@wrongstack/core 0.285.0 → 0.286.0

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 (145) hide show
  1. package/dist/autophase/phase-orchestrator.d.ts.map +1 -1
  2. package/dist/boot.d.ts.map +1 -1
  3. package/dist/coordination/agent-monitor.d.ts +29 -0
  4. package/dist/coordination/agent-monitor.d.ts.map +1 -1
  5. package/dist/coordination/autonomous-brain.d.ts +0 -2
  6. package/dist/coordination/autonomous-brain.d.ts.map +1 -1
  7. package/dist/coordination/autonomous-coordinator.d.ts +4 -0
  8. package/dist/coordination/autonomous-coordinator.d.ts.map +1 -1
  9. package/dist/coordination/brain-ledger.d.ts +142 -0
  10. package/dist/coordination/brain-ledger.d.ts.map +1 -0
  11. package/dist/coordination/brain-monitor.d.ts +31 -2
  12. package/dist/coordination/brain-monitor.d.ts.map +1 -1
  13. package/dist/coordination/brain.d.ts +43 -0
  14. package/dist/coordination/brain.d.ts.map +1 -1
  15. package/dist/coordination/delegate-tool.d.ts.map +1 -1
  16. package/dist/coordination/director-construction.d.ts.map +1 -1
  17. package/dist/coordination/director.d.ts +1 -1
  18. package/dist/coordination/director.d.ts.map +1 -1
  19. package/dist/coordination/fleet.d.ts +4 -4
  20. package/dist/coordination/fleet.d.ts.map +1 -1
  21. package/dist/coordination/global-mailbox.d.ts +63 -2
  22. package/dist/coordination/global-mailbox.d.ts.map +1 -1
  23. package/dist/coordination/index.d.ts +2 -1
  24. package/dist/coordination/index.d.ts.map +1 -1
  25. package/dist/coordination/index.js +1566 -462
  26. package/dist/coordination/index.js.map +4 -4
  27. package/dist/coordination/knowledge-graph.d.ts +13 -1
  28. package/dist/coordination/knowledge-graph.d.ts.map +1 -1
  29. package/dist/coordination/mailbox-actions.d.ts +12 -13
  30. package/dist/coordination/mailbox-actions.d.ts.map +1 -1
  31. package/dist/coordination/mailbox-constants.d.ts +64 -0
  32. package/dist/coordination/mailbox-constants.d.ts.map +1 -0
  33. package/dist/coordination/mailbox-events.d.ts +32 -0
  34. package/dist/coordination/mailbox-events.d.ts.map +1 -0
  35. package/dist/coordination/mailbox-message-codec.d.ts +8 -0
  36. package/dist/coordination/mailbox-message-codec.d.ts.map +1 -0
  37. package/dist/coordination/mailbox-types.d.ts +88 -4
  38. package/dist/coordination/mailbox-types.d.ts.map +1 -1
  39. package/dist/coordination/mailbox.d.ts +21 -2
  40. package/dist/coordination/mailbox.d.ts.map +1 -1
  41. package/dist/coordination/package-author-tracker.d.ts.map +1 -1
  42. package/dist/coordination/subagent-result-tool.d.ts.map +1 -1
  43. package/dist/defaults/index.js +846 -523
  44. package/dist/defaults/index.js.map +4 -4
  45. package/dist/execution/autonomous-runner.d.ts +7 -1
  46. package/dist/execution/autonomous-runner.d.ts.map +1 -1
  47. package/dist/execution/autonomy-brain.d.ts +72 -11
  48. package/dist/execution/autonomy-brain.d.ts.map +1 -1
  49. package/dist/execution/brain-chain.d.ts +53 -0
  50. package/dist/execution/brain-chain.d.ts.map +1 -0
  51. package/dist/execution/brain-evaluation.d.ts +66 -0
  52. package/dist/execution/brain-evaluation.d.ts.map +1 -0
  53. package/dist/execution/brain-runtime.d.ts +171 -0
  54. package/dist/execution/brain-runtime.d.ts.map +1 -0
  55. package/dist/execution/council-brain.d.ts +79 -0
  56. package/dist/execution/council-brain.d.ts.map +1 -0
  57. package/dist/execution/eternal-autonomy.d.ts +12 -0
  58. package/dist/execution/eternal-autonomy.d.ts.map +1 -1
  59. package/dist/execution/index.d.ts +5 -1
  60. package/dist/execution/index.d.ts.map +1 -1
  61. package/dist/execution/index.js +1350 -377
  62. package/dist/execution/index.js.map +4 -4
  63. package/dist/execution/parallel-eternal-engine.d.ts +12 -0
  64. package/dist/execution/parallel-eternal-engine.d.ts.map +1 -1
  65. package/dist/execution/tool-executor.d.ts.map +1 -1
  66. package/dist/hq/auth-store.d.ts +21 -3
  67. package/dist/hq/auth-store.d.ts.map +1 -1
  68. package/dist/hq/factory.d.ts +3 -0
  69. package/dist/hq/factory.d.ts.map +1 -1
  70. package/dist/hq/index.js +628 -72
  71. package/dist/hq/index.js.map +4 -4
  72. package/dist/hq/protocol.d.ts +54 -2
  73. package/dist/hq/protocol.d.ts.map +1 -1
  74. package/dist/hq/publisher.d.ts +4 -0
  75. package/dist/hq/publisher.d.ts.map +1 -1
  76. package/dist/index.d.ts +12 -6
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +3482 -1495
  79. package/dist/index.js.map +4 -4
  80. package/dist/kernel/events.d.ts +22 -4
  81. package/dist/kernel/events.d.ts.map +1 -1
  82. package/dist/kernel/index.js.map +2 -2
  83. package/dist/mailbox-attach.d.ts.map +1 -1
  84. package/dist/observability/index.js +16 -15
  85. package/dist/observability/index.js.map +2 -2
  86. package/dist/security/index.d.ts +1 -0
  87. package/dist/security/index.d.ts.map +1 -1
  88. package/dist/security/index.js +253 -21
  89. package/dist/security/index.js.map +4 -4
  90. package/dist/security/permission-policy-schema.d.ts +77 -0
  91. package/dist/security/permission-policy-schema.d.ts.map +1 -0
  92. package/dist/security/permission-policy.d.ts +5 -0
  93. package/dist/security/permission-policy.d.ts.map +1 -1
  94. package/dist/security/secret-vault.d.ts +9 -0
  95. package/dist/security/secret-vault.d.ts.map +1 -1
  96. package/dist/session-registry.d.ts.map +1 -1
  97. package/dist/storage/config-loader.d.ts +10 -0
  98. package/dist/storage/config-loader.d.ts.map +1 -1
  99. package/dist/storage/goal-store.d.ts +1 -1
  100. package/dist/storage/goal-store.d.ts.map +1 -1
  101. package/dist/storage/index.js +147 -162
  102. package/dist/storage/index.js.map +2 -2
  103. package/dist/storage/plan-store.d.ts +1 -1
  104. package/dist/storage/plan-store.d.ts.map +1 -1
  105. package/dist/storage/queue-store.d.ts +4 -0
  106. package/dist/storage/queue-store.d.ts.map +1 -1
  107. package/dist/storage/session-store.d.ts +9 -0
  108. package/dist/storage/session-store.d.ts.map +1 -1
  109. package/dist/storage/task-store.d.ts +1 -1
  110. package/dist/storage/task-store.d.ts.map +1 -1
  111. package/dist/storage/todos-checkpoint.d.ts +2 -2
  112. package/dist/storage/todos-checkpoint.d.ts.map +1 -1
  113. package/dist/types/config.d.ts +209 -1
  114. package/dist/types/config.d.ts.map +1 -1
  115. package/dist/types/index.js +11 -0
  116. package/dist/types/index.js.map +2 -2
  117. package/dist/types/multi-agent.d.ts +8 -0
  118. package/dist/types/multi-agent.d.ts.map +1 -1
  119. package/dist/types/observability.d.ts +5 -0
  120. package/dist/types/observability.d.ts.map +1 -1
  121. package/dist/types/tool.d.ts +7 -0
  122. package/dist/types/tool.d.ts.map +1 -1
  123. package/dist/utils/glob-expand.d.ts.map +1 -1
  124. package/dist/utils/incoming-images.d.ts +39 -0
  125. package/dist/utils/incoming-images.d.ts.map +1 -0
  126. package/dist/utils/index.d.ts +1 -0
  127. package/dist/utils/index.d.ts.map +1 -1
  128. package/dist/utils/index.js +81 -3
  129. package/dist/utils/index.js.map +3 -3
  130. package/dist/worktree/worktree-manager.d.ts +13 -4
  131. package/dist/worktree/worktree-manager.d.ts.map +1 -1
  132. package/instructions/agents/browser.md +25 -16
  133. package/instructions/coordination/subagent-baseline.md +16 -2
  134. package/instructions/leader-after-task.md +3 -1
  135. package/instructions/sections/tool/common-patterns.md +7 -1
  136. package/instructions/system.md +47 -0
  137. package/package.json +2 -2
  138. package/skills/docker-deploy/SKILL.md +1 -1
  139. package/skills/wrongstack-mailbox/SKILL.md +51 -12
  140. package/dist/plugins/git-plugin.d.ts +0 -15
  141. package/dist/plugins/git-plugin.d.ts.map +0 -1
  142. package/dist/plugins/observability-plugin.d.ts +0 -19
  143. package/dist/plugins/observability-plugin.d.ts.map +0 -1
  144. package/dist/plugins/plan-plugin.d.ts +0 -16
  145. package/dist/plugins/plan-plugin.d.ts.map +0 -1
