@skrr-ai/cli 0.1.13 → 0.1.15

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 (136) hide show
  1. package/dist/base-command.d.ts +12 -36
  2. package/dist/base-command.js +96 -11
  3. package/dist/commands/agents/create.d.ts +1 -0
  4. package/dist/commands/agents/create.js +6 -1
  5. package/dist/commands/agents/instructions/add.d.ts +21 -0
  6. package/dist/commands/agents/instructions/add.js +115 -0
  7. package/dist/commands/agents/instructions/disable.d.ts +13 -0
  8. package/dist/commands/agents/instructions/disable.js +50 -0
  9. package/dist/commands/agents/instructions/edit.d.ts +16 -0
  10. package/dist/commands/agents/instructions/edit.js +79 -0
  11. package/dist/commands/agents/instructions/enable.d.ts +13 -0
  12. package/dist/commands/agents/instructions/enable.js +50 -0
  13. package/dist/commands/agents/instructions/move.d.ts +15 -0
  14. package/dist/commands/agents/instructions/move.js +61 -0
  15. package/dist/commands/agents/instructions/preview.d.ts +13 -0
  16. package/dist/commands/agents/instructions/preview.js +59 -0
  17. package/dist/commands/agents/instructions/remove.d.ts +13 -0
  18. package/dist/commands/agents/instructions/remove.js +49 -0
  19. package/dist/commands/agents/instructions/set.d.ts +17 -0
  20. package/dist/commands/agents/instructions/set.js +79 -0
  21. package/dist/commands/agents/instructions/show.d.ts +15 -0
  22. package/dist/commands/agents/instructions/show.js +76 -0
  23. package/dist/commands/agents/instructions/upgrade.d.ts +16 -0
  24. package/dist/commands/agents/instructions/upgrade.js +77 -0
  25. package/dist/commands/agents/list.d.ts +10 -0
  26. package/dist/commands/agents/list.js +16 -1
  27. package/dist/commands/agents/show.js +5 -0
  28. package/dist/commands/agents/triggers/policy.js +8 -2
  29. package/dist/commands/agents/update.d.ts +1 -0
  30. package/dist/commands/agents/update.js +8 -2
  31. package/dist/commands/browser.js +5 -5
  32. package/dist/commands/commitments/create.d.ts +2 -0
  33. package/dist/commands/commitments/create.js +30 -13
  34. package/dist/commands/commitments/update.d.ts +2 -0
  35. package/dist/commands/commitments/update.js +24 -4
  36. package/dist/commands/daemon/byok.js +5 -5
  37. package/dist/commands/daemon/index.js +5 -3
  38. package/dist/commands/daemon/install.js +8 -5
  39. package/dist/commands/daemon/login.js +5 -5
  40. package/dist/commands/daemon/logs.js +5 -5
  41. package/dist/commands/daemon/recover-offline-queue.d.ts +9 -0
  42. package/dist/commands/daemon/recover-offline-queue.js +24 -0
  43. package/dist/commands/daemon/restart.js +5 -5
  44. package/dist/commands/daemon/start.js +34 -6
  45. package/dist/commands/daemon/status.js +5 -5
  46. package/dist/commands/daemon/stop.js +5 -5
  47. package/dist/commands/daemon/uninstall.js +5 -5
  48. package/dist/commands/daemon/unlock.js +5 -5
  49. package/dist/commands/daemon/usage.js +6 -6
  50. package/dist/commands/instruction-blocks/create.d.ts +19 -0
  51. package/dist/commands/instruction-blocks/create.js +94 -0
  52. package/dist/commands/instruction-blocks/delete.d.ts +13 -0
  53. package/dist/commands/instruction-blocks/delete.js +35 -0
  54. package/dist/commands/instruction-blocks/list.d.ts +13 -0
  55. package/dist/commands/instruction-blocks/list.js +71 -0
  56. package/dist/commands/instruction-blocks/show.d.ts +12 -0
  57. package/dist/commands/instruction-blocks/show.js +35 -0
  58. package/dist/commands/instruction-blocks/update.d.ts +23 -0
  59. package/dist/commands/instruction-blocks/update.js +94 -0
  60. package/dist/commands/login.js +7 -2
  61. package/dist/commands/spaces/auto-executor/preview.d.ts +1 -0
  62. package/dist/commands/spaces/auto-executor/preview.js +62 -3
  63. package/dist/commands/spaces/auto-executor/update.d.ts +4 -0
  64. package/dist/commands/spaces/auto-executor/update.js +78 -7
  65. package/dist/commands/spaces/capacity.js +14 -2
  66. package/dist/commands/spaces/list.d.ts +13 -0
  67. package/dist/commands/spaces/list.js +20 -1
  68. package/dist/commands/spaces/update.d.ts +4 -0
  69. package/dist/commands/spaces/update.js +49 -2
  70. package/dist/commands/tasks/complete.d.ts +12 -5
  71. package/dist/commands/tasks/complete.js +50 -28
  72. package/dist/commands/tasks/continue-ready.js +9 -1
  73. package/dist/commands/tasks/create.d.ts +1 -0
  74. package/dist/commands/tasks/create.js +25 -1
  75. package/dist/commands/tasks/deliverable/add.d.ts +23 -0
  76. package/dist/commands/tasks/deliverable/add.js +70 -0
  77. package/dist/commands/tasks/events/append.d.ts +1 -1
  78. package/dist/commands/tasks/events/append.js +4 -4
  79. package/dist/commands/tasks/expectations.d.ts +12 -0
  80. package/dist/commands/tasks/expectations.js +92 -0
  81. package/dist/commands/tasks/judge.d.ts +29 -0
  82. package/dist/commands/tasks/judge.js +68 -0
  83. package/dist/commands/tasks/list.d.ts +11 -0
  84. package/dist/commands/tasks/list.js +82 -11
  85. package/dist/commands/tasks/report.d.ts +1 -1
  86. package/dist/commands/tasks/report.js +3 -3
  87. package/dist/commands/tasks/update.d.ts +1 -0
  88. package/dist/commands/tasks/update.js +34 -4
  89. package/dist/commands/tasks/waive.d.ts +25 -0
  90. package/dist/commands/tasks/waive.js +58 -0
  91. package/dist/commands/wiki/cat.js +2 -1
  92. package/dist/commands/wiki/mv.js +5 -1
  93. package/dist/commands/wiki/write.js +5 -1
  94. package/dist/lib/agent-config.js +5 -0
  95. package/dist/lib/agent-instructions.d.ts +15 -0
  96. package/dist/lib/agent-instructions.js +55 -0
  97. package/dist/lib/api-fetch.d.ts +2 -1
  98. package/dist/lib/api-fetch.js +9 -2
  99. package/dist/lib/command-hygiene.d.ts +6 -1
  100. package/dist/lib/command-hygiene.js +49 -29
  101. package/dist/lib/commitments.d.ts +44 -0
  102. package/dist/lib/commitments.js +123 -0
  103. package/dist/lib/daemon-binding.d.ts +3 -4
  104. package/dist/lib/daemon-binding.js +11 -10
  105. package/dist/lib/daemon-handoff-opt-out.d.ts +8 -0
  106. package/dist/lib/daemon-handoff-opt-out.js +17 -0
  107. package/dist/lib/daemon-installer.d.ts +1 -1
  108. package/dist/lib/daemon-installer.js +2 -2
  109. package/dist/lib/daemon-setup.js +13 -7
  110. package/dist/lib/daemonHandoff.d.ts +1 -1
  111. package/dist/lib/daemonHandoff.js +20 -7
  112. package/dist/lib/delegated-cli.d.ts +0 -9
  113. package/dist/lib/delegated-cli.js +149 -6
  114. package/dist/lib/{exec-oversky.d.ts → exec-runtime-binary.d.ts} +28 -4
  115. package/dist/lib/{exec-oversky.js → exec-runtime-binary.js} +138 -37
  116. package/dist/lib/git-task.d.ts +37 -0
  117. package/dist/lib/git-task.js +151 -0
  118. package/dist/lib/instruction-blocks.d.ts +29 -0
  119. package/dist/lib/instruction-blocks.js +159 -0
  120. package/dist/lib/node-adapter.js +6 -0
  121. package/dist/lib/runtime-start-verification.d.ts +49 -0
  122. package/dist/lib/runtime-start-verification.js +108 -0
  123. package/dist/lib/sky-code.d.ts +1 -1
  124. package/dist/lib/sky-code.js +1 -1
  125. package/dist/lib/task-execution.d.ts +18 -2
  126. package/dist/lib/task-execution.js +19 -14
  127. package/dist/lib/task-transcript.js +1 -1
  128. package/dist/lib/tasks.d.ts +50 -0
  129. package/dist/lib/tasks.js +66 -1
  130. package/dist/lib/usage-discovery.js +1 -1
  131. package/dist/lib/web-url.d.ts +16 -0
  132. package/dist/lib/web-url.js +25 -0
  133. package/dist/node_modules/@skrr-ai/data-provider/index.js +4075 -3905
  134. package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
  135. package/oclif.manifest.json +12364 -10488
  136. package/package.json +4 -1
