@1agh/maude 0.29.0 → 0.31.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 (162) hide show
  1. package/README.md +6 -6
  2. package/apps/studio/acp/bridge.ts +285 -0
  3. package/apps/studio/acp/env.ts +48 -0
  4. package/apps/studio/acp/index.ts +132 -0
  5. package/apps/studio/acp/probe.ts +112 -0
  6. package/apps/studio/acp/transcript.ts +149 -0
  7. package/apps/studio/ai-banner.tsx +0 -1
  8. package/apps/studio/annotations-align.ts +149 -0
  9. package/apps/studio/annotations-bindings.ts +197 -0
  10. package/apps/studio/annotations-context-toolbar.tsx +436 -186
  11. package/apps/studio/annotations-groups.ts +270 -0
  12. package/apps/studio/annotations-layer.tsx +1714 -1661
  13. package/apps/studio/annotations-model.ts +2077 -0
  14. package/apps/studio/annotations-snap.ts +125 -0
  15. package/apps/studio/api.ts +433 -182
  16. package/apps/studio/bin/_png-playwright.mjs +1 -1
  17. package/apps/studio/bin/annotate.mjs +732 -0
  18. package/apps/studio/bin/annotate.sh +17 -0
  19. package/apps/studio/bin/chat-open.sh +44 -0
  20. package/apps/studio/bin/read-annotations.mjs +152 -17
  21. package/apps/studio/build.ts +1 -1
  22. package/apps/studio/canvas-arrowheads.ts +78 -9
  23. package/apps/studio/canvas-cursors.ts +2 -0
  24. package/apps/studio/canvas-edit.ts +257 -7
  25. package/apps/studio/canvas-icons.tsx +105 -0
  26. package/apps/studio/canvas-lib.tsx +112 -19
  27. package/apps/studio/canvas-list-watch.ts +177 -0
  28. package/apps/studio/canvas-shell.tsx +326 -9
  29. package/apps/studio/client/app.jsx +3579 -250
  30. package/apps/studio/client/canvas-url.js +5 -0
  31. package/apps/studio/client/github.js +99 -0
  32. package/apps/studio/client/index.html +1 -1
  33. package/apps/studio/client/panels/ChatPanel.jsx +770 -0
  34. package/apps/studio/client/panels/CollabModelInfographic.jsx +71 -0
  35. package/apps/studio/client/panels/CreateProject.jsx +334 -0
  36. package/apps/studio/client/panels/DiffView.jsx +590 -0
  37. package/apps/studio/client/panels/GitPanel.jsx +767 -0
  38. package/apps/studio/client/panels/IdentityBar.jsx +294 -0
  39. package/apps/studio/client/panels/OnboardingWizard.jsx +563 -0
  40. package/apps/studio/client/panels/RepoBranchSwitcher.jsx +349 -0
  41. package/apps/studio/client/panels/acp-runtime.js +286 -0
  42. package/apps/studio/client/panels/chat-markdown.jsx +138 -0
  43. package/apps/studio/client/panels/git-grouping.js +86 -0
  44. package/apps/studio/client/styles/0-reset.css +4 -0
  45. package/apps/studio/client/styles/3-shell-maude.css +1326 -14
  46. package/apps/studio/client/styles/4-components.css +39 -0
  47. package/apps/studio/client/styles/5-maude-overrides.css +41 -2
  48. package/apps/studio/client/styles/6-acp-chat.css +771 -0
  49. package/apps/studio/client/styles/_index.css +2 -0
  50. package/apps/studio/client/tour/collab-tour.js +61 -0
  51. package/apps/studio/client/tour/overlay.jsx +116 -18
  52. package/apps/studio/client/tour/usage-tour.js +23 -10
  53. package/apps/studio/client/whats-new.jsx +25 -10
  54. package/apps/studio/collab/registry.ts +13 -0
  55. package/apps/studio/collab/room.ts +36 -0
  56. package/apps/studio/commands/annotation-strokes-command.ts +1 -1
  57. package/apps/studio/commands/move-artboards-command.ts +1 -1
  58. package/apps/studio/comments-overlay.tsx +7 -5
  59. package/apps/studio/context-menu.tsx +4 -3
  60. package/apps/studio/contextual-toolbar.tsx +14 -0
  61. package/apps/studio/cursors-overlay.tsx +37 -21
  62. package/apps/studio/dist/client.bundle.js +31795 -1829
  63. package/apps/studio/dist/comment-mount.js +97 -9
  64. package/apps/studio/dist/styles.css +7938 -1599
  65. package/apps/studio/dom-selection.ts +115 -0
  66. package/apps/studio/export-dialog.tsx +3 -3
  67. package/apps/studio/git/endpoints.ts +338 -0
  68. package/apps/studio/git/service.ts +1334 -0
  69. package/apps/studio/git/watch.ts +97 -0
  70. package/apps/studio/github/endpoints.ts +358 -0
  71. package/apps/studio/github/service.ts +231 -0
  72. package/apps/studio/github/token.ts +53 -0
  73. package/apps/studio/history.ts +20 -3
  74. package/apps/studio/hmr-broadcast.ts +9 -2
  75. package/apps/studio/http.ts +508 -6
  76. package/apps/studio/input-router.tsx +7 -0
  77. package/apps/studio/inspect.ts +37 -8
  78. package/apps/studio/participants-chrome.tsx +70 -16
  79. package/apps/studio/paths.ts +12 -0
  80. package/apps/studio/scaffold-design.ts +57 -0
  81. package/apps/studio/server.ts +70 -4
  82. package/apps/studio/sync/agent.ts +311 -57
  83. package/apps/studio/sync/codec.ts +69 -0
  84. package/apps/studio/sync/cold-start.ts +198 -0
  85. package/apps/studio/sync/connection-state.ts +58 -2
  86. package/apps/studio/sync/hub-link.ts +137 -0
  87. package/apps/studio/sync/index.ts +563 -221
  88. package/apps/studio/sync/journal.ts +190 -0
  89. package/apps/studio/sync/migrate-seed.ts +202 -44
  90. package/apps/studio/sync/projection.ts +22 -3
  91. package/apps/studio/sync/status.ts +15 -4
  92. package/apps/studio/test/acp-bridge.test.ts +127 -0
  93. package/apps/studio/test/acp-env.test.ts +65 -0
  94. package/apps/studio/test/acp-origin-gate.test.ts +78 -0
  95. package/apps/studio/test/acp-transcript.test.ts +112 -0
  96. package/apps/studio/test/activity.test.ts +1 -7
  97. package/apps/studio/test/annotate-write.test.ts +184 -0
  98. package/apps/studio/test/annotations-align.test.ts +88 -0
  99. package/apps/studio/test/annotations-bindings.test.ts +124 -0
  100. package/apps/studio/test/annotations-groups.test.ts +231 -0
  101. package/apps/studio/test/annotations-snap.test.ts +79 -0
  102. package/apps/studio/test/canvas-create-api.test.ts +72 -0
  103. package/apps/studio/test/canvas-edit.test.ts +181 -1
  104. package/apps/studio/test/canvas-list-watch.test.ts +322 -0
  105. package/apps/studio/test/canvas-meta-api.test.ts +161 -27
  106. package/apps/studio/test/canvas-origin-gate.test.ts +43 -0
  107. package/apps/studio/test/chat-markdown.test.tsx +58 -0
  108. package/apps/studio/test/collab-bridge.test.ts +0 -2
  109. package/apps/studio/test/collab-room.test.ts +2 -7
  110. package/apps/studio/test/collab-session-survival.test.tsx +176 -0
  111. package/apps/studio/test/csp-canvas-shell.test.ts +5 -0
  112. package/apps/studio/test/csrf-write-guard.test.ts +78 -0
  113. package/apps/studio/test/editing-presence.test.ts +103 -0
  114. package/apps/studio/test/figjam-v3-model.test.ts +342 -0
  115. package/apps/studio/test/fixtures/figjam-v3-groups-bindings.svg +1 -0
  116. package/apps/studio/test/fixtures/mock-acp-agent.mjs +45 -0
  117. package/apps/studio/test/git-api.test.ts +0 -0
  118. package/apps/studio/test/git-branches.test.ts +106 -0
  119. package/apps/studio/test/git-grouping.test.ts +106 -0
  120. package/apps/studio/test/git-watch.test.ts +97 -0
  121. package/apps/studio/test/github-api.test.ts +465 -0
  122. package/apps/studio/test/hub-link.test.ts +69 -0
  123. package/apps/studio/test/participants-chrome.test.ts +36 -1
  124. package/apps/studio/test/shared-doc-migrate.test.ts +224 -14
  125. package/apps/studio/test/sync-agent.test.ts +272 -2
  126. package/apps/studio/test/sync-codec.test.ts +65 -0
  127. package/apps/studio/test/sync-cold-seed-dedup.test.ts +187 -0
  128. package/apps/studio/test/sync-cold-start.test.ts +304 -0
  129. package/apps/studio/test/sync-connection-state.test.ts +68 -0
  130. package/apps/studio/test/sync-hardening.test.ts +0 -8
  131. package/apps/studio/test/sync-hubs-config.test.ts +0 -1
  132. package/apps/studio/test/sync-incident-replay.test.ts +211 -0
  133. package/apps/studio/test/sync-journal.test.ts +176 -0
  134. package/apps/studio/test/sync-runtime.test.ts +360 -5
  135. package/apps/studio/test/sync-status.test.ts +66 -0
  136. package/apps/studio/test/tour-overlay.test.tsx +18 -0
  137. package/apps/studio/test/use-annotation-resize.test.ts +159 -0
  138. package/apps/studio/test/use-artboard-drag.test.ts +0 -1
  139. package/apps/studio/test/use-collab.test.ts +0 -0
  140. package/apps/studio/test/use-tool-mode.test.tsx +5 -2
  141. package/apps/studio/tool-palette.tsx +30 -11
  142. package/apps/studio/undo-hud.tsx +0 -1
  143. package/apps/studio/use-agent-presence.tsx +4 -2
  144. package/apps/studio/use-annotation-resize.tsx +484 -54
  145. package/apps/studio/use-annotation-selection.tsx +16 -4
  146. package/apps/studio/use-canvas-activity.tsx +2 -2
  147. package/apps/studio/use-chrome-visibility.tsx +66 -0
  148. package/apps/studio/use-collab.tsx +434 -202
  149. package/apps/studio/use-selection-set.tsx +9 -0
  150. package/apps/studio/use-tool-mode.tsx +5 -1
  151. package/apps/studio/whats-new.json +208 -10
  152. package/apps/studio/whats-new.schema.json +18 -2
  153. package/apps/studio/ws.ts +44 -1
  154. package/cli/commands/design-link.test.mjs +84 -0
  155. package/cli/commands/design.mjs +3 -1
  156. package/cli/commands/design.test.mjs +5 -1
  157. package/cli/lib/design-link.mjs +51 -1
  158. package/cli/lib/gitignore-block.mjs +16 -3
  159. package/cli/lib/gitignore-block.test.mjs +13 -1
  160. package/package.json +11 -9
  161. package/plugins/design/dependencies.json +17 -0
  162. package/plugins/design/templates/_shell.html +58 -12