@@ -230,10 +230,19 @@ export declare class WorktreeManager {
230
230
  */
231
231
  private tryResolveConflict;
232
232
  /**
233
- * True when staged content still carries conflict markers. `git diff --cached
234
- * --check` exits nonzero and prints a "leftover conflict marker" line for each
235
- * survivor; whitespace-only errors (also flagged by --check) are ignored so a
236
- * clean resolution with unrelated whitespace is not rejected.
233
+ * True when staged content still carries conflict markers.
234
+ *
235
+ * Primary probe: `git grep --cached` scans the STAGED blobs directly for a
236
+ * full marker line (`<<<<<<< `, `=======`, `>>>>>>> `, `||||||| `) — exit 0
237
+ * means found. This is byte-level and independent of git version, locale,
238
+ * and human-output phrasing. When the caller knows which files conflicted,
239
+ * the scan is restricted to them so an unrelated `=======` underline in
240
+ * some document can't false-positive.
241
+ *
242
+ * Fallback probe: `git diff --cached --check` prints a "leftover conflict
243
+ * marker" line per survivor. Kept as belt-and-braces — it was the original
244
+ * sole probe, but CI runners were observed to miss markers through it
245
+ * (output parsing), which let a half-resolved merge commit.
237
246
  */
238
247
  private hasConflictMarkers;
239
248
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"worktree-manager.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,cAAc,GACd,QAAQ,CAAC;AAEb,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,UAAU,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AAE,cAAc,EAAE,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAc9F;IAED,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE/C;IAED,IAAI,IAAI,cAAc,EAAE,CAEvB;IAID,OAAO,CAAC,aAAa;YAIP,gBAAgB;IAS9B,OAAO,CAAC,QAAQ;YAgBF,YAAY;IAkB1B;;;;;;;OAOG;YACW,YAAY;YAYZ,aAAa;IAQ3B,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,IAAI;IAaZ,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,UAAU;CAyBnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAO3D;AAED,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAMrE"}
@@ -10,18 +10,26 @@ Scope:
10
10
  - Evaluate JavaScript in the page context to extract structured data
