@xingular/harness 1.6.0-unstable → 2.0.1-unstable

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/CHANGELOG.md +43 -0
  2. package/dist/cli.js +23375 -19883
  3. package/dist/sdk/cli.js +16 -1
  4. package/dist/sdk/harness.js +2 -1
  5. package/dist/sdk/prompt/reporting.d.ts +1 -1
  6. package/dist/sdk/prompt/reporting.js +8 -3
  7. package/dist/sdk/server/methods.js +12 -3
  8. package/dist/sdk/server/serve.d.ts +5 -2
  9. package/dist/sdk/server/serve.js +10 -3
  10. package/dist/sdk/server/socket.d.ts +28 -0
  11. package/dist/sdk/server/socket.js +122 -0
  12. package/dist/sdk/sessions/contracts.d.ts +14 -1
  13. package/dist/sdk/sessions/contracts.js +9 -0
  14. package/dist/sdk/sessions/extensionUi.js +4 -4
  15. package/dist/sdk/sessions/live.d.ts +101 -0
  16. package/dist/sdk/sessions/live.js +265 -0
  17. package/dist/sdk/sessions/registry.d.ts +12 -0
  18. package/dist/sdk/sessions/registry.js +3 -0
  19. package/dist/sdk/sessions/runner.d.ts +25 -3
  20. package/dist/sdk/sessions/runner.js +171 -31
  21. package/dist/sdk/sessions/sessions.d.ts +49 -0
  22. package/dist/sdk/sessions/sessions.js +165 -8
  23. package/dist/sdk/{terminal → sessions}/stallWatch.d.ts +4 -0
  24. package/dist/sdk/{terminal → sessions}/stallWatch.js +10 -4
  25. package/dist/sdk/sessions/subagentService.js +1 -1
  26. package/dist/sdk/terminal/controller.js +1 -3
  27. package/dist/sdk/terminal/daemon.d.ts +44 -0
  28. package/dist/sdk/terminal/daemon.js +264 -0
  29. package/dist/sdk/terminal/liveTerminal.d.ts +96 -0
  30. package/dist/sdk/terminal/liveTerminal.js +436 -0
  31. package/dist/sdk/terminal/standalone.d.ts +19 -1
  32. package/dist/sdk/terminal/standalone.js +75 -25
  33. package/dist/sdk/terminal/terminals.d.ts +43 -0
  34. package/dist/sdk/terminal/terminals.js +171 -14
  35. package/dist/sdk/terminal/tui/commands.d.ts +2 -0
  36. package/dist/sdk/terminal/tui/commands.js +24 -2
  37. package/dist/sdk/terminal/tui/harnessRuntime.d.ts +8 -0
  38. package/dist/sdk/terminal/tui/harnessRuntime.js +771 -0
  39. package/dist/sdk/terminal/tui/thinkingLevels.d.ts +11 -0
  40. package/dist/sdk/terminal/tui/thinkingLevels.js +31 -0
  41. package/dist/terminal-opentui.js +2013 -975
  42. package/dist/terminal-pi.js +9 -0
  43. package/docs/architecture/02-sessions-and-runs.md +61 -3
  44. package/docs/architecture/04-prompt.md +8 -6
  45. package/docs/architecture/10-server-protocol.md +23 -1
  46. package/docs/architecture/11-terminal.md +67 -3
  47. package/docs/architecture/12-storage.md +3 -1
  48. package/docs/architecture/14-surfaces-and-parity.md +4 -0
  49. package/docs/architecture/15-remote-control.md +3 -1
  50. package/docs/architecture/README.md +5 -0
  51. package/docs/decisions/ADR-0001-owned-terminal.md +9 -2
  52. package/docs/decisions/ADR-0083-one-live-session-runtime.md +256 -0
  53. package/docs/parity.md +4 -3
  54. package/docs/releases/2.0.1-unstable.md +63 -0
  55. package/docs/terminal-tui.md +10 -5
  56. package/package.json +1 -1
package/docs/parity.md CHANGED
@@ -36,7 +36,7 @@ implemented is not a parity claim; acceptance is tracked per command.
36
36
  | Agent profiles | `agents/profiles.ts` | `spawn_subagent { agent }`, `agents.list/get/create/remove`; terminal `terminal.agents.*`; package profiles through `Loading.profilePaths` | `/agents` page: browse, create, edit in `$EDITOR`, copy, delete; package profiles listed under "From a plugin" and switched on `/plugins` | Solo `/agents` lists profiles; profile details and management are not wired | partial | PAR-010 |
37
37
  | Run todo list | `tools/todo.ts` | `todo_write`, `runs.todo` (`runs.checklist` deprecated); terminal `todo` telemetry | registered in terminal sessions and their subagents; each write shows as a todo block in the transcript; `/todo` shows the current list; a subagent row shows its `n of m tasks` | `/todo` shows the current list on demand; each write is not rendered inline | terminal done; App shows it on demand | PAR-001 |
38
38
  | Continuation of a stopped run | `sessions/continuation.ts` | `continueFrom`, `runs.continuation` | not offered (`/resume` reopens history only) | not offered | planned | PAR-003 |
39
- | Bounded replies and checkpoints (PROP-0041) | `sessions/workSlice.ts`, `tools/checkpoint.ts`, `sessions/runner.ts`, `terminal/stallWatch.ts` | `checkpoint_write`, `workSlice`, `runs.continuation.checkpoint`, `checkpoint`/`heartbeat` events | guard on every terminal reply with the shared tool; every live reply heartbeats and a reply with no progress for fifteen minutes ends as `stalled`, a reply waiting on subagents is judged by each child's own clock, and the working row names what it waits on; the handoff is recorded on the run; no checkpoint card or slice control yet | not wired | implemented; terminal card, App presentation and `/slices` open | PAR-004 |
39
+ | Bounded replies and checkpoints (PROP-0041) | `sessions/workSlice.ts`, `tools/checkpoint.ts`, `sessions/runner.ts`, `sessions/stallWatch.ts` | `checkpoint_write`, `workSlice`, `runs.continuation.checkpoint`, `checkpoint`/`heartbeat` events | guard on every terminal reply with the shared tool; every harness run and terminal reply heartbeats and a reply with no progress for fifteen minutes ends as `stalled` (a stalled live session is closed), a reply waiting on subagents is judged by each child's own clock, and the working row names what it waits on; the handoff is recorded on the run; no checkpoint card or slice control yet | not wired | implemented; terminal card, App presentation and `/slices` open | PAR-004 |
40
40
  | Accounts | `accounts/` | `accounts.*` | `/accounts` | Accounts | parity | — |
41
41
  | Models and effort | `accounts/choices.ts` | — | `/model`, `/effort` | composer pickers | parity | — |
42
42
  | Skills | `plugins/`, `tools/dispatch.ts`, `prompt/compile.ts` | `skill_load`; `Launch.requiredSkills` | `$name` at any word start (required for that request), `/skill:name`, browser Skills tab | composer `$` chip with `requiredSkills`; Capability | implemented; install routes taught in the release-owned skill, foreign manifest skills load as package skills; acceptance not recertified | — |
@@ -136,7 +136,8 @@ or live-model sketch quality.
136
136
 
137
137
  | ID | Gap | Planned change |
138
138
  |---|---|---|
139
- | PAR-018 | Remote control from the App | `/remote-control` drives an `xagent` terminal session from a phone (page 15). App sessions are structured runs, not terminal sessions; the App would need the same pairing over its own session controls, or to present a terminal session's remote control. |
139
+ | PAR-019 | Client terminal (ADR-0083) | The default terminal runs on harness live sessions; `--daemon` and `xagent attach` let a reply outlive its window. The full production PTY run passes at 40x20, 80x24, 100x30 and 120x40, with the focused suites as recorded in ADR-0083; the suites that still fail fail the same way on the previous release's in-process runtime (Known drift D-30, D-31). Plugin custom TUI components, key handlers, renderers, shortcuts and themes need `XINGULAR_TERMINAL_RUNTIME=inprocess` (INV-TUI-8). Provider limits are captured by the harness's own model runtime; `/goal` runs as a harness goal. |
140
+ | PAR-018 | Remote control from the App | `/remote-control` drives an `xagent` terminal session from a phone (page 15). App sessions are structured runs, not terminal sessions; the App would need the same pairing over its own session controls, or to present a terminal session's remote control. ADR-0083: App chat turns now run on live sessions (`live: true`), the same path a client terminal uses, so remote control can move to live sessions; not built yet. |
140
141
  | PAR-017 | Plugin proposal review surfaces | The terminal provides hash-bound review in `/plugins`; the App has no proposal review UI yet. |
