qlogicagent 2.18.12 → 2.19.2
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/README.md +382 -382
- package/dist/agent-contract.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
- package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
- package/dist/host-contract.js +1 -1
- package/dist/host-session-collection-contract.js +1 -0
- package/dist/index.js +478 -505
- package/dist/pet-host.js +8 -8
- package/dist/project-memory-host.js +23 -23
- package/dist/protocol.js +1 -1
- package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
- package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
- package/dist/types/cli/acp-commands.d.ts +1 -1
- package/dist/types/cli/acp-extended-handlers.d.ts +8 -8
- package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -11
- package/dist/types/cli/acp-session-host.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -9
- package/dist/types/cli/default-project-bootstrap.d.ts +2 -32
- package/dist/types/cli/handlers/session-handler.d.ts +0 -43
- package/dist/types/cli/handlers/solo-handler.d.ts +3 -14
- package/dist/types/cli/multi-agent-handler-host.d.ts +3 -16
- package/dist/types/cli/product-coordinator.d.ts +3 -14
- package/dist/types/cli/rpc-registry.d.ts +0 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +4 -1
- package/dist/types/cli/stdio-server.d.ts +1 -2
- package/dist/types/host-contract/index.d.ts +112 -19
- package/dist/types/host-session-collection-contract.d.ts +61 -0
- package/dist/types/orchestration/agent-instance.d.ts +11 -14
- package/dist/types/orchestration/agent-roster.d.ts +8 -4
- package/dist/types/orchestration/delegate-bridge.d.ts +8 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -3
- package/dist/types/orchestration/product-persistence.d.ts +0 -4
- package/dist/types/orchestration/product-planner.d.ts +4 -6
- package/dist/types/orchestration/solo-evaluator.d.ts +2 -5
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +2 -1
- package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +7 -0
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
- package/dist/types/protocol/agent-contract.d.ts +50 -0
- package/dist/types/protocol/methods.d.ts +20 -38
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +2 -190
- package/dist/types/protocol/wire/acp-protocol.d.ts +3 -4
- package/dist/types/protocol/wire/agent-events.d.ts +1 -32
- package/dist/types/protocol/wire/agent-methods.d.ts +1 -243
- package/dist/types/protocol/wire/gateway-rpc.d.ts +343 -15
- package/dist/types/protocol/wire/index.d.ts +3 -3
- package/dist/types/protocol/wire/notification-payloads.d.ts +103 -126
- package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +17 -0
- package/dist/types/runtime/infra/project-authority-facade.d.ts +1 -1
- package/dist/types/runtime/infra/project-data-paths.d.ts +2 -1
- package/dist/types/runtime/infra/project-host-authority.d.ts +3 -2
- package/dist/types/runtime/infra/project-store.d.ts +4 -39
- package/dist/types/runtime/session/session-catalog.d.ts +0 -12
- package/dist/types/runtime/session/session-persistence.d.ts +1 -1
- package/dist/types/runtime/session/session-resource-key.d.ts +1 -1
- package/dist/types/runtime/session/session-types.d.ts +0 -23
- package/dist/types/transport/acp-server.d.ts +2 -10
- package/dist/vendor/hatch-pet/LICENSE.txt +201 -201
- package/dist/vendor/hatch-pet/NOTICE.md +25 -25
- package/dist/vendor/hatch-pet/references/animation-rows.md +29 -29
- package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -35
- package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -66
- package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -169
- package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -150
- package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -408
- package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -256
- package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -96
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +834 -834
- package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -78
- package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -157
- package/dist/workflow-host.js +10 -10
- package/package.json +16 -1
- package/dist/types/cli/agent-config-coordinator.d.ts +0 -27
- package/dist/types/cli/agent-config-runtime.d.ts +0 -11
- package/dist/types/cli/agent-status-notifier.d.ts +0 -11
- package/dist/types/cli/handlers/agents-handler.d.ts +0 -121
- package/dist/types/cli/handlers/project-handler.d.ts +0 -36
- package/dist/types/cli/project-command-service.d.ts +0 -28
- package/dist/types/orchestration/delegation-coordinator.d.ts +0 -100
- package/dist/types/runtime/infra/acp-detector.d.ts +0 -271
- package/dist/types/runtime/infra/agent-config-store.d.ts +0 -30
- package/dist/types/runtime/infra/agent-install-runner.d.ts +0 -80
- package/dist/types/runtime/infra/external-agent-approvals.d.ts +0 -59
- package/dist/types/runtime/infra/migrate-device-scope.d.ts +0 -49
- package/dist/types/runtime/infra/project-data-gc.d.ts +0 -15
- package/dist/types/runtime/session/native/claude-session-source.d.ts +0 -23
- package/dist/types/runtime/session/native/codex-index.d.ts +0 -21
- package/dist/types/runtime/session/native/codex-session-source.d.ts +0 -31
- package/dist/types/runtime/session/native/cwd-normalize.d.ts +0 -53
- package/dist/types/runtime/session/native/ephemeral-rollout-sweep.d.ts +0 -13
- package/dist/types/runtime/session/native/native-cwd-agents.d.ts +0 -17
- package/dist/types/runtime/session/native/native-session-source.d.ts +0 -89
- package/dist/types/runtime/session/native/native-title.d.ts +0 -1
- package/dist/types/runtime/session/native/register-builtin-sources.d.ts +0 -1
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { ProductOrchestrator } from "../orchestration/agent-instance.js";
|
|
2
2
|
import { ProductPlanner } from "../orchestration/product-planner.js";
|
|
3
|
-
import type { DelegateBridge } from "../orchestration/
|
|
4
|
-
import type {
|
|
5
|
-
import type { AcpDetector } from "../runtime/infra/acp-detector.js";
|
|
3
|
+
import type { DelegateBridge } from "../orchestration/delegate-bridge.js";
|
|
4
|
+
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
6
5
|
export interface ProductCoordinatorHost {
|
|
7
|
-
|
|
8
|
-
agentConfigStore: AgentConfigStore | null;
|
|
6
|
+
providerDirectory: HostAgentProviderDirectory;
|
|
9
7
|
productOrchestrator: ProductOrchestrator | null;
|
|
10
8
|
productPlanner: ProductPlanner | null;
|
|
11
|
-
emitAgentStatus(agentId: string, state: string, extra?: {
|
|
12
|
-
missedBeats?: number;
|
|
13
|
-
lastActivityAt?: number;
|
|
14
|
-
usage?: {
|
|
15
|
-
inputTokens: number;
|
|
16
|
-
outputTokens: number;
|
|
17
|
-
totalTokens: number;
|
|
18
|
-
};
|
|
19
|
-
}): void;
|
|
20
9
|
handleMcpToolCall(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
|
|
21
10
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
22
11
|
/** 激活层(S3c):gateway-routed delegate 桥(gate 关/未挂 = undefined → 旧本地 spawn 路径)。 */
|
|
@@ -5,7 +5,6 @@ import { type ControlHandlerHost } from "./handlers/control-handler.js";
|
|
|
5
5
|
import { type FilesHandlerHost } from "./handlers/files-handler.js";
|
|
6
6
|
import { type MediaHandlerHost } from "./handlers/media-handler.js";
|
|
7
7
|
import { type MemoryHandlerHost } from "./handlers/memory-handler.js";
|
|
8
|
-
import { type ProjectHandlerHost } from "./handlers/project-handler.js";
|
|
9
8
|
import { type SessionHandlerHost } from "./handlers/session-handler.js";
|
|
10
9
|
import { type SkillsHandlerHost } from "./handlers/skills-handler.js";
|
|
11
10
|
import { type TurnBaselineHandlerHost } from "./handlers/turn-baseline-handler.js";
|
|
@@ -50,7 +49,6 @@ export interface RpcHandlerHosts {
|
|
|
50
49
|
files: FilesHandlerHost;
|
|
51
50
|
media: MediaHandlerHost;
|
|
52
51
|
skills: SkillsHandlerHost;
|
|
53
|
-
project: ProjectHandlerHost;
|
|
54
52
|
community: CommunityHandlerHost;
|
|
55
53
|
dream: DreamHandlerHost;
|
|
56
54
|
turn: TurnControlHandlerHost;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { LLMRequest } from "../agent/types.js";
|
|
2
2
|
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
3
3
|
import type { RpcHandlerHosts } from "./rpc-registry.js";
|
|
4
|
-
type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["
|
|
4
|
+
type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["community"] & {
|
|
5
5
|
currentTurnId?: string;
|
|
6
6
|
/** Mid-turn guidance queue (运行中引导) — shared between handleTurnGuide and the tool loop's drain. */
|
|
7
7
|
pendingTurnGuidance?: string[];
|
|
8
|
+
memdir: RpcHandlerHosts["memory"]["memdir"];
|
|
9
|
+
projectMemoryStoreFactory: RpcHandlerHosts["memory"]["projectMemoryStoreFactory"];
|
|
10
|
+
setActiveWorkdir(dir: string): void;
|
|
8
11
|
getActiveProjectRoot(): string;
|
|
9
12
|
readonly multiAgentHandlerHost: RpcHandlerHosts["multiAgent"];
|
|
10
13
|
};
|
|
@@ -122,6 +122,7 @@ export declare class StdioServer {
|
|
|
122
122
|
getHostProfileClient(): HostProfileClient | undefined;
|
|
123
123
|
/** Thin read-only facade; consumers fail loudly when the host did not advertise capability. */
|
|
124
124
|
getHostCapabilityClient(): HostCapabilityClient | undefined;
|
|
125
|
+
getHostAgentProviderDirectory(): import("../runtime/infra/host-agent-provider-directory.js").HostAgentProviderDirectory;
|
|
125
126
|
/** Session durable-state facade; absent under gate-off/standalone so compatibility stays inert. */
|
|
126
127
|
getHostSessionClient(): HostSessionClient | undefined;
|
|
127
128
|
/** D2 telemetry/feedback business facade; durable storage remains gateway-only. */
|
|
@@ -223,8 +224,6 @@ export declare class StdioServer {
|
|
|
223
224
|
ensureTaskDistillation(): TaskDistillationCoordinator;
|
|
224
225
|
resolveAgent(config: TurnConfig): Agent | null;
|
|
225
226
|
private invalidateResolvedLlmCache;
|
|
226
|
-
/** Emit an `agents.status` notification when a child process state changes. */
|
|
227
|
-
private emitAgentStatus;
|
|
228
227
|
createDreamHandlerHost(): import("./handlers/dream-handler.js").DreamHandlerHost;
|
|
229
228
|
private createAcpExtendedHandlerHost;
|
|
230
229
|
/**
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
* 标注 [S1 补定] 的辅助类型是 freeze 引用但未给定义的最小结构,属 S1 评审点,
|
|
12
12
|
* 其字段以 freeze 正文/recon 注释为据;实现 lane 负责与现状 store 形状做映射。
|
|
13
13
|
*/
|
|
14
|
+
import type { NativeTranscript } from "../host-session-collection-contract.js";
|
|
15
|
+
export type { HostSessionCollectionDelta, HostSessionCollectionScope, HostSessionCollectionSnapshot, HostSessionLifecycle, HostSessionProviderDiagnostic, HostSessionSummary, HostSessionTitleSource, NativeTranscript, NativeTranscriptMessage, } from "../host-session-collection-contract.js";
|
|
16
|
+
export { isHostSessionCollectionDelta, isHostSessionCollectionSnapshot, isNativeTranscript, } from "../host-session-collection-contract.js";
|
|
14
17
|
export * from "./provider-profile.js";
|
|
15
18
|
/** agent 逻辑身份(小智自身也是一个 agentId="qlogicagent")。自身 vs 第三方仅由此值决定(F2)。 */
|
|
16
19
|
export type AgentId = string;
|
|
@@ -71,7 +74,8 @@ export type AgentInstanceState = "starting" | "ready" | "busy" | "unresponsive"
|
|
|
71
74
|
* 结构化失败归类(freeze §4 E3:失败一律结构化明示,不得降级成裸 error 串)。
|
|
72
75
|
* UNKNOWN = 无法归类时的显式兜底:禁止硬塞错误 code,也禁止因归不了类降级成裸串。
|
|
73
76
|
*/
|
|
74
|
-
export
|
|
77
|
+
export declare const LIFECYCLE_CODES: readonly ["CANCELLED", "PROCESS_EXIT", "HEARTBEAT_TIMEOUT", "TURN_TIMEOUT", "PROTOCOL_MISMATCH", "UNKNOWN"];
|
|
78
|
+
export type LifecycleCode = (typeof LIFECYCLE_CODES)[number];
|
|
75
79
|
/**
|
|
76
80
|
* 确定性派生 projectId —— host-contract leaf 内的唯一实现(project-id.ts):
|
|
77
81
|
* sha256(resolve(workspaceDir).toLowerCase()).hex[:16]。
|
|
@@ -202,7 +206,7 @@ export interface SessionMeta {
|
|
|
202
206
|
/** 主 agent(创建即锁定,severe 禁中途切换) */
|
|
203
207
|
agentId: AgentId;
|
|
204
208
|
cwd: string;
|
|
205
|
-
/** 每 native agent 的原生会话 id 映射(
|
|
209
|
+
/** 每 native agent 的原生会话 id 映射(现状旧单值映射由 importer 迁入,见 N2) */
|
|
206
210
|
nativeSessionIds?: Record<AgentId, string>;
|
|
207
211
|
lifecycle: string;
|
|
208
212
|
}
|
|
@@ -212,22 +216,36 @@ export interface NativeSessionSummary {
|
|
|
212
216
|
updatedAt: number;
|
|
213
217
|
title?: string;
|
|
214
218
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
export interface NativeSessionIndexProvider {
|
|
221
|
-
/** 仅 native-cwd 后端(codex/claude)有 provider */
|
|
219
|
+
export interface NativeProjectContext {
|
|
220
|
+
projectId: ProjectId;
|
|
221
|
+
cwd: string;
|
|
222
|
+
}
|
|
223
|
+
export interface NativeSessionRef {
|
|
222
224
|
agentId: AgentId;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
cwd: string;
|
|
226
|
-
}): NativeSessionSummary[];
|
|
227
|
-
resolveNativeResumeId(sessionId: CanonicalSessionId, ctx: {
|
|
228
|
-
cwd: string;
|
|
229
|
-
}): string | undefined;
|
|
225
|
+
projectId: ProjectId;
|
|
226
|
+
nativeId: string;
|
|
230
227
|
}
|
|
228
|
+
export interface NativeSessionDetail extends NativeSessionSummary {
|
|
229
|
+
createdAt?: number;
|
|
230
|
+
messageCount?: number;
|
|
231
|
+
}
|
|
232
|
+
export interface NativeSessionProvider {
|
|
233
|
+
readonly agentId: AgentId;
|
|
234
|
+
list(ctx: NativeProjectContext): Promise<NativeSessionSummary[]>;
|
|
235
|
+
get(nativeId: string, ctx: NativeProjectContext): Promise<NativeSessionDetail | undefined>;
|
|
236
|
+
loadTranscript(nativeId: string, ctx: NativeProjectContext): Promise<NativeTranscript>;
|
|
237
|
+
exists(nativeId: string, ctx: NativeProjectContext): Promise<boolean>;
|
|
238
|
+
}
|
|
239
|
+
export type ProjectAgentSessionEntry = {
|
|
240
|
+
source: "host";
|
|
241
|
+
canonicalSessionId: CanonicalSessionId;
|
|
242
|
+
nativeRef?: NativeSessionRef;
|
|
243
|
+
title?: string;
|
|
244
|
+
} | {
|
|
245
|
+
source: "native-unadopted";
|
|
246
|
+
nativeRef: NativeSessionRef;
|
|
247
|
+
title?: string;
|
|
248
|
+
};
|
|
231
249
|
/**
|
|
232
250
|
* 拥有会话存储 + 项目作用域 + agentId 绑定 + canonical↔native 映射 + 生命周期状态。
|
|
233
251
|
* 唯一权威(不与 qlogicagent 并存)。崩溃恢复靠网关持有并重放(freeze §11.4#5)。
|
|
@@ -673,7 +691,7 @@ export interface SupervisorEventSink {
|
|
|
673
691
|
}): void;
|
|
674
692
|
/**
|
|
675
693
|
* media:统一 {mediaType,url,model,provider}(非 imageUrls[])。⚠R3:external agent 今天不发此事件
|
|
676
|
-
*
|
|
694
|
+
* Provider media must arrive as a first-class lifecycle event, never only as a generic tool call.
|
|
677
695
|
*/
|
|
678
696
|
onMedia(e: EvBase & {
|
|
679
697
|
mediaType: string;
|
|
@@ -1078,7 +1096,78 @@ export interface HostSkillInvocationResult {
|
|
|
1078
1096
|
/** 单文件读取上限;host 在解码前按 bytes 检查。 */
|
|
1079
1097
|
export declare const HOST_SKILL_FILE_MAX_BYTES: number;
|
|
1080
1098
|
/** [X7-P] 单一 agent→host 一元请求通道的服务域。 */
|
|
1081
|
-
export type HostRequestService = "memory" | "projectMemory" | "profile" | "preview" | "capability" | "session" | "feedback" | "project" | "runState" | "pet";
|
|
1099
|
+
export type HostRequestService = "memory" | "projectMemory" | "profile" | "preview" | "capability" | "session" | "feedback" | "project" | "runState" | "pet" | "provider";
|
|
1100
|
+
/** Read-only Provider projection exposed by the Gateway Host to supervised qlogicagent compute. */
|
|
1101
|
+
export declare const HOST_PROVIDER_PROXY_METHODS: readonly ["list", "get", "diagnose"];
|
|
1102
|
+
export type HostProviderProxyMethod = typeof HOST_PROVIDER_PROXY_METHODS[number];
|
|
1103
|
+
export type HostAgentProviderState = "installed" | "auth_required" | "ready" | "disabled" | "incompatible" | "unresponsive" | "failed";
|
|
1104
|
+
export type HostAgentProviderDiagnosticState = HostAgentProviderState | "not_installed";
|
|
1105
|
+
export type HostAgentProviderDiagnosticStage = "install" | "manifest" | "auth" | "launch" | "initialize" | "models" | "native_sessions" | "request";
|
|
1106
|
+
export type HostAgentProviderModelAuthority = {
|
|
1107
|
+
kind: "provider";
|
|
1108
|
+
enumeration: "protocol" | "implicit-default";
|
|
1109
|
+
} | {
|
|
1110
|
+
kind: "host";
|
|
1111
|
+
managedPurposes: string[];
|
|
1112
|
+
};
|
|
1113
|
+
export interface HostAgentProviderDiagnostic {
|
|
1114
|
+
providerId: string;
|
|
1115
|
+
state: HostAgentProviderDiagnosticState;
|
|
1116
|
+
stage: HostAgentProviderDiagnosticStage;
|
|
1117
|
+
code: string;
|
|
1118
|
+
message: string;
|
|
1119
|
+
retryable: boolean;
|
|
1120
|
+
providerVersion?: string;
|
|
1121
|
+
payloadVersion?: string;
|
|
1122
|
+
}
|
|
1123
|
+
export interface HostAgentProviderSnapshot {
|
|
1124
|
+
providerId: string;
|
|
1125
|
+
displayName: string;
|
|
1126
|
+
version: string;
|
|
1127
|
+
state: HostAgentProviderState;
|
|
1128
|
+
capabilities: {
|
|
1129
|
+
execution: {
|
|
1130
|
+
streaming: boolean;
|
|
1131
|
+
approvals: boolean;
|
|
1132
|
+
cancellation: boolean;
|
|
1133
|
+
resume: boolean;
|
|
1134
|
+
};
|
|
1135
|
+
auth: {
|
|
1136
|
+
modes: Array<"account" | "userKey" | "managed">;
|
|
1137
|
+
terminal: boolean;
|
|
1138
|
+
logout: boolean;
|
|
1139
|
+
};
|
|
1140
|
+
models: HostAgentProviderModelAuthority;
|
|
1141
|
+
nativeSessions: {
|
|
1142
|
+
discover: boolean;
|
|
1143
|
+
transcript: boolean;
|
|
1144
|
+
resume: boolean;
|
|
1145
|
+
};
|
|
1146
|
+
diagnostics: {
|
|
1147
|
+
readiness: true;
|
|
1148
|
+
version: true;
|
|
1149
|
+
structuredErrors: true;
|
|
1150
|
+
};
|
|
1151
|
+
};
|
|
1152
|
+
diagnostic?: HostAgentProviderDiagnostic;
|
|
1153
|
+
}
|
|
1154
|
+
export interface HostAgentProviderListResult {
|
|
1155
|
+
revision: number;
|
|
1156
|
+
providers: HostAgentProviderSnapshot[];
|
|
1157
|
+
}
|
|
1158
|
+
export interface HostAgentProviderGetResult {
|
|
1159
|
+
revision: number;
|
|
1160
|
+
provider: HostAgentProviderSnapshot | null;
|
|
1161
|
+
}
|
|
1162
|
+
export type HostProviderRequestParams = {
|
|
1163
|
+
service: "provider";
|
|
1164
|
+
method: "list";
|
|
1165
|
+
params: [];
|
|
1166
|
+
} | {
|
|
1167
|
+
service: "provider";
|
|
1168
|
+
method: "get" | "diagnose";
|
|
1169
|
+
params: [providerId: string];
|
|
1170
|
+
};
|
|
1082
1171
|
/** Preview Browser 的七个允许动作;tool 与 gateway 必须消费此单源。 */
|
|
1083
1172
|
export declare const PREVIEW_BROWSER_ACTIONS: readonly ["navigate", "snapshot", "click", "type", "screenshot", "console", "network"];
|
|
1084
1173
|
export type PreviewBrowserAction = (typeof PREVIEW_BROWSER_ACTIONS)[number];
|
|
@@ -1583,7 +1672,7 @@ export type HostPreviewRequestParams = {
|
|
|
1583
1672
|
* [X7-P] 跨进程 HostRequest 判别联合。memory/profile/preview 共用 `x/host.request`,
|
|
1584
1673
|
* service + method 二级分派;preview 的 method 与 payload 在类型层保持逐动作关联。
|
|
1585
1674
|
*/
|
|
1586
|
-
export type HostRequestParams = HostMemoryRequestParams | HostProjectMemoryRequestParams | HostProfileRequestParams | HostPreviewRequestParams | HostCapabilityRequestParams | HostSessionRequestParams | HostFeedbackRequestParams | HostProjectRequestParams | HostRunStateRequestParams | HostPetRequestParams;
|
|
1675
|
+
export type HostRequestParams = HostMemoryRequestParams | HostProjectMemoryRequestParams | HostProfileRequestParams | HostPreviewRequestParams | HostCapabilityRequestParams | HostSessionRequestParams | HostFeedbackRequestParams | HostProjectRequestParams | HostRunStateRequestParams | HostPetRequestParams | HostProviderRequestParams;
|
|
1587
1676
|
/** initialize 声明的真实已装配 host-request 服务;version 只接受冻结版本 1。 */
|
|
1588
1677
|
export type HostRequestCapability = {
|
|
1589
1678
|
version: 1;
|
|
@@ -1600,6 +1689,10 @@ export declare function isHostSkillMutationResult(value: unknown): value is Host
|
|
|
1600
1689
|
export declare function isHostApplyCuratorPlanResult(value: unknown): value is HostApplyCuratorPlanResult;
|
|
1601
1690
|
export declare function isHostPrepareSkillInstallResult(value: unknown): value is HostPrepareSkillInstallResult;
|
|
1602
1691
|
export declare function isHostFinalizeSkillInstallResult(value: unknown): value is HostFinalizeSkillInstallResult;
|
|
1692
|
+
export declare function isHostAgentProviderDiagnostic(value: unknown): value is HostAgentProviderDiagnostic;
|
|
1693
|
+
export declare function isHostAgentProviderSnapshot(value: unknown): value is HostAgentProviderSnapshot;
|
|
1694
|
+
export declare function isHostAgentProviderListResult(value: unknown): value is HostAgentProviderListResult;
|
|
1695
|
+
export declare function isHostAgentProviderGetResult(value: unknown): value is HostAgentProviderGetResult;
|
|
1603
1696
|
export declare function isHostSessionLoadForResumeResult(value: unknown): value is HostSessionLoadForResumeResult;
|
|
1604
1697
|
export declare function isHostSessionAppendResult(value: unknown): value is HostSessionAppendResult;
|
|
1605
1698
|
export declare function isHostSessionMutationResult(value: unknown): value is HostSessionMutationResult;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe Host session collection protocol.
|
|
3
|
+
*
|
|
4
|
+
* This is the common protocol layer shared by Gateway and renderer clients. It intentionally has
|
|
5
|
+
* no Node/runtime imports; Host services and native Providers remain behind the Gateway facade.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentId, CanonicalSessionId, NativeSessionRef, ProjectId } from "./host-contract/index.js";
|
|
8
|
+
export type HostSessionTitleSource = "prompt" | "generated" | "user" | "native" | "repaired";
|
|
9
|
+
export type HostSessionLifecycle = "active" | "archived" | "source-missing" | "resume-unavailable";
|
|
10
|
+
export type HostSessionCollectionScope = {
|
|
11
|
+
kind: "project";
|
|
12
|
+
projectId: ProjectId;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "workspace-tree";
|
|
15
|
+
};
|
|
16
|
+
export interface HostSessionSummary {
|
|
17
|
+
resourceId: string;
|
|
18
|
+
canonicalSessionId?: CanonicalSessionId;
|
|
19
|
+
source: "host" | "native-unadopted";
|
|
20
|
+
projectId: ProjectId;
|
|
21
|
+
agentId: AgentId;
|
|
22
|
+
title?: string;
|
|
23
|
+
titleSource?: HostSessionTitleSource;
|
|
24
|
+
lastActiveAt: string;
|
|
25
|
+
lifecycle: HostSessionLifecycle;
|
|
26
|
+
nativeRef?: NativeSessionRef;
|
|
27
|
+
}
|
|
28
|
+
export interface HostSessionProviderDiagnostic {
|
|
29
|
+
agentId: AgentId;
|
|
30
|
+
projectId: ProjectId;
|
|
31
|
+
code: string;
|
|
32
|
+
message: string;
|
|
33
|
+
lastGoodRevision?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface HostSessionCollectionSnapshot {
|
|
36
|
+
revision: number;
|
|
37
|
+
scopeGeneration: number;
|
|
38
|
+
items: HostSessionSummary[];
|
|
39
|
+
diagnostics: HostSessionProviderDiagnostic[];
|
|
40
|
+
}
|
|
41
|
+
export interface HostSessionCollectionDelta {
|
|
42
|
+
revision: number;
|
|
43
|
+
scopeGeneration: number;
|
|
44
|
+
addedOrUpdated?: HostSessionSummary[];
|
|
45
|
+
removed?: string[];
|
|
46
|
+
diagnostics?: HostSessionProviderDiagnostic[];
|
|
47
|
+
}
|
|
48
|
+
/** Provider-owned transcript wire shape. The renderer consumes this exact shape through Host RPC. */
|
|
49
|
+
export interface NativeTranscriptMessage {
|
|
50
|
+
id?: string;
|
|
51
|
+
role: "user" | "assistant" | "tool";
|
|
52
|
+
content: unknown;
|
|
53
|
+
createdAt?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface NativeTranscript {
|
|
56
|
+
messages: NativeTranscriptMessage[];
|
|
57
|
+
diagnostics?: unknown[];
|
|
58
|
+
}
|
|
59
|
+
export declare function isNativeTranscript(value: unknown): value is NativeTranscript;
|
|
60
|
+
export declare function isHostSessionCollectionSnapshot(value: unknown): value is HostSessionCollectionSnapshot;
|
|
61
|
+
export declare function isHostSessionCollectionDelta(value: unknown): value is HostSessionCollectionDelta;
|
|
@@ -11,27 +11,30 @@
|
|
|
11
11
|
* 4. product.resume → load state, resume scheduling
|
|
12
12
|
* 5. product.checkpoint → manual checkpoint
|
|
13
13
|
*/
|
|
14
|
-
import type {
|
|
15
|
-
import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
|
|
14
|
+
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
16
15
|
import type { ProductPhase, ProductCreateParams, ProductStatus, ProductSummary } from "../protocol/wire/acp-agent-management.js";
|
|
17
16
|
import { type PlannerMemoryContext } from "./planner-memory-brief.js";
|
|
18
17
|
import type { DagMutation } from "./product-planner.js";
|
|
19
18
|
import type { ProductLeaderCoordinator } from "./product-run-coordinator.js";
|
|
20
|
-
import type { DelegateBridge } from "./
|
|
19
|
+
import type { DelegateBridge } from "./delegate-bridge.js";
|
|
21
20
|
export type { ProductLeaderCoordinator } from "./product-run-coordinator.js";
|
|
22
21
|
export interface ProductCallbacks {
|
|
23
22
|
log?: {
|
|
24
23
|
info(msg: string): void;
|
|
25
24
|
warn(msg: string): void;
|
|
26
25
|
};
|
|
27
|
-
onTaskStarted?: (productId: string, taskId: string, assignee: string) => void;
|
|
28
|
-
onTaskCompleted?: (productId: string, taskId: string, result: string, meta
|
|
26
|
+
onTaskStarted?: (productId: string, taskId: string, assignee: string, attempt: number) => void;
|
|
27
|
+
onTaskCompleted?: (productId: string, taskId: string, result: string, meta: {
|
|
28
|
+
attempt: number;
|
|
29
29
|
inputTokens: number;
|
|
30
30
|
outputTokens: number;
|
|
31
31
|
changedFiles: string[];
|
|
32
32
|
acceptanceUnverified?: boolean;
|
|
33
33
|
}) => void;
|
|
34
|
-
onTaskFailed?: (productId: string, taskId: string, error: string
|
|
34
|
+
onTaskFailed?: (productId: string, taskId: string, error: string, meta: {
|
|
35
|
+
attempt: number;
|
|
36
|
+
terminalState: "failed" | "cancelled";
|
|
37
|
+
}) => void;
|
|
35
38
|
onCheckpointed?: (productId: string, timestamp: string) => void;
|
|
36
39
|
onBudgetWarning?: (productId: string, usedTokens: number, maxTotalTokens: number, percentage: number) => void;
|
|
37
40
|
/** Budget hard limit hit → the run auto-paused. The 100% counterpart of onBudgetWarning (80%): the
|
|
@@ -81,12 +84,11 @@ export declare function buildTaskContextPrompt(upstream: {
|
|
|
81
84
|
output: string;
|
|
82
85
|
}[], prompt: string): string;
|
|
83
86
|
export declare class ProductOrchestrator {
|
|
84
|
-
private
|
|
85
|
-
private configStore;
|
|
87
|
+
private providerDirectory;
|
|
86
88
|
private callbacks;
|
|
87
89
|
private leaderCoordinator?;
|
|
88
90
|
private sessions;
|
|
89
|
-
constructor(
|
|
91
|
+
constructor(providerDirectory: HostAgentProviderDirectory, callbacks?: ProductCallbacks, leaderCoordinator?: ProductLeaderCoordinator | undefined);
|
|
90
92
|
setLeaderCoordinator(leaderCoordinator: ProductLeaderCoordinator): void;
|
|
91
93
|
/** (a) Owner global cheat-sheet source for member dispatches (cli-injected;
|
|
92
94
|
* orchestration never imports skills directly). */
|
|
@@ -139,11 +141,6 @@ export declare class ProductOrchestrator {
|
|
|
139
141
|
* targets a successful-but-wrong task and re-runs forward from it in place.
|
|
140
142
|
*/
|
|
141
143
|
replayTask(productId: string, taskId: string): Promise<void>;
|
|
142
|
-
/** Get product status. */
|
|
143
|
-
/** P2-1: the native (codex/claude) session id captured for a delegation's single worker, so the
|
|
144
|
-
* DelegationCoordinator can resume it on the next same-(chat×agent) delegation. undefined for a
|
|
145
|
-
* multi-instance product, an own agent, or before the worker's first task settles. */
|
|
146
|
-
getDelegationNativeSessionId(productId: string): string | undefined;
|
|
147
144
|
getStatus(productId: string): ProductStatus | null;
|
|
148
145
|
/** Live DAG progress snapshot for a product (for the planner's execution-phase leader). */
|
|
149
146
|
getProgressSnapshot(productId: string): {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { HostAgentProviderListResult } from "../host-contract/index.js";
|
|
2
|
+
import type { AgentRosterEntry } from "../protocol/wire/acp-agent-management.js";
|
|
3
3
|
/** Build the team roster the leader sees during planning: every ready agent with a coarse
|
|
4
4
|
* strengths hint + its backing model. Leader-only soft hints — NOT a capability contract.
|
|
5
5
|
*
|
|
@@ -14,7 +14,9 @@ import { type AcpDetector } from "../runtime/infra/acp-detector.js";
|
|
|
14
14
|
* The leader `qlogicagent` (小智) is ALWAYS present (universal coordinator / fallback executor) — appended
|
|
15
15
|
* if not already in the roster, so the leader always has ≥1 valid assignee even when the user's picks turn
|
|
16
16
|
* out unready (or when the pool is empty). */
|
|
17
|
-
export declare function buildAgentRoster(
|
|
17
|
+
export declare function buildAgentRoster(snapshot: Readonly<HostAgentProviderListResult>, allowedAgents?: string[], options?: {
|
|
18
|
+
injectLeader?: boolean;
|
|
19
|
+
}): AgentRosterEntry[];
|
|
18
20
|
/**
|
|
19
21
|
* User-PICKED worker ids that did NOT make it into the roster (unready: not installed / not logged in
|
|
20
22
|
* / not in the catalog). Excludes the leader (always force-included). Empty when nothing was dropped
|
|
@@ -23,7 +25,9 @@ export declare function buildAgentRoster(detector: AcpDetector, _configStore: Ag
|
|
|
23
25
|
*/
|
|
24
26
|
export declare function computeUnavailablePicks(allowedAgents: string[] | undefined, rosterIds: readonly string[]): string[];
|
|
25
27
|
/** buildAgentRoster + the diagnostics of which picked workers were dropped as unavailable. */
|
|
26
|
-
export declare function buildAgentRosterWithDiagnostics(
|
|
28
|
+
export declare function buildAgentRosterWithDiagnostics(snapshot: Readonly<HostAgentProviderListResult>, allowedAgents?: string[], options?: {
|
|
29
|
+
injectLeader?: boolean;
|
|
30
|
+
}): {
|
|
27
31
|
roster: AgentRosterEntry[];
|
|
28
32
|
unavailablePicks: string[];
|
|
29
33
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DelegateRequestParams, SupervisorEventSink, TurnResult } from "../host-contract/index.js";
|
|
2
|
+
/** Authority-neutral transport used by the six orchestration stations to call Gateway-owned workers. */
|
|
3
|
+
export interface DelegateBridge {
|
|
4
|
+
isSupported(): boolean;
|
|
5
|
+
send(params: DelegateRequestParams, sink: SupervisorEventSink): Promise<TurnResult>;
|
|
6
|
+
cancel(delegationId: string): void;
|
|
7
|
+
respond(delegationId: string, approvalId: string, optionId: string): void;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { DelegateBridge } from "./
|
|
1
|
+
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
2
|
+
import type { DelegateBridge } from "./delegate-bridge.js";
|
|
3
3
|
import { type PlannerMemoryContext } from "./planner-memory-brief.js";
|
|
4
4
|
import type { ProductOrchestrator } from "./agent-instance.js";
|
|
5
5
|
import type { LeaderPort, PhaseRunnerPort } from "./goal-loop-coordinator.js";
|
|
@@ -49,7 +49,7 @@ export declare function takeGoalPhaseChangedFiles(productId: string): string[];
|
|
|
49
49
|
export declare function extractJson<T>(text: string): T;
|
|
50
50
|
export interface LeaderAdapterDeps {
|
|
51
51
|
/** Resolves the leader's external ACP descriptor (product-planner.ts:583). */
|
|
52
|
-
|
|
52
|
+
providerDirectory: HostAgentProviderDirectory;
|
|
53
53
|
/** Catalog id of the leader agent (e.g. "qlogicagent"). */
|
|
54
54
|
leaderAgentId: string;
|
|
55
55
|
/** Project workspaceDir — the leader process cwd. */
|
|
@@ -27,10 +27,6 @@ export interface PersistedProductState {
|
|
|
27
27
|
* PlanningSession is strings / arrays / plain objects (no functions, dates, or class instances).
|
|
28
28
|
*/
|
|
29
29
|
leaderDialogue?: PlanningSession;
|
|
30
|
-
/** P2-1: run tasks in the project cwd instead of per-task worktrees (see
|
|
31
|
-
* ProductCreateParams.runInProjectCwd) — persisted so a delegation resumed after an engine restart
|
|
32
|
-
* keeps running in the project cwd, not a fresh isolated worktree. */
|
|
33
|
-
runInProjectCwd?: boolean;
|
|
34
30
|
}
|
|
35
31
|
export interface ProductPersistenceOptions {
|
|
36
32
|
pathService?: PathService;
|
|
@@ -23,9 +23,8 @@
|
|
|
23
23
|
* - CrewAI: checkpoint serialization (mid-task state)
|
|
24
24
|
* - LangGraph: durable execution (persist after each node)
|
|
25
25
|
*/
|
|
26
|
-
import type {
|
|
27
|
-
import type {
|
|
28
|
-
import type { DelegateBridge } from "./delegation-coordinator.js";
|
|
26
|
+
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
27
|
+
import type { DelegateBridge } from "./delegate-bridge.js";
|
|
29
28
|
import type { ProductPlanParams, ProductPlan, ProductConfirmParams } from "../protocol/wire/acp-agent-management.js";
|
|
30
29
|
export type PlanningPhase = "planning" | "awaiting_confirmation" | "confirmed" | "executing" | "paused" | "completed" | "cancelled";
|
|
31
30
|
export interface PlanningMessage {
|
|
@@ -105,11 +104,10 @@ export interface DagMutation {
|
|
|
105
104
|
details?: Record<string, unknown>;
|
|
106
105
|
}
|
|
107
106
|
export declare class ProductPlanner {
|
|
108
|
-
private
|
|
109
|
-
private configStore;
|
|
107
|
+
private providerDirectory;
|
|
110
108
|
private callbacks;
|
|
111
109
|
private sessions;
|
|
112
|
-
constructor(
|
|
110
|
+
constructor(providerDirectory: HostAgentProviderDirectory, callbacks?: PlannerCallbacks);
|
|
113
111
|
/**
|
|
114
112
|
* Start an interactive planning session (Phase 1).
|
|
115
113
|
* Spawns the leader agent and begins multi-turn dialogue.
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* Degradation: if K agents fail but ≥1 succeeds, session remains interactive.
|
|
20
20
|
*/
|
|
21
|
-
import type {
|
|
22
|
-
import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
|
|
23
|
-
import type { DelegateBridge } from "./delegation-coordinator.js";
|
|
21
|
+
import type { DelegateBridge } from "./delegate-bridge.js";
|
|
24
22
|
import type { SoloState, SoloAgentState, SoloEvaluation, SoloStatus, SoloStartParams, SoloSelectParams, SoloSpec } from "../protocol/wire/acp-agent-management.js";
|
|
25
23
|
export declare function deriveSoloDelegateProjectId(registeredProjectRoot: string): string;
|
|
26
24
|
export interface SoloCallbacks {
|
|
@@ -75,10 +73,9 @@ export declare function buildEvaluationPrompt(originalTask: string, spec: SoloSp
|
|
|
75
73
|
diff?: string;
|
|
76
74
|
}>): string;
|
|
77
75
|
export declare class SoloEvaluator {
|
|
78
|
-
private configStore;
|
|
79
76
|
private callbacks;
|
|
80
77
|
private sessions;
|
|
81
|
-
constructor(
|
|
78
|
+
constructor(callbacks?: SoloCallbacks);
|
|
82
79
|
/** Persist current session data to disk (fire-and-forget). */
|
|
83
80
|
private persistSession;
|
|
84
81
|
/** Restore sessions from disk (call once at startup). */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { DelegateBridge } from "../
|
|
1
|
+
import type { DelegateBridge } from "../delegate-bridge.js";
|
|
2
2
|
interface LegacyTurnFixture {
|
|
3
3
|
sendTask(memberId: string, prompt: string, options?: {
|
|
4
4
|
timeout?: number;
|
|
5
|
+
session?: unknown;
|
|
5
6
|
}): Promise<unknown>;
|
|
6
7
|
getUsageTracker?(memberId: string): {
|
|
7
8
|
getUsage(): {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HostAgentProviderState } from "../../host-contract/index.js";
|
|
2
|
+
import type { HostAgentProviderDirectory } from "../../runtime/infra/host-agent-provider-directory.js";
|
|
3
|
+
export interface HostProviderDirectoryFixtureOptions {
|
|
4
|
+
states?: Readonly<Record<string, HostAgentProviderState | "not_installed">>;
|
|
5
|
+
diagnostics?: Readonly<Record<string, string>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function makeHostAgentProviderDirectoryFixture(options?: HostProviderDirectoryFixtureOptions): HostAgentProviderDirectory;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* with qlogicagent's actual capabilities. No mocks, no stubs (plan §1.5).
|
|
4
4
|
*
|
|
5
5
|
* Boundary capabilities (runAgent / invokeMcp / sendChannel) are injected so this file stays
|
|
6
|
-
* decoupled from the handler host that owns
|
|
6
|
+
* decoupled from the handler host that owns Gateway delegation and the xiaozhiclaw channel
|
|
7
7
|
* callback. Tool invocation goes straight through the single-source-of-truth tool registry
|
|
8
8
|
* (`findTool`). fail-loud everywhere: unknown tool, missing channel host, or any rejection throws.
|
|
9
9
|
*/
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { NotificationMethodMap } from "./wire/notification-payloads.js";
|
|
2
|
+
export declare const AGENT_CONTRACT_VERSION: 4;
|
|
3
|
+
export declare const AGENT_EVENT_SCHEMA_VERSION: 1;
|
|
4
|
+
export declare const AGENT_TERMINAL_STATES: readonly ["completed", "failed", "cancelled"];
|
|
5
|
+
export type TerminalState = (typeof AGENT_TERMINAL_STATES)[number];
|
|
6
|
+
export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "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.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", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "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", "workflow.approvalTimedOut"];
|
|
7
|
+
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", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
|
|
8
|
+
export declare const AGENT_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "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.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", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "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", "workflow.approvalTimedOut", "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", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
|
|
9
|
+
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "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.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", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "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", "workflow.approvalTimedOut", "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", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
|
|
10
|
+
/** Runtime-required keys whose shape is not encoded by TypeScript after serialization. */
|
|
11
|
+
export declare const AGENT_EVENT_REQUIRED_KEYS: {
|
|
12
|
+
readonly "product.taskStarted": readonly ["productId", "taskId", "assignee", "attempt"];
|
|
13
|
+
readonly "product.taskCompleted": readonly ["productId", "taskId", "result", "attempt"];
|
|
14
|
+
readonly "product.taskFailed": readonly ["productId", "taskId", "error", "attempt", "terminalState"];
|
|
15
|
+
readonly "mention.delegate_started": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
|
|
16
|
+
readonly "mention.delegate_activity": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
|
|
17
|
+
readonly "mention.delegate_settled": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision", "status"];
|
|
18
|
+
};
|
|
19
|
+
export type AgentWsEventName = (typeof AGENT_WS_EVENT_NAMES)[number];
|
|
20
|
+
export type AgentTeamWsEventName = (typeof AGENT_TEAM_WS_EVENT_NAMES)[number];
|
|
21
|
+
export type AgentEventName = (typeof AGENT_EVENT_NAMES)[number];
|
|
22
|
+
export type AllAgentWsEventName = AgentEventName;
|
|
23
|
+
export type AgentEventPayloadMap = {
|
|
24
|
+
[K in AgentEventName]: K extends keyof NotificationMethodMap ? NotificationMethodMap[K] : Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
export interface AgentEventEnvelope<K extends AgentEventName = AgentEventName> {
|
|
27
|
+
schemaVersion: typeof AGENT_EVENT_SCHEMA_VERSION;
|
|
28
|
+
type: K;
|
|
29
|
+
payload: AgentEventPayloadMap[K];
|
|
30
|
+
}
|
|
31
|
+
export declare const AGENT_CONTRACT_DESCRIPTOR: {
|
|
32
|
+
readonly version: 4;
|
|
33
|
+
readonly eventSchemaVersion: 1;
|
|
34
|
+
readonly eventNames: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.file_changes", "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.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", "session.recovery_pending", "memory.updated", "skills.updated", "turn.memory_recall", "turn.memory_written", "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", "workflow.approvalTimedOut", "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", "product.planReady", "product.planningDelta", "product.leaderMessage", "product.planFailed", "product.planningAsk", "goal.run_state_changed", "goal.phase_boundary", "goal.goal_edited", "goal.message_queued", "goal.acceptance_updated", "goal.round_message", "mention.delegate_started", "mention.delegate_activity", "mention.delegate_settled"];
|
|
35
|
+
readonly eventRequiredKeys: {
|
|
36
|
+
readonly "product.taskStarted": readonly ["productId", "taskId", "assignee", "attempt"];
|
|
37
|
+
readonly "product.taskCompleted": readonly ["productId", "taskId", "result", "attempt"];
|
|
38
|
+
readonly "product.taskFailed": readonly ["productId", "taskId", "error", "attempt", "terminalState"];
|
|
39
|
+
readonly "mention.delegate_started": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
|
|
40
|
+
readonly "mention.delegate_activity": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision"];
|
|
41
|
+
readonly "mention.delegate_settled": readonly ["parentSessionId", "parentMessageId", "bindingId", "executionSessionId", "delegationId", "sequence", "providerId", "revision", "status"];
|
|
42
|
+
};
|
|
43
|
+
readonly terminalStates: readonly ["completed", "failed", "cancelled"];
|
|
44
|
+
};
|
|
45
|
+
export declare const AGENT_CONTRACT_HASH: "23e967b8afdc32d4f8663cf50a1e86e07e658b4d63a6c657f043b62be0c81ec3";
|
|
46
|
+
export interface AgentContractIdentity {
|
|
47
|
+
version: typeof AGENT_CONTRACT_VERSION;
|
|
48
|
+
hash: typeof AGENT_CONTRACT_HASH;
|
|
49
|
+
}
|
|
50
|
+
export declare const AGENT_CONTRACT_IDENTITY: AgentContractIdentity;
|