@zhushanwen/subagent-engine-sdk 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{chunk-F7VDVSBZ.js → chunk-CNCFMPEH.js} +1 -1
  2. package/dist/{chunk-MQPASWMA.js → chunk-HSNDUHFH.js} +1 -1
  3. package/dist/{chunk-SFNTX7Q3.js → chunk-JZN76I3S.js} +31 -12
  4. package/dist/{chunk-DIIYVO4O.js → chunk-LM7P7OTA.js} +2 -1
  5. package/dist/{chunk-3WC36CHI.js → chunk-NTOLHLCL.js} +1 -1
  6. package/dist/{contract-types-DqOD58r-.d.cts → contract-types-jSa1g28F.d.cts} +37 -2
  7. package/dist/{contract-types-DqOD58r-.d.ts → contract-types-jSa1g28F.d.ts} +37 -2
  8. package/dist/error-codes-DnFru4L4.d.ts +150 -0
  9. package/dist/error-codes-f-UO4a8D.d.cts +150 -0
  10. package/dist/index.cjs +38 -15
  11. package/dist/index.d.cts +4 -3
  12. package/dist/index.d.ts +4 -3
  13. package/dist/index.js +15 -9
  14. package/dist/journal-io.d.cts +1 -1
  15. package/dist/journal-io.d.ts +1 -1
  16. package/dist/journal-replay.d.cts +1 -1
  17. package/dist/journal-replay.d.ts +1 -1
  18. package/dist/kill-chain.cjs +26 -0
  19. package/dist/kill-chain.d.cts +1 -1
  20. package/dist/kill-chain.d.ts +1 -1
  21. package/dist/kill-chain.js +2 -2
  22. package/dist/{error-codes-CiDwaODz.d.ts → methods-BLxg4ZFr.d.cts} +46 -120
  23. package/dist/{error-codes-C3oVToMr.d.cts → methods-C2zvZqhP.d.ts} +46 -120
  24. package/dist/node-executor.cjs +26 -0
  25. package/dist/node-executor.js +2 -2
  26. package/dist/port-contract.d.cts +11 -1
  27. package/dist/port-contract.d.ts +11 -1
  28. package/dist/protocol/index.cjs +38 -15
  29. package/dist/protocol/index.d.cts +20 -8
  30. package/dist/protocol/index.d.ts +20 -8
  31. package/dist/protocol/index.js +12 -6
  32. package/dist/server/index.cjs +26 -0
  33. package/dist/server/index.d.cts +4 -3
  34. package/dist/server/index.d.ts +4 -3
  35. package/dist/server/index.js +1 -1
  36. package/dist/spawn.cjs +28 -0
  37. package/dist/spawn.js +3 -3
  38. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -6574,8 +6574,6 @@ var src_exports = {};
