@skrr-ai/cli 0.1.60 → 0.1.62

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 (194) hide show
  1. package/dist/base-command.js +16 -0
  2. package/dist/commands/agents/create.d.ts +1 -0
  3. package/dist/commands/agents/create.js +8 -1
  4. package/dist/commands/agents/delete.d.ts +14 -0
  5. package/dist/commands/agents/delete.js +52 -4
  6. package/dist/commands/agents/eval/index.d.ts +38 -0
  7. package/dist/commands/agents/eval/index.js +157 -0
  8. package/dist/commands/agents/eval/list.d.ts +13 -0
  9. package/dist/commands/agents/eval/list.js +53 -0
  10. package/dist/commands/agents/eval/show.d.ts +13 -0
  11. package/dist/commands/agents/eval/show.js +36 -0
  12. package/dist/commands/agents/import.d.ts +37 -0
  13. package/dist/commands/agents/import.js +233 -0
  14. package/dist/commands/agents/pull.d.ts +27 -0
  15. package/dist/commands/agents/pull.js +82 -0
  16. package/dist/commands/agents/push.d.ts +28 -0
  17. package/dist/commands/agents/push.js +112 -0
  18. package/dist/commands/agents/releases/ci-publish.d.ts +32 -0
  19. package/dist/commands/agents/releases/ci-publish.js +99 -0
  20. package/dist/commands/agents/releases/create.d.ts +3 -0
  21. package/dist/commands/agents/releases/create.js +27 -6
  22. package/dist/commands/agents/releases/known-issues/add.d.ts +19 -0
  23. package/dist/commands/agents/releases/known-issues/add.js +43 -0
  24. package/dist/commands/agents/releases/known-issues/list.d.ts +17 -0
  25. package/dist/commands/agents/releases/known-issues/list.js +55 -0
  26. package/dist/commands/agents/releases/known-issues/update.d.ts +18 -0
  27. package/dist/commands/agents/releases/known-issues/update.js +47 -0
  28. package/dist/commands/agents/releases/list.js +25 -3
  29. package/dist/commands/agents/releases/rollback.js +12 -4
  30. package/dist/commands/agents/releases/test-install.d.ts +22 -0
  31. package/dist/commands/agents/releases/test-install.js +70 -0
  32. package/dist/commands/agents/releases/trusted-publishers/list.d.ts +17 -0
  33. package/dist/commands/agents/releases/trusted-publishers/list.js +55 -0
  34. package/dist/commands/agents/releases/trusted-publishers/remove.d.ts +17 -0
  35. package/dist/commands/agents/releases/trusted-publishers/remove.js +45 -0
  36. package/dist/commands/agents/releases/trusted-publishers/set.d.ts +27 -0
  37. package/dist/commands/agents/releases/trusted-publishers/set.js +82 -0
  38. package/dist/commands/agents/update.d.ts +1 -0
  39. package/dist/commands/agents/update.js +8 -1
  40. package/dist/commands/agents/usage-cap.d.ts +20 -0
  41. package/dist/commands/agents/usage-cap.js +76 -0
  42. package/dist/commands/agents/validate.d.ts +22 -0
  43. package/dist/commands/agents/validate.js +66 -0
  44. package/dist/commands/agents/visibility.d.ts +13 -0
  45. package/dist/commands/agents/visibility.js +84 -2
  46. package/dist/commands/commerce/fees/show.d.ts +19 -0
  47. package/dist/commands/commerce/fees/show.js +75 -0
  48. package/dist/commands/earnings/index.d.ts +15 -0
  49. package/dist/commands/earnings/index.js +46 -0
  50. package/dist/commands/earnings/payouts.d.ts +12 -0
  51. package/dist/commands/earnings/payouts.js +39 -0
  52. package/dist/commands/earnings/statements.d.ts +19 -0
  53. package/dist/commands/earnings/statements.js +70 -0
  54. package/dist/commands/goals/key-results/create.d.ts +1 -1
  55. package/dist/commands/goals/key-results/create.js +5 -1
  56. package/dist/commands/harnesses/show.js +11 -1
  57. package/dist/commands/logout.js +31 -0
  58. package/dist/commands/machines/show.js +10 -1
  59. package/dist/commands/managed-execution/show.d.ts +10 -0
  60. package/dist/commands/managed-execution/show.js +60 -0
  61. package/dist/commands/spaces/show.js +35 -1
  62. package/dist/commands/step-up.d.ts +23 -0
  63. package/dist/commands/step-up.js +96 -0
  64. package/dist/commands/store/acquisitions/approve.d.ts +30 -0
  65. package/dist/commands/store/acquisitions/approve.js +100 -0
  66. package/dist/commands/store/acquisitions/decline.d.ts +17 -0
  67. package/dist/commands/store/acquisitions/decline.js +47 -0
  68. package/dist/commands/store/acquisitions/show.d.ts +16 -0
  69. package/dist/commands/store/acquisitions/show.js +49 -0
  70. package/dist/commands/store/admissions/approve.d.ts +19 -0
  71. package/dist/commands/store/admissions/approve.js +50 -0
  72. package/dist/commands/store/admissions/list.d.ts +15 -0
  73. package/dist/commands/store/admissions/list.js +60 -0
  74. package/dist/commands/store/admissions/refuse.d.ts +18 -0
  75. package/dist/commands/store/admissions/refuse.js +49 -0
  76. package/dist/commands/store/advisories/artifact.d.ts +15 -0
  77. package/dist/commands/store/advisories/artifact.js +25 -0
  78. package/dist/commands/store/advisories/cancel.d.ts +13 -0
  79. package/dist/commands/store/advisories/cancel.js +34 -0
  80. package/dist/commands/store/advisories/close.d.ts +18 -0
  81. package/dist/commands/store/advisories/close.js +51 -0
  82. package/dist/commands/store/advisories/confirm.d.ts +17 -0
  83. package/dist/commands/store/advisories/confirm.js +40 -0
  84. package/dist/commands/store/advisories/issue.d.ts +20 -0
  85. package/dist/commands/store/advisories/issue.js +59 -0
  86. package/dist/commands/store/advisories/list.d.ts +15 -0
  87. package/dist/commands/store/advisories/list.js +49 -0
  88. package/dist/commands/store/advisories/show.d.ts +13 -0
  89. package/dist/commands/store/advisories/show.js +34 -0
  90. package/dist/commands/store/artifacts/release.d.ts +16 -0
  91. package/dist/commands/store/artifacts/release.js +31 -0
  92. package/dist/commands/store/artifacts/used-by.d.ts +12 -0
  93. package/dist/commands/store/artifacts/used-by.js +20 -0
  94. package/dist/commands/store/browse.d.ts +5 -0
  95. package/dist/commands/store/browse.js +28 -1
  96. package/dist/commands/store/channel.d.ts +21 -0
  97. package/dist/commands/store/channel.js +62 -0
  98. package/dist/commands/store/follow.d.ts +14 -0
  99. package/dist/commands/store/follow.js +45 -0
  100. package/dist/commands/store/governance/policy.d.ts +18 -5
  101. package/dist/commands/store/governance/policy.js +80 -12
  102. package/dist/commands/store/governance/requests.d.ts +28 -0
  103. package/dist/commands/store/governance/requests.js +116 -0
  104. package/dist/commands/store/install.d.ts +3 -0
  105. package/dist/commands/store/install.js +101 -2
  106. package/dist/commands/store/issues.d.ts +26 -0
  107. package/dist/commands/store/issues.js +118 -0
  108. package/dist/commands/store/maintainers/add.d.ts +13 -0
  109. package/dist/commands/store/maintainers/add.js +23 -0
  110. package/dist/commands/store/maintainers/remove.d.ts +13 -0
  111. package/dist/commands/store/maintainers/remove.js +22 -0
  112. package/dist/commands/store/publishers/approve.d.ts +11 -0
  113. package/dist/commands/store/publishers/approve.js +25 -0
  114. package/dist/commands/store/publishers/claim.d.ts +12 -0
  115. package/dist/commands/store/publishers/claim.js +20 -0
  116. package/dist/commands/store/publishers/confirm.d.ts +11 -0
  117. package/dist/commands/store/publishers/confirm.js +17 -0
  118. package/dist/commands/store/publishers/domains/begin.d.ts +12 -0
  119. package/dist/commands/store/publishers/domains/begin.js +20 -0
  120. package/dist/commands/store/publishers/domains/list.d.ts +9 -0
  121. package/dist/commands/store/publishers/domains/list.js +19 -0
  122. package/dist/commands/store/publishers/domains/verify.d.ts +12 -0
  123. package/dist/commands/store/publishers/domains/verify.js +20 -0
  124. package/dist/commands/store/publishers/namespaces.d.ts +8 -0
  125. package/dist/commands/store/publishers/namespaces.js +16 -0
  126. package/dist/commands/store/publishers/verified.d.ts +11 -0
  127. package/dist/commands/store/publishers/verified.js +34 -0
  128. package/dist/commands/store/refund.d.ts +22 -0
  129. package/dist/commands/store/refund.js +80 -0
  130. package/dist/commands/store/report.d.ts +20 -0
  131. package/dist/commands/store/report.js +59 -0
  132. package/dist/commands/store/reports.d.ts +11 -0
  133. package/dist/commands/store/reports.js +52 -0
  134. package/dist/commands/store/signals.d.ts +18 -0
  135. package/dist/commands/store/signals.js +43 -0
  136. package/dist/commands/store/star.d.ts +17 -0
  137. package/dist/commands/store/star.js +41 -0
  138. package/dist/commands/store/stars.d.ts +10 -0
  139. package/dist/commands/store/stars.js +33 -0
  140. package/dist/commands/store/trial.d.ts +11 -0
  141. package/dist/commands/store/trial.js +17 -0
  142. package/dist/commands/store/uninstall.d.ts +19 -0
  143. package/dist/commands/store/uninstall.js +118 -0
  144. package/dist/commands/store/update.d.ts +2 -0
  145. package/dist/commands/store/update.js +60 -2
  146. package/dist/commands/store/updates.d.ts +10 -4
  147. package/dist/commands/store/updates.js +60 -39
  148. package/dist/commands/store/watch.d.ts +18 -0
  149. package/dist/commands/store/watch.js +44 -0
  150. package/dist/commands/subscriptions/health.d.ts +12 -0
  151. package/dist/commands/subscriptions/health.js +39 -0
  152. package/dist/commands/subscriptions/list.js +3 -2
  153. package/dist/commands/subscriptions/status.js +7 -1
  154. package/dist/commands/subscriptions/subscribe.d.ts +9 -2
  155. package/dist/commands/subscriptions/subscribe.js +141 -12
  156. package/dist/commands/tasks/comments/list.js +9 -1
  157. package/dist/commands/tasks/labels/attach.js +15 -2
  158. package/dist/commands/tasks/show.js +17 -3
  159. package/dist/commands/tasks/update.js +15 -4
  160. package/dist/commands/tasks/updates/add.js +5 -1
  161. package/dist/lib/agent-config.js +1 -0
  162. package/dist/lib/agent-evals.d.ts +71 -0
  163. package/dist/lib/agent-evals.js +359 -0
  164. package/dist/lib/agent-spec.d.ts +28 -0
  165. package/dist/lib/agent-spec.js +58 -0
  166. package/dist/lib/auth-storage.d.ts +12 -0
  167. package/dist/lib/auth-storage.js +0 -33
  168. package/dist/lib/commerce.d.ts +8 -0
  169. package/dist/lib/commerce.js +10 -0
  170. package/dist/lib/earnings.d.ts +36 -0
  171. package/dist/lib/earnings.js +164 -0
  172. package/dist/lib/github-oidc.d.ts +13 -0
  173. package/dist/lib/github-oidc.js +41 -0
  174. package/dist/lib/governed-store.d.ts +43 -2
  175. package/dist/lib/governed-store.js +25 -1
  176. package/dist/lib/label-ref.js +16 -0
  177. package/dist/lib/managed-execution.d.ts +10 -0
  178. package/dist/lib/managed-execution.js +43 -0
  179. package/dist/lib/principal-display.d.ts +20 -0
  180. package/dist/lib/principal-display.js +64 -0
  181. package/dist/lib/space-template-source.d.ts +14 -0
  182. package/dist/lib/space-template-source.js +41 -0
  183. package/dist/lib/step-up.d.ts +21 -0
  184. package/dist/lib/step-up.js +44 -0
  185. package/dist/lib/store-acquisition.d.ts +11 -0
  186. package/dist/lib/store-acquisition.js +40 -0
  187. package/dist/lib/store-advisories.d.ts +50 -0
  188. package/dist/lib/store-advisories.js +62 -0
  189. package/dist/lib/task-closure.js +1 -1
  190. package/dist/lib/web-url.d.ts +11 -0
  191. package/dist/lib/web-url.js +14 -0
  192. package/dist/node_modules/@skrr-ai/data-provider/index.js +25471 -24177
  193. package/oclif.manifest.json +38931 -34119
  194. package/package.json +21 -3
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * YOUR monthly cap on ONE agent's hosted spend (C11), enforced where each of
4
+ * your hosted Agent SDK runs of it starts. It counts and bounds only the runs
5
+ * billed to you. For a Store agent, pass your installed copy's id — the cap is
6
+ * on the agent that runs, not on the publisher's listing.
7
+ */
8
+ export default class AgentsUsageCap extends BaseCommand {
9
+ static description: string;
10
+ static examples: string[];
11
+ static args: {
12
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
14
+ static flags: {
15
+ set: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ clear: 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,76 @@
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
+ * YOUR monthly cap on ONE agent's hosted spend (C11), enforced where each of
8
+ * your hosted Agent SDK runs of it starts. It counts and bounds only the runs
9
+ * billed to you. For a Store agent, pass your installed copy's id — the cap is
10
+ * on the agent that runs, not on the publisher's listing.
11
+ */
12
+ class AgentsUsageCap extends base_command_1.BaseCommand {
13
+ static description = 'Show, set or remove your monthly hosted-spend cap on an agent';
14
+ static examples = [
15
+ '<%= config.bin %> agents usage-cap <agent-id>',
16
+ '<%= config.bin %> agents usage-cap <agent-id> --set 20',
17
+ '<%= config.bin %> agents usage-cap <agent-id> --clear --json',
18
+ ];
19
+ static args = {
20
+ id: core_1.Args.string({
21
+ description: 'Agent ID (for a Store agent, your installed copy)',
22
+ required: true,
23
+ ignoreStdin: true,
24
+ }),
25
+ };
26
+ static flags = {
27
+ set: core_1.Flags.string({
28
+ description: 'Monthly cap in dollars of usage, e.g. 20 or 12.50',
29
+ exclusive: ['clear'],
30
+ }),
31
+ clear: core_1.Flags.boolean({ description: 'Remove the cap', exclusive: ['set'] }),
32
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
33
+ };
34
+ async run() {
35
+ this.requireAuth();
36
+ const { args, flags } = await this.parse(AgentsUsageCap);
37
+ let micros = null;
38
+ if (flags.set !== undefined) {
39
+ micros = (0, data_provider_1.parseAgentUsageCapDollars)(flags.set);
40
+ if (micros === null) {
41
+ this.error(`--set takes an amount in dollars, like 20 or 12.50 (got "${flags.set}")`, {
42
+ exit: 2,
43
+ });
44
+ }
45
+ }
46
+ let cap;
47
+ try {
48
+ cap = flags.clear
49
+ ? await data_provider_1.dataService.clearAgentUsageCap(args.id)
50
+ : micros !== null
51
+ ? await data_provider_1.dataService.setAgentUsageCap(args.id, { monthlyLimitMicros: micros })
52
+ : await data_provider_1.dataService.getAgentUsageCap(args.id);
53
+ }
54
+ catch (err) {
55
+ this.handleApiError(err);
56
+ }
57
+ if (!cap)
58
+ return;
59
+ if (flags.json) {
60
+ this.log(JSON.stringify(cap, null, 2));
61
+ return;
62
+ }
63
+ const resets = String(cap.periodEnd).slice(0, 10);
64
+ if (cap.monthlyLimitMicros === null) {
65
+ this.log(`Agent ${args.id}: no cap set · ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} used by you this month`);
66
+ }
67
+ else {
68
+ // Figures unclamped: usage past the cap is shown as it is. "Reached" is
69
+ // the server's call, made with the refusal's own threshold — a few cents
70
+ // left can already be too little to start a run.
71
+ this.log(`Agent ${args.id}: ${(0, data_provider_1.formatAgentUsageMicros)(cap.usedMicros)} of ${(0, data_provider_1.formatAgentUsageMicros)(cap.monthlyLimitMicros)} used by you this month (resets ${resets})${cap.exhausted ? ' — cap reached, your new runs are refused' : ''}`);
72
+ }
73
+ this.log(data_provider_1.AGENT_USAGE_CAP_EXPLANATION);
74
+ }
75
+ }
76
+ exports.default = AgentsUsageCap;
@@ -0,0 +1,22 @@
1
+ import { Command } from '@oclif/core';
2
+ /**
3
+ * Check an agent-as-code document without signing in or touching the network.
4
+ *
5
+ * It extends oclif's `Command`, not `BaseCommand`, on purpose: `BaseCommand`
6
+ * resolves a credential (keychain, local broker) before any command runs, and
7
+ * a CI job or a pre-commit hook that validates a file must not need either.
8
+ * The rules are the same module the server applies on push, so a file that
9
+ * passes here is refused on push only for what needs the live agent — a field
10
+ * push cannot set that differs from the agent's current value.
11
+ */
12
+ export default class AgentsValidate extends Command {
13
+ static description: string;
14
+ static examples: string[];
15
+ static args: {
16
+ file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
17
+ };
18
+ static flags: {
19
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<void>;
22
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const agent_spec_1 = require("../../lib/agent-spec");
5
+ /**
6
+ * Check an agent-as-code document without signing in or touching the network.
7
+ *
8
+ * It extends oclif's `Command`, not `BaseCommand`, on purpose: `BaseCommand`
9
+ * resolves a credential (keychain, local broker) before any command runs, and
10
+ * a CI job or a pre-commit hook that validates a file must not need either.
11
+ * The rules are the same module the server applies on push, so a file that
12
+ * passes here is refused on push only for what needs the live agent — a field
13
+ * push cannot set that differs from the agent's current value.
14
+ */
15
+ class AgentsValidate extends core_1.Command {
16
+ static description = 'Check an agent spec file offline: portable fields only, no credentials, no withheld references';
17
+ static examples = [
18
+ '<%= config.bin %> agents validate agent.json',
19
+ 'cat agent.json | <%= config.bin %> agents validate -',
20
+ '<%= config.bin %> agents validate agent.json --json',
21
+ ];
22
+ static args = {
23
+ file: core_1.Args.string({
24
+ description: 'Agent spec document ("-" for stdin)',
25
+ required: true,
26
+ ignoreStdin: true,
27
+ }),
28
+ };
29
+ static flags = {
30
+ json: core_1.Flags.boolean({ description: 'Output the result as JSON' }),
31
+ };
32
+ async run() {
33
+ const { args, flags } = await this.parse(AgentsValidate);
34
+ let raw;
35
+ try {
36
+ raw = await (0, agent_spec_1.readSpecSource)(args.file);
37
+ }
38
+ catch (err) {
39
+ this.error(`Could not read ${args.file}: ${err.message}`, {
40
+ code: 'AGENT_SPEC_READ_FAILED',
41
+ exit: 1,
42
+ });
43
+ }
44
+ const parsed = (0, agent_spec_1.parseAndValidateAgentSpec)(raw, args.file);
45
+ if (!parsed.ok) {
46
+ if (flags.json) {
47
+ this.log(JSON.stringify({ ok: false, issues: [{ code: 'AGENT_SPEC_NOT_JSON', message: parsed.message }] }, null, 2));
48
+ this.exit(1);
49
+ }
50
+ this.error(parsed.message, { code: 'AGENT_SPEC_NOT_JSON', exit: 1 });
51
+ }
52
+ const { validation } = parsed;
53
+ if (flags.json) {
54
+ this.log(JSON.stringify({ ok: validation.ok, issues: validation.issues }, null, 2));
55
+ if (!validation.ok)
56
+ this.exit(1);
57
+ return;
58
+ }
59
+ if (!validation.ok) {
60
+ this.error((0, agent_spec_1.issueBlock)(`${args.file} is not a valid agent spec (${validation.issues.length} issue(s)):`, validation.issues), { code: 'AGENT_SPEC_INVALID', exit: 1 });
61
+ }
62
+ const fields = Object.keys(validation.document.spec);
63
+ this.log(`${args.file} is a valid agent spec (${fields.length} field(s): ${fields.join(', ')}).`);
64
+ }
65
+ }
66
+ exports.default = AgentsValidate;
@@ -1,4 +1,15 @@
1
1
  import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * `--capability-rationale <permission-key>=<note>` → the publisher notes a
4
+ * release carries beside its capability manifest. Split on the FIRST `=`, so a
5
+ * note may contain one. A later entry for the same key replaces an earlier one.
6
+ * The server keeps only keys the release actually discloses and never refuses
7
+ * a release over them (D7), so this only checks the shape it can see.
8
+ */
9
+ export declare function parseCapabilityRationales(entries: readonly string[] | undefined): {
10
+ rationales?: Record<string, string>;
11
+ error?: string;
12
+ };
2
13
  export default class AgentsVisibility extends BaseCommand {
3
14
  static description: string;
4
15
  static examples: string[];
@@ -14,6 +25,8 @@ export default class AgentsVisibility extends BaseCommand {
14
25
  changelog: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
26
  'version-major': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
27
  'version-minor': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
28
+ 'capability-rationale': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
29
+ language: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
30
  };
18
31
  run(): Promise<void>;
19
32
  }
@@ -1,14 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCapabilityRationales = parseCapabilityRationales;
3
4
  const core_1 = require("@oclif/core");
4
5
  const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
7
+ /**
8
+ * `--capability-rationale <permission-key>=<note>` → the publisher notes a
9
+ * release carries beside its capability manifest. Split on the FIRST `=`, so a
10
+ * note may contain one. A later entry for the same key replaces an earlier one.
11
+ * The server keeps only keys the release actually discloses and never refuses
12
+ * a release over them (D7), so this only checks the shape it can see.
13
+ */
14
+ function parseCapabilityRationales(entries) {
15
+ if (!entries || entries.length === 0)
16
+ return {};
17
+ const rationales = {};
18
+ for (const entry of entries) {
19
+ const at = entry.indexOf('=');
20
+ const key = at > 0 ? entry.slice(0, at).trim() : '';
21
+ const note = at > 0 ? entry.slice(at + 1).trim() : '';
22
+ if (!key || !note) {
23
+ return {
24
+ error: `--capability-rationale expects <permission-key>=<note>, got "${entry}".`,
25
+ };
26
+ }
27
+ rationales[key] = note;
28
+ }
29
+ return { rationales };
30
+ }
6
31
  class AgentsVisibility extends base_command_1.BaseCommand {
7
- static description = 'Set the visibility of an agent (public or private)';
32
+ static description = 'Set the visibility of an agent (accounts with 2FA need recent step-up for public publishing)';
8
33
  static examples = [
9
34
  '<%= config.bin %> agents visibility <agent-id> --public',
35
+ '<%= config.bin %> step-up # required before public publishing when 2FA is enabled',
10
36
  '<%= config.bin %> agents visibility <agent-id> --private',
11
37
  '<%= config.bin %> agents visibility <agent-id> --public --json',
38
+ '<%= config.bin %> agents visibility <agent-id> --public --capability-rationale "network:*=Looks up flight prices on the web"',
39
+ '<%= config.bin %> agents visibility <agent-id> --public --language en --language zh-Hans',
12
40
  ];
13
41
  static args = {
14
42
  id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
@@ -23,7 +51,9 @@ class AgentsVisibility extends base_command_1.BaseCommand {
23
51
  description: 'Make the agent private',
24
52
  exclusive: ['public'],
25
53
  }),
26
- price: core_1.Flags.integer({ description: 'Price in token credits when publishing' }),
54
+ price: core_1.Flags.integer({
55
+ description: 'Listing price in micro-USD (1,000,000 = $1.00; the same unit the offer compares against)',
56
+ }),
27
57
  'share-mode': core_1.Flags.string({
28
58
  description: 'Published data sharing mode',
29
59
  options: ['none', 'bootstrap', 'memory', 'full'],
@@ -31,6 +61,17 @@ class AgentsVisibility extends base_command_1.BaseCommand {
31
61
  changelog: core_1.Flags.string({ description: 'Release changelog' }),
32
62
  'version-major': core_1.Flags.integer({ description: 'Explicit release major version' }),
33
63
  'version-minor': core_1.Flags.integer({ description: 'Explicit release minor version' }),
64
+ 'capability-rationale': core_1.Flags.string({
65
+ description: "A publisher note shown beside one entry of the release's capability manifest, as " +
66
+ '<permission-key>=<note>. Keys are spelled tool:…, connector:…, data:…, network:… or ' +
67
+ 'secret:… (for example network:* or connector:capability:*). Repeatable. A key the ' +
68
+ 'release does not disclose is dropped; a note never blocks publishing.',
69
+ multiple: true,
70
+ }),
71
+ language: core_1.Flags.string({
72
+ description: 'A language the release works in, as a BCP 47 tag such as en or zh-Hans (repeatable). Shown on the listing as declared by you; the platform does not check it.',
73
+ multiple: true,
74
+ }),
34
75
  };
35
76
  async run() {
36
77
  this.requireAuth();
@@ -39,6 +80,45 @@ class AgentsVisibility extends base_command_1.BaseCommand {
39
80
  this.error('Pass either --public or --private.', { exit: 1 });
40
81
  }
41
82
  const isPublic = flags.public === true;
83
+ const { rationales: capabilityRationales, error: rationaleError } = parseCapabilityRationales(flags['capability-rationale']);
84
+ if (rationaleError) {
85
+ this.error(rationaleError, { exit: 1 });
86
+ }
87
+ if (capabilityRationales && !isPublic) {
88
+ this.error('--capability-rationale applies only when publishing with --public.', {
89
+ exit: 1,
90
+ });
91
+ }
92
+ // The declaration is recorded on the public release a publish creates; an
93
+ // unpublish creates none, so the flag would have nothing to attach to.
94
+ if (flags.language?.length && !isPublic) {
95
+ this.error('--language declares the languages of a public release; pass it with --public.', {
96
+ exit: 1,
97
+ });
98
+ }
99
+ // A public release reaches buyers. Accounts with 2FA need a recent
100
+ // second-factor proof; accounts without 2FA can publish from a verified
101
+ // sign-in session. Read that state before the publish write so the
102
+ // remedy is visible in the normal CLI flow instead of only after a 403.
103
+ // The server remains authoritative: this is user guidance, not a bypass.
104
+ if (isPublic) {
105
+ let stepUp;
106
+ try {
107
+ stepUp = await data_provider_1.dataService.getStepUpStatus(data_provider_1.STORE_PUBLISH_STEP_UP_PURPOSE);
108
+ }
109
+ catch (err) {
110
+ this.handleApiError(err);
111
+ }
112
+ if (!stepUp.active) {
113
+ const bin = this.config.bin;
114
+ if (!stepUp.sessionBound) {
115
+ this.error(`This credential is not tied to a sign-in session. Run \`${bin} login\` before publishing, then \`${bin} step-up\` if your account has 2FA enabled.`, { code: 'STEP_UP_SESSION_UNBOUND', exit: 2 });
116
+ }
117
+ if (stepUp.methods.length > 0) {
118
+ this.error(`Public publishing needs a recent two-factor verification. Run \`${bin} step-up\`, then retry this command.`, { code: 'STEP_UP_PROOF_REQUIRED', exit: 2 });
119
+ }
120
+ }
121
+ }
42
122
  let result;
43
123
  try {
44
124
  result = await data_provider_1.dataService.setAgentVisibility({
@@ -49,6 +129,8 @@ class AgentsVisibility extends base_command_1.BaseCommand {
49
129
  changelog: flags.changelog,
50
130
  versionMajor: flags['version-major'],
51
131
  versionMinor: flags['version-minor'],
132
+ capabilityRationales,
133
+ supportedLanguages: flags.language,
52
134
  });
53
135
  }
54
136
  catch (err) {
@@ -0,0 +1,19 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce fees show` — the Marketplace fee schedule (OSK-12271).
4
+ *
5
+ * The seller share, the platform fee, the standard hold and the payout minimum
6
+ * are declared once on the server, and every surface that states one of them
7
+ * reads this same response. The schedule is what a publisher is QUOTED: a
8
+ * completed sale keeps the split its offer and ledger row recorded, whatever
9
+ * this says today.
10
+ */
11
+ export default class CommerceFeesShow extends BaseCommand {
12
+ static description: string;
13
+ static examples: string[];
14
+ static flags: {
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
@@ -0,0 +1,75 @@
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 commerce_1 = require("../../../lib/commerce");
7
+ function describeTerms(fees) {
8
+ return `seller ${(0, data_provider_1.formatMarketplaceBasisPoints)(fees.sellerShareBps)}, platform ${(0, data_provider_1.formatMarketplaceBasisPoints)(fees.platformFeeBps)}, held ${fees.holdDays} days`;
9
+ }
10
+ /**
11
+ * `skrr commerce fees show` — the Marketplace fee schedule (OSK-12271).
12
+ *
13
+ * The seller share, the platform fee, the standard hold and the payout minimum
14
+ * are declared once on the server, and every surface that states one of them
15
+ * reads this same response. The schedule is what a publisher is QUOTED: a
16
+ * completed sale keeps the split its offer and ledger row recorded, whatever
17
+ * this says today.
18
+ */
19
+ class CommerceFeesShow extends base_command_1.BaseCommand {
20
+ static description = 'Show the Marketplace fee schedule: seller share and hold per category, and the payout minimum.';
21
+ static examples = [
22
+ '<%= config.bin %> commerce fees show',
23
+ '<%= config.bin %> commerce fees show --json',
24
+ '<%= config.bin %> commerce fees show --version marketplace-fees.v1',
25
+ ];
26
+ static flags = {
27
+ json: core_1.Flags.boolean({ description: 'Output the full schedule as JSON' }),
28
+ version: core_1.Flags.string({
29
+ description: 'Read a named past schedule version instead of the current one',
30
+ }),
31
+ };
32
+ async run() {
33
+ this.requireAuth();
34
+ const { flags } = await this.parse(CommerceFeesShow);
35
+ let schedule;
36
+ try {
37
+ schedule = await (0, commerce_1.getMarketplaceFeeSchedule)(flags.version);
38
+ }
39
+ catch (error) {
40
+ this.handleApiError(error);
41
+ return;
42
+ }
43
+ if (flags.json) {
44
+ this.log(JSON.stringify(schedule, null, 2));
45
+ return;
46
+ }
47
+ this.log(`Fee schedule ${schedule.version} (${schedule.currency})`);
48
+ this.log(schedule.publisherTerms
49
+ ? `Presented under publisher terms ${schedule.publisherTerms.termsVersion}`
50
+ : 'No publisher terms are configured; this schedule is not bound to any.');
51
+ this.log('');
52
+ for (const [category, fees] of Object.entries(schedule.categories)) {
53
+ const kinds = Object.entries(schedule.listingCategories)
54
+ .filter(([, mapped]) => mapped === category)
55
+ .map(([kind]) => kind);
56
+ this.log(`${category}: ${describeTerms(fees)}`);
57
+ if (kinds.length > 0)
58
+ this.log(` quoted for: ${kinds.join(', ')}`);
59
+ }
60
+ this.log(`legacy (a sale with no versioned offer): ${describeTerms(schedule.legacy)}`);
61
+ this.log('');
62
+ this.log(`Payout: at least ${(0, data_provider_1.formatMarketplacePayoutMinimum)(schedule)}, ` +
63
+ `at most once every ${schedule.payout.cadenceDays} days`);
64
+ if (schedule.versions?.length) {
65
+ this.log('');
66
+ this.log('Versions:');
67
+ for (const v of schedule.versions) {
68
+ this.log(` ${v.version} — effective ${v.effectiveAt.slice(0, 10)}` +
69
+ `${v.current ? ' (current)' : ''}`);
70
+ }
71
+ }
72
+ this.log(`Content hash: ${schedule.contentHash}`);
73
+ }
74
+ }
75
+ exports.default = CommerceFeesShow;
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * `skrr earnings` — a publisher's balance and how it is paid out (OSK-12272).
4
+ *
5
+ * Read-only. Requesting a payout and turning automatic payouts on move money
6
+ * and refuse a daemon credential, so they live on the web Earnings page.
7
+ */
8
+ export default class Earnings extends BaseCommand {
9
+ static description: string;
10
+ static examples: string[];
11
+ static flags: {
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,46 @@
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 earnings_1 = require("../../lib/earnings");
6
+ /**
7
+ * `skrr earnings` — a publisher's balance and how it is paid out (OSK-12272).
8
+ *
9
+ * Read-only. Requesting a payout and turning automatic payouts on move money
10
+ * and refuse a daemon credential, so they live on the web Earnings page.
11
+ */
12
+ class Earnings extends base_command_1.BaseCommand {
13
+ static description = 'Show your publisher earnings: available and pending balance, payout window and automatic payouts (read-only). ' +
14
+ 'See `earnings statements` and `earnings payouts` for the history behind it.';
15
+ static examples = [
16
+ '<%= config.bin %> earnings',
17
+ '<%= config.bin %> earnings --json',
18
+ '<%= config.bin %> earnings statements',
19
+ '<%= config.bin %> earnings payouts',
20
+ ];
21
+ static flags = {
22
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
23
+ };
24
+ async run() {
25
+ this.requireAuth();
26
+ const { flags } = await this.parse(Earnings);
27
+ try {
28
+ const earnings = await (0, earnings_1.readEarnings)();
29
+ // Automatic payouts only mean something once payouts are set up; a
30
+ // publisher who has not onboarded gets the balance without them.
31
+ let autoPayout = null;
32
+ if (earnings.connectOnboarded) {
33
+ autoPayout = await (0, earnings_1.readAutoPayout)();
34
+ }
35
+ if (flags.json) {
36
+ this.log(JSON.stringify({ earnings, autoPayout }, null, 2));
37
+ return;
38
+ }
39
+ (0, earnings_1.renderEarningsSummary)(earnings, autoPayout, (line) => this.log(line));
40
+ }
41
+ catch (error) {
42
+ this.handleApiError(error, { subject: 'earnings' });
43
+ }
44
+ }
45
+ }
46
+ exports.default = Earnings;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** `skrr earnings payouts` — your payout history, newest first (OSK-12272). Read-only. */
3
+ export default class EarningsPayouts extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,39 @@
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 earnings_1 = require("../../lib/earnings");
6
+ /** `skrr earnings payouts` — your payout history, newest first (OSK-12272). Read-only. */
7
+ class EarningsPayouts extends base_command_1.BaseCommand {
8
+ static description = 'List your payouts, newest first: amount, status and when Stripe settled it';
9
+ static examples = [
10
+ '<%= config.bin %> earnings payouts',
11
+ '<%= config.bin %> earnings payouts --limit 50 --json',
12
+ ];
13
+ static flags = {
14
+ limit: core_1.Flags.integer({
15
+ description: 'Payouts per page (1-100)',
16
+ default: 20,
17
+ min: 1,
18
+ max: 100,
19
+ }),
20
+ cursor: core_1.Flags.string({ description: 'The last payout id of the previous page' }),
21
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
22
+ };
23
+ async run() {
24
+ this.requireAuth();
25
+ const { flags } = await this.parse(EarningsPayouts);
26
+ try {
27
+ const result = await (0, earnings_1.readPayouts)({ limit: flags.limit, cursor: flags.cursor });
28
+ if (flags.json) {
29
+ this.log(JSON.stringify(result, null, 2));
30
+ return;
31
+ }
32
+ (0, earnings_1.renderPayoutHistory)(result, (line) => this.log(line));
33
+ }
34
+ catch (error) {
35
+ this.handleApiError(error, { subject: 'payouts' });
36
+ }
37
+ }
38
+ }
39
+ exports.default = EarningsPayouts;
@@ -0,0 +1,19 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * `skrr earnings statements [YYYY-MM]` — monthly earnings statements
4
+ * (OSK-12272). Without a month, lists them newest first; with one, prints that
5
+ * month from opening balance to closing balance.
6
+ */
7
+ export default class EarningsStatements extends BaseCommand {
8
+ static description: string;
9
+ static examples: string[];
10
+ static args: {
11
+ period: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
12
+ };
13
+ static flags: {
14
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
@@ -0,0 +1,70 @@
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 earnings_1 = require("../../lib/earnings");
6
+ /**
7
+ * `skrr earnings statements [YYYY-MM]` — monthly earnings statements
8
+ * (OSK-12272). Without a month, lists them newest first; with one, prints that
9
+ * month from opening balance to closing balance.
10
+ */
11
+ class EarningsStatements extends base_command_1.BaseCommand {
12
+ static description = 'List your monthly earnings statements, or show one month (YYYY-MM, UTC) from opening to closing balance';
13
+ static examples = [
14
+ '<%= config.bin %> earnings statements',
15
+ '<%= config.bin %> earnings statements 2026-09',
16
+ '<%= config.bin %> earnings statements --limit 24 --json',
17
+ ];
18
+ static args = {
19
+ period: core_1.Args.string({
20
+ description: 'Month to show, as YYYY-MM (UTC)',
21
+ required: false,
22
+ ignoreStdin: true,
23
+ }),
24
+ };
25
+ static flags = {
26
+ limit: core_1.Flags.integer({
27
+ description: 'Statements per page (1-60)',
28
+ default: 12,
29
+ min: 1,
30
+ max: 60,
31
+ }),
32
+ cursor: core_1.Flags.string({ description: 'The last month of the previous page (YYYY-MM)' }),
33
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
34
+ };
35
+ async run() {
36
+ this.requireAuth();
37
+ const { args, flags } = await this.parse(EarningsStatements);
38
+ for (const [name, value] of [
39
+ ['month', args.period],
40
+ ['--cursor', flags.cursor],
41
+ ]) {
42
+ if (value !== undefined && !earnings_1.PERIOD_PATTERN.test(value)) {
43
+ this.error(`${name} must be a month as YYYY-MM, for example 2026-09.`, { exit: 2 });
44
+ }
45
+ }
46
+ try {
47
+ if (args.period) {
48
+ const statement = await (0, earnings_1.readStatement)(args.period);
49
+ if (flags.json) {
50
+ this.log(JSON.stringify(statement, null, 2));
51
+ return;
52
+ }
53
+ (0, earnings_1.renderStatement)(statement, (line) => this.log(line));
54
+ return;
55
+ }
56
+ const result = await (0, earnings_1.readStatements)({ limit: flags.limit, cursor: flags.cursor });
57
+ if (flags.json) {
58
+ this.log(JSON.stringify(result, null, 2));
59
+ return;
60
+ }
61
+ (0, earnings_1.renderStatementList)(result, (line) => this.log(line));
62
+ }
63
+ catch (error) {
64
+ this.handleApiError(error, {
65
+ subject: args.period ? `statement ${args.period}` : 'statements',
66
+ });
67
+ }
68
+ }
69
+ }
70
+ exports.default = EarningsStatements;
@@ -18,7 +18,7 @@ export default class GoalsKeyResultsCreate extends BaseCommand {
18
18
  title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
19
  description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
20
  progress: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
- 'progress-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ 'progress-mode': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
22
22
  status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
23
  order: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
24
  };