@skrr-ai/cli 0.1.32 → 0.1.34

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 (114) hide show
  1. package/bin/run.js +2 -2
  2. package/dist/base-command.js +5 -0
  3. package/dist/commands/agents/list.d.ts +2 -1
  4. package/dist/commands/agents/list.js +2 -1
  5. package/dist/commands/agents/show.js +2 -1
  6. package/dist/commands/balance/statement.js +8 -4
  7. package/dist/commands/browser/install.js +6 -2
  8. package/dist/commands/browser/uninstall.js +6 -2
  9. package/dist/commands/code/acp.js +2 -1
  10. package/dist/commands/code/doctor.d.ts +1 -1
  11. package/dist/commands/code/doctor.js +6 -5
  12. package/dist/commands/code/handover.d.ts +2 -2
  13. package/dist/commands/code/handover.js +2 -2
  14. package/dist/commands/code/index.d.ts +2 -2
  15. package/dist/commands/code/index.js +18 -17
  16. package/dist/commands/code/install.d.ts +3 -3
  17. package/dist/commands/code/install.js +18 -11
  18. package/dist/commands/code/migrate.js +3 -2
  19. package/dist/commands/code/oversky-agent.d.ts +5 -4
  20. package/dist/commands/code/oversky-agent.js +24 -22
  21. package/dist/commands/code/run.js +2 -1
  22. package/dist/commands/harnesses/list.d.ts +9 -1
  23. package/dist/commands/harnesses/list.js +28 -7
  24. package/dist/commands/harnesses/show.js +7 -2
  25. package/dist/commands/instructions/install.js +16 -6
  26. package/dist/commands/learning/delete.d.ts +9 -0
  27. package/dist/commands/learning/delete.js +40 -0
  28. package/dist/commands/learning/export.d.ts +9 -0
  29. package/dist/commands/learning/export.js +56 -0
  30. package/dist/commands/learning/reset.d.ts +9 -0
  31. package/dist/commands/learning/reset.js +36 -0
  32. package/dist/commands/learning/set.d.ts +10 -0
  33. package/dist/commands/learning/set.js +52 -0
  34. package/dist/commands/learning/status.d.ts +8 -0
  35. package/dist/commands/learning/status.js +35 -0
  36. package/dist/commands/logout.js +10 -5
  37. package/dist/commands/machines/dedicated/attach.js +2 -1
  38. package/dist/commands/tasks/runs.js +3 -1
  39. package/dist/commands/workspaces/use.js +2 -1
  40. package/dist/lib/adaptive-learning.d.ts +37 -0
  41. package/dist/lib/adaptive-learning.js +39 -0
  42. package/dist/lib/auth-core-init.d.ts +23 -0
  43. package/dist/lib/auth-core-init.js +61 -0
  44. package/dist/lib/code-handover.d.ts +1 -1
  45. package/dist/lib/code-handover.js +3 -2
  46. package/dist/lib/config.d.ts +30 -4
  47. package/dist/lib/config.js +2 -1
  48. package/dist/lib/daemon-installer.d.ts +1 -1
  49. package/dist/lib/daemon-target.js +2 -2
  50. package/dist/lib/dedicated-machines.d.ts +2 -2
  51. package/dist/lib/dedicated-machines.js +11 -4
  52. package/dist/lib/exec-runtime-binary.d.ts +2 -2
  53. package/dist/lib/exec-runtime-binary.js +2 -2
  54. package/dist/lib/{sky-code-agent.d.ts → first-party-harness-agent.d.ts} +20 -19
  55. package/dist/lib/{sky-code-agent.js → first-party-harness-agent.js} +85 -47
  56. package/dist/lib/{sky-code-broker.d.ts → first-party-harness-broker.d.ts} +6 -6
  57. package/dist/lib/{sky-code-broker.js → first-party-harness-broker.js} +23 -23
  58. package/dist/lib/{sky-code-doctor.d.ts → first-party-harness-doctor.d.ts} +12 -2
  59. package/dist/lib/{sky-code-doctor.js → first-party-harness-doctor.js} +181 -94
  60. package/dist/lib/{sky-code-managed.d.ts → first-party-harness-managed.d.ts} +55 -30
  61. package/dist/lib/{sky-code-managed.js → first-party-harness-managed.js} +92 -35
  62. package/dist/lib/{sky-code.d.ts → first-party-harness.d.ts} +107 -36
  63. package/dist/lib/{sky-code.js → first-party-harness.js} +172 -73
  64. package/dist/lib/harness-provider-input.d.ts +35 -0
  65. package/dist/lib/harness-provider-input.js +57 -0
  66. package/dist/lib/harness-tiers.d.ts +8 -2
  67. package/dist/lib/harness-tiers.js +11 -6
  68. package/dist/lib/task-instruction-offer.js +10 -4
  69. package/dist/lib/worklogs.js +2 -2
  70. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +2 -2
  71. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +2 -2
  72. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +248 -0
  73. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +361 -0
  74. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +147 -0
  75. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +180 -0
  76. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessHome.d.ts +111 -0
  77. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessHome.js +314 -0
  78. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.d.ts +11 -5
  79. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +14 -7
  80. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +3 -1
  81. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +51 -14
  82. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.js +1 -1
  83. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +4 -4
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +4 -4
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +2 -2
  86. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +2 -2
  87. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +248 -0
  88. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +332 -0
  89. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +147 -0
  90. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +170 -0
  91. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessHome.d.ts +111 -0
  92. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessHome.js +303 -0
  93. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.d.ts +11 -5
  94. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +14 -7
  95. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +3 -1
  96. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +12 -2
  97. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.js +1 -1
  98. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +4 -4
  99. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +4 -4
  100. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  101. package/dist/node_modules/@skrr-ai/data-provider/index.js +4816 -4782
  102. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.d.ts +1 -1
  103. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.js +1 -1
  104. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +1 -1
  105. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.d.ts +1 -1
  106. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.js +1 -1
  107. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +1 -1
  108. package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
  109. package/oclif.manifest.json +34286 -33962
  110. package/package.json +5 -2
  111. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/skyCodeChannels.d.ts +0 -96
  112. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/skyCodeChannels.js +0 -115
  113. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/skyCodeChannels.d.ts +0 -96
  114. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/skyCodeChannels.js +0 -107
