@nanopm/cli 0.1.18 → 0.1.19

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/index.js CHANGED
@@ -5335,6 +5335,8 @@ var BUILD_SKILL = "build";
5335
5335
  var BUILD_STEPS_MIN = 1;
5336
5336
  var BUILD_STEPS_MAX = 8;
5337
5337
  var BUILD_STEP_MAX = 120;
5338
+ var BUILD_UNDERSTOOD_MIN = 40;
5339
+ var BUILD_UNDERSTOOD_MAX = 600;
5338
5340
  var BUILD_RESUMES_MAX = 3;
5339
5341
  var BUILD_TRAILER = "Co-Authored-By: NanoPM <noreply@nanopm.app>";
5340
5342
  var BUILD_COLUMNS = "id, ref, title, status, actor, agent_spec, spec";
@@ -11271,9 +11273,10 @@ async function runBuildJob(input) {
11271
11273
  let end = { stop: failed("the agent produced no result") };
11272
11274
  for await (const event of adapter.run({ ...spec2, prompt, resumeSessionId: resume3 ? spec2.sessionId : void 0 })) {
11273
11275
  await input.onEvent(event);
11274
- if (event.type === "tool_use" && event.tool === PLAN_TOOL && !plan) {
11276
+ if (event.type === "tool_result" && event.tool === PLAN_TOOL && !event.isError && !plan) {
11275
11277
  plan = stepsOf(event.input);
11276
- if (plan) await events.write("plan", { steps: plan });
11278
+ const understood = event.input?.understood;
11279
+ if (plan) await events.write("plan", { steps: plan, ...typeof understood === "string" && understood.trim() ? { understood: understood.trim().slice(0, BUILD_UNDERSTOOD_MAX) } : {} });
11277
11280
  } else if (event.type === "tool_result" && event.tool === STEP_TOOL && !event.isError) {
11278
11281
  const { step, summary } = event.input ?? {};
11279
11282
  const index = Number(step) - 1;
@@ -12827,8 +12830,8 @@ ${renderMap()}`,
12827
12830
  server.registerTool(
12828
12831
  "build_plan",
12829
12832
  {
12830
- description: `Say the plan before you change anything: ${BUILD_STEPS_MIN} to ${BUILD_STEPS_MAX} steps, in order, each one change the founder can recognise, in their words (at most ${BUILD_STEP_MAX} characters). The last step is your own check of the whole change. Call it once; the founder sees it as a checklist.`,
12831
- inputSchema: { steps: z21.array(z21.string().min(3).max(BUILD_STEP_MAX)).min(BUILD_STEPS_MIN).max(BUILD_STEPS_MAX) }
12833
+ description: `Say what you understood and your plan before you change anything. \`understood\`: in your own words and plain language, the problem, what you will change, and what you will not touch \u2014 a short paragraph the founder reads first, so a misunderstanding shows before any code (at most ${BUILD_UNDERSTOOD_MAX} characters). \`steps\`: ${BUILD_STEPS_MIN} to ${BUILD_STEPS_MAX}, in order, each one change the founder can recognise, in their words (at most ${BUILD_STEP_MAX} characters); the last is your own check of the whole change. Call it once; the founder sees the paragraph, then the steps as a checklist.`,
12834
+ inputSchema: { understood: z21.string().min(BUILD_UNDERSTOOD_MIN).max(BUILD_UNDERSTOOD_MAX), steps: z21.array(z21.string().min(3).max(BUILD_STEP_MAX)).min(BUILD_STEPS_MIN).max(BUILD_STEPS_MAX) }
12832
12835
  },
12833
12836
  async ({ steps }) => ctx.workspace ? json({ recorded: steps.length, note: "Recorded. Build step 1 now; call build_step when it is done." }) : failure("this job builds nothing")
12834
12837
  );
@@ -14667,7 +14670,7 @@ import { promisify as promisify8 } from "util";
14667
14670
  // package.json
14668
14671
  var package_default = {
14669
14672
  name: "@nanopm/cli",
14670
- version: "0.1.18",
14673
+ version: "0.1.19",
14671
14674
  description: "An autonomous product manager for builders who run several small products. Runs on your machine, drives your own coding harness.",
14672
14675
  type: "module",
14673
14676
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanopm/cli",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "An autonomous product manager for builders who run several small products. Runs on your machine, drives your own coding harness.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,8 +24,11 @@ NanoPM commits each step for you and opens the pull request when you are done.
24
24
  2. If the code contradicts the spec — what it asks already exists, a step it assumes is not
25
25
  there, the size does not hold — `ask_user` before you plan: what the spec says, what the code
26
26
  has, what it changes, and the options. Do not guess what the founder decided.
27
- 3. `build_plan`: your plan, 1 to 8 steps, in order, each a change the founder can recognise, in
28
- their words. The last step is your check of the whole change.
27
+ 3. `build_plan`: first, in `understood`, what you understood, in your own words and plain
28
+ language — the problem, what you will change, what you will not touch. The founder reads it
29
+ before anything else; a misunderstanding must show there, not in the pull request. Then your
30
+ plan, 1 to 8 steps, in order, each a change the founder can recognise, in their words. The last
31
+ step is your check of the whole change.
29
32
  4. Build one step at a time. After each: run its tests and the project's own checks (the ones
30
33
  CLAUDE.md, the README or `package.json` name), fix what they report, then `build_step` with the
31
34
  step's number and one line on what you did. NanoPM commits right then, so a step is committed