@skrr-ai/cli 0.1.83 → 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 (48) 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 +3 -4
  35. package/dist/lib/harness-context.js +1 -5
  36. package/dist/lib/store-acquisition.d.ts +2 -0
  37. package/dist/lib/store-acquisition.js +18 -1
  38. package/dist/lib/store-moderation.d.ts +95 -0
  39. package/dist/lib/store-moderation.js +51 -0
  40. package/dist/lib/workspaces.d.ts +73 -0
  41. package/dist/lib/workspaces.js +21 -0
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +1 -1
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +1 -1
  44. package/dist/node_modules/@skrr-ai/data-provider/index.js +4324 -4294
  45. package/oclif.manifest.json +22000 -21244
  46. package/package.json +4 -3
  47. package/dist/commands/pair.d.ts +0 -67
  48. package/dist/commands/pair.js +0 -351
@@ -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';