@@ -0,0 +1,314 @@
1
+ "use strict";
2
+ /**
3
+ * Where the first-party harness lives on disk, and the one-time move that keeps
4
+ * that true across a rename.
5
+ *
6
+ * ── Why one implementation ────────────────────────────────────────────────
7
+ *
8
+ * Three processes put an engine under the skrr root and read it back: the daemon
9
+ * installer, the CLI (`skrr code`), and the desktop app's bundled-engine
10
+ * install. Each used to build `<root>/sky-code/bin/sky-code` itself, and they
11
+ * already disagreed once about which root that was (see `configRoot.ts`). A
12
+ * rename that every one of them had to perform independently would disagree
13
+ * again, so the paths AND the move live here.
14
+ *
15
+ * ── The move ──────────────────────────────────────────────────────────────
16
+ *
17
+ * Idempotent, lossless, and safe to run concurrently from all three:
18
+ *
19
+ * 1. The HOME follows the engine's namespace. If `<root>/<appName>` does not
20
+ * exist and `<root>/<legacyAppName>` is a real directory, rename it and
21
+ * leave the legacy name as a relative symlink. (No legacy app name exists
22
+ * yet; this step is what an engine-namespace rename will use.)
23
+ * 2. The BINARY follows the provider. Inside `<home>/bin`, if the canonical
24
+ * binary does not exist and an alias binary is a real file, rename it and
25
+ * each companion (rollback copy, provenance sidecar), leaving a relative
26
+ * symlink at every old name.
27
+ *
28
+ * The two follow different names on purpose: the home is shared with the
29
+ * engine, which reads its config and managed `AGENTS.md` from it, so it can only
30
+ * move when the engine's namespace does (`firstPartyHarnessHomeDirname`). The
31
+ * symlinks are the compatibility story, not an afterthought: every CLI and
32
+ * daemon already installed reads the legacy binary path, and a symlink keeps
33
+ * them working with no coordination.
34
+ *
35
+ * It never overwrites, never deletes, and never renames THROUGH a symlink, so
36
+ * running it twice, or after a downgrade, changes nothing. Any error leaves the
37
+ * tree exactly as it was and is reported rather than thrown: a failed move must
38
+ * degrade to reading the old path, not to an engine that cannot start.
39
+ *
40
+ * Skipped on Windows, where creating a symlink needs a privilege a normal user
41
+ * does not hold, and where no engine artifact is published anyway.
42
+ */
43
+ var __importDefault = (this && this.__importDefault) || function (mod) {
44
+ return (mod && mod.__esModule) ? mod : { "default": mod };
45
+ };
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX = exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX = void 0;
48
+ exports.firstPartyHarnessHomeDir = firstPartyHarnessHomeDir;
49
+ exports.firstPartyHarnessBinDir = firstPartyHarnessBinDir;
50
+ exports.firstPartyHarnessInstalledBinaryPath = firstPartyHarnessInstalledBinaryPath;
51
+ exports.migrateFirstPartyHarnessHome = migrateFirstPartyHarnessHome;
52
+ exports.linkFirstPartyHarnessAliases = linkFirstPartyHarnessAliases;
53
+ const node_fs_1 = require("node:fs");
54
+ const node_path_1 = __importDefault(require("node:path"));
55
+ const configRoot_js_1 = require("./configRoot.js");
56
+ const firstPartyHarness_js_1 = require("./firstPartyHarness.js");
57
+ /** Suffix of the rollback copy the installer keeps beside the binary. */
58
+ exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX = '.previous';
59
+ /**
60
+ * Suffix of the provenance record beside the binary. The `oversky` in it is a
61
+ * persisted file name that already exists on machines, not the product name.
62
+ */
63
+ exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX = '.oversky-provenance.json';
64
+ /** `<root>/<engine appName>` — the engine home, shared by the platform and the engine. */
65
+ function firstPartyHarnessHomeDir(env = process.env) {
66
+ return node_path_1.default.join((0, configRoot_js_1.resolveConfigRoot)(env), (0, firstPartyHarness_js_1.firstPartyHarnessHomeDirname)());
67
+ }
68
+ /** `<home>/bin`, where the platform installs the engine binary. */
69
+ function firstPartyHarnessBinDir(env = process.env) {
70
+ return node_path_1.default.join(firstPartyHarnessHomeDir(env), 'bin');
71
+ }
72
+ /** The installed binary path for a spelling (canonical by default) — lookup order is canonical first. */
73
+ function firstPartyHarnessInstalledBinaryPath(env = process.env, provider = firstPartyHarness_js_1.FIRST_PARTY_HARNESS.provider, platform = process.platform) {
74
+ return node_path_1.default.join(firstPartyHarnessBinDir(env), (0, firstPartyHarness_js_1.firstPartyHarnessBinaryName)(provider, platform));
75
+ }
76
+ const NODE_FS = {
77
+ lstat(p) {
78
+ try {
79
+ return (0, node_fs_1.lstatSync)(p);
80
+ }
81
+ catch {
82
+ return null;
83
+ }
84
+ },
85
+ readlink(p) {
86
+ try {
87
+ return (0, node_fs_1.lstatSync)(p).isSymbolicLink() ? (0, node_fs_1.readlinkSync)(p) : null;
88
+ }
89
+ catch {
90
+ return null;
91
+ }
92
+ },
93
+ rename: node_fs_1.renameSync,
94
+ symlink(target, at, type) {
95
+ (0, node_fs_1.symlinkSync)(target, at, type);
96
+ },
97
+ };
98
+ function isRealDirectory(stat) {
99
+ return stat !== null && stat.isDirectory() && !stat.isSymbolicLink();
100
+ }
101
+ function isRealFile(stat) {
102
+ return stat !== null && stat.isFile() && !stat.isSymbolicLink();
103
+ }
104
+ function describe(err) {
105
+ return err instanceof Error ? err.message : String(err);
106
+ }
107
+ /** Companions that travel with the binary, binary first. */
108
+ const COMPANION_SUFFIXES = [
109
+ '',
110
+ exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX,
111
+ exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX,
112
+ ];
113
+ /**
114
+ * How much newer an alias binary must be before it is treated as a later
115
+ * install rather than the same one. Clock and filesystem-granularity slack.
116
+ */
117
+ const NEWER_THRESHOLD_MS = 1000;
118
+ /**
119
+ * Move a legacy engine home and binary onto the canonical names. See the file
120
+ * header for the exact contract. Returns what it did; never throws.
121
+ *
122
+ * Inside `<home>/bin` it resolves the three layouts a rename can leave:
123
+ *
124
+ * - canonical ABSENT, an alias is a real file — the ordinary legacy install.
125
+ * The alias moves to canonical and a link is left at its name.
126
+ * - canonical is a LINK to an alias that is a real file — what an alias link
127
+ * left DURING the expand phase becomes once the flip swaps which spelling is
128
+ * canonical. Leaving it means the next install writes its provenance record
129
+ * THROUGH the link onto the old binary's record, and the legacy name then
130
+ * verifies as `tampered`. The real file is adopted onto the canonical name
131
+ * (a rename replaces the link itself, never what it points at).
132
+ * - canonical and an alias are BOTH real files and the alias is newer — a
133
+ * client that predates the flip installed an update under the old name. The
134
+ * newer engine is what every reader should run, so it is promoted: the older
135
+ * canonical binary becomes the rollback copy, and the alias becomes a link.
136
+ *
137
+ * Any other layout is left exactly as it is.
138
+ */
139
+ function migrateFirstPartyHarnessHome(options = {}) {
140
+ const env = options.env ?? process.env;
141
+ const platform = options.platform ?? process.platform;
142
+ const fs = options.fs ?? NODE_FS;
143
+ if (platform === 'win32') {
144
+ return { moved: [], errors: [], skipped: 'unsupported-platform' };
145
+ }
146
+ const moved = [];
147
+ const errors = [];
148
+ const canonical = firstPartyHarness_js_1.FIRST_PARTY_HARNESS.provider;
149
+ const root = (0, configRoot_js_1.resolveConfigRoot)(env);
150
+ const canonicalHome = firstPartyHarnessHomeDir(env);
151
+ // 1. The home directory — follows the engine's namespace.
152
+ if (fs.lstat(canonicalHome) === null) {
153
+ for (const legacyAppName of firstPartyHarness_js_1.FIRST_PARTY_HARNESS_ENGINE.legacyAppNames) {
154
+ const aliasHome = node_path_1.default.join(root, legacyAppName);
155
+ if (!isRealDirectory(fs.lstat(aliasHome)))
156
+ continue;
157
+ try {
158
+ fs.rename(aliasHome, canonicalHome);
159
+ }
160
+ catch (err) {
161
+ // A concurrent migrator may have won; step 2 still runs against
162
+ // whatever is now at the canonical path.
163
+ errors.push(`could not move ${aliasHome} to ${canonicalHome}: ${describe(err)}`);
164
+ break;
165
+ }
166
+ moved.push(`${aliasHome} -> ${canonicalHome}`);
167
+ try {
168
+ fs.symlink(node_path_1.default.basename(canonicalHome), aliasHome, 'dir');
169
+ moved.push(`symlink ${aliasHome} -> ${node_path_1.default.basename(canonicalHome)}`);
170
+ }
171
+ catch (err) {
172
+ errors.push(`moved ${aliasHome} but could not leave a symlink behind: ${describe(err)}`);
173
+ }
174
+ break;
175
+ }
176
+ }
177
+ // 2. The binary and its companions — follow the provider — inside the home.
178
+ const binDir = node_path_1.default.join(canonicalHome, 'bin');
179
+ if (!isRealDirectory(fs.lstat(binDir))) {
180
+ return { moved, errors };
181
+ }
182
+ const canonicalName = (0, firstPartyHarness_js_1.firstPartyHarnessBinaryName)(canonical, platform);
183
+ const canonicalBinary = node_path_1.default.join(binDir, canonicalName);
184
+ const canonicalStat = fs.lstat(canonicalBinary);
185
+ const aliasNames = firstPartyHarness_js_1.FIRST_PARTY_HARNESS.aliases.map((alias) => (0, firstPartyHarness_js_1.firstPartyHarnessBinaryName)(alias, platform));
186
+ /** Move `<from><suffix>` onto `<to><suffix>` and leave a link; `replaceable` says what may sit at the target. */
187
+ const relocate = (fromName, suffix, replaceable) => {
188
+ const from = node_path_1.default.join(binDir, `${fromName}${suffix}`);
189
+ const to = node_path_1.default.join(binDir, `${canonicalName}${suffix}`);
190
+ const toStat = fs.lstat(to);
191
+ if (!isRealFile(fs.lstat(from)) || !replaceable(to, toStat))
192
+ return 'skipped';
193
+ try {
194
+ // `rename` replaces a LINK at `to` itself, never the file it points at.
195
+ fs.rename(from, to);
196
+ }
197
+ catch (err) {
198
+ errors.push(`could not move ${from} to ${to}: ${describe(err)}`);
199
+ return 'failed';
200
+ }
201
+ moved.push(`${from} -> ${to}`);
202
+ try {
203
+ fs.symlink(node_path_1.default.basename(to), from, 'file');
204
+ moved.push(`symlink ${from} -> ${node_path_1.default.basename(to)}`);
205
+ }
206
+ catch (err) {
207
+ errors.push(`moved ${from} but could not leave a symlink behind: ${describe(err)}`);
208
+ }
209
+ return 'moved';
210
+ };
211
+ // 2a. Canonical absent: an ordinary legacy install.
212
+ if (canonicalStat === null) {
213
+ const aliasName = aliasNames.find((name) => isRealFile(fs.lstat(node_path_1.default.join(binDir, name))));
214
+ if (aliasName) {
215
+ for (const suffix of COMPANION_SUFFIXES) {
216
+ const outcome = relocate(aliasName, suffix, (_to, toStat) => toStat === null);
217
+ if (suffix === '' && outcome !== 'moved')
218
+ break;
219
+ }
220
+ }
221
+ return { moved, errors };
222
+ }
223
+ // 2b. Canonical is a link to a real alias file: adopt the file.
224
+ const linkText = fs.readlink(canonicalBinary);
225
+ if (linkText !== null) {
226
+ const linkedName = node_path_1.default.basename(linkText);
227
+ if (node_path_1.default.dirname(linkText) === '.' &&
228
+ aliasNames.includes(linkedName) &&
229
+ isRealFile(fs.lstat(node_path_1.default.join(binDir, linkedName)))) {
230
+ for (const suffix of COMPANION_SUFFIXES) {
231
+ const outcome = relocate(linkedName, suffix, (to, toStat) => toStat === null || fs.readlink(to) === `${linkedName}${suffix}`);
232
+ if (suffix === '' && outcome !== 'moved')
233
+ break;
234
+ }
235
+ }
236
+ return { moved, errors };
237
+ }
238
+ // 2c. Both real, alias newer: an update installed under the old name.
239
+ if (isRealFile(canonicalStat)) {
240
+ const newer = aliasNames
241
+ .map((name) => ({ name, stat: fs.lstat(node_path_1.default.join(binDir, name)) }))
242
+ .filter((entry) => isRealFile(entry.stat))
243
+ .filter((entry) => entry.stat.mtimeMs - canonicalStat.mtimeMs > NEWER_THRESHOLD_MS)
244
+ .sort((a, b) => b.stat.mtimeMs - a.stat.mtimeMs)[0];
245
+ if (newer) {
246
+ const previous = `${canonicalBinary}${exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX}`;
247
+ const previousStat = fs.lstat(previous);
248
+ if (previousStat !== null && !isRealFile(previousStat)) {
249
+ errors.push(`${previous} is not a regular file; left the newer ${newer.name} in place`);
250
+ return { moved, errors };
251
+ }
252
+ try {
253
+ // The older canonical engine becomes the rollback copy — the same
254
+ // meaning `.previous` has after any install.
255
+ fs.rename(canonicalBinary, previous);
256
+ }
257
+ catch (err) {
258
+ errors.push(`could not keep ${canonicalBinary} as ${previous}: ${describe(err)}`);
259
+ return { moved, errors };
260
+ }
261
+ moved.push(`${canonicalBinary} -> ${previous}`);
262
+ for (const suffix of ['', exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX]) {
263
+ // The alias's sidecar describes the alias's bytes, so it replaces the
264
+ // canonical one: a record must always sit beside the binary it describes.
265
+ const outcome = relocate(newer.name, suffix, (to, toStat) => suffix === '' ? toStat === null : toStat === null || isRealFile(toStat));
266
+ if (suffix === '' && outcome !== 'moved')
267
+ break;
268
+ }
269
+ }
270
+ }
271
+ return { moved, errors };
272
+ }
273
+ /**
274
+ * Leave a relative symlink at every alias name — binary and provenance sidecar —
275
+ * that does not exist yet, pointing at the canonical file.
276
+ *
277
+ * Call after installing the canonical binary. A platform CLI or daemon installed
278
+ * before a rename resolves the legacy name; the link keeps it on the current
279
+ * engine. It never replaces anything that exists, whether a real file (an older
280
+ * engine someone may still run) or a link someone else placed. Never throws.
281
+ */
282
+ function linkFirstPartyHarnessAliases(options = {}) {
283
+ const env = options.env ?? process.env;
284
+ const platform = options.platform ?? process.platform;
285
+ const fs = options.fs ?? NODE_FS;
286
+ if (platform === 'win32') {
287
+ return { moved: [], errors: [], skipped: 'unsupported-platform' };
288
+ }
289
+ const moved = [];
290
+ const errors = [];
291
+ const binDir = firstPartyHarnessBinDir(env);
292
+ const canonicalName = (0, firstPartyHarness_js_1.firstPartyHarnessBinaryName)(firstPartyHarness_js_1.FIRST_PARTY_HARNESS.provider, platform);
293
+ if (!isRealFile(fs.lstat(node_path_1.default.join(binDir, canonicalName)))) {
294
+ return { moved, errors };
295
+ }
296
+ for (const alias of firstPartyHarness_js_1.FIRST_PARTY_HARNESS.aliases) {
297
+ const aliasName = (0, firstPartyHarness_js_1.firstPartyHarnessBinaryName)(alias, platform);
298
+ // Sidecar FIRST: a verifier that finds the binary link must find its record.
299
+ for (const suffix of [exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX, '']) {
300
+ const target = `${canonicalName}${suffix}`;
301
+ const at = node_path_1.default.join(binDir, `${aliasName}${suffix}`);
302
+ if (!isRealFile(fs.lstat(node_path_1.default.join(binDir, target))) || fs.lstat(at) !== null)
303
+ continue;
304
+ try {
305
+ fs.symlink(target, at, 'file');
306
+ moved.push(`symlink ${at} -> ${target}`);
307
+ }
308
+ catch (err) {
309
+ errors.push(`could not link ${at} -> ${target}: ${describe(err)}`);
310
+ }
311
+ }
312
+ }
313
+ return { moved, errors };
314
+ }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * ── Why this lives in auth-core ────────────────────────────────────────────
5
5
  *
