qlogicagent 2.15.9 → 2.15.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -263,10 +263,69 @@ export interface TurnHeartbeatNotification {
263
263
  turnId: string;
264
264
  message: string;
265
265
  }
266
- /** Human-readable summary of a tool use batch. */
266
+ /** Structured telemetry for a tool use batch. */
267
267
  export interface TurnToolUseSummaryNotification {
268
268
  turnId: string;
269
+ availableToolNames: string[];
270
+ enabledToolNames: string[];
271
+ toolCallNames: string[];
272
+ blockedToolCalls: Array<{
273
+ name: string;
274
+ reason: string;
275
+ }>;
276
+ }
277
+ /** Queryable long-horizon turn lifecycle telemetry. */
278
+ export interface TurnLifecycleNotification {
279
+ turnId: string;
280
+ kind: "stage" | "reopen" | "resume" | "context_compression" | "goal_reconstruction" | "memory_drift" | "artifact_path_drift";
281
+ stage?: string;
282
+ status?: string;
283
+ detail?: string;
284
+ reconstruction?: GoalReconstructionState;
285
+ observedAt?: string;
286
+ }
287
+ export interface GoalReconstructionState {
288
+ goal: string;
289
+ artifactRoot: string;
290
+ decisions: string[];
291
+ defects: string[];
292
+ acceptanceCriteria: string[];
293
+ blockers: string[];
294
+ nextAction: string;
295
+ }
296
+ export interface MaintainedDocumentIndex {
297
+ name?: string;
298
+ path?: string;
299
+ indexed: true;
300
+ maintained: true;
301
+ indexVersion: string;
302
+ contentHash: string;
269
303
  summary: string;
304
+ lastReviewedTurn: number;
305
+ }
306
+ export interface DecisionStateRecord {
307
+ id: string;
308
+ decision: string;
309
+ status: string;
310
+ evidence: string;
311
+ lastConfirmedTurn: number;
312
+ }
313
+ export interface ReadCycleGuard {
314
+ strategy: string;
315
+ nextReadPolicy: string;
316
+ budgetStatus: "within-budget";
317
+ maxReadsPerDocument: number;
318
+ observedReadsByPath: Record<string, number>;
319
+ }
320
+ /** Queryable large-document maintenance and read-cycle audit telemetry. */
321
+ export interface TurnDocumentMaintenanceNotification {
322
+ turnId: string;
323
+ checkpointId: string;
324
+ documents: MaintainedDocumentIndex[];
325
+ decisionStateTable: DecisionStateRecord[];
326
+ readCycleFindings: Array<Record<string, unknown>>;
327
+ readCycleGuard: ReadCycleGuard;
328
+ observedAt?: string;
270
329
  }
271
330
  /** Structured artifact produced by the agent. */
