@greppleai/grip 0.0.0-stage → 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/CHANGELOG.md +22 -0
- package/README.md +725 -2
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +11 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +13 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +32 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +70 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +441 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +60 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +35 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +82 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +406 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +970 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +5176 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +150 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +557 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +26 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +99 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +83 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +220 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +65 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +550 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/compression-detection-ledger.d.ts +34 -0
- package/dist/core/compaction/compression-detection-ledger.d.ts.map +1 -0
- package/dist/core/compaction/compression-detection-ledger.js +52 -0
- package/dist/core/compaction/compression-detection-ledger.js.map +1 -0
- package/dist/core/compaction/compression-detector.d.ts +71 -0
- package/dist/core/compaction/compression-detector.d.ts.map +1 -0
- package/dist/core/compaction/compression-detector.js +407 -0
- package/dist/core/compaction/compression-detector.js.map +1 -0
- package/dist/core/compaction/compression-economics.d.ts +55 -0
- package/dist/core/compaction/compression-economics.d.ts.map +1 -0
- package/dist/core/compaction/compression-economics.js +151 -0
- package/dist/core/compaction/compression-economics.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +28 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +165 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +18 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +245 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +21 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +230 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +32 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/core/extensions/loader.d.ts +24 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +613 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +160 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +962 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1311 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +51 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +52 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +318 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/grip-agent.d.ts +240 -0
- package/dist/core/grip-agent.d.ts.map +1 -0
- package/dist/core/grip-agent.js +1243 -0
- package/dist/core/grip-agent.js.map +1 -0
- package/dist/core/grip-manifest.d.ts +9 -0
- package/dist/core/grip-manifest.d.ts.map +1 -0
- package/dist/core/grip-manifest.js +25 -0
- package/dist/core/grip-manifest.js.map +1 -0
- package/dist/core/hooks/aggregate.d.ts +5 -0
- package/dist/core/hooks/aggregate.d.ts.map +1 -0
- package/dist/core/hooks/aggregate.js +226 -0
- package/dist/core/hooks/aggregate.js.map +1 -0
- package/dist/core/hooks/config.d.ts +14 -0
- package/dist/core/hooks/config.d.ts.map +1 -0
- package/dist/core/hooks/config.js +372 -0
- package/dist/core/hooks/config.js.map +1 -0
- package/dist/core/hooks/executor.d.ts +12 -0
- package/dist/core/hooks/executor.d.ts.map +1 -0
- package/dist/core/hooks/executor.js +708 -0
- package/dist/core/hooks/executor.js.map +1 -0
- package/dist/core/hooks/index.d.ts +9 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/hooks/index.js +14 -0
- package/dist/core/hooks/index.js.map +1 -0
- package/dist/core/hooks/matcher.d.ts +10 -0
- package/dist/core/hooks/matcher.d.ts.map +1 -0
- package/dist/core/hooks/matcher.js +70 -0
- package/dist/core/hooks/matcher.js.map +1 -0
- package/dist/core/hooks/trust-store.d.ts +38 -0
- package/dist/core/hooks/trust-store.d.ts.map +1 -0
- package/dist/core/hooks/trust-store.js +167 -0
- package/dist/core/hooks/trust-store.js.map +1 -0
- package/dist/core/hooks/types.d.ts +234 -0
- package/dist/core/hooks/types.d.ts.map +1 -0
- package/dist/core/hooks/types.js +52 -0
- package/dist/core/hooks/types.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +82 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/instruction-resource-loader.d.ts +81 -0
- package/dist/core/instruction-resource-loader.d.ts.map +1 -0
- package/dist/core/instruction-resource-loader.js +574 -0
- package/dist/core/instruction-resource-loader.js.map +1 -0
- package/dist/core/keybindings.d.ts +399 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +299 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/lsp/abort.d.ts +3 -0
- package/dist/core/lsp/abort.d.ts.map +1 -0
- package/dist/core/lsp/abort.js +28 -0
- package/dist/core/lsp/abort.js.map +1 -0
- package/dist/core/lsp/client.d.ts +108 -0
- package/dist/core/lsp/client.d.ts.map +1 -0
- package/dist/core/lsp/client.js +586 -0
- package/dist/core/lsp/client.js.map +1 -0
- package/dist/core/lsp/config-loader.d.ts +44 -0
- package/dist/core/lsp/config-loader.d.ts.map +1 -0
- package/dist/core/lsp/config-loader.js +223 -0
- package/dist/core/lsp/config-loader.js.map +1 -0
- package/dist/core/lsp/config.d.ts +134 -0
- package/dist/core/lsp/config.d.ts.map +1 -0
- package/dist/core/lsp/config.js +682 -0
- package/dist/core/lsp/config.js.map +1 -0
- package/dist/core/lsp/diagnostics.d.ts +18 -0
- package/dist/core/lsp/diagnostics.d.ts.map +1 -0
- package/dist/core/lsp/diagnostics.js +311 -0
- package/dist/core/lsp/diagnostics.js.map +1 -0
- package/dist/core/lsp/file-sync.d.ts +58 -0
- package/dist/core/lsp/file-sync.d.ts.map +1 -0
- package/dist/core/lsp/file-sync.js +432 -0
- package/dist/core/lsp/file-sync.js.map +1 -0
- package/dist/core/lsp/integration.d.ts +62 -0
- package/dist/core/lsp/integration.d.ts.map +1 -0
- package/dist/core/lsp/integration.js +145 -0
- package/dist/core/lsp/integration.js.map +1 -0
- package/dist/core/lsp/language-map.d.ts +54 -0
- package/dist/core/lsp/language-map.d.ts.map +1 -0
- package/dist/core/lsp/language-map.js +300 -0
- package/dist/core/lsp/language-map.js.map +1 -0
- package/dist/core/lsp/manager.d.ts +120 -0
- package/dist/core/lsp/manager.d.ts.map +1 -0
- package/dist/core/lsp/manager.js +636 -0
- package/dist/core/lsp/manager.js.map +1 -0
- package/dist/core/lsp/navigation.d.ts +32 -0
- package/dist/core/lsp/navigation.d.ts.map +1 -0
- package/dist/core/lsp/navigation.js +327 -0
- package/dist/core/lsp/navigation.js.map +1 -0
- package/dist/core/lsp/portable-path.d.ts +18 -0
- package/dist/core/lsp/portable-path.d.ts.map +1 -0
- package/dist/core/lsp/portable-path.js +83 -0
- package/dist/core/lsp/portable-path.js.map +1 -0
- package/dist/core/lsp/refactor.d.ts +32 -0
- package/dist/core/lsp/refactor.d.ts.map +1 -0
- package/dist/core/lsp/refactor.js +519 -0
- package/dist/core/lsp/refactor.js.map +1 -0
- package/dist/core/lsp/transport.d.ts +39 -0
- package/dist/core/lsp/transport.d.ts.map +1 -0
- package/dist/core/lsp/transport.js +261 -0
- package/dist/core/lsp/transport.js.map +1 -0
- package/dist/core/messages.d.ts +34 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +140 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +148 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +812 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +115 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +498 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +209 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2341 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +57 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +353 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +33 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/remote-workspace-protocol/contract.d.ts +456 -0
- package/dist/core/remote-workspace-protocol/contract.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/contract.js +809 -0
- package/dist/core/remote-workspace-protocol/contract.js.map +1 -0
- package/dist/core/remote-workspace-protocol/session.d.ts +247 -0
- package/dist/core/remote-workspace-protocol/session.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/session.js +1839 -0
- package/dist/core/remote-workspace-protocol/session.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +32 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +257 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +200 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +1209 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/rules.d.ts +40 -0
- package/dist/core/rules.d.ts.map +1 -0
- package/dist/core/rules.js +57 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/sandbox/command.d.ts +27 -0
- package/dist/core/sandbox/command.d.ts.map +1 -0
- package/dist/core/sandbox/command.js +124 -0
- package/dist/core/sandbox/command.js.map +1 -0
- package/dist/core/sandbox/docker.d.ts +169 -0
- package/dist/core/sandbox/docker.d.ts.map +1 -0
- package/dist/core/sandbox/docker.js +633 -0
- package/dist/core/sandbox/docker.js.map +1 -0
- package/dist/core/sandbox/lima.d.ts +38 -0
- package/dist/core/sandbox/lima.d.ts.map +1 -0
- package/dist/core/sandbox/lima.js +324 -0
- package/dist/core/sandbox/lima.js.map +1 -0
- package/dist/core/session/constants.d.ts +2 -0
- package/dist/core/session/constants.d.ts.map +1 -0
- package/dist/core/session/constants.js +2 -0
- package/dist/core/session/constants.js.map +1 -0
- package/dist/core/session/context-metadata.d.ts +5 -0
- package/dist/core/session/context-metadata.d.ts.map +1 -0
- package/dist/core/session/context-metadata.js +55 -0
- package/dist/core/session/context-metadata.js.map +1 -0
- package/dist/core/session/context.d.ts +14 -0
- package/dist/core/session/context.d.ts.map +1 -0
- package/dist/core/session/context.js +117 -0
- package/dist/core/session/context.js.map +1 -0
- package/dist/core/session/ids.d.ts +9 -0
- package/dist/core/session/ids.d.ts.map +1 -0
- package/dist/core/session/ids.js +21 -0
- package/dist/core/session/ids.js.map +1 -0
- package/dist/core/session/in-memory-session-manager.d.ts +17 -0
- package/dist/core/session/in-memory-session-manager.d.ts.map +1 -0
- package/dist/core/session/in-memory-session-manager.js +40 -0
- package/dist/core/session/in-memory-session-manager.js.map +1 -0
- package/dist/core/session/in-memory-session.d.ts +7 -0
- package/dist/core/session/in-memory-session.d.ts.map +1 -0
- package/dist/core/session/in-memory-session.js +11 -0
- package/dist/core/session/in-memory-session.js.map +1 -0
- package/dist/core/session/jsonl-errors.d.ts +36 -0
- package/dist/core/session/jsonl-errors.d.ts.map +1 -0
- package/dist/core/session/jsonl-errors.js +49 -0
- package/dist/core/session/jsonl-errors.js.map +1 -0
- package/dist/core/session/jsonl-helpers.d.ts +20 -0
- package/dist/core/session/jsonl-helpers.d.ts.map +1 -0
- package/dist/core/session/jsonl-helpers.js +21 -0
- package/dist/core/session/jsonl-helpers.js.map +1 -0
- package/dist/core/session/local-session-manager.d.ts +30 -0
- package/dist/core/session/local-session-manager.d.ts.map +1 -0
- package/dist/core/session/local-session-manager.js +205 -0
- package/dist/core/session/local-session-manager.js.map +1 -0
- package/dist/core/session/local-session.d.ts +9 -0
- package/dist/core/session/local-session.d.ts.map +1 -0
- package/dist/core/session/local-session.js +15 -0
- package/dist/core/session/local-session.js.map +1 -0
- package/dist/core/session/migrations.d.ts +11 -0
- package/dist/core/session/migrations.d.ts.map +1 -0
- package/dist/core/session/migrations.js +78 -0
- package/dist/core/session/migrations.js.map +1 -0
- package/dist/core/session/remote-session-client.d.ts +83 -0
- package/dist/core/session/remote-session-client.d.ts.map +1 -0
- package/dist/core/session/remote-session-client.js +224 -0
- package/dist/core/session/remote-session-client.js.map +1 -0
- package/dist/core/session/remote-session-manager.d.ts +32 -0
- package/dist/core/session/remote-session-manager.d.ts.map +1 -0
- package/dist/core/session/remote-session-manager.js +124 -0
- package/dist/core/session/remote-session-manager.js.map +1 -0
- package/dist/core/session/remote-session.d.ts +20 -0
- package/dist/core/session/remote-session.d.ts.map +1 -0
- package/dist/core/session/remote-session.js +33 -0
- package/dist/core/session/remote-session.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +18 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +2 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/session/session.d.ts +140 -0
- package/dist/core/session/session.d.ts.map +1 -0
- package/dist/core/session/session.js +461 -0
- package/dist/core/session/session.js.map +1 -0
- package/dist/core/session/stores/in-memory-session-store.d.ts +39 -0
- package/dist/core/session/stores/in-memory-session-store.d.ts.map +1 -0
- package/dist/core/session/stores/in-memory-session-store.js +168 -0
- package/dist/core/session/stores/in-memory-session-store.js.map +1 -0
- package/dist/core/session/stores/jsonl-session-store.d.ts +97 -0
- package/dist/core/session/stores/jsonl-session-store.d.ts.map +1 -0
- package/dist/core/session/stores/jsonl-session-store.js +1140 -0
- package/dist/core/session/stores/jsonl-session-store.js.map +1 -0
- package/dist/core/session/stores/remote-session-store.d.ts +44 -0
- package/dist/core/session/stores/remote-session-store.d.ts.map +1 -0
- package/dist/core/session/stores/remote-session-store.js +159 -0
- package/dist/core/session/stores/remote-session-store.js.map +1 -0
- package/dist/core/session/stores/session-store.d.ts +42 -0
- package/dist/core/session/stores/session-store.d.ts.map +1 -0
- package/dist/core/session/stores/session-store.js +2 -0
- package/dist/core/session/stores/session-store.js.map +1 -0
- package/dist/core/session/types.d.ts +141 -0
- package/dist/core/session/types.d.ts.map +1 -0
- package/dist/core/session/types.js +2 -0
- package/dist/core/session/types.js.map +1 -0
- package/dist/core/session/usage-ledger.d.ts +18 -0
- package/dist/core/session/usage-ledger.d.ts.map +1 -0
- package/dist/core/session/usage-ledger.js +68 -0
- package/dist/core/session/usage-ledger.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/settings-manager.d.ts +318 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +991 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +40 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +57 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +36 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +26 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +27 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +32 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +131 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +10 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +41 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +51 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +310 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/compress-context.d.ts +27 -0
- package/dist/core/tools/compress-context.d.ts.map +1 -0
- package/dist/core/tools/compress-context.js +142 -0
- package/dist/core/tools/compress-context.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +82 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +327 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +50 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +324 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +60 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +22 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +268 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +27 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +332 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/hash-store.d.ts +12 -0
- package/dist/core/tools/hash-store.d.ts.map +1 -0
- package/dist/core/tools/hash-store.js +48 -0
- package/dist/core/tools/hash-store.js.map +1 -0
- package/dist/core/tools/hashline/apply.d.ts +40 -0
- package/dist/core/tools/hashline/apply.d.ts.map +1 -0
- package/dist/core/tools/hashline/apply.js +261 -0
- package/dist/core/tools/hashline/apply.js.map +1 -0
- package/dist/core/tools/hashline/hash.d.ts +56 -0
- package/dist/core/tools/hashline/hash.d.ts.map +1 -0
- package/dist/core/tools/hashline/hash.js +196 -0
- package/dist/core/tools/hashline/hash.js.map +1 -0
- package/dist/core/tools/hashline/parse.d.ts +8 -0
- package/dist/core/tools/hashline/parse.d.ts.map +1 -0
- package/dist/core/tools/hashline/parse.js +41 -0
- package/dist/core/tools/hashline/parse.js.map +1 -0
- package/dist/core/tools/hashline/resolve.d.ts +51 -0
- package/dist/core/tools/hashline/resolve.d.ts.map +1 -0
- package/dist/core/tools/hashline/resolve.js +187 -0
- package/dist/core/tools/hashline/resolve.js.map +1 -0
- package/dist/core/tools/hashline-utils.d.ts +6 -0
- package/dist/core/tools/hashline-utils.d.ts.map +1 -0
- package/dist/core/tools/hashline-utils.js +23 -0
- package/dist/core/tools/hashline-utils.js.map +1 -0
- package/dist/core/tools/index.d.ts +36 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +141 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +21 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +156 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/operations.d.ts +201 -0
- package/dist/core/tools/operations.d.ts.map +1 -0
- package/dist/core/tools/operations.js +697 -0
- package/dist/core/tools/operations.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +54 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +9 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +32 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +318 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +33 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +61 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/replace-diff.d.ts +16 -0
- package/dist/core/tools/replace-diff.d.ts.map +1 -0
- package/dist/core/tools/replace-diff.js +117 -0
- package/dist/core/tools/replace-diff.js.map +1 -0
- package/dist/core/tools/replace-normalize.d.ts +2 -0
- package/dist/core/tools/replace-normalize.d.ts.map +1 -0
- package/dist/core/tools/replace-normalize.js +73 -0
- package/dist/core/tools/replace-normalize.js.map +1 -0
- package/dist/core/tools/replace-render.d.ts +51 -0
- package/dist/core/tools/replace-render.d.ts.map +1 -0
- package/dist/core/tools/replace-render.js +162 -0
- package/dist/core/tools/replace-render.js.map +1 -0
- package/dist/core/tools/runtime.d.ts +2 -0
- package/dist/core/tools/runtime.d.ts.map +1 -0
- package/dist/core/tools/runtime.js +6 -0
- package/dist/core/tools/runtime.js.map +1 -0
- package/dist/core/tools/session-history.d.ts +55 -0
- package/dist/core/tools/session-history.d.ts.map +1 -0
- package/dist/core/tools/session-history.js +649 -0
- package/dist/core/tools/session-history.js.map +1 -0
- package/dist/core/tools/subagent-agents.d.ts +29 -0
- package/dist/core/tools/subagent-agents.d.ts.map +1 -0
- package/dist/core/tools/subagent-agents.js +223 -0
- package/dist/core/tools/subagent-agents.js.map +1 -0
- package/dist/core/tools/subagent.d.ts +185 -0
- package/dist/core/tools/subagent.d.ts.map +1 -0
- package/dist/core/tools/subagent.js +1309 -0
- package/dist/core/tools/subagent.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +39 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/websearch.d.ts +33 -0
- package/dist/core/tools/websearch.d.ts.map +1 -0
- package/dist/core/tools/websearch.js +341 -0
- package/dist/core/tools/websearch.js.map +1 -0
- package/dist/core/tools/workspace-tool-host.d.ts +102 -0
- package/dist/core/tools/workspace-tool-host.d.ts.map +1 -0
- package/dist/core/tools/workspace-tool-host.js +348 -0
- package/dist/core/tools/workspace-tool-host.js.map +1 -0
- package/dist/core/tools/write.d.ts +16 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +204 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/workspace-identity.d.ts +7 -0
- package/dist/core/workspace-identity.d.ts.map +1 -0
- package/dist/core/workspace-identity.js +2 -0
- package/dist/core/workspace-identity.js.map +1 -0
- package/dist/daemon/command.d.ts +6 -0
- package/dist/daemon/command.d.ts.map +1 -0
- package/dist/daemon/command.js +58 -0
- package/dist/daemon/command.js.map +1 -0
- package/dist/daemon/config.d.ts +43 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +304 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/help.d.ts +2 -0
- package/dist/daemon/help.d.ts.map +1 -0
- package/dist/daemon/help.js +42 -0
- package/dist/daemon/help.js.map +1 -0
- package/dist/daemon/lsp-config.d.ts +4 -0
- package/dist/daemon/lsp-config.d.ts.map +1 -0
- package/dist/daemon/lsp-config.js +155 -0
- package/dist/daemon/lsp-config.js.map +1 -0
- package/dist/daemon/security.d.ts +19 -0
- package/dist/daemon/security.d.ts.map +1 -0
- package/dist/daemon/security.js +175 -0
- package/dist/daemon/security.js.map +1 -0
- package/dist/daemon/server.d.ts +20 -0
- package/dist/daemon/server.d.ts.map +1 -0
- package/dist/daemon/server.js +400 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/workspace-runtime.d.ts +46 -0
- package/dist/daemon/workspace-runtime.d.ts.map +1 -0
- package/dist/daemon/workspace-runtime.js +673 -0
- package/dist/daemon/workspace-runtime.js.map +1 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +39 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +763 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +35 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +412 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +29 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +149 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +36 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +173 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +18 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +74 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +514 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +25 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +85 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +80 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +118 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +128 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +83 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +36 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +227 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/hook-execution.d.ts +19 -0
- package/dist/modes/interactive/components/hook-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/hook-execution.js +184 -0
- package/dist/modes/interactive/components/hook-execution.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +55 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +176 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts +4 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +14 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +228 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +52 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +296 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +50 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +300 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +22 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +144 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +108 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +835 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +81 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +455 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +51 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +67 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +306 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +127 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1098 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +49 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +557 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +5859 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +86 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +106 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1030 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/json-event.d.ts +28 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +12 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +29 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +142 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +321 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +755 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +963 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +652 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +4 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +488 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +25 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +23 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +74 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +15 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +88 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +13 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +248 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +4 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +171 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/directory-completions.d.ts +5 -0
- package/dist/utils/directory-completions.d.ts.map +1 -0
- package/dist/utils/directory-completions.js +64 -0
- package/dist/utils/directory-completions.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +6 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +166 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +27 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +237 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/grip-user-agent.d.ts +2 -0
- package/dist/utils/grip-user-agent.d.ts.map +1 -0
- package/dist/utils/grip-user-agent.js +5 -0
- package/dist/utils/grip-user-agent.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +12 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +43 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +133 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +19 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +81 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +110 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +31 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +87 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +22 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +125 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +28 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +188 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +125 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +5 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +329 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +14 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +91 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +408 -0
- package/docs/custom-provider.md +714 -0
- package/docs/daemon-architecture.md +399 -0
- package/docs/daemon.md +110 -0
- package/docs/development.md +72 -0
- package/docs/docs.json +164 -0
- package/docs/extensions.md +2745 -0
- package/docs/hooks.md +85 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +81 -0
- package/docs/json.md +89 -0
- package/docs/keybindings.md +230 -0
- package/docs/lsp.md +499 -0
- package/docs/migrating-to-grip.md +18 -0
- package/docs/models.md +496 -0
- package/docs/packages.md +228 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +251 -0
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +1492 -0
- package/docs/rules.md +117 -0
- package/docs/sandbox.md +181 -0
- package/docs/sdk.md +360 -0
- package/docs/session-format.md +414 -0
- package/docs/sessions.md +137 -0
- package/docs/settings.md +371 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +246 -0
- package/docs/terminal-setup.md +112 -0
- package/docs/termux.md +129 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +918 -0
- package/docs/usage.md +304 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +31 -0
- package/examples/daemon-docker/Dockerfile +43 -0
- package/examples/daemon-docker/README.md +45 -0
- package/examples/extensions/README.md +208 -0
- package/examples/extensions/auto-commit-on-exit.ts +46 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +259 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +82 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +131 -0
- package/examples/extensions/custom-footer.ts +79 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +707 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +402 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +104 -0
- package/examples/extensions/dirty-repo-guard.ts +59 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +133 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/RULES.md +8 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +16 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +125 -0
- package/examples/extensions/github-issue-autocomplete.ts +191 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +104 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +194 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +428 -0
- package/examples/extensions/modal-editor.ts +86 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1374 -0
- package/examples/extensions/overlay-test.ts +171 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +346 -0
- package/examples/extensions/plan-mode/utils.ts +172 -0
- package/examples/extensions/preset.ts +426 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +29 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +125 -0
- package/examples/extensions/question.ts +294 -0
- package/examples/extensions/questionnaire.ts +459 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +320 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +381 -0
- package/examples/extensions/space-invaders.ts +597 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +175 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +1083 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +186 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1091 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +306 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +141 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +200 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/remote-session-server/README.md +71 -0
- package/examples/remote-session-server/server.ts +353 -0
- package/examples/rpc-extension-ui.ts +642 -0
- package/examples/sandbox-docker/Dockerfile +274 -0
- package/examples/sandbox-docker/README.md +88 -0
- package/examples/sdk/01-minimal.ts +27 -0
- package/examples/sdk/02-custom-model.ts +54 -0
- package/examples/sdk/03-custom-prompt.ts +76 -0
- package/examples/sdk/04-skills.ts +60 -0
- package/examples/sdk/05-tools.ts +55 -0
- package/examples/sdk/06-extensions.ts +94 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +56 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +50 -0
- package/examples/sdk/10-settings.ts +58 -0
- package/examples/sdk/11-sessions.ts +54 -0
- package/examples/sdk/12-full-control.ts +79 -0
- package/examples/sdk/13-session-runtime.ts +49 -0
- package/examples/sdk/README.md +94 -0
- package/npm-shrinkwrap.json +1878 -0
- package/package.json +102 -5
package/docs/rules.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Rules
|
|
2
|
+
|
|
3
|
+
Rules are on-demand, mandatory instruction files. Use them for constraints and policies that must apply when the current task or files match the rule description.
|
|
4
|
+
|
|
5
|
+
Rules use progressive disclosure like skills: Grip lists available rules in the system prompt, and the agent loads the full file only when applicable.
|
|
6
|
+
|
|
7
|
+
## Locations
|
|
8
|
+
|
|
9
|
+
Grip loads rules from:
|
|
10
|
+
|
|
11
|
+
- Global:
|
|
12
|
+
- `~/.grip/agent/rules/`
|
|
13
|
+
- `~/.agents/rules/`
|
|
14
|
+
- Project:
|
|
15
|
+
- `.grip/rules/`
|
|
16
|
+
- `.agents/rules/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
|
|
17
|
+
- Packages: `rules/` directories or `grip.rules` entries in `package.json`
|
|
18
|
+
- Settings: `rules` array with files or directories
|
|
19
|
+
- CLI: `--rule <path>` (repeatable, additive even with `--no-rules`)
|
|
20
|
+
|
|
21
|
+
Discovery rules:
|
|
22
|
+
|
|
23
|
+
- In `~/.grip/agent/rules/` and `.grip/rules/`, direct root `.md` files are discovered as individual rules
|
|
24
|
+
- In all rule locations, directories containing `RULES.md` are discovered recursively
|
|
25
|
+
- In `~/.agents/rules/` and project `.agents/rules/`, root `.md` files are ignored
|
|
26
|
+
|
|
27
|
+
Disable discovery with `--no-rules` (explicit `--rule` paths still load).
|
|
28
|
+
|
|
29
|
+
## How Rules Work
|
|
30
|
+
|
|
31
|
+
1. At startup, Grip scans rule locations and extracts names and descriptions
|
|
32
|
+
2. The system prompt includes available rules in XML format
|
|
33
|
+
3. When a task or file matches, the agent uses `read` to load the full `RULES.md`
|
|
34
|
+
4. Applicable rules are mandatory and constrain normal behavior and skills
|
|
35
|
+
|
|
36
|
+
Only descriptions are always in context. Full instructions load on demand.
|
|
37
|
+
|
|
38
|
+
## Rule Commands
|
|
39
|
+
|
|
40
|
+
Rules register as `/rule:name` commands when skill commands are enabled:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
/rule:typescript # Load the rule
|
|
44
|
+
/rule:naming-conventions use for new files
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Arguments after the command are appended to the rule content as user text.
|
|
48
|
+
|
|
49
|
+
## Rule Structure
|
|
50
|
+
|
|
51
|
+
A rule is a directory with a `RULES.md` file. Everything else is freeform.
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
typescript/
|
|
55
|
+
├── RULES.md
|
|
56
|
+
└── references/
|
|
57
|
+
└── examples.md
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### RULES.md Format
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
---
|
|
64
|
+
name: typescript
|
|
65
|
+
description: Mandatory TypeScript rules. Load before editing *.ts or *.tsx files.
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
# TypeScript Rules
|
|
69
|
+
|
|
70
|
+
- No `any` unless absolutely necessary.
|
|
71
|
+
- Use top-level imports only.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Use relative paths from the rule directory:
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
See [examples](references/examples.md).
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Frontmatter
|
|
81
|
+
|
|
82
|
+
| Field | Required | Description |
|
|
83
|
+
|-------|----------|-------------|
|
|
84
|
+
| `name` | Yes | Max 64 chars. Lowercase a-z, 0-9, hyphens. Falls back to parent directory name. |
|
|
85
|
+
| `description` | Yes | Max 1024 chars. Defines when the rule applies. |
|
|
86
|
+
| `tools` | No | Tool name or YAML list of lazy tools to load automatically when the rule is loaded via `read` or `/rule:name`. |
|
|
87
|
+
| `disable-model-invocation` | No | When `true`, the rule is hidden from the system prompt. Users must use `/rule:name`. |
|
|
88
|
+
|
|
89
|
+
Example with associated lazy tools:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
---
|
|
93
|
+
name: github-review
|
|
94
|
+
description: Mandatory PR review rules. Load when reviewing GitHub pull requests.
|
|
95
|
+
tools:
|
|
96
|
+
- github_get_pr
|
|
97
|
+
- github_list_review_comments
|
|
98
|
+
---
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
When the agent loads this rule, Grip loads those tools into the active tool context for the next turn.
|
|
102
|
+
|
|
103
|
+
## Description Best Practices
|
|
104
|
+
|
|
105
|
+
The description determines when the agent loads the rule. Write applicability, not capability.
|
|
106
|
+
|
|
107
|
+
Good:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
description: Mandatory TypeScript rules. Load before editing *.ts or *.tsx files.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Poor:
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
description: TypeScript help.
|
|
117
|
+
```
|
package/docs/sandbox.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Workspace Sandbox
|
|
2
|
+
|
|
3
|
+
`/sandbox` is the single interactive command for workspace tool backends. It can show or clear the active backend, attach an existing sandbox daemon, or manage a Docker container or Lima VM. Sandbox connections are session-local: a new session starts on its underlying backend, returning to an earlier session reconnects its remembered sandbox while Grip remains running, and multiple session sandboxes may coexist. Local Grip remains the orchestrator: provider credentials, model calls, session history, extensions, RPC, and UI stay in the local process; subagent workspace tools inherit the parent session's active sandbox.
|
|
4
|
+
|
|
5
|
+
The command is user-only. It is shown in interactive slash-command completion, but it is not exposed through RPC `get_commands`, extension-visible command catalogs, system prompts, tool definitions, prompt templates, skills, or rules. This only hides the Grip operator command from LLM-visible catalogs; it does not prevent a model with host shell access from invoking Docker or Lima directly.
|
|
6
|
+
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
Type these commands in interactive mode:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
/sandbox [status]
|
|
13
|
+
/sandbox clear
|
|
14
|
+
/sandbox --attach <ws://url>
|
|
15
|
+
/sandbox start [--runtime docker|lima] [--image <image>] [--name <lima-instance>] [--template <lima-template>]
|
|
16
|
+
/sandbox list [--runtime docker|lima]
|
|
17
|
+
/sandbox stop [sandbox]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- `/sandbox` and `/sandbox status` show the active workspace tool backend.
|
|
21
|
+
- `/sandbox clear` disconnects the active deferred or sandbox backend without stopping a managed container or VM.
|
|
22
|
+
- `/sandbox --attach` connects to an already-running sandbox daemon without starting or managing its container. Set `GRIP_REMOTE_TOKEN` when the daemon requires authentication. The daemon workspace root must match `--remote-cwd` in deferred mode, or `sandbox.workspaceMountPath` (default `/workspace`) otherwise.
|
|
23
|
+
- `/sandbox start` launches a Docker container by default. With `--runtime lima`, it creates a Lima VM from `template:docker-rootful`, mounts the current working directory read-write at `/workspace`, starts `grip --daemon` inside the VM, and switches workspace tools and project resource loading to that daemon. Use `--template` to override the Lima template for a new VM. Passing `--name` implies `--runtime lima` when no runtime is specified; without `--name`, runtime selection is unchanged. `--name` creates the named instance if missing, starts it if stopped, or reuses it if running. Existing instances must already have a writable `/workspace` mount mapping to the current directory. Explicitly named VMs remain running after `/sandbox stop` or graceful Grip shutdown; only their Grip daemon is stopped, regardless of `sandbox.cleanup`.
|
|
24
|
+
- `/sandbox list` lists sandboxes for the current workspace. Use `/sandbox list --runtime lima` to list matching Lima instances that can be reused by name.
|
|
25
|
+
- `/sandbox stop` stops the active Grip-owned sandbox. For a daemon connected with `--attach`, it only detaches and restores the previous tool backend. Explicitly named Lima VMs remain running, but their Grip daemon is stopped. With an id or name, it uses the active runtime, or `sandbox.runtime` when no sandbox is active. Ambiguous cases require an explicit target.
|
|
26
|
+
|
|
27
|
+
Example:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
GRIP_REMOTE_TOKEN=... grip
|
|
31
|
+
/sandbox --attach ws://127.0.0.1:8787/grip/workspace
|
|
32
|
+
/sandbox stop
|
|
33
|
+
|
|
34
|
+
/sandbox start --image grip-sandbox:local
|
|
35
|
+
/sandbox list
|
|
36
|
+
|
|
37
|
+
/sandbox start --runtime lima
|
|
38
|
+
/sandbox start --runtime lima --template template:alpine
|
|
39
|
+
/sandbox list --runtime lima
|
|
40
|
+
/sandbox stop
|
|
41
|
+
|
|
42
|
+
/sandbox start --name my-dev
|
|
43
|
+
/sandbox stop
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
When start succeeds, Grip shows the sandbox name/id, the host-to-sandbox workspace mount, a redacted daemon endpoint, and a status line that workspace tools/resources now route through the sandbox daemon.
|
|
47
|
+
|
|
48
|
+
## Workspace mount and daemon endpoint
|
|
49
|
+
|
|
50
|
+
Defaults:
|
|
51
|
+
|
|
52
|
+
| Setting | Default |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Host workspace | current working directory |
|
|
55
|
+
| Container workspace | `/workspace` |
|
|
56
|
+
| Daemon command | `grip --daemon` |
|
|
57
|
+
| Docker network mode | `bridge` |
|
|
58
|
+
| Daemon preferred bind and endpoint | `127.0.0.1:8787` |
|
|
59
|
+
| Daemon token | generated per start |
|
|
60
|
+
| Lima binary | `limactl` |
|
|
61
|
+
| Lima template | `template:docker-rootful` |
|
|
62
|
+
|
|
63
|
+
The mounted workspace is read/write. Any process in the container can modify files in the mounted host directory. Paths reported by the daemon use the container workspace root (`/workspace`), while local Grip keeps session and UI state on the host. The container uses Docker bridge networking and publishes only the authenticated daemon port to the configured host bind address (`127.0.0.1` by default), so sandbox processes cannot directly access host loopback services. Grip uses the configured daemon port when available and otherwise selects an available host port, allowing separate sessions to keep concurrent sandbox containers. The default image also configures `/tmp` as an additional confined temporary root, so workspace tools can use disposable scratch files without exposing another host mount.
|
|
64
|
+
|
|
65
|
+
Sandbox bash calls receive the current `GRIP_SESSION_ID`, `GRIP_SESSION_FILE`, `GRIP_PROVIDER`, `GRIP_MODEL`, and `GRIP_REASONING_LEVEL` values per invocation. This metadata follows the active session rather than the daemon process environment; other host environment variables are not forwarded automatically.
|
|
66
|
+
|
|
67
|
+
`/sandbox start` uses a fresh bearer token for every daemon. Docker receives it through the container environment. Lima generates it inside the guest and returns it directly to the host launcher. Grip keeps the token in memory and uses it to connect to the daemon. Tokens are not put in Docker or Lima command arguments, image layers, container or instance names, labels, URLs, or user-facing status. Status, list output, and errors redact secrets.
|
|
68
|
+
|
|
69
|
+
## Image and configuration
|
|
70
|
+
|
|
71
|
+
The configured default image is `ghcr.io/greppleai/grip-sandbox:latest`, but its publication has not been verified. Until it is available, build a reviewed local image below or configure a verified compatible replacement; do not assume the default image can be pulled. The local example image uses integrated `grip --daemon` from `@greppleai/grip`. There is no separate Grip daemon package or binary.
|
|
72
|
+
|
|
73
|
+
When a sandbox daemon connects, Grip also loads `~/.grip/AGENTS.md` from the daemon user's home directory as user-scoped context. This is separate from the orchestrator's global instructions and lets custom Docker images or Lima users define instructions that apply only inside the sandbox. Create or update the file inside the sandbox, then run `/reload` to refresh context.
|
|
74
|
+
Configuration precedence for a start is:
|
|
75
|
+
|
|
76
|
+
1. command flags: `/sandbox start --runtime <runtime>`, `--image <image>`, `--name <lima-instance>`, and `--template <lima-template>`;
|
|
77
|
+
2. environment variables: `GRIP_SANDBOX_*`;
|
|
78
|
+
3. project settings in `.grip/settings.json`;
|
|
79
|
+
4. global settings in `~/.grip/agent/settings.json`;
|
|
80
|
+
5. defaults.
|
|
81
|
+
|
|
82
|
+
Sandbox settings:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"sandbox": {
|
|
87
|
+
"runtime": "docker",
|
|
88
|
+
"image": "grip-sandbox:local",
|
|
89
|
+
"dockerBinary": "docker",
|
|
90
|
+
"limaBinary": "limactl",
|
|
91
|
+
"limaTemplate": "template:docker-rootful",
|
|
92
|
+
"limaInstanceNamePrefix": "grip-sandbox",
|
|
93
|
+
"workspaceMountPath": "/workspace",
|
|
94
|
+
"containerNamePrefix": "grip-sandbox",
|
|
95
|
+
"daemonPort": 8787,
|
|
96
|
+
"daemonHostBind": "127.0.0.1",
|
|
97
|
+
"cleanup": "stop"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Environment overrides:
|
|
103
|
+
|
|
104
|
+
| Variable | Setting |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `GRIP_SANDBOX_RUNTIME` | `sandbox.runtime` (`docker` or `lima`) |
|
|
107
|
+
| `GRIP_SANDBOX_IMAGE` | `sandbox.image` |
|
|
108
|
+
| `GRIP_SANDBOX_DOCKER` | `sandbox.dockerBinary` |
|
|
109
|
+
| `GRIP_SANDBOX_LIMA` | `sandbox.limaBinary` |
|
|
110
|
+
| `GRIP_SANDBOX_LIMA_TEMPLATE` | `sandbox.limaTemplate` |
|
|
111
|
+
| `GRIP_SANDBOX_LIMA_INSTANCE_PREFIX` | `sandbox.limaInstanceNamePrefix` |
|
|
112
|
+
| `GRIP_SANDBOX_WORKSPACE_MOUNT` | `sandbox.workspaceMountPath` |
|
|
113
|
+
| `GRIP_SANDBOX_CONTAINER_PREFIX` | `sandbox.containerNamePrefix` |
|
|
114
|
+
| `GRIP_SANDBOX_DAEMON_PORT` | `sandbox.daemonPort` |
|
|
115
|
+
| `GRIP_SANDBOX_DAEMON_HOST_BIND` | `sandbox.daemonHostBind` |
|
|
116
|
+
| `GRIP_SANDBOX_CLEANUP` | `sandbox.cleanup` (`stop` or `remove`) |
|
|
117
|
+
|
|
118
|
+
## Base image
|
|
119
|
+
|
|
120
|
+
Build the local base image from repository release artifacts:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm run release:local -- --out /tmp/grip-local-release --force
|
|
124
|
+
docker build \
|
|
125
|
+
-f packages/coding-agent/examples/sandbox-docker/Dockerfile \
|
|
126
|
+
-t grip-sandbox:local \
|
|
127
|
+
/tmp/grip-local-release
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Then use it for one start:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
/sandbox start --image grip-sandbox:local
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Or make it the default:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
GRIP_SANDBOX_IMAGE=grip-sandbox:local grip
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
See [`../examples/sandbox-docker/README.md`](../examples/sandbox-docker/README.md) for image build inputs and manual `docker run` commands.
|
|
143
|
+
|
|
144
|
+
## Sandbox identity, list, and stop
|
|
145
|
+
|
|
146
|
+
Grip labels sandbox containers and filters list/stop operations by those labels, not by name alone. Labels include sandbox ownership, workspace hash, workspace mount target, daemon port, owner uid when available, Grip version, and a session id. Labels do not contain tokens.
|
|
147
|
+
|
|
148
|
+
Docker container names use the configured prefix plus a sanitized workspace name, workspace hash, and per-start session suffix. Managed Lima names use `sandbox.limaInstanceNamePrefix` with the same workspace/session identity and a random suffix. Daemon ports are allocated per start, preferring `sandbox.daemonPort` and falling back to an available host port. `/sandbox list --runtime lima` reports Lima instances whose writable `/workspace` mount maps to the current host workspace; their names can be passed back to `/sandbox start --runtime lima --name <name>`. Explicitly named VMs are left running by `/sandbox stop`, whether newly created or reused, while Grip stops or removes automatically named VMs according to `sandbox.cleanup`.
|
|
149
|
+
|
|
150
|
+
Stopping the active sandbox clears the current session's remote tool backend and returns it to the previous non-sandbox backend or local tool execution. If Grip was started in deferred remote mode, stop leaves that session's deferred backend unconfigured. Switching sessions disconnects the old live client without stopping its managed sandbox; returning to that session reconnects it from memory. On graceful Grip shutdown, Docker containers and automatically named Lima instances started by that Grip process are stopped or removed according to `sandbox.cleanup`; explicitly named Lima VMs remain running with their Grip daemon stopped. Tokens are never persisted to session files, so sandboxes are not restored after Grip exits.
|
|
151
|
+
|
|
152
|
+
## Security boundaries
|
|
153
|
+
|
|
154
|
+
Docker and Lima sandbox modes are not complete security sandboxes.
|
|
155
|
+
|
|
156
|
+
- The current working directory is mounted read/write into the container or VM.
|
|
157
|
+
- Subagents inherit the active workspace backend. Sandboxed subagents reject host cwd overrides, do not load host project context or extensions, treat custom system prompts as literal text, and cannot continue an older run after the parent backend changes.
|
|
158
|
+
- Sandbox processes can read, write, delete, or chmod files in that mount as the guest user.
|
|
159
|
+
- Files created by the default image are owned by uid `1000` unless Docker/user policy changes it.
|
|
160
|
+
- `/tmp` is writable container-local scratch storage and is removed with the container; it is not mounted from the host by default.
|
|
161
|
+
- The daemon token authorizes high-privilege workspace tool access for the mounted workspace.
|
|
162
|
+
- Anyone with Docker access on the host may inspect containers, images, mounts, labels, ports, and environment depending on host policy.
|
|
163
|
+
- Override Docker images and Lima templates are trusted code. A malicious image or template can run arbitrary processes against the mounted workspace.
|
|
164
|
+
- Docker socket mounts, privileged mode, broad host volumes, or extra credentials can further break the intended boundary.
|
|
165
|
+
- Bridge networking prevents direct host-loopback access, but the container may still reach external networks and host services deliberately exposed beyond loopback.
|
|
166
|
+
- Reused Lima instances retain their existing filesystem, software, credentials, and network access; only reuse instances you trust.
|
|
167
|
+
- Hidden command behavior only keeps `/sandbox` out of LLM-visible Grip catalogs. It is not an OS, Docker, or VM permission boundary.
|
|
168
|
+
|
|
169
|
+
Use trusted images, avoid mounting the Docker socket, avoid privileged containers, keep `sandbox.daemonHostBind` loopback-only unless you add a separate trusted network/TLS boundary, and do not place secrets in the mounted workspace unless the sandbox image should access them.
|
|
170
|
+
|
|
171
|
+
## Troubleshooting
|
|
172
|
+
|
|
173
|
+
- Docker missing: install Docker or set `GRIP_SANDBOX_DOCKER` / `sandbox.dockerBinary` to the correct executable.
|
|
174
|
+
- Lima missing: install Lima or set `GRIP_SANDBOX_LIMA` / `sandbox.limaBinary`. Newly created Lima VMs, including explicitly named ones, provision the current `@greppleai/grip` version through npm when `grip` is missing; reused instances must already provide a compatible `grip` command. Provisioning requires an apt-based guest and package availability.
|
|
175
|
+
- Permission denied connecting to Docker: add the user to the appropriate Docker group, start Docker Desktop, or run Grip where Docker is accessible. Treat Docker group membership as host-level administrative power.
|
|
176
|
+
- Image pull/build failure: verify the image name, registry authentication, network access, and local build command. For local images, build with the local release directory as context; do not use `--skip-install` for the sandbox Dockerfile.
|
|
177
|
+
- Port conflict: Grip prefers the configured daemon port (default `8787`) and automatically selects an available port when it is occupied. A remaining bind failure can indicate an invalid `sandbox.daemonHostBind`, exhausted local resources, or a race with another process.
|
|
178
|
+
- Start succeeds but daemon activation fails: the container or VM may still be running. Use the runtime-specific `/sandbox list` and `/sandbox stop <id-or-name>` commands to clean it up.
|
|
179
|
+
- `/sandbox list` is empty: Docker listing only includes Grip-labeled containers; Lima listing only includes instances with the current workspace mounted at `/workspace`. Check that you selected the intended runtime and workspace.
|
|
180
|
+
- `/sandbox stop` says no sandbox was found: pass the listed id or name, or switch to the workspace that owns the sandbox.
|
|
181
|
+
- Already stopped: stop is idempotent for matching containers and reports already-stopped containers cleanly.
|
package/docs/sdk.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
> Grip can help you use the SDK. Ask it to build an integration for your use case.
|
|
2
|
+
|
|
3
|
+
# SDK
|
|
4
|
+
|
|
5
|
+
The SDK provides programmatic access to Grip's agent capabilities. Use `GripAgent` as the composition root for embedded apps, custom interfaces, automated workflows, and tests.
|
|
6
|
+
|
|
7
|
+
See [examples/sdk/](../examples/sdk/) for working examples from minimal to full control.
|
|
8
|
+
|
|
9
|
+
`CreateGripAgentOptions.hooks` controls Claude-compatible hooks. Automatic discovery is user-only. Set the host-only `trustProjectHooks: true` only after approving the destination repository; it does not discover project hooks when the initial workspace backend is non-local. Once an approved local snapshot exists, project/local command hooks follow later backend transitions and execute inside sandbox/remote operations rather than on the host. Project/local HTTP hooks fail closed on non-local backends. User hooks and `hooks.snapshot` remain trusted host configuration, while `hooks.allowedHttpHookUrls` and `hooks.httpHookAllowedEnvVars` impose host ceilings. See [hooks.md](hooks.md).
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { AuthStorage, InMemorySessionManager, ModelRegistry, GripAgent } from "@greppleai/grip";
|
|
15
|
+
|
|
16
|
+
const authStorage = AuthStorage.create();
|
|
17
|
+
const modelRegistry = ModelRegistry.create(authStorage);
|
|
18
|
+
const pi = await GripAgent.create({
|
|
19
|
+
sessionManager: new InMemorySessionManager(),
|
|
20
|
+
authStorage,
|
|
21
|
+
modelRegistry,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const session = await pi.createAgentSession();
|
|
25
|
+
|
|
26
|
+
session.subscribe((event) => {
|
|
27
|
+
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
|
|
28
|
+
process.stdout.write(event.assistantMessageEvent.delta);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
await session.prompt("What files are in the current directory?");
|
|
33
|
+
await pi.dispose();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Core Concepts
|
|
37
|
+
|
|
38
|
+
### GripAgent
|
|
39
|
+
|
|
40
|
+
`GripAgent` owns shared app services, the session lifecycle backend, and the current active `AgentSession`.
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { InMemorySessionManager, GripAgent } from "@greppleai/grip";
|
|
44
|
+
|
|
45
|
+
const pi = await GripAgent.create({
|
|
46
|
+
sessionManager: new InMemorySessionManager(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const session = await pi.createAgentSession();
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The session manages agent lifecycle, message history, model state, compaction, and event streaming.
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
interface AgentSession {
|
|
56
|
+
// Send a prompt and wait for completion
|
|
57
|
+
prompt(text: string, options?: PromptOptions): Promise<void>;
|
|
58
|
+
|
|
59
|
+
// Queue messages during streaming
|
|
60
|
+
steer(text: string): Promise<void>;
|
|
61
|
+
followUp(text: string): Promise<void>;
|
|
62
|
+
|
|
63
|
+
// Subscribe to events (returns unsubscribe function)
|
|
64
|
+
subscribe(listener: (event: AgentSessionEvent) => void): () => void;
|
|
65
|
+
|
|
66
|
+
// Session info
|
|
67
|
+
sessionFile: string | undefined;
|
|
68
|
+
sessionId: string;
|
|
69
|
+
|
|
70
|
+
// Model control
|
|
71
|
+
setModel(model: Model): Promise<void>;
|
|
72
|
+
setThinkingLevel(level: ThinkingLevel): void;
|
|
73
|
+
cycleModel(): Promise<ModelCycleResult | undefined>;
|
|
74
|
+
cycleThinkingLevel(): ThinkingLevel | undefined;
|
|
75
|
+
|
|
76
|
+
// State access
|
|
77
|
+
agent: Agent;
|
|
78
|
+
model: Model | undefined;
|
|
79
|
+
thinkingLevel: ThinkingLevel;
|
|
80
|
+
messages: AgentMessage[];
|
|
81
|
+
isStreaming: boolean;
|
|
82
|
+
|
|
83
|
+
// In-place tree navigation within the current session file
|
|
84
|
+
navigateTree(targetId: string, options?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string }): Promise<{ editorText?: string; cancelled: boolean }>;
|
|
85
|
+
|
|
86
|
+
// Compaction
|
|
87
|
+
compact(customInstructions?: string): Promise<CompactionResult>;
|
|
88
|
+
abortCompaction(): void;
|
|
89
|
+
|
|
90
|
+
// Abort current operation
|
|
91
|
+
abort(): Promise<void>;
|
|
92
|
+
|
|
93
|
+
// Cleanup
|
|
94
|
+
dispose(): void;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Most one-off session options can be passed directly to `GripAgent.create()`:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
const pi = await GripAgent.create({
|
|
102
|
+
cwd: process.cwd(),
|
|
103
|
+
model,
|
|
104
|
+
thinkingLevel: "high",
|
|
105
|
+
tools: ["read", "grep", "find", "ls"],
|
|
106
|
+
authStorage,
|
|
107
|
+
modelRegistry,
|
|
108
|
+
settingsManager,
|
|
109
|
+
resourceLoader,
|
|
110
|
+
sessionManager,
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Use `pi.createAgentSession({ session })` when you already have an opened or created `Session`. Here `pi` is the example's local `GripAgent` instance.
|
|
115
|
+
|
|
116
|
+
### AgentSession
|
|
117
|
+
|
|
118
|
+
`AgentSession` owns active conversation behavior: prompts, message history, model state, compaction, event streaming, and in-place tree navigation.
|
|
119
|
+
|
|
120
|
+
Use `session.sessionReference` when you need the backend-neutral active session reference. For local JSONL sessions this is the session file path; for in-memory sessions it is `undefined`. `session.sessionFile` remains available as a local-file-oriented alias.
|
|
121
|
+
|
|
122
|
+
Session replacement APIs such as new-session, resume, fork, clone, and import live on `GripAgent`, not on `AgentSession`.
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
interface PromptOptions {
|
|
126
|
+
expandPromptTemplates?: boolean;
|
|
127
|
+
images?: ImageContent[];
|
|
128
|
+
streamingBehavior?: "steer" | "followUp";
|
|
129
|
+
source?: InputSource;
|
|
130
|
+
preflightResult?: (success: boolean) => void;
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### SessionManager and Session
|
|
135
|
+
|
|
136
|
+
`SessionManager` handles lifecycle and discovery: create, open, continue, list, fork, and import. It returns a `Session`.
|
|
137
|
+
|
|
138
|
+
`Session` owns active persisted conversation state and tree operations.
|
|
139
|
+
|
|
140
|
+
## Prompting
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
await session.prompt("What files are here?");
|
|
144
|
+
|
|
145
|
+
await session.prompt("What's in this image?", {
|
|
146
|
+
images: [{ type: "image", source: { type: "base64", mediaType: "image/png", data: "..." } }],
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
await session.prompt("After you're done, also check X", { streamingBehavior: "followUp" });
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Use `steer()` or `followUp()` for explicit queueing during streaming:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
await session.steer("New instruction");
|
|
156
|
+
await session.followUp("After you're done, also do this");
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Events
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
const unsubscribe = session.subscribe((event) => {
|
|
163
|
+
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
|
|
164
|
+
process.stdout.write(event.assistantMessageEvent.delta);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Subscriptions are attached to a specific `AgentSession`. Re-subscribe after `GripAgent` replaces the active session.
|
|
170
|
+
|
|
171
|
+
## Session Replacement
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
import { LocalSessionManager, GripAgent } from "@greppleai/grip";
|
|
175
|
+
|
|
176
|
+
const pi = await GripAgent.create({
|
|
177
|
+
cwd: process.cwd(),
|
|
178
|
+
sessionManager: new LocalSessionManager({ cwd: process.cwd() }),
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
await pi.createAgentSession();
|
|
182
|
+
await pi.newSession();
|
|
183
|
+
await pi.switchSession("/path/to/session.jsonl");
|
|
184
|
+
await pi.fork("entry-id");
|
|
185
|
+
await pi.fork("entry-id", { position: "at" });
|
|
186
|
+
await pi.importFromJsonl("/path/to/old-session.jsonl");
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
After replacement, use `pi.session` for the new active `AgentSession`.
|
|
190
|
+
|
|
191
|
+
## Common Configuration
|
|
192
|
+
|
|
193
|
+
### Model
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
import { getModel } from "@greppleai/grip-ai";
|
|
197
|
+
import { AuthStorage, ModelRegistry, GripAgent } from "@greppleai/grip";
|
|
198
|
+
|
|
199
|
+
const authStorage = AuthStorage.create();
|
|
200
|
+
const modelRegistry = ModelRegistry.create(authStorage);
|
|
201
|
+
const model = getModel("anthropic", "claude-opus-4-5");
|
|
202
|
+
|
|
203
|
+
const pi = await GripAgent.create({
|
|
204
|
+
authStorage,
|
|
205
|
+
modelRegistry,
|
|
206
|
+
model,
|
|
207
|
+
thinkingLevel: "medium",
|
|
208
|
+
});
|
|
209
|
+
const session = await pi.createAgentSession();
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### API keys and OAuth
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
const authStorage = AuthStorage.create();
|
|
216
|
+
const modelRegistry = ModelRegistry.create(authStorage);
|
|
217
|
+
authStorage.setRuntimeApiKey("anthropic", "sk-my-temp-key");
|
|
218
|
+
|
|
219
|
+
const pi = await GripAgent.create({ authStorage, modelRegistry });
|
|
220
|
+
await pi.createAgentSession();
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Resource loading
|
|
224
|
+
|
|
225
|
+
Use `DefaultResourceLoader` to override or discover extensions, skills, rules, prompt templates, themes, and context files.
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
const loader = new DefaultResourceLoader({
|
|
229
|
+
cwd: process.cwd(),
|
|
230
|
+
agentDir: getAgentDir(),
|
|
231
|
+
systemPromptOverride: () => "You are a helpful assistant.",
|
|
232
|
+
});
|
|
233
|
+
await loader.reload();
|
|
234
|
+
|
|
235
|
+
const pi = await GripAgent.create({ resourceLoader: loader });
|
|
236
|
+
await pi.createAgentSession();
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Tools
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
const pi = await GripAgent.create({
|
|
243
|
+
tools: ["read", "grep", "find", "ls"],
|
|
244
|
+
noTools: "builtin",
|
|
245
|
+
customTools: [myTool],
|
|
246
|
+
});
|
|
247
|
+
await pi.createAgentSession();
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Built-in tool names include `read`, `bash`, `edit`, `write`, `websearch`, `session_search`, `session_entry_get`, `compress_context`, `grep`, `find`, `ls`, `subagent`, `subagent_runs`, `create_subagent`, and the `lsp_*` navigation/refactoring tools. The subagent and LSP tool families are inactive by default. Set `enableSubagents: true` in settings to activate subagents or `enableLspTools: true` in settings or `GripAgent.create()` to expose configured LSP tools. An explicit `tools` option selects any subset regardless of these defaults; `noTools: "all"` and `noTools: "builtin"` remain authoritative.
|
|
251
|
+
|
|
252
|
+
### Settings
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
const settingsManager = SettingsManager.inMemory({
|
|
256
|
+
enableSubagents: true,
|
|
257
|
+
compaction: { enabled: false },
|
|
258
|
+
retry: { enabled: true, maxRetries: 2 },
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const pi = await GripAgent.create({ settingsManager });
|
|
262
|
+
await pi.createAgentSession();
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
For a live session, `session.setSubagentsEnabled(enabled)` persists the setting and immediately refreshes active tools and orchestration guidance. `session.reload()` applies settings-file changes.
|
|
266
|
+
|
|
267
|
+
## Language servers
|
|
268
|
+
|
|
269
|
+
Each active `AgentSession` owns exactly one LSP runtime; `GripAgent` resolves its configuration and replaces it with the session lifecycle. Supply the same validated configuration used by settings or the CLI through `lsp`:
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
import { InMemorySessionManager, GripAgent } from "@greppleai/grip";
|
|
273
|
+
|
|
274
|
+
const pi = await GripAgent.create({
|
|
275
|
+
cwd: process.cwd(),
|
|
276
|
+
sessionManager: new InMemorySessionManager(process.cwd()),
|
|
277
|
+
enableLspTools: true,
|
|
278
|
+
lsp: {
|
|
279
|
+
type: "configuration",
|
|
280
|
+
configuration: {
|
|
281
|
+
servers: [
|
|
282
|
+
{
|
|
283
|
+
id: "typescript",
|
|
284
|
+
selectors: [{ languageId: "typescript", pattern: "**/*.ts" }],
|
|
285
|
+
transport: { type: "tcp", host: "127.0.0.1", port: 2087 },
|
|
286
|
+
lifecycle: { type: "attached" },
|
|
287
|
+
workspace: { type: "session" },
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
const session = await pi.createAgentSession();
|
|
295
|
+
console.log(session.getLspStatus());
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Hosts can also provide `lspConnectionFactories`, grant `trustProjectLspTransports` after applying their own trust policy, and return destination-specific LSP options from `resolveSessionOptions`. The grant covers every active project-origin transport and positive project `enabled: true` activation because both commands and attached endpoints can expose document content; project settings cannot grant it to themselves. `GripAgent.create()` and `resolveSessionOptions` inputs propagate through new, resumed, forked, and cross-cwd replacement sessions; source-relative paths are re-resolved for the destination cwd. Use `session.configureLsp(layer)` for a validated session-runtime-only replacement; normal reload or session replacement re-applies the configured sources. `session.reload()` returns current raw, source- and JSON-path-attributed LSP configuration diagnostics. `pi.diagnostics` exposes formatted diagnostics from initial session creation and refreshes them after reload or session replacement. Invalid or unreadable LSP configuration yields nonfatal diagnostics at the applicable error or warning severity and an empty disabled LSP state rather than retaining stale runtime state; unrelated application diagnostics remain fatal.
|
|
299
|
+
|
|
300
|
+
See [Language Server Protocol](lsp.md) for complete configuration, a host-provided connection-factory example, lifecycle ownership, status fields, reload behavior, and migration guidance.
|
|
301
|
+
|
|
302
|
+
## Run Modes
|
|
303
|
+
|
|
304
|
+
The SDK exports run mode utilities for building custom interfaces on top of `GripAgent`.
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
import { InteractiveMode, LocalSessionManager, GripAgent, runPrintMode, runRpcMode } from "@greppleai/grip";
|
|
308
|
+
|
|
309
|
+
const pi = await GripAgent.create({
|
|
310
|
+
cwd: process.cwd(),
|
|
311
|
+
sessionManager: new LocalSessionManager({ cwd: process.cwd() }),
|
|
312
|
+
});
|
|
313
|
+
await pi.createAgentSession();
|
|
314
|
+
|
|
315
|
+
await runPrintMode(pi, {
|
|
316
|
+
mode: "text",
|
|
317
|
+
initialMessage: "Hello",
|
|
318
|
+
initialImages: [],
|
|
319
|
+
messages: [],
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
await runRpcMode(pi);
|
|
323
|
+
|
|
324
|
+
const mode = new InteractiveMode(pi, {
|
|
325
|
+
migratedProviders: [],
|
|
326
|
+
modelFallbackMessage: pi.modelFallbackMessage,
|
|
327
|
+
initialMessage: "Hello",
|
|
328
|
+
initialImages: [],
|
|
329
|
+
initialMessages: [],
|
|
330
|
+
});
|
|
331
|
+
await mode.run();
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
See [RPC documentation](rpc.md) for the JSON protocol.
|
|
335
|
+
|
|
336
|
+
## Main Exports
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
GripAgent
|
|
340
|
+
AgentSession
|
|
341
|
+
AuthStorage
|
|
342
|
+
ModelRegistry
|
|
343
|
+
DefaultResourceLoader
|
|
344
|
+
defineTool
|
|
345
|
+
InMemorySessionManager
|
|
346
|
+
LocalSessionManager
|
|
347
|
+
SettingsManager
|
|
348
|
+
createEventBus
|
|
349
|
+
createCodingTools
|
|
350
|
+
createReadOnlyTools
|
|
351
|
+
createReadTool, createBashTool, createEditTool, createWriteTool
|
|
352
|
+
createGrepTool, createFindTool, createLsTool, createSubagentTool
|
|
353
|
+
LspClient, LspManager, LspFileSync, LspRouter, LspPathMapper
|
|
354
|
+
loadLspConfiguration, parseLspConfiguration, resolveLspConfiguration
|
|
355
|
+
createManagedStdioConnectionFactory, createTcpConnectionFactory
|
|
356
|
+
registerStandaloneLspLifecycleHandlers
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The package root curates the public LSP API directly from the modules under `core/lsp/`. `createSubagentTool` requires a `SubagentRunner` in its options. `GripAgent` configures the embedded runner automatically; standalone tool construction must provide its own in-process runner.
|
|
360
|
+
For extension types, see [extensions.md](extensions.md). For LSP configuration, lifecycle, transport, routing, status, and public type exports, see [Language Server Protocol](lsp.md).
|