kimi-plugin-cc 3.0.0 → 3.1.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.
Files changed (281) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +3 -14
  3. package/README.md +428 -572
  4. package/assets/logo.svg +6 -0
  5. package/cordis.patch.yml +18 -0
  6. package/dist/background-spawn.js +4 -2
  7. package/dist/cli-client.js +105 -66
  8. package/dist/commands/ask.js +27 -12
  9. package/dist/commands/cancel.js +4 -13
  10. package/dist/commands/cli-helpers.js +1 -1
  11. package/dist/commands/pursue.js +3 -2
  12. package/dist/commands/registry.js +7 -26
  13. package/dist/commands/repair-sessions.js +7 -4
  14. package/dist/commands/replay.js +4 -3
  15. package/dist/commands/rescue.js +17 -5
  16. package/dist/commands/review.js +18 -5
  17. package/dist/commands/setup.js +277 -262
  18. package/dist/commands/swarm.js +20 -7
  19. package/dist/companion.js +142 -18
  20. package/dist/help.js +11 -7
  21. package/dist/hook-escape.js +7 -16
  22. package/dist/hooks/approval-hook.js +1762 -124
  23. package/dist/hooks/approval-policy.js +15 -10
  24. package/dist/hooks/config-safety.js +15 -24
  25. package/dist/hooks/hook-timing.js +1 -1
  26. package/dist/hooks/install-paths.js +179 -107
  27. package/dist/hooks/install.js +44 -166
  28. package/dist/hooks/managed-block.js +44 -95
  29. package/dist/job-store.js +117 -49
  30. package/dist/jobs.js +53 -1
  31. package/dist/kimi-engine.js +68 -92
  32. package/dist/kimi-errors.js +1 -1
  33. package/dist/kimi-journal.js +3 -2
  34. package/dist/kimi-releases.js +28 -49
  35. package/dist/kimi-timeouts.js +1 -15
  36. package/dist/kimi-version-probe.js +24 -72
  37. package/dist/logging.js +12 -7
  38. package/dist/mcp/binding.js +13 -4
  39. package/dist/mcp/job-control.js +386 -89
  40. package/dist/mcp/launcher.js +1 -1
  41. package/dist/mcp/operations.js +387 -193
  42. package/dist/mcp/protocol.js +116 -27
  43. package/dist/mcp/skills.js +130 -0
  44. package/dist/mcp/stdio.js +15 -2
  45. package/dist/native-v2-preflight.js +127 -35
  46. package/dist/parsing.js +45 -11
  47. package/dist/paths.js +20 -10
  48. package/dist/plugin-data.js +28 -83
  49. package/dist/read-scope.js +2 -2
  50. package/dist/render.js +13 -38
  51. package/dist/session-references.js +216 -0
  52. package/dist/session-title.js +1 -1
  53. package/dist/surface-routing.js +92 -5
  54. package/dist/swarm-activation.js +26 -137
  55. package/dist/version.js +1 -1
  56. package/docs/migration.md +45 -227
  57. package/docs/models.md +24 -66
  58. package/docs/safety.md +195 -400
  59. package/docs/session-visibility.md +24 -14
  60. package/docs/swarm-recovery.md +26 -20
  61. package/dsh/index.json +54 -0
  62. package/mcp_config.json +10 -0
  63. package/package.json +23 -82
  64. package/plugin.json +19 -0
  65. package/plugins/kimi-codex/.codex-plugin/plugin.json +7 -7
  66. package/plugins/kimi-codex/.mcp.json +2 -3
  67. package/plugins/kimi-codex/dist/background-spawn.js +4 -2
  68. package/plugins/kimi-codex/dist/cli-client.js +105 -66
  69. package/plugins/kimi-codex/dist/commands/ask.js +27 -12
  70. package/plugins/kimi-codex/dist/commands/cancel.js +4 -13
  71. package/plugins/kimi-codex/dist/commands/cli-helpers.js +1 -1
  72. package/plugins/kimi-codex/dist/commands/pursue.js +3 -2
  73. package/plugins/kimi-codex/dist/commands/registry.js +7 -26
  74. package/plugins/kimi-codex/dist/commands/repair-sessions.js +7 -4
  75. package/plugins/kimi-codex/dist/commands/replay.js +4 -3
  76. package/plugins/kimi-codex/dist/commands/rescue.js +17 -5
  77. package/plugins/kimi-codex/dist/commands/review.js +18 -5
  78. package/plugins/kimi-codex/dist/commands/setup.js +277 -262
  79. package/plugins/kimi-codex/dist/commands/swarm.js +20 -7
  80. package/plugins/kimi-codex/dist/companion.js +142 -18
  81. package/plugins/kimi-codex/dist/help.js +11 -7
  82. package/plugins/kimi-codex/dist/hook-escape.js +7 -16
  83. package/plugins/kimi-codex/dist/hooks/approval-hook.js +1762 -124
  84. package/plugins/kimi-codex/dist/hooks/approval-policy.js +15 -10
  85. package/plugins/kimi-codex/dist/hooks/config-safety.js +15 -24
  86. package/plugins/kimi-codex/dist/hooks/hook-timing.js +1 -1
  87. package/plugins/kimi-codex/dist/hooks/install-paths.js +179 -107
  88. package/plugins/kimi-codex/dist/hooks/install.js +44 -166
  89. package/plugins/kimi-codex/dist/hooks/managed-block.js +44 -95
  90. package/plugins/kimi-codex/dist/job-store.js +117 -49
  91. package/plugins/kimi-codex/dist/jobs.js +53 -1
  92. package/plugins/kimi-codex/dist/kimi-engine.js +68 -92
  93. package/plugins/kimi-codex/dist/kimi-errors.js +1 -1
  94. package/plugins/kimi-codex/dist/kimi-journal.js +3 -2
  95. package/plugins/kimi-codex/dist/kimi-releases.js +28 -49
  96. package/plugins/kimi-codex/dist/kimi-timeouts.js +1 -15
  97. package/plugins/kimi-codex/dist/kimi-version-probe.js +24 -72
  98. package/plugins/kimi-codex/dist/logging.js +12 -7
  99. package/plugins/kimi-codex/dist/mcp/binding.js +13 -4
  100. package/plugins/kimi-codex/dist/mcp/job-control.js +386 -89
  101. package/plugins/kimi-codex/dist/mcp/launcher.js +1 -1
  102. package/plugins/kimi-codex/dist/mcp/operations.js +387 -193
  103. package/plugins/kimi-codex/dist/mcp/protocol.js +116 -27
  104. package/plugins/kimi-codex/dist/mcp/skills.js +130 -0
  105. package/plugins/kimi-codex/dist/mcp/stdio.js +15 -2
  106. package/plugins/kimi-codex/dist/native-v2-preflight.js +127 -35
  107. package/plugins/kimi-codex/dist/parsing.js +45 -11
  108. package/plugins/kimi-codex/dist/paths.js +20 -10
  109. package/plugins/kimi-codex/dist/plugin-data.js +28 -83
  110. package/plugins/kimi-codex/dist/read-scope.js +2 -2
  111. package/plugins/kimi-codex/dist/render.js +13 -38
  112. package/plugins/kimi-codex/dist/session-references.js +216 -0
  113. package/plugins/kimi-codex/dist/session-title.js +1 -1
  114. package/plugins/kimi-codex/dist/surface-routing.js +92 -5
  115. package/plugins/kimi-codex/dist/swarm-activation.js +26 -137
  116. package/plugins/kimi-codex/dist/version.js +1 -1
  117. package/plugins/kimi-codex/scripts/companion.sh +4 -15
  118. package/plugins/kimi-codex/skills/kimi/SKILL.md +77 -0
  119. package/plugins/kimi-codex/skills/kimi/agents/openai.yaml +6 -0
  120. package/scripts/companion.sh +4 -15
  121. package/skills/kimi/SKILL.md +77 -0
  122. package/skills/kimi/agents/openai.yaml +6 -0
  123. package/CHANGELOG.md +0 -1402
  124. package/agents/kimi-pursue.md +0 -93
  125. package/agents/kimi-review.md +0 -86
  126. package/agents/kimi-swarm.md +0 -88
  127. package/agents/kimi-task.md +0 -93
  128. package/commands/README.md +0 -14
  129. package/commands/cancel.md +0 -17
  130. package/commands/pursue.md +0 -41
  131. package/commands/replay.md +0 -13
  132. package/commands/result.md +0 -13
  133. package/commands/review.md +0 -40
  134. package/commands/setup.md +0 -25
  135. package/commands/status.md +0 -13
  136. package/commands/swarm.md +0 -45
  137. package/commands/task.md +0 -40
  138. package/dist/commands/review-gate.js +0 -391
  139. package/dist/config.js +0 -22
  140. package/dist/dsh/companion.js +0 -177
  141. package/dist/dsh/index.js +0 -167
  142. package/dist/hooks/review-gate-stop.js +0 -19
  143. package/dist/schemas/review-gate-output.js +0 -41
  144. package/docs/registry-releases.md +0 -228
  145. package/docs/upstream-2.4.1-certification.md +0 -54
  146. package/docs/upstream-2.5.0-certification.md +0 -52
  147. package/docs/upstream-2.5.1-certification.md +0 -47
  148. package/docs/upstream-2.5.2-certification.md +0 -40
  149. package/docs/upstream-2.5.3-certification.md +0 -73
  150. package/docs/upstream-2.6.0-certification.md +0 -65
  151. package/docs/upstream-2.6.2-certification.md +0 -144
  152. package/docs/upstream-2.6.3-certification.md +0 -100
  153. package/docs/upstream-2.7.2-certification.md +0 -113
  154. package/docs/upstream-2.7.3-certification.md +0 -95
  155. package/docs/windows-validation.md +0 -39
  156. package/hooks/README.md +0 -9
  157. package/hooks/hooks.json +0 -16
  158. package/plugins/kimi-codex/dist/commands/review-gate.js +0 -391
  159. package/plugins/kimi-codex/dist/config.js +0 -22
  160. package/plugins/kimi-codex/dist/dsh/companion.js +0 -177
  161. package/plugins/kimi-codex/dist/dsh/index.js +0 -167
  162. package/plugins/kimi-codex/dist/hooks/review-gate-stop.js +0 -19
  163. package/plugins/kimi-codex/dist/schemas/review-gate-output.js +0 -41
  164. package/plugins/kimi-codex/scripts/review-gate-hook.sh +0 -32
  165. package/plugins/kimi-codex/skills/kimi-cancel/SKILL.md +0 -25
  166. package/plugins/kimi-codex/skills/kimi-cancel/agents/openai.yaml +0 -6
  167. package/plugins/kimi-codex/skills/kimi-pursue/SKILL.md +0 -32
  168. package/plugins/kimi-codex/skills/kimi-pursue/agents/openai.yaml +0 -6
  169. package/plugins/kimi-codex/skills/kimi-replay/SKILL.md +0 -25
  170. package/plugins/kimi-codex/skills/kimi-replay/agents/openai.yaml +0 -6
  171. package/plugins/kimi-codex/skills/kimi-result/SKILL.md +0 -25
  172. package/plugins/kimi-codex/skills/kimi-result/agents/openai.yaml +0 -6
  173. package/plugins/kimi-codex/skills/kimi-review/SKILL.md +0 -35
  174. package/plugins/kimi-codex/skills/kimi-review/agents/openai.yaml +0 -6
  175. package/plugins/kimi-codex/skills/kimi-setup/SKILL.md +0 -35
  176. package/plugins/kimi-codex/skills/kimi-setup/agents/openai.yaml +0 -6
  177. package/plugins/kimi-codex/skills/kimi-status/SKILL.md +0 -25
  178. package/plugins/kimi-codex/skills/kimi-status/agents/openai.yaml +0 -6
  179. package/plugins/kimi-codex/skills/kimi-swarm/SKILL.md +0 -37
  180. package/plugins/kimi-codex/skills/kimi-swarm/agents/openai.yaml +0 -6
  181. package/plugins/kimi-codex/skills/kimi-task/SKILL.md +0 -37
  182. package/plugins/kimi-codex/skills/kimi-task/agents/openai.yaml +0 -6
  183. package/plugins/kimi-dsh/LICENSE +0 -201
  184. package/plugins/kimi-dsh/README.md +0 -84
  185. package/plugins/kimi-dsh/cordis.patch.yml +0 -45
  186. package/plugins/kimi-dsh/dist/background-spawn.js +0 -209
  187. package/plugins/kimi-dsh/dist/cli-cancellation.js +0 -43
  188. package/plugins/kimi-dsh/dist/cli-client.js +0 -1097
  189. package/plugins/kimi-dsh/dist/commands/ask.js +0 -269
  190. package/plugins/kimi-dsh/dist/commands/cancel.js +0 -177
  191. package/plugins/kimi-dsh/dist/commands/cli-helpers.js +0 -302
  192. package/plugins/kimi-dsh/dist/commands/models.js +0 -139
  193. package/plugins/kimi-dsh/dist/commands/pursue.js +0 -293
  194. package/plugins/kimi-dsh/dist/commands/recover-swarm.js +0 -140
  195. package/plugins/kimi-dsh/dist/commands/registry.js +0 -74
  196. package/plugins/kimi-dsh/dist/commands/repair-sessions.js +0 -266
  197. package/plugins/kimi-dsh/dist/commands/replay.js +0 -124
  198. package/plugins/kimi-dsh/dist/commands/rescue.js +0 -277
  199. package/plugins/kimi-dsh/dist/commands/result.js +0 -72
  200. package/plugins/kimi-dsh/dist/commands/review-gate.js +0 -391
  201. package/plugins/kimi-dsh/dist/commands/review.js +0 -217
  202. package/plugins/kimi-dsh/dist/commands/setup.js +0 -1465
  203. package/plugins/kimi-dsh/dist/commands/status.js +0 -27
  204. package/plugins/kimi-dsh/dist/commands/swarm.js +0 -823
  205. package/plugins/kimi-dsh/dist/commands/worker.js +0 -24
  206. package/plugins/kimi-dsh/dist/companion.js +0 -99
  207. package/plugins/kimi-dsh/dist/config.js +0 -22
  208. package/plugins/kimi-dsh/dist/dsh/companion.js +0 -177
  209. package/plugins/kimi-dsh/dist/dsh/index.js +0 -167
  210. package/plugins/kimi-dsh/dist/errors.js +0 -40
  211. package/plugins/kimi-dsh/dist/git.js +0 -216
  212. package/plugins/kimi-dsh/dist/help.js +0 -43
  213. package/plugins/kimi-dsh/dist/hook-escape.js +0 -71
  214. package/plugins/kimi-dsh/dist/hooks/approval-hook.js +0 -145
  215. package/plugins/kimi-dsh/dist/hooks/approval-policy.js +0 -295
  216. package/plugins/kimi-dsh/dist/hooks/config-safety.js +0 -641
  217. package/plugins/kimi-dsh/dist/hooks/hook-timing.js +0 -48
  218. package/plugins/kimi-dsh/dist/hooks/install-paths.js +0 -428
  219. package/plugins/kimi-dsh/dist/hooks/install.js +0 -405
  220. package/plugins/kimi-dsh/dist/hooks/managed-block.js +0 -729
  221. package/plugins/kimi-dsh/dist/hooks/review-gate-stop.js +0 -19
  222. package/plugins/kimi-dsh/dist/job-id.js +0 -12
  223. package/plugins/kimi-dsh/dist/job-store.js +0 -631
  224. package/plugins/kimi-dsh/dist/jobs.js +0 -212
  225. package/plugins/kimi-dsh/dist/kimi-command.js +0 -144
  226. package/plugins/kimi-dsh/dist/kimi-engine.js +0 -770
  227. package/plugins/kimi-dsh/dist/kimi-errors.js +0 -205
  228. package/plugins/kimi-dsh/dist/kimi-home.js +0 -15
  229. package/plugins/kimi-dsh/dist/kimi-journal.js +0 -41
  230. package/plugins/kimi-dsh/dist/kimi-releases.js +0 -144
  231. package/plugins/kimi-dsh/dist/kimi-timeouts.js +0 -52
  232. package/plugins/kimi-dsh/dist/kimi-version-probe.js +0 -198
  233. package/plugins/kimi-dsh/dist/logging.js +0 -22
  234. package/plugins/kimi-dsh/dist/mcp/binding.js +0 -58
  235. package/plugins/kimi-dsh/dist/mcp/job-control.js +0 -343
  236. package/plugins/kimi-dsh/dist/mcp/launcher.js +0 -263
  237. package/plugins/kimi-dsh/dist/mcp/operations.js +0 -333
  238. package/plugins/kimi-dsh/dist/mcp/protocol.js +0 -277
  239. package/plugins/kimi-dsh/dist/mcp/server.js +0 -8
  240. package/plugins/kimi-dsh/dist/mcp/stdio.js +0 -79
  241. package/plugins/kimi-dsh/dist/mcp/supervised-child.js +0 -15
  242. package/plugins/kimi-dsh/dist/mcp/tool-result.js +0 -7
  243. package/plugins/kimi-dsh/dist/mcp/workspace.js +0 -34
  244. package/plugins/kimi-dsh/dist/model-command.js +0 -34
  245. package/plugins/kimi-dsh/dist/native-v2-preflight.js +0 -596
  246. package/plugins/kimi-dsh/dist/package.json +0 -1
  247. package/plugins/kimi-dsh/dist/parsing.js +0 -554
  248. package/plugins/kimi-dsh/dist/paths.js +0 -35
  249. package/plugins/kimi-dsh/dist/plugin-data.js +0 -98
  250. package/plugins/kimi-dsh/dist/process-tree.js +0 -597
  251. package/plugins/kimi-dsh/dist/prompt-size.js +0 -18
  252. package/plugins/kimi-dsh/dist/read-scope.js +0 -435
  253. package/plugins/kimi-dsh/dist/render.js +0 -214
  254. package/plugins/kimi-dsh/dist/rescue-approval.js +0 -1242
  255. package/plugins/kimi-dsh/dist/schemas/review-gate-output.js +0 -41
  256. package/plugins/kimi-dsh/dist/session-recovery.js +0 -202
  257. package/plugins/kimi-dsh/dist/session-title.js +0 -313
  258. package/plugins/kimi-dsh/dist/stream-json.js +0 -344
  259. package/plugins/kimi-dsh/dist/surface-routing.js +0 -21
  260. package/plugins/kimi-dsh/dist/swarm-activation.js +0 -1194
  261. package/plugins/kimi-dsh/dist/swarm-policy.js +0 -74
  262. package/plugins/kimi-dsh/dist/swarm-recovery.js +0 -166
  263. package/plugins/kimi-dsh/dist/swarm-tool-policy.js +0 -146
  264. package/plugins/kimi-dsh/dist/types.js +0 -1
  265. package/plugins/kimi-dsh/dist/util.js +0 -28
  266. package/plugins/kimi-dsh/dist/vendor/shell-quote/LICENSE +0 -24
  267. package/plugins/kimi-dsh/dist/vendor/shell-quote/index.js +0 -1
  268. package/plugins/kimi-dsh/dist/vendor/shell-quote/parse.js +0 -229
  269. package/plugins/kimi-dsh/dist/vendor/smol-toml/LICENSE +0 -24
  270. package/plugins/kimi-dsh/dist/vendor/smol-toml/date.js +0 -156
  271. package/plugins/kimi-dsh/dist/vendor/smol-toml/error.js +0 -67
  272. package/plugins/kimi-dsh/dist/vendor/smol-toml/extract.js +0 -293
  273. package/plugins/kimi-dsh/dist/vendor/smol-toml/parse.js +0 -164
  274. package/plugins/kimi-dsh/dist/vendor/smol-toml/primitive.js +0 -151
  275. package/plugins/kimi-dsh/dist/vendor/smol-toml/struct.js +0 -156
  276. package/plugins/kimi-dsh/dist/vendor/smol-toml/util.js +0 -57
  277. package/plugins/kimi-dsh/dist/version.js +0 -7
  278. package/plugins/kimi-dsh/package.json +0 -78
  279. package/plugins/kimi-dsh/scripts/companion.sh +0 -37
  280. package/plugins/kimi-dsh/scripts/review-gate-hook.sh +0 -32
  281. package/scripts/review-gate-hook.sh +0 -32