@@ -41,6 +41,8 @@ export default class CommitmentsCreate extends BaseCommand {
41
41
  source: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
42
42
  watch: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
43
43
  'metric-key': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
44
+ 'watch-space': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
45
+ 'watch-monitor': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
44
46
  cadence: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
45
47
  'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
46
48
  timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -85,7 +85,7 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
85
85
  description: 'Watched source the criterion reads (implies --evaluator source_state), e.g. github',
86
86
  }),
87
87
  watch: core_1.Flags.string({
88
- description: `Watched source (repeatable). One of: ${commitments_1.COMMITMENT_WATCHED_SOURCES.join(', ')}`,
88
+ description: `Watched source (repeatable). One of: ${commitments_1.COMMITMENT_WATCHED_SOURCES.join(', ')}. Some sources need companion flags: --watch-space, --watch-monitor, --metric-key.`,
89
89
  multiple: true,
90
90
  options: [...commitments_1.COMMITMENT_WATCHED_SOURCES],
91
91
  }),
@@ -93,6 +93,20 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
93
93
  description: 'Metric key to read when --watch metrics is used (repeatable)',
94
94
  multiple: true,
95
95
  }),
96
+ // `space` and `monitor` sources REQUIRE a scope id in `config`, and the
97
+ // watched-source enum on its own cannot express it (the API rejects the
98
+ // create with `Space watched source requires config.spaceId` / `Monitor
99
+ // watchedSources require a bounded config.monitorId`). Providing the
100
+ // companion flag implicitly opts the source in — mirroring how
101
+ // `--metric-key` works — so the enum and its config never disagree.
102
+ 'watch-space': core_1.Flags.string({
103
+ description: 'Space to watch (repeatable). Accepts a space id, ref, or unique title. Implies --watch space.',
104
+ multiple: true,
105
+ }),
106
+ 'watch-monitor': core_1.Flags.string({
107
+ description: 'Signal Monitor id to watch (repeatable). Implies --watch monitor.',
108
+ multiple: true,
109
+ }),
96
110
  cadence: core_1.Flags.string({
97
111
  description: 'Check interval, e.g. "15m", "6h", "1d" (1m..30d). Implies --cadence-mode interval.',
98
112
  }),
