@skrr-ai/cli 0.1.94 → 0.1.96
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 +175 -165
- package/bin/run.js +32 -0
- package/bin/update-npm-runner.cjs +33 -0
- package/bin/update-session.cjs +194 -0
- package/bin/update-worker.cjs +208 -0
- package/dist/base-command.js +0 -15
- package/dist/commands/agent/message/send.d.ts +2 -0
- package/dist/commands/agent/message/send.js +75 -5
- package/dist/commands/agents/chat.js +1 -1
- package/dist/commands/agents/create.d.ts +0 -3
- package/dist/commands/agents/create.js +0 -26
- package/dist/commands/agents/egress.d.ts +17 -0
- package/dist/commands/agents/egress.js +84 -0
- package/dist/commands/agents/mailbox/messages.d.ts +14 -0
- package/dist/commands/agents/mailbox/messages.js +52 -0
- package/dist/commands/agents/mailbox/show.d.ts +13 -0
- package/dist/commands/agents/mailbox/show.js +52 -0
- package/dist/commands/agents/operating-plan.js +8 -0
- package/dist/commands/agents/roles/capture.d.ts +16 -0
- package/dist/commands/agents/roles/capture.js +53 -0
- package/dist/commands/agents/roles/install.d.ts +1 -0
- package/dist/commands/agents/roles/install.js +8 -1
- package/dist/commands/agents/roles/preview.d.ts +2 -0
- package/dist/commands/agents/roles/preview.js +27 -3
- package/dist/commands/agents/update.d.ts +0 -3
- package/dist/commands/agents/update.js +1 -31
- package/dist/commands/agents/usage-cap.d.ts +4 -1
- package/dist/commands/agents/usage-cap.js +49 -10
- package/dist/commands/code/doctor.d.ts +1 -0
- package/dist/commands/code/doctor.js +6 -0
- package/dist/commands/code/index.js +4 -0
- package/dist/commands/code/install.d.ts +5 -62
- package/dist/commands/code/install.js +86 -279
- package/dist/commands/code/jobs/show.js +12 -0
- package/dist/commands/code/rollback.d.ts +8 -0
- package/dist/commands/code/rollback.js +20 -0
- package/dist/commands/code/update.d.ts +8 -37
- package/dist/commands/code/update.js +134 -213
- package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
- package/dist/commands/commitments/action-proposals/decide.js +12 -0
- package/dist/commands/commitments/action-proposals.js +7 -0
- package/dist/commands/commitments/create.d.ts +1 -0
- package/dist/commands/commitments/create.js +17 -1
- package/dist/commands/commitments/delivery.d.ts +1 -0
- package/dist/commands/commitments/delivery.js +11 -1
- package/dist/commands/commitments/doctor.js +4 -0
- package/dist/commands/commitments/effective-policy.js +26 -0
- package/dist/commands/commitments/endpoints/create.js +5 -2
- package/dist/commands/commitments/observations.d.ts +10 -0
- package/dist/commands/commitments/observations.js +88 -0
- package/dist/commands/commitments/pause.d.ts +1 -1
- package/dist/commands/commitments/pause.js +4 -3
- package/dist/commands/commitments/preflight.js +2 -1
- package/dist/commands/commitments/reports.d.ts +2 -0
- package/dist/commands/commitments/reports.js +22 -4
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +35 -5
- package/dist/commands/daemon/install.js +4 -0
- package/dist/commands/generate-recovery-code.d.ts +13 -1
- package/dist/commands/generate-recovery-code.js +146 -13
- package/dist/commands/grants/create.d.ts +1 -0
- package/dist/commands/grants/create.js +8 -0
- package/dist/commands/grants/rotate.d.ts +5 -0
- package/dist/commands/grants/rotate.js +13 -1
- package/dist/commands/grants/update.d.ts +12 -0
- package/dist/commands/grants/update.js +27 -0
- package/dist/commands/instructions/guide.d.ts +20 -0
- package/dist/commands/instructions/guide.js +84 -0
- package/dist/commands/instructions/install.js +57 -33
- package/dist/commands/instructions/setup.d.ts +14 -0
- package/dist/commands/instructions/setup.js +72 -0
- package/dist/commands/integrations/execute.js +1 -1
- package/dist/commands/login.d.ts +5 -6
- package/dist/commands/login.js +27 -11
- package/dist/commands/logout.js +7 -7
- package/dist/commands/machines/hosted/start.js +7 -1
- package/dist/commands/machines/list.js +4 -4
- package/dist/commands/measures/confirm.d.ts +1 -7
- package/dist/commands/measures/confirm.js +15 -14
- package/dist/commands/measures/list.d.ts +1 -7
- package/dist/commands/measures/list.js +1 -7
- package/dist/commands/measures/record.js +4 -4
- package/dist/commands/measures/show.d.ts +11 -0
- package/dist/commands/measures/show.js +26 -0
- package/dist/commands/northstars/governance/configure.d.ts +1 -0
- package/dist/commands/northstars/governance/configure.js +8 -1
- package/dist/commands/proposals/discard.d.ts +5 -0
- package/dist/commands/proposals/discard.js +8 -0
- package/dist/commands/proposals/keep.d.ts +5 -0
- package/dist/commands/proposals/keep.js +8 -0
- package/dist/commands/proposals/list.d.ts +15 -0
- package/dist/commands/proposals/list.js +74 -0
- package/dist/commands/proposals/show.d.ts +12 -0
- package/dist/commands/proposals/show.js +27 -0
- package/dist/commands/proposals/snooze.d.ts +5 -0
- package/dist/commands/proposals/snooze.js +8 -0
- package/dist/commands/security/overview.d.ts +11 -0
- package/dist/commands/security/overview.js +158 -0
- package/dist/commands/signals/monitors/create.d.ts +9 -0
- package/dist/commands/signals/monitors/create.js +29 -0
- package/dist/commands/signals/monitors/list.d.ts +8 -0
- package/dist/commands/signals/monitors/list.js +16 -0
- package/dist/commands/signals/monitors/pause.d.ts +11 -0
- package/dist/commands/signals/monitors/pause.js +17 -0
- package/dist/commands/signals/monitors/resume.d.ts +11 -0
- package/dist/commands/signals/monitors/resume.js +17 -0
- package/dist/commands/signals/monitors/revise.d.ts +12 -0
- package/dist/commands/signals/monitors/revise.js +25 -0
- package/dist/commands/signals/monitors/show.d.ts +11 -0
- package/dist/commands/signals/monitors/show.js +17 -0
- package/dist/commands/signals/monitors/test.d.ts +12 -0
- package/dist/commands/signals/monitors/test.js +25 -0
- package/dist/commands/signals/monitors/transitions.d.ts +11 -0
- package/dist/commands/signals/monitors/transitions.js +17 -0
- package/dist/commands/signals/monitors/validate.d.ts +9 -0
- package/dist/commands/signals/monitors/validate.js +24 -0
- package/dist/commands/signals/schemas/list.d.ts +8 -0
- package/dist/commands/signals/schemas/list.js +16 -0
- package/dist/commands/signals/schemas/show.d.ts +11 -0
- package/dist/commands/signals/schemas/show.js +17 -0
- package/dist/commands/signals/sources/list.d.ts +8 -0
- package/dist/commands/signals/sources/list.js +16 -0
- package/dist/commands/signals/sources/receipts.d.ts +11 -0
- package/dist/commands/signals/sources/receipts.js +17 -0
- package/dist/commands/signals/sources/show.d.ts +11 -0
- package/dist/commands/signals/sources/show.js +17 -0
- package/dist/commands/spaces/claim.d.ts +12 -0
- package/dist/commands/spaces/claim.js +42 -0
- package/dist/commands/spaces/ownership.d.ts +12 -0
- package/dist/commands/spaces/ownership.js +46 -0
- package/dist/commands/spaces/usage.d.ts +12 -0
- package/dist/commands/spaces/usage.js +28 -0
- package/dist/commands/spaces/workflows/run.js +3 -0
- package/dist/commands/spaces/workflows/runs.js +2 -1
- package/dist/commands/spaces/workflows/update.d.ts +6 -1
- package/dist/commands/spaces/workflows/update.js +34 -2
- package/dist/commands/tasks/cancel-cascade.js +1 -1
- package/dist/commands/tasks/cascade-status.d.ts +2 -0
- package/dist/commands/tasks/cascade-status.js +27 -1
- package/dist/commands/tasks/create-tree.d.ts +5 -1
- package/dist/commands/tasks/create-tree.js +35 -7
- package/dist/commands/tasks/create.d.ts +4 -0
- package/dist/commands/tasks/create.js +16 -0
- package/dist/commands/tasks/deliverable/add.js +12 -3
- package/dist/commands/tasks/economics-compare.d.ts +15 -0
- package/dist/commands/tasks/economics-compare.js +60 -0
- package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
- package/dist/commands/tasks/expectations/evaluate.js +43 -0
- package/dist/commands/tasks/interrupt.js +2 -2
- package/dist/commands/tasks/list.d.ts +1 -0
- package/dist/commands/tasks/list.js +44 -1
- package/dist/commands/tasks/pause-schedule.js +1 -1
- package/dist/commands/tasks/show.d.ts +5 -0
- package/dist/commands/tasks/show.js +17 -0
- package/dist/commands/tasks/update.d.ts +4 -0
- package/dist/commands/tasks/update.js +9 -0
- package/dist/commands/tasks/workflow-findings.js +2 -2
- package/dist/commands/token/list.d.ts +3 -5
- package/dist/commands/token/list.js +99 -57
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +15 -0
- package/dist/commands/update.d.ts +14 -0
- package/dist/commands/update.js +61 -0
- package/dist/commands/workspaces/grants.d.ts +12 -0
- package/dist/commands/workspaces/grants.js +31 -0
- package/dist/commands/workspaces/stewardship.d.ts +13 -0
- package/dist/commands/workspaces/stewardship.js +34 -0
- package/dist/generated/managed-instruction-guides.json +9 -0
- package/dist/hooks/init.d.ts +5 -0
- package/dist/hooks/init.js +27 -0
- package/dist/lib/agent-config.d.ts +0 -12
- package/dist/lib/agent-config.js +1 -27
- package/dist/lib/agent-mailbox.d.ts +35 -0
- package/dist/lib/agent-mailbox.js +55 -0
- package/dist/lib/commitment-endpoints.d.ts +2 -1
- package/dist/lib/commitment-endpoints.js +2 -5
- package/dist/lib/commitment-product.d.ts +3 -1
- package/dist/lib/commitment-product.js +10 -0
- package/dist/lib/commitment-terms.js +1 -1
- package/dist/lib/commitments.d.ts +17 -15
- package/dist/lib/commitments.js +173 -137
- package/dist/lib/compasses.d.ts +14 -0
- package/dist/lib/compasses.js +25 -11
- package/dist/lib/daemon-installer.d.ts +2 -0
- package/dist/lib/daemon-installer.js +100 -24
- package/dist/lib/first-party-harness-doctor.js +31 -1
- package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
- package/dist/lib/first-party-harness-remote-install.js +310 -0
- package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
- package/dist/lib/first-party-harness-remote-update.js +242 -0
- package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
- package/dist/lib/first-party-harness-startup-update.js +166 -0
- package/dist/lib/first-party-harness-update.d.ts +46 -0
- package/dist/lib/first-party-harness-update.js +289 -0
- package/dist/lib/first-party-harness.js +7 -4
- package/dist/lib/grants.d.ts +5 -1
- package/dist/lib/grants.js +9 -1
- package/dist/lib/hosted-machines.d.ts +7 -0
- package/dist/lib/mailbox-human-command.d.ts +11 -0
- package/dist/lib/mailbox-human-command.js +41 -0
- package/dist/lib/managed-instruction-local.d.ts +12 -0
- package/dist/lib/managed-instruction-local.js +58 -0
- package/dist/lib/managed-instruction-setup.d.ts +35 -0
- package/dist/lib/managed-instruction-setup.js +306 -0
- package/dist/lib/measures.d.ts +28 -2
- package/dist/lib/measures.js +38 -14
- package/dist/lib/memory-sync.d.ts +1 -0
- package/dist/lib/memory-sync.js +279 -68
- package/dist/lib/message-intent.d.ts +6 -2
- package/dist/lib/message-intent.js +1 -0
- package/dist/lib/northstars.js +2 -1
- package/dist/lib/platform-update-local.d.ts +2 -0
- package/dist/lib/platform-update-local.js +113 -0
- package/dist/lib/platform-update.d.ts +39 -0
- package/dist/lib/platform-update.js +84 -0
- package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
- package/dist/lib/profile-machine-identity-guard.js +13 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +4 -3
- package/dist/lib/proposal-decision-command.d.ts +19 -0
- package/dist/lib/proposal-decision-command.js +64 -0
- package/dist/lib/proposals.d.ts +8 -0
- package/dist/lib/proposals.js +22 -0
- package/dist/lib/roles.d.ts +141 -6
- package/dist/lib/roles.js +8 -2
- package/dist/lib/signals.d.ts +20 -0
- package/dist/lib/signals.js +24 -0
- package/dist/lib/space-usage.d.ts +3 -0
- package/dist/lib/space-usage.js +17 -0
- package/dist/lib/stewardship-output.d.ts +4 -0
- package/dist/lib/stewardship-output.js +82 -0
- package/dist/lib/task-asset-upload.d.ts +3 -1
- package/dist/lib/task-asset-upload.js +1 -0
- package/dist/lib/task-batch.d.ts +9 -0
- package/dist/lib/task-batch.js +94 -17
- package/dist/lib/task-economics.d.ts +16 -0
- package/dist/lib/task-economics.js +22 -0
- package/dist/lib/task-instruction-offer.d.ts +1 -4
- package/dist/lib/task-instruction-offer.js +3 -129
- package/dist/lib/triggers.d.ts +11 -3
- package/dist/lib/triggers.js +58 -1
- package/dist/lib/update-check.d.ts +61 -53
- package/dist/lib/update-check.js +453 -314
- package/dist/lib/usage-discovery.d.ts +10 -0
- package/dist/lib/usage-discovery.js +24 -3
- package/dist/lib/workflow-run-budget.d.ts +12 -0
- package/dist/lib/workflow-run-budget.js +37 -0
- package/dist/lib/workspaces.d.ts +48 -0
- package/dist/lib/workspaces.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8069 -7121
- package/docs/v1/README.md +28 -0
- package/docs/v1/api.md +55 -0
- package/docs/v1/changelog.md +16 -0
- package/docs/v1/check-examples.mjs +178 -0
- package/docs/v1/examples/api-readonly.mjs +144 -0
- package/docs/v1/operations.md +87 -0
- package/docs/v1/quickstart.md +71 -0
- package/oclif.manifest.json +49424 -46174
- package/package.json +34 -11
|
@@ -1,242 +1,163 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
const core_1 = require("@oclif/core");
|
|
4
37
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* `skrr code update` — pull the engine's signed release down through the daemon.
|
|
11
|
-
*
|
|
12
|
-
* ── Why this command exists ────────────────────────────────────────────────
|
|
13
|
-
*
|
|
14
|
-
* The update verb has been API-exposed and daemon-implemented since OSK-10096 —
|
|
15
|
-
* `POST /api/daemons/:id/cli-installers/:provider/update` re-fetches the signed
|
|
16
|
-
* manifest and installs whatever the channel points at. But the only CLI that
|
|
17
|
-
* reached it was `skrr harnesses install <provider> --update`: a flag on a
|
|
18
|
-
* command a `code` user has no reason to read. On stable that left no
|
|
19
|
-
* discoverable path at all — `code install` answered "Already installed." with
|
|
20
|
-
* no next step, and the channel moving past the installed build was invisible
|
|
21
|
-
* from the surface that owns the engine (OSK-10650).
|
|
22
|
-
*
|
|
23
|
-
* So this adds a SURFACE and no mechanism. Same route `harnesses install
|
|
24
|
-
* --update` posts, same inventory pre-check, same 504 recovery — one update
|
|
25
|
-
* path, spelled where the engine's users look.
|
|
26
|
-
*/
|
|
27
|
-
class CodeUpdate extends base_command_1.BaseCommand {
|
|
28
|
-
static description = `Update the ${auth_core_1.FIRST_PARTY_HARNESS.displayName} engine on this machine, through the daemon`;
|
|
38
|
+
const first_party_harness_update_1 = require("../../lib/first-party-harness-update");
|
|
39
|
+
const first_party_harness_startup_update_1 = require("../../lib/first-party-harness-startup-update");
|
|
40
|
+
/** The default target is this computer; an explicit daemon keeps the remote API path. */
|
|
41
|
+
class CodeUpdate extends core_1.Command {
|
|
42
|
+
static description = `Check or update the local ${auth_core_1.FIRST_PARTY_HARNESS.displayName} signed release; use --daemon to update another machine`;
|
|
29
43
|
static examples = [
|
|
30
44
|
'<%= config.bin %> code update',
|
|
45
|
+
'<%= config.bin %> code update --check',
|
|
31
46
|
'<%= config.bin %> code update --daemon <daemon-id>',
|
|
32
|
-
'<%= config.bin %> code update --
|
|
47
|
+
'<%= config.bin %> code update --rollback',
|
|
33
48
|
];
|
|
34
49
|
static flags = {
|
|
35
|
-
daemon: core_1.Flags.string({
|
|
36
|
-
description: 'Which daemon runs the update. Defaults to this machine on a Dedicated Runtime, otherwise to the only active one; required when you have several.',
|
|
37
|
-
}),
|
|
50
|
+
daemon: core_1.Flags.string({ description: 'Run the update on this daemon instead of this computer' }),
|
|
38
51
|
wait: core_1.Flags.boolean({
|
|
39
52
|
default: true,
|
|
40
53
|
allowNo: true,
|
|
41
|
-
description: '
|
|
54
|
+
description: 'Wait for completion. --no-wait returns the local process or remote job.',
|
|
42
55
|
}),
|
|
43
56
|
json: core_1.Flags.boolean({ description: 'Emit the result as JSON' }),
|
|
57
|
+
check: core_1.Flags.boolean({
|
|
58
|
+
description: 'Check the signed release channel without downloading or changing the engine',
|
|
59
|
+
}),
|
|
60
|
+
'target-version': core_1.Flags.string({ description: 'Install this exact signed release' }),
|
|
61
|
+
'allow-downgrade': core_1.Flags.boolean({
|
|
62
|
+
description: 'Allow an explicitly pinned older signed release',
|
|
63
|
+
}),
|
|
64
|
+
rollback: core_1.Flags.boolean({ description: 'Restore the previous verified release' }),
|
|
65
|
+
'startup-checks': core_1.Flags.string({
|
|
66
|
+
options: ['on', 'off'],
|
|
67
|
+
description: 'Enable or disable new-session update checks without updating the engine',
|
|
68
|
+
}),
|
|
44
69
|
};
|
|
45
70
|
async run() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
inventory = await (0, cli_installers_1.listCliInstallers)(daemonId, this.resolvedCredential);
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
this.handleApiError(err);
|
|
57
|
-
}
|
|
58
|
-
const row = (inventory.providers ?? []).find((p) => (0, auth_core_1.isFirstPartyHarnessProvider)(p.provider));
|
|
59
|
-
if (!row) {
|
|
60
|
-
this.failWithCliError({
|
|
61
|
-
message: `${auth_core_1.FIRST_PARTY_HARNESS.displayName} is not installed on ${daemonId}. ` +
|
|
62
|
-
`Install it with \`${this.config.bin} code install\`.`,
|
|
63
|
-
code: 'NOT_INSTALLED',
|
|
64
|
-
exit: 1,
|
|
65
|
-
retryable: false,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (row.updatable === undefined) {
|
|
69
|
-
this.failWithCliError({
|
|
70
|
-
message: `The daemon ${daemonId} (${inventory.daemonVersion ?? 'version not reported'}) cannot update ${auth_core_1.FIRST_PARTY_HARNESS.displayName}: it predates managed updates. ` +
|
|
71
|
-
`Update the daemon, then run this again.`,
|
|
72
|
-
code: 'DAEMON_UPDATE_UNSUPPORTED',
|
|
73
|
-
exit: 1,
|
|
74
|
-
retryable: false,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
if (!row.updatable) {
|
|
78
|
-
this.failWithCliError({
|
|
79
|
-
message: row.updateDisabledReason?.trim() ||
|
|
80
|
-
`${auth_core_1.FIRST_PARTY_HARNESS.displayName}: the daemon cannot update it here.`,
|
|
81
|
-
code: 'CLI_NOT_UPDATABLE',
|
|
82
|
-
exit: 1,
|
|
83
|
-
retryable: false,
|
|
84
|
-
});
|
|
71
|
+
// Preserve all authenticated remote flags (--profile, --workspace, --token)
|
|
72
|
+
// without importing or initializing the auth stack for a local operation.
|
|
73
|
+
if (this.argv.some((arg) => arg === '--daemon' || arg.startsWith('--daemon='))) {
|
|
74
|
+
const { default: RemoteCodeUpdate } = await Promise.resolve().then(() => __importStar(require('../../lib/first-party-harness-remote-update')));
|
|
75
|
+
await this.parse(RemoteCodeUpdate);
|
|
76
|
+
await RemoteCodeUpdate.run(this.argv, this.config);
|
|
77
|
+
return;
|
|
85
78
|
}
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
79
|
+
const { flags } = await this.parse(CodeUpdate);
|
|
80
|
+
if (flags['startup-checks']) {
|
|
81
|
+
if (flags.daemon ||
|
|
82
|
+
flags.check ||
|
|
83
|
+
flags.rollback ||
|
|
84
|
+
flags['target-version'] ||
|
|
85
|
+
flags['allow-downgrade'] ||
|
|
86
|
+
!flags.wait)
|
|
87
|
+
this.error('--startup-checks changes only the local preference; use it without other update controls.');
|
|
88
|
+
const setting = (0, first_party_harness_startup_update_1.configureCodeStartupChecks)(flags['startup-checks'] === 'on');
|
|
89
|
+
if (flags.json)
|
|
90
|
+
this.log(JSON.stringify({
|
|
91
|
+
component: 'code',
|
|
92
|
+
state: 'configured',
|
|
93
|
+
startupChecks: setting.enabled,
|
|
94
|
+
preferencesPath: setting.preferencesPath,
|
|
95
|
+
}, null, 2));
|
|
96
|
+
else
|
|
97
|
+
this.log(`${auth_core_1.FIRST_PARTY_HARNESS.displayName} startup update checks ${setting.enabled ? 'enabled' : 'disabled'}. Change this with \`skrr code update --startup-checks ${setting.enabled ? 'off' : 'on'}\`.`);
|
|
88
98
|
return;
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
}
|
|
100
|
+
if (flags.rollback &&
|
|
101
|
+
(flags.check || flags['target-version'] || flags['allow-downgrade'] || !flags.wait))
|
|
102
|
+
this.error('--rollback cannot be combined with --check, --target-version, --allow-downgrade or --no-wait.');
|
|
103
|
+
if (flags['allow-downgrade'] && !flags['target-version'])
|
|
104
|
+
this.error('--allow-downgrade requires --target-version.');
|
|
105
|
+
const options = {
|
|
106
|
+
version: flags['target-version'],
|
|
107
|
+
allowDowngrade: flags['allow-downgrade'],
|
|
108
|
+
force: true,
|
|
109
|
+
};
|
|
110
|
+
try {
|
|
111
|
+
const current = (0, first_party_harness_update_1.getLocalCodeUpdateStatus)();
|
|
112
|
+
if (!flags.check && !flags.rollback && !current.activePath && current.owner === 'managed') {
|
|
113
|
+
const missing = {
|
|
114
|
+
...current,
|
|
115
|
+
state: 'failed',
|
|
116
|
+
code: 'NOT_INSTALLED',
|
|
117
|
+
message: `${auth_core_1.FIRST_PARTY_HARNESS.displayName} is not installed on this computer. Run \`skrr code install\`.`,
|
|
118
|
+
};
|
|
119
|
+
if (flags.json)
|
|
120
|
+
this.log(JSON.stringify(missing, null, 2));
|
|
121
|
+
else
|
|
122
|
+
this.log((0, first_party_harness_update_1.formatLocalCodeUpdate)(missing));
|
|
123
|
+
process.exitCode = 1;
|
|
93
124
|
return;
|
|
94
125
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (flags.json) {
|
|
102
|
-
this.log(JSON.stringify({ daemonId, ...start }, null, 2));
|
|
126
|
+
if (!flags.check && !flags.rollback && !flags.wait) {
|
|
127
|
+
const queued = await (0, first_party_harness_update_1.startLocalCodeUpdate)(options);
|
|
128
|
+
if (flags.json)
|
|
129
|
+
this.log(JSON.stringify(queued, null, 2));
|
|
130
|
+
else
|
|
131
|
+
this.log(`${auth_core_1.FIRST_PARTY_HARNESS.displayName} update queued (process ${queued.pid}). Results: ${queued.logPath}; status: skrr code doctor.`);
|
|
103
132
|
return;
|
|
104
133
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
134
|
+
const result = flags.check
|
|
135
|
+
? await (0, first_party_harness_update_1.checkLocalCodeUpdate)(options)
|
|
136
|
+
: flags.rollback
|
|
137
|
+
? (0, first_party_harness_update_1.rollbackLocalCode)()
|
|
138
|
+
: await (0, first_party_harness_update_1.updateLocalCode)({
|
|
139
|
+
...options,
|
|
140
|
+
onProgress: flags.json ? undefined : (line) => this.logToStderr(line),
|
|
141
|
+
});
|
|
142
|
+
if (flags.json)
|
|
143
|
+
this.log(JSON.stringify(result, null, 2));
|
|
144
|
+
else
|
|
145
|
+
this.log((0, first_party_harness_update_1.formatLocalCodeUpdate)(result));
|
|
146
|
+
if (result.state === 'failed' || result.state === 'check-failed')
|
|
117
147
|
process.exitCode = 1;
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (job.status === 'failed') {
|
|
121
|
-
this.failWithCliError({
|
|
122
|
-
message: job.error || 'The update failed and the daemon gave no reason.',
|
|
123
|
-
code: 'UPDATE_FAILED',
|
|
124
|
-
exit: 1,
|
|
125
|
-
retryable: false,
|
|
126
|
-
});
|
|
127
148
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
local: (0, daemon_target_1.localMachine)({ baseURL: this.cliConfig?.baseURL }),
|
|
137
|
-
listActiveDaemons: () => (0, daemon_target_1.listConnectedDaemons)(this.resolvedCredential),
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
catch (err) {
|
|
141
|
-
this.handleApiError(err);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* The daemon id to update through, or the refusal — identical rules to
|
|
146
|
-
* `code install`: a Dedicated Runtime's own machine is image-managed, several
|
|
147
|
-
* connected daemons get named rather than guessed.
|
|
148
|
-
*/
|
|
149
|
-
updateTarget(target) {
|
|
150
|
-
if (target.kind === 'daemon')
|
|
151
|
-
return target.daemonId;
|
|
152
|
-
if (target.kind === 'this-machine') {
|
|
153
|
-
this.failWithCliError({
|
|
154
|
-
message: target.explicit
|
|
155
|
-
? first_party_harness_1.DEDICATED_RUNTIME_ENGINE_MESSAGE
|
|
156
|
-
: `${first_party_harness_1.DEDICATED_RUNTIME_ENGINE_MESSAGE} This command updates the machine it runs on; ` +
|
|
157
|
-
'to update another of your machines, name it with --daemon.',
|
|
158
|
-
code: 'DEDICATED_RUNTIME_ENGINE_SHIPS_WITH_IMAGE',
|
|
159
|
-
exit: 1,
|
|
160
|
-
retryable: false,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
if (target.kind === 'none') {
|
|
164
|
-
this.failWithCliError({
|
|
165
|
-
message: 'No daemon is connected for this account, so nothing can perform the update. ' +
|
|
166
|
-
`Start the background service on this computer with \`${this.config.bin} daemon start\`, then run this again.`,
|
|
167
|
-
code: 'NO_DAEMON',
|
|
168
|
-
exit: 1,
|
|
169
|
-
retryable: false,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
const { daemons } = target;
|
|
173
|
-
const choices = daemons
|
|
174
|
-
.slice(0, 10)
|
|
175
|
-
.map((d) => ` ${d.id} ${d.name || '—'}`)
|
|
176
|
-
.join('\n');
|
|
177
|
-
this.failWithCliError({
|
|
178
|
-
message: `${daemons.length} connected daemons — say which machine should update the engine:\n${choices}\n` +
|
|
179
|
-
`Pass one with --daemon, or see each daemon id in the DAEMON ID column of \`${this.config.bin} harnesses list\`.`,
|
|
180
|
-
code: 'AMBIGUOUS_DAEMON',
|
|
181
|
-
exit: 1,
|
|
182
|
-
retryable: false,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Start the update, and survive a gateway that cut the request off — the same
|
|
187
|
-
* 504 recovery `harnesses install --update` uses: the relay can drop the
|
|
188
|
-
* answer while the daemon runs the job it started, so on a server-side
|
|
189
|
-
* failure we ask the daemon and follow the job it reports.
|
|
190
|
-
*/
|
|
191
|
-
async start(daemonId, json) {
|
|
192
|
-
try {
|
|
193
|
-
return await (0, cli_installers_1.startManagedCliUpdate)(daemonId, PROVIDER, this.resolvedCredential);
|
|
194
|
-
}
|
|
195
|
-
catch (err) {
|
|
196
|
-
const status = err.status ?? 0;
|
|
197
|
-
if (status >= 500 || status === 408) {
|
|
198
|
-
const job = await (0, cli_installers_1.jobStartedDespiteTimeout)(daemonId, PROVIDER, this.resolvedCredential);
|
|
199
|
-
if (job?.id) {
|
|
200
|
-
if (!json) {
|
|
201
|
-
this.logToStderr(`The request to ${daemonId} did not come back (HTTP ${status}), but the daemon started job ${job.id}. Following it.`);
|
|
202
|
-
}
|
|
203
|
-
return { started: true, job };
|
|
204
|
-
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
if (flags.json) {
|
|
151
|
+
this.log(JSON.stringify({
|
|
152
|
+
component: 'code',
|
|
153
|
+
state: 'failed',
|
|
154
|
+
error: error instanceof Error ? error.message : String(error),
|
|
155
|
+
}));
|
|
156
|
+
process.exitCode = 1;
|
|
205
157
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/** Follow a job to its end, or report why it could not be followed (and return nothing). */
|
|
211
|
-
async follow(daemonId, jobId, json) {
|
|
212
|
-
const outcome = await (0, cli_installers_1.followManagedCliInstallJob)({
|
|
213
|
-
daemonId,
|
|
214
|
-
jobId,
|
|
215
|
-
credential: this.resolvedCredential,
|
|
216
|
-
onLogLine: json ? undefined : (line) => this.logToStderr(` ${line}`),
|
|
217
|
-
});
|
|
218
|
-
if (outcome.kind === 'missing') {
|
|
219
|
-
this.failWithCliError({
|
|
220
|
-
message: `The daemon no longer has update job ${jobId}.`,
|
|
221
|
-
code: 'JOB_MISSING',
|
|
222
|
-
exit: 1,
|
|
223
|
-
retryable: false,
|
|
224
|
-
});
|
|
225
|
-
return undefined;
|
|
226
|
-
}
|
|
227
|
-
if (outcome.kind === 'timeout') {
|
|
228
|
-
this.failWithCliError({
|
|
229
|
-
message: `Still updating after ${Math.round(cli_installers_1.INSTALL_MAX_WAIT_MS / 60000)} minutes — the daemon is ` +
|
|
230
|
-
`still working on job ${jobId}. Check \`${this.config.bin} code doctor\` in a while.`,
|
|
231
|
-
code: 'UPDATE_PENDING',
|
|
232
|
-
exit: 1,
|
|
233
|
-
retryable: true,
|
|
234
|
-
});
|
|
235
|
-
return undefined;
|
|
158
|
+
else
|
|
159
|
+
this.error(error instanceof Error ? error : String(error));
|
|
236
160
|
}
|
|
237
|
-
return outcome.job;
|
|
238
161
|
}
|
|
239
162
|
}
|
|
240
163
|
exports.default = CodeUpdate;
|
|
241
|
-
/** Same canonical provider id `code install` posts — read from the identity module. */
|
|
242
|
-
const PROVIDER = auth_core_1.FIRST_PARTY_HARNESS.provider;
|
|
@@ -8,6 +8,8 @@ export default class CommitmentsActionProposalsDecide extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
decision: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'reason-code': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
13
|
};
|
|
12
14
|
run(): Promise<void>;
|
|
13
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
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
6
|
const commitments_1 = require("../../../lib/commitments");
|
|
6
7
|
class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
|
|
@@ -16,6 +17,13 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
|
|
|
16
17
|
static flags = {
|
|
17
18
|
json: core_1.Flags.boolean({ description: 'Output the decision and execution receipts as JSON' }),
|
|
18
19
|
decision: core_1.Flags.string({ options: ['approve', 'reject'], required: true }),
|
|
20
|
+
reason: core_1.Flags.string({
|
|
21
|
+
description: 'Why this proposal was kept or discarded (up to 1000 characters)',
|
|
22
|
+
}),
|
|
23
|
+
'reason-code': core_1.Flags.string({
|
|
24
|
+
options: [...data_provider_1.PROPOSAL_DISCARD_REASON_CODES],
|
|
25
|
+
description: 'Structured discard reason',
|
|
26
|
+
}),
|
|
19
27
|
};
|
|
20
28
|
async run() {
|
|
21
29
|
this.requireAuth();
|
|
@@ -36,6 +44,10 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
|
|
|
36
44
|
const decided = await commitments_1.commitmentApi.decideActionProposal(args.commitmentId, args.proposalId, decision, {
|
|
37
45
|
snapshotDigest: proposal.snapshotDigest,
|
|
38
46
|
bundleVersion: proposal.bundleVersion,
|
|
47
|
+
...(flags.reason ? { reason: flags.reason } : {}),
|
|
48
|
+
...(flags['reason-code']
|
|
49
|
+
? { reasonCode: flags['reason-code'] }
|
|
50
|
+
: {}),
|
|
39
51
|
});
|
|
40
52
|
const execution = decision === 'approve' && decided.status === 'approved'
|
|
41
53
|
? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId)
|
|
@@ -38,6 +38,13 @@ class CommitmentsActionProposals extends base_command_1.BaseCommand {
|
|
|
38
38
|
this.log('No prepared Action Bundles.');
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
+
this.log('Advisory captured overlaps only; an empty list does not prove resources are safe.');
|
|
42
|
+
for (const proposal of response.data) {
|
|
43
|
+
if (proposal.overlapCoverage?.status !== 'available')
|
|
44
|
+
this.log(`${proposal.id}: overlap evidence incomplete or unavailable.`);
|
|
45
|
+
for (const peer of proposal.overlaps || [])
|
|
46
|
+
this.log(`${proposal.id} overlaps ${peer.proposalId} (${peer.agentId}) ${peer.repoFullName}: ${peer.paths.join(', ')}`);
|
|
47
|
+
}
|
|
41
48
|
(0, format_1.renderTable)(response.data.map((proposal) => ({
|
|
42
49
|
id: proposal.id,
|
|
43
50
|
actions: String(proposal.actionSnapshots?.length || 1),
|
|
@@ -66,6 +66,7 @@ export default class CommitmentsCreate extends BaseCommand {
|
|
|
66
66
|
'cadence-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
67
67
|
timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
68
68
|
delivery: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
69
|
+
'task-review-policy': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
69
70
|
repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
70
71
|
base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
71
72
|
isolation: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.hasEventCapableWatchedSource = hasEventCapableWatchedSource;
|
|
4
4
|
exports.assertEventDrivenWatchedSource = assertEventDrivenWatchedSource;
|
|
5
5
|
exports.createCadenceFromFlags = createCadenceFromFlags;
|
|
6
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
7
|
const core_1 = require("@oclif/core");
|
|
7
8
|
const base_command_1 = require("../../base-command");
|
|
8
9
|
const web_url_1 = require("../../lib/web-url");
|
|
@@ -248,6 +249,10 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
248
249
|
description: 'Requested delivery artifact or destination',
|
|
249
250
|
options: [...commitment_product_1.COMMITMENT_DELIVERY_CHOICES],
|
|
250
251
|
}),
|
|
252
|
+
'task-review-policy': core_1.Flags.string({
|
|
253
|
+
options: [...data_provider_1.TASK_REVIEW_POLICIES],
|
|
254
|
+
description: 'Owner choice for generated Tasks. Required records a blocker; the owner and their Agent can still close.',
|
|
255
|
+
}),
|
|
251
256
|
repo: core_1.Flags.string({ description: 'Delivery repository, owner/repo' }),
|
|
252
257
|
base: core_1.Flags.string({ description: 'Delivery target branch' }),
|
|
253
258
|
isolation: core_1.Flags.string({
|
|
@@ -354,9 +359,20 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
|
354
359
|
: {};
|
|
355
360
|
const policy = { ...existingPolicy };
|
|
356
361
|
if (flags.delivery)
|
|
357
|
-
payload.delivery =
|
|
362
|
+
payload.delivery = {
|
|
363
|
+
...(record(payload.delivery) || {}),
|
|
364
|
+
...(0, commitment_product_1.deliveryInput)(flags.delivery, flags),
|
|
365
|
+
};
|
|
358
366
|
else if (flags.repo || flags.base)
|
|
359
367
|
throw new Error('--repo and --base require --delivery.');
|
|
368
|
+
if (flags['task-review-policy'] !== undefined)
|
|
369
|
+
payload.delivery = {
|
|
370
|
+
...(record(payload.delivery) || { version: 1, mode: 'report_only' }),
|
|
371
|
+
reviewPolicy: (0, commitment_product_1.normalizeTaskReviewPolicy)(flags['task-review-policy']),
|
|
372
|
+
};
|
|
373
|
+
const declaredDelivery = record(payload.delivery);
|
|
374
|
+
if (declaredDelivery?.reviewPolicy !== undefined)
|
|
375
|
+
(0, commitment_product_1.normalizeTaskReviewPolicy)(declaredDelivery.reviewPolicy);
|
|
360
376
|
if (flags.isolation)
|
|
361
377
|
policy.executionIsolation = flags.isolation;
|
|
362
378
|
if (flags['max-nudges'] !== undefined)
|
|
@@ -8,6 +8,7 @@ export default class CommitmentsDelivery extends BaseCommand {
|
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
10
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'task-review-policy': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
12
|
repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
13
|
base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
14
|
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
5
6
|
const commitments_1 = require("../../lib/commitments");
|
|
@@ -24,6 +25,10 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
|
24
25
|
};
|
|
25
26
|
static flags = {
|
|
26
27
|
json: core_1.Flags.boolean({ description: 'Output the complete contract as JSON' }),
|
|
28
|
+
'task-review-policy': core_1.Flags.string({
|
|
29
|
+
options: [...data_provider_1.TASK_REVIEW_POLICIES],
|
|
30
|
+
description: 'Owner choice for generated Tasks; omission preserves the current declaration.',
|
|
31
|
+
}),
|
|
27
32
|
repo: core_1.Flags.string({ description: 'GitHub repository, owner/repo' }),
|
|
28
33
|
base: core_1.Flags.string({ description: 'Delivery target branch, such as main' }),
|
|
29
34
|
reason: core_1.Flags.string({ description: 'Reason recorded with this contract change' }),
|
|
@@ -33,7 +38,12 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
|
|
|
33
38
|
const { args, flags } = await this.parse(CommitmentsDelivery);
|
|
34
39
|
try {
|
|
35
40
|
const current = (await commitments_1.commitmentApi.get(args.id)).commitment;
|
|
36
|
-
const requested = (0, commitment_product_1.deliveryInput)(args.mode,
|
|
41
|
+
const requested = (0, commitment_product_1.deliveryInput)(args.mode, {
|
|
42
|
+
...flags,
|
|
43
|
+
...(flags['task-review-policy'] !== undefined
|
|
44
|
+
? { taskReviewPolicy: (0, commitment_product_1.normalizeTaskReviewPolicy)(flags['task-review-policy']) }
|
|
45
|
+
: {}),
|
|
46
|
+
});
|
|
37
47
|
const delivery = { ...current.delivery, ...requested };
|
|
38
48
|
const result = await commitments_1.commitmentApi.delivery(args.id, {
|
|
39
49
|
delivery,
|
|
@@ -95,6 +95,10 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
|
|
|
95
95
|
operatingState,
|
|
96
96
|
observedAt: new Date().toISOString(),
|
|
97
97
|
};
|
|
98
|
+
if (!flags.json && operatingState.knowledge) {
|
|
99
|
+
const knowledge = operatingState.knowledge;
|
|
100
|
+
this.log(`Space knowledge: ${knowledge.status || 'unavailable'}${knowledge.spaceId ? ` · ${knowledge.spaceId}` : ''}${knowledge.source ? ` (${knowledge.source})` : ''}; prospective scope, not a completed memory mount`);
|
|
101
|
+
}
|
|
98
102
|
if (flags.json)
|
|
99
103
|
this.log(JSON.stringify(report, null, 2));
|
|
100
104
|
else {
|
|
@@ -11,6 +11,31 @@ const RUN_LIMIT_BINDING_LABELS = {
|
|
|
11
11
|
workspace_admin: 'workspace limit',
|
|
12
12
|
owner: 'owner limit',
|
|
13
13
|
};
|
|
14
|
+
/** The admission day is UTC and said so; the shared Northstar pools are named apart. */
|
|
15
|
+
function budgetDayLines(policy) {
|
|
16
|
+
const day = policy.budgetDay;
|
|
17
|
+
const shared = policy.portfolio?.sharedBudget;
|
|
18
|
+
const lines = [];
|
|
19
|
+
if (day) {
|
|
20
|
+
lines.push(`Daily budgets reset at ${day.resetsAt ?? '00:00 UTC'}${day.localResetAt ? ` (${day.localResetAt} ${day.localTimeZone})` : ''}`);
|
|
21
|
+
}
|
|
22
|
+
if (shared?.status === 'unavailable') {
|
|
23
|
+
lines.push('Northstar shared run pools: unavailable (could not be read)');
|
|
24
|
+
}
|
|
25
|
+
else if (shared?.status === 'available') {
|
|
26
|
+
// `null` is "no ceiling" only when the server says the state is unset (or
|
|
27
|
+
// an older server says nothing). A stored value that is not a non-negative
|
|
28
|
+
// integer is refused at admission as unreadable; saying "no ceiling" for it
|
|
29
|
+
// would be the reassuring lie.
|
|
30
|
+
const pool = (value, state) => state === 'malformed'
|
|
31
|
+
? 'malformed (enforced as unreadable)'
|
|
32
|
+
: value == null
|
|
33
|
+
? 'no ceiling'
|
|
34
|
+
: `${value}/day`;
|
|
35
|
+
lines.push(`Northstar shared pools: action runs ${pool(shared.actionRunsPerDay, shared.actionRunsPerDayState)} · observation runs ${pool(shared.observationRunsPerDay, shared.observationRunsPerDayState)}`);
|
|
36
|
+
}
|
|
37
|
+
return lines;
|
|
38
|
+
}
|
|
14
39
|
function effectivePolicyLines(policy) {
|
|
15
40
|
const governance = policy.governance || {};
|
|
16
41
|
const owner = policy.owner || {};
|
|
@@ -47,6 +72,7 @@ function effectivePolicyLines(policy) {
|
|
|
47
72
|
}
|
|
48
73
|
if (policy.observation?.sensing)
|
|
49
74
|
lines.push("Sensing runs: the Agent's own permissions");
|
|
75
|
+
lines.push(...budgetDayLines(policy));
|
|
50
76
|
return lines;
|
|
51
77
|
}
|
|
52
78
|
/** Show the policy actually governing a Commitment without changing it. */
|
|
@@ -1,6 +1,7 @@
|
|
|
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
6
|
const commitment_endpoints_1 = require("../../../lib/commitment-endpoints");
|
|
6
7
|
/**
|
|
@@ -19,13 +20,14 @@ class CommitmentsEndpointsCreate extends base_command_1.BaseCommand {
|
|
|
19
20
|
static examples = [
|
|
20
21
|
'<%= config.bin %> commitments endpoints create --agent agent_abc --label "Ops channel" --destination slack_channel --target C123 --capability push --capability reply',
|
|
21
22
|
'<%= config.bin %> commitments endpoints create --agent agent_abc --label "My DM" --destination slack_owner_dm --capability push',
|
|
23
|
+
'<%= config.bin %> commitments endpoints create --agent agent_abc --label "My Discord" --destination discord_owner_dm --capability push',
|
|
22
24
|
];
|
|
23
25
|
static flags = {
|
|
24
26
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
25
27
|
agent: core_1.Flags.string({ description: 'Agent ID', required: true }),
|
|
26
28
|
label: core_1.Flags.string({ description: 'Human-readable label', required: true }),
|
|
27
29
|
destination: core_1.Flags.string({
|
|
28
|
-
description:
|
|
30
|
+
description: `Implemented destination: ${commitment_endpoints_1.COMMITMENT_ENDPOINT_DESTINATIONS.join(', ')}`,
|
|
29
31
|
options: [...commitment_endpoints_1.COMMITMENT_ENDPOINT_DESTINATIONS],
|
|
30
32
|
required: true,
|
|
31
33
|
}),
|
|
@@ -45,7 +47,8 @@ class CommitmentsEndpointsCreate extends base_command_1.BaseCommand {
|
|
|
45
47
|
endpoint = await commitment_endpoints_1.commitmentEndpointApi.create({
|
|
46
48
|
agentId: flags.agent,
|
|
47
49
|
label: flags.label,
|
|
48
|
-
provider: flags.destination
|
|
50
|
+
provider: data_provider_1.COMMITMENT_DESTINATION_REGISTRY[flags.destination]
|
|
51
|
+
.transport,
|
|
49
52
|
destination: flags.destination,
|
|
50
53
|
capabilities: flags.capability,
|
|
51
54
|
...(flags.target ? { target: flags.target } : {}),
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/** Explicit ISO FROM/TO intervals avoid local-time or rolling-window ambiguity. */
|
|
3
|
+
export declare function parseObservationWindow(value: string): {
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function renderObservationWindow(response: Record<string, unknown>, log: (line: string) => void): void;
|
|
2
8
|
/**
|
|
3
9
|
* `skrr commitments observations <id>` — what this commitment's runs saw.
|
|
4
10
|
*
|
|
@@ -22,6 +28,10 @@ export default class CommitmentsObservations extends BaseCommand {
|
|
|
22
28
|
};
|
|
23
29
|
static flags: {
|
|
24
30
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
31
|
+
latest: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
32
|
+
key: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
33
|
+
window: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
34
|
+
'compare-to': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
35
|
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
36
|
'declared-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
27
37
|
'changed-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|