@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
@@ -0,0 +1,19 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class InstructionBlocksCreate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ summary: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ body: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ category: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ tag: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ visibility: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'parameter-schema': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ requirements: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ changelog: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ const instruction_blocks_1 = require("../../lib/instruction-blocks");
7
+ const instruction_input_1 = require("../../lib/instruction-input");
8
+ const CATEGORIES = [
9
+ 'github',
10
+ 'communication',
11
+ 'research',
12
+ 'output',
13
+ 'planning',
14
+ 'other',
15
+ ];
16
+ class InstructionBlocksCreate extends base_command_1.BaseCommand {
17
+ static description = 'Create a reusable, version-pinned Agent instruction block';
18
+ static examples = [
19
+ '<%= config.bin %> instruction-blocks create --name "Evidence first" --body "State evidence before conclusions."',
20
+ '<%= config.bin %> instruction-blocks create --name "PR review" --file ./review.md --category github --tag github --tag review',
21
+ '<%= config.bin %> instruction-blocks create --name "Team research" --file ./research.md --visibility workspace',
22
+ ];
23
+ static flags = {
24
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
25
+ name: core_1.Flags.string({ description: 'Short, reusable block name', required: true }),
26
+ summary: core_1.Flags.string({ description: 'One-line description for library pickers' }),
27
+ body: core_1.Flags.string({ description: 'Instruction template text' }),
28
+ file: core_1.Flags.string({ description: 'Read template text from a file, or - for stdin' }),
29
+ category: core_1.Flags.string({ description: 'Library category', options: CATEGORIES }),
30
+ tag: core_1.Flags.string({ description: 'Library tag (repeatable)', multiple: true }),
31
+ visibility: core_1.Flags.string({
32
+ description: 'private (default), workspace, or public',
33
+ options: ['private', 'workspace', 'public'],
34
+ }),
35
+ 'parameter-schema': core_1.Flags.string({
36
+ description: 'JSON array of typed parameter definitions (never secrets)',
37
+ }),
38
+ requirements: core_1.Flags.string({
39
+ description: 'JSON array of declarative capability/integration requirements; never grants access',
40
+ }),
41
+ changelog: core_1.Flags.string({ description: 'Why this initial version exists' }),
42
+ };
43
+ async run() {
44
+ this.requireAuth();
45
+ const { flags } = await this.parse(InstructionBlocksCreate);
46
+ let bodyTemplate;
47
+ let parameterSchema;
48
+ let requirements;
49
+ try {
50
+ bodyTemplate = (await (0, instruction_input_1.readInstructionBody)({
51
+ body: flags.body,
52
+ file: flags.file,
53
+ required: true,
54
+ }));
55
+ parameterSchema = (0, instruction_blocks_1.parseJsonFlag)(flags['parameter-schema'], '--parameter-schema');
56
+ requirements = (0, instruction_blocks_1.parseJsonFlag)(flags.requirements, '--requirements');
57
+ if (parameterSchema && !Array.isArray(parameterSchema)) {
58
+ throw new Error('--parameter-schema must be a JSON array');
59
+ }
60
+ if (requirements && !Array.isArray(requirements)) {
61
+ throw new Error('--requirements must be a JSON array');
62
+ }
63
+ }
64
+ catch (error) {
65
+ this.error(error.message, { exit: 2 });
66
+ }
67
+ let block;
68
+ try {
69
+ block = await data_provider_1.dataService.createInstructionBlock({
70
+ name: flags.name,
71
+ ...(flags.summary !== undefined ? { summary: flags.summary } : {}),
72
+ ...(flags.category !== undefined
73
+ ? { category: flags.category }
74
+ : {}),
75
+ ...(flags.tag?.length ? { tags: flags.tag } : {}),
76
+ ...(flags.visibility !== undefined
77
+ ? { visibility: flags.visibility }
78
+ : {}),
79
+ bodyTemplate,
80
+ ...(parameterSchema !== undefined ? { parameterSchema } : {}),
81
+ ...(requirements !== undefined ? { requirements } : {}),
82
+ ...(flags.changelog !== undefined ? { changelog: flags.changelog } : {}),
83
+ });
84
+ }
85
+ catch (error) {
86
+ this.handleApiError(error);
87
+ }
88
+ if (flags.json)
89
+ return this.log(JSON.stringify(block, null, 2));
90
+ this.log(`Created ${block.name} (${block.id}) at v${block.currentVersion}.`);
91
+ this.log(`Attach it: skrr agents instructions add --agent <agent-id> --block ${block.id}`);
92
+ }
93
+ }
94
+ exports.default = InstructionBlocksCreate;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class InstructionBlocksDelete extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ const prompt_1 = require("../../lib/prompt");
7
+ class InstructionBlocksDelete extends base_command_1.BaseCommand {
8
+ static description = 'Archive a block you authored (existing Agent compositions keep their pinned snapshot)';
9
+ static examples = ['<%= config.bin %> instruction-blocks delete block_… --yes'];
10
+ static args = {
11
+ id: core_1.Args.string({ description: 'Instruction block ID', required: true, ignoreStdin: true }),
12
+ };
13
+ static flags = {
14
+ yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation' }),
15
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
16
+ };
17
+ async run() {
18
+ this.requireAuth();
19
+ const { args, flags } = await this.parse(InstructionBlocksDelete);
20
+ const confirmed = await (0, prompt_1.confirmDestructive)(`Archive ${args.id}? Existing Agents keep their version-pinned snapshot, but it can no longer be newly attached.`, flags.yes);
21
+ if (!confirmed)
22
+ return this.log('Aborted.');
23
+ let result;
24
+ try {
25
+ result = await data_provider_1.dataService.archiveInstructionBlock(args.id);
26
+ }
27
+ catch (error) {
28
+ this.handleApiError(error);
29
+ }
30
+ if (flags.json)
31
+ return this.log(JSON.stringify(result, null, 2));
32
+ this.log(`Archived ${result.id}. Existing Agents retain their pinned snapshots.`);
33
+ }
34
+ }
35
+ exports.default = InstructionBlocksDelete;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** List the picker catalog in a form an Agent can act on without a browser. */
3
+ export default class InstructionBlocksList extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ official: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ library: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ category: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ const format_1 = require("../../lib/format");
7
+ const CATEGORIES = [
8
+ 'github',
9
+ 'communication',
10
+ 'research',
11
+ 'output',
12
+ 'planning',
13
+ 'other',
14
+ ];
15
+ /** List the picker catalog in a form an Agent can act on without a browser. */
16
+ class InstructionBlocksList extends base_command_1.BaseCommand {
17
+ static description = 'List reusable Agent instruction blocks (official blocks and your visible library)';
18
+ static examples = [
19
+ '<%= config.bin %> instruction-blocks list',
20
+ '<%= config.bin %> instruction-blocks list --library',
21
+ '<%= config.bin %> instruction-blocks list --category github --json',
22
+ ];
23
+ static flags = {
24
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
25
+ official: core_1.Flags.boolean({ description: 'Only code-owned official blocks' }),
26
+ library: core_1.Flags.boolean({ description: 'Only blocks visible from your library' }),
27
+ category: core_1.Flags.string({ description: 'Only blocks in this category', options: CATEGORIES }),
28
+ };
29
+ async run() {
30
+ this.requireAuth();
31
+ const { flags } = await this.parse(InstructionBlocksList);
32
+ if (flags.official && flags.library) {
33
+ this.error('Use either --official or --library, not both.', { exit: 2 });
34
+ }
35
+ let catalog;
36
+ try {
37
+ catalog = await data_provider_1.dataService.listInstructionBlocks();
38
+ }
39
+ catch (error) {
40
+ this.handleApiError(error);
41
+ }
42
+ const all = [
43
+ ...(flags.library ? [] : catalog.official),
44
+ ...(flags.official ? [] : catalog.library),
45
+ ].filter((block) => !flags.category || block.category === flags.category);
46
+ if (flags.json) {
47
+ this.log(JSON.stringify({ blocks: all }, null, 2));
48
+ return;
49
+ }
50
+ if (!all.length) {
51
+ this.log('No instruction blocks match. Create one with `skrr instruction-blocks create`.');
52
+ return;
53
+ }
54
+ (0, format_1.renderTable)(all.map((block) => ({
55
+ id: block.id,
56
+ name: block.name,
57
+ source: block.source,
58
+ version: `v${block.currentVersion}`,
59
+ category: block.category,
60
+ summary: block.summary,
61
+ })), [
62
+ { key: 'id', header: 'ID', verbatim: true },
63
+ { key: 'name', header: 'NAME', maxWidth: 30 },
64
+ { key: 'source', header: 'SOURCE' },
65
+ { key: 'version', header: 'VERSION' },
66
+ { key: 'category', header: 'CATEGORY' },
67
+ { key: 'summary', header: 'SUMMARY', maxWidth: 52 },
68
+ ], (line) => this.log(line));
69
+ }
70
+ }
71
+ exports.default = InstructionBlocksList;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class InstructionBlocksShow extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ const instruction_blocks_1 = require("../../lib/instruction-blocks");
7
+ class InstructionBlocksShow extends base_command_1.BaseCommand {
8
+ static description = 'Show a reusable block, including its pinned source and requirements';
9
+ static examples = [
10
+ '<%= config.bin %> instruction-blocks show block_official_decision_memo',
11
+ '<%= config.bin %> instruction-blocks show block_… --json',
12
+ ];
13
+ static args = {
14
+ id: core_1.Args.string({ description: 'Instruction block ID', required: true, ignoreStdin: true }),
15
+ };
16
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
17
+ async run() {
18
+ this.requireAuth();
19
+ const { args, flags } = await this.parse(InstructionBlocksShow);
20
+ let block;
21
+ try {
22
+ block = await data_provider_1.dataService.getInstructionBlock(args.id);
23
+ }
24
+ catch (error) {
25
+ this.handleApiError(error);
26
+ }
27
+ if (flags.json) {
28
+ this.log(JSON.stringify(block, null, 2));
29
+ return;
30
+ }
31
+ for (const line of (0, instruction_blocks_1.renderInstructionBlockDetail)(block))
32
+ this.log(line);
33
+ }
34
+ }
35
+ exports.default = InstructionBlocksShow;
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** Any edit produces a new immutable source version; attached Agents stay pinned. */
3
+ export default class InstructionBlocksUpdate extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ summary: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ body: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ category: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ tag: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ visibility: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'parameter-schema': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ requirements: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ changelog: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ };
22
+ run(): Promise<void>;
23
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ const instruction_blocks_1 = require("../../lib/instruction-blocks");
7
+ const instruction_input_1 = require("../../lib/instruction-input");
8
+ const CATEGORIES = [
9
+ 'github',
10
+ 'communication',
11
+ 'research',
12
+ 'output',
13
+ 'planning',
14
+ 'other',
15
+ ];
16
+ /** Any edit produces a new immutable source version; attached Agents stay pinned. */
17
+ class InstructionBlocksUpdate extends base_command_1.BaseCommand {
18
+ static description = 'Update a block you authored (creates a new immutable version; attached Agents stay pinned)';
19
+ static examples = [
20
+ '<%= config.bin %> instruction-blocks update block_… --body "Lead with evidence." --changelog "Clarify order"',
21
+ '<%= config.bin %> instruction-blocks update block_… --file ./review.md',
22
+ '<%= config.bin %> instruction-blocks update block_… --visibility workspace',
23
+ ];
24
+ static args = {
25
+ id: core_1.Args.string({ description: 'Instruction block ID', required: true, ignoreStdin: true }),
26
+ };
27
+ static flags = {
28
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
29
+ name: core_1.Flags.string({ description: 'New block name' }),
30
+ summary: core_1.Flags.string({ description: 'New one-line description' }),
31
+ body: core_1.Flags.string({ description: 'New instruction template text' }),
32
+ file: core_1.Flags.string({ description: 'Read new template text from a file, or - for stdin' }),
33
+ category: core_1.Flags.string({ description: 'New library category', options: CATEGORIES }),
34
+ tag: core_1.Flags.string({
35
+ description: 'Replace tags with these values (repeatable)',
36
+ multiple: true,
37
+ }),
38
+ visibility: core_1.Flags.string({ options: ['private', 'workspace', 'public'] }),
39
+ 'parameter-schema': core_1.Flags.string({ description: 'Replace parameters with this JSON array' }),
40
+ requirements: core_1.Flags.string({ description: 'Replace requirements with this JSON array' }),
41
+ changelog: core_1.Flags.string({ description: 'Reason for this version' }),
42
+ };
43
+ async run() {
44
+ this.requireAuth();
45
+ const { args, flags } = await this.parse(InstructionBlocksUpdate);
46
+ let bodyTemplate;
47
+ let parameterSchema;
48
+ let requirements;
49
+ try {
50
+ bodyTemplate = await (0, instruction_input_1.readInstructionBody)({ body: flags.body, file: flags.file });
51
+ parameterSchema = (0, instruction_blocks_1.parseJsonFlag)(flags['parameter-schema'], '--parameter-schema');
52
+ requirements = (0, instruction_blocks_1.parseJsonFlag)(flags.requirements, '--requirements');
53
+ if (parameterSchema && !Array.isArray(parameterSchema)) {
54
+ throw new Error('--parameter-schema must be a JSON array');
55
+ }
56
+ if (requirements && !Array.isArray(requirements)) {
57
+ throw new Error('--requirements must be a JSON array');
58
+ }
59
+ }
60
+ catch (error) {
61
+ this.error(error.message, { exit: 2 });
62
+ }
63
+ const patch = {
64
+ ...(flags.name !== undefined ? { name: flags.name } : {}),
65
+ ...(flags.summary !== undefined ? { summary: flags.summary } : {}),
66
+ ...(bodyTemplate !== undefined ? { bodyTemplate } : {}),
67
+ ...(flags.category !== undefined
68
+ ? { category: flags.category }
69
+ : {}),
70
+ ...(flags.tag !== undefined ? { tags: flags.tag } : {}),
71
+ ...(flags.visibility !== undefined
72
+ ? { visibility: flags.visibility }
73
+ : {}),
74
+ ...(parameterSchema !== undefined ? { parameterSchema } : {}),
75
+ ...(requirements !== undefined ? { requirements } : {}),
76
+ ...(flags.changelog !== undefined ? { changelog: flags.changelog } : {}),
77
+ };
78
+ if (!Object.keys(patch).length) {
79
+ this.error('Nothing to update. Pass at least one field to change.', { exit: 2 });
80
+ }
81
+ let block;
82
+ try {
83
+ block = await data_provider_1.dataService.updateInstructionBlock(args.id, patch);
84
+ }
85
+ catch (error) {
86
+ this.handleApiError(error);
87
+ }
88
+ if (flags.json)
89
+ return this.log(JSON.stringify(block, null, 2));
90
+ this.log(`Updated ${block.name} (${block.id}) to v${block.currentVersion}.`);
91
+ this.log('Existing Agent compositions remain pinned; upgrade them explicitly when ready.');
92
+ }
93
+ }
94
+ exports.default = InstructionBlocksUpdate;
@@ -38,7 +38,10 @@ const auth_storage_1 = require("../lib/auth-storage");
38
38
  * `cliLoginWithRefreshToken` for the full rationale.
