@oxygen-agent/cli 1.922.14 → 1.936.1
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 +1 -1
- package/dist/admin-primary-providers-render.d.ts +18 -0
- package/dist/admin-primary-providers-render.js +371 -0
- package/dist/command-manifest.js +6 -0
- package/dist/functions-commands.d.ts +6 -0
- package/dist/functions-commands.js +56 -0
- package/dist/http-client.d.ts +4 -0
- package/dist/http-client.js +49 -2
- package/dist/index.js +175 -40
- package/dist/ugc-commands.d.ts +6 -0
- package/dist/ugc-commands.js +748 -0
- package/dist/visual-commands.d.ts +6 -0
- package/dist/visual-commands.js +57 -0
- package/dist/visual-render-wait.d.ts +3 -0
- package/dist/visual-render-wait.js +56 -0
- package/node_modules/@oxygen/shared/dist/byok-connect.d.ts +43 -0
- package/node_modules/@oxygen/shared/dist/byok-connect.js +84 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery.js +26 -10
- package/node_modules/@oxygen/shared/dist/feature-gates.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/feature-gates.js +3 -0
- package/node_modules/@oxygen/shared/dist/index.d.ts +4 -0
- package/node_modules/@oxygen/shared/dist/index.js +4 -0
- package/node_modules/@oxygen/shared/dist/knowledge-constants.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/knowledge-constants.js +3 -2
- package/node_modules/@oxygen/shared/dist/knowledge-seed-content.js +1 -1
- package/node_modules/@oxygen/shared/dist/langfuse.js +17 -0
- package/node_modules/@oxygen/shared/dist/object-storage.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/object-storage.js +5 -0
- package/node_modules/@oxygen/shared/dist/provider-balance-signal.d.ts +113 -0
- package/node_modules/@oxygen/shared/dist/provider-balance-signal.js +158 -0
- package/node_modules/@oxygen/shared/dist/sequence-failures.d.ts +12 -0
- package/node_modules/@oxygen/shared/dist/sequence-failures.js +24 -0
- package/node_modules/@oxygen/shared/dist/sequences.d.ts +16 -0
- package/node_modules/@oxygen/shared/dist/sequences.js +54 -0
- package/node_modules/@oxygen/shared/dist/ugc.d.ts +113 -0
- package/node_modules/@oxygen/shared/dist/ugc.js +2 -0
- package/node_modules/@oxygen/shared/dist/vercel-sandbox-fetch.d.ts +9 -0
- package/node_modules/@oxygen/shared/dist/vercel-sandbox-fetch.js +33 -0
- package/node_modules/@oxygen/shared/dist/version.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/version.js +1 -1
- package/node_modules/@oxygen/shared/dist/visual-render.d.ts +30 -0
- package/node_modules/@oxygen/shared/dist/visual-render.js +55 -0
- package/node_modules/@oxygen/shared/dist/workspace-file-storage.d.ts +43 -0
- package/node_modules/@oxygen/shared/dist/workspace-file-storage.js +126 -0
- package/node_modules/@oxygen/shared/package.json +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
import { requestOxygen } from "./http-client.js";
|
|
2
|
+
function parseField(value, field) {
|
|
3
|
+
if (field.kind === "array" || field.kind === "object") {
|
|
4
|
+
const parsed = JSON.parse(String(value));
|
|
5
|
+
if (field.kind === "array"
|
|
6
|
+
? !Array.isArray(parsed) ||
|
|
7
|
+
!parsed.every((item) => typeof item === "string")
|
|
8
|
+
: !parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
9
|
+
throw new Error(`${field.name} must be a JSON ${field.kind === "array" ? "array of strings" : "object"}.`);
|
|
10
|
+
return parsed;
|
|
11
|
+
}
|
|
12
|
+
if (field.kind === "number") {
|
|
13
|
+
const parsed = Number(value);
|
|
14
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
15
|
+
throw new Error(`${field.name} must be a nonnegative finite number.`);
|
|
16
|
+
return parsed;
|
|
17
|
+
}
|
|
18
|
+
if (field.kind === "boolean") {
|
|
19
|
+
if (value === true || value === "true")
|
|
20
|
+
return true;
|
|
21
|
+
if (value === false || value === "false")
|
|
22
|
+
return false;
|
|
23
|
+
throw new Error(`${field.name} must be true or false.`);
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
export function registerUgcCommands(program, handle) {
|
|
28
|
+
const ugc = program
|
|
29
|
+
.command("ugc")
|
|
30
|
+
.description("Manage UGC programs and independent creator participations: briefs, voice, posts, approvals, sponsorship and bounded amplification. Requires UGC availability.");
|
|
31
|
+
const groups = new Map();
|
|
32
|
+
const group = (name) => {
|
|
33
|
+
let command = groups.get(name);
|
|
34
|
+
if (!command) {
|
|
35
|
+
command = ugc.command(name);
|
|
36
|
+
groups.set(name, command);
|
|
37
|
+
}
|
|
38
|
+
return command;
|
|
39
|
+
};
|
|
40
|
+
group("programs")
|
|
41
|
+
.command("list")
|
|
42
|
+
.description("Read UGC programs in the active workspace. Read-only.")
|
|
43
|
+
.option("--program-id <id>", "Program ID.")
|
|
44
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
45
|
+
.option("--json", "Print a JSON envelope.")
|
|
46
|
+
.action((options) => handle("ugc programs list", options, () => {
|
|
47
|
+
const query = new URLSearchParams({ view: "programs" });
|
|
48
|
+
if (options.programId)
|
|
49
|
+
query.set("program_id", String(options.programId));
|
|
50
|
+
if (options.participationId)
|
|
51
|
+
query.set("participation_id", String(options.participationId));
|
|
52
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
53
|
+
}));
|
|
54
|
+
group("programs")
|
|
55
|
+
.command("get")
|
|
56
|
+
.description("Read UGC program in the active workspace. Read-only.")
|
|
57
|
+
.requiredOption("--program-id <id>", "Program ID.")
|
|
58
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
59
|
+
.option("--json", "Print a JSON envelope.")
|
|
60
|
+
.action((options) => handle("ugc programs get", options, () => {
|
|
61
|
+
const query = new URLSearchParams({ view: "program" });
|
|
62
|
+
if (options.programId)
|
|
63
|
+
query.set("program_id", String(options.programId));
|
|
64
|
+
if (options.participationId)
|
|
65
|
+
query.set("participation_id", String(options.participationId));
|
|
66
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
67
|
+
}));
|
|
68
|
+
group("creators")
|
|
69
|
+
.command("list")
|
|
70
|
+
.description("Read UGC participations in the active workspace. Read-only.")
|
|
71
|
+
.option("--program-id <id>", "Program ID.")
|
|
72
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
73
|
+
.option("--json", "Print a JSON envelope.")
|
|
74
|
+
.action((options) => handle("ugc creators list", options, () => {
|
|
75
|
+
const query = new URLSearchParams({ view: "participations" });
|
|
76
|
+
if (options.programId)
|
|
77
|
+
query.set("program_id", String(options.programId));
|
|
78
|
+
if (options.participationId)
|
|
79
|
+
query.set("participation_id", String(options.participationId));
|
|
80
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
81
|
+
}));
|
|
82
|
+
group("briefs")
|
|
83
|
+
.command("list")
|
|
84
|
+
.description("Read one program's UGC briefs. Read-only; requires --program-id.")
|
|
85
|
+
.showHelpAfterError(`Briefs belong to a program. Run \`${program.name() || "oxygen"} ugc programs list --json\` to find its ID, then \`${program.name() || "oxygen"} ugc briefs list --program-id <id> --json\`.`)
|
|
86
|
+
.requiredOption("--program-id <id>", "Program ID.")
|
|
87
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
88
|
+
.option("--json", "Print a JSON envelope.")
|
|
89
|
+
.action((options) => handle("ugc briefs list", options, () => {
|
|
90
|
+
const query = new URLSearchParams({ view: "briefs" });
|
|
91
|
+
if (options.programId)
|
|
92
|
+
query.set("program_id", String(options.programId));
|
|
93
|
+
if (options.participationId)
|
|
94
|
+
query.set("participation_id", String(options.participationId));
|
|
95
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
96
|
+
}));
|
|
97
|
+
group("posts")
|
|
98
|
+
.command("list")
|
|
99
|
+
.description("Read UGC posts in the active workspace. Read-only.")
|
|
100
|
+
.requiredOption("--program-id <id>", "Program ID.")
|
|
101
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
102
|
+
.option("--cursor <cursor>", "Opaque next_cursor from the previous page.")
|
|
103
|
+
.option("--limit <count>", "Posts per page, 1–500.")
|
|
104
|
+
.option("--json", "Print a JSON envelope.")
|
|
105
|
+
.action((options) => handle("ugc posts list", options, () => {
|
|
106
|
+
const query = new URLSearchParams({ view: "posts" });
|
|
107
|
+
if (options.programId)
|
|
108
|
+
query.set("program_id", String(options.programId));
|
|
109
|
+
if (options.participationId)
|
|
110
|
+
query.set("participation_id", String(options.participationId));
|
|
111
|
+
if (options.cursor)
|
|
112
|
+
query.set("cursor", String(options.cursor));
|
|
113
|
+
if (options.limit)
|
|
114
|
+
query.set("limit", String(options.limit));
|
|
115
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
116
|
+
}));
|
|
117
|
+
group("analytics")
|
|
118
|
+
.command("get")
|
|
119
|
+
.description("Read UGC analytics in the active workspace. Read-only.")
|
|
120
|
+
.requiredOption("--program-id <id>", "Program ID.")
|
|
121
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
122
|
+
.option("--json", "Print a JSON envelope.")
|
|
123
|
+
.action((options) => handle("ugc analytics get", options, () => {
|
|
124
|
+
const query = new URLSearchParams({ view: "analytics" });
|
|
125
|
+
if (options.programId)
|
|
126
|
+
query.set("program_id", String(options.programId));
|
|
127
|
+
if (options.participationId)
|
|
128
|
+
query.set("participation_id", String(options.participationId));
|
|
129
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
130
|
+
}));
|
|
131
|
+
group("knowledge")
|
|
132
|
+
.command("list")
|
|
133
|
+
.description("Read UGC knowledge in the active workspace. Read-only.")
|
|
134
|
+
.requiredOption("--program-id <id>", "Program ID.")
|
|
135
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
136
|
+
.option("--json", "Print a JSON envelope.")
|
|
137
|
+
.action((options) => handle("ugc knowledge list", options, () => {
|
|
138
|
+
const query = new URLSearchParams({ view: "knowledge" });
|
|
139
|
+
if (options.programId)
|
|
140
|
+
query.set("program_id", String(options.programId));
|
|
141
|
+
if (options.participationId)
|
|
142
|
+
query.set("participation_id", String(options.participationId));
|
|
143
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
144
|
+
}));
|
|
145
|
+
group("voice")
|
|
146
|
+
.command("get")
|
|
147
|
+
.description("Read UGC voice in the active workspace. Read-only.")
|
|
148
|
+
.option("--program-id <id>", "Program ID.")
|
|
149
|
+
.requiredOption("--participation-id <id>", "Creator participation ID.")
|
|
150
|
+
.option("--json", "Print a JSON envelope.")
|
|
151
|
+
.action((options) => handle("ugc voice get", options, () => {
|
|
152
|
+
const query = new URLSearchParams({ view: "voice" });
|
|
153
|
+
if (options.programId)
|
|
154
|
+
query.set("program_id", String(options.programId));
|
|
155
|
+
if (options.participationId)
|
|
156
|
+
query.set("participation_id", String(options.participationId));
|
|
157
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
158
|
+
}));
|
|
159
|
+
group("sponsorship")
|
|
160
|
+
.command("get")
|
|
161
|
+
.description("Read UGC sponsorship in the active workspace. Read-only.")
|
|
162
|
+
.requiredOption("--program-id <id>", "Program ID.")
|
|
163
|
+
.option("--participation-id <id>", "Creator participation ID.")
|
|
164
|
+
.option("--json", "Print a JSON envelope.")
|
|
165
|
+
.action((options) => handle("ugc sponsorship get", options, () => {
|
|
166
|
+
const query = new URLSearchParams({ view: "sponsorship" });
|
|
167
|
+
if (options.programId)
|
|
168
|
+
query.set("program_id", String(options.programId));
|
|
169
|
+
if (options.participationId)
|
|
170
|
+
query.set("participation_id", String(options.participationId));
|
|
171
|
+
return requestOxygen(`/api/cli/ugc?${query}`);
|
|
172
|
+
}));
|
|
173
|
+
const writes = [
|
|
174
|
+
{
|
|
175
|
+
action: "program_create",
|
|
176
|
+
command: "programs create",
|
|
177
|
+
description: "Create a master UGC program. Free: 0 credits, no provider call.",
|
|
178
|
+
fields: [
|
|
179
|
+
{
|
|
180
|
+
name: "name",
|
|
181
|
+
kind: "string",
|
|
182
|
+
description: "Program name.",
|
|
183
|
+
required: true,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "product_url",
|
|
187
|
+
kind: "string",
|
|
188
|
+
description: "Product website URL.",
|
|
189
|
+
required: true,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "description",
|
|
193
|
+
kind: "string",
|
|
194
|
+
description: "Program description.",
|
|
195
|
+
required: false,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "knowledge_slugs",
|
|
199
|
+
kind: "array",
|
|
200
|
+
description: "Selected live master wiki slugs shared with creators; empty array clears sharing.",
|
|
201
|
+
required: false,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "brand_approval_required",
|
|
205
|
+
kind: "boolean",
|
|
206
|
+
description: "Require a separate brand approval before publishing.",
|
|
207
|
+
required: false,
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
action: "program_update",
|
|
213
|
+
command: "programs update",
|
|
214
|
+
description: "Update program settings and selected shared knowledge.",
|
|
215
|
+
fields: [
|
|
216
|
+
{
|
|
217
|
+
name: "program_id",
|
|
218
|
+
kind: "string",
|
|
219
|
+
description: "Program ID.",
|
|
220
|
+
required: true,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "name",
|
|
224
|
+
kind: "string",
|
|
225
|
+
description: "Program name.",
|
|
226
|
+
required: false,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "product_url",
|
|
230
|
+
kind: "string",
|
|
231
|
+
description: "Product website URL.",
|
|
232
|
+
required: false,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "description",
|
|
236
|
+
kind: "string",
|
|
237
|
+
description: "Program description.",
|
|
238
|
+
required: false,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: "knowledge_slugs",
|
|
242
|
+
kind: "array",
|
|
243
|
+
description: "Selected live master wiki slugs shared with creators; empty array clears sharing.",
|
|
244
|
+
required: false,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "brand_approval_required",
|
|
248
|
+
kind: "boolean",
|
|
249
|
+
description: "Require a separate brand approval before publishing.",
|
|
250
|
+
required: false,
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "status",
|
|
254
|
+
kind: "string",
|
|
255
|
+
description: "Program status, or revoked for a participation.",
|
|
256
|
+
required: false,
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
action: "invite_create",
|
|
262
|
+
command: "creators invite",
|
|
263
|
+
description: "Create a shareable invite for an independent creator. No email is sent.",
|
|
264
|
+
fields: [
|
|
265
|
+
{
|
|
266
|
+
name: "program_id",
|
|
267
|
+
kind: "string",
|
|
268
|
+
description: "Program ID.",
|
|
269
|
+
required: true,
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "email",
|
|
273
|
+
kind: "string",
|
|
274
|
+
description: "Invitee email. Returns a shareable invitation; does not send email.",
|
|
275
|
+
required: true,
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
action: "invite_revoke",
|
|
281
|
+
command: "creators revoke-invite",
|
|
282
|
+
description: "Revoke an unaccepted invitation.",
|
|
283
|
+
fields: [
|
|
284
|
+
{
|
|
285
|
+
name: "program_id",
|
|
286
|
+
kind: "string",
|
|
287
|
+
description: "Program ID.",
|
|
288
|
+
required: true,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "invitation_id",
|
|
292
|
+
kind: "string",
|
|
293
|
+
description: "Exact invitation ID to revoke.",
|
|
294
|
+
required: true,
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
action: "invite_accept",
|
|
300
|
+
command: "creators accept",
|
|
301
|
+
description: "Accept an exact invitation in the creator workspace and choose who may approve.",
|
|
302
|
+
fields: [
|
|
303
|
+
{
|
|
304
|
+
name: "token",
|
|
305
|
+
kind: "string",
|
|
306
|
+
description: "Exact invitation token.",
|
|
307
|
+
required: true,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "approval_mode",
|
|
311
|
+
kind: "string",
|
|
312
|
+
description: "creator: creator approves; delegated: master operators may approve and schedule.",
|
|
313
|
+
required: true,
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: "linkedin_url",
|
|
317
|
+
kind: "string",
|
|
318
|
+
description: "Creator LinkedIn profile URL.",
|
|
319
|
+
required: true,
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
action: "participation_update",
|
|
325
|
+
command: "creators update",
|
|
326
|
+
description: "Connect an existing LinkedIn sender, change approval authority, or revoke participation.",
|
|
327
|
+
fields: [
|
|
328
|
+
{
|
|
329
|
+
name: "participation_id",
|
|
330
|
+
kind: "string",
|
|
331
|
+
description: "Creator participation ID.",
|
|
332
|
+
required: true,
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: "approval_mode",
|
|
336
|
+
kind: "string",
|
|
337
|
+
description: "creator: creator approves; delegated: master operators may approve and schedule.",
|
|
338
|
+
required: false,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "sender_account_id",
|
|
342
|
+
kind: "string",
|
|
343
|
+
description: "Existing physical LinkedIn connection ID; reused across programs.",
|
|
344
|
+
required: false,
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: "status",
|
|
348
|
+
kind: "string",
|
|
349
|
+
description: "Program status, or revoked for a participation.",
|
|
350
|
+
required: false,
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
action: "brief_create",
|
|
356
|
+
command: "briefs create",
|
|
357
|
+
description: "Create a brief with ordered questions. Free: 0 credits, no provider call.",
|
|
358
|
+
fields: [
|
|
359
|
+
{
|
|
360
|
+
name: "program_id",
|
|
361
|
+
kind: "string",
|
|
362
|
+
description: "Program ID.",
|
|
363
|
+
required: true,
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "title",
|
|
367
|
+
kind: "string",
|
|
368
|
+
description: "Brief or post title.",
|
|
369
|
+
required: true,
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: "prompt",
|
|
373
|
+
kind: "string",
|
|
374
|
+
description: "Instructions for this brief.",
|
|
375
|
+
required: true,
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: "questions",
|
|
379
|
+
kind: "array",
|
|
380
|
+
description: "Ordered questions for the creator.",
|
|
381
|
+
required: true,
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: "cycle",
|
|
385
|
+
kind: "string",
|
|
386
|
+
description: "Brief cycle label.",
|
|
387
|
+
required: false,
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
action: "brief_update",
|
|
393
|
+
command: "briefs update",
|
|
394
|
+
description: "Update a program brief.",
|
|
395
|
+
fields: [
|
|
396
|
+
{
|
|
397
|
+
name: "program_id",
|
|
398
|
+
kind: "string",
|
|
399
|
+
description: "Program ID.",
|
|
400
|
+
required: true,
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "brief_id",
|
|
404
|
+
kind: "string",
|
|
405
|
+
description: "Brief ID.",
|
|
406
|
+
required: true,
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
name: "title",
|
|
410
|
+
kind: "string",
|
|
411
|
+
description: "Brief or post title.",
|
|
412
|
+
required: false,
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "prompt",
|
|
416
|
+
kind: "string",
|
|
417
|
+
description: "Instructions for this brief.",
|
|
418
|
+
required: false,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: "questions",
|
|
422
|
+
kind: "array",
|
|
423
|
+
description: "Ordered questions for the creator.",
|
|
424
|
+
required: false,
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: "cycle",
|
|
428
|
+
kind: "string",
|
|
429
|
+
description: "Brief cycle label.",
|
|
430
|
+
required: false,
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
action: "post_enroll",
|
|
436
|
+
command: "posts enroll",
|
|
437
|
+
description: "Enroll one existing creator-owned post in this participation.",
|
|
438
|
+
fields: [
|
|
439
|
+
{
|
|
440
|
+
name: "participation_id",
|
|
441
|
+
kind: "string",
|
|
442
|
+
description: "Creator participation ID.",
|
|
443
|
+
required: true,
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: "post_id",
|
|
447
|
+
kind: "string",
|
|
448
|
+
description: "Canonical post ID.",
|
|
449
|
+
required: true,
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
action: "draft_create",
|
|
455
|
+
command: "posts draft",
|
|
456
|
+
description: "Preview AI drafting from brief answers; execute only with approved and a credit ceiling.",
|
|
457
|
+
fields: [
|
|
458
|
+
{
|
|
459
|
+
name: "participation_id",
|
|
460
|
+
kind: "string",
|
|
461
|
+
description: "Creator participation ID.",
|
|
462
|
+
required: true,
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: "brief_id",
|
|
466
|
+
kind: "string",
|
|
467
|
+
description: "Brief ID.",
|
|
468
|
+
required: true,
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: "answers",
|
|
472
|
+
kind: "array",
|
|
473
|
+
description: "Answers in brief question order.",
|
|
474
|
+
required: true,
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "approved",
|
|
478
|
+
kind: "boolean",
|
|
479
|
+
description: "Explicit authorization of the exact preview or approval. Never inferred.",
|
|
480
|
+
required: false,
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
name: "max_credits",
|
|
484
|
+
kind: "number",
|
|
485
|
+
description: "Explicit credit ceiling from preview.",
|
|
486
|
+
required: false,
|
|
487
|
+
},
|
|
488
|
+
],
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
action: "post_update",
|
|
492
|
+
command: "posts update",
|
|
493
|
+
description: "Edit or schedule an enrolled post with creator or delegated authority; publishing gates still apply.",
|
|
494
|
+
fields: [
|
|
495
|
+
{
|
|
496
|
+
name: "program_id",
|
|
497
|
+
kind: "string",
|
|
498
|
+
description: "Program ID.",
|
|
499
|
+
required: true,
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "post_id",
|
|
503
|
+
kind: "string",
|
|
504
|
+
description: "Canonical post ID.",
|
|
505
|
+
required: true,
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: "title",
|
|
509
|
+
kind: "string",
|
|
510
|
+
description: "Brief or post title.",
|
|
511
|
+
required: false,
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: "content_text",
|
|
515
|
+
kind: "string",
|
|
516
|
+
description: "Edited post text.",
|
|
517
|
+
required: false,
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
name: "scheduled_for",
|
|
521
|
+
kind: "string",
|
|
522
|
+
description: "Future ISO-8601 publishing time with timezone.",
|
|
523
|
+
required: false,
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
action: "post_approve",
|
|
529
|
+
command: "posts approve",
|
|
530
|
+
description: "Record creator or explicitly delegated operator approval of the current post.",
|
|
531
|
+
fields: [
|
|
532
|
+
{
|
|
533
|
+
name: "program_id",
|
|
534
|
+
kind: "string",
|
|
535
|
+
description: "Program ID.",
|
|
536
|
+
required: true,
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "post_id",
|
|
540
|
+
kind: "string",
|
|
541
|
+
description: "Canonical post ID.",
|
|
542
|
+
required: true,
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
name: "source_revision",
|
|
546
|
+
kind: "string",
|
|
547
|
+
description: "Exact reviewed content fingerprint returned by posts list.",
|
|
548
|
+
required: true,
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "approved",
|
|
552
|
+
kind: "boolean",
|
|
553
|
+
description: "Explicit authorization of the exact preview or approval. Never inferred.",
|
|
554
|
+
required: true,
|
|
555
|
+
},
|
|
556
|
+
],
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
action: "brand_approve",
|
|
560
|
+
command: "posts brand-approve",
|
|
561
|
+
description: "Record separate master brand approval of the current post.",
|
|
562
|
+
fields: [
|
|
563
|
+
{
|
|
564
|
+
name: "program_id",
|
|
565
|
+
kind: "string",
|
|
566
|
+
description: "Program ID.",
|
|
567
|
+
required: true,
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
name: "post_id",
|
|
571
|
+
kind: "string",
|
|
572
|
+
description: "Canonical post ID.",
|
|
573
|
+
required: true,
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: "source_revision",
|
|
577
|
+
kind: "string",
|
|
578
|
+
description: "Exact reviewed content fingerprint returned by posts list.",
|
|
579
|
+
required: true,
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: "approved",
|
|
583
|
+
kind: "boolean",
|
|
584
|
+
description: "Explicit authorization of the exact preview or approval. Never inferred.",
|
|
585
|
+
required: true,
|
|
586
|
+
},
|
|
587
|
+
],
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
action: "voice_import",
|
|
591
|
+
command: "voice import",
|
|
592
|
+
description: "Preview LinkedIn voice import; execute only with approved and a credit ceiling.",
|
|
593
|
+
fields: [
|
|
594
|
+
{
|
|
595
|
+
name: "participation_id",
|
|
596
|
+
kind: "string",
|
|
597
|
+
description: "Creator participation ID.",
|
|
598
|
+
required: true,
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: "approved",
|
|
602
|
+
kind: "boolean",
|
|
603
|
+
description: "Explicit authorization of the exact preview or approval. Never inferred.",
|
|
604
|
+
required: false,
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
name: "max_credits",
|
|
608
|
+
kind: "number",
|
|
609
|
+
description: "Explicit credit ceiling from preview.",
|
|
610
|
+
required: false,
|
|
611
|
+
},
|
|
612
|
+
],
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
action: "sponsorship_preview",
|
|
616
|
+
command: "sponsorship preview",
|
|
617
|
+
description: "Preview seat charges and monthly 10,000-credit creator grants for this program.",
|
|
618
|
+
fields: [
|
|
619
|
+
{
|
|
620
|
+
name: "program_id",
|
|
621
|
+
kind: "string",
|
|
622
|
+
description: "Program ID.",
|
|
623
|
+
required: true,
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: "participation_ids",
|
|
627
|
+
kind: "array",
|
|
628
|
+
description: "Exact creator participation IDs to sponsor.",
|
|
629
|
+
required: true,
|
|
630
|
+
},
|
|
631
|
+
],
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
action: "sponsorship_confirm",
|
|
635
|
+
command: "sponsorship confirm",
|
|
636
|
+
description: "Approve the exact sponsorship quote; each master program pays separately even for the same account.",
|
|
637
|
+
fields: [
|
|
638
|
+
{
|
|
639
|
+
name: "program_id",
|
|
640
|
+
kind: "string",
|
|
641
|
+
description: "Program ID.",
|
|
642
|
+
required: true,
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: "participation_ids",
|
|
646
|
+
kind: "array",
|
|
647
|
+
description: "Exact creator participation IDs to sponsor.",
|
|
648
|
+
required: true,
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: "quote",
|
|
652
|
+
kind: "string",
|
|
653
|
+
description: "Exact sponsorship quote returned by preview.",
|
|
654
|
+
required: true,
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "approved",
|
|
658
|
+
kind: "boolean",
|
|
659
|
+
description: "Explicit authorization of the exact preview or approval. Never inferred.",
|
|
660
|
+
required: true,
|
|
661
|
+
},
|
|
662
|
+
],
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
action: "amplification_save",
|
|
666
|
+
command: "amplification save",
|
|
667
|
+
description: "Save exact opted-in sender scope and bounded post-specific amplification. Enabling needs explicit approval.",
|
|
668
|
+
fields: [
|
|
669
|
+
{
|
|
670
|
+
name: "program_id",
|
|
671
|
+
kind: "string",
|
|
672
|
+
description: "Program ID.",
|
|
673
|
+
required: true,
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: "participant_sender_ids",
|
|
677
|
+
kind: "array",
|
|
678
|
+
description: "Exact opted-in participant sender IDs.",
|
|
679
|
+
required: true,
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "actions",
|
|
683
|
+
kind: "array",
|
|
684
|
+
description: "Allowed post-specific amplification actions.",
|
|
685
|
+
required: true,
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
name: "enabled",
|
|
689
|
+
kind: "boolean",
|
|
690
|
+
description: "Enable the bounded amplification policy.",
|
|
691
|
+
required: true,
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
name: "max_actions_per_post",
|
|
695
|
+
kind: "number",
|
|
696
|
+
description: "Hard limit for amplification actions on each enrolled published post.",
|
|
697
|
+
required: true,
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
name: "max_credits_per_cycle",
|
|
701
|
+
kind: "number",
|
|
702
|
+
description: "Hard credit ceiling for the amplification cycle.",
|
|
703
|
+
required: true,
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
name: "approved",
|
|
707
|
+
kind: "boolean",
|
|
708
|
+
description: "Explicit authorization of the exact preview or approval. Never inferred.",
|
|
709
|
+
required: false,
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
name: "delay_min_seconds",
|
|
713
|
+
kind: "number",
|
|
714
|
+
description: "Minimum amplification delay, 60–3600 seconds.",
|
|
715
|
+
required: false,
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
name: "delay_max_seconds",
|
|
719
|
+
kind: "number",
|
|
720
|
+
description: "Maximum amplification delay, 60–86400 seconds.",
|
|
721
|
+
required: false,
|
|
722
|
+
},
|
|
723
|
+
],
|
|
724
|
+
},
|
|
725
|
+
];
|
|
726
|
+
for (const spec of writes) {
|
|
727
|
+
const [family, leaf] = spec.command.split(" ");
|
|
728
|
+
const command = group(family).command(leaf).description(spec.description);
|
|
729
|
+
for (const field of spec.fields) {
|
|
730
|
+
const flag = `--${field.name.replaceAll("_", "-")}${field.name === "approved" ? "" : ` <${field.kind === "array" || field.kind === "object" ? "json" : field.kind === "boolean" ? "true|false" : "value"}>`}`;
|
|
731
|
+
if (field.required)
|
|
732
|
+
command.requiredOption(flag, field.description);
|
|
733
|
+
else
|
|
734
|
+
command.option(flag, field.description);
|
|
735
|
+
}
|
|
736
|
+
command
|
|
737
|
+
.option("--json", "Print a JSON envelope.")
|
|
738
|
+
.action((options) => handle(`ugc ${spec.command}`, options, () => {
|
|
739
|
+
const body = { action: spec.action };
|
|
740
|
+
for (const field of spec.fields) {
|
|
741
|
+
const key = field.name.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
742
|
+
if (options[key] !== undefined)
|
|
743
|
+
body[field.name] = parseField(options[key], field);
|
|
744
|
+
}
|
|
745
|
+
return requestOxygen("/api/cli/ugc", { method: "POST", body });
|
|
746
|
+
}));
|
|
747
|
+
}
|
|
748
|
+
}
|