@skrr-ai/cli 0.1.94 → 0.1.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +153 -165
  2. package/bin/run.js +32 -0
  3. package/bin/update-npm-runner.cjs +33 -0
  4. package/bin/update-session.cjs +194 -0
  5. package/bin/update-worker.cjs +208 -0
  6. package/dist/base-command.js +0 -15
  7. package/dist/commands/code/doctor.d.ts +1 -0
  8. package/dist/commands/code/doctor.js +6 -0
  9. package/dist/commands/code/index.js +4 -0
  10. package/dist/commands/code/install.d.ts +5 -62
  11. package/dist/commands/code/install.js +86 -279
  12. package/dist/commands/code/rollback.d.ts +8 -0
  13. package/dist/commands/code/rollback.js +20 -0
  14. package/dist/commands/code/update.d.ts +8 -37
  15. package/dist/commands/code/update.js +134 -213
  16. package/dist/commands/daemon/install.js +4 -0
  17. package/dist/commands/generate-recovery-code.d.ts +13 -1
  18. package/dist/commands/generate-recovery-code.js +146 -13
  19. package/dist/commands/instructions/guide.d.ts +20 -0
  20. package/dist/commands/instructions/guide.js +84 -0
  21. package/dist/commands/instructions/install.js +57 -33
  22. package/dist/commands/instructions/setup.d.ts +14 -0
  23. package/dist/commands/instructions/setup.js +72 -0
  24. package/dist/commands/integrations/execute.js +1 -1
  25. package/dist/commands/login.d.ts +5 -6
  26. package/dist/commands/login.js +27 -11
  27. package/dist/commands/logout.js +7 -7
  28. package/dist/commands/security/overview.d.ts +11 -0
  29. package/dist/commands/security/overview.js +158 -0
  30. package/dist/commands/spaces/claim.d.ts +12 -0
  31. package/dist/commands/spaces/claim.js +42 -0
  32. package/dist/commands/spaces/ownership.d.ts +12 -0
  33. package/dist/commands/spaces/ownership.js +46 -0
  34. package/dist/commands/tasks/cancel-cascade.js +1 -1
  35. package/dist/commands/tasks/create-tree.d.ts +5 -1
  36. package/dist/commands/tasks/create-tree.js +35 -7
  37. package/dist/commands/tasks/interrupt.js +2 -2
  38. package/dist/commands/tasks/pause-schedule.js +1 -1
  39. package/dist/commands/token/list.d.ts +3 -5
  40. package/dist/commands/token/list.js +99 -57
  41. package/dist/commands/update.d.ts +14 -0
  42. package/dist/commands/update.js +61 -0
  43. package/dist/generated/managed-instruction-guides.json +9 -0
  44. package/dist/hooks/init.d.ts +5 -0
  45. package/dist/hooks/init.js +27 -0
  46. package/dist/lib/commitments.d.ts +0 -8
  47. package/dist/lib/commitments.js +0 -52
  48. package/dist/lib/daemon-installer.d.ts +2 -0
  49. package/dist/lib/daemon-installer.js +100 -24
  50. package/dist/lib/first-party-harness-doctor.js +31 -1
  51. package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
  52. package/dist/lib/first-party-harness-remote-install.js +310 -0
  53. package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
  54. package/dist/lib/first-party-harness-remote-update.js +242 -0
  55. package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
  56. package/dist/lib/first-party-harness-startup-update.js +166 -0
  57. package/dist/lib/first-party-harness-update.d.ts +46 -0
  58. package/dist/lib/first-party-harness-update.js +289 -0
  59. package/dist/lib/first-party-harness.js +7 -4
  60. package/dist/lib/managed-instruction-local.d.ts +12 -0
  61. package/dist/lib/managed-instruction-local.js +58 -0
  62. package/dist/lib/managed-instruction-setup.d.ts +35 -0
  63. package/dist/lib/managed-instruction-setup.js +306 -0
  64. package/dist/lib/memory-sync.d.ts +1 -0
  65. package/dist/lib/memory-sync.js +279 -68
  66. package/dist/lib/platform-update-local.d.ts +2 -0
  67. package/dist/lib/platform-update-local.js +113 -0
  68. package/dist/lib/platform-update.d.ts +39 -0
  69. package/dist/lib/platform-update.js +84 -0
  70. package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
  71. package/dist/lib/profile-machine-identity-guard.js +13 -0
  72. package/dist/lib/prompt.d.ts +1 -0
  73. package/dist/lib/prompt.js +4 -3
  74. package/dist/lib/task-batch.d.ts +9 -0
  75. package/dist/lib/task-batch.js +94 -17
  76. package/dist/lib/task-instruction-offer.d.ts +1 -4
  77. package/dist/lib/task-instruction-offer.js +3 -129
  78. package/dist/lib/update-check.d.ts +61 -53
  79. package/dist/lib/update-check.js +453 -314
  80. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +3 -4
  81. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
  82. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
  83. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
  86. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +32 -0
  87. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
  88. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
  89. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
  90. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
  91. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
  92. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
  93. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
  94. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -0
  95. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +3 -4
  96. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
  97. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
  98. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
  99. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
  100. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -0
  101. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +32 -0
  102. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
  103. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
  104. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
  105. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
  106. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
  107. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
  108. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
  109. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
  110. package/dist/node_modules/@skrr-ai/auth-core/package.json +31 -1
  111. package/dist/node_modules/@skrr-ai/data-provider/index.js +6584 -6567
  112. package/docs/v1/README.md +28 -0
  113. package/docs/v1/api.md +55 -0
  114. package/docs/v1/changelog.md +16 -0
  115. package/docs/v1/check-examples.mjs +178 -0
  116. package/docs/v1/examples/api-readonly.mjs +144 -0
  117. package/docs/v1/operations.md +87 -0
  118. package/docs/v1/quickstart.md +71 -0
  119. package/oclif.manifest.json +46007 -45462
  120. package/package.json +13 -11
