@1agh/maude 0.28.0 → 0.28.1

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 (131) hide show
  1. package/cli/commands/design.mjs +69 -3
  2. package/cli/commands/design.test.mjs +97 -1
  3. package/cli/lib/cache.mjs +1 -1
  4. package/cli/lib/config-lint.mjs +1 -1
  5. package/cli/lib/copy-tree.mjs +1 -1
  6. package/cli/lib/design-link.mjs +1 -1
  7. package/cli/lib/flow-design-integration.test.mjs +1 -1
  8. package/cli/lib/gitignore-block.test.mjs +2 -2
  9. package/cli/lib/stack-detect.mjs +1 -1
  10. package/package.json +9 -9
  11. package/plugins/design/dev-server/annotations-context-toolbar.tsx +1 -1
  12. package/plugins/design/dev-server/annotations-layer.tsx +3 -3
  13. package/plugins/design/dev-server/api.ts +1 -1
  14. package/plugins/design/dev-server/bin/scenario-report.mjs +1 -1
  15. package/plugins/design/dev-server/bin/server-up.sh +102 -9
  16. package/plugins/design/dev-server/bin/visual-sanity.sh +19 -3
  17. package/plugins/design/dev-server/canvas-comment-mount.tsx +1 -1
  18. package/plugins/design/dev-server/canvas-cursors.ts +1 -1
  19. package/plugins/design/dev-server/canvas-lib.tsx +10 -21
  20. package/plugins/design/dev-server/canvas-shell.tsx +1 -1
  21. package/plugins/design/dev-server/collab/awareness-bridge.ts +1 -1
  22. package/plugins/design/dev-server/collab/index.ts +4 -4
  23. package/plugins/design/dev-server/collab/persistence.ts +1 -1
  24. package/plugins/design/dev-server/context-menu.tsx +1 -1
  25. package/plugins/design/dev-server/dist/client.bundle.js +4 -4
  26. package/plugins/design/dev-server/dist/comment-mount.js +5 -5
  27. package/plugins/design/dev-server/dist/runtime/lib0_decoding.js +1 -620
  28. package/plugins/design/dev-server/dist/runtime/lib0_encoding.js +1 -604
  29. package/plugins/design/dev-server/dist/runtime/motion.js +4 -4944
  30. package/plugins/design/dev-server/dist/runtime/motion_react.js +10 -10054
  31. package/plugins/design/dev-server/dist/runtime/pixi-js.js +2775 -52482
  32. package/plugins/design/dev-server/dist/runtime/react-dom.js +1 -231
  33. package/plugins/design/dev-server/dist/runtime/react-dom_client.js +9 -10357
  34. package/plugins/design/dev-server/dist/runtime/react.js +1 -535
  35. package/plugins/design/dev-server/dist/runtime/react_jsx-dev-runtime.js +1 -60
  36. package/plugins/design/dev-server/dist/runtime/react_jsx-runtime.js +1 -85
  37. package/plugins/design/dev-server/dist/runtime/y-protocols_awareness.js +1 -376
  38. package/plugins/design/dev-server/dist/runtime/y-protocols_sync.js +1 -100
  39. package/plugins/design/dev-server/dist/runtime/yjs.js +5 -6687
  40. package/plugins/design/dev-server/draw/brush.ts +3 -3
  41. package/plugins/design/dev-server/draw/index.ts +5 -5
  42. package/plugins/design/dev-server/draw/layout.ts +1 -1
  43. package/plugins/design/dev-server/draw/test/geometry.test.ts +1 -1
  44. package/plugins/design/dev-server/draw/test/layout.test.ts +1 -1
  45. package/plugins/design/dev-server/draw/test/primitives.test.ts +1 -1
  46. package/plugins/design/dev-server/draw/test/serialize.test.ts +1 -1
  47. package/plugins/design/dev-server/equal-spacing-handles.tsx +1 -1
  48. package/plugins/design/dev-server/examples/perf-100-artboards.tsx +1 -2
  49. package/plugins/design/dev-server/export-dialog.tsx +1 -1
  50. package/plugins/design/dev-server/exporters/html.ts +1 -1
  51. package/plugins/design/dev-server/exporters/index.ts +2 -2
  52. package/plugins/design/dev-server/exporters/pdf.ts +1 -1
  53. package/plugins/design/dev-server/exporters/png.ts +1 -1
  54. package/plugins/design/dev-server/exporters/pptx.ts +1 -1
  55. package/plugins/design/dev-server/exporters/svg.ts +1 -1
  56. package/plugins/design/dev-server/http.ts +1 -1
  57. package/plugins/design/dev-server/marquee-overlay.tsx +1 -1
  58. package/plugins/design/dev-server/server.ts +1 -1
  59. package/plugins/design/dev-server/sync/agent.ts +1 -1
  60. package/plugins/design/dev-server/sync/index.ts +5 -5
  61. package/plugins/design/dev-server/sync/materialize.ts +2 -2
  62. package/plugins/design/dev-server/sync/migrate-seed.ts +1 -1
  63. package/plugins/design/dev-server/sync/projection.ts +3 -3
  64. package/plugins/design/dev-server/test/ai-activity.test.ts +1 -1
  65. package/plugins/design/dev-server/test/annotations-api.test.ts +1 -2
  66. package/plugins/design/dev-server/test/annotations-draw-modifiers.test.ts +2 -2
  67. package/plugins/design/dev-server/test/annotations-layer.test.ts +6 -6
  68. package/plugins/design/dev-server/test/annotations-roundtrip.test.ts +1 -1
  69. package/plugins/design/dev-server/test/boot-self-heal.test.ts +1 -1
  70. package/plugins/design/dev-server/test/canvas-cursors.test.ts +1 -1
  71. package/plugins/design/dev-server/test/canvas-edit.test.ts +1 -1
  72. package/plugins/design/dev-server/test/canvas-header.test.ts +1 -1
  73. package/plugins/design/dev-server/test/canvas-hmr-runtime.test.tsx +1 -1
  74. package/plugins/design/dev-server/test/canvas-lib-inline.test.ts +1 -1
  75. package/plugins/design/dev-server/test/canvas-lib-resolver.test.ts +1 -2
  76. package/plugins/design/dev-server/test/canvas-meta-api.test.ts +1 -2
  77. package/plugins/design/dev-server/test/canvas-origin-gate.test.ts +1 -2
  78. package/plugins/design/dev-server/test/collab-annotations-bridge.test.ts +1 -1
  79. package/plugins/design/dev-server/test/collab-bridge.test.ts +1 -1
  80. package/plugins/design/dev-server/test/collab-protocol.test.ts +2 -2
  81. package/plugins/design/dev-server/test/collab-room.test.ts +1 -1
  82. package/plugins/design/dev-server/test/collab-stress.test.ts +1 -1
  83. package/plugins/design/dev-server/test/comments-api.test.ts +1 -2
  84. package/plugins/design/dev-server/test/compile-entry.test.ts +1 -2
  85. package/plugins/design/dev-server/test/exporters/canva.test.ts +1 -2
  86. package/plugins/design/dev-server/test/exporters/history.test.ts +1 -2
  87. package/plugins/design/dev-server/test/exporters/pw-launch.test.ts +1 -1
  88. package/plugins/design/dev-server/test/exporters/scope.test.ts +1 -2
  89. package/plugins/design/dev-server/test/exporters/zip.test.ts +1 -2
  90. package/plugins/design/dev-server/test/git-lifecycle.test.ts +1 -2
  91. package/plugins/design/dev-server/test/handoff-static-frames.test.ts +1 -1
  92. package/plugins/design/dev-server/test/handoff.test.ts +1 -1
  93. package/plugins/design/dev-server/test/hmr-broadcast.test.ts +1 -1
  94. package/plugins/design/dev-server/test/input-router.test.ts +2 -2
  95. package/plugins/design/dev-server/test/locator.test.ts +1 -1
  96. package/plugins/design/dev-server/test/runtime-bundle.test.ts +1 -1
  97. package/plugins/design/dev-server/test/shared-doc-convergence.test.ts +1 -1
  98. package/plugins/design/dev-server/test/shared-doc-migrate.test.ts +2 -3
  99. package/plugins/design/dev-server/test/shared-doc-projection.test.ts +1 -1
  100. package/plugins/design/dev-server/test/snap-distance-pill.test.ts +1 -1
  101. package/plugins/design/dev-server/test/sync-agent.test.ts +2 -3
  102. package/plugins/design/dev-server/test/sync-atomic-write.test.ts +2 -3
  103. package/plugins/design/dev-server/test/sync-codec.test.ts +1 -1
  104. package/plugins/design/dev-server/test/sync-connection-state.test.ts +1 -1
  105. package/plugins/design/dev-server/test/sync-echo-guard.test.ts +1 -1
  106. package/plugins/design/dev-server/test/sync-fs-mirror.test.ts +1 -2
  107. package/plugins/design/dev-server/test/sync-hardening.test.ts +4 -5
  108. package/plugins/design/dev-server/test/sync-hubs-config.test.ts +1 -2
  109. package/plugins/design/dev-server/test/sync-meta-codec.test.ts +1 -1
  110. package/plugins/design/dev-server/test/sync-runtime.test.ts +3 -8
  111. package/plugins/design/dev-server/test/sync-status.test.ts +1 -1
  112. package/plugins/design/dev-server/test/sync-untrusted.test.ts +1 -2
  113. package/plugins/design/dev-server/test/undo-stack.test.ts +2 -2
  114. package/plugins/design/dev-server/test/use-agent-presence.test.tsx +4 -1
  115. package/plugins/design/dev-server/test/use-artboard-drag.test.ts +3 -3
  116. package/plugins/design/dev-server/test/use-canvas-activity.test.tsx +2 -2
  117. package/plugins/design/dev-server/test/use-selection-set.test.tsx +1 -1
  118. package/plugins/design/dev-server/test/use-snap-guides.test.ts +1 -1
  119. package/plugins/design/dev-server/test/use-undo-stack.test.tsx +2 -2
  120. package/plugins/design/dev-server/use-agent-presence.tsx +1 -1
  121. package/plugins/design/dev-server/use-annotation-resize.tsx +1 -5
  122. package/plugins/design/dev-server/use-annotation-selection.tsx +2 -6
  123. package/plugins/design/dev-server/use-annotations-visibility.tsx +1 -1
  124. package/plugins/design/dev-server/use-artboard-drag.tsx +1 -1
  125. package/plugins/design/dev-server/use-canvas-activity.tsx +1 -1
  126. package/plugins/design/dev-server/use-collab.tsx +3 -4
  127. package/plugins/design/dev-server/use-selection-set.tsx +1 -1
  128. package/plugins/design/dev-server/use-tool-mode.tsx +1 -1
  129. package/plugins/design/dev-server/use-undo-stack.tsx +4 -5
  130. package/plugins/design/templates/_shell.html +3 -3
  131. package/plugins/design/templates/design-system-inspiration/SUB-AGENT-PROMPTS.md +18 -3
