@rayss-dev/openclaude 0.33.3-by-rayss → 0.34.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/acp.mjs CHANGED
@@ -3756,12 +3756,145 @@ function getTeamsDir() {
3756
3756
  function getProjectsDir() {
3757
3757
  return join(getClaudeConfigHomeDir(), "projects");
3758
3758
  }
3759
+ function tokenizeNodeOptions(nodeOptions) {
3760
+ const tokens = [];
3761
+ let isInString = false;
3762
+ let willStartNewArg = true;
3763
+ for (let i = 0;i < nodeOptions.length; i++) {
3764
+ let c = nodeOptions[i];
3765
+ if (c === "\\" && isInString) {
3766
+ if (i + 1 >= nodeOptions.length) {
3767
+ return null;
3768
+ }
3769
+ c = nodeOptions[++i];
3770
+ } else if (c === " " && !isInString) {
3771
+ willStartNewArg = true;
3772
+ continue;
3773
+ } else if (c === '"') {
3774
+ isInString = !isInString;
3775
+ continue;
3776
+ }
3777
+ if (willStartNewArg) {
3778
+ tokens.push(c);
3779
+ willStartNewArg = false;
3780
+ } else {
3781
+ tokens[tokens.length - 1] += c;
3782
+ }
3783
+ }
3784
+ if (isInString) {
3785
+ return null;
3786
+ }
3787
+ return tokens;
3788
+ }
3789
+ function resolveNodeOption(name, hasInlineValue) {
3790
+ if (hasInlineValue) {
3791
+ const inlineAlias = NODE_INLINE_OPTION_ALIASES.get(`${name}=`);
3792
+ if (inlineAlias) {
3793
+ return {
3794
+ role: NODE_OPTION_ROLES.get(inlineAlias[0]) ?? "boolean",
3795
+ names: [name, ...inlineAlias]
3796
+ };
3797
+ }
3798
+ }
3799
+ const alias = NODE_OPTION_ALIASES.get(name);
3800
+ if (alias) {
3801
+ return {
3802
+ role: NODE_OPTION_ROLES.get(alias[0]) ?? "boolean",
3803
+ names: [name, ...alias]
3804
+ };
3805
+ }
3806
+ return { role: NODE_OPTION_ROLES.get(name) ?? "boolean", names: [name] };
3807
+ }
3808
+ function parseNodeOptions(nodeOptions) {
3809
+ const tokens = tokenizeNodeOptions(nodeOptions);
3810
+ if (!tokens) {
3811
+ return { valid: false, options: [] };
3812
+ }
3813
+ const options = [];
3814
+ let index = 0;
3815
+ while (index < tokens.length) {
3816
+ const token = tokens[index];
3817
+ index += 1;
3818
+ if (token.length <= 1 || token[0] !== "-") {
3819
+ break;
3820
+ }
3821
+ if (token === "--") {
3822
+ return { valid: false, options: [] };
3823
+ }
3824
+ const equalsIndex = token.startsWith("--") ? token.indexOf("=") : -1;
3825
+ const name = equalsIndex === -1 ? token : token.slice(0, equalsIndex);
3826
+ const inlineValue = equalsIndex === -1 ? undefined : token.slice(equalsIndex + 1);
3827
+ let optionName = name;
3828
+ let negated = false;
3829
+ if (optionName.startsWith("--no-")) {
3830
+ optionName = `--${optionName.slice("--no-".length)}`;
3831
+ negated = true;
3832
+ }
3833
+ const { role, names } = resolveNodeOption(optionName, equalsIndex !== -1);
3834
+ if (negated && role !== "boolean") {
3835
+ return { valid: false, options: [] };
3836
+ }
3837
+ switch (role) {
3838
+ case "boolean":
3839
+ break;
3840
+ case "value": {
3841
+ if (inlineValue !== undefined) {
3842
+ if (inlineValue === "") {
3843
+ return { valid: false, options: [] };
3844
+ }
3845
+ break;
3846
+ }
3847
+ const next = tokens[index];
3848
+ if (next === undefined || next.startsWith("-")) {
3849
+ return { valid: false, options: [] };
3850
+ }
3851
+ index += 1;
3852
+ break;
3853
+ }
3854
+ case "inline-value": {
3855
+ if (inlineValue === undefined) {
3856
+ return { valid: false, options: [] };
3857
+ }
3858
+ break;
3859
+ }
3860
+ case "inline-required": {
3861
+ if (inlineValue === undefined || inlineValue === "") {
3862
+ return { valid: false, options: [] };
3863
+ }
3864
+ break;
3865
+ }
3866
+ }
3867
+ const recorded = new Set;
3868
+ for (const occurrenceName of names) {
3869
+ if (recorded.has(occurrenceName)) {
3870
+ continue;
3871
+ }
3872
+ recorded.add(occurrenceName);
3873
+ options.push({ name: occurrenceName, negated });
3874
+ }
3875
+ }
3876
+ return { valid: true, options };
3877
+ }
3759
3878
  function hasNodeOption(flag) {
3760
3879
  const nodeOptions = process.env.NODE_OPTIONS;
3761
3880
  if (!nodeOptions) {
3762
3881
  return false;
3763
3882
  }
3764
- return nodeOptions.split(/\s+/).includes(flag);
3883
+ const parsed = parseNodeOptions(nodeOptions);
3884
+ if (!parsed.valid) {
3885
+ return false;
3886
+ }
3887
+ const negatedQuery = flag.startsWith("--no-");
3888
+ const optionName = negatedQuery ? `--${flag.slice("--no-".length)}` : flag;
3889
+ let enabled = false;
3890
+ let seen = false;
3891
+ for (const option of parsed.options) {
3892
+ if (option.name === optionName) {
3893
+ enabled = !option.negated;
3894
+ seen = true;
3895
+ }
3896
+ }
3897
+ return negatedQuery ? seen && !enabled : enabled;
3765
3898
  }
3766
3899
  function isEnvTruthy(envVar) {
3767
3900
  if (!envVar)
@@ -3796,6 +3929,21 @@ function shouldMaintainProjectWorkingDir() {
3796
3929
  function isRunningOnHomespace() {
3797
3930
  return process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.COO_RUNNING_ON_HOMESPACE);
3798
3931
  }
3932
+ function getEnvNumber(key, defaultValue) {
3933
+ const value = process.env[key];
3934
+ if (value === undefined) {
3935
+ return defaultValue;
3936
+ }
3937
+ const trimmed = value.trim();
3938
+ if (!/^(0|[1-9]\d*)$/.test(trimmed)) {
3939
+ return defaultValue;
3940
+ }
3941
+ const parsed = Number.parseInt(trimmed, 10);
3942
+ if (!Number.isSafeInteger(parsed) || parsed <= 0) {
3943
+ return defaultValue;
3944
+ }
3945
+ return parsed;
3946
+ }
3799
3947
  function isInProtectedNamespace() {
3800
3948
  if (process.env.USER_TYPE === "ant") {
3801
3949
  return (init_protectedNamespace(), __toCommonJS(exports_protectedNamespace)).checkProtectedNamespace();
@@ -3811,7 +3959,7 @@ function getVertexRegionForModel(model) {
3811
3959
  }
3812
3960
  return getDefaultVertexRegion();
3813
3961
  }
3814
- var claudeConfigHomeDirOverride, getDefaultClaudeConfigHomeDir, getClaudeConfigHomeDir, VERTEX_REGION_OVERRIDES;
3962
+ var claudeConfigHomeDirOverride, getDefaultClaudeConfigHomeDir, getClaudeConfigHomeDir, NODE_OPTION_ROLES, NODE_OPTION_ALIASES, NODE_INLINE_OPTION_ALIASES, VERTEX_REGION_OVERRIDES;
3815
3963
  var init_envUtils = __esm(() => {
3816
3964
  init_memoize();
3817
3965
  getDefaultClaudeConfigHomeDir = memoize_default(() => {
@@ -3832,6 +3980,89 @@ var init_envUtils = __esm(() => {
3832
3980
  }
3833
3981
  return getDefaultClaudeConfigHomeDir();
3834
3982
  }, { cache: getDefaultClaudeConfigHomeDir.cache });
3983
+ NODE_OPTION_ROLES = new Map([
3984
+ ["--max-old-space-size", "inline-value"],
3985
+ ["--max-semi-space-size", "inline-value"],
3986
+ ["--stack-trace-limit", "inline-required"],
3987
+ ["--allow-fs-read", "value"],
3988
+ ["--allow-fs-write", "value"],
3989
+ ["--conditions", "value"],
3990
+ ["-C", "value"],
3991
+ ["--cpu-prof-dir", "value"],
3992
+ ["--cpu-prof-interval", "value"],
3993
+ ["--cpu-prof-name", "value"],
3994
+ ["--debug-port", "value"],
3995
+ ["--diagnostic-dir", "value"],
3996
+ ["--disable-proto", "value"],
3997
+ ["--disable-warning", "value"],
3998
+ ["--dns-result-order", "value"],
3999
+ ["--experimental-default-type", "value"],
4000
+ ["--experimental-loader", "value"],
4001
+ ["--heap-prof-dir", "value"],
4002
+ ["--heap-prof-interval", "value"],
4003
+ ["--heap-prof-name", "value"],
4004
+ ["--heapsnapshot-near-heap-limit", "value"],
4005
+ ["--heapsnapshot-signal", "value"],
4006
+ ["--icu-data-dir", "value"],
4007
+ ["--import", "value"],
4008
+ ["--input-type", "value"],
4009
+ ["--inspect-port", "value"],
4010
+ ["--inspect-publish-uid", "value"],
4011
+ ["--loader", "value"],
4012
+ ["--localstorage-file", "value"],
4013
+ ["--max-http-header-size", "value"],
4014
+ ["--max-old-space-size-percentage", "value"],
4015
+ ["--network-family-autoselection-attempt-timeout", "value"],
4016
+ ["--openssl-config", "value"],
4017
+ ["--redirect-warnings", "value"],
4018
+ ["--report-dir", "value"],
4019
+ ["--report-directory", "value"],
4020
+ ["--report-filename", "value"],
4021
+ ["--report-signal", "value"],
4022
+ ["--require", "value"],
4023
+ ["-r", "value"],
4024
+ ["--secure-heap", "value"],
4025
+ ["--secure-heap-min", "value"],
4026
+ ["--snapshot-blob", "value"],
4027
+ ["--test-coverage-branches", "value"],
4028
+ ["--test-coverage-exclude", "value"],
4029
+ ["--test-coverage-functions", "value"],
4030
+ ["--test-coverage-include", "value"],
4031
+ ["--test-coverage-lines", "value"],
4032
+ ["--test-global-setup", "value"],
4033
+ ["--test-isolation", "value"],
4034
+ ["--test-name-pattern", "value"],
4035
+ ["--test-reporter", "value"],
4036
+ ["--test-reporter-destination", "value"],
4037
+ ["--test-rerun-failures", "value"],
4038
+ ["--test-shard", "value"],
4039
+ ["--test-skip-pattern", "value"],
4040
+ ["--title", "value"],
4041
+ ["--tls-cipher-list", "value"],
4042
+ ["--tls-keylog", "value"],
4043
+ ["--trace-event-categories", "value"],
4044
+ ["--trace-event-file-pattern", "value"],
4045
+ ["--trace-require-module", "value"],
4046
+ ["--unhandled-rejections", "value"],
4047
+ ["--use-largepages", "value"],
4048
+ ["--v8-pool-size", "value"],
4049
+ ["--watch-kill-signal", "value"],
4050
+ ["--watch-path", "value"]
4051
+ ]);
4052
+ NODE_OPTION_ALIASES = new Map([
4053
+ ["-C", ["--conditions"]],
4054
+ ["-r", ["--require"]],
4055
+ ["--debug-port", ["--inspect-port"]],
4056
+ ["--loader", ["--experimental-loader"]],
4057
+ ["--report-directory", ["--report-dir"]],
4058
+ ["--experimental-test-isolation", ["--test-isolation"]]
4059
+ ]);
4060
+ NODE_INLINE_OPTION_ALIASES = new Map([
4061
+ ["--inspect=", ["--inspect-port", "--inspect"]],
4062
+ ["--inspect-brk=", ["--inspect-port", "--inspect-brk"]],
4063
+ ["--inspect-brk-node=", ["--inspect-port", "--inspect-brk-node"]],
4064
+ ["--inspect-wait=", ["--inspect-port", "--inspect-wait"]]
4065
+ ]);
3835
4066
  VERTEX_REGION_OVERRIDES = [
3836
4067
  ["claude-haiku-4-5", "VERTEX_REGION_CLAUDE_HAIKU_4_5"],
3837
4068
  ["claude-3-5-haiku", "VERTEX_REGION_CLAUDE_3_5_HAIKU"],
@@ -10106,14 +10337,14 @@ function getReleaseTagUrl(version = publicBuildVersion) {
10106
10337
  return `${OPENCLAUDE_RELEASES_URL}/tag/v${normalizePublicVersion(version)}`;
10107
10338
  }
10108
10339
  function getPublicBuildVersion() {
10109
- return "0.33.3-by-rayss";
10340
+ return "0.34.0";
10110
10341
  }
10111
10342
  var import_semver, OPENCLAUDE_RELEASES_URL = "https://github.com/rayss868/openclaude/releases", fallbackBuildVersion, publicBuildVersion;
10112
10343
  var init_version = __esm(() => {
10113
10344
  import_semver = __toESM(require_semver2(), 1);
10114
10345
  fallbackBuildVersion = (() => {
10115
10346
  try {
10116
- return "0.33.3-by-rayss";
10347
+ return "0.34.0";
10117
10348
  } catch {
10118
10349
  return "0.0.0";
10119
10350
  }
@@ -101130,7 +101361,7 @@ function createHttpsProxyAgent(proxyUrl, extra = {}) {
101130
101361
  callback(null, hostname2, getAddressFamily(options));
101131
101362
  };
101132
101363
  }
101133
- return new import_https_proxy_agent.HttpsProxyAgent(proxyUrl, { ...agentOptions, ...extra });
101364
+ return new TargetTLSHttpsProxyAgent(proxyUrl, { ...agentOptions, ...extra });
101134
101365
  }
101135
101366
  function getWebSocketProxyAgent(url3) {
101136
101367
  const proxyUrl = getProxyUrl();
@@ -101227,7 +101458,7 @@ async function getAWSClientProxyConfig() {
101227
101458
  })
101228
101459
  };
101229
101460
  }
101230
- var import_https_proxy_agent, keepAliveDisabled, getProxyAgent, proxyInterceptorId;
101461
+ var import_https_proxy_agent, keepAliveDisabled, TargetTLSHttpsProxyAgent, getProxyAgent, proxyInterceptorId;
101231
101462
  var init_proxy = __esm(() => {
101232
101463
  init_axios2();
101233
101464
  init_memoize();
@@ -101238,6 +101469,17 @@ var init_proxy = __esm(() => {
101238
101469
  init_optionalRuntimeModule();
101239
101470
  import_https_proxy_agent = __toESM(require_dist3(), 1);
101240
101471
  keepAliveDisabled = isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_KEEPALIVE);
101472
+ TargetTLSHttpsProxyAgent = class TargetTLSHttpsProxyAgent extends import_https_proxy_agent.HttpsProxyAgent {
101473
+ targetTLSOptions;
101474
+ constructor(proxyUrl, options) {
101475
+ super(proxyUrl, options);
101476
+ const { ca, cert, key, passphrase } = options;
101477
+ this.targetTLSOptions = { ca, cert, key, passphrase };
101478
+ }
101479
+ connect(...[req, opts]) {
101480
+ return super.connect(req, { ...this.targetTLSOptions, ...opts });
101481
+ }
101482
+ };
101241
101483
  getProxyAgent = memoize_default((uri) => {
101242
101484
  const undiciMod = require_undici();
101243
101485
  const mtlsConfig = getMTLSConfig();
@@ -110969,7 +111211,7 @@ var init_metadata = __esm(() => {
110969
111211
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
110970
111212
  WHITESPACE_REGEX = /\s+/;
110971
111213
  getVersionBase = memoize_default(() => {
110972
- const match = "0.33.3-by-rayss".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
111214
+ const match = "0.34.0".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
110973
111215
  return match ? match[0] : undefined;
110974
111216
  });
110975
111217
  buildEnvContext = memoize_default(async () => {
@@ -111009,9 +111251,9 @@ var init_metadata = __esm(() => {
111009
111251
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
111010
111252
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
111011
111253
  isClaudeAiAuth: isClaudeAISubscriber(),
111012
- version: "0.33.3-by-rayss",
111254
+ version: "0.34.0",
111013
111255
  versionBase: getVersionBase(),
111014
- buildTime: "2026-10-28T03:21:39.519Z",
111256
+ buildTime: "2026-11-08T14:26:41.014Z",
111015
111257
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
111016
111258
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
111017
111259
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -164704,50 +164946,6 @@ var init_doomLoop = __esm(() => {
164704
164946
  stateByAgent = new Map;
164705
164947
  });
164706
164948
 
164707
- // src/utils/toolErrorRepeats.ts
164708
- function getState2(agentKey) {
164709
- let state2 = stateByAgent2.get(agentKey);
164710
- if (!state2) {
164711
- state2 = { lastTool: null, lastError: null, count: 0 };
164712
- stateByAgent2.set(agentKey, state2);
164713
- }
164714
- return state2;
164715
- }
164716
- function normalizeText(text) {
164717
- return text.replace(/\s+/g, " ").replace(/\d+/g, "#").trim();
164718
- }
164719
- function buildNudge(count3) {
164720
- return `
164721
- <system-reminder>This is the ${count3}th consecutive failure of this tool with the same error. Do not simply retry — pause, re-read the original request and the error above, then adjust your approach.</system-reminder>`;
164722
- }
164723
- function recordRepeatedToolError(agentKey, toolName, errorText) {
164724
- const state2 = getState2(agentKey);
164725
- const normalized = normalizeText(errorText);
164726
- if (state2.lastTool === toolName && state2.lastError === normalized) {
164727
- state2.count++;
164728
- } else {
164729
- state2.lastTool = toolName;
164730
- state2.lastError = normalized;
164731
- state2.count = 1;
164732
- }
164733
- if (state2.count >= DEFAULT_THRESHOLD2) {
164734
- return { count: state2.count, nudge: buildNudge(state2.count) };
164735
- }
164736
- return { count: state2.count };
164737
- }
164738
- function resetToolErrorRepeats(agentKey, toolName) {
164739
- const state2 = stateByAgent2.get(agentKey);
164740
- if (state2 && state2.lastTool === toolName) {
164741
- state2.lastTool = null;
164742
- state2.lastError = null;
164743
- state2.count = 0;
164744
- }
164745
- }
164746
- var DEFAULT_THRESHOLD2 = 3, stateByAgent2;
164747
- var init_toolErrorRepeats = __esm(() => {
164748
- stateByAgent2 = new Map;
164749
- });
164750
-
164751
164949
  // src/utils/stream.ts
164752
164950
  var Stream2;
164753
164951
  var init_stream2 = __esm(() => {
@@ -170558,6 +170756,7 @@ var init_boundedAsync = __esm(() => {
170558
170756
  });
170559
170757
 
170560
170758
  // src/services/mcp/oauthPort.ts
170759
+ import { randomInt as randomInt2 } from "crypto";
170561
170760
  import { createServer as createServer2 } from "http";
170562
170761
  function buildRedirectUri(port = REDIRECT_PORT_FALLBACK) {
170563
170762
  return `http://localhost:${port}/callback`;
@@ -170575,7 +170774,7 @@ async function findAvailablePort() {
170575
170774
  const range = max2 - min + 1;
170576
170775
  const maxAttempts = Math.min(range, 100);
170577
170776
  for (let attempt = 0;attempt < maxAttempts; attempt++) {
170578
- const port = min + Math.floor(Math.random() * range);
170777
+ const port = randomInt2(min, max2 + 1);
170579
170778
  try {
170580
170779
  await new Promise((resolve23, reject) => {
170581
170780
  const testServer = createServer2();
@@ -174762,57 +174961,6 @@ var init_ReadMcpResourceTool = __esm(() => {
174762
174961
  });
174763
174962
  });
174764
174963
 
174765
- // src/services/mcp/argCoercion.ts
174766
- function coerceValue(value, schema) {
174767
- if (value === null || value === undefined || !schema) {
174768
- return value;
174769
- }
174770
- const type = schema.type;
174771
- if (type === "integer" || type === "number") {
174772
- if (typeof value === "string" && value.trim() !== "") {
174773
- const parsed = Number(value);
174774
- if (Number.isFinite(parsed)) {
174775
- return parsed;
174776
- }
174777
- }
174778
- return value;
174779
- }
174780
- if (type === "boolean") {
174781
- if (value === "true")
174782
- return true;
174783
- if (value === "false")
174784
- return false;
174785
- return value;
174786
- }
174787
- if (type === "object" && typeof value === "object" && value !== null && !Array.isArray(value)) {
174788
- const props = schema.properties;
174789
- if (!props)
174790
- return value;
174791
- const out = {};
174792
- for (const [key, v] of Object.entries(value)) {
174793
- out[key] = coerceValue(v, props[key]);
174794
- }
174795
- return out;
174796
- }
174797
- if (type === "array" && Array.isArray(value)) {
174798
- if (!schema.items)
174799
- return value;
174800
- return value.map((item) => coerceValue(item, schema.items));
174801
- }
174802
- return value;
174803
- }
174804
- function coerceArgsToInputSchema(args, inputSchema7) {
174805
- if (!inputSchema7 || typeof inputSchema7 !== "object" || !inputSchema7.properties) {
174806
- return args;
174807
- }
174808
- const props = inputSchema7.properties;
174809
- const out = {};
174810
- for (const [key, value] of Object.entries(args)) {
174811
- out[key] = coerceValue(value, props[key]);
174812
- }
174813
- return out;
174814
- }
174815
-
174816
174964
  // src/utils/codeIndexing.ts
174817
174965
  function detectCodeIndexingFromCommand(command) {
174818
174966
  const trimmed = command.trim();
@@ -174894,11 +175042,11 @@ var init_codeIndexing = __esm(() => {
174894
175042
 
174895
175043
  // src/utils/userAgent.ts
174896
175044
  function getClaudeCodeUserAgent() {
174897
- return `claude-code/${"0.33.3-by-rayss"}`;
175045
+ return `claude-code/${"0.34.0"}`;
174898
175046
  }
174899
175047
  function getOpenClaudeUserAgent() {
174900
175048
  try {
174901
- return `openclaude/${"0.33.3-by-rayss"}`;
175049
+ return `openclaude/${"0.34.0"}`;
174902
175050
  } catch {
174903
175051
  return "openclaude/0.0.0";
174904
175052
  }
@@ -174920,7 +175068,7 @@ function getUserAgent() {
174920
175068
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
174921
175069
  const workload = getWorkload();
174922
175070
  const workloadSuffix = workload ? `, workload/${workload}` : "";
174923
- return `claude-cli/${"0.33.3-by-rayss"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
175071
+ return `claude-cli/${"0.34.0"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
174924
175072
  }
174925
175073
  function getMCPUserAgent() {
174926
175074
  const parts = [];
@@ -174934,7 +175082,7 @@ function getMCPUserAgent() {
174934
175082
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
174935
175083
  }
174936
175084
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
174937
- return `claude-code/${"0.33.3-by-rayss"}${suffix}`;
175085
+ return `claude-code/${"0.34.0"}${suffix}`;
174938
175086
  }
174939
175087
  function getWebFetchUserAgent() {
174940
175088
  const supportUrl = isFirstPartyAnthropicProvider() ? "https://support.anthropic.com/" : "https://github.com/rayss868/openclaude";
@@ -180009,7 +180157,7 @@ function getAttributionHeader(fingerprint, policy) {
180009
180157
  if (!policy.generate) {
180010
180158
  return "";
180011
180159
  }
180012
- const version2 = `${"0.33.3-by-rayss"}.${fingerprint}`;
180160
+ const version2 = `${"0.34.0"}.${fingerprint}`;
180013
180161
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
180014
180162
  const cch = "";
180015
180163
  const workload = getWorkload();
@@ -183093,11 +183241,13 @@ function createRequestBodyPlanner(context) {
183093
183241
  options.temperature = params.temperature;
183094
183242
  if (params.top_p !== undefined)
183095
183243
  options.top_p = params.top_p;
183244
+ const think = request.reasoning?.effort ? ["xhigh", "max", "ultracode"].includes(request.reasoning.effort) ? "high" : request.reasoning.effort : false;
183096
183245
  return {
183097
183246
  model: request.resolvedModel,
183098
183247
  messages: normalizeOllamaNativeMessages(body.messages),
183099
183248
  stream: params.stream ?? false,
183100
183249
  options,
183250
+ think,
183101
183251
  ...body.tools ? { tools: body.tools } : {}
183102
183252
  };
183103
183253
  };
@@ -184034,10 +184184,8 @@ function convertOllamaStreamingResponse(response, fallbackModel, makeMessageId2
184034
184184
  buffer = lines.pop() ?? "";
184035
184185
  let emitted = false;
184036
184186
  for (const line of lines)
184037
- if (line.trim()) {
184038
- enqueue(line.trim(), controller);
184187
+ if (line.trim() && enqueue(line.trim(), controller))
184039
184188
  emitted = true;
184040
- }
184041
184189
  if (emitted)
184042
184190
  return;
184043
184191
  }
@@ -184051,7 +184199,7 @@ function convertOllamaStreamingResponse(response, fallbackModel, makeMessageId2
184051
184199
  try {
184052
184200
  data = JSON.parse(line);
184053
184201
  } catch {
184054
- return;
184202
+ return false;
184055
184203
  }
184056
184204
  const model = data.model ?? fallbackModel;
184057
184205
  const chunks = [];
@@ -184077,6 +184225,7 @@ function convertOllamaStreamingResponse(response, fallbackModel, makeMessageId2
184077
184225
  }
184078
184226
  for (const chunk of chunks)
184079
184227
  controller.enqueue(encoder.encode(chunk));
184228
+ return chunks.length > 0;
184080
184229
  }
184081
184230
  return responseWithPreservedUrl(stream4, { status: response.status, statusText: response.statusText, headers: { "content-type": "text/event-stream" } }, response.url);
184082
184231
  }
@@ -184713,6 +184862,13 @@ function convertNonStreamingResponseToAnthropicMessage(data, model, deps) {
184713
184862
  content.push({ type: "text", text: `
184714
184863
 
184715
184864
  [Content blocked by provider safety filter]` });
184865
+ } else if (choice?.finish_reason === "length") {
184866
+ content.push({
184867
+ type: "text",
184868
+ text: `
184869
+
184870
+ [Response truncated — reached length limit or upstream stalled. Ask the model to continue.]`
184871
+ });
184716
184872
  }
184717
184873
  return {
184718
184874
  id: data.id ?? deps.makeMessageId(),
@@ -184754,8 +184910,290 @@ function getStreamStats(state2) {
184754
184910
  };
184755
184911
  }
184756
184912
 
184913
+ // src/services/api/openaiShim/xmlToolCallParsing.ts
184914
+ function coerceXmlToolValue(raw) {
184915
+ const trimmed = raw.trim();
184916
+ if (trimmed === "")
184917
+ return "";
184918
+ try {
184919
+ return JSON.parse(trimmed);
184920
+ } catch {
184921
+ return raw;
184922
+ }
184923
+ }
184924
+ function parseHy3ToolCallInner(inner) {
184925
+ const args = {};
184926
+ const trimmed = inner.trim();
184927
+ const name = trimmed.split(/[\n<]/, 1)[0]?.trim().replace(/[\s`*_]+$/, "");
184928
+ let hasStructuredArguments = false;
184929
+ for (const parameter of inner.matchAll(HY3_PARAMETER_RE)) {
184930
+ const key = parameter[1];
184931
+ if (key) {
184932
+ hasStructuredArguments = true;
184933
+ args[key] = coerceXmlToolValue(parameter[2] ?? "");
184934
+ }
184935
+ }
184936
+ for (const line of inner.matchAll(HY3_NAMED_ARGUMENT_LINE_RE)) {
184937
+ const key = line[1];
184938
+ if (key) {
184939
+ hasStructuredArguments = true;
184940
+ args[key] = coerceXmlToolValue(line[2] ?? "");
184941
+ }
184942
+ }
184943
+ for (const pair of inner.matchAll(HY3_ARG_PAIR_RE)) {
184944
+ const key = pair[1]?.trim();
184945
+ if (key) {
184946
+ hasStructuredArguments = true;
184947
+ args[key] = coerceXmlToolValue(pair[2] ?? "");
184948
+ }
184949
+ }
184950
+ return {
184951
+ name: name && /^[A-Za-z_][\w.-]*$/.test(name) && (hasStructuredArguments || trimmed === name) ? name : undefined,
184952
+ args
184953
+ };
184954
+ }
184955
+ function isHy3Model(model) {
184956
+ return model.split("?", 1)[0]?.toLowerCase() === "tencent/hy3";
184957
+ }
184958
+ function trailingXmlOpenerPrefixLen(s, allowHy3) {
184959
+ let longest = 0;
184960
+ const openers = allowHy3 ? XML_TOOL_CALL_OPENERS : [XML_TOOL_CALL_OPEN];
184961
+ for (const opener of openers) {
184962
+ const max2 = Math.min(s.length, opener.length - 1);
184963
+ for (let len = max2;len > 0; len--) {
184964
+ if (opener.startsWith(s.slice(s.length - len))) {
184965
+ longest = Math.max(longest, len);
184966
+ break;
184967
+ }
184968
+ }
184969
+ }
184970
+ return longest;
184971
+ }
184972
+ function findXmlToolCallOpener(text, allowHy3) {
184973
+ const openers = allowHy3 ? XML_TOOL_CALL_OPENERS : [XML_TOOL_CALL_OPEN];
184974
+ return openers.reduce((first, opener) => {
184975
+ const index = text.indexOf(opener);
184976
+ return index === -1 ? first : first === -1 ? index : Math.min(first, index);
184977
+ }, -1);
184978
+ }
184979
+ function isJsonText(raw) {
184980
+ try {
184981
+ JSON.parse(raw);
184982
+ return true;
184983
+ } catch {
184984
+ return false;
184985
+ }
184986
+ }
184987
+ function findJsonEnvelopeBody(text, bodyStart) {
184988
+ const firstClose = text.indexOf(XML_TOOL_CALL_CLOSE, bodyStart);
184989
+ const jsonStart = text.indexOf("{", bodyStart);
184990
+ if (jsonStart === -1 || firstClose !== -1 && jsonStart > firstClose)
184991
+ return null;
184992
+ const lead = text.slice(bodyStart, jsonStart);
184993
+ if (XML_FUNCTION_NAME_RE.test(lead) || lead.includes(XML_ARG_KEY_OPEN))
184994
+ return null;
184995
+ const json2 = extractBalancedJson(text, jsonStart);
184996
+ if (!json2 || !isJsonText(json2))
184997
+ return null;
184998
+ const jsonEnd = jsonStart + json2.length;
184999
+ const closeIndex = text.indexOf(XML_TOOL_CALL_CLOSE, jsonEnd);
185000
+ return closeIndex === -1 ? { json: [jsonStart, jsonEnd], bodyEnd: text.length, end: text.length } : { json: [jsonStart, jsonEnd], bodyEnd: closeIndex, end: closeIndex + XML_TOOL_CALL_CLOSE.length };
185001
+ }
185002
+ function xmlToolCallBlockMarkup(block) {
185003
+ if (!block.startsWith(XML_TOOL_CALL_OPEN))
185004
+ return block;
185005
+ const envelope = findJsonEnvelopeBody(block, XML_TOOL_CALL_OPEN.length);
185006
+ if (envelope?.end !== block.length)
185007
+ return block;
185008
+ return block.slice(0, envelope.json[0]) + block.slice(envelope.json[1]);
185009
+ }
185010
+ function findStandardXmlToolCallBlocks(text) {
185011
+ const blocks = [];
185012
+ let start = text.indexOf(XML_TOOL_CALL_OPEN);
185013
+ while (start !== -1) {
185014
+ const bodyStart = start + XML_TOOL_CALL_OPEN.length;
185015
+ const envelope = findJsonEnvelopeBody(text, bodyStart);
185016
+ let end;
185017
+ if (envelope) {
185018
+ end = envelope.end;
185019
+ blocks.push({
185020
+ range: [start, end],
185021
+ inner: text.slice(bodyStart, envelope.bodyEnd),
185022
+ json: text.slice(envelope.json[0], envelope.json[1])
185023
+ });
185024
+ } else {
185025
+ const closeIndex = text.indexOf(XML_TOOL_CALL_CLOSE, bodyStart);
185026
+ const bodyEnd = closeIndex === -1 ? text.length : closeIndex;
185027
+ end = closeIndex === -1 ? text.length : closeIndex + XML_TOOL_CALL_CLOSE.length;
185028
+ blocks.push({ range: [start, end], inner: text.slice(bodyStart, bodyEnd) });
185029
+ }
185030
+ start = text.indexOf(XML_TOOL_CALL_OPEN, end);
185031
+ }
185032
+ return blocks;
185033
+ }
185034
+ function findXmlToolCallBlockRanges(text, allowHy3 = false) {
185035
+ const ranges = findStandardXmlToolCallBlocks(text).map((block) => block.range);
185036
+ if (allowHy3) {
185037
+ for (const blockRe of [HY3_TOOL_CALLS_BLOCK_RE, HY3_TOOL_CALL_BLOCK_RE]) {
185038
+ for (const block of text.matchAll(blockRe)) {
185039
+ ranges.push([block.index, block.index + block[0].length]);
185040
+ }
185041
+ }
185042
+ }
185043
+ return ranges.sort((left, right) => left[0] - right[0] || right[1] - left[1]);
185044
+ }
185045
+ function parseStandardXmlToolCallInner(inner, envelopeJson) {
185046
+ let name;
185047
+ const args = {};
185048
+ const trimmedInner = inner.trim();
185049
+ const isJsonEnvelope = envelopeJson !== undefined;
185050
+ const fnMatch = isJsonEnvelope ? null : inner.match(XML_FUNCTION_NAME_RE);
185051
+ if (fnMatch) {
185052
+ name = fnMatch[1];
185053
+ for (const p of inner.matchAll(XML_PARAMETER_RE)) {
185054
+ const key = p[1];
185055
+ if (key)
185056
+ args[key] = coerceXmlToolValue(p[2] ?? "");
185057
+ }
185058
+ } else {
185059
+ const argPairs = [...inner.matchAll(XML_ARG_PAIR_RE)];
185060
+ if (argPairs.length > 0 && !isJsonEnvelope && !trimmedInner.startsWith("{")) {
185061
+ const nameTok = trimmedInner.split(/[\n<]/, 1)[0]?.trim();
185062
+ if (nameTok)
185063
+ name = nameTok;
185064
+ for (const p of argPairs) {
185065
+ const key = (p[1] ?? "").trim();
185066
+ if (key)
185067
+ args[key] = coerceXmlToolValue(p[2] ?? "");
185068
+ }
185069
+ } else if (isJsonEnvelope) {
185070
+ const obj = JSON.parse(envelopeJson);
185071
+ if (typeof obj["name"] === "string") {
185072
+ name = obj["name"];
185073
+ const rawArgs = obj["arguments"];
185074
+ if (typeof rawArgs === "string") {
185075
+ try {
185076
+ Object.assign(args, JSON.parse(rawArgs));
185077
+ } catch {}
185078
+ } else if (rawArgs && typeof rawArgs === "object") {
185079
+ Object.assign(args, rawArgs);
185080
+ }
185081
+ }
185082
+ }
185083
+ }
185084
+ return { name, args };
185085
+ }
185086
+ function parseXmlToolCalls(text, allowHy3, nextSequence) {
185087
+ const results = [];
185088
+ const seen = new Set;
185089
+ const ranges = [];
185090
+ const addCall = (name, args) => {
185091
+ const dedupKey = `${name}:${JSON.stringify(args)}`;
185092
+ if (seen.has(dedupKey))
185093
+ return;
185094
+ seen.add(dedupKey);
185095
+ results.push({ id: `xml_tc_${nextSequence()}`, name, arguments: args });
185096
+ };
185097
+ const hy3Blocks = allowHy3 ? [...text.matchAll(HY3_TOOL_CALL_BLOCK_RE)].map((block) => ({
185098
+ range: [block.index, block.index + block[0].length],
185099
+ parsed: parseHy3ToolCallInner(block[1] ?? "")
185100
+ })) : [];
185101
+ const hy3WrapperRanges = allowHy3 ? [...text.matchAll(HY3_TOOL_CALLS_BLOCK_RE)].filter((wrapper) => {
185102
+ const range = [
185103
+ wrapper.index,
185104
+ wrapper.index + wrapper[0].length
185105
+ ];
185106
+ return hy3Blocks.some((block) => block.parsed.name && range[0] <= block.range[0] && block.range[1] <= range[1]);
185107
+ }).map((wrapper) => [
185108
+ wrapper.index,
185109
+ wrapper.index + wrapper[0].length
185110
+ ]) : [];
185111
+ const candidates = [];
185112
+ for (const block of hy3Blocks) {
185113
+ const { name, args } = block.parsed;
185114
+ if (!name)
185115
+ continue;
185116
+ const range = block.range;
185117
+ candidates.push({
185118
+ range,
185119
+ name,
185120
+ args,
185121
+ coveredByWrapper: hy3WrapperRanges.some((wrapper) => wrapper[0] <= range[0] && range[1] <= wrapper[1])
185122
+ });
185123
+ }
185124
+ for (const { range, inner, json: json2 } of findStandardXmlToolCallBlocks(text)) {
185125
+ const { name, args } = parseStandardXmlToolCallInner(inner, json2);
185126
+ if (!name)
185127
+ continue;
185128
+ candidates.push({
185129
+ range,
185130
+ name,
185131
+ args,
185132
+ coveredByWrapper: false
185133
+ });
185134
+ }
185135
+ candidates.sort((left, right) => left.range[0] - right.range[0]);
185136
+ for (const candidate of candidates) {
185137
+ addCall(candidate.name, candidate.args);
185138
+ if (!candidate.coveredByWrapper) {
185139
+ ranges.push(candidate.range);
185140
+ }
185141
+ }
185142
+ ranges.push(...hy3WrapperRanges);
185143
+ ranges.sort((left, right) => left[0] - right[0]);
185144
+ return { calls: results, toolCallRanges: ranges };
185145
+ }
185146
+ var HY3_PARAMETER_RE, HY3_NAMED_ARGUMENT_LINE_RE, HY3_ARG_PAIR_RE, XML_TOOL_CALL_OPEN = "<tool_call>", HY3_TOOL_CALLS_OPEN = "<tool_calls:", HY3_TOOL_CALL_OPEN = "<tool_call:", XML_TOOL_CALL_OPENERS, XML_TOOL_CALL_CLOSE = "</tool_call>", XML_ARG_KEY_OPEN = "<arg_key>", HY3_TOOL_CALLS_BLOCK_RE, HY3_TOOL_CALL_BLOCK_RE, XML_FUNCTION_NAME_RE, XML_PARAMETER_RE, XML_ARG_PAIR_RE;
185147
+ var init_xmlToolCallParsing = __esm(() => {
185148
+ init_rawToolCallParsing();
185149
+ HY3_PARAMETER_RE = /<parameter\s+name=["']([^"'>\s]+)["']\s*>([\s\S]*?)<\/parameter>/g;
185150
+ HY3_NAMED_ARGUMENT_LINE_RE = /^\s*([A-Za-z_][\w-]*)\s*:\s*(.+?)\s*$/gm;
185151
+ HY3_ARG_PAIR_RE = /<arg_key(?::[^>\s]+)?>([\s\S]*?)<\/arg_key(?::[^>\s]+)?>\s*<arg_value(?::[^>\s]+)?>([\s\S]*?)<\/arg_value(?::[^>\s]+)?>/g;
185152
+ XML_TOOL_CALL_OPENERS = [
185153
+ XML_TOOL_CALL_OPEN,
185154
+ HY3_TOOL_CALLS_OPEN,
185155
+ HY3_TOOL_CALL_OPEN
185156
+ ];
185157
+ HY3_TOOL_CALLS_BLOCK_RE = /<tool_calls:[^>\s]+>([\s\S]*?)(?:<\/tool_calls(?::[^>\s]+)?>|$)/g;
185158
+ HY3_TOOL_CALL_BLOCK_RE = /<tool_call:[^>\s]+>([\s\S]*?)(?:<\/tool_call(?::[^>\s]+)?>|$)/g;
185159
+ XML_FUNCTION_NAME_RE = /<function=([^>\s]+)\s*>/;
185160
+ XML_PARAMETER_RE = /<parameter=([^>\s]+)\s*>([\s\S]*?)<\/parameter>/g;
185161
+ XML_ARG_PAIR_RE = /<arg_key>([\s\S]*?)<\/arg_key>\s*<arg_value>([\s\S]*?)<\/arg_value>/g;
185162
+ });
185163
+
184757
185164
  // src/services/api/openaiShim/streamConversion.ts
184758
185165
  import { APIError as APIError6 } from "@anthropic-ai/sdk";
185166
+ function reasoningMarkupTouchesBlock(text, start, block) {
185167
+ const markup = xmlToolCallBlockMarkup(block);
185168
+ if (stripThinkTags(markup) !== markup)
185169
+ return true;
185170
+ const lastTagEnd = start > 0 ? text.lastIndexOf(">", start - 1) : -1;
185171
+ const openerTail = text.slice(lastTagEnd + 1, text.indexOf(">", start) + 1);
185172
+ return stripThinkTags(openerTail) !== openerTail;
185173
+ }
185174
+ function visibleTextKeepingToolCallBlocks(text, blockRanges) {
185175
+ const filter2 = createThinkTagFilter();
185176
+ let visible = "";
185177
+ let position = 0;
185178
+ for (const [start, end] of blockRanges) {
185179
+ if (start < position) {
185180
+ if (end > position)
185181
+ return null;
185182
+ continue;
185183
+ }
185184
+ const block = text.slice(start, end);
185185
+ if (reasoningMarkupTouchesBlock(text, start, block))
185186
+ return null;
185187
+ const before = filter2.feed(text.slice(position, start) + TOOL_CALL_BLOCK_BOUNDARY);
185188
+ if (filter2.isInsideBlock()) {
185189
+ visible += before;
185190
+ } else {
185191
+ visible += before.slice(0, -1) + block;
185192
+ }
185193
+ position = end;
185194
+ }
185195
+ return visible + filter2.feed(text.slice(position));
185196
+ }
184759
185197
  function convertOpenAIStreamUsage(usage) {
184760
185198
  if (!usage)
184761
185199
  return;
@@ -184768,24 +185206,24 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
184768
185206
  createReaderCanceller: createReaderCanceller2,
184769
185207
  createProviderStreamTrace: createProviderStreamTrace2,
184770
185208
  createStreamAbortError: createStreamAbortError2,
184771
- findXmlToolCallOpener,
185209
+ findXmlToolCallOpener: findXmlToolCallOpener2,
184772
185210
  geminiThoughtSignatureFromExtraContent: geminiThoughtSignatureFromExtraContent2,
184773
185211
  getStreamIdleTimeoutMs: getStreamIdleTimeoutMs2,
184774
185212
  headersWithRequestUrl,
184775
- isHy3Model,
185213
+ isHy3Model: isHy3Model2,
184776
185214
  makeMessageId: makeMessageId2,
184777
185215
  mergeGeminiThoughtSignature: mergeGeminiThoughtSignature2,
184778
185216
  parseRawToolCallsRequestedText: parseRawToolCallsRequestedText2,
184779
185217
  parseTextToolCalls: parseTextToolCalls2,
184780
- parseXmlToolCalls,
185218
+ parseXmlToolCalls: parseXmlToolCalls2,
184781
185219
  readWithIdleTimeout: readWithIdleTimeout2,
184782
185220
  repairPossiblyTruncatedObjectJson: repairPossiblyTruncatedObjectJson2,
184783
185221
  stripRanges: stripRanges2,
184784
185222
  throwIfStreamAborted: throwIfStreamAborted2,
184785
- trailingXmlOpenerPrefixLen
185223
+ trailingXmlOpenerPrefixLen: trailingXmlOpenerPrefixLen2
184786
185224
  } = dependencies2;
184787
185225
  const messageId = makeMessageId2();
184788
- const allowHy3ToolCalls = isHy3Model(model);
185226
+ const allowHy3ToolCalls = isHy3Model2(model);
184789
185227
  let contentBlockIndex = 0;
184790
185228
  const activeToolCalls = new Map;
184791
185229
  let hasEmittedContentStart = false;
@@ -185158,7 +185596,7 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
185158
185596
  }
185159
185597
  } else {
185160
185598
  const combined = xmlHoldback + delta.content;
185161
- const openIdx = findXmlToolCallOpener(combined, allowHy3ToolCalls);
185599
+ const openIdx = findXmlToolCallOpener2(combined, allowHy3ToolCalls);
185162
185600
  if (openIdx !== -1) {
185163
185601
  const before = combined.slice(0, openIdx);
185164
185602
  if (before)
@@ -185166,7 +185604,7 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
185166
185604
  xmlHoldback = "";
185167
185605
  xmlToolCallText = combined.slice(openIdx);
185168
185606
  } else {
185169
- const keep = trailingXmlOpenerPrefixLen(combined, allowHy3ToolCalls);
185607
+ const keep = trailingXmlOpenerPrefixLen2(combined, allowHy3ToolCalls);
185170
185608
  const emit = keep > 0 ? combined.slice(0, combined.length - keep) : combined;
185171
185609
  xmlHoldback = keep > 0 ? combined.slice(combined.length - keep) : "";
185172
185610
  if (emit)
@@ -185294,10 +185732,25 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
185294
185732
  const originalFinishReason = choice.finish_reason;
185295
185733
  let ollamaClosedContentBlock = false;
185296
185734
  if (isTerminalOllamaFinish) {
185297
- const { calls: textToolCalls, toolCallRanges } = parseTextToolCalls2(accumulatedText);
185735
+ let toolCallSource = accumulatedText;
185736
+ let { calls: textToolCalls, toolCallRanges } = parseTextToolCalls2(accumulatedText);
185737
+ if (textToolCalls.length === 0) {
185738
+ ({ calls: textToolCalls, toolCallRanges } = parseXmlToolCalls2(accumulatedText, allowHy3ToolCalls));
185739
+ const visibleSource = textToolCalls.length > 0 ? visibleTextKeepingToolCallBlocks(accumulatedText, findXmlToolCallBlockRanges(accumulatedText, allowHy3ToolCalls)) : accumulatedText;
185740
+ const callKey = (tc) => `${tc.name}\x00${JSON.stringify(tc.arguments)}`;
185741
+ const rawCallKeys = new Set(textToolCalls.map(callKey));
185742
+ if (visibleSource !== null && visibleSource !== accumulatedText) {
185743
+ toolCallSource = visibleSource;
185744
+ ({ calls: textToolCalls, toolCallRanges } = parseXmlToolCalls2(toolCallSource, allowHy3ToolCalls));
185745
+ }
185746
+ if (visibleSource === null || textToolCalls.some((tc) => !rawCallKeys.has(callKey(tc)))) {
185747
+ textToolCalls = [];
185748
+ toolCallRanges = [];
185749
+ }
185750
+ }
185298
185751
  if (textToolCalls.length > 0) {
185299
185752
  ollamaClosedContentBlock = true;
185300
- const stripped = stripRanges2(accumulatedText, toolCallRanges).trim();
185753
+ const stripped = stripRanges2(toolCallSource, toolCallRanges).trim();
185301
185754
  const strippedVisible = stripThinkTags(stripped).trim();
185302
185755
  if (hasEmittedContentStart) {
185303
185756
  if (strippedVisible) {
@@ -185368,7 +185821,7 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
185368
185821
  if (!isOllamaStream && xmlToolCallText !== null) {
185369
185822
  const buffered = xmlToolCallText;
185370
185823
  xmlToolCallText = null;
185371
- const { calls, toolCallRanges } = parseXmlToolCalls(buffered, allowHy3ToolCalls);
185824
+ const { calls, toolCallRanges } = parseXmlToolCalls2(buffered, allowHy3ToolCalls);
185372
185825
  if (calls.length > 0) {
185373
185826
  const stripped = stripRanges2(buffered, toolCallRanges).trim();
185374
185827
  const strippedVisible = stripThinkTags(stripped).trim();
@@ -185566,13 +186019,14 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
185566
186019
  throwIfStreamAborted2(signal);
185567
186020
  yield { type: "message_stop" };
185568
186021
  }
185569
- var JSON_REPAIR_SUFFIXES2;
186022
+ var JSON_REPAIR_SUFFIXES2, TOOL_CALL_BLOCK_BOUNDARY = "\x00";
185570
186023
  var init_streamConversion = __esm(() => {
185571
186024
  init_cacheMetrics();
185572
186025
  init_openaiErrorClassification();
185573
186026
  init_thinkTagSanitizer();
185574
186027
  init_toolArgumentNormalization();
185575
186028
  init_debug();
186029
+ init_xmlToolCallParsing();
185576
186030
  JSON_REPAIR_SUFFIXES2 = [
185577
186031
  "}",
185578
186032
  '"}',
@@ -185827,203 +186281,6 @@ var init_geminiStreamConversion = __esm(() => {
185827
186281
  init_debug();
185828
186282
  });
185829
186283
 
185830
- // src/services/api/openaiShim/xmlToolCallParsing.ts
185831
- function coerceXmlToolValue(raw) {
185832
- const trimmed = raw.trim();
185833
- if (trimmed === "")
185834
- return "";
185835
- try {
185836
- return JSON.parse(trimmed);
185837
- } catch {
185838
- return raw;
185839
- }
185840
- }
185841
- function parseHy3ToolCallInner(inner) {
185842
- const args = {};
185843
- const trimmed = inner.trim();
185844
- const name = trimmed.split(/[\n<]/, 1)[0]?.trim().replace(/[\s`*_]+$/, "");
185845
- let hasStructuredArguments = false;
185846
- for (const parameter of inner.matchAll(HY3_PARAMETER_RE)) {
185847
- const key = parameter[1];
185848
- if (key) {
185849
- hasStructuredArguments = true;
185850
- args[key] = coerceXmlToolValue(parameter[2] ?? "");
185851
- }
185852
- }
185853
- for (const line of inner.matchAll(HY3_NAMED_ARGUMENT_LINE_RE)) {
185854
- const key = line[1];
185855
- if (key) {
185856
- hasStructuredArguments = true;
185857
- args[key] = coerceXmlToolValue(line[2] ?? "");
185858
- }
185859
- }
185860
- for (const pair of inner.matchAll(HY3_ARG_PAIR_RE)) {
185861
- const key = pair[1]?.trim();
185862
- if (key) {
185863
- hasStructuredArguments = true;
185864
- args[key] = coerceXmlToolValue(pair[2] ?? "");
185865
- }
185866
- }
185867
- return {
185868
- name: name && /^[A-Za-z_][\w.-]*$/.test(name) && (hasStructuredArguments || trimmed === name) ? name : undefined,
185869
- args
185870
- };
185871
- }
185872
- function isHy3Model(model) {
185873
- return model.split("?", 1)[0]?.toLowerCase() === "tencent/hy3";
185874
- }
185875
- function trailingXmlOpenerPrefixLen(s, allowHy3) {
185876
- let longest = 0;
185877
- const openers = allowHy3 ? XML_TOOL_CALL_OPENERS : [XML_TOOL_CALL_OPEN];
185878
- for (const opener of openers) {
185879
- const max2 = Math.min(s.length, opener.length - 1);
185880
- for (let len = max2;len > 0; len--) {
185881
- if (opener.startsWith(s.slice(s.length - len))) {
185882
- longest = Math.max(longest, len);
185883
- break;
185884
- }
185885
- }
185886
- }
185887
- return longest;
185888
- }
185889
- function findXmlToolCallOpener(text, allowHy3) {
185890
- const openers = allowHy3 ? XML_TOOL_CALL_OPENERS : [XML_TOOL_CALL_OPEN];
185891
- return openers.reduce((first, opener) => {
185892
- const index = text.indexOf(opener);
185893
- return index === -1 ? first : first === -1 ? index : Math.min(first, index);
185894
- }, -1);
185895
- }
185896
- function parseStandardXmlToolCallInner(inner) {
185897
- let name;
185898
- const args = {};
185899
- const fnMatch = inner.match(XML_FUNCTION_NAME_RE);
185900
- if (fnMatch) {
185901
- name = fnMatch[1];
185902
- for (const p of inner.matchAll(XML_PARAMETER_RE)) {
185903
- const key = p[1];
185904
- if (key)
185905
- args[key] = coerceXmlToolValue(p[2] ?? "");
185906
- }
185907
- } else {
185908
- const trimmedInner = inner.trim();
185909
- const argPairs = [...inner.matchAll(XML_ARG_PAIR_RE)];
185910
- if (argPairs.length > 0 && !trimmedInner.startsWith("{")) {
185911
- const nameTok = trimmedInner.split(/[\n<]/, 1)[0]?.trim();
185912
- if (nameTok)
185913
- name = nameTok;
185914
- for (const p of argPairs) {
185915
- const key = (p[1] ?? "").trim();
185916
- if (key)
185917
- args[key] = coerceXmlToolValue(p[2] ?? "");
185918
- }
185919
- } else {
185920
- const jsonStart = trimmedInner.indexOf("{");
185921
- if (jsonStart !== -1) {
185922
- const jsonRaw = extractBalancedJson(trimmedInner, jsonStart);
185923
- if (jsonRaw) {
185924
- try {
185925
- const obj = JSON.parse(jsonRaw);
185926
- if (typeof obj["name"] === "string") {
185927
- name = obj["name"];
185928
- const rawArgs = obj["arguments"];
185929
- if (typeof rawArgs === "string") {
185930
- try {
185931
- Object.assign(args, JSON.parse(rawArgs));
185932
- } catch {}
185933
- } else if (rawArgs && typeof rawArgs === "object") {
185934
- Object.assign(args, rawArgs);
185935
- }
185936
- }
185937
- } catch {}
185938
- }
185939
- }
185940
- }
185941
- }
185942
- return { name, args };
185943
- }
185944
- function parseXmlToolCalls(text, allowHy3, nextSequence) {
185945
- const results = [];
185946
- const seen = new Set;
185947
- const ranges = [];
185948
- const addCall = (name, args) => {
185949
- const dedupKey = `${name}:${JSON.stringify(args)}`;
185950
- if (seen.has(dedupKey))
185951
- return;
185952
- seen.add(dedupKey);
185953
- results.push({ id: `xml_tc_${nextSequence()}`, name, arguments: args });
185954
- };
185955
- const hy3Blocks = allowHy3 ? [...text.matchAll(HY3_TOOL_CALL_BLOCK_RE)].map((block) => ({
185956
- range: [block.index, block.index + block[0].length],
185957
- parsed: parseHy3ToolCallInner(block[1] ?? "")
185958
- })) : [];
185959
- const hy3WrapperRanges = allowHy3 ? [...text.matchAll(HY3_TOOL_CALLS_BLOCK_RE)].filter((wrapper) => {
185960
- const range = [
185961
- wrapper.index,
185962
- wrapper.index + wrapper[0].length
185963
- ];
185964
- return hy3Blocks.some((block) => block.parsed.name && range[0] <= block.range[0] && block.range[1] <= range[1]);
185965
- }).map((wrapper) => [
185966
- wrapper.index,
185967
- wrapper.index + wrapper[0].length
185968
- ]) : [];
185969
- const candidates = [];
185970
- for (const block of hy3Blocks) {
185971
- const { name, args } = block.parsed;
185972
- if (!name)
185973
- continue;
185974
- const range = block.range;
185975
- candidates.push({
185976
- range,
185977
- name,
185978
- args,
185979
- coveredByWrapper: hy3WrapperRanges.some((wrapper) => wrapper[0] <= range[0] && range[1] <= wrapper[1])
185980
- });
185981
- }
185982
- for (const block of text.matchAll(XML_TOOL_CALL_BLOCK_RE)) {
185983
- const range = [
185984
- block.index,
185985
- block.index + block[0].length
185986
- ];
185987
- const { name, args } = parseStandardXmlToolCallInner(block[1] ?? "");
185988
- if (!name)
185989
- continue;
185990
- candidates.push({
185991
- range,
185992
- name,
185993
- args,
185994
- coveredByWrapper: false
185995
- });
185996
- }
185997
- candidates.sort((left, right) => left.range[0] - right.range[0]);
185998
- for (const candidate of candidates) {
185999
- addCall(candidate.name, candidate.args);
186000
- if (!candidate.coveredByWrapper) {
186001
- ranges.push(candidate.range);
186002
- }
186003
- }
186004
- ranges.push(...hy3WrapperRanges);
186005
- ranges.sort((left, right) => left[0] - right[0]);
186006
- return { calls: results, toolCallRanges: ranges };
186007
- }
186008
- var HY3_PARAMETER_RE, HY3_NAMED_ARGUMENT_LINE_RE, HY3_ARG_PAIR_RE, XML_TOOL_CALL_OPEN = "<tool_call>", HY3_TOOL_CALLS_OPEN = "<tool_calls:", HY3_TOOL_CALL_OPEN = "<tool_call:", XML_TOOL_CALL_OPENERS, XML_TOOL_CALL_BLOCK_RE, HY3_TOOL_CALLS_BLOCK_RE, HY3_TOOL_CALL_BLOCK_RE, XML_FUNCTION_NAME_RE, XML_PARAMETER_RE, XML_ARG_PAIR_RE;
186009
- var init_xmlToolCallParsing = __esm(() => {
186010
- init_rawToolCallParsing();
186011
- HY3_PARAMETER_RE = /<parameter\s+name=["']([^"'>\s]+)["']\s*>([\s\S]*?)<\/parameter>/g;
186012
- HY3_NAMED_ARGUMENT_LINE_RE = /^\s*([A-Za-z_][\w-]*)\s*:\s*(.+?)\s*$/gm;
186013
- HY3_ARG_PAIR_RE = /<arg_key(?::[^>\s]+)?>([\s\S]*?)<\/arg_key(?::[^>\s]+)?>\s*<arg_value(?::[^>\s]+)?>([\s\S]*?)<\/arg_value(?::[^>\s]+)?>/g;
186014
- XML_TOOL_CALL_OPENERS = [
186015
- XML_TOOL_CALL_OPEN,
186016
- HY3_TOOL_CALLS_OPEN,
186017
- HY3_TOOL_CALL_OPEN
186018
- ];
186019
- XML_TOOL_CALL_BLOCK_RE = /<tool_call>([\s\S]*?)(?:<\/tool_call>|$)/g;
186020
- HY3_TOOL_CALLS_BLOCK_RE = /<tool_calls:[^>\s]+>([\s\S]*?)(?:<\/tool_calls(?::[^>\s]+)?>|$)/g;
186021
- HY3_TOOL_CALL_BLOCK_RE = /<tool_call:[^>\s]+>([\s\S]*?)(?:<\/tool_call(?::[^>\s]+)?>|$)/g;
186022
- XML_FUNCTION_NAME_RE = /<function=([^>\s]+)\s*>/;
186023
- XML_PARAMETER_RE = /<parameter=([^>\s]+)\s*>([\s\S]*?)<\/parameter>/g;
186024
- XML_ARG_PAIR_RE = /<arg_key>([\s\S]*?)<\/arg_key>\s*<arg_value>([\s\S]*?)<\/arg_value>/g;
186025
- });
186026
-
186027
186284
  // src/services/api/openaiShim/responseAdapters.ts
186028
186285
  function makeMessageId2() {
186029
186286
  return `msg_${crypto.randomUUID().replace(/-/g, "")}`;
@@ -188214,7 +188471,7 @@ function computeFingerprint(messageText2, version2) {
188214
188471
  }
188215
188472
  function computeFingerprintFromMessages(messages) {
188216
188473
  const firstMessageText = extractFirstMessageText(messages);
188217
- return computeFingerprint(firstMessageText, "0.33.3-by-rayss");
188474
+ return computeFingerprint(firstMessageText, "0.34.0");
188218
188475
  }
188219
188476
  var FINGERPRINT_SALT = "59cf53e54c78";
188220
188477
  var init_fingerprint = () => {};
@@ -189697,7 +189954,7 @@ var init_client3 = __esm(() => {
189697
189954
  const client = new Client({
189698
189955
  name: "claude-code",
189699
189956
  title: "OpenClaude",
189700
- version: "0.33.3-by-rayss",
189957
+ version: "0.34.0",
189701
189958
  description: "OpenClaude — coding-agent CLI for any LLM provider",
189702
189959
  websiteUrl: PRODUCT_URL
189703
189960
  }, {
@@ -190195,7 +190452,6 @@ var init_client3 = __esm(() => {
190195
190452
  async call(args, context, _canUseTool, parentMessage, onProgress) {
190196
190453
  const toolUseId = extractToolUseId(parentMessage);
190197
190454
  const meta = toolUseId ? { "claudecode/toolUseId": toolUseId } : {};
190198
- const normalizedArgs = coerceArgsToInputSchema(args, tool.inputSchema);
190199
190455
  if (onProgress && toolUseId) {
190200
190456
  try {
190201
190457
  onProgress({
@@ -190244,7 +190500,7 @@ var init_client3 = __esm(() => {
190244
190500
  client: connectedClient,
190245
190501
  clientConnection: client,
190246
190502
  tool: tool.name,
190247
- args: normalizedArgs,
190503
+ args,
190248
190504
  meta,
190249
190505
  signal: context.abortController.signal,
190250
190506
  setAppState: context.setAppState,
@@ -192106,14 +192362,13 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
192106
192362
  },
192107
192363
  ...mcpToolDetailsForAnalytics(tool.name, mcpServerType, mcpServerBaseUrl)
192108
192364
  });
192109
- const repeatedError = recordRepeatedToolError(toolUseContext.agentId ?? "main", tool.name, errorContent);
192110
192365
  return [
192111
192366
  {
192112
192367
  message: createUserMessage({
192113
192368
  content: [
192114
192369
  {
192115
192370
  type: "tool_result",
192116
- content: `<tool_use_error>InputValidationError: ${errorContent}</tool_use_error>${repeatedError.nudge ?? ""}`,
192371
+ content: `<tool_use_error>InputValidationError: ${errorContent}</tool_use_error>`,
192117
192372
  is_error: true,
192118
192373
  tool_use_id: toolUseID
192119
192374
  }
@@ -192541,7 +192796,6 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
192541
192796
  const toolContextModifier = result.contextModifier;
192542
192797
  const mcpMeta = result.mcpMeta;
192543
192798
  async function addToolResult(toolUseResult, preMappedBlock) {
192544
- resetToolErrorRepeats(toolUseContext.agentId ?? "main", tool.name);
192545
192799
  const toolResultBlock = preMappedBlock ? await processPreMappedToolResultBlock(preMappedBlock, tool.name, tool.maxResultSizeChars) : await processToolResultBlock(tool, toolUseResult, toolUseID);
192546
192800
  const contentBlocks = [toolResultBlock];
192547
192801
  if ("acceptFeedback" in permissionDecision && permissionDecision.acceptFeedback) {
@@ -192727,14 +192981,13 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
192727
192981
  delete hookChainsContext.hookChainsCanUseTool;
192728
192982
  }
192729
192983
  }
192730
- const repeatedError = recordRepeatedToolError(toolUseContext.agentId ?? "main", tool.name, content);
192731
192984
  return [
192732
192985
  {
192733
192986
  message: createUserMessage({
192734
192987
  content: [
192735
192988
  {
192736
192989
  type: "tool_result",
192737
- content: `${content}${repeatedError.nudge ?? ""}`,
192990
+ content,
192738
192991
  is_error: true,
192739
192992
  tool_use_id: toolUseID
192740
192993
  }
@@ -192777,7 +193030,6 @@ var init_toolExecution = __esm(() => {
192777
193030
  init_abortReasons();
192778
193031
  init_debug();
192779
193032
  init_doomLoop();
192780
- init_toolErrorRepeats();
192781
193033
  init_errors();
192782
193034
  init_hooks4();
192783
193035
  init_log();
@@ -286555,7 +286807,7 @@ function buildQueryConfig() {
286555
286807
  sessionId: getSessionId(),
286556
286808
  gates: {
286557
286809
  streamingToolExecution: checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_streaming_tool_execution2"),
286558
- emitToolUseSummaries: getSettingsForSource("userSettings")?.toolUseSummariesEnabled ?? isEnvTruthy(process.env.CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES),
286810
+ emitToolUseSummaries: isEnvTruthy(process.env.CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES),
286559
286811
  isAnt: false,
286560
286812
  fastModeEnabled: !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_FAST_MODE)
286561
286813
  }
@@ -286565,7 +286817,6 @@ var init_config7 = __esm(() => {
286565
286817
  init_state();
286566
286818
  init_growthbook();
286567
286819
  init_envUtils();
286568
- init_settings3();
286569
286820
  });
286570
286821
 
286571
286822
  // src/query/deps.ts
@@ -289042,7 +289293,7 @@ function getAnthropicEnvMetadata() {
289042
289293
  function getBuildAgeMinutes() {
289043
289294
  if (false)
289044
289295
  ;
289045
- const buildTime = new Date("2026-10-28T03:21:39.519Z").getTime();
289296
+ const buildTime = new Date("2026-11-08T14:26:41.014Z").getTime();
289046
289297
  if (isNaN(buildTime))
289047
289298
  return;
289048
289299
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -299546,7 +299797,7 @@ function Feedback({
299546
299797
  platform: env2.platform,
299547
299798
  gitRepo: envInfo.isGit,
299548
299799
  terminal: env2.terminal,
299549
- version: "0.33.3-by-rayss",
299800
+ version: "0.34.0",
299550
299801
  transcript: normalizeMessagesForAPI(messages),
299551
299802
  errors: sanitizedErrors,
299552
299803
  lastApiRequest: getLastAPIRequest(),
@@ -299735,7 +299986,7 @@ function Feedback({
299735
299986
  ", ",
299736
299987
  env2.terminal,
299737
299988
  ", v",
299738
- "0.33.3-by-rayss"
299989
+ "0.34.0"
299739
299990
  ]
299740
299991
  }, undefined, true, undefined, this)
299741
299992
  ]
@@ -299843,7 +300094,7 @@ ${sanitizedDescription}
299843
300094
  ` + `**Environment Info**
299844
300095
  ` + `- Platform: ${env2.platform}
299845
300096
  ` + `- Terminal: ${env2.terminal}
299846
- ` + `- Version: ${"0.33.3-by-rayss"}
300097
+ ` + `- Version: ${"0.34.0"}
299847
300098
  ` + feedbackIdLine + `
299848
300099
  **Errors**
299849
300100
  \`\`\`json
@@ -305746,7 +305997,7 @@ var init_user = __esm(() => {
305746
305997
  deviceId,
305747
305998
  sessionId: getSessionId(),
305748
305999
  email: getEmail(),
305749
- appVersion: "0.33.3-by-rayss",
306000
+ appVersion: "0.34.0",
305750
306001
  platform: getHostPlatformForAnalytics(),
305751
306002
  organizationUuid,
305752
306003
  accountUuid,
@@ -306880,7 +307131,7 @@ function detectLinuxGlobPatternWarnings() {
306880
307131
  }
306881
307132
  async function getDoctorDiagnostic() {
306882
307133
  const installationType = await getCurrentInstallationType();
306883
- const version2 = typeof MACRO !== "undefined" ? "0.33.3-by-rayss" : "unknown";
307134
+ const version2 = typeof MACRO !== "undefined" ? "0.34.0" : "unknown";
306884
307135
  const installationPath = await getInstallationPath();
306885
307136
  const invokedBinary = getInvokedBinary();
306886
307137
  const multipleInstallations = await detectMultipleInstallations();
@@ -307591,8 +307842,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
307591
307842
  const maxVersion = await getMaxVersion();
307592
307843
  if (maxVersion && gt(version2, maxVersion)) {
307593
307844
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
307594
- if (gte("0.33.3-by-rayss", maxVersion)) {
307595
- logForDebugging(`Native installer: current version ${"0.33.3-by-rayss"} is already at or above maxVersion ${maxVersion}, skipping update`);
307845
+ if (gte("0.34.0", maxVersion)) {
307846
+ logForDebugging(`Native installer: current version ${"0.34.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
307596
307847
  logEvent("tengu_native_update_skipped_max_version", {
307597
307848
  latency_ms: Date.now() - startTime,
307598
307849
  max_version: maxVersion,
@@ -307603,7 +307854,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
307603
307854
  version2 = maxVersion;
307604
307855
  }
307605
307856
  }
307606
- if (!forceReinstall && version2 === "0.33.3-by-rayss" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
307857
+ if (!forceReinstall && version2 === "0.34.0" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
307607
307858
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
307608
307859
  logEvent("tengu_native_update_complete", {
307609
307860
  latency_ms: Date.now() - startTime,
@@ -352936,7 +353187,7 @@ function buildPrimarySection() {
352936
353187
  }, undefined, false, undefined, this);
352937
353188
  return [{
352938
353189
  label: "Version",
352939
- value: "0.33.3-by-rayss"
353190
+ value: "0.34.0"
352940
353191
  }, {
352941
353192
  label: "Session name",
352942
353193
  value: nameValue
@@ -357550,13 +357801,7 @@ function ModelPicker(t0) {
357550
357801
  "modelPicker:decreaseEffort": () => handleCycleEffort("left"),
357551
357802
  "modelPicker:increaseEffort": () => handleCycleEffort("right"),
357552
357803
  ...onRefresh ? {
357553
- "modelPicker:refresh": () => {
357554
- if (viewMode === "search") {
357555
- onRefresh();
357556
- return false;
357557
- }
357558
- onRefresh();
357559
- }
357804
+ "modelPicker:refresh": () => onRefresh()
357560
357805
  } : {}
357561
357806
  };
357562
357807
  let t13;
@@ -359161,23 +359406,6 @@ function Config2({
359161
359406
  });
359162
359407
  }
359163
359408
  },
359164
- {
359165
- id: "toolUseSummariesEnabled",
359166
- description: "Generate a short label after completed tool batches using an auxiliary model request.",
359167
- label: "Tool-use summaries",
359168
- searchText: "tool use summary summaries model request auxiliary",
359169
- value: settingsData?.toolUseSummariesEnabled ?? false,
359170
- type: "boolean",
359171
- onChange(enabled2) {
359172
- updateSettingsForSource("userSettings", {
359173
- toolUseSummariesEnabled: enabled2
359174
- });
359175
- setSettingsData((prev) => ({
359176
- ...prev,
359177
- toolUseSummariesEnabled: enabled2
359178
- }));
359179
- }
359180
- },
359181
359409
  {
359182
359410
  id: "apiRetryMaxRetries",
359183
359411
  description: "How many times a failed API request is retried before giving up.",
@@ -360481,7 +360709,7 @@ function Config2({
360481
360709
  }
360482
360710
  }, undefined, false, undefined, this)
360483
360711
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsxDEV162(ChannelDowngradeDialog, {
360484
- currentVersion: "0.33.3-by-rayss",
360712
+ currentVersion: "0.34.0",
360485
360713
  onChoice: (choice) => {
360486
360714
  setShowSubmenu(null);
360487
360715
  setTabsHidden(false);
@@ -360493,7 +360721,7 @@ function Config2({
360493
360721
  autoUpdatesChannel: "stable"
360494
360722
  };
360495
360723
  if (choice === "stay") {
360496
- newSettings.minimumVersion = "0.33.3-by-rayss";
360724
+ newSettings.minimumVersion = "0.34.0";
360497
360725
  }
360498
360726
  updateSettingsForSource("userSettings", newSettings);
360499
360727
  setSettingsData((prev_27) => ({
@@ -369580,21 +369808,21 @@ function readPackageManager(env4) {
369580
369808
  }
369581
369809
  function readMacroVersion() {
369582
369810
  try {
369583
- return "0.33.3-by-rayss";
369811
+ return "0.34.0";
369584
369812
  } catch {
369585
369813
  return;
369586
369814
  }
369587
369815
  }
369588
369816
  function readMacroDisplayVersion() {
369589
369817
  try {
369590
- return "0.33.3-by-rayss";
369818
+ return "0.34.0";
369591
369819
  } catch {
369592
369820
  return;
369593
369821
  }
369594
369822
  }
369595
369823
  function readMacroBuildTime() {
369596
369824
  try {
369597
- return "2026-10-28T03:21:39.519Z";
369825
+ return "2026-11-08T14:26:41.014Z";
369598
369826
  } catch {
369599
369827
  return;
369600
369828
  }
@@ -443568,9 +443796,9 @@ function readLinuxProcessStartId(pid) {
443568
443796
  return null;
443569
443797
  }
443570
443798
  }
443571
- function readCommandProcessStartId(command9, args, prefix) {
443799
+ function readCommandProcessStartId(command9, args, prefix, timeoutMs) {
443572
443800
  try {
443573
- const result = spawnSync3(command9, args, {
443801
+ const result = identityLookupSync(command9, args, {
443574
443802
  encoding: "utf8",
443575
443803
  env: {
443576
443804
  ...process.env,
@@ -443578,7 +443806,7 @@ function readCommandProcessStartId(command9, args, prefix) {
443578
443806
  LC_ALL: "C",
443579
443807
  TZ: "UTC"
443580
443808
  },
443581
- timeout: 1000,
443809
+ timeout: timeoutMs,
443582
443810
  windowsHide: true
443583
443811
  });
443584
443812
  if (result.error || result.status !== 0)
@@ -443589,7 +443817,7 @@ function readCommandProcessStartId(command9, args, prefix) {
443589
443817
  return null;
443590
443818
  }
443591
443819
  }
443592
- function readProcessStartId(pid) {
443820
+ function readProcessStartId(pid, windowsTimeoutMs = WINDOWS_SETTINGS_LOCK_IDENTITY_LOOKUP_TIMEOUT_MS) {
443593
443821
  if (process.platform === "linux")
443594
443822
  return readLinuxProcessStartId(pid);
443595
443823
  if (process.platform === "win32") {
@@ -443598,9 +443826,9 @@ function readProcessStartId(pid) {
443598
443826
  "-NonInteractive",
443599
443827
  "-Command",
443600
443828
  `(Get-Process -Id ${pid} -ErrorAction Stop).StartTime.ToUniversalTime().Ticks`
443601
- ], "windows");
443829
+ ], "windows", windowsTimeoutMs);
443602
443830
  }
443603
- return readCommandProcessStartId("ps", ["-p", String(pid), "-o", "lstart="], "posix");
443831
+ return readCommandProcessStartId("ps", ["-p", String(pid), "-o", "lstart="], "posix", SETTINGS_LOCK_IDENTITY_LOOKUP_TIMEOUT_MS);
443604
443832
  }
443605
443833
  function currentProcessStartId() {
443606
443834
  if (settingsLockProcessStartId !== undefined) {
@@ -443639,7 +443867,7 @@ function isIdentityOwnerAlive(identity4, processStartIds) {
443639
443867
  if (processStartIds.has(cacheKey)) {
443640
443868
  currentProcessStartId2 = processStartIds.get(cacheKey) ?? null;
443641
443869
  } else {
443642
- currentProcessStartId2 = readProcessStartId(identity4.pid);
443870
+ currentProcessStartId2 = readProcessStartId(identity4.pid, SETTINGS_LOCK_IDENTITY_LOOKUP_TIMEOUT_MS);
443643
443871
  processStartIds.set(cacheKey, currentProcessStartId2);
443644
443872
  }
443645
443873
  return currentProcessStartId2 === null || currentProcessStartId2 === identity4.processStartId;
@@ -443775,6 +444003,10 @@ function acquireSettingsLock(targetPath) {
443775
444003
  }
443776
444004
  const remaining = deadline - now2;
443777
444005
  if (remaining <= 0) {
444006
+ if (tryPublishPendingLock(pendingPath, lockPath2)) {
444007
+ acquired = true;
444008
+ return () => releaseOwnedLock(lockPath2, owner);
444009
+ }
443778
444010
  throw Object.assign(new Error(`Timed out after ${SETTINGS_LOCK_WAIT_MS}ms waiting for settings lock ${lockPath2}, held by ${describeCurrentOwner(lockPath2)}. If that process is known to have exited, remove the lock directory before retrying.`), { code: "ELOCKED" });
443779
444011
  }
443780
444012
  Atomics.wait(waitBuffer, 0, 0, Math.min(SETTINGS_LOCK_RETRY_MS, remaining));
@@ -443804,7 +444036,7 @@ function withSettingsFileTransactionSync(requestedPath, operation) {
443804
444036
  release2();
443805
444037
  return result;
443806
444038
  }
443807
- var SETTINGS_LOCK_RETRY_MS = 25, SETTINGS_LOCK_CONTENTION_LOG_MS = 100, SETTINGS_LOCK_WAIT_MS = 2000, SETTINGS_LOCK_HOST, SETTINGS_LOCK_OWNER_FILE = "owner.json", waitBuffer, settingsLockProcessStartId;
444039
+ var identityLookupSync, SETTINGS_LOCK_RETRY_MS = 25, SETTINGS_LOCK_CONTENTION_LOG_MS = 100, SETTINGS_LOCK_WAIT_MS = 2000, SETTINGS_LOCK_IDENTITY_LOOKUP_TIMEOUT_MS = 1000, WINDOWS_SETTINGS_LOCK_IDENTITY_LOOKUP_TIMEOUT_MS = 1e4, SETTINGS_LOCK_HOST, SETTINGS_LOCK_OWNER_FILE = "owner.json", waitBuffer, settingsLockProcessStartId;
443808
444040
  var init_settingsFileTransaction = __esm(() => {
443809
444041
  init_debug();
443810
444042
  init_errors();
@@ -443812,6 +444044,7 @@ var init_settingsFileTransaction = __esm(() => {
443812
444044
  init_fsOperations();
443813
444045
  init_internalWrites();
443814
444046
  init_settingsCache();
444047
+ identityLookupSync = spawnSync3;
443815
444048
  SETTINGS_LOCK_HOST = hostname3();
443816
444049
  waitBuffer = new Int32Array(new SharedArrayBuffer(4));
443817
444050
  });
@@ -444044,7 +444277,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
444044
444277
  smapsRollup,
444045
444278
  platform: process.platform,
444046
444279
  nodeVersion: process.version,
444047
- ccVersion: "0.33.3-by-rayss"
444280
+ ccVersion: "0.34.0"
444048
444281
  };
444049
444282
  }
444050
444283
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -444311,7 +444544,7 @@ var init_bridge_kick = __esm(() => {
444311
444544
  var call75 = async () => {
444312
444545
  return {
444313
444546
  type: "text",
444314
- value: `${"0.33.3-by-rayss"} (built ${"2026-10-28T03:21:39.519Z"})`
444547
+ value: `${"0.34.0"} (built ${"2026-11-08T14:26:41.014Z"})`
444315
444548
  };
444316
444549
  }, version2, version_default;
444317
444550
  var init_version2 = __esm(() => {
@@ -444877,7 +445110,7 @@ async function call76(onDone, _context, args) {
444877
445110
  }, undefined, false, undefined, this));
444878
445111
  return null;
444879
445112
  }
444880
- var PACKAGE_URL = "@rayss-dev/openclaude", CURRENT_VERSION = "0.33.3-by-rayss";
445113
+ var PACKAGE_URL = "@rayss-dev/openclaude", CURRENT_VERSION = "0.34.0";
444881
445114
  var init_update = __esm(() => {
444882
445115
  init_StatusIcon();
444883
445116
  init_ink2();
@@ -457067,7 +457300,7 @@ function generateHtmlReport(data, insights) {
457067
457300
  </html>`;
457068
457301
  }
457069
457302
  function buildExportData(data, insights, facets) {
457070
- const version3 = typeof MACRO !== "undefined" ? "0.33.3-by-rayss" : "unknown";
457303
+ const version3 = typeof MACRO !== "undefined" ? "0.34.0" : "unknown";
457071
457304
  const facets_summary = {
457072
457305
  total: facets.size,
457073
457306
  goal_categories: {},
@@ -458650,9 +458883,24 @@ function getEntrypoint() {
458650
458883
  function isCustomTitleEnabled() {
458651
458884
  return true;
458652
458885
  }
458886
+ function followSessionSwitches() {
458887
+ if (unsubscribeSessionSwitch)
458888
+ return;
458889
+ pointerSessionId = getSessionId();
458890
+ pointerProjectDir = getSessionProjectDir();
458891
+ unsubscribeSessionSwitch = onSessionSwitch((sessionId) => {
458892
+ const projectDir = getSessionProjectDir();
458893
+ if (sessionId === pointerSessionId && projectDir === pointerProjectDir)
458894
+ return;
458895
+ pointerSessionId = sessionId;
458896
+ pointerProjectDir = projectDir;
458897
+ project?.resetSessionFile();
458898
+ });
458899
+ }
458653
458900
  function getProject() {
458654
458901
  if (!project) {
458655
458902
  project = new Project;
458903
+ followSessionSwitches();
458656
458904
  if (!cleanupRegistered3) {
458657
458905
  registerCleanup(async () => {
458658
458906
  await project?.flush();
@@ -458682,6 +458930,10 @@ function resetProjectFlushStateForTesting() {
458682
458930
  }
458683
458931
  function resetProjectForTesting() {
458684
458932
  project = null;
458933
+ unsubscribeSessionSwitch?.();
458934
+ unsubscribeSessionSwitch = null;
458935
+ pointerSessionId = null;
458936
+ pointerProjectDir = null;
458685
458937
  }
458686
458938
  function setSessionFileForTesting(path17) {
458687
458939
  getProject().sessionFile = path17;
@@ -458712,8 +458964,8 @@ class Project {
458712
458964
  currentSessionGoal;
458713
458965
  currentSessionBranch;
458714
458966
  sessionFile = null;
458715
- pendingEntries = [];
458716
- pendingEntriesSessionId = null;
458967
+ hasStartedSession = false;
458968
+ pendingEntries = new Map;
458717
458969
  remoteIngressUrl = null;
458718
458970
  internalEventWriter = null;
458719
458971
  internalEventReader = null;
@@ -458983,15 +459235,35 @@ class Project {
458983
459235
  return this.trackWrite(() => this.enqueueRewrite(filePath, (signal) => replaceFileAtomic(filePath, data, { signal })));
458984
459236
  }
458985
459237
  resetSessionFile() {
459238
+ if (this.sessionFile !== null)
459239
+ this.hasStartedSession = true;
459240
+ const startupMetadata = !this.hasStartedSession ? {
459241
+ title: this.currentSessionTitle,
459242
+ agentSetting: this.currentSessionAgentSetting,
459243
+ worktree: this.currentSessionWorktree
459244
+ } : undefined;
458986
459245
  this.sessionFile = null;
458987
- this.pendingEntries = [];
458988
- this.pendingEntriesSessionId = null;
458989
- }
458990
- dropForeignPendingEntries(sessionId) {
458991
- if (this.pendingEntriesSessionId !== null && this.pendingEntriesSessionId !== sessionId) {
458992
- this.pendingEntries = [];
458993
- this.pendingEntriesSessionId = null;
458994
- }
459246
+ this.clearSessionMetadata();
459247
+ if (startupMetadata) {
459248
+ this.currentSessionTitle = startupMetadata.title;
459249
+ this.currentSessionAgentSetting = startupMetadata.agentSetting;
459250
+ this.currentSessionWorktree = startupMetadata.worktree;
459251
+ }
459252
+ }
459253
+ clearSessionMetadata() {
459254
+ this.currentSessionTitle = undefined;
459255
+ this.currentSessionTag = undefined;
459256
+ this.currentSessionAgentName = undefined;
459257
+ this.currentSessionAgentColor = undefined;
459258
+ this.currentSessionLastPrompt = undefined;
459259
+ this.currentSessionAgentSetting = undefined;
459260
+ this.currentSessionMode = undefined;
459261
+ this.currentSessionWorktree = undefined;
459262
+ this.currentSessionPrNumber = undefined;
459263
+ this.currentSessionPrUrl = undefined;
459264
+ this.currentSessionPrRepository = undefined;
459265
+ this.currentSessionGoal = undefined;
459266
+ this.currentSessionBranch = undefined;
458995
459267
  }
458996
459268
  reAppendSessionMetadata(skipTitleRefresh = false) {
458997
459269
  if (!this.sessionFile)
@@ -459176,15 +459448,14 @@ class Project {
459176
459448
  return shouldSkipSessionPersistence();
459177
459449
  }
459178
459450
  async materializeSessionFile() {
459451
+ this.hasStartedSession = true;
459179
459452
  if (this.shouldSkipPersistence())
459180
459453
  return;
459181
- this.dropForeignPendingEntries(getSessionId());
459182
- this.ensureCurrentSessionFile();
459454
+ const sessionFile = resolvePath2(this.ensureCurrentSessionFile());
459183
459455
  this.reAppendSessionMetadata();
459184
- if (this.pendingEntries.length > 0) {
459185
- const buffered = this.pendingEntries;
459186
- this.pendingEntries = [];
459187
- this.pendingEntriesSessionId = null;
459456
+ const buffered = this.pendingEntries.get(sessionFile);
459457
+ if (buffered && buffered.length > 0) {
459458
+ this.pendingEntries.delete(sessionFile);
459188
459459
  for (const entry of buffered) {
459189
459460
  await this.appendEntry(entry);
459190
459461
  }
@@ -459319,9 +459590,13 @@ class Project {
459319
459590
  let sessionFile;
459320
459591
  if (isCurrentSession) {
459321
459592
  if (this.sessionFile === null) {
459322
- this.dropForeignPendingEntries(currentSessionId);
459323
- this.pendingEntriesSessionId = currentSessionId;
459324
- this.pendingEntries.push(entry);
459593
+ const pendingPath = resolvePath2(getTranscriptPath());
459594
+ let buffered = this.pendingEntries.get(pendingPath);
459595
+ if (!buffered) {
459596
+ buffered = [];
459597
+ this.pendingEntries.set(pendingPath, buffered);
459598
+ }
459599
+ buffered.push(entry);
459325
459600
  return;
459326
459601
  }
459327
459602
  sessionFile = this.sessionFile;
@@ -459413,6 +459688,7 @@ class Project {
459413
459688
  async forgetDeletedSession(sessionId, transcriptPath) {
459414
459689
  this.deletedSessionFiles.add(resolvePath2(transcriptPath));
459415
459690
  this.existingSessionFiles.delete(sessionId);
459691
+ this.pendingEntries.delete(resolvePath2(transcriptPath));
459416
459692
  if (this.sessionFile && this.isDeletedSessionFile(this.sessionFile)) {
459417
459693
  this.resetSessionFile();
459418
459694
  }
@@ -460528,20 +460804,7 @@ function restoreSessionMetadata(meta) {
460528
460804
  project2.currentSessionBranch = meta.sessionBranch ?? undefined;
460529
460805
  }
460530
460806
  function clearSessionMetadata() {
460531
- const project2 = getProject();
460532
- project2.currentSessionTitle = undefined;
460533
- project2.currentSessionTag = undefined;
460534
- project2.currentSessionAgentName = undefined;
460535
- project2.currentSessionAgentColor = undefined;
460536
- project2.currentSessionLastPrompt = undefined;
460537
- project2.currentSessionAgentSetting = undefined;
460538
- project2.currentSessionMode = undefined;
460539
- project2.currentSessionWorktree = undefined;
460540
- project2.currentSessionPrNumber = undefined;
460541
- project2.currentSessionPrUrl = undefined;
460542
- project2.currentSessionPrRepository = undefined;
460543
- project2.currentSessionGoal = undefined;
460544
- project2.currentSessionBranch = undefined;
460807
+ getProject().clearSessionMetadata();
460545
460808
  }
460546
460809
  function reAppendSessionMetadata() {
460547
460810
  getProject().reAppendSessionMetadata();
@@ -462071,7 +462334,7 @@ async function enrichLogs(allLogs, startIndex, count3, options2) {
462071
462334
  }
462072
462335
  return { logs: result, nextIndex: i3 };
462073
462336
  }
462074
- var VERSION3, builtInCommandNamesCache, MAX_TOMBSTONE_REWRITE_BYTES, TRANSCRIPT_COPY_CHUNK_BYTES, transcriptRewriteHooksForTesting, SKIP_FIRST_PROMPT_PATTERN2, LOCAL_COMMAND_TAGS, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered3 = false, REMOTE_FLUSH_INTERVAL_MS = 10, PERSISTED_OUTPUT_TAG2, TOOL_USE_RESULT_KEY, SEARCH_HEAD_BYTES, SEARCH_TAIL_BYTES, SEARCH_MID_WINDOW_BYTES, SEARCH_MAX_MID_WINDOWS = 12, SEARCH_MAX_TOTAL_READ_BYTES, SEARCH_MAX_CHAR_COUNT = 80000, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages, INITIAL_ENRICH_COUNT = 50, SESSION_BRANCH_ENTRY_PREFIX = '{"type":"session-branch"', SESSION_BRANCH_ENTRY_PREFIX_SPACED = '{"type": "session-branch"';
462337
+ var VERSION3, builtInCommandNamesCache, MAX_TOMBSTONE_REWRITE_BYTES, TRANSCRIPT_COPY_CHUNK_BYTES, transcriptRewriteHooksForTesting, SKIP_FIRST_PROMPT_PATTERN2, LOCAL_COMMAND_TAGS, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered3 = false, unsubscribeSessionSwitch = null, pointerSessionId = null, pointerProjectDir = null, REMOTE_FLUSH_INTERVAL_MS = 10, PERSISTED_OUTPUT_TAG2, TOOL_USE_RESULT_KEY, SEARCH_HEAD_BYTES, SEARCH_TAIL_BYTES, SEARCH_MID_WINDOW_BYTES, SEARCH_MAX_MID_WINDOWS = 12, SEARCH_MAX_TOTAL_READ_BYTES, SEARCH_MAX_CHAR_COUNT = 80000, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages, INITIAL_ENRICH_COUNT = 50, SESSION_BRANCH_ENTRY_PREFIX = '{"type":"session-branch"', SESSION_BRANCH_ENTRY_PREFIX_SPACED = '{"type": "session-branch"';
462075
462338
  var init_sessionStorage = __esm(() => {
462076
462339
  init_memoize();
462077
462340
  init_state();
@@ -462101,7 +462364,7 @@ var init_sessionStorage = __esm(() => {
462101
462364
  init_slowOperations();
462102
462365
  init_transcriptFileLock();
462103
462366
  init_uuid();
462104
- VERSION3 = typeof MACRO !== "undefined" ? "0.33.3-by-rayss" : "unknown";
462367
+ VERSION3 = typeof MACRO !== "undefined" ? "0.34.0" : "unknown";
462105
462368
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
462106
462369
  TRANSCRIPT_COPY_CHUNK_BYTES = 64 * 1024;
462107
462370
  transcriptRewriteHooksForTesting = {};
@@ -463590,7 +463853,7 @@ var init_filesystem = __esm(() => {
463590
463853
  });
463591
463854
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
463592
463855
  const nonce = randomBytes19(16).toString("hex");
463593
- return join150(getClaudeTempDir(), "bundled-skills", "0.33.3-by-rayss", nonce);
463856
+ return join150(getClaudeTempDir(), "bundled-skills", "0.34.0", nonce);
463594
463857
  });
463595
463858
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
463596
463859
  });
@@ -463820,7 +464083,7 @@ var init_diskOutput = __esm(() => {
463820
464083
  });
463821
464084
 
463822
464085
  // src/Task.ts
463823
- import { randomInt as randomInt2 } from "crypto";
464086
+ import { randomInt as randomInt3 } from "crypto";
463824
464087
  function isTerminalTaskStatus(status2) {
463825
464088
  return status2 === "completed" || status2 === "failed" || status2 === "killed";
463826
464089
  }
@@ -463831,7 +464094,7 @@ function generateTaskId(type) {
463831
464094
  const prefix = getTaskIdPrefix(type);
463832
464095
  let id = prefix;
463833
464096
  for (let i3 = 0;i3 < 8; i3++) {
463834
- id += TASK_ID_ALPHABET[randomInt2(TASK_ID_ALPHABET.length)];
464097
+ id += TASK_ID_ALPHABET[randomInt3(TASK_ID_ALPHABET.length)];
463835
464098
  }
463836
464099
  return id;
463837
464100
  }
@@ -473484,6 +473747,13 @@ var init_findRelevantMemories = __esm(() => {
473484
473747
  import { readdir as readdir31, stat as stat49 } from "fs/promises";
473485
473748
  import nodePath2, { dirname as dirname63, parse as parse12, relative as relative30, resolve as resolve48 } from "path";
473486
473749
  import { randomUUID as randomUUID38 } from "crypto";
473750
+ function getTodoReminderConfig() {
473751
+ const config3 = getSettings_DEPRECATED()?.todoReminder;
473752
+ return {
473753
+ turnsSinceWrite: config3?.turnsSinceWrite ?? getEnvNumber("OPENCLAUDE_TODO_REMINDER_TURNS_SINCE_WRITE", 10),
473754
+ turnsBetweenReminders: config3?.turnsBetweenReminders ?? getEnvNumber("OPENCLAUDE_TODO_REMINDER_TURNS_BETWEEN_REMINDERS", 10)
473755
+ };
473756
+ }
473487
473757
  function shouldIncludeSkillListingAttachment(querySource) {
473488
473758
  return !(typeof querySource === "string" && SKILL_LISTING_SUPPRESSED_QUERY_SOURCES.has(querySource));
473489
473759
  }
@@ -474838,7 +475108,8 @@ async function getTodoReminderAttachments(messages, toolUseContext) {
474838
475108
  return [];
474839
475109
  }
474840
475110
  const { turnsSinceLastTodoWrite, turnsSinceLastReminder } = getTodoReminderTurnCounts(messages);
474841
- if (turnsSinceLastTodoWrite >= TODO_REMINDER_CONFIG.TURNS_SINCE_WRITE && turnsSinceLastReminder >= TODO_REMINDER_CONFIG.TURNS_BETWEEN_REMINDERS) {
475111
+ const reminderConfig = getTodoReminderConfig();
475112
+ if (turnsSinceLastTodoWrite >= reminderConfig.turnsSinceWrite && turnsSinceLastReminder >= reminderConfig.turnsBetweenReminders) {
474842
475113
  const todoKey = toolUseContext.agentId ?? getSessionId();
474843
475114
  const appState = toolUseContext.getAppState();
474844
475115
  const todos = appState.todos[todoKey] ?? [];
@@ -474899,7 +475170,8 @@ async function getTaskReminderAttachments(messages, toolUseContext) {
474899
475170
  return [];
474900
475171
  }
474901
475172
  const { turnsSinceLastTaskManagement, turnsSinceLastReminder } = getTaskReminderTurnCounts(messages);
474902
- if (turnsSinceLastTaskManagement >= TODO_REMINDER_CONFIG.TURNS_SINCE_WRITE && turnsSinceLastReminder >= TODO_REMINDER_CONFIG.TURNS_BETWEEN_REMINDERS) {
475173
+ const reminderConfig = getTodoReminderConfig();
475174
+ if (turnsSinceLastTaskManagement >= reminderConfig.turnsSinceWrite && turnsSinceLastReminder >= reminderConfig.turnsBetweenReminders) {
474903
475175
  const tasks2 = await listTasks(getTaskListId());
474904
475176
  return [
474905
475177
  {
@@ -475221,7 +475493,7 @@ function isFileReadDenied(filePath, toolPermissionContext) {
475221
475493
  const denyRule = matchingRuleForInput(filePath, toolPermissionContext, "read", "deny");
475222
475494
  return denyRule !== null;
475223
475495
  }
475224
- var skillSearchModules, autoModeStateModule2, BRIEF_TOOL_NAME2 = null, TODO_REMINDER_CONFIG, PLAN_MODE_ATTACHMENT_CONFIG, AUTO_MODE_ATTACHMENT_CONFIG, SKILL_LISTING_SUPPRESSED_QUERY_SOURCES, MAX_MEMORY_LINES = 200, MAX_MEMORY_BYTES = 4096, RELEVANT_MEMORIES_CONFIG, VERIFY_PLAN_REMINDER_CONFIG, ATTACHMENT_FILE_IO_CONCURRENCY = 8, INLINE_NOTIFICATION_MODES, defaultAtMentionedFileDeps, defaultChangedFileDeps, sentSkillNames, suppressNext = false, FILTERED_LISTING_MAX = 30, LSP_DIAGNOSTIC_ATTACHMENT_MAX_WAIT_MS, MIN_SNIP_NUDGE_TOKENS = 1e4, MAX_SNIP_NUDGE_REPEAT_TOKENS = 1e5, SNIP_NUDGE_START_FRACTION = 0.6, SNIP_NUDGE_REPEAT_FRACTION = 0.1;
475496
+ var skillSearchModules, autoModeStateModule2, BRIEF_TOOL_NAME2 = null, PLAN_MODE_ATTACHMENT_CONFIG, AUTO_MODE_ATTACHMENT_CONFIG, SKILL_LISTING_SUPPRESSED_QUERY_SOURCES, MAX_MEMORY_LINES = 200, MAX_MEMORY_BYTES = 4096, RELEVANT_MEMORIES_CONFIG, VERIFY_PLAN_REMINDER_CONFIG, ATTACHMENT_FILE_IO_CONCURRENCY = 8, INLINE_NOTIFICATION_MODES, defaultAtMentionedFileDeps, defaultChangedFileDeps, sentSkillNames, suppressNext = false, FILTERED_LISTING_MAX = 30, LSP_DIAGNOSTIC_ATTACHMENT_MAX_WAIT_MS, MIN_SNIP_NUDGE_TOKENS = 1e4, MAX_SNIP_NUDGE_REPEAT_TOKENS = 1e5, SNIP_NUDGE_START_FRACTION = 0.6, SNIP_NUDGE_REPEAT_FRACTION = 0.1;
475225
475497
  var init_attachments = __esm(() => {
475226
475498
  init_metadata();
475227
475499
  init_Tool();
@@ -475242,6 +475514,7 @@ var init_attachments = __esm(() => {
475242
475514
  init_diagnosticTracking();
475243
475515
  init_settings3();
475244
475516
  init_providers2();
475517
+ init_envUtils();
475245
475518
  init_effort();
475246
475519
  init_utils4();
475247
475520
  init_imageResizer();
@@ -475301,10 +475574,6 @@ var init_attachments = __esm(() => {
475301
475574
  prefetch: (init_prefetch(), __toCommonJS(exports_prefetch))
475302
475575
  };
475303
475576
  autoModeStateModule2 = __toCommonJS(exports_autoModeState);
475304
- TODO_REMINDER_CONFIG = {
475305
- TURNS_SINCE_WRITE: 10,
475306
- TURNS_BETWEEN_REMINDERS: 10
475307
- };
475308
475577
  PLAN_MODE_ATTACHMENT_CONFIG = {
475309
475578
  TURNS_BETWEEN_ATTACHMENTS: 5,
475310
475579
  FULL_REMINDER_EVERY_N_ATTACHMENTS: 5
@@ -496866,6 +497135,10 @@ var init_types13 = __esm(() => {
496866
497135
  deniedMcpServers: exports_external.array(DeniedMcpServerEntrySchema()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. " + "If a server is on the denylist, it will be blocked across all scopes including enterprise. " + "Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),
496867
497136
  hooks: HooksSchema().optional().describe("Custom commands to run before/after tool executions"),
496868
497137
  autoFix: AutoFixConfigSchema.optional().describe("Auto-fix configuration: automatically run lint/test after AI file edits " + "and feed errors back for self-repair."),
497138
+ todoReminder: exports_external.object({
497139
+ turnsSinceWrite: exports_external.number().int().positive().optional().catch(undefined).describe("Assistant turns since last TodoWrite/TaskUpdate before showing reminder (default: 10)"),
497140
+ turnsBetweenReminders: exports_external.number().int().positive().optional().catch(undefined).describe("Assistant turns between reminders (default: 10)")
497141
+ }).optional().catch(undefined).describe("Configuration for todo/task tool usage reminders"),
496869
497142
  worktree: exports_external.preprocess((val) => {
496870
497143
  if (val && typeof val === "object") {
496871
497144
  const copy2 = { ...val };
@@ -496953,7 +497226,6 @@ var init_types13 = __esm(() => {
496953
497226
  maxOutputTokens: exports_external.number().int().positive().optional().describe("Maximum output tokens per response.")
496954
497227
  })).optional().describe("Per-model overrides for context window and max output tokens. " + "Used for OpenAI-compatible models whose limits are not in the built-in catalog. " + "Keys are matched against the model name (exact match preferred, then prefix). " + "CLAUDE_CODE_OPENAI_CONTEXT_WINDOWS / CLAUDE_CODE_OPENAI_MAX_OUTPUT_TOKENS env vars take precedence. " + 'Example: { "qwen3.6-plus": { "contextWindow": 1048576, "maxOutputTokens": 32768 } }'),
496955
497228
  modelPricing: ModelPricingSchema.optional().catch(undefined).describe("Exact-model pricing overrides. Token fields are USD per 1,000,000 tokens; " + "webSearchRequests is USD per request and defaults to $0.01 when omitted. " + "All four token fields are required. Keys are exact, case-sensitive resolved model ids. " + "Shared project settings are ignored for personal USD accounting."),
496956
- toolUseSummariesEnabled: exports_external.boolean().optional().describe("When true, generate a short summary after completed tool batches. Defaults to false."),
496957
497229
  apiRetry: exports_external.object({
496958
497230
  maxRetries: exports_external.union([exports_external.number().int().nonnegative(), exports_external.literal("unlimited")]).optional().describe("How many times a retryable request is retried (rate limits like 429, " + "capacity 529, 5xx, transient network errors). Set 0 to never retry, " + 'any positive integer, or "unlimited" to keep retrying (with the fixed ' + "delayMs below) until the request succeeds or you cancel. " + "When unset, the OPENCLAUDE_MAX_RETRIES env var is used (default 10)."),
496959
497231
  delayMs: exports_external.number().int().nonnegative().optional().describe("Fixed delay in milliseconds between retry attempts when this is set. " + "Set 5000 for 5 seconds, or 0 to retry immediately. A server-provided " + "Retry-After that is even longer is still honored. When unset, the " + "default exponential backoff (and OPENCLAUDE_RETRY_DELAY_MS env var) apply.")
@@ -501924,7 +502196,7 @@ function buildSystemInitMessage(inputs) {
501924
502196
  slash_commands: inputs.commands.filter((c6) => c6.userInvocable !== false).map((c6) => c6.name),
501925
502197
  apiKeySource: getAnthropicApiKeyWithSource().source,
501926
502198
  betas: getSdkBetas(),
501927
- claude_code_version: "0.33.3-by-rayss",
502199
+ claude_code_version: "0.34.0",
501928
502200
  output_style: outputStyle2,
501929
502201
  agents: inputs.agents.map((agent) => agent.agentType),
501930
502202
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -503486,4 +503758,4 @@ export {
503486
503758
  createAcpServer
503487
503759
  };
503488
503760
 
503489
- //# debugId=210344A47775717A64756E2164756E21
503761
+ //# debugId=EC08150E4151F12F64756E2164756E21