@skrr-ai/cli 0.1.36 → 0.1.37

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 (152) hide show
  1. package/README.md +17 -4
  2. package/dist/commands/agents/actions/create.d.ts +5 -0
  3. package/dist/commands/agents/actions/create.js +26 -0
  4. package/dist/commands/agents/actions/update.d.ts +5 -0
  5. package/dist/commands/agents/actions/update.js +24 -0
  6. package/dist/commands/agents/api-actions/add.d.ts +41 -0
  7. package/dist/commands/agents/api-actions/add.js +202 -0
  8. package/dist/commands/agents/api-actions/index.d.ts +28 -0
  9. package/dist/commands/agents/api-actions/index.js +77 -0
  10. package/dist/commands/agents/api-actions/remove.d.ts +14 -0
  11. package/dist/commands/agents/api-actions/remove.js +36 -0
  12. package/dist/commands/agents/avatar/default/apply.d.ts +25 -0
  13. package/dist/commands/agents/avatar/default/apply.js +56 -0
  14. package/dist/commands/agents/avatar/default/index.d.ts +18 -0
  15. package/dist/commands/agents/avatar/default/index.js +44 -0
  16. package/dist/commands/agents/avatar/default/set.d.ts +23 -0
  17. package/dist/commands/agents/avatar/default/set.js +95 -0
  18. package/dist/commands/agents/avatar/library/delete.d.ts +20 -0
  19. package/dist/commands/agents/avatar/library/delete.js +47 -0
  20. package/dist/commands/agents/avatar/library/index.d.ts +16 -0
  21. package/dist/commands/agents/avatar/library/index.js +56 -0
  22. package/dist/commands/agents/avatar/presets.d.ts +19 -0
  23. package/dist/commands/agents/avatar/presets.js +56 -0
  24. package/dist/commands/agents/categories/create.d.ts +14 -0
  25. package/dist/commands/agents/categories/create.js +46 -0
  26. package/dist/commands/agents/categories/delete.d.ts +13 -0
  27. package/dist/commands/agents/categories/delete.js +33 -0
  28. package/dist/commands/agents/categories/index.d.ts +20 -0
  29. package/dist/commands/agents/categories/index.js +82 -0
  30. package/dist/commands/agents/categories/update.d.ts +22 -0
  31. package/dist/commands/agents/categories/update.js +59 -0
  32. package/dist/commands/agents/create.d.ts +10 -0
  33. package/dist/commands/agents/create.js +57 -3
  34. package/dist/commands/agents/ensure-default.d.ts +27 -0
  35. package/dist/commands/agents/ensure-default.js +65 -0
  36. package/dist/commands/agents/mute.d.ts +16 -0
  37. package/dist/commands/agents/mute.js +38 -0
  38. package/dist/commands/agents/pin.d.ts +16 -0
  39. package/dist/commands/agents/pin.js +38 -0
  40. package/dist/commands/agents/tools/auth.d.ts +19 -0
  41. package/dist/commands/agents/tools/auth.js +41 -0
  42. package/dist/commands/agents/tools/calls.d.ts +18 -0
  43. package/dist/commands/agents/tools/calls.js +54 -0
  44. package/dist/commands/agents/tools/index.d.ts +20 -0
  45. package/dist/commands/agents/tools/index.js +77 -0
  46. package/dist/commands/agents/unmute.d.ts +16 -0
  47. package/dist/commands/agents/unmute.js +38 -0
  48. package/dist/commands/agents/unpin.d.ts +16 -0
  49. package/dist/commands/agents/unpin.js +38 -0
  50. package/dist/commands/agents/update.d.ts +12 -0
  51. package/dist/commands/agents/update.js +64 -3
  52. package/dist/commands/followups/act.d.ts +22 -0
  53. package/dist/commands/followups/act.js +102 -0
  54. package/dist/commands/followups/cancel.d.ts +17 -0
  55. package/dist/commands/followups/cancel.js +40 -0
  56. package/dist/commands/followups/checkin.d.ts +27 -0
  57. package/dist/commands/followups/checkin.js +107 -0
  58. package/dist/commands/followups/list.d.ts +24 -0
  59. package/dist/commands/followups/list.js +90 -0
  60. package/dist/commands/followups/remind.d.ts +26 -0
  61. package/dist/commands/followups/remind.js +106 -0
  62. package/dist/commands/followups/reschedule.d.ts +15 -0
  63. package/dist/commands/followups/reschedule.js +48 -0
  64. package/dist/commands/followups/resolve.d.ts +23 -0
  65. package/dist/commands/followups/resolve.js +54 -0
  66. package/dist/commands/followups/show.d.ts +12 -0
  67. package/dist/commands/followups/show.js +45 -0
  68. package/dist/commands/followups/watch.d.ts +51 -0
  69. package/dist/commands/followups/watch.js +207 -0
  70. package/dist/commands/goals/labels/add.js +19 -2
  71. package/dist/commands/goals/labels/remove.js +22 -2
  72. package/dist/commands/labels/list.d.ts +24 -1
  73. package/dist/commands/labels/list.js +62 -19
  74. package/dist/commands/memory/governance/index.d.ts +21 -0
  75. package/dist/commands/memory/governance/index.js +64 -0
  76. package/dist/commands/memory/governance/set.d.ts +24 -0
  77. package/dist/commands/memory/governance/set.js +95 -0
  78. package/dist/commands/memory/provenance.d.ts +18 -0
  79. package/dist/commands/memory/provenance.js +66 -0
  80. package/dist/commands/spaces/create.d.ts +3 -0
  81. package/dist/commands/spaces/create.js +32 -2
  82. package/dist/commands/spaces/labels/add.js +19 -2
  83. package/dist/commands/spaces/labels/remove.js +22 -2
  84. package/dist/commands/spaces/show.js +2 -0
  85. package/dist/commands/spaces/update.d.ts +5 -0
  86. package/dist/commands/spaces/update.js +41 -4
  87. package/dist/commands/spaces/workflows/lifecycle-diagnostics.d.ts +11 -0
  88. package/dist/commands/spaces/workflows/lifecycle-diagnostics.js +45 -0
  89. package/dist/commands/tasks/complete.d.ts +1 -0
  90. package/dist/commands/tasks/complete.js +8 -1
  91. package/dist/commands/tasks/create.d.ts +3 -0
  92. package/dist/commands/tasks/create.js +34 -2
  93. package/dist/commands/tasks/expectations/assess.d.ts +11 -0
  94. package/dist/commands/tasks/expectations/assess.js +85 -14
  95. package/dist/commands/tasks/expectations.js +19 -2
  96. package/dist/commands/tasks/labels/attach.js +20 -3
  97. package/dist/commands/tasks/labels/detach.js +21 -3
  98. package/dist/commands/tasks/lifecycle/attach.d.ts +14 -0
  99. package/dist/commands/tasks/lifecycle/attach.js +47 -0
  100. package/dist/commands/tasks/lifecycle/definitions.d.ts +11 -0
  101. package/dist/commands/tasks/lifecycle/definitions.js +40 -0
  102. package/dist/commands/tasks/lifecycle/detach.d.ts +12 -0
  103. package/dist/commands/tasks/lifecycle/detach.js +32 -0
  104. package/dist/commands/tasks/lifecycle/history.d.ts +13 -0
  105. package/dist/commands/tasks/lifecycle/history.js +38 -0
  106. package/dist/commands/tasks/lifecycle/migrate.d.ts +12 -0
  107. package/dist/commands/tasks/lifecycle/migrate.js +29 -0
  108. package/dist/commands/tasks/lifecycle/reconcile.d.ts +11 -0
  109. package/dist/commands/tasks/lifecycle/reconcile.js +27 -0
  110. package/dist/commands/tasks/lifecycle/reopen.d.ts +13 -0
  111. package/dist/commands/tasks/lifecycle/reopen.js +34 -0
  112. package/dist/commands/tasks/lifecycle/show.d.ts +11 -0
  113. package/dist/commands/tasks/lifecycle/show.js +27 -0
  114. package/dist/commands/tasks/lifecycle/start.d.ts +12 -0
  115. package/dist/commands/tasks/lifecycle/start.js +30 -0
  116. package/dist/commands/tasks/lifecycle/transition.d.ts +15 -0
  117. package/dist/commands/tasks/lifecycle/transition.js +78 -0
  118. package/dist/commands/tasks/move.d.ts +1 -0
  119. package/dist/commands/tasks/move.js +31 -0
  120. package/dist/commands/tasks/result/submit.js +11 -1
  121. package/dist/commands/tasks/review-queue.d.ts +29 -0
  122. package/dist/commands/tasks/review-queue.js +165 -0
  123. package/dist/commands/tasks/show.js +42 -0
  124. package/dist/commands/tasks/update.d.ts +1 -0
  125. package/dist/commands/tasks/update.js +47 -0
  126. package/dist/lib/agent-actions.d.ts +36 -10
  127. package/dist/lib/agent-actions.js +63 -9
  128. package/dist/lib/agent-config.d.ts +11 -0
  129. package/dist/lib/agent-config.js +85 -3
  130. package/dist/lib/agent-pin-mute.d.ts +24 -0
  131. package/dist/lib/agent-pin-mute.js +17 -0
  132. package/dist/lib/agent-visual-refs.d.ts +6 -0
  133. package/dist/lib/agent-visual-refs.js +142 -0
  134. package/dist/lib/first-party-harness-agent.js +7 -0
  135. package/dist/lib/followups.d.ts +107 -0
  136. package/dist/lib/followups.js +102 -0
  137. package/dist/lib/label-ref.d.ts +95 -0
  138. package/dist/lib/label-ref.js +163 -0
  139. package/dist/lib/label-scope.d.ts +2 -2
  140. package/dist/lib/label-scope.js +3 -3
  141. package/dist/lib/task-closure.d.ts +32 -0
  142. package/dist/lib/task-closure.js +106 -0
  143. package/dist/lib/task-lifecycle-output.d.ts +14 -0
  144. package/dist/lib/task-lifecycle-output.js +101 -0
  145. package/dist/lib/tasks.d.ts +3 -0
  146. package/dist/lib/tasks.js +31 -0
  147. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +4 -0
  148. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +4 -0
  149. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  150. package/dist/node_modules/@skrr-ai/data-provider/index.js +5079 -4546
  151. package/oclif.manifest.json +20216 -16002
  152. package/package.json +16 -4