141
142
  | PAR-001 | Todo list not rendered inline in the App | Both surfaces can show the current list: the terminal renders each write as a todo block and `/todo` shows a snapshot; the App's `/todo` shows a read-only list. The App still does not draw an inline block for each write. |
142
143
  | PAR-002 | Acceptance of terminal-model History/Wiki/skill tools | Source gap resolved: `Terminals.ownTools` registers History/trajectory, Wiki-read and skill tools over the session socket; `xagent-wiki` is a user-facing shell utility, not the model's only route. Acceptance has not been recertified in this documentation pass. |
@@ -145,7 +146,7 @@ or live-model sketch quality.
145
146
  | PAR-005 | Wiki browsing only in the App | A `/wiki` page over `wiki.*`. |
146
147
  | PAR-006 | Acceptance of terminal first-party hooks | Source gap resolved: enabled hooks are returned by protected `firstParty.list` and loaded by `terminal/piExtension.ts`. Acceptance has not been recertified in this documentation pass. |
147
148
  | PAR-007 | Host tools without a complete Harness surface | The opt-in screenshot contract and unregistered interaction adapter exist, but terminal availability reporting, per-action authorization and a conforming backend are not wired. The current macOS host captures a display, not an isolated approved window, and uses global input. Terminal socket execution and native input delivery require a verified authorization boundary before control tools can be exposed. The remaining computer controls are host-owned; the files vault becomes a Harness capability or is dropped. |
148
- | PAR-008 | Separate session catalogs | Proposal approved; shared catalog is not implemented. Terminal `/session` selects native Pi history in the current folder. App `/session` reads Solo `agent.threads`, maps threads through Solo project groups, and filters to the current effective account and folder; `/session all` broadens only within that App catalog. It cannot open an arbitrary native session path. No cross-surface catalog or visibility guarantee exists. |
149
+ | PAR-008 | Separate session catalogs | Proposal approved; shared catalog is not implemented. Terminal `/session` selects native Pi history in the current folder. App `/session` reads Solo `agent.threads`, maps threads through Solo project groups, and filters to the current effective account and folder; `/session all` broadens only within that App catalog. It cannot open an arbitrary native session path. No cross-surface catalog or visibility guarantee exists. ADR-0083: `sessions.live` lists the live sessions of one harness, and the long-lived harness lists detached terminal replies (`terminal.detached`); neither is a catalog of saved sessions. |
149
150
  | PAR-009 | Shared folder/recent-project choice | Terminal starts from its launch `cwd` and can switch through its worktree surface. App Solo uses Project › Session and starts new sessions in the selected project's folder; it has no folder/worktree level or shared recent-folder picker. |
150
151
  | PAR-010 | Agent profile management in Solo | App Solo `/agents` can list profiles. Although the renderer allowlist includes `agents.get`, Solo does not wrap it; `agents.create/remove` are not exposed there. Profile details and management actions are unavailable, unlike terminal `/agents`. |
151
152
  | PAR-011 | Web annotations | Harness, terminal and App source done (PROP-0017, PROP-0018, 2026-10-24): the App calls `annotations.*`, imports its old notes once, uses the `page_notes_*` tools, and has the Annotate panel. Open: acceptance of the inspector and selection gestures in the running App's WKWebView. PROP-0038 (2026-10-25): both front ends share the page helper, so open shadow roots work in the terminal's capture browser and the App's tabs alike; composed text capture, save, resolve and reveal were exercised in an isolated App WKWebView, inspector clicks were not. PROP-0048 (2026-10-27): Harness and terminal moved to pending/sent with two popover actions, send-all with an optional request, clear, read-only page-note tools, and DevTools app discovery and launch; the App's Annotate panel still uses the removed queue methods and must follow. |
