qlogicagent 2.18.9 → 2.18.10

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 (62) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/host-contract.js +1 -1
  3. package/dist/index.js +445 -984
  4. package/dist/pet-host.js +8 -8
  5. package/dist/project-memory-host.js +40 -0
  6. package/dist/protocol.js +1 -1
  7. package/dist/types/cli/acp-session-host.d.ts +1 -1
  8. package/dist/types/cli/community-resource-installer.d.ts +3 -5
  9. package/dist/types/cli/default-project-bootstrap.d.ts +1 -1
  10. package/dist/types/cli/handlers/agents-handler.d.ts +8 -6
  11. package/dist/types/cli/handlers/community-handler.d.ts +0 -4
  12. package/dist/types/cli/handlers/control-handler.d.ts +1 -1
  13. package/dist/types/cli/handlers/project-handler.d.ts +1 -1
  14. package/dist/types/cli/handlers/session-handler.d.ts +0 -7
  15. package/dist/types/cli/handlers/solo-handler.d.ts +0 -2
  16. package/dist/types/cli/memory-coordinator.d.ts +1 -1
  17. package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -3
  18. package/dist/types/cli/pet-runtime.d.ts +5 -5
  19. package/dist/types/cli/product-coordinator.d.ts +0 -2
  20. package/dist/types/cli/project-memory-store-factory.d.ts +11 -1
  21. package/dist/types/cli/rpc-registry.d.ts +0 -2
  22. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +2 -0
  23. package/dist/types/cli/stdio-runtime-services.d.ts +2 -0
  24. package/dist/types/cli/stdio-server.d.ts +3 -1
  25. package/dist/types/config/cn-mirror.d.ts +2 -2
  26. package/dist/types/host-contract/index.d.ts +167 -9
  27. package/dist/types/orchestration/agent-instance.d.ts +1 -3
  28. package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -3
  29. package/dist/types/orchestration/goal-run-persistence.d.ts +0 -3
  30. package/dist/types/orchestration/product-persistence.d.ts +1 -4
  31. package/dist/types/orchestration/product-planner.d.ts +2 -3
  32. package/dist/types/orchestration/run-state-host-authority.d.ts +7 -0
  33. package/dist/types/orchestration/solo-evaluator.d.ts +2 -3
  34. package/dist/types/orchestration/solo-persistence.d.ts +4 -7
  35. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +13 -2
  36. package/dist/types/orchestration/workflow/node-schema.d.ts +2 -1
  37. package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
  38. package/dist/types/orchestration/workflow/workflow-bundle.d.ts +1 -1
  39. package/dist/types/project-memory-host.d.ts +3 -0
  40. package/dist/types/protocol/wire/acp-agent-management.d.ts +1 -1
  41. package/dist/types/protocol/wire/acp-protocol.d.ts +1 -1
  42. package/dist/types/runtime/infra/acp-detector.d.ts +1 -1
  43. package/dist/types/runtime/infra/background-tasks.d.ts +1 -1
  44. package/dist/types/runtime/pet/pet-community-assets.d.ts +7 -17
  45. package/dist/types/runtime/pet/petdex-vision-qa.d.ts +12 -0
  46. package/dist/types/runtime/ports/memory-recall-source.d.ts +10 -0
  47. package/dist/types/runtime/ports/project-memory-store.d.ts +1 -1
  48. package/dist/types/runtime/session/session-persistence.d.ts +3 -4
  49. package/dist/types/skills/memory/host-memory-provider.d.ts +2 -2
  50. package/dist/types/skills/memory/memory-config-resolver.d.ts +4 -0
  51. package/dist/types/skills/memory/task-distillation.d.ts +1 -1
  52. package/dist/types/test-support/run-state-authority-setup.d.ts +1 -0
  53. package/dist/types/transport/host-pet-client.d.ts +20 -0
  54. package/dist/types/transport/host-run-state-client.d.ts +17 -0
  55. package/dist/workflow-host.js +9 -9
  56. package/package.json +12 -2
  57. package/dist/runtime/infra/mcp-bridge-server.js +0 -338
  58. package/dist/types/cli/handlers/message-feedback-handler.d.ts +0 -31
  59. package/dist/types/runtime/infra/agent-process.d.ts +0 -368
  60. package/dist/types/runtime/infra/external-agent-pool.d.ts +0 -89
  61. package/dist/types/skills/memory/local-memory-provider.d.ts +0 -325
  62. package/dist/types/skills/memory/memory-provider-factory.d.ts +0 -33
