@1agh/maude 1.7.1 → 1.8.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 (49) hide show
  1. package/apps/studio/acp/bridge.ts +1 -0
  2. package/apps/studio/acp/login-state.ts +1 -0
  3. package/apps/studio/acp/probe.ts +1 -0
  4. package/apps/studio/api.ts +412 -35
  5. package/apps/studio/asset-upload.ts +174 -0
  6. package/apps/studio/assets-s3.ts +37 -2
  7. package/apps/studio/bin/_pdf-playwright.mjs +22 -1
  8. package/apps/studio/bin/_png-playwright.mjs +20 -1
  9. package/apps/studio/bin/_region.mjs +92 -0
  10. package/apps/studio/canvas-build.ts +59 -4
  11. package/apps/studio/canvas-lib.tsx +48 -1
  12. package/apps/studio/canvas-shell.tsx +28 -4
  13. package/apps/studio/client/app.jsx +109 -22
  14. package/apps/studio/client/canvas-url.js +9 -0
  15. package/apps/studio/client/embed-view.jsx +284 -0
  16. package/apps/studio/client/embed.js +101 -0
  17. package/apps/studio/client/export-center.jsx +2 -0
  18. package/apps/studio/client/github.js +36 -3
  19. package/apps/studio/client/report-bug.jsx +8 -2
  20. package/apps/studio/context.ts +7 -0
  21. package/apps/studio/dist/client.bundle.js +2682 -2682
  22. package/apps/studio/dist/comment-mount.js +2 -2
  23. package/apps/studio/embed-origins.ts +52 -0
  24. package/apps/studio/export-dialog.tsx +55 -3
  25. package/apps/studio/exporters/format-scopes.ts +11 -3
  26. package/apps/studio/exporters/index.ts +17 -2
  27. package/apps/studio/exporters/jobs.ts +16 -8
  28. package/apps/studio/exporters/pdf.ts +10 -2
  29. package/apps/studio/exporters/png.ts +10 -2
  30. package/apps/studio/exporters/scope.ts +74 -3
  31. package/apps/studio/generation/runtime-probe.ts +1 -1
  32. package/apps/studio/git/service.ts +1 -0
  33. package/apps/studio/http.ts +186 -13
  34. package/apps/studio/input-router.tsx +7 -1
  35. package/apps/studio/path-containment.ts +72 -0
  36. package/apps/studio/paths.ts +14 -1
  37. package/apps/studio/read-only-mode.ts +53 -0
  38. package/apps/studio/server.ts +9 -0
  39. package/apps/studio/sync/index.ts +74 -13
  40. package/apps/studio/sync/park.ts +39 -0
  41. package/apps/studio/sync/presentation.ts +9 -3
  42. package/apps/studio/sync/writer-registry.ts +5 -0
  43. package/apps/studio/use-canvas-media-drop.tsx +8 -28
  44. package/apps/studio/whats-new.json +27 -0
  45. package/cli/commands/design.mjs +9 -2
  46. package/cli/commands/hub-workspace.mjs +25 -0
  47. package/cli/lib/workspace-plan.mjs +51 -0
  48. package/package.json +9 -9
  49. package/plugins/design/templates/_shell.html +58 -0
