@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/skills",
3
- "version": "0.12.11",
3
+ "version": "0.12.12",
4
4
  "description": "The Pikku agent skills — the instruction set coding agents read to build, wire and deploy Pikku projects",
5
5
  "author": "yasser.fadl@gmail.com",
6
6
  "license": "MIT",
@@ -201,8 +201,7 @@ export const todoAgent = pikkuAgent({
201
201
  ### Scaffold the HTTP surface
202
202
 
203
203
  ```bash
204
- pikku enable agent # session required
205
- pikku enable agent --noAuth # public
204
+ pikku enable agent
206
205
  ```
207
206
 
208
207
  The next `pikku all` generates `agent.gen.ts` — run/stream/approve/resume
@@ -82,10 +82,31 @@ Placeholders are `{{ ... }}`. Resolution order inside a template:
82
82
  - `{{> footer}}` — include a partial from `partials/`.
83
83
  - `{{content}}` / `{{subject}}` — only meaningful inside `partials/layout.html`
84
84
  (the rendered body and subject). `layout.html` wraps every template if present.
85
+ - `{{{verifyUrl}}}` — the same value **unescaped**. See below.
85
86
 
86
87
  Locale strings may themselves contain variables and partial-free placeholders, e.g.
87
- `"subject": "{{inviterName}} invited you to join {{organizationName}}"`. These are
88
- resolved in the same pass, so a subject of `{{t.invitation.subject}}` expands fully.
88
+ `"subject": "{{inviterName}} invited you to join {{organizationName}}"`. Locale files
89
+ and `theme.json` ship alongside the templates, so they are expanded first and a subject
90
+ of `{{t.invitation.subject}}` expands fully.
91
+
92
+ ## Escaping
93
+
94
+ Values are HTML-escaped (`& < > " '`) on the way into `.html` output, so a URL, a
95
+ display name or a font stack containing quotes lands inside its attribute instead of
96
+ breaking out of it. `.subject.txt` and `.text.txt` are plain text and are never escaped.
97
+
98
+ Rendering is **layered by trust**, and the layers do not leak into each other:
99
+
100
+ - Partials are inlined first — a `data` value that happens to contain `{{> footer}}`
101
+ is not an include.
102
+ - `theme.*` and `t.*` are template-author input: expanded next, escaped, and allowed
103
+ to contain further placeholders (up to 5 levels).
104
+ - Everything else is caller data: substituted in **one pass**, escaped, and never
105
+ rescanned — a `data` value containing `{{...}}` renders as those literal characters.
106
+
107
+ `{{content}}` and partials are template-authored markup and stay raw. For a value you
108
+ genuinely want inserted as markup, use the explicit `{{{value}}}` form — it is opt-in,
109
+ it bypasses escaping entirely, and it is only safe for HTML you control.
89
110
 
90
111
  ## Typed variables (per template)
91
112
 
@@ -66,8 +66,7 @@ see `pikku-services`.
66
66
  ## 2. Enable the server side
67
67
 
68
68
  ```bash
69
- yarn pikku enable events # auth required by default
70
- yarn pikku enable events --noAuth # public events
69
+ yarn pikku enable events
71
70
  ```
72
71
 
73
72
  This sets `scaffold.events` in `pikku.config.json`. The next `pikku all` generates
@@ -75,10 +75,12 @@ The `POST /rpc/:rpcName` endpoint that dispatches every `expose: true` function
75
75
  is **generated, not hand-written**. Turn it on and let codegen own it:
76
76
 
77
77
  ```bash
78
- pikku enable rpc # sets scaffold.rpc = true (auth required)
79
- pikku enable rpc --noAuth # sets scaffold.rpc = { auth: false } (public)
78
+ pikku enable rpc # sets scaffold.rpc = true
80
79
  ```
81
80
 
81
+ The flag says the endpoint exists, not who may call it — each exposed function
82
+ is gated by its own `auth`, permissions and scopes.
83
+
82
84
  This writes `rpc-public.gen.ts` with an `rpcCaller` function and its `wireHTTP`
83
85
  call already wired. Do not write that wiring yourself — a hand-rolled copy
84
86
  collides with the generated route on the same path.
@@ -682,14 +682,13 @@ Coverage is attributed by running scenarios against a server that is collecting
682
682
  Prerequisite in `pikku.config.json`:
683
683
 
684
684
  ```bash
685
- pikku enable scenarios # sets scaffold.scenarios = true (session required)
686
- pikku enable scenarios --noAuth # sets scaffold.scenarios = { "auth": false }
685
+ pikku enable scenarios # sets scaffold.scenarios = true
687
686
  ```
688
687
 
689
- `scaffold.scenarios` is a boolean or `{ auth?, path? }`. The legacy string forms
690
- (`"auth"` / `"no-auth"`) are **rejected by the config loader**, not reinterpreted —
691
- under a shape where a string could be a path, silently reading one as a flag
692
- would be worse than failing.
688
+ `scaffold.scenarios` is a boolean or `{ path? }` — whether the surface exists
689
+ and where it is written. A bare string is **rejected by the config loader**, not
690
+ reinterpreted: under a shape where a string could be a path, silently reading
691
+ one as a flag would be worse than failing.
693
692
 
694
693
  `scaffold.scenarios` generates the coverage and stub RPCs into your project (`pikkuScenarioTakeLiveCoverage`, `pikkuScenarioResetLiveCoverage`, `pikkuScenarioResetStubs`, `pikkuScenarioGetStubCalls`), so scenario runs work against any server. The coverage RPC reads `<outDir>/function/pikku-functions-meta-verbose.gen.json` off disk at request time — codegen always writes it, but it has to be deployed alongside the app or the RPC returns `null`.
695
694