@@ -0,0 +1,59 @@
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
+ /**
7
+ * Edit one of the caller's own categories. Wraps `PATCH /api/agents/categories/:value`.
8
+ *
9
+ * `value` is the identity, not a field: agents point at it, so it is the ARG and
10
+ * cannot be changed here. Renaming means `--label`.
11
+ */
12
+ class AgentsCategoriesUpdate extends base_command_1.BaseCommand {
13
+ static description = 'Update a custom agent category';
14
+ static examples = [
15
+ '<%= config.bin %> agents categories update ops --label "Operations & on-call"',
16
+ '<%= config.bin %> agents categories update ops --no-active',
17
+ ];
18
+ static args = {
19
+ value: core_1.Args.string({ description: 'Category value', required: true, ignoreStdin: true }),
20
+ };
21
+ static flags = {
22
+ label: core_1.Flags.string({ description: 'New display name' }),
23
+ description: core_1.Flags.string({ description: 'New description' }),
24
+ order: core_1.Flags.integer({ description: 'New sort position' }),
25
+ active: core_1.Flags.boolean({
26
+ description: 'Whether the category is offered when choosing one',
27
+ allowNo: true,
28
+ }),
29
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
30
+ };
31
+ async run() {
32
+ this.requireAuth();
33
+ const { args, flags } = await this.parse(AgentsCategoriesUpdate);
34
+ const patch = {
35
+ ...(flags.label === undefined ? {} : { label: flags.label }),
36
+ ...(flags.description === undefined ? {} : { description: flags.description }),
37
+ ...(flags.order === undefined ? {} : { order: flags.order }),
38
+ ...(flags.active === undefined ? {} : { isActive: flags.active }),
39
+ };
40
+ if (Object.keys(patch).length === 0) {
41
+ this.error('Nothing to update. Pass at least one of --label, --description, --order, --active.', {
42
+ exit: 1,
43
+ });
44
+ }
45
+ let updated;
46
+ try {
47
+ updated = await data_provider_1.dataService.updateUserCategory(args.value, patch);
48
+ }
49
+ catch (err) {
50
+ this.handleApiError(err);
51
+ }
52
+ if (flags.json) {
53
+ this.log(JSON.stringify(updated, null, 2));
54
+ return;
55
+ }
56
+ this.log(`Updated category ${args.value}`);
57
+ }
58
+ }
59
+ exports.default = AgentsCategoriesUpdate;
@@ -104,6 +104,16 @@ export default class AgentsCreate extends BaseCommand {
104
104
  'hide-sequential-outputs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
105
105
  'is-collaborative': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
106
106
  'recursion-limit': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
107
+ avatar: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
108
+ 'conversation-starter': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
109
+ 'todo-working-hours': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
110
+ 'reasoning-tool-escape': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
111
+ 'commitment-responsibility': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
112
+ 'commitment-responsibility-ceiling': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
113
+ 'max-turns': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
114
+ 'tool-resources': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
115
+ 'install-channel': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
116
+ 'auto-minor-updates': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
107
117
  };
