qlogicagent 2.7.0 → 2.10.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 (117) hide show
  1. package/dist/agent.js +18 -18
  2. package/dist/cli.js +445 -433
  3. package/dist/index.js +444 -432
  4. package/dist/orchestration.js +6 -6
  5. package/dist/protocol.js +1 -1
  6. package/dist/types/agent/agent.d.ts +1 -1
  7. package/dist/types/agent/tool-loop.d.ts +1 -1
  8. package/dist/types/agent/tunable-defaults.d.ts +4 -0
  9. package/dist/types/agent/types.d.ts +7 -18
  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 +21 -0
  16. package/dist/types/cli/handlers/pet-handler.d.ts +28 -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 +90 -106
  26. package/dist/types/cli/tool-bootstrap.d.ts +4 -3
  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/tool-cascade.d.ts +2 -2
  31. package/dist/types/protocol/methods.d.ts +153 -5
  32. package/dist/types/protocol/wire/agent-events.d.ts +2 -2
  33. package/dist/types/protocol/wire/agent-methods.d.ts +5 -3
  34. package/dist/types/protocol/wire/gateway-rpc.d.ts +125 -4
  35. package/dist/types/protocol/wire/index.d.ts +1 -1
  36. package/dist/types/protocol/wire/notification-payloads.d.ts +79 -1
  37. package/dist/types/runtime/execution/dream-agent.d.ts +1 -1
  38. package/dist/types/runtime/execution/forked-agent.d.ts +1 -1
  39. package/dist/types/runtime/hooks/context-compression.d.ts +1 -1
  40. package/dist/types/runtime/hooks/memory-hooks.d.ts +1 -1
  41. package/dist/types/runtime/infra/acp-types.d.ts +4 -0
  42. package/dist/types/runtime/infra/agent-paths.d.ts +22 -25
  43. package/dist/types/runtime/infra/agent-process.d.ts +1 -1
  44. package/dist/types/runtime/infra/builtin-providers.d.ts +36 -0
  45. package/dist/types/runtime/infra/checkpoint-backend.d.ts +1 -1
  46. package/dist/types/runtime/infra/index.d.ts +1 -2
  47. package/dist/types/runtime/infra/key-pool.d.ts +120 -0
  48. package/dist/types/runtime/infra/media-persistence.d.ts +26 -15
  49. package/dist/types/runtime/infra/model-registry.d.ts +187 -0
  50. package/dist/types/runtime/infra/project-instructions-store.d.ts +3 -3
  51. package/dist/types/runtime/infra/project-store.d.ts +3 -0
  52. package/dist/types/runtime/infra/token-budget.d.ts +2 -2
  53. package/dist/types/runtime/infra/worktree-backend.d.ts +1 -1
  54. package/dist/types/runtime/pet/index.d.ts +10 -0
  55. package/dist/types/runtime/pet/pet-consistency.d.ts +79 -0
  56. package/dist/types/runtime/pet/pet-context-injection.d.ts +8 -0
  57. package/dist/types/runtime/pet/pet-file-loader.d.ts +62 -0
  58. package/dist/types/runtime/pet/pet-growth-engine.d.ts +60 -0
  59. package/dist/types/runtime/pet/pet-reaction-service.d.ts +33 -0
  60. package/dist/types/runtime/pet/pet-skeleton.d.ts +70 -0
  61. package/dist/types/runtime/pet/pet-soul-service.d.ts +71 -0
  62. package/dist/types/runtime/session/group-session-split.d.ts +38 -0
  63. package/dist/types/runtime/session/index.d.ts +4 -2
  64. package/dist/types/runtime/session/session-locator.d.ts +24 -0
  65. package/dist/types/runtime/session/session-memory.d.ts +4 -4
  66. package/dist/types/runtime/session/session-persistence.d.ts +47 -46
  67. package/dist/types/runtime/session/session-state.d.ts +3 -5
  68. package/dist/types/skills/memory/local-memory-provider.d.ts +11 -1
  69. package/dist/types/skills/memory/local-store.d.ts +3 -2
  70. package/dist/types/skills/memory/memdir.d.ts +7 -4
  71. package/dist/types/skills/memory/memory-provider-factory.d.ts +2 -8
  72. package/dist/types/skills/permissions/denial-audit-log.d.ts +1 -1
  73. package/dist/types/skills/permissions/permission-classifier.d.ts +1 -1
  74. package/dist/types/skills/tools/search-tool.d.ts +1 -1
  75. package/dist/types/skills/tools.d.ts +3 -3
  76. package/dist/types/transport/acp-event-emitter.d.ts +1 -1
  77. package/dist/types/transport/acp-server.d.ts +2 -2
  78. package/package.json +2 -1
  79. package/dist/types/llm/adapters/aliyun-oss-file-upload-adapter.d.ts +0 -44
  80. package/dist/types/llm/adapters/gemini-file-upload-adapter.d.ts +0 -26
  81. package/dist/types/llm/adapters/hub-oss-file-upload-adapter.d.ts +0 -29
  82. package/dist/types/llm/adapters/index.d.ts +0 -10
  83. package/dist/types/llm/adapters/openai-file-upload-adapter.d.ts +0 -38
  84. package/dist/types/llm/adapters/volcengine-file-upload-adapter.d.ts +0 -24
  85. package/dist/types/llm/builtin-providers.d.ts +0 -10
  86. package/dist/types/llm/debug-transport.d.ts +0 -12
  87. package/dist/types/llm/file-upload-service.d.ts +0 -68
  88. package/dist/types/llm/gemini-schema-utils.d.ts +0 -17
  89. package/dist/types/llm/llm-client.d.ts +0 -43
  90. package/dist/types/llm/media-client.d.ts +0 -42
  91. package/dist/types/llm/media-transport.d.ts +0 -176
  92. package/dist/types/llm/model-catalog.d.ts +0 -82
  93. package/dist/types/llm/model-detection.d.ts +0 -22
  94. package/dist/types/llm/provider-def.d.ts +0 -203
  95. package/dist/types/llm/provider-registry.d.ts +0 -59
  96. package/dist/types/llm/provider-tool-api.d.ts +0 -44
  97. package/dist/types/llm/retry.d.ts +0 -37
  98. package/dist/types/llm/transport.d.ts +0 -281
  99. package/dist/types/llm/transports/anthropic-messages.d.ts +0 -65
  100. package/dist/types/llm/transports/gemini-cache-api.d.ts +0 -86
  101. package/dist/types/llm/transports/gemini-file-api.d.ts +0 -90
  102. package/dist/types/llm/transports/gemini-generatecontent.d.ts +0 -56
  103. package/dist/types/llm/transports/gemini-lyria-realtime.d.ts +0 -117
  104. package/dist/types/llm/transports/gemini-media.d.ts +0 -53
  105. package/dist/types/llm/transports/media-resolve.d.ts +0 -50
  106. package/dist/types/llm/transports/minimax-media.d.ts +0 -55
  107. package/dist/types/llm/transports/openai-chat.d.ts +0 -81
  108. package/dist/types/llm/transports/openai-media.d.ts +0 -24
  109. package/dist/types/llm/transports/openai-responses.d.ts +0 -63
  110. package/dist/types/llm/transports/qwen-media.d.ts +0 -50
  111. package/dist/types/llm/transports/realtime-transport.d.ts +0 -183
  112. package/dist/types/llm/transports/volcengine-grounding.d.ts +0 -58
  113. package/dist/types/llm/transports/volcengine-media.d.ts +0 -93
  114. package/dist/types/llm/transports/volcengine-responses.d.ts +0 -64
  115. package/dist/types/llm/transports/zhipu-media.d.ts +0 -82
  116. package/dist/types/llm/transports/zhipu-tool-api.d.ts +0 -35
  117. package/dist/types/runtime/infra/project-plan-store.d.ts +0 -27
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Session & Thread handlers — uses SessionLocator for all path resolution.
3
+ *
4
+ * Handles: thread.create, thread.list, session.create, session.resolve,
5
+ * session.list, session.get, session.getMessages, session.update,
6
+ * session.delete, session.deleteAll, session.archive, session.resume,
7
+ * session.getInfo, session.switchProject, session.getState
8
+ *
9
+ * Key invariant: every session operation resolves storage path via projectId,
10
+ * never via the global `currentProjectRoot`. Sessions are immutably bound
11
+ * to a project at creation time.
12
+ */
13
+ export declare function handleThreadCreate(this: any, msg: any): void;
14
+ export declare function handleThreadList(this: any, msg: any): Promise<void>;
15
+ export declare function handleSessionCreate(this: any, msg: any): Promise<void>;
16
+ export declare function handleSessionResolve(this: any, msg: any): Promise<void>;
17
+ export declare function handleSessionList(this: any, msg: any): Promise<void>;
18
+ export declare function handleSessionGet(this: any, msg: any): Promise<void>;
19
+ export declare function handleSessionGetMessages(this: any, msg: any): Promise<void>;
20
+ export declare function handleSessionUpdate(this: any, msg: any): Promise<void>;
21
+ export declare function handleSessionDelete(this: any, msg: any): Promise<void>;
22
+ export declare function handleSessionDeleteAll(this: any, msg: any): Promise<void>;
23
+ export declare function handleSessionArchive(this: any, msg: any): Promise<void>;
24
+ export declare function handleSessionResume(this: any, msg: any): Promise<void>;
25
+ export declare function handleSessionGetInfo(this: any, msg: any): void;
26
+ export declare function handleSessionSwitchProject(this: any, msg: any): void;
27
+ export declare function handleSessionGetState(this: any, msg: any): void;
28
+ /**
29
+ * `session.focus` — Desktop UI reports which session is currently focused.
30
+ * Agent switches active project/cwd to the session's owning project.
31
+ */
32
+ export declare function handleSessionFocus(this: any, msg: any): Promise<void>;
33
+ /**
34
+ * `session.moveToProject` — Move a session from one project to another.
35
+ * Physically copies session files, updates metadata.projectId, then removes the source.
36
+ * Emits session:updated notification.
37
+ */
38
+ export declare function handleSessionMoveToProject(this: any, msg: any): Promise<void>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Settings RPC handlers — model management system.
3
+ *
4
+ * All model pool operations go through ModelRegistry (single source of truth).
5
+ * Handles: settings.listSupportedProviders, settings.addKey, settings.removeKey,
6
+ * settings.toggleKey, settings.listModels, settings.setActiveModel,
7
+ * settings.getActiveModel, settings.getOverview, settings.refreshModels
8
+ */
9
+ import type { AgentRpcRequest } from "../../protocol/wire/agent-rpc.js";
10
+ export declare function handleSettingsListProviders(this: any, msg: AgentRpcRequest): void;
11
+ export declare function handleSettingsAddKey(this: any, msg: AgentRpcRequest): Promise<void>;
12
+ export declare function handleSettingsRemoveKey(this: any, msg: AgentRpcRequest): void;
13
+ export declare function handleSettingsToggleKey(this: any, msg: AgentRpcRequest): void;
14
+ export declare function handleSettingsToggleModel(this: any, msg: AgentRpcRequest): void;
15
+ export declare function handleSettingsListModels(this: any, msg: AgentRpcRequest): void;
16
+ export declare function handleSettingsSetActiveModel(this: any, msg: AgentRpcRequest): void;
17
+ export declare function handleSettingsGetActiveModel(this: any, msg: AgentRpcRequest): void;
18
+ export declare function handleSettingsGetOverview(this: any, msg: AgentRpcRequest): void;
19
+ export declare function handleSettingsRefreshModels(this: any, msg: AgentRpcRequest): Promise<void>;
20
+ /**
21
+ * Validate a provider API key by making a minimal /models list request.
22
+ * Does not store the key; just verifies connectivity + auth.
23
+ */
24
+ export declare function handleSettingsValidateKey(this: any, msg: AgentRpcRequest): Promise<void>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Skills management handlers — extracted from StdioServer.
3
+ * Handles: skills.list, skills.activate, skills.deactivate, skills.delete,
4
+ * skills.promote, skills.stats, skills.pin, skills.unpin,
5
+ * skills.curator, skills.lifecycle
6
+ */
7
+ export declare function extractSkillMeta(skillMdPath: string): {
8
+ version?: string;
9
+ description?: string;
10
+ };
11
+ export declare function handleSkillsList(this: any, msg: any): void;
12
+ export declare function handleSkillsActivate(this: any, msg: any): void;
13
+ export declare function handleSkillsDeactivate(this: any, msg: any): void;
14
+ export declare function handleSkillsDelete(this: any, msg: any): void;
15
+ export declare function handleSkillsPromote(this: any, msg: any): void;
16
+ export declare function handleSkillsStats(this: any, msg: any): void;
17
+ export declare function handleSkillsPin(this: any, msg: any): void;
18
+ export declare function handleSkillsUnpin(this: any, msg: any): void;
19
+ export declare function handleSkillsCurator(this: any, msg: any): void;
20
+ export declare function handleSkillsLifecycle(this: any, msg: any): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Solo mode handlers — extracted from StdioServer.
3
+ * Handles: solo.start, solo.status, solo.cancel, solo.select,
4
+ * solo.list, solo.delete, solo.message, solo.evaluate
5
+ */
6
+ import { SoloEvaluator } from "../../orchestration/solo-evaluator.js";
7
+ export declare function ensureSoloEvaluator(this: any): SoloEvaluator;
8
+ export declare function handleSoloStart(this: any, msg: any): Promise<void>;
9
+ export declare function handleSoloStatus(this: any, msg: any): Promise<void>;
10
+ export declare function handleSoloCancel(this: any, msg: any): Promise<void>;
11
+ export declare function handleSoloSelect(this: any, msg: any): Promise<void>;
12
+ export declare function handleSoloList(this: any, msg: any): void;
13
+ export declare function handleSoloDelete(this: any, msg: any): Promise<void>;
14
+ export declare function handleSoloMessage(this: any, msg: any): Promise<void>;
15
+ export declare function handleSoloEvaluate(this: any, msg: any): Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Turn execution handlers — extracted from StdioServer.
3
+ * Handles: thread.turn, agent.abort, tool.approval.response, thread.user_response
4
+ */
5
+ import type { ChatMessage } from "../../agent/types.js";
6
+ import type { AgentRpcRequest } from "../../protocol/wire/agent-rpc.js";
7
+ import type { LLMTransport } from "@qlogic/provider-core";
8
+ export declare function handleAbort(this: any, msg: AgentRpcRequest): void;
9
+ export declare function handleApprovalResponse(this: any, msg: AgentRpcRequest): void;
10
+ export declare function handleUserResponse(this: any, msg: AgentRpcRequest): void;
11
+ export declare function handleTurn(this: any, msg: AgentRpcRequest): Promise<void>;
12
+ export declare const SUGGESTION_PROMPT: string;
13
+ /**
14
+ * Generate follow-up suggestions after a turn completes.
15
+ * Fire-and-forget — failures are silently logged. Non-blocking.
16
+ */
17
+ export declare function generateSuggestions(this: any, turnId: string, messages: ChatMessage[], transport: LLMTransport, apiKey: string, model: string): Promise<void>;
@@ -9,7 +9,7 @@
9
9
  * qlogicagent [--verbose] [--acp]
