qlogicagent 2.6.1 → 2.9.0

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 (137) hide show
  1. package/dist/agent.js +19 -17
  2. package/dist/cli.js +634 -367
  3. package/dist/index.js +631 -364
  4. package/dist/orchestration.js +15 -15
  5. package/dist/protocol.js +1 -1
  6. package/dist/types/agent/agent.d.ts +4 -1
  7. package/dist/types/agent/tool-loop.d.ts +3 -1
  8. package/dist/types/agent/tunable-defaults.d.ts +22 -1
  9. package/dist/types/agent/types.d.ts +7 -9
  10. package/dist/types/cli/handlers/agents-handler.d.ts +19 -0
  11. package/dist/types/cli/handlers/config-handler.d.ts +17 -0
  12. package/dist/types/cli/handlers/dream-handler.d.ts +5 -0
  13. package/dist/types/cli/handlers/files-handler.d.ts +15 -0
  14. package/dist/types/cli/handlers/media-handler.d.ts +13 -0
  15. package/dist/types/cli/handlers/memory-handler.d.ts +11 -0
  16. package/dist/types/cli/handlers/pet-handler.d.ts +21 -0
  17. package/dist/types/cli/handlers/product-handler.d.ts +32 -0
  18. package/dist/types/cli/handlers/project-handler.d.ts +19 -0
  19. package/dist/types/cli/handlers/session-handler.d.ts +38 -0
  20. package/dist/types/cli/handlers/settings-handler.d.ts +24 -0
  21. package/dist/types/cli/handlers/skills-handler.d.ts +20 -0
  22. package/dist/types/cli/handlers/solo-handler.d.ts +15 -0
  23. package/dist/types/cli/handlers/turn-handler.d.ts +17 -0
  24. package/dist/types/cli/main.d.ts +2 -2
  25. package/dist/types/cli/stdio-server.d.ts +94 -100
  26. package/dist/types/cli/tool-bootstrap.d.ts +7 -8
  27. package/dist/types/config/config.d.ts +1 -1
  28. package/dist/types/index.d.ts +2 -2
  29. package/dist/types/llm/index.d.ts +1 -31
  30. package/dist/types/orchestration/dag-scheduler.d.ts +46 -0
  31. package/dist/types/orchestration/index.d.ts +1 -1
  32. package/dist/types/orchestration/product-planner.d.ts +146 -0
  33. package/dist/types/orchestration/skill-improvement.d.ts +39 -0
  34. package/dist/types/orchestration/solo-evaluator.d.ts +26 -6
  35. package/dist/types/orchestration/solo-persistence.d.ts +5 -0
  36. package/dist/types/orchestration/tool-cascade.d.ts +2 -2
  37. package/dist/types/protocol/methods.d.ts +189 -6
  38. package/dist/types/protocol/notifications.d.ts +1 -1
  39. package/dist/types/protocol/wire/acp-protocol.d.ts +7 -0
  40. package/dist/types/protocol/wire/agent-events.d.ts +2 -2
  41. package/dist/types/protocol/wire/agent-methods.d.ts +6 -4
  42. package/dist/types/protocol/wire/gateway-rpc.d.ts +77 -4
  43. package/dist/types/protocol/wire/index.d.ts +1 -1
  44. package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +3 -1
  45. package/dist/types/protocol/wire/notification-payloads.d.ts +124 -4
  46. package/dist/types/runtime/execution/dream-agent.d.ts +33 -6
  47. package/dist/types/runtime/execution/forked-agent.d.ts +1 -1
  48. package/dist/types/runtime/execution/memory-decay.d.ts +17 -5
  49. package/dist/types/runtime/hooks/context-compression.d.ts +1 -1
  50. package/dist/types/runtime/hooks/memory-hooks.d.ts +10 -1
  51. package/dist/types/runtime/infra/acp-types.d.ts +92 -0
  52. package/dist/types/runtime/infra/agent-paths.d.ts +22 -25
  53. package/dist/types/runtime/infra/agent-process.d.ts +1 -1
  54. package/dist/types/runtime/infra/builtin-providers.d.ts +36 -0
  55. package/dist/types/runtime/infra/checkpoint-backend.d.ts +1 -1
  56. package/dist/types/runtime/infra/index.d.ts +1 -2
  57. package/dist/types/runtime/infra/key-pool.d.ts +120 -0
  58. package/dist/types/runtime/infra/media-persistence.d.ts +26 -15
  59. package/dist/types/runtime/infra/model-registry.d.ts +187 -0
  60. package/dist/types/runtime/infra/project-instructions-store.d.ts +3 -3
  61. package/dist/types/runtime/infra/project-store.d.ts +3 -0
  62. package/dist/types/runtime/infra/token-budget.d.ts +2 -2
  63. package/dist/types/runtime/infra/worktree-backend.d.ts +1 -1
  64. package/dist/types/runtime/pet/index.d.ts +8 -0
  65. package/dist/types/runtime/pet/pet-context-injection.d.ts +8 -0
  66. package/dist/types/runtime/pet/pet-file-loader.d.ts +62 -0
  67. package/dist/types/runtime/pet/pet-growth-engine.d.ts +60 -0
  68. package/dist/types/runtime/pet/pet-reaction-service.d.ts +33 -0
  69. package/dist/types/runtime/pet/pet-soul-service.d.ts +71 -0
  70. package/dist/types/runtime/prompt/environment-context.d.ts +10 -0
  71. package/dist/types/runtime/prompt/index.d.ts +1 -1
  72. package/dist/types/runtime/session/group-session-split.d.ts +38 -0
  73. package/dist/types/runtime/session/index.d.ts +4 -2
  74. package/dist/types/runtime/session/session-locator.d.ts +24 -0
  75. package/dist/types/runtime/session/session-memory.d.ts +4 -4
  76. package/dist/types/runtime/session/session-persistence.d.ts +47 -46
  77. package/dist/types/runtime/session/session-state.d.ts +3 -5
  78. package/dist/types/skills/index.d.ts +8 -2
  79. package/dist/types/skills/memory/implicit-extraction.d.ts +58 -0
  80. package/dist/types/skills/memory/local-embedding.d.ts +176 -0
  81. package/dist/types/skills/memory/local-memory-provider.d.ts +197 -0
  82. package/dist/types/skills/memory/local-store.d.ts +255 -0
  83. package/dist/types/skills/memory/memdir.d.ts +13 -5
  84. package/dist/types/skills/memory/memory-provider-factory.d.ts +48 -0
  85. package/dist/types/skills/memory/memory-tool.d.ts +30 -2
  86. package/dist/types/skills/permissions/denial-audit-log.d.ts +52 -0
  87. package/dist/types/skills/permissions/hook-runner.d.ts +14 -4
  88. package/dist/types/skills/permissions/permission-classifier.d.ts +1 -1
  89. package/dist/types/skills/skill-system/skill-lifecycle.d.ts +81 -0
  90. package/dist/types/skills/skill-system/skill-validation.d.ts +29 -0
  91. package/dist/types/skills/tools/exec-tool.d.ts +1 -1
  92. package/dist/types/skills/tools/search-tool.d.ts +1 -1
  93. package/dist/types/skills/tools.d.ts +3 -3
  94. package/dist/types/transport/acp-event-emitter.d.ts +1 -1
  95. package/dist/types/transport/acp-server.d.ts +7 -2
  96. package/package.json +19 -5
  97. package/dist/types/llm/adapters/aliyun-oss-file-upload-adapter.d.ts +0 -44
  98. package/dist/types/llm/adapters/gemini-file-upload-adapter.d.ts +0 -26
  99. package/dist/types/llm/adapters/hub-oss-file-upload-adapter.d.ts +0 -29
  100. package/dist/types/llm/adapters/index.d.ts +0 -10
  101. package/dist/types/llm/adapters/openai-file-upload-adapter.d.ts +0 -38
  102. package/dist/types/llm/adapters/volcengine-file-upload-adapter.d.ts +0 -24
  103. package/dist/types/llm/builtin-providers.d.ts +0 -10
  104. package/dist/types/llm/debug-transport.d.ts +0 -12
  105. package/dist/types/llm/file-upload-service.d.ts +0 -68
  106. package/dist/types/llm/gemini-schema-utils.d.ts +0 -17
  107. package/dist/types/llm/llm-client.d.ts +0 -43
  108. package/dist/types/llm/media-client.d.ts +0 -42
  109. package/dist/types/llm/media-transport.d.ts +0 -176
  110. package/dist/types/llm/model-catalog.d.ts +0 -53
  111. package/dist/types/llm/model-detection.d.ts +0 -22
  112. package/dist/types/llm/provider-def.d.ts +0 -203
  113. package/dist/types/llm/provider-registry.d.ts +0 -59
  114. package/dist/types/llm/provider-tool-api.d.ts +0 -44
  115. package/dist/types/llm/retry.d.ts +0 -37
  116. package/dist/types/llm/transport.d.ts +0 -281
  117. package/dist/types/llm/transports/anthropic-messages.d.ts +0 -65
  118. package/dist/types/llm/transports/gemini-cache-api.d.ts +0 -86
  119. package/dist/types/llm/transports/gemini-file-api.d.ts +0 -90
  120. package/dist/types/llm/transports/gemini-generatecontent.d.ts +0 -56
  121. package/dist/types/llm/transports/gemini-lyria-realtime.d.ts +0 -117
  122. package/dist/types/llm/transports/gemini-media.d.ts +0 -53
  123. package/dist/types/llm/transports/media-resolve.d.ts +0 -50
  124. package/dist/types/llm/transports/minimax-media.d.ts +0 -55
  125. package/dist/types/llm/transports/openai-chat.d.ts +0 -81
  126. package/dist/types/llm/transports/openai-media.d.ts +0 -24
  127. package/dist/types/llm/transports/openai-responses.d.ts +0 -63
  128. package/dist/types/llm/transports/qwen-media.d.ts +0 -50
  129. package/dist/types/llm/transports/realtime-transport.d.ts +0 -183
  130. package/dist/types/llm/transports/volcengine-grounding.d.ts +0 -58
  131. package/dist/types/llm/transports/volcengine-media.d.ts +0 -93
  132. package/dist/types/llm/transports/volcengine-responses.d.ts +0 -64
  133. package/dist/types/llm/transports/zhipu-media.d.ts +0 -82
  134. package/dist/types/llm/transports/zhipu-tool-api.d.ts +0 -35
  135. package/dist/types/runtime/infra/project-plan-store.d.ts +0 -27
  136. package/dist/types/skills/memory/qmemory-adapter.d.ts +0 -55
  137. package/dist/types/skills/memory/qmemory-http-client.d.ts +0 -16
