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.
Files changed (147) 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 +539 -530
  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 +6 -0
  19. package/dist/types/agent/tool-loop.test-harness.d.ts +20 -0
  20. package/dist/types/agent/types.d.ts +2 -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/handlers/agents-handler.d.ts +4 -1
  31. package/dist/types/cli/handlers/community-handler.d.ts +2 -0
  32. package/dist/types/cli/handlers/config-handler.d.ts +2 -15
  33. package/dist/types/cli/handlers/pet-handler.d.ts +3 -2
  34. package/dist/types/cli/handlers/session-handler.d.ts +1 -1
  35. package/dist/types/cli/handlers/skills-handler.d.ts +12 -10
  36. package/dist/types/cli/handlers/solo-handler.d.ts +3 -0
  37. package/dist/types/cli/handlers/turn-handler.d.ts +46 -32
  38. package/dist/types/cli/handlers/workflow-handler.d.ts +6 -0
  39. package/dist/types/cli/mcp-bootstrap.d.ts +0 -2
  40. package/dist/types/cli/media-inline.d.ts +14 -0
  41. package/dist/types/cli/media-understanding.d.ts +65 -8
  42. package/dist/types/cli/memory-coordinator.d.ts +8 -0
  43. package/dist/types/cli/multi-agent-handler-host.d.ts +2 -0
  44. package/dist/types/cli/permission-bootstrap.d.ts +2 -0
  45. package/dist/types/cli/pet-runtime.d.ts +0 -1
  46. package/dist/types/cli/plugin-bootstrap.d.ts +2 -1
  47. package/dist/types/cli/product-coordinator.d.ts +4 -1
  48. package/dist/types/cli/rpc-registry.d.ts +1 -3
  49. package/dist/types/cli/runtime-watcher-bootstrap.d.ts +0 -2
  50. package/dist/types/cli/session-context.d.ts +4 -2
  51. package/dist/types/cli/skill-invocation-service.d.ts +2 -0
  52. package/dist/types/cli/skill-tools-bootstrap.d.ts +2 -0
  53. package/dist/types/cli/skills-query-service.d.ts +2 -1
  54. package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +9 -0
  55. package/dist/types/cli/stdio-acp-request-host.d.ts +11 -2
  56. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +1 -1
  57. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +6 -0
  58. package/dist/types/cli/stdio-runtime-services.d.ts +6 -1
  59. package/dist/types/cli/stdio-server.d.ts +33 -4
  60. package/dist/types/cli/task-distillation-coordinator.d.ts +9 -4
  61. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +3 -0
  62. package/dist/types/cli/tool-bootstrap-media-registration.d.ts +10 -0
  63. package/dist/types/cli/tool-bootstrap-web-registration.d.ts +1 -0
  64. package/dist/types/cli/tool-bootstrap.d.ts +9 -0
  65. package/dist/types/cli/turn-core.d.ts +2 -0
  66. package/dist/types/cli/turn-preview-browser-setup.d.ts +15 -0
  67. package/dist/types/cli/turn-project-router.d.ts +1 -1
  68. package/dist/types/cli/workflow-host-adapter.d.ts +2 -0
  69. package/dist/types/host-contract/index.d.ts +1475 -0
  70. package/dist/types/host-contract/project-id.d.ts +5 -0
  71. package/dist/types/host-contract/provider-profile.d.ts +46 -0
  72. package/dist/types/orchestration/agent-instance.d.ts +6 -0
  73. package/dist/types/orchestration/delegation-coordinator.d.ts +40 -0
  74. package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -0
  75. package/dist/types/orchestration/product-planner.d.ts +3 -0
  76. package/dist/types/orchestration/solo-evaluator.d.ts +18 -3
  77. package/dist/types/orchestration/solo-persistence.d.ts +2 -0
  78. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +4 -0
  79. package/dist/types/permissions.d.ts +2 -0
  80. package/dist/types/protocol/methods.d.ts +0 -199
  81. package/dist/types/protocol/wire/acp-protocol.d.ts +16 -1
  82. package/dist/types/protocol/wire/agent-methods.d.ts +1 -173
  83. package/dist/types/protocol/wire/chat-types.d.ts +6 -0
  84. package/dist/types/runtime/config/tunable-defaults.d.ts +13 -3
  85. package/dist/types/runtime/execution/dream-agent.d.ts +9 -8
  86. package/dist/types/runtime/infra/agent-paths.d.ts +3 -3
  87. package/dist/types/runtime/infra/astraclaw-capabilities.d.ts +1 -1
  88. package/dist/types/runtime/infra/clixml-sanitize.d.ts +16 -0
  89. package/dist/types/runtime/infra/external-agent-approvals.d.ts +18 -0
  90. package/dist/types/runtime/infra/feedback-distillation.d.ts +3 -1
  91. package/dist/types/runtime/infra/feedback-host-authority.d.ts +4 -0
  92. package/dist/types/runtime/infra/llmrouter-catalog.d.ts +2 -13
  93. package/dist/types/runtime/infra/model-registry.d.ts +3 -1
  94. package/dist/types/runtime/infra/project-authority-facade.d.ts +11 -0
  95. package/dist/types/runtime/infra/project-host-authority.d.ts +10 -0
  96. package/dist/types/runtime/ports/memory-provider.d.ts +11 -7
  97. package/dist/types/runtime/ports/tool-contracts.d.ts +2 -0
  98. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +2 -2
  99. package/dist/types/runtime/session/session-persistence.d.ts +29 -10
  100. package/dist/types/runtime/session/session-recovery.d.ts +4 -0
  101. package/dist/types/runtime/session/session-summary.d.ts +3 -1
  102. package/dist/types/runtime/session/session-transcript-store.d.ts +7 -0
  103. package/dist/types/skills/memory/host-memory-provider.d.ts +148 -0
  104. package/dist/types/skills/memory/local-memory-provider.d.ts +19 -10
  105. package/dist/types/skills/memory/task-distillation.d.ts +6 -0
  106. package/dist/types/skills/plugins/plugin-marketplace.d.ts +23 -57
  107. package/dist/types/skills/tools/media-understand-tool.d.ts +28 -0
  108. package/dist/types/skills/tools/preview-browser-tool.d.ts +136 -0
  109. package/dist/types/skills/tools/shell/task-output.d.ts +10 -1
  110. package/dist/types/skills/tools/skill-tool.d.ts +1 -1
  111. package/dist/types/skills/web-search/brave-source.d.ts +2 -1
  112. package/dist/types/skills/web-search/crawl4ai-extractor.d.ts +3 -2
  113. package/dist/types/skills/web-search/exa-source.d.ts +2 -1
  114. package/dist/types/skills/web-search/search-svc-source.d.ts +4 -3
  115. package/dist/types/skills/web-search/searxng-source.d.ts +3 -1
  116. package/dist/types/skills/web-search/serper-source.d.ts +2 -1
  117. package/dist/types/skills/web-search/source-factory.d.ts +2 -1
  118. package/dist/types/skills/web-search/web-tunable-resolver.d.ts +16 -0
  119. package/dist/types/test-support/global-home-setup.d.ts +2 -0
  120. package/dist/types/transport/acp-server.d.ts +29 -0
  121. package/dist/types/transport/delegate-client.d.ts +82 -0
  122. package/dist/types/transport/host-capability-client.d.ts +21 -0
  123. package/dist/types/transport/host-feedback-client.d.ts +25 -0
  124. package/dist/types/transport/host-profile-client.d.ts +19 -0
  125. package/dist/types/transport/host-project-client.d.ts +16 -0
  126. package/dist/types/transport/host-request-client.d.ts +38 -0
  127. package/dist/types/transport/host-session-client.d.ts +29 -0
  128. package/dist/types/tunables.d.ts +2 -0
  129. package/dist/vendor/hatch-pet/LICENSE.txt +201 -201
  130. package/dist/vendor/hatch-pet/NOTICE.md +25 -25
  131. package/dist/vendor/hatch-pet/references/animation-rows.md +29 -29
  132. package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -35
  133. package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -66
  134. package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -169
  135. package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -150
  136. package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -408
  137. package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -256
  138. package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -96
  139. package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +834 -834
  140. package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -78
  141. package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -157
  142. package/package.json +25 -2
  143. package/dist/types/cli/handlers/settings-handler.d.ts +0 -19
  144. package/dist/types/cli/permission-rule-persistence.d.ts +0 -16
  145. package/dist/types/cli/tunable-store.d.ts +0 -26
  146. package/dist/types/skills/permissions/settings-watcher.d.ts +0 -26
  147. /package/dist/types/{skills/memory → host-contract}/fts-segment.d.ts +0 -0
