@parall/cli 1.64.0 → 1.66.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"clip-connection.d.ts","sourceRoot":"","sources":["../../src/commands/clip-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAgC5C,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAsClE"}
1
+ {"version":3,"file":"clip-connection.d.ts","sourceRoot":"","sources":["../../src/commands/clip-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAgC5C,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAyGlE"}
@@ -1,7 +1,7 @@
1
1
  import { Option } from 'commander';
2
2
  import { ApiError } from '@parall/sdk';
3
3
  import { resolveCredentials } from '../lib/client.js';
4
- import { printError, printJson } from '../lib/output.js';
4
+ import { printError, printJson, printRefHint } from '../lib/output.js';
5
5
  async function resolveConnection(client, orgId, ref) {
6
6
  if (ref.startsWith('ccn_'))
7
7
  return ref;
@@ -25,11 +25,51 @@ async function resolveConnection(client, orgId, ref) {
25
25
  return [...matches][0];
26
26
  }
27
27
  export function registerClipConnectionCommands(clip) {
28
+ const connection = clip.command('connection').description('Manage clip connections');
29
+ // --- create ---
30
+ connection
31
+ .command('create')
32
+ .description('Create a connection binding a clip to an Edge device and browser profile. Binding follows the device layer: a personal device is bound by its owner alone, an org-shared or hosted device only by a human org owner/admin. The clip must be installed first (`parall clip install`)')
33
+ .argument('<clip>', 'Registry clip id (crg_…) or installed clip name')
34
+ .requiredOption('--device <id>', 'Edge device id (edg_…) — from the Clip Console, or the device_id of an existing row in `parall clip connections <clip>`')
35
+ .option('--profile <name>', 'Browser profile name on the device (omit for the device default)')
36
+ .option('--alias <name>', 'Human-readable alias for the connection (unique within the clip)')
37
+ .option('--default', 'Mark as the default connection for this clip')
38
+ .option('--public', 'Make the connection public to the entire organization')
39
+ .action(async (clipRef, opts) => {
40
+ try {
41
+ const { client, orgId } = resolveCredentials();
42
+ const installed = await client.listInstalledRegistryClips(orgId);
43
+ // An id is unique, so it wins outright. A NAME is not: cross-org
44
+ // installs can collide, and picking the first silently binds the
45
+ // device to the wrong clip. Mirror resolveConnection below — refuse
46
+ // an ambiguous match and name the ids that would disambiguate.
47
+ const byId = installed.find((c) => c.id === clipRef);
48
+ const matches = byId ? [byId] : installed.filter((c) => c.name === clipRef);
49
+ if (matches.length === 0) {
50
+ printError(new Error(`No installed clip matching "${clipRef}" (pass a crg_ id or the registry name; install first with \`parall clip install\`)`));
51
+ }
52
+ if (matches.length > 1) {
53
+ printError(new Error(`Clip name "${clipRef}" is ambiguous. Use a crg_ id: ${matches.map((c) => c.id).join(', ')}`));
54
+ }
55
+ const conn = await client.createClipConnection(orgId, matches[0].id, {
56
+ device_id: opts.device,
57
+ profile: opts.profile,
58
+ alias: opts.alias,
59
+ is_default: opts.default,
60
+ org_public: opts.public,
61
+ });
62
+ printJson(conn);
63
+ printRefHint(conn.id);
64
+ }
65
+ catch (err) {
66
+ printError(err);
67
+ }
68
+ });
69
+ // --- share ---
28
70
  let makePublic = false;
29
71
  let makePrivate = false;
30
- clip
31
- .command('connection')
32
- .description('Manage a clip connection')
72
+ connection
33
73
  .command('share')
34
74
  .description('Set organization-public access (human org owner/admin; personal key supported). When public, all humans and agents in this organization can use the connection regardless of the clip access list.')
35
75
  .argument('<connection>', 'Connection ccn_ id (ccn_ prefix always means ID), or unique alias across installed clips')
@@ -1 +1 @@
1
- {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../src/commands/slack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QA8NrD"}
1
+ {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../src/commands/slack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QAoPrD"}
@@ -16,8 +16,8 @@ export function registerSlackCommands(program) {
16
16
  .description('Slack channel platform verbs (agent-only; sends as the bound bot)');
17
17
  slack
18
18
  .command('send')
19
- .description('Send a message to a Slack conversation this connection has seen inbound')
20
- .requiredOption('--channel <channelId>', 'Vendor-native conversation id from the inbound event (C…/G…/D…)')
19
+ .description('Send a new Slack message, or reply in a thread')
20
+ .requiredOption('--channel <channelId>', 'Slack conversation id (C…/G…/D…)')
21
21
  // Same pair every other send verb carries (dm / messages / wechat).
22
22
  // Slack was the only one without it, while carrying the same
23
23
  // agent-authored prose: a reply containing `$`, a backtick or an
@@ -25,7 +25,8 @@ export function registerSlackCommands(program) {
25
25
  // it, and --text alone leaves no way out of that.
26
26
  .option('--text <text>', TEXT_OPTION_DESC)
27
27
  .option('--text-file <path>', TEXT_FILE_OPTION_DESC)
28
- .option('--reply-to <messageId>', 'Inbound message id you are answering ({channel}:{ts}, thread children {channel}:{root}#{ts}); REQUIRED in channels (reply lands in its thread). In DMs pass it too: a thread-child id lands the reply in that thread, a bare id keeps the main flow — the session never forks either way')
28
+ .option('--reply-to <messageId>', 'Legacy message id ({channel}:{ts} or {channel}:{root}#{ts}); channel replies use its thread, DM bare ids keep the main flow. Do not combine with --thread-ts')
29
+ .option('--thread-ts <ts>', 'Slack parent message ts; omit for a new message (requires an updated server)')
29
30
  .option('--file <path>', 'Attach a local file: it posts into the addressed conversation/thread with --text as the comment')
30
31
  .action(async (opts) => {
31
32
  try {
@@ -48,6 +49,7 @@ export function registerSlackCommands(program) {
48
49
  fileName: path.basename(filePath),
49
50
  content: new Blob([content]),
50
51
  ...(opts.replyTo ? { replyTo: opts.replyTo } : {}),
52
+ ...(opts.threadTs ? { threadTs: opts.threadTs } : {}),
51
53
  ...(text ? { text } : {}),
52
54
  });
53
55
  printJson(sent);
@@ -61,6 +63,7 @@ export function registerSlackCommands(program) {
61
63
  conversation_id: opts.channel,
62
64
  text,
63
65
  ...(opts.replyTo ? { reply_to: opts.replyTo } : {}),
66
+ ...(opts.threadTs ? { thread_ts: opts.threadTs } : {}),
64
67
  });
65
68
  printJson(sent);
66
69
  }
@@ -174,6 +177,22 @@ export function registerSlackCommands(program) {
174
177
  printError(err);
175
178
  }
176
179
  });
180
+ slack
181
+ .command('replies')
182
+ .description('Read a Slack thread: parent and replies (conversations.replies), one page at a time')
183
+ .requiredOption('--channel <id>', 'Slack channel id')
184
+ .requiredOption('--ts <ts>', 'Parent message ts; use thread_ts when starting from a reply')
185
+ .option('--cursor <cursor>', 'Pagination cursor from a previous page; continue until absent')
186
+ .option('--limit <n>', 'Page size (max 200)')
187
+ .action(async (opts) => {
188
+ try {
189
+ const { client, orgId } = resolveCredentials();
190
+ printJson(await client.slackReplies(orgId, opts.channel, opts.ts, page(opts)));
191
+ }
192
+ catch (err) {
193
+ printError(err);
194
+ }
195
+ });
177
196
  slack
178
197
  .command('status')
179
198
  .description('Set/clear the Agents-pane typing indicator on an assistant thread (cosmetic)')
@@ -0,0 +1,32 @@
1
+ import type { TaskDependencies, TaskDependencyEdge } from '@parall/sdk';
2
+ import type { Command } from 'commander';
3
+ /** Which side of a "blocks" edge the other task sits on, as named by the
4
+ * flag: `--blocked-by X` means X blocks the task, `--blocks Y` means the task
5
+ * blocks Y. */
6
+ export type DepsDirection = 'blocked_by' | 'blocks';
7
+ export interface DepsTarget {
8
+ direction: DepsDirection;
9
+ otherId: string;
10
+ }
11
+ /** Flag grammar for `tasks deps add/remove`: exactly one of --blocked-by /
12
+ * --blocks names the other task. The flag name carries the direction so the
13
+ * agent never has to infer who blocks whom. Exported for tests. */
14
+ export declare function resolveDepsTarget(opts: {
15
+ blockedBy?: string;
16
+ blocks?: string;
17
+ }): DepsTarget;
18
+ /** The relation row of a "blocks" edge is stored on the blocker side —
19
+ * POST/DELETE go to /tasks/{blocker}/relations. Exported for tests. */
20
+ export declare function resolveDepsEdgeEnds(taskId: string, target: DepsTarget): {
21
+ blockerId: string;
22
+ blockedId: string;
23
+ };
24
+ /** Finds the edge to the other task on the side the direction names.
25
+ * Exported for tests. */
26
+ export declare function findDepsEdge(deps: TaskDependencies, target: DepsTarget): TaskDependencyEdge | undefined;
27
+ /** Task dependency commands (`parall tasks deps …`), a sibling of tasks.ts to
28
+ * respect the file-size ratchet. Registered by registerTaskCommands on the
29
+ * `tasks` command group. Dependencies are `blocks` relations; the flag name
30
+ * gives the direction, so `tasks relations` stays for the other types. */
31
+ export declare function registerTaskDepsCommands(tasks: Command): void;
32
+ //# sourceMappingURL=task-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-deps.d.ts","sourceRoot":"","sources":["../../src/commands/task-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC;;eAEe;AACf,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;mEAEmE;AACnE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAe3F;AAED;uEACuE;AACvE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,GACjB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAI1C;AAED;yBACyB;AACzB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,UAAU,GACjB,kBAAkB,GAAG,SAAS,CAGhC;AAQD;;;0EAG0E;AAC1E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,QAyEtD"}
@@ -0,0 +1,105 @@
1
+ import { resolveCredentials } from '../lib/client.js';
2
+ import { printError, printJson, stripPrllScheme } from '../lib/output.js';
3
+ /** Flag grammar for `tasks deps add/remove`: exactly one of --blocked-by /
4
+ * --blocks names the other task. The flag name carries the direction so the
5
+ * agent never has to infer who blocks whom. Exported for tests. */
6
+ export function resolveDepsTarget(opts) {
7
+ const hasBlockedBy = opts.blockedBy !== undefined;
8
+ const hasBlocks = opts.blocks !== undefined;
9
+ if (hasBlockedBy && hasBlocks) {
10
+ throw new Error('--blocked-by and --blocks are mutually exclusive. Provide exactly one.');
11
+ }
12
+ if (!hasBlockedBy && !hasBlocks) {
13
+ throw new Error('Provide exactly one of --blocked-by <taskId> or --blocks <taskId>.');
14
+ }
15
+ const flag = hasBlockedBy ? '--blocked-by' : '--blocks';
16
+ const otherId = stripPrllScheme(((hasBlockedBy ? opts.blockedBy : opts.blocks) ?? '').trim());
17
+ if (!otherId) {
18
+ throw new Error(`${flag} requires a task ID`);
19
+ }
20
+ return { direction: hasBlockedBy ? 'blocked_by' : 'blocks', otherId };
21
+ }
22
+ /** The relation row of a "blocks" edge is stored on the blocker side —
23
+ * POST/DELETE go to /tasks/{blocker}/relations. Exported for tests. */
24
+ export function resolveDepsEdgeEnds(taskId, target) {
25
+ return target.direction === 'blocked_by'
26
+ ? { blockerId: target.otherId, blockedId: taskId }
27
+ : { blockerId: taskId, blockedId: target.otherId };
28
+ }
29
+ /** Finds the edge to the other task on the side the direction names.
30
+ * Exported for tests. */
31
+ export function findDepsEdge(deps, target) {
32
+ const side = target.direction === 'blocked_by' ? deps.blocked_by : deps.blocking;
33
+ return side.find((edge) => edge.task.id === target.otherId);
34
+ }
35
+ function withDirectionFlags(cmd) {
36
+ return cmd
37
+ .option('--blocked-by <taskId>', 'The other task blocks this one (it must finish first)')
38
+ .option('--blocks <taskId>', 'This task blocks the other one (it has to wait)');
39
+ }
40
+ /** Task dependency commands (`parall tasks deps …`), a sibling of tasks.ts to
41
+ * respect the file-size ratchet. Registered by registerTaskCommands on the
42
+ * `tasks` command group. Dependencies are `blocks` relations; the flag name
43
+ * gives the direction, so `tasks relations` stays for the other types. */
44
+ export function registerTaskDepsCommands(tasks) {
45
+ const deps = tasks
46
+ .command('deps')
47
+ .description('Blocking dependencies between tasks (who blocks whom)');
48
+ deps
49
+ .command('list')
50
+ .description('Show what blocks a task (blocked_by) and what it blocks (blocking); a restricted entry is a task you cannot read and names the project to join')
51
+ .argument('<taskId>', 'Task ID')
52
+ .action(async (taskId) => {
53
+ try {
54
+ const { client, orgId } = resolveCredentials();
55
+ const result = await client.getTaskDependencies(orgId, stripPrllScheme(taskId));
56
+ printJson(result);
57
+ }
58
+ catch (err) {
59
+ printError(err);
60
+ }
61
+ });
62
+ withDirectionFlags(deps
63
+ .command('add')
64
+ .description('Declare a blocking dependency with exactly one of --blocked-by <id> or --blocks <id>')
65
+ .argument('<taskId>', 'Task ID')).action(async (taskId, opts) => {
66
+ try {
67
+ // Grammar first: a flag error is a parameter error even when
68
+ // credentials are absent, and it must never reach the wire.
69
+ const target = resolveDepsTarget(opts);
70
+ const { blockerId, blockedId } = resolveDepsEdgeEnds(stripPrllScheme(taskId), target);
71
+ const { client, orgId } = resolveCredentials();
72
+ const result = await client.createTaskRelation(orgId, blockerId, {
73
+ target_type: 'task',
74
+ target_id: blockedId,
75
+ relation_type: 'blocks',
76
+ });
77
+ printJson(result);
78
+ }
79
+ catch (err) {
80
+ printError(err);
81
+ }
82
+ });
83
+ withDirectionFlags(deps
84
+ .command('remove')
85
+ .description('Remove a blocking dependency (same --blocked-by / --blocks grammar as "tasks deps add")')
86
+ .argument('<taskId>', 'Task ID')).action(async (taskId, opts) => {
87
+ try {
88
+ const target = resolveDepsTarget(opts);
89
+ const normalizedTaskId = stripPrllScheme(taskId);
90
+ const { blockerId } = resolveDepsEdgeEnds(normalizedTaskId, target);
91
+ const { client, orgId } = resolveCredentials();
92
+ const edge = findDepsEdge(await client.getTaskDependencies(orgId, normalizedTaskId), target);
93
+ if (!edge) {
94
+ throw new Error(target.direction === 'blocked_by'
95
+ ? `${normalizedTaskId} is not blocked by ${target.otherId} (run "tasks deps list ${normalizedTaskId}" to see its blockers)`
96
+ : `${normalizedTaskId} does not block ${target.otherId} (run "tasks deps list ${normalizedTaskId}" to see what it blocks)`);
97
+ }
98
+ await client.deleteTaskRelation(orgId, blockerId, edge.relation_id);
99
+ printJson({ ok: true });
100
+ }
101
+ catch (err) {
102
+ printError(err);
103
+ }
104
+ });
105
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2GpC;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG;IAClD,WAAW,EAAE,sBAAsB,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB,CAOA;AAgCD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;;;;;;;;;;;GAcA;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;YAS0B,iBAAiB,CAAC,QAAQ,CAAC;cACvB,iBAAiB,CAAC,UAAU,CAAC;;;;;;;;;GAU3D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAyiBpD"}
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4GpC;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG;IAClD,WAAW,EAAE,sBAAsB,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB,CAOA;AAgCD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;;;;;;;;;;;GAcA;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;YAS0B,iBAAiB,CAAC,QAAQ,CAAC;cACvB,iBAAiB,CAAC,UAAU,CAAC;;;;;;;;;GAU3D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QA+iBpD"}
@@ -3,6 +3,7 @@ import { createHash } from 'node:crypto';
3
3
  import { resolveCredentials, resolveTypedDispatchBinding } from '../lib/client.js';
4
4
  import { printJson, printError, printRefHint, stripPrllScheme } from '../lib/output.js';
5
5
  import { resolveResolutionFlag } from './comments.js';
6
+ import { registerTaskDepsCommands } from './task-deps.js';
6
7
  import { BODY_FILE_OPTION_DESC, BODY_OPTION_DESC, DESCRIPTION_FILE_OPTION_DESC, DESCRIPTION_OPTION_DESC, resolveCommentBody, resolveTaskDescription, } from '../lib/text-input.js';
7
8
  function stripUndefined(obj) {
8
9
  return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined));
@@ -616,7 +617,7 @@ export function registerTaskCommands(program) {
616
617
  // ---- Relations ----
617
618
  const relations = tasks
618
619
  .command('relations')
619
- .description('Link a task to other entities (blocks / related / duplicate / source / …)');
620
+ .description('Link a task to other entities (blocks / related / duplicate / source / …); for who-blocks-whom between tasks prefer "tasks deps"');
620
621
  relations
621
622
  .command('add')
622
623
  .description('Create a relation from a task to another entity')
@@ -667,4 +668,6 @@ export function registerTaskCommands(program) {
667
668
  printError(err);
668
669
  }
669
670
  });
671
+ // ---- Dependencies (blocks edges; direction given by the flag name) ----
672
+ registerTaskDepsCommands(tasks);
670
673
  }
@@ -659,7 +659,7 @@ export function registerWikiCommands(program) {
659
659
  const result = await ctx.client.getWikiPageIndex(ctx.orgId, wiki.id);
660
660
  process.stderr.write(`Wiki: ${result.wiki_name} (${result.wiki_slug}) | ${result.page_count} pages\n\n`);
661
661
  for (const page of result.pages) {
662
- const headings = page.top_headings.length > 0 ? ` — ${page.top_headings.join(', ')}` : '';
662
+ const headings = page.top_headings?.length ? ` — ${page.top_headings.join(', ')}` : '';
663
663
  process.stderr.write(` ${page.path} "${page.title}" (${page.section_count} sections, ${page.size_bytes}B)${headings}\n`);
664
664
  }
665
665
  printJson(result);
@@ -21,5 +21,16 @@ export declare function ensurePrllScheme(idOrUri: string): string;
21
21
  * than receiving a malformed value.
22
22
  */
23
23
  export declare function parsePositiveInt(raw: string | undefined): number | undefined;
24
+ /**
25
+ * Plain-text next step for a project-roster denial: a 403 `PERMISSION_DENIED`
26
+ * whose `details.project` names an existing task/project the caller is not on
27
+ * the roster of. The wire carries only facts (id, visibility, key/name); the
28
+ * remediation command is synthesized here from `visibility`, so no command
29
+ * string ever comes from the server. Undefined when `details` does not carry
30
+ * a well-formed project or the visibility is unknown, so the caller falls
31
+ * back to the generic approval guidance.
32
+ * See docs/engineering-design/project-roster-denial-design.md §3.2 / §5
33
+ */
34
+ export declare function projectRosterNextStep(details: unknown): string | undefined;
24
35
  export declare function printError(err: unknown, attemptedPayload?: Record<string, unknown>): never;
25
36
  //# sourceMappingURL=output.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAY,GAAG,IAAI,CAEvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAW5E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CA8C1F"}
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAY,GAAG,IAAI,CAEvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAW5E;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAe1E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAqD1F"}
@@ -43,6 +43,46 @@ export function parsePositiveInt(raw) {
43
43
  const n = Number(t);
44
44
  return Number.isInteger(n) && n > 0 ? n : undefined;
45
45
  }
46
+ /** Reads `details.project` off a denial envelope; undefined unless it carries
47
+ * a string `id` and `visibility` (`key` / `name` are omitted for private). */
48
+ function readProjectDenial(details) {
49
+ if (details === null || typeof details !== 'object')
50
+ return undefined;
51
+ const project = details.project;
52
+ if (project === null || typeof project !== 'object')
53
+ return undefined;
54
+ const { id, visibility, key } = project;
55
+ if (typeof id !== 'string' || id === '' || typeof visibility !== 'string')
56
+ return undefined;
57
+ return { id, visibility, key: typeof key === 'string' && key !== '' ? key : undefined };
58
+ }
59
+ /**
60
+ * Plain-text next step for a project-roster denial: a 403 `PERMISSION_DENIED`
61
+ * whose `details.project` names an existing task/project the caller is not on
62
+ * the roster of. The wire carries only facts (id, visibility, key/name); the
63
+ * remediation command is synthesized here from `visibility`, so no command
64
+ * string ever comes from the server. Undefined when `details` does not carry
65
+ * a well-formed project or the visibility is unknown, so the caller falls
66
+ * back to the generic approval guidance.
67
+ * See docs/engineering-design/project-roster-denial-design.md §3.2 / §5
68
+ */
69
+ export function projectRosterNextStep(details) {
70
+ const project = readProjectDenial(details);
71
+ if (!project)
72
+ return undefined;
73
+ const label = project.key ?? project.id;
74
+ const ref = `prll://${project.id}`;
75
+ switch (project.visibility) {
76
+ case 'public':
77
+ return `You are not on the roster of project ${label} (public). Join it yourself — project admission is self-service, not the approvals flow, so approvable above does not apply:\n parall projects join ${ref}`;
78
+ case 'restricted':
79
+ return `You are not on the roster of project ${label} (restricted). Request to join it yourself — project admission is self-service, not the approvals flow, so approvable above does not apply; a project manager approves and you receive an approval.decided event:\n parall projects request-join ${ref}`;
80
+ case 'private':
81
+ return 'This belongs to a private project you are not on. Ask a project manager or org owner/admin to add you.';
82
+ default:
83
+ return undefined;
84
+ }
85
+ }
46
86
  export function printError(err, attemptedPayload) {
47
87
  if (err instanceof ApiError) {
48
88
  // Faithful, parseable line: the server's real message + machine anchors.
@@ -55,10 +95,17 @@ export function printError(err, attemptedPayload) {
55
95
  ...(err.approvable !== undefined ? { approvable: err.approvable } : {}),
56
96
  ...(err.extras ? { extras: err.extras } : {}),
57
97
  }));
58
- // Authorization denial: tell the agent how to escalate, driven entirely by
59
- // the server's `approvable` flag (no hardcoded allowlist that can drift).
60
- // See docs/engineering-design/error-contract-design.md
61
- if (err.code === 'PERMISSION_DENIED' && err.action) {
98
+ // Project-roster denial: the fix is joining the project (its own action
99
+ // with its own endpoint), not an approval of the read — so this branch
100
+ // replaces the approval guidance below rather than adding to it.
101
+ const rosterStep = err.code === 'PERMISSION_DENIED' ? projectRosterNextStep(err.extras?.details) : undefined;
102
+ if (rosterStep) {
103
+ console.error(rosterStep);
104
+ }
105
+ else if (err.code === 'PERMISSION_DENIED' && err.action) {
106
+ // Authorization denial: tell the agent how to escalate, driven entirely by
107
+ // the server's `approvable` flag (no hardcoded allowlist that can drift).
108
+ // See docs/engineering-design/error-contract-design.md
62
109
  // Only an explicit `false` means "not approvable". A missing flag (older
63
110
  // server, or a service that doesn't emit it) is unknown — offer the
64
111
  // approval path rather than suppressing a possibly-valid request.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.64.0",
3
+ "version": "1.66.0",
4
4
  "description": "CLI client for Parall — universal agent & human access to Parall API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,15 +37,15 @@
37
37
  "js-yaml": "^4.1.0",
38
38
  "node-diff3": "3.2.1",
39
39
  "zod": "^4.3.6",
40
- "@parall/sdk": "1.64.0",
41
- "@parall/agent-core": "1.64.0"
40
+ "@parall/agent-core": "1.66.0",
41
+ "@parall/sdk": "1.66.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/js-yaml": "^4.0.9",
45
45
  "@types/node": "^22.0.0",
46
46
  "esbuild": "^0.25.0",
47
47
  "typescript": "^5.7.0",
48
- "@parall/agent-core": "1.64.0"
48
+ "@parall/agent-core": "1.66.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc",