qlogicagent 2.10.22 → 2.10.24
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/qla-executor-host.d.ts +42 -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 +18 -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 +6 -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,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 {};
|
|
@@ -29,6 +29,10 @@ export interface InstructionFileInfo {
|
|
|
29
29
|
/** Glob patterns from frontmatter — file only applies when target path matches */
|
|
30
30
|
globs?: string[];
|
|
31
31
|
}
|
|
32
|
+
export interface LiteralResponseRequirement {
|
|
33
|
+
marker: string;
|
|
34
|
+
placement: "prefix" | "suffix" | "include";
|
|
35
|
+
}
|
|
32
36
|
/**
|
|
33
37
|
* Load all instruction files following CC's discovery order.
|
|
34
38
|
*
|
|
@@ -49,15 +53,17 @@ export declare function loadInstructions(cwd: string, hooks?: HookRegistry): Pro
|
|
|
49
53
|
* CC parity: getClaudeMds()
|
|
50
54
|
*/
|
|
51
55
|
export declare function buildInstructionsPrompt(files: InstructionFileInfo[]): string;
|
|
56
|
+
export declare function extractLiteralResponseRequirements(files: InstructionFileInfo[]): LiteralResponseRequirement[];
|
|
57
|
+
export declare function applyLiteralResponseRequirements(content: string, requirements: readonly LiteralResponseRequirement[]): string;
|
|
52
58
|
/**
|
|
53
59
|
* Get conditional rules that match a target file path.
|
|
54
60
|
* CC parity: getManagedAndUserConditionalRules() + getMemoryFilesForNestedDirectory()
|
|
55
61
|
*/
|
|
56
62
|
export declare function getConditionalRules(cwd: string, targetPath: string): Promise<InstructionFileInfo[]>;
|
|
57
63
|
/**
|
|
58
|
-
* Load instructions
|
|
59
|
-
*
|
|
60
|
-
*
|
|
64
|
+
* Load instructions for the current turn.
|
|
65
|
+
* This intentionally reloads from disk every call so instruction edits become
|
|
66
|
+
* visible on the next turn without depending on a filesystem watcher.
|
|
61
67
|
*/
|
|
62
68
|
export declare function getInstructions(cwd: string, hooks?: HookRegistry): Promise<InstructionFileInfo[]>;
|
|
63
69
|
/** Clear the instruction cache. Called after file changes or compaction. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Type Taxonomy — CC-aligned sub-agent task state system.
|
|
3
|
+
*
|
|
4
|
+
* CC defines 7 task types for sub-agent dispatch. Each type has different:
|
|
5
|
+
* - Execution model (in-process, subprocess, remote)
|
|
6
|
+
* - Isolation level (shared, worktree, container)
|
|
7
|
+
* - Permission handling (interactive, coordinator, worker)
|
|
8
|
+
* - Tool access (full, restricted, read-only)
|
|
9
|
+
*
|
|
10
|
+
* Reference: claude-code src/tasks/types.ts
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The 7 task types from CC's sub-agent architecture.
|
|
14
|
+
*
|
|
15
|
+
* - local_bash: Subprocess shell execution (bash/powershell)
|
|
16
|
+
* - local_agent: Background forked Node process with its own tool loop
|
|
17
|
+
* - remote_agent: Cloud environment (polling-based, e.g., CCR sandbox)
|
|
18
|
+
* - in_process_teammate: Same process, AsyncLocalStorage-isolated agent
|
|
19
|
+
* - local_workflow: DAG/pipeline execution (planned)
|
|
20
|
+
* - monitor_mcp: MCP server monitoring agent (planned)
|
|
21
|
+
* - dream: Background memory consolidation agent
|
|
22
|
+
*/
|
|
23
|
+
export type TaskType = "local_bash" | "local_agent" | "remote_agent" | "in_process_teammate" | "local_workflow" | "monitor_mcp" | "dream";
|
|
24
|
+
/**
|
|
25
|
+
* How a sub-agent is isolated from the parent execution.
|
|
26
|
+
*
|
|
27
|
+
* - shared: Same working directory, same filesystem (default fork)
|
|
28
|
+
* - worktree: Git worktree checkout — separate branch, merges back
|
|
29
|
+
* - container: Container sandbox (docker/remote)
|
|
30
|
+
*/
|
|
31
|
+
export type IsolationMode = "shared" | "worktree" | "container";
|
|
32
|
+
/**
|
|
33
|
+
* Permission context for sub-agent execution.
|
|
34
|
+
* Determines which PermissionChecker variant is used.
|
|
35
|
+
*
|
|
36
|
+
* CC reference: 3 permission handler variants
|
|
37
|
+
* - interactive: User-facing agent, prompts for approval
|
|
38
|
+
* - coordinator: Orchestrator agent, auto-approves most non-destructive ops
|
|
39
|
+
* - worker: Headless worker, classifier-only (no user prompts)
|
|
40
|
+
*/
|
|
41
|
+
export type PermissionRole = "interactive" | "coordinator" | "worker";
|
|
42
|
+
/** Common state fields shared by all task types. */
|
|
43
|
+
export interface TaskStateBase {
|
|
44
|
+
/** Unique task ID. */
|
|
45
|
+
taskId: string;
|
|
46
|
+
/** Task type discriminant. */
|
|
47
|
+
type: TaskType;
|
|
48
|
+
/** Human-readable label. */
|
|
49
|
+
label: string;
|
|
50
|
+
/** The permission role for this task's agent. */
|
|
51
|
+
permissionRole: PermissionRole;
|
|
52
|
+
/** Isolation mode. */
|
|
53
|
+
isolation: IsolationMode;
|
|
54
|
+
/** Current lifecycle state. */
|
|
55
|
+
lifecycle: TaskLifecycle;
|
|
56
|
+
/** Parent task ID (for nested sub-agents). */
|
|
57
|
+
parentTaskId?: string;
|
|
58
|
+
/** Execution depth (0 = root). */
|
|
59
|
+
depth: number;
|
|
60
|
+
/** Maximum turns before forced stop. */
|
|
61
|
+
maxTurns: number;
|
|
62
|
+
/** Token budget for this task. */
|
|
63
|
+
tokenBudget: number;
|
|
64
|
+
/** Start timestamp (ms). */
|
|
65
|
+
startedAt: number;
|
|
66
|
+
/** End timestamp (ms), set when completed/failed. */
|
|
67
|
+
endedAt?: number;
|
|
68
|
+
}
|
|
69
|
+
export type TaskLifecycle = "pending" | "running" | "completed" | "failed" | "cancelled" | "timeout";
|
|
70
|
+
/** Local bash task — subprocess shell execution. */
|
|
71
|
+
export interface LocalBashTaskState extends TaskStateBase {
|
|
72
|
+
type: "local_bash";
|
|
73
|
+
command: string;
|
|
74
|
+
cwd: string;
|
|
75
|
+
pid?: number;
|
|
76
|
+
}
|
|
77
|
+
/** Local agent task — forked agent with its own tool loop. */
|
|
78
|
+
export interface LocalAgentTaskState extends TaskStateBase {
|
|
79
|
+
type: "local_agent";
|
|
80
|
+
agentName: string;
|
|
81
|
+
systemPrompt: string;
|
|
82
|
+
/** Restricted tool set (empty = inherit parent). */
|
|
83
|
+
allowedTools: string[];
|
|
84
|
+
/** Worktree branch name (if isolation === "worktree"). */
|
|
85
|
+
worktreeBranch?: string;
|
|
86
|
+
}
|
|
87
|
+
/** Remote agent task — cloud sandbox execution. */
|
|
88
|
+
export interface RemoteAgentTaskState extends TaskStateBase {
|
|
89
|
+
type: "remote_agent";
|
|
90
|
+
/** Remote session/environment ID. */
|
|
91
|
+
remoteSessionId: string;
|
|
92
|
+
/** Polling endpoint for status checks. */
|
|
93
|
+
pollEndpoint?: string;
|
|
94
|
+
}
|
|
95
|
+
/** In-process teammate — AsyncLocalStorage-isolated, same process. */
|
|
96
|
+
export interface InProcessTeammateTaskState extends TaskStateBase {
|
|
97
|
+
type: "in_process_teammate";
|
|
98
|
+
teamName: string;
|
|
99
|
+
agentName: string;
|
|
100
|
+
/** Teammate's independent permission mode. */
|
|
101
|
+
permissionMode: string;
|
|
102
|
+
/** Async mailbox for coordinator ↔ worker communication. */
|
|
103
|
+
mailboxId?: string;
|
|
104
|
+
/** Isolated git worktree path for this teammate (CC team worktree parity). */
|
|
105
|
+
worktreePath?: string;
|
|
106
|
+
/** Worktree branch name (for cleanup). */
|
|
107
|
+
worktreeBranch?: string;
|
|
108
|
+
}
|
|
109
|
+
/** A single dream agent turn — text output + tool use count. */
|
|
110
|
+
export interface DreamTurn {
|
|
111
|
+
text: string;
|
|
112
|
+
toolUseCount: number;
|
|
113
|
+
}
|
|
114
|
+
/** Dream phase lifecycle — CC alignment. */
|
|
115
|
+
export type DreamPhase = "starting" | "updating" | "completed" | "failed";
|
|
116
|
+
/** Dream task — background memory consolidation agent (CC autoDream parity). */
|
|
117
|
+
export interface DreamTaskState extends TaskStateBase {
|
|
118
|
+
type: "dream";
|
|
119
|
+
sessionId: string;
|
|
120
|
+
/** Current dream phase. */
|
|
121
|
+
phase: DreamPhase;
|
|
122
|
+
/** Number of sessions being reviewed. */
|
|
123
|
+
sessionsReviewing: number;
|
|
124
|
+
/** Memory files touched by the dream agent. */
|
|
125
|
+
filesTouched: string[];
|
|
126
|
+
/** Dream agent turn history (capped). */
|
|
127
|
+
turns: DreamTurn[];
|
|
128
|
+
/** Stashed lock mtime for rollback on failure. */
|
|
129
|
+
priorLockMtime: number;
|
|
130
|
+
}
|
|
131
|
+
/** Placeholder for planned task types. */
|
|
132
|
+
export interface PlannedTaskState extends TaskStateBase {
|
|
133
|
+
type: "local_workflow" | "monitor_mcp";
|
|
134
|
+
}
|
|
135
|
+
/** Union of all concrete task states. */
|
|
136
|
+
export type TaskState = LocalBashTaskState | LocalAgentTaskState | RemoteAgentTaskState | InProcessTeammateTaskState | DreamTaskState | PlannedTaskState;
|
|
137
|
+
/**
|
|
138
|
+
* Filter available tools by permission role.
|
|
139
|
+
*
|
|
140
|
+
* @param role - The agent's permission role
|
|
141
|
+
* @param availableTools - Full set of tool names
|
|
142
|
+
* @returns Filtered tool names appropriate for the role
|
|
143
|
+
*/
|
|
144
|
+
export declare function filterToolsByRole(role: PermissionRole, availableTools: string[]): string[];
|
|
145
|
+
/** Create a new task state with defaults populated. */
|
|
146
|
+
export declare function createTaskState(overrides: Pick<TaskStateBase, "taskId" | "type" | "label"> & Partial<TaskStateBase>): TaskStateBase;
|
|
@@ -95,8 +95,8 @@ export { parseFrontmatter, resolveSkillMetadata, resolveSkillInvocationPolicy, r
|
|
|
95
95
|
export { loadSkillEntries, filterSkillEntries, buildSkillSnapshot, } from "./skill-system/skill-loader.js";
|
|
96
96
|
export { scanSource, scanSkillDirectory, hasCriticalFindings, isScannable, } from "./skill-system/skill-guard.js";
|
|
97
97
|
export type { SkillGuardDeps } from "./skill-system/skill-guard.js";
|
|
98
|
-
export {
|
|
99
|
-
export type {
|
|
98
|
+
export { trackSkillInvocation, getSkillStats, getAllSkillStats, resetStatsCache, } from "./skill-system/skill-source.js";
|
|
99
|
+
export type { SkillStatsFile, SkillUsageStats, } from "./skill-system/skill-source.js";
|
|
100
100
|
export { loadLifecycleStore, saveLifecycleStore, ensureRecord, recordInvocation, recordView, recordPatch, removeRecord, pinSkill, unpinSkill, runCurator, executeCuratorCycle, archiveSkillOnDisk, unarchiveSkillOnDisk, getSkillsByState, getLifecycleRecord, } from "./skill-system/skill-lifecycle.js";
|
|
101
101
|
export type { SkillLifecycleState, SkillLifecycleRecord, SkillLifecycleStore, CuratorResult, } from "./skill-system/skill-lifecycle.js";
|
|
102
102
|
export { validateSkillContent, generateSkillContent, autoFixFrontmatter, } from "./skill-system/skill-validation.js";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
import { type McpToolAnnotations } from "./mcp-tool-metadata.js";
|
|
2
3
|
interface McpToolSchema {
|
|
3
4
|
name: string;
|
|
4
5
|
description?: string;
|
|
5
6
|
inputSchema?: Record<string, unknown>;
|
|
7
|
+
annotations?: McpToolAnnotations;
|
|
6
8
|
}
|
|
7
9
|
interface McpToolCallResult {
|
|
8
10
|
content: Array<{
|
|
@@ -23,6 +23,8 @@ export interface McpServerEntry {
|
|
|
23
23
|
args?: string[];
|
|
24
24
|
/** Extra environment variables (stdio only) */
|
|
25
25
|
env?: Record<string, string>;
|
|
26
|
+
/** Working directory for stdio MCP subprocesses */
|
|
27
|
+
cwd?: string;
|
|
26
28
|
/** HTTP endpoint URL (http only) */
|
|
27
29
|
url?: string;
|
|
28
30
|
/** Extra HTTP headers (http only) */
|
|
@@ -38,11 +40,14 @@ export interface McpManagerConfig {
|
|
|
38
40
|
info(msg: string): void;
|
|
39
41
|
warn(msg: string): void;
|
|
40
42
|
};
|
|
43
|
+
/** Active workspace boundary for local-path arguments passed into MCP tools. */
|
|
44
|
+
workspaceRoot?: string;
|
|
41
45
|
}
|
|
42
46
|
export declare class McpManager {
|
|
43
47
|
private clients;
|
|
44
48
|
private injected;
|
|
45
49
|
private log;
|
|
50
|
+
private workspaceRoot?;
|
|
46
51
|
constructor(config: McpManagerConfig);
|
|
47
52
|
/**
|
|
48
53
|
* Connect to all configured MCP servers. Failures are logged but don't block.
|
|
@@ -74,10 +79,8 @@ export declare class McpManager {
|
|
|
74
79
|
* Read a resource from a specific MCP server by URI.
|
|
75
80
|
*/
|
|
76
81
|
readResource(serverName: string, uri: string): Promise<McpResourceContent[]>;
|
|
82
|
+
private wrapToolsForWorkspaceBoundary;
|
|
77
83
|
private reinjectTools;
|
|
78
84
|
}
|
|
79
|
-
|
|
80
|
-
* Parse MCP server configs from a JSON structure (mcp.json format).
|
|
81
|
-
* Compatible with Claude Code's mcp_servers.json structure.
|
|
82
|
-
*/
|
|
85
|
+
export declare function validateMcpToolWorkspaceBoundary(toolName: string, args: unknown, workspaceRoot: string | undefined): string | null;
|
|
83
86
|
export declare function parseMcpConfig(json: unknown): McpServerEntry[];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
import { type McpToolAnnotations } from "./mcp-tool-metadata.js";
|
|
2
3
|
interface McpToolSchema {
|
|
3
4
|
name: string;
|
|
4
5
|
description?: string;
|
|
5
6
|
inputSchema?: Record<string, unknown>;
|
|
7
|
+
annotations?: McpToolAnnotations;
|
|
6
8
|
}
|
|
7
9
|
interface McpToolCallResult {
|
|
8
10
|
content: Array<{
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface McpToolAnnotations {
|
|
2
|
+
readOnlyHint?: boolean;
|
|
3
|
+
destructiveHint?: boolean;
|
|
4
|
+
idempotentHint?: boolean;
|
|
5
|
+
openWorldHint?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface McpToolMetadataInput {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
annotations?: McpToolAnnotations;
|
|
12
|
+
}
|
|
13
|
+
export interface McpPortableToolTraits {
|
|
14
|
+
isReadOnly: boolean;
|
|
15
|
+
isConcurrencySafe: boolean;
|
|
16
|
+
isDestructive: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function deriveMcpPortableToolTraits(tool: McpToolMetadataInput): McpPortableToolTraits;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Memory categories for QMemory writes.
|
|
3
|
-
* Each has different value thresholds and retention policies.
|
|
4
|
-
*/
|
|
5
|
-
export type QMemoryCategory = "lesson" | "preference" | "pattern" | "fact" | "decision" | "skill-learning";
|
|
1
|
+
export type { QMemoryCategory } from "../../runtime/memory/categories.js";
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/** Max topic files to consider during scan. */
|
|
3
|
-
readonly MAX_SCAN_FILES: 100;
|
|
4
|
-
/** Max files to surface per turn. */
|
|
5
|
-
readonly MAX_SELECTED: 5;
|
|
6
|
-
/** Max bytes per surfaced file (CC: 4096). */
|
|
7
|
-
readonly MAX_FILE_BYTES: 4096;
|
|
8
|
-
/** Max total bytes for all surfaced files combined. */
|
|
9
|
-
readonly MAX_TOTAL_BYTES: number;
|
|
10
|
-
/** Minimum score to be selected (0.0-1.0). */
|
|
11
|
-
readonly MIN_SCORE: 0.2;
|
|
12
|
-
/** Lines to read for header/description extraction. */
|
|
13
|
-
readonly HEADER_LINES: 10;
|
|
14
|
-
/** Recency boost: files modified within this many days get a bonus. */
|
|
15
|
-
readonly RECENCY_DAYS: 7;
|
|
16
|
-
/** Recency boost amount. */
|
|
17
|
-
readonly RECENCY_BOOST: 0.15;
|
|
18
|
-
};
|
|
19
|
-
/** Scanned memory file header (CC MemoryHeader parity). */
|
|
20
|
-
export interface MemoryFileHeader {
|
|
21
|
-
/** Filename (e.g. "lesson-docker.md") */
|
|
22
|
-
filename: string;
|
|
23
|
-
/** Absolute path */
|
|
24
|
-
filePath: string;
|
|
25
|
-
/** Last modified timestamp (ms since epoch) */
|
|
26
|
-
mtimeMs: number;
|
|
27
|
-
/** File size in bytes */
|
|
28
|
-
sizeBytes: number;
|
|
29
|
-
/** Description extracted from first non-heading line */
|
|
30
|
-
description: string | null;
|
|
31
|
-
/** Category inferred from filename prefix */
|
|
32
|
-
category: string | null;
|
|
33
|
-
}
|
|
34
|
-
/** A selected relevant memory with content loaded. */
|
|
35
|
-
export interface RelevantMemory {
|
|
36
|
-
/** Filename */
|
|
37
|
-
filename: string;
|
|
38
|
-
/** Full file path */
|
|
39
|
-
filePath: string;
|
|
40
|
-
/** Last modified timestamp */
|
|
41
|
-
mtimeMs: number;
|
|
42
|
-
/** Relevance score (0.0 - 1.0) */
|
|
43
|
-
score: number;
|
|
44
|
-
/** Content (possibly truncated) */
|
|
45
|
-
content: string;
|
|
46
|
-
/** Whether content was truncated */
|
|
47
|
-
truncated: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Find memory files relevant to a user query.
|
|
51
|
-
*
|
|
52
|
-
* CC parity: scans topic files, scores by keyword + filename + recency,
|
|
53
|
-
* selects top-N, loads content. No LLM needed (unlike CC's Sonnet call).
|
|
54
|
-
*
|
|
55
|
-
* @param query - User query text
|
|
56
|
-
* @param memoryDir - Root of the MEMDIR directory (~/.qlogicagent/memory/)
|
|
57
|
-
* @param alreadySurfaced - Paths already shown in prior turns (for dedup)
|
|
58
|
-
* @returns Relevant memories with content, sorted by score
|
|
59
|
-
*/
|
|
60
|
-
export declare function findRelevantMemories(query: string, memoryDir: string, alreadySurfaced?: ReadonlySet<string>): Promise<RelevantMemory[]>;
|
|
61
|
-
/**
|
|
62
|
-
* Scan memory directory for topic files (excludes INDEX.md).
|
|
63
|
-
* Returns headers sorted by modification time (newest first).
|
|
64
|
-
*/
|
|
65
|
-
export declare function scanMemoryHeaders(memoryDir: string): Promise<MemoryFileHeader[]>;
|
|
66
|
-
/**
|
|
67
|
-
* Format relevant memories as a single block for system prompt injection.
|
|
68
|
-
* CC parity: includes freshness header per file.
|
|
69
|
-
*/
|
|
70
|
-
export declare function formatRelevantMemoriesBlock(memories: RelevantMemory[]): string;
|
|
1
|
+
export * from "../../runtime/memory/find-relevant-memories.js";
|