@skrr-ai/cli 0.1.46 → 0.1.48
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/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/code/handover.d.ts +2 -2
- package/dist/commands/code/handover.js +12 -13
- package/dist/commands/code/install.js +31 -0
- package/dist/commands/code/update.d.ts +46 -0
- package/dist/commands/code/update.js +242 -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/convos/handover.d.ts +1 -0
- package/dist/commands/convos/handover.js +4 -0
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/update.d.ts +19 -0
- package/dist/commands/daemon/update.js +48 -0
- 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/spaces/briefs/get.js +8 -0
- package/dist/commands/spaces/briefs/list.js +2 -0
- package/dist/commands/spaces/briefs/set.d.ts +3 -0
- package/dist/commands/spaces/briefs/set.js +78 -13
- package/dist/commands/spaces/expertise-suggestions.d.ts +12 -0
- package/dist/commands/spaces/expertise-suggestions.js +71 -0
- package/dist/commands/spaces/members/add.d.ts +1 -0
- package/dist/commands/spaces/members/add.js +11 -3
- package/dist/commands/spaces/members/list.js +11 -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/assign.d.ts +9 -0
- package/dist/commands/tasks/assign.js +108 -1
- 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/assignee-resolver.d.ts +22 -0
- package/dist/lib/assignee-resolver.js +26 -0
- package/dist/lib/balance.d.ts +6 -1
- package/dist/lib/balance.js +15 -0
- package/dist/lib/code-handover.d.ts +0 -10
- package/dist/lib/code-handover.js +20 -5
- 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/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/lib/update-check.d.ts +80 -7
- package/dist/lib/update-check.js +365 -33
- 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 +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +6 -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/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 +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- 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/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 +5067 -4821
- package/oclif.manifest.json +34877 -28659
- package/package.json +43 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/api/commerce/admin/enterprise/*` — the enterprise half of the commerce
|
|
3
|
+
* control plane: workspace profiles, domain verification, commercial
|
|
4
|
+
* contracts, budget policies, financial documents and finance-close snapshots.
|
|
5
|
+
*
|
|
6
|
+
* It lives under the `/api/commerce` mount and under the `skrr enterprise`
|
|
7
|
+
* TOPIC, and that is deliberate. A mount is where the server happened to put a
|
|
8
|
+
* router; a topic is what an operator is trying to do. Somebody administering
|
|
9
|
+
* an enterprise deployment wants its contracts, budgets and audit export in
|
|
10
|
+
* one place, and does not know or care that one of them is served from a
|
|
11
|
+
* different router than the others.
|
|
12
|
+
*
|
|
13
|
+
* Every route is written out at its own call site rather than composed from a
|
|
14
|
+
* builder: the parity checker reads a LITERAL there and deliberately refuses a
|
|
15
|
+
* composed path. Bodies are passed through and validated by the server, so the
|
|
16
|
+
* CLI never becomes a second declaration of a contract or budget shape.
|
|
17
|
+
*/
|
|
18
|
+
/** `PUT /workspaces/:workspaceId/profile` — the enterprise profile itself. */
|
|
19
|
+
export declare function upsertEnterpriseProfile(workspaceId: string, body: Record<string, unknown>): Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* `POST /workspaces/:workspaceId/domains/begin` — start proving a domain.
|
|
22
|
+
*
|
|
23
|
+
* Two calls, not one, and the gap between them is the point: `begin` hands
|
|
24
|
+
* back a challenge you have to publish somewhere you control, and `verify`
|
|
25
|
+
* goes and looks. A single command that did both would either block on DNS or
|
|
26
|
+
* report a request as a result.
|
|
27
|
+
*/
|
|
28
|
+
export declare function beginEnterpriseDomainVerification(workspaceId: string, body: Record<string, unknown>): Promise<unknown>;
|
|
29
|
+
/** `POST /workspaces/:workspaceId/domains/verify` — check the published challenge. */
|
|
30
|
+
export declare function verifyEnterpriseDomain(workspaceId: string, body: Record<string, unknown>): Promise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* The contract lifecycle: create → issue (mints it with Stripe) → activate.
|
|
33
|
+
*
|
|
34
|
+
* Three doors, because `issue` is the one that reaches an external provider
|
|
35
|
+
* and `activate` is the one that starts billing. Collapsing them into a
|
|
36
|
+
* `--state` flag would hide which of those a command is about to do.
|
|
37
|
+
*/
|
|
38
|
+
/** `POST /contracts` — draft a commercial contract. */
|
|
39
|
+
export declare function createEnterpriseContract(body: Record<string, unknown>): Promise<unknown>;
|
|
40
|
+
/** `POST /contracts/:contractId/issue` — mint it with Stripe. Reaches a provider. */
|
|
41
|
+
export declare function issueEnterpriseContract(contractId: string, body?: Record<string, unknown>): Promise<unknown>;
|
|
42
|
+
/** `POST /contracts/:contractId/activate` — it starts billing. */
|
|
43
|
+
export declare function activateEnterpriseContract(contractId: string, body?: Record<string, unknown>): Promise<unknown>;
|
|
44
|
+
/** `POST /budgets` — draft a hierarchical budget policy. */
|
|
45
|
+
export declare function createEnterpriseBudget(body: Record<string, unknown>): Promise<unknown>;
|
|
46
|
+
/** `POST /budgets/:policyId/publish` — it starts constraining spend. */
|
|
47
|
+
export declare function publishEnterpriseBudget(policyId: string, body?: Record<string, unknown>): Promise<unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* `POST /budgets/evaluate` — what would this spend do, against the published
|
|
50
|
+
* policies?
|
|
51
|
+
*
|
|
52
|
+
* A read shaped like a write: it changes nothing and answers a question about
|
|
53
|
+
* a hypothetical charge, which is why it is the one budget verb safe to run
|
|
54
|
+
* whenever you are unsure.
|
|
55
|
+
*/
|
|
56
|
+
export declare function evaluateEnterpriseBudget(body: Record<string, unknown>): Promise<unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* `POST /financial-documents/manual` — record a document the platform did not
|
|
59
|
+
* generate.
|
|
60
|
+
*
|
|
61
|
+
* `manual` is in the route for a reason and the CLI keeps the word: this is
|
|
62
|
+
* the door for a document that came from somewhere else, and it is not the
|
|
63
|
+
* same thing as the platform producing one.
|
|
64
|
+
*/
|
|
65
|
+
export declare function recordEnterpriseFinancialDocument(body: Record<string, unknown>): Promise<unknown>;
|
|
66
|
+
/** `POST /finance-close-snapshots` — freeze a period's figures. */
|
|
67
|
+
export declare function createEnterpriseFinanceCloseSnapshot(body: Record<string, unknown>): Promise<unknown>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertEnterpriseProfile = upsertEnterpriseProfile;
|
|
4
|
+
exports.beginEnterpriseDomainVerification = beginEnterpriseDomainVerification;
|
|
5
|
+
exports.verifyEnterpriseDomain = verifyEnterpriseDomain;
|
|
6
|
+
exports.createEnterpriseContract = createEnterpriseContract;
|
|
7
|
+
exports.issueEnterpriseContract = issueEnterpriseContract;
|
|
8
|
+
exports.activateEnterpriseContract = activateEnterpriseContract;
|
|
9
|
+
exports.createEnterpriseBudget = createEnterpriseBudget;
|
|
10
|
+
exports.publishEnterpriseBudget = publishEnterpriseBudget;
|
|
11
|
+
exports.evaluateEnterpriseBudget = evaluateEnterpriseBudget;
|
|
12
|
+
exports.recordEnterpriseFinancialDocument = recordEnterpriseFinancialDocument;
|
|
13
|
+
exports.createEnterpriseFinanceCloseSnapshot = createEnterpriseFinanceCloseSnapshot;
|
|
14
|
+
const api_fetch_1 = require("./api-fetch");
|
|
15
|
+
/**
|
|
16
|
+
* `/api/commerce/admin/enterprise/*` — the enterprise half of the commerce
|
|
17
|
+
* control plane: workspace profiles, domain verification, commercial
|
|
18
|
+
* contracts, budget policies, financial documents and finance-close snapshots.
|
|
19
|
+
*
|
|
20
|
+
* It lives under the `/api/commerce` mount and under the `skrr enterprise`
|
|
21
|
+
* TOPIC, and that is deliberate. A mount is where the server happened to put a
|
|
22
|
+
* router; a topic is what an operator is trying to do. Somebody administering
|
|
23
|
+
* an enterprise deployment wants its contracts, budgets and audit export in
|
|
24
|
+
* one place, and does not know or care that one of them is served from a
|
|
25
|
+
* different router than the others.
|
|
26
|
+
*
|
|
27
|
+
* Every route is written out at its own call site rather than composed from a
|
|
28
|
+
* builder: the parity checker reads a LITERAL there and deliberately refuses a
|
|
29
|
+
* composed path. Bodies are passed through and validated by the server, so the
|
|
30
|
+
* CLI never becomes a second declaration of a contract or budget shape.
|
|
31
|
+
*/
|
|
32
|
+
/** `PUT /workspaces/:workspaceId/profile` — the enterprise profile itself. */
|
|
33
|
+
async function upsertEnterpriseProfile(workspaceId, body) {
|
|
34
|
+
return (0, api_fetch_1.apiFetch)(`/api/commerce/admin/enterprise/workspaces/${encodeURIComponent(workspaceId)}/profile`, { method: 'PUT', body });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `POST /workspaces/:workspaceId/domains/begin` — start proving a domain.
|
|
38
|
+
*
|
|
39
|
+
* Two calls, not one, and the gap between them is the point: `begin` hands
|
|
40
|
+
* back a challenge you have to publish somewhere you control, and `verify`
|
|
41
|
+
* goes and looks. A single command that did both would either block on DNS or
|
|
42
|
+
* report a request as a result.
|
|
43
|
+
*/
|
|
44
|
+
async function beginEnterpriseDomainVerification(workspaceId, body) {
|
|
45
|
+
return (0, api_fetch_1.apiFetch)(`/api/commerce/admin/enterprise/workspaces/${encodeURIComponent(workspaceId)}/domains/begin`, { method: 'POST', body });
|
|
46
|
+
}
|
|
47
|
+
/** `POST /workspaces/:workspaceId/domains/verify` — check the published challenge. */
|
|
48
|
+
async function verifyEnterpriseDomain(workspaceId, body) {
|
|
49
|
+
return (0, api_fetch_1.apiFetch)(`/api/commerce/admin/enterprise/workspaces/${encodeURIComponent(workspaceId)}/domains/verify`, { method: 'POST', body });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The contract lifecycle: create → issue (mints it with Stripe) → activate.
|
|
53
|
+
*
|
|
54
|
+
* Three doors, because `issue` is the one that reaches an external provider
|
|
55
|
+
* and `activate` is the one that starts billing. Collapsing them into a
|
|
56
|
+
* `--state` flag would hide which of those a command is about to do.
|
|
57
|
+
*/
|
|
58
|
+
/** `POST /contracts` — draft a commercial contract. */
|
|
59
|
+
async function createEnterpriseContract(body) {
|
|
60
|
+
return (0, api_fetch_1.apiFetch)('/api/commerce/admin/enterprise/contracts', { method: 'POST', body });
|
|
61
|
+
}
|
|
62
|
+
/** `POST /contracts/:contractId/issue` — mint it with Stripe. Reaches a provider. */
|
|
63
|
+
async function issueEnterpriseContract(contractId, body = {}) {
|
|
64
|
+
return (0, api_fetch_1.apiFetch)(`/api/commerce/admin/enterprise/contracts/${encodeURIComponent(contractId)}/issue`, { method: 'POST', body });
|
|
65
|
+
}
|
|
66
|
+
/** `POST /contracts/:contractId/activate` — it starts billing. */
|
|
67
|
+
async function activateEnterpriseContract(contractId, body = {}) {
|
|
68
|
+
return (0, api_fetch_1.apiFetch)(`/api/commerce/admin/enterprise/contracts/${encodeURIComponent(contractId)}/activate`, { method: 'POST', body });
|
|
69
|
+
}
|
|
70
|
+
/** `POST /budgets` — draft a hierarchical budget policy. */
|
|
71
|
+
async function createEnterpriseBudget(body) {
|
|
72
|
+
return (0, api_fetch_1.apiFetch)('/api/commerce/admin/enterprise/budgets', { method: 'POST', body });
|
|
73
|
+
}
|
|
74
|
+
/** `POST /budgets/:policyId/publish` — it starts constraining spend. */
|
|
75
|
+
async function publishEnterpriseBudget(policyId, body = {}) {
|
|
76
|
+
return (0, api_fetch_1.apiFetch)(`/api/commerce/admin/enterprise/budgets/${encodeURIComponent(policyId)}/publish`, { method: 'POST', body });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `POST /budgets/evaluate` — what would this spend do, against the published
|
|
80
|
+
* policies?
|
|
81
|
+
*
|
|
82
|
+
* A read shaped like a write: it changes nothing and answers a question about
|
|
83
|
+
* a hypothetical charge, which is why it is the one budget verb safe to run
|
|
84
|
+
* whenever you are unsure.
|
|
85
|
+
*/
|
|
86
|
+
async function evaluateEnterpriseBudget(body) {
|
|
87
|
+
return (0, api_fetch_1.apiFetch)('/api/commerce/admin/enterprise/budgets/evaluate', {
|
|
88
|
+
method: 'POST',
|
|
89
|
+
body,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* `POST /financial-documents/manual` — record a document the platform did not
|
|
94
|
+
* generate.
|
|
95
|
+
*
|
|
96
|
+
* `manual` is in the route for a reason and the CLI keeps the word: this is
|
|
97
|
+
* the door for a document that came from somewhere else, and it is not the
|
|
98
|
+
* same thing as the platform producing one.
|
|
99
|
+
*/
|
|
100
|
+
async function recordEnterpriseFinancialDocument(body) {
|
|
101
|
+
return (0, api_fetch_1.apiFetch)('/api/commerce/admin/enterprise/financial-documents/manual', {
|
|
102
|
+
method: 'POST',
|
|
103
|
+
body,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** `POST /finance-close-snapshots` — freeze a period's figures. */
|
|
107
|
+
async function createEnterpriseFinanceCloseSnapshot(body) {
|
|
108
|
+
return (0, api_fetch_1.apiFetch)('/api/commerce/admin/enterprise/finance-close-snapshots', {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
body,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/api/enterprise/external-configuration` — where a workspace's audit and
|
|
3
|
+
* log export lands, and whether that destination is live.
|
|
4
|
+
*
|
|
5
|
+
* Admin-gated on the server (`requireJwtAuth` + `checkAdmin`); the CLI grants
|
|
6
|
+
* nothing, it only gives the operator a way in that is not a browser. This is
|
|
7
|
+
* configuration for a deployment, which is the case the CLI exists for.
|
|
8
|
+
*
|
|
9
|
+
* Two shapes worth knowing before calling anything here:
|
|
10
|
+
*
|
|
11
|
+
* **The write is REVISION-FENCED.** `expectedRevision` is compare-and-set:
|
|
12
|
+
* present means "replace exactly this revision", absent means "create". That
|
|
13
|
+
* makes the request self-describing, so `apiFetch` derives one stable
|
|
14
|
+
* idempotency key from it and a retry after a lost response REPLAYS instead of
|
|
15
|
+
* colliding — the rule in `packages/data-provider/src/idempotency.ts`. Never
|
|
16
|
+
* omit it to force a write through; omitting it is a different intent.
|
|
17
|
+
*
|
|
18
|
+
* **Activation is a REQUEST, not a result.** `activate` enqueues a
|
|
19
|
+
* verification job and answers 202. The evidence that the destination really
|
|
20
|
+
* accepts writes is produced by the writer and verifier workloads, never by
|
|
21
|
+
* the caller — which is why there is no way to hand it in from here.
|
|
22
|
+
*/
|
|
23
|
+
/** Shape is owned by the service; the CLI prints it and does not interpret it. */
|
|
24
|
+
export interface EnterpriseExternalConfiguration {
|
|
25
|
+
configurationId?: string;
|
|
26
|
+
workspaceId?: string;
|
|
27
|
+
revision?: number;
|
|
28
|
+
status?: string;
|
|
29
|
+
configuration?: unknown;
|
|
30
|
+
updatedBy?: string;
|
|
31
|
+
updatedAt?: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface EnterpriseExternalConfigurationVerificationJob {
|
|
35
|
+
id?: string;
|
|
36
|
+
status?: string;
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
/** `GET /:workspaceId` — 404 when the workspace has never been configured. */
|
|
40
|
+
export declare function getEnterpriseExternalConfiguration(workspaceId: string): Promise<{
|
|
41
|
+
configuration: EnterpriseExternalConfiguration;
|
|
42
|
+
}>;
|
|
43
|
+
/** `PUT /:workspaceId` — create (no `expectedRevision`) or replace one exact revision. */
|
|
44
|
+
export declare function upsertEnterpriseExternalConfiguration(workspaceId: string, input: {
|
|
45
|
+
configuration: unknown;
|
|
46
|
+
configurationId?: string;
|
|
47
|
+
expectedRevision?: number;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
configuration: EnterpriseExternalConfiguration;
|
|
50
|
+
}>;
|
|
51
|
+
/** `POST /:workspaceId/activate` — enqueue verification. 202; nothing is live yet. */
|
|
52
|
+
export declare function activateEnterpriseExternalConfiguration(workspaceId: string): Promise<{
|
|
53
|
+
verificationJob: EnterpriseExternalConfigurationVerificationJob;
|
|
54
|
+
}>;
|
|
55
|
+
/** `POST /:workspaceId/suspend` — stop exporting. Fenced on the exact revision. */
|
|
56
|
+
export declare function suspendEnterpriseExternalConfiguration(workspaceId: string, expectedRevision: number): Promise<{
|
|
57
|
+
configuration: EnterpriseExternalConfiguration;
|
|
58
|
+
}>;
|
|
59
|
+
/** One readable block for a configuration, shared by every command here. */
|
|
60
|
+
export declare function describeEnterpriseExternalConfiguration(configuration: EnterpriseExternalConfiguration): string[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnterpriseExternalConfiguration = getEnterpriseExternalConfiguration;
|
|
4
|
+
exports.upsertEnterpriseExternalConfiguration = upsertEnterpriseExternalConfiguration;
|
|
5
|
+
exports.activateEnterpriseExternalConfiguration = activateEnterpriseExternalConfiguration;
|
|
6
|
+
exports.suspendEnterpriseExternalConfiguration = suspendEnterpriseExternalConfiguration;
|
|
7
|
+
exports.describeEnterpriseExternalConfiguration = describeEnterpriseExternalConfiguration;
|
|
8
|
+
const api_fetch_1 = require("./api-fetch");
|
|
9
|
+
/*
|
|
10
|
+
* Each route is written out at its own call site, rather than composed by a
|
|
11
|
+
* `path(id, suffix)` helper. That is not repetition for its own sake: the
|
|
12
|
+
* parity checker reads a LITERAL at the call site and deliberately refuses to
|
|
13
|
+
* resolve a composed one, because a path it cannot read is an endpoint it
|
|
14
|
+
* reports as unreachable — and the cure people reach for is an allowlist entry
|
|
15
|
+
* for something that was fine. Keeping the route visible here keeps the gate
|
|
16
|
+
* able to see it.
|
|
17
|
+
*/
|
|
18
|
+
/** `GET /:workspaceId` — 404 when the workspace has never been configured. */
|
|
19
|
+
async function getEnterpriseExternalConfiguration(workspaceId) {
|
|
20
|
+
return (0, api_fetch_1.apiFetch)(`/api/enterprise/external-configuration/${encodeURIComponent(workspaceId)}`);
|
|
21
|
+
}
|
|
22
|
+
/** `PUT /:workspaceId` — create (no `expectedRevision`) or replace one exact revision. */
|
|
23
|
+
async function upsertEnterpriseExternalConfiguration(workspaceId, input) {
|
|
24
|
+
return (0, api_fetch_1.apiFetch)(`/api/enterprise/external-configuration/${encodeURIComponent(workspaceId)}`, {
|
|
25
|
+
method: 'PUT',
|
|
26
|
+
body: {
|
|
27
|
+
configuration: input.configuration,
|
|
28
|
+
...(input.configurationId ? { configurationId: input.configurationId } : {}),
|
|
29
|
+
...(input.expectedRevision !== undefined
|
|
30
|
+
? { expectedRevision: input.expectedRevision }
|
|
31
|
+
: {}),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** `POST /:workspaceId/activate` — enqueue verification. 202; nothing is live yet. */
|
|
36
|
+
async function activateEnterpriseExternalConfiguration(workspaceId) {
|
|
37
|
+
return (0, api_fetch_1.apiFetch)(`/api/enterprise/external-configuration/${encodeURIComponent(workspaceId)}/activate`, { method: 'POST', body: {} });
|
|
38
|
+
}
|
|
39
|
+
/** `POST /:workspaceId/suspend` — stop exporting. Fenced on the exact revision. */
|
|
40
|
+
async function suspendEnterpriseExternalConfiguration(workspaceId, expectedRevision) {
|
|
41
|
+
return (0, api_fetch_1.apiFetch)(`/api/enterprise/external-configuration/${encodeURIComponent(workspaceId)}/suspend`, { method: 'POST', body: { expectedRevision } });
|
|
42
|
+
}
|
|
43
|
+
/** One readable block for a configuration, shared by every command here. */
|
|
44
|
+
function describeEnterpriseExternalConfiguration(configuration) {
|
|
45
|
+
const lines = [`workspace ${configuration.workspaceId ?? '(unknown)'}`];
|
|
46
|
+
if (configuration.configurationId)
|
|
47
|
+
lines.push(`id ${configuration.configurationId}`);
|
|
48
|
+
if (configuration.status)
|
|
49
|
+
lines.push(`status ${configuration.status}`);
|
|
50
|
+
// Printed on every read because it is what the next write must fence on.
|
|
51
|
+
if (configuration.revision !== undefined)
|
|
52
|
+
lines.push(`revision ${configuration.revision}`);
|
|
53
|
+
if (configuration.updatedAt)
|
|
54
|
+
lines.push(`updated ${configuration.updatedAt}`);
|
|
55
|
+
if (configuration.updatedBy)
|
|
56
|
+
lines.push(`updated by ${configuration.updatedBy}`);
|
|
57
|
+
return lines;
|
|
58
|
+
}
|
|
@@ -443,17 +443,21 @@ const BYOK_AWS_NON_SECRETS = new Set([
|
|
|
443
443
|
* credentials. Only the second class is ever something a `skrr code` run is
|
|
444
444
|
* supposed to spend, so only the second class comes back below. `OVERSKY_TOKEN`
|
|
445
445
|
* is the one this whole filter exists for and is covered twice — by name and by
|
|
446
|
-
* the `OVERSKY_` prefix — on purpose.
|
|
446
|
+
* the `OVERSKY_` prefix — on purpose. `SKRR_TOKEN` is the supported renamed
|
|
447
|
+
* spelling of the same credential (`cli/src/lib/config.ts` honors both), so it
|
|
448
|
+
* gets identical name + prefix coverage — a deny-list with a hole is not a
|
|
449
|
+
* deny-list.
|
|
447
450
|
*/
|
|
448
451
|
const ENGINE_NEVER_INHERITS = new Set([
|
|
449
452
|
'OVERSKY_TOKEN',
|
|
453
|
+
'SKRR_TOKEN',
|
|
450
454
|
'CLAUDE_CODE_OAUTH_TOKEN',
|
|
451
455
|
'LITELLM_MASTER_KEY',
|
|
452
456
|
'GH_TOKEN',
|
|
453
457
|
'GITHUB_TOKEN',
|
|
454
458
|
'NPM_TOKEN',
|
|
455
459
|
]);
|
|
456
|
-
const ENGINE_NEVER_INHERITS_PREFIXES = ['OVERSKY_', 'AWS_'];
|
|
460
|
+
const ENGINE_NEVER_INHERITS_PREFIXES = ['OVERSKY_', 'SKRR_', 'AWS_'];
|
|
457
461
|
/**
|
|
458
462
|
* The provider credentials this environment offers a BYOK run, by name.
|
|
459
463
|
*
|
|
@@ -626,7 +630,17 @@ function engineOwnedEnv(env) {
|
|
|
626
630
|
}
|
|
627
631
|
if (!(0, auth_core_1.readFirstPartyHarnessEngineEnv)(env, 'home').value)
|
|
628
632
|
return {};
|
|
629
|
-
|
|
633
|
+
const out = Object.fromEntries(Object.entries(everyName(engineInstructionHome(env))).filter(([name]) => !(typeof env[name] === 'string' && env[name].trim() !== '')));
|
|
634
|
+
// The current-namespace name (`SKRR_CODE_HOME`) sits under the shared
|
|
635
|
+
// sanitizer's SKRR_ sweep, so ambient inheritance no longer carries it —
|
|
636
|
+
// pass the user's own spelling through explicitly, verbatim. Legacy names
|
|
637
|
+
// (`SKY_CODE_*`) are not under that prefix and still inherit.
|
|
638
|
+
const currentName = auth_core_1.FIRST_PARTY_HARNESS_ENGINE.env.home;
|
|
639
|
+
const currentValue = env[currentName];
|
|
640
|
+
if (typeof currentValue === 'string' && currentValue.trim() !== '') {
|
|
641
|
+
out[currentName] = currentValue;
|
|
642
|
+
}
|
|
643
|
+
return out;
|
|
630
644
|
}
|
|
631
645
|
async function execEngine(args, env = process.env, options = {}) {
|
|
632
646
|
// Move an engine installed under an older binary name onto the canonical one,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/api/store/governance` — who may RUN what, and which exact release.
|
|
3
|
+
*
|
|
4
|
+
* Distinct from `skrr store browse|install|releases|update`, which is the
|
|
5
|
+
* published-AGENT surface: you find one, you get your own copy. This mount is
|
|
6
|
+
* the licensing and policy plane over the whole artifact catalogue — agents,
|
|
7
|
+
* skills, actions, services, teams, bundles, space templates and connectors —
|
|
8
|
+
* where a license grants an owner the right to run a release and a workspace
|
|
9
|
+
* policy says which releases may run at all.
|
|
10
|
+
*
|
|
11
|
+
* Keeping them as one `store` topic with a `governance` subtopic is the
|
|
12
|
+
* decision this file records. They are the same catalogue seen two ways, and
|
|
13
|
+
* splitting them into two top-level nouns would repeat the `skrr machines
|
|
14
|
+
* hosted` collision the parity spec already documents — two surfaces sharing a
|
|
15
|
+
* word, only one of which has a CLI.
|
|
16
|
+
*
|
|
17
|
+
* Every route is written out at its own call site rather than composed from a
|
|
18
|
+
* builder: the parity checker reads a LITERAL there and deliberately refuses a
|
|
19
|
+
* composed path, so a helper would turn real coverage into a reported gap.
|
|
20
|
+
*/
|
|
21
|
+
/** Both license-policy doors take this; the actor is what differs. */
|
|
22
|
+
export interface BundleLicensePolicyInput {
|
|
23
|
+
updatePolicy: 'manual' | 'pinned' | 'compatible';
|
|
24
|
+
/** Compare-and-set. The server requires it: a license policy is never blind-written. */
|
|
25
|
+
expectedRevision: number;
|
|
26
|
+
selectedReleaseIds?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface StoreArtifactQuery {
|
|
29
|
+
entityType?: string;
|
|
30
|
+
capability?: string;
|
|
31
|
+
permission?: string;
|
|
32
|
+
verifiedOutcome?: string;
|
|
33
|
+
minCostMicros?: number;
|
|
34
|
+
maxCostMicros?: number;
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* `GET /artifacts` — search the catalogue by capability, permission and cost.
|
|
39
|
+
*
|
|
40
|
+
* The query rides in `withQuery` rather than being interpolated into the
|
|
41
|
+
* literal: the parity checker reads the LITERAL at the call site, and a query
|
|
42
|
+
* baked into it resolves to a path no route matches — so a covered endpoint
|
|
43
|
+
* would report as unreachable.
|
|
44
|
+
*/
|
|
45
|
+
export declare function searchGovernedStoreArtifacts(input: StoreArtifactQuery): Promise<{
|
|
46
|
+
artifacts: unknown[];
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* `POST /install-plan` — what installing this release would actually do.
|
|
50
|
+
*
|
|
51
|
+
* A PLAN, not an install. It resolves the release against a license, a
|
|
52
|
+
* workspace policy and the environment you declare, and answers whether the
|
|
53
|
+
* install is permitted and what it would pull — which is the read an operator
|
|
54
|
+
* wants before spending anything.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveGovernedStoreInstallPlan(body: {
|
|
57
|
+
releaseId: string;
|
|
58
|
+
licenseId?: string;
|
|
59
|
+
workspaceId?: string;
|
|
60
|
+
spaceId?: string;
|
|
61
|
+
environment?: Record<string, unknown>;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
plan: unknown;
|
|
64
|
+
}>;
|
|
65
|
+
/** `POST /admin/releases` — publish one artifact release. Admin. */
|
|
66
|
+
export declare function publishGovernedStoreRelease(body: Record<string, unknown>): Promise<{
|
|
67
|
+
release: unknown;
|
|
68
|
+
}>;
|
|
69
|
+
/** `POST /admin/licenses` — mint a bundle license against an acquisition. Admin. */
|
|
70
|
+
export declare function createGovernedStoreLicense(body: Record<string, unknown>): Promise<{
|
|
71
|
+
license: unknown;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* `PATCH /licenses/:licenseId/update-policy` — change how a license you hold
|
|
75
|
+
* AS A PERSON takes updates.
|
|
76
|
+
*/
|
|
77
|
+
export declare function updateOwnLicensePolicy(licenseId: string, body: BundleLicensePolicyInput): Promise<{
|
|
78
|
+
license: unknown;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* `PATCH /workspaces/:workspaceId/licenses/:licenseId/update-policy` — the same
|
|
82
|
+
* change for a license the WORKSPACE holds.
|
|
83
|
+
*
|
|
84
|
+
* A separate door rather than a flag on the one above, because the server
|
|
85
|
+
* resolves a different actor (`actorOwnerType`) from the route itself. Two
|
|
86
|
+
* owners can hold licenses over the same release, and which one you are
|
|
87
|
+
* decides what you may change — so the CLI keeps them distinguishable instead
|
|
88
|
+
* of inferring it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function updateWorkspaceLicensePolicy(workspaceId: string, licenseId: string, body: BundleLicensePolicyInput): Promise<{
|
|
91
|
+
license: unknown;
|
|
92
|
+
}>;
|
|
93
|
+
/** `PUT /workspaces/:workspaceId/policy` — which releases a workspace may run. */
|
|
94
|
+
export declare function setWorkspaceStorePolicy(workspaceId: string, body: {
|
|
95
|
+
mode: 'deny_all' | 'allowlist';
|
|
96
|
+
allowedReleaseIds: string[];
|
|
97
|
+
policyId?: string;
|
|
98
|
+
expectedRevision?: number;
|
|
99
|
+
}): Promise<{
|
|
100
|
+
policy: unknown;
|
|
101
|
+
}>;
|
|
102
|
+
/** `POST /workspaces/:workspaceId/assignments` — give a seat to a member or Space. */
|
|
103
|
+
export declare function assignWorkspaceStoreLicense(workspaceId: string, body: {
|
|
104
|
+
licenseId: string;
|
|
105
|
+
assigneeType: 'member' | 'space';
|
|
106
|
+
assigneeId: string;
|
|
107
|
+
assignmentId?: string;
|
|
108
|
+
}): Promise<{
|
|
109
|
+
assignment: unknown;
|
|
110
|
+
}>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchGovernedStoreArtifacts = searchGovernedStoreArtifacts;
|
|
4
|
+
exports.resolveGovernedStoreInstallPlan = resolveGovernedStoreInstallPlan;
|
|
5
|
+
exports.publishGovernedStoreRelease = publishGovernedStoreRelease;
|
|
6
|
+
exports.createGovernedStoreLicense = createGovernedStoreLicense;
|
|
7
|
+
exports.updateOwnLicensePolicy = updateOwnLicensePolicy;
|
|
8
|
+
exports.updateWorkspaceLicensePolicy = updateWorkspaceLicensePolicy;
|
|
9
|
+
exports.setWorkspaceStorePolicy = setWorkspaceStorePolicy;
|
|
10
|
+
exports.assignWorkspaceStoreLicense = assignWorkspaceStoreLicense;
|
|
11
|
+
const api_fetch_1 = require("./api-fetch");
|
|
12
|
+
const triggers_1 = require("./triggers");
|
|
13
|
+
/**
|
|
14
|
+
* `GET /artifacts` — search the catalogue by capability, permission and cost.
|
|
15
|
+
*
|
|
16
|
+
* The query rides in `withQuery` rather than being interpolated into the
|
|
17
|
+
* literal: the parity checker reads the LITERAL at the call site, and a query
|
|
18
|
+
* baked into it resolves to a path no route matches — so a covered endpoint
|
|
19
|
+
* would report as unreachable.
|
|
20
|
+
*/
|
|
21
|
+
async function searchGovernedStoreArtifacts(input) {
|
|
22
|
+
return (0, api_fetch_1.apiFetch)((0, triggers_1.withQuery)('/api/store/governance/artifacts', { ...input }));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `POST /install-plan` — what installing this release would actually do.
|
|
26
|
+
*
|
|
27
|
+
* A PLAN, not an install. It resolves the release against a license, a
|
|
28
|
+
* workspace policy and the environment you declare, and answers whether the
|
|
29
|
+
* install is permitted and what it would pull — which is the read an operator
|
|
30
|
+
* wants before spending anything.
|
|
31
|
+
*/
|
|
32
|
+
async function resolveGovernedStoreInstallPlan(body) {
|
|
33
|
+
return (0, api_fetch_1.apiFetch)('/api/store/governance/install-plan', {
|
|
34
|
+
method: 'POST',
|
|
35
|
+
body,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** `POST /admin/releases` — publish one artifact release. Admin. */
|
|
39
|
+
async function publishGovernedStoreRelease(body) {
|
|
40
|
+
return (0, api_fetch_1.apiFetch)('/api/store/governance/admin/releases', {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
body,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** `POST /admin/licenses` — mint a bundle license against an acquisition. Admin. */
|
|
46
|
+
async function createGovernedStoreLicense(body) {
|
|
47
|
+
return (0, api_fetch_1.apiFetch)('/api/store/governance/admin/licenses', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
body,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* `PATCH /licenses/:licenseId/update-policy` — change how a license you hold
|
|
54
|
+
* AS A PERSON takes updates.
|
|
55
|
+
*/
|
|
56
|
+
async function updateOwnLicensePolicy(licenseId, body) {
|
|
57
|
+
return (0, api_fetch_1.apiFetch)(`/api/store/governance/licenses/${encodeURIComponent(licenseId)}/update-policy`, { method: 'PATCH', body });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* `PATCH /workspaces/:workspaceId/licenses/:licenseId/update-policy` — the same
|
|
61
|
+
* change for a license the WORKSPACE holds.
|
|
62
|
+
*
|
|
63
|
+
* A separate door rather than a flag on the one above, because the server
|
|
64
|
+
* resolves a different actor (`actorOwnerType`) from the route itself. Two
|
|
65
|
+
* owners can hold licenses over the same release, and which one you are
|
|
66
|
+
* decides what you may change — so the CLI keeps them distinguishable instead
|
|
67
|
+
* of inferring it.
|
|
68
|
+
*/
|
|
69
|
+
async function updateWorkspaceLicensePolicy(workspaceId, licenseId, body) {
|
|
70
|
+
return (0, api_fetch_1.apiFetch)(`/api/store/governance/workspaces/${encodeURIComponent(workspaceId)}/licenses/${encodeURIComponent(licenseId)}/update-policy`, { method: 'PATCH', body });
|
|
71
|
+
}
|
|
72
|
+
/** `PUT /workspaces/:workspaceId/policy` — which releases a workspace may run. */
|
|
73
|
+
async function setWorkspaceStorePolicy(workspaceId, body) {
|
|
74
|
+
return (0, api_fetch_1.apiFetch)(`/api/store/governance/workspaces/${encodeURIComponent(workspaceId)}/policy`, { method: 'PUT', body });
|
|
75
|
+
}
|
|
76
|
+
/** `POST /workspaces/:workspaceId/assignments` — give a seat to a member or Space. */
|
|
77
|
+
async function assignWorkspaceStoreLicense(workspaceId, body) {
|
|
78
|
+
return (0, api_fetch_1.apiFetch)(`/api/store/governance/workspaces/${encodeURIComponent(workspaceId)}/assignments`, { method: 'POST', body });
|
|
79
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../base-command';
|
|
2
|
+
import { type GuestServiceReply } from './guest-service';
|
|
3
|
+
/**
|
|
4
|
+
* `skrr service ls|status|logs` — the guest-local read verbs.
|
|
5
|
+
*
|
|
6
|
+
* They run INSIDE a Dedicated Runtime guest on the daemon's workload socket;
|
|
7
|
+
* SO_PEERCRED is the credential, so no login is required and `requireAuth`
|
|
8
|
+
* is deliberately absent — an agent's Bash tool has no token and needs none.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class GuestServiceCommand extends BaseCommand {
|
|
11
|
+
protected requireGuest(): void;
|
|
12
|
+
protected guestRead(op: 'list' | 'status' | 'logs', args?: {
|
|
13
|
+
name?: string;
|
|
14
|
+
tailBytes?: number;
|
|
15
|
+
}): Promise<GuestServiceReply>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuestServiceCommand = void 0;
|
|
4
|
+
const base_command_1 = require("../base-command");
|
|
5
|
+
const dedicated_service_1 = require("./dedicated-service");
|
|
6
|
+
const guest_service_1 = require("./guest-service");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr service ls|status|logs` — the guest-local read verbs.
|
|
9
|
+
*
|
|
10
|
+
* They run INSIDE a Dedicated Runtime guest on the daemon's workload socket;
|
|
11
|
+
* SO_PEERCRED is the credential, so no login is required and `requireAuth`
|
|
12
|
+
* is deliberately absent — an agent's Bash tool has no token and needs none.
|
|
13
|
+
*/
|
|
14
|
+
class GuestServiceCommand extends base_command_1.BaseCommand {
|
|
15
|
+
requireGuest() {
|
|
16
|
+
if (!(0, dedicated_service_1.runningOnDedicatedRuntimeGuest)()) {
|
|
17
|
+
this.error('This command reads services on a Dedicated Runtime guest, and this is not one. ' +
|
|
18
|
+
'From your own machine use `skrr machines dedicated service …`.', { exit: 2 });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async guestRead(op, args = {}) {
|
|
22
|
+
try {
|
|
23
|
+
return await (0, guest_service_1.callGuestServiceRead)(op, args);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
if (err instanceof dedicated_service_1.DedicatedServiceError)
|
|
27
|
+
this.error(err.message, { exit: 1 });
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.GuestServiceCommand = GuestServiceCommand;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { connect as connectSocket } from 'node:net';
|
|
2
|
+
import { type DedicatedServiceSpec } from './dedicated-service';
|
|
3
|
+
/**
|
|
4
|
+
* The guest-local service lane — `skrr service propose` and its read verbs,
|
|
5
|
+
* running INSIDE a Dedicated Runtime guest.
|
|
6
|
+
*
|
|
7
|
+
* Design: docs/architecture/dedicated-runtime-always-on-workloads-2026-09-21.md
|
|
8
|
+
* §5.6 (proposals) and §10.1 (guest-local status). The daemon listens on
|
|
9
|
+
* `/run/skrr-dedicated-runtime/service-propose/service-propose.sock` inside
|
|
10
|
+
* a workload-owned, daemon-group directory — the directory mode is the
|
|
11
|
+
* audience gate, so nothing here carries a token. The wire is one
|
|
12
|
+
* newline-terminated JSON request per connection:
|
|
13
|
+
*
|
|
14
|
+
* propose → {"verb": "propose", "spec": {...}} — the daemon validates the
|
|
15
|
+
* spec and derives `createdBy` from the peer's pid →
|
|
16
|
+
* DaemonSession; a claim in the payload is ignored
|
|
17
|
+
* reads → {"verb": "list" | "status" | "logs", "name"?, "tailBytes"?}
|
|
18
|
+
*
|
|
19
|
+
* and the daemon answers one JSON line back:
|
|
20
|
+
*
|
|
21
|
+
* {ok: true, ...verb-shaped fields} or {ok: false, error}
|
|
22
|
+
*
|
|
23
|
+
* The newline is the frame terminator — a document without one is left
|
|
24
|
+
* unread by design (the daemon cannot distinguish it from a truncated
|
|
25
|
+
* request).
|
|
26
|
+
*/
|
|
27
|
+
export interface GuestServiceReply {
|
|
28
|
+
ok?: boolean;
|
|
29
|
+
proposalId?: string;
|
|
30
|
+
result?: unknown;
|
|
31
|
+
error?: string;
|
|
32
|
+
code?: string;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
export declare const GUEST_SERVICE_CALL_TIMEOUT_MS = 15000;
|
|
36
|
+
/**
|
|
37
|
+
* Write one document to the propose socket and read the daemon's one reply.
|
|
38
|
+
* Half-closing after the write is the "request is complete" signal — a
|
|
39
|
+
* keep-alive protocol would need framing the design does not specify.
|
|
40
|
+
*/
|
|
41
|
+
export declare function callGuestServiceSocket(document: Record<string, unknown>, options?: {
|
|
42
|
+
socketPath?: string;
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
connect?: typeof connectSocket;
|
|
45
|
+
}): Promise<GuestServiceReply>;
|
|
46
|
+
/** `skrr service propose` — hand the daemon a spec, get back a proposal id. */
|
|
47
|
+
export declare function proposeGuestService(spec: DedicatedServiceSpec, options?: {
|
|
48
|
+
socketPath?: string;
|
|
49
|
+
connect?: typeof connectSocket;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
proposalId: string;
|
|
52
|
+
reply: GuestServiceReply;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* `skrr service ls|status|logs` — the read verbs on the same socket. The
|
|
56
|
+
* daemon returns `result` in whatever shape the verb defines; the commands
|
|
57
|
+
* render it, they do not reinterpret it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function callGuestServiceRead(op: 'list' | 'status' | 'logs', args?: {
|
|
60
|
+
name?: string;
|
|
61
|
+
tailBytes?: number;
|
|
62
|
+
}, options?: {
|
|
63
|
+
socketPath?: string;
|
|
64
|
+
connect?: typeof connectSocket;
|
|
65
|
+
}): Promise<GuestServiceReply>;
|
|
66
|
+
/** Parse and validate a spec document read from a file the guest hands the daemon. */
|
|
67
|
+
export declare function readGuestSpecFile(filePath: string): DedicatedServiceSpec;
|