@pikku/skills 0.12.64 → 0.12.66
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
|
@@ -200,7 +200,10 @@ npx pikku new addon stripe --display-name Stripe --category Payments --dir addon
|
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
**Handed an OpenAPI or Swagger spec?** Don't hand-write the functions —
|
|
203
|
-
`pikku new addon <name> --openapi <spec>` generates one function per operation
|
|
203
|
+
`pikku new addon <name> --openapi <spec>` generates one function per operation
|
|
204
|
+
(`<spec>` is a path, a URL, or a registry catalogue name such as
|
|
205
|
+
`amazonaws.com:applicationcostprofiler`; inside an app,
|
|
206
|
+
`pikku addons add <catalogue-name>` does the same and picks `--auth` for you),
|
|
204
207
|
with its schemas, service and credential. Read `references/openapi.md`.
|
|
205
208
|
|
|
206
209
|
This generates `package.json` (exports `.pikku/*` + `dist/`), `pikku.config.json` (`addon: true`), `tsconfig.json` (`#pikku` path mapping), `src/services.ts`, `src/functions/`, and `types/application-types.d.ts`. For the full file contents/exports you rarely hand-edit, read `references/addon-package-manifest.md`.
|
|
@@ -421,18 +424,27 @@ export default definePlugin({
|
|
|
421
424
|
addons only; Studio enforces that). `layout: 'bare'` renders without the shell.
|
|
422
425
|
- Titles are message keys in the addon's `messages/{locale}.json`, found by
|
|
423
426
|
convention next to its `package.json`; there is no field for them.
|
|
427
|
+
- `agent: 'name'` makes that agent answer in Studio's chat panel (a second tab
|
|
428
|
+
beside the general chat) while the screen is open. It resolves to
|
|
429
|
+
`agents/<name>.md` at the addon's package root: the agent's instructions,
|
|
430
|
+
which name the skills it follows (plain folders `skills/<name>/SKILL.md`).
|
|
431
|
+
`agent: 'studio:<name>'` instead picks an agent Studio ships; `pikku all` only
|
|
432
|
+
checks the format and looks up no file.
|
|
433
|
+
The file starts with frontmatter whose `title` and `description` are message
|
|
434
|
+
keys in `messages/en.json`. The name matches `/^[a-z][a-z0-9-]*$/`.
|
|
424
435
|
- `scopes` only hide the screen. The addon's functions must enforce the same
|
|
425
436
|
scopes.
|
|
426
437
|
|
|
427
438
|
The inspector reads every field statically, so each must be a literal.
|
|
428
439
|
`pikku all` fails on:
|
|
429
440
|
|
|
430
|
-
| Code | When
|
|
431
|
-
| ------ |
|
|
432
|
-
| PKU345 | a field is not a literal (variable, call, spread, bad value)
|
|
433
|
-
| PKU357 | two screens of the addon use the same path
|
|
434
|
-
| PKU358 | a title key is missing from `messages/en.json`
|
|
435
|
-
| PKU359 | `nav.badge` names no function of the addon
|
|
441
|
+
| Code | When |
|
|
442
|
+
| ------ | ---------------------------------------------------------------------------------------------------- |
|
|
443
|
+
| PKU345 | a field is not a literal (variable, call, spread, bad value) |
|
|
444
|
+
| PKU357 | two screens of the addon use the same path |
|
|
445
|
+
| PKU358 | a title or agent frontmatter key is missing from `messages/en.json` |
|
|
446
|
+
| PKU359 | `nav.badge` names no function of the addon |
|
|
447
|
+
| PKU365 | `agent` is neither a name nor `studio:<name>`, or a name has no non-empty `agents/<name>.md`, or no frontmatter `title` and `description` |
|
|
436
448
|
|
|
437
449
|
A key missing from another locale's catalog is a warning.
|
|
438
450
|
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
- 6 — Check the spec against the real API
|
|
12
12
|
- Then
|
|
13
13
|
|
|
14
|
-
When you are handed an OpenAPI or Swagger spec — a file,
|
|
14
|
+
When you are handed an OpenAPI or Swagger spec — a file, a URL to one, or the
|
|
15
|
+
name of one in the registry's catalogue (`https://www.pikku.dev/openapis`) — the
|
|
15
16
|
API it describes becomes an addon: one function per operation, each with its
|
|
16
17
|
input and output schemas, behind one service that makes the HTTP calls. Say so
|
|
17
18
|
before starting ("This is an OpenAPI spec — I'll turn it into an addon first"),
|
|
@@ -26,7 +27,23 @@ A JSON or YAML document with a top-level `openapi` key (3.x) or `swagger` key
|
|
|
26
27
|
|
|
27
28
|
## 1 — Look at the spec first
|
|
28
29
|
|
|
29
|
-
`--openapi` takes a path
|
|
30
|
+
`--openapi` takes a path, a URL, or a catalogue name such as
|
|
31
|
+
`amazonaws.com:applicationcostprofiler`. A name is anything that is neither a
|
|
32
|
+
URL, a path, nor a `.json`/`.yaml` file; it is looked up in the registry
|
|
33
|
+
(`--registry`, else `pikku.config.json`'s `registry`, else
|
|
34
|
+
`https://api.pikkustudio.app`) and generated from the entry's spec URL. A name
|
|
35
|
+
the registry does not know is refused before anything is written. On the
|
|
36
|
+
website the page URL is a slug (`amazonaws-com-applicationcostprofiler`); the
|
|
37
|
+
name to pass is the one the page's command shows, with its `.` and `:`.
|
|
38
|
+
|
|
39
|
+
For a catalogue entry inside an app, the short form is
|
|
40
|
+
`pikku addons add amazonaws.com:applicationcostprofiler`. It names the addon
|
|
41
|
+
after the entry (`amazonaws-applicationcostprofiler`) and takes `--auth` from
|
|
42
|
+
what the registry records: `none` for a public API, `user` for OAuth or a key
|
|
43
|
+
each user brings, `shared` for a key the app holds, and `user` when the registry
|
|
44
|
+
does not know. It prints the mode it picked; pass `--auth` to override it.
|
|
45
|
+
|
|
46
|
+
A spec published only to signed-in callers
|
|
30
47
|
takes the key the way the API reads it: `--openapi-header "NAME: value"`
|
|
31
48
|
(repeatable), or in the URL's query string when the API reads it there
|
|
32
49
|
(Dolibarr's explorer takes `?DOLAPIKEY=`). A 401 while fetching says which.
|
|
@@ -40,7 +57,7 @@ Keep a copy in `specs/` as the record of what the addon was generated from.
|
|
|
40
57
|
## 2 — Generate, from the app's root
|
|
41
58
|
|
|
42
59
|
```bash
|
|
43
|
-
bunx --bun pikku new addon <name> --openapi <path-or-
|
|
60
|
+
bunx --bun pikku new addon <name> --openapi <path-url-or-catalogue-name>
|
|
44
61
|
```
|
|
45
62
|
|
|
46
63
|
One command. Inside an app it writes `packages/addon-<name>` as
|