@xingular/harness 1.3.1-unstable.2 → 1.3.1-unstable.3

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 (76) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +1 -1
  3. package/dist/cli.js +1217 -701
  4. package/dist/sdk/computer/screenshot.d.ts +32 -0
  5. package/dist/sdk/computer/screenshot.js +35 -0
  6. package/dist/sdk/context/attribution.d.ts +18 -0
  7. package/dist/sdk/context/attribution.js +295 -0
  8. package/dist/sdk/context/types.d.ts +94 -0
  9. package/dist/sdk/context/types.js +10 -0
  10. package/dist/sdk/index.d.ts +2 -1
  11. package/dist/sdk/index.js +2 -1
  12. package/dist/sdk/plugins/builtin.js +1 -0
  13. package/dist/sdk/prompt/compile.d.ts +42 -2
  14. package/dist/sdk/prompt/compile.js +87 -15
  15. package/dist/sdk/server/methods.js +3 -0
  16. package/dist/sdk/sessions/contracts.d.ts +4 -0
  17. package/dist/sdk/sessions/contracts.js +2 -0
  18. package/dist/sdk/sessions/runner.d.ts +10 -0
  19. package/dist/sdk/sessions/runner.js +17 -0
  20. package/dist/sdk/sessions/subagentService.d.ts +11 -1
  21. package/dist/sdk/sessions/subagentService.js +120 -38
  22. package/dist/sdk/sessions/subagents.d.ts +31 -0
  23. package/dist/sdk/sessions/subagents.js +45 -0
  24. package/dist/sdk/terminal/client.d.ts +1 -1
  25. package/dist/sdk/terminal/client.js +13 -6
  26. package/dist/sdk/terminal/control.d.ts +1 -1
  27. package/dist/sdk/terminal/control.js +2 -2
  28. package/dist/sdk/terminal/controller.d.ts +9 -0
  29. package/dist/sdk/terminal/controller.js +48 -11
  30. package/dist/sdk/terminal/piExtension.js +35 -1
  31. package/dist/sdk/terminal/terminals.d.ts +2 -0
  32. package/dist/sdk/terminal/terminals.js +11 -0
  33. package/dist/sdk/terminal/tui/commands.d.ts +1 -2
  34. package/dist/sdk/terminal/tui/commands.js +1 -4
  35. package/dist/sdk/terminal/tui/dialogs.d.ts +3 -2
  36. package/dist/sdk/terminal/tui/dialogs.js +4 -3
  37. package/dist/sdk/terminal/tui/keybindings.d.ts +1 -1
  38. package/dist/sdk/terminal/tui/keybindings.js +1 -1
  39. package/dist/sdk/terminal/tui/modeChoices.d.ts +3 -2
  40. package/dist/sdk/terminal/tui/modeChoices.js +4 -4
  41. package/dist/sdk/terminal/tui/mouseReport.d.ts +30 -0
  42. package/dist/sdk/terminal/tui/mouseReport.js +80 -0
  43. package/dist/sdk/terminal/tui/pages/annotatePage.js +3 -2
  44. package/dist/sdk/terminal/tui/pages/browserPage.d.ts +1 -1
  45. package/dist/sdk/terminal/tui/pages/contextPage.d.ts +54 -0
  46. package/dist/sdk/terminal/tui/pages/contextPage.js +393 -0
  47. package/dist/sdk/terminal/tui/pages/trajectoryPage.js +5 -4
  48. package/dist/sdk/terminal/tui/runtime.js +8 -2
  49. package/dist/sdk/terminal/tui/search.js +3 -2
  50. package/dist/sdk/terminal/tui/skillInvocation.d.ts +21 -2
  51. package/dist/sdk/terminal/tui/skillInvocation.js +31 -11
  52. package/dist/sdk/tools/defaultSkills.d.ts +19 -0
  53. package/dist/sdk/tools/defaultSkills.js +27 -1
  54. package/dist/sdk/tools/dispatch.js +8 -9
  55. package/dist/sdk/tools/spawnSubagent.d.ts +1 -1
  56. package/dist/sdk/tools/spawnSubagent.js +4 -2
  57. package/dist/terminal-opentui.js +570 -240
  58. package/dist/terminal-pi.js +142 -28
  59. package/docs/README.md +1 -0
  60. package/docs/architecture/02-sessions-and-runs.md +9 -0
  61. package/docs/architecture/04-prompt.md +13 -4
  62. package/docs/architecture/07-tools-and-gate.md +1 -1
  63. package/docs/architecture/11-terminal.md +12 -2
  64. package/docs/architecture/13-world-tools.md +17 -3
  65. package/docs/architecture/14-surfaces-and-parity.md +3 -3
  66. package/docs/architecture/README.md +1 -0
  67. package/docs/architecture/proposals/PROP-0049-context-attribution.md +382 -0
  68. package/docs/architecture/proposals/README.md +1 -0
  69. package/docs/decisions/ADR-0048-required-skills-from-a-message.md +42 -0
  70. package/docs/decisions/ADR-0050-approved-window-screenshots.md +19 -0
  71. package/docs/decisions/ADR-0051-terminal-decision-wait.md +10 -0
  72. package/docs/decisions/ADR-0052-per-profile-subagent-budgets.md +25 -0
  73. package/docs/parity.md +6 -6
  74. package/docs/releases/1.3.1-unstable.3.md +54 -0
  75. package/docs/terminal-tui.md +28 -15
  76. package/package.json +1 -1
