@mccaskie-labs/workbench-config 0.1.37 → 0.1.39

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,17 @@
1
1
  # @mccaskie-labs/workbench-config
2
2
 
3
+ ## 0.1.39
4
+
5
+ ### Patch Changes
6
+
7
+ - Skills: each tool's skill now sends Claude to the project's own note beside it, `.claude/skills/workbench-<component>/project.md` (never generated), for where that project wires the tool in, instead of to the project's `CLAUDE.md`. `workbench-start` tells Claude to make no claim about cost or setup when it introduces the tools (the first live test invented one). New export `projectNotes`.
8
+
9
+ ## 0.1.38
10
+
11
+ ### Patch Changes
12
+
13
+ - The pdf and email manifests have `styles` (`wb-pdf-`, `wb-email-`), so their skills say how to restyle them through `public/styles/project.css`.
14
+
3
15
  ## 0.1.37
4
16
 
5
17
  ### Patch Changes
@@ -68,5 +68,8 @@
68
68
  { "id": "email.hook.unsigned-refused", "half": "runtime", "expect": "refused_as_expected", "refusal": "unauthorised", "smoke": true, "cost_hint_usd": 0, "note": "POST /auth/send-email from outside with no signature answers 401, not a sign-in redirect: proves the Access path bypass and the handler. Needs no secret" },
69
69
  { "id": "email.hook.signed-refused-action", "half": "runtime", "expect": "refused_as_expected", "refusal": "refused", "cost_hint_usd": 0, "note": "A request signed with SEND_EMAIL_HOOK_SECRET for email_action_type recovery answers 422 and sends nothing; skipped while the Worker has no hook secret" },
70
70
  { "id": "email.brand.logo-public", "half": "runtime", "expect": "pass", "smoke": true, "cost_hint_usd": 0, "note": "GET brand.json's logo.url from outside with no sign-in answers 200 with an image content type" }
71
- ]
71
+ ],
72
+ "styles": {
73
+ "prefix": "wb-email-"
74
+ }
72
75
  }
@@ -94,5 +94,8 @@
94
94
  "cost_hint_usd": 0,
95
95
  "note": "Prints the app's own HTML holding an image from a host not in allowOrigins; the PDF is made and the browser reports that image's request as blocked"
96
96
  }
97
- ]
97
+ ],
98
+ "styles": {
99
+ "prefix": "wb-pdf-"
100
+ }
98
101
  }
