@engenty/wizards-runtime 0.12.1 → 0.12.2

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.
Files changed (91) hide show
  1. package/apps/runtime/dist/agents/studio-assistant.js +17 -1
  2. package/apps/runtime/dist/app.js +4 -2
  3. package/apps/runtime/dist/db/live-triggers.js +13 -3
  4. package/apps/runtime/dist/db/migrations/tenant/0027_space_skill.sql +48 -0
  5. package/apps/runtime/dist/db/migrations/tenant/meta/0027_snapshot.json +4120 -0
  6. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  7. package/apps/runtime/dist/db/schema.js +31 -0
  8. package/apps/runtime/dist/docs/dev/skills.md +116 -0
  9. package/apps/runtime/dist/docs/user-guide/skills.md +85 -0
  10. package/apps/runtime/dist/engine/steps.js +10 -1
  11. package/apps/runtime/dist/harness/model.js +4 -0
  12. package/apps/runtime/dist/live/views.js +2 -0
  13. package/apps/runtime/dist/models.js +4 -0
  14. package/apps/runtime/dist/prompts/goose.md +7 -0
  15. package/apps/runtime/dist/prompts/step.md +19 -1
  16. package/apps/runtime/dist/prompts/tools.md +33 -0
  17. package/apps/runtime/dist/routes/skills.js +84 -0
  18. package/apps/runtime/dist/services/skills-registry.js +209 -0
  19. package/apps/runtime/dist/services/skills.js +478 -0
  20. package/apps/runtime/dist/sync/records.js +81 -1
  21. package/apps/runtime/dist/texts.js +39 -0
  22. package/apps/runtime/dist/tools/index.js +4 -2
  23. package/apps/runtime/dist/tools/net-guard.js +8 -4
  24. package/apps/runtime/dist/tools/skills.js +197 -0
  25. package/apps/web/dist/assets/{AboutDialog-uGYGy2R2.js → AboutDialog-CLgnoYTI.js} +1 -1
  26. package/apps/web/dist/assets/{ChangelogDialog-BWaEdlt3.js → ChangelogDialog-CKLgFL6r.js} +1 -1
  27. package/apps/web/dist/assets/CodeEditor-B3nto_26.js +2 -0
  28. package/apps/web/dist/assets/EditorPage-D9JDdAAI.js +3 -0
  29. package/apps/web/dist/assets/{FlowPreview-DXpzFBRj.js → FlowPreview-zJCtixSi.js} +1 -1
  30. package/apps/web/dist/assets/Marketplace-D4e0Oac9.js +2 -0
  31. package/apps/web/dist/assets/{NewWizardChannels-B5wuTm7J.js → NewWizardChannels-B4N7GIYh.js} +1 -1
  32. package/apps/web/dist/assets/{NewWizardPage-Ci1ZsTJk.js → NewWizardPage-Dpt0Mzk8.js} +1 -1
  33. package/apps/web/dist/assets/{OnboardingPage-QkdluEZk.js → OnboardingPage-CDoYVjRC.js} +1 -1
  34. package/apps/web/dist/assets/PreviewPane-DPB5nEd5.js +10 -0
  35. package/apps/web/dist/assets/ProjectPage-408YOoNa.js +10 -0
  36. package/apps/web/dist/assets/{PublicRunner-Bt8gMxit.js → PublicRunner-BZ66xdRX.js} +1 -1
  37. package/apps/web/dist/assets/{ReadOnly-Cap_e5ke.js → ReadOnly-C9oGMkUB.js} +1 -1
  38. package/apps/web/dist/assets/{SettingsPage-C2rmXm_Q.js → SettingsPage-Dq3AZwJS.js} +2 -2
  39. package/apps/web/dist/assets/{SetupPage-CbqGgFPZ.js → SetupPage-CP3lbyZc.js} +1 -1
  40. package/apps/web/dist/assets/{SharePage-DEeVGatD.js → SharePage-DdMm1Y8K.js} +1 -1
  41. package/apps/web/dist/assets/SkillEditor-b5NMFB90.js +1 -0
  42. package/apps/web/dist/assets/changelog-82-DHogQ.js +1 -0
  43. package/apps/web/dist/assets/code-xml-Hx7YxCg0.js +1 -0
  44. package/apps/web/dist/assets/{dist-BwhPmMDu.js → dist-BdDd1FxP.js} +1 -1
  45. package/apps/web/dist/assets/dist-EBVTpvRr.js +10 -0
  46. package/apps/web/dist/assets/dist-GlRRx9Xl.js +1 -0
  47. package/apps/web/dist/assets/dist-H1UN89OA.js +1 -0
  48. package/apps/web/dist/assets/eye-BkMFLnYu.js +1 -0
  49. package/apps/web/dist/assets/i18n-CKKh3Pn0.js +55 -0
  50. package/apps/web/dist/assets/index-Cy2NHzAx.js +49 -0
  51. package/apps/web/dist/assets/index-wR_-1hfN.css +1 -0
  52. package/apps/web/dist/assets/json-CEsfHdlZ.js +1 -0
  53. package/apps/web/dist/assets/{lock-D-CjMpqn.js → lock-CGXM95Mi.js} +1 -1
  54. package/apps/web/dist/assets/markdown-5-I9_izp.js +29 -0
  55. package/apps/web/dist/assets/{oss-credits-CUpVhKSr.js → oss-credits-DpRWUPjD.js} +1 -1
  56. package/apps/web/dist/assets/{phone-CXSrxw3H.js → phone-DMfwuh9V.js} +1 -1
  57. package/apps/web/dist/assets/{runners-D71NjXtA.js → runners-D5qz6b_s.js} +1 -1
  58. package/apps/web/dist/assets/{session-B2LtqeDq.js → session-DRy0k0nh.js} +1 -1
  59. package/apps/web/dist/assets/{theme-Dab079EV.js → theme-DNPm6r4e.js} +2 -2
  60. package/apps/web/dist/assets/{ui-DQX_CQ7c.js → ui-CwFQAfE-.js} +2 -2
  61. package/apps/web/dist/assets/{upload-hLkuT3Q6.js → upload-DQJwLSGj.js} +1 -1
  62. package/apps/web/dist/assets/{useMutation-C3XBoSVf.js → useMutation-C20c2EH3.js} +1 -1
  63. package/apps/web/dist/assets/{volume-2-DIxdTlaA.js → volume-2-CC5qamYT.js} +1 -1
  64. package/apps/web/dist/index.html +9 -8
  65. package/apps/web/dist/mcp/flow.html +66 -66
  66. package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +3 -2
  67. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +6 -0
  68. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +6 -0
  69. package/node_modules/@engenty/wizards-shared/dist/live.d.ts +1 -1
  70. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +1 -0
  71. package/node_modules/@engenty/wizards-shared/dist/run.js +2 -0
  72. package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +165 -0
  73. package/node_modules/@engenty/wizards-shared/dist/skills.js +346 -0
  74. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +4 -2
  75. package/node_modules/@engenty/wizards-shared/dist/sync.js +2 -1
  76. package/package.json +7 -7
  77. package/plugin/.claude-plugin/plugin.json +1 -1
  78. package/plugin/plugin.json +1 -1
  79. package/apps/web/dist/assets/CodeEditor-B5hV1IvK.js +0 -2
  80. package/apps/web/dist/assets/EditorPage-j9BOx5-V.js +0 -3
  81. package/apps/web/dist/assets/Marketplace-DSo6uZF6.js +0 -2
  82. package/apps/web/dist/assets/PreviewPane-swAH89un.js +0 -10
  83. package/apps/web/dist/assets/ProjectPage-Djv5EOYU.js +0 -1
  84. package/apps/web/dist/assets/changelog-DAY6ZEyy.js +0 -1
  85. package/apps/web/dist/assets/dist-DVpDdhG9.js +0 -1
  86. package/apps/web/dist/assets/dist-DzdNG7Sf.js +0 -10
  87. package/apps/web/dist/assets/i18n-B3J2ypKu.js +0 -55
  88. package/apps/web/dist/assets/index-Dxwbli0m.css +0 -1
  89. package/apps/web/dist/assets/index-WY5lJ_-h.js +0 -49
  90. package/apps/web/dist/assets/json-D2GVvTXK.js +0 -1
  91. package/apps/web/dist/assets/markdown-DwdMW7q0.js +0 -29
