@pmate/cli 0.24.42 → 0.24.44
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 +320 -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,31 @@ 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.sendReplyViaConversation(targetPage, thread, args.text);
|
|
16183
|
+
ui.success("im1 reply sent", { source: target.sourceKey, thread: thread.name });
|
|
16184
|
+
} catch (error) {
|
|
16185
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16186
|
+
throw new Error(`im1 reply failed: ${message}`);
|
|
16187
|
+
} finally {
|
|
16188
|
+
await browser?.close().catch(() => void 0);
|
|
16189
|
+
}
|
|
16190
|
+
}
|
|
16159
16191
|
async persistThread(rootDir, target, thread, messages2, syncedAt, existing) {
|
|
16160
16192
|
const threadKey = toThreadKey(thread.name);
|
|
16161
16193
|
const incoming = messages2.map((message) => ({
|
|
@@ -16380,6 +16412,15 @@ var CollectCommandHandler = class {
|
|
|
16380
16412
|
await session.detach().catch(() => void 0);
|
|
16381
16413
|
}
|
|
16382
16414
|
}
|
|
16415
|
+
async sendReplyViaConversation(page, thread, text) {
|
|
16416
|
+
const result = await this.evaluateInPage(
|
|
16417
|
+
page,
|
|
16418
|
+
buildSendMessageExpr(thread.conversationId, text)
|
|
16419
|
+
);
|
|
16420
|
+
if (!result?.ok) {
|
|
16421
|
+
throw new Error(result?.reason || "Send failed");
|
|
16422
|
+
}
|
|
16423
|
+
}
|
|
16383
16424
|
};
|
|
16384
16425
|
async function archiveMessageImages(rootDir, sourceKey, threadKey, messages2) {
|
|
16385
16426
|
const attachmentRoot = resolveLocalAttachmentRoot(sourceKey);
|
|
@@ -16633,6 +16674,40 @@ function buildGetMessagesByConversationExpr(conversationId, limit) {
|
|
|
16633
16674
|
}
|
|
16634
16675
|
})()`;
|
|
16635
16676
|
}
|
|
16677
|
+
function buildSendMessageExpr(conversationId, message) {
|
|
16678
|
+
const escapedConversationId = escapeForJs(conversationId);
|
|
16679
|
+
const escapedMessage = escapeForJs(message);
|
|
16680
|
+
return `(async function() {
|
|
16681
|
+
try {
|
|
16682
|
+
var controller = globalThis.ConversationController;
|
|
16683
|
+
if (!controller || typeof controller.get !== 'function') {
|
|
16684
|
+
return { ok: false, reason: 'ConversationController unavailable' };
|
|
16685
|
+
}
|
|
16686
|
+
var conversation = controller.get('${escapedConversationId}');
|
|
16687
|
+
if (!conversation) return { ok: false, reason: 'Conversation not found: ${escapedConversationId}' };
|
|
16688
|
+
if (typeof conversation.sendMessage !== 'function') {
|
|
16689
|
+
return { ok: false, reason: 'Conversation sendMessage unavailable' };
|
|
16690
|
+
}
|
|
16691
|
+
var type = conversation.get ? conversation.get('type') : null;
|
|
16692
|
+
var name = conversation.get ? (conversation.get('name') || conversation.get('id')) : '${escapedConversationId}';
|
|
16693
|
+
await conversation.sendMessage('${escapedMessage}', null, null, [], null, null, null, null, null, null);
|
|
16694
|
+
return { ok: true, name: name, type: type };
|
|
16695
|
+
} catch(e) {
|
|
16696
|
+
return { ok: false, reason: e && e.message ? e.message : String(e) };
|
|
16697
|
+
}
|
|
16698
|
+
})()`;
|
|
16699
|
+
}
|
|
16700
|
+
function findThreadForReply(threads, query) {
|
|
16701
|
+
const normalizedQuery = normalizeText(query).toLowerCase();
|
|
16702
|
+
if (!normalizedQuery) {
|
|
16703
|
+
return null;
|
|
16704
|
+
}
|
|
16705
|
+
const exact = threads.find((thread) => thread.name.toLowerCase() === normalizedQuery);
|
|
16706
|
+
if (exact) {
|
|
16707
|
+
return exact;
|
|
16708
|
+
}
|
|
16709
|
+
return threads.find((thread) => thread.name.toLowerCase().includes(normalizedQuery)) ?? null;
|
|
16710
|
+
}
|
|
16636
16711
|
function escapeForJs(value) {
|
|
16637
16712
|
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r");
|
|
16638
16713
|
}
|
|
@@ -25107,6 +25182,110 @@ function requireValue10(tokens, optionName) {
|
|
|
25107
25182
|
return value;
|
|
25108
25183
|
}
|
|
25109
25184
|
|
|
25185
|
+
// src/im1CommandParser.ts
|
|
25186
|
+
function parseIm1Args(tokens) {
|
|
25187
|
+
const rest = [...tokens];
|
|
25188
|
+
const action = rest.shift();
|
|
25189
|
+
if (!action) {
|
|
25190
|
+
throw new Error("Usage: im1 collect sync (--source <cc|yelling> | --endpoint <url>) | im1 reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)");
|
|
25191
|
+
}
|
|
25192
|
+
if (action === "collect") {
|
|
25193
|
+
return parseIm1CollectArgs(rest);
|
|
25194
|
+
}
|
|
25195
|
+
if (action === "reply") {
|
|
25196
|
+
return parseIm1ReplyArgs(rest);
|
|
25197
|
+
}
|
|
25198
|
+
throw new Error(`Unknown im1 action: ${action}`);
|
|
25199
|
+
}
|
|
25200
|
+
function parseIm1CollectArgs(tokens) {
|
|
25201
|
+
const rest = [...tokens];
|
|
25202
|
+
const action = rest.shift();
|
|
25203
|
+
if (action !== "sync") {
|
|
25204
|
+
throw new Error("Usage: im1 collect sync (--source <cc|yelling> | --endpoint <url>)");
|
|
25205
|
+
}
|
|
25206
|
+
const target = parseTargetOptions(rest);
|
|
25207
|
+
if (!target.source && !target.endpoint) {
|
|
25208
|
+
throw new Error("Usage: im1 collect sync (--source <cc|yelling> | --endpoint <url>)");
|
|
25209
|
+
}
|
|
25210
|
+
return {
|
|
25211
|
+
type: "collect" /* Collect */,
|
|
25212
|
+
action: "sync",
|
|
25213
|
+
source: target.source,
|
|
25214
|
+
endpoint: target.endpoint
|
|
25215
|
+
};
|
|
25216
|
+
}
|
|
25217
|
+
function parseIm1ReplyArgs(tokens) {
|
|
25218
|
+
const rest = [...tokens];
|
|
25219
|
+
const targetTokens = [];
|
|
25220
|
+
let thread;
|
|
25221
|
+
let text;
|
|
25222
|
+
while (rest.length > 0) {
|
|
25223
|
+
const token = rest.shift();
|
|
25224
|
+
switch (token) {
|
|
25225
|
+
case "--thread":
|
|
25226
|
+
thread = requireValue11(rest, token);
|
|
25227
|
+
break;
|
|
25228
|
+
case "--text":
|
|
25229
|
+
text = requireValue11(rest, token);
|
|
25230
|
+
break;
|
|
25231
|
+
case "--source":
|
|
25232
|
+
case "--endpoint":
|
|
25233
|
+
targetTokens.push(token, requireValue11(rest, token));
|
|
25234
|
+
break;
|
|
25235
|
+
default:
|
|
25236
|
+
throw new Error(`Unknown im1 reply option: ${token}`);
|
|
25237
|
+
}
|
|
25238
|
+
}
|
|
25239
|
+
if (!thread || !text) {
|
|
25240
|
+
throw new Error("Usage: im1 reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)");
|
|
25241
|
+
}
|
|
25242
|
+
const target = parseTargetOptions(targetTokens);
|
|
25243
|
+
if (!target.source && !target.endpoint) {
|
|
25244
|
+
throw new Error("Usage: im1 reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)");
|
|
25245
|
+
}
|
|
25246
|
+
return {
|
|
25247
|
+
type: "collect" /* Collect */,
|
|
25248
|
+
action: "reply",
|
|
25249
|
+
source: target.source,
|
|
25250
|
+
endpoint: target.endpoint,
|
|
25251
|
+
thread,
|
|
25252
|
+
text
|
|
25253
|
+
};
|
|
25254
|
+
}
|
|
25255
|
+
function parseTargetOptions(tokens) {
|
|
25256
|
+
const rest = [...tokens];
|
|
25257
|
+
const options = {};
|
|
25258
|
+
while (rest.length > 0) {
|
|
25259
|
+
const token = rest.shift();
|
|
25260
|
+
switch (token) {
|
|
25261
|
+
case "--source": {
|
|
25262
|
+
const value = requireValue11(rest, token);
|
|
25263
|
+
if (value !== "cc" && value !== "yelling") {
|
|
25264
|
+
throw new Error(`Unsupported im1 source: ${value}`);
|
|
25265
|
+
}
|
|
25266
|
+
options.source = value;
|
|
25267
|
+
break;
|
|
25268
|
+
}
|
|
25269
|
+
case "--endpoint":
|
|
25270
|
+
options.endpoint = requireValue11(rest, token);
|
|
25271
|
+
break;
|
|
25272
|
+
default:
|
|
25273
|
+
throw new Error(`Unknown im1 option: ${token}`);
|
|
25274
|
+
}
|
|
25275
|
+
}
|
|
25276
|
+
if (options.source && options.endpoint) {
|
|
25277
|
+
throw new Error("Use either --source or --endpoint, not both.");
|
|
25278
|
+
}
|
|
25279
|
+
return options;
|
|
25280
|
+
}
|
|
25281
|
+
function requireValue11(tokens, optionName) {
|
|
25282
|
+
const value = tokens.shift();
|
|
25283
|
+
if (!value || value.startsWith("--")) {
|
|
25284
|
+
throw new Error(`Missing value for ${optionName}`);
|
|
25285
|
+
}
|
|
25286
|
+
return value;
|
|
25287
|
+
}
|
|
25288
|
+
|
|
25110
25289
|
// src/chatRoomCommandParser.ts
|
|
25111
25290
|
function parseChatRoomArgs(tokens) {
|
|
25112
25291
|
const rest = [...tokens];
|
|
@@ -25206,12 +25385,12 @@ function parseShared(tokens) {
|
|
|
25206
25385
|
case "--title":
|
|
25207
25386
|
case "--bot-a":
|
|
25208
25387
|
case "--bot-b":
|
|
25209
|
-
options.set(token,
|
|
25388
|
+
options.set(token, requireValue12(tokens, token));
|
|
25210
25389
|
break;
|
|
25211
25390
|
case "--member":
|
|
25212
25391
|
case "--recipient": {
|
|
25213
25392
|
const values = multiOptions.get(token) ?? [];
|
|
25214
|
-
values.push(
|
|
25393
|
+
values.push(requireValue12(tokens, token));
|
|
25215
25394
|
multiOptions.set(token, values);
|
|
25216
25395
|
break;
|
|
25217
25396
|
}
|
|
@@ -25237,7 +25416,7 @@ function requiredOption(options, option) {
|
|
|
25237
25416
|
}
|
|
25238
25417
|
return value;
|
|
25239
25418
|
}
|
|
25240
|
-
function
|
|
25419
|
+
function requireValue12(tokens, option) {
|
|
25241
25420
|
const value = tokens.shift();
|
|
25242
25421
|
if (!value || value.startsWith("--")) {
|
|
25243
25422
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -25272,7 +25451,7 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25272
25451
|
close = true;
|
|
25273
25452
|
break;
|
|
25274
25453
|
case "--env": {
|
|
25275
|
-
const rawValue =
|
|
25454
|
+
const rawValue = requireValue13(rest, token);
|
|
25276
25455
|
const parsed = Number.parseInt(rawValue, 10);
|
|
25277
25456
|
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
25278
25457
|
throw new Error(`Invalid --env value: ${rawValue}`);
|
|
@@ -25281,13 +25460,13 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25281
25460
|
break;
|
|
25282
25461
|
}
|
|
25283
25462
|
case "--env-root":
|
|
25284
|
-
envRoot =
|
|
25463
|
+
envRoot = requireValue13(rest, token);
|
|
25285
25464
|
break;
|
|
25286
25465
|
case "--base-root":
|
|
25287
|
-
baseRoot =
|
|
25466
|
+
baseRoot = requireValue13(rest, token);
|
|
25288
25467
|
break;
|
|
25289
25468
|
case "--note":
|
|
25290
|
-
note =
|
|
25469
|
+
note = requireValue13(rest, token);
|
|
25291
25470
|
break;
|
|
25292
25471
|
case "--json":
|
|
25293
25472
|
json = true;
|
|
@@ -25323,7 +25502,7 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25323
25502
|
json
|
|
25324
25503
|
};
|
|
25325
25504
|
}
|
|
25326
|
-
function
|
|
25505
|
+
function requireValue13(tokens, option) {
|
|
25327
25506
|
const value = tokens.shift();
|
|
25328
25507
|
if (!value || value.startsWith("-")) {
|
|
25329
25508
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -25415,7 +25594,10 @@ var HELP_TEXT = [
|
|
|
25415
25594
|
` ${import_chalk4.default.gray(" [--length <n>] [--charset base64url|hex|alnum|ascii]")}`,
|
|
25416
25595
|
` ${import_chalk4.default.gray(" [--count <n>]")}`,
|
|
25417
25596
|
` ${import_chalk4.default.gray(" --easy [--words <n>] [--digits <n>] [--separator <s>] [--count <n>]")}`,
|
|
25418
|
-
` ${import_chalk4.default.cyan("
|
|
25597
|
+
` ${import_chalk4.default.cyan("im1")} Collect and reply in CC-like Electron chat apps via CDP`,
|
|
25598
|
+
` ${import_chalk4.default.gray(" collect sync (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25599
|
+
` ${import_chalk4.default.gray(" reply --thread <name> --text <text> (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25600
|
+
` ${import_chalk4.default.cyan("collect")} Legacy alias for CC/yelling collection`,
|
|
25419
25601
|
` ${import_chalk4.default.gray(" sync (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25420
25602
|
` ${import_chalk4.default.cyan("chat-room")} Run social chat regression commands with PMate bot key JSON`,
|
|
25421
25603
|
` ${import_chalk4.default.gray(" join|request-friend|accept-friend|delete-friend|send|group-create|group-send|smoke --app <ns:app> --bot <file>")}`,
|
|
@@ -25579,10 +25761,10 @@ function parseCommandArgs(args) {
|
|
|
25579
25761
|
const token = rest.shift();
|
|
25580
25762
|
switch (token) {
|
|
25581
25763
|
case "--app":
|
|
25582
|
-
app =
|
|
25764
|
+
app = requireValue14(rest, token);
|
|
25583
25765
|
break;
|
|
25584
25766
|
case "--profile-id":
|
|
25585
|
-
profileId =
|
|
25767
|
+
profileId = requireValue14(rest, token);
|
|
25586
25768
|
break;
|
|
25587
25769
|
default:
|
|
25588
25770
|
throw new Error(`Unknown login option: ${token}`);
|
|
@@ -25644,6 +25826,9 @@ function parseCommandArgs(args) {
|
|
|
25644
25826
|
if (args.rest[0] === "collect") {
|
|
25645
25827
|
return parseCollectArgs(args.rest.slice(1));
|
|
25646
25828
|
}
|
|
25829
|
+
if (args.rest[0] === "im1") {
|
|
25830
|
+
return parseIm1Args(args.rest.slice(1));
|
|
25831
|
+
}
|
|
25647
25832
|
if (args.rest[0] === "chat-room") {
|
|
25648
25833
|
return parseChatRoomArgs(args.rest.slice(1));
|
|
25649
25834
|
}
|
|
@@ -25691,7 +25876,7 @@ function parseVercelArgs(tokens) {
|
|
|
25691
25876
|
const token = rest.shift();
|
|
25692
25877
|
switch (token) {
|
|
25693
25878
|
case "--scope":
|
|
25694
|
-
scope =
|
|
25879
|
+
scope = requireValue14(rest, token);
|
|
25695
25880
|
break;
|
|
25696
25881
|
default:
|
|
25697
25882
|
throw new Error(`Unknown vercel option: ${token}`);
|
|
@@ -25711,10 +25896,10 @@ function parseVercelArgs(tokens) {
|
|
|
25711
25896
|
const token = rest.shift();
|
|
25712
25897
|
switch (token) {
|
|
25713
25898
|
case "--scope":
|
|
25714
|
-
scope =
|
|
25899
|
+
scope = requireValue14(rest, token);
|
|
25715
25900
|
break;
|
|
25716
25901
|
case "--project":
|
|
25717
|
-
project =
|
|
25902
|
+
project = requireValue14(rest, token);
|
|
25718
25903
|
break;
|
|
25719
25904
|
case "--last-week":
|
|
25720
25905
|
lastWeek = true;
|
|
@@ -25745,16 +25930,16 @@ function parseAddDnsArgs(tokens) {
|
|
|
25745
25930
|
const token = rest.shift();
|
|
25746
25931
|
switch (token) {
|
|
25747
25932
|
case "--type":
|
|
25748
|
-
options.dnsType =
|
|
25933
|
+
options.dnsType = requireValue14(rest, token);
|
|
25749
25934
|
break;
|
|
25750
25935
|
case "--value":
|
|
25751
|
-
options.dnsValue =
|
|
25936
|
+
options.dnsValue = requireValue14(rest, token);
|
|
25752
25937
|
break;
|
|
25753
25938
|
case "--rr":
|
|
25754
|
-
options.dnsRr =
|
|
25939
|
+
options.dnsRr = requireValue14(rest, token);
|
|
25755
25940
|
break;
|
|
25756
25941
|
case "--ttl": {
|
|
25757
|
-
const ttlValue =
|
|
25942
|
+
const ttlValue = requireValue14(rest, token);
|
|
25758
25943
|
const ttl = Number.parseInt(ttlValue, 10);
|
|
25759
25944
|
if (!Number.isFinite(ttl) || ttl <= 0) {
|
|
25760
25945
|
throw new Error(`Invalid --ttl value: ${ttlValue}`);
|
|
@@ -25763,7 +25948,7 @@ function parseAddDnsArgs(tokens) {
|
|
|
25763
25948
|
break;
|
|
25764
25949
|
}
|
|
25765
25950
|
case "--domain":
|
|
25766
|
-
options.dnsDomain =
|
|
25951
|
+
options.dnsDomain = requireValue14(rest, token);
|
|
25767
25952
|
break;
|
|
25768
25953
|
default:
|
|
25769
25954
|
throw new Error(`Unknown add-dns option: ${token}`);
|
|
@@ -25796,13 +25981,13 @@ function parseBucketArgs(tokens) {
|
|
|
25796
25981
|
options.bucketCreate = true;
|
|
25797
25982
|
break;
|
|
25798
25983
|
case "--name":
|
|
25799
|
-
options.bucketName =
|
|
25984
|
+
options.bucketName = requireValue14(rest, token);
|
|
25800
25985
|
break;
|
|
25801
25986
|
case "--subdomain":
|
|
25802
|
-
options.bucketSubdomain =
|
|
25987
|
+
options.bucketSubdomain = requireValue14(rest, token);
|
|
25803
25988
|
break;
|
|
25804
25989
|
case "--domain":
|
|
25805
|
-
options.bucketDomain =
|
|
25990
|
+
options.bucketDomain = requireValue14(rest, token);
|
|
25806
25991
|
break;
|
|
25807
25992
|
default:
|
|
25808
25993
|
throw new Error(`Unknown bucket option: ${token}`);
|
|
@@ -25834,7 +26019,7 @@ function parseDevArgs(tokens) {
|
|
|
25834
26019
|
const token = rest.shift();
|
|
25835
26020
|
switch (token) {
|
|
25836
26021
|
case "--cwd":
|
|
25837
|
-
options.devCwd =
|
|
26022
|
+
options.devCwd = requireValue14(rest, token);
|
|
25838
26023
|
break;
|
|
25839
26024
|
default:
|
|
25840
26025
|
throw new Error(`Unknown dev option: ${token}`);
|
|
@@ -25854,7 +26039,7 @@ function parseDeleteArgs(tokens) {
|
|
|
25854
26039
|
const token = rest.shift();
|
|
25855
26040
|
switch (token) {
|
|
25856
26041
|
case "--cwd":
|
|
25857
|
-
deleteCwd =
|
|
26042
|
+
deleteCwd = requireValue14(rest, token);
|
|
25858
26043
|
break;
|
|
25859
26044
|
default:
|
|
25860
26045
|
throw new Error(`Unknown delete option: ${token}`);
|
|
@@ -25888,13 +26073,13 @@ function parseOssArgs(tokens) {
|
|
|
25888
26073
|
const token = rest.shift();
|
|
25889
26074
|
switch (token) {
|
|
25890
26075
|
case "--bucket":
|
|
25891
|
-
bucket =
|
|
26076
|
+
bucket = requireValue14(rest, token);
|
|
25892
26077
|
break;
|
|
25893
26078
|
case "--file":
|
|
25894
|
-
filePath =
|
|
26079
|
+
filePath = requireValue14(rest, token);
|
|
25895
26080
|
break;
|
|
25896
26081
|
case "--key":
|
|
25897
|
-
objectKey =
|
|
26082
|
+
objectKey = requireValue14(rest, token);
|
|
25898
26083
|
break;
|
|
25899
26084
|
default:
|
|
25900
26085
|
throw new Error(`Unknown oss option: ${token}`);
|
|
@@ -25927,7 +26112,7 @@ function parseEnvArgs(tokens) {
|
|
|
25927
26112
|
throw new Error("Only one env action is allowed.");
|
|
25928
26113
|
}
|
|
25929
26114
|
action = "set";
|
|
25930
|
-
key =
|
|
26115
|
+
key = requireValue14(rest, token);
|
|
25931
26116
|
break;
|
|
25932
26117
|
case "--list":
|
|
25933
26118
|
if (action) {
|
|
@@ -25940,17 +26125,17 @@ function parseEnvArgs(tokens) {
|
|
|
25940
26125
|
throw new Error("Only one env action is allowed.");
|
|
25941
26126
|
}
|
|
25942
26127
|
action = "delete";
|
|
25943
|
-
key =
|
|
26128
|
+
key = requireValue14(rest, token);
|
|
25944
26129
|
break;
|
|
25945
26130
|
case "--value":
|
|
25946
|
-
value =
|
|
26131
|
+
value = requireValue14(rest, token);
|
|
25947
26132
|
break;
|
|
25948
26133
|
case "--verbose":
|
|
25949
26134
|
case "-v":
|
|
25950
26135
|
verbose = true;
|
|
25951
26136
|
break;
|
|
25952
26137
|
case "--cwd":
|
|
25953
|
-
cwd =
|
|
26138
|
+
cwd = requireValue14(rest, token);
|
|
25954
26139
|
break;
|
|
25955
26140
|
default:
|
|
25956
26141
|
throw new Error(`Unknown env option: ${token}`);
|
|
@@ -26008,7 +26193,7 @@ function parseCommitArgs(tokens) {
|
|
|
26008
26193
|
push = true;
|
|
26009
26194
|
break;
|
|
26010
26195
|
case "--cwd":
|
|
26011
|
-
cwd =
|
|
26196
|
+
cwd = requireValue14(rest, token);
|
|
26012
26197
|
break;
|
|
26013
26198
|
default:
|
|
26014
26199
|
throw new Error(`Unknown commit option: ${token}`);
|
|
@@ -26024,10 +26209,10 @@ function parseSummaryArgs(tokens) {
|
|
|
26024
26209
|
const token = rest.shift();
|
|
26025
26210
|
switch (token) {
|
|
26026
26211
|
case "--pr":
|
|
26027
|
-
prRef =
|
|
26212
|
+
prRef = requireValue14(rest, token);
|
|
26028
26213
|
break;
|
|
26029
26214
|
case "--cwd":
|
|
26030
|
-
cwd =
|
|
26215
|
+
cwd = requireValue14(rest, token);
|
|
26031
26216
|
break;
|
|
26032
26217
|
default:
|
|
26033
26218
|
throw new Error(`Unknown summary option: ${token}`);
|
|
@@ -26052,13 +26237,13 @@ function parseQuizArgs(tokens) {
|
|
|
26052
26237
|
const token = rest.shift();
|
|
26053
26238
|
switch (token) {
|
|
26054
26239
|
case "--paper-id":
|
|
26055
|
-
paperId =
|
|
26240
|
+
paperId = requireValue14(rest, token);
|
|
26056
26241
|
break;
|
|
26057
26242
|
case "--base-url":
|
|
26058
|
-
apiBaseUrl =
|
|
26243
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26059
26244
|
break;
|
|
26060
26245
|
case "--link-base":
|
|
26061
|
-
linkBaseUrl =
|
|
26246
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26062
26247
|
break;
|
|
26063
26248
|
default:
|
|
26064
26249
|
throw new Error(`Unknown quiz create-draft option: ${token}`);
|
|
@@ -26084,16 +26269,16 @@ function parseQuizArgs(tokens) {
|
|
|
26084
26269
|
const token = rest.shift();
|
|
26085
26270
|
switch (token) {
|
|
26086
26271
|
case "--paper-id":
|
|
26087
|
-
paperId =
|
|
26272
|
+
paperId = requireValue14(rest, token);
|
|
26088
26273
|
break;
|
|
26089
26274
|
case "--file":
|
|
26090
|
-
filePath =
|
|
26275
|
+
filePath = requireValue14(rest, token);
|
|
26091
26276
|
break;
|
|
26092
26277
|
case "--base-url":
|
|
26093
|
-
apiBaseUrl =
|
|
26278
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26094
26279
|
break;
|
|
26095
26280
|
case "--link-base":
|
|
26096
|
-
linkBaseUrl =
|
|
26281
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26097
26282
|
break;
|
|
26098
26283
|
default:
|
|
26099
26284
|
throw new Error(`Unknown quiz update-meta option: ${token}`);
|
|
@@ -26123,16 +26308,16 @@ function parseQuizArgs(tokens) {
|
|
|
26123
26308
|
const token = rest.shift();
|
|
26124
26309
|
switch (token) {
|
|
26125
26310
|
case "--paper-id":
|
|
26126
|
-
paperId =
|
|
26311
|
+
paperId = requireValue14(rest, token);
|
|
26127
26312
|
break;
|
|
26128
26313
|
case "--file":
|
|
26129
|
-
filePath =
|
|
26314
|
+
filePath = requireValue14(rest, token);
|
|
26130
26315
|
break;
|
|
26131
26316
|
case "--base-url":
|
|
26132
|
-
apiBaseUrl =
|
|
26317
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26133
26318
|
break;
|
|
26134
26319
|
case "--link-base":
|
|
26135
|
-
linkBaseUrl =
|
|
26320
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26136
26321
|
break;
|
|
26137
26322
|
default:
|
|
26138
26323
|
throw new Error(`Unknown quiz append-step option: ${token}`);
|
|
@@ -26163,19 +26348,19 @@ function parseQuizArgs(tokens) {
|
|
|
26163
26348
|
const token = rest.shift();
|
|
26164
26349
|
switch (token) {
|
|
26165
26350
|
case "--paper-id":
|
|
26166
|
-
paperId =
|
|
26351
|
+
paperId = requireValue14(rest, token);
|
|
26167
26352
|
break;
|
|
26168
26353
|
case "--step-id":
|
|
26169
|
-
stepId =
|
|
26354
|
+
stepId = requireValue14(rest, token);
|
|
26170
26355
|
break;
|
|
26171
26356
|
case "--file":
|
|
26172
|
-
filePath =
|
|
26357
|
+
filePath = requireValue14(rest, token);
|
|
26173
26358
|
break;
|
|
26174
26359
|
case "--base-url":
|
|
26175
|
-
apiBaseUrl =
|
|
26360
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26176
26361
|
break;
|
|
26177
26362
|
case "--link-base":
|
|
26178
|
-
linkBaseUrl =
|
|
26363
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26179
26364
|
break;
|
|
26180
26365
|
default:
|
|
26181
26366
|
throw new Error(`Unknown quiz update-step option: ${token}`);
|
|
@@ -26209,16 +26394,16 @@ function parseQuizArgs(tokens) {
|
|
|
26209
26394
|
const token = rest.shift();
|
|
26210
26395
|
switch (token) {
|
|
26211
26396
|
case "--paper-id":
|
|
26212
|
-
paperId =
|
|
26397
|
+
paperId = requireValue14(rest, token);
|
|
26213
26398
|
break;
|
|
26214
26399
|
case "--step-ids":
|
|
26215
|
-
stepIdsRaw =
|
|
26400
|
+
stepIdsRaw = requireValue14(rest, token);
|
|
26216
26401
|
break;
|
|
26217
26402
|
case "--base-url":
|
|
26218
|
-
apiBaseUrl =
|
|
26403
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26219
26404
|
break;
|
|
26220
26405
|
case "--link-base":
|
|
26221
|
-
linkBaseUrl =
|
|
26406
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26222
26407
|
break;
|
|
26223
26408
|
default:
|
|
26224
26409
|
throw new Error(`Unknown quiz reorder option: ${token}`);
|
|
@@ -26252,16 +26437,16 @@ function parseQuizArgs(tokens) {
|
|
|
26252
26437
|
const token = rest.shift();
|
|
26253
26438
|
switch (token) {
|
|
26254
26439
|
case "--paper-id":
|
|
26255
|
-
paperId =
|
|
26440
|
+
paperId = requireValue14(rest, token);
|
|
26256
26441
|
break;
|
|
26257
26442
|
case "--step-id":
|
|
26258
|
-
stepId =
|
|
26443
|
+
stepId = requireValue14(rest, token);
|
|
26259
26444
|
break;
|
|
26260
26445
|
case "--base-url":
|
|
26261
|
-
apiBaseUrl =
|
|
26446
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26262
26447
|
break;
|
|
26263
26448
|
case "--link-base":
|
|
26264
|
-
linkBaseUrl =
|
|
26449
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26265
26450
|
break;
|
|
26266
26451
|
default:
|
|
26267
26452
|
throw new Error(`Unknown quiz delete-step option: ${token}`);
|
|
@@ -26290,13 +26475,13 @@ function parseQuizArgs(tokens) {
|
|
|
26290
26475
|
const token = rest.shift();
|
|
26291
26476
|
switch (token) {
|
|
26292
26477
|
case "--paper-id":
|
|
26293
|
-
paperId =
|
|
26478
|
+
paperId = requireValue14(rest, token);
|
|
26294
26479
|
break;
|
|
26295
26480
|
case "--base-url":
|
|
26296
|
-
apiBaseUrl =
|
|
26481
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26297
26482
|
break;
|
|
26298
26483
|
case "--link-base":
|
|
26299
|
-
linkBaseUrl =
|
|
26484
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26300
26485
|
break;
|
|
26301
26486
|
default:
|
|
26302
26487
|
throw new Error(`Unknown quiz activate option: ${token}`);
|
|
@@ -26321,13 +26506,13 @@ function parseQuizArgs(tokens) {
|
|
|
26321
26506
|
const token = rest.shift();
|
|
26322
26507
|
switch (token) {
|
|
26323
26508
|
case "--paper-id":
|
|
26324
|
-
paperId =
|
|
26509
|
+
paperId = requireValue14(rest, token);
|
|
26325
26510
|
break;
|
|
26326
26511
|
case "--base-url":
|
|
26327
|
-
apiBaseUrl =
|
|
26512
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26328
26513
|
break;
|
|
26329
26514
|
case "--link-base":
|
|
26330
|
-
linkBaseUrl =
|
|
26515
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26331
26516
|
break;
|
|
26332
26517
|
default:
|
|
26333
26518
|
throw new Error(`Unknown quiz view option: ${token}`);
|
|
@@ -26356,22 +26541,22 @@ function parseQuizArgs(tokens) {
|
|
|
26356
26541
|
const token = rest.shift();
|
|
26357
26542
|
switch (token) {
|
|
26358
26543
|
case "--paper-id":
|
|
26359
|
-
paperId =
|
|
26544
|
+
paperId = requireValue14(rest, token);
|
|
26360
26545
|
break;
|
|
26361
26546
|
case "--step-id":
|
|
26362
|
-
stepId =
|
|
26547
|
+
stepId = requireValue14(rest, token);
|
|
26363
26548
|
break;
|
|
26364
26549
|
case "--file":
|
|
26365
|
-
filePath =
|
|
26550
|
+
filePath = requireValue14(rest, token);
|
|
26366
26551
|
break;
|
|
26367
26552
|
case "--new-paper-id":
|
|
26368
|
-
newPaperId =
|
|
26553
|
+
newPaperId = requireValue14(rest, token);
|
|
26369
26554
|
break;
|
|
26370
26555
|
case "--base-url":
|
|
26371
|
-
apiBaseUrl =
|
|
26556
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26372
26557
|
break;
|
|
26373
26558
|
case "--link-base":
|
|
26374
|
-
linkBaseUrl =
|
|
26559
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26375
26560
|
break;
|
|
26376
26561
|
case "--activate":
|
|
26377
26562
|
activate = true;
|
|
@@ -26461,10 +26646,10 @@ function parseLinearPrArgs(tokens) {
|
|
|
26461
26646
|
const token = rest.shift();
|
|
26462
26647
|
switch (token) {
|
|
26463
26648
|
case "--account":
|
|
26464
|
-
account =
|
|
26649
|
+
account = requireValue14(rest, token);
|
|
26465
26650
|
break;
|
|
26466
26651
|
case "--cwd":
|
|
26467
|
-
cwd =
|
|
26652
|
+
cwd = requireValue14(rest, token);
|
|
26468
26653
|
break;
|
|
26469
26654
|
default:
|
|
26470
26655
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26493,35 +26678,35 @@ function parseLinearCreateArgs(tokens) {
|
|
|
26493
26678
|
const token = rest.shift();
|
|
26494
26679
|
switch (token) {
|
|
26495
26680
|
case "--account":
|
|
26496
|
-
account =
|
|
26681
|
+
account = requireValue14(rest, token);
|
|
26497
26682
|
break;
|
|
26498
26683
|
case "--repl":
|
|
26499
26684
|
useRepl = true;
|
|
26500
26685
|
break;
|
|
26501
26686
|
case "--title":
|
|
26502
|
-
title =
|
|
26687
|
+
title = requireValue14(rest, token);
|
|
26503
26688
|
break;
|
|
26504
26689
|
case "--desc":
|
|
26505
26690
|
case "--description":
|
|
26506
|
-
description = decodeEscapedNewlines(
|
|
26691
|
+
description = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26507
26692
|
break;
|
|
26508
26693
|
case "--team-id":
|
|
26509
|
-
teamId =
|
|
26694
|
+
teamId = requireValue14(rest, token);
|
|
26510
26695
|
break;
|
|
26511
26696
|
case "--team-key":
|
|
26512
|
-
teamKey =
|
|
26697
|
+
teamKey = requireValue14(rest, token);
|
|
26513
26698
|
break;
|
|
26514
26699
|
case "--priority":
|
|
26515
|
-
priority = parseLinearPriority(
|
|
26700
|
+
priority = parseLinearPriority(requireValue14(rest, token));
|
|
26516
26701
|
break;
|
|
26517
26702
|
case "--parent-id":
|
|
26518
|
-
parentId =
|
|
26703
|
+
parentId = requireValue14(rest, token);
|
|
26519
26704
|
break;
|
|
26520
26705
|
case "--state-id":
|
|
26521
|
-
stateId =
|
|
26706
|
+
stateId = requireValue14(rest, token);
|
|
26522
26707
|
break;
|
|
26523
26708
|
case "--cwd":
|
|
26524
|
-
cwd =
|
|
26709
|
+
cwd = requireValue14(rest, token);
|
|
26525
26710
|
break;
|
|
26526
26711
|
default:
|
|
26527
26712
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26556,10 +26741,10 @@ function parseLinearWhoamiArgs(tokens) {
|
|
|
26556
26741
|
const token = rest.shift();
|
|
26557
26742
|
switch (token) {
|
|
26558
26743
|
case "--account":
|
|
26559
|
-
account =
|
|
26744
|
+
account = requireValue14(rest, token);
|
|
26560
26745
|
break;
|
|
26561
26746
|
case "--cwd":
|
|
26562
|
-
cwd =
|
|
26747
|
+
cwd = requireValue14(rest, token);
|
|
26563
26748
|
break;
|
|
26564
26749
|
default:
|
|
26565
26750
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26584,10 +26769,10 @@ function parseLinearViewArgs(tokens) {
|
|
|
26584
26769
|
const token = rest.shift();
|
|
26585
26770
|
switch (token) {
|
|
26586
26771
|
case "--account":
|
|
26587
|
-
account =
|
|
26772
|
+
account = requireValue14(rest, token);
|
|
26588
26773
|
break;
|
|
26589
26774
|
case "--cwd":
|
|
26590
|
-
cwd =
|
|
26775
|
+
cwd = requireValue14(rest, token);
|
|
26591
26776
|
break;
|
|
26592
26777
|
default:
|
|
26593
26778
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26622,32 +26807,32 @@ function parseLinearUpdateArgs(tokens) {
|
|
|
26622
26807
|
const token = rest.shift();
|
|
26623
26808
|
switch (token) {
|
|
26624
26809
|
case "--account":
|
|
26625
|
-
account =
|
|
26810
|
+
account = requireValue14(rest, token);
|
|
26626
26811
|
break;
|
|
26627
26812
|
case "--title":
|
|
26628
|
-
title =
|
|
26813
|
+
title = requireValue14(rest, token);
|
|
26629
26814
|
break;
|
|
26630
26815
|
case "--desc":
|
|
26631
26816
|
case "--description":
|
|
26632
|
-
description = decodeEscapedNewlines(
|
|
26817
|
+
description = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26633
26818
|
break;
|
|
26634
26819
|
case "--team-id":
|
|
26635
|
-
teamId =
|
|
26820
|
+
teamId = requireValue14(rest, token);
|
|
26636
26821
|
break;
|
|
26637
26822
|
case "--team-key":
|
|
26638
|
-
teamKey =
|
|
26823
|
+
teamKey = requireValue14(rest, token);
|
|
26639
26824
|
break;
|
|
26640
26825
|
case "--priority":
|
|
26641
|
-
priority = parseLinearPriority(
|
|
26826
|
+
priority = parseLinearPriority(requireValue14(rest, token));
|
|
26642
26827
|
break;
|
|
26643
26828
|
case "--parent-id":
|
|
26644
|
-
parentId =
|
|
26829
|
+
parentId = requireValue14(rest, token);
|
|
26645
26830
|
break;
|
|
26646
26831
|
case "--state-id":
|
|
26647
|
-
stateId =
|
|
26832
|
+
stateId = requireValue14(rest, token);
|
|
26648
26833
|
break;
|
|
26649
26834
|
case "--cwd":
|
|
26650
|
-
cwd =
|
|
26835
|
+
cwd = requireValue14(rest, token);
|
|
26651
26836
|
break;
|
|
26652
26837
|
default:
|
|
26653
26838
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26685,10 +26870,10 @@ function parseLinearSubIssuesArgs(tokens) {
|
|
|
26685
26870
|
const token = rest.shift();
|
|
26686
26871
|
switch (token) {
|
|
26687
26872
|
case "--account":
|
|
26688
|
-
account =
|
|
26873
|
+
account = requireValue14(rest, token);
|
|
26689
26874
|
break;
|
|
26690
26875
|
case "--cwd":
|
|
26691
|
-
cwd =
|
|
26876
|
+
cwd = requireValue14(rest, token);
|
|
26692
26877
|
break;
|
|
26693
26878
|
default:
|
|
26694
26879
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26715,15 +26900,15 @@ function parseLinearCommentArgs(tokens) {
|
|
|
26715
26900
|
const token = rest.shift();
|
|
26716
26901
|
switch (token) {
|
|
26717
26902
|
case "--account":
|
|
26718
|
-
account =
|
|
26903
|
+
account = requireValue14(rest, token);
|
|
26719
26904
|
break;
|
|
26720
26905
|
case "--body":
|
|
26721
26906
|
case "--desc":
|
|
26722
26907
|
case "--description":
|
|
26723
|
-
body = decodeEscapedNewlines(
|
|
26908
|
+
body = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26724
26909
|
break;
|
|
26725
26910
|
case "--cwd":
|
|
26726
|
-
cwd =
|
|
26911
|
+
cwd = requireValue14(rest, token);
|
|
26727
26912
|
break;
|
|
26728
26913
|
default:
|
|
26729
26914
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26753,10 +26938,10 @@ function parseLinearCommentsArgs(tokens) {
|
|
|
26753
26938
|
const token = rest.shift();
|
|
26754
26939
|
switch (token) {
|
|
26755
26940
|
case "--account":
|
|
26756
|
-
account =
|
|
26941
|
+
account = requireValue14(rest, token);
|
|
26757
26942
|
break;
|
|
26758
26943
|
case "--cwd":
|
|
26759
|
-
cwd =
|
|
26944
|
+
cwd = requireValue14(rest, token);
|
|
26760
26945
|
break;
|
|
26761
26946
|
default:
|
|
26762
26947
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26780,16 +26965,16 @@ function parseLinearCycleArgs(tokens) {
|
|
|
26780
26965
|
const token = rest.shift();
|
|
26781
26966
|
switch (token) {
|
|
26782
26967
|
case "--account":
|
|
26783
|
-
account =
|
|
26968
|
+
account = requireValue14(rest, token);
|
|
26784
26969
|
break;
|
|
26785
26970
|
case "--team-id":
|
|
26786
|
-
teamId =
|
|
26971
|
+
teamId = requireValue14(rest, token);
|
|
26787
26972
|
break;
|
|
26788
26973
|
case "--team-key":
|
|
26789
|
-
teamKey =
|
|
26974
|
+
teamKey = requireValue14(rest, token);
|
|
26790
26975
|
break;
|
|
26791
26976
|
case "--cwd":
|
|
26792
|
-
cwd =
|
|
26977
|
+
cwd = requireValue14(rest, token);
|
|
26793
26978
|
break;
|
|
26794
26979
|
default:
|
|
26795
26980
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26812,10 +26997,10 @@ function parseLinearTeamsArgs(tokens) {
|
|
|
26812
26997
|
const token = rest.shift();
|
|
26813
26998
|
switch (token) {
|
|
26814
26999
|
case "--account":
|
|
26815
|
-
account =
|
|
27000
|
+
account = requireValue14(rest, token);
|
|
26816
27001
|
break;
|
|
26817
27002
|
case "--cwd":
|
|
26818
|
-
cwd =
|
|
27003
|
+
cwd = requireValue14(rest, token);
|
|
26819
27004
|
break;
|
|
26820
27005
|
default:
|
|
26821
27006
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26842,16 +27027,16 @@ function parseLinearUserIssuesArgs(tokens) {
|
|
|
26842
27027
|
const token = rest.shift();
|
|
26843
27028
|
switch (token) {
|
|
26844
27029
|
case "--account":
|
|
26845
|
-
account =
|
|
27030
|
+
account = requireValue14(rest, token);
|
|
26846
27031
|
break;
|
|
26847
27032
|
case "--cycle":
|
|
26848
|
-
cycle = parseLinearCycle(
|
|
27033
|
+
cycle = parseLinearCycle(requireValue14(rest, token));
|
|
26849
27034
|
break;
|
|
26850
27035
|
case "--status":
|
|
26851
|
-
status = parseLinearStatus(
|
|
27036
|
+
status = parseLinearStatus(requireValue14(rest, token));
|
|
26852
27037
|
break;
|
|
26853
27038
|
case "--cwd":
|
|
26854
|
-
cwd =
|
|
27039
|
+
cwd = requireValue14(rest, token);
|
|
26855
27040
|
break;
|
|
26856
27041
|
default:
|
|
26857
27042
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26885,28 +27070,28 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
26885
27070
|
const token = rest.shift();
|
|
26886
27071
|
switch (token) {
|
|
26887
27072
|
case "--account":
|
|
26888
|
-
account =
|
|
27073
|
+
account = requireValue14(rest, token);
|
|
26889
27074
|
break;
|
|
26890
27075
|
case "--team-id":
|
|
26891
|
-
teamId =
|
|
27076
|
+
teamId = requireValue14(rest, token);
|
|
26892
27077
|
break;
|
|
26893
27078
|
case "--team-key":
|
|
26894
|
-
teamKey =
|
|
27079
|
+
teamKey = requireValue14(rest, token);
|
|
26895
27080
|
break;
|
|
26896
27081
|
case "--user":
|
|
26897
|
-
user =
|
|
27082
|
+
user = requireValue14(rest, token);
|
|
26898
27083
|
break;
|
|
26899
27084
|
case "--cycle":
|
|
26900
|
-
cycle = parseLinearCycle(
|
|
27085
|
+
cycle = parseLinearCycle(requireValue14(rest, token));
|
|
26901
27086
|
break;
|
|
26902
27087
|
case "--status":
|
|
26903
|
-
status = parseLinearStatus(
|
|
27088
|
+
status = parseLinearStatus(requireValue14(rest, token));
|
|
26904
27089
|
break;
|
|
26905
27090
|
case "--query":
|
|
26906
|
-
query =
|
|
27091
|
+
query = requireValue14(rest, token).trim();
|
|
26907
27092
|
break;
|
|
26908
27093
|
case "--limit": {
|
|
26909
|
-
const value = Number.parseInt(
|
|
27094
|
+
const value = Number.parseInt(requireValue14(rest, token), 10);
|
|
26910
27095
|
if (!Number.isInteger(value) || value < 1 || value > 250) {
|
|
26911
27096
|
throw new Error("Invalid --limit. Expected an integer between 1 and 250.");
|
|
26912
27097
|
}
|
|
@@ -26914,7 +27099,7 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
26914
27099
|
break;
|
|
26915
27100
|
}
|
|
26916
27101
|
case "--cwd":
|
|
26917
|
-
cwd =
|
|
27102
|
+
cwd = requireValue14(rest, token);
|
|
26918
27103
|
break;
|
|
26919
27104
|
default:
|
|
26920
27105
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26955,10 +27140,10 @@ function parseLinearLegacyArgs(tokens) {
|
|
|
26955
27140
|
useScreenshot = true;
|
|
26956
27141
|
break;
|
|
26957
27142
|
case "--account":
|
|
26958
|
-
account =
|
|
27143
|
+
account = requireValue14(rest, token);
|
|
26959
27144
|
break;
|
|
26960
27145
|
case "--cwd":
|
|
26961
|
-
cwd =
|
|
27146
|
+
cwd = requireValue14(rest, token);
|
|
26962
27147
|
break;
|
|
26963
27148
|
default:
|
|
26964
27149
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -27052,19 +27237,19 @@ function parseNotionArgs(tokens) {
|
|
|
27052
27237
|
const token = rest.shift();
|
|
27053
27238
|
switch (token) {
|
|
27054
27239
|
case "--parent":
|
|
27055
|
-
parentPageId =
|
|
27240
|
+
parentPageId = requireValue14(rest, token);
|
|
27056
27241
|
break;
|
|
27057
27242
|
case "--title":
|
|
27058
|
-
title =
|
|
27243
|
+
title = requireValue14(rest, token);
|
|
27059
27244
|
break;
|
|
27060
27245
|
case "--private":
|
|
27061
27246
|
isPrivate = true;
|
|
27062
27247
|
break;
|
|
27063
27248
|
case "--content":
|
|
27064
|
-
content2 =
|
|
27249
|
+
content2 = requireValue14(rest, token);
|
|
27065
27250
|
break;
|
|
27066
27251
|
case "--file":
|
|
27067
|
-
filePath2 =
|
|
27252
|
+
filePath2 = requireValue14(rest, token);
|
|
27068
27253
|
break;
|
|
27069
27254
|
default:
|
|
27070
27255
|
throw new Error(`Unknown notion option: ${token}`);
|
|
@@ -27108,10 +27293,10 @@ function parseNotionArgs(tokens) {
|
|
|
27108
27293
|
const token = rest.shift();
|
|
27109
27294
|
switch (token) {
|
|
27110
27295
|
case "--content":
|
|
27111
|
-
content =
|
|
27296
|
+
content = requireValue14(rest, token);
|
|
27112
27297
|
break;
|
|
27113
27298
|
case "--file":
|
|
27114
|
-
filePath =
|
|
27299
|
+
filePath = requireValue14(rest, token);
|
|
27115
27300
|
break;
|
|
27116
27301
|
case "--append":
|
|
27117
27302
|
append = true;
|
|
@@ -27156,11 +27341,11 @@ function parseRandomArgs(tokens) {
|
|
|
27156
27341
|
mode = "easy";
|
|
27157
27342
|
break;
|
|
27158
27343
|
case "--length":
|
|
27159
|
-
length = parsePositiveInt2(
|
|
27344
|
+
length = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27160
27345
|
seenLength = true;
|
|
27161
27346
|
break;
|
|
27162
27347
|
case "--charset": {
|
|
27163
|
-
const value =
|
|
27348
|
+
const value = requireValue14(rest, token);
|
|
27164
27349
|
if (!["base64url", "hex", "alnum", "ascii"].includes(value)) {
|
|
27165
27350
|
throw new Error(
|
|
27166
27351
|
`Invalid --charset value: ${value}. Use base64url|hex|alnum|ascii.`
|
|
@@ -27171,18 +27356,18 @@ function parseRandomArgs(tokens) {
|
|
|
27171
27356
|
break;
|
|
27172
27357
|
}
|
|
27173
27358
|
case "--count":
|
|
27174
|
-
count = parsePositiveInt2(
|
|
27359
|
+
count = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27175
27360
|
break;
|
|
27176
27361
|
case "--words":
|
|
27177
|
-
words = parsePositiveInt2(
|
|
27362
|
+
words = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27178
27363
|
seenWords = true;
|
|
27179
27364
|
break;
|
|
27180
27365
|
case "--digits":
|
|
27181
|
-
digits = parseNonNegativeInt(
|
|
27366
|
+
digits = parseNonNegativeInt(requireValue14(rest, token), token);
|
|
27182
27367
|
seenDigits = true;
|
|
27183
27368
|
break;
|
|
27184
27369
|
case "--separator":
|
|
27185
|
-
separator =
|
|
27370
|
+
separator = requireValue14(rest, token);
|
|
27186
27371
|
seenSeparator = true;
|
|
27187
27372
|
break;
|
|
27188
27373
|
default:
|
|
@@ -27213,7 +27398,7 @@ function parseRandomArgs(tokens) {
|
|
|
27213
27398
|
count
|
|
27214
27399
|
};
|
|
27215
27400
|
}
|
|
27216
|
-
function
|
|
27401
|
+
function requireValue14(tokens, optionName) {
|
|
27217
27402
|
const value = tokens.shift();
|
|
27218
27403
|
if (!value) {
|
|
27219
27404
|
throw new Error(`Missing value for ${optionName}`);
|