108
118
  run(): Promise<void>;
109
119
  }
@@ -157,7 +157,10 @@ class AgentsCreate extends base_command_1.BaseCommand {
157
157
  instructions: core_1.Flags.string({
158
158
  description: 'Initial raw custom instructions (creates one inline block; use `agents instructions` to compose reusable blocks later)',
159
159
  }),
160
- category: core_1.Flags.string({ description: 'Agent category' }),
160
+ category: core_1.Flags.string({
161
+ description: 'Agent category. `skrr agents categories` lists what this account accepts, and ' +
162
+ '`skrr agents categories create` adds one.',
163
+ }),
161
164
  target: core_1.Flags.string({
162
165
  description: 'Required execution target. Use a Harness id, Hosted Machine session, or Agent Worker. ' +
163
166
  'Use hosted-machine, sbs_..., agent-worker, or a connected Harness id. ' +
@@ -192,7 +195,10 @@ class AgentsCreate extends base_command_1.BaseCommand {
192
195
  'network-agent-ids': core_1.Flags.string({ description: 'Network agent IDs JSON array' }),
193
196
  'network-include-public': core_1.Flags.boolean({ description: 'Include public agents in network' }),
194
197
  'character-3d-id': core_1.Flags.string({ description: '3D character ID' }),
195
- 'scene-background': core_1.Flags.string({ description: 'Scene background' }),
198
+ 'scene-background': core_1.Flags.string({
199
+ description: 'Backdrop for the 3D view: default, preset:<id>, or image:<filepath>@<source>. ' +
200
+ 'A bare string is refused — the stored field is a typed reference, not a name.',
201
+ }),
196
202
  'tone-mode': core_1.Flags.string({ description: 'Tone mode' }),
197
203
  'tone-id': core_1.Flags.string({ description: 'Tone ID' }),
198
204
  'tone-notes': core_1.Flags.string({ description: 'Per-agent tone notes' }),
@@ -209,6 +215,45 @@ class AgentsCreate extends base_command_1.BaseCommand {
209
215
  'hide-sequential-outputs': core_1.Flags.boolean({ description: 'Hide sequential outputs' }),
210
216
  'is-collaborative': core_1.Flags.boolean({ description: 'Enable collaboration' }),
211
217
  'recursion-limit': core_1.Flags.integer({ description: 'Agent recursion limit' }),
218
+ avatar: core_1.Flags.string({
219
+ description: "The agent's face, as a reference rather than a file: default, preset:<id> " +
220
+ '(`skrr agents avatar presets`), asset:<id> (`skrr agents avatar library`), or ' +
221
+ 'image:<filepath>@<source>. To upload a new image use `skrr agents avatar upload`.',
222
+ }),
223
+ 'conversation-starter': core_1.Flags.string({
224
+ description: 'Suggested opening prompt shown on the agent (repeatable; replaces the list)',
225
+ multiple: true,
226
+ }),
227
+ 'todo-working-hours': core_1.Flags.string({
228
+ description: 'When this agent schedules its own work: HH:MM-HH:MM[@<IANA timezone>], e.g. ' +
229
+ '09:00-18:00@America/Los_Angeles',
230
+ }),
231
+ 'reasoning-tool-escape': core_1.Flags.string({
232
+ description: 'Tool a reasoning-only turn may still use (repeatable; replaces the list). ' +
233
+ 'These are ESCAPES, not a fenced tool surface.',
234
+ options: [...agent_config_1.REASONING_TOOL_ESCAPES],
235
+ multiple: true,
236
+ }),
237
+ 'commitment-responsibility': core_1.Flags.string({
238
+ description: "Default work authority for this agent's commitments",
239
+ options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
240
+ }),
241
+ 'commitment-responsibility-ceiling': core_1.Flags.string({
242
+ description: 'Ceiling a commitment may not exceed, whatever it asks for',
243
+ options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
244
+ }),
245
+ 'max-turns': core_1.Flags.integer({ description: 'Maximum turns in one agent run (1-500)' }),
246
+ 'tool-resources': core_1.Flags.string({
247
+ description: 'Tool resources JSON object (file_search / context / image_edit bindings)',
248
+ }),
249
+ 'install-channel': core_1.Flags.string({
250
+ description: 'Release policy: which channel installs of this agent follow',
251
+ options: [...agent_config_1.RELEASE_INSTALL_CHANNELS],
252
+ }),
253
+ 'auto-minor-updates': core_1.Flags.boolean({
254
+ description: 'Release policy: allow installs to take minor updates automatically',
255
+ allowNo: true,
256
+ }),
212
257
  };
213
258
  async run() {
214
259
  this.requireAuth();
@@ -275,7 +320,16 @@ class AgentsCreate extends base_command_1.BaseCommand {
275
320
  // server seeds the full portfolio exactly as it always has.
276
321
  relationshipLoops: flags['no-relationship-loops'] ? false : undefined,
277
322
  });
278
- payload = (0, agent_config_1.mergeAgentConfigFlags)(payload, flags);
323
+ // `mergeAgentConfigFlags` parses the typed flags (avatar, scene background,
324
+ // working hours, every JSON flag). A parse failure is the caller's input, so
325
+ // it is reported as a CLI error with the accepted forms — not as an unhandled
326
+ // throw, and not as a 400 from the server naming a zod path.
327
+ try {
328
+ payload = (0, agent_config_1.mergeAgentConfigFlags)(payload, flags);
329
+ }
330
+ catch (err) {
331
+ this.error(err.message, { exit: 1 });
332
+ }
279
333
  // agentCreateSchema (packages/api/src/agents/validation.ts) requires
280
334
  // provider and model, and a nameless agent is unusable (see
281
335
  // agentCreateMissingFields). We validate client-side so users get a clearer
@@ -0,0 +1,27 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * The agent a harness gets when nobody has configured one.
4
+ *
5
+ * Wraps `POST /api/agents/default`, the path a `skrr code` session takes on an
6
+ * unconfigured account. It is IDEMPOTENT — it returns the existing default
7
+ * rather than minting a second one — which is what makes it safe in a
8
+ * first-run script where `agents create` would not be.
9
+ *
10
+ * Deliberately a separate command from `agents create`: this one asks the server
11
+ * to CHOOSE (provider, model, placement, name), and `create` is where the caller
12
+ * chooses. Collapsing them would make `create` sometimes-not-create.
13
+ *
14
+ * `lib/first-party-harness-agent.ts` calls the same endpoint through its own
15
+ * private helper and keeps doing so: that path takes an `AbortSignal` and treats
16
+ * an abort as distinct from a refusal, which `dataService.ensureDefaultAgent`
17
+ * cannot express. Two call sites, one endpoint, for a stated reason — not drift.
18
+ */
19
+ export default class AgentsEnsureDefault extends BaseCommand {
20
+ static description: string;
21
+ static examples: string[];
22
+ static flags: {
23
+ harness: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
25
+ };
26
+ run(): Promise<void>;
27
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const auth_core_1 = require("@skrr-ai/auth-core");
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
+ const base_command_1 = require("../../base-command");
7
+ const web_url_1 = require("../../lib/web-url");
8
+ /**
9
+ * The agent a harness gets when nobody has configured one.
10
+ *
11
+ * Wraps `POST /api/agents/default`, the path a `skrr code` session takes on an
12
+ * unconfigured account. It is IDEMPOTENT — it returns the existing default
13
+ * rather than minting a second one — which is what makes it safe in a
14
+ * first-run script where `agents create` would not be.
15
+ *
16
+ * Deliberately a separate command from `agents create`: this one asks the server
17
+ * to CHOOSE (provider, model, placement, name), and `create` is where the caller
18
+ * chooses. Collapsing them would make `create` sometimes-not-create.
19
+ *
20
+ * `lib/first-party-harness-agent.ts` calls the same endpoint through its own
21
+ * private helper and keeps doing so: that path takes an `AbortSignal` and treats
22
+ * an abort as distinct from a refusal, which `dataService.ensureDefaultAgent`
23
+ * cannot express. Two call sites, one endpoint, for a stated reason — not drift.
24
+ */
25
+ class AgentsEnsureDefault extends base_command_1.BaseCommand {
26
+ static description = "Return this account's default agent for a harness, creating it if there isn't one";
27
+ static examples = [
28
+ '<%= config.bin %> agents ensure-default',
29
+ '<%= config.bin %> agents ensure-default --harness <harness-id> --json',
30
+ ];
31
+ static flags = {
32
+ harness: core_1.Flags.string({
33
+ // Only a harness with a managed-inference capability can own a default
34
+ // agent, and today exactly one does. Defaulted rather than required
35
+ // because the bare call is otherwise refused with a message that quotes
36
+ // the literal string "undefined" — accurate about the body, useless about
37
+ // the fix. Read from FIRST_PARTY_HARNESS, never written as a literal.
38
+ description: `Harness the default belongs to (default: ${auth_core_1.FIRST_PARTY_HARNESS.provider})`,
39
+ default: auth_core_1.FIRST_PARTY_HARNESS.provider,
40
+ }),
41
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
42
+ };
43
+ async run() {
44
+ this.requireAuth();
45
+ const { flags } = await this.parse(AgentsEnsureDefault);
46
+ let result;
47
+ try {
48
+ result = await data_provider_1.dataService.ensureDefaultAgent({ harness: flags.harness });
49
+ }
50
+ catch (err) {
51
+ this.handleApiError(err);
52
+ }
53
+ const agent = result.agent;
54
+ if (flags.json) {
55
+ this.log(JSON.stringify({ created: result.created, agent: (0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, agent) }, null, 2));
56
+ return;
57
+ }
58
+ const agentId = String(agent.id ?? agent._id ?? '?');
59
+ this.log(result.created
60
+ ? `Created default agent ${agentId} — ${agent.name ?? '(no name)'}`
61
+ : `Default agent already exists: ${agentId} — ${agent.name ?? '(no name)'}`);
62
+ this.log(`URL: ${(0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, agent).url ?? '-'}`);
63
+ }
64
+ }
65
+ exports.default = AgentsEnsureDefault;
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * Per-USER preference, not agent config: it changes your view of the agent and
4
+ * nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
5
+ */
6
+ export default class AgentsMute extends BaseCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ static args: {
10
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
12
+ static flags: {
13
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
6
+ /**
7
+ * Per-USER preference, not agent config: it changes your view of the agent and
8
+ * nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
9
+ */
10
+ class AgentsMute extends base_command_1.BaseCommand {
11
+ static description = "Silence an agent's notifications for you";
12
+ static examples = ['<%= config.bin %> agents mute <agent-id>'];
13
+ static args = {
14
+ id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
15
+ };
16
+ static flags = {
17
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
18
+ };
19
+ async run() {
20
+ this.requireAuth();
21
+ const { args, flags } = await this.parse(AgentsMute);
22
+ let result;
23
+ try {
24
+ result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'mute', true);
25
+ }
26
+ catch (err) {
27
+ this.handleApiError(err);
28
+ }
29
+ if (flags.json) {
30
+ this.log(this.agentJson(args.id, { mute: result.value, changed: result.changed }));
31
+ return;
32
+ }
33
+ this.log(result.changed
34
+ ? `Agent ${args.id}: mute is now ${result.value}`
35
+ : `Agent ${args.id}: mute was already ${result.value} — nothing to do`);
36
+ }
37
+ }
38
+ exports.default = AgentsMute;
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * Per-USER preference, not agent config: it changes your view of the agent and
4
+ * nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
5
+ */
6
+ export default class AgentsPin extends BaseCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ static args: {
10
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
12
+ static flags: {
13
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
6
+ /**
7
+ * Per-USER preference, not agent config: it changes your view of the agent and
8
+ * nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
9
+ */
10
+ class AgentsPin extends base_command_1.BaseCommand {
11
+ static description = 'Pin an agent to the top of your list';
12
+ static examples = ['<%= config.bin %> agents pin <agent-id>'];
13
+ static args = {
14
+ id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
15
+ };
16
+ static flags = {
17
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
18
+ };
19
+ async run() {
20
+ this.requireAuth();
21
+ const { args, flags } = await this.parse(AgentsPin);
22
+ let result;
23
+ try {
24
+ result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'pin', true);
25
+ }
26
+ catch (err) {
27
+ this.handleApiError(err);
28
+ }
29
+ if (flags.json) {
30
+ this.log(this.agentJson(args.id, { pin: result.value, changed: result.changed }));
31
+ return;
32
+ }
33
+ this.log(result.changed
34
+ ? `Agent ${args.id}: pin is now ${result.value}`
35
+ : `Agent ${args.id}: pin was already ${result.value} — nothing to do`);
36
+ }
37
+ }
38
+ exports.default = AgentsPin;
@@ -0,0 +1,19 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Whether this account has credentials for one tool.
4
+ *
5
+ * Separate from the `AUTH` column in `agents tools` because that column reports
6
+ * what the catalog said in one batch read, and this asks the server about one
7
+ * tool now — which is the question worth asking after wiring up a key.
8
+ */
9
+ export default class AgentsToolsAuth extends BaseCommand {
10
+ static description: string;
11
+ static examples: string[];
12
+ static args: {
13
+ toolId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
14
+ };
15
+ static flags: {
16
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
@@ -0,0 +1,41 @@
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
+ /**
7
+ * Whether this account has credentials for one tool.
8
+ *
9
+ * Separate from the `AUTH` column in `agents tools` because that column reports
10
+ * what the catalog said in one batch read, and this asks the server about one
11
+ * tool now — which is the question worth asking after wiring up a key.
12
+ */
13
+ class AgentsToolsAuth extends base_command_1.BaseCommand {
14
+ static description = 'Check whether this account is authenticated for one tool';
15
+ static examples = ['<%= config.bin %> agents tools auth <plugin-key>'];
16
+ static args = {
17
+ toolId: core_1.Args.string({ description: 'Plugin key', required: true, ignoreStdin: true }),
18
+ };
19
+ static flags = {
20
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
21
+ };
22
+ async run() {
23
+ this.requireAuth();
24
+ const { args, flags } = await this.parse(AgentsToolsAuth);
25
+ let result;
26
+ try {
27
+ result = await data_provider_1.dataService.getVerifyAgentToolAuth({ toolId: args.toolId });
28
+ }
29
+ catch (err) {
30
+ this.handleApiError(err);
31
+ }
32
+ if (flags.json) {
33
+ this.log(JSON.stringify(result, null, 2));
34
+ return;
35
+ }
36
+ this.log(result.authenticated
37
+ ? `${args.toolId}: authenticated`
38
+ : `${args.toolId}: not authenticated${result.message ? ` — ${result.message}` : ''}`);
39
+ }
40
+ }
41
+ exports.default = AgentsToolsAuth;
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Tool calls recorded in one conversation.
4
+ *
5
+ * `conversationId` is REQUIRED by the endpoint, not optional with a default, so
6
+ * it is a required flag rather than something this command guesses — a
7
+ * conversation-less listing would silently be somebody else's transcript or
8
+ * nothing at all.
9
+ */
10
+ export default class AgentsToolsCalls extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static flags: {
14
+ conversation: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,54 @@
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
+ /**
8
+ * Tool calls recorded in one conversation.
9
+ *
10
+ * `conversationId` is REQUIRED by the endpoint, not optional with a default, so
11
+ * it is a required flag rather than something this command guesses — a
12
+ * conversation-less listing would silently be somebody else's transcript or
13
+ * nothing at all.
14
+ */
15
+ class AgentsToolsCalls extends base_command_1.BaseCommand {
16
+ static description = 'List the tool calls recorded in one conversation';
17
+ static examples = [
18
+ '<%= config.bin %> agents tools calls --conversation <conversation-id>',
19
+ ];
20
+ static flags = {
21
+ conversation: core_1.Flags.string({ description: 'Conversation ID', required: true }),
22
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
23
+ };
24
+ async run() {
25
+ this.requireAuth();
26
+ const { flags } = await this.parse(AgentsToolsCalls);
27
+ let calls;
28
+ try {
29
+ calls = await data_provider_1.dataService.getToolCalls({ conversationId: flags.conversation });
30
+ }
31
+ catch (err) {
32
+ this.handleApiError(err);
33
+ }
34
+ if (flags.json) {
35
+ this.log(JSON.stringify(calls, null, 2));
36
+ return;
37
+ }
38
+ const rows = (calls ?? []);
39
+ if (rows.length === 0) {
40
+ this.log(`No tool calls recorded in conversation ${flags.conversation}.`);
41
+ return;
42
+ }
43
+ (0, format_1.renderTable)(rows.map((call) => ({
44
+ toolId: String(call.toolId ?? '-'),
45
+ messageId: String(call.messageId ?? '-'),
46
+ blockIndex: call.blockIndex === undefined ? '-' : String(call.blockIndex),
47
+ })), [
48
+ { key: 'toolId', header: 'TOOL', verbatim: true },
49
+ { key: 'messageId', header: 'MESSAGE', verbatim: true },
50
+ { key: 'blockIndex', header: 'BLOCK' },
51
+ ], (line) => this.log(line));
52
+ }
53
+ }
54
+ exports.default = AgentsToolsCalls;
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * The tool catalog `--tools` is chosen from.
4
+ *
5
+ * `agents create --tools '["..."]'` has always taken an array of plugin keys the
6
+ * caller had no way to enumerate — the web fills the same field from a picker
7
+ * backed by this endpoint, so the flag was only usable by someone reading the
8
+ * server's source or copying another agent's array.
9
+ *
10
+ * PLUGIN KEY is the column that matters: it is the string the field stores.
11
+ */
12
+ export default class AgentsToolsList extends BaseCommand {
13
+ static description: string;
14
+ static examples: string[];
15
+ static flags: {
16
+ authenticated: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ };
19
+ run(): Promise<void>;
20
+ }
@@ -0,0 +1,77 @@
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
+ /**
8
+ * The tool catalog `--tools` is chosen from.
9
+ *
10
+ * `agents create --tools '["..."]'` has always taken an array of plugin keys the
11
+ * caller had no way to enumerate — the web fills the same field from a picker
12
+ * backed by this endpoint, so the flag was only usable by someone reading the
13
+ * server's source or copying another agent's array.
14
+ *
15
+ * PLUGIN KEY is the column that matters: it is the string the field stores.
16
+ */
17
+ class AgentsToolsList extends base_command_1.BaseCommand {
18
+ static description = 'List the tools `agents create/update --tools` accepts';
19
+ static examples = [
20
+ '<%= config.bin %> agents tools',
21
+ '<%= config.bin %> agents tools --authenticated',
22
+ '<%= config.bin %> agents tools --json',
23
+ ];
24
+ static flags = {
25
+ authenticated: core_1.Flags.boolean({
26
+ description: 'Only tools this account has already authenticated',
27
+ }),
28
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
29
+ };
30
+ async run() {
31
+ this.requireAuth();
32
+ const { flags } = await this.parse(AgentsToolsList);
33
+ let tools;
34
+ try {
35
+ tools = await data_provider_1.dataService.getAvailableTools();
36
+ }
37
+ catch (err) {
38
+ this.handleApiError(err);
39
+ }
40
+ const rows = flags.authenticated
41
+ ? tools.filter((tool) => tool.authenticated === true)
42
+ : tools;
43
+ if (flags.json) {
44
+ this.log(JSON.stringify(rows, null, 2));
45
+ return;
46
+ }
47
+ if (rows.length === 0) {
48
+ this.log(flags.authenticated ? 'No authenticated tools.' : 'No tools available.');
49
+ return;
50
+ }
51
+ /**
52
+ * Three states, not two. `authConfig` present means the tool needs
53
+ * credentials; `authenticated` says whether this account has supplied them.
54
+ * A tool that needs nothing is neither — printing "no" for it would send
55
+ * someone to configure a key that does not exist.
56
+ */
57
+ const authState = (tool) => {
58
+ if (!tool.authConfig || tool.authConfig.length === 0)
59
+ return '-';
60
+ return tool.authenticated ? 'yes' : 'needed';
61
+ };
62
+ (0, format_1.renderTable)(rows.map((tool) => ({
63
+ pluginKey: tool.pluginKey,
64
+ name: tool.name,
65
+ auth: authState(tool),
66
+ description: String(tool.description ?? ''),
67
+ })), [
68
+ { key: 'pluginKey', header: 'PLUGIN KEY', verbatim: true },
69
+ { key: 'name', header: 'NAME', maxWidth: 28 },
70
+ { key: 'auth', header: 'AUTH' },
71
+ { key: 'description', header: 'DESCRIPTION', maxWidth: 52 },
72
+ ], (line) => this.log(line));
73
+ this.log('');
74
+ this.log('PLUGIN KEY is what --tools stores, e.g. --tools \'["web_search"]\'.');
75
+ }
76
+ }
77
+ exports.default = AgentsToolsList;
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * Per-USER preference, not agent config: it changes your view of the agent and
4
+ * nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
5
+ */
6
+ export default class AgentsUnmute extends BaseCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ static args: {
10
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
12
+ static flags: {
13
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }