@bushizhanghan/dsh-publish-gate 0.6.0 → 0.7.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 (5) hide show
  1. package/CHANGELOG.md +94 -74
  2. package/README.md +223 -220
  3. package/lib/engine.js +2144 -1999
  4. package/lib/index.js +486 -471
  5. package/package.json +52 -52
package/CHANGELOG.md CHANGED
@@ -1,74 +1,94 @@
1
- # Changelog
2
-
3
- ## 0.6.0
4
-
5
- - New rule `tool-undeclared-param`: a tool whose `execute` reads `args.x` that
6
- `parameters.properties` never declares. The host renders `parameters` into the
7
- prompt and passes the model nothing else, so that value is undefined on every
8
- real call — the code path exists and never runs, and nothing throws.
9
- Covers `args.x`, `args['x']` and `const { x } = args`.
10
-
11
- ## 0.5.0
12
-
13
- - New layer: traceability. `git-uncommitted` (files that ship in the tarball are
14
- not committed), `git-tag-missing` (no `v<version>` tag on HEAD),
15
- `git-tag-elsewhere` (the tag exists but points at another commit).
16
- - The incident behind it: a 1.2.7 went to npm while the GitHub release still
17
- said 1.2.6 and the market entry still pointed at the old tarball.
18
-
19
- ## 0.4.0
20
-
21
- - New layer: dependency truth. `undeclared-import` (lib/ imports a package
22
- package.json never declares), `dep-in-dev-only` (only devDependencies satisfy
23
- it — npm never installs those for the consumer), `unused-dependency` (info).
24
- - New rule `version-behind-latest`: publishing under the live `latest` is
25
- accepted by npm and reaches nobody.
26
-
27
- ## 0.3.4
28
-
29
- - `tool-call-slow` split from `tool-call-throws`: a timeout is not a defect.
30
-
31
- ## 0.3.3
32
-
33
- - `publish_gate_tools` accepts `call: ["name"]` to really invoke a tool, opt-in
34
- because some tools open applications or write files.
35
-
36
- ## 0.3.2
37
-
38
- - New rule `node-too-old`: `engines.node` says one thing, `lib/` uses an API from
39
- a newer Node. npm only warns on `engines`, so the plugin installs and then
40
- throws at import.
41
-
42
- ## 0.3.1
43
-
44
- - `publish_gate_commands` emits commands that actually run on this machine
45
- (`cmd /c "npm publish --access public"` on Windows) and pairs the publish step
46
- with a `publish_gate_verify` shasum check.
47
-
48
- ## 0.3.0
49
-
50
- - New layer: the browser half. `checkClientHalf` / `checkClientRuntime` load the
51
- bundle against a fake `window.__ModuleLoader__` and report a bundle that never
52
- loads, never returns `apply`, throws, registers nothing, or uses a service its
53
- `inject` array does not declare.
54
- - New layer: market readiness — the repo is already listed, another entry
55
- publishes the same npm name, or the repo is under 24 hours old (the gate fails
56
- and reruns itself).
57
- - New rules: `client-without-platform`, `pack-omits-client`, `pack-ships-secret`,
58
- `private-field-set`, `publish-config-registry`, `tool-bad-parameter-type`,
59
- `entry-path-missing`, `bundle-patch-not-declared`, `inject-unused-service`.
60
- - New tool `publish_gate_client` (9 tools).
61
-
62
- ## 0.2.0
63
-
64
- - New layers: artifact (`npm pack --dry-run` — what npm will really ship) and
65
- runtime (import the entry in an isolated child process, call `apply`, report a
66
- throwing import, a throwing apply, missing execute, duplicate tool names, a
67
- throwing `presentCall`, and card kinds the host does not render).
68
- - New tools `publish_gate_tools` and `publish_gate_verify`.
69
- - Fixed: `bad-repo-url` never fired for the object form of `repository`.
70
-
71
- ## 0.1.0
72
-
73
- - First release: manifest rules, `cordis.patch.yml` insert checks, README and
74
- test presence, npm name and registry state.
1
+ # Changelog
2
+
3
+ ## 0.7.1
4
+
5
+ - Fixed: a non-string `dir` made every path tool throw a raw Node `TypeError`
6
+ (`The "path" argument must be of type string. Received type number (123)`).
7
+ The host never validates tool input against `parameters`, so a number or an
8
+ object really does reach `path.join`. A wrong type is now refused with a
9
+ message, and it deliberately does NOT fall back to the cwd — that would gate a
10
+ different plugin than the one that was asked for.
11
+ - Integration test added: every tool that takes `dir` is driven with `123`,
12
+ `true`, `{}` and `[]` and must answer with `ok: false`, never throw.
13
+
14
+ ## 0.7.0
15
+
16
+ - `tool-output-invalid` (error): a tool result its own `output.schema` rejects. The host validates every
17
+ result and throws `ToolOutputError`, so the tool is unusable from the first call. Only checked when the
18
+ caller names the tool in `call`, because calling a tool can launch applications or write files.
19
+ - `npm-not-logged-in` (error) / `npm-scope-mismatch` (warn): ask npm who it is before spending a publish.
20
+ ENEEDAUTH and the 403 that names neither the token nor the scope both become a message instead of a loss.
21
+ - `readme-wrong-package` (error): the README install line names a different package — a README copied from
22
+ another plugin. Whoever follows it installs something else, and nothing fails because that package exists.
23
+ ## 0.6.0
24
+
25
+ - New rule `tool-undeclared-param`: a tool whose `execute` reads `args.x` that
26
+ `parameters.properties` never declares. The host renders `parameters` into the
27
+ prompt and passes the model nothing else, so that value is undefined on every
28
+ real call — the code path exists and never runs, and nothing throws.
29
+ Covers `args.x`, `args['x']` and `const { x } = args`.
30
+
31
+ ## 0.5.0
32
+
33
+ - New layer: traceability. `git-uncommitted` (files that ship in the tarball are
34
+ not committed), `git-tag-missing` (no `v<version>` tag on HEAD),
35
+ `git-tag-elsewhere` (the tag exists but points at another commit).
36
+ - The incident behind it: a 1.2.7 went to npm while the GitHub release still
37
+ said 1.2.6 and the market entry still pointed at the old tarball.
38
+
39
+ ## 0.4.0
40
+
41
+ - New layer: dependency truth. `undeclared-import` (lib/ imports a package
42
+ package.json never declares), `dep-in-dev-only` (only devDependencies satisfy
43
+ it — npm never installs those for the consumer), `unused-dependency` (info).
44
+ - New rule `version-behind-latest`: publishing under the live `latest` is
45
+ accepted by npm and reaches nobody.
46
+
47
+ ## 0.3.4
48
+
49
+ - `tool-call-slow` split from `tool-call-throws`: a timeout is not a defect.
50
+
51
+ ## 0.3.3
52
+
53
+ - `publish_gate_tools` accepts `call: ["name"]` to really invoke a tool, opt-in
54
+ because some tools open applications or write files.
55
+
56
+ ## 0.3.2
57
+
58
+ - New rule `node-too-old`: `engines.node` says one thing, `lib/` uses an API from
59
+ a newer Node. npm only warns on `engines`, so the plugin installs and then
60
+ throws at import.
61
+
62
+ ## 0.3.1
63
+
64
+ - `publish_gate_commands` emits commands that actually run on this machine
65
+ (`cmd /c "npm publish --access public"` on Windows) and pairs the publish step
66
+ with a `publish_gate_verify` shasum check.
67
+
68
+ ## 0.3.0
69
+
70
+ - New layer: the browser half. `checkClientHalf` / `checkClientRuntime` load the
71
+ bundle against a fake `window.__ModuleLoader__` and report a bundle that never
72
+ loads, never returns `apply`, throws, registers nothing, or uses a service its
73
+ `inject` array does not declare.
74
+ - New layer: market readiness — the repo is already listed, another entry
75
+ publishes the same npm name, or the repo is under 24 hours old (the gate fails
76
+ and reruns itself).
77
+ - New rules: `client-without-platform`, `pack-omits-client`, `pack-ships-secret`,
78
+ `private-field-set`, `publish-config-registry`, `tool-bad-parameter-type`,
79
+ `entry-path-missing`, `bundle-patch-not-declared`, `inject-unused-service`.
80
+ - New tool `publish_gate_client` (9 tools).
81
+
82
+ ## 0.2.0
83
+
84
+ - New layers: artifact (`npm pack --dry-run` — what npm will really ship) and
85
+ runtime (import the entry in an isolated child process, call `apply`, report a
86
+ throwing import, a throwing apply, missing execute, duplicate tool names, a
87
+ throwing `presentCall`, and card kinds the host does not render).
88
+ - New tools `publish_gate_tools` and `publish_gate_verify`.
89
+ - Fixed: `bad-repo-url` never fired for the object form of `repository`.
90
+
91
+ ## 0.1.0
92
+
93
+ - First release: manifest rules, `cordis.patch.yml` insert checks, README and
94
+ test presence, npm name and registry state.