@skrr-ai/cli 0.1.82 → 0.1.84

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 (50) hide show
  1. package/README.md +2 -2
  2. package/dist/base-command.js +2 -2
  3. package/dist/commands/agents/endpoint/connect.d.ts +24 -0
  4. package/dist/commands/agents/endpoint/connect.js +93 -0
  5. package/dist/commands/agents/endpoint/disable.d.ts +18 -0
  6. package/dist/commands/agents/endpoint/disable.js +44 -0
  7. package/dist/commands/agents/endpoint/enable.d.ts +18 -0
  8. package/dist/commands/agents/endpoint/enable.js +46 -0
  9. package/dist/commands/agents/endpoint/show.d.ts +16 -0
  10. package/dist/commands/agents/endpoint/show.js +45 -0
  11. package/dist/commands/harnesses/install-token.d.ts +4 -4
  12. package/dist/commands/harnesses/install-token.js +4 -4
  13. package/dist/commands/store/acquisitions/list.d.ts +18 -0
  14. package/dist/commands/store/acquisitions/list.js +58 -0
  15. package/dist/commands/store/governance/requests.js +6 -0
  16. package/dist/commands/store/maintainers/remove.d.ts +8 -1
  17. package/dist/commands/store/maintainers/remove.js +29 -4
  18. package/dist/commands/store/reports/confirm-ban.d.ts +19 -0
  19. package/dist/commands/store/reports/confirm-ban.js +57 -0
  20. package/dist/commands/store/reports/disposition.d.ts +21 -0
  21. package/dist/commands/store/reports/disposition.js +76 -0
  22. package/dist/commands/store/reports/list.d.ts +17 -0
  23. package/dist/commands/store/reports/list.js +79 -0
  24. package/dist/commands/store/reports/withdraw-ban.d.ts +18 -0
  25. package/dist/commands/store/reports/withdraw-ban.js +48 -0
  26. package/dist/commands/store/updates.js +9 -5
  27. package/dist/commands/workspaces/audit.d.ts +30 -0
  28. package/dist/commands/workspaces/audit.js +145 -0
  29. package/dist/lib/agent-endpoints.d.ts +62 -0
  30. package/dist/lib/agent-endpoints.js +64 -0
  31. package/dist/lib/auth-storage.d.ts +1 -1
  32. package/dist/lib/auth-storage.js +1 -1
  33. package/dist/lib/daemonBroker.d.ts +1 -1
  34. package/dist/lib/daemonBroker.js +7 -4
  35. package/dist/lib/first-party-harness-broker.d.ts +2 -0
  36. package/dist/lib/first-party-harness-broker.js +77 -3
  37. package/dist/lib/harness-context.js +1 -5
  38. package/dist/lib/store-acquisition.d.ts +2 -0
  39. package/dist/lib/store-acquisition.js +18 -1
  40. package/dist/lib/store-moderation.d.ts +95 -0
  41. package/dist/lib/store-moderation.js +51 -0
  42. package/dist/lib/workspaces.d.ts +73 -0
  43. package/dist/lib/workspaces.js +21 -0
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +1 -1
  45. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +1 -1
  46. package/dist/node_modules/@skrr-ai/data-provider/index.js +4324 -4294
  47. package/oclif.manifest.json +35537 -34781
  48. package/package.json +4 -3
  49. package/dist/commands/pair.d.ts +0 -67
  50. package/dist/commands/pair.js +0 -351
@@ -75,6 +75,13 @@ const auth_core_init_1 = require("./auth-core-init");
75
75
  const config_1 = require("./config");
76
76
  const cli_id_1 = require("./cli-id");
77
77
  const cred_envelope_1 = require("./cred-envelope");
