qlogicagent 2.18.5 → 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.
Files changed (151) hide show
  1. package/README.md +382 -382
  2. package/dist/agent.js +30 -30
  3. package/dist/cli.js +1 -1
  4. package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
  5. package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
  6. package/dist/host-contract.js +1 -0
  7. package/dist/index.js +536 -525
  8. package/dist/orchestration.js +4 -4
  9. package/dist/permissions.js +1 -1
  10. package/dist/plugin-marketplace-compute.js +1 -0
  11. package/dist/protocol.js +1 -1
  12. package/dist/runtime/infra/mcp-bridge-server.js +275 -275
  13. package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
  14. package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
  15. package/dist/skills/mcp/astraclaw-native-mcp-server.js +4 -4
  16. package/dist/tunables.js +1 -0
  17. package/dist/types/agent/runtime-vars.d.ts +1 -2
  18. package/dist/types/agent/tool-loop.d.ts +13 -0
  19. package/dist/types/agent/tool-loop.test-harness.d.ts +20 -0
  20. package/dist/types/agent/types.d.ts +8 -0
  21. package/dist/types/cli/acp-extended-handlers.d.ts +7 -0
  22. package/dist/types/cli/acp-extended-host-adapter.d.ts +2 -0
  23. package/dist/types/cli/acp-session-host.d.ts +15 -2
  24. package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
  25. package/dist/types/cli/community-skill-installer.d.ts +2 -0
  26. package/dist/types/cli/core-tool-coordinator.d.ts +4 -0
  27. package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +3 -1
  28. package/dist/types/cli/core-tools/config-tool-service.d.ts +7 -5
  29. package/dist/types/cli/default-project-bootstrap.d.ts +1 -0
  30. package/dist/types/cli/dream-host-adapter.d.ts +1 -0
  31. package/dist/types/cli/handlers/agents-handler.d.ts +4 -1
  32. package/dist/types/cli/handlers/community-handler.d.ts +2 -0
  33. package/dist/types/cli/handlers/config-handler.d.ts +2 -15
  34. package/dist/types/cli/handlers/dream-handler.d.ts +4 -0
  35. package/dist/types/cli/handlers/pet-handler.d.ts +3 -2
  36. package/dist/types/cli/handlers/session-handler.d.ts +1 -1
  37. package/dist/types/cli/handlers/skills-handler.d.ts +12 -10
  38. package/dist/types/cli/handlers/solo-handler.d.ts +3 -0
  39. package/dist/types/cli/handlers/turn-handler.d.ts +46 -32
  40. package/dist/types/cli/handlers/workflow-handler.d.ts +6 -0
  41. package/dist/types/cli/mcp-bootstrap.d.ts +0 -2
  42. package/dist/types/cli/media-inline.d.ts +31 -0
  43. package/dist/types/cli/media-understanding.d.ts +65 -8
  44. package/dist/types/cli/memory-coordinator.d.ts +8 -0
  45. package/dist/types/cli/multi-agent-handler-host.d.ts +2 -0
  46. package/dist/types/cli/permission-bootstrap.d.ts +2 -0
  47. package/dist/types/cli/pet-runtime.d.ts +0 -1
  48. package/dist/types/cli/plugin-bootstrap.d.ts +2 -1
  49. package/dist/types/cli/product-coordinator.d.ts +4 -1
  50. package/dist/types/cli/rpc-registry.d.ts +1 -3
  51. package/dist/types/cli/runtime-watcher-bootstrap.d.ts +0 -2
  52. package/dist/types/cli/session-context.d.ts +4 -2
  53. package/dist/types/cli/skill-invocation-service.d.ts +2 -0
  54. package/dist/types/cli/skill-tools-bootstrap.d.ts +2 -0
  55. package/dist/types/cli/skills-query-service.d.ts +2 -1
  56. package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +9 -0
  57. package/dist/types/cli/stdio-acp-request-host.d.ts +11 -2
  58. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +1 -1
  59. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +6 -0
  60. package/dist/types/cli/stdio-runtime-services.d.ts +6 -1
  61. package/dist/types/cli/stdio-server.d.ts +33 -4
  62. package/dist/types/cli/task-distillation-coordinator.d.ts +9 -4
  63. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +3 -0
  64. package/dist/types/cli/tool-bootstrap-media-registration.d.ts +10 -0
  65. package/dist/types/cli/tool-bootstrap-web-registration.d.ts +1 -0
  66. package/dist/types/cli/tool-bootstrap.d.ts +9 -0
  67. package/dist/types/cli/turn-core.d.ts +4 -0
  68. package/dist/types/cli/turn-preview-browser-setup.d.ts +15 -0
  69. package/dist/types/cli/turn-project-router.d.ts +1 -1
  70. package/dist/types/cli/workflow-host-adapter.d.ts +2 -0
  71. package/dist/types/host-contract/index.d.ts +1475 -0
  72. package/dist/types/host-contract/project-id.d.ts +5 -0
  73. package/dist/types/host-contract/provider-profile.d.ts +46 -0
  74. package/dist/types/orchestration/agent-instance.d.ts +6 -0
  75. package/dist/types/orchestration/delegation-coordinator.d.ts +40 -0
  76. package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -0
  77. package/dist/types/orchestration/product-planner.d.ts +3 -0
  78. package/dist/types/orchestration/solo-evaluator.d.ts +18 -3
  79. package/dist/types/orchestration/solo-persistence.d.ts +2 -0
  80. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +4 -0
  81. package/dist/types/permissions.d.ts +2 -0
  82. package/dist/types/protocol/methods.d.ts +0 -199
  83. package/dist/types/protocol/wire/acp-protocol.d.ts +16 -1
  84. package/dist/types/protocol/wire/agent-methods.d.ts +1 -173
  85. package/dist/types/protocol/wire/chat-types.d.ts +6 -0
  86. package/dist/types/runtime/config/tunable-defaults.d.ts +13 -3
  87. package/dist/types/runtime/execution/dream-agent.d.ts +9 -8
  88. package/dist/types/runtime/infra/agent-paths.d.ts +3 -3
  89. package/dist/types/runtime/infra/astraclaw-capabilities.d.ts +1 -1
  90. package/dist/types/runtime/infra/clixml-sanitize.d.ts +16 -0
  91. package/dist/types/runtime/infra/external-agent-approvals.d.ts +18 -0
  92. package/dist/types/runtime/infra/feedback-distillation.d.ts +3 -1
  93. package/dist/types/runtime/infra/feedback-host-authority.d.ts +4 -0
  94. package/dist/types/runtime/infra/llmrouter-catalog.d.ts +2 -13
  95. package/dist/types/runtime/infra/model-registry.d.ts +3 -1
  96. package/dist/types/runtime/infra/project-authority-facade.d.ts +11 -0
  97. package/dist/types/runtime/infra/project-host-authority.d.ts +10 -0
  98. package/dist/types/runtime/ports/memory-provider.d.ts +11 -7
  99. package/dist/types/runtime/ports/tool-contracts.d.ts +2 -0
  100. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +2 -2
  101. package/dist/types/runtime/session/session-catalog.d.ts +12 -0
  102. package/dist/types/runtime/session/session-persistence.d.ts +30 -11
  103. package/dist/types/runtime/session/session-recovery.d.ts +4 -0
  104. package/dist/types/runtime/session/session-summary.d.ts +3 -1
  105. package/dist/types/runtime/session/session-transcript-store.d.ts +7 -0
  106. package/dist/types/skills/memory/host-memory-provider.d.ts +148 -0
  107. package/dist/types/skills/memory/local-memory-provider.d.ts +20 -11
  108. package/dist/types/skills/memory/local-store.d.ts +5 -2
  109. package/dist/types/skills/memory/task-distillation.d.ts +6 -0
  110. package/dist/types/skills/plugins/plugin-marketplace.d.ts +23 -57
  111. package/dist/types/skills/tools/media-understand-tool.d.ts +28 -0
  112. package/dist/types/skills/tools/preview-browser-tool.d.ts +136 -0
  113. package/dist/types/skills/tools/shell/task-output.d.ts +10 -1
  114. package/dist/types/skills/tools/skill-tool.d.ts +1 -1
  115. package/dist/types/skills/web-search/brave-source.d.ts +2 -1
  116. package/dist/types/skills/web-search/crawl4ai-extractor.d.ts +3 -2
  117. package/dist/types/skills/web-search/exa-source.d.ts +2 -1
  118. package/dist/types/skills/web-search/search-svc-source.d.ts +4 -3
  119. package/dist/types/skills/web-search/searxng-source.d.ts +3 -1
  120. package/dist/types/skills/web-search/serper-source.d.ts +2 -1
  121. package/dist/types/skills/web-search/source-factory.d.ts +2 -1
  122. package/dist/types/skills/web-search/web-tunable-resolver.d.ts +16 -0
  123. package/dist/types/test-support/global-home-setup.d.ts +2 -0
  124. package/dist/types/transport/acp-server.d.ts +29 -0
  125. package/dist/types/transport/delegate-client.d.ts +82 -0
  126. package/dist/types/transport/host-capability-client.d.ts +21 -0
  127. package/dist/types/transport/host-feedback-client.d.ts +25 -0
  128. package/dist/types/transport/host-profile-client.d.ts +19 -0
  129. package/dist/types/transport/host-project-client.d.ts +16 -0
  130. package/dist/types/transport/host-request-client.d.ts +38 -0
  131. package/dist/types/transport/host-session-client.d.ts +29 -0
  132. package/dist/types/tunables.d.ts +2 -0
  133. package/dist/vendor/hatch-pet/LICENSE.txt +201 -201
  134. package/dist/vendor/hatch-pet/NOTICE.md +25 -25
  135. package/dist/vendor/hatch-pet/references/animation-rows.md +29 -29
  136. package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -35
  137. package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -66
  138. package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -169
  139. package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -150
  140. package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -408
  141. package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -256
  142. package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -96
  143. package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +834 -834
  144. package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -78
  145. package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -157
  146. package/package.json +25 -2
  147. package/dist/types/cli/handlers/settings-handler.d.ts +0 -19
  148. package/dist/types/cli/permission-rule-persistence.d.ts +0 -16
  149. package/dist/types/cli/tunable-store.d.ts +0 -26
  150. package/dist/types/skills/permissions/settings-watcher.d.ts +0 -26
  151. /package/dist/types/{skills/memory → host-contract}/fts-segment.d.ts +0 -0
