aven-ai 0.0.1
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.md +171 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/libs/config/config-store.d.ts +109 -0
- package/dist/libs/config/config-store.d.ts.map +1 -0
- package/dist/libs/config/config-store.js +169 -0
- package/dist/libs/config/config-store.js.map +1 -0
- package/dist/libs/config/index.d.ts +2 -0
- package/dist/libs/config/index.d.ts.map +1 -0
- package/dist/libs/config/index.js +2 -0
- package/dist/libs/config/index.js.map +1 -0
- package/dist/libs/provider-clients/index.d.ts +2 -0
- package/dist/libs/provider-clients/index.d.ts.map +1 -0
- package/dist/libs/provider-clients/index.js +2 -0
- package/dist/libs/provider-clients/index.js.map +1 -0
- package/dist/libs/provider-clients/provider-client.d.ts +34 -0
- package/dist/libs/provider-clients/provider-client.d.ts.map +1 -0
- package/dist/libs/provider-clients/provider-client.js +167 -0
- package/dist/libs/provider-clients/provider-client.js.map +1 -0
- package/dist/libs/provider-definitions/index.d.ts +2 -0
- package/dist/libs/provider-definitions/index.d.ts.map +1 -0
- package/dist/libs/provider-definitions/index.js +2 -0
- package/dist/libs/provider-definitions/index.js.map +1 -0
- package/dist/libs/provider-definitions/provider-definitions.d.ts +16 -0
- package/dist/libs/provider-definitions/provider-definitions.d.ts.map +1 -0
- package/dist/libs/provider-definitions/provider-definitions.js +59 -0
- package/dist/libs/provider-definitions/provider-definitions.js.map +1 -0
- package/dist/libs/pty/index.d.ts +2 -0
- package/dist/libs/pty/index.d.ts.map +1 -0
- package/dist/libs/pty/index.js +2 -0
- package/dist/libs/pty/index.js.map +1 -0
- package/dist/libs/pty/pty-runner.d.ts +26 -0
- package/dist/libs/pty/pty-runner.d.ts.map +1 -0
- package/dist/libs/pty/pty-runner.js +153 -0
- package/dist/libs/pty/pty-runner.js.map +1 -0
- package/dist/libs/session-storage/index.d.ts +2 -0
- package/dist/libs/session-storage/index.d.ts.map +1 -0
- package/dist/libs/session-storage/index.js +2 -0
- package/dist/libs/session-storage/index.js.map +1 -0
- package/dist/libs/session-storage/session-catalog.d.ts +19 -0
- package/dist/libs/session-storage/session-catalog.d.ts.map +1 -0
- package/dist/libs/session-storage/session-catalog.js +180 -0
- package/dist/libs/session-storage/session-catalog.js.map +1 -0
- package/dist/libs/terminal/clipboard.d.ts +3 -0
- package/dist/libs/terminal/clipboard.d.ts.map +1 -0
- package/dist/libs/terminal/clipboard.js +8 -0
- package/dist/libs/terminal/clipboard.js.map +1 -0
- package/dist/libs/terminal/index.d.ts +6 -0
- package/dist/libs/terminal/index.d.ts.map +1 -0
- package/dist/libs/terminal/index.js +6 -0
- package/dist/libs/terminal/index.js.map +1 -0
- package/dist/libs/terminal/keyboard-protocol.d.ts +3 -0
- package/dist/libs/terminal/keyboard-protocol.d.ts.map +1 -0
- package/dist/libs/terminal/keyboard-protocol.js +7 -0
- package/dist/libs/terminal/keyboard-protocol.js.map +1 -0
- package/dist/libs/terminal/mouse-protocol.d.ts +22 -0
- package/dist/libs/terminal/mouse-protocol.d.ts.map +1 -0
- package/dist/libs/terminal/mouse-protocol.js +51 -0
- package/dist/libs/terminal/mouse-protocol.js.map +1 -0
- package/dist/libs/terminal/terminal-provider.d.ts +15 -0
- package/dist/libs/terminal/terminal-provider.d.ts.map +1 -0
- package/dist/libs/terminal/terminal-provider.js +47 -0
- package/dist/libs/terminal/terminal-provider.js.map +1 -0
- package/dist/libs/terminal/theme.d.ts +24 -0
- package/dist/libs/terminal/theme.d.ts.map +1 -0
- package/dist/libs/terminal/theme.js +23 -0
- package/dist/libs/terminal/theme.js.map +1 -0
- package/dist/modules/agent/core.d.ts +41 -0
- package/dist/modules/agent/core.d.ts.map +1 -0
- package/dist/modules/agent/core.js +149 -0
- package/dist/modules/agent/core.js.map +1 -0
- package/dist/modules/agent/events/memory-message-adapter.d.ts +4 -0
- package/dist/modules/agent/events/memory-message-adapter.d.ts.map +1 -0
- package/dist/modules/agent/events/memory-message-adapter.js +48 -0
- package/dist/modules/agent/events/memory-message-adapter.js.map +1 -0
- package/dist/modules/agent/events/stream-event-adapter.d.ts +17 -0
- package/dist/modules/agent/events/stream-event-adapter.d.ts.map +1 -0
- package/dist/modules/agent/events/stream-event-adapter.js +82 -0
- package/dist/modules/agent/events/stream-event-adapter.js.map +1 -0
- package/dist/modules/agent/events/tool-message-adapter.d.ts +21 -0
- package/dist/modules/agent/events/tool-message-adapter.d.ts.map +1 -0
- package/dist/modules/agent/events/tool-message-adapter.js +123 -0
- package/dist/modules/agent/events/tool-message-adapter.js.map +1 -0
- package/dist/modules/agent/index.d.ts +5 -0
- package/dist/modules/agent/index.d.ts.map +1 -0
- package/dist/modules/agent/index.js +5 -0
- package/dist/modules/agent/index.js.map +1 -0
- package/dist/modules/agent/mock.d.ts +10 -0
- package/dist/modules/agent/mock.d.ts.map +1 -0
- package/dist/modules/agent/mock.js +60 -0
- package/dist/modules/agent/mock.js.map +1 -0
- package/dist/modules/agent/prompts/commands.d.ts +2 -0
- package/dist/modules/agent/prompts/commands.d.ts.map +1 -0
- package/dist/modules/agent/prompts/commands.js +5 -0
- package/dist/modules/agent/prompts/commands.js.map +1 -0
- package/dist/modules/agent/prompts/file-tools.d.ts +2 -0
- package/dist/modules/agent/prompts/file-tools.d.ts.map +1 -0
- package/dist/modules/agent/prompts/file-tools.js +7 -0
- package/dist/modules/agent/prompts/file-tools.js.map +1 -0
- package/dist/modules/agent/prompts/identity.d.ts +2 -0
- package/dist/modules/agent/prompts/identity.d.ts.map +1 -0
- package/dist/modules/agent/prompts/identity.js +5 -0
- package/dist/modules/agent/prompts/identity.js.map +1 -0
- package/dist/modules/agent/prompts/system.d.ts +2 -0
- package/dist/modules/agent/prompts/system.d.ts.map +1 -0
- package/dist/modules/agent/prompts/system.js +5 -0
- package/dist/modules/agent/prompts/system.js.map +1 -0
- package/dist/modules/agent/services/direct-command-executor.d.ts +10 -0
- package/dist/modules/agent/services/direct-command-executor.d.ts.map +1 -0
- package/dist/modules/agent/services/direct-command-executor.js +58 -0
- package/dist/modules/agent/services/direct-command-executor.js.map +1 -0
- package/dist/modules/agent/services/prompt-turn-executor.d.ts +12 -0
- package/dist/modules/agent/services/prompt-turn-executor.d.ts.map +1 -0
- package/dist/modules/agent/services/prompt-turn-executor.js +79 -0
- package/dist/modules/agent/services/prompt-turn-executor.js.map +1 -0
- package/dist/modules/agent/tools/exec-command.d.ts +13 -0
- package/dist/modules/agent/tools/exec-command.d.ts.map +1 -0
- package/dist/modules/agent/tools/exec-command.js +11 -0
- package/dist/modules/agent/tools/exec-command.js.map +1 -0
- package/dist/modules/agent/tools/files/contracts.d.ts +132 -0
- package/dist/modules/agent/tools/files/contracts.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/contracts.js +84 -0
- package/dist/modules/agent/tools/files/contracts.js.map +1 -0
- package/dist/modules/agent/tools/files/create-file-tools.d.ts +61 -0
- package/dist/modules/agent/tools/files/create-file-tools.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/create-file-tools.js +26 -0
- package/dist/modules/agent/tools/files/create-file-tools.js.map +1 -0
- package/dist/modules/agent/tools/files/edit-file-operation.d.ts +4 -0
- package/dist/modules/agent/tools/files/edit-file-operation.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/edit-file-operation.js +98 -0
- package/dist/modules/agent/tools/files/edit-file-operation.js.map +1 -0
- package/dist/modules/agent/tools/files/file-path-safety.d.ts +2 -0
- package/dist/modules/agent/tools/files/file-path-safety.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/file-path-safety.js +10 -0
- package/dist/modules/agent/tools/files/file-path-safety.js.map +1 -0
- package/dist/modules/agent/tools/files/file-state-cache.d.ts +21 -0
- package/dist/modules/agent/tools/files/file-state-cache.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/file-state-cache.js +54 -0
- package/dist/modules/agent/tools/files/file-state-cache.js.map +1 -0
- package/dist/modules/agent/tools/files/file-tool-error.d.ts +3 -0
- package/dist/modules/agent/tools/files/file-tool-error.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/file-tool-error.js +3 -0
- package/dist/modules/agent/tools/files/file-tool-error.js.map +1 -0
- package/dist/modules/agent/tools/files/file-tool-operations.d.ts +22 -0
- package/dist/modules/agent/tools/files/file-tool-operations.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/file-tool-operations.js +73 -0
- package/dist/modules/agent/tools/files/file-tool-operations.js.map +1 -0
- package/dist/modules/agent/tools/files/file-tool-service.d.ts +14 -0
- package/dist/modules/agent/tools/files/file-tool-service.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/file-tool-service.js +28 -0
- package/dist/modules/agent/tools/files/file-tool-service.js.map +1 -0
- package/dist/modules/agent/tools/files/mutation-journal.d.ts +12 -0
- package/dist/modules/agent/tools/files/mutation-journal.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/mutation-journal.js +25 -0
- package/dist/modules/agent/tools/files/mutation-journal.js.map +1 -0
- package/dist/modules/agent/tools/files/read-file-operation.d.ts +4 -0
- package/dist/modules/agent/tools/files/read-file-operation.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/read-file-operation.js +92 -0
- package/dist/modules/agent/tools/files/read-file-operation.js.map +1 -0
- package/dist/modules/agent/tools/files/text-file-codec.d.ts +13 -0
- package/dist/modules/agent/tools/files/text-file-codec.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/text-file-codec.js +45 -0
- package/dist/modules/agent/tools/files/text-file-codec.js.map +1 -0
- package/dist/modules/agent/tools/files/write-file-operation.d.ts +4 -0
- package/dist/modules/agent/tools/files/write-file-operation.d.ts.map +1 -0
- package/dist/modules/agent/tools/files/write-file-operation.js +61 -0
- package/dist/modules/agent/tools/files/write-file-operation.js.map +1 -0
- package/dist/modules/agent/types.d.ts +65 -0
- package/dist/modules/agent/types.d.ts.map +1 -0
- package/dist/modules/agent/types.js +21 -0
- package/dist/modules/agent/types.js.map +1 -0
- package/dist/modules/app/cli.d.ts +2 -0
- package/dist/modules/app/cli.d.ts.map +1 -0
- package/dist/modules/app/cli.js +23 -0
- package/dist/modules/app/cli.js.map +1 -0
- package/dist/modules/app/components/app-provider.d.ts +11 -0
- package/dist/modules/app/components/app-provider.d.ts.map +1 -0
- package/dist/modules/app/components/app-provider.js +18 -0
- package/dist/modules/app/components/app-provider.js.map +1 -0
- package/dist/modules/app/components/app.d.ts +7 -0
- package/dist/modules/app/components/app.d.ts.map +1 -0
- package/dist/modules/app/components/app.js +45 -0
- package/dist/modules/app/components/app.js.map +1 -0
- package/dist/modules/app/index.d.ts +6 -0
- package/dist/modules/app/index.d.ts.map +1 -0
- package/dist/modules/app/index.js +5 -0
- package/dist/modules/app/index.js.map +1 -0
- package/dist/modules/app/input/prompt-history.d.ts +3 -0
- package/dist/modules/app/input/prompt-history.d.ts.map +1 -0
- package/dist/modules/app/input/prompt-history.js +13 -0
- package/dist/modules/app/input/prompt-history.js.map +1 -0
- package/dist/modules/app/input/use-overlay-controller.d.ts +14 -0
- package/dist/modules/app/input/use-overlay-controller.d.ts.map +1 -0
- package/dist/modules/app/input/use-overlay-controller.js +168 -0
- package/dist/modules/app/input/use-overlay-controller.js.map +1 -0
- package/dist/modules/app/services/quit-controller.d.ts +2 -0
- package/dist/modules/app/services/quit-controller.d.ts.map +1 -0
- package/dist/modules/app/services/quit-controller.js +27 -0
- package/dist/modules/app/services/quit-controller.js.map +1 -0
- package/dist/modules/app/services/runtime-event-batcher.d.ts +13 -0
- package/dist/modules/app/services/runtime-event-batcher.d.ts.map +1 -0
- package/dist/modules/app/services/runtime-event-batcher.js +41 -0
- package/dist/modules/app/services/runtime-event-batcher.js.map +1 -0
- package/dist/modules/app/services/use-app-input.d.ts +14 -0
- package/dist/modules/app/services/use-app-input.d.ts.map +1 -0
- package/dist/modules/app/services/use-app-input.js +144 -0
- package/dist/modules/app/services/use-app-input.js.map +1 -0
- package/dist/modules/app/services/use-runtime-connection.d.ts +15 -0
- package/dist/modules/app/services/use-runtime-connection.d.ts.map +1 -0
- package/dist/modules/app/services/use-runtime-connection.js +128 -0
- package/dist/modules/app/services/use-runtime-connection.js.map +1 -0
- package/dist/modules/app/services/use-runtime-session.d.ts +8 -0
- package/dist/modules/app/services/use-runtime-session.d.ts.map +1 -0
- package/dist/modules/app/services/use-runtime-session.js +79 -0
- package/dist/modules/app/services/use-runtime-session.js.map +1 -0
- package/dist/modules/app/services/use-runtime-workspace.d.ts +16 -0
- package/dist/modules/app/services/use-runtime-workspace.d.ts.map +1 -0
- package/dist/modules/app/services/use-runtime-workspace.js +134 -0
- package/dist/modules/app/services/use-runtime-workspace.js.map +1 -0
- package/dist/modules/app/store/app-state.d.ts +39 -0
- package/dist/modules/app/store/app-state.d.ts.map +1 -0
- package/dist/modules/app/store/app-state.js +2 -0
- package/dist/modules/app/store/app-state.js.map +1 -0
- package/dist/modules/app/store/apply-runtime-event.d.ts +4 -0
- package/dist/modules/app/store/apply-runtime-event.d.ts.map +1 -0
- package/dist/modules/app/store/apply-runtime-event.js +72 -0
- package/dist/modules/app/store/apply-runtime-event.js.map +1 -0
- package/dist/modules/app/store/create-app-store.d.ts +5 -0
- package/dist/modules/app/store/create-app-store.d.ts.map +1 -0
- package/dist/modules/app/store/create-app-store.js +49 -0
- package/dist/modules/app/store/create-app-store.js.map +1 -0
- package/dist/modules/app/store/selectors.d.ts +20 -0
- package/dist/modules/app/store/selectors.d.ts.map +1 -0
- package/dist/modules/app/store/selectors.js +19 -0
- package/dist/modules/app/store/selectors.js.map +1 -0
- package/dist/modules/commands/index.d.ts +2 -0
- package/dist/modules/commands/index.d.ts.map +1 -0
- package/dist/modules/commands/index.js +2 -0
- package/dist/modules/commands/index.js.map +1 -0
- package/dist/modules/commands/registry.d.ts +11 -0
- package/dist/modules/commands/registry.d.ts.map +1 -0
- package/dist/modules/commands/registry.js +16 -0
- package/dist/modules/commands/registry.js.map +1 -0
- package/dist/modules/composer/components/composer.d.ts +17 -0
- package/dist/modules/composer/components/composer.d.ts.map +1 -0
- package/dist/modules/composer/components/composer.js +35 -0
- package/dist/modules/composer/components/composer.js.map +1 -0
- package/dist/modules/composer/index.d.ts +6 -0
- package/dist/modules/composer/index.d.ts.map +1 -0
- package/dist/modules/composer/index.js +5 -0
- package/dist/modules/composer/index.js.map +1 -0
- package/dist/modules/composer/services/editor.d.ts +9 -0
- package/dist/modules/composer/services/editor.d.ts.map +1 -0
- package/dist/modules/composer/services/editor.js +39 -0
- package/dist/modules/composer/services/editor.js.map +1 -0
- package/dist/modules/composer/services/input-intent.d.ts +40 -0
- package/dist/modules/composer/services/input-intent.d.ts.map +1 -0
- package/dist/modules/composer/services/input-intent.js +58 -0
- package/dist/modules/composer/services/input-intent.js.map +1 -0
- package/dist/modules/composer/services/suggestions.d.ts +9 -0
- package/dist/modules/composer/services/suggestions.d.ts.map +1 -0
- package/dist/modules/composer/services/suggestions.js +18 -0
- package/dist/modules/composer/services/suggestions.js.map +1 -0
- package/dist/modules/composer/types.d.ts +9 -0
- package/dist/modules/composer/types.d.ts.map +1 -0
- package/dist/modules/composer/types.js +2 -0
- package/dist/modules/composer/types.js.map +1 -0
- package/dist/modules/conversation/components/transcript-row.d.ts +9 -0
- package/dist/modules/conversation/components/transcript-row.d.ts.map +1 -0
- package/dist/modules/conversation/components/transcript-row.js +13 -0
- package/dist/modules/conversation/components/transcript-row.js.map +1 -0
- package/dist/modules/conversation/components/virtual-transcript.d.ts +9 -0
- package/dist/modules/conversation/components/virtual-transcript.d.ts.map +1 -0
- package/dist/modules/conversation/components/virtual-transcript.js +24 -0
- package/dist/modules/conversation/components/virtual-transcript.js.map +1 -0
- package/dist/modules/conversation/fixtures.d.ts +3 -0
- package/dist/modules/conversation/fixtures.d.ts.map +1 -0
- package/dist/modules/conversation/fixtures.js +22 -0
- package/dist/modules/conversation/fixtures.js.map +1 -0
- package/dist/modules/conversation/index.d.ts +5 -0
- package/dist/modules/conversation/index.d.ts.map +1 -0
- package/dist/modules/conversation/index.js +4 -0
- package/dist/modules/conversation/index.js.map +1 -0
- package/dist/modules/conversation/services/input-intent.d.ts +18 -0
- package/dist/modules/conversation/services/input-intent.d.ts.map +1 -0
- package/dist/modules/conversation/services/input-intent.js +18 -0
- package/dist/modules/conversation/services/input-intent.js.map +1 -0
- package/dist/modules/conversation/services/markdown-rows.d.ts +5 -0
- package/dist/modules/conversation/services/markdown-rows.d.ts.map +1 -0
- package/dist/modules/conversation/services/markdown-rows.js +96 -0
- package/dist/modules/conversation/services/markdown-rows.js.map +1 -0
- package/dist/modules/conversation/services/message-rows.d.ts +8 -0
- package/dist/modules/conversation/services/message-rows.d.ts.map +1 -0
- package/dist/modules/conversation/services/message-rows.js +141 -0
- package/dist/modules/conversation/services/message-rows.js.map +1 -0
- package/dist/modules/conversation/services/row-model.d.ts +5 -0
- package/dist/modules/conversation/services/row-model.d.ts.map +1 -0
- package/dist/modules/conversation/services/row-model.js +11 -0
- package/dist/modules/conversation/services/row-model.js.map +1 -0
- package/dist/modules/conversation/services/selection.d.ts +10 -0
- package/dist/modules/conversation/services/selection.d.ts.map +1 -0
- package/dist/modules/conversation/services/selection.js +92 -0
- package/dist/modules/conversation/services/selection.js.map +1 -0
- package/dist/modules/conversation/services/terminal-cells.d.ts +9 -0
- package/dist/modules/conversation/services/terminal-cells.d.ts.map +1 -0
- package/dist/modules/conversation/services/terminal-cells.js +24 -0
- package/dist/modules/conversation/services/terminal-cells.js.map +1 -0
- package/dist/modules/conversation/services/transcript-row-cache.d.ts +10 -0
- package/dist/modules/conversation/services/transcript-row-cache.d.ts.map +1 -0
- package/dist/modules/conversation/services/transcript-row-cache.js +40 -0
- package/dist/modules/conversation/services/transcript-row-cache.js.map +1 -0
- package/dist/modules/conversation/services/use-transcript-controller.d.ts +17 -0
- package/dist/modules/conversation/services/use-transcript-controller.d.ts.map +1 -0
- package/dist/modules/conversation/services/use-transcript-controller.js +157 -0
- package/dist/modules/conversation/services/use-transcript-controller.js.map +1 -0
- package/dist/modules/conversation/services/wrapping.d.ts +3 -0
- package/dist/modules/conversation/services/wrapping.d.ts.map +1 -0
- package/dist/modules/conversation/services/wrapping.js +46 -0
- package/dist/modules/conversation/services/wrapping.js.map +1 -0
- package/dist/modules/conversation/types.d.ts +77 -0
- package/dist/modules/conversation/types.d.ts.map +1 -0
- package/dist/modules/conversation/types.js +2 -0
- package/dist/modules/conversation/types.js.map +1 -0
- package/dist/modules/overlays/components/overlay.d.ts +10 -0
- package/dist/modules/overlays/components/overlay.d.ts.map +1 -0
- package/dist/modules/overlays/components/overlay.js +17 -0
- package/dist/modules/overlays/components/overlay.js.map +1 -0
- package/dist/modules/overlays/index.d.ts +6 -0
- package/dist/modules/overlays/index.d.ts.map +1 -0
- package/dist/modules/overlays/index.js +5 -0
- package/dist/modules/overlays/index.js.map +1 -0
- package/dist/modules/overlays/services/overlay-items.d.ts +20 -0
- package/dist/modules/overlays/services/overlay-items.d.ts.map +1 -0
- package/dist/modules/overlays/services/overlay-items.js +56 -0
- package/dist/modules/overlays/services/overlay-items.js.map +1 -0
- package/dist/modules/overlays/services/overlay-registry.d.ts +4 -0
- package/dist/modules/overlays/services/overlay-registry.d.ts.map +1 -0
- package/dist/modules/overlays/services/overlay-registry.js +42 -0
- package/dist/modules/overlays/services/overlay-registry.js.map +1 -0
- package/dist/modules/overlays/services/overlay-selection.d.ts +23 -0
- package/dist/modules/overlays/services/overlay-selection.d.ts.map +1 -0
- package/dist/modules/overlays/services/overlay-selection.js +23 -0
- package/dist/modules/overlays/services/overlay-selection.js.map +1 -0
- package/dist/modules/overlays/types.d.ts +15 -0
- package/dist/modules/overlays/types.d.ts.map +1 -0
- package/dist/modules/overlays/types.js +2 -0
- package/dist/modules/overlays/types.js.map +1 -0
- package/dist/modules/providers/catalog.d.ts +2 -0
- package/dist/modules/providers/catalog.d.ts.map +1 -0
- package/dist/modules/providers/catalog.js +2 -0
- package/dist/modules/providers/catalog.js.map +1 -0
- package/dist/modules/providers/index.d.ts +5 -0
- package/dist/modules/providers/index.d.ts.map +1 -0
- package/dist/modules/providers/index.js +3 -0
- package/dist/modules/providers/index.js.map +1 -0
- package/dist/modules/providers/services/provider-connection-manager.d.ts +22 -0
- package/dist/modules/providers/services/provider-connection-manager.d.ts.map +1 -0
- package/dist/modules/providers/services/provider-connection-manager.js +147 -0
- package/dist/modules/providers/services/provider-connection-manager.js.map +1 -0
- package/dist/modules/providers/types.d.ts +20 -0
- package/dist/modules/providers/types.d.ts.map +1 -0
- package/dist/modules/providers/types.js +2 -0
- package/dist/modules/providers/types.js.map +1 -0
- package/dist/modules/sessions/index.d.ts +3 -0
- package/dist/modules/sessions/index.d.ts.map +1 -0
- package/dist/modules/sessions/index.js +3 -0
- package/dist/modules/sessions/index.js.map +1 -0
- package/dist/modules/sessions/services/project-session-manager.d.ts +28 -0
- package/dist/modules/sessions/services/project-session-manager.d.ts.map +1 -0
- package/dist/modules/sessions/services/project-session-manager.js +90 -0
- package/dist/modules/sessions/services/project-session-manager.js.map +1 -0
- package/dist/modules/sessions/types.d.ts +13 -0
- package/dist/modules/sessions/types.d.ts.map +1 -0
- package/dist/modules/sessions/types.js +12 -0
- package/dist/modules/sessions/types.js.map +1 -0
- package/dist/utils/safe-error.d.ts +2 -0
- package/dist/utils/safe-error.d.ts.map +1 -0
- package/dist/utils/safe-error.js +10 -0
- package/dist/utils/safe-error.js.map +1 -0
- package/dist/utils/text.d.ts +2 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +5 -0
- package/dist/utils/text.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { AnthropicClient } from '@anvia/anthropic';
|
|
2
|
+
import { OpenAIClient } from '@anvia/openai';
|
|
3
|
+
import { normalizeDatabricksBaseUrl } from '../provider-definitions/index.js';
|
|
4
|
+
export const providerBaseUrls = {
|
|
5
|
+
anthropic: 'https://api.anthropic.com',
|
|
6
|
+
'devscale-ai': 'https://ai.devscale.id/api/v1',
|
|
7
|
+
deepseek: 'https://api.deepseek.com',
|
|
8
|
+
'fireworks-ai': 'https://api.fireworks.ai/inference/v1',
|
|
9
|
+
'github-models': 'https://models.github.ai/inference',
|
|
10
|
+
huggingface: 'https://router.huggingface.co/v1',
|
|
11
|
+
minimax: 'https://api.minimax.io/anthropic',
|
|
12
|
+
'opencode-go-anthropic': 'https://opencode.ai/zen/go',
|
|
13
|
+
'opencode-go-openai': 'https://opencode.ai/zen/go/v1',
|
|
14
|
+
openrouter: 'https://openrouter.ai/api/v1',
|
|
15
|
+
sumopod: 'https://ai.sumopod.com',
|
|
16
|
+
'xiaomi-mimo': 'https://token-plan-sgp.xiaomimimo.com/v1',
|
|
17
|
+
};
|
|
18
|
+
export const minimaxModels = [
|
|
19
|
+
{
|
|
20
|
+
contextLength: 1_000_000,
|
|
21
|
+
description: 'MiniMax M3 chat model.',
|
|
22
|
+
id: 'MiniMax-M3',
|
|
23
|
+
name: 'MiniMax-M3',
|
|
24
|
+
ownedBy: 'minimax',
|
|
25
|
+
type: 'chat',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
contextLength: 204_800,
|
|
29
|
+
description: 'MiniMax M2.7 chat model.',
|
|
30
|
+
id: 'MiniMax-M2.7',
|
|
31
|
+
name: 'MiniMax-M2.7',
|
|
32
|
+
ownedBy: 'minimax',
|
|
33
|
+
type: 'chat',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
contextLength: 204_800,
|
|
37
|
+
description: 'MiniMax M2.7 high-speed chat model.',
|
|
38
|
+
id: 'MiniMax-M2.7-highspeed',
|
|
39
|
+
name: 'MiniMax-M2.7-highspeed',
|
|
40
|
+
ownedBy: 'minimax',
|
|
41
|
+
type: 'chat',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
export const xiaomiMimoModels = [
|
|
45
|
+
{
|
|
46
|
+
contextLength: 1_048_576,
|
|
47
|
+
description: 'Flagship reasoning model for text generation and agents.',
|
|
48
|
+
id: 'mimo-v2.5-pro',
|
|
49
|
+
name: 'MiMo-V2.5-Pro',
|
|
50
|
+
ownedBy: 'xiaomi',
|
|
51
|
+
type: 'chat',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
contextLength: 1_048_576,
|
|
55
|
+
description: 'Multimodal model for text, image, audio, and video understanding.',
|
|
56
|
+
id: 'mimo-v2.5',
|
|
57
|
+
name: 'MiMo-V2.5',
|
|
58
|
+
ownedBy: 'xiaomi',
|
|
59
|
+
type: 'chat',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
contextLength: 1_048_576,
|
|
63
|
+
description: 'Flagship reasoning model for text generation and agents.',
|
|
64
|
+
id: 'mimo-v2-pro',
|
|
65
|
+
name: 'MiMo-V2-Pro',
|
|
66
|
+
ownedBy: 'xiaomi',
|
|
67
|
+
type: 'chat',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
contextLength: 262_144,
|
|
71
|
+
description: 'Omni-modal model for multimodal understanding.',
|
|
72
|
+
id: 'mimo-v2-omni',
|
|
73
|
+
name: 'MiMo-V2-Omni',
|
|
74
|
+
ownedBy: 'xiaomi',
|
|
75
|
+
type: 'chat',
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const opencodeGoModelProtocols = {
|
|
79
|
+
'deepseek-v4-flash': 'openai-compatible',
|
|
80
|
+
'deepseek-v4-pro': 'openai-compatible',
|
|
81
|
+
'glm-5': 'openai-compatible',
|
|
82
|
+
'glm-5.1': 'openai-compatible',
|
|
83
|
+
'kimi-k2.5': 'openai-compatible',
|
|
84
|
+
'kimi-k2.6': 'openai-compatible',
|
|
85
|
+
'mimo-v2-omni': 'openai-compatible',
|
|
86
|
+
'mimo-v2-pro': 'openai-compatible',
|
|
87
|
+
'mimo-v2.5': 'openai-compatible',
|
|
88
|
+
'mimo-v2.5-pro': 'openai-compatible',
|
|
89
|
+
'minimax-m2.5': 'anthropic',
|
|
90
|
+
'minimax-m2.7': 'anthropic',
|
|
91
|
+
'qwen3.5-plus': 'anthropic',
|
|
92
|
+
'qwen3.6-plus': 'anthropic',
|
|
93
|
+
'qwen3.7-max': 'anthropic',
|
|
94
|
+
};
|
|
95
|
+
export const opencodeGoModelProtocol = (model) => opencodeGoModelProtocols[model];
|
|
96
|
+
export const requireOpencodeGoModelProtocol = (model) => {
|
|
97
|
+
const protocol = opencodeGoModelProtocol(model);
|
|
98
|
+
if (!protocol)
|
|
99
|
+
throw new Error(`OpenCode Go model "${model}" is not supported because its protocol is not mapped.`);
|
|
100
|
+
return protocol;
|
|
101
|
+
};
|
|
102
|
+
const staticModelList = (models) => ({ data: [...models] });
|
|
103
|
+
const openAiCompatibleConnection = (credentials, baseUrl) => {
|
|
104
|
+
const client = new OpenAIClient({ apiKey: credentials.apiKey, baseUrl });
|
|
105
|
+
return {
|
|
106
|
+
model: (model) => client.completionModel(model),
|
|
107
|
+
listModels: () => client.listModels(),
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const anthropicConnection = (credentials, baseUrl) => {
|
|
111
|
+
const client = new AnthropicClient({ apiKey: credentials.apiKey, ...(baseUrl ? { baseUrl } : {}) });
|
|
112
|
+
return {
|
|
113
|
+
model: (model) => client.completionModel(model),
|
|
114
|
+
listModels: () => client.listModels(),
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const opencodeGoConnection = (credentials) => {
|
|
118
|
+
const listingClient = new OpenAIClient({ apiKey: credentials.apiKey, baseUrl: providerBaseUrls['opencode-go-openai'] });
|
|
119
|
+
return {
|
|
120
|
+
model: (model) => {
|
|
121
|
+
const protocol = requireOpencodeGoModelProtocol(model);
|
|
122
|
+
if (protocol === 'anthropic') {
|
|
123
|
+
return new AnthropicClient({
|
|
124
|
+
apiKey: credentials.apiKey,
|
|
125
|
+
baseUrl: providerBaseUrls['opencode-go-anthropic'],
|
|
126
|
+
}).completionModel(model);
|
|
127
|
+
}
|
|
128
|
+
return listingClient.completionModel(model);
|
|
129
|
+
},
|
|
130
|
+
listModels: async () => {
|
|
131
|
+
const listing = await listingClient.listModels();
|
|
132
|
+
return { ...listing, data: listing.data.filter((model) => Boolean(opencodeGoModelProtocol(model.id))) };
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export const defaultProviderFactory = (provider, credentials) => {
|
|
137
|
+
if (provider === 'openai') {
|
|
138
|
+
const client = new OpenAIClient({ apiKey: credentials.apiKey });
|
|
139
|
+
return { model: (model) => client.completionModel(model), listModels: () => client.listModels() };
|
|
140
|
+
}
|
|
141
|
+
if (provider === 'anthropic')
|
|
142
|
+
return anthropicConnection(credentials);
|
|
143
|
+
if (provider === 'minimax') {
|
|
144
|
+
const connection = anthropicConnection(credentials, providerBaseUrls.minimax);
|
|
145
|
+
return { ...connection, listModels: async () => staticModelList(minimaxModels) };
|
|
146
|
+
}
|
|
147
|
+
if (provider === 'xiaomi-mimo') {
|
|
148
|
+
const client = new OpenAIClient({
|
|
149
|
+
apiKey: credentials.apiKey,
|
|
150
|
+
baseUrl: providerBaseUrls['xiaomi-mimo'],
|
|
151
|
+
headers: { 'api-key': credentials.apiKey },
|
|
152
|
+
});
|
|
153
|
+
return {
|
|
154
|
+
model: (model) => client.completionModel(model),
|
|
155
|
+
listModels: async () => staticModelList(xiaomiMimoModels),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (provider === 'opencode-go')
|
|
159
|
+
return opencodeGoConnection(credentials);
|
|
160
|
+
if (provider === 'databricks') {
|
|
161
|
+
if (!credentials.baseUrl)
|
|
162
|
+
throw new Error('Databricks workspace URL is not configured.');
|
|
163
|
+
return openAiCompatibleConnection(credentials, normalizeDatabricksBaseUrl(credentials.baseUrl));
|
|
164
|
+
}
|
|
165
|
+
return openAiCompatibleConnection(credentials, providerBaseUrls[provider]);
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=provider-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-client.js","sourceRoot":"","sources":["../../../src/libs/provider-clients/provider-client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AK,kBAAkB,EACvB,KAAK,UAAU,GACf,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/libs/provider-definitions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,WAAW,GAGX,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const providerIds: readonly ['openai', 'openrouter', 'deepseek', 'fireworks-ai', 'github-models', 'huggingface', 'devscale-ai', 'sumopod', 'databricks', 'anthropic', 'opencode-go', 'xiaomi-mimo', 'minimax'];
|
|
2
|
+
export type ProviderId = (typeof providerIds)[number];
|
|
3
|
+
export type ProviderDescriptor = {
|
|
4
|
+
id: ProviderId;
|
|
5
|
+
label: string;
|
|
6
|
+
baseUrl?: {
|
|
7
|
+
label: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const providerCatalog: Record<ProviderId, ProviderDescriptor>;
|
|
13
|
+
export declare const isProviderId: (value: string) => value is ProviderId;
|
|
14
|
+
export declare const normalizeDatabricksBaseUrl: (value: string) => string;
|
|
15
|
+
export declare const normalizeProviderBaseUrl: (provider: ProviderId, value: string) => string;
|
|
16
|
+
//# sourceMappingURL=provider-definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-definitions.d.ts","sourceRoot":"","sources":["../../../src/libs/provider-definitions/provider-definitions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,YACvB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,CACA,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG;IAChC,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,IAAI,CAAC;KACf,CAAC;CACF,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAsBlE,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,KAAK,IAAI,UAAgE,CAAC;AAIvH,eAAO,MAAM,0BAA0B,UAAW,MAAM,KAAG,MAS1D,CAAC;AAEF,eAAO,MAAM,wBAAwB,aAAc,UAAU,SAAS,MAAM,KAAG,MAG9E,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export const providerIds = [
|
|
2
|
+
'openai',
|
|
3
|
+
'openrouter',
|
|
4
|
+
'deepseek',
|
|
5
|
+
'fireworks-ai',
|
|
6
|
+
'github-models',
|
|
7
|
+
'huggingface',
|
|
8
|
+
'devscale-ai',
|
|
9
|
+
'sumopod',
|
|
10
|
+
'databricks',
|
|
11
|
+
'anthropic',
|
|
12
|
+
'opencode-go',
|
|
13
|
+
'xiaomi-mimo',
|
|
14
|
+
'minimax',
|
|
15
|
+
];
|
|
16
|
+
export const providerCatalog = {
|
|
17
|
+
openai: { id: 'openai', label: 'OpenAI' },
|
|
18
|
+
openrouter: { id: 'openrouter', label: 'OpenRouter' },
|
|
19
|
+
deepseek: { id: 'deepseek', label: 'DeepSeek' },
|
|
20
|
+
'fireworks-ai': { id: 'fireworks-ai', label: 'Fireworks AI' },
|
|
21
|
+
'github-models': { id: 'github-models', label: 'GitHub Models' },
|
|
22
|
+
huggingface: { id: 'huggingface', label: 'Hugging Face' },
|
|
23
|
+
'devscale-ai': { id: 'devscale-ai', label: 'Devscale AI' },
|
|
24
|
+
sumopod: { id: 'sumopod', label: 'Sumopod' },
|
|
25
|
+
databricks: {
|
|
26
|
+
id: 'databricks',
|
|
27
|
+
label: 'Databricks',
|
|
28
|
+
baseUrl: {
|
|
29
|
+
label: 'Workspace URL',
|
|
30
|
+
placeholder: 'https://dbc-12345678.cloud.databricks.com',
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
anthropic: { id: 'anthropic', label: 'Anthropic' },
|
|
35
|
+
'opencode-go': { id: 'opencode-go', label: 'OpenCode Go' },
|
|
36
|
+
'xiaomi-mimo': { id: 'xiaomi-mimo', label: 'Xiaomi Mimo Singapore' },
|
|
37
|
+
minimax: { id: 'minimax', label: 'MiniMax' },
|
|
38
|
+
};
|
|
39
|
+
export const isProviderId = (value) => providerIds.some((provider) => provider === value);
|
|
40
|
+
const databricksDefaultPath = '/ai-gateway/mlflow/v1';
|
|
41
|
+
export const normalizeDatabricksBaseUrl = (value) => {
|
|
42
|
+
const trimmed = value.trim();
|
|
43
|
+
if (!trimmed)
|
|
44
|
+
throw new Error('Databricks workspace URL is required.');
|
|
45
|
+
const url = new URL(/^https?:\/\//iu.test(trimmed) ? trimmed : `https://${trimmed}`);
|
|
46
|
+
if (!url.hostname)
|
|
47
|
+
throw new Error('Databricks workspace URL is invalid.');
|
|
48
|
+
if (!url.pathname || url.pathname === '/')
|
|
49
|
+
url.pathname = databricksDefaultPath;
|
|
50
|
+
url.hash = '';
|
|
51
|
+
url.search = '';
|
|
52
|
+
return url.toString().replace(/\/$/u, '');
|
|
53
|
+
};
|
|
54
|
+
export const normalizeProviderBaseUrl = (provider, value) => {
|
|
55
|
+
if (provider === 'databricks')
|
|
56
|
+
return normalizeDatabricksBaseUrl(value);
|
|
57
|
+
return value.trim();
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=provider-definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-definitions.js","sourceRoot":"","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CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/pty/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,GACd,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/libs/pty/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,aAAa,GAIb,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ExecCommandResult = {
|
|
2
|
+
command: string;
|
|
3
|
+
cwd: string;
|
|
4
|
+
exitCode: number | null;
|
|
5
|
+
signal: number | null;
|
|
6
|
+
timedOut: boolean;
|
|
7
|
+
truncated: boolean;
|
|
8
|
+
output: string;
|
|
9
|
+
};
|
|
10
|
+
export type ExecCommandOptions = {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
};
|
|
14
|
+
export interface PtyRunner {
|
|
15
|
+
run(command: string, options?: ExecCommandOptions): Promise<ExecCommandResult>;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class NodePtyRunner implements PtyRunner {
|
|
19
|
+
#private;
|
|
20
|
+
readonly cwd: string;
|
|
21
|
+
constructor(cwd?: string);
|
|
22
|
+
run(command: string, options?: ExecCommandOptions): Promise<ExecCommandResult>;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare const commandResultDetail: (result: ExecCommandResult) => string;
|
|
26
|
+
//# sourceMappingURL=pty-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pty-runner.d.ts","sourceRoot":"","sources":["../../../src/libs/pty/pty-runner.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,SAAS;IACzB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/E,OAAO,IAAI,IAAI,CAAC;CAChB;AAiED,qBAAa,aAAc,YAAW,SAAS;;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAKrB,YAAY,GAAG,SAAgB,EAG9B;IAED,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA0DjF;IAED,OAAO,IAAI,IAAI,CAGd;CAUD;AAED,eAAO,MAAM,mBAAmB,WAAY,iBAAiB,KAAG,MAM/D,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import { accessSync, chmodSync, constants, existsSync } from 'node:fs';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import * as nodePty from 'node-pty';
|
|
6
|
+
import stripAnsi from 'strip-ansi';
|
|
7
|
+
const OUTPUT_LIMIT = 64 * 1024;
|
|
8
|
+
const OUTPUT_HALF = OUTPUT_LIMIT / 2;
|
|
9
|
+
const DEFAULT_TIMEOUT = 120_000;
|
|
10
|
+
const TRUNCATION_MARKER = '\n… output truncated …\n';
|
|
11
|
+
const appendOutput = (capture, data) => {
|
|
12
|
+
const chunk = Buffer.from(data);
|
|
13
|
+
capture.total += chunk.length;
|
|
14
|
+
let offset = 0;
|
|
15
|
+
if (capture.first.length < OUTPUT_HALF) {
|
|
16
|
+
const remaining = OUTPUT_HALF - capture.first.length;
|
|
17
|
+
const firstPart = chunk.subarray(0, remaining);
|
|
18
|
+
capture.first = Buffer.concat([capture.first, firstPart]);
|
|
19
|
+
offset = firstPart.length;
|
|
20
|
+
}
|
|
21
|
+
const combinedTail = Buffer.concat([capture.tail, chunk.subarray(offset)]);
|
|
22
|
+
capture.tail = combinedTail.subarray(Math.max(0, combinedTail.length - OUTPUT_HALF));
|
|
23
|
+
};
|
|
24
|
+
const captureText = (capture) => {
|
|
25
|
+
const truncated = capture.total > OUTPUT_LIMIT;
|
|
26
|
+
const raw = `${capture.first.toString('utf8')}${truncated ? TRUNCATION_MARKER : ''}${capture.tail.toString('utf8')}`;
|
|
27
|
+
return {
|
|
28
|
+
truncated,
|
|
29
|
+
output: stripAnsi(raw)
|
|
30
|
+
.replaceAll('\r\n', '\n')
|
|
31
|
+
.replaceAll('\r', '\n')
|
|
32
|
+
.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/gu, '')
|
|
33
|
+
.trimEnd(),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const shellCommand = (command) => {
|
|
37
|
+
if (process.platform === 'win32') {
|
|
38
|
+
if (process.env.COMSPEC)
|
|
39
|
+
return { file: process.env.COMSPEC, args: ['/d', '/s', '/c', command] };
|
|
40
|
+
return { file: 'powershell.exe', args: ['-NoLogo', '-NoProfile', '-Command', command] };
|
|
41
|
+
}
|
|
42
|
+
return { file: process.env.SHELL ?? '/bin/sh', args: ['-lc', command] };
|
|
43
|
+
};
|
|
44
|
+
const ensureSpawnHelperIsExecutable = () => {
|
|
45
|
+
if (process.platform === 'win32')
|
|
46
|
+
return;
|
|
47
|
+
const require = createRequire(import.meta.url);
|
|
48
|
+
const packageRoot = dirname(require.resolve('node-pty/package.json'));
|
|
49
|
+
for (const helper of [
|
|
50
|
+
join(packageRoot, 'prebuilds', `${process.platform}-${process.arch}`, 'spawn-helper'),
|
|
51
|
+
join(packageRoot, 'build', 'Release', 'spawn-helper'),
|
|
52
|
+
]) {
|
|
53
|
+
if (!existsSync(helper))
|
|
54
|
+
continue;
|
|
55
|
+
try {
|
|
56
|
+
accessSync(helper, constants.X_OK);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
chmodSync(helper, 0o755);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export class NodePtyRunner {
|
|
64
|
+
cwd;
|
|
65
|
+
#active = new Set();
|
|
66
|
+
#forceTimers = new Map();
|
|
67
|
+
#disposed = false;
|
|
68
|
+
constructor(cwd = process.cwd()) {
|
|
69
|
+
ensureSpawnHelperIsExecutable();
|
|
70
|
+
this.cwd = cwd;
|
|
71
|
+
}
|
|
72
|
+
run(command, options = {}) {
|
|
73
|
+
if (this.#disposed)
|
|
74
|
+
return Promise.reject(new Error('PTY runner has been disposed'));
|
|
75
|
+
const normalized = command.trim();
|
|
76
|
+
if (!normalized)
|
|
77
|
+
return Promise.reject(new Error('Command must not be empty'));
|
|
78
|
+
if (options.signal?.aborted)
|
|
79
|
+
return Promise.reject(options.signal.reason ?? new Error('Aborted'));
|
|
80
|
+
const shell = shellCommand(normalized);
|
|
81
|
+
const environment = Object.fromEntries(Object.entries(process.env).flatMap(([key, value]) => (value === undefined ? [] : [[key, value]])));
|
|
82
|
+
const terminal = nodePty.spawn(shell.file, shell.args, {
|
|
83
|
+
name: 'xterm-256color',
|
|
84
|
+
cwd: this.cwd,
|
|
85
|
+
cols: Math.max(20, process.stdout.columns ?? 120),
|
|
86
|
+
rows: Math.max(5, process.stdout.rows ?? 30),
|
|
87
|
+
env: { ...environment, TERM: 'xterm-256color' },
|
|
88
|
+
});
|
|
89
|
+
this.#active.add(terminal);
|
|
90
|
+
return new Promise((resolve, reject) => {
|
|
91
|
+
const capture = { first: Buffer.alloc(0), tail: Buffer.alloc(0), total: 0 };
|
|
92
|
+
let timedOut = false;
|
|
93
|
+
let aborted = false;
|
|
94
|
+
const terminate = () => this.#terminate(terminal);
|
|
95
|
+
const timeout = setTimeout(() => {
|
|
96
|
+
timedOut = true;
|
|
97
|
+
terminate();
|
|
98
|
+
}, options.timeoutMs ?? DEFAULT_TIMEOUT);
|
|
99
|
+
const abort = () => {
|
|
100
|
+
aborted = true;
|
|
101
|
+
terminate();
|
|
102
|
+
};
|
|
103
|
+
options.signal?.addEventListener('abort', abort, { once: true });
|
|
104
|
+
terminal.onData((data) => appendOutput(capture, data));
|
|
105
|
+
terminal.onExit(({ exitCode, signal }) => {
|
|
106
|
+
clearTimeout(timeout);
|
|
107
|
+
const forceTimer = this.#forceTimers.get(terminal);
|
|
108
|
+
if (forceTimer)
|
|
109
|
+
clearTimeout(forceTimer);
|
|
110
|
+
this.#forceTimers.delete(terminal);
|
|
111
|
+
options.signal?.removeEventListener('abort', abort);
|
|
112
|
+
this.#active.delete(terminal);
|
|
113
|
+
if (aborted) {
|
|
114
|
+
reject(options.signal?.reason ?? new Error('Aborted'));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const result = captureText(capture);
|
|
118
|
+
resolve({
|
|
119
|
+
command: normalized,
|
|
120
|
+
cwd: this.cwd,
|
|
121
|
+
exitCode: Number.isInteger(exitCode) ? exitCode : null,
|
|
122
|
+
signal: signal !== undefined && Number.isInteger(signal) ? signal : null,
|
|
123
|
+
timedOut,
|
|
124
|
+
truncated: result.truncated,
|
|
125
|
+
output: result.output,
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
dispose() {
|
|
131
|
+
this.#disposed = true;
|
|
132
|
+
for (const terminal of this.#active)
|
|
133
|
+
this.#terminate(terminal);
|
|
134
|
+
}
|
|
135
|
+
#terminate(terminal) {
|
|
136
|
+
if (this.#forceTimers.has(terminal))
|
|
137
|
+
return;
|
|
138
|
+
const timer = setTimeout(() => {
|
|
139
|
+
if (this.#active.has(terminal))
|
|
140
|
+
terminal.kill('SIGKILL');
|
|
141
|
+
}, 1000);
|
|
142
|
+
this.#forceTimers.set(terminal, timer);
|
|
143
|
+
terminal.kill();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export const commandResultDetail = (result) => {
|
|
147
|
+
const status = result.timedOut ? 'Timed out' : `Exit code: ${result.exitCode ?? 'unknown'}`;
|
|
148
|
+
const signal = result.signal && result.signal !== 0 ? `Signal: ${result.signal}` : '';
|
|
149
|
+
return [status, signal, result.truncated ? 'Output was truncated.' : '', result.output || '(no output)']
|
|
150
|
+
.filter(Boolean)
|
|
151
|
+
.join('\n');
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=pty-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pty-runner.js","sourceRoot":"","sources":["../../../src/libs/pty/pty-runner.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AACrE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,SAAS,MAAM,YAAY,CAAC;AAsBnC,MAAM,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/B,MAAM,WAAW,GAAG,YAAY,GAAG,CAAC,CAAC;AACrC,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAQrD,MAAM,YAAY,GAAG,CAAC,OAAsB,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AS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC;SACtG,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/session-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,KAAK,oBAAoB,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/libs/session-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAA4B,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type StoredProjectSession = {
|
|
2
|
+
id: string;
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
title: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class SessionCatalog {
|
|
9
|
+
#private;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
constructor(path: string);
|
|
12
|
+
list(projectRoot: string): StoredProjectSession[];
|
|
13
|
+
get(projectRoot: string, sessionId: string): StoredProjectSession | undefined;
|
|
14
|
+
save(session: StoredProjectSession): void;
|
|
15
|
+
touch(projectRoot: string, sessionId: string, updatedAt: string): StoredProjectSession;
|
|
16
|
+
claimLegacy(projectRoot: string, hasLegacyHistory: boolean, now?: string): StoredProjectSession | undefined;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=session-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-catalog.d.ts","sourceRoot":"","sources":["../../../src/libs/session-storage/session-catalog.ts"],"names":[],"mappings":"AAwCA,MAAM,MAAM,oBAAoB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAUF,qBAAa,cAAc;;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAGtB,YAAY,IAAI,EAAE,MAAM,EAEvB;IAED,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAYhD;IAED,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAW5E;IAED,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAwBxC;IAED,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,oBAAoB,CA6BrF;IAED,WAAW,CACV,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,OAAO,EACzB,GAAG,SAA2B,GAC5B,oBAAoB,GAAG,SAAS,CAmClC;IAED,OAAO,IAAI,IAAI,CAGd;CA6BD"}
|