6
- * `sky code doctor` must tell a user what tier their harness is and what that
6
+ * `skrr code doctor` must tell a user what tier their harness is and what that
7
7
  * means for credentials and permission prompts. The daemon is the authority for
8
8
  * that answer, but the CLI cannot import `daemon/src` — separate packages, and
9
9
  * the daemon already depends on the CLI, so the reverse edge would be a cycle.
@@ -18,7 +18,7 @@
18
18
  * parsed the daemon's source to catch drift. That guard worked — and it was still
19
19
  * only a guard. The regression it existed to catch had already shipped once: the
20
20
  * doctor described Tier 2 behaviour for a day after the owner decision of
21
- * 2026-08-11 moved `sky-code` to Tier 1, and a unit test asserting the stale
21
+ * 2026-08-11 moved the first-party harness to Tier 1, and a unit test asserting the stale
22
22
  * string made the wrong claim look load-bearing.
23
23
  *
24
24
  * ── What deliberately did NOT move ────────────────────────────────────────
@@ -44,10 +44,16 @@ export type HarnessTrustTier = 1 | 2 | 3;
44
44
  * map resolves to, so adding trust is always a deliberate, reviewable edit and
45
45
  * never an omission.
46
46
  *
47
- * `sky-code` is Tier 1 by OWNER DECISION (2026-08-11). The full reasoning, and
48
- * the measured cost of the Tier 2 posture it replaced, is recorded in
49
- * `daemon/src/harness-trust.ts` beside the gates that read it — the argument
47
+ * The first-party harness is Tier 1 by OWNER DECISION (2026-08-11). The full
48
+ * reasoning, and the measured cost of the Tier 2 posture it replaced, is recorded
49
+ * in `daemon/src/harness-trust.ts` beside the gates that read it — the argument
50
50
  * belongs where the enforcement is, not in a shared vocabulary module.
