@zhushanwen/subagent-engine-sdk 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/{chunk-7I4XGL5J.js → chunk-BBWUC2EE.js} +2 -2
  2. package/dist/{chunk-3K2P2CM2.js → chunk-CNQTJJF5.js} +1 -1
  3. package/dist/{chunk-DSQ7JQKM.js → chunk-GSW3DMN6.js} +5 -5
  4. package/dist/{chunk-BBVZK5DL.js → chunk-M3SZTDNQ.js} +20 -20
  5. package/dist/{chunk-HYES77BR.js → chunk-MSAJXIP4.js} +2 -2
  6. package/dist/{chunk-FJT23P7T.js → chunk-QOEXD2FT.js} +1 -1
  7. package/dist/{chunk-LKPVN3N6.js → chunk-W3BKI2BP.js} +3 -3
  8. package/dist/{chunk-WS4WAZVR.js → chunk-WMDMXP2F.js} +2 -2
  9. package/dist/{chunk-GT6YLLN4.js → chunk-X24IVQKJ.js} +5 -5
  10. package/dist/{chunk-365AUV6N.js → chunk-YE472JOO.js} +2 -2
  11. package/dist/{contract-types-C71Sqq8d.d.cts → contract-types-Dsvy79r3.d.cts} +9 -10
  12. package/dist/{contract-types-C71Sqq8d.d.ts → contract-types-Dsvy79r3.d.ts} +9 -10
  13. package/dist/data-dir.cjs +6 -6
  14. package/dist/data-dir.d.cts +4 -4
  15. package/dist/data-dir.d.ts +4 -4
  16. package/dist/data-dir.js +3 -3
  17. package/dist/env.cjs +20 -20
  18. package/dist/env.d.cts +12 -5
  19. package/dist/env.d.ts +12 -5
  20. package/dist/env.js +1 -1
  21. package/dist/{error-codes-D5YlWaBx.d.ts → error-codes-DMGeUUUm.d.ts} +12 -12
  22. package/dist/{error-codes-CiOO3PMg.d.cts → error-codes-pT7RYTqQ.d.cts} +12 -12
  23. package/dist/index.cjs +42 -42
  24. package/dist/index.d.cts +3 -3
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.js +12 -12
  27. package/dist/journal-io.d.cts +1 -1
  28. package/dist/journal-io.d.ts +1 -1
  29. package/dist/journal-replay.d.cts +1 -1
  30. package/dist/journal-replay.d.ts +1 -1
  31. package/dist/kill-chain.d.cts +2 -2
  32. package/dist/kill-chain.d.ts +2 -2
  33. package/dist/kill-chain.js +2 -2
  34. package/dist/logs/stderr-rotation.cjs +2 -2
  35. package/dist/logs/stderr-rotation.d.cts +1 -1
  36. package/dist/logs/stderr-rotation.d.ts +1 -1
  37. package/dist/logs/stderr-rotation.js +1 -1
  38. package/dist/nesting-guard.cjs +2 -2
  39. package/dist/nesting-guard.d.cts +2 -2
  40. package/dist/nesting-guard.d.ts +2 -2
  41. package/dist/nesting-guard.js +1 -1
  42. package/dist/node-executor.cjs +2 -2
  43. package/dist/node-executor.d.cts +5 -5
  44. package/dist/node-executor.d.ts +5 -5
  45. package/dist/node-executor.js +2 -2
  46. package/dist/port-contract.d.cts +1 -1
  47. package/dist/port-contract.d.ts +1 -1
  48. package/dist/protocol/index.cjs +2 -2
  49. package/dist/protocol/index.d.cts +5 -5
  50. package/dist/protocol/index.d.ts +5 -5
  51. package/dist/protocol/index.js +1 -1
  52. package/dist/relay-env.cjs +5 -5
  53. package/dist/relay-env.d.cts +5 -5
  54. package/dist/relay-env.d.ts +5 -5
  55. package/dist/relay-env.js +1 -1
  56. package/dist/spawn.cjs +1 -1
  57. package/dist/spawn.d.cts +2 -2
  58. package/dist/spawn.d.ts +2 -2
  59. package/dist/spawn.js +1 -1
  60. package/dist/ui-channels.cjs +2 -2
  61. package/dist/ui-channels.js +1 -1
  62. package/package.json +2 -4
  63. package/src/best-effort.ts +0 -37
  64. package/src/cli-entry.ts +0 -82
  65. package/src/data-dir.ts +0 -89
  66. package/src/env.ts +0 -265
  67. package/src/error-message.ts +0 -22
  68. package/src/index.ts +0 -63
  69. package/src/journal-io.ts +0 -82
  70. package/src/journal-replay.ts +0 -436
  71. package/src/kill-chain.ts +0 -265
  72. package/src/logger.ts +0 -105
  73. package/src/logs/stderr-rotation.ts +0 -166
  74. package/src/nesting-guard.ts +0 -140
  75. package/src/node-executor.ts +0 -272
  76. package/src/paths.ts +0 -48
  77. package/src/port-contract.ts +0 -150
  78. package/src/protocol/contract-types.ts +0 -379
  79. package/src/protocol/engine-protocol.ts +0 -91
  80. package/src/protocol/error-codes.ts +0 -180
  81. package/src/protocol/frames.ts +0 -143
  82. package/src/protocol/index.ts +0 -12
  83. package/src/protocol/methods.ts +0 -237
  84. package/src/protocol/reverse-channels.ts +0 -123
  85. package/src/protocol/schema.ts +0 -185
  86. package/src/relay-env.ts +0 -60
  87. package/src/schema-emulation.ts +0 -192
  88. package/src/spawn.ts +0 -246
  89. package/src/ui-channels.ts +0 -219
  90. package/src/ui-types.ts +0 -101
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent, E as EngineCapabilities } from './contract-types-C71Sqq8d.cjs';
1
+ import { a as AgentEvent, E as EngineCapabilities } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
4
4
  interface ProtocolError {
@@ -87,20 +87,20 @@ declare class EngineSdkError extends Error {
87
87
  }
88
88
  declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
89
89
  /**
90
- * [v1.x] resume 会话形态(run.params.resume)的 gate 拒绝具名错误(chat-domain
91
- * 设计 §3.2 D1-A + 验收 A6:manifest 无 conversation gate 位的引擎收到
92
- * conversation 请求 → 同步拒;[H1] 文案随 D5 语义收窄——续聊 = resume 续聊)。
93
- * 文案契约对齐 core capability-gate.ts conversation 分支(错误码
94
- * engine_capability_unsupported + 「去掉参数 / 修 manifest / 升级引擎包」恢复指引)
95
- * ——W3 chat 路由切协议客户端时以本构造器替换 core 内联文案,保持两侧一致。
90
+ * 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
91
+ * 引擎,message 续聊资格被拒——manifest conversation 能力轴消费;[modeless 波5
92
+ * 收尾] core capability-gate 的显式参数分支随派发参数删除退役,本构造器消费方 =
93
+ * 引擎侧 resume gate(assertChatConversationSupported)与 message 资格门)。
94
+ * 文案契约:错误码 engine_capability_unsupported + 「换引擎续聊 / 修 manifest /
95
+ * 升级引擎包」恢复指引,两侧一致防漂移。
96
96
  */
97
97
  declare function engineConversationUnsupportedError(engineId: string): EngineSdkError;
98
98
  /**
99
- * [v1.x] resume 会话形态(run.params.resume / task.conversation=true)派发前的同步 gate:
100
- * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError——
101
- * 进程/record 创建前同步拒(A6:run 域不受影响,仅 chat 面被拦)。
102
- * 判据单源:core 侧 capability-gate.assertTaskShapeSupported 的 conversation 分支
103
- * 覆盖同一能力位,协议客户端路径(W3 接线)消费本函数,防两处判据漂移。
99
+ * resume 会话形态(run.params.resume——唯一会话形态键)派发前的同步 gate:
100
+ * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
101
+ * ——进程/record 创建前同步拒(A6 方向防御:manifest/实装漂移时引擎侧自拒,
102
+ * 与 core capability-gate 同一能力位,防两侧判据漂移)。[modeless 波2] 协议
103
+ * task 的 conversation 键已删,本 gate 只对 resume 形态键生效。
104
104
  */
105
105
  declare function assertChatConversationSupported(engineId: string, capabilities: Pick<EngineCapabilities, "conversation">): void;
106
106
  /** stdout 尾部回显上限(engine_timeout / engine_run_failed 的错误规格载体系数)。 */
package/dist/index.cjs CHANGED
@@ -6615,7 +6615,7 @@ __export(src_exports, {
6615
6615
  STDERR_TAIL_CHARS: () => STDERR_TAIL_CHARS,
6616
6616
  STDOUT_TAIL_ECHO_CHARS: () => STDOUT_TAIL_ECHO_CHARS,
6617
6617
  SUPPORTED_PROTOCOL_RANGE: () => SUPPORTED_PROTOCOL_RANGE,
6618
- XYZ_DATA_DIR_ENV: () => XYZ_DATA_DIR_ENV,
6618
+ TAIJI_DATA_DIR_ENV: () => TAIJI_DATA_DIR_ENV,
6619
6619
  abortWithFallback: () => abortWithFallback,
6620
6620
  aggregateUsage: () => aggregateUsage,
6621
6621
  armEngineSelfDestruct: () => armEngineSelfDestruct,
@@ -6706,7 +6706,7 @@ var CRASH_REBUILD_BACKOFF_MS = [
6706
6706
  CRASH_REBUILD_BACKOFF_STEP_3_MS
6707
6707
  ];
6708
6708
  var STDERR_TAIL_CHARS = 400;
6709
- var ENGINE_EVENT_COALESCE_ENV = "XYZ_ENGINE_EVENT_COALESCE";
6709
+ var ENGINE_EVENT_COALESCE_ENV = "TAIJI_ENGINE_EVENT_COALESCE";
6710
6710
  var ENGINE_EVENT_COALESCE_DEFAULT = "0";
6711
6711
 
6712
6712
  // src/protocol/frames.ts
@@ -6813,7 +6813,7 @@ function engineConversationUnsupportedError(engineId) {
6813
6813
  return new EngineSdkError(
6814
6814
  "engine_capability_unsupported",
6815
6815
  `engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
6816
- `\u53BB\u6389 conversation \u53C2\u6570\uFF08\u4E00\u6B21\u6027\u4EFB\u52A1\u9ED8\u8BA4\u5F62\u6001\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
6816
+ `\u6539\u7528\u58F0\u660E conversation \u80FD\u529B\u7684\u5F15\u64CE\u7EED\u804A\uFF08\u6216\u4EE5\u65B0\u4EFB\u52A1\u91CD\u6D3E\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
6817
6817
  { engineId, capability: "conversation", declared: "unsupported" }
6818
6818
  );
6819
6819
  }
@@ -7071,7 +7071,7 @@ function getOrCompileValidator(schema) {
7071
7071
 
7072
7072
  // src/nesting-guard.ts
7073
7073
  var import_node_async_hooks = require("async_hooks");
7074
- var NESTED_SPAWN_ENV = "XYZ_AGENT_SUBAGENT";
7074
+ var NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
7075
7075
  var NATIVE_NESTED_KEYS = ["CLAUDECODE", "ZSW_NESTED"];
7076
7076
  var NATIVE_NESTED_PREFIXES = ["PI_SUBAGENT_"];
7077
7077
  var NestedSpawnRejectedError = class extends Error {
@@ -7080,7 +7080,7 @@ var NestedSpawnRejectedError = class extends Error {
7080
7080
  recovery;
7081
7081
  constructor() {
7082
7082
  super(
7083
- "nested_spawn_rejected: this process is already a subagent (XYZ_AGENT_SUBAGENT=1)"
7083
+ "nested_spawn_rejected: this process is already a subagent (TAIJI_AGENT_SUBAGENT=1)"
7084
7084
  );
7085
7085
  this.name = "NestedSpawnRejectedError";
7086
7086
  this.recovery = "Subagents must not spawn further subagents (unbounded recursion guard). Do the work directly inside the current task instead of delegating.";
@@ -7529,7 +7529,7 @@ function sessionIdFromHandle(handle) {
7529
7529
 
7530
7530
  // src/data-dir.ts
7531
7531
  var logger2 = getLogger("subagents");
7532
- var XYZ_DATA_DIR_ENV = "XYZ_AGENT_DATA_DIR";
7532
+ var TAIJI_DATA_DIR_ENV = "TAIJI_AGENT_DATA_DIR";
7533
7533
  var WARNED_SLOT_KEY = /* @__PURE__ */ Symbol.for("@zhushanwen/subagent-engine-sdk.data-dir-warned");
7534
7534
  function getWarnedSlot() {
7535
7535
  let slot = Reflect.get(globalThis, WARNED_SLOT_KEY);
@@ -7543,19 +7543,19 @@ function resetDataDirWarnForTests() {
7543
7543
  getWarnedSlot().current = false;
7544
7544
  }
7545
7545
  function resolveEngineDataDir(env, opts = {}) {
7546
- const fromEnv = env[XYZ_DATA_DIR_ENV]?.trim();
7546
+ const fromEnv = env[TAIJI_DATA_DIR_ENV]?.trim();
7547
7547
  if (fromEnv !== void 0 && fromEnv !== "") return fromEnv;
7548
7548
  const fallback = opts.fallbackDataRoot?.trim();
7549
7549
  if (fallback === void 0 || fallback === "") {
7550
7550
  throw new Error(
7551
- `[subagent-engine-sdk] engine_not_found: ${XYZ_DATA_DIR_ENV} is not set and no fallback data root was injected. Recovery: the host must inject ${XYZ_DATA_DIR_ENV} into the engine process env (xyz-agent runtime / pi extension host do this at spawn), or pass { fallbackDataRoot } when calling resolveEngineDataDir from a host that resolves the data root itself.`
7551
+ `[subagent-engine-sdk] engine_not_found: ${TAIJI_DATA_DIR_ENV} is not set and no fallback data root was injected. Recovery: the host must inject ${TAIJI_DATA_DIR_ENV} into the engine process env (taiji runtime / pi extension host do this at spawn), or pass { fallbackDataRoot } when calling resolveEngineDataDir from a host that resolves the data root itself.`
7552
7552
  );
7553
7553
  }
7554
7554
  if (!getWarnedSlot().current) {
7555
7555
  getWarnedSlot().current = true;
7556
7556
  const warn = opts.warn ?? defaultWarn;
7557
7557
  warn(
7558
- `[engine-data-dir] ${XYZ_DATA_DIR_ENV} is not set; engine journal/pool fall back to the injected data root (${fallback}). The xyz-agent host normally injects this env \u2014 if you are running inside xyz-agent, check the runtime spawn env; standalone installs intentionally use the injected root.`
7558
+ `[engine-data-dir] ${TAIJI_DATA_DIR_ENV} is not set; engine journal/pool fall back to the injected data root (${fallback}). The taiji host normally injects this env \u2014 if you are running inside taiji, check the runtime spawn env; standalone installs intentionally use the injected root.`
7559
7559
  );
7560
7560
  }
7561
7561
  return fallback;
@@ -7595,8 +7595,8 @@ function isUiResponse(value) {
7595
7595
  var NUL = "\0";
7596
7596
  function normalizeChannelName(markerLiteral) {
7597
7597
  let name = markerLiteral;
7598
- if (name.startsWith("XYZ_")) {
7599
- name = name.slice("XYZ_".length);
7598
+ if (name.startsWith("TAIJI_")) {
7599
+ name = name.slice("TAIJI_".length);
7600
7600
  }
7601
7601
  if (name.endsWith(":")) {
7602
7602
  name = name.slice(0, -1);
@@ -7685,25 +7685,25 @@ function createUiChannelRegistry() {
7685
7685
  // src/env.ts
7686
7686
  var logger3 = getLogger("engine-sdk/env");
7687
7687
  var ENGINE_ENV_PREFIXES = [
7688
- "XYZ_",
7689
- "XYZ_AGENT_",
7690
- "XYZ_SUBAGENT_"
7688
+ "TAIJI_",
7689
+ "TAIJI_AGENT_",
7690
+ "TAIJI_SUBAGENT_"
7691
7691
  ];
7692
7692
  var ENGINE_ENV_DENY_LIST = [
7693
- "XYZ_AGENT_PACKAGED",
7694
- "XYZ_RUNTIME_TOKEN",
7695
- "XYZ_AGENT_API_KEY",
7696
- "XYZ_SUBAGENT_RELAY_SESSION_ID",
7697
- "XYZ_SUBAGENT_RELAY_RECORD_ID"
7693
+ "TAIJI_AGENT_PACKAGED",
7694
+ "TAIJI_RUNTIME_TOKEN",
7695
+ "TAIJI_AGENT_API_KEY",
7696
+ "TAIJI_SUBAGENT_RELAY_SESSION_ID",
7697
+ "TAIJI_SUBAGENT_RELAY_RECORD_ID"
7698
7698
  ];
7699
7699
  var ENGINE_ENV_L0_INFRA_KEYS = [
7700
- "XYZ_AGENT_DATA_DIR",
7701
- "XYZ_AGENT_ENGINE_NODE",
7700
+ "TAIJI_AGENT_DATA_DIR",
7701
+ "TAIJI_AGENT_ENGINE_NODE",
7702
7702
  "ELECTRON_RUN_AS_NODE",
7703
- "XYZ_AGENT_SUBAGENT",
7704
- "XYZ_SUBAGENT_RELAY_SOCKET",
7705
- "XYZ_SUBAGENT_RELAY_NODE",
7706
- "XYZ_SUBAGENT_RELAY_SCRIPT"
7703
+ "TAIJI_AGENT_SUBAGENT",
7704
+ "TAIJI_SUBAGENT_RELAY_SOCKET",
7705
+ "TAIJI_SUBAGENT_RELAY_NODE",
7706
+ "TAIJI_SUBAGENT_RELAY_SCRIPT"
7707
7707
  ];
7708
7708
  var ENV_PREFIX_SHAPE_RE = /^[A-Za-z0-9_]+$/;
7709
7709
  function deleteEnvKeysCaseInsensitive(env, names) {
@@ -7753,14 +7753,14 @@ function applyManifestAllowlist(env, opts) {
7753
7753
  }
7754
7754
  }
7755
7755
  function injectL0InfraKeys(env, opts) {
7756
- env.XYZ_AGENT_DATA_DIR = opts.dataDir;
7757
- if (opts.engineNode !== void 0) env.XYZ_AGENT_ENGINE_NODE = opts.engineNode;
7756
+ env.TAIJI_AGENT_DATA_DIR = opts.dataDir;
7757
+ if (opts.engineNode !== void 0) env.TAIJI_AGENT_ENGINE_NODE = opts.engineNode;
7758
7758
  if (opts.electronRunAsNode === true) env.ELECTRON_RUN_AS_NODE = "1";
7759
- env.XYZ_AGENT_SUBAGENT = "1";
7759
+ env.TAIJI_AGENT_SUBAGENT = "1";
7760
7760
  if (opts.relay !== void 0) {
7761
- env.XYZ_SUBAGENT_RELAY_SOCKET = opts.relay.socket;
7762
- env.XYZ_SUBAGENT_RELAY_NODE = opts.relay.node;
7763
- env.XYZ_SUBAGENT_RELAY_SCRIPT = opts.relay.script;
7761
+ env.TAIJI_SUBAGENT_RELAY_SOCKET = opts.relay.socket;
7762
+ env.TAIJI_SUBAGENT_RELAY_NODE = opts.relay.node;
7763
+ env.TAIJI_SUBAGENT_RELAY_SCRIPT = opts.relay.script;
7764
7764
  }
7765
7765
  if (opts.identityEnv !== void 0) {
7766
7766
  for (const [key, value] of Object.entries(opts.identityEnv)) {
@@ -7831,7 +7831,7 @@ function spawnEngineChild(opts) {
7831
7831
  return child;
7832
7832
  }
7833
7833
  var DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS = 3e4;
7834
- var ENGINE_HOST_REQUEST_TIMEOUT_ENV = "XYZ_ENGINE_HOST_REQUEST_TIMEOUT_MS";
7834
+ var ENGINE_HOST_REQUEST_TIMEOUT_ENV = "TAIJI_ENGINE_HOST_REQUEST_TIMEOUT_MS";
7835
7835
  var SWEEP_INTERVAL_MS = 1e3;
7836
7836
  function resolveHostRequestTimeoutMs(opts) {
7837
7837
  if (opts.hostRequestTimeoutMs !== void 0) return opts.hostRequestTimeoutMs;
@@ -7918,7 +7918,7 @@ function pumpNdjsonLines(stream, onLine) {
7918
7918
 
7919
7919
  // src/node-executor.ts
7920
7920
  var import_node_child_process2 = require("child_process");
7921
- var ENGINE_NODE_ENV = "XYZ_AGENT_ENGINE_NODE";
7921
+ var ENGINE_NODE_ENV = "TAIJI_AGENT_ENGINE_NODE";
7922
7922
  var PROBE_TIMEOUT_MS = 5e3;
7923
7923
  function probeNodeExecutor(execPath, isElectron) {
7924
7924
  return new Promise((resolve) => {
@@ -7978,7 +7978,7 @@ async function resolvePiExtensionLaunch(entryPath, entryArgs, env) {
7978
7978
  if (engineNode === void 0 || engineNode === "") {
7979
7979
  throw engineNotFound(
7980
7980
  `pi extension host must spawn engines via injected executor ${ENGINE_NODE_ENV}, but it is not set (host process.execPath is the pi binary, not a node executor)`,
7981
- `The xyz-agent runtime injects ${ENGINE_NODE_ENV} when spawning the pi host. If you are running the extension inside a packaged app, report this as a packaging regression; standalone pi installs do not use the pi-extension host kind.`
7981
+ `The taiji runtime injects ${ENGINE_NODE_ENV} when spawning the pi host. If you are running the extension inside a packaged app, report this as a packaging regression; standalone pi installs do not use the pi-extension host kind.`
7982
7982
  );
7983
7983
  }
7984
7984
  const isElectron = env.ELECTRON_RUN_AS_NODE === "1";
@@ -8061,8 +8061,8 @@ function positiveIntEnv(env, key) {
8061
8061
  }
8062
8062
  function stderrRotationParams(env) {
8063
8063
  return {
8064
- maxBytes: positiveIntEnv(env, "XYZ_LOG_MAX_BYTES") ?? DEFAULT_STDERR_MAX_BYTES,
8065
- keepDays: positiveIntEnv(env, "XYZ_LOG_KEEP_DAYS") ?? DEFAULT_STDERR_KEEP_DAYS
8064
+ maxBytes: positiveIntEnv(env, "TAIJI_LOG_MAX_BYTES") ?? DEFAULT_STDERR_MAX_BYTES,
8065
+ keepDays: positiveIntEnv(env, "TAIJI_LOG_KEEP_DAYS") ?? DEFAULT_STDERR_KEEP_DAYS
8066
8066
  };
8067
8067
  }
8068
8068
  function stderrLogPathFor(engineDataDir, pid, prefix) {
@@ -8140,11 +8140,11 @@ function cleanupSiblingStderrLogs(logPath, env, prefix, now) {
8140
8140
  }
8141
8141
 
8142
8142
  // src/relay-env.ts
8143
- var RELAY_ENV_SOCKET = "XYZ_SUBAGENT_RELAY_SOCKET";
8144
- var RELAY_ENV_NODE = "XYZ_SUBAGENT_RELAY_NODE";
8145
- var RELAY_ENV_SCRIPT = "XYZ_SUBAGENT_RELAY_SCRIPT";
8146
- var RELAY_ENV_SESSION_ID = "XYZ_SUBAGENT_RELAY_SESSION_ID";
8147
- var RELAY_ENV_RECORD_ID = "XYZ_SUBAGENT_RELAY_RECORD_ID";
8143
+ var RELAY_ENV_SOCKET = "TAIJI_SUBAGENT_RELAY_SOCKET";
8144
+ var RELAY_ENV_NODE = "TAIJI_SUBAGENT_RELAY_NODE";
8145
+ var RELAY_ENV_SCRIPT = "TAIJI_SUBAGENT_RELAY_SCRIPT";
8146
+ var RELAY_ENV_SESSION_ID = "TAIJI_SUBAGENT_RELAY_SESSION_ID";
8147
+ var RELAY_ENV_RECORD_ID = "TAIJI_SUBAGENT_RELAY_RECORD_ID";
8148
8148
  var RELAY_PROTOCOL_VERSION = 1;
8149
8149
  var RELAY_EXIT_CODES = {
8150
8150
  /** 握手被拒:协议版本不匹配(安装损坏,重装应用)。 */
@@ -8307,7 +8307,7 @@ function runEngineCliEntry(opts) {
8307
8307
  STDERR_TAIL_CHARS,
8308
8308
  STDOUT_TAIL_ECHO_CHARS,
8309
8309
  SUPPORTED_PROTOCOL_RANGE,
8310
- XYZ_DATA_DIR_ENV,
8310
+ TAIJI_DATA_DIR_ENV,
8311
8311
  abortWithFallback,
8312
8312
  aggregateUsage,
8313
8313
  armEngineSelfDestruct,
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
1
  export { CANCEL_SETTLE_GRACE_MS, CRASH_REBUILD_BACKOFF_MS, CRASH_REBUILD_MAX_ATTEMPTS, CancelParams, CancelResult, DisposeParams, DisposeResult, ENGINE_EVENT_COALESCE_DEFAULT, ENGINE_EVENT_COALESCE_ENV, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, InitializeParams, InitializeResult, ListModelsParams, ListModelsResult, PROTOCOL_METHODS, PingParams, PingResult, ProbeParams, ProtocolMethod, ProtocolParamsMap, ProtocolResultMap, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReadParams, ReverseChannel, ReverseRequestTimeoutClass, RunContextParams, RunParams, RunResult, RunResumeParams, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, ValidateModelParams, ValidateModelResult, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.cjs';
2
- export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d 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 STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-CiOO3PMg.cjs';
3
- export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-C71Sqq8d.cjs';
2
+ export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d 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 STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-pT7RYTqQ.cjs';
3
+ export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-Dsvy79r3.cjs';
4
4
  export { SCHEMA_EMULATION_TAIL_CHARS, StructuredOutputResult, buildSchemaEmulationSegment, extractAndValidateStructuredOutput } from './schema-emulation.cjs';
5
5
  export { ExecutionNestingContext, ExecutionNestingState, NESTED_SPAWN_ENV, NestedSpawnRejectedError, SpawnEnv, assertNotNestedSpawn, buildNestedSpawnEnv } from './nesting-guard.cjs';
6
6
  export { CoreLogger, LogLevel, LoggerSink, configureLoggerSink, getLogger, resetLoggerSinkForTests } from './logger.cjs';
7
7
  export { DEFAULT_KILL_GRACE_MS, DEFAULT_NATIVE_INTERRUPT_GRACE_MS, HOST_TIMEOUT_ABORT_REASON, KillChainOptions, KillableChild, abortWithFallback, killChain, synthesizeTimeoutOutcome } from './kill-chain.cjs';
8
8
  export { ReplayRecordView, aggregateUsage, createReplayRecord, eventsToSessionView, sessionIdFromHandle, toReplayedTurn, updateFromEvent } from './journal-replay.cjs';
9
- export { XYZ_DATA_DIR_ENV, resetDataDirWarnForTests, resolveEngineDataDir } from './data-dir.cjs';
9
+ export { TAIJI_DATA_DIR_ENV, resetDataDirWarnForTests, resolveEngineDataDir } from './data-dir.cjs';
10
10
  export { resolveEngineDir, resolveEnginesRoot, resolveJournalPath, resolvePoolDir, sanitizeSeg } from './paths.cjs';
11
11
  export { UiMethod, UiRequest, UiRequestHandler, UiResponse, isUiResponse } from './ui-types.cjs';
12
12
  export { ChannelHandler, ExtensionUiRequestLike, ParsedChannel, UiChannelRegistry, createUiChannelRegistry, parseChannel } from './ui-channels.cjs';
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  export { CANCEL_SETTLE_GRACE_MS, CRASH_REBUILD_BACKOFF_MS, CRASH_REBUILD_MAX_ATTEMPTS, CancelParams, CancelResult, DisposeParams, DisposeResult, ENGINE_EVENT_COALESCE_DEFAULT, ENGINE_EVENT_COALESCE_ENV, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, InitializeParams, InitializeResult, ListModelsParams, ListModelsResult, PROTOCOL_METHODS, PingParams, PingResult, ProbeParams, ProtocolMethod, ProtocolParamsMap, ProtocolResultMap, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReadParams, ReverseChannel, ReverseRequestTimeoutClass, RunContextParams, RunParams, RunResult, RunResumeParams, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, ValidateModelParams, ValidateModelResult, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.js';
2
- export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d 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 STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-D5YlWaBx.js';
3
- export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-C71Sqq8d.js';
2
+ export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d 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 STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-DMGeUUUm.js';
3
+ export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-Dsvy79r3.js';
4
4
  export { SCHEMA_EMULATION_TAIL_CHARS, StructuredOutputResult, buildSchemaEmulationSegment, extractAndValidateStructuredOutput } from './schema-emulation.js';
5
5
  export { ExecutionNestingContext, ExecutionNestingState, NESTED_SPAWN_ENV, NestedSpawnRejectedError, SpawnEnv, assertNotNestedSpawn, buildNestedSpawnEnv } from './nesting-guard.js';
6
6
  export { CoreLogger, LogLevel, LoggerSink, configureLoggerSink, getLogger, resetLoggerSinkForTests } from './logger.js';
7
7
  export { DEFAULT_KILL_GRACE_MS, DEFAULT_NATIVE_INTERRUPT_GRACE_MS, HOST_TIMEOUT_ABORT_REASON, KillChainOptions, KillableChild, abortWithFallback, killChain, synthesizeTimeoutOutcome } from './kill-chain.js';
8
8
  export { ReplayRecordView, aggregateUsage, createReplayRecord, eventsToSessionView, sessionIdFromHandle, toReplayedTurn, updateFromEvent } from './journal-replay.js';
9
- export { XYZ_DATA_DIR_ENV, resetDataDirWarnForTests, resolveEngineDataDir } from './data-dir.js';
9
+ export { TAIJI_DATA_DIR_ENV, resetDataDirWarnForTests, resolveEngineDataDir } from './data-dir.js';
10
10
  export { resolveEngineDir, resolveEnginesRoot, resolveJournalPath, resolvePoolDir, sanitizeSeg } from './paths.js';
11
11
  export { UiMethod, UiRequest, UiRequestHandler, UiResponse, isUiResponse } from './ui-types.js';
12
12
  export { ChannelHandler, ExtensionUiRequestLike, ParsedChannel, UiChannelRegistry, createUiChannelRegistry, parseChannel } from './ui-channels.js';
package/dist/index.js CHANGED
@@ -24,28 +24,28 @@ import {
24
24
  import {
25
25
  createUiChannelRegistry,
26
26
  parseChannel
27
- } from "./chunk-7I4XGL5J.js";
27
+ } from "./chunk-BBWUC2EE.js";
28
28
  import {
29
29
  ENGINE_ENV_DENY_LIST,
30
30
  ENGINE_ENV_L0_INFRA_KEYS,
31
31
  ENGINE_ENV_PREFIXES,
32
32
  buildEngineChildEnv,
33
33
  buildOutboundChildEnv
34
- } from "./chunk-BBVZK5DL.js";
34
+ } from "./chunk-M3SZTDNQ.js";
35
35
  import {
36
36
  DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS,
37
37
  ENGINE_HOST_REQUEST_TIMEOUT_ENV,
38
38
  armEngineSelfDestruct,
39
39
  pumpNdjsonLines,
40
40
  spawnEngineChild
41
- } from "./chunk-3K2P2CM2.js";
41
+ } from "./chunk-CNQTJJF5.js";
42
42
  import {
43
43
  ENGINE_NODE_ENV,
44
44
  hostKindOf,
45
45
  probeNodeExecutor,
46
46
  resetEngineNodeProbeCache,
47
47
  resolveEngineNodeLaunch
48
- } from "./chunk-LKPVN3N6.js";
48
+ } from "./chunk-W3BKI2BP.js";
49
49
  import {
50
50
  DEFAULT_STDERR_KEEP_DAYS,
51
51
  DEFAULT_STDERR_MAX_BYTES,
@@ -56,7 +56,7 @@ import {
56
56
  stderrLogPathFor,
57
57
  stderrLogPidOf,
58
58
  stderrRotationParams
59
- } from "./chunk-HYES77BR.js";
59
+ } from "./chunk-MSAJXIP4.js";
60
60
  import {
61
61
  RELAY_ENV_NODE,
62
62
  RELAY_ENV_RECORD_ID,
@@ -67,7 +67,7 @@ import {
67
67
  RELAY_PROTOCOL_VERSION,
68
68
  isRelayActive,
69
69
  readRelayForwardEnv
70
- } from "./chunk-DSQ7JQKM.js";
70
+ } from "./chunk-GSW3DMN6.js";
71
71
  import {
72
72
  ENGINE_PROTOCOL_SCHEMAS,
73
73
  FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS,
@@ -97,7 +97,7 @@ import {
97
97
  NestedSpawnRejectedError,
98
98
  assertNotNestedSpawn,
99
99
  buildNestedSpawnEnv
100
- } from "./chunk-365AUV6N.js";
100
+ } from "./chunk-YE472JOO.js";
101
101
  import {
102
102
  DEFAULT_KILL_GRACE_MS,
103
103
  DEFAULT_NATIVE_INTERRUPT_GRACE_MS,
@@ -105,7 +105,7 @@ import {
105
105
  abortWithFallback,
106
106
  killChain,
107
107
  synthesizeTimeoutOutcome
108
- } from "./chunk-FJT23P7T.js";
108
+ } from "./chunk-QOEXD2FT.js";
109
109
  import {
110
110
  toErrorMessage
111
111
  } from "./chunk-PYO3YR7W.js";
@@ -133,7 +133,7 @@ import {
133
133
  isEngineProtocolErrorCode,
134
134
  isProtocolVersionCompatible,
135
135
  schemaEmulationFailedDetail
136
- } from "./chunk-WS4WAZVR.js";
136
+ } from "./chunk-WMDMXP2F.js";
137
137
  import {
138
138
  aggregateUsage,
139
139
  createReplayRecord,
@@ -143,10 +143,10 @@ import {
143
143
  updateFromEvent
144
144
  } from "./chunk-AIG5LSGK.js";
145
145
  import {
146
- XYZ_DATA_DIR_ENV,
146
+ TAIJI_DATA_DIR_ENV,
147
147
  resetDataDirWarnForTests,
148
148
  resolveEngineDataDir
149
- } from "./chunk-GT6YLLN4.js";
149
+ } from "./chunk-X24IVQKJ.js";
150
150
  import {
151
151
  configureLoggerSink,
152
152
  getLogger,
@@ -197,7 +197,7 @@ export {
197
197
  STDERR_TAIL_CHARS,
198
198
  STDOUT_TAIL_ECHO_CHARS,
199
199
  SUPPORTED_PROTOCOL_RANGE,
200
- XYZ_DATA_DIR_ENV,
200
+ TAIJI_DATA_DIR_ENV,
201
201
  abortWithFallback,
202
202
  aggregateUsage,
203
203
  armEngineSelfDestruct,
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent } from './contract-types-C71Sqq8d.cjs';
1
+ import { a as AgentEvent } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /**
4
4
  * 重放 journal:读取路径下全部事件,重放即得 AgentEvent 流(read 第②级)。
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent } from './contract-types-C71Sqq8d.js';
1
+ import { a as AgentEvent } from './contract-types-Dsvy79r3.js';
2
2
 
3
3
  /**
4
4
  * 重放 journal:读取路径下全部事件,重放即得 AgentEvent 流(read 第②级)。
@@ -1,4 +1,4 @@
1
- import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-C71Sqq8d.cjs';
1
+ import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /**
4
4
  * reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
@@ -1,4 +1,4 @@
1
- import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-C71Sqq8d.js';
1
+ import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-Dsvy79r3.js';
2
2
 
3
3
  /**
4
4
  * reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
@@ -1,5 +1,5 @@
1
- export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-CiOO3PMg.cjs';
2
- import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-C71Sqq8d.cjs';
1
+ export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-pT7RYTqQ.cjs';
2
+ import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-Dsvy79r3.cjs';
3
3
 
4
4
  /**
5
5
  * 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
@@ -1,5 +1,5 @@
1
- export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-D5YlWaBx.js';
2
- import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-C71Sqq8d.js';
1
+ export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-DMGeUUUm.js';
2
+ import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-Dsvy79r3.js';
3
3
 
4
4
  /**
5
5
  * 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
@@ -5,11 +5,11 @@ import {
5
5
  abortWithFallback,
6
6
  killChain,
7
7
  synthesizeTimeoutOutcome
8
- } from "./chunk-FJT23P7T.js";
8
+ } from "./chunk-QOEXD2FT.js";
9
9
  import "./chunk-PYO3YR7W.js";
10
10
  import {
11
11
  STDOUT_TAIL_ECHO_CHARS
12
- } from "./chunk-WS4WAZVR.js";
12
+ } from "./chunk-WMDMXP2F.js";
13
13
  import "./chunk-75QEMUGV.js";
14
14
  import "./chunk-JSBRDJBE.js";
15
15
  export {
@@ -60,8 +60,8 @@ function positiveIntEnv(env, key) {
60
60
  }
61
61
  function stderrRotationParams(env) {
62
62
  return {
63
- maxBytes: positiveIntEnv(env, "XYZ_LOG_MAX_BYTES") ?? DEFAULT_STDERR_MAX_BYTES,
64
- keepDays: positiveIntEnv(env, "XYZ_LOG_KEEP_DAYS") ?? DEFAULT_STDERR_KEEP_DAYS
63
+ maxBytes: positiveIntEnv(env, "TAIJI_LOG_MAX_BYTES") ?? DEFAULT_STDERR_MAX_BYTES,
64
+ keepDays: positiveIntEnv(env, "TAIJI_LOG_KEEP_DAYS") ?? DEFAULT_STDERR_KEEP_DAYS
65
65
  };
66
66
  }
67
67
  function stderrLogPathFor(engineDataDir, pid, prefix) {
@@ -1,7 +1,7 @@
1
1
  declare const DEFAULT_STDERR_MAX_BYTES: number;
2
2
  /** 缺省保留天数(与宿主 logger 同源缺省:7 天)。 */
3
3
  declare const DEFAULT_STDERR_KEEP_DAYS = 7;
4
- /** 轮转参数(env 覆盖面 = 宿主 logger 同款 XYZ_LOG_* 两键)。 */
4
+ /** 轮转参数(env 覆盖面 = 宿主 logger 同款 TAIJI_LOG_* 两键)。 */
5
5
  interface StderrRotationParams {
6
6
  maxBytes: number;
7
7
  keepDays: number;
@@ -1,7 +1,7 @@
1
1
  declare const DEFAULT_STDERR_MAX_BYTES: number;
2
2
  /** 缺省保留天数(与宿主 logger 同源缺省:7 天)。 */
3
3
  declare const DEFAULT_STDERR_KEEP_DAYS = 7;
4
- /** 轮转参数(env 覆盖面 = 宿主 logger 同款 XYZ_LOG_* 两键)。 */
4
+ /** 轮转参数(env 覆盖面 = 宿主 logger 同款 TAIJI_LOG_* 两键)。 */
5
5
  interface StderrRotationParams {
6
6
  maxBytes: number;
7
7
  keepDays: number;
@@ -8,7 +8,7 @@ import {
8
8
  stderrLogPathFor,
9
9
  stderrLogPidOf,
10
10
  stderrRotationParams
11
- } from "../chunk-HYES77BR.js";
11
+ } from "../chunk-MSAJXIP4.js";
12
12
  import "../chunk-JSBRDJBE.js";
13
13
  export {
14
14
  DEFAULT_STDERR_KEEP_DAYS,
@@ -28,7 +28,7 @@ __export(nesting_guard_exports, {
28
28
  });
29
29
  module.exports = __toCommonJS(nesting_guard_exports);
30
30
  var import_node_async_hooks = require("async_hooks");
31
- var NESTED_SPAWN_ENV = "XYZ_AGENT_SUBAGENT";
31
+ var NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
32
32
  var NATIVE_NESTED_KEYS = ["CLAUDECODE", "ZSW_NESTED"];
33
33
  var NATIVE_NESTED_PREFIXES = ["PI_SUBAGENT_"];
34
34
  var NestedSpawnRejectedError = class extends Error {
@@ -37,7 +37,7 @@ var NestedSpawnRejectedError = class extends Error {
37
37
  recovery;
38
38
  constructor() {
39
39
  super(
40
- "nested_spawn_rejected: this process is already a subagent (XYZ_AGENT_SUBAGENT=1)"
40
+ "nested_spawn_rejected: this process is already a subagent (TAIJI_AGENT_SUBAGENT=1)"
41
41
  );
42
42
  this.name = "NestedSpawnRejectedError";
43
43
  this.recovery = "Subagents must not spawn further subagents (unbounded recursion guard). Do the work directly inside the current task instead of delegating.";
@@ -1,5 +1,5 @@
1
1
  /** 统一嵌套标记 env 名(D8)。值恒 '1'。 */
2
- declare const NESTED_SPAWN_ENV = "XYZ_AGENT_SUBAGENT";
2
+ declare const NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
3
3
  /** env 对象形状(NodeJS.ProcessEnv 的结构子集,测试可传普通对象)。 */
4
4
  type SpawnEnv = Record<string, string | undefined>;
5
5
  /**
@@ -13,7 +13,7 @@ declare class NestedSpawnRejectedError extends Error {
13
13
  constructor();
14
14
  }
15
15
  /**
16
- * 构造子代理 spawn env:注入 XYZ_AGENT_SUBAGENT=1 + 剥离引擎原生嵌套标记。
16
+ * 构造子代理 spawn env:注入 TAIJI_AGENT_SUBAGENT=1 + 剥离引擎原生嵌套标记。
17
17
  * 返回新对象,不改入参(spawn env 组装链中的多层 spread 安全)。
18
18
  */
19
19
  declare function buildNestedSpawnEnv(baseEnv: SpawnEnv): SpawnEnv;
@@ -1,5 +1,5 @@
1
1
  /** 统一嵌套标记 env 名(D8)。值恒 '1'。 */
2
- declare const NESTED_SPAWN_ENV = "XYZ_AGENT_SUBAGENT";
2
+ declare const NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
3
3
  /** env 对象形状(NodeJS.ProcessEnv 的结构子集,测试可传普通对象)。 */
4
4
  type SpawnEnv = Record<string, string | undefined>;
5
5
  /**
@@ -13,7 +13,7 @@ declare class NestedSpawnRejectedError extends Error {
13
13
  constructor();
14
14
  }
15
15
  /**
16
- * 构造子代理 spawn env:注入 XYZ_AGENT_SUBAGENT=1 + 剥离引擎原生嵌套标记。
16
+ * 构造子代理 spawn env:注入 TAIJI_AGENT_SUBAGENT=1 + 剥离引擎原生嵌套标记。
17
17
  * 返回新对象,不改入参(spawn env 组装链中的多层 spread 安全)。
18
18
  */
19
19
  declare function buildNestedSpawnEnv(baseEnv: SpawnEnv): SpawnEnv;
@@ -4,7 +4,7 @@ import {
4
4
  NestedSpawnRejectedError,
5
5
  assertNotNestedSpawn,
6
6
  buildNestedSpawnEnv
7
- } from "./chunk-365AUV6N.js";
7
+ } from "./chunk-YE472JOO.js";
8
8
  import "./chunk-JSBRDJBE.js";
9
9
  export {
10
10
  ExecutionNestingContext,
@@ -48,7 +48,7 @@ var EngineSdkError = class extends Error {
48
48
  };
49
49
 
50
50
  // src/node-executor.ts
51
- var ENGINE_NODE_ENV = "XYZ_AGENT_ENGINE_NODE";
51
+ var ENGINE_NODE_ENV = "TAIJI_AGENT_ENGINE_NODE";
52
52
  var PROBE_TIMEOUT_MS = 5e3;
53
53
  function probeNodeExecutor(execPath, isElectron) {
54
54
  return new Promise((resolve) => {
@@ -108,7 +108,7 @@ async function resolvePiExtensionLaunch(entryPath, entryArgs, env) {
108
108
  if (engineNode === void 0 || engineNode === "") {
109
109
  throw engineNotFound(
110
110
  `pi extension host must spawn engines via injected executor ${ENGINE_NODE_ENV}, but it is not set (host process.execPath is the pi binary, not a node executor)`,
111
- `The xyz-agent runtime injects ${ENGINE_NODE_ENV} when spawning the pi host. If you are running the extension inside a packaged app, report this as a packaging regression; standalone pi installs do not use the pi-extension host kind.`
111
+ `The taiji runtime injects ${ENGINE_NODE_ENV} when spawning the pi host. If you are running the extension inside a packaged app, report this as a packaging regression; standalone pi installs do not use the pi-extension host kind.`
112
112
  );
113
113
  }
114
114
  const isElectron = env.ELECTRON_RUN_AS_NODE === "1";
@@ -1,5 +1,5 @@
1
- /** L0 注入的引擎执行器路径 env(与 relay 的 XYZ_SUBAGENT_RELAY_NODE 不复用)。 */
2
- declare const ENGINE_NODE_ENV = "XYZ_AGENT_ENGINE_NODE";
1
+ /** L0 注入的引擎执行器路径 env(与 relay 的 TAIJI_SUBAGENT_RELAY_NODE 不复用)。 */
2
+ declare const ENGINE_NODE_ENV = "TAIJI_AGENT_ENGINE_NODE";
3
3
  /**
4
4
  * 探针:验证执行器能以纯 node 语义执行 JS(先例 = runtime relay-env.ts:47-90)。
5
5
  *
@@ -20,7 +20,7 @@ interface EngineNodeLaunchOptions {
20
20
  args?: readonly string[];
21
21
  /** 宿主形态。 */
22
22
  hostKind: EngineNodeHostKind;
23
- /** 读取 XYZ_AGENT_ENGINE_NODE 的 env 快照(矩阵① 的注入通道)。 */
23
+ /** 读取 TAIJI_AGENT_ENGINE_NODE 的 env 快照(矩阵① 的注入通道)。 */
24
24
  env?: Record<string, string | undefined>;
25
25
  /** 宿主 process.execPath(缺省 process.execPath)。 */
26
26
  execPath?: string;
@@ -42,7 +42,7 @@ interface EngineNodeLaunch {
42
42
  *
43
43
  * 判定序(与规格逐行对应):
44
44
  * Windows + entry .cmd → cmd.exe /c 显式形态(禁 shell:true 的注入面);
45
- * pi-extension → 注入执行器(env XYZ_AGENT_ENGINE_NODE),缺失/探针失败 =
45
+ * pi-extension → 注入执行器(env TAIJI_AGENT_ENGINE_NODE),缺失/探针失败 =
46
46
  * engine_not_found + 指引;
47
47
  * runtime-sidecar → process.execPath(Electron 时 electronRunAsNode,探针先行);
48
48
  * standalone → PATH node(探针失败 = engine_not_found + 安装指引);
@@ -54,7 +54,7 @@ declare function resolveEngineNodeLaunch(opts: EngineNodeLaunchOptions): Promise
54
54
  /**
55
55
  * EngineClient 的自由字符串 hostKind('pi' / 'runtime' / …)→ 矩阵行归一:
56
56
  * 'runtime*' → runtime-sidecar(②:sidecar execPath 权威);
57
- * env 已注入 XYZ_AGENT_ENGINE_NODE(打包态 runtime 注入主 pi 进程的通道)→
57
+ * env 已注入 TAIJI_AGENT_ENGINE_NODE(打包态 runtime 注入主 pi 进程的通道)→
58
58
  * pi-extension(①:必须用注入执行器——pi 宿主自身 execPath 是 pi binary);
59
59
  * 其余 → standalone(③:PATH node)。
60
60
  */