@parall/cli 1.64.0 → 1.65.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)')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.64.0",
3
+ "version": "1.65.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.65.0",
41
+ "@parall/sdk": "1.65.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.65.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc",