@pikku/skills 0.12.11 → 0.12.12

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,56 @@
1
1
  # @pikku/skills
2
2
 
3
+ ## 0.12.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 8d6a6bc: fix(cli): a scaffold flag says a surface exists, not who may call it
8
+
9
+ `scaffold.<feature>` accepted an `auth` field, and the generated wrapper emitted
10
+ it onto the wired function. That put authentication in two places at once: the
11
+ target function already declares whether it needs a session, its wiring, its
12
+ scopes and its addon gate already refine it, and `runPikkuFunc` already enforces
13
+ all of that on every call. The scaffold flag only stacked a coarser gate in
14
+ front of the one that actually decides, and — being a config field — it could
15
+ disagree with the function it was gating.
16
+
17
+ `PikkuScaffoldFeature` is now `boolean | { path?: string }`. It answers two
18
+ things and no more: whether the surface is generated, and where the file is
19
+ written. A feature that was `{ "auth": false }` becomes plain `true`, and
20
+ `pikku enable` loses its `--noAuth` flag along with the dimension it set.
21
+
22
+ The six generators that took the flag no longer take one. The four that generate
23
+ a dispatcher — public RPC, public agent, workflow routes and the events channel
24
+ — now emit a fixed `auth: false`. That is the wrapper declining to gate, not the
25
+ scaffold declaring the surface public: `rpcCaller` forwards to whichever
26
+ function the caller named, and that function's own `auth`, permissions, scopes
27
+ and addon gate are what decide. Emitting nothing would not be neutral, since a
28
+ wiring without `auth` requires a session and would reject the call before the
29
+ gate that decides ever ran. The two that generate scoped admin functions — user
30
+ admin and virtual users — emit no `auth`, because they are `pikkuFunc` with
31
+ their own `scopes`: session-required by construction, and the deciding function
32
+ rather than a wrapper in front of one.
33
+
34
+ The legacy `'auth'` / `'no-auth'` string values are gone with it. A bare string
35
+ is still refused rather than read as a `path`: under `boolean | object` no
36
+ string is valid, so guessing one would turn a typo into a generated file nobody
37
+ asked for.
38
+
39
+ - 31ad85f: fix(emails): escape substituted values in the generated email renderer
40
+
41
+ `renderEmailTemplate` spliced values into HTML unescaped and looped substitution
42
+ until it reached a fixed point, so a value containing `"` broke out of the
43
+ attribute it landed in, a value containing markup was injected verbatim, and a
44
+ value containing `{{...}}` was re-expanded as a template on the next pass. An
45
+ ordinary CSS font stack from `theme.json` was enough to corrupt the document.
46
+
47
+ Rendering is now layered by trust. Partials are inlined first; `theme.*` and
48
+ `t.*` are expanded next as template-author input; caller `data` is substituted in
49
+ a single pass that is never rescanned. Values are HTML-escaped in `.html` output
50
+ and left raw in `.subject.txt` / `.text.txt`. `{{content}}` and partials stay
51
+ raw, and `{{{value}}}` is a new opt-in raw form. The console's email preview uses
52
+ the same renderer, so previews match what is sent.
53
+
3
54
  ## 0.12.11
4
55
 
5
56
  ### Patch Changes