@skrr-ai/cli 0.1.170 → 0.1.172

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 (46) hide show
  1. package/dist/commands/agents/always-on/recovery-close.d.ts +4 -0
  2. package/dist/commands/agents/always-on/recovery-close.js +5 -1
  3. package/dist/commands/agents/always-on/recovery-review.js +29 -2
  4. package/dist/commands/harnesses/models.d.ts +12 -0
  5. package/dist/commands/harnesses/models.js +14 -2
  6. package/dist/commands/harnesses/rollouts/grant.d.ts +21 -0
  7. package/dist/commands/harnesses/rollouts/grant.js +56 -0
  8. package/dist/commands/harnesses/rollouts/list.d.ts +24 -0
  9. package/dist/commands/harnesses/rollouts/list.js +87 -0
  10. package/dist/commands/harnesses/rollouts/revoke.d.ts +22 -0
  11. package/dist/commands/harnesses/rollouts/revoke.js +56 -0
  12. package/dist/commands/machines/hosted/exec.d.ts +19 -0
  13. package/dist/commands/machines/hosted/exec.js +59 -5
  14. package/dist/commands/machines/hosted/list.js +8 -1
  15. package/dist/commands/machines/hosted/start.js +10 -1
  16. package/dist/lib/first-party-harness-broker.js +6 -0
  17. package/dist/lib/harness-tiers.d.ts +6 -4
  18. package/dist/lib/harness-tiers.js +12 -10
  19. package/dist/lib/hosted-machines.d.ts +13 -0
  20. package/dist/lib/hosted-machines.js +34 -1
  21. package/dist/lib/provider-rollouts.d.ts +58 -0
  22. package/dist/lib/provider-rollouts.js +23 -0
  23. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.cjs +8 -0
  24. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.d.cts +23 -0
  25. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.json +2381 -0
  26. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.d.ts +11 -2
  27. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +1 -5
  28. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.d.ts +165 -0
  29. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.js +132 -0
  30. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.d.ts +11 -2
  31. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +1 -5
  32. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.d.ts +165 -0
  33. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.js +203 -0
  34. package/dist/node_modules/@skrr-ai/auth-core/package.json +14 -0
  35. package/dist/node_modules/@skrr-ai/data-provider/index.js +11600 -11591
  36. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.d.ts +1 -1
  37. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.js +4 -0
  38. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.d.ts +58 -1
  39. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +171 -61
  40. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.d.ts +1 -1
  41. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.js +1 -1
  42. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.d.ts +58 -1
  43. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +217 -88
  44. package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
  45. package/oclif.manifest.json +298 -5
  46. package/package.json +5 -2
@@ -60,8 +60,9 @@ export interface TierDescription {
60
60
  remedy?: string;
61
61
  /**
62
62
  * Whether this posture is worth flagging. Tier 1 is flagged NOT because it is
63
- * wrong but because it grants the most and currently grants it to an unsigned
64
- * build — exactly the kind of fact a diagnostic exists to surface.
63
+ * wrong but because it grants the most (a configured `auto` mode stands) and
64
+ * currently grants it to an unsigned build — exactly the kind of fact a
65
+ * diagnostic exists to surface.
65
66
  */
66
67
  notable: boolean;
67
68
  }
@@ -74,8 +75,9 @@ export interface TierDescription {
74
75
  *
75
76
  * - PERMISSION (`tierPermitsConfiguredAutoMode`) — may an operator-configured
76
77
  * `auto` mode stand, or is it downgraded to per-call human adjudication?
77
- * - CREDENTIAL (`credentialPolicyForTier`) — may the platform master key be
78
- * delivered directly, or only a scoped gateway token, or nothing?
78
+ * - CREDENTIAL (`credentialPolicyForTier`) — a scoped gateway token, or
79
+ * nothing? No tier receives a raw platform key (OSK-24415), so Tier 1 and
80
+ * Tier 2 give the same credential answer.
79
81
  *
80
82
  * A tier NEVER approves an individual tool call. That sentence is repeated in the
81
83
  * output because "my harness is Tier 1" is regularly misread as "my tool calls are
@@ -70,8 +70,9 @@ function mirroredTier(harness) {
70
70
  *
71
71
  * - PERMISSION (`tierPermitsConfiguredAutoMode`) — may an operator-configured
72
72
  * `auto` mode stand, or is it downgraded to per-call human adjudication?
73
- * - CREDENTIAL (`credentialPolicyForTier`) — may the platform master key be
74
- * delivered directly, or only a scoped gateway token, or nothing?
73
+ * - CREDENTIAL (`credentialPolicyForTier`) — a scoped gateway token, or
74
+ * nothing? No tier receives a raw platform key (OSK-24415), so Tier 1 and
75
+ * Tier 2 give the same credential answer.
75
76
  *
76
77
  * A tier NEVER approves an individual tool call. That sentence is repeated in the
77
78
  * output because "my harness is Tier 1" is regularly misread as "my tool calls are
@@ -83,12 +84,13 @@ function describeTier(harness, tier) {
83
84
  return {
84
85
  notable: true,
85
86
  detail: `${harness} is Tier 1: an operator-configured \`auto\` permission mode STANDS ` +
86
- '(it is not downgraded to per-call adjudication), and direct platform-key ' +
87
- 'delivery is permitted. A tier still never approves an individual tool call.',
88
- remedy: `skrr does not yet sign ${auth_core_1.FIRST_PARTY_HARNESS.displayName} releases, so in practice an UNSIGNED build can ` +
89
- 'receive the platform master key. The provenance machinery still runs and still ' +
90
- 'verifies binaries — signing stops being what earns the key and becomes what lets ' +
91
- `you prove which bytes held it. Reverting to the strict posture is one line in ${exports.HARNESS_TIER_TABLE}.`,
87
+ '(it is not downgraded to per-call adjudication). For credentials it is the same ' +
88
+ 'as Tier 2: a scoped gateway token, never a raw platform key. A tier still never ' +
89
+ 'approves an individual tool call.',
90
+ remedy: `skrr does not yet sign ${auth_core_1.FIRST_PARTY_HARNESS.displayName} releases, so in practice an UNSIGNED build keeps ` +
91
+ 'a configured `auto` mode. The provenance machinery still runs and still verifies ' +
92
+ `binaries, which is what lets you prove which bytes ran. The tier is set in ${exports.HARNESS_TIER_TABLE}; ` +
93
+ `${exports.HARNESS_TIER_AUTHORITY} is what applies it.`,
92
94
  };
93
95
  }
94
96
  if (tier === 2) {
@@ -103,8 +105,8 @@ function describeTier(harness, tier) {
103
105
  // "All checks passed." branch DEAD CODE — a diagnostic that can never
104
106
  // report health has no way to tell a user that nothing is wrong.
105
107
  notable: false,
106
- detail: `${harness} is Tier 2: it receives a scoped gateway token, never the platform ` +
107
- 'master key, and an operator-configured `auto` mode is downgraded to per-call ' +
108
+ detail: `${harness} is Tier 2: it receives a scoped gateway token, never a raw platform ` +
109
+ 'key, and an operator-configured `auto` mode is downgraded to per-call ' +
108
110
  'adjudication by the daemon.',
109
111
  remedy: 'Expect a managed session to ask about every tool. An UNATTENDED run has no human to ' +
110
112
  'ask, so each call burns the approval timeout and returns cancelled — if that is what ' +
@@ -89,12 +89,18 @@ export interface HostedMachineListJson {
89
89
  }>;
90
90
  }
91
91
  export declare function curateHostedMachineList(response: HostedMachineListResponse): HostedMachineListJson;
92
+ /** The account a command ran as on the machine, and the HOME it was given (OSK-24531). */
93
+ export interface HostedMachineExecIdentity {
94
+ user: string;
95
+ home: string;
96
+ }
92
97
  export interface HostedMachineExecResponse {
93
98
  success: boolean;
94
99
  stdout?: string;
95
100
  stderr?: string;
96
101
  exitCode?: number;
97
102
  executionTime?: number;
103
+ executedAs?: HostedMachineExecIdentity;
98
104
  previewUrl?: string | null;
99
105
  session?: HostedMachineSession;
100
106
  operation?: HostedMachineOperation;
@@ -115,6 +121,7 @@ export interface HostedMachineExecJson {
115
121
  stdout: string;
116
122
  stderr: string;
117
123
  executionTime?: number;
124
+ executedAs?: HostedMachineExecIdentity;
118
125
  previewUrl?: string;
119
126
  session?: {
120
127
  id: string;
@@ -150,6 +157,12 @@ export interface HostedMachineExecInput {
150
157
  language?: 'shell' | 'python' | 'node';
151
158
  cwd?: string;
152
159
  timeoutMs?: number;
160
+ /**
161
+ * Omitted: the machine's workload account, the one its daemon runs harnesses
162
+ * as, with that account's own HOME. `'root'`: root, shell only, with a HOME
163
+ * root alone owns (never the daemon's), reported back as `executedAs.home`.
164
+ */
165
+ runAs?: 'root';
153
166
  }
154
167
  export declare function hostedMachineId(session: HostedMachineSession | undefined | null): string;
155
168
  export declare function hostedMachineStatus(session: HostedMachineSession | undefined | null): string;
@@ -71,6 +71,9 @@ function curateHostedMachineExecResult(response) {
71
71
  };
72
72
  if (typeof response.executionTime === 'number')
73
73
  out.executionTime = response.executionTime;
74
+ if (response.executedAs?.user) {
75
+ out.executedAs = { user: response.executedAs.user, home: response.executedAs.home };
76
+ }
74
77
  if (response.previewUrl)
75
78
  out.previewUrl = response.previewUrl;
76
79
  if (response.session) {
@@ -201,7 +204,37 @@ function formatHostedMachineApiError(err, context = {}) {
201
204
  .filter(Boolean)
202
205
  .join(' ');
203
206
  }
204
- return message;
207
+ const registration = describeRegistrationTimeoutDetails(err.body);
208
+ return message && registration ? `${message} ${registration}` : message;
209
+ }
210
+ /**
211
+ * The predicate a Hosted daemon registration timeout names (OSK-24523). The
212
+ * server's vocabulary is closed (`daemonRegistrationDiagnosis.js`); an unknown
213
+ * member prints as itself rather than vanishing.
214
+ */
215
+ const REGISTRATION_PREDICATE_SENTENCES = {
216
+ daemon_process_running: 'The daemon process is not running in the machine.',
217
+ registry_row_present: 'The server never recorded the daemon registration.',
218
+ registry_row_has_socket: 'The daemon registration has no live connection.',
219
+ registry_row_source_hosted_machine: "The registration was not made by this machine's daemon.",
220
+ heartbeat_since_resume: 'The daemon has not sent a heartbeat since the resume.',
221
+ };
222
+ function describeRegistrationTimeoutDetails(body) {
223
+ let details;
224
+ try {
225
+ details = JSON.parse(body).details;
226
+ }
227
+ catch {
228
+ return '';
229
+ }
230
+ const predicate = typeof details?.unmetPredicate === 'string' ? details.unmetPredicate : '';
231
+ if (!predicate)
232
+ return '';
233
+ const sentence = REGISTRATION_PREDICATE_SENTENCES[predicate] || `Unmet registration predicate: ${predicate}.`;
234
+ const status = Number(details?.refusalStatus);
235
+ return Number.isInteger(status) && status > 0
236
+ ? `${sentence} The daemon's last refusal was HTTP ${status}.`
237
+ : sentence;
205
238
  }
206
239
  async function startHostedMachine(input) {
207
240
  return (0, api_fetch_1.apiFetch)('/api/agentic/sandbox-sessions', {
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Managed inference provider rollouts (OSK-24530): `/api/admin/provider-rollouts`.
3
+ *
4
+ * A provider in the server's rollout registry (today `copilot-sdk`) is closed to
5
+ * every account on managed inference until it is released to that account,
6
+ * whatever the payer's policy permits. These calls release it to one person,
7
+ * list who holds it, and withdraw it, with no deploy: admission reads the grants
8
+ * on every turn.
9
+ *
10
+ * Platform admins only, signed in as a person (`skrr login`). A personal access
11
+ * token is refused for every `/api/admin` path, and a daemon credential for this
12
+ * one.
13
+ *
14
+ * Paths are written INLINE at each call so `cli/src/__tests__/helpers/api-surface.ts`
15
+ * can read them; queries ride in `withQuery` for the same reason.
16
+ */
17
+ export interface ProviderRolloutGrant {
18
+ grantId: string;
19
+ provider: string;
20
+ subjectType: string;
21
+ subjectId: string;
22
+ active: boolean;
23
+ grantedByUserId: string | null;
24
+ grantReason: string;
25
+ grantedAt: string | null;
26
+ revokedAt: string | null;
27
+ revokedByUserId: string | null;
28
+ revokeReason: string | null;
29
+ }
30
+ export interface ProviderRolloutProvider {
31
+ provider: string;
32
+ displayName: string;
33
+ subjectTypes: string[];
34
+ }
35
+ export interface ProviderRolloutList {
36
+ providers: ProviderRolloutProvider[];
37
+ grants: ProviderRolloutGrant[];
38
+ }
39
+ export declare function listProviderRollouts(opts?: {
40
+ provider?: string;
41
+ subjectId?: string;
42
+ includeRevoked?: boolean;
43
+ limit?: number;
44
+ }): Promise<ProviderRolloutList>;
45
+ /** Who a grant names. `user` is the only subject type the server accepts today; `me` is yourself. */
46
+ export interface ProviderRolloutSubject {
47
+ type: 'user';
48
+ id: string;
49
+ }
50
+ /** Release `provider` to one subject. Idempotent: an active grant comes back as is. */
51
+ export declare function grantProviderRollout(provider: string, subject: ProviderRolloutSubject, reason: string): Promise<{
52
+ created: boolean;
53
+ grant: ProviderRolloutGrant;
54
+ }>;
55
+ /** Withdraw `provider` from one subject. The grant row is kept as the record. */
56
+ export declare function revokeProviderRollout(provider: string, subject: ProviderRolloutSubject, reason: string): Promise<{
57
+ revoked: ProviderRolloutGrant[];
58
+ }>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listProviderRollouts = listProviderRollouts;
4
+ exports.grantProviderRollout = grantProviderRollout;
5
+ exports.revokeProviderRollout = revokeProviderRollout;
6
+ const api_fetch_1 = require("./api-fetch");
7
+ const triggers_1 = require("./triggers");
8
+ async function listProviderRollouts(opts = {}) {
9
+ return (0, api_fetch_1.apiFetch)((0, triggers_1.withQuery)('/api/admin/provider-rollouts', {
10
+ provider: opts.provider,
11
+ subjectId: opts.subjectId,
12
+ includeRevoked: opts.includeRevoked ? 'true' : undefined,
13
+ limit: opts.limit,
14
+ }));
15
+ }
16
+ /** Release `provider` to one subject. Idempotent: an active grant comes back as is. */
17
+ async function grantProviderRollout(provider, subject, reason) {
18
+ return (0, api_fetch_1.apiFetch)(`/api/admin/provider-rollouts/${encodeURIComponent(provider)}/subjects/${encodeURIComponent(subject.type)}/${encodeURIComponent(subject.id)}`, { method: 'PUT', body: { reason } });
19
+ }
20
+ /** Withdraw `provider` from one subject. The grant row is kept as the record. */
21
+ async function revokeProviderRollout(provider, subject, reason) {
22
+ return (0, api_fetch_1.apiFetch)(`/api/admin/provider-rollouts/${encodeURIComponent(provider)}/subjects/${encodeURIComponent(subject.type)}/${encodeURIComponent(subject.id)}/revoke`, { method: 'POST', body: { reason } });
23
+ }
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ // The model catalog every Codex the platform runs reads (`model_catalog_json`, OSK-24465).
4
+ // `codex-model-catalog.json` beside this file is GENERATED from packages/llm by
5
+ // scripts/llm-codex-model-catalog.js; this module only hands it out, so the cloud worker's
6
+ // Codex driver and the daemon's managed Codex launch read the same bytes. finalize-cjs copies
7
+ // both files into dist/cjs, the only part of this package the production image carries.
8
+ module.exports = require('./codex-model-catalog.json');
@@ -0,0 +1,23 @@
1
+ /** One entry of Codex's model catalog, in Codex's own field names. */
2
+ interface CodexModelCatalogEntry {
3
+ slug: string;
4
+ context_window?: number;
5
+ max_context_window?: number;
6
+ input_modalities?: string[];
7
+ [field: string]: unknown;
8
+ }
9
+
10
+ /** `codex-model-catalog.json`, generated by scripts/llm-codex-model-catalog.js. */
11
+ declare const catalog: {
12
+ $comment: string;
13
+ /** The Codex release whose own catalog `models` carries verbatim. */
14
+ codexVersion: string;
15
+ /** The vendored Codex files it was built from, by sha256. */
16
+ sources: { models: string; prompt: string };
17
+ /** Every model a session may pair with Codex, sorted. */
18
+ sessionModels: string[];
19
+ /** What Codex reads: `{ "models": [...] }`. */
20
+ models: CodexModelCatalogEntry[];
21
+ };
22
+
23
+ export = catalog;