6574
6574
  __export(src_exports, {
6575
6575
  AGENT_EVENT_TYPE_NAMES: () => AGENT_EVENT_TYPE_NAMES,
6576
6576
  CANCEL_SETTLE_GRACE_MS: () => CANCEL_SETTLE_GRACE_MS,
6577
- CRASH_REBUILD_BACKOFF_MS: () => CRASH_REBUILD_BACKOFF_MS,
6578
- CRASH_REBUILD_MAX_ATTEMPTS: () => CRASH_REBUILD_MAX_ATTEMPTS,
6579
6577
  DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS: () => DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS,
6580
6578
  DEFAULT_KILL_GRACE_MS: () => DEFAULT_KILL_GRACE_MS,
6581
6579
  DEFAULT_NATIVE_INTERRUPT_GRACE_MS: () => DEFAULT_NATIVE_INTERRUPT_GRACE_MS,
@@ -6614,6 +6612,10 @@ __export(src_exports, {
6614
6612
  REVERSE_CHANNEL_TIMEOUT_CLASS: () => REVERSE_CHANNEL_TIMEOUT_CLASS,
6615
6613
  REVERSE_REQUEST_TIMEOUT_MS: () => REVERSE_REQUEST_TIMEOUT_MS,
6616
6614
  SCHEMA_EMULATION_TAIL_CHARS: () => SCHEMA_EMULATION_TAIL_CHARS,
6615
+ SET_MODEL_ERROR_CODES: () => SET_MODEL_ERROR_CODES,
6616
+ SET_MODEL_NOT_ACTIVE_CODE: () => SET_MODEL_NOT_ACTIVE_CODE,
6617
+ SET_MODEL_REQUEST_TIMEOUT_MS: () => SET_MODEL_REQUEST_TIMEOUT_MS,
6618
+ SET_MODEL_STAGE_TIMEOUT_MS: () => SET_MODEL_STAGE_TIMEOUT_MS,
6617
6619
  SHARED_POOL_KEY: () => SHARED_POOL_KEY,
6618
6620
  STDERR_TAIL_CHARS: () => STDERR_TAIL_CHARS,
6619
6621
  STDOUT_TAIL_ECHO_CHARS: () => STDOUT_TAIL_ECHO_CHARS,
@@ -6639,6 +6641,7 @@ __export(src_exports, {
6639
6641
  createUiChannelRegistry: () => createUiChannelRegistry,
6640
6642
  engineConversationUnsupportedError: () => engineConversationUnsupportedError,
6641
6643
  engineProtocolMismatchError: () => engineProtocolMismatchError,
6644
+ engineSetModelUnsupportedError: () => engineSetModelUnsupportedError,
6642
6645
  engineTimeoutDetail: () => engineTimeoutDetail,
6643
6646
  errorResponseFrameSchema: () => errorResponseFrameSchema,
6644
6647
  eventsToSessionView: () => eventsToSessionView,
@@ -6705,15 +6708,8 @@ function isProtocolVersionCompatible(version) {
6705
6708
  var REVERSE_REQUEST_TIMEOUT_MS = 1e4;
6706
6709
  var HANDSHAKE_TIMEOUT_MS = 1e4;
6707
6710
  var CANCEL_SETTLE_GRACE_MS = 3e3;
6708
- var CRASH_REBUILD_MAX_ATTEMPTS = 3;
6709
- var CRASH_REBUILD_BACKOFF_STEP_1_MS = 1e3;
6710
- var CRASH_REBUILD_BACKOFF_STEP_2_MS = 2e3;
6711
- var CRASH_REBUILD_BACKOFF_STEP_3_MS = 4e3;
6712
- var CRASH_REBUILD_BACKOFF_MS = [
6713
- CRASH_REBUILD_BACKOFF_STEP_1_MS,
6714
- CRASH_REBUILD_BACKOFF_STEP_2_MS,
6715
- CRASH_REBUILD_BACKOFF_STEP_3_MS
6716
- ];
6711
+ var SET_MODEL_STAGE_TIMEOUT_MS = 3e3;
6712
+ var SET_MODEL_REQUEST_TIMEOUT_MS = 1e4;
6717
6713
  var STDERR_TAIL_CHARS = 400;
6718
6714
 
6719
6715
  // src/protocol/frames.ts
@@ -6748,7 +6744,8 @@ var PROTOCOL_METHODS = [
6748
6744
  "listModels",
6749
6745
  "validateModel",
6750
6746
  "dispose",
6751
- "ping"
6747
+ "ping",
6748
+ "setModel"
6752
6749
  ];
6753
6750
 
6754
6751
  // src/protocol/reverse-channels.ts
@@ -6770,6 +6767,19 @@ var REVERSE_CHANNEL_TIMEOUT_CLASS = {
6770
6767
  };
6771
6768
 
6772
6769
  // src/protocol/error-codes.ts
6770
+ var SET_MODEL_ERROR_CODES = [
6771
+ /** 目标模型不在当前进程快照(子进程模型快照冻结于 spawn 时刻——模型本身有效,
6772
+ * 下一轮 spawn 现取目录即可用;宿主按「写覆盖意图」处置,设计 §7.2 快照型失败行)。 */
6773
+ "engine_model_not_in_snapshot",
6774
+ /** 凭据校验失败(子进程 set_model checkAuth 抛错——宿主预检通过后 registry 态漂移
6775
+ * 的权威兜底;宿主按校验型失败处置,设计 §7.5 凭据行)。 */
6776
+ "engine_credential_missing",
6777
+ /** 命令已发出(set_model 可能已执行)但读应答 / get_state 回读无回执、生效值未知
6778
+ * (非进程退出情形——退出归无活进程路径;宿主按「写覆盖意图 + 错误应答」处置,
6779
+ * 设计 §7.5 回读失败行)。 */
6780
+ "engine_state_readback_failed"
6781
+ ];
6782
+ var SET_MODEL_NOT_ACTIVE_CODE = "engine_run_not_active";
6773
6783
  var ENGINE_PROTOCOL_ERROR_CODES = [
6774
6784
  "engine_not_found",
6775
6785
  "engine_protocol_mismatch",
@@ -6779,7 +6789,9 @@ var ENGINE_PROTOCOL_ERROR_CODES = [
6779
6789
  "engine_model_mismatch",
6780
6790
  "engine_handshake_timeout",
6781
6791
  "engine_crashed",
6782
- "engine_probe_failed"
6792
+ "engine_probe_failed",
6793
+ ...SET_MODEL_ERROR_CODES,
6794
+ SET_MODEL_NOT_ACTIVE_CODE
6783
6795
  ];
6784
6796
  function isEngineProtocolErrorCode(value) {
6785
6797
  return typeof value === "string" && ENGINE_PROTOCOL_ERROR_CODES.includes(value);
@@ -6829,6 +6841,14 @@ function assertChatConversationSupported(engineId, capabilities) {
6829
6841
  throw engineConversationUnsupportedError(engineId);
6830
6842
  }
6831
6843
  }
6844
+ function engineSetModelUnsupportedError(engineId, declared) {
6845
+ return new EngineSdkError(
6846
+ "engine_capability_unsupported",
6847
+ `engine '${engineId}' does not support hot model switching (capabilities.setModel = ${declared ?? "unsupported (undeclared)"}); the host pre-check (design \xA77.2 step 2) must not dispatch setModel to it`,
6848
+ `Route the switch to an engine that declares capabilities.setModel = 'native', or record the override for the next run instead. If this engine actually supports hot switching, fix the manifest capabilities declaration.`,
6849
+ { engineId, capability: "setModel", declared: declared ?? "unsupported" }
6850
+ );
6851
+ }
6832
6852
  var DETAIL_ECHO_MAX_CHARS = 200;
6833
6853
  var STDOUT_TAIL_ECHO_CHARS = 2e3;
6834
6854
  function truncate(text, max) {
@@ -8404,8 +8424,6 @@ function runEngineCliEntry(opts) {
8404
8424
  0 && (module.exports = {
8405
8425
  AGENT_EVENT_TYPE_NAMES,
8406
8426
  CANCEL_SETTLE_GRACE_MS,
8407
- CRASH_REBUILD_BACKOFF_MS,
8408
- CRASH_REBUILD_MAX_ATTEMPTS,
8409
8427
  DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS,
8410
8428
  DEFAULT_KILL_GRACE_MS,
8411
8429
  DEFAULT_NATIVE_INTERRUPT_GRACE_MS,
@@ -8444,6 +8462,10 @@ function runEngineCliEntry(opts) {
8444
8462
  REVERSE_CHANNEL_TIMEOUT_CLASS,
8445
8463
  REVERSE_REQUEST_TIMEOUT_MS,
8446
8464
  SCHEMA_EMULATION_TAIL_CHARS,
8465
+ SET_MODEL_ERROR_CODES,
8466
+ SET_MODEL_NOT_ACTIVE_CODE,
8467
+ SET_MODEL_REQUEST_TIMEOUT_MS,
8468
+ SET_MODEL_STAGE_TIMEOUT_MS,
8447
8469
  SHARED_POOL_KEY,
8448
8470
  STDERR_TAIL_CHARS,
8449
8471
  STDOUT_TAIL_ECHO_CHARS,
@@ -8469,6 +8491,7 @@ function runEngineCliEntry(opts) {
8469
8491
  createUiChannelRegistry,
8470
8492
  engineConversationUnsupportedError,
8471
8493
  engineProtocolMismatchError,
8494
+ engineSetModelUnsupportedError,
8472
8495
  engineTimeoutDetail,
8473
8496
  errorResponseFrameSchema,
8474
8497
  eventsToSessionView,
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
- export { CANCEL_SETTLE_GRACE_MS, CRASH_REBUILD_BACKOFF_MS, CRASH_REBUILD_MAX_ATTEMPTS, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReverseChannel, ReverseRequestTimeoutClass, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.cjs';
2
- export { C as CancelParams, b as CancelResult, D as DisposeParams, c as DisposeResult, d as ENGINE_ERROR_CODE_PREFIX, e as ENGINE_PROTOCOL_ERROR_CODES, f as ENGINE_TIMEOUT_RECOVERY, g as EngineProtocolErrorCode, E as EngineSdkError, h as ErrorResponseFrame, i as EventNotificationParams, a as InitializeParams, I as InitializeResult, L as ListModelsParams, j as ListModelsResult, N as NotificationFrame, P as PROTOCOL_METHODS, k as PingParams, l as PingResult, m as ProbeParams, n as ProtocolError, o as ProtocolMethod, p as ProtocolParamsMap, q as ProtocolResultMap, r as ReadParams, s as RequestFrame, t as ResponseFrame, u as ReverseRequestFrame, v as ReverseResponseResult, R as RunContextParams, w as RunParams, x as RunResult, y as RunResumeParams, S as STDOUT_TAIL_ECHO_CHARS, z as SuccessResponseFrame, V as ValidateModelParams, A as ValidateModelResult, B as assertChatConversationSupported, F as engineConversationUnsupportedError, G as engineProtocolMismatchError, H as engineTimeoutDetail, J as isEngineErrorPassthroughCode, K as isEngineProtocolErrorCode, M as isNotificationFrame, O as isRequestFrame, Q as isResponseFrame, T as isReverseRequestFrame, U as schemaEmulationFailedDetail } from './error-codes-C3oVToMr.cjs';
3
- export { f as AGENT_EVENT_TYPE_NAMES, b as AgentCallOpts, A as AgentEvent, g as AgentEventTypeName, h as AgentFailureKind, c as AgentOutcome, i as AgentOutcomeUsage, j as AgentUsage, a as AgentUsageTotal, k as AssertMutuallyAssignable, d as EngineCapabilities, E as EngineHandleData, l as EngineProcessModel, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, e as ResumeAnchor, S as SessionView, m as ToolCall, n as ToolCallEntry, o as ToolCallResult, T as Turn, W as WorktreeHandle } from './contract-types-DqOD58r-.cjs';
1
+ export { CANCEL_SETTLE_GRACE_MS, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReverseChannel, ReverseRequestTimeoutClass, SET_MODEL_REQUEST_TIMEOUT_MS, SET_MODEL_STAGE_TIMEOUT_MS, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.cjs';
2
+ export { a as ENGINE_ERROR_CODE_PREFIX, b as ENGINE_PROTOCOL_ERROR_CODES, c as ENGINE_TIMEOUT_RECOVERY, d as EngineProtocolErrorCode, E as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as SET_MODEL_ERROR_CODES, j as SET_MODEL_NOT_ACTIVE_CODE, k as STDOUT_TAIL_ECHO_CHARS, l as SetModelErrorCode, m as SuccessResponseFrame, n as assertChatConversationSupported, o as engineConversationUnsupportedError, p as engineProtocolMismatchError, q as engineSetModelUnsupportedError, r as engineTimeoutDetail, s as isEngineErrorPassthroughCode, t as isEngineProtocolErrorCode, u as isNotificationFrame, v as isRequestFrame, w as isResponseFrame, x as isReverseRequestFrame, y as schemaEmulationFailedDetail } from './error-codes-f-UO4a8D.cjs';
3
+ export { C as CancelParams, c as CancelResult, D as DisposeParams, d as DisposeResult, b as InitializeParams, I as InitializeResult, L as ListModelsParams, e as ListModelsResult, P as PROTOCOL_METHODS, f as PingParams, g as PingResult, h as ProbeParams, i as ProtocolMethod, j as ProtocolParamsMap, k as ProtocolResultMap, l as ReadParams, R as RunContextParams, m as RunParams, n as RunResult, o as RunResumeParams, S as SetModelParams, a as SetModelResult, V as ValidateModelParams, p as ValidateModelResult } from './methods-BLxg4ZFr.cjs';
4
+ export { g as AGENT_EVENT_TYPE_NAMES, b as AgentCallOpts, A as AgentEvent, h as AgentEventTypeName, i as AgentFailureKind, c as AgentOutcome, j as AgentOutcomeUsage, k as AgentUsage, a as AgentUsageTotal, l as AssertMutuallyAssignable, d as EngineCapabilities, E as EngineHandleData, m as EngineProcessModel, I as InternalToolCall, f as ModelCatalogEntry, M as ModelRef, P as ProbeReport, R as ReplayedTurn, e as ResumeAnchor, S as SessionView, n as ToolCall, o as ToolCallEntry, p as ToolCallResult, T as Turn, W as WorktreeHandle } from './contract-types-jSa1g28F.cjs';
4
5
  export { SCHEMA_EMULATION_TAIL_CHARS, StructuredOutputResult, buildSchemaEmulationSegment, extractAndValidateStructuredOutput } from './schema-emulation.cjs';
5
6
  export { ExecutionNestingContext, ExecutionNestingState, NESTED_SPAWN_ENV, NestedSpawnRejectedError, SpawnEnv, assertNotNestedSpawn, buildNestedSpawnEnv } from './nesting-guard.cjs';
6
7
  export { CoreLogger, LogLevel, LoggerSink, configureLoggerSink, getLogger, resetLoggerSinkForTests } from './logger.cjs';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export { CANCEL_SETTLE_GRACE_MS, CRASH_REBUILD_BACKOFF_MS, CRASH_REBUILD_MAX_ATTEMPTS, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReverseChannel, ReverseRequestTimeoutClass, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.js';
2
- export { C as CancelParams, b as CancelResult, D as DisposeParams, c as DisposeResult, d as ENGINE_ERROR_CODE_PREFIX, e as ENGINE_PROTOCOL_ERROR_CODES, f as ENGINE_TIMEOUT_RECOVERY, g as EngineProtocolErrorCode, E as EngineSdkError, h as ErrorResponseFrame, i as EventNotificationParams, a as InitializeParams, I as InitializeResult, L as ListModelsParams, j as ListModelsResult, N as NotificationFrame, P as PROTOCOL_METHODS, k as PingParams, l as PingResult, m as ProbeParams, n as ProtocolError, o as ProtocolMethod, p as ProtocolParamsMap, q as ProtocolResultMap, r as ReadParams, s as RequestFrame, t as ResponseFrame, u as ReverseRequestFrame, v as ReverseResponseResult, R as RunContextParams, w as RunParams, x as RunResult, y as RunResumeParams, S as STDOUT_TAIL_ECHO_CHARS, z as SuccessResponseFrame, V as ValidateModelParams, A as ValidateModelResult, B as assertChatConversationSupported, F as engineConversationUnsupportedError, G as engineProtocolMismatchError, H as engineTimeoutDetail, J as isEngineErrorPassthroughCode, K as isEngineProtocolErrorCode, M as isNotificationFrame, O as isRequestFrame, Q as isResponseFrame, T as isReverseRequestFrame, U as schemaEmulationFailedDetail } from './error-codes-CiDwaODz.js';
3
- export { f as AGENT_EVENT_TYPE_NAMES, b as AgentCallOpts, A as AgentEvent, g as AgentEventTypeName, h as AgentFailureKind, c as AgentOutcome, i as AgentOutcomeUsage, j as AgentUsage, a as AgentUsageTotal, k as AssertMutuallyAssignable, d as EngineCapabilities, E as EngineHandleData, l as EngineProcessModel, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, e as ResumeAnchor, S as SessionView, m as ToolCall, n as ToolCallEntry, o as ToolCallResult, T as Turn, W as WorktreeHandle } from './contract-types-DqOD58r-.js';
1
+ export { CANCEL_SETTLE_GRACE_MS, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReverseChannel, ReverseRequestTimeoutClass, SET_MODEL_REQUEST_TIMEOUT_MS, SET_MODEL_STAGE_TIMEOUT_MS, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.js';
2
+ export { a as ENGINE_ERROR_CODE_PREFIX, b as ENGINE_PROTOCOL_ERROR_CODES, c as ENGINE_TIMEOUT_RECOVERY, d as EngineProtocolErrorCode, E as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as SET_MODEL_ERROR_CODES, j as SET_MODEL_NOT_ACTIVE_CODE, k as STDOUT_TAIL_ECHO_CHARS, l as SetModelErrorCode, m as SuccessResponseFrame, n as assertChatConversationSupported, o as engineConversationUnsupportedError, p as engineProtocolMismatchError, q as engineSetModelUnsupportedError, r as engineTimeoutDetail, s as isEngineErrorPassthroughCode, t as isEngineProtocolErrorCode, u as isNotificationFrame, v as isRequestFrame, w as isResponseFrame, x as isReverseRequestFrame, y as schemaEmulationFailedDetail } from './error-codes-DnFru4L4.js';
3
+ export { C as CancelParams, c as CancelResult, D as DisposeParams, d as DisposeResult, b as InitializeParams, I as InitializeResult, L as ListModelsParams, e as ListModelsResult, P as PROTOCOL_METHODS, f as PingParams, g as PingResult, h as ProbeParams, i as ProtocolMethod, j as ProtocolParamsMap, k as ProtocolResultMap, l as ReadParams, R as RunContextParams, m as RunParams, n as RunResult, o as RunResumeParams, S as SetModelParams, a as SetModelResult, V as ValidateModelParams, p as ValidateModelResult } from './methods-C2zvZqhP.js';
4
+ export { g as AGENT_EVENT_TYPE_NAMES, b as AgentCallOpts, A as AgentEvent, h as AgentEventTypeName, i as AgentFailureKind, c as AgentOutcome, j as AgentOutcomeUsage, k as AgentUsage, a as AgentUsageTotal, l as AssertMutuallyAssignable, d as EngineCapabilities, E as EngineHandleData, m as EngineProcessModel, I as InternalToolCall, f as ModelCatalogEntry, M as ModelRef, P as ProbeReport, R as ReplayedTurn, e as ResumeAnchor, S as SessionView, n as ToolCall, o as ToolCallEntry, p as ToolCallResult, T as Turn, W as WorktreeHandle } from './contract-types-jSa1g28F.js';
4
5
  export { SCHEMA_EMULATION_TAIL_CHARS, StructuredOutputResult, buildSchemaEmulationSegment, extractAndValidateStructuredOutput } from './schema-emulation.js';
5
6
  export { ExecutionNestingContext, ExecutionNestingState, NESTED_SPAWN_ENV, NestedSpawnRejectedError, SpawnEnv, assertNotNestedSpawn, buildNestedSpawnEnv } from './nesting-guard.js';
6
7
  export { CoreLogger, LogLevel, LoggerSink, configureLoggerSink, getLogger, resetLoggerSinkForTests } from './logger.js';
package/dist/index.js CHANGED
@@ -59,14 +59,14 @@ import {
59
59
  armEngineSelfDestruct,
60
60
  pumpNdjsonLines,
61
61
  spawnEngineChild
62
- } from "./chunk-MQPASWMA.js";
62
+ } from "./chunk-HSNDUHFH.js";
63
63
  import {
64
64
  ENGINE_NODE_ENV,
65
65
  hostKindOf,
66
66
  probeNodeExecutor,
67
67
  resetEngineNodeProbeCache,
68
68
  resolveEngineNodeLaunch
69
- } from "./chunk-3WC36CHI.js";
69
+ } from "./chunk-NTOLHLCL.js";
70
70
  import {
71
71
  DEFAULT_STDERR_KEEP_DAYS,
72
72
  DEFAULT_STDERR_MAX_BYTES,
@@ -92,7 +92,7 @@ import {
92
92
  reverseRequestFrameSchema,
93
93
  runSessionParamsSchema,
94
94
  successResponseFrameSchema
95
- } from "./chunk-DIIYVO4O.js";
95
+ } from "./chunk-LM7P7OTA.js";
96
96
  import {
97
97
  isNotificationFrame,
98
98
  isRequestFrame,
@@ -121,14 +121,12 @@ import {
121
121
  probePidAlive,
122
122
  safeKill,
123
123
  synthesizeTimeoutOutcome
124
- } from "./chunk-F7VDVSBZ.js";
124
+ } from "./chunk-CNCFMPEH.js";
125
125
  import {
126
126
  toErrorMessage
127
127
  } from "./chunk-PYO3YR7W.js";
128
128
  import {
129
129
  CANCEL_SETTLE_GRACE_MS,
130
- CRASH_REBUILD_BACKOFF_MS,
131
- CRASH_REBUILD_MAX_ATTEMPTS,
132
130
  ENGINE_ERROR_CODE_PREFIX,
133
131
  ENGINE_PROTOCOL_ERROR_CODES,
134
132
  ENGINE_PROTOCOL_VERSION,
@@ -136,18 +134,23 @@ import {
136
134
  EngineSdkError,
137
135
  HANDSHAKE_TIMEOUT_MS,
138
136
  REVERSE_REQUEST_TIMEOUT_MS,
137
+ SET_MODEL_ERROR_CODES,
138
+ SET_MODEL_NOT_ACTIVE_CODE,
139
+ SET_MODEL_REQUEST_TIMEOUT_MS,
140
+ SET_MODEL_STAGE_TIMEOUT_MS,
139
141
  STDERR_TAIL_CHARS,
140
142
  STDOUT_TAIL_ECHO_CHARS,
141
143
  SUPPORTED_PROTOCOL_RANGE,
142
144
  assertChatConversationSupported,
143
145
  engineConversationUnsupportedError,
144
146
  engineProtocolMismatchError,
147
+ engineSetModelUnsupportedError,
145
148
  engineTimeoutDetail,
146
149
  isEngineErrorPassthroughCode,
147
150
  isEngineProtocolErrorCode,
148
151
  isProtocolVersionCompatible,
149
152
  schemaEmulationFailedDetail
150
- } from "./chunk-SFNTX7Q3.js";
153
+ } from "./chunk-JZN76I3S.js";
151
154
  import {
152
155
  configureLoggerSink,
153
156
  getLogger,
@@ -221,8 +224,6 @@ var RELAY_REJECT_REASONS = {
221
224
  export {
222
225
  AGENT_EVENT_TYPE_NAMES,
223
226
  CANCEL_SETTLE_GRACE_MS,
224
- CRASH_REBUILD_BACKOFF_MS,
225
- CRASH_REBUILD_MAX_ATTEMPTS,
226
227
  DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS,
227
228
  DEFAULT_KILL_GRACE_MS,
228
229
  DEFAULT_NATIVE_INTERRUPT_GRACE_MS,
@@ -261,6 +262,10 @@ export {
261
262
  REVERSE_CHANNEL_TIMEOUT_CLASS,
262
263
  REVERSE_REQUEST_TIMEOUT_MS,
263
264
  SCHEMA_EMULATION_TAIL_CHARS,
265
+ SET_MODEL_ERROR_CODES,
266
+ SET_MODEL_NOT_ACTIVE_CODE,
267
+ SET_MODEL_REQUEST_TIMEOUT_MS,
268
+ SET_MODEL_STAGE_TIMEOUT_MS,
264
269
  SHARED_POOL_KEY,
265
270
  STDERR_TAIL_CHARS,
266
271
  STDOUT_TAIL_ECHO_CHARS,
@@ -286,6 +291,7 @@ export {
286
291
  createUiChannelRegistry,
287
292
  engineConversationUnsupportedError,
288
293
  engineProtocolMismatchError,
294
+ engineSetModelUnsupportedError,
289
295
  engineTimeoutDetail,
290
296
  errorResponseFrameSchema,
291
297
  eventsToSessionView,
@@ -1,4 +1,4 @@
1
- import { A as AgentEvent } from './contract-types-DqOD58r-.cjs';
1
+ import { A as AgentEvent } from './contract-types-jSa1g28F.cjs';
2
2
 
3
3
  /**
4
4
  * 重放 journal:读取路径下全部事件,重放即得 AgentEvent 流(read 第②级)。
@@ -1,4 +1,4 @@
1
- import { A as AgentEvent } from './contract-types-DqOD58r-.js';
1
+ import { A as AgentEvent } from './contract-types-jSa1g28F.js';
2
2
 
3
3
  /**
4
4
  * 重放 journal:读取路径下全部事件,重放即得 AgentEvent 流(read 第②级)。
@@ -1,4 +1,4 @@
1
- import { T as Turn, a as AgentUsageTotal, A as AgentEvent, S as SessionView, E as EngineHandleData, R as ReplayedTurn } from './contract-types-DqOD58r-.cjs';
1
+ import { T as Turn, a as AgentUsageTotal, A as AgentEvent, S as SessionView, E as EngineHandleData, R as ReplayedTurn } from './contract-types-jSa1g28F.cjs';
2
2
 
3
3
  /**
4
4
  * reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
@@ -1,4 +1,4 @@
1
- import { T as Turn, a as AgentUsageTotal, A as AgentEvent, S as SessionView, E as EngineHandleData, R as ReplayedTurn } from './contract-types-DqOD58r-.js';
1
+ import { T as Turn, a as AgentUsageTotal, A as AgentEvent, S as SessionView, E as EngineHandleData, R as ReplayedTurn } from './contract-types-jSa1g28F.js';
2
2
 
3
3
  /**
4
4
  * reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
@@ -101,6 +101,32 @@ function toErrorMessage(e) {
101
101
  }
102
102
 
103
103
  // src/protocol/error-codes.ts
104
+ var SET_MODEL_ERROR_CODES = [
105
+ /** 目标模型不在当前进程快照(子进程模型快照冻结于 spawn 时刻——模型本身有效,
106
+ * 下一轮 spawn 现取目录即可用;宿主按「写覆盖意图」处置,设计 §7.2 快照型失败行)。 */
107
+ "engine_model_not_in_snapshot",
108
+ /** 凭据校验失败(子进程 set_model checkAuth 抛错——宿主预检通过后 registry 态漂移
109
+ * 的权威兜底;宿主按校验型失败处置,设计 §7.5 凭据行)。 */
110
+ "engine_credential_missing",
111
+ /** 命令已发出(set_model 可能已执行)但读应答 / get_state 回读无回执、生效值未知
112
+ * (非进程退出情形——退出归无活进程路径;宿主按「写覆盖意图 + 错误应答」处置,
113
+ * 设计 §7.5 回读失败行)。 */
114
+ "engine_state_readback_failed"
115
+ ];
116
+ var SET_MODEL_NOT_ACTIVE_CODE = "engine_run_not_active";
117
+ var ENGINE_PROTOCOL_ERROR_CODES = [
118
+ "engine_not_found",
119
+ "engine_protocol_mismatch",
120
+ "engine_capability_unsupported",
121
+ "engine_capability_mismatch",
122
+ "engine_model_unknown",
123
+ "engine_model_mismatch",
124
+ "engine_handshake_timeout",
125
+ "engine_crashed",
126
+ "engine_probe_failed",
127
+ ...SET_MODEL_ERROR_CODES,
128
+ SET_MODEL_NOT_ACTIVE_CODE
129
+ ];
104
130
  var STDOUT_TAIL_ECHO_CHARS = 2e3;
105
131
  function truncate(text, max) {
106
132
  return text.length <= max ? text : `${text.slice(0, max)}...`;
@@ -1,4 +1,4 @@
1
- import { b as AgentCallOpts, c as AgentOutcome } from './contract-types-DqOD58r-.cjs';
1
+ import { b as AgentCallOpts, c as AgentOutcome } from './contract-types-jSa1g28F.cjs';
2
2
 
3
3
  /**
4
4
  * 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
@@ -1,4 +1,4 @@
1
- import { b as AgentCallOpts, c as AgentOutcome } from './contract-types-DqOD58r-.js';
1
+ import { b as AgentCallOpts, c as AgentOutcome } from './contract-types-jSa1g28F.js';
2
2
 
3
3
  /**
4
4
  * 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
@@ -8,9 +8,9 @@ import {
8
8
  probePidAlive,
9
9
  safeKill,
10
10
  synthesizeTimeoutOutcome
11
- } from "./chunk-F7VDVSBZ.js";
11
+ } from "./chunk-CNCFMPEH.js";
12
12
  import "./chunk-PYO3YR7W.js";
13
- import "./chunk-SFNTX7Q3.js";
13
+ import "./chunk-JZN76I3S.js";
14
14
  import "./chunk-NXNNXGTY.js";
15
15
  import "./chunk-JSBRDJBE.js";
16
16
  export {
@@ -1,76 +1,15 @@
1
- import { A as AgentEvent, d as EngineCapabilities, M as ModelCatalogEntry, b as AgentCallOpts, e as ResumeAnchor, E as EngineHandleData, P as ProbeReport, c as AgentOutcome, S as SessionView } from './contract-types-DqOD58r-.js';
2
-
3
- /** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
4
- interface ProtocolError {
5
- /** 错误码(error-codes.ts 词表 + 其余 engine_* 引擎自报透传)。 */
6
- code: string;
7
- /** 人类可读详情。 */
8
- message: string;
9
- /** 恢复指引:指向具体下一步(命令 / 配置路径 / 升级动作),非安慰性文案。 */
10
- recovery: string;
11
- /** 结构化附参(如 engine_protocol_mismatch 的双方版本)。 */
12
- data?: Record<string, unknown>;
13
- }
14
- interface RequestFrame {
15
- id: number;
16
- method: string;
17
- params: unknown;
18
- }
19
- interface SuccessResponseFrame {
20
- id: number | string;
21
- result: unknown;
22
- }
23
- interface ErrorResponseFrame {
24
- id: number | string;
25
- error: ProtocolError;
26
- }
27
- type ResponseFrame = SuccessResponseFrame | ErrorResponseFrame;
28
- /** event 通知载荷:runId 关联在途 run;seq 单调递增(基线①结构等价断言对象)。 */
29
- interface EventNotificationParams {
30
- runId: string;
31
- seq: number;
32
- event: AgentEvent;
33
- }
34
- interface NotificationFrame {
35
- method: "event";
36
- params: EventNotificationParams;
37
- }
38
- interface ReverseRequestFrame {
39
- id: string;
40
- method: string;
41
- params: unknown;
42
- }
43
- /** 反向请求的应答(core → 引擎,沿 ResponseFrame 通道回传;id = 反向请求 id 原样)。 */
44
- type ReverseResponseResult =
45
- /** 数据面类:处理确认。 */
46
- {
47
- ok: true;
48
- }
49
- /** 人机交互类(askUser)两阶段第一阶段:已受理,结果异步到达(R9-2)。 */
50
- | {
51
- ack: true;
52
- }
53
- /** 未实现或宿主未知的通道(宽容语义③:由 askUser 语境泛化到全通道——宿主对未知 host/* 通道回 unsupported,引擎自行降级)。 */
54
- | {
55
- unsupported: true;
56
- };
57
- /** ① 请求:有数字 id + method + params,且无 result/error(与②应答区分)。 */
58
- declare function isRequestFrame(frame: unknown): frame is RequestFrame;
59
- /** ② 应答:有 id(number|string)且 result/error 二选一。 */
60
- declare function isResponseFrame(frame: unknown): frame is ResponseFrame;
61
- /** ③ 通知:无 id,method === "event",params 含 runId/seq/event。 */
62
- declare function isNotificationFrame(frame: unknown): frame is NotificationFrame;
63
- /** ④ 反向请求:有字符串 id + host/* method + params(与①的区别 = id 形态与 method 前缀)。 */
64
- declare function isReverseRequestFrame(frame: unknown): frame is ReverseRequestFrame;
1
+ import { M as ModelRef, d as EngineCapabilities, f as ModelCatalogEntry, b as AgentCallOpts, e as ResumeAnchor, E as EngineHandleData, P as ProbeReport, c as AgentOutcome, S as SessionView } from './contract-types-jSa1g28F.cjs';
65
2
 
66
3
  /**
67
- * 正向方法名联合(恰好 9 个;PROTOCOL_METHODS 常量数组与之同源互证)。
4
+ * 正向方法名联合(恰好 10 个;PROTOCOL_METHODS 常量数组与之同源互证)。
68
5
  * [H1] `interact` 成员已随 chat-run 统一退役(docs/architecture/subagent-chat-run-unification.md
69
6
  * §3.3 D5:续聊轮统一为「新 run + resume 锚点」,U5 删除)。
7
+ * [subagent-model-switch] `setModel` 为执行中模型热切换方法(capabilities.setModel
8
+ * 位门控;消费点 = 宿主发送前预检,位不支持不发调用)。
70
9
  */
71
- type ProtocolMethod = "initialize" | "probe" | "run" | "cancel" | "read" | "listModels" | "validateModel" | "dispose" | "ping";
10
+ type ProtocolMethod = "initialize" | "probe" | "run" | "cancel" | "read" | "listModels" | "validateModel" | "dispose" | "ping" | "setModel";
72
11
  /** 方法名全集(运行时顺序化枚举;与 ProtocolMethod 的同源关系由测试断言)。 */
73
- declare const PROTOCOL_METHODS: readonly ["initialize", "probe", "run", "cancel", "read", "listModels", "validateModel", "dispose", "ping"];
12
+ declare const PROTOCOL_METHODS: readonly ["initialize", "probe", "run", "cancel", "read", "listModels", "validateModel", "dispose", "ping", "setModel"];
74
13
  /**
75
14
  * run 上下文(RunContext 字段映射的协议承载,设计 §3.3 RunContext 映射表)。
76
15
  */
@@ -231,6 +170,43 @@ interface PingParams {
231
170
  interface PingResult {
232
171
  pong: true;
233
172
  }
173
+ /**
174
+ * [subagent-model-switch §7.3] setModel 参数——RunParams 同级的 run 定向方法
175
+ * (params 以 runId 寻址活跃子进程,对照 cancel)。
176
+ *
177
+ * 语义(引擎侧实装义务,权威 = 设计 §7.3):定位活跃子进程 → 转发 pi 原生
178
+ * `set_model` → 读应答 → get_state 回读生效值 → 应答。请求 model 是**目标意图**
179
+ * (pi 部分模型族会静默替换成同族模型),生效值以应答 effectiveModel 为准。
180
+ * 失败经 error 帧,分型值域 = SET_MODEL_ERROR_CODES 三型
181
+ * (engine_model_not_in_snapshot / engine_credential_missing / engine_state_readback_failed);
182
+ * 目标 run 无活跃子进程(定位时 / 命令写入 / 读应答 / 回读四个竞态窗口内退出——
183
+ * 同一处置)按「无活进程」形态应答 = error 帧 `SET_MODEL_NOT_ACTIVE_CODE`
184
+ * (engine_run_not_active,宿主转纯记账路径,§7.5 子进程已退出行)。
185
+ *
186
+ * 无 thinkingLevel 参数(D5 裁决 M1-1):热切档位由 pi set_model 按新模型档位表
187
+ * 联动重设管辖(生效值以应答 effectiveThinkingLevel 为准);用户显式档位经覆盖
188
+ * 记账在下一轮 spawn 由解析链裁决(§6.2 跨轮档位以解析链为准)。未来引擎真支持
189
+ * 档位热切时走 additive 演进(新增可选参数)。
190
+ *
191
+ * 消费链:U2 宿主编排经 EnginePort 调用(capabilities.setModel='native' 预检通过后);
192
+ * U3 pi 引擎实装;U5 run 级聚合逐成员转发复用同一方法。
193
+ */
194
+ interface SetModelParams {
195
+ /** 目标 run 的 id(RunParams.runId 同源——引擎以它定位活跃子进程)。 */
196
+ runId: string;
197
+ /** 目标模型 ref(provider + modelId;宿主编排层负责与 canonical ref 目录互校)。 */
198
+ model: ModelRef;
199
+ }
200
+ /**
201
+ * [subagent-model-switch §7.3] setModel 应答——**回读生效值**(get_state 同源读回,
202
+ * 非命令应答转述;同族替换时 effectiveModel ≠ 请求 model)。
203
+ */
204
+ interface SetModelResult {
205
+ /** 生效模型 ref(pi 子进程活状态读回)。 */
206
+ effectiveModel: ModelRef;
207
+ /** 生效 thinking 档位(pi set_model 联动重设后的实际档位)。 */
208
+ effectiveThinkingLevel: string;
209
+ }
234
210
  /** 方法 → params 类型映射。 */
235
211
  interface ProtocolParamsMap {
236
212
  initialize: InitializeParams;
@@ -242,6 +218,7 @@ interface ProtocolParamsMap {
242
218
  validateModel: ValidateModelParams;
243
219
  dispose: DisposeParams;
244
220
  ping: PingParams;
221
+ setModel: SetModelParams;
245
222
  }
246
223
  /** 方法 → result 类型映射。 */
247
224
  interface ProtocolResultMap {
@@ -254,58 +231,7 @@ interface ProtocolResultMap {
254
231
  validateModel: ValidateModelResult;
255
232
  dispose: DisposeResult;
256
233
  ping: PingResult;
234
+ setModel: SetModelResult;
257
235
  }
258
236
 
259
- /** 协议核心错误码(引擎 error 帧 + core 同步拦截共用的固定词表)。 */
260
- declare const ENGINE_PROTOCOL_ERROR_CODES: readonly ["engine_not_found", "engine_protocol_mismatch", "engine_capability_unsupported", "engine_capability_mismatch", "engine_model_unknown", "engine_model_mismatch", "engine_handshake_timeout", "engine_crashed", "engine_probe_failed"];
261
- type EngineProtocolErrorCode = (typeof ENGINE_PROTOCOL_ERROR_CODES)[number];
262
- /** unknown → 协议错误码收窄(外部输入携带错误码时的运行时 guard;其余 engine_* 走透传)。 */
263
- declare function isEngineProtocolErrorCode(value: unknown): value is EngineProtocolErrorCode;
264
- /** 其余引擎自报错误码的前缀契约(透传面;core 不解释文案)。 */
265
- declare const ENGINE_ERROR_CODE_PREFIX = "engine_";
266
- declare function isEngineErrorPassthroughCode(value: string): boolean;
267
-
268
- /**
269
- * 结构化引擎错误(message 恒为 `<code>: <detail>` 前缀格式——AgentOutcome.error 与
270
- * 协议 error 帧共用的错误码前缀约定);recovery 指向恢复动作。
271
- * toStructured() 产出即协议 ProtocolError 形态(error 帧载荷直用)。
272
- */
273
- declare class EngineSdkError extends Error {
274
- readonly code: string;
275
- readonly recovery: string;
276
- readonly data?: Record<string, unknown>;
277
- constructor(code: string, detail: string, recovery: string, data?: Record<string, unknown>);
278
- /** 协议 error 帧载荷投影。 */
279
- toStructured(): ProtocolError;
280
- }
281
- declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
282
- /**
283
- * 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
284
- * 引擎,message 续聊资格被拒——manifest conversation 能力轴消费;[modeless 波5
285
- * 收尾] core capability-gate 的显式参数分支随派发参数删除退役,本构造器消费方 =
286
- * 引擎侧 resume gate(assertChatConversationSupported)与 message 资格门)。
287
- * 文案契约:错误码 engine_capability_unsupported + 「换引擎续聊 / 修 manifest /
288
- * 升级引擎包」恢复指引,两侧一致防漂移。
289
- */
290
- declare function engineConversationUnsupportedError(engineId: string): EngineSdkError;
291
- /**
292
- * resume 会话形态(run.params.resume——唯一会话形态键)派发前的同步 gate:
293
- * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
294
- * ——进程/record 创建前同步拒(A6 方向防御:manifest/实装漂移时引擎侧自拒,
295
- * 与 core capability-gate 同一能力位,防两侧判据漂移)。[modeless 波2] 协议
296
- * task 的 conversation 键已删,本 gate 只对 resume 形态键生效。
297
- */
298
- declare function assertChatConversationSupported(engineId: string, capabilities: Pick<EngineCapabilities, "conversation">): void;
299
- /** stdout 尾部回显上限(engine_timeout / engine_run_failed 的错误规格载体系数)。 */
300
- declare const STDOUT_TAIL_ECHO_CHARS = 2000;
301
- /** engine_timeout 的恢复指引(kill-chain 超时杀链收尾文案)。 */
302
- declare const ENGINE_TIMEOUT_RECOVERY: string;
303
- /**
304
- * engine_timeout 的 outcome.error 文案:含 stdout 尾部 2000 字 + 恢复指引
305
- * (kill-chain synthesizeTimeoutOutcome 消费;与 core errors.ts engineTimeoutDetail 逐字等价)。
306
- */
307
- declare function engineTimeoutDetail(stdoutTail: string): string;
308
- /** schema_emulation_failed 的终报文案(宿主编排层「重试一次仍失败」后消费)。 */
309
- declare function schemaEmulationFailedDetail(error: string, tail: string): string;
310
-
311
- export { type ValidateModelResult as A, assertChatConversationSupported as B, type CancelParams as C, type DisposeParams as D, EngineSdkError as E, engineConversationUnsupportedError as F, engineProtocolMismatchError as G, engineTimeoutDetail as H, type InitializeResult as I, isEngineErrorPassthroughCode as J, isEngineProtocolErrorCode as K, type ListModelsParams as L, isNotificationFrame as M, type NotificationFrame as N, isRequestFrame as O, PROTOCOL_METHODS as P, isResponseFrame as Q, type RunContextParams as R, STDOUT_TAIL_ECHO_CHARS as S, isReverseRequestFrame as T, schemaEmulationFailedDetail as U, type ValidateModelParams as V, type InitializeParams as a, type CancelResult as b, type DisposeResult as c, ENGINE_ERROR_CODE_PREFIX as d, ENGINE_PROTOCOL_ERROR_CODES as e, ENGINE_TIMEOUT_RECOVERY as f, type EngineProtocolErrorCode as g, type ErrorResponseFrame as h, type EventNotificationParams as i, type ListModelsResult as j, type PingParams as k, type PingResult as l, type ProbeParams as m, type ProtocolError as n, type ProtocolMethod as o, type ProtocolParamsMap as p, type ProtocolResultMap as q, type ReadParams as r, type RequestFrame as s, type ResponseFrame as t, type ReverseRequestFrame as u, type ReverseResponseResult as v, type RunParams as w, type RunResult as x, type RunResumeParams as y, type SuccessResponseFrame as z };
237
+ export { type CancelParams as C, type DisposeParams as D, type InitializeResult as I, type ListModelsParams as L, PROTOCOL_METHODS as P, type RunContextParams as R, type SetModelParams as S, type ValidateModelParams as V, type SetModelResult as a, type InitializeParams as b, type CancelResult as c, type DisposeResult as d, type ListModelsResult as e, type PingParams as f, type PingResult as g, type ProbeParams as h, type ProtocolMethod as i, type ProtocolParamsMap as j, type ProtocolResultMap as k, type ReadParams as l, type RunParams as m, type RunResult as n, type RunResumeParams as o, type ValidateModelResult as p };