@@ -45,6 +45,8 @@ export interface TurnStartNotification {
45
45
  turnId: string;
46
46
  model?: string;
47
47
  provider?: string;
48
+ /** Project that owns this session — enables frontend to associate without fallback guessing */
49
+ projectId?: string;
48
50
  }
49
51
  /** Streaming text chunk from the main agent. */
50
52
  export interface TurnDeltaNotification {
@@ -66,8 +68,10 @@ export interface TurnEndNotification {
66
68
  /** Turn failed. */
67
69
  export interface TurnErrorNotification {
68
70
  turnId: string;
69
- error: string;
70
- code?: string;
71
+ error: {
72
+ message: string;
73
+ code?: string;
74
+ };
71
75
  }
72
76
  /** Agent self-recovered from an error. */
73
77
  export interface TurnRecoveryNotification {
@@ -256,6 +260,15 @@ export interface TurnSkillInstructionNotification {
256
260
  turnId: string;
257
261
  instruction: unknown;
258
262
  }
263
+ /** Agent detected a repeating pattern that should be acquired as a skill from hub. */
264
+ export interface TurnSkillAcquisitionNeededNotification {
265
+ turnId: string;
266
+ pattern: {
267
+ suggestedName: string;
268
+ description: string;
269
+ tools: string[];
270
+ };
271
+ }
259
272
  /** Agent asks the user a clarifying question mid-turn. */
260
273
  export interface TurnAskUserNotification {
261
274
  askId?: string;
@@ -276,6 +289,11 @@ export interface MemoryUpdatedNotification {
276
289
  entryCount?: number;
277
290
  summary?: string;
278
291
  }
292
+ /** Skills list changed (activated/deactivated/learned/deleted). */
293
+ export interface SkillsUpdatedNotification {
294
+ action: "activate" | "deactivate" | "delete" | "learn" | "promote";
295
+ name?: string;
296
+ }
279
297
  /** Importance decay completed after Dream consolidation. */
280
298
  export interface MemoryDecayCompletedNotification {
281
299
  decayed: number;
@@ -290,6 +308,8 @@ export interface SessionInfoNotification {
290
308
  provider?: string;
291
309
  cwd?: string;
292
310
  turnCount?: number;
311
+ pinnedAt?: string;
312
+ projectId?: string;
293
313
  }
294
314
  /** Permission rule saved/updated. */
295
315
  export interface PermissionRuleUpdatedNotification {
@@ -341,7 +361,7 @@ export interface AgentsErrorNotification {
341
361
  export interface SoloProgressNotification {
342
362
  soloId: string;
343
363
  agentId: string;
344
- state: "pending" | "running" | "completed" | "failed";
364
+ state: "pending" | "running" | "completed" | "failed" | "idle";
345
365
  progress?: string;
346
366
  }
347
367
  /** Solo evaluation completed. */
@@ -434,10 +454,45 @@ export interface ProductTaskOutputDeltaNotification {
434
454
  taskId: string;
435
455
  text: string;
436
456
  }
457
+ /** Leader agent produced a structured plan — client should present to user. */
458
+ export interface ProductPlanReadyNotification {
459
+ productId: string;
460
+ plan: {
461
+ name: string;
462
+ modules: Array<{
463
+ name: string;
464
+ description: string;
465
+ suggestedAgentId?: string;
466
+ }>;
467
+ instances: Array<{
468
+ name: string;
469
+ agentId: string;
470
+ role: string;
471
+ }>;
472
+ tasks: Array<{
473
+ taskId: string;
474
+ assignee: string;
475
+ prompt: string;
476
+ dependsOn?: string[];
477
+ }>;
478
+ reasoning: string;
479
+ };
480
+ }
481
+ /** Planning failed. */
482
+ export interface ProductPlanFailedNotification {
483
+ productId: string;
484
+ error: string;
485
+ }
486
+ /** Streaming text output from leader during planning. */
487
+ export interface ProductPlanningDeltaNotification {
488
+ productId: string;
489
+ text: string;
490
+ }
437
491
  /** Plan interrupted. */
438
492
  export interface PlanInterruptedNotification {
439
493
  planId: string;
440
- planMode: "solo" | "product";
494
+ /** The project type (solo/product) of the interrupted plan */
495
+ projectType: "solo" | "product";
441
496
  reason: string;
442
497
  }
443
498
  /** A project was created. */
@@ -513,6 +568,60 @@ export interface TeamUpdatedNotification {
513
568
  pid?: number;
514
569
  }>;
515
570
  }
571
+ /** Emitted when pet soul is hatched/ready. */
572
+ export interface PetSoulReadyNotification {
573
+ name: string;
574
+ species: string;
575
+ personality: string;
576
+ catchphrase: string;
577
+ stats: {
578
+ grip: number;
579
+ patience: number;
580
+ curiosity: number;
581
+ appetite: number;
582
+ humor: number;
583
+ };
584
+ rarity: string;
585
+ breed?: string;
586
+ breedColors?: {
587
+ primary: string;
588
+ secondary: string;
589
+ };
590
+ }
591
+ /** Emitted with a reaction text for the pet speech bubble. */
592
+ export interface PetReactionNotification {
593
+ text: string;
594
+ style: "normal" | "thinking" | "excited" | "sleepy";
595
+ duration?: number;
596
+ }
597
+ /** Emitted when pet gains XP or levels up. */
598
+ export interface PetGrowthNotification {
599
+ level: number;
600
+ experience: number;
601
+ xpNeeded?: number;
602
+ newAbility?: string;
603
+ abilities?: string[];
604
+ nextAbility?: {
605
+ name: string;
606
+ level: number;
607
+ };
608
+ }
609
+ /** Emitted to override pet state from agent side. */
610
+ export interface PetStateNotification {
611
+ state: string;
612
+ }
613
+ /** Emitted when agent needs user confirmation for a tool call (design §8 PetConfirmWindow). */
614
+ export interface PetConfirmNotification {
615
+ confirmId: string;
616
+ toolName: string;
617
+ description: string;
618
+ risk: "low" | "medium" | "high";
619
+ timeoutMs?: number;
620
+ }
621
+ export interface PetForgedNotification {
622
+ name: string;
623
+ svgs: Record<string, string>;
624
+ }
516
625
  export interface NotificationMethodMap {
517
626
  "turn.start": TurnStartNotification;
518
627
  "turn.delta": TurnDeltaNotification;
@@ -543,9 +652,11 @@ export interface NotificationMethodMap {
543
652
  "turn.artifact": TurnArtifactNotification;
544
653
  "tool.approval.request": ToolApprovalRequestNotification;
545
654
  "turn.skill_instruction": TurnSkillInstructionNotification;
655
+ "turn.skill_acquisition_needed": TurnSkillAcquisitionNeededNotification;
546
656
  "turn.ask_user": TurnAskUserNotification;
547
657
  "memory.updated": MemoryUpdatedNotification;
548
658
  "memory.decay.completed": MemoryDecayCompletedNotification;
659
+ "skills.updated": SkillsUpdatedNotification;
549
660
  "session.info": SessionInfoNotification;
550
661
  "permission.rule_updated": PermissionRuleUpdatedNotification;
551
662
  "team.member.notification": TeamMemberNotification;
@@ -569,6 +680,9 @@ export interface NotificationMethodMap {
569
680
  "product.dagTopology": ProductDagTopologyNotification;
570
681
  "product.budgetUpdate": ProductBudgetUpdateNotification;
571
682
  "product.taskOutput": ProductTaskOutputDeltaNotification;
683
+ "product.planReady": ProductPlanReadyNotification;
684
+ "product.planFailed": ProductPlanFailedNotification;
685
+ "product.planningDelta": ProductPlanningDeltaNotification;
572
686
  "plan.interrupted": PlanInterruptedNotification;
573
687
  "project.created": ProjectCreatedNotification;
574
688
  "project.switched": ProjectSwitchedNotification;
@@ -576,6 +690,12 @@ export interface NotificationMethodMap {
576
690
  "project.renamed": ProjectRenamedNotification;
577
691
  "project.archived": ProjectArchivedNotification;
578
692
  "project.unarchived": ProjectUnarchivedNotification;
693
+ "pet.soul_ready": PetSoulReadyNotification;
694
+ "pet.reaction": PetReactionNotification;
695
+ "pet.growth": PetGrowthNotification;
696
+ "pet.state": PetStateNotification;
697
+ "pet.confirm": PetConfirmNotification;
698
+ "pet.forged": PetForgedNotification;
579
699
  }
580
700
  /** All known notification method names. */
581
701
  export type NotificationMethod = keyof NotificationMethodMap;
@@ -12,12 +12,14 @@
12
12
  */
13
13
  import type { DreamTaskState, DreamTurn } from "../../orchestration/subagent/task-types.js";
14
14
  import type { ToolDefinition, ToolInvoker, AgentLogger, HookRegistry } from "../../agent/types.js";
15
- import type { LLMTransport } from "../../llm/transport.js";
15
+ import type { LLMTransport } from "@qlogic/provider-core";
16
16
  export interface DreamTriggerConfig {
17
17
  /** Minimum hours since last consolidation. Default: 24. */
18
18
  minHours: number;
19
19
  /** Minimum sessions since last consolidation. Default: 5. */
20
20
  minSessions: number;
21
+ /** Minimum turns in current session as alternative gate. Default: 20. */
22
+ minTurnsInSession: number;
21
23
  /** Scan throttle interval (ms). Default: 600_000 (10 min). */
22
24
  scanIntervalMs: number;
23
25
  /** Force run, ignoring gates. */
@@ -32,6 +34,8 @@ export interface DreamContext {
32
34
  currentSessionId: string;
33
35
  /** Callback to list session IDs touched since a timestamp. */
34
36
  listSessionsSince: (sinceMs: number) => Promise<string[]>;
37
+ /** Turn count in current session (for single-session users). */
38
+ currentSessionTurnCount?: number;
35
39
  }
36
40
  export interface DreamToolRestriction {
37
41
  toolName: string;
@@ -77,6 +81,8 @@ export declare function canUseDreamTool(memoryRoot: string, restriction: DreamTo
77
81
  export declare function buildConsolidationPrompt(memoryRoot: string, transcriptDir: string, sessionIds: string[], opts?: {
78
82
  hasQMemory?: boolean;
79
83
  categoryContext?: string;
84
+ temporalContext?: string;
85
+ profileContext?: string;
80
86
  }): string;
81
87
  /**
82
88
  * Check whether dream consolidation should run.
@@ -160,11 +166,11 @@ export interface DreamRunDeps {
160
166
  /** Parent abort signal */
161
167
  parentSignal?: AbortSignal;
162
168
  /**
163
- * QMemory adapter — when provided, Dream Agent acts as the "hippocampus":
169
+ * Memory provider — when provided, Dream Agent acts as the "hippocampus":
164
170
  * reads existing long-term memories, writes classified session insights,
165
171
  * and submits feedback on outdated/contradicted memories.
166
172
  */
167
- qmemoryAdapter?: {
173
+ memoryProvider?: {
168
174
  search(query: string, userId: string, options?: {
169
175
  limit?: number;
170
176
  }): Promise<Array<{
@@ -178,10 +184,31 @@ export interface DreamRunDeps {
178
184
  }): Promise<{
179
185
  memoriesAdded: number;
180
186
  }>;
181
- feedback?(memoryIds: string[], signal: string, sessionId?: string): Promise<void>;
187
+ feedback?(memoryIds: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
188
+ affected: number;
189
+ }>;
190
+ /** Recent activity summary for temporal context injection into Dream. */
191
+ getActivitySummary?(userId: string, days?: number): {
192
+ dailyCounts: Array<{
193
+ date: string;
194
+ count: number;
195
+ }>;
196
+ highlights: Array<{
197
+ text: string;
198
+ category: string;
199
+ importance: number;
200
+ date: string;
201
+ }>;
202
+ };
203
+ /** Synthesize a timeline narrative for a time range. */
204
+ synthesizeTimeline?(userId: string, startMs: number, endMs: number): string;
205
+ /** Get/set user profile entries. */
206
+ getProfile?(userId: string, key: string): string | null;
207
+ setProfile?(userId: string, key: string, value: string): void;
208
+ getAllProfiles?(userId: string): Record<string, string>;
182
209
  };
183
- /** User ID for QMemory operations. */
184
- qmemoryUserId?: string;
210
+ /** User ID for memory operations. */
211
+ memoryUserId?: string;
185
212
  }
186
213
  /**
187
214
  * Run a complete dream consolidation using an isolated forked agent.
@@ -18,7 +18,7 @@
18
18
  * Reference: claude-code src/utils/forkedAgent.ts
19
19
  */
20
20
  import type { AgentLogger, ChatMessage, ToolDefinition, ToolInvoker, TokenUsage, TurnEvent, HookRegistry } from "../../agent/types.js";
21
- import type { LLMTransport } from "../../llm/transport.js";
21
+ import type { LLMTransport } from "@qlogic/provider-core";
22
22
  import type { AgentProgress } from "./progress-tracker.js";
23
23
  /**
24
24
  * Tool permission check function — CC canUseTool parity.
@@ -1,4 +1,14 @@
1
- import type { DecayOptions, DecayResult } from "../../skills/memory/qmemory-adapter.js";
1
+ /** Options for triggering a decay cycle. */
2
+ export interface DecayOptions {
3
+ temporalExpiry?: boolean;
4
+ stalenessDecay?: boolean;
5
+ noiseArchival?: boolean;
6
+ }
7
+ /** Result of a decay cycle. */
8
+ export interface DecayResult {
9
+ decayed: number;
10
+ archived: number;
11
+ }
2
12
  export interface DecayConfig {
3
13
  /** Minimum hours between decay cycles. Default: 24. */
4
14
  minIntervalHours: number;
@@ -20,11 +30,13 @@ export declare function shouldTriggerDecay(memoryRoot: string, config?: Partial<
20
30
  */
21
31
  export declare function markDecayComplete(memoryRoot: string): Promise<void>;
22
32
  export interface DecayCycleDeps {
23
- /** QMemory adapter with triggerDecay method. */
33
+ /** Memory provider with triggerDecay method. */
24
34
  adapter: {
25
- triggerDecay(userId: string, options?: DecayOptions): Promise<DecayResult>;
35
+ triggerDecay(userId: string, maxAgeDays?: number): Promise<{
36
+ decayed: number;
37
+ }>;
26
38
  };
27
- /** User ID for QMemory operations. */
39
+ /** User ID for memory operations. */
28
40
  userId: string;
29
41
  /** Memory root directory (for gate marker). */
30
42
  memoryRoot: string;
@@ -51,7 +63,7 @@ export interface DecayCycleResult {
51
63
  *
52
64
  * Lifecycle:
53
65
  * 1. Check time gate (24h default)
54
- * 2. Call QMemory /v1/admin/decay
66
+ * 2. Call local memory provider decay
55
67
  * 3. Mark completion timestamp
56
68
  */
57
69
  export declare function runDecayCycle(deps: DecayCycleDeps): Promise<DecayCycleResult>;
@@ -1,7 +1,7 @@
1
1
  import { ContextEngineRegistry, type CompressibleMessage, type CompressionResult, type CompressionStrategy, type AsyncCompressionStrategy, type SummarizeFn } from "../../orchestration/index.js";
2
2
  import type { HookRegistry } from "./hook-registry.js";
3
3
  import type { RuntimeLogger } from "./hook-registry.js";
4
- import type { LLMTransport } from "../../llm/transport.js";
4
+ import type { LLMTransport } from "@qlogic/provider-core";
5
5
  /** Rough token estimate: ~4 chars per token for mixed CJK/English. */
6
6
  export declare function estimateTokens(msg: CompressibleMessage): number;
7
7
  /** Estimate total tokens for a message array. */
@@ -1,5 +1,6 @@
1
1
  import type { HookRegistry } from "../../contracts/hooks.js";
2
2
  import type { MemoryProvider } from "../../protocol/wire/index.js";
3
+ import type { LocalMemoryProvider } from "../../skills/memory/local-memory-provider.js";
3
4
  import type { Memdir } from "../../skills/memory/memdir.js";
4
5
  export declare const MEMORY_PREFETCH_CONFIG: {
5
6
  readonly MAX_SESSION_BYTES: number;
@@ -9,6 +10,8 @@ export declare const MEMORY_PREFETCH_CONFIG: {
9
10
  export interface MemoryHooksDeps {
10
11
  /** QMemory adapter (MemoryProvider with search/health). */
11
12
  memoryProvider?: MemoryProvider;
13
+ /** Local memory provider for direct writes (auto-extract). */
14
+ localMemoryProvider?: LocalMemoryProvider;
12
15
  /** User ID for memory lookups. */
13
16
  userId: string;
14
17
  /** Logger. */
@@ -16,6 +19,12 @@ export interface MemoryHooksDeps {
16
19
  debug(msg: string): void;
17
20
  warn(msg: string): void;
18
21
  };
22
+ /** Access to recent messages (for auto-extract). Set externally per turn. */
23
+ getLastUserMessage?: () => string | undefined;
24
+ /** Access to last assistant response (for implicit extraction). Set externally per turn. */
25
+ getLastAssistantMessage?: () => string | undefined;
26
+ /** Background LLM for implicit extraction. If provided, enables Layer 2. */
27
+ llmExtract?: (prompt: string) => Promise<string | null>;
19
28
  }
20
29
  /** Session-scoped state for dedup and byte budget (CC parity). */
21
30
  export interface MemoryPrefetchState {
@@ -43,7 +52,7 @@ export declare function createMemoryPrefetchState(): MemoryPrefetchState;
43
52
  * Returns a cleanup function to unregister.
44
53
  */
45
54
  export declare function registerMemoryHooks(hooks: HookRegistry, deps: MemoryHooksDeps,
46
- /** Shared state 鈥?pass the same object across hook re-registrations in a session. */
55
+ /** Shared statepass the same object across hook re-registrations in a session. */
47
56
  prefetchState?: MemoryPrefetchState): () => void;
48
57
  export interface MemdirRecallHookDeps {
49
58
  /** MEMDIR instance (lazy: may be null at registration time). */
@@ -158,6 +158,17 @@ export interface SoloStartParams {
158
158
  task: string;
159
159
  agents: string[];
160
160
  cwd: string;
161
+ /** Project ID that owns this solo session. Used for session storage routing. */
162
+ projectId?: string;
163
+ /** Optional shared config injected into all agents (memory seed, rules, etc). */
164
+ sharedConfig?: {
165
+ /** Initial memory entries to seed into each agent's context. */
166
+ memory?: string[];
167
+ /** Rules/instructions to inject as system prompt prefix. */
168
+ rules?: string[];
169
+ /** Model override for all agents. */
170
+ model?: string;
171
+ };
161
172
  }
162
173
  /** solo.status / solo.cancel / solo.select RPC params. */
163
174
  export interface SoloIdParams {
@@ -168,6 +179,22 @@ export interface SoloSelectParams {
168
179
  soloId: string;
169
180
  winnerId: string;
170
181
  }
182
+ /** solo.message RPC params — send follow-up to individual agent. */
183
+ export interface SoloMessageParams {
184
+ soloId: string;
185
+ agentId: string;
186
+ content: string;
187
+ /** For duplicate agentIds, specify which instance (0-based index). */
188
+ agentIndex?: number;
189
+ }
190
+ /** solo.evaluate RPC params — user-triggered evaluation with chosen evaluator. */
191
+ export interface SoloEvaluateParams {
192
+ soloId: string;
193
+ /** Which agent in the solo session should perform the evaluation comparison. */
194
+ evaluatorAgentId: string;
195
+ /** For duplicate agentIds, specify which instance (0-based index). */
196
+ evaluatorIndex?: number;
197
+ }
171
198
  export type ProductInstanceState = "idle" | "running" | "completed" | "failed" | "paused";
172
199
  /** Product budget configuration & runtime counters. */
173
200
  export interface ProductBudget {
@@ -180,6 +207,8 @@ export interface ProductBudget {
180
207
  export interface ProductCreateParams {
181
208
  name: string;
182
209
  cwd: string;
210
+ /** Project ID that owns this product session. Used for session storage routing. */
211
+ projectId?: string;
183
212
  instances: ProductInstanceDef[];
184
213
  tasks: ProductTaskDef[];
185
214
  budget?: {
@@ -187,6 +216,69 @@ export interface ProductCreateParams {
187
216
  maxDuration?: number;
188
217
  };
189
218
  }
219
+ /**
220
+ * product.plan RPC params — starts an interactive planning session.
221
+ * The leader agent decomposes the goal into modules and proposes a DAG.
222
+ */
223
+ export interface ProductPlanParams {
224
+ /** High-level project goal (e.g. "build a multiplayer MMO game"). */
225
+ goal: string;
226
+ /** Working directory for the project. */
227
+ cwd: string;
228
+ /** Which agent acts as the team leader (must be ACP-compatible). */
229
+ leaderAgentId: string;
230
+ /** Optional: project name. Leader can suggest one if omitted. */
231
+ name?: string;
232
+ /** Optional: budget constraints communicated to leader during planning. */
233
+ budget?: {
234
+ maxTotalTokens?: number;
235
+ maxDuration?: number;
236
+ };
237
+ }
238
+ /** The structured plan produced by the leader agent. */
239
+ export interface ProductPlan {
240
+ /** Product/project name. */
241
+ name: string;
242
+ /** Modules the project is decomposed into. */
243
+ modules: Array<{
244
+ name: string;
245
+ description: string;
246
+ /** Suggested agent for this module (leader's recommendation). */
247
+ suggestedAgentId?: string;
248
+ }>;
249
+ /** Proposed team members (leader may suggest agents for each module). */
250
+ instances: ProductInstanceDef[];
251
+ /** Proposed task DAG. */
252
+ tasks: ProductTaskDef[];
253
+ /** Leader's explanation of the decomposition strategy. */
254
+ reasoning: string;
255
+ }
256
+ /**
257
+ * product.confirm RPC params — user confirms (optionally modified) plan.
258
+ * This starts the actual DAG execution with the leader managing progress.
259
+ */
260
+ export interface ProductConfirmParams {
261
+ /** The planning session product ID (returned by product.plan). */
262
+ productId: string;
263
+ /** Final instances (user may have reassigned agents). */
264
+ instances: ProductInstanceDef[];
265
+ /** Final task DAG (user may have modified). */
266
+ tasks: ProductTaskDef[];
267
+ /** Budget for execution phase. */
268
+ budget?: {
269
+ maxTotalTokens?: number;
270
+ maxDuration?: number;
271
+ };
272
+ }
273
+ /**
274
+ * product.message RPC params — user sends a message to the leader during any phase.
275
+ * Supports: multi-turn planning dialogue, and user intervention during execution.
276
+ */
277
+ export interface ProductMessageParams {
278
+ productId: string;
279
+ /** User's message content. */
280
+ content: string;
281
+ }
190
282
  /** product.resume / product.pause / product.checkpoint / product.status RPC params. */
191
283
  export interface ProductIdParams {
192
284
  productId: string;
@@ -9,10 +9,12 @@
9
9
  export declare const AGENT_DOT_DIR = ".qlogicagent";
10
10
  /** `~/.qlogicagent/` (or QLOGICAGENT_HOME override) */
11
11
  export declare function getUserAgentHome(): string;
12
- /** `~/.qlogicagent/sessions/` */
13
- export declare function getUserSessionsRoot(): string;
14
- /** `~/.qlogicagent/sessions/{sessionId}` */
15
- export declare function getUserSessionDir(sessionId: string): string;
12
+ /**
13
+ * Ensure the user agent home directory exists and is writable.
14
+ * Returns the path if accessible, throws with a friendly message otherwise.
15
+ * Call this once at startup rather than on every path resolution.
16
+ */
17
+ export declare function ensureUserAgentHome(): string;
16
18
  /** `~/.qlogicagent/.credentials.json` */
17
19
  export declare function getUserCredentialsPath(): string;
18
20
  /** `~/.qlogicagent/plugins/` */
@@ -25,8 +27,6 @@ export declare function getUserSettingsPath(): string;
25
27
  export declare function getUserCacheDir(): string;
26
28
  /** `~/.qlogicagent/debug-logs/` */
27
29
  export declare function getUserDebugLogsDir(): string;
28
- /** `~/.qlogicagent/checkpoints/` or `~/.qlogicagent/checkpoints/{sessionId}` */
29
- export declare function getUserCheckpointsDir(sessionId?: string): string;
30
30
  /** `~/.qlogicagent/plugin-cache/` */
31
31
  export declare function getUserPluginCacheDir(): string;
32
32
  /** `~/.qlogicagent/mcp.json` */
@@ -39,26 +39,20 @@ export declare function getUserWorkflowsDir(): string;
39
39
  export declare function getUserInstructionsPath(): string;
40
40
  /** `~/.qlogicagent/rules/` */
41
41
  export declare function getUserRulesDir(): string;
42
- /** `~/.qlogicagent/media/` — auto-downloaded media files (images, videos, audio). */
43
- export declare function getUserMediaDir(): string;
44
42
  /** `<cwd>/.qlogicagent/` */
45
- export declare function getProjectAgentDir(cwd?: string): string;
43
+ export declare function getProjectAgentDir(cwd: string): string;
46
44
  /** `<cwd>/.qlogicagent/workflows/` */
47
- export declare function getProjectWorkflowsDir(cwd?: string): string;
45
+ export declare function getProjectWorkflowsDir(cwd: string): string;
48
46
  /** `<cwd>/.qlogicagent/plugins/` */
49
- export declare function getProjectPluginsDir(cwd?: string): string;
47
+ export declare function getProjectPluginsDir(cwd: string): string;
50
48
  /** `<cwd>/.qlogicagent/skills/` */
51
- export declare function getProjectSkillsDir(cwd?: string): string;
49
+ export declare function getProjectSkillsDir(cwd: string): string;
52
50
  /** `<cwd>/.qlogicagent/settings.json` */
53
- export declare function getProjectSettingsPath(cwd?: string): string;
51
+ export declare function getProjectSettingsPath(cwd: string): string;
54
52
  /** `<cwd>/.qlogicagent/INSTRUCTIONS.md` */
55
- export declare function getProjectInstructionsPath(cwd?: string): string;
56
- /** `<cwd>/.qlogicagent/instructions/` — project-scoped instruction files (CRUD via RPC) */
57
- export declare function getProjectInstructionsDir(cwd?: string): string;
58
- /** `<cwd>/.qlogicagent/plans/` — project-scoped plan files */
59
- export declare function getProjectPlansDir(cwd?: string): string;
60
- /** `<cwd>/.qlogicagent/rules/` */
61
- export declare function getProjectRulesDir(cwd?: string): string;
53
+ export declare function getProjectInstructionsPath(cwd: string): string;
54
+ /** `<cwd>/.qlogicagent/rules/` — unified rules + instructions directory */
55
+ export declare function getProjectRulesDir(cwd: string): string;
62
56
  /** `<cwd>/.qlogicagent/sessions/` */
63
57
  export declare function getProjectSessionsRoot(cwd: string): string;
64
58
  /** `<cwd>/.qlogicagent/sessions/{sessionId}` */
@@ -68,16 +62,19 @@ export declare function getProjectCheckpointsDir(cwd: string, sessionId?: string
68
62
  /** `<gitRoot>/.qlogicagent/hooks/` */
69
63
  export declare function getGitRootHooksDir(gitRoot: string): string;
70
64
  /**
71
- * Discover all known project directories from session history.
72
- * Scans `~/.qlogicagent/sessions/` metadata to extract unique `cwd` paths.
65
+ * Discover all known project directories from the project store.
73
66
  * Used for cross-project skill recall (read-only, never writes to foreign projects).
74
67
  *
68
+ * NOTE: Does NOT import project-store directly to avoid circular deps.
69
+ * Caller must pass the project list.
70
+ *
71
+ * @param projectDirs - All known project workspace directories
75
72
  * @param excludeCwd - Current project cwd to exclude from results
76
- * @returns Array of absolute paths to project roots that have been worked on
73
+ * @returns Array of absolute paths to project roots that have skill directories
77
74
  */
78
- export declare function getKnownProjectDirs(excludeCwd?: string): string[];
75
+ export declare function getKnownProjectDirs(projectDirs: string[], excludeCwd?: string): string[];
79
76
  /**
80
77
  * Get skill directories from all known projects (excluding current).
81
78
  * Returns paths to `<project>/.qlogicagent/skills/` for recall-only access.
82
79
  */
83
- export declare function getAllProjectSkillDirs(excludeCwd?: string): string[];
80
+ export declare function getAllProjectSkillDirs(projectDirs: string[], excludeCwd?: string): string[];
@@ -7,7 +7,7 @@
7
7
  * - Own memory + tool context (no shared process.cwd)
8
8
  * - Lifecycle tracking (PID, health, abort)
9
9
  *
10
- * CC does this via tmux split-pane + `claude --agent-id ...` commands.
10
+ * CC does this via tmux split-pane + `claudeagent-id ...` commands.
11
11
  * We spawn `node dist/cli.js` as child processes with JSON-RPC stdio.
12
12
  *
13
13
  * Reference: claude-code-haha/src/utils/swarm/spawnMultiAgent.ts
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Supported provider metadata for settings RPC.
3
+ *
4
+ * Bridges provider-core's BUILTIN_PROVIDERS into the ModelPurpose system.
5
+ * This is the authoritative list of providers shown in "Add Key" UI.
6
+ *
7
+ * IMPORTANT: Model lists here are the Layer 2 (offline fallback) data source.
8
+ * Layer 1 is ModelCatalog (models.dev remote). These two are the ONLY sources.
9
+ */
10
+ import type { ModelPurpose } from "./model-registry.js";
11
+ export interface KnownModelMeta {
12
+ model: string;
13
+ displayName: string;
14
+ purposes: ModelPurpose[];
15
+ baseUrl?: string;
16
+ }
17
+ export interface SupportedProviderMeta {
18
+ id: string;
19
+ displayName: string;
20
+ baseUrl: string;
21
+ defaultRateLimit?: {
22
+ rpm?: number;
23
+ tpm?: number;
24
+ };
25
+ knownModels: KnownModelMeta[];
26
+ }
27
+ /**
28
+ * Minimal offline fallback providers.
29
+ * Remote catalog (Layer 1) has text generation models; this Layer 2 keeps ONLY
30
+ * specialized models that remote may not cover: embedding, TTS, STT, image gen,
31
+ * video gen, music gen, 3D gen, realtime voice/video, voice clone.
32
+ *
33
+ * All providers are kept (for Add Key UI dropdown + baseUrl lookup).
34
+ * Text generation / image understanding models are NOT listed here — remote always has them.
35
+ */
36
+ export declare const SUPPORTED_PROVIDERS: SupportedProviderMeta[];
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Local Checkpoint Backend — git-based shadow repo implementation.
3
3
  *
4
- * Creates and manages checkpoint snapshots in `~/.qlogicagent/checkpoints/<sessionId>/`
4
+ * Creates and manages checkpoint snapshots in `<project>/.qlogicagent/checkpoints/<sessionId>/`
5
5
  * using a shadow git repository independent of the user's project .git.
6
6
  */
7
7
  import type { CheckpointToolDeps } from "../../skills/tools/checkpoint-tool.js";
@@ -1,8 +1,7 @@
1
- export { AGENT_DOT_DIR, getUserAgentHome, getUserSessionDir, getUserCredentialsPath, getUserPluginsDir, getUserSkillsDir, getUserSettingsPath, getUserCacheDir, getUserDebugLogsDir, getUserCheckpointsDir, getUserPluginCacheDir, getUserMcpConfigPath, getUserMarketplaceConfigPath, getUserWorkflowsDir, getUserInstructionsPath, getProjectAgentDir, getProjectWorkflowsDir, getProjectPluginsDir, getProjectSkillsDir, getProjectSettingsPath, getProjectInstructionsPath, getProjectInstructionsDir, getProjectPlansDir, getProjectRulesDir, getGitRootHooksDir, getKnownProjectDirs, getAllProjectSkillDirs, } from "./agent-paths.js";
1
+ export { AGENT_DOT_DIR, getUserAgentHome, getUserCredentialsPath, getUserPluginsDir, getUserSkillsDir, getUserSettingsPath, getUserCacheDir, getUserDebugLogsDir, getUserPluginCacheDir, getUserMcpConfigPath, getUserMarketplaceConfigPath, getUserWorkflowsDir, getProjectAgentDir, getProjectWorkflowsDir, getProjectPluginsDir, getProjectSkillsDir, getProjectSettingsPath, getProjectInstructionsPath, getProjectRulesDir, getGitRootHooksDir, getKnownProjectDirs, getAllProjectSkillDirs, } from "./agent-paths.js";
2
2
  export { getBudgetContinuationMessage } from "./token-budget.js";
3
3
  export { type SecureStorage, saveApiKey, loadApiKey } from "./secure-storage.js";
4
4
  export { ProjectInstructionsStore, type InstructionFile } from "./project-instructions-store.js";
5
- export { ProjectPlanStore, type PlanEntry } from "./project-plan-store.js";
6
5
  export { createFileWatcher, FileWatcher } from "./file-watcher.js";
7
6
  export { TaskStore } from "./task-runtime.js";
8
7
  export { createWorktreeBackend } from "./worktree-backend.js";