@theokit/sdk-tools 0.27.4 → 0.27.6

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
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.27.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#724](https://github.com/usetheokit/theokit-sdk/pull/724) [`d58f5ef`](https://github.com/usetheokit/theokit-sdk/commit/d58f5efbc911ffa429082688a53b36fad659e305) Thanks [@usetheodev](https://github.com/usetheodev)! - The optional `simple-git` peer range moves from `^3.0.0` to `^4.0.1`. Every 3.x release up to
8
+ 3.36.0 is covered by published advisories (GHSA-x6jw-m9v5-85vh, GHSA-g4wm-2vf7-vfgr,
9
+ GHSA-858h-whjf-mvg5): Git configuration includes and abbreviated long options can lead to command
10
+ execution. 4.0.1 is the first release that fixes all of them.
11
+
12
+ No tool in this package imports `simple-git`. `createGitDiffTool` and `createGitStatusTool` run
13
+ `git` as a child process, so their behaviour does not change. A project that still has
14
+ `simple-git` 3.x installed gets an unmet-peer warning and nothing else.
15
+
16
+ ## 0.27.5
17
+
18
+ ### Patch Changes
19
+
20
+ - [#664](https://github.com/usetheokit/theokit-sdk/pull/664) [`d18d0d8`](https://github.com/usetheokit/theokit-sdk/commit/d18d0d8237ee26315b6693947bd2a476a1e004b0) Thanks [@usetheodev](https://github.com/usetheodev)! - A V4A patch opening with `*** Begin Patch ***` now gets an error that names the near miss.
21
+
22
+ The message was `Invalid patch: missing '*** Begin Patch'`. That is true about the exact match and
23
+ misleading about the text on screen: the symmetric form CONTAINS the string it says is missing, so a
24
+ writer greps for an absent line while the defect is three characters at the end of a line already
25
+ there.
26
+
27
+ Measured on a live run: a model wrote the symmetric form by analogy with the `*** Add File: …`
28
+ headers this format also uses, spent three attempts against the old message, and abandoned the step.
29
+ The analogy is the reason the mistake is common — every other marker in V4A carries a trailing
30
+ token, and this one does not.
31
+
32
+ The variant is **not** accepted. V4A is parsed by other tools, and widening it here would make a
33
+ patch this runtime writes unreadable elsewhere. The error teaches the exact spelling instead: it
34
+ quotes the offending line back and says which part to drop.
35
+
36
+ Detection is a near-miss test — a line that starts with the marker and is not equal to it — so it
37
+ also covers `*** Begin Patch v2` and any other trailing suffix, not the one spelling that prompted
38
+ it. A patch with no marker at all keeps the original message.
39
+
3
40
  ## 0.27.4
4
41
 
5
42
  ## 0.27.4-next.1
package/dist/index.cjs CHANGED
@@ -33,11 +33,19 @@ var V4APatchError = class extends Error {
33
33
  this.name = "V4APatchError";
34
34
  }
35
35
  };
36
+ function missingBeginMessage(lines) {
37
+ const nearMiss = lines.find((l) => {
38
+ const t = l.trim();
39
+ return t !== BEGIN && t.startsWith(BEGIN);
40
+ });
41
+ if (nearMiss === void 0) return `Invalid patch: missing '${BEGIN}'`;
42
+ return `Invalid patch: the opening marker must be exactly '${BEGIN}', and this patch has '${nearMiss.trim()}'. Drop everything after '${BEGIN}' on that line \u2014 the trailing '***' belongs to no marker in this format.`;
43
+ }
36
44
  function parseV4A(patch) {
37
45
  const lines = patch.split("\n").map((l) => l.endsWith("\r") ? l.slice(0, -1) : l);
38
46
  let i = 0;
39
47
  while (i < lines.length && lines[i].trim() !== BEGIN) i++;
40
- if (i >= lines.length) throw new V4APatchError("Invalid patch: missing '*** Begin Patch'");
48
+ if (i >= lines.length) throw new V4APatchError(missingBeginMessage(lines));
41
49
  i++;
42
50
  const hunks = [];
43
51
  while (i < lines.length) {