@crewx/cli 0.9.0-rc.5 → 0.9.0-rc.50

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.
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.handlePublish = handlePublish;
37
+ /**
38
+ * crewx publish handler — thin CLI wrapper over @crewx/sdk/publish.
39
+ *
40
+ * Usage:
41
+ * crewx publish [dir] [--dry-run] [--version <semver>] [--json] [--upload]
42
+ *
43
+ * All scanning, exclusion-rule judgment, secret detection, hashing, and
44
+ * tar.gz packing lives in @crewx/sdk/publish (planPublish / packTemplate).
45
+ * Submit+upload (WI-SHR-20260806-013) lives in the same package
46
+ * (uploadToMarketplace) for the same reason — see that module's header.
47
+ * This command only parses argv, forwards options, reads auth.json
48
+ * (read-only — see readAuthJson()'s own doc), and renders the result.
49
+ */
50
+ const fs = __importStar(require("fs"));
51
+ const publish_1 = require("@crewx/sdk/publish");
52
+ const parse_common_flags_1 = require("./parse-common-flags");
53
+ function parsePublishFlags(args) {
54
+ const flags = { dryRun: false, json: false, help: false, upload: false };
55
+ for (let i = 0; i < args.length; i++) {
56
+ const arg = args[i];
57
+ if (arg === '--help' || arg === '-h') {
58
+ flags.help = true;
59
+ continue;
60
+ }
61
+ if (arg === '--dry-run') {
62
+ flags.dryRun = true;
63
+ continue;
64
+ }
65
+ if (arg === '--json') {
66
+ flags.json = true;
67
+ continue;
68
+ }
69
+ if (arg === '--upload') {
70
+ flags.upload = true;
71
+ continue;
72
+ }
73
+ if (arg === '--version') {
74
+ const value = args[i + 1];
75
+ if (value === undefined)
76
+ throw new parse_common_flags_1.UnknownOptionError('--version requires a value');
77
+ flags.version = value;
78
+ i++;
79
+ continue;
80
+ }
81
+ if (arg.startsWith('--version=')) {
82
+ flags.version = arg.slice('--version='.length);
83
+ continue;
84
+ }
85
+ if (arg.startsWith('-')) {
86
+ throw new parse_common_flags_1.UnknownOptionError(`Unknown option: ${arg}`);
87
+ }
88
+ if (flags.dir === undefined) {
89
+ flags.dir = arg;
90
+ continue;
91
+ }
92
+ throw new parse_common_flags_1.UnknownOptionError(`Unknown option: ${arg}`);
93
+ }
94
+ return flags;
95
+ }
96
+ function resolveWorkspaceDir(flags) {
97
+ return flags.dir ?? process.env['CREWX_WORKSPACE'] ?? process.cwd();
98
+ }
99
+ function printJson(payload) {
100
+ console.log(JSON.stringify(payload));
101
+ }
102
+ /** Prints the error and exits 1. Never returns (matches `process.exit`'s `never` type). */
103
+ function failWithError(err, json) {
104
+ const message = err instanceof Error ? err.message : String(err);
105
+ if (json) {
106
+ printJson({ success: false, error: message });
107
+ }
108
+ else {
109
+ console.error(`✗ ${message}`);
110
+ }
111
+ process.exit(1);
112
+ }
113
+ function printHelp() {
114
+ console.log(`
115
+ crewx publish — package a workspace as a distributable template archive
116
+
117
+ Usage:
118
+ crewx publish [dir] [--dry-run] [--version <semver>] [--json] [--upload]
119
+
120
+ Arguments:
121
+ dir Workspace to publish (default: $CREWX_WORKSPACE or cwd)
122
+
123
+ Options:
124
+ --dry-run Scan + build manifest only; do not write a .tgz
125
+ --version <ver> Override manifest version (semver, e.g. 1.0.0)
126
+ --json Print machine-readable JSON to stdout
127
+ --upload Submit + upload the packed archive to marketplace
128
+ (requires CREWX_MARKETPLACE_URL and a prior login;
129
+ ignored when combined with --dry-run)
130
+ --help, -h Show this help
131
+
132
+ Notes:
133
+ Without --upload, this command only scans the workspace, applies
134
+ exclusion rules, checks for secrets, and packs a local
135
+ .crewx/publish/<name>-<version>.tgz archive.
136
+ `.trim());
137
+ }
138
+ /** CREWX_MARKETPLACE_URL — same env var name as the server's MARKETPLACE_DISABLED check, never a second name. */
139
+ function requireMarketplaceUrl() {
140
+ const url = process.env['CREWX_MARKETPLACE_URL'];
141
+ if (!url) {
142
+ throw new Error('CREWX_MARKETPLACE_URL이 설정되지 않았습니다 — 업로드하려면 이 환경변수가 필요합니다');
143
+ }
144
+ return url;
145
+ }
146
+ async function handlePublish(args) {
147
+ const flags = parsePublishFlags(args);
148
+ if (flags.help) {
149
+ printHelp();
150
+ return;
151
+ }
152
+ const dir = resolveWorkspaceDir(flags);
153
+ process.stderr.write(`[publish] scanning ${dir}...\n`);
154
+ let plan;
155
+ try {
156
+ plan = await (0, publish_1.planPublish)(dir, { version: flags.version });
157
+ }
158
+ catch (err) {
159
+ failWithError(err, flags.json);
160
+ }
161
+ if (plan.secretFindings.length > 0) {
162
+ if (flags.json) {
163
+ printJson({ success: false, error: 'secret findings detected', findings: plan.secretFindings });
164
+ }
165
+ else {
166
+ console.error('✗ secret findings detected — publish aborted');
167
+ for (const f of plan.secretFindings) {
168
+ console.error(` ${f.path}:${f.line} (${f.rule})`);
169
+ }
170
+ }
171
+ process.exit(1);
172
+ }
173
+ if (flags.dryRun) {
174
+ if (flags.json) {
175
+ printJson({
176
+ success: true,
177
+ dryRun: true,
178
+ workspace: dir,
179
+ manifest: plan.manifest,
180
+ included: plan.included,
181
+ excluded: plan.excluded,
182
+ });
183
+ }
184
+ else {
185
+ console.log('✓ dry-run — no archive written');
186
+ console.log(` workspace: ${dir}`);
187
+ console.log(` name: ${plan.manifest.name} version: ${plan.manifest.version}`);
188
+ console.log(` included: ${plan.included.length} files`);
189
+ console.log(` excluded: ${plan.excluded.length} entries`);
190
+ for (const e of plan.excluded) {
191
+ console.log(` ${e.path} (${e.rule})`);
192
+ }
193
+ }
194
+ return;
195
+ }
196
+ // Resolved before packing (not after) so a doomed --upload run (no
197
+ // marketplace url / no session) never writes a stray .tgz to the
198
+ // workspace — WI-SHR-20260806-013 AC-U5.
199
+ let marketplaceUrl = '';
200
+ let accessToken = '';
201
+ if (flags.upload) {
202
+ try {
203
+ marketplaceUrl = requireMarketplaceUrl();
204
+ accessToken = (0, publish_1.readAuthJson)().access_token;
205
+ }
206
+ catch (err) {
207
+ failWithError(err, flags.json);
208
+ }
209
+ }
210
+ process.stderr.write(`[publish] packing ${plan.manifest.name}@${plan.manifest.version}...\n`);
211
+ let packed;
212
+ try {
213
+ packed = await (0, publish_1.packTemplate)(dir, { version: flags.version });
214
+ }
215
+ catch (err) {
216
+ failWithError(err, flags.json);
217
+ }
218
+ const fileCount = packed.manifest.files.length;
219
+ const totalBytes = fs.statSync(packed.tgzPath).size;
220
+ let uploadResult;
221
+ if (flags.upload) {
222
+ process.stderr.write(`[publish] uploading ${packed.manifest.name}@${packed.manifest.version} to ${marketplaceUrl}...\n`);
223
+ try {
224
+ uploadResult = await (0, publish_1.uploadToMarketplace)({
225
+ tgzPath: packed.tgzPath,
226
+ manifest: packed.manifest,
227
+ baseUrl: marketplaceUrl,
228
+ accessToken,
229
+ });
230
+ }
231
+ catch (err) {
232
+ failWithError(err, flags.json);
233
+ }
234
+ process.stderr.write(`[publish] submit -> ${uploadResult.submitOutcome}\n`);
235
+ }
236
+ if (flags.json) {
237
+ printJson({
238
+ success: true,
239
+ tgzPath: packed.tgzPath,
240
+ fileCount,
241
+ totalBytes,
242
+ manifest: packed.manifest,
243
+ ...(uploadResult
244
+ ? {
245
+ slug: uploadResult.slug,
246
+ version: uploadResult.version,
247
+ artifactChecksum: uploadResult.artifactChecksum,
248
+ artifactSizeBytes: uploadResult.artifactSizeBytes,
249
+ submitOutcome: uploadResult.submitOutcome,
250
+ versionUpdate: uploadResult.versionUpdate,
251
+ serverVersionBefore: uploadResult.serverVersionBefore,
252
+ }
253
+ : {}),
254
+ });
255
+ }
256
+ else {
257
+ console.log(`✓ packed: ${packed.tgzPath}`);
258
+ console.log(` files: ${fileCount} bytes: ${totalBytes}`);
259
+ if (uploadResult) {
260
+ console.log(`✓ uploaded: ${uploadResult.slug}@${uploadResult.version} (${uploadResult.submitOutcome})`);
261
+ console.log(` artifactChecksum: ${uploadResult.artifactChecksum} artifactSizeBytes: ${uploadResult.artifactSizeBytes}`);
262
+ }
263
+ }
264
+ if (!flags.upload) {
265
+ console.error('⚠ 업로드하려면 --upload 를 사용하세요 — 생성된 파일 경로를 확인하세요');
266
+ }
267
+ }
@@ -5,6 +5,7 @@
5
5
  * Flags:
6
6
  * --thread <name> Conversation thread name
7
7
  * --provider <cli/xxx> Provider override
8
+ * --model <name> Model override (e.g. claude-sonnet-5)
8
9
  * --metadata <json> Extra metadata JSON (double-quoted object). Propagated to events/hooks/tracing.
9
10
  * e.g. --metadata='{"workflow_id":"wf-1"}'
10
11
  * --verbose Debug output mode (default: raw agent response only)
@@ -6,6 +6,7 @@
6
6
  * Flags:
7
7
  * --thread <name> Conversation thread name
8
8
  * --provider <cli/xxx> Provider override
9
+ * --model <name> Model override (e.g. claude-sonnet-5)
9
10
  * --metadata <json> Extra metadata JSON (double-quoted object). Propagated to events/hooks/tracing.
10
11
  * e.g. --metadata='{"workflow_id":"wf-1"}'
11
12
  * --verbose Debug output mode (default: raw agent response only)
@@ -27,6 +28,7 @@ const parse_common_flags_1 = require("./parse-common-flags");
27
28
  const resolve_prompt_1 = require("./resolve-prompt");
28
29
  const crewx_cli_1 = require("../bootstrap/crewx-cli");
29
30
  const inherited_trace_1 = require("../utils/inherited-trace");
31
+ const write_output_1 = require("./write-output");
30
32
  /**
31
33
  * Handle `crewx query <agentRef> <message>` command.
32
34
  *
@@ -34,7 +36,7 @@ const inherited_trace_1 = require("../utils/inherited-trace");
34
36
  * --verbose: debug info written to stderr, response to stdout.
35
37
  */
