@jait/gateway 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/jait.mjs +144 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +73 -0
- package/dist/config.js.map +1 -0
- package/dist/db/connection.d.ts +37 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +85 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +4 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +4 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +24 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +312 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/schema.d.ts +2253 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +195 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/foundation.d.ts +26 -0
- package/dist/foundation.d.ts.map +1 -0
- package/dist/foundation.js +15 -0
- package/dist/foundation.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +413 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/uuidv7.d.ts +10 -0
- package/dist/lib/uuidv7.d.ts.map +1 -0
- package/dist/lib/uuidv7.js +33 -0
- package/dist/lib/uuidv7.js.map +1 -0
- package/dist/memory/contracts.d.ts +42 -0
- package/dist/memory/contracts.d.ts.map +1 -0
- package/dist/memory/contracts.js +2 -0
- package/dist/memory/contracts.js.map +1 -0
- package/dist/memory/embeddings.d.ts +4 -0
- package/dist/memory/embeddings.d.ts.map +1 -0
- package/dist/memory/embeddings.js +26 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/service.d.ts +17 -0
- package/dist/memory/service.d.ts.map +1 -0
- package/dist/memory/service.js +82 -0
- package/dist/memory/service.js.map +1 -0
- package/dist/memory/sqlite-backend.d.ts +11 -0
- package/dist/memory/sqlite-backend.d.ts.map +1 -0
- package/dist/memory/sqlite-backend.js +68 -0
- package/dist/memory/sqlite-backend.js.map +1 -0
- package/dist/plugins/contracts.d.ts +11 -0
- package/dist/plugins/contracts.d.ts.map +1 -0
- package/dist/plugins/contracts.js +2 -0
- package/dist/plugins/contracts.js.map +1 -0
- package/dist/providers/claude-code-provider.d.ts +39 -0
- package/dist/providers/claude-code-provider.d.ts.map +1 -0
- package/dist/providers/claude-code-provider.js +322 -0
- package/dist/providers/claude-code-provider.js.map +1 -0
- package/dist/providers/codex-provider.d.ts +51 -0
- package/dist/providers/codex-provider.d.ts.map +1 -0
- package/dist/providers/codex-provider.js +826 -0
- package/dist/providers/codex-provider.js.map +1 -0
- package/dist/providers/contracts.d.ts +167 -0
- package/dist/providers/contracts.d.ts.map +1 -0
- package/dist/providers/contracts.js +13 -0
- package/dist/providers/contracts.js.map +1 -0
- package/dist/providers/index.d.ts +6 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +5 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/jait-provider.d.ts +23 -0
- package/dist/providers/jait-provider.d.ts.map +1 -0
- package/dist/providers/jait-provider.js +67 -0
- package/dist/providers/jait-provider.js.map +1 -0
- package/dist/providers/registry.d.ts +39 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +64 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/pty-broker-client.d.ts +46 -0
- package/dist/pty-broker-client.d.ts.map +1 -0
- package/dist/pty-broker-client.js +142 -0
- package/dist/pty-broker-client.js.map +1 -0
- package/dist/routes/auth.d.ts +6 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +236 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/chat.d.ts +32 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +1503 -0
- package/dist/routes/chat.js.map +1 -0
- package/dist/routes/consent.d.ts +10 -0
- package/dist/routes/consent.d.ts.map +1 -0
- package/dist/routes/consent.js +127 -0
- package/dist/routes/consent.js.map +1 -0
- package/dist/routes/filesystem.d.ts +14 -0
- package/dist/routes/filesystem.d.ts.map +1 -0
- package/dist/routes/filesystem.js +152 -0
- package/dist/routes/filesystem.js.map +1 -0
- package/dist/routes/git.d.ts +17 -0
- package/dist/routes/git.d.ts.map +1 -0
- package/dist/routes/git.js +213 -0
- package/dist/routes/git.js.map +1 -0
- package/dist/routes/health.d.ts +7 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +21 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/hooks.d.ts +9 -0
- package/dist/routes/hooks.d.ts.map +1 -0
- package/dist/routes/hooks.js +22 -0
- package/dist/routes/hooks.js.map +1 -0
- package/dist/routes/jobs.d.ts +5 -0
- package/dist/routes/jobs.d.ts.map +1 -0
- package/dist/routes/jobs.js +333 -0
- package/dist/routes/jobs.js.map +1 -0
- package/dist/routes/mcp-server.d.ts +23 -0
- package/dist/routes/mcp-server.d.ts.map +1 -0
- package/dist/routes/mcp-server.js +177 -0
- package/dist/routes/mcp-server.js.map +1 -0
- package/dist/routes/mobile.d.ts +12 -0
- package/dist/routes/mobile.d.ts.map +1 -0
- package/dist/routes/mobile.js +64 -0
- package/dist/routes/mobile.js.map +1 -0
- package/dist/routes/network.d.ts +3 -0
- package/dist/routes/network.d.ts.map +1 -0
- package/dist/routes/network.js +367 -0
- package/dist/routes/network.js.map +1 -0
- package/dist/routes/repositories.d.ts +18 -0
- package/dist/routes/repositories.d.ts.map +1 -0
- package/dist/routes/repositories.js +90 -0
- package/dist/routes/repositories.js.map +1 -0
- package/dist/routes/screen-share.d.ts +17 -0
- package/dist/routes/screen-share.d.ts.map +1 -0
- package/dist/routes/screen-share.js +92 -0
- package/dist/routes/screen-share.js.map +1 -0
- package/dist/routes/sessions.d.ts +18 -0
- package/dist/routes/sessions.d.ts.map +1 -0
- package/dist/routes/sessions.js +169 -0
- package/dist/routes/sessions.js.map +1 -0
- package/dist/routes/terminals.d.ts +15 -0
- package/dist/routes/terminals.d.ts.map +1 -0
- package/dist/routes/terminals.js +326 -0
- package/dist/routes/terminals.js.map +1 -0
- package/dist/routes/threads.d.ts +38 -0
- package/dist/routes/threads.d.ts.map +1 -0
- package/dist/routes/threads.js +488 -0
- package/dist/routes/threads.js.map +1 -0
- package/dist/routes/trust.d.ts +9 -0
- package/dist/routes/trust.d.ts.map +1 -0
- package/dist/routes/trust.js +25 -0
- package/dist/routes/trust.js.map +1 -0
- package/dist/routes/voice.d.ts +5 -0
- package/dist/routes/voice.d.ts.map +1 -0
- package/dist/routes/voice.js +37 -0
- package/dist/routes/voice.js.map +1 -0
- package/dist/routes/workspace.d.ts +13 -0
- package/dist/routes/workspace.d.ts.map +1 -0
- package/dist/routes/workspace.js +275 -0
- package/dist/routes/workspace.js.map +1 -0
- package/dist/scheduler/contracts.d.ts +15 -0
- package/dist/scheduler/contracts.d.ts.map +1 -0
- package/dist/scheduler/contracts.js +2 -0
- package/dist/scheduler/contracts.js.map +1 -0
- package/dist/scheduler/hooks.d.ts +20 -0
- package/dist/scheduler/hooks.d.ts.map +1 -0
- package/dist/scheduler/hooks.js +78 -0
- package/dist/scheduler/hooks.js.map +1 -0
- package/dist/scheduler/service.d.ts +65 -0
- package/dist/scheduler/service.d.ts.map +1 -0
- package/dist/scheduler/service.js +188 -0
- package/dist/scheduler/service.js.map +1 -0
- package/dist/security/consent-executor.d.ts +48 -0
- package/dist/security/consent-executor.d.ts.map +1 -0
- package/dist/security/consent-executor.js +158 -0
- package/dist/security/consent-executor.js.map +1 -0
- package/dist/security/consent-manager.d.ts +105 -0
- package/dist/security/consent-manager.d.ts.map +1 -0
- package/dist/security/consent-manager.js +227 -0
- package/dist/security/consent-manager.js.map +1 -0
- package/dist/security/contracts.d.ts +31 -0
- package/dist/security/contracts.d.ts.map +1 -0
- package/dist/security/contracts.js +2 -0
- package/dist/security/contracts.js.map +1 -0
- package/dist/security/http-auth.d.ts +10 -0
- package/dist/security/http-auth.d.ts.map +1 -0
- package/dist/security/http-auth.js +48 -0
- package/dist/security/http-auth.js.map +1 -0
- package/dist/security/index.d.ts +10 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +9 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/path-guard.d.ts +40 -0
- package/dist/security/path-guard.d.ts.map +1 -0
- package/dist/security/path-guard.js +125 -0
- package/dist/security/path-guard.js.map +1 -0
- package/dist/security/sandbox-manager.d.ts +43 -0
- package/dist/security/sandbox-manager.d.ts.map +1 -0
- package/dist/security/sandbox-manager.js +110 -0
- package/dist/security/sandbox-manager.js.map +1 -0
- package/dist/security/ssrf-guard.d.ts +11 -0
- package/dist/security/ssrf-guard.d.ts.map +1 -0
- package/dist/security/ssrf-guard.js +59 -0
- package/dist/security/ssrf-guard.js.map +1 -0
- package/dist/security/tool-permissions.d.ts +61 -0
- package/dist/security/tool-permissions.d.ts.map +1 -0
- package/dist/security/tool-permissions.js +105 -0
- package/dist/security/tool-permissions.js.map +1 -0
- package/dist/security/tool-profiles.d.ts +23 -0
- package/dist/security/tool-profiles.d.ts.map +1 -0
- package/dist/security/tool-profiles.js +106 -0
- package/dist/security/tool-profiles.js.map +1 -0
- package/dist/security/trust-engine.d.ts +61 -0
- package/dist/security/trust-engine.d.ts.map +1 -0
- package/dist/security/trust-engine.js +192 -0
- package/dist/security/trust-engine.js.map +1 -0
- package/dist/server.d.ts +54 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +188 -0
- package/dist/server.js.map +1 -0
- package/dist/services/audit.d.ts +60 -0
- package/dist/services/audit.d.ts.map +1 -0
- package/dist/services/audit.js +58 -0
- package/dist/services/audit.js.map +1 -0
- package/dist/services/device-registry.d.ts +15 -0
- package/dist/services/device-registry.d.ts.map +1 -0
- package/dist/services/device-registry.js +32 -0
- package/dist/services/device-registry.js.map +1 -0
- package/dist/services/git.d.ts +168 -0
- package/dist/services/git.d.ts.map +1 -0
- package/dist/services/git.js +957 -0
- package/dist/services/git.js.map +1 -0
- package/dist/services/repositories.d.ts +32 -0
- package/dist/services/repositories.d.ts.map +1 -0
- package/dist/services/repositories.js +70 -0
- package/dist/services/repositories.js.map +1 -0
- package/dist/services/session-state.d.ts +20 -0
- package/dist/services/session-state.d.ts.map +1 -0
- package/dist/services/session-state.js +89 -0
- package/dist/services/session-state.js.map +1 -0
- package/dist/services/sessions.d.ts +68 -0
- package/dist/services/sessions.d.ts.map +1 -0
- package/dist/services/sessions.js +136 -0
- package/dist/services/sessions.js.map +1 -0
- package/dist/services/thread-title.d.ts +23 -0
- package/dist/services/thread-title.d.ts.map +1 -0
- package/dist/services/thread-title.js +141 -0
- package/dist/services/thread-title.js.map +1 -0
- package/dist/services/threads.d.ts +64 -0
- package/dist/services/threads.d.ts.map +1 -0
- package/dist/services/threads.js +202 -0
- package/dist/services/threads.js.map +1 -0
- package/dist/services/users.d.ts +39 -0
- package/dist/services/users.d.ts.map +1 -0
- package/dist/services/users.js +203 -0
- package/dist/services/users.js.map +1 -0
- package/dist/sessions/contracts.d.ts +14 -0
- package/dist/sessions/contracts.d.ts.map +1 -0
- package/dist/sessions/contracts.js +2 -0
- package/dist/sessions/contracts.js.map +1 -0
- package/dist/surfaces/browser.d.ts +65 -0
- package/dist/surfaces/browser.d.ts.map +1 -0
- package/dist/surfaces/browser.js +615 -0
- package/dist/surfaces/browser.js.map +1 -0
- package/dist/surfaces/contracts.d.ts +34 -0
- package/dist/surfaces/contracts.d.ts.map +1 -0
- package/dist/surfaces/contracts.js +2 -0
- package/dist/surfaces/contracts.js.map +1 -0
- package/dist/surfaces/filesystem.d.ts +76 -0
- package/dist/surfaces/filesystem.d.ts.map +1 -0
- package/dist/surfaces/filesystem.js +245 -0
- package/dist/surfaces/filesystem.js.map +1 -0
- package/dist/surfaces/index.d.ts +6 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +5 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/registry.d.ts +24 -0
- package/dist/surfaces/registry.d.ts.map +1 -0
- package/dist/surfaces/registry.js +59 -0
- package/dist/surfaces/registry.js.map +1 -0
- package/dist/surfaces/terminal.d.ts +76 -0
- package/dist/surfaces/terminal.d.ts.map +1 -0
- package/dist/surfaces/terminal.js +271 -0
- package/dist/surfaces/terminal.js.map +1 -0
- package/dist/tools/agent-loop.d.ts +302 -0
- package/dist/tools/agent-loop.d.ts.map +1 -0
- package/dist/tools/agent-loop.js +918 -0
- package/dist/tools/agent-loop.js.map +1 -0
- package/dist/tools/agent-tools.d.ts +39 -0
- package/dist/tools/agent-tools.d.ts.map +1 -0
- package/dist/tools/agent-tools.js +263 -0
- package/dist/tools/agent-tools.js.map +1 -0
- package/dist/tools/browser-tools.d.ts +38 -0
- package/dist/tools/browser-tools.d.ts.map +1 -0
- package/dist/tools/browser-tools.js +725 -0
- package/dist/tools/browser-tools.js.map +1 -0
- package/dist/tools/chat-modes.d.ts +75 -0
- package/dist/tools/chat-modes.d.ts.map +1 -0
- package/dist/tools/chat-modes.js +228 -0
- package/dist/tools/chat-modes.js.map +1 -0
- package/dist/tools/contracts.d.ts +69 -0
- package/dist/tools/contracts.d.ts.map +1 -0
- package/dist/tools/contracts.js +2 -0
- package/dist/tools/contracts.js.map +1 -0
- package/dist/tools/core/agent.d.ts +31 -0
- package/dist/tools/core/agent.d.ts.map +1 -0
- package/dist/tools/core/agent.js +65 -0
- package/dist/tools/core/agent.js.map +1 -0
- package/dist/tools/core/edit.d.ts +30 -0
- package/dist/tools/core/edit.d.ts.map +1 -0
- package/dist/tools/core/edit.js +109 -0
- package/dist/tools/core/edit.js.map +1 -0
- package/dist/tools/core/execute.d.ts +36 -0
- package/dist/tools/core/execute.d.ts.map +1 -0
- package/dist/tools/core/execute.js +81 -0
- package/dist/tools/core/execute.js.map +1 -0
- package/dist/tools/core/get-fs.d.ts +32 -0
- package/dist/tools/core/get-fs.d.ts.map +1 -0
- package/dist/tools/core/get-fs.js +143 -0
- package/dist/tools/core/get-fs.js.map +1 -0
- package/dist/tools/core/index.d.ts +26 -0
- package/dist/tools/core/index.d.ts.map +1 -0
- package/dist/tools/core/index.js +26 -0
- package/dist/tools/core/index.js.map +1 -0
- package/dist/tools/core/jait.d.ts +60 -0
- package/dist/tools/core/jait.d.ts.map +1 -0
- package/dist/tools/core/jait.js +256 -0
- package/dist/tools/core/jait.js.map +1 -0
- package/dist/tools/core/read.d.ts +26 -0
- package/dist/tools/core/read.d.ts.map +1 -0
- package/dist/tools/core/read.js +118 -0
- package/dist/tools/core/read.js.map +1 -0
- package/dist/tools/core/search.d.ts +34 -0
- package/dist/tools/core/search.d.ts.map +1 -0
- package/dist/tools/core/search.js +187 -0
- package/dist/tools/core/search.js.map +1 -0
- package/dist/tools/core/todo.d.ts +38 -0
- package/dist/tools/core/todo.d.ts.map +1 -0
- package/dist/tools/core/todo.js +116 -0
- package/dist/tools/core/todo.js.map +1 -0
- package/dist/tools/core/web.d.ts +34 -0
- package/dist/tools/core/web.d.ts.map +1 -0
- package/dist/tools/core/web.js +120 -0
- package/dist/tools/core/web.js.map +1 -0
- package/dist/tools/cron-tools.d.ts +7 -0
- package/dist/tools/cron-tools.d.ts.map +1 -0
- package/dist/tools/cron-tools.js +116 -0
- package/dist/tools/cron-tools.js.map +1 -0
- package/dist/tools/file-tools.d.ts +32 -0
- package/dist/tools/file-tools.d.ts.map +1 -0
- package/dist/tools/file-tools.js +178 -0
- package/dist/tools/file-tools.js.map +1 -0
- package/dist/tools/gateway-tools.d.ts +15 -0
- package/dist/tools/gateway-tools.d.ts.map +1 -0
- package/dist/tools/gateway-tools.js +39 -0
- package/dist/tools/gateway-tools.js.map +1 -0
- package/dist/tools/index.d.ts +57 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +170 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/mcp-bridge.d.ts +111 -0
- package/dist/tools/mcp-bridge.d.ts.map +1 -0
- package/dist/tools/mcp-bridge.js +166 -0
- package/dist/tools/mcp-bridge.js.map +1 -0
- package/dist/tools/memory-tools.d.ts +19 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +78 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/meta-tools.d.ts +25 -0
- package/dist/tools/meta-tools.d.ts.map +1 -0
- package/dist/tools/meta-tools.js +125 -0
- package/dist/tools/meta-tools.js.map +1 -0
- package/dist/tools/network-tools.d.ts +21 -0
- package/dist/tools/network-tools.d.ts.map +1 -0
- package/dist/tools/network-tools.js +189 -0
- package/dist/tools/network-tools.js.map +1 -0
- package/dist/tools/os-tools.d.ts +18 -0
- package/dist/tools/os-tools.d.ts.map +1 -0
- package/dist/tools/os-tools.js +210 -0
- package/dist/tools/os-tools.js.map +1 -0
- package/dist/tools/prompts/claude-prompt.d.ts +8 -0
- package/dist/tools/prompts/claude-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/claude-prompt.js +228 -0
- package/dist/tools/prompts/claude-prompt.js.map +1 -0
- package/dist/tools/prompts/default-openai-prompt.d.ts +8 -0
- package/dist/tools/prompts/default-openai-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/default-openai-prompt.js +67 -0
- package/dist/tools/prompts/default-openai-prompt.js.map +1 -0
- package/dist/tools/prompts/default-prompt.d.ts +7 -0
- package/dist/tools/prompts/default-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/default-prompt.js +50 -0
- package/dist/tools/prompts/default-prompt.js.map +1 -0
- package/dist/tools/prompts/gemini-prompt.d.ts +8 -0
- package/dist/tools/prompts/gemini-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/gemini-prompt.js +118 -0
- package/dist/tools/prompts/gemini-prompt.js.map +1 -0
- package/dist/tools/prompts/gpt5-codex-prompt.d.ts +8 -0
- package/dist/tools/prompts/gpt5-codex-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/gpt5-codex-prompt.js +72 -0
- package/dist/tools/prompts/gpt5-codex-prompt.js.map +1 -0
- package/dist/tools/prompts/gpt5-prompt.d.ts +8 -0
- package/dist/tools/prompts/gpt5-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/gpt5-prompt.js +177 -0
- package/dist/tools/prompts/gpt5-prompt.js.map +1 -0
- package/dist/tools/prompts/gpt51-prompt.d.ts +8 -0
- package/dist/tools/prompts/gpt51-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/gpt51-prompt.js +178 -0
- package/dist/tools/prompts/gpt51-prompt.js.map +1 -0
- package/dist/tools/prompts/gpt52-prompt.d.ts +8 -0
- package/dist/tools/prompts/gpt52-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/gpt52-prompt.js +198 -0
- package/dist/tools/prompts/gpt52-prompt.js.map +1 -0
- package/dist/tools/prompts/index.d.ts +22 -0
- package/dist/tools/prompts/index.d.ts.map +1 -0
- package/dist/tools/prompts/index.js +23 -0
- package/dist/tools/prompts/index.js.map +1 -0
- package/dist/tools/prompts/prompt-registry.d.ts +44 -0
- package/dist/tools/prompts/prompt-registry.d.ts.map +1 -0
- package/dist/tools/prompts/prompt-registry.js +60 -0
- package/dist/tools/prompts/prompt-registry.js.map +1 -0
- package/dist/tools/prompts/shared-sections.d.ts +28 -0
- package/dist/tools/prompts/shared-sections.d.ts.map +1 -0
- package/dist/tools/prompts/shared-sections.js +111 -0
- package/dist/tools/prompts/shared-sections.js.map +1 -0
- package/dist/tools/prompts/xai-prompt.d.ts +8 -0
- package/dist/tools/prompts/xai-prompt.d.ts.map +1 -0
- package/dist/tools/prompts/xai-prompt.js +68 -0
- package/dist/tools/prompts/xai-prompt.js.map +1 -0
- package/dist/tools/redeploy-tools.d.ts +30 -0
- package/dist/tools/redeploy-tools.d.ts.map +1 -0
- package/dist/tools/redeploy-tools.js +191 -0
- package/dist/tools/redeploy-tools.js.map +1 -0
- package/dist/tools/registry.d.ts +51 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +148 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/screen-share-tools.d.ts +31 -0
- package/dist/tools/screen-share-tools.d.ts.map +1 -0
- package/dist/tools/screen-share-tools.js +183 -0
- package/dist/tools/screen-share-tools.js.map +1 -0
- package/dist/tools/surface-tools.d.ts +23 -0
- package/dist/tools/surface-tools.d.ts.map +1 -0
- package/dist/tools/surface-tools.js +99 -0
- package/dist/tools/surface-tools.js.map +1 -0
- package/dist/tools/terminal-tools.d.ts +37 -0
- package/dist/tools/terminal-tools.d.ts.map +1 -0
- package/dist/tools/terminal-tools.js +448 -0
- package/dist/tools/terminal-tools.js.map +1 -0
- package/dist/tools/thread-tools.d.ts +61 -0
- package/dist/tools/thread-tools.d.ts.map +1 -0
- package/dist/tools/thread-tools.js +484 -0
- package/dist/tools/thread-tools.js.map +1 -0
- package/dist/tools/token-estimator.d.ts +55 -0
- package/dist/tools/token-estimator.d.ts.map +1 -0
- package/dist/tools/token-estimator.js +82 -0
- package/dist/tools/token-estimator.js.map +1 -0
- package/dist/tools/tool-names.d.ts +64 -0
- package/dist/tools/tool-names.d.ts.map +1 -0
- package/dist/tools/tool-names.js +76 -0
- package/dist/tools/tool-names.js.map +1 -0
- package/dist/tools/validate.d.ts +27 -0
- package/dist/tools/validate.d.ts.map +1 -0
- package/dist/tools/validate.js +99 -0
- package/dist/tools/validate.js.map +1 -0
- package/dist/tools/voice-tools.d.ts +8 -0
- package/dist/tools/voice-tools.d.ts.map +1 -0
- package/dist/tools/voice-tools.js +32 -0
- package/dist/tools/voice-tools.js.map +1 -0
- package/dist/voice/service.d.ts +42 -0
- package/dist/voice/service.d.ts.map +1 -0
- package/dist/voice/service.js +75 -0
- package/dist/voice/service.js.map +1 -0
- package/dist/ws.d.ts +90 -0
- package/dist/ws.d.ts.map +1 -0
- package/dist/ws.js +562 -0
- package/dist/ws.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-tools.js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B;gBAClC,IAAI,EAAE,MAAM;aACb,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat modes — Jait's take on VS Code Copilot's Ask / Agent / Edit (Plan) modes.
|
|
3
|
+
*
|
|
4
|
+
* Unlike Copilot which is IDE-centric, Jait modes consider the full tool
|
|
5
|
+
* ecosystem: terminal, surfaces, schedulers, memory, MCP, etc.
|
|
6
|
+
*
|
|
7
|
+
* - `ask` — Read-only. The agent can read files, search, query — but
|
|
8
|
+
* cannot write files, run commands, or mutate state. Good for
|
|
9
|
+
* questions, explanations, and code review.
|
|
10
|
+
* - `agent` — Full agentic mode (default). All tools available, full
|
|
11
|
+
* execution. The agent acts autonomously with tool calling.
|
|
12
|
+
* - `plan` — Planning mode. The agent reads and analyzes, then produces
|
|
13
|
+
* a structured plan of proposed actions. Mutating tool calls
|
|
14
|
+
* are collected but NOT executed until the user approves the
|
|
15
|
+
* plan. Once approved, the plan executes as a batch.
|
|
16
|
+
*/
|
|
17
|
+
export type ChatMode = "ask" | "agent" | "plan";
|
|
18
|
+
export declare const CHAT_MODES: readonly ["ask", "agent", "plan"];
|
|
19
|
+
export declare function isValidChatMode(value: unknown): value is ChatMode;
|
|
20
|
+
/**
|
|
21
|
+
* Tools allowed in Ask mode. These are strictly read-only and cannot
|
|
22
|
+
* mutate the filesystem, run destructive commands, or change system state.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ASK_MODE_TOOLS: Set<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Tools that mutate state — in Plan mode these are collected into
|
|
27
|
+
* the plan proposal rather than executed immediately.
|
|
28
|
+
*/
|
|
29
|
+
export declare const MUTATING_TOOLS: Set<string>;
|
|
30
|
+
/** A single proposed action within a plan */
|
|
31
|
+
export interface PlannedAction {
|
|
32
|
+
/** Unique ID for this action */
|
|
33
|
+
id: string;
|
|
34
|
+
/** Tool name to execute */
|
|
35
|
+
tool: string;
|
|
36
|
+
/** Tool arguments (as the LLM produced them) */
|
|
37
|
+
args: unknown;
|
|
38
|
+
/** Human-readable description of what this step does */
|
|
39
|
+
description: string;
|
|
40
|
+
/** Order in the plan (0-based) */
|
|
41
|
+
order: number;
|
|
42
|
+
/** Status: pending approval, approved, rejected, executed */
|
|
43
|
+
status: "pending" | "approved" | "rejected" | "executed" | "failed";
|
|
44
|
+
/** Execution result (populated after execution) */
|
|
45
|
+
result?: {
|
|
46
|
+
ok: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
data?: unknown;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** A complete plan proposed by the agent */
|
|
52
|
+
export interface Plan {
|
|
53
|
+
/** Unique plan ID */
|
|
54
|
+
id: string;
|
|
55
|
+
/** Session this plan belongs to */
|
|
56
|
+
sessionId: string;
|
|
57
|
+
/** The agent's summary of what the plan does */
|
|
58
|
+
summary: string;
|
|
59
|
+
/** Ordered list of actions */
|
|
60
|
+
actions: PlannedAction[];
|
|
61
|
+
/** Plan status */
|
|
62
|
+
status: "pending" | "approved" | "partial" | "executing" | "completed" | "rejected";
|
|
63
|
+
/** Timestamp */
|
|
64
|
+
createdAt: string;
|
|
65
|
+
/** When was the plan last updated */
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
}
|
|
68
|
+
export declare const SYSTEM_PROMPT_ASK = "You are Jait \u2014 Just Another Intelligent Tool, running in Ask mode.\n\nIn this mode you answer questions, explain code, analyze files, and provide information.\nYou have read-only access to the filesystem, system info, memory, and web search.\nYou CANNOT write files, run terminal commands, install packages, or modify any system state.\n\nKey capabilities:\n- read: Read files or list directories. Specify startLine/endLine for large files.\n- search: Search file contents (grep) or find files by name.\n- web: Search the web or fetch pages for information.\n- todo: Track tasks and progress.\n- jait: Search memories (action: memory.search), check status (action: status), list cron jobs.\n\nGuidelines:\n- Be thorough and educational in your explanations.\n- Read files to provide accurate answers \u2014 don't guess about code contents.\n- If the user asks you to make changes, explain what you would do and suggest switching to Agent or Plan mode.\n- For code review, read the relevant files first, then provide structured feedback.";
|
|
69
|
+
export declare const SYSTEM_PROMPT_AGENT = "You are Jait \u2014 Just Another Intelligent Tool.\n\nYou are a capable AI coding agent that can read/write files, run shell commands, search the web, delegate tasks to sub-agents, and manage platform services.\n\nWhen the user asks you to do something that requires action (run a command, edit a file, check system info, etc.), use your tools. Don't just describe what you would do \u2014 actually do it.\n\nCore tools:\n- read: Read file contents or list directory entries. Specify startLine/endLine for large files. Truncates at 2000 lines.\n- edit: Create new files, overwrite existing files, or patch (search-and-replace). Always generate the explanation first. Always read before patching.\n- execute: Run shell commands (PowerShell on Windows). Set isBackground: true for servers/watchers. Provide an explanation.\n- search: Search file contents (grep) or find files by name. Use isRegexp for regex patterns. Use include to filter by glob.\n- web: Search the web (query) or fetch URLs (url/urls).\n- agent: Delegate complex multi-step tasks to a sub-agent. Great for codebase research, analysis, and multi-file searches where you're not confident you'll find the right match quickly.\n- todo: Track task progress visually. Use this tool frequently for any multi-step work.\n- jait: Platform services \u2014 save/search/forget memories, add/list/update/remove cron jobs, check gateway status.\n\n## Preambles and progress updates\n\nBefore making tool calls, send a brief preamble to the user explaining what you're about to do. Follow these principles:\n- Logically group related actions: if you're about to run several related commands, describe them together in one preamble rather than sending a separate note for each.\n- Keep it concise: 1-2 sentences (8-12 words for quick updates).\n- Build on prior context: if this is not your first tool call, use the preamble to connect the dots with what's been done so far and explain your next actions.\n- Keep your tone light, friendly and curious.\n- Skip preambles for trivial single reads unless part of a larger grouped action.\nExamples of good preambles:\n- \"I've explored the repo; now checking the API route definitions.\"\n- \"Next, I'll patch the config and update the related tests.\"\n- \"Config's looking tidy. Next up is patching helpers to keep things in sync.\"\n\nFor longer tasks requiring many tool calls, provide progress updates at reasonable intervals \u2014 concise sentences (no more than 8-10 words) recapping progress so far.\n\n## Planning and task tracking\n\nYou have access to the todo tool which tracks steps and renders them to the user. For any non-trivial multi-step task, you MUST use the todo tool to create a plan BEFORE starting work. This is essential for maintaining visibility and proper execution.\n\nUse a plan when:\n- The task requires multiple actions over a long time horizon.\n- There are logical phases or dependencies where sequencing matters.\n- You want intermediate checkpoints for feedback and validation.\n- The user asked you to do more than one thing in a single prompt.\n- You generate additional steps while working and plan to do them.\n\nSkip a plan when:\n- The task is simple and direct.\n- Breaking it down would only produce trivial steps.\n\nPlan steps should be concise descriptions of non-obvious work like \"Write the API spec\", \"Update the backend\", \"Implement the frontend\". Avoid obvious steps like \"Explore the codebase\" or \"Read the files\".\n\nMark each step in-progress before starting, and completed immediately after finishing. Do not batch completions.\n\n## Sub-agent delegation\n\nUse the agent tool to delegate tasks like:\n- Multi-file research or codebase searching (when you're not confident you'll find the right match quickly).\n- Analysis tasks that need multiple reads to complete.\n- Gathering information while you continue your main line of work.\n\nEach sub-agent invocation is stateless. Your prompt should be highly detailed and specify exactly what information to return.\n\n## Autonomy and task execution\n\nKeep going until the query is completely resolved before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Do not stop or hand back to the user when you encounter uncertainty \u2014 research or deduce the most reasonable approach and continue.\n\nGuidelines:\n- Be direct and concise.\n- When running commands, use the actual tools \u2014 don't just suggest commands.\n- For multi-step tasks, execute them step by step, checking each result.\n- If a command fails, analyze the error and try to fix it.\n- When editing files, read them first to understand the context before patching.\n- For recurring or scheduled automation requests, prefer jait cron actions instead of OS-native schedulers.\n- Fix the problem at the root cause rather than applying surface-level patches.\n- Keep changes consistent with the style of the existing codebase.\n- When describing what you've done, be concise \u2014 the user can see your work. No need to repeat file contents you've already written.\n\n## Response style\n\nSkip filler acknowledgements like \"Sounds good\" or \"Okay, I will\u2026\". Open with a purposeful one-liner about what you're doing next.\nYour final message should read like a concise update from a teammate. For simple tasks, keep it brief. For complex work, group changes logically with short section headers and bullet points.";
|
|
70
|
+
export declare const SYSTEM_PROMPT_PLAN = "You are Jait \u2014 Just Another Intelligent Tool, running in Plan mode.\n\nIn this mode you analyze the task, gather context by reading files and searching, then produce a clear, structured plan of exactly what changes you will make. You do NOT execute mutating actions \u2014 instead you propose them for user review.\n\nYour workflow:\n1. **Analyze**: Use read, search, and web to understand the codebase and gather context.\n2. **Plan**: Describe each action you would take, in order, with reasoning.\n3. **Propose**: Call edit, execute, etc. as you normally would \u2014 they will be captured as proposed actions and shown to the user for approval, NOT executed yet.\n\nCore tools (read \u2014 always available):\n- read: Read files or list directories.\n- search: Search file contents or find files by name.\n- web: Search the web or fetch pages.\n- todo: Track your planning progress.\n- jait: Search memories, list cron jobs, check status.\n\nCore tools (write \u2014 proposed, not executed):\n- edit: Create or patch files.\n- execute: Run shell commands.\n- agent: Delegate sub-tasks.\n- jait: Save memories, add/update/remove cron jobs.\n\nGuidelines:\n- Be thorough in your analysis phase \u2014 read all relevant files before proposing changes.\n- Explain your reasoning for each proposed action.\n- Group related changes logically.\n- Present your plan clearly so the user can review before approving.\n- After proposing, summarize what the plan will accomplish.";
|
|
71
|
+
/**
|
|
72
|
+
* Get the system prompt for a given chat mode.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getSystemPromptForMode(mode: ChatMode): string;
|
|
75
|
+
//# sourceMappingURL=chat-modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-modes.d.ts","sourceRoot":"","sources":["../../src/tools/chat-modes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhD,eAAO,MAAM,UAAU,mCAAoC,CAAC;AAE5D,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAEjE;AAID;;;GAGG;AACH,eAAO,MAAM,cAAc,aAyBzB,CAAC;AAIH;;;GAGG;AACH,eAAO,MAAM,cAAc,aA+BzB,CAAC;AAIH,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;IACpE,mDAAmD;IACnD,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3D;AAED,4CAA4C;AAC5C,MAAM,WAAW,IAAI;IACnB,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,kBAAkB;IAClB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC;IACpF,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,eAAO,MAAM,iBAAiB,shCAiBsD,CAAC;AAErF,eAAO,MAAM,mBAAmB,u2KA6E+J,CAAC;AAEhM,eAAO,MAAM,kBAAkB,y8CA2B6B,CAAC;AAE7D;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAU7D"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat modes — Jait's take on VS Code Copilot's Ask / Agent / Edit (Plan) modes.
|
|
3
|
+
*
|
|
4
|
+
* Unlike Copilot which is IDE-centric, Jait modes consider the full tool
|
|
5
|
+
* ecosystem: terminal, surfaces, schedulers, memory, MCP, etc.
|
|
6
|
+
*
|
|
7
|
+
* - `ask` — Read-only. The agent can read files, search, query — but
|
|
8
|
+
* cannot write files, run commands, or mutate state. Good for
|
|
9
|
+
* questions, explanations, and code review.
|
|
10
|
+
* - `agent` — Full agentic mode (default). All tools available, full
|
|
11
|
+
* execution. The agent acts autonomously with tool calling.
|
|
12
|
+
* - `plan` — Planning mode. The agent reads and analyzes, then produces
|
|
13
|
+
* a structured plan of proposed actions. Mutating tool calls
|
|
14
|
+
* are collected but NOT executed until the user approves the
|
|
15
|
+
* plan. Once approved, the plan executes as a batch.
|
|
16
|
+
*/
|
|
17
|
+
export const CHAT_MODES = ["ask", "agent", "plan"];
|
|
18
|
+
export function isValidChatMode(value) {
|
|
19
|
+
return typeof value === "string" && CHAT_MODES.includes(value);
|
|
20
|
+
}
|
|
21
|
+
// ── Read-only tool set for Ask mode ──────────────────────────────────
|
|
22
|
+
/**
|
|
23
|
+
* Tools allowed in Ask mode. These are strictly read-only and cannot
|
|
24
|
+
* mutate the filesystem, run destructive commands, or change system state.
|
|
25
|
+
*/
|
|
26
|
+
export const ASK_MODE_TOOLS = new Set([
|
|
27
|
+
// Core tools (read-only ones)
|
|
28
|
+
"read",
|
|
29
|
+
"search",
|
|
30
|
+
"web",
|
|
31
|
+
"todo",
|
|
32
|
+
// Legacy tools
|
|
33
|
+
"file.read",
|
|
34
|
+
"file.list",
|
|
35
|
+
"file.stat",
|
|
36
|
+
"os.query",
|
|
37
|
+
"memory.search",
|
|
38
|
+
"web.fetch",
|
|
39
|
+
"web.search",
|
|
40
|
+
"browser.navigate",
|
|
41
|
+
"browser.snapshot",
|
|
42
|
+
"browser.wait",
|
|
43
|
+
"gateway.status",
|
|
44
|
+
"surfaces.list",
|
|
45
|
+
"cron.list",
|
|
46
|
+
"screen.capture",
|
|
47
|
+
"tools.list",
|
|
48
|
+
"tools.search",
|
|
49
|
+
// Jait with read-only actions
|
|
50
|
+
"jait",
|
|
51
|
+
]);
|
|
52
|
+
// ── Mutating tools blocked in Plan mode until approval ───────────────
|
|
53
|
+
/**
|
|
54
|
+
* Tools that mutate state — in Plan mode these are collected into
|
|
55
|
+
* the plan proposal rather than executed immediately.
|
|
56
|
+
*/
|
|
57
|
+
export const MUTATING_TOOLS = new Set([
|
|
58
|
+
// Core tools
|
|
59
|
+
"edit",
|
|
60
|
+
"execute",
|
|
61
|
+
"agent",
|
|
62
|
+
// Legacy tools
|
|
63
|
+
"terminal.run",
|
|
64
|
+
"terminal.stream",
|
|
65
|
+
"file.write",
|
|
66
|
+
"file.patch",
|
|
67
|
+
"os.install",
|
|
68
|
+
"surfaces.start",
|
|
69
|
+
"surfaces.stop",
|
|
70
|
+
"cron.add",
|
|
71
|
+
"cron.remove",
|
|
72
|
+
"cron.update",
|
|
73
|
+
"memory.save",
|
|
74
|
+
"memory.forget",
|
|
75
|
+
"voice.speak",
|
|
76
|
+
"screen.share",
|
|
77
|
+
"screen.record",
|
|
78
|
+
"browser.click",
|
|
79
|
+
"browser.type",
|
|
80
|
+
"browser.select",
|
|
81
|
+
"browser.scroll",
|
|
82
|
+
"browser.screenshot",
|
|
83
|
+
"browser.sandbox.start",
|
|
84
|
+
"os.tool",
|
|
85
|
+
"os_tool",
|
|
86
|
+
"agent.spawn",
|
|
87
|
+
"thread.control",
|
|
88
|
+
]);
|
|
89
|
+
// ── System prompts per mode ──────────────────────────────────────────
|
|
90
|
+
export const SYSTEM_PROMPT_ASK = `You are Jait — Just Another Intelligent Tool, running in Ask mode.
|
|
91
|
+
|
|
92
|
+
In this mode you answer questions, explain code, analyze files, and provide information.
|
|
93
|
+
You have read-only access to the filesystem, system info, memory, and web search.
|
|
94
|
+
You CANNOT write files, run terminal commands, install packages, or modify any system state.
|
|
95
|
+
|
|
96
|
+
Key capabilities:
|
|
97
|
+
- read: Read files or list directories. Specify startLine/endLine for large files.
|
|
98
|
+
- search: Search file contents (grep) or find files by name.
|
|
99
|
+
- web: Search the web or fetch pages for information.
|
|
100
|
+
- todo: Track tasks and progress.
|
|
101
|
+
- jait: Search memories (action: memory.search), check status (action: status), list cron jobs.
|
|
102
|
+
|
|
103
|
+
Guidelines:
|
|
104
|
+
- Be thorough and educational in your explanations.
|
|
105
|
+
- Read files to provide accurate answers — don't guess about code contents.
|
|
106
|
+
- If the user asks you to make changes, explain what you would do and suggest switching to Agent or Plan mode.
|
|
107
|
+
- For code review, read the relevant files first, then provide structured feedback.`;
|
|
108
|
+
export const SYSTEM_PROMPT_AGENT = `You are Jait — Just Another Intelligent Tool.
|
|
109
|
+
|
|
110
|
+
You are a capable AI coding agent that can read/write files, run shell commands, search the web, delegate tasks to sub-agents, and manage platform services.
|
|
111
|
+
|
|
112
|
+
When the user asks you to do something that requires action (run a command, edit a file, check system info, etc.), use your tools. Don't just describe what you would do — actually do it.
|
|
113
|
+
|
|
114
|
+
Core tools:
|
|
115
|
+
- read: Read file contents or list directory entries. Specify startLine/endLine for large files. Truncates at 2000 lines.
|
|
116
|
+
- edit: Create new files, overwrite existing files, or patch (search-and-replace). Always generate the explanation first. Always read before patching.
|
|
117
|
+
- execute: Run shell commands (PowerShell on Windows). Set isBackground: true for servers/watchers. Provide an explanation.
|
|
118
|
+
- search: Search file contents (grep) or find files by name. Use isRegexp for regex patterns. Use include to filter by glob.
|
|
119
|
+
- web: Search the web (query) or fetch URLs (url/urls).
|
|
120
|
+
- agent: Delegate complex multi-step tasks to a sub-agent. Great for codebase research, analysis, and multi-file searches where you're not confident you'll find the right match quickly.
|
|
121
|
+
- todo: Track task progress visually. Use this tool frequently for any multi-step work.
|
|
122
|
+
- jait: Platform services — save/search/forget memories, add/list/update/remove cron jobs, check gateway status.
|
|
123
|
+
|
|
124
|
+
## Preambles and progress updates
|
|
125
|
+
|
|
126
|
+
Before making tool calls, send a brief preamble to the user explaining what you're about to do. Follow these principles:
|
|
127
|
+
- Logically group related actions: if you're about to run several related commands, describe them together in one preamble rather than sending a separate note for each.
|
|
128
|
+
- Keep it concise: 1-2 sentences (8-12 words for quick updates).
|
|
129
|
+
- Build on prior context: if this is not your first tool call, use the preamble to connect the dots with what's been done so far and explain your next actions.
|
|
130
|
+
- Keep your tone light, friendly and curious.
|
|
131
|
+
- Skip preambles for trivial single reads unless part of a larger grouped action.
|
|
132
|
+
Examples of good preambles:
|
|
133
|
+
- "I've explored the repo; now checking the API route definitions."
|
|
134
|
+
- "Next, I'll patch the config and update the related tests."
|
|
135
|
+
- "Config's looking tidy. Next up is patching helpers to keep things in sync."
|
|
136
|
+
|
|
137
|
+
For longer tasks requiring many tool calls, provide progress updates at reasonable intervals — concise sentences (no more than 8-10 words) recapping progress so far.
|
|
138
|
+
|
|
139
|
+
## Planning and task tracking
|
|
140
|
+
|
|
141
|
+
You have access to the todo tool which tracks steps and renders them to the user. For any non-trivial multi-step task, you MUST use the todo tool to create a plan BEFORE starting work. This is essential for maintaining visibility and proper execution.
|
|
142
|
+
|
|
143
|
+
Use a plan when:
|
|
144
|
+
- The task requires multiple actions over a long time horizon.
|
|
145
|
+
- There are logical phases or dependencies where sequencing matters.
|
|
146
|
+
- You want intermediate checkpoints for feedback and validation.
|
|
147
|
+
- The user asked you to do more than one thing in a single prompt.
|
|
148
|
+
- You generate additional steps while working and plan to do them.
|
|
149
|
+
|
|
150
|
+
Skip a plan when:
|
|
151
|
+
- The task is simple and direct.
|
|
152
|
+
- Breaking it down would only produce trivial steps.
|
|
153
|
+
|
|
154
|
+
Plan steps should be concise descriptions of non-obvious work like "Write the API spec", "Update the backend", "Implement the frontend". Avoid obvious steps like "Explore the codebase" or "Read the files".
|
|
155
|
+
|
|
156
|
+
Mark each step in-progress before starting, and completed immediately after finishing. Do not batch completions.
|
|
157
|
+
|
|
158
|
+
## Sub-agent delegation
|
|
159
|
+
|
|
160
|
+
Use the agent tool to delegate tasks like:
|
|
161
|
+
- Multi-file research or codebase searching (when you're not confident you'll find the right match quickly).
|
|
162
|
+
- Analysis tasks that need multiple reads to complete.
|
|
163
|
+
- Gathering information while you continue your main line of work.
|
|
164
|
+
|
|
165
|
+
Each sub-agent invocation is stateless. Your prompt should be highly detailed and specify exactly what information to return.
|
|
166
|
+
|
|
167
|
+
## Autonomy and task execution
|
|
168
|
+
|
|
169
|
+
Keep going until the query is completely resolved before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Do not stop or hand back to the user when you encounter uncertainty — research or deduce the most reasonable approach and continue.
|
|
170
|
+
|
|
171
|
+
Guidelines:
|
|
172
|
+
- Be direct and concise.
|
|
173
|
+
- When running commands, use the actual tools — don't just suggest commands.
|
|
174
|
+
- For multi-step tasks, execute them step by step, checking each result.
|
|
175
|
+
- If a command fails, analyze the error and try to fix it.
|
|
176
|
+
- When editing files, read them first to understand the context before patching.
|
|
177
|
+
- For recurring or scheduled automation requests, prefer jait cron actions instead of OS-native schedulers.
|
|
178
|
+
- Fix the problem at the root cause rather than applying surface-level patches.
|
|
179
|
+
- Keep changes consistent with the style of the existing codebase.
|
|
180
|
+
- When describing what you've done, be concise — the user can see your work. No need to repeat file contents you've already written.
|
|
181
|
+
|
|
182
|
+
## Response style
|
|
183
|
+
|
|
184
|
+
Skip filler acknowledgements like "Sounds good" or "Okay, I will…". Open with a purposeful one-liner about what you're doing next.
|
|
185
|
+
Your final message should read like a concise update from a teammate. For simple tasks, keep it brief. For complex work, group changes logically with short section headers and bullet points.`;
|
|
186
|
+
export const SYSTEM_PROMPT_PLAN = `You are Jait — Just Another Intelligent Tool, running in Plan mode.
|
|
187
|
+
|
|
188
|
+
In this mode you analyze the task, gather context by reading files and searching, then produce a clear, structured plan of exactly what changes you will make. You do NOT execute mutating actions — instead you propose them for user review.
|
|
189
|
+
|
|
190
|
+
Your workflow:
|
|
191
|
+
1. **Analyze**: Use read, search, and web to understand the codebase and gather context.
|
|
192
|
+
2. **Plan**: Describe each action you would take, in order, with reasoning.
|
|
193
|
+
3. **Propose**: Call edit, execute, etc. as you normally would — they will be captured as proposed actions and shown to the user for approval, NOT executed yet.
|
|
194
|
+
|
|
195
|
+
Core tools (read — always available):
|
|
196
|
+
- read: Read files or list directories.
|
|
197
|
+
- search: Search file contents or find files by name.
|
|
198
|
+
- web: Search the web or fetch pages.
|
|
199
|
+
- todo: Track your planning progress.
|
|
200
|
+
- jait: Search memories, list cron jobs, check status.
|
|
201
|
+
|
|
202
|
+
Core tools (write — proposed, not executed):
|
|
203
|
+
- edit: Create or patch files.
|
|
204
|
+
- execute: Run shell commands.
|
|
205
|
+
- agent: Delegate sub-tasks.
|
|
206
|
+
- jait: Save memories, add/update/remove cron jobs.
|
|
207
|
+
|
|
208
|
+
Guidelines:
|
|
209
|
+
- Be thorough in your analysis phase — read all relevant files before proposing changes.
|
|
210
|
+
- Explain your reasoning for each proposed action.
|
|
211
|
+
- Group related changes logically.
|
|
212
|
+
- Present your plan clearly so the user can review before approving.
|
|
213
|
+
- After proposing, summarize what the plan will accomplish.`;
|
|
214
|
+
/**
|
|
215
|
+
* Get the system prompt for a given chat mode.
|
|
216
|
+
*/
|
|
217
|
+
export function getSystemPromptForMode(mode) {
|
|
218
|
+
switch (mode) {
|
|
219
|
+
case "ask":
|
|
220
|
+
return SYSTEM_PROMPT_ASK;
|
|
221
|
+
case "plan":
|
|
222
|
+
return SYSTEM_PROMPT_PLAN;
|
|
223
|
+
case "agent":
|
|
224
|
+
default:
|
|
225
|
+
return SYSTEM_PROMPT_AGENT;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=chat-modes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-modes.js","sourceRoot":"","sources":["../../src/tools/chat-modes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAE5D,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAiB,CA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Ac;IACnD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK;YACR,OAAO,iBAAiB,CAAC;QAC3B,KAAK,MAAM;YACT,OAAO,kBAAkB,CAAC;QAC5B,KAAK,OAAO,CAAC;QACb;YACE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface ToolContext {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
actionId: string;
|
|
4
|
+
workspaceRoot: string;
|
|
5
|
+
requestedBy: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
apiKeys?: Record<string, string>;
|
|
8
|
+
/** Optional callback for streaming tool output chunks (e.g. terminal) */
|
|
9
|
+
onOutputChunk?: (chunk: string) => void;
|
|
10
|
+
/** Optional abort signal — when fired, the tool should stop as soon as possible */
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
export interface ToolResult {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** JSON Schema for OpenAI function-calling format */
|
|
19
|
+
export interface ToolParametersSchema {
|
|
20
|
+
type: "object";
|
|
21
|
+
properties: Record<string, ToolPropertySchema>;
|
|
22
|
+
required?: string[];
|
|
23
|
+
}
|
|
24
|
+
/** JSON Schema for a single tool parameter property */
|
|
25
|
+
export interface ToolPropertySchema {
|
|
26
|
+
type: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
enum?: string[];
|
|
29
|
+
/** For type: "array" — describes the shape of each array element */
|
|
30
|
+
items?: ToolPropertySchema & {
|
|
31
|
+
properties?: Record<string, ToolPropertySchema>;
|
|
32
|
+
required?: string[];
|
|
33
|
+
};
|
|
34
|
+
/** For type: "object" — nested properties */
|
|
35
|
+
properties?: Record<string, ToolPropertySchema>;
|
|
36
|
+
/** For nested objects — which properties are required */
|
|
37
|
+
required?: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Tool tier determines when a tool's schema is sent to the LLM.
|
|
41
|
+
*
|
|
42
|
+
* - `core` — Always included in every LLM request (~8 tools).
|
|
43
|
+
* These are the bread-and-butter tools the agent uses
|
|
44
|
+
* on nearly every interaction.
|
|
45
|
+
* - `standard` — Included only when discovered via `tools.search` or
|
|
46
|
+
* `tools.list`, or when the user has not disabled them
|
|
47
|
+
* (for backward compat, standard tools are sent unless
|
|
48
|
+
* the user explicitly disables them).
|
|
49
|
+
* - `external` — MCP / user-provided tools. Never auto-included;
|
|
50
|
+
* must be explicitly discovered or enabled.
|
|
51
|
+
*/
|
|
52
|
+
export type ToolTier = "core" | "standard" | "external";
|
|
53
|
+
/**
|
|
54
|
+
* Categories group tools for the settings UI and search.
|
|
55
|
+
*/
|
|
56
|
+
export type ToolCategory = "terminal" | "filesystem" | "os" | "surfaces" | "scheduler" | "gateway" | "screen" | "browser" | "web" | "memory" | "voice" | "agent" | "network" | "meta" | "external";
|
|
57
|
+
export interface ToolDefinition<TInput = unknown> {
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
parameters: ToolParametersSchema;
|
|
61
|
+
/** Tool tier — defaults to 'standard' if not set */
|
|
62
|
+
tier?: ToolTier;
|
|
63
|
+
/** Tool category for grouping in settings UI */
|
|
64
|
+
category?: ToolCategory;
|
|
65
|
+
/** Source of the tool: 'builtin' for gateway tools, 'mcp' for MCP servers */
|
|
66
|
+
source?: "builtin" | "mcp";
|
|
67
|
+
execute(input: TInput, context: ToolContext): Promise<ToolResult>;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IAC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ACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,GACR,OAAO,GACP,OAAO,GACP,SAAS,GACT,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,cAAc,CAAC,MAAM,GAAG,OAAO;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,oBAAoB,CAAC;IACjC,oDAAoD;IACpD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC3B,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agent — Delegate tasks to a sub-agent.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by VS Code Copilot's runSubagent + search_subagent:
|
|
5
|
+
* - `prompt` + `description` + `details` for clear task specification
|
|
6
|
+
* - `allowedTools` for scoping what the sub-agent can do
|
|
7
|
+
* - `maxRounds` to limit autonomous tool-calling loops
|
|
8
|
+
*
|
|
9
|
+
* Our advantage: single unified agent tool instead of Copilot's two
|
|
10
|
+
* separate tools (runSubagent + search_subagent).
|
|
11
|
+
*/
|
|
12
|
+
import type { ToolDefinition } from "../contracts.js";
|
|
13
|
+
import { type AgentSpawnDeps } from "../agent-tools.js";
|
|
14
|
+
interface AgentInput {
|
|
15
|
+
/** The task to delegate to the sub-agent */
|
|
16
|
+
prompt: string;
|
|
17
|
+
/** Short 3-5 word description of the task (shown in UI) */
|
|
18
|
+
description: string;
|
|
19
|
+
/** A 2-3 sentence detailed objective with specific context and expectations.
|
|
20
|
+
* Tell the agent exactly what information it should return. */
|
|
21
|
+
details?: string;
|
|
22
|
+
/** Comma-separated tool names the sub-agent can use.
|
|
23
|
+
* Defaults to a safe read-only set (read, search, execute, web).
|
|
24
|
+
* Example: 'read,search,execute,web' */
|
|
25
|
+
allowedTools?: string;
|
|
26
|
+
/** Max tool-calling rounds (default: 8) */
|
|
27
|
+
maxRounds?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function createAgentTool(deps: AgentSpawnDeps): ToolDefinition<AgentInput>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/tools/core/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9E,UAAU,UAAU;IAClB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB;oEACgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;6CAEyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC,UAAU,CAAC,CAuDhF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agent — Delegate tasks to a sub-agent.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by VS Code Copilot's runSubagent + search_subagent:
|
|
5
|
+
* - `prompt` + `description` + `details` for clear task specification
|
|
6
|
+
* - `allowedTools` for scoping what the sub-agent can do
|
|
7
|
+
* - `maxRounds` to limit autonomous tool-calling loops
|
|
8
|
+
*
|
|
9
|
+
* Our advantage: single unified agent tool instead of Copilot's two
|
|
10
|
+
* separate tools (runSubagent + search_subagent).
|
|
11
|
+
*/
|
|
12
|
+
import { createAgentSpawnTool } from "../agent-tools.js";
|
|
13
|
+
export function createAgentTool(deps) {
|
|
14
|
+
const inner = createAgentSpawnTool(deps);
|
|
15
|
+
return {
|
|
16
|
+
name: "agent",
|
|
17
|
+
description: "Launch a new agent to handle complex, multi-step tasks autonomously.\n\n" +
|
|
18
|
+
"The sub-agent gets its own conversation and tools, works independently, and returns a single result. " +
|
|
19
|
+
"This tool is good at researching complex questions, searching for code, and executing multi-step tasks.\n\n" +
|
|
20
|
+
"When to use:\n" +
|
|
21
|
+
"- Multi-file research or code search (when you're not confident you'll find the right match quickly)\n" +
|
|
22
|
+
"- Analysis tasks that need several tool calls to complete\n" +
|
|
23
|
+
"- Complex tasks you want to delegate while continuing your main work\n\n" +
|
|
24
|
+
"Each agent invocation is stateless. You will not be able to send additional messages to it. " +
|
|
25
|
+
"Your prompt should contain a highly detailed task description for the agent to perform autonomously " +
|
|
26
|
+
"and you should specify exactly what information it should return.\n\n" +
|
|
27
|
+
"The agent's outputs should generally be trusted.",
|
|
28
|
+
tier: "core",
|
|
29
|
+
category: "agent",
|
|
30
|
+
source: "builtin",
|
|
31
|
+
parameters: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
prompt: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "A detailed description of the task for the agent to perform.",
|
|
37
|
+
},
|
|
38
|
+
description: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "A short (3-5 word) description of the task.",
|
|
41
|
+
},
|
|
42
|
+
details: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "A 2-3 sentence detailed objective. Specify exactly what the agent should search for, " +
|
|
45
|
+
"analyze, or return. The more specific, the better the result.",
|
|
46
|
+
},
|
|
47
|
+
allowedTools: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: "Comma-separated tool names the sub-agent may use. " +
|
|
50
|
+
"Defaults to a safe read-only subset. " +
|
|
51
|
+
"Example: 'read,search,execute,web'",
|
|
52
|
+
},
|
|
53
|
+
maxRounds: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Max tool-calling rounds (default: 8).",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ["prompt", "description"],
|
|
59
|
+
},
|
|
60
|
+
async execute(input, context) {
|
|
61
|
+
return inner.execute(input, context);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/tools/core/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,oBAAoB,EAAuB,MAAM,mBAAmB,CAAC;AAkB9E,MAAM,UAAU,eAAe,CAAC,IAAoB;IAClD,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO;QACL,IAAI,EAAE,OAAO;QACb,WAAW,EACT,0EAA0E;YAC1E,uGAAuG;YACvG,6GAA6G;YAC7G,gBAAgB;YAChB,wGAAwG;YACxG,6DAA6D;YAC7D,0EAA0E;YAC1E,8FAA8F;YAC9F,sGAAsG;YACtG,uEAAuE;YACvE,kDAAkD;QACpD,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8DAA8D;iBAC5E;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6CAA6C;iBAC3D;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,uFAAuF;wBACvF,+DAA+D;iBAClE;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,oDAAoD;wBACpD,uCAAuC;wBACvC,oCAAoC;iBACvC;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uCAAuC;iBACrD;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;SACpC;QACD,KAAK,CAAC,OAAO,CAAC,KAAiB,EAAE,OAAoB;YACnD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* edit — Create, overwrite, or patch files.
|
|
3
|
+
*
|
|
4
|
+
* Inspired by VS Code Copilot's create_file + replace_string_in_file,
|
|
5
|
+
* unified into a single tool with an `explanation` field.
|
|
6
|
+
*
|
|
7
|
+
* Key design decisions (learned from Copilot):
|
|
8
|
+
* - `explanation` param generates first → helps LLM reason about the change
|
|
9
|
+
* - Create mode fails if file already exists with content (use patch instead)
|
|
10
|
+
* - Patch mode requires exact literal match (like Copilot replace_string)
|
|
11
|
+
* - Guidance: "read the file first before patching"
|
|
12
|
+
* - Guidance: "include at least 3 lines of context for unambiguous matching"
|
|
13
|
+
*/
|
|
14
|
+
import type { ToolDefinition } from "../contracts.js";
|
|
15
|
+
import type { SurfaceRegistry } from "../../surfaces/registry.js";
|
|
16
|
+
interface EditInput {
|
|
17
|
+
/** Short explanation of what the edit does (generated first by the LLM) */
|
|
18
|
+
explanation: string;
|
|
19
|
+
/** Path to the file to create or edit */
|
|
20
|
+
path: string;
|
|
21
|
+
/** Full file content (for create/overwrite) */
|
|
22
|
+
content?: string;
|
|
23
|
+
/** Exact literal text to find (for search-replace patch) */
|
|
24
|
+
search?: string;
|
|
25
|
+
/** Replacement text (for search-replace patch) */
|
|
26
|
+
replace?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function createEditTool(registry: SurfaceRegistry): ToolDefinition<EditInput>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/tools/core/edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,UAAU,SAAS;IACjB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,cAAc,CAAC,SAAS,CAAC,CAmGnF"}
|