@mccaskie-labs/workbench-config 0.2.4 → 0.3.0

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/dist/skills.js CHANGED
@@ -120,14 +120,14 @@ function useBlock(m, guide) {
120
120
  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/\`.`);
121
121
  return out;
122
122
  }
123
- /** The SKILL.md for one manifest, or undefined when it has no `delivery` (plumbing). `guide` is its `capabilities/<component>.md`, when there is one. */
123
+ /** The SKILL.md for one manifest, or undefined for plumbing (no `delivery` or no `offer`). `guide` is its `capabilities/<component>.md`, when there is one. */
124
124
  export function renderSkill(m, guide) {
125
125
  const o = m.offer;
126
126
  const d = m.delivery;
127
- if (!d)
127
+ if (!d || !o)
128
128
  return undefined;
129
- const when = o?.when ?? d.when ?? m.summary;
130
- const description = (o ? `${when} Offers Workbench ${m.title} and asks the client for its settings.` : `${when} Use Workbench ${m.title} for it.`).replaceAll("\n", " ");
129
+ const when = o.when;
130
+ const description = `${when} Offers Workbench ${m.title} and asks the client for its settings.`.replaceAll("\n", " ");
131
131
  const out = [
132
132
  "---",
133
133
  `name: ${skillName(m.component)}`,
@@ -146,10 +146,6 @@ export function renderSkill(m, guide) {
146
146
  "",
147
147
  ...beforeBlock(m),
148
148
  ];
149
- if (!o) {
150
- 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));
151
- return `${out.join("\n")}\n`;
152
- }
153
149
  out.push("", "## What to say", "", d.choice === "optional"
154
150
  ? `Once the owner's choice is yes, say: "${o.say}"`
155
151
  : `Say: "${o.say}" Don't ask whether to use Workbench or something of the client's own. If the client says they don't want it, stop and say what they give up.`, "", "## How to ask", "", ...(o.needs?.length ? [`- First check the project setup this needs: ${o.needs.map((n) => `\`workbench/${n}.json\``).join(", ")}. If one is missing, use that component's \`workbench-<component>\` skill first.`] : []), ...PATTERN_STEPS[o.pattern].map((step) => `- ${step}`), "- Ask with the AskUserQuestion tool, up to four questions per call. Give each question's answers in the order below; the first is recommended, so label it \"(Recommended)\", unless the question says none is. The tool adds \"Other\" itself.", "- Where the client accepts every recommendation, still ask each \"Must ask\" question.", "- An \"Other\" answer must meet the rule under its question. When it doesn't, say why and ask again. Never store a value outside it.", "- Ask nothing that isn't listed here, and invent no setting. A need the questions don't cover goes back to the client as a plain question, and isn't written to the answers file.", `- Write the answers to \`${o.answers_file}\`${o.per ? `, one entry per ${o.per}` : ""}: ${o.answers_format ?? `for each question its id, the value, and the client's own words when they typed "Other" or changed a recommendation.`}${o.generator ? ` Then run \`${o.generator}\`, which writes the code and refuses anything the package can't apply (it doesn't check the "Other" rules: you do). It builds nothing while an answers file is a draft. Never edit what it writes; change the answers file and run it again.` : ""}`, "", "## Questions", "", o.questions.map((q, i) => questionBlock(q, i + 1)).join("\n\n"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mccaskie-labs/workbench-config",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
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",