36
38
  async function handleQuery(args) {
37
- const { thread, provider, metadata, verbose, config, outputFormat, effort, promptFile, vars, rest } = (0, parse_common_flags_1.parseCommonFlags)(args);
39
+ const { thread, provider, model, metadata, verbose, config, outputFormat, effort, promptFile, overdrive, vars, out, rest } = (0, parse_common_flags_1.parseCommonFlags)(args);
38
40
  const { agentRef: parsedAgentRef, message } = (0, parse_agent_message_1.parseAgentMessage)(rest);
39
41
  // No @mention → default to @crewx agent (matches cli-bak behaviour)
40
42
  const agentRef = parsedAgentRef || '@crewx';
@@ -55,6 +57,7 @@ async function handleQuery(args) {
55
57
  console.error('Options:');
56
58
  console.error(' --thread <name> Conversation thread name');
57
59
  console.error(' --provider <cli/xxx> Provider override');
60
+ console.error(' --model <name> Model override (e.g. claude-sonnet-5)');
58
61
  console.error(' --metadata <json> Extra metadata (JSON object, double-quoted).');
59
62
  console.error(' Propagated to events/hooks/tracing.');
60
63
  console.error(' Invalid JSON aborts with exit code 2.');
@@ -62,9 +65,11 @@ async function handleQuery(args) {
62
65
  console.error(' --verbose Debug output mode');
63
66
  console.error(' --config/-c <path> Config file path');
64
67
  console.error(' --output-format <fmt> Output format (json|text|stream-json)');
68
+ console.error(' --out/-o <path> Save result to file (stdout suppressed)');
65
69
  console.error(' --effort <level> Model effort (high|medium|low)');
66
70
  console.error(' -f/--prompt-file <path> Read prompt body from file');
67
71
  console.error(' --var key=value Template variable (repeatable)');
72
+ console.error(' --overdrive Activate overdrive (boost) profile for this request');
68
73
  process.exit(1);
69
74
  }
70
75
  const configPath = config ?? process.env.CREWX_CONFIG ?? 'crewx.yaml';
@@ -79,10 +84,14 @@ async function handleQuery(args) {
79
84
  process.stderr.write(`🔗 Thread: ${thread}\n`);
80
85
  if (provider)
81
86
  process.stderr.write(`🔌 Provider: ${provider}\n`);
87
+ if (model)
88
+ process.stderr.write(`🧠 Model: ${model}\n`);
82
89
  if (outputFormat)
83
90
  process.stderr.write(`📄 Output-format: ${outputFormat}\n`);
84
91
  if (effort)
85
92
  process.stderr.write(`⚡ Effort: ${effort}\n`);
93
+ if (overdrive)
94
+ process.stderr.write(`🚀 Overdrive: ON\n`);
86
95
  process.stderr.write('─'.repeat(60) + '\n');
87
96
  }
88
97
  let parsedMetadata = {};
@@ -98,7 +107,9 @@ async function handleQuery(args) {
98
107
  try {
99
108
  const result = await crewx.query(agentRef, finalMessage, {
100
109
  provider,
110
+ model,
101
111
  effort: effort || undefined,
112
+ overdrive: overdrive || undefined,
102
113
  threadId: thread,
103
114
  metadata: Object.keys(parsedMetadata).length > 0 ? parsedMetadata : undefined,
104
115
  vars: Object.keys(vars).length > 0 ? vars : undefined,
@@ -107,6 +118,7 @@ async function handleQuery(args) {
107
118
  if (!result.ok) {
108
119
  const errMsg = result.error?.message ?? 'Query failed';
109
120
  console.error(errMsg);
121
+ (0, write_output_1.appendError)(out, errMsg);
110
122
  exitCode = 1;
111
123
  }
112
124
  else {
@@ -119,7 +131,7 @@ async function handleQuery(args) {
119
131
  process.stderr.write('\n📄 Response:\n');
120
132
  process.stderr.write('─'.repeat(40) + '\n');
121
133
  }
122
- console.log(result.data);
134
+ (0, write_output_1.writeResult)(out, result.data);
123
135
  if (verbose) {
124
136
  process.stderr.write('\n✅ Query completed successfully\n');
125
137
  }
@@ -128,6 +140,7 @@ async function handleQuery(args) {
128
140
  catch (err) {
129
141
  const errMsg = err instanceof Error ? err.message : String(err);
130
142
  console.error(`Error: ${errMsg}`);
143
+ (0, write_output_1.appendError)(out, `Error: ${errMsg}`);
131
144
  exitCode = 1;
132
145
  }
133
146
  finally {
@@ -17,13 +17,15 @@ exports.KNOWN_COMMANDS = new Set([
17
17
  'doctor', 'init',
18
18
  'db',
19
19
  'help',
20
+ 'shortcut',
21
+ 'publish',
20
22
  'slack', 'slack:files',
21
23
  'hook', 'hook-dispatch',
22
24
  ]);
23
25
  /** Built-in tool commands routed via handleBuiltin(). */
24
26
  exports.BUILTIN_COMMAND_NAMES = new Set([
25
27
  'memory', 'search', 'doc', 'wbs', 'cron', 'workflow', 'skill', 'dreaming',
26
- 'wi', 'chromex',
28
+ 'wi', 'chromex', 'notify',
27
29
  ]);
28
30
  /** Commands not yet migrated from cli-bak — show a migration message. */
29
31
  exports.NOT_YET_MIGRATED = new Set([
@@ -43,18 +43,23 @@ function buildRetryPrefix(originalTaskId) {
43
43
  * the string when present and non-empty, otherwise `undefined` so the
44
44
  * agent's configured provider default is used.
45
45
  */
46
- function extractProvider(metadata) {
46
+ function parseTaskMetadata(metadata) {
47
47
  if (!metadata)
48
- return undefined;
48
+ return {};
49
49
  try {
50
50
  const parsed = JSON.parse(metadata);
51
- const provider = parsed.provider;
52
- return typeof provider === 'string' && provider.length > 0 ? provider : undefined;
51
+ return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
52
+ ? parsed
53
+ : {};
53
54
  }
54
55
  catch {
55
- return undefined;
56
+ return {};
56
57
  }
57
58
  }
59
+ function extractProvider(metadata) {
60
+ const provider = metadata.provider;
61
+ return typeof provider === 'string' && provider.length > 0 ? provider : undefined;
62
+ }
58
63
  async function handleRestart(args) {
59
64
  const verbose = args.includes('--verbose');
60
65
  const taskId = args.find((a) => !a.startsWith('--'));
@@ -96,7 +101,10 @@ async function handleRestart(args) {
96
101
  // provider: recovered from metadata.provider (SDK-persisted). Falls back to
97
102
  // the agent's configured provider when absent. This preserves a
98
103
  // `crewx x --provider ...` choice across restart.
99
- const provider = extractProvider(original.metadata);
104
+ const originalMetadata = parseTaskMetadata(original.metadata);
105
+ const provider = extractProvider(originalMetadata);
106
+ const originalWasOverdrive = originalMetadata.overdrive === true;
107
+ const originalOverdriveMode = originalMetadata.overdriveState === 'latch' ? 'latch' : 'count';
100
108
  (0, sdk_1.setAuditVerbose)(verbose);
101
109
  if (verbose) {
102
110
  process.stderr.write(`🔁 Restart: ${taskId} → ${newTaskId}\n`);
@@ -111,10 +119,16 @@ async function handleRestart(args) {
111
119
  threadId: original.thread_id ?? undefined,
112
120
  model,
113
121
  provider,
122
+ ...(originalWasOverdrive ? { overdrive: { mode: originalOverdriveMode } } : {}),
114
123
  metadata: {
115
124
  restartedFromTaskId: taskId,
116
125
  // Back-compat / search convenience: mirror the Web UI metadata key.
117
126
  retriedFromTaskId: taskId,
127
+ ...(originalWasOverdrive ? {
128
+ overdrive: true,
129
+ overdriveState: originalOverdriveMode,
130
+ overdriveMode: mode,
131
+ } : {}),
118
132
  },
119
133
  trace: (0, inherited_trace_1.readInheritedTrace)(),
120
134
  };
@@ -3,8 +3,12 @@
3
3
  * Retrieves the result of a completed task by its ID.
4
4
  *
5
5
  * Usage:
6
- * crewx result <task-id> Print raw result
7
- * crewx result <task-id> --json Print full task record as JSON
8
- * crewx result List recent tasks (latest 10)
6
+ * crewx result <task-id> Print raw result
7
+ * crewx result <task-id> --json Print full task record as JSON
8
+ * crewx result <task-id> --wait=N Poll (1s interval) up to N seconds for
9
+ * the task to leave 'running'. Exit 124 on
10
+ * timeout. --wait=0 behaves like no --wait
11
+ * (single immediate check).
12
+ * crewx result List recent tasks (latest 10)
9
13
  */
10
14
  export declare function handleResult(args: string[]): Promise<void>;
@@ -4,13 +4,18 @@
4
4
  * Retrieves the result of a completed task by its ID.
5
5
  *
6
6
  * Usage:
7
- * crewx result <task-id> Print raw result
8
- * crewx result <task-id> --json Print full task record as JSON
9
- * crewx result List recent tasks (latest 10)
7
+ * crewx result <task-id> Print raw result
8
+ * crewx result <task-id> --json Print full task record as JSON
9
+ * crewx result <task-id> --wait=N Poll (1s interval) up to N seconds for
10
+ * the task to leave 'running'. Exit 124 on
11
+ * timeout. --wait=0 behaves like no --wait
12
+ * (single immediate check).
13
+ * crewx result List recent tasks (latest 10)
10
14
  */
11
15
  Object.defineProperty(exports, "__esModule", { value: true });
12
16
  exports.handleResult = handleResult;
13
17
  const repository_1 = require("@crewx/sdk/repository");
18
+ const POLL_INTERVAL_MS = 1000;
14
19
  function statusIcon(status) {
15
20
  switch (status) {
16
21
  case 'running': return '⏳';
@@ -19,8 +24,20 @@ function statusIcon(status) {
19
24
  default: return '❓';
20
25
  }
21
26
  }
27
+ function sleep(ms) {
28
+ return new Promise((resolve) => setTimeout(resolve, ms));
29
+ }
30
+ /** Parses `--wait=N` (seconds). Returns undefined when the flag is absent. */
31
+ function parseWaitSeconds(args) {
32
+ const arg = args.find(a => a.startsWith('--wait='));
33
+ if (arg === undefined)
34
+ return undefined;
35
+ const n = Number(arg.slice('--wait='.length));
36
+ return Number.isFinite(n) && n >= 0 ? n : 0;
37
+ }
22
38
  async function handleResult(args) {
23
39
  const jsonMode = args.includes('--json');
40
+ const waitSeconds = parseWaitSeconds(args);
24
41
  const taskId = args.find(a => !a.startsWith('--'));
25
42
  const repo = new repository_1.TaskRepository();
26
43
  if (!taskId) {
@@ -45,12 +62,29 @@ async function handleResult(args) {
45
62
  console.log('Tip: Run `crewx result <task-id>` to see full output.');
46
63
  return;
47
64
  }
48
- const task = repo.getTask(taskId);
65
+ let task = repo.getTask(taskId);
49
66
  if (!task) {
50
67
  console.error(`Error: Task not found: ${taskId}`);
51
68
  process.exit(1);
52
69
  return;
53
70
  }
71
+ if (waitSeconds !== undefined && waitSeconds > 0 && task.status === 'running') {
72
+ const deadline = Date.now() + waitSeconds * 1000;
73
+ while (task && task.status === 'running') {
74
+ if (Date.now() >= deadline) {
75
+ console.error(`Task ${taskId} did not complete within --wait=${waitSeconds}s (status: running).`);
76
+ process.exit(124);
77
+ return;
78
+ }
79
+ await sleep(Math.min(POLL_INTERVAL_MS, Math.max(0, deadline - Date.now())));
80
+ task = repo.getTask(taskId);
81
+ if (!task) {
82
+ console.error(`Error: Task not found: ${taskId}`);
83
+ process.exit(1);
84
+ return;
85
+ }
86
+ }
87
+ }
54
88
  if (jsonMode) {
55
89
  console.log(JSON.stringify(task, null, 2));
56
90
  return;
@@ -0,0 +1 @@
1
+ export declare function handleShortcut(args: string[]): Promise<void>;