@ycodium-ai/agent-claude 0.2.3484 → 0.2.3488

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.
Files changed (2) hide show
  1. package/dist/index.js +23 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -60,6 +60,8 @@ var CLAUDE_CARD = {
60
60
  reportsSpawnedAgents: true,
61
61
  // 用户点名的技能:最后一个原生 `/name` 派发,更早的读 SKILL.md 内联展开(claudeSkillDispatch.ts)。
62
62
  handlesSkillInvocations: true,
63
+ // 会话的其它文件夹经 `--add-dir` 声明成工作目录,并让 CLI 加载它们的 CLAUDE.md 与规则(workingDirectories.ts)。
64
+ acceptsAdditionalDirectories: true,
63
65
  // 出处:Anthropic Messages API 的视觉文档——单张图片 5 MB、宽高各不超过 8000 像素,超了
64
66
  // API 直接拒掉整轮。5 MB 量的是 base64 之后的长度(SDK 把图片以 base64 块发出),所以
65
67
  // 原始字节上限是它的 3/4。宿主据此把更大的图退化成路径(Claude 自己的 Read 工具会读那个
@@ -25432,6 +25434,19 @@ var makeSessionControls = (deps) => {
25432
25434
  };
25433
25435
  };
25434
25436
 
25437
+ // src/workingDirectories.ts
25438
+ var ADDITIONAL_DIRECTORIES_CLAUDE_MD_ENV = "CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD";
25439
+ function claudeWorkingDirectories(cwd, others) {
25440
+ const hasOthers = (others?.length ?? 0) > 0;
25441
+ return {
25442
+ directories: [...cwd ? [cwd] : [], ...others ?? []],
25443
+ env: hasOthers ? { [ADDITIONAL_DIRECTORIES_CLAUDE_MD_ENV]: "1" } : {}
25444
+ };
25445
+ }
25446
+ function sameWorkingDirectories(previous, next) {
25447
+ return previous.length === next.length && previous.every((directory, i) => directory === next[i]);
25448
+ }
25449
+
25435
25450
  // src/adapter/sessionLifecycle.ts
25436
25451
  var RESULT_CLAIM_WAIT_MS = 1e3;
25437
25452
  var makeSessionLifecycle = (deps) => {
@@ -25575,7 +25590,7 @@ var makeSessionLifecycle = (deps) => {
25575
25590
  context.spawnEnvironment,
25576
25591
  desired.spawnEnvironment
25577
25592
  );
25578
- const reusable = !context.stopped && context.session.status !== "closed" && context.session.cwd === input.cwd && context.session.runtimeMode === input.runtimeMode && context.basePermissionMode === desired.permissionMode && context.launchEffort === desired.effectiveEffort && context.sessionSkills?.pluginDir === input.skills?.pluginDir && (resumeTarget === void 0 || resumeTarget === context.resumeSessionId) && changedEnvironmentKeys.length === 0;
25593
+ const reusable = !context.stopped && context.session.status !== "closed" && context.session.cwd === input.cwd && sameWorkingDirectories(context.additionalDirectories, desired.additionalDirectories) && context.session.runtimeMode === input.runtimeMode && context.basePermissionMode === desired.permissionMode && context.launchEffort === desired.effectiveEffort && context.sessionSkills?.pluginDir === input.skills?.pluginDir && (resumeTarget === void 0 || resumeTarget === context.resumeSessionId) && changedEnvironmentKeys.length === 0;
25579
25594
  if (!reusable) {
25580
25595
  if (changedEnvironmentKeys.length > 0) {
25581
25596
  log.info("claude.session.environment-changed", {
@@ -25910,8 +25925,10 @@ var makeStartSession = (deps) => {
25910
25925
  ultracode,
25911
25926
  autoCompactWindow: recipe.autoCompactWindow
25912
25927
  });
25928
+ const workingDirectories = claudeWorkingDirectories(input.cwd, input.additionalDirectories);
25929
+ const additionalDirectories = workingDirectories.directories;
25913
25930
  const spawnEnvironment = {
25914
- processEnv: compactEnv(buildLaunchEnvironment())
25931
+ processEnv: { ...compactEnv(buildLaunchEnvironment()), ...workingDirectories.env }
25915
25932
  };
25916
25933
  const existingContext = sessions.get(input.threadId);
25917
25934
  if (existingContext) {
@@ -25921,7 +25938,8 @@ var makeStartSession = (deps) => {
25921
25938
  ...effectiveEffort ? { effectiveEffort } : {},
25922
25939
  ...modelSelection?.model ? { model: modelSelection.model } : {},
25923
25940
  settings,
25924
- spawnEnvironment
25941
+ spawnEnvironment,
25942
+ additionalDirectories
25925
25943
  });
25926
25944
  if (reconfigured) {
25927
25945
  return reconfigured;
@@ -25971,7 +25989,6 @@ var makeStartSession = (deps) => {
25971
25989
  contextAfterCompaction: input.contextAfterCompaction,
25972
25990
  log
25973
25991
  });
25974
- const additionalDirectories = input.cwd ? [input.cwd] : [];
25975
25992
  const mcpServers = toClaudeMcpServers(input.mcpServers);
25976
25993
  const querySettings = { ...settings };
25977
25994
  const permissionRules = {
@@ -26045,7 +26062,7 @@ var makeStartSession = (deps) => {
26045
26062
  },
26046
26063
  supportedDialogKinds: ["resume_return"],
26047
26064
  env: { ...spawnEnvironment.processEnv },
26048
- additionalDirectories,
26065
+ additionalDirectories: [...additionalDirectories],
26049
26066
  ...Object.keys(extraArgs).length > 0 ? { extraArgs } : {},
26050
26067
  ...claudeSessionPlugins(input.skills)
26051
26068
  };
@@ -26098,6 +26115,7 @@ var makeStartSession = (deps) => {
26098
26115
  launchEffort: effectiveEffort ?? void 0,
26099
26116
  sessionSkills: input.skills,
26100
26117
  spawnEnvironment,
26118
+ additionalDirectories,
26101
26119
  currentSettings: settings,
26102
26120
  permissionRules,
26103
26121
  currentPermissionAllow: permissionAllow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-claude",
3
- "version": "0.2.3484",
3
+ "version": "0.2.3488",
4
4
  "description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -24,7 +24,7 @@
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.3484",
27
+ "@ycodium-ai/plugin-api": "0.2.3488",
28
28
  "ycodium-composer-tokens": "0.0.0",
29
29
  "ycodium-jsonl-stream": "0.0.0",
30
30
  "ycodium-executor-testing": "0.0.0"