@skrr-ai/cli 0.1.10 → 0.1.11
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/dist/base-command.d.ts +1 -13
- package/dist/base-command.js +78 -1
- package/dist/commands/browser/skill/show.js +7 -1
- package/dist/commands/code/index.d.ts +1 -0
- package/dist/commands/code/index.js +9 -1
- package/dist/commands/commitments/analytics/index.js +2 -0
- package/dist/commands/daemon/byok.d.ts +1 -0
- package/dist/commands/daemon/byok.js +2 -1
- package/dist/commands/daemon/install.d.ts +1 -0
- package/dist/commands/daemon/install.js +2 -1
- package/dist/commands/daemon/login.d.ts +31 -0
- package/dist/commands/daemon/login.js +56 -0
- package/dist/commands/daemon/restart.d.ts +9 -0
- package/dist/commands/daemon/restart.js +36 -0
- package/dist/commands/daemon/start.d.ts +1 -0
- package/dist/commands/daemon/start.js +2 -1
- package/dist/commands/daemon/status.d.ts +1 -0
- package/dist/commands/daemon/status.js +2 -1
- package/dist/commands/daemon/stop.d.ts +1 -0
- package/dist/commands/daemon/stop.js +2 -1
- package/dist/commands/daemon/uninstall.d.ts +1 -0
- package/dist/commands/daemon/uninstall.js +2 -1
- package/dist/commands/daemon/unlock.d.ts +9 -0
- package/dist/commands/daemon/unlock.js +33 -0
- package/dist/commands/goals/key-results/create.js +32 -1
- package/dist/commands/goals/key-results/update.d.ts +11 -0
- package/dist/commands/goals/key-results/update.js +80 -2
- package/dist/commands/goals/plan-now.d.ts +54 -2
- package/dist/commands/goals/plan-now.js +175 -18
- package/dist/commands/goals/planner-config.d.ts +60 -9
- package/dist/commands/goals/planner-config.js +82 -34
- package/dist/commands/goals/revisions.js +17 -0
- package/dist/commands/goals/show.d.ts +17 -0
- package/dist/commands/goals/show.js +90 -3
- package/dist/commands/login.js +30 -0
- package/dist/commands/spaces/create.js +2 -1
- package/dist/commands/spaces/index.js +9 -1
- package/dist/commands/spaces/list.d.ts +18 -0
- package/dist/commands/spaces/list.js +57 -7
- package/dist/commands/spaces/show.js +4 -1
- package/dist/commands/spaces/summary.d.ts +4 -0
- package/dist/commands/spaces/summary.js +77 -1
- package/dist/commands/spaces/update.d.ts +4 -0
- package/dist/commands/spaces/update.js +38 -1
- package/dist/commands/tasks/actionability.js +40 -1
- package/dist/commands/tasks/activity.d.ts +29 -0
- package/dist/commands/tasks/activity.js +47 -0
- package/dist/commands/tasks/complete.d.ts +47 -0
- package/dist/commands/tasks/complete.js +159 -12
- package/dist/commands/tasks/create.d.ts +26 -0
- package/dist/commands/tasks/create.js +60 -1
- package/dist/commands/tasks/events/append.d.ts +2 -0
- package/dist/commands/tasks/events/append.js +41 -10
- package/dist/commands/tasks/events/list.js +60 -9
- package/dist/commands/tasks/output.js +22 -2
- package/dist/commands/tasks/ready.d.ts +38 -0
- package/dist/commands/tasks/ready.js +37 -0
- package/dist/commands/tasks/runs.d.ts +22 -0
- package/dist/commands/tasks/runs.js +110 -2
- package/dist/commands/tasks/show.d.ts +28 -0
- package/dist/commands/tasks/show.js +61 -0
- package/dist/commands/tasks/timeline.d.ts +7 -0
- package/dist/commands/tasks/timeline.js +34 -3
- package/dist/commands/tasks/update.d.ts +20 -0
- package/dist/commands/tasks/update.js +38 -1
- package/dist/commands/whoami.d.ts +40 -0
- package/dist/commands/whoami.js +57 -9
- package/dist/commands/wiki/ls.d.ts +23 -0
- package/dist/commands/wiki/ls.js +63 -10
- package/dist/commands/wiki/mv.d.ts +70 -0
- package/dist/commands/wiki/mv.js +198 -4
- package/dist/commands/wiki/rm.js +12 -1
- package/dist/commands/wiki/write.js +35 -3
- package/dist/help.d.ts +27 -0
- package/dist/help.js +48 -0
- package/dist/hooks/command-not-found.d.ts +31 -0
- package/dist/hooks/command-not-found.js +12 -80
- package/dist/lib/command-miss.d.ts +60 -0
- package/dist/lib/command-miss.js +128 -0
- package/dist/lib/commitment-analytics.d.ts +10 -0
- package/dist/lib/commitment-analytics.js +10 -0
- package/dist/lib/config.js +6 -2
- package/dist/lib/daemonBroker.d.ts +7 -1
- package/dist/lib/daemonBroker.js +71 -0
- package/dist/lib/daemonHandoff.d.ts +38 -0
- package/dist/lib/daemonHandoff.js +297 -0
- package/dist/lib/exec-oversky.d.ts +30 -0
- package/dist/lib/exec-oversky.js +41 -0
- package/dist/lib/format.d.ts +7 -0
- package/dist/lib/format.js +27 -5
- package/dist/lib/login.js +22 -2
- package/dist/lib/sky-code.js +1 -1
- package/dist/lib/task-transcript.d.ts +9 -0
- package/dist/lib/task-transcript.js +13 -2
- package/dist/lib/tasks.d.ts +34 -0
- package/dist/lib/tasks.js +70 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +67 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +7 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +59 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +3 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +15 -4
- package/oclif.manifest.json +15771 -15538
- package/package.json +5 -3
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
/** Runtime binary names, current first. */
|
|
2
2
|
export declare const RUNTIME_BINARY_NAMES: readonly ["skrrd", "oversky"];
|
|
3
|
+
/**
|
|
4
|
+
* The sentence a `skrr daemon` pass-through appends to its description.
|
|
5
|
+
*
|
|
6
|
+
* OSK-296 made these commands forward their flags to `skrrd` instead of
|
|
7
|
+
* rejecting them, and stopped there. oclif renders the FLAGS section of help
|
|
8
|
+
* from a command's declared flags, and a pass-through declares none — so help
|
|
9
|
+
* kept describing the old, broken behaviour where these commands took nothing,
|
|
10
|
+
* while `skrr daemon status --profile work` quietly worked. The entire flag
|
|
11
|
+
* surface of the wrapped binary became reachable and undiscoverable in the
|
|
12
|
+
* same commit.
|
|
13
|
+
*
|
|
14
|
+
* `skrr code` hit this first and fixed BOTH halves: its description says out
|
|
15
|
+
* loud that engine flags are not listed there and where to find them. This is
|
|
16
|
+
* that sentence, for the other wrapper, in one place so eight commands cannot
|
|
17
|
+
* drift into eight wordings.
|
|
18
|
+
*
|
|
19
|
+
* It names `skrrd --help` separately because `--profile` is a GLOBAL option on
|
|
20
|
+
* the runtime, so a reader sent only to the subcommand's help would not find
|
|
21
|
+
* the flag they are most likely to want.
|
|
22
|
+
*
|
|
23
|
+
* This is a command's `description`, and each command keeps a short `summary`
|
|
24
|
+
* beside it. oclif renders `summary` in the topic listing and `description`
|
|
25
|
+
* only in the command's own help, so the note reaches someone asking about
|
|
26
|
+
* THIS command without turning `skrr daemon --help` into eight paragraphs of
|
|
27
|
+
* the same boilerplate — which is what it did when this text was appended to
|
|
28
|
+
* `description` alone.
|
|
29
|
+
*/
|
|
30
|
+
export declare function forwardedFlagsNote(verb: string, opts?: {
|
|
31
|
+
binds?: boolean;
|
|
32
|
+
}): string;
|
|
3
33
|
/** Resolve the absolute path of `oversky` if it exists, else return null. */
|
|
4
34
|
export declare function findOverskyBinary(): string | null;
|
|
5
35
|
/**
|
package/dist/lib/exec-oversky.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RUNTIME_BINARY_NAMES = void 0;
|
|
7
|
+
exports.forwardedFlagsNote = forwardedFlagsNote;
|
|
7
8
|
exports.findOverskyBinary = findOverskyBinary;
|
|
8
9
|
exports.notInstalledMessage = notInstalledMessage;
|
|
9
10
|
exports.execOversky = execOversky;
|
|
@@ -31,6 +32,46 @@ const node_fs_1 = require("node:fs");
|
|
|
31
32
|
const node_path_1 = __importDefault(require("node:path"));
|
|
32
33
|
/** Runtime binary names, current first. */
|
|
33
34
|
exports.RUNTIME_BINARY_NAMES = ['skrrd', 'oversky'];
|
|
35
|
+
/**
|
|
36
|
+
* The sentence a `skrr daemon` pass-through appends to its description.
|
|
37
|
+
*
|
|
38
|
+
* OSK-296 made these commands forward their flags to `skrrd` instead of
|
|
39
|
+
* rejecting them, and stopped there. oclif renders the FLAGS section of help
|
|
40
|
+
* from a command's declared flags, and a pass-through declares none — so help
|
|
41
|
+
* kept describing the old, broken behaviour where these commands took nothing,
|
|
42
|
+
* while `skrr daemon status --profile work` quietly worked. The entire flag
|
|
43
|
+
* surface of the wrapped binary became reachable and undiscoverable in the
|
|
44
|
+
* same commit.
|
|
45
|
+
*
|
|
46
|
+
* `skrr code` hit this first and fixed BOTH halves: its description says out
|
|
47
|
+
* loud that engine flags are not listed there and where to find them. This is
|
|
48
|
+
* that sentence, for the other wrapper, in one place so eight commands cannot
|
|
49
|
+
* drift into eight wordings.
|
|
50
|
+
*
|
|
51
|
+
* It names `skrrd --help` separately because `--profile` is a GLOBAL option on
|
|
52
|
+
* the runtime, so a reader sent only to the subcommand's help would not find
|
|
53
|
+
* the flag they are most likely to want.
|
|
54
|
+
*
|
|
55
|
+
* This is a command's `description`, and each command keeps a short `summary`
|
|
56
|
+
* beside it. oclif renders `summary` in the topic listing and `description`
|
|
57
|
+
* only in the command's own help, so the note reaches someone asking about
|
|
58
|
+
* THIS command without turning `skrr daemon --help` into eight paragraphs of
|
|
59
|
+
* the same boilerplate — which is what it did when this text was appended to
|
|
60
|
+
* `description` alone.
|
|
61
|
+
*/
|
|
62
|
+
function forwardedFlagsNote(verb, opts = {}) {
|
|
63
|
+
const base = `Flags are forwarded to \`skrrd ${verb}\` unchanged, so they are not listed here —` +
|
|
64
|
+
` run \`skrrd ${verb} --help\` for this verb's own flags, or \`skrrd --help\` for` +
|
|
65
|
+
' global ones such as `--profile`.';
|
|
66
|
+
// `install` and `login` are not pure pass-throughs: they fill in the server
|
|
67
|
+
// and profile from the CLI's own session when the caller named neither, so a
|
|
68
|
+
// daemon cannot silently end up on a different deployment than the CLI that
|
|
69
|
+
// installed it (OSK-279). Saying so is the difference between a flag you may
|
|
70
|
+
// pass and a flag that is already being passed for you.
|
|
71
|
+
return opts.binds
|
|
72
|
+
? `${base} \`--server\` and \`--profile\` are filled in from your CLI session unless you pass them.`
|
|
73
|
+
: base;
|
|
74
|
+
}
|
|
34
75
|
/** Extra well-known install locations to check when PATH lookup misses. */
|
|
35
76
|
const FALLBACK_PATHS = exports.RUNTIME_BINARY_NAMES.flatMap((name) => [
|
|
36
77
|
`/opt/homebrew/bin/${name}`,
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -34,6 +34,13 @@ export declare function truncate(s: string, max: number): string;
|
|
|
34
34
|
* reads as missing instead of as the string `undefined`.
|
|
35
35
|
*/
|
|
36
36
|
export declare function formatCell(value: unknown, placeholder?: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Collapse newlines/runs of whitespace so a value cannot break the table grid.
|
|
39
|
+
*
|
|
40
|
+
* Exported because `renderTable` applies it to EVERY cell, not just the ones
|
|
41
|
+
* that happened to come through `formatCell`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function collapseWhitespace(value: string): string;
|
|
37
44
|
/**
|
|
38
45
|
* Render an array of row objects as a column-aligned table.
|
|
39
46
|
*
|
package/dist/lib/format.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.displayWidth = displayWidth;
|
|
|
4
4
|
exports.pad = pad;
|
|
5
5
|
exports.truncate = truncate;
|
|
6
6
|
exports.formatCell = formatCell;
|
|
7
|
+
exports.collapseWhitespace = collapseWhitespace;
|
|
7
8
|
exports.renderTable = renderTable;
|
|
8
9
|
exports.localStamp = localStamp;
|
|
9
10
|
exports.localZone = localZone;
|
|
@@ -141,28 +142,49 @@ function stringifyCell(value, depth) {
|
|
|
141
142
|
.filter(Boolean)
|
|
142
143
|
.join(' ');
|
|
143
144
|
}
|
|
144
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Collapse newlines/runs of whitespace so a value cannot break the table grid.
|
|
147
|
+
*
|
|
148
|
+
* Exported because `renderTable` applies it to EVERY cell, not just the ones
|
|
149
|
+
* that happened to come through `formatCell`.
|
|
150
|
+
*/
|
|
145
151
|
function collapseWhitespace(value) {
|
|
146
152
|
return value.replace(/\s+/g, ' ').trim();
|
|
147
153
|
}
|
|
148
154
|
function renderTable(rows, columns, log) {
|
|
149
155
|
if (rows.length === 0)
|
|
150
156
|
return;
|
|
157
|
+
// Every cell is collapsed ONCE, here, before anything measures it. A
|
|
158
|
+
// fixed-width cell cannot legally contain a newline, and the table is the
|
|
159
|
+
// only place that knows that — a caller passing `String(item.preview)` has
|
|
160
|
+
// no idea whether the API's preview is one line or twelve.
|
|
161
|
+
//
|
|
162
|
+
// It has to happen before the width pass, not just at render: `displayWidth`
|
|
163
|
+
// counts a newline as one column, so an embedded one made the measurement
|
|
164
|
+
// wrong as well as the output. `tasks complete` writes a multi-line
|
|
165
|
+
// `---TASK_OUTPUT---` comment, so `tasks timeline` exploded one row across
|
|
166
|
+
// three physical lines and lost column alignment for everything after it —
|
|
167
|
+
// on every task that had been completed, which is all of them.
|
|
168
|
+
//
|
|
169
|
+
// `verbatim` is exempt from CLIPPING, not from this: an unclipped newline
|
|
170
|
+
// breaks the grid exactly as badly, and an id column never contains one.
|
|
171
|
+
const cells = rows.map((row) => Object.fromEntries(columns.map((col) => [String(col.key), collapseWhitespace(String(row[col.key] ?? ''))])));
|
|
151
172
|
const widths = {};
|
|
152
173
|
for (const col of columns) {
|
|
153
174
|
const key = String(col.key);
|
|
154
175
|
const headerWidth = displayWidth(col.header);
|
|
155
|
-
const dataWidth = Math.max(...
|
|
176
|
+
const dataWidth = Math.max(0, ...cells.map((r) => displayWidth(r[key])));
|
|
156
177
|
const natural = Math.max(headerWidth, dataWidth);
|
|
157
178
|
widths[key] = col.maxWidth && !col.verbatim ? Math.min(natural, col.maxWidth) : natural;
|
|
158
179
|
}
|
|
159
180
|
const header = columns.map((col) => pad(col.header, widths[String(col.key)])).join(' ');
|
|
160
181
|
log(header);
|
|
161
|
-
for (const row of
|
|
182
|
+
for (const row of cells) {
|
|
162
183
|
const line = columns
|
|
163
184
|
.map((col) => {
|
|
164
|
-
const
|
|
165
|
-
const
|
|
185
|
+
const key = String(col.key);
|
|
186
|
+
const raw = row[key];
|
|
187
|
+
const width = widths[key];
|
|
166
188
|
return pad(col.verbatim ? raw : truncate(raw, width), width);
|
|
167
189
|
})
|
|
168
190
|
.join(' ');
|
package/dist/lib/login.js
CHANGED
|
@@ -52,6 +52,8 @@ async function cliLogin(opts = {}) {
|
|
|
52
52
|
}
|
|
53
53
|
const envForce = isTruthy(process.env.OVERSKY_FORCE_DEVICE_CODE);
|
|
54
54
|
const ssh = (0, ssh_detect_1.detectSshSession)();
|
|
55
|
+
/** Set when the broker was refused for a reason that WAITING fixes. */
|
|
56
|
+
let brokerRateLimited = false;
|
|
55
57
|
// --- Daemon-as-broker pre-flight ---------------------------------------
|
|
56
58
|
// When the local `oversky` daemon is already authenticated for this user
|
|
57
59
|
// on this machine, the cleanest UX is no second browser flow at all:
|
|
@@ -114,6 +116,20 @@ async function cliLogin(opts = {}) {
|
|
|
114
116
|
// the PKCE flow opens a browser to a different URL than the
|
|
115
117
|
// daemon. Continues to PKCE below — that's the right fallback for
|
|
116
118
|
// "I'm logging into a different server than the daemon".
|
|
119
|
+
// Transient by construction — the ceiling is per 15-minute window — so the
|
|
120
|
+
// useful thing to say is "wait", not "here is a browser". An interactive
|
|
121
|
+
// user still gets the browser, because that genuinely works for them; the
|
|
122
|
+
// note exists so a surprise browser has a stated cause. Non-interactive
|
|
123
|
+
// callers get the real reason from the throw below instead of a sentence
|
|
124
|
+
// about terminals.
|
|
125
|
+
if (brokerResult.reason === 'rate_limited') {
|
|
126
|
+
brokerRateLimited = true;
|
|
127
|
+
if (!(0, ssh_detect_1.isNonInteractive)()) {
|
|
128
|
+
console.log('');
|
|
129
|
+
console.log(' The local skrr runtime has brokered several logins recently and the server is ' +
|
|
130
|
+
'rate-limiting them. Falling back to the browser flow.');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
117
133
|
if (brokerResult.reason === 'base_url_mismatch' && brokerResult.daemonServerUrl) {
|
|
118
134
|
console.log('');
|
|
119
135
|
console.log(` The local skrr runtime is logged in to ${brokerResult.daemonServerUrl}, but skrr is configured for ${serverUrl}.`);
|
|
@@ -121,8 +137,12 @@ async function cliLogin(opts = {}) {
|
|
|
121
137
|
}
|
|
122
138
|
}
|
|
123
139
|
if ((0, ssh_detect_1.isNonInteractive)()) {
|
|
124
|
-
throw new Error(
|
|
125
|
-
'
|
|
140
|
+
throw new Error(brokerRateLimited
|
|
141
|
+
? 'The local skrr runtime is being rate-limited while brokering logins, and this ' +
|
|
142
|
+
'shell cannot run the browser flow instead. The limit is per 15-minute window — ' +
|
|
143
|
+
'retry shortly. For CI, use `skrr create-token` and set OVERSKY_TOKEN=osk_ci_...'
|
|
144
|
+
: 'skrr login requires an interactive terminal or an SSH session. ' +
|
|
145
|
+
'For CI, use `skrr create-token` and set OVERSKY_TOKEN=osk_ci_...');
|
|
126
146
|
}
|
|
127
147
|
// --- Decision tree (first match wins) ---
|
|
128
148
|
if (opts.forceDeviceCode) {
|
package/dist/lib/sky-code.js
CHANGED
|
@@ -91,7 +91,7 @@ function managedEnginePath(exeName, env = process.env) {
|
|
|
91
91
|
* hard-coded home would defeat the pinning {@link engineHome} relies on.
|
|
92
92
|
*/
|
|
93
93
|
function legacyManagedEnginePath(exeName, env = process.env) {
|
|
94
|
-
if (
|
|
94
|
+
if ((0, auth_core_1.isConfigRootOverridden)(env))
|
|
95
95
|
return null;
|
|
96
96
|
return node_path_1.default.join((0, node_os_1.homedir)(), '.oversky', 'sky-code', 'bin', exeName);
|
|
97
97
|
}
|
|
@@ -23,6 +23,15 @@ export type TaskOutputComment = {
|
|
|
23
23
|
parsed: ParsedTaskOutput;
|
|
24
24
|
/** Block lines the field parser could not attribute — see `unattributedBlockLines`. */
|
|
25
25
|
unattributed: string[];
|
|
26
|
+
/**
|
|
27
|
+
* How many OLDER TASK_OUTPUT blocks this one supersedes.
|
|
28
|
+
*
|
|
29
|
+
* `tasks complete` can run twice on an already-done task, and each run posts
|
|
30
|
+
* its own block. Callers render the newest, so without this count a screen
|
|
31
|
+
* built from several completions is indistinguishable from one built from a
|
|
32
|
+
* single completion.
|
|
33
|
+
*/
|
|
34
|
+
supersededCount: number;
|
|
26
35
|
};
|
|
27
36
|
/**
|
|
28
37
|
* Mirror of `api/server/services/taskCompletionFormatting.js:parseTaskOutputBlock`.
|
|
@@ -130,21 +130,32 @@ async function fetchLatestTaskOutputComment(taskId, limit = 50) {
|
|
|
130
130
|
const comments = response?.data ?? [];
|
|
131
131
|
// listTaskComments returns newest-first; take the first parseable block so a
|
|
132
132
|
// later "action items tracked" follow-up comment doesn't mask the real output.
|
|
133
|
+
// Keep walking after finding it, though — the REST are earlier completions,
|
|
134
|
+
// and their number is the only signal a caller has that the newest block is
|
|
135
|
+
// not the whole story.
|
|
136
|
+
let newest = null;
|
|
137
|
+
let blocks = 0;
|
|
133
138
|
for (const comment of comments) {
|
|
134
139
|
const body = String(comment.body ?? comment.content ?? '');
|
|
135
140
|
const parsed = parseTaskOutputBlock(body);
|
|
136
141
|
if (!parsed)
|
|
137
142
|
continue;
|
|
138
|
-
|
|
143
|
+
blocks += 1;
|
|
144
|
+
if (newest)
|
|
145
|
+
continue;
|
|
146
|
+
newest = {
|
|
139
147
|
commentId: String(comment.id ?? comment._id ?? '-'),
|
|
140
148
|
createdAt: comment.createdAt ? String(comment.createdAt) : null,
|
|
141
149
|
author: String(comment.authorAgentId ?? comment.authorUserId ?? comment.author ?? '-'),
|
|
142
150
|
body,
|
|
143
151
|
parsed,
|
|
144
152
|
unattributed: unattributedBlockLines(body),
|
|
153
|
+
supersededCount: 0,
|
|
145
154
|
};
|
|
146
155
|
}
|
|
147
|
-
|
|
156
|
+
if (newest)
|
|
157
|
+
newest.supersededCount = blocks - 1;
|
|
158
|
+
return newest;
|
|
148
159
|
}
|
|
149
160
|
/** Last message the agent (not the user) produced in the execution conversation. */
|
|
150
161
|
function lastAssistantMessage(messages) {
|
package/dist/lib/tasks.d.ts
CHANGED
|
@@ -194,3 +194,37 @@ export declare function normalizeBulkUpdateInput(input: unknown): Array<{
|
|
|
194
194
|
id: string;
|
|
195
195
|
patch: TaskRecord;
|
|
196
196
|
}>;
|
|
197
|
+
/**
|
|
198
|
+
* Verdict strings the server recognises on a task completion.
|
|
199
|
+
*
|
|
200
|
+
* `--verdict` is free text: `skrr tasks complete <id> --verdict banana`
|
|
201
|
+
* succeeds and the value is permanently recorded, while `--status` beside it
|
|
202
|
+
* is enumerated and rejects a typo. So `--verdict aproved` closes a task with
|
|
203
|
+
* a verdict nothing matches, quietly.
|
|
204
|
+
*
|
|
205
|
+
* It cannot simply be enumerated, and that is the point worth recording:
|
|
206
|
+
*
|
|
207
|
+
* - A REVIEWER task legitimately passes a JSON object
|
|
208
|
+
* (`{"posture":"request_changes","confidence":0.82,"criteria":[…]}`) —
|
|
209
|
+
* documented in the task-execution prompt and consumed by
|
|
210
|
+
* `normalizeReviewPosture`. `options:` on the flag would refuse it.
|
|
211
|
+
* - That normaliser accepts synonyms, and when it recognises NOTHING it does
|
|
212
|
+
* not fail — it derives the posture from the criteria instead. So a typo
|
|
213
|
+
* silently becomes whatever the criteria imply.
|
|
214
|
+
*
|
|
215
|
+
* Hence a warning, not a refusal, over the set the server actually matches.
|
|
216
|
+
* Mirrored from `normalizeReviewPosture` in
|
|
217
|
+
* `api/server/services/TasksMCP/taskExecutionHelpers.js` and pinned against it
|
|
218
|
+
* by `task-verdict-parity.spec.ts`, the same way TASK_WORK_EVENT_KINDS is.
|
|
219
|
+
*/
|
|
220
|
+
export declare const RECOGNIZED_TASK_VERDICTS: readonly ["request_changes", "changes_requested", "needs_changes", "needs_revision", "approved", "approve", "pass", "passed", "blocked"];
|
|
221
|
+
/** The server's own normalisation, so the same spellings match here. */
|
|
222
|
+
export declare function normalizeVerdict(value: string): string;
|
|
223
|
+
/**
|
|
224
|
+
* Does this verdict mean anything to the server?
|
|
225
|
+
*
|
|
226
|
+
* `UNVERIFIED` is platform-stamped rather than user-supplied, and a JSON
|
|
227
|
+
* verdict is the reviewer shape — both are legitimate and neither is in the
|
|
228
|
+
* synonym list.
|
|
229
|
+
*/
|
|
230
|
+
export declare function verdictIsRecognized(value: string | undefined): boolean;
|
package/dist/lib/tasks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TASK_WORK_EVENT_KINDS = exports.TASK_PRIORITIES = void 0;
|
|
3
|
+
exports.RECOGNIZED_TASK_VERDICTS = exports.TASK_WORK_EVENT_KINDS = exports.TASK_PRIORITIES = void 0;
|
|
4
4
|
exports.releasePinRepairGuard = releasePinRepairGuard;
|
|
5
5
|
exports.taskUpdateMutationGuard = taskUpdateMutationGuard;
|
|
6
6
|
exports.executionIsolationFromWorktreeFlag = executionIsolationFromWorktreeFlag;
|
|
@@ -27,6 +27,8 @@ exports.formatTaskLabel = formatTaskLabel;
|
|
|
27
27
|
exports.hasTaskAssignee = hasTaskAssignee;
|
|
28
28
|
exports.normalizeTaskUpdateEntry = normalizeTaskUpdateEntry;
|
|
29
29
|
exports.normalizeBulkUpdateInput = normalizeBulkUpdateInput;
|
|
30
|
+
exports.normalizeVerdict = normalizeVerdict;
|
|
31
|
+
exports.verdictIsRecognized = verdictIsRecognized;
|
|
30
32
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
31
33
|
const prompt_1 = require("./prompt");
|
|
32
34
|
const projects_1 = require("./projects");
|
|
@@ -715,3 +717,70 @@ function formatApiError(err) {
|
|
|
715
717
|
return err.message;
|
|
716
718
|
return String(err);
|
|
717
719
|
}
|
|
720
|
+
/**
|
|
721
|
+
* Verdict strings the server recognises on a task completion.
|
|
722
|
+
*
|
|
723
|
+
* `--verdict` is free text: `skrr tasks complete <id> --verdict banana`
|
|
724
|
+
* succeeds and the value is permanently recorded, while `--status` beside it
|
|
725
|
+
* is enumerated and rejects a typo. So `--verdict aproved` closes a task with
|
|
726
|
+
* a verdict nothing matches, quietly.
|
|
727
|
+
*
|
|
728
|
+
* It cannot simply be enumerated, and that is the point worth recording:
|
|
729
|
+
*
|
|
730
|
+
* - A REVIEWER task legitimately passes a JSON object
|
|
731
|
+
* (`{"posture":"request_changes","confidence":0.82,"criteria":[…]}`) —
|
|
732
|
+
* documented in the task-execution prompt and consumed by
|
|
733
|
+
* `normalizeReviewPosture`. `options:` on the flag would refuse it.
|
|
734
|
+
* - That normaliser accepts synonyms, and when it recognises NOTHING it does
|
|
735
|
+
* not fail — it derives the posture from the criteria instead. So a typo
|
|
736
|
+
* silently becomes whatever the criteria imply.
|
|
737
|
+
*
|
|
738
|
+
* Hence a warning, not a refusal, over the set the server actually matches.
|
|
739
|
+
* Mirrored from `normalizeReviewPosture` in
|
|
740
|
+
* `api/server/services/TasksMCP/taskExecutionHelpers.js` and pinned against it
|
|
741
|
+
* by `task-verdict-parity.spec.ts`, the same way TASK_WORK_EVENT_KINDS is.
|
|
742
|
+
*/
|
|
743
|
+
exports.RECOGNIZED_TASK_VERDICTS = [
|
|
744
|
+
'request_changes',
|
|
745
|
+
'changes_requested',
|
|
746
|
+
'needs_changes',
|
|
747
|
+
'needs_revision',
|
|
748
|
+
'approved',
|
|
749
|
+
'approve',
|
|
750
|
+
'pass',
|
|
751
|
+
'passed',
|
|
752
|
+
'blocked',
|
|
753
|
+
];
|
|
754
|
+
/** The server's own normalisation, so the same spellings match here. */
|
|
755
|
+
function normalizeVerdict(value) {
|
|
756
|
+
return String(value ?? '')
|
|
757
|
+
.trim()
|
|
758
|
+
.toLowerCase()
|
|
759
|
+
.replace(/[\s-]+/g, '_');
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Does this verdict mean anything to the server?
|
|
763
|
+
*
|
|
764
|
+
* `UNVERIFIED` is platform-stamped rather than user-supplied, and a JSON
|
|
765
|
+
* verdict is the reviewer shape — both are legitimate and neither is in the
|
|
766
|
+
* synonym list.
|
|
767
|
+
*/
|
|
768
|
+
function verdictIsRecognized(value) {
|
|
769
|
+
if (!value)
|
|
770
|
+
return true;
|
|
771
|
+
const raw = value.trim();
|
|
772
|
+
if (!raw)
|
|
773
|
+
return true;
|
|
774
|
+
if (raw.toUpperCase() === 'UNVERIFIED')
|
|
775
|
+
return true;
|
|
776
|
+
if (raw.startsWith('{') || raw.startsWith('[')) {
|
|
777
|
+
try {
|
|
778
|
+
JSON.parse(raw);
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
catch {
|
|
782
|
+
return false;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return exports.RECOGNIZED_TASK_VERDICTS.includes(normalizeVerdict(raw));
|
|
786
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skrr root — the single definition of where this machine keeps its skrr
|
|
3
|
+
* state.
|
|
4
|
+
*
|
|
5
|
+
* It lives here because BOTH binaries need the same answer and neither owns it.
|
|
6
|
+
* `skrr` and `skrrd` keep separate credentials on purpose, but they share one
|
|
7
|
+
* root, and every place that re-derived it became a place they could disagree.
|
|
8
|
+
* They did, twice in one day:
|
|
9
|
+
*
|
|
10
|
+
* - The CLI's engine path honoured `OVERSKY_CONFIG_DIR` while its config did
|
|
11
|
+
* not, so a relocated root moved the engine and left the credentials in
|
|
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
|
|
14
|
+
* only the old name.
|
|
15
|
+
* - The daemon then had the same shape, and fixing the CLI's half turned it
|
|
16
|
+
* into a CLI/daemon divergence: with the variable set, the two halves of one
|
|
17
|
+
* product disagreed about where the credentials live.
|
|
18
|
+
*
|
|
19
|
+
* Each of those was a correct local fix that created the next defect, because
|
|
20
|
+
* the root was being DERIVED rather than READ. Teaching every site the same list
|
|
21
|
+
* of variable names only defers the problem to whenever the list changes again —
|
|
22
|
+
* which is exactly what `SKRR_CONFIG_DIR` did.
|
|
23
|
+
*
|
|
24
|
+
* So: one function, and a boundary test that fails if anything re-derives it.
|
|
25
|
+
*
|
|
26
|
+
* `SKRR_CONFIG_DIR` is the spelling for anything new (root `CLAUDE.md`) and wins
|
|
27
|
+
* when both are set. `OVERSKY_CONFIG_DIR` keeps working because existing installs,
|
|
28
|
+
* the engine resolver and the daemon all read it, and breaking a documented
|
|
29
|
+
* override to tidy a name would be a worse trade than carrying two.
|
|
30
|
+
*
|
|
31
|
+
* Takes `env` rather than reading the global so a caller can resolve a root for a
|
|
32
|
+
* child process it is about to spawn, and so tests need no process-wide mutation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveConfigRoot(env?: NodeJS.ProcessEnv): string;
|
|
35
|
+
/** A path under the skrr root, e.g. `configRootPath(env, 'sky-code', 'bin')`. */
|
|
36
|
+
export declare function configRootPath(env: NodeJS.ProcessEnv, ...segments: string[]): string;
|
|
37
|
+
/**
|
|
38
|
+
* Has the operator explicitly relocated the root?
|
|
39
|
+
*
|
|
40
|
+
* A distinct question from "what is the root", and it has a real caller: the
|
|
41
|
+
* legacy-location fallbacks exist to find state left by an older layout under
|
|
42
|
+
* `$HOME`, and once someone has POINTED the root somewhere, guessing at
|
|
43
|
+
* `$HOME` is no longer a helpful fallback — it is a different machine's data.
|
|
44
|
+
*
|
|
45
|
+
* Shared for the same reason as `resolveConfigRoot`: this check was copied to
|
|
46
|
+
* three call sites, each spelling the variable list itself, so adding
|
|
47
|
+
* `SKRR_CONFIG_DIR` to the resolver silently left the copies answering the old
|
|
48
|
+
* question.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isConfigRootOverridden(env?: NodeJS.ProcessEnv): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.resolveConfigRoot = resolveConfigRoot;
|
|
7
|
+
exports.configRootPath = configRootPath;
|
|
8
|
+
exports.isConfigRootOverridden = isConfigRootOverridden;
|
|
9
|
+
const node_os_1 = require("node:os");
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
+
/**
|
|
12
|
+
* The skrr root — the single definition of where this machine keeps its skrr
|
|
13
|
+
* state.
|
|
14
|
+
*
|
|
15
|
+
* It lives here because BOTH binaries need the same answer and neither owns it.
|
|
16
|
+
* `skrr` and `skrrd` keep separate credentials on purpose, but they share one
|
|
17
|
+
* root, and every place that re-derived it became a place they could disagree.
|
|
18
|
+
* They did, twice in one day:
|
|
19
|
+
*
|
|
20
|
+
* - The CLI's engine path honoured `OVERSKY_CONFIG_DIR` while its config did
|
|
21
|
+
* not, so a relocated root moved the engine and left the credentials in
|
|
22
|
+
* `$HOME`. Fixed by teaching `config.ts` the variable — which promptly
|
|
23
|
+
* re-created the split in the mirror image, because `sky-code.ts` still read
|
|
24
|
+
* only the old name.
|
|
25
|
+
* - The daemon then had the same shape, and fixing the CLI's half turned it
|
|
26
|
+
* into a CLI/daemon divergence: with the variable set, the two halves of one
|
|
27
|
+
* product disagreed about where the credentials live.
|
|
28
|
+
*
|
|
29
|
+
* Each of those was a correct local fix that created the next defect, because
|
|
30
|
+
* the root was being DERIVED rather than READ. Teaching every site the same list
|
|
31
|
+
* of variable names only defers the problem to whenever the list changes again —
|
|
32
|
+
* which is exactly what `SKRR_CONFIG_DIR` did.
|
|
33
|
+
*
|
|
34
|
+
* So: one function, and a boundary test that fails if anything re-derives it.
|
|
35
|
+
*
|
|
36
|
+
* `SKRR_CONFIG_DIR` is the spelling for anything new (root `CLAUDE.md`) and wins
|
|
37
|
+
* when both are set. `OVERSKY_CONFIG_DIR` keeps working because existing installs,
|
|
38
|
+
* the engine resolver and the daemon all read it, and breaking a documented
|
|
39
|
+
* override to tidy a name would be a worse trade than carrying two.
|
|
40
|
+
*
|
|
41
|
+
* Takes `env` rather than reading the global so a caller can resolve a root for a
|
|
42
|
+
* child process it is about to spawn, and so tests need no process-wide mutation.
|
|
43
|
+
*/
|
|
44
|
+
function resolveConfigRoot(env = process.env) {
|
|
45
|
+
const override = (env.SKRR_CONFIG_DIR || env.OVERSKY_CONFIG_DIR)?.trim();
|
|
46
|
+
return override || node_path_1.default.join((0, node_os_1.homedir)(), '.skrr');
|
|
47
|
+
}
|
|
48
|
+
/** A path under the skrr root, e.g. `configRootPath(env, 'sky-code', 'bin')`. */
|
|
49
|
+
function configRootPath(env, ...segments) {
|
|
50
|
+
return node_path_1.default.join(resolveConfigRoot(env), ...segments);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Has the operator explicitly relocated the root?
|
|
54
|
+
*
|
|
55
|
+
* A distinct question from "what is the root", and it has a real caller: the
|
|
56
|
+
* legacy-location fallbacks exist to find state left by an older layout under
|
|
57
|
+
* `$HOME`, and once someone has POINTED the root somewhere, guessing at
|
|
58
|
+
* `$HOME` is no longer a helpful fallback — it is a different machine's data.
|
|
59
|
+
*
|
|
60
|
+
* Shared for the same reason as `resolveConfigRoot`: this check was copied to
|
|
61
|
+
* three call sites, each spelling the variable list itself, so adding
|
|
62
|
+
* `SKRR_CONFIG_DIR` to the resolver silently left the copies answering the old
|
|
63
|
+
* question.
|
|
64
|
+
*/
|
|
65
|
+
function isConfigRootOverridden(env = process.env) {
|
|
66
|
+
return Boolean((env.SKRR_CONFIG_DIR || env.OVERSKY_CONFIG_DIR)?.trim());
|
|
67
|
+
}
|
|
@@ -36,3 +36,4 @@ export { sanitizeSpawnEnv, SENSITIVE_ENV_VARS, SENSITIVE_ENV_PREFIXES, SENSITIVE
|
|
|
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
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';
|
|
39
|
+
export { resolveConfigRoot, configRootPath, isConfigRootOverridden } from './configRoot.js';
|
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
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
12
|
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
13
|
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.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_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = exports.sanitizeSpawnEnv = exports.tierPermitsConfiguredAutoMode = exports.credentialPolicyForTier = void 0;
|
|
14
|
+
exports.isConfigRootOverridden = exports.configRootPath = exports.resolveConfigRoot = 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_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = exports.sanitizeSpawnEnv = exports.tierPermitsConfiguredAutoMode = exports.credentialPolicyForTier = void 0;
|
|
15
15
|
// Daemon scope vocabulary — single source of truth for non-Mongoose tiers
|
|
16
16
|
// (daemon, desktop, cli). Schema-bound canonical lives in
|
|
17
17
|
// `@skrr-ai/data-schemas/common/daemonScopes`; the two are kept byte-equal
|
|
@@ -315,3 +315,9 @@ Object.defineProperty(exports, "resolveSkyCodeChannel", { enumerable: true, get:
|
|
|
315
315
|
Object.defineProperty(exports, "skyCodeChannelPrefix", { enumerable: true, get: function () { return skyCodeChannels_js_1.skyCodeChannelPrefix; } });
|
|
316
316
|
Object.defineProperty(exports, "skyCodeFeedBase", { enumerable: true, get: function () { return skyCodeChannels_js_1.skyCodeFeedBase; } });
|
|
317
317
|
Object.defineProperty(exports, "SKY_CODE_FEED_BASE_ENV", { enumerable: true, get: function () { return skyCodeChannels_js_1.SKY_CODE_FEED_BASE_ENV; } });
|
|
318
|
+
// The one definition of the skrr root, shared by `skrr` and `skrrd`. See the
|
|
319
|
+
// module for why re-deriving it kept producing divergences.
|
|
320
|
+
var configRoot_js_1 = require("./configRoot.js");
|
|
321
|
+
Object.defineProperty(exports, "resolveConfigRoot", { enumerable: true, get: function () { return configRoot_js_1.resolveConfigRoot; } });
|
|
322
|
+
Object.defineProperty(exports, "configRootPath", { enumerable: true, get: function () { return configRoot_js_1.configRootPath; } });
|
|
323
|
+
Object.defineProperty(exports, "isConfigRootOverridden", { enumerable: true, get: function () { return configRoot_js_1.isConfigRootOverridden; } });
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skrr root — the single definition of where this machine keeps its skrr
|
|
3
|
+
* state.
|
|
4
|
+
*
|
|
5
|
+
* It lives here because BOTH binaries need the same answer and neither owns it.
|
|
6
|
+
* `skrr` and `skrrd` keep separate credentials on purpose, but they share one
|
|
7
|
+
* root, and every place that re-derived it became a place they could disagree.
|
|
8
|
+
* They did, twice in one day:
|
|
9
|
+
*
|
|
10
|
+
* - The CLI's engine path honoured `OVERSKY_CONFIG_DIR` while its config did
|
|
11
|
+
* not, so a relocated root moved the engine and left the credentials in
|
|
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
|
|
14
|
+
* only the old name.
|
|
15
|
+
* - The daemon then had the same shape, and fixing the CLI's half turned it
|
|
16
|
+
* into a CLI/daemon divergence: with the variable set, the two halves of one
|
|
17
|
+
* product disagreed about where the credentials live.
|
|
18
|
+
*
|
|
19
|
+
* Each of those was a correct local fix that created the next defect, because
|
|
20
|
+
* the root was being DERIVED rather than READ. Teaching every site the same list
|
|
21
|
+
* of variable names only defers the problem to whenever the list changes again —
|
|
22
|
+
* which is exactly what `SKRR_CONFIG_DIR` did.
|
|
23
|
+
*
|
|
24
|
+
* So: one function, and a boundary test that fails if anything re-derives it.
|
|
25
|
+
*
|
|
26
|
+
* `SKRR_CONFIG_DIR` is the spelling for anything new (root `CLAUDE.md`) and wins
|
|
27
|
+
* when both are set. `OVERSKY_CONFIG_DIR` keeps working because existing installs,
|
|
28
|
+
* the engine resolver and the daemon all read it, and breaking a documented
|
|
29
|
+
* override to tidy a name would be a worse trade than carrying two.
|
|
30
|
+
*
|
|
31
|
+
* Takes `env` rather than reading the global so a caller can resolve a root for a
|
|
32
|
+
* child process it is about to spawn, and so tests need no process-wide mutation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveConfigRoot(env?: NodeJS.ProcessEnv): string;
|
|
35
|
+
/** A path under the skrr root, e.g. `configRootPath(env, 'sky-code', 'bin')`. */
|
|
36
|
+
export declare function configRootPath(env: NodeJS.ProcessEnv, ...segments: string[]): string;
|
|
37
|
+
/**
|
|
38
|
+
* Has the operator explicitly relocated the root?
|
|
39
|
+
*
|
|
40
|
+
* A distinct question from "what is the root", and it has a real caller: the
|
|
41
|
+
* legacy-location fallbacks exist to find state left by an older layout under
|
|
42
|
+
* `$HOME`, and once someone has POINTED the root somewhere, guessing at
|
|
43
|
+
* `$HOME` is no longer a helpful fallback — it is a different machine's data.
|
|
44
|
+
*
|
|
45
|
+
* Shared for the same reason as `resolveConfigRoot`: this check was copied to
|
|
46
|
+
* three call sites, each spelling the variable list itself, so adding
|
|
47
|
+
* `SKRR_CONFIG_DIR` to the resolver silently left the copies answering the old
|
|
48
|
+
* question.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isConfigRootOverridden(env?: NodeJS.ProcessEnv): boolean;
|