@@ -0,0 +1,63 @@
1
+ # Xingular Harness 2.0.1-unstable
2
+
3
+ Unstable preview of the current Harness work. Install with `npm install @xingular/harness@unstable`.
4
+ 2.0.0-unstable was tagged but never published; this is its first release.
5
+ This is a 2.0 line because the terminal's runtime changes: `xagent` is now a client of the harness
6
+ (ADR-0083), which adds methods and a socket transport and changes who owns execution in the
7
+ terminal. The package API and the stored data layout are otherwise unchanged.
8
+
9
+ - **One session runtime (ADR-0083): the terminal is now a client of the harness.** `xagent` runs no
10
+ agent loop in its window any more. Each turn is a harness run with the same gate, run records,
11
+ plan mode, goals and subagents as a host's, and the harness keeps the conversation's Pi session
12
+ open across turns (`sessions.run { live: true }`), so steering, queued follow-ups and plugin
13
+ state carry from one turn to the next. New methods `sessions.live`, `sessions.close`,
14
+ `sessions.followUp` and `sessions.followUp.clear`. `XINGULAR_TERMINAL_RUNTIME=inprocess` runs the
15
+ previous in-process runtime.
16
+ - **A long-lived harness (opt-in).** `xagent daemon start|stop|status` runs one harness per state
17
+ folder on an owner-only socket; `xagent --daemon` windows use it, so a reply keeps running when
18
+ its window closes, and `xagent attach [session]` reconnects. Plain `xagent` is unchanged: its
19
+ window runs its own private harness.
20
+ - **Every harness run now ends when it stops making progress.** A reply that produces nothing for
21
+ fifteen minutes (thirty with a tool running; a pending approval or a wait for subagents does not
22
+ count) is interrupted with reason `stalled`, whatever front end started it, and its live session
23
+ is closed rather than reused. Every run now sends the 30-second `heartbeat`, not only runs with a
24
+ work slice, so a long quiet tool is no longer settled as `owner_gone`.
25
+ - **Switching accounts starts on the new account's model.** A conversation resumed on another
26
+ account that names a model this account cannot use starts on this account's own latest choice,
27
+ with a notice, instead of showing and sending the old account's model. Plan and normal mode keep
28
+ their own model and effort in the new terminal: a mode that never chose an effort starts on the
29
+ default rather than the other mode's, a mode switch during a reply waits for it to settle, and a
30
+ one-shot `/plan` runs on the plan mode's choice.
31
+ - **The new terminal offers every effort level the model supports.** It stopped at `high`; it now
32
+ lists `xhigh` and `max` where the model maps them, and runs a model at the nearest level it
33
+ supports when asked for one it does not.
34
+ - **Fenced code in labeled panels.** Code blocks appear in a bordered panel labeled with the fence
35
+ language, with tree-sitter highlighting where a grammar is bundled and lightweight Python, shell
36
+ and JSON highlighting otherwise. The final-answer prompt asks for language-labeled fences and
37
+ `bash` fences for commands the person must run.
38
+ - **A reply whose provider request timed out and was retried successfully is now recorded as
39
+ completed**, not failed. A terminal window whose terminal closed no longer leaves its process
40
+ running.
41
+ - Terminal runs now record Pi's session id as `nativeSessionId`, as host runs do (in-process runs
42
+ keep recording their history file). `/session` takes a saved conversation's session id as well
43
+ as its file. Plugin dialogs reach the window as questions.
44
+
45
+ Two prompt lines change (the language-labeled fences), so the stable prefix misses the provider
46
+ cache once per existing session after the upgrade.
47
+
48
+ Behaviour changes to know about: in the default terminal, plugins get the host's interface
49
+ (dialogs, notices, status lines and text widgets); custom terminal components, key handlers,
50
+ renderers, shortcuts and themes need `XINGULAR_TERMINAL_RUNTIME=inprocess`.
51
+
52
+ Known gaps: a list item's wrapped lines are not aligned beneath its text (the renderer that did
53
+ that cost the blank rows between paragraphs, so lists wrap as in the previous release; Known drift
54
+ D-32). Remote control (`/remote-control`) still belongs to a terminal session, so a phone cannot
55
+ reach an App chat, and a reply that outlives its window under `--daemon` loses its phone
56
+ (PAR-018). The stall guard was tested with a fake Pi session and fake timers; no live model
57
+ request exercised it.
58
+
59
+ The release workflow builds the tarball from the `v2.0.1-unstable` tag, reruns CI on Ubuntu and
60
+ macOS, smoke-tests that exact tarball on both, and attaches it with `SHA256SUMS` to the GitHub
61
+ release before publishing it to npm's `unstable` dist-tag with provenance. The published SHA-256 and
62
+ npm integrity are the ones in that attached file, which `scripts/release-verify.mjs` checks against
63
+ the registry.
@@ -203,9 +203,10 @@ An empty conversation shows a centered welcome. The default `Xingular Agent` ide
203
203
  an orange block `X` and blue letter-spaced `A G E N T`, followed by `Welcome.`, the tagline
