@parall/claude-agent 1.31.0 → 1.32.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,4 +1,4 @@
1
- import type { AgentIdentity } from "@parall/agent-core";
1
+ import type { AgentIdentity } from '@parall/agent-core';
2
2
  export declare function ensureClaudeWorkspace(workspaceDir: string, log?: {
3
3
  warn: (msg: string) => void;
4
4
  }, agentIdentity?: AgentIdentity): void;
package/dist/workspace.js CHANGED
@@ -1,7 +1,7 @@
1
- import * as fs from "node:fs";
2
- import * as path from "node:path";
3
- import { BRIDGE_WORKSPACE_INSTRUCTIONS, PRLL_BEHAVIOR, PRLL_REFERENCE_GUIDE, buildIdentity, buildSkillReferences, writeSkillFiles, } from "@parall/agent-core";
4
- import { ensureLocalAttachmentGitExclude } from "@parall/agent-core/internal/attachment-input";
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { BRIDGE_WORKSPACE_INSTRUCTIONS, PRLL_BEHAVIOR, PRLL_REFERENCE_GUIDE, buildIdentity, buildSkillReferences, writeSkillFiles, } from '@parall/agent-core';
4
+ import { ensureLocalAttachmentGitExclude } from '@parall/agent-core/internal/attachment-input';
5
5
  export function ensureClaudeWorkspace(workspaceDir, log, agentIdentity) {
6
6
  const systemPrompt = [
7
7
  buildIdentity(agentIdentity),
@@ -9,12 +9,12 @@ export function ensureClaudeWorkspace(workspaceDir, log, agentIdentity) {
9
9
  PRLL_BEHAVIOR,
10
10
  PRLL_REFERENCE_GUIDE,
11
11
  buildSkillReferences(workspaceDir),
12
- ].join("\n\n");
12
+ ].join('\n\n');
13
13
  fs.mkdirSync(workspaceDir, { recursive: true });
14
- fs.mkdirSync(path.join(workspaceDir, ".claude"), { recursive: true });
15
- const parallDir = path.join(workspaceDir, ".parall");
14
+ fs.mkdirSync(path.join(workspaceDir, '.claude'), { recursive: true });
15
+ const parallDir = path.join(workspaceDir, '.parall');
16
16
  fs.mkdirSync(parallDir, { recursive: true });
17
- fs.writeFileSync(path.join(parallDir, "system-prompt.md"), systemPrompt, "utf8");
18
- writeSkillFiles(path.join(parallDir, "skills"));
17
+ fs.writeFileSync(path.join(parallDir, 'system-prompt.md'), systemPrompt, 'utf8');
18
+ writeSkillFiles(path.join(parallDir, 'skills'));
19
19
  ensureLocalAttachmentGitExclude(workspaceDir);
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/claude-agent",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "Claude Code bridge runtime for self-hosted Parall agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,9 +25,9 @@
25
25
  "src"
26
26
  ],