@@ -38,9 +38,10 @@ export interface StudioSettingsSection {
38
38
  /**
39
39
  * The parts of the space page: `info` (who the space is: its title, what it does, its facts),
40
40
  * `brand` (how it looks: its logos, colours, type and assets), `knowledge` (its documents and what its steps search), `data` (what its wizards keep), `page`
41
- * (its public page at `<organization>.wizards.page/<slug>`) and `results` (what its runs produced).
41
+ * (its public page at `<organization>.wizards.page/<slug>`), `results` (what its runs produced) and
42
+ * `skills` (instructions its wizards follow, behind the `skills` switch).
42
43
  */
43
- export type StudioSpaceGroup = "info" | "brand" | "knowledge" | "data" | "page" | "results";
44
+ export type StudioSpaceGroup = "info" | "brand" | "knowledge" | "data" | "page" | "results" | "skills";
44
45
  /**
45
46
  * A section of the space page, in one of its parts, below the part's own sections. The studio
46
47
  * draws its heading and hint above it, and its entry in the part's menu under the plugin's name;
@@ -105,6 +105,12 @@ export declare const FEATURES: {
105
105
  readonly label: "WordPress plugin";
106
106
  readonly hint: "The plugin for WordPress sites, and a wizard as a package for one: offered in the share dialog and under Settings → Integrate.";
107
107
  };
108
+ readonly skills: {
109
+ readonly kind: "release";
110
+ readonly default: false;
111
+ readonly label: "Skills";
112
+ readonly hint: "Skills in a space's sources: from skills.sh, uploaded or written; always on in every AI step, or read by a wizard when it needs one.";
113
+ };
108
114
  readonly plugins: {
109
115
  readonly kind: "release";
110
116
  readonly default: false;
@@ -97,6 +97,12 @@ export const FEATURES = {
97
97
  label: "WordPress plugin",
98
98
  hint: "The plugin for WordPress sites, and a wizard as a package for one: offered in the share dialog and under Settings → Integrate.",
99
99
  },
100
+ skills: {
101
+ kind: "release",
102
+ default: false,
103
+ label: "Skills",
104
+ hint: "Skills in a space's sources: from skills.sh, uploaded or written; always on in every AI step, or read by a wizard when it needs one.",
105
+ },
100
106
  plugins: {
101
107
  kind: "release",
102
108
  default: false,
@@ -3,7 +3,7 @@
3
3
  * in the tenant's `live_change` feed, and an open studio hears of it. The kinds start equal to
4
4
  * the two-way sync's; they are their own list so a kind can be live without syncing.
5
5
  */
6
- export declare const LIVE_KINDS: readonly ["space", "wizard", "translation", "message", "page", "table", "row", "category", "file", "connector", "presence"];
6
+ export declare const LIVE_KINDS: readonly ["space", "wizard", "translation", "message", "page", "table", "row", "category", "file", "connector", "skill", "presence"];
7
7
  export type LiveKind = (typeof LIVE_KINDS)[number];
8
8
  /** `put`: the item was added or changed. `del`: the item itself was deleted. */
9
9
  export type LiveOp = "put" | "del";
@@ -223,6 +223,7 @@ declare const NOTES_EN: {
223
223
  readonly searchesDocuments: "Searching the documents: {query}";
224
224
  readonly searchesKnowledge: "Searching knowledge: {query} – {relevant} of {candidates} fit";
225
225
  readonly listsKnowledge: "Listing knowledge";
226
+ readonly readsSkill: "Reading the skill {name}";
226
227
  readonly searchesMail: "Searching {label}";
227
228
  readonly savesReceipts: {
228
229
  readonly one: "Saving {count} receipt from {label}";
@@ -55,6 +55,7 @@ const NOTES_EN = {
55
55
  searchesDocuments: "Searching the documents: {query}",
56
56
  searchesKnowledge: "Searching knowledge: {query} – {relevant} of {candidates} fit",
57
57
  listsKnowledge: "Listing knowledge",
58
+ readsSkill: "Reading the skill {name}",
58
59
  searchesMail: "Searching {label}",
59
60
  savesReceipts: {
60
61
  one: "Saving {count} receipt from {label}",
@@ -370,6 +371,7 @@ const NOTES_DE = {
370
371
  searchesDocuments: "Sucht in den Dokumenten: {query}",
371
372
  searchesKnowledge: "Sucht in Wissen: {query} – {relevant} von {candidates} passen",
372
373
  listsKnowledge: "Listet Wissen",
374
+ readsSkill: "Liest den Skill {name}",
373
375
  searchesMail: "Durchsucht {label}",
374
376
  savesReceipts: {
375
377
  one: "Speichert {count} Beleg aus {label}",
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Skills of a space (docs/plans/skills.md): instructions in the Agent Skills format – a folder
3
+ * with a `SKILL.md` (front matter `name` and `description`, then Markdown) and the files it
4
+ * points to. A space's wizards follow a skill that is always on in every AI step; one on demand
5
+ * they see by name and description and read when it fits the task. A skill whose scripts may
6
+ * run gets its folder in the run's sandbox. Behind the `skills` switch.
7
+ */
8
+ /** When a skill counts: in every AI step, when a step reads it, or not at all. */
9
+ export declare const SKILL_MODES: readonly ["always", "demand", "off"];
10
+ export type SkillMode = (typeof SKILL_MODES)[number];
11
+ /** Where it came from: written in the studio, uploaded, or added from skills.sh. */
12
+ export declare const SKILL_SOURCES: readonly ["own", "upload", "skills.sh"];
13
+ export type SkillSource = (typeof SKILL_SOURCES)[number];
14
+ export declare const SKILL_LIMITS: {
15
+ /** A name, as the Agent Skills format allows it. */
16
+ readonly name: 64;
17
+ readonly description: 1024;
18
+ /** Bytes of the `SKILL.md`, of any other file, of the whole skill, and its files. */
19
+ readonly skillMd: 100000;
20
+ readonly file: 256000;
21
+ readonly total: 1000000;
22
+ readonly files: 100;
23
+ readonly perSpace: 100;
24
+ /** Skills always on, and the characters of their instructions together: each is in every AI step. */
25
+ readonly always: 5;
26
+ readonly alwaysChars: 20000;
27
+ /** Skills on demand a step sees by name; more are left out of its list. */
28
+ readonly listed: 50;
29
+ /**
30
+ * Files kept for scripts only (fonts, templates, schemas): bytes of one, of all of a skill's
31
+ * together, and how many. They live in the blob store, not in the skill's row.
32
+ */
33
+ readonly blobFile: 5000000;
34
+ readonly blobTotal: 20000000;
35
+ readonly blobFiles: 200;
36
+ };
37
+ /** Lower-case letters, digits and single hyphens inside. */
38
+ export declare const SKILL_NAME: RegExp;
39
+ /**
40
+ * The GitHub owners skills.sh lists as official (skills.sh/official, October 2026). A skill from
41
+ * one of them shows as from an official source; any other is shown as not checked.
42
+ */
43
+ export declare const OFFICIAL_SKILL_OWNERS: readonly string[];
44
+ /** A skill's address on skills.sh: `owner/repo/skill`. */
45
+ export declare const SKILL_REF: RegExp;
46
+ export declare function officialSkill(ref: string | null | undefined): boolean;
47
+ /** A file of a skill beside its `SKILL.md`: a path inside the skill's folder and its text. */
48
+ export interface SkillFile {
49
+ path: string;
50
+ text: string;
51
+ }
52
+ /**
53
+ * A file of a skill that no model reads: not text, or of a kind the format keeps for its scripts
54
+ * (a font, a template, a schema). Its bytes are in the blob store, by their hash; they reach a
55
+ * run's sandbox when the skill's scripts may run.
56
+ */
57
+ export interface SkillBlobFile {
58
+ path: string;
59
+ hash: string;
60
+ bytes: number;
61
+ }
62
+ /** A skill as the list shows it. */
63
+ export interface SkillSummary {
64
+ id: string;
65
+ name: string;
66
+ description: string;
67
+ mode: SkillMode;
68
+ source: SkillSource;
69
+ /** skills.sh: `owner/repo/skill`. */
70
+ origin: string | null;
71
+ official: boolean;
72
+ /** Its scripts run in the sandbox of a step that has one. Off until someone switches it on. */
73
+ runScripts: boolean;
74
+ /** Its files beside the `SKILL.md`, the ones for scripts too. */
75
+ files: number;
76
+ /** Characters of its instructions: what a step reads, or carries when it is always on. */
77
+ chars: number;
78
+ updatedAt: string;
79
+ }
80
+ export interface SkillsList {
81
+ skills: SkillSummary[];
82
+ readOnly: boolean;
83
+ }
84
+ /** A skill opened: its instructions, the rest of its front matter and its files. */
85
+ export interface SkillDetail extends SkillSummary {
86
+ projectId: string;
87
+ body: string;
88
+ /** Front matter beside `name` and `description`, kept as it came (`license`, `metadata` …). */
89
+ meta: Record<string, unknown>;
90
+ fileList: SkillFile[];
91
+ /** Files for its scripts only. */
92
+ blobList: SkillBlobFile[];
93
+ /** The hash of what skills.sh had when it was added: an update is offered when it differs. */
94
+ originHash: string | null;
95
+ readOnly: boolean;
96
+ }
97
+ /** A skill on skills.sh, as a search finds it. */
98
+ export interface SkillHit {
99
+ ref: string;
100
+ name: string;
101
+ /** `owner/repo` on GitHub. */
102
+ source: string;
103
+ installs: number;
104
+ official: boolean;
105
+ /** The space has a skill from this address already. */
106
+ added: boolean;
107
+ }
108
+ /** A skill of skills.sh read whole, before it is added. */
109
+ export interface SkillPreview {
110
+ ref: string;
111
+ name: string;
112
+ description: string;
113
+ body: string;
114
+ meta: Record<string, unknown>;
115
+ fileList: SkillFile[];
116
+ /** Files kept for its scripts only. */
117
+ blobList: {
118
+ path: string;
119
+ bytes: number;
120
+ }[];
121
+ /** Files left out: not text, or too large. */
122
+ skipped: {
123
+ path: string;
124
+ reason: "binary" | "size" | "path" | "count";
125
+ }[];
126
+ official: boolean;
127
+ bytes: number;
128
+ hash: string;
129
+ }
130
+ /** Whether a path may be a file of a skill: relative, inside its folder, no hidden or odd parts. */
131
+ export declare function skillPathOk(path: string): boolean;
132
+ export declare function skillTextPath(path: string): boolean;
133
+ /** A script: text a model reads, run in the sandbox when the skill's scripts may run. */
134
+ export declare function skillScript(path: string): boolean;
135
+ export interface ParsedSkillMd {
136
+ name: string;
137
+ description: string;
138
+ body: string;
139
+ /** The other keys of the front matter. */
140
+ meta: Record<string, unknown>;
141
+ }
142
+ /** Why a `SKILL.md` was not taken: no front matter, or no name or description in it. */
143
+ export type SkillMdProblem = "frontmatter" | "name" | "description";
144
+ export declare class SkillMdError extends Error {
145
+ readonly problem: SkillMdProblem;
146
+ constructor(problem: SkillMdProblem);
147
+ }
148
+ /**
149
+ * The front matter of a `SKILL.md`, in the part of YAML skills use: `key: value` with quoted or
150
+ * plain values, plain values going on over indented lines, block scalars (`|`, `>`), one level
151
+ * of mapping (`metadata:`) and lists of plain items. What it does not read it leaves out.
152
+ */
153
+ export declare function parseFrontmatter(yaml: string): Record<string, unknown>;
154
+ /** A `SKILL.md` read: its name, description, the rest of its front matter and its instructions. */
155
+ export declare function parseSkillMd(text: string): ParsedSkillMd;
156
+ /** A skill as its `SKILL.md`: front matter with name, description and the rest, then its instructions. */
157
+ export declare function skillMd(skill: {
158
+ name: string;
159
+ description: string;
160
+ body: string;
161
+ meta?: Record<string, unknown>;
162
+ }): string;
163
+ /** A name the format allows, made from any title: `Tonalität & Stil` → `tonalitaet-stil`. */
164
+ export declare function skillNameOf(text: string): string;
165
+ export declare const byteLength: (text: string) => number;
@@ -0,0 +1,346 @@
1
+ /**
2
+ * Skills of a space (docs/plans/skills.md): instructions in the Agent Skills format – a folder
3
+ * with a `SKILL.md` (front matter `name` and `description`, then Markdown) and the files it
4
+ * points to. A space's wizards follow a skill that is always on in every AI step; one on demand
5
+ * they see by name and description and read when it fits the task. A skill whose scripts may
6
+ * run gets its folder in the run's sandbox. Behind the `skills` switch.
7
+ */
8
+ /** When a skill counts: in every AI step, when a step reads it, or not at all. */
9
+ export const SKILL_MODES = ["always", "demand", "off"];
10
+ /** Where it came from: written in the studio, uploaded, or added from skills.sh. */
11
+ export const SKILL_SOURCES = ["own", "upload", "skills.sh"];
12
+ export const SKILL_LIMITS = {
13
+ /** A name, as the Agent Skills format allows it. */
14
+ name: 64,
15
+ description: 1024,
16
+ /** Bytes of the `SKILL.md`, of any other file, of the whole skill, and its files. */
17
+ skillMd: 100_000,
18
+ file: 256_000,
19
+ total: 1_000_000,
20
+ files: 100,
21
+ perSpace: 100,
22
+ /** Skills always on, and the characters of their instructions together: each is in every AI step. */
23
+ always: 5,
24
+ alwaysChars: 20_000,
25
+ /** Skills on demand a step sees by name; more are left out of its list. */
26
+ listed: 50,
27
+ /**
28
+ * Files kept for scripts only (fonts, templates, schemas): bytes of one, of all of a skill's
29
+ * together, and how many. They live in the blob store, not in the skill's row.
30
+ */
31
+ blobFile: 5_000_000,
32
+ blobTotal: 20_000_000,
33
+ blobFiles: 200,
34
+ };
35
+ /** Lower-case letters, digits and single hyphens inside. */
36
+ export const SKILL_NAME = /^[a-z0-9]+(-[a-z0-9]+)*$/;
37
+ /**
38
+ * The GitHub owners skills.sh lists as official (skills.sh/official, October 2026). A skill from
39
+ * one of them shows as from an official source; any other is shown as not checked.
40
+ */
41
+ export const OFFICIAL_SKILL_OWNERS = [
42
+ "aave",
43
+ "anthropics",
44
+ "antithesishq",
45
+ "apify",
46
+ "apollographql",
47
+ "astronomer",
48
+ "auth0",
49
+ "automattic",
50
+ "aws",
51
+ "axiomhq",
52
+ "base",
53
+ "better-auth",
54
+ "bitwarden",
55
+ "box",
56
+ "brave",
57
+ "browser-use",
58
+ "browserbase",
59
+ "callstackincubator",
60
+ "clerk",
61
+ "clickhouse",
62
+ "cloudflare",
63
+ "coderabbitai",
64
+ "coinbase",
65
+ "contentful",
66
+ "contentstack",
67
+ "convex-dev",
68
+ "dagster-io",
69
+ "dash0hq",
70
+ "datadog-labs",
71
+ "dbt-labs",
72
+ "deepgram",
73
+ "denoland",
74
+ "elevenlabs",
75
+ "encoredev",
76
+ "exploreomni",
77
+ "expo",
78
+ "facebook",
79
+ "factory-ai",
80
+ "figma",
81
+ "firebase",
82
+ "firecrawl",
83
+ "flutter",
84
+ "getsentry",
85
+ "github",
86
+ "google-gemini",
87
+ "google-labs-code",
88
+ "hashicorp",
89
+ "huggingface",
90
+ "kotlin",
91
+ "langchain-ai",
92
+ "langfuse",
93
+ "launchdarkly",
94
+ "makenotion",
95
+ "mapbox",
96
+ "mastra-ai",
97
+ "mcp-use",
98
+ "medusajs",
99
+ "microsoft",
100
+ "mongodb",
101
+ "n8n-io",
102
+ "neondatabase",
103
+ "nuxt",
104
+ "nvidia",
105
+ "openai",
106
+ "openshift",
107
+ "parallel-web",
108
+ "pinecone-io",
109
+ "planetscale",
110
+ "posthog",
111
+ "prisma",
112
+ "pulumi",
113
+ "pytorch",
114
+ "redis",
115
+ "remotion-dev",
116
+ "resend",
117
+ "rivet-dev",
118
+ "runwayml",
119
+ "sanity-io",
120
+ "semgrep",
121
+ "shopify",
122
+ "signoz",
123
+ "streamlit",
124
+ "stripe",
125
+ "supabase",
126
+ "sveltejs",
127
+ "tavily-ai",
128
+ "temporalio",
129
+ "tinybirdco",
130
+ "tldraw",
131
+ "triggerdotdev",
132
+ "uniformdev",
133
+ "upstash",
134
+ "vapiai",
135
+ "vercel",
136
+ "vercel-labs",
137
+ "webflow",
138
+ "wix",
139
+ "wordpress",
140
+ ];
141
+ /** A skill's address on skills.sh: `owner/repo/skill`. */
142
+ export const SKILL_REF = /^[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.:-]{1,100}$/;
143
+ export function officialSkill(ref) {
144
+ const owner = ref?.split("/")[0]?.toLowerCase();
145
+ return Boolean(owner && OFFICIAL_SKILL_OWNERS.includes(owner));
146
+ }
147
+ /** Whether a path may be a file of a skill: relative, inside its folder, no hidden or odd parts. */
148
+ export function skillPathOk(path) {
149
+ if (!path || path.length > 200 || path.startsWith("/") || path.includes("\\")) {
150
+ return false;
151
+ }
152
+ return path
153
+ .split("/")
154
+ .every((part) => part !== "" && part !== "." && part !== ".." && /^[\w.@+ -]+$/.test(part));
155
+ }
156
+ /** Files a model reads as text: instructions, references, data and scripts. */
157
+ const TEXT_EXT = /\.(md|markdown|mdx|txt|text|csv|tsv|json|jsonl|yaml|yml|toml|xml|html|htm|css|js|mjs|cjs|ts|tsx|jsx|py|sh|bash|zsh|rb|go|rs|java|kt|swift|php|sql|r|ini|cfg|conf|env\.example|svg|tex|rst|adoc)$/i;
158
+ const TEXT_NAMES = /^(LICENSE|LICENCE|NOTICE|README|CHANGELOG|COPYING|Makefile|Dockerfile)(\.\w+)?$/i;
159
+ export function skillTextPath(path) {
160
+ const name = path.split("/").pop() ?? "";
161
+ return TEXT_EXT.test(name) || TEXT_NAMES.test(name);
162
+ }
163
+ const scriptPath = /\.(py|sh|bash|zsh|js|mjs|cjs|ts|rb|php|go|rs)$/i;
164
+ /** A script: text a model reads, run in the sandbox when the skill's scripts may run. */
165
+ export function skillScript(path) {
166
+ return scriptPath.test(path);
167
+ }
168
+ export class SkillMdError extends Error {
169
+ problem;
170
+ constructor(problem) {
171
+ super(`SKILL.md: ${problem}`);
172
+ this.problem = problem;
173
+ }
174
+ }
175
+ function unquote(value) {
176
+ const v = value.trim();
177
+ if (v.length >= 2 && v.startsWith('"') && v.endsWith('"')) {
178
+ try {
179
+ return JSON.parse(v);
180
+ }
181
+ catch {
182
+ return v.slice(1, -1);
183
+ }
184
+ }
185
+ if (v.length >= 2 && v.startsWith("'") && v.endsWith("'")) {
186
+ return v.slice(1, -1).replace(/''/g, "'");
187
+ }
188
+ return v;
189
+ }
190
+ /** A block scalar's lines (`|`, `>`, with `-` or `+`), indentation taken off. */
191
+ function blockScalar(style, lines) {
192
+ const indent = Math.min(...lines.filter((l) => l.trim()).map((l) => l.length - l.trimStart().length));
193
+ const plain = lines.map((l) => l.slice(Number.isFinite(indent) ? indent : 0));
194
+ let text;
195
+ if (style.startsWith("|")) {
196
+ text = plain.join("\n");
197
+ }
198
+ else {
199
+ // Folded: lines of a paragraph join with a space, an empty line stays a break.
200
+ text = plain
201
+ .join("\n")
202
+ .replace(/([^\n])\n(?!\n)/g, "$1 ")
203
+ .replace(/\n\n/g, "\n");
204
+ }
205
+ return style.includes("-") ? text.replace(/\s+$/, "") : `${text.replace(/\n*$/, "")}\n`;
206
+ }
207
+ /**
208
+ * The front matter of a `SKILL.md`, in the part of YAML skills use: `key: value` with quoted or
209
+ * plain values, plain values going on over indented lines, block scalars (`|`, `>`), one level
210
+ * of mapping (`metadata:`) and lists of plain items. What it does not read it leaves out.
211
+ */
212
+ export function parseFrontmatter(yaml) {
213
+ const out = {};
214
+ const lines = yaml.replace(/\r\n?/g, "\n").split("\n");
215
+ let i = 0;
216
+ const more = (from) => {
217
+ const taken = [];
218
+ let j = from;
219
+ while (j < lines.length && (lines[j].trim() === "" || /^\s/.test(lines[j]))) {
220
+ taken.push(lines[j]);
221
+ j++;
222
+ }
223
+ while (taken.length && taken[taken.length - 1].trim() === "") {
224
+ taken.pop();
225
+ j--;
226
+ }
227
+ return { taken, next: j };
228
+ };
229
+ while (i < lines.length) {
230
+ const line = lines[i];
231
+ const m = /^([A-Za-z_][\w.-]*)\s*:(.*)$/.exec(line);
232
+ if (!m || line.trimStart().startsWith("#")) {
233
+ i++;
234
+ continue;
235
+ }
236
+ const key = m[1];
237
+ const rest = m[2].trim();
238
+ const { taken, next } = more(i + 1);
239
+ i = next;
240
+ if (/^[|>][+-]?\d*$/.test(rest)) {
241
+ out[key] = blockScalar(rest, taken);
242
+ }
243
+ else if (rest === "" && taken.length) {
244
+ const items = taken.filter((l) => l.trim());
245
+ if (items.every((l) => /^\s*-\s/.test(l))) {
246
+ out[key] = items.map((l) => unquote(l.replace(/^\s*-\s/, "")));
247
+ }
248
+ else {
249
+ const map = {};
250
+ for (const l of items) {
251
+ const kv = /^\s*([^:#]+?)\s*:\s*(.*)$/.exec(l);
252
+ if (kv) {
253
+ map[kv[1]] = unquote(kv[2]);
254
+ }
255
+ }
256
+ out[key] = map;
257
+ }
258
+ }
259
+ else if (rest.startsWith("[") && rest.endsWith("]")) {
260
+ out[key] = rest
261
+ .slice(1, -1)
262
+ .split(",")
263
+ .map((s) => unquote(s))
264
+ .filter(Boolean);
265
+ }
266
+ else if (/^["']/.test(rest) && !/^(["']).*\1\s*$/.test(rest)) {
267
+ // A quoted value over several lines.
268
+ out[key] = unquote([rest, ...taken.map((l) => l.trim())].join(" "));
269
+ }
270
+ else {
271
+ const value = [rest, ...taken.map((l) => l.trim()).filter(Boolean)].join(" ");
272
+ out[key] = unquote(value);
273
+ }
274
+ }
275
+ return out;
276
+ }
277
+ const FRONTMATTER = /^?---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/;
278
+ /** A `SKILL.md` read: its name, description, the rest of its front matter and its instructions. */
279
+ export function parseSkillMd(text) {
280
+ const m = FRONTMATTER.exec(text);
281
+ if (!m) {
282
+ throw new SkillMdError("frontmatter");
283
+ }
284
+ const front = parseFrontmatter(m[1]);
285
+ const name = typeof front.name === "string" ? front.name.trim() : "";
286
+ const description = typeof front.description === "string" ? front.description.replace(/\s+/g, " ").trim() : "";
287
+ if (!name) {
288
+ throw new SkillMdError("name");
289
+ }
290
+ if (!description) {
291
+ throw new SkillMdError("description");
292
+ }
293
+ const { name: _n, description: _d, ...meta } = front;
294
+ return { name, description, body: text.slice(m[0].length).replace(/^\s*\n/, ""), meta };
295
+ }
296
+ function yamlValue(value, indent = "") {
297
+ if (Array.isArray(value)) {
298
+ return `\n${value.map((v) => `${indent} - ${yamlScalar(String(v))}`).join("\n")}`;
299
+ }
300
+ if (value && typeof value === "object") {
301
+ return `\n${Object.entries(value)
302
+ .map(([k, v]) => `${indent} ${k}: ${yamlScalar(String(v))}`)
303
+ .join("\n")}`;
304
+ }
305
+ return ` ${yamlScalar(String(value ?? ""))}`;
306
+ }
307
+ /** A plain scalar where YAML reads it back the same, else a double-quoted one. */
308
+ function yamlScalar(value) {
309
+ return /^[^\s"'#&*!|>%@`{}[\],?:-][^\n#]*$/.test(value) &&
310
+ !/:\s|\s$/.test(value) &&
311
+ !/^(true|false|null|yes|no|~|[\d.+-]+)$/i.test(value)
312
+ ? value
313
+ : JSON.stringify(value);
314
+ }
315
+ /** A skill as its `SKILL.md`: front matter with name, description and the rest, then its instructions. */
316
+ export function skillMd(skill) {
317
+ const keys = Object.entries(skill.meta ?? {})
318
+ .filter(([, v]) => v !== undefined && v !== null)
319
+ .map(([k, v]) => `${k}:${yamlValue(v)}`);
320
+ return [
321
+ "---",
322
+ `name: ${yamlScalar(skill.name)}`,
323
+ `description: ${yamlScalar(skill.description)}`,
324
+ ...keys,
325
+ "---",
326
+ "",
327
+ skill.body.replace(/^\n+/, ""),
328
+ ].join("\n");
329
+ }
330
+ /** A name the format allows, made from any title: `Tonalität & Stil` → `tonalitaet-stil`. */
331
+ export function skillNameOf(text) {
332
+ return text
333
+ .toLowerCase()
334
+ .replace(/ä/g, "ae")
335
+ .replace(/ö/g, "oe")
336
+ .replace(/ü/g, "ue")
337
+ .replace(/ß/g, "ss")
338
+ .normalize("NFKD")
339
+ .replace(/[̀-ͯ]/g, "")
340
+ .replace(/[^a-z0-9]+/g, "-")
341
+ .replace(/^-+|-+$/g, "")
342
+ .slice(0, SKILL_LIMITS.name)
343
+ .replace(/-+$/, "");
344
+ }
345
+ const encoder = new TextEncoder();
346
+ export const byteLength = (text) => encoder.encode(text).length;
@@ -9,9 +9,9 @@ import type { MergeConflict } from "./sync-merge.js";
9
9
  /**
10
10
  * What syncs, one row each: the space's details, a wizard (its draft and workspace together),
11
11
  * a translation, a message of a wizard's build chat, a page, a table, a row, a category (with
12
- * its values), a file, an imported connector. Runs, chats, the store and the index do not.
12
+ * its values), a file, an imported connector, a skill. Runs, chats, the store and the index do not.
13
13
  */
14
- export declare const SYNC_KINDS: readonly ["space", "wizard", "translation", "message", "page", "table", "row", "category", "file", "connector"];
14
+ export declare const SYNC_KINDS: readonly ["space", "wizard", "translation", "message", "page", "table", "row", "category", "file", "connector", "skill"];
15
15
  export type SyncKind = (typeof SYNC_KINDS)[number];
16
16
  /** One item as it travels: its fields, never the tenant's id; `null` = deleted. */
17
17
  export type SyncRecord = Record<string, unknown>;
@@ -33,6 +33,7 @@ export declare const pushItemSchema: z.ZodObject<{
33
33
  message: "message";
34
34
  page: "page";
35
35
  row: "row";
36
+ skill: "skill";
36
37
  space: "space";
37
38
  table: "table";
38
39
  translation: "translation";
@@ -53,6 +54,7 @@ export declare const pushSchema: z.ZodObject<{
53
54
  message: "message";
54
55
  page: "page";
55
56
  row: "row";
57
+ skill: "skill";
56
58
  space: "space";
57
59
  table: "table";
58
60
  translation: "translation";
@@ -8,7 +8,7 @@ import { z } from "zod";
8
8
  /**
9
9
  * What syncs, one row each: the space's details, a wizard (its draft and workspace together),
10
10
  * a translation, a message of a wizard's build chat, a page, a table, a row, a category (with
11
- * its values), a file, an imported connector. Runs, chats, the store and the index do not.
11
+ * its values), a file, an imported connector, a skill. Runs, chats, the store and the index do not.
12
12
  */
13
13
  export const SYNC_KINDS = [
14
14
  "space",
@@ -21,6 +21,7 @@ export const SYNC_KINDS = [
21
21
  "category",
22
22
  "file",
23
23
  "connector",
24
+ "skill",
24
25
  ];
25
26
  /** Items carry ids as installs make them (nanoid), or `<id>:<part>` for a wizard's translations and a space's connectors. */
26
27
  export const syncItemId = z.string().regex(/^[A-Za-z0-9_-]{1,64}(:[A-Za-z0-9_.-]{1,64})?$/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engenty/wizards-runtime",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have. The runtime, which `npx wizards` installs.",
5
5
  "license": "FSL-1.1-MIT AND CC-BY-4.0",
6
6
  "homepage": "https://engenty.ai",
@@ -57,7 +57,7 @@
57
57
  "@modelcontextprotocol/client": "2.3.0",
58
58
  "@modelcontextprotocol/ext-apps": "2.0.3",
59
59
  "@modelcontextprotocol/server": "2.3.0",
60
- "@napi-rs/canvas": "0.1.80",
60
+ "@napi-rs/canvas": "1.0.13",
61
61
  "@turbodocx/html-to-docx": "1.23.1",
62
62
  "ai": "7.0.102",
63
63
  "aws4fetch": "1.0.20",
@@ -73,15 +73,15 @@
73
73
  "jose": "6.2.12",
74
74
  "mammoth": "1.13.0",
75
75
  "marked": "18.0.14",
76
- "nanoid": "5.1.16",
77
- "nodemailer": "10.0.10",
76
+ "nanoid": "6.0.2",
77
+ "nodemailer": "10.1.4",
78
78
  "pdf-parse": "2.4.5",
79
79
  "playwright-core": "1.63.0",
80
- "postal-mime": "4.0.2",
80
+ "postal-mime": "4.0.8",
81
81
  "rfc6902": "5.3.0",
82
82
  "turndown": "7.2.4",
83
- "undici": "7.30.0",
84
- "zod": "4.6.5"
83
+ "undici": "8.12.3",
84
+ "zod": "4.6.6"
85
85
  },
86
86
  "bundleDependencies": [
87
87
  "@engenty/wizards",