chatccc 0.2.308 → 0.2.309

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.
@@ -397,6 +397,8 @@ deepccc-cli --raw-stream-json --prompt "Read the specified files" > machine-even
397
397
 
398
398
  当前最新工具批次在总预算允许时优先保留完整结果;历史单项上限不再无条件截短尚未读取的新结果。总预算仍生效,过大结果或多结果批次仍可能缩短,须按实际视图和缩短标记分段读取。原始日志完整不能代替这一步检查。
399
399
 
400
+ 0.2.40 起,损坏的保留参数标记(例如工件哈希写错、标记不完整或包有空白)同样在权限、执行和文件写入前被拒绝;错误指出受影响字段,合法引用给出当前会话的读取路径,损坏引用要求检查实际文件而不猜哈希。不会自动读取、修补或执行引用。合法脚本内部用于说明或处理的标记字面量仍可使用。
401
+
400
402
  输出是逐行 JSON:
401
403
 
402
404
  ```jsonl
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepccc",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "description": "A lightweight coding agent with OpenAI-compatible and Anthropic Messages API support.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -1508,22 +1508,33 @@ function requireCommandArguments(name, input, requiredStrings, allowEmpty = [])
1508
1508
  + "Pass these named fields directly; do not wrap the arguments in raw or a JSON string.");
1509
1509
  }
1510
1510
  }
1511
- function requireCompleteHistoricalArguments(input) {
1512
- const pending = [input];
1511
+ function requireCompleteHistoricalArguments(input, argumentArtifactDirectory) {
1512
+ const pending = [{ value: input, field: "input" }];
1513
1513
  const seen = new WeakSet();
1514
1514
  while (pending.length) {
1515
- const value = pending.pop();
1515
+ const { value, field } = pending.pop();
1516
1516
  const metadata = value && typeof value === "object" ? value : undefined;
1517
- const artifactReference = typeof metadata?.__deepccc_input_artifact === "string"
1518
- && /^[a-f0-9]{64}\.txt$/.test(metadata.__deepccc_input_artifact);
1517
+ const artifactReference = typeof metadata?.__deepccc_input_artifact === "string";
1519
1518
  if (isOmittedToolArgument(value) || artifactReference || metadata?.__deepccc_input_unavailable === true
1520
1519
  || metadata?.__deepccc_payload_unavailable === true) {
1521
- throw new Error("This historical argument was omitted; read its referenced artifact or original saved file before reuse");
1520
+ const candidate = artifactReference ? metadata.__deepccc_input_artifact
1521
+ : typeof value === "string" ? value.match(/^\s*\[\[DEEPCCC_OMITTED_TOOL_ARGUMENT artifact=([a-f0-9]{64}\.txt)\]\]\s*$/)?.[1] : undefined;
1522
+ const filename = candidate && /^[a-f0-9]{64}\.txt$/.test(candidate) ? candidate : undefined;
1523
+ const hint = filename && argumentArtifactDirectory
1524
+ ? `Try read_file at ${join(argumentArtifactDirectory, filename)}; the reader verifies the content hash. If absent, use the original saved file. `
1525
+ : filename ? `Artifact reference: ${filename}. Read the original saved file or the actual session artifact directory. `
1526
+ : "The reference is incomplete or has no recoverable artifact name; inspect the actual saved file/session artifacts and do not guess a hash. ";
1527
+ throw new Error(`This historical argument was omitted at ${field}; ${hint}Read complete content and check the current task before reuse; never execute the marker.`);
1522
1528
  }
1523
1529
  if (value && typeof value === "object" && !seen.has(value)) {
1524
1530
  seen.add(value);
1525
- for (const child of Object.values(value))
1526
- pending.push(child);
1531
+ if (Array.isArray(value))
1532
+ value.forEach((child, index) => pending.push({ value: child, field: `${field}[${index}]` }));
1533
+ else
1534
+ for (const [key, child] of Object.entries(value)) {
1535
+ const known = ["code", "content", "args", "command", "path", "executable", "old_string", "new_string", "patch", "input", "raw"].includes(key);
1536
+ pending.push({ value: child, field: field + (known ? `.${key}` : ".[nested]") });
1537
+ }
1527
1538
  }
1528
1539
  }
1529
1540
  }
@@ -2008,7 +2019,7 @@ export function createBuiltinFileTools(cwd, options = {}) {
2008
2019
  continue;
2009
2020
  definition.execute = (input, executionOptions) => {
2010
2021
  try {
2011
- requireCompleteHistoricalArguments(input);
2022
+ requireCompleteHistoricalArguments(input, options.toolArgumentArtifactDir);
2012
2023
  }
2013
2024
  catch (error) {
2014
2025
  return Promise.reject(error);
@@ -3,7 +3,10 @@ export function omittedToolArgument(characters) {
3
3
  return `[[DEEPCCC_OMITTED_TOOL_ARGUMENT chars=${characters}; read the original saved file before reuse]]`;
4
4
  }
5
5
  export function isOmittedToolArgument(value) {
6
- return typeof value === "string" && /^\[\[DEEPCCC_OMITTED_TOOL_ARGUMENT (?:chars=\d+; read the original saved file before reuse|artifact=[a-f0-9]{64}\.txt)\]\]$/.test(value);
6
+ // A model may damage the hash, delimiters or surrounding whitespace. Such a
7
+ // reserved metadata value is still unavailable input, never executable code.
8
+ // Literal marker text inside an ordinary script remains ordinary source.
9
+ return typeof value === "string" && /^\s*\[\[DEEPCCC_OMITTED_TOOL_ARGUMENT(?=\s|\]|$)/.test(value);
7
10
  }
8
11
  export function artifactToolArgument(filename) {
9
12
  if (!/^[a-f0-9]{64}\.txt$/.test(filename))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatccc",
3
- "version": "0.2.308",
3
+ "version": "0.2.309",
4
4
  "description": "Feishu bot bridge for Claude Code",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",