11
11
  - Verify visual state (element visibility, text content, attribute values)
12
12
 
13
- Playwright tools available (require the "playwright" MCP server to be enabled):
14
- playwright_navigate(url) open a page at the given URL
15
- playwright_screenshot() capture a full-page or viewport screenshot
16
- playwright_click(selector) click on an element matching a CSS selector
17
- playwright_type(selector, text) type text into a focused input element
18
- playwright_evaluate(script) run arbitrary JavaScript in the page context
19
- playwright_select_option(selector, value) pick a <select> dropdown option
20
- playwright_hover(selector) hover the mouse over an element
21
- playwright_fill_form(fields) — fill multiple form fields in one call
22
- playwright_wait_for(selector) block until an element appears on the page
23
- playwright_press_key(key) press a keyboard key (Enter, Tab, Escape, …)
24
- playwright_drag(from, to) drag an element from one selector to another
13
+ First-party browser tools (no MCP server configuration required):
14
+ browser_status() check Playwright Chromium installation
15
+ browser_open(url?) open an isolated session; returns sessionId
16
+ browser_list() list only this agent's sessions
17
+ browser_navigate(sessionId, url) navigate to an approved URL
18
+ browser_snapshot(sessionId) bounded accessibility + console/network evidence
19
+ browser_screenshot(sessionId, ...) capture a durable PNG artifact
20
+ browser_click(sessionId, selector) click an element
21
+ browser_type(sessionId, selector, text) — fill an input
22
+ browser_select(sessionId, selector, value) pick a select option
23
+ browser_hover(sessionId, selector) hover an element
24
+ browser_wait(sessionId, selector?) wait for an element or bounded duration
25
+ browser_press(sessionId, key) — press a keyboard key
26
+ browser_drag(sessionId, from, to) — drag between elements
27
+ browser_evaluate(sessionId, expression) — confirmed arbitrary page evaluation
28
+ browser_upload(sessionId, selector, files) — confirmed project-local upload
29
+ browser_close(sessionId) — close and return the trace artifact
30
+
31
+ The optional Playwright MCP preset may coexist; its `playwright_*` names do not
32
+ collide with the first-party `browser_*` namespace.
25
33
 