@@ -46,7 +46,7 @@ export interface AcpSessionHost {
46
46
  cancelIdleDreamTimer(): void;
47
47
  disposeSessionRuntime?(): void;
48
48
  enableIdleDream(): void;
49
- ensureDefaultProject(): void;
49
+ ensureDefaultProject(): void | Promise<void>;
50
50
  initializeHostProjectAuthority?(): Promise<void>;
51
51
  /**
52
52
  * Ensure the model-registry catalog (this.models) is hydrated from the owner profile +
@@ -1,8 +1,8 @@
1
1
  import type { CommunityInstallResolution } from "../runtime/community/community-consent-client.js";
2
- import { type InstalledCommunityPet } from "../runtime/pet/pet-community-assets.js";
2
+ import { type CommunityPetAdoptionProposal } from "../runtime/pet/pet-community-assets.js";
3
3
  import { type CommunityInstalledResource, type InstallCommunitySkillOptions } from "./community-skill-installer.js";
4
4
  import { type CommunityWorkflowBundlePayload } from "./community-workflow-installer.js";
5
- export type CommunityInstalledAnyResource = CommunityInstalledResource | InstalledCommunityPet | CommunityWorkflowBundlePayload;
5
+ export type CommunityInstalledAnyResource = CommunityInstalledResource | CommunityPetAdoptionProposal | CommunityWorkflowBundlePayload;
6
6
  export interface CommunityMcpInstallPreview {
7
7
  kind: "mcp";
8
8
  mode: "preview";
@@ -27,6 +27,4 @@ export interface CommunityExecutableLauncherGate {
27
27
  autoRunBlocked: true;
28
28
  manifest: unknown;
29
29
  }
30
- export declare function installCommunityResource(install: CommunityInstallResolution, options?: InstallCommunitySkillOptions & {
31
- ownerUserId?: string;
32
- }): Promise<CommunityInstalledAnyResource | CommunityMcpInstallPreview | CommunityExecutableLauncherGate>;
30
+ export declare function installCommunityResource(install: CommunityInstallResolution, options?: InstallCommunitySkillOptions): Promise<CommunityInstalledAnyResource | CommunityMcpInstallPreview | CommunityExecutableLauncherGate>;
@@ -24,7 +24,7 @@ interface DeferredHeavyWork {
24
24
  }
25
25
  /** Resolves once the most recently scheduled deferred heavy work has settled (never rejects). */
26
26
  export declare function getDefaultProjectHeavyWorkPromise(): Promise<void>;
27
- export declare function ensureDefaultProjectBootstrap(deps: DefaultProjectBootstrapDeps): ProjectMemoryStore;
27
+ export declare function ensureDefaultProjectBootstrap(deps: DefaultProjectBootstrapDeps): Promise<ProjectMemoryStore>;
28
28
  /**
29
29
  * Schedule (fire-and-forget) the deferred heavy work so it runs off the synchronous initialize path.
30
30
  * Exposed for tests; production calls it from ensureDefaultProjectBootstrap. Records a gate promise on
@@ -5,15 +5,11 @@
5
5
  * agents.kill, agents.listConfigured, agents.getLog, agents.testConnection
6
6
  */
7
7
  import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
8
- import type { AgentProcessManager } from "../../runtime/infra/agent-process.js";
9
8
  import type { AgentConfigStore } from "../../runtime/infra/agent-config-store.js";
10
9
  import { type AcpDetector } from "../../runtime/infra/acp-detector.js";
11
- import { type PooledTurnCtx } from "../../runtime/infra/external-agent-pool.js";
12
10
  import type { DelegateBridge } from "../../orchestration/delegation-coordinator.js";
13
11
  export interface AgentsHandlerHost {
14
12
  acpDetector: AcpDetector;
15
- soloProcessManager: AgentProcessManager | null;
16
- productProcessManager: AgentProcessManager | null;
17
13
  ensureAgentConfigStore(): Promise<AgentConfigStore>;
18
14
  getActiveProjectRoot?(): string;
19
15
  handleMcpToolCall?(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
@@ -23,6 +19,13 @@ export interface AgentsHandlerHost {
23
19
  /** 激活层(S3c §1.1):gateway-routed delegate 桥(懒读;未挂/gate 关 = undefined → 旧进程池路径)。 */
24
20
  getDelegateBridge?(): DelegateBridge | undefined;
25
21
  }
22
+ interface PooledTurnCtx {
23
+ sessionId?: string;
24
+ turnId?: string;
25
+ requestId?: string;
26
+ deltas: string[];
27
+ streamedAny: boolean;
28
+ }
26
29
  export declare function relayPooledTurnNotification(input: {
27
30
  agentId: string;
28
31
  turn: PooledTurnCtx | null;
@@ -68,8 +71,6 @@ export declare function handleAgentsLogout(this: AgentsHandlerHost, msg: AgentRp
68
71
  export declare function handleAgentsSetGateway(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
69
72
  export declare function handleAgentsGetGateway(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
70
73
  export declare function handleAgentsListConfigured(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
71
- export declare function handleAgentsProcesses(this: AgentsHandlerHost, msg: AgentRpcRequest): void;
72
- export declare function handleAgentsKill(this: AgentsHandlerHost, msg: AgentRpcRequest): void;
73
74
  export declare function handleAgentsGetLog(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
74
75
  export declare function handleAgentsTestConnection(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
75
76
  /** Formats a session persisted transcript into a compact prior-conversation block for an external
@@ -117,3 +118,4 @@ export declare function resolveNativeColdResume(input: {
117
118
  /** Pre-warm an external agent's process (on agent-select) so the first message skips the cold start. */
118
119
  export declare function handleAgentsWarm(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
119
120
  export declare function handleAgentsPrompt(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
121
+ export {};
@@ -6,10 +6,6 @@ export interface CommunityHandlerHost {
6
6
  resolveCommunityConsentClient?: () => CommunityConsentClient | null;
7
7
  getHostCapabilityClient?(): HostCapabilityClient | undefined;
8
8
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
9
- /** Push a JSON-RPC notification (e.g. pet.asset.updated after a community pet install hydrates the UI store). */
10
- sendNotification(method: string, params: Record<string, unknown>): void;
11
- /** Active owner id, so community pet install/publish land in the same profile pet.status reads. */
12
- memoryUserId?: string;
13
9
  }
14
10
  export declare function handleCommunityResolveInstall(this: CommunityHandlerHost, msg: AgentRpcRequest): Promise<void>;
15
11
  export declare function handleCommunityListResourceVersions(this: CommunityHandlerHost, msg: AgentRpcRequest): Promise<void>;
@@ -14,7 +14,7 @@ export interface ControlHandlerHost {
14
14
  log(message: string): void;
15
15
  sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
16
16
  sendNotification<M extends keyof NotificationMethodMap>(method: M, params: NotificationMethodMap[M]): void;
17
- ensureDefaultProject(): void;
17
+ ensureDefaultProject(): void | Promise<void>;
18
18
  /** LH-10: propagate an explicit cancel to the background tasks the current
19
19
  * session launched. No-op if the host has no task registry. */
20
20
  cancelBackgroundTasksForSession?(sessionId?: string): void;
@@ -19,7 +19,7 @@ export interface ProjectHandlerHost {
19
19
  }
20
20
  export declare function handleProjectCreate(this: ProjectHandlerHost, msg: AgentRpcRequest): Promise<void>;
21
21
  export declare function handleProjectList(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
22
- export declare function handleProjectSwitch(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
22
+ export declare function handleProjectSwitch(this: ProjectHandlerHost, msg: AgentRpcRequest): Promise<void>;
23
23
  /**
24
24
  * Reliable recursive directory removal for Windows. fs.rmSync({recursive,force}) cannot be trusted
25
25
  * here: on git repos it silently leaves read-only object/pack files (and whole subtrees) behind
@@ -90,13 +90,6 @@ 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): Promise<void>;
94
- export declare function handleSessionGetState(this: SessionHandlerHost, msg: AgentRpcRequest): void;
95
- /**
96
- * `session.focus` - Desktop UI reports which session is currently focused.
97
- * Agent switches active project/cwd to the session's owning project.
98
- */
99
- export declare function handleSessionFocus(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
100
93
  /**
101
94
  * `session.moveToProject` - Move a session from one project to another.
102
95
  * Physically copies session files, updates metadata.projectId, then removes the source.
@@ -3,7 +3,6 @@
3
3
  * Handles: solo.start, solo.status, solo.cancel, solo.select,
4
4
  * solo.list, solo.delete, solo.message, solo.evaluate
5
5
  */
6
- import { AgentProcessManager } from "../../runtime/infra/agent-process.js";
7
6
  import type { AcpDetector } from "../../runtime/infra/acp-detector.js";
8
7
  import type { AgentConfigStore } from "../../runtime/infra/agent-config-store.js";
9
8
  import { SoloEvaluator } from "../../orchestration/solo-evaluator.js";
@@ -12,7 +11,6 @@ import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/in
12
11
  export declare const soloProjectMap: Map<string, string>;
13
12
  export interface SoloHandlerHost {
14
13
  soloEvaluator: SoloEvaluator | null;
15
- soloProcessManager: AgentProcessManager | null;
16
14
  acpDetector: AcpDetector;
17
15
  agentConfigStore: AgentConfigStore | null;
18
16
  sendNotification(method: string, params: Record<string, unknown>): void;
@@ -20,7 +20,7 @@ export interface MemoryHostRequestAccess {
20
20
  }
21
21
  /** 装配期绑定(stdio-runtime-services 注入;lazy resolver——gate 在创建时刻现读)。重绑重置选型护栏。 */
22
22
  export declare function bindMemoryHostRequestAccess(resolve: () => MemoryHostRequestAccess | null): void;
23
- export declare function ensureLocalMemoryProvider(currentUserId: string): MemoryProviderState;
23
+ export declare function ensureHostMemoryProvider(currentUserId: string): MemoryProviderState;
24
24
  export interface RegisterMemoryRuntimeHooksDeps {
25
25
  hooks: HookRegistry;
26
26
  currentUserId: string;
@@ -1,11 +1,8 @@
1
1
  import type { ProductOrchestrator } from "../orchestration/agent-instance.js";
2
2
  import type { ProductPlanner } from "../orchestration/product-planner.js";
3
3
  import type { SoloEvaluator } from "../orchestration/solo-evaluator.js";
4
- import type { AgentProcessManager } from "../runtime/infra/agent-process.js";
5
4
  export declare class MultiAgentStateCoordinator {
6
5
  soloEvaluator: SoloEvaluator | null;
7
6
  productOrchestrator: ProductOrchestrator | null;
8
7
  productPlanner: ProductPlanner | null;
9
- soloProcessManager: AgentProcessManager | null;
10
- productProcessManager: AgentProcessManager | null;
11
8
  }
@@ -2,6 +2,7 @@ import type { ChatMessage } from "../agent/types.js";
2
2
  import type { ModelPurpose } from "../runtime/infra/model-registry.js";
3
3
  import { type PetStats, type PetdexPetAsset, type PetdexValidationReport } from "../runtime/pet/index.js";
4
4
  import { type PetdexProductionRun } from "../runtime/pet/petdex-forge-service.js";
5
+ import type { HostPetClient } from "../transport/host-pet-client.js";
5
6
  import type { LLMTransport } from "./provider-core-facade.js";
6
7
  export type PetSoulGenerator = (rarity: string, stats: PetStats) => Promise<{
7
8
  name: string;
@@ -47,15 +48,14 @@ export interface PetRuntime {
47
48
  reactAfterTurn(messages: ChatMessage[]): Promise<void>;
48
49
  /** Backfill missing daily journey summaries (per-owner, cross-project, idempotent, best-effort).
49
50
  * Owns the LLM + project-listing side effects so stdio-server doesn't reach into runtime/infra. */
50
- catchUpJourney(memoryUserId: string): Promise<string[]>;
51
+ catchUpJourney(): Promise<string[]>;
52
+ refreshActive(): Promise<boolean>;
51
53
  isActive(): boolean;
52
54
  }
53
55
  export interface PetRuntimeDeps {
54
- getActiveProjectRoot(): string;
55
- resolveOwnerUserId?: () => string;
56
56
  resolveClientForPurpose(purpose: ModelPurpose): PetLlmClient | null;
57
57
  sendNotification(method: string, params: Record<string, unknown>): void;
58
- /** Project ids for the cross-project journey backfill — injected so pet-runtime never imports the project store. */
59
- listProjectIds?: () => string[];
58
+ getCurrentSessionId?(): string | undefined;
59
+ resolveHostPetClient?(): HostPetClient | undefined;
60
60
  }
61
61
  export declare function createPetRuntime(deps: PetRuntimeDeps): PetRuntime;
@@ -1,7 +1,6 @@
1
1
  import { ProductOrchestrator } from "../orchestration/agent-instance.js";
2
2
  import { ProductPlanner } from "../orchestration/product-planner.js";
3
3
  import type { DelegateBridge } from "../orchestration/delegation-coordinator.js";
4
- import { AgentProcessManager } from "../runtime/infra/agent-process.js";
5
4
  import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
6
5
  import type { AcpDetector } from "../runtime/infra/acp-detector.js";
7
6
  export interface ProductCoordinatorHost {
@@ -9,7 +8,6 @@ export interface ProductCoordinatorHost {
9
8
  agentConfigStore: AgentConfigStore | null;
10
9
  productOrchestrator: ProductOrchestrator | null;
11
10
  productPlanner: ProductPlanner | null;
12
- productProcessManager: AgentProcessManager | null;
13
11
  emitAgentStatus(agentId: string, state: string, extra?: {
14
12
  missedBeats?: number;
15
13
  lastActivityAt?: number;
@@ -1,2 +1,12 @@
1
+ import type { HostRequestParams, HostRequestService } from "../host-contract/index.js";
1
2
  import type { ProjectMemoryStoreFactory } from "../runtime/ports/index.js";
2
- export declare function createCliProjectMemoryStoreFactory(): ProjectMemoryStoreFactory;
3
+ export interface ProjectMemoryHostRequestAccess {
4
+ supportsHostRequestService(service: HostRequestService): boolean;
5
+ readonly hostRequest: {
6
+ request(params: HostRequestParams, opts?: {
7
+ timeoutMs?: number;
8
+ signal?: AbortSignal;
9
+ }): Promise<unknown>;
10
+ };
11
+ }
12
+ export declare function createCliProjectMemoryStoreFactory(resolveAccess?: () => ProjectMemoryHostRequestAccess | null, resolveSessionId?: () => string | undefined): ProjectMemoryStoreFactory;
@@ -9,7 +9,6 @@ import { type ProjectHandlerHost } from "./handlers/project-handler.js";
9
9
  import { type SessionHandlerHost } from "./handlers/session-handler.js";
10
10
  import { type SkillsHandlerHost } from "./handlers/skills-handler.js";
11
11
  import { type TurnBaselineHandlerHost } from "./handlers/turn-baseline-handler.js";
12
- import { type MessageFeedbackHandlerHost } from "./handlers/message-feedback-handler.js";
13
12
  import { type TurnControlHandlerHost } from "./handlers/turn-handler.js";
14
13
  import { type WorkingMaterialsHandlerHost } from "./handlers/working-materials-handler.js";
15
14
  import { type DreamHandlerHost } from "./handlers/dream-handler.js";
@@ -56,7 +55,6 @@ export interface RpcHandlerHosts {
56
55
  dream: DreamHandlerHost;
57
56
  turn: TurnControlHandlerHost;
58
57
  turnBaseline: TurnBaselineHandlerHost;
59
- messageFeedback: MessageFeedbackHandlerHost;
60
58
  workingMaterials: WorkingMaterialsHandlerHost;
61
59
  /** agents/solo/product are served by the multi-agent sub-host. */
62
60
  multiAgent: MultiAgentHandlerHost;
@@ -4,6 +4,7 @@ import type { LLMTransport } from "./provider-core-facade.js";
4
4
  import type { MemoryHostRequestAccess } from "./memory-coordinator.js";
5
5
  import { type StdioRuntimeServices } from "./stdio-runtime-services.js";
6
6
  import type { HostProfileClient } from "../transport/host-profile-client.js";
7
+ import type { HostPetClient } from "../transport/host-pet-client.js";
7
8
  export interface StdioRuntimeBootstrapDeps {
8
9
  verbose: boolean;
9
10
  getActiveProjectRoot(): string;
@@ -20,5 +21,6 @@ export interface StdioRuntimeBootstrapDeps {
20
21
  resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
21
22
  /** Lazy session-bound host profile facade; unavailable/non-ACP must fail loud at first web invoke. */
22
23
  resolveHostProfileClient?(): HostProfileClient | undefined;
24
+ resolveHostPetClient?(): HostPetClient | undefined;
23
25
  }
24
26
  export declare function bootstrapStdioRuntimeServices(deps: StdioRuntimeBootstrapDeps): StdioRuntimeServices;
@@ -4,6 +4,7 @@ import { MediaPersistence } from "../runtime/infra/media-persistence.js";
4
4
  import { MediaClient, ProviderRegistry, type LLMTransport } from "./provider-core-facade.js";
5
5
  import { type MemoryHostRequestAccess, type MemoryProviderState } from "./memory-coordinator.js";
6
6
  import { type PetRuntime } from "./pet-runtime.js";
7
+ import type { HostPetClient } from "../transport/host-pet-client.js";
7
8
  import { type TurnMediaSetupHost } from "./turn-media-setup.js";
8
9
  export interface StdioRuntimeServicesDeps {
9
10
  getActiveProjectRoot(): string;
@@ -19,6 +20,7 @@ export interface StdioRuntimeServicesDeps {
19
20
  * memory provider 工厂据此在创建时刻按 memory service 一次性选型 HostMemoryProvider。
20
21
  */
21
22
  resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
23
+ resolveHostPetClient?(): HostPetClient | undefined;
22
24
  }
23
25
  export interface StdioRuntimeServices {
24
26
  providerRegistry: ProviderRegistry;
@@ -26,6 +26,7 @@ import { SessionHistoryCoordinator } from "./session-history-coordinator.js";
26
26
  import { PetConfirmCoordinator } from "./pet-confirm-coordinator.js";
27
27
  import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMode, ProjectMemoryStore } from "../runtime/ports/index.js";
28
28
  import { HostProfileClient } from "../transport/host-profile-client.js";
29
+ import { HostPetClient } from "../transport/host-pet-client.js";
29
30
  import { HostCapabilityClient } from "../transport/host-capability-client.js";
30
31
  import { HostSessionClient } from "../transport/host-session-client.js";
31
32
  import { HostProjectClient } from "../transport/host-project-client.js";
@@ -126,6 +127,7 @@ export declare class StdioServer {
126
127
  /** D2 telemetry/feedback business facade; durable storage remains gateway-only. */
127
128
  getHostFeedbackClient(): HostFeedbackClient | undefined;
128
129
  getHostProjectClient(): HostProjectClient | undefined;
130
+ getHostPetClient(): HostPetClient | undefined;
129
131
  initializeHostProjectAuthority(): Promise<void>;
130
132
  /**
131
133
  * Mid-turn guidance queue (运行中引导). Reset per turn by runTurnPipeline, pushed by
@@ -197,7 +199,7 @@ export declare class StdioServer {
197
199
  * Ensure a default project exists on first start.
198
200
  * Called from both legacy handleInitialize and ACP acpHandleInitialize.
199
201
  */
200
- ensureDefaultProject(): void;
202
+ ensureDefaultProject(): Promise<void>;
201
203
  /**
202
204
  * Atomically resolve transport + model + apiKey for a given ModelPurpose.
203
205
  * If the resolved provider matches `this.currentProvider`, reuses cached transport.
@@ -4,7 +4,7 @@
4
4
  * NOT our OSS. Lives in the config layer (not infra) so it can be public API:
5
5
  * the runtime gateway merges it into the agent env when the user's region/network
6
6
  * switch is on (cross-cutting ③); MCP subprocesses and skill shells then inherit
7
- * it via the agent-process FORWARDED_ENV_KEYS list.
7
+ * it through the Gateway Supervisor child-environment allow-list.
8
8
  *
9
9
  * Honest scope: this only redirects dependency *resolution* to official mirrors
10
10
  * (covers most). It does NOT guarantee cold/new packages (npmmirror sync lag →
@@ -17,7 +17,7 @@ export declare const CN_BINARY_HOST = "https://registry.npmmirror.com/-/binary";
17
17
  /** Mirror endpoint values (official mirrors, not our OSS). */
18
18
  export declare function buildCnMirrorEnv(): Record<string, string>;
19
19
  /**
20
- * The env keys `buildCnMirrorEnv()` sets. agent-process appends these to its
20
+ * The env keys `buildCnMirrorEnv()` sets. The Gateway Supervisor appends these to its
21
21
  * forwarded-env list so a mirror set on the agent propagates to MCP/skill children.
22
22
  */
23
23
  export declare const CN_MIRROR_ENV_KEYS: string[];
@@ -509,11 +509,9 @@ export interface MemoryMatch {
509
509
  * 是 memory MCP 能力模块(freeze §3.7)的 store-owner;三张脸(MCP 面/UI-API 面/brain proxy 面 X7)
510
510
  * 都是 thin adapter,唯一写者恒为本服务(脸数≠拷贝数,M-1)。
511
511
  *
512
- * [Route B X6 裁决] 本服务只管 **A 域库面**(memories.db + 附件 + 晋升/蒸馏 JSON + 用户级 INDEX.md
513
- * 派生渲染)。C 域 memdir(`<cwd>/.qlogicagent/memory/`) memory host-state **剥离**,归"项目文件面"
514
- * (进用户仓的项目文件,类 .vscode/,非 host store):UI-API memdir 分支由 gateway 文件服务本地应答
515
- * (VSCode main IFileService 同构),agent 侧 qla 直接 fs 操作如常。`read(source, target)` 的 memdir
516
- * 两义剥除——source 只指库内来源标识,绝不再指 memdir 文件。
512
+ * A 域库面(memories.db + 附件 + 晋升/蒸馏 JSON + 用户级 INDEX.md 派生渲染)与 C 域项目 memdir
513
+ * (`<cwd>/.qlogicagent/memory/`)都由 Gateway 独占在线存取。C 域仍是项目文件而非用户 Host store,
514
+ * agent 只能经 projectMemory X7 语义代理访问,与 VSCode ext host main IFileService proxy 同构。
517
515
  */
518
516
  export interface MemoryProfileService {
519
517
  atlas(query: MemoryQuery): MemoryRecord[];
@@ -573,6 +571,8 @@ export interface RunEvent {
573
571
  /** ISO 时间戳 */
574
572
  at: string;
575
573
  type: string;
574
+ /** Optional domain event sequence (Goal event-sourcing recovery). */
575
+ sequence?: number;
576
576
  member?: MemberHandle;
577
577
  payload?: unknown;
578
578
  }
@@ -595,15 +595,20 @@ export interface RunState {
595
595
  * leader 大脑逻辑(怎么规划、派谁)仍留 qlogicagent,只写"计划"、不持久化"进度记录"(P5)。
596
596
  */
597
597
  export interface RunStateStore {
598
- openRun(kind: "solo" | "product" | "goal", owner: SessionContext): RunId;
598
+ /** Optional caller-selected domain id keeps Solo/Product/Goal public ids identical to host run ids. */
599
+ openRun(kind: "solo" | "product" | "goal", owner: SessionContext, runId?: RunId): RunId;
599
600
  recordEvent(runId: RunId, ev: RunEvent): void;
600
601
  /** product/solo 检查点 */
601
- checkpoint(runId: RunId, snapshot: unknown): void;
602
+ checkpoint(runId: RunId, snapshot: unknown, checkpointId?: string): void;
603
+ getCheckpoint(runId: RunId, checkpointId: string): unknown | undefined;
604
+ listCheckpoints(runId: RunId): string[];
605
+ restoreCheckpoint(runId: RunId, checkpointId: string): unknown | undefined;
602
606
  getRun(runId: RunId): RunState;
603
607
  listRuns(filter: {
604
608
  projectId: ProjectId;
605
609
  kind?: string;
606
610
  }): RunState[];
611
+ deleteRun(runId: RunId): boolean;
607
612
  }
608
613
  export interface EvBase {
609
614
  /** 由 relay 合成(今天线上无 handle,只有 agentId+sessionId+delegationId 关联;R1) */
@@ -786,6 +791,18 @@ export interface HostNotificationSink {
786
791
  */
787
792
  export declare const HOST_MEMORY_PROXY_METHODS: readonly ["search", "addText", "embedText", "ingestExtracted", "proposeExtracted", "consumePendingProposals", "feedback", "findRelatedEvents", "synthesizeTimeline", "getActivitySummary", "getAllProfiles", "setProfile", "getAtlas", "setMemoryArchived", "triggerDecay", "resolveConflicts"];
788
793
  export type HostMemoryProxyMethod = (typeof HOST_MEMORY_PROXY_METHODS)[number];
794
+ /** Project-scoped Markdown memory face. Gateway resolves cwd/project from the supervised caller. */
795
+ export declare const HOST_PROJECT_MEMORY_PROXY_METHODS: readonly ["initialize", "getIndex", "addToIndex", "replaceInIndex", "removeFromIndex", "createFile", "writeFile", "readFile", "deleteFile", "listFiles", "searchLocal"];
796
+ export type HostProjectMemoryProxyMethod = (typeof HOST_PROJECT_MEMORY_PROXY_METHODS)[number];
797
+ export interface HostProjectMemoryIndexSnapshot {
798
+ raw: string;
799
+ prompt: string;
800
+ usage: {
801
+ chars: number;
802
+ lines: number;
803
+ percent: number;
804
+ };
805
+ }
789
806
  /** [X7-C1a] Capability 大脑代理当前只开放两个只读方法;写面与 connector 尚未入约。 */
790
807
  export declare const HOST_CAPABILITY_PROXY_METHODS: readonly ["getSkillSnapshot", "readSkillFile", "recordSkillInvocation", "commitSkillMutation", "applyCuratorPlan", "prepareSkillInstall", "finalizeSkillInstall"];
791
808
  export type HostCapabilityProxyMethod = (typeof HOST_CAPABILITY_PROXY_METHODS)[number];
@@ -1061,10 +1078,15 @@ export interface HostSkillInvocationResult {
1061
1078
  /** 单文件读取上限;host 在解码前按 bytes 检查。 */
1062
1079
  export declare const HOST_SKILL_FILE_MAX_BYTES: number;
1063
1080
  /** [X7-P] 单一 agent→host 一元请求通道的服务域。 */
1064
- export type HostRequestService = "memory" | "profile" | "preview" | "capability" | "session" | "feedback" | "project";
1081
+ export type HostRequestService = "memory" | "projectMemory" | "profile" | "preview" | "capability" | "session" | "feedback" | "project" | "runState" | "pet";
1065
1082
  /** Preview Browser 的七个允许动作;tool 与 gateway 必须消费此单源。 */
1066
1083
  export declare const PREVIEW_BROWSER_ACTIONS: readonly ["navigate", "snapshot", "click", "type", "screenshot", "console", "network"];
1067
1084
  export type PreviewBrowserAction = (typeof PREVIEW_BROWSER_ACTIONS)[number];
1085
+ export declare const PREVIEW_BROWSER_MUTATION_ACTIONS: readonly ["navigate", "click", "type"];
1086
+ export declare const PREVIEW_BROWSER_READ_ACTIONS: readonly ["snapshot", "screenshot", "console", "network"];
1087
+ /** Canonical identity for a built-in preview WebContentsView. */
1088
+ export type PreviewTargetKey = `preview:${number}`;
1089
+ export declare function isPreviewTargetKey(value: unknown): value is PreviewTargetKey;
1068
1090
  /** 每个 preview action 的精确 payload;禁止把任意 Electron IPC method/params 暴露给 agent。 */
1069
1091
  export interface PreviewBrowserActionParams {
1070
1092
  navigate: {
@@ -1106,12 +1128,65 @@ export interface PreviewBrowserDriveResult {
1106
1128
  screenshotB64?: string;
1107
1129
  error?: string;
1108
1130
  details?: unknown;
1131
+ targetKey?: PreviewTargetKey;
1132
+ refGeneration?: number;
1109
1133
  }
1110
1134
  export type HostMemoryRequestParams = {
1111
1135
  service: "memory";
1112
1136
  method: HostMemoryProxyMethod;
1113
1137
  params: unknown[];
1114
1138
  };
1139
+ export type HostProjectMemoryRequestParams = {
1140
+ service: "projectMemory";
1141
+ method: "initialize" | "getIndex" | "listFiles";
1142
+ params: {
1143
+ sessionId: string;
1144
+ };
1145
+ } | {
1146
+ service: "projectMemory";
1147
+ method: "addToIndex";
1148
+ params: {
1149
+ sessionId: string;
1150
+ content: string;
1151
+ };
1152
+ } | {
1153
+ service: "projectMemory";
1154
+ method: "replaceInIndex";
1155
+ params: {
1156
+ sessionId: string;
1157
+ oldText: string;
1158
+ newText: string;
1159
+ };
1160
+ } | {
1161
+ service: "projectMemory";
1162
+ method: "removeFromIndex";
1163
+ params: {
1164
+ sessionId: string;
1165
+ oldText: string;
1166
+ };
1167
+ } | {
1168
+ service: "projectMemory";
1169
+ method: "createFile" | "writeFile";
1170
+ params: {
1171
+ sessionId: string;
1172
+ name: string;
1173
+ content: string;
1174
+ };
1175
+ } | {
1176
+ service: "projectMemory";
1177
+ method: "readFile" | "deleteFile";
1178
+ params: {
1179
+ sessionId: string;
1180
+ name: string;
1181
+ };
1182
+ } | {
1183
+ service: "projectMemory";
1184
+ method: "searchLocal";
1185
+ params: {
1186
+ sessionId: string;
1187
+ query: string;
1188
+ };
1189
+ };
1115
1190
  export type HostSessionRequestParams = {
1116
1191
  service: "session";
1117
1192
  method: "loadForResume";
@@ -1209,6 +1284,89 @@ export type HostFeedbackRequestParams = {
1209
1284
  projectId: ProjectId;
1210
1285
  };
1211
1286
  };
1287
+ /** Agent-originated semantic run-state operations. Owner/project/cwd are resolved by Gateway scope. */
1288
+ export declare const HOST_RUN_STATE_PROXY_METHODS: readonly ["open", "recordEvent", "checkpoint", "get", "list", "delete", "getCheckpoint", "listCheckpoints", "restoreCheckpoint"];
1289
+ export type HostRunStateProxyMethod = typeof HOST_RUN_STATE_PROXY_METHODS[number];
1290
+ export type HostRunStateRequestParams = {
1291
+ service: "runState";
1292
+ method: "open";
1293
+ params: {
1294
+ runId: RunId;
1295
+ kind: "solo" | "product" | "goal";
1296
+ projectId: ProjectId;
1297
+ sessionId: CanonicalSessionId;
1298
+ };
1299
+ } | {
1300
+ service: "runState";
1301
+ method: "recordEvent";
1302
+ params: {
1303
+ runId: RunId;
1304
+ event: Omit<RunEvent, "member">;
1305
+ sessionId: CanonicalSessionId;
1306
+ };
1307
+ } | {
1308
+ service: "runState";
1309
+ method: "checkpoint";
1310
+ params: {
1311
+ runId: RunId;
1312
+ checkpointId?: string;
1313
+ snapshot: unknown;
1314
+ sessionId: CanonicalSessionId;
1315
+ };
1316
+ } | {
1317
+ service: "runState";
1318
+ method: "get";
1319
+ params: {
1320
+ runId: RunId;
1321
+ sessionId: CanonicalSessionId;
1322
+ };
1323
+ } | {
1324
+ service: "runState";
1325
+ method: "list";
1326
+ params: {
1327
+ projectId: ProjectId;
1328
+ kind?: "solo" | "product" | "goal";
1329
+ sessionId: CanonicalSessionId;
1330
+ };
1331
+ } | {
1332
+ service: "runState";
1333
+ method: "delete";
1334
+ params: {
1335
+ runId: RunId;
1336
+ sessionId: CanonicalSessionId;
1337
+ };
1338
+ } | {
1339
+ service: "runState";
1340
+ method: "getCheckpoint" | "restoreCheckpoint";
1341
+ params: {
1342
+ runId: RunId;
1343
+ checkpointId: string;
1344
+ sessionId: CanonicalSessionId;
1345
+ };
1346
+ } | {
1347
+ service: "runState";
1348
+ method: "listCheckpoints";
1349
+ params: {
1350
+ runId: RunId;
1351
+ sessionId: CanonicalSessionId;
1352
+ };
1353
+ };
1354
+ export declare const HOST_PET_PROXY_METHODS: readonly ["isActive", "getSoul", "awardXp", "journeyCatchUp"];
1355
+ export type HostPetProxyMethod = typeof HOST_PET_PROXY_METHODS[number];
1356
+ export type HostPetRequestParams = {
1357
+ service: "pet";
1358
+ method: "isActive" | "getSoul" | "journeyCatchUp";
1359
+ params: {
1360
+ sessionId: CanonicalSessionId;
1361
+ };
1362
+ } | {
1363
+ service: "pet";
1364
+ method: "awardXp";
1365
+ params: {
1366
+ event: string;
1367
+ sessionId: CanonicalSessionId;
1368
+ };
1369
+ };
1212
1370
  /** Agent-originated profile store calls. UI/provider surfaces are intentionally excluded. */
1213
1371
  export declare const HOST_PROFILE_PROXY_METHODS: readonly ["getTunables", "updateTunable", "clearTunable", "appendDirectoryAllowRule"];
1214
1372
  export type HostProfileProxyMethod = typeof HOST_PROFILE_PROXY_METHODS[number];
@@ -1425,7 +1583,7 @@ export type HostPreviewRequestParams = {
1425
1583
  * [X7-P] 跨进程 HostRequest 判别联合。memory/profile/preview 共用 `x/host.request`,
1426
1584
  * service + method 二级分派;preview 的 method 与 payload 在类型层保持逐动作关联。
1427
1585
  */
1428
- export type HostRequestParams = HostMemoryRequestParams | HostProfileRequestParams | HostPreviewRequestParams | HostCapabilityRequestParams | HostSessionRequestParams | HostFeedbackRequestParams | HostProjectRequestParams;
1586
+ export type HostRequestParams = HostMemoryRequestParams | HostProjectMemoryRequestParams | HostProfileRequestParams | HostPreviewRequestParams | HostCapabilityRequestParams | HostSessionRequestParams | HostFeedbackRequestParams | HostProjectRequestParams | HostRunStateRequestParams | HostPetRequestParams;
1429
1587
  /** initialize 声明的真实已装配 host-request 服务;version 只接受冻结版本 1。 */
1430
1588
  export type HostRequestCapability = {
1431
1589
  version: 1;
@@ -11,7 +11,6 @@
11
11
  * 4. product.resume → load state, resume scheduling
12
12
  * 5. product.checkpoint → manual checkpoint
13
13
  */
14
- import type { AgentProcessManager } from "../runtime/infra/agent-process.js";
15
14
  import type { AcpDetector } from "../runtime/infra/acp-detector.js";
16
15
  import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
17
16
  import type { ProductPhase, ProductCreateParams, ProductStatus, ProductSummary } from "../protocol/wire/acp-agent-management.js";
@@ -82,13 +81,12 @@ export declare function buildTaskContextPrompt(upstream: {
82
81
  output: string;
83
82
  }[], prompt: string): string;
84
83
  export declare class ProductOrchestrator {
85
- private processManager;
86
84
  private acpDetector;
87
85
  private configStore;
88
86
  private callbacks;
89
87
  private leaderCoordinator?;
90
88
  private sessions;
91
- constructor(processManager: AgentProcessManager, acpDetector: AcpDetector, configStore: AgentConfigStore | null, callbacks?: ProductCallbacks, leaderCoordinator?: ProductLeaderCoordinator | undefined);
89
+ constructor(acpDetector: AcpDetector, configStore: AgentConfigStore | null, callbacks?: ProductCallbacks, leaderCoordinator?: ProductLeaderCoordinator | undefined);
92
90
  setLeaderCoordinator(leaderCoordinator: ProductLeaderCoordinator): void;
93
91
  /** (a) Owner global cheat-sheet source for member dispatches (cli-injected;
94
92
  * orchestration never imports skills directly). */
@@ -1,4 +1,3 @@
1
- import type { AgentProcessManager } from "../runtime/infra/agent-process.js";
2
1
  import type { AcpDetector } from "../runtime/infra/acp-detector.js";
3
2
  import type { DelegateBridge } from "./delegation-coordinator.js";
4
3
  import { type PlannerMemoryContext } from "./planner-memory-brief.js";
@@ -49,8 +48,6 @@ export declare function takeGoalPhaseChangedFiles(productId: string): string[];
49
48
  */
50
49
  export declare function extractJson<T>(text: string): T;
51
50
  export interface LeaderAdapterDeps {
52
- /** Same transport ProductPlanner.sendToLeader uses (product-planner.ts:579). */
53
- processManager: AgentProcessManager;
54
51
  /** Resolves the leader's external ACP descriptor (product-planner.ts:583). */
55
52
  acpDetector: AcpDetector;
56
53
  /** Catalog id of the leader agent (e.g. "qlogicagent"). */
@@ -3,9 +3,6 @@ import type { GoalRunEvent, PersistedGoalRunState } from "./goal-run-types.js";
3
3
  export interface GoalPersistenceOptions {
4
4
  pathService?: PathService;
5
5
  }
6
- export declare function getGoalDir(goalRunId: string, cwd?: string, o?: GoalPersistenceOptions): string;
7
- export declare function getEventsPath(goalRunId: string, cwd?: string, o?: GoalPersistenceOptions): string;
8
- export declare function getSnapshotPath(goalRunId: string, cwd?: string, o?: GoalPersistenceOptions): string;
9
6
  /** Append one event as a fsync'd JSON line (the durable source of truth). */
10
7
  export declare function appendGoalRunEvent(goalRunId: string, event: GoalRunEvent, cwd?: string, o?: GoalPersistenceOptions): Promise<void>;
11
8
  export declare function readGoalRunEvents(goalRunId: string, cwd?: string, o?: GoalPersistenceOptions): Promise<GoalRunEvent[]>;
@@ -1,8 +1,5 @@
1
1
  /**
2
- * Product Persistence read/write Product Mode state to disk.
3
- *
4
- * State is stored at `<project>/.qlogicagent/products/<productId>/product-state.json`.
5
- * Product listing is done by enumerating subdirectories.
2
+ * Product persistence facade over the Gateway-owned RunStateStore.
6
3
  */
7
4
  import type { PathService } from "../runtime/ports/index.js";
8
5
  import type { ProductPhase, ProductInstanceDef } from "../protocol/wire/acp-agent-management.js";