204
204
  `One run, done well.`, and a blue `/help` hint. Explicit host product names use the same generic mark and
205
205
  subline formatting. The current model and thinking level remain available in dim text. Once a message
206
- exists, a scrollable transcript fills the space above the composer. Single-line notices can appear
207
- with the welcome, while multiline notices such as `/help` switch to the transcript layout so their
208
- output cannot overlap it. The composer is a single top and bottom rule, with the right-aligned `plan mode` label followed by one divider character in the top rule,
206
+ exists, a scrollable transcript fills the space above the composer. Assistant replies, plan bodies,
207
+ and other transcript Markdown use one renderer. Single-line notices
208
+ can appear with the welcome, while multiline notices such as `/help` switch to the transcript layout
209
+ so their output cannot overlap it. The composer is a single top and bottom rule, with the right-aligned `plan mode` label followed by one divider character in the top rule,
209
210
  and the textarea in the middle.
210
211
  The working status row shows the active verb with a soft, warm glint that feathers across it and
211
212
  fades past its edges, followed by run duration and the latest completed assistant response's output
@@ -310,8 +311,12 @@ bundle, an installer, a launchable script or an executable file is refused with
310
311
  being run. The launcher receives the address as one argument without a shell. OSC 8 metadata is
311
312
  emitted where available, but link activation does not depend on terminal OSC 8 support; a terminal
312
313
  that opens OSC 8 links itself acts on its own modifier, so the Harness keeps the primary click.
313
- Inline and fenced code use a subtle panel fill with syntax colors. Emphasis, quotes, list markers,
314
- tables, dividers and task-list markers use the existing titanium palette. Images display their alt
314
+ Inline code uses a subtle panel fill. Fenced code appears in a bordered panel labeled with the
315
+ opening fence's language; JavaScript, TypeScript/TSX, Zig and other bundled grammars use tree-sitter,
316
+ while Python, shell and JSON receive lightweight token highlighting. Unknown or unlabeled languages
317
+ remain readable in the same panel, with `CODE` shown when no language is given. The code itself
318
+ stays selectable and copyable, and the panel updates while a reply streams. Emphasis, quotes, list
319
+ markers, tables, dividers and task-list markers use the existing titanium palette. Images display their alt
315
320
  text and are not fetched or rendered as image files.
316
321
 
317
322
  ## Todo block
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingular/harness",
3
- "version": "1.6.0-unstable",
3
+ "version": "2.0.1-unstable",
4
4
  "type": "module",
5
5
  "description": "Xingular Harness — a Pi agent harness built on recursive harnessing (Harness²): versioned eight-component variants, refinement from evidence, multi-account sessions, a compiled prompt, project notes, tools, and MCP",
6
6
  "repository": {