@@ -14,7 +14,8 @@ interface PetMemoryActivitySummary {
14
14
  }>;
15
15
  }
16
16
  interface PetMemoryProviderLike {
17
- getActivitySummary(userId: string, days: number): PetMemoryActivitySummary | undefined;
17
+ /** B3(X7)异步化:16 host-state proxy 方法(host 模式经 x/host.request 跨进程)。 */
18
+ getActivitySummary(userId: string, days: number): Promise<PetMemoryActivitySummary | undefined> | undefined;
18
19
  }
19
20
  interface PetSessionStateLike {
20
21
  turnCount?: number;
@@ -25,7 +26,7 @@ export interface PetHandlerHost {
25
26
  memoryProvider?: PetMemoryProviderLike | null;
26
27
  memoryUserId?: string;
27
28
  ownerUserId?: string;
28
- petRuntime: Pick<PetRuntime, "createPetSoulGenerator" | "createSmallLLMCall" | "forgeAnalyzeImage"> & Partial<Pick<PetRuntime, "forgeGeneratePetdexAtlas" | "isImageGenerationAvailable" | "isPetdexForgeAvailable">>;
29
+ petRuntime: Pick<PetRuntime, "createPetSoulGenerator" | "createSmallLLMCall"> & Partial<Pick<PetRuntime, "forgeGeneratePetdexAtlas" | "isImageGenerationAvailable" | "isPetdexForgeAvailable">>;
29
30
  getActiveProjectRoot(): string;
30
31
  sendNotification(method: string, params: Record<string, unknown>): void;
31
32
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
@@ -90,7 +90,7 @@ export declare function handleSessionArchive(this: SessionHandlerHost, msg: Agen
90
90
  export declare function handleSessionMarkCleanShutdown(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
91
91
  export declare function handleSessionResume(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
92
92
  export declare function handleSessionGetInfo(this: SessionHandlerHost, msg: AgentRpcRequest): void;
93
- export declare function handleSessionSwitchProject(this: SessionHandlerHost, msg: AgentRpcRequest): void;
93
+ export declare function handleSessionSwitchProject(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
94
94
  export declare function handleSessionGetState(this: SessionHandlerHost, msg: AgentRpcRequest): void;
95
95
  /**
96
96
  * `session.focus` - Desktop UI reports which session is currently focused.
@@ -5,11 +5,13 @@
5
5
  * skills.curator, skills.lifecycle
6
6
  */
7
7
  import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
8
+ import type { HostCapabilityClient } from "../../transport/host-capability-client.js";
8
9
  export interface SkillsHandlerHost {
9
10
  projectLocator?: {
10
11
  resolveProjectRoot(projectId: string): string | undefined;
11
12
  };
12
13
  getActiveProjectRoot(): string;
14
+ getHostCapabilityClient(): HostCapabilityClient | undefined;
13
15
  sendNotification(method: string, params: Record<string, unknown>): void;
14
16
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
15
17
  }
@@ -17,19 +19,19 @@ export declare function extractSkillMeta(skillMdPath: string): {
17
19
  version?: string;
18
20
  description?: string;
19
21
  };
20
- export declare function handleSkillsList(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
21
- export declare function handleSkillsActivate(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
22
- export declare function handleSkillsDeactivate(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
22
+ export declare function handleSkillsList(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
23
+ export declare function handleSkillsActivate(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
24
+ export declare function handleSkillsDeactivate(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
23
25
  export declare function handleSkillsDelete(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
24
- export declare function handleSkillsPromote(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
26
+ export declare function handleSkillsPromote(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
25
27
  /**
26
28
  * Per-project opt-out: mute (or un-mute) a globally-installed skill in ONE project so the agent
27
29
  * doesn't see it there — cuts context and mis-triggering without uninstalling the skill. The file
28
30
  * stays in the global store and stays active in every other project. This is the "本项目技能" toggle.
29
31
  */
30
- export declare function handleSkillsSetProjectDisabled(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
31
- export declare function handleSkillsStats(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
32
- export declare function handleSkillsPin(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
33
- export declare function handleSkillsUnpin(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
34
- export declare function handleSkillsCurator(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
35
- export declare function handleSkillsLifecycle(this: SkillsHandlerHost, msg: AgentRpcRequest): void;
32
+ export declare function handleSkillsSetProjectDisabled(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
33
+ export declare function handleSkillsStats(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
34
+ export declare function handleSkillsPin(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
35
+ export declare function handleSkillsUnpin(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
36
+ export declare function handleSkillsCurator(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
37
+ export declare function handleSkillsLifecycle(this: SkillsHandlerHost, msg: AgentRpcRequest): Promise<void>;
@@ -7,6 +7,7 @@ import { AgentProcessManager } from "../../runtime/infra/agent-process.js";
7
7
  import type { AcpDetector } from "../../runtime/infra/acp-detector.js";
8
8
  import type { AgentConfigStore } from "../../runtime/infra/agent-config-store.js";
9
9
  import { SoloEvaluator } from "../../orchestration/solo-evaluator.js";
10
+ import type { DelegateBridge } from "../../orchestration/delegation-coordinator.js";
10
11
  import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
11
12
  export declare const soloProjectMap: Map<string, string>;
12
13
  export interface SoloHandlerHost {
@@ -26,6 +27,8 @@ export interface SoloHandlerHost {
26
27
  };
27
28
  }): void;
28
29
  handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
30
+ /** 激活层(S3c §1.5):gateway-routed delegate 桥(懒读;未挂/gate 关 = undefined → 旧本地 spawn 路径)。 */
31
+ getDelegateBridge?(): DelegateBridge | undefined;
29
32
  }
30
33
  export declare function ensureSoloEvaluator(this: SoloHandlerHost): SoloEvaluator;
31
34
  export declare function handleSoloStart(this: SoloHandlerHost, msg: AgentRpcRequest): Promise<void>;
@@ -3,7 +3,7 @@
3
3
  * Handles: the shared turn pipeline (runTurnPipeline) + thread.user_response (ask-user answers).
4
4
  */
5
5
  import { type ModelPurpose } from "../../runtime/infra/model-registry.js";
6
- import { type UnderstandMediaClient, type UnderstandMediaKind } from "../media-understanding.js";
6
+ import { type UnderstandMediaKind } from "../media-understanding.js";
7
7
  import { type InstructionFileInfo } from "../../runtime/prompt/instruction-loader.js";
8
8
  import type { HookRegistry } from "../../contracts/hooks.js";
9
9
  import type { AppendMessageOutcome } from "../../runtime/session/session-transcript-store.js";
@@ -98,9 +98,6 @@ export declare function loadInstructionBlockForTurn(deps: {
98
98
  }): Promise<string | undefined>;
99
99
  export declare function hydrateTurnConfigFromModelMetadata(config: TurnConfig): TurnConfig;
100
100
  export declare function hydrateAttachmentReferenceUrlsForTurn(messages: ChatMessage[]): ChatMessage[];
101
- export declare function getFocusedAttachmentToolNamesForTurn(messages: ChatMessage[]): Set<string> | null;
102
- type FocusedAttachmentModelPurpose = "imageUnderstanding" | "videoUnderstanding";
103
- export declare function getFocusedAttachmentUnsupportedContentForTurn(messages: ChatMessage[], purpose: FocusedAttachmentModelPurpose): string | null;
104
101
  /**
105
102
  * Return a shallow-cloned message array whose LAST user message has the model-facing attachment
106
103
  * context (numbered manifest / reference URLs / picked-element selector+styles) appended to its
@@ -145,44 +142,61 @@ export declare function injectSkillContextBeforeLastUser(messages: ChatMessage[]
145
142
  */
146
143
  export declare function buildMemoryIndexBlock(globalBlock: string | null, projectBlock: string | null): string | null;
147
144
  export declare function injectDomainGuidanceBeforeLastUser(messages: ChatMessage[], domainGuidance: string): ChatMessage[];
148
- export declare function getFocusedAttachmentModelPurposeForTurn(messages: ChatMessage[]): FocusedAttachmentModelPurpose | null;
149
145
  export declare function refreshPermissionCheckerToolMeta(permissionChecker: PermissionMetadataResolver | null | undefined, tools: ToolDefinition[]): void;
150
146
  export declare function handleUserResponse(this: TurnControlHandlerHost, msg: AgentRpcRequest): void;
151
- /**
152
- * Pure: assemble the text appended to the user message after modality routing.
153
- * `descriptorsByKind` are the successfully understood texts (in order per modality);
154
- * `fallbackStripped` are the "X 张图片"-style labels for media that was dropped without
155
- * understanding. Returns "" when there is nothing to inject.
156
- *
157
- * The understood blocks lead with a note stating they are model transcriptions; the
158
- * "media omitted" note is appended ONLY for the fallback set, so a successful transcription
159
- * is never contradicted by a blanket "media omitted" line.
160
- */
161
- export declare function buildUnderstoodInjection(descriptorsByKind: Record<UnderstandMediaKind, string[]>, fallbackStripped: string[]): string;
162
147
  interface ModalityRegistryView {
163
148
  acceptsInputModality(modality: string, purpose: ModelPurpose): boolean;
164
149
  isAvailable(purpose: ModelPurpose): boolean;
165
150
  }
166
- interface RouteUnsupportedModalitiesDeps {
167
- lastUserMsg: ChatMessage;
168
- purpose: ModelPurpose;
169
- registry: ModalityRegistryView;
170
- resolveClient(purpose: ModelPurpose): UnderstandMediaClient | null;
171
- signal?: AbortSignal;
172
- log(message: string): void;
151
+ export interface UnsupportedMediaRefs {
152
+ image: string[];
153
+ video: string[];
154
+ audio: string[];
155
+ }
156
+ /** Plan for the media a text-only main model can't consume, produced by detectUnsupportedMediaForTools. */
157
+ export interface MediaUnderstandingPlan {
158
+ /** Refs the model should call the understanding tool on — understanding model bound AND the ref is
159
+ * tool-addressable (a short URL/path it can echo). Capped when surfaced (see the notice builder). */
160
+ toolRefs: UnsupportedMediaRefs;
161
+ /** Kinds present but NOT understandable this turn: no understanding model is bound for them, or every
162
+ * ref is a non-addressable (data:/oversized) URL. Surfaced as an HONEST "cannot read this" note so
163
+ * the model never points at an absent tool while being forbidden to admit blindness. */
164
+ blockedKinds: UnderstandMediaKind[];
173
165
  }
174
166
  /**
175
- * For each modality the resolved main model can't consume, route the media to its
176
- * understanding model (image→imageUnderstanding, audio→stt, video→videoUnderstanding)
177
- * and fold the returned text into the user message; media that can't be understood
178
- * (model unavailable / call failed / empty / over the cap) degrades to the previous
179
- * behavior (field dropped + omission note). The media field is ALWAYS deleted afterward
180
- * the main model still can't consume it, so leaving it would 400 the turn.
167
+ * Detect the media modalities the resolved main model can't consume, STRIP the media fields (a text-only
168
+ * model 400s on multimodal content), and PLAN what to tell the model: which refs to call the understanding
169
+ * tool on, and which kinds it must honestly report as unreadable (no understanding model bound, or every
170
+ * ref is a non-addressable data:/oversized URL). It does NOT transcribe and does NOT touch the message
171
+ * text the plan is surfaced via a model-only notice so the model calls image_understand /
172
+ * video_understand / stt itself, exactly as it would for an in-message media path; the user's bubble
173
+ * stays clean. This is the ONLY media-understanding path (the legacy eager pre-inject was fully retired).
174
+ *
175
+ * Reliability note: unlike the eager path, this DEPENDS on the model calling the tool — the medium is not
176
+ * transcribed anywhere, so if the model ignores the notice the understanding does not happen this turn
177
+ * (mitigated by the strong notice). Cross-turn is fine WITHIN a live session: the model's prior
178
+ * image_understand call (carrying the image_url ref) stays in the running conversation, so a later turn
179
+ * can re-read the same image — verified by a 2-turn test. The only gap is a COLD resume: the on-disk
180
+ * transcript stores just the user text (media stripped) + the assistant's text, not the tool calls/results
181
+ * (see appendMessage), so re-opening the session in a fresh process rebuilds history without the ref —
182
+ * the model then has only its earlier answer text, not a way to look again.
181
183
  *
182
- * Mutates `lastUserMsg` in place. Injection only touches string content (array content is
183
- * left as-is, matching the prior behavior). Best-effort: never throws for a per-item failure.
184
+ * Attachments were saved to disk + rewritten to short gateway local-media URLs by persistInboundUploadsForTurn
185
+ * upstream, so a proxy ref is compact; isToolAddressableRef guards the residual raw-data: case. Mutates
186
+ * `lastUserMsg` (deletes the consumed media fields).
187
+ */
188
+ export declare function detectUnsupportedMediaForTools(lastUserMsg: ChatMessage, purpose: ModelPurpose, registry: ModalityRegistryView): MediaUnderstandingPlan;
189
+ /**
190
+ * Build the MODEL-ONLY notice for a MediaUnderstandingPlan. Understandable media → a directive to call the
191
+ * matching tool on each listed ref (capped at MAX_MEDIA_UNDERSTAND_REFS). Blocked media → an HONEST
192
+ * "cannot read this, do not guess" note (no understanding model / unaddressable ref) — never a directive to
193
+ * call an absent tool. For a user ATTACHMENT the notice rides the LLM copy of the user message
194
+ * (effectiveMessages), NEVER the persisted/displayed message, so the bubble stays clean; for a TOOL RESULT
195
+ * it is appended to the tool-result content. Returns "" when there is no unconsumable media.
184
196
  */
185
- export declare function routeUnsupportedModalitiesToUnderstanding(deps: RouteUnsupportedModalitiesDeps): Promise<void>;
197
+ export declare function buildMediaUnderstandingToolNotice(plan: MediaUnderstandingPlan, opts?: {
198
+ source?: "attachment" | "tool_result";
199
+ }): string;
186
200
  export interface TurnPipelineInput {
187
201
  turnId: string;
188
202
  sessionId: string;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { AgentProcessManager } from "../../runtime/infra/agent-process.js";
10
10
  import type { AcpDetector } from "../../runtime/infra/acp-detector.js";
11
+ import type { DelegateBridge } from "../../orchestration/delegation-coordinator.js";
11
12
  import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
12
13
  import { WorkflowController } from "../../orchestration/workflow/workflow-controller.js";
13
14
  import { WorkflowStore, type WorkflowRecord } from "../../orchestration/workflow/workflow-store.js";
@@ -46,6 +47,11 @@ export interface WorkflowCoordinatorHost {
46
47
  } | null;
47
48
  /** Per-root engine bundles keyed by resolved cwd; built lazily by ensureWorkflowRoot. */
48
49
  workflowRoots: Map<string, WorkflowRootBundle> | null;
50
+ /**
51
+ * 激活层(S3c §1.6):gateway-routed delegate 桥(gateway 在 initialize 声明 delegate 能力位时
52
+ * 才 isSupported;缺省/gate 关 = 旧 AgentProcessManager 本地 spawn 路径,单轨保留零回归)。
53
+ */
54
+ getDelegateBridge?(): DelegateBridge | undefined;
49
55
  }
50
56
  export interface WorkflowHandlerHost extends WorkflowCoordinatorHost {
51
57
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
@@ -13,9 +13,7 @@ export interface McpBootstrapDeps {
13
13
  }
14
14
  export declare const mcpToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<McpBootstrapDeps>;
15
15
  export declare function configureMcpBootstrap(deps: McpBootstrapDeps): void;
16
- export declare function readUserMcpConfig(pathService: PathService, log?: RuntimeLogger): unknown;
17
16
  export declare function buildMcpBootstrapEntries(params: {
18
17
  turnMcpConfig?: unknown;
19
- userMcpConfig?: unknown;
20
18
  projectRoot: string;
21
19
  }): import("../skills/mcp/mcp-manager.js").McpServerEntry[];
@@ -15,3 +15,17 @@
15
15
  * unchanged. Never throws.
16
16
  */
17
17
  export declare function resolveLocalMediaForModel(url: string): string;
18
+ /**
19
+ * Resolve an IMAGE reference for an understanding call, preferring a self-contained base64 `data:` URL
20
+ * for a small LOCAL image over the upload path. A local image inlined as base64 is delivered inside the
21
+ * request (the model provider fetches nothing), so it sidesteps the whole local→upload→OSS→signed-URL
22
+ * chain that a text main model's image understanding otherwise depends on (an unsigned private-OSS URL
23
+ * the provider 403s on is the classic silent-empty fault). Behavior:
24
+ * - `data:` URL → returned as-is (already inline).
25
+ * - public `http(s)`/`blob:` URL → returned as-is (the provider fetches it server-side).
26
+ * - LOCAL image (raw path / `file://` / the 127.0.0.1 media-proxy URL) within the inline ceiling →
27
+ * read + base64 `data:` URL.
28
+ * - LOCAL image over the ceiling (or unreadable) → fall back to resolveLocalMediaForModel (proxy/upload).
29
+ * Only images inline as base64 — video is far too large, so it always takes the URL path. Never throws.
30
+ */
31
+ export declare function resolveImageForUnderstanding(url: string): string;
@@ -20,6 +20,22 @@ export declare const PURPOSE_BY_KIND: Record<UnderstandMediaKind, "imageUndersta
20
20
  export declare const URL_FIELD_BY_KIND: Record<UnderstandMediaKind, "imageUrls" | "audioUrls" | "videoUrls">;
21
21
  /** Per-medium instruction. Every kind is normalized to plain text so callers only swap a label. */
22
22
  export declare const PROMPT_BY_KIND: Record<UnderstandMediaKind, string>;
23
+ /**
24
+ * The subset of stream-chunk fields understandMediaUrl inspects. Deliberately loose and
25
+ * all-optional beyond `type` so it stays structurally compatible with the real LLMTransport's
26
+ * discriminated LLMChunk union (delta / usage / error / done all satisfy it) and the memory
27
+ * client. Beyond the `delta` text we read the `usage` tokens and the terminal `error` / `done`
28
+ * so an empty reply can be diagnosed (medium never reached the model) rather than silently
29
+ * reported as a blank description.
30
+ */
31
+ export interface UnderstandMediaChunk {
32
+ type: string;
33
+ text?: string;
34
+ promptTokens?: number;
35
+ completionTokens?: number;
36
+ finishReason?: string;
37
+ message?: string;
38
+ }
23
39
  /**
24
40
  * A resolved understanding client. Structurally compatible with both the real LLMTransport
25
41
  * (whose `stream` takes an optional third `signal` arg) and the memory client. Deliberately
@@ -29,17 +45,58 @@ export interface UnderstandMediaClient {
29
45
  model: string;
30
46
  apiKey: string;
31
47
  transport: {
32
- stream(request: Record<string, unknown>, apiKey: string, signal?: AbortSignal): AsyncIterable<{
33
- type: string;
34
- text?: string;
35
- }>;
48
+ stream(request: object, apiKey: string, signal?: AbortSignal): AsyncIterable<UnderstandMediaChunk>;
36
49
  };
37
50
  }
38
51
  /**
39
- * Understand a single medium at `url` and return the model's trimmed text (may be empty
40
- * if the model produced nothing). Never throws for an empty reply an empty string is a
41
- * valid "no text" result the caller degrades on.
52
+ * Why an understanding call yielded no usable text. Lets callers separate a genuine "the model
53
+ * looked and had nothing to say" (`empty_output`) from "the medium never reached the model"
54
+ * (`fetch_failed`) the silent-empty failure mode where an unfetchable image (e.g. a private-OSS
55
+ * URL the provider 403s on) bills zero input tokens, so an empty reply is a delivery failure, not
56
+ * a blank description. `stream_error` is an explicit upstream error surfaced mid-stream.
57
+ */
58
+ export type MediaUnderstandFailure = "fetch_failed" | "stream_error" | "empty_output";
59
+ /**
60
+ * Structured outcome of understandMediaUrl. `text` is the transcript (empty ⇔ the model produced
61
+ * no text); when `text` is empty, `failure` classifies WHY so callers can surface a delivery
62
+ * failure distinctly instead of treating every empty reply as "nothing to describe". The token /
63
+ * finishReason fields carry the diagnostic evidence for logs.
64
+ */
65
+ export interface UnderstandMediaResult {
66
+ /** The model's trimmed text. Empty string ⇔ no text was produced (see `failure`). */
67
+ text: string;
68
+ /** Input tokens the provider billed, if a usage chunk arrived. undefined ⇔ no usage chunk was
69
+ * seen at all — itself a strong "nothing reached, or came back from, the model" signal. */
70
+ promptTokens?: number;
71
+ /** Output tokens, if a usage chunk arrived. */
72
+ completionTokens?: number;
73
+ /** finishReason from the terminal chunk ("" / undefined ⇔ truncated or none). */
74
+ finishReason?: string;
75
+ /** Message from an explicit `error` chunk, if the stream surfaced one. */
76
+ errorText?: string;
77
+ /** Set when the reply is not a trustworthy result. Usually `text` is empty, but `fetch_failed` can
78
+ * accompany NON-empty `text` — an image billed at text-only tokens was never seen, so its "description"
79
+ * is confabulated. undefined ⇔ a real success; when set, callers must NOT treat `text` as valid. */
80
+ failure?: MediaUnderstandFailure;
81
+ }
82
+ /**
83
+ * Stream an already-built understanding request and classify an empty reply. Placement of the
84
+ * prompt and media URL(s) onto the request is the CALLER's job — this owns only the streaming +
85
+ * diagnosis, so every vision caller (the turn gate's understandMediaUrl AND the pet forge's image
86
+ * analysis / vision-QA) shares ONE definition of "fetch_failed vs empty_output vs stream_error"
87
+ * instead of each re-deriving it from a thin delta-only loop. `kind` drives only the image
88
+ * token-floor heuristic — pass the kind of the primary medium carried on the request.
89
+ */
90
+ export declare function streamUnderstanding(client: UnderstandMediaClient, request: Record<string, unknown>, kind: UnderstandMediaKind, opts?: {
91
+ signal?: AbortSignal;
92
+ }): Promise<UnderstandMediaResult>;
93
+ /**
94
+ * Understand a single medium at `url`. Returns a structured result: the trimmed text (may be
95
+ * empty) plus, when empty, a `failure` classifying WHY. Never throws for an empty reply — the
96
+ * caller decides how to degrade, but can now tell a delivery failure (`fetch_failed`) apart from a
97
+ * blank description (`empty_output`) instead of treating every empty reply the same. Thin wrapper
98
+ * over streamUnderstanding that builds the single-URL, modality-correct request.
42
99
  */
43
100
  export declare function understandMediaUrl(client: UnderstandMediaClient, kind: UnderstandMediaKind, url: string, opts?: {
44
101
  signal?: AbortSignal;
45
- }): Promise<string>;
102
+ }): Promise<UnderstandMediaResult>;
@@ -1,3 +1,4 @@
1
+ import { type HostRequestRequester } from "../skills/memory/host-memory-provider.js";
1
2
  import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
2
3
  import type { HookRegistry } from "../contracts/hooks.js";
3
4
  import type { RuntimeLogger } from "../runtime/hooks/hook-registry.js";
@@ -12,6 +13,13 @@ export interface MemoryProviderState {
12
13
  dreamProvider: MemoryDreamRuntimeProvider | null;
13
14
  userId: string;
14
15
  }
16
+ /** Host-request access exposed by the ACP protocol coordinator. */
17
+ export interface MemoryHostRequestAccess {
18
+ supportsHostRequestService(service: "memory"): boolean;
19
+ readonly hostRequest: HostRequestRequester;
20
+ }
21
+ /** 装配期绑定(stdio-runtime-services 注入;lazy resolver——gate 在创建时刻现读)。重绑重置选型护栏。 */
22
+ export declare function bindMemoryHostRequestAccess(resolve: () => MemoryHostRequestAccess | null): void;
15
23
  export declare function ensureLocalMemoryProvider(currentUserId: string): MemoryProviderState;
16
24
  export interface RegisterMemoryRuntimeHooksDeps {
17
25
  hooks: HookRegistry;
@@ -22,6 +22,8 @@ export interface MultiAgentHandlerHostDeps {
22
22
  log(message: string): void;
23
23
  sendNotification(method: string, params: Record<string, unknown>): void;
24
24
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
25
+ /** 激活层(S3c):gateway-routed delegate 桥(懒读;未挂/gate 关 = undefined → 各旧本地 spawn 路径)。 */
26
+ getDelegateBridge?: ProductHandlerHost["getDelegateBridge"];
25
27
  }
26
28
  export declare function createMultiAgentHandlerHost(deps: MultiAgentHandlerHostDeps): MultiAgentHandlerHost;
27
29
  export {};
@@ -2,6 +2,7 @@ import type { HookRegistry } from "../contracts/hooks.js";
2
2
  import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
3
3
  import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
4
4
  import type { ToolCatalog } from "../runtime/ports/index.js";
5
+ import type { HostProfileClient } from "../transport/host-profile-client.js";
5
6
  import { type RuntimePermissionChecker, type RuntimePermissionRuleEngine } from "./permission-runtime-service.js";
6
7
  export { createApprovalResponseFromAcpOption } from "./permission-approval-bridge.js";
7
8
  export interface PermissionBootstrapDeps {
@@ -30,6 +31,7 @@ export interface PermissionBootstrapDeps {
30
31
  } | undefined;
31
32
  sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
32
33
  isPetActive(): boolean;
34
+ resolveHostProfileClient?: () => HostProfileClient | undefined;
33
35
  currentUnregister?: (() => void) | null;
34
36
  }
35
37
  export interface PermissionBootstrapResult {
@@ -40,7 +40,6 @@ export interface PetLlmClient {
40
40
  export interface PetRuntime {
41
41
  createPetSoulGenerator(): PetSoulGenerator | undefined;
42
42
  createSmallLLMCall(): SmallLlmCall | undefined;
43
- forgeAnalyzeImage(imageBase64: string, hint?: string): Promise<string>;
44
43
  isImageGenerationAvailable(): boolean;
45
44
  isPetdexForgeAvailable(): boolean;
46
45
  forgeGeneratePetdexAtlas(input: PetdexForgeInput): Promise<PetdexForgeOutput>;
@@ -2,6 +2,7 @@ import type { HookRegistry } from "../contracts/hooks.js";
2
2
  import type { RuntimeLogger } from "../runtime/hooks/hook-registry.js";
3
3
  import type { PathService, ToolCatalog } from "../runtime/ports/index.js";
4
4
  import { PluginLoader } from "../skills/plugins/plugin-loader.js";
5
+ export declare const HOST_PLUGIN_REFS_FILE_ENV = "QLOGICAGENT_HOST_PLUGIN_REFS_FILE";
5
6
  export interface PluginBootstrapDeps {
6
7
  config: Record<string, unknown>;
7
8
  hooks: HookRegistry;
@@ -12,4 +13,4 @@ export interface PluginBootstrapDeps {
12
13
  }
13
14
  export declare const pluginToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<PluginBootstrapDeps>;
14
15
  export declare function configurePluginBootstrap(deps: PluginBootstrapDeps): void;
15
- export declare function resolvePluginDirsFromConfig(config: Record<string, unknown>, pathService: PathService): string[];
16
+ export declare function resolvePluginDirsFromConfig(config: Record<string, unknown>, _pathService: PathService, hostRefs?: readonly string[]): string[];
@@ -1,5 +1,6 @@
1
1
  import { ProductOrchestrator } from "../orchestration/agent-instance.js";
2
2
  import { ProductPlanner } from "../orchestration/product-planner.js";
3
+ import type { DelegateBridge } from "../orchestration/delegation-coordinator.js";
3
4
  import { AgentProcessManager } from "../runtime/infra/agent-process.js";
4
5
  import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
5
6
  import type { AcpDetector } from "../runtime/infra/acp-detector.js";
@@ -20,6 +21,8 @@ export interface ProductCoordinatorHost {
20
21
  }): void;
21
22
  handleMcpToolCall(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
22
23
  sendNotification(method: string, params: Record<string, unknown>): void;
24
+ /** 激活层(S3c):gateway-routed delegate 桥(gate 关/未挂 = undefined → 旧本地 spawn 路径)。 */
25
+ getDelegateBridge?(): DelegateBridge | undefined;
23
26
  }
24
27
  /** productId → 容器项目 id(R2 容器优先,与 solo-handler.soloProjectMap 对称)。终态回写用。
25
28
  * 定义在此(callbacks 所在文件)与 solo 对称;product-handler 再导出供 ACP 入口/测试引用。 */
@@ -29,6 +32,6 @@ export declare const productProjectMap: Map<string, string>;
29
32
  * 刷新后留存。**仅当项目仍 "running" 时迁移**——避免"完成晚到覆盖取消"或反向覆盖(R1 cancel-clobber
30
33
  * 教训)。成功 → "completed";失败 → "failed";取消 → "cancelled"。
31
34
  */
32
- export declare function writeProductTerminalPlanStatus(host: ProductCoordinatorHost, productId: string, status: "completed" | "failed" | "cancelled"): void;
35
+ export declare function writeProductTerminalPlanStatus(host: ProductCoordinatorHost, productId: string, status: "completed" | "failed" | "cancelled"): Promise<void>;
33
36
  export declare function ensureProductOrchestrator(host: ProductCoordinatorHost): ProductOrchestrator;
34
37
  export declare function ensureProductPlanner(host: ProductCoordinatorHost): ProductPlanner;
@@ -10,7 +10,6 @@ import { type PetHandlerHost } from "./handlers/pet-handler.js";
10
10
  import { type WorkflowHandlerHost } from "./handlers/workflow-handler.js";
11
11
  import { type ProjectHandlerHost } from "./handlers/project-handler.js";
12
12
  import { type SessionHandlerHost } from "./handlers/session-handler.js";
13
- import { type SettingsHandlerHost } from "./handlers/settings-handler.js";
14
13
  import { type SkillsHandlerHost } from "./handlers/skills-handler.js";
15
14
  import { type TurnBaselineHandlerHost } from "./handlers/turn-baseline-handler.js";
16
15
  import { type MessageFeedbackHandlerHost } from "./handlers/message-feedback-handler.js";
@@ -18,7 +17,7 @@ import { type TurnControlHandlerHost } from "./handlers/turn-handler.js";
18
17
  import { type WorkingMaterialsHandlerHost } from "./handlers/working-materials-handler.js";
19
18
  import { type DreamHandlerHost } from "./handlers/dream-handler.js";
20
19
  import type { MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
21
- export type RpcMethodHandler = (msg: AgentRpcRequest) => void;
20
+ export type RpcMethodHandler = (msg: AgentRpcRequest) => void | Promise<void>;
22
21
  /**
23
22
  * Per-domain host adapters the RPC registry binds handlers to. Each field is
24
23
  * typed to exactly ONE handler's narrow contract, so the host (StdioServer)
@@ -59,7 +58,6 @@ export interface RpcHandlerHosts {
59
58
  petConfirm: PetConfirmHandlerHost;
60
59
  project: ProjectHandlerHost;
61
60
  community: CommunityHandlerHost;
62
- settings: SettingsHandlerHost;
63
61
  dream: DreamHandlerHost;
64
62
  turn: TurnControlHandlerHost;
65
63
  turnBaseline: TurnBaselineHandlerHost;
@@ -1,12 +1,10 @@
1
1
  import type { AgentLogger } from "../agent/types.js";
2
2
  import type { HookRegistry } from "../contracts/hooks.js";
3
3
  import { type FileWatcher } from "../runtime/infra/file-watcher.js";
4
- import type { PermissionRuleEnginePort } from "../runtime/ports/index.js";
5
4
  export type { FileWatcher };
6
5
  export interface RuntimeWatcherBootstrapDeps {
7
6
  config: Record<string, unknown>;
8
7
  hooks: HookRegistry;
9
- ruleEngine: PermissionRuleEnginePort;
10
8
  sessionId: string;
11
9
  currentFileWatcher: FileWatcher | null;
12
10
  log: AgentLogger;
@@ -13,7 +13,7 @@
13
13
  * set_config) — keeps working unchanged.
14
14
  */
15
15
  import type { SessionState } from "../runtime/session/session-state.js";
16
- import type { SessionLlmConfig } from "./acp-session-host.js";
16
+ import type { MaterializedSessionProfile, SessionLlmConfig } from "./acp-session-host.js";
17
17
  export declare class SessionContext {
18
18
  /** Active session id (chatId for desktop; group key pattern for groups). */
19
19
  sessionId: string;
@@ -23,7 +23,9 @@ export declare class SessionContext {
23
23
  state: SessionState | null;
24
24
  /** Host-pinned per-session LLM config (session/set_config_option · set_model · /model).
25
25
  * NEVER wiped by ModelRegistry churn — distinct from the DERIVED ResolvedAgentCache. */
26
- llmConfig: SessionLlmConfig;
26
+ llmConfigBySession: Map<string, SessionLlmConfig>;
27
+ /** Gateway-materialized profiles are private to their ACP session. */
28
+ materializedProfiles: Map<string, MaterializedSessionProfile>;
27
29
  /** ACP session-level context supplement (_meta from session/new), inherited by every prompt.
28
30
  * LEGACY per-connection singleton — kept for old-gateway fallback; multiplexed prompts read
29
31
  * acpMetaBySession by sessionId instead. */
@@ -1,8 +1,10 @@
1
+ import type { HostCapabilityClient } from "../transport/host-capability-client.js";
1
2
  export interface RunSkillInvocationParams {
2
3
  skillName: string;
3
4
  skillContent: string;
4
5
  userArgs?: string;
5
6
  skillDir?: string;
6
7
  sessionId?: string;
8
+ hostCapabilityClient: HostCapabilityClient;
7
9
  }
8
10
  export declare function runSkillInvocation(params: RunSkillInvocationParams): Promise<string>;
@@ -1,6 +1,7 @@
1
1
  import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
2
2
  import type { MemoryLearningSink, PathService, ToolCatalog } from "../runtime/ports/index.js";
3
3
  import type { WorkspaceSkill } from "../skills/skill-system/skill-types.js";
4
+ import type { HostCapabilityClient } from "../transport/host-capability-client.js";
4
5
  export interface SkillToolsBootstrapDeps {
5
6
  config: Record<string, unknown>;
6
7
  pathService: PathService;
@@ -10,6 +11,7 @@ export type SkillLearningMemorySink = MemoryLearningSink;
10
11
  export interface SkillToolsHost {
11
12
  getActiveProjectRoot(): string;
12
13
  getPluginSkills(): WorkspaceSkill[];
14
+ getHostCapabilityClient(): HostCapabilityClient | undefined;
13
15
  sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
14
16
  getMemoryLearningSink(): SkillLearningMemorySink | null;
15
17
  getMemoryUserId(): string;
@@ -1,3 +1,4 @@
1
+ import type { HostCapabilityClient } from "../transport/host-capability-client.js";
1
2
  export interface SkillListEntry {
2
3
  id: string;
3
4
  name: string;
@@ -37,4 +38,4 @@ export interface SkillListEntry {
37
38
  * scope and whether it is active in the given project. Name-collisions cannot
38
39
  * occur (one directory per name in the store), so each skill appears once.
39
40
  */
40
- export declare function listSkillsForProject(projectRoot?: string): SkillListEntry[];
41
+ export declare function listSkillsForProject(capability: HostCapabilityClient | undefined, projectRoot?: string): Promise<SkillListEntry[]>;
@@ -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[];