@promptdriven/pds 0.1.0
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 +110 -0
- package/bin/pds +6 -0
- package/dist/args/parser.d.ts +19 -0
- package/dist/args/parser.js +114 -0
- package/dist/args/parser.js.map +1 -0
- package/dist/client/api-client.d.ts +53 -0
- package/dist/client/api-client.js +469 -0
- package/dist/client/api-client.js.map +1 -0
- package/dist/client/types.d.ts +137 -0
- package/dist/client/types.js +3 -0
- package/dist/client/types.js.map +1 -0
- package/dist/commands/registry.d.ts +13 -0
- package/dist/commands/registry.js +987 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/config/config.d.ts +45 -0
- package/dist/config/config.js +145 -0
- package/dist/config/config.js.map +1 -0
- package/dist/errors/errors.d.ts +44 -0
- package/dist/errors/errors.js +203 -0
- package/dist/errors/errors.js.map +1 -0
- package/dist/main.d.ts +19 -0
- package/dist/main.js +248 -0
- package/dist/main.js.map +1 -0
- package/dist/output/output.d.ts +17 -0
- package/dist/output/output.js +90 -0
- package/dist/output/output.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PdsApiClient = exports.PDS_API_VERSION = void 0;
|
|
4
|
+
const errors_1 = require("../errors/errors");
|
|
5
|
+
const version_1 = require("../version");
|
|
6
|
+
Object.defineProperty(exports, "PDS_API_VERSION", { enumerable: true, get: function () { return version_1.PDS_API_VERSION; } });
|
|
7
|
+
class PdsApiClient {
|
|
8
|
+
apiUrl;
|
|
9
|
+
token;
|
|
10
|
+
timeoutMs;
|
|
11
|
+
fetchImpl;
|
|
12
|
+
clientVersion;
|
|
13
|
+
sleepImpl;
|
|
14
|
+
maxWatchReconnects;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.apiUrl = options.apiUrl.replace(/\/+$/, "");
|
|
17
|
+
this.token = options.token;
|
|
18
|
+
this.timeoutMs = options.timeoutMs;
|
|
19
|
+
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
20
|
+
this.clientVersion = options.clientVersion ?? version_1.PDS_CLIENT_VERSION;
|
|
21
|
+
this.sleepImpl = options.sleepImpl ?? sleep;
|
|
22
|
+
this.maxWatchReconnects = options.maxWatchReconnects ?? 8;
|
|
23
|
+
}
|
|
24
|
+
async getVersion() {
|
|
25
|
+
return await this.request("GET", "/api/agent/version");
|
|
26
|
+
}
|
|
27
|
+
async getAuthStatus() {
|
|
28
|
+
return await this.request("GET", "/api/agent/auth/status");
|
|
29
|
+
}
|
|
30
|
+
async createProject(request) {
|
|
31
|
+
const { idempotencyKey, ...body } = request;
|
|
32
|
+
return await this.request("POST", "/api/agent/projects", { body, idempotencyKey });
|
|
33
|
+
}
|
|
34
|
+
async getProject(projectId) {
|
|
35
|
+
return await this.request("GET", `/api/agent/projects/${encodeURIComponent(projectId)}`);
|
|
36
|
+
}
|
|
37
|
+
async getScript(request) {
|
|
38
|
+
return await this.request("GET", `/api/agent/projects/${encodeURIComponent(request.projectId)}/script`, {
|
|
39
|
+
query: { file: request.file }
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async setScript(request) {
|
|
43
|
+
const { idempotencyKey, ...body } = request;
|
|
44
|
+
return await this.request("PUT", `/api/agent/projects/${encodeURIComponent(request.projectId)}/script`, {
|
|
45
|
+
query: { file: body.file },
|
|
46
|
+
body: { content: body.content },
|
|
47
|
+
idempotencyKey
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async listArtifacts(projectId) {
|
|
51
|
+
return await this.request("GET", `/api/agent/projects/${encodeURIComponent(projectId)}/artifacts`);
|
|
52
|
+
}
|
|
53
|
+
async planPipeline(request) {
|
|
54
|
+
return await this.request("POST", "/api/agent/pipeline/plan", { body: request });
|
|
55
|
+
}
|
|
56
|
+
async runPipeline(request) {
|
|
57
|
+
const { idempotencyKey, ...body } = request;
|
|
58
|
+
return await this.request("POST", "/api/agent/pipeline/run", {
|
|
59
|
+
body,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
timeoutMs: body.wait !== false ? null : undefined
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async resetPipeline(request) {
|
|
65
|
+
const { projectId, idempotencyKey, ...body } = request;
|
|
66
|
+
return await this.request("POST", `/api/agent/projects/${encodeURIComponent(projectId)}/reset-pipeline`, { body, idempotencyKey });
|
|
67
|
+
}
|
|
68
|
+
async getPipelineStatus(request) {
|
|
69
|
+
return await this.request("GET", "/api/agent/pipeline/status", {
|
|
70
|
+
query: { projectId: request.projectId }
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async watchJob(request) {
|
|
74
|
+
const events = [];
|
|
75
|
+
const seenEvents = new Set();
|
|
76
|
+
let retryDelayMs = 250;
|
|
77
|
+
let reconnects = 0;
|
|
78
|
+
while (true) {
|
|
79
|
+
try {
|
|
80
|
+
await this.requestNdjson("GET", `/api/agent/jobs/${encodeURIComponent(request.jobId)}/events`, { accept: "application/x-ndjson", timeoutMs: null }, async (event) => {
|
|
81
|
+
const eventKey = JSON.stringify(event);
|
|
82
|
+
if (seenEvents.has(eventKey)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (request.onEvent) {
|
|
86
|
+
try {
|
|
87
|
+
await request.onEvent(event);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
throw new WatchEventHandlerError(error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
events.push(event);
|
|
95
|
+
}
|
|
96
|
+
seenEvents.add(eventKey);
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
events
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (error instanceof WatchEventHandlerError) {
|
|
104
|
+
throw error.cause;
|
|
105
|
+
}
|
|
106
|
+
if (!shouldRetryWatch(error)) {
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
if (reconnects >= this.maxWatchReconnects) {
|
|
110
|
+
throw new errors_1.ApiError(`Agent job event stream disconnected after ${this.maxWatchReconnects} reconnect attempts`, {
|
|
111
|
+
code: "watch_reconnect_exhausted",
|
|
112
|
+
exitCode: errors_1.EXIT_CODES.unexpected,
|
|
113
|
+
details: {
|
|
114
|
+
jobId: request.jobId,
|
|
115
|
+
reconnects
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
reconnects += 1;
|
|
120
|
+
await this.sleepImpl(retryDelayMs);
|
|
121
|
+
retryDelayMs = Math.min(retryDelayMs * 2, 5_000);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async getJob(request) {
|
|
126
|
+
return await this.request("GET", `/api/agent/jobs/${encodeURIComponent(request.jobId)}`);
|
|
127
|
+
}
|
|
128
|
+
async cancelJob(request) {
|
|
129
|
+
return await this.request("POST", `/api/agent/jobs/${encodeURIComponent(request.jobId)}`, {
|
|
130
|
+
body: { action: "cancel" }
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
async startDeviceLogin(request) {
|
|
134
|
+
return await this.request("POST", "/api/agent/auth/device/start", {
|
|
135
|
+
body: request
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async completeDeviceLogin(request) {
|
|
139
|
+
return await this.request("POST", "/api/agent/auth/device/complete", {
|
|
140
|
+
body: request
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async createToken(request) {
|
|
144
|
+
return await this.request("POST", "/api/agent/auth/tokens", {
|
|
145
|
+
body: request
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async listTokens() {
|
|
149
|
+
return await this.request("GET", "/api/agent/auth/tokens");
|
|
150
|
+
}
|
|
151
|
+
async revokeToken(request) {
|
|
152
|
+
return await this.request("DELETE", `/api/agent/auth/tokens/${encodeURIComponent(request.tokenId)}`);
|
|
153
|
+
}
|
|
154
|
+
async generateDistribution(request) {
|
|
155
|
+
const { idempotencyKey, ...body } = request;
|
|
156
|
+
return await this.request("POST", "/api/agent/distribution/package", {
|
|
157
|
+
body,
|
|
158
|
+
idempotencyKey,
|
|
159
|
+
timeoutMs: body.dryRun === true ? undefined : null
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
async getDistributionStatus(request) {
|
|
163
|
+
return await this.request("GET", "/api/agent/distribution/package", {
|
|
164
|
+
query: {
|
|
165
|
+
projectId: request.projectId,
|
|
166
|
+
platform: request.platform
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
async publishDistribution(request) {
|
|
171
|
+
const { idempotencyKey, ...body } = request;
|
|
172
|
+
return await this.request("POST", "/api/agent/distribution/publish", {
|
|
173
|
+
body,
|
|
174
|
+
idempotencyKey,
|
|
175
|
+
timeoutMs: body.wait !== false ? null : undefined
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
async listDistributionConnections(request) {
|
|
179
|
+
return await this.request("GET", "/api/agent/distribution/connections", {
|
|
180
|
+
query: {
|
|
181
|
+
projectId: request.projectId,
|
|
182
|
+
platform: request.platform
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async selectDistributionConnection(request) {
|
|
187
|
+
return await this.request("POST", "/api/agent/distribution/connection", {
|
|
188
|
+
body: request
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
async createReleaseVideo(request) {
|
|
192
|
+
const { idempotencyKey, ...body } = request;
|
|
193
|
+
return await this.request("POST", "/api/agent/release-video", {
|
|
194
|
+
body,
|
|
195
|
+
idempotencyKey,
|
|
196
|
+
timeoutMs: body.wait !== false ? null : undefined
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
async request(method, path, options = {}) {
|
|
200
|
+
const attempts = method === "GET" ? 2 : 1;
|
|
201
|
+
let lastError;
|
|
202
|
+
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
203
|
+
try {
|
|
204
|
+
return await this.requestOnce(method, path, options);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
lastError = error;
|
|
208
|
+
if (!(method === "GET" && shouldRetryRead(error) && attempt + 1 < attempts)) {
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
throw lastError;
|
|
214
|
+
}
|
|
215
|
+
async requestOnce(method, path, options) {
|
|
216
|
+
const response = await this.fetchResponse(method, path, options);
|
|
217
|
+
return await parseResponse(response);
|
|
218
|
+
}
|
|
219
|
+
async requestText(method, path, options = {}) {
|
|
220
|
+
const response = await this.fetchResponse(method, path, options);
|
|
221
|
+
const text = await readResponseText(response);
|
|
222
|
+
if (response.ok) {
|
|
223
|
+
return text;
|
|
224
|
+
}
|
|
225
|
+
throw apiErrorFromResponseText(response, text);
|
|
226
|
+
}
|
|
227
|
+
async requestNdjson(method, path, options = {}, onEvent) {
|
|
228
|
+
const response = await this.fetchResponse(method, path, options);
|
|
229
|
+
if (!response.ok) {
|
|
230
|
+
throw apiErrorFromResponseText(response, await readResponseText(response));
|
|
231
|
+
}
|
|
232
|
+
const events = [];
|
|
233
|
+
const collectEvents = onEvent === undefined;
|
|
234
|
+
const handleEvent = async (event) => {
|
|
235
|
+
if (collectEvents) {
|
|
236
|
+
events.push(event);
|
|
237
|
+
}
|
|
238
|
+
if (onEvent) {
|
|
239
|
+
await onEvent(event);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
if (!response.body) {
|
|
243
|
+
await parseNdjsonText(await readResponseText(response), handleEvent);
|
|
244
|
+
return events;
|
|
245
|
+
}
|
|
246
|
+
const reader = response.body.getReader();
|
|
247
|
+
const decoder = new TextDecoder();
|
|
248
|
+
let buffer = "";
|
|
249
|
+
while (true) {
|
|
250
|
+
const { done, value } = await reader.read();
|
|
251
|
+
if (done) {
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
buffer += decoder.decode(value, { stream: true });
|
|
255
|
+
buffer = await drainNdjsonBuffer(buffer, handleEvent);
|
|
256
|
+
}
|
|
257
|
+
buffer += decoder.decode();
|
|
258
|
+
await parseNdjsonText(buffer, handleEvent);
|
|
259
|
+
return events;
|
|
260
|
+
}
|
|
261
|
+
async fetchResponse(method, path, options) {
|
|
262
|
+
const url = new URL(path, `${this.apiUrl}/`);
|
|
263
|
+
for (const [key, value] of Object.entries(options.query ?? {})) {
|
|
264
|
+
if (value !== undefined) {
|
|
265
|
+
url.searchParams.set(key, value);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const headers = new Headers({
|
|
269
|
+
accept: options.accept ?? "application/json",
|
|
270
|
+
"x-pds-api-version": version_1.PDS_API_VERSION,
|
|
271
|
+
"x-pds-client-version": this.clientVersion
|
|
272
|
+
});
|
|
273
|
+
if (this.token) {
|
|
274
|
+
headers.set("authorization", `Bearer ${this.token}`);
|
|
275
|
+
}
|
|
276
|
+
if (options.idempotencyKey) {
|
|
277
|
+
headers.set("idempotency-key", options.idempotencyKey);
|
|
278
|
+
}
|
|
279
|
+
const init = { method, headers };
|
|
280
|
+
if (options.body !== undefined) {
|
|
281
|
+
headers.set("content-type", "application/json");
|
|
282
|
+
init.body = JSON.stringify(options.body);
|
|
283
|
+
}
|
|
284
|
+
const timeoutMs = options.timeoutMs === undefined ? this.timeoutMs : options.timeoutMs;
|
|
285
|
+
let timeout;
|
|
286
|
+
if (timeoutMs !== null) {
|
|
287
|
+
const controller = new AbortController();
|
|
288
|
+
timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
289
|
+
init.signal = controller.signal;
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
return await this.fetchImpl(url.toString(), init);
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
if (isAbortError(error)) {
|
|
296
|
+
throw new errors_1.ApiError(`Request timed out after ${timeoutMs}ms`, {
|
|
297
|
+
code: "timeout",
|
|
298
|
+
exitCode: errors_1.EXIT_CODES.timeout
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
if (error instanceof errors_1.ApiError) {
|
|
302
|
+
throw error;
|
|
303
|
+
}
|
|
304
|
+
if (error instanceof Error) {
|
|
305
|
+
throw new errors_1.ApiError((0, errors_1.redactSecretString)(error.message), {
|
|
306
|
+
code: "network_error",
|
|
307
|
+
exitCode: errors_1.EXIT_CODES.unexpected
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
throw error;
|
|
311
|
+
}
|
|
312
|
+
finally {
|
|
313
|
+
if (timeout) {
|
|
314
|
+
clearTimeout(timeout);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
exports.PdsApiClient = PdsApiClient;
|
|
320
|
+
async function parseResponse(response) {
|
|
321
|
+
const text = await readResponseText(response);
|
|
322
|
+
const parsed = parseResponseBody(text, response.headers.get("content-type"));
|
|
323
|
+
if (response.ok) {
|
|
324
|
+
return parsed;
|
|
325
|
+
}
|
|
326
|
+
throw apiErrorFromParsedBody(response, parsed);
|
|
327
|
+
}
|
|
328
|
+
async function readResponseText(response) {
|
|
329
|
+
try {
|
|
330
|
+
return await response.text();
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
if (error instanceof errors_1.ApiError) {
|
|
334
|
+
throw error;
|
|
335
|
+
}
|
|
336
|
+
if (error instanceof Error) {
|
|
337
|
+
throw new errors_1.ApiError((0, errors_1.redactSecretString)(error.message), {
|
|
338
|
+
code: "network_error",
|
|
339
|
+
exitCode: errors_1.EXIT_CODES.unexpected
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
async function drainNdjsonBuffer(buffer, handleEvent) {
|
|
346
|
+
let newlineIndex = buffer.search(/\r?\n/);
|
|
347
|
+
while (newlineIndex >= 0) {
|
|
348
|
+
const line = buffer.slice(0, newlineIndex).trim();
|
|
349
|
+
buffer = buffer.slice(buffer[newlineIndex] === "\r" ? newlineIndex + 2 : newlineIndex + 1);
|
|
350
|
+
if (line.length > 0) {
|
|
351
|
+
await handleEvent(JSON.parse(line));
|
|
352
|
+
}
|
|
353
|
+
newlineIndex = buffer.search(/\r?\n/);
|
|
354
|
+
}
|
|
355
|
+
return buffer;
|
|
356
|
+
}
|
|
357
|
+
async function parseNdjsonText(text, handleEvent) {
|
|
358
|
+
const trimmed = text.trim();
|
|
359
|
+
if (!trimmed) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
for (const line of trimmed.split(/\n+/)) {
|
|
363
|
+
const normalized = line.trim();
|
|
364
|
+
if (normalized.length > 0) {
|
|
365
|
+
await handleEvent(JSON.parse(normalized));
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function apiErrorFromResponseText(response, text) {
|
|
370
|
+
return apiErrorFromParsedBody(response, parseResponseBody(text, response.headers.get("content-type")));
|
|
371
|
+
}
|
|
372
|
+
function apiErrorFromParsedBody(response, parsed) {
|
|
373
|
+
const errorBody = isRecord(parsed) ? parsed : {};
|
|
374
|
+
const nestedError = isRecord(errorBody.error) ? errorBody.error : {};
|
|
375
|
+
const code = stringOrUndefined(nestedError.code) ?? stringOrUndefined(errorBody.code);
|
|
376
|
+
const details = nestedError.details !== undefined ? nestedError.details : errorBody;
|
|
377
|
+
const message = stringOrUndefined(nestedError.message) ??
|
|
378
|
+
stringOrUndefined(errorBody.message) ??
|
|
379
|
+
response.statusText ??
|
|
380
|
+
`HTTP ${response.status}`;
|
|
381
|
+
throw new errors_1.ApiError(enhanceApiErrorMessage(message, code, details), {
|
|
382
|
+
code: code ?? `http_${response.status}`,
|
|
383
|
+
status: response.status,
|
|
384
|
+
exitCode: (0, errors_1.mapApiErrorToExitCode)(code, response.status),
|
|
385
|
+
details
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
function enhanceApiErrorMessage(message, code, details) {
|
|
389
|
+
if (code !== "stage_not_enabled_for_agent_execution") {
|
|
390
|
+
return message;
|
|
391
|
+
}
|
|
392
|
+
const record = isRecord(details) ? details : {};
|
|
393
|
+
const enablement = isRecord(record.enablement) ? record.enablement : {};
|
|
394
|
+
const target = stringOrUndefined(record.target);
|
|
395
|
+
const operation = stringOrUndefined(record.operation);
|
|
396
|
+
const targetEnv = stringOrUndefined(enablement.targetEnv);
|
|
397
|
+
const releaseVideoTargetEnv = stringOrUndefined(enablement.releaseVideoTargetEnv);
|
|
398
|
+
const allEnv = stringOrUndefined(enablement.env);
|
|
399
|
+
const recommendedValue = stringOrUndefined(enablement.recommendedValue);
|
|
400
|
+
const targetText = target ? ` for target ${target}` : "";
|
|
401
|
+
if (!targetEnv && !releaseVideoTargetEnv && !allEnv) {
|
|
402
|
+
return message;
|
|
403
|
+
}
|
|
404
|
+
const isReleaseVideoGate = operation === "release-video.create";
|
|
405
|
+
const isReleaseVideoScopedRetryGate = operation === "pipeline.run" && Boolean(releaseVideoTargetEnv);
|
|
406
|
+
const scopedTargetValue = recommendedValue ?? target;
|
|
407
|
+
const primaryGuidance = releaseVideoTargetEnv
|
|
408
|
+
? scopedTargetValue
|
|
409
|
+
? `set ${releaseVideoTargetEnv}=${scopedTargetValue} on the API service to enable release-video ${scopedTargetValue} stage retries`
|
|
410
|
+
: `set ${releaseVideoTargetEnv} on the API service to enable release-video stage retries`
|
|
411
|
+
: targetEnv && scopedTargetValue
|
|
412
|
+
? isReleaseVideoGate
|
|
413
|
+
? `set ${targetEnv}=${scopedTargetValue} on the API service to enable release-video ${scopedTargetValue} targets`
|
|
414
|
+
: `set ${targetEnv}=${scopedTargetValue} on the API service to enable direct pipeline target ${scopedTargetValue}`
|
|
415
|
+
: targetEnv
|
|
416
|
+
? `set ${targetEnv} on the API service to enable the required paid target`
|
|
417
|
+
: undefined;
|
|
418
|
+
const guidance = [
|
|
419
|
+
primaryGuidance,
|
|
420
|
+
!isReleaseVideoScopedRetryGate && allEnv
|
|
421
|
+
? `${allEnv}=1 enables all paid agent targets and should be reserved for controlled environments`
|
|
422
|
+
: undefined
|
|
423
|
+
].filter(Boolean);
|
|
424
|
+
return `${message}${targetText}. ${guidance.join("; ")}.`;
|
|
425
|
+
}
|
|
426
|
+
function parseResponseBody(text, contentType) {
|
|
427
|
+
if (!text) {
|
|
428
|
+
return {};
|
|
429
|
+
}
|
|
430
|
+
if (contentType?.includes("application/json") || /^[\s]*[{[]/.test(text)) {
|
|
431
|
+
try {
|
|
432
|
+
return JSON.parse(text);
|
|
433
|
+
}
|
|
434
|
+
catch {
|
|
435
|
+
return { message: text };
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return { message: text };
|
|
439
|
+
}
|
|
440
|
+
function isRecord(value) {
|
|
441
|
+
return typeof value === "object" && value !== null;
|
|
442
|
+
}
|
|
443
|
+
function stringOrUndefined(value) {
|
|
444
|
+
return typeof value === "string" ? value : undefined;
|
|
445
|
+
}
|
|
446
|
+
function isAbortError(error) {
|
|
447
|
+
return error instanceof DOMException && error.name === "AbortError";
|
|
448
|
+
}
|
|
449
|
+
function shouldRetryRead(error) {
|
|
450
|
+
return error instanceof errors_1.ApiError && (error.exitCode === errors_1.EXIT_CODES.server || error.exitCode === errors_1.EXIT_CODES.unexpected);
|
|
451
|
+
}
|
|
452
|
+
function shouldRetryWatch(error) {
|
|
453
|
+
if (shouldRetryRead(error)) {
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
456
|
+
return error instanceof Error && !(error instanceof errors_1.ApiError) && !(error instanceof SyntaxError);
|
|
457
|
+
}
|
|
458
|
+
function sleep(ms) {
|
|
459
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
460
|
+
}
|
|
461
|
+
class WatchEventHandlerError extends Error {
|
|
462
|
+
cause;
|
|
463
|
+
constructor(cause) {
|
|
464
|
+
super(cause instanceof Error ? cause.message : String(cause));
|
|
465
|
+
this.name = "WatchEventHandlerError";
|
|
466
|
+
this.cause = cause;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/client/api-client.ts"],"names":[],"mappings":";;;AAAA,6CAAmG;AACnG,wCAAiE;AAoBxD,gGApBA,yBAAe,OAoBA;AAsBxB,MAAa,YAAY;IACN,MAAM,CAAS;IACf,KAAK,CAAqB;IAC1B,SAAS,CAAS;IAClB,SAAS,CAAY;IACrB,aAAa,CAAS;IACtB,SAAS,CAAgC;IACzC,kBAAkB,CAAS;IAE5C,YAAY,OAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,4BAAkB,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;QAC5C,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,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 -0,0 +1,137 @@
|
|
|
1
|
+
export type JsonRecord = Record<string, unknown>;
|
|
2
|
+
export type CreateProjectRequest = {
|
|
3
|
+
name: string;
|
|
4
|
+
projectId?: string;
|
|
5
|
+
template?: string;
|
|
6
|
+
idempotencyKey?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ScriptGetRequest = {
|
|
9
|
+
projectId: string;
|
|
10
|
+
file?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ScriptSetRequest = {
|
|
13
|
+
projectId: string;
|
|
14
|
+
file?: string;
|
|
15
|
+
content: string;
|
|
16
|
+
idempotencyKey?: string;
|
|
17
|
+
};
|
|
18
|
+
export type PipelineRequest = {
|
|
19
|
+
projectId: string;
|
|
20
|
+
to?: string;
|
|
21
|
+
stage?: string;
|
|
22
|
+
mode?: string;
|
|
23
|
+
dryRun?: boolean;
|
|
24
|
+
forceRegenerate?: boolean;
|
|
25
|
+
wait?: boolean;
|
|
26
|
+
idempotencyKey?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ResetPipelineRequest = {
|
|
29
|
+
projectId: string;
|
|
30
|
+
all?: true;
|
|
31
|
+
from?: string;
|
|
32
|
+
stage?: string;
|
|
33
|
+
idempotencyKey?: string;
|
|
34
|
+
};
|
|
35
|
+
export type PipelineStatusRequest = {
|
|
36
|
+
projectId: string;
|
|
37
|
+
};
|
|
38
|
+
export type JobRequest = {
|
|
39
|
+
jobId: string;
|
|
40
|
+
onEvent?: (event: unknown) => void | Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
export type CreateTokenRequest = {
|
|
43
|
+
label: string;
|
|
44
|
+
scopes: string[];
|
|
45
|
+
projectIds: string[] | "*";
|
|
46
|
+
expiresAt: string;
|
|
47
|
+
};
|
|
48
|
+
export type DeviceLoginStartRequest = {
|
|
49
|
+
scopes: string[];
|
|
50
|
+
projectIds: string[] | "*";
|
|
51
|
+
expiresAt: string;
|
|
52
|
+
};
|
|
53
|
+
export type DeviceLoginCompleteRequest = {
|
|
54
|
+
deviceCode?: string;
|
|
55
|
+
userCode?: string;
|
|
56
|
+
};
|
|
57
|
+
export type RevokeTokenRequest = {
|
|
58
|
+
tokenId: string;
|
|
59
|
+
};
|
|
60
|
+
export type DistributionRequest = {
|
|
61
|
+
projectId: string;
|
|
62
|
+
platform?: string;
|
|
63
|
+
mode?: string;
|
|
64
|
+
privacy?: string;
|
|
65
|
+
dryRun?: boolean;
|
|
66
|
+
forceRegenerate?: boolean;
|
|
67
|
+
noGenerate?: boolean;
|
|
68
|
+
overrideAudit?: boolean;
|
|
69
|
+
auditOverrideRationale?: string;
|
|
70
|
+
wait?: boolean;
|
|
71
|
+
idempotencyKey?: string;
|
|
72
|
+
};
|
|
73
|
+
export type DistributionConnectionListRequest = {
|
|
74
|
+
projectId?: string;
|
|
75
|
+
platform?: string;
|
|
76
|
+
};
|
|
77
|
+
export type DistributionConnectionSelectRequest = {
|
|
78
|
+
projectId: string;
|
|
79
|
+
platform?: string;
|
|
80
|
+
connectionId: string;
|
|
81
|
+
};
|
|
82
|
+
export type ReleaseVideoRequest = {
|
|
83
|
+
projectName?: string;
|
|
84
|
+
projectId?: string;
|
|
85
|
+
script?: {
|
|
86
|
+
content: string;
|
|
87
|
+
fileName?: string;
|
|
88
|
+
};
|
|
89
|
+
releaseNotes?: {
|
|
90
|
+
content: string;
|
|
91
|
+
fileName?: string;
|
|
92
|
+
};
|
|
93
|
+
changelog?: {
|
|
94
|
+
content: string;
|
|
95
|
+
fileName?: string;
|
|
96
|
+
};
|
|
97
|
+
repoUrl?: string;
|
|
98
|
+
repoName?: string;
|
|
99
|
+
gitSha?: string;
|
|
100
|
+
releaseTag?: string;
|
|
101
|
+
preset?: string;
|
|
102
|
+
target?: string;
|
|
103
|
+
platform?: string;
|
|
104
|
+
privacy?: string;
|
|
105
|
+
overrideAudit?: boolean;
|
|
106
|
+
auditOverrideRationale?: string;
|
|
107
|
+
dryRun?: boolean;
|
|
108
|
+
idempotencyKey?: string;
|
|
109
|
+
wait?: boolean;
|
|
110
|
+
};
|
|
111
|
+
export interface PdsClient {
|
|
112
|
+
getVersion(): Promise<unknown>;
|
|
113
|
+
getAuthStatus(): Promise<unknown>;
|
|
114
|
+
createProject(request: CreateProjectRequest): Promise<unknown>;
|
|
115
|
+
getProject(projectId: string): Promise<unknown>;
|
|
116
|
+
getScript(request: ScriptGetRequest): Promise<unknown>;
|
|
117
|
+
setScript(request: ScriptSetRequest): Promise<unknown>;
|
|
118
|
+
listArtifacts(projectId: string): Promise<unknown>;
|
|
119
|
+
planPipeline(request: PipelineRequest): Promise<unknown>;
|
|
120
|
+
runPipeline(request: PipelineRequest): Promise<unknown>;
|
|
121
|
+
resetPipeline(request: ResetPipelineRequest): Promise<unknown>;
|
|
122
|
+
getPipelineStatus(request: PipelineStatusRequest): Promise<unknown>;
|
|
123
|
+
getJob(request: JobRequest): Promise<unknown>;
|
|
124
|
+
watchJob(request: JobRequest): Promise<unknown>;
|
|
125
|
+
cancelJob(request: JobRequest): Promise<unknown>;
|
|
126
|
+
startDeviceLogin(request: DeviceLoginStartRequest): Promise<unknown>;
|
|
127
|
+
completeDeviceLogin(request: DeviceLoginCompleteRequest): Promise<unknown>;
|
|
128
|
+
createToken(request: CreateTokenRequest): Promise<unknown>;
|
|
129
|
+
listTokens(): Promise<unknown>;
|
|
130
|
+
revokeToken(request: RevokeTokenRequest): Promise<unknown>;
|
|
131
|
+
generateDistribution(request: DistributionRequest): Promise<unknown>;
|
|
132
|
+
getDistributionStatus(request: DistributionRequest): Promise<unknown>;
|
|
133
|
+
publishDistribution(request: DistributionRequest): Promise<unknown>;
|
|
134
|
+
listDistributionConnections(request: DistributionConnectionListRequest): Promise<unknown>;
|
|
135
|
+
selectDistributionConnection(request: DistributionConnectionSelectRequest): Promise<unknown>;
|
|
136
|
+
createReleaseVideo(request: ReleaseVideoRequest): Promise<unknown>;
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ResolvedConfig } from "../config/config";
|
|
2
|
+
import type { PdsClient } from "../client/types";
|
|
3
|
+
export type CommandContext = {
|
|
4
|
+
client: PdsClient;
|
|
5
|
+
config: ResolvedConfig;
|
|
6
|
+
configRoot?: string;
|
|
7
|
+
env: Record<string, string | undefined>;
|
|
8
|
+
emitJsonlEvent?: (event: unknown) => void;
|
|
9
|
+
notice?: (text: string) => void;
|
|
10
|
+
openUrl?: (url: string) => void | Promise<void>;
|
|
11
|
+
sleep?: (ms: number) => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export declare function dispatchCommand(commandPath: string[], commandArgs: string[], context: CommandContext): Promise<unknown>;
|