```coffeescript
fsUtils = require 'fs-utils'
path = require 'path'
_ = require 'underscore'
archive = require 'ls-archive'
File = require 'file'

module.exports=
class ArchiveEditSession
  registerDeserializer(this)
  @version: 1

  @activate: ->
    Project = require 'project'
    Project.registerOpener (filePath) ->
      new ArchiveEditSession(filePath) if archive.isPathSupported(filePath)

  @deserialize: ({path}={}) ->
    path = project.resolve(path)
    if fsUtils.isFileSync(path)
      new ArchiveEditSession(path)
    else
      console.warn "Could not build archive edit session for path '#{path}' because that file no longer exists"

  constructor: (@path) ->
    @file = new File(@path)

  destroy: ->
    @file?.off()

  serialize: ->
    deserializer: 'ArchiveEditSession'
    path: @getUri()

  getViewClass: ->
    require './archive-view'

  getTitle: ->
    if archivePath = @getPath()
      path.basename(archivePath)
    else
      'untitled'

  getUri: -> project?.relativize(@getPath()) ? @getPath()

  getPath: -> @path

  isEqual: (other) ->
    other instanceof ArchiveEditSession and @getUri() is other.getUri()
```

Store archive edit session state in a telepath document
user
```coffeescript
path = require 'path'

_ = require 'underscore'
archive = require 'ls-archive'
telepath = require 'telepath'

fsUtils = require 'fs-utils'
File = require 'file'

module.exports=
class ArchiveEditSession
  @acceptsDocuments: true
  registerDeserializer(this)
  @version: 1

  @activate: ->
    Project = require 'project'
    Project.registerOpener (filePath) ->
      new ArchiveEditSession(path: filePath) if archive.isPathSupported(filePath)

  @deserialize: (state) ->
    relativePath = state.get('relativePath')
    resolvedPath = project.resolve(relativePath) if relativePath
    if fsUtils.isFileSync(resolvedPath)
      new ArchiveEditSession(state)
    else
      console.warn "Could not build archive edit session for path '#{relativePath}' because that file no longer exists"

  constructor: (optionsOrState) ->
    if optionsOrState instanceof telepath.Document
      @state = optionsOrState
      resolvedPath = project.resolve(@getRelativePath())
    else
      resolvedPath = optionsOrState.path
      @state = site.createDocument
        deserializer: @constructor.name
        version: @constructor.version
        relativePath: project.relativize(resolvedPath)

    @file = new File(resolvedPath)

  destroy: -> @file?.off()

  serialize: -> @state.clone()

  getState: -> @state

  getViewClass: -> require './archive-view'

  getTitle: ->
    if archivePath = @getPath()
      path.basename(archivePath)
    else
      'untitled'

  getUri: -> @getRelativePath()

  getRelativePath: -> @state.get('relativePath')

  getPath: -> @file.getPath()

  isEqual: (other) ->
    other instanceof ArchiveEditSession and @getUri() is other.getUri()
```
assistant