qlogicagent 2.2.0 → 2.4.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 (72) hide show
  1. package/dist/agent.js +10 -9
  2. package/dist/cli.js +213 -211
  3. package/dist/index.js +212 -210
  4. package/dist/orchestration.js +13 -12
  5. package/dist/protocol.js +1 -0
  6. package/dist/types/agent/constants.d.ts +4 -53
  7. package/dist/types/agent/tunable-defaults.d.ts +225 -0
  8. package/dist/types/agent/types.d.ts +24 -100
  9. package/dist/types/cli/stdio-server.d.ts +40 -0
  10. package/dist/types/cli/tool-bootstrap.d.ts +6 -0
  11. package/dist/types/contracts/index.d.ts +2 -3
  12. package/dist/types/llm/provider-def.d.ts +3 -0
  13. package/dist/types/llm/transport.d.ts +25 -25
  14. package/dist/types/llm/transports/anthropic-messages.d.ts +2 -2
  15. package/dist/types/llm/transports/gemini-generatecontent.d.ts +2 -2
  16. package/dist/types/llm/transports/openai-chat.d.ts +2 -2
  17. package/dist/types/llm/transports/openai-responses.d.ts +9 -9
  18. package/dist/types/llm/transports/volcengine-responses.d.ts +11 -11
  19. package/dist/types/orchestration/agent-instance.d.ts +15 -0
  20. package/dist/types/orchestration/skill-improvement.d.ts +39 -8
  21. package/dist/types/orchestration/solo-evaluator.d.ts +7 -0
  22. package/dist/types/orchestration/subagent/fork-subagent.d.ts +2 -2
  23. package/dist/types/orchestration/tool-loop/tool-choice-policy.d.ts +1 -1
  24. package/dist/types/protocol/methods.d.ts +143 -53
  25. package/dist/types/protocol/notifications.d.ts +4 -495
  26. package/dist/types/protocol/wire/acp-protocol.d.ts +411 -0
  27. package/dist/types/protocol/wire/agent-events.d.ts +32 -0
  28. package/dist/types/protocol/wire/agent-methods.d.ts +587 -0
  29. package/dist/types/protocol/wire/agent-rpc.d.ts +97 -0
  30. package/dist/types/protocol/wire/capability-manifest.d.ts +111 -0
  31. package/dist/types/protocol/wire/capability-transport.d.ts +207 -0
  32. package/dist/types/protocol/wire/channel-ingress.d.ts +29 -0
  33. package/dist/types/protocol/wire/channel.d.ts +89 -0
  34. package/dist/types/protocol/wire/chat-types.d.ts +87 -0
  35. package/dist/types/protocol/wire/checkpoint-runtime.d.ts +61 -0
  36. package/dist/types/protocol/wire/checkpoint.d.ts +72 -0
  37. package/dist/types/protocol/wire/execution.d.ts +391 -0
  38. package/dist/types/protocol/wire/gateway-rpc.d.ts +314 -0
  39. package/dist/types/protocol/wire/gateway.d.ts +62 -0
  40. package/dist/types/protocol/wire/hook-protocol.d.ts +37 -0
  41. package/dist/types/protocol/wire/index.d.ts +25 -0
  42. package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +80 -0
  43. package/dist/types/protocol/wire/notification-payloads.d.ts +581 -0
  44. package/dist/types/protocol/wire/provider-runtime-contract.d.ts +66 -0
  45. package/dist/types/protocol/wire/provider-runtime-core.d.ts +147 -0
  46. package/dist/types/protocol/wire/provider-runtime-io.d.ts +20 -0
  47. package/dist/types/protocol/wire/resource-manifest.d.ts +68 -0
  48. package/dist/types/protocol/wire/session.d.ts +32 -0
  49. package/dist/types/protocol/wire/thread-protocol.d.ts +157 -0
  50. package/dist/types/protocol/wire/transport.d.ts +57 -0
  51. package/dist/types/protocol/wire/turn.d.ts +208 -0
  52. package/dist/types/protocol/wire/web-capability.d.ts +51 -0
  53. package/dist/types/runtime/hooks/memory-hooks.d.ts +2 -5
  54. package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +2 -4
  55. package/dist/types/runtime/infra/acp-types.d.ts +3 -142
  56. package/dist/types/runtime/infra/project-store.d.ts +6 -0
  57. package/dist/types/runtime/infra/skill-injector.d.ts +9 -2
  58. package/dist/types/runtime/infra/token-budget.d.ts +3 -3
  59. package/dist/types/runtime/session/index.d.ts +1 -1
  60. package/dist/types/runtime/session/session-memory.d.ts +46 -0
  61. package/dist/types/runtime/session/session-persistence.d.ts +34 -8
  62. package/dist/types/runtime/session/session-state.d.ts +4 -4
  63. package/dist/types/skills/memory/memory-tool.d.ts +1 -1
  64. package/dist/types/skills/memory/qmemory-adapter.d.ts +1 -1
  65. package/dist/types/skills/permissions/hook-runner.d.ts +4 -4
  66. package/dist/types/skills/permissions/permission-classifier.d.ts +2 -2
  67. package/dist/types/skills/skill-system/skill-source.d.ts +65 -0
  68. package/dist/types/skills/tools/project-switch-tool.d.ts +24 -0
  69. package/dist/types/skills/tools.d.ts +5 -5
  70. package/dist/types/transport/acp-event-emitter.d.ts +1 -1
  71. package/dist/types/transport/acp-server.d.ts +18 -9
  72. package/package.json +14 -3
