@pmate/cli 0.24.42 → 0.24.43
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/dist/index.d.ts +7 -0
- package/dist/index.js +361 -135
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -564,6 +564,13 @@ type CollectCommandArgs = {
|
|
|
564
564
|
action: "sync";
|
|
565
565
|
source?: "cc" | "yelling";
|
|
566
566
|
endpoint?: string;
|
|
567
|
+
} | {
|
|
568
|
+
type: Command.Collect;
|
|
569
|
+
action: "reply";
|
|
570
|
+
source?: "cc" | "yelling";
|
|
571
|
+
endpoint?: string;
|
|
572
|
+
thread: string;
|
|
573
|
+
text: string;
|
|
567
574
|
};
|
|
568
575
|
type ChatRoomCommonArgs = {
|
|
569
576
|
type: Command.ChatRoom;
|
package/dist/index.js
CHANGED
|
@@ -16092,6 +16092,13 @@ function normalizeStoredMessage(message) {
|
|
|
16092
16092
|
// src/commands/CollectCommandHandler.ts
|
|
16093
16093
|
var CollectCommandHandler = class {
|
|
16094
16094
|
async handle(args) {
|
|
16095
|
+
if (args.action === "reply") {
|
|
16096
|
+
await this.handleReply(args);
|
|
16097
|
+
return;
|
|
16098
|
+
}
|
|
16099
|
+
await this.handleSync(args);
|
|
16100
|
+
}
|
|
16101
|
+
async handleSync(args) {
|
|
16095
16102
|
let browser = null;
|
|
16096
16103
|
try {
|
|
16097
16104
|
const target = resolveCollectTarget(args);
|
|
@@ -16156,6 +16163,32 @@ var CollectCommandHandler = class {
|
|
|
16156
16163
|
await browser?.close().catch(() => void 0);
|
|
16157
16164
|
}
|
|
16158
16165
|
}
|
|
16166
|
+
async handleReply(args) {
|
|
16167
|
+
let browser = null;
|
|
16168
|
+
try {
|
|
16169
|
+
const target = resolveCollectTarget(args);
|
|
16170
|
+
browser = await import_playwright.chromium.connectOverCDP(target.endpoint);
|
|
16171
|
+
const targetPage = await this.pickTargetPage(
|
|
16172
|
+
browser.contexts().flatMap((context) => context.pages())
|
|
16173
|
+
);
|
|
16174
|
+
if (!targetPage) {
|
|
16175
|
+
throw new Error("Cannot find target page from CDP contexts.");
|
|
16176
|
+
}
|
|
16177
|
+
const threads = await this.extractThreadsFromConversationData(targetPage);
|
|
16178
|
+
const thread = findThreadForReply(threads, args.thread);
|
|
16179
|
+
if (!thread) {
|
|
16180
|
+
throw new Error(`Thread not found: ${args.thread}`);
|
|
16181
|
+
}
|
|
16182
|
+
await this.openThreadForReply(targetPage, thread);
|
|
16183
|
+
await this.sendReplyText(targetPage, args.text);
|
|
16184
|
+
ui.success("im1 reply sent", { source: target.sourceKey, thread: thread.name });
|
|
16185
|
+
} catch (error) {
|
|
16186
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16187
|
+
throw new Error(`im1 reply failed: ${message}`);
|
|
16188
|
+
} finally {
|
|
16189
|
+
await browser?.close().catch(() => void 0);
|
|
16190
|
+
}
|
|
16191
|
+
}
|
|
16159
16192
|
async persistThread(rootDir, target, thread, messages2, syncedAt, existing) {
|
|
16160
16193
|
const threadKey = toThreadKey(thread.name);
|
|
16161
16194
|
const incoming = messages2.map((message) => ({
|
|
@@ -16380,6 +16413,48 @@ var CollectCommandHandler = class {
|
|
|
16380
16413
|
await session.detach().catch(() => void 0);
|
|
16381
16414
|
}
|
|
16382
16415
|
}
|
|
16416
|
+
async openThreadForReply(page, thread) {
|
|
16417
|
+
const opened = await this.evaluateInPage(
|
|
16418
|
+
page,
|
|
16419
|
+
buildOpenConversationExpr(thread.conversationId)
|
|
16420
|
+
).catch((error) => ({
|
|
16421
|
+
ok: false,
|
|
16422
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
16423
|
+
}));
|
|
16424
|
+
if (!opened.ok) {
|
|
16425
|
+
await page.getByText(thread.name, { exact: true }).first().click({ timeout: 5e3 });
|
|
16426
|
+
}
|
|
16427
|
+
await page.waitForTimeout(500);
|
|
16428
|
+
}
|
|
16429
|
+
async sendReplyText(page, text) {
|
|
16430
|
+
const selectors = [
|
|
16431
|
+
'[data-testid="CompositionInput"]',
|
|
16432
|
+
'[aria-label="Message"]',
|
|
16433
|
+
'[aria-label="Write a message"]',
|
|
16434
|
+
'[contenteditable="true"]',
|
|
16435
|
+
"textarea"
|
|
16436
|
+
];
|
|
16437
|
+
let focused = false;
|
|
16438
|
+
for (const selector of selectors) {
|
|
16439
|
+
const locator = page.locator(selector).last();
|
|
16440
|
+
if (await locator.count().catch(() => 0) === 0) {
|
|
16441
|
+
continue;
|
|
16442
|
+
}
|
|
16443
|
+
await locator.click({ timeout: 3e3 }).catch(() => void 0);
|
|
16444
|
+
focused = await locator.evaluate((element) => {
|
|
16445
|
+
const activeElement = element.ownerDocument?.activeElement;
|
|
16446
|
+
return activeElement === element || element.contains(activeElement);
|
|
16447
|
+
}).catch(() => false);
|
|
16448
|
+
if (focused) {
|
|
16449
|
+
break;
|
|
16450
|
+
}
|
|
16451
|
+
}
|
|
16452
|
+
if (!focused) {
|
|
16453
|
+
throw new Error("Cannot focus CC message composer.");
|
|
16454
|
+
}
|
|
16455
|
+
await page.keyboard.insertText(text);
|
|
16456
|
+
await page.keyboard.press("Enter");
|
|
16457
|
+
}
|
|
16383
16458
|
};
|
|
16384
16459
|
async function archiveMessageImages(rootDir, sourceKey, threadKey, messages2) {
|
|
16385
16460
|
const attachmentRoot = resolveLocalAttachmentRoot(sourceKey);
|
|
@@ -16633,6 +16708,47 @@ function buildGetMessagesByConversationExpr(conversationId, limit) {
|
|
|
16633
16708
|
}
|
|
16634
16709
|
})()`;
|
|
16635
16710
|
}
|
|
16711
|
+
function buildOpenConversationExpr(conversationId) {
|
|
16712
|
+
const escapedConversationId = escapeForJs(conversationId);
|
|
16713
|
+
return `(async function() {
|
|
16714
|
+
try {
|
|
16715
|
+
var runtime = globalThis;
|
|
16716
|
+
var controller = runtime.ConversationController;
|
|
16717
|
+
var conversationId = '${escapedConversationId}';
|
|
16718
|
+
var conversation = controller && typeof controller.get === 'function' ? controller.get(conversationId) : null;
|
|
16719
|
+
if (!conversation) return { ok: false, reason: 'Conversation not found: ' + conversationId };
|
|
16720
|
+
if (runtime.reduxActions && runtime.reduxActions.conversations) {
|
|
16721
|
+
var actions = runtime.reduxActions.conversations;
|
|
16722
|
+
if (typeof actions.showConversation === 'function') {
|
|
16723
|
+
await actions.showConversation({ conversationId: conversationId });
|
|
16724
|
+
return { ok: true };
|
|
16725
|
+
}
|
|
16726
|
+
if (typeof actions.conversationOpened === 'function') {
|
|
16727
|
+
await actions.conversationOpened({ conversationId: conversationId });
|
|
16728
|
+
return { ok: true };
|
|
16729
|
+
}
|
|
16730
|
+
}
|
|
16731
|
+
if (typeof conversation.trigger === 'function') {
|
|
16732
|
+
conversation.trigger('opened', conversation);
|
|
16733
|
+
return { ok: true };
|
|
16734
|
+
}
|
|
16735
|
+
return { ok: false, reason: 'No supported conversation open API found' };
|
|
16736
|
+
} catch(e) {
|
|
16737
|
+
return { ok: false, reason: e && e.message ? e.message : String(e) };
|
|
16738
|
+
}
|
|
16739
|
+
})()`;
|
|
16740
|
+
}
|
|
16741
|
+
function findThreadForReply(threads, query) {
|
|
16742
|
+
const normalizedQuery = normalizeText(query).toLowerCase();
|
|
16743
|
+
if (!normalizedQuery) {
|
|
16744
|
+
return null;
|
|
16745
|
+
}
|
|
16746
|
+
const exact = threads.find((thread) => thread.name.toLowerCase() === normalizedQuery);
|
|
16747
|
+
if (exact) {
|
|
16748
|
+
return exact;
|
|
16749
|
+
}
|
|
16750
|
+
return threads.find((thread) => thread.name.toLowerCase().includes(normalizedQuery)) ?? null;
|
|
16751
|
+
}
|
|
16636
16752
|
function escapeForJs(value) {
|
|
16637
16753
|
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r");
|
|
16638
16754
|
}
|
|
@@ -25107,6 +25223,110 @@ function requireValue10(tokens, optionName) {
|
|
|
25107
25223
|
return value;
|
|
25108
25224
|
}
|
|
25109
25225
|
|
|
25226
|
+
// src/im1CommandParser.ts
|
|
25227
|
+
function parseIm1Args(tokens) {
|
|
25228
|
+
const rest = [...tokens];
|
|
25229
|
+
const action = rest.shift();
|
|
25230
|
+
if (!action) {
|
|
25231
|
+
throw new Error("Usage: im1 collect sync (--source <cc|yelling> | --endpoint <url>) | im1 reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)");
|
|
25232
|
+
}
|
|
25233
|
+
if (action === "collect") {
|
|
25234
|
+
return parseIm1CollectArgs(rest);
|
|
25235
|
+
}
|
|
25236
|
+
if (action === "reply") {
|
|
25237
|
+
return parseIm1ReplyArgs(rest);
|
|
25238
|
+
}
|
|
25239
|
+
throw new Error(`Unknown im1 action: ${action}`);
|
|
25240
|
+
}
|
|
25241
|
+
function parseIm1CollectArgs(tokens) {
|
|
25242
|
+
const rest = [...tokens];
|
|
25243
|
+
const action = rest.shift();
|
|
25244
|
+
if (action !== "sync") {
|
|
25245
|
+
throw new Error("Usage: im1 collect sync (--source <cc|yelling> | --endpoint <url>)");
|
|
25246
|
+
}
|
|
25247
|
+
const target = parseTargetOptions(rest);
|
|
25248
|
+
if (!target.source && !target.endpoint) {
|
|
25249
|
+
throw new Error("Usage: im1 collect sync (--source <cc|yelling> | --endpoint <url>)");
|
|
25250
|
+
}
|
|
25251
|
+
return {
|
|
25252
|
+
type: "collect" /* Collect */,
|
|
25253
|
+
action: "sync",
|
|
25254
|
+
source: target.source,
|
|
25255
|
+
endpoint: target.endpoint
|
|
25256
|
+
};
|
|
25257
|
+
}
|
|
25258
|
+
function parseIm1ReplyArgs(tokens) {
|
|
25259
|
+
const rest = [...tokens];
|
|
25260
|
+
const targetTokens = [];
|
|
25261
|
+
let thread;
|
|
25262
|
+
let text;
|
|
25263
|
+
while (rest.length > 0) {
|
|
25264
|
+
const token = rest.shift();
|
|
25265
|
+
switch (token) {
|
|
25266
|
+
case "--thread":
|
|
25267
|
+
thread = requireValue11(rest, token);
|
|
25268
|
+
break;
|
|
25269
|
+
case "--text":
|
|
25270
|
+
text = requireValue11(rest, token);
|
|
25271
|
+
break;
|
|
25272
|
+
case "--source":
|
|
25273
|
+
case "--endpoint":
|
|
25274
|
+
targetTokens.push(token, requireValue11(rest, token));
|
|
25275
|
+
break;
|
|
25276
|
+
default:
|
|
25277
|
+
throw new Error(`Unknown im1 reply option: ${token}`);
|
|
25278
|
+
}
|
|
25279
|
+
}
|
|
25280
|
+
if (!thread || !text) {
|
|
25281
|
+
throw new Error("Usage: im1 reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)");
|
|
25282
|
+
}
|
|
25283
|
+
const target = parseTargetOptions(targetTokens);
|
|
25284
|
+
if (!target.source && !target.endpoint) {
|
|
25285
|
+
throw new Error("Usage: im1 reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)");
|
|
25286
|
+
}
|
|
25287
|
+
return {
|
|
25288
|
+
type: "collect" /* Collect */,
|
|
25289
|
+
action: "reply",
|
|
25290
|
+
source: target.source,
|
|
25291
|
+
endpoint: target.endpoint,
|
|
25292
|
+
thread,
|
|
25293
|
+
text
|
|
25294
|
+
};
|
|
25295
|
+
}
|
|
25296
|
+
function parseTargetOptions(tokens) {
|
|
25297
|
+
const rest = [...tokens];
|
|
25298
|
+
const options = {};
|
|
25299
|
+
while (rest.length > 0) {
|
|
25300
|
+
const token = rest.shift();
|
|
25301
|
+
switch (token) {
|
|
25302
|
+
case "--source": {
|
|
25303
|
+
const value = requireValue11(rest, token);
|
|
25304
|
+
if (value !== "cc" && value !== "yelling") {
|
|
25305
|
+
throw new Error(`Unsupported im1 source: ${value}`);
|
|
25306
|
+
}
|
|
25307
|
+
options.source = value;
|
|
25308
|
+
break;
|
|
25309
|
+
}
|
|
25310
|
+
case "--endpoint":
|
|
25311
|
+
options.endpoint = requireValue11(rest, token);
|
|
25312
|
+
break;
|
|
25313
|
+
default:
|
|
25314
|
+
throw new Error(`Unknown im1 option: ${token}`);
|
|
25315
|
+
}
|
|
25316
|
+
}
|
|
25317
|
+
if (options.source && options.endpoint) {
|
|
25318
|
+
throw new Error("Use either --source or --endpoint, not both.");
|
|
25319
|
+
}
|
|
25320
|
+
return options;
|
|
25321
|
+
}
|
|
25322
|
+
function requireValue11(tokens, optionName) {
|
|
25323
|
+
const value = tokens.shift();
|
|
25324
|
+
if (!value || value.startsWith("--")) {
|
|
25325
|
+
throw new Error(`Missing value for ${optionName}`);
|
|
25326
|
+
}
|
|
25327
|
+
return value;
|
|
25328
|
+
}
|
|
25329
|
+
|
|
25110
25330
|
// src/chatRoomCommandParser.ts
|
|
25111
25331
|
function parseChatRoomArgs(tokens) {
|
|
25112
25332
|
const rest = [...tokens];
|
|
@@ -25206,12 +25426,12 @@ function parseShared(tokens) {
|
|
|
25206
25426
|
case "--title":
|
|
25207
25427
|
case "--bot-a":
|
|
25208
25428
|
case "--bot-b":
|
|
25209
|
-
options.set(token,
|
|
25429
|
+
options.set(token, requireValue12(tokens, token));
|
|
25210
25430
|
break;
|
|
25211
25431
|
case "--member":
|
|
25212
25432
|
case "--recipient": {
|
|
25213
25433
|
const values = multiOptions.get(token) ?? [];
|
|
25214
|
-
values.push(
|
|
25434
|
+
values.push(requireValue12(tokens, token));
|
|
25215
25435
|
multiOptions.set(token, values);
|
|
25216
25436
|
break;
|
|
25217
25437
|
}
|
|
@@ -25237,7 +25457,7 @@ function requiredOption(options, option) {
|
|
|
25237
25457
|
}
|
|
25238
25458
|
return value;
|
|
25239
25459
|
}
|
|
25240
|
-
function
|
|
25460
|
+
function requireValue12(tokens, option) {
|
|
25241
25461
|
const value = tokens.shift();
|
|
25242
25462
|
if (!value || value.startsWith("--")) {
|
|
25243
25463
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -25272,7 +25492,7 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25272
25492
|
close = true;
|
|
25273
25493
|
break;
|
|
25274
25494
|
case "--env": {
|
|
25275
|
-
const rawValue =
|
|
25495
|
+
const rawValue = requireValue13(rest, token);
|
|
25276
25496
|
const parsed = Number.parseInt(rawValue, 10);
|
|
25277
25497
|
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
25278
25498
|
throw new Error(`Invalid --env value: ${rawValue}`);
|
|
@@ -25281,13 +25501,13 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25281
25501
|
break;
|
|
25282
25502
|
}
|
|
25283
25503
|
case "--env-root":
|
|
25284
|
-
envRoot =
|
|
25504
|
+
envRoot = requireValue13(rest, token);
|
|
25285
25505
|
break;
|
|
25286
25506
|
case "--base-root":
|
|
25287
|
-
baseRoot =
|
|
25507
|
+
baseRoot = requireValue13(rest, token);
|
|
25288
25508
|
break;
|
|
25289
25509
|
case "--note":
|
|
25290
|
-
note =
|
|
25510
|
+
note = requireValue13(rest, token);
|
|
25291
25511
|
break;
|
|
25292
25512
|
case "--json":
|
|
25293
25513
|
json = true;
|
|
@@ -25323,7 +25543,7 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25323
25543
|
json
|
|
25324
25544
|
};
|
|
25325
25545
|
}
|
|
25326
|
-
function
|
|
25546
|
+
function requireValue13(tokens, option) {
|
|
25327
25547
|
const value = tokens.shift();
|
|
25328
25548
|
if (!value || value.startsWith("-")) {
|
|
25329
25549
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -25415,7 +25635,10 @@ var HELP_TEXT = [
|
|
|
25415
25635
|
` ${import_chalk4.default.gray(" [--length <n>] [--charset base64url|hex|alnum|ascii]")}`,
|
|
25416
25636
|
` ${import_chalk4.default.gray(" [--count <n>]")}`,
|
|
25417
25637
|
` ${import_chalk4.default.gray(" --easy [--words <n>] [--digits <n>] [--separator <s>] [--count <n>]")}`,
|
|
25418
|
-
` ${import_chalk4.default.cyan("
|
|
25638
|
+
` ${import_chalk4.default.cyan("im1")} Collect and reply in CC-like Electron chat apps via CDP`,
|
|
25639
|
+
` ${import_chalk4.default.gray(" collect sync (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25640
|
+
` ${import_chalk4.default.gray(" reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25641
|
+
` ${import_chalk4.default.cyan("collect")} Legacy alias for CC/yelling collection`,
|
|
25419
25642
|
` ${import_chalk4.default.gray(" sync (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25420
25643
|
` ${import_chalk4.default.cyan("chat-room")} Run social chat regression commands with PMate bot key JSON`,
|
|
25421
25644
|
` ${import_chalk4.default.gray(" join|request-friend|accept-friend|delete-friend|send|group-create|group-send|smoke --app <ns:app> --bot <file>")}`,
|
|
@@ -25579,10 +25802,10 @@ function parseCommandArgs(args) {
|
|
|
25579
25802
|
const token = rest.shift();
|
|
25580
25803
|
switch (token) {
|
|
25581
25804
|
case "--app":
|
|
25582
|
-
app =
|
|
25805
|
+
app = requireValue14(rest, token);
|
|
25583
25806
|
break;
|
|
25584
25807
|
case "--profile-id":
|
|
25585
|
-
profileId =
|
|
25808
|
+
profileId = requireValue14(rest, token);
|
|
25586
25809
|
break;
|
|
25587
25810
|
default:
|
|
25588
25811
|
throw new Error(`Unknown login option: ${token}`);
|
|
@@ -25644,6 +25867,9 @@ function parseCommandArgs(args) {
|
|
|
25644
25867
|
if (args.rest[0] === "collect") {
|
|
25645
25868
|
return parseCollectArgs(args.rest.slice(1));
|
|
25646
25869
|
}
|
|
25870
|
+
if (args.rest[0] === "im1") {
|
|
25871
|
+
return parseIm1Args(args.rest.slice(1));
|
|
25872
|
+
}
|
|
25647
25873
|
if (args.rest[0] === "chat-room") {
|
|
25648
25874
|
return parseChatRoomArgs(args.rest.slice(1));
|
|
25649
25875
|
}
|
|
@@ -25691,7 +25917,7 @@ function parseVercelArgs(tokens) {
|
|
|
25691
25917
|
const token = rest.shift();
|
|
25692
25918
|
switch (token) {
|
|
25693
25919
|
case "--scope":
|
|
25694
|
-
scope =
|
|
25920
|
+
scope = requireValue14(rest, token);
|
|
25695
25921
|
break;
|
|
25696
25922
|
default:
|
|
25697
25923
|
throw new Error(`Unknown vercel option: ${token}`);
|
|
@@ -25711,10 +25937,10 @@ function parseVercelArgs(tokens) {
|
|
|
25711
25937
|
const token = rest.shift();
|
|
25712
25938
|
switch (token) {
|
|
25713
25939
|
case "--scope":
|
|
25714
|
-
scope =
|
|
25940
|
+
scope = requireValue14(rest, token);
|
|
25715
25941
|
break;
|
|
25716
25942
|
case "--project":
|
|
25717
|
-
project =
|
|
25943
|
+
project = requireValue14(rest, token);
|
|
25718
25944
|
break;
|
|
25719
25945
|
case "--last-week":
|
|
25720
25946
|
lastWeek = true;
|
|
@@ -25745,16 +25971,16 @@ function parseAddDnsArgs(tokens) {
|
|
|
25745
25971
|
const token = rest.shift();
|
|
25746
25972
|
switch (token) {
|
|
25747
25973
|
case "--type":
|
|
25748
|
-
options.dnsType =
|
|
25974
|
+
options.dnsType = requireValue14(rest, token);
|
|
25749
25975
|
break;
|
|
25750
25976
|
case "--value":
|
|
25751
|
-
options.dnsValue =
|
|
25977
|
+
options.dnsValue = requireValue14(rest, token);
|
|
25752
25978
|
break;
|
|
25753
25979
|
case "--rr":
|
|
25754
|
-
options.dnsRr =
|
|
25980
|
+
options.dnsRr = requireValue14(rest, token);
|
|
25755
25981
|
break;
|
|
25756
25982
|
case "--ttl": {
|
|
25757
|
-
const ttlValue =
|
|
25983
|
+
const ttlValue = requireValue14(rest, token);
|
|
25758
25984
|
const ttl = Number.parseInt(ttlValue, 10);
|
|
25759
25985
|
if (!Number.isFinite(ttl) || ttl <= 0) {
|
|
25760
25986
|
throw new Error(`Invalid --ttl value: ${ttlValue}`);
|
|
@@ -25763,7 +25989,7 @@ function parseAddDnsArgs(tokens) {
|
|
|
25763
25989
|
break;
|
|
25764
25990
|
}
|
|
25765
25991
|
case "--domain":
|
|
25766
|
-
options.dnsDomain =
|
|
25992
|
+
options.dnsDomain = requireValue14(rest, token);
|
|
25767
25993
|
break;
|
|
25768
25994
|
default:
|
|
25769
25995
|
throw new Error(`Unknown add-dns option: ${token}`);
|
|
@@ -25796,13 +26022,13 @@ function parseBucketArgs(tokens) {
|
|
|
25796
26022
|
options.bucketCreate = true;
|
|
25797
26023
|
break;
|
|
25798
26024
|
case "--name":
|
|
25799
|
-
options.bucketName =
|
|
26025
|
+
options.bucketName = requireValue14(rest, token);
|
|
25800
26026
|
break;
|
|
25801
26027
|
case "--subdomain":
|
|
25802
|
-
options.bucketSubdomain =
|
|
26028
|
+
options.bucketSubdomain = requireValue14(rest, token);
|
|
25803
26029
|
break;
|
|
25804
26030
|
case "--domain":
|
|
25805
|
-
options.bucketDomain =
|
|
26031
|
+
options.bucketDomain = requireValue14(rest, token);
|
|
25806
26032
|
break;
|
|
25807
26033
|
default:
|
|
25808
26034
|
throw new Error(`Unknown bucket option: ${token}`);
|
|
@@ -25834,7 +26060,7 @@ function parseDevArgs(tokens) {
|
|
|
25834
26060
|
const token = rest.shift();
|
|
25835
26061
|
switch (token) {
|
|
25836
26062
|
case "--cwd":
|
|
25837
|
-
options.devCwd =
|
|
26063
|
+
options.devCwd = requireValue14(rest, token);
|
|
25838
26064
|
break;
|
|
25839
26065
|
default:
|
|
25840
26066
|
throw new Error(`Unknown dev option: ${token}`);
|
|
@@ -25854,7 +26080,7 @@ function parseDeleteArgs(tokens) {
|
|
|
25854
26080
|
const token = rest.shift();
|
|
25855
26081
|
switch (token) {
|
|
25856
26082
|
case "--cwd":
|
|
25857
|
-
deleteCwd =
|
|
26083
|
+
deleteCwd = requireValue14(rest, token);
|
|
25858
26084
|
break;
|
|
25859
26085
|
default:
|
|
25860
26086
|
throw new Error(`Unknown delete option: ${token}`);
|
|
@@ -25888,13 +26114,13 @@ function parseOssArgs(tokens) {
|
|
|
25888
26114
|
const token = rest.shift();
|
|
25889
26115
|
switch (token) {
|
|
25890
26116
|
case "--bucket":
|
|
25891
|
-
bucket =
|
|
26117
|
+
bucket = requireValue14(rest, token);
|
|
25892
26118
|
break;
|
|
25893
26119
|
case "--file":
|
|
25894
|
-
filePath =
|
|
26120
|
+
filePath = requireValue14(rest, token);
|
|
25895
26121
|
break;
|
|
25896
26122
|
case "--key":
|
|
25897
|
-
objectKey =
|
|
26123
|
+
objectKey = requireValue14(rest, token);
|
|
25898
26124
|
break;
|
|
25899
26125
|
default:
|
|
25900
26126
|
throw new Error(`Unknown oss option: ${token}`);
|
|
@@ -25927,7 +26153,7 @@ function parseEnvArgs(tokens) {
|
|
|
25927
26153
|
throw new Error("Only one env action is allowed.");
|
|
25928
26154
|
}
|
|
25929
26155
|
action = "set";
|
|
25930
|
-
key =
|
|
26156
|
+
key = requireValue14(rest, token);
|
|
25931
26157
|
break;
|
|
25932
26158
|
case "--list":
|
|
25933
26159
|
if (action) {
|
|
@@ -25940,17 +26166,17 @@ function parseEnvArgs(tokens) {
|
|
|
25940
26166
|
throw new Error("Only one env action is allowed.");
|
|
25941
26167
|
}
|
|
25942
26168
|
action = "delete";
|
|
25943
|
-
key =
|
|
26169
|
+
key = requireValue14(rest, token);
|
|
25944
26170
|
break;
|
|
25945
26171
|
case "--value":
|
|
25946
|
-
value =
|
|
26172
|
+
value = requireValue14(rest, token);
|
|
25947
26173
|
break;
|
|
25948
26174
|
case "--verbose":
|
|
25949
26175
|
case "-v":
|
|
25950
26176
|
verbose = true;
|
|
25951
26177
|
break;
|
|
25952
26178
|
case "--cwd":
|
|
25953
|
-
cwd =
|
|
26179
|
+
cwd = requireValue14(rest, token);
|
|
25954
26180
|
break;
|
|
25955
26181
|
default:
|
|
25956
26182
|
throw new Error(`Unknown env option: ${token}`);
|
|
@@ -26008,7 +26234,7 @@ function parseCommitArgs(tokens) {
|
|
|
26008
26234
|
push = true;
|
|
26009
26235
|
break;
|
|
26010
26236
|
case "--cwd":
|
|
26011
|
-
cwd =
|
|
26237
|
+
cwd = requireValue14(rest, token);
|
|
26012
26238
|
break;
|
|
26013
26239
|
default:
|
|
26014
26240
|
throw new Error(`Unknown commit option: ${token}`);
|
|
@@ -26024,10 +26250,10 @@ function parseSummaryArgs(tokens) {
|
|
|
26024
26250
|
const token = rest.shift();
|
|
26025
26251
|
switch (token) {
|
|
26026
26252
|
case "--pr":
|
|
26027
|
-
prRef =
|
|
26253
|
+
prRef = requireValue14(rest, token);
|
|
26028
26254
|
break;
|
|
26029
26255
|
case "--cwd":
|
|
26030
|
-
cwd =
|
|
26256
|
+
cwd = requireValue14(rest, token);
|
|
26031
26257
|
break;
|
|
26032
26258
|
default:
|
|
26033
26259
|
throw new Error(`Unknown summary option: ${token}`);
|
|
@@ -26052,13 +26278,13 @@ function parseQuizArgs(tokens) {
|
|
|
26052
26278
|
const token = rest.shift();
|
|
26053
26279
|
switch (token) {
|
|
26054
26280
|
case "--paper-id":
|
|
26055
|
-
paperId =
|
|
26281
|
+
paperId = requireValue14(rest, token);
|
|
26056
26282
|
break;
|
|
26057
26283
|
case "--base-url":
|
|
26058
|
-
apiBaseUrl =
|
|
26284
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26059
26285
|
break;
|
|
26060
26286
|
case "--link-base":
|
|
26061
|
-
linkBaseUrl =
|
|
26287
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26062
26288
|
break;
|
|
26063
26289
|
default:
|
|
26064
26290
|
throw new Error(`Unknown quiz create-draft option: ${token}`);
|
|
@@ -26084,16 +26310,16 @@ function parseQuizArgs(tokens) {
|
|
|
26084
26310
|
const token = rest.shift();
|
|
26085
26311
|
switch (token) {
|
|
26086
26312
|
case "--paper-id":
|
|
26087
|
-
paperId =
|
|
26313
|
+
paperId = requireValue14(rest, token);
|
|
26088
26314
|
break;
|
|
26089
26315
|
case "--file":
|
|
26090
|
-
filePath =
|
|
26316
|
+
filePath = requireValue14(rest, token);
|
|
26091
26317
|
break;
|
|
26092
26318
|
case "--base-url":
|
|
26093
|
-
apiBaseUrl =
|
|
26319
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26094
26320
|
break;
|
|
26095
26321
|
case "--link-base":
|
|
26096
|
-
linkBaseUrl =
|
|
26322
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26097
26323
|
break;
|
|
26098
26324
|
default:
|
|
26099
26325
|
throw new Error(`Unknown quiz update-meta option: ${token}`);
|
|
@@ -26123,16 +26349,16 @@ function parseQuizArgs(tokens) {
|
|
|
26123
26349
|
const token = rest.shift();
|
|
26124
26350
|
switch (token) {
|
|
26125
26351
|
case "--paper-id":
|
|
26126
|
-
paperId =
|
|
26352
|
+
paperId = requireValue14(rest, token);
|
|
26127
26353
|
break;
|
|
26128
26354
|
case "--file":
|
|
26129
|
-
filePath =
|
|
26355
|
+
filePath = requireValue14(rest, token);
|
|
26130
26356
|
break;
|
|
26131
26357
|
case "--base-url":
|
|
26132
|
-
apiBaseUrl =
|
|
26358
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26133
26359
|
break;
|
|
26134
26360
|
case "--link-base":
|
|
26135
|
-
linkBaseUrl =
|
|
26361
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26136
26362
|
break;
|
|
26137
26363
|
default:
|
|
26138
26364
|
throw new Error(`Unknown quiz append-step option: ${token}`);
|
|
@@ -26163,19 +26389,19 @@ function parseQuizArgs(tokens) {
|
|
|
26163
26389
|
const token = rest.shift();
|
|
26164
26390
|
switch (token) {
|
|
26165
26391
|
case "--paper-id":
|
|
26166
|
-
paperId =
|
|
26392
|
+
paperId = requireValue14(rest, token);
|
|
26167
26393
|
break;
|
|
26168
26394
|
case "--step-id":
|
|
26169
|
-
stepId =
|
|
26395
|
+
stepId = requireValue14(rest, token);
|
|
26170
26396
|
break;
|
|
26171
26397
|
case "--file":
|
|
26172
|
-
filePath =
|
|
26398
|
+
filePath = requireValue14(rest, token);
|
|
26173
26399
|
break;
|
|
26174
26400
|
case "--base-url":
|
|
26175
|
-
apiBaseUrl =
|
|
26401
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26176
26402
|
break;
|
|
26177
26403
|
case "--link-base":
|
|
26178
|
-
linkBaseUrl =
|
|
26404
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26179
26405
|
break;
|
|
26180
26406
|
default:
|
|
26181
26407
|
throw new Error(`Unknown quiz update-step option: ${token}`);
|
|
@@ -26209,16 +26435,16 @@ function parseQuizArgs(tokens) {
|
|
|
26209
26435
|
const token = rest.shift();
|
|
26210
26436
|
switch (token) {
|
|
26211
26437
|
case "--paper-id":
|
|
26212
|
-
paperId =
|
|
26438
|
+
paperId = requireValue14(rest, token);
|
|
26213
26439
|
break;
|
|
26214
26440
|
case "--step-ids":
|
|
26215
|
-
stepIdsRaw =
|
|
26441
|
+
stepIdsRaw = requireValue14(rest, token);
|
|
26216
26442
|
break;
|
|
26217
26443
|
case "--base-url":
|
|
26218
|
-
apiBaseUrl =
|
|
26444
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26219
26445
|
break;
|
|
26220
26446
|
case "--link-base":
|
|
26221
|
-
linkBaseUrl =
|
|
26447
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26222
26448
|
break;
|
|
26223
26449
|
default:
|
|
26224
26450
|
throw new Error(`Unknown quiz reorder option: ${token}`);
|
|
@@ -26252,16 +26478,16 @@ function parseQuizArgs(tokens) {
|
|
|
26252
26478
|
const token = rest.shift();
|
|
26253
26479
|
switch (token) {
|
|
26254
26480
|
case "--paper-id":
|
|
26255
|
-
paperId =
|
|
26481
|
+
paperId = requireValue14(rest, token);
|
|
26256
26482
|
break;
|
|
26257
26483
|
case "--step-id":
|
|
26258
|
-
stepId =
|
|
26484
|
+
stepId = requireValue14(rest, token);
|
|
26259
26485
|
break;
|
|
26260
26486
|
case "--base-url":
|
|
26261
|
-
apiBaseUrl =
|
|
26487
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26262
26488
|
break;
|
|
26263
26489
|
case "--link-base":
|
|
26264
|
-
linkBaseUrl =
|
|
26490
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26265
26491
|
break;
|
|
26266
26492
|
default:
|
|
26267
26493
|
throw new Error(`Unknown quiz delete-step option: ${token}`);
|
|
@@ -26290,13 +26516,13 @@ function parseQuizArgs(tokens) {
|
|
|
26290
26516
|
const token = rest.shift();
|
|
26291
26517
|
switch (token) {
|
|
26292
26518
|
case "--paper-id":
|
|
26293
|
-
paperId =
|
|
26519
|
+
paperId = requireValue14(rest, token);
|
|
26294
26520
|
break;
|
|
26295
26521
|
case "--base-url":
|
|
26296
|
-
apiBaseUrl =
|
|
26522
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26297
26523
|
break;
|
|
26298
26524
|
case "--link-base":
|
|
26299
|
-
linkBaseUrl =
|
|
26525
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26300
26526
|
break;
|
|
26301
26527
|
default:
|
|
26302
26528
|
throw new Error(`Unknown quiz activate option: ${token}`);
|
|
@@ -26321,13 +26547,13 @@ function parseQuizArgs(tokens) {
|
|
|
26321
26547
|
const token = rest.shift();
|
|
26322
26548
|
switch (token) {
|
|
26323
26549
|
case "--paper-id":
|
|
26324
|
-
paperId =
|
|
26550
|
+
paperId = requireValue14(rest, token);
|
|
26325
26551
|
break;
|
|
26326
26552
|
case "--base-url":
|
|
26327
|
-
apiBaseUrl =
|
|
26553
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26328
26554
|
break;
|
|
26329
26555
|
case "--link-base":
|
|
26330
|
-
linkBaseUrl =
|
|
26556
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26331
26557
|
break;
|
|
26332
26558
|
default:
|
|
26333
26559
|
throw new Error(`Unknown quiz view option: ${token}`);
|
|
@@ -26356,22 +26582,22 @@ function parseQuizArgs(tokens) {
|
|
|
26356
26582
|
const token = rest.shift();
|
|
26357
26583
|
switch (token) {
|
|
26358
26584
|
case "--paper-id":
|
|
26359
|
-
paperId =
|
|
26585
|
+
paperId = requireValue14(rest, token);
|
|
26360
26586
|
break;
|
|
26361
26587
|
case "--step-id":
|
|
26362
|
-
stepId =
|
|
26588
|
+
stepId = requireValue14(rest, token);
|
|
26363
26589
|
break;
|
|
26364
26590
|
case "--file":
|
|
26365
|
-
filePath =
|
|
26591
|
+
filePath = requireValue14(rest, token);
|
|
26366
26592
|
break;
|
|
26367
26593
|
case "--new-paper-id":
|
|
26368
|
-
newPaperId =
|
|
26594
|
+
newPaperId = requireValue14(rest, token);
|
|
26369
26595
|
break;
|
|
26370
26596
|
case "--base-url":
|
|
26371
|
-
apiBaseUrl =
|
|
26597
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26372
26598
|
break;
|
|
26373
26599
|
case "--link-base":
|
|
26374
|
-
linkBaseUrl =
|
|
26600
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26375
26601
|
break;
|
|
26376
26602
|
case "--activate":
|
|
26377
26603
|
activate = true;
|
|
@@ -26461,10 +26687,10 @@ function parseLinearPrArgs(tokens) {
|
|
|
26461
26687
|
const token = rest.shift();
|
|
26462
26688
|
switch (token) {
|
|
26463
26689
|
case "--account":
|
|
26464
|
-
account =
|
|
26690
|
+
account = requireValue14(rest, token);
|
|
26465
26691
|
break;
|
|
26466
26692
|
case "--cwd":
|
|
26467
|
-
cwd =
|
|
26693
|
+
cwd = requireValue14(rest, token);
|
|
26468
26694
|
break;
|
|
26469
26695
|
default:
|
|
26470
26696
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26493,35 +26719,35 @@ function parseLinearCreateArgs(tokens) {
|
|
|
26493
26719
|
const token = rest.shift();
|
|
26494
26720
|
switch (token) {
|
|
26495
26721
|
case "--account":
|
|
26496
|
-
account =
|
|
26722
|
+
account = requireValue14(rest, token);
|
|
26497
26723
|
break;
|
|
26498
26724
|
case "--repl":
|
|
26499
26725
|
useRepl = true;
|
|
26500
26726
|
break;
|
|
26501
26727
|
case "--title":
|
|
26502
|
-
title =
|
|
26728
|
+
title = requireValue14(rest, token);
|
|
26503
26729
|
break;
|
|
26504
26730
|
case "--desc":
|
|
26505
26731
|
case "--description":
|
|
26506
|
-
description = decodeEscapedNewlines(
|
|
26732
|
+
description = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26507
26733
|
break;
|
|
26508
26734
|
case "--team-id":
|
|
26509
|
-
teamId =
|
|
26735
|
+
teamId = requireValue14(rest, token);
|
|
26510
26736
|
break;
|
|
26511
26737
|
case "--team-key":
|
|
26512
|
-
teamKey =
|
|
26738
|
+
teamKey = requireValue14(rest, token);
|
|
26513
26739
|
break;
|
|
26514
26740
|
case "--priority":
|
|
26515
|
-
priority = parseLinearPriority(
|
|
26741
|
+
priority = parseLinearPriority(requireValue14(rest, token));
|
|
26516
26742
|
break;
|
|
26517
26743
|
case "--parent-id":
|
|
26518
|
-
parentId =
|
|
26744
|
+
parentId = requireValue14(rest, token);
|
|
26519
26745
|
break;
|
|
26520
26746
|
case "--state-id":
|
|
26521
|
-
stateId =
|
|
26747
|
+
stateId = requireValue14(rest, token);
|
|
26522
26748
|
break;
|
|
26523
26749
|
case "--cwd":
|
|
26524
|
-
cwd =
|
|
26750
|
+
cwd = requireValue14(rest, token);
|
|
26525
26751
|
break;
|
|
26526
26752
|
default:
|
|
26527
26753
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26556,10 +26782,10 @@ function parseLinearWhoamiArgs(tokens) {
|
|
|
26556
26782
|
const token = rest.shift();
|
|
26557
26783
|
switch (token) {
|
|
26558
26784
|
case "--account":
|
|
26559
|
-
account =
|
|
26785
|
+
account = requireValue14(rest, token);
|
|
26560
26786
|
break;
|
|
26561
26787
|
case "--cwd":
|
|
26562
|
-
cwd =
|
|
26788
|
+
cwd = requireValue14(rest, token);
|
|
26563
26789
|
break;
|
|
26564
26790
|
default:
|
|
26565
26791
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26584,10 +26810,10 @@ function parseLinearViewArgs(tokens) {
|
|
|
26584
26810
|
const token = rest.shift();
|
|
26585
26811
|
switch (token) {
|
|
26586
26812
|
case "--account":
|
|
26587
|
-
account =
|
|
26813
|
+
account = requireValue14(rest, token);
|
|
26588
26814
|
break;
|
|
26589
26815
|
case "--cwd":
|
|
26590
|
-
cwd =
|
|
26816
|
+
cwd = requireValue14(rest, token);
|
|
26591
26817
|
break;
|
|
26592
26818
|
default:
|
|
26593
26819
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26622,32 +26848,32 @@ function parseLinearUpdateArgs(tokens) {
|
|
|
26622
26848
|
const token = rest.shift();
|
|
26623
26849
|
switch (token) {
|
|
26624
26850
|
case "--account":
|
|
26625
|
-
account =
|
|
26851
|
+
account = requireValue14(rest, token);
|
|
26626
26852
|
break;
|
|
26627
26853
|
case "--title":
|
|
26628
|
-
title =
|
|
26854
|
+
title = requireValue14(rest, token);
|
|
26629
26855
|
break;
|
|
26630
26856
|
case "--desc":
|
|
26631
26857
|
case "--description":
|
|
26632
|
-
description = decodeEscapedNewlines(
|
|
26858
|
+
description = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26633
26859
|
break;
|
|
26634
26860
|
case "--team-id":
|
|
26635
|
-
teamId =
|
|
26861
|
+
teamId = requireValue14(rest, token);
|
|
26636
26862
|
break;
|
|
26637
26863
|
case "--team-key":
|
|
26638
|
-
teamKey =
|
|
26864
|
+
teamKey = requireValue14(rest, token);
|
|
26639
26865
|
break;
|
|
26640
26866
|
case "--priority":
|
|
26641
|
-
priority = parseLinearPriority(
|
|
26867
|
+
priority = parseLinearPriority(requireValue14(rest, token));
|
|
26642
26868
|
break;
|
|
26643
26869
|
case "--parent-id":
|
|
26644
|
-
parentId =
|
|
26870
|
+
parentId = requireValue14(rest, token);
|
|
26645
26871
|
break;
|
|
26646
26872
|
case "--state-id":
|
|
26647
|
-
stateId =
|
|
26873
|
+
stateId = requireValue14(rest, token);
|
|
26648
26874
|
break;
|
|
26649
26875
|
case "--cwd":
|
|
26650
|
-
cwd =
|
|
26876
|
+
cwd = requireValue14(rest, token);
|
|
26651
26877
|
break;
|
|
26652
26878
|
default:
|
|
26653
26879
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26685,10 +26911,10 @@ function parseLinearSubIssuesArgs(tokens) {
|
|
|
26685
26911
|
const token = rest.shift();
|
|
26686
26912
|
switch (token) {
|
|
26687
26913
|
case "--account":
|
|
26688
|
-
account =
|
|
26914
|
+
account = requireValue14(rest, token);
|
|
26689
26915
|
break;
|
|
26690
26916
|
case "--cwd":
|
|
26691
|
-
cwd =
|
|
26917
|
+
cwd = requireValue14(rest, token);
|
|
26692
26918
|
break;
|
|
26693
26919
|
default:
|
|
26694
26920
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26715,15 +26941,15 @@ function parseLinearCommentArgs(tokens) {
|
|
|
26715
26941
|
const token = rest.shift();
|
|
26716
26942
|
switch (token) {
|
|
26717
26943
|
case "--account":
|
|
26718
|
-
account =
|
|
26944
|
+
account = requireValue14(rest, token);
|
|
26719
26945
|
break;
|
|
26720
26946
|
case "--body":
|
|
26721
26947
|
case "--desc":
|
|
26722
26948
|
case "--description":
|
|
26723
|
-
body = decodeEscapedNewlines(
|
|
26949
|
+
body = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26724
26950
|
break;
|
|
26725
26951
|
case "--cwd":
|
|
26726
|
-
cwd =
|
|
26952
|
+
cwd = requireValue14(rest, token);
|
|
26727
26953
|
break;
|
|
26728
26954
|
default:
|
|
26729
26955
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26753,10 +26979,10 @@ function parseLinearCommentsArgs(tokens) {
|
|
|
26753
26979
|
const token = rest.shift();
|
|
26754
26980
|
switch (token) {
|
|
26755
26981
|
case "--account":
|
|
26756
|
-
account =
|
|
26982
|
+
account = requireValue14(rest, token);
|
|
26757
26983
|
break;
|
|
26758
26984
|
case "--cwd":
|
|
26759
|
-
cwd =
|
|
26985
|
+
cwd = requireValue14(rest, token);
|
|
26760
26986
|
break;
|
|
26761
26987
|
default:
|
|
26762
26988
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26780,16 +27006,16 @@ function parseLinearCycleArgs(tokens) {
|
|
|
26780
27006
|
const token = rest.shift();
|
|
26781
27007
|
switch (token) {
|
|
26782
27008
|
case "--account":
|
|
26783
|
-
account =
|
|
27009
|
+
account = requireValue14(rest, token);
|
|
26784
27010
|
break;
|
|
26785
27011
|
case "--team-id":
|
|
26786
|
-
teamId =
|
|
27012
|
+
teamId = requireValue14(rest, token);
|
|
26787
27013
|
break;
|
|
26788
27014
|
case "--team-key":
|
|
26789
|
-
teamKey =
|
|
27015
|
+
teamKey = requireValue14(rest, token);
|
|
26790
27016
|
break;
|
|
26791
27017
|
case "--cwd":
|
|
26792
|
-
cwd =
|
|
27018
|
+
cwd = requireValue14(rest, token);
|
|
26793
27019
|
break;
|
|
26794
27020
|
default:
|
|
26795
27021
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26812,10 +27038,10 @@ function parseLinearTeamsArgs(tokens) {
|
|
|
26812
27038
|
const token = rest.shift();
|
|
26813
27039
|
switch (token) {
|
|
26814
27040
|
case "--account":
|
|
26815
|
-
account =
|
|
27041
|
+
account = requireValue14(rest, token);
|
|
26816
27042
|
break;
|
|
26817
27043
|
case "--cwd":
|
|
26818
|
-
cwd =
|
|
27044
|
+
cwd = requireValue14(rest, token);
|
|
26819
27045
|
break;
|
|
26820
27046
|
default:
|
|
26821
27047
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26842,16 +27068,16 @@ function parseLinearUserIssuesArgs(tokens) {
|
|
|
26842
27068
|
const token = rest.shift();
|
|
26843
27069
|
switch (token) {
|
|
26844
27070
|
case "--account":
|
|
26845
|
-
account =
|
|
27071
|
+
account = requireValue14(rest, token);
|
|
26846
27072
|
break;
|
|
26847
27073
|
case "--cycle":
|
|
26848
|
-
cycle = parseLinearCycle(
|
|
27074
|
+
cycle = parseLinearCycle(requireValue14(rest, token));
|
|
26849
27075
|
break;
|
|
26850
27076
|
case "--status":
|
|
26851
|
-
status = parseLinearStatus(
|
|
27077
|
+
status = parseLinearStatus(requireValue14(rest, token));
|
|
26852
27078
|
break;
|
|
26853
27079
|
case "--cwd":
|
|
26854
|
-
cwd =
|
|
27080
|
+
cwd = requireValue14(rest, token);
|
|
26855
27081
|
break;
|
|
26856
27082
|
default:
|
|
26857
27083
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26885,28 +27111,28 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
26885
27111
|
const token = rest.shift();
|
|
26886
27112
|
switch (token) {
|
|
26887
27113
|
case "--account":
|
|
26888
|
-
account =
|
|
27114
|
+
account = requireValue14(rest, token);
|
|
26889
27115
|
break;
|
|
26890
27116
|
case "--team-id":
|
|
26891
|
-
teamId =
|
|
27117
|
+
teamId = requireValue14(rest, token);
|
|
26892
27118
|
break;
|
|
26893
27119
|
case "--team-key":
|
|
26894
|
-
teamKey =
|
|
27120
|
+
teamKey = requireValue14(rest, token);
|
|
26895
27121
|
break;
|
|
26896
27122
|
case "--user":
|
|
26897
|
-
user =
|
|
27123
|
+
user = requireValue14(rest, token);
|
|
26898
27124
|
break;
|
|
26899
27125
|
case "--cycle":
|
|
26900
|
-
cycle = parseLinearCycle(
|
|
27126
|
+
cycle = parseLinearCycle(requireValue14(rest, token));
|
|
26901
27127
|
break;
|
|
26902
27128
|
case "--status":
|
|
26903
|
-
status = parseLinearStatus(
|
|
27129
|
+
status = parseLinearStatus(requireValue14(rest, token));
|
|
26904
27130
|
break;
|
|
26905
27131
|
case "--query":
|
|
26906
|
-
query =
|
|
27132
|
+
query = requireValue14(rest, token).trim();
|
|
26907
27133
|
break;
|
|
26908
27134
|
case "--limit": {
|
|
26909
|
-
const value = Number.parseInt(
|
|
27135
|
+
const value = Number.parseInt(requireValue14(rest, token), 10);
|
|
26910
27136
|
if (!Number.isInteger(value) || value < 1 || value > 250) {
|
|
26911
27137
|
throw new Error("Invalid --limit. Expected an integer between 1 and 250.");
|
|
26912
27138
|
}
|
|
@@ -26914,7 +27140,7 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
26914
27140
|
break;
|
|
26915
27141
|
}
|
|
26916
27142
|
case "--cwd":
|
|
26917
|
-
cwd =
|
|
27143
|
+
cwd = requireValue14(rest, token);
|
|
26918
27144
|
break;
|
|
26919
27145
|
default:
|
|
26920
27146
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26955,10 +27181,10 @@ function parseLinearLegacyArgs(tokens) {
|
|
|
26955
27181
|
useScreenshot = true;
|
|
26956
27182
|
break;
|
|
26957
27183
|
case "--account":
|
|
26958
|
-
account =
|
|
27184
|
+
account = requireValue14(rest, token);
|
|
26959
27185
|
break;
|
|
26960
27186
|
case "--cwd":
|
|
26961
|
-
cwd =
|
|
27187
|
+
cwd = requireValue14(rest, token);
|
|
26962
27188
|
break;
|
|
26963
27189
|
default:
|
|
26964
27190
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -27052,19 +27278,19 @@ function parseNotionArgs(tokens) {
|
|
|
27052
27278
|
const token = rest.shift();
|
|
27053
27279
|
switch (token) {
|
|
27054
27280
|
case "--parent":
|
|
27055
|
-
parentPageId =
|
|
27281
|
+
parentPageId = requireValue14(rest, token);
|
|
27056
27282
|
break;
|
|
27057
27283
|
case "--title":
|
|
27058
|
-
title =
|
|
27284
|
+
title = requireValue14(rest, token);
|
|
27059
27285
|
break;
|
|
27060
27286
|
case "--private":
|
|
27061
27287
|
isPrivate = true;
|
|
27062
27288
|
break;
|
|
27063
27289
|
case "--content":
|
|
27064
|
-
content2 =
|
|
27290
|
+
content2 = requireValue14(rest, token);
|
|
27065
27291
|
break;
|
|
27066
27292
|
case "--file":
|
|
27067
|
-
filePath2 =
|
|
27293
|
+
filePath2 = requireValue14(rest, token);
|
|
27068
27294
|
break;
|
|
27069
27295
|
default:
|
|
27070
27296
|
throw new Error(`Unknown notion option: ${token}`);
|
|
@@ -27108,10 +27334,10 @@ function parseNotionArgs(tokens) {
|
|
|
27108
27334
|
const token = rest.shift();
|
|
27109
27335
|
switch (token) {
|
|
27110
27336
|
case "--content":
|
|
27111
|
-
content =
|
|
27337
|
+
content = requireValue14(rest, token);
|
|
27112
27338
|
break;
|
|
27113
27339
|
case "--file":
|
|
27114
|
-
filePath =
|
|
27340
|
+
filePath = requireValue14(rest, token);
|
|
27115
27341
|
break;
|
|
27116
27342
|
case "--append":
|
|
27117
27343
|
append = true;
|
|
@@ -27156,11 +27382,11 @@ function parseRandomArgs(tokens) {
|
|
|
27156
27382
|
mode = "easy";
|
|
27157
27383
|
break;
|
|
27158
27384
|
case "--length":
|
|
27159
|
-
length = parsePositiveInt2(
|
|
27385
|
+
length = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27160
27386
|
seenLength = true;
|
|
27161
27387
|
break;
|
|
27162
27388
|
case "--charset": {
|
|
27163
|
-
const value =
|
|
27389
|
+
const value = requireValue14(rest, token);
|
|
27164
27390
|
if (!["base64url", "hex", "alnum", "ascii"].includes(value)) {
|
|
27165
27391
|
throw new Error(
|
|
27166
27392
|
`Invalid --charset value: ${value}. Use base64url|hex|alnum|ascii.`
|
|
@@ -27171,18 +27397,18 @@ function parseRandomArgs(tokens) {
|
|
|
27171
27397
|
break;
|
|
27172
27398
|
}
|
|
27173
27399
|
case "--count":
|
|
27174
|
-
count = parsePositiveInt2(
|
|
27400
|
+
count = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27175
27401
|
break;
|
|
27176
27402
|
case "--words":
|
|
27177
|
-
words = parsePositiveInt2(
|
|
27403
|
+
words = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27178
27404
|
seenWords = true;
|
|
27179
27405
|
break;
|
|
27180
27406
|
case "--digits":
|
|
27181
|
-
digits = parseNonNegativeInt(
|
|
27407
|
+
digits = parseNonNegativeInt(requireValue14(rest, token), token);
|
|
27182
27408
|
seenDigits = true;
|
|
27183
27409
|
break;
|
|
27184
27410
|
case "--separator":
|
|
27185
|
-
separator =
|
|
27411
|
+
separator = requireValue14(rest, token);
|
|
27186
27412
|
seenSeparator = true;
|
|
27187
27413
|
break;
|
|
27188
27414
|
default:
|
|
@@ -27213,7 +27439,7 @@ function parseRandomArgs(tokens) {
|
|
|
27213
27439
|
count
|
|
27214
27440
|
};
|
|
27215
27441
|
}
|
|
27216
|
-
function
|
|
27442
|
+
function requireValue14(tokens, optionName) {
|
|
27217
27443
|
const value = tokens.shift();
|
|
27218
27444
|
if (!value) {
|
|
27219
27445
|
throw new Error(`Missing value for ${optionName}`);
|