@skrr-ai/cli 0.1.153 → 0.1.155

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.
@@ -30,6 +30,7 @@ class Daemon extends core_1.Command {
30
30
  '<%= config.bin %> daemon logs',
31
31
  '<%= config.bin %> daemon diagnostics',
32
32
  '<%= config.bin %> daemon recover-offline-queue --apply',
33
+ '<%= config.bin %> daemon workspace-locks',
33
34
  '<%= config.bin %> daemon usage --refresh',
34
35
  '<%= config.bin %> daemon byok status',
35
36
  ];
@@ -52,6 +53,7 @@ class Daemon extends core_1.Command {
52
53
  this.log(' skrr daemon logs — tail recent daemon logs');
53
54
  this.log(' skrr daemon diagnostics — write a support bundle (status, logs) to send with a bug report');
54
55
  this.log(' skrr daemon recover-offline-queue — restore recoverable offline WALs');
56
+ this.log(' skrr daemon workspace-locks — list workspace locks, clear a stranded one');
55
57
  this.log(' skrr daemon usage — show local Claude Code and Codex usage limits');
56
58
  this.log(' skrr daemon byok — manage local BYOK Keychain credentials');
57
59
  this.log(' skrr daemon profile — list, select, clean up, remove and restore profiles');
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class DaemonWorkspaceLocks extends Command {
3
+ static aliases: string[];
4
+ static summary: string;
5
+ static description: string;
6
+ static strict: boolean;
7
+ static examples: string[];
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
+ /**
6
+ * `skrrd workspace-locks` exits 2 for "refused, nothing changed", 64 for a bad key and 78 for an untrusted state
7
+ * directory, and this wrapper forwards those verbatim. "The installed runtime has no such command" must not
8
+ * collide with any of them, so it is sysexits' EX_UNAVAILABLE.
9
+ */
10
+ const RUNTIME_TOO_OLD_EXIT = 69;
11
+ class DaemonWorkspaceLocks extends core_1.Command {
12
+ // `skrr daemons <sub>` — the plural is advertised as an alias for the
13
+ // whole topic, and without a per-command alias only the bare topic
14
+ // resolved: every subcommand under it failed.
15
+ static aliases = ['daemons:workspace-locks'];
16
+ static summary = 'List the workspace locks on this computer, or clear one left by a launch that never recorded its outcome';
17
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('workspace-locks');
18
+ static strict = false; // forward all args verbatim — see run()
19
+ static examples = [
20
+ '<%= config.bin %> daemon workspace-locks',
21
+ '<%= config.bin %> daemon workspace-locks --json',
22
+ '<%= config.bin %> daemon workspace-locks clear <key> --acknowledge launch_outcome_unknown',
23
+ ];
24
+ async run() {
25
+ // The refusal "Task workspace launch outcome is unknown; explicit recovery is
26
+ // required" repeats on every later start until this runs, so it must be
27
+ // reachable from the wrapper like `unlock`, not only from a second binary.
28
+ //
29
+ // It is reached for on a machine that is already wedged, which is often a
30
+ // machine whose runtime predates the verb. A stale runtime treats a
31
+ // subcommand it does not know as `start`, which collides with the healthy
32
+ // daemon's singleton lock, so the runtime's top-level help is read first
33
+ // (it starts nothing). Only a runtime that positively lacks the verb is
34
+ // refused; one whose help cannot be read is forwarded to, as every other
35
+ // wrapper does.
36
+ //
37
+ // `this.argv`, NOT `this.parse()`: `strict = false` relaxes POSITIONAL arity
38
+ // and oclif still rejects any flag this command has not declared, which
39
+ // would make `--acknowledge` and `--json` unreachable (OSK-296).
40
+ const argv = this.argv;
41
+ try {
42
+ if ((await (0, exec_runtime_binary_1.runtimeBinarySupportsSubcommand)('workspace-locks')) === false) {
43
+ this.error('The installed skrr background service is older than this skrr CLI and has no ' +
44
+ '`workspace-locks` command. Update it with `skrr daemon update`, then rerun ' +
45
+ '`skrr daemon workspace-locks`; do not stop a healthy running daemon to work around this.', { exit: RUNTIME_TOO_OLD_EXIT });
46
+ }
47
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['workspace-locks', ...argv]);
48
+ this.exit(code);
49
+ }
50
+ catch (err) {
51
+ if (err.message === 'runtime-binary-not-installed') {
52
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
53
+ this.exit(127);
54
+ }
55
+ throw err;
56
+ }
57
+ }
58
+ }
59
+ exports.default = DaemonWorkspaceLocks;
@@ -104,16 +104,16 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
104
104
  accessRoleId,
105
105
  })),
106
106
  ];
107
- let current;
108
107
  let result;
109
108
  try {
110
- current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
111
- result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, {
109
+ // `public` is left out on purpose: the server reads a missing or false one as
110
+ // "revoke the PUBLIC grant", so it is read from the space right before the
111
+ // write and carried through. If it cannot be read, nothing is written.
112
+ const request = await (0, data_provider_1.resolvePermissionsUpdate)({
112
113
  updated: updated,
113
114
  removed: [],
114
- public: Boolean(current.public),
115
- publicAccessRoleId: current.publicAccessRoleId,
116
- });
115
+ }, () => data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef));
116
+ result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, request);
117
117
  const expertise = flags.expertise;
118
118
  if ((brief && brief.trim().length > 0) || (expertise && expertise.length > 0)) {
119
119
  const saves = [
@@ -42,16 +42,16 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
42
42
  ...userIds.map((id) => ({ type: (0, space_members_1.principalType)('user'), id })),
43
43
  ...agentIds.map((id) => ({ type: (0, space_members_1.principalType)('agent'), id })),
44
44
  ];
45
- let current;
46
45
  let result;
47
46
  try {
48
- current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
49
- result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, {
47
+ // `public` is left out on purpose: the server reads a missing or false one as
48
+ // "revoke the PUBLIC grant", so it is read from the space right before the
49
+ // write and carried through. If it cannot be read, nothing is written.
50
+ const request = await (0, data_provider_1.resolvePermissionsUpdate)({
50
51
  updated: [],
51
52
  removed: removed,
52
- public: Boolean(current.public),
53
- publicAccessRoleId: current.publicAccessRoleId,
54
- });
53
+ }, () => data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef));
54
+ result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, request);
55
55
  if (!flags['keep-brief']) {
56
56
  const deletes = [
57
57
  ...userIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(spaceRef, 'user', principalId).catch(() => undefined)),
@@ -1481,9 +1481,7 @@ scheduleIssues) {
1481
1481
  const criteria = duty.target?.successCriteria || [];
1482
1482
  const evidenceHealth = latestCheck?.inputs?.evidenceHealth;
1483
1483
  const evidenceLine = describeEvidenceHealth(evidenceHealth, criteria.length);
1484
- const assessment = duty.assessment
1485
- ? (0, data_provider_2.readDutyAssessment)(duty.assessment)
1486
- : undefined;
1484
+ const assessment = duty.assessment ? (0, data_provider_2.readDutyAssessment)(duty.assessment) : undefined;
1487
1485
  log(`Assessment: ${assessment?.label ?? 'Unknown'}`);
1488
1486
  log(`Evidence: ${describeAssessmentEvidence(assessment?.evidence)}`);
1489
1487
  log(`Operation: ${describeOperation(assessment?.operation, assessment?.operationReason)}`);
@@ -1557,7 +1555,8 @@ scheduleIssues) {
1557
1555
  if (decision?.summaryClarification && duty.state.summary === decision.summaryClarificationFor) {
1558
1556
  log(decision.summaryClarification);
1559
1557
  }
1560
- else if (duty.state.summary === 'Its last run already covered this evidence, so no new run was started.') {
1558
+ else if (duty.state.summary ===
1559
+ 'Its last run already covered this evidence, so no new run was started.') {
1561
1560
  log('This statement alone does not prove that the evidence was observed or the work succeeded.');
1562
1561
  }
1563
1562
  }
@@ -1680,7 +1679,8 @@ function renderCheckList(checks, log) {
1680
1679
  if (reasons.length > 0)
1681
1680
  log(`'-' = not retained. ${reasons.join(' ')}`);
1682
1681
  for (const check of checks) {
1683
- if (check.decision?.summaryClarification && (check.decision.whyNow ?? check.decision.summary) === check.decision.summaryClarificationFor) {
1682
+ if (check.decision?.summaryClarification &&
1683
+ (check.decision.whyNow ?? check.decision.summary) === check.decision.summaryClarificationFor) {
1684
1684
  log(`Check ${check.id ?? '-'}: ${check.decision.summaryClarification}`);
1685
1685
  }
1686
1686
  }
@@ -1792,6 +1792,16 @@ function renderDutyLedger(ledger, log) {
1792
1792
  { key: 'actions', header: 'ACTIONS' },
1793
1793
  { key: 'why', header: 'WHY', maxWidth: 48 },
1794
1794
  ], 'No checks recorded.', log);
1795
+ // The WHY cell is the stored sentence, cut to fit. For a deduplicated follow-through that
1796
+ // sentence ("Its last run already covered this evidence") reads as proof the work was seen,
1797
+ // so the clarification the server sends with it is printed beneath the table, as the trace
1798
+ // does (OSK-23051).
1799
+ for (const item of checks) {
1800
+ const clarification = record(item.decision)?.summaryClarification;
1801
+ if (typeof clarification === 'string' && clarification) {
1802
+ log(`Check ${text(item.id)}: ${clarification}`);
1803
+ }
1804
+ }
1795
1805
  }
1796
1806
  if (runs.length) {
1797
1807
  log('Runs:');
@@ -2046,8 +2056,18 @@ function cycleSummary(cycle) {
2046
2056
  : 'applied an agent result';
2047
2057
  }
2048
2058
  if (cycle.outcome === 'in_flight') {
2049
- const runs = cycle.runs?.length || 0;
2050
- return runs ? `${runs} run(s) still going` : 'check still running';
2059
+ const runs = cycle.runs ?? [];
2060
+ if (!runs.length)
2061
+ return 'check still running';
2062
+ // A run parked for a runtime is not "still going" (OSK-23379): it has not started, and the server
2063
+ // says why (`waiting`), so the row says parked and names the reason once.
2064
+ const parked = runs.filter((run) => run.waiting);
2065
+ if (!parked.length)
2066
+ return `${runs.length} run(s) still going`;
2067
+ const why = [...new Set(parked.map((run) => run.waiting?.summary))].join('; ');
2068
+ return parked.length === runs.length
2069
+ ? `${parked.length} run(s) parked — ${why}`
2070
+ : `${runs.length - parked.length} running, ${parked.length} parked — ${why}`;
2051
2071
  }
2052
2072
  return cycle.note || cycle.decision?.summary || cycle.decision?.posture || 'nothing to act on';
2053
2073
  }
@@ -2100,7 +2120,9 @@ function formatDutyCycles(page) {
2100
2120
  : CYCLE_GLYPH[cycle.outcome] || '?';
2101
2121
  const word = echo ? 'recorded' : owed ? 'owed' : String(cycle.outcome);
2102
2122
  lines.push(`${cycleTime(cycle.startedAt)} ${glyph} ${word.padEnd(9)} ${cycleWake(cycle).padEnd(18)} ${echo ? recordOnlyEchoSummary(cycle) : cycleSummary(cycle)}`);
2103
- if (!echo && cycle.decision?.summaryClarification && cycleSummary(cycle) === cycle.decision.summary) {
2123
+ if (!echo &&
2124
+ cycle.decision?.summaryClarification &&
2125
+ cycleSummary(cycle) === cycle.decision.summary) {
2104
2126
  lines.push(` ${cycle.decision.summaryClarification}`);
2105
2127
  }
2106
2128
  lines.push(...platformFetchLines(cycle));
@@ -51,6 +51,11 @@ function renderExecutionReceipt(receipt, log, verbose = false) {
51
51
  const identity = receipt.runtime.name || receipt.runtime.id || 'the selected runtime';
52
52
  log(`Runtime: ${identity}${receipt.runtime.kind ? ` · ${receipt.runtime.kind}` : ''}${receipt.runtime.provider ? ` · ${receipt.runtime.provider}` : ''}`);
53
53
  }
54
+ // The server attaches the same evidence, usually the Check itself, to every phase of one
55
+ // execution, so the link was printed under Check, Working, Decided and Delivered (OSK-23271).
56
+ // Each piece of evidence is printed once, under the first phase that has it and a place to
57
+ // open it; different evidence stays on the phase it belongs to. The web receipt does the same.
58
+ const printedEvidence = new Set();
54
59
  for (const phase of receipt.phases) {
55
60
  const mark = { done: '✓', working: '→', waiting: '…', failed: '×', skipped: '–' }[phase.status];
56
61
  const label = phase.phase === 'observed' && receipt.checkKind === 'follow_through'
@@ -59,8 +64,13 @@ function renderExecutionReceipt(receipt, log, verbose = false) {
59
64
  log(` ${mark} ${label}: ${phase.summary}${phase.at ? ` · ${phase.at}` : ''}`);
60
65
  for (const evidence of phase.evidence) {
61
66
  const location = evidence.url || evidence.path;
62
- if (location)
63
- log(` ${evidence.label}: ${location}`);
67
+ if (!location)
68
+ continue;
69
+ const identity = `${evidence.kind}:${evidence.id}`;
70
+ if (printedEvidence.has(identity))
71
+ continue;
72
+ printedEvidence.add(identity);
73
+ log(` ${evidence.label}: ${location}`);
64
74
  }
65
75
  }
66
76
  // "Next" names an action only when the receipt has one. A reason that only