@@ -1,115 +1,35 @@
1
1
  /**
2
- * Pure agent types zero I/O framework dependencies.
2
+ * Pure agent types 鈥?zero I/O framework dependencies.
3
3
  *
4
- * These types define the contract between:
5
- * - CLI stdio layer Agent class
6
- * - Agent class LLM Provider
7
- * - Agent class ↔ Tool loop
8
- *
9
- * Ported from Hub semantic-turn-shared.ts / semantic-turn-tools.ts,
10
- * with Hub infrastructure (WS/PG/Redis) replaced by DI interfaces.
11
- *
12
- * No imports from express/pg/ioredis/ws.
4
+ * Wire-level types (ChatMessage, ToolDefinition) are canonical in
5
+ * protocol/wire/. This file re-exports them and adds
6
+ * internal-only extensions (e.g. backfillObservableInput on ToolDefinition).
13
7
  */
14
8
  import type { SkillInstruction } from "../orchestration/index.js";
15
9
  import type { HookRegistry } from "../contracts/hooks.js";
16
10
  import type { MediaCapability } from "../llm/provider-def.js";
17
- export type ChatMessageRole = "system" | "user" | "assistant" | "tool";
18
- /** Thinking block from Anthropic Messages API (DeepSeek, Claude, etc.) */
19
- export interface ThinkingBlock {
20
- thinking: string;
21
- signature: string;
22
- }
23
- export interface ChatMessage {
24
- role: ChatMessageRole;
25
- content: string | null;
26
- /** For assistant messages with tool calls */
27
- tool_calls?: ToolCallMessage[];
28
- /** For tool result messages */
29
- tool_call_id?: string;
30
- /** For tool result messages — tool name */
31
- name?: string;
32
- /** Anthropic thinking blocks — must be passed back to API in subsequent requests */
33
- thinkingBlocks?: ThinkingBlock[];
34
- /**
35
- * Image URLs for vision-capable models.
36
- * Transports convert these into the provider's native content block format:
37
- * - OpenAI-chat: [{type:"text",text:...},{type:"image_url",image_url:{url:...}}]
38
- * - Anthropic: [{type:"text",text:...},{type:"image",source:{type:"url",url:...}}]
39
- * Valid on role="user" and role="tool" messages.
40
- * For tool results, images are resolved via FileUploadAdapter before sending to LLM.
41
- */
42
- imageUrls?: string[];
43
- /** Image detail level for vision understanding: 'auto' | 'low' | 'high' | 'xhigh' */
44
- imageDetail?: "auto" | "low" | "high" | "xhigh";
45
- /** Max image pixels budget for vision understanding (Volcengine image_pixel_limit) */
46
- imagePixelLimit?: {
47
- minPixels?: number;
48
- maxPixels?: number;
49
- };
50
- /** Video URLs for video-understanding models. Only valid on role="user" messages. */
51
- videoUrls?: string[];
52
- /** Per-video fps for video understanding (0.2-5, default 1) */
53
- videoFps?: number;
54
- /** Audio format hint for audio understanding: 'mp3' | 'wav' | 'aac' | 'm4a' */
55
- audioFormat?: "mp3" | "wav" | "aac" | "m4a";
56
- /** Audio URLs for audio-understanding models. Only valid on role="user" messages. */
57
- audioUrls?: string[];
58
- /**
59
- * Pre-uploaded file IDs for document/media understanding.
60
- * Used with Files API — each entry is a { id, mimeType } pair.
61
- * Only valid on role="user" messages.
62
- */
63
- fileIds?: Array<{
64
- id: string;
65
- mimeType?: string;
66
- }>;
67
- }
68
- export interface ToolCallMessage {
69
- id: string;
70
- type: "function";
71
- function: {
72
- name: string;
73
- arguments: string;
74
- };
75
- }
76
- export interface ToolDefinition {
77
- type: "function";
78
- function: {
79
- name: string;
80
- description: string;
81
- parameters?: Record<string, unknown>;
82
- };
83
- /** Tool scheduling metadata from host manifest (optional) */
84
- meta?: {
85
- serialOnly?: boolean;
86
- parallelSafe?: boolean;
87
- /** If true, host should request user approval before execution (CC PreToolUse parity) */
88
- requiresApproval?: boolean;
89
- /** Tool is read-only / safe — skip approval even in strict mode */
90
- isReadOnly?: boolean;
91
- /** Tool can cause irreversible side-effects — force approval in default mode */
92
- isDangerous?: boolean;
93
- };
11
+ import type { ChatMessage as WireChatMessage, ChatMessageRole as WireChatMessageRole, ThinkingBlock as WireThinkingBlock, ToolCallMessage as WireToolCallMessage, ToolDefinition as WireToolDefinition, WireTokenUsage } from "../protocol/wire/index.js";
12
+ export type ChatMessageRole = WireChatMessageRole;
13
+ export type ThinkingBlock = WireThinkingBlock;
14
+ export type ToolCallMessage = WireToolCallMessage;
15
+ export type ChatMessage = WireChatMessage;
16
+ export interface ToolDefinition extends WireToolDefinition {
94
17
  /**
95
18
  * Backfill derived/legacy fields onto a shallow copy of the tool input
96
19
  * before hooks and observers see it (CC backfillObservableInput parity).
97
20
  * The original API-bound input is never modified.
21
+ * Internal-only 鈥?never serialized over JSON-RPC.
98
22
  */
99
23
  backfillObservableInput?: (input: Record<string, unknown>) => void;
100
24
  }
101
- export interface TokenUsage {
102
- prompt: number;
103
- completion: number;
104
- /** Reasoning tokens (for models like o1/DeepSeek-R1) */
105
- reasoning?: number;
106
- /** Prompt cache read tokens (CC cache_read_input_tokens parity) */
107
- cacheRead?: number;
108
- /** Prompt cache creation tokens (CC cache_creation_input_tokens parity) */
109
- cacheCreation?: number;
110
- }
111
25
  /**
112
- * Why the previous iteration continued each variant corresponds to one of
26
+ * Token usage 鈥?unified with WireTokenUsage from contracts.
27
+ * No more internal/wire split: all code uses the same field names
28
+ * (inputTokens, outputTokens, reasoningTokens, cacheRead, cacheWrite).
29
+ */
30
+ export type TokenUsage = WireTokenUsage;
31
+ /**
32
+ * Why the previous iteration continued 鈥?each variant corresponds to one of
113
33
  * the 7 `continue` sites in the main while(true) loop.
114
34
  * Tests can assert recovery paths fired without inspecting message contents.
115
35
  */
@@ -194,7 +114,7 @@ export interface TurnConfig {
194
114
  summaryModel?: string;
195
115
  /** Max concurrent tool executions (0 = unlimited). */
196
116
  maxConcurrentTools?: number;
197
- /** Model requires streaming disable non-streaming fallback. */
117
+ /** Model requires streaming 鈥?disable non-streaming fallback. */
198
118
  streamRequired?: boolean;
199
119
  /** Reasoning effort for models that support it (GPT-5.x, o-series). */
200
120
  reasoning?: {
@@ -221,7 +141,7 @@ export interface TurnConfig {
221
141
  /**
222
142
  * User-designated provider+model per media category.
223
143
  * Each entry maps a media type (image/video/music/tts/3d/...) to
224
- * the specific provider and model the user chose. No failover
144
+ * the specific provider and model the user chose. No failover 鈥?
225
145
  * if the designated provider fails, the error propagates directly.
226
146
  */
227
147
  mediaProviders?: Partial<Record<MediaCapability, {
@@ -371,8 +291,12 @@ export interface ToolInvoker {
371
291
  */
372
292
  export interface AgentLogger {
373
293
  info(message: string): void;
294
+ info(obj: Record<string, unknown>, message: string): void;
374
295
  warn(message: string): void;
296
+ warn(obj: Record<string, unknown>, message: string): void;
375
297
  error(message: string): void;
298
+ error(obj: Record<string, unknown>, message: string): void;
376
299
  debug(message: string): void;
300
+ debug(obj: Record<string, unknown>, message: string): void;
377
301
  }
378
302
  export type { HookRegistry };
@@ -92,6 +92,11 @@ export declare class StdioServer {
92
92
  * Always returns the InitializeResult shape.
93
93
  */
94
94
  private handleInitialize;
95
+ /**
96
+ * Ensure a default project exists on first start.
97
+ * Called from both legacy handleInitialize and ACP acpHandleInitialize.
98
+ */
99
+ private ensureDefaultProject;
95
100
  /**
96
101
  * `thread.create` — create a new thread (session container).
97
102
  * Maps threadId → sessionId for the underlying session system.
@@ -173,6 +178,16 @@ export declare class StdioServer {
173
178
  * `config.update` — Update agent runtime configuration (merges into settings.json).
174
179
  */
175
180
  private handleConfigUpdate;
181
+ /**
182
+ * `config.tunables` — Return all tunable default values with their current overrides.
183
+ */
184
+ private handleConfigTunables;
185
+ /**
186
+ * `config.updateTunable` — Write a single tunable override into settings.json.tunables.
187
+ * Params: { key: string, value: number | boolean | string }
188
+ * Only keys that exist in TunableDefaults are accepted (validation).
189
+ */
190
+ private handleConfigUpdateTunable;
176
191
  /**
177
192
  * `todos.list` — Query current todo items and summary.
178
193
  * Invokes the registered todo tool's list action.
@@ -296,13 +311,23 @@ export declare class StdioServer {
296
311
  private acpHandleSoloStart;
297
312
  private acpHandleSoloStatus;
298
313
  private acpHandleSoloSelect;
314
+ private acpHandleSoloCancel;
315
+ private acpHandleSoloSubscribe;
316
+ private acpHandleAgentsList;
299
317
  private acpHandleProductCreate;
300
318
  private acpHandleProductResume;
301
319
  private acpHandleProductStatus;
320
+ private acpHandleProductPause;
321
+ private acpHandleProductCancel;
322
+ private acpHandleProductRollback;
323
+ private acpHandleProductSubscribe;
302
324
  private acpHandleTeamDelegate;
303
325
  private handleProjectCreate;
304
326
  private handleProjectList;
305
327
  private handleProjectDelete;
328
+ private handleProjectRename;
329
+ private handleProjectArchive;
330
+ private handleProjectUnarchive;
306
331
  private handleProjectArchiveByGroup;
307
332
  private handleSessionSwitchProject;
308
333
  private handleSessionGetState;
@@ -312,8 +337,23 @@ export declare class StdioServer {
312
337
  private handleInstructionsWrite;
313
338
  private handleInstructionsDelete;
314
339
  private handleSkillsList;
340
+ /** Extract version and description from a SKILL.md frontmatter. */
341
+ private extractSkillMeta;
315
342
  private handleSkillsActivate;
316
343
  private handleSkillsDeactivate;
344
+ /**
345
+ * `skills.delete` — Permanently remove a skill from project or global scope.
346
+ * Params: { name: string, scope?: "project" | "global" }
347
+ * Default scope: "project"
348
+ */
349
+ private handleSkillsDelete;
350
+ /**
351
+ * `skills.promote` — Copy a project-level skill to global (user-level).
352
+ * Params: { name: string, keepLocal?: boolean }
353
+ * By default removes the project-level copy after promoting.
354
+ */
355
+ private handleSkillsPromote;
356
+ private handleSkillsStats;
317
357
  private getProjectPlanStore;
318
358
  private handlePlansList;
319
359
  private handlePlansGet;
@@ -14,6 +14,12 @@ 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
+ /** Set callback invoked after LLM-driven project switch. */
18
+ export declare function setProjectSwitchCallback(cb: ((project: {
19
+ id: string;
20
+ name: string;
21
+ workspaceDir: string;
22
+ }) => void) | undefined): void;
17
23
  /**
18
24
  * Set task tool lifecycle hooks. Called from stdio-server when session starts.
19
25
  * Connects planning-task events to the HookRegistry.
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Internal contracts — types internalized from qlogicagent-runtime-contracts.
2
+ * Internal contracts — hooks + todo types.
3
3
  *
4
- * These types are only consumed within qlogicagent itself (agent runtime + hub).
5
- * They were removed from the public npm package to slim the cross-repo API surface.
4
+ * These types are only consumed within qlogicagent itself.
6
5
  */
7
6
  export * from "./todo.js";
8
7
  export * from "./hooks.js";
@@ -107,6 +107,9 @@ export interface ProviderQuirks {
107
107
  filterImageBlocks?: boolean;
108
108
  /** DeepSeek: budget_tokens ignored, use output_config.effort instead */
109
109
  useEffortInsteadOfBudget?: boolean;
110
+ /** Provider natively supports PDF/document content blocks (Anthropic document, Gemini fileData).
111
+ * When false, PDFs are annotated as text labels and the agent must use tools to extract content. */
112
+ supportsDocumentVision?: boolean;
110
113
  /** Provider supports reasoning_effort param (Kimi K2, OpenAI o-series) */
111
114
  supportsReasoningEffort?: boolean;
112
115
  /** Provider has built-in web search (Kimi: builtin_function.$web_search, GLM: web_search) */
@@ -1,14 +1,14 @@
1
1
  /**
2
- * LLMTransport abstract interface for LLM inference calls.
2
+ * LLMTransport 鈥?abstract interface for LLM inference calls.
3
3
  *
4
4
  * Aligned with Hermes `ProviderTransport` ABC:
5
- * stream(request, apiKey, signal) AsyncGenerator<LLMChunk>
5
+ * stream(request, apiKey, signal) 鈫?AsyncGenerator<LLMChunk>
6
6
  *
7
7
  * Two concrete implementations:
8
8
  * - OpenAI Chat Completions (covers 95% of providers)
9
9
  * - Anthropic Messages API
10
10
  */
11
- import type { ChatMessage, ToolDefinition } from "../agent/types.js";
11
+ import type { ChatMessage, ToolDefinition } from "../protocol/wire/index.js";
12
12
  export type StructuredOutputConfig = {
13
13
  mode: "json_object";
14
14
  } | {
@@ -19,7 +19,7 @@ export type StructuredOutputConfig = {
19
19
  };
20
20
  export interface CachingConfig {
21
21
  type: "enabled" | "disabled";
22
- /** Enable prefix caching mode (§20.3). Requires store=true and stream=false. */
22
+ /** Enable prefix caching mode (20.3). Requires store=true and stream=false. */
23
23
  prefix?: boolean;
24
24
  }
25
25
  export type ContextEdit = {
@@ -58,10 +58,10 @@ export interface LLMRequest {
58
58
  maxTokens?: number;
59
59
  reasoning?: {
60
60
  effort: "minimal" | "low" | "medium" | "high" | "xhigh";
61
- /** Request encrypted original reasoning content (Volcengine §17.7). */
61
+ /** Request encrypted original reasoning content (Volcengine 17.7). */
62
62
  includeEncryptedReasoning?: boolean;
63
63
  };
64
- /** Volcengine: max builtin tool calls per turn (§19.15). */
64
+ /** Volcengine: max builtin tool calls per turn (19.15). */
65
65
  maxToolCalls?: number;
66
66
  /**
67
67
  * DeepSeek prefix completion: force model to continue from this prefix.
@@ -69,7 +69,7 @@ export interface LLMRequest {
69
69
  */
70
70
  prefixMessage?: string;
71
71
  /**
72
- * Model requires streaming disable non-streaming fallback in transports.
72
+ * Model requires streaming 鈥?disable non-streaming fallback in transports.
73
73
  * When true, transports must NOT fall back to non-streaming requests on failure.
74
74
  * Set for models like QwQ/Omni where the provider rejects non-streaming calls.
75
75
  */
@@ -89,49 +89,49 @@ export interface LLMRequest {
89
89
  config?: Record<string, unknown>;
90
90
  }>;
91
91
  /**
92
- * Server-side context continuation via response chain (§5).
92
+ * Server-side context continuation via response chain (5).
93
93
  * When set, the server automatically includes previous context,
94
94
  * so messages[] only needs to contain the NEW user message.
95
95
  */
96
96
  previousResponseId?: string;
97
97
  /**
98
- * Control server-side storage of this request's input/output (§5.1).
98
+ * Control server-side storage of this request's input/output (5.1).
99
99
  * Default: true (server stores for 3 days).
100
100
  */
101
101
  store?: boolean;
102
102
  /** Expiration time for stored response (Unix seconds, max 7 days from now) */
103
103
  storeExpireAt?: number;
104
104
  /**
105
- * Per-turn system instruction augmentation (§8).
105
+ * Per-turn system instruction augmentation (8).
106
106
  * Temporarily overlays persona or adds constraints for this turn only.
107
- * NOTE: Incompatible with caching do not use both together.
107
+ * NOTE: Incompatible with caching 鈥?do not use both together.
108
108
  */
109
109
  instructions?: string;
110
110
  /**
111
- * Structured output format (§16).
111
+ * Structured output format (16).
112
112
  * Forces model to produce JSON conforming to the specified schema.
113
113
  */
114
114
  structuredOutput?: StructuredOutputConfig;
115
115
  /**
116
- * Caching configuration (§20).
116
+ * Caching configuration (20).
117
117
  * Controls prefix/session caching behavior.
118
118
  * NOTE: Incompatible with instructions, json_schema, and builtin tools.
119
119
  */
120
120
  caching?: CachingConfig;
121
121
  /**
122
- * Context management edits (§21, beta).
122
+ * Context management edits (21, beta).
123
123
  * Server-side trimming of historical thinking chains and tool call traces.
124
124
  */
125
125
  contextManagement?: ContextManagementConfig;
126
126
  /**
127
- * Gemini explicit cache reference (gemini-ProviderMax §8).
127
+ * Gemini explicit cache reference (gemini-ProviderMax 8).
128
128
  * Passes a pre-created cache name (e.g. "cachedContents/abc123") to
129
129
  * generateContent so the server uses cached tokens instead of re-processing.
130
130
  * Create caches via GeminiCacheAPI.createCache() first.
131
131
  */
132
132
  cachedContent?: string;
133
133
  /**
134
- * Predicted output for speculative decoding (openai-ProviderMax §11).
134
+ * Predicted output for speculative decoding (openai-ProviderMax 11).
135
135
  * When editing code, pass the existing content so the model can diff efficiently.
136
136
  * Reduces latency by 3-5x when prediction matches. Falls back when it doesn't.
137
137
  * Works with OpenAI GPT-5.x models via Responses API and Chat Completions.
@@ -141,24 +141,24 @@ export interface LLMRequest {
141
141
  content: string;
142
142
  };
143
143
  /**
144
- * Prompt cache bucketing key (openai-ProviderMax §11).
144
+ * Prompt cache bucketing key (openai-ProviderMax 11).
145
145
  * Replaces the deprecated `user` field. Helps OpenAI group similar requests
146
146
  * for higher cache hit rates.
147
147
  */
148
148
  promptCacheKey?: string;
149
149
  /**
150
- * Prompt cache retention policy (openai-ProviderMax §11).
150
+ * Prompt cache retention policy (openai-ProviderMax 11).
151
151
  * "in_memory" = default 5-10 min, "24h" = extended up to 24 hours.
152
152
  */
153
153
  promptCacheRetention?: "in_memory" | "24h";
154
154
  /**
155
- * Service tier for request scheduling (openai-ProviderMax §14).
155
+ * Service tier for request scheduling (openai-ProviderMax 14).
156
156
  * "auto" = project default, "flex" = 50% cheaper / higher latency,
157
157
  * "priority" = guaranteed low latency.
158
158
  */
159
159
  serviceTier?: "auto" | "default" | "flex" | "priority";
160
160
  /**
161
- * OpenAI Responses API built-in tools (openai-ProviderMax §7).
161
+ * OpenAI Responses API built-in tools (openai-ProviderMax 7).
162
162
  * Platform-executed tools like web_search, file_search, code_interpreter, etc.
163
163
  */
164
164
  openaiBuiltinTools?: Array<{
@@ -166,8 +166,8 @@ export interface LLMRequest {
166
166
  [key: string]: unknown;
167
167
  }>;
168
168
  /**
169
- * OpenAI Responses API conversation ID (openai-ProviderMax §2.1).
170
- * Alternative to previous_response_id persistent server-side conversation.
169
+ * OpenAI Responses API conversation ID (openai-ProviderMax 2.1).
170
+ * Alternative to previous_response_id 鈥?persistent server-side conversation.
171
171
  * Cannot be used together with previousResponseId.
172
172
  */
173
173
  conversationId?: string;
@@ -177,13 +177,13 @@ export interface LLMRequest {
177
177
  */
178
178
  parallelToolCalls?: boolean;
179
179
  /**
180
- * Text output verbosity hint (openai-ProviderMax §5).
180
+ * Text output verbosity hint (openai-ProviderMax 5).
181
181
  * Controls how detailed the model's textual output should be.
182
182
  */
183
183
  textVerbosity?: "low" | "medium" | "high";
184
184
  }
185
185
  /**
186
- * FIM completion request DeepSeek Beta Completions API.
186
+ * FIM completion request 鈥?DeepSeek Beta Completions API.
187
187
  * POST /beta/v1/completions with prompt + suffix.
188
188
  * Only works with non-thinking mode.
189
189
  */
@@ -267,7 +267,7 @@ export interface LLMTransport {
267
267
  */
268
268
  stream(request: LLMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<LLMChunk>;
269
269
  /**
270
- * FIM (Fill-In-Middle) completion optional capability.
270
+ * FIM (Fill-In-Middle) completion 鈥?optional capability.
271
271
  * Only implemented by providers that support it (DeepSeek /beta endpoint).
272
272
  */
273
273
  complete?(request: FIMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<FIMChunk>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Anthropic Messages Transport SSE streaming for Claude API.
2
+ * Anthropic Messages Transport 鈥?SSE streaming for Claude API.
3
3
  *
4
4
  * Aligned with CC (claude-code-haha) src/services/api/claude.ts:
5
5
  * - cache_control ephemeral injection on system prompt blocks
@@ -26,7 +26,7 @@ export interface AnthropicTransportConfig {
26
26
  enablePromptCaching?: boolean;
27
27
  /** Max retry attempts on transient errors (default 3) */
28
28
  maxRetries?: number;
29
- /** Omit temperature when it equals 0 MiniMax rejects temperature=0 */
29
+ /** Omit temperature when it equals 0 鈥?MiniMax rejects temperature=0 */
30
30
  omitZeroTemperature?: boolean;
31
31
  /** Provider-specific quirks for conditional logic (CC/altcode parity) */
32
32
  quirks?: ProviderQuirks;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Gemini generateContent Transport Native Gemini API streaming implementation.
2
+ * Gemini generateContent Transport 鈥?Native Gemini API streaming implementation.
3
3
  *
4
4
  * Targets Gemini 3 series exclusively (3.1 Pro, 3 Flash, 3.1 Flash-Lite).
5
5
  * Uses the native Gemini REST API instead of the OpenAI compatibility layer,
6
6
  * unlocking Gemini-exclusive features unavailable via the compat endpoint:
7
- * - thinkingConfig (thinkingLevel G3 native control)
7
+ * - thinkingConfig (thinkingLevel 鈥?G3 native control)
8
8
  * - Google Search / Maps Grounding
9
9
  * - Code Execution
10
10
  * - Safety Settings fine-grained control
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OpenAI Chat Completions Transport SSE streaming implementation.
2
+ * OpenAI Chat Completions Transport 鈥?SSE streaming implementation.
3
3
  *
4
4
  * Covers all OpenAI-compatible providers:
5
5
  * DeepSeek, Qwen, Minimax, Moonshot, OpenRouter, etc.
@@ -70,7 +70,7 @@ export declare class OpenAIChatTransport implements LLMTransport {
70
70
  bytes: number;
71
71
  }>;
72
72
  /**
73
- * Get file content/status GET /v1/files/{file_id}
73
+ * Get file content/status 鈥?GET /v1/files/{file_id}
74
74
  */
75
75
  getFileInfo(fileId: string, apiKey: string, signal?: AbortSignal): Promise<{
76
76
  id: string;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OpenAI Responses API Transport SSE streaming implementation.
2
+ * OpenAI Responses API Transport 鈥?SSE streaming implementation.
3
3
  *
4
4
  * Implements the OpenAI Responses API (`POST /v1/responses`),
5
5
  * the officially recommended path for GPT-5.x text generation.
@@ -49,14 +49,14 @@ export declare class OpenAIResponsesTransport implements LLMTransport {
49
49
  *
50
50
  * Event format: "event: <type>\ndata: <json>\n\n"
51
51
  * Key events:
52
- * - response.output_text.delta text content delta
53
- * - response.reasoning_summary_text.delta reasoning summary text
54
- * - response.function_call_arguments.delta tool call arguments streaming
55
- * - response.output_item.added new output item started
56
- * - response.output_item.done output item completed
57
- * - response.content_part.done content part completed (annotations)
58
- * - response.completed full response complete with usage
59
- * - response.failed error
52
+ * - response.output_text.delta 鈫?text content delta
53
+ * - response.reasoning_summary_text.delta 鈫?reasoning summary text
54
+ * - response.function_call_arguments.delta 鈫?tool call arguments streaming
55
+ * - response.output_item.added 鈫?new output item started
56
+ * - response.output_item.done 鈫?output item completed
57
+ * - response.content_part.done 鈫?content part completed (annotations)
58
+ * - response.completed 鈫?full response complete with usage
59
+ * - response.failed 鈫?error
60
60
  */
61
61
  private parseSSEStream;
62
62
  private processEvent;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Volcengine Responses API Transport SSE streaming implementation.
2
+ * Volcengine Responses API Transport 鈥?SSE streaming implementation.
3
3
  *
4
4
  * Implements the fire mountain ark Responses API (`/api/v3/responses`),
5
5
  * which is the officially recommended primary path for Doubao LLM text generation
@@ -37,9 +37,9 @@ export declare class VolcengineResponsesTransport implements LLMTransport {
37
37
  stream(request: LLMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<LLMChunk>;
38
38
  /**
39
39
  * Resolve known Volcengine Responses API incompatibilities:
40
- * - instructions + caching drop caching (§20.7)
41
- * - caching + json_schema downgrade to json_object (§20.10)
42
- * - caching + builtin_web_search/image_process drop those builtin tools
40
+ * - instructions + caching 鈫?drop caching (20.7)
41
+ * - caching + json_schema 鈫?downgrade to json_object (20.10)
42
+ * - caching + builtin_web_search/image_process 鈫?drop those builtin tools
43
43
  * Returns a shallow copy with fields adjusted; never mutates the original.
44
44
  */
45
45
  private resolveConstraints;
@@ -51,13 +51,13 @@ export declare class VolcengineResponsesTransport implements LLMTransport {
51
51
  *
52
52
  * Event format: "event: <type>\ndata: <json>\n\n"
53
53
  * Key events:
54
- * - response.output_text.delta text content delta
55
- * - response.reasoning_summary_text.delta thinking/reasoning text
56
- * - response.function_call_arguments.delta tool call arguments streaming
57
- * - response.output_item.added new output item started
58
- * - response.output_item.done output item completed
59
- * - response.completed full response complete with usage
60
- * - response.failed error
54
+ * - response.output_text.delta 鈫?text content delta
55
+ * - response.reasoning_summary_text.delta 鈫?thinking/reasoning text
56
+ * - response.function_call_arguments.delta 鈫?tool call arguments streaming
57
+ * - response.output_item.added 鈫?new output item started
58
+ * - response.output_item.done 鈫?output item completed
59
+ * - response.completed 鈫?full response complete with usage
60
+ * - response.failed 鈫?error
61
61
  */
62
62
  private parseSSEStream;
63
63
  private processEvent;
@@ -26,6 +26,19 @@ export interface ProductCallbacks {
26
26
  onCheckpointed?: (productId: string, timestamp: string) => void;
27
27
  onBudgetWarning?: (productId: string, usedTokens: number, maxTotalTokens: number, percentage: number) => void;
28
28
  onCompleted?: (productId: string, summary: string) => void;
29
+ /** DAG topology resolved and sent to client for visualization. */
30
+ onDagTopology?: (productId: string, nodes: {
31
+ id: string;
32
+ label: string;
33
+ deps: string[];
34
+ }[], edges: {
35
+ from: string;
36
+ to: string;
37
+ }[]) => void;
38
+ /** Real-time budget consumption update. */
39
+ onBudgetUpdate?: (productId: string, inputTokens: number, outputTokens: number, elapsed: number, maxTotalTokens?: number) => void;
40
+ /** Streaming text output from a running task. */
41
+ onTaskOutputDelta?: (productId: string, taskId: string, text: string) => void;
29
42
  }
30
43
  export declare class ProductOrchestrator {
31
44
  private processManager;
@@ -46,6 +59,8 @@ export declare class ProductOrchestrator {
46
59
  checkpoint(productId: string): Promise<void>;
47
60
  /** Delete a product session, pausing first if active. */
48
61
  delete(productId: string): Promise<void>;
62
+ /** Rollback a product to a checkpoint: delete running session then resume from disk. */
63
+ rollback(productId: string, _checkpoint: string): Promise<void>;
49
64
  /** Get product status. */
50
65
  getStatus(productId: string): ProductStatus | null;
51
66
  /** List all products (in-memory + on-disk). */