51
+ *
52
+ * It is entered under EVERY spelling (`firstPartyHarnessSpellings`), not only the
53
+ * canonical one. A backend name reaches this lookup from a daemon of any version,
54
+ * and an alias that fell through to the Tier 3 default would silently strip the
55
+ * harness of the trust the owner granted it — a failure that looks like a
56
+ * permission prompt storm, not like a rename.
51
57
  */
52
58
  export declare const HARNESS_TIERS: Readonly<Record<string, HarnessTrustTier>>;
53
59
  /**
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * ── Why this lives in auth-core ────────────────────────────────────────────
6
6
  *
7
- * `sky code doctor` must tell a user what tier their harness is and what that
7
+ * `skrr code doctor` must tell a user what tier their harness is and what that
8
8
  * means for credentials and permission prompts. The daemon is the authority for
9
9
  * that answer, but the CLI cannot import `daemon/src` — separate packages, and
10
10
  * the daemon already depends on the CLI, so the reverse edge would be a cycle.
@@ -19,7 +19,7 @@
19
19
  * parsed the daemon's source to catch drift. That guard worked — and it was still
20
20
  * only a guard. The regression it existed to catch had already shipped once: the
21
21
  * doctor described Tier 2 behaviour for a day after the owner decision of
22
- * 2026-08-11 moved `sky-code` to Tier 1, and a unit test asserting the stale
22
+ * 2026-08-11 moved the first-party harness to Tier 1, and a unit test asserting the stale
23
23
  * string made the wrong claim look load-bearing.
24
24
  *
25
25
  * ── What deliberately did NOT move ────────────────────────────────────────
@@ -40,6 +40,7 @@ exports.HARNESS_TIERS = void 0;
40
40
  exports.getHarnessTier = getHarnessTier;
41
41
  exports.credentialPolicyForTier = credentialPolicyForTier;
42
42
  exports.tierPermitsConfiguredAutoMode = tierPermitsConfiguredAutoMode;
43
+ const firstPartyHarness_js_1 = require("./firstPartyHarness.js");
43
44
  /**
44
45
  * Trust tier by backend name.
45
46
  *
@@ -48,20 +49,26 @@ exports.tierPermitsConfiguredAutoMode = tierPermitsConfiguredAutoMode;
48
49
  * map resolves to, so adding trust is always a deliberate, reviewable edit and
49
50
  * never an omission.
50
51
  *
51
- * `sky-code` is Tier 1 by OWNER DECISION (2026-08-11). The full reasoning, and
52
- * the measured cost of the Tier 2 posture it replaced, is recorded in
53
- * `daemon/src/harness-trust.ts` beside the gates that read it — the argument
52
+ * The first-party harness is Tier 1 by OWNER DECISION (2026-08-11). The full
53
+ * reasoning, and the measured cost of the Tier 2 posture it replaced, is recorded
54
+ * in `daemon/src/harness-trust.ts` beside the gates that read it — the argument
54
55
  * belongs where the enforcement is, not in a shared vocabulary module.
56
+ *
57
+ * It is entered under EVERY spelling (`firstPartyHarnessSpellings`), not only the
58
+ * canonical one. A backend name reaches this lookup from a daemon of any version,
59
+ * and an alias that fell through to the Tier 3 default would silently strip the
60
+ * harness of the trust the owner granted it — a failure that looks like a
61
+ * permission prompt storm, not like a rename.
55
62
  */