@@ -1,6 +1,6 @@
1
1
  // use-tool-mode — Phase 4.1 Task 2. Provider transitions + cursor sync.
2
2
 
3
- import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
3
+ import { describe, expect, test } from 'bun:test';
4
4
 
5
5
  import { renderToStaticMarkup } from 'react-dom/server';
6
6
 
@@ -12,7 +12,7 @@ import {
12
12
  } from '../use-tool-mode.tsx';
13
13
 
14
14
  describe('use-tool-mode / static', () => {
15
- test('DEFAULT_TOOLS exposes V/H/C + draw set B/I/R/N/A/T/E (single Shape tool + highlighter)', () => {
15
+ test('DEFAULT_TOOLS exposes V/H/C + draw set B/I/R/N/⇧S/A/T/E (single Shape tool + highlighter + section)', () => {
16
16
  expect(DEFAULT_TOOLS.map((t) => t.id)).toEqual([
17
17
  'move',
18
18
  'hand',
@@ -21,6 +21,7 @@ describe('use-tool-mode / static', () => {
21
21
  'highlighter',
22
22
  'shape',
23
23
  'sticky',
24
+ 'section',
24
25
  'arrow',
25
26
  'text',
26
27
  'eraser',
@@ -33,6 +34,7 @@ describe('use-tool-mode / static', () => {
33
34
  'I',
34
35
  'R',
35
36
  'N',
37
+ '⇧S',
36
38
  'A',
37
39
  'T',
38
40
  'E',
@@ -55,6 +57,7 @@ describe('use-tool-mode / static', () => {
55
57
  'highlighter',
56
58
  'shape',
57
59
  'sticky',
60
+ 'section',
58
61
  'arrow',
59
62
  'text',
60
63
  'eraser',
@@ -20,7 +20,7 @@ import {
20
20
  SHAPE_KIND_ICONS,
21
21
  TOOL_ICONS,
22
22
  } from './canvas-icons.tsx';
23
- import { useAnnotationsVisibility } from './use-annotations-visibility.tsx';
23
+ import { useChromeVisibility } from './use-chrome-visibility.tsx';
24
24
  import { type ShapeKind, useToolMode } from './use-tool-mode.tsx';
25
25
 
26
26
  // ─────────────────────────────────────────────────────────────────────────────
@@ -227,8 +227,18 @@ function ensurePaletteStyles(): void {
227
227
 
228
228
  const NAV_TOOLS = ['move', 'hand', 'comment'] as const;
229
229
  // Phase 24 — the two rect/ellipse buttons collapse into one Shape tool (with a
230
- // kind popover); sticky/arrow/text/eraser keep their order.
231
- const DRAW_TOOLS = ['pen', 'highlighter', 'shape', 'sticky', 'arrow', 'text', 'eraser'] as const;
230
+ // kind popover); sticky/arrow/text/eraser keep their order. Wave H — section
231
+ // joins the row (it was ⇧S-only before; users couldn't discover it).
232
+ const DRAW_TOOLS = [
233
+ 'pen',
234
+ 'highlighter',
235
+ 'shape',
236
+ 'sticky',
237
+ 'section',
238
+ 'arrow',
239
+ 'text',
240
+ 'eraser',
241
+ ] as const;
232
242
 
233
243
  // Phase 24 — the Shape tool's primitive picker (popover order matches FigJam).
234
244
  const SHAPE_KINDS: ReadonlyArray<{ kind: ShapeKind; label: string }> = [
@@ -246,7 +256,7 @@ const SHAPE_KINDS: ReadonlyArray<{ kind: ShapeKind; label: string }> = [
246
256
  export function ToolPalette() {
247
257
  ensurePaletteStyles();
248
258
  const { tool, setTool, tools, sticky, toggleSticky, shapeKind, setShapeKind } = useToolMode();
249
- const visibilityCtx = useAnnotationsVisibility();
259
+ const chrome = useChromeVisibility();
250
260
  const [mounted, setMounted] = useState(false);
251
261
  const [shapeOpen, setShapeOpen] = useState(false);
252
262
  const containerRef = useRef<HTMLDivElement | null>(null);
@@ -277,11 +287,12 @@ export function ToolPalette() {
277
287
  }, [tool]);
278
288
 
279
289
  if (!mounted) return null;
290
+ // Presentation Mode hides the whole tool palette (clean artboards-only view).
291
+ if (chrome?.present) return null;
280
292
 
281
293
  const byId = new Map(tools.map((t) => [t.id, t]));
282
294
  const navList = NAV_TOOLS.map((id) => byId.get(id)).filter(Boolean);
283
295
  const drawList = DRAW_TOOLS.map((id) => byId.get(id)).filter(Boolean);
284
- const annotationsHidden = visibilityCtx ? !visibilityCtx.visible : false;
285
296
 
286
297
  const renderToolButton = (id: string, label: string, shortcut: string) => {
287
298
  const Icon = TOOL_ICONS[id];
@@ -402,12 +413,20 @@ export function ToolPalette() {
402
413
  </button>
403
414
  <button
404
415
  type="button"
405
- aria-label={
406
- annotationsHidden ? 'Show annotations (Shift+P)' : 'Hide annotations (Shift+P)'
407
- }
408
- aria-pressed={annotationsHidden}
409
- title="Presentation (Shift+P)"
410
- onClick={() => visibilityCtx?.setVisible(!visibilityCtx.visible)}
416
+ aria-label="Presentation mode — hide all chrome"
417
+ title="Presentation mode hide all chrome (Esc to exit)"
418
+ onClick={() => {
419
+ // Present Mode is a SHELL-level state (it hides the menubar /
420
+ // sidebar / panels too), so the canvas iframe requests it from the
421
+ // parent shell, which flips on `.is-present` + broadcasts
422
+ // dgn:'view-chrome' back down. Enter-only — the palette is hidden
423
+ // while presenting; exit is Esc or the floating pill.
424
+ try {
425
+ window.parent.postMessage({ dgn: 'present-enter' }, '*');
426
+ } catch {
427
+ /* detached / cross-origin */
428
+ }
429
+ }}
411
430
  >
412
431
  <IconPresentation />
413
432
  </button>
@@ -82,7 +82,6 @@ export function UndoHud() {
82
82
  return (
83
83
  <div
84
84
  className="dc-undo-hud"
85
- // biome-ignore lint/a11y/useSemanticElements: <output> is form-scoped; this HUD is a global status overlay outside any form
86
85
  data-visible={visible ? 'true' : 'false'}
87
86
  role="status"
88
87
  aria-live="polite"
@@ -23,7 +23,7 @@
23
23
 
24
24
  import { createContext, type ReactNode, useContext, useEffect, useMemo, useState } from 'react';
25
25
 
26
- import { colorForName } from './use-collab.tsx';
26
+ import { AGENT_COLOR } from './use-collab.tsx';
27
27
 
28
28
  /** Wire shape of an `ai-activity` entry (matches collab/ai-activity.ts). */
29
29
  export interface AiEntry {
@@ -134,7 +134,9 @@ export function deriveAgent(entry: AiEntry): AgentPresence {
134
134
  const author = sanitizeAuthor(entry.author);
135
135
  const id = `${author}:${entry.startedAt}`;
136
136
  const name = agentFunnyName(id);
137
- return { id, name, color: colorForName(name), author, startedAt: entry.startedAt };
137
+ // DS colors-presence contract: the agent rides --presence-agent, a hue no
138
+ // human peer can hash to — attribution stays unambiguous on a shared canvas.
139
+ return { id, name, color: AGENT_COLOR, author, startedAt: entry.startedAt };
138
140
  }
139
141
 
140
142
  // ---------------------------------------------------------------------------