@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
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
5
|
+
const base_command_1 = require("../base-command");
|
|
6
|
+
const cli_installers_1 = require("./cli-installers");
|
|
7
|
+
const daemon_target_1 = require("./daemon-target");
|
|
8
|
+
const first_party_harness_1 = require("./first-party-harness");
|
|
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`;
|
|
29
|
+
static examples = [
|
|
30
|
+
'<%= config.bin %> code update',
|
|
31
|
+
'<%= config.bin %> code update --daemon <daemon-id>',
|
|
32
|
+
'<%= config.bin %> code update --json',
|
|
33
|
+
];
|
|
34
|
+
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
|
+
}),
|
|
38
|
+
wait: core_1.Flags.boolean({
|
|
39
|
+
default: true,
|
|
40
|
+
allowNo: true,
|
|
41
|
+
description: 'Follow the update job until it finishes. --no-wait returns the job id.',
|
|
42
|
+
}),
|
|
43
|
+
json: core_1.Flags.boolean({ description: 'Emit the result as JSON' }),
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
const { flags } = await this.parse(CodeUpdate);
|
|
47
|
+
const daemonId = this.updateTarget(await this.resolveTarget(flags.daemon));
|
|
48
|
+
// Ask the inventory before posting: a daemon older than managed updates has
|
|
49
|
+
// no handler for the request and would leave it to time out, and an engine
|
|
50
|
+
// that updates some other way has a reason the daemon already words.
|
|
51
|
+
let inventory;
|
|
52
|
+
try {
|
|
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
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const start = await this.start(daemonId, flags.json === true);
|
|
87
|
+
if (!start)
|
|
88
|
+
return;
|
|
89
|
+
const jobId = start.job?.id;
|
|
90
|
+
if (!start.started || !jobId) {
|
|
91
|
+
if (flags.json) {
|
|
92
|
+
this.log(JSON.stringify({ daemonId, ...start }, null, 2));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.log(start.alreadyRunning
|
|
96
|
+
? `${auth_core_1.FIRST_PARTY_HARNESS.displayName}: an install or update is already running (job ${start.job?.id ?? 'unknown'}).`
|
|
97
|
+
: `${auth_core_1.FIRST_PARTY_HARNESS.displayName}: ${start.provider?.updateDisabledReason?.trim() || 'the daemon started no update job.'}`);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!flags.wait) {
|
|
101
|
+
if (flags.json) {
|
|
102
|
+
this.log(JSON.stringify({ daemonId, ...start }, null, 2));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.log(`Update started on ${daemonId} — job ${jobId}.`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (!flags.json) {
|
|
109
|
+
this.logToStderr(`Updating ${auth_core_1.FIRST_PARTY_HARNESS.displayName} ${row.version ? `${row.version} ` : ''}on ${daemonId}…`);
|
|
110
|
+
}
|
|
111
|
+
const job = await this.follow(daemonId, jobId, flags.json === true);
|
|
112
|
+
if (!job)
|
|
113
|
+
return;
|
|
114
|
+
if (flags.json) {
|
|
115
|
+
this.log(JSON.stringify({ daemonId, job }, null, 2));
|
|
116
|
+
if (job.status !== 'succeeded')
|
|
117
|
+
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
|
+
}
|
|
128
|
+
this.log((0, cli_installers_1.updateOutcomeLine)(job) ??
|
|
129
|
+
`${auth_core_1.FIRST_PARTY_HARNESS.displayName} updated${job.installedVersion ? ` to ${job.installedVersion}` : ''}.`);
|
|
130
|
+
}
|
|
131
|
+
/** Which daemon the update targets, by the rule every daemon-picking command shares. */
|
|
132
|
+
async resolveTarget(explicit) {
|
|
133
|
+
try {
|
|
134
|
+
return await (0, daemon_target_1.resolveDaemonTarget)({
|
|
135
|
+
explicit,
|
|
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
|
+
}
|
|
205
|
+
}
|
|
206
|
+
this.handleApiError(err);
|
|
207
|
+
return undefined;
|
|
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;
|
|
236
|
+
}
|
|
237
|
+
return outcome.job;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
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;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { checkLocalCodeUpdate, updateLocalCode, type LocalCodeUpdateStatus } from './first-party-harness-update';
|
|
2
|
+
export type CodeUpdateChoice = 'update' | 'once' | 'version' | 'disable';
|
|
3
|
+
export declare function configureCodeStartupChecks(enabled: boolean, env?: NodeJS.ProcessEnv): {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
preferencesPath: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function shouldCheckCodeAtStartup(input: {
|
|
8
|
+
argv: string[];
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
stdinTTY?: boolean;
|
|
11
|
+
stdoutTTY?: boolean;
|
|
12
|
+
stderrTTY?: boolean;
|
|
13
|
+
}): boolean;
|
|
14
|
+
export declare function ttyCodeUpdateAsker(): (result: LocalCodeUpdateStatus) => Promise<CodeUpdateChoice>;
|
|
15
|
+
/** The only caller is a new interactive TUI launch, before any broker or lease. */
|
|
16
|
+
export declare function maybeOfferCodeUpdate(input: {
|
|
17
|
+
argv: string[];
|
|
18
|
+
env?: NodeJS.ProcessEnv;
|
|
19
|
+
say: (line: string) => void;
|
|
20
|
+
stdinTTY?: boolean;
|
|
21
|
+
stdoutTTY?: boolean;
|
|
22
|
+
stderrTTY?: boolean;
|
|
23
|
+
ask?: (result: LocalCodeUpdateStatus) => Promise<CodeUpdateChoice>;
|
|
24
|
+
check?: typeof checkLocalCodeUpdate;
|
|
25
|
+
update?: typeof updateLocalCode;
|
|
26
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configureCodeStartupChecks = configureCodeStartupChecks;
|
|
7
|
+
exports.shouldCheckCodeAtStartup = shouldCheckCodeAtStartup;
|
|
8
|
+
exports.ttyCodeUpdateAsker = ttyCodeUpdateAsker;
|
|
9
|
+
exports.maybeOfferCodeUpdate = maybeOfferCodeUpdate;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
const node_readline_1 = __importDefault(require("node:readline"));
|
|
13
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
14
|
+
const first_party_harness_update_1 = require("./first-party-harness-update");
|
|
15
|
+
function preferencesPath(env) {
|
|
16
|
+
return node_path_1.default.join((0, auth_core_1.resolveConfigRoot)(env), 'code-update-preferences.json');
|
|
17
|
+
}
|
|
18
|
+
function readPreferences(env) {
|
|
19
|
+
try {
|
|
20
|
+
const value = JSON.parse((0, node_fs_1.readFileSync)(preferencesPath(env), 'utf8'));
|
|
21
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
22
|
+
return {};
|
|
23
|
+
const input = value;
|
|
24
|
+
const skipped = input.skippedVersions;
|
|
25
|
+
return {
|
|
26
|
+
...(typeof input.promptOnStartup === 'boolean'
|
|
27
|
+
? { promptOnStartup: input.promptOnStartup }
|
|
28
|
+
: {}),
|
|
29
|
+
...(skipped && typeof skipped === 'object' && !Array.isArray(skipped)
|
|
30
|
+
? {
|
|
31
|
+
skippedVersions: Object.fromEntries(Object.entries(skipped).filter((entry) => typeof entry[1] === 'string')),
|
|
32
|
+
}
|
|
33
|
+
: {}),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function saveChoice(env, result, choice) {
|
|
41
|
+
if (choice !== 'version' && choice !== 'disable')
|
|
42
|
+
return;
|
|
43
|
+
try {
|
|
44
|
+
const previous = readPreferences(env);
|
|
45
|
+
const next = choice === 'disable'
|
|
46
|
+
? { ...previous, promptOnStartup: false }
|
|
47
|
+
: {
|
|
48
|
+
...previous,
|
|
49
|
+
skippedVersions: {
|
|
50
|
+
...previous.skippedVersions,
|
|
51
|
+
[result.channel]: result.offeredVersion,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const file = preferencesPath(env);
|
|
55
|
+
(0, node_fs_1.mkdirSync)(node_path_1.default.dirname(file), { recursive: true, mode: 0o700 });
|
|
56
|
+
const staging = `${file}.${process.pid}.tmp`;
|
|
57
|
+
(0, node_fs_1.writeFileSync)(staging, JSON.stringify(next), { mode: 0o600 });
|
|
58
|
+
(0, node_fs_1.renameSync)(staging, file);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
/* Update preferences must never make a session unavailable. */
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function configureCodeStartupChecks(enabled, env = process.env) {
|
|
65
|
+
const file = preferencesPath(env);
|
|
66
|
+
(0, node_fs_1.mkdirSync)(node_path_1.default.dirname(file), { recursive: true, mode: 0o700 });
|
|
67
|
+
const staging = `${file}.${process.pid}.tmp`;
|
|
68
|
+
(0, node_fs_1.writeFileSync)(staging, JSON.stringify({ ...readPreferences(env), promptOnStartup: enabled }), {
|
|
69
|
+
mode: 0o600,
|
|
70
|
+
});
|
|
71
|
+
(0, node_fs_1.renameSync)(staging, file);
|
|
72
|
+
return { enabled, preferencesPath: file };
|
|
73
|
+
}
|
|
74
|
+
const disabled = (value) => /^(0|false|off|no|disabled)$/i.test(value ?? '');
|
|
75
|
+
const enabled = (value) => /^(1|true|on|yes)$/i.test(value ?? '');
|
|
76
|
+
function shouldCheckCodeAtStartup(input) {
|
|
77
|
+
const env = input.env ?? process.env;
|
|
78
|
+
if (!(input.stdinTTY ?? process.stdin.isTTY) ||
|
|
79
|
+
!(input.stdoutTTY ?? process.stdout.isTTY) ||
|
|
80
|
+
!(input.stderrTTY ?? process.stderr.isTTY))
|
|
81
|
+
return false;
|
|
82
|
+
if (enabled(env.CI) ||
|
|
83
|
+
disabled(env.SKRR_CODE_UPDATE_CHECK) ||
|
|
84
|
+
disabled(env.SKRR_CODE_UPDATE_PROMPT) ||
|
|
85
|
+
enabled(env.OVERSKY_SKIP_UPDATE_CHECK) ||
|
|
86
|
+
enabled(env.OVERSKY_NO_UPDATE_NUDGE))
|
|
87
|
+
return false;
|
|
88
|
+
if ((0, first_party_harness_update_1.localCodeUpdateOwner)(env) !== 'managed' || readPreferences(env).promptOnStartup === false)
|
|
89
|
+
return false;
|
|
90
|
+
if (input.argv.some((arg) => /^(--help|-h|--version|-v|--json|--print|-p|--no-tui|--output|--format)(=|$)/.test(arg)))
|
|
91
|
+
return false;
|
|
92
|
+
if (/^(run|acp|serve|web|auth|upgrade|update|doctor|install|rollback|export|import|session|models)$/.test(input.argv[0] ?? ''))
|
|
93
|
+
return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
function ttyCodeUpdateAsker() {
|
|
97
|
+
return (result) => new Promise((resolve) => {
|
|
98
|
+
const rl = node_readline_1.default.createInterface({ input: process.stdin, output: process.stderr });
|
|
99
|
+
let settled = false;
|
|
100
|
+
const finish = (choice) => {
|
|
101
|
+
if (settled)
|
|
102
|
+
return;
|
|
103
|
+
settled = true;
|
|
104
|
+
rl.close();
|
|
105
|
+
resolve(choice);
|
|
106
|
+
};
|
|
107
|
+
rl.on('close', () => finish('once'));
|
|
108
|
+
rl.question(`\n${auth_core_1.FIRST_PARTY_HARNESS.displayName} update: ${result.installedVersion ?? 'installed version not recorded'} → ${result.offeredVersion} (${result.channel})\n` +
|
|
109
|
+
' [1] Update and start [2] Skip this time [3] Skip this version [4] Disable startup checks\nChoose [2]: ', (reply) => finish(reply.trim() === '1'
|
|
110
|
+
? 'update'
|
|
111
|
+
: reply.trim() === '3'
|
|
112
|
+
? 'version'
|
|
113
|
+
: reply.trim() === '4'
|
|
114
|
+
? 'disable'
|
|
115
|
+
: 'once'));
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/** The only caller is a new interactive TUI launch, before any broker or lease. */
|
|
119
|
+
async function maybeOfferCodeUpdate(input) {
|
|
120
|
+
if (!shouldCheckCodeAtStartup(input))
|
|
121
|
+
return;
|
|
122
|
+
const env = input.env ?? process.env;
|
|
123
|
+
const controller = new AbortController();
|
|
124
|
+
let timer;
|
|
125
|
+
try {
|
|
126
|
+
// Bound the whole discovery, including feed fallbacks; failed checks remain
|
|
127
|
+
// inspectable through update --check but do not hold the session open.
|
|
128
|
+
const timeout = new Promise((resolve) => {
|
|
129
|
+
timer = setTimeout(() => {
|
|
130
|
+
controller.abort();
|
|
131
|
+
resolve(null);
|
|
132
|
+
}, 1500);
|
|
133
|
+
});
|
|
134
|
+
const result = await Promise.race([
|
|
135
|
+
(input.check ?? first_party_harness_update_1.checkLocalCodeUpdate)({
|
|
136
|
+
env,
|
|
137
|
+
signal: controller.signal,
|
|
138
|
+
manifestTimeoutMs: 1500,
|
|
139
|
+
}),
|
|
140
|
+
timeout,
|
|
141
|
+
]);
|
|
142
|
+
if (timer) {
|
|
143
|
+
clearTimeout(timer);
|
|
144
|
+
timer = undefined;
|
|
145
|
+
}
|
|
146
|
+
if (!result || result.state !== 'update-available' || !result.offeredVersion)
|
|
147
|
+
return;
|
|
148
|
+
if (readPreferences(env).skippedVersions?.[result.channel] === result.offeredVersion)
|
|
149
|
+
return;
|
|
150
|
+
const choice = await (input.ask ?? ttyCodeUpdateAsker())(result);
|
|
151
|
+
saveChoice(env, result, choice);
|
|
152
|
+
if (choice !== 'update')
|
|
153
|
+
return;
|
|
154
|
+
const updated = await (input.update ?? first_party_harness_update_1.updateLocalCode)({ env, onProgress: input.say });
|
|
155
|
+
input.say((0, first_party_harness_update_1.formatLocalCodeUpdate)(updated));
|
|
156
|
+
if (updated.state === 'failed')
|
|
157
|
+
input.say('Starting the installed engine. Inspect the update result with `skrr code doctor` or retry `skrr code update`.');
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
input.say(`${auth_core_1.FIRST_PARTY_HARNESS.displayName} update could not complete: ${error instanceof Error ? error.message : String(error)}. Starting the installed engine.`);
|
|
161
|
+
}
|
|
162
|
+
finally {
|
|
163
|
+
if (timer)
|
|
164
|
+
clearTimeout(timer);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFirstPartyHarnessUpdateState } from '@skrr-ai/auth-core/first-party-harness-updater';
|
|
2
|
+
export type CodeUpdateOwner = 'managed' | 'external' | 'desktop' | 'image';
|
|
3
|
+
export interface LocalCodeUpdateStatus {
|
|
4
|
+
component: 'code';
|
|
5
|
+
state: 'not-installed' | 'unchecked' | 'up-to-date' | 'update-available' | 'owner-managed' | 'check-failed' | 'installed' | 'failed' | 'rolled-back';
|
|
6
|
+
runningVersion: null;
|
|
7
|
+
installedVersion: string | null;
|
|
8
|
+
offeredVersion: string | null;
|
|
9
|
+
channel: string;
|
|
10
|
+
owner: CodeUpdateOwner;
|
|
11
|
+
activePath: string | null;
|
|
12
|
+
managedPath: string;
|
|
13
|
+
installedVerified: boolean;
|
|
14
|
+
command: string;
|
|
15
|
+
lastAttempt: ReturnType<typeof readFirstPartyHarnessUpdateState>;
|
|
16
|
+
message?: string;
|
|
17
|
+
code?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LocalCodeUpdateOptions {
|
|
20
|
+
env?: NodeJS.ProcessEnv;
|
|
21
|
+
force?: boolean;
|
|
22
|
+
version?: string;
|
|
23
|
+
allowDowngrade?: boolean;
|
|
24
|
+
onProgress?: (line: string) => void;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
manifestTimeoutMs?: number;
|
|
27
|
+
/** Only an explicit install may adopt an engine currently found on PATH. */
|
|
28
|
+
install?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function localCodeUpdateOwner(env?: NodeJS.ProcessEnv): CodeUpdateOwner;
|
|
31
|
+
/** Read metadata without networking or executing the engine. External versions are unknown. */
|
|
32
|
+
export declare function getLocalCodeUpdateStatus(env?: NodeJS.ProcessEnv): LocalCodeUpdateStatus;
|
|
33
|
+
export declare function checkLocalCodeUpdate(options?: LocalCodeUpdateOptions): Promise<LocalCodeUpdateStatus>;
|
|
34
|
+
export declare function updateLocalCode(options?: LocalCodeUpdateOptions): Promise<LocalCodeUpdateStatus>;
|
|
35
|
+
export declare function rollbackLocalCode(env?: NodeJS.ProcessEnv): LocalCodeUpdateStatus;
|
|
36
|
+
/** Explicit --no-wait launches the same local command, with a durable private log. */
|
|
37
|
+
export declare function startLocalCodeUpdate(options?: LocalCodeUpdateOptions & {
|
|
38
|
+
operation?: 'install' | 'update';
|
|
39
|
+
}): Promise<{
|
|
40
|
+
component: 'code';
|
|
41
|
+
state: 'queued';
|
|
42
|
+
pid: number;
|
|
43
|
+
logPath: string;
|
|
44
|
+
command: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare function formatLocalCodeUpdate(result: LocalCodeUpdateStatus): string;
|