56
63
  exports.HARNESS_TIERS = Object.freeze({
57
- // --- Tier 1: first-party / audited ---
64
+ // --- Tier 1: vendor first-party / audited ---
58
65
  claude: 1,
59
66
  codex: 1,
60
67
  opencode: 1,
61
68
  'opencode-acp': 1,
62
69
  gemini: 1,
63
70
  'gemini-acp': 1,
64
- 'sky-code': 1,
71
+ ...Object.fromEntries((0, firstPartyHarness_js_1.firstPartyHarnessSpellings)().map((spelling) => [spelling, 1])),
65
72
  // --- Tier 2: reviewed open-source community harnesses ---
66
73
  goose: 2,
67
74
  aider: 2,
@@ -35,7 +35,9 @@ export { HARNESS_TIERS, getHarnessTier, credentialPolicyForTier, tierPermitsConf
35
35
  export { sanitizeSpawnEnv, SENSITIVE_ENV_VARS, SENSITIVE_ENV_PREFIXES, SENSITIVE_ENV_SUFFIXES, SENSITIVE_ENV_NAME_TOKENS, SENSITIVE_ENV_PREFIX_EXCEPTIONS, } from './spawnEnv.js';
36
36
  export { CONFIG_DIR_NAME, LEGACY_CONFIG_DIR_NAMES, NATIVE_ID_PREFIX, LEGACY_NATIVE_ID_PREFIXES, DEFAULT_BINARY_NAME, } from './localIdentity.js';
37
37
  export { findLegacyLocalState, describeLegacyState, type LegacyStateFinding, type LegacyStateReport, } from './legacyStatePreflight.js';
38
- export { DEFAULT_SKY_CODE_CHANNEL, DEFAULT_SKY_CODE_FEED_BASE, SKY_CODE_CHANNELS, SKY_CODE_CHANNEL_ENV, SKY_CODE_MANIFEST_FILE, isSkyCodeChannel, resolveChannelManifestUrl, resolveSkyCodeChannel, skyCodeChannelPrefix, skyCodeFeedBase, SKY_CODE_FEED_BASE_ENV, type SkyCodeChannel, } from './skyCodeChannels.js';
38
+ export * from './firstPartyHarness.js';
39
+ export { FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX, FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX, firstPartyHarnessBinDir, firstPartyHarnessHomeDir, firstPartyHarnessInstalledBinaryPath, linkFirstPartyHarnessAliases, migrateFirstPartyHarnessHome, type FirstPartyHarnessHomeFs, type FirstPartyHarnessHomeMigration, } from './firstPartyHarnessHome.js';
40
+ export { DEFAULT_FIRST_PARTY_HARNESS_CHANNEL, FIRST_PARTY_HARNESS_CHANNELS, firstPartyHarnessChannelPrefix, firstPartyHarnessFeedBase, firstPartyHarnessFeedCandidates, isFirstPartyHarnessChannel, resolveChannelManifestUrl, resolveFirstPartyHarnessChannel, type FirstPartyHarnessChannel, type FirstPartyHarnessFeedCandidate, DEFAULT_SKY_CODE_CHANNEL, DEFAULT_SKY_CODE_FEED_BASE, SKY_CODE_CHANNELS, SKY_CODE_CHANNEL_ENV, SKY_CODE_MANIFEST_FILE, isSkyCodeChannel, resolveSkyCodeChannel, skyCodeChannelPrefix, skyCodeFeedBase, SKY_CODE_FEED_BASE_ENV, type SkyCodeChannel, } from './firstPartyHarnessChannels.js';
39
41
  export { OVERSKY_RELEASE_PUBLIC_KEYS, type ReleaseKey } from './releaseKeys.js';
40
42
  export { MAX_SIGS, buildArtifactMessage, buildManifestMessage, getDeltaFor, verifyArtifact, verifyManifest, type DaemonVersionManifest, type DeltaDescriptor, type ManifestSignature, type PlatformArtifact, type VerifyResult, } from './releaseManifest.js';
41
43
  export { resolveConfigRoot, configRootPath, isConfigRootOverridden } from './configRoot.js';
@@ -7,11 +7,25 @@
7
7
  * wire up its logger, config dir, kill switches, and binary name — then
8
8
  * uses the rest of the API uniformly.
9
9
  */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
+ };
10
24
  Object.defineProperty(exports, "__esModule", { value: true });
11
25
  exports.challenge = exports.generateVerifier = exports.invalidateHeadersHelperCache = exports.runHeadersHelper = exports.SENTINEL_TRIGGERING_FAILURES = exports.__resetAuthHelperFailureReasonForTest = exports.getLastAuthHelperFailureReason = exports.getDefaultHelperTtlMs = exports.invokeAuthHelper = exports.AuthHelperUnavailableError = exports.AuthHelperUntrustedError = exports.CI_TOKEN_PREFIX = exports.classifyTokenKind = exports.invalidateAuthHelperCache = exports.__resetCredentialResolverForTest = exports.CREDENTIAL_PRECEDENCE = exports.CredentialResolver = exports.__setFdReaderForTest = exports.readAuthFromFd = exports.createRefreshScheduler = exports.UNKNOWN_401_BUDGET = exports.__resetUnknown401StreaksForTest = exports.__refreshDiagnostics = exports.installLockExitHandlers = exports.clearReauthState = exports.needsReauthState = exports.persistReauthState = exports.withAuthLock = exports.revokeDaemonRefreshSession = exports.refreshDaemonToken = exports.classifyRefreshResponse = exports.EXIT_NEEDS_REAUTH = exports.formatReauthMessage = exports.handleMidStreamAuthExpiry = exports.isAuthExpiredSseEvent = exports.decodeJwtPayload = exports.decodeJwtExpiry = exports.TransientAuthFailure = exports.PermanentAuthFailure = exports.emitAuthTelemetry = exports.getAuthBinaryName = exports.getAuthKillSwitches = exports.getAuthConfigDir = exports.getAuthLogger = exports.configureAuthCore = exports.OAUTH_CLI_SCOPE = exports.isDaemonScope = exports.VALID_DAEMON_SCOPE_SET = exports.ALL_DAEMON_SCOPES = exports.SCOPES = void 0;
12
26
  exports.tokenHash = exports.publicJwkFromX = exports.normalizeHtu = exports.jwkThumbprint = exports.generateDeviceKeyPair = exports.buildDeviceProof = exports.zeroizeKekCaches = exports.WindowsKek = exports.registerZeroizeHook = exports.MacosKek = exports.LinuxKek = exports.KekUnavailableError = exports.UnavailableKek = exports.InMemoryKek = exports.getKekStrategy = exports.__setKekStrategyForTest = exports.credEnvelopeWrap = exports.credEnvelopeUnwrap = exports.credEnvelopeSerialize = exports.credSealBuffer = exports.credOpenBuffer = exports.CRED_KEY_LEN = exports.isCredEnvelopeString = exports.generateDek = exports.CRED_ENVELOPE_MAGIC = exports.credEnvelopeEncrypt = exports.credEnvelopeDeserialize = exports.credEnvelopeDecrypt = exports.buildCredentialAad = exports.isValidRecoveryCode = exports.normalizeRecoveryCode = exports.parseRecoveryCode = exports.formatRecoveryCode = exports.MAX_TTL_DAYS = exports.MIN_TTL_DAYS = exports.parseTtlDays = exports.LoginExchangeError = exports.LoginInitError = exports.loginWithLocalhost = exports.LocalCallbackMalformedError = exports.LocalCallbackDeniedError = exports.LocalCallbackStateMismatchError = exports.LocalCallbackTimeoutError = exports.LocalCallbackBindError = exports.LocalCallbackError = exports.DEFAULT_LOGIN_TIMEOUT_MS = exports.startLocalCallback = exports.verifyChallenge = exports.safeEqual = exports.generateState = void 0;
13
27
  exports.getHarnessTier = exports.HARNESS_TIERS = exports.pairUint8ArrayToBase64Url = exports.pairUint8ArrayToBase64 = exports.parsePairUrl = exports.parsePairPlaintext = exports.parsePairBundle = exports.openPairBundleBase64 = exports.generatePairKeyPair = exports.buildPairUrl = exports.buildPairAad = exports.pairBase64UrlToUint8Array = exports.pairBase64ToUint8Array = exports.assemblePairBundleBase64 = exports.PairBundleError = exports.PAIR_SECRET_LEN = exports.PAIR_PUBKEY_LEN = exports.PAIR_NONCE_LEN = exports.PAIR_BUNDLE_MAX_BASE64_LEN = exports.PAIR_AAD_MAX_LEN = exports.PAIR_AAD_PREFIX = exports.__resetCachedDaemonIdForTest = exports.legacyDaemonUuids = exports.ensureMachineDaemonId = exports.__getDeviceIdentityStateForTest = exports.__setDeviceIdentityStateForTest = exports.__enrollmentBackoffPathForTest = exports.__enrollmentMarkerPathForTest = exports.__privateKeyPathForTest = exports.__publicKeyPathForTest = exports.describeDeviceIdentityState = exports.getDevicePublicKey = exports.isDeviceIdentityActive = exports.clearEnrollmentMarker = exports.enrollWithServer = exports.signServerRequest = exports.resetDeviceIdentity = exports.initDeviceIdentity = exports.__resetShutdownGuardForTest = exports.__getCredEnvelopeStateForTest = exports.__setCredEnvelopeStateForTest = exports.__wrappedDekFilePathForTest = exports.maybeDecryptOnRead = exports.maybeEncryptForWrite = exports.describeCredEnvelopeState = exports.isCredEnvelopeActive = exports.shutdownCredEnvelope = exports.resetCredEnvelope = exports.initCredEnvelope = exports.verifyDeviceProof = void 0;
14
- exports.isConfigRootOverridden = exports.configRootPath = exports.resolveConfigRoot = exports.verifyManifest = exports.verifyArtifact = exports.getDeltaFor = exports.buildManifestMessage = exports.buildArtifactMessage = exports.MAX_SIGS = exports.OVERSKY_RELEASE_PUBLIC_KEYS = exports.SKY_CODE_FEED_BASE_ENV = exports.skyCodeFeedBase = exports.skyCodeChannelPrefix = exports.resolveSkyCodeChannel = exports.resolveChannelManifestUrl = exports.isSkyCodeChannel = exports.SKY_CODE_MANIFEST_FILE = exports.SKY_CODE_CHANNEL_ENV = exports.SKY_CODE_CHANNELS = exports.DEFAULT_SKY_CODE_FEED_BASE = exports.DEFAULT_SKY_CODE_CHANNEL = exports.describeLegacyState = exports.findLegacyLocalState = exports.DEFAULT_BINARY_NAME = exports.LEGACY_NATIVE_ID_PREFIXES = exports.NATIVE_ID_PREFIX = exports.LEGACY_CONFIG_DIR_NAMES = exports.CONFIG_DIR_NAME = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = exports.sanitizeSpawnEnv = exports.tierPermitsConfiguredAutoMode = exports.credentialPolicyForTier = void 0;
28
+ exports.isConfigRootOverridden = exports.configRootPath = exports.resolveConfigRoot = exports.verifyManifest = exports.verifyArtifact = exports.getDeltaFor = exports.buildManifestMessage = exports.buildArtifactMessage = exports.MAX_SIGS = exports.OVERSKY_RELEASE_PUBLIC_KEYS = exports.SKY_CODE_FEED_BASE_ENV = exports.skyCodeFeedBase = exports.skyCodeChannelPrefix = exports.resolveSkyCodeChannel = exports.isSkyCodeChannel = exports.SKY_CODE_MANIFEST_FILE = exports.SKY_CODE_CHANNEL_ENV = exports.SKY_CODE_CHANNELS = exports.DEFAULT_SKY_CODE_FEED_BASE = exports.DEFAULT_SKY_CODE_CHANNEL = exports.resolveFirstPartyHarnessChannel = exports.resolveChannelManifestUrl = exports.isFirstPartyHarnessChannel = exports.firstPartyHarnessFeedCandidates = exports.firstPartyHarnessFeedBase = exports.firstPartyHarnessChannelPrefix = exports.FIRST_PARTY_HARNESS_CHANNELS = exports.DEFAULT_FIRST_PARTY_HARNESS_CHANNEL = exports.migrateFirstPartyHarnessHome = exports.linkFirstPartyHarnessAliases = exports.firstPartyHarnessInstalledBinaryPath = exports.firstPartyHarnessHomeDir = exports.firstPartyHarnessBinDir = exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX = exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX = exports.describeLegacyState = exports.findLegacyLocalState = exports.DEFAULT_BINARY_NAME = exports.LEGACY_NATIVE_ID_PREFIXES = exports.NATIVE_ID_PREFIX = exports.LEGACY_CONFIG_DIR_NAMES = exports.CONFIG_DIR_NAME = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = exports.sanitizeSpawnEnv = exports.tierPermitsConfiguredAutoMode = exports.credentialPolicyForTier = void 0;
15
29
  // Daemon scope vocabulary — single source of truth for non-Mongoose tiers
16
30
  // (daemon, desktop, cli). Schema-bound canonical lives in
17
31
  // `@skrr-ai/data-schemas/common/daemonScopes`; the two are kept byte-equal
@@ -271,7 +285,7 @@ Object.defineProperty(exports, "parsePairUrl", { enumerable: true, get: function
271
285
  Object.defineProperty(exports, "pairUint8ArrayToBase64", { enumerable: true, get: function () { return daemonPair_js_1.uint8ArrayToBase64; } });
272
286
  Object.defineProperty(exports, "pairUint8ArrayToBase64Url", { enumerable: true, get: function () { return daemonPair_js_1.uint8ArrayToBase64Url; } });
273
287
  // OSK-3897 — harness trust tiers, shared by the daemon (the authority) and the
274
- // CLI (which publishes the fact in `sky code doctor`). The PROVENANCE half stays
288
+ // CLI (which publishes the fact in `skrr code doctor`). The PROVENANCE half stays
275
289
  // in the daemon on purpose: a tier is a published fact, provenance is evidence
276
290
  // about bytes on disk that only the spawning process can gather.
277
291
  var harnessTrust_js_1 = require("./harnessTrust.js");
@@ -304,18 +318,41 @@ Object.defineProperty(exports, "DEFAULT_BINARY_NAME", { enumerable: true, get: f
304
318
  var legacyStatePreflight_js_1 = require("./legacyStatePreflight.js");
305
319
  Object.defineProperty(exports, "findLegacyLocalState", { enumerable: true, get: function () { return legacyStatePreflight_js_1.findLegacyLocalState; } });
306
320
  Object.defineProperty(exports, "describeLegacyState", { enumerable: true, get: function () { return legacyStatePreflight_js_1.describeLegacyState; } });
307
- var skyCodeChannels_js_1 = require("./skyCodeChannels.js");
308
- Object.defineProperty(exports, "DEFAULT_SKY_CODE_CHANNEL", { enumerable: true, get: function () { return skyCodeChannels_js_1.DEFAULT_SKY_CODE_CHANNEL; } });
309
- Object.defineProperty(exports, "DEFAULT_SKY_CODE_FEED_BASE", { enumerable: true, get: function () { return skyCodeChannels_js_1.DEFAULT_SKY_CODE_FEED_BASE; } });
310
- Object.defineProperty(exports, "SKY_CODE_CHANNELS", { enumerable: true, get: function () { return skyCodeChannels_js_1.SKY_CODE_CHANNELS; } });
311
- Object.defineProperty(exports, "SKY_CODE_CHANNEL_ENV", { enumerable: true, get: function () { return skyCodeChannels_js_1.SKY_CODE_CHANNEL_ENV; } });
312
- Object.defineProperty(exports, "SKY_CODE_MANIFEST_FILE", { enumerable: true, get: function () { return skyCodeChannels_js_1.SKY_CODE_MANIFEST_FILE; } });
313
- Object.defineProperty(exports, "isSkyCodeChannel", { enumerable: true, get: function () { return skyCodeChannels_js_1.isSkyCodeChannel; } });
314
- Object.defineProperty(exports, "resolveChannelManifestUrl", { enumerable: true, get: function () { return skyCodeChannels_js_1.resolveChannelManifestUrl; } });
315
- Object.defineProperty(exports, "resolveSkyCodeChannel", { enumerable: true, get: function () { return skyCodeChannels_js_1.resolveSkyCodeChannel; } });
316
- Object.defineProperty(exports, "skyCodeChannelPrefix", { enumerable: true, get: function () { return skyCodeChannels_js_1.skyCodeChannelPrefix; } });
317
- Object.defineProperty(exports, "skyCodeFeedBase", { enumerable: true, get: function () { return skyCodeChannels_js_1.skyCodeFeedBase; } });
318
- Object.defineProperty(exports, "SKY_CODE_FEED_BASE_ENV", { enumerable: true, get: function () { return skyCodeChannels_js_1.SKY_CODE_FEED_BASE_ENV; } });
321
+ // The first-party harness identity: the ONE place its product name is written.
322
+ // Pure, and also published as the `./first-party-harness` subpath for browser and
323
+ // React Native consumers. See firstPartyHarness.ts.
324
+ __exportStar(require("./firstPartyHarness.js"), exports);
325
+ // Where the first-party harness lives under the skrr root, and the one-time move
326
+ // that keeps legacy installs working across a rename. Node-only.
327
+ var firstPartyHarnessHome_js_1 = require("./firstPartyHarnessHome.js");
328
+ Object.defineProperty(exports, "FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX; } });
329
+ Object.defineProperty(exports, "FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX; } });
330
+ Object.defineProperty(exports, "firstPartyHarnessBinDir", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.firstPartyHarnessBinDir; } });
331
+ Object.defineProperty(exports, "firstPartyHarnessHomeDir", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.firstPartyHarnessHomeDir; } });
332
+ Object.defineProperty(exports, "firstPartyHarnessInstalledBinaryPath", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.firstPartyHarnessInstalledBinaryPath; } });
333
+ Object.defineProperty(exports, "linkFirstPartyHarnessAliases", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.linkFirstPartyHarnessAliases; } });
334
+ Object.defineProperty(exports, "migrateFirstPartyHarnessHome", { enumerable: true, get: function () { return firstPartyHarnessHome_js_1.migrateFirstPartyHarnessHome; } });
335
+ var firstPartyHarnessChannels_js_1 = require("./firstPartyHarnessChannels.js");
336
+ Object.defineProperty(exports, "DEFAULT_FIRST_PARTY_HARNESS_CHANNEL", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.DEFAULT_FIRST_PARTY_HARNESS_CHANNEL; } });
337
+ Object.defineProperty(exports, "FIRST_PARTY_HARNESS_CHANNELS", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.FIRST_PARTY_HARNESS_CHANNELS; } });
338
+ Object.defineProperty(exports, "firstPartyHarnessChannelPrefix", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.firstPartyHarnessChannelPrefix; } });
339
+ Object.defineProperty(exports, "firstPartyHarnessFeedBase", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.firstPartyHarnessFeedBase; } });
340
+ Object.defineProperty(exports, "firstPartyHarnessFeedCandidates", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.firstPartyHarnessFeedCandidates; } });
341
+ Object.defineProperty(exports, "isFirstPartyHarnessChannel", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.isFirstPartyHarnessChannel; } });
342
+ Object.defineProperty(exports, "resolveChannelManifestUrl", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.resolveChannelManifestUrl; } });
343
+ Object.defineProperty(exports, "resolveFirstPartyHarnessChannel", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.resolveFirstPartyHarnessChannel; } });
344
+ // Deprecated names kept for installed CLIs that resolve this published package
345
+ // with a caret range. Removed in the contract phase with a minor bump.
346
+ Object.defineProperty(exports, "DEFAULT_SKY_CODE_CHANNEL", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.DEFAULT_SKY_CODE_CHANNEL; } });
347
+ Object.defineProperty(exports, "DEFAULT_SKY_CODE_FEED_BASE", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.DEFAULT_SKY_CODE_FEED_BASE; } });
348
+ Object.defineProperty(exports, "SKY_CODE_CHANNELS", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.SKY_CODE_CHANNELS; } });
349
+ Object.defineProperty(exports, "SKY_CODE_CHANNEL_ENV", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.SKY_CODE_CHANNEL_ENV; } });
350
+ Object.defineProperty(exports, "SKY_CODE_MANIFEST_FILE", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.SKY_CODE_MANIFEST_FILE; } });
351
+ Object.defineProperty(exports, "isSkyCodeChannel", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.isSkyCodeChannel; } });
352
+ Object.defineProperty(exports, "resolveSkyCodeChannel", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.resolveSkyCodeChannel; } });
353
+ Object.defineProperty(exports, "skyCodeChannelPrefix", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.skyCodeChannelPrefix; } });
354
+ Object.defineProperty(exports, "skyCodeFeedBase", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.skyCodeFeedBase; } });
355
+ Object.defineProperty(exports, "SKY_CODE_FEED_BASE_ENV", { enumerable: true, get: function () { return firstPartyHarnessChannels_js_1.SKY_CODE_FEED_BASE_ENV; } });
319
356
  // Daemon release trust: the pinned ed25519 keys and the canonical signature