272
331
  export interface TurnArtifactNotification {
@@ -279,6 +338,21 @@ export interface TurnArtifactNotification {
279
338
  content?: string;
280
339
  mimeType?: string;
281
340
  }
341
+ /** Single-track artifact delivery and browser-acceptance contract. */
342
+ export interface TurnArtifactContractNotification {
343
+ turnId: string;
344
+ artifactRoot?: string;
345
+ writePaths: string[];
346
+ outOfRootWrites: Array<{
347
+ path: string;
348
+ artifactRoot: string;
349
+ toolName: string;
350
+ }>;
351
+ devServerUrls: string[];
352
+ browserVerified: boolean;
353
+ browserEvidence: string[];
354
+ requiresBrowserAcceptance: boolean;
355
+ }
282
356
  /** Agent requests user approval before executing a restricted tool. */
283
357
  export interface ToolApprovalRequestNotification {
284
358
  approvalId: string;
@@ -502,6 +576,9 @@ export interface SoloProgressNotification {
502
576
  agentId: string;
503
577
  state: "pending" | "running" | "completed" | "failed" | "idle";
504
578
  progress?: string;
579
+ /** Absolute path of the competitor's isolated git worktree, sent with the first "running" event so
580
+ * the UI can resolve the agent's产物 (which live in the worktree) for click-to-preview. */
581
+ worktreePath?: string;
505
582
  }
506
583
  /** Solo evaluation completed. */
507
584
  export interface SoloEvaluationNotification {
@@ -515,15 +592,6 @@ export interface SoloAgentDeltaNotification {
515
592
  agentId: string;
516
593
  text: string;
517
594
  }
518
- /** Solo agent diff. */
519
- export interface SoloAgentDiffNotification {
520
- soloId: string;
521
- agentId: string;
522
- files: {
523
- path: string;
524
- hunks: string;
525
- }[];
526
- }
527
595
  /** Solo agent usage. */
528
596
  export interface SoloAgentUsageNotification {
529
597
  soloId: string;
@@ -854,7 +922,10 @@ export interface NotificationMethodMap {
854
922
  "turn.exec_progress": TurnExecProgressNotification;
855
923
  "turn.heartbeat": TurnHeartbeatNotification;
856
924
  "turn.tool_use_summary": TurnToolUseSummaryNotification;
925
+ "turn.lifecycle": TurnLifecycleNotification;
926
+ "turn.document_maintenance": TurnDocumentMaintenanceNotification;
857
927
  "turn.artifact": TurnArtifactNotification;
928
+ "turn.artifact_contract": TurnArtifactContractNotification;
858
929
  "tool.approval.request": ToolApprovalRequestNotification;
859
930
  "turn.skill_instruction": TurnSkillInstructionNotification;
860
931
  "turn.skill_acquisition_needed": TurnSkillAcquisitionNeededNotification;
@@ -879,7 +950,6 @@ export interface NotificationMethodMap {
879
950
  "solo.progress": SoloProgressNotification;
880
951
  "solo.evaluation": SoloEvaluationNotification;
881
952
  "solo.agentDelta": SoloAgentDeltaNotification;
882
- "solo.agentDiff": SoloAgentDiffNotification;
883
953
  "solo.agentUsage": SoloAgentUsageNotification;
884
954
  "product.taskStarted": ProductTaskStartedNotification;
885
955
  "product.taskCompleted": ProductTaskCompletedNotification;
@@ -22,7 +22,7 @@ export declare function resolveInstalledNpmPackageVersionFromInstall(install: Ac
22
22
  export declare function getCatalogInstalledVersion(entry: AcpBackendConfig, detectedVersion?: string): string | undefined;
23
23
  /** Resolve a package's latest published version via `npm view` (async + cached). Used by the background
24
24
  * update check so N agents resolve concurrently (one `npm view` each) instead of blocking sequentially. */
25
- export declare function fetchNpmLatestPackageVersionAsync(packageName: string | null | undefined): Promise<string | null>;
25
+ export declare function fetchNpmLatestPackageVersionAsync(packageName: string | null | undefined, registry?: string): Promise<string | null>;
26
26
  export interface CatalogUpdateInfo {
27
27
  id: string;
28
28
  packageName?: string;
@@ -39,7 +39,22 @@ export declare function getCatalogUpdateInfoAsync(entries: ReadonlyArray<{
39
39
  id: string;
40
40
  entry: AcpBackendConfig;
41
41
  detectedVersion?: string;
42
- }>): Promise<CatalogUpdateInfo[]>;
42
+ }>, registry?: string): Promise<CatalogUpdateInfo[]>;
43
+ /**
44
+ * Synchronous, NETWORK-FREE update info read straight from the persisted cache (disk-seeded on first
45
+ * use). Returns immediately so the panel lights up last-known badges INSTANTLY — VS Code's gallery
46
+ * pattern — without waiting on `npm view`. `stale` is true when any installed package's cached "latest"
47
+ * is missing, errored, or older than the TTL; the caller then refreshes via getCatalogUpdateInfoAsync
48
+ * in the background, and the next call serves the fresh value.
49
+ */
50
+ export declare function getCatalogUpdateInfoCached(entries: ReadonlyArray<{
51
+ id: string;
52
+ entry: AcpBackendConfig;
53
+ detectedVersion?: string;
54
+ }>, registry?: string): {
55
+ updates: CatalogUpdateInfo[];
56
+ stale: boolean;
57
+ };
43
58
  export declare function normalizeWindowsAcpCommand(cliPath: string, args: string[]): {
44
59
  cliPath: string;
45
60
  acpArgs: string[];
@@ -167,5 +182,22 @@ export declare class AcpDetector {
167
182
  * would fail its turn ("No LLM provider"/auth). Does NOT verify the key is *valid* — that's only
168
183
  * known at runtime.
169
184
  */
185
+ /**
186
+ * Tri-state native-login state for the credential UI's account label — distinct from isAgentReady.
187
+ * `true` = a native login/subscription was actually detected (e.g. codex ~/.codex/auth.json); `false`
188
+ * = probeable but not logged in; `undefined` = no probe for this agent (e.g. hermes' own `acp --setup`
189
+ * store, which we can't read). isAgentReady treats undefined as ready-if-installed so the CLI gets a
190
+ * chance to run, but the UI must NOT claim "已登录" on undefined — it just doesn't know.
191
+ */
192
+ getNativeLoginState(agentId: string): boolean | undefined;
170
193
  isAgentReady(agentId: string): boolean;
194
+ /**
195
+ * Fast-fail guard for the turn path: returns a user-facing error when an agent is in a key-required
196
+ * credential mode (managed / userKey / auto-resolving-to-key) but NO usable key got injected — so the
197
+ * caller can reject the turn cleanly instead of spawning a CLI that would silently stall on auth (the
198
+ * host then goes quiet → the gateway's hang-watchdog kills it → the user sees a cryptic "Agent process
199
+ * stdio closed"). Returns null when credentialed, or when the mode owns its own native login
200
+ * (account / oauth / keyless), or when we can't be sure a key is needed.
201
+ */
202
+ resolveCredentialError(agentId: string): string | null;
171
203
  }
@@ -55,3 +55,26 @@ export declare function runAgentInstall(install: AgentInstallSpec, onEvent: (e:
55
55
  ok: boolean;
56
56
  error?: string;
57
57
  }>;
58
+ /**
59
+ * Open an OS terminal window running an agent's interactive login/setup command (e.g. `kimi login`,
60
+ * `hermes acp --setup`). The local desktop host can spawn a real terminal so the user completes the
61
+ * CLI's own login flow without leaving the app. Detached + unref so it outlives the engine. The command
62
+ * is a fixed catalog string (no user input) → no injection surface.
63
+ */
64
+ export declare function launchSetupTerminal(command: string, platform?: NodeJS.Platform): {
65
+ ok: boolean;
66
+ error?: string;
67
+ };
68
+ /**
69
+ * Fire-and-forget install in a FULLY DETACHED process (own session/process-group, no stdio shared with
70
+ * us). Used for self/host-platform agents (openclaw) whose in-place UPDATE would otherwise disrupt the
71
+ * running engine the install is a child of — "Agent process stdio closed". Returns immediately; the new
72
+ * version is live on the agent's next startup. No progress streaming (the process is detached).
73
+ */
74
+ export declare function runAgentInstallDetached(install: AgentInstallSpec, opts?: {
75
+ platform?: NodeJS.Platform;
76
+ mirror?: string;
77
+ }): {
78
+ ok: boolean;
79
+ error?: string;
80
+ };
@@ -285,6 +285,16 @@ export declare class AgentProcessManager {
285
285
  isAlive(memberId: string): boolean;
286
286
  /** Get usage tracker for an ACP agent (returns null for internal agents). */
287
287
  getUsageTracker(memberId: string): AcpUsageTracker | null;
288
+ /**
289
+ * Feed token usage into the tracker from a child notification (Tier 1). Handles all three shapes a
290
+ * child may use so the tracker is actually populated:
291
+ * - a top-level `usage_update` method (legacy/non-standard),
292
+ * - standard ACP `session/update` with `sessionUpdate:"usage_update"` (fields on the update),
293
+ * - the self-hosted qlogicagent's relay: `session/update` → `sessionUpdate:"x_relay"` carrying
294
+ * `method:"turn.usage_update"` with `params.usage` (a TokenUsage object).
295
+ * Without the x_relay branch the self-agent's usage was never captured → Solo columns showed ↓0 ↑0.
296
+ */
297
+ private feedUsageFromNotification;
288
298
  /**
289
299
  * Create a named-pipe IPC server for MCP bridge tool-call proxying.
290
300
  * External agents' MCP bridge servers connect here to proxy tool calls
@@ -72,7 +72,31 @@ export type TurnEvent = {
72
72
  } | {
73
73
  type: "tool_use_summary";
74
74
  turnId: string;
75
- summary: string;
75
+ availableToolNames: string[];
76
+ enabledToolNames: string[];
77
+ toolCallNames: string[];
78
+ blockedToolCalls: Array<{
79
+ name: string;
80
+ reason: string;
81
+ }>;
82
+ } | {
83
+ type: "lifecycle";
84
+ turnId: string;
85
+ kind: "stage" | "reopen" | "resume" | "context_compression" | "goal_reconstruction" | "memory_drift" | "artifact_path_drift";
86
+ stage?: string;
87
+ status?: string;
88
+ detail?: string;
89
+ reconstruction?: GoalReconstructionState;
90
+ observedAt?: string;
91
+ } | {
92
+ type: "document_maintenance";
93
+ turnId: string;
94
+ checkpointId: string;
95
+ documents: MaintainedDocumentIndex[];
96
+ decisionStateTable: DecisionStateRecord[];
97
+ readCycleFindings: Array<Record<string, unknown>>;
98
+ readCycleGuard: ReadCycleGuard;
99
+ observedAt?: string;
76
100
  } | {
77
101
  type: "reasoning_delta";
78
102
  turnId: string;
@@ -109,6 +133,20 @@ export type TurnEvent = {
109
133
  language?: string;
110
134
  content?: string;
111
135
  mimeType?: string;
136
+ } | {
137
+ type: "artifact_contract";
138
+ turnId: string;
139
+ artifactRoot?: string;
140
+ writePaths: string[];
141
+ outOfRootWrites: Array<{
142
+ path: string;
143
+ artifactRoot: string;
144
+ toolName: string;
145
+ }>;
146
+ devServerUrls: string[];
147
+ browserVerified: boolean;
148
+ browserEvidence: string[];
149
+ requiresBrowserAcceptance: boolean;
112
150
  } | {
113
151
  type: "annotations";
114
152
  turnId: string;
@@ -133,6 +171,39 @@ export type TurnEvent = {
133
171
  outputPreview?: string;
134
172
  error?: string;
135
173
  };
174
+ export interface GoalReconstructionState {
175
+ goal: string;
176
+ artifactRoot: string;
177
+ decisions: string[];
178
+ defects: string[];
179
+ acceptanceCriteria: string[];
180
+ blockers: string[];
181
+ nextAction: string;
182
+ }
183
+ export interface MaintainedDocumentIndex {
184
+ name?: string;
185
+ path?: string;
186
+ indexed: true;
187
+ maintained: true;
188
+ indexVersion: string;
189
+ contentHash: string;
190
+ summary: string;
191
+ lastReviewedTurn: number;
192
+ }
193
+ export interface DecisionStateRecord {
194
+ id: string;
195
+ decision: string;
196
+ status: string;
197
+ evidence: string;
198
+ lastConfirmedTurn: number;
199
+ }
200
+ export interface ReadCycleGuard {
201
+ strategy: string;
202
+ nextReadPolicy: string;
203
+ budgetStatus: "within-budget";
204
+ maxReadsPerDocument: number;
205
+ observedReadsByPath: Record<string, number>;
206
+ }
136
207
  export interface ToolInvoker {
137
208
  invoke(turnId: string, name: string, args: string, signal?: AbortSignal): Promise<{
138
209
  result: string;
@@ -146,6 +217,8 @@ export interface AgentRunRequest {
146
217
  turnId: string;
147
218
  sessionId: string;
148
219
  messages: ChatMessage[];
220
+ /** Full registered tool surface before per-turn policy filtering. */
221
+ availableTools?: ToolDefinition[];
149
222
  tools: ToolDefinition[];
150
223
  systemPrompt?: string;
151
224
  config?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.15.9",
3
+ "version": "2.15.10",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",