@@ -1,4 +1,4 @@
1
- export declare const MANIFEST_VERSION: "8e65a2fda0b3";
1
+ export declare const MANIFEST_VERSION: "90023fb27145";
2
2
  export declare const capabilities: {
3
3
  readonly ai: {
4
4
  readonly $schema: "./schema.json";
@@ -897,6 +897,9 @@ export declare const capabilities: {
897
897
  readonly cost_hint_usd: 0;
898
898
  readonly note: "GET brand.json's logo.url from outside with no sign-in answers 200 with an image content type";
899
899
  }];
900
+ readonly styles: {
901
+ readonly prefix: "wb-email-";
902
+ };
900
903
  readonly delivery: {
901
904
  readonly choice: "built_in";
902
905
  readonly intro: "The emails the app sends, such as confirmations, receipts and sign-in codes.";
@@ -1924,6 +1927,9 @@ export declare const capabilities: {
1924
1927
  readonly cost_hint_usd: 0;
1925
1928
  readonly note: "Prints the app's own HTML holding an image from a host not in allowOrigins; the PDF is made and the browser reports that image's request as blocked";
1926
1929
  }];
1930
+ readonly styles: {
1931
+ readonly prefix: "wb-pdf-";
1932
+ };
1927
1933
  readonly delivery: {
1928
1934
  readonly choice: "optional";
1929
1935
  readonly intro: "PDFs such as invoices and receipts, printed with the project's logo and colours.";
@@ -1,6 +1,6 @@
1
1
  // Generated by `npm run capabilities:build` from capabilities/*.json. Do not edit.
2
2
  // check:capabilities fails in Checks when this file is stale.
3
- export const MANIFEST_VERSION = "8e65a2fda0b3";
3
+ export const MANIFEST_VERSION = "90023fb27145";
4
4
  export const capabilities = {
5
5
  "ai": {
6
6
  "$schema": "./schema.json",
@@ -1234,6 +1234,9 @@ export const capabilities = {
1234
1234
  "note": "GET brand.json's logo.url from outside with no sign-in answers 200 with an image content type"
1235
1235
  }
1236
1236
  ],
1237
+ "styles": {
1238
+ "prefix": "wb-email-"
1239
+ },
1237
1240
  "delivery": {
1238
1241
  "choice": "built_in",
1239
1242
  "intro": "The emails the app sends, such as confirmations, receipts and sign-in codes.",
@@ -2599,6 +2602,9 @@ export const capabilities = {
2599
2602
  "note": "Prints the app's own HTML holding an image from a host not in allowOrigins; the PDF is made and the browser reports that image's request as blocked"
2600
2603
  }
2601
2604
  ],
2605
+ "styles": {
2606
+ "prefix": "wb-pdf-"
2607
+ },
2602
2608
  "delivery": {
2603
2609
  "choice": "optional",
2604
2610
  "intro": "PDFs such as invoices and receipts, printed with the project's logo and colours.",
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { defineConfig, type Config } from "./define-config.ts";
3
3
  export { sharedSecret, workerSecret, redact, redactAll, type SecretsStoreSecretLike } from "./secrets.ts";
4
4
  export { WorkbenchConfigError, type ConfigErrorCode, type ConfigProblem } from "./errors.ts";
5
5
  export { capabilitySchema, checkManifests, allowedSchemas, COMPONENTS, type Capability, type Component, type ManifestProblem, type Offer, OFFER_PATTERNS, OFFER_PENDING, } from "./capability-schema.ts";
6
- export { renderSkill, renderSkills, renderStart, skillName, SKILLS_DIR, START_SKILL, TOOLS_FILE } from "./skills.ts";
6
+ export { projectNotes, renderSkill, renderSkills, renderStart, skillName, SKILLS_DIR, START_SKILL, TOOLS_FILE } from "./skills.ts";
7
7
  export { toolsState } from "./tools.ts";
8
8
  export type { ToolChoices, ToolsState } from "./tools.ts";
9
9
  export { capabilities, MANIFEST_VERSION, type Alias, type GatewayScope } from "./capabilities.gen.ts";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { defineConfig } from "./define-config.js";
3
3
  export { sharedSecret, workerSecret, redact, redactAll } from "./secrets.js";
4
4
  export { WorkbenchConfigError } from "./errors.js";
5
5
  export { capabilitySchema, checkManifests, allowedSchemas, COMPONENTS, OFFER_PATTERNS, OFFER_PENDING, } from "./capability-schema.js";
6
- export { renderSkill, renderSkills, renderStart, skillName, SKILLS_DIR, START_SKILL, TOOLS_FILE } from "./skills.js";
6
+ export { projectNotes, renderSkill, renderSkills, renderStart, skillName, SKILLS_DIR, START_SKILL, TOOLS_FILE } from "./skills.js";
7
7
  export { toolsState } from "./tools.js";
8
8
  export { capabilities, MANIFEST_VERSION } from "./capabilities.gen.js";
9
9
  export { compareDevVars, parseDevVarNames } from "./dev-vars.js";
package/dist/skills.d.ts CHANGED
@@ -4,6 +4,8 @@ export declare const skillName: (component: string) => string;
4
4
  /** The owner's choices: which optional tools this project uses (§9.6). */
5
5
  export declare const TOOLS_FILE = "workbench/tools.json";
6
6
  export declare const START_SKILL = "workbench-start";
7
+ /** The project's own notes on a tool, beside its generated skill: where this project wires it in. Never generated. */
8
+ export declare const projectNotes: (component: string) => string;
7
9
  /** The SKILL.md for one manifest, or undefined when it has no `delivery` (plumbing). `guide` is its `capabilities/<component>.md`, when there is one. */
8
10
  export declare function renderSkill(m: Capability, guide?: string): string | undefined;
9
11
  /** The `workbench-start` skill: every tool introduced to the owner, and how their choices are recorded (§9.6). */
package/dist/skills.js CHANGED
@@ -9,6 +9,8 @@ export const skillName = (component) => `workbench-${component}`;
9
9
  /** The owner's choices: which optional tools this project uses (§9.6). */
10
10
  export const TOOLS_FILE = "workbench/tools.json";
11
11
  export const START_SKILL = "workbench-start";
12
+ /** The project's own notes on a tool, beside its generated skill: where this project wires it in. Never generated. */
13
+ export const projectNotes = (component) => `${SKILLS_DIR}/${skillName(component)}/project.md`;
12
14
  const GENERATED = (from) => `<!-- Generated by \`npx workbench-config skills\` from @mccaskie-labs/workbench-config, ${from}. Don't edit: \`npx workbench-config skills --check\` fails when this file differs. -->`;
13
15
  const show = (v) => (v === null ? "none" : `\`${JSON.stringify(v)}\``);
14
16
  const cell = (s) => s.replaceAll("|", "\\|").replaceAll("\n", " ");
@@ -112,7 +114,7 @@ function useBlock(m, guide) {
112
114
  const out = ["## How to use it", ""];
113
115
  if (guide)
114
116
  out.push(guideSection(guide), "");
115
- out.push(`Its limits, rules and error codes are in ${manifest}. Where the project already wires it in is in the project's \`CLAUDE.md\`, and each package's API is in its \`README.md\` under \`node_modules/@mccaskie-labs/\`.`);
117
+ out.push(`Read \`${projectNotes(m.component)}\` next, if it is there: it is this project's own note on where the tool is already wired in and how to call it here. It is the project's to edit; add to it when the wiring changes. Its limits, rules and error codes are in ${manifest}, and each package's API is in its \`README.md\` under \`node_modules/@mccaskie-labs/\`.`);
116
118
  return out;
117
119
  }
118
120
  /** The SKILL.md for one manifest, or undefined when it has no `delivery` (plumbing). `guide` is its `capabilities/<component>.md`, when there is one. */
@@ -160,7 +162,7 @@ export function renderSkill(m, guide) {
160
162
  }
161
163
  /** How a project restyles what a component draws (docs/capabilities-manifest.md §10). */
162
164
  function restyleLine(prefix) {
163
- return `Everything this tool draws on a page has a \`${prefix}\` class with a default Workbench style, and its colours and sizes are \`--${prefix}*\` variables. All of them are listed, each with what it is, in \`public/styles/workbench.css\`, which \`npx workbench-ui styles\` generates: never edit it. To match the project's own look, write rules for those classes, or set the variables to the project's own colours, in \`public/styles/project.css\`. It loads after workbench.css and always wins. When the client asks for a different look, change project.css, never the tool's markup.`;
165
+ return `Everything this tool draws (on a page, in a PDF or in an email) has a \`${prefix}\` class with a default Workbench style, and its colours and sizes are \`--${prefix}*\` variables. All of them are listed, each with what it is, in \`public/styles/workbench.css\`, which \`npx workbench-ui styles\` generates: never edit it. To match the project's own look, write rules for those classes, or set the variables to the project's own colours, in \`public/styles/project.css\`. It loads after workbench.css and always wins. When the client asks for a different look, change project.css, never the tool's markup.`;
164
166
  }
165
167
  /** The `workbench-start` skill: every tool introduced to the owner, and how their choices are recorded (§9.6). */
166
168
  export function renderStart(manifests) {
@@ -186,7 +188,7 @@ export function renderStart(manifests) {
186
188
  `1. Read \`${TOOLS_FILE}\`. A tool listed there is decided: don't ask about it again.`,
187
189
  "2. If the file is missing, this is the first session. Introduce everything: say in two or three sentences that the project comes with Workbench tools, then show the two lists below in the owner's words (the first column), without package names.",
188
190
  "3. If the file is there and only some optional tools are missing from it, they arrived in an update. Introduce only those.",
189
- "4. Say the built-in tools are simply there. Don't ask about them.",
191
+ "4. Say the built-in tools are simply there. Don't ask about them. Say only what the lists say: make no claim about what a tool costs, or that nothing needs setting up.",
190
192
  "5. Ask about each undecided optional tool with the AskUserQuestion tool, one question per tool, up to four questions per call: \"Use it (Recommended)\" or \"Not now\". Put what the tool does in the question, in plain words.",
191
193
  "6. Write every answer to the file at once (the format is below), and tell the owner they can change any choice later by asking.",
192
194
  "7. Then carry on with what the owner came to do. A tool with unanswered settings asks them when it is first used, through its own skill.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mccaskie-labs/workbench-config",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "Workbench app configuration: WORKBENCH_ENV, typed variables that fail by name, secrets that are never printed, and the capabilities manifest.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",