qlogicagent 2.18.9 → 2.18.11

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 (68) hide show
  1. package/dist/agent.js +17 -17
  2. package/dist/cli.js +1 -1
  3. package/dist/host-contract.js +1 -1
  4. package/dist/index.js +445 -984
  5. package/dist/pet-host.js +8 -8
  6. package/dist/project-memory-host.js +40 -0
  7. package/dist/protocol.js +1 -1
  8. package/dist/skills/mcp/astraclaw-native-mcp-server.js +6 -6
  9. package/dist/types/cli/acp-session-host.d.ts +1 -1
  10. package/dist/types/cli/community-resource-installer.d.ts +3 -5
  11. package/dist/types/cli/default-project-bootstrap.d.ts +1 -1
  12. package/dist/types/cli/handlers/agents-handler.d.ts +8 -6
  13. package/dist/types/cli/handlers/community-handler.d.ts +0 -4
  14. package/dist/types/cli/handlers/control-handler.d.ts +1 -1
  15. package/dist/types/cli/handlers/project-handler.d.ts +1 -1
  16. package/dist/types/cli/handlers/session-handler.d.ts +0 -7
  17. package/dist/types/cli/handlers/solo-handler.d.ts +0 -2
  18. package/dist/types/cli/memory-coordinator.d.ts +1 -1
  19. package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -3
  20. package/dist/types/cli/pet-runtime.d.ts +5 -5
  21. package/dist/types/cli/product-coordinator.d.ts +0 -2
  22. package/dist/types/cli/project-memory-store-factory.d.ts +11 -1
  23. package/dist/types/cli/rpc-registry.d.ts +0 -2
  24. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +2 -0
  25. package/dist/types/cli/stdio-runtime-services.d.ts +2 -0
  26. package/dist/types/cli/stdio-server.d.ts +3 -1
  27. package/dist/types/config/cn-mirror.d.ts +2 -2
  28. package/dist/types/host-contract/index.d.ts +167 -9
  29. package/dist/types/orchestration/agent-instance.d.ts +1 -3
  30. package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -3
  31. package/dist/types/orchestration/goal-run-persistence.d.ts +0 -3
  32. package/dist/types/orchestration/product-persistence.d.ts +1 -4
  33. package/dist/types/orchestration/product-planner.d.ts +2 -3
  34. package/dist/types/orchestration/run-state-host-authority.d.ts +7 -0
  35. package/dist/types/orchestration/solo-evaluator.d.ts +2 -3
  36. package/dist/types/orchestration/solo-persistence.d.ts +4 -7
  37. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +13 -2
  38. package/dist/types/orchestration/workflow/node-schema.d.ts +2 -1
  39. package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
  40. package/dist/types/orchestration/workflow/workflow-bundle.d.ts +1 -1
  41. package/dist/types/project-memory-host.d.ts +3 -0
  42. package/dist/types/protocol/wire/acp-agent-management.d.ts +1 -1
  43. package/dist/types/protocol/wire/acp-protocol.d.ts +1 -1
  44. package/dist/types/protocol/wire/chat-types.d.ts +2 -0
  45. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +2 -0
  46. package/dist/types/runtime/infra/acp-detector.d.ts +1 -1
  47. package/dist/types/runtime/infra/background-tasks.d.ts +1 -1
  48. package/dist/types/runtime/pet/pet-community-assets.d.ts +7 -17
  49. package/dist/types/runtime/pet/petdex-vision-qa.d.ts +12 -0
  50. package/dist/types/runtime/ports/agent-runtime-ports.d.ts +1 -0
  51. package/dist/types/runtime/ports/memory-recall-source.d.ts +10 -0
  52. package/dist/types/runtime/ports/project-memory-store.d.ts +1 -1
  53. package/dist/types/runtime/session/session-persistence.d.ts +3 -4
  54. package/dist/types/skills/memory/host-memory-provider.d.ts +2 -2
  55. package/dist/types/skills/memory/memory-config-resolver.d.ts +4 -0
  56. package/dist/types/skills/memory/task-distillation.d.ts +1 -1
  57. package/dist/types/skills/portable-tool.d.ts +5 -0
  58. package/dist/types/test-support/run-state-authority-setup.d.ts +1 -0
  59. package/dist/types/transport/host-pet-client.d.ts +20 -0
  60. package/dist/types/transport/host-run-state-client.d.ts +17 -0
  61. package/dist/workflow-host.js +9 -9
  62. package/package.json +12 -2
  63. package/dist/runtime/infra/mcp-bridge-server.js +0 -338
  64. package/dist/types/cli/handlers/message-feedback-handler.d.ts +0 -31
  65. package/dist/types/runtime/infra/agent-process.d.ts +0 -368
  66. package/dist/types/runtime/infra/external-agent-pool.d.ts +0 -89
  67. package/dist/types/skills/memory/local-memory-provider.d.ts +0 -325
  68. package/dist/types/skills/memory/memory-provider-factory.d.ts +0 -33
