qlogicagent 2.15.9 → 2.16.1
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.
- package/dist/agent.js +34 -16
- package/dist/cli.js +585 -514
- package/dist/index.js +584 -513
- package/dist/orchestration.js +9 -9
- package/dist/protocol.js +1 -1
- package/dist/types/agent/tool-loop/artifact-final-contract.d.ts +86 -0
- package/dist/types/agent/tool-loop/completion-action-policy.d.ts +1 -9
- package/dist/types/agent/tool-loop/tool-failure-policy.d.ts +2 -0
- package/dist/types/agent/tool-loop.d.ts +4 -10
- package/dist/types/agent/types.d.ts +9 -131
- package/dist/types/cli/acp-extended-handlers.d.ts +1 -0
- package/dist/types/cli/agent-config-coordinator.d.ts +11 -0
- package/dist/types/cli/core-tools/agent-tool-service.d.ts +1 -0
- package/dist/types/cli/handlers/agents-handler.d.ts +15 -6
- package/dist/types/cli/handlers/product-handler.d.ts +21 -2
- package/dist/types/cli/handlers/project-handler.d.ts +8 -0
- package/dist/types/cli/handlers/workflow-handler.d.ts +5 -0
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +5 -0
- package/dist/types/cli/turn-core.d.ts +4 -0
- package/dist/types/contracts/index.d.ts +1 -0
- package/dist/types/contracts/turn-event.d.ts +235 -0
- package/dist/types/orchestration/agent-instance.d.ts +45 -2
- package/dist/types/orchestration/agent-roster.d.ts +17 -0
- package/dist/types/orchestration/dag-scheduler.d.ts +27 -0
- package/dist/types/orchestration/product-budget.d.ts +7 -1
- package/dist/types/orchestration/product-persistence.d.ts +31 -0
- package/dist/types/orchestration/product-planner.d.ts +123 -0
- package/dist/types/orchestration/product-run-coordinator.d.ts +17 -1
- package/dist/types/orchestration/product-worktree.d.ts +3 -0
- package/dist/types/orchestration/skill-improvement.d.ts +2 -19
- package/dist/types/orchestration/solo-evaluator.d.ts +11 -6
- package/dist/types/orchestration/solo-spec-builder.d.ts +4 -0
- package/dist/types/orchestration/workflow/n8n-import.d.ts +26 -32
- package/dist/types/orchestration/workflow/n8n-template-compat.d.ts +5 -0
- package/dist/types/orchestration/workflow/node-registry.d.ts +13 -0
- package/dist/types/orchestration/workflow/node-schema.d.ts +10 -0
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +7 -1
- package/dist/types/protocol/methods.d.ts +8 -1
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +51 -0
- package/dist/types/protocol/wire/acp-protocol.d.ts +1 -0
- package/dist/types/protocol/wire/agent-events.d.ts +3 -3
- package/dist/types/protocol/wire/agent-methods.d.ts +14 -2
- package/dist/types/protocol/wire/index.d.ts +1 -1
- package/dist/types/protocol/wire/notification-payloads.d.ts +120 -11
- package/dist/types/runtime/infra/acp-detector.d.ts +37 -2
- package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +9 -0
- package/dist/types/runtime/infra/agent-install-runner.d.ts +23 -0
- package/dist/types/runtime/infra/agent-process.d.ts +10 -0
- package/dist/types/runtime/ports/agent-execution-contracts.d.ts +4 -128
- package/dist/types/runtime/ports/tool-contracts.d.ts +6 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +20 -1
- package/dist/types/skills/tools/ask-user-tool.d.ts +4 -2
- package/dist/types/skills/tools/shell/command-classification.d.ts +1 -0
- package/dist/types/skills/tools/tool-search-tool.d.ts +13 -0
- package/dist/types/skills/tools/tool-selection-eval.d.ts +49 -0
- package/dist/types/skills/tools/tool-selection-eval.dataset.d.ts +5 -0
- package/dist/types/skills/tools/write-tool.d.ts +2 -0
- package/dist/types/skills/tools.d.ts +21 -0
- package/dist/types/transport/acp-server.d.ts +1 -0
- package/package.json +2 -1
|
@@ -44,6 +44,8 @@ export interface AcpBackendConfig {
|
|
|
44
44
|
install?: AgentInstallSpec;
|
|
45
45
|
/** Short UI note (e.g. "需 GitHub 账号", "非 ACP,自定义适配器驱动"). */
|
|
46
46
|
note?: string;
|
|
47
|
+
/** Coarse soft capability hint for the leader's planning roster (NOT a capability contract). */
|
|
48
|
+
strengths?: string;
|
|
47
49
|
}
|
|
48
50
|
/** Official install commands for the one-click installer (no self-hosted CDN — runs upstream). */
|
|
49
51
|
export interface AgentInstallSpec {
|
|
@@ -57,6 +59,19 @@ export interface AgentInstallSpec {
|
|
|
57
59
|
verifyCmd?: string;
|
|
58
60
|
/** Official docs / source URL (shown in the install confirmation). */
|
|
59
61
|
docsUrl: string;
|
|
62
|
+
/**
|
|
63
|
+
* Self/host-platform agents (e.g. openclaw) whose in-place UPDATE would disrupt the running session
|
|
64
|
+
* (the engine bridges to a live instance). When already installed, the update runs DETACHED in the
|
|
65
|
+
* background instead of as a child of the engine, and takes effect on the agent's next startup.
|
|
66
|
+
*/
|
|
67
|
+
deferUpdate?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Interactive terminal login/setup command for agents that hold credentials in their OWN CLI store
|
|
70
|
+
* (oauth / own-setup, e.g. `kimi login`, `hermes acp --setup`). The UI exposes a "在终端登录/设置"
|
|
71
|
+
* button that opens an OS terminal running this, so the user never leaves the app. Resolved
|
|
72
|
+
* server-side (fixed catalog string, no user input) — never managed/key-routable agents.
|
|
73
|
+
*/
|
|
74
|
+
setupCommand?: string;
|
|
60
75
|
}
|
|
61
76
|
/**
|
|
62
77
|
* Extended descriptor for external agents,
|
|
@@ -299,6 +314,8 @@ export interface ProductBudget {
|
|
|
299
314
|
maxTotalTokens?: number;
|
|
300
315
|
maxDuration?: number;
|
|
301
316
|
usedTokens: number;
|
|
317
|
+
inputTokens?: number;
|
|
318
|
+
outputTokens?: number;
|
|
302
319
|
elapsed: number;
|
|
303
320
|
}
|
|
304
321
|
/** product.create RPC params. */
|
|
@@ -334,6 +351,19 @@ export interface ProductPlanParams {
|
|
|
334
351
|
maxTotalTokens?: number;
|
|
335
352
|
maxDuration?: number;
|
|
336
353
|
};
|
|
354
|
+
/**
|
|
355
|
+
* Optional user-supplied allow-list of agent ids the leader 小智 (qlogicagent) may assign tasks to —
|
|
356
|
+
* during planning AND during execution-phase reassignment. The user picks WHICH agents participate;
|
|
357
|
+
* the leader still auto-plans + assigns, but only within this set.
|
|
358
|
+
*
|
|
359
|
+
* Semantics are PRESENCE-based (see buildAgentRoster) — an explicit `[]` differs from omitted:
|
|
360
|
+
* - omitted / undefined → ALL ready agents (backward compatible — WS probes, other callers, old sessions).
|
|
361
|
+
* - `[]` (explicit empty array) → ONLY the leader `qlogicagent` (小智): the user deselected every worker.
|
|
362
|
+
* - non-empty → the assignable roster = ready catalog entries whose id ∈ allowedAgents, PLUS the
|
|
363
|
+
* leader `qlogicagent` (小智) ALWAYS included (universal coordinator / fallback executor, so there
|
|
364
|
+
* is always ≥1 valid assignee even if the user's picks turn out unready).
|
|
365
|
+
*/
|
|
366
|
+
allowedAgents?: string[];
|
|
337
367
|
}
|
|
338
368
|
/** The structured plan produced by the leader agent. */
|
|
339
369
|
export interface ProductPlan {
|
|
@@ -383,6 +413,14 @@ export interface ProductMessageParams {
|
|
|
383
413
|
export interface ProductIdParams {
|
|
384
414
|
productId: string;
|
|
385
415
|
}
|
|
416
|
+
/**
|
|
417
|
+
* product.replay RPC params — re-run from an arbitrary completed/failed task forward.
|
|
418
|
+
* Resets the task + its descendants to pending and reuses upstream (ancestor) outputs as context.
|
|
419
|
+
*/
|
|
420
|
+
export interface ProductReplayParams {
|
|
421
|
+
productId: string;
|
|
422
|
+
taskId: string;
|
|
423
|
+
}
|
|
386
424
|
/** Runtime instance state. */
|
|
387
425
|
export interface ProductInstanceStatus {
|
|
388
426
|
instanceId: string;
|
|
@@ -404,6 +442,11 @@ export interface ProductTaskState {
|
|
|
404
442
|
error?: string;
|
|
405
443
|
startedAt?: string;
|
|
406
444
|
completedAt?: string;
|
|
445
|
+
/** Per-task token usage, surfaced for cost attribution in the task detail view. */
|
|
446
|
+
inputTokens?: number;
|
|
447
|
+
outputTokens?: number;
|
|
448
|
+
/** Relative paths of files the task produced. */
|
|
449
|
+
changedFiles?: string[];
|
|
407
450
|
}
|
|
408
451
|
/** agents.getGateway response. */
|
|
409
452
|
export interface AgentsGetGatewayResult {
|
|
@@ -461,3 +504,11 @@ export interface ProductDeleteParams {
|
|
|
461
504
|
productId: string;
|
|
462
505
|
}
|
|
463
506
|
export type { AgentSource } from "./notification-payloads.js";
|
|
507
|
+
/** One row of the team roster shown to the leader during planning (soft capability hints only). */
|
|
508
|
+
export interface AgentRosterEntry {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
model?: string;
|
|
512
|
+
strengths: string;
|
|
513
|
+
isLeader: boolean;
|
|
514
|
+
}
|
|
@@ -31,6 +31,7 @@ export declare const ACP_EXTENDED_METHODS: {
|
|
|
31
31
|
readonly PRODUCT_PAUSE: "x/product.pause";
|
|
32
32
|
readonly PRODUCT_CANCEL: "x/product.cancel";
|
|
33
33
|
readonly PRODUCT_ROLLBACK: "x/product.rollback";
|
|
34
|
+
readonly PRODUCT_REPLAY: "x/product.replay";
|
|
34
35
|
readonly PRODUCT_STATUS: "x/product.status";
|
|
35
36
|
readonly SOLO_SUBSCRIBE: "x/solo.subscribe";
|
|
36
37
|
readonly SOLO_MESSAGE: "x/solo.message";
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
* Turn-lifecycle events relayed to the Control UI WebSocket.
|
|
14
14
|
* These are the "chat session" events that every UI client needs.
|
|
15
15
|
*/
|
|
16
|
-
export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.asset.updated", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested"];
|
|
16
|
+
export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_ended", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.asset.updated", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested"];
|
|
17
17
|
/**
|
|
18
18
|
* Agent Team events (Solo Mode, Product Mode, Plan lifecycle).
|
|
19
19
|
* Relayed to the UI's team/orchestration panel.
|
|
20
20
|
*/
|
|
21
|
-
export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.agentDelta", "solo.
|
|
21
|
+
export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted"];
|
|
22
22
|
/**
|
|
23
23
|
* All agent notifications that Gateway should relay to WS clients.
|
|
24
24
|
* Union of session events + team events.
|
|
25
25
|
*/
|
|
26
|
-
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.asset.updated", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "solo.progress", "solo.agentDelta", "solo.
|
|
26
|
+
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_started", "turn.subagent_delta", "turn.subagent_ended", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.tool_use_summary", "turn.tool_selection_policy", "turn.lifecycle", "turn.document_maintenance", "turn.artifact_contract", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.asset.updated", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "solo.progress", "solo.specProgress", "solo.agentDelta", "solo.agentActivity", "solo.agentUsage", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.members", "product.agentActivity", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted"];
|
|
27
27
|
/** Type-level event name for session events. */
|
|
28
28
|
export type AgentWsEventName = (typeof AGENT_WS_EVENT_NAMES)[number];
|
|
29
29
|
/** Type-level event name for team events. */
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type { ChatMessage, LocalizedToolText, ToolCapabilityCategory } from "./chat-types.js";
|
|
12
12
|
import type { GatewayRpcMethodMap } from "./gateway-rpc.js";
|
|
13
13
|
import type { WireTokenUsage } from "./notification-payloads.js";
|
|
14
|
-
import type { SoloEvaluation, SoloMessageParams, SoloEvaluateParams, SoloDeleteParams, ProductPlan, ProductPlanParams, ProductConfirmParams, ProductMessageParams, ProductIdParams, ProductDeleteParams, AgentsGetGatewayResult, AgentsListConfiguredItem, AgentsProcessInfo, AgentsKillParams, AgentsGetLogParams, AgentsGetLogResult, AgentsTestConnectionParams, AgentsTestConnectionResult } from "./acp-agent-management.js";
|
|
14
|
+
import type { SoloEvaluation, SoloMessageParams, SoloEvaluateParams, SoloDeleteParams, ProductPlan, ProductPlanParams, ProductConfirmParams, ProductMessageParams, ProductIdParams, ProductDeleteParams, ProductReplayParams, AgentsGetGatewayResult, AgentsListConfiguredItem, AgentsProcessInfo, AgentsKillParams, AgentsGetLogParams, AgentsGetLogResult, AgentsTestConnectionParams, AgentsTestConnectionResult } from "./acp-agent-management.js";
|
|
15
15
|
export type AgentCategory = "sub-agent" | "teammate";
|
|
16
16
|
export type AgentProtocol = "internal" | "acp";
|
|
17
17
|
export type AgentStatus = "available" | "unavailable" | "handshake_failed" | "not_installed";
|
|
@@ -103,6 +103,9 @@ export interface ProductTaskDef {
|
|
|
103
103
|
assignee: string;
|
|
104
104
|
prompt: string;
|
|
105
105
|
dependsOn?: string[];
|
|
106
|
+
/** Leader-authored "done" criteria: files to produce / how to self-check / terminal PASS.
|
|
107
|
+
* Appended to the task prompt so the evidence gate (assertProductTaskCompletionEvidence) sees it. */
|
|
108
|
+
acceptanceCriteria?: string;
|
|
106
109
|
}
|
|
107
110
|
export interface ProductStatus {
|
|
108
111
|
productId: string;
|
|
@@ -1108,7 +1111,9 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
|
|
|
1108
1111
|
};
|
|
1109
1112
|
};
|
|
1110
1113
|
"agents.checkUpdates": {
|
|
1111
|
-
params:
|
|
1114
|
+
params: {
|
|
1115
|
+
mirror?: string;
|
|
1116
|
+
} | undefined;
|
|
1112
1117
|
result: {
|
|
1113
1118
|
updates: unknown[];
|
|
1114
1119
|
};
|
|
@@ -1261,6 +1266,13 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
|
|
|
1261
1266
|
ok: true;
|
|
1262
1267
|
};
|
|
1263
1268
|
};
|
|
1269
|
+
"product.replay": {
|
|
1270
|
+
params: ProductReplayParams;
|
|
1271
|
+
result: {
|
|
1272
|
+
productId: string;
|
|
1273
|
+
ok: true;
|
|
1274
|
+
};
|
|
1275
|
+
};
|
|
1264
1276
|
"workflow.create": {
|
|
1265
1277
|
params: Record<string, unknown>;
|
|
1266
1278
|
result: Record<string, unknown>;
|
|
@@ -6,7 +6,7 @@ export { type ChatMessage, type ChatMessageRole, type LocalizedToolText, type Th
|
|
|
6
6
|
export { type AgentCapabilities, type AgentCategory, type AgentConfig, type AgentDescriptor, type AgentProtocol, type AgentRpcMethodMap, type AgentStatus, type CustomAgentDef, type ProductInstanceDef, type ProductPhase, type ProductStatus, type ProductSummary, type ProductTaskDef, type ProductTaskStatus, type SoloAgentResult, type SoloAgentState, type SoloState, type SoloStatus, } from "./agent-methods.js";
|
|
7
7
|
export type * from "./acp-agent-management.js";
|
|
8
8
|
export { AGENT_TEAM_WS_EVENT_NAMES, AGENT_WS_EVENT_NAMES, ALL_AGENT_WS_EVENT_NAMES, type AgentTeamWsEventName, type AgentWsEventName, type AllAgentWsEventName, } from "./agent-events.js";
|
|
9
|
-
export { type AgentSource, type AgentsErrorNotification, type AgentsStatusNotification, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SoloAgentDeltaNotification, type
|
|
9
|
+
export { type AgentSource, type AgentsErrorNotification, type AgentsStatusNotification, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductMembersNotification, type ProductAgentActivityNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SoloAgentDeltaNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactContractNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaPersistedNotification, type TurnMediaProgressNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnSkillInstructionNotification, type TurnStartNotification, type TurnSubagentDeltaNotification, type TurnSubagentEndedNotification, type TurnSubagentStartedNotification, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type PetSoulReadyNotification, type PetReactionNotification, type PetGrowthNotification, type PetStateNotification, type PetConfirmNotification, type WorkflowDeletedNotification, type WorkflowRecordNotification, type WorkflowRunCompletedNotification, type WorkflowRunFailedNotification, type WorkflowRunStartedNotification, } from "./notification-payloads.js";
|
|
10
10
|
export { ACP_EXTENDED_METHODS, ACP_EXTENDED_SESSION_UPDATE_TYPES, ACP_METHODS, ACP_PROTOCOL_VERSION, ACP_SESSION_UPDATE_TYPES, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, isExtendedSessionUpdateType, isStandardSessionUpdateType, parseAcpMessage, type AcpAgentCapabilities, type AcpAgentMessageChunkPayload, type AcpAgentThoughtChunkPayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpEndTurnPayload, type AcpExtendedMethod, type AcpExtendedSessionUpdateType, type AcpFsReadTextFileParams, type AcpFsReadTextFileResult, type AcpFsWriteTextFileParams, type AcpFsWriteTextFileResult, type AcpHostCapabilities, type AcpInitializeParams, type AcpInitializeResult, type AcpJsonRpcError, type AcpJsonRpcMessage, type AcpJsonRpcNotification, type AcpJsonRpcRequest, type AcpJsonRpcResponse, type AcpMode, type AcpPermissionOption, type AcpPermissionRequestParams, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, type AcpSessionSetConfigParams, type AcpSessionUpdateNotification, type AcpSessionUpdateType, type AcpStandardMethod, type AcpStandardSessionUpdateType, type AcpStopReason, type AcpToolCallPayload, type AcpToolCallUpdatePayload, type AcpUsage, type AcpUsageUpdatePayload, type AcpXSessionInfoPayload, type AcpXSkillInstructionPayload, } from "./acp-protocol.js";
|
|
11
11
|
export { type ApprovalRequiredToolContract, type ModelSelectionReason, type PendingPromptContract, type RuntimeCapabilitySummaryContract, type RuntimeSessionContract, type SessionIdentityContract, } from "./session.js";
|
|
12
12
|
export { type GatewayChannelExecutionEgressContract, type GatewayChannelExecutionEgressKind, type GatewayChannelExecutionIngressBindingContract, type GatewayChannelExecutionIngressSource, } from "./channel-ingress.js";
|
|
@@ -263,10 +263,84 @@ export interface TurnHeartbeatNotification {
|
|
|
263
263
|
turnId: string;
|
|
264
264
|
message: string;
|
|
265
265
|
}
|
|
266
|
-
/**
|
|
266
|
+
/** Structured telemetry for a tool use batch. */
|
|
267
267
|
export interface TurnToolUseSummaryNotification {
|
|
268
268
|
turnId: string;
|
|
269
|
+
telemetrySource?: "agent" | "agent-synthetic";
|
|
270
|
+
availableToolNames: string[];
|
|
271
|
+
enabledToolNames: string[];
|
|
272
|
+
toolCallNames: string[];
|
|
273
|
+
blockedToolCalls: Array<{
|
|
274
|
+
name: string;
|
|
275
|
+
reason: string;
|
|
276
|
+
}>;
|
|
277
|
+
}
|
|
278
|
+
/** Structured telemetry for why the enabled tool surface changed within a turn. */
|
|
279
|
+
export interface TurnToolSelectionPolicyNotification {
|
|
280
|
+
turnId: string;
|
|
281
|
+
policyId: string;
|
|
282
|
+
intent: "benchmark_state_maintenance" | "fresh_evidence" | "verification" | "final_answer" | "deferred_tool_discovery" | "tool_recovery" | "lifecycle_reconciliation";
|
|
283
|
+
reason: string;
|
|
284
|
+
availableToolNames: string[];
|
|
285
|
+
enabledToolNamesBefore: string[];
|
|
286
|
+
enabledToolNamesAfter: string[];
|
|
287
|
+
suppressedToolNames: string[];
|
|
288
|
+
nextAction: string;
|
|
289
|
+
}
|
|
290
|
+
/** Queryable long-horizon turn lifecycle telemetry. */
|
|
291
|
+
export interface TurnLifecycleNotification {
|
|
292
|
+
turnId: string;
|
|
293
|
+
kind: "stage" | "reopen" | "resume" | "context_compression" | "goal_reconstruction" | "memory_drift" | "artifact_path_drift";
|
|
294
|
+
stage?: string;
|
|
295
|
+
status?: string;
|
|
296
|
+
detail?: string;
|
|
297
|
+
reconstruction?: GoalReconstructionState;
|
|
298
|
+
observedAt?: string;
|
|
299
|
+
}
|
|
300
|
+
export interface GoalReconstructionState {
|
|
301
|
+
goal: string;
|
|
302
|
+
artifactRoot: string;
|
|
303
|
+
decisions: string[];
|
|
304
|
+
defects: string[];
|
|
305
|
+
acceptanceCriteria: string[];
|
|
306
|
+
blockers: string[];
|
|
307
|
+
nextAction: string;
|
|
308
|
+
}
|
|
309
|
+
export interface MaintainedDocumentIndex {
|
|
310
|
+
name?: string;
|
|
311
|
+
path?: string;
|
|
312
|
+
indexed: true;
|
|
313
|
+
maintained: true;
|
|
314
|
+
indexVersion: string;
|
|
315
|
+
contentHash: string;
|
|
269
316
|
summary: string;
|
|
317
|
+
lastReviewedTurn: number;
|
|
318
|
+
fileSizeBytes: number;
|
|
319
|
+
recordCount: number;
|
|
320
|
+
}
|
|
321
|
+
export interface DecisionStateRecord {
|
|
322
|
+
id: string;
|
|
323
|
+
decision: string;
|
|
324
|
+
status: string;
|
|
325
|
+
evidence: string;
|
|
326
|
+
lastConfirmedTurn: number;
|
|
327
|
+
}
|
|
328
|
+
export interface ReadCycleGuard {
|
|
329
|
+
strategy: string;
|
|
330
|
+
nextReadPolicy: string;
|
|
331
|
+
budgetStatus: "within-budget";
|
|
332
|
+
maxReadsPerDocument: number;
|
|
333
|
+
observedReadsByPath: Record<string, number>;
|
|
334
|
+
}
|
|
335
|
+
/** Queryable large-document maintenance and read-cycle audit telemetry. */
|
|
336
|
+
export interface TurnDocumentMaintenanceNotification {
|
|
337
|
+
turnId: string;
|
|
338
|
+
checkpointId: string;
|
|
339
|
+
documents: MaintainedDocumentIndex[];
|
|
340
|
+
decisionStateTable: DecisionStateRecord[];
|
|
341
|
+
readCycleFindings: Array<Record<string, unknown>>;
|
|
342
|
+
readCycleGuard: ReadCycleGuard;
|
|
343
|
+
observedAt?: string;
|
|
270
344
|
}
|
|
271
345
|
/** Structured artifact produced by the agent. */
|
|
272
346
|
export interface TurnArtifactNotification {
|
|
@@ -279,6 +353,21 @@ export interface TurnArtifactNotification {
|
|
|
279
353
|
content?: string;
|
|
280
354
|
mimeType?: string;
|
|
281
355
|
}
|
|
356
|
+
/** Single-track artifact delivery and browser-acceptance contract. */
|
|
357
|
+
export interface TurnArtifactContractNotification {
|
|
358
|
+
turnId: string;
|
|
359
|
+
artifactRoot?: string;
|
|
360
|
+
writePaths: string[];
|
|
361
|
+
outOfRootWrites: Array<{
|
|
362
|
+
path: string;
|
|
363
|
+
artifactRoot: string;
|
|
364
|
+
toolName: string;
|
|
365
|
+
}>;
|
|
366
|
+
devServerUrls: string[];
|
|
367
|
+
browserVerified: boolean;
|
|
368
|
+
browserEvidence: string[];
|
|
369
|
+
requiresBrowserAcceptance: boolean;
|
|
370
|
+
}
|
|
282
371
|
/** Agent requests user approval before executing a restricted tool. */
|
|
283
372
|
export interface ToolApprovalRequestNotification {
|
|
284
373
|
approvalId: string;
|
|
@@ -502,6 +591,9 @@ export interface SoloProgressNotification {
|
|
|
502
591
|
agentId: string;
|
|
503
592
|
state: "pending" | "running" | "completed" | "failed" | "idle";
|
|
504
593
|
progress?: string;
|
|
594
|
+
/** Absolute path of the competitor's isolated git worktree, sent with the first "running" event so
|
|
595
|
+
* the UI can resolve the agent's产物 (which live in the worktree) for click-to-preview. */
|
|
596
|
+
worktreePath?: string;
|
|
505
597
|
}
|
|
506
598
|
/** Solo evaluation completed. */
|
|
507
599
|
export interface SoloEvaluationNotification {
|
|
@@ -515,15 +607,6 @@ export interface SoloAgentDeltaNotification {
|
|
|
515
607
|
agentId: string;
|
|
516
608
|
text: string;
|
|
517
609
|
}
|
|
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
610
|
/** Solo agent usage. */
|
|
528
611
|
export interface SoloAgentUsageNotification {
|
|
529
612
|
soloId: string;
|
|
@@ -542,6 +625,11 @@ export interface ProductTaskCompletedNotification {
|
|
|
542
625
|
productId: string;
|
|
543
626
|
taskId: string;
|
|
544
627
|
result: string;
|
|
628
|
+
/** Per-task token usage harvested from the agent's usage tracker. */
|
|
629
|
+
inputTokens?: number;
|
|
630
|
+
outputTokens?: number;
|
|
631
|
+
/** Relative paths of files the task produced (before its worktree was torn down). */
|
|
632
|
+
changedFiles?: string[];
|
|
545
633
|
}
|
|
546
634
|
/** Product task failed. */
|
|
547
635
|
export interface ProductTaskFailedNotification {
|
|
@@ -593,6 +681,22 @@ export interface ProductTaskOutputDeltaNotification {
|
|
|
593
681
|
taskId: string;
|
|
594
682
|
text: string;
|
|
595
683
|
}
|
|
684
|
+
/** Live team roster, emitted once at run start (and on resume) so the 团队成员 panel populates live. */
|
|
685
|
+
export interface ProductMembersNotification {
|
|
686
|
+
productId: string;
|
|
687
|
+
members: {
|
|
688
|
+
agentId: string;
|
|
689
|
+
role: string;
|
|
690
|
+
name: string;
|
|
691
|
+
}[];
|
|
692
|
+
}
|
|
693
|
+
/** Per-task tool-call heartbeat (parity with Solo's solo.agentActivity) — keeps a silent-tool worker's
|
|
694
|
+
* detail pane from looking frozen by surfacing the tool it is currently using. */
|
|
695
|
+
export interface ProductAgentActivityNotification {
|
|
696
|
+
productId: string;
|
|
697
|
+
taskId: string;
|
|
698
|
+
toolName: string;
|
|
699
|
+
}
|
|
596
700
|
/** Leader agent produced a structured plan — client should present to user. */
|
|
597
701
|
export interface ProductPlanReadyNotification {
|
|
598
702
|
productId: string;
|
|
@@ -854,7 +958,11 @@ export interface NotificationMethodMap {
|
|
|
854
958
|
"turn.exec_progress": TurnExecProgressNotification;
|
|
855
959
|
"turn.heartbeat": TurnHeartbeatNotification;
|
|
856
960
|
"turn.tool_use_summary": TurnToolUseSummaryNotification;
|
|
961
|
+
"turn.tool_selection_policy": TurnToolSelectionPolicyNotification;
|
|
962
|
+
"turn.lifecycle": TurnLifecycleNotification;
|
|
963
|
+
"turn.document_maintenance": TurnDocumentMaintenanceNotification;
|
|
857
964
|
"turn.artifact": TurnArtifactNotification;
|
|
965
|
+
"turn.artifact_contract": TurnArtifactContractNotification;
|
|
858
966
|
"tool.approval.request": ToolApprovalRequestNotification;
|
|
859
967
|
"turn.skill_instruction": TurnSkillInstructionNotification;
|
|
860
968
|
"turn.skill_acquisition_needed": TurnSkillAcquisitionNeededNotification;
|
|
@@ -879,7 +987,6 @@ export interface NotificationMethodMap {
|
|
|
879
987
|
"solo.progress": SoloProgressNotification;
|
|
880
988
|
"solo.evaluation": SoloEvaluationNotification;
|
|
881
989
|
"solo.agentDelta": SoloAgentDeltaNotification;
|
|
882
|
-
"solo.agentDiff": SoloAgentDiffNotification;
|
|
883
990
|
"solo.agentUsage": SoloAgentUsageNotification;
|
|
884
991
|
"product.taskStarted": ProductTaskStartedNotification;
|
|
885
992
|
"product.taskCompleted": ProductTaskCompletedNotification;
|
|
@@ -890,6 +997,8 @@ export interface NotificationMethodMap {
|
|
|
890
997
|
"product.dagTopology": ProductDagTopologyNotification;
|
|
891
998
|
"product.budgetUpdate": ProductBudgetUpdateNotification;
|
|
892
999
|
"product.taskOutput": ProductTaskOutputDeltaNotification;
|
|
1000
|
+
"product.members": ProductMembersNotification;
|
|
1001
|
+
"product.agentActivity": ProductAgentActivityNotification;
|
|
893
1002
|
"product.planReady": ProductPlanReadyNotification;
|
|
894
1003
|
"product.planFailed": ProductPlanFailedNotification;
|
|
895
1004
|
"product.planningDelta": ProductPlanningDeltaNotification;
|
|
@@ -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
|
-
}
|
|
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,25 @@ 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
|
}
|
|
204
|
+
/** Best-effort resolve the backing model id for an agent (for the planning roster).
|
|
205
|
+
* Returns the configured/auto model or undefined. No spawn — reads config + auto env only. */
|
|
206
|
+
export declare function resolveAgentModel(detector: AcpDetector, id: string): string | undefined;
|
|
@@ -118,6 +118,15 @@ export declare class AcpProtocolAdapter {
|
|
|
118
118
|
* @param hostHandler Optional handler for agent→host requests (fs, terminal, permission)
|
|
119
119
|
*/
|
|
120
120
|
attach(child: ChildProcess, onNotification?: (method: string, params: unknown) => void, hostHandler?: AcpHostRequestHandler): void;
|
|
121
|
+
/**
|
|
122
|
+
* qlogicagent extends ACP `session/update` with an `x_*` variant namespace (x_relay, x_session_info,
|
|
123
|
+
* x_skill_instruction, …) that the standard SDK schema does not model and therefore rejects. Detect
|
|
124
|
+
* those notifications on the read side and dispatch them to onNotification directly — bypassing the
|
|
125
|
+
* SDK's strict validation — so the host's usage/progress accumulation runs exactly as it does for the
|
|
126
|
+
* internal-agent path. Returns true when the message was consumed here (and must be hidden from the
|
|
127
|
+
* SDK); false for everything else (standard updates, requests, responses) which the SDK handles.
|
|
128
|
+
*/
|
|
129
|
+
private consumeExtensionNotification;
|
|
121
130
|
/**
|
|
122
131
|
* Build the SDK Client implementation (agent→host reverse-RPC) from our loose host handler.
|
|
123
132
|
* Re-reads this.hostHandler / this.onNotification on each call so detach() takes effect.
|
|
@@ -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
|