@celljs/ta-host 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +34 -4
- package/README.md +33 -3
- package/cell.schema.json +4 -0
- package/cell.yml +2 -0
- package/esm/node/auth-server-impl.d.ts +2 -0
- package/esm/node/auth-server-impl.js +7 -0
- package/esm/node/client-tool-broker.d.ts +11 -3
- package/esm/node/client-tool-broker.js +23 -3
- package/esm/node/extension-providers.d.ts +22 -0
- package/esm/node/extension-providers.js +52 -0
- package/esm/node/host-protocol.d.ts +22 -1
- package/esm/node/host-protocol.js +1 -0
- package/esm/node/index.d.ts +6 -0
- package/esm/node/index.js +6 -0
- package/esm/node/live-run.d.ts +22 -0
- package/esm/node/live-run.js +58 -0
- package/esm/node/message-page.d.ts +17 -0
- package/esm/node/message-page.js +71 -0
- package/esm/node/package-host-extension.d.ts +4 -2
- package/esm/node/package-host-extension.js +4 -3
- package/esm/node/package-hosts.d.ts +2 -2
- package/esm/node/package-hosts.js +2 -0
- package/esm/node/package-server-impl.d.ts +9 -1
- package/esm/node/package-server-impl.js +16 -1
- package/esm/node/relay-bridge.d.ts +9 -1
- package/esm/node/relay-bridge.js +44 -4
- package/esm/node/remote-ui-context.d.ts +6 -1
- package/esm/node/remote-ui-context.js +31 -3
- package/esm/node/session-catalog.d.ts +69 -0
- package/esm/node/session-catalog.js +211 -0
- package/esm/node/session-files.d.ts +18 -0
- package/esm/node/session-files.js +32 -0
- package/esm/node/session-info-util.d.ts +4 -1
- package/esm/node/session-info-util.js +8 -3
- package/esm/node/settings-server-impl.d.ts +1 -0
- package/esm/node/settings-server-impl.js +8 -0
- package/esm/node/settings-store.d.ts +3 -1
- package/esm/node/settings-store.js +25 -3
- package/esm/node/sign-in/access-server-impl.d.ts +19 -0
- package/esm/node/sign-in/access-server-impl.js +82 -0
- package/esm/node/sign-in/access-store.d.ts +65 -0
- package/esm/node/sign-in/access-store.js +175 -0
- package/esm/node/sign-in/index.d.ts +7 -0
- package/esm/node/sign-in/index.js +8 -0
- package/esm/node/sign-in/sign-in-flow.d.ts +58 -0
- package/esm/node/sign-in/sign-in-flow.js +104 -0
- package/esm/node/sign-in/sign-in-middleware.d.ts +10 -0
- package/esm/node/sign-in/sign-in-middleware.js +48 -0
- package/esm/node/sign-in/sign-in-pages.d.ts +31 -0
- package/esm/node/sign-in/sign-in-pages.js +118 -0
- package/esm/node/sign-in/sign-in-provider.d.ts +135 -0
- package/esm/node/sign-in/sign-in-provider.js +225 -0
- package/esm/node/sign-in/ta-sign-in.d.ts +10 -0
- package/esm/node/sign-in/ta-sign-in.js +32 -0
- package/esm/node/ta-access.d.ts +7 -0
- package/esm/node/ta-access.js +30 -1
- package/esm/node/ta-server-impl.d.ts +8 -3
- package/esm/node/ta-server-impl.js +25 -6
- package/esm/node/ta-session-factory.d.ts +4 -1
- package/esm/node/ta-session-factory.js +30 -7
- package/esm/node/ta-session-registry.d.ts +2 -0
- package/esm/node/ta-session-registry.js +23 -3
- package/esm/node/ta-session.d.ts +24 -2
- package/esm/node/ta-session.js +84 -6
- package/esm/node/temporary-packages.d.ts +46 -0
- package/esm/node/temporary-packages.js +114 -0
- package/esm/node/temporary-purge.d.ts +13 -0
- package/esm/node/temporary-purge.js +51 -0
- package/esm/node/terminal-service.d.ts +18 -2
- package/esm/node/terminal-service.js +45 -9
- package/esm/node/terminal-util.d.ts +14 -0
- package/esm/node/terminal-util.js +30 -1
- package/esm/node/web-extension-catalog.d.ts +28 -1
- package/esm/node/web-extension-catalog.js +173 -5
- package/esm/node/web-extension-util.d.ts +5 -1
- package/esm/node/web-extension-util.js +36 -5
- package/esm/node/workspace-protocol.d.ts +2 -0
- package/esm/node/workspace-server-impl.d.ts +2 -1
- package/esm/node/workspace-server-impl.js +13 -1
- package/esm/node/workspace-service.d.ts +1 -0
- package/esm/node/workspace-service.js +13 -1
- package/lib/node/auth-server-impl.d.ts +2 -0
- package/lib/node/auth-server-impl.js +7 -0
- package/lib/node/client-tool-broker.d.ts +11 -3
- package/lib/node/client-tool-broker.js +23 -3
- package/lib/node/extension-providers.d.ts +23 -0
- package/lib/node/extension-providers.js +55 -0
- package/lib/node/host-protocol.d.ts +22 -1
- package/lib/node/host-protocol.js +2 -1
- package/lib/node/index.d.ts +6 -0
- package/lib/node/index.js +6 -0
- package/lib/node/live-run.d.ts +23 -0
- package/lib/node/live-run.js +62 -0
- package/lib/node/message-page.d.ts +18 -0
- package/lib/node/message-page.js +74 -0
- package/lib/node/package-host-extension.d.ts +4 -2
- package/lib/node/package-host-extension.js +4 -3
- package/lib/node/package-hosts.d.ts +2 -2
- package/lib/node/package-hosts.js +2 -0
- package/lib/node/package-server-impl.d.ts +9 -1
- package/lib/node/package-server-impl.js +15 -0
- package/lib/node/relay-bridge.d.ts +9 -1
- package/lib/node/relay-bridge.js +43 -3
- package/lib/node/remote-ui-context.d.ts +6 -1
- package/lib/node/remote-ui-context.js +31 -3
- package/lib/node/session-catalog.d.ts +70 -0
- package/lib/node/session-catalog.js +214 -0
- package/lib/node/session-files.d.ts +19 -0
- package/lib/node/session-files.js +36 -0
- package/lib/node/session-info-util.d.ts +4 -1
- package/lib/node/session-info-util.js +7 -2
- package/lib/node/settings-server-impl.d.ts +1 -0
- package/lib/node/settings-server-impl.js +8 -0
- package/lib/node/settings-store.d.ts +3 -1
- package/lib/node/settings-store.js +25 -3
- package/lib/node/sign-in/access-server-impl.d.ts +20 -0
- package/lib/node/sign-in/access-server-impl.js +85 -0
- package/lib/node/sign-in/access-store.d.ts +66 -0
- package/lib/node/sign-in/access-store.js +179 -0
- package/lib/node/sign-in/index.d.ts +8 -0
- package/lib/node/sign-in/index.js +24 -0
- package/lib/node/sign-in/sign-in-flow.d.ts +59 -0
- package/lib/node/sign-in/sign-in-flow.js +108 -0
- package/lib/node/sign-in/sign-in-middleware.d.ts +11 -0
- package/lib/node/sign-in/sign-in-middleware.js +51 -0
- package/lib/node/sign-in/sign-in-pages.d.ts +32 -0
- package/lib/node/sign-in/sign-in-pages.js +121 -0
- package/lib/node/sign-in/sign-in-provider.d.ts +136 -0
- package/lib/node/sign-in/sign-in-provider.js +232 -0
- package/lib/node/sign-in/ta-sign-in.d.ts +11 -0
- package/lib/node/sign-in/ta-sign-in.js +35 -0
- package/lib/node/ta-access.d.ts +7 -0
- package/lib/node/ta-access.js +30 -1
- package/lib/node/ta-server-impl.d.ts +8 -3
- package/lib/node/ta-server-impl.js +24 -5
- package/lib/node/ta-session-factory.d.ts +4 -1
- package/lib/node/ta-session-factory.js +30 -7
- package/lib/node/ta-session-registry.d.ts +2 -0
- package/lib/node/ta-session-registry.js +23 -3
- package/lib/node/ta-session.d.ts +24 -2
- package/lib/node/ta-session.js +84 -6
- package/lib/node/temporary-packages.d.ts +47 -0
- package/lib/node/temporary-packages.js +118 -0
- package/lib/node/temporary-purge.d.ts +14 -0
- package/lib/node/temporary-purge.js +54 -0
- package/lib/node/terminal-service.d.ts +18 -2
- package/lib/node/terminal-service.js +44 -8
- package/lib/node/terminal-util.d.ts +14 -0
- package/lib/node/terminal-util.js +30 -1
- package/lib/node/web-extension-catalog.d.ts +28 -1
- package/lib/node/web-extension-catalog.js +172 -4
- package/lib/node/web-extension-util.d.ts +5 -1
- package/lib/node/web-extension-util.js +36 -5
- package/lib/node/workspace-protocol.d.ts +2 -0
- package/lib/node/workspace-server-impl.d.ts +2 -1
- package/lib/node/workspace-server-impl.js +12 -0
- package/lib/node/workspace-service.d.ts +1 -0
- package/lib/node/workspace-service.js +13 -1
- package/package.json +17 -12
- package/esm/node/auth-server-impl.js.map +0 -1
- package/esm/node/client-channel.js.map +0 -1
- package/esm/node/client-tool-broker.js.map +0 -1
- package/esm/node/event-log.js.map +0 -1
- package/esm/node/exec-environment-factory.js.map +0 -1
- package/esm/node/extension-data-notifier.js.map +0 -1
- package/esm/node/extension-data.js.map +0 -1
- package/esm/node/host-protocol.js.map +0 -1
- package/esm/node/index.js.map +0 -1
- package/esm/node/module.js.map +0 -1
- package/esm/node/package-host-extension.js.map +0 -1
- package/esm/node/package-hosts.js.map +0 -1
- package/esm/node/package-server-impl.js.map +0 -1
- package/esm/node/package-switch.js.map +0 -1
- package/esm/node/receipt-book.js.map +0 -1
- package/esm/node/relay-bridge.js.map +0 -1
- package/esm/node/remote/index.js.map +0 -1
- package/esm/node/remote/pi-directories.js.map +0 -1
- package/esm/node/remote/port-forwards.js.map +0 -1
- package/esm/node/remote/remote-hosts.js.map +0 -1
- package/esm/node/remote/remote-protocol.js.map +0 -1
- package/esm/node/remote/remote-server-impl.js.map +0 -1
- package/esm/node/remote-ui-context.js.map +0 -1
- package/esm/node/session-info-util.js.map +0 -1
- package/esm/node/session-storage/file-session-storage.js.map +0 -1
- package/esm/node/session-storage/index.js.map +0 -1
- package/esm/node/session-storage/session-storage-protocol.js.map +0 -1
- package/esm/node/session-storage/stored-session.js.map +0 -1
- package/esm/node/settings-server-impl.js.map +0 -1
- package/esm/node/settings-store.js.map +0 -1
- package/esm/node/ta-access.js.map +0 -1
- package/esm/node/ta-errors.js.map +0 -1
- package/esm/node/ta-event-util.js.map +0 -1
- package/esm/node/ta-server-impl.js.map +0 -1
- package/esm/node/ta-session-factory.js.map +0 -1
- package/esm/node/ta-session-registry.js.map +0 -1
- package/esm/node/ta-session.js.map +0 -1
- package/esm/node/terminal-protocol.js.map +0 -1
- package/esm/node/terminal-service.js.map +0 -1
- package/esm/node/terminal-util.js.map +0 -1
- package/esm/node/web-extension-catalog.js.map +0 -1
- package/esm/node/web-extension-util.js.map +0 -1
- package/esm/node/working-directory.js.map +0 -1
- package/esm/node/workspace-files.js.map +0 -1
- package/esm/node/workspace-protocol.js.map +0 -1
- package/esm/node/workspace-server-impl.js.map +0 -1
- package/esm/node/workspace-service.js.map +0 -1
- package/esm/node/workspace-util.js.map +0 -1
- package/lib/node/auth-server-impl.d.ts.map +0 -1
- package/lib/node/auth-server-impl.js.map +0 -1
- package/lib/node/auth-server-impl.spec.d.ts +0 -2
- package/lib/node/auth-server-impl.spec.d.ts.map +0 -1
- package/lib/node/auth-server-impl.spec.js +0 -47
- package/lib/node/auth-server-impl.spec.js.map +0 -1
- package/lib/node/client-channel.d.ts.map +0 -1
- package/lib/node/client-channel.js.map +0 -1
- package/lib/node/client-channel.spec.d.ts +0 -2
- package/lib/node/client-channel.spec.d.ts.map +0 -1
- package/lib/node/client-channel.spec.js +0 -106
- package/lib/node/client-channel.spec.js.map +0 -1
- package/lib/node/client-tool-broker.d.ts.map +0 -1
- package/lib/node/client-tool-broker.js.map +0 -1
- package/lib/node/client-tool-broker.spec.d.ts +0 -2
- package/lib/node/client-tool-broker.spec.d.ts.map +0 -1
- package/lib/node/client-tool-broker.spec.js +0 -49
- package/lib/node/client-tool-broker.spec.js.map +0 -1
- package/lib/node/event-log.d.ts.map +0 -1
- package/lib/node/event-log.js.map +0 -1
- package/lib/node/event-log.spec.d.ts +0 -2
- package/lib/node/event-log.spec.d.ts.map +0 -1
- package/lib/node/event-log.spec.js +0 -48
- package/lib/node/event-log.spec.js.map +0 -1
- package/lib/node/exec-environment-factory.d.ts.map +0 -1
- package/lib/node/exec-environment-factory.js.map +0 -1
- package/lib/node/extension-data-notifier.d.ts.map +0 -1
- package/lib/node/extension-data-notifier.js.map +0 -1
- package/lib/node/extension-data-notifier.spec.d.ts +0 -2
- package/lib/node/extension-data-notifier.spec.d.ts.map +0 -1
- package/lib/node/extension-data-notifier.spec.js +0 -35
- package/lib/node/extension-data-notifier.spec.js.map +0 -1
- package/lib/node/extension-data.d.ts.map +0 -1
- package/lib/node/extension-data.js.map +0 -1
- package/lib/node/extension-data.spec.d.ts +0 -2
- package/lib/node/extension-data.spec.d.ts.map +0 -1
- package/lib/node/extension-data.spec.js +0 -99
- package/lib/node/extension-data.spec.js.map +0 -1
- package/lib/node/host-protocol.d.ts.map +0 -1
- package/lib/node/host-protocol.js.map +0 -1
- package/lib/node/index.d.ts.map +0 -1
- package/lib/node/index.js.map +0 -1
- package/lib/node/module.d.ts.map +0 -1
- package/lib/node/module.js.map +0 -1
- package/lib/node/package-host-extension.d.ts.map +0 -1
- package/lib/node/package-host-extension.js.map +0 -1
- package/lib/node/package-hosts.d.ts.map +0 -1
- package/lib/node/package-hosts.js.map +0 -1
- package/lib/node/package-hosts.spec.d.ts +0 -2
- package/lib/node/package-hosts.spec.d.ts.map +0 -1
- package/lib/node/package-hosts.spec.js +0 -53
- package/lib/node/package-hosts.spec.js.map +0 -1
- package/lib/node/package-server-impl.d.ts.map +0 -1
- package/lib/node/package-server-impl.js.map +0 -1
- package/lib/node/package-switch.d.ts.map +0 -1
- package/lib/node/package-switch.js.map +0 -1
- package/lib/node/receipt-book.d.ts.map +0 -1
- package/lib/node/receipt-book.js.map +0 -1
- package/lib/node/receipt-book.spec.d.ts +0 -2
- package/lib/node/receipt-book.spec.d.ts.map +0 -1
- package/lib/node/receipt-book.spec.js +0 -39
- package/lib/node/receipt-book.spec.js.map +0 -1
- package/lib/node/relay-bridge.d.ts.map +0 -1
- package/lib/node/relay-bridge.js.map +0 -1
- package/lib/node/remote/index.d.ts.map +0 -1
- package/lib/node/remote/index.js.map +0 -1
- package/lib/node/remote/pi-directories.d.ts.map +0 -1
- package/lib/node/remote/pi-directories.js.map +0 -1
- package/lib/node/remote/port-forwards.d.ts.map +0 -1
- package/lib/node/remote/port-forwards.js.map +0 -1
- package/lib/node/remote/remote-hosts.d.ts.map +0 -1
- package/lib/node/remote/remote-hosts.js.map +0 -1
- package/lib/node/remote/remote-protocol.d.ts.map +0 -1
- package/lib/node/remote/remote-protocol.js.map +0 -1
- package/lib/node/remote/remote-server-impl.d.ts.map +0 -1
- package/lib/node/remote/remote-server-impl.js.map +0 -1
- package/lib/node/remote/remote.spec.d.ts +0 -2
- package/lib/node/remote/remote.spec.d.ts.map +0 -1
- package/lib/node/remote/remote.spec.js +0 -130
- package/lib/node/remote/remote.spec.js.map +0 -1
- package/lib/node/remote-ui-context.d.ts.map +0 -1
- package/lib/node/remote-ui-context.js.map +0 -1
- package/lib/node/remote-ui-context.spec.d.ts +0 -2
- package/lib/node/remote-ui-context.spec.d.ts.map +0 -1
- package/lib/node/remote-ui-context.spec.js +0 -62
- package/lib/node/remote-ui-context.spec.js.map +0 -1
- package/lib/node/session-info-util.d.ts.map +0 -1
- package/lib/node/session-info-util.js.map +0 -1
- package/lib/node/session-info-util.spec.d.ts +0 -2
- package/lib/node/session-info-util.spec.d.ts.map +0 -1
- package/lib/node/session-info-util.spec.js +0 -22
- package/lib/node/session-info-util.spec.js.map +0 -1
- package/lib/node/session-storage/file-session-storage.d.ts.map +0 -1
- package/lib/node/session-storage/file-session-storage.js.map +0 -1
- package/lib/node/session-storage/file-session-storage.spec.d.ts +0 -2
- package/lib/node/session-storage/file-session-storage.spec.d.ts.map +0 -1
- package/lib/node/session-storage/file-session-storage.spec.js +0 -70
- package/lib/node/session-storage/file-session-storage.spec.js.map +0 -1
- package/lib/node/session-storage/index.d.ts.map +0 -1
- package/lib/node/session-storage/index.js.map +0 -1
- package/lib/node/session-storage/session-storage-protocol.d.ts.map +0 -1
- package/lib/node/session-storage/session-storage-protocol.js.map +0 -1
- package/lib/node/session-storage/stored-session.d.ts.map +0 -1
- package/lib/node/session-storage/stored-session.js.map +0 -1
- package/lib/node/session-storage/stored-session.spec.d.ts +0 -2
- package/lib/node/session-storage/stored-session.spec.d.ts.map +0 -1
- package/lib/node/session-storage/stored-session.spec.js +0 -73
- package/lib/node/session-storage/stored-session.spec.js.map +0 -1
- package/lib/node/settings-server-impl.d.ts.map +0 -1
- package/lib/node/settings-server-impl.js.map +0 -1
- package/lib/node/settings-store.d.ts.map +0 -1
- package/lib/node/settings-store.js.map +0 -1
- package/lib/node/settings-store.spec.d.ts +0 -2
- package/lib/node/settings-store.spec.d.ts.map +0 -1
- package/lib/node/settings-store.spec.js +0 -146
- package/lib/node/settings-store.spec.js.map +0 -1
- package/lib/node/ta-access.d.ts.map +0 -1
- package/lib/node/ta-access.js.map +0 -1
- package/lib/node/ta-access.spec.d.ts +0 -2
- package/lib/node/ta-access.spec.d.ts.map +0 -1
- package/lib/node/ta-access.spec.js +0 -33
- package/lib/node/ta-access.spec.js.map +0 -1
- package/lib/node/ta-errors.d.ts.map +0 -1
- package/lib/node/ta-errors.js.map +0 -1
- package/lib/node/ta-errors.spec.d.ts +0 -2
- package/lib/node/ta-errors.spec.d.ts.map +0 -1
- package/lib/node/ta-errors.spec.js +0 -25
- package/lib/node/ta-errors.spec.js.map +0 -1
- package/lib/node/ta-event-util.d.ts.map +0 -1
- package/lib/node/ta-event-util.js.map +0 -1
- package/lib/node/ta-event-util.spec.d.ts +0 -2
- package/lib/node/ta-event-util.spec.d.ts.map +0 -1
- package/lib/node/ta-event-util.spec.js +0 -28
- package/lib/node/ta-event-util.spec.js.map +0 -1
- package/lib/node/ta-server-impl.d.ts.map +0 -1
- package/lib/node/ta-server-impl.js.map +0 -1
- package/lib/node/ta-session-factory.d.ts.map +0 -1
- package/lib/node/ta-session-factory.js.map +0 -1
- package/lib/node/ta-session-registry.d.ts.map +0 -1
- package/lib/node/ta-session-registry.js.map +0 -1
- package/lib/node/ta-session.d.ts.map +0 -1
- package/lib/node/ta-session.js.map +0 -1
- package/lib/node/terminal-protocol.d.ts.map +0 -1
- package/lib/node/terminal-protocol.js.map +0 -1
- package/lib/node/terminal-service.d.ts.map +0 -1
- package/lib/node/terminal-service.js.map +0 -1
- package/lib/node/terminal-service.spec.d.ts +0 -2
- package/lib/node/terminal-service.spec.d.ts.map +0 -1
- package/lib/node/terminal-service.spec.js +0 -79
- package/lib/node/terminal-service.spec.js.map +0 -1
- package/lib/node/terminal-util.d.ts.map +0 -1
- package/lib/node/terminal-util.js.map +0 -1
- package/lib/node/terminal-util.spec.d.ts +0 -2
- package/lib/node/terminal-util.spec.d.ts.map +0 -1
- package/lib/node/terminal-util.spec.js +0 -71
- package/lib/node/terminal-util.spec.js.map +0 -1
- package/lib/node/web-extension-catalog.d.ts.map +0 -1
- package/lib/node/web-extension-catalog.js.map +0 -1
- package/lib/node/web-extension-catalog.spec.d.ts +0 -2
- package/lib/node/web-extension-catalog.spec.d.ts.map +0 -1
- package/lib/node/web-extension-catalog.spec.js +0 -157
- package/lib/node/web-extension-catalog.spec.js.map +0 -1
- package/lib/node/web-extension-util.d.ts.map +0 -1
- package/lib/node/web-extension-util.js.map +0 -1
- package/lib/node/working-directory.d.ts.map +0 -1
- package/lib/node/working-directory.js.map +0 -1
- package/lib/node/workspace-files.d.ts.map +0 -1
- package/lib/node/workspace-files.js.map +0 -1
- package/lib/node/workspace-files.spec.d.ts +0 -2
- package/lib/node/workspace-files.spec.d.ts.map +0 -1
- package/lib/node/workspace-files.spec.js +0 -133
- package/lib/node/workspace-files.spec.js.map +0 -1
- package/lib/node/workspace-protocol.d.ts.map +0 -1
- package/lib/node/workspace-protocol.js.map +0 -1
- package/lib/node/workspace-server-impl.d.ts.map +0 -1
- package/lib/node/workspace-server-impl.js.map +0 -1
- package/lib/node/workspace-service.d.ts.map +0 -1
- package/lib/node/workspace-service.js.map +0 -1
- package/lib/node/workspace-service.spec.d.ts +0 -2
- package/lib/node/workspace-service.spec.d.ts.map +0 -1
- package/lib/node/workspace-service.spec.js +0 -104
- package/lib/node/workspace-service.spec.js.map +0 -1
- package/lib/node/workspace-util.d.ts.map +0 -1
- package/lib/node/workspace-util.js.map +0 -1
- package/lib/node/workspace-util.spec.d.ts +0 -2
- package/lib/node/workspace-util.spec.d.ts.map +0 -1
- package/lib/node/workspace-util.spec.js +0 -44
- package/lib/node/workspace-util.spec.js.map +0 -1
- package/src/node/auth-server-impl.spec.ts +0 -49
- package/src/node/auth-server-impl.ts +0 -252
- package/src/node/client-channel.spec.ts +0 -117
- package/src/node/client-channel.ts +0 -94
- package/src/node/client-tool-broker.spec.ts +0 -53
- package/src/node/client-tool-broker.ts +0 -106
- package/src/node/event-log.spec.ts +0 -52
- package/src/node/event-log.ts +0 -59
- package/src/node/exec-environment-factory.ts +0 -66
- package/src/node/extension-data-notifier.spec.ts +0 -34
- package/src/node/extension-data-notifier.ts +0 -124
- package/src/node/extension-data.spec.ts +0 -105
- package/src/node/extension-data.ts +0 -180
- package/src/node/host-protocol.ts +0 -62
- package/src/node/index.ts +0 -37
- package/src/node/module.ts +0 -4
- package/src/node/package-host-extension.ts +0 -20
- package/src/node/package-hosts.spec.ts +0 -54
- package/src/node/package-hosts.ts +0 -202
- package/src/node/package-server-impl.ts +0 -87
- package/src/node/package-switch.ts +0 -80
- package/src/node/receipt-book.spec.ts +0 -41
- package/src/node/receipt-book.ts +0 -40
- package/src/node/relay-bridge.ts +0 -94
- package/src/node/remote/index.ts +0 -5
- package/src/node/remote/pi-directories.ts +0 -49
- package/src/node/remote/port-forwards.ts +0 -148
- package/src/node/remote/remote-hosts.ts +0 -170
- package/src/node/remote/remote-protocol.ts +0 -57
- package/src/node/remote/remote-server-impl.ts +0 -60
- package/src/node/remote/remote.spec.ts +0 -142
- package/src/node/remote-ui-context.spec.ts +0 -68
- package/src/node/remote-ui-context.ts +0 -168
- package/src/node/session-info-util.spec.ts +0 -23
- package/src/node/session-info-util.ts +0 -55
- package/src/node/session-storage/file-session-storage.spec.ts +0 -72
- package/src/node/session-storage/file-session-storage.ts +0 -145
- package/src/node/session-storage/index.ts +0 -3
- package/src/node/session-storage/session-storage-protocol.ts +0 -81
- package/src/node/session-storage/stored-session.spec.ts +0 -80
- package/src/node/session-storage/stored-session.ts +0 -149
- package/src/node/settings-server-impl.ts +0 -33
- package/src/node/settings-store.spec.ts +0 -156
- package/src/node/settings-store.ts +0 -314
- package/src/node/ta-access.spec.ts +0 -36
- package/src/node/ta-access.ts +0 -156
- package/src/node/ta-errors.spec.ts +0 -25
- package/src/node/ta-errors.ts +0 -75
- package/src/node/ta-event-util.spec.ts +0 -29
- package/src/node/ta-event-util.ts +0 -23
- package/src/node/ta-server-impl.ts +0 -341
- package/src/node/ta-session-factory.ts +0 -203
- package/src/node/ta-session-registry.ts +0 -75
- package/src/node/ta-session.ts +0 -240
- package/src/node/terminal-protocol.ts +0 -18
- package/src/node/terminal-service.spec.ts +0 -84
- package/src/node/terminal-service.ts +0 -259
- package/src/node/terminal-util.spec.ts +0 -78
- package/src/node/terminal-util.ts +0 -166
- package/src/node/web-extension-catalog.spec.ts +0 -172
- package/src/node/web-extension-catalog.ts +0 -177
- package/src/node/web-extension-util.ts +0 -144
- package/src/node/working-directory.ts +0 -71
- package/src/node/workspace-files.spec.ts +0 -145
- package/src/node/workspace-files.ts +0 -256
- package/src/node/workspace-protocol.ts +0 -22
- package/src/node/workspace-server-impl.ts +0 -90
- package/src/node/workspace-service.spec.ts +0 -113
- package/src/node/workspace-service.ts +0 -223
- package/src/node/workspace-util.spec.ts +0 -47
- package/src/node/workspace-util.ts +0 -103
|
@@ -14,7 +14,7 @@ export interface PackageHosts {
|
|
|
14
14
|
/** Starts the hosts of the packages that are on and stops those turned off. */
|
|
15
15
|
sync(): Promise<void>;
|
|
16
16
|
/** For a pi extension of the package `name`. */
|
|
17
|
-
answer(name: string): Promise<TaHostAnswer
|
|
17
|
+
answer(name: string): Promise<Omit<TaHostAnswer, 'files'>>;
|
|
18
18
|
/** A method of what the host of the package `name` returned, for its web extension (TaPackageServer.callPackageHost). */
|
|
19
19
|
call(name: string, method: string, params: unknown[]): Promise<unknown>;
|
|
20
20
|
}
|
|
@@ -38,7 +38,7 @@ export declare class PackageHostsImpl implements PackageHosts, ApplicationLifecy
|
|
|
38
38
|
onStart(): Promise<void>;
|
|
39
39
|
onStop(): void;
|
|
40
40
|
sync(): Promise<void>;
|
|
41
|
-
answer(name: string): Promise<TaHostAnswer
|
|
41
|
+
answer(name: string): Promise<Omit<TaHostAnswer, 'files'>>;
|
|
42
42
|
call(name: string, method: string, params: unknown[]): Promise<unknown>;
|
|
43
43
|
protected start(name: string, file: string): Running;
|
|
44
44
|
protected stop(name: string): Promise<void>;
|
|
@@ -155,9 +155,11 @@ let PackageHostsImpl = class PackageHostsImpl {
|
|
|
155
155
|
getServerInfo: () => server.getServerInfo(),
|
|
156
156
|
listSessions: () => server.listSessions(),
|
|
157
157
|
openSession: options => server.openSession(options),
|
|
158
|
+
closeSession: sessionId => server.closeSession(sessionId),
|
|
158
159
|
setSessionName: (sessionId, name) => server.setSessionName(sessionId, name),
|
|
159
160
|
prompt: (sessionId, input) => server.prompt(sessionId, input),
|
|
160
161
|
followUp: (sessionId, input) => server.followUp(sessionId, input),
|
|
162
|
+
abort: sessionId => server.abort(sessionId),
|
|
161
163
|
getState: sessionId => server.getState(sessionId),
|
|
162
164
|
getLastAssistantText: sessionId => server.getLastAssistantText(sessionId),
|
|
163
165
|
getExtensionData: (name, key, cwd) => packages.getExtensionData(name, key, cwd),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExecEnvironmentFactory } from '@celljs/ta-exec';
|
|
2
|
-
import { type TaPackageInfo, TaPackageServer, type TaSettingsScope, type TaWebExtensionInfo, type TaWebExtensionSource } from '@celljs/ta-protocol';
|
|
2
|
+
import { type TaPackageInfo, TaPackageServer, type TaSettingsScope, type TaTemporaryFrom, type TaWebExtensionInfo, type TaWebExtensionSource } from '@celljs/ta-protocol';
|
|
3
3
|
import { ExtensionDataStore } from './extension-data';
|
|
4
4
|
import { ExtensionDataNotifier } from './extension-data-notifier';
|
|
5
5
|
import { WebExtensionCatalog } from './host-protocol';
|
|
@@ -21,6 +21,14 @@ export declare class TaPackageServerImpl implements TaPackageServer {
|
|
|
21
21
|
callPackageHost(name: string, method: string, params?: unknown[]): Promise<unknown>;
|
|
22
22
|
getExtensionData(name: string, key: string, cwd?: string): Promise<unknown>;
|
|
23
23
|
setExtensionData(name: string, key: string, value: unknown, cwd?: string): Promise<void>;
|
|
24
|
+
openTemporaryPackage(source: string, from: TaTemporaryFrom): Promise<TaWebExtensionInfo[]>;
|
|
25
|
+
updateTemporaryPackage(id: string, change: {
|
|
26
|
+
used?: boolean;
|
|
27
|
+
kept?: boolean;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
installTemporaryPackage(id: string): Promise<void>;
|
|
30
|
+
getTemporaryRetention(): Promise<number>;
|
|
31
|
+
setTemporaryRetention(days: number): Promise<void>;
|
|
24
32
|
protected cwd(cwd?: string): Promise<string>;
|
|
25
33
|
}
|
|
26
34
|
//# sourceMappingURL=package-server-impl.d.ts.map
|
|
@@ -66,6 +66,21 @@ let TaPackageServerImpl = class TaPackageServerImpl {
|
|
|
66
66
|
setExtensionData(name, key, value, cwd) {
|
|
67
67
|
return ta_errors_1.TaErrors.guard(() => this.extensionData.set(name, key, value, cwd));
|
|
68
68
|
}
|
|
69
|
+
openTemporaryPackage(source, from) {
|
|
70
|
+
return ta_errors_1.TaErrors.guard(async () => this.webExtensions.openTemporary(await this.cwd(), source, from));
|
|
71
|
+
}
|
|
72
|
+
updateTemporaryPackage(id, change) {
|
|
73
|
+
return ta_errors_1.TaErrors.guard(async () => this.webExtensions.updateTemporary(await this.cwd(), id, change !== null && change !== void 0 ? change : {}));
|
|
74
|
+
}
|
|
75
|
+
installTemporaryPackage(id) {
|
|
76
|
+
return ta_errors_1.TaErrors.guard(async () => this.webExtensions.installTemporary(await this.cwd(), id));
|
|
77
|
+
}
|
|
78
|
+
getTemporaryRetention() {
|
|
79
|
+
return ta_errors_1.TaErrors.guard(async () => this.webExtensions.temporaryRetention);
|
|
80
|
+
}
|
|
81
|
+
setTemporaryRetention(days) {
|
|
82
|
+
return ta_errors_1.TaErrors.guard(async () => this.webExtensions.setTemporaryRetention(days));
|
|
83
|
+
}
|
|
69
84
|
async cwd(cwd) {
|
|
70
85
|
return cwd || (await this.environments.defaultCwd());
|
|
71
86
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import { type Application, ApplicationLifecycle } from '@celljs/core';
|
|
3
|
-
import {
|
|
3
|
+
import { ExecEnvironmentFactory } from '@celljs/ta-exec';
|
|
4
|
+
import { type TaPackageShare, type TaRelayDevice, type TaRelayInfo, TaRelayServer } from '@celljs/ta-protocol';
|
|
4
5
|
import { RelayHost, RelayStore } from '@celljs/ta-relay/lib/node';
|
|
5
6
|
import { ServerAware } from '@celljs/web/lib/node';
|
|
7
|
+
import { WebExtensionCatalog } from './host-protocol';
|
|
6
8
|
import { type TaAccess } from './ta-access';
|
|
7
9
|
/** The id of {@link RelayBridge}, for TaRelayServerImpl. */
|
|
8
10
|
export declare const RELAY_BRIDGE: unique symbol;
|
|
@@ -20,11 +22,17 @@ export declare class RelayBridge implements ServerAware, ApplicationLifecycle<Ap
|
|
|
20
22
|
refresh(): void;
|
|
21
23
|
setServer(server: Server): Promise<void>;
|
|
22
24
|
onStop(): Promise<void>;
|
|
25
|
+
/** A package as it goes by a link: a gzipped tar of its directory, without node_modules and .git. */
|
|
26
|
+
static pack(root: string): Promise<Uint8Array>;
|
|
23
27
|
protected start(server: Server): void;
|
|
24
28
|
}
|
|
25
29
|
/** `ta pair` for clients: the devices of relay.json, which RelayBridge serves. Their keys never leave, but in the link of a new one. */
|
|
26
30
|
export declare class TaRelayServerImpl implements TaRelayServer {
|
|
27
31
|
protected readonly bridge: RelayBridge;
|
|
32
|
+
protected readonly catalog: WebExtensionCatalog;
|
|
33
|
+
protected readonly environments: ExecEnvironmentFactory;
|
|
34
|
+
sharePackage(id: string): Promise<TaPackageShare>;
|
|
35
|
+
unsharePackage(id: string): Promise<void>;
|
|
28
36
|
getRelay(): Promise<TaRelayInfo>;
|
|
29
37
|
pair(relay: string, name: string): Promise<{
|
|
30
38
|
link: string;
|
package/lib/node/relay-bridge.js
CHANGED
|
@@ -8,15 +8,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var RelayBridge_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.TaRelayServerImpl = exports.RelayBridge = exports.RELAY_BRIDGE = void 0;
|
|
13
14
|
const node_fs_1 = require("node:fs");
|
|
15
|
+
const node_path_1 = require("node:path");
|
|
14
16
|
const core_1 = require("@celljs/core");
|
|
15
17
|
const rpc_1 = require("@celljs/rpc");
|
|
18
|
+
const ta_exec_1 = require("@celljs/ta-exec");
|
|
19
|
+
const package_archive_1 = require("@celljs/ta-harness/lib/node/package-archive");
|
|
16
20
|
const ta_brand_1 = require("@celljs/ta-harness/lib/node/ta-brand");
|
|
17
21
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
18
22
|
const node_1 = require("@celljs/ta-relay/lib/node");
|
|
19
23
|
const node_2 = require("@celljs/web/lib/node");
|
|
24
|
+
const host_protocol_1 = require("./host-protocol");
|
|
20
25
|
const ta_access_1 = require("./ta-access");
|
|
21
26
|
const ta_errors_1 = require("./ta-errors");
|
|
22
27
|
/** The id of {@link RelayBridge}, for TaRelayServerImpl. */
|
|
@@ -28,7 +33,7 @@ const WATCH_INTERVAL_MS = 2000;
|
|
|
28
33
|
* keeps a connection out to the relay and gives each device a connection of its own to this server.
|
|
29
34
|
* Without one it does nothing.
|
|
30
35
|
*/
|
|
31
|
-
let RelayBridge = class RelayBridge {
|
|
36
|
+
let RelayBridge = RelayBridge_1 = class RelayBridge {
|
|
32
37
|
constructor() {
|
|
33
38
|
this.store = new node_1.RelayStore(ta_brand_1.TaBrand.agentDir());
|
|
34
39
|
}
|
|
@@ -56,10 +61,14 @@ let RelayBridge = class RelayBridge {
|
|
|
56
61
|
(0, node_fs_1.unwatchFile)(this.store.file);
|
|
57
62
|
(_a = this.host) === null || _a === void 0 ? void 0 : _a.stop();
|
|
58
63
|
}
|
|
64
|
+
/** A package as it goes by a link: a gzipped tar of its directory, without node_modules and .git. */
|
|
65
|
+
static async pack(root) {
|
|
66
|
+
return package_archive_1.PackageArchive.pack((0, node_path_1.basename)(root), package_archive_1.PackageArchive.collect(root));
|
|
67
|
+
}
|
|
59
68
|
start(server) {
|
|
60
69
|
const { port } = server.address();
|
|
61
70
|
const localUrl = `ws://127.0.0.1:${port}${ta_protocol_1.TA_WEBSOCKET_PATH}?token=${encodeURIComponent(this.access.token)}`;
|
|
62
|
-
const host = new node_1.RelayHost({ store: this.store, localUrl });
|
|
71
|
+
const host = new node_1.RelayHost({ store: this.store, localUrl, sharePackage: share => RelayBridge_1.pack(share.root) });
|
|
63
72
|
this.host = host;
|
|
64
73
|
host.start();
|
|
65
74
|
(0, node_fs_1.watchFile)(this.store.file, { interval: WATCH_INTERVAL_MS }, () => host.refresh());
|
|
@@ -70,12 +79,35 @@ __decorate([
|
|
|
70
79
|
(0, core_1.Autowired)(ta_access_1.TA_ACCESS),
|
|
71
80
|
__metadata("design:type", Function)
|
|
72
81
|
], RelayBridge.prototype, "access", void 0);
|
|
73
|
-
exports.RelayBridge = RelayBridge = __decorate([
|
|
82
|
+
exports.RelayBridge = RelayBridge = RelayBridge_1 = __decorate([
|
|
74
83
|
(0, core_1.Component)([exports.RELAY_BRIDGE, node_2.ServerAware, core_1.ApplicationLifecycle])
|
|
75
84
|
], RelayBridge);
|
|
76
85
|
const device = ({ id, name, createdAt }) => ({ id, name, createdAt });
|
|
77
86
|
/** `ta pair` for clients: the devices of relay.json, which RelayBridge serves. Their keys never leave, but in the link of a new one. */
|
|
78
87
|
let TaRelayServerImpl = class TaRelayServerImpl {
|
|
88
|
+
sharePackage(id) {
|
|
89
|
+
return ta_errors_1.TaErrors.guard(async () => {
|
|
90
|
+
const pkg = await this.catalog.packageOf(await this.environments.defaultCwd(), id);
|
|
91
|
+
if (pkg.origin === 'builtin') {
|
|
92
|
+
throw ta_errors_1.TaErrors.invalidArgument(`${pkg.name} comes with Ta: everyone has it already.`, 'Share a package of your own, or one you installed.');
|
|
93
|
+
}
|
|
94
|
+
// Packed once now: what is too large is told at once, not when the other computer asks.
|
|
95
|
+
const size = (await RelayBridge.pack(pkg.root)).length;
|
|
96
|
+
if (size > node_1.RELAY_SHARE_MAX_BYTES) {
|
|
97
|
+
throw ta_errors_1.TaErrors.invalidArgument(`${pkg.name} is ${(size / 1024 / 1024).toFixed(1)} MB packed, more than the ${node_1.RELAY_SHARE_MAX_BYTES / 1024 / 1024} MB a link takes.`, 'Publish it to npm or Git and share that, or export it as a file.');
|
|
98
|
+
}
|
|
99
|
+
const { link, share } = this.bridge.store.shareRoot(pkg.root, pkg.name);
|
|
100
|
+
this.bridge.refresh();
|
|
101
|
+
return { link: node_1.RelayShareUtil.link(link), expiresAt: share.expiresAt, maxBytes: node_1.RELAY_SHARE_MAX_BYTES };
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
unsharePackage(id) {
|
|
105
|
+
return ta_errors_1.TaErrors.guard(async () => {
|
|
106
|
+
const pkg = await this.catalog.packageOf(await this.environments.defaultCwd(), id);
|
|
107
|
+
this.bridge.store.unshareRoot(pkg.root);
|
|
108
|
+
this.bridge.refresh();
|
|
109
|
+
});
|
|
110
|
+
}
|
|
79
111
|
async getRelay() {
|
|
80
112
|
const { url, devices } = this.bridge.store.read();
|
|
81
113
|
return { relay: url, defaultRelay: node_1.RELAY_DEFAULT_URL, online: this.bridge.online, devices: devices.map(device) };
|
|
@@ -102,6 +134,14 @@ __decorate([
|
|
|
102
134
|
(0, core_1.Autowired)(exports.RELAY_BRIDGE),
|
|
103
135
|
__metadata("design:type", RelayBridge)
|
|
104
136
|
], TaRelayServerImpl.prototype, "bridge", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, core_1.Autowired)(host_protocol_1.WebExtensionCatalog),
|
|
139
|
+
__metadata("design:type", Object)
|
|
140
|
+
], TaRelayServerImpl.prototype, "catalog", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, core_1.Autowired)(ta_exec_1.ExecEnvironmentFactory),
|
|
143
|
+
__metadata("design:type", Object)
|
|
144
|
+
], TaRelayServerImpl.prototype, "environments", void 0);
|
|
105
145
|
exports.TaRelayServerImpl = TaRelayServerImpl = __decorate([
|
|
106
146
|
(0, rpc_1.Rpc)(ta_protocol_1.TaRelayServer)
|
|
107
147
|
], TaRelayServerImpl);
|
|
@@ -16,9 +16,13 @@ type DialogRequest = RpcExtensionUIRequest extends infer R ? (R extends {
|
|
|
16
16
|
export declare class RemoteUiContext implements ExtensionUIContext {
|
|
17
17
|
protected readonly publish: (event: TaEvent) => void;
|
|
18
18
|
protected readonly pending: Map<string, PendingDialog>;
|
|
19
|
+
/** The last status and widget of each key, for clients that attach later. */
|
|
20
|
+
protected readonly shown: Map<string, import("@earendil-works/pi-coding-agent", { with: { "resolution-mode": "import" } }).RpcExtensionUIRequest>;
|
|
19
21
|
readonly theme: import("@earendil-works/pi-coding-agent", { with: { "resolution-mode": "import" } }).Theme;
|
|
20
22
|
constructor(publish: (event: TaEvent) => void);
|
|
21
23
|
get pendingRequests(): RpcExtensionUIRequest[];
|
|
24
|
+
/** What the extensions show now with `setStatus` and `setWidget`. */
|
|
25
|
+
get shownRequests(): RpcExtensionUIRequest[];
|
|
22
26
|
/** False when the dialog was answered before or ended. */
|
|
23
27
|
respond(response: RpcExtensionUIResponse): boolean;
|
|
24
28
|
/** Ends the open dialogs as if they timed out: the extensions go on, with their defaults. */
|
|
@@ -55,7 +59,8 @@ export declare class RemoteUiContext implements ExtensionUIContext {
|
|
|
55
59
|
};
|
|
56
60
|
getToolsExpanded(): boolean;
|
|
57
61
|
setToolsExpanded(): void;
|
|
58
|
-
protected tell(request: DialogRequest):
|
|
62
|
+
protected tell(request: DialogRequest): RpcExtensionUIRequest;
|
|
63
|
+
protected keep(key: string, request: RpcExtensionUIRequest | undefined): void;
|
|
59
64
|
protected dialog<T>(request: DialogRequest, options: DialogOptions | undefined, fallback: T, parse: (response: Exclude<RpcExtensionUIResponse, {
|
|
60
65
|
cancelled: true;
|
|
61
66
|
}>) => T): Promise<T>;
|
|
@@ -14,13 +14,29 @@ const PLAIN_THEME = new Proxy({}, {
|
|
|
14
14
|
*/
|
|
15
15
|
class RemoteUiContext {
|
|
16
16
|
constructor(publish) {
|
|
17
|
+
var _a;
|
|
17
18
|
this.publish = publish;
|
|
18
19
|
this.pending = new Map();
|
|
20
|
+
/** The last status and widget of each key, for clients that attach later. */
|
|
21
|
+
this.shown = new Map();
|
|
19
22
|
this.theme = PLAIN_THEME;
|
|
23
|
+
// pi copies the context it is given (`{ ...ui }`), which keeps only own properties: the methods go on the object.
|
|
24
|
+
for (let proto = Object.getPrototypeOf(this); proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) {
|
|
25
|
+
for (const name of Object.getOwnPropertyNames(proto)) {
|
|
26
|
+
const method = (_a = Object.getOwnPropertyDescriptor(proto, name)) === null || _a === void 0 ? void 0 : _a.value;
|
|
27
|
+
if (name !== 'constructor' && typeof method === 'function' && !Object.getOwnPropertyDescriptor(this, name)) {
|
|
28
|
+
Object.defineProperty(this, name, { value: method.bind(this), enumerable: true, writable: true, configurable: true });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
}
|
|
21
33
|
get pendingRequests() {
|
|
22
34
|
return [...this.pending.values()].map(dialog => dialog.request);
|
|
23
35
|
}
|
|
36
|
+
/** What the extensions show now with `setStatus` and `setWidget`. */
|
|
37
|
+
get shownRequests() {
|
|
38
|
+
return [...this.shown.values()];
|
|
39
|
+
}
|
|
24
40
|
/** False when the dialog was answered before or ended. */
|
|
25
41
|
respond(response) {
|
|
26
42
|
const dialog = this.pending.get(response.id);
|
|
@@ -49,12 +65,14 @@ class RemoteUiContext {
|
|
|
49
65
|
this.tell({ method: 'notify', message, notifyType: type });
|
|
50
66
|
}
|
|
51
67
|
setStatus(key, text) {
|
|
52
|
-
this.tell({ method: 'setStatus', statusKey: key, statusText: text });
|
|
68
|
+
const request = this.tell({ method: 'setStatus', statusKey: key, statusText: text });
|
|
69
|
+
this.keep(`status:${key}`, text ? request : undefined);
|
|
53
70
|
}
|
|
54
71
|
setWidget(key, content, options) {
|
|
55
72
|
// Clients cannot run a component factory; pi's RPC mode ignores those too.
|
|
56
73
|
if (content === undefined || Array.isArray(content)) {
|
|
57
|
-
this.tell({ method: 'setWidget', widgetKey: key, widgetLines: content, widgetPlacement: options === null || options === void 0 ? void 0 : options.placement });
|
|
74
|
+
const request = this.tell({ method: 'setWidget', widgetKey: key, widgetLines: content, widgetPlacement: options === null || options === void 0 ? void 0 : options.placement });
|
|
75
|
+
this.keep(`widget:${key}`, (content === null || content === void 0 ? void 0 : content.length) ? request : undefined);
|
|
58
76
|
}
|
|
59
77
|
}
|
|
60
78
|
setTitle(title) {
|
|
@@ -101,7 +119,17 @@ class RemoteUiContext {
|
|
|
101
119
|
}
|
|
102
120
|
setToolsExpanded() { }
|
|
103
121
|
tell(request) {
|
|
104
|
-
|
|
122
|
+
const full = { type: 'extension_ui_request', id: (0, node_crypto_1.randomUUID)(), ...request };
|
|
123
|
+
this.publish(full);
|
|
124
|
+
return full;
|
|
125
|
+
}
|
|
126
|
+
keep(key, request) {
|
|
127
|
+
if (request) {
|
|
128
|
+
this.shown.set(key, request);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.shown.delete(key);
|
|
132
|
+
}
|
|
105
133
|
}
|
|
106
134
|
dialog(request, options, fallback, parse) {
|
|
107
135
|
var _a;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type CodingAgentOptions } from '@celljs/ai-coding-agent';
|
|
2
|
+
import type { TaSavedSessionInfo } from '@celljs/ta-protocol';
|
|
3
|
+
import { TaSessionCatalog } from './host-protocol';
|
|
4
|
+
import { PiDirectories } from './remote/remote-protocol';
|
|
5
|
+
/** What a list shows of a session file, with the directory pi worked in, before it is a location. */
|
|
6
|
+
export type SessionSummary = Omit<TaSavedSessionInfo, 'sessionFile' | 'cwd'> & {
|
|
7
|
+
piCwd: string;
|
|
8
|
+
};
|
|
9
|
+
/** What ta's methods read of pi's SessionManager to mark a session. */
|
|
10
|
+
interface MarkableSession {
|
|
11
|
+
getEntries(): readonly {
|
|
12
|
+
type: string;
|
|
13
|
+
customType?: string;
|
|
14
|
+
data?: unknown;
|
|
15
|
+
}[];
|
|
16
|
+
appendCustomEntry(customType: string, data?: unknown): string;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace SessionCatalogUtil {
|
|
19
|
+
/** pi's custom entry that names the group of the package that opened the session (TaOpenSessionOptions.group). */
|
|
20
|
+
const GROUP_ENTRY = "ta-group";
|
|
21
|
+
/**
|
|
22
|
+
* Writes the group in the session, once: after the session closes, its file still says that its package
|
|
23
|
+
* opens it, with a role of its own. A custom entry is pi's way to keep the state of an extension: the model never reads it.
|
|
24
|
+
*/
|
|
25
|
+
function markGroup(session: MarkableSession, group: string): void;
|
|
26
|
+
/** pi's custom entry that keeps the role a session was opened with (TaOpenSessionOptions.appendSystemPrompt). */
|
|
27
|
+
const ROLE_ENTRY = "ta-role";
|
|
28
|
+
/**
|
|
29
|
+
* Writes the role of the session when it is not the one written last: opened again from its file
|
|
30
|
+
* without one (by a package that relays a message to it, or from the list of conversations), it keeps it.
|
|
31
|
+
*/
|
|
32
|
+
function markRole(session: MarkableSession, role: string): void;
|
|
33
|
+
/** The role the last of the entries keeps. */
|
|
34
|
+
function roleOf(entries: readonly {
|
|
35
|
+
type: string;
|
|
36
|
+
customType?: string;
|
|
37
|
+
data?: unknown;
|
|
38
|
+
}[]): string | undefined;
|
|
39
|
+
/** The group the last of the entries names. */
|
|
40
|
+
function groupOf(entries: readonly {
|
|
41
|
+
type: string;
|
|
42
|
+
customType?: string;
|
|
43
|
+
data?: unknown;
|
|
44
|
+
}[]): string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* What a list of conversations shows of the text of a pi session file, as pi's `/resume` reads it:
|
|
47
|
+
* undefined for a file that does not start with a session header.
|
|
48
|
+
*/
|
|
49
|
+
function summarize(text: string, modifiedAt: number): SessionSummary | undefined;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The session files of pi in its agent directory, one directory per working directory, as pi's `/resume`
|
|
53
|
+
* lists them. A file is read again only when it changed since the last list.
|
|
54
|
+
*/
|
|
55
|
+
export declare class DefaultTaSessionCatalog implements TaSessionCatalog {
|
|
56
|
+
protected readonly codingAgentOptions?: CodingAgentOptions;
|
|
57
|
+
protected readonly directories: PiDirectories;
|
|
58
|
+
/** By file: its size and time when read, and what it held. */
|
|
59
|
+
protected readonly cache: Map<string, {
|
|
60
|
+
version: string;
|
|
61
|
+
summary?: SessionSummary;
|
|
62
|
+
}>;
|
|
63
|
+
list(): Promise<TaSavedSessionInfo[]>;
|
|
64
|
+
/** Where pi keeps the sessions it creates (SessionManager.create without a directory). */
|
|
65
|
+
protected sessionsDir(): Promise<string>;
|
|
66
|
+
protected files(root: string): Promise<string[]>;
|
|
67
|
+
protected summary(file: string): Promise<SessionSummary | undefined>;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=session-catalog.d.ts.map
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DefaultTaSessionCatalog = exports.SessionCatalogUtil = void 0;
|
|
13
|
+
const promises_1 = require("node:fs/promises");
|
|
14
|
+
const node_path_1 = require("node:path");
|
|
15
|
+
const ai_coding_agent_1 = require("@celljs/ai-coding-agent");
|
|
16
|
+
const core_1 = require("@celljs/core");
|
|
17
|
+
const host_protocol_1 = require("./host-protocol");
|
|
18
|
+
const remote_protocol_1 = require("./remote/remote-protocol");
|
|
19
|
+
const session_info_util_1 = require("./session-info-util");
|
|
20
|
+
/** Files read at once. */
|
|
21
|
+
const BATCH = 16;
|
|
22
|
+
var SessionCatalogUtil;
|
|
23
|
+
(function (SessionCatalogUtil) {
|
|
24
|
+
/** pi's custom entry that names the group of the package that opened the session (TaOpenSessionOptions.group). */
|
|
25
|
+
SessionCatalogUtil.GROUP_ENTRY = 'ta-group';
|
|
26
|
+
/**
|
|
27
|
+
* Writes the group in the session, once: after the session closes, its file still says that its package
|
|
28
|
+
* opens it, with a role of its own. A custom entry is pi's way to keep the state of an extension: the model never reads it.
|
|
29
|
+
*/
|
|
30
|
+
function markGroup(session, group) {
|
|
31
|
+
if (groupOf(session.getEntries()) !== group) {
|
|
32
|
+
session.appendCustomEntry(SessionCatalogUtil.GROUP_ENTRY, { group });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
SessionCatalogUtil.markGroup = markGroup;
|
|
36
|
+
/** pi's custom entry that keeps the role a session was opened with (TaOpenSessionOptions.appendSystemPrompt). */
|
|
37
|
+
SessionCatalogUtil.ROLE_ENTRY = 'ta-role';
|
|
38
|
+
/**
|
|
39
|
+
* Writes the role of the session when it is not the one written last: opened again from its file
|
|
40
|
+
* without one (by a package that relays a message to it, or from the list of conversations), it keeps it.
|
|
41
|
+
*/
|
|
42
|
+
function markRole(session, role) {
|
|
43
|
+
if (roleOf(session.getEntries()) !== role) {
|
|
44
|
+
session.appendCustomEntry(SessionCatalogUtil.ROLE_ENTRY, { role });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
SessionCatalogUtil.markRole = markRole;
|
|
48
|
+
/** The role the last of the entries keeps. */
|
|
49
|
+
function roleOf(entries) {
|
|
50
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
51
|
+
const { type, customType, data } = entries[i];
|
|
52
|
+
if (type === 'custom' && customType === SessionCatalogUtil.ROLE_ENTRY) {
|
|
53
|
+
const role = data === null || data === void 0 ? void 0 : data.role;
|
|
54
|
+
return typeof role === 'string' && role ? role : undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
SessionCatalogUtil.roleOf = roleOf;
|
|
60
|
+
/** The group the last of the entries names. */
|
|
61
|
+
function groupOf(entries) {
|
|
62
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
63
|
+
const { type, customType, data } = entries[i];
|
|
64
|
+
if (type === 'custom' && customType === SessionCatalogUtil.GROUP_ENTRY) {
|
|
65
|
+
const group = data === null || data === void 0 ? void 0 : data.group;
|
|
66
|
+
return typeof group === 'string' && group ? group : undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
SessionCatalogUtil.groupOf = groupOf;
|
|
72
|
+
/**
|
|
73
|
+
* What a list of conversations shows of the text of a pi session file, as pi's `/resume` reads it:
|
|
74
|
+
* undefined for a file that does not start with a session header.
|
|
75
|
+
*/
|
|
76
|
+
function summarize(text, modifiedAt) {
|
|
77
|
+
let header;
|
|
78
|
+
let sessionName;
|
|
79
|
+
let firstMessage;
|
|
80
|
+
let messageCount = 0;
|
|
81
|
+
let updatedAt;
|
|
82
|
+
const marks = [];
|
|
83
|
+
for (const line of text.split('\n')) {
|
|
84
|
+
const entry = parse(line);
|
|
85
|
+
if (!entry) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (!header) {
|
|
89
|
+
if (entry.type !== 'session') {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
header = entry;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (entry.type === 'session_info') {
|
|
96
|
+
sessionName = typeof entry.name === 'string' ? entry.name.trim() || undefined : undefined;
|
|
97
|
+
}
|
|
98
|
+
else if (entry.type === 'custom') {
|
|
99
|
+
marks.push(entry);
|
|
100
|
+
}
|
|
101
|
+
else if (entry.type === 'message' && entry.message && typeof entry.message === 'object') {
|
|
102
|
+
const message = entry.message;
|
|
103
|
+
messageCount++;
|
|
104
|
+
firstMessage !== null && firstMessage !== void 0 ? firstMessage : (firstMessage = session_info_util_1.SessionInfoUtil.firstMessage([message]));
|
|
105
|
+
if (typeof message.timestamp === 'number') {
|
|
106
|
+
updatedAt = Math.max(updatedAt !== null && updatedAt !== void 0 ? updatedAt : 0, message.timestamp);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!header || typeof header.id !== 'string') {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const started = typeof header.timestamp === 'string' ? Date.parse(header.timestamp) : Number.NaN;
|
|
114
|
+
const createdAt = Number.isNaN(started) ? modifiedAt : started;
|
|
115
|
+
return {
|
|
116
|
+
piSessionId: header.id,
|
|
117
|
+
piCwd: typeof header.cwd === 'string' ? header.cwd : '',
|
|
118
|
+
sessionName,
|
|
119
|
+
firstMessage,
|
|
120
|
+
messageCount,
|
|
121
|
+
createdAt,
|
|
122
|
+
updatedAt: updatedAt !== null && updatedAt !== void 0 ? updatedAt : createdAt,
|
|
123
|
+
group: groupOf(marks),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
SessionCatalogUtil.summarize = summarize;
|
|
127
|
+
function parse(line) {
|
|
128
|
+
if (!line.trim()) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
const entry = JSON.parse(line);
|
|
133
|
+
return entry && typeof entry === 'object' && typeof entry.type === 'string' ? entry : undefined;
|
|
134
|
+
}
|
|
135
|
+
catch (_a) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
})(SessionCatalogUtil || (exports.SessionCatalogUtil = SessionCatalogUtil = {}));
|
|
140
|
+
/**
|
|
141
|
+
* The session files of pi in its agent directory, one directory per working directory, as pi's `/resume`
|
|
142
|
+
* lists them. A file is read again only when it changed since the last list.
|
|
143
|
+
*/
|
|
144
|
+
let DefaultTaSessionCatalog = class DefaultTaSessionCatalog {
|
|
145
|
+
constructor() {
|
|
146
|
+
/** By file: its size and time when read, and what it held. */
|
|
147
|
+
this.cache = new Map();
|
|
148
|
+
}
|
|
149
|
+
async list() {
|
|
150
|
+
const files = await this.files(await this.sessionsDir());
|
|
151
|
+
const sessions = [];
|
|
152
|
+
for (let i = 0; i < files.length; i += BATCH) {
|
|
153
|
+
await Promise.all(files.slice(i, i + BATCH).map(async (file) => {
|
|
154
|
+
const summary = await this.summary(file);
|
|
155
|
+
if (summary) {
|
|
156
|
+
const { piCwd, ...info } = summary;
|
|
157
|
+
sessions.push({ ...info, sessionFile: file, cwd: piCwd && this.directories.fromPi(piCwd) });
|
|
158
|
+
}
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
const listed = new Set(files);
|
|
162
|
+
for (const file of this.cache.keys()) {
|
|
163
|
+
if (!listed.has(file)) {
|
|
164
|
+
this.cache.delete(file);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return sessions.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
168
|
+
}
|
|
169
|
+
/** Where pi keeps the sessions it creates (SessionManager.create without a directory). */
|
|
170
|
+
async sessionsDir() {
|
|
171
|
+
var _a;
|
|
172
|
+
var _b;
|
|
173
|
+
const agentDir = (_b = (_a = this.codingAgentOptions) === null || _a === void 0 ? void 0 : _a.agentDir) !== null && _b !== void 0 ? _b : (await ai_coding_agent_1.PiSdkUtil.load()).getAgentDir();
|
|
174
|
+
return (0, node_path_1.join)(agentDir, 'sessions');
|
|
175
|
+
}
|
|
176
|
+
async files(root) {
|
|
177
|
+
const dirs = await (0, promises_1.readdir)(root, { withFileTypes: true }).catch(() => []);
|
|
178
|
+
const files = await Promise.all(dirs
|
|
179
|
+
.filter(dir => dir.isDirectory())
|
|
180
|
+
.map(async (dir) => {
|
|
181
|
+
const names = await (0, promises_1.readdir)((0, node_path_1.join)(root, dir.name)).catch(() => []);
|
|
182
|
+
return names.filter(name => name.endsWith('.jsonl')).map(name => (0, node_path_1.join)(root, dir.name, name));
|
|
183
|
+
}));
|
|
184
|
+
return files.flat();
|
|
185
|
+
}
|
|
186
|
+
async summary(file) {
|
|
187
|
+
const stats = await (0, promises_1.stat)(file).catch(() => undefined);
|
|
188
|
+
if (!(stats === null || stats === void 0 ? void 0 : stats.isFile())) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
const version = `${stats.size}:${stats.mtimeMs}`;
|
|
192
|
+
const cached = this.cache.get(file);
|
|
193
|
+
if ((cached === null || cached === void 0 ? void 0 : cached.version) === version) {
|
|
194
|
+
return cached.summary;
|
|
195
|
+
}
|
|
196
|
+
const text = await (0, promises_1.readFile)(file, 'utf8').catch(() => undefined);
|
|
197
|
+
const summary = text === undefined ? undefined : SessionCatalogUtil.summarize(text, stats.mtimeMs);
|
|
198
|
+
this.cache.set(file, { version, summary });
|
|
199
|
+
return summary;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
exports.DefaultTaSessionCatalog = DefaultTaSessionCatalog;
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, core_1.Value)(ai_coding_agent_1.CODING_AGENT_OPTIONS),
|
|
205
|
+
__metadata("design:type", Object)
|
|
206
|
+
], DefaultTaSessionCatalog.prototype, "codingAgentOptions", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, core_1.Autowired)(remote_protocol_1.PiDirectories),
|
|
209
|
+
__metadata("design:type", Object)
|
|
210
|
+
], DefaultTaSessionCatalog.prototype, "directories", void 0);
|
|
211
|
+
exports.DefaultTaSessionCatalog = DefaultTaSessionCatalog = __decorate([
|
|
212
|
+
(0, core_1.Component)(host_protocol_1.TaSessionCatalog)
|
|
213
|
+
], DefaultTaSessionCatalog);
|
|
214
|
+
//# sourceMappingURL=session-catalog.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExecEnvironment } from '@celljs/ta-exec';
|
|
2
|
+
import { ExecOperations } from '@celljs/ta-harness';
|
|
3
|
+
import type { TaSessionFiles } from '@celljs/ta-protocol';
|
|
4
|
+
/**
|
|
5
|
+
* The files of a session on its execution environment. `piCwd` is the directory pi works in for it
|
|
6
|
+
* (PiDirectories): pi's tools resolve paths there, and ExecOperations maps them into the environment.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ExecSessionFiles implements TaSessionFiles {
|
|
9
|
+
protected readonly environment: ExecEnvironment;
|
|
10
|
+
protected readonly piCwd: string;
|
|
11
|
+
protected readonly operations: ExecOperations;
|
|
12
|
+
constructor(environment: ExecEnvironment, piCwd: string);
|
|
13
|
+
/** As pi's tools resolve a path of their arguments: without a leading `@`, `~` the home directory, against pi's directory. */
|
|
14
|
+
resolve(path: string): string;
|
|
15
|
+
read(path: string): Promise<Uint8Array | undefined>;
|
|
16
|
+
write(path: string, data: Uint8Array): Promise<void>;
|
|
17
|
+
remove(path: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=session-files.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecSessionFiles = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const ta_harness_1 = require("@celljs/ta-harness");
|
|
7
|
+
/**
|
|
8
|
+
* The files of a session on its execution environment. `piCwd` is the directory pi works in for it
|
|
9
|
+
* (PiDirectories): pi's tools resolve paths there, and ExecOperations maps them into the environment.
|
|
10
|
+
*/
|
|
11
|
+
class ExecSessionFiles {
|
|
12
|
+
constructor(environment, piCwd) {
|
|
13
|
+
this.environment = environment;
|
|
14
|
+
this.piCwd = piCwd;
|
|
15
|
+
this.operations = new ta_harness_1.ExecOperations(environment, piCwd);
|
|
16
|
+
}
|
|
17
|
+
/** As pi's tools resolve a path of their arguments: without a leading `@`, `~` the home directory, against pi's directory. */
|
|
18
|
+
resolve(path) {
|
|
19
|
+
const bare = path.startsWith('@') ? path.slice(1) : path;
|
|
20
|
+
const expanded = bare === '~' || bare.startsWith('~/') ? (0, node_os_1.homedir)() + bare.slice(1) : bare;
|
|
21
|
+
return this.operations.map((0, node_path_1.resolve)(this.piCwd, expanded));
|
|
22
|
+
}
|
|
23
|
+
async read(path) {
|
|
24
|
+
const stat = await this.environment.stat(path);
|
|
25
|
+
return stat && !stat.isDirectory ? this.environment.readFile(path) : undefined;
|
|
26
|
+
}
|
|
27
|
+
async write(path, data) {
|
|
28
|
+
await this.environment.mkdir(this.environment.local ? (0, node_path_1.dirname)(path) : node_path_1.posix.dirname(path));
|
|
29
|
+
await this.environment.writeFile(path, data);
|
|
30
|
+
}
|
|
31
|
+
remove(path) {
|
|
32
|
+
return this.environment.remove(path, { recursive: false });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ExecSessionFiles = ExecSessionFiles;
|
|
36
|
+
//# sourceMappingURL=session-files.js.map
|
|
@@ -6,7 +6,10 @@ interface MessageLike {
|
|
|
6
6
|
}
|
|
7
7
|
/** What a list of conversations shows of one: its first message, as pi's session list does, and when it last changed. */
|
|
8
8
|
export declare namespace SessionInfoUtil {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The first line of the first message of the user that has text, without its context, cut to a title's length;
|
|
11
|
+
* a skill the user ran is `/skill:name` and what follows, not the skill's file.
|
|
12
|
+
*/
|
|
10
13
|
function firstMessage(messages: readonly MessageLike[]): string | undefined;
|
|
11
14
|
/** The time of the last message that has one, else `fallback`. */
|
|
12
15
|
function updatedAt(messages: readonly MessageLike[], fallback: number): number;
|