@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.
- package/apps/studio/access/request.ts +1 -0
- package/apps/studio/actions/agents.ts +45 -42
- package/apps/studio/actions/defs/app.ts +28 -1
- package/apps/studio/actions/defs/sync.ts +4 -0
- package/apps/studio/actions/verbs.ts +49 -0
- package/apps/studio/actions.manifest.json +162 -20
- package/apps/studio/actions.parity.json +13 -1
- package/apps/studio/ai/create-claim.ts +1 -1
- package/apps/studio/bin/_asset-file.mjs +117 -0
- package/apps/studio/bin/_canvas-file.mjs +146 -0
- package/apps/studio/bin/_curl-local.mjs +7 -4
- package/apps/studio/bin/_footage.mjs +123 -0
- package/apps/studio/bin/_pdf-playwright.mjs +14 -0
- package/apps/studio/bin/_png-playwright.mjs +15 -1
- package/apps/studio/bin/_pw-launch.mjs +98 -0
- package/apps/studio/bin/_retry-save.mjs +49 -0
- package/apps/studio/bin/_sync.mjs +145 -2
- package/apps/studio/bin/asset-rename.sh +12 -0
- package/apps/studio/bin/asset-trash.sh +12 -0
- package/apps/studio/bin/canvas-move.sh +12 -0
- package/apps/studio/bin/canvas-new.sh +12 -0
- package/apps/studio/bin/footage.sh +12 -0
- package/apps/studio/bin/generate.sh +7 -0
- package/apps/studio/bin/retry-save.sh +13 -0
- package/apps/studio/bridge/canvas-mode-store.ts +11 -2
- package/apps/studio/bridge/dgn-protocol.ts +8 -3
- package/apps/studio/bridge/occlusion.ts +45 -0
- package/apps/studio/canvas-theme-pill.tsx +169 -26
- package/apps/studio/client/app.jsx +16 -4
- package/apps/studio/client/export-center.jsx +32 -3
- package/apps/studio/client/home/HomeAccountBanner.jsx +61 -0
- package/apps/studio/client/home/HomeAccountsChip.jsx +404 -0
- package/apps/studio/client/home/HomeConnection.jsx +112 -0
- package/apps/studio/client/home/ProjectRows.jsx +514 -0
- package/apps/studio/client/home/home-accounts-model.js +234 -76
- package/apps/studio/client/home/home-api.js +10 -2
- package/apps/studio/client/home/home-app.jsx +151 -394
- package/apps/studio/client/home/home-icons.jsx +8 -0
- package/apps/studio/client/home/home-model.js +149 -1
- package/apps/studio/client/home/home-where-model.js +105 -0
- package/apps/studio/client/home/home.css +621 -53
- package/apps/studio/client/home/use-account-fix.js +123 -0
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +3 -1
- package/apps/studio/client/hooks/use-tabs.jsx +11 -4
- package/apps/studio/client/panels/TeamProjects.jsx +137 -134
- package/apps/studio/client/share-link.js +12 -0
- package/apps/studio/client/styles/_index.css +4 -0
- package/apps/studio/client/v2/assets/generate-ask.jsx +3 -1
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
- package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +94 -3
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +187 -4
- package/apps/studio/client/v2/export/done-toast.jsx +2 -5
- package/apps/studio/client/v2/export/export-sheet.jsx +9 -2
- package/apps/studio/client/v2/export/export.css +9 -0
- package/apps/studio/client/v2/export/exports-model.js +16 -3
- package/apps/studio/client/v2/export/file-rows.jsx +81 -5
- package/apps/studio/client/v2/export/native-save.js +33 -0
- package/apps/studio/client/v2/export/sections/print-copy.js +3 -0
- package/apps/studio/client/v2/export/sections/print.jsx +37 -20
- package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
- package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
- package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
- package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
- package/apps/studio/client/v2/link-server/link-server.css +109 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
- package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
- package/apps/studio/client/v2/search/search-keywords.js +3 -2
- package/apps/studio/client/v2/settings/account.jsx +4 -2
- package/apps/studio/client/v2/settings/advanced-section.jsx +245 -148
- package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
- package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
- package/apps/studio/client/v2/settings/general-section.jsx +138 -43
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
- package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
- package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
- package/apps/studio/client/v2/settings/settings-cards.js +220 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
- package/apps/studio/client/v2/settings/settings-model.js +91 -31
- package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
- package/apps/studio/client/v2/settings/settings.css +374 -64
- package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
- package/apps/studio/client/v2/settings/this-project-model.js +172 -0
- package/apps/studio/client/v2/settings/use-connections.js +3 -2
- package/apps/studio/client/v2/settings/use-open-card.js +37 -0
- package/apps/studio/client/v2/shell/connection-state.js +197 -0
- package/apps/studio/client/v2/shell/menu-runner.js +7 -2
- package/apps/studio/client/v2/shell/occlusion-insets.js +37 -9
- package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
- package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
- package/apps/studio/client/v2/shell/project-account-model.js +272 -149
- package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
- package/apps/studio/client/v2/shell/project-account.css +237 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
- package/apps/studio/client/v2/shell/shell-parity.js +3 -2
- package/apps/studio/client/v2/shell/shell-parity.json +40 -26
- package/apps/studio/client/v2/shell/use-account.js +2 -0
- package/apps/studio/client/v2/shell/use-occluded-insets.js +13 -3
- package/apps/studio/client/v2/signin/use-signin.js +1 -1
- package/apps/studio/cloud/endpoints.ts +29 -4
- package/apps/studio/collab/room.ts +21 -7
- package/apps/studio/dist/client.bundle.js +886 -886
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/exporters/ghostscript.ts +78 -1
- package/apps/studio/exporters/pdf-fonts.ts +31 -4
- package/apps/studio/generation/jobs.ts +6 -0
- package/apps/studio/home/accounts.ts +30 -11
- package/apps/studio/home/cloud.ts +6 -1
- package/apps/studio/home/hub-health.ts +76 -0
- package/apps/studio/home/routes.ts +9 -3
- package/apps/studio/http.ts +14 -2
- package/apps/studio/migrate/hub.ts +8 -1
- package/apps/studio/routes/agent.ts +6 -2
- package/apps/studio/routes/hub-link-folder.ts +334 -0
- package/apps/studio/routes/hub-signin.ts +78 -1
- package/apps/studio/routes/index.ts +4 -0
- package/apps/studio/routes/project-undo.ts +10 -0
- package/apps/studio/routes/sync.ts +22 -4
- package/apps/studio/server.ts +25 -0
- package/apps/studio/shell/api-key.ts +11 -0
- package/apps/studio/shell/cli-yield.ts +48 -11
- package/apps/studio/sync/accepted-cold-start.ts +144 -8
- package/apps/studio/sync/action-stage.ts +18 -1
- package/apps/studio/sync/ctl-heal.ts +58 -0
- package/apps/studio/sync/file-ledger.ts +38 -4
- package/apps/studio/sync/file-plane.ts +226 -19
- package/apps/studio/sync/held-deletes.ts +86 -5
- package/apps/studio/sync/hub-link.ts +8 -0
- package/apps/studio/sync/index.ts +68 -4
- package/apps/studio/sync/link-consent.ts +22 -75
- package/apps/studio/sync/link-survey.ts +252 -0
- package/apps/studio/sync/local-kernel.ts +16 -1
- package/apps/studio/sync/seed-progress.ts +12 -0
- package/apps/studio/sync/source-recovery.ts +18 -2
- package/apps/studio/sync/status.ts +11 -1
- package/apps/studio/sync/writer-registry.ts +5 -0
- package/apps/studio/whats-new.json +36 -0
- package/cli/commands/design.mjs +74 -16
- package/cli/lib/bash-guard.mjs +23 -4
- package/cli/lib/confine-read.mjs +2 -0
- package/cli/lib/design-help.gen.mjs +15 -2
- package/cli/lib/design-hook.mjs +1 -1
- package/cli/lib/desktop-locate.mjs +36 -8
- package/cli/lib/studio-locate.mjs +8 -2
- package/cli/lib/sub-verbs.mjs +13 -1
- package/package.json +9 -8
- package/apps/studio/client/home/HomeAccounts.jsx +0 -262
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
- package/apps/studio/client/v2/shell/account-card-model.js +0 -114
- package/apps/studio/client/v2/shell/account-card.jsx +0 -189
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Internal shim behind footage.sh (`maude design footage show|save`).
|
|
2
|
+
//
|
|
3
|
+
// The footage sidecars of /design-video:reel and /design-video:video-analyze (feature-footage-analysis-
|
|
4
|
+
// director), for the orchestrator in the AI chat and a terminal (fix-bulk 2026-11-10 follow-up):
|
|
5
|
+
// show GET /_api/footage?asset=<…> | ?slug=<…> a clip's FootageAnalysis, or a cut's EDL ({} = none yet)
|
|
6
|
+
// save PUT /_api/footage?asset=<…> | ?slug=<…> validated and stamped by the studio (footage-store.ts)
|
|
7
|
+
// The analyst agent never runs this: it returns JSON, and the command persists it (DDR-183 F2).
|
|
8
|
+
//
|
|
9
|
+
// Why a verb and not a loopback curl: since 2.1.0 the studio's main origin needs its key from every
|
|
10
|
+
// caller (contract sec-loopback-bearer §7), and `curl-local` sends none. This finds the studio and its
|
|
11
|
+
// key the way every verb does (studio-locate.mjs). A `.footage.json` / EDL syncs between peers
|
|
12
|
+
// (DDR-054), so `show` prints it inside the untrusted-data block.
|
|
13
|
+
//
|
|
14
|
+
// `save --from <file>` reads the file the caller names: in a Maude chat that path is checked against the
|
|
15
|
+
// chat's read boundary by the dispatcher (cli/lib/confine-read.mjs SOURCE_FLAGS).
|
|
16
|
+
|
|
17
|
+
import { readFileSync } from 'node:fs';
|
|
18
|
+
import {
|
|
19
|
+
call,
|
|
20
|
+
clean,
|
|
21
|
+
connect,
|
|
22
|
+
parseWords,
|
|
23
|
+
runVerb,
|
|
24
|
+
UNTRUSTED_NOTICE,
|
|
25
|
+
UsageError,
|
|
26
|
+
writeUntrusted,
|
|
27
|
+
} from './_studio-verb.mjs';
|
|
28
|
+
|
|
29
|
+
export const USAGE = `usage: maude design footage show (--asset <clip> | --cut <slug>) [--json] [--root <project>]
|
|
30
|
+
maude design footage save (--asset <clip> | --cut <slug>) --from <file.json> [--root <project>]
|
|
31
|
+
show a clip's footage analysis (its shots), or a cut's EDL; {} when there is none yet
|
|
32
|
+
save store the analysis (or EDL) in the file, as the studio validates it; a refusal names the field
|
|
33
|
+
--asset the clip: assets/<sha8>.<ext>, or its <sha8>
|
|
34
|
+
--cut the cut's EDL slug (.design/<slug>.edl.json)
|
|
35
|
+
--from the JSON file to store (- reads stdin)
|
|
36
|
+
Exit 0 ok · 1 refused (the JSON did not validate) · 2 usage · 3 no studio running.
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
/** The words after `show` / `save` → `{ flags, query }`. Pure; throws UsageError. */
|
|
40
|
+
export function footageQuery(words, { save }) {
|
|
41
|
+
const { flags, pos } = parseWords(words, {
|
|
42
|
+
bool: save ? [] : ['--json'],
|
|
43
|
+
value: save ? ['--asset', '--cut', '--from', '--root'] : ['--asset', '--cut', '--root'],
|
|
44
|
+
});
|
|
45
|
+
if (pos.length) throw new UsageError(`unexpected ${clean(pos[0])}`);
|
|
46
|
+
const asset = flags['--asset'];
|
|
47
|
+
const cut = flags['--cut'];
|
|
48
|
+
if ((asset === undefined) === (cut === undefined))
|
|
49
|
+
throw new UsageError('give exactly one of --asset <clip> or --cut <slug>');
|
|
50
|
+
if (save && flags['--from'] === undefined) throw new UsageError('save needs --from <file.json>');
|
|
51
|
+
const q = new URLSearchParams();
|
|
52
|
+
if (asset !== undefined)
|
|
53
|
+
q.set(
|
|
54
|
+
'asset',
|
|
55
|
+
String(asset)
|
|
56
|
+
.replace(/^\.\//, '')
|
|
57
|
+
.replace(/^\.design\//, '')
|
|
58
|
+
);
|
|
59
|
+
else q.set('slug', String(cut));
|
|
60
|
+
return { flags, query: q.toString() };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function refused(r) {
|
|
64
|
+
const b = r?.body ?? {};
|
|
65
|
+
const why = clean(
|
|
66
|
+
b.error ?? b.reason ?? (r ? r.text?.trim() || `HTTP ${r.status}` : 'no answer')
|
|
67
|
+
);
|
|
68
|
+
process.stderr.write(`maude design footage: refused — ${why}\n`);
|
|
69
|
+
return 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function show(words) {
|
|
73
|
+
const { flags, query } = footageQuery(words, { save: false });
|
|
74
|
+
const c = await connect('footage', flags['--root']);
|
|
75
|
+
if (c.exit) return c.exit;
|
|
76
|
+
const r = await call(c.studio, `/_api/footage?${query}`);
|
|
77
|
+
if (r?.status !== 200 || !r.body || typeof r.body !== 'object') return refused(r);
|
|
78
|
+
// JSON.stringify escapes every control character, so the text is safe to print as it is.
|
|
79
|
+
if (flags['--json'])
|
|
80
|
+
process.stdout.write(
|
|
81
|
+
`${JSON.stringify({ untrusted: true, notice: UNTRUSTED_NOTICE, data: r.body })}\n`
|
|
82
|
+
);
|
|
83
|
+
else writeUntrusted(JSON.stringify(r.body, null, 2));
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function save(words) {
|
|
88
|
+
const { flags, query } = footageQuery(words, { save: true });
|
|
89
|
+
const from = flags['--from'];
|
|
90
|
+
let text;
|
|
91
|
+
try {
|
|
92
|
+
text = readFileSync(from === '-' ? 0 : from, 'utf8');
|
|
93
|
+
} catch {
|
|
94
|
+
throw new UsageError(`cannot read ${clean(from)}`);
|
|
95
|
+
}
|
|
96
|
+
let json;
|
|
97
|
+
try {
|
|
98
|
+
json = JSON.parse(text);
|
|
99
|
+
} catch {
|
|
100
|
+
throw new UsageError(`${clean(from)} is not JSON`);
|
|
101
|
+
}
|
|
102
|
+
const c = await connect('footage', flags['--root']);
|
|
103
|
+
if (c.exit) return c.exit;
|
|
104
|
+
const r = await call(c.studio, `/_api/footage?${query}`, { method: 'PUT', json });
|
|
105
|
+
if (r?.status === 200 && r.body?.ok) {
|
|
106
|
+
process.stdout.write(`→ saved ${query.startsWith('asset=') ? 'the analysis' : 'the EDL'}\n`);
|
|
107
|
+
return 0;
|
|
108
|
+
}
|
|
109
|
+
return refused(r);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const SUBS = { show, save };
|
|
113
|
+
|
|
114
|
+
if (import.meta.main) {
|
|
115
|
+
runVerb('footage', USAGE, async (words) => {
|
|
116
|
+
const sub = words[0];
|
|
117
|
+
if (!sub || !Object.hasOwn(SUBS, sub))
|
|
118
|
+
throw new UsageError(
|
|
119
|
+
sub ? `unknown sub-verb ${clean(sub)}` : 'name a sub-verb: show or save'
|
|
120
|
+
);
|
|
121
|
+
return SUBS[sub](words.slice(1));
|
|
122
|
+
});
|
|
123
|
+
}
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
launchChromium,
|
|
30
30
|
newShellContext,
|
|
31
31
|
safeArtboardFilename,
|
|
32
|
+
settleForCapture,
|
|
32
33
|
} from './_pw-launch.mjs';
|
|
33
34
|
import { layoutRegion, parseRegionArg } from './_region.mjs';
|
|
34
35
|
|
|
@@ -120,6 +121,11 @@ try {
|
|
|
120
121
|
const box = await layoutRegion(page, region);
|
|
121
122
|
assertRenderOutputSizeOk(box.width, box.height, deviceScaleFactor, '_pdf-playwright');
|
|
122
123
|
await page.setViewportSize({ width: Math.max(1, box.width), height: Math.max(1, box.height) });
|
|
124
|
+
// B3 — the region spans artboards that were off screen until now; settle all of them.
|
|
125
|
+
const restoreCulling = await settleForCapture(page.locator('.dc-world').first(), {
|
|
126
|
+
budgetMs: timeoutMs,
|
|
127
|
+
label: 'region',
|
|
128
|
+
});
|
|
123
129
|
const pdf = await page.pdf({
|
|
124
130
|
width: `${box.width}px`,
|
|
125
131
|
height: `${box.height}px`,
|
|
@@ -129,6 +135,7 @@ try {
|
|
|
129
135
|
});
|
|
130
136
|
writeFileSync(out, pdf);
|
|
131
137
|
written.push(out);
|
|
138
|
+
await restoreCulling();
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
for (let i = 0; i < (region ? 0 : screens.length); i += 1) {
|
|
@@ -174,6 +181,12 @@ try {
|
|
|
174
181
|
el.scrollIntoView({ block: 'start', inline: 'start' });
|
|
175
182
|
window.scrollTo(0, 0);
|
|
176
183
|
});
|
|
184
|
+
// B3 — an artboard that started off screen was never laid out (content-visibility), so its
|
|
185
|
+
// webfont was never requested and its pictures may still be loading: settle it first.
|
|
186
|
+
const restoreCulling = await settleForCapture(handle, {
|
|
187
|
+
budgetMs: timeoutMs,
|
|
188
|
+
label: screenId ?? `artboard ${i + 1}`,
|
|
189
|
+
});
|
|
177
190
|
const pdf = await page.pdf({
|
|
178
191
|
width: `${Math.ceil(rect.w)}px`,
|
|
179
192
|
height: `${Math.ceil(rect.h)}px`,
|
|
@@ -183,6 +196,7 @@ try {
|
|
|
183
196
|
});
|
|
184
197
|
writeFileSync(targetPath, pdf);
|
|
185
198
|
written.push(targetPath);
|
|
199
|
+
await restoreCulling();
|
|
186
200
|
// Restore the artboard's original position now that its page is written.
|
|
187
201
|
await handle.evaluate((el, prev) => {
|
|
188
202
|
const ab = el.closest('[data-dc-screen]') ?? el;
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
// viewport exactly and crop to the target element's bounding box.
|
|
7
7
|
|
|
8
8
|
import { mkdirSync } from 'node:fs';
|
|
9
|
-
import { dirname, join } from 'node:path';
|
|
9
|
+
import { basename, dirname, join } from 'node:path';
|
|
10
10
|
import {
|
|
11
11
|
afterPaint,
|
|
12
12
|
launchChromium,
|
|
13
13
|
newShellContext,
|
|
14
14
|
safeArtboardFilename,
|
|
15
|
+
settleForCapture,
|
|
15
16
|
} from './_pw-launch.mjs';
|
|
16
17
|
import { layoutRegion, parseRegionArg } from './_region.mjs';
|
|
17
18
|
|
|
@@ -206,6 +207,12 @@ try {
|
|
|
206
207
|
const vp = page.viewportSize();
|
|
207
208
|
const clipX = Math.min(Math.max(0, Math.floor(finalRect.x)), Math.max(0, vp.width - 1));
|
|
208
209
|
const clipY = Math.min(Math.max(0, Math.floor(finalRect.y)), Math.max(0, vp.height - 1));
|
|
210
|
+
// B3 — an artboard that started off screen was never laid out (content-visibility), so its
|
|
211
|
+
// webfont was never requested and its pictures may still be loading: settle it first.
|
|
212
|
+
const restoreCulling = await settleForCapture(widenedHandle, {
|
|
213
|
+
budgetMs: timeoutMs,
|
|
214
|
+
label: basename(target),
|
|
215
|
+
});
|
|
209
216
|
// Shoot a frame painted at this size and position, never the previous surface (afterPaint).
|
|
210
217
|
await afterPaint(page);
|
|
211
218
|
await page.screenshot({
|
|
@@ -219,6 +226,7 @@ try {
|
|
|
219
226
|
},
|
|
220
227
|
});
|
|
221
228
|
written.push(target);
|
|
229
|
+
await restoreCulling();
|
|
222
230
|
// Restore the artboard's original position now that its capture is done,
|
|
223
231
|
// so it doesn't stay pinned at (0,0) and corrupt the next target's clip.
|
|
224
232
|
await widenedHandle.evaluate((el, prev) => {
|
|
@@ -239,6 +247,11 @@ try {
|
|
|
239
247
|
const box = await layoutRegion(page, region);
|
|
240
248
|
assertOutputSizeOk(box.width, box.height);
|
|
241
249
|
await page.setViewportSize({ width: Math.max(1, box.width), height: Math.max(1, box.height) });
|
|
250
|
+
// B3 — the region spans artboards that were off screen until now; settle all of them.
|
|
251
|
+
const restoreCulling = await settleForCapture(page.locator('.dc-world').first(), {
|
|
252
|
+
budgetMs: timeoutMs,
|
|
253
|
+
label: 'region',
|
|
254
|
+
});
|
|
242
255
|
// Shoot a frame painted at this size and position, never the previous surface (afterPaint).
|
|
243
256
|
await afterPaint(page);
|
|
244
257
|
await page.screenshot({
|
|
@@ -247,6 +260,7 @@ try {
|
|
|
247
260
|
clip: { x: 0, y: 0, width: box.width, height: box.height },
|
|
248
261
|
});
|
|
249
262
|
written.push(out);
|
|
263
|
+
await restoreCulling();
|
|
250
264
|
} else if (multi) {
|
|
251
265
|
if (!outDir) {
|
|
252
266
|
console.error('_png-playwright: --multi requires --out-dir');
|
|
@@ -192,6 +192,104 @@ export async function afterPaint(page) {
|
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
// B3 (fix-bulk 2026-11-10) — settle ONE capture target, right before its shot.
|
|
196
|
+
//
|
|
197
|
+
// Every `.dc-artboard-body` is `content-visibility: auto` (canvas-lib, the pan/zoom jank fix), so
|
|
198
|
+
// an artboard outside the viewport is neither laid out nor painted. The canvas mounts after
|
|
199
|
+
// `load`, so nothing about such an artboard is ready when the shim starts: its webfont has never
|
|
200
|
+
// been requested (the one `document.fonts.ready` awaited after load resolved without it) and its
|
|
201
|
+
// pictures may still be on the wire. A multi-page Print PDF of LetakA6 lost the photos and the
|
|
202
|
+
// colour font of exactly the artboard that started below the viewport; a warm re-run was fine.
|
|
203
|
+
//
|
|
204
|
+
// So, for the target's own artboard (or, for a region, the element given — the world plane):
|
|
205
|
+
// 1. render it now — `content-visibility: visible !important` on its culled bodies, restored
|
|
206
|
+
// by the returned function (set through CSSOM, which the canvas CSP allows);
|
|
207
|
+
// 2. lay it out, then wait until no font face is loading (re-checked after a frame: a face is
|
|
208
|
+
// requested only once text that needs it is shaped);
|
|
209
|
+
// 3. wait for every `<img>` (lazy ones made eager) to load or fail, then `decode()` it, and
|
|
210
|
+
// `decode()` every SVG `<image>`;
|
|
211
|
+
// 4. two frames, so the shot carries what was just decoded (`afterPaint`).
|
|
212
|
+
// Bounded by `budgetMs`: a picture that never arrives costs one budget and the shot goes ahead
|
|
213
|
+
// (the old behaviour) with a line on stderr, never a hung export.
|
|
214
|
+
//
|
|
215
|
+
// @param {import('playwright').ElementHandle | import('playwright').Locator} handle
|
|
216
|
+
// @param {{ budgetMs?: number, label?: string }} [opts]
|
|
217
|
+
// @returns {Promise<() => Promise<void>>} restores the culling it lifted
|
|
218
|
+
export async function settleForCapture(handle, opts = {}) {
|
|
219
|
+
const budgetMs = Math.max(1000, Math.min(60_000, opts.budgetMs ?? 15_000));
|
|
220
|
+
const result = await handle.evaluateHandle(async (el, budget) => {
|
|
221
|
+
const root = el.closest('[data-dc-screen]') ?? el;
|
|
222
|
+
const lifted = [];
|
|
223
|
+
const candidates = [
|
|
224
|
+
root,
|
|
225
|
+
...root.querySelectorAll('.dc-artboard-body, [style*="content-visibility"]'),
|
|
226
|
+
];
|
|
227
|
+
for (const node of candidates) {
|
|
228
|
+
if (getComputedStyle(node).contentVisibility === 'visible') continue;
|
|
229
|
+
lifted.push({
|
|
230
|
+
node,
|
|
231
|
+
value: node.style.getPropertyValue('content-visibility'),
|
|
232
|
+
priority: node.style.getPropertyPriority('content-visibility'),
|
|
233
|
+
});
|
|
234
|
+
node.style.setProperty('content-visibility', 'visible', 'important');
|
|
235
|
+
}
|
|
236
|
+
root.getBoundingClientRect(); // lay it out now, so the faces its text needs are requested
|
|
237
|
+
|
|
238
|
+
const frame = () => new Promise((r) => requestAnimationFrame(() => r()));
|
|
239
|
+
const settle = async () => {
|
|
240
|
+
for (const img of root.querySelectorAll('img')) {
|
|
241
|
+
if (img.loading === 'lazy') img.loading = 'eager';
|
|
242
|
+
}
|
|
243
|
+
for (let round = 0; round < 3; round += 1) {
|
|
244
|
+
await document.fonts.ready;
|
|
245
|
+
const loading = [...document.fonts].filter((f) => f.status === 'loading');
|
|
246
|
+
await Promise.all(loading.map((f) => f.loaded.catch(() => {})));
|
|
247
|
+
await Promise.all(
|
|
248
|
+
[...root.querySelectorAll('img')].map(async (img) => {
|
|
249
|
+
if (!img.complete) {
|
|
250
|
+
await new Promise((r) => {
|
|
251
|
+
img.addEventListener('load', r, { once: true });
|
|
252
|
+
img.addEventListener('error', r, { once: true });
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
if (img.naturalWidth > 0) await img.decode().catch(() => {});
|
|
256
|
+
})
|
|
257
|
+
);
|
|
258
|
+
await Promise.all(
|
|
259
|
+
[...root.querySelectorAll('image')].map((im) =>
|
|
260
|
+
typeof im.decode === 'function' ? im.decode().catch(() => {}) : null
|
|
261
|
+
)
|
|
262
|
+
);
|
|
263
|
+
await frame();
|
|
264
|
+
if (![...document.fonts].some((f) => f.status === 'loading')) break;
|
|
265
|
+
}
|
|
266
|
+
await frame();
|
|
267
|
+
await frame();
|
|
268
|
+
return true;
|
|
269
|
+
};
|
|
270
|
+
const settled = await Promise.race([
|
|
271
|
+
settle(),
|
|
272
|
+
new Promise((r) => setTimeout(() => r(false), budget)),
|
|
273
|
+
]);
|
|
274
|
+
return { settled, lifted };
|
|
275
|
+
}, budgetMs);
|
|
276
|
+
const settled = await (await result.getProperty('settled')).jsonValue();
|
|
277
|
+
if (!settled) {
|
|
278
|
+
console.error(
|
|
279
|
+
`capture: ${opts.label ?? 'target'} still had fonts or pictures loading after ${budgetMs} ms — shooting it anyway`
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
return async () => {
|
|
283
|
+
await result.evaluate(({ lifted }) => {
|
|
284
|
+
for (const { node, value, priority } of lifted) {
|
|
285
|
+
if (value) node.style.setProperty('content-visibility', value, priority);
|
|
286
|
+
else node.style.removeProperty('content-visibility');
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
await result.dispose();
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
195
293
|
// Shared by every raster-capture export shim (_png/_pdf-playwright.mjs) that
|
|
196
294
|
// scales its render surface by `deviceScaleFactor` (feature-2-print-artboards
|
|
197
295
|
// T4's DPI support). The requested pixel output is only knowable once the
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Internal shim behind retry-save.sh (`maude design retry-save`).
|
|
2
|
+
//
|
|
3
|
+
// Retry on the "Not saved — this Mac is out of space" status (S11.17): the canvas writes a full disk
|
|
4
|
+
// held try to land now (POST /_api/diagnostics/disk-retry → { landed, held, full }). They also land by
|
|
5
|
+
// themselves once there is room; an agent frees space first, then retries (fix-bulk 2026-11-10
|
|
6
|
+
// follow-up). An agent's own writes go straight to the files and are never held here.
|
|
7
|
+
//
|
|
8
|
+
// Why a verb and not `curl-local`: since 2.1.0 the studio's main origin needs its key from every caller
|
|
9
|
+
// (contract sec-loopback-bearer §7). `curl-local` sends none, by design; this finds the studio and its
|
|
10
|
+
// key the way every verb does (studio-locate.mjs).
|
|
11
|
+
|
|
12
|
+
import { call, clean, connect, parseWords, runVerb, UsageError } from './_studio-verb.mjs';
|
|
13
|
+
|
|
14
|
+
export const USAGE = `usage: maude design retry-save [--json] [--root <project>]
|
|
15
|
+
The saves this Mac held because its disk was full try to land now, as Retry on the "Not saved"
|
|
16
|
+
status does. Free some space first; they also land by themselves once there is room.
|
|
17
|
+
Exit 0 nothing is held any more · 1 some are still held / the studio refused · 2 usage · 3 no studio running.
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
async function main(words) {
|
|
21
|
+
const { flags, pos } = parseWords(words, { bool: ['--json'], value: ['--root'] });
|
|
22
|
+
if (pos.length) throw new UsageError('retry-save takes no operand');
|
|
23
|
+
const c = await connect('retry-save', flags['--root']);
|
|
24
|
+
if (c.exit) return c.exit;
|
|
25
|
+
const r = await call(c.studio, '/_api/diagnostics/disk-retry', { method: 'POST' });
|
|
26
|
+
const b = r?.body ?? {};
|
|
27
|
+
if (r?.status !== 200 || !Number.isFinite(b.held)) {
|
|
28
|
+
const why = clean(
|
|
29
|
+
b.reason ?? b.error ?? (r ? r.text?.trim() || `HTTP ${r.status}` : 'no answer')
|
|
30
|
+
);
|
|
31
|
+
process.stderr.write(`maude design retry-save: refused — ${why}\n`);
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
const out = { landed: Number(b.landed) || 0, held: b.held, full: b.held > 0 };
|
|
35
|
+
if (flags['--json']) process.stdout.write(`${JSON.stringify(out)}\n`);
|
|
36
|
+
else if (out.held === 0)
|
|
37
|
+
process.stdout.write(
|
|
38
|
+
out.landed
|
|
39
|
+
? `→ ${out.landed} held saves landed\n`
|
|
40
|
+
: '→ nothing was held — every save is on disk\n'
|
|
41
|
+
);
|
|
42
|
+
else
|
|
43
|
+
process.stdout.write(
|
|
44
|
+
`· ${out.landed} landed, ${out.held} still held — the disk is still full; free some space and retry\n`
|
|
45
|
+
);
|
|
46
|
+
return out.held === 0 ? 0 : 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (import.meta.main) runVerb('retry-save', USAGE, main);
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
// same sentence the toast shows (effect shared → prompt: it re-compares every file with the
|
|
9
9
|
// cloud copy and sends what is newer here). Nothing is overwritten.
|
|
10
10
|
//
|
|
11
|
+
// Sync details' own buttons (fix-bulk 2026-11-10 follow-up — they were taught as `curl-local` recipes,
|
|
12
|
+
// which a keyed studio answers 401, sec-loopback-bearer §7; `call` sends the studio's key). Each falls
|
|
13
|
+
// to the `sync` tier entry (prompt), as the recipes did:
|
|
14
|
+
// compare <canvas> GET /_api/project/conflict?file= a held source conflict's two sides
|
|
15
|
+
// keep-mine|use-theirs|keep-both <canvas>
|
|
16
|
+
// POST /_api/project/conflict { file, choice }
|
|
17
|
+
// publish-ai-edit|discard-ai-edit [--run <id>]
|
|
18
|
+
// POST /_api/project/ai-action { choice, runId? }
|
|
19
|
+
// cancel-transfer POST /_api/sync/cancel-assets stops the picture/video transfer
|
|
20
|
+
//
|
|
11
21
|
// Hub URLs, file names and conflict paths come from a peer or a config: only counts, the word and the
|
|
12
22
|
// hub's host are printed, inside the untrusted block (`--json` carries `untrusted: true`).
|
|
13
23
|
|
|
@@ -19,7 +29,10 @@ import {
|
|
|
19
29
|
} from '../client/v2/diagnostics/resync-model.js';
|
|
20
30
|
import {
|
|
21
31
|
call,
|
|
32
|
+
clean,
|
|
33
|
+
cleanLines,
|
|
22
34
|
connect,
|
|
35
|
+
DESIGN_REL,
|
|
23
36
|
field,
|
|
24
37
|
parseWords,
|
|
25
38
|
runVerb,
|
|
@@ -30,11 +43,23 @@ import {
|
|
|
30
43
|
|
|
31
44
|
export const USAGE = `usage: maude design sync status [--json] [--root <project>]
|
|
32
45
|
maude design sync resync [--no-wait] [--json] [--root <project>]
|
|
46
|
+
maude design sync compare <canvas> [--json] [--root <project>]
|
|
47
|
+
maude design sync keep-mine|use-theirs|keep-both <canvas> [--json] [--root <project>]
|
|
48
|
+
maude design sync publish-ai-edit|discard-ai-edit [--run <id>] [--json] [--root <project>]
|
|
49
|
+
maude design sync cancel-transfer [--json] [--root <project>]
|
|
33
50
|
status Sync in one word (Up to date · Syncing… · Offline · Needs you · Local project), the hub's
|
|
34
51
|
host, the file counts, and the last resync's result
|
|
35
52
|
resync compare every file with the cloud copy: what is newer here is sent, what is newer there is
|
|
36
53
|
fetched, a file changed on both sides becomes a conflict in Sync details. Nothing is
|
|
37
54
|
overwritten. Waits and prints the result; --no-wait only starts it.
|
|
55
|
+
compare a held source conflict's two versions: this Mac's and the project's (Sync details › Compare)
|
|
56
|
+
keep-mine · use-theirs · keep-both
|
|
57
|
+
answer a held source conflict, as its card does; keep-both keeps this Mac's version as a
|
|
58
|
+
new canvas "<name> this Mac". <canvas> is the canvas path or the slug \`sync status\` names.
|
|
59
|
+
publish-ai-edit · discard-ai-edit
|
|
60
|
+
the answer to an unfinished AI edit held from the project (--run: that run only)
|
|
61
|
+
cancel-transfer
|
|
62
|
+
stops the picture and video transfer that is running (it starts again on the next sync)
|
|
38
63
|
Exit 0 ok · 1 sync is not running / the studio refused / it stopped early · 2 usage · 3 no studio running.
|
|
39
64
|
`;
|
|
40
65
|
|
|
@@ -167,13 +192,131 @@ async function resync(words) {
|
|
|
167
192
|
return view.state === 'done' ? 0 : 1;
|
|
168
193
|
}
|
|
169
194
|
|
|
170
|
-
|
|
195
|
+
function refused(r) {
|
|
196
|
+
const b = r?.body ?? {};
|
|
197
|
+
const why =
|
|
198
|
+
b.error ||
|
|
199
|
+
b.detail ||
|
|
200
|
+
b.code ||
|
|
201
|
+
b.status ||
|
|
202
|
+
(r ? r.text?.trim() || `HTTP ${r.status}` : 'no answer');
|
|
203
|
+
process.stderr.write(`maude design sync: refused — ${field(why)}\n`);
|
|
204
|
+
return 1;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** `<canvas>`: a canvas path (design-root-relative, or `.design/…`) or a conflict slug → what the
|
|
208
|
+
* route takes (a repo-relative path, or the slug). Pure; throws UsageError. */
|
|
209
|
+
export function conflictOperand(word) {
|
|
210
|
+
const w = String(word ?? '').replace(/^\.\//, '');
|
|
211
|
+
if (!w || w.startsWith('/') || w.split('/').includes('..') || w.length > 512)
|
|
212
|
+
throw new UsageError(`${clean(word)} is not a canvas path or a conflict slug`);
|
|
213
|
+
return /\.(tsx|html)$/i.test(w) && !w.startsWith(`${DESIGN_REL}/`) ? `${DESIGN_REL}/${w}` : w;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async function compare(words) {
|
|
217
|
+
const { flags, pos } = parseWords(words, { bool: ['--json'], value: ['--root'] });
|
|
218
|
+
if (pos.length !== 1) throw new UsageError('compare takes one canvas');
|
|
219
|
+
const file = conflictOperand(pos[0]);
|
|
220
|
+
const c = await connect('sync', flags['--root']);
|
|
221
|
+
if (c.exit) return c.exit;
|
|
222
|
+
const r = await call(c.studio, `/_api/project/conflict?file=${encodeURIComponent(file)}`);
|
|
223
|
+
const b = r?.body ?? {};
|
|
224
|
+
if (r?.status !== 200 || !b.ok) return refused(r);
|
|
225
|
+
// a peer's source and this Mac's: data, never instructions
|
|
226
|
+
const out = { slug: b.slug, mine: b.mine ?? null, theirs: b.theirs ?? '' };
|
|
227
|
+
if (flags['--json']) {
|
|
228
|
+
process.stdout.write(
|
|
229
|
+
`${JSON.stringify(untrustedJson(out, { multiline: ['mine', 'theirs'] }))}\n`
|
|
230
|
+
);
|
|
231
|
+
return 0;
|
|
232
|
+
}
|
|
233
|
+
const mine = out.mine === null ? '(none: this Mac has no version of it)' : cleanLines(out.mine);
|
|
234
|
+
writeUntrusted(
|
|
235
|
+
`conflict · ${field(out.slug)}\n--- this Mac\n${mine}\n--- the project\n${cleanLines(out.theirs)}`
|
|
236
|
+
);
|
|
237
|
+
return 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const CHOICE = { 'keep-mine': 'mine', 'use-theirs': 'theirs', 'keep-both': 'keep-both' };
|
|
241
|
+
|
|
242
|
+
function resolveWith(sub) {
|
|
243
|
+
return async (words) => {
|
|
244
|
+
const { flags, pos } = parseWords(words, { bool: ['--json'], value: ['--root'] });
|
|
245
|
+
if (pos.length !== 1) throw new UsageError(`${sub} takes one canvas`);
|
|
246
|
+
const file = conflictOperand(pos[0]);
|
|
247
|
+
const c = await connect('sync', flags['--root']);
|
|
248
|
+
if (c.exit) return c.exit;
|
|
249
|
+
const r = await call(c.studio, '/_api/project/conflict', {
|
|
250
|
+
method: 'POST',
|
|
251
|
+
json: { file, choice: CHOICE[sub] },
|
|
252
|
+
timeoutMs: 30_000,
|
|
253
|
+
});
|
|
254
|
+
const b = r?.body ?? {};
|
|
255
|
+
if (r?.status !== 200 || !b.ok) return refused(r);
|
|
256
|
+
if (flags['--json']) process.stdout.write(`${JSON.stringify(b)}\n`);
|
|
257
|
+
else process.stdout.write(`→ ${sub}: ${field(b.status ?? 'done')}\n`);
|
|
258
|
+
return 0;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function aiEdit(choice) {
|
|
263
|
+
return async (words) => {
|
|
264
|
+
const { flags, pos } = parseWords(words, { bool: ['--json'], value: ['--run', '--root'] });
|
|
265
|
+
if (pos.length) throw new UsageError(`${choice}-ai-edit takes no operand`);
|
|
266
|
+
const body = { choice };
|
|
267
|
+
if (flags['--run'] !== undefined) {
|
|
268
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(flags['--run'])) throw new UsageError('--run is a run id');
|
|
269
|
+
body.runId = flags['--run'];
|
|
270
|
+
}
|
|
271
|
+
const c = await connect('sync', flags['--root']);
|
|
272
|
+
if (c.exit) return c.exit;
|
|
273
|
+
const r = await call(c.studio, '/_api/project/ai-action', {
|
|
274
|
+
method: 'POST',
|
|
275
|
+
json: body,
|
|
276
|
+
timeoutMs: 30_000,
|
|
277
|
+
});
|
|
278
|
+
const b = r?.body ?? {};
|
|
279
|
+
if (r?.status !== 200 || !b.ok) return refused(r);
|
|
280
|
+
if (flags['--json']) process.stdout.write(`${JSON.stringify(b)}\n`);
|
|
281
|
+
else
|
|
282
|
+
process.stdout.write(`→ ${choice === 'publish' ? 'published' : 'discarded'} the AI edit\n`);
|
|
283
|
+
return 0;
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
async function cancelTransfer(words) {
|
|
288
|
+
const { flags, pos } = parseWords(words, { bool: ['--json'], value: ['--root'] });
|
|
289
|
+
if (pos.length) throw new UsageError('cancel-transfer takes no operand');
|
|
290
|
+
const c = await connect('sync', flags['--root']);
|
|
291
|
+
if (c.exit) return c.exit;
|
|
292
|
+
const r = await call(c.studio, '/_api/sync/cancel-assets', { method: 'POST' });
|
|
293
|
+
const b = r?.body ?? {};
|
|
294
|
+
if (r?.status !== 200 || !b.ok) return refused(r);
|
|
295
|
+
if (flags['--json']) process.stdout.write(`${JSON.stringify({ cancelled: !!b.cancelled })}\n`);
|
|
296
|
+
else
|
|
297
|
+
process.stdout.write(b.cancelled ? '→ the transfer stopped\n' : '→ no transfer was running\n');
|
|
298
|
+
return 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const SUBS = {
|
|
302
|
+
status,
|
|
303
|
+
resync,
|
|
304
|
+
compare,
|
|
305
|
+
'keep-mine': resolveWith('keep-mine'),
|
|
306
|
+
'use-theirs': resolveWith('use-theirs'),
|
|
307
|
+
'keep-both': resolveWith('keep-both'),
|
|
308
|
+
'publish-ai-edit': aiEdit('publish'),
|
|
309
|
+
'discard-ai-edit': aiEdit('discard'),
|
|
310
|
+
'cancel-transfer': cancelTransfer,
|
|
311
|
+
};
|
|
171
312
|
|
|
172
313
|
if (import.meta.main) {
|
|
173
314
|
runVerb('sync', USAGE, async (words) => {
|
|
174
315
|
const sub = words[0];
|
|
175
316
|
if (!sub || !Object.hasOwn(SUBS, sub))
|
|
176
|
-
throw new UsageError(
|
|
317
|
+
throw new UsageError(
|
|
318
|
+
sub ? `unknown sub-verb ${clean(sub)}` : `name a sub-verb: ${Object.keys(SUBS).join(', ')}`
|
|
319
|
+
);
|
|
177
320
|
return SUBS[sub](words.slice(1));
|
|
178
321
|
});
|
|
179
322
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# asset-rename.sh — `maude design asset-rename` (fix-bulk 2026-11-10 follow-up). Reached via `maude design
|
|
3
|
+
# asset-rename` (DDR-062), never a raw bin path. The Assets panel's Rename… (POST /_api/assets/rename),
|
|
4
|
+
# sent with the studio's key — see _asset-file.mjs. Exit 0 ok · 1 refused · 2 usage · 3 no studio.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
|
|
7
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
8
|
+
echo "asset-rename.sh: bun is required (hard dependency — see plugins/design/dependencies.json)." >&2
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
exec bun run "$SCRIPT_DIR/_asset-file.mjs" rename "$@"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# asset-trash.sh — `maude design asset-trash` (fix-bulk 2026-11-10 follow-up). Reached via `maude design
|
|
3
|
+
# asset-trash` (DDR-062), never a raw bin path. The Assets panel's Move to trash (POST /_api/assets/trash),
|
|
4
|
+
# sent with the studio's key — see _asset-file.mjs. Exit 0 ok · 1 refused · 2 usage · 3 no studio.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
|
|
7
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
8
|
+
echo "asset-trash.sh: bun is required (hard dependency — see plugins/design/dependencies.json)." >&2
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
exec bun run "$SCRIPT_DIR/_asset-file.mjs" trash "$@"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# canvas-move.sh — `maude design canvas-move` (fix-bulk W1 follow-up). Reached via `maude design
|
|
3
|
+
# canvas-move` (DDR-062), never a raw bin path. The studio's own rename / move (POST /_api/fs-move),
|
|
4
|
+
# sent with the studio's key — see _canvas-file.mjs. Exit 0 ok · 1 refused · 2 usage · 3 no studio.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
|
|
7
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
8
|
+
echo "canvas-move.sh: bun is required (hard dependency — see plugins/design/dependencies.json)." >&2
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
exec bun run "$SCRIPT_DIR/_canvas-file.mjs" move "$@"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# canvas-new.sh — `maude design canvas-new` (fix-bulk W1 follow-up). Reached via `maude design
|
|
3
|
+
# canvas-new` (DDR-062), never a raw bin path. The studio's own create (POST /_api/canvas), sent with
|
|
4
|
+
# the studio's key — see _canvas-file.mjs. Exit 0 ok · 1 refused · 2 usage · 3 no studio running.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
|
|
7
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
8
|
+
echo "canvas-new.sh: bun is required (hard dependency — see plugins/design/dependencies.json)." >&2
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
exec bun run "$SCRIPT_DIR/_canvas-file.mjs" new "$@"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# footage.sh — `maude design footage show|save` (fix-bulk 2026-11-10 follow-up). Reached via `maude design
|
|
3
|
+
# footage` (DDR-062), never a raw bin path. A clip's footage analysis or a cut's EDL (GET / PUT
|
|
4
|
+
# /_api/footage), sent with the studio's key — see _footage.mjs. Exit 0 ok · 1 refused · 2 usage · 3 no studio.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
|
|
7
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
8
|
+
echo "footage.sh: bun is required (hard dependency — see plugins/design/dependencies.json)." >&2
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
exec bun run "$SCRIPT_DIR/_footage.mjs" "$@"
|
|
@@ -178,6 +178,13 @@ JOB_ID=$(printf '%s' "$RESP" | jq -r '.jobId // empty' 2>/dev/null || echo "")
|
|
|
178
178
|
if [ -z "$JOB_ID" ]; then
|
|
179
179
|
REASON=$(printf '%s' "$RESP" | jq -r '.reason // empty' 2>/dev/null || echo "")
|
|
180
180
|
MSG=$(printf '%s' "$RESP" | jq -r '.message // empty' 2>/dev/null || echo "")
|
|
181
|
+
# #218 — the studio refused THIS helper (its own local access key was missing or wrong), before
|
|
182
|
+
# any provider was asked. Never word it as a provider key: the person's Gemini key was never read.
|
|
183
|
+
case "$(printf '%s' "$RESP" | jq -r '.error // empty' 2>/dev/null || echo "")" in
|
|
184
|
+
api-key-required|api-key-invalid)
|
|
185
|
+
echo "generate.sh: Maude's project server refused this command: it could not prove it runs on this Mac for this project. This is not your provider key — that was never read. Run the command again as it is, in a fresh shell; if HOME was changed in this shell, unset that change first." >&2
|
|
186
|
+
exit 1 ;;
|
|
187
|
+
esac
|
|
181
188
|
case "$REASON" in
|
|
182
189
|
needs-confirm)
|
|
183
190
|
echo "generate.sh: $MSG" >&2
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# retry-save.sh — `maude design retry-save` (fix-bulk 2026-11-10 follow-up). Reached via `maude design
|
|
3
|
+
# retry-save` (DDR-062), never a raw bin path. Retry on the saves a full disk held (POST
|
|
4
|
+
# /_api/diagnostics/disk-retry), sent with the studio's key — see _retry-save.mjs.
|
|
5
|
+
# Exit 0 every held save landed · 1 some still held / refused · 2 usage · 3 no studio.
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
|
|
8
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
9
|
+
echo "retry-save.sh: bun is required (hard dependency — see plugins/design/dependencies.json)." >&2
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
exec bun run "$SCRIPT_DIR/_retry-save.mjs" "$@"
|