@skrr-ai/cli 0.1.47 → 0.1.49
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.
- package/README.md +1 -1
- package/dist/base-command.d.ts +18 -0
- package/dist/base-command.js +61 -1
- package/dist/commands/agent-worker.d.ts +12 -0
- package/dist/commands/agent-worker.js +140 -0
- package/dist/commands/agents/chat.d.ts +21 -0
- package/dist/commands/agents/chat.js +26 -9
- package/dist/commands/balance/usage/breakdown.d.ts +14 -0
- package/dist/commands/balance/usage/breakdown.js +68 -0
- package/dist/commands/balance/usage.js +24 -0
- package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
- package/dist/commands/commerce/entitlements/explain.js +40 -0
- package/dist/commands/commerce/incidents/audit.d.ts +20 -0
- package/dist/commands/commerce/incidents/audit.js +37 -0
- package/dist/commands/commerce/incidents/list.d.ts +22 -0
- package/dist/commands/commerce/incidents/list.js +49 -0
- package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
- package/dist/commands/commerce/incidents/resolve.js +45 -0
- package/dist/commands/commerce/incidents/retry.d.ts +22 -0
- package/dist/commands/commerce/incidents/retry.js +45 -0
- package/dist/commands/commerce/incidents/show.d.ts +13 -0
- package/dist/commands/commerce/incidents/show.js +30 -0
- package/dist/commands/commerce/offers/approve.d.ts +17 -0
- package/dist/commands/commerce/offers/approve.js +33 -0
- package/dist/commands/commerce/offers/create.d.ts +18 -0
- package/dist/commands/commerce/offers/create.js +34 -0
- package/dist/commands/commerce/offers/publish.d.ts +13 -0
- package/dist/commands/commerce/offers/publish.js +28 -0
- package/dist/commands/commerce/offers/retire.d.ts +17 -0
- package/dist/commands/commerce/offers/retire.js +32 -0
- package/dist/commands/commerce/offers/validate.d.ts +18 -0
- package/dist/commands/commerce/offers/validate.js +33 -0
- package/dist/commands/commerce/products/create.d.ts +10 -0
- package/dist/commands/commerce/products/create.js +25 -0
- package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
- package/dist/commands/commerce/promotions/redeem.js +32 -0
- package/dist/commands/commerce/terms/accept.d.ts +18 -0
- package/dist/commands/commerce/terms/accept.js +39 -0
- package/dist/commands/commerce/terms/show.d.ts +10 -0
- package/dist/commands/commerce/terms/show.js +34 -0
- package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
- package/dist/commands/commerce/trials/conversion-preview.js +39 -0
- package/dist/commands/commerce/trials/start.d.ts +23 -0
- package/dist/commands/commerce/trials/start.js +58 -0
- package/dist/commands/commitments/accounting.d.ts +39 -0
- package/dist/commands/commitments/accounting.js +116 -0
- package/dist/commands/commitments/action-history.d.ts +1 -0
- package/dist/commands/commitments/action-history.js +8 -1
- package/dist/commands/commitments/case.d.ts +1 -0
- package/dist/commands/commitments/case.js +19 -3
- package/dist/commands/commitments/cases.d.ts +1 -0
- package/dist/commands/commitments/cases.js +11 -1
- package/dist/commands/commitments/checks.d.ts +1 -0
- package/dist/commands/commitments/checks.js +5 -1
- package/dist/commands/commitments/cost.d.ts +62 -0
- package/dist/commands/commitments/cost.js +130 -0
- package/dist/commands/commitments/create.js +1 -1
- package/dist/commands/commitments/delete.d.ts +1 -0
- package/dist/commands/commitments/delete.js +56 -6
- package/dist/commands/commitments/feedback.js +9 -1
- package/dist/commands/commitments/handover.js +16 -0
- package/dist/commands/commitments/hypotheses.d.ts +1 -0
- package/dist/commands/commitments/hypotheses.js +17 -2
- package/dist/commands/commitments/links/list.js +4 -1
- package/dist/commands/commitments/liveness.d.ts +18 -0
- package/dist/commands/commitments/liveness.js +80 -0
- package/dist/commands/commitments/metrics.d.ts +1 -0
- package/dist/commands/commitments/metrics.js +8 -1
- package/dist/commands/commitments/next-tick.d.ts +39 -0
- package/dist/commands/commitments/next-tick.js +122 -0
- package/dist/commands/commitments/observations.d.ts +1 -0
- package/dist/commands/commitments/observations.js +19 -2
- package/dist/commands/commitments/pause.js +12 -0
- package/dist/commands/commitments/receipt.d.ts +2 -0
- package/dist/commands/commitments/receipt.js +16 -2
- package/dist/commands/commitments/remediation-proposal.js +6 -2
- package/dist/commands/commitments/remediation-proposals.js +5 -1
- package/dist/commands/commitments/restore.d.ts +25 -0
- package/dist/commands/commitments/restore.js +46 -0
- package/dist/commands/commitments/show.js +32 -0
- package/dist/commands/commitments/trigger-status.js +33 -0
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +31 -5
- package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
- package/dist/commands/commitments/wake-capabilities.js +8 -4
- package/dist/commands/enterprise/budgets/create.d.ts +11 -0
- package/dist/commands/enterprise/budgets/create.js +27 -0
- package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
- package/dist/commands/enterprise/budgets/evaluate.js +32 -0
- package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
- package/dist/commands/enterprise/budgets/publish.js +30 -0
- package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
- package/dist/commands/enterprise/contracts/activate.js +30 -0
- package/dist/commands/enterprise/contracts/create.d.ts +14 -0
- package/dist/commands/enterprise/contracts/create.js +32 -0
- package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
- package/dist/commands/enterprise/contracts/issue.js +34 -0
- package/dist/commands/enterprise/domains/begin.d.ts +20 -0
- package/dist/commands/enterprise/domains/begin.js +39 -0
- package/dist/commands/enterprise/domains/verify.d.ts +14 -0
- package/dist/commands/enterprise/domains/verify.js +32 -0
- package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
- package/dist/commands/enterprise/external-config/activate.js +49 -0
- package/dist/commands/enterprise/external-config/set.d.ts +25 -0
- package/dist/commands/enterprise/external-config/set.js +123 -0
- package/dist/commands/enterprise/external-config/show.d.ts +12 -0
- package/dist/commands/enterprise/external-config/show.js +39 -0
- package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
- package/dist/commands/enterprise/external-config/suspend.js +41 -0
- package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
- package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
- package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
- package/dist/commands/enterprise/finance/record-document.js +35 -0
- package/dist/commands/enterprise/profile.d.ts +20 -0
- package/dist/commands/enterprise/profile.js +38 -0
- package/dist/commands/login.d.ts +13 -0
- package/dist/commands/login.js +77 -0
- package/dist/commands/machines/dedicated/index.js +3 -0
- package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
- package/dist/commands/machines/dedicated/service/apply.js +99 -0
- package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
- package/dist/commands/machines/dedicated/service/approve.js +52 -0
- package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
- package/dist/commands/machines/dedicated/service/create.js +222 -0
- package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
- package/dist/commands/machines/dedicated/service/edit.js +146 -0
- package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
- package/dist/commands/machines/dedicated/service/exec.js +92 -0
- package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
- package/dist/commands/machines/dedicated/service/export.js +106 -0
- package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/index.js +49 -0
- package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
- package/dist/commands/machines/dedicated/service/logs.js +148 -0
- package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/ls.js +80 -0
- package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/restart.js +29 -0
- package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/rm.js +33 -0
- package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
- package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
- package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
- package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/start.js +29 -0
- package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
- package/dist/commands/machines/dedicated/service/status.js +85 -0
- package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/stop.js +35 -0
- package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/top.js +120 -0
- package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
- package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
- package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
- package/dist/commands/machines/dedicated/ssh-config.js +66 -0
- package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
- package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
- package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
- package/dist/commands/machines/dedicated/ssh.js +121 -0
- package/dist/commands/native/allow-all.d.ts +14 -0
- package/dist/commands/native/allow-all.js +25 -0
- package/dist/commands/native/allow.d.ts +24 -0
- package/dist/commands/native/allow.js +45 -0
- package/dist/commands/native/deny.d.ts +24 -0
- package/dist/commands/native/deny.js +43 -0
- package/dist/commands/native/disable.d.ts +17 -0
- package/dist/commands/native/disable.js +28 -0
- package/dist/commands/native/enable.d.ts +12 -0
- package/dist/commands/native/enable.js +29 -0
- package/dist/commands/native/list-apps.d.ts +19 -0
- package/dist/commands/native/list-apps.js +30 -0
- package/dist/commands/native/restrict-to.d.ts +22 -0
- package/dist/commands/native/restrict-to.js +41 -0
- package/dist/commands/native/status.d.ts +19 -0
- package/dist/commands/native/status.js +33 -0
- package/dist/commands/native.d.ts +39 -0
- package/dist/commands/native.js +76 -0
- package/dist/commands/service/index.d.ts +14 -0
- package/dist/commands/service/index.js +31 -0
- package/dist/commands/service/logs.d.ts +18 -0
- package/dist/commands/service/logs.js +53 -0
- package/dist/commands/service/ls.d.ts +13 -0
- package/dist/commands/service/ls.js +48 -0
- package/dist/commands/service/propose.d.ts +34 -0
- package/dist/commands/service/propose.js +113 -0
- package/dist/commands/service/status.d.ts +17 -0
- package/dist/commands/service/status.js +56 -0
- package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
- package/dist/commands/spaces/auto-executor/runs.js +56 -0
- package/dist/commands/store/governance/artifacts.d.ts +25 -0
- package/dist/commands/store/governance/artifacts.js +55 -0
- package/dist/commands/store/governance/assign.d.ts +16 -0
- package/dist/commands/store/governance/assign.js +54 -0
- package/dist/commands/store/governance/create-license.d.ts +18 -0
- package/dist/commands/store/governance/create-license.js +35 -0
- package/dist/commands/store/governance/install-plan.d.ts +25 -0
- package/dist/commands/store/governance/install-plan.js +56 -0
- package/dist/commands/store/governance/license-policy.d.ts +30 -0
- package/dist/commands/store/governance/license-policy.js +69 -0
- package/dist/commands/store/governance/policy.d.ts +25 -0
- package/dist/commands/store/governance/policy.js +65 -0
- package/dist/commands/store/governance/publish-release.d.ts +17 -0
- package/dist/commands/store/governance/publish-release.js +34 -0
- package/dist/commands/tasks/deliverable/add.d.ts +15 -0
- package/dist/commands/tasks/deliverable/add.js +174 -0
- package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
- package/dist/commands/tasks/deliverable/archive.js +205 -0
- package/dist/commands/tasks/labels/detach.js +3 -0
- package/dist/commands/tasks/labels/suggest.d.ts +24 -0
- package/dist/commands/tasks/labels/suggest.js +69 -0
- package/dist/commands/tasks/list.d.ts +16 -2
- package/dist/commands/tasks/list.js +100 -24
- package/dist/commands/tasks/show.d.ts +23 -0
- package/dist/commands/tasks/show.js +51 -1
- package/dist/commands/wiki/rm.d.ts +22 -1
- package/dist/commands/wiki/rm.js +52 -3
- package/dist/lib/agentic-stream.js +10 -2
- package/dist/lib/balance.d.ts +6 -1
- package/dist/lib/balance.js +15 -0
- package/dist/lib/commerce-command.d.ts +48 -0
- package/dist/lib/commerce-command.js +70 -0
- package/dist/lib/commerce.d.ts +93 -0
- package/dist/lib/commerce.js +129 -0
- package/dist/lib/commitment-product.js +1 -1
- package/dist/lib/commitments.d.ts +202 -29
- package/dist/lib/commitments.js +300 -33
- package/dist/lib/daemon-installer.d.ts +6 -5
- package/dist/lib/daemon-installer.js +4 -17
- package/dist/lib/dedicated-lease-command.js +10 -0
- package/dist/lib/dedicated-machines.d.ts +37 -0
- package/dist/lib/dedicated-machines.js +47 -0
- package/dist/lib/dedicated-service-command.d.ts +60 -0
- package/dist/lib/dedicated-service-command.js +182 -0
- package/dist/lib/dedicated-service.d.ts +342 -0
- package/dist/lib/dedicated-service.js +741 -0
- package/dist/lib/dedicated-ssh.d.ts +136 -0
- package/dist/lib/dedicated-ssh.js +387 -0
- package/dist/lib/delegated-cli.js +51 -13
- package/dist/lib/enterprise-commerce.d.ts +67 -0
- package/dist/lib/enterprise-commerce.js +112 -0
- package/dist/lib/enterprise-external-configuration.d.ts +60 -0
- package/dist/lib/enterprise-external-configuration.js +58 -0
- package/dist/lib/first-party-harness.js +17 -3
- package/dist/lib/governed-store.d.ts +110 -0
- package/dist/lib/governed-store.js +79 -0
- package/dist/lib/guest-service-command.d.ts +16 -0
- package/dist/lib/guest-service-command.js +32 -0
- package/dist/lib/guest-service.d.ts +67 -0
- package/dist/lib/guest-service.js +112 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +1 -0
- package/dist/lib/task-asset-upload.d.ts +20 -0
- package/dist/lib/task-asset-upload.js +30 -8
- package/dist/lib/task-extras.d.ts +23 -0
- package/dist/lib/task-extras.js +6 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +8 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.d.ts +38 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.js +66 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.d.ts +38 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.js +64 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5060 -4827
- package/oclif.manifest.json +35194 -29157
- package/package.json +43 -1
|
@@ -38,6 +38,9 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
|
|
|
38
38
|
description: 'Only readings the server judged a material change',
|
|
39
39
|
}),
|
|
40
40
|
since: core_1.Flags.string({ description: 'ISO date — only observations made after it' }),
|
|
41
|
+
cursor: core_1.Flags.string({
|
|
42
|
+
description: 'Continue from the next_cursor emitted by a previous page',
|
|
43
|
+
}),
|
|
41
44
|
};
|
|
42
45
|
async run() {
|
|
43
46
|
this.requireAuth();
|
|
@@ -49,6 +52,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
|
|
|
49
52
|
declaredOnly: flags['declared-only'] || undefined,
|
|
50
53
|
changedOnly: flags['changed-only'] || undefined,
|
|
51
54
|
since: flags.since,
|
|
55
|
+
cursor: flags.cursor,
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
58
|
catch (err) {
|
|
@@ -56,9 +60,22 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
|
|
|
56
60
|
}
|
|
57
61
|
if (flags.json) {
|
|
58
62
|
this.log(JSON.stringify(response, null, 2));
|
|
59
|
-
return;
|
|
60
63
|
}
|
|
61
|
-
|
|
64
|
+
else {
|
|
65
|
+
// "The commitment has none" and "your filter matched none" are different
|
|
66
|
+
// facts; a filter that empties the list must not claim the first
|
|
67
|
+
// (OSK-10953).
|
|
68
|
+
const filters = [
|
|
69
|
+
flags['declared-only'] ? '--declared-only' : null,
|
|
70
|
+
flags['changed-only'] ? '--changed-only' : null,
|
|
71
|
+
flags.since ? `--since ${flags.since}` : null,
|
|
72
|
+
].filter(Boolean);
|
|
73
|
+
const emptyMessage = filters.length
|
|
74
|
+
? `No observations match ${filters.join(' ')}.`
|
|
75
|
+
: 'No observations recorded.';
|
|
76
|
+
(0, commitments_1.renderCommitmentObservations)(response, (line) => this.log(line), { emptyMessage });
|
|
77
|
+
}
|
|
78
|
+
(0, commitments_1.renderListPageHint)(response, (line) => this.log(line));
|
|
62
79
|
}
|
|
63
80
|
}
|
|
64
81
|
exports.default = CommitmentsObservations;
|
|
@@ -30,6 +30,18 @@ class CommitmentsPause extends base_command_1.BaseCommand {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
this.log(`Paused commitment ${args.id}.`);
|
|
33
|
+
// The status write is the fence and it has landed. The teardown of the
|
|
34
|
+
// wake tree behind it is best-effort, and used to be silent — so a pause
|
|
35
|
+
// that left triggers live looked exactly like one that did not. Say which
|
|
36
|
+
// happened; a reconciler will converge the degraded case, but a person
|
|
37
|
+
// deciding whether they are really stopped should not have to assume it.
|
|
38
|
+
const teardown = commitment
|
|
39
|
+
.teardown;
|
|
40
|
+
if (teardown?.status === 'degraded') {
|
|
41
|
+
this.warn('The control loop is stopped, but some scheduled wakes may not have been retired yet. ' +
|
|
42
|
+
'They cannot run anything — every wake is refused while this Commitment is paused — ' +
|
|
43
|
+
`and the reconciler retries automatically. Check with: skrr commitments trigger-status ${args.id}`);
|
|
44
|
+
}
|
|
33
45
|
(0, commitments_1.renderCommitmentSummary)(commitment, (line) => this.log(line));
|
|
34
46
|
}
|
|
35
47
|
}
|
|
@@ -8,6 +8,8 @@ export default class CommitmentsReceipt extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
latest: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
check: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
run: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
13
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
14
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
15
|
};
|
|
@@ -6,11 +6,21 @@ const commitments_1 = require("../../lib/commitments");
|
|
|
6
6
|
const commitment_product_1 = require("../../lib/commitment-product");
|
|
7
7
|
class CommitmentsReceipt extends base_command_1.BaseCommand {
|
|
8
8
|
static description = 'Explain what happened from the event through work, delivery, and verification';
|
|
9
|
-
static examples = [
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> commitments receipt <id> --latest',
|
|
11
|
+
'<%= config.bin %> commitments receipt <id> --check objchk_abc',
|
|
12
|
+
'<%= config.bin %> commitments receipt <id> --run arun_abc',
|
|
13
|
+
];
|
|
10
14
|
static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
11
15
|
static flags = {
|
|
12
16
|
latest: core_1.Flags.boolean({ description: 'Show the latest wake (default)' }),
|
|
13
17
|
limit: core_1.Flags.integer({ description: 'Number of receipts to show', min: 1, max: 100 }),
|
|
18
|
+
check: core_1.Flags.string({
|
|
19
|
+
description: 'Explain one specific check — its exact receipt, not the latest-N window',
|
|
20
|
+
}),
|
|
21
|
+
run: core_1.Flags.string({
|
|
22
|
+
description: 'Explain the run — resolves to the receipt of the check that minted it',
|
|
23
|
+
}),
|
|
14
24
|
json: core_1.Flags.boolean({ description: 'Output projected receipts as JSON' }),
|
|
15
25
|
verbose: core_1.Flags.boolean({ description: 'Include source IDs and diagnostic traces' }),
|
|
16
26
|
};
|
|
@@ -18,7 +28,11 @@ class CommitmentsReceipt extends base_command_1.BaseCommand {
|
|
|
18
28
|
this.requireAuth();
|
|
19
29
|
const { args, flags } = await this.parse(CommitmentsReceipt);
|
|
20
30
|
try {
|
|
21
|
-
const result = await commitments_1.commitmentApi.receipts(args.id,
|
|
31
|
+
const result = await commitments_1.commitmentApi.receipts(args.id, {
|
|
32
|
+
limit: flags.latest ? 1 : flags.limit || 1,
|
|
33
|
+
checkId: flags.check,
|
|
34
|
+
runId: flags.run,
|
|
35
|
+
});
|
|
22
36
|
if (flags.json)
|
|
23
37
|
return this.log(JSON.stringify(result, null, 2));
|
|
24
38
|
if (!result.receipts.length)
|
|
@@ -12,7 +12,7 @@ class CommitmentsRemediationProposal extends base_command_1.BaseCommand {
|
|
|
12
12
|
static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
|
|
13
13
|
async run() {
|
|
14
14
|
this.requireAuth();
|
|
15
|
-
const { args } = await this.parse(CommitmentsRemediationProposal);
|
|
15
|
+
const { args, flags } = await this.parse(CommitmentsRemediationProposal);
|
|
16
16
|
let result;
|
|
17
17
|
try {
|
|
18
18
|
result = await commitments_1.commitmentApi.remediationProposal(args.commitmentId, args.proposalId);
|
|
@@ -20,7 +20,11 @@ class CommitmentsRemediationProposal extends base_command_1.BaseCommand {
|
|
|
20
20
|
catch (error) {
|
|
21
21
|
this.handleApiError(error);
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
if (flags.json) {
|
|
24
|
+
this.log(JSON.stringify(result, null, 2));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
(0, commitments_1.renderCommitmentRemediationProposal)(result, (line) => this.log(line));
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
exports.default = CommitmentsRemediationProposal;
|
|
@@ -28,7 +28,11 @@ class CommitmentsRemediationProposals extends base_command_1.BaseCommand {
|
|
|
28
28
|
catch (error) {
|
|
29
29
|
this.handleApiError(error);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
if (flags.json) {
|
|
32
|
+
this.log(JSON.stringify(result, null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
(0, commitments_1.renderCommitmentRemediationProposals)(result, (line) => this.log(line));
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
exports.default = CommitmentsRemediationProposals;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr commitments restore <id>` — bring back a deleted commitment.
|
|
4
|
+
*
|
|
5
|
+
* Deleting is a soft tombstone, so the row and its whole history were always
|
|
6
|
+
* still there; until now there was simply no way for anyone to reach them
|
|
7
|
+
* again, which is the storage cost of a recoverable delete with none of the
|
|
8
|
+
* benefit.
|
|
9
|
+
*
|
|
10
|
+
* It comes back PAUSED, never active. Restoring the record and re-granting the
|
|
11
|
+
* authority to act are two decisions, and the second still has to pass the
|
|
12
|
+
* activation preflight — so a restore can never quietly put an agent back to
|
|
13
|
+
* work.
|
|
14
|
+
*/
|
|
15
|
+
export default class CommitmentsRestore extends BaseCommand {
|
|
16
|
+
static description: string;
|
|
17
|
+
static examples: string[];
|
|
18
|
+
static args: {
|
|
19
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
20
|
+
};
|
|
21
|
+
static flags: {
|
|
22
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
};
|
|
24
|
+
run(): Promise<void>;
|
|
25
|
+
}
|
|
@@ -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 web_url_1 = require("../../lib/web-url");
|
|
6
|
+
const commitments_1 = require("../../lib/commitments");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr commitments restore <id>` — bring back a deleted commitment.
|
|
9
|
+
*
|
|
10
|
+
* Deleting is a soft tombstone, so the row and its whole history were always
|
|
11
|
+
* still there; until now there was simply no way for anyone to reach them
|
|
12
|
+
* again, which is the storage cost of a recoverable delete with none of the
|
|
13
|
+
* benefit.
|
|
14
|
+
*
|
|
15
|
+
* It comes back PAUSED, never active. Restoring the record and re-granting the
|
|
16
|
+
* authority to act are two decisions, and the second still has to pass the
|
|
17
|
+
* activation preflight — so a restore can never quietly put an agent back to
|
|
18
|
+
* work.
|
|
19
|
+
*/
|
|
20
|
+
class CommitmentsRestore extends base_command_1.BaseCommand {
|
|
21
|
+
static description = 'Restore a deleted commitment (it comes back paused — resume it separately)';
|
|
22
|
+
static examples = ['<%= config.bin %> commitments restore <commitment-id>'];
|
|
23
|
+
static args = {
|
|
24
|
+
id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
|
|
25
|
+
};
|
|
26
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
|
|
27
|
+
async run() {
|
|
28
|
+
this.requireAuth();
|
|
29
|
+
const { args, flags } = await this.parse(CommitmentsRestore);
|
|
30
|
+
let commitment;
|
|
31
|
+
try {
|
|
32
|
+
commitment = await commitments_1.commitmentApi.restore(args.id);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
if (flags.json) {
|
|
38
|
+
this.log(JSON.stringify((0, web_url_1.withCommitmentUrl)(this.cliConfig.baseURL, commitment), null, 2));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.log(`Restored commitment ${args.id}. It is paused.`);
|
|
42
|
+
this.log(` Start it again with: skrr commitments resume ${args.id}`);
|
|
43
|
+
(0, commitments_1.renderCommitmentSummary)(commitment, (line) => this.log(line));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = CommitmentsRestore;
|
|
@@ -50,6 +50,38 @@ class CommitmentsShow extends base_command_1.BaseCommand {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
(0, commitments_1.renderCommitmentSummary)(response.commitment, (line) => this.log(line), response.latestCheck);
|
|
53
|
+
// `show` is the first surface a person reaches after linking something, and
|
|
54
|
+
// it used to render only watchedSources — a freshly linked goal or task was
|
|
55
|
+
// invisible until you knew to run `links list` (OSK-10963).
|
|
56
|
+
try {
|
|
57
|
+
const links = await commitments_1.commitmentApi.workLinks(args.id);
|
|
58
|
+
const active = (links.data || []).filter((link) => link.status === 'active');
|
|
59
|
+
if (active.length) {
|
|
60
|
+
this.log('Links:');
|
|
61
|
+
for (const link of active) {
|
|
62
|
+
const roles = Array.isArray(link.roles) ? link.roles.join(', ') : '';
|
|
63
|
+
this.log(` - ${link.targetType}:${link.targetId}${roles ? ` (${roles})` : ''}${link.isDelivery ? ' · delivery' : ''}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// The header still stands on its own when the links read is unavailable.
|
|
69
|
+
}
|
|
70
|
+
// `goals link` writes goal.commitmentId — an edge that lives on the GOAL,
|
|
71
|
+
// so `links list` can never see it. The lineage projection aggregates both
|
|
72
|
+
// link models; without it, a goal the commitment visibly advances is
|
|
73
|
+
// unrenderable from its own headline view (OSK-10963).
|
|
74
|
+
try {
|
|
75
|
+
const lineage = await commitments_1.commitmentApi.workLineage(args.id, 50);
|
|
76
|
+
const hasAny = ['goals', 'tasks', 'runs'].some((key) => Array.isArray(lineage?.[key]) && lineage[key].length > 0);
|
|
77
|
+
if (hasAny) {
|
|
78
|
+
this.log('');
|
|
79
|
+
(0, commitments_1.renderCommitmentLineage)(lineage, (line) => this.log(line));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Lineage is a hint on the headline view, not load-bearing.
|
|
84
|
+
}
|
|
53
85
|
try {
|
|
54
86
|
const receipts = await commitments_1.commitmentApi.receipts(args.id, 1);
|
|
55
87
|
if (receipts.receipts[0]) {
|
|
@@ -62,6 +62,25 @@ function formatTriggerStatus(status) {
|
|
|
62
62
|
const lines = [];
|
|
63
63
|
const commitmentId = String(status.commitmentId ?? '-');
|
|
64
64
|
lines.push(`Trigger status for ${commitmentId} (plan generation ${String(status.planGeneration ?? '-')})`);
|
|
65
|
+
// OSK-10961: the one-word answer an operator came for — did the plan
|
|
66
|
+
// materialize. Absent on older servers; only rendered when present.
|
|
67
|
+
const convergence = status.convergence;
|
|
68
|
+
if (convergence?.verdict) {
|
|
69
|
+
lines.push(`Convergence: ${String(convergence.verdict).toUpperCase()}`);
|
|
70
|
+
for (const item of convergence.divergent ?? []) {
|
|
71
|
+
lines.push(` - ${item.id ?? '-'} [${String(item.state ?? 'unknown').toUpperCase()}]` +
|
|
72
|
+
(item.reason ? ` — ${item.reason}` : ''));
|
|
73
|
+
}
|
|
74
|
+
// OSK-10943: spent once-wakes and resolver-disabled orphans stay counted
|
|
75
|
+
// but no longer drown the live binding list.
|
|
76
|
+
const retired = convergence.retired;
|
|
77
|
+
if (retired && Number(retired.triggers) > 0) {
|
|
78
|
+
lines.push(` retired residue: ${Number(retired.triggers)} spent trigger` +
|
|
79
|
+
`${Number(retired.triggers) === 1 ? '' : 's'} across ` +
|
|
80
|
+
`${Number(retired.bindings)} binding${Number(retired.bindings) === 1 ? '' : 's'} ` +
|
|
81
|
+
'(fired or disabled — cannot wake this commitment)');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
65
84
|
const bindings = Array.isArray(status.bindings) ? status.bindings : [];
|
|
66
85
|
lines.push('');
|
|
67
86
|
if (bindings.length === 0) {
|
|
@@ -91,6 +110,20 @@ function formatTriggerStatus(status) {
|
|
|
91
110
|
lines.push(` configured sources: ${(caps.configuredSources ?? []).join(', ') || 'none'}`);
|
|
92
111
|
lines.push(` eligible sources: ${(caps.eligibleSources ?? []).join(', ') || 'none'}`);
|
|
93
112
|
lines.push(` materialized sources: ${(caps.materializedSources ?? []).join(', ') || 'none'}`);
|
|
113
|
+
if ((caps.dormantSources ?? []).length) {
|
|
114
|
+
lines.push(` dormant sources: ${caps.dormantSources.join(', ')} (configured but the cadence never requests them)`);
|
|
115
|
+
}
|
|
116
|
+
if ((caps.unroutableSources ?? []).length) {
|
|
117
|
+
lines.push(` unroutable sources: ${caps
|
|
118
|
+
.unroutableSources.map((item) => `${item.source} (${item.reason})`)
|
|
119
|
+
.join(', ')} — materialized but no upstream producer can deliver events`);
|
|
120
|
+
}
|
|
121
|
+
if ((caps.permissionGaps ?? []).length) {
|
|
122
|
+
lines.push(` permission gaps: ${caps
|
|
123
|
+
.permissionGaps.map((gap) => `${gap.source} ${gap.capability ?? gap.permission}` +
|
|
124
|
+
` (${gap.impact === 'evidence_read' ? 'needed by' : 'blocks'} ${(gap.events ?? []).join(', ')})`)
|
|
125
|
+
.join('; ')} — the routing GitHub installation does not hold the permission`);
|
|
126
|
+
}
|
|
94
127
|
if (caps.degradedReason)
|
|
95
128
|
lines.push(` degraded: ${caps.degradedReason}`);
|
|
96
129
|
const recent = (status.recent ?? {});
|
|
@@ -27,6 +27,7 @@ export default class CommitmentsUpdate extends BaseCommand {
|
|
|
27
27
|
};
|
|
28
28
|
static flags: {
|
|
29
29
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
30
|
+
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
30
31
|
'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
31
32
|
'if-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
32
33
|
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
5
|
-
const web_url_1 = require("../../lib/web-url");
|
|
6
6
|
const prompt_1 = require("../../lib/prompt");
|
|
7
|
+
const web_url_1 = require("../../lib/web-url");
|
|
8
|
+
const prompt_2 = require("../../lib/prompt");
|
|
7
9
|
const triggers_1 = require("../../lib/triggers");
|
|
8
10
|
const commitments_1 = require("../../lib/commitments");
|
|
9
11
|
/**
|
|
@@ -40,6 +42,10 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
|
|
|
40
42
|
};
|
|
41
43
|
static flags = {
|
|
42
44
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
45
|
+
yes: core_1.Flags.boolean({
|
|
46
|
+
char: 'y',
|
|
47
|
+
description: 'Skip the confirmation prompt for an irreversible status change',
|
|
48
|
+
}),
|
|
43
49
|
'from-json': core_1.Flags.string({
|
|
44
50
|
description: 'Path to a JSON file (or "-" for stdin) for fields not exposed as flags',
|
|
45
51
|
}),
|
|
@@ -143,7 +149,7 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
|
|
|
143
149
|
}
|
|
144
150
|
let payload;
|
|
145
151
|
try {
|
|
146
|
-
payload = await (0,
|
|
152
|
+
payload = await (0, prompt_2.readJsonBody)(flags['from-json']);
|
|
147
153
|
if (flags['if-version'] !== undefined)
|
|
148
154
|
payload.expectedVersion = flags['if-version'];
|
|
149
155
|
if (flags.title)
|
|
@@ -156,8 +162,30 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
|
|
|
156
162
|
});
|
|
157
163
|
if (agentDirective !== undefined)
|
|
158
164
|
payload.agentDirective = agentDirective;
|
|
159
|
-
if (flags.status)
|
|
165
|
+
if (flags.status) {
|
|
166
|
+
// `completed` and `cancelled` END the Commitment: `active` is not
|
|
167
|
+
// reachable from either in one step. They were settable through this
|
|
168
|
+
// generic PATCH with no ceremony at all, while `commitments delete` —
|
|
169
|
+
// whose data is all still on disk, and which is now restorable —
|
|
170
|
+
// prompts. Ceremony should track how hard something is to undo.
|
|
171
|
+
if ((0, data_provider_1.isTerminalCommitmentStatus)(flags.status)) {
|
|
172
|
+
let confirmed;
|
|
173
|
+
try {
|
|
174
|
+
confirmed = await (0, prompt_1.confirmDestructive)(`Set ${args.id} to ${flags.status}? This ends the Commitment — making it active again means archiving it first, then resuming.`, flags.yes);
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
if (err.exit === 7) {
|
|
178
|
+
this.error(err.message, { exit: 7 });
|
|
179
|
+
}
|
|
180
|
+
throw err;
|
|
181
|
+
}
|
|
182
|
+
if (!confirmed) {
|
|
183
|
+
this.log('Cancelled.');
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
160
187
|
payload.status = flags.status;
|
|
188
|
+
}
|
|
161
189
|
if (wantsTarget) {
|
|
162
190
|
const existing = current?.target ?? {};
|
|
163
191
|
const outcome = flags.outcome ?? existing.outcome;
|
|
@@ -212,8 +240,6 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
|
|
|
212
240
|
cadence.intervalMs = existing.intervalMs;
|
|
213
241
|
if (existing.timezone)
|
|
214
242
|
cadence.timezone = existing.timezone;
|
|
215
|
-
if (existing.nextCheckAt)
|
|
216
|
-
cadence.nextCheckAt = existing.nextCheckAt;
|
|
217
243
|
if (flags.cadence) {
|
|
218
244
|
cadence.intervalMs = (0, commitments_1.parseIntervalToMs)(flags.cadence);
|
|
219
245
|
// Setting an interval on a manual commitment implies interval mode.
|
|
@@ -13,7 +13,6 @@ export declare function wakePolicyHeadline(result: {
|
|
|
13
13
|
* misconfiguration. Showing only one list would make those indistinguishable.
|
|
14
14
|
*/
|
|
15
15
|
export default class CommitmentsWakeCapabilities extends BaseCommand {
|
|
16
|
-
static hidden: boolean;
|
|
17
16
|
static description: string;
|
|
18
17
|
static examples: string[];
|
|
19
18
|
static args: {
|
|
@@ -8,7 +8,12 @@ const format_1 = require("../../lib/format");
|
|
|
8
8
|
function wakePolicyHeadline(result) {
|
|
9
9
|
return result.workPromotionModel === 'monitor_prepare_execute_v1'
|
|
10
10
|
? 'Wake behavior: configured Commitment sources may wake it automatically; there is no separate permission level.'
|
|
11
|
-
: '
|
|
11
|
+
: // The Commitment's Monitor/Prepare/Execute mode is a different field —
|
|
12
|
+
// this policy predates the current wake contract, which is why a
|
|
13
|
+
// Commitment already in `execute` mode can still carry the legacy
|
|
14
|
+
// marker. Naming the field avoids the "migrate to what it already is"
|
|
15
|
+
// contradiction.
|
|
16
|
+
'Wake behavior: this Commitment predates the current wake contract and runs the compatibility policy. Re-saving its mode (Monitor, Prepare, or Execute) stamps the current policy.';
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
|
|
@@ -21,9 +26,8 @@ function wakePolicyHeadline(result) {
|
|
|
21
26
|
* misconfiguration. Showing only one list would make those indistinguishable.
|
|
22
27
|
*/
|
|
23
28
|
class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
static hidden = true;
|
|
29
|
+
// A working command an operator cannot discover is an observability gap, not
|
|
30
|
+
// a product simplification — surfaced by dogfood (OSK-10941).
|
|
27
31
|
static description = 'Inspect configured wake-source diagnostics for a commitment';
|
|
28
32
|
static examples = [
|
|
29
33
|
'<%= config.bin %> commitments wake-capabilities obj_abc123',
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** A draft policy. It constrains nothing until it is published. */
|
|
3
|
+
export default class EnterpriseBudgetsCreate extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_command_1 = require("../../../base-command");
|
|
4
|
+
const enterprise_commerce_1 = require("../../../lib/enterprise-commerce");
|
|
5
|
+
const commerce_command_1 = require("../../../lib/commerce-command");
|
|
6
|
+
/** A draft policy. It constrains nothing until it is published. */
|
|
7
|
+
class EnterpriseBudgetsCreate extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Draft a hierarchical budget policy (admin). It constrains nothing until published.';
|
|
9
|
+
static examples = ['<%= config.bin %> enterprise budgets create --file ./budget.json'];
|
|
10
|
+
static flags = { ...commerce_command_1.jsonBodyFlags };
|
|
11
|
+
async run() {
|
|
12
|
+
this.requireAuth();
|
|
13
|
+
const { flags } = await this.parse(EnterpriseBudgetsCreate);
|
|
14
|
+
const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
|
|
15
|
+
let result;
|
|
16
|
+
try {
|
|
17
|
+
result = await (0, enterprise_commerce_1.createEnterpriseBudget)(body);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
this.handleApiError(error);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.log(JSON.stringify(result, null, 2));
|
|
24
|
+
this.log('\nDraft only. Next: `enterprise budgets publish <policy-id>`.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = EnterpriseBudgetsCreate;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* A read shaped like a write: POST, changes nothing.
|
|
4
|
+
*
|
|
5
|
+
* Worth having as its own verb because it is the only budget command that is
|
|
6
|
+
* safe to run whenever you are unsure — it answers what the published
|
|
7
|
+
* policies WOULD do to a hypothetical charge, without anyone being charged.
|
|
8
|
+
*/
|
|
9
|
+
export default class EnterpriseBudgetsEvaluate extends BaseCommand {
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
12
|
+
static flags: {
|
|
13
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_command_1 = require("../../../base-command");
|
|
4
|
+
const enterprise_commerce_1 = require("../../../lib/enterprise-commerce");
|
|
5
|
+
const commerce_command_1 = require("../../../lib/commerce-command");
|
|
6
|
+
/**
|
|
7
|
+
* A read shaped like a write: POST, changes nothing.
|
|
8
|
+
*
|
|
9
|
+
* Worth having as its own verb because it is the only budget command that is
|
|
10
|
+
* safe to run whenever you are unsure — it answers what the published
|
|
11
|
+
* policies WOULD do to a hypothetical charge, without anyone being charged.
|
|
12
|
+
*/
|
|
13
|
+
class EnterpriseBudgetsEvaluate extends base_command_1.BaseCommand {
|
|
14
|
+
static description = 'Ask what the published budget policies would do to a hypothetical charge (admin). Changes nothing.';
|
|
15
|
+
static examples = ['<%= config.bin %> enterprise budgets evaluate --file ./charge.json'];
|
|
16
|
+
static flags = { ...commerce_command_1.jsonBodyFlags };
|
|
17
|
+
async run() {
|
|
18
|
+
this.requireAuth();
|
|
19
|
+
const { flags } = await this.parse(EnterpriseBudgetsEvaluate);
|
|
20
|
+
const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
|
|
21
|
+
let result;
|
|
22
|
+
try {
|
|
23
|
+
result = await (0, enterprise_commerce_1.evaluateEnterpriseBudget)(body);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.handleApiError(error);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.log(JSON.stringify(result, null, 2));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = EnterpriseBudgetsEvaluate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** From here the policy starts refusing spend. Run `evaluate` first if unsure. */
|
|
3
|
+
export default class EnterpriseBudgetsPublish extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
policy: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 enterprise_commerce_1 = require("../../../lib/enterprise-commerce");
|
|
6
|
+
const commerce_command_1 = require("../../../lib/commerce-command");
|
|
7
|
+
/** From here the policy starts refusing spend. Run `evaluate` first if unsure. */
|
|
8
|
+
class EnterpriseBudgetsPublish extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Publish a budget policy (admin) — from here it constrains real spend. `enterprise budgets evaluate` answers what it would do, first.';
|
|
10
|
+
static examples = ['<%= config.bin %> enterprise budgets publish <policy-id>'];
|
|
11
|
+
static args = {
|
|
12
|
+
policy: core_1.Args.string({ description: 'Budget policy id', required: true, ignoreStdin: true }),
|
|
13
|
+
};
|
|
14
|
+
static flags = { ...commerce_command_1.jsonBodyFlags };
|
|
15
|
+
async run() {
|
|
16
|
+
this.requireAuth();
|
|
17
|
+
const { args, flags } = await this.parse(EnterpriseBudgetsPublish);
|
|
18
|
+
const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file, { required: false });
|
|
19
|
+
let result;
|
|
20
|
+
try {
|
|
21
|
+
result = await (0, enterprise_commerce_1.publishEnterpriseBudget)(args.policy, body);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
this.handleApiError(error);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.log(JSON.stringify(result, null, 2));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = EnterpriseBudgetsPublish;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** The step that starts billing. Named plainly for that reason. */
|
|
3
|
+
export default class EnterpriseContractsActivate extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
contract: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 enterprise_commerce_1 = require("../../../lib/enterprise-commerce");
|
|
6
|
+
const commerce_command_1 = require("../../../lib/commerce-command");
|
|
7
|
+
/** The step that starts billing. Named plainly for that reason. */
|
|
8
|
+
class EnterpriseContractsActivate extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Activate an issued contract (admin). From here it bills.';
|
|
10
|
+
static examples = ['<%= config.bin %> enterprise contracts activate <contract-id>'];
|
|
11
|
+
static args = {
|
|
12
|
+
contract: core_1.Args.string({ description: 'Contract id', required: true, ignoreStdin: true }),
|
|
13
|
+
};
|
|
14
|
+
static flags = { ...commerce_command_1.jsonBodyFlags };
|
|
15
|
+
async run() {
|
|
16
|
+
this.requireAuth();
|
|
17
|
+
const { args, flags } = await this.parse(EnterpriseContractsActivate);
|
|
18
|
+
const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file, { required: false });
|
|
19
|
+
let result;
|
|
20
|
+
try {
|
|
21
|
+
result = await (0, enterprise_commerce_1.activateEnterpriseContract)(args.contract, body);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
this.handleApiError(error);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.log(JSON.stringify(result, null, 2));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = EnterpriseContractsActivate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Draft a commercial contract. Nothing external happens here and nothing bills
|
|
4
|
+
* — `issue` reaches Stripe, `activate` starts the money.
|
|
5
|
+
*/
|
|
6
|
+
export default class EnterpriseContractsCreate extends BaseCommand {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|