@1agh/maude 2.1.0 → 2.1.2

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 (153) hide show
  1. package/apps/studio/access/request.ts +1 -0
  2. package/apps/studio/actions/agents.ts +45 -42
  3. package/apps/studio/actions/defs/app.ts +28 -1
  4. package/apps/studio/actions/defs/sync.ts +4 -0
  5. package/apps/studio/actions/verbs.ts +49 -0
  6. package/apps/studio/actions.manifest.json +162 -20
  7. package/apps/studio/actions.parity.json +13 -1
  8. package/apps/studio/ai/create-claim.ts +1 -1
  9. package/apps/studio/bin/_asset-file.mjs +117 -0
  10. package/apps/studio/bin/_canvas-file.mjs +146 -0
  11. package/apps/studio/bin/_curl-local.mjs +7 -4
  12. package/apps/studio/bin/_footage.mjs +123 -0
  13. package/apps/studio/bin/_pdf-playwright.mjs +14 -0
  14. package/apps/studio/bin/_png-playwright.mjs +15 -1
  15. package/apps/studio/bin/_pw-launch.mjs +98 -0
  16. package/apps/studio/bin/_retry-save.mjs +49 -0
  17. package/apps/studio/bin/_sync.mjs +145 -2
  18. package/apps/studio/bin/asset-rename.sh +12 -0
  19. package/apps/studio/bin/asset-trash.sh +12 -0
  20. package/apps/studio/bin/canvas-move.sh +12 -0
  21. package/apps/studio/bin/canvas-new.sh +12 -0
  22. package/apps/studio/bin/footage.sh +12 -0
  23. package/apps/studio/bin/generate.sh +7 -0
  24. package/apps/studio/bin/retry-save.sh +13 -0
  25. package/apps/studio/bridge/canvas-mode-store.ts +11 -2
  26. package/apps/studio/bridge/dgn-protocol.ts +8 -3
  27. package/apps/studio/bridge/occlusion.ts +45 -0
  28. package/apps/studio/canvas-theme-pill.tsx +169 -26
  29. package/apps/studio/client/app.jsx +16 -4
  30. package/apps/studio/client/export-center.jsx +32 -3
  31. package/apps/studio/client/home/HomeAccountBanner.jsx +61 -0
  32. package/apps/studio/client/home/HomeAccountsChip.jsx +404 -0
  33. package/apps/studio/client/home/HomeConnection.jsx +112 -0
  34. package/apps/studio/client/home/ProjectRows.jsx +514 -0
  35. package/apps/studio/client/home/home-accounts-model.js +234 -76
  36. package/apps/studio/client/home/home-api.js +10 -2
  37. package/apps/studio/client/home/home-app.jsx +151 -394
  38. package/apps/studio/client/home/home-icons.jsx +8 -0
  39. package/apps/studio/client/home/home-model.js +149 -1
  40. package/apps/studio/client/home/home-where-model.js +105 -0
  41. package/apps/studio/client/home/home.css +621 -53
  42. package/apps/studio/client/home/use-account-fix.js +123 -0
  43. package/apps/studio/client/hooks/use-palette-and-panels.jsx +3 -1
  44. package/apps/studio/client/hooks/use-tabs.jsx +11 -4
  45. package/apps/studio/client/panels/TeamProjects.jsx +137 -134
  46. package/apps/studio/client/share-link.js +12 -0
  47. package/apps/studio/client/styles/_index.css +4 -0
  48. package/apps/studio/client/v2/assets/generate-ask.jsx +3 -1
  49. package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
  50. package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
  51. package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
  52. package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
  53. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +94 -3
  54. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +187 -4
  55. package/apps/studio/client/v2/export/done-toast.jsx +2 -5
  56. package/apps/studio/client/v2/export/export-sheet.jsx +9 -2
  57. package/apps/studio/client/v2/export/export.css +9 -0
  58. package/apps/studio/client/v2/export/exports-model.js +16 -3
  59. package/apps/studio/client/v2/export/file-rows.jsx +81 -5
  60. package/apps/studio/client/v2/export/native-save.js +33 -0
  61. package/apps/studio/client/v2/export/sections/print-copy.js +3 -0
  62. package/apps/studio/client/v2/export/sections/print.jsx +37 -20
  63. package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
  64. package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
  65. package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
  66. package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
  67. package/apps/studio/client/v2/link-server/link-server.css +109 -0
  68. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
  69. package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
  70. package/apps/studio/client/v2/search/search-keywords.js +3 -2
  71. package/apps/studio/client/v2/settings/account.jsx +4 -2
  72. package/apps/studio/client/v2/settings/advanced-section.jsx +245 -148
  73. package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
  74. package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
  75. package/apps/studio/client/v2/settings/general-section.jsx +138 -43
  76. package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
  77. package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
  78. package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
  79. package/apps/studio/client/v2/settings/settings-cards.js +220 -0
  80. package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
  81. package/apps/studio/client/v2/settings/settings-model.js +91 -31
  82. package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
  83. package/apps/studio/client/v2/settings/settings.css +374 -64
  84. package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
  85. package/apps/studio/client/v2/settings/this-project-model.js +172 -0
  86. package/apps/studio/client/v2/settings/use-connections.js +3 -2
  87. package/apps/studio/client/v2/settings/use-open-card.js +37 -0
  88. package/apps/studio/client/v2/shell/connection-state.js +197 -0
  89. package/apps/studio/client/v2/shell/menu-runner.js +7 -2
  90. package/apps/studio/client/v2/shell/occlusion-insets.js +37 -9
  91. package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
  92. package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
  93. package/apps/studio/client/v2/shell/project-account-model.js +272 -149
  94. package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
  95. package/apps/studio/client/v2/shell/project-account.css +237 -0
  96. package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
  97. package/apps/studio/client/v2/shell/shell-parity.js +3 -2
  98. package/apps/studio/client/v2/shell/shell-parity.json +40 -26
  99. package/apps/studio/client/v2/shell/use-account.js +2 -0
  100. package/apps/studio/client/v2/shell/use-occluded-insets.js +13 -3
  101. package/apps/studio/client/v2/signin/use-signin.js +1 -1
  102. package/apps/studio/cloud/endpoints.ts +29 -4
  103. package/apps/studio/collab/room.ts +21 -7
  104. package/apps/studio/dist/client.bundle.js +886 -886
  105. package/apps/studio/dist/comment-mount.js +2 -2
  106. package/apps/studio/dist/styles.css +1 -1
  107. package/apps/studio/exporters/ghostscript.ts +78 -1
  108. package/apps/studio/exporters/pdf-fonts.ts +31 -4
  109. package/apps/studio/generation/jobs.ts +6 -0
  110. package/apps/studio/home/accounts.ts +30 -11
  111. package/apps/studio/home/cloud.ts +6 -1
  112. package/apps/studio/home/hub-health.ts +76 -0
  113. package/apps/studio/home/routes.ts +9 -3
  114. package/apps/studio/http.ts +14 -2
  115. package/apps/studio/migrate/hub.ts +8 -1
  116. package/apps/studio/routes/agent.ts +6 -2
  117. package/apps/studio/routes/hub-link-folder.ts +334 -0
  118. package/apps/studio/routes/hub-signin.ts +78 -1
  119. package/apps/studio/routes/index.ts +4 -0
  120. package/apps/studio/routes/project-undo.ts +10 -0
  121. package/apps/studio/routes/sync.ts +22 -4
  122. package/apps/studio/server.ts +25 -0
  123. package/apps/studio/shell/api-key.ts +11 -0
  124. package/apps/studio/shell/cli-yield.ts +48 -11
  125. package/apps/studio/sync/accepted-cold-start.ts +144 -8
  126. package/apps/studio/sync/action-stage.ts +18 -1
  127. package/apps/studio/sync/ctl-heal.ts +58 -0
  128. package/apps/studio/sync/file-ledger.ts +38 -4
  129. package/apps/studio/sync/file-plane.ts +226 -19
  130. package/apps/studio/sync/held-deletes.ts +86 -5
  131. package/apps/studio/sync/hub-link.ts +8 -0
  132. package/apps/studio/sync/index.ts +68 -4
  133. package/apps/studio/sync/link-consent.ts +22 -75
  134. package/apps/studio/sync/link-survey.ts +252 -0
  135. package/apps/studio/sync/local-kernel.ts +16 -1
  136. package/apps/studio/sync/seed-progress.ts +12 -0
  137. package/apps/studio/sync/source-recovery.ts +18 -2
  138. package/apps/studio/sync/status.ts +11 -1
  139. package/apps/studio/sync/writer-registry.ts +5 -0
  140. package/apps/studio/whats-new.json +36 -0
  141. package/cli/commands/design.mjs +74 -16
  142. package/cli/lib/bash-guard.mjs +23 -4
  143. package/cli/lib/confine-read.mjs +2 -0
  144. package/cli/lib/design-help.gen.mjs +15 -2
  145. package/cli/lib/design-hook.mjs +1 -1
  146. package/cli/lib/desktop-locate.mjs +36 -8
  147. package/cli/lib/studio-locate.mjs +8 -2
  148. package/cli/lib/sub-verbs.mjs +13 -1
  149. package/package.json +9 -8
  150. package/apps/studio/client/home/HomeAccounts.jsx +0 -262
  151. package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
  152. package/apps/studio/client/v2/shell/account-card-model.js +0 -114
  153. package/apps/studio/client/v2/shell/account-card.jsx +0 -189