78
+ const dedicated_guest_1 = require("./dedicated-guest");
79
+ const daemonBroker_1 = require("./daemonBroker");
80
+ const daemonBrokerRefusal_1 = require("./daemonBrokerRefusal");
81
+ const cli_identity_1 = require("./cli-identity");
82
+ const credential_resolver_1 = require("./credential-resolver");
83
+ const harness_context_1 = require("./harness-context");
84
+ const node_adapter_1 = require("./node-adapter");
78
85
  const first_party_harness_1 = require("./first-party-harness");
79
86
  const first_party_harness_agent_1 = require("./first-party-harness-agent");
80
87
  const first_party_harness_managed_1 = require("./first-party-harness-managed");
@@ -162,6 +169,47 @@ class ManagedAcquisitionError extends Error {
162
169
  }
163
170
  }
164
171
  exports.ManagedAcquisitionError = ManagedAcquisitionError;
172
+ async function borrowDedicatedGuestCredential() {
173
+ if (!(0, dedicated_guest_1.runningOnDedicatedRuntimeGuest)() ||
174
+ (0, harness_context_1.isHarnessCliContext)() ||
175
+ (0, credential_resolver_1.resolveTrustedAutonomousCredential)()) {
176
+ return null;
177
+ }
178
+ // `skrr code run` does not extend BaseCommand, so its local credential check
179
+ // used to stop before the guest's daemon hand-off could be redeemed. Borrow
180
+ // only the fixed root-owned guest descriptor. No refresh family or credential
181
+ // is persisted, and apiFetch can re-redeem this DPoP-bound token on a 401.
182
+ try {
183
+ const cfg = (0, config_1.loadConfig)();
184
+ const outcome = await (0, daemonBroker_1.attemptDaemonBrokerLogin)({
185
+ cliId: (0, cli_identity_1.planLoginCliId)(cfg).cliId,
186
+ baseURL: cfg.baseURL,
187
+ bootstrapPathOverride: daemonBroker_1.DEDICATED_RUNTIME_CLI_HANDOFF_DESCRIPTOR,
188
+ preferHandoffMode: 'access_token',
189
+ borrowOnly: true,
190
+ timeoutMs: 10_000,
191
+ });
192
+ if (!outcome.ok) {
193
+ const description = (0, daemonBrokerRefusal_1.describeBrokerFailure)(outcome);
194
+ throw new ManagedAcquisitionError(outcome.code ?? 'guest-handoff-unavailable', description
195
+ ? `${description.headline} ${description.remedy}`
196
+ : `the Dedicated Runtime could not provide its managed skrr session (${outcome.reason})`);
197
+ }
198
+ if (!outcome.brokered)
199
+ return false;
200
+ (0, node_adapter_1.setAdapterCredentialOverride)({
201
+ token: outcome.accessToken,
202
+ source: 'env-token',
203
+ kind: (0, auth_core_1.classifyTokenKind)(outcome.accessToken),
204
+ });
205
+ return true;
206
+ }
207
+ catch (error) {
208
+ if (error instanceof ManagedAcquisitionError)
209
+ throw error;
210
+ return false;
211
+ }
212
+ }
165
213
  /**
166
214
  * Acquire a managed session, or throw a typed `ManagedAcquisitionError`.
167
215
  *
@@ -183,11 +231,28 @@ async function acquireManagedSession(input = {}, deps = {}) {
183
231
  // Checked locally, BEFORE any network. A fresh machine that has never run
184
232
  // `skrr login` must fall back to BYOK without a round trip and without a 401 that
185
233
  // would drag `apiFetch`'s refresh machinery in behind it.
186
- let localCredentialAvailable;
187
- if (deps.hasCredential) {
234
+ let localCredentialAvailable = false;
235
+ // Match BaseCommand's narrowly scoped retirement path: a stale guest refresh
236
+ // family must not prevent the live machine descriptor from lending a token.
237
+ const brokerBeforeStored = !deps.hasCredential &&
238
+ !(0, config_1.isEnvAuthOverride)() &&
239
+ !(0, harness_context_1.isHarnessCliContext)() &&
240
+ !(0, credential_resolver_1.resolveTrustedAutonomousCredential)() &&
241
+ (0, daemonBroker_1.shouldBrokerBeforeStoredCredential)();
242
+ if (brokerBeforeStored) {
243
+ try {
244
+ const guestHandoff = await (deps.borrowGuestCredential ?? borrowDedicatedGuestCredential)();
245
+ if (guestHandoff === true)
246
+ localCredentialAvailable = true;
247
+ }
248
+ catch {
249
+ // A usable stored credential remains the fallback during a hand-off outage.
250
+ }
251
+ }
252
+ if (!localCredentialAvailable && deps.hasCredential) {
188
253
  localCredentialAvailable = deps.hasCredential();
189
254
  }
190
- else {
255
+ else if (!localCredentialAvailable) {
191
256
  (0, cred_envelope_1.consumeEncryptedCredentialReadWhileInactive)();
192
257
  localCredentialAvailable = hasLocalCredential();
193
258
  if (!localCredentialAvailable && (0, cred_envelope_1.consumeEncryptedCredentialReadWhileInactive)()) {
@@ -195,6 +260,15 @@ async function acquireManagedSession(input = {}, deps = {}) {
195
260
  localCredentialAvailable = hasLocalCredential();
196
261
  }
197
262
  }
263
+ if (!localCredentialAvailable) {
264
+ const guestHandoff = await (deps.borrowGuestCredential ?? borrowDedicatedGuestCredential)();
265
+ if (guestHandoff === true) {
266
+ localCredentialAvailable = true;
267
+ }
268
+ else if (guestHandoff === false) {
269
+ throw new ManagedAcquisitionError('guest-handoff-unavailable', 'the Dedicated Runtime could not provide its managed skrr session');
270
+ }
271
+ }
198
272
  if (!localCredentialAvailable) {
199
273
  throw new ManagedAcquisitionError('not-signed-in', 'no skrr session on this machine — run `skrr login`');
200
274
  }
@@ -48,8 +48,4 @@ class HarnessCredentialPersistRefused extends Error {
48
48
  }
49
49
  exports.HarnessCredentialPersistRefused = HarnessCredentialPersistRefused;
50
50
  /** The commands a harness-context process may not run (they own the stored session). */