@@ -1,8 +1,11 @@
1
1
  import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
2
+ import type { HostRequestService } from "../host-contract/index.js";
2
3
  import { AcpServer, type AcpRequestHandler } from "../transport/acp-server.js";
4
+ import { HostRequestClient } from "../transport/host-request-client.js";
3
5
  import type { Transport } from "./transport.js";
4
6
  export declare class StdioAcpProtocolCoordinator {
5
7
  private server;
8
+ private hostRequestClient;
6
9
  get active(): boolean;
7
10
  init(transport: Transport, handler: AcpRequestHandler, options: {
8
11
  verbose: boolean;
@@ -14,5 +17,11 @@ export declare class StdioAcpProtocolCoordinator {
14
17
  sessionId: string;
15
18
  requestPermission: AcpServer["requestPermission"];
16
19
  } | undefined;
20
+ getHostRequestClient(): HostRequestClient | null;
21
+ getHostRequestAccess(): {
22
+ hostRequest: HostRequestClient;
23
+ supportsHostRequestService(service: HostRequestService): boolean;
24
+ } | null;
25
+ dispose(reason?: string): void;
17
26
  emitUpdate<M extends NotificationMethod>(sessionId: string, method: M, params: NotificationMethodMap[M]): boolean;
18
27
  }
@@ -1,3 +1,5 @@
1
+ import type { HostRequestClient } from "../transport/host-request-client.js";
2
+ import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
1
3
  import type { CliAcpRequestHandlerHost } from "./cli-acp-request-handler.js";
2
4
  /**
3
5
  * Everything the ACP request handlers — INCLUDING the shared turn pipeline
@@ -6,7 +8,7 @@ import type { CliAcpRequestHandlerHost } from "./cli-acp-request-handler.js";
6
8
  * (`this: any`), so members it touches must be forwarded here explicitly;
7
9
  * see TURN_PIPELINE_HOST_MEMBERS for the regression-tested list.
8
10
  */
9
- export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTurn" | "acpSessionMeta" | "acpSessionMetaBySession" | "currentHooks" | "currentSessionId" | "currentTurnId" | "memoryPrefetchState" | "permissionChecker" | "sessionHistory" | "sessionLlmConfig" | "sessionState" | "cancelIdleDreamTimer" | "disposeSessionRuntime" | "enableIdleDream" | "ensureDefaultProject" | "ensureModelRegistryHydrated" | "getActiveProjectRoot" | "log" | "sendNotification" | "setActiveWorkdir"> & {
11
+ export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTurn" | "acpSessionMeta" | "acpSessionMetaBySession" | "currentHooks" | "currentSessionId" | "currentTurnId" | "memoryPrefetchState" | "permissionChecker" | "sessionHistory" | "sessionLlmConfigBySession" | "materializedSessionProfiles" | "sessionState" | "cancelIdleDreamTimer" | "disposeSessionRuntime" | "enableIdleDream" | "ensureDefaultProject" | "initializeHostProjectAuthority" | "ensureModelRegistryHydrated" | "getActiveProjectRoot" | "log" | "sendNotification" | "setActiveWorkdir"> & {
10
12
  currentModel: string | undefined;
11
13
  lastAssistantMessageForExtract: string | undefined;
12
14
  lastUserMessageForAutoExtract: string | undefined;
@@ -19,6 +21,13 @@ export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTu
19
21
  taskDistillation: unknown;
20
22
  cancelBackgroundTasksForSession(sessionId?: string): void;
21
23
  configureTurnMedia(config: Record<string, unknown> | undefined, turnId: string): void;
24
+ getAcpPermissionSession(): {
25
+ sessionId: string;
26
+ requestPermission(params: AcpPermissionRequestParams): Promise<{
27
+ optionId?: string;
28
+ }>;
29
+ } | undefined;
30
+ getHostRequestClient(): Pick<HostRequestClient, "request"> | undefined;
22
31
  drainPendingTaskNotifications(): string[];
23
32
  resolveAgent(config: unknown): unknown;
24
33
  resolveClientForPurpose(purpose: unknown): unknown;
@@ -26,5 +35,5 @@ export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTu
26
35
  };
27
36
  /** Host members the shared turn pipeline reads/writes — keep in sync with
28
37
  * `grep -oE "this\.[a-zA-Z]+" src/cli/handlers/turn-handler.ts | sort -u`. */
29
- export declare const TURN_PIPELINE_HOST_MEMBERS: readonly ["activeTurn", "configureTurnMedia", "currentHooks", "currentModel", "currentTurnId", "drainPendingTaskNotifications", "getActiveProjectRoot", "lastAssistantMessageForExtract", "lastUserMessageForAutoExtract", "log", "mcpReady", "memdir", "pendingAskUser", "permissionChecker", "petRuntime", "projectMemoryStoreFactory", "resolveAgent", "resolveClientForPurpose", "sendNotification", "sendResponse", "sessionHistory", "sessionState", "setActiveWorkdir", "taskDistillation", "toolCatalog"];
38
+ export declare const TURN_PIPELINE_HOST_MEMBERS: readonly ["activeTurn", "configureTurnMedia", "currentHooks", "currentModel", "currentTurnId", "drainPendingTaskNotifications", "getAcpPermissionSession", "getHostRequestClient", "getActiveProjectRoot", "lastAssistantMessageForExtract", "lastUserMessageForAutoExtract", "log", "mcpReady", "memdir", "pendingAskUser", "permissionChecker", "petRuntime", "projectMemoryStoreFactory", "resolveAgent", "resolveClientForPurpose", "sendNotification", "sendResponse", "sessionHistory", "sessionState", "setActiveWorkdir", "taskDistillation", "toolCatalog"];
30
39
  export declare function createStdioAcpRequestHandlerHost(host: StdioAcpRequestHostSource): CliAcpRequestHandlerHost;
@@ -1,7 +1,7 @@
1
1
  import type { LLMRequest } from "../agent/types.js";
2
2
  import type { ModelPurpose } from "../runtime/infra/model-registry.js";
3
3
  import type { RpcHandlerHosts } from "./rpc-registry.js";
4
- type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["project"] & RpcHandlerHosts["community"] & RpcHandlerHosts["settings"] & RpcHandlerHosts["petConfirm"] & {
4
+ type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["project"] & RpcHandlerHosts["community"] & RpcHandlerHosts["petConfirm"] & {
5
5
  currentTurnId?: string;
6
6
  /** Mid-turn guidance queue (运行中引导) — shared between handleTurnGuide and the tool loop's drain. */
7
7
  pendingTurnGuidance?: string[];
@@ -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 sessionLlmConfig(): SessionLlmConfig;
125
- set sessionLlmConfig(v: SessionLlmConfig);
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 或重启。settings-watcher 仍监听文件作为外部改动兜底。
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
- /** 签名 embedding;null=不可用(候选照存但不参与聚类,宁严勿松) */
14
- embed: (text: string) => Promise<Float32Array | null>;
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.
@@ -18,6 +18,10 @@ export interface TurnCoreRequest {
18
18
  refreshTools?: () => ToolDefinition[];
19
19
  /** Mid-turn guidance drain (运行中引导) — forwarded to the tool loop. */
20
20
  drainPendingGuidance?: () => string[];
21
+ /** Sanitize tool-result media the main model can't consume — forwarded to the tool loop. */
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;
21
25
  systemPrompt: string;
22
26
  config: TurnConfig;
23
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;
@@ -28,4 +28,4 @@ export declare function routeTurnProjectContext(params: {
28
28
  sessionId?: string;
29
29
  host: TurnProjectRoutingHost;
30
30
  nowMs?: number;
31
- }): TurnProjectRoutingResult;
31
+ }): Promise<TurnProjectRoutingResult>;
@@ -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;