26
34
  Input format you accept:
27
35
  { "task": "navigate | screenshot | extract | interact | verify", "url": "<url>", "steps": ["step1", "step2"] }
@@ -34,10 +42,11 @@ Output: Structured markdown report:
34
42
  - ## Errors (any failures with stack traces)
35
43
 
36
44
  Working rules:
37
- - Always playwright_navigate first before any interaction
38
- - Always playwright_wait_for after navigation to ensure the page is ready
39
- - playwright_screenshot is your primary evidence — use it before and after interactions
40
- - Use playwright_evaluate for structured data extraction (JSON, text content)
45
+ - Always browser_open first, then pass its sessionId to every operation
46
+ - Always browser_wait after navigation to ensure the page is ready
47
+ - browser_screenshot is your primary evidence — use it before and after interactions
48
+ - Use browser_snapshot before browser_evaluate; evaluation is confirmed and reserved for data the snapshot cannot expose
49
+ - Always browser_close when finished; run disposal also closes owned sessions as a safety net
41
50
  - If a selector fails, try alternative selectors before giving up
42
51
  - Report exact CSS selectors used — they're part of the evidence
43
52
  - If playwright tools are unavailable, report the error immediately — do not guess
@@ -6,6 +6,13 @@ Capabilities & operating rules:
6
6
  dependency install) and run non-interactively: routine work is
7
7
  pre-authorized, so finish the task end-to-end without stopping to ask
8
8
  permission to read, edit, or build.
9
+ - Memory tools (`remember`, `search_memory`, `find_related_memories`) are
10
+ available and share the project's knowledge base. Before every tool call
11
+ on an unfamiliar file, `search_memory` for relevant context. After
12
+ discovering a convention, file path, bug root cause, or making a
13
+ decision, `remember` it with type, scope, priority, and tags so the
14
+ Director and future agents see it. Use `project-memory` scope for
15
+ codebase facts, `user-memory` for preferences.
9
16
  - Stay inside the project root. Do not touch machine config, credentials,
10
17
  or global state — those require an explicit grant you do not have.
11
18
  - Respect your current working directory. When the Director gives you an
@@ -42,8 +49,15 @@ Bridge contract:
42
49
  CRITICAL CONSTRAINT — NO FURTHER DELEGATION:
43
50
  - You MUST NOT call `delegate`, `spawn_subagent`, `assign_task`, or any
44
51
  equivalent. Execute the assigned task yourself; do not orchestrate.
