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.
- 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 +536 -525
- 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 +13 -0
- package/dist/types/agent/tool-loop.test-harness.d.ts +20 -0
- package/dist/types/agent/types.d.ts +8 -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/dream-host-adapter.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/dream-handler.d.ts +4 -0
- 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 +31 -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 +4 -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-catalog.d.ts +12 -0
- package/dist/types/runtime/session/session-persistence.d.ts +30 -11
- 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 +20 -11
- package/dist/types/skills/memory/local-store.d.ts +5 -2
- 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,13 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* provider.list, tools.list, todos.list, tasks.list, tasks.cancel
|
|
5
|
-
*
|
|
6
|
-
* NOTE: Provider/model/key management is handled by settings-handler.ts (settings.* RPC).
|
|
7
|
-
* config.get/config.update only operate on tunables and non-model settings.
|
|
2
|
+
* Provider/catalog and task-list handlers retained after the public config.* RPC teardown.
|
|
3
|
+
* Profile/tunable state is gateway-owned and is available to agent tools only through private X7.
|
|
8
4
|
*/
|
|
9
5
|
import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
10
|
-
import type { PermissionMode } from "../../runtime/ports/index.js";
|
|
11
6
|
import type { BackgroundTaskManager } from "../../runtime/infra/background-tasks.js";
|
|
12
7
|
import type { TaskStore } from "../../runtime/infra/task-runtime.js";
|
|
13
8
|
import type { ToolCatalog } from "../../runtime/ports/index.js";
|
|
@@ -16,18 +11,10 @@ export interface ConfigHandlerHost {
|
|
|
16
11
|
backgroundTasks: BackgroundTaskManager;
|
|
17
12
|
toolCatalog?: ToolCatalog;
|
|
18
13
|
syncToolListMediaConfig?(): void;
|
|
19
|
-
/** 权限热应用:config.update 写盘后立即同步活的 rule engine(否则要等下一轮 _meta/重启)。 */
|
|
20
|
-
applyPermissionConfig?(perm: {
|
|
21
|
-
mode: PermissionMode;
|
|
22
|
-
}): void;
|
|
23
14
|
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
24
15
|
}
|
|
25
16
|
export declare function handleToolsList(this: ConfigHandlerHost, msg: AgentRpcRequest): void;
|
|
26
17
|
export declare function handleProviderList(this: ConfigHandlerHost, msg: AgentRpcRequest): void;
|
|
27
|
-
export declare function handleConfigGet(this: ConfigHandlerHost, msg: AgentRpcRequest): void;
|
|
28
|
-
export declare function handleConfigUpdate(this: ConfigHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
29
|
-
export declare function handleConfigTunables(this: ConfigHandlerHost, msg: AgentRpcRequest): void;
|
|
30
|
-
export declare function handleConfigUpdateTunable(this: ConfigHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
31
18
|
export declare function handleTodosList(this: ConfigHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
32
19
|
export declare function handleTasksList(this: ConfigHandlerHost, msg: AgentRpcRequest): void;
|
|
33
20
|
export declare function handleTasksCancel(this: ConfigHandlerHost, msg: AgentRpcRequest): void;
|
|
@@ -17,6 +17,10 @@ export interface DreamHandlerHost {
|
|
|
17
17
|
currentHooks?: DreamRunDeps["hooks"] | null;
|
|
18
18
|
memoryProvider?: DreamMemoryProvider | null;
|
|
19
19
|
memoryUserId?: string;
|
|
20
|
+
/** Lazy read-path init for the L2 memory provider (cheap, side-effect-free DB open). Consumers
|
|
21
|
+
* that can run before any turn (goal planning's orchestration memory context, memory.atlas)
|
|
22
|
+
* must call this before reading memoryProvider — on a cold process nothing else has built it. */
|
|
23
|
+
ensureMemoryProvider?(): void;
|
|
20
24
|
toolCatalog: ToolCatalog;
|
|
21
25
|
taskStore: TaskStore;
|
|
22
26
|
verbose?: boolean;
|
|
@@ -14,7 +14,8 @@ interface PetMemoryActivitySummary {
|
|
|
14
14
|
}>;
|
|
15
15
|
}
|
|
16
16
|
interface PetMemoryProviderLike {
|
|
17
|
-
|
|
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"
|
|
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
|
|
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
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* and
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
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
|
-
*
|
|
183
|
-
*
|
|
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
|
|
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[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a media reference into a form a REMOTE model can consume, by rewriting a LOCAL file path to
|
|
3
|
+
* the gateway's `/api/media/local?src=file://…` proxy URL.
|
|
4
|
+
*
|
|
5
|
+
* Why the proxy URL (not a raw path, not base64, not the provider file-API upload):
|
|
6
|
+
* - A tool result (e.g. the `read` tool reading a workspace image) carries a RAW local path
|
|
7
|
+
* (`C:\…\assets\images\x.jpg`) a remote model cannot fetch → the understanding model returns empty.
|
|
8
|
+
* - A base64 `data:` URL blows past the LLM gateway's request-size limit → HTTP 413.
|
|
9
|
+
* - The provider file-API upload (media-file-api-service) needs a Files-API provider that isn't always
|
|
10
|
+
* configured → "no provider".
|
|
11
|
+
* - The `127.0.0.1/api/media/local` proxy URL is exactly what user-attachments use: provider-core's
|
|
12
|
+
* FileUploadAdapter (given QLOGICAGENT_HUB_URL) relays it to hub OSS → a small public URL. Proven path.
|
|
13
|
+
*
|
|
14
|
+
* Remote (`http`/`https`/`data`/`blob`) URLs, non-media extensions, and missing files pass through
|
|
15
|
+
* unchanged. Never throws.
|
|
16
|
+
*/
|
|
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:
|
|
33
|
-
type: string;
|
|
34
|
-
text?: string;
|
|
35
|
-
}>;
|
|
48
|
+
stream(request: object, apiKey: string, signal?: AbortSignal): AsyncIterable<UnderstandMediaChunk>;
|
|
36
49
|
};
|
|
37
50
|
}
|
|
38
51
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
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<
|
|
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>,
|
|
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
|
-
|
|
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[]>;
|