@@ -153,18 +167,21 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
153
167
  else if (flags.deadline || criteria.length) {
154
168
  throw new Error('--outcome is required when passing --deadline or --criterion.');
155
169
  }
156
- const watched = (0, triggers_1.splitRepeated)(flags.watch);
157
- if (watched && watched.length) {
158
- const metricKeys = (0, triggers_1.splitRepeated)(flags['metric-key']);
159
- if (metricKeys?.length && !watched.includes('metrics')) {
160
- throw new Error('--metric-key requires --watch metrics.');
161
- }
162
- payload.watchedSources = watched.map((source) => ({
163
- source,
164
- enabled: true,
165
- ...(source === 'metrics' && metricKeys?.length ? { config: { metricKeys } } : {}),
166
- }));
167
- }
170
+ // Resolve space references up front (ref/title → uuid), so a name in
171
+ // `--watch-space` is treated the same way it is everywhere else that
172
+ // takes a space.
173
+ const watchSpaces = (0, triggers_1.splitRepeated)(flags['watch-space']);
174
+ const resolvedSpaceIds = watchSpaces
175
+ ? await Promise.all(watchSpaces.map((ref) => this.resolveSpaceReference(ref)))
176
+ : [];
177
+ const built = (0, commitments_1.buildWatchedSources)({
178
+ watch: (0, triggers_1.splitRepeated)(flags.watch),
179
+ metricKey: (0, triggers_1.splitRepeated)(flags['metric-key']),
180
+ spaceIds: resolvedSpaceIds,
181
+ monitorIds: (0, triggers_1.splitRepeated)(flags['watch-monitor']),
182
+ });
183
+ if (built)
184
+ payload.watchedSources = built;
168
185
  const cadence = {};
169
186
  if (flags.cadence) {
170
187
  cadence.intervalMs = (0, commitments_1.parseIntervalToMs)(flags.cadence);
@@ -35,6 +35,8 @@ export default class CommitmentsUpdate extends BaseCommand {
35
35
  measure: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
36
36
  source: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
37
37
  watch: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
38
+ 'watch-space': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
39
+ 'watch-monitor': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
38
40
  cadence: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
39
41
  'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
40
42
  timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -64,10 +64,18 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
64
64
  description: 'Watched source the criterion reads (implies --evaluator source_state), e.g. github',
65
65
  }),
66
66
  watch: core_1.Flags.string({
67
- description: 'Watched source (repeatable). Replaces the existing set.',
67
+ description: 'Watched source (repeatable). Replaces the existing set. Some sources need companion flags: --watch-space, --watch-monitor.',
68
68
  multiple: true,
69
69
  options: [...commitments_1.COMMITMENT_WATCHED_SOURCES],
70
70
  }),
