qlogicagent 2.10.22 → 2.10.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -4
- package/dist/agent.js +11 -11
- package/dist/cli.js +701 -604
- package/dist/index.js +700 -603
- package/dist/permissions.js +1 -0
- package/dist/protocol.js +1 -1
- package/dist/types/agent/tool-access.d.ts +1 -30
- package/dist/types/agent/tunable-defaults.d.ts +1 -249
- package/dist/types/agent/types.d.ts +7 -0
- package/dist/types/cli/acp-extended-handlers.d.ts +41 -0
- package/dist/types/cli/acp-extended-host-adapter.d.ts +28 -0
- package/dist/types/cli/acp-extended-host-adapter.test.d.ts +1 -0
- package/dist/types/cli/acp-session-handlers.d.ts +39 -0
- package/dist/types/cli/acp-session-handlers.test.d.ts +1 -0
- package/dist/types/cli/agent-config-coordinator.d.ts +13 -0
- package/dist/types/cli/agent-config-runtime.d.ts +11 -0
- package/dist/types/cli/agent-runner-factory.d.ts +2 -0
- package/dist/types/cli/agent-runtime-bootstrap.d.ts +64 -0
- package/dist/types/cli/agent-status-notifier.d.ts +11 -0
- package/dist/types/cli/agent-status-notifier.test.d.ts +1 -0
- package/dist/types/cli/base-tool-bootstrap.d.ts +7 -0
- package/dist/types/cli/cli-acp-request-handler.d.ts +9 -0
- package/dist/types/cli/cli-acp-request-handler.test.d.ts +1 -0
- package/dist/types/cli/cli-agent-builder.d.ts +35 -0
- package/dist/types/cli/community-skill-installer.d.ts +12 -0
- package/dist/types/cli/community-skill-installer.test.d.ts +1 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +30 -0
- package/dist/types/cli/core-tools/agent-tool-bootstrap.d.ts +10 -0
- package/dist/types/cli/core-tools/agent-tool-service.d.ts +18 -0
- package/dist/types/cli/core-tools/checkpoint-tool-bootstrap.d.ts +7 -0
- package/dist/types/cli/core-tools/checkpoint-tool-service.d.ts +7 -0
- package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +7 -0
- package/dist/types/cli/core-tools/config-tool-service.d.ts +7 -0
- package/dist/types/cli/core-tools/cron-tool-bootstrap.d.ts +7 -0
- package/dist/types/cli/core-tools/cron-tool-service.d.ts +22 -0
- package/dist/types/cli/core-tools/cron-tool-service.test.d.ts +1 -0
- package/dist/types/cli/core-tools/monitor-tool-bootstrap.d.ts +5 -0
- package/dist/types/cli/core-tools/monitor-tool-service.d.ts +6 -0
- package/dist/types/cli/core-tools/registry.d.ts +9 -0
- package/dist/types/cli/core-tools/team-tool-bootstrap.d.ts +7 -0
- package/dist/types/cli/core-tools/team-tool-service.d.ts +21 -0
- package/dist/types/cli/core-tools/utility-tool-bootstrap.d.ts +8 -0
- package/dist/types/cli/default-project-bootstrap.d.ts +8 -0
- package/dist/types/cli/dev-tool-bootstrap.d.ts +4 -0
- package/dist/types/cli/dev-tools/lsp-tool-service.d.ts +5 -0
- package/dist/types/cli/dev-tools/repl-lsp-tool-services.test.d.ts +1 -0
- package/dist/types/cli/dev-tools/repl-tool-service.d.ts +5 -0
- package/dist/types/cli/dream-host-adapter.d.ts +19 -0
- package/dist/types/cli/handlers/agents-handler.d.ts +28 -14
- package/dist/types/cli/handlers/community-handler.d.ts +25 -0
- package/dist/types/cli/handlers/community-handler.test.d.ts +1 -0
- package/dist/types/cli/handlers/config-handler.d.ts +15 -9
- package/dist/types/cli/handlers/config-handler.test.d.ts +1 -0
- package/dist/types/cli/handlers/control-handler.d.ts +23 -0
- package/dist/types/cli/handlers/dream-handler.d.ts +21 -1
- package/dist/types/cli/handlers/files-handler.d.ts +15 -9
- package/dist/types/cli/handlers/files-handler.instructions.test.d.ts +1 -0
- package/dist/types/cli/handlers/media-handler.d.ts +10 -4
- package/dist/types/cli/handlers/media-handler.test.d.ts +1 -0
- package/dist/types/cli/handlers/memory-handler.d.ts +39 -12
- package/dist/types/cli/handlers/pet-confirm-handler.d.ts +7 -0
- package/dist/types/cli/handlers/pet-handler.d.ts +29 -4
- package/dist/types/cli/handlers/pet-handler.test.d.ts +1 -0
- package/dist/types/cli/handlers/product-handler.d.ts +40 -14
- package/dist/types/cli/handlers/project-handler.d.ts +23 -14
- package/dist/types/cli/handlers/session-handler.d.ts +36 -17
- package/dist/types/cli/handlers/session-handler.resume.test.d.ts +1 -0
- package/dist/types/cli/handlers/settings-handler.d.ts +16 -12
- package/dist/types/cli/handlers/skills-handler.d.ts +19 -10
- package/dist/types/cli/handlers/skills-handler.profile.test.d.ts +1 -0
- package/dist/types/cli/handlers/solo-handler.d.ts +31 -9
- package/dist/types/cli/handlers/turn-handler.approval.test.d.ts +1 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +17 -11
- package/dist/types/cli/idle-dream-coordinator.d.ts +46 -0
- package/dist/types/cli/idle-dream-coordinator.test.d.ts +1 -0
- package/dist/types/cli/mcp-plugin-bootstrap.d.ts +27 -0
- package/dist/types/cli/mcp-plugin-bootstrap.test.d.ts +1 -0
- package/dist/types/cli/mcp-tool-proxy.d.ts +7 -0
- package/dist/types/cli/media-file-api-service.d.ts +73 -0
- package/dist/types/cli/media-file-api-service.test.d.ts +1 -0
- package/dist/types/cli/media-file-tool-service.d.ts +13 -0
- package/dist/types/cli/memory-coordinator.d.ts +36 -0
- package/dist/types/cli/model-client-resolver.d.ts +22 -0
- package/dist/types/cli/multi-agent-handler-host.d.ts +27 -0
- package/dist/types/cli/multi-agent-handler-host.test.d.ts +1 -0
- package/dist/types/cli/multi-agent-state-coordinator.d.ts +11 -0
- package/dist/types/cli/permission-bootstrap.d.ts +33 -0
- package/dist/types/cli/permission-bootstrap.test.d.ts +1 -0
- package/dist/types/cli/permission-settings-store.d.ts +2 -0
- package/dist/types/cli/permission-settings-store.test.d.ts +1 -0
- package/dist/types/cli/pet-confirm-coordinator.d.ts +20 -0
- package/dist/types/cli/pet-confirm-coordinator.test.d.ts +1 -0
- package/dist/types/cli/pet-runtime.d.ts +34 -0
- package/dist/types/cli/pet-runtime.test.d.ts +1 -0
- package/dist/types/cli/project-context.d.ts +1 -0
- package/dist/types/cli/project-memory-store-factory.d.ts +2 -0
- package/dist/types/cli/project-template-seeder.d.ts +5 -0
- package/dist/types/cli/provider-core-facade.d.ts +27 -0
- package/dist/types/cli/rpc-registry.community.test.d.ts +1 -0
- package/dist/types/cli/rpc-registry.d.ts +8 -0
- package/dist/types/cli/runtime-hook-bootstrap.d.ts +34 -0
- package/dist/types/cli/runtime-watcher-bootstrap.d.ts +15 -0
- package/dist/types/cli/session-coordinator.d.ts +10 -0
- package/dist/types/cli/session-coordinator.test.d.ts +1 -0
- package/dist/types/cli/session-history-coordinator.d.ts +11 -0
- package/dist/types/cli/session-history-coordinator.test.d.ts +1 -0
- package/dist/types/cli/skill-meta-tool-bootstrap.d.ts +25 -0
- package/dist/types/cli/skill-meta-tool-bootstrap.test.d.ts +1 -0
- package/dist/types/cli/stdio-server.d.ts +17 -134
- package/dist/types/cli/tool-bootstrap.d.ts +1 -4
- package/dist/types/cli/tool-bootstrap.instructions.test.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap.media-provider-alias.test.d.ts +1 -0
- package/dist/types/cli/tool-catalog.d.ts +2 -0
- package/dist/types/cli/tool-invoker-factory.d.ts +10 -0
- package/dist/types/cli/tool-result-processor.d.ts +14 -0
- package/dist/types/cli/transport.d.ts +2 -12
- package/dist/types/cli/turn-ask-user-setup.d.ts +9 -0
- package/dist/types/cli/turn-event-forwarder.d.ts +10 -0
- package/dist/types/cli/turn-lifecycle.d.ts +19 -0
- package/dist/types/cli/turn-lifecycle.test.d.ts +1 -0
- package/dist/types/cli/turn-media-setup.d.ts +16 -0
- package/dist/types/cli/turn-permission-sync.d.ts +7 -0
- package/dist/types/cli/turn-permission-sync.test.d.ts +1 -0
- package/dist/types/cli/turn-project-router.d.ts +22 -0
- package/dist/types/cli/turn-project-router.test.d.ts +1 -0
- package/dist/types/cli/turn-skill-autopersist.d.ts +47 -0
- package/dist/types/cli/turn-skill-autopersist.test.d.ts +1 -0
- package/dist/types/cli/turn-suggestion-generator.d.ts +15 -0
- package/dist/types/orchestration/agent-instance.d.ts +1 -1
- package/dist/types/orchestration/dag-scheduler.d.ts +135 -86
- package/dist/types/orchestration/index.d.ts +2 -2
- package/dist/types/orchestration/product-budget.d.ts +1 -1
- package/dist/types/orchestration/product-persistence.d.ts +3 -12
- package/dist/types/orchestration/product-planner.d.ts +1 -1
- package/dist/types/orchestration/skill-improvement.d.ts +1 -1
- package/dist/types/orchestration/solo-evaluator.d.ts +1 -1
- package/dist/types/orchestration/solo-persistence.d.ts +1 -1
- package/dist/types/orchestration/subagent/fork-subagent.d.ts +1 -1
- package/dist/types/orchestration/subagent/task-types.d.ts +1 -146
- package/dist/types/orchestration/tool-cascade.d.ts +2 -2
- package/dist/types/orchestration/workflow/budget-permission-gate.d.ts +85 -0
- package/dist/types/orchestration/workflow/builtin-executors.d.ts +12 -0
- package/dist/types/orchestration/workflow/cron-schedule.d.ts +37 -0
- package/dist/types/orchestration/workflow/data-item.d.ts +39 -0
- package/dist/types/orchestration/workflow/expression.d.ts +52 -0
- package/dist/types/orchestration/workflow/host-executors.d.ts +15 -0
- package/dist/types/orchestration/workflow/n8n-import.d.ts +35 -0
- package/dist/types/orchestration/workflow/node-registry.d.ts +19 -0
- package/dist/types/orchestration/workflow/node-schema.d.ts +119 -0
- package/dist/types/orchestration/workflow/run-checkpoint-store.d.ts +53 -0
- package/dist/types/orchestration/workflow/trigger-validation.d.ts +22 -0
- package/dist/types/orchestration/workflow/workflow-controller.d.ts +143 -0
- package/dist/types/orchestration/workflow/workflow-patch.d.ts +101 -0
- package/dist/types/orchestration/workflow/workflow-render.d.ts +41 -0
- package/dist/types/orchestration/workflow/workflow-runtime.d.ts +127 -0
- package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +83 -0
- package/dist/types/orchestration/workflow/workflow-store.d.ts +40 -0
- package/dist/types/orchestration/workflow/workflow-trigger.d.ts +14 -0
- package/dist/types/permissions.d.ts +2 -0
- package/dist/types/permissions.public-api.test.d.ts +1 -0
- package/dist/types/protocol/methods.d.ts +262 -11
- package/dist/types/{runtime/infra/acp-types.d.ts → protocol/wire/acp-agent-management.d.ts} +3 -3
- package/dist/types/protocol/wire/agent-methods.d.ts +15 -11
- package/dist/types/protocol/wire/agent-rpc.d.ts +11 -0
- package/dist/types/protocol/wire/chat-types.d.ts +9 -0
- package/dist/types/protocol/wire/gateway-rpc.d.ts +13 -0
- package/dist/types/protocol/wire/index.d.ts +2 -1
- package/dist/types/protocol/wire/notification-payloads.d.ts +18 -3
- package/dist/types/runtime/community/community-consent-client.d.ts +117 -0
- package/dist/types/runtime/community/community-consent-client.test.d.ts +1 -0
- package/dist/types/runtime/community/community-desensitization-red-team-cli.d.ts +7 -0
- package/dist/types/runtime/community/community-desensitization-red-team-cli.test.d.ts +1 -0
- package/dist/types/runtime/community/community-desensitization.d.ts +29 -0
- package/dist/types/runtime/community/community-desensitization.test.d.ts +1 -0
- package/dist/types/runtime/community/community-telemetry-recorder.d.ts +6 -0
- package/dist/types/runtime/config/tunable-defaults.d.ts +249 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +4 -2
- package/dist/types/runtime/execution/dream-category-context.d.ts +1 -1
- package/dist/types/runtime/execution/forked-agent.d.ts +3 -1
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +4 -2
- package/dist/types/runtime/execution/tool-eligibility.d.ts +1 -1
- package/dist/types/runtime/hooks/context-compression.d.ts +2 -2
- package/dist/types/runtime/hooks/memory-hooks.d.ts +6 -6
- package/dist/types/runtime/infra/acp-detector.d.ts +2 -2
- package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +1 -1
- package/dist/types/runtime/infra/acp-usage-tracker.d.ts +1 -1
- package/dist/types/runtime/infra/agent-config-store.d.ts +2 -2
- package/dist/types/runtime/infra/agent-paths.d.ts +14 -10
- package/dist/types/runtime/infra/agent-paths.test.d.ts +1 -0
- package/dist/types/runtime/infra/agent-process.d.ts +2 -2
- package/dist/types/runtime/infra/checkpoint-backend.d.ts +2 -2
- package/dist/types/runtime/infra/index.d.ts +1 -1
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +10 -0
- package/dist/types/runtime/infra/mcp-bridge.d.ts +1 -1
- package/dist/types/runtime/infra/model-registry.d.ts +2 -1
- package/dist/types/runtime/infra/profile-storage.test.d.ts +1 -0
- package/dist/types/runtime/infra/skill-injector.d.ts +3 -2
- package/dist/types/runtime/infra/skill-injector.test.d.ts +1 -0
- package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
- package/dist/types/runtime/infra/worktree-backend.d.ts +2 -2
- package/dist/types/runtime/memory/categories.d.ts +5 -0
- package/dist/types/runtime/memory/find-relevant-memories.d.ts +70 -0
- package/dist/types/runtime/memory/implicit-extraction.d.ts +58 -0
- package/dist/types/runtime/memory/recall-category-filter.d.ts +54 -0
- package/dist/types/runtime/pet/index.d.ts +1 -1
- package/dist/types/runtime/pet/pet-growth-engine.d.ts +10 -9
- package/dist/types/runtime/pet/pet-growth-engine.test.d.ts +1 -0
- package/dist/types/runtime/pet/pet-soul-service.d.ts +1 -2
- package/dist/types/runtime/pet/pet-soul-service.test.d.ts +1 -0
- package/dist/types/runtime/ports/agent-execution-contracts.d.ts +182 -0
- package/dist/types/runtime/ports/checkpoint-contracts.d.ts +19 -0
- package/dist/types/runtime/ports/index.d.ts +13 -0
- package/dist/types/runtime/ports/memory-provider.d.ts +146 -0
- package/dist/types/runtime/ports/memory-recall-source.d.ts +3 -0
- package/dist/types/runtime/ports/memory-writer.d.ts +21 -0
- package/dist/types/runtime/ports/path-service.d.ts +5 -0
- package/dist/types/runtime/ports/permission-contracts.d.ts +107 -0
- package/dist/types/runtime/ports/project-memory-store.d.ts +44 -0
- package/dist/types/runtime/ports/tool-call-contracts.d.ts +16 -0
- package/dist/types/runtime/ports/tool-contracts.d.ts +23 -0
- package/dist/types/runtime/ports/web-search-contracts.d.ts +17 -0
- package/dist/types/runtime/ports/worktree-contracts.d.ts +22 -0
- package/dist/types/runtime/prompt/environment-context.test.d.ts +1 -0
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +19 -0
- package/dist/types/runtime/prompt/fresh-workspace-evidence.test.d.ts +1 -0
- package/dist/types/runtime/prompt/instruction-loader.d.ts +9 -3
- package/dist/types/runtime/prompt/instruction-loader.test.d.ts +1 -0
- package/dist/types/runtime/session/session-persistence.test.d.ts +1 -0
- package/dist/types/runtime/tasks/task-types.d.ts +146 -0
- package/dist/types/skills/index.d.ts +2 -2
- package/dist/types/skills/mcp/mcp-http-client.d.ts +2 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +7 -4
- package/dist/types/skills/mcp/mcp-stdio-client.d.ts +2 -0
- package/dist/types/skills/mcp/mcp-tool-metadata.d.ts +18 -0
- package/dist/types/skills/memory/categories.d.ts +1 -5
- package/dist/types/skills/memory/find-relevant-memories.d.ts +1 -70
- package/dist/types/skills/memory/implicit-extraction.d.ts +1 -58
- package/dist/types/skills/memory/local-memory-provider.d.ts +4 -10
- package/dist/types/skills/memory/local-store.d.ts +4 -4
- package/dist/types/skills/memory/memory-consolidation.d.ts +9 -1
- package/dist/types/skills/memory/memory-provider-factory.d.ts +2 -0
- package/dist/types/skills/memory/memory-tool.d.ts +4 -6
- package/dist/types/skills/memory/recall-category-filter.d.ts +1 -54
- package/dist/types/skills/permissions/community-sandbox-policy.d.ts +3 -0
- package/dist/types/skills/permissions/community-sandbox-red-team-cli.d.ts +7 -0
- package/dist/types/skills/permissions/community-sandbox-red-team.d.ts +30 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +15 -2
- package/dist/types/skills/permissions/settings-watcher.d.ts +2 -0
- package/dist/types/skills/permissions/types.d.ts +2 -113
- package/dist/types/skills/portable-tool.d.ts +22 -0
- package/dist/types/skills/skill-system/skill-lifecycle.d.ts +5 -0
- package/dist/types/skills/skill-system/skill-source.d.ts +2 -148
- package/dist/types/skills/tool-access.d.ts +30 -0
- package/dist/types/skills/tools/skill-tool.d.ts +2 -10
- package/dist/types/skills/tools/web-search-tool.d.ts +3 -20
- package/dist/types/skills/tools.d.ts +1 -1
- package/dist/types/transport/acp-server.d.ts +1 -1
- package/dist/types/transport/index.d.ts +1 -0
- package/dist/types/transport/io-transport.d.ts +19 -0
- package/package.json +93 -80
- package/dist/types/llm/index.d.ts +0 -1
- /package/dist/types/{orchestration/context/context-compression.d.ts → runtime/context/context-compression-strategies.d.ts} +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
2
|
+
import type { ChatMessage as WireChatMessage, ToolDefinition as WireToolDefinition, WireTokenUsage } from "../../protocol/wire/index.js";
|
|
3
|
+
export type ChatMessage = WireChatMessage;
|
|
4
|
+
export type TokenUsage = WireTokenUsage;
|
|
5
|
+
export interface ToolDefinition extends WireToolDefinition {
|
|
6
|
+
backfillObservableInput?: (input: Record<string, unknown>) => void;
|
|
7
|
+
}
|
|
8
|
+
export type TurnEvent = {
|
|
9
|
+
type: "start";
|
|
10
|
+
turnId: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: "delta";
|
|
13
|
+
turnId: string;
|
|
14
|
+
text: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: "tool_call";
|
|
17
|
+
turnId: string;
|
|
18
|
+
callId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
arguments: string;
|
|
21
|
+
inputSummary?: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "end";
|
|
24
|
+
turnId: string;
|
|
25
|
+
content: string;
|
|
26
|
+
usage?: TokenUsage;
|
|
27
|
+
model?: string;
|
|
28
|
+
provider?: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: "error";
|
|
31
|
+
turnId: string;
|
|
32
|
+
error: string;
|
|
33
|
+
code?: string;
|
|
34
|
+
usage?: TokenUsage;
|
|
35
|
+
} | {
|
|
36
|
+
type: "skill_instruction";
|
|
37
|
+
turnId: string;
|
|
38
|
+
instruction: unknown;
|
|
39
|
+
} | {
|
|
40
|
+
type: "tool_result";
|
|
41
|
+
turnId: string;
|
|
42
|
+
callId: string;
|
|
43
|
+
name: string;
|
|
44
|
+
ok: boolean;
|
|
45
|
+
error?: string;
|
|
46
|
+
outputPreview?: string;
|
|
47
|
+
durationMs?: number;
|
|
48
|
+
exitCode?: number;
|
|
49
|
+
stdout?: string;
|
|
50
|
+
stderr?: string;
|
|
51
|
+
details?: Record<string, unknown>;
|
|
52
|
+
} | {
|
|
53
|
+
type: "tool_blocked";
|
|
54
|
+
turnId: string;
|
|
55
|
+
callId: string;
|
|
56
|
+
name: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
} | {
|
|
59
|
+
type: "recovery";
|
|
60
|
+
turnId: string;
|
|
61
|
+
action: string;
|
|
62
|
+
detail?: string;
|
|
63
|
+
} | {
|
|
64
|
+
type: "plan_update";
|
|
65
|
+
turnId: string;
|
|
66
|
+
slug: string;
|
|
67
|
+
content: string;
|
|
68
|
+
} | {
|
|
69
|
+
type: "heartbeat";
|
|
70
|
+
turnId: string;
|
|
71
|
+
message: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: "tool_use_summary";
|
|
74
|
+
turnId: string;
|
|
75
|
+
summary: string;
|
|
76
|
+
} | {
|
|
77
|
+
type: "reasoning_delta";
|
|
78
|
+
turnId: string;
|
|
79
|
+
text: string;
|
|
80
|
+
} | {
|
|
81
|
+
type: "suggestions";
|
|
82
|
+
turnId: string;
|
|
83
|
+
items: Array<{
|
|
84
|
+
text: string;
|
|
85
|
+
icon?: string;
|
|
86
|
+
action?: string;
|
|
87
|
+
}>;
|
|
88
|
+
} | {
|
|
89
|
+
type: "media_result";
|
|
90
|
+
turnId: string;
|
|
91
|
+
mediaType: "image" | "tts" | "video" | "music";
|
|
92
|
+
url: string;
|
|
93
|
+
model?: string;
|
|
94
|
+
provider?: string;
|
|
95
|
+
durationSeconds?: number;
|
|
96
|
+
width?: number;
|
|
97
|
+
height?: number;
|
|
98
|
+
mimeType?: string;
|
|
99
|
+
billingUnit?: string;
|
|
100
|
+
billingQuantity?: number;
|
|
101
|
+
taskId?: string;
|
|
102
|
+
} | {
|
|
103
|
+
type: "artifact";
|
|
104
|
+
turnId: string;
|
|
105
|
+
artifactId: string;
|
|
106
|
+
artifactType: "code" | "file" | "image" | "document" | "diagram" | "table";
|
|
107
|
+
title: string;
|
|
108
|
+
filePath?: string;
|
|
109
|
+
language?: string;
|
|
110
|
+
content?: string;
|
|
111
|
+
mimeType?: string;
|
|
112
|
+
} | {
|
|
113
|
+
type: "annotations";
|
|
114
|
+
turnId: string;
|
|
115
|
+
annotations: Array<{
|
|
116
|
+
type: string;
|
|
117
|
+
url?: string;
|
|
118
|
+
title?: string;
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
}>;
|
|
121
|
+
} | {
|
|
122
|
+
type: "subagent_started";
|
|
123
|
+
turnId: string;
|
|
124
|
+
subagentId: string;
|
|
125
|
+
agentType: string;
|
|
126
|
+
prompt?: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "subagent_ended";
|
|
129
|
+
turnId: string;
|
|
130
|
+
subagentId: string;
|
|
131
|
+
agentType: string;
|
|
132
|
+
ok: boolean;
|
|
133
|
+
outputPreview?: string;
|
|
134
|
+
error?: string;
|
|
135
|
+
};
|
|
136
|
+
export interface ToolInvoker {
|
|
137
|
+
invoke(turnId: string, name: string, args: string, signal?: AbortSignal): Promise<{
|
|
138
|
+
result: string;
|
|
139
|
+
error?: string;
|
|
140
|
+
toolReferences?: string[];
|
|
141
|
+
imageUrls?: string[];
|
|
142
|
+
details?: Record<string, unknown>;
|
|
143
|
+
}>;
|
|
144
|
+
}
|
|
145
|
+
export interface AgentRunRequest {
|
|
146
|
+
turnId: string;
|
|
147
|
+
sessionId: string;
|
|
148
|
+
messages: ChatMessage[];
|
|
149
|
+
tools: ToolDefinition[];
|
|
150
|
+
systemPrompt?: string;
|
|
151
|
+
config?: {
|
|
152
|
+
model?: string;
|
|
153
|
+
apiKey?: string;
|
|
154
|
+
temperature?: number;
|
|
155
|
+
maxOutputTokens?: number;
|
|
156
|
+
parentDepth?: number;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export interface ForkedAgentRunner {
|
|
160
|
+
run(request: AgentRunRequest, signal?: AbortSignal): AsyncIterable<TurnEvent>;
|
|
161
|
+
}
|
|
162
|
+
export interface ForkedAgentRunnerFactory {
|
|
163
|
+
(params: {
|
|
164
|
+
transport: unknown;
|
|
165
|
+
apiKey: string;
|
|
166
|
+
toolInvoker: ToolInvoker;
|
|
167
|
+
log: AgentLogger;
|
|
168
|
+
hooks?: HookRegistry;
|
|
169
|
+
maxRounds?: number;
|
|
170
|
+
}): ForkedAgentRunner;
|
|
171
|
+
}
|
|
172
|
+
export interface AgentLogger {
|
|
173
|
+
info(message: string): void;
|
|
174
|
+
info(obj: Record<string, unknown>, message: string): void;
|
|
175
|
+
warn(message: string): void;
|
|
176
|
+
warn(obj: Record<string, unknown>, message: string): void;
|
|
177
|
+
error(message: string): void;
|
|
178
|
+
error(obj: Record<string, unknown>, message: string): void;
|
|
179
|
+
debug(message: string): void;
|
|
180
|
+
debug(obj: Record<string, unknown>, message: string): void;
|
|
181
|
+
}
|
|
182
|
+
export type { HookRegistry };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Checkpoint {
|
|
2
|
+
id: string;
|
|
3
|
+
message: string;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
fileCount: number;
|
|
6
|
+
}
|
|
7
|
+
export interface CheckpointResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
checkpoint?: Checkpoint;
|
|
10
|
+
checkpoints?: Checkpoint[];
|
|
11
|
+
diff?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CheckpointBackend {
|
|
15
|
+
createCheckpoint(message?: string): Promise<CheckpointResult>;
|
|
16
|
+
listCheckpoints(): Promise<CheckpointResult>;
|
|
17
|
+
restoreCheckpoint(checkpointId: string, paths?: string[]): Promise<CheckpointResult>;
|
|
18
|
+
diffCheckpoint(checkpointId: string): Promise<CheckpointResult>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { MemoryWriter, MemoryWriteMetadata } from "./memory-writer.js";
|
|
2
|
+
export type { MemoryRecallSource } from "./memory-recall-source.js";
|
|
3
|
+
export type { MemoryProvider, MemorySearchOptions, MemorySearchResult, MemoryIngestMessage, MemoryIngestOptions, MemoryExtractionItem, MemoryConsolidationWriteResult, MemoryLearningSink, MemoryToolLocalProvider, MemoryActivitySummary, MemoryAtlasRecord, MemoryAtlasResult, MemoryUpdatePatch, MemoryHandlerProvider, MemoryDreamProvider, MemoryDecayProvider, MemoryRuntimeHookProvider, MemoryToolProvider, MemoryDreamRuntimeProvider, } from "./memory-provider.js";
|
|
4
|
+
export type { PathService } from "./path-service.js";
|
|
5
|
+
export { PERMISSION_MODES, } from "./permission-contracts.js";
|
|
6
|
+
export type { ApprovalRequest, ApprovalResponse, PermissionApprovalResolver, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionMetadataResolver, PermissionMode, PermissionResult, PermissionRuleEnginePort, PermissionRuleEntry, PermissionUpdate, ToolPermissionCheckInput, } from "./permission-contracts.js";
|
|
7
|
+
export type { ProjectMemoryFileInfo, ProjectMemoryResult, ProjectMemoryStore, ProjectMemoryStoreFactory, } from "./project-memory-store.js";
|
|
8
|
+
export type { ToolBootstrap, ToolCatalog } from "./tool-contracts.js";
|
|
9
|
+
export type { Checkpoint, CheckpointBackend, CheckpointResult } from "./checkpoint-contracts.js";
|
|
10
|
+
export type { WorktreeBackend, WorktreeInfo, WorktreeResult } from "./worktree-contracts.js";
|
|
11
|
+
export type { WebSearchBackend, WebSearchOutput, WebSearchResult } from "./web-search-contracts.js";
|
|
12
|
+
export { buildToolResultMessage, type OpenAiToolCall, type ToolResultMessageInput } from "./tool-call-contracts.js";
|
|
13
|
+
export type { AgentLogger, AgentRunRequest, ChatMessage, ForkedAgentRunner, ForkedAgentRunnerFactory, HookRegistry, TokenUsage, ToolDefinition, ToolInvoker, TurnEvent, } from "./agent-execution-contracts.js";
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { MemoryWriter } from "./memory-writer.js";
|
|
2
|
+
export interface MemorySearchOptions {
|
|
3
|
+
limit?: number;
|
|
4
|
+
minScore?: number;
|
|
5
|
+
preferredCategories?: string[];
|
|
6
|
+
llmConfig?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface MemorySearchResult {
|
|
9
|
+
blockId: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
text: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
score: number;
|
|
15
|
+
source?: string;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface MemoryIngestMessage {
|
|
19
|
+
role: string;
|
|
20
|
+
content: string;
|
|
21
|
+
timestamp?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MemoryIngestOptions {
|
|
24
|
+
llmConfig?: unknown;
|
|
25
|
+
source?: string;
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface MemoryExtractionItem {
|
|
29
|
+
text: string;
|
|
30
|
+
category?: string;
|
|
31
|
+
importance?: number;
|
|
32
|
+
confidence?: number;
|
|
33
|
+
source?: string;
|
|
34
|
+
event_date?: string;
|
|
35
|
+
tags?: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface MemoryConsolidationWriteResult {
|
|
38
|
+
memoriesAdded?: number;
|
|
39
|
+
observationsAdded?: number;
|
|
40
|
+
proposalsAdded?: number;
|
|
41
|
+
claimsAdded?: number;
|
|
42
|
+
conflictsAdded?: number;
|
|
43
|
+
claimIds?: string[];
|
|
44
|
+
conflictIds?: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface MemoryProvider {
|
|
47
|
+
readonly providerId: string;
|
|
48
|
+
search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
|
|
49
|
+
ingest?(messages: MemoryIngestMessage[], userId: string, options?: MemoryIngestOptions): Promise<void>;
|
|
50
|
+
addText?(text: string, userId: string, options?: MemoryIngestOptions): Promise<{
|
|
51
|
+
memoriesAdded: number;
|
|
52
|
+
}>;
|
|
53
|
+
remove?(memoryId: string): Promise<boolean>;
|
|
54
|
+
}
|
|
55
|
+
export interface MemoryLearningSink {
|
|
56
|
+
ingestExtracted(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
57
|
+
}
|
|
58
|
+
export interface MemoryToolLocalProvider {
|
|
59
|
+
addText(text: string, userId: string, metadata?: MemoryIngestOptions & {
|
|
60
|
+
category?: string;
|
|
61
|
+
importance?: number;
|
|
62
|
+
}): Promise<unknown>;
|
|
63
|
+
synthesizeTimeline(userId: string, startMs: number, endMs: number): string;
|
|
64
|
+
feedback(ids: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
|
|
65
|
+
affected: number;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export interface MemoryActivitySummary {
|
|
69
|
+
dailyCounts: Array<{
|
|
70
|
+
date: string;
|
|
71
|
+
count: number;
|
|
72
|
+
}>;
|
|
73
|
+
highlights: Array<{
|
|
74
|
+
text: string;
|
|
75
|
+
category: string;
|
|
76
|
+
importance: number;
|
|
77
|
+
date: string;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
export interface MemoryAtlasRecord {
|
|
81
|
+
id: string;
|
|
82
|
+
text: string;
|
|
83
|
+
category?: string;
|
|
84
|
+
importance?: number;
|
|
85
|
+
confidence?: number;
|
|
86
|
+
source?: string;
|
|
87
|
+
sessionId?: string;
|
|
88
|
+
eventDate?: string;
|
|
89
|
+
tags?: string[];
|
|
90
|
+
createdAt?: string | number;
|
|
91
|
+
updatedAt?: string | number;
|
|
92
|
+
accessCount?: number;
|
|
93
|
+
lastAccessedAt?: string | number;
|
|
94
|
+
isArchived?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface MemoryAtlasResult {
|
|
97
|
+
totalCount?: number;
|
|
98
|
+
records?: MemoryAtlasRecord[];
|
|
99
|
+
buckets?: unknown[];
|
|
100
|
+
clusters?: unknown[];
|
|
101
|
+
windowCursor?: unknown;
|
|
102
|
+
timeRange?: unknown;
|
|
103
|
+
}
|
|
104
|
+
export interface MemoryUpdatePatch {
|
|
105
|
+
text?: string;
|
|
106
|
+
category?: string;
|
|
107
|
+
importance?: number;
|
|
108
|
+
source?: string;
|
|
109
|
+
eventDate?: string;
|
|
110
|
+
tags?: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface MemoryHandlerProvider extends MemoryProvider {
|
|
113
|
+
getAtlas?(userId: string, options?: Record<string, unknown>): MemoryAtlasResult;
|
|
114
|
+
getActivitySummary?(userId: string, days: number): MemoryActivitySummary;
|
|
115
|
+
observeExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
116
|
+
proposeExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
117
|
+
ingestExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
118
|
+
update?(id: string, patch: MemoryUpdatePatch): Promise<boolean>;
|
|
119
|
+
}
|
|
120
|
+
export interface MemoryDreamProvider {
|
|
121
|
+
search(query: string, userId: string, options?: {
|
|
122
|
+
limit?: number;
|
|
123
|
+
}): Promise<MemorySearchResult[]>;
|
|
124
|
+
proposeExtracted?(items: MemoryExtractionItem[], userId: string, options?: {
|
|
125
|
+
sessionId?: string;
|
|
126
|
+
source?: string;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
proposalsAdded?: number;
|
|
129
|
+
}>;
|
|
130
|
+
feedback?(memoryIds: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
|
|
131
|
+
affected: number;
|
|
132
|
+
}>;
|
|
133
|
+
getActivitySummary?(userId: string, days?: number): MemoryActivitySummary;
|
|
134
|
+
synthesizeTimeline?(userId: string, startMs: number, endMs: number): string;
|
|
135
|
+
getProfile?(userId: string, key: string): string | null;
|
|
136
|
+
setProfile?(userId: string, key: string, value: string): void;
|
|
137
|
+
getAllProfiles?(userId: string): Record<string, string>;
|
|
138
|
+
}
|
|
139
|
+
export interface MemoryDecayProvider {
|
|
140
|
+
triggerDecay(userId: string, maxAgeDays?: number): Promise<{
|
|
141
|
+
decayed: number;
|
|
142
|
+
}>;
|
|
143
|
+
}
|
|
144
|
+
export type MemoryRuntimeHookProvider = MemoryProvider & MemoryWriter;
|
|
145
|
+
export type MemoryToolProvider = MemoryProvider & MemoryToolLocalProvider;
|
|
146
|
+
export type MemoryDreamRuntimeProvider = MemoryDreamProvider & MemoryDecayProvider;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface MemoryWriteMetadata {
|
|
2
|
+
source?: string;
|
|
3
|
+
category?: string;
|
|
4
|
+
importance?: number;
|
|
5
|
+
eventDate?: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface MemoryWriter {
|
|
9
|
+
addText(text: string, userId: string, metadata?: MemoryWriteMetadata): Promise<unknown>;
|
|
10
|
+
proposeExtracted?(items: Array<{
|
|
11
|
+
text: string;
|
|
12
|
+
category?: string;
|
|
13
|
+
importance?: number;
|
|
14
|
+
}>, userId: string, metadata?: MemoryWriteMetadata): Promise<{
|
|
15
|
+
proposalsAdded?: number;
|
|
16
|
+
}>;
|
|
17
|
+
findRelatedEvents?(text: string, userId: string): Promise<Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
}>>;
|
|
20
|
+
feedback?(ids: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<unknown>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export type PermissionMode = "default" | "bypassPermissions" | "acceptEdits" | "dontAsk" | "plan" | "auto";
|
|
2
|
+
export declare const PERMISSION_MODES: readonly PermissionMode[];
|
|
3
|
+
export type PermissionBehavior = "allow" | "deny" | "ask";
|
|
4
|
+
export interface PermissionRuleEntry {
|
|
5
|
+
pattern: string;
|
|
6
|
+
behavior: PermissionBehavior;
|
|
7
|
+
reason?: string;
|
|
8
|
+
source?: string;
|
|
9
|
+
}
|
|
10
|
+
export type PermissionDecisionReason = {
|
|
11
|
+
type: "rule";
|
|
12
|
+
rule: PermissionRuleEntry;
|
|
13
|
+
} | {
|
|
14
|
+
type: "mode";
|
|
15
|
+
mode: PermissionMode;
|
|
16
|
+
} | {
|
|
17
|
+
type: "hook";
|
|
18
|
+
hookName: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: "classifier";
|
|
22
|
+
classifier: string;
|
|
23
|
+
reason: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: "tool_check";
|
|
26
|
+
reason: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: "eligibility";
|
|
29
|
+
reasonCodes: string[];
|
|
30
|
+
} | {
|
|
31
|
+
type: "sandbox";
|
|
32
|
+
reason: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: "other";
|
|
35
|
+
reason: string;
|
|
36
|
+
};
|
|
37
|
+
export interface PermissionAllowResult {
|
|
38
|
+
behavior: "allow";
|
|
39
|
+
updatedInput?: Record<string, unknown>;
|
|
40
|
+
decisionReason?: PermissionDecisionReason;
|
|
41
|
+
}
|
|
42
|
+
export interface PermissionAskResult {
|
|
43
|
+
behavior: "ask";
|
|
44
|
+
message: string;
|
|
45
|
+
toolName: string;
|
|
46
|
+
input?: Record<string, unknown>;
|
|
47
|
+
suggestions?: PermissionUpdate[];
|
|
48
|
+
decisionReason?: PermissionDecisionReason;
|
|
49
|
+
}
|
|
50
|
+
export interface PermissionDenyResult {
|
|
51
|
+
behavior: "deny";
|
|
52
|
+
message: string;
|
|
53
|
+
decisionReason: PermissionDecisionReason;
|
|
54
|
+
}
|
|
55
|
+
export type PermissionResult = PermissionAllowResult | PermissionAskResult | PermissionDenyResult;
|
|
56
|
+
export interface PermissionUpdate {
|
|
57
|
+
pattern: string;
|
|
58
|
+
behavior: PermissionBehavior;
|
|
59
|
+
scope?: "session" | "persistent";
|
|
60
|
+
description?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface PermissionConfig {
|
|
63
|
+
mode: PermissionMode;
|
|
64
|
+
rules: PermissionRuleEntry[];
|
|
65
|
+
defaultBehavior: PermissionBehavior;
|
|
66
|
+
}
|
|
67
|
+
export interface ToolPermissionCheckInput {
|
|
68
|
+
toolName: string;
|
|
69
|
+
arguments?: Record<string, unknown>;
|
|
70
|
+
meta?: {
|
|
71
|
+
isReadOnly?: boolean;
|
|
72
|
+
isDangerous?: boolean;
|
|
73
|
+
requiresApproval?: boolean;
|
|
74
|
+
parallelSafe?: boolean;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface ApprovalRequest {
|
|
78
|
+
approvalId: string;
|
|
79
|
+
callId: string;
|
|
80
|
+
toolName: string;
|
|
81
|
+
arguments?: Record<string, unknown>;
|
|
82
|
+
message: string;
|
|
83
|
+
suggestions?: PermissionUpdate[];
|
|
84
|
+
}
|
|
85
|
+
export interface ApprovalResponse {
|
|
86
|
+
approvalId: string;
|
|
87
|
+
decision: "approved" | "denied";
|
|
88
|
+
updatedInput?: Record<string, unknown>;
|
|
89
|
+
permissionUpdate?: PermissionUpdate;
|
|
90
|
+
}
|
|
91
|
+
export interface PermissionRuleEnginePort {
|
|
92
|
+
setMode(mode: PermissionMode): void;
|
|
93
|
+
replaceRules(rules: PermissionRuleEntry[]): void;
|
|
94
|
+
setDefaultBehavior(behavior: PermissionBehavior): void;
|
|
95
|
+
}
|
|
96
|
+
export interface PermissionApprovalResolver {
|
|
97
|
+
resolveApproval(response: ApprovalResponse): void;
|
|
98
|
+
}
|
|
99
|
+
export interface PermissionMetadataResolver extends PermissionApprovalResolver {
|
|
100
|
+
setToolMeta?(tools: Array<{
|
|
101
|
+
function: {
|
|
102
|
+
name: string;
|
|
103
|
+
};
|
|
104
|
+
meta?: ToolPermissionCheckInput["meta"];
|
|
105
|
+
}>): void;
|
|
106
|
+
ruleEngineRef?: PermissionRuleEnginePort;
|
|
107
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ProjectMemoryFileInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
size: number;
|
|
4
|
+
modifiedAt: string;
|
|
5
|
+
preview?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ProjectMemoryResult {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
file?: string;
|
|
11
|
+
indexUsage?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectMemoryStore {
|
|
14
|
+
getRootPath(): string;
|
|
15
|
+
ensureInitialized(): void;
|
|
16
|
+
getIndexForPrompt(): string;
|
|
17
|
+
getIndexRaw(): string;
|
|
18
|
+
getIndexUsage(): {
|
|
19
|
+
chars: number;
|
|
20
|
+
lines: number;
|
|
21
|
+
percent: number;
|
|
22
|
+
};
|
|
23
|
+
addToIndex(content: string): Promise<ProjectMemoryResult>;
|
|
24
|
+
replaceInIndex(oldText: string, newText: string): Promise<ProjectMemoryResult>;
|
|
25
|
+
removeFromIndex(oldText: string): Promise<ProjectMemoryResult>;
|
|
26
|
+
createFile(name: string, content: string): Promise<ProjectMemoryResult>;
|
|
27
|
+
writeFile(name: string, content: string): Promise<ProjectMemoryResult>;
|
|
28
|
+
readFile(name: string): Promise<{
|
|
29
|
+
ok: boolean;
|
|
30
|
+
content?: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}>;
|
|
33
|
+
deleteFile(name: string): Promise<ProjectMemoryResult>;
|
|
34
|
+
listFiles(): Promise<ProjectMemoryFileInfo[]>;
|
|
35
|
+
searchLocal(query: string): Promise<Array<{
|
|
36
|
+
file: string;
|
|
37
|
+
snippet: string;
|
|
38
|
+
score: number;
|
|
39
|
+
}>>;
|
|
40
|
+
}
|
|
41
|
+
export interface ProjectMemoryStoreFactory {
|
|
42
|
+
getRootPath(projectRoot: string): string;
|
|
43
|
+
create(projectRoot: string): ProjectMemoryStore;
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface OpenAiToolCall {
|
|
2
|
+
id: string;
|
|
3
|
+
type: "function";
|
|
4
|
+
function: {
|
|
5
|
+
name: string;
|
|
6
|
+
arguments: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface ToolResultMessageInput {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
payload?: unknown;
|
|
12
|
+
error?: string;
|
|
13
|
+
toolReferences?: string[];
|
|
14
|
+
imageUrls?: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare function buildToolResultMessage(callId: string, result: ToolResultMessageInput): Record<string, unknown>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ToolDefinition } from "../../protocol/wire/index.js";
|
|
2
|
+
export interface RuntimeToolContract {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: Record<string, unknown>;
|
|
7
|
+
isEnabled?: () => boolean;
|
|
8
|
+
shouldDefer?: boolean;
|
|
9
|
+
execute?(toolCallId: string, params: Record<string, unknown>, signal?: AbortSignal): Promise<{
|
|
10
|
+
content: Array<{
|
|
11
|
+
text?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export interface ToolCatalog {
|
|
16
|
+
findTool(name: string): RuntimeToolContract | undefined;
|
|
17
|
+
getToolManifest(includeDeferred?: boolean): ToolDefinition[];
|
|
18
|
+
getToolNames(): string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ToolBootstrap {
|
|
21
|
+
getAllBaseTools(): RuntimeToolContract[];
|
|
22
|
+
setWorkdir(dir: string): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface WebSearchResult {
|
|
2
|
+
title: string;
|
|
3
|
+
url: string;
|
|
4
|
+
snippet: string;
|
|
5
|
+
}
|
|
6
|
+
export interface WebSearchOutput {
|
|
7
|
+
query: string;
|
|
8
|
+
results: WebSearchResult[];
|
|
9
|
+
totalResults?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface WebSearchBackend {
|
|
12
|
+
search(query: string, options?: {
|
|
13
|
+
allowedDomains?: string[];
|
|
14
|
+
blockedDomains?: string[];
|
|
15
|
+
maxResults?: number;
|
|
16
|
+
}): Promise<WebSearchOutput>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface WorktreeInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
branch: string;
|
|
5
|
+
isCurrent: boolean;
|
|
6
|
+
hasChanges: boolean;
|
|
7
|
+
unpushedCommits: number;
|
|
8
|
+
}
|
|
9
|
+
export interface WorktreeResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
worktree?: WorktreeInfo;
|
|
12
|
+
worktrees?: WorktreeInfo[];
|
|
13
|
+
previousCwd?: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface WorktreeBackend {
|
|
17
|
+
enterWorktree(name?: string): Promise<WorktreeResult>;
|
|
18
|
+
exitWorktree(action: "keep" | "remove", discardChanges?: boolean): Promise<WorktreeResult>;
|
|
19
|
+
listWorktrees(): Promise<WorktreeResult>;
|
|
20
|
+
isInWorktree(): boolean;
|
|
21
|
+
currentWorktree?(): WorktreeInfo | null;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type SystemPromptSection } from "./system-prompt-sections.js";
|
|
2
|
+
export interface PromptMessageLike {
|
|
3
|
+
role?: string;
|
|
4
|
+
content?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface ToolNameLike {
|
|
7
|
+
function?: {
|
|
8
|
+
name?: string;
|
|
9
|
+
};
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FreshWorkspaceEvidencePolicy {
|
|
13
|
+
requiresFreshTool: boolean;
|
|
14
|
+
reason?: "file-read" | "file-mutation" | "memory-mutation" | "directory-list" | "content-search" | "shell" | "web";
|
|
15
|
+
allowedToolNames: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
|
|
18
|
+
export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolNameLike>(tools: readonly TTool[], policy: FreshWorkspaceEvidencePolicy): TTool[];
|
|
19
|
+
export declare function createFreshWorkspaceEvidenceSection(policy: FreshWorkspaceEvidencePolicy): SystemPromptSection | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|