320
357
  // messages. Shared because BOTH the daemon (self-update) and the CLI
321
358
  // (`skrr daemon install`, which runs when there is no daemon to ask) verify the
@@ -26,7 +26,7 @@ exports.getDeltaFor = getDeltaFor;
26
26
  *
27
27
  * WHY IT LIVES IN auth-core NOW
28
28
  *
29
- * It lived in `daemon/src/release-manifest.ts`, and `skyCodeChannels.ts` beside
29
+ * It lived in `daemon/src/release-manifest.ts`, and `firstPartyHarnessChannels.ts` beside
30
30
  * it recorded the reason for stopping there: "the installer, the signature
31
31
  * verification and the promotion machinery stay in the daemon, which is the
32
32
  * only process that performs them." That premise held exactly until the CLI
@@ -5,8 +5,8 @@
5
5
  * ── Why this lives in auth-core ────────────────────────────────────────────
6
6
  *
7
7
  * The daemon has stripped its own credentials out of `process.env` before every
8
- * harness spawn since `daemon/src/env-sanitize.ts` was written. `sky code` spawns
9
- * THE SAME engine — `daemon/src/backends/acp.ts` and `cli/src/lib/sky-code.ts`
8
+ * harness spawn since `daemon/src/env-sanitize.ts` was written. `skrr code` spawns
9
+ * THE SAME engine — `daemon/src/backends/acp.ts` and `cli/src/lib/first-party-harness.ts`
10
10
  * resolve the same binary, from the same managed location — and had no