@@ -29,10 +29,11 @@ overrides the Bun executable.
29
29
  [`app.ts`](../src/terminal/opentui/app.ts) owns the terminal lifecycle and reuses the shared
30
30
  `TerminalRuntime`, session replacement, commands, decisions, account pinning and run records. It
31
31
  projects the runtime's snapshot and transcript into an OpenCode-inspired view, with a native
32
- OpenTUI textarea for the prompt and `Ctrl+K` for the command palette. `Return` sends or steers a
33
- running reply; `Cmd+Return`, `Ctrl+Return` or `Alt+Return` queues a follow-up, and `Shift+Return`
34
- inserts a newline. Typing `/` or `$` filters
35
- matching commands or skills; `Tab` inserts the selected entry and leaves the cursor at the end of the inserted text.
32
+ OpenTUI textarea for the prompt and `Ctrl+K` for the command palette. `Return` sends or queues a
33
+ follow-up; `Cmd+Return`, `Ctrl+Return` or `Alt+Return` steers a running reply, and `Shift+Return`
34
+ inserts a newline. Typing `/` at the start of the draft filters matching commands, and typing `$` at any word start
35
+ filters matching skills; `Tab` inserts the selected entry and leaves the cursor after it. A `$`
36
+ entry replaces only the token being typed, so text before and after it stays in place.
36
37
  With an empty composer, unmodified Up recalls the latest non-empty user message from the active session.
37
38
  With a draft, unmodified Up browses older history and Down browses newer history when the caret is at
38
39
  either absolute draft endpoint (start or end). Down past the newest entry restores the draft, cursor
@@ -95,7 +96,7 @@ The frontend is verified with a real isolated PTY and a loopback provider. Run
95
96
  `python3 scripts/verify-terminal.py --welcome-only --sizes 40x20,80x24,120x40` to check the empty
96
97
  welcome, product label, accent colors and `/help` transition. Run
97
98
  `python3 scripts/verify-terminal.py --composer-only` for recognized slash-command colors in the composer
98
- and a user bubble, enabled-skill colors in the composer, unknown-token and argument colors,
99
+ and a user bubble, enabled-skill colors in the composer (leading and after text), unknown-token and argument colors,
99
100
  explicit-newline and soft-wrap checks of both prompt gutters, and normal/plan/Bash mode exclusivity.
100
101
  Run it with `--sizes 40x20,80x24,120x40` for compact through wide layouts. Use `--dialog-paste-only` to verify bracketed paste into a centered
101
102
  input dialog, `--file-completion-only` for filesystem completion and insertion,
@@ -246,8 +247,9 @@ end. A narrow `▕` thumb marks transcript position at the right edge; its mouse
246
247
  thinking, tools, image results, notices, summaries, custom messages, user messages, plan cards and
247
248
  Bash entries. User, plan and Bash bubbles also have one blank row of internal padding above and below
248
249
  their content; other entries have no internal vertical padding. Bubble padding is additional to the
249
- inter-entry gap. Internal lines within an entry stay together. The transcript stays pinned to the
250
- latest message until you scroll away. While scrolled away, a `↓ Jump to latest` badge overlays the
250
+ inter-entry gap. A plan card carries its title as an underlined header in the plan blue, then one
251
+ blank row before the plan body. Internal lines within an entry stay together. The transcript stays
252
+ pinned to the latest message until you scroll away. While scrolled away, a `↓ Jump to latest` badge overlays the
251
253
  transcript's lower-right corner; clicking it returns to the newest message and hides the badge.
252
254
  `Ctrl+End` remains an alternate way to jump to the end. A primary click in the transcript or empty
253
255
  welcome area focuses the composer. Dragging to select text anywhere in the TUI—including the
@@ -263,6 +265,12 @@ question's action is clicked. Dialogs preserve their existing confirmation safeg
263
265
  hover; terminals or multiplexers that do not report motion retain keyboard navigation. ANSI-only
264
266
  custom UI without a mouse handler remains keyboard-driven.
265
267
 
268
+ A mouse report the terminal delivers in two pieces across the input parser's timeout arrives as
269
+ printable keys. The composer and every single-line field drop the report's `<button;column;row>`
270
+ tail instead of keeping it, so a stray scroll never becomes a draft, a filter or a prompt; text typed
271
+ at human speed is untouched even when it spells the same shape. Recorded text never prints a
272
+ reported sequence on a page, and a bare tail that was recorded stays visible as recorded evidence.
273
+
266
274
  Page dialogs and blocks are absolute overlays, so the transcript stays behind them. The screen