71
+ 'watch-space': core_1.Flags.string({
72
+ description: 'Space to watch (repeatable). Accepts a space id, ref, or unique title. Implies --watch space.',
73
+ multiple: true,
74
+ }),
75
+ 'watch-monitor': core_1.Flags.string({
76
+ description: 'Signal Monitor id to watch (repeatable). Implies --watch monitor.',
77
+ multiple: true,
78
+ }),
71
79
  cadence: core_1.Flags.string({ description: 'New check interval, e.g. "15m", "6h", "1d" (1m..30d)' }),
72
80
  'cadence-mode': core_1.Flags.string({
73
81
  description: 'Cadence mode',
@@ -143,9 +151,21 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
143
151
  : {}),
144
152
  };
145
153
  }
146
- if (watched && watched.length) {
147
- payload.watchedSources = watched.map((source) => ({ source, enabled: true }));
148
- }
154
+ // Companion flags carry the config required by `space` / `monitor`, and
155
+ // implicitly opt each source in same shape as `create`. The API
156
+ // replaces watchedSources WHOLESALE, so passing `--watch-space` alone
157
+ // still names the FULL new set (`space`) rather than adding to it.
158
+ const watchSpaces = (0, triggers_1.splitRepeated)(flags['watch-space']);
159
+ const resolvedSpaceIds = watchSpaces
160
+ ? await Promise.all(watchSpaces.map((ref) => this.resolveSpaceReference(ref)))
161
+ : [];
162
+ const built = (0, commitments_1.buildWatchedSources)({
163
+ watch: watched,
164
+ spaceIds: resolvedSpaceIds,
165
+ monitorIds: (0, triggers_1.splitRepeated)(flags['watch-monitor']),
166
+ });
167
+ if (built)
168
+ payload.watchedSources = built;
149
169
  if (wantsCadence) {
150
170
  const existing = current?.cadence ?? {};
151
171
  const cadence = {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  /**
6
6
  * `skrr daemon byok ...` forwards the Keychain operation to the daemon. The
7
7
  * daemon owns profile selection and secret custody; this CLI never receives a
@@ -13,7 +13,7 @@ class DaemonByok extends core_1.Command {
13
13
  // resolved: every subcommand under it failed.
14
14
  static aliases = ['daemons:byok'];
15
15
  static summary = 'Manage local BYOK provider credentials in the daemon profile Keychain';
16
- static description = (0, exec_oversky_1.forwardedFlagsNote)('byok');
16
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('byok');
17
17
  static strict = false;
18
18
  static examples = [
19
19
  '<%= config.bin %> daemon byok status',
@@ -33,11 +33,11 @@ class DaemonByok extends core_1.Command {
33
33
  // mistake, one directory over.
34
34
  const argv = this.argv;
35
35
  try {
36
- this.exit(await (0, exec_oversky_1.execOversky)(['byok', ...argv]));
36
+ this.exit(await (0, exec_runtime_binary_1.execRuntimeBinary)(['byok', ...argv]));
37
37
  }
38
38
  catch (error) {
39
- if (error.message === 'oversky-not-installed') {
40
- this.log((0, exec_oversky_1.notInstalledMessage)());
39
+ if (error.message === 'runtime-binary-not-installed') {
40
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
41
41
  this.exit(127);
42
42
  }
43
43
  throw error;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  /**
6
6
  * `skrr daemon` — top-level help for the daemon subcommands.
7
7
  *
@@ -20,13 +20,14 @@ class Daemon extends core_1.Command {
20
20
  '<%= config.bin %> daemon start',
21
21
  '<%= config.bin %> daemon stop',
22
22
  '<%= config.bin %> daemon logs',
23
+ '<%= config.bin %> daemon recover-offline-queue --apply',
23
24
  '<%= config.bin %> daemon usage --refresh',
24
25
  '<%= config.bin %> daemon byok status',
25
26
  ];
26
27
  async run() {
27
- const bin = (0, exec_oversky_1.findOverskyBinary)();
28
+ const bin = (0, exec_runtime_binary_1.findRuntimeBinary)();
28
29
  if (!bin) {
29
- this.log((0, exec_oversky_1.notInstalledMessage)());
30
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
30
31
  this.exit(127);
31
32
  }
32
33
  this.log(`runtime binary: ${bin}`);
@@ -38,6 +39,7 @@ class Daemon extends core_1.Command {
38
39
  this.log(' skrr daemon stop — stop the daemon');
39
40
  this.log(' skrr daemon status — show running state and config');
40
41
  this.log(' skrr daemon logs — tail recent daemon logs');
42
+ this.log(' skrr daemon recover-offline-queue — restore recoverable offline WALs');
41
43
  this.log(' skrr daemon usage — show local Claude Code and Codex usage limits');
42
44
  this.log(' skrr daemon byok — manage local BYOK Keychain credentials');
43
45
  this.log('');
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  const daemon_binding_1 = require("../../lib/daemon-binding");
6
6
  const daemon_installer_1 = require("../../lib/daemon-installer");
7
7
  /**
@@ -36,7 +36,10 @@ class DaemonInstall extends core_1.Command {
36
36
  // resolved: every subcommand under it failed.
37
37
  static aliases = ['daemons:install'];
38
38
  static summary = 'Install the local skrr runtime as a background service';
39
- static description = (0, exec_oversky_1.forwardedFlagsNote)('install', { binds: true });
39
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('install', {
40
+ binds: true,
41
+ bootstrapsRuntime: true,
42
+ });
40
43
  static strict = false; // forward all args verbatim — see run()
41
44
  async run() {
42
45
  // `this.argv`, NOT `this.parse()`. `strict = false` relaxes POSITIONAL
@@ -53,7 +56,7 @@ class DaemonInstall extends core_1.Command {
53
56
  // brew, the script installer, a dev checkout — is left exactly alone; this
54
57
  // is a floor under the missing case, not a second update channel competing
55
58
  // with the daemon's own.
56
- if (!(0, exec_oversky_1.findOverskyBinary)()) {
59
+ if (!(0, exec_runtime_binary_1.isCurrentRuntimeBinary)((0, exec_runtime_binary_1.findRuntimeBinary)())) {
57
60
  this.log('No local skrr runtime found. Fetching the signed release...');
58
61
  const outcome = await (0, daemon_installer_1.installDaemon)();
59
62
  if (!outcome.ok) {
@@ -73,11 +76,11 @@ class DaemonInstall extends core_1.Command {
73
76
  // moment the binding is chosen, and leaving it to a separate command
74
77
  // is how a CLI and its daemon end up on different deployments
75
78
  // (OSK-279) without anyone doing anything wrong.
76
- const code = await (0, exec_oversky_1.execOversky)(['install', ...(0, daemon_binding_1.bindToCliSession)(argv)]);
79
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['install', ...(0, daemon_binding_1.bindToCliSession)(argv)]);
77
80
  this.exit(code);
78
81
  }
79
82
  catch (err) {
80
- if (err.message === 'oversky-not-installed') {
83
+ if (err.message === 'runtime-binary-not-installed') {
81
84
  // Reachable only if the runtime vanished between the bootstrap above
82
85
  // and this line. Saying so beats repeating install instructions for
83
86
  // something that was just installed.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const daemon_binding_1 = require("../../lib/daemon-binding");
5
- const exec_oversky_1 = require("../../lib/exec-oversky");
5
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
6
6
  /**
7
7
  * `skrr daemon login` — authenticate the local runtime.
8
8
  *
@@ -29,7 +29,7 @@ const exec_oversky_1 = require("../../lib/exec-oversky");
29
29
  class DaemonLogin extends core_1.Command {
30
30
  static aliases = ['daemons:login'];
31
31
  static summary = 'Authenticate the local skrr runtime (separate from `skrr login`)';
32
- static description = (0, exec_oversky_1.forwardedFlagsNote)('login', { binds: true });
32
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('login', { binds: true });
33
33
  static strict = false; // forward all args verbatim — see run()
34
34
  async run() {
35
35
  // `this.argv`, NOT `this.parse()` — `strict = false` relaxes POSITIONAL
@@ -41,12 +41,12 @@ class DaemonLogin extends core_1.Command {
41
41
  // from the installed service definition, which is the only authoritative
42
42
  // answer; guessing it from the CLI's cwd is exactly the mistake that made
43
43
  // the old default wrong.
44
- const code = await (0, exec_oversky_1.execOversky)(['login', ...(0, daemon_binding_1.bindToCliSession)(argv)]);
44
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['login', ...(0, daemon_binding_1.bindToCliSession)(argv)]);
45
45
  this.exit(code);
46
46
  }
47
47
  catch (err) {
48
- if (err.message === 'oversky-not-installed') {
49
- this.log((0, exec_oversky_1.notInstalledMessage)());
48
+ if (err.message === 'runtime-binary-not-installed') {
49
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
50
50
  this.exit(127);
51
51
  }
52
52
  throw err;
@@ -10,7 +10,7 @@ const core_1 = require("@oclif/core");
10
10
  const node_fs_1 = require("node:fs");
11
11
  const node_os_1 = require("node:os");
12
12
  const node_path_1 = __importDefault(require("node:path"));
13
- const exec_oversky_1 = require("../../lib/exec-oversky");
13
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
14
14
  const MAX_FALLBACK_LOG_BYTES = 1024 * 1024;
15
15
  const PROFILE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
16
16
  /**
@@ -122,7 +122,7 @@ class DaemonLogs extends core_1.Command {
122
122
  // `oversky 0.2.x` has profiles and writes the same files, but has no
123
123
  // `logs` subcommand. Probe top-level help first so forwarding does not
124
124
  // print an unrelated "unknown option" error before the useful output.
125
- if ((await (0, exec_oversky_1.overskySupportsSubcommand)('logs')) === false) {
125
+ if ((await (0, exec_runtime_binary_1.runtimeBinarySupportsSubcommand)('logs')) === false) {
126
126
  const logPath = resolveLegacyDaemonLogPath(flags);
127
127
  if (flags.path) {
128
128
  this.log(logPath);
@@ -163,12 +163,12 @@ class DaemonLogs extends core_1.Command {
163
163
  }
164
164
  return;
165
165
  }
166
- const code = await (0, exec_oversky_1.execOversky)(args);
166
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(args);
167
167
  this.exit(code);
168
168
  }
169
169
  catch (err) {
170
- if (err.message === 'oversky-not-installed') {
171
- this.log((0, exec_oversky_1.notInstalledMessage)());
170
+ if (err.message === 'runtime-binary-not-installed') {
171
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
172
172
  this.log('');
173
173
  this.log('Daemon logs live under the per-profile config dir, e.g.:');
174
174
  this.log(` ${node_path_1.default.join((0, node_os_1.homedir)(), '.skrr', 'profiles', '<profile>', 'logs', 'daemon.log')}`);
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ /** Restore explicitly selected offline-queue forensic WALs through the runtime. */
3
+ export default class DaemonRecoverOfflineQueue extends Command {
4
+ static aliases: string[];
5
+ static summary: string;
6
+ static description: string;
7
+ static strict: boolean;
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,24 @@
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
+ /** Restore explicitly selected offline-queue forensic WALs through the runtime. */
6
+ class DaemonRecoverOfflineQueue extends core_1.Command {
7
+ static aliases = ['daemons:recover-offline-queue'];
8
+ static summary = 'Restore recoverable offline-queue dead letters after a replay fix';
9
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('recover-offline-queue');
10
+ static strict = false;
11
+ async run() {
12
+ try {
13
+ this.exit(await (0, exec_runtime_binary_1.execRuntimeBinary)(['recover-offline-queue', ...this.argv]));
14
+ }
15
+ catch (err) {
16
+ if (err.message === 'runtime-binary-not-installed') {
17
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
18
+ this.exit(127);
19
+ }
20
+ throw err;
21
+ }
22
+ }
23
+ }
24
+ exports.default = DaemonRecoverOfflineQueue;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  class DaemonRestart extends core_1.Command {
6
6
  // `skrr daemons <sub>` — the plural is advertised as an alias for the
7
7
  // whole topic, and without a per-command alias only the bare topic
8
8
  // resolved: every subcommand under it failed.
9
9
  static aliases = ['daemons:restart'];
10
10
  static summary = 'Restart the local skrr daemon, preserving its current supervision mode';
11
- static description = (0, exec_oversky_1.forwardedFlagsNote)('restart');
11
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('restart');
12
12
  static strict = false; // forward all args verbatim — see run()
13
13
  static examples = [
14
14
  '<%= config.bin %> daemon restart',
@@ -21,12 +21,12 @@ class DaemonRestart extends core_1.Command {
21
21
  // exists to reach it (OSK-296).
22
22
  const argv = this.argv;
23
23
  try {
24
- const code = await (0, exec_oversky_1.execOversky)(['restart', ...argv]);
24
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['restart', ...argv]);
25
25
  this.exit(code);
26
26
  }
27
27
  catch (err) {
28
- if (err.message === 'oversky-not-installed') {
29
- this.log((0, exec_oversky_1.notInstalledMessage)());
28
+ if (err.message === 'runtime-binary-not-installed') {
29
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
30
30
  this.exit(127);
31
31
  }
32
32
  throw err;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
+ const runtime_start_verification_1 = require("../../lib/runtime-start-verification");
5
6
  class DaemonStart extends core_1.Command {
6
7
  // `skrr daemons <sub>` — the plural is advertised as an alias for the
7
8
  // whole topic, and without a per-command alias only the bare topic
8
9
  // resolved: every subcommand under it failed.
9
10
  static aliases = ['daemons:start'];
10
11
  static summary = 'Start the local skrr daemon';
11
- static description = (0, exec_oversky_1.forwardedFlagsNote)('start');
12
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('start');
12
13
  static strict = false; // forward all args verbatim — see run()
13
14
  async run() {
14
15
  // `this.argv`, NOT `this.parse()`. `strict = false` relaxes POSITIONAL
@@ -22,12 +23,39 @@ class DaemonStart extends core_1.Command {
22
23
  // mistake, one directory over.
23
24
  const argv = this.argv;
24
25
  try {
25
- const code = await (0, exec_oversky_1.execOversky)(['start', ...argv]);
26
- this.exit(code);
26
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['start', ...argv]);
27
+ if (code !== 0)
28
+ this.exit(code);
29
+ // A supervisor's successful `kickstart` means only that it accepted the
30
+ // request. Older installed skrrd builds then write TOKEN_MISSING and exit
31
+ // cleanly, leaving the CLI that invoked them to report success. Query the
32
+ // same profile after every zero exit so the public command never claims a
33
+ // stopped service is running while users move through a staggered release.
34
+ const status = await (0, exec_runtime_binary_1.execRuntimeBinaryCapture)((0, runtime_start_verification_1.statusArgsForStart)(argv));
35
+ const verification = (0, runtime_start_verification_1.verifyRuntimeStart)(status.stdout, status.code, argv);
36
+ if (verification.status === 'reauth_required') {
37
+ this.logToStderr(`Local runtime did not start: profile '${verification.profile}' requires ` +
38
+ `re-authentication (reason: ${verification.reason ?? 'UNKNOWN'}). Run ` +
39
+ `\`${verification.recoveryCommand}\`, then retry \`skrr daemon start\`.`);
40
+ this.exit(runtime_start_verification_1.DAEMON_START_REAUTH_EXIT);
41
+ }
42
+ if (verification.status === 'not_running') {
43
+ this.logToStderr(`Local runtime did not remain running after skrrd exited successfully ` +
44
+ `(profile '${verification.profile}', service status: ` +
45
+ `${verification.runtimeStatus ?? 'unknown'}). Run \`skrr daemon logs\` for the reason.`);
46
+ this.exit(runtime_start_verification_1.DAEMON_START_UNVERIFIED_EXIT);
47
+ }
48
+ if (verification.status === 'unreadable_status') {
49
+ this.logToStderr(`skrrd start exited successfully, but skrr could not verify a running local runtime ` +
50
+ `for profile '${verification.profile}'; refusing to report success. ` +
51
+ 'Run `skrr daemon status` and `skrr daemon logs` for the reason.');
52
+ this.exit(runtime_start_verification_1.DAEMON_START_UNVERIFIED_EXIT);
53
+ }
54
+ this.exit(0);
27
55
  }
28
56
  catch (err) {
29
- if (err.message === 'oversky-not-installed') {
30
- this.log((0, exec_oversky_1.notInstalledMessage)());
57
+ if (err.message === 'runtime-binary-not-installed') {
58
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
31
59
  this.exit(127);
32
60
  }
33
61
  throw err;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  class DaemonStatus extends core_1.Command {
6
6
  // `skrr daemons <sub>` — the plural is advertised as an alias for the
7
7
  // whole topic, and without a per-command alias only the bare topic
8
8
  // resolved: every subcommand under it failed.
9
9
  static aliases = ['daemons:status'];
10
10
  static summary = 'Show skrr daemon status (config, connection, services)';
11
- static description = (0, exec_oversky_1.forwardedFlagsNote)('status');
11
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('status');
12
12
  static strict = false;
13
13
  async run() {
14
14
  // `this.argv`, NOT `this.parse()`. `strict = false` relaxes POSITIONAL
@@ -22,12 +22,12 @@ class DaemonStatus extends core_1.Command {
22
22
  // mistake, one directory over.
23
23
  const argv = this.argv;
24
24
  try {
25
- const code = await (0, exec_oversky_1.execOversky)(['status', ...argv]);
25
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['status', ...argv]);
26
26
  this.exit(code);
27
27
  }
28
28
  catch (err) {
29
- if (err.message === 'oversky-not-installed') {
30
- this.log((0, exec_oversky_1.notInstalledMessage)());
29
+ if (err.message === 'runtime-binary-not-installed') {
30
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
31
31
  this.exit(127);
32
32
  }
33
33
  throw err;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  class DaemonStop extends core_1.Command {
6
6
  // `skrr daemons <sub>` — the plural is advertised as an alias for the
7
7
  // whole topic, and without a per-command alias only the bare topic
8
8
  // resolved: every subcommand under it failed.
9
9
  static aliases = ['daemons:stop'];
10
10
  static summary = 'Stop the local skrr daemon';
11
- static description = (0, exec_oversky_1.forwardedFlagsNote)('stop');
11
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('stop');
12
12
  static strict = false;
13
13
  async run() {
14
14
  // `this.argv`, NOT `this.parse()`. `strict = false` relaxes POSITIONAL
@@ -22,12 +22,12 @@ class DaemonStop extends core_1.Command {
22
22
  // mistake, one directory over.
23
23
  const argv = this.argv;
24
24
  try {
25
- const code = await (0, exec_oversky_1.execOversky)(['stop', ...argv]);
25
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['stop', ...argv]);
26
26
  this.exit(code);
27
27
  }
28
28
  catch (err) {
29
- if (err.message === 'oversky-not-installed') {
30
- this.log((0, exec_oversky_1.notInstalledMessage)());
29
+ if (err.message === 'runtime-binary-not-installed') {
30
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
31
31
  this.exit(127);
32
32
  }
33
33
  throw err;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  /**
6
6
  * `skrr daemon uninstall` — uninstall the local runtime's OS service.
7
7
  *
@@ -20,7 +20,7 @@ class DaemonUninstall extends core_1.Command {
20
20
  // resolved: every subcommand under it failed.
21
21
  static aliases = ['daemons:uninstall'];
22
22
  static summary = "Remove the local skrr runtime's background service (local state is left alone)";
23
- static description = (0, exec_oversky_1.forwardedFlagsNote)('uninstall');
23
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('uninstall');
24
24
  static strict = false; // forward all args verbatim — see run()
25
25
  async run() {
26
26
  // `this.argv`, NOT `this.parse()`. `strict = false` relaxes POSITIONAL
@@ -34,12 +34,12 @@ class DaemonUninstall extends core_1.Command {
34
34
  // mistake, one directory over.
35
35
  const argv = this.argv;
36
36
  try {
37
- const code = await (0, exec_oversky_1.execOversky)(['uninstall', ...argv]);
37
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['uninstall', ...argv]);
38
38
  this.exit(code);
39
39
  }
40
40
  catch (err) {
41
- if (err.message === 'oversky-not-installed') {
42
- this.log((0, exec_oversky_1.notInstalledMessage)());
41
+ if (err.message === 'runtime-binary-not-installed') {
42
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
43
43
  this.exit(127);
44
44
  }
45
45
  throw err;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
- const exec_oversky_1 = require("../../lib/exec-oversky");
4
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
5
5
  class DaemonUnlock extends core_1.Command {
6
6
  // `skrr daemons <sub>` — the plural is advertised as an alias for the
7
7
  // whole topic, and without a per-command alias only the bare topic
8
8
  // resolved: every subcommand under it failed.
9
9
  static aliases = ['daemons:unlock'];
10
10
  static summary = 'Clear a stranded singleton lock (daemon.lock) left by a crashed skrr daemon';
11
- static description = (0, exec_oversky_1.forwardedFlagsNote)('unlock');
11
+ static description = (0, exec_runtime_binary_1.forwardedFlagsNote)('unlock');
12
12
  static strict = false; // forward all args verbatim — see run()
13
13
  static examples = ['<%= config.bin %> daemon unlock'];
14
14
  async run() {
@@ -18,12 +18,12 @@ class DaemonUnlock extends core_1.Command {
18
18
  // the verb lives on a second binary you have to learn about first.
19
19
  const argv = this.argv;
20
20
  try {
21
- const code = await (0, exec_oversky_1.execOversky)(['unlock', ...argv]);
21
+ const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['unlock', ...argv]);
22
22
  this.exit(code);
23
23
  }
24
24
  catch (err) {
25
- if (err.message === 'oversky-not-installed') {
26
- this.log((0, exec_oversky_1.notInstalledMessage)());
25
+ if (err.message === 'runtime-binary-not-installed') {
26
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
27
27
  this.exit(127);
28
28
  }
29
29
  throw err;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.supportsDaemonUsage = supportsDaemonUsage;
7
7
  const core_1 = require("@oclif/core");
8
8
  const node_child_process_1 = require("node:child_process");
9
- const exec_oversky_1 = require("../../lib/exec-oversky");
9
+ const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
10
10
  const index_1 = __importDefault(require("./index"));
11
11
  /** Whether an `oversky --help` surface actually supports the usage command. */
12
12
  function supportsDaemonUsage(helpText) {
@@ -29,9 +29,9 @@ class DaemonUsage extends index_1.default {
29
29
  };
30
30
  async run() {
31
31
  const { flags } = await this.parse(DaemonUsage);
32
- const binary = (0, exec_oversky_1.findOverskyBinary)();
32
+ const binary = (0, exec_runtime_binary_1.findRuntimeBinary)();
33
33
  if (!binary) {
34
- this.log((0, exec_oversky_1.notInstalledMessage)());
34
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
35
35
  this.exit(127);
36
36
  }
37
37
  // A stale PATH-first `oversky` (0.2.x is common on Homebrew installs) does
@@ -58,11 +58,11 @@ class DaemonUsage extends index_1.default {
58
58
  if (flags.json)
59
59
  args.push('--json');
60
60
  try {
61
- this.exit(await (0, exec_oversky_1.execOversky)(args));
61
+ this.exit(await (0, exec_runtime_binary_1.execRuntimeBinary)(args));
62
62
  }
63
63
  catch (error) {
64
- if (error.message === 'oversky-not-installed') {
65
- this.log((0, exec_oversky_1.notInstalledMessage)());
64
+ if (error.message === 'runtime-binary-not-installed') {
65
+ this.log((0, exec_runtime_binary_1.notInstalledMessage)());
66
66
  this.exit(127);
67
67
  }
68
68
  throw error;