@parall/cli 1.80.0 → 1.81.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.
@@ -0,0 +1,65 @@
1
+ import { resolveCredentials } from '../lib/client.js';
2
+ import { printError, printJson, printProgress, stripPrllScheme } from '../lib/output.js';
3
+ const REACT_HELP = `
4
+ Examples:
5
+ parall messages react prll://msg_01HXYZ 👍 # add; running it again keeps it
6
+ parall messages unreact prll://msg_01HXYZ 👍 # remove; running it again is fine
7
+
8
+ React instead of replying when a short acknowledgement or agreement needs no words.`;
9
+ /**
10
+ * Message ID from a `msg_…` or `prll://msg_…` argument. Any other reference
11
+ * is refused before a request is made, with the command to run instead.
12
+ */
13
+ export function parseReactionTarget(raw, verb) {
14
+ const id = stripPrllScheme(raw.trim());
15
+ if (id.startsWith('msg_'))
16
+ return id;
17
+ const fix = id.startsWith('cht_')
18
+ ? `That is a chat. Find the message first: parall messages list prll://${id} --limit 5`
19
+ : `Find the message ID (msg_…) with: parall messages list <chat> --limit 5`;
20
+ throw new Error(`parall messages ${verb} takes a message ID (msg_… or prll://msg_…), got "${raw}". ${fix}`);
21
+ }
22
+ /**
23
+ * Put the caller's reaction into the desired state. A server that predates
24
+ * desired-state writes ignores the body and toggles (its response has no
25
+ * `reacted`); when that toggle went the wrong way, toggle once more.
26
+ */
27
+ export async function setMessageReaction(client, messageId, emoji, reacted) {
28
+ const result = await client.setReaction(messageId, emoji, reacted);
29
+ if (result.reacted !== undefined)
30
+ return result;
31
+ if (result.added === reacted)
32
+ return { ...result, reacted };
33
+ const retry = await client.toggleReaction(messageId, emoji);
34
+ return { ...retry, reacted: retry.added };
35
+ }
36
+ export function registerReactionCommands(messages) {
37
+ for (const [verb, reacted] of [
38
+ ['react', true],
39
+ ['unreact', false],
40
+ ]) {
41
+ messages
42
+ .command(verb)
43
+ .description(reacted
44
+ ? 'Add your emoji reaction to a message (repeating it is a no-op)'
45
+ : 'Remove your emoji reaction from a message (repeating it is a no-op)')
46
+ .argument('<messageId>', 'Message ID (msg_… or prll://msg_…)')
47
+ .argument('<emoji>', 'Emoji, e.g. 👍')
48
+ .addHelpText('after', REACT_HELP)
49
+ .showHelpAfterError(`Example: parall messages ${verb} prll://msg_xxx 👍`)
50
+ .action(async (rawId, emoji) => {
51
+ try {
52
+ const messageId = parseReactionTarget(rawId, verb);
53
+ const { client } = resolveCredentials();
54
+ const result = await setMessageReaction(client, messageId, emoji, reacted);
55
+ printJson(result);
56
+ printProgress(result.reacted
57
+ ? `Reacted ${emoji} on prll://${messageId}`
58
+ : `No ${emoji} reaction from you on prll://${messageId}`);
59
+ }
60
+ catch (err) {
61
+ printError(err);
62
+ }
63
+ });
64
+ }
65
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5C,OAAO,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GACtD;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CASzC;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QA8TvD"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5C,OAAO,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GACtD;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CASzC;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAiTvD"}
@@ -4,6 +4,7 @@ import { LaneContextError, markLaneReplyCommitted, resolveCredentials, resolveLa
4
4
  import { printError, printJson, printRefHint, stripPrllScheme } from '../lib/output.js';
5
5
  import { NO_BODY_ERROR, resolveMessageText, TEXT_FILE_OPTION_DESC, TEXT_OPTION_DESC, } from '../lib/text-input.js';
6
6
  import { uploadFile } from '../lib/upload.js';
7
+ import { registerReactionCommands } from './messages-react.js';
7
8
  /**
8
9
  * Message ↔ session/step attribution for a send. Lane context WINS over the
9
10
  * process-level runtime context: the lane file is written per dispatch (a
@@ -81,21 +82,7 @@ export function registerMessageCommands(program) {
81
82
  printError(err);
82
83
  }
83
84
  });
84
- messages
85
- .command('react')
86
- .description('Toggle an emoji reaction on a message (add if absent, remove if present)')
87
- .argument('<messageId>', 'Message ID')
88
- .argument('<emoji>', 'Emoji to toggle (e.g. 👍)')
89
- .action(async (messageId, emoji) => {
90
- try {
91
- const { client } = resolveCredentials();
92
- const result = await client.toggleReaction(stripPrllScheme(messageId), emoji);
93
- printJson(result);
94
- }
95
- catch (err) {
96
- printError(err);
97
- }
98
- });
85
+ registerReactionCommands(messages);
99
86
  messages
100
87
  .command('edit')
101
88
  .description('Edit a message you authored (replaces its full text; recipients see an edit signal)')
@@ -0,0 +1,3 @@
1
+ /** Printed after a usage error (missing argument, unknown option) under `parall connector`. */
2
+ export declare const CONNECTOR_USAGE_HINT = "(list installed connectors with `parall connector list`; add --help for usage)";
3
+ //# sourceMappingURL=connector-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-ref.d.ts","sourceRoot":"","sources":["../../src/lib/connector-ref.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,mFACiD,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Printed after a usage error (missing argument, unknown option) under `parall connector`. */
2
+ export const CONNECTOR_USAGE_HINT = '(list installed connectors with `parall connector list`; add --help for usage)';
@@ -6,7 +6,7 @@ function fileIdentityMatches(a, b) {
6
6
  function assertContained(root, candidate, name) {
7
7
  const pathFromRoot = relative(root, candidate);
8
8
  if (pathFromRoot === '..' || pathFromRoot.startsWith(`..${sep}`) || isAbsolute(pathFromRoot)) {
9
- throw new Error(`Publish source escapes the clip directory: ${name}`);
9
+ throw new Error(`Publish source escapes the connector directory: ${name}`);
10
10
  }
11
11
  }
12
12
  function assertSourceRootIdentity(root, expected) {
@@ -97,7 +97,7 @@ export function collectPublishSource(directory) {
97
97
  throw new Error('not a directory');
98
98
  }
99
99
  catch {
100
- throw new Error(`Clip directory is unavailable: ${directory}`);
100
+ throw new Error(`Connector directory is unavailable: ${directory}`);
101
101
  }
102
102
  const entries = new Map(readdirSync(root, { withFileTypes: true }).map((entry) => [entry.name, entry]));
103
103
  assertSourceRootIdentity(root, rootMetadata);
@@ -158,8 +158,8 @@ function assertPublishableManifestType(manifest) {
158
158
  if (type == null || type === 'browser' || type === 'mcp')
159
159
  return;
160
160
  const message = type === 'clip'
161
- ? 'manifest "type" "clip" is the legacy Pinix v2 package value — declare "browser" (or omit the field) for a browser clip, "mcp" for an MCP clip'
162
- : `manifest "type" must be "browser" or "mcp" (or omitted for a browser clip); got ${JSON.stringify(type)}`;
161
+ ? 'manifest "type" "clip" is the legacy Pinix v2 package value — declare "browser" (or omit the field) for a browser connector, "mcp" for an MCP connector'
162
+ : `manifest "type" must be "browser" or "mcp" (or omitted for a browser connector); got ${JSON.stringify(type)}`;
163
163
  throw new Error(`Invalid manifest: ${message}`);
164
164
  }
165
165
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.80.0",
3
+ "version": "1.81.0",
4
4
  "description": "CLI client for Parall — universal agent & human access to Parall API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "node-diff3": "3.2.1",
43
43
  "tar-stream": "^3.2.1",
44
44
  "zod": "^4.3.6",
45
- "@parall/agent-core": "1.80.0",
46
- "@parall/sdk": "1.80.0"
45
+ "@parall/sdk": "1.81.0",
46
+ "@parall/agent-core": "1.81.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@dnd-kit/core": "6.3.1",
@@ -71,7 +71,7 @@
71
71
  "tw-animate-css": "1.4.0",
72
72
  "typescript": "^5.7.0",
73
73
  "vite": "6.4.1",
74
- "@parall/agent-core": "1.80.0"
74
+ "@parall/agent-core": "1.81.0"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "node scripts/generate-miniapp-sdk.mjs --check && node scripts/generate-local-runner.mjs --check && node scripts/generate-app-templates.mjs --check && node scripts/generate-app-template-catalog.mjs --check && tsc",