@skrr-ai/cli 0.1.40 → 0.1.42

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 (120) hide show
  1. package/dist/base-command.d.ts +9 -0
  2. package/dist/base-command.js +18 -3
  3. package/dist/commands/agent-shares/list-for.js +4 -11
  4. package/dist/commands/agent-shares/received.js +4 -11
  5. package/dist/commands/agent-shares/sent.js +4 -11
  6. package/dist/commands/agent-shares/with.js +3 -10
  7. package/dist/commands/agents/activity.js +1 -1
  8. package/dist/commands/agents/api-actions/add.js +6 -0
  9. package/dist/commands/agents/chat.js +6 -1
  10. package/dist/commands/agents/create.js +6 -1
  11. package/dist/commands/agents/manager/ensure.d.ts +18 -0
  12. package/dist/commands/agents/manager/ensure.js +56 -0
  13. package/dist/commands/agents/show.js +4 -0
  14. package/dist/commands/agents/tools/auth.d.ts +6 -0
  15. package/dist/commands/agents/tools/auth.js +27 -1
  16. package/dist/commands/agents/tools/index.js +11 -1
  17. package/dist/commands/agents/update.js +6 -1
  18. package/dist/commands/code/install.d.ts +4 -2
  19. package/dist/commands/code/install.js +15 -14
  20. package/dist/commands/convos/list.js +1 -3
  21. package/dist/commands/convos/show.js +4 -11
  22. package/dist/commands/daemon/index.js +3 -3
  23. package/dist/commands/daemon/install.js +4 -4
  24. package/dist/commands/daemon/login.js +1 -1
  25. package/dist/commands/daemon/logs.d.ts +3 -1
  26. package/dist/commands/daemon/logs.js +16 -1
  27. package/dist/commands/daemon/start.js +3 -3
  28. package/dist/commands/daemon/status.d.ts +9 -0
  29. package/dist/commands/daemon/status.js +22 -0
  30. package/dist/commands/dm/messages.js +1 -11
  31. package/dist/commands/followups/cancel.js +1 -1
  32. package/dist/commands/followups/remind.js +4 -0
  33. package/dist/commands/followups/resolve.js +1 -1
  34. package/dist/commands/followups/show.js +16 -0
  35. package/dist/commands/harnesses/forget.js +20 -3
  36. package/dist/commands/harnesses/install.d.ts +18 -0
  37. package/dist/commands/harnesses/install.js +146 -25
  38. package/dist/commands/harnesses/installers.d.ts +1 -1
  39. package/dist/commands/harnesses/installers.js +36 -12
  40. package/dist/commands/harnesses/list.d.ts +74 -2
  41. package/dist/commands/harnesses/list.js +231 -15
  42. package/dist/commands/harnesses/ping.d.ts +2 -0
  43. package/dist/commands/harnesses/ping.js +21 -0
  44. package/dist/commands/harnesses/show.d.ts +22 -0
  45. package/dist/commands/harnesses/show.js +116 -17
  46. package/dist/commands/harnesses/update.d.ts +8 -0
  47. package/dist/commands/harnesses/update.js +25 -1
  48. package/dist/commands/harnesses/usage.d.ts +2 -0
  49. package/dist/commands/harnesses/usage.js +7 -2
  50. package/dist/commands/instructions/status.js +13 -0
  51. package/dist/commands/instructions/update-target.d.ts +1 -0
  52. package/dist/commands/instructions/update-target.js +11 -3
  53. package/dist/commands/login.js +5 -5
  54. package/dist/commands/machines/list.js +8 -9
  55. package/dist/commands/machines/show.js +46 -17
  56. package/dist/commands/messages/show.js +3 -10
  57. package/dist/commands/shares/get.js +2 -9
  58. package/dist/commands/shares/list.js +1 -9
  59. package/dist/commands/shortcuts/show.js +4 -11
  60. package/dist/commands/skills/import-as-actions.js +6 -15
  61. package/dist/commands/skills/local.js +6 -0
  62. package/dist/commands/spaces/actions/run.js +3 -4
  63. package/dist/commands/spaces/briefs/get.js +2 -9
  64. package/dist/commands/spaces/briefs/list.js +1 -9
  65. package/dist/commands/spaces/conversations.js +1 -9
  66. package/dist/commands/spaces/heartbeats/list.js +1 -9
  67. package/dist/commands/spaces/heartbeats/status.js +2 -9
  68. package/dist/commands/tasks/activity.js +1 -10
  69. package/dist/commands/tasks/approvals/list.js +1 -9
  70. package/dist/commands/tasks/attachments/list.js +1 -9
  71. package/dist/commands/tasks/comments/list.js +1 -9
  72. package/dist/commands/tasks/complete.js +13 -0
  73. package/dist/commands/tasks/dri-status.js +2 -9
  74. package/dist/commands/tasks/events/append.js +9 -7
  75. package/dist/commands/tasks/execution-timeline.js +1 -9
  76. package/dist/commands/tasks/monitor.js +1 -9
  77. package/dist/commands/tasks/result/submit.js +14 -0
  78. package/dist/commands/tasks/runs.js +1 -9
  79. package/dist/commands/tasks/show.js +5 -12
  80. package/dist/commands/token/list.d.ts +8 -0
  81. package/dist/commands/token/list.js +51 -6
  82. package/dist/help.js +8 -12
  83. package/dist/lib/agent-home-workspace.d.ts +19 -0
  84. package/dist/lib/agent-home-workspace.js +39 -0
  85. package/dist/lib/agent-resolver.js +2 -2
  86. package/dist/lib/agentic-stream.d.ts +22 -1
  87. package/dist/lib/agentic-stream.js +48 -7
  88. package/dist/lib/cli-installers.d.ts +124 -2
  89. package/dist/lib/cli-installers.js +196 -13
  90. package/dist/lib/command-miss.d.ts +22 -0
  91. package/dist/lib/command-miss.js +78 -0
  92. package/dist/lib/daemon-setup.js +2 -2
  93. package/dist/lib/daemon-target.d.ts +14 -0
  94. package/dist/lib/daemon-target.js +32 -0
  95. package/dist/lib/daemonBroker.js +1 -1
  96. package/dist/lib/daemonHandoff.js +1 -1
  97. package/dist/lib/exec-runtime-binary.js +2 -2
  98. package/dist/lib/followups.d.ts +12 -0
  99. package/dist/lib/followups.js +14 -1
  100. package/dist/lib/format.d.ts +11 -0
  101. package/dist/lib/format.js +21 -0
  102. package/dist/lib/harness-labels.d.ts +39 -0
  103. package/dist/lib/harness-labels.js +60 -0
  104. package/dist/lib/harnesses.d.ts +6 -0
  105. package/dist/lib/instruction-input.d.ts +13 -0
  106. package/dist/lib/instruction-input.js +20 -1
  107. package/dist/lib/local-skills.d.ts +44 -1
  108. package/dist/lib/local-skills.js +58 -2
  109. package/dist/lib/login.js +5 -5
  110. package/dist/lib/machines.d.ts +6 -0
  111. package/dist/lib/machines.js +68 -2
  112. package/dist/lib/runtime-tool-support.d.ts +34 -0
  113. package/dist/lib/runtime-tool-support.js +77 -0
  114. package/dist/lib/share-rows.d.ts +17 -0
  115. package/dist/lib/share-rows.js +35 -0
  116. package/dist/lib/task-closure.d.ts +13 -0
  117. package/dist/lib/task-closure.js +17 -0
  118. package/dist/node_modules/@skrr-ai/data-provider/index.js +5066 -5033
  119. package/oclif.manifest.json +33472 -33360
  120. package/package.json +6 -3
@@ -7,6 +7,7 @@ exports.formatCell = formatCell;
7
7
  exports.collapseWhitespace = collapseWhitespace;
8
8
  exports.renderTable = renderTable;
9
9
  exports.localStamp = localStamp;
10
+ exports.localTime = localTime;
10
11
  exports.localZone = localZone;
11
12
  /**
12
13
  * Code points that occupy TWO terminal columns (Unicode East Asian Wide and
@@ -212,6 +213,26 @@ function localStamp(value) {
212
213
  return (`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ` +
213
214
  `${pad(date.getHours())}:${pad(date.getMinutes())}`);
214
215
  }
216
+ /**
217
+ * One timestamp that carries its own zone: `2026-08-21 17:54:03 PDT`.
218
+ *
219
+ * For key/value output and any row that cannot share a header naming the zone.
220
+ * About 25 commands formatted with `toISOString().slice(0, 19)` — UTC with no
221
+ * marker, which reads as local time — while `harnesses list` and `machines`
222
+ * printed local time with the zone named, so one CLI kept two clocks
223
+ * (OSK-10041). Seconds, because the commands that print these (task runs,
224
+ * activity, monitor) order events seconds apart. Never throws.
225
+ */
226
+ function localTime(value) {
227
+ if (value === null || value === undefined || value === '')
228
+ return '-';
229
+ const date = value instanceof Date ? value : new Date(typeof value === 'number' ? value : String(value));
230
+ if (Number.isNaN(date.getTime()))
231
+ return String(value);
232
+ const zone = localZone(date);
233
+ const seconds = `${date.getSeconds()}`.padStart(2, '0');
234
+ return `${localStamp(date)}:${seconds}${zone ? ` ${zone}` : ''}`;
235
+ }
215
236
  /**
216
237
  * `PDT` — the zone `localStamp` renders in, to be named once per command
217
238
  * rather than repeated on every row.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * How a harness row's provider and status read in human output — ONE rule for
3
+ * `harnesses list` and `harnesses show`.
4
+ *
5
+ * Both findings this closes were the same defect on two columns: the rule lived
6
+ * in one command and not the other.
7
+ *
8
+ * - Status (OSK-9610): `list` printed `superseded` for a row a later
9
+ * registration replaced; `show` printed `offline` for the same id. The server
10
+ * sends `superseded` on both routes — `show` never read it.
11
+ * - Provider (OSK-9649 / OSK-9290): the web renders the placeholder row of a
12
+ * machine with no coding engine as "No coding agent installed" and folds the
13
+ * first-party harness's older spelling into its current one. The CLI printed
14
+ * the stored value — `oversky` on 111 rows, and the first-party harness's
15
+ * older spelling beside its current one — so one product had three names here.
16
+ *
17
+ * `--json` keeps the stored values: it is the API contract, not a rendering.
18
+ */
19
+ /** What the PROVIDER column says for a machine that has no coding engine. */
20
+ export declare const NO_CODING_AGENT_PROVIDER_LABEL = "none";
21
+ export declare function harnessStatusLabel(row: {
22
+ status?: string | null;
23
+ superseded?: boolean | null;
24
+ }): string;
25
+ export declare function isNoCodingAgentProvider(provider: string | null | undefined): boolean;
26
+ export declare function harnessProviderLabel(provider: string | null | undefined): string;
27
+ /**
28
+ * YOUR alias is what `name` shows and it differs from the name everyone else
29
+ * sees. The server sends both (`aliased`, `sharedName`); every human surface
30
+ * asks this one question of them, so `list`, `show` and `update --name` cannot
31
+ * disagree about whether a row is aliased (OSK-10004).
32
+ */
33
+ export declare function isAliasCoveringSharedName(row: {
34
+ name?: string | null;
35
+ sharedName?: string | null;
36
+ aliased?: boolean | null;
37
+ }): boolean;
38
+ /** The longer phrase, for a single-row view with room for it. */
39
+ export declare function harnessProviderDescription(provider: string | null | undefined): string;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * How a harness row's provider and status read in human output — ONE rule for
4
+ * `harnesses list` and `harnesses show`.
5
+ *
6
+ * Both findings this closes were the same defect on two columns: the rule lived
7
+ * in one command and not the other.
8
+ *
9
+ * - Status (OSK-9610): `list` printed `superseded` for a row a later
10
+ * registration replaced; `show` printed `offline` for the same id. The server
11
+ * sends `superseded` on both routes — `show` never read it.
12
+ * - Provider (OSK-9649 / OSK-9290): the web renders the placeholder row of a
13
+ * machine with no coding engine as "No coding agent installed" and folds the
14
+ * first-party harness's older spelling into its current one. The CLI printed
15
+ * the stored value — `oversky` on 111 rows, and the first-party harness's
16
+ * older spelling beside its current one — so one product had three names here.
17
+ *
18
+ * `--json` keeps the stored values: it is the API contract, not a rendering.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.NO_CODING_AGENT_PROVIDER_LABEL = void 0;
22
+ exports.harnessStatusLabel = harnessStatusLabel;
23
+ exports.isNoCodingAgentProvider = isNoCodingAgentProvider;
24
+ exports.harnessProviderLabel = harnessProviderLabel;
25
+ exports.isAliasCoveringSharedName = isAliasCoveringSharedName;
26
+ exports.harnessProviderDescription = harnessProviderDescription;
27
+ const data_provider_1 = require("@skrr-ai/data-provider");
28
+ /** What the PROVIDER column says for a machine that has no coding engine. */
29
+ exports.NO_CODING_AGENT_PROVIDER_LABEL = 'none';
30
+ function harnessStatusLabel(row) {
31
+ if (row.superseded)
32
+ return 'superseded';
33
+ return typeof row.status === 'string' && row.status.length > 0 ? row.status : 'unknown';
34
+ }
35
+ function isNoCodingAgentProvider(provider) {
36
+ return typeof provider === 'string' && (0, data_provider_1.isManagedProductFallbackProvider)(provider);
37
+ }
38
+ function harnessProviderLabel(provider) {
39
+ if (typeof provider !== 'string' || provider.length === 0)
40
+ return 'unknown';
41
+ if (isNoCodingAgentProvider(provider))
42
+ return exports.NO_CODING_AGENT_PROVIDER_LABEL;
43
+ return String((0, data_provider_1.canonicalHarnessProvider)(provider) ?? provider);
44
+ }
45
+ /**
46
+ * YOUR alias is what `name` shows and it differs from the name everyone else
47
+ * sees. The server sends both (`aliased`, `sharedName`); every human surface
48
+ * asks this one question of them, so `list`, `show` and `update --name` cannot
49
+ * disagree about whether a row is aliased (OSK-10004).
50
+ */
51
+ function isAliasCoveringSharedName(row) {
52
+ return Boolean(row.aliased && row.sharedName && row.sharedName !== row.name);
53
+ }
54
+ /** The longer phrase, for a single-row view with room for it. */
55
+ function harnessProviderDescription(provider) {
56
+ if (isNoCodingAgentProvider(provider)) {
57
+ return `${exports.NO_CODING_AGENT_PROVIDER_LABEL} — ${(0, data_provider_1.managedProductFallbackLabel)().toLowerCase()} on this machine`;
58
+ }
59
+ return harnessProviderLabel(provider);
60
+ }
@@ -51,6 +51,12 @@ export interface Harness {
51
51
  sharedName?: string;
52
52
  aliased?: boolean;
53
53
  status?: string;
54
+ /**
55
+ * A later registration on the same machine replaced this row. Sent by both
56
+ * the list and the single-row routes; human output shows it instead of the
57
+ * stored status (`harnessStatusLabel`, OSK-9610).
58
+ */
59
+ superseded?: boolean;
54
60
  harnessLocation?: 'local' | 'cloud';
55
61
  daemonId?: string;
56
62
  machineUuid?: string;
@@ -76,3 +76,16 @@ export declare function describeTargetSync(target: {
76
76
  updatedAt?: string;
77
77
  driftCount?: number;
78
78
  }, now?: number, liveDaemonIds?: string[]): string;
79
+ /**
80
+ * The command that re-binds a stalled target to the daemon now running on its
81
+ * machine, or null when no such daemon is live.
82
+ *
83
+ * A daemon started a different way on the same machine (launchd → cli) gets a
84
+ * new id, and a target stays bound to the old one. Placement is the machine, not
85
+ * the daemon, so the recovery is `update-target --daemon`, never a re-install,
86
+ * which the placement index refuses (OSK-9961).
87
+ */
88
+ export declare function rebindCommandFor(target: {
89
+ id: string;
90
+ daemonId?: string | null;
91
+ }, liveDaemonIds: readonly string[]): string | null;
@@ -7,6 +7,7 @@ exports.resolveBundleLabel = resolveBundleLabel;
7
7
  exports.parseDaemonId = parseDaemonId;
8
8
  exports.sameMachineDaemon = sameMachineDaemon;
9
9
  exports.describeTargetSync = describeTargetSync;
10
+ exports.rebindCommandFor = rebindCommandFor;
10
11
  const promises_1 = require("node:fs/promises");
11
12
  async function readStdin() {
12
13
  const chunks = [];
@@ -180,7 +181,25 @@ function describeTargetSync(target, now = Date.now(), liveDaemonIds = []) {
180
181
  const live = parseDaemonId(elsewhere);
181
182
  const pinned = parseDaemonId(target.daemonId || '');
182
183
  // Kept under the STATUS column's `maxWidth: 78`, same constraint as below.
183
- return `${base} — stalled ${days}d; daemon here now runs as ${live?.source}, not ${pinned?.source}: re-install`;
184
+ // Re-bind, not re-install: install refuses a second target on the same
185
+ // placement, so "re-install" was a remedy that could not succeed (OSK-9961).
186
+ // The full command does not fit the column; status prints it below.
187
+ return `${base} — stalled ${days}d; daemon here now runs as ${live?.source}, not ${pinned?.source}: re-bind below`;
184
188
  }
185
189
  return `${base} — stalled ${days}d; daemon may be gone: remove, then purge-target --force`;
186
190
  }
191
+ /**
192
+ * The command that re-binds a stalled target to the daemon now running on its
193
+ * machine, or null when no such daemon is live.
194
+ *
195
+ * A daemon started a different way on the same machine (launchd → cli) gets a
196
+ * new id, and a target stays bound to the old one. Placement is the machine, not
197
+ * the daemon, so the recovery is `update-target --daemon`, never a re-install,
198
+ * which the placement index refuses (OSK-9961).
199
+ */
200
+ function rebindCommandFor(target, liveDaemonIds) {
201
+ if (!target.daemonId || liveDaemonIds.includes(target.daemonId))
202
+ return null;
203
+ const live = sameMachineDaemon(target.daemonId, [...liveDaemonIds]);
204
+ return live ? `skrr instructions update-target ${target.id} --daemon ${live}` : null;
205
+ }
@@ -38,7 +38,23 @@ export declare function isUserInvocable(skill: Pick<DaemonLocalSkill, 'triggers'
38
38
  * dropped, because the server's own rule is that a skill the user picked and
39
39
  * the turn did not load must fail the turn rather than run without it.
40
40
  */
41
- export declare function resolveLocalSkillRefs(inventory: ReadonlyArray<DaemonLocalSkill>, requested: ReadonlyArray<string>): {
41
+ /**
42
+ * The restart that refreshes THIS daemon's inventory. A daemon id is
43
+ * `daemon_<machine>_<source>_<profile>`; a bare `skrr daemon restart` restarts
44
+ * the default profile, so for any other profile the hint named a different
45
+ * daemon than the one whose list was stale (OSK-10080 verifier).
46
+ */
47
+ export declare function daemonRestartCommand(daemonId: string | undefined): string;
48
+ export declare function resolveLocalSkillRefs(inventory: ReadonlyArray<DaemonLocalSkill>, requested: ReadonlyArray<string>, options?: {
49
+ /**
50
+ * The inventory is what the daemon reported when it last registered, not a
51
+ * live read. A skill added since is missing from it — for up to an hour, until
52
+ * the daemon reconnects — so "not on this machine" would be false (OSK-10080).
53
+ */
54
+ snapshot?: boolean;
55
+ /** Whose snapshot, so the refresh hint restarts the right daemon. */
56
+ daemonId?: string;
57
+ }): {
42
58
  refs: Array<{
43
59
  name: string;
44
60
  pathHash: string;
@@ -96,3 +112,30 @@ export declare const SKILL_CONVENTION_DISCOVERY_SINCE = "0.8.44";
96
112
  * add an explanation, and claiming an unknown daemon is old would be a guess.
97
113
  */
98
114
  export declare function daemonPredates(version: string | null | undefined, floor: string): boolean;
115
+ /**
116
+ * The table, summary and exit decision for `skills import-as-actions`.
117
+ *
118
+ * A skill that imported without its action because the library was full used to
119
+ * show only `limit_reached`, an empty detail, "0 skill(s) failed" and exit 0, so
120
+ * a script or agent concluded every action it asked for was added (OSK-10185).
121
+ * `already_exists` stays a success: the action the caller wanted is there.
122
+ */
123
+ export declare function summarizeSkillActionImport(result: {
124
+ targetAgentId: string;
125
+ actionsCreated: number;
126
+ results: Array<{
127
+ name: string;
128
+ status: string;
129
+ error?: string;
130
+ actionCreated?: boolean;
131
+ actionSkippedReason?: string;
132
+ actionError?: string;
133
+ }>;
134
+ actionsError?: {
135
+ message: string;
136
+ } | null;
137
+ }): {
138
+ rows: Array<Record<string, string>>;
139
+ summary: string;
140
+ failed: boolean;
141
+ };
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SKILL_CONVENTION_DISCOVERY_SINCE = void 0;
4
4
  exports.chooseDaemon = chooseDaemon;
5
5
  exports.isUserInvocable = isUserInvocable;
6
+ exports.daemonRestartCommand = daemonRestartCommand;
6
7
  exports.resolveLocalSkillRefs = resolveLocalSkillRefs;
7
8
  exports.withSkillInvocations = withSkillInvocations;
8
9
  exports.looksLikeSkillPath = looksLikeSkillPath;
9
10
  exports.findLocalSkillsNamed = findLocalSkillsNamed;
10
11
  exports.describeStoreSkillMiss = describeStoreSkillMiss;
11
12
  exports.daemonPredates = daemonPredates;
13
+ exports.summarizeSkillActionImport = summarizeSkillActionImport;
12
14
  const data_provider_1 = require("@skrr-ai/data-provider");
15
+ const instruction_input_1 = require("./instruction-input");
13
16
  /**
14
17
  * Which machine to ask, or why there is no single answer.
15
18
  *
@@ -44,7 +47,19 @@ function isUserInvocable(skill) {
44
47
  * dropped, because the server's own rule is that a skill the user picked and
45
48
  * the turn did not load must fail the turn rather than run without it.
46
49
  */
47
- function resolveLocalSkillRefs(inventory, requested) {
50
+ /**
51
+ * The restart that refreshes THIS daemon's inventory. A daemon id is
52
+ * `daemon_<machine>_<source>_<profile>`; a bare `skrr daemon restart` restarts
53
+ * the default profile, so for any other profile the hint named a different
54
+ * daemon than the one whose list was stale (OSK-10080 verifier).
55
+ */
56
+ function daemonRestartCommand(daemonId) {
57
+ const profile = daemonId ? (0, instruction_input_1.parseDaemonId)(daemonId)?.profile : undefined;
58
+ return profile && profile !== 'default'
59
+ ? `skrr daemon restart --profile ${profile}`
60
+ : 'skrr daemon restart';
61
+ }
62
+ function resolveLocalSkillRefs(inventory, requested, options = {}) {
48
63
  const refs = [];
49
64
  const problems = [];
50
65
  const seen = new Set();
@@ -58,7 +73,11 @@ function resolveLocalSkillRefs(inventory, requested) {
58
73
  if (matches.length === 0) {
59
74
  problems.push(named.length > 0
60
75
  ? `No skill "${name}" under ${root}. It is under: ${named.map((s) => s.source ?? '?').join(', ')}.`
61
- : `No skill named "${name}" on this machine. See \`skrr skills local\`.`);
76
+ : options.snapshot
77
+ ? `No skill named "${name}" in the list this machine's daemon reported when it last connected. ` +
78
+ `A skill added since then appears after the daemon reconnects — run \`${daemonRestartCommand(options.daemonId)}\` on that machine. ` +
79
+ 'See `skrr skills local`.'
80
+ : `No skill named "${name}" on this machine. See \`skrr skills local\`.`);
62
81
  continue;
63
82
  }
64
83
  if (matches.length > 1) {
@@ -193,3 +212,40 @@ function daemonPredates(version, floor) {
193
212
  }
194
213
  return false;
195
214
  }
215
+ /** Why a skill imported but got no action, in words a person or an agent can act on. */
216
+ const ACTION_SKIP_DETAIL = {
217
+ limit_reached: "this agent's action library is full; delete an action, then run the import again to add it",
218
+ already_exists: 'an action for this skill is already offered at this scope',
219
+ };
220
+ /**
221
+ * The table, summary and exit decision for `skills import-as-actions`.
222
+ *
223
+ * A skill that imported without its action because the library was full used to
224
+ * show only `limit_reached`, an empty detail, "0 skill(s) failed" and exit 0, so
225
+ * a script or agent concluded every action it asked for was added (OSK-10185).
226
+ * `already_exists` stays a success: the action the caller wanted is there.
227
+ */
228
+ function summarizeSkillActionImport(result) {
229
+ const failed = result.results.filter((r) => r.status === 'failed');
230
+ const overCap = result.results.filter((r) => r.status !== 'failed' && r.actionSkippedReason === 'limit_reached');
231
+ const rows = result.results.map((r) => ({
232
+ skill: r.name,
233
+ import: r.status,
234
+ action: r.actionCreated
235
+ ? 'created'
236
+ : (r.actionSkippedReason ?? r.actionError ?? (r.status === 'failed' ? '-' : 'not added')),
237
+ detail: r.error ??
238
+ r.actionError ??
239
+ (r.actionSkippedReason ? (ACTION_SKIP_DETAIL[r.actionSkippedReason] ?? '') : ''),
240
+ }));
241
+ const summary = `${result.actionsCreated} action(s) created on ${result.targetAgentId}; ` +
242
+ `${failed.length} skill(s) failed` +
243
+ (overCap.length > 0
244
+ ? `; ${overCap.length} skill(s) imported without an action because the action library is full.`
245
+ : '.');
246
+ return {
247
+ rows,
248
+ summary,
249
+ failed: failed.length > 0 || overCap.length > 0 || Boolean(result.actionsError),
250
+ };
251
+ }
package/dist/lib/login.js CHANGED
@@ -84,7 +84,7 @@ async function cliLogin(opts = {}) {
84
84
  });
85
85
  if (brokerResult.ok) {
86
86
  console.log('');
87
- console.log(' Authorized via the local skrr runtime (no browser needed).');
87
+ console.log(' Authorized via the skrr background service on this computer (no browser needed).');
88
88
  return {
89
89
  token: brokerResult.accessToken,
90
90
  refreshToken: brokerResult.refreshToken,
@@ -107,7 +107,7 @@ async function cliLogin(opts = {}) {
107
107
  // broker failures — missing bootstrap, network blip, server 5xx —
108
108
  // silently fall through to PKCE / device-code below.
109
109
  if (brokerResult.reason === 'ci_token_refused') {
110
- throw new Error('The local skrr runtime is bootstrapped from a CI token, which cannot broker an interactive CLI login. ' +
110
+ throw new Error('The skrr background service on this computer is bootstrapped from a CI token, which cannot broker an interactive CLI login. ' +
111
111
  'Use `skrr create-token --name <name>` to mint a long-lived CI credential directly, ' +
112
112
  'or run `skrr login` on a machine where the daemon was authenticated interactively.');
113
113
  }
@@ -126,19 +126,19 @@ async function cliLogin(opts = {}) {
126
126
  brokerRateLimited = true;
127
127
  if (!(0, ssh_detect_1.isNonInteractive)()) {
128
128
  console.log('');
129
- console.log(' The local skrr runtime has brokered several logins recently and the server is ' +
129
+ console.log(' The skrr background service on this computer has brokered several logins recently and the server is ' +
130
130
  'rate-limiting them. Falling back to the browser flow.');
131
131
  }
132
132
  }
133
133
  if (brokerResult.reason === 'base_url_mismatch' && brokerResult.daemonServerUrl) {
134
134
  console.log('');
135
- console.log(` The local skrr runtime is logged in to ${brokerResult.daemonServerUrl}, but skrr is configured for ${serverUrl}.`);
135
+ console.log(` The skrr background service on this computer is logged in to ${brokerResult.daemonServerUrl}, but skrr is configured for ${serverUrl}.`);
136
136
  console.log(` Skipping the daemon-broker handoff. Run \`skrr login --base-url ${brokerResult.daemonServerUrl}\` to use the daemon instead.`);
137
137
  }
138
138
  }
139
139
  if ((0, ssh_detect_1.isNonInteractive)()) {
140
140
  throw new Error(brokerRateLimited
141
- ? 'The local skrr runtime is being rate-limited while brokering logins, and this ' +
141
+ ? 'The skrr background service on this computer is being rate-limited while brokering logins, and this ' +
142
142
  'shell cannot run the browser flow instead. The limit is per 15-minute window — ' +
143
143
  'retry shortly. For CI, use `skrr create-token` and set OVERSKY_TOKEN=osk_ci_...'
144
144
  : 'skrr login requires an interactive terminal or an SSH session. ' +
@@ -112,6 +112,12 @@ export interface Machine {
112
112
  * could come back says so, and a destroyed one cannot.
113
113
  */
114
114
  export declare function machineStateLabel(machine: Machine): string;
115
+ /**
116
+ * What a list says it left out, by the label each hidden machine would have
117
+ * printed: `250 terminated, 5 offline, 1 paused`. "offline or terminated"
118
+ * called a paused machine offline after the table stopped doing so (OSK-9996).
119
+ */
120
+ export declare function hiddenMachinesSummary(hidden: readonly Machine[]): string;
115
121
  /** Is this a machine a user could still use, or bring back? */
116
122
  export declare function isReachableMachine(machine: Machine): boolean;
117
123
  /** The user-editable slice. Identities, capabilities and lifecycle are not. */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.machineStateLabel = machineStateLabel;
4
+ exports.hiddenMachinesSummary = hiddenMachinesSummary;
4
5
  exports.isReachableMachine = isReachableMachine;
5
6
  exports.liveHarnessCount = liveHarnessCount;
6
7
  exports.listMachines = listMachines;
@@ -30,8 +31,36 @@ function machineStateLabel(machine) {
30
31
  if (controls && controls.canResume === false && controls.canTerminate === false) {
31
32
  return 'terminated';
32
33
  }
34
+ // A leased machine at rest says WHICH rest. `machines hosted list` printed
35
+ // `paused` and this list printed `offline` for the same machine, with the
36
+ // reason only in `machines show` (OSK-9996). `offline` stays for a machine
37
+ // that simply is not connected.
38
+ const leaseState = machine.lease?.state;
39
+ if (leaseState === 'paused' || leaseState === 'stopped')
40
+ return leaseState;
41
+ // A lease the provider has ended cannot come back either; it read `offline`
42
+ // while an unleased dead sandbox read `terminated`, so the hidden-machine
43
+ // footer counted 95 ended leases as offline (OSK-9996 verifier).
44
+ if (leaseState === 'terminated')
45
+ return 'terminated';
33
46
  return 'offline';
34
47
  }
48
+ /**
49
+ * What a list says it left out, by the label each hidden machine would have
50
+ * printed: `250 terminated, 5 offline, 1 paused`. "offline or terminated"
51
+ * called a paused machine offline after the table stopped doing so (OSK-9996).
52
+ */
53
+ function hiddenMachinesSummary(hidden) {
54
+ const counts = new Map();
55
+ for (const machine of hidden) {
56
+ const label = machineStateLabel(machine);
57
+ counts.set(label, (counts.get(label) ?? 0) + 1);
58
+ }
59
+ return [...counts.entries()]
60
+ .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))
61
+ .map(([label, count]) => `${count} ${label}`)
62
+ .join(', ');
63
+ }
35
64
  /** Is this a machine a user could still use, or bring back? */
36
65
  function isReachableMachine(machine) {
37
66
  return machineStateLabel(machine) !== 'terminated' && machine.status !== 'offline';
@@ -105,6 +134,22 @@ function hostedSandboxDaemonIds(ref) {
105
134
  return [];
106
135
  return [`hosted-machine-${ref}`, `hosted-job-machine-${ref}`];
107
136
  }
137
+ /**
138
+ * An id with its identity-kind prefix removed: `lease:rtl_…` → `rtl_…`,
139
+ * `dedicated-runtime:rtl_…` → `rtl_…`, `machine:0354…` → `0354…`.
140
+ *
141
+ * Other commands print the bare form. `machines dedicated list` and the lease
142
+ * payloads name `rtl_…`, and `harnesses list`'s MACHINE column prints the head
143
+ * of the identifier after the kind — so the id a user has to hand often lacks
144
+ * the prefix this list keys on, and `machines show rtl_…` answered "No machine
145
+ * matches" for a machine it was listing as `lease:rtl_…` (OSK-9269, OSK-9290).
146
+ */
147
+ function withoutIdentityKind(value) {
148
+ if (!value)
149
+ return undefined;
150
+ const separator = value.indexOf(':');
151
+ return separator === -1 ? undefined : value.slice(separator + 1);
152
+ }
108
153
  function resolveMachineRef(machines, ref) {
109
154
  const needle = ref.trim();
110
155
  const lower = needle.toLowerCase();
@@ -121,13 +166,26 @@ function resolveMachineRef(machines, ref) {
121
166
  // two unrelated-looking ids, no way on screen to tell they are one
122
167
  // machine. Exact composition, not a substring search, so this cannot
123
168
  // match a machine that merely contains the text.
124
- hostedSandboxDaemonIds(needle).some((candidate) => m.daemonId === candidate));
169
+ hostedSandboxDaemonIds(needle).some((candidate) => m.daemonId === candidate) ||
170
+ withoutIdentityKind(m.id) === needle ||
171
+ withoutIdentityKind(m.machineUuid) === needle ||
172
+ // A harness id names exactly one machine — the one it is registered on.
173
+ // Refusing it with "No machine matches" sent the user to a different
174
+ // command without saying which (OSK-9313).
175
+ (m.harnesses ?? []).some((h) => h.id === needle));
125
176
  if (exact.length === 1)
126
177
  return exact[0];
127
178
  const byName = machines.filter((m) => m.name?.toLowerCase() === lower);
128
179
  if (byName.length === 1)
129
180
  return byName[0];
130
- const prefix = machines.filter((m) => [m.id, m.machineUuid, m.stableDaemonId, m.daemonId].some((candidate) => candidate && candidate.toLowerCase().startsWith(lower)));
181
+ const prefix = machines.filter((m) => [
182
+ m.id,
183
+ m.machineUuid,
184
+ m.stableDaemonId,
185
+ m.daemonId,
186
+ withoutIdentityKind(m.id),
187
+ withoutIdentityKind(m.machineUuid),
188
+ ].some((candidate) => candidate && candidate.toLowerCase().startsWith(lower)));
131
189
  if (prefix.length === 1)
132
190
  return prefix[0];
133
191
  if (prefix.length > 1) {
@@ -140,5 +198,13 @@ function resolveMachineRef(machines, ref) {
140
198
  throw new Error(`"${ref}" matches ${prefix.length} machines: ${shown.join(', ')}` +
141
199
  `${rest > 0 ? `, and ${rest} more` : ''}. Use a longer prefix or the full id.`);
142
200
  }
201
+ // A harness id prefix or a harness name is the other `show`'s input. Say so
202
+ // rather than only "no machine", which left the reader to guess that a
203
+ // sibling command takes it (OSK-9313).
204
+ const harnessMatch = machines.some((m) => (m.harnesses ?? []).some((h) => (lower.length >= 4 && h.id.toLowerCase().startsWith(lower)) ||
205
+ (typeof h.name === 'string' && h.name.toLowerCase() === lower)));
206
+ if (harnessMatch) {
207
+ throw new Error(`No machine matches "${ref}", but a harness does. \`skrr harnesses show ${ref}\` takes it.`);
208
+ }
143
209
  throw new Error(`No machine matches "${ref}". Run \`skrr machines list\` to see them.`);
144
210
  }
@@ -0,0 +1,34 @@
1
+ import type { TPlugin } from '@skrr-ai/data-provider';
2
+ /**
3
+ * What an agent turn can call, said where tools are configured.
4
+ *
5
+ * Plugin tools (`agents tools`, `--tools`) and OpenAPI actions
6
+ * (`agents api-actions add`) reach an agent turn through the runtime's
7
+ * `agent-tools` server (OSK-9750, OSK-9754). Two limits remain, and the CLI is
8
+ * where the tool is set up, so it says them there:
9
+ * - image and file plugins save their output through a web request an agent
10
+ * turn does not have, so they are stored but not loaded;
11
+ * - an OAuth action runs only after the user authorizes it once, through a
12
+ * link the agent hands over on its first call.
13
+ */
14
+ /** The catalog's AGENT column. `?` for a server older than the `agentRuntime` field. */
15
+ export declare function agentRuntimeLabel(tool: Pick<TPlugin, 'agentRuntime'>): string;
16
+ export declare const AGENT_COLUMN_FOOTNOTE: string;
17
+ /** Stored plugin keys the catalog says an agent turn does not load. */
18
+ export declare function pluginKeysNotLoaded(keys: string[], catalog: TPlugin[]): string[];
19
+ export declare function pluginsNotLoadedNotice(keys: string[]): string;
20
+ /** Said after adding an OAuth action, since nothing works until both steps happen. */
21
+ export declare function oauthActionNotice(redirectUrl: string): string;
22
+ /** Split an agent's stored `tools` into plugin keys and OpenAPI action tool names. */
23
+ export declare function splitStoredTools(tools: unknown): {
24
+ plugins: string[];
25
+ actions: string[];
26
+ };
27
+ /**
28
+ * After `--tools` is saved: warn about the plugin keys an agent turn will not load.
29
+ *
30
+ * Unknown keys are refused by the server (OSK-9545); this covers the known ones
31
+ * that are stored but skipped. Best effort: a catalog that cannot be read says
32
+ * nothing rather than failing a write that already succeeded.
33
+ */
34
+ export declare function warnPluginsNotLoaded(tools: unknown, warn: (message: string) => void, fetchCatalog?: () => Promise<TPlugin[]>): Promise<void>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AGENT_COLUMN_FOOTNOTE = void 0;
4
+ exports.agentRuntimeLabel = agentRuntimeLabel;
5
+ exports.pluginKeysNotLoaded = pluginKeysNotLoaded;
6
+ exports.pluginsNotLoadedNotice = pluginsNotLoadedNotice;
7
+ exports.oauthActionNotice = oauthActionNotice;
8
+ exports.splitStoredTools = splitStoredTools;
9
+ exports.warnPluginsNotLoaded = warnPluginsNotLoaded;
10
+ const data_provider_1 = require("@skrr-ai/data-provider");
11
+ /**
12
+ * What an agent turn can call, said where tools are configured.
13
+ *
14
+ * Plugin tools (`agents tools`, `--tools`) and OpenAPI actions
15
+ * (`agents api-actions add`) reach an agent turn through the runtime's
16
+ * `agent-tools` server (OSK-9750, OSK-9754). Two limits remain, and the CLI is
17
+ * where the tool is set up, so it says them there:
18
+ * - image and file plugins save their output through a web request an agent
19
+ * turn does not have, so they are stored but not loaded;
20
+ * - an OAuth action runs only after the user authorizes it once, through a
21
+ * link the agent hands over on its first call.
22
+ */
23
+ /** The catalog's AGENT column. `?` for a server older than the `agentRuntime` field. */
24
+ function agentRuntimeLabel(tool) {
25
+ if (tool.agentRuntime === undefined)
26
+ return '?';
27
+ return tool.agentRuntime ? 'yes' : 'no';
28
+ }
29
+ exports.AGENT_COLUMN_FOOTNOTE = 'AGENT says whether an agent turn can call the tool. Image and file tools (AGENT no) ' +
30
+ 'save their output through a web request an agent turn does not have.';
31
+ /** Stored plugin keys the catalog says an agent turn does not load. */
32
+ function pluginKeysNotLoaded(keys, catalog) {
33
+ const byKey = new Map(catalog.map((tool) => [tool.pluginKey, tool]));
34
+ return keys.filter((key) => byKey.get(key)?.agentRuntime === false);
35
+ }
36
+ function pluginsNotLoadedNotice(keys) {
37
+ const [subject, verb] = keys.length === 1 ? ['it', 'saves'] : ['they', 'save'];
38
+ return (`Saved, but an agent turn cannot call ${keys.join(', ')}: ${subject} ${verb} ` +
39
+ 'output through a web request an agent turn does not have.');
40
+ }
41
+ /** Said after adding an OAuth action, since nothing works until both steps happen. */
42
+ function oauthActionNotice(redirectUrl) {
43
+ return (`Register ${redirectUrl} as the redirect URL with the OAuth provider. ` +
44
+ "The agent's first call to one of these operations returns a link for you to authorize; " +
45
+ 'after you finish, ask it to try again.');
46
+ }
47
+ /** Split an agent's stored `tools` into plugin keys and OpenAPI action tool names. */
48
+ function splitStoredTools(tools) {
49
+ const list = Array.isArray(tools) ? tools.map(String) : [];
50
+ return {
51
+ plugins: list.filter((name) => !name.includes(data_provider_1.actionDelimiter)),
52
+ actions: list.filter((name) => name.includes(data_provider_1.actionDelimiter)),
53
+ };
54
+ }
55
+ /**
56
+ * After `--tools` is saved: warn about the plugin keys an agent turn will not load.
57
+ *
58
+ * Unknown keys are refused by the server (OSK-9545); this covers the known ones
59
+ * that are stored but skipped. Best effort: a catalog that cannot be read says
60
+ * nothing rather than failing a write that already succeeded.
61
+ */
62
+ async function warnPluginsNotLoaded(tools, warn, fetchCatalog = () => data_provider_1.dataService.getAvailableTools()) {
63
+ const { plugins } = splitStoredTools(tools);
64
+ if (plugins.length === 0)
65
+ return;
66
+ let catalog;
67
+ try {
68
+ catalog = await fetchCatalog();
69
+ }
70
+ catch {
71
+ return;
72
+ }
73
+ const skipped = pluginKeysNotLoaded(plugins, catalog);
74
+ if (skipped.length > 0) {
75
+ warn(pluginsNotLoadedNotice(skipped));
76
+ }
77
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * How an agent-share row names its share and the other person.
3
+ *
4
+ * The share routes answer `{ shareId, owner: { userId, name }, recipient:
5
+ * { userId, name } }`. The four `agent-shares` listings read `id`/`_id` and
6
+ * stringified the person object, so every row printed SHARE ID `-` and FROM/TO
7
+ * `[object Object]` (OSK-10043): the one id `respond`/`revoke` need was
8
+ * unreadable, and so was who the share was with.
9
+ */
10
+ /** The share's id, whichever key the row carries it under. */
11
+ export declare function shareIdOf(share: Record<string, unknown>): string;
12
+ /**
13
+ * A person as `Name (userId)` — the name to recognise, the id that
14
+ * `agent-shares with <userId>` takes. Accepts a bare id string too, which older
15
+ * rows used.
16
+ */
17
+ export declare function sharePartyLabel(value: unknown): string;