45
- - If a subtask is too complex, report what you found and let the Director
46
- decide how to decompose.
52
+ - If the assigned task is genuinely too large for one worker, finish a clean,
53
+ useful checkpoint instead of running until forced termination. Call
54
+ `submit_result` with `completion: "partial"` and a concrete `remaining_work`
55
+ description; the `delegate` tool can hand that remainder to a fresh worker.
56
+ - You still MUST NOT spawn that worker yourself. If an independent parallel
57
+ helper would materially improve the result, use `mail_send` (or mailbox
58
+ send) with type `ask` to request one from the leader. Name the exact helper
59
+ task, why it is independent, and what result you need; then continue your
60
+ own assigned slice unless blocked.
47
61
 
48
62
  Inter-agent mailbox (if you have the `mail_send`/`mail_inbox`/`mailbox` tools):
49
63
  - Your identity is `<your-name>@<session-tag>` (unique per session). Mail
@@ -18,5 +18,7 @@ Rules:
18
18
  - **Omit the tag entirely while the live `ctx.todos` list has any `pending` or `in_progress` item.** Finishing the in-flight todo list takes priority, and the runtime discards `<nextsteps>` in that state anyway. Emit it again on the turn the last todo flips to `completed`.
19
19
  - If you have no genuinely useful suggestions, omit the tag.
20
20
 
21
- **After a significant task, also post a status update** to the inter-agent mailbox so other agents can discover what you finished and route follow-on work:
21
+ **After a significant task, remember key findings** file paths you touched, conventions you noticed, decisions you made. Use `remember` with appropriate type, scope, priority, and tags so future sessions benefit.
22
+
23
+ **Also post a status update** to the inter-agent mailbox so other agents can discover what you finished and route follow-on work:
22
24
  `mailbox action=send to=* type=status subject="<one-line task summary>" body="<brief outcome>"`
@@ -5,5 +5,11 @@
5
5
  - **Verify after mutate:** `write`/`edit`/`patch` -> `read` back to confirm -> report outcome
6
6
  - **Explore project:** `glob` for structure -> `read` key files -> `grep` for patterns
7
7
  - **Batch ops:** Use `replace` with glob patterns for multi-file surgical changes
8
+ - **Memory before tool calls:** Before `read`/`edit`/`grep`/`glob` on unfamiliar files, `search_memory` for relevant context and include a hint in your reasoning
9
+ - **Remember every file path:** Every time you discover a useful file, `remember` its path with `type: "reference"`, tags: #path
10
+ - **Remember every convention:** Every time you notice a pattern, `remember` it with `type: "convention"`, appropriate scope, and tags
11
+ - **Remember decisions:** Before resolving ambiguity, `remember` the decision with `type: "decision"` so future turns don't re-litigate
12
+ - **Resume informed:** When starting work on a new area, `search_memory`/`find_related_memories` to surface past decisions
13
+ - **Memory-driven context:** Include memory hints in your reasoning during tool calls — the LLM reasons better with concrete context
8
14
 
9
- When unsure about a file's current state, read it first rather than assuming.
15
+ When unsure about a file's current state, read it first rather than assuming. When unsure about a project's conventions, search memory first.
@@ -30,6 +30,53 @@ For every non-trivial task, follow this four-phase loop:
30
30
 
31
31
  This loop separates intent, evidence, mutation, and validation. Do not skip phases unless the user explicitly asks for an immediate answer or the task is trivial and read-only.
32
32
 