@@ -18,10 +18,9 @@
18
18
  * quietly redeclaring. This follows that road rather than reopening the one it
19
19
  * replaced.
20
20
  *
21
- * Only the VOCABULARY lives here — channel names, the env var, the default, the
22
- * URL shape and the feed candidates. The installer, the signature verification
23
- * and the promotion machinery stay in the daemon, which is the only process that
24
- * performs them.
21
+ * Channel vocabulary stays here. The shared signed installer lives beside it
22
+ * in firstPartyHarnessUpdater.ts, used by CLI, Daemon and Desktop so updating
23
+ * a local engine needs neither a running daemon nor an account.
25
24
  *
26
25
  * Every product-named value comes from `firstPartyHarness.ts`; nothing in this
27
26
  * file spells the product.
@@ -19,10 +19,9 @@
19
19
  * quietly redeclaring. This follows that road rather than reopening the one it
20
20
  * replaced.
21
21
  *
22
- * Only the VOCABULARY lives here — channel names, the env var, the default, the
23
- * URL shape and the feed candidates. The installer, the signature verification
24
- * and the promotion machinery stay in the daemon, which is the only process that
25
- * performs them.
22
+ * Channel vocabulary stays here. The shared signed installer lives beside it
23
+ * in firstPartyHarnessUpdater.ts, used by CLI, Daemon and Desktop so updating
24
+ * a local engine needs neither a running daemon nor an account.
26
25
  *
27
26
  * Every product-named value comes from `firstPartyHarness.ts`; nothing in this
28
27
  * file spells the product.
