@skrr-ai/cli 0.1.142 → 0.1.144

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 (156) hide show
  1. package/README.md +8 -0
  2. package/dist/base-command.d.ts +4 -2
  3. package/dist/base-command.js +46 -13
  4. package/dist/commands/agenda/trigger/create.js +4 -2
  5. package/dist/commands/agenda/trigger/list.js +7 -7
  6. package/dist/commands/agent/message/approve.d.ts +17 -0
  7. package/dist/commands/agent/message/approve.js +72 -0
  8. package/dist/commands/agent/message/decline.d.ts +17 -0
  9. package/dist/commands/agent/message/decline.js +72 -0
  10. package/dist/commands/agent/message/pending.d.ts +18 -0
  11. package/dist/commands/agent/message/pending.js +79 -0
  12. package/dist/commands/agents/always-on/disable.js +9 -1
  13. package/dist/commands/agents/always-on/enable.js +9 -1
  14. package/dist/commands/agents/always-on/status.js +14 -1
  15. package/dist/commands/agents/create.js +10 -1
  16. package/dist/commands/agents/delete.d.ts +51 -0
  17. package/dist/commands/agents/delete.js +163 -2
  18. package/dist/commands/agents/intuitions/list.js +1 -1
  19. package/dist/commands/agents/plan-day.d.ts +39 -7
  20. package/dist/commands/agents/plan-day.js +254 -65
  21. package/dist/commands/agents/proactive-audit.d.ts +22 -0
  22. package/dist/commands/agents/proactive-audit.js +86 -0
  23. package/dist/commands/agents/schedule-overview.d.ts +7 -0
  24. package/dist/commands/agents/schedule-overview.js +43 -5
  25. package/dist/commands/agents/schedule-trace.js +30 -19
  26. package/dist/commands/agents/spawn.d.ts +51 -0
  27. package/dist/commands/agents/spawn.js +212 -9
  28. package/dist/commands/agents/todos/cancel.js +3 -0
  29. package/dist/commands/agents/todos/edit.js +1 -1
  30. package/dist/commands/agents/todos/list.d.ts +5 -0
  31. package/dist/commands/agents/todos/list.js +19 -5
  32. package/dist/commands/agents/triggers/create.js +1 -1
  33. package/dist/commands/agents/triggers/policy.js +7 -0
  34. package/dist/commands/agents/triggers/update.js +1 -1
  35. package/dist/commands/commitments/create.js +13 -3
  36. package/dist/commands/commitments/preflight.js +31 -5
  37. package/dist/commands/daemon/index.js +1 -0
  38. package/dist/commands/daemon/logs.d.ts +8 -1
  39. package/dist/commands/daemon/logs.js +32 -22
  40. package/dist/commands/daemon/profile.d.ts +15 -0
  41. package/dist/commands/daemon/profile.js +51 -0
  42. package/dist/commands/goals/briefing/status.js +1 -1
  43. package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
  44. package/dist/commands/initiatives/worker/deactivate.js +78 -0
  45. package/dist/commands/login.js +8 -2
  46. package/dist/commands/logout.d.ts +20 -0
  47. package/dist/commands/logout.js +110 -5
  48. package/dist/commands/machines/profiles/disconnect.d.ts +23 -0
  49. package/dist/commands/machines/profiles/disconnect.js +102 -0
  50. package/dist/commands/machines/profiles/index.d.ts +15 -0
  51. package/dist/commands/machines/profiles/index.js +33 -0
  52. package/dist/commands/machines/profiles/label.d.ts +24 -0
  53. package/dist/commands/machines/profiles/label.js +85 -0
  54. package/dist/commands/machines/profiles/list.d.ts +16 -0
  55. package/dist/commands/machines/profiles/list.js +87 -0
  56. package/dist/commands/memory/maintain.js +16 -2
  57. package/dist/commands/profiles/list.js +17 -2
  58. package/dist/commands/spaces/delete.js +6 -1
  59. package/dist/commands/spaces/workflows/archive.js +6 -1
  60. package/dist/commands/spaces/workflows/publish.js +3 -1
  61. package/dist/commands/spaces/workflows/run.d.ts +1 -0
  62. package/dist/commands/spaces/workflows/run.js +17 -1
  63. package/dist/commands/spaces/workflows/triggers/create.js +3 -1
  64. package/dist/commands/tasks/workflow-context.js +3 -1
  65. package/dist/commands/triggers/authorization.js +1 -1
  66. package/dist/commands/triggers/capabilities.js +17 -1
  67. package/dist/commands/triggers/create.d.ts +2 -0
  68. package/dist/commands/triggers/create.js +23 -7
  69. package/dist/commands/triggers/fire-detail.js +12 -3
  70. package/dist/commands/triggers/list.d.ts +1 -0
  71. package/dist/commands/triggers/list.js +13 -1
  72. package/dist/commands/triggers/preflight.js +18 -0
  73. package/dist/commands/triggers/prune.js +9 -5
  74. package/dist/commands/triggers/update.js +13 -4
  75. package/dist/generated/agent-guides.json +35 -35
  76. package/dist/lib/agent-guides.js +1 -1
  77. package/dist/lib/agent-proactive-baseline.d.ts +6 -0
  78. package/dist/lib/agent-proactive-baseline.js +32 -3
  79. package/dist/lib/always-on-command-result.d.ts +18 -0
  80. package/dist/lib/always-on-command-result.js +52 -0
  81. package/dist/lib/always-on-runtime.d.ts +31 -0
  82. package/dist/lib/always-on-runtime.js +39 -0
  83. package/dist/lib/auth-diagnostics.d.ts +10 -1
  84. package/dist/lib/auth-diagnostics.js +16 -8
  85. package/dist/lib/commitments.d.ts +16 -9
  86. package/dist/lib/commitments.js +65 -4
  87. package/dist/lib/compasses.js +5 -0
  88. package/dist/lib/daemon-binding.js +6 -3
  89. package/dist/lib/daemon-command-hint.d.ts +10 -5
  90. package/dist/lib/daemon-command-hint.js +11 -6
  91. package/dist/lib/daemon-setup.js +9 -3
  92. package/dist/lib/daemonBroker.d.ts +7 -0
  93. package/dist/lib/daemonBroker.js +5 -0
  94. package/dist/lib/daemonHandoff.d.ts +2 -0
  95. package/dist/lib/daemonHandoff.js +16 -3
  96. package/dist/lib/daemonIslandProfile.d.ts +19 -0
  97. package/dist/lib/daemonIslandProfile.js +41 -0
  98. package/dist/lib/drain-stdio.d.ts +22 -0
  99. package/dist/lib/drain-stdio.js +46 -0
  100. package/dist/lib/format.d.ts +32 -0
  101. package/dist/lib/format.js +105 -1
  102. package/dist/lib/initiatives-worker.d.ts +25 -0
  103. package/dist/lib/initiatives-worker.js +13 -0
  104. package/dist/lib/keychain.d.ts +22 -1
  105. package/dist/lib/keychain.js +40 -1
  106. package/dist/lib/local-daemon-readiness.js +4 -6
  107. package/dist/lib/local-skills.js +4 -1
  108. package/dist/lib/login.d.ts +7 -0
  109. package/dist/lib/login.js +5 -0
  110. package/dist/lib/machines.d.ts +68 -0
  111. package/dist/lib/machines.js +67 -0
  112. package/dist/lib/proactive-audit.d.ts +52 -0
  113. package/dist/lib/proactive-audit.js +67 -0
  114. package/dist/lib/proactiveApi.d.ts +23 -0
  115. package/dist/lib/refresh.d.ts +20 -6
  116. package/dist/lib/refresh.js +27 -9
  117. package/dist/lib/roles.d.ts +1 -1
  118. package/dist/lib/runtime-start-verification.js +3 -6
  119. package/dist/lib/schedule.d.ts +189 -9
  120. package/dist/lib/schedule.js +283 -22
  121. package/dist/lib/triggers.d.ts +134 -3
  122. package/dist/lib/triggers.js +370 -17
  123. package/dist/lib/workflow-node-control.js +8 -0
  124. package/dist/lib/workflow-run-view.js +9 -0
  125. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +12 -0
  126. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +10 -2
  127. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +8 -0
  128. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +22 -0
  129. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.d.ts +133 -0
  130. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +180 -0
  131. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +5 -3
  132. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +50 -0
  133. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.d.ts +137 -0
  134. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.js +328 -0
  135. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.d.ts +63 -0
  136. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.js +174 -0
  137. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
  138. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
  139. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +12 -0
  140. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +14 -0
  141. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +8 -0
  142. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +27 -0
  143. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.d.ts +133 -0
  144. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +183 -0
  145. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +5 -3
  146. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +11 -3
  147. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.d.ts +137 -0
  148. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +333 -0
  149. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.d.ts +63 -0
  150. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.js +212 -0
  151. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
  152. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
  153. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  154. package/dist/node_modules/@skrr-ai/data-provider/index.js +7446 -7378
  155. package/oclif.manifest.json +844 -47
  156. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.triggerApi = exports.AgentTriggerScopeError = exports.TRIGGER_MODE_REQUIRED_FLAGS = exports.TRIGGER_CREATE_FIELD_FLAGS = exports.FLAG_OWNER_KINDS = exports.SCOPE_IMPLIED_REF_KEY = exports.TRIGGER_EVENT_CATALOG = exports.TRIGGER_EVENT_ENTITY_TYPES = exports.TRIGGER_CHAT_AUTH_MODES = exports.TRIGGER_CHAT_RESPONSE_MODES = exports.TRIGGER_CHAT_MODES = exports.TRIGGER_FORM_RESPONSE_MODES = exports.TRIGGER_CONCURRENCY_POLICIES = exports.TRIGGER_EVENT_FILTER_MODES = exports.TRIGGER_EXECUTOR_MODES = exports.TRIGGER_SCOPE_KINDS = exports.TRIGGER_KINDS = void 0;