33
+ ## Memory management — use it every turn
34
+
35
+ WrongStack has a SuperMemory system that persists facts across sessions and automatically injects relevant memories into your context. **Using memory is essential to being effective.**
36
+
37
+ ### When to remember
38
+
39
+ After discovering ANY of the following, call `remember` immediately:
40
+ - **File paths** you frequently access (`type: "reference"`, tags: #path)
41
+ - **Project conventions** you noticed (`type: "convention"`)
42
+ - **Design decisions** made during the session (`type: "decision"`)
43
+ - **Facts about the codebase** — architecture, dependencies, tooling (`type: "fact"`)
44
+ - **User preferences** — coding style, naming, testing habits (`type: "preference"`)
45
+ - **Anti-patterns** to avoid (`type: "anti_pattern"`)
46
+
47
+ ### Scope rules
48
+
49
+ | Scope | When to use |
50
+ |-------|------------|
51
+ | `project-memory` | Codebase facts, file paths, conventions, architecture decisions |
52
+ | `user-memory` | Personal preferences, workflow habits, naming style |
53
+ | `project-agents` | Inter-agent coordination facts (other agents' roles, active work) |
54
+
55
+ ### Memory priority
56
+
57
+ - `critical` — Security constraints, build commands, project-wide rules
58
+ - `high` — Important for most tasks (directory structure, main patterns)
59
+ - `medium` — Useful context (specific module details)
60
+ - `low` — Nice to know (minor preferences)
61
+
62
+ ### Before every tool call
63
+
64
+ Before calling `read`, `edit`, `grep`, `glob`, or `write` on a file or directory you haven't visited this session:
65
+ 1. `search_memory` for relevant context (path, topic, convention)
66
+ 2. Include a hint from memory in your reasoning — strengthens LLM context
67
+
68
+ ### After every significant discovery
69
+
70
+ - **File found**: `remember` the path with tags #path
71
+ - **Pattern noticed**: `remember` it with type `convention`
72
+ - **Decision made**: `remember` it with type `decision`
73
+ - **Bug found**: `remember` the root cause with type `fact`, tags #bug
74
+
75
+ ### Finding memories
76
+
77
+ - `search_memory` — keyword/substring search
78
+ - `find_related_memories` — graph traversal for connected knowledge
79
+
33
80
  ## Tool use and failures
34
81
 
35
82
  Call tools directly and let the permission flow decide — don't pre-announce that you "would like to" do something. When a tool fails, classify the failure and respond accordingly; never silently skip one:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.285.0",
3
+ "version": "0.286.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {
@@ -87,7 +87,7 @@
87
87
  ],
88
88
  "wrongstackApiVersion": "0.1.10",
89
89
  "dependencies": {
90
- "@wrongstack/kanban": "0.285.0"
90
+ "@wrongstack/kanban": "0.286.0"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@types/node": "^26.0.1",
@@ -143,7 +143,7 @@ trivy image --exit-code 1 --ignore-unfixed --severity HIGH,CRITICAL wrongstack:$
143
143
  ## WrongStack-specific notes
144
144
 
145
145
  - **WrongStack CLI entry point**: `packages/cli/dist/index.js` after build.
146
- - **pnpm workspaces**: Build from repo root `pnpm -r build` before `docker build`.
146
+ - **pnpm workspaces**: Build from repo root with `pnpm build` before `docker build`; WrongStack's build runner topologically orders workspace dependencies.
147
147
  - **Session storage**: Sessions are stored at `WRONGSTACK_SESSION_ROOT` — mount a volume for persistence.
148
148
  - **Config**: Config is at `WRONGSTACK_CONFIG_DIR` — mount for config persistence across restarts.
149
149
 
@@ -371,18 +371,55 @@ setInterval(() => {
371
371
  }, 30_000);
372
372
  ```
373
373
 
374
- ### Poll, don't long-poll
374
+ ### Real-time push via SSE (preferred) or polling
375
375
 
376
- The bridge does not support long-polling or websockets. Poll for new
377
- messages on a 5–10 s interval. Don't poll faster than 1 Hz that's noisy
378
- and gives nothing useful.
376
+ The bridge supports **Server-Sent Events (SSE)** on `GET /mailbox/events`
377
+ for real-time push. This is the preferred approachno polling needed.
379
378
 
380
- For normal inbox catch-up, prefer `/mailbox/check` over manual
381
- `/mailbox/query` + `/mailbox/ack-many`. It checks direct mail,
382
- `baseId` alias mail, and broadcasts in one call, dedupes messages, and
383
- can optionally mark them read or completed via one batch ack.
379
+ ```ts
380
+ // Open an SSE connection that pushes events in real-time.
381
+ const res = await fetch(`${url}/mailbox/events`, {
382
+ headers: { Authorization: `Bearer ${token}` },
383
+ });
384
+ const reader = res.body!.getReader();
385
+ const decoder = new TextDecoder();
386
+
387
+ for (;;) {
388
+ const { done, value } = await reader.read();
389
+ if (done) break;
390
+ const text = decoder.decode(value);
391
+ // SSE events arrive as: data: {"type":"message.sent",...}\n\n
392
+ for (const line of text.split('\n')) {
393
+ if (!line.startsWith('data: ')) continue;
394
+ const event = JSON.parse(line.slice(6));
395
+ if (event.type === 'message.sent') {
396
+ console.log(`[${event.type}] ${event.from} → ${event.to}: ${event.messageId}`);
397
+ // Fetch the full message via /mailbox/query or /mailbox/check.
398
+ }
399
+ }
400
+ }
401
+ ```
402
+
403
+ **SSE event types:**
404
+
405
+ | Event `type` | When | Payload fields |
406
+ |--------------|------|---------------|
407
+ | `message.sent` | A message was sent via `POST /mailbox/send` | `messageId`, `from`, `to`, `timestamp` |
408
+
409
+ The SSE stream sends a `: connected` comment on open and a
410
+ `: keepalive` comment every 15 s to prevent proxy/CDN timeouts.
411
+
412
+ **Important:** SSE events carry only the message id and metadata — not
413
+ the full message body. When you receive an event, call `/mailbox/check`
414
+ or `/mailbox/query` to fetch the complete message content.
415
+
416
+ **Fallback: polling.** If your HTTP client doesn't support SSE (or you're
417
+ behind a proxy that buffers responses), poll on a 5–10 s interval. Don't
418
+ poll faster than 1 Hz — the bridge enforces a rate limit of 120 requests
419
+ per minute per bearer token.
384
420
 
385
421
  ```ts
422
+ // Fallback: poll every 5 s when SSE is unavailable.
386
423
  async function pollOnce(): Promise<void> {
387
424
  const result = await mb('/mailbox/check', {
388
425
  agentId,
@@ -504,7 +541,7 @@ All routes take JSON bodies on POST (or no body on GET). All require
504
541
 
505
542
  | Method | Path | Purpose |
506
543
  |--------|------|---------|
507
- | POST | `/mailbox/send` | Send a message |
544
+ | POST | `/mailbox/send` | Send a message (supports optional `ttlMs` for auto-expiry) |
508
545
  | POST | `/mailbox/query` | Query messages (filters: `to`, `from`, `unreadBy`, `type`, `minPriority`, `incompleteOnly`, `limit`, `since`) |
509
546
  | POST | `/mailbox/check` | Read inbox mail for `agentId`/`baseId` plus broadcasts; optionally `markRead=false`, `completed=true`, `outcome` |
510
547
  | POST | `/mailbox/ack` | Acknowledge one message |
@@ -516,6 +553,7 @@ All routes take JSON bodies on POST (or no body on GET). All require
516
553
  | POST | `/mailbox/heartbeat` | Update client heartbeat |
517
554
  | GET | `/mailbox/agents` | List all registered agents |
518
555
  | GET | `/mailbox/agents/online` | List agents with a live heartbeat (within 60 s) |
556
+ | GET | `/mailbox/events` | **SSE stream** — real-time push of mailbox events (auth required) |
519
557
  | GET | `/healthz` | Liveness probe — does NOT require auth |
520
558
 
521
559
  ### Error shape
@@ -528,6 +566,7 @@ All routes take JSON bodies on POST (or no body on GET). All require
528
566
  |------|------|----------------------------|
529
567
  | `VALIDATION_ERROR` | 400 | Missing or wrong-type field. Read the message; it tells you which field. |
530
568
  | `UNAUTHORIZED` | 401 | Token mismatch. Re-read `~/.wrongstack/projects/<slug>/.mailbox.token` and try again — the bridge may have restarted. |
569
+ | `RATE_LIMITED` | 429 | Rate limit exceeded (max 120 requests/min per token). Slow down or use SSE instead of polling. |
531
570
  | `NOT_FOUND` | 404 | Wrong route. Check the path table above. |
532
571
  | `INTERNAL_ERROR` | 500 | WrongStack-side failure. Retry once; if it persists, surface to the user. |
533
572
 
@@ -606,9 +645,9 @@ await mb('/mailbox/send', {
606
645
  - **Don't reuse one `agentId` across multiple external sessions.** If
607
646
  two processes register under the same id, heartbeats overwrite each
608
647
  other and read receipts become unreliable.
609
- - **Don't poll faster than 1 Hz.** The bridge isn't load-tested for
610
- high-frequency polling, and there's no rate limit at the server side
611
- your noisy client can starve other agents.
648
+ - **Don't poll faster than 1 Hz.** The bridge enforces a rate limit of
649
+ 120 requests/min per bearer token (returns `429 RATE_LIMITED` beyond
650
+ that). Prefer SSE (`GET /mailbox/events`) over polling when possible.
612
651
  - **Don't include the token in any logged output.** It's the only
613
652
  credential. If you must print the URL, redact the token (`[REDACTED]`).
614
653
  - **Don't reply to a broadcast with another broadcast.** Replies should
@@ -1,15 +0,0 @@
1
- import type { Plugin } from '../types/plugin.js';
2
- import type { SlashCommand } from '../index.js';
3
- /**
4
- * GitPlugin — built-in git helpers.
5
- *
6
- * Registers `/commit`, `/gitcheck` and `/push`. First-party ("official")
7
- * plugin, so the commands keep their bare names and `gc` / `gcstatus` aliases.
8
- * `/commit` generates an LLM commit message from the session provider when one
9
- * is available, falling back to diff heuristics. No configuration required.
10
- */
11
- export declare function createGitPlugin(): Plugin;
12
- export declare function buildCommitCommand(): SlashCommand;
13
- export declare function buildGitcheckCommand(): SlashCommand;
14
- export declare function buildPushCommand(): SlashCommand;
15
- //# sourceMappingURL=git-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/git-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,MAAM,CA2BxC;AAgLD,wBAAgB,kBAAkB,IAAI,YAAY,CA+FjD;AAED,wBAAgB,oBAAoB,IAAI,YAAY,CAmBnD;AAED,wBAAgB,gBAAgB,IAAI,YAAY,CAiC/C"}
@@ -1,19 +0,0 @@
1
- import type { Plugin } from '../types/plugin.js';
2
- import type { SlashCommand } from '../index.js';
3
- import type { HealthRegistry, MetricsSink } from '../types/observability.js';
4
- interface ObservabilityPluginOptions {
5
- metricsSink?: MetricsSink | undefined;
6
- healthRegistry?: HealthRegistry | undefined;
7
- }
8
- /**
9
- * ObservabilityPlugin — runtime metrics + health checks.
10
- *
11
- * Registers `/metrics` and `/health`. First-party ("official") plugin, so the
12
- * commands keep their bare names. Both require the host to have started the
13
- * metrics subsystem (`--metrics`); without it they report that and no-op.
14
- */
15
- export declare function createObservabilityPlugin(opts?: ObservabilityPluginOptions): Plugin;
16
- export declare function buildMetricsCommand(metricsSink?: MetricsSink): SlashCommand;
17
- export declare function buildHealthCommand(healthRegistry?: HealthRegistry): SlashCommand;
18
- export {};
19
- //# sourceMappingURL=observability-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observability-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/observability-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7E,UAAU,0BAA0B;IAClC,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACtC,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE,0BAA0B,GAAG,MAAM,CA8BnF;AAQD,wBAAgB,mBAAmB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,YAAY,CAqC3E;AAED,wBAAgB,kBAAkB,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,YAAY,CAmBhF"}
@@ -1,16 +0,0 @@
1
- import type { Plugin } from '../types/plugin.js';
2
- import type { SlashCommand } from '../index.js';
3
- import type { WstackPaths } from '../utils/wstack-paths.js';
4
- interface PlanPluginOptions {
5
- paths?: WstackPaths | undefined;
6
- }
7
- /**
8
- * PlanPlugin — strategic plan board (`/plan`), the higher-level counterpart to
9
- * `/todos`. First-party ("official") plugin, so the command keeps its bare
10
- * name. Plans persist to `<projectDir>/plan.json` (from the injected
11
- * `WstackPaths`); the live context is read off `ctx` at dispatch.
12
- */
13
- export declare function createPlanPlugin(opts?: PlanPluginOptions): Plugin;
14
- export declare function buildPlanCommand(planPath?: string): SlashCommand;
15
- export {};
16
- //# sourceMappingURL=plan-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/plan-plugin.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAyBjE;AAYD,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAuHhE"}