@selesai/code 0.1.9 → 0.1.11

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.
@@ -63,6 +63,18 @@ export function resolveWindowsPiCliScript(deps: PiSpawnDeps = {}): string | unde
63
63
 
64
64
  if (argv1) {
65
65
  const argvPath = normalizePath(argv1);
66
+ // Resolve symlinks before checking the extension: a renamed fork like
67
+ // "selesai" is typically a symlink to dist/cli.js, so the raw argv1 has
68
+ // no .js extension and would otherwise fail the runnable-script check.
69
+ let resolved = argvPath;
70
+ try {
71
+ resolved = fs.realpathSync(argvPath);
72
+ } catch {
73
+ // realpath is best-effort; fall back to the raw path.
74
+ }
75
+ if (isRunnableNodeScript(resolved, existsSync)) {
76
+ return resolved;
77
+ }
66
78
  if (isRunnableNodeScript(argvPath, existsSync)) {
67
79
  return argvPath;
68
80
  }
@@ -284,7 +284,7 @@ This plan is for the ACTUAL prototype/output the user wants — not a plan for r
284
284
 
285
285
  If research was skipped, that is fine — proceed directly. You already understand the user's intent from grilling.
286
286
 
287
- Spawn the ARCHITECT SUB-AGENT to produce the plan. Use the task tool with subagent_type "architect". Craft a tailored prompt from ${artifactDir}/requirements.md and ${artifactDir}/research.md so the architect knows exactly what to plan for THIS task. The architect writes to ${artifactDir}/plan.md.
287
+ Spawn the ARCHITECT SUB-AGENT to produce the plan. Use the task tool with subagent_type "architect". Do NOT pass a model parameter — let the agent use its configured model. Craft a tailored prompt from ${artifactDir}/requirements.md and ${artifactDir}/research.md so the architect knows exactly what to plan for THIS task. The architect writes to ${artifactDir}/plan.md.
288
288
 
289
289
  The workflow advances automatically once plan.md exists.`;
290
290
  case "reuse":
@@ -292,7 +292,7 @@ The workflow advances automatically once plan.md exists.`;
292
292
 
293
293
  Purpose: explore the existing codebase for reusable components, patterns, and knowledge this prototype should build on, so you do not reinvent what already exists.
294
294
 
295
- Spawn an EXPLORER SUB-AGENT to do the exploration. Use the task tool with subagent_type "explorer". Do NOT send a generic exploration prompt — CRAFT a specific prompt tailored to THIS task: from ${artifactDir}/requirements.md and ${artifactDir}/plan.md, tell the explorer exactly which areas of the codebase, which patterns, and which dependencies are relevant. For example, if the user wants Tailwind, have the explorer determine how Tailwind is already set up and used here and what conventions to follow. Instruct the explorer to write its findings to ${artifactDir}/reuse.md.
295
+ Spawn an EXPLORER SUB-AGENT to do the exploration. Use the task tool with subagent_type "explorer". Do NOT pass a model parameter — let the agent use its configured model. Do NOT send a generic exploration prompt — CRAFT a specific prompt tailored to THIS task: from ${artifactDir}/requirements.md and ${artifactDir}/plan.md, tell the explorer exactly which areas of the codebase, which patterns, and which dependencies are relevant. For example, if the user wants Tailwind, have the explorer determine how Tailwind is already set up and used here and what conventions to follow. Instruct the explorer to write its findings to ${artifactDir}/reuse.md.
296
296
 
297
297
  When the explorer returns, synthesize its findings into ${artifactDir}/reuse.md: what is reusable, where, and how the prototype should leverage it.
298
298
 
@@ -308,15 +308,15 @@ Draw from ALL prior phases:
308
308
  - ${artifactDir}/plan.md (the build plan)
309
309
  - ${artifactDir}/reuse.md (codebase exploration findings)
310
310
 
311
- Spawn the RECAPPER SUB-AGENT to compile the handoff. Use the task tool with subagent_type "recapper". Craft a tailored prompt that points the recapper at all four artifact files and tells it what the prototype is about, so it can write a coherent handoff tailored to this task. The recapper writes to ${artifactDir}/handoff.md.
311
+ Spawn the RECAPPER SUB-AGENT to compile the handoff. Use the task tool with subagent_type "recapper". Do NOT pass a model parameter — let the agent use its configured model. Craft a tailored prompt that points the recapper at all four artifact files and tells it what the prototype is about, so it can write a coherent handoff tailored to this task. The recapper writes to ${artifactDir}/handoff.md.
312
312
 
313
313
  The workflow advances automatically once handoff.md exists.`;
314
314
  case "loop":
315
315
  return `You are entering the LOOP (orchestration) phase. Your job is to DELEGATE the implementation to sub-agents — do not implement the code yourself.
316
316
 
317
317
  Read ${artifactDir}/plan.md, ${artifactDir}/handoff.md, ${artifactDir}/research.md, and ${artifactDir}/reuse.md. Using that full context, GENERATE YOUR OWN delegation prompts (do not use a static template):
318
- 1. Dispatch ONE builder sub-agent (task tool, subagent_type "builder") with a prompt YOU craft: give it the plan + handoff + any research/reuse context it needs, tailored to this specific task, and instruct it to implement every task in plan.md in order. All code changes go in the workspace, never in ${artifactDir}.
319
- 2. Dispatch ONE commentator sub-agent (task tool, subagent_type "commentator") to review the builder's diff against plan.md. Generate the review prompt YOURSELF based on what matters for this task.
318
+ 1. Dispatch ONE builder sub-agent (task tool, subagent_type "builder"). Do NOT pass a model parameter — let the agent use its configured model. Craft a prompt: give it the plan + handoff + any research/reuse context it needs, tailored to this specific task, and instruct it to implement every task in plan.md in order. All code changes go in the workspace, never in ${artifactDir}.
319
+ 2. Dispatch ONE commentator sub-agent (task tool, subagent_type "commentator"). Do NOT pass a model parameter. Review the builder's diff against plan.md. Generate the review prompt YOURSELF based on what matters for this task.
320
320
  3. If the commentator reports blocking issues, dispatch the builder again with the issues to fix, then re-run the commentator. Repeat until no issues.
321
321
  4. Write ${artifactDir}/loop-complete.md with a one-line summary of the finished plan.
322
322
 
@@ -328,9 +328,9 @@ Purpose: review the changes made during the loop phase, then audit for over-engi
328
328
 
329
329
  Two sub-agent rounds:
330
330
 
331
- 1. Spawn the COMMENTATOR SUB-AGENT (task tool, subagent_type "commentator"). Craft a tailored prompt from the full diff and plan.md so the commentator reviews correctness and plan-adherence (writing ${artifactDir}/review.md), then runs a whole-repo over-engineering audit (writing ${artifactDir}/audit.md). Give the commentator the diff context and tell it which files matter.
331
+ 1. Spawn the COMMENTATOR SUB-AGENT (task tool, subagent_type "commentator"). Do NOT pass a model parameter — let the agent use its configured model. Craft a tailored prompt from the full diff and plan.md so the commentator reviews correctness and plan-adherence (writing ${artifactDir}/review.md), then runs a whole-repo over-engineering audit (writing ${artifactDir}/audit.md). Give the commentator the diff context and tell it which files matter.
332
332
 
333
- 2. If review.md or audit.md lists any actionable issues, spawn the BUILDER SUB-AGENT (task tool, subagent_type "builder") with a tailored prompt containing the commentator's findings. Instruct the builder to FIX every issue: trim over-engineering, delete dead code, remove unnecessary abstractions, correct plan deviations. All fixes go in the workspace, never in ${artifactDir}. Do not leave findings unresolved — no tech debt carries past this phase.
333
+ 2. If review.md or audit.md lists any actionable issues, spawn the BUILDER SUB-AGENT (task tool, subagent_type "builder"). Do NOT pass a model parameter. Craft a tailored prompt containing the commentator's findings. Instruct the builder to FIX every issue: trim over-engineering, delete dead code, remove unnecessary abstractions, correct plan deviations. All fixes go in the workspace, never in ${artifactDir}. Do not leave findings unresolved — no tech debt carries past this phase.
334
334
 
335
335
  3. After the builder returns, re-dispatch the commentator to confirm the fixes resolved the findings and no new issues appeared. Repeat commentator→builder until the commentator reports a clean review.
336
336
 
@@ -239,7 +239,7 @@ When you have enough clarity OR when 4 questions have been asked, stop grilling.
239
239
 
240
240
  This is a QUICK workflow — no separate research phase. Based on ${artifactDir}/requirements.md, produce the concrete build plan: what to build, how, in order, components, and what the finished prototype looks like.
241
241
 
242
- Spawn the ARCHITECT SUB-AGENT to produce the plan. Use the task tool with subagent_type "architect". Craft a tailored prompt from ${artifactDir}/requirements.md so the architect knows exactly what to plan for THIS task. The architect writes to ${artifactDir}/plan.md.
242
+ Spawn the ARCHITECT SUB-AGENT to produce the plan. Use the task tool with subagent_type "architect". Do NOT pass a model parameter — let the agent use its configured model. Craft a tailored prompt from ${artifactDir}/requirements.md so the architect knows exactly what to plan for THIS task. The architect writes to ${artifactDir}/plan.md.
243
243
 
244
244
  The workflow advances automatically once plan.md exists.`;
245
245
  case "reuse":
@@ -247,7 +247,7 @@ The workflow advances automatically once plan.md exists.`;
247
247
 
248
248
  Purpose: explore the existing codebase for reusable components, patterns, and knowledge this quick prototype should build on.
249
249
 
250
- Spawn an EXPLORER SUB-AGENT to do the exploration. Use the task tool with subagent_type "explorer". Craft a specific prompt tailored to THIS task from ${artifactDir}/requirements.md and ${artifactDir}/plan.md, telling the explorer which areas, patterns, and dependencies matter. Instruct the explorer to write findings to ${artifactDir}/reuse.md.
250
+ Spawn an EXPLORER SUB-AGENT to do the exploration. Use the task tool with subagent_type "explorer". Do NOT pass a model parameter — let the agent use its configured model. Craft a specific prompt tailored to THIS task from ${artifactDir}/requirements.md and ${artifactDir}/plan.md, telling the explorer which areas, patterns, and dependencies matter. Instruct the explorer to write findings to ${artifactDir}/reuse.md.
251
251
 
252
252
  When the explorer returns, synthesize its findings into ${artifactDir}/reuse.md: what is reusable, where, and how the prototype should leverage it.
253
253
 
@@ -262,15 +262,15 @@ Draw from ALL prior phases:
262
262
  - ${artifactDir}/plan.md
263
263
  - ${artifactDir}/reuse.md
264
264
 
265
- Spawn the RECAPPER SUB-AGENT to compile the handoff. Use the task tool with subagent_type "recapper". Craft a tailored prompt that points the recapper at all three artifact files and tells it what the prototype is about, so it writes a coherent handoff tailored to this task. The recapper writes to ${artifactDir}/handoff.md.
265
+ Spawn the RECAPPER SUB-AGENT to compile the handoff. Use the task tool with subagent_type "recapper". Do NOT pass a model parameter — let the agent use its configured model. Craft a tailored prompt that points the recapper at all three artifact files and tells it what the prototype is about, so it writes a coherent handoff tailored to this task. The recapper writes to ${artifactDir}/handoff.md.
266
266
 
267
267
  The workflow advances automatically once handoff.md exists.`;
268
268
  case "loop":
269
269
  return `You are entering the LOOP (orchestration) phase. Your job is to DELEGATE the implementation to sub-agents — do not implement the code yourself.
270
270
 
271
271
  Read ${artifactDir}/plan.md, ${artifactDir}/handoff.md, and ${artifactDir}/reuse.md. Using that full context, GENERATE YOUR OWN delegation prompts:
272
- 1. Dispatch ONE builder sub-agent (task tool, subagent_type "builder") with a prompt YOU craft: give it the plan + handoff + reuse context, tailored to this specific task, and instruct it to implement every task in plan.md in order. All code changes go in the workspace, never in ${artifactDir}.
273
- 2. Dispatch ONE commentator sub-agent (task tool, subagent_type "commentator") to review the builder's diff against plan.md. Generate the review prompt YOURSELF.
272
+ 1. Dispatch ONE builder sub-agent (task tool, subagent_type "builder"). Do NOT pass a model parameter — let the agent use its configured model. Give it the plan + handoff + reuse context, tailored to this specific task, and instruct it to implement every task in plan.md in order. All code changes go in the workspace, never in ${artifactDir}.
273
+ 2. Dispatch ONE commentator sub-agent (task tool, subagent_type "commentator"). Do NOT pass a model parameter. Review the builder's diff against plan.md. Generate the review prompt YOURSELF.
274
274
  3. If the commentator reports blocking issues, dispatch the builder again with the issues to fix, then re-run the commentator. Repeat until no issues.
275
275
  4. Write ${artifactDir}/loop-complete.md with a one-line summary of the finished plan.
276
276
 
@@ -282,9 +282,9 @@ Purpose: review loop-phase changes and audit for over-engineering across the rep
282
282
 
283
283
  Two sub-agent rounds:
284
284
 
285
- 1. Spawn the COMMENTATOR SUB-AGENT (task tool, subagent_type "commentator"). Craft a tailored prompt from the full diff and plan.md so the commentator reviews correctness and plan-adherence (writing ${artifactDir}/review.md), then runs a whole-repo over-engineering audit (writing ${artifactDir}/audit.md).
285
+ 1. Spawn the COMMENTATOR SUB-AGENT (task tool, subagent_type "commentator"). Do NOT pass a model parameter. Craft a tailored prompt from the full diff and plan.md so the commentator reviews correctness and plan-adherence (writing ${artifactDir}/review.md), then runs a whole-repo over-engineering audit (writing ${artifactDir}/audit.md).
286
286
 
287
- 2. If review.md or audit.md lists actionable issues, spawn the BUILDER SUB-AGENT (task tool, subagent_type "builder") with a tailored prompt containing the findings. Instruct the builder to FIX every issue. All fixes go in the workspace, never in ${artifactDir}.
287
+ 2. If review.md or audit.md lists actionable issues, spawn the BUILDER SUB-AGENT (task tool, subagent_type "builder"). Do NOT pass a model parameter. Craft a tailored prompt containing the findings. Instruct the builder to FIX every issue. All fixes go in the workspace, never in ${artifactDir}.
288
288
 
289
289
  3. After the builder returns, re-dispatch the commentator to confirm fixes resolved findings. Repeat until clean.
290
290
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selesai/code",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Selesai coding agent",
5
5
  "type": "module",
6
6
  "piConfig": {