3
+ exports.triggerApi = exports.TRIGGER_LIMIT_CEILING = exports.TRIGGER_MODE_FLAG_DESCRIPTION = exports.TRIGGER_WINDOW_FLAG_HELP = exports.AgentTriggerScopeError = exports.TRIGGER_MODE_REQUIRED_FLAGS = exports.TRIGGER_CREATE_FIELD_FLAGS = exports.FLAG_OWNER_KINDS = exports.SCOPE_IMPLIED_REF_KEY = exports.TRIGGER_EVENT_CATALOG = exports.TRIGGER_EVENT_ENTITY_TYPES = exports.TRIGGER_CHAT_AUTH_MODES = exports.TRIGGER_CHAT_RESPONSE_MODES = exports.TRIGGER_CHAT_MODES = exports.TRIGGER_FORM_RESPONSE_MODES = exports.TRIGGER_CONCURRENCY_POLICIES = exports.TRIGGER_EVENT_FILTER_MODES = exports.TRIGGER_EXECUTOR_MODES = exports.TRIGGER_SCOPE_KINDS = exports.TRIGGER_KINDS = void 0;
4
4
  exports.validateEventReference = validateEventReference;
5
5
  exports.validateEventFilter = validateEventFilter;
6
6
  exports.serverEventCatalogIncludes = serverEventCatalogIncludes;
7
7
  exports.parseKeyValueFlags = parseKeyValueFlags;
8
+ exports.refEntitiesFromRefFlags = refEntitiesFromRefFlags;
8
9
  exports.parseJsonObject = parseJsonObject;
9
10
  exports.parseJsonArray = parseJsonArray;
10
11
  exports.buildBuiltinActionPayload = buildBuiltinActionPayload;
@@ -46,16 +47,25 @@ exports.degradedMarker = degradedMarker;
46
47
  exports.sensorHealthLines = sensorHealthLines;
47
48
  exports.renderTriggerList = renderTriggerList;
48
49
  exports.formatDuplicateSubscriptionWarning = formatDuplicateSubscriptionWarning;
50
+ exports.windowAuthoringAdvice = windowAuthoringAdvice;
51
+ exports.schedulerLimitSentence = schedulerLimitSentence;
49
52
  exports.armedStateLabel = armedStateLabel;
50
53
  exports.writeModeLabel = writeModeLabel;
51
54
  exports.webhookIngestUrl = webhookIngestUrl;
52
55
  exports.toolsRefusedHintLines = toolsRefusedHintLines;
53
56
  exports.fireRefusalLines = fireRefusalLines;
57
+ exports.executorModeEffect = executorModeEffect;
58
+ exports.debounceSummaryLine = debounceSummaryLine;
59
+ exports.scheduleSummaryLine = scheduleSummaryLine;
60
+ exports.builtinActionLine = builtinActionLine;
54
61
  exports.renderTriggerSummary = renderTriggerSummary;
