@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 +51 -0
- package/dist/skills.gen.js +1 -1
- package/package.json +1 -1
- package/skills/pikku-agent/SKILL.md +1 -2
- package/skills/pikku-emails/SKILL.md +23 -2
- package/skills/pikku-realtime/SKILL.md +1 -2
- package/skills/pikku-rpc/SKILL.md +4 -2
- package/skills/pikku-scenario/SKILL.md +5 -6
package/package.json
CHANGED
|
@@ -201,8 +201,7 @@ export const todoAgent = pikkuAgent({
|
|
|
201
201
|
### Scaffold the HTTP surface
|
|
202
202
|
|
|
203
203
|
```bash
|
|
204
|
-
pikku enable agent
|
|
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}}"`.
|
|
88
|
-
|
|
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
|
|
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
|
|
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
|
|
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 `{
|
|
690
|
-
|
|
691
|
-
under a shape where a string could be a path, silently reading
|
|
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
|
|