qlogicagent 2.20.6 → 2.20.8
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 +27 -54
- package/dist/agent-contract.js +1 -1
- package/dist/agent.js +42 -41
- package/dist/cli.js +1 -1
- package/dist/host-contract.js +1 -1
- package/dist/index.js +539 -565
- package/dist/orchestration.js +14 -14
- package/dist/project-memory-host.js +30 -33
- package/dist/protocol.js +1 -1
- package/dist/types/agent/memory-recall-context.d.ts +7 -0
- package/dist/types/agent/tool-loop/artifact-final-contract.d.ts +2 -0
- package/dist/types/agent/tool-loop/direct-response-contract.d.ts +12 -0
- package/dist/types/agent/tool-loop/final-status-stream-suppressor.d.ts +22 -0
- package/dist/types/agent/tool-loop/loop-helpers.d.ts +2 -2
- package/dist/types/agent/tool-loop.d.ts +5 -1
- package/dist/types/agent/types.d.ts +27 -15
- package/dist/types/cli/acp-commands.d.ts +1 -1
- package/dist/types/cli/acp-extended-handlers.d.ts +13 -3
- package/dist/types/cli/agent-runtime-session-state.d.ts +1 -0
- package/dist/types/cli/base-tool-bootstrap.d.ts +0 -7
- package/dist/types/cli/community-skill-installer.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -3
- package/dist/types/cli/core-tools/registry.d.ts +1 -4
- package/dist/types/cli/handlers/config-handler.d.ts +0 -1
- package/dist/types/cli/handlers/goal-handler.d.ts +24 -0
- package/dist/types/cli/handlers/memory-handler.d.ts +1 -2
- package/dist/types/cli/handlers/skill-curator-handler.d.ts +8 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +9 -12
- package/dist/types/cli/memory-candidate-service.d.ts +1 -8
- package/dist/types/cli/memory-coordinator.d.ts +1 -13
- package/dist/types/cli/product-acp-params.d.ts +1 -0
- package/dist/types/cli/provider-core-facade.d.ts +2 -30
- package/dist/types/cli/rpc-registry.d.ts +2 -4
- package/dist/types/cli/runtime-hook-bootstrap.d.ts +1 -2
- package/dist/types/cli/stdio-acp-request-host.d.ts +1 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +0 -2
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -7
- package/dist/types/cli/stdio-runtime-services.d.ts +1 -8
- package/dist/types/cli/stdio-server.d.ts +0 -4
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +0 -4
- package/dist/types/cli/tool-bootstrap.d.ts +0 -17
- package/dist/types/contracts/memory-recall-packet.d.ts +31 -0
- package/dist/types/contracts/memory-response-contract.d.ts +2 -0
- package/dist/types/contracts/tool-execution-evidence.d.ts +8 -0
- package/dist/types/contracts/tool-name.d.ts +10 -0
- package/dist/types/contracts/turn-event.d.ts +36 -3
- package/dist/types/host-contract/acp-content.d.ts +45 -0
- package/dist/types/host-contract/index.d.ts +65 -48
- package/dist/types/orchestration/agent-instance.d.ts +21 -1
- package/dist/types/orchestration/agent-roster.d.ts +14 -15
- package/dist/types/orchestration/dag-scheduler.d.ts +4 -0
- package/dist/types/orchestration/goal-context-envelope.d.ts +7 -0
- package/dist/types/orchestration/goal-loop-coordinator.d.ts +55 -12
- package/dist/types/orchestration/goal-mode-adapters.d.ts +13 -1
- package/dist/types/orchestration/goal-run-persistence.d.ts +9 -2
- package/dist/types/orchestration/goal-run-types.d.ts +127 -13
- package/dist/types/orchestration/index.d.ts +1 -1
- package/dist/types/orchestration/product-persistence.d.ts +10 -1
- package/dist/types/orchestration/product-planner.d.ts +3 -3
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +1 -0
- package/dist/types/orchestration/workflow/data-item.d.ts +1 -1
- package/dist/types/orchestration/workflow/expression.d.ts +1 -2
- package/dist/types/orchestration/workflow/workflow-patch.d.ts +1 -2
- package/dist/types/orchestration/workflow/workflow-render.d.ts +1 -2
- package/dist/types/project-memory-host.d.ts +1 -0
- package/dist/types/protocol/agent-contract.d.ts +10 -8
- package/dist/types/protocol/methods.d.ts +2 -19
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +48 -6
- package/dist/types/protocol/wire/acp-protocol.d.ts +11 -24
- package/dist/types/protocol/wire/agent-methods.d.ts +5 -142
- package/dist/types/protocol/wire/chat-types.d.ts +50 -0
- package/dist/types/protocol/wire/index.d.ts +2 -2
- package/dist/types/protocol/wire/notification-payloads.d.ts +73 -122
- package/dist/types/protocol/wire/thread-protocol.d.ts +4 -40
- package/dist/types/runtime/community/community-consent-client.d.ts +0 -13
- package/dist/types/runtime/context/context-compression-strategies.d.ts +29 -0
- package/dist/types/runtime/context/context-envelope.d.ts +3 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +4 -5
- package/dist/types/runtime/execution/mcp-capability-selection.d.ts +54 -0
- package/dist/types/runtime/execution/memory-decay.d.ts +1 -1
- package/dist/types/runtime/execution/search-result-quality.d.ts +22 -0
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +2 -0
- package/dist/types/runtime/execution/tool-result-storage.d.ts +44 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +3 -2
- package/dist/types/runtime/infra/agent-paths.d.ts +0 -8
- package/dist/types/runtime/infra/default-path-service.d.ts +0 -2
- package/dist/types/runtime/infra/llmrouter-managed-inference.d.ts +54 -1
- package/dist/types/runtime/infra/media-persistence.d.ts +6 -36
- package/dist/types/runtime/memory/implicit-extraction.d.ts +7 -15
- package/dist/types/runtime/memory/memory-recall-attribution.d.ts +24 -0
- package/dist/types/runtime/ports/agent-runtime-ports.d.ts +14 -0
- package/dist/types/runtime/ports/index.d.ts +1 -3
- package/dist/types/runtime/ports/memory-provider.d.ts +2 -19
- package/dist/types/runtime/ports/memory-writer.d.ts +1 -1
- package/dist/types/runtime/ports/path-service.d.ts +0 -2
- package/dist/types/runtime/prompt/capability-routing-policy.d.ts +13 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +3 -6
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +8 -13
- package/dist/types/runtime/prompt/tool-necessity-policy.d.ts +12 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +29 -4
- package/dist/types/skills/memory/host-memory-provider.d.ts +3 -9
- package/dist/types/skills/memory/memdir.d.ts +1 -1
- package/dist/types/skills/memory/memory-content-safety.d.ts +1 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +3 -3
- package/dist/types/skills/portable-tool.d.ts +5 -0
- package/dist/types/skills/skill-system/skill-lifecycle.d.ts +1 -0
- package/dist/types/skills/tools/exec-tool.d.ts +1 -5
- package/dist/types/skills/tools/shell/command-compatibility.d.ts +3 -0
- package/dist/types/skills/tools/shell/index.d.ts +4 -3
- package/dist/types/skills/tools/shell/shell-exec.d.ts +15 -8
- package/dist/types/skills/tools/shell/shell-provider.d.ts +26 -0
- package/dist/types/transport/acp-server.d.ts +4 -1
- package/dist/types/transport/host-community-client.d.ts +0 -1
- package/dist/types/transport/host-request-client.d.ts +1 -0
- package/dist/types/transport/host-run-state-client.d.ts +1 -1
- package/dist/workflow-host.js +6 -6
- package/package.json +4 -3
- package/dist/skills/mcp/astraclaw-native-mcp-server.js +0 -12
- package/dist/types/cli/core-tools/checkpoint-tool-bootstrap.d.ts +0 -9
- package/dist/types/cli/core-tools/checkpoint-tool-service.d.ts +0 -7
- package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +0 -7
- package/dist/types/cli/core-tools/config-tool-service.d.ts +0 -13
- package/dist/types/cli/core-tools/monitor-tool-bootstrap.d.ts +0 -7
- package/dist/types/cli/core-tools/monitor-tool-service.d.ts +0 -6
- package/dist/types/cli/dev-tool-bootstrap.d.ts +0 -9
- package/dist/types/cli/dev-tools/dev-tool-bootstrap-service.d.ts +0 -7
- package/dist/types/cli/dev-tools/dev-tool-registry.d.ts +0 -8
- package/dist/types/cli/dev-tools/incremental-repo-map.d.ts +0 -81
- package/dist/types/cli/dev-tools/lsp-supervisor.d.ts +0 -59
- package/dist/types/cli/dev-tools/lsp-tool-service.d.ts +0 -7
- package/dist/types/cli/handlers/media-handler.d.ts +0 -19
- package/dist/types/cli/handlers/skills-handler.d.ts +0 -37
- package/dist/types/cli/industrial-runtime-store.d.ts +0 -16
- package/dist/types/cli/media-capability-schema.d.ts +0 -49
- package/dist/types/cli/media-file-api-service.d.ts +0 -73
- package/dist/types/cli/media-file-tool-service.d.ts +0 -13
- package/dist/types/cli/media-inline.d.ts +0 -31
- package/dist/types/cli/media-runtime-facade.d.ts +0 -51
- package/dist/types/cli/media-understanding.d.ts +0 -102
- package/dist/types/cli/skill-invocation-service.d.ts +0 -10
- package/dist/types/cli/skill-tools-bootstrap.d.ts +0 -35
- package/dist/types/cli/skills-query-service.d.ts +0 -41
- package/dist/types/cli/tool-bootstrap-media-registration.d.ts +0 -20
- package/dist/types/cli/turn-media-setup.d.ts +0 -34
- package/dist/types/cli/turn-preview-browser-setup.d.ts +0 -15
- package/dist/types/runtime/infra/astraclaw-capabilities.d.ts +0 -33
- package/dist/types/runtime/infra/builtin-skills-seed.d.ts +0 -31
- package/dist/types/runtime/infra/checkpoint-backend.d.ts +0 -9
- package/dist/types/runtime/infra/industrial-runtime-session-server.d.ts +0 -20
- package/dist/types/runtime/infra/migrate-project-skills.d.ts +0 -24
- package/dist/types/runtime/infra/project-skill-manifest.d.ts +0 -21
- package/dist/types/runtime/infra/skill-resolver.d.ts +0 -74
- package/dist/types/runtime/infra/worktree-backend.d.ts +0 -86
- package/dist/types/runtime/ports/checkpoint-contracts.d.ts +0 -19
- package/dist/types/runtime/ports/worktree-contracts.d.ts +0 -22
- package/dist/types/skills/mcp/astraclaw-native-mcp-server.d.ts +0 -1
- package/dist/types/skills/memory/memory-tool.d.ts +0 -87
- package/dist/types/skills/tools/checkpoint-tool.d.ts +0 -66
- package/dist/types/skills/tools/config-tool.d.ts +0 -61
- package/dist/types/skills/tools/file-management-tool.d.ts +0 -90
- package/dist/types/skills/tools/image-generate-tool.d.ts +0 -98
- package/dist/types/skills/tools/instructions-tool.d.ts +0 -65
- package/dist/types/skills/tools/lsp-tool.d.ts +0 -153
- package/dist/types/skills/tools/media-cancel-tool.d.ts +0 -30
- package/dist/types/skills/tools/media-understand-tool.d.ts +0 -28
- package/dist/types/skills/tools/monitor-tool.d.ts +0 -113
- package/dist/types/skills/tools/music-generate-tool.d.ts +0 -80
- package/dist/types/skills/tools/notebook-edit-tool.d.ts +0 -15
- package/dist/types/skills/tools/preview-browser-tool.d.ts +0 -136
- package/dist/types/skills/tools/repo-map-tool.d.ts +0 -52
- package/dist/types/skills/tools/skill-tool.d.ts +0 -142
- package/dist/types/skills/tools/sleep-tool.d.ts +0 -49
- package/dist/types/skills/tools/stt-tool.d.ts +0 -33
- package/dist/types/skills/tools/subagent-decision-tool.d.ts +0 -15
- package/dist/types/skills/tools/three-d-generate-tool.d.ts +0 -46
- package/dist/types/skills/tools/tts-tool.d.ts +0 -50
- package/dist/types/skills/tools/video-edit-tool.d.ts +0 -72
- package/dist/types/skills/tools/video-generate-tool.d.ts +0 -162
- package/dist/types/skills/tools/video-merge-tool.d.ts +0 -105
- package/dist/types/skills/tools/video-upscale-tool.d.ts +0 -45
- package/dist/types/skills/tools/voice-clone-tool.d.ts +0 -40
- package/dist/types/skills/tools/worktree-tool.d.ts +0 -69
|
@@ -18,9 +18,7 @@ export declare class DefaultPathService implements PathService {
|
|
|
18
18
|
getOwnerProfileDir(ownerUserId?: string): string;
|
|
19
19
|
getProfileMemoryDir(ownerUserId?: string): string;
|
|
20
20
|
getUserSettingsPath(): string;
|
|
21
|
-
getUserSkillsDir(): string;
|
|
22
21
|
getUserPluginsDir(): string;
|
|
23
|
-
getUserMcpConfigPath(): string;
|
|
24
22
|
getUserPluginCacheDir(): string;
|
|
25
23
|
getUserMarketplaceConfigPath(): string;
|
|
26
24
|
getProjectAgentDir(projectRoot?: string): string;
|
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
import type { ConfigPort } from "../ports/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* One registered plan-grant product: a fixed local path and the fixed upstream
|
|
4
|
+
* path it maps to.
|
|
5
|
+
*/
|
|
6
|
+
export interface PlanGrantDomain {
|
|
7
|
+
readonly domain: string;
|
|
8
|
+
readonly proxyPath: string;
|
|
9
|
+
readonly upstreamPath: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The plan-grant products this runtime proxies, and nothing else.
|
|
13
|
+
*
|
|
14
|
+
* A table, not a generic proxy. Each entry is a pair of constants, and there is
|
|
15
|
+
* deliberately no entry point that accepts a `domain` argument: that would turn
|
|
16
|
+
* path-level isolation into field-level isolation and let the caller choose the
|
|
17
|
+
* upstream target through a request field. Adding a product means adding a row
|
|
18
|
+
* here, and the four places that used to name each product one by one — route
|
|
19
|
+
* resolution, content-type validation, the request path type and the timeout
|
|
20
|
+
* rule — all read from this table.
|
|
21
|
+
*
|
|
22
|
+
* Mirrors `qllm/plan_grants/registry.py` on the llmrouter side. The two must
|
|
23
|
+
* agree: a row here with no upstream route proxies to a 404. As of this
|
|
24
|
+
* change llmrouter registers `easyeda` but has not yet mounted its router
|
|
25
|
+
* (`qllm/ext/easyeda_router.py` does not exist), so that row forwards to a 404
|
|
26
|
+
* until the endpoint ships. The row is correct and deliberate -- the proxy is
|
|
27
|
+
* not the thing gating easyeda -- but nothing here should be read as evidence
|
|
28
|
+
* that the upstream endpoint works.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PLAN_GRANT_DOMAINS: readonly [{
|
|
31
|
+
readonly domain: "cad";
|
|
32
|
+
readonly proxyPath: "/v1/runtime-session/llmrouter/cad/plan-grants";
|
|
33
|
+
readonly upstreamPath: "/v1/cad/plan-grants";
|
|
34
|
+
}, {
|
|
35
|
+
readonly domain: "solidworks";
|
|
36
|
+
readonly proxyPath: "/v1/runtime-session/llmrouter/solidworks/plan-grants";
|
|
37
|
+
readonly upstreamPath: "/v1/solidworks/plan-grants";
|
|
38
|
+
}, {
|
|
39
|
+
readonly domain: "easyeda";
|
|
40
|
+
readonly proxyPath: "/v1/runtime-session/llmrouter/easyeda/plan-grants";
|
|
41
|
+
readonly upstreamPath: "/v1/easyeda/plan-grants";
|
|
42
|
+
}];
|
|
43
|
+
/** Upstream paths the table registers. A closed union, not a template. */
|
|
44
|
+
export type PlanGrantUpstreamPath = (typeof PLAN_GRANT_DOMAINS)[number]["upstreamPath"];
|
|
45
|
+
/** Whether a path is a registered plan-grant path. */
|
|
46
|
+
export declare function isPlanGrantUpstreamPath(path: string): path is PlanGrantUpstreamPath;
|
|
47
|
+
/**
|
|
48
|
+
* The registered product a local URL addresses, if any.
|
|
49
|
+
*
|
|
50
|
+
* Matches the whole path exactly. No prefix matching and no path segment is
|
|
51
|
+
* ever taken from the request: an unregistered URL returns undefined and is
|
|
52
|
+
* refused by the caller rather than forwarded.
|
|
53
|
+
*/
|
|
54
|
+
export declare function planGrantDomainForProxyPath(url: string | undefined): (typeof PLAN_GRANT_DOMAINS)[number] | undefined;
|
|
2
55
|
export interface ManagedInferenceRequest {
|
|
3
|
-
path: "/v1/models" | "/v1/files" | `/v1/files/${string}` |
|
|
56
|
+
path: "/v1/models" | "/v1/files" | `/v1/files/${string}` | PlanGrantUpstreamPath;
|
|
4
57
|
method: "GET" | "POST" | "DELETE";
|
|
5
58
|
contentType?: string;
|
|
6
59
|
body?: AsyncIterable<Uint8Array>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MediaPersistence —
|
|
2
|
+
* MediaPersistence — persist generic inline/temporary tool artifacts.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* This helper is limited to projected-tool inline image blocks and exec-created temporary
|
|
5
|
+
* artifacts. Runtime Host owns generation providers, generated-media persistence, publication,
|
|
6
|
+
* explicit output paths, and all `astraclaw_media` MCP results.
|
|
7
7
|
*
|
|
8
8
|
* Storage layout:
|
|
9
9
|
* <project>/assets/images/image_20260520_143022_abc.png
|
|
@@ -12,12 +12,9 @@
|
|
|
12
12
|
* <project>/assets/models/ <project>/assets/files/
|
|
13
13
|
*
|
|
14
14
|
* 产出归项目工作区可见的 assets/ 目录(按类型分),项目级、所有会话共享 —— 文件树可见可
|
|
15
|
-
* 管理。文件名带时间戳+随机后缀保证多会话不冲突。
|
|
15
|
+
* 管理。文件名带时间戳+随机后缀保证多会话不冲突。
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* Called from the tool result pipeline in tool-loop.ts.
|
|
19
|
-
* When a tool result's `details.mediaUrls` contains URLs,
|
|
20
|
-
* each URL is downloaded and the local path is added to details.
|
|
17
|
+
* It does not inspect or materialize `details.mediaUrls`.
|
|
21
18
|
*/
|
|
22
19
|
export interface MediaDownloadResult {
|
|
23
20
|
/** Original cloud URL. */
|
|
@@ -28,10 +25,6 @@ export interface MediaDownloadResult {
|
|
|
28
25
|
bytes: number;
|
|
29
26
|
/** MIME type (from Content-Type header). */
|
|
30
27
|
mimeType: string;
|
|
31
|
-
/** First bytes of the saved file as uppercase hex pairs. */
|
|
32
|
-
headerHex?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface MediaSaveResult extends MediaDownloadResult {
|
|
35
28
|
}
|
|
36
29
|
export interface MediaPersistenceConfig {
|
|
37
30
|
/**
|
|
@@ -73,29 +66,6 @@ export declare class MediaPersistence {
|
|
|
73
66
|
type?: string;
|
|
74
67
|
sessionId?: string;
|
|
75
68
|
}): Promise<MediaDownloadResult>;
|
|
76
|
-
/**
|
|
77
|
-
* Download multiple URLs. Returns results for successful downloads.
|
|
78
|
-
* Failed downloads are logged but don't throw.
|
|
79
|
-
*/
|
|
80
|
-
downloadAll(urls: string[], hint?: {
|
|
81
|
-
type?: string;
|
|
82
|
-
sessionId?: string;
|
|
83
|
-
}, log?: {
|
|
84
|
-
warn: (msg: string) => void;
|
|
85
|
-
}): Promise<MediaDownloadResult[]>;
|
|
86
|
-
/**
|
|
87
|
-
* Persist generated media to caller-requested artifact paths.
|
|
88
|
-
*
|
|
89
|
-
* This complements project-level archival downloads: generated assets remain
|
|
90
|
-
* previewable in assets/images, while explicit user deliverables are also
|
|
91
|
-
* written to their requested paths.
|
|
92
|
-
*/
|
|
93
|
-
saveAllToPaths(urls: string[], outputPaths: string[], hint?: {
|
|
94
|
-
type?: string;
|
|
95
|
-
sessionId?: string;
|
|
96
|
-
}, log?: {
|
|
97
|
-
warn: (msg: string) => void;
|
|
98
|
-
}): Promise<MediaSaveResult[]>;
|
|
99
69
|
/** Get the project-level assets root (<project>/assets). */
|
|
100
70
|
getMediaDir(): string;
|
|
101
71
|
/** Get the project directory (for testing/inspection). */
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Implicit Memory Extraction — CC extractMemories lightweight port.
|
|
3
3
|
*
|
|
4
4
|
* Architecture:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* - Lightweight LLM pass (async, non-blocking) extracts structured facts
|
|
6
|
+
* - Host validates and commits atomic claims through the canonical evidence chain
|
|
7
7
|
*
|
|
8
8
|
* This runs AFTER turn.end, so the user already has their response.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Every completed user turn is eligible for the bounded learned pass. If the
|
|
10
|
+
* model is unavailable or cannot produce a valid structured claim, extraction
|
|
11
|
+
* fails closed without creating an unstructured memory.
|
|
12
12
|
*
|
|
13
13
|
* Reference: claude-code src/services/extractMemories/extractMemories.ts
|
|
14
14
|
*/
|
|
@@ -57,17 +57,9 @@ export interface TurnPair {
|
|
|
57
57
|
assistantMessage: string;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* Zero LLM cost — pure regex scanning.
|
|
62
|
-
*
|
|
63
|
-
* @returns true if the message likely contains extractable personal facts/events
|
|
64
|
-
*/
|
|
65
|
-
export declare function hasExtractionSignal(userMessage: string): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Layer 2: Use a lightweight LLM to extract structured facts from a turn pair.
|
|
68
|
-
* Only called when Layer 1 signals are detected.
|
|
60
|
+
* Use a lightweight LLM to extract structured facts from a turn pair.
|
|
69
61
|
*/
|
|
70
|
-
export declare function extractFactsViaLlm(turn: TurnPair, llmExtract: (prompt: string) => Promise<string | null>, today: string, onDiagnostic?: (message: string) => void): Promise<ExtractedFact[]>;
|
|
62
|
+
export declare function extractFactsViaLlm(turn: TurnPair, llmExtract: (prompt: string) => Promise<string | null>, today: string, onDiagnostic?: (message: string) => void, existingClaims?: readonly ExtractedFact[]): Promise<ExtractedFact[]>;
|
|
71
63
|
/**
|
|
72
64
|
* Run the full implicit extraction pipeline for a completed turn.
|
|
73
65
|
* This is async and non-blocking — call it after turn.end.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type MemoryRecallUsage = "used" | "not_used" | "uncertain";
|
|
2
|
+
export type MemoryRecallEffect = "helpful" | "neutral" | "harmful" | "uncertain";
|
|
3
|
+
export interface MemoryRecallAttribution {
|
|
4
|
+
usage: MemoryRecallUsage;
|
|
5
|
+
effect: MemoryRecallEffect;
|
|
6
|
+
usedMemoryIds: string[];
|
|
7
|
+
rationale: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MemoryRecallAttributionInput {
|
|
10
|
+
query: string;
|
|
11
|
+
response: string;
|
|
12
|
+
memories: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
content: string;
|
|
15
|
+
recallPacket?: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds a background semantic-assessment task. This deliberately asks for
|
|
20
|
+
* causal use of evidence rather than lexical overlap, so paraphrases and
|
|
21
|
+
* repeated topic words do not become fabricated positive feedback.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildMemoryRecallAttributionPrompt(input: MemoryRecallAttributionInput): string;
|
|
24
|
+
export declare function parseMemoryRecallAttribution(raw: string | null | undefined): MemoryRecallAttribution | null;
|
|
@@ -38,6 +38,8 @@ export interface StreamingToolExecutorPortConfig {
|
|
|
38
38
|
executionTimeoutMsByTool?: ReadonlyMap<string, number>;
|
|
39
39
|
/** Turn workspace/cwd — routes oversized tool-result spillover to the session's reachable data dir. */
|
|
40
40
|
projectRoot?: string;
|
|
41
|
+
/** Opaque per-turn typed context budget and skill-readiness state. */
|
|
42
|
+
contextState?: unknown;
|
|
41
43
|
}
|
|
42
44
|
export interface ContextCompressionEnginePort {
|
|
43
45
|
compressAsync(messages: RuntimeCompressibleMessage[], budget: number, context: {
|
|
@@ -56,6 +58,18 @@ export interface ToolLoopRuntimePorts {
|
|
|
56
58
|
newlyReplacedCount: number;
|
|
57
59
|
newlyPersistedBytes?: number;
|
|
58
60
|
}>;
|
|
61
|
+
restoreRequiredContextMessages?(messagesBefore: Array<{
|
|
62
|
+
role: string;
|
|
63
|
+
content?: string | unknown;
|
|
64
|
+
tool_call_id?: string;
|
|
65
|
+
}>, messagesAfter: Array<{
|
|
66
|
+
role: string;
|
|
67
|
+
content?: string | unknown;
|
|
68
|
+
tool_call_id?: string;
|
|
69
|
+
}>, state: unknown): {
|
|
70
|
+
messages: unknown[];
|
|
71
|
+
recoveredCount: number;
|
|
72
|
+
};
|
|
59
73
|
getActiveContextCompressionEngine(): ContextCompressionEnginePort | null;
|
|
60
74
|
compressMessages(messages: RuntimeCompressibleMessage[], options: {
|
|
61
75
|
budget: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { MemoryExtractionQueue, MemoryWriter, MemoryWriteMetadata, } from "./memory-writer.js";
|
|
2
2
|
export type { MemoryRecallSource } from "./memory-recall-source.js";
|
|
3
|
-
export type { MemoryProvider, MemorySearchOptions, MemorySearchResult, MemoryIngestOptions, MemoryExtractionItem, MemoryConsolidationWriteResult, MemoryLearningSink,
|
|
3
|
+
export type { MemoryProvider, MemorySearchOptions, MemorySearchResult, MemoryIngestOptions, MemoryExtractionItem, MemoryConsolidationWriteResult, MemoryLearningSink, MemoryActivitySummary, MemoryAtlasRecord, MemoryAtlasResult, MemoryUpdatePatch, MemoryHandlerProvider, MemoryDreamProvider, MemoryDecayProvider, MemoryRuntimeHookProvider, MemoryDreamRuntimeProvider, } from "./memory-provider.js";
|
|
4
4
|
export type { PathService } from "./path-service.js";
|
|
5
5
|
export type { ConfigPort } from "./config-port.js";
|
|
6
6
|
export { createRecordConfigPort } from "./config-port.js";
|
|
@@ -9,8 +9,6 @@ export type { ApprovalRequest, ApprovalResponse, PermissionApprovalResolver, Per
|
|
|
9
9
|
export type { ProjectMemoryFileInfo, ProjectMemoryResult, ProjectMemoryStore, ProjectMemoryStoreFactory, } from "./project-memory-store.js";
|
|
10
10
|
export type { RuntimeToolContract, ToolBootstrap, ToolBootstrapConfig, ToolBootstrapProvider, ToolBootstrapProviderContext, ToolBootstrapProgress, ToolCatalog, ToolRegistrationModule, ToolRegistrationModuleKind, } from "./tool-contracts.js";
|
|
11
11
|
export { defineToolRegistrationModule } from "./tool-contracts.js";
|
|
12
|
-
export type { Checkpoint, CheckpointBackend, CheckpointResult } from "./checkpoint-contracts.js";
|
|
13
|
-
export type { WorktreeBackend, WorktreeInfo, WorktreeResult } from "./worktree-contracts.js";
|
|
14
12
|
export { buildToolResultMessage, type OpenAiToolCall, type ToolResultMessageInput } from "./tool-call-contracts.js";
|
|
15
13
|
export type { AgentLogger, AgentRunRequest, ChatMessage, ForkedAgentRunner, ForkedAgentRunnerFactory, HookRegistry, TokenUsage, ToolDefinition, ToolInvoker, TurnEvent, } from "./agent-execution-contracts.js";
|
|
16
14
|
export type { AccumulatedToolCall, LLMChunk, LLMRequest, LLMTransport, } from "./model-transport-contracts.js";
|
|
@@ -44,11 +44,12 @@ export interface MemoryExtractionItem {
|
|
|
44
44
|
};
|
|
45
45
|
/** Ids of already-uploaded attachments to link to this memory on commit. */
|
|
46
46
|
attachmentIds?: string[];
|
|
47
|
-
/** Evidence trail
|
|
47
|
+
/** Evidence audit trail: source refs, optional verbatim quote, and a crash-safe dedup key. */
|
|
48
48
|
evidence?: {
|
|
49
49
|
kind: string;
|
|
50
50
|
refs: string[];
|
|
51
51
|
idempotencyKey: string;
|
|
52
|
+
quote?: string;
|
|
52
53
|
};
|
|
53
54
|
/** The source turn explicitly retracts or replaces an earlier decision. */
|
|
54
55
|
correction?: boolean;
|
|
@@ -73,28 +74,11 @@ export interface MemoryConsolidationWriteResult {
|
|
|
73
74
|
export interface MemoryProvider {
|
|
74
75
|
readonly providerId: string;
|
|
75
76
|
search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
|
|
76
|
-
addText?(text: string, userId: string, options?: MemoryIngestOptions): Promise<{
|
|
77
|
-
memoriesAdded: number;
|
|
78
|
-
}>;
|
|
79
77
|
remove?(memoryId: string): Promise<boolean>;
|
|
80
78
|
}
|
|
81
79
|
export interface MemoryLearningSink {
|
|
82
80
|
ingestExtracted(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
83
81
|
}
|
|
84
|
-
export interface MemoryToolLocalProvider {
|
|
85
|
-
addText(text: string, userId: string, metadata?: MemoryIngestOptions & {
|
|
86
|
-
category?: string;
|
|
87
|
-
importance?: number;
|
|
88
|
-
}): Promise<unknown>;
|
|
89
|
-
/** B3(X7)异步化:Host 契约方法(host 模式经 x/host.request 跨进程)。 */
|
|
90
|
-
synthesizeTimeline(userId: string, startMs: number, endMs: number): Promise<string>;
|
|
91
|
-
feedback(ids: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong", context?: {
|
|
92
|
-
sessionId?: string;
|
|
93
|
-
silent?: boolean;
|
|
94
|
-
}): Promise<{
|
|
95
|
-
affected: number;
|
|
96
|
-
}>;
|
|
97
|
-
}
|
|
98
82
|
export interface MemoryActivitySummary {
|
|
99
83
|
dailyCounts: Array<{
|
|
100
84
|
date: string;
|
|
@@ -232,5 +216,4 @@ export interface MemoryDecayProvider {
|
|
|
232
216
|
}>;
|
|
233
217
|
}
|
|
234
218
|
export type MemoryRuntimeHookProvider = MemoryProvider & MemoryWriter;
|
|
235
|
-
export type MemoryToolProvider = MemoryProvider & MemoryToolLocalProvider;
|
|
236
219
|
export type MemoryDreamRuntimeProvider = MemoryDreamProvider & MemoryDecayProvider;
|
|
@@ -26,12 +26,12 @@ export interface MemoryWriterExtractionItem {
|
|
|
26
26
|
kind: string;
|
|
27
27
|
refs: string[];
|
|
28
28
|
idempotencyKey: string;
|
|
29
|
+
quote?: string;
|
|
29
30
|
};
|
|
30
31
|
/** The source turn explicitly retracts or replaces an earlier decision. */
|
|
31
32
|
correction?: boolean;
|
|
32
33
|
}
|
|
33
34
|
export interface MemoryWriter {
|
|
34
|
-
addText(text: string, userId: string, metadata?: MemoryWriteMetadata): Promise<unknown>;
|
|
35
35
|
ingestExtracted?(items: MemoryWriterExtractionItem[], userId: string, metadata?: MemoryWriteMetadata): Promise<{
|
|
36
36
|
memoriesAdded?: number;
|
|
37
37
|
items?: Array<{
|
|
@@ -17,9 +17,7 @@ export interface PathService {
|
|
|
17
17
|
getOwnerProfileDir(ownerUserId?: string): string;
|
|
18
18
|
getProfileMemoryDir(ownerUserId?: string): string;
|
|
19
19
|
getUserSettingsPath(): string;
|
|
20
|
-
getUserSkillsDir(): string;
|
|
21
20
|
getUserPluginsDir(): string;
|
|
22
|
-
getUserMcpConfigPath(): string;
|
|
23
21
|
getUserPluginCacheDir(): string;
|
|
24
22
|
getUserMarketplaceConfigPath(): string;
|
|
25
23
|
getProjectAgentDir(projectRoot?: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FreshWorkspaceEvidencePolicy } from "./fresh-workspace-evidence.js";
|
|
2
|
+
export type CapabilityRoutingOwner = "structured-planner" | "direct-response" | "mcp-capability" | "typed-builtin" | "pinned-skill" | "host-skill-discovery";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves exclusive capability ownership before any semantic Skill classification.
|
|
5
|
+
* A lower-specificity route must never steal a turn already owned by a typed policy.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveCapabilityRoutingOwner(input: {
|
|
8
|
+
structuredPlannerTurn: boolean;
|
|
9
|
+
directResponse: boolean;
|
|
10
|
+
mcpCapabilitySelection: boolean;
|
|
11
|
+
freshEvidencePolicy: FreshWorkspaceEvidencePolicy;
|
|
12
|
+
pinnedSkillCount: number;
|
|
13
|
+
}): CapabilityRoutingOwner;
|
|
@@ -90,13 +90,10 @@ export declare function createToolGuidanceSection(): SystemPromptSection;
|
|
|
90
90
|
*/
|
|
91
91
|
export declare function createLanguageSection(language?: string): SystemPromptSection;
|
|
92
92
|
/**
|
|
93
|
-
* Available Skills —
|
|
94
|
-
*
|
|
95
|
-
* skill via skill_view BEFORE acting — even when the user did not name it. This is the link that
|
|
96
|
-
* makes installed skills actually auto-activate; without it active skills only sit behind the
|
|
97
|
-
* skill_view tool as a passive catalog and never fire on their own.
|
|
93
|
+
* Available Skills — Host-owned discovery. qlogicagent advertises only the projected MCP workflow;
|
|
94
|
+
* it does not scan, parse, cache, or read the Host Skill store.
|
|
98
95
|
*/
|
|
99
|
-
export declare function createAvailableSkillsSection(
|
|
96
|
+
export declare function createAvailableSkillsSection(availableToolNames?: string[]): SystemPromptSection;
|
|
100
97
|
/**
|
|
101
98
|
* Detect the response language from the user's current-turn text so the strong
|
|
102
99
|
* explicit-language branch of createLanguageSection actually fires.
|
|
@@ -14,23 +14,18 @@ export interface FreshWorkspaceEvidencePolicy {
|
|
|
14
14
|
reason?: "file-read" | "memory-mutation" | "media-generation" | "media-understanding" | "directory-list" | "content-search" | "shell" | "web";
|
|
15
15
|
mediaKind?: "image" | "video" | "tts" | "music";
|
|
16
16
|
allowedToolNames: string[];
|
|
17
|
+
/** When true, the typed route is an execution boundary rather than prompt guidance. */
|
|
18
|
+
enforceAllowedToolNames?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
|
|
19
21
|
export declare function isLightweightChatTurn(messages: readonly PromptMessageLike[] | string): boolean;
|
|
20
22
|
export declare function isExplicitNoToolTurn(messages: readonly PromptMessageLike[] | string): boolean;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* `skill_view` belongs here for the same reason: it is the capability-invocation
|
|
28
|
-
* primitive, and the `# Available Skills` section tells the model to call it.
|
|
29
|
-
* Stripping `skill_view` on a file/mutation/shell turn (i.e. almost every real task)
|
|
30
|
-
* makes that instruction impossible to follow — the model cannot call a tool it
|
|
31
|
-
* was never given — which was the entire "skills never self-activate" bug.
|
|
32
|
-
* (skills_list / skill_manage are not load-bearing for self-activation, so they
|
|
33
|
-
* stay subject to the normal evidence filter.)
|
|
24
|
+
* Apply a hard allowlist only for deterministic Host-owned operations such as
|
|
25
|
+
* media generation/understanding. Other evidence policies keep the complete
|
|
26
|
+
* turn surface so ordinary engineering and orchestration work is not narrowed
|
|
27
|
+
* merely because its wording resembles an evidence request. Namespaced Host
|
|
28
|
+
* tools are matched by their local MCP tool name.
|
|
34
29
|
*/
|
|
35
30
|
export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolNameLike>(tools: readonly TTool[], policy: FreshWorkspaceEvidencePolicy): TTool[];
|
|
36
31
|
/**
|
|
@@ -40,4 +35,4 @@ export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolName
|
|
|
40
35
|
* misfired on quoted/reported speech ("he said don't use tools").
|
|
41
36
|
*/
|
|
42
37
|
export declare function createExplicitNoToolNoticeSection(): SystemPromptSection;
|
|
43
|
-
export declare function createFreshWorkspaceEvidenceSection(policy: FreshWorkspaceEvidencePolicy): SystemPromptSection | null;
|
|
38
|
+
export declare function createFreshWorkspaceEvidenceSection(policy: FreshWorkspaceEvidencePolicy, availableToolNames?: readonly string[]): SystemPromptSection | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FreshWorkspaceEvidencePolicy } from "./fresh-workspace-evidence.js";
|
|
2
|
+
/**
|
|
3
|
+
* Typed, conservative pre-tool routing for requests whose complete input is already
|
|
4
|
+
* present in the latest user message. This is intentionally an operation taxonomy,
|
|
5
|
+
* not a benchmark phrase list: every admitted class is closed over supplied text or
|
|
6
|
+
* scalar values and therefore cannot gain correctness from filesystem, shell or MCP.
|
|
7
|
+
*/
|
|
8
|
+
export interface ToolNecessityPolicy {
|
|
9
|
+
mode: "model-tools" | "direct-response";
|
|
10
|
+
reason?: "scalar-computation" | "text-transformation" | "structured-data-inspection" | "inline-classification" | "url-component-extraction";
|
|
11
|
+
}
|
|
12
|
+
export declare function resolveToolNecessityPolicy(text: string, evidencePolicy: FreshWorkspaceEvidencePolicy): ToolNecessityPolicy;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ServerToolInfo } from "mcporter";
|
|
1
2
|
import type { PortableTool, PortableToolResult } from "../portable-tool.js";
|
|
2
3
|
interface ToolRegistryLike {
|
|
3
4
|
addTools(tools: PortableTool[]): void;
|
|
@@ -38,7 +39,7 @@ export interface McpSecurityIssue {
|
|
|
38
39
|
message: string;
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
|
-
* A configured server that is
|
|
42
|
+
* A configured server that is not currently serving tools. Surfaced (not just logged)
|
|
42
43
|
* so capability queries (e.g. mcp_connectors_list) can disclose "configured but unavailable"
|
|
43
44
|
* instead of the server silently vanishing from the tool pool.
|
|
44
45
|
*/
|
|
@@ -75,7 +76,9 @@ export declare class McpManager {
|
|
|
75
76
|
private runtime;
|
|
76
77
|
private definitions;
|
|
77
78
|
private toolsByServer;
|
|
79
|
+
private refreshAllPromise;
|
|
78
80
|
private injectedNames;
|
|
81
|
+
private injectedNamesByServer;
|
|
79
82
|
private log;
|
|
80
83
|
private workspaceRoot?;
|
|
81
84
|
private toolCatalog?;
|
|
@@ -84,7 +87,7 @@ export declare class McpManager {
|
|
|
84
87
|
private serverCallTimeouts;
|
|
85
88
|
private failedServers;
|
|
86
89
|
constructor(config: McpManagerConfig);
|
|
87
|
-
/** Record (and loudly report) a server that
|
|
90
|
+
/** Record (and loudly report) a server that is not currently serving tools. */
|
|
88
91
|
private markServerFailed;
|
|
89
92
|
private toServerDefinition;
|
|
90
93
|
/**
|
|
@@ -97,9 +100,18 @@ export declare class McpManager {
|
|
|
97
100
|
*/
|
|
98
101
|
injectTools(): void;
|
|
99
102
|
refreshServerTools(serverName: string): Promise<number>;
|
|
103
|
+
/**
|
|
104
|
+
* Refresh every configured server's live tool inventory at a turn boundary.
|
|
105
|
+
*
|
|
106
|
+
* Some MCP servers expose a dynamic tools/list result: their backing
|
|
107
|
+
* capabilities can become ready after the initial transport connection.
|
|
108
|
+
* Retain each server's last-good snapshot on a transient refresh failure,
|
|
109
|
+
* while applying successful additions/removals to the session catalog.
|
|
110
|
+
*/
|
|
111
|
+
refreshAllServerTools(): Promise<number>;
|
|
100
112
|
/** Get names of all connected servers. */
|
|
101
113
|
getConnectedServers(): string[];
|
|
102
|
-
/** Configured servers serving
|
|
114
|
+
/** Configured servers not currently serving tools. */
|
|
103
115
|
getFailedServers(): McpServerFailure[];
|
|
104
116
|
/** Get total number of MCP tools across all servers. */
|
|
105
117
|
getToolCount(): number;
|
|
@@ -115,6 +127,15 @@ export declare class McpManager {
|
|
|
115
127
|
private registerTools;
|
|
116
128
|
private removeRegisteredTool;
|
|
117
129
|
}
|
|
130
|
+
export declare function mcpFallbackToolTitle(serverName: string, toolName: string): string;
|
|
131
|
+
export declare function mcpPortableToolMetadata(serverName: string, mcpTool: ServerToolInfo): Pick<PortableTool, "name" | "label" | "description" | "semanticCapability" | "searchHint" | "isConcurrencySafe" | "isReadOnly" | "isDestructive" | "riskLevel" | "isEgress" | "egressCarriesData">;
|
|
132
|
+
/**
|
|
133
|
+
* MCP bridges may already expose a globally-scoped `{server}__{tool}` name.
|
|
134
|
+
* Prefixing that name again makes the model-facing function opaque and can push
|
|
135
|
+
* it past provider limits. Preserve that namespace, normalize it to the portable
|
|
136
|
+
* function-name alphabet, and bound it with a collision-resistant suffix.
|
|
137
|
+
*/
|
|
138
|
+
export declare function mcpPortableFunctionName(serverName: string, toolName: string): string;
|
|
118
139
|
/**
|
|
119
140
|
* Flatten an MCP CallToolResult into a text-bearing PortableToolResult.
|
|
120
141
|
* Non-text blocks (image/audio/resource…) cannot be dropped silently: content is
|
|
@@ -122,7 +143,11 @@ export declare class McpManager {
|
|
|
122
143
|
* "(no text output)" for a result that DID produce blocks is a lie.
|
|
123
144
|
* Exported for unit tests only.
|
|
124
145
|
*/
|
|
125
|
-
export declare function toPortableResult(result: unknown
|
|
146
|
+
export declare function toPortableResult(result: unknown, source?: {
|
|
147
|
+
serverName: string;
|
|
148
|
+
toolName: string;
|
|
149
|
+
args?: Record<string, unknown>;
|
|
150
|
+
}): PortableToolResult;
|
|
126
151
|
export declare function validateMcpToolWorkspaceBoundary(toolName: string, args: unknown, workspaceRoot: string | undefined): string | null;
|
|
127
152
|
export declare function parseMcpConfig(json: unknown): McpServerEntry[];
|
|
128
153
|
export declare function filterMcpTools<T extends {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* (HostRequestParams;wire 形态 = { service:"memory", method, params:<位置参数数组> })。
|
|
10
10
|
*
|
|
11
11
|
* 【PROXY 共享面(以 host-contract 常量为准;两仓照此表,一字不差)】
|
|
12
|
-
* search /
|
|
12
|
+
* search / embedText / ingestExtracted / proposeExtracted / consumePendingProposals /
|
|
13
13
|
* feedback / findRelatedEvents / synthesizeTimeline / getActivitySummary / getAllProfiles /
|
|
14
14
|
* setProfile / getAtlas / setMemoryArchived / triggerDecay / resolveConflicts
|
|
15
15
|
* [A9] 追加 listActiveMemoriesByTag(晋升扫描全量列举;无窗/无 clamp/无上限)。
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { HostMemoryExtractionTurnInput, HostPendingMemoryExtractionTurn, HostRequestParams } from "../../host-contract/index.js";
|
|
30
30
|
import type { CandidateStoreFile, ProcedureUsageStoreFile, PromotionStoreFile } from "./task-distillation.js";
|
|
31
|
-
import type { MemoryActivitySummary, MemoryAtlasResult, MemoryConsolidationWriteResult, MemoryDreamRuntimeProvider, MemoryExtractionItem, MemoryHandlerProvider, MemoryIngestOptions, MemoryLearningSink, MemoryExtractionQueue, MemoryRuntimeHookProvider, MemorySearchOptions, MemorySearchResult
|
|
31
|
+
import type { MemoryActivitySummary, MemoryAtlasResult, MemoryConsolidationWriteResult, MemoryDreamRuntimeProvider, MemoryExtractionItem, MemoryHandlerProvider, MemoryIngestOptions, MemoryLearningSink, MemoryExtractionQueue, MemoryRuntimeHookProvider, MemorySearchOptions, MemorySearchResult } from "../../runtime/ports/index.js";
|
|
32
32
|
/**
|
|
33
33
|
* 最小转发口(结构化契约,由 coordinator-owned HostRequestClient 满足)。
|
|
34
34
|
* 只取 request 一个方法:provider 不持有判活/连接生命周期(那归协议 coordinator/client)。
|
|
@@ -43,7 +43,7 @@ export interface HostMemoryProviderConfig {
|
|
|
43
43
|
/** x/host.request client; its service gate runs before send. */
|
|
44
44
|
client: HostRequestRequester;
|
|
45
45
|
}
|
|
46
|
-
export declare class HostMemoryProvider implements MemoryRuntimeHookProvider, MemoryExtractionQueue, MemoryLearningSink,
|
|
46
|
+
export declare class HostMemoryProvider implements MemoryRuntimeHookProvider, MemoryExtractionQueue, MemoryLearningSink, MemoryHandlerProvider, MemoryDreamRuntimeProvider {
|
|
47
47
|
private readonly config;
|
|
48
48
|
readonly providerId = "qmemory-host";
|
|
49
49
|
constructor(config: HostMemoryProviderConfig);
|
|
@@ -56,12 +56,6 @@ export declare class HostMemoryProvider implements MemoryRuntimeHookProvider, Me
|
|
|
56
56
|
/** 面外方法护栏:fail-loud,绝不静默回落本地(见文件头)。 */
|
|
57
57
|
private unproxied;
|
|
58
58
|
search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
|
|
59
|
-
addText(text: string, userId: string, options?: MemoryIngestOptions & {
|
|
60
|
-
category?: string;
|
|
61
|
-
importance?: number;
|
|
62
|
-
}): Promise<{
|
|
63
|
-
memoriesAdded: number;
|
|
64
|
-
}>;
|
|
65
59
|
/** R3 蒸馏签名 embedding(gateway 调 llmrouter 现算);null = 不可用,调用方降级不炸。 */
|
|
66
60
|
embedText(text: string, signal?: AbortSignal): Promise<number[] | null>;
|
|
67
61
|
ingestExtracted(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
@@ -31,7 +31,7 @@ export interface MemdirResult {
|
|
|
31
31
|
/** Current INDEX.md char usage */
|
|
32
32
|
indexUsage?: string;
|
|
33
33
|
}
|
|
34
|
-
export { isMemoryContentSafe } from "./memory-
|
|
34
|
+
export { isMemoryContentSafe } from "./memory-content-safety.js";
|
|
35
35
|
export declare class Memdir {
|
|
36
36
|
private readonly root;
|
|
37
37
|
constructor(projectRoot: string);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isMemoryContentSafe(text: string): boolean;
|
|
@@ -44,9 +44,9 @@ export interface PermissionCheckerDeps {
|
|
|
44
44
|
/** Getter for current turn ID (changes per turn). */
|
|
45
45
|
getTurnId?: () => string;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* headless/test checkers degrade to session-only memory.
|
|
47
|
+
* Ask the composition root to persist a directory allow-rule across restarts
|
|
48
|
+
* (user picked "始终允许此文件夹"). Storage ownership stays outside the
|
|
49
|
+
* permission checker; headless/test checkers degrade to session-only memory.
|
|
50
50
|
*/
|
|
51
51
|
persistPermissionRule?: (rule: {
|
|
52
52
|
pathPrefix: string;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Compatible with OpenAI / Anthropic content array format.
|
|
4
4
|
*/
|
|
5
5
|
import type { PermissionRiskLevel } from "../runtime/ports/index.js";
|
|
6
|
+
import type { SemanticToolCapability, ToolIdentity } from "../protocol/wire/index.js";
|
|
6
7
|
export interface ToolContentBlock {
|
|
7
8
|
type: "text" | "image";
|
|
8
9
|
text?: string;
|
|
@@ -51,6 +52,8 @@ export interface PortableToolResult {
|
|
|
51
52
|
export interface PortableTool<TParams = Record<string, unknown>> {
|
|
52
53
|
/** Unique tool name (e.g. "task", "memory"). */
|
|
53
54
|
name: string;
|
|
55
|
+
/** Canonical internal identity derived at the projection boundary. */
|
|
56
|
+
identity?: ToolIdentity;
|
|
54
57
|
/** Human-readable label. */
|
|
55
58
|
label: string;
|
|
56
59
|
/**
|
|
@@ -64,6 +67,8 @@ export interface PortableTool<TParams = Record<string, unknown>> {
|
|
|
64
67
|
displayDescription?: LocalizedText;
|
|
65
68
|
/** Tool description shown to the LLM. */
|
|
66
69
|
description: string;
|
|
70
|
+
/** Structured semantics used by model-based capability discovery and routing. */
|
|
71
|
+
semanticCapability?: SemanticToolCapability;
|
|
67
72
|
/** JSON Schema object describing the tool's parameters. */
|
|
68
73
|
parameters: Record<string, unknown>;
|
|
69
74
|
/**
|
|
@@ -19,6 +19,7 @@ export interface SkillLifecycleRecord {
|
|
|
19
19
|
sourceTier?: "official" | "community";
|
|
20
20
|
riskTier?: "R0" | "R1" | "R2" | "R3";
|
|
21
21
|
artifactDigest?: string;
|
|
22
|
+
contentTreeDigest?: string;
|
|
22
23
|
registryResourceId?: string;
|
|
23
24
|
registryVersion?: string;
|
|
24
25
|
registrySourceTier?: "official" | "community";
|
|
@@ -16,7 +16,7 @@ export declare const EXEC_TOOL_SCHEMA: {
|
|
|
16
16
|
readonly properties: {
|
|
17
17
|
readonly command: {
|
|
18
18
|
readonly type: "string";
|
|
19
|
-
readonly description: "Shell command to execute
|
|
19
|
+
readonly description: "Shell command to execute with the active shell provider. See the # Environment section for its path, version, and syntax rules.";
|
|
20
20
|
};
|
|
21
21
|
readonly description: {
|
|
22
22
|
readonly type: "string";
|
|
@@ -80,10 +80,6 @@ export interface ExecToolHost {
|
|
|
80
80
|
* Returns undefined to disable the OS sandbox (degrade to prompt-only).
|
|
81
81
|
*/
|
|
82
82
|
resolveSandbox?(): SandboxConfig | undefined;
|
|
83
|
-
/** Resolve active private runtime PATH entries at command execution time. */
|
|
84
|
-
resolveRuntimePathEntries?(): Promise<string[]>;
|
|
85
|
-
/** Return the current opaque qlogicagent session ID for this exec call. */
|
|
86
|
-
getSessionId?(): string | undefined;
|
|
87
83
|
/**
|
|
88
84
|
* Interpret a non-zero exit code.
|
|
89
85
|
* E.g. 127 → "command not found", 137 → "killed by SIGKILL".
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PowerShellEdition, ShellCommandCompatibilityIssue } from "./shell-provider.js";
|
|
2
|
+
export declare function validatePowerShellCommandCompatibility(command: string, edition?: PowerShellEdition): ShellCommandCompatibilityIssue | null;
|
|
3
|
+
export declare function validateBashCommandCompatibility(command: string): ShellCommandCompatibilityIssue | null;
|