55
62
  exports.renderLegacyRuns = renderLegacyRuns;
56
- exports.quietHoursAuditExplanation = quietHoursAuditExplanation;
63
+ exports.clockSkipAuditExplanation = clockSkipAuditExplanation;
64
+ exports.coalescedAuditExplanation = coalescedAuditExplanation;
65
+ exports.policyCardSentence = policyCardSentence;
57
66
  exports.policyAuditExplanation = policyAuditExplanation;
58
67
  exports.renderFireAudit = renderFireAudit;
68
+ exports.describeTriggerBudget = describeTriggerBudget;
59
69
  const data_provider_1 = require("@skrr-ai/data-provider");
60
70
  const node_fs_1 = require("node:fs");
61
71
  const format_1 = require("./format");
@@ -382,6 +392,30 @@ function parseKeyValueFlags(values, flagName, scopeKind) {
382
392
  }
383
393
  return refs;
384
394
  }
395
+ /**
396
+ * The entity kind a `--ref <key>=<id>` names, for the filter a list takes. `triggers create` takes
397
+ * `--ref agentId=abc`; `triggers list` took only `--ref-entity agent:abc`, so the one spelling that
398
+ * created the trigger was refused by the command that finds it (OSK-22493).
399
+ */
400
+ const REF_KEY_ENTITY_KIND = {
401
+ agentId: 'agent',
402
+ goalId: 'goal',
403
+ taskId: 'task',
404
+ spaceId: 'space',
405
+ groupChatId: 'groupChat',
406
+ };
407
+ /** `--ref agentId=abc` as the `agent:abc` the list filter takes. Throws for a key that filters nothing. */
408
+ function refEntitiesFromRefFlags(values) {
409
+ const refs = parseKeyValueFlags(values, '--ref');
410
+ return Object.entries(refs).map(([key, id]) => {
411
+ const kind = REF_KEY_ENTITY_KIND[key];
412
+ if (!kind) {
413
+ throw new Error(`--ref ${key}=... cannot filter a list. Use ${Object.keys(REF_KEY_ENTITY_KIND).join(', ')}, ` +
414
+ 'or --ref-entity <kind>:<id>.');
415
+ }
416
+ return `${kind}:${id}`;
417
+ });
418
+ }
385
419
  function parseJsonObject(raw, flagName) {
386
420
  if (raw === undefined)
387
421
  return undefined;
@@ -800,7 +834,15 @@ exports.TRIGGER_CREATE_FIELD_FLAGS = Object.freeze({
800
834
  'execution.dispatch': '--dispatch',
801
835
  'execution.references': '--reference',
802
836
  'execution.workingHours': '--working-hours',
837
+ 'execution.workingHours.enabled': '--working-hours',
838
+ 'execution.workingHours.start': '--working-hours',
839
+ 'execution.workingHours.end': '--working-hours',
840
+ 'execution.workingHours.timezone': '--working-hours',
803
841
  'execution.quietHours': '--quiet-hours',
842
+ 'execution.quietHours.enabled': '--quiet-hours',
843
+ 'execution.quietHours.start': '--quiet-hours',
844
+ 'execution.quietHours.end': '--quiet-hours',
845
+ 'execution.quietHours.timezone': '--quiet-hours',
804
846
  });
805
847
  /**
806
848
  * Flags an execution mode cannot work without, refused before the request is sent. The inverse
@@ -1125,6 +1167,10 @@ function armedLabel(trigger) {
1125
1167
  if (trigger.kind === 'once' && trigger.once && trigger.once.firedAt) {
1126
1168
  return 'spent';
1127
1169
  }
1170
+ // Enabled and synced, but the scheduler has used the run limit it was given: it drops every slot
1171
+ // (OSK-22526). Only a read that asked for the limits can say so; absent is unknown, not fine.
1172
+ if (trigger.schedulerLimits?.state === 'reached')
1173
+ return 'limit';
1128
1174
  return 'yes';
1129
1175
  }
1130
1176
  /**
@@ -1194,7 +1240,7 @@ function renderTriggerList(triggers, log) {
1194
1240
  { key: 'enabled', header: 'ARMED' },
1195
1241
  { key: 'scope', header: 'SCOPE', maxWidth: 42 },
1196
1242
  { key: 'next', header: 'NEXT/LAST', maxWidth: 24 },
1197
- { key: 'label', header: 'LABEL', maxWidth: 32 },
1243
+ { key: 'label', header: 'LABEL', maxWidth: 40, truncate: 'middle' },
1198
1244
  ], log);
1199
1245
  const degraded = triggers.filter((t) => degradedMarker(t) === ' (degraded)');
1200
1246
  if (degraded.length > 0) {
@@ -1246,6 +1292,42 @@ function formatDuplicateSubscriptionWarning(trigger) {
1246
1292
  lines,
1247
1293
  };
1248
1294
  }
1295
+ /** The `warnings[]` codes a create or update answers about a working / quiet window it just saved. */
1296
+ const WINDOW_ADVICE_CODES = new Set(['window_timezone_defaulted', 'quiet_window_empty']);
1297
+ /**
1298
+ * Advice about a window the trigger was just saved with, one sentence each, or none. The window was
1299
+ * accepted; these say how it will be read (in UTC when it names no zone, as an empty quiet window that
1300
+ * suppresses nothing), so a person finds out now and not from the first skipped fire (OSK-22530).
1301
+ */
1302
+ function windowAuthoringAdvice(trigger) {
1303
+ const warnings = trigger?.warnings;
1304
+ if (!Array.isArray(warnings))
1305
+ return [];
1306
+ return warnings.flatMap((warning) => {
1307
+ const { code, message } = (warning ?? {});
1308
+ return typeof code === 'string' && WINDOW_ADVICE_CODES.has(code) && typeof message === 'string'
1309
+ ? [message]
1310
+ : [];
1311
+ });
1312
+ }
1313
+ /** What `--working-hours` / `--quiet-hours` take, for their `--help`. */
1314
+ exports.TRIGGER_WINDOW_FLAG_HELP = 'JSON object {"enabled":true,"start":"09:00","end":"17:00","timezone":"America/Vancouver"}. "enabled" is required for the window to apply, and with no "timezone" it is read in UTC, not in the trigger\'s own zone.';
1315
+ /**
1316
+ * Why a schedule whose own counters look healthy will not run, in the scheduler's numbers. The
1317
+ * scheduler charges a limit when it claims a slot, so it can hold more than the trigger counts; once
1318
+ * the limit is reached it drops every later slot without running or recording it (OSK-22526).
1319
+ */
1320
+ function schedulerLimitSentence(limits) {
1321
+ const lifetime = limits.reason === 'max_runs_reached';
1322
+ const used = lifetime
1323
+ ? `${limits.claimedTotal ?? '?'} of ${limits.maxRuns ?? '?'} runs (--max-runs)`
1324
+ : `${limits.claimedToday ?? '?'} of ${limits.maxPerDay ?? '?'} runs today (--max-fires-per-day)`;
1325
+ const counted = lifetime
1326
+ ? `${limits.triggerFireCount ?? 0} succeeded`
1327
+ : `${limits.triggerFiresToday ?? 0} counted today`;
1328
+ return (`the scheduler has used ${used} (the trigger itself has ${counted}), so it skips every slot` +
1329
+ `${lifetime ? '' : ' until the day rolls over'}; see \`skrr triggers preflight\``);
1330
+ }
1249
1331
  /**
1250
1332
  * Human phrasing for a trigger's enabled state (OSK-4886).
1251
1333
  *
@@ -1255,7 +1337,9 @@ function formatDuplicateSubscriptionWarning(trigger) {
1255
1337
  */
1256
1338
  function armedStateLabel(enabled, lastResult,
1257
1339
  /** Pass for a `once` trigger: how often its single fire ran. A spent one-shot is not waiting to be enabled (OSK-21509). */
1258
- oneShot) {
1340
+ oneShot,
1341
+ /** The server's reading of the scheduler's run limits: a reached limit means no slot will run (OSK-22526). */
1342
+ schedulerLimits) {
1259
1343
  if (enabled === false && oneShot && (oneShot.fires ?? 0) > 0) {
1260
1344
  return 'no — already fired (a one-shot trigger is spent once it fires)';
1261
1345
  }
@@ -1264,6 +1348,8 @@ oneShot) {
1264
1348
  }
1265
1349
  if (enabled === false)
1266
1350
  return 'no — inert until enabled';
1351
+ if (schedulerLimits?.state === 'reached')
1352
+ return `no — ${schedulerLimitSentence(schedulerLimits)}`;
1267
1353
  // "Will fire" is the row's intent. A platform-managed row whose owner is fenced (Always-On off) ticks on
1268
1354
  // schedule and is skipped every time, and the same screen's `Fires:` line says so; the first line a reader
1269
1355
  // meets must not say the opposite (dogfood df-261031-commitment-authoring, OSK-21103).
@@ -1365,12 +1451,147 @@ function fireRefusalLines(metadata) {
1365
1451
  }
1366
1452
  return lines;
1367
1453
  }