11
11
  * equivalent, so `OVERSKY_TOKEN` (a cloud-reusable platform credential that
12
12
  * authenticates every `/api/*` call as the human) entered the environment of a
@@ -32,10 +32,10 @@
32
32
  * This is a DENY-LIST over the parent's own environment, and it strips provider
33
33
  * credentials because the daemon delivers a child's model credential explicitly
34
34
  * (`cred.env`, after the trust gate) and never by ambient inheritance. A parent
35
- * whose supported mode IS ambient inheritance — `sky code` running BYOK, where
35
+ * whose supported mode IS ambient inheritance — `skrr code` running BYOK, where
36
36
  * the user's own key is the credential the run is meant to spend — has to
37
37
  * re-admit that credential deliberately after this filter. See
38
- * `cli/src/lib/sky-code.ts` (`engineSpawnEnv`). Do not soften the list here to
38
+ * `cli/src/lib/first-party-harness.ts` (`engineSpawnEnv`). Do not soften the list here to
39
39
  * serve that case: a deny-list with a hole is not a deny-list.
40
40
  */
41
41
  /**
@@ -6,8 +6,8 @@
6
6
  * ── Why this lives in auth-core ────────────────────────────────────────────
7
7
  *
8
8
  * The daemon has stripped its own credentials out of `process.env` before every
9
- * harness spawn since `daemon/src/env-sanitize.ts` was written. `sky code` spawns
10
- * THE SAME engine — `daemon/src/backends/acp.ts` and `cli/src/lib/sky-code.ts`
9
+ * harness spawn since `daemon/src/env-sanitize.ts` was written. `skrr code` spawns
10
+ * THE SAME engine — `daemon/src/backends/acp.ts` and `cli/src/lib/first-party-harness.ts`
11
11
  * resolve the same binary, from the same managed location — and had no
12
12
  * equivalent, so `OVERSKY_TOKEN` (a cloud-reusable platform credential that
13
13
  * authenticates every `/api/*` call as the human) entered the environment of a
@@ -33,10 +33,10 @@
33
33
  * This is a DENY-LIST over the parent's own environment, and it strips provider
34
34
  * credentials because the daemon delivers a child's model credential explicitly
35
35
  * (`cred.env`, after the trust gate) and never by ambient inheritance. A parent
36
- * whose supported mode IS ambient inheritance — `sky code` running BYOK, where
36
+ * whose supported mode IS ambient inheritance — `skrr code` running BYOK, where
37
37
  * the user's own key is the credential the run is meant to spend — has to
38
38
  * re-admit that credential deliberately after this filter. See
39
- * `cli/src/lib/sky-code.ts` (`engineSpawnEnv`). Do not soften the list here to
39
+ * `cli/src/lib/first-party-harness.ts` (`engineSpawnEnv`). Do not soften the list here to
40
40
  * serve that case: a deny-list with a hole is not a deny-list.
41
41
  */
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,7 +10,7 @@
10
10
  * - The CLI's engine path honoured `OVERSKY_CONFIG_DIR` while its config did
