@skrr-ai/cli 0.1.31 → 0.1.33
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/bin/run.js +2 -2
- package/dist/commands/agents/list.d.ts +2 -1
- package/dist/commands/agents/list.js +2 -1
- package/dist/commands/agents/show.js +2 -1
- package/dist/commands/balance/statement.js +8 -4
- package/dist/commands/browser/install.js +6 -2
- package/dist/commands/browser/uninstall.js +6 -2
- package/dist/commands/code/acp.js +2 -1
- package/dist/commands/code/doctor.d.ts +1 -1
- package/dist/commands/code/doctor.js +6 -5
- package/dist/commands/code/handover.d.ts +2 -2
- package/dist/commands/code/handover.js +2 -2
- package/dist/commands/code/index.d.ts +2 -2
- package/dist/commands/code/index.js +18 -17
- package/dist/commands/code/install.d.ts +3 -3
- package/dist/commands/code/install.js +18 -11
- package/dist/commands/code/migrate.js +3 -2
- package/dist/commands/code/oversky-agent.d.ts +5 -4
- package/dist/commands/code/oversky-agent.js +24 -22
- package/dist/commands/code/run.js +2 -1
- package/dist/commands/harnesses/list.d.ts +9 -1
- package/dist/commands/harnesses/list.js +28 -7
- package/dist/commands/harnesses/show.js +7 -2
- package/dist/commands/instructions/install.js +16 -6
- package/dist/commands/learning/delete.d.ts +9 -0
- package/dist/commands/learning/delete.js +39 -0
- package/dist/commands/learning/export.d.ts +5 -0
- package/dist/commands/learning/export.js +22 -0
- package/dist/commands/learning/reset.d.ts +9 -0
- package/dist/commands/learning/reset.js +34 -0
- package/dist/commands/learning/set.d.ts +10 -0
- package/dist/commands/learning/set.js +52 -0
- package/dist/commands/learning/status.d.ts +8 -0
- package/dist/commands/learning/status.js +35 -0
- package/dist/commands/logout.js +10 -5
- package/dist/commands/machines/dedicated/attach.js +2 -1
- package/dist/commands/tasks/runs.js +3 -1
- package/dist/commands/workspaces/use.js +2 -1
- package/dist/lib/adaptive-learning.d.ts +37 -0
- package/dist/lib/adaptive-learning.js +39 -0
- package/dist/lib/code-handover.d.ts +1 -1
- package/dist/lib/code-handover.js +3 -2
- package/dist/lib/config.d.ts +30 -4
- package/dist/lib/config.js +2 -1
- package/dist/lib/daemon-installer.d.ts +1 -1
- package/dist/lib/daemon-target.js +2 -2
- package/dist/lib/dedicated-lease-command.js +2 -1
- package/dist/lib/dedicated-machines.d.ts +2 -2
- package/dist/lib/dedicated-machines.js +6 -3
- package/dist/lib/exec-runtime-binary.d.ts +2 -2
- package/dist/lib/exec-runtime-binary.js +2 -2
- package/dist/lib/{sky-code-agent.d.ts → first-party-harness-agent.d.ts} +20 -19
- package/dist/lib/{sky-code-agent.js → first-party-harness-agent.js} +85 -47
- package/dist/lib/{sky-code-broker.d.ts → first-party-harness-broker.d.ts} +6 -6
- package/dist/lib/{sky-code-broker.js → first-party-harness-broker.js} +23 -23
- package/dist/lib/{sky-code-doctor.d.ts → first-party-harness-doctor.d.ts} +12 -2
- package/dist/lib/{sky-code-doctor.js → first-party-harness-doctor.js} +181 -94
- package/dist/lib/{sky-code-managed.d.ts → first-party-harness-managed.d.ts} +55 -30
- package/dist/lib/{sky-code-managed.js → first-party-harness-managed.js} +92 -35
- package/dist/lib/{sky-code.d.ts → first-party-harness.d.ts} +107 -36
- package/dist/lib/{sky-code.js → first-party-harness.js} +172 -73
- package/dist/lib/harness-provider-input.d.ts +35 -0
- package/dist/lib/harness-provider-input.js +57 -0
- package/dist/lib/harness-tiers.d.ts +8 -2
- package/dist/lib/harness-tiers.js +11 -6
- package/dist/lib/task-instruction-offer.js +10 -4
- package/dist/lib/worklogs.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +248 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +361 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +147 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +180 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessHome.d.ts +111 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessHome.js +314 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.d.ts +11 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +14 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +51 -14
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +248 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +332 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +147 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +170 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessHome.d.ts +111 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessHome.js +303 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.d.ts +11 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +14 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +12 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +4816 -4782
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.js +1 -1
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +1 -1
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +1 -1
- package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
- package/oclif.manifest.json +27119 -26808
- package/package.json +5 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/skyCodeChannels.d.ts +0 -96
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/skyCodeChannels.js +0 -115
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/skyCodeChannels.d.ts +0 -96
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/skyCodeChannels.js +0 -107
package/dist/commands/logout.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.shouldSkipLocalLogout = shouldSkipLocalLogout;
|
|
|
37
37
|
const core_1 = require("@oclif/core");
|
|
38
38
|
const base_command_1 = require("../base-command");
|
|
39
39
|
const config_1 = require("../lib/config");
|
|
40
|
+
const first_party_harness_managed_1 = require("../lib/first-party-harness-managed");
|
|
40
41
|
const auth_storage_1 = require("../lib/auth-storage");
|
|
41
42
|
const refresh_1 = require("../lib/refresh");
|
|
42
43
|
const api_fetch_1 = require("../lib/api-fetch");
|
|
@@ -212,10 +213,13 @@ class Logout extends base_command_1.BaseCommand {
|
|
|
212
213
|
//
|
|
213
214
|
// This rebuilds the object rather than deleting keys, which is what strips
|
|
214
215
|
// the tokens — so every field worth keeping has to be named here, and one
|
|
215
|
-
// that is not named is dropped SILENTLY. `
|
|
216
|
-
// that position: `skrr code` told users to set it, and the next
|
|
217
|
-
// erased it with no message. It is preserved for the same reason
|
|
218
|
-
// and `cliId` are — this machine's settings outlive one session.
|
|
216
|
+
// that is not named is dropped SILENTLY. The `skrr code` agent setting was in
|
|
217
|
+
// exactly that position: `skrr code` told users to set it, and the next
|
|
218
|
+
// `skrr logout` erased it with no message. It is preserved for the same reason
|
|
219
|
+
// `baseURL` and `cliId` are — this machine's settings outlive one session.
|
|
220
|
+
//
|
|
221
|
+
// Read under every key it has had and written back under the neutral one, so a
|
|
222
|
+
// logout on a machine an older CLI configured also finishes that key's move.
|
|
219
223
|
//
|
|
220
224
|
// It is re-resolved through the NEXT caller's own roster, so an id they
|
|
221
225
|
// cannot reach is refused by name rather than silently attributed. That is
|
|
@@ -225,10 +229,11 @@ class Logout extends base_command_1.BaseCommand {
|
|
|
225
229
|
// would bill it. `skrr code skrr-agent --show` reports the resolved agent
|
|
226
230
|
// and where it came from, which is the intended way to notice.
|
|
227
231
|
const cfg = (0, config_1.loadConfig)();
|
|
232
|
+
const agentSetting = (0, first_party_harness_managed_1.readAgentSetting)(cfg);
|
|
228
233
|
(0, config_1.saveConfig)({
|
|
229
234
|
baseURL: cfg.baseURL,
|
|
230
235
|
...(cfg.cliId ? { cliId: cfg.cliId } : {}),
|
|
231
|
-
...(
|
|
236
|
+
...(agentSetting.value ? { [first_party_harness_managed_1.AGENT_CONFIG_KEY]: agentSetting.value } : {}),
|
|
232
237
|
...(cfg.credentials ? { credentials: cfg.credentials } : {}),
|
|
233
238
|
migrated: { ...(cfg.migrated ?? {}), authOutOfConfig: true },
|
|
234
239
|
});
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
7
8
|
const dedicated_lease_command_1 = require("../../../lib/dedicated-lease-command");
|
|
8
9
|
const dedicated_machines_1 = require("../../../lib/dedicated-machines");
|
|
9
10
|
const harnesses_1 = require("../../../lib/harnesses");
|
|
@@ -40,7 +41,7 @@ class DedicatedMachinesAttach extends dedicated_lease_command_1.DedicatedLeaseCo
|
|
|
40
41
|
description: 'Agent to attach. Inside an agent session it defaults to that agent (OVERSKY_SESSION_AGENT_ID).',
|
|
41
42
|
}),
|
|
42
43
|
engine: core_1.Flags.string({
|
|
43
|
-
description:
|
|
44
|
+
description: `Which engine row to attach when the machine registered several (claude, codex, ${auth_core_1.FIRST_PARTY_HARNESS.provider}, oversky). Required only when it is ambiguous.`,
|
|
44
45
|
}),
|
|
45
46
|
'rebind-tasks': core_1.Flags.boolean({
|
|
46
47
|
description: 'Publish the updated agent release and move dormant assigned task pins to it. Running and finished tasks are never changed.',
|
|
@@ -5,6 +5,7 @@ exports.runNeedsFailureReason = runNeedsFailureReason;
|
|
|
5
5
|
exports.failureFromRun = failureFromRun;
|
|
6
6
|
exports.renderRunFailures = renderRunFailures;
|
|
7
7
|
const core_1 = require("@oclif/core");
|
|
8
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
8
9
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
9
10
|
const base_command_1 = require("../../base-command");
|
|
10
11
|
const format_1 = require("../../lib/format");
|
|
@@ -34,7 +35,8 @@ function formatRunExecutor(run) {
|
|
|
34
35
|
}
|
|
35
36
|
const env = run.executionEnvironment;
|
|
36
37
|
if (typeof env === 'string' && env.trim() !== '') {
|
|
37
|
-
|
|
38
|
+
// Canonical: a run recorded before or after a harness rename prints one name.
|
|
39
|
+
return String((0, auth_core_1.canonicalExecutionEnvironment)(env));
|
|
38
40
|
}
|
|
39
41
|
return '-';
|
|
40
42
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
4
5
|
const base_command_1 = require("../../base-command");
|
|
5
6
|
const config_1 = require("../../lib/config");
|
|
6
7
|
const workspaces_1 = require("../../lib/workspaces");
|
|
@@ -87,7 +88,7 @@ class WorkspacesUse extends base_command_1.BaseCommand {
|
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
90
|
this.log(`Now working in ${selected.name ?? selected.id} (${selected.id}).`);
|
|
90
|
-
this.log(
|
|
91
|
+
this.log(`New agents and \`${auth_core_1.FIRST_PARTY_HARNESS.command}\` sessions resolve here. --workspace still wins per command.`);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
exports.default = WorkspacesUse;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface AdaptiveLearningConsent {
|
|
2
|
+
personalizationAllowed: boolean;
|
|
3
|
+
sharedTrainingAllowed: boolean;
|
|
4
|
+
policyVersion: string;
|
|
5
|
+
source: 'explicit' | 'default_off' | 'workspace_policy' | string;
|
|
6
|
+
stateGeneration: number;
|
|
7
|
+
decidedAt: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface LearnedPreference {
|
|
10
|
+
key: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
confidence: number;
|
|
13
|
+
source: 'explicit' | 'inferred' | 'aggregate' | string;
|
|
14
|
+
evidenceCategory: string;
|
|
15
|
+
evidenceCount: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AdaptiveLearningState {
|
|
18
|
+
id: string;
|
|
19
|
+
policyNamespace: string;
|
|
20
|
+
scopeKey: string;
|
|
21
|
+
stateVersion: number;
|
|
22
|
+
modelVersion: string;
|
|
23
|
+
featureViewVersion: string;
|
|
24
|
+
posteriorVersion: string;
|
|
25
|
+
sampleCount: number;
|
|
26
|
+
preferences?: LearnedPreference[];
|
|
27
|
+
}
|
|
28
|
+
export interface AdaptiveLearningStateResponse {
|
|
29
|
+
items: AdaptiveLearningState[];
|
|
30
|
+
count: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function consentPatch(input: {
|
|
33
|
+
personalization?: 'on' | 'off';
|
|
34
|
+
sharedTraining?: 'on' | 'off';
|
|
35
|
+
}): Record<string, boolean>;
|
|
36
|
+
export declare function servingSummary(consent: AdaptiveLearningConsent, state: AdaptiveLearningStateResponse): string;
|
|
37
|
+
export declare function formatLearningStatus(consent: AdaptiveLearningConsent, state: AdaptiveLearningStateResponse): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.consentPatch = consentPatch;
|
|
4
|
+
exports.servingSummary = servingSummary;
|
|
5
|
+
exports.formatLearningStatus = formatLearningStatus;
|
|
6
|
+
function consentPatch(input) {
|
|
7
|
+
const patch = {};
|
|
8
|
+
if (input.personalization !== undefined) {
|
|
9
|
+
patch.personalizationAllowed = input.personalization === 'on';
|
|
10
|
+
}
|
|
11
|
+
if (input.sharedTraining !== undefined) {
|
|
12
|
+
patch.sharedTrainingAllowed = input.sharedTraining === 'on';
|
|
13
|
+
}
|
|
14
|
+
return patch;
|
|
15
|
+
}
|
|
16
|
+
function servingSummary(consent, state) {
|
|
17
|
+
if (!consent.personalizationAllowed)
|
|
18
|
+
return 'deterministic baseline (personalization off)';
|
|
19
|
+
if (!state.items.length)
|
|
20
|
+
return 'deterministic baseline (cold start)';
|
|
21
|
+
return 'One Voice authoritative; learned policy is shadow-only';
|
|
22
|
+
}
|
|
23
|
+
function formatLearningStatus(consent, state) {
|
|
24
|
+
const lines = [
|
|
25
|
+
`Personalization: ${consent.personalizationAllowed ? 'on' : 'off'}`,
|
|
26
|
+
`Shared model training: ${consent.sharedTrainingAllowed ? 'on' : 'off'}`,
|
|
27
|
+
`Serving: ${servingSummary(consent, state)}`,
|
|
28
|
+
`Consent: ${consent.source} · ${consent.policyVersion} · generation ${consent.stateGeneration}`,
|
|
29
|
+
`Learned states: ${state.count}`,
|
|
30
|
+
];
|
|
31
|
+
for (const row of state.items) {
|
|
32
|
+
const recommendation = row.preferences?.find((item) => item.key === 'recommended_action');
|
|
33
|
+
lines.push(`- ${row.policyNamespace} / ${row.scopeKey}: v${row.stateVersion}, samples=${row.sampleCount}` +
|
|
34
|
+
(recommendation
|
|
35
|
+
? `, recommended=${String(recommendation.value)} (${recommendation.source})`
|
|
36
|
+
: ''));
|
|
37
|
+
}
|
|
38
|
+
return lines.join('\n');
|
|
39
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Exported and pure so the parts that decide whether a handover is SAFE are
|
|
5
5
|
* unit-testable without an oclif runtime, a git checkout, or a live API — the
|
|
6
|
-
* convention `buildEngineArgs` follows in `lib/
|
|
6
|
+
* convention `buildEngineArgs` follows in `lib/first-party-harness.ts`. The command itself
|
|
7
7
|
* only collects facts and prints.
|
|
8
8
|
*/
|
|
9
9
|
/** `owner/name` from any GitHub remote URL shape. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Exported and pure so the parts that decide whether a handover is SAFE are
|
|
6
6
|
* unit-testable without an oclif runtime, a git checkout, or a live API — the
|
|
7
|
-
* convention `buildEngineArgs` follows in `lib/
|
|
7
|
+
* convention `buildEngineArgs` follows in `lib/first-party-harness.ts`. The command itself
|
|
8
8
|
* only collects facts and prints.
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -13,6 +13,7 @@ exports.evaluateHandoverSafety = evaluateHandoverSafety;
|
|
|
13
13
|
exports.formatUnsafeHandover = formatUnsafeHandover;
|
|
14
14
|
exports.composeHandoverPrompt = composeHandoverPrompt;
|
|
15
15
|
exports.matchAgent = matchAgent;
|
|
16
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
16
17
|
/** `owner/name` from any GitHub remote URL shape. */
|
|
17
18
|
function parseGitHubRepo(remoteUrl) {
|
|
18
19
|
if (!remoteUrl || !remoteUrl.trim()) {
|
|
@@ -69,7 +70,7 @@ function composeHandoverPrompt(input) {
|
|
|
69
70
|
input.brief.trim(),
|
|
70
71
|
'',
|
|
71
72
|
'---',
|
|
72
|
-
`Handed over from a local
|
|
73
|
+
`Handed over from a local ${auth_core_1.FIRST_PARTY_HARNESS.displayName} session in ${input.repoFullName} on ${input.branch}${at}.`,
|
|
73
74
|
input.recentCommits ? `Recent commits:\n${input.recentCommits}` : null,
|
|
74
75
|
input.localWorkNotCarried
|
|
75
76
|
? 'NOTE: local uncommitted or unpushed work was NOT carried over — you are working from the pushed state of this branch.'
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -33,16 +33,22 @@ export interface CliConfig {
|
|
|
33
33
|
* OSK-3892 — the agent a locally-hosted `skrr code` session is attributed to.
|
|
34
34
|
*
|
|
35
35
|
* `skrr code` is the local arm of an AGENT's harness: the cloud dispatches to
|
|
36
|
-
*
|
|
37
|
-
* managed session needs an agent, and this is where a user records
|
|
38
|
-
* normally work as instead of typing `--
|
|
36
|
+
* the first-party harness as an agent, and a human running it here runs the same
|
|
37
|
+
* harness. So a managed session needs an agent, and this is where a user records
|
|
38
|
+
* the one they normally work as instead of typing `--skrr-agent` every time.
|
|
39
39
|
*
|
|
40
40
|
* Deliberately NOT a fallback for anything else. It is read only by the managed
|
|
41
41
|
* acquisition in `skrr code`; every other command keeps its own agent resolution
|
|
42
42
|
* (`agent-resolver.ts`), whose precedence is different and whose callers are
|
|
43
43
|
* often inside a daemon session that already binds one.
|
|
44
|
+
*
|
|
45
|
+
* The key is brand-neutral. Earlier CLIs wrote the same setting under a key
|
|
46
|
+
* named after the product; those are still read, through
|
|
47
|
+
* `readAgentSetting` in `first-party-harness-managed.ts`, which is the only
|
|
48
|
+
* reader — never read this field directly, or an older machine's setting is
|
|
49
|
+
* silently ignored.
|
|
44
50
|
*/
|
|
45
|
-
|
|
51
|
+
firstPartyHarnessAgentId?: string;
|
|
46
52
|
/**
|
|
47
53
|
* The workspace this machine works in, chosen once with `skrr workspaces use`.
|
|
48
54
|
*
|
|
@@ -167,6 +173,26 @@ export declare function isEnvAuthOverride(): boolean;
|
|
|
167
173
|
* resolver and every existing install read it.
|
|
168
174
|
*/
|
|
169
175
|
export declare function configRoot(env?: NodeJS.ProcessEnv): string;
|
|
176
|
+
/**
|
|
177
|
+
* The PRE-RENAME config root — the generation between `.sky` and `.skrr`.
|
|
178
|
+
*
|
|
179
|
+
* This was missing from the fallback chain, which went straight from `.skrr` to
|
|
180
|
+
* `.sky` and skipped the directory that every current install actually has.
|
|
181
|
+
* The effect is not a missing preference: with no config found, `loadConfig`
|
|
182
|
+
* returns DEFAULT_CONFIG, whose baseURL is the DEV deployment — so a CLI that
|
|
183
|
+
* had been pointed at production silently starts addressing dev, and its
|
|
184
|
+
* `workspaceId` is gone. Nothing errors; commands just answer about a different
|
|
185
|
+
* backend.
|
|
186
|
+
*
|
|
187
|
+
* This read "the production apex", and said the drift ran the other way. It did
|
|
188
|
+
* not: DEFAULT_CONFIG has been dev since it was written, forty lines further up.
|
|
189
|
+
* The direction matters here more than most stale comments, because it is the
|
|
190
|
+
* difference between a lost session and one that silently addresses production.
|
|
191
|
+
*
|
|
192
|
+
* Note the filename differs by generation: `.sky` used `config.json`, `.oversky`
|
|
193
|
+
* and `.skrr` use `cli-config.json`.
|
|
194
|
+
*/
|
|
195
|
+
export declare function priorConfigDir(): string;
|
|
170
196
|
/**
|
|
171
197
|
* Read the config file. Returns defaults if missing. Throws on corrupt JSON.
|
|
172
198
|
* Performs a one-shot legacy → new copy when only the legacy file exists, so
|
package/dist/lib/config.js
CHANGED
|
@@ -39,6 +39,7 @@ exports.describeDeployment = describeDeployment;
|
|
|
39
39
|
exports.canonicalizeKnownBaseURL = canonicalizeKnownBaseURL;
|
|
40
40
|
exports.isEnvAuthOverride = isEnvAuthOverride;
|
|
41
41
|
exports.configRoot = configRoot;
|
|
42
|
+
exports.priorConfigDir = priorConfigDir;
|
|
42
43
|
exports.loadConfig = loadConfig;
|
|
43
44
|
exports.saveConfig = saveConfig;
|
|
44
45
|
exports.getConfigPath = getConfigPath;
|
|
@@ -280,7 +281,7 @@ function newConfigDir() {
|
|
|
280
281
|
*
|
|
281
282
|
* Everything else follows the profile, because everything else IS the
|
|
282
283
|
* deployment: `baseURL`, who you are there (`userId`, `email`), and what you
|
|
283
|
-
* chose there (`workspaceId`, `
|
|
284
|
+
* chose there (`workspaceId`, `firstPartyHarnessAgentId`).
|
|
284
285
|
*/
|
|
285
286
|
const MACHINE_SCOPED_KEYS = ['cliId', 'credentials', 'migrated'];
|
|
286
287
|
/**
|
|
@@ -22,7 +22,7 @@ export interface DaemonInstallOptions {
|
|
|
22
22
|
fetchImpl?: typeof fetch;
|
|
23
23
|
/**
|
|
24
24
|
* Trust anchors. Defaults to the pinned production set; tests substitute a
|
|
25
|
-
* generated keypair, exactly as the
|
|
25
|
+
* generated keypair, exactly as the first-party harness installer does. Passing an EMPTY
|
|
26
26
|
* set does not disable verification here — every non-`ok` verdict is a
|
|
27
27
|
* refusal, so an unconfigured trust root turns installs off rather than
|
|
28
28
|
* turning checking off.
|
|
@@ -49,11 +49,11 @@ exports.listActiveDaemons = listActiveDaemons;
|
|
|
49
49
|
const api_fetch_1 = require("./api-fetch");
|
|
50
50
|
const daemonBroker_1 = require("./daemonBroker");
|
|
51
51
|
const daemon_ref_1 = require("./daemon-ref");
|
|
52
|
-
const
|
|
52
|
+
const first_party_harness_1 = require("./first-party-harness");
|
|
53
53
|
function localMachine(options = {}) {
|
|
54
54
|
const env = options.env ?? process.env;
|
|
55
55
|
const getuid = 'getuid' in options ? options.getuid : process.getuid?.bind(process);
|
|
56
|
-
if (!(0,
|
|
56
|
+
if (!(0, first_party_harness_1.isDedicatedRuntimeWorkload)(env, getuid))
|
|
57
57
|
return { dedicatedRuntime: false, daemonId: null };
|
|
58
58
|
return { dedicatedRuntime: true, daemonId: publishedDaemonId(options) };
|
|
59
59
|
}
|
|
@@ -131,8 +131,9 @@ class DedicatedLeaseCommand extends base_command_1.BaseCommand {
|
|
|
131
131
|
this.failWithCliError({
|
|
132
132
|
message,
|
|
133
133
|
code: (0, dedicated_machines_1.dedicatedRuntimeApiErrorCode)(err) ?? 'CLI_ERROR',
|
|
134
|
+
status: err instanceof api_fetch_1.ApiFetchError ? err.status : undefined,
|
|
134
135
|
exit: 1,
|
|
135
|
-
retryable:
|
|
136
|
+
retryable: dedicatedRuntimeApiErrorRetryable(err),
|
|
136
137
|
details: (0, dedicated_machines_1.dedicatedRuntimeApiErrorDetails)(err),
|
|
137
138
|
});
|
|
138
139
|
}
|
|
@@ -418,8 +418,8 @@ export declare function dedicatedDeletionLines(lease: DedicatedLease, now?: Date
|
|
|
418
418
|
* A lease payload names no daemon (provider and daemon ids are deliberately
|
|
419
419
|
* absent), so the join goes the other way: each row a guest daemon registers
|
|
420
420
|
* carries `metadata.machineLeaseId` and `metadata.machineProduct`. One daemon
|
|
421
|
-
* writes one row PER ENGINE it announces (claude, codex,
|
|
422
|
-
* when it announces none), all sharing the daemon id.
|
|
421
|
+
* writes one row PER ENGINE it announces (claude, codex, the first-party harness,
|
|
422
|
+
* or `oversky` when it announces none), all sharing the daemon id.
|
|
423
423
|
*/
|
|
424
424
|
export declare function dedicatedLeaseHarnesses(lease: Pick<DedicatedLease, 'id'>, harnesses: readonly Harness[]): Harness[];
|
|
425
425
|
/**
|
|
@@ -36,6 +36,7 @@ exports.dedicatedCatalogFromProducts = dedicatedCatalogFromProducts;
|
|
|
36
36
|
exports.dedicatedRuntimeApiErrorCode = dedicatedRuntimeApiErrorCode;
|
|
37
37
|
exports.dedicatedRuntimeApiErrorDetails = dedicatedRuntimeApiErrorDetails;
|
|
38
38
|
exports.formatDedicatedRuntimeApiError = formatDedicatedRuntimeApiError;
|
|
39
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
39
40
|
const api_fetch_1 = require("./api-fetch");
|
|
40
41
|
const edge_error_page_1 = require("./edge-error-page");
|
|
41
42
|
const harnesses_1 = require("./harnesses");
|
|
@@ -622,8 +623,8 @@ function dedicatedDeletionLines(lease, now = new Date()) {
|
|
|
622
623
|
* A lease payload names no daemon (provider and daemon ids are deliberately
|
|
623
624
|
* absent), so the join goes the other way: each row a guest daemon registers
|
|
624
625
|
* carries `metadata.machineLeaseId` and `metadata.machineProduct`. One daemon
|
|
625
|
-
* writes one row PER ENGINE it announces (claude, codex,
|
|
626
|
-
* when it announces none), all sharing the daemon id.
|
|
626
|
+
* writes one row PER ENGINE it announces (claude, codex, the first-party harness,
|
|
627
|
+
* or `oversky` when it announces none), all sharing the daemon id.
|
|
627
628
|
*/
|
|
628
629
|
function dedicatedLeaseHarnesses(lease, harnesses) {
|
|
629
630
|
const seenAt = (harness) => Date.parse(harness.lastSeenAt || '') || 0;
|
|
@@ -689,7 +690,9 @@ function selectDedicatedAttachHarness(lease, harnesses, engine) {
|
|
|
689
690
|
}
|
|
690
691
|
const providers = [...new Set(rows.map((row) => row.provider))];
|
|
691
692
|
if (engine) {
|
|
692
|
-
|
|
693
|
+
// Any accepted spelling of an engine names it: a user who typed the first-party
|
|
694
|
+
// harness's older name means the row stored under its canonical one.
|
|
695
|
+
const match = rows.find((row) => (0, auth_core_1.isSameHarnessProvider)(row.provider, engine));
|
|
693
696
|
if (!match) {
|
|
694
697
|
return {
|
|
695
698
|
error: `${lease.id} has no "${engine}" engine. Registered: ${providers.join(', ')}.`,
|
|
@@ -57,8 +57,8 @@ export declare function normalizeRuntimeGlobalArgs(args: readonly string[]): str
|
|
|
57
57
|
*
|
|
58
58
|
* An install instruction is only worth what it installs. Renaming these
|
|
59
59
|
* before the tap and repository move produces a message that reads correct
|
|
60
|
-
* and fails when followed — the same defect as the
|
|
61
|
-
* `
|
|
60
|
+
* and fails when followed — the same defect as the old hint that told users to
|
|
61
|
+
* run `code install` under the previous CLI name, a command that never existed.
|
|
62
62
|
*
|
|
63
63
|
* They move when the Homebrew tap is published (that work is tracked
|
|
64
64
|
* separately) and when the repository is renamed — not before, and not as
|
|
@@ -187,8 +187,8 @@ function isExecutable(p) {
|
|
|
187
187
|
*
|
|
188
188
|
* An install instruction is only worth what it installs. Renaming these
|
|
189
189
|
* before the tap and repository move produces a message that reads correct
|
|
190
|
-
* and fails when followed — the same defect as the
|
|
191
|
-
* `
|
|
190
|
+
* and fails when followed — the same defect as the old hint that told users to
|
|
191
|
+
* run `code install` under the previous CLI name, a command that never existed.
|
|
192
192
|
*
|
|
193
193
|
* They move when the Homebrew tap is published (that work is tracked
|
|
194
194
|
* separately) and when the repository is renamed — not before, and not as
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OSK-3892 — which AGENT a locally-hosted
|
|
2
|
+
* OSK-3892 — which AGENT a locally-hosted first-party harness session belongs to.
|
|
3
3
|
*
|
|
4
4
|
* ── Why a session needs an agent at all ────────────────────────────────────
|
|
5
5
|
*
|
|
6
6
|
* `skrr code` is the local arm of an agent's harness. The cloud dispatches to
|
|
7
|
-
*
|
|
7
|
+
* the first-party harness AS an agent, and a human running it here runs the same harness against
|
|
8
8
|
* the same server contract — so the session is attributed to an agent the user
|
|
9
9
|
* names.
|
|
10
10
|
*
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
* ── Resolution order, and why it ends in a refusal ─────────────────────────
|
|
17
17
|
*
|
|
18
|
-
* 1. `--
|
|
19
|
-
* 2. `
|
|
18
|
+
* 1. `--skrr-agent <id-or-name>` (or its older spelling, `--oversky-agent`)
|
|
19
|
+
* 2. `AGENT_CONFIG_KEY` in `~/.skrr/cli-config.json` (or the key earlier CLIs wrote)
|
|
20
20
|
* 3. the user's single agent, when they have exactly one AND AUTHORED IT
|
|
21
21
|
* 4. the user's own DEFAULT agent for this harness, created on first use
|
|
22
22
|
*
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
* `--oversky-agent` fail inside any daemon-spawned CLI child. Its error TYPE and
|
|
49
49
|
* its habit of listing what it found are worth copying; its precedence is not.
|
|
50
50
|
*/
|
|
51
|
-
export type
|
|
52
|
-
export interface
|
|
51
|
+
export type FirstPartyHarnessAgentSource = 'flag' | 'config' | 'sole-agent' | 'default-agent';
|
|
52
|
+
export interface FirstPartyHarnessAgent {
|
|
53
53
|
id: string;
|
|
54
54
|
name?: string;
|
|
55
|
-
source:
|
|
55
|
+
source: FirstPartyHarnessAgentSource;
|
|
56
56
|
/**
|
|
57
57
|
* True only on the run that actually minted the default agent, so the CLI can
|
|
58
58
|
* say so once instead of on every session. The server reports it as 201 vs
|
|
@@ -60,10 +60,10 @@ export interface SkyCodeAgent {
|
|
|
60
60
|
*/
|
|
61
61
|
createdNow?: boolean;
|
|
62
62
|
}
|
|
63
|
-
export type
|
|
64
|
-
export declare class
|
|
65
|
-
readonly code:
|
|
66
|
-
constructor(code:
|
|
63
|
+
export type FirstPartyHarnessAgentFailure = 'agent-unknown' | 'agent-ambiguous' | 'agent-unset' | 'agent-lookup-failed';
|
|
64
|
+
export declare class FirstPartyHarnessAgentError extends Error {
|
|
65
|
+
readonly code: FirstPartyHarnessAgentFailure;
|
|
66
|
+
constructor(code: FirstPartyHarnessAgentFailure, message: string);
|
|
67
67
|
}
|
|
68
68
|
interface AgentRow {
|
|
69
69
|
id?: string;
|
|
@@ -77,11 +77,12 @@ interface AgentRow {
|
|
|
77
77
|
* Set when this row IS the caller's auto-created default for a harness. Also
|
|
78
78
|
* already on the wire, for the same reason — which is what lets a read-only
|
|
79
79
|
* caller recognise an existing default without asking the get-or-create
|
|
80
|
-
* endpoint to establish one.
|
|
80
|
+
* endpoint to establish one. A stored row may carry any accepted spelling of
|
|
81
|
+
* the harness, so it is compared with `isFirstPartyHarnessProvider`, never `===`.
|
|
81
82
|
*/
|
|
82
83
|
defaultForHarness?: string;
|
|
83
84
|
}
|
|
84
|
-
export interface
|
|
85
|
+
export interface FirstPartyHarnessAgentDeps {
|
|
85
86
|
/** Agents this user may run. Bounded; see `ROSTER_LIMIT`. */
|
|
86
87
|
listAgents?: (signal?: AbortSignal) => Promise<AgentRow[]>;
|
|
87
88
|
/** Direct read, for an id outside the bounded roster. `null` when unreadable. */
|
|
@@ -99,7 +100,7 @@ interface DefaultAgentRow extends AgentRow {
|
|
|
99
100
|
/** Whether THIS call created it (server 201) rather than found it (200). */
|
|
100
101
|
created?: boolean;
|
|
101
102
|
}
|
|
102
|
-
export interface
|
|
103
|
+
export interface FirstPartyHarnessAgentOptions {
|
|
103
104
|
/**
|
|
104
105
|
* OSK-3892 — the CALLER's deadline for the whole managed acquisition.
|
|
105
106
|
*
|
|
@@ -120,8 +121,8 @@ export interface SkyCodeAgentOptions {
|
|
|
120
121
|
/**
|
|
121
122
|
* How a refusal NAMES an explicitly-supplied reference.
|
|
122
123
|
*
|
|
123
|
-
* Defaults to `--
|
|
124
|
-
*
|
|
124
|
+
* Defaults to `--skrr-agent`, which is how a session receives one. `skrr code
|
|
125
|
+
* skrr-agent --set` passes its own spelling so a bad value does not send the
|
|
125
126
|
* user to fix a flag they never typed.
|
|
126
127
|
*/
|
|
127
128
|
explicitLabel?: string;
|
|
@@ -143,18 +144,18 @@ export interface SkyCodeAgentOptions {
|
|
|
143
144
|
* a refusal listable. That is worth just as much care — a wrong pick is not a
|
|
144
145
|
* breach, it is a bill someone else reads weeks later — but it is a different job.
|
|
145
146
|
*/
|
|
146
|
-
export declare function
|
|
147
|
+
export declare function resolveFirstPartyHarnessAgent(explicit?: string, deps?: FirstPartyHarnessAgentDeps, options?: FirstPartyHarnessAgentOptions): Promise<FirstPartyHarnessAgent>;
|
|
147
148
|
/** The stored value, unresolved — for a `--show` that must report "unset" honestly. */
|
|
148
149
|
export declare function readConfiguredAgentId(): string | undefined;
|
|
149
150
|
/**
|
|
150
151
|
* Persist the agent `skrr code` runs as when no flag is passed.
|
|
151
152
|
*
|
|
152
|
-
* Resolves through the SAME roster `
|
|
153
|
+
* Resolves through the SAME roster `resolveFirstPartyHarnessAgent` uses, for two reasons: a
|
|
153
154
|
* typo is refused while the user is still looking at it rather than at the start
|
|
154
155
|
* of some later session, and what lands on disk is always a canonical id. Storing
|
|
155
156
|
* the display name a user typed would silently break on the next rename.
|
|
156
157
|
*/
|
|
157
|
-
export declare function setConfiguredAgentId(ref: string, deps?:
|
|
158
|
+
export declare function setConfiguredAgentId(ref: string, deps?: FirstPartyHarnessAgentDeps, options?: FirstPartyHarnessAgentOptions): Promise<FirstPartyHarnessAgent>;
|
|
158
159
|
/** Remove the setting. Returns what was there, so the caller can say so. */
|
|
159
160
|
export declare function clearConfiguredAgentId(): string | undefined;
|
|
160
161
|
export {};
|