1454
+ /**
1455
+ * What an executor mode DOES, in words. The name alone said nothing about side effects: `run_only`
1456
+ * read as if it ran nothing, so a person testing a disabled sensor trigger could not tell that firing
1457
+ * it starts an Agent turn (OSK-21766). Only the modes an author normally chooses are described; an
1458
+ * unlisted mode simply has no effect line rather than a guess.
1459
+ */
1460
+ const EXECUTOR_MODE_EFFECTS = {
1461
+ send_message: 'runs an Agent turn and posts its reply to the destination chat',
1462
+ run_only: 'runs an Agent turn and posts nothing visible; it still uses the Agent’s model budget',
1463
+ builtin_action: 'runs a deterministic action with no Agent turn and no model cost; the Action line says which (types: `skrr triggers actions`)',
1464
+ };
1465
+ /** The `--mode` flag's help, shared so create and update never describe the modes differently. */
1466
+ exports.TRIGGER_MODE_FLAG_DESCRIPTION = 'Execution mode. send_message runs an Agent turn and posts its reply to the destination chat; run_only runs an Agent turn and posts nothing visible (it still uses the Agent’s model budget).';
1467
+ function executorModeEffect(mode) {
1468
+ return typeof mode === 'string' ? EXECUTOR_MODE_EFFECTS[mode] : undefined;
1469
+ }
1470
+ /** `30s`, `2m` — the window, short enough to sit in a one-line summary. */
1471
+ function debounceSpan(ms) {
1472
+ const seconds = Math.round(ms / 1000);
1473
+ if (seconds >= 60 && seconds % 60 === 0)
1474
+ return `${seconds / 60}m`;
1475
+ return `${seconds}s`;
1476
+ }
1477
+ /**
1478
+ * The text of the `Debounce:` line of `triggers show`. An event trigger carries a trigger-wide debounce (30s unless
1479
+ * set), and neither its size nor its meaning was shown anywhere but raw JSON: a person deciding whether
1480
+ * two close events both fire could not tell that the second is skipped, not queued, whatever its
1481
+ * subject (OSK-21756). Undefined when there is nothing to say.
1482
+ */
1483
+ function debounceSummaryLine(trigger) {
1484
+ if (trigger.kind !== 'event')
1485
+ return undefined;
1486
+ // A Commitment wake coalesces in the wake ledger; TriggerEngine never debounces those fires.
1487
+ if (trigger.scope?.kind === 'commitment_watcher' || trigger.execution?.mode === 'commitment_reflection') {
1488
+ return undefined;
1489
+ }
1490
+ const ms = trigger.event?.debounceMs;
1491
+ if (typeof ms !== 'number' || !Number.isFinite(ms) || ms <= 0) {
1492
+ return 'none — every matching event can fire';
1493
+ }
1494
+ return `${debounceSpan(ms)}, trigger-wide — a matching event within ${debounceSpan(ms)} of the last fire is skipped, not queued`;
1495
+ }
1496
+ /** The machine's own IANA zone, or undefined where the runtime cannot say. */
1497
+ function machineTimeZone() {
1498
+ try {
1499
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || undefined;
1500
+ }
1501
+ catch {
1502
+ return undefined;
1503
+ }
1504
+ }
1505
+ /** `01:30 PST`: the wall clock of an instant in a zone, or undefined for a zone this runtime does not know. */
1506
+ function clockInZone(iso, timeZone) {
1507
+ const date = new Date(iso);
1508
+ if (Number.isNaN(date.getTime()))
1509
+ return undefined;
1510
+ try {
1511
+ return new Intl.DateTimeFormat('en-US', {
1512
+ timeZone,
1513
+ hour: '2-digit',
1514
+ minute: '2-digit',
1515
+ hourCycle: 'h23',
1516
+ timeZoneName: 'short',
1517
+ }).format(date);
1518
+ }
1519
+ catch {
1520
+ return undefined;
1521
+ }
1522
+ }
1523
+ /**
1524
+ * When a schedule or one-shot trigger runs, in the zone it runs in (OSK-22487).
1525
+ *
1526
+ * `triggers create` and `triggers show` printed the kind, the mode and `Fires: 0 succeeded` and nothing
1527
+ * about WHEN, so a schedule made without `--timezone` (which stores UTC) looked the same as one made
1528
+ * for the person's own morning, eight hours apart. The zone is stated always, and the same instant is
1529
+ * restated on this machine's clock when the two differ, so "09:30" cannot be mistaken for local time.
1530
+ * A disabled trigger's next occurrence is labelled as conditional: nothing will run until it is enabled.
1531
+ *
1532
+ * Undefined for a kind with no clock (event, on_demand, ...). `machineZone` is a parameter so the text
1533
+ * is deterministic under test.
1534
+ */
1535
+ function scheduleSummaryLine(trigger, machineZone = machineTimeZone()) {
1536
+ let cadence;
1537
+ let nextIso;
1538
+ let zone = 'UTC';
1539
+ if (trigger.kind === 'schedule') {
1540
+ const schedule = (trigger.schedule ?? {});
1541
+ if (typeof schedule.timezone === 'string' && schedule.timezone)
1542
+ zone = schedule.timezone;
1543
+ if (Array.isArray(schedule.times) && schedule.times.length > 0) {
1544
+ cadence = `daily at ${schedule.times.join(', ')} ${zone}`;
1545
+ }
1546
+ else if (typeof schedule.cronExpression === 'string' && schedule.cronExpression) {
1547
+ cadence = `cron "${schedule.cronExpression}" in ${zone}`;
1548
+ }
1549
+ else if (typeof schedule.intervalMs === 'number' && schedule.intervalMs > 0) {
1550
+ const minutes = Math.round(schedule.intervalMs / 60_000);
1551
+ cadence = `every ${minutes === 1 ? 'minute' : `${minutes} minutes`}`;
1552
+ }
1553
+ if (schedule.nextRunAt)
1554
+ nextIso = String(schedule.nextRunAt);
1555
+ }
1556
+ else if (trigger.kind === 'once') {
1557
+ const once = (trigger.once ?? {});
1558
+ const runAt = once.runAt ?? once.at;
1559
+ if (runAt) {
1560
+ nextIso = String(runAt);
1561
+ cadence = 'one-time run';
1562
+ }
1563
+ }
1564
+ if (!cadence)
1565
+ return undefined;
1566
+ // An interval has no wall-clock time to be mistaken for local time.
1567
+ const hasClock = !cadence.startsWith('every ');
1568
+ const parts = [cadence];
1569
+ if (nextIso) {
1570
+ const there = hasClock && machineZone && machineZone !== zone ? clockInZone(nextIso, machineZone) : undefined;
1571
+ const when = trigger.enabled === false ? `next ${nextIso} if enabled` : `next ${nextIso}`;
1572
+ parts.push(there ? `${when} (${there} on this machine)` : when);
1573
+ }
1574
+ return parts.join('; ');
1575
+ }
1576
+ /** What a builtin_action trigger does, from its stored action: the type and its config. */
1577
+ function builtinActionLine(trigger) {
1578
+ if (trigger.execution?.mode !== 'builtin_action')
1579
+ return undefined;
1580
+ const action = trigger.execution.builtinAction;
1581
+ if (typeof action?.builtinType !== 'string')
1582
+ return undefined;
1583
+ const config = action.config && typeof action.config === 'object' && Object.keys(action.config).length > 0
1584
+ ? JSON.stringify(action.config)
1585
+ : '';
1586
+ const shown = config.length > 160 ? `${config.slice(0, 160)}…` : config;
1587
+ return `${action.builtinType}${shown ? ` ${shown}` : ''}`;
1588
+ }
1368
1589
  function renderTriggerSummary(trigger, log, options = {}) {
1369
1590
  log(`ID: ${trigger.id ?? '-'}`);
1370
1591
  log(`Kind: ${trigger.kind ?? '-'}`);
1371
1592
  log(`Armed: ${armedStateLabel(trigger.enabled, trigger.audit?.lastResult, trigger.kind === 'once'
1372
1593
  ? { fires: trigger.audit?.fireCount, failures: trigger.audit?.failureCount }
1373
- : undefined)}`);
1594
+ : undefined, trigger.schedulerLimits)}`);
1374
1595
  log(`Scope: ${scopeLabel(trigger)}`);
1375
1596
  /*
1376
1597
  * Say when the row is not yours to change.
@@ -1396,6 +1617,18 @@ function renderTriggerSummary(trigger, log, options = {}) {
1396
1617
  log(`Label: ${trigger.label}`);
1397
1618
  if (trigger.execution?.mode)
1398
1619
  log(`Mode: ${String(trigger.execution.mode)}`);
1620
+ const modeEffect = executorModeEffect(trigger.execution?.mode);
1621
+ if (modeEffect)
1622
+ log(`Effect: ${modeEffect}`);
1623
+ const action = builtinActionLine(trigger);
1624
+ if (action)
1625
+ log(`Action: ${action}`);
1626
+ const schedule = scheduleSummaryLine(trigger);
1627
+ if (schedule)
1628
+ log(`Schedule: ${schedule}`);
1629
+ const debounceText = debounceSummaryLine(trigger);
1630
+ if (debounceText)
1631
+ log(`Debounce: ${debounceText}`);
1399
1632
  const sensor = trigger.execution?.mode === 'sensor_poll' ? trigger.execution.sensor : undefined;
1400
1633
  if (sensor?.measureSink) {
1401
1634
  log(`Measure: ${sensor.measureSink.measureId} — platform fetched, unconfirmed`);
@@ -1451,7 +1684,10 @@ function renderTriggerSummary(trigger, log, options = {}) {
1451
1684
  if (next !== '-') {
1452
1685
  // `nextRunLabel` falls back to the last fire when nothing is scheduled; say which it is.
1453
1686
  const upcoming = Boolean(scheduledRunAt(trigger));
1454
- log(`${upcoming ? 'Next run:' : 'Last run:'}${next.length > 0 ? ` ${next}` : ''}`);
1687
+ // A slot the scheduler will drop is not a run to wait for (OSK-22526).
1688
+ const dropped = upcoming && trigger.schedulerLimits?.state === 'reached';
1689
+ log(`${upcoming ? (dropped ? 'Next slot:' : 'Next run:') : 'Last run:'}${next.length > 0 ? ` ${next}` : ''}` +
1690
+ `${dropped ? ' (will be skipped: the scheduler\'s run limit is reached)' : ''}`);
1455
1691
  }
1456
1692
  /*
1457
1693
  * What actually happened when it fired.
@@ -1526,28 +1762,131 @@ function renderLegacyRuns(runs, log) {
1526
1762
  { key: 'conversation', header: 'CONVO', maxWidth: 24 },
1527
1763
  ], log);
1528
1764
  }
1529
- /** Human explanation for quiet-hour audit rows; a one-shot may have been re-armed. */
1530
- function quietHoursAuditExplanation(fire) {
1531
- const reason = fire.reason || fire.outcome;
1532
- if (reason !== 'inside_quiet_hours' && reason !== 'initiative_policy_quiet_hours')
1765
+ /**
1766
+ * What a window-skipped fire's record says about the window, as one clause, or null when the record
1767
+ * kept none (it predates the field, or the platform scheduler recorded the skip).
1768
+ */
1769
+ function skippedWindowClause(window, kind) {
1770
+ if (!window || window.kind !== kind || !window.start || !window.end)
1533
1771
  return null;
1534
- if (fire.source === 'once') {
1772
+ const zone = window.timezone || 'UTC';
1773
+ const label = kind === 'working_hours' ? 'working hours' : 'quiet hours';
1774
+ const judged = window.localTime
1775
+ ? `It was judged at ${window.localTime} ${zone}`
1776
+ : `It was judged at ${window.evaluatedAt ?? 'the time it came due'}`;
1777
+ const relation = kind === 'working_hours' ? 'outside' : 'inside';
1778
+ const defaulted = window.timezoneDefaulted
1779
+ ? ' The window sets no timezone, so it is read in UTC.'
1780
+ : '';
1781
+ return `${judged}, ${relation} the trigger's ${label} ${window.start}-${window.end} ${zone}.${defaulted}`;
1782
+ }
1783
+ /**
1784
+ * Why a fire was skipped by a working or quiet window, in words. Both trigger-level windows (Gate 5)
1785
+ * consume the occurrence: a one-shot is spent, a recurring schedule carries on to its next slot, and
1786
+ * nothing is retried. The Agent's own quiet hours (`initiative_policy_quiet_hours`) are a separate
1787
+ * policy that can hold a one-shot, so that wording stays hedged.
1788
+ */
1789
+ function clockSkipAuditExplanation(fire) {
1790
+ const reason = fire.reason || fire.outcome;
1791
+ if (reason === 'initiative_policy_quiet_hours') {
1792
+ if (fire.source === 'once') {
1793
+ return {
1794
+ summary: 'One-shot skipped: quiet hours',
1795
+ detail: 'This skipped occurrence will not retry automatically. Check the trigger state; if the one-shot is spent, schedule a new one outside quiet hours.',
1796
+ };
1797
+ }
1535
1798
  return {
1536
- summary: 'One-shot skipped: quiet hours',
1537
- detail: 'This skipped occurrence will not retry automatically. Check the trigger state; if the one-shot is spent, schedule a new one outside quiet hours.',
1799
+ summary: 'Skipped: Agent quiet hours',
1800
+ detail: 'The Agent quiet hours covered this occurrence, so it did not run. It is not retried; a recurring schedule carries on to its next slot.',
1538
1801
  };
1539
1802
  }
1803
+ if (reason !== 'outside_working_hours' && reason !== 'inside_quiet_hours')
1804
+ return null;
1805
+ const working = reason === 'outside_working_hours';
1806
+ const kind = working ? 'working_hours' : 'quiet_hours';
1807
+ const oneShot = fire.source === 'once';
1808
+ const recurring = fire.source === 'schedule';
1809
+ const record = fire.metadata?.window;
1810
+ const window = skippedWindowClause(record, kind) ??
1811
+ `This occurrence landed ${working ? 'outside the working hours' : 'inside the quiet hours'} set on this trigger. The record did not keep the window; \`skrr triggers show <id> --json\` shows what it is now.`;
1812
+ const outcome = oneShot
1813
+ ? `A one-shot has a single occurrence, so it is spent and will not retry. To run it, create a new one ${working ? 'inside the working hours' : 'outside the quiet hours'}.`
1814
+ : recurring
1815
+ ? 'The schedule does not retry this slot; it carries on, and its next occurrence is checked against the window again.'
1816
+ : 'It was dropped, not queued, and will not retry automatically.';
1817
+ return {
1818
+ summary: `${oneShot ? 'One-shot skipped' : 'Skipped'}: ${working ? 'outside working hours' : 'quiet hours'}`,
1819
+ detail: `${window} ${outcome}`,
1820
+ };
1821
+ }
1822
+ /**
1823
+ * Why a coalesced occurrence did not run. `coalesced` with reason `in_flight` is the concurrency lane
1824
+ * (gate 7) finding an earlier fire still holding it: this occurrence was dropped, not queued, and an
1825
+ * occurrence that was dropped is consumed, so it is not retried (OSK-22509). The raw code alone read
1826
+ * as a fire that was still in progress.
1827
+ */
1828
+ function coalescedAuditExplanation(fire) {
1829
+ if (fire.outcome !== 'coalesced')
1830
+ return null;
1540
1831
  return {
1541
- summary: 'Skipped: quiet hours',
1542
- detail: 'Review the trigger and Agent quiet-hours settings before retrying.',
1832
+ summary: 'Not run: lane already busy',
1833
+ detail: 'An earlier fire under the same concurrency lane was still running when this occurrence came due, so it was dropped, not queued, and will not retry automatically. `skrr triggers preflight <id> --json` shows the lane (concurrencyKey); a trigger that stores no key coalesces only against itself.',
1543
1834
  };
1544
1835
  }