267
275
  restores the terminal's alternate-screen state when the application exits.
268
276
 
@@ -377,10 +385,9 @@ snapshot and compares their text with the latest saved version. No in-place edit
377
385
  is added. Library skills and rules are added through `terminal.components.add`, which commits a
378
386
  validated future version. Directory-backed variants stay read-only.
379
387
 
380
- Skill browsing is independent of the Skill commands setting. Use inserts a leading `$name`
381
- without submitting. Ctrl+K opens a separate command filter; choosing a browser section keeps
388
+ Skill browsing is independent of the Skill commands setting. Use inserts `$name` without submitting. Ctrl+K opens a separate command filter; choosing a browser section keeps
382
389
  the existing draft text and attachment labels. Canceling the filter restores that draft. OpenTUI completes
383
- loaded skills for a leading `$`; Enter or Tab inserts the selected skill rather than sending.
390
+ loaded skills for a `$` at any word start; Enter or Tab inserts the selected skill rather than sending.
384
391
  Plugin contributions, settings, attachment and code trust share one detail flow. Package install
385
392
  and removal delegate to existing services; installing never trusts or activates code.
386
393
 
@@ -466,7 +473,8 @@ request-scoped prompt section, which the next ordinary request withdraws.
466
473
  Each mode keeps its own model and effort for the account. Every selection the person makes (the model
467
474
  picker, `/effort`, Shift+Up/Down, Ctrl+P) is saved against the mode it was made in, so Shift+Tab switches to that
468
475
  mode's model and effort, and a new conversation starts on the normal mode's latest choice. A mode with no
469
- choice of its own takes normal's, field by field. A resumed conversation keeps the model in its history,
476
+ choice of its own takes normal's, field by field; when neither has a saved effort, the mode uses Pi's
477
+ default level rather than keeping the level chosen in the other mode. A resumed conversation keeps the model in its history,
470
478
  and a saved model the account cannot use is skipped. The choices live in the account's `choices.json`,
471
479
  and the App reads and writes them through `accounts.choices` and `accounts.choose`.
472
480
 
@@ -652,12 +660,14 @@ second key once with `control.claim`, before plugin code loads. [`control.ts`](.
652
660
  retains it in a process-local promise shared with the bridge; it is never written to disk or
653
661
  placed in the environment. It survives `/new`, resume, fork and reload.
654
662
 
655
- The private key is required for `terminal.policy`, `terminal.approval`, `terminal.pending`,
663
+ The private key is required for `terminal.policy`, `terminal.approval`, `terminal.pending`, `terminal.pending.wait`,
656
664
  `terminal.approve`, `terminal.answer`, `terminal.draft`, `terminal.interrupt` and
657
665
  `terminal.resources`, as well as existing account and plugin mutations. A model-spawned shell with
658
666
  only the environment token cannot submit policy or approval decisions, change permissions, or
659
667
  answer its own pending questions. The application renders decisions obtained from the existing
660
668
  controller and returns the person's answer through these calls.
669
+ The frontend waits on revisioned decision snapshots instead of polling continuously; a bounded wait
670
+ and reconnect resynchronize the inbox after a lost connection.
661
671
 
662
672
  Approval prompts offer **Allow once**, **Always allow this tool everywhere** when the host policy
663
673
  marks the decision rememberable, and **Deny**. A tool grant covers every call with that tool name
@@ -768,9 +778,12 @@ file size separated by ` · `. One blank line separates each session. Enter resu
768
778
  session; account and folder scope checks
769
779
  remain enforced. Supplying an explicit path continues directly without opening the picker.
770
780
  The `$` palette completes enabled skill invocations using the same two-column palette as slash
771
- commands; `/skills` always browses skills. Choosing a skill inserts `$name ` without submitting.
772
- A recognized leading `$name` uses the blue accent in the composer, while its arguments, unavailable
773
- names and ordinary currency text keep the normal color. `/help` renders the command list as one
781
+ commands, at any word start in the draft; `/skills` always browses skills. Choosing a skill inserts
782
+ `$name` at the caret without submitting. Every recognized `$name` that names a loaded skill uses the
783
+ blue accent in the composer, while its arguments, unavailable names and ordinary currency text keep
784
+ the normal color. Sending a message that contains `$name` makes that skill required for the request:
785
+ the terminal appends its text and the requirement as a hidden request-scoped message, and the
786
+ person's wording is sent unchanged. `/help` renders the command list as one
774
787
  transcript entry, grouped under Core, Run, Model, Session, Inspect, Harness, Plugins and Prompts;
775
788
  command names and descriptions wrap in aligned columns, with no blank rows between choices. `/plugins`
776
789
  opens the focused local manager; its Packages tab installs, updates and removes packages with protected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingular/harness",
3
- "version": "1.3.1-unstable.2",
3
+ "version": "1.3.1-unstable.3",
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": {