51
- exports.HARNESS_REFUSED_AUTH_COMMANDS = new Set([
52
- 'login',
53
- 'logout',
54
- 'pair',
55
- ]);
51
+ exports.HARNESS_REFUSED_AUTH_COMMANDS = new Set(['login', 'logout']);
@@ -9,3 +9,5 @@ import type { StoreAcquisitionRequest } from '@skrr-ai/data-provider';
9
9
  * terminal and the card cannot describe one request two ways.
10
10
  */
11
11
  export declare function describeAcquisitionRequestLines(request: StoreAcquisitionRequest): string[];
12
+ /** One request as one line, for `skrr store acquisitions list`. */
13
+ export declare function describeAcquisitionRequestRow(request: StoreAcquisitionRequest): string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.describeAcquisitionRequestLines = describeAcquisitionRequestLines;
4
+ exports.describeAcquisitionRequestRow = describeAcquisitionRequestRow;
4
5
  const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  /**
6
7
  * A purchase an agent asked to make, as the lines a terminal shows (OSK-12240).
@@ -17,7 +18,7 @@ function describeAcquisitionRequestLines(request) {
17
18
  const kind = request.entityType === 'skill' ? 'skill' : 'agent';
18
19
  const status = (0, data_provider_1.describeStoreAcquisitionStatus)(request.status);
19
20
  const lines = [
20
- `${name}${version} (a paid ${kind})`,
21
+ `${name}${version} (${request.price > 0 ? 'a paid' : 'a free'} ${kind})`,
21
22
  ` Status: ${status.label}${status.detail ? ` — ${status.detail}` : ''}`,
22
23
  ` Price: ${(0, data_provider_1.formatStoreAcquisitionPrice)(request.price)} ${request.currency}`,
23
24
  ` Refunds: ${(0, data_provider_1.describeStoreAcquisitionRefundTerms)(request.refundTerms)}`,
@@ -36,5 +37,21 @@ function describeAcquisitionRequestLines(request) {
36
37
  if (request.expiresAt) {
37
38
  lines.push(` Expires: ${request.expiresAt}`);
38
39
  }
40
+ const hold = (0, data_provider_1.describeStoreAcquisitionHold)(request);
41
+ if (hold) {
42
+ lines.push(` Workspace: ${hold}`);
43
+ const storeRequestId = request.policyHold?.storeInstallRequestId;
44
+ if (storeRequestId &&
45
+ request.workspaceId &&
46
+ request.policyHold?.storeInstallRequestStatus !== 'approved') {
47
+ lines.push(` Owner step: skrr store governance requests ${request.workspaceId} --approve ${storeRequestId}`);
48
+ }
49
+ }
39
50
  return lines;
40
51
  }
52
+ /** One request as one line, for `skrr store acquisitions list`. */
53
+ function describeAcquisitionRequestRow(request) {
54
+ const name = request.listingName || request.entityId;
55
+ const held = request.holdReason === 'workspace_policy' ? ' [held: workspace policy]' : '';
56
+ return `${request.id} ${request.status} ${(0, data_provider_1.formatStoreAcquisitionPrice)(request.price)} ${name}${held}`;
57
+ }
@@ -0,0 +1,95 @@
1
+ /**
2
+ * `/api/store/moderation/reports` — a Store curator's report queue and its
3
+ * dispositions (OSK-12597).
4
+ *
5
+ * Only the `store_curation` surface (the TRUST role) may use these; the server
6
+ * refuses everyone else, a system ADMIN with no functional role included. A
7
+ * curator may not disposition a report on a listing they published, or whose
8
+ * publisher shares a workspace with them (STORE_CURATION_CONFLICT_OF_INTEREST).
9
+ *
10
+ * Every route is written out at its own call site rather than composed from a
11
+ * builder, like the rest of the Store CLI: the parity checker reads the
12
+ * LITERAL at the call site.
13
+ */
14
+ /** The disposition vocabulary, mirroring STORE_REPORT_DISPOSITIONS on the server. */
15
+ export declare const STORE_REPORT_DISPOSITIONS: readonly ["dismiss", "warn", "delist", "ban"];
16
+ export type StoreReportDisposition = (typeof STORE_REPORT_DISPOSITIONS)[number];
17
+ /** What each disposition does, in the words a curator decides by. */
18
+ export declare const STORE_REPORT_DISPOSITION_EFFECTS: Record<StoreReportDisposition, string>;
19
+ /** A ban one curator requested, waiting for a different one to confirm. */
20
+ export type StoreReportBanRequest = {
21
+ requestId: string;
22
+ requestedBy: string;
23
+ requestedAt?: string;
24
+ /** Withheld (absent) on a listing the reading curator is conflicted on. */
25
+ note?: string | null;
26
+ };
27
+ /** One open report as a curator reads it. Never the reporter's identity. */
28
+ export type CuratorStoreReport = {
29
+ reportId: string;
30
+ agentId: string;
31
+ reason: string;
32
+ /** Withheld (null) on a listing the curator is conflicted on. */
33
+ description: string | null;
34
+ status: string;
35
+ moderationAction: string | null;
36
+ releaseId: string | null;
37
+ versionLabel: string | null;
38
+ createdAt?: string;
39
+ reviewedAt?: string | null;
40
+ /** A ban waiting for a second curator, or null. */
41
+ banRequest?: StoreReportBanRequest | null;
42
+ /** Why this curator may not disposition it, or null. */
43
+ conflict: string | null;
44
+ };
45
+ export type CuratorStoreReportQueue = {
46
+ reports: CuratorStoreReport[];
47
+ total: number;
48
+ limit: number;
49
+ skip: number;
50
+ };
51
+ export type StoreReportDispositionResult = {
52
+ disposition: {
53
+ reportId: string;
54
+ agentId: string;
55
+ action: StoreReportDisposition;
56
+ replayed: boolean;
57
+ reportStatus: string;
58
+ listingState?: string;
59
+ reportsClosed?: number;
60
+ publisherNotified: boolean;
61
+ /** True when a ban was recorded and now waits for a second curator. */
62
+ pendingConfirmation?: boolean;
63
+ banRequest?: StoreReportBanRequest | null;
64
+ requestedBy?: string;
65
+ confirmedBy?: string;
66
+ };
67
+ };
68
+ export type StoreReportBanWithdrawalResult = {
69
+ withdrawal: {
70
+ reportId: string;
71
+ agentId: string;
72
+ withdrawn: boolean;
73
+ replayed: boolean;
74
+ withdrawnRequest?: StoreReportBanRequest;
75
+ };
76
+ };
77
+ /** `GET /moderation/reports` — every report still waiting, oldest first. */
78
+ export declare function listCuratorStoreReports(params?: {
79
+ agentId?: string;
80
+ limit?: number;
81
+ skip?: number;
82
+ }): Promise<CuratorStoreReportQueue>;
83
+ /** `POST /moderation/reports/:reportId/disposition` */
84
+ export declare function dispositionStoreReport(reportId: string, body: {
85
+ action: StoreReportDisposition;
86
+ note: string;
87
+ }): Promise<StoreReportDispositionResult>;
88
+ /** `POST /moderation/reports/:reportId/ban-request/confirm` — the second curator. */
89
+ export declare function confirmStoreReportBan(reportId: string, body: {
90
+ note: string;
91
+ }): Promise<StoreReportDispositionResult>;
92
+ /** `DELETE /moderation/reports/:reportId/ban-request` — withdraw a waiting ban. */
93
+ export declare function withdrawStoreReportBan(reportId: string, body?: {
94
+ note?: string;
95
+ }): Promise<StoreReportBanWithdrawalResult>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STORE_REPORT_DISPOSITION_EFFECTS = exports.STORE_REPORT_DISPOSITIONS = void 0;
4
+ exports.listCuratorStoreReports = listCuratorStoreReports;
5
+ exports.dispositionStoreReport = dispositionStoreReport;
6
+ exports.confirmStoreReportBan = confirmStoreReportBan;
7
+ exports.withdrawStoreReportBan = withdrawStoreReportBan;
8
+ const api_fetch_1 = require("./api-fetch");
9
+ const triggers_1 = require("./triggers");
10
+ /**
11
+ * `/api/store/moderation/reports` — a Store curator's report queue and its
12
+ * dispositions (OSK-12597).
13
+ *
14
+ * Only the `store_curation` surface (the TRUST role) may use these; the server
15
+ * refuses everyone else, a system ADMIN with no functional role included. A
16
+ * curator may not disposition a report on a listing they published, or whose
17
+ * publisher shares a workspace with them (STORE_CURATION_CONFLICT_OF_INTEREST).
18
+ *
19
+ * Every route is written out at its own call site rather than composed from a
20
+ * builder, like the rest of the Store CLI: the parity checker reads the
21
+ * LITERAL at the call site.
22
+ */
23
+ /** The disposition vocabulary, mirroring STORE_REPORT_DISPOSITIONS on the server. */
24
+ exports.STORE_REPORT_DISPOSITIONS = ['dismiss', 'warn', 'delist', 'ban'];
25
+ /** What each disposition does, in the words a curator decides by. */
26
+ exports.STORE_REPORT_DISPOSITION_EFFECTS = {
27
+ dismiss: 'close the report, no action on the listing, publisher not told',
28
+ warn: 'listing stays up, publisher gets a moderator warning',
29
+ delist: 'listing suspended until a moderator restores it, publisher told',
30
+ ban: 'requests a permanent withdrawal; a different curator must confirm it (`store reports confirm-ban`)',
31
+ };
32
+ /** `GET /moderation/reports` — every report still waiting, oldest first. */
33
+ async function listCuratorStoreReports(params = {}) {
34
+ return (0, api_fetch_1.apiFetch)((0, triggers_1.withQuery)('/api/store/moderation/reports', {
35
+ agentId: params.agentId,
36
+ limit: params.limit,
37
+ skip: params.skip,
38
+ }));
39
+ }
40
+ /** `POST /moderation/reports/:reportId/disposition` */
41
+ async function dispositionStoreReport(reportId, body) {
42
+ return (0, api_fetch_1.apiFetch)(`/api/store/moderation/reports/${encodeURIComponent(reportId)}/disposition`, { method: 'POST', body });
43
+ }
44
+ /** `POST /moderation/reports/:reportId/ban-request/confirm` — the second curator. */
45
+ async function confirmStoreReportBan(reportId, body) {
46
+ return (0, api_fetch_1.apiFetch)(`/api/store/moderation/reports/${encodeURIComponent(reportId)}/ban-request/confirm`, { method: 'POST', body });
47
+ }
48
+ /** `DELETE /moderation/reports/:reportId/ban-request` — withdraw a waiting ban. */
49
+ async function withdrawStoreReportBan(reportId, body = {}) {
50
+ return (0, api_fetch_1.apiFetch)(`/api/store/moderation/reports/${encodeURIComponent(reportId)}/ban-request`, { method: 'DELETE', body });
51
+ }
@@ -61,6 +61,79 @@ export declare function ambientWorkspaceId(env?: NodeJS.ProcessEnv): Promise<str
61
61
  export declare function clearAmbientWorkspaceCache(): void;
