qlogicagent 2.18.6 → 2.18.7
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 +382 -382
- package/dist/agent.js +30 -30
- package/dist/cli.js +1 -1
- package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
- package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
- package/dist/host-contract.js +1 -0
- package/dist/index.js +539 -530
- package/dist/orchestration.js +4 -4
- package/dist/permissions.js +1 -1
- package/dist/plugin-marketplace-compute.js +1 -0
- package/dist/protocol.js +1 -1
- package/dist/runtime/infra/mcp-bridge-server.js +275 -275
- package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
- package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
- package/dist/skills/mcp/astraclaw-native-mcp-server.js +4 -4
- package/dist/tunables.js +1 -0
- package/dist/types/agent/runtime-vars.d.ts +1 -2
- package/dist/types/agent/tool-loop.d.ts +6 -0
- package/dist/types/agent/tool-loop.test-harness.d.ts +20 -0
- package/dist/types/agent/types.d.ts +2 -0
- package/dist/types/cli/acp-extended-handlers.d.ts +7 -0
- package/dist/types/cli/acp-extended-host-adapter.d.ts +2 -0
- package/dist/types/cli/acp-session-host.d.ts +15 -2
- package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
- package/dist/types/cli/community-skill-installer.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +4 -0
- package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +3 -1
- package/dist/types/cli/core-tools/config-tool-service.d.ts +7 -5
- package/dist/types/cli/default-project-bootstrap.d.ts +1 -0
- package/dist/types/cli/handlers/agents-handler.d.ts +4 -1
- package/dist/types/cli/handlers/community-handler.d.ts +2 -0
- package/dist/types/cli/handlers/config-handler.d.ts +2 -15
- package/dist/types/cli/handlers/pet-handler.d.ts +3 -2
- package/dist/types/cli/handlers/session-handler.d.ts +1 -1
- package/dist/types/cli/handlers/skills-handler.d.ts +12 -10
- package/dist/types/cli/handlers/solo-handler.d.ts +3 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +46 -32
- package/dist/types/cli/handlers/workflow-handler.d.ts +6 -0
- package/dist/types/cli/mcp-bootstrap.d.ts +0 -2
- package/dist/types/cli/media-inline.d.ts +14 -0
- package/dist/types/cli/media-understanding.d.ts +65 -8
- package/dist/types/cli/memory-coordinator.d.ts +8 -0
- package/dist/types/cli/multi-agent-handler-host.d.ts +2 -0
- package/dist/types/cli/permission-bootstrap.d.ts +2 -0
- package/dist/types/cli/pet-runtime.d.ts +0 -1
- package/dist/types/cli/plugin-bootstrap.d.ts +2 -1
- package/dist/types/cli/product-coordinator.d.ts +4 -1
- package/dist/types/cli/rpc-registry.d.ts +1 -3
- package/dist/types/cli/runtime-watcher-bootstrap.d.ts +0 -2
- package/dist/types/cli/session-context.d.ts +4 -2
- package/dist/types/cli/skill-invocation-service.d.ts +2 -0
- package/dist/types/cli/skill-tools-bootstrap.d.ts +2 -0
- package/dist/types/cli/skills-query-service.d.ts +2 -1
- package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +9 -0
- package/dist/types/cli/stdio-acp-request-host.d.ts +11 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +1 -1
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +6 -0
- package/dist/types/cli/stdio-runtime-services.d.ts +6 -1
- package/dist/types/cli/stdio-server.d.ts +33 -4
- package/dist/types/cli/task-distillation-coordinator.d.ts +9 -4
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +3 -0
- package/dist/types/cli/tool-bootstrap-media-registration.d.ts +10 -0
- package/dist/types/cli/tool-bootstrap-web-registration.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap.d.ts +9 -0
- package/dist/types/cli/turn-core.d.ts +2 -0
- package/dist/types/cli/turn-preview-browser-setup.d.ts +15 -0
- package/dist/types/cli/turn-project-router.d.ts +1 -1
- package/dist/types/cli/workflow-host-adapter.d.ts +2 -0
- package/dist/types/host-contract/index.d.ts +1475 -0
- package/dist/types/host-contract/project-id.d.ts +5 -0
- package/dist/types/host-contract/provider-profile.d.ts +46 -0
- package/dist/types/orchestration/agent-instance.d.ts +6 -0
- package/dist/types/orchestration/delegation-coordinator.d.ts +40 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -0
- package/dist/types/orchestration/product-planner.d.ts +3 -0
- package/dist/types/orchestration/solo-evaluator.d.ts +18 -3
- package/dist/types/orchestration/solo-persistence.d.ts +2 -0
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +4 -0
- package/dist/types/permissions.d.ts +2 -0
- package/dist/types/protocol/methods.d.ts +0 -199
- package/dist/types/protocol/wire/acp-protocol.d.ts +16 -1
- package/dist/types/protocol/wire/agent-methods.d.ts +1 -173
- package/dist/types/protocol/wire/chat-types.d.ts +6 -0
- package/dist/types/runtime/config/tunable-defaults.d.ts +13 -3
- package/dist/types/runtime/execution/dream-agent.d.ts +9 -8
- package/dist/types/runtime/infra/agent-paths.d.ts +3 -3
- package/dist/types/runtime/infra/astraclaw-capabilities.d.ts +1 -1
- package/dist/types/runtime/infra/clixml-sanitize.d.ts +16 -0
- package/dist/types/runtime/infra/external-agent-approvals.d.ts +18 -0
- package/dist/types/runtime/infra/feedback-distillation.d.ts +3 -1
- package/dist/types/runtime/infra/feedback-host-authority.d.ts +4 -0
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +2 -13
- package/dist/types/runtime/infra/model-registry.d.ts +3 -1
- package/dist/types/runtime/infra/project-authority-facade.d.ts +11 -0
- package/dist/types/runtime/infra/project-host-authority.d.ts +10 -0
- package/dist/types/runtime/ports/memory-provider.d.ts +11 -7
- package/dist/types/runtime/ports/tool-contracts.d.ts +2 -0
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +2 -2
- package/dist/types/runtime/session/session-persistence.d.ts +29 -10
- package/dist/types/runtime/session/session-recovery.d.ts +4 -0
- package/dist/types/runtime/session/session-summary.d.ts +3 -1
- package/dist/types/runtime/session/session-transcript-store.d.ts +7 -0
- package/dist/types/skills/memory/host-memory-provider.d.ts +148 -0
- package/dist/types/skills/memory/local-memory-provider.d.ts +19 -10
- package/dist/types/skills/memory/task-distillation.d.ts +6 -0
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +23 -57
- package/dist/types/skills/tools/media-understand-tool.d.ts +28 -0
- package/dist/types/skills/tools/preview-browser-tool.d.ts +136 -0
- package/dist/types/skills/tools/shell/task-output.d.ts +10 -1
- package/dist/types/skills/tools/skill-tool.d.ts +1 -1
- package/dist/types/skills/web-search/brave-source.d.ts +2 -1
- package/dist/types/skills/web-search/crawl4ai-extractor.d.ts +3 -2
- package/dist/types/skills/web-search/exa-source.d.ts +2 -1
- package/dist/types/skills/web-search/search-svc-source.d.ts +4 -3
- package/dist/types/skills/web-search/searxng-source.d.ts +3 -1
- package/dist/types/skills/web-search/serper-source.d.ts +2 -1
- package/dist/types/skills/web-search/source-factory.d.ts +2 -1
- package/dist/types/skills/web-search/web-tunable-resolver.d.ts +16 -0
- package/dist/types/test-support/global-home-setup.d.ts +2 -0
- package/dist/types/transport/acp-server.d.ts +29 -0
- package/dist/types/transport/delegate-client.d.ts +82 -0
- package/dist/types/transport/host-capability-client.d.ts +21 -0
- package/dist/types/transport/host-feedback-client.d.ts +25 -0
- package/dist/types/transport/host-profile-client.d.ts +19 -0
- package/dist/types/transport/host-project-client.d.ts +16 -0
- package/dist/types/transport/host-request-client.d.ts +38 -0
- package/dist/types/transport/host-session-client.d.ts +29 -0
- package/dist/types/tunables.d.ts +2 -0
- package/dist/vendor/hatch-pet/LICENSE.txt +201 -201
- package/dist/vendor/hatch-pet/NOTICE.md +25 -25
- package/dist/vendor/hatch-pet/references/animation-rows.md +29 -29
- package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -35
- package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -66
- package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -169
- package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -150
- package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -408
- package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -256
- package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -96
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +834 -834
- package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -78
- package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -157
- package/package.json +25 -2
- package/dist/types/cli/handlers/settings-handler.d.ts +0 -19
- package/dist/types/cli/permission-rule-persistence.d.ts +0 -16
- package/dist/types/cli/tunable-store.d.ts +0 -26
- package/dist/types/skills/permissions/settings-watcher.d.ts +0 -26
- /package/dist/types/{skills/memory → host-contract}/fts-segment.d.ts +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
2
2
|
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
3
3
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
4
|
+
import type { MemoryHostRequestAccess } from "./memory-coordinator.js";
|
|
4
5
|
import { type StdioRuntimeServices } from "./stdio-runtime-services.js";
|
|
6
|
+
import type { HostProfileClient } from "../transport/host-profile-client.js";
|
|
5
7
|
export interface StdioRuntimeBootstrapDeps {
|
|
6
8
|
verbose: boolean;
|
|
7
9
|
getActiveProjectRoot(): string;
|
|
@@ -14,5 +16,9 @@ export interface StdioRuntimeBootstrapDeps {
|
|
|
14
16
|
} | null;
|
|
15
17
|
log(message: string): void;
|
|
16
18
|
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
19
|
+
/** B3(X7):host-state 接入面(AcpServer;lazy——gate 在 provider 创建时刻现读)。 */
|
|
20
|
+
resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
|
|
21
|
+
/** Lazy session-bound host profile facade; unavailable/non-ACP must fail loud at first web invoke. */
|
|
22
|
+
resolveHostProfileClient?(): HostProfileClient | undefined;
|
|
17
23
|
}
|
|
18
24
|
export declare function bootstrapStdioRuntimeServices(deps: StdioRuntimeBootstrapDeps): StdioRuntimeServices;
|
|
@@ -2,7 +2,7 @@ import type { NotificationMethod, NotificationMethodMap } from "../protocol/noti
|
|
|
2
2
|
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PathService, ToolBootstrap, ToolCatalog } from "../runtime/ports/index.js";
|
|
3
3
|
import { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
4
4
|
import { MediaClient, ProviderRegistry, type LLMTransport } from "./provider-core-facade.js";
|
|
5
|
-
import { type MemoryProviderState } from "./memory-coordinator.js";
|
|
5
|
+
import { type MemoryHostRequestAccess, type MemoryProviderState } from "./memory-coordinator.js";
|
|
6
6
|
import { type PetRuntime } from "./pet-runtime.js";
|
|
7
7
|
import { type TurnMediaSetupHost } from "./turn-media-setup.js";
|
|
8
8
|
export interface StdioRuntimeServicesDeps {
|
|
@@ -14,6 +14,11 @@ export interface StdioRuntimeServicesDeps {
|
|
|
14
14
|
model: string;
|
|
15
15
|
} | null;
|
|
16
16
|
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
17
|
+
/**
|
|
18
|
+
* B3(X7)host-state 接入面(AcpServer;initialize 前/非 ACP 宿主 = null)。
|
|
19
|
+
* memory provider 工厂据此在创建时刻按 memory service 一次性选型 HostMemoryProvider。
|
|
20
|
+
*/
|
|
21
|
+
resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
|
|
17
22
|
}
|
|
18
23
|
export interface StdioRuntimeServices {
|
|
19
24
|
providerRegistry: ProviderRegistry;
|
|
@@ -20,13 +20,17 @@ import { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
|
20
20
|
import { type AgentRpcError } from "../protocol/wire/index.js";
|
|
21
21
|
import type { AcpServer } from "../transport/acp-server.js";
|
|
22
22
|
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
23
|
-
import type { SessionLlmConfig } from "./acp-session-host.js";
|
|
24
23
|
import { AgentRuntimeSessionState } from "./agent-runtime-session-state.js";
|
|
25
24
|
import { type MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
|
|
26
25
|
import type { WorkflowHandlerHost } from "./handlers/workflow-handler.js";
|
|
27
26
|
import { SessionHistoryCoordinator } from "./session-history-coordinator.js";
|
|
28
27
|
import { PetConfirmCoordinator } from "./pet-confirm-coordinator.js";
|
|
29
28
|
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMode, ProjectMemoryStore } from "../runtime/ports/index.js";
|
|
29
|
+
import { HostProfileClient } from "../transport/host-profile-client.js";
|
|
30
|
+
import { HostCapabilityClient } from "../transport/host-capability-client.js";
|
|
31
|
+
import { HostSessionClient } from "../transport/host-session-client.js";
|
|
32
|
+
import { HostProjectClient } from "../transport/host-project-client.js";
|
|
33
|
+
import { HostFeedbackClient } from "../transport/host-feedback-client.js";
|
|
30
34
|
export interface StdioServerConfig {
|
|
31
35
|
verbose: boolean;
|
|
32
36
|
transport?: Transport;
|
|
@@ -107,6 +111,25 @@ export declare class StdioServer {
|
|
|
107
111
|
set currentSessionId(v: string);
|
|
108
112
|
get currentTurnId(): string;
|
|
109
113
|
set currentTurnId(v: string);
|
|
114
|
+
/**
|
|
115
|
+
* The active ACP permission session for the current turn, or undefined when no host is connected.
|
|
116
|
+
*/
|
|
117
|
+
getAcpPermissionSession(): {
|
|
118
|
+
sessionId: string;
|
|
119
|
+
requestPermission: AcpServer["requestPermission"];
|
|
120
|
+
} | undefined;
|
|
121
|
+
/** The coordinator-owned host-request client is available only for an active ACP session. */
|
|
122
|
+
getHostRequestClient(): import("../transport/host-request-client.js").HostRequestClient | undefined;
|
|
123
|
+
/** Thin facade over the coordinator-owned HostRequestClient; owns no second pending table. */
|
|
124
|
+
getHostProfileClient(): HostProfileClient | undefined;
|
|
125
|
+
/** Thin read-only facade; consumers fail loudly when the host did not advertise capability. */
|
|
126
|
+
getHostCapabilityClient(): HostCapabilityClient | undefined;
|
|
127
|
+
/** Session durable-state facade; absent under gate-off/standalone so compatibility stays inert. */
|
|
128
|
+
getHostSessionClient(): HostSessionClient | undefined;
|
|
129
|
+
/** D2 telemetry/feedback business facade; durable storage remains gateway-only. */
|
|
130
|
+
getHostFeedbackClient(): HostFeedbackClient | undefined;
|
|
131
|
+
getHostProjectClient(): HostProjectClient | undefined;
|
|
132
|
+
initializeHostProjectAuthority(): Promise<void>;
|
|
110
133
|
/**
|
|
111
134
|
* Mid-turn guidance queue (运行中引导). Reset per turn by runTurnPipeline, pushed by
|
|
112
135
|
* handleTurnGuide (via the turn host proxy), drained each round by the tool loop.
|
|
@@ -121,8 +144,8 @@ export declare class StdioServer {
|
|
|
121
144
|
cancelBackgroundTasksForSession(sessionId?: string): void;
|
|
122
145
|
get sessionState(): SessionState | null;
|
|
123
146
|
set sessionState(v: SessionState | null);
|
|
124
|
-
get
|
|
125
|
-
|
|
147
|
+
get sessionLlmConfigBySession(): Map<string, import("./acp-session-host.js").SessionLlmConfig>;
|
|
148
|
+
get materializedSessionProfiles(): Map<string, import("./acp-session-host.js").MaterializedSessionProfile>;
|
|
126
149
|
get acpSessionMeta(): Record<string, unknown> | null;
|
|
127
150
|
set acpSessionMeta(v: Record<string, unknown> | null);
|
|
128
151
|
get acpSessionMetaBySession(): Map<string, Record<string, unknown>>;
|
|
@@ -132,7 +155,7 @@ export declare class StdioServer {
|
|
|
132
155
|
/**
|
|
133
156
|
* config.update 权限热应用:写盘的同时立即更新活的 rule engine,
|
|
134
157
|
* 当前会话(乃至运行中 turn)的下一次工具调用就按新模式判定——
|
|
135
|
-
* 不再等下一轮 _meta
|
|
158
|
+
* 不再等下一轮 _meta 或重启。持久权限只由 host profile 与 session materialized profile 提供。
|
|
136
159
|
*/
|
|
137
160
|
applyPermissionConfig(perm: {
|
|
138
161
|
mode: PermissionMode;
|
|
@@ -205,6 +228,12 @@ export declare class StdioServer {
|
|
|
205
228
|
private emitAgentStatus;
|
|
206
229
|
createDreamHandlerHost(): import("./handlers/dream-handler.js").DreamHandlerHost;
|
|
207
230
|
private createAcpExtendedHandlerHost;
|
|
231
|
+
/**
|
|
232
|
+
* 激活层(S3c):gateway-routed delegate 桥 —— 懒读 AcpServer(server 在 initialize 后才 init,故每次现读)。
|
|
233
|
+
* gateway 声明 delegate 能力位(supportsDelegate)才放行 x/delegate;否则调用方(@mention coordinator /
|
|
234
|
+
* workflow agent 节点 / 后续各机制 B spawn 点)走各自旧本地 spawn 路径(单轨保留,gate 关零回归)。
|
|
235
|
+
*/
|
|
236
|
+
private buildDelegateBridge;
|
|
208
237
|
/**
|
|
209
238
|
* Handle an MCP tool call proxied from an external ACP agent via the
|
|
210
239
|
* named-pipe bridge. Dispatches the tool through the host's own tool
|
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
* · 晋升(spec:唯一技能入口): accessCount ≥ 阈值且未被负反馈沉底 → system.activity 推荐。
|
|
9
9
|
*/
|
|
10
10
|
import { type PromotionMetrics, type CandidateStoreFile, type PromotionProposal } from "../skills/memory/task-distillation.js";
|
|
11
|
+
import type { HostCapabilityClient } from "../transport/host-capability-client.js";
|
|
11
12
|
export interface TaskDistillationDeps {
|
|
12
13
|
profileMemoryDir: () => string;
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
/** Gateway-owned skill authority. Missing service is fatal; local skill-store fallback is forbidden. */
|
|
15
|
+
hostCapabilityClient: () => HostCapabilityClient | undefined;
|
|
16
|
+
/** 签名 embedding;null=不可用(候选照存但不参与聚类,宁严勿松)。
|
|
17
|
+
* B3(X7):number[](非 Float32Array)——host 模式下 embedText 结果跨 x/host.request JSON wire。 */
|
|
18
|
+
embed: (text: string) => Promise<number[] | null>;
|
|
15
19
|
/** 落库:返回是否成功(候选只在成功后标 distilled) */
|
|
16
20
|
addProcedure: (text: string, tags: string[]) => Promise<boolean>;
|
|
17
21
|
/** 小模型摘要(dream 同款);null/失败 → 降级模板 */
|
|
@@ -23,8 +27,8 @@ export interface TaskDistillationDeps {
|
|
|
23
27
|
accessCount: number;
|
|
24
28
|
importance: number;
|
|
25
29
|
}>>;
|
|
26
|
-
/** V3 promote/demote:archive(技能接棒)/unarchive(降格回归) */
|
|
27
|
-
setMemoryArchived: (id: string, archived: boolean) => boolean
|
|
30
|
+
/** V3 promote/demote:archive(技能接棒)/unarchive(降格回归)。B3(X7)异步化:16 面 proxy 方法。 */
|
|
31
|
+
setMemoryArchived: (id: string, archived: boolean) => Promise<boolean>;
|
|
28
32
|
sendNotification: (method: string, params: Record<string, unknown>) => void;
|
|
29
33
|
log: (message: string) => void;
|
|
30
34
|
}
|
|
@@ -46,6 +50,7 @@ export declare class TaskDistillationCoordinator {
|
|
|
46
50
|
/** 已通知过晋升的条目(进程内防重复打扰;跨重启重复通知无害) */
|
|
47
51
|
private readonly promotionNotified;
|
|
48
52
|
constructor(deps: TaskDistillationDeps);
|
|
53
|
+
private requireCapability;
|
|
49
54
|
/** 回合完成时采集候选。异步(embedding 网络调用),错误吞掉不碰回合主链。 */
|
|
50
55
|
recordTurn(input: RecordTurnInput): Promise<void>;
|
|
51
56
|
/** 空闲窗/手动共用的蒸馏 pass。 */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PortableTool } from "../skills/portable-tool.js";
|
|
2
2
|
import { type TaskToolHooks } from "../skills/tools/task-tool.js";
|
|
3
3
|
import { type AskUserQuestion } from "../skills/tools/ask-user-tool.js";
|
|
4
|
+
import { type PreviewBrowserDriveResult, type PreviewBrowserToolParams } from "../skills/tools/preview-browser-tool.js";
|
|
4
5
|
import { type ExecProgress } from "../skills/tools/exec-tool.js";
|
|
5
6
|
import type { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
6
7
|
import type { SandboxConfig } from "../skills/tools/shell/sandbox/sandbox-types.js";
|
|
@@ -14,6 +15,8 @@ export interface LocalCoreToolRegistrationContext {
|
|
|
14
15
|
getCurrentTurnId?: () => string | undefined;
|
|
15
16
|
askUserCallback: ((questions: AskUserQuestion[]) => Promise<Record<string, string> | null>) | null;
|
|
16
17
|
getAskUserCallback?: () => ((questions: AskUserQuestion[]) => Promise<Record<string, string> | null>) | null;
|
|
18
|
+
previewBrowserCallback: ((params: PreviewBrowserToolParams, signal?: AbortSignal) => Promise<PreviewBrowserDriveResult>) | null;
|
|
19
|
+
getPreviewBrowserCallback?: () => ((params: PreviewBrowserToolParams, signal?: AbortSignal) => Promise<PreviewBrowserDriveResult>) | null;
|
|
17
20
|
onExecProgress?: (progress: ExecProgress) => void;
|
|
18
21
|
sendNotification?(method: string, params: Record<string, unknown>): void;
|
|
19
22
|
getCwd(): string;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import type { PortableTool } from "../skills/portable-tool.js";
|
|
2
2
|
import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
3
|
+
import { type ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
4
|
+
import type { LLMTransport } from "./provider-core-facade.js";
|
|
3
5
|
export interface LocalMediaToolRegistrationContext {
|
|
4
6
|
tools: PortableTool<any>[];
|
|
5
7
|
getCwd(): string;
|
|
6
8
|
activeProjectRoot(): string;
|
|
7
9
|
mediaPersistence?: MediaPersistence;
|
|
10
|
+
/** Resolves the LLM client bound to a model purpose — needed by the image/video understanding
|
|
11
|
+
* tools, which run the imageUnderstanding / videoUnderstanding purpose model (a vision LLM),
|
|
12
|
+
* NOT the media-generation runtime that stt/generation ride. Absent → those tools are skipped. */
|
|
13
|
+
resolveClientForPurpose?(purpose: ModelPurpose): {
|
|
14
|
+
transport: LLMTransport;
|
|
15
|
+
apiKey: string;
|
|
16
|
+
model: string;
|
|
17
|
+
} | null;
|
|
8
18
|
}
|
|
9
19
|
export declare const localMediaToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<LocalMediaToolRegistrationContext>;
|
|
10
20
|
export declare function registerLocalMediaTools(context: LocalMediaToolRegistrationContext): void;
|
|
@@ -8,6 +8,7 @@ export interface LocalWebToolRegistrationContext {
|
|
|
8
8
|
apiKey: string;
|
|
9
9
|
model: string;
|
|
10
10
|
} | null;
|
|
11
|
+
loadTunableOverrides?(): Promise<Record<string, unknown>>;
|
|
11
12
|
}
|
|
12
13
|
export declare const localWebToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<LocalWebToolRegistrationContext>;
|
|
13
14
|
export declare function registerLocalWebTools(context: LocalWebToolRegistrationContext): void;
|
|
@@ -8,6 +8,7 @@ import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
|
8
8
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
9
9
|
import type { AgentLogger } from "../agent/types.js";
|
|
10
10
|
import type { AskUserQuestion } from "../skills/tools/ask-user-tool.js";
|
|
11
|
+
import type { PreviewBrowserDriveResult, PreviewBrowserToolParams } from "../skills/tools/preview-browser-tool.js";
|
|
11
12
|
import type { PathService, ToolCatalog } from "../runtime/ports/index.js";
|
|
12
13
|
export { setMediaClientConfig, setProviderToolAPI } from "./media-runtime-facade.js";
|
|
13
14
|
export { setGroupSecurityMode, validateExecCommand } from "./tool-bootstrap-core-registration.js";
|
|
@@ -19,6 +20,7 @@ export interface SandboxPermissionSnapshot {
|
|
|
19
20
|
}
|
|
20
21
|
/** Wire the OS-sandbox permission source (live rule-engine snapshot), or null to clear. */
|
|
21
22
|
export declare function setSandboxPermissionSource(source: (() => SandboxPermissionSnapshot | undefined) | null): void;
|
|
23
|
+
type PreviewBrowserCallback = (params: PreviewBrowserToolParams, signal?: AbortSignal) => Promise<PreviewBrowserDriveResult>;
|
|
22
24
|
/**
|
|
23
25
|
* Set task tool lifecycle hooks. Called from stdio-server when session starts.
|
|
24
26
|
* Connects planning-task events to the HookRegistry.
|
|
@@ -36,6 +38,12 @@ export declare function setBackgroundTaskRuntime(manager: BackgroundTaskManager
|
|
|
36
38
|
* If null, ask_user returns "user declined" to the LLM.
|
|
37
39
|
*/
|
|
38
40
|
export declare function setAskUserCallback(callback: ((questions: AskUserQuestion[]) => Promise<Record<string, string> | null>) | null): void;
|
|
41
|
+
/**
|
|
42
|
+
* Set the preview_browser callback. The host (Electron / test harness) provides the backend
|
|
43
|
+
* that drives the shared preview view (via x/host.request service:preview) and returns text + screenshot.
|
|
44
|
+
* Wired per turn by configureTurnPreviewBrowser. If null, preview_browser reports "not available".
|
|
45
|
+
*/
|
|
46
|
+
export declare function setPreviewBrowserCallback(callback: PreviewBrowserCallback | null): void;
|
|
39
47
|
export declare function setBootstrapWorkdir(newWorkdir: string): void;
|
|
40
48
|
export interface BootstrapConfig {
|
|
41
49
|
workdir?: string;
|
|
@@ -54,6 +62,7 @@ export interface BootstrapConfig {
|
|
|
54
62
|
getTaskScopeKey?(): string | undefined;
|
|
55
63
|
getCurrentTurnId?(): string | undefined;
|
|
56
64
|
sendNotification?(method: string, params: Record<string, unknown>): void;
|
|
65
|
+
loadTunableOverrides?(): Promise<Record<string, unknown>>;
|
|
57
66
|
}
|
|
58
67
|
/**
|
|
59
68
|
* Create all locally-executable tools and install into centralized tool pool.
|
|
@@ -20,6 +20,8 @@ export interface TurnCoreRequest {
|
|
|
20
20
|
drainPendingGuidance?: () => string[];
|
|
21
21
|
/** Sanitize tool-result media the main model can't consume — forwarded to the tool loop. */
|
|
22
22
|
sanitizeToolResultMedia?: (message: Record<string, unknown>) => Promise<void>;
|
|
23
|
+
/** Persist each model-visible tool-stream message to the transcript — forwarded to the tool loop. */
|
|
24
|
+
persistTurnMessage?: (message: ChatMessage) => void;
|
|
23
25
|
systemPrompt: string;
|
|
24
26
|
config: TurnConfig;
|
|
25
27
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HostRequestClient } from "../transport/host-request-client.js";
|
|
2
|
+
import type { PreviewBrowserDriveResult, PreviewBrowserToolParams } from "../skills/tools/preview-browser-tool.js";
|
|
3
|
+
export interface TurnPreviewBrowserSetupHost {
|
|
4
|
+
/** The coordinator-owned unary host client, or undefined when no host is attached. */
|
|
5
|
+
getHostRequestClient(): Pick<HostRequestClient, "request"> | undefined;
|
|
6
|
+
/** Active turn attribution; injected into preview params, never accepted from agent tool input. */
|
|
7
|
+
readonly currentSessionId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Build the preview_browser backend over the coordinator-owned HostRequestClient. The action is the
|
|
11
|
+
* service method and is removed from the action-specific payload. Preview owns an explicit 15s
|
|
12
|
+
* policy; failures remain visible as `{ error }`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function makePreviewBrowserBackend(host: TurnPreviewBrowserSetupHost): (params: PreviewBrowserToolParams, signal?: AbortSignal) => Promise<PreviewBrowserDriveResult>;
|
|
15
|
+
export declare function configureTurnPreviewBrowser(host: TurnPreviewBrowserSetupHost): void;
|
|
@@ -25,5 +25,7 @@ export interface WorkflowHostAdapterDeps {
|
|
|
25
25
|
handleMcpToolCall: WorkflowHandlerHost["handleMcpToolCall"];
|
|
26
26
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
27
27
|
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
28
|
+
/** 激活层(S3c §1.6):gateway-routed delegate 桥(懒读;gateway 未声明 delegate 能力位时 undefined)。 */
|
|
29
|
+
getDelegateBridge?: WorkflowHandlerHost["getDelegateBridge"];
|
|
28
30
|
}
|
|
29
31
|
export declare function createWorkflowHostAdapter(deps: WorkflowHostAdapterDeps): WorkflowHandlerHost;
|