@@ -123,6 +123,9 @@ export interface SyncNotice {
123
123
  * which config key opts out. */
124
124
  text: string;
125
125
  severity: 'info' | 'warn';
126
+ /** 2.1.1 T14 — `set-aside-<slug>`: which of this Mac's lanes (`meta` · `annotations` · `comments`)
127
+ * the project's version replaced, so Sync details can name them without parsing `text`. */
128
+ lanes?: string[];
126
129
  at: number;
127
130
  }
128
131
 
@@ -131,7 +134,7 @@ export interface FilePlaneStatus {
131
134
  synced: number;
132
135
  /** Cumulative files landed this boot. */
133
136
  pulled: number;
134
- /** Cumulative conflicts this boot (either winner); losers are in _trash/. */
137
+ /** Cumulative conflicts this boot: the project's version is the file, this Mac's is parked beside it. */
135
138
  conflicts: number;
136
139
  /** Sync v2 — cumulative files sent UP this boot. The v1 lane had no push
137
140
  * half of its own, so this is absent on a journal-less hub. */
@@ -176,6 +179,8 @@ export interface FilePlaneStatus {
176
179
  paths: string[];
177
180
  /** Issue #207 (7b) — `delete-out`: the folders the held deletes sit in, largest first. */
178
181
  folders?: { folder: string; count: number }[];
182
+ /** 2.1.1 T8 — `delete-in`: a fingerprint of every held path; the answer carries it back. */
183
+ digest?: string;
179
184
  /** `code-held`: the version of each listed file on the hub (an older hub names none) — the row
180
185
  * shows it and "Adopt as code" sends the sha, so the hub adopts exactly what was shown. */
181
186
  files?: { path: string; sha256: string; size: number }[];
@@ -253,6 +258,11 @@ export interface FilePlaneStatus {
253
258
  * emits. Same bounding shape `items`/`itemsTruncated` already uses.
254
259
  */
255
260
  deliveryTruncated?: number;
261
+ /**
262
+ * 2.1.1 T14 — files in `conflict` whose copy of this Mac's version sits beside them:
263
+ * `{ "<file>": "<copy>" }`, both relative to the design root. Sync details names the copy.
264
+ */
265
+ conflictCopies?: Record<string, string>;
256
266
  /**
257
267
  * THE DENOMINATOR (feature-large-project-seed).
258
268
  *
@@ -532,6 +532,9 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
532
532
  '/_api/generate/keys': { class: 'local' },
533
533
  '/_api/generate/whisper-model': { class: 'local' },
534
534
  '/_api/hub/link': { class: 'local' },
535
+ // 2.1.1 routes/hub-link-folder.ts: links THIS folder to the person's team server (the attach lane);
536
+ // the seed-up is the sync runtime's, never this route's
537
+ '/_api/hub/link-folder': { class: 'local' },
535
538
  '/_api/report': { class: 'local' },
536
539
  '/_api/report-fallback': { class: 'local' },
537
540
  '/_api/shell-shot': { class: 'local' },
@@ -567,6 +570,8 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
567
570
  '/_api/hub-signin/poll': { class: 'local' },
568
571
  '/_api/hub-signin/cancel': { class: 'local' },
569
572
  '/_api/hub-signin/return': { class: 'local' },
573
+ // 2.1.1 T5 — "Link your server": a tokenless /health check of a typed address (writes nothing)
574
+ '/_api/hub-signin/check': { class: 'read' },
570
575
  // --- the V2-2.5 table (routes/*.ts) — classified by the lead (decision v2-2.5 classification)
571
576
  '/_api/outbox': { class: 'read' }, // routes/outbox.ts: the queue's view
572
577
  '/_api/outbox/:id': { class: 'read' },
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "$schema": "./whats-new.schema.json",
3
3
  "entries": [
4
+ {
5
+ "id": "export-and-chat-fixes-2026-11",
6
+ "version": "2.1.2",
7
+ "date": "2026-11-10",
8
+ "kind": "fix",
9
+ "title": "Export from the chat, steadier AI edits",
10
+ "summary": "Export works again from the AI chat, and Save to can be any folder. ⌘Z undoes your latest annotation, a failed picture generation no longer stops the project, and a selected artboard no longer stops the AI from editing the others.",
11
+ "surface": "design-ui"
12
+ },
13
+ {
14
+ "id": "home-declutter",
15
+ "version": "2.1.2",
16
+ "date": "2026-11-10",
17
+ "kind": "improvement",
18
+ "title": "A calmer Home",
19
+ "summary": "Home now shows what you make and where: recent canvases and your projects. Accounts sit behind one button at the top right, a banner appears only when a sign-in needs you, old servers fold away with Forget, and a project row says where it lives and when you last opened it.",
20
+ "surface": "design-ui"
21
+ },
22
+ {
23
+ "id": "accounts-and-where-projects-live",
24
+ "version": "2.1.1",
25
+ "date": "2026-11-09",
26
+ "kind": "feature",
27
+ "title": "See where each project lives",
28
+ "summary": "The account button now shows which account a project uses, where it lives and whether it connects, with Sign in again one click away when a sign-in stops working. Link your server sends a folder to your own server and asks first when that server already holds work, and Settings opens with This project.",
29
+ "surface": "design-ui"
30
+ },
31
+ {
32
+ "id": "own-server-sync-fixes-2-1-1",
33
+ "version": "2.1.1",
34
+ "date": "2026-11-09",
35
+ "kind": "fix",
36
+ "title": "Signing in to your own server works again",
37
+ "summary": "Sign-in to your team's own server finishes again after the browser hands back. Files the owner removed for good stay removed, and a first link keeps your comments, sticky notes and layout.",
38
+ "surface": "design-ui"
39
+ },
4
40
  {
5
41
  "id": "generation-spend-limits",
6
42
  "version": "2.1.0",
@@ -38,6 +38,7 @@ import {
38
38
  } from '../lib/export-spec.mjs';
39
39
  import { writeGitignoreBlock } from '../lib/gitignore-block.mjs';
40
40
  import { isCompiledBinary, resolveAppSidecar } from '../lib/pkg-root.mjs';
41
+ import { studioHeaders } from '../lib/studio-locate.mjs';
41
42
  import { subVerbArgs } from '../lib/sub-verbs.mjs';
42
43
 
43
44
  const SUBCOMMANDS = new Set([
@@ -87,6 +88,18 @@ const BIN_VERBS = new Set([
87
88
  // S11.6 — read-only: the canvases that can't be drawn, and a canvas's source or one artboard's lines.
88
89
  'canvas-errors',
89
90
  'canvas-source',
91
+ // fix-bulk W1 follow-up. `canvas-new` makes a canvas (blank / brief / empty video, or a duplicate) and
92
+ // `canvas-move` renames or moves one, through the studio's own routes WITH its key — the recipes used
93
+ // `curl-local …/_api/canvas|fs-move`, which every keyed studio answers 401 (sec-loopback-bearer §7).
94
+ 'canvas-new',
95
+ 'canvas-move',
96
+ // fix-bulk 2026-11-10 follow-up — the last `curl-local` recipe families, each a verb that sends the
97
+ // studio's key: Assets › Move to trash / Rename…, Retry on Not saved, and the footage sidecars
98
+ // (/design-video:reel). Sync details' buttons are `sync` sub-verbs. All prompt (verbs.ts).
99
+ 'asset-trash',
100
+ 'asset-rename',
101
+ 'retry-save',
102
+ 'footage',
90
103
  'chat-open',
91
104
  'ensure-browser',
92
105
  'fetch-asset',
@@ -546,6 +559,10 @@ Studio (talk to the running Maude window — contract V2-1.11 §5.3):
546
559
  Restore a canvas / undo an action or a whole AI chat, each as ONE new version; name a version (synced projects). Asks first.
547
560
  history restore <canvas> <ref> --artboard <id> | --element <artboard>/<id> · history restore <canvas> @last-good
548
561
  Put back only one artboard or object, or the last version that drew without an error.
562
+ canvas-new [<name>] [--kind blank|brief-board|video-comp] [--group <folder>] · canvas-new --duplicate <canvas>
563
+ Make a canvas as Canvases › New canvas / Duplicate do; prints the file to Edit.
564
+ canvas-move <canvas> [--name <new name>] [--to <folder>]
565
+ Rename or move a canvas as Canvases › Rename / Move to… do.
549
566
  trash list [--json] · trash move <canvas> · trash restore <id | canvas path>
550
567
  What is in the Trash; move one canvas to it (as Canvases › Move canvas to trash); bring one item back.
551
568
  trash clear [--item <id>]... [--yes]
@@ -557,12 +574,22 @@ Studio (talk to the running Maude window — contract V2-1.11 §5.3):
557
574
  runs only the items of one export that did not make it.
558
575
  assets [--usage <asset>] [--not-used] [--json]
559
576
  The project's assets and the canvases that use them; not-used ones once older versions are checked. Read-only.
577
+ asset-trash <asset>... · asset-rename <asset> <new name>
578
+ Move pictures to the Trash or rename one, as Assets does; one a canvas uses stays. Asks first.
579
+ retry-save
580
+ The saves a full disk held try to land now (Retry on Not saved). Asks first.
581
+ footage show (--asset <clip> | --cut <slug>) · footage save (--asset | --cut) --from <file.json>
582
+ A clip's footage analysis or a cut's EDL; save stores it as the studio validates it. Asks first.
560
583
  runs list [--canvas <canvas>] [--json] · runs stop <run>
561
584
  The AI runs on this project and the artboards each is changing; stop one of yours.
562
585
  logs [--source all|sync|server|ai|export] [--tail N] [--grep <text>] [--json]
563
586
  This Mac's Maude log lines, redacted, merged by time (what Diagnostics › Logs shows). Read-only.
564
587
  sync status [--json] · sync resync [--no-wait] [--json]
565
588
  Sync in one word + the last resync; or compare every file with the cloud copy. Resync asks first.
589
+ sync compare <canvas> · sync keep-mine|use-theirs|keep-both <canvas>
590
+ sync publish-ai-edit|discard-ai-edit [--run <id>] · sync cancel-transfer
591
+ Sync details' buttons: a held conflict's two versions and its answer, an unfinished AI edit's
592
+ answer, stop the picture transfer. Each asks first.
566
593
  captions add|list|export <canvas>#<artboard> · cut-words <canvas>#<artboard> --clip <id> --words w12-w15
567
594
  cut-to-beat <canvas>#<artboard> [--every 1|2|4] · beats <assets/x.mp3> [--bpm N] [--dry-run]
568
595
  A video's captions, edit by transcript, Cut to the beat (one undoable edit each, in the
@@ -991,6 +1018,42 @@ function checkDevDeps({ pkgRoot }) {
991
1018
  return missing;
992
1019
  }
993
1020
 
1021
+ const UNVERIFIED_LINE =
1022
+ 'Maude has this project open, but its server did not answer the check. Close and reopen the tab in Maude, or quit Maude to use a separate server.';
1023
+
1024
+ /**
1025
+ * fix-bulk B1 — `{ base, apiKey? }` of the studio an export goes to, or `{ error }`. The project is
1026
+ * the session's (AI chat) or the one at or above the cwd; `--port` names a port, else the app's
1027
+ * attested server or `_server.json` (verified by `/_health`) is used. Always 127.0.0.1.
1028
+ */
1029
+ export async function exportStudio(portFlag, { env = process.env, cwd = process.cwd() } = {}) {
1030
+ const { sessionRoot } = await import('../lib/confine-root.mjs');
1031
+ const { probeStudio } = await import('../lib/studio-locate.mjs');
1032
+ const { ATTEST_PATIENCE, serverKeyFor } = await import('../lib/desktop-locate.mjs');
1033
+ const root = sessionRoot(env, cwd) ?? cwd;
1034
+ if (portFlag !== undefined && portFlag !== true) {
1035
+ const port = Number(portFlag);
1036
+ if (!Number.isInteger(port) || port < 1 || port > 65535)
1037
+ return { error: `--port ${portFlag} is not a port.` };
1038
+ const k = await serverKeyFor(root, port, { env, ...ATTEST_PATIENCE });
1039
+ if (k.unverified) return { error: UNVERIFIED_LINE };
1040
+ return { base: `http://127.0.0.1:${port}`, ...(k.key ? { apiKey: k.key } : {}) };
1041
+ }
1042
+ const p = await probeStudio(root, {
1043
+ timeoutMs: ATTEST_PATIENCE.timeoutMs,
1044
+ attempts: ATTEST_PATIENCE.attempts,
1045
+ retryDelayMs: ATTEST_PATIENCE.retryDelayMs,
1046
+ });
1047
+ if (p.studio) return p.studio;
1048
+ if (p.unverified) return { error: UNVERIFIED_LINE };
1049
+ if (p.state === 'busy')
1050
+ return { error: 'the studio is busy and did not answer. Try again in a moment.' };
1051
+ return {
1052
+ error:
1053
+ 'no running studio for this project (no --port given, and neither the Maude app nor .design/_server.json names one). Open the project in Maude, or start one with `maude design serve`.',
1054
+ };
1055
+ }
1056
+
994
1057
  async function runExport({ args }) {
995
1058
  // `maude design export <format> [--scope ...] [--port N] [--out <path>] [--option key=value]`
996
1059
  // v2 (S8.1c, contract S8-export-spec.md §5.7): `--scope selection|canvas|folder|project` with
@@ -1022,20 +1085,15 @@ async function runExport({ args }) {
1022
1085
  process.exit(2);
1023
1086
  }
1024
1087
 
1025
- // Resolve port: --port > .design/_server.json
1026
- let port = flags.port ? Number(flags.port) : null;
1027
- if (!port) {
1028
- try {
1029
- const raw = await readFile(resolve(process.cwd(), '.design', '_server.json'), 'utf8');
1030
- port = JSON.parse(raw).port;
1031
- } catch {
1032
- /* no server.json — handled below */
1033
- }
1034
- }
1035
- if (!port) {
1036
- process.stderr.write(
1037
- 'maude design export: no --port given and .design/_server.json not found. Start the dev server first (`maude design serve`).\n'
1038
- );
1088
+ // fix-bulk B1 (#221) — the studio and its key, the way every other verb finds them
1089
+ // (sec-loopback-bearer §7.6): the desktop app's ATTESTED server for this project first (its key from
1090
+ // the app's registry), else `_server.json`'s port once `/_health` names this project (a
1091
+ // terminal-started server's key from its per-user key file). An explicit --port gets the key of
1092
+ // whichever of those serves there. Never a key or an address from a project file; the export used
1093
+ // to POST with no key at all, and a server in required mode answered 401 api-key-required.
1094
+ const studio = await exportStudio(flags.port);
1095
+ if (studio.error) {
1096
+ process.stderr.write(`maude design export: ${studio.error}\n`);
1039
1097
  process.exit(1);
1040
1098
  }
1041
1099
 
@@ -1065,9 +1123,9 @@ async function runExport({ args }) {
1065
1123
  body = { format, scope, options: parsed.options };
1066
1124
  }
1067
1125
 
1068
- const r = await fetch(`http://localhost:${port}${route}`, {
1126
+ const r = await fetch(`${studio.base}${route}`, {
1069
1127
  method: 'POST',
1070
- headers: { 'content-type': 'application/json' },
1128
+ headers: studioHeaders(studio, { 'content-type': 'application/json' }),
1071
1129
  body: JSON.stringify(body),
1072
1130
  });
1073
1131
  if (!r.ok) {
@@ -565,13 +565,13 @@ const SCRIPT_WRITES =
565
565
  /\b(?:writeFile(?:Sync)?|appendFile(?:Sync)?|createWriteStream|rmSync|unlink(?:Sync)?|rename(?:Sync)?|copyFile(?:Sync)?|cpSync|truncate(?:Sync)?|Bun\.write|write_text|write_bytes|os\.remove|os\.replace|os\.rename|shutil\.\w+|File\.write|FileUtils)\b|\bopen\s*\([^)]*['"][wax+]b?['"]|\bmode\s*=\s*['"][wax+]|\bopen\s*\([^)]*['"]\+?>{1,2}/;
566
566
 
567
567
  const MESSAGES = {
568
- // The route is the studio's own (the one Canvases uses), reached with `curl-local`; the port is in
569
- // `.design/_server.json`. (These messages once named `maude design trash move` / `canvas move`:
570
- // neither verb exists, and the agent spent 15+ calls finding this route.)
568
+ // The verbs are the studio's own routes (the ones Canvases uses), sent with the studio's key —
569
+ // `curl-local` sends none, and a keyed studio answers it 401 (sec-loopback-bearer §7). (These
570
+ // messages once named verbs that did not exist, and the agent spent 15+ calls finding the route.)
571
571
  'use-trash': (rel) =>
572
572
  `use-trash: ${rel} is a versioned design file — Bash never deletes it. Move a canvas to the trash with \`maude design trash move <canvas path>\` (the studio's own Move canvas to trash; \`maude design trash restore <canvas path>\` brings it back — or ask the person to delete it in Canvases); remove one artboard by deleting its DCArtboard block with Edit.`,
573
573
  'use-verb': (rel) =>
574
- `use-verb: ${rel} is a versioned design file — Bash never moves it. Rename or move it with the studio's own route: \`maude design curl-local http://127.0.0.1:<port>/_api/fs-move --method POST --header "Content-Type: application/json" --data '{"file":"<canvas path>","toName":"<new name>"}'\` (add "toDir" to move it to another folder; port: .design/_server.json; or ask the person to move it in Canvases). To the trash: \`maude design trash move <canvas path>\`.`,
574
+ `use-verb: ${rel} is a versioned design file — Bash never moves it. Rename or move it as Canvases does: \`maude design canvas-move <canvas path> --name "<new name>"\` (\`--to <folder>\` moves it to another folder; or ask the person to move it in Canvases). To the trash: \`maude design trash move <canvas path>\`.`,
575
575
  'out-of-project': (path) =>
576
576
  `out-of-project: this \`maude\` command's output would be written to ${path}, outside the project. Write inside the project or the temp dir (or drop the redirection and read the output).`,
577
577
  'other-project': (what) =>
@@ -597,6 +597,25 @@ const HUMAN_ONLY_ROUTES = [
597
597
  what: 'Move to cloud',
598
598
  why: 'it uploads the project to their billed cloud account',
599
599
  },
600
+ // 2.1.1 — Link your server: THIS folder joins the person's team server; the studio answers a
601
+ // write without the window's own fetch 403 window-only (routes/hub-link-folder.ts).
602
+ {
603
+ re: /\/_api\/hub\/link-folder(?![\w-])/i,
604
+ what: 'Link your server',
605
+ why: "it uploads the project to their team server with this Mac's sign-in",
606
+ },
607
+ // 2.1.1 T8 — a team-server sign-in and saving a team-server credential are the person's acts; the
608
+ // studio answers them 403 person-only to a key holder (shell/api-key.ts PERSON_ONLY).
609
+ {
610
+ re: /\/_api\/hub-signin\/(?:start|check)(?![\w-])/i,
611
+ what: 'Sign in to your server',
612
+ why: 'it signs this Mac in to a team server and stores that sign-in',
613
+ },
614
+ {
615
+ re: /\/_api\/hub\/link(?![\w-])/i,
616
+ what: 'Save a server sign-in',
617
+ why: "it stores a team server's credential on this Mac",
618
+ },
600
619
  // V2-8.9 defender M1 (decision maude/v2-8.9-sync-link-confirm-needs-fetch-metadata).
601
620
  {
602
621
  re: /\/_api\/sync\/link\/confirm(?![\w-])/i,
@@ -56,6 +56,8 @@ export const SOURCE_VERBS = new Set([
56
56
  */
57
57
  export const SOURCE_FLAGS = new Map([
58
58
  ['annotate', ['--board', '--flow', '--ops', '--rects', '--canvas-state']],
59
+ // fix-bulk 2026-11-10 follow-up: `footage save --from <file.json>` stores that file's JSON in the project
60
+ ['footage', ['--from']],
59
61
  ]);
60
62
 
61
63
  /** The values of `flags` in `args` (`--f v` and `--f=v`). */
@@ -1,9 +1,9 @@
1
1
  // GENERATED by scripts/gen-actions.mjs from apps/studio/actions/verbs.ts — DO NOT EDIT BY HAND.
2
2
  // What `maude design help` prints under the static usage (contract V2-1.11 §5.7 rule 6).
3
- // manifest e05dcafced81
3
+ // manifest 924d3acafe2c
4
4
 
5
5
  export const DESIGN_VERB_TIERS_HELP =
6
- "Verbs by permission tier (generated from actions.manifest.json, contract V2-1.11 §5.3):\n auto No prompt in the Maude chat (effect none/project):\n prep · bootstrap-check · slug · server-up · runtime-health · screenshot · smoke\n visual-sanity · perf · canvas-rects · canvas-errors · canvas-source\n read-annotations · svg-optimize · asset-sweep · draw-proof · probe-footage\n smart-frames · agent-browser-safe · chat-open · serve · status · index · assets\n help · check · place · layout-check · open · history list · history show\n history diff · history object · trash list · comments list · exports list\n exports again · runs list · runs stop · logs · sync status · annotate · canvas-edit\n handoff · import-asset · import-tokens · ingest-footage · photo-adjust\n transcribe-local · beats · captions list · captions add · captions export · captions\n cut-words · cut-to-beat · reel-place · ds-check · ds-upgrade analyse\n ds-upgrade plan · ds-upgrade validate · ds-upgrade status · ds-upgrade stage\n ds-upgrade prove · ds-upgrade discard · ds-upgrade cancel · trash move\n trash restore · ds status · ds usage · ds check-system · ds revisions\n prompt Shows the permission card:\n hook · video-proxy · export · curl-local · draw-build · to-lottie · generate\n audio-search · fetch-asset · ensure-browser · transcribe · import-figma\n import-brand · photo-bg-remove · describe · init · ds-upgrade · bulk-deletes\n history restore · trash · history undo · history name · exports · sync resync · sync\n runs · ds · comments reply · comments resolve · comments reopen · comments add\n comments · history\n human For people in a terminal. Never in the AI allow list:\n trash clear · link · adopt · unlink · detach\n Every studio capability's file or verb: the design plugin's studio-actions skill.\n";
6
+ "Verbs by permission tier (generated from actions.manifest.json, contract V2-1.11 §5.3):\n auto No prompt in the Maude chat (effect none/project):\n prep · bootstrap-check · slug · server-up · runtime-health · screenshot · smoke\n visual-sanity · perf · canvas-rects · canvas-errors · canvas-source\n read-annotations · svg-optimize · asset-sweep · draw-proof · probe-footage\n smart-frames · agent-browser-safe · chat-open · serve · status · index · assets\n help · check · place · layout-check · open · history list · history show\n history diff · history object · trash list · comments list · exports list\n exports again · runs list · runs stop · logs · sync status · annotate · canvas-edit\n canvas-new · canvas-move · handoff · import-asset · import-tokens · ingest-footage\n photo-adjust · transcribe-local · beats · captions list · captions add\n captions export · captions · cut-words · cut-to-beat · reel-place · ds-check\n ds-upgrade analyse · ds-upgrade plan · ds-upgrade validate · ds-upgrade status\n ds-upgrade stage · ds-upgrade prove · ds-upgrade discard · ds-upgrade cancel\n trash move · trash restore · ds status · ds usage · ds check-system · ds revisions\n prompt Shows the permission card:\n hook · video-proxy · export · asset-trash · asset-rename · retry-save · footage\n sync compare · sync cancel-transfer · sync keep-mine · sync use-theirs\n sync keep-both · sync publish-ai-edit · sync discard-ai-edit · curl-local\n draw-build · to-lottie · generate · audio-search · fetch-asset · ensure-browser\n transcribe · import-figma · import-brand · photo-bg-remove · describe · init\n ds-upgrade · bulk-deletes · history restore · trash · history undo · history name\n exports · sync resync · sync · runs · ds · comments reply · comments resolve\n comments reopen · comments add · comments · history\n human For people in a terminal. Never in the AI allow list:\n trash clear · link · adopt · unlink · detach\n Every studio capability's file or verb: the design plugin's studio-actions skill.\n";
7
7
 
8
8
  /** The `maude design` verbs the manifest knows, by tier. */
9
9
  export const DESIGN_VERBS_BY_TIER = {
@@ -51,6 +51,8 @@ export const DESIGN_VERBS_BY_TIER = {
51
51
  'sync status',
52
52
  'annotate',
53
53
  'canvas-edit',
54
+ 'canvas-new',
55
+ 'canvas-move',
54
56
  'handoff',
55
57
  'import-asset',
56
58
  'import-tokens',
@@ -85,6 +87,17 @@ export const DESIGN_VERBS_BY_TIER = {
85
87
  'hook',
86
88
  'video-proxy',
87
89
  'export',
90
+ 'asset-trash',
91
+ 'asset-rename',
92
+ 'retry-save',
93
+ 'footage',
94
+ 'sync compare',
95
+ 'sync cancel-transfer',
96
+ 'sync keep-mine',
97
+ 'sync use-theirs',
98
+ 'sync keep-both',
99
+ 'sync publish-ai-edit',
100
+ 'sync discard-ai-edit',
88
101
  'curl-local',
89
102
  'draw-build',
90
103
  'to-lottie',
@@ -1104,7 +1104,7 @@ export function handMadeCanvasReason(designRoot, rel) {
1104
1104
  return dir !== '' && (rel === dir || rel.startsWith(`${dir}/`));
1105
1105
  };
1106
1106
  if (dirs.some(under)) return null;
1107
- return `new-canvas: ${rel} does not exist yet, and a canvas is never written by hand. Make it with the app's own create — \`maude design curl-local "http://127.0.0.1:<port>/_api/canvas" --method POST --header "Content-Type: application/json" --data '{"kind":"blank","name":"<name>"}'\` (the port is in ${DESIGN_REL}/_server.json; the answer's \`rel\` is the file) — then Edit the file it made. A component goes in the newComponentDir instead.`;
1107
+ return `new-canvas: ${rel} does not exist yet, and a canvas is never written by hand. Make it with the app's own create — \`maude design canvas-new "<name>"\` (it prints the file it made) — then Edit that file. A component goes in the newComponentDir instead.`;
1108
1108
  }
1109
1109
 
1110
1110
  async function preEdit(ctx, input) {
@@ -37,7 +37,7 @@
37
37
  import { createHash, createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
38
38
  import { lstatSync, readFileSync, realpathSync } from 'node:fs';
39
39
  import { createConnection } from 'node:net';
40
- import { homedir } from 'node:os';
40
+ import { homedir, userInfo } from 'node:os';
41
41
  import { dirname, isAbsolute, join, resolve } from 'node:path';
42
42
  import { fileURLToPath } from 'node:url';
43
43
 
@@ -115,8 +115,26 @@ function real(p) {
115
115
 
116
116
  const underTest = (e) => !!e && (!!e.NODE_TEST_CONTEXT || e.NODE_ENV === 'test');
117
117
 
118
+ /**
119
+ * #218 — the home the app's files sit under. `$HOME` when it is an absolute path (a throwaway-HOME
120
+ * harness keeps its own); anything else is not a home — an AI chat's shell once assigned a prompt
121
+ * fragment to a variable named HOME, every helper then found no app and sent no studio key — so the
122
+ * account's own home (the passwd entry, which ignores `$HOME`) stands in. Never throws.
123
+ */
124
+ export function homeOf(env = process.env) {
125
+ const h = env.HOME;
126
+ if (h && isAbsolute(h)) return h;
127
+ try {
128
+ const u = userInfo().homedir;
129
+ if (u && isAbsolute(u)) return u;
130
+ } catch {
131
+ /* no passwd entry: the platform default below */
132
+ }
133
+ return homedir();
134
+ }
135
+
118
136
  /** The registry the app writes: Tauri's `app_data_dir()` + `servers.json` (cli-yield.ts registryPath). */
119
- export function registryPath(env = process.env, platform = process.platform, home = homedir()) {
137
+ export function registryPath(env = process.env, platform = process.platform, home = homeOf(env)) {
120
138
  const override = env[REGISTRY_FILE_ENV];
121
139
  if (override && isAbsolute(override)) return override;
122
140
  // Under a test runner (node --test, bun test) only an explicit override counts: a suite that runs
@@ -129,7 +147,7 @@ export function registryPath(env = process.env, platform = process.platform, hom
129
147
  export function appDataRegistryPath(
130
148
  env = process.env,
131
149
  platform = process.platform,
132
- home = homedir()
150
+ home = homeOf(env)
133
151
  ) {
134
152
  if (platform === 'darwin')
135
153
  return join(home, 'Library', 'Application Support', APP_IDENTIFIER, 'servers.json');
@@ -324,9 +342,9 @@ const LAUNCH_DOMAIN = 'maude-launch/1';
324
342
  const HELPER_LAUNCH_DOMAIN = 'maude-launch-helper/1';
325
343
 
326
344
  /** apps/studio/shell/key-file.ts `serverKeyDir`, verbatim: `<state>/maude/servers`. */
327
- export function serverKeyDir(env = process.env, home = homedir()) {
345
+ export function serverKeyDir(env = process.env, home = homeOf(env)) {
328
346
  const s = env.XDG_STATE_HOME;
329
- const state = s && isAbsolute(s) ? s : join(env.HOME || home, '.local', 'state');
347
+ const state = s && isAbsolute(s) ? s : join(home, '.local', 'state');
330
348
  return join(state, 'maude', 'servers');
331
349
  }
332
350
 
@@ -632,6 +650,13 @@ exit: 0 ok · 10 not the app's (use the project's own server; no key) · 11 the
632
650
  it did not answer the check (do not use _server.json) · 4 refused (message on stderr) · 2 usage
633
651
  `;
634
652
 
653
+ /**
654
+ * How long a caller that is not latency-bound (the bash helpers' `port` / `key` / `launch-url`, an
655
+ * export) waits for an app server to answer the attest check: 4 tries, 3 s each, 750 ms apart. A
656
+ * server busy with an export or a fresh boot answers late; only after the last try is it unverified.
657
+ */
658
+ export const ATTEST_PATIENCE = Object.freeze({ attempts: 4, retryDelayMs: 750, timeoutMs: 3000 });
659
+
635
660
  function argsOf(argv) {
636
661
  const o = { mode: argv[0] };
637
662
  for (let i = 1; i < argv.length; i++) {
@@ -681,7 +706,7 @@ export async function main(
681
706
  }
682
707
  const root = resolve(a.root);
683
708
  if (a.mode === 'port') {
684
- const p = await probeDesktop(root, { env, attempts: 4, retryDelayMs: 750 });
709
+ const p = await probeDesktop(root, { env, ...ATTEST_PATIENCE });
685
710
  // `--ensure show` (/design:browse): the app shows the project itself — nothing on stdout
686
711
  if (a.ensure === 'show' && p.state !== 'no-app' && p.socket) {
687
712
  const r = await ensureDesktop(root, { env, purpose: 'show', log });
@@ -726,8 +751,11 @@ export async function main(
726
751
  err.write(`desktop-locate: ${a.mode} needs --port N\n${USAGE}`);
727
752
  return 2;
728
753
  }
729
- // the app's attested server, else a terminal-started one's key file (sec-loopback-bearer §7.5)
730
- const r = await serverKeyFor(root, Number(a.port), { env });
754
+ // the app's attested server, else a terminal-started one's key file (sec-loopback-bearer §7.5).
755
+ // fix-bulk B1 — the same patience as `port` mode: a busy app server (an export, a fresh boot)
756
+ // answers the check late, and one 1.5 s try read as "did not attest" (exit 11). Still only an
757
+ // attested port gets its key; a wrong answer stays 11 after the last try.
758
+ const r = await serverKeyFor(root, Number(a.port), { env, ...ATTEST_PATIENCE });
731
759
  if (r.unverified) return 11;
732
760
  if (a.mode === 'launch-url') {
733
761
  // a browser opens the studio with a one-time token (a server that needs no key: the plain URL)
@@ -55,8 +55,14 @@ export async function probeStudio(
55
55
  root,
56
56
  { timeoutMs = 300, attempts = 1, retryDelayMs = 250 } = {}
57
57
  ) {
58
- const app = await probeDesktop(root, { timeoutMs: Math.max(timeoutMs, 300) });
59
- if (app.state === 'unverified') return { state: 'none' };
58
+ // fix-bulk B1 — the app's attest check gets the same tries as `/_health` below: a busy app server
59
+ // (an export, a fresh boot) answers late, and one try read as "no studio" for every verb
60
+ const app = await probeDesktop(root, {
61
+ timeoutMs: Math.max(timeoutMs, 300),
62
+ attempts,
63
+ retryDelayMs,
64
+ });
65
+ if (app.state === 'unverified') return { state: 'none', unverified: true };
60
66
  if (app.state === 'running') {
61
67
  const base = `http://127.0.0.1:${app.port}`;
62
68
  let health = null;
@@ -47,7 +47,19 @@ export const SUB_VERBS = {
47
47
  // S5.4 (V2-1.15 §5.10): the AI runs — `list` reads, `stop` stops one of your own runs.
48
48
  runs: { list: NATIVE, stop: NATIVE },
49
49
  // S11.11: `status` reads; `resync` re-compares every file with the cloud copy (shared → prompt).
50
- sync: { status: NATIVE, resync: NATIVE },
50
+ // fix-bulk 2026-11-10 follow-up: Sync details' buttons. All prompt (verbs.ts: the answers are shared,
51
+ // `compare` / `cancel-transfer` are held at the tier their recipe had).
52
+ sync: {
53
+ status: NATIVE,
54
+ resync: NATIVE,
55
+ compare: NATIVE,
56
+ 'keep-mine': NATIVE,
57
+ 'use-theirs': NATIVE,
58
+ 'keep-both': NATIVE,
59
+ 'publish-ai-edit': NATIVE,
60
+ 'discard-ai-edit': NATIVE,
61
+ 'cancel-transfer': NATIVE,
62
+ },
51
63
  // S7.6c (V2-1.10 §5.7): a video's captions — `list` reads, `add` / `export` write in the project.
52
64
  captions: { add: NATIVE, list: NATIVE, export: NATIVE },
53
65
  // S10.3 (S10 §2.4): the design-system reads; the helper (ds/ds-verb.ts) refuses a write flag
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1agh/maude",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Marketplace of Claude Code plugins by Michal Dovrtěl: `design` (canvas-first design iteration) + `flow` (generic agentic workflow loop with .ai second brain). Ships the `maude` CLI (with `mdcc` legacy alias) to scaffold workspace, run the design dev server, and manage configs.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -60,6 +60,7 @@
60
60
  "test:e2e:desktop:parity": "pnpm --filter @maude/desktop-e2e e2e:parity",
61
61
  "test:e2e:desktop:sidecar-respawn": "pnpm --filter @maude/desktop-e2e e2e:sidecar-respawn",
62
62
  "test:e2e:desktop:exports": "pnpm --filter @maude/desktop-e2e e2e:exports",
63
+ "test:e2e:desktop:accounts": "pnpm --filter @maude/desktop-e2e e2e:accounts",
63
64
  "test:e2e:desktop:team-project": "pnpm --filter @maude/desktop-e2e e2e:team-project",
64
65
  "test:e2e:desktop:ai-runs": "pnpm --filter @maude/desktop-e2e e2e:ai-runs",
65
66
  "test:e2e:desktop:team-cell": "pnpm --filter @maude/desktop-e2e e2e:team-cell",
@@ -71,13 +72,13 @@
71
72
  "test:e2e:desktop:parity:cloud": "pnpm --filter @maude/desktop-e2e e2e:parity:cloud"
72
73
  },
73
74
  "optionalDependencies": {
74
- "@1agh/maude-darwin-arm64": "2.1.0",
75
- "@1agh/maude-darwin-x64": "2.1.0",
76
- "@1agh/maude-linux-arm64": "2.1.0",
77
- "@1agh/maude-linux-arm64-musl": "2.1.0",
78
- "@1agh/maude-linux-x64": "2.1.0",
79
- "@1agh/maude-linux-x64-musl": "2.1.0",
80
- "@1agh/maude-win32-x64": "2.1.0"
75
+ "@1agh/maude-darwin-arm64": "2.1.2",
76
+ "@1agh/maude-darwin-x64": "2.1.2",
77
+ "@1agh/maude-linux-arm64": "2.1.2",
78
+ "@1agh/maude-linux-arm64-musl": "2.1.2",
79
+ "@1agh/maude-linux-x64": "2.1.2",
80
+ "@1agh/maude-linux-x64-musl": "2.1.2",
81
+ "@1agh/maude-win32-x64": "2.1.2"
81
82
  },
82
83
  "files": [
83
84
  "cli",