@mccaskie-labs/workbench-config 0.1.38 → 0.1.40

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.40
4
+
5
+ ### Patch Changes
6
+
7
+ - A skill whose client questions aren't written yet (pdf, email) also gets its "Restyling" section, which now says PDFs and emails take project.css too.
8
+
9
+ ## 0.1.39
10
+
11
+ ### Patch Changes
12
+
13
+ - 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`.
14
+
3
15
  ## 0.1.38
4
16
 
5
17
  ### Patch Changes
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. */
@@ -142,7 +144,7 @@ export function renderSkill(m, guide) {
142
144
  ...beforeBlock(m),
143
145
  ];
144
146
  if (!o) {
145
- out.push("", "## Questions", "", "This tool's questions for the client aren't written yet. Use it with its defaults, tell the client that is what you did, and invent no setting. A choice only the client can make goes to them as a plain question.", "", ...useBlock(m, guide));
147
+ out.push("", "## Questions", "", "This tool's questions for the client aren't written yet. Use it with its defaults, tell the client that is what you did, and invent no setting. A choice only the client can make goes to them as a plain question.", ...(m.styles ? ["", "## Restyling", "", restyleLine(m.styles.prefix)] : []), "", ...useBlock(m, guide));
146
148
  return `${out.join("\n")}\n`;
147
149
  }
148
150
  out.push("", "## What to say", "", d.choice === "optional"
@@ -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, 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.`;
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, and PDFs and emails take it too (\`src/lib/project-css.ts\`). 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.38",
3
+ "version": "0.1.40",
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",