@adia-ai/web-modules 0.8.28 → 0.8.29

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.8.29] — 2026-08-06
4
+
5
+ ### Added
6
+ - **chat-surfaces renders plan-envelope chrome** — `wireAgentEvents` gains a `step` case rendering the turn's surface manifest and "what changed" synthesis as feed chrome (workflow:'plan'), riding the existing AgentEvent `step` kind — no event-vocabulary change (gh#648, PR #654).
7
+
8
+ ### Maintenance
9
+ - **`dist/` bundles rebuilt** in this cut's window (1 file(s)) — regenerated from the source changes described above, not independent edits.
10
+
3
11
  ## [0.8.28] — 2026-08-05
4
12
 
5
13
  ### Fixed
@@ -39,6 +39,22 @@ export function createSurfaceRegistry(opts: {
39
39
  /** CHAT-HARNESS law 3 — code-owned progress labels, never model text. */
40
40
  export const PROGRESS_LABELS: Record<string, string>;
41
41
 
42
+ /** Plan-envelope feed chrome (gh#648) — code-owned sentence around a
43
+ * `PlanEnvelope`'s per-surface rationale. Ruling 3: feed chrome, never a canvas. */
44
+ export function describePlanManifest(plan: {
45
+ turnId: string;
46
+ surfaces: { surfaceId: string; rationale: string }[];
47
+ }): string;
48
+
49
+ /** Plan-envelope feed chrome (gh#648) — code-owned sentence around a
50
+ * `TurnSynthesis`'s new/updated/closed surface lists. */
51
+ export function describeTurnSynthesis(synthesis: {
52
+ turnId: string;
53
+ new: string[];
54
+ updated: string[];
55
+ closed: string[];
56
+ }): string;
57
+
42
58
  export function wireAgentEvents(
43
59
  chatShell: Element & {
44
60
  appendChunk?(text: string): void;
@@ -163,6 +163,38 @@ export const PROGRESS_LABELS = {
163
163
  done: 'Done',
164
164
  };
165
165
 
166
+ /**
167
+ * Plan-envelope feed chrome (gh#648, docs/ORCHESTRATION.md §Plan envelope
168
+ * ruling 3 — "what changed" is feed chrome, never a canvas). These render
169
+ * from the `{ type: 'step', workflow: 'plan', step: 'manifest'|'synthesis' }`
170
+ * AgentEvent — the EXISTING `step` kind (`@adia-ai/agent`'s `AgentEvent`
171
+ * union already carries `workflow`/`step`/`data`), so no closed-vocabulary
172
+ * `type` amendment is needed to carry this: `workflow: 'plan'` is just a
173
+ * new value inside an already-open string field, the same way
174
+ * `packages/agent/src/workflow.ts`'s own step events use `workflow` for a
175
+ * different named workflow.
176
+ *
177
+ * Code-owned text (CHAT-HARNESS law 3's spirit, applied to `step` the way
178
+ * PROGRESS_LABELS applies it to `progress`): the rationale strings inside
179
+ * a PlanEnvelope ARE planner-authored copy (not raw model text — R-O10's
180
+ * `rationale` is a structured field, one line per surface), so they render
181
+ * verbatim; the surrounding sentence is code-owned.
182
+ */
183
+ export function describePlanManifest(plan) {
184
+ const n = plan.surfaces.length;
185
+ const list = plan.surfaces.map((s) => `${s.surfaceId} — ${s.rationale}`).join('; ');
186
+ return `Planning ${n} surface${n === 1 ? '' : 's'}: ${list}`;
187
+ }
188
+
189
+ const SYNTHESIS_LABELS = { new: 'New', updated: 'Updated', closed: 'Closed' };
190
+
191
+ export function describeTurnSynthesis(synthesis) {
192
+ const parts = ['new', 'updated', 'closed']
193
+ .filter((key) => synthesis[key].length > 0)
194
+ .map((key) => `${SYNTHESIS_LABELS[key]}: ${synthesis[key].join(', ')}`);
195
+ return parts.length ? `What changed — ${parts.join(' · ')}` : 'What changed — nothing this turn';
196
+ }
197
+
166
198
  /**
167
199
  * Consumes ONE `AsyncIterable<AgentEvent>` for the turn already opened on
168
200
  * `chatShell` (the caller has already appended the user message and an
@@ -206,6 +238,21 @@ export async function wireAgentEvents(chatShell, registry, opts) {
206
238
  break;
207
239
  }
208
240
 
241
+ case 'step': {
242
+ // Plan-envelope chrome (gh#648, ruling 1 — harness-level progress,
243
+ // never wire; ruling 3 — feed chrome, never a canvas). Any other
244
+ // `workflow` value falls through unrendered — this switch only
245
+ // owns the 'plan' workflow's two steps.
246
+ if (event.workflow === 'plan' && event.step === 'manifest') {
247
+ chatShell.appendMessage?.({ role: 'assistant', content: describePlanManifest(event.data), render: true });
248
+ chatShell.appendMessage?.({ role: 'assistant', content: '' });
249
+ } else if (event.workflow === 'plan' && event.step === 'synthesis') {
250
+ chatShell.appendMessage?.({ role: 'assistant', content: describeTurnSynthesis(event.data), render: true });
251
+ chatShell.appendMessage?.({ role: 'assistant', content: '' });
252
+ }
253
+ break;
254
+ }
255
+
209
256
  case 'tool_use':
210
257
  chatShell.appendMessage?.({
211
258
  role: 'assistant',