@pikku/skills 0.12.11 → 0.12.13

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,79 @@
1
1
  # @pikku/skills
2
2
 
3
+ ## 0.12.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 58cb0f8: Scaffold an addon whose exports point at the leaf its codegen actually writes
8
+
9
+ `pikku all` roots an addon's generated tree at `.pikku/addon/`, but `pikku new
10
+ addon` still wrote the pre-split targets: `./.pikku/*` resolved to
11
+ `./dist/.pikku/*` and the internal RPC map to `./dist/.pikku/rpc/...`, neither of
12
+ which exists in the published package. The subpaths a consumer writes are
13
+ unchanged — only the targets gain the `addon` segment.
14
+
15
+ The addon manifest reference in the `pikku-addon` skill described the same
16
+ package.json one migration further back, with `imports` and `exports` naming the
17
+ source tree and `files: ["dist", ".pikku"]` shipping `.ts` files Node cannot
18
+ load. It now documents the built layout, and why `imports` and tsconfig `paths`
19
+ deliberately point at different trees.
20
+
21
+ The plain scaffold — no `--secret`, `--oauth` or `--credential` — built its API
22
+ service with `new XService(variables)` against a class declaring no constructor,
23
+ so `pikku new addon <name>` produced a package that did not typecheck until the
24
+ author deleted the argument. Only the authenticating variants take one.
25
+
26
+ ## 0.12.12
27
+
28
+ ### Patch Changes
29
+
30
+ - 8d6a6bc: fix(cli): a scaffold flag says a surface exists, not who may call it
31
+
32
+ `scaffold.<feature>` accepted an `auth` field, and the generated wrapper emitted
33
+ it onto the wired function. That put authentication in two places at once: the
34
+ target function already declares whether it needs a session, its wiring, its
35
+ scopes and its addon gate already refine it, and `runPikkuFunc` already enforces
36
+ all of that on every call. The scaffold flag only stacked a coarser gate in
37
+ front of the one that actually decides, and — being a config field — it could
38
+ disagree with the function it was gating.
39
+
40
+ `PikkuScaffoldFeature` is now `boolean | { path?: string }`. It answers two
41
+ things and no more: whether the surface is generated, and where the file is
42
+ written. A feature that was `{ "auth": false }` becomes plain `true`, and
43
+ `pikku enable` loses its `--noAuth` flag along with the dimension it set.
44
+
45
+ The six generators that took the flag no longer take one. The four that generate
46
+ a dispatcher — public RPC, public agent, workflow routes and the events channel
47
+ — now emit a fixed `auth: false`. That is the wrapper declining to gate, not the
48
+ scaffold declaring the surface public: `rpcCaller` forwards to whichever
49
+ function the caller named, and that function's own `auth`, permissions, scopes
50
+ and addon gate are what decide. Emitting nothing would not be neutral, since a
51
+ wiring without `auth` requires a session and would reject the call before the
52
+ gate that decides ever ran. The two that generate scoped admin functions — user
53
+ admin and virtual users — emit no `auth`, because they are `pikkuFunc` with
54
+ their own `scopes`: session-required by construction, and the deciding function
55
+ rather than a wrapper in front of one.
56
+
57
+ The legacy `'auth'` / `'no-auth'` string values are gone with it. A bare string
58
+ is still refused rather than read as a `path`: under `boolean | object` no
59
+ string is valid, so guessing one would turn a typo into a generated file nobody
60
+ asked for.
61
+
62
+ - 31ad85f: fix(emails): escape substituted values in the generated email renderer
63
+
64
+ `renderEmailTemplate` spliced values into HTML unescaped and looped substitution
65
+ until it reached a fixed point, so a value containing `"` broke out of the
66
+ attribute it landed in, a value containing markup was injected verbatim, and a
67
+ value containing `{{...}}` was re-expanded as a template on the next pass. An
68
+ ordinary CSS font stack from `theme.json` was enough to corrupt the document.
69
+
70
+ Rendering is now layered by trust. Partials are inlined first; `theme.*` and
71
+ `t.*` are expanded next as template-author input; caller `data` is substituted in
72
+ a single pass that is never rescanned. Values are HTML-escaped in `.html` output
73
+ and left raw in `.subject.txt` / `.text.txt`. `{{content}}` and partials stay
74
+ raw, and `{{{value}}}` is a new opt-in raw form. The console's email preview uses
75
+ the same renderer, so previews match what is sent.
76
+
3
77
  ## 0.12.11
4
78
 
5
79
  ### Patch Changes