@ycodium-ai/agent-claude 0.2.3112 → 0.2.3114
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 +41 -11
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -22771,27 +22771,47 @@ function assertSteeringTarget(expectedTurnId, turnState) {
|
|
|
22771
22771
|
}
|
|
22772
22772
|
|
|
22773
22773
|
// src/hostMcpAllowRules.ts
|
|
22774
|
+
import { setsOwnModelConnection } from "@ycodium-ai/plugin-api/executor";
|
|
22774
22775
|
function claudeHostMcpAllowRules(servers) {
|
|
22775
22776
|
return (servers ?? []).filter((server) => server.hostOwned === true).map((server) => `mcp__${server.name}`);
|
|
22776
22777
|
}
|
|
22777
|
-
function
|
|
22778
|
-
|
|
22778
|
+
function claudeUsesOfficialChannel(env2) {
|
|
22779
|
+
const connectivity = CLAUDE_CARD.modelConnectivity;
|
|
22780
|
+
const rows = Object.entries(env2).map(([name, value]) => ({ name, value }));
|
|
22781
|
+
if (setsOwnModelConnection({ backendSwitchEnvKeys: connectivity?.backendSwitchEnvKeys }, rows))
|
|
22782
|
+
return false;
|
|
22783
|
+
const key = connectivity?.baseUrlEnvKey;
|
|
22784
|
+
const baseUrl = key === void 0 ? void 0 : env2[key]?.trim();
|
|
22785
|
+
if (baseUrl === void 0 || baseUrl === "") return true;
|
|
22786
|
+
try {
|
|
22787
|
+
const host = new URL(baseUrl).hostname.toLowerCase();
|
|
22788
|
+
return host === "anthropic.com" || host.endsWith(".anthropic.com");
|
|
22789
|
+
} catch {
|
|
22790
|
+
return false;
|
|
22791
|
+
}
|
|
22792
|
+
}
|
|
22793
|
+
var ALLOWLIST_MODE_TOOLS = ["Read", "Edit", "Bash"];
|
|
22794
|
+
function claudeSdkPermission(rules, mode) {
|
|
22795
|
+
if (mode !== "auto") return { mode, allow: rules.read };
|
|
22796
|
+
if (rules.officialChannel) return { mode, allow: [...rules.read, ...rules.hostMcp] };
|
|
22797
|
+
return { mode: "default", allow: [...rules.read, ...rules.hostMcp, ...ALLOWLIST_MODE_TOOLS] };
|
|
22779
22798
|
}
|
|
22780
22799
|
|
|
22781
22800
|
// src/adapter/permissionMode.ts
|
|
22782
22801
|
var sameRules = (a, b3) => a.join("\n") === b3.join("\n");
|
|
22783
22802
|
var permissionAllowInSync = (context) => sameRules(
|
|
22784
|
-
|
|
22803
|
+
claudeSdkPermission(context.permissionRules, context.currentPermissionMode ?? "default").allow,
|
|
22785
22804
|
context.currentPermissionAllow
|
|
22786
22805
|
);
|
|
22787
22806
|
async function applyClaudePermissionMode(context, mode, failAs) {
|
|
22807
|
+
const sdk = claudeSdkPermission(context.permissionRules, mode);
|
|
22788
22808
|
try {
|
|
22789
|
-
await context.query.setPermissionMode(mode);
|
|
22809
|
+
await context.query.setPermissionMode(sdk.mode);
|
|
22790
22810
|
} catch (cause) {
|
|
22791
22811
|
throw toRequestError(failAs.threadId, failAs.method, cause);
|
|
22792
22812
|
}
|
|
22793
22813
|
context.currentPermissionMode = mode;
|
|
22794
|
-
const allow =
|
|
22814
|
+
const allow = sdk.allow;
|
|
22795
22815
|
if (sameRules(allow, context.currentPermissionAllow)) return;
|
|
22796
22816
|
try {
|
|
22797
22817
|
await context.query.applyFlagSettings({
|
|
@@ -23983,9 +24003,19 @@ var makeStartSession = (deps) => {
|
|
|
23983
24003
|
const querySettings = { ...settings };
|
|
23984
24004
|
const permissionRules = {
|
|
23985
24005
|
read: claudeReadAllowRules(input.readOnlyDirectories),
|
|
23986
|
-
hostMcp: claudeHostMcpAllowRules(input.mcpServers)
|
|
24006
|
+
hostMcp: claudeHostMcpAllowRules(input.mcpServers),
|
|
24007
|
+
officialChannel: claudeUsesOfficialChannel(spawnEnvironment.processEnv)
|
|
23987
24008
|
};
|
|
23988
|
-
const
|
|
24009
|
+
const sdkPermission = claudeSdkPermission(permissionRules, permissionMode);
|
|
24010
|
+
const permissionAllow = sdkPermission.allow;
|
|
24011
|
+
if (sdkPermission.mode !== permissionMode) {
|
|
24012
|
+
log.warn("claude.permission.allowlistMode", {
|
|
24013
|
+
threadId: input.threadId,
|
|
24014
|
+
seatMode: permissionMode,
|
|
24015
|
+
sdkMode: sdkPermission.mode,
|
|
24016
|
+
reason: "model requests do not use the official channel; the auto-mode classifier is unavailable"
|
|
24017
|
+
});
|
|
24018
|
+
}
|
|
23989
24019
|
if (permissionAllow.length > 0) {
|
|
23990
24020
|
querySettings.permissions = { allow: [...permissionAllow] };
|
|
23991
24021
|
}
|
|
@@ -24006,7 +24036,7 @@ var makeStartSession = (deps) => {
|
|
|
24006
24036
|
...effectiveEffort ? {
|
|
24007
24037
|
effort: effectiveEffort
|
|
24008
24038
|
} : {},
|
|
24009
|
-
|
|
24039
|
+
permissionMode: sdkPermission.mode,
|
|
24010
24040
|
...permissionMode === "bypassPermissions" ? { allowDangerouslySkipPermissions: true } : {},
|
|
24011
24041
|
...Object.keys(querySettings).length > 0 ? { settings: querySettings } : {},
|
|
24012
24042
|
...existingResumeSessionId ? { resume: existingResumeSessionId } : {},
|
|
@@ -27055,7 +27085,7 @@ import * as NodePath15 from "node:path";
|
|
|
27055
27085
|
// src/usageRead/quota.ts
|
|
27056
27086
|
import * as NodeFS4 from "node:fs";
|
|
27057
27087
|
import * as NodePath12 from "node:path";
|
|
27058
|
-
import { mergeLaunchEnv as mergeLaunchEnv2, setsOwnModelConnection } from "@ycodium-ai/plugin-api/executor";
|
|
27088
|
+
import { mergeLaunchEnv as mergeLaunchEnv2, setsOwnModelConnection as setsOwnModelConnection2 } from "@ycodium-ai/plugin-api/executor";
|
|
27059
27089
|
import {
|
|
27060
27090
|
parseRetryAfterMs
|
|
27061
27091
|
} from "@ycodium-ai/plugin-api/usage";
|
|
@@ -27151,8 +27181,8 @@ var readClaudeQuota = async (request) => {
|
|
|
27151
27181
|
name,
|
|
27152
27182
|
value
|
|
27153
27183
|
}));
|
|
27154
|
-
if (connectivity !== void 0 &&
|
|
27155
|
-
const changesEndpoint =
|
|
27184
|
+
if (connectivity !== void 0 && setsOwnModelConnection2(connectivity, environmentRows)) {
|
|
27185
|
+
const changesEndpoint = setsOwnModelConnection2(
|
|
27156
27186
|
{
|
|
27157
27187
|
baseUrlEnvKey: connectivity.baseUrlEnvKey,
|
|
27158
27188
|
backendSwitchEnvKeys: connectivity.backendSwitchEnvKeys
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-claude",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3114",
|
|
4
4
|
"description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@types/node": "24.12.4",
|
|
25
25
|
"esbuild": "0.28.1",
|
|
26
26
|
"vite-plus": "0.2.2",
|
|
27
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
27
|
+
"@ycodium-ai/plugin-api": "0.2.3114",
|
|
28
28
|
"ycodium-composer-tokens": "0.0.0",
|
|
29
|
-
"ycodium-
|
|
30
|
-
"ycodium-
|
|
29
|
+
"ycodium-executor-testing": "0.0.0",
|
|
30
|
+
"ycodium-jsonl-stream": "0.0.0"
|
|
31
31
|
},
|
|
32
32
|
"ycodium": {
|
|
33
33
|
"plugin": "./dist/index.js",
|