1836
+ /** Why no new inbox card was written, by the code the server records. Unknown codes are shown as they are. */
1837
+ const POLICY_CARD_REASONS = {
1838
+ policy_mode_has_no_card: 'this autonomy mode does not make inbox suggestions',
1839
+ scope_not_agent: 'the trigger is not scoped to an Agent',
1840
+ agent_unresolved: 'the trigger names no Agent',
1841
+ creation_error: 'creating it failed',
1842
+ card_not_visible: 'it was saved but cannot be shown to its owner',
1843
+ not_recorded: 'the suggestion service did not say why',
1844
+ relevance_gate: 'the relevance check judged it not worth surfacing',
1845
+ payload_gate: 'it carried nothing to act on',
1846
+ dedupe: 'this occurrence already has one',
1847
+ initiative_policy_cooldown: 'an earlier suggestion from this trigger is still open',
1848
+ initiative_policy_source_cooldown: 'an earlier suggestion from this source is still open',
1849
+ initiative_policy_channel_cooldown: 'an earlier suggestion from this channel is still open',
1850
+ initiative_policy_cross_worker_duplicate: 'another Agent already raised the same thing',
1851
+ initiative_policy_hard_stop: 'the Agent hard stop is on',
1852
+ initiative_policy_off: 'the Agent initiative policy is off',
1853
+ initiative_policy_quiet_hours: 'it landed inside the Agent quiet hours',
1854
+ initiative_policy_outside_working_hours: 'it landed outside the Agent working hours',
1855
+ initiative_policy_daily_card_cap: 'the Agent daily limit on inbox suggestions was reached',
1856
+ initiative_policy_source_daily_card_cap: 'the daily limit for this source was reached',
1857
+ initiative_policy_channel_daily_card_cap: 'the daily limit for this channel was reached',
1858
+ initiative_policy_suppressed: 'a suppression rule on the Agent matches it',
1859
+ initiative_policy_dismiss_cooldown: 'a similar suggestion was dismissed recently',
1860
+ initiative_policy_source_off: 'this source is switched off for the Agent',
1861
+ initiative_policy_channel_off: 'this channel is switched off for the Agent',
1862
+ };
1863
+ /** One sentence saying whether the fire left an inbox card, or null for a fire that predates the record. */
1864
+ function policyCardSentence(policyCard) {
1865
+ if (!policyCard || typeof policyCard !== 'object' || Array.isArray(policyCard))
1866
+ return null;
1867
+ const card = policyCard;
1868
+ const id = typeof card.initiativeId === 'string' && card.initiativeId ? ` (${card.initiativeId})` : '';
1869
+ if (card.created === true)
1870
+ return `An inbox suggestion was created${id}.`;
1871
+ const why = typeof card.reason === 'string' && card.reason
1872
+ ? (POLICY_CARD_REASONS[card.reason] ?? card.reason)
1873
+ : null;
1874
+ if (card.existing === true) {
1875
+ return `No new inbox suggestion: an earlier one${id} covers this${why ? ` (${why})` : ''}.`;
1876
+ }
1877
+ if (card.created === false)
1878
+ return `No inbox suggestion was created${why ? `: ${why}` : ''}.`;
1879
+ return null;
1880
+ }
1545
1881
  function policyAuditExplanation(fire) {
1546
1882
  if (fire.outcome !== 'skipped' || fire.reason !== 'initiative_policy_suggestions_only')
1547
1883
  return null;
1884
+ const metadata = fire.metadata;
1885
+ // A fire from before the server recorded the card cannot say; the old hedge stays for those.
1886
+ const card = policyCardSentence(metadata?.policyCard) ?? 'An inbox suggestion is not guaranteed.';
1548
1887
  return {
1549
1888
  summary: 'Skipped: suggestions-only policy',
1550
- detail: 'The Agent policy prevented autonomous execution. Review the trigger preflight and Agent policy; an inbox suggestion is not guaranteed.',
1889
+ detail: `The Agent policy prevented autonomous execution. Review the trigger preflight and Agent policy. ${card}`,
1551
1890
  };
1552
1891
  }
