n8n-nodes-claude-code-cli 1.5.0 → 1.6.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.
- package/dist/index.js +286 -2
- package/dist/index.js.map +3 -3
- package/dist/nodes/ClaudeCode/ClaudeCode.node.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/ClaudeCode.node.js +286 -2
- package/dist/nodes/ClaudeCode/ClaudeCode.node.js.map +3 -3
- package/dist/nodes/ClaudeCode/descriptions/agentsDescription.d.ts +3 -0
- package/dist/nodes/ClaudeCode/descriptions/agentsDescription.d.ts.map +1 -0
- package/dist/nodes/ClaudeCode/descriptions/index.d.ts +1 -0
- package/dist/nodes/ClaudeCode/descriptions/index.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/descriptions/optionsDescription.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/interfaces/ClaudeCodeTypes.d.ts +21 -0
- package/dist/nodes/ClaudeCode/interfaces/ClaudeCodeTypes.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/interfaces/index.d.ts +1 -1
- package/dist/nodes/ClaudeCode/interfaces/index.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/transport/K8sPersistentExecutor.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/transport/k8s/podSpecBuilder.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/utils/commandBuilder.d.ts.map +1 -1
- package/dist/nodes/ClaudeCode/utils/optionsBuilder.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaudeCode.node.d.ts","sourceRoot":"","sources":["../../../nodes/ClaudeCode/ClaudeCode.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAEpB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ClaudeCode.node.d.ts","sourceRoot":"","sources":["../../../nodes/ClaudeCode/ClaudeCode.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAEpB,MAAM,cAAc,CAAC;AA2BtB,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CA6F/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAuHvE"}
|
|
@@ -173996,6 +173996,142 @@ var modelDescription = [
|
|
|
173996
173996
|
}
|
|
173997
173997
|
];
|
|
173998
173998
|
|
|
173999
|
+
// nodes/ClaudeCode/descriptions/agentsDescription.ts
|
|
174000
|
+
var agentsDescription = [
|
|
174001
|
+
{
|
|
174002
|
+
displayName: "Subagents",
|
|
174003
|
+
name: "agents",
|
|
174004
|
+
type: "fixedCollection",
|
|
174005
|
+
typeOptions: {
|
|
174006
|
+
multipleValues: true,
|
|
174007
|
+
multipleValueButtonText: "Add Subagent"
|
|
174008
|
+
},
|
|
174009
|
+
default: { agentsList: [] },
|
|
174010
|
+
displayOptions: {
|
|
174011
|
+
show: {
|
|
174012
|
+
operation: ["executePrompt", "executeWithContext"]
|
|
174013
|
+
}
|
|
174014
|
+
},
|
|
174015
|
+
options: [
|
|
174016
|
+
{
|
|
174017
|
+
name: "agentsList",
|
|
174018
|
+
displayName: "Agents",
|
|
174019
|
+
values: [
|
|
174020
|
+
{
|
|
174021
|
+
displayName: "Agent Name",
|
|
174022
|
+
name: "name",
|
|
174023
|
+
type: "string",
|
|
174024
|
+
default: "",
|
|
174025
|
+
required: true,
|
|
174026
|
+
placeholder: "code-reviewer",
|
|
174027
|
+
description: "Unique identifier for this agent. Lowercase letters, numbers, and hyphens only (3-50 chars)."
|
|
174028
|
+
},
|
|
174029
|
+
{
|
|
174030
|
+
displayName: "Description",
|
|
174031
|
+
name: "description",
|
|
174032
|
+
type: "string",
|
|
174033
|
+
typeOptions: { rows: 2 },
|
|
174034
|
+
default: "",
|
|
174035
|
+
required: true,
|
|
174036
|
+
placeholder: "Expert code reviewer. Use proactively when code changes are made.",
|
|
174037
|
+
description: "When Claude should delegate to this agent."
|
|
174038
|
+
},
|
|
174039
|
+
{
|
|
174040
|
+
displayName: "System Prompt",
|
|
174041
|
+
name: "prompt",
|
|
174042
|
+
type: "string",
|
|
174043
|
+
typeOptions: { rows: 5 },
|
|
174044
|
+
default: "",
|
|
174045
|
+
required: true,
|
|
174046
|
+
placeholder: "You are a senior code reviewer. Focus on...",
|
|
174047
|
+
description: "System prompt governing this agent's behavior."
|
|
174048
|
+
},
|
|
174049
|
+
{
|
|
174050
|
+
displayName: "Model",
|
|
174051
|
+
name: "model",
|
|
174052
|
+
type: "options",
|
|
174053
|
+
options: [
|
|
174054
|
+
{
|
|
174055
|
+
name: "Inherit (Parent Model)",
|
|
174056
|
+
value: "inherit"
|
|
174057
|
+
},
|
|
174058
|
+
{ name: "Sonnet", value: "sonnet" },
|
|
174059
|
+
{ name: "Opus", value: "opus" },
|
|
174060
|
+
{ name: "Haiku", value: "haiku" }
|
|
174061
|
+
],
|
|
174062
|
+
default: "inherit",
|
|
174063
|
+
description: "Model to use for this agent."
|
|
174064
|
+
},
|
|
174065
|
+
{
|
|
174066
|
+
displayName: "Allowed Tools",
|
|
174067
|
+
name: "tools",
|
|
174068
|
+
type: "string",
|
|
174069
|
+
default: "",
|
|
174070
|
+
placeholder: "Read, Grep, Glob, Bash(git:*)",
|
|
174071
|
+
description: "Tools this agent can use (comma-separated). Leave empty to inherit all tools."
|
|
174072
|
+
},
|
|
174073
|
+
{
|
|
174074
|
+
displayName: "Disallowed Tools",
|
|
174075
|
+
name: "disallowedTools",
|
|
174076
|
+
type: "string",
|
|
174077
|
+
default: "",
|
|
174078
|
+
placeholder: "Write, Edit, Bash(rm:*)",
|
|
174079
|
+
description: "Tools this agent cannot use (comma-separated). Takes precedence over allowed tools."
|
|
174080
|
+
},
|
|
174081
|
+
{
|
|
174082
|
+
displayName: "Permission Mode",
|
|
174083
|
+
name: "permissionMode",
|
|
174084
|
+
type: "options",
|
|
174085
|
+
options: [
|
|
174086
|
+
{ name: "Default", value: "" },
|
|
174087
|
+
{ name: "Accept Edits", value: "acceptEdits" },
|
|
174088
|
+
{ name: "Plan (Read-Only)", value: "plan" },
|
|
174089
|
+
{ name: "Don't Ask", value: "dontAsk" },
|
|
174090
|
+
{
|
|
174091
|
+
name: "Bypass Permissions",
|
|
174092
|
+
value: "bypassPermissions"
|
|
174093
|
+
},
|
|
174094
|
+
{ name: "Delegate", value: "delegate" }
|
|
174095
|
+
],
|
|
174096
|
+
default: "",
|
|
174097
|
+
description: "Permission mode for this agent. Leave empty to use default."
|
|
174098
|
+
},
|
|
174099
|
+
{
|
|
174100
|
+
displayName: "Max Turns",
|
|
174101
|
+
name: "maxTurns",
|
|
174102
|
+
type: "number",
|
|
174103
|
+
default: 0,
|
|
174104
|
+
description: "Maximum agentic turns before stopping. 0 = unlimited."
|
|
174105
|
+
},
|
|
174106
|
+
{
|
|
174107
|
+
displayName: "Memory",
|
|
174108
|
+
name: "memory",
|
|
174109
|
+
type: "options",
|
|
174110
|
+
options: [
|
|
174111
|
+
{ name: "None", value: "" },
|
|
174112
|
+
{
|
|
174113
|
+
name: "User (Cross-Project)",
|
|
174114
|
+
value: "user"
|
|
174115
|
+
},
|
|
174116
|
+
{
|
|
174117
|
+
name: "Project (Shareable)",
|
|
174118
|
+
value: "project"
|
|
174119
|
+
},
|
|
174120
|
+
{
|
|
174121
|
+
name: "Local (Not Committed)",
|
|
174122
|
+
value: "local"
|
|
174123
|
+
}
|
|
174124
|
+
],
|
|
174125
|
+
default: "",
|
|
174126
|
+
description: "Memory persistence mode for this agent."
|
|
174127
|
+
}
|
|
174128
|
+
]
|
|
174129
|
+
}
|
|
174130
|
+
],
|
|
174131
|
+
description: "Define custom subagents that Claude can delegate to during execution. Useful for specialized workflows (reviewer, debugger, architect...)."
|
|
174132
|
+
}
|
|
174133
|
+
];
|
|
174134
|
+
|
|
173999
174135
|
// nodes/ClaudeCode/descriptions/optionsDescription.ts
|
|
174000
174136
|
var optionsDescription = [
|
|
174001
174137
|
{
|
|
@@ -174050,6 +174186,74 @@ var optionsDescription = [
|
|
|
174050
174186
|
placeholder: "You are a helpful code reviewer...",
|
|
174051
174187
|
description: "Additional system prompt to append to Claude Code default system prompt"
|
|
174052
174188
|
},
|
|
174189
|
+
{
|
|
174190
|
+
displayName: "System Prompt File",
|
|
174191
|
+
name: "systemPromptFile",
|
|
174192
|
+
type: "string",
|
|
174193
|
+
default: "",
|
|
174194
|
+
placeholder: "/path/to/system-prompt.txt",
|
|
174195
|
+
description: "Path to a file containing additional system prompt text to append to Claude Code default system prompt. Use this instead of inline System Prompt for long or reusable prompts."
|
|
174196
|
+
},
|
|
174197
|
+
{
|
|
174198
|
+
displayName: "Verbose",
|
|
174199
|
+
name: "verbose",
|
|
174200
|
+
type: "boolean",
|
|
174201
|
+
default: false,
|
|
174202
|
+
description: "Enable verbose logging. Automatically enabled when Output Format is Stream JSON. Useful for debugging in JSON or Text output modes."
|
|
174203
|
+
},
|
|
174204
|
+
{
|
|
174205
|
+
displayName: "Max Budget (USD)",
|
|
174206
|
+
name: "maxBudgetUsd",
|
|
174207
|
+
type: "number",
|
|
174208
|
+
default: 0,
|
|
174209
|
+
description: "Maximum dollar amount to spend before stopping execution. 0 means unlimited. Critical for controlling costs in automated workflows."
|
|
174210
|
+
},
|
|
174211
|
+
{
|
|
174212
|
+
displayName: "JSON Schema",
|
|
174213
|
+
name: "jsonSchema",
|
|
174214
|
+
type: "string",
|
|
174215
|
+
typeOptions: {
|
|
174216
|
+
rows: 4
|
|
174217
|
+
},
|
|
174218
|
+
default: "",
|
|
174219
|
+
placeholder: '{"type":"object","properties":{"summary":{"type":"string"}}}',
|
|
174220
|
+
description: "JSON schema for validated structured output. Claude will return JSON matching this schema. Must be a valid JSON schema string."
|
|
174221
|
+
},
|
|
174222
|
+
{
|
|
174223
|
+
displayName: "Fallback Model",
|
|
174224
|
+
name: "fallbackModel",
|
|
174225
|
+
type: "string",
|
|
174226
|
+
default: "",
|
|
174227
|
+
placeholder: "claude-sonnet-4-20250514",
|
|
174228
|
+
description: "Fallback model to use when the primary model is overloaded or unavailable. Improves resilience in production workflows."
|
|
174229
|
+
},
|
|
174230
|
+
{
|
|
174231
|
+
displayName: "Extended Context (1M Tokens)",
|
|
174232
|
+
name: "extendedContext",
|
|
174233
|
+
type: "boolean",
|
|
174234
|
+
default: true,
|
|
174235
|
+
description: "Enable 1M token context window for analyzing very large codebases in a single pass. Only supported by Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, and Sonnet 4. Has no effect on other models."
|
|
174236
|
+
},
|
|
174237
|
+
{
|
|
174238
|
+
displayName: "Worktree Isolation",
|
|
174239
|
+
name: "worktreeEnabled",
|
|
174240
|
+
type: "boolean",
|
|
174241
|
+
default: false,
|
|
174242
|
+
description: "Run Claude Code in an isolated git worktree. Each execution works on a separate copy of the repository, preventing conflicts with the main workspace. The worktree is automatically cleaned up if no changes are made."
|
|
174243
|
+
},
|
|
174244
|
+
{
|
|
174245
|
+
displayName: "Worktree Name",
|
|
174246
|
+
name: "worktreeName",
|
|
174247
|
+
type: "string",
|
|
174248
|
+
default: "",
|
|
174249
|
+
placeholder: "feature-auth",
|
|
174250
|
+
description: "Optional name for the worktree. If empty, Claude Code auto-generates a unique name. The worktree is created at <repo>/.claude/worktrees/<name>/.",
|
|
174251
|
+
displayOptions: {
|
|
174252
|
+
show: {
|
|
174253
|
+
worktreeEnabled: [true]
|
|
174254
|
+
}
|
|
174255
|
+
}
|
|
174256
|
+
},
|
|
174053
174257
|
{
|
|
174054
174258
|
displayName: "Additional Arguments",
|
|
174055
174259
|
name: "additionalArgs",
|
|
@@ -174103,6 +174307,28 @@ function buildCommand(options, credentials) {
|
|
|
174103
174307
|
if (options.systemPrompt) {
|
|
174104
174308
|
args.push("--append-system-prompt", options.systemPrompt);
|
|
174105
174309
|
}
|
|
174310
|
+
if (options.systemPromptFile) {
|
|
174311
|
+
args.push("--append-system-prompt-file", options.systemPromptFile);
|
|
174312
|
+
}
|
|
174313
|
+
if (options.verbose && options.outputFormat !== "stream-json") {
|
|
174314
|
+
args.push("--verbose");
|
|
174315
|
+
}
|
|
174316
|
+
if (options.maxBudgetUsd && options.maxBudgetUsd > 0) {
|
|
174317
|
+
args.push("--max-budget-usd", String(options.maxBudgetUsd));
|
|
174318
|
+
}
|
|
174319
|
+
if (options.jsonSchema) {
|
|
174320
|
+
args.push("--json-schema", options.jsonSchema);
|
|
174321
|
+
}
|
|
174322
|
+
if (options.fallbackModel) {
|
|
174323
|
+
args.push("--fallback-model", options.fallbackModel);
|
|
174324
|
+
}
|
|
174325
|
+
if (options.worktree !== void 0) {
|
|
174326
|
+
if (options.worktree) {
|
|
174327
|
+
args.push("--worktree", options.worktree);
|
|
174328
|
+
} else {
|
|
174329
|
+
args.push("--worktree");
|
|
174330
|
+
}
|
|
174331
|
+
}
|
|
174106
174332
|
if (options.contextFiles && options.contextFiles.length > 0) {
|
|
174107
174333
|
const uniqueDirs = /* @__PURE__ */ new Set();
|
|
174108
174334
|
options.contextFiles.forEach((file) => {
|
|
@@ -174115,9 +174341,15 @@ function buildCommand(options, credentials) {
|
|
|
174115
174341
|
args.push("--add-dir", dir);
|
|
174116
174342
|
});
|
|
174117
174343
|
}
|
|
174344
|
+
if (options.agents && Object.keys(options.agents).length > 0) {
|
|
174345
|
+
args.push("--agents", JSON.stringify(options.agents));
|
|
174346
|
+
}
|
|
174118
174347
|
if (options.additionalArgs && options.additionalArgs.length > 0) {
|
|
174119
174348
|
args.push(...options.additionalArgs);
|
|
174120
174349
|
}
|
|
174350
|
+
if (options.extendedContext === false) {
|
|
174351
|
+
env.CLAUDE_CODE_DISABLE_1M_CONTEXT = "1";
|
|
174352
|
+
}
|
|
174121
174353
|
if ("envVars" in credentials && credentials.envVars) {
|
|
174122
174354
|
const envVarsString = credentials.envVars;
|
|
174123
174355
|
if (envVarsString && envVarsString !== "{}") {
|
|
@@ -174318,6 +174550,38 @@ function buildExecutionOptions(context, itemIndex, operation) {
|
|
|
174318
174550
|
"default"
|
|
174319
174551
|
);
|
|
174320
174552
|
const permissionMode = permissionModeRaw && permissionModeRaw !== "default" ? permissionModeRaw : void 0;
|
|
174553
|
+
const agentsData = context.getNodeParameter("agents", itemIndex, {
|
|
174554
|
+
agentsList: []
|
|
174555
|
+
});
|
|
174556
|
+
let agents;
|
|
174557
|
+
if (agentsData.agentsList && agentsData.agentsList.length > 0) {
|
|
174558
|
+
agents = {};
|
|
174559
|
+
for (const agent of agentsData.agentsList) {
|
|
174560
|
+
const def = {
|
|
174561
|
+
description: agent.description,
|
|
174562
|
+
prompt: agent.prompt
|
|
174563
|
+
};
|
|
174564
|
+
if (agent.tools) {
|
|
174565
|
+
def.tools = agent.tools.split(",").map((t) => t.trim()).filter(Boolean);
|
|
174566
|
+
}
|
|
174567
|
+
if (agent.disallowedTools) {
|
|
174568
|
+
def.disallowedTools = agent.disallowedTools.split(",").map((t) => t.trim()).filter(Boolean);
|
|
174569
|
+
}
|
|
174570
|
+
if (agent.model && agent.model !== "inherit") {
|
|
174571
|
+
def.model = agent.model;
|
|
174572
|
+
}
|
|
174573
|
+
if (agent.permissionMode) {
|
|
174574
|
+
def.permissionMode = agent.permissionMode;
|
|
174575
|
+
}
|
|
174576
|
+
if (agent.maxTurns && agent.maxTurns > 0) {
|
|
174577
|
+
def.maxTurns = agent.maxTurns;
|
|
174578
|
+
}
|
|
174579
|
+
if (agent.memory) {
|
|
174580
|
+
def.memory = agent.memory;
|
|
174581
|
+
}
|
|
174582
|
+
agents[agent.name] = def;
|
|
174583
|
+
}
|
|
174584
|
+
}
|
|
174321
174585
|
return {
|
|
174322
174586
|
prompt,
|
|
174323
174587
|
workingDirectory: options.workingDirectory,
|
|
@@ -174330,7 +174594,15 @@ function buildExecutionOptions(context, itemIndex, operation) {
|
|
|
174330
174594
|
contextFiles,
|
|
174331
174595
|
additionalArgs: additionalArgs.length > 0 ? additionalArgs : void 0,
|
|
174332
174596
|
timeout: options.timeout || 300,
|
|
174333
|
-
systemPrompt: options.systemPrompt || void 0
|
|
174597
|
+
systemPrompt: options.systemPrompt || void 0,
|
|
174598
|
+
systemPromptFile: options.systemPromptFile || void 0,
|
|
174599
|
+
verbose: options.verbose || void 0,
|
|
174600
|
+
maxBudgetUsd: options.maxBudgetUsd || void 0,
|
|
174601
|
+
jsonSchema: options.jsonSchema || void 0,
|
|
174602
|
+
fallbackModel: options.fallbackModel || void 0,
|
|
174603
|
+
agents,
|
|
174604
|
+
extendedContext: options.extendedContext !== false,
|
|
174605
|
+
worktree: options.worktreeEnabled ? options.worktreeName || "" : void 0
|
|
174334
174606
|
};
|
|
174335
174607
|
}
|
|
174336
174608
|
|
|
@@ -174942,6 +175214,12 @@ function buildEphemeralPodSpec(credentials, options, podName) {
|
|
|
174942
175214
|
const claudeArgs = buildClaudeArgs(options);
|
|
174943
175215
|
const envVars = buildEnvVars(credentials);
|
|
174944
175216
|
const limits = buildResourceLimits(credentials);
|
|
175217
|
+
if (options.extendedContext === false) {
|
|
175218
|
+
envVars.push({
|
|
175219
|
+
name: "CLAUDE_CODE_DISABLE_1M_CONTEXT",
|
|
175220
|
+
value: "1"
|
|
175221
|
+
});
|
|
175222
|
+
}
|
|
174945
175223
|
const credentialPrefix = buildCredentialInjectionPrefix(credentials);
|
|
174946
175224
|
const container = credentialPrefix ? {
|
|
174947
175225
|
name: "claude-code",
|
|
@@ -175074,6 +175352,9 @@ function buildClaudeArgs(options) {
|
|
|
175074
175352
|
args.push("--add-dir", dir);
|
|
175075
175353
|
});
|
|
175076
175354
|
}
|
|
175355
|
+
if (options.agents && Object.keys(options.agents).length > 0) {
|
|
175356
|
+
args.push("--agents", JSON.stringify(options.agents));
|
|
175357
|
+
}
|
|
175077
175358
|
if (options.additionalArgs && options.additionalArgs.length > 0) {
|
|
175078
175359
|
args.push(...options.additionalArgs);
|
|
175079
175360
|
}
|
|
@@ -175370,10 +175651,11 @@ var K8sPersistentExecutor = class {
|
|
|
175370
175651
|
const claudePath = this.credentials.claudePath || "claude";
|
|
175371
175652
|
const claudeArgs = buildClaudeArgs(options);
|
|
175372
175653
|
const workDir = options.workingDirectory || this.credentials.defaultWorkingDir || "/workspace";
|
|
175654
|
+
const envPrefix = options.extendedContext === false ? "export CLAUDE_CODE_DISABLE_1M_CONTEXT=1 && " : "";
|
|
175373
175655
|
const command = [
|
|
175374
175656
|
"sh",
|
|
175375
175657
|
"-c",
|
|
175376
|
-
|
|
175658
|
+
`${envPrefix}cd ${workDir} && ${claudePath} ${claudeArgs.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ")}`
|
|
175377
175659
|
];
|
|
175378
175660
|
return this.execInPod(clients, namespace, command).then(
|
|
175379
175661
|
({ stdout, stderr, exitCode }) => {
|
|
@@ -175518,6 +175800,8 @@ var ClaudeCode = class {
|
|
|
175518
175800
|
...toolPermissionsDescription,
|
|
175519
175801
|
// Model selection
|
|
175520
175802
|
...modelDescription,
|
|
175803
|
+
// Custom subagents
|
|
175804
|
+
...agentsDescription,
|
|
175521
175805
|
// Additional options
|
|
175522
175806
|
...optionsDescription
|
|
175523
175807
|
]
|