@@ -23,15 +23,15 @@
23
23
 
24
24
  import type { Rect } from './geometry.ts';
25
25
  import {
26
- path,
26
+ circle,
27
27
  type DrawPrimitive,
28
28
  type DrawStyle,
29
- type Point,
30
- circle,
31
29
  fe,
32
30
  filter,
33
31
  group,
34
32
  line,
33
+ type Point,
34
+ path,
35
35
  } from './primitives.ts';
36
36
 
37
37
  function fmt(n: number): string {
@@ -18,11 +18,11 @@
18
18
  * React-free (DDR-067) — nothing here imports react / a `.tsx`.
19
19
  */
20
20
 
21
- export * from './primitives.ts';
22
- export * from './geometry.ts';
23
- export * from './palette.ts';
24
- export * from './composition.ts';
25
21
  export * from './brush.ts';
22
+ export * from './composition.ts';
23
+ export * from './geometry.ts';
26
24
  export * from './layout.ts';
27
- export * from './serialize.ts';
28
25
  export * from './optimize.ts';
26
+ export * from './palette.ts';
27
+ export * from './primitives.ts';
28
+ export * from './serialize.ts';
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { type Rect, routeConnector } from './geometry.ts';
18
- import { type DrawPrimitive, type Point, group, polyline, rect, snap, text } from './primitives.ts';
18
+ import { type DrawPrimitive, group, type Point, polyline, rect, snap, text } from './primitives.ts';
19
19
 
20
20
  // ─────────────────────────────────────────────────────────────────────────────
21
21
  // Grid + modular scale
@@ -1,11 +1,11 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import {
3
- EQUAL_AREA_CIRCLE_SCALE,
4
3
  blobPath,
5
4
  centroid,
6
5
  centroidCenter,
7
6
  chamferCorners,
8
7
  convexHull,
8
+ EQUAL_AREA_CIRCLE_SCALE,
9
9
  equalWeightCircleDiameter,
10
10
  overshoot,
11
11
  pchipEval,
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import type { Rect } from '../geometry.ts';
3
- import { type LabelItem, diagram, modularScale, placeLabels, snapToGrid } from '../layout.ts';
3
+ import { diagram, type LabelItem, modularScale, placeLabels, snapToGrid } from '../layout.ts';
4
4
  import type { Point } from '../primitives.ts';
5
5
 
6
6
  describe('grid + modular scale', () => {
@@ -1,6 +1,5 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
  import {
3
- VIEWBOX,
4
3
  boxViewBox,
5
4
  circle,
6
5
  group,
@@ -13,6 +12,7 @@ import {
13
12
  text,
14
13
  transformString,
15
14
  use,
15
+ VIEWBOX,
16
16
  } from '../primitives.ts';
17
17
 
18
18
  describe('snap', () => {
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
- import { path, circle, group, line, rect, text } from '../primitives.ts';
3
2
  import type { DrawPrimitive } from '../primitives.ts';
3
+ import { circle, group, line, path, rect, text } from '../primitives.ts';
4
4
  import { primitivesToNodes, toJsx, toSvg } from '../serialize.ts';
5
5
 
6
6
  const SAMPLE: DrawPrimitive[] = [
@@ -15,9 +15,9 @@
15
15
  import { useEffect, useRef, useState } from 'react';
16
16
 
17
17
  import {
18
+ detectEqualSpacing,
18
19
  type EqualSpacingResult,
19
20
  type SpacingAxis,
20
- detectEqualSpacing,
21
21
  } from './equal-spacing-detector.ts';
22
22
  import { useSelectionSet } from './use-selection-set.tsx';
23
23
 
@@ -20,9 +20,8 @@
20
20
  * Results land in .ai/decisions/DDR-024 + .ai/logs/phase-4-perf-<date>.md.
21
21
  */
22
22
 
23
- import { useEffect } from 'react';
24
-
25
23
  import { DCArtboard, DCSection, DesignCanvas } from '@maude/canvas-lib';
24
+ import { useEffect } from 'react';
26
25
 
27
26
  const ARTBOARD_COUNT = 100;
28
27
  const NODES_PER_ARTBOARD = 30;
@@ -14,8 +14,8 @@
14
14
  */
15
15
 
16
16
  import {
17
- type ReactNode,
18
17
  createContext,
18
+ type ReactNode,
19
19
  useCallback,
20
20
  useContext,
21
21
  useEffect,
@@ -13,10 +13,10 @@ import path from 'node:path';
13
13
  import JSZip from 'jszip';
14
14
 
15
15
  import {
16
+ canvasShellUrl,
16
17
  type ExportContext,
17
18
  type ExportOptions,
18
19
  type ExportResult,
19
- canvasShellUrl,
20
20
  } from './index.ts';
21
21
  import type { Target } from './scope.ts';
22
22
 
@@ -13,7 +13,7 @@ import * as html from './html.ts';
13
13
  import * as pdf from './pdf.ts';
14
14
  import * as png from './png.ts';
15
15
  import * as pptx from './pptx.ts';
16
- import { type ResolveScopeArgs, type Scope, type Target, resolveScope } from './scope.ts';
16
+ import { type ResolveScopeArgs, resolveScope, type Scope, type Target } from './scope.ts';
17
17
  import * as svg from './svg.ts';
18
18
  import * as zip from './zip.ts';
19
19
 
@@ -100,8 +100,8 @@ export async function runExport(args: {
100
100
  return adapter.run(targets, args.options, args.ctx);
101
101
  }
102
102
 
103
- export { resolveScope };
104
103
  export type { Scope, Target };
104
+ export { resolveScope };
105
105
 
106
106
  /**
107
107
  * Build the `_canvas-shell.html?canvas=…&tokens=…&components=…` URL the
@@ -15,10 +15,10 @@ import path from 'node:path';
15
15
  import { PDFDocument } from 'pdf-lib';
16
16
 
17
17
  import {
18
+ canvasShellUrl,
18
19
  type ExportContext,
19
20
  type ExportOptions,
20
21
  type ExportResult,
21
- canvasShellUrl,
22
22
  } from './index.ts';
23
23
  import type { Target } from './scope.ts';
24
24
 
@@ -14,10 +14,10 @@ import path from 'node:path';
14
14
  import JSZip from 'jszip';
15
15
 
16
16
  import {
17
+ canvasShellUrl,
17
18
  type ExportContext,
18
19
  type ExportOptions,
19
20
  type ExportResult,
20
- canvasShellUrl,
21
21
  } from './index.ts';
22
22
  import type { Target } from './scope.ts';
23
23
 
@@ -28,10 +28,10 @@ import PptxGenJS from 'pptxgenjs';
28
28
 
29
29
  import { getBrowserBundle } from './_browser-bundles.ts';
30
30
  import {
31
+ canvasShellUrl,
31
32
  type ExportContext,
32
33
  type ExportOptions,
33
34
  type ExportResult,
34
- canvasShellUrl,
35
35
  } from './index.ts';
36
36
  import type { Target } from './scope.ts';
37
37
 
@@ -14,10 +14,10 @@ import JSZip from 'jszip';
14
14
 
15
15
  import { getBrowserBundle } from './_browser-bundles.ts';
16
16
  import {
17
+ canvasShellUrl,
17
18
  type ExportContext,
18
19
  type ExportOptions,
19
20
  type ExportResult,
20
- canvasShellUrl,
21
21
  } from './index.ts';
22
22
  import type { Target } from './scope.ts';
23
23
 
@@ -19,7 +19,7 @@ import type { ActiveJsonShape } from './exporters/scope.ts';
19
19
  import type { Inspect } from './inspect.ts';
20
20
  import { canvasSlug, writeLocator } from './locator.ts';
21
21
  import { DEV_SERVER_ROOT } from './paths.ts';
22
- import { RUNTIME_PACKAGES, getRuntimeBundle, packageForSlug, slugFor } from './runtime-bundle.ts';
22
+ import { getRuntimeBundle, packageForSlug, RUNTIME_PACKAGES, slugFor } from './runtime-bundle.ts';
23
23
 
24
24
  // Real disk install root — never the virtual `/$bunfs/root` of compiled bins.
25
25
  // See paths.ts for the resolution logic + Phase 19.1 / v0.18.1 rationale.
@@ -277,6 +277,6 @@ export function applyMarqueeMode(
277
277
  selSet.replace(next);
278
278
  }
279
279
 
280
+ export type { Mode };
280
281
  // Re-export for tests.
281
282
  export { modeOf };
282
- export type { Mode };
@@ -28,7 +28,7 @@ import { createHttp } from './http.ts';
28
28
  import { createInspect } from './inspect.ts';
29
29
  import { startHeapWatch } from './mem.ts';
30
30
  import { createSyncRuntime } from './sync/index.ts';
31
- import { type WsData, createWs, isLoopbackHost, parseCollabSlug } from './ws.ts';
31
+ import { createWs, isLoopbackHost, parseCollabSlug, type WsData } from './ws.ts';
32
32
 
33
33
  // Phase 19 / DDR-044 — covers the marketplace-cache-install gap where
34
34
  // node_modules/ ships empty (git clone honors .gitignore). Auto-installs +
@@ -33,7 +33,6 @@ import type * as Y from 'yjs';
33
33
 
34
34
  import { atomicWrite } from './atomic-write.ts';
35
35
  import {
36
- Y_SYNC_TYPES,
37
36
  annotationsFromDoc,
38
37
  applyAnnotationsToDoc,
39
38
  applyCommentsToDoc,
@@ -45,6 +44,7 @@ import {
45
44
  htmlFromDoc,
46
45
  mergeSharedMetaIntoLocal,
47
46
  metaFromDoc,
47
+ Y_SYNC_TYPES,
48
48
  } from './codec.ts';
49
49
  import { type EchoGuard, hashBytes } from './echo-guard.ts';
50
50
 
@@ -29,15 +29,15 @@ import type { Context } from '../context.ts';
29
29
  import { type CanvasSyncAgent, createCanvasSyncAgent } from './agent.ts';
30
30
  import {
31
31
  type ConnectionMonitor,
32
- type ProviderStatus,
33
32
  createConnectionMonitor,
33
+ type ProviderStatus,
34
34
  } from './connection-state.ts';
35
- import { type EchoGuard, createEchoGuard } from './echo-guard.ts';
36
- import { type FsReader, createFsReader } from './fs-mirror.ts';
35
+ import { createEchoGuard, type EchoGuard } from './echo-guard.ts';
36
+ import { createFsReader, type FsReader } from './fs-mirror.ts';
37
37
  import { getHubToken } from './hubs-config.ts';
38
38
  import { migrateSeed } from './migrate-seed.ts';
39
- import { type DocProjection, createDocProjection } from './projection.ts';
40
- import { type SyncStatusStore, createSyncStatusStore } from './status.ts';
39
+ import { createDocProjection, type DocProjection } from './projection.ts';
40
+ import { createSyncStatusStore, type SyncStatusStore } from './status.ts';
41
41
  import { writeUntrustedMarkers } from './untrusted.ts';
42
42
 
43
43
  /** A minimum-surface stand-in for the HocuspocusProvider's runtime API. */
@@ -21,7 +21,7 @@
21
21
 
22
22
  import type * as Y from 'yjs';
23
23
  import { Y_TYPES } from '../collab/persistence.ts';
24
- import { Y_SYNC_TYPES, annotationsFromDoc, commentsFromDoc } from './codec.ts';
24
+ import { annotationsFromDoc, commentsFromDoc, Y_SYNC_TYPES } from './codec.ts';
25
25
 
26
26
  export interface CanonicalMaterialization {
27
27
  html: string;
@@ -59,4 +59,4 @@ export function materializeCanonical(doc: Y.Doc): string {
59
59
  }
60
60
 
61
61
  // Re-export so a shadow-compare caller has the type names in one import.
62
- export { Y_TYPES, Y_SYNC_TYPES };
62
+ export { Y_SYNC_TYPES, Y_TYPES };
@@ -34,12 +34,12 @@ import type * as Y from 'yjs';
34
34
 
35
35
  import { Y_TYPES } from '../collab/persistence.ts';
36
36
  import {
37
- Y_SYNC_TYPES,
38
37
  applyAnnotationsToDoc,
39
38
  applyCommentsToDoc,
40
39
  applyCssToDoc,
41
40
  applyHtmlToDoc,
42
41
  applyMetaToDoc,
42
+ Y_SYNC_TYPES,
43
43
  } from './codec.ts';
44
44
  import { ORIGINS } from './origins.ts';
45
45
 
@@ -30,9 +30,6 @@ import type * as Y from 'yjs';
30
30
 
31
31
  import { atomicWrite } from './atomic-write.ts';
32
32
  import {
33
- MAX_CSS_BYTES,
34
- MAX_HTML_BYTES,
35
- MAX_META_BYTES,
36
33
  applyAnnotationsToDoc,
37
34
  applyCommentsToDoc,
38
35
  applyCssToDoc,
@@ -40,6 +37,9 @@ import {
40
37
  applyMetaToDoc,
41
38
  cssFromDoc,
42
39
  htmlFromDoc,
40
+ MAX_CSS_BYTES,
41
+ MAX_HTML_BYTES,
42
+ MAX_META_BYTES,
43
43
  mergeSharedMetaIntoLocal,
44
44
  metaFromDoc,
45
45
  } from './codec.ts';
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { describe, expect, test } from 'bun:test';
4
4
 
5
- import { HEARTBEAT_GRACE_MS, createAiActivity } from '../collab/ai-activity.ts';
5
+ import { createAiActivity, HEARTBEAT_GRACE_MS } from '../collab/ai-activity.ts';
6
6
  import { type Context, createBus } from '../context.ts';
7
7
 
8
8
  function makeCtx(): { ctx: Context; events: { file: string; entry: unknown }[] } {
@@ -8,11 +8,10 @@
8
8
  // - PUT rejects oversized bodies (>1 MB)
9
9
  // - Unknown method → 405
10
10
 
11
+ import { describe, expect, test } from 'bun:test';
11
12
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
12
13
  import { join } from 'node:path';
13
14
 
14
- import { describe, expect, test } from 'bun:test';
15
-
16
15
  import { bootServer, killProc, makeSandbox, nextPort } from './_helpers.ts';
17
16
 
18
17
  const SVG_OK =
@@ -6,13 +6,13 @@ import { describe, expect, test } from 'bun:test';
6
6
 
7
7
  import {
8
8
  type ArrowStroke,
9
+ applyDrawModifiers,
10
+ constrainDrawBox,
9
11
  type EllipseStroke,
10
12
  type PenStroke,
11
13
  type PolygonStroke,
12
14
  type RectStroke,
13
15
  type StickyStroke,
14
- applyDrawModifiers,
15
- constrainDrawBox,
16
16
  } from '../annotations-layer.tsx';
17
17
 
18
18
  const NONE = { shift: false, alt: false };
@@ -11,23 +11,23 @@ import { describe, expect, test } from 'bun:test';
11
11
 
12
12
  import {
13
13
  type ArrowStroke,
14
+ arrowHeadPoints,
14
15
  type EllipseStroke,
15
16
  type PenStroke,
16
17
  type PolygonStroke,
17
- type RectStroke,
18
- STICKY_PALETTE,
19
- type StickyStroke,
20
- type Stroke,
21
- type TextStroke,
22
- arrowHeadPoints,
23
18
  penPathD,
24
19
  polygonPoints,
25
20
  polygonVertices,
21
+ type RectStroke,
26
22
  rid,
23
+ STICKY_PALETTE,
24
+ type StickyStroke,
25
+ type Stroke,
27
26
  strokeBBox,
28
27
  strokeHitTest,
29
28
  strokesShallowEqual,
30
29
  strokesToSvg,
30
+ type TextStroke,
31
31
  } from '../annotations-layer.tsx';
32
32
 
33
33
  describe('annotations-layer / penPathD', () => {
@@ -17,9 +17,9 @@ import {
17
17
  type RectStroke,
18
18
  type StickyStroke,
19
19
  type Stroke,
20
- type TextStroke,
21
20
  strokesToSvg,
22
21
  svgToStrokes,
22
+ type TextStroke,
23
23
  } from '../annotations-layer.tsx';
24
24
  import { sanitizeAnnotationSvg } from '../api.ts';
25
25
 
@@ -9,7 +9,7 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
9
9
  import { tmpdir } from 'node:os';
10
10
  import { join } from 'node:path';
11
11
 
12
- import { type SelfHealOptions, bootSelfHeal } from '../boot-self-heal.ts';
12
+ import { bootSelfHeal, type SelfHealOptions } from '../boot-self-heal.ts';
13
13
 
14
14
  let TMP: string;
15
15
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { describe, expect, test } from 'bun:test';
6
6
 
7
- import { TOOL_CURSORS, resolveToolCursor } from '../canvas-cursors.ts';
7
+ import { resolveToolCursor, TOOL_CURSORS } from '../canvas-cursors.ts';
8
8
 
9
9
  const ALL_TOOLS = [
10
10
  'move',
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { describe, expect, test } from 'bun:test';
7
7
 
8
- import { CanvasEditError, applyEdit, editAttribute } from '../canvas-edit.ts';
8
+ import { applyEdit, CanvasEditError, editAttribute } from '../canvas-edit.ts';
9
9
  import { transpileCanvasSource } from '../canvas-pipeline.ts';
10
10
 
11
11
  const CANVAS = '/abs/Canvas.tsx';
@@ -7,10 +7,10 @@ import { tmpdir } from 'node:os';
7
7
  import path from 'node:path';
8
8
 
9
9
  import {
10
- type MetaSidecar,
11
10
  applyHeader,
12
11
  applyHeaderToSource,
13
12
  buildHeader,
13
+ type MetaSidecar,
14
14
  } from '../canvas-header.ts';
15
15
 
16
16
  const META: MetaSidecar = {
@@ -18,7 +18,7 @@ afterAll(() => {
18
18
  });
19
19
 
20
20
  import { act, createElement } from 'react';
21
- import { type Root, createRoot } from 'react-dom/client';
21
+ import { createRoot, type Root } from 'react-dom/client';
22
22
 
23
23
  import { CanvasErrorBoundary } from '../canvas-comment-mount.tsx';
24
24
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { describe, expect, test } from 'bun:test';
5
5
 
6
- import { type LibMap, buildLibMap, inlineUsedExports } from '../canvas-lib-inline.ts';
6
+ import { buildLibMap, inlineUsedExports, type LibMap } from '../canvas-lib-inline.ts';
7
7
 
8
8
  const LIB_PATH = '/virtual/_lib/canvas-lib.tsx';
9
9
 
@@ -2,12 +2,11 @@
2
2
  // bundled canvas-lib (Phase 3.6.1 Task 2; relocated to dev-server in Phase
3
3
  // 4.0.5 per DDR-025).
4
4
 
5
+ import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
5
6
  import { existsSync } from 'node:fs';
6
7
  import { mkdir, rm, writeFile } from 'node:fs/promises';
7
8
  import path from 'node:path';
8
9
 
9
- import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
10
-
11
10
  import { buildCanvasModule } from '../canvas-build.ts';
12
11
  import {
13
12
  CANVAS_LIB_SPECIFIER,
@@ -8,11 +8,10 @@
8
8
  // - GET returns the merged meta
9
9
  // - Paths that escape repoRoot are 400
10
10
 
11
+ import { describe, expect, test } from 'bun:test';
11
12
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
12
13
  import { join } from 'node:path';
13
14
 
14
- import { describe, expect, test } from 'bun:test';
15
-
16
15
  import { bootServer, killProc, makeSandbox, nextPort } from './_helpers.ts';
17
16
 
18
17
  interface MetaShape {
@@ -5,11 +5,10 @@
5
5
  // designRoot assets + the shell still serve; (4) the shell carries the hardened
6
6
  // CSP. See .ai/logs/security-reviews/phase-9.1-t2-f1-cross-origin-reaudit.md.
7
7
 
8
+ import { describe, expect, test } from 'bun:test';
8
9
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
9
10
  import { join } from 'node:path';
10
11
 
11
- import { describe, expect, test } from 'bun:test';
12
-
13
12
  import { bootServer, killProc, makeSandbox, nextPort } from './_helpers.ts';
14
13
 
15
14
  async function readCanvasOrigin(designRoot: string): Promise<string> {
@@ -45,7 +45,7 @@ describe('Registry.syncRoomFromAnnotations', () => {
45
45
  test('inspector-write origin propagates through doc.update', () => {
46
46
  const r = createRegistry(noopCallbacks());
47
47
  const room = r.get('echo-slug');
48
- let lastOrigin: unknown = undefined;
48
+ let lastOrigin: unknown;
49
49
  room.doc.on('update', (_update, origin) => {
50
50
  lastOrigin = origin;
51
51
  });
@@ -71,7 +71,7 @@ describe('Registry inspector-bridge', () => {
71
71
  test('inspector-write origin triggers doc.update broadcast', async () => {
72
72
  const r = createRegistry(noopCallbacks());
73
73
  const room = r.get('echo-slug');
74
- let lastOrigin: unknown = undefined;
74
+ let lastOrigin: unknown;
75
75
  room.doc.on('update', (_update, origin) => {
76
76
  lastOrigin = origin;
77
77
  });
@@ -8,12 +8,12 @@ import { Awareness } from 'y-protocols/awareness';
8
8
  import * as Y from 'yjs';
9
9
 
10
10
  import {
11
- MESSAGE_AWARENESS,
12
- MESSAGE_SYNC,
13
11
  encodeAwarenessFrame,
14
12
  encodeHandshake,
15
13
  encodeSyncUpdate,
16
14
  handleMessage,
15
+ MESSAGE_AWARENESS,
16
+ MESSAGE_SYNC,
17
17
  } from '../collab/protocol.ts';
18
18
 
19
19
  function readType(frame: Uint8Array): number {
@@ -12,7 +12,7 @@ import {
12
12
  encodeSyncUpdate,
13
13
  handleMessage,
14
14
  } from '../collab/protocol.ts';
15
- import { type RoomCallbacks, type RoomConn, createRoom } from '../collab/room.ts';
15
+ import { createRoom, type RoomCallbacks, type RoomConn } from '../collab/room.ts';
16
16
 
17
17
  function makeConn(id: string): RoomConn & { recv: Uint8Array[] } {
18
18
  const recv: Uint8Array[] = [];
@@ -19,7 +19,7 @@ import { afterEach, describe, expect, test } from 'bun:test';
19
19
  import { Awareness } from 'y-protocols/awareness';
20
20
  import * as Y from 'yjs';
21
21
 
22
- import { type RoomConn, createRoom } from '../collab/room.ts';
22
+ import { createRoom, type RoomConn } from '../collab/room.ts';
23
23
 
24
24
  const STRESS_MS = Number(process.env.MAUDE_STRESS_MS ?? 10_000);
25
25
  const RSS_GROWTH_LIMIT_MB = 20;
@@ -11,11 +11,10 @@
11
11
  // git sandbox; gracefully empty if git fails)
12
12
  // - Reply on unknown id → 404
13
13
 
14
+ import { describe, expect, test } from 'bun:test';
14
15
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
15
16
  import { join } from 'node:path';
16
17
 
17
- import { describe, expect, test } from 'bun:test';
18
-
19
18
  import { bootServer, killProc, makeSandbox, nextPort } from './_helpers.ts';
20
19
 
21
20
  async function initGit(root: string) {
@@ -4,12 +4,11 @@
4
4
  // no spawn): given a target, it writes two files (`init-oxc-<slug>.ts` +
5
5
  // `server-<slug>.ts`) under dist/.compile-entries/ and returns the entry path.
6
6
 
7
+ import { describe, expect, test } from 'bun:test';
7
8
  import { existsSync, readFileSync, rmSync } from 'node:fs';
8
9
  import { dirname, join } from 'node:path';
9
10
  import { fileURLToPath } from 'node:url';
10
11
 
11
- import { describe, expect, test } from 'bun:test';
12
-
13
12
  import { writeCompileEntry } from '../build.ts';
14
13
 
15
14
  const ROOT = dirname(fileURLToPath(import.meta.url));
@@ -4,9 +4,8 @@
4
4
  // + the empty/file-tree branches.
5
5
 
6
6
  import { describe, expect, test } from 'bun:test';
7
-
8
- import { buildHandoffMarkdown } from '../../exporters/canva-handoff-prompt.ts';
9
7
  import { run } from '../../exporters/canva.ts';
8
+ import { buildHandoffMarkdown } from '../../exporters/canva-handoff-prompt.ts';
10
9
 
11
10
  const CTX = {
12
11
  designRoot: '/tmp/.design',
@@ -1,10 +1,9 @@
1
1
  // Phase 6.5 T10 — export history persistence + endpoint.
2
2
 
3
+ import { describe, expect, test } from 'bun:test';
3
4
  import { readFileSync } from 'node:fs';
4
5
  import { join } from 'node:path';
5
6
 
6
- import { describe, expect, test } from 'bun:test';
7
-
8
7
  import { bootServer, killProc, makeSandbox, nextPort } from '../_helpers.ts';
9
8
 
10
9
  interface HistoryShape {
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { describe, expect, test } from 'bun:test';
9
9
 
10
- import { INSTALL_HINT, NO_BROWSER_EXIT, isMissingBrowserError } from '../../bin/_pw-launch.mjs';
10
+ import { INSTALL_HINT, isMissingBrowserError, NO_BROWSER_EXIT } from '../../bin/_pw-launch.mjs';
11
11
 
12
12
  describe('_pw-launch — missing-browser classifier', () => {
13
13
  test('matches the real Playwright "Executable doesn\'t exist" message', () => {