@botiverse/raft-daemon 0.70.1 → 0.70.3

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.
@@ -1412,6 +1412,18 @@ function defineTraceFields(definitions) {
1412
1412
  }
1413
1413
  return definitions;
1414
1414
  }
1415
+ var TRACE_LIFECYCLE_SHADOW_SIGNAL_SITE_VALUES = [
1416
+ "daemon_ingest",
1417
+ "delivery_ack",
1418
+ "hint_resolution",
1419
+ "lifecycle_plan",
1420
+ "preserve_rebroadcast",
1421
+ "ready_online",
1422
+ "runtime_error",
1423
+ "slock_action_status",
1424
+ "starting_resolve",
1425
+ "synthetic_repair"
1426
+ ];
1415
1427
  var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
1416
1428
  { key: "row_kind", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "stable" },
1417
1429
  { key: "trace_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
@@ -1434,10 +1446,13 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
1434
1446
  { key: "route_pattern", fieldClass: "query_axis", placement: "span", valueKind: "route" },
1435
1447
  { key: "caller_kind", fieldClass: "query_axis", placement: "span", valueKind: "closed_enum", enumBinding: "stable" },
1436
1448
  { key: "server_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
1449
+ { key: "channel_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
1437
1450
  { key: "machine_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
1438
1451
  { key: "agent_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
1452
+ { key: "job_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
1439
1453
  { key: "launch_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
1440
1454
  { key: "session_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
1455
+ { key: "outcome", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
1441
1456
  { key: "observation_class", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
1442
1457
  { key: "action", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
1443
1458
  { key: "source", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
@@ -1456,7 +1471,7 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
1456
1471
  { key: "activity_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1457
1472
  { key: "status_bucket", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1458
1473
  { key: "shadow_agent_id", fieldClass: "family_query_axis", placement: "event", valueKind: "identity", scope: "family:lifecycle_shadow", highCardinality: true },
1459
- { key: "shadow_signal_site", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
1474
+ { key: "shadow_signal_site", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457", enumValues: TRACE_LIFECYCLE_SHADOW_SIGNAL_SITE_VALUES },
1460
1475
  { key: "shadow_observation_class", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
1461
1476
  { key: "shadow_prior_projection", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
1462
1477
  { key: "shadow_projection", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
@@ -1466,6 +1481,8 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
1466
1481
  { key: "shadow_direction", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
1467
1482
  { key: "shadow_plan_kind", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
1468
1483
  { key: "row_count", fieldClass: "detail", placement: "span_or_event", valueKind: "detail" },
1484
+ { key: "rows_copied", fieldClass: "detail", placement: "span_or_event", valueKind: "numeric" },
1485
+ { key: "batch_index", fieldClass: "detail", placement: "span_or_event", valueKind: "numeric" },
1469
1486
  { key: "retry_count", fieldClass: "detail", placement: "span_or_event", valueKind: "detail" },
1470
1487
  { key: "error_message", fieldClass: "detail", placement: "span_or_event", valueKind: "detail", contentRule: "scrub_and_short_retention" },
1471
1488
  { key: "query_text", fieldClass: "content_safety", placement: "span_or_event", valueKind: "content", contentRule: "scrub_and_short_retention" },
@@ -2283,6 +2300,7 @@ var agentApiServerInfoResponseSchema = passthroughObject({
2283
2300
  serverId: z2.string(),
2284
2301
  machineId: z2.string().nullable().optional(),
2285
2302
  machineName: z2.string().nullable().optional(),
2303
+ machineDescription: z2.string().nullable().optional(),
2286
2304
  machineHostname: z2.string().nullable().optional(),
2287
2305
  machineOs: z2.string().nullable().optional(),
2288
2306
  daemonVersion: z2.string().nullable().optional(),
@@ -3145,6 +3163,14 @@ var daemonApiContract = {
3145
3163
  })
3146
3164
  };
3147
3165
 
3166
+ // ../shared/src/authRefreshTiming.ts
3167
+ var AUTH_REFRESH_ROTATED_REPLAY_GRACE_MS = 1e4;
3168
+ var AUTH_REFRESH_ROTATION_DISCOVERY_LAG_BUDGET_MS = 1e3;
3169
+ var AUTH_REFRESH_ROTATED_TOKEN_WAIT_MS = 4e3;
3170
+ var AUTH_REFRESH_ROTATION_RETRY_RTT_BUDGET_MS = 1e3;
3171
+ var AUTH_REFRESH_ROTATION_LOSER_WORST_CHAIN_MS = AUTH_REFRESH_ROTATION_DISCOVERY_LAG_BUDGET_MS + AUTH_REFRESH_ROTATED_TOKEN_WAIT_MS + AUTH_REFRESH_ROTATION_RETRY_RTT_BUDGET_MS;
3172
+ var AUTH_REFRESH_ROTATION_REPLAY_GRACE_MARGIN_MS = AUTH_REFRESH_ROTATED_REPLAY_GRACE_MS - AUTH_REFRESH_ROTATION_LOSER_WORST_CHAIN_MS;
3173
+
3148
3174
  // ../shared/src/agentInbox.ts
3149
3175
  function formatAgentInboxDelta(rows, options = {}) {
3150
3176
  const totalPendingMessages = options.totalPendingMessages;
@@ -3318,7 +3344,8 @@ var SUPPORTED_TRANSLATION_LANGUAGE_CODES = [
3318
3344
  "es",
3319
3345
  "fr",
3320
3346
  "de",
3321
- "pt-br"
3347
+ "pt-br",
3348
+ "it"
3322
3349
  ];
3323
3350
  var SUPPORTED_TRANSLATION_LANGUAGE_SET = new Set(
3324
3351
  SUPPORTED_TRANSLATION_LANGUAGE_CODES
@@ -10083,15 +10110,37 @@ var KIMI_SDK_RUNTIME_SESSION_DESCRIPTOR = {
10083
10110
  busyDelivery: "direct",
10084
10111
  postTurn: "keep_alive"
10085
10112
  };
10086
- async function createKimiAgentSessionForContext(ctx, sessionId) {
10113
+ function composeStandingRoleAdditional(standingPrompt, wrapperPath) {
10114
+ const sections = [];
10115
+ if (standingPrompt) {
10116
+ sections.push(standingPrompt);
10117
+ }
10118
+ if (wrapperPath) {
10119
+ sections.push(
10120
+ `## CLI invocation note (Kimi SDK in-process runtime)
10121
+
10122
+ When you run \`raft\` CLI commands from your bash tool, **use this absolute path** because PATH is not pre-injected for the in-process Kimi SDK:
10123
+
10124
+ \`\`\`
10125
+ ${wrapperPath}
10126
+ \`\`\`
10127
+
10128
+ So instead of \`raft message send ...\`, run \`${wrapperPath} message send ...\` (every \`raft\` reference in the protocol above maps to this wrapper). The wrapper carries this agent's identity automatically; do not pass auth tokens explicitly.`
10129
+ );
10130
+ }
10131
+ return sections.join("\n\n---\n\n");
10132
+ }
10133
+ async function createKimiAgentSessionForContext(ctx, sessionId, deps = {}) {
10134
+ const createHarnessImpl = deps.createHarness ?? createKimiHarness;
10135
+ const prepareTransportImpl = deps.prepareTransport ?? prepareCliTransport;
10087
10136
  const sessionDir = buildKimiSessionDir(ctx.workingDirectory);
10088
10137
  mkdirSync2(sessionDir, { recursive: true });
10089
- const cliTransport = await prepareCliTransport(ctx, { NO_COLOR: "1" });
10138
+ const cliTransport = await prepareTransportImpl(ctx, { NO_COLOR: "1" });
10090
10139
  const spawnEnv = cliTransport.spawnEnv;
10091
10140
  const wrapperPath = cliTransport.wrapperPath;
10092
10141
  const homeDir = spawnEnv.KIMI_HOME || (process.env.HOME ? path10.join(process.env.HOME, ".kimi") : path10.join(ctx.workingDirectory, ".kimi"));
10093
10142
  mkdirSync2(homeDir, { recursive: true });
10094
- const harness = createKimiHarness({
10143
+ const harness = createHarnessImpl({
10095
10144
  homeDir,
10096
10145
  identity: {
10097
10146
  userAgentProduct: KIMI_CODE_USER_AGENT_PRODUCT,
@@ -10100,9 +10149,11 @@ async function createKimiAgentSessionForContext(ctx, sessionId) {
10100
10149
  }
10101
10150
  });
10102
10151
  const launchRuntimeFields = runtimeConfigToLaunchFields(hydrateRuntimeConfig(ctx.config));
10152
+ const roleAdditional = composeStandingRoleAdditional(ctx.standingPrompt, wrapperPath);
10103
10153
  const sessionFields = {
10104
10154
  workDir: ctx.workingDirectory,
10105
- ...launchRuntimeFields.model && launchRuntimeFields.model !== "default" ? { model: launchRuntimeFields.model } : {}
10155
+ ...launchRuntimeFields.model && launchRuntimeFields.model !== "default" ? { model: launchRuntimeFields.model } : {},
10156
+ ...roleAdditional ? { roleAdditional } : {}
10106
10157
  };
10107
10158
  let session;
10108
10159
  if (ctx.config.sessionId) {
@@ -10189,25 +10240,7 @@ var KimiSdkRuntimeSession = class {
10189
10240
  return { ok: true, acceptedAs: "prompt" };
10190
10241
  }
10191
10242
  composeFirstTurnPreamble(turnText) {
10192
- const sections = [];
10193
- if (this.ctx.standingPrompt) {
10194
- sections.push(this.ctx.standingPrompt);
10195
- }
10196
- if (this.wrapperPath) {
10197
- sections.push(
10198
- `## CLI invocation note (Kimi SDK in-process runtime)
10199
-
10200
- When you run \`raft\` CLI commands from your bash tool, **use this absolute path** because PATH is not pre-injected for the in-process Kimi SDK:
10201
-
10202
- \`\`\`
10203
- ${this.wrapperPath}
10204
- \`\`\`
10205
-
10206
- So instead of \`raft message send ...\`, run \`${this.wrapperPath} message send ...\` (every \`raft\` reference in the protocol above maps to this wrapper). The wrapper carries this agent's identity automatically; do not pass auth tokens explicitly.`
10207
- );
10208
- }
10209
- sections.push(turnText);
10210
- return sections.join("\n\n---\n\n");
10243
+ return turnText;
10211
10244
  }
10212
10245
  send(input) {
10213
10246
  if (this.didClose) return { ok: false, reason: "closed" };
@@ -10363,6 +10396,13 @@ function detectKimiSdkModels(home = resolveKimiHome(), ctx = {}) {
10363
10396
  }
10364
10397
  var KimiSdkDriver = class {
10365
10398
  id = "kimi-sdk";
10399
+ /**
10400
+ * Genuine native support: the standing prompt (and wrapper CLI note) are
10401
+ * mounted via the Kimi SDK's `roleAdditional` session option, which renders
10402
+ * into the base system prompt on every request and therefore survives context
10403
+ * compaction — no per-turn re-assertion needed. See
10404
+ * composeStandingRoleAdditional + createKimiAgentSessionForContext.
10405
+ */
10366
10406
  supportsNativeStandingPrompt = true;
10367
10407
  lifecycle = {
10368
10408
  kind: "persistent",
@@ -18810,12 +18850,29 @@ Use \`raft message read\` to catch up on the channels listed above, then stop. R
18810
18850
  }
18811
18851
  this.commitApmIdleState(agentId, ap, false);
18812
18852
  }
18813
- interruptCompactionIfActive(agentId) {
18853
+ interruptCompactionIfActive(agentId, options = {}) {
18814
18854
  const ap = this.agents.get(agentId);
18815
- if (!ap || ap.compaction.kind !== "active" && !ap.gatedSteering.compacting) return;
18855
+ if (!ap || ap.compaction.kind !== "active" && !ap.gatedSteering.compacting) return false;
18816
18856
  this.clearCompactionWatchdog(ap);
18817
18857
  const reduction = reduceApmGatedCompaction(ap.gatedSteering, { kind: "compaction_interrupted" });
18818
- this.commitGatedSteeringDecisionState(agentId, ap, reduction.nextState);
18858
+ this.commitGatedSteeringDecisionState(agentId, ap, reduction.nextState, { event: "compaction_interrupted" });
18859
+ if (options.traceAttrs) {
18860
+ this.recordRuntimeTraceEvent(agentId, ap, "runtime.context_compaction.interrupted", options.traceAttrs);
18861
+ }
18862
+ if (options.detail) {
18863
+ this.broadcastActivity(
18864
+ agentId,
18865
+ "error",
18866
+ options.detail,
18867
+ options.entries ?? [],
18868
+ void 0,
18869
+ options.detailKind ?? "runtime_error"
18870
+ );
18871
+ }
18872
+ if (options.flushBoundaryMessages) {
18873
+ this.flushCompactionBoundaryMessages(agentId, ap);
18874
+ }
18875
+ return true;
18819
18876
  }
18820
18877
  flushReviewBoundaryMessages(agentId, ap) {
18821
18878
  const reduction = reduceApmGatedReviewBoundaryFlush(ap.gatedSteering, {
@@ -19543,6 +19600,17 @@ Use \`raft message read\` to catch up on the channels listed above, then stop. R
19543
19600
  if (event.kind === "delivery_error") {
19544
19601
  if (ap) {
19545
19602
  this.restoreRuntimeDeliveryAfterAsyncRejection(agentId, ap, event);
19603
+ this.interruptCompactionIfActive(agentId, {
19604
+ detail: `Context compaction interrupted after runtime delivery failed: ${event.message}`,
19605
+ entries: [{ kind: "text", text: `Error: ${event.message}` }],
19606
+ flushBoundaryMessages: true,
19607
+ traceAttrs: {
19608
+ reason: "delivery_error",
19609
+ request_method: event.requestMethod,
19610
+ source: event.source,
19611
+ payloadBytes: event.payloadBytes
19612
+ }
19613
+ });
19546
19614
  } else {
19547
19615
  this.recordDaemonTrace("daemon.agent.delivery_error.received_without_process", {
19548
19616
  agentId,
@@ -22324,7 +22392,7 @@ function resolveSlockCliPathOrEmpty(moduleUrl = import.meta.url) {
22324
22392
  }
22325
22393
  async function runBundledSlockCli(argv) {
22326
22394
  process.argv = [process.execPath, "slock", ...argv];
22327
- await import("./dist-D77BWHH4.js");
22395
+ await import("./dist-GL6ZFVL7.js");
22328
22396
  }
22329
22397
  function detectRuntimes(tracer = noopTracer) {
22330
22398
  const ids = [];
package/dist/cli/index.js CHANGED
@@ -28823,6 +28823,18 @@ function defineTraceFields(definitions) {
28823
28823
  }
28824
28824
  return definitions;
28825
28825
  }
28826
+ var TRACE_LIFECYCLE_SHADOW_SIGNAL_SITE_VALUES = [
28827
+ "daemon_ingest",
28828
+ "delivery_ack",
28829
+ "hint_resolution",
28830
+ "lifecycle_plan",
28831
+ "preserve_rebroadcast",
28832
+ "ready_online",
28833
+ "runtime_error",
28834
+ "slock_action_status",
28835
+ "starting_resolve",
28836
+ "synthetic_repair"
28837
+ ];
28826
28838
  var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28827
28839
  { key: "row_kind", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "stable" },
28828
28840
  { key: "trace_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
@@ -28845,10 +28857,13 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28845
28857
  { key: "route_pattern", fieldClass: "query_axis", placement: "span", valueKind: "route" },
28846
28858
  { key: "caller_kind", fieldClass: "query_axis", placement: "span", valueKind: "closed_enum", enumBinding: "stable" },
28847
28859
  { key: "server_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28860
+ { key: "channel_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
28848
28861
  { key: "machine_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28849
28862
  { key: "agent_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
28863
+ { key: "job_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
28850
28864
  { key: "launch_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28851
28865
  { key: "session_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28866
+ { key: "outcome", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28852
28867
  { key: "observation_class", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28853
28868
  { key: "action", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28854
28869
  { key: "source", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
@@ -28867,7 +28882,7 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28867
28882
  { key: "activity_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28868
28883
  { key: "status_bucket", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28869
28884
  { key: "shadow_agent_id", fieldClass: "family_query_axis", placement: "event", valueKind: "identity", scope: "family:lifecycle_shadow", highCardinality: true },
28870
- { key: "shadow_signal_site", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28885
+ { key: "shadow_signal_site", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457", enumValues: TRACE_LIFECYCLE_SHADOW_SIGNAL_SITE_VALUES },
28871
28886
  { key: "shadow_observation_class", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28872
28887
  { key: "shadow_prior_projection", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28873
28888
  { key: "shadow_projection", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
@@ -28877,6 +28892,8 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28877
28892
  { key: "shadow_direction", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28878
28893
  { key: "shadow_plan_kind", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28879
28894
  { key: "row_count", fieldClass: "detail", placement: "span_or_event", valueKind: "detail" },
28895
+ { key: "rows_copied", fieldClass: "detail", placement: "span_or_event", valueKind: "numeric" },
28896
+ { key: "batch_index", fieldClass: "detail", placement: "span_or_event", valueKind: "numeric" },
28880
28897
  { key: "retry_count", fieldClass: "detail", placement: "span_or_event", valueKind: "detail" },
28881
28898
  { key: "error_message", fieldClass: "detail", placement: "span_or_event", valueKind: "detail", contentRule: "scrub_and_short_retention" },
28882
28899
  { key: "query_text", fieldClass: "content_safety", placement: "span_or_event", valueKind: "content", contentRule: "scrub_and_short_retention" },
@@ -43187,6 +43204,7 @@ var agentApiServerInfoResponseSchema = passthroughObject({
43187
43204
  serverId: external_exports.string(),
43188
43205
  machineId: external_exports.string().nullable().optional(),
43189
43206
  machineName: external_exports.string().nullable().optional(),
43207
+ machineDescription: external_exports.string().nullable().optional(),
43190
43208
  machineHostname: external_exports.string().nullable().optional(),
43191
43209
  machineOs: external_exports.string().nullable().optional(),
43192
43210
  daemonVersion: external_exports.string().nullable().optional(),
@@ -44394,6 +44412,15 @@ function parseDaemonApiResponse(routeKey, data) {
44394
44412
  return daemonApiContract[routeKey].response.body.parse(data);
44395
44413
  }
44396
44414
 
44415
+ // ../shared/src/authRefreshTiming.ts
44416
+ init_esm_shims();
44417
+ var AUTH_REFRESH_ROTATED_REPLAY_GRACE_MS = 1e4;
44418
+ var AUTH_REFRESH_ROTATION_DISCOVERY_LAG_BUDGET_MS = 1e3;
44419
+ var AUTH_REFRESH_ROTATED_TOKEN_WAIT_MS = 4e3;
44420
+ var AUTH_REFRESH_ROTATION_RETRY_RTT_BUDGET_MS = 1e3;
44421
+ var AUTH_REFRESH_ROTATION_LOSER_WORST_CHAIN_MS = AUTH_REFRESH_ROTATION_DISCOVERY_LAG_BUDGET_MS + AUTH_REFRESH_ROTATED_TOKEN_WAIT_MS + AUTH_REFRESH_ROTATION_RETRY_RTT_BUDGET_MS;
44422
+ var AUTH_REFRESH_ROTATION_REPLAY_GRACE_MARGIN_MS = AUTH_REFRESH_ROTATED_REPLAY_GRACE_MS - AUTH_REFRESH_ROTATION_LOSER_WORST_CHAIN_MS;
44423
+
44397
44424
  // ../shared/src/daemonApiRawClient.ts
44398
44425
  init_esm_shims();
44399
44426
  function failure2(routeKey, reason, message, details = {}) {
@@ -44858,7 +44885,8 @@ var SUPPORTED_TRANSLATION_LANGUAGE_CODES = [
44858
44885
  "es",
44859
44886
  "fr",
44860
44887
  "de",
44861
- "pt-br"
44888
+ "pt-br",
44889
+ "it"
44862
44890
  ];
44863
44891
  var SUPPORTED_TRANSLATION_LANGUAGE_SET = new Set(
44864
44892
  SUPPORTED_TRANSLATION_LANGUAGE_CODES
@@ -48470,6 +48498,7 @@ function formatRuntimeContext(ctx) {
48470
48498
  const label = ctx.machineName && ctx.machineId ? `${ctx.machineName} (${ctx.machineId})` : ctx.machineName || ctx.machineId;
48471
48499
  lines.push(`- Computer: ${label}`);
48472
48500
  }
48501
+ if (ctx.machineDescription) lines.push(`- Computer Description: ${ctx.machineDescription}`);
48473
48502
  if (ctx.machineHostname) lines.push(`- Hostname: ${ctx.machineHostname}`);
48474
48503
  if (ctx.machineOs) lines.push(`- OS: ${ctx.machineOs}`);
48475
48504
  if (ctx.daemonVersion) lines.push(`- Daemon: v${ctx.daemonVersion}`);
package/dist/core.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  runBundledSlockCli,
17
17
  scanWorkspaceDirectories,
18
18
  subscribeDaemonLogs
19
- } from "./chunk-SIGIQH6T.js";
19
+ } from "./chunk-JNRVF35M.js";
20
20
  export {
21
21
  AGENT_MIGRATION_BUNDLE_SCHEMA_VERSION,
22
22
  AgentMigrationGrantRegistry,
@@ -28565,6 +28565,18 @@ function defineTraceFields(definitions) {
28565
28565
  }
28566
28566
  return definitions;
28567
28567
  }
28568
+ var TRACE_LIFECYCLE_SHADOW_SIGNAL_SITE_VALUES = [
28569
+ "daemon_ingest",
28570
+ "delivery_ack",
28571
+ "hint_resolution",
28572
+ "lifecycle_plan",
28573
+ "preserve_rebroadcast",
28574
+ "ready_online",
28575
+ "runtime_error",
28576
+ "slock_action_status",
28577
+ "starting_resolve",
28578
+ "synthetic_repair"
28579
+ ];
28568
28580
  var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28569
28581
  { key: "row_kind", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "stable" },
28570
28582
  { key: "trace_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
@@ -28587,10 +28599,13 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28587
28599
  { key: "route_pattern", fieldClass: "query_axis", placement: "span", valueKind: "route" },
28588
28600
  { key: "caller_kind", fieldClass: "query_axis", placement: "span", valueKind: "closed_enum", enumBinding: "stable" },
28589
28601
  { key: "server_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28602
+ { key: "channel_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
28590
28603
  { key: "machine_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28591
28604
  { key: "agent_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
28605
+ { key: "job_id", fieldClass: "query_axis", placement: "span_or_event", valueKind: "identity", highCardinality: true },
28592
28606
  { key: "launch_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28593
28607
  { key: "session_id", fieldClass: "query_axis", placement: "span", valueKind: "identity", highCardinality: true },
28608
+ { key: "outcome", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28594
28609
  { key: "observation_class", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28595
28610
  { key: "action", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28596
28611
  { key: "source", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
@@ -28609,7 +28624,7 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28609
28624
  { key: "activity_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28610
28625
  { key: "status_bucket", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28611
28626
  { key: "shadow_agent_id", fieldClass: "family_query_axis", placement: "event", valueKind: "identity", scope: "family:lifecycle_shadow", highCardinality: true },
28612
- { key: "shadow_signal_site", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28627
+ { key: "shadow_signal_site", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457", enumValues: TRACE_LIFECYCLE_SHADOW_SIGNAL_SITE_VALUES },
28613
28628
  { key: "shadow_observation_class", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28614
28629
  { key: "shadow_prior_projection", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28615
28630
  { key: "shadow_projection", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
@@ -28619,6 +28634,8 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28619
28634
  { key: "shadow_direction", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28620
28635
  { key: "shadow_plan_kind", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:lifecycle_shadow", enumBinding: "pending_457" },
28621
28636
  { key: "row_count", fieldClass: "detail", placement: "span_or_event", valueKind: "detail" },
28637
+ { key: "rows_copied", fieldClass: "detail", placement: "span_or_event", valueKind: "numeric" },
28638
+ { key: "batch_index", fieldClass: "detail", placement: "span_or_event", valueKind: "numeric" },
28622
28639
  { key: "retry_count", fieldClass: "detail", placement: "span_or_event", valueKind: "detail" },
28623
28640
  { key: "error_message", fieldClass: "detail", placement: "span_or_event", valueKind: "detail", contentRule: "scrub_and_short_retention" },
28624
28641
  { key: "query_text", fieldClass: "content_safety", placement: "span_or_event", valueKind: "content", contentRule: "scrub_and_short_retention" },
@@ -42743,6 +42760,7 @@ var agentApiServerInfoResponseSchema = passthroughObject({
42743
42760
  serverId: external_exports.string(),
42744
42761
  machineId: external_exports.string().nullable().optional(),
42745
42762
  machineName: external_exports.string().nullable().optional(),
42763
+ machineDescription: external_exports.string().nullable().optional(),
42746
42764
  machineHostname: external_exports.string().nullable().optional(),
42747
42765
  machineOs: external_exports.string().nullable().optional(),
42748
42766
  daemonVersion: external_exports.string().nullable().optional(),
@@ -43944,6 +43962,13 @@ function parseDaemonApiResponse(routeKey, data) {
43944
43962
  return daemonApiContract[routeKey].response.body.parse(data);
43945
43963
  }
43946
43964
  init_esm_shims();
43965
+ var AUTH_REFRESH_ROTATED_REPLAY_GRACE_MS = 1e4;
43966
+ var AUTH_REFRESH_ROTATION_DISCOVERY_LAG_BUDGET_MS = 1e3;
43967
+ var AUTH_REFRESH_ROTATED_TOKEN_WAIT_MS = 4e3;
43968
+ var AUTH_REFRESH_ROTATION_RETRY_RTT_BUDGET_MS = 1e3;
43969
+ var AUTH_REFRESH_ROTATION_LOSER_WORST_CHAIN_MS = AUTH_REFRESH_ROTATION_DISCOVERY_LAG_BUDGET_MS + AUTH_REFRESH_ROTATED_TOKEN_WAIT_MS + AUTH_REFRESH_ROTATION_RETRY_RTT_BUDGET_MS;
43970
+ var AUTH_REFRESH_ROTATION_REPLAY_GRACE_MARGIN_MS = AUTH_REFRESH_ROTATED_REPLAY_GRACE_MS - AUTH_REFRESH_ROTATION_LOSER_WORST_CHAIN_MS;
43971
+ init_esm_shims();
43947
43972
  function failure2(routeKey, reason, message, details = {}) {
43948
43973
  return {
43949
43974
  ok: false,
@@ -44398,7 +44423,8 @@ var SUPPORTED_TRANSLATION_LANGUAGE_CODES = [
44398
44423
  "es",
44399
44424
  "fr",
44400
44425
  "de",
44401
- "pt-br"
44426
+ "pt-br",
44427
+ "it"
44402
44428
  ];
44403
44429
  var SUPPORTED_TRANSLATION_LANGUAGE_SET = new Set(
44404
44430
  SUPPORTED_TRANSLATION_LANGUAGE_CODES
@@ -47938,6 +47964,7 @@ function formatRuntimeContext(ctx) {
47938
47964
  const label = ctx.machineName && ctx.machineId ? `${ctx.machineName} (${ctx.machineId})` : ctx.machineName || ctx.machineId;
47939
47965
  lines.push(`- Computer: ${label}`);
47940
47966
  }
47967
+ if (ctx.machineDescription) lines.push(`- Computer Description: ${ctx.machineDescription}`);
47941
47968
  if (ctx.machineHostname) lines.push(`- Hostname: ${ctx.machineHostname}`);
47942
47969
  if (ctx.machineOs) lines.push(`- OS: ${ctx.machineOs}`);
47943
47970
  if (ctx.daemonVersion) lines.push(`- Daemon: v${ctx.daemonVersion}`);
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DAEMON_CLI_USAGE,
4
4
  DaemonCore,
5
5
  parseDaemonCliArgs
6
- } from "./chunk-SIGIQH6T.js";
6
+ } from "./chunk-JNRVF35M.js";
7
7
 
8
8
  // src/index.ts
9
9
  var parsedArgs = parseDaemonCliArgs(process.argv.slice(2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botiverse/raft-daemon",
3
- "version": "0.70.1",
3
+ "version": "0.70.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "raft-daemon": "dist/raft-daemon.js",
@@ -45,7 +45,7 @@
45
45
  "release:alpha": "npm version prerelease --preid=alpha --no-git-tag-version && cd ../.. && pnpm install --lockfile-only && git add packages/daemon/package.json pnpm-lock.yaml && git commit -m \"chore: bump @botiverse/raft-daemon to v$(node -p \"require('./packages/daemon/package.json').version\")\" && git tag daemon-v$(node -p \"require('./packages/daemon/package.json').version\") && git push && git push --tags"
46
46
  },
47
47
  "dependencies": {
48
- "@botiverse/kimi-code-sdk": "0.20.1-botiverse.0",
48
+ "@botiverse/kimi-code-sdk": "0.20.1-botiverse.1",
49
49
  "@earendil-works/pi-ai": "0.80.3",
50
50
  "@earendil-works/pi-coding-agent": "0.80.3",
51
51
  "@jackwener/opencli": "^1.8.3",