@opencow-ai/opencow-agent-sdk 0.4.26 → 0.4.27
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/capabilities/mcp/types.d.ts +3 -0
- package/dist/capabilities/plugins/pluginOptionsStorage.d.ts +6 -0
- package/dist/capabilities/plugins/schemas.d.ts +6 -0
- package/dist/capabilities/plugins/sdkPluginRuntime.d.ts +2 -0
- package/dist/cli.mjs +138 -232
- package/dist/client.js +163 -247
- package/dist/constants/oauth.d.ts +0 -8
- package/dist/controller/dispatch/toolHooks.d.ts +4 -3
- package/dist/entrypoints/sdk/controlSchemas.d.ts +20 -0
- package/dist/entrypoints/sdk/coreSchemas.d.ts +6 -0
- package/dist/entrypoints/sdk/runtimeTypes.d.ts +8 -0
- package/dist/sdk.js +163 -247
- package/dist/session/branding.d.ts +4 -0
- package/dist/session/brandingConfig.d.ts +16 -0
- package/dist/session/state/index.d.ts +1 -1
- package/dist/session/state/registries.d.ts +8 -1
- package/dist/session/state/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/capabilities/tools/AgentTool/built-in/claudeCodeGuideAgent.d.ts +0 -3
package/dist/cli.mjs
CHANGED
|
@@ -711,21 +711,49 @@ var init_errors = __esm(() => {
|
|
|
711
711
|
});
|
|
712
712
|
|
|
713
713
|
// src/session/brandingConfig.ts
|
|
714
|
+
function toProductSlug(value) {
|
|
715
|
+
const slug = value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
716
|
+
return slug || PRODUCT_SLUG_FALLBACK;
|
|
717
|
+
}
|
|
714
718
|
function normalizeBrandName(value, fallback) {
|
|
715
719
|
const normalized = value?.replace(/[\u0000-\u001f\u007f]+/g, " ").replace(/\s+/g, " ").trim();
|
|
716
720
|
return normalized ? normalized.slice(0, 80) : fallback;
|
|
717
721
|
}
|
|
722
|
+
function optionalUrl(key, value) {
|
|
723
|
+
const trimmed = value?.trim();
|
|
724
|
+
return trimmed ? { [key]: trimmed } : {};
|
|
725
|
+
}
|
|
726
|
+
function validatedProductUrl(value) {
|
|
727
|
+
const trimmed = value?.trim();
|
|
728
|
+
if (!trimmed)
|
|
729
|
+
return {};
|
|
730
|
+
let protocol;
|
|
731
|
+
try {
|
|
732
|
+
protocol = new URL(trimmed).protocol;
|
|
733
|
+
} catch {
|
|
734
|
+
throw new TypeError(`branding.productUrl is not a valid URL: ${trimmed}`);
|
|
735
|
+
}
|
|
736
|
+
if (protocol !== "https:" && protocol !== "http:" || /[^\x21-\x7e]/.test(trimmed)) {
|
|
737
|
+
throw new TypeError(`branding.productUrl must be an ASCII http(s) URL: ${trimmed}`);
|
|
738
|
+
}
|
|
739
|
+
return { productUrl: trimmed };
|
|
740
|
+
}
|
|
718
741
|
function resolveBranding(options) {
|
|
719
742
|
const productName = normalizeBrandName(options?.productName, DEFAULT_BRANDING.productName);
|
|
743
|
+
const explicitSlug = options?.productSlug?.trim();
|
|
720
744
|
return Object.freeze({
|
|
721
745
|
productName,
|
|
722
|
-
|
|
746
|
+
productSlug: toProductSlug(explicitSlug || productName),
|
|
747
|
+
assistantName: normalizeBrandName(options?.assistantName, productName),
|
|
748
|
+
...optionalUrl("mcpOAuthClientMetadataUrl", options?.mcpOAuthClientMetadataUrl),
|
|
749
|
+
...validatedProductUrl(options?.productUrl)
|
|
723
750
|
});
|
|
724
751
|
}
|
|
725
|
-
var DEFAULT_BRANDING;
|
|
752
|
+
var DEFAULT_BRANDING, PRODUCT_SLUG_FALLBACK = "app";
|
|
726
753
|
var init_brandingConfig = __esm(() => {
|
|
727
754
|
DEFAULT_BRANDING = Object.freeze({
|
|
728
755
|
productName: "Agentic",
|
|
756
|
+
productSlug: "agentic",
|
|
729
757
|
assistantName: "Agentic"
|
|
730
758
|
});
|
|
731
759
|
});
|
|
@@ -742,12 +770,17 @@ function getAssistantIdentityPrompt() {
|
|
|
742
770
|
return `You are ${getBranding().assistantName}, an agentic coding assistant.`;
|
|
743
771
|
}
|
|
744
772
|
function getMcpClientInfo() {
|
|
745
|
-
const { productName } = getBranding();
|
|
773
|
+
const { productName, productSlug, productUrl } = getBranding();
|
|
746
774
|
return {
|
|
775
|
+
name: productSlug,
|
|
747
776
|
title: `${productName} Coding Client`,
|
|
748
|
-
description: `${productName} agentic coding client
|
|
777
|
+
description: `${productName} agentic coding client`,
|
|
778
|
+
...productUrl ? { websiteUrl: productUrl } : {}
|
|
749
779
|
};
|
|
750
780
|
}
|
|
781
|
+
function getProductUserAgentToken() {
|
|
782
|
+
return getBranding().productSlug;
|
|
783
|
+
}
|
|
751
784
|
var brandingStorage;
|
|
752
785
|
var init_branding = __esm(() => {
|
|
753
786
|
init_brandingConfig();
|
|
@@ -6887,7 +6920,7 @@ function getOauthConfig() {
|
|
|
6887
6920
|
}
|
|
6888
6921
|
return config;
|
|
6889
6922
|
}
|
|
6890
|
-
var CLAUDE_AI_INFERENCE_SCOPE = "user:inference", CLAUDE_AI_PROFILE_SCOPE = "user:profile", CONSOLE_SCOPE = "org:create_api_key", OAUTH_BETA_HEADER = "oauth-2025-04-20", CONSOLE_OAUTH_SCOPES, CLAUDE_AI_OAUTH_SCOPES, ALL_OAUTH_SCOPES, PROD_OAUTH_CONFIG,
|
|
6923
|
+
var CLAUDE_AI_INFERENCE_SCOPE = "user:inference", CLAUDE_AI_PROFILE_SCOPE = "user:profile", CONSOLE_SCOPE = "org:create_api_key", OAUTH_BETA_HEADER = "oauth-2025-04-20", CONSOLE_OAUTH_SCOPES, CLAUDE_AI_OAUTH_SCOPES, ALL_OAUTH_SCOPES, PROD_OAUTH_CONFIG, STAGING_OAUTH_CONFIG, ALLOWED_OAUTH_BASE_URLS;
|
|
6891
6924
|
var init_oauth = __esm(() => {
|
|
6892
6925
|
init_envUtils();
|
|
6893
6926
|
init_envVars();
|
|
@@ -22902,7 +22935,7 @@ var GIT_ROOT_NOT_FOUND, findGitRootImpl, findGitRoot, resolveCanonicalRoot, find
|
|
|
22902
22935
|
return getWorktreeCountFromFs();
|
|
22903
22936
|
}, stashToCleanState = async (message) => {
|
|
22904
22937
|
try {
|
|
22905
|
-
const stashMessage = message ||
|
|
22938
|
+
const stashMessage = message || `${getBranding().productName} auto-stash - ${new Date().toISOString()}`;
|
|
22906
22939
|
const { untracked } = await getFileStatus();
|
|
22907
22940
|
if (untracked.length > 0) {
|
|
22908
22941
|
const { code: addCode } = await execFileNoThrow(gitExe(), ["add", ...untracked], { preserveOutputOnError: false });
|
|
@@ -22929,6 +22962,7 @@ var init_git = __esm(() => {
|
|
|
22929
22962
|
init_log3();
|
|
22930
22963
|
init_memoize2();
|
|
22931
22964
|
init_which();
|
|
22965
|
+
init_branding();
|
|
22932
22966
|
GIT_ROOT_NOT_FOUND = Symbol("git-root-not-found");
|
|
22933
22967
|
findGitRootImpl = memoizeWithLRU((startPath) => {
|
|
22934
22968
|
const startTime = Date.now();
|
|
@@ -25744,7 +25778,8 @@ var init_types2 = __esm(() => {
|
|
|
25744
25778
|
type: literal("stdio").optional(),
|
|
25745
25779
|
command: string2().min(1, "Command cannot be empty"),
|
|
25746
25780
|
args: array(string2()).default([]),
|
|
25747
|
-
env: record(string2(), string2()).optional()
|
|
25781
|
+
env: record(string2(), string2()).optional(),
|
|
25782
|
+
cwd: string2().optional()
|
|
25748
25783
|
}));
|
|
25749
25784
|
McpXaaConfigSchema = lazySchema(() => boolean2());
|
|
25750
25785
|
McpOAuthConfigSchema = lazySchema(() => object({
|
|
@@ -26740,7 +26775,7 @@ var init_types3 = __esm(() => {
|
|
|
26740
26775
|
allow: array(PermissionRuleSchema()).optional().describe("List of permission rules for allowed operations"),
|
|
26741
26776
|
deny: array(PermissionRuleSchema()).optional().describe("List of permission rules for denied operations"),
|
|
26742
26777
|
ask: array(PermissionRuleSchema()).optional().describe("List of permission rules that should always prompt for confirmation"),
|
|
26743
|
-
defaultMode: _enum(EXTERNAL_PERMISSION_MODES).optional().describe("Default permission mode when
|
|
26778
|
+
defaultMode: _enum(EXTERNAL_PERMISSION_MODES).optional().describe("Default permission mode when the agent needs access"),
|
|
26744
26779
|
disableBypassPermissionsMode: _enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),
|
|
26745
26780
|
...{},
|
|
26746
26781
|
additionalDirectories: array(string2()).optional().describe("Additional directories to include in the permission scope")
|
|
@@ -26785,7 +26820,7 @@ var init_types3 = __esm(() => {
|
|
|
26785
26820
|
"mcp"
|
|
26786
26821
|
];
|
|
26787
26822
|
SettingsSchema = lazySchema(() => object({
|
|
26788
|
-
$schema: literal(CLAUDE_CODE_SETTINGS_SCHEMA_URL).optional().describe("JSON Schema reference for
|
|
26823
|
+
$schema: literal(CLAUDE_CODE_SETTINGS_SCHEMA_URL).optional().describe("JSON Schema reference for settings"),
|
|
26789
26824
|
apiKeyHelper: string2().optional().describe("Path to a script that outputs authentication values"),
|
|
26790
26825
|
awsCredentialExport: string2().optional().describe("Path to a script that exports AWS credentials"),
|
|
26791
26826
|
awsAuthRefresh: string2().optional().describe("Path to a script that refreshes AWS authentication"),
|
|
@@ -26793,7 +26828,7 @@ var init_types3 = __esm(() => {
|
|
|
26793
26828
|
...isEnvTruthy(resolveEnvVar("ENABLE_XAA")) ? {
|
|
26794
26829
|
xaaIdp: object({
|
|
26795
26830
|
issuer: string2().url().describe("IdP issuer URL for OIDC discovery"),
|
|
26796
|
-
clientId: string2().describe("
|
|
26831
|
+
clientId: string2().describe("The client_id registered at the IdP"),
|
|
26797
26832
|
callbackPort: number2().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. " + "Only needed if the IdP does not honor RFC 8252 port-any matching.")
|
|
26798
26833
|
}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")
|
|
26799
26834
|
} : {},
|
|
@@ -26803,10 +26838,10 @@ var init_types3 = __esm(() => {
|
|
|
26803
26838
|
}).optional().describe("Custom file suggestion configuration for @ mentions"),
|
|
26804
26839
|
respectGitignore: boolean2().optional().describe("Whether file picker should respect .gitignore files (default: true). " + "Note: .ignore files are always respected."),
|
|
26805
26840
|
cleanupPeriodDays: number2().nonnegative().int().optional().describe("Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup."),
|
|
26806
|
-
env: EnvironmentVariablesSchema().optional().describe("Environment variables to set for
|
|
26841
|
+
env: EnvironmentVariablesSchema().optional().describe("Environment variables to set for agent sessions"),
|
|
26807
26842
|
includeGitInstructions: boolean2().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),
|
|
26808
26843
|
permissions: PermissionsSchema().optional().describe("Tool usage permissions configuration"),
|
|
26809
|
-
model: string2().optional().describe("Override the default model used by
|
|
26844
|
+
model: string2().optional().describe("Override the default model used by the agent"),
|
|
26810
26845
|
availableModels: array(string2()).optional().describe("Allowlist of models that users can select. " + 'Accepts family aliases ("opus" allows any opus version), ' + 'version prefixes ("opus-4-5" allows only that version), ' + "and full model IDs. " + "If undefined, all models are available. If empty array, only the default model is available. " + "Typically set in managed settings by enterprise administrators."),
|
|
26811
26846
|
modelOverrides: record(string2(), string2()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific ' + "model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by " + "enterprise administrators."),
|
|
26812
26847
|
enableAllProjectMcpServers: boolean2().optional().describe("Whether to automatically approve all MCP servers in the project"),
|
|
@@ -49640,11 +49675,6 @@ function parseAnthropicStreamChunk(chunk) {
|
|
|
49640
49675
|
return [chunk];
|
|
49641
49676
|
}
|
|
49642
49677
|
|
|
49643
|
-
// src/providers/shared/userAgent.ts
|
|
49644
|
-
function getClaudeCodeUserAgent() {
|
|
49645
|
-
return `claude-code/${"99.0.0"}`;
|
|
49646
|
-
}
|
|
49647
|
-
|
|
49648
49678
|
// src/session/workloadContext.ts
|
|
49649
49679
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
49650
49680
|
function getWorkload() {
|
|
@@ -49679,11 +49709,12 @@ function getMCPUserAgent() {
|
|
|
49679
49709
|
parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
|
|
49680
49710
|
}
|
|
49681
49711
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
49682
|
-
return
|
|
49712
|
+
return `${getProductUserAgentToken()}/${"99.0.0"}${suffix}`;
|
|
49683
49713
|
}
|
|
49684
49714
|
function getWebFetchUserAgent() {
|
|
49685
|
-
const
|
|
49686
|
-
|
|
49715
|
+
const { productSlug, productUrl } = getBranding();
|
|
49716
|
+
const contact = productUrl ? `; +${productUrl}` : "";
|
|
49717
|
+
return `${productSlug}-User (${productSlug}/${"99.0.0"}${contact})`;
|
|
49687
49718
|
}
|
|
49688
49719
|
function getAuthHeaders() {
|
|
49689
49720
|
if (isClaudeAISubscriber()) {
|
|
@@ -49737,6 +49768,7 @@ var init_http2 = __esm(() => {
|
|
|
49737
49768
|
init_auth();
|
|
49738
49769
|
init_state();
|
|
49739
49770
|
init_workloadContext();
|
|
49771
|
+
init_branding();
|
|
49740
49772
|
});
|
|
49741
49773
|
|
|
49742
49774
|
// src/providers/shared/model/providers.ts
|
|
@@ -81127,6 +81159,7 @@ function buildQueryContextFromSdk(options) {
|
|
|
81127
81159
|
loaded: createSignal()
|
|
81128
81160
|
},
|
|
81129
81161
|
pluginDataPaths: new Map,
|
|
81162
|
+
pluginContentVariables: {},
|
|
81130
81163
|
lspManager: null
|
|
81131
81164
|
},
|
|
81132
81165
|
diagnostics: createFreshDiagnostics(),
|
|
@@ -81763,11 +81796,22 @@ function resetSdkInitState() {
|
|
|
81763
81796
|
r.initJsonSchema = null;
|
|
81764
81797
|
r.registeredHooks = null;
|
|
81765
81798
|
}
|
|
81766
|
-
function setExplicitPluginRuntimeContext(dataPaths, lspManager) {
|
|
81799
|
+
function setExplicitPluginRuntimeContext(dataPaths, lspManager, contentVariables) {
|
|
81767
81800
|
const registries = getQueryContext().registries;
|
|
81768
81801
|
registries.pluginDataPaths = new Map(dataPaths);
|
|
81802
|
+
registries.pluginContentVariables = { ...contentVariables };
|
|
81769
81803
|
registries.lspManager = lspManager;
|
|
81770
81804
|
}
|
|
81805
|
+
function setExplicitPluginRuntimeBundle(bundle) {
|
|
81806
|
+
setExplicitPluginRuntimeContext(bundle.dataPaths, bundle.lspManager, bundle.contentVariables ?? {});
|
|
81807
|
+
}
|
|
81808
|
+
function tryGetPluginContentVariables() {
|
|
81809
|
+
try {
|
|
81810
|
+
return getQueryContext().registries.pluginContentVariables;
|
|
81811
|
+
} catch {
|
|
81812
|
+
return {};
|
|
81813
|
+
}
|
|
81814
|
+
}
|
|
81771
81815
|
function tryGetExplicitPluginDataPath(pluginId) {
|
|
81772
81816
|
try {
|
|
81773
81817
|
return getQueryContext().registries.pluginDataPaths.get(pluginId);
|
|
@@ -82233,6 +82277,7 @@ __export(exports_state, {
|
|
|
82233
82277
|
setCwdState: () => setCwdState,
|
|
82234
82278
|
setDirectConnectServerUrl: () => setDirectConnectServerUrl,
|
|
82235
82279
|
setEnvVar: () => setEnvVar,
|
|
82280
|
+
setExplicitPluginRuntimeBundle: () => setExplicitPluginRuntimeBundle,
|
|
82236
82281
|
setExplicitPluginRuntimeContext: () => setExplicitPluginRuntimeContext,
|
|
82237
82282
|
setFastModeHeaderLatched: () => setFastModeHeaderLatched,
|
|
82238
82283
|
setFlagSettingsInline: () => setFlagSettingsInline,
|
|
@@ -82269,6 +82314,7 @@ __export(exports_state, {
|
|
|
82269
82314
|
snapshotOutputTokensForTurn: () => snapshotOutputTokensForTurn,
|
|
82270
82315
|
switchSession: () => switchSession,
|
|
82271
82316
|
tryGetExplicitPluginDataPath: () => tryGetExplicitPluginDataPath,
|
|
82317
|
+
tryGetPluginContentVariables: () => tryGetPluginContentVariables,
|
|
82272
82318
|
tryGetQueryContext: () => tryGetQueryContext,
|
|
82273
82319
|
tryGetSessionLspManager: () => tryGetSessionLspManager,
|
|
82274
82320
|
unregisterCreatedTeam: () => unregisterCreatedTeam
|
|
@@ -82384,7 +82430,7 @@ function setMeter(meter, createCounter) {
|
|
|
82384
82430
|
description: "Number of git commits created"
|
|
82385
82431
|
});
|
|
82386
82432
|
STATE.costCounter = createCounter("claude_code.cost.usage", {
|
|
82387
|
-
description: "Cost of the
|
|
82433
|
+
description: "Cost of the agent session",
|
|
82388
82434
|
unit: "USD"
|
|
82389
82435
|
});
|
|
82390
82436
|
STATE.tokenCounter = createCounter("claude_code.token.usage", {
|
|
@@ -84260,6 +84306,7 @@ function createBootQueryContext() {
|
|
|
84260
84306
|
loaded: createSignal()
|
|
84261
84307
|
},
|
|
84262
84308
|
pluginDataPaths: new Map,
|
|
84309
|
+
pluginContentVariables: {},
|
|
84263
84310
|
lspManager: null
|
|
84264
84311
|
},
|
|
84265
84312
|
diagnostics: createFreshDiagnostics(),
|
|
@@ -84351,6 +84398,7 @@ function deriveSubagentRegistries(parent) {
|
|
|
84351
84398
|
skillListingSuppressNext: false,
|
|
84352
84399
|
dynamicSkills: parent.dynamicSkills,
|
|
84353
84400
|
pluginDataPaths: parent.pluginDataPaths,
|
|
84401
|
+
pluginContentVariables: parent.pluginContentVariables,
|
|
84354
84402
|
lspManager: parent.lspManager
|
|
84355
84403
|
};
|
|
84356
84404
|
}
|
|
@@ -86678,7 +86726,7 @@ function printStartupScreen() {
|
|
|
86678
86726
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
86679
86727
|
out.push(boxRow(sRow, W, sLen));
|
|
86680
86728
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W - 2)}╝${RESET}`);
|
|
86681
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.
|
|
86729
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.27"}${RESET}`);
|
|
86682
86730
|
out.push("");
|
|
86683
86731
|
process.stdout.write(out.join(`
|
|
86684
86732
|
`) + `
|
|
@@ -87720,7 +87768,7 @@ function getRemoteSessionUrl(sessionId, ingressUrl) {
|
|
|
87720
87768
|
const baseUrl = getClaudeAiBaseUrl(compatId, ingressUrl);
|
|
87721
87769
|
return `${baseUrl}/code/${compatId}`;
|
|
87722
87770
|
}
|
|
87723
|
-
var
|
|
87771
|
+
var TELEMETRY_SERVICE_NAME = "claude-code", CLAUDE_AI_BASE_URL = "https://claude.ai", CLAUDE_AI_STAGING_BASE_URL = "https://claude-ai.staging.ant.dev", CLAUDE_AI_LOCAL_BASE_URL = "http://localhost:4000";
|
|
87724
87772
|
|
|
87725
87773
|
// src/constants/system.ts
|
|
87726
87774
|
function isCLISyspromptPrefix(value) {
|
|
@@ -106162,6 +106210,7 @@ var init_TaskOutput = __esm(() => {
|
|
|
106162
106210
|
init_stringUtils();
|
|
106163
106211
|
init_diskOutput();
|
|
106164
106212
|
init_fsOperations();
|
|
106213
|
+
init_branding();
|
|
106165
106214
|
DEFAULT_MAX_MEMORY = 8 * 1024 * 1024;
|
|
106166
106215
|
TaskOutput = class TaskOutput {
|
|
106167
106216
|
taskId;
|
|
@@ -106349,7 +106398,7 @@ Output truncated (${sizeKB}KB total). Full output saved to: ${this.path}`;
|
|
|
106349
106398
|
} catch (err) {
|
|
106350
106399
|
const code = err instanceof Error && "code" in err ? String(err.code) : "unknown";
|
|
106351
106400
|
logForDebugging2(`TaskOutput.#readStdoutFromFile: failed to read ${this.path} (${code}): ${err}`);
|
|
106352
|
-
return `<bash output unavailable: output file ${this.path} could not be read (${code}). This usually means another
|
|
106401
|
+
return `<bash output unavailable: output file ${this.path} could not be read (${code}). This usually means another ${getBranding().productName} process in the same project deleted it during startup cleanup.>`;
|
|
106353
106402
|
}
|
|
106354
106403
|
}
|
|
106355
106404
|
getStderr() {
|
|
@@ -110129,7 +110178,7 @@ var LITERAL_BACKSLASH = "\\", SNAPSHOT_CREATION_TIMEOUT = 1e4, VCS_DIRECTORIES_T
|
|
|
110129
110178
|
logForDebugging2(`Looking for shell config file: ${configFile}`);
|
|
110130
110179
|
const configFileExists = await pathExists(configFile);
|
|
110131
110180
|
if (!configFileExists) {
|
|
110132
|
-
logForDebugging2(`Shell config file not found: ${configFile}, creating snapshot with
|
|
110181
|
+
logForDebugging2(`Shell config file not found: ${configFile}, creating snapshot with ${getBranding().productName} defaults only`);
|
|
110133
110182
|
}
|
|
110134
110183
|
const timestamp = Date.now();
|
|
110135
110184
|
const randomId = Math.random().toString(36).substring(2, 8);
|
|
@@ -110242,6 +110291,7 @@ var init_ShellSnapshot = __esm(() => {
|
|
|
110242
110291
|
init_subprocessEnv();
|
|
110243
110292
|
init_shellQuote();
|
|
110244
110293
|
init_state();
|
|
110294
|
+
init_branding();
|
|
110245
110295
|
VCS_DIRECTORIES_TO_EXCLUDE = [
|
|
110246
110296
|
".git",
|
|
110247
110297
|
".svn",
|
|
@@ -135256,6 +135306,11 @@ function substitutePluginVariables(value, plugin) {
|
|
|
135256
135306
|
}
|
|
135257
135307
|
return out;
|
|
135258
135308
|
}
|
|
135309
|
+
function substitutePluginContentVariables(value, variables = tryGetPluginContentVariables()) {
|
|
135310
|
+
if (Object.keys(variables).length === 0)
|
|
135311
|
+
return value;
|
|
135312
|
+
return value.replace(/\$\{([A-Z][A-Z0-9_]*)\}/g, (match, name) => Object.hasOwn(variables, name) ? variables[name] : match);
|
|
135313
|
+
}
|
|
135259
135314
|
function substituteUserConfigVariables(value, userConfig) {
|
|
135260
135315
|
return value.replace(/\$\{user_config\.([^}]+)\}/g, (_match, key) => {
|
|
135261
135316
|
const configValue = userConfig[key];
|
|
@@ -135299,7 +135354,7 @@ var init_pluginOptionsStorage = __esm(() => {
|
|
|
135299
135354
|
});
|
|
135300
135355
|
|
|
135301
135356
|
// src/capabilities/plugins/mcpPluginIntegration.ts
|
|
135302
|
-
import { join as join47 } from "path";
|
|
135357
|
+
import { join as join47, resolve as resolvePath } from "path";
|
|
135303
135358
|
async function loadMcpServersFromMcpb(plugin, mcpbPath, errors) {
|
|
135304
135359
|
try {
|
|
135305
135360
|
logForDebugging2(`Loading MCP servers from MCPB: ${mcpbPath}`);
|
|
@@ -135532,6 +135587,9 @@ function resolvePluginMcpEnvironment(config, plugin, userConfig, errors, pluginN
|
|
|
135532
135587
|
if (stdioConfig.args) {
|
|
135533
135588
|
stdioConfig.args = stdioConfig.args.map((arg) => resolveValue(arg));
|
|
135534
135589
|
}
|
|
135590
|
+
if (stdioConfig.cwd) {
|
|
135591
|
+
stdioConfig.cwd = resolvePath(plugin.path, resolveValue(stdioConfig.cwd));
|
|
135592
|
+
}
|
|
135535
135593
|
const resolvedEnv = {
|
|
135536
135594
|
CLAUDE_PLUGIN_ROOT: plugin.path,
|
|
135537
135595
|
CLAUDE_PLUGIN_DATA: plugin.dataPath ?? getPluginDataDir(plugin.source),
|
|
@@ -136256,160 +136314,6 @@ var init_agentMemorySnapshot = __esm(() => {
|
|
|
136256
136314
|
}));
|
|
136257
136315
|
});
|
|
136258
136316
|
|
|
136259
|
-
// src/capabilities/tools/AgentTool/built-in/claudeCodeGuideAgent.ts
|
|
136260
|
-
function getClaudeCodeGuideBasePrompt() {
|
|
136261
|
-
const localSearchHint = hasEmbeddedSearchTools() ? `${FILE_READ_TOOL_NAME}, \`find\`, and \`grep\`` : `${FILE_READ_TOOL_NAME}, ${GLOB_TOOL_NAME}, and ${GREP_TOOL_NAME}`;
|
|
136262
|
-
return `You are the Claude guide agent. Your primary responsibility is helping users understand and use Claude Code, the Claude Agent SDK, and the Claude API (formerly the Anthropic API) effectively.
|
|
136263
|
-
|
|
136264
|
-
**Your expertise spans three domains:**
|
|
136265
|
-
|
|
136266
|
-
1. **Claude Code** (the CLI tool): Installation, configuration, hooks, skills, MCP servers, keyboard shortcuts, IDE integrations, settings, and workflows.
|
|
136267
|
-
|
|
136268
|
-
2. **Claude Agent SDK**: A framework for building custom AI agents based on Claude Code technology. Available for Node.js/TypeScript and Python.
|
|
136269
|
-
|
|
136270
|
-
3. **Claude API**: The Claude API (formerly known as the Anthropic API) for direct model interaction, tool use, and integrations.
|
|
136271
|
-
|
|
136272
|
-
**Documentation sources:**
|
|
136273
|
-
|
|
136274
|
-
- **Claude Code docs** (${CLAUDE_CODE_DOCS_MAP_URL}): Fetch this for questions about the Claude Code CLI tool, including:
|
|
136275
|
-
- Installation, setup, and getting started
|
|
136276
|
-
- Hooks (pre/post command execution)
|
|
136277
|
-
- Custom skills
|
|
136278
|
-
- MCP server configuration
|
|
136279
|
-
- IDE integrations (VS Code, JetBrains)
|
|
136280
|
-
- Settings files and configuration
|
|
136281
|
-
- Keyboard shortcuts and hotkeys
|
|
136282
|
-
- Subagents and plugins
|
|
136283
|
-
- Sandboxing and security
|
|
136284
|
-
|
|
136285
|
-
- **Claude Agent SDK docs** (${CDP_DOCS_MAP_URL}): Fetch this for questions about building agents with the SDK, including:
|
|
136286
|
-
- SDK overview and getting started (Python and TypeScript)
|
|
136287
|
-
- Agent configuration + custom tools
|
|
136288
|
-
- Session management and permissions
|
|
136289
|
-
- MCP integration in agents
|
|
136290
|
-
- Hosting and deployment
|
|
136291
|
-
- Cost tracking and context management
|
|
136292
|
-
Note: Agent SDK docs are part of the Claude API documentation at the same URL.
|
|
136293
|
-
|
|
136294
|
-
- **Claude API docs** (${CDP_DOCS_MAP_URL}): Fetch this for questions about the Claude API (formerly the Anthropic API), including:
|
|
136295
|
-
- Messages API and streaming
|
|
136296
|
-
- Tool use (function calling) and Anthropic-defined tools (computer use, code execution, web search, text editor, bash, programmatic tool calling, tool search tool, context editing, Files API, structured outputs)
|
|
136297
|
-
- Vision, PDF support, and citations
|
|
136298
|
-
- Extended thinking and structured outputs
|
|
136299
|
-
- MCP connector for remote MCP servers
|
|
136300
|
-
- Cloud provider integrations (Bedrock, Vertex AI, Foundry)
|
|
136301
|
-
|
|
136302
|
-
**Approach:**
|
|
136303
|
-
1. Determine which domain the user's question falls into
|
|
136304
|
-
2. Use ${WEB_FETCH_TOOL_NAME} to fetch the appropriate docs map
|
|
136305
|
-
3. Identify the most relevant documentation URLs from the map
|
|
136306
|
-
4. Fetch the specific documentation pages
|
|
136307
|
-
5. Provide clear, actionable guidance based on official documentation
|
|
136308
|
-
6. Use ${WEB_SEARCH_TOOL_NAME} if docs don't cover the topic
|
|
136309
|
-
7. Reference local project files (CLAUDE.md, .claude/ directory) when relevant using ${localSearchHint}
|
|
136310
|
-
|
|
136311
|
-
**Guidelines:**
|
|
136312
|
-
- Always prioritize official documentation over assumptions
|
|
136313
|
-
- Keep responses concise and actionable
|
|
136314
|
-
- Include specific examples or code snippets when helpful
|
|
136315
|
-
- Reference exact documentation URLs in your responses
|
|
136316
|
-
- Help users discover features by proactively suggesting related commands, shortcuts, or capabilities
|
|
136317
|
-
|
|
136318
|
-
Complete the user's request by providing accurate, documentation-based guidance.`;
|
|
136319
|
-
}
|
|
136320
|
-
function getFeedbackGuideline() {
|
|
136321
|
-
if (isUsing3PServices()) {
|
|
136322
|
-
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${"report the issue at https://github.com/anthropics/claude-code/issues"}`;
|
|
136323
|
-
}
|
|
136324
|
-
return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
|
|
136325
|
-
}
|
|
136326
|
-
var CLAUDE_CODE_DOCS_MAP_URL = "https://code.claude.com/docs/en/claude_code_docs_map.md", CDP_DOCS_MAP_URL = "https://platform.claude.com/llms.txt", CLAUDE_CODE_GUIDE_AGENT_TYPE = "claude-code-guide", CLAUDE_CODE_GUIDE_AGENT;
|
|
136327
|
-
var init_claudeCodeGuideAgent = __esm(() => {
|
|
136328
|
-
init_auth();
|
|
136329
|
-
init_embeddedTools();
|
|
136330
|
-
init_settings2();
|
|
136331
|
-
init_slowOperations();
|
|
136332
|
-
CLAUDE_CODE_GUIDE_AGENT = {
|
|
136333
|
-
agentType: CLAUDE_CODE_GUIDE_AGENT_TYPE,
|
|
136334
|
-
whenToUse: `Use this agent when the user asks questions ("Can Claude...", "Does Claude...", "How do I...") about: (1) Claude Code (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Claude Agent SDK - building custom agents; (3) Claude API (formerly Anthropic API) - API usage, tool use, Anthropic SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can continue via ${SEND_MESSAGE_TOOL_NAME}.`,
|
|
136335
|
-
tools: hasEmbeddedSearchTools() ? [
|
|
136336
|
-
BASH_TOOL_NAME,
|
|
136337
|
-
FILE_READ_TOOL_NAME,
|
|
136338
|
-
WEB_FETCH_TOOL_NAME,
|
|
136339
|
-
WEB_SEARCH_TOOL_NAME
|
|
136340
|
-
] : [
|
|
136341
|
-
GLOB_TOOL_NAME,
|
|
136342
|
-
GREP_TOOL_NAME,
|
|
136343
|
-
FILE_READ_TOOL_NAME,
|
|
136344
|
-
WEB_FETCH_TOOL_NAME,
|
|
136345
|
-
WEB_SEARCH_TOOL_NAME
|
|
136346
|
-
],
|
|
136347
|
-
source: "built-in",
|
|
136348
|
-
baseDir: "built-in",
|
|
136349
|
-
model: "haiku",
|
|
136350
|
-
permissionMode: "dontAsk",
|
|
136351
|
-
getSystemPrompt({ toolUseContext }) {
|
|
136352
|
-
const commands = toolUseContext.options.commands;
|
|
136353
|
-
const contextSections = [];
|
|
136354
|
-
const customCommands = commands.filter((cmd) => cmd.type === "prompt");
|
|
136355
|
-
if (customCommands.length > 0) {
|
|
136356
|
-
const commandList = customCommands.map((cmd) => `- /${cmd.name}: ${cmd.description}`).join(`
|
|
136357
|
-
`);
|
|
136358
|
-
contextSections.push(`**Available custom skills in this project:**
|
|
136359
|
-
${commandList}`);
|
|
136360
|
-
}
|
|
136361
|
-
const customAgents = toolUseContext.options.agentDefinitions.activeAgents.filter((a) => a.source !== "built-in");
|
|
136362
|
-
if (customAgents.length > 0) {
|
|
136363
|
-
const agentList = customAgents.map((a) => `- ${a.agentType}: ${a.whenToUse}`).join(`
|
|
136364
|
-
`);
|
|
136365
|
-
contextSections.push(`**Available custom agents configured:**
|
|
136366
|
-
${agentList}`);
|
|
136367
|
-
}
|
|
136368
|
-
const mcpClients = toolUseContext.options.mcpClients;
|
|
136369
|
-
if (mcpClients && mcpClients.length > 0) {
|
|
136370
|
-
const mcpList = mcpClients.map((client) => `- ${client.name}`).join(`
|
|
136371
|
-
`);
|
|
136372
|
-
contextSections.push(`**Configured MCP servers:**
|
|
136373
|
-
${mcpList}`);
|
|
136374
|
-
}
|
|
136375
|
-
const pluginCommands = commands.filter((cmd) => cmd.type === "prompt" && cmd.source === "plugin");
|
|
136376
|
-
if (pluginCommands.length > 0) {
|
|
136377
|
-
const pluginList = pluginCommands.map((cmd) => `- /${cmd.name}: ${cmd.description}`).join(`
|
|
136378
|
-
`);
|
|
136379
|
-
contextSections.push(`**Available plugin skills:**
|
|
136380
|
-
${pluginList}`);
|
|
136381
|
-
}
|
|
136382
|
-
const settings = getSettings_DEPRECATED();
|
|
136383
|
-
if (Object.keys(settings).length > 0) {
|
|
136384
|
-
const settingsJson = jsonStringify(settings, null, 2);
|
|
136385
|
-
contextSections.push(`**User's settings.json:**
|
|
136386
|
-
\`\`\`json
|
|
136387
|
-
${settingsJson}
|
|
136388
|
-
\`\`\``);
|
|
136389
|
-
}
|
|
136390
|
-
const feedbackGuideline = getFeedbackGuideline();
|
|
136391
|
-
const basePromptWithFeedback = `${getClaudeCodeGuideBasePrompt()}
|
|
136392
|
-
${feedbackGuideline}`;
|
|
136393
|
-
if (contextSections.length > 0) {
|
|
136394
|
-
return `${basePromptWithFeedback}
|
|
136395
|
-
|
|
136396
|
-
---
|
|
136397
|
-
|
|
136398
|
-
# User's Current Configuration
|
|
136399
|
-
|
|
136400
|
-
The user has the following custom setup in their environment:
|
|
136401
|
-
|
|
136402
|
-
${contextSections.join(`
|
|
136403
|
-
|
|
136404
|
-
`)}
|
|
136405
|
-
|
|
136406
|
-
When answering questions, consider these configured features and proactively suggest them when relevant.`;
|
|
136407
|
-
}
|
|
136408
|
-
return basePromptWithFeedback;
|
|
136409
|
-
}
|
|
136410
|
-
};
|
|
136411
|
-
});
|
|
136412
|
-
|
|
136413
136317
|
// src/capabilities/tools/AgentTool/built-in/exploreAgent.ts
|
|
136414
136318
|
function getExploreSystemPrompt() {
|
|
136415
136319
|
const embedded = hasEmbeddedSearchTools();
|
|
@@ -136876,17 +136780,12 @@ function getBuiltInAgents() {
|
|
|
136876
136780
|
if (areExplorePlanAgentsEnabled()) {
|
|
136877
136781
|
agents.push(EXPLORE_AGENT, PLAN_AGENT);
|
|
136878
136782
|
}
|
|
136879
|
-
const isNonSdkEntrypoint = resolveEnvVar("ENTRYPOINT") !== "sdk-ts" && resolveEnvVar("ENTRYPOINT") !== "sdk-py" && resolveEnvVar("ENTRYPOINT") !== "sdk-cli";
|
|
136880
|
-
if (isNonSdkEntrypoint) {
|
|
136881
|
-
agents.push(CLAUDE_CODE_GUIDE_AGENT);
|
|
136882
|
-
}
|
|
136883
136783
|
if (false) {}
|
|
136884
136784
|
return agents;
|
|
136885
136785
|
}
|
|
136886
136786
|
var init_builtInAgents = __esm(() => {
|
|
136887
136787
|
init_state2();
|
|
136888
136788
|
init_envUtils();
|
|
136889
|
-
init_claudeCodeGuideAgent();
|
|
136890
136789
|
init_exploreAgent();
|
|
136891
136790
|
init_generalPurposeAgent();
|
|
136892
136791
|
init_planAgent();
|
|
@@ -138862,7 +138761,7 @@ function getErrorMessageIfRefusal(stopReason, model) {
|
|
|
138862
138761
|
}
|
|
138863
138762
|
logEvent("tengu_refusal_api_response", {});
|
|
138864
138763
|
const usagePolicyUrl = isFamily(getProvider(), "firstParty") ? "https://www.anthropic.com/legal/aup" : "your provider's acceptable use policy";
|
|
138865
|
-
const baseMessage = getIsNonInteractiveSession() ? `${API_ERROR_MESSAGE_PREFIX}:
|
|
138764
|
+
const baseMessage = getIsNonInteractiveSession() ? `${API_ERROR_MESSAGE_PREFIX}: ${getBranding().productName} is unable to respond to this request, which appears to violate our Usage Policy (${usagePolicyUrl}). Try rephrasing the request or attempting a different approach.` : `${API_ERROR_MESSAGE_PREFIX}: ${getBranding().productName} is unable to respond to this request, which appears to violate our Usage Policy (${usagePolicyUrl}). Please double press esc to edit your last message or start a new session for ${getBranding().productName} to assist with a different task.`;
|
|
138866
138765
|
const modelSuggestion = model !== "claude-sonnet-4-20250514" ? " If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models." : "";
|
|
138867
138766
|
return createAssistantAPIErrorMessage({
|
|
138868
138767
|
content: baseMessage + modelSuggestion,
|
|
@@ -138909,6 +138808,7 @@ var init_errors8 = __esm(() => {
|
|
|
138909
138808
|
init_claudeAiLimits();
|
|
138910
138809
|
init_mocking();
|
|
138911
138810
|
init_errorUtils();
|
|
138811
|
+
init_branding();
|
|
138912
138812
|
});
|
|
138913
138813
|
|
|
138914
138814
|
// src/providers/shared/retry.ts
|
|
@@ -231366,12 +231266,11 @@ async function* runPostToolUseFailureHooks(toolUseContext, tool, toolUseID, mess
|
|
|
231366
231266
|
}
|
|
231367
231267
|
async function resolveHookPermissionDecision(hookPermissionResult, tool, input, toolUseContext, canUseTool, assistantMessage, toolUseID) {
|
|
231368
231268
|
const requiresInteraction = tool.requiresUserInteraction?.();
|
|
231369
|
-
const requireCanUseTool = toolUseContext.requireCanUseTool;
|
|
231370
231269
|
if (hookPermissionResult?.behavior === "allow") {
|
|
231371
231270
|
const hookInput = hookPermissionResult.updatedInput ?? input;
|
|
231372
231271
|
const interactionSatisfied = requiresInteraction && hookPermissionResult.updatedInput !== undefined;
|
|
231373
|
-
if (
|
|
231374
|
-
logForDebugging2(`Hook approved tool use for ${tool.name},
|
|
231272
|
+
if (!interactionSatisfied) {
|
|
231273
|
+
logForDebugging2(`Hook approved tool use for ${tool.name}, deferring final decision to canUseTool`);
|
|
231375
231274
|
return {
|
|
231376
231275
|
decision: await consumePermissionPreDecision(toolUseContext, toolUseID, hookInput, () => canUseTool(tool, hookInput, toolUseContext, assistantMessage, toolUseID)),
|
|
231377
231276
|
input: hookInput
|
|
@@ -231379,7 +231278,7 @@ async function resolveHookPermissionDecision(hookPermissionResult, tool, input,
|
|
|
231379
231278
|
}
|
|
231380
231279
|
const ruleCheck = await checkRuleBasedPermissions(tool, hookInput, toolUseContext);
|
|
231381
231280
|
if (ruleCheck === null) {
|
|
231382
|
-
logForDebugging2(
|
|
231281
|
+
logForDebugging2(`Hook satisfied user interaction for ${tool.name} via updatedInput`);
|
|
231383
231282
|
return { decision: hookPermissionResult, input: hookInput };
|
|
231384
231283
|
}
|
|
231385
231284
|
if (ruleCheck.behavior === "deny") {
|
|
@@ -235260,7 +235159,7 @@ function getAnthropicEnvMetadata() {
|
|
|
235260
235159
|
function getBuildAgeMinutes() {
|
|
235261
235160
|
if (false)
|
|
235262
235161
|
;
|
|
235263
|
-
const buildTime = new Date("2026-10-
|
|
235162
|
+
const buildTime = new Date("2026-10-20T14:00:47.620Z").getTime();
|
|
235264
235163
|
if (isNaN(buildTime))
|
|
235265
235164
|
return;
|
|
235266
235165
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -237580,7 +237479,7 @@ function hookSourceDescriptionDisplayString(source) {
|
|
|
237580
237479
|
case "sessionHook":
|
|
237581
237480
|
return "Session hooks (in-memory, temporary)";
|
|
237582
237481
|
case "builtinHook":
|
|
237583
|
-
return "Built-in hooks (registered internally
|
|
237482
|
+
return "Built-in hooks (registered internally)";
|
|
237584
237483
|
default:
|
|
237585
237484
|
return source;
|
|
237586
237485
|
}
|
|
@@ -239847,6 +239746,11 @@ NOTE: You just closed out 3+ tasks and none of them was a verification step. Bef
|
|
|
239847
239746
|
});
|
|
239848
239747
|
});
|
|
239849
239748
|
|
|
239749
|
+
// src/providers/shared/userAgent.ts
|
|
239750
|
+
function getClaudeCodeUserAgent() {
|
|
239751
|
+
return `claude-code/${"99.0.0"}`;
|
|
239752
|
+
}
|
|
239753
|
+
|
|
239850
239754
|
// src/providers/anthropic/policyLimits/types.ts
|
|
239851
239755
|
var PolicyLimitsResponseSchema;
|
|
239852
239756
|
var init_types8 = __esm(() => {
|
|
@@ -242328,7 +242232,8 @@ var init_coreSchemas = __esm(() => {
|
|
|
242328
242232
|
type: literal("stdio").optional(),
|
|
242329
242233
|
command: string2(),
|
|
242330
242234
|
args: array(string2()).optional(),
|
|
242331
|
-
env: record(string2(), string2()).optional()
|
|
242235
|
+
env: record(string2(), string2()).optional(),
|
|
242236
|
+
cwd: string2().optional()
|
|
242332
242237
|
}));
|
|
242333
242238
|
McpSSEServerConfigSchema2 = lazySchema(() => object({
|
|
242334
242239
|
type: literal("sse"),
|
|
@@ -248743,7 +248648,7 @@ function validateCommandPaths(command, args, cwd, toolPermissionContext, compoun
|
|
|
248743
248648
|
if (validator && !validator(args)) {
|
|
248744
248649
|
return {
|
|
248745
248650
|
behavior: "ask",
|
|
248746
|
-
message: `${command} with flags requires manual approval to ensure path safety. For security,
|
|
248651
|
+
message: `${command} with flags requires manual approval to ensure path safety. For security, ${getBranding().productName} cannot automatically validate ${command} commands that use flags, as some flags like --target-directory=PATH can bypass path validation.`,
|
|
248747
248652
|
decisionReason: {
|
|
248748
248653
|
type: "other",
|
|
248749
248654
|
reason: `${command} command with flags requires manual approval`
|
|
@@ -248753,7 +248658,7 @@ function validateCommandPaths(command, args, cwd, toolPermissionContext, compoun
|
|
|
248753
248658
|
if (compoundCommandHasCd && operationType !== "read") {
|
|
248754
248659
|
return {
|
|
248755
248660
|
behavior: "ask",
|
|
248756
|
-
message: `Commands that change directories and perform write operations require explicit approval to ensure paths are evaluated correctly. For security,
|
|
248661
|
+
message: `Commands that change directories and perform write operations require explicit approval to ensure paths are evaluated correctly. For security, ${getBranding().productName} cannot automatically determine the final working directory when 'cd' is used in compound commands.`,
|
|
248757
248662
|
decisionReason: {
|
|
248758
248663
|
type: "other",
|
|
248759
248664
|
reason: "Compound command contains cd with write operation - manual approval required to prevent path resolution bypass"
|
|
@@ -248765,7 +248670,7 @@ function validateCommandPaths(command, args, cwd, toolPermissionContext, compoun
|
|
|
248765
248670
|
if (!allowed) {
|
|
248766
248671
|
const workingDirs = Array.from(allWorkingDirectories(toolPermissionContext));
|
|
248767
248672
|
const dirListStr = formatDirectoryList(workingDirs);
|
|
248768
|
-
const message = decisionReason?.type === "other" || decisionReason?.type === "safetyCheck" ? decisionReason.reason : `${command} in '${resolvedPath}' was blocked. For security,
|
|
248673
|
+
const message = decisionReason?.type === "other" || decisionReason?.type === "safetyCheck" ? decisionReason.reason : `${command} in '${resolvedPath}' was blocked. For security, ${getBranding().productName} may only ${ACTION_VERBS[command]} the allowed working directories for this session: ${dirListStr}.`;
|
|
248769
248674
|
if (decisionReason?.type === "rule") {
|
|
248770
248675
|
return {
|
|
248771
248676
|
behavior: "deny",
|
|
@@ -248890,7 +248795,7 @@ function validateOutputRedirections(redirections, cwd, toolPermissionContext, co
|
|
|
248890
248795
|
if (compoundCommandHasCd && redirections.length > 0) {
|
|
248891
248796
|
return {
|
|
248892
248797
|
behavior: "ask",
|
|
248893
|
-
message: `Commands that change directories and write via output redirection require explicit approval to ensure paths are evaluated correctly. For security,
|
|
248798
|
+
message: `Commands that change directories and write via output redirection require explicit approval to ensure paths are evaluated correctly. For security, ${getBranding().productName} cannot automatically determine the final working directory when 'cd' is used in compound commands.`,
|
|
248894
248799
|
decisionReason: {
|
|
248895
248800
|
type: "other",
|
|
248896
248801
|
reason: "Compound command contains cd with output redirection - manual approval required to prevent path resolution bypass"
|
|
@@ -248905,7 +248810,7 @@ function validateOutputRedirections(redirections, cwd, toolPermissionContext, co
|
|
|
248905
248810
|
if (!allowed) {
|
|
248906
248811
|
const workingDirs = Array.from(allWorkingDirectories(toolPermissionContext));
|
|
248907
248812
|
const dirListStr = formatDirectoryList(workingDirs);
|
|
248908
|
-
const message = decisionReason?.type === "other" || decisionReason?.type === "safetyCheck" ? decisionReason.reason : decisionReason?.type === "rule" ? `Output redirection to '${resolvedPath}' was blocked by a deny rule.` : `Output redirection to '${resolvedPath}' was blocked. For security,
|
|
248813
|
+
const message = decisionReason?.type === "other" || decisionReason?.type === "safetyCheck" ? decisionReason.reason : decisionReason?.type === "rule" ? `Output redirection to '${resolvedPath}' was blocked by a deny rule.` : `Output redirection to '${resolvedPath}' was blocked. For security, ${getBranding().productName} may only write to files in the allowed working directories for this session: ${dirListStr}.`;
|
|
248909
248814
|
if (decisionReason?.type === "rule") {
|
|
248910
248815
|
return {
|
|
248911
248816
|
behavior: "deny",
|
|
@@ -249112,6 +249017,7 @@ var init_pathValidation2 = __esm(() => {
|
|
|
249112
249017
|
init_pathValidation();
|
|
249113
249018
|
init_bashPermissions();
|
|
249114
249019
|
init_sedValidation();
|
|
249020
|
+
init_branding();
|
|
249115
249021
|
PATH_EXTRACTORS = {
|
|
249116
249022
|
cd: (args) => args.length === 0 ? [homedir18()] : [args.join(" ")],
|
|
249117
249023
|
ls: (args) => {
|
|
@@ -262129,7 +262035,7 @@ function validateInputForSettingsFileEdit(filePath, originalContent, getUpdatedC
|
|
|
262129
262035
|
if (!afterValidation.isValid) {
|
|
262130
262036
|
return {
|
|
262131
262037
|
result: false,
|
|
262132
|
-
message: `
|
|
262038
|
+
message: `settings.json validation failed after edit:
|
|
262133
262039
|
${afterValidation.error}
|
|
262134
262040
|
|
|
262135
262041
|
Full schema:
|
|
@@ -273999,6 +273905,7 @@ ${content}`;
|
|
|
273999
273905
|
source: sourceName,
|
|
274000
273906
|
dataPath: pluginDataPath
|
|
274001
273907
|
});
|
|
273908
|
+
finalContent = substitutePluginContentVariables(finalContent);
|
|
274002
273909
|
if (pluginManifest.userConfig) {
|
|
274003
273910
|
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
274004
273911
|
}
|
|
@@ -281437,7 +281344,7 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl,
|
|
|
281437
281344
|
}
|
|
281438
281345
|
if (code) {
|
|
281439
281346
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
281440
|
-
res.end(`<h1>Authentication Successful</h1><p>You can close this window. Return to
|
|
281347
|
+
res.end(`<h1>Authentication Successful</h1><p>You can close this window. Return to ${import_xss2.default(getBranding().productName)}.</p>`);
|
|
281441
281348
|
cleanup();
|
|
281442
281349
|
resolveOnce(code);
|
|
281443
281350
|
}
|
|
@@ -281603,7 +281510,7 @@ class ClaudeAuthProvider {
|
|
|
281603
281510
|
}
|
|
281604
281511
|
get clientMetadata() {
|
|
281605
281512
|
const metadata = {
|
|
281606
|
-
client_name:
|
|
281513
|
+
client_name: `${getBranding().productName} (${this.serverName})`,
|
|
281607
281514
|
redirect_uris: [this.redirectUri],
|
|
281608
281515
|
grant_types: ["authorization_code", "refresh_token"],
|
|
281609
281516
|
response_types: ["code"],
|
|
@@ -281622,7 +281529,7 @@ class ClaudeAuthProvider {
|
|
|
281622
281529
|
logMCPDebug(this.serverName, `Using CIMD URL from env: ${override}`);
|
|
281623
281530
|
return override;
|
|
281624
281531
|
}
|
|
281625
|
-
return
|
|
281532
|
+
return getBranding().mcpOAuthClientMetadataUrl;
|
|
281626
281533
|
}
|
|
281627
281534
|
setMetadata(metadata) {
|
|
281628
281535
|
this._metadata = metadata;
|
|
@@ -282248,7 +282155,7 @@ var init_auth6 = __esm(() => {
|
|
|
282248
282155
|
init_errors7();
|
|
282249
282156
|
init_auth4();
|
|
282250
282157
|
init_axios2();
|
|
282251
|
-
|
|
282158
|
+
init_branding();
|
|
282252
282159
|
init_browser();
|
|
282253
282160
|
init_envUtils();
|
|
282254
282161
|
init_errors2();
|
|
@@ -287044,7 +286951,7 @@ function isIncludedMcpTool(tool) {
|
|
|
287044
286951
|
return !tool.name.startsWith("mcp__ide__") || ALLOWED_IDE_TOOLS.includes(tool.name);
|
|
287045
286952
|
}
|
|
287046
286953
|
function getServerCacheKey(name, serverRef) {
|
|
287047
|
-
return `${name}-${jsonStringify(serverRef)}`;
|
|
286954
|
+
return `${name}-${jsonStringify(serverRef)}-${jsonStringify(getBranding())}`;
|
|
287048
286955
|
}
|
|
287049
286956
|
async function clearServerCache(name, serverRef) {
|
|
287050
286957
|
const key = getServerCacheKey(name, serverRef);
|
|
@@ -287636,10 +287543,8 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
287636
287543
|
const results = await Promise.allSettled(Object.entries(sdkMcpConfigs).map(async ([name, config]) => {
|
|
287637
287544
|
const transport = new SdkControlClientTransport(name, sendMcpMessage);
|
|
287638
287545
|
const client = new Client({
|
|
287639
|
-
name: TELEMETRY_SERVICE_NAME,
|
|
287640
287546
|
...getMcpClientInfo(),
|
|
287641
|
-
version: "99.0.0"
|
|
287642
|
-
websiteUrl: PRODUCT_URL
|
|
287547
|
+
version: "99.0.0"
|
|
287643
287548
|
}, {
|
|
287644
287549
|
capabilities: {}
|
|
287645
287550
|
});
|
|
@@ -287768,6 +287673,7 @@ var init_client5 = __esm(() => {
|
|
|
287768
287673
|
ALLOWED_IDE_TOOLS = ["mcp__ide__executeCode", "mcp__ide__getDiagnostics"];
|
|
287769
287674
|
connectToServer = memoize_default(async (name, serverRef, serverStats) => {
|
|
287770
287675
|
const connectStartTime = Date.now();
|
|
287676
|
+
const cacheKey = getServerCacheKey(name, serverRef);
|
|
287771
287677
|
let inProcessServer;
|
|
287772
287678
|
try {
|
|
287773
287679
|
let transport;
|
|
@@ -287966,6 +287872,7 @@ var init_client5 = __esm(() => {
|
|
|
287966
287872
|
...subprocessEnv(),
|
|
287967
287873
|
...serverRef.env
|
|
287968
287874
|
},
|
|
287875
|
+
...serverRef.cwd ? { cwd: serverRef.cwd } : {},
|
|
287969
287876
|
stderr: "pipe"
|
|
287970
287877
|
});
|
|
287971
287878
|
} else {
|
|
@@ -287987,10 +287894,8 @@ var init_client5 = __esm(() => {
|
|
|
287987
287894
|
}
|
|
287988
287895
|
}
|
|
287989
287896
|
const client = new Client({
|
|
287990
|
-
name: TELEMETRY_SERVICE_NAME,
|
|
287991
287897
|
...getMcpClientInfo(),
|
|
287992
|
-
version: "99.0.0"
|
|
287993
|
-
websiteUrl: PRODUCT_URL
|
|
287898
|
+
version: "99.0.0"
|
|
287994
287899
|
}, {
|
|
287995
287900
|
capabilities: {
|
|
287996
287901
|
roots: {},
|
|
@@ -288200,12 +288105,11 @@ var init_client5 = __esm(() => {
|
|
|
288200
288105
|
const uptime = Date.now() - connectionStartTime;
|
|
288201
288106
|
const transportType = serverRef.type ?? "unknown";
|
|
288202
288107
|
logMCPDebug(name, `${transportType.toUpperCase()} connection closed after ${Math.floor(uptime / 1000)}s (${hasErrorOccurred ? "with errors" : "cleanly"})`);
|
|
288203
|
-
const key = getServerCacheKey(name, serverRef);
|
|
288204
288108
|
fetchToolsForClient.cache.delete(name);
|
|
288205
288109
|
fetchResourcesForClient.cache.delete(name);
|
|
288206
288110
|
fetchCommandsForClient.cache.delete(name);
|
|
288207
288111
|
if (false) {}
|
|
288208
|
-
connectToServer.cache.delete(
|
|
288112
|
+
connectToServer.cache.delete(cacheKey);
|
|
288209
288113
|
logMCPDebug(name, `Cleared connection cache for reconnection`);
|
|
288210
288114
|
if (originalOnclose) {
|
|
288211
288115
|
originalOnclose();
|
|
@@ -301151,7 +301055,7 @@ function AUTO_REJECT_MESSAGE(toolName) {
|
|
|
301151
301055
|
return `Permission to use ${toolName} has been denied. ${DENIAL_WORKAROUND_GUIDANCE}`;
|
|
301152
301056
|
}
|
|
301153
301057
|
function DONT_ASK_REJECT_MESSAGE(toolName) {
|
|
301154
|
-
return `Permission to use ${toolName} has been denied because
|
|
301058
|
+
return `Permission to use ${toolName} has been denied because ${getBranding().productName} is running in don't ask mode. ${DENIAL_WORKAROUND_GUIDANCE}`;
|
|
301155
301059
|
}
|
|
301156
301060
|
function isSyntheticMessage(message) {
|
|
301157
301061
|
return message.type !== "progress" && message.type !== "attachment" && message.type !== "system" && Array.isArray(message.message.content) && message.message.content[0]?.type === "text" && SYNTHETIC_MESSAGES.has(message.message.content[0].text);
|
|
@@ -304343,6 +304247,7 @@ var init_messages4 = __esm(() => {
|
|
|
304343
304247
|
init_tasks();
|
|
304344
304248
|
init_toolSearch();
|
|
304345
304249
|
init_state();
|
|
304250
|
+
init_branding();
|
|
304346
304251
|
DENIAL_WORKAROUND_GUIDANCE = `IMPORTANT: You *may* attempt to accomplish this action using other tools that might naturally be used to accomplish this goal, ` + `e.g. using head instead of cat. But you *should not* attempt to work around this denial in malicious ways, ` + `e.g. do not use your ability to run tests to execute non-test actions. ` + `You should only try to work around this restriction in reasonable ways that do not attempt to bypass the intent behind this denial. ` + `If you believe this capability is essential to complete the user's request, STOP and explain to the user ` + `what you were trying to do and why you need this permission. Let the user decide how to proceed.`;
|
|
304347
304252
|
SYNTHETIC_MESSAGES = new Set([
|
|
304348
304253
|
INTERRUPT_MESSAGE,
|
|
@@ -369441,11 +369346,12 @@ var init_utils8 = __esm(() => {
|
|
|
369441
369346
|
init_log3();
|
|
369442
369347
|
init_state();
|
|
369443
369348
|
init_mcpOutputStorage();
|
|
369349
|
+
init_branding();
|
|
369444
369350
|
init_settings2();
|
|
369445
369351
|
init_preapproved();
|
|
369446
369352
|
DomainBlockedError = class DomainBlockedError extends Error {
|
|
369447
369353
|
constructor(domain) {
|
|
369448
|
-
super(
|
|
369354
|
+
super(`${getBranding().productName} is unable to fetch from ${domain}`);
|
|
369449
369355
|
this.name = "DomainBlockedError";
|
|
369450
369356
|
}
|
|
369451
369357
|
};
|
|
@@ -389663,7 +389569,7 @@ async function enrollTrustedDevice() {
|
|
|
389663
389569
|
const baseUrl = getOauthConfig().BASE_API_URL;
|
|
389664
389570
|
let response;
|
|
389665
389571
|
try {
|
|
389666
|
-
response = await axios_default.post(`${baseUrl}/api/auth/trusted_devices`, { display_name:
|
|
389572
|
+
response = await axios_default.post(`${baseUrl}/api/auth/trusted_devices`, { display_name: `${getBranding().productName} on ${hostname2()} · ${process.platform}` }, {
|
|
389667
389573
|
headers: {
|
|
389668
389574
|
Authorization: `Bearer ${accessToken}`,
|
|
389669
389575
|
"Content-Type": "application/json"
|
|
@@ -389715,6 +389621,7 @@ var init_trustedDevice = __esm(() => {
|
|
|
389715
389621
|
init_privacyLevel();
|
|
389716
389622
|
init_secureStorage();
|
|
389717
389623
|
init_slowOperations();
|
|
389624
|
+
init_branding();
|
|
389718
389625
|
readStoredToken = memoize_default(() => {
|
|
389719
389626
|
const envToken = process.env.CLAUDE_TRUSTED_DEVICE_TOKEN;
|
|
389720
389627
|
if (envToken) {
|
|
@@ -480217,7 +480124,7 @@ function buildPrimarySection() {
|
|
|
480217
480124
|
}, undefined, false, undefined, this);
|
|
480218
480125
|
return [{
|
|
480219
480126
|
label: "Version",
|
|
480220
|
-
value: "0.4.
|
|
480127
|
+
value: "0.4.27"
|
|
480221
480128
|
}, {
|
|
480222
480129
|
label: "Session name",
|
|
480223
480130
|
value: nameValue
|
|
@@ -506721,7 +506628,7 @@ async function validatePluginManifest(filePath) {
|
|
|
506721
506628
|
delete stripped[key];
|
|
506722
506629
|
warnings.push({
|
|
506723
506630
|
path: key,
|
|
506724
|
-
message: `Field '${key}' belongs in the marketplace entry (marketplace.json), ` + `not plugin.json. It's harmless here but unused —
|
|
506631
|
+
message: `Field '${key}' belongs in the marketplace entry (marketplace.json), ` + `not plugin.json. It's harmless here but unused — ${getBranding().productName} ` + `ignores it at load time.`
|
|
506725
506632
|
});
|
|
506726
506633
|
}
|
|
506727
506634
|
toValidate = stripped;
|
|
@@ -506736,7 +506643,7 @@ async function validatePluginManifest(filePath) {
|
|
|
506736
506643
|
if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(manifest.name)) {
|
|
506737
506644
|
warnings.push({
|
|
506738
506645
|
path: "name",
|
|
506739
|
-
message: `Plugin name "${manifest.name}" is not kebab-case.
|
|
506646
|
+
message: `Plugin name "${manifest.name}" is not kebab-case. ${getBranding().productName} accepts ` + `it, but the Claude.ai marketplace sync requires kebab-case ` + `(lowercase letters, digits, and hyphens only, e.g., "my-plugin").`
|
|
506740
506647
|
});
|
|
506741
506648
|
}
|
|
506742
506649
|
if (!manifest.version) {
|
|
@@ -507172,6 +507079,7 @@ var init_validatePlugin = __esm(() => {
|
|
|
507172
507079
|
init_slowOperations();
|
|
507173
507080
|
init_schemas3();
|
|
507174
507081
|
init_fsOperations();
|
|
507082
|
+
init_branding();
|
|
507175
507083
|
MARKETPLACE_ONLY_MANIFEST_FIELDS = new Set([
|
|
507176
507084
|
"category",
|
|
507177
507085
|
"source",
|
|
@@ -528296,7 +528204,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
528296
528204
|
var call58 = async () => {
|
|
528297
528205
|
return {
|
|
528298
528206
|
type: "text",
|
|
528299
|
-
value: `${"99.0.0"} (built ${"2026-10-
|
|
528207
|
+
value: `${"99.0.0"} (built ${"2026-10-20T14:00:47.620Z"})`
|
|
528300
528208
|
};
|
|
528301
528209
|
}, version2, version_default;
|
|
528302
528210
|
var init_version = __esm(() => {
|
|
@@ -545975,7 +545883,7 @@ function WelcomeV2() {
|
|
|
545975
545883
|
dimColor: true,
|
|
545976
545884
|
children: [
|
|
545977
545885
|
"v",
|
|
545978
|
-
"0.4.
|
|
545886
|
+
"0.4.27",
|
|
545979
545887
|
" "
|
|
545980
545888
|
]
|
|
545981
545889
|
}, undefined, true, undefined, this)
|
|
@@ -546175,7 +546083,7 @@ function WelcomeV2() {
|
|
|
546175
546083
|
dimColor: true,
|
|
546176
546084
|
children: [
|
|
546177
546085
|
"v",
|
|
546178
|
-
"0.4.
|
|
546086
|
+
"0.4.27",
|
|
546179
546087
|
" "
|
|
546180
546088
|
]
|
|
546181
546089
|
}, undefined, true, undefined, this)
|
|
@@ -546401,7 +546309,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
546401
546309
|
dimColor: true,
|
|
546402
546310
|
children: [
|
|
546403
546311
|
"v",
|
|
546404
|
-
"0.4.
|
|
546312
|
+
"0.4.27",
|
|
546405
546313
|
" "
|
|
546406
546314
|
]
|
|
546407
546315
|
}, undefined, true, undefined, this);
|
|
@@ -546655,7 +546563,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
546655
546563
|
dimColor: true,
|
|
546656
546564
|
children: [
|
|
546657
546565
|
"v",
|
|
546658
|
-
"0.4.
|
|
546566
|
+
"0.4.27",
|
|
546659
546567
|
" "
|
|
546660
546568
|
]
|
|
546661
546569
|
}, undefined, true, undefined, this);
|
|
@@ -550136,9 +550044,8 @@ Remember that settings are in:
|
|
|
550136
550044
|
|
|
550137
550045
|
1. Review the user's issue description
|
|
550138
550046
|
2. The last ${DEFAULT_DEBUG_LINES_READ} lines show the debug file format. Look for [ERROR] and [WARN] entries, stack traces, and failure patterns across the file
|
|
550139
|
-
3.
|
|
550140
|
-
4.
|
|
550141
|
-
5. Suggest concrete fixes or next steps
|
|
550047
|
+
3. Explain what you found in plain language
|
|
550048
|
+
4. Suggest concrete fixes or next steps
|
|
550142
550049
|
`;
|
|
550143
550050
|
return [{ type: "text", text: prompt }];
|
|
550144
550051
|
}
|
|
@@ -550146,7 +550053,6 @@ Remember that settings are in:
|
|
|
550146
550053
|
}
|
|
550147
550054
|
var DEFAULT_DEBUG_LINES_READ = 20, TAIL_READ_BYTES;
|
|
550148
550055
|
var init_debug3 = __esm(() => {
|
|
550149
|
-
init_claudeCodeGuideAgent();
|
|
550150
550056
|
init_settings2();
|
|
550151
550057
|
init_debug();
|
|
550152
550058
|
init_errors2();
|
|
@@ -550299,7 +550205,7 @@ var init_schema2 = __esm(() => {
|
|
|
550299
550205
|
$schema: string2().optional().describe("JSON Schema URL for editor validation"),
|
|
550300
550206
|
$docs: string2().optional().describe("Documentation URL"),
|
|
550301
550207
|
bindings: array(KeybindingBlockSchema()).describe("Array of keybinding blocks by context")
|
|
550302
|
-
}).describe("
|
|
550208
|
+
}).describe("Keybindings configuration. Customize keyboard shortcuts by context."));
|
|
550303
550209
|
});
|
|
550304
550210
|
|
|
550305
550211
|
// src/cli/skills/bundled/keybindings.ts
|
|
@@ -567414,7 +567320,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
567414
567320
|
pendingHookMessages
|
|
567415
567321
|
}, renderAndRun);
|
|
567416
567322
|
}
|
|
567417
|
-
}).version("0.4.
|
|
567323
|
+
}).version("0.4.27 (OpenCow)", "-v, --version", "Output the version number");
|
|
567418
567324
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
567419
567325
|
program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
567420
567326
|
if (canUserConfigureAdvisor()) {
|
|
@@ -568009,7 +567915,7 @@ if (false) {}
|
|
|
568009
567915
|
async function main2() {
|
|
568010
567916
|
const args = process.argv.slice(2);
|
|
568011
567917
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
568012
|
-
console.log(`${"0.4.
|
|
567918
|
+
console.log(`${"0.4.27"} (OpenCow)`);
|
|
568013
567919
|
return;
|
|
568014
567920
|
}
|
|
568015
567921
|
if (args.includes("--provider")) {
|
|
@@ -568109,4 +568015,4 @@ async function main2() {
|
|
|
568109
568015
|
}
|
|
568110
568016
|
main2();
|
|
568111
568017
|
|
|
568112
|
-
//# debugId=
|
|
568018
|
+
//# debugId=25745C572ABF064464756E2164756E21
|