11
11
  * not, so a relocated root moved the engine and left the credentials in
12
12
  * `$HOME`. Fixed by teaching `config.ts` the variable — which promptly
13
- * re-created the split in the mirror image, because `sky-code.ts` still read
13
+ * re-created the split in the mirror image, because the engine resolver still read
14
14
  * only the old name.
15
15
  * - The daemon then had the same shape, and fixing the CLI's half turned it
16
16
  * into a CLI/daemon divergence: with the variable set, the two halves of one
@@ -32,7 +32,7 @@
32
32
  * child process it is about to spawn, and so tests need no process-wide mutation.
33
33
  */
34
34
  export declare function resolveConfigRoot(env?: NodeJS.ProcessEnv): string;
35
- /** A path under the skrr root, e.g. `configRootPath(env, 'sky-code', 'bin')`. */
35
+ /** A path under the skrr root, e.g. `configRootPath(env, 'daemon', 'logs')`. */
36
36
  export declare function configRootPath(env: NodeJS.ProcessEnv, ...segments: string[]): string;
37
37
  /**
38
38
  * Has the operator explicitly relocated the root?
@@ -12,7 +12,7 @@ import path from 'node:path';
12
12
  * - The CLI's engine path honoured `OVERSKY_CONFIG_DIR` while its config did
13
13
  * not, so a relocated root moved the engine and left the credentials in
14
14
  * `$HOME`. Fixed by teaching `config.ts` the variable — which promptly
15
- * re-created the split in the mirror image, because `sky-code.ts` still read
15
+ * re-created the split in the mirror image, because the engine resolver still read
16
16
  * only the old name.
17
17
  * - The daemon then had the same shape, and fixing the CLI's half turned it
18
18
  * into a CLI/daemon divergence: with the variable set, the two halves of one
@@ -37,7 +37,7 @@ export function resolveConfigRoot(env = process.env) {
37
37
  const override = (env.SKRR_CONFIG_DIR || env.OVERSKY_CONFIG_DIR)?.trim();
38
38
  return override || path.join(homedir(), '.skrr');
39
39
  }
40
- /** A path under the skrr root, e.g. `configRootPath(env, 'sky-code', 'bin')`. */
40
+ /** A path under the skrr root, e.g. `configRootPath(env, 'daemon', 'logs')`. */
41
41
  export function configRootPath(env, ...segments) {
42
42
  return path.join(resolveConfigRoot(env), ...segments);
43
43
  }