@pmate/cli 0.24.41 → 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 +381 -137
- 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
|
}
|
|
@@ -18931,7 +19047,7 @@ var ServiceRuntimeRunner = class {
|
|
|
18931
19047
|
if (cwd) {
|
|
18932
19048
|
return import_node_path24.default.resolve(process.cwd(), cwd);
|
|
18933
19049
|
}
|
|
18934
|
-
const repository = this.getType(service) === "vite" || this.getType(service) === "static" ? this.
|
|
19050
|
+
const repository = this.getType(service) === "vite" || this.getType(service) === "static" ? this.getRepoStaticSite(service).repository.trim() : this.getType(service) === "fc" ? this.getFc(service).repository?.trim() : this.getType(service) === "ios" || this.getType(service) === "android" ? void 0 : this.getNetwork(service).repository?.trim();
|
|
18935
19051
|
if (repository) {
|
|
18936
19052
|
const repoName = repository.replace(/\/+$/, "").split("/").pop()?.replace(/\.git$/i, "");
|
|
18937
19053
|
if (repoName) {
|
|
@@ -18950,13 +19066,14 @@ var ServiceRuntimeRunner = class {
|
|
|
18950
19066
|
}
|
|
18951
19067
|
resolveLocalDir(service, cwd) {
|
|
18952
19068
|
const repoRoot = this.resolveRepoRoot(service, cwd);
|
|
18953
|
-
const dir = this.getType(service) === "vite" || this.getType(service) === "static" ? this.
|
|
19069
|
+
const dir = this.getType(service) === "vite" || this.getType(service) === "static" ? this.getRepoStaticSite(service).dir.trim() : this.getType(service) === "fc" ? this.getFc(service).dir?.trim() : this.getType(service) === "ios" || this.getType(service) === "android" ? void 0 : this.getNetwork(service).dir?.trim();
|
|
18954
19070
|
if (!dir) {
|
|
18955
19071
|
throw new Error(`Missing service dir for ${service.id}`);
|
|
18956
19072
|
}
|
|
18957
19073
|
return import_node_path24.default.resolve(repoRoot, dir);
|
|
18958
19074
|
}
|
|
18959
19075
|
async deployVite(service, options) {
|
|
19076
|
+
this.assertDeployableStaticSite(service);
|
|
18960
19077
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
18961
19078
|
const packageJsonPath = import_node_path24.default.join(appDir, "package.json");
|
|
18962
19079
|
if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
|
|
@@ -18986,6 +19103,7 @@ var ServiceRuntimeRunner = class {
|
|
|
18986
19103
|
await AliyunService.uploadDirectory(distDir, bucketName);
|
|
18987
19104
|
}
|
|
18988
19105
|
async deployStatic(service, options) {
|
|
19106
|
+
this.assertDeployableStaticSite(service);
|
|
18989
19107
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
18990
19108
|
const srcDir = import_node_path24.default.join(appDir, "src");
|
|
18991
19109
|
if (!(0, import_node_fs20.existsSync)(srcDir)) {
|
|
@@ -19311,6 +19429,9 @@ var ServiceRuntimeRunner = class {
|
|
|
19311
19429
|
}
|
|
19312
19430
|
async initStaticLike(service) {
|
|
19313
19431
|
const site = this.getSite(service);
|
|
19432
|
+
if (site.exposeType === "managed-oss-cdn") {
|
|
19433
|
+
throw new Error(`Service ${service.id} is managed-oss-cdn and cannot be initialized`);
|
|
19434
|
+
}
|
|
19314
19435
|
const bucketName = site.bucket?.trim();
|
|
19315
19436
|
const baseDomain = site.domain?.trim();
|
|
19316
19437
|
if (!bucketName) {
|
|
@@ -19327,6 +19448,19 @@ var ServiceRuntimeRunner = class {
|
|
|
19327
19448
|
routeType: this.getType(service) === "vite" ? "spa" : "spa"
|
|
19328
19449
|
});
|
|
19329
19450
|
}
|
|
19451
|
+
assertDeployableStaticSite(service) {
|
|
19452
|
+
const site = this.getSite(service);
|
|
19453
|
+
if (site.exposeType === "managed-oss-cdn") {
|
|
19454
|
+
throw new Error(`Service ${service.id} is managed-oss-cdn and cannot be deployed`);
|
|
19455
|
+
}
|
|
19456
|
+
}
|
|
19457
|
+
getRepoStaticSite(service) {
|
|
19458
|
+
const site = this.getSite(service);
|
|
19459
|
+
if (site.exposeType === "managed-oss-cdn") {
|
|
19460
|
+
throw new Error(`Service ${service.id} is managed-oss-cdn and has no repository or dir`);
|
|
19461
|
+
}
|
|
19462
|
+
return site;
|
|
19463
|
+
}
|
|
19330
19464
|
async initServerApp(service, options, config) {
|
|
19331
19465
|
const network = this.getNetwork(service);
|
|
19332
19466
|
const subdomain = "subdomain" in network ? network.subdomain?.trim() : void 0;
|
|
@@ -25089,6 +25223,110 @@ function requireValue10(tokens, optionName) {
|
|
|
25089
25223
|
return value;
|
|
25090
25224
|
}
|
|
25091
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
|
+
|
|
25092
25330
|
// src/chatRoomCommandParser.ts
|
|
25093
25331
|
function parseChatRoomArgs(tokens) {
|
|
25094
25332
|
const rest = [...tokens];
|
|
@@ -25188,12 +25426,12 @@ function parseShared(tokens) {
|
|
|
25188
25426
|
case "--title":
|
|
25189
25427
|
case "--bot-a":
|
|
25190
25428
|
case "--bot-b":
|
|
25191
|
-
options.set(token,
|
|
25429
|
+
options.set(token, requireValue12(tokens, token));
|
|
25192
25430
|
break;
|
|
25193
25431
|
case "--member":
|
|
25194
25432
|
case "--recipient": {
|
|
25195
25433
|
const values = multiOptions.get(token) ?? [];
|
|
25196
|
-
values.push(
|
|
25434
|
+
values.push(requireValue12(tokens, token));
|
|
25197
25435
|
multiOptions.set(token, values);
|
|
25198
25436
|
break;
|
|
25199
25437
|
}
|
|
@@ -25219,7 +25457,7 @@ function requiredOption(options, option) {
|
|
|
25219
25457
|
}
|
|
25220
25458
|
return value;
|
|
25221
25459
|
}
|
|
25222
|
-
function
|
|
25460
|
+
function requireValue12(tokens, option) {
|
|
25223
25461
|
const value = tokens.shift();
|
|
25224
25462
|
if (!value || value.startsWith("--")) {
|
|
25225
25463
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -25254,7 +25492,7 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25254
25492
|
close = true;
|
|
25255
25493
|
break;
|
|
25256
25494
|
case "--env": {
|
|
25257
|
-
const rawValue =
|
|
25495
|
+
const rawValue = requireValue13(rest, token);
|
|
25258
25496
|
const parsed = Number.parseInt(rawValue, 10);
|
|
25259
25497
|
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
25260
25498
|
throw new Error(`Invalid --env value: ${rawValue}`);
|
|
@@ -25263,13 +25501,13 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25263
25501
|
break;
|
|
25264
25502
|
}
|
|
25265
25503
|
case "--env-root":
|
|
25266
|
-
envRoot =
|
|
25504
|
+
envRoot = requireValue13(rest, token);
|
|
25267
25505
|
break;
|
|
25268
25506
|
case "--base-root":
|
|
25269
|
-
baseRoot =
|
|
25507
|
+
baseRoot = requireValue13(rest, token);
|
|
25270
25508
|
break;
|
|
25271
25509
|
case "--note":
|
|
25272
|
-
note =
|
|
25510
|
+
note = requireValue13(rest, token);
|
|
25273
25511
|
break;
|
|
25274
25512
|
case "--json":
|
|
25275
25513
|
json = true;
|
|
@@ -25305,7 +25543,7 @@ function parsePrepareDevArgs(tokens) {
|
|
|
25305
25543
|
json
|
|
25306
25544
|
};
|
|
25307
25545
|
}
|
|
25308
|
-
function
|
|
25546
|
+
function requireValue13(tokens, option) {
|
|
25309
25547
|
const value = tokens.shift();
|
|
25310
25548
|
if (!value || value.startsWith("-")) {
|
|
25311
25549
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -25397,7 +25635,10 @@ var HELP_TEXT = [
|
|
|
25397
25635
|
` ${import_chalk4.default.gray(" [--length <n>] [--charset base64url|hex|alnum|ascii]")}`,
|
|
25398
25636
|
` ${import_chalk4.default.gray(" [--count <n>]")}`,
|
|
25399
25637
|
` ${import_chalk4.default.gray(" --easy [--words <n>] [--digits <n>] [--separator <s>] [--count <n>]")}`,
|
|
25400
|
-
` ${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`,
|
|
25401
25642
|
` ${import_chalk4.default.gray(" sync (--source <cc|yelling> | --endpoint <url>)")}`,
|
|
25402
25643
|
` ${import_chalk4.default.cyan("chat-room")} Run social chat regression commands with PMate bot key JSON`,
|
|
25403
25644
|
` ${import_chalk4.default.gray(" join|request-friend|accept-friend|delete-friend|send|group-create|group-send|smoke --app <ns:app> --bot <file>")}`,
|
|
@@ -25561,10 +25802,10 @@ function parseCommandArgs(args) {
|
|
|
25561
25802
|
const token = rest.shift();
|
|
25562
25803
|
switch (token) {
|
|
25563
25804
|
case "--app":
|
|
25564
|
-
app =
|
|
25805
|
+
app = requireValue14(rest, token);
|
|
25565
25806
|
break;
|
|
25566
25807
|
case "--profile-id":
|
|
25567
|
-
profileId =
|
|
25808
|
+
profileId = requireValue14(rest, token);
|
|
25568
25809
|
break;
|
|
25569
25810
|
default:
|
|
25570
25811
|
throw new Error(`Unknown login option: ${token}`);
|
|
@@ -25626,6 +25867,9 @@ function parseCommandArgs(args) {
|
|
|
25626
25867
|
if (args.rest[0] === "collect") {
|
|
25627
25868
|
return parseCollectArgs(args.rest.slice(1));
|
|
25628
25869
|
}
|
|
25870
|
+
if (args.rest[0] === "im1") {
|
|
25871
|
+
return parseIm1Args(args.rest.slice(1));
|
|
25872
|
+
}
|
|
25629
25873
|
if (args.rest[0] === "chat-room") {
|
|
25630
25874
|
return parseChatRoomArgs(args.rest.slice(1));
|
|
25631
25875
|
}
|
|
@@ -25673,7 +25917,7 @@ function parseVercelArgs(tokens) {
|
|
|
25673
25917
|
const token = rest.shift();
|
|
25674
25918
|
switch (token) {
|
|
25675
25919
|
case "--scope":
|
|
25676
|
-
scope =
|
|
25920
|
+
scope = requireValue14(rest, token);
|
|
25677
25921
|
break;
|
|
25678
25922
|
default:
|
|
25679
25923
|
throw new Error(`Unknown vercel option: ${token}`);
|
|
@@ -25693,10 +25937,10 @@ function parseVercelArgs(tokens) {
|
|
|
25693
25937
|
const token = rest.shift();
|
|
25694
25938
|
switch (token) {
|
|
25695
25939
|
case "--scope":
|
|
25696
|
-
scope =
|
|
25940
|
+
scope = requireValue14(rest, token);
|
|
25697
25941
|
break;
|
|
25698
25942
|
case "--project":
|
|
25699
|
-
project =
|
|
25943
|
+
project = requireValue14(rest, token);
|
|
25700
25944
|
break;
|
|
25701
25945
|
case "--last-week":
|
|
25702
25946
|
lastWeek = true;
|
|
@@ -25727,16 +25971,16 @@ function parseAddDnsArgs(tokens) {
|
|
|
25727
25971
|
const token = rest.shift();
|
|
25728
25972
|
switch (token) {
|
|
25729
25973
|
case "--type":
|
|
25730
|
-
options.dnsType =
|
|
25974
|
+
options.dnsType = requireValue14(rest, token);
|
|
25731
25975
|
break;
|
|
25732
25976
|
case "--value":
|
|
25733
|
-
options.dnsValue =
|
|
25977
|
+
options.dnsValue = requireValue14(rest, token);
|
|
25734
25978
|
break;
|
|
25735
25979
|
case "--rr":
|
|
25736
|
-
options.dnsRr =
|
|
25980
|
+
options.dnsRr = requireValue14(rest, token);
|
|
25737
25981
|
break;
|
|
25738
25982
|
case "--ttl": {
|
|
25739
|
-
const ttlValue =
|
|
25983
|
+
const ttlValue = requireValue14(rest, token);
|
|
25740
25984
|
const ttl = Number.parseInt(ttlValue, 10);
|
|
25741
25985
|
if (!Number.isFinite(ttl) || ttl <= 0) {
|
|
25742
25986
|
throw new Error(`Invalid --ttl value: ${ttlValue}`);
|
|
@@ -25745,7 +25989,7 @@ function parseAddDnsArgs(tokens) {
|
|
|
25745
25989
|
break;
|
|
25746
25990
|
}
|
|
25747
25991
|
case "--domain":
|
|
25748
|
-
options.dnsDomain =
|
|
25992
|
+
options.dnsDomain = requireValue14(rest, token);
|
|
25749
25993
|
break;
|
|
25750
25994
|
default:
|
|
25751
25995
|
throw new Error(`Unknown add-dns option: ${token}`);
|
|
@@ -25778,13 +26022,13 @@ function parseBucketArgs(tokens) {
|
|
|
25778
26022
|
options.bucketCreate = true;
|
|
25779
26023
|
break;
|
|
25780
26024
|
case "--name":
|
|
25781
|
-
options.bucketName =
|
|
26025
|
+
options.bucketName = requireValue14(rest, token);
|
|
25782
26026
|
break;
|
|
25783
26027
|
case "--subdomain":
|
|
25784
|
-
options.bucketSubdomain =
|
|
26028
|
+
options.bucketSubdomain = requireValue14(rest, token);
|
|
25785
26029
|
break;
|
|
25786
26030
|
case "--domain":
|
|
25787
|
-
options.bucketDomain =
|
|
26031
|
+
options.bucketDomain = requireValue14(rest, token);
|
|
25788
26032
|
break;
|
|
25789
26033
|
default:
|
|
25790
26034
|
throw new Error(`Unknown bucket option: ${token}`);
|
|
@@ -25816,7 +26060,7 @@ function parseDevArgs(tokens) {
|
|
|
25816
26060
|
const token = rest.shift();
|
|
25817
26061
|
switch (token) {
|
|
25818
26062
|
case "--cwd":
|
|
25819
|
-
options.devCwd =
|
|
26063
|
+
options.devCwd = requireValue14(rest, token);
|
|
25820
26064
|
break;
|
|
25821
26065
|
default:
|
|
25822
26066
|
throw new Error(`Unknown dev option: ${token}`);
|
|
@@ -25836,7 +26080,7 @@ function parseDeleteArgs(tokens) {
|
|
|
25836
26080
|
const token = rest.shift();
|
|
25837
26081
|
switch (token) {
|
|
25838
26082
|
case "--cwd":
|
|
25839
|
-
deleteCwd =
|
|
26083
|
+
deleteCwd = requireValue14(rest, token);
|
|
25840
26084
|
break;
|
|
25841
26085
|
default:
|
|
25842
26086
|
throw new Error(`Unknown delete option: ${token}`);
|
|
@@ -25870,13 +26114,13 @@ function parseOssArgs(tokens) {
|
|
|
25870
26114
|
const token = rest.shift();
|
|
25871
26115
|
switch (token) {
|
|
25872
26116
|
case "--bucket":
|
|
25873
|
-
bucket =
|
|
26117
|
+
bucket = requireValue14(rest, token);
|
|
25874
26118
|
break;
|
|
25875
26119
|
case "--file":
|
|
25876
|
-
filePath =
|
|
26120
|
+
filePath = requireValue14(rest, token);
|
|
25877
26121
|
break;
|
|
25878
26122
|
case "--key":
|
|
25879
|
-
objectKey =
|
|
26123
|
+
objectKey = requireValue14(rest, token);
|
|
25880
26124
|
break;
|
|
25881
26125
|
default:
|
|
25882
26126
|
throw new Error(`Unknown oss option: ${token}`);
|
|
@@ -25909,7 +26153,7 @@ function parseEnvArgs(tokens) {
|
|
|
25909
26153
|
throw new Error("Only one env action is allowed.");
|
|
25910
26154
|
}
|
|
25911
26155
|
action = "set";
|
|
25912
|
-
key =
|
|
26156
|
+
key = requireValue14(rest, token);
|
|
25913
26157
|
break;
|
|
25914
26158
|
case "--list":
|
|
25915
26159
|
if (action) {
|
|
@@ -25922,17 +26166,17 @@ function parseEnvArgs(tokens) {
|
|
|
25922
26166
|
throw new Error("Only one env action is allowed.");
|
|
25923
26167
|
}
|
|
25924
26168
|
action = "delete";
|
|
25925
|
-
key =
|
|
26169
|
+
key = requireValue14(rest, token);
|
|
25926
26170
|
break;
|
|
25927
26171
|
case "--value":
|
|
25928
|
-
value =
|
|
26172
|
+
value = requireValue14(rest, token);
|
|
25929
26173
|
break;
|
|
25930
26174
|
case "--verbose":
|
|
25931
26175
|
case "-v":
|
|
25932
26176
|
verbose = true;
|
|
25933
26177
|
break;
|
|
25934
26178
|
case "--cwd":
|
|
25935
|
-
cwd =
|
|
26179
|
+
cwd = requireValue14(rest, token);
|
|
25936
26180
|
break;
|
|
25937
26181
|
default:
|
|
25938
26182
|
throw new Error(`Unknown env option: ${token}`);
|
|
@@ -25990,7 +26234,7 @@ function parseCommitArgs(tokens) {
|
|
|
25990
26234
|
push = true;
|
|
25991
26235
|
break;
|
|
25992
26236
|
case "--cwd":
|
|
25993
|
-
cwd =
|
|
26237
|
+
cwd = requireValue14(rest, token);
|
|
25994
26238
|
break;
|
|
25995
26239
|
default:
|
|
25996
26240
|
throw new Error(`Unknown commit option: ${token}`);
|
|
@@ -26006,10 +26250,10 @@ function parseSummaryArgs(tokens) {
|
|
|
26006
26250
|
const token = rest.shift();
|
|
26007
26251
|
switch (token) {
|
|
26008
26252
|
case "--pr":
|
|
26009
|
-
prRef =
|
|
26253
|
+
prRef = requireValue14(rest, token);
|
|
26010
26254
|
break;
|
|
26011
26255
|
case "--cwd":
|
|
26012
|
-
cwd =
|
|
26256
|
+
cwd = requireValue14(rest, token);
|
|
26013
26257
|
break;
|
|
26014
26258
|
default:
|
|
26015
26259
|
throw new Error(`Unknown summary option: ${token}`);
|
|
@@ -26034,13 +26278,13 @@ function parseQuizArgs(tokens) {
|
|
|
26034
26278
|
const token = rest.shift();
|
|
26035
26279
|
switch (token) {
|
|
26036
26280
|
case "--paper-id":
|
|
26037
|
-
paperId =
|
|
26281
|
+
paperId = requireValue14(rest, token);
|
|
26038
26282
|
break;
|
|
26039
26283
|
case "--base-url":
|
|
26040
|
-
apiBaseUrl =
|
|
26284
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26041
26285
|
break;
|
|
26042
26286
|
case "--link-base":
|
|
26043
|
-
linkBaseUrl =
|
|
26287
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26044
26288
|
break;
|
|
26045
26289
|
default:
|
|
26046
26290
|
throw new Error(`Unknown quiz create-draft option: ${token}`);
|
|
@@ -26066,16 +26310,16 @@ function parseQuizArgs(tokens) {
|
|
|
26066
26310
|
const token = rest.shift();
|
|
26067
26311
|
switch (token) {
|
|
26068
26312
|
case "--paper-id":
|
|
26069
|
-
paperId =
|
|
26313
|
+
paperId = requireValue14(rest, token);
|
|
26070
26314
|
break;
|
|
26071
26315
|
case "--file":
|
|
26072
|
-
filePath =
|
|
26316
|
+
filePath = requireValue14(rest, token);
|
|
26073
26317
|
break;
|
|
26074
26318
|
case "--base-url":
|
|
26075
|
-
apiBaseUrl =
|
|
26319
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26076
26320
|
break;
|
|
26077
26321
|
case "--link-base":
|
|
26078
|
-
linkBaseUrl =
|
|
26322
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26079
26323
|
break;
|
|
26080
26324
|
default:
|
|
26081
26325
|
throw new Error(`Unknown quiz update-meta option: ${token}`);
|
|
@@ -26105,16 +26349,16 @@ function parseQuizArgs(tokens) {
|
|
|
26105
26349
|
const token = rest.shift();
|
|
26106
26350
|
switch (token) {
|
|
26107
26351
|
case "--paper-id":
|
|
26108
|
-
paperId =
|
|
26352
|
+
paperId = requireValue14(rest, token);
|
|
26109
26353
|
break;
|
|
26110
26354
|
case "--file":
|
|
26111
|
-
filePath =
|
|
26355
|
+
filePath = requireValue14(rest, token);
|
|
26112
26356
|
break;
|
|
26113
26357
|
case "--base-url":
|
|
26114
|
-
apiBaseUrl =
|
|
26358
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26115
26359
|
break;
|
|
26116
26360
|
case "--link-base":
|
|
26117
|
-
linkBaseUrl =
|
|
26361
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26118
26362
|
break;
|
|
26119
26363
|
default:
|
|
26120
26364
|
throw new Error(`Unknown quiz append-step option: ${token}`);
|
|
@@ -26145,19 +26389,19 @@ function parseQuizArgs(tokens) {
|
|
|
26145
26389
|
const token = rest.shift();
|
|
26146
26390
|
switch (token) {
|
|
26147
26391
|
case "--paper-id":
|
|
26148
|
-
paperId =
|
|
26392
|
+
paperId = requireValue14(rest, token);
|
|
26149
26393
|
break;
|
|
26150
26394
|
case "--step-id":
|
|
26151
|
-
stepId =
|
|
26395
|
+
stepId = requireValue14(rest, token);
|
|
26152
26396
|
break;
|
|
26153
26397
|
case "--file":
|
|
26154
|
-
filePath =
|
|
26398
|
+
filePath = requireValue14(rest, token);
|
|
26155
26399
|
break;
|
|
26156
26400
|
case "--base-url":
|
|
26157
|
-
apiBaseUrl =
|
|
26401
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26158
26402
|
break;
|
|
26159
26403
|
case "--link-base":
|
|
26160
|
-
linkBaseUrl =
|
|
26404
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26161
26405
|
break;
|
|
26162
26406
|
default:
|
|
26163
26407
|
throw new Error(`Unknown quiz update-step option: ${token}`);
|
|
@@ -26191,16 +26435,16 @@ function parseQuizArgs(tokens) {
|
|
|
26191
26435
|
const token = rest.shift();
|
|
26192
26436
|
switch (token) {
|
|
26193
26437
|
case "--paper-id":
|
|
26194
|
-
paperId =
|
|
26438
|
+
paperId = requireValue14(rest, token);
|
|
26195
26439
|
break;
|
|
26196
26440
|
case "--step-ids":
|
|
26197
|
-
stepIdsRaw =
|
|
26441
|
+
stepIdsRaw = requireValue14(rest, token);
|
|
26198
26442
|
break;
|
|
26199
26443
|
case "--base-url":
|
|
26200
|
-
apiBaseUrl =
|
|
26444
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26201
26445
|
break;
|
|
26202
26446
|
case "--link-base":
|
|
26203
|
-
linkBaseUrl =
|
|
26447
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26204
26448
|
break;
|
|
26205
26449
|
default:
|
|
26206
26450
|
throw new Error(`Unknown quiz reorder option: ${token}`);
|
|
@@ -26234,16 +26478,16 @@ function parseQuizArgs(tokens) {
|
|
|
26234
26478
|
const token = rest.shift();
|
|
26235
26479
|
switch (token) {
|
|
26236
26480
|
case "--paper-id":
|
|
26237
|
-
paperId =
|
|
26481
|
+
paperId = requireValue14(rest, token);
|
|
26238
26482
|
break;
|
|
26239
26483
|
case "--step-id":
|
|
26240
|
-
stepId =
|
|
26484
|
+
stepId = requireValue14(rest, token);
|
|
26241
26485
|
break;
|
|
26242
26486
|
case "--base-url":
|
|
26243
|
-
apiBaseUrl =
|
|
26487
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26244
26488
|
break;
|
|
26245
26489
|
case "--link-base":
|
|
26246
|
-
linkBaseUrl =
|
|
26490
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26247
26491
|
break;
|
|
26248
26492
|
default:
|
|
26249
26493
|
throw new Error(`Unknown quiz delete-step option: ${token}`);
|
|
@@ -26272,13 +26516,13 @@ function parseQuizArgs(tokens) {
|
|
|
26272
26516
|
const token = rest.shift();
|
|
26273
26517
|
switch (token) {
|
|
26274
26518
|
case "--paper-id":
|
|
26275
|
-
paperId =
|
|
26519
|
+
paperId = requireValue14(rest, token);
|
|
26276
26520
|
break;
|
|
26277
26521
|
case "--base-url":
|
|
26278
|
-
apiBaseUrl =
|
|
26522
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26279
26523
|
break;
|
|
26280
26524
|
case "--link-base":
|
|
26281
|
-
linkBaseUrl =
|
|
26525
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26282
26526
|
break;
|
|
26283
26527
|
default:
|
|
26284
26528
|
throw new Error(`Unknown quiz activate option: ${token}`);
|
|
@@ -26303,13 +26547,13 @@ function parseQuizArgs(tokens) {
|
|
|
26303
26547
|
const token = rest.shift();
|
|
26304
26548
|
switch (token) {
|
|
26305
26549
|
case "--paper-id":
|
|
26306
|
-
paperId =
|
|
26550
|
+
paperId = requireValue14(rest, token);
|
|
26307
26551
|
break;
|
|
26308
26552
|
case "--base-url":
|
|
26309
|
-
apiBaseUrl =
|
|
26553
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26310
26554
|
break;
|
|
26311
26555
|
case "--link-base":
|
|
26312
|
-
linkBaseUrl =
|
|
26556
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26313
26557
|
break;
|
|
26314
26558
|
default:
|
|
26315
26559
|
throw new Error(`Unknown quiz view option: ${token}`);
|
|
@@ -26338,22 +26582,22 @@ function parseQuizArgs(tokens) {
|
|
|
26338
26582
|
const token = rest.shift();
|
|
26339
26583
|
switch (token) {
|
|
26340
26584
|
case "--paper-id":
|
|
26341
|
-
paperId =
|
|
26585
|
+
paperId = requireValue14(rest, token);
|
|
26342
26586
|
break;
|
|
26343
26587
|
case "--step-id":
|
|
26344
|
-
stepId =
|
|
26588
|
+
stepId = requireValue14(rest, token);
|
|
26345
26589
|
break;
|
|
26346
26590
|
case "--file":
|
|
26347
|
-
filePath =
|
|
26591
|
+
filePath = requireValue14(rest, token);
|
|
26348
26592
|
break;
|
|
26349
26593
|
case "--new-paper-id":
|
|
26350
|
-
newPaperId =
|
|
26594
|
+
newPaperId = requireValue14(rest, token);
|
|
26351
26595
|
break;
|
|
26352
26596
|
case "--base-url":
|
|
26353
|
-
apiBaseUrl =
|
|
26597
|
+
apiBaseUrl = requireValue14(rest, token);
|
|
26354
26598
|
break;
|
|
26355
26599
|
case "--link-base":
|
|
26356
|
-
linkBaseUrl =
|
|
26600
|
+
linkBaseUrl = requireValue14(rest, token);
|
|
26357
26601
|
break;
|
|
26358
26602
|
case "--activate":
|
|
26359
26603
|
activate = true;
|
|
@@ -26443,10 +26687,10 @@ function parseLinearPrArgs(tokens) {
|
|
|
26443
26687
|
const token = rest.shift();
|
|
26444
26688
|
switch (token) {
|
|
26445
26689
|
case "--account":
|
|
26446
|
-
account =
|
|
26690
|
+
account = requireValue14(rest, token);
|
|
26447
26691
|
break;
|
|
26448
26692
|
case "--cwd":
|
|
26449
|
-
cwd =
|
|
26693
|
+
cwd = requireValue14(rest, token);
|
|
26450
26694
|
break;
|
|
26451
26695
|
default:
|
|
26452
26696
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26475,35 +26719,35 @@ function parseLinearCreateArgs(tokens) {
|
|
|
26475
26719
|
const token = rest.shift();
|
|
26476
26720
|
switch (token) {
|
|
26477
26721
|
case "--account":
|
|
26478
|
-
account =
|
|
26722
|
+
account = requireValue14(rest, token);
|
|
26479
26723
|
break;
|
|
26480
26724
|
case "--repl":
|
|
26481
26725
|
useRepl = true;
|
|
26482
26726
|
break;
|
|
26483
26727
|
case "--title":
|
|
26484
|
-
title =
|
|
26728
|
+
title = requireValue14(rest, token);
|
|
26485
26729
|
break;
|
|
26486
26730
|
case "--desc":
|
|
26487
26731
|
case "--description":
|
|
26488
|
-
description = decodeEscapedNewlines(
|
|
26732
|
+
description = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26489
26733
|
break;
|
|
26490
26734
|
case "--team-id":
|
|
26491
|
-
teamId =
|
|
26735
|
+
teamId = requireValue14(rest, token);
|
|
26492
26736
|
break;
|
|
26493
26737
|
case "--team-key":
|
|
26494
|
-
teamKey =
|
|
26738
|
+
teamKey = requireValue14(rest, token);
|
|
26495
26739
|
break;
|
|
26496
26740
|
case "--priority":
|
|
26497
|
-
priority = parseLinearPriority(
|
|
26741
|
+
priority = parseLinearPriority(requireValue14(rest, token));
|
|
26498
26742
|
break;
|
|
26499
26743
|
case "--parent-id":
|
|
26500
|
-
parentId =
|
|
26744
|
+
parentId = requireValue14(rest, token);
|
|
26501
26745
|
break;
|
|
26502
26746
|
case "--state-id":
|
|
26503
|
-
stateId =
|
|
26747
|
+
stateId = requireValue14(rest, token);
|
|
26504
26748
|
break;
|
|
26505
26749
|
case "--cwd":
|
|
26506
|
-
cwd =
|
|
26750
|
+
cwd = requireValue14(rest, token);
|
|
26507
26751
|
break;
|
|
26508
26752
|
default:
|
|
26509
26753
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26538,10 +26782,10 @@ function parseLinearWhoamiArgs(tokens) {
|
|
|
26538
26782
|
const token = rest.shift();
|
|
26539
26783
|
switch (token) {
|
|
26540
26784
|
case "--account":
|
|
26541
|
-
account =
|
|
26785
|
+
account = requireValue14(rest, token);
|
|
26542
26786
|
break;
|
|
26543
26787
|
case "--cwd":
|
|
26544
|
-
cwd =
|
|
26788
|
+
cwd = requireValue14(rest, token);
|
|
26545
26789
|
break;
|
|
26546
26790
|
default:
|
|
26547
26791
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26566,10 +26810,10 @@ function parseLinearViewArgs(tokens) {
|
|
|
26566
26810
|
const token = rest.shift();
|
|
26567
26811
|
switch (token) {
|
|
26568
26812
|
case "--account":
|
|
26569
|
-
account =
|
|
26813
|
+
account = requireValue14(rest, token);
|
|
26570
26814
|
break;
|
|
26571
26815
|
case "--cwd":
|
|
26572
|
-
cwd =
|
|
26816
|
+
cwd = requireValue14(rest, token);
|
|
26573
26817
|
break;
|
|
26574
26818
|
default:
|
|
26575
26819
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26604,32 +26848,32 @@ function parseLinearUpdateArgs(tokens) {
|
|
|
26604
26848
|
const token = rest.shift();
|
|
26605
26849
|
switch (token) {
|
|
26606
26850
|
case "--account":
|
|
26607
|
-
account =
|
|
26851
|
+
account = requireValue14(rest, token);
|
|
26608
26852
|
break;
|
|
26609
26853
|
case "--title":
|
|
26610
|
-
title =
|
|
26854
|
+
title = requireValue14(rest, token);
|
|
26611
26855
|
break;
|
|
26612
26856
|
case "--desc":
|
|
26613
26857
|
case "--description":
|
|
26614
|
-
description = decodeEscapedNewlines(
|
|
26858
|
+
description = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26615
26859
|
break;
|
|
26616
26860
|
case "--team-id":
|
|
26617
|
-
teamId =
|
|
26861
|
+
teamId = requireValue14(rest, token);
|
|
26618
26862
|
break;
|
|
26619
26863
|
case "--team-key":
|
|
26620
|
-
teamKey =
|
|
26864
|
+
teamKey = requireValue14(rest, token);
|
|
26621
26865
|
break;
|
|
26622
26866
|
case "--priority":
|
|
26623
|
-
priority = parseLinearPriority(
|
|
26867
|
+
priority = parseLinearPriority(requireValue14(rest, token));
|
|
26624
26868
|
break;
|
|
26625
26869
|
case "--parent-id":
|
|
26626
|
-
parentId =
|
|
26870
|
+
parentId = requireValue14(rest, token);
|
|
26627
26871
|
break;
|
|
26628
26872
|
case "--state-id":
|
|
26629
|
-
stateId =
|
|
26873
|
+
stateId = requireValue14(rest, token);
|
|
26630
26874
|
break;
|
|
26631
26875
|
case "--cwd":
|
|
26632
|
-
cwd =
|
|
26876
|
+
cwd = requireValue14(rest, token);
|
|
26633
26877
|
break;
|
|
26634
26878
|
default:
|
|
26635
26879
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26667,10 +26911,10 @@ function parseLinearSubIssuesArgs(tokens) {
|
|
|
26667
26911
|
const token = rest.shift();
|
|
26668
26912
|
switch (token) {
|
|
26669
26913
|
case "--account":
|
|
26670
|
-
account =
|
|
26914
|
+
account = requireValue14(rest, token);
|
|
26671
26915
|
break;
|
|
26672
26916
|
case "--cwd":
|
|
26673
|
-
cwd =
|
|
26917
|
+
cwd = requireValue14(rest, token);
|
|
26674
26918
|
break;
|
|
26675
26919
|
default:
|
|
26676
26920
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26697,15 +26941,15 @@ function parseLinearCommentArgs(tokens) {
|
|
|
26697
26941
|
const token = rest.shift();
|
|
26698
26942
|
switch (token) {
|
|
26699
26943
|
case "--account":
|
|
26700
|
-
account =
|
|
26944
|
+
account = requireValue14(rest, token);
|
|
26701
26945
|
break;
|
|
26702
26946
|
case "--body":
|
|
26703
26947
|
case "--desc":
|
|
26704
26948
|
case "--description":
|
|
26705
|
-
body = decodeEscapedNewlines(
|
|
26949
|
+
body = decodeEscapedNewlines(requireValue14(rest, token));
|
|
26706
26950
|
break;
|
|
26707
26951
|
case "--cwd":
|
|
26708
|
-
cwd =
|
|
26952
|
+
cwd = requireValue14(rest, token);
|
|
26709
26953
|
break;
|
|
26710
26954
|
default:
|
|
26711
26955
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26735,10 +26979,10 @@ function parseLinearCommentsArgs(tokens) {
|
|
|
26735
26979
|
const token = rest.shift();
|
|
26736
26980
|
switch (token) {
|
|
26737
26981
|
case "--account":
|
|
26738
|
-
account =
|
|
26982
|
+
account = requireValue14(rest, token);
|
|
26739
26983
|
break;
|
|
26740
26984
|
case "--cwd":
|
|
26741
|
-
cwd =
|
|
26985
|
+
cwd = requireValue14(rest, token);
|
|
26742
26986
|
break;
|
|
26743
26987
|
default:
|
|
26744
26988
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26762,16 +27006,16 @@ function parseLinearCycleArgs(tokens) {
|
|
|
26762
27006
|
const token = rest.shift();
|
|
26763
27007
|
switch (token) {
|
|
26764
27008
|
case "--account":
|
|
26765
|
-
account =
|
|
27009
|
+
account = requireValue14(rest, token);
|
|
26766
27010
|
break;
|
|
26767
27011
|
case "--team-id":
|
|
26768
|
-
teamId =
|
|
27012
|
+
teamId = requireValue14(rest, token);
|
|
26769
27013
|
break;
|
|
26770
27014
|
case "--team-key":
|
|
26771
|
-
teamKey =
|
|
27015
|
+
teamKey = requireValue14(rest, token);
|
|
26772
27016
|
break;
|
|
26773
27017
|
case "--cwd":
|
|
26774
|
-
cwd =
|
|
27018
|
+
cwd = requireValue14(rest, token);
|
|
26775
27019
|
break;
|
|
26776
27020
|
default:
|
|
26777
27021
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26794,10 +27038,10 @@ function parseLinearTeamsArgs(tokens) {
|
|
|
26794
27038
|
const token = rest.shift();
|
|
26795
27039
|
switch (token) {
|
|
26796
27040
|
case "--account":
|
|
26797
|
-
account =
|
|
27041
|
+
account = requireValue14(rest, token);
|
|
26798
27042
|
break;
|
|
26799
27043
|
case "--cwd":
|
|
26800
|
-
cwd =
|
|
27044
|
+
cwd = requireValue14(rest, token);
|
|
26801
27045
|
break;
|
|
26802
27046
|
default:
|
|
26803
27047
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26824,16 +27068,16 @@ function parseLinearUserIssuesArgs(tokens) {
|
|
|
26824
27068
|
const token = rest.shift();
|
|
26825
27069
|
switch (token) {
|
|
26826
27070
|
case "--account":
|
|
26827
|
-
account =
|
|
27071
|
+
account = requireValue14(rest, token);
|
|
26828
27072
|
break;
|
|
26829
27073
|
case "--cycle":
|
|
26830
|
-
cycle = parseLinearCycle(
|
|
27074
|
+
cycle = parseLinearCycle(requireValue14(rest, token));
|
|
26831
27075
|
break;
|
|
26832
27076
|
case "--status":
|
|
26833
|
-
status = parseLinearStatus(
|
|
27077
|
+
status = parseLinearStatus(requireValue14(rest, token));
|
|
26834
27078
|
break;
|
|
26835
27079
|
case "--cwd":
|
|
26836
|
-
cwd =
|
|
27080
|
+
cwd = requireValue14(rest, token);
|
|
26837
27081
|
break;
|
|
26838
27082
|
default:
|
|
26839
27083
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26867,28 +27111,28 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
26867
27111
|
const token = rest.shift();
|
|
26868
27112
|
switch (token) {
|
|
26869
27113
|
case "--account":
|
|
26870
|
-
account =
|
|
27114
|
+
account = requireValue14(rest, token);
|
|
26871
27115
|
break;
|
|
26872
27116
|
case "--team-id":
|
|
26873
|
-
teamId =
|
|
27117
|
+
teamId = requireValue14(rest, token);
|
|
26874
27118
|
break;
|
|
26875
27119
|
case "--team-key":
|
|
26876
|
-
teamKey =
|
|
27120
|
+
teamKey = requireValue14(rest, token);
|
|
26877
27121
|
break;
|
|
26878
27122
|
case "--user":
|
|
26879
|
-
user =
|
|
27123
|
+
user = requireValue14(rest, token);
|
|
26880
27124
|
break;
|
|
26881
27125
|
case "--cycle":
|
|
26882
|
-
cycle = parseLinearCycle(
|
|
27126
|
+
cycle = parseLinearCycle(requireValue14(rest, token));
|
|
26883
27127
|
break;
|
|
26884
27128
|
case "--status":
|
|
26885
|
-
status = parseLinearStatus(
|
|
27129
|
+
status = parseLinearStatus(requireValue14(rest, token));
|
|
26886
27130
|
break;
|
|
26887
27131
|
case "--query":
|
|
26888
|
-
query =
|
|
27132
|
+
query = requireValue14(rest, token).trim();
|
|
26889
27133
|
break;
|
|
26890
27134
|
case "--limit": {
|
|
26891
|
-
const value = Number.parseInt(
|
|
27135
|
+
const value = Number.parseInt(requireValue14(rest, token), 10);
|
|
26892
27136
|
if (!Number.isInteger(value) || value < 1 || value > 250) {
|
|
26893
27137
|
throw new Error("Invalid --limit. Expected an integer between 1 and 250.");
|
|
26894
27138
|
}
|
|
@@ -26896,7 +27140,7 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
26896
27140
|
break;
|
|
26897
27141
|
}
|
|
26898
27142
|
case "--cwd":
|
|
26899
|
-
cwd =
|
|
27143
|
+
cwd = requireValue14(rest, token);
|
|
26900
27144
|
break;
|
|
26901
27145
|
default:
|
|
26902
27146
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -26937,10 +27181,10 @@ function parseLinearLegacyArgs(tokens) {
|
|
|
26937
27181
|
useScreenshot = true;
|
|
26938
27182
|
break;
|
|
26939
27183
|
case "--account":
|
|
26940
|
-
account =
|
|
27184
|
+
account = requireValue14(rest, token);
|
|
26941
27185
|
break;
|
|
26942
27186
|
case "--cwd":
|
|
26943
|
-
cwd =
|
|
27187
|
+
cwd = requireValue14(rest, token);
|
|
26944
27188
|
break;
|
|
26945
27189
|
default:
|
|
26946
27190
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -27034,19 +27278,19 @@ function parseNotionArgs(tokens) {
|
|
|
27034
27278
|
const token = rest.shift();
|
|
27035
27279
|
switch (token) {
|
|
27036
27280
|
case "--parent":
|
|
27037
|
-
parentPageId =
|
|
27281
|
+
parentPageId = requireValue14(rest, token);
|
|
27038
27282
|
break;
|
|
27039
27283
|
case "--title":
|
|
27040
|
-
title =
|
|
27284
|
+
title = requireValue14(rest, token);
|
|
27041
27285
|
break;
|
|
27042
27286
|
case "--private":
|
|
27043
27287
|
isPrivate = true;
|
|
27044
27288
|
break;
|
|
27045
27289
|
case "--content":
|
|
27046
|
-
content2 =
|
|
27290
|
+
content2 = requireValue14(rest, token);
|
|
27047
27291
|
break;
|
|
27048
27292
|
case "--file":
|
|
27049
|
-
filePath2 =
|
|
27293
|
+
filePath2 = requireValue14(rest, token);
|
|
27050
27294
|
break;
|
|
27051
27295
|
default:
|
|
27052
27296
|
throw new Error(`Unknown notion option: ${token}`);
|
|
@@ -27090,10 +27334,10 @@ function parseNotionArgs(tokens) {
|
|
|
27090
27334
|
const token = rest.shift();
|
|
27091
27335
|
switch (token) {
|
|
27092
27336
|
case "--content":
|
|
27093
|
-
content =
|
|
27337
|
+
content = requireValue14(rest, token);
|
|
27094
27338
|
break;
|
|
27095
27339
|
case "--file":
|
|
27096
|
-
filePath =
|
|
27340
|
+
filePath = requireValue14(rest, token);
|
|
27097
27341
|
break;
|
|
27098
27342
|
case "--append":
|
|
27099
27343
|
append = true;
|
|
@@ -27138,11 +27382,11 @@ function parseRandomArgs(tokens) {
|
|
|
27138
27382
|
mode = "easy";
|
|
27139
27383
|
break;
|
|
27140
27384
|
case "--length":
|
|
27141
|
-
length = parsePositiveInt2(
|
|
27385
|
+
length = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27142
27386
|
seenLength = true;
|
|
27143
27387
|
break;
|
|
27144
27388
|
case "--charset": {
|
|
27145
|
-
const value =
|
|
27389
|
+
const value = requireValue14(rest, token);
|
|
27146
27390
|
if (!["base64url", "hex", "alnum", "ascii"].includes(value)) {
|
|
27147
27391
|
throw new Error(
|
|
27148
27392
|
`Invalid --charset value: ${value}. Use base64url|hex|alnum|ascii.`
|
|
@@ -27153,18 +27397,18 @@ function parseRandomArgs(tokens) {
|
|
|
27153
27397
|
break;
|
|
27154
27398
|
}
|
|
27155
27399
|
case "--count":
|
|
27156
|
-
count = parsePositiveInt2(
|
|
27400
|
+
count = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27157
27401
|
break;
|
|
27158
27402
|
case "--words":
|
|
27159
|
-
words = parsePositiveInt2(
|
|
27403
|
+
words = parsePositiveInt2(requireValue14(rest, token), token);
|
|
27160
27404
|
seenWords = true;
|
|
27161
27405
|
break;
|
|
27162
27406
|
case "--digits":
|
|
27163
|
-
digits = parseNonNegativeInt(
|
|
27407
|
+
digits = parseNonNegativeInt(requireValue14(rest, token), token);
|
|
27164
27408
|
seenDigits = true;
|
|
27165
27409
|
break;
|
|
27166
27410
|
case "--separator":
|
|
27167
|
-
separator =
|
|
27411
|
+
separator = requireValue14(rest, token);
|
|
27168
27412
|
seenSeparator = true;
|
|
27169
27413
|
break;
|
|
27170
27414
|
default:
|
|
@@ -27195,7 +27439,7 @@ function parseRandomArgs(tokens) {
|
|
|
27195
27439
|
count
|
|
27196
27440
|
};
|
|
27197
27441
|
}
|
|
27198
|
-
function
|
|
27442
|
+
function requireValue14(tokens, optionName) {
|
|
27199
27443
|
const value = tokens.shift();
|
|
27200
27444
|
if (!value) {
|
|
27201
27445
|
throw new Error(`Missing value for ${optionName}`);
|