10
10
  *
11
11
  * Flags:
12
- * --verbose Enable debug logging to stderr
13
- * --acp Enable ACP (Agent-Client Protocol) server alongside legacy protocol
12
+ * verbose Enable debug logging to stderr
13
+ * acp Enable ACP (Agent-Client Protocol) server alongside legacy protocol
14
14
  */
15
15
  export {};
@@ -17,6 +17,8 @@ export interface StdioServerConfig {
17
17
  export declare class StdioServer {
18
18
  private running;
19
19
  private activeTurn;
20
+ /** Resolves when the active turn fully completes (including post-abort flush). */
21
+ private turnDone;
20
22
  private verbose;
21
23
  private transport;
22
24
  private registry;
@@ -25,8 +27,6 @@ export declare class StdioServer {
25
27
  private lastLlmConfigKey;
26
28
  private currentSessionId;
27
29
  private currentTurnId;
28
- /** Project root for project-local session/memory persistence. */
29
- private currentProjectRoot;
30
30
  private currentHooks;
31
31
  private mcpManager;
32
32
  private mcpReady;
@@ -83,6 +83,17 @@ export declare class StdioServer {
83
83
  /** Idle dream timer — fires after configurable idle period to trigger memory consolidation. */
84
84
  private idleDreamTimer;
85
85
  constructor(config: StdioServerConfig);
86
+ /**
87
+ * Get the active project workspace directory.
88
+ * Reads from projectStore (single source of truth).
89
+ */
90
+ private getActiveProjectRoot;
91
+ /**
92
+ * Single entry point for updating the active workdir.
93
+ * Centralizes all side-effects (bootstrap workdir, media persistence, etc.).
94
+ * Uses projectStore as the source of truth — no private field cache.
95
+ */
96
+ private setActiveWorkdir;
86
97
  start(): void;
87
98
  stop(): void;
88
99
  private readonly methodHandlers;
@@ -99,118 +110,166 @@ export declare class StdioServer {
99
110
  * Called from both legacy handleInitialize and ACP acpHandleInitialize.
100
111
  */
101
112
  private ensureDefaultProject;
113
+ private ensureDefaultProjectDir;
102
114
  /**
103
115
  * `thread.create` — create a new thread (session container).
104
116
  * Maps threadId → sessionId for the underlying session system.
105
117
  */
106
- private handleThreadCreate;
107
118
  /**
108
119
  * `thread.list` — list available threads. Delegates to session listing.
109
120
  */
110
- private handleThreadList;
121
+ /**
122
+ * Resolve session for an inbound message.
123
+ * For desktop: chatId IS the sessionId — look it up directly.
124
+ * For group: look up by groupKey pattern.
125
+ * If not found, create a new session and return it.
126
+ */
111
127
  private handlePing;
112
- private handleAbort;
113
- private handleApprovalResponse;
114
- private handleUserResponse;
115
- private handleSessionResume;
116
- private handleTurn;
117
128
  private static readonly SUGGESTION_PROMPT;
129
+ /**
130
+ * Atomically resolve transport + model + apiKey for a given ModelPurpose.
131
+ * If the resolved provider matches `this.currentProvider`, reuses cached transport.
132
+ * Otherwise creates a one-shot client. Returns null if purpose is unresolvable.
133
+ * This ensures side-ops always use fresh model from registry — never stale cache.
134
+ */
135
+ private resolveClientForPurpose;
118
136
  /**
119
137
  * Generate follow-up suggestions after a turn completes.
120
138
  * Fire-and-forget — failures are silently logged. Non-blocking.
139
+ * CC parity: suggestions use the SAME model as main (prompt cache sharing).
121
140
  */
122
141
  private generateSuggestions;
123
- private handleDream;
142
+ /**
143
+ * Create a soul generator function that uses small model LLM.
144
+ * Used by pet.hatch to generate personalized name/personality/catchphrase.
145
+ */
146
+ createPetSoulGenerator(): ((rarity: string, stats: any) => Promise<{
147
+ name: string;
148
+ personality: string;
149
+ catchphrase: string;
150
+ }>) | undefined;
151
+ /**
152
+ * Create a generic small LLM call function for short generation tasks.
153
+ * Returns a function compatible with generateLLMReaction's signature.
154
+ */
155
+ createSmallLLMCall(): ((prompt: string, maxTokens: number) => Promise<string | null>) | undefined;
156
+ /**
157
+ * P4 Forge: Analyze uploaded image via Vision model (design §14.3 step 1).
158
+ */
159
+ forgeAnalyzeImage(imageBase64: string, hint?: string): Promise<string>;
160
+ /**
161
+ * P4 Forge: Generate a single state SVG via LLM code generation (design §14.3 Option C).
162
+ */
163
+ forgeGenerateSVG(characterDesc: string, state: string): Promise<string>;
164
+ /**
165
+ * P4 Forge: Generate a base skeleton SVG via LLM (design §14.3 Plan A).
166
+ * One LLM call produces the entire character skeleton with labeled parts.
167
+ * States are then rendered by injecting CSS animations (no additional LLM calls).
168
+ */
169
+ forgeGenerateSkeleton(characterDesc: string): Promise<string>;
170
+ /**
171
+ * P4 Forge: Score SVG consistency using Vision model (design §14.4).
172
+ * Compares a candidate SVG against the reference (idle) to score character consistency.
173
+ */
174
+ forgeScoreConsistency(referenceSvg: string, candidateSvg: string, state: string, characterDesc: string): Promise<{
175
+ score: number;
176
+ feedback: string;
177
+ }>;
178
+ /**
179
+ * Award XP to pet on events (fire-and-forget).
180
+ */
181
+ private petAwardXp;
182
+ /** Check if the pet system is active (soul hatched). */
183
+ private isPetActive;
184
+ /** Pending confirm requests — confirmId → resolve callback. */
185
+ private pendingConfirms;
186
+ /**
187
+ * Request user confirmation for a tool call via the pet overlay.
188
+ * Returns true if approved, false if denied or timed out.
189
+ */
190
+ requestPetConfirm(toolName: string, description: string, risk: "low" | "medium" | "high", timeoutMs?: number): Promise<boolean>;
191
+ private handlePetConfirmResponse;
192
+ /**
193
+ * Generate pet reaction after turn (P3: LLM-enhanced, P0: template fallback).
194
+ */
195
+ private petReactionAfterTurn;
196
+ /**
197
+ * Ensure the L2 SQLite memory provider exists for read-only RPCs
198
+ * (memory.atlas / memory.activity). These can be called before any turn has
199
+ * run, so they cannot rely on resolveAgent() having initialized the provider.
200
+ * Opening the DB is cheap and side-effect-free (list() does not embed).
201
+ */
202
+ private ensureMemoryProvider;
124
203
  private resolveAgent;
125
204
  /**
126
- * Load LLM settings from ~/.qlogicagent/settings.json (sync).
205
+ * Load LLM config from ModelRegistry (textGeneration binding).
127
206
  * Returns provider/model/apiKey if found, undefined otherwise.
128
207
  */
129
- private loadSettingsSync;
130
208
  /**
131
209
  * `session.getInfo` — Return session metadata, filesystem paths, and usage summary.
132
210
  * Aligns with Codex/Copilot session introspection capability.
133
211
  */
134
- private handleSessionGetInfo;
135
212
  /**
136
213
  * `memory.list` — Enumerate available memory sources (memdir + local sqlite).
137
214
  */
138
- private handleMemoryList;
139
215
  /**
140
216
  * `memory.read` — Read memory content from memdir (INDEX.md or topic file).
141
217
  */
142
- private handleMemoryRead;
143
218
  /**
144
219
  * `memory.write` — Write memory content to memdir (INDEX.md or topic file).
145
220
  */
146
- private handleMemoryWrite;
147
221
  /**
148
222
  * `tools.list` — Return available tool definitions (local + MCP + plugin).
149
223
  * Supports optional category filter.
150
224
  */
151
- private handleToolsList;
152
225
  /**
153
226
  * `media.listModels` — List available media generation models.
154
227
  * Desktop app uses this to populate the model selector per category.
155
228
  */
156
- private handleMediaListModels;
157
229
  /**
158
230
  * `media.cancel` — Cancel an in-progress media generation task.
159
231
  * Delegates to the provider's native cancellation API (e.g. Volcengine DELETE task).
160
232
  */
161
- private handleMediaCancel;
162
233
  /**
163
234
  * `media.status` — Query the status of a media generation task.
164
235
  * Returns provider-specific task status (e.g. queuing, running, succeeded, failed).
165
236
  */
166
- private handleMediaStatus;
167
237
  /** Resolve media API key for a provider from the current session config. */
168
- private resolveMediaApiKey;
169
238
  /**
170
239
  * `provider.list` — List all available LLM providers grouped by logical family.
171
240
  * Returns protocol variants so callers can pick which transport to use.
172
241
  */
173
- private handleProviderList;
174
242
  /**
175
243
  * `config.get` — Read current agent runtime configuration.
176
244
  * Returns merged user-level + project-level settings.
177
245
  */
178
- private handleConfigGet;
179
246
  /**
180
247
  * `config.update` — Update agent runtime configuration (merges into settings.json).
181
248
  */
182
- private handleConfigUpdate;
183
249
  /**
184
250
  * `config.tunables` — Return all tunable default values with their current overrides.
185
251
  */
186
- private handleConfigTunables;
187
252
  /**
188
253
  * `config.updateTunable` — Write a single tunable override into settings.json.tunables.
189
254
  * Params: { key: string, value: number | boolean | string }
190
255
  * Only keys that exist in TunableDefaults are accepted (validation).
191
256
  */
192
- private handleConfigUpdateTunable;
193
257
  /**
194
258
  * `todos.list` — Query current todo items and summary.
195
259
  * Invokes the registered todo tool's list action.
196
260
  */
197
- private handleTodosList;
198
261
  /**
199
262
  * `memory.search` — Search memory via local SQLite provider or memdir keyword fallback.
200
263
  */
201
- private handleMemorySearch;
202
264
  /**
203
265
  * `memory.delete` — Remove memory entry from memdir (INDEX.md line) or local store (by ID).
204
266
  */
205
- private handleMemoryDelete;
206
267
  /**
207
268
  * `tasks.list` — Query running/completed infrastructure tasks.
208
269
  */
209
- private handleTasksList;
210
270
  /**
211
271
  * `tasks.cancel` — Cancel a running task by ID.
212
272
  */
213
- private handleTasksCancel;
214
273
  /** Map process handle state → agents.status notification status. */
215
274
  private static readonly STATE_TO_STATUS;
216
275
  /** Emit an `agents.status` notification when a child process state changes. */
@@ -224,75 +283,39 @@ export declare class StdioServer {
224
283
  /** Ensure agent config store is loaded. */
225
284
  private ensureAgentConfigStore;
226
285
  /** `agents.scan` — Scan for installed ACP agent CLIs. */
227
- private handleAgentsScan;
228
286
  /** `agents.list` — Return cached agent descriptors. */
229
- private handleAgentsList;
230
287
  /** `agents.config` — Register / unregister / update custom agents. */
231
- private handleAgentsConfig;
232
288
  /** `agents.setConfig` — Set per-agent LLM / environment / model ID config. */
233
- private handleAgentsSetConfig;
234
289
  /** `agents.getConfig` — Get per-agent configuration. */
235
- private handleAgentsGetConfig;
236
290
  /** `agents.removeConfig` — Remove per-agent configuration. */
237
- private handleAgentsRemoveConfig;
238
291
  /** `agents.setGateway` — Set global gateway proxy URL. */
239
- private handleAgentsSetGateway;
240
- private ensureSoloEvaluator;
241
292
  /** `solo.start` — Start a Solo Mode PK session. */
242
- private handleSoloStart;
243
293
  /** `solo.status` — Query solo session status. */
244
- private handleSoloStatus;
245
294
  /** `solo.cancel` — Cancel a running solo session. */
246
- private handleSoloCancel;
247
295
  /** `solo.select` — Select winner and merge worktree. */
248
- private handleSoloSelect;
249
- private ensureProductOrchestrator;
250
296
  /** Ensure ProductPlanner is initialized. */
251
- private ensureProductPlanner;
252
297
  /** `product.plan` — Start interactive planning with leader agent. */
253
- private handleProductPlan;
254
298
  /** `product.confirm` — User confirms the plan, transition to execution. */
255
- private handleProductConfirm;
256
299
  /** `product.message` — User sends message to leader (multi-turn planning or execution intervention). */
257
- private handleProductMessage;
258
300
  /** `product.create` — Create a new Product Mode session. */
259
- private handleProductCreate;
260
301
  /** `product.resume` — Resume a paused product. */
261
- private handleProductResume;
262
302
  /** `product.pause` — Pause a running product. */
263
- private handleProductPause;
264
303
  /** `product.checkpoint` — Manual checkpoint. */
265
- private handleProductCheckpoint;
266
304
  /** `product.status` — Query product status. */
267
- private handleProductStatus;
268
305
  /** `product.list` — List all products. */
269
- private handleProductList;
270
306
  /** `agents.getGateway` — Get the current global gateway proxy URL. */
271
- private handleAgentsGetGateway;
272
307
  /** `agents.listConfigured` — List agents that have persisted configuration. */
273
- private handleAgentsListConfigured;
274
308
  /** `agents.processes` — List all active child agent processes from solo/product PMs. */
275
- private handleAgentsProcesses;
276
309
  /** `agents.kill` — Kill a child agent process by memberId. */
277
- private handleAgentsKill;
278
310
  /** `agents.getLog` — Read stderr log for a specific agent. */
279
- private handleAgentsGetLog;
280
311
  /** `agents.testConnection` — Spawn an agent with a short timeout to verify connectivity. */
281
- private handleAgentsTestConnection;
282
312
  /** `solo.list` — List all solo sessions. */
283
- private handleSoloList;
284
313
  /** `solo.delete` — Delete a solo session and clean up resources. */
285
- private handleSoloDelete;
286
314
  /** `solo.message` — Send follow-up message to a specific agent in solo session. */
287
- private handleSoloMessage;
288
315
  /** `solo.evaluate` — User-triggered evaluation of solo session results. */
289
- private handleSoloEvaluate;
290
316
  /** `product.delete` — Delete a product session and clean up resources. */
291
- private handleProductDelete;
292
317
  /** `product.cancel` — Cancel a running product. */
293
- private handleProductCancel;
294
318
  /** `product.rollback` — Rollback a product to a checkpoint. */
295
- private handleProductRollback;
296
319
  private sendResponse;
297
320
  private sendNotification;
298
321
  private writeStdout;
@@ -345,43 +368,4 @@ export declare class StdioServer {
345
368
  private acpHandleProductRollback;
346
369
  private acpHandleProductSubscribe;
347
370
  private acpHandleTeamDelegate;
348
- private handleProjectCreate;
349
- private handleProjectList;
350
- private handleProjectDelete;
351
- private handleProjectRename;
352
- private handleProjectArchive;
353
- private handleProjectUnarchive;
354
- private handleProjectArchiveByGroup;
355
- private handleSessionSwitchProject;
356
- private handleSessionGetState;
357
- private getProjectInstructionsStore;
358
- private handleInstructionsList;
359
- private handleInstructionsRead;
360
- private handleInstructionsWrite;
361
- private handleInstructionsDelete;
362
- private handleSkillsList;
363
- /** Extract version and description from a SKILL.md frontmatter. */
364
- private extractSkillMeta;
365
- private handleSkillsActivate;
366
- private handleSkillsDeactivate;
367
- /**
368
- * `skills.delete` — Permanently remove a skill from project or global scope.
369
- * Params: { name: string, scope?: "project" | "global" }
370
- * Default scope: "project"
371
- */
372
- private handleSkillsDelete;
373
- /**
374
- * `skills.promote` — Copy a project-level skill to global (user-level).
375
- * Params: { name: string, keepLocal?: boolean }
376
- * By default removes the project-level copy after promoting.
377
- */
378
- private handleSkillsPromote;
379
- private handleSkillsStats;
380
- private handleSkillsPin;
381
- private handleSkillsUnpin;
382
- private handleSkillsCurator;
383
- private handleSkillsLifecycle;
384
- private getProjectPlanStore;
385
- private handlePlansList;
386
- private handlePlansGet;
387
371
  }
@@ -3,9 +3,9 @@ import { type TaskToolHooks } from "../skills/tools/task-tool.js";
3
3
  import { type ExecProgress } from "../skills/tools/exec-tool.js";
4
4
  import type { AgentLogger } from "../agent/types.js";
5
5
  import { type AskUserQuestion } from "../skills/tools/ask-user-tool.js";
6
- import type { MediaClient } from "../llm/media-client.js";
7
- import type { MediaCapability } from "../llm/provider-def.js";
8
- import type { ProviderToolAPI } from "../llm/provider-tool-api.js";
6
+ import type { MediaClient } from "@qlogic/provider-core";
7
+ import type { MediaCapability } from "@qlogic/provider-core";
8
+ import type { ProviderToolAPI } from "@qlogic/provider-core";
9
9
  /** Enable or disable group security mode (blocks sensitive file access). */
10
10
  export declare function setGroupSecurityMode(enabled: boolean): void;
11
11
  /**
@@ -14,6 +14,7 @@ export declare function setGroupSecurityMode(enabled: boolean): void;
14
14
  * falling back to SearXNG. Called from stdio-server per session.
15
15
  */
16
16
  export declare function setProviderToolAPI(api: ProviderToolAPI | undefined): void;
17
+ export declare function createProviderToolAPIForSession(providerId: string | undefined, apiKey: string | undefined): ProviderToolAPI | undefined;
17
18
  /** Set callback invoked after LLM-driven project switch. */
18
19
  export declare function setProjectSwitchCallback(cb: ((project: {
19
20
  id: string;
@@ -12,6 +12,6 @@ export interface AgentConfig {
12
12
  * Parse CLI arguments into AgentConfig.
13
13
  *
14
14
  * Supports:
15
- * --verbose / -v Enable verbose logging
15
+ * verbose / -v Enable verbose logging
16
16
  */
17
17
  export declare function parseCliArgs(argv: string[]): AgentConfig;
@@ -10,7 +10,7 @@ export type { AgentConfig } from "./config/config.js";
10
10
  export type { Transport } from "./cli/transport.js";
11
11
  export { StdioTransport } from "./cli/transport.js";
12
12
  export { StdioServer, type StdioServerConfig } from "./cli/stdio-server.js";
13
- export { ProviderRegistry, createLLMClient, } from "./llm/index.js";
14
- export type { LLMTransport, LLMRequest, LLMChunk } from "./llm/index.js";
13
+ export { ProviderRegistry, createLLMClient, } from "@qlogic/provider-core";
14
+ export type { LLMTransport, LLMRequest, LLMChunk } from "@qlogic/provider-core";
15
15
  export { createHookRegistry } from "./runtime/hooks/hook-registry.js";
16
16
  export { buildSkillInstruction, } from "./orchestration/index.js";
@@ -1,31 +1 @@
1
- /**
2
- * LLM Provider layer — public API surface.
3
- *
4
- * Provides: ProviderDef + LLMTransport + ProviderRegistry + LLMClient factory
5
- */
6
- export type { ProviderDef, ModelInfo, TransportType, AuthType, MediaCapability, MediaCapabilities, VideoCapabilities, ImageCapabilities, MusicCapabilities, TtsCapabilities, ThreeDCapabilities, SttCapabilities, EmbeddingCapabilities, VideoUnderstandingCapabilities, ImageUnderstandingCapabilities, VoiceCloneCapabilities, RerankCapabilities, DocumentParsingCapabilities, RealtimeAudioCapabilities, VideoOperation, ImageOperation, MusicOperation, TtsOperation, ThreeDOperation } from "./provider-def.js";
7
- export type { LLMTransport, LLMRequest, LLMChunk, AccumulatedToolCall, } from "./transport.js";
8
- export { accumulateToolCalls } from "./transport.js";
9
- export type { MediaTransport, MediaRequest, MediaResult, MediaType } from "./media-transport.js";
10
- export { MediaClient, type MediaClientConfig, type ResolvedMediaModel } from "./media-client.js";
11
- export { ProviderRegistry } from "./provider-registry.js";
12
- export { BUILTIN_PROVIDERS } from "./builtin-providers.js";
13
- export { ModelCatalog } from "./model-catalog.js";
14
- export type { LLMClientConfig, LLMClient } from "./llm-client.js";
15
- export { createLLMClient } from "./llm-client.js";
16
- export { OpenAIChatTransport } from "./transports/openai-chat.js";
17
- export { AnthropicMessagesTransport } from "./transports/anthropic-messages.js";
18
- export { GeminiGenerateContentTransport } from "./transports/gemini-generatecontent.js";
19
- export { VolcengineMediaTransport } from "./transports/volcengine-media.js";
20
- export { OpenAIMediaTransport } from "./transports/openai-media.js";
21
- export { MiniMaxMediaTransport } from "./transports/minimax-media.js";
22
- export { GeminiMediaTransport, type GeminiMediaConfig } from "./transports/gemini-media.js";
23
- export { GeminiLyriaRealtimeSession, generateRealtimeMusic } from "./transports/gemini-lyria-realtime.js";
24
- export type { WeightedPrompt, MusicGenerationConfig, MusicScale, MusicGenerationMode, LyriaRealtimeConfig, LyriaRealtimeSessionOptions, AudioChunk } from "./transports/gemini-lyria-realtime.js";
25
- export { RealtimeTransport } from "./transports/realtime-transport.js";
26
- export type { RealtimeConfig, RealtimeTool, RealtimeEvent, RealtimeUsage } from "./transports/realtime-transport.js";
27
- export { GeminiCacheAPI } from "./transports/gemini-cache-api.js";
28
- export type { GeminiCachedContent, GeminiCacheCreateOptions } from "./transports/gemini-cache-api.js";
29
- export { GeminiFileAPI } from "./transports/gemini-file-api.js";
30
- export type { GeminiFileInfo } from "./transports/gemini-file-api.js";
31
- export { isDebugTransportEnabled, createDebugTransport } from "./debug-transport.js";
1
+ export * from "@qlogic/provider-core";
@@ -23,14 +23,14 @@
23
23
  *
24
24
  * ```ts
25
25
  * import { cascadeWebSearch } from "./tool-cascade.js";
26
- * import { ZhipuToolAPI } from "../llm/transports/zhipu-tool-api.js";
26
+ * import { ZhipuToolAPI } from "@qlogic/provider-core/transports/zhipu-tool-api";
27
27
  *
28
28
  * const providerApi = new ZhipuToolAPI({ baseUrl, apiKey });
29
29
  * const cascadedSearch = cascadeWebSearch(providerApi, fallbackSearchFn);
30
30
  * const tool = createWebSearchTool({ search: cascadedSearch });
31
31
  * ```
32
32
  */
33
- import type { ProviderToolAPI } from "../llm/provider-tool-api.js";
33
+ import type { ProviderToolAPI } from "@qlogic/provider-core";
34
34
  import type { WebSearchToolDeps } from "../skills/tools/web-search-tool.js";
35
35
  /**
36
36
  * Cascade web search: provider-native search → host fallback.