@@ -1,164 +0,0 @@
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 { parseKey } from './struct.js';
29
- import { extractValue } from './extract.js';
30
- import { skipVoid } from './util.js';
31
- import { TomlError } from './error.js';
32
- function peekTable(ctx, key, table, meta, type) {
33
- let t = table;
34
- let m = meta;
35
- let k;
36
- let hasOwn = false;
37
- let state;
38
- for (let i = 0; i < key.length; i++) {
39
- if (i) {
40
- t = hasOwn ? t[k] : (t[k] = Object.create(null));
41
- m = (state = m[k]).c;
42
- if (type === 0 /* Type.DOTTED */ && (state.t === 1 /* Type.EXPLICIT */ || state.t === 2 /* Type.ARRAY */)) {
43
- return null;
44
- }
45
- if (state.t === 2 /* Type.ARRAY */) {
46
- let l = t.length - 1;
47
- t = t[l];
48
- m = m[l].c;
49
- }
50
- }
51
- k = key[i];
52
- if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 /* Type.DOTTED */ && m[k]?.d) {
53
- return null;
54
- }
55
- if (!hasOwn) {
56
- let unsafe = k === '__proto__';
57
- if (ctx.uk && (unsafe || k === 'constructor'))
58
- return false;
59
- if (unsafe) {
60
- Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
61
- Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });
62
- }
63
- m[k] = {
64
- t: i < key.length - 1 && type === 2 /* Type.ARRAY */
65
- ? 3 /* Type.ARRAY_DOTTED */ : type,
66
- d: false,
67
- i: 0,
68
- c: Object.create(null),
69
- };
70
- }
71
- }
72
- state = m[k];
73
- if (state.t !== type && !(type === 1 /* Type.EXPLICIT */ && state.t === 3 /* Type.ARRAY_DOTTED */)) {
74
- // Bad key type!
75
- return null;
76
- }
77
- if (type === 2 /* Type.ARRAY */) {
78
- if (!state.d) {
79
- state.d = true;
80
- t[k] = [];
81
- }
82
- t[k].push(t = Object.create(null));
83
- state.c[state.i++] = (state = { t: 1 /* Type.EXPLICIT */, d: false, i: 0, c: Object.create(null) });
84
- }
85
- if (state.d) {
86
- // Redefining a table!
87
- return null;
88
- }
89
- state.d = true;
90
- if (type === 1 /* Type.EXPLICIT */) {
91
- t = hasOwn ? t[k] : (t[k] = Object.create(null));
92
- }
93
- else if (type === 0 /* Type.DOTTED */ && hasOwn) {
94
- return null;
95
- }
96
- return [k, t, state.c];
97
- }
98
- function validateTablePeek(ctx, peek, ptr) {
99
- if (peek === null || ctx.uk === 2)
100
- TomlError.x(peek === null
101
- ? 'trying to redefine an already defined table or value'
102
- : 'document contains an unsafe property', ctx, ptr);
103
- }
104
- export function parse(toml, options = {}) {
105
- let ctx = {
106
- s: toml,
107
- p: 0,
108
- d: options.maxDepth ?? 1000,
109
- bi: options.integersAsBigInt ?? false,
110
- ld: options.useLegacyDate ?? true,
111
- uk: options.unsafeKeyBehaviour === 'throw' ? 2 : options.unsafeKeyBehaviour === 'drop' ? 1 : 0,
112
- };
113
- let res = Object.create(null);
114
- let meta = Object.create(null);
115
- let tmp;
116
- let skipping = false;
117
- let tbl = res;
118
- let m = meta;
119
- // BOM is allowed, skip.
120
- // JS is UTF-16, so we have to check for the UTF-16 BOM instead of the UTF-8 BOM sequence!
121
- if (toml.charCodeAt(0) === 0xfeff)
122
- ctx.p++;
123
- skipVoid(ctx);
124
- while (ctx.p < toml.length) {
125
- if (toml.charCodeAt(ctx.p) === 0x5b /* [ */) {
126
- let isTableArray = toml.charCodeAt(++ctx.p) === 0x5b; /* [ */
127
- tmp = ctx.p += +isTableArray;
128
- skipping = false;
129
- let k = parseKey(ctx, 0x5d /* ] */);
130
- if (isTableArray) {
131
- if (toml.charCodeAt(ctx.p) !== 0x5d /* ] */) {
132
- TomlError.x('expected end of table array declaration', ctx);
133
- }
134
- ctx.p++;
135
- }
136
- let p = peekTable(ctx, k, res, meta, isTableArray ? 2 /* Type.ARRAY */ : 1 /* Type.EXPLICIT */);
137
- if (!p) {
138
- validateTablePeek(ctx, p, tmp);
139
- skipping = true;
140
- }
141
- else {
142
- m = p[2];
143
- tbl = p[1];
144
- }
145
- }
146
- else {
147
- tmp = ctx.p;
148
- let k = parseKey(ctx);
149
- let p = peekTable(ctx, k, tbl, m, 0 /* Type.DOTTED */);
150
- if (!p && !skipping)
151
- validateTablePeek(ctx, p, tmp);
152
- skipVoid(ctx, true, true);
153
- let v = extractValue(ctx, void 0);
154
- if (p && !skipping)
155
- p[1][p[0]] = v;
156
- }
157
- skipVoid(ctx, true);
158
- if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 0xa /* \n */ && (tmp !== 0xd /* \r */ || toml.charCodeAt(ctx.p + 1) !== 0xa /* \n */)) {
159
- TomlError.x('each key-value declaration must be followed by an end-of-line', ctx);
160
- }
161
- skipVoid(ctx);
162
- }
163
- return res;
164
- }
@@ -1,151 +0,0 @@
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
- /** @internal */
30
- export function parseString(ctx) {
31
- let startPtr = ctx.p;
32
- let c = ctx.s.charCodeAt(ctx.p++);
33
- let first = c;
34
- let isLiteral = c === 0x27; /* ' */
35
- let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1);
36
- if (isMultiline) {
37
- // Trim initial newline
38
- if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 0xa /* \n */)
39
- ctx.p++;
40
- else if (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */)
41
- ctx.p += 2;
42
- }
43
- // For the record: it is not worth it to use a fast-path for literal strings using `indexOf`.
44
- // Doing a char-by-char iteration ends up dispatching less instructions, for the same wall-clock runtime.
45
- let parsed = '';
46
- let sliceStart = ctx.p;
47
- // states:
48
- // 0 - decoding
49
- // 1 - decoding escape
50
- // 2 - whitespace escape (no newline encountered yet, must fail on non-whitespace)
51
- // 3 - whitespace escape (newline encountered, allowed to transition back to normal decode)
52
- let state = 0;
53
- for (; ctx.p < ctx.s.length; ctx.p++) {
54
- c = ctx.s.charCodeAt(ctx.p);
55
- // Deal with newlines first, since that simplifies control character checking and handling across all states
56
- if (isMultiline && (c === 0xa /* \n */ || (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */))) {
57
- state = state && 3;
58
- }
59
- // Control characters are banned in TOML, so we throw an error if we encounter them
60
- else if ((c < 0x20 && c !== 0x9 /* \t */) || c === 0x7f) {
61
- TomlError.x('control characters are not allowed in strings', ctx);
62
- }
63
- // The string might terminate while we're parsing through a newline escape.
64
- // It must have encountered a newline; otherwise, it'll simply fail in another branch.
65
- else if ((!state || state === 3) && c === first && (!isMultiline || (ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first))) {
66
- if (isMultiline) {
67
- // If the string ends with 4-5 quotes, then the first 1-2 are part of the string
68
- if (ctx.s.charCodeAt(ctx.p + 3) === first)
69
- ctx.p++;
70
- if (ctx.s.charCodeAt(ctx.p + 3) === first)
71
- ctx.p++;
72
- }
73
- // If we're in a newline escape still, then there's nothing to add.
74
- if (!state) {
75
- // Avoid a useless concat operation if the string can be used as-is.
76
- let s = ctx.s.slice(sliceStart, ctx.p);
77
- parsed = parsed ? parsed + s : s;
78
- }
79
- ctx.p += isMultiline ? 3 : 1;
80
- return parsed;
81
- }
82
- // Baseline state; keep moving forward unless an escape sequence starts
83
- else if (!state) {
84
- if (!isLiteral && c === 0x5c /* \ */) {
85
- parsed += ctx.s.slice(sliceStart, (sliceStart = ctx.p));
86
- state = 1;
87
- }
88
- }
89
- else if (state === 1) {
90
- if (c === 0x78 /* x */ || c === 0x75 /* u */ || c === 0x55 /* U */) { // Unicode escape
91
- let errPtr = ctx.p++ - 1;
92
- let value = 0;
93
- let len = c === 0x78 /* x */ ? 2 : c === 0x75 /* u */ ? 4 : 8;
94
- for (let j = 0; j < len; j++, ctx.p++) {
95
- let hex = ctx.s.charCodeAt(ctx.p);
96
- let digit =
97
- /* 0-9 */ hex >= 0x30 && hex <= 0x39 ? hex - 0x30 :
98
- /* A-F */ hex >= 0x41 && hex <= 0x46 ? hex - 0x41 + 10 :
99
- /* a-f */ hex >= 0x61 && hex <= 0x66 ? hex - 0x61 + 10 : -1;
100
- if (digit < 0)
101
- TomlError.x('invalid non-hex character in unicode escape', ctx);
102
- value = (value << 4) | digit;
103
- }
104
- // Because JS does bitwise on signed 32bit integers, all 0xfzzzzzzz values are actually seen as negative
105
- if (value < 0 || value > 0x10ffff || (value >= 0xd800 && value <= 0xdfff)) {
106
- TomlError.x('invalid unicode escape', ctx, errPtr);
107
- }
108
- parsed += String.fromCodePoint(value);
109
- sliceStart = ctx.p--;
110
- state = 0;
111
- }
112
- // Newline escape sequence. We only need to care about spaces and tabs; newlines are dealt with earlier
113
- else if (isMultiline && (c === 0x20 || c === 0x9 /* \t */)) {
114
- state = 2;
115
- }
116
- // Basic escape sequence
117
- else {
118
- if (c === 0x62 /* b */)
119
- parsed += '\b';
120
- else if (c === 0x74 /* t */)
121
- parsed += '\t';
122
- else if (c === 0x6e /* n */)
123
- parsed += '\n';
124
- else if (c === 0x66 /* f */)
125
- parsed += '\f';
126
- else if (c === 0x72 /* r */)
127
- parsed += '\r';
128
- else if (c === 0x65 /* e */)
129
- parsed += '\x1b';
130
- else if (c === 0x22 /* " */)
131
- parsed += '"';
132
- else if (c === 0x5c /* \ */)
133
- parsed += '\\';
134
- else
135
- TomlError.x('unrecognised escape sequence', ctx);
136
- sliceStart = ctx.p + 1;
137
- state = 0;
138
- }
139
- }
140
- // Newline escape continuation: keep moving forward until the first non-whitespace char
141
- else if (c !== 0x20 && c !== 0x9 /* \t */) {
142
- if (state === 2)
143
- TomlError.x('invalid escape: only line-ending whitespace may be escaped', ctx, sliceStart);
144
- // State cannot be zero, or we'd have branched earlier already.
145
- // If it's a backslash, immediately transition to the escape state so it can be processed.
146
- state = !isLiteral && c === 0x5c /* \ */ ? 1 : 0;
147
- sliceStart = ctx.p;
148
- }
149
- }
150
- TomlError.x('unfinished string', ctx, startPtr);
151
- }
@@ -1,156 +0,0 @@
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 { skipVoid } from './util.js';
31
- import { TomlError } from './error.js';
32
- /** @internal */
33
- export function parseKey(ctx, end = 0x3d /* = */) {
34
- // States:
35
- // 0: before first char
36
- // 1: parsing bare key
37
- // 2: after key component
38
- let startPtr;
39
- let state = 0;
40
- let parsed = [];
41
- let sliceStart;
42
- let c = ctx.s.charCodeAt(startPtr = ctx.p);
43
- do {
44
- // End of key
45
- if (c === end) {
46
- if (!state)
47
- TomlError.x('unexpected end of key', ctx);
48
- if (state === 1)
49
- parsed.push(ctx.s.slice(sliceStart, ctx.p));
50
- return ctx.p++, parsed;
51
- }
52
- // Dotted key separator
53
- else if (c === 0x2e /* . */) {
54
- if (!state)
55
- TomlError.x('illegal empty bare key', ctx);
56
- if (state === 1)
57
- parsed.push(ctx.s.slice(sliceStart, ctx.p));
58
- state = 0;
59
- }
60
- // Quoted key
61
- else if (!state && (c === 0x22 /* " */ || c === 0x27 /* ' */)) {
62
- if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2))
63
- TomlError.x('illegal quoted key: multiline strings are not allowed', ctx);
64
- parsed.push(parseString(ctx));
65
- state = 2;
66
- ctx.p--;
67
- }
68
- // Whitespace; no-op in state 0 and 2, end of bare key in state 1
69
- else if (c === 0x20 || c === 0x9 /* \t */) {
70
- if (state === 1) {
71
- parsed.push(ctx.s.slice(sliceStart, ctx.p));
72
- state = 2;
73
- }
74
- }
75
- // If state is post-key, no character is allowed; otherwise ensure it's a bare-key component
76
- else if (state === 2 || (c < 0x30 && c !== 0x2d /* - */) || (c > 0x39 && c < 0x41) || (c > 0x5a && c < 0x61 && c !== 0x5f /* _ */) || c > 0x7a) {
77
- TomlError.x('illegal character in key', ctx);
78
- }
79
- // Illegal character
80
- else if (!state) {
81
- state = 1;
82
- sliceStart = ctx.p;
83
- }
84
- } while (c = ctx.s.charCodeAt(++ctx.p));
85
- TomlError.x('incomplete key-value: cannot find end of key', ctx, startPtr);
86
- }
87
- /** @internal */
88
- export function parseInlineTable(ctx) {
89
- let startPtr = ctx.p++;
90
- let res = Object.create(null);
91
- let seen = new Set();
92
- let c;
93
- while (ctx.p < ctx.s.length) {
94
- skipVoid(ctx);
95
- if ((c = ctx.s.charCodeAt(ctx.p)) === 0x7d /* } */) {
96
- ctx.p++;
97
- return res;
98
- }
99
- let k;
100
- let t = res;
101
- let hasOwn = false;
102
- let errPtr = ctx.p;
103
- let key = parseKey(ctx);
104
- for (let i = 0; i < key.length; i++) {
105
- if (i)
106
- t = hasOwn ? t[k] : (t[k] = Object.create(null));
107
- k = key[i];
108
- if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
109
- TomlError.x('trying to redefine an already defined value', ctx, errPtr);
110
- }
111
- let unsafe = k === '__proto__';
112
- if (ctx.uk && (unsafe || k === 'constructor')) {
113
- t = ctx.uk !== 1 && TomlError.x('document contains an unsafe property', ctx, errPtr);
114
- break;
115
- }
116
- if (!hasOwn && unsafe) {
117
- Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
118
- }
119
- }
120
- if (hasOwn) {
121
- TomlError.x('trying to redefine an already defined value', ctx, errPtr);
122
- }
123
- skipVoid(ctx, true, true);
124
- let value = extractValue(ctx, 0x7d /* } */);
125
- if (t && typeof (t[k] = value) === 'object')
126
- seen.add(value);
127
- skipVoid(ctx);
128
- if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x7d /* } */) {
129
- return res;
130
- }
131
- if (c !== 0x2c /* , */)
132
- TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);
133
- }
134
- TomlError.x('unfinished table', ctx, startPtr);
135
- }
136
- /** @internal */
137
- export function parseArray(ctx) {
138
- let startPtr = ctx.p++;
139
- let res = [];
140
- let c;
141
- while (ctx.p < ctx.s.length) {
142
- skipVoid(ctx);
143
- if ((c = ctx.s.charCodeAt(ctx.p)) === 0x5d /* ] */) {
144
- ctx.p++;
145
- return res;
146
- }
147
- res.push(extractValue(ctx, 0x5d /* ] */));
148
- skipVoid(ctx);
149
- if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x5d /* ] */) {
150
- return res;
151
- }
152
- if (c !== 0x2c /* , */)
153
- TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);
154
- }
155
- TomlError.x('unfinished array', ctx, startPtr);
156
- }
@@ -1,57 +0,0 @@
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
- /** @internal */
30
- export function skipComment(ctx) {
31
- for (; ctx.p < ctx.s.length; ctx.p++) {
32
- let c = ctx.s.charCodeAt(ctx.p);
33
- if (c === 0xa /* \n */)
34
- break;
35
- if (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */) {
36
- ctx.p++;
37
- break;
38
- }
39
- if ((c < 0x20 && c !== 0x9 /* \t */) || c === 0x7f) {
40
- TomlError.x('control characters are not allowed in comments', ctx);
41
- }
42
- }
43
- }
44
- /** @internal */
45
- export function skipVoid(ctx, banNewLines, banComments) {
46
- let c;
47
- while (ctx.p < ctx.s.length) {
48
- while (ctx.p < ctx.s.length && ((c = ctx.s.charCodeAt(ctx.p)) === 0x20 ||
49
- c === 0x9 /* \t */ ||
50
- (!banNewLines &&
51
- (c === 0xa /* \n */ || (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */)))))
52
- ctx.p++;
53
- if (banComments || c !== 0x23 /* # */)
54
- break;
55
- skipComment(ctx);
56
- }
57
- }
@@ -1,7 +0,0 @@
1
- // Single source of truth for the plugin version that the runtime reports
2
- // in setup output and managed-block markers. Keep this in sync with
3
- // package.json, .claude-plugin/plugin.json, .claude-plugin/marketplace.json,
4
- // and AGENTS.md on every release. A future improvement would read this from
5
- // package.json at build time, but that adds a build-step dependency we
6
- // don't want yet.
7
- export const KIMI_PLUGIN_CC_VERSION = "3.0.0";
@@ -1,78 +0,0 @@
1
- {
2
- "name": "kimi-plugin-cc",
3
- "version": "3.0.0",
4
- "description": "Kimi Code subagents for DeepSeek Harness: all seven ask, review, challenge, rescue, pursue, swarm, and swarm-write operations through the kimi-plugin-cc companion runtime.",
5
- "type": "module",
6
- "main": "dist/dsh/index.js",
7
- "exports": {
8
- ".": "./dist/dsh/index.js",
9
- "./cordis.patch.yml": "./cordis.patch.yml",
10
- "./package.json": "./package.json"
11
- },
12
- "files": [
13
- "cordis.patch.yml",
14
- "dist/",
15
- "scripts/",
16
- "README.md",
17
- "LICENSE"
18
- ],
19
- "engines": {
20
- "node": ">=24.9.0",
21
- "dsh": ">=0.2.1-rc.5 <0.3.0"
22
- },
23
- "dsh": {
24
- "bundle": {
25
- "patch": "./cordis.patch.yml"
26
- }
27
- },
28
- "peerDependencies": {
29
- "@deepseek-ai/cordis": "~4.0.5",
30
- "@deepseek-ai/dsh-commands": ">=0.2.1-rc.5 <0.3.0",
31
- "@deepseek-ai/dsh-llm": ">=0.2.1-rc.5 <0.3.0",
32
- "@deepseek-ai/dsh-session": ">=0.2.1-rc.5 <0.3.0",
33
- "@deepseek-ai/dsh-subagent": ">=0.2.1-rc.5 <0.3.0",
34
- "@deepseek-ai/dsh-subprocess": ">=0.2.1-rc.5 <0.3.0",
35
- "@deepseek-ai/dsh-system-prompt": ">=0.2.1-rc.5 <0.3.0",
36
- "@deepseek-ai/dsh-working-directory": ">=0.2.1-rc.5 <0.3.0",
37
- "@deepseek-ai/dsh-tool-subagent": ">=0.2.1-rc.5 <0.3.0"
38
- },
39
- "peerDependenciesMeta": {
40
- "@deepseek-ai/cordis": {
41
- "optional": true
42
- },
43
- "@deepseek-ai/dsh-commands": {
44
- "optional": true
45
- },
46
- "@deepseek-ai/dsh-llm": {
47
- "optional": true
48
- },
49
- "@deepseek-ai/dsh-session": {
50
- "optional": true
51
- },
52
- "@deepseek-ai/dsh-subagent": {
53
- "optional": true
54
- },
55
- "@deepseek-ai/dsh-subprocess": {
56
- "optional": true
57
- },
58
- "@deepseek-ai/dsh-system-prompt": {
59
- "optional": true
60
- },
61
- "@deepseek-ai/dsh-working-directory": {
62
- "optional": true
63
- },
64
- "@deepseek-ai/dsh-tool-subagent": {
65
- "optional": true
66
- }
67
- },
68
- "dependencies": {
69
- "@deepseek-ai/dsh-brand": ">=0.2.1-rc.5 <0.3.0",
70
- "@deepseek-ai/schemastery": "~3.18.5"
71
- },
72
- "license": "Apache-2.0",
73
- "repository": {
74
- "type": "git",
75
- "url": "git+https://github.com/linxule/kimi-plugin-cc.git",
76
- "directory": "plugins/kimi-dsh"
77
- }
78
- }
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Entry point for slash commands. Launches the compiled Node runtime from the plugin root so
5
- # that runtime dependencies resolve against the plugin's node_modules, while preserving the
6
- # user's working directory via KIMI_PLUGIN_CC_WORKSPACE_CWD.
7
- #
8
- # Required env: CLAUDE_PLUGIN_ROOT (set by Claude Code when the plugin is installed).
9
- # Codex plugin hosts may provide PLUGIN_ROOT/PLUGIN_DATA instead; accept those as aliases.
10
- # When running from the repo checkout, both root env vars may be unset — default to the
11
- # script's parent directory so `bun run` style local invocation still works.
12
-
13
- : "${CLAUDE_PLUGIN_ROOT:=${PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}}"
14
- export CLAUDE_PLUGIN_ROOT
15
- export PLUGIN_ROOT="${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}"
16
- # Data-root selection lives in the runtime so commands, workers, and Stop agree.
17
- # Preserve shared variables verbatim: conflicting values must not be hidden.
18
- export KIMI_PLUGIN_CC_SHELL_LAUNCH=1
19
- export KIMI_PLUGIN_CC_WORKSPACE_CWD="${KIMI_PLUGIN_CC_WORKSPACE_CWD:-$PWD}"
20
-
21
- NODE_BIN="${KIMI_PLUGIN_CC_NODE_BIN:-$(command -v node 2>/dev/null || true)}"
22
- if [ -z "${NODE_BIN}" ]; then
23
- echo "kimi-plugin-cc: unable to locate 'node'. Install Node >= 22.5 or set KIMI_PLUGIN_CC_NODE_BIN to an absolute path." >&2
24
- exit 127
25
- fi
26
-
27
- NODE_VERSION_OUT="$("${NODE_BIN}" --version 2>/dev/null || true)"
28
- NODE_MAJOR="$(printf '%s\n' "${NODE_VERSION_OUT}" | sed -En 's/^v([0-9]+)\..*/\1/p')"
29
- NODE_MINOR="$(printf '%s\n' "${NODE_VERSION_OUT}" | sed -En 's/^v[0-9]+\.([0-9]+)\..*/\1/p')"
30
- if [ -z "${NODE_MAJOR}" ] || [ -z "${NODE_MINOR}" ] || [ "${NODE_MAJOR}" -lt 22 ] || \
31
- { [ "${NODE_MAJOR}" -eq 22 ] && [ "${NODE_MINOR}" -lt 5 ]; }; then
32
- echo "kimi-plugin-cc requires Node >= 22.5.0 (node:sqlite is a built-in, introduced in 22.5). Found: ${NODE_VERSION_OUT:-unknown}. Upgrade Node or set KIMI_PLUGIN_CC_NODE_BIN to a qualifying binary." >&2
33
- exit 127
34
- fi
35
-
36
- cd "${CLAUDE_PLUGIN_ROOT}"
37
- exec "${NODE_BIN}" dist/companion.js "$@"