62
62
  /** `listWorkspaces`, keeping the envelope's caller-level fields. */
63
63
  export declare function listWorkspaceListing(): Promise<WorkspaceListing>;
64
+ /**
65
+ * One event of a workspace's third-party (Store) agent audit trail (OSK-12588).
66
+ * The server builds it from an allow-list; this type is what it sends.
67
+ */
68
+ export interface WorkspaceAgentAuditEvent {
69
+ id: string;
70
+ at: string;
71
+ kind: string;
72
+ actor: {
73
+ kind: 'user' | 'agent' | 'system' | string;
74
+ userId?: string | null;
75
+ agentId?: string | null;
76
+ tool?: string | null;
77
+ process?: string | null;
78
+ confirmedBy?: {
79
+ userId: string | null;
80
+ at: string | null;
81
+ acquisitionRequestId: string | null;
82
+ };
83
+ };
84
+ subject: {
85
+ memberUserId: string | null;
86
+ fulfillment: string | null;
87
+ listingId: string | null;
88
+ listingName: string | null;
89
+ installedAgentId: string | null;
90
+ installedAgentName: string | null;
91
+ teamOrderId: string | null;
92
+ sourceTeamId: string | null;
93
+ installedAgentIds: string[] | null;
94
+ };
95
+ release: {
96
+ releaseId: string | null;
97
+ versionLabel: string | null;
98
+ releaseNumber: number | null;
99
+ fromReleaseId: string | null;
100
+ fromVersionLabel: string | null;
101
+ direction: 'upgrade' | 'rollback' | 'same' | 'unknown' | null;
102
+ strategy: string | null;
103
+ mergeOutcome: string | null;
104
+ } | null;
105
+ outcome: Record<string, unknown>;
106
+ request: {
107
+ method: string | null;
108
+ path: string | null;
109
+ requestId: string | null;
110
+ };
111
+ observationScope: unknown;
112
+ }
113
+ export interface WorkspaceAgentAuditPage {
114
+ workspaceId: string;
115
+ events: WorkspaceAgentAuditEvent[];
116
+ hasMore: boolean;
117
+ nextCursor: string | null;
118
+ coverage: {
119
+ source: string;
120
+ kinds: string[];
121
+ notRecorded: string[];
122
+ };
123
+ }
124
+ export interface WorkspaceAgentAuditQuery {
125
+ kinds?: string[];
126
+ since?: string;
127
+ until?: string;
128
+ limit?: number;
129
+ cursor?: string;
130
+ }
131
+ /**
132
+ * `GET /api/workspaces/:workspaceId/audit/agent-lifecycle` — owner/admin only.
133
+ * The kind vocabulary is the server's; an unknown kind is its 400, not a
134
+ * second list kept here.
135
+ */
136
+ export declare function listWorkspaceAgentAudit(workspaceId: string, query?: WorkspaceAgentAuditQuery): Promise<WorkspaceAgentAuditPage>;
64
137
  export declare function getWorkspace(workspaceId: string): Promise<WorkspaceRow>;
