@skrr-ai/cli 0.1.171 → 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 (43) hide show
  1. package/dist/commands/harnesses/models.d.ts +12 -0
  2. package/dist/commands/harnesses/models.js +14 -2
  3. package/dist/commands/harnesses/rollouts/grant.d.ts +21 -0
  4. package/dist/commands/harnesses/rollouts/grant.js +56 -0
  5. package/dist/commands/harnesses/rollouts/list.d.ts +24 -0
  6. package/dist/commands/harnesses/rollouts/list.js +87 -0
  7. package/dist/commands/harnesses/rollouts/revoke.d.ts +22 -0
  8. package/dist/commands/harnesses/rollouts/revoke.js +56 -0
  9. package/dist/commands/machines/hosted/exec.d.ts +19 -0
  10. package/dist/commands/machines/hosted/exec.js +59 -5
  11. package/dist/commands/machines/hosted/list.js +8 -1
  12. package/dist/commands/machines/hosted/start.js +10 -1
  13. package/dist/lib/first-party-harness-broker.js +6 -0
  14. package/dist/lib/harness-tiers.d.ts +6 -4
  15. package/dist/lib/harness-tiers.js +12 -10
  16. package/dist/lib/hosted-machines.d.ts +13 -0
  17. package/dist/lib/hosted-machines.js +34 -1
  18. package/dist/lib/provider-rollouts.d.ts +58 -0
  19. package/dist/lib/provider-rollouts.js +23 -0
  20. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.cjs +8 -0
  21. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.d.cts +23 -0
  22. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.json +2381 -0
  23. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.d.ts +11 -2
  24. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +1 -5
  25. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.d.ts +165 -0
  26. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.js +132 -0
  27. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.d.ts +11 -2
  28. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +1 -5
  29. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.d.ts +165 -0
  30. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.js +203 -0
  31. package/dist/node_modules/@skrr-ai/auth-core/package.json +14 -0
  32. package/dist/node_modules/@skrr-ai/data-provider/index.js +11598 -11591
  33. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.d.ts +1 -1
  34. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.js +4 -0
  35. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.d.ts +58 -1
  36. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +171 -61
  37. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.d.ts +1 -1
  38. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.js +1 -1
  39. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.d.ts +58 -1
  40. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +217 -88
  41. package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
  42. package/oclif.manifest.json +297 -4
  43. package/package.json +5 -2
@@ -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;