@vectorplane/ctrl-cli 0.1.11 → 0.1.13

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/core/api.js CHANGED
@@ -144,6 +144,21 @@ export class VectorPlaneApiClient {
144
144
  },
145
145
  }, this.timeoutMs, this.logger);
146
146
  }
147
+ async getWorkspaceSnapshotDiff(accessToken, workspaceId, params) {
148
+ const url = new URL(`${this.apiBaseUrl}/workspace/${workspaceId}/snapshot/diff`);
149
+ if (params.from) {
150
+ url.searchParams.set("from", params.from);
151
+ }
152
+ if (params.to) {
153
+ url.searchParams.set("to", params.to);
154
+ }
155
+ return requestJson(url.toString(), {
156
+ method: "GET",
157
+ headers: {
158
+ "Authorization": `Bearer ${accessToken}`,
159
+ },
160
+ }, this.timeoutMs, this.logger);
161
+ }
147
162
  async getWorkspaceDeliveryContext(accessToken, workspaceId) {
148
163
  return requestJson(`${this.apiBaseUrl}/cli/workspace/${workspaceId}/delivery-context`, {
149
164
  method: "GET",
@@ -152,6 +167,26 @@ export class VectorPlaneApiClient {
152
167
  },
153
168
  }, this.timeoutMs, this.logger);
154
169
  }
170
+ async getWorkspaceDeliveryContextSemantic(accessToken, workspaceId, params) {
171
+ const url = new URL(`${this.apiBaseUrl}/cli/workspace/${workspaceId}/delivery-context`);
172
+ url.searchParams.set("mode", "semantic");
173
+ url.searchParams.set("query", params.query);
174
+ if (params.type) {
175
+ url.searchParams.set("type", params.type);
176
+ }
177
+ if (params.authority) {
178
+ url.searchParams.set("authority", params.authority);
179
+ }
180
+ if (typeof params.limit === "number") {
181
+ url.searchParams.set("limit", String(params.limit));
182
+ }
183
+ return requestJson(url.toString(), {
184
+ method: "GET",
185
+ headers: {
186
+ "Authorization": `Bearer ${accessToken}`,
187
+ },
188
+ }, this.timeoutMs, this.logger);
189
+ }
155
190
  async getAgentSetup(accessToken, workspaceId) {
156
191
  return requestJson(`${this.apiBaseUrl}/cli/workspace/${workspaceId}/agent-setup`, {
157
192
  method: "GET",
@@ -160,6 +195,51 @@ export class VectorPlaneApiClient {
160
195
  },
161
196
  }, this.timeoutMs, this.logger);
162
197
  }
198
+ async listWorkspacePolicyRules(accessToken, workspaceRef) {
199
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/policy-rules`, {
200
+ method: "GET",
201
+ headers: {
202
+ "Authorization": `Bearer ${accessToken}`,
203
+ },
204
+ }, this.timeoutMs, this.logger);
205
+ }
206
+ async createWorkspacePolicyRule(accessToken, workspaceRef, payload) {
207
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/policy-rules`, {
208
+ method: "POST",
209
+ headers: authHeaders(accessToken),
210
+ body: JSON.stringify(payload),
211
+ }, this.timeoutMs, this.logger);
212
+ }
213
+ async updateWorkspacePolicyRule(accessToken, workspaceRef, ruleId, payload) {
214
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/policy-rules/${ruleId}`, {
215
+ method: "PUT",
216
+ headers: authHeaders(accessToken),
217
+ body: JSON.stringify(payload),
218
+ }, this.timeoutMs, this.logger);
219
+ }
220
+ async listWorkspaceWebhooks(accessToken, workspaceRef) {
221
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/webhooks`, {
222
+ method: "GET",
223
+ headers: {
224
+ "Authorization": `Bearer ${accessToken}`,
225
+ },
226
+ }, this.timeoutMs, this.logger);
227
+ }
228
+ async createWorkspaceWebhook(accessToken, workspaceRef, payload) {
229
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/webhooks`, {
230
+ method: "POST",
231
+ headers: authHeaders(accessToken),
232
+ body: JSON.stringify(payload),
233
+ }, this.timeoutMs, this.logger);
234
+ }
235
+ async deleteWorkspaceWebhook(accessToken, workspaceRef, webhookId) {
236
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/webhooks/${webhookId}`, {
237
+ method: "DELETE",
238
+ headers: {
239
+ "Authorization": `Bearer ${accessToken}`,
240
+ },
241
+ }, this.timeoutMs, this.logger);
242
+ }
163
243
  async listMemoryDrafts(accessToken, workspaceRef, status) {
164
244
  const url = new URL(`${this.apiBaseUrl}/cli/workspace/${workspaceRef}/memory-drafts`);
165
245
  if (status) {
@@ -179,6 +259,159 @@ export class VectorPlaneApiClient {
179
259
  body: JSON.stringify(payload),
180
260
  }, this.timeoutMs, this.logger);
181
261
  }
262
+ async searchWorkspaceMemory(accessToken, workspaceRef, params) {
263
+ const url = new URL(`${this.apiBaseUrl}/cli/workspace/${workspaceRef}/memory/search`);
264
+ url.searchParams.set("q", params.query);
265
+ if (params.type) {
266
+ url.searchParams.set("type", params.type);
267
+ }
268
+ if (params.authority) {
269
+ url.searchParams.set("authority", params.authority);
270
+ }
271
+ if (typeof params.limit === "number") {
272
+ url.searchParams.set("limit", String(params.limit));
273
+ }
274
+ return requestJson(url.toString(), {
275
+ method: "GET",
276
+ headers: {
277
+ "Authorization": `Bearer ${accessToken}`,
278
+ },
279
+ }, this.timeoutMs, this.logger);
280
+ }
281
+ async listTasks(accessToken, workspaceRef) {
282
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks`, {
283
+ method: "GET",
284
+ headers: {
285
+ "Authorization": `Bearer ${accessToken}`,
286
+ },
287
+ }, this.timeoutMs, this.logger);
288
+ }
289
+ async createTask(accessToken, workspaceRef, payload) {
290
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks`, {
291
+ method: "POST",
292
+ headers: authHeaders(accessToken),
293
+ body: JSON.stringify(payload),
294
+ }, this.timeoutMs, this.logger);
295
+ }
296
+ async listTaskTemplates(accessToken) {
297
+ return requestJson(`${this.apiBaseUrl}/admin/task-templates`, {
298
+ method: "GET",
299
+ headers: {
300
+ "Authorization": `Bearer ${accessToken}`,
301
+ },
302
+ }, this.timeoutMs, this.logger);
303
+ }
304
+ async getTask(accessToken, workspaceRef, taskId) {
305
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/${taskId}`, {
306
+ method: "GET",
307
+ headers: {
308
+ "Authorization": `Bearer ${accessToken}`,
309
+ },
310
+ }, this.timeoutMs, this.logger);
311
+ }
312
+ async listClaimableTaskSteps(accessToken, workspaceRef, filters) {
313
+ const url = new URL(`${this.apiBaseUrl}/cli/workspace/${workspaceRef}/tasks/claimable`);
314
+ if (filters?.capability) {
315
+ url.searchParams.set("capability", filters.capability);
316
+ }
317
+ if (filters?.agentName) {
318
+ url.searchParams.set("agent_name", filters.agentName);
319
+ }
320
+ return requestJson(url.toString(), {
321
+ method: "GET",
322
+ headers: {
323
+ "Authorization": `Bearer ${accessToken}`,
324
+ },
325
+ }, this.timeoutMs, this.logger);
326
+ }
327
+ async claimTaskStep(accessToken, workspaceRef, taskId, stepId, payload) {
328
+ return requestJson(`${this.apiBaseUrl}/cli/workspace/${workspaceRef}/tasks/${taskId}/steps/${stepId}/claim`, {
329
+ method: "POST",
330
+ headers: authHeaders(accessToken),
331
+ body: JSON.stringify(payload ?? {}),
332
+ }, this.timeoutMs, this.logger);
333
+ }
334
+ async delegateTask(accessToken, workspaceRef, taskId, stepId, toAgentId, reason) {
335
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/${taskId}/delegate`, {
336
+ method: "POST",
337
+ headers: authHeaders(accessToken),
338
+ body: JSON.stringify({ stepId, toAgentId, reason }),
339
+ }, this.timeoutMs, this.logger);
340
+ }
341
+ async callbackTaskStep(accessToken, workspaceRef, taskId, stepId, payload) {
342
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/${taskId}/steps/${stepId}/callback`, {
343
+ method: "POST",
344
+ headers: authHeaders(accessToken),
345
+ body: JSON.stringify(payload),
346
+ }, this.timeoutMs, this.logger);
347
+ }
348
+ async getTaskHandoff(accessToken, workspaceRef, taskId) {
349
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/${taskId}/handoff`, {
350
+ method: "GET",
351
+ headers: {
352
+ "Authorization": `Bearer ${accessToken}`,
353
+ },
354
+ }, this.timeoutMs, this.logger);
355
+ }
356
+ async getTaskObservability(accessToken, workspaceRef, taskId) {
357
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/${taskId}/observability`, {
358
+ method: "GET",
359
+ headers: {
360
+ "Authorization": `Bearer ${accessToken}`,
361
+ },
362
+ }, this.timeoutMs, this.logger);
363
+ }
364
+ async getWorkspaceTaskObservability(accessToken, workspaceRef) {
365
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/observability`, {
366
+ method: "GET",
367
+ headers: {
368
+ "Authorization": `Bearer ${accessToken}`,
369
+ },
370
+ }, this.timeoutMs, this.logger);
371
+ }
372
+ async approveTask(accessToken, workspaceRef, taskId, payload) {
373
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/tasks/${taskId}/approve`, {
374
+ method: "POST",
375
+ headers: authHeaders(accessToken),
376
+ body: JSON.stringify(payload),
377
+ }, this.timeoutMs, this.logger);
378
+ }
379
+ async listAgentRegistry(accessToken) {
380
+ return requestJson(`${this.apiBaseUrl}/admin/agent-registry`, {
381
+ method: "GET",
382
+ headers: {
383
+ "Authorization": `Bearer ${accessToken}`,
384
+ },
385
+ }, this.timeoutMs, this.logger);
386
+ }
387
+ async createRegistryAgent(accessToken, payload) {
388
+ return requestJson(`${this.apiBaseUrl}/admin/agent-registry`, {
389
+ method: "POST",
390
+ headers: authHeaders(accessToken),
391
+ body: JSON.stringify(payload),
392
+ }, this.timeoutMs, this.logger);
393
+ }
394
+ async updateRegistryAgent(accessToken, agentId, payload) {
395
+ return requestJson(`${this.apiBaseUrl}/admin/agent-registry/${agentId}`, {
396
+ method: "PUT",
397
+ headers: authHeaders(accessToken),
398
+ body: JSON.stringify(payload),
399
+ }, this.timeoutMs, this.logger);
400
+ }
401
+ async deactivateRegistryAgent(accessToken, agentId) {
402
+ return requestJson(`${this.apiBaseUrl}/admin/agent-registry/${agentId}/deactivate`, {
403
+ method: "POST",
404
+ headers: authHeaders(accessToken),
405
+ }, this.timeoutMs, this.logger);
406
+ }
407
+ async getWorkspaceHealth(accessToken, workspaceRef) {
408
+ return requestJson(`${this.apiBaseUrl}/workspace/${workspaceRef}/health`, {
409
+ method: "GET",
410
+ headers: {
411
+ "Authorization": `Bearer ${accessToken}`,
412
+ },
413
+ }, this.timeoutMs, this.logger);
414
+ }
182
415
  async checkInAgent(accessToken, payload) {
183
416
  return requestJson(`${this.apiBaseUrl}/cli/workspace/${payload.workspaceId}/agents/check-in`, {
184
417
  method: "POST",
@@ -226,5 +459,79 @@ export class VectorPlaneApiClient {
226
459
  method: "GET",
227
460
  }, this.timeoutMs, this.logger);
228
461
  }
462
+ async streamWorkspaceEvents(accessToken, workspaceRef, params) {
463
+ const url = new URL(`${this.apiBaseUrl}/workspace/${workspaceRef}/events/stream`);
464
+ if (params.taskId) {
465
+ url.searchParams.set("task_id", params.taskId);
466
+ }
467
+ if (params.types && params.types.length > 0) {
468
+ url.searchParams.set("types", params.types.join(","));
469
+ }
470
+ this.logger.debug("http_stream_open", { url: url.toString() });
471
+ const response = await fetch(url.toString(), {
472
+ method: "GET",
473
+ headers: {
474
+ "Authorization": `Bearer ${accessToken}`,
475
+ "Accept": "text/event-stream",
476
+ },
477
+ signal: params.signal,
478
+ });
479
+ if (!response.ok || !response.body) {
480
+ const body = await parseBody(response);
481
+ const message = typeof body === "string" ? body : `HTTP ${response.status}`;
482
+ throw new ApiError(message, response.status, body);
483
+ }
484
+ const reader = response.body.getReader();
485
+ const decoder = new TextDecoder();
486
+ let buffer = "";
487
+ const emitFrame = (frame) => {
488
+ const lines = frame.split("\n");
489
+ let eventName = "message";
490
+ const dataLines = [];
491
+ for (const line of lines) {
492
+ if (line.startsWith("event:")) {
493
+ eventName = line.slice(6).trim();
494
+ continue;
495
+ }
496
+ if (line.startsWith("data:")) {
497
+ dataLines.push(line.slice(5).trim());
498
+ }
499
+ }
500
+ if (dataLines.length === 0) {
501
+ return;
502
+ }
503
+ try {
504
+ const payload = JSON.parse(dataLines.join("\n"));
505
+ params.onEvent({
506
+ type: eventName,
507
+ workspaceId: payload.workspaceId,
508
+ taskId: payload.taskId ?? null,
509
+ stepId: payload.stepId ?? null,
510
+ timestamp: payload.timestamp,
511
+ summary: payload.summary ?? null,
512
+ });
513
+ }
514
+ catch (error) {
515
+ this.logger.debug("http_stream_frame_ignored", {
516
+ reason: error instanceof Error ? error.message : "invalid_json",
517
+ eventName,
518
+ });
519
+ }
520
+ };
521
+ while (true) {
522
+ const { done, value } = await reader.read();
523
+ if (done) {
524
+ break;
525
+ }
526
+ buffer += decoder.decode(value, { stream: true });
527
+ let separatorIndex = buffer.indexOf("\n\n");
528
+ while (separatorIndex >= 0) {
529
+ const frame = buffer.slice(0, separatorIndex);
530
+ buffer = buffer.slice(separatorIndex + 2);
531
+ emitFrame(frame);
532
+ separatorIndex = buffer.indexOf("\n\n");
533
+ }
534
+ }
535
+ }
229
536
  }
230
537
  //# sourceMappingURL=api.js.map
@@ -0,0 +1,29 @@
1
+ import type { SupportedAgent } from "./agent-runtime-detection.js";
2
+ import type { CliConfig, CliProfileConfig } from "../types/config.js";
3
+ import type { DeviceIdentity } from "../types/machine.js";
4
+ import type { Logger } from "./logger.js";
5
+ export declare function buildInitLoginArgs(params: {
6
+ manual: boolean;
7
+ noBrowser: boolean;
8
+ profile?: string;
9
+ }): Promise<string[]>;
10
+ export declare function runInitWorkspaceUseCase(params: {
11
+ cliVersion: string;
12
+ commandArgs: string[];
13
+ runtime: {
14
+ profile: CliProfileConfig;
15
+ config: CliConfig;
16
+ device: DeviceIdentity;
17
+ logger: Logger;
18
+ };
19
+ force: boolean;
20
+ explicitWorkspace?: string;
21
+ requestedAgent?: SupportedAgent;
22
+ ensureLoggedIn: () => Promise<void>;
23
+ }): Promise<{
24
+ workspace: string;
25
+ agent: SupportedAgent;
26
+ confidence: string;
27
+ templatePath: string;
28
+ fileStatus: string;
29
+ }>;
@@ -0,0 +1,73 @@
1
+ import { ensureSessionAvailable, loadSession, upsertProfile } from "./config.js";
2
+ import { collectGitContext } from "./git.js";
3
+ import { collectMachineContext, collectRuntimeContext } from "./machine.js";
4
+ import { VectorPlaneApiClient } from "./api.js";
5
+ import { ensureFreshSession } from "./session.js";
6
+ import { ensureAgentSetupCurrent } from "./agent-setup.js";
7
+ import { resolveWorkspaceRoot } from "./workspace-binding.js";
8
+ import { resolveAuthorizedWorkspace } from "./workspace-resolution.js";
9
+ export async function buildInitLoginArgs(params) {
10
+ const loginArgs = [];
11
+ if (params.manual) {
12
+ loginArgs.push("--manual");
13
+ }
14
+ if (params.noBrowser) {
15
+ loginArgs.push("--no-browser");
16
+ }
17
+ if (params.profile) {
18
+ loginArgs.push("--profile", params.profile);
19
+ }
20
+ return loginArgs;
21
+ }
22
+ export async function runInitWorkspaceUseCase(params) {
23
+ let session = await loadSession(params.runtime.profile.name);
24
+ if (!session) {
25
+ params.runtime.logger.info("sessão local ausente, iniciando login...");
26
+ await params.ensureLoggedIn();
27
+ session = await ensureSessionAvailable(params.runtime.profile.name);
28
+ }
29
+ const [git, machine, runtimeContext] = await Promise.all([
30
+ collectGitContext(process.cwd()),
31
+ collectMachineContext(params.runtime.device, params.runtime.config),
32
+ collectRuntimeContext(params.cliVersion, "init", params.commandArgs),
33
+ ]);
34
+ const apiClient = new VectorPlaneApiClient(params.runtime.profile.apiBaseUrl, params.runtime.config.requestTimeoutMs, params.runtime.logger);
35
+ const freshSession = await ensureFreshSession({
36
+ profileName: params.runtime.profile.name,
37
+ session,
38
+ machine,
39
+ runtime: runtimeContext,
40
+ device: params.runtime.device,
41
+ apiClient,
42
+ logger: params.runtime.logger,
43
+ });
44
+ const rootPath = resolveWorkspaceRoot(process.cwd(), git);
45
+ const workspace = await resolveAuthorizedWorkspace({
46
+ apiClient,
47
+ accessToken: freshSession.accessToken,
48
+ git,
49
+ explicitWorkspace: params.explicitWorkspace,
50
+ profile: params.runtime.profile,
51
+ session: freshSession,
52
+ });
53
+ const result = await ensureAgentSetupCurrent({
54
+ rootPath,
55
+ workspace,
56
+ repoUrl: git.remoteOrigin,
57
+ source: git.remoteOrigin ? "api-resolve" : "manual",
58
+ accessToken: freshSession.accessToken,
59
+ apiClient,
60
+ logger: params.runtime.logger,
61
+ explicitAgent: params.requestedAgent,
62
+ force: params.force,
63
+ });
64
+ await upsertProfile(params.runtime.profile.name, { workspace });
65
+ return {
66
+ workspace,
67
+ agent: result.agent,
68
+ confidence: result.confidence,
69
+ templatePath: result.templatePath,
70
+ fileStatus: result.fileStatus,
71
+ };
72
+ }
73
+ //# sourceMappingURL=init-workspace.js.map
@@ -0,0 +1,18 @@
1
+ import type { VectorPlaneApiClient } from "./api.js";
2
+ import type { Logger } from "./logger.js";
3
+ import type { AuthSession } from "../types/auth.js";
4
+ import type { GitContext } from "../types/workspace.js";
5
+ export declare function ensureRuntimeAgentSetup(params: {
6
+ rootPath: string;
7
+ workspace: string;
8
+ git: GitContext;
9
+ session: AuthSession;
10
+ apiClient: VectorPlaneApiClient;
11
+ logger: Logger;
12
+ }): Promise<{
13
+ agent: import("./agent-runtime-detection.js").SupportedAgent;
14
+ templatePath: string;
15
+ fileStatus: "created" | "updated" | "unchanged";
16
+ changed: boolean;
17
+ confidence: import("./agent-runtime-detection.js").DetectionConfidence;
18
+ }>;
@@ -0,0 +1,13 @@
1
+ import { ensureAgentSetupCurrent } from "./agent-setup.js";
2
+ export async function ensureRuntimeAgentSetup(params) {
3
+ return ensureAgentSetupCurrent({
4
+ rootPath: params.rootPath,
5
+ workspace: params.workspace,
6
+ repoUrl: params.git.remoteOrigin,
7
+ source: params.git.remoteOrigin ? "api-resolve" : "manual",
8
+ accessToken: params.session.accessToken,
9
+ apiClient: params.apiClient,
10
+ logger: params.logger,
11
+ });
12
+ }
13
+ //# sourceMappingURL=runtime-agent-setup.js.map
@@ -0,0 +1,16 @@
1
+ export interface LocalTaskExecutionInput {
2
+ execution: Record<string, unknown> | null | undefined;
3
+ workspaceRoot: string;
4
+ workspaceRef: string;
5
+ taskId: string;
6
+ stepId: string;
7
+ capability: string;
8
+ }
9
+ export declare function executeLocalTaskStep(input: LocalTaskExecutionInput): Promise<{
10
+ command: string;
11
+ args: string[];
12
+ cwd: string;
13
+ exitCode: number;
14
+ stdout: string;
15
+ stderr: string;
16
+ }>;
@@ -0,0 +1,62 @@
1
+ import { spawn } from "node:child_process";
2
+ import { ValidationError } from "./errors.js";
3
+ function interpolate(value, context) {
4
+ return value.replace(/\{([a-zA-Z0-9_]+)\}/g, (_, key) => context[key] ?? "");
5
+ }
6
+ function asStringArray(value) {
7
+ return Array.isArray(value) ? value.map((item) => String(item)) : [];
8
+ }
9
+ export async function executeLocalTaskStep(input) {
10
+ const execution = input.execution ?? {};
11
+ const type = typeof execution.type === "string" ? execution.type : "command";
12
+ if (type !== "command") {
13
+ throw new ValidationError("A execução local do step exige `metadata.execution.type = command`.");
14
+ }
15
+ const rawCommand = typeof execution.command === "string" ? execution.command.trim() : "";
16
+ if (!rawCommand) {
17
+ throw new ValidationError("A execução local do step exige `metadata.execution.command`.");
18
+ }
19
+ const context = {
20
+ workspaceRoot: input.workspaceRoot,
21
+ workspace: input.workspaceRef,
22
+ taskId: input.taskId,
23
+ stepId: input.stepId,
24
+ capability: input.capability,
25
+ };
26
+ const command = interpolate(rawCommand, context);
27
+ const args = asStringArray(execution.args).map((item) => interpolate(item, context));
28
+ const cwd = typeof execution.cwd === "string" && execution.cwd.trim()
29
+ ? interpolate(execution.cwd, context)
30
+ : input.workspaceRoot;
31
+ const envOverrides = execution.env && typeof execution.env === "object"
32
+ ? Object.fromEntries(Object.entries(execution.env).map(([key, value]) => [key, interpolate(String(value), context)]))
33
+ : {};
34
+ return new Promise((resolve, reject) => {
35
+ const child = spawn(command, args, {
36
+ cwd,
37
+ env: { ...process.env, ...envOverrides },
38
+ stdio: ["ignore", "pipe", "pipe"],
39
+ shell: false,
40
+ });
41
+ let stdout = "";
42
+ let stderr = "";
43
+ child.stdout.on("data", (chunk) => {
44
+ stdout += String(chunk);
45
+ });
46
+ child.stderr.on("data", (chunk) => {
47
+ stderr += String(chunk);
48
+ });
49
+ child.on("error", reject);
50
+ child.on("close", (exitCode) => {
51
+ resolve({
52
+ command,
53
+ args,
54
+ cwd,
55
+ exitCode: exitCode ?? 1,
56
+ stdout: stdout.trim(),
57
+ stderr: stderr.trim(),
58
+ });
59
+ });
60
+ });
61
+ }
62
+ //# sourceMappingURL=task-runner.js.map
package/dist/index.js CHANGED
@@ -10,9 +10,11 @@ import { runEventCommand } from "./commands/event.js";
10
10
  import { runInitCommand } from "./commands/init.js";
11
11
  import { runLoginCommand } from "./commands/login.js";
12
12
  import { runLogoutCommand } from "./commands/logout.js";
13
+ import { runRegistryCommand } from "./commands/registry.js";
13
14
  import { runSessionCommand } from "./commands/session.js";
14
15
  import { runStatusCommand } from "./commands/status.js";
15
16
  import { runSyncCommand } from "./commands/sync.js";
17
+ import { runTaskCommand } from "./commands/task.js";
16
18
  import { runWhoAmICommand } from "./commands/whoami.js";
17
19
  import { runWorkspaceCommand } from "./commands/workspace.js";
18
20
  import { CLIError } from "./core/errors.js";
@@ -33,11 +35,13 @@ function printHelp() {
33
35
  process.stdout.write(" logout\n");
34
36
  process.stdout.write(" sync [--force]\n");
35
37
  process.stdout.write(" status\n");
38
+ process.stdout.write(" task <run|templates|list|inspect|watch|claim|execute|daemon|approve|reject|delegate|step-update|handoff|observability|health>\n");
39
+ process.stdout.write(" registry <list|register|update|deactivate>\n");
36
40
  process.stdout.write(" whoami\n");
37
41
  process.stdout.write(" doctor\n");
38
42
  process.stdout.write(" draft <create|list>\n");
39
43
  process.stdout.write(" config <profile|get|set>\n");
40
- process.stdout.write(" workspace <current|use|resolve|clear>\n");
44
+ process.stdout.write(" workspace <current|use|resolve|clear|policy|webhook>\n");
41
45
  process.stdout.write(" session <check-in|heartbeat|check-out>\n");
42
46
  process.stdout.write(" context [--snapshot|--delivery]\n");
43
47
  process.stdout.write(" bootstrap\n");
@@ -60,8 +64,12 @@ export async function runCli(args) {
60
64
  return runSyncCommand(cliVersion, rest);
61
65
  case "logout":
62
66
  return runLogoutCommand();
67
+ case "registry":
68
+ return runRegistryCommand(rest);
63
69
  case "status":
64
70
  return runStatusCommand();
71
+ case "task":
72
+ return runTaskCommand(cliVersion, rest);
65
73
  case "whoami":
66
74
  return runWhoAmICommand(cliVersion);
67
75
  case "doctor":