@@ -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";
@@ -23,7 +23,6 @@
23
23
  * - CrewAI: checkpoint serialization (mid-task state)
24
24
  * - LangGraph: durable execution (persist after each node)
25
25
  */
26
- import type { AgentProcessManager } from "../runtime/infra/agent-process.js";
27
26
  import type { AcpDetector } from "../runtime/infra/acp-detector.js";
28
27
  import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
29
28
  import type { DelegateBridge } from "./delegation-coordinator.js";
@@ -40,6 +39,7 @@ export interface PlanningSession {
40
39
  cwd: string;
41
40
  leaderAgentId: string;
42
41
  leaderMemberId?: string;
42
+ activeDelegationId?: string;
43
43
  phase: PlanningPhase;
44
44
  plan?: ProductPlan;
45
45
  /** Multi-turn conversation history during planning. */
@@ -105,12 +105,11 @@ export interface DagMutation {
105
105
  details?: Record<string, unknown>;
106
106
  }
107
107
  export declare class ProductPlanner {
108
- private processManager;
109
108
  private acpDetector;
110
109
  private configStore;
111
110
  private callbacks;
112
111
  private sessions;
113
- constructor(processManager: AgentProcessManager, acpDetector: AcpDetector, configStore: AgentConfigStore | null, callbacks?: PlannerCallbacks);
112
+ constructor(acpDetector: AcpDetector, configStore: AgentConfigStore | null, callbacks?: PlannerCallbacks);
114
113
  /**
115
114
  * Start an interactive planning session (Phase 1).
116
115
  * Spawns the leader agent and begins multi-turn dialogue.
@@ -0,0 +1,7 @@
1
+ import type { HostRunStateClient } from "../transport/host-run-state-client.js";
2
+ export interface HostRunStateAuthority {
3
+ client: HostRunStateClient;
4
+ sessionId: string;
5
+ }
6
+ export declare function configureHostRunStateAuthority(resolver: (() => HostRunStateAuthority | undefined) | null): void;
7
+ export declare function requireHostRunStateAuthority(): HostRunStateAuthority;
@@ -18,11 +18,11 @@
18
18
  *
19
19
  * Degradation: if K agents fail but ≥1 succeeds, session remains interactive.
20
20
  */
21
- import type { AgentProcessManager } from "../runtime/infra/agent-process.js";
22
21
  import type { AcpDetector } from "../runtime/infra/acp-detector.js";
23
22
  import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
24
23
  import type { DelegateBridge } from "./delegation-coordinator.js";
25
24
  import type { SoloState, SoloAgentState, SoloEvaluation, SoloStatus, SoloStartParams, SoloSelectParams, SoloSpec } from "../protocol/wire/acp-agent-management.js";
25
+ export declare function deriveSoloDelegateProjectId(registeredProjectRoot: string): string;
26
26
  export interface SoloCallbacks {
27
27
  log?: {
28
28
  info(msg: string): void;
@@ -75,11 +75,10 @@ export declare function buildEvaluationPrompt(originalTask: string, spec: SoloSp
75
75
  diff?: string;
76
76
  }>): string;
77
77
  export declare class SoloEvaluator {
78
- private processManager;
79
78
  private configStore;
80
79
  private callbacks;
81
80
  private sessions;
82
- constructor(processManager: AgentProcessManager, _acpDetector: AcpDetector, configStore: AgentConfigStore | null, callbacks?: SoloCallbacks);
81
+ constructor(_acpDetector: AcpDetector, configStore: AgentConfigStore | null, callbacks?: SoloCallbacks);
83
82
  /** Persist current session data to disk (fire-and-forget). */
84
83
  private persistSession;
85
84
  /** Restore sessions from disk (call once at startup). */
@@ -1,8 +1,5 @@
1
1
  /**
2
- * Solo Persistence read/write Solo Mode state to disk.
3
- *
4
- * State is stored at `<project>/.qlogicagent/solos/<soloId>/solo-state.json`.
5
- * Mirrors the product-persistence.ts pattern.
2
+ * Solo persistence facade over the Gateway-owned RunStateStore.
6
3
  */
7
4
  import type { PathService } from "../runtime/ports/index.js";
8
5
  import type { SoloState, SoloAgentState, SoloEvaluation, SoloSpec } from "../protocol/wire/acp-agent-management.js";
@@ -40,11 +37,11 @@ export interface PersistedSoloState {
40
37
  export interface SoloPersistenceOptions {
41
38
  pathService?: PathService;
42
39
  }
43
- /** Save solo state to disk. */
40
+ /** Save the latest Solo snapshot through Gateway authority. */
44
41
  export declare function saveSoloState(state: PersistedSoloState, cwd?: string, options?: SoloPersistenceOptions): Promise<void>;
45
- /** Load solo state from disk. Returns undefined if not found. */
42
+ /** Load the latest Solo snapshot from Gateway authority. */
46
43
  export declare function loadSoloState(soloId: string, cwd?: string, options?: SoloPersistenceOptions): Promise<PersistedSoloState | undefined>;
47
44
  /** List all solo session IDs with their persisted state. */
48
45
  export declare function listSoloSessions(cwd?: string, options?: SoloPersistenceOptions): Promise<PersistedSoloState[]>;
49
- /** Delete solo state from disk. */
46
+ /** Delete a Solo run through Gateway authority. */
50
47
  export declare function deleteSoloState(soloId: string, cwd?: string, options?: SoloPersistenceOptions): Promise<boolean>;
@@ -1,4 +1,15 @@
1
- import type { AgentProcessManager } from "../../runtime/infra/agent-process.js";
2
1
  import type { DelegateBridge } from "../delegation-coordinator.js";
2
+ interface LegacyTurnFixture {
3
+ sendTask(memberId: string, prompt: string, options?: {
4
+ timeout?: number;
5
+ }): Promise<unknown>;
6
+ getUsageTracker?(memberId: string): {
7
+ getUsage(): {
8
+ inputTokens: number;
9
+ outputTokens: number;
10
+ };
11
+ } | null;
12
+ }
3
13
  /** Test-only adapter for migrating orchestration fixtures from the retired local spawn lane. */
4
- export declare function makeDelegateTestBridge(processManager: AgentProcessManager): DelegateBridge;
14
+ export declare function makeDelegateTestBridge(processManager: LegacyTurnFixture): DelegateBridge;
15
+ export {};
@@ -147,11 +147,12 @@ export interface ExecutorHost {
147
147
  waitWebhook?(req: WebhookWaitHostRequest): Promise<Record<string, unknown>>;
148
148
  }
149
149
  export interface AgentHostRequest {
150
- agentId?: string;
150
+ agentId: string;
151
151
  prompt: string;
152
152
  input: DataItem[];
153
153
  signal?: AbortSignal;
154
154
  }
155
+ export declare function requireWorkflowAgentId(value: unknown): string;
155
156
  export interface ModelHostRequest {
156
157
  prompt: string;
157
158
  modelHint?: string;
@@ -14,7 +14,7 @@ import type { ExecutorHost, ToolHostRequest, MemoryHostRequest, SubworkflowHostR
14
14
  export interface QlaExecutorHostDeps {
15
15
  /** Run one agent turn (spawn external ACP agent + sendTask). Returns the agent's text output. */
16
16
  runAgent: (req: {
17
- agentId?: string;
17
+ agentId: string;
18
18
  prompt: string;
19
19
  signal?: AbortSignal;
20
20
  }) => Promise<string>;
@@ -10,7 +10,7 @@
10
10
  * graph references, so an importer (or the Hub apply checklist) can verify bindings
11
11
  * BEFORE activating instead of failing mid-run.
12
12
  */
13
- import type { WorkflowDef } from "./node-schema.js";
13
+ import { type WorkflowDef } from "./node-schema.js";
14
14
  import type { TriggerDef } from "./workflow-trigger.js";
15
15
  import type { ConcurrencyPolicy, WorkflowRecord } from "./workflow-store.js";
16
16
  export declare const WORKFLOW_BUNDLE_SCHEMA_VERSION = 2;
@@ -0,0 +1,3 @@
1
+ /** Gateway-owned project-memory implementation. qlogicagent production code must consume the X7 proxy. */
2
+ export { Memdir } from "./skills/memory/memdir.js";
3
+ export type { MemdirFileInfo, MemdirResult } from "./skills/memory/memdir.js";
@@ -75,7 +75,7 @@ export interface AgentInstallSpec {
75
75
  }
76
76
  /**
77
77
  * Extended descriptor for external agents,
78
- * used internally by AgentProcessManager to spawn.
78
+ * used by the Gateway Supervisor when resolving an agent.
79
79
  */
80
80
  export interface ExternalAgentDescriptor {
81
81
  /** Backend ID. */
@@ -97,7 +97,7 @@ export interface AcpHostCapabilities {
97
97
  }
98
98
  /** Agent capabilities declared in the initialize response. */
99
99
  export interface AcpAgentCapabilities {
100
- /** Standard (agent-process reads it; implemented in subproject 2). */
100
+ /** Standard ACP capability consumed by the Gateway Supervisor. */
101
101
  loadSession?: boolean;
102
102
  /** Standard (used when reading third-party agents like copilot). */
103
103
  promptCapabilities?: Record<string, unknown>;
@@ -117,5 +117,7 @@ export interface ToolDefinition {
117
117
  isEgress?: boolean;
118
118
  /** Egress carries user data (true) vs. read-only external query (false). */
119
119
  egressCarriesData?: boolean;
120
+ /** Tool-specific foreground execution deadline used by the agent scheduler. */
121
+ executionTimeoutMs?: number;
120
122
  };
121
123
  }
@@ -39,6 +39,8 @@ export interface StreamingToolExecutorConfig {
39
39
  maxConcurrentTools?: number;
40
40
  /** Per foreground tool deadline. 0 or undefined means no executor deadline. */
41
41
  maxExecutionMs?: number;
42
+ /** Optional per-tool deadlines; entries override maxExecutionMs for that tool only. */
43
+ executionTimeoutMsByTool?: ReadonlyMap<string, number>;
42
44
  }
43
45
  /**
44
46
  * Executes tools with concurrency control and streaming progress.
@@ -220,7 +220,7 @@ export declare class AcpDetector {
220
220
  */
221
221
  private buildSelfDescriptor;
222
222
  /**
223
- * Build an ExternalAgentDescriptor suitable for AgentProcessManager.spawn().
223
+ * Build an ExternalAgentDescriptor suitable for Gateway Supervisor resolution.
224
224
  * Returns null if the agent is not available.
225
225
  */
226
226
  buildExternalDescriptor(agentId: string): import("../../protocol/wire/acp-agent-management.js").ExternalAgentDescriptor | null;
@@ -67,7 +67,7 @@ export interface TaskOutputSnapshot {
67
67
  }
68
68
  /**
69
69
  * Control surface for a task whose EXECUTION lives outside this manager — e.g. a
70
- * team-member subprocess owned by AgentProcessManager. The manager holds the task
70
+ * supervised team-member process. The Gateway holds the task
71
71
  * in the unified panel (list/output/cancel) and routes those three actions here;
72
72
  * lifecycle settlement is driven by the owner via settleExternalTask().
73
73
  */
@@ -1,31 +1,21 @@
1
1
  import type { CommunityInstallResolution } from "../community/community-consent-client.js";
2
- import { type PetdexPetAssetSummary } from "./petdex-asset.js";
3
- export interface InstalledCommunityPet {
2
+ export interface CommunityPetAdoptionProposal {
4
3
  kind: "pet";
5
- status: "installed";
4
+ mode: "gateway-adoption";
6
5
  resourceId: string;
7
6
  version: string;
8
7
  checksum: string;
9
- /** Petdex asset id now registered in profile.customPets. */
10
8
  assetId: string;
11
9
  name: string;
12
- /** Materialized petdex summary (atlas imageUrl = spritesheet data URL) for instant UI hydration. */
13
- asset: PetdexPetAssetSummary;
10
+ fileName: string;
11
+ /** Validated, provenance-normalized .petdex bytes. Only Gateway may adopt these bytes. */
12
+ packageBase64: string;
14
13
  }
15
14
  export interface InstallCommunityPetOptions {
16
15
  fetchFn?: typeof fetch;
17
16
  /** Replace an existing install in place (update flow). Petdex upsert is idempotent, so this is accepted for dispatcher parity. */
18
17
  allowReplace?: boolean;
19
- /** Owner whose profile receives the pet; defaults to the active runtime owner. */
20
- ownerUserId?: string;
21
18
  }
22
- /**
23
- * Materialize a community pet end to end: download the gzipped `.petdex` package,
24
- * verify size + whole-package sha256, gunzip + load + validate the petdex atlas, then
25
- * register it into `profile.customPets` with `source.kind="community"` — the exact same
26
- * registration upload/forge use. From that moment `pet.status` includes it and the desktop
27
- * pet can render the sprite. (Previously this wrote a stripped manifest that never reached
28
- * the profile, so installed community pets were invisible in the settings pet list.)
29
- */
30
- export declare function installCommunityPetResource(install: CommunityInstallResolution, options?: InstallCommunityPetOptions): Promise<InstalledCommunityPet>;
19
+ /** Download, verify, validate, and normalize a community PET into an inert Gateway adoption proposal. */
20
+ export declare function installCommunityPetResource(install: CommunityInstallResolution, options?: InstallCommunityPetOptions): Promise<CommunityPetAdoptionProposal>;
31
21
  export declare function assertPetInstall(install: CommunityInstallResolution): void;
@@ -0,0 +1,12 @@
1
+ export interface PetdexVisionVerdict {
2
+ ok: boolean;
3
+ reason: string;
4
+ qaSkipped?: boolean;
5
+ }
6
+ export interface PetdexVisionQaContext {
7
+ label: string;
8
+ target: string;
9
+ }
10
+ /** Lenient parse: only an explicit FAIL blocks ambiguous model output. */
11
+ export declare function parsePetdexVisionVerdict(text: string): PetdexVisionVerdict;
12
+ export declare function runPetdexVisionQa(call: () => Promise<string>, context: PetdexVisionQaContext, log?: (message: string) => void): Promise<PetdexVisionVerdict>;
@@ -39,6 +39,7 @@ export interface StreamingToolExecutorPortConfig {
39
39
  signal?: AbortSignal;
40
40
  maxConcurrentTools?: number;
41
41
  maxExecutionMs?: number;
42
+ executionTimeoutMsByTool?: ReadonlyMap<string, number>;
42
43
  /** Turn workspace/cwd — routes oversized tool-result spillover to the session's reachable data dir. */
43
44
  projectRoot?: string;
44
45
  }
@@ -1,3 +1,13 @@
1
1
  export interface MemoryRecallSource {
2
2
  getRootPath(): string;
3
+ searchLocal(query: string): Promise<Array<{
4
+ file: string;
5
+ snippet: string;
6
+ score: number;
7
+ }>>;
8
+ readFile(name: string): Promise<{
9
+ ok: boolean;
10
+ content?: string;
11
+ message: string;
12
+ }>;
3
13
  }
@@ -12,7 +12,7 @@ export interface ProjectMemoryResult {
12
12
  }
13
13
  export interface ProjectMemoryStore {
14
14
  getRootPath(): string;
15
- ensureInitialized(): void;
15
+ ensureInitialized(): void | Promise<void>;
16
16
  getIndexForPrompt(): string;
17
17
  getIndexRaw(): string;
18
18
  getIndexUsage(): {
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * Session persistence authority facade.
3
3
  *
4
- * When gateway advertises Session X7, durable reads/writes go through HostSessionClient. Without
5
- * that capability (gate-off/tests/standalone), the legacy local implementation remains the inert
6
- * compatibility path. A single call never writes both stores.
4
+ * Every durable read/write goes through HostSessionClient. Standalone/local persistence is not a
5
+ * supported runtime mode after the S3 state-inversion cut.
7
6
  */
8
7
  import type { ChatMessage } from "../../protocol/wire/index.js";
9
8
  import type { HostSessionClient } from "../../transport/host-session-client.js";
10
- import { type AppendMessageOutcome } from "./session-transcript-store.js";
9
+ import type { AppendMessageOutcome } from "./session-transcript-store.js";
11
10
  import { getSessionMetadata, readSessionMetadata } from "./session-metadata-store.js";
12
11
  import type { MessageDisplayMetadata, PersistedSession, SessionMetadataPatch, SessionStateSaveMetadata, SessionUsageSnapshot, TokenUsage } from "./session-types.js";
13
12
  export declare function configureHostSessionPersistence(resolver: () => HostSessionClient | undefined): void;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * HostMemoryProvider —— qlogicagent 大脑对 memories.db 的存取反转(Route B B3;X7 brain proxy)。
3
3
  *
4
- * LocalMemoryProvider 同公开面的 **proxy 实现**:大脑逻辑(dream/distill/晋升/consolidation/召回 hook)
4
+ * Gateway Memory 权威公开面的 **proxy 实现**:大脑逻辑(dream/distill/晋升/consolidation/召回 hook)
5
5
  * 零改动,底下的存取经 `x/host.request`(HostRequestClient)打到 gateway 四权威 host 服务(memory 域),
6
6
  * store(memories.db)只有 gateway 进程打开。
7
7
  *
@@ -144,5 +144,5 @@ export declare class HostMemoryProvider implements MemoryRuntimeHookProvider, Me
144
144
  readAttachmentBytes(_id: string): never;
145
145
  setAttachmentText(_id: string, _text: string): never;
146
146
  }
147
- /** 工厂便捷函数(与 createLocalMemoryProvider 对称)。 */
147
+ /** Host Memory proxy 工厂。 */
148
148
  export declare function createHostMemoryProvider(config: HostMemoryProviderConfig): HostMemoryProvider;