@selesai/code 0.5.21 → 0.5.23

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.
Files changed (56) hide show
  1. package/README.md +1 -1
  2. package/dist/core/agent-session-skill-block.test.d.ts +2 -0
  3. package/dist/core/agent-session-skill-block.test.d.ts.map +1 -0
  4. package/dist/core/agent-session-skill-block.test.js +20 -0
  5. package/dist/core/agent-session-skill-block.test.js.map +1 -0
  6. package/dist/core/agent-session.d.ts +7 -4
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js +22 -12
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/skills.d.ts.map +1 -1
  11. package/dist/core/skills.js +1 -1
  12. package/dist/core/skills.js.map +1 -1
  13. package/dist/data/capabilities.d.ts +48 -0
  14. package/dist/data/capabilities.d.ts.map +1 -0
  15. package/dist/data/capabilities.js +282 -0
  16. package/dist/data/capabilities.js.map +1 -0
  17. package/dist/data/navigation.d.ts +3 -0
  18. package/dist/data/navigation.d.ts.map +1 -0
  19. package/dist/data/navigation.js +90 -0
  20. package/dist/data/navigation.js.map +1 -0
  21. package/dist/extensions/inline-skills.test.ts +96 -0
  22. package/dist/extensions/inline-skills.ts +92 -0
  23. package/dist/extensions/package.json +1 -0
  24. package/dist/extensions/pi-powerline-footer/tests/tps.test.ts +39 -0
  25. package/dist/extensions/pi-powerline-footer/tps.ts +172 -113
  26. package/dist/extensions/pi-subagents/src/tui/fleet.ts +0 -4
  27. package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +1 -1
  28. package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1 -1
  29. package/dist/extensions/question/batch.ts +89 -25
  30. package/dist/extensions/question/constants.ts +1 -1
  31. package/dist/extensions/question/helpers.ts +34 -78
  32. package/dist/extensions/question/index.ts +327 -564
  33. package/dist/extensions/question/package.json +2 -1
  34. package/dist/extensions/question/question-list.ts +21 -14
  35. package/dist/extensions/question/row-layout.ts +2 -2
  36. package/dist/extensions/question/schemas.ts +33 -47
  37. package/dist/extensions/question/selection-mode.ts +5 -7
  38. package/dist/extensions/question/tests/batch.test.ts +65 -16
  39. package/dist/extensions/question/tests/helpers.test.ts +31 -156
  40. package/dist/extensions/question/tests/question-list.test.ts +17 -3
  41. package/dist/extensions/question/tests/row-layout.test.ts +4 -4
  42. package/dist/extensions/question/tests/schemas.test.ts +30 -0
  43. package/dist/extensions/question/tests/wizard.test.ts +99 -0
  44. package/dist/extensions/question/types.ts +65 -66
  45. package/dist/extensions/workflow/adapter.ts +20 -77
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  51. package/dist/modes/interactive/interactive-mode.js +10 -10
  52. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  53. package/dist/skills/workflow-creation/SKILL.md +2 -2
  54. package/docs/skills.md +8 -0
  55. package/docs/workflows.md +4 -4
  56. package/package.json +1 -1
@@ -33,7 +33,7 @@ Done when every proposed behavior has one owner: state machine, shared adapter,
33
33
  For a new mode, add `src/extensions/workflow/modes/<name>.ts`, modeled on `quick.ts`, with only `WorkflowConfig` and `WorkflowModeRegistration`:
34
34
 
35
35
  - ordered phases, phase artifacts, prompts, validators, close artifacts/validators;
36
- - unique mode/status/entry identities and slash-command name; shared start/resume/end tools select the mode;
36
+ - unique mode/status/entry identities and slash-command name; users start/resume through that command, while the shared end tool selects the mode;
37
37
  - prompts that name exact artifact paths and use `write_workflow_artifact` only for workflow artifacts.
38
38
 
39
39
  Register the mode once in `MODES` in `extension.ts`; document its lifecycle and commands in `docs/workflows.md`.
@@ -45,7 +45,7 @@ Done when the mode file has no filesystem, persistence, event-registration, or c
45
45
  The shared adapter owns UUID artifact directories, atomic saves, resume, loop review state, and reload safety. Do not reimplement them per mode.
46
46
 
47
47
  - Persisted state changes after start, artifact/loop transition, resume reconciliation, and explicit end.
48
- - Never auto-resume on `session_start`; an explicit selector attaches a run.
48
+ - Never auto-resume on `session_start`; only a user-invoked mode command with an explicit selector attaches a run.
49
49
  - Artifact completion advances durable state then stops the parent turn; the user deliberately continues the attached mode.
50
50
  - Terminal-ready stays active. Only `end_workflow({ mode })` marks the record completed and terminates.
51
51
  - One `ExtensionAPI` hosts all modes: shared writer once, stale reload handlers inert, one attached run total.
package/docs/skills.md CHANGED
@@ -81,6 +81,14 @@ Skills register as `/skill:name` commands:
81
81
 
82
82
  Arguments after the command are appended to the skill content as `User: <args>`.
83
83
 
84
+ ### Inline Skill Picker
85
+
86
+ In interactive chat, type `#` anywhere in a prompt to open completion for available skills. Select a skill to insert `#skill-name`; on send, Selesai expands it at that position.
87
+
88
+ ```text
89
+ Draft implementation plan, then #codebase-design the module.
90
+ ```
91
+
84
92
  Toggle skill commands via `/settings` in interactive mode or in `settings.json`:
85
93
 
