@sayknow-cli/agent-core 0.7.19 → 0.7.20

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/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
- ## [0.7.19] - 2026-11-09
5
+ ## [0.7.20] - 2026-11-10
6
6
 
7
7
  ## [0.7.17] - 2026-11-05
8
8
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@sayknow-cli/agent-core",
4
- "version": "0.7.19",
4
+ "version": "0.7.20",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://sayknow-cli.com",
7
7
  "author": "jaybeyond",
@@ -35,15 +35,16 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@sayknow-cli/ai": "0.7.19",
39
- "@sayknow-cli/natives": "0.7.19",
40
- "@sayknow-cli/utils": "0.7.19",
38
+ "@sayknow-cli/ai": "0.7.20",
39
+ "@sayknow-cli/natives": "0.7.20",
40
+ "@sayknow-cli/utils": "0.7.20",
41
41
  "@opentelemetry/api": "^1.9.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@opentelemetry/context-async-hooks": "^2.0.0",
45
45
  "@opentelemetry/sdk-trace-base": "^2.0.0",
46
- "@types/bun": "^1.3.14"
46
+ "@types/bun": "^1.3.14",
47
+ "fast-check": "4.10.2"
47
48
  },
48
49
  "engines": {
49
50
  "bun": ">=1.3.14"
@@ -77,13 +77,22 @@ function getPrunedToolResultContent(message: ToolResultMessage): (TextContent |
77
77
  }
78
78
 
79
79
  /**
80
- * Encode a stored summary before it is placed in the summary template.
81
- * `prompt.render` does not escape, and the summary can contain tool output,
82
- * repository text, or fetched pages. Newlines stay so the summary remains readable.
80
+ * 저장된 요약을 템플릿에 넣기 전에 정리한다. `prompt.render`는 이스케이프하지 않고,
81
+ * 요약에는 도구 출력·저장소 텍스트·받아온 페이지가 섞일 수 있다.
82
+ *
83
+ * 코드 문자는 보존한다. `<`, `>`, `&`, `"`를 엔티티로 바꾸면 `if a < b` 같은 코드가
84
+ * 깨진 채로 모델에 들어간다. 대신 래퍼를 깨는 태그(<summary>, </summary>,
85
+ * <untrusted-content>, </untrusted-content>)만 열기 꺾쇠 뒤에 폭 없는 공백을 넣어
86
+ * 태그로 파싱되지 않게 한다. 개행과 탭은 그대로 두고, 그 밖 제어문자·양방향 문자·
87
+ * 짝 없는 서로게이트는 그대로 걷어낸다.
83
88
  */
84
89
  function escapeSummaryMarkup(value: string): string {
85
- return value.replace(
86
- /[&<>"\u0000-\u001f\u007f-\u009f\u061c\u200e-\u200f\u202a-\u202e\u2066-\u2069\ud800-\udfff]/g,
90
+ const neutralized = value.replace(
91
+ /<\s*\/?\s*(?:untrusted-content|summary)(?=[\s>])[^>]*>/gi,
92
+ tag => `<\u200b${tag.slice(1)}`,
93
+ );
94
+ return neutralized.replace(
95
+ /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069\ud800-\udfff]/g,
87
96
  (char, offset) => {
88
97
  const code = char.charCodeAt(0);
89
98
  const next = value.charCodeAt(offset + 1);
@@ -95,18 +104,7 @@ function escapeSummaryMarkup(value: string): string {
95
104
  return char;
96
105
  }
97
106
  if (char === "\n" || char === "\t") return char;
98
- switch (char) {
99
- case "&":
100
- return "&amp;";
101
- case "<":
102
- return "&lt;";
103
- case ">":
104
- return "&gt;";
105
- case '"':
106
- return "&quot;";
107
- default:
108
- return `\\u${code.toString(16).padStart(4, "0")}`;
109
- }
107
+ return `\\u${code.toString(16).padStart(4, "0")}`;
110
108
  },
111
109
  );
112
110
  }