@atlaswork/atlascode 0.1.126 → 0.1.128
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/atlasweb-carrier.json +3 -3
- package/dist/cli.js +31 -7
- package/dist/web-contract/index.d.ts +8 -0
- package/dist/web-contract/index.js +5 -2
- package/dist/web-session-runtime/atlascode/web/limits.d.ts +2 -0
- package/dist/web-session-runtime/atlascode/web/projection.d.ts +6 -0
- package/dist/web-session-runtime/atlascode/web/readonlyRuntime.d.ts +24 -0
- package/dist/web-session-runtime/atlascode/web/replayPaging.d.ts +27 -0
- package/dist/web-session-runtime/engine/session/load.d.ts +47 -0
- package/dist/web-session-runtime/engine/session/predicates.d.ts +1 -1
- package/dist/web-session-runtime/engine/session/readonly.d.ts +2 -0
- package/dist/web-session-runtime/engine/session/replayScan.d.ts +45 -0
- package/dist/web-session-runtime/engine/session/types.d.ts +1 -1
- package/dist/web-session-runtime/index.js +373 -4
- package/dist/web-session-runtime/kernel/protocol/webSessionV0.d.ts +8 -0
- package/dist/web-session-runtime/shared/index.d.ts +1 -1
- package/dist/web-session-runtime-execution/atlascode/web/entry.d.ts +2 -0
- package/dist/web-session-runtime-execution/atlascode/web/limits.d.ts +2 -0
- package/dist/web-session-runtime-execution/atlascode/web/projection.d.ts +6 -0
- package/dist/web-session-runtime-execution/atlascode/web/readonlyRuntime.d.ts +24 -0
- package/dist/web-session-runtime-execution/atlascode/web/replayPaging.d.ts +27 -0
- package/dist/web-session-runtime-execution/engine/session/load.d.ts +47 -0
- package/dist/web-session-runtime-execution/engine/session/predicates.d.ts +1 -1
- package/dist/web-session-runtime-execution/engine/session/readonly.d.ts +2 -0
- package/dist/web-session-runtime-execution/engine/session/replayScan.d.ts +45 -0
- package/dist/web-session-runtime-execution/engine/session/types.d.ts +1 -1
- package/dist/web-session-runtime-execution/index.js +662 -8
- package/dist/web-session-runtime-execution/kernel/execution/executionComposition.d.ts +18 -0
- package/dist/web-session-runtime-execution/kernel/execution/executionKernel.d.ts +77 -0
- package/dist/web-session-runtime-execution/kernel/protocol/webSessionV0.d.ts +8 -0
- package/dist/web-session-runtime-execution/shared/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/web-session-runtime/atlascode/web/entry.d.ts +0 -21
- package/dist/web-session-runtime/atlascode/web/executionOutlet.d.ts +0 -60
- package/dist/web-session-runtime/kernel/execution/executionOutlet.d.ts +0 -60
- package/dist/web-session-runtime/kernel/protocol/webExecutionV0.d.ts +0 -542
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ExecutionTurnRunner } from './executionKernel.js';
|
|
2
|
+
/**
|
|
3
|
+
* B1 前置件形 2(f4 附条件采认 @2026-11-21):注入形转正。
|
|
4
|
+
* - 零参默认行为零变更(CLI 双车道回归腿):runTurn 占位 fail-closed 抛错
|
|
5
|
+
* + actorId ambient——CLI 车道自身不服务 web 执行,占位语义保留。
|
|
6
|
+
* - host 侧(AtlasWeb upstream.ts,单接触点)经注入面传 runTurn 真体 +
|
|
7
|
+
* actorId 真源(已认证连接身份)。
|
|
8
|
+
*/
|
|
9
|
+
export type ExecutionCompositionOptions = {
|
|
10
|
+
runTurn?: ExecutionTurnRunner;
|
|
11
|
+
actorId?: () => string;
|
|
12
|
+
now?: () => number;
|
|
13
|
+
};
|
|
14
|
+
export declare function createExecutionComposition(options?: ExecutionCompositionOptions): {
|
|
15
|
+
kernel: import("./executionKernel.js").ExecutionKernel;
|
|
16
|
+
outlet: import("./executionOutlet.js").ExecutionOutlet;
|
|
17
|
+
};
|
|
18
|
+
export type ExecutionComposition = ReturnType<typeof createExecutionComposition>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kernel 执行域 —— B0 执行出口波 S3(呈批书 §2 S3 + f4 批复 @a62925c0)。
|
|
3
|
+
* 合同 docs/superpowers/specs/2026-11-20-first-wave-execution-contract.md
|
|
4
|
+
* §3(提交幂等)/§4(状态机与真取消)/§5(审批决策证据)/§2(bind/cursor)/
|
|
5
|
+
* §8(上限:队列 16 / 300s / 2 MiB / 10 000 / 并发 1)。
|
|
6
|
+
*
|
|
7
|
+
* 职责边界:
|
|
8
|
+
* - 上游执法唯一点:幂等键 (workspaceId, sessionId, submitId) 结算重放、
|
|
9
|
+
* 有界 FIFO 队列、并发 1、真取消(queued 不启动 / running 引擎真中止)、
|
|
10
|
+
* 待批 300s 超时 → expired、decide 归属绑定(bind.turnId ≡ 审批归属 turn)、
|
|
11
|
+
* follow 事件缓冲溢出 → 错误边界标记(S4 游标重同步消费)。
|
|
12
|
+
* - 事件流:cursor 每 (workspaceId, sessionId) 流单调递增(唯一排序权威);
|
|
13
|
+
* 事件恒携权威 bind 三元组(E2:结算只认三元组精确匹配的对偶面)。
|
|
14
|
+
* - 引擎缝:options.runTurn 注入(组合根 S4 接线);kernel 不 import 引擎面
|
|
15
|
+
* (加载图惰性同 executionOutlet 纪律)。
|
|
16
|
+
* - follow.resume 命令面 = S4(本切片返回 notImplemented 边界错误)。
|
|
17
|
+
* - 审计读门(turnStates / bufferState)公开为测试与运维只读面。
|
|
18
|
+
*/
|
|
19
|
+
import type { ExecutionReplay, WebExecutionCommand, WebExecutionError, WebExecutionEvent } from '../protocol/webExecutionV0.js';
|
|
20
|
+
export declare const EXECUTION_QUEUE_DEPTH = 16;
|
|
21
|
+
export declare const EXECUTION_APPROVAL_TIMEOUT_MS = 300000;
|
|
22
|
+
export declare const EXECUTION_MAX_TEXT_BYTES: number;
|
|
23
|
+
export declare const EXECUTION_FOLLOW_BUFFER_LIMIT = 10000;
|
|
24
|
+
/** 单 delta 块字节上限(合同 §8,f4 归属裁定 @2f8a716:kernel 入口执法,禁静默截断)。 */
|
|
25
|
+
export declare const EXECUTION_MAX_DELTA_BYTES: number;
|
|
26
|
+
export type ExecutionTurnOutcome = 'completed' | 'failed' | 'cancelled';
|
|
27
|
+
export type ExecutionApprovalDecision = 'approved' | 'denied' | 'expired' | 'voidedByCancel';
|
|
28
|
+
export type ExecutionTurnRunnerDeps = {
|
|
29
|
+
bind: {
|
|
30
|
+
workspaceId: string;
|
|
31
|
+
sessionId: string;
|
|
32
|
+
turnId: string;
|
|
33
|
+
};
|
|
34
|
+
text: string;
|
|
35
|
+
signal: AbortSignal;
|
|
36
|
+
/** 注册待批操作:resolve 于 decide / 300s expired / turn 取消(voidedByCancel)。 */
|
|
37
|
+
requestApproval: () => Promise<ExecutionApprovalDecision>;
|
|
38
|
+
/**
|
|
39
|
+
* 回合流增量发射(B1 前置件形 1,f4 附条件采认 @2026-11-21):经 kernel
|
|
40
|
+
* 既有 emit 权威落 `turn.delta`(cursor 单调/bind 三元组/缓冲上限同执法,
|
|
41
|
+
* 零新执法面)。text = 回合流内容,不进审批证据记录(合同 §5 不含正文)。
|
|
42
|
+
*/
|
|
43
|
+
emitDelta: (text: string) => void;
|
|
44
|
+
};
|
|
45
|
+
export type ExecutionTurnRunner = (deps: ExecutionTurnRunnerDeps) => Promise<ExecutionTurnOutcome>;
|
|
46
|
+
export type ExecutionKernelOptions = {
|
|
47
|
+
runTurn: ExecutionTurnRunner;
|
|
48
|
+
/** 服务端时钟(§5:timestamp 由服务端产生;测试注入)。 */
|
|
49
|
+
now?: () => number;
|
|
50
|
+
/** 服务端解析的连接身份(§5:actorId 客户端自报不得覆盖;组合根注入)。 */
|
|
51
|
+
actorId?: () => string;
|
|
52
|
+
queueDepth?: number;
|
|
53
|
+
approvalTimeoutMs?: number;
|
|
54
|
+
maxTextBytes?: number;
|
|
55
|
+
followBufferLimit?: number;
|
|
56
|
+
};
|
|
57
|
+
export type ExecutionKernelHandleResult = WebExecutionEvent | WebExecutionError;
|
|
58
|
+
type TurnState = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
59
|
+
/**
|
|
60
|
+
* §6 follow 恢复原语(S4)——结果型 ExecutionReplay 归协议文件
|
|
61
|
+
* (webExecutionV0),本域只执语义。
|
|
62
|
+
*/
|
|
63
|
+
export type ExecutionKernel = {
|
|
64
|
+
handleCommand: (command: WebExecutionCommand) => Promise<ExecutionKernelHandleResult>;
|
|
65
|
+
/** §6 恢复原语:follow.resume 的 kernel 侧真体(增量恰一次/过期基线替换)。 */
|
|
66
|
+
replaySince: (workspaceId: string, sessionId: string, cursor?: string) => ExecutionReplay;
|
|
67
|
+
onEvent: (cb: (e: WebExecutionEvent) => void) => () => void;
|
|
68
|
+
/** 审计读门:turnId → 状态(queued/running/终态恰一个)。 */
|
|
69
|
+
turnStates: Map<string, TurnState>;
|
|
70
|
+
/** 审计读门:follow 缓冲态(overflowed = 错误边界标记,S4 游标重同步消费)。 */
|
|
71
|
+
bufferState: (workspaceId: string, sessionId: string) => {
|
|
72
|
+
overflowed: boolean;
|
|
73
|
+
kept: number;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare function createExecutionKernel(options: ExecutionKernelOptions): ExecutionKernel;
|
|
77
|
+
export {};
|
|
@@ -45,6 +45,8 @@ export declare const SearchSessionsRequestSchema: z.ZodObject<{
|
|
|
45
45
|
scopeId: z.ZodString;
|
|
46
46
|
}, z.core.$strict>;
|
|
47
47
|
export declare const ReplaySessionRequestSchema: z.ZodObject<{
|
|
48
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
48
50
|
kind: z.ZodLiteral<"replaySession">;
|
|
49
51
|
sessionId: z.ZodString;
|
|
50
52
|
schemaVersion: z.ZodLiteral<0>;
|
|
@@ -96,6 +98,8 @@ export declare const WebSessionRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
96
98
|
productId: z.ZodString;
|
|
97
99
|
scopeId: z.ZodString;
|
|
98
100
|
}, z.core.$strict>, z.ZodObject<{
|
|
101
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
99
103
|
kind: z.ZodLiteral<"replaySession">;
|
|
100
104
|
sessionId: z.ZodString;
|
|
101
105
|
schemaVersion: z.ZodLiteral<0>;
|
|
@@ -329,6 +333,8 @@ export declare const ReplaySessionSuccessSchema: z.ZodObject<{
|
|
|
329
333
|
}, z.core.$strict>>;
|
|
330
334
|
truncated: z.ZodLiteral<false>;
|
|
331
335
|
}, z.core.$strict>;
|
|
336
|
+
hasMore: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
332
338
|
schemaVersion: z.ZodLiteral<0>;
|
|
333
339
|
requestId: z.ZodUUID;
|
|
334
340
|
productId: z.ZodString;
|
|
@@ -401,6 +407,8 @@ export declare const WebSessionSuccessSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
401
407
|
}, z.core.$strict>>;
|
|
402
408
|
truncated: z.ZodLiteral<false>;
|
|
403
409
|
}, z.core.$strict>;
|
|
410
|
+
hasMore: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
+
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
404
412
|
schemaVersion: z.ZodLiteral<0>;
|
|
405
413
|
requestId: z.ZodUUID;
|
|
406
414
|
productId: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* shared 模块唯一公共出口(STR-1 门面规则)。
|
|
3
3
|
*
|
|
4
|
-
* 外部模块只许 `import { ... } from "../shared.js"`(或 "src/shared"),
|
|
4
|
+
* 外部模块只许 `import { ... } from "../shared/index.js"`(或 "src/shared"),
|
|
5
5
|
* 不许 reach 内部文件(entry-point lint 拦截)。
|
|
6
6
|
*
|
|
7
7
|
* re-export: feature(A 波已实现)/ types / types-session /
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaswork/atlascode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.128",
|
|
4
4
|
"description": "AtlasCode — Coding Agent for the domestic computing ecosystem (Ascend NPU + domestic LLM backends)",
|
|
5
5
|
"homepage": "https://www.atlaswork.cn/",
|
|
6
6
|
"bin": {
|
|
@@ -122,4 +122,4 @@
|
|
|
122
122
|
"typescript": "^5.9.3",
|
|
123
123
|
"typescript-eslint": "^8"
|
|
124
124
|
}
|
|
125
|
-
}
|
|
125
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AtlasWeb S0-R `./web-session-runtime` pack 出口(工单 §4.5)。
|
|
3
|
-
*
|
|
4
|
-
* 纯 re-export 面:零副作用(禁入口导入就跑 CLI)、零 TUI/private TSX
|
|
5
|
-
* 泄漏(加载图审计);声明只依赖 contract 公开类型(经 ./contract 相对
|
|
6
|
-
* shim)。
|
|
7
|
-
* S0-R2 形 A(lock-face @25cb7454 §1/§2,f4 批复工单 §7 @351c74c4):本出口
|
|
8
|
-
* 扩具名导出 `createDefaultReadonlySessionRuntime`(engine 真体随 bundle,
|
|
9
|
-
* pack 格重形 = engine/session 只读闭包允许);注入缝
|
|
10
|
-
* (createReadonlySessionRuntime options.engine)保留不动(预答不变量)。
|
|
11
|
-
* 内部面不入出口:atlasWebSessionEngine / buildConversationChain /
|
|
12
|
-
* TranscriptMessage(d.ts 泄漏面钉②)。
|
|
13
|
-
*/
|
|
14
|
-
export { createReadonlySessionRuntime, type ReadonlySessionRuntime, type ReadonlySessionRuntimeOptions, type ReadonlySessionEngine, type ReadonlySessionScopes, type ReadonlySessionLimits, type ResolvedLimits, type ListSessionsRequest, type ListSessionsResult, type ReplaySessionRequest, type ReplaySessionResult, type FollowSessionRequest, type FollowSubscription, type SearchSessionsRequest, type SearchSessionsResult, } from './readonlyRuntime.js';
|
|
15
|
-
export { createDefaultReadonlySessionRuntime, type AtlasWebSessionRuntimeOptions, } from './runtimeDefault.js';
|
|
16
|
-
export type { FollowHandle } from './follow.js';
|
|
17
|
-
export type { SessionStoreAdapter, SessionStoreScopes, SessionFileEntry, TranscriptStat, TranscriptTail, } from './sessionStoreAdapter.js';
|
|
18
|
-
export type { NeutralProjection, NeutralProjectionMessage, NeutralBlock, ProjectionSourceMessage, ProjectionEngineDeps, ProjectionLoad, } from './projection.js';
|
|
19
|
-
export { WebSessionError, type WebSessionErrorCode } from './errors.js';
|
|
20
|
-
export { createExecutionOutlet, type ExecutionOutlet, type ExecutionOutletOptions, type ExecutionDispatchResult, type WebExecutionProbeResult, } from '../../kernel/execution/executionOutlet.js';
|
|
21
|
-
export { EXECUTION_SCHEMA_VERSION, EXECUTION_PROTOCOL_VERSION, EXECUTION_CAPABILITY_DISABLED_CODE, WebExecutionCommandSchema, WebExecutionEventSchema, WebExecutionErrorSchema, ExecutionBindSchema, type ExecutionBind, type ExecutionReplay, type WebExecutionCommand, type WebExecutionEvent, type WebExecutionError, } from '../../kernel/protocol/webExecutionV0.js';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 执行出口 —— B0 执行出口波 S2(呈批书 §2 S2 + f4 批复条件①②)。
|
|
3
|
-
* 合同 docs/superpowers/specs/2026-11-20-first-wave-execution-contract.md
|
|
4
|
-
* §2(六命令)/ §7(组合根恰一次注入、单接触点)。
|
|
5
|
-
*
|
|
6
|
-
* 设计约束:
|
|
7
|
-
* - 懒触达(E1 增格,f4 批复条件②):createExecutionOutlet 构造零副作用、
|
|
8
|
-
* 不 boot kernel;能力开关默认 off(fail-closed),off 下六命令任一 = 拒
|
|
9
|
-
* (capabilityDisabled)且内核零痕迹(dispatch 零触达)。
|
|
10
|
-
* - kernel 侧能力开关落点 = options.isExecutionEnabled(组合根注入;
|
|
11
|
-
* probe 查询经此读门,泄露面仅 on/off + 受支持 v,合同 §2 审计登记 b)。
|
|
12
|
-
* - 薄适配:enabled 命令经 options.dispatchCommand 原样透传 kernel 命令面,
|
|
13
|
-
* 事件/错误原样上抛——不重写排序(cursor 唯一权威)、不改结算、
|
|
14
|
-
* §3 幂等与 §4/§5/§8 上限执法全归 kernel 侧(S3)。
|
|
15
|
-
* - 单接触点(条件①):本文件是 src 面唯一 createExecutionOutlet 定义点;
|
|
16
|
-
* 消费面仅 entry.ts 扩具名导出(符号级扫描腿机器判)。
|
|
17
|
-
* - 本文件 import 面 = webExecutionV0 唯一(零 engine/kernel 状态导入,
|
|
18
|
-
* 懒触达由加载图保证,非仅运行时纪律)。
|
|
19
|
-
*/
|
|
20
|
-
import { EXECUTION_PROTOCOL_VERSION, type ExecutionReplay, type WebExecutionCommand, type WebExecutionError, type WebExecutionEvent } from '../../kernel/protocol/webExecutionV0.js';
|
|
21
|
-
/** capability.probe 应答:泄露面仅 on/off + 受支持 v(合同 §2 审计登记 b)。 */
|
|
22
|
-
export type WebExecutionProbeResult = {
|
|
23
|
-
type: 'capability.probe';
|
|
24
|
-
enabled: boolean;
|
|
25
|
-
protocolVersion: typeof EXECUTION_PROTOCOL_VERSION;
|
|
26
|
-
};
|
|
27
|
-
export type ExecutionDispatchResult = WebExecutionEvent | WebExecutionError;
|
|
28
|
-
export type ExecutionOutletOptions = {
|
|
29
|
-
/** kernel 侧能力开关读门(默认 off = fail-closed;组合根注入,S3 接线)。 */
|
|
30
|
-
isExecutionEnabled?: () => boolean;
|
|
31
|
-
/** kernel 命令面薄适配(唯一 kernel 触达缝;事件/错误原样上抛)。 */
|
|
32
|
-
dispatchCommand: (command: WebExecutionCommand) => Promise<ExecutionDispatchResult>;
|
|
33
|
-
/**
|
|
34
|
-
* §6 follow 恢复缝(S4):kernel.replaySince 直通(不经 dispatch)。
|
|
35
|
-
* 缺省 = off 车道恒拒。
|
|
36
|
-
*/
|
|
37
|
-
resumeExecution?: (bind: {
|
|
38
|
-
workspaceId: string;
|
|
39
|
-
sessionId: string;
|
|
40
|
-
}, cursor?: string) => ExecutionReplay;
|
|
41
|
-
};
|
|
42
|
-
export type ExecutionHandleResult = ExecutionDispatchResult | WebExecutionProbeResult;
|
|
43
|
-
export type ExecutionOutlet = {
|
|
44
|
-
/** 能力探针:不经 dispatch(kernel 零痕迹),仅读门求值。 */
|
|
45
|
-
probe: () => WebExecutionProbeResult;
|
|
46
|
-
/**
|
|
47
|
-
* 六命令统一入口:probe=off 下 probe 外五命令一律 capabilityDisabled 拒
|
|
48
|
-
* 且 dispatch 零触达;on 下薄适配透传。
|
|
49
|
-
*/
|
|
50
|
-
handle: (command: WebExecutionCommand) => Promise<ExecutionHandleResult>;
|
|
51
|
-
/**
|
|
52
|
-
* §6 follow 恢复(S4):off = capabilityDisabled 拒且内核零痕迹;on =
|
|
53
|
-
* kernel.replaySince 透传(baseline/delta/expired 三态,增量恰一次)。
|
|
54
|
-
*/
|
|
55
|
-
followResume: (bind: {
|
|
56
|
-
workspaceId: string;
|
|
57
|
-
sessionId: string;
|
|
58
|
-
}, cursor?: string) => ExecutionReplay | WebExecutionError;
|
|
59
|
-
};
|
|
60
|
-
export declare function createExecutionOutlet(options: ExecutionOutletOptions): ExecutionOutlet;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 执行出口 —— B0 执行出口波 S2(呈批书 §2 S2 + f4 批复条件①②)。
|
|
3
|
-
* 合同 docs/superpowers/specs/2026-11-20-first-wave-execution-contract.md
|
|
4
|
-
* §2(六命令)/ §7(组合根恰一次注入、单接触点)。
|
|
5
|
-
*
|
|
6
|
-
* 设计约束:
|
|
7
|
-
* - 懒触达(E1 增格,f4 批复条件②):createExecutionOutlet 构造零副作用、
|
|
8
|
-
* 不 boot kernel;能力开关默认 off(fail-closed),off 下六命令任一 = 拒
|
|
9
|
-
* (capabilityDisabled)且内核零痕迹(dispatch 零触达)。
|
|
10
|
-
* - kernel 侧能力开关落点 = options.isExecutionEnabled(组合根注入;
|
|
11
|
-
* probe 查询经此读门,泄露面仅 on/off + 受支持 v,合同 §2 审计登记 b)。
|
|
12
|
-
* - 薄适配:enabled 命令经 options.dispatchCommand 原样透传 kernel 命令面,
|
|
13
|
-
* 事件/错误原样上抛——不重写排序(cursor 唯一权威)、不改结算、
|
|
14
|
-
* §3 幂等与 §4/§5/§8 上限执法全归 kernel 侧(S3)。
|
|
15
|
-
* - 单接触点(条件①):本文件是 src 面唯一 createExecutionOutlet 定义点;
|
|
16
|
-
* 消费面仅 entry.ts 扩具名导出(符号级扫描腿机器判)。
|
|
17
|
-
* - 本文件 import 面 = webExecutionV0 唯一(零 engine/kernel 状态导入,
|
|
18
|
-
* 懒触达由加载图保证,非仅运行时纪律)。
|
|
19
|
-
*/
|
|
20
|
-
import { EXECUTION_PROTOCOL_VERSION, type ExecutionReplay, type WebExecutionCommand, type WebExecutionError, type WebExecutionEvent } from '../protocol/webExecutionV0.js';
|
|
21
|
-
/** capability.probe 应答:泄露面仅 on/off + 受支持 v(合同 §2 审计登记 b)。 */
|
|
22
|
-
export type WebExecutionProbeResult = {
|
|
23
|
-
type: 'capability.probe';
|
|
24
|
-
enabled: boolean;
|
|
25
|
-
protocolVersion: typeof EXECUTION_PROTOCOL_VERSION;
|
|
26
|
-
};
|
|
27
|
-
export type ExecutionDispatchResult = WebExecutionEvent | WebExecutionError;
|
|
28
|
-
export type ExecutionOutletOptions = {
|
|
29
|
-
/** kernel 侧能力开关读门(默认 off = fail-closed;组合根注入,S3 接线)。 */
|
|
30
|
-
isExecutionEnabled?: () => boolean;
|
|
31
|
-
/** kernel 命令面薄适配(唯一 kernel 触达缝;事件/错误原样上抛)。 */
|
|
32
|
-
dispatchCommand: (command: WebExecutionCommand) => Promise<ExecutionDispatchResult>;
|
|
33
|
-
/**
|
|
34
|
-
* §6 follow 恢复缝(S4):kernel.replaySince 直通(不经 dispatch)。
|
|
35
|
-
* 缺省 = off 车道恒拒。
|
|
36
|
-
*/
|
|
37
|
-
resumeExecution?: (bind: {
|
|
38
|
-
workspaceId: string;
|
|
39
|
-
sessionId: string;
|
|
40
|
-
}, cursor?: string) => ExecutionReplay;
|
|
41
|
-
};
|
|
42
|
-
export type ExecutionHandleResult = ExecutionDispatchResult | WebExecutionProbeResult;
|
|
43
|
-
export type ExecutionOutlet = {
|
|
44
|
-
/** 能力探针:不经 dispatch(kernel 零痕迹),仅读门求值。 */
|
|
45
|
-
probe: () => WebExecutionProbeResult;
|
|
46
|
-
/**
|
|
47
|
-
* 六命令统一入口:probe=off 下 probe 外五命令一律 capabilityDisabled 拒
|
|
48
|
-
* 且 dispatch 零触达;on 下薄适配透传。
|
|
49
|
-
*/
|
|
50
|
-
handle: (command: WebExecutionCommand) => Promise<ExecutionHandleResult>;
|
|
51
|
-
/**
|
|
52
|
-
* §6 follow 恢复(S4):off = capabilityDisabled 拒且内核零痕迹;on =
|
|
53
|
-
* kernel.replaySince 透传(baseline/delta/expired 三态,增量恰一次)。
|
|
54
|
-
*/
|
|
55
|
-
followResume: (bind: {
|
|
56
|
-
workspaceId: string;
|
|
57
|
-
sessionId: string;
|
|
58
|
-
}, cursor?: string) => ExecutionReplay | WebExecutionError;
|
|
59
|
-
};
|
|
60
|
-
export declare function createExecutionOutlet(options: ExecutionOutletOptions): ExecutionOutlet;
|