@@ -0,0 +1,82 @@
1
+ /**
2
+ * WL-6.8 — ed25519 public keys that vouch for a **first-party harness binary**.
3
+ *
4
+ * ── Why this is not `daemon/src/release-keys.ts` ───────────────────────────
5
+ *
6
+ * `verifyHarnessProvenance` originally defaulted to the daemon's own
7
+ * self-update keys. That is convenient and wrong. Those two keys answer
8
+ * different questions and protect different things:
9
+ *
10
+ * `OVERSKY_RELEASE_PUBLIC_KEYS` — "may this binary REPLACE the daemon?"
11
+ * `FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS` — "may this binary receive a
12
+ * platform credential?"
13
+ *
14
+ * Sharing one key means a compromise of the harness signing identity is also a
15
+ * forged-daemon-self-update primitive: an attacker who can sign a harness can
16
+ * sign a manifest that the daemon installs over itself. That is a strictly
17
+ * larger blast radius than the harness key needs to carry, and it is
18
+ * unnecessary — the two artifacts have different release cadences and
19
+ * different publishers, so they were always going to want independent
20
+ * rotation.
21
+ *
22
+ * Separating them costs one more secret to provision and removes an
23
+ * escalation path. That trade is not close.
24
+ *
25
+ * ── Fail-closed, and in the direction that matters ─────────────────────────
26
+ *
27
+ * EMPTY means provenance can never be established. Until 2026-08-11 that also
28
+ * meant the first-party harness was held at Tier 2 on a scoped gateway token; that
29
+ * floor has since been removed, and it is DECLARED Tier 1, so an empty list no
30
+ * longer withholds the credential privilege from it. What an empty list still
31
+ * costs is the ability to say WHICH BYTES held the credential — the verdict
32
+ * becomes `unverifiable`, and the record is silent about the binary on disk.
33
+ *
34
+ * The fail-closed direction below still governs every OTHER
35
+ * OverSky-distributed harness, and remains the correct posture for this one if
36
+ * the floor is ever restored.
37
+ *
38
+ * Note this is the OPPOSITE posture to the daemon's own `../release-keys.ts`
39
+ * (same basename, different module), deliberately. There,
40
+ * an empty list disables verification and the updater proceeds, because a fleet
41
+ * that cannot update is its own outage. Here, an empty list withholds a
42
+ * privilege, because absence of evidence must never grant one. Getting these
43
+ * two backwards would mean provisioning a key *reduces* what the daemon trusts.
44
+ *
45
+ * ── Provisioning ──────────────────────────────────────────────────────────
46
+ *
47
+ * 1. Mint: node scripts/first-party-harness/generate-signing-key.mjs (in the fork)
48
+ * 2. Store the PRIVATE half as the GH Actions secret
49
+ * `FIRST_PARTY_HARNESS_ENV.signingKey.name` (the only name the publish
50
+ * workflow reads) + AWS Secrets Manager. It must never be committed and
51
+ * never leave CI.
52
+ * 3. Paste the PUBLIC half below, newest first.
53
+ * 4. Ship a daemon build carrying it BEFORE the first signed harness
54
+ * release, so the fleet can verify what it is about to be handed.
55
+ *
56
+ * Rotation is the same shape as the daemon's: add the next key ABOVE the
57
+ * current one, ship that build, then start dual-signing. Verification accepts
58
+ * any pinned key, so an overlap window has no gap.
59
+ */
60
+ import type { ReleaseKey } from './releaseKeys.js';
61
+ export type { ReleaseKey };
62
+ /**
63
+ * Pinned first-party harness signing public keys, newest first.
64
+ *
65
+ * Provisioned 2026-08-07 (WL-6.8). The private half lives in the GitHub secret
66
+ * named by `FIRST_PARTY_HARNESS_ENV.signingKey` and in AWS Secrets Manager — a
67
+ * HARNESS key, deliberately a different trust domain from the daemon
68
+ * self-update key in `../release-keys.ts`.
69
+ *
70
+ * ── Two literals that must NOT follow a rename (contract §6) ────────────────
71
+ * The `keyId` below and the AWS secret path `oversky/sky-code/signing-key` are
72
+ * historical identifiers, not the product name. A key id is inside every
73
+ * signature ever issued and every provenance sidecar ever written, so changing
74
+ * it would make every existing release unverifiable; the secret is stateful
75
+ * infrastructure. Both move only at the next key ROTATION.
76
+ *
77
+ * ORDER OF OPERATIONS, and it only works one way round: this pinned build must
78
+ * SHIP before any harness release is signed. Backwards, the fleet receives an
79
+ * artifact it cannot verify and every daemon reports `invalid-signature` —
80
+ * which from the outside is indistinguishable from a real attack.
81
+ */
82
+ export declare const FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS: ReleaseKey[];
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ /**
3
+ * WL-6.8 — ed25519 public keys that vouch for a **first-party harness binary**.
4
+ *
5
+ * ── Why this is not `daemon/src/release-keys.ts` ───────────────────────────
6
+ *
7
+ * `verifyHarnessProvenance` originally defaulted to the daemon's own
8
+ * self-update keys. That is convenient and wrong. Those two keys answer
9
+ * different questions and protect different things:
10
+ *
11
+ * `OVERSKY_RELEASE_PUBLIC_KEYS` — "may this binary REPLACE the daemon?"
12
+ * `FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS` — "may this binary receive a
13
+ * platform credential?"
14
+ *
15
+ * Sharing one key means a compromise of the harness signing identity is also a
16
+ * forged-daemon-self-update primitive: an attacker who can sign a harness can
17
+ * sign a manifest that the daemon installs over itself. That is a strictly
18
+ * larger blast radius than the harness key needs to carry, and it is
19
+ * unnecessary — the two artifacts have different release cadences and
20
+ * different publishers, so they were always going to want independent
21
+ * rotation.
22
+ *
23
+ * Separating them costs one more secret to provision and removes an
24
+ * escalation path. That trade is not close.
25
+ *
26
+ * ── Fail-closed, and in the direction that matters ─────────────────────────
27
+ *
28
+ * EMPTY means provenance can never be established. Until 2026-08-11 that also
29
+ * meant the first-party harness was held at Tier 2 on a scoped gateway token; that
30
+ * floor has since been removed, and it is DECLARED Tier 1, so an empty list no
31
+ * longer withholds the credential privilege from it. What an empty list still
32
+ * costs is the ability to say WHICH BYTES held the credential — the verdict
33
+ * becomes `unverifiable`, and the record is silent about the binary on disk.
34
+ *
35
+ * The fail-closed direction below still governs every OTHER
36
+ * OverSky-distributed harness, and remains the correct posture for this one if
37
+ * the floor is ever restored.
38
+ *
39
+ * Note this is the OPPOSITE posture to the daemon's own `../release-keys.ts`
40
+ * (same basename, different module), deliberately. There,
41
+ * an empty list disables verification and the updater proceeds, because a fleet
42
+ * that cannot update is its own outage. Here, an empty list withholds a
43
+ * privilege, because absence of evidence must never grant one. Getting these
44
+ * two backwards would mean provisioning a key *reduces* what the daemon trusts.
45
+ *
46
+ * ── Provisioning ──────────────────────────────────────────────────────────
47
+ *
48
+ * 1. Mint: node scripts/first-party-harness/generate-signing-key.mjs (in the fork)
49
+ * 2. Store the PRIVATE half as the GH Actions secret
50
+ * `FIRST_PARTY_HARNESS_ENV.signingKey.name` (the only name the publish
51
+ * workflow reads) + AWS Secrets Manager. It must never be committed and
52
+ * never leave CI.
53
+ * 3. Paste the PUBLIC half below, newest first.
54
+ * 4. Ship a daemon build carrying it BEFORE the first signed harness
55
+ * release, so the fleet can verify what it is about to be handed.
56
+ *
57
+ * Rotation is the same shape as the daemon's: add the next key ABOVE the
58
+ * current one, ship that build, then start dual-signing. Verification accepts
59
+ * any pinned key, so an overlap window has no gap.
60
+ */
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS = void 0;
63
+ /**
64
+ * Pinned first-party harness signing public keys, newest first.
65
+ *
66
+ * Provisioned 2026-08-07 (WL-6.8). The private half lives in the GitHub secret
67
+ * named by `FIRST_PARTY_HARNESS_ENV.signingKey` and in AWS Secrets Manager — a
68
+ * HARNESS key, deliberately a different trust domain from the daemon
69
+ * self-update key in `../release-keys.ts`.
70
+ *
71
+ * ── Two literals that must NOT follow a rename (contract §6) ────────────────
72
+ * The `keyId` below and the AWS secret path `oversky/sky-code/signing-key` are
73
+ * historical identifiers, not the product name. A key id is inside every
74
+ * signature ever issued and every provenance sidecar ever written, so changing
75
+ * it would make every existing release unverifiable; the secret is stateful
76
+ * infrastructure. Both move only at the next key ROTATION.
77
+ *
78
+ * ORDER OF OPERATIONS, and it only works one way round: this pinned build must
79
+ * SHIP before any harness release is signed. Backwards, the fleet receives an
80
+ * artifact it cannot verify and every daemon reports `invalid-signature` —
81
+ * which from the outside is indistinguishable from a real attack.
82
+ */
83
+ exports.FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS = [
84
+ // ── NEXT key goes ABOVE this line during a rotation (newest first). ──
85
+ {
86
+ // Literal on purpose: a key id is inside every signature issued (contract §6).
87
+ keyId: 'sky-code-2026-08',
88
+ publicKeySpkiB64: 'MCowBQYDK2VwAyEAO/5glF6bICuz5MGYgG1PJaDEgXJZkUuv2cLzguVZCvY=',
89
+ },
90
+ ];
91
+ /*
92
+ * Dev/test escape hatch: an absolute path to a JSON file holding
93
+ * `[{ keyId, publicKeySpkiB64 }]`, named by `FIRST_PARTY_HARNESS_ENV.devKeys` and
94
+ * read in `./provenance.ts` with `readFirstPartyHarnessEnv(env, 'devKeys')` — its
95
+ * brand-neutral name, the only one read.
96
+ *
97
+ * Exists so a developer can build, sign, and verify a local harness end to end
98
+ * without minting a production key — the alternative is that the whole trust
99
+ * chain is only ever exercised in CI, which is how it rots.
100
+ *
101
+ * Deliberately NOT a way to weaken production: it can only ADD keys a local
102
+ * operator explicitly pointed at, it is read from an absolute path (a relative
103
+ * one would be attacker-influenced via cwd), and a build that ships with an
104
+ * empty pinned list still refuses to elevate without it.
105
+ */
@@ -0,0 +1,110 @@
1
+ import { type FirstPartyHarnessChannel } from './firstPartyHarnessChannels.js';
2
+ import { type DaemonVersionManifest, type PlatformArtifact, type ReleaseKey } from './releaseManifest.js';
3
+ export { FIRST_PARTY_HARNESS_RELEASE_PUBLIC_KEYS } from './firstPartyHarnessReleaseKeys.js';
4
+ export { firstPartyHarnessFeedBase, firstPartyHarnessFeedCandidates, } from './firstPartyHarnessChannels.js';
5
+ export { firstPartyHarnessManifestFile } from './firstPartyHarness.js';
6
+ export type { ReleaseKey } from './releaseManifest.js';
7
+ export declare const PREVIOUS_SUFFIX = ".previous";
8
+ export declare const PROVENANCE_SUFFIX = ".oversky-provenance.json";
9
+ export declare const MAX_ARTIFACT_BYTES: number;
10
+ export type InstallFailureCode = 'unsupported-platform' | 'feed-unreachable' | 'manifest-malformed' | 'manifest-unverified' | 'artifact-missing' | 'artifact-unverified' | 'download-failed' | 'hash-mismatch' | 'too-large' | 'install-failed' | 'no-pinned-keys' | 'downgrade-refused' | 'version-invalid' | 'lock-busy' | 'minimum-version' | 'policy-rejected';
11
+ export interface InstallResult {
12
+ ok: boolean;
13
+ version?: string;
14
+ platform?: string;
15
+ binaryPath?: string;
16
+ replaced?: boolean;
17
+ changed?: boolean;
18
+ reason?: string;
19
+ code?: InstallFailureCode;
20
+ error?: string;
21
+ }
22
+ export interface InstallOptions {
23
+ env?: NodeJS.ProcessEnv;
24
+ keys?: readonly ReleaseKey[];
25
+ fetchImpl?: typeof fetch;
26
+ platform?: NodeJS.Platform;
27
+ arch?: string;
28
+ onProgress?: (message: string) => void;
29
+ version?: string;
30
+ allowDowngrade?: boolean;
31
+ signal?: AbortSignal;
32
+ manifestTimeoutMs?: number;
33
+ autonomous?: boolean;
34
+ cohortSubject?: string;
35
+ contracts?: Record<string, number>;
36
+ now?: Date;
37
+ }
38
+ export interface HarnessProvenanceRecord {
39
+ version: string;
40
+ platform: string;
41
+ sha256: string;
42
+ url: string;
43
+ sig: string;
44
+ sigs?: PlatformArtifact['sigs'];
45
+ keyId?: string;
46
+ }
47
+ export interface FirstPartyHarnessUpdateState {
48
+ operation: 'install' | 'rollback';
49
+ status: 'running' | 'succeeded' | 'failed';
50
+ attemptedAt: number;
51
+ completedAt?: number;
52
+ targetVersion?: string;
53
+ installedVersion?: string;
54
+ code?: InstallFailureCode;
55
+ error?: string;
56
+ changed?: boolean;
57
+ }
58
+ type InstallFailure = InstallResult & {
59
+ ok: false;
60
+ };
61
+ export declare function firstPartyHarnessInstallDir(env?: NodeJS.ProcessEnv): string;
62
+ export declare function firstPartyHarnessBinaryPath(env?: NodeJS.ProcessEnv): string;
63
+ export declare function firstPartyHarnessPlatformKey(platform?: NodeJS.Platform, arch?: string): string | null;
64
+ export declare function fetchVerifiedManifest(options?: InstallOptions): Promise<{
65
+ ok: true;
66
+ manifest: DaemonVersionManifest;
67
+ } | InstallFailure>;
68
+ export declare function isManagedFirstPartyHarnessReleasePath(binaryPath: string, env?: NodeJS.ProcessEnv): boolean;
69
+ /** Read a single immutable binary/sidecar pair, never two different `current` targets. */
70
+ export declare function getVerifiedInstalledFirstPartyHarness(options?: Pick<InstallOptions, 'env' | 'keys' | 'platform' | 'arch'>): {
71
+ binaryPath: string;
72
+ version: string | null;
73
+ verified: boolean;
74
+ exists: boolean;
75
+ provenance: HarnessProvenanceRecord | null;
76
+ };
77
+ export declare function readFirstPartyHarnessUpdateState(env?: NodeJS.ProcessEnv): FirstPartyHarnessUpdateState | null;
78
+ export interface ActivateFirstPartyHarnessOptions {
79
+ binary: Buffer;
80
+ provenance: HarnessProvenanceRecord;
81
+ env?: NodeJS.ProcessEnv;
82
+ keys?: readonly ReleaseKey[];
83
+ platform?: NodeJS.Platform;
84
+ arch?: string;
85
+ allowDowngrade?: boolean;
86
+ onProgress?: (message: string) => void;
87
+ preserveUnknownInstalled?: boolean;
88
+ preserveExternalLink?: boolean;
89
+ /** Optional already verified signed manifest; retained as minimum-floor evidence. */
90
+ manifest?: DaemonVersionManifest;
91
+ }
92
+ /** Desktop's already-downloaded signed artifact uses the exact same transaction. */
93
+ export declare function activateVerifiedFirstPartyHarnessArtifact(options: ActivateFirstPartyHarnessOptions): InstallResult;
94
+ /** Signed-manifest check reads only; no lock, migration, state writes or login. */
95
+ export declare function checkFirstPartyHarnessUpdate(options?: InstallOptions): Promise<{
96
+ ok: true;
97
+ installedVersion: string | null;
98
+ latestVersion: string;
99
+ channel: FirstPartyHarnessChannel;
100
+ updateAvailable: boolean;
101
+ binaryPath: string;
102
+ owner: 'managed' | 'external';
103
+ installedVerified: boolean;
104
+ minimumVersion: string;
105
+ lastUpdate: FirstPartyHarnessUpdateState | null;
106
+ } | InstallFailure>;
107
+ export declare function installFirstPartyHarness(options?: InstallOptions): Promise<InstallResult>;
108
+ /** Rollback validates the retained immutable release and preserves its signature. */
109
+ export declare function rollbackFirstPartyHarness(env?: NodeJS.ProcessEnv, options?: Pick<InstallOptions, 'keys'>): InstallResult;
110
+ export declare function installedFirstPartyHarnessSize(env?: NodeJS.ProcessEnv): number | null;