39
39
  */
40
40
  class Login extends base_command_1.BaseCommand {
41
- static description = 'Sign in to a skrr instance (PKCE localhost callback; device-code fallback)';
41
+ static description = 'Sign in to a skrr instance (PKCE localhost callback; device-code fallback). ' +
42
+ 'On an interactive first login without a local runtime, skrr offers to install it as a ' +
43
+ 'background service. Choose no, or set SKRR_SKIP_DAEMON_HANDOFF=1 before running this ' +
44
+ 'command, to skip that optional setup.';
42
45
  static examples = [
43
46
  '<%= config.bin %> login',
44
47
  '<%= config.bin %> login --env prod',
@@ -186,7 +189,9 @@ class Login extends base_command_1.BaseCommand {
186
189
  // profile, and until this login there was no session to take them from.
187
190
  // Keyed off `reason` rather than the sentence in `detail`, which is
188
191
  // written for a person and expected to be reworded.
189
- if (handoff.reason === 'no-binary' || handoff.reason === 'no-service') {
192
+ if (handoff.reason === 'no-binary' ||
193
+ handoff.reason === 'legacy-binary' ||
194
+ handoff.reason === 'no-service') {
190
195
  const setup = await (0, daemon_setup_1.offerDaemonSetup)({
191
196
  binaryPresent: handoff.reason === 'no-service',
192
197
  log: (line) => this.log(line),
@@ -1,6 +1,7 @@
1
1
  import { BaseCommand } from '../../../base-command';
2
2
  export default class SpacesAutoExecutorPreview extends BaseCommand {
3
3
  static description: string;
4
+ static examples: string[];
4
5
  static args: {
5
6
  id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
7
  };
@@ -6,21 +6,80 @@ const base_command_1 = require("../../../base-command");
6
6
  const space_output_1 = require("../../../lib/space-output");
7
7
  class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
8
8
  static description = 'Preview what a space auto-executor run would do';
9
+ static examples = [
10
+ '<%= config.bin %> spaces auto-executor preview <space-id>',
11
+ '<%= config.bin %> spaces auto-executor preview <space-id> --json',
12
+ ];
9
13
  static args = {
10
14
  id: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
11
15
  };
12
16
  static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
13
17
  async run() {
14
18
  this.requireAuth();
15
- const { args } = await this.parse(SpacesAutoExecutorPreview);
19
+ // `flags` was previously not destructured at all: --json was declared,
20
+ // ignored, and raw JSON printed unconditionally. There was no readable
21
+ // rendering of a preview anywhere in the CLI.
22
+ const { args, flags } = await this.parse(SpacesAutoExecutorPreview);
16
23
  let result;
17
24
  try {
18
- result = await data_provider_1.dataService.previewSpaceAutoExecutor(args.id);
25
+ result = (await data_provider_1.dataService.previewSpaceAutoExecutor(args.id));
19
26
  }
20
27
  catch (err) {
21
28
  this.handleApiError(err);
22
29
  }
23
- this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'execution', { result }), null, 2));
30
+ if (flags.json) {
31
+ this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, args.id, 'execution', { result }), null, 2));
32
+ return;
33
+ }
34
+ const { space, plan } = result;
35
+ if (!plan) {
36
+ this.log('No plan was returned for this space.');
37
+ return;
38
+ }
39
+ this.log(`Space: ${space.title ?? args.id}`);
40
+ this.log(`Autopilot: ${space.autoExecuteEnabled ? 'enabled' : 'disabled'}` +
41
+ (space.autoExecuteLifecycleState === 'sleeping'
42
+ ? ` (sleeping${space.autoExecuteSuspensionReason ? `: ${String(space.autoExecuteSuspensionReason).replace(/_/g, ' ')}` : ''})`
43
+ : '') +
44
+ ` · ${plan.policy.mode}`);
45
+ const { capacity } = plan;
46
+ this.log(`Running: ${(0, data_provider_1.formatRunningCapacity)(capacity.activeCount, capacity.maxActiveTasks)}` +
47
+ (capacity.maxActiveTasks === null ? ' (no concurrency cap)' : ''));
48
+ this.log(`Can start: ${(0, data_provider_1.formatLimit)(capacity.startsAvailable)} now`);
49
+ if (capacity.budget && !capacity.budget.unlimited) {
50
+ this.log(`Budget: ${capacity.budget.consumedStarts}/${capacity.budget.maxStarts} starts used this round`);
51
+ }
52
+ const { actions, summary } = plan;
53
+ this.log('');
54
+ this.log(`Board: ${summary.readyCount} ready · ${summary.unassignedCount} unassigned · ` +
55
+ `${summary.runningCount} running · ${summary.failedCount} failed · ${summary.scheduledCount} scheduled`);
56
+ section(this.log.bind(this), 'Would start now', actions.startNow, (a) => taskLine(a.task));
57
+ section(this.log.bind(this), 'Would assign', actions.assignments, (a) => `${taskLine(a.task)} → ${a.suggestedAgentName ?? a.suggestedAgentId ?? 'no eligible agent'}`);
58
+ section(this.log.bind(this), 'Would schedule later', actions.scheduleLater, (a) => `${taskLine(a.task)} @ ${a.scheduledFor}`);
59
+ section(this.log.bind(this), 'Failures to review', actions.failureReviews, (a) => taskLine(a.task));
60
+ // The single most useful diagnostic in the payload: a ready task that is
61
+ // not starting because ITS agent is saturated elsewhere, not because this
62
+ // space is full. Without it the board just looks stuck.
63
+ section(this.log.bind(this), 'Waiting on agent capacity', actions.capacityWaits, (a) => `${taskLine(a.task)} (agent ${a.agentId ?? 'unknown'} is at its cross-space cap)`);
64
+ if (plan.risks?.length) {
65
+ this.log('');
66
+ this.log('Risks:');
67
+ for (const risk of plan.risks)
68
+ this.log(` ! ${risk}`);
69
+ }
24
70
  }
25
71
  }
26
72
  exports.default = SpacesAutoExecutorPreview;
73
+ function taskLine(task) {
74
+ return `${task.identifier ? `${task.identifier} ` : ''}${task.title}`;
75
+ }
76
+ function section(log, heading, items, render, limit = 10) {
77
+ if (!items?.length)
78
+ return;
79
+ log('');
80
+ log(`${heading} (${items.length}):`);
81
+ for (const item of items.slice(0, limit))
82
+ log(` - ${render(item)}`);
83
+ if (items.length > limit)
84
+ log(` … ${items.length - limit} more (use --json for all)`);
85
+ }
@@ -9,7 +9,11 @@ export default class SpacesAutoExecutorUpdate extends BaseCommand {
9
9
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
10
  'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
11
  enabled: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ mode: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
13
  'interval-ms': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ cron: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'daily-time': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
17
  'max-starts-per-run': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
18
  'max-active-tasks': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
19
  };