@@ -155,17 +155,50 @@ export const saveExport = (filename, jobId) => invoke('save_export', { filename,
155
155
  /**
156
156
  * Native "open file" for media upload — the read counterpart to saveExport.
157
157
  * WKWebView won't present the file panel for an HTML <input type=file>, so the
158
- * AssetPicker uses this in the desktop app. Returns { name, bytes:[...] } or null
159
- * (cancelled). Browser build uses the <input type=file> path instead.
158
+ * AssetPicker uses this in the desktop app. Returns `{ token, name, size }` or
159
+ * null (cancelled) — never the bytes: read them with {@link pickedMediaSource}.
160
+ * Browser build uses the <input type=file> path instead.
160
161
  */
161
162
  export const pickMediaFile = () => invoke('pick_media_file');
162
163
 
163
164
  /**
164
165
  * feature-bulk-media-insert — multi-select counterpart to pickMediaFile.
165
- * Resolves to `[{name, bytes:[...]}, ...]` (empty array if cancelled).
166
+ * Resolves to `[{ token, name, size }, ...]` (empty array if cancelled).
166
167
  */
167
168
  export const pickMediaFiles = () => invoke('pick_media_files');
168
169
 
170
+ /**
171
+ * A picked file as an upload source (`asset-upload.ts` ChunkSource): bytes are
172
+ * read one slice at a time as a raw ArrayBuffer over IPC, so a 500 MB clip is
173
+ * never held whole in the page. Call `release()` when the upload is done.
174
+ */
175
+ export function pickedMediaSource(ref, type) {
176
+ return {
177
+ size: ref.size,
178
+ type: type || '',
179
+ name: ref.name,
180
+ async read(start, end) {
181
+ const buf = await invoke('read_picked_media', {
182
+ token: ref.token,
183
+ offset: start,
184
+ len: end - start,
185
+ });
186
+ return new Uint8Array(buf);
187
+ },
188
+ release: () => invoke('release_picked_media', { token: ref.token }).catch(() => {}),
189
+ };
190
+ }
191
+
192
+ /** A small picked file read whole (screenshots). Releases the pick. */
193
+ export async function readPickedMediaBlob(ref, type) {
194
+ const src = pickedMediaSource(ref, type);
195
+ try {
196
+ return new Blob([await src.read(0, ref.size)], type ? { type } : undefined);
197
+ } finally {
198
+ src.release();
199
+ }
200
+ }
201
+
169
202
  // ── Tauri shell: auto-update (Phase 32 / Task 1) ────────────────────────────────
170
203
  // The shell downloads + stages a newer build in the background and emits
171
204
  // `update-ready` with { version, notes }. The client shows a banner; clicking
@@ -14,7 +14,13 @@
14
14
 
15
15
  import React, { useCallback, useEffect, useRef, useState } from 'react';
16
16
 
17
- import { invoke, isNativeApp, openGitHubUrl, pickMediaFile } from './github.js';
17
+ import {
18
+ invoke,
19
+ isNativeApp,
20
+ openGitHubUrl,
21
+ pickMediaFile,
22
+ readPickedMediaBlob,
23
+ } from './github.js';
18
24
 
19
25
  // Two of these are auto-captured (window + artboard), so the ceiling leaves
20
26
  // room for the user to still attach their own.
@@ -207,7 +213,7 @@ export function ReportBugDialog({ open, onClose, activeCanvas = null }) {
207
213
  if (isNativeApp()) {
208
214
  try {
209
215
  const picked = await pickMediaFile();
210
- if (picked?.bytes) addShotBlob(new Blob([new Uint8Array(picked.bytes)]), 'attached');
216
+ if (picked) addShotBlob(await readPickedMediaBlob(picked), 'attached');
211
217
  } catch {
212
218
  /* cancelled or dialog failure — paste (⌘V) still works */
213
219
  }
@@ -226,6 +226,13 @@ export interface Context {
226
226
  * origin's `frame-ancestors`. Undefined in tests / before boot.
227
227
  */
228
228
  mainOrigin?: string;
229
+ /**
230
+ * DDR-247 — third-party apps allowed to FRAME the studio page (and so the
231
+ * canvas shell inside it) for the read-only `?embed=1` view, parsed from
232
+ * `MAUDE_EMBED_ORIGINS` by server.ts. Framing only: never a writer, never a
233
+ * shell. Undefined / empty = nobody but the shell origins.
234
+ */
235
+ embedOrigins?: string[];
229
236
  /**
230
237
  * Phase 9.2 (DDR-064) — `MAUDE_SHARED_DOC` feature flag. When true, the
231
238
  * collab room's Y.Doc becomes the SINGLE shared doc per canvas: the