@skrr-ai/cli 0.1.83 → 0.1.85
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/README.md +2 -2
- package/dist/base-command.js +2 -2
- package/dist/commands/agents/chat.js +10 -3
- package/dist/commands/agents/endpoint/connect.d.ts +24 -0
- package/dist/commands/agents/endpoint/connect.js +93 -0
- package/dist/commands/agents/endpoint/disable.d.ts +18 -0
- package/dist/commands/agents/endpoint/disable.js +44 -0
- package/dist/commands/agents/endpoint/enable.d.ts +18 -0
- package/dist/commands/agents/endpoint/enable.js +46 -0
- package/dist/commands/agents/endpoint/show.d.ts +16 -0
- package/dist/commands/agents/endpoint/show.js +45 -0
- package/dist/commands/harnesses/install-token.d.ts +4 -4
- package/dist/commands/harnesses/install-token.js +4 -4
- package/dist/commands/store/acquisitions/list.d.ts +18 -0
- package/dist/commands/store/acquisitions/list.js +58 -0
- package/dist/commands/store/governance/requests.js +6 -0
- package/dist/commands/store/maintainers/remove.d.ts +8 -1
- package/dist/commands/store/maintainers/remove.js +29 -4
- package/dist/commands/store/reports/confirm-ban.d.ts +19 -0
- package/dist/commands/store/reports/confirm-ban.js +57 -0
- package/dist/commands/store/reports/disposition.d.ts +21 -0
- package/dist/commands/store/reports/disposition.js +76 -0
- package/dist/commands/store/reports/list.d.ts +17 -0
- package/dist/commands/store/reports/list.js +79 -0
- package/dist/commands/store/reports/withdraw-ban.d.ts +18 -0
- package/dist/commands/store/reports/withdraw-ban.js +48 -0
- package/dist/commands/store/updates.js +9 -5
- package/dist/commands/workspaces/audit.d.ts +30 -0
- package/dist/commands/workspaces/audit.js +145 -0
- package/dist/lib/agent-endpoints.d.ts +62 -0
- package/dist/lib/agent-endpoints.js +64 -0
- package/dist/lib/agentic-stream.d.ts +84 -17
- package/dist/lib/agentic-stream.js +207 -36
- package/dist/lib/auth-storage.d.ts +1 -1
- package/dist/lib/auth-storage.js +1 -1
- package/dist/lib/daemonBroker.d.ts +1 -1
- package/dist/lib/daemonBroker.js +3 -4
- package/dist/lib/harness-context.js +1 -5
- package/dist/lib/store-acquisition.d.ts +2 -0
- package/dist/lib/store-acquisition.js +18 -1
- package/dist/lib/store-moderation.d.ts +95 -0
- package/dist/lib/store-moderation.js +51 -0
- package/dist/lib/workspaces.d.ts +73 -0
- package/dist/lib/workspaces.js +19 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +4324 -4294
- package/oclif.manifest.json +43429 -42673
- package/package.json +4 -3
- package/dist/commands/pair.d.ts +0 -67
- package/dist/commands/pair.js +0 -351
|
@@ -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
|
+
}
|
package/dist/lib/workspaces.d.ts
CHANGED
|
@@ -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.
|
package/dist/lib/workspaces.js
CHANGED
|
@@ -5,9 +5,11 @@ 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");
|
|
12
|
+
const triggers_1 = require("./triggers");
|
|
11
13
|
/**
|
|
12
14
|
* The server's workspace document can include presentation metadata such as an
|
|
13
15
|
* avatar source. This CLI surface is a selector, not a workspace export: keep
|
|
@@ -121,6 +123,23 @@ async function listWorkspaceListing() {
|
|
|
121
123
|
}
|
|
122
124
|
return { rows, defaultWorkspaceId };
|
|
123
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* `GET /api/workspaces/:workspaceId/audit/agent-lifecycle` — owner/admin only.
|
|
128
|
+
* The kind vocabulary is the server's; an unknown kind is its 400, not a
|
|
129
|
+
* second list kept here.
|
|
130
|
+
*/
|
|
131
|
+
async function listWorkspaceAgentAudit(workspaceId, query = {}) {
|
|
132
|
+
// The query rides in `withQuery`, outside the path literal, so the CLI parity
|
|
133
|
+
// check can read the route this calls (a `?` suffix nested inside the literal
|
|
134
|
+
// truncates what it sees).
|
|
135
|
+
return (0, api_fetch_1.apiFetch)((0, triggers_1.withQuery)(`/api/workspaces/${encodeURIComponent(workspaceId)}/audit/agent-lifecycle`, {
|
|
136
|
+
kind: query.kinds?.length ? query.kinds.join(',') : undefined,
|
|
137
|
+
since: query.since || undefined,
|
|
138
|
+
until: query.until || undefined,
|
|
139
|
+
limit: query.limit || undefined,
|
|
140
|
+
cursor: query.cursor || undefined,
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
124
143
|
async function getWorkspace(workspaceId) {
|
|
125
144
|
return (0, api_fetch_1.apiFetch)(`/api/workspaces/${encodeURIComponent(workspaceId)}`);
|
|
126
145
|
}
|
|
@@ -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 `
|
|
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 `
|
|
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';
|