86
94
  ```json
package/docs/workflows.md CHANGED
@@ -20,7 +20,7 @@ src/extensions/workflow/
20
20
  - **`state-machine.ts`** is the deep module. It owns the phase graph, artifact gating, skip rules, the terminal close gate, and the reentrancy guard. It imports nothing external — no `node:fs`, no pi API, no `pi-tui`, no `typebox`. Every method returns a `WorkflowEffect` (a discriminated union in domain vocabulary) that the adapter pattern-matches on.
21
21
  - **`adapter.ts`** is the thin glue. It owns Pi/fs wiring, durable state, explicit resume, loop review persistence, and the git-based `reuse` skip predicate. Parent-written artifacts advance durable phase state and queue hidden engine continuations; every built-in mode flows automatically.
22
22
  - **`workflow.json`** in each artifact directory is the canonical, versioned run record. It is atomically replaced after state changes; session custom entries are only pointers for UI/history and never reconstruct an active run.
23
- - **`extension.ts`** imports each mode's registration object and calls `createWorkflowExtension(config, options)(pi)` for each. One extension load registers one shared writer plus `start_workflow`, `resume_workflow`, and `end_workflow`; each lifecycle call selects a mode.
23
+ - **`extension.ts`** imports each mode's registration object and calls `createWorkflowExtension(config, options)(pi)` for each. One extension load registers the model-facing artifact writer and `end_workflow` tool. Starting and resuming are user-only actions exposed by each mode's slash command.
24
24
  - **A mode file** is pure data: the phase list, per-phase artifact filenames, prompt generators, terminal close artifacts, and command/status/entry identities. Prompts receive `{ artifactDir, userPrompt }`. Each mode exports a `WorkflowModeRegistration` object (e.g. `prototypeMode`, `quickMode`); it does not call `createWorkflowExtension` itself.
25
25
 
26
26
  ## To add a future mode
@@ -106,7 +106,7 @@ import { rigorousMode } from "./modes/rigorous.ts";
106
106
  const MODES = [prototypeMode, quickMode, rigorousMode] as const;
107
107
  ```
108
108
 
109
- That's it. The loader picks it up at boot (`package.json` loads only `./extension.ts`); the shared lifecycle tools accept `mode: "rigorous"`, and the `/rigorous` command is registered automatically. There is no `next` tool — phases auto-advance as artifacts land and only `end_workflow({ mode: "rigorous" })` completes the terminal phase.
109
+ That's it. The loader picks it up at boot (`package.json` loads only `./extension.ts`), and the `/rigorous` command is registered automatically. There is no model-facing start/resume or `next` tool — users start and resume through `/rigorous`, phases auto-advance as artifacts land, and only `end_workflow({ mode: "rigorous" })` completes the terminal phase.
110
110
 
111
111
  ## Built-in modes
112
112
 
@@ -152,12 +152,12 @@ Each started workflow receives a UUID artifact directory under `.selesai/artifac
152
152
 
153
153
  Runs are **never** auto-resumed on session start. At most one run can be attached to a Pi instance, but older active runs remain resumable:
154
154
 
155
- - `start_workflow({ mode, goal })`, `resume_workflow({ mode, run: "<id-or-path>" })`, and `end_workflow({ mode })`, where `mode` is `prototype`, `quick`, or `task`
155
+ - Workflow initiation is user-only: `/workflow-prototype <goal>`, `/workflow-quick <goal>`, or `/workflow-task <goal>`
156
156
  - `/workflow-prototype resume <id-or-artifact-dir-or-workflow.json>` / `/workflow-quick resume ...` / `/workflow-task resume ...`
157
157
  - `/workflow-prototype resume`, `/workflow-quick resume`, or `/workflow-task resume` lists active runs (and offers a UI picker when available).
158
158
  - `/workflow-prototype help`, `/workflow-quick help`, or `/workflow-task help` shows the start, resume, continue, and explicit-completion lifecycle.
159
159
 
160
- Resume validates the selected file is under the artifacts base, belongs to that mode, is active, and matches its containing directory. It reconciles the current expected artifact once before emitting the current prompt, covering a crash after `write_workflow_artifact` writes the file but before the phase-state write. Valid artifact writes queue one hidden engine-controlled continuation using `steer` and terminate the current parent turn; invalid writes stay in the current phase and do not terminate. Prompts injected by start, resume, and continue commands are hidden custom messages rather than visible synthetic user messages. Transition-capable calls (`write_workflow_artifact`, loop commentator transitions, and `end_workflow`) must be the sole tool call in their assistant batch; the adapter fails closed when that cannot be proven. Corrupt records are skipped during discovery. Reloads never auto-resume; explicit `resume_workflow` remains required.
160
+ Resume validates the selected file is under the artifacts base, belongs to that mode, is active, and matches its containing directory. It reconciles the current expected artifact once before emitting the current prompt, covering a crash after `write_workflow_artifact` writes the file but before the phase-state write. Valid artifact writes queue one hidden engine-controlled continuation using `steer` and terminate the current parent turn; invalid writes stay in the current phase and do not terminate. Prompts injected by start, resume, and continue commands are hidden custom messages rather than visible synthetic user messages. Transition-capable calls (`write_workflow_artifact`, loop commentator transitions, and `end_workflow`) must be the sole tool call in their assistant batch; the adapter fails closed when that cannot be proven. Corrupt records are skipped during discovery. Reloads never auto-resume; the user must explicitly resume through a mode's slash command.
161
161
 
162
162
  A valid terminal artifact makes a workflow **terminal-ready**; it does not complete the run. Call `end_workflow({ mode })` to write `status: "completed"`, append the done entry, and terminate. This is the only completion path.
163
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selesai/code",
3
- "version": "0.5.21",
3
+ "version": "0.5.23",
4
4
  "description": "Maintained, extension-first Pi coding agent with built-in workflows, subagents, web research, questions, skills, and an enhanced terminal UI.",
5
5
  "type": "module",
6
6
  "repository": {