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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
2
|
+
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
2
3
|
import type { ToolDefinition } from "../../protocol/wire/index.js";
|
|
3
4
|
import { PermissionRuleEngine } from "./rule-engine.js";
|
|
4
5
|
import type { PermissionUpdate, ApprovalRequest, ApprovalResponse } from "./types.js";
|
|
5
6
|
import { type ClassifierLLMCall } from "./permission-classifier.js";
|
|
6
|
-
import type { PermissionRole } from "../../orchestration/subagent/task-types.js";
|
|
7
7
|
import { DenialAuditLogger } from "./denial-audit-log.js";
|
|
8
|
+
export type PermissionRole = "interactive" | "coordinator" | "worker";
|
|
8
9
|
export interface PermissionCheckerDeps {
|
|
9
10
|
ruleEngine: PermissionRuleEngine;
|
|
10
11
|
hookRegistry: HookRegistry;
|
|
@@ -27,7 +28,7 @@ export interface PermissionCheckerDeps {
|
|
|
27
28
|
* Recent conversation messages for classifier context.
|
|
28
29
|
* Called lazily when the classifier needs to run.
|
|
29
30
|
*/
|
|
30
|
-
getRecentMessages?: () =>
|
|
31
|
+
getRecentMessages?: () => ChatMessage[];
|
|
31
32
|
/**
|
|
32
33
|
* Permission role context (CC: interactive/coordinator/worker).
|
|
33
34
|
* Determines how the checker behaves:
|
|
@@ -42,6 +43,13 @@ export interface PermissionCheckerDeps {
|
|
|
42
43
|
sessionId?: string;
|
|
43
44
|
/** Getter for current turn ID (changes per turn). */
|
|
44
45
|
getTurnId?: () => string;
|
|
46
|
+
/** Best-effort community telemetry sink for consent-gated sandbox metrics. */
|
|
47
|
+
communityTelemetryRecorder?: {
|
|
48
|
+
recordTelemetry(input: {
|
|
49
|
+
event: "community.sandbox.violation";
|
|
50
|
+
metadata?: Record<string, unknown>;
|
|
51
|
+
}): Promise<unknown>;
|
|
52
|
+
};
|
|
45
53
|
}
|
|
46
54
|
export declare class PermissionChecker {
|
|
47
55
|
private readonly ruleEngine;
|
|
@@ -56,6 +64,9 @@ export declare class PermissionChecker {
|
|
|
56
64
|
private readonly auditLogger;
|
|
57
65
|
private readonly sessionId;
|
|
58
66
|
private readonly getTurnId;
|
|
67
|
+
private readonly communityTelemetryRecorder;
|
|
68
|
+
private readonly communitySandboxTurnIds;
|
|
69
|
+
private readonly communitySandboxRuleEngine;
|
|
59
70
|
private unregisterHook;
|
|
60
71
|
/** Tool meta cache — populated from ToolDefinition[] at agent creation */
|
|
61
72
|
private toolMetaCache;
|
|
@@ -78,9 +89,11 @@ export declare class PermissionChecker {
|
|
|
78
89
|
*/
|
|
79
90
|
setToolMeta(tools: ToolDefinition[]): void;
|
|
80
91
|
get ruleEngineRef(): PermissionRuleEngine;
|
|
92
|
+
private checkCommunitySandboxThenBase;
|
|
81
93
|
/** Fire permission.denied hook + onDenied callback + audit log */
|
|
82
94
|
private fireDenied;
|
|
83
95
|
private handleResult;
|
|
96
|
+
private handleInteractiveApproval;
|
|
84
97
|
/**
|
|
85
98
|
* Worker/coordinator "ask" handler: classifier-only, no approval dialog.
|
|
86
99
|
* CC pattern: headless workers never prompt users.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* Settings file location: `.qlogicagent/settings.json` in the project root
|
|
9
9
|
*
|
|
10
10
|
* Watched fields:
|
|
11
|
+
* - permissions: PermissionConfig
|
|
11
12
|
* - permissionMode: PermissionMode
|
|
12
13
|
* - permissionRules: PermissionRuleEntry[]
|
|
13
14
|
* - defaultBehavior: PermissionBehavior
|
|
@@ -19,6 +20,7 @@ import type { PermissionRuleEntry, PermissionMode, PermissionBehavior } from "./
|
|
|
19
20
|
import { PermissionRuleEngine } from "./rule-engine.js";
|
|
20
21
|
/** On-disk settings file schema */
|
|
21
22
|
export interface SettingsFile {
|
|
23
|
+
permissions?: unknown;
|
|
22
24
|
permissionMode?: PermissionMode;
|
|
23
25
|
permissionRules?: PermissionRuleEntry[];
|
|
24
26
|
defaultBehavior?: PermissionBehavior;
|
|
@@ -1,113 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* cc reference:
|
|
5
|
-
* 'default' → normal prompting
|
|
6
|
-
* 'bypassPermissions' → auto-accept all
|
|
7
|
-
* 'acceptEdits' → auto-accept edits only
|
|
8
|
-
* 'dontAsk' → auto-deny all
|
|
9
|
-
* 'plan' → planning mode (pause execution)
|
|
10
|
-
*
|
|
11
|
-
* We keep the cc names for compatibility.
|
|
12
|
-
*/
|
|
13
|
-
export type PermissionMode = "default" | "bypassPermissions" | "acceptEdits" | "dontAsk" | "plan" | "auto";
|
|
14
|
-
export declare const PERMISSION_MODES: readonly PermissionMode[];
|
|
15
|
-
export type PermissionBehavior = "allow" | "deny" | "ask";
|
|
16
|
-
export type PermissionDecisionReason = {
|
|
17
|
-
type: "rule";
|
|
18
|
-
rule: PermissionRuleEntry;
|
|
19
|
-
} | {
|
|
20
|
-
type: "mode";
|
|
21
|
-
mode: PermissionMode;
|
|
22
|
-
} | {
|
|
23
|
-
type: "hook";
|
|
24
|
-
hookName: string;
|
|
25
|
-
reason: string;
|
|
26
|
-
} | {
|
|
27
|
-
type: "classifier";
|
|
28
|
-
classifier: string;
|
|
29
|
-
reason: string;
|
|
30
|
-
} | {
|
|
31
|
-
type: "tool_check";
|
|
32
|
-
reason: string;
|
|
33
|
-
} | {
|
|
34
|
-
type: "eligibility";
|
|
35
|
-
reasonCodes: string[];
|
|
36
|
-
} | {
|
|
37
|
-
type: "sandbox";
|
|
38
|
-
reason: string;
|
|
39
|
-
} | {
|
|
40
|
-
type: "other";
|
|
41
|
-
reason: string;
|
|
42
|
-
};
|
|
43
|
-
export interface PermissionAllowResult {
|
|
44
|
-
behavior: "allow";
|
|
45
|
-
updatedInput?: Record<string, unknown>;
|
|
46
|
-
decisionReason?: PermissionDecisionReason;
|
|
47
|
-
}
|
|
48
|
-
export interface PermissionAskResult {
|
|
49
|
-
behavior: "ask";
|
|
50
|
-
message: string;
|
|
51
|
-
toolName: string;
|
|
52
|
-
input?: Record<string, unknown>;
|
|
53
|
-
suggestions?: PermissionUpdate[];
|
|
54
|
-
decisionReason?: PermissionDecisionReason;
|
|
55
|
-
}
|
|
56
|
-
export interface PermissionDenyResult {
|
|
57
|
-
behavior: "deny";
|
|
58
|
-
message: string;
|
|
59
|
-
decisionReason: PermissionDecisionReason;
|
|
60
|
-
}
|
|
61
|
-
export type PermissionResult = PermissionAllowResult | PermissionAskResult | PermissionDenyResult;
|
|
62
|
-
export interface PermissionUpdate {
|
|
63
|
-
/** Tool name or glob pattern */
|
|
64
|
-
pattern: string;
|
|
65
|
-
/** New rule to apply */
|
|
66
|
-
behavior: PermissionBehavior;
|
|
67
|
-
/** Human-readable description */
|
|
68
|
-
description?: string;
|
|
69
|
-
}
|
|
70
|
-
export interface PermissionRuleEntry {
|
|
71
|
-
/** Exact tool name or glob pattern */
|
|
72
|
-
pattern: string;
|
|
73
|
-
/** Action for matching tools */
|
|
74
|
-
behavior: PermissionBehavior;
|
|
75
|
-
/** Optional reason for logging/display */
|
|
76
|
-
reason?: string;
|
|
77
|
-
/** Source of this rule (config/user/plugin) */
|
|
78
|
-
source?: string;
|
|
79
|
-
}
|
|
80
|
-
export interface PermissionConfig {
|
|
81
|
-
/** Active permission mode */
|
|
82
|
-
mode: PermissionMode;
|
|
83
|
-
/** Rules evaluated in order; first match wins */
|
|
84
|
-
rules: PermissionRuleEntry[];
|
|
85
|
-
/** Default behavior when no rule matches */
|
|
86
|
-
defaultBehavior: PermissionBehavior;
|
|
87
|
-
}
|
|
88
|
-
export interface ToolPermissionCheckInput {
|
|
89
|
-
toolName: string;
|
|
90
|
-
arguments?: Record<string, unknown>;
|
|
91
|
-
/** Tool metadata from ToolDefinition.meta */
|
|
92
|
-
meta?: {
|
|
93
|
-
isReadOnly?: boolean;
|
|
94
|
-
isDangerous?: boolean;
|
|
95
|
-
requiresApproval?: boolean;
|
|
96
|
-
parallelSafe?: boolean;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export interface ApprovalRequest {
|
|
100
|
-
approvalId: string;
|
|
101
|
-
callId: string;
|
|
102
|
-
toolName: string;
|
|
103
|
-
arguments?: Record<string, unknown>;
|
|
104
|
-
message: string;
|
|
105
|
-
suggestions?: PermissionUpdate[];
|
|
106
|
-
}
|
|
107
|
-
export interface ApprovalResponse {
|
|
108
|
-
approvalId: string;
|
|
109
|
-
decision: "approved" | "denied";
|
|
110
|
-
updatedInput?: Record<string, unknown>;
|
|
111
|
-
/** Persistent rule to save */
|
|
112
|
-
permissionUpdate?: PermissionUpdate;
|
|
113
|
-
}
|
|
1
|
+
export { PERMISSION_MODES, } from "../../runtime/ports/permission-contracts.js";
|
|
2
|
+
export type { ApprovalRequest, ApprovalResponse, PermissionAllowResult, PermissionAskResult, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionDenyResult, PermissionMode, PermissionResult, PermissionRuleEntry, PermissionUpdate, ToolPermissionCheckInput, } from "../../runtime/ports/permission-contracts.js";
|
|
@@ -14,6 +14,19 @@ export interface ToolContentBlock {
|
|
|
14
14
|
data?: string;
|
|
15
15
|
mimeType?: string;
|
|
16
16
|
}
|
|
17
|
+
export type LocaleCode = "zh-CN" | "en-US" | (string & {});
|
|
18
|
+
export interface LocalizedText {
|
|
19
|
+
/**
|
|
20
|
+
* Stable translation key. UI clients decide the final language.
|
|
21
|
+
* Backends must not localize this string.
|
|
22
|
+
*/
|
|
23
|
+
key: string;
|
|
24
|
+
/** Safe fallback for clients that do not have the key yet. */
|
|
25
|
+
fallback: string;
|
|
26
|
+
/** Optional bundled values for offline clients. */
|
|
27
|
+
values?: Partial<Record<LocaleCode, string>>;
|
|
28
|
+
}
|
|
29
|
+
export type CapabilityCategory = "orchestration" | "filesystem" | "web" | "search" | "memory" | "media" | "developer" | "mcp" | "automation" | "system" | "other";
|
|
17
30
|
/**
|
|
18
31
|
* Result of executing a portable tool.
|
|
19
32
|
*/
|
|
@@ -38,6 +51,15 @@ export interface PortableTool<TParams = Record<string, unknown>> {
|
|
|
38
51
|
name: string;
|
|
39
52
|
/** Human-readable label. */
|
|
40
53
|
label: string;
|
|
54
|
+
/**
|
|
55
|
+
* UI category declared by the tool registration.
|
|
56
|
+
* Clients must not infer this from name/description.
|
|
57
|
+
*/
|
|
58
|
+
category?: CapabilityCategory;
|
|
59
|
+
/** UI-facing localized name. */
|
|
60
|
+
displayName?: LocalizedText;
|
|
61
|
+
/** UI-facing localized summary. The LLM-only description stays separate. */
|
|
62
|
+
displayDescription?: LocalizedText;
|
|
41
63
|
/** Tool description shown to the LLM. */
|
|
42
64
|
description: string;
|
|
43
65
|
/** JSON Schema object describing the tool's parameters. */
|
|
@@ -11,6 +11,11 @@ export interface SkillLifecycleRecord {
|
|
|
11
11
|
pinned: boolean;
|
|
12
12
|
useCount: number;
|
|
13
13
|
source: "learned" | "created" | "installed" | "promoted";
|
|
14
|
+
registryResourceId?: string;
|
|
15
|
+
registryVersion?: string;
|
|
16
|
+
registrySourceTier?: "official" | "community";
|
|
17
|
+
registryRiskTier?: "R0" | "R1" | "R2" | "R3";
|
|
18
|
+
registryEffectiveRiskTier?: "R0" | "R1" | "R2" | "R3";
|
|
14
19
|
}
|
|
15
20
|
export interface SkillLifecycleStore {
|
|
16
21
|
version: 1;
|
|
@@ -1,77 +1,6 @@
|
|
|
1
|
-
import type { SkillScanSummary } from "./skill-types.js";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export type TrustLevel = "builtin" | "verified" | "community" | "unknown";
|
|
7
|
-
/**
|
|
8
|
-
* Result of a skill security scan decision.
|
|
9
|
-
*/
|
|
10
|
-
export type ScanVerdict = "pass" | "quarantine" | "reject";
|
|
11
|
-
/**
|
|
12
|
-
* A resolved skill source descriptor.
|
|
13
|
-
*/
|
|
14
|
-
export interface SkillSourceDescriptor {
|
|
15
|
-
/** Source type. */
|
|
16
|
-
kind: "bundled" | "github" | "npm" | "local" | "tap";
|
|
17
|
-
/** Human-readable identifier, e.g. "github:user/repo" or "npm:@scope/pkg". */
|
|
18
|
-
identifier: string;
|
|
19
|
-
/** Trust level derived from source type + verification status. */
|
|
20
|
-
trust: TrustLevel;
|
|
21
|
-
/** Version constraint (semver or tag). */
|
|
22
|
-
version?: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Result of fetching a skill from a remote source.
|
|
26
|
-
*/
|
|
27
|
-
export interface SkillFetchResult {
|
|
28
|
-
/** Local directory where fetched content was placed. */
|
|
29
|
-
quarantineDir: string;
|
|
30
|
-
/** Manifest metadata if found. */
|
|
31
|
-
name?: string;
|
|
32
|
-
version?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Dependencies for the skill fetch step.
|
|
36
|
-
* Consumers inject actual HTTP/git/npm implementations.
|
|
37
|
-
*/
|
|
38
|
-
export interface SkillFetchDeps {
|
|
39
|
-
/**
|
|
40
|
-
* Download / clone / extract a skill from its source into a quarantine dir.
|
|
41
|
-
* Must NOT place content in the final install location.
|
|
42
|
-
*/
|
|
43
|
-
fetch(source: SkillSourceDescriptor, quarantineDir: string): Promise<SkillFetchResult>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Dependencies for the skill storage step.
|
|
47
|
-
* Manages the local skill directory and registry.
|
|
48
|
-
*/
|
|
49
|
-
export interface SkillStorageDeps {
|
|
50
|
-
/** Root directory for installed skills (e.g. ~/.xiaozhiclaw/skills/). */
|
|
51
|
-
skillsDir: string;
|
|
52
|
-
/** Registry subdirectory (e.g. ~/.xiaozhiclaw/skills/.registry/). */
|
|
53
|
-
registryDir: string;
|
|
54
|
-
/** Move content from quarantine to final location. */
|
|
55
|
-
moveToInstallDir(quarantineDir: string, skillName: string): Promise<string>;
|
|
56
|
-
/** Remove an installed skill directory. */
|
|
57
|
-
removeSkill(skillName: string): Promise<void>;
|
|
58
|
-
/** Read the registry lock file. */
|
|
59
|
-
readLockfile(): Promise<SkillLockfile>;
|
|
60
|
-
/** Write the registry lock file. */
|
|
61
|
-
writeLockfile(lockfile: SkillLockfile): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A single version history entry for a skill.
|
|
65
|
-
*/
|
|
66
|
-
export interface SkillVersionEntry {
|
|
67
|
-
version: string;
|
|
68
|
-
updatedAt: string;
|
|
69
|
-
changelog?: string;
|
|
70
|
-
/** Integrity hash of the SKILL.md content at this version (sha256). */
|
|
71
|
-
integrity?: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Usage statistics for a skill.
|
|
2
|
+
* Lightweight per-skill stats stored in `~/.qlogicagent/skill-stats.json`.
|
|
3
|
+
* Covers learned, promoted, and registry-installed skills.
|
|
75
4
|
*/
|
|
76
5
|
export interface SkillUsageStats {
|
|
77
6
|
/** Total number of times this skill has been invoked/applied. */
|
|
@@ -87,43 +16,6 @@ export interface SkillUsageStats {
|
|
|
87
16
|
/** Derived success rate = (invokeCount - negativeCount) / invokeCount */
|
|
88
17
|
successRate?: number;
|
|
89
18
|
}
|
|
90
|
-
/**
|
|
91
|
-
* Single entry in the skill lockfile.
|
|
92
|
-
*/
|
|
93
|
-
export interface SkillLockEntry {
|
|
94
|
-
name: string;
|
|
95
|
-
source: SkillSourceDescriptor;
|
|
96
|
-
installedAt: string;
|
|
97
|
-
scanVerdict: ScanVerdict;
|
|
98
|
-
scanSummary?: SkillScanSummary;
|
|
99
|
-
/** Integrity hash of the SKILL.md content (sha256). */
|
|
100
|
-
integrity?: string;
|
|
101
|
-
/** Current version (from frontmatter or auto-incremented). */
|
|
102
|
-
currentVersion?: string;
|
|
103
|
-
/** Version history — newest first. */
|
|
104
|
-
versionHistory?: SkillVersionEntry[];
|
|
105
|
-
/** Usage statistics. */
|
|
106
|
-
usage?: SkillUsageStats;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Complete lockfile for all installed skills.
|
|
110
|
-
*/
|
|
111
|
-
export interface SkillLockfile {
|
|
112
|
-
version: 1;
|
|
113
|
-
entries: Record<string, SkillLockEntry>;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Record a skill usage event. Mutates the lockfile entry in-place.
|
|
117
|
-
*/
|
|
118
|
-
export declare function recordSkillUsage(lockfile: SkillLockfile, skillName: string, feedback?: "positive" | "negative" | null): void;
|
|
119
|
-
/**
|
|
120
|
-
* Record a skill version update. Pushes current version to history.
|
|
121
|
-
*/
|
|
122
|
-
export declare function recordSkillVersionUpdate(lockfile: SkillLockfile, skillName: string, newVersion: string, changelog?: string, integrity?: string): void;
|
|
123
|
-
/**
|
|
124
|
-
* Lightweight per-skill stats stored in `~/.qlogicagent/skill-stats.json`.
|
|
125
|
-
* This is independent of the lockfile — covers learned, promoted, and installed skills.
|
|
126
|
-
*/
|
|
127
19
|
export interface SkillStatsFile {
|
|
128
20
|
[skillName: string]: SkillUsageStats;
|
|
129
21
|
}
|
|
@@ -144,41 +36,3 @@ export declare function getSkillStats(agentHome: string, skillName: string): Ski
|
|
|
144
36
|
export declare function getAllSkillStats(agentHome: string): SkillStatsFile;
|
|
145
37
|
/** Reset cache (for testing). */
|
|
146
38
|
export declare function resetStatsCache(): void;
|
|
147
|
-
/**
|
|
148
|
-
* Result of a skill install operation.
|
|
149
|
-
*/
|
|
150
|
-
export interface SkillInstallResult {
|
|
151
|
-
success: boolean;
|
|
152
|
-
name: string;
|
|
153
|
-
installDir?: string;
|
|
154
|
-
verdict: ScanVerdict;
|
|
155
|
-
scanSummary?: SkillScanSummary;
|
|
156
|
-
error?: string;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Orchestrate the full install pipeline:
|
|
160
|
-
* Fetch → Quarantine → Scan → Validate → Move → Lock
|
|
161
|
-
*
|
|
162
|
-
* This function is pure orchestration — actual I/O is delegated to deps.
|
|
163
|
-
*/
|
|
164
|
-
export declare function installSkill(params: {
|
|
165
|
-
source: SkillSourceDescriptor;
|
|
166
|
-
fetchDeps: SkillFetchDeps;
|
|
167
|
-
storageDeps: SkillStorageDeps;
|
|
168
|
-
scanSkillDir: (dir: string) => Promise<SkillScanSummary>;
|
|
169
|
-
quarantineDir: string;
|
|
170
|
-
}): Promise<SkillInstallResult>;
|
|
171
|
-
/**
|
|
172
|
-
* Uninstall a skill: remove from disk + update lockfile.
|
|
173
|
-
*/
|
|
174
|
-
export declare function uninstallSkill(params: {
|
|
175
|
-
skillName: string;
|
|
176
|
-
storageDeps: SkillStorageDeps;
|
|
177
|
-
}): Promise<{
|
|
178
|
-
success: boolean;
|
|
179
|
-
error?: string;
|
|
180
|
-
}>;
|
|
181
|
-
/**
|
|
182
|
-
* Create an empty lockfile.
|
|
183
|
-
*/
|
|
184
|
-
export declare function createEmptyLockfile(): SkillLockfile;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool access constants for sub-agent tool filtering.
|
|
3
|
+
*
|
|
4
|
+
* CC-aligned: constants/tools.ts pattern.
|
|
5
|
+
* Tool filtering happens at agent SPAWN time (not per-iteration in tool loop).
|
|
6
|
+
*
|
|
7
|
+
* CC reference: claude-code-haha/src/constants/tools.ts
|
|
8
|
+
* CC reference: claude-code-haha/src/tools/AgentTool/agentToolUtils.ts
|
|
9
|
+
*/
|
|
10
|
+
import type { ToolDefinition } from "../protocol/wire/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* Tools that ALL sub-agents are forbidden from using.
|
|
13
|
+
* CC: ALL_AGENT_DISALLOWED_TOOLS
|
|
14
|
+
*/
|
|
15
|
+
export declare const AGENT_DISALLOWED_TOOLS: Set<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Additional tools denied for custom (user-defined) agents.
|
|
18
|
+
* CC: CUSTOM_AGENT_DISALLOWED_TOOLS
|
|
19
|
+
*/
|
|
20
|
+
export declare const CUSTOM_AGENT_DISALLOWED_TOOLS: Set<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Filter tools available to a sub-agent.
|
|
23
|
+
*
|
|
24
|
+
* CC pattern: tool filtering happens at agent SPAWN time,
|
|
25
|
+
* not per-iteration inside the tool loop.
|
|
26
|
+
*
|
|
27
|
+
* @param tools - Parent's full tool pool
|
|
28
|
+
* @param isBuiltIn - Whether the agent is a built-in agent type (vs custom)
|
|
29
|
+
*/
|
|
30
|
+
export declare function filterToolsForAgent(tools: ToolDefinition[], isBuiltIn: boolean): ToolDefinition[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
2
|
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
|
|
3
3
|
export declare const SKILL_TOOL_NAME: "skill";
|
|
4
|
-
export type SkillAction = "invoke" | "list" | "view" | "create" | "edit" | "patch" | "delete" | "promote"
|
|
4
|
+
export type SkillAction = "invoke" | "list" | "view" | "create" | "edit" | "patch" | "delete" | "promote";
|
|
5
5
|
export interface SkillToolParams {
|
|
6
6
|
action: SkillAction;
|
|
7
7
|
name?: string;
|
|
@@ -12,15 +12,13 @@ export interface SkillToolParams {
|
|
|
12
12
|
fileContent?: string;
|
|
13
13
|
oldString?: string;
|
|
14
14
|
newString?: string;
|
|
15
|
-
/** URL to download skill from (for 'install' action). */
|
|
16
|
-
url?: string;
|
|
17
15
|
}
|
|
18
16
|
export declare const SKILL_TOOL_SCHEMA: {
|
|
19
17
|
readonly type: "object";
|
|
20
18
|
readonly properties: {
|
|
21
19
|
readonly action: {
|
|
22
20
|
readonly type: "string";
|
|
23
|
-
readonly enum: readonly ["invoke", "list", "view", "create", "edit", "patch", "delete", "promote"
|
|
21
|
+
readonly enum: readonly ["invoke", "list", "view", "create", "edit", "patch", "delete", "promote"];
|
|
24
22
|
readonly description: string;
|
|
25
23
|
};
|
|
26
24
|
readonly name: {
|
|
@@ -55,10 +53,6 @@ export declare const SKILL_TOOL_SCHEMA: {
|
|
|
55
53
|
readonly type: "string";
|
|
56
54
|
readonly description: "Replacement text for patch action.";
|
|
57
55
|
};
|
|
58
|
-
readonly url: {
|
|
59
|
-
readonly type: "string";
|
|
60
|
-
readonly description: "URL to download a skill from (for 'install' action). Supports skill stores (skillhub.cn, skill.io, GitHub raw links, etc.) and any direct .md URL.";
|
|
61
|
-
};
|
|
62
56
|
};
|
|
63
57
|
readonly required: readonly ["action"];
|
|
64
58
|
};
|
|
@@ -108,7 +102,5 @@ export interface SkillToolDeps {
|
|
|
108
102
|
}): Promise<SkillManageResult>;
|
|
109
103
|
/** Promote a project-level skill to user/global level. Returns success message. */
|
|
110
104
|
promoteSkill?(name: string): Promise<SkillManageResult>;
|
|
111
|
-
/** Install a skill from a URL. Downloads .md content and saves it. */
|
|
112
|
-
installSkill?(url: string, name?: string): Promise<SkillManageResult>;
|
|
113
105
|
}
|
|
114
106
|
export declare function createSkillMetaTool(deps: SkillToolDeps): PortableTool<SkillToolParams>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
import type { WebSearchBackend, WebSearchOutput, WebSearchResult } from "../../runtime/ports/web-search-contracts.js";
|
|
2
3
|
export declare const WEB_SEARCH_TOOL_NAME: "web_search";
|
|
3
4
|
export interface WebSearchToolParams {
|
|
4
5
|
query: string;
|
|
@@ -29,29 +30,11 @@ export declare const WEB_SEARCH_TOOL_SCHEMA: {
|
|
|
29
30
|
};
|
|
30
31
|
readonly required: readonly ["query"];
|
|
31
32
|
};
|
|
32
|
-
export
|
|
33
|
-
title: string;
|
|
34
|
-
url: string;
|
|
35
|
-
snippet: string;
|
|
36
|
-
}
|
|
37
|
-
export interface WebSearchOutput {
|
|
38
|
-
query: string;
|
|
39
|
-
results: WebSearchResult[];
|
|
40
|
-
totalResults?: number;
|
|
41
|
-
}
|
|
33
|
+
export type { WebSearchOutput, WebSearchResult };
|
|
42
34
|
/**
|
|
43
35
|
* Host-provided web search backend.
|
|
44
36
|
* The host may use any search engine (SearXNG, Brave, Tavily, etc.).
|
|
45
37
|
*/
|
|
46
|
-
export interface WebSearchToolDeps {
|
|
47
|
-
/**
|
|
48
|
-
* Execute a web search and return results.
|
|
49
|
-
* The host is responsible for API key management and rate limiting.
|
|
50
|
-
*/
|
|
51
|
-
search(query: string, options?: {
|
|
52
|
-
allowedDomains?: string[];
|
|
53
|
-
blockedDomains?: string[];
|
|
54
|
-
maxResults?: number;
|
|
55
|
-
}): Promise<WebSearchOutput>;
|
|
38
|
+
export interface WebSearchToolDeps extends WebSearchBackend {
|
|
56
39
|
}
|
|
57
40
|
export declare function createWebSearchTool(deps: WebSearchToolDeps): PortableTool<WebSearchToolParams>;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { PortableTool } from "./portable-tool.js";
|
|
15
15
|
import type { ToolDefinition } from "../protocol/wire/index.js";
|
|
16
|
-
import { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent } from "
|
|
16
|
+
import { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent } from "./tool-access.js";
|
|
17
17
|
export { AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, filterToolsForAgent };
|
|
18
18
|
/**
|
|
19
19
|
* Register tools into the internal pool. Called by initToolDeps().
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* interface. The StdioServer implements this interface by routing ACP methods to
|
|
17
17
|
* existing internal handlers.
|
|
18
18
|
*/
|
|
19
|
-
import type { Transport } from "
|
|
19
|
+
import type { Transport } from "./io-transport.js";
|
|
20
20
|
import { type AcpInitializeParams, type AcpInitializeResult, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, type AcpSessionEndParams, type AcpSessionSetConfigParams, type AcpSessionUpdateType, type AcpPermissionRequestParams, type AcpPermissionRequestResult } from "../protocol/wire/index.js";
|
|
21
21
|
export declare const ACP_ERROR_CODES: {
|
|
22
22
|
readonly PARSE_ERROR: -32700;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract I/O layer for JSON-RPC message exchange.
|
|
3
|
+
*
|
|
4
|
+
* Physical transports such as stdio, WebSocket, or domain sockets implement
|
|
5
|
+
* this interface so protocol handlers do not depend on a concrete process
|
|
6
|
+
* entry point.
|
|
7
|
+
*/
|
|
8
|
+
export interface Transport {
|
|
9
|
+
/** Register the message handler, called for each parsed incoming message. */
|
|
10
|
+
onMessage(handler: (msg: unknown) => void): void;
|
|
11
|
+
/** Register the close handler, called when the transport closes. */
|
|
12
|
+
onClose(handler: () => void): void;
|
|
13
|
+
/** Send a JSON-RPC message. Implementations serialize as needed. */
|
|
14
|
+
send(msg: unknown): void;
|
|
15
|
+
/** Start listening for incoming messages. */
|
|
16
|
+
start(): void;
|
|
17
|
+
/** Close the transport gracefully. */
|
|
18
|
+
close(): void;
|
|
19
|
+
}
|