@parall/cli 1.25.0 → 1.26.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.
@@ -13,11 +13,12 @@ export type RuntimeContext = {
13
13
  noReply: boolean;
14
14
  };
15
15
  /**
16
- * Read per-dispatch context from ENV.
16
+ * Read per-dispatch context from ENV + sideband files.
17
17
  *
18
- * Step ID resolution order:
19
- * 1. PRLL_STEP_ID env var (set by openclaw-channel before_tool_call hook)
20
- * 2. PRLL_STEP_ID_FILE file contents (written by bridge for subprocess runtimes)
18
+ * Resolution order (first non-empty value wins per field):
19
+ * 1. PRLL_* env vars (set by OpenClaw/Hermes hooks per tool call)
20
+ * 2. PRLL_CONTEXT_FILE JSON (written by CC/Codex bridge gateway per dispatch)
21
+ * 3. PRLL_STEP_ID_FILE plain text (legacy step-id-only backward compat)
21
22
  */
22
23
  export declare function resolveRuntimeContext(): RuntimeContext;
23
24
  export declare function resolveCredentials(): ResolvedCredentials;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAmBtD;AAED,wBAAgB,kBAAkB,IAAI,mBAAmB,CAoBxD"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAiCtD;AAED,wBAAgB,kBAAkB,IAAI,mBAAmB,CAoBxD"}
@@ -1,14 +1,36 @@
1
1
  import * as fs from 'node:fs';
2
2
  import { ParallClient } from '@parall/sdk';
3
3
  /**
4
- * Read per-dispatch context from ENV.
4
+ * Read per-dispatch context from ENV + sideband files.
5
5
  *
6
- * Step ID resolution order:
7
- * 1. PRLL_STEP_ID env var (set by openclaw-channel before_tool_call hook)
8
- * 2. PRLL_STEP_ID_FILE file contents (written by bridge for subprocess runtimes)
6
+ * Resolution order (first non-empty value wins per field):
7
+ * 1. PRLL_* env vars (set by OpenClaw/Hermes hooks per tool call)
8
+ * 2. PRLL_CONTEXT_FILE JSON (written by CC/Codex bridge gateway per dispatch)
9
+ * 3. PRLL_STEP_ID_FILE plain text (legacy step-id-only backward compat)
9
10
  */
10
11
  export function resolveRuntimeContext() {
12
+ let sessionId = process.env.PRLL_SESSION_ID?.trim() || undefined;
11
13
  let stepId = process.env.PRLL_STEP_ID?.trim() || undefined;
14
+ let chatId = process.env.PRLL_CHAT_ID?.trim() || undefined;
15
+ let triggerMessageId = process.env.PRLL_TRIGGER_MESSAGE_ID?.trim() || undefined;
16
+ let noReply = process.env.PRLL_NO_REPLY === '1';
17
+ if (process.env.PRLL_CONTEXT_FILE) {
18
+ try {
19
+ const raw = fs.readFileSync(process.env.PRLL_CONTEXT_FILE, 'utf-8').trim();
20
+ if (raw) {
21
+ const ctx = JSON.parse(raw);
22
+ sessionId ??= ctx.session_id || undefined;
23
+ chatId ??= ctx.chat_id || undefined;
24
+ triggerMessageId ??= ctx.trigger_message_id || undefined;
25
+ stepId ??= ctx.step_id || undefined;
26
+ if (ctx.no_reply === true)
27
+ noReply = true;
28
+ }
29
+ }
30
+ catch {
31
+ // File not yet written or malformed — no context
32
+ }
33
+ }
12
34
  if (!stepId && process.env.PRLL_STEP_ID_FILE) {
13
35
  try {
14
36
  const content = fs.readFileSync(process.env.PRLL_STEP_ID_FILE, 'utf-8').trim();
@@ -19,13 +41,7 @@ export function resolveRuntimeContext() {
19
41
  // File not yet written or unreadable — no step context
20
42
  }
21
43
  }
22
- return {
23
- sessionId: process.env.PRLL_SESSION_ID?.trim() || undefined,
24
- stepId,
25
- chatId: process.env.PRLL_CHAT_ID?.trim() || undefined,
26
- triggerMessageId: process.env.PRLL_TRIGGER_MESSAGE_ID?.trim() || undefined,
27
- noReply: process.env.PRLL_NO_REPLY === '1',
28
- };
44
+ return { sessionId, stepId, chatId, triggerMessageId, noReply };
29
45
  }
30
46
  export function resolveCredentials() {
31
47
  const url = process.env.PRLL_API_URL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.25.0",
3
+ "version": "1.26.0",
4
4
  "description": "CLI client for Parall — universal agent & human access to Parall API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "@modelcontextprotocol/sdk": "1.27.1",
31
31
  "commander": "^13.0.0",
32
32
  "zod": "^4.3.6",
33
- "@parall/sdk": "1.25.0"
33
+ "@parall/sdk": "1.26.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^22.0.0",