65
138
  /**
66
139
  * Resolve what a human typed to a workspace they are actually in.
@@ -5,6 +5,7 @@ exports.listWorkspaces = listWorkspaces;
5
5
  exports.ambientWorkspaceId = ambientWorkspaceId;
6
6
  exports.clearAmbientWorkspaceCache = clearAmbientWorkspaceCache;
7
7
  exports.listWorkspaceListing = listWorkspaceListing;
8
+ exports.listWorkspaceAgentAudit = listWorkspaceAgentAudit;
8
9
  exports.getWorkspace = getWorkspace;
9
10
  exports.matchWorkspace = matchWorkspace;
10
11
  const api_fetch_1 = require("./api-fetch");
@@ -121,6 +122,26 @@ async function listWorkspaceListing() {
121
122
  }
122
123
  return { rows, defaultWorkspaceId };
123
124
  }
125
+ /**
126
+ * `GET /api/workspaces/:workspaceId/audit/agent-lifecycle` — owner/admin only.
127
+ * The kind vocabulary is the server's; an unknown kind is its 400, not a
128
+ * second list kept here.
129
+ */
130
+ async function listWorkspaceAgentAudit(workspaceId, query = {}) {
131
+ const params = new URLSearchParams();
132
+ if (query.kinds?.length)
133
+ params.set('kind', query.kinds.join(','));
134
+ if (query.since)
135
+ params.set('since', query.since);
136
+ if (query.until)
137
+ params.set('until', query.until);
138
+ if (query.limit)
139
+ params.set('limit', String(query.limit));
140
+ if (query.cursor)
141
+ params.set('cursor', query.cursor);
142
+ const qs = params.toString();
143
+ return (0, api_fetch_1.apiFetch)(`/api/workspaces/${encodeURIComponent(workspaceId)}/audit/agent-lifecycle${qs ? `?${qs}` : ''}`);
144
+ }
124
145
  async function getWorkspace(workspaceId) {
125
146
  return (0, api_fetch_1.apiFetch)(`/api/workspaces/${encodeURIComponent(workspaceId)}`);
126
147
  }
@@ -43,7 +43,7 @@ exports.generatePairKeyPair = generatePairKeyPair;
43
43
  *
44
44
  * Lifetime invariant: the ephemeral X25519 secret key NEVER persists. The
45
45
  * mobile generates one per pairing, uses it once, and discards. The daemon
46
- * generates one per `oversky pair` invocation, uses it for the duration
46
+ * generates one per `skrrd pair` invocation, uses it for the duration
47
47
  * of the polling window, and discards on success/failure/abort.
48
48
  */
49
49
  const tweetnacl_1 = __importDefault(require("tweetnacl"));
@@ -25,7 +25,7 @@
25
25
  *
26
26
  * Lifetime invariant: the ephemeral X25519 secret key NEVER persists. The
27
27
  * mobile generates one per pairing, uses it once, and discards. The daemon
28
- * generates one per `oversky pair` invocation, uses it for the duration
28
+ * generates one per `skrrd pair` invocation, uses it for the duration
29
29
  * of the polling window, and discards on success/failure/abort.
30
30
  */
31
31
  import nacl from 'tweetnacl';