1553
1892
  function renderFireAudit(fires, log) {
@@ -1562,7 +1901,7 @@ function renderFireAudit(fires, log) {
1562
1901
  source: fire.source ?? '-',
1563
1902
  reason: fire.metadata?.recordKind === 'schedule_end_marker'
1564
1903
  ? 'Schedule ended after prior fire'
1565
- : quietHoursAuditExplanation(fire)?.summary ?? policyAuditExplanation(fire)?.summary ?? fire.reason ?? fire.errorMessage ?? '',
1904
+ : clockSkipAuditExplanation(fire)?.summary ?? policyAuditExplanation(fire)?.summary ?? coalescedAuditExplanation(fire)?.summary ?? fire.reason ?? fire.errorMessage ?? '',
1566
1905
  duration: fire.durationMs === undefined ? '-' : `${fire.durationMs}ms`,
1567
1906
  replay: fire.metadata?.replayable === true || fire.metadata?.replayContext
1568
1907
  ? 'yes'
@@ -1579,6 +1918,20 @@ function renderFireAudit(fires, log) {
1579
1918
  { key: 'reason', header: 'REASON', maxWidth: 40 },
1580
1919
  ], log);
1581
1920
  }
1921
+ /**
1922
+ * The largest finite trigger limit the server accepts. An owner with no cap of
1923
+ * their own resolves to exactly this, so a limit at or above it means "no limit"
1924
+ * and printing it as a number reads as a budget (OSK-22402). A server new enough
1925
+ * to say `unlimited` is believed; an older one is judged by the value.
1926
+ */
1927
+ exports.TRIGGER_LIMIT_CEILING = 100_000_000;
1928
+ /** `used / limit (free free)`, or `used / unlimited` when there is no cap. */
1929
+ function describeTriggerBudget(budget) {
1930
+ const unlimited = budget.unlimited ?? budget.limit >= exports.TRIGGER_LIMIT_CEILING;
1931
+ return unlimited
1932
+ ? `${budget.used} / unlimited`
1933
+ : `${budget.used} / ${budget.limit} (${budget.free} free)`;
1934
+ }
1582
1935
  exports.triggerApi = {
1583
1936
  create: (body) => data_provider_1.request.post('/api/triggers', body),
1584
1937
  list: (path) => data_provider_1.request.get(path),
@@ -16,6 +16,14 @@ function nodeCancellationFromSnapshot(spaceId, runId, nodeKey, snapshot, reason)
16
16
  throw new Error('Use a saved canonical run snapshot for this exact Space and workflow run.');
17
17
  }
18
18
  const selected = snapshot.nodes.filter((node) => record(node) && node.nodeKey === nodeKey);
19
+ // A mistyped node key used to surface as "must contain one exact node attempt", which blames
20
+ // the file the user just saved (OSK-22460). Say the key is not in it, and which keys are.
21
+ if (selected.length === 0) {
22
+ const keys = snapshot.nodes
23
+ .filter((node) => record(node) && typeof node.nodeKey === 'string')
24
+ .map((node) => String(node.nodeKey));
25
+ throw new Error(`Node "${nodeKey}" is not in this run snapshot.${keys.length ? ` Its nodes are: ${keys.join(', ')}.` : ''}`);
26
+ }
19
27
  const node = selected[0];
20
28
  if (selected.length !== 1 || !record(node) || !id(node.id) || node.workflowRunId !== runId
21
29
  || !integer(node.iteration) || !integer(node.planGeneration) || !id(node.nodeType)) {
@@ -61,6 +61,15 @@ function describeNodeDetail(node, attention = '') {
61
61
  const loop = describeLoopProgress(node);
62
62
  if (loop)
63
63
  parts.push(loop);
64
+ // The text view left a skipped step and a condition's chosen branch blank, so a run that ended
65
+ // `succeeded` with half its graph unrun looked unexplained; only --json said why (OSK-22461).
66
+ const extra = node;
67
+ if (node.status === 'skipped' && typeof extra.output?.reason === 'string') {
68
+ parts.push(`skipped: ${extra.output.reason.replace(/_/g, ' ')}`);
69
+ }
70
+ if (extra.nodeType === 'condition' && node.status === 'succeeded' && typeof extra.outcome === 'string') {
71
+ parts.push(`took "${extra.outcome}"`);
72
+ }
64
73
  return printable(parts.join('; '));
65
74
  }
66
75
  /**
@@ -32,6 +32,18 @@
32
32
  * child process it is about to spawn, and so tests need no process-wide mutation.
33
33
  */
34
34
  export declare function resolveConfigRoot(env?: NodeJS.ProcessEnv): string;
35
+ /**
36
+ * The variables that relocate the root, newest spelling first. For a message
37
+ * that must tell a person which override to drop; nothing reads the
38
+ * environment through this list.
39
+ */
40
+ export declare const CONFIG_ROOT_ENV_VARS: readonly ["SKRR_CONFIG_DIR", "OVERSKY_CONFIG_DIR"];
41
+ /**
42
+ * `env` with the root pointed at `root`, for a caller that resolves as though the
43
+ * root were elsewhere (a test's temporary home, a child process). Writing the
44
+ * override here keeps the variable's name in its one definition.
45
+ */
46
+ export declare function withConfigRoot(env: NodeJS.ProcessEnv, root: string): NodeJS.ProcessEnv;
35
47
  /** A path under the skrr root, e.g. `configRootPath(env, 'daemon', 'logs')`. */
36
48
  export declare function configRootPath(env: NodeJS.ProcessEnv, ...segments: string[]): string;
37
49
  /**
@@ -28,9 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var configRoot_exports = {};
30
30
  __export(configRoot_exports, {
31
+ CONFIG_ROOT_ENV_VARS: () => CONFIG_ROOT_ENV_VARS,
31
32
  configRootPath: () => configRootPath,
32
33
  isConfigRootOverridden: () => isConfigRootOverridden,
33
- resolveConfigRoot: () => resolveConfigRoot
34
+ resolveConfigRoot: () => resolveConfigRoot,
35
+ withConfigRoot: () => withConfigRoot
34
36
  });
35
37
  module.exports = __toCommonJS(configRoot_exports);
36
38
  var import_node_os = require("node:os");
@@ -39,6 +41,10 @@ function resolveConfigRoot(env = process.env) {
39
41
  const override = (env.SKRR_CONFIG_DIR || env.OVERSKY_CONFIG_DIR)?.trim();
40
42
  return override || import_node_path.default.join((0, import_node_os.homedir)(), ".skrr");
41
43
  }
44
+ const CONFIG_ROOT_ENV_VARS = ["SKRR_CONFIG_DIR", "OVERSKY_CONFIG_DIR"];
45
+ function withConfigRoot(env, root) {
46
+ return { ...env, SKRR_CONFIG_DIR: root };
47
+ }
42
48
  function configRootPath(env, ...segments) {
43
49
  return import_node_path.default.join(resolveConfigRoot(env), ...segments);
44
50
  }
@@ -47,7 +53,9 @@ function isConfigRootOverridden(env = process.env) {
47
53
  }
48
54
  // Annotate the CommonJS export names for ESM import in node:
49
55
  0 && (module.exports = {
56
+ CONFIG_ROOT_ENV_VARS,
50
57
  configRootPath,
51
58
  isConfigRootOverridden,
52
- resolveConfigRoot
59
+ resolveConfigRoot,
60
+ withConfigRoot
53
61
  });
@@ -1,6 +1,7 @@
1
1
  import { type DeviceKeyAlg, type DevicePublicJwk } from './deviceKey.js';
2
2
  import { type DeviceKeyCustody, type DeviceKeyHandle } from './deviceKeyHandle.js';
3
3
  import { type ExecutorStopReceipt, type ExecutorStopReceiptBody } from './executorStopReceipt.js';
4
+ import { type ExecutorStopReceiptBodyV2, type ExecutorStopReceiptV2 } from './executorStopReceiptV2.js';
4
5
  import { type HardwareKeyCapability, type HardwareKeyRecord } from './deviceKeyHardware.js';
5
6
  /**
6
7
  * The `cred_envelope.read.decrypt_failed` hint for the device PRIVATE key
@@ -244,6 +245,13 @@ export declare function signServerRequest(opts: {
244
245
  * server treats as an unproven stop rather than as a failure of the session.
245
246
  */
246
247
  export declare function signExecutorStopReceiptWithDeviceKey(body: ExecutorStopReceiptBody): Promise<ExecutorStopReceipt | null>;
248
+ /**
249
+ * Sign a parent-witnessed stop receipt (OSK-20777, docs/architecture/independent-stop-witness-2026-11-02.md)
250
+ * with the device key. Same contract as `signExecutorStopReceiptWithDeviceKey`: null when device identity is not
251
+ * active or the key cannot sign right now, never throws, and a failed sign emits a telemetry event so the caller
252
+ * sends the response without a receipt, which the server treats as an unproven stop.
253
+ */
254
+ export declare function signExecutorStopReceiptV2WithDeviceKey(body: ExecutorStopReceiptBodyV2): Promise<ExecutorStopReceiptV2 | null>;
247
255
  /** @internal Test seams — file path resolvers. */
248
256
  export declare function __publicKeyPathForTest(profile: string): string;
249
257
  export declare function __privateKeyPathForTest(profile: string): string;