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 @@
|
|
|
1
|
+
{"version":3,"file":"file-tools.js","sourceRoot":"","sources":["../../../../src/modules/agent/prompts/file-tools.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACtD,2HAA2H;IAC3H,2GAA2G;IAC3G,6HAA6H;IAC7H,iHAAiH;CACjH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../src/modules/agent/prompts/identity.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,gBAAiB,MAAM,KAAG,SAAS,MAAM,EAGzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../../src/modules/agent/prompts/identity.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAmB,EAAqB,EAAE,CAAC;IAC/E,oDAAoD;IACpD,qDAAqD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG;CACnF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/modules/agent/prompts/system.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,KAAG,MAC2C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { commandInstructions } from './commands.js';
|
|
2
|
+
import { fileToolInstructions } from './file-tools.js';
|
|
3
|
+
import { identityInstructions } from './identity.js';
|
|
4
|
+
export const buildSystemPrompt = (projectRoot) => [...identityInstructions(projectRoot), ...fileToolInstructions, ...commandInstructions].join('\n');
|
|
5
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../../src/modules/agent/prompts/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAAU,EAAE,CAChE,CAAC,GAAG,oBAAoB,CAAC,WAAW,CAAC,EAAE,GAAG,oBAAoB,EAAE,GAAG,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SqliteMemoryStore } from '@anvia/memory-sqlite';
|
|
2
|
+
import type { RuntimeEvent } from '../types.js';
|
|
3
|
+
import type { SubmitRequest } from '../types.js';
|
|
4
|
+
import type { PtyRunner } from '../../../libs/pty/index.js';
|
|
5
|
+
export declare class DirectCommandExecutor {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(projectRoot: string, memory: SqliteMemoryStore, pty: PtyRunner);
|
|
8
|
+
run(request: SubmitRequest, signal: AbortSignal, sessionId: string): AsyncIterable<RuntimeEvent>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=direct-command-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direct-command-executor.d.ts","sourceRoot":"","sources":["../../../../src/modules/agent/services/direct-command-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAG1D,qBAAa,qBAAqB;;IAKjC,YAAY,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,SAAS,EAIzE;IAEM,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CA2CtG;CACD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AssistantContent, Message } from '@anvia/core';
|
|
2
|
+
import { toolMessageFromResult } from '../events/tool-message-adapter.js';
|
|
3
|
+
export class DirectCommandExecutor {
|
|
4
|
+
#memory;
|
|
5
|
+
#projectRoot;
|
|
6
|
+
#pty;
|
|
7
|
+
constructor(projectRoot, memory, pty) {
|
|
8
|
+
this.#projectRoot = projectRoot;
|
|
9
|
+
this.#memory = memory;
|
|
10
|
+
this.#pty = pty;
|
|
11
|
+
}
|
|
12
|
+
async *run(request, signal, sessionId) {
|
|
13
|
+
const messageId = `bash-${request.id}`;
|
|
14
|
+
yield { type: 'status.changed', status: 'runningTool' };
|
|
15
|
+
yield {
|
|
16
|
+
type: 'message.appended',
|
|
17
|
+
message: {
|
|
18
|
+
id: messageId,
|
|
19
|
+
kind: 'tool',
|
|
20
|
+
name: 'ExecCommand',
|
|
21
|
+
status: 'running',
|
|
22
|
+
summary: request.content,
|
|
23
|
+
group: 'bash',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const result = await this.#pty.run(request.content, { signal });
|
|
27
|
+
const toolCallId = `direct-${request.id}`;
|
|
28
|
+
let persistenceFailed = false;
|
|
29
|
+
try {
|
|
30
|
+
await this.#memory.append({
|
|
31
|
+
context: { sessionId, metadata: { projectRoot: this.#projectRoot } },
|
|
32
|
+
runId: request.id,
|
|
33
|
+
turn: 1,
|
|
34
|
+
messages: [
|
|
35
|
+
Message.user(request.content, { metadata: { avenMode: 'bash' } }),
|
|
36
|
+
Message.assistant([AssistantContent.toolCall(toolCallId, 'ExecCommand', { command: request.content })]),
|
|
37
|
+
Message.toolResult(toolCallId, result, { toolName: 'ExecCommand' }),
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
persistenceFailed = true;
|
|
43
|
+
}
|
|
44
|
+
yield { type: 'message.replaced', message: toolMessageFromResult(messageId, result) };
|
|
45
|
+
if (persistenceFailed) {
|
|
46
|
+
yield {
|
|
47
|
+
type: 'message.appended',
|
|
48
|
+
message: {
|
|
49
|
+
id: `shell-history-warning-${request.id}`,
|
|
50
|
+
kind: 'system',
|
|
51
|
+
level: 'warning',
|
|
52
|
+
content: 'The command completed, but Aven could not save it to session history.',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=direct-command-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direct-command-executor.js","sourceRoot":"","sources":["../../../../src/modules/agent/services/direct-command-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAE,OAAO,EAAC,MAAM,aAAa,CAAC;AAKtD,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAExE,MAAM,OAAO,qBAAqB;IACxB,OAAO,CAAoB;IAC3B,YAAY,CAAS;IACrB,IAAI,CAAY;IAEzB,YAAY,WAAmB,EAAE,MAAyB,EAAE,GAAc;QACzE,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,CAAC,GAAG,CAAC,OAAsB,EAAE,MAAmB,EAAE,SAAiB;QACxE,MAAM,SAAS,GAAG,QAAQ,OAAO,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,EAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAC,CAAC;QACtD,MAAM;YACL,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE;gBACR,EAAE,EAAE,SAAS;gBACb,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa;gBACnB,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,KAAK,EAAE,MAAM;aACb;SACD,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,UAAU,OAAO,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} from '@anvia/memory-sqlite';
|
|
3
|
+
import type { RuntimeEvent } from '../types.js';
|
|
4
|
+
import type { SubmitRequest } from '../types.js';
|
|
5
|
+
import type { FileToolService } from '../tools/files/file-tool-service.js';
|
|
6
|
+
import type { PtyRunner } from '../../../libs/pty/index.js';
|
|
7
|
+
export declare class PromptTurnExecutor {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(projectRoot: string, memory: SqliteMemoryStore, pty: PtyRunner, files: FileToolService);
|
|
10
|
+
run(request: SubmitRequest, signal: AbortSignal, model: CompletionModel, sessionId: string): AsyncIterable<RuntimeEvent>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=prompt-turn-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-turn-executor.d.ts","sourceRoot":"","sources":["../../../../src/modules/agent/services/prompt-turn-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,eAAe,EAAC,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAG/C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAK1D,qBAAa,kBAAkB;;IAM9B,YAAY,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAKjG;IAEM,GAAG,CACT,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,MAAM,GACf,aAAa,CAAC,YAAY,CAAC,CA6D7B;CACD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AgentBuilder } from '@anvia/core';
|
|
2
|
+
import { createExecCommandTool } from '../tools/exec-command.js';
|
|
3
|
+
import { createFileTools } from '../tools/files/create-file-tools.js';
|
|
4
|
+
import { safeErrorMessage } from '../../../utils/safe-error.js';
|
|
5
|
+
import { eventToRuntimeEvents } from '../events/stream-event-adapter.js';
|
|
6
|
+
import { buildSystemPrompt } from '../prompts/system.js';
|
|
7
|
+
export class PromptTurnExecutor {
|
|
8
|
+
#files;
|
|
9
|
+
#memory;
|
|
10
|
+
#projectRoot;
|
|
11
|
+
#pty;
|
|
12
|
+
constructor(projectRoot, memory, pty, files) {
|
|
13
|
+
this.#projectRoot = projectRoot;
|
|
14
|
+
this.#memory = memory;
|
|
15
|
+
this.#pty = pty;
|
|
16
|
+
this.#files = files;
|
|
17
|
+
}
|
|
18
|
+
async *run(request, signal, model, sessionId) {
|
|
19
|
+
yield { type: 'status.changed', status: 'thinking' };
|
|
20
|
+
const tools = [createExecCommandTool(this.#pty, signal), ...createFileTools(this.#files, signal)];
|
|
21
|
+
const agent = new AgentBuilder('aven', model)
|
|
22
|
+
.instructions(buildSystemPrompt(this.#projectRoot))
|
|
23
|
+
.tools(tools)
|
|
24
|
+
.memory(this.#memory, { savePolicy: 'turn' })
|
|
25
|
+
.defaultMaxTurns(8)
|
|
26
|
+
.build();
|
|
27
|
+
const streamedTurn = agent
|
|
28
|
+
.session(sessionId, { metadata: { projectRoot: this.#projectRoot } })
|
|
29
|
+
.prompt(request.content)
|
|
30
|
+
.withToolConcurrency(1)
|
|
31
|
+
.stream();
|
|
32
|
+
const stream = streamedTurn[Symbol.asyncIterator]();
|
|
33
|
+
const stop = () => {
|
|
34
|
+
void stream.return?.();
|
|
35
|
+
};
|
|
36
|
+
signal.addEventListener('abort', stop, { once: true });
|
|
37
|
+
const baseAssistantId = `assistant-${request.id}`;
|
|
38
|
+
let assistantId = baseAssistantId;
|
|
39
|
+
let assistantText = '';
|
|
40
|
+
const toolQueue = [];
|
|
41
|
+
try {
|
|
42
|
+
while (true) {
|
|
43
|
+
const next = await stream.next();
|
|
44
|
+
if (next.done)
|
|
45
|
+
break;
|
|
46
|
+
const event = next.value;
|
|
47
|
+
if (event.type === 'turn_start') {
|
|
48
|
+
assistantId = event.turn === 1 ? baseAssistantId : `${baseAssistantId}-turn-${event.turn}`;
|
|
49
|
+
assistantText = '';
|
|
50
|
+
}
|
|
51
|
+
for (const runtimeEvent of eventToRuntimeEvents(event, request.id, assistantId, toolQueue, assistantText, this.#files)) {
|
|
52
|
+
if (runtimeEvent.type === 'assistant.delta')
|
|
53
|
+
assistantText += runtimeEvent.delta;
|
|
54
|
+
yield runtimeEvent;
|
|
55
|
+
}
|
|
56
|
+
if (event.type === 'final' && event.output !== assistantText) {
|
|
57
|
+
yield {
|
|
58
|
+
type: 'message.replaced',
|
|
59
|
+
message: { id: assistantId, kind: 'assistant', variant: 'text', content: event.output },
|
|
60
|
+
};
|
|
61
|
+
assistantText = event.output;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (signal.aborted)
|
|
65
|
+
throw signal.reason ?? new Error('Aborted');
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (signal.aborted)
|
|
69
|
+
throw signal.reason ?? error;
|
|
70
|
+
// Do not retain the provider error as a cause; it may contain credentials.
|
|
71
|
+
// eslint-disable-next-line preserve-caught-error
|
|
72
|
+
throw new Error(safeErrorMessage(error));
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
signal.removeEventListener('abort', stop);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=prompt-turn-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-turn-executor.js","sourceRoot":"","sources":["../../../../src/modules/agent/services/prompt-turn-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAuB,MAAM,aAAa,CAAC;AAI/D,OAAO,EAAC,qBAAqB,EAA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AAC,IAAI,KAAK,iBAAiB;wBAAE,aAAa,IAAI,YAAY,CAAC,KAAK,CAAC;oBACjF,MAAM,YAAY,CAAC;gBACpB,CAAC;gBACD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;oBAC9D,MAAM;wBACL,IAAI,EAAE,kBAAkB;wBACxB,OAAO,EAAE,EAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAC;qBACrF,CAAC;oBACF,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC9B,CAAC;YACF,CAAC;YACD,IAAI,MAAM,CAAC,OAAO;gBAAE,MAAM,MAAM,CAAC,MAAM,IAAI,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,MAAM,CAAC,OAAO;gBAAE,MAAM,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC;YACjD,2EAA2E;YAC3E,iDAAiD;YACjD,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,CAAC;gBAAS,CAAC;YACV,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PtyRunner } from '../../../libs/pty/index.js';
|
|
2
|
+
export declare const createExecCommandTool: (pty: PtyRunner, signal: AbortSignal) => import("@anvia/core").Tool<{
|
|
3
|
+
command: string;
|
|
4
|
+
}, {
|
|
5
|
+
command: string;
|
|
6
|
+
cwd: string;
|
|
7
|
+
exitCode: number | null;
|
|
8
|
+
signal: number | null;
|
|
9
|
+
timedOut: boolean;
|
|
10
|
+
truncated: boolean;
|
|
11
|
+
output: string;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=exec-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-command.d.ts","sourceRoot":"","sources":["../../../../src/modules/agent/tools/exec-command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAG1D,eAAO,MAAM,qBAAqB,QAAS,SAAS,UAAU,WAAW;;;;;;;;;;EAOtE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createTool } from '@anvia/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { execResultSchema } from '../events/tool-message-adapter.js';
|
|
4
|
+
export const createExecCommandTool = (pty, signal) => createTool({
|
|
5
|
+
name: 'ExecCommand',
|
|
6
|
+
description: 'Run a shell command in the current workspace using a PTY and return its exit status and output.',
|
|
7
|
+
input: z.object({ command: z.string().min(1).describe('The shell command to execute.') }),
|
|
8
|
+
output: execResultSchema,
|
|
9
|
+
execute: ({ command }) => pty.run(command, { signal }),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=exec-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-command.js","sourceRoot":"","sources":["../../../../src/modules/agent/tools/exec-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AAEnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAc,EAAE,MAAmB,EAAE,EAAE,CAC5E,UAAU,CAAC;IACV,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,iGAAiG;IAC9G,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAC,CAAC;IACvF,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,EAAC,MAAM,EAAC,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const readInputSchema: z.ZodObject<{
|
|
3
|
+
file_path: z.ZodString;
|
|
4
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const editInputSchema: z.ZodObject<{
|
|
8
|
+
file_path: z.ZodString;
|
|
9
|
+
old_string: z.ZodString;
|
|
10
|
+
new_string: z.ZodString;
|
|
11
|
+
replace_all: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const writeInputSchema: z.ZodObject<{
|
|
14
|
+
file_path: z.ZodString;
|
|
15
|
+
content: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export declare const readResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
18
|
+
status: z.ZodLiteral<"success">;
|
|
19
|
+
tool: z.ZodLiteral<"Read">;
|
|
20
|
+
file_path: z.ZodString;
|
|
21
|
+
content: z.ZodString;
|
|
22
|
+
start_line: z.ZodNumber;
|
|
23
|
+
num_lines: z.ZodNumber;
|
|
24
|
+
total_lines: z.ZodNumber;
|
|
25
|
+
truncated: z.ZodBoolean;
|
|
26
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
27
|
+
status: z.ZodLiteral<"unchanged">;
|
|
28
|
+
tool: z.ZodLiteral<"Read">;
|
|
29
|
+
file_path: z.ZodString;
|
|
30
|
+
start_line: z.ZodNumber;
|
|
31
|
+
num_lines: z.ZodNumber;
|
|
32
|
+
total_lines: z.ZodNumber;
|
|
33
|
+
message: z.ZodString;
|
|
34
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
35
|
+
status: z.ZodLiteral<"error">;
|
|
36
|
+
tool: z.ZodEnum<{
|
|
37
|
+
Edit: "Edit";
|
|
38
|
+
Read: "Read";
|
|
39
|
+
Write: "Write";
|
|
40
|
+
}>;
|
|
41
|
+
file_path: z.ZodString;
|
|
42
|
+
error: z.ZodString;
|
|
43
|
+
}, z.core.$strict>]>;
|
|
44
|
+
export declare const editResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
45
|
+
status: z.ZodLiteral<"success">;
|
|
46
|
+
tool: z.ZodLiteral<"Edit">;
|
|
47
|
+
file_path: z.ZodString;
|
|
48
|
+
replacements: z.ZodNumber;
|
|
49
|
+
operation_id: z.ZodString;
|
|
50
|
+
message: z.ZodString;
|
|
51
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
52
|
+
status: z.ZodLiteral<"error">;
|
|
53
|
+
tool: z.ZodEnum<{
|
|
54
|
+
Edit: "Edit";
|
|
55
|
+
Read: "Read";
|
|
56
|
+
Write: "Write";
|
|
57
|
+
}>;
|
|
58
|
+
file_path: z.ZodString;
|
|
59
|
+
error: z.ZodString;
|
|
60
|
+
}, z.core.$strict>]>;
|
|
61
|
+
export declare const writeResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
62
|
+
status: z.ZodLiteral<"success">;
|
|
63
|
+
tool: z.ZodLiteral<"Write">;
|
|
64
|
+
file_path: z.ZodString;
|
|
65
|
+
operation: z.ZodEnum<{
|
|
66
|
+
create: "create";
|
|
67
|
+
update: "update";
|
|
68
|
+
}>;
|
|
69
|
+
operation_id: z.ZodString;
|
|
70
|
+
message: z.ZodString;
|
|
71
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
72
|
+
status: z.ZodLiteral<"error">;
|
|
73
|
+
tool: z.ZodEnum<{
|
|
74
|
+
Edit: "Edit";
|
|
75
|
+
Read: "Read";
|
|
76
|
+
Write: "Write";
|
|
77
|
+
}>;
|
|
78
|
+
file_path: z.ZodString;
|
|
79
|
+
error: z.ZodString;
|
|
80
|
+
}, z.core.$strict>]>;
|
|
81
|
+
export declare const fileToolResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
82
|
+
status: z.ZodLiteral<"success">;
|
|
83
|
+
tool: z.ZodLiteral<"Read">;
|
|
84
|
+
file_path: z.ZodString;
|
|
85
|
+
content: z.ZodString;
|
|
86
|
+
start_line: z.ZodNumber;
|
|
87
|
+
num_lines: z.ZodNumber;
|
|
88
|
+
total_lines: z.ZodNumber;
|
|
89
|
+
truncated: z.ZodBoolean;
|
|
90
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
91
|
+
status: z.ZodLiteral<"unchanged">;
|
|
92
|
+
tool: z.ZodLiteral<"Read">;
|
|
93
|
+
file_path: z.ZodString;
|
|
94
|
+
start_line: z.ZodNumber;
|
|
95
|
+
num_lines: z.ZodNumber;
|
|
96
|
+
total_lines: z.ZodNumber;
|
|
97
|
+
message: z.ZodString;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
status: z.ZodLiteral<"success">;
|
|
100
|
+
tool: z.ZodLiteral<"Edit">;
|
|
101
|
+
file_path: z.ZodString;
|
|
102
|
+
replacements: z.ZodNumber;
|
|
103
|
+
operation_id: z.ZodString;
|
|
104
|
+
message: z.ZodString;
|
|
105
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
106
|
+
status: z.ZodLiteral<"success">;
|
|
107
|
+
tool: z.ZodLiteral<"Write">;
|
|
108
|
+
file_path: z.ZodString;
|
|
109
|
+
operation: z.ZodEnum<{
|
|
110
|
+
create: "create";
|
|
111
|
+
update: "update";
|
|
112
|
+
}>;
|
|
113
|
+
operation_id: z.ZodString;
|
|
114
|
+
message: z.ZodString;
|
|
115
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
116
|
+
status: z.ZodLiteral<"error">;
|
|
117
|
+
tool: z.ZodEnum<{
|
|
118
|
+
Edit: "Edit";
|
|
119
|
+
Read: "Read";
|
|
120
|
+
Write: "Write";
|
|
121
|
+
}>;
|
|
122
|
+
file_path: z.ZodString;
|
|
123
|
+
error: z.ZodString;
|
|
124
|
+
}, z.core.$strict>]>;
|
|
125
|
+
export type ReadInput = z.infer<typeof readInputSchema>;
|
|
126
|
+
export type EditInput = z.infer<typeof editInputSchema>;
|
|
127
|
+
export type WriteInput = z.infer<typeof writeInputSchema>;
|
|
128
|
+
export type ReadResult = z.infer<typeof readResultSchema>;
|
|
129
|
+
export type EditResult = z.infer<typeof editResultSchema>;
|
|
130
|
+
export type WriteResult = z.infer<typeof writeResultSchema>;
|
|
131
|
+
export type FileToolResult = z.infer<typeof fileToolResultSchema>;
|
|
132
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../../src/modules/agent/tools/files/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,eAAe;;;;kBAMlB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;kBAOlB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;kBAKnB,CAAC;AA0DX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAqE,CAAC;AACnG,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;oBAAgD,CAAC;AAC9E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;oBAAiD,CAAC;AAChF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAM/B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const readInputSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
file_path: z.string().min(1).describe('Absolute path to the text file to read.'),
|
|
5
|
+
offset: z.number().int().positive().optional().describe('One-based line number to start reading from.'),
|
|
6
|
+
limit: z.number().int().positive().optional().describe('Maximum number of lines to return (defaults to 2000).'),
|
|
7
|
+
})
|
|
8
|
+
.strict();
|
|
9
|
+
export const editInputSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
file_path: z.string().min(1).describe('Absolute path to the text file to edit.'),
|
|
12
|
+
old_string: z.string().describe('Exact text to replace. Use an empty string only when creating a new file.'),
|
|
13
|
+
new_string: z.string().describe('Replacement text.'),
|
|
14
|
+
replace_all: z.boolean().optional().describe('Replace every exact match instead of requiring a unique match.'),
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
export const writeInputSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
file_path: z.string().min(1).describe('Absolute path to the text file to write.'),
|
|
20
|
+
content: z.string().describe('Complete file content.'),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
const fileErrorSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
status: z.literal('error'),
|
|
26
|
+
tool: z.enum(['Read', 'Edit', 'Write']),
|
|
27
|
+
file_path: z.string(),
|
|
28
|
+
error: z.string(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
const readSuccessSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
status: z.literal('success'),
|
|
34
|
+
tool: z.literal('Read'),
|
|
35
|
+
file_path: z.string(),
|
|
36
|
+
content: z.string(),
|
|
37
|
+
start_line: z.number().int().positive(),
|
|
38
|
+
num_lines: z.number().int().nonnegative(),
|
|
39
|
+
total_lines: z.number().int().nonnegative(),
|
|
40
|
+
truncated: z.boolean(),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
43
|
+
const readUnchangedSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
status: z.literal('unchanged'),
|
|
46
|
+
tool: z.literal('Read'),
|
|
47
|
+
file_path: z.string(),
|
|
48
|
+
start_line: z.number().int().positive(),
|
|
49
|
+
num_lines: z.number().int().nonnegative(),
|
|
50
|
+
total_lines: z.number().int().nonnegative(),
|
|
51
|
+
message: z.string(),
|
|
52
|
+
})
|
|
53
|
+
.strict();
|
|
54
|
+
const editSuccessSchema = z
|
|
55
|
+
.object({
|
|
56
|
+
status: z.literal('success'),
|
|
57
|
+
tool: z.literal('Edit'),
|
|
58
|
+
file_path: z.string(),
|
|
59
|
+
replacements: z.number().int().positive(),
|
|
60
|
+
operation_id: z.string(),
|
|
61
|
+
message: z.string(),
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
64
|
+
const writeSuccessSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
status: z.literal('success'),
|
|
67
|
+
tool: z.literal('Write'),
|
|
68
|
+
file_path: z.string(),
|
|
69
|
+
operation: z.enum(['create', 'update']),
|
|
70
|
+
operation_id: z.string(),
|
|
71
|
+
message: z.string(),
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
74
|
+
export const readResultSchema = z.union([readSuccessSchema, readUnchangedSchema, fileErrorSchema]);
|
|
75
|
+
export const editResultSchema = z.union([editSuccessSchema, fileErrorSchema]);
|
|
76
|
+
export const writeResultSchema = z.union([writeSuccessSchema, fileErrorSchema]);
|
|
77
|
+
export const fileToolResultSchema = z.union([
|
|
78
|
+
readSuccessSchema,
|
|
79
|
+
readUnchangedSchema,
|
|
80
|
+
editSuccessSchema,
|
|
81
|
+
writeSuccessSchema,
|
|
82
|
+
fileErrorSchema,
|
|
83
|
+
]);
|
|
84
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../../src/modules/agent/tools/files/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC9B,MAAM,CAAC;IACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAChF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACvG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;CAC/G,CAAC;KACD,MAAM,EAAE,CAAC;AAEX,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC9B,MAAM,CAAC;IACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAChF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2EAA2E,CAAC;IAC5G,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACp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AC,CAAC;IACvC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC;KACD,MAAM,EAAE,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC;AACnG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3C,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FileToolService } from './file-tool-service.js';
|
|
2
|
+
export declare const createFileTools: (service: FileToolService, signal: AbortSignal) => (import("@anvia/core").Tool<{
|
|
3
|
+
file_path: string;
|
|
4
|
+
old_string: string;
|
|
5
|
+
new_string: string;
|
|
6
|
+
replace_all?: boolean | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
status: "success";
|
|
9
|
+
tool: "Edit";
|
|
10
|
+
file_path: string;
|
|
11
|
+
replacements: number;
|
|
12
|
+
operation_id: string;
|
|
13
|
+
message: string;
|
|
14
|
+
} | {
|
|
15
|
+
status: "error";
|
|
16
|
+
tool: "Edit" | "Read" | "Write";
|
|
17
|
+
file_path: string;
|
|
18
|
+
error: string;
|
|
19
|
+
}> | import("@anvia/core").Tool<{
|
|
20
|
+
file_path: string;
|
|
21
|
+
offset?: number | undefined;
|
|
22
|
+
limit?: number | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
status: "error";
|
|
25
|
+
tool: "Edit" | "Read" | "Write";
|
|
26
|
+
file_path: string;
|
|
27
|
+
error: string;
|
|
28
|
+
} | {
|
|
29
|
+
status: "success";
|
|
30
|
+
tool: "Read";
|
|
31
|
+
file_path: string;
|
|
32
|
+
content: string;
|
|
33
|
+
start_line: number;
|
|
34
|
+
num_lines: number;
|
|
35
|
+
total_lines: number;
|
|
36
|
+
truncated: boolean;
|
|
37
|
+
} | {
|
|
38
|
+
status: "unchanged";
|
|
39
|
+
tool: "Read";
|
|
40
|
+
file_path: string;
|
|
41
|
+
start_line: number;
|
|
42
|
+
num_lines: number;
|
|
43
|
+
total_lines: number;
|
|
44
|
+
message: string;
|
|
45
|
+
}> | import("@anvia/core").Tool<{
|
|
46
|
+
file_path: string;
|
|
47
|
+
content: string;
|
|
48
|
+
}, {
|
|
49
|
+
status: "error";
|
|
50
|
+
tool: "Edit" | "Read" | "Write";
|
|
51
|
+
file_path: string;
|
|
52
|
+
error: string;
|
|
53
|
+
} | {
|
|
54
|
+
status: "success";
|
|
55
|
+
tool: "Write";
|
|
56
|
+
file_path: string;
|
|
57
|
+
operation: "create" | "update";
|
|
58
|
+
operation_id: string;
|
|
59
|
+
message: string;
|
|
60
|
+
}>)[];
|
|
61
|
+
//# sourceMappingURL=create-file-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-file-tools.d.ts","sourceRoot":"","sources":["../../../../../src/modules/agent/tools/files/create-file-tools.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAE5D,eAAO,MAAM,eAAe,YAAa,eAAe,UAAU,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyB5E,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createTool } from '@anvia/core';
|
|
2
|
+
import { editInputSchema, editResultSchema, readInputSchema, readResultSchema, writeInputSchema, writeResultSchema, } from './contracts.js';
|
|
3
|
+
export const createFileTools = (service, signal) => [
|
|
4
|
+
createTool({
|
|
5
|
+
name: 'Read',
|
|
6
|
+
description: 'Read a UTF-8 or UTF-16LE text file by absolute path with compact line-numbered output. Read files before changing them.',
|
|
7
|
+
input: readInputSchema,
|
|
8
|
+
output: readResultSchema,
|
|
9
|
+
execute: (input) => service.read(input, signal),
|
|
10
|
+
}),
|
|
11
|
+
createTool({
|
|
12
|
+
name: 'Edit',
|
|
13
|
+
description: 'Replace an exact string in a text file. Existing files must be read first, and stale files are rejected.',
|
|
14
|
+
input: editInputSchema,
|
|
15
|
+
output: editResultSchema,
|
|
16
|
+
execute: (input) => service.edit(input, signal),
|
|
17
|
+
}),
|
|
18
|
+
createTool({
|
|
19
|
+
name: 'Write',
|
|
20
|
+
description: 'Write complete text file contents. Existing files must be read first; new files and parent directories may be created.',
|
|
21
|
+
input: writeInputSchema,
|
|
22
|
+
output: writeResultSchema,
|
|
23
|
+
execute: (input) => service.write(input, signal),
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
26
|
+
//# sourceMappingURL=create-file-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-file-tools.js","sourceRoot":"","sources":["../../../../../src/modules/agent/tools/files/create-file-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAwB,EAAE,MAAmB,EAAE,EAAE,CAAC;IACjF,UAAU,CAAC;QACV,IAAI,EAAE,MAAM;QACZ,WAAW,EACV,yHAAyH;QAC1H,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;KAC/C,CAAC;IACF,UAAU,CAAC;QACV,IAAI,EAAE,MAAM;QACZ,WAAW,EACV,0GAA0G;QAC3G,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;KAC/C,CAAC;IACF,UAAU,CAAC;QACV,IAAI,EAAE,OAAO;QACb,WAAW,EACV,wHAAwH;QACzH,KAAK,EAAE,gBAAgB;QACvB,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC;KAChD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditInput, EditResult } from './contracts.js';
|
|
2
|
+
import { type FileToolContext } from './file-tool-operations.js';
|
|
3
|
+
export declare const editFileOperation: (context: FileToolContext, input: EditInput, signal: AbortSignal) => Promise<EditResult>;
|
|
4
|
+
//# sourceMappingURL=edit-file-operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-file-operation.d.ts","sourceRoot":"","sources":["../../../../../src/modules/agent/tools/files/edit-file-operation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAMN,KAAK,eAAe,EAMpB,MAAM,2BAA2B,CAAC;AAGnC,eAAO,MAAM,iBAAiB,YACpB,eAAe,SACjB,SAAS,UACR,WAAW,KACjB,OAAO,CAAC,UAAU,CAyDpB,CAAC"}
|