27
27
  "dependencies": {
28
- "@parall/sdk": "1.31.0",
29
- "@parall/cli": "1.31.0",
30
- "@parall/agent-core": "1.31.0"
28
+ "@parall/agent-core": "1.32.0",
29
+ "@parall/cli": "1.32.0",
30
+ "@parall/sdk": "1.32.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.0.0",
package/src/config.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as os from "node:os";
2
- import * as path from "node:path";
1
+ import * as os from 'node:os';
2
+ import * as path from 'node:path';
3
3
 
4
4
  export type ClaudeAgentConfig = {
5
5
  apiUrl: string;
@@ -42,12 +42,16 @@ function resolvePath(value: string): string {
42
42
  }
43
43
 
44
44
  export function resolveClaudeAgentConfig(env: NodeJS.ProcessEnv = process.env): ClaudeAgentConfig {
45
- const apiUrl = requireEnv(env, "PRLL_API_URL");
46
- const apiKey = requireEnv(env, "PRLL_API_KEY");
47
- const orgId = requireEnv(env, "PRLL_ORG_ID");
45
+ const apiUrl = requireEnv(env, 'PRLL_API_URL');
46
+ const apiKey = requireEnv(env, 'PRLL_API_KEY');
47
+ const orgId = requireEnv(env, 'PRLL_ORG_ID');
48
48
  const claudeHome = resolvePath(env.PRLL_CLAUDE_HOME?.trim() || env.HOME || os.homedir());
49
- const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() || path.join(claudeHome, ".parall-agent"));
50
- const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() || path.join(stateDir, "workspace"));
49
+ const stateDir = resolvePath(
50
+ env.PRLL_STATE_DIR?.trim() || path.join(claudeHome, '.parall-agent'),
51
+ );
52
+ const workspaceDir = resolvePath(
53
+ env.PRLL_WORKSPACE_DIR?.trim() || path.join(stateDir, 'workspace'),
54
+ );
51
55
  const additionalDirs = parseList(env.PRLL_CLAUDE_ADD_DIRS).map(resolvePath);
52
56
 
53
57
  return {
@@ -56,26 +60,30 @@ export function resolveClaudeAgentConfig(env: NodeJS.ProcessEnv = process.env):
56
60
  orgId,
57
61
  wsUrl: env.PRLL_WS_URL?.trim() || undefined,
58
62
  swimlaneName: env.PRLL_SWIMLANE_NAME?.trim() || undefined,
59
- claudeBin: env.PRLL_CLAUDE_BIN?.trim() || "claude",
63
+ claudeBin: env.PRLL_CLAUDE_BIN?.trim() || 'claude',
60
64
  claudeHome,
61
65
  stateDir,
62
66
  workspaceDir,
63
67
  model: env.PRLL_CLAUDE_MODEL?.trim() || undefined,
64
- permissionMode: env.PRLL_CLAUDE_PERMISSION_MODE?.trim() || "bypassPermissions",
68
+ permissionMode: env.PRLL_CLAUDE_PERMISSION_MODE?.trim() || 'bypassPermissions',
65
69
  allowedTools: parseList(env.PRLL_CLAUDE_ALLOWED_TOOLS),
66
70
  disallowedTools: parseList(env.PRLL_CLAUDE_DISALLOWED_TOOLS),
67
71
  additionalDirs,
68
72
  appendSystemPrompt: env.PRLL_CLAUDE_APPEND_SYSTEM_PROMPT?.trim() || undefined,
69
73
  runtimeKey: env.PRLL_CLAUDE_RUNTIME_KEY?.trim() || undefined,
70
- allowApiKey: env.PRLL_CLAUDE_ALLOW_API_KEY?.trim() === "1",
74
+ allowApiKey: env.PRLL_CLAUDE_ALLOW_API_KEY?.trim() === '1',
71
75
  };
72
76
  }
73
77
 
74
- export function resolveWsUrl(apiUrl: string, explicitWsUrl?: string, swimlaneName?: string): string {
75
- const base = explicitWsUrl || `${apiUrl.replace(/\/$/, "").replace(/^http/, "ws")}/ws`;
78
+ export function resolveWsUrl(
79
+ apiUrl: string,
80
+ explicitWsUrl?: string,
81
+ swimlaneName?: string,
82
+ ): string {
83
+ const base = explicitWsUrl || `${apiUrl.replace(/\/$/, '').replace(/^http/, 'ws')}/ws`;
76
84
  if (!swimlaneName) return base;
77
85
  const url = new URL(base);
78
- url.searchParams.set("swimlane", swimlaneName);
86
+ url.searchParams.set('swimlane', swimlaneName);
79
87
  return url.toString();
80
88
  }
81
89
 
@@ -84,17 +92,17 @@ export function buildClaudeRuntimeKey(agentUserId: string): string {
84
92
  }
85
93
 
86
94
  export function sessionStateFilePathForRuntime(stateDir: string, runtimeKey: string): string {
87
- const fileName = Buffer.from(runtimeKey).toString("base64url");
88
- return path.join(stateDir, "sessions", `${fileName}.json`);
95
+ const fileName = Buffer.from(runtimeKey).toString('base64url');
96
+ return path.join(stateDir, 'sessions', `${fileName}.json`);
89
97
  }
90
98
 
91
99
  export function contextFilePathForSession(stateDir: string, sessionKey: string): string {
92
- const fileName = Buffer.from(sessionKey).toString("base64url");
93
- return path.join(stateDir, "dispatch-context", `${fileName}.json`);
100
+ const fileName = Buffer.from(sessionKey).toString('base64url');
101
+ return path.join(stateDir, 'dispatch-context', `${fileName}.json`);
94
102
  }
95
103
 
96
104
  /** @deprecated Use contextFilePathForSession. */
97
105
  export function stepIdFilePathForSession(stateDir: string, sessionKey: string): string {
98
- const fileName = Buffer.from(sessionKey).toString("base64url");
99
- return path.join(stateDir, "step-ids", `${fileName}.txt`);
106
+ const fileName = Buffer.from(sessionKey).toString('base64url');
107
+ return path.join(stateDir, 'step-ids', `${fileName}.txt`);
100
108
  }