@uvl000/claude-trace 3.0.13-workflowexp.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/README.md +477 -0
  2. package/README.zh-CN.md +477 -0
  3. package/dist/adapt/api-format.d.ts +41 -0
  4. package/dist/adapt/api-format.d.ts.map +1 -0
  5. package/dist/adapt/api-format.js +132 -0
  6. package/dist/adapt/api-format.js.map +1 -0
  7. package/dist/adapt/openai-adapter.d.ts +123 -0
  8. package/dist/adapt/openai-adapter.d.ts.map +1 -0
  9. package/dist/adapt/openai-adapter.js +628 -0
  10. package/dist/adapt/openai-adapter.js.map +1 -0
  11. package/dist/cli/cli-common.d.ts +73 -0
  12. package/dist/cli/cli-common.d.ts.map +1 -0
  13. package/dist/cli/cli-common.js +189 -0
  14. package/dist/cli/cli-common.js.map +1 -0
  15. package/dist/cli/cli.d.ts +23 -0
  16. package/dist/cli/cli.d.ts.map +1 -0
  17. package/dist/cli/cli.js +175 -0
  18. package/dist/cli/cli.js.map +1 -0
  19. package/dist/cli/codex-cli.d.ts +24 -0
  20. package/dist/cli/codex-cli.d.ts.map +1 -0
  21. package/dist/cli/codex-cli.js +146 -0
  22. package/dist/cli/codex-cli.js.map +1 -0
  23. package/dist/cli/opencode-cli.d.ts +23 -0
  24. package/dist/cli/opencode-cli.d.ts.map +1 -0
  25. package/dist/cli/opencode-cli.js +156 -0
  26. package/dist/cli/opencode-cli.js.map +1 -0
  27. package/dist/cli/trace-runner.d.ts +21 -0
  28. package/dist/cli/trace-runner.d.ts.map +1 -0
  29. package/dist/cli/trace-runner.js +282 -0
  30. package/dist/cli/trace-runner.js.map +1 -0
  31. package/dist/cli/validate-trace.d.ts +30 -0
  32. package/dist/cli/validate-trace.d.ts.map +1 -0
  33. package/dist/cli/validate-trace.js +230 -0
  34. package/dist/cli/validate-trace.js.map +1 -0
  35. package/dist/cli/verify-offline-bundle.d.ts +13 -0
  36. package/dist/cli/verify-offline-bundle.d.ts.map +1 -0
  37. package/dist/cli/verify-offline-bundle.js +89 -0
  38. package/dist/cli/verify-offline-bundle.js.map +1 -0
  39. package/dist/cli/vibe-coding-proxy-cli.d.ts +12 -0
  40. package/dist/cli/vibe-coding-proxy-cli.d.ts.map +1 -0
  41. package/dist/cli/vibe-coding-proxy-cli.js +218 -0
  42. package/dist/cli/vibe-coding-proxy-cli.js.map +1 -0
  43. package/dist/config/claude-config-overlay.d.ts +69 -0
  44. package/dist/config/claude-config-overlay.d.ts.map +1 -0
  45. package/dist/config/claude-config-overlay.js +229 -0
  46. package/dist/config/claude-config-overlay.js.map +1 -0
  47. package/dist/config/codex-config-overlay.d.ts +122 -0
  48. package/dist/config/codex-config-overlay.d.ts.map +1 -0
  49. package/dist/config/codex-config-overlay.js +352 -0
  50. package/dist/config/codex-config-overlay.js.map +1 -0
  51. package/dist/index.d.ts +15 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +37 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/intercept/forward-proxy.d.ts +77 -0
  56. package/dist/intercept/forward-proxy.d.ts.map +1 -0
  57. package/dist/intercept/forward-proxy.js +368 -0
  58. package/dist/intercept/forward-proxy.js.map +1 -0
  59. package/dist/intercept/header-redaction.d.ts +7 -0
  60. package/dist/intercept/header-redaction.d.ts.map +1 -0
  61. package/dist/intercept/header-redaction.js +28 -0
  62. package/dist/intercept/header-redaction.js.map +1 -0
  63. package/dist/intercept/interceptor-loader.js +26 -0
  64. package/dist/intercept/interceptor.d.ts +164 -0
  65. package/dist/intercept/interceptor.d.ts.map +1 -0
  66. package/dist/intercept/interceptor.js +496 -0
  67. package/dist/intercept/interceptor.js.map +1 -0
  68. package/dist/intercept/mitm-cert.d.ts +53 -0
  69. package/dist/intercept/mitm-cert.d.ts.map +1 -0
  70. package/dist/intercept/mitm-cert.js +259 -0
  71. package/dist/intercept/mitm-cert.js.map +1 -0
  72. package/dist/intercept/proxy-log-writer.d.ts +77 -0
  73. package/dist/intercept/proxy-log-writer.d.ts.map +1 -0
  74. package/dist/intercept/proxy-log-writer.js +323 -0
  75. package/dist/intercept/proxy-log-writer.js.map +1 -0
  76. package/dist/intercept/proxy-targets.d.ts +69 -0
  77. package/dist/intercept/proxy-targets.d.ts.map +1 -0
  78. package/dist/intercept/proxy-targets.js +129 -0
  79. package/dist/intercept/proxy-targets.js.map +1 -0
  80. package/dist/intercept/reverse-proxy.d.ts +191 -0
  81. package/dist/intercept/reverse-proxy.d.ts.map +1 -0
  82. package/dist/intercept/reverse-proxy.js +807 -0
  83. package/dist/intercept/reverse-proxy.js.map +1 -0
  84. package/dist/intercept/token-extractor.js +28 -0
  85. package/dist/report/html-generator.d.ts +96 -0
  86. package/dist/report/html-generator.d.ts.map +1 -0
  87. package/dist/report/html-generator.js +225 -0
  88. package/dist/report/html-generator.js.map +1 -0
  89. package/dist/report/index-generator.d.ts +89 -0
  90. package/dist/report/index-generator.d.ts.map +1 -0
  91. package/dist/report/index-generator.js +319 -0
  92. package/dist/report/index-generator.js.map +1 -0
  93. package/dist/report/shared-conversation-processor.d.ts +200 -0
  94. package/dist/report/shared-conversation-processor.d.ts.map +1 -0
  95. package/dist/report/shared-conversation-processor.js +720 -0
  96. package/dist/report/shared-conversation-processor.js.map +1 -0
  97. package/dist/routing/codex-routing.d.ts +40 -0
  98. package/dist/routing/codex-routing.d.ts.map +1 -0
  99. package/dist/routing/codex-routing.js +96 -0
  100. package/dist/routing/codex-routing.js.map +1 -0
  101. package/dist/routing/proxy-routing.d.ts +48 -0
  102. package/dist/routing/proxy-routing.d.ts.map +1 -0
  103. package/dist/routing/proxy-routing.js +113 -0
  104. package/dist/routing/proxy-routing.js.map +1 -0
  105. package/dist/tools/binary-utils.d.ts +29 -0
  106. package/dist/tools/binary-utils.d.ts.map +1 -0
  107. package/dist/tools/binary-utils.js +134 -0
  108. package/dist/tools/binary-utils.js.map +1 -0
  109. package/dist/tools/claude.d.ts +61 -0
  110. package/dist/tools/claude.d.ts.map +1 -0
  111. package/dist/tools/claude.js +449 -0
  112. package/dist/tools/claude.js.map +1 -0
  113. package/dist/tools/codex.d.ts +70 -0
  114. package/dist/tools/codex.d.ts.map +1 -0
  115. package/dist/tools/codex.js +492 -0
  116. package/dist/tools/codex.js.map +1 -0
  117. package/dist/tools/opencode.d.ts +85 -0
  118. package/dist/tools/opencode.d.ts.map +1 -0
  119. package/dist/tools/opencode.js +401 -0
  120. package/dist/tools/opencode.js.map +1 -0
  121. package/dist/tools/types.d.ts +91 -0
  122. package/dist/tools/types.d.ts.map +1 -0
  123. package/dist/tools/types.js +11 -0
  124. package/dist/tools/types.js.map +1 -0
  125. package/dist/types.d.ts +158 -0
  126. package/dist/types.d.ts.map +1 -0
  127. package/dist/types.js +12 -0
  128. package/dist/types.js.map +1 -0
  129. package/frontend/dist/index.global.js +1551 -0
  130. package/frontend/dist/styles.css +1027 -0
  131. package/frontend/template.html +19 -0
  132. package/node_modules/agent-base/LICENSE +22 -0
  133. package/node_modules/agent-base/README.md +69 -0
  134. package/node_modules/agent-base/dist/helpers.d.ts +15 -0
  135. package/node_modules/agent-base/dist/helpers.d.ts.map +1 -0
  136. package/node_modules/agent-base/dist/helpers.js +66 -0
  137. package/node_modules/agent-base/dist/helpers.js.map +1 -0
  138. package/node_modules/agent-base/dist/index.d.ts +41 -0
  139. package/node_modules/agent-base/dist/index.d.ts.map +1 -0
  140. package/node_modules/agent-base/dist/index.js +178 -0
  141. package/node_modules/agent-base/dist/index.js.map +1 -0
  142. package/node_modules/agent-base/package.json +46 -0
  143. package/node_modules/debug/LICENSE +20 -0
  144. package/node_modules/debug/README.md +481 -0
  145. package/node_modules/debug/package.json +64 -0
  146. package/node_modules/debug/src/browser.js +272 -0
  147. package/node_modules/debug/src/common.js +292 -0
  148. package/node_modules/debug/src/index.js +10 -0
  149. package/node_modules/debug/src/node.js +263 -0
  150. package/node_modules/http-proxy-agent/LICENSE +22 -0
  151. package/node_modules/http-proxy-agent/README.md +44 -0
  152. package/node_modules/http-proxy-agent/dist/index.d.ts +44 -0
  153. package/node_modules/http-proxy-agent/dist/index.d.ts.map +1 -0
  154. package/node_modules/http-proxy-agent/dist/index.js +148 -0
  155. package/node_modules/http-proxy-agent/dist/index.js.map +1 -0
  156. package/node_modules/http-proxy-agent/package.json +47 -0
  157. package/node_modules/https-proxy-agent/LICENSE +22 -0
  158. package/node_modules/https-proxy-agent/README.md +70 -0
  159. package/node_modules/https-proxy-agent/dist/index.d.ts +47 -0
  160. package/node_modules/https-proxy-agent/dist/index.d.ts.map +1 -0
  161. package/node_modules/https-proxy-agent/dist/index.js +180 -0
  162. package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  163. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +15 -0
  164. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +1 -0
  165. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
  166. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  167. package/node_modules/https-proxy-agent/package.json +50 -0
  168. package/node_modules/ms/index.js +162 -0
  169. package/node_modules/ms/license.md +21 -0
  170. package/node_modules/ms/package.json +38 -0
  171. package/node_modules/ms/readme.md +59 -0
  172. package/node_modules/node-forge/LICENSE +331 -0
  173. package/node_modules/node-forge/README.md +2071 -0
  174. package/node_modules/node-forge/dist/forge.all.min.js +2 -0
  175. package/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
  176. package/node_modules/node-forge/dist/forge.min.js +2 -0
  177. package/node_modules/node-forge/dist/forge.min.js.map +1 -0
  178. package/node_modules/node-forge/dist/prime.worker.min.js +2 -0
  179. package/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
  180. package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
  181. package/node_modules/node-forge/lib/aes.js +1091 -0
  182. package/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
  183. package/node_modules/node-forge/lib/asn1-validator.js +91 -0
  184. package/node_modules/node-forge/lib/asn1.js +1503 -0
  185. package/node_modules/node-forge/lib/baseN.js +186 -0
  186. package/node_modules/node-forge/lib/cipher.js +230 -0
  187. package/node_modules/node-forge/lib/cipherModes.js +999 -0
  188. package/node_modules/node-forge/lib/des.js +496 -0
  189. package/node_modules/node-forge/lib/ed25519.js +1091 -0
  190. package/node_modules/node-forge/lib/forge.js +13 -0
  191. package/node_modules/node-forge/lib/form.js +149 -0
  192. package/node_modules/node-forge/lib/hmac.js +146 -0
  193. package/node_modules/node-forge/lib/http.js +1346 -0
  194. package/node_modules/node-forge/lib/index.all.js +16 -0
  195. package/node_modules/node-forge/lib/index.js +33 -0
  196. package/node_modules/node-forge/lib/jsbn.js +1294 -0
  197. package/node_modules/node-forge/lib/kem.js +168 -0
  198. package/node_modules/node-forge/lib/log.js +319 -0
  199. package/node_modules/node-forge/lib/md.all.js +13 -0
  200. package/node_modules/node-forge/lib/md.js +11 -0
  201. package/node_modules/node-forge/lib/md5.js +289 -0
  202. package/node_modules/node-forge/lib/mgf.js +12 -0
  203. package/node_modules/node-forge/lib/mgf1.js +57 -0
  204. package/node_modules/node-forge/lib/oids.js +180 -0
  205. package/node_modules/node-forge/lib/pbe.js +1023 -0
  206. package/node_modules/node-forge/lib/pbkdf2.js +211 -0
  207. package/node_modules/node-forge/lib/pem.js +237 -0
  208. package/node_modules/node-forge/lib/pkcs1.js +276 -0
  209. package/node_modules/node-forge/lib/pkcs12.js +1078 -0
  210. package/node_modules/node-forge/lib/pkcs7.js +1260 -0
  211. package/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
  212. package/node_modules/node-forge/lib/pki.js +102 -0
  213. package/node_modules/node-forge/lib/prime.js +297 -0
  214. package/node_modules/node-forge/lib/prime.worker.js +168 -0
  215. package/node_modules/node-forge/lib/prng.js +419 -0
  216. package/node_modules/node-forge/lib/pss.js +241 -0
  217. package/node_modules/node-forge/lib/random.js +191 -0
  218. package/node_modules/node-forge/lib/rc2.js +410 -0
  219. package/node_modules/node-forge/lib/rsa.js +1968 -0
  220. package/node_modules/node-forge/lib/sha1.js +319 -0
  221. package/node_modules/node-forge/lib/sha256.js +327 -0
  222. package/node_modules/node-forge/lib/sha512.js +561 -0
  223. package/node_modules/node-forge/lib/socket.js +287 -0
  224. package/node_modules/node-forge/lib/ssh.js +236 -0
  225. package/node_modules/node-forge/lib/tls.js +4282 -0
  226. package/node_modules/node-forge/lib/tlssocket.js +249 -0
  227. package/node_modules/node-forge/lib/util.js +2652 -0
  228. package/node_modules/node-forge/lib/x509.js +3251 -0
  229. package/node_modules/node-forge/lib/xhr.js +738 -0
  230. package/node_modules/node-forge/package.json +123 -0
  231. package/node_modules/smol-toml/LICENSE +24 -0
  232. package/node_modules/smol-toml/README.md +239 -0
  233. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  234. package/node_modules/smol-toml/dist/date.js +127 -0
  235. package/node_modules/smol-toml/dist/error.d.ts +38 -0
  236. package/node_modules/smol-toml/dist/error.js +63 -0
  237. package/node_modules/smol-toml/dist/extract.d.ts +30 -0
  238. package/node_modules/smol-toml/dist/extract.js +100 -0
  239. package/node_modules/smol-toml/dist/index.cjs +897 -0
  240. package/node_modules/smol-toml/dist/index.d.ts +43 -0
  241. package/node_modules/smol-toml/dist/index.js +33 -0
  242. package/node_modules/smol-toml/dist/parse.d.ts +37 -0
  243. package/node_modules/smol-toml/dist/parse.js +148 -0
  244. package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
  245. package/node_modules/smol-toml/dist/primitive.js +179 -0
  246. package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
  247. package/node_modules/smol-toml/dist/stringify.js +167 -0
  248. package/node_modules/smol-toml/dist/struct.d.ts +32 -0
  249. package/node_modules/smol-toml/dist/struct.js +184 -0
  250. package/node_modules/smol-toml/dist/util.d.ts +42 -0
  251. package/node_modules/smol-toml/dist/util.js +111 -0
  252. package/node_modules/smol-toml/package.json +54 -0
  253. package/offline/bin/claude-trace +6 -0
  254. package/offline/bin/claude-wrapper +13 -0
  255. package/offline/bin/install-agent +14 -0
  256. package/offline/bin/validate-trace +6 -0
  257. package/offline/bin/verify-bundle +7 -0
  258. package/package.json +103 -0
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { type IntegersAsBigInt } from './primitive.js';
29
+ import { type TomlTable, type TomlValue } from './util.js';
30
+ export declare function parseKey(str: string, ptr: number, end?: string): [string[], number];
31
+ export declare function parseInlineTable(str: string, ptr: number, depth: number, integersAsBigInt: IntegersAsBigInt): [TomlTable, number];
32
+ export declare function parseArray(str: string, ptr: number, depth: number, integersAsBigInt: IntegersAsBigInt): [TomlValue[], number];
@@ -0,0 +1,184 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { parseString } from './primitive.js';
29
+ import { extractValue } from './extract.js';
30
+ import { getStringEnd, indexOfNewline, skipComment, skipVoid } from './util.js';
31
+ import { TomlError } from './error.js';
32
+ let KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
33
+ export function parseKey(str, ptr, end = '=') {
34
+ let dot = ptr - 1;
35
+ let parsed = [];
36
+ let endPtr = str.indexOf(end, ptr);
37
+ if (endPtr < 0) {
38
+ throw new TomlError('incomplete key-value: cannot find end of key', {
39
+ toml: str,
40
+ ptr: ptr,
41
+ });
42
+ }
43
+ do {
44
+ let c = str[ptr = ++dot];
45
+ // If it's whitespace, ignore
46
+ if (c !== ' ' && c !== '\t') {
47
+ // If it's a string
48
+ if (c === '"' || c === '\'') {
49
+ if (c === str[ptr + 1] && c === str[ptr + 2]) {
50
+ throw new TomlError('multiline strings are not allowed in keys', {
51
+ toml: str,
52
+ ptr: ptr,
53
+ });
54
+ }
55
+ let eos = getStringEnd(str, ptr);
56
+ if (eos < 0) {
57
+ throw new TomlError('unfinished string encountered', {
58
+ toml: str,
59
+ ptr: ptr,
60
+ });
61
+ }
62
+ dot = str.indexOf('.', eos);
63
+ let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
64
+ let newLine = indexOfNewline(strEnd);
65
+ if (newLine > -1) {
66
+ throw new TomlError('newlines are not allowed in keys', {
67
+ toml: str,
68
+ ptr: ptr + dot + newLine,
69
+ });
70
+ }
71
+ if (strEnd.trimStart()) {
72
+ throw new TomlError('found extra tokens after the string part', {
73
+ toml: str,
74
+ ptr: eos,
75
+ });
76
+ }
77
+ if (endPtr < eos) {
78
+ endPtr = str.indexOf(end, eos);
79
+ if (endPtr < 0) {
80
+ throw new TomlError('incomplete key-value: cannot find end of key', {
81
+ toml: str,
82
+ ptr: ptr,
83
+ });
84
+ }
85
+ }
86
+ parsed.push(parseString(str, ptr, eos));
87
+ }
88
+ else {
89
+ // Normal raw key part consumption and validation
90
+ dot = str.indexOf('.', ptr);
91
+ let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
92
+ if (!KEY_PART_RE.test(part)) {
93
+ throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {
94
+ toml: str,
95
+ ptr: ptr,
96
+ });
97
+ }
98
+ parsed.push(part.trimEnd());
99
+ }
100
+ }
101
+ // Until there's no more dot
102
+ } while (dot + 1 && dot < endPtr);
103
+ return [parsed, skipVoid(str, endPtr + 1, true, true)];
104
+ }
105
+ export function parseInlineTable(str, ptr, depth, integersAsBigInt) {
106
+ let res = {};
107
+ let seen = new Set();
108
+ let c;
109
+ ptr++;
110
+ while ((c = str[ptr++]) !== '}' && c) {
111
+ if (c === ',') {
112
+ throw new TomlError('expected value, found comma', {
113
+ toml: str,
114
+ ptr: ptr - 1,
115
+ });
116
+ }
117
+ else if (c === '#')
118
+ ptr = skipComment(str, ptr);
119
+ else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
120
+ let k;
121
+ let t = res;
122
+ let hasOwn = false;
123
+ let [key, keyEndPtr] = parseKey(str, ptr - 1);
124
+ for (let i = 0; i < key.length; i++) {
125
+ if (i)
126
+ t = hasOwn ? t[k] : (t[k] = {});
127
+ k = key[i];
128
+ if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
129
+ throw new TomlError('trying to redefine an already defined value', {
130
+ toml: str,
131
+ ptr: ptr,
132
+ });
133
+ }
134
+ if (!hasOwn && k === '__proto__') {
135
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
136
+ }
137
+ }
138
+ if (hasOwn) {
139
+ throw new TomlError('trying to redefine an already defined value', {
140
+ toml: str,
141
+ ptr: ptr,
142
+ });
143
+ }
144
+ let [value, valueEndPtr] = extractValue(str, keyEndPtr, '}', depth - 1, integersAsBigInt);
145
+ seen.add(value);
146
+ t[k] = value;
147
+ ptr = valueEndPtr;
148
+ }
149
+ }
150
+ if (!c) {
151
+ throw new TomlError('unfinished table encountered', {
152
+ toml: str,
153
+ ptr: ptr,
154
+ });
155
+ }
156
+ return [res, ptr];
157
+ }
158
+ export function parseArray(str, ptr, depth, integersAsBigInt) {
159
+ let res = [];
160
+ let c;
161
+ ptr++;
162
+ while ((c = str[ptr++]) !== ']' && c) {
163
+ if (c === ',') {
164
+ throw new TomlError('expected value, found comma', {
165
+ toml: str,
166
+ ptr: ptr - 1,
167
+ });
168
+ }
169
+ else if (c === '#')
170
+ ptr = skipComment(str, ptr);
171
+ else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
172
+ let e = extractValue(str, ptr - 1, ']', depth - 1, integersAsBigInt);
173
+ res.push(e[0]);
174
+ ptr = e[1];
175
+ }
176
+ }
177
+ if (!c) {
178
+ throw new TomlError('unfinished array encountered', {
179
+ toml: str,
180
+ ptr: ptr,
181
+ });
182
+ }
183
+ return [res, ptr];
184
+ }
@@ -0,0 +1,42 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import type { TomlDate } from './date.js';
29
+ export type TomlPrimitive = string | number | bigint | boolean | TomlDate;
30
+ export type TomlTable = {
31
+ [key: string]: TomlValue;
32
+ };
33
+ export type TomlValue = TomlPrimitive | TomlValue[] | TomlTable;
34
+ export type TomlTableWithoutBigInt = {
35
+ [key: string]: TomlValueWithoutBigInt;
36
+ };
37
+ export type TomlValueWithoutBigInt = Exclude<TomlPrimitive, bigint> | TomlValueWithoutBigInt[] | TomlTableWithoutBigInt;
38
+ export declare function indexOfNewline(str: string, start?: number, end?: number): number;
39
+ export declare function skipComment(str: string, ptr: number): number;
40
+ export declare function skipVoid(str: string, ptr: number, banNewLines?: boolean, banComments?: boolean): number;
41
+ export declare function skipUntil(str: string, ptr: number, sep: string, end?: string, banNewLines?: boolean): number;
42
+ export declare function getStringEnd(str: string, seek: number): number;
@@ -0,0 +1,111 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { TomlError } from './error.js';
29
+ function isEscaped(str, ptr) {
30
+ let i = 0;
31
+ while (str[ptr - ++i] === '\\')
32
+ ;
33
+ return --i && (i % 2);
34
+ }
35
+ export function indexOfNewline(str, start = 0, end = str.length) {
36
+ let idx = str.indexOf('\n', start);
37
+ if (str[idx - 1] === '\r')
38
+ idx--;
39
+ return idx <= end ? idx : -1;
40
+ }
41
+ export function skipComment(str, ptr) {
42
+ for (let i = ptr; i < str.length; i++) {
43
+ let c = str[i];
44
+ if (c === '\n')
45
+ return i;
46
+ if (c === '\r' && str[i + 1] === '\n')
47
+ return i + 1;
48
+ if ((c < '\x20' && c !== '\t') || c === '\x7f') {
49
+ throw new TomlError('control characters are not allowed in comments', {
50
+ toml: str,
51
+ ptr: ptr,
52
+ });
53
+ }
54
+ }
55
+ return str.length;
56
+ }
57
+ export function skipVoid(str, ptr, banNewLines, banComments) {
58
+ let c;
59
+ while (1) {
60
+ while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || c === '\r' && str[ptr + 1] === '\n')))
61
+ ptr++;
62
+ // Tucking the return statement here would save 5 characters >:)
63
+ // But TypeScript fails to detect there is no way to exit the loop so it complains about the lack of final return
64
+ if (banComments || c !== '#')
65
+ break;
66
+ ptr = skipComment(str, ptr);
67
+ }
68
+ return ptr;
69
+ }
70
+ export function skipUntil(str, ptr, sep, end, banNewLines = false) {
71
+ if (!end) {
72
+ ptr = indexOfNewline(str, ptr);
73
+ return ptr < 0 ? str.length : ptr;
74
+ }
75
+ for (let i = ptr; i < str.length; i++) {
76
+ let c = str[i];
77
+ if (c === '#') {
78
+ i = indexOfNewline(str, i);
79
+ }
80
+ else if (c === sep) {
81
+ return i + 1;
82
+ }
83
+ else if (c === end || (banNewLines && (c === '\n' || (c === '\r' && str[i + 1] === '\n')))) {
84
+ return i;
85
+ }
86
+ }
87
+ throw new TomlError('cannot find end of structure', {
88
+ toml: str,
89
+ ptr: ptr
90
+ });
91
+ }
92
+ export function getStringEnd(str, seek) {
93
+ let first = str[seek];
94
+ let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2]
95
+ ? str.slice(seek, seek + 3)
96
+ : first;
97
+ seek += target.length - 1;
98
+ do
99
+ seek = str.indexOf(target, ++seek);
100
+ while (seek > -1 && first !== "'" && isEscaped(str, seek));
101
+ if (seek > -1) {
102
+ seek += target.length;
103
+ if (target.length > 1) {
104
+ if (str[seek] === first)
105
+ seek++;
106
+ if (str[seek] === first)
107
+ seek++;
108
+ }
109
+ }
110
+ return seek;
111
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "smol-toml",
3
+ "license": "BSD-3-Clause",
4
+ "version": "1.6.1",
5
+ "description": "A small, fast, and correct TOML parser/serializer",
6
+ "author": "Cynthia <cyyynthia@borkenware.com>",
7
+ "repository": "github:squirrelchat/smol-toml",
8
+ "bugs": "https://github.com/squirrelchat/smol-toml/issues",
9
+ "funding": "https://github.com/sponsors/cyyynthia",
10
+ "keywords": [
11
+ "toml",
12
+ "parser",
13
+ "serializer"
14
+ ],
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">= 18"
18
+ },
19
+ "devDependencies": {
20
+ "@iarna/toml": "3.0.0",
21
+ "@ltd/j-toml": "^1.38.0",
22
+ "@tsconfig/node-lts": "^24.0.0",
23
+ "@tsconfig/strictest": "^2.0.8",
24
+ "@types/node": "^25.5.0",
25
+ "@vitest/ui": "^4.1.1",
26
+ "esbuild": "^0.27.4",
27
+ "fast-toml": "^0.5.4",
28
+ "pin-github-action": "^3.4.0",
29
+ "typescript": "^5.9.3",
30
+ "vitest": "^4.1.1"
31
+ },
32
+ "main": "./dist/index.cjs",
33
+ "module": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
35
+ "exports": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js",
38
+ "require": "./dist/index.cjs"
39
+ },
40
+ "files": [
41
+ "README.md",
42
+ "LICENSE",
43
+ "dist"
44
+ ],
45
+ "scripts": {
46
+ "test": "vitest",
47
+ "test-ui": "vitest --ui",
48
+ "bench": "vitest bench",
49
+ "build": "pnpm run build:mjs && pnpm run build:cjs && node test/package/package-test.mjs",
50
+ "build:mjs": "tsc",
51
+ "build:cjs": "esbuild dist/index.js --bundle --platform=node --target=node18 --format=cjs --outfile=dist/index.cjs",
52
+ "update-gha": "pin-github-action .github/workflows"
53
+ }
54
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+ script_path="$(readlink -f "$0")"
4
+ bundle_dir="$(CDPATH= cd -- "$(dirname -- "$script_path")/.." && pwd)"
5
+ exec "$bundle_dir/node/bin/node" \
6
+ "$bundle_dir/package/node_modules/@uvl000/claude-trace/dist/cli/cli.js" "$@"
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+ script_path="$(readlink -f "$0")"
4
+ bundle_dir="$(CDPATH= cd -- "$(dirname -- "$script_path")/.." && pwd)"
5
+ if [ "${CLAUDE_TRACE_ENABLED:-0}" = "1" ]; then
6
+ exec "$bundle_dir/bin/claude-trace" \
7
+ --claude-path "$HOME/.local/bin/claude-real" \
8
+ --include-all-requests \
9
+ --no-open \
10
+ --log trace \
11
+ --run-with "$@"
12
+ fi
13
+ exec "$HOME/.local/bin/claude-real" "$@"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+ script_path="$(readlink -f "$0")"
4
+ bundle_dir="$(CDPATH= cd -- "$(dirname -- "$script_path")/.." && pwd)"
5
+ mkdir -p "$HOME/.local/bin"
6
+ if [ ! -x "$HOME/.local/bin/claude-real" ]; then
7
+ real_binary="$(readlink -f "$HOME/.local/bin/claude")"
8
+ if [ "$real_binary" = "$HOME/.local/bin/claude" ]; then
9
+ mv "$HOME/.local/bin/claude" "$HOME/.local/bin/claude-real"
10
+ else
11
+ ln -sfn "$real_binary" "$HOME/.local/bin/claude-real"
12
+ fi
13
+ fi
14
+ ln -sfn "$bundle_dir/bin/claude-wrapper" "$HOME/.local/bin/claude"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+ script_path="$(readlink -f "$0")"
4
+ bundle_dir="$(CDPATH= cd -- "$(dirname -- "$script_path")/.." && pwd)"
5
+ exec "$bundle_dir/node/bin/node" \
6
+ "$bundle_dir/package/node_modules/@uvl000/claude-trace/dist/cli/validate-trace.js" "$@"
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+ script_path="$(readlink -f "$0")"
4
+ bundle_dir="$(CDPATH= cd -- "$(dirname -- "$script_path")/.." && pwd)"
5
+ exec "$bundle_dir/node/bin/node" \
6
+ "$bundle_dir/package/node_modules/@uvl000/claude-trace/dist/cli/verify-offline-bundle.js" \
7
+ "$bundle_dir"
package/package.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "name": "@uvl000/claude-trace",
3
+ "version": "3.0.13-workflowexp.1",
4
+ "description": "WorkflowExp fork for recording API traffic from Claude Code, OpenCode, and Codex CLI",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "claude-trace": "dist/cli/cli.js",
8
+ "claude-trace-validate": "dist/cli/validate-trace.js",
9
+ "opencode-trace": "dist/cli/opencode-cli.js",
10
+ "codex-trace": "dist/cli/codex-cli.js",
11
+ "vibe-coding-proxy": "dist/cli/vibe-coding-proxy-cli.js"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc && mkdir -p dist/intercept && cp src/intercept/interceptor-loader.js src/intercept/token-extractor.js dist/intercept/ && npm run build:frontend",
15
+ "build:frontend": "cd frontend && npm run build",
16
+ "setup": "npm install && cd frontend && npm install",
17
+ "predev": "tsc && mkdir -p dist/intercept && cp src/intercept/interceptor-loader.js src/intercept/token-extractor.js dist/intercept/",
18
+ "dev": "concurrently \"npm run dev:core\" \"npm run dev:copy\" \"npm run dev:frontend\"",
19
+ "dev:core": "tsc --watch --preserveWatchOutput",
20
+ "dev:copy": "npx nodemon --watch src/intercept/interceptor-loader.js --watch src/intercept/token-extractor.js --exec 'mkdir -p dist/intercept && cp src/intercept/interceptor-loader.js src/intercept/token-extractor.js dist/intercept/'",
21
+ "dev:frontend": "cd frontend && npm run dev",
22
+ "clean": "rm -rf dist",
23
+ "prepublishOnly": "npm run clean && npm run build",
24
+ "test": "node --require ./dist/intercept/interceptor.js echo 'test'",
25
+ "test:unit": "npx tsx --test test/*.test.ts",
26
+ "test:generate": "npx tsx src/cli/cli.ts test/test-traffic.jsonl test/index.html",
27
+ "typecheck": "tsc --noEmit",
28
+ "pack:workflowexp": "bash scripts/pack-workflowexp.sh releases",
29
+ "publish:check": "bash scripts/publish.sh --check",
30
+ "publish:dry-run": "bash scripts/publish.sh --dry-run",
31
+ "publish:release": "bash scripts/publish.sh",
32
+ "publish:patch": "bash scripts/publish.sh patch",
33
+ "publish:minor": "bash scripts/publish.sh minor",
34
+ "publish:major": "bash scripts/publish.sh major",
35
+ "publish:oidc:check": "bash scripts/publish-oidc.sh --check",
36
+ "publish:oidc:dry-run": "bash scripts/publish-oidc.sh --dry-run",
37
+ "publish:oidc": "bash scripts/publish-oidc.sh",
38
+ "publish:oidc:patch": "bash scripts/publish-oidc.sh patch",
39
+ "publish:oidc:minor": "bash scripts/publish-oidc.sh minor",
40
+ "publish:oidc:major": "bash scripts/publish-oidc.sh major"
41
+ },
42
+ "files": [
43
+ "dist/**/*",
44
+ "frontend/dist/**/*",
45
+ "frontend/template.html",
46
+ "offline/bin/**/*",
47
+ "README.md",
48
+ "README.zh-CN.md"
49
+ ],
50
+ "keywords": [
51
+ "claude",
52
+ "opencode",
53
+ "codex",
54
+ "anthropic",
55
+ "logging",
56
+ "api",
57
+ "debugging",
58
+ "http",
59
+ "interception"
60
+ ],
61
+ "author": "Mario Zechner",
62
+ "license": "MIT",
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "git+https://github.com/hanqunfeng/claude-trace.git"
66
+ },
67
+ "engines": {
68
+ "node": ">=16.0.0"
69
+ },
70
+ "devDependencies": {
71
+ "@anthropic-ai/sdk": "^0.52.0",
72
+ "@types/node": "^20.0.0",
73
+ "@types/node-forge": "^1.3.14",
74
+ "concurrently": "^9.1.2",
75
+ "nodemon": "^3.1.10",
76
+ "tsx": "4.23.13",
77
+ "typescript": "^5.0.0"
78
+ },
79
+ "directories": {
80
+ "test": "test"
81
+ },
82
+ "types": "./dist/index.d.ts",
83
+ "bugs": {
84
+ "url": "https://github.com/hanqunfeng/claude-trace/issues"
85
+ },
86
+ "homepage": "https://github.com/hanqunfeng/claude-trace#readme",
87
+ "publishConfig": {
88
+ "access": "public",
89
+ "tag": "workflowexp"
90
+ },
91
+ "dependencies": {
92
+ "http-proxy-agent": "7.0.2",
93
+ "https-proxy-agent": "7.0.6",
94
+ "node-forge": "^1.4.0",
95
+ "smol-toml": "^1.6.1"
96
+ },
97
+ "bundleDependencies": [
98
+ "http-proxy-agent",
99
+ "https-proxy-agent",
100
+ "node-forge",
101
+ "smol-toml"
102
+ ]
103
+ }