@1agh/maude 2.0.2 → 2.0.4
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/README.md +6 -5
- package/apps/studio/access/request.ts +0 -1
- package/apps/studio/acp/adapter-stderr.ts +43 -13
- package/apps/studio/acp/background-tasks.ts +155 -0
- package/apps/studio/acp/bridge.ts +44 -5
- package/apps/studio/acp/connected-fact.ts +15 -4
- package/apps/studio/acp/index.ts +14 -5
- package/apps/studio/actions/agents.ts +5 -0
- package/apps/studio/actions/defs/view.ts +12 -0
- package/apps/studio/actions.manifest.json +13 -1
- package/apps/studio/actions.parity.json +7 -1
- package/apps/studio/api.ts +31 -24
- package/apps/studio/asset-placeholder.tsx +157 -62
- package/apps/studio/bin/_png-playwright.mjs +10 -1
- package/apps/studio/bin/_pw-launch.mjs +14 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +4 -1
- package/apps/studio/boot-progress.ts +31 -0
- package/apps/studio/bridge/dgn-protocol.ts +34 -4
- package/apps/studio/canvas-build-sandbox.ts +275 -42
- package/apps/studio/canvas-build-worker.ts +10 -0
- package/apps/studio/canvas-create.ts +24 -0
- package/apps/studio/canvas-module-cache.ts +93 -0
- package/apps/studio/canvas-source/errors.ts +39 -0
- package/apps/studio/canvas-source/waiting.ts +290 -0
- package/apps/studio/client/actions/shell-key-handlers.js +5 -0
- package/apps/studio/client/app.jsx +22 -9
- package/apps/studio/client/github.js +23 -3
- package/apps/studio/client/home/home-api.js +30 -19
- package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
- package/apps/studio/client/hooks/use-shell-core.jsx +3 -0
- package/apps/studio/client/hooks/use-tabs.jsx +64 -35
- package/apps/studio/client/index-loader.ts +23 -3
- package/apps/studio/client/panels/ChatPanel.jsx +22 -37
- package/apps/studio/client/panels/DiffView.jsx +314 -248
- package/apps/studio/client/panels/TeamProjects.jsx +119 -69
- package/apps/studio/client/panels/acp-runtime.js +25 -0
- package/apps/studio/client/panels/chat-finish.js +66 -0
- package/apps/studio/client/shell/frame-cap.js +53 -0
- package/apps/studio/client/shell/viewport.jsx +9 -0
- package/apps/studio/client/styles/_index.css +2 -0
- package/apps/studio/client/tree/tree.jsx +48 -21
- package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
- package/apps/studio/client/v2/ai/StoppedDivider.jsx +2 -1
- package/apps/studio/client/v2/ai/ai-run.css +87 -3
- package/apps/studio/client/v2/ai/background-model.js +113 -0
- package/apps/studio/client/v2/ai/needs-you-store.js +2 -1
- package/apps/studio/client/v2/ai/run-api.js +7 -3
- package/apps/studio/client/v2/ai/runs-store.js +2 -1
- package/apps/studio/client/v2/annotations/vote-store.js +11 -5
- package/apps/studio/client/v2/assets/asset-state-lane.js +176 -8
- package/apps/studio/client/v2/assets/assets-bus.js +10 -8
- package/apps/studio/client/v2/assets/browse-view.jsx +2 -0
- package/apps/studio/client/v2/assets/ds-library-view.jsx +47 -0
- package/apps/studio/client/v2/assets/missing-frame.jsx +8 -4
- package/apps/studio/client/v2/assets/spotlight-model.js +75 -0
- package/apps/studio/client/v2/assets/spotlight.css +153 -0
- package/apps/studio/client/v2/assets/spotlight.jsx +199 -0
- package/apps/studio/client/v2/assets/tile-menu.jsx +3 -1
- package/apps/studio/client/v2/assets/tile.jsx +3 -0
- package/apps/studio/client/v2/assets/use-assets.js +2 -1
- package/apps/studio/client/v2/canvases/canvases-panel.jsx +13 -2
- package/apps/studio/client/v2/canvases/covers.js +11 -5
- package/apps/studio/client/v2/canvases/folder-ask.js +139 -0
- package/apps/studio/client/v2/canvases/folder-dialogs.jsx +150 -0
- package/apps/studio/client/v2/canvases/trash-canvas.js +10 -2
- package/apps/studio/client/v2/canvases/trash-queue.js +152 -0
- package/apps/studio/client/v2/canvases/use-canvas-index.js +42 -18
- package/apps/studio/client/v2/canvases/use-pins.js +2 -1
- package/apps/studio/client/v2/code/canvas-error-card.jsx +70 -5
- package/apps/studio/client/v2/code/canvas-waiting-card.jsx +128 -0
- package/apps/studio/client/v2/code/canvas-waiting.js +164 -0
- package/apps/studio/client/v2/code/code.css +67 -0
- package/apps/studio/client/v2/code/use-canvas-source.js +19 -4
- package/apps/studio/client/v2/create/NameDialog.jsx +4 -2
- package/apps/studio/client/v2/create/name-dialog.css +10 -0
- package/apps/studio/client/v2/ds/advanced-host.jsx +5 -2
- package/apps/studio/client/v2/ds/make-host.jsx +5 -2
- package/apps/studio/client/v2/ds/off-system-host.jsx +5 -2
- package/apps/studio/client/v2/ds/truth-host.jsx +5 -2
- package/apps/studio/client/v2/empty/arriving.jsx +29 -12
- package/apps/studio/client/v2/empty/empty-host.jsx +8 -2
- package/apps/studio/client/v2/empty/not-local.jsx +31 -1
- package/apps/studio/client/v2/empty/use-empty-canvas.js +10 -1
- package/apps/studio/client/v2/export/last-finished.js +2 -1
- package/apps/studio/client/v2/export/native-save.js +44 -0
- package/apps/studio/client/v2/history/git-model.js +18 -4
- package/apps/studio/client/v2/history/git-parts.jsx +60 -42
- package/apps/studio/client/v2/history/history.css +6 -0
- package/apps/studio/client/v2/left-panel/assets-panel.jsx +87 -10
- package/apps/studio/client/v2/left-panel/use-trash.js +2 -1
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +100 -33
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +51 -83
- package/apps/studio/client/v2/onboarding/onboarding-model.js +10 -6
- package/apps/studio/client/v2/present/order-notes-artboards.js +2 -1
- package/apps/studio/client/v2/search/search-recent.js +3 -1
- package/apps/studio/client/v2/search/search-remote.js +6 -4
- package/apps/studio/client/v2/settings/connections-model.js +1 -1
- package/apps/studio/client/v2/shell/menu-runner.js +1 -0
- package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
- package/apps/studio/client/v2/shell/recovery-store.js +2 -1
- package/apps/studio/client/v2/shell/served-routes.js +120 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +2 -1
- package/apps/studio/client/v2/shell/shell-activity.js +19 -0
- package/apps/studio/client/v2/shell/use-occluded-insets.js +3 -0
- package/apps/studio/client/v2/sync-states/conflict-card.jsx +7 -2
- package/apps/studio/client/v2/undo/use-undo-projection.jsx +3 -1
- package/apps/studio/cloud/endpoints.ts +23 -1
- package/apps/studio/dist/client.bundle.js +798 -801
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/ds-assets.ts +138 -48
- package/apps/studio/editing/minimap-context.tsx +3 -3
- package/apps/studio/editing/page-activity.ts +251 -0
- package/apps/studio/editing/rotate-handle.tsx +9 -5
- package/apps/studio/editing/sticky-name.tsx +4 -4
- package/apps/studio/history/restore-artboard-action.ts +40 -0
- package/apps/studio/home/hub.ts +77 -175
- package/apps/studio/home/routes.ts +47 -8
- package/apps/studio/http.ts +117 -66
- package/apps/studio/index-flight.ts +40 -0
- package/apps/studio/managed-projects.ts +52 -24
- package/apps/studio/migrate/hub.ts +7 -1
- package/apps/studio/routes/asset-state.ts +12 -0
- package/apps/studio/routes/canvas-source.ts +44 -2
- package/apps/studio/routes/ds-assets.ts +8 -0
- package/apps/studio/routes/history.ts +28 -5
- package/apps/studio/routes/hub-signin.ts +115 -0
- package/apps/studio/routes/index.ts +4 -0
- package/apps/studio/routes/table.ts +7 -0
- package/apps/studio/routes/trash.ts +3 -0
- package/apps/studio/server.ts +11 -0
- package/apps/studio/sync/accepted-cold-start.ts +26 -3
- package/apps/studio/sync/accepted-link.ts +9 -4
- package/apps/studio/sync/asset-push.ts +8 -1
- package/apps/studio/sync/asset-state.ts +27 -2
- package/apps/studio/sync/code-module-consent.ts +74 -0
- package/apps/studio/sync/file-ledger.ts +35 -0
- package/apps/studio/sync/file-plane.ts +479 -84
- package/apps/studio/sync/hub-browser-signin.ts +377 -0
- package/apps/studio/sync/hub-text-undo.ts +30 -10
- package/apps/studio/sync/index.ts +73 -11
- package/apps/studio/sync/lfs-pointer.ts +137 -0
- package/apps/studio/sync/projection.ts +44 -2
- package/apps/studio/sync/pull-pacer.ts +160 -0
- package/apps/studio/sync/pull-priority.ts +119 -0
- package/apps/studio/sync/seed-progress.ts +47 -3
- package/apps/studio/sync/transaction-client.ts +71 -6
- package/apps/studio/sync/workspace-signin.ts +6 -256
- package/apps/studio/sync/writer-registry.ts +5 -1
- package/apps/studio/video-links-overlay.tsx +3 -2
- package/apps/studio/whats-new.json +63 -0
- package/cli/lib/design-help.gen.mjs +1 -1
- package/cli/lib/workspace-plan.mjs +14 -0
- package/package.json +8 -8
|
@@ -246,6 +246,41 @@ export function laneHash(content: string): string {
|
|
|
246
246
|
|
|
247
247
|
export const EMPTY_LANE_HASH = laneHash('');
|
|
248
248
|
|
|
249
|
+
/** #166 R3 — what a read may be bounded by beyond the 20 s transport timeout. */
|
|
250
|
+
export interface ReadLimits {
|
|
251
|
+
/** aborts the read (its fetch and the body still streaming) */
|
|
252
|
+
signal?: AbortSignal;
|
|
253
|
+
/** the body's byte cap, enforced on the stream; past it the body is cancelled and the read refuses */
|
|
254
|
+
maxBytes?: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* A response body as text, never more than `maxBytes`: a declared length over the cap refuses
|
|
259
|
+
* before reading, and a stream that passes it is cancelled there (a hub can omit the length).
|
|
260
|
+
*/
|
|
261
|
+
async function readCappedText(res: Response, maxBytes: number): Promise<string> {
|
|
262
|
+
const declared = Number(res.headers.get('content-length'));
|
|
263
|
+
if (Number.isFinite(declared) && declared > maxBytes) {
|
|
264
|
+
await res.body?.cancel().catch(() => {});
|
|
265
|
+
throw new TransactionError(`read over ${maxBytes} bytes`, 'too-large');
|
|
266
|
+
}
|
|
267
|
+
if (!res.body) return '';
|
|
268
|
+
const reader = res.body.getReader();
|
|
269
|
+
const chunks: Uint8Array[] = [];
|
|
270
|
+
let total = 0;
|
|
271
|
+
for (;;) {
|
|
272
|
+
const { done, value } = await reader.read();
|
|
273
|
+
if (done) break;
|
|
274
|
+
total += value.byteLength;
|
|
275
|
+
if (total > maxBytes) {
|
|
276
|
+
await reader.cancel().catch(() => {});
|
|
277
|
+
throw new TransactionError(`read over ${maxBytes} bytes`, 'too-large');
|
|
278
|
+
}
|
|
279
|
+
chunks.push(value);
|
|
280
|
+
}
|
|
281
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
282
|
+
}
|
|
283
|
+
|
|
249
284
|
export class TransactionError extends Error {
|
|
250
285
|
constructor(
|
|
251
286
|
message: string,
|
|
@@ -315,14 +350,31 @@ export function createTransactionClient(opts: TransactionClientOptions) {
|
|
|
315
350
|
};
|
|
316
351
|
}
|
|
317
352
|
|
|
318
|
-
async function request(
|
|
353
|
+
async function request(
|
|
354
|
+
method: string,
|
|
355
|
+
route: string,
|
|
356
|
+
body?: string,
|
|
357
|
+
format?: number,
|
|
358
|
+
lim: ReadLimits = {}
|
|
359
|
+
) {
|
|
360
|
+
const timeout = AbortSignal.timeout(20_000);
|
|
319
361
|
const res = await fetchImpl(`${base}/api/projects/${projectId ?? 'current'}/v1/${route}`, {
|
|
320
362
|
method,
|
|
321
363
|
headers: headers(format),
|
|
322
364
|
...(body !== undefined ? { body } : {}),
|
|
323
|
-
signal: AbortSignal.timeout
|
|
365
|
+
signal: lim.signal ? AbortSignal.any([timeout, lim.signal]) : timeout,
|
|
324
366
|
});
|
|
325
|
-
|
|
367
|
+
if (lim.maxBytes === undefined) {
|
|
368
|
+
const json = (await res.json().catch(() => null)) as unknown;
|
|
369
|
+
return { status: res.status, json };
|
|
370
|
+
}
|
|
371
|
+
const text = await readCappedText(res, lim.maxBytes);
|
|
372
|
+
let json: unknown = null;
|
|
373
|
+
try {
|
|
374
|
+
json = JSON.parse(text);
|
|
375
|
+
} catch {
|
|
376
|
+
/* not JSON — the caller reads null, as res.json() would */
|
|
377
|
+
}
|
|
326
378
|
return { status: res.status, json };
|
|
327
379
|
}
|
|
328
380
|
|
|
@@ -981,13 +1033,26 @@ export function createTransactionClient(opts: TransactionClientOptions) {
|
|
|
981
1033
|
}
|
|
982
1034
|
}
|
|
983
1035
|
|
|
984
|
-
/**
|
|
985
|
-
|
|
1036
|
+
/**
|
|
1037
|
+
* A read route (`history`, `lane`, `revisions`) — no retry, bounded. #166 R3: `signal` ends a
|
|
1038
|
+
* read its caller stopped waiting for; `maxBytes` caps the body while it streams in.
|
|
1039
|
+
*/
|
|
1040
|
+
async function read(
|
|
1041
|
+
route: string,
|
|
1042
|
+
params: Record<string, string | number>,
|
|
1043
|
+
lim: ReadLimits = {}
|
|
1044
|
+
): Promise<unknown> {
|
|
986
1045
|
if (projectId === null) await bootstrap();
|
|
987
1046
|
const qs = new URLSearchParams(
|
|
988
1047
|
Object.fromEntries(Object.entries(params).map(([k, v]) => [k, String(v)]))
|
|
989
1048
|
);
|
|
990
|
-
const { status, json } = await request(
|
|
1049
|
+
const { status, json } = await request(
|
|
1050
|
+
'GET',
|
|
1051
|
+
`${route}?${qs.toString()}`,
|
|
1052
|
+
undefined,
|
|
1053
|
+
undefined,
|
|
1054
|
+
lim
|
|
1055
|
+
);
|
|
991
1056
|
if (status !== 200) throw new TransactionError(`${route} failed (${status})`, 'read');
|
|
992
1057
|
return json;
|
|
993
1058
|
}
|
|
@@ -1,260 +1,10 @@
|
|
|
1
|
-
//
|
|
1
|
+
// What the operator of a team server can see — the disclosure shown where the person is.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// The vocabulary rule is not cosmetic (DDR-193 §5). The persona this product
|
|
9
|
-
// lives or dies by is the invited teammate who has never used git. Every string
|
|
10
|
-
// on this path says "sign in", "workspace", "project" — never token, never
|
|
11
|
-
// repository, never OAuth. A flow that says "paste your bearer token" has
|
|
12
|
-
// already told that person the product is not for them.
|
|
13
|
-
//
|
|
14
|
-
// TOKEN CUSTODY (unchanged from DDR-054 / the phase-29 A2 finding, and the
|
|
15
|
-
// reason this file reuses hub-link.ts rather than writing its own storage):
|
|
16
|
-
//
|
|
17
|
-
// • the health probe is TOKENLESS — a lookalike address must never receive a
|
|
18
|
-
// credential;
|
|
19
|
-
// • the password goes ONLY to the address the user typed, once, and is never
|
|
20
|
-
// stored anywhere, in memory or on disk, after the request;
|
|
21
|
-
// • what IS stored is the minted peer token, in `~/.config/maude/hubs.json`
|
|
22
|
-
// at mode 0600, keyed by normalized URL — the same store `maude design
|
|
23
|
-
// link` writes, so a project opened later just works.
|
|
24
|
-
//
|
|
25
|
-
// The token now EXPIRES (Phase 2), which changes one thing for the client: a
|
|
26
|
-
// sync failure can mean "your session ran out" rather than "something broke",
|
|
27
|
-
// and the honest response is to ask the person to sign in again rather than to
|
|
28
|
-
// silently retry forever.
|
|
29
|
-
|
|
30
|
-
import { saveHubCredential } from './hub-link.ts';
|
|
31
|
-
import { normalizeUrl } from './hubs-config.ts';
|
|
32
|
-
|
|
33
|
-
const PROBE_TIMEOUT_MS = 4000;
|
|
34
|
-
const LOGIN_TIMEOUT_MS = 15_000;
|
|
35
|
-
|
|
36
|
-
export interface SignInResult {
|
|
37
|
-
status: number;
|
|
38
|
-
json:
|
|
39
|
-
| {
|
|
40
|
-
ok: true;
|
|
41
|
-
url: string;
|
|
42
|
-
/** Plain-words identity for the UI header — never a token. */
|
|
43
|
-
user: { email: string; role: string };
|
|
44
|
-
/** ms-epoch. The UI surfaces "signed in until <date>", not a raw number. */
|
|
45
|
-
expiresAt: number | null;
|
|
46
|
-
version: string | null;
|
|
47
|
-
}
|
|
48
|
-
| { ok: false; error: string; reason?: SignInFailure };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type SignInFailure =
|
|
52
|
-
| 'bad-address'
|
|
53
|
-
| 'unreachable'
|
|
54
|
-
| 'not-a-maude-workspace'
|
|
55
|
-
| 'bad-credentials'
|
|
56
|
-
| 'cloud-identity'
|
|
57
|
-
| 'rate-limited'
|
|
58
|
-
| 'save-failed'
|
|
59
|
-
| 'server-error';
|
|
60
|
-
|
|
61
|
-
export interface SignInInput {
|
|
62
|
-
url?: unknown;
|
|
63
|
-
email?: unknown;
|
|
64
|
-
password?: unknown;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Injected in tests. */
|
|
68
|
-
export interface SignInDeps {
|
|
69
|
-
fetchImpl?: typeof fetch;
|
|
70
|
-
save?: (
|
|
71
|
-
normUrl: string,
|
|
72
|
-
token: string,
|
|
73
|
-
role?: string,
|
|
74
|
-
expiresAt?: number,
|
|
75
|
-
/** the account the workspace vouched (`user.email`), for "Signed in as" */
|
|
76
|
-
account?: string
|
|
77
|
-
) => void;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Address → reachability → sign in → credential stored. One call, because the
|
|
82
|
-
* person doing this is not debugging a network stack; they were sent a link.
|
|
83
|
-
*/
|
|
84
|
-
export async function signInToWorkspace(
|
|
85
|
-
input: SignInInput,
|
|
86
|
-
deps: SignInDeps = {}
|
|
87
|
-
): Promise<SignInResult> {
|
|
88
|
-
const doFetch = deps.fetchImpl ?? fetch;
|
|
89
|
-
const save =
|
|
90
|
-
deps.save ??
|
|
91
|
-
((u: string, t: string, r?: string, e?: number, a?: string) =>
|
|
92
|
-
saveHubCredential(u, t, r, e, undefined, a));
|
|
93
|
-
|
|
94
|
-
if (typeof input.url !== 'string' || !input.url.trim()) {
|
|
95
|
-
return fail(400, 'Enter the workspace address your team sent you.', 'bad-address');
|
|
96
|
-
}
|
|
97
|
-
if (typeof input.email !== 'string' || !input.email.trim()) {
|
|
98
|
-
return fail(400, 'Enter your email address.', 'bad-credentials');
|
|
99
|
-
}
|
|
100
|
-
if (typeof input.password !== 'string' || input.password === '') {
|
|
101
|
-
return fail(400, 'Enter your password.', 'bad-credentials');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
let norm: string;
|
|
105
|
-
try {
|
|
106
|
-
norm = normalizeUrl(input.url.trim());
|
|
107
|
-
const parsed = new URL(norm);
|
|
108
|
-
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
109
|
-
return fail(400, 'The workspace address must start with http:// or https://.', 'bad-address');
|
|
110
|
-
}
|
|
111
|
-
} catch {
|
|
112
|
-
return fail(400, "That doesn't look like a workspace address.", 'bad-address');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 1. TOKENLESS reachability probe. Also tells us it is a Maude workspace at
|
|
116
|
-
// all, so a typo'd address fails here with a sentence a person can act on
|
|
117
|
-
// instead of failing later as a mysterious auth error.
|
|
118
|
-
const probe = await probe200(doFetch, `${norm}/health`, PROBE_TIMEOUT_MS);
|
|
119
|
-
if (!probe.reached) {
|
|
120
|
-
return fail(
|
|
121
|
-
502,
|
|
122
|
-
"Couldn't reach that workspace. Check the address, or ask whoever invited you whether it's online.",
|
|
123
|
-
'unreachable'
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
if (!probe.isMaude) {
|
|
127
|
-
return fail(
|
|
128
|
-
502,
|
|
129
|
-
"That address answered, but it isn't a Maude workspace. Double-check the link you were sent.",
|
|
130
|
-
'not-a-maude-workspace'
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// 2. Sign in. The password goes to this address once and is never retained.
|
|
135
|
-
let res: Response;
|
|
136
|
-
try {
|
|
137
|
-
const ctrl = new AbortController();
|
|
138
|
-
const timer = setTimeout(() => ctrl.abort(), LOGIN_TIMEOUT_MS);
|
|
139
|
-
try {
|
|
140
|
-
res = await doFetch(`${norm}/auth/login`, {
|
|
141
|
-
method: 'POST',
|
|
142
|
-
headers: { 'Content-Type': 'application/json' },
|
|
143
|
-
body: JSON.stringify({ email: input.email.trim(), password: input.password }),
|
|
144
|
-
signal: ctrl.signal,
|
|
145
|
-
});
|
|
146
|
-
} finally {
|
|
147
|
-
clearTimeout(timer);
|
|
148
|
-
}
|
|
149
|
-
} catch {
|
|
150
|
-
return fail(502, "Couldn't reach that workspace to sign in.", 'unreachable');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (res.status === 401) {
|
|
154
|
-
// The hub deliberately cannot tell us WHICH part was wrong (it refuses to be
|
|
155
|
-
// a user-existence oracle), so neither can we. Saying "wrong password" when
|
|
156
|
-
// the account may not exist would be a guess presented as fact.
|
|
157
|
-
return fail(401, 'That email and password combination was not accepted.', 'bad-credentials');
|
|
158
|
-
}
|
|
159
|
-
if (res.status === 429) {
|
|
160
|
-
return fail(429, 'Too many attempts. Wait a minute and try again.', 'rate-limited');
|
|
161
|
-
}
|
|
162
|
-
if (res.status === 400) {
|
|
163
|
-
// The ONE refusal that comes with directions (Phase 23 B3): a cloud
|
|
164
|
-
// workspace saying "this door signs in through Maude Cloud" — or a viewer
|
|
165
|
-
// being told what viewing needs. Swallowing it into "try again shortly"
|
|
166
|
-
// turned the most actionable message on this path into a shrug.
|
|
167
|
-
let message = 'The workspace refused the sign-in.';
|
|
168
|
-
try {
|
|
169
|
-
const body = (await res.json()) as { error?: unknown };
|
|
170
|
-
if (typeof body.error === 'string' && body.error) message = body.error;
|
|
171
|
-
} catch {
|
|
172
|
-
/* keep the generic sentence */
|
|
173
|
-
}
|
|
174
|
-
return fail(400, message, 'cloud-identity');
|
|
175
|
-
}
|
|
176
|
-
if (!res.ok) {
|
|
177
|
-
return fail(502, 'The workspace refused the sign-in. Try again shortly.', 'server-error');
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
let body: {
|
|
181
|
-
token?: unknown;
|
|
182
|
-
expiresAt?: unknown;
|
|
183
|
-
user?: { email?: unknown; role?: unknown };
|
|
184
|
-
};
|
|
185
|
-
try {
|
|
186
|
-
body = (await res.json()) as typeof body;
|
|
187
|
-
} catch {
|
|
188
|
-
return fail(502, 'The workspace sent an unexpected reply.', 'server-error');
|
|
189
|
-
}
|
|
190
|
-
if (typeof body.token !== 'string' || !body.token) {
|
|
191
|
-
return fail(502, 'The workspace sent an unexpected reply.', 'server-error');
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// 3. Persist ONLY the minted token, 0600, in the shared credential store —
|
|
195
|
-
// plus the role the workspace vouched for (Cloud Phase 25 C2), so a
|
|
196
|
-
// viewer is known to be one at BOOT. Learning it from the first refusal
|
|
197
|
-
// instead means showing somebody an editor and then taking it away.
|
|
198
|
-
const vouchedRole = typeof body.user?.role === 'string' ? body.user.role : 'member';
|
|
199
|
-
// …and WHEN it dies. The expiry was already read (it is echoed to the UI
|
|
200
|
-
// below) — discarding it from the store is what left the sync runtime
|
|
201
|
-
// with no deadline to renew against.
|
|
202
|
-
const expiresAt = typeof body.expiresAt === 'number' ? body.expiresAt : undefined;
|
|
203
|
-
try {
|
|
204
|
-
const account = typeof body.user?.email === 'string' ? body.user.email : undefined;
|
|
205
|
-
save(norm, body.token, vouchedRole, expiresAt, account);
|
|
206
|
-
} catch {
|
|
207
|
-
return fail(500, "Couldn't save the workspace connection on this computer.", 'save-failed');
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return {
|
|
211
|
-
status: 200,
|
|
212
|
-
json: {
|
|
213
|
-
ok: true,
|
|
214
|
-
url: norm,
|
|
215
|
-
user: {
|
|
216
|
-
email: typeof body.user?.email === 'string' ? body.user.email : String(input.email).trim(),
|
|
217
|
-
role: vouchedRole,
|
|
218
|
-
},
|
|
219
|
-
expiresAt: expiresAt ?? null,
|
|
220
|
-
version: probe.version,
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function fail(status: number, error: string, reason: SignInFailure): SignInResult {
|
|
226
|
-
return { status, json: { ok: false, error, reason } };
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
async function probe200(
|
|
230
|
-
doFetch: typeof fetch,
|
|
231
|
-
url: string,
|
|
232
|
-
timeoutMs: number
|
|
233
|
-
): Promise<{ reached: boolean; isMaude: boolean; version: string | null }> {
|
|
234
|
-
const ctrl = new AbortController();
|
|
235
|
-
const timer = setTimeout(() => ctrl.abort(), timeoutMs);
|
|
236
|
-
try {
|
|
237
|
-
const res = await doFetch(url, { signal: ctrl.signal });
|
|
238
|
-
if (!res.ok) return { reached: true, isMaude: false, version: null };
|
|
239
|
-
try {
|
|
240
|
-
const j = (await res.json()) as { ok?: unknown; version?: unknown };
|
|
241
|
-
// A Maude hub's /health always carries `ok`. Anything else answered on
|
|
242
|
-
// that path is some other service.
|
|
243
|
-
const isMaude = j?.ok === true;
|
|
244
|
-
return {
|
|
245
|
-
reached: true,
|
|
246
|
-
isMaude,
|
|
247
|
-
version: typeof j?.version === 'string' ? j.version : null,
|
|
248
|
-
};
|
|
249
|
-
} catch {
|
|
250
|
-
return { reached: true, isMaude: false, version: null };
|
|
251
|
-
}
|
|
252
|
-
} catch {
|
|
253
|
-
return { reached: false, isMaude: false, version: null };
|
|
254
|
-
} finally {
|
|
255
|
-
clearTimeout(timer);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
3
|
+
// This file used to hold "Sign in to workspace" too: an address, an email and a password, posted to
|
|
4
|
+
// the hub's `/auth/login`. Issue #204 retired it — the desktop owns no login method for a team
|
|
5
|
+
// server. A team server is signed in to on its OWN page (`routes/hub-signin.ts`,
|
|
6
|
+
// `sync/hub-browser-signin.ts`: a one-time code comes back, the token is stored), and the one
|
|
7
|
+
// fallback is a pasted access token (`/_api/hub/link`). Only the disclosure stays here.
|
|
258
8
|
|
|
259
9
|
// ---------------------------------------------------------------- disclosure
|
|
260
10
|
|
|
@@ -552,7 +552,11 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
|
|
|
552
552
|
'/_api/tree-state': { class: 'local' },
|
|
553
553
|
'/_api/ui-prefs': { class: 'local' },
|
|
554
554
|
'/_api/workspace/disclosure': { class: 'local' },
|
|
555
|
-
|
|
555
|
+
// Issue #204 — the team-server browser sign-in: a credential in this Mac's hubs.json
|
|
556
|
+
'/_api/hub-signin/start': { class: 'local' },
|
|
557
|
+
'/_api/hub-signin/poll': { class: 'local' },
|
|
558
|
+
'/_api/hub-signin/cancel': { class: 'local' },
|
|
559
|
+
'/_api/hub-signin/return': { class: 'local' },
|
|
556
560
|
// --- the V2-2.5 table (routes/*.ts) — classified by the lead (decision v2-2.5 classification)
|
|
557
561
|
'/_api/outbox': { class: 'read' }, // routes/outbox.ts: the queue's view
|
|
558
562
|
'/_api/outbox/:id': { class: 'read' },
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { useSyncExternalStore } from 'react';
|
|
19
19
|
|
|
20
20
|
import { useArtboardsContext } from './canvas-lib.tsx';
|
|
21
|
+
import { activeInterval } from './editing/page-activity.ts';
|
|
21
22
|
import { type LinkGroup, linkGroups, unlinkedBase } from './video/link-groups.ts';
|
|
22
23
|
|
|
23
24
|
export interface PillRect {
|
|
@@ -162,8 +163,8 @@ function subscribe(fn: () => void): () => void {
|
|
|
162
163
|
: (window as unknown as Record<symbol, PlayheadHubLike | undefined>);
|
|
163
164
|
const hub = w?.[HUB_KEY];
|
|
164
165
|
if (!hub) {
|
|
165
|
-
|
|
166
|
-
return (
|
|
166
|
+
// 2.0.4: only while the page is in use — this ran 2×/s on every idle canvas (page-activity.ts)
|
|
167
|
+
return activeInterval(fn, 500);
|
|
167
168
|
}
|
|
168
169
|
hub.listeners.add(fn);
|
|
169
170
|
return () => void hub.listeners.delete(fn);
|
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./whats-new.schema.json",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"id": "team-server-browser-signin",
|
|
6
|
+
"version": "2.0.4",
|
|
7
|
+
"date": "2026-11-05",
|
|
8
|
+
"kind": "feature",
|
|
9
|
+
"title": "Sign in to a team server in your browser",
|
|
10
|
+
"summary": "Signing in to your own team server now opens that server's sign-in page in your browser, with every way it offers, such as your company account. When you're done, you're back in the app. The app no longer asks for a team server's password.",
|
|
11
|
+
"surface": "design-ui"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "canvas-says-what-it-waits-for",
|
|
15
|
+
"version": "2.0.4",
|
|
16
|
+
"date": "2026-11-05",
|
|
17
|
+
"kind": "fix",
|
|
18
|
+
"title": "A canvas says what it is waiting for",
|
|
19
|
+
"summary": "A canvas that is still downloading shows how far along it is and opens by itself when its files arrive. One that can't open yet, or a design system that is still building, says why instead of \"can't be drawn\".",
|
|
20
|
+
"surface": "design-ui"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "faster-first-download",
|
|
24
|
+
"version": "2.0.4",
|
|
25
|
+
"date": "2026-11-05",
|
|
26
|
+
"kind": "fix",
|
|
27
|
+
"title": "A new Mac gets a project much faster",
|
|
28
|
+
"summary": "Opening a big project on another Mac for the first time downloads it several times faster, and the canvas you have open comes first. A cloud project's shared code now arrives too, so canvases that use it draw everywhere.",
|
|
29
|
+
"surface": "design-ui"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "less-memory-and-rest",
|
|
33
|
+
"version": "2.0.4",
|
|
34
|
+
"date": "2026-11-05",
|
|
35
|
+
"kind": "fix",
|
|
36
|
+
"title": "Less memory, quieter when idle",
|
|
37
|
+
"summary": "Maude keeps far less in memory as you move between canvases and uses almost no CPU when you're not working. Up to three projects run at once, and a project you haven't used for 15 minutes rests until you come back to it.",
|
|
38
|
+
"surface": "design-ui"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "folders-trash-spotlight",
|
|
42
|
+
"version": "2.0.4",
|
|
43
|
+
"date": "2026-11-05",
|
|
44
|
+
"kind": "fix",
|
|
45
|
+
"title": "Folders, trash and a bigger look",
|
|
46
|
+
"summary": "New folder and Rename work again. Moving canvases to the trash shows right away and handles several in a row. Double-click a picture or video in Assets to see it large.",
|
|
47
|
+
"surface": "design-ui"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "ai-background-work-shown",
|
|
51
|
+
"version": "2.0.4",
|
|
52
|
+
"date": "2026-11-05",
|
|
53
|
+
"kind": "feature",
|
|
54
|
+
"title": "See what the AI runs in the background",
|
|
55
|
+
"summary": "When the AI starts helpers or long commands, the chat shows what is still running and for how long, until it's done.",
|
|
56
|
+
"surface": "design-ui"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "lfs-placeholder-fix",
|
|
60
|
+
"version": "2.0.3",
|
|
61
|
+
"date": "2026-11-04",
|
|
62
|
+
"kind": "fix",
|
|
63
|
+
"title": "Pictures that were never downloaded say so",
|
|
64
|
+
"summary": "A picture or video that is still a Git LFS placeholder now says \"Not downloaded — Git LFS placeholder\" instead of \"not found\". In the desktop app, Fix with AI puts a restore prompt in the chat, and Copy prompt copies it. Sync no longer uploads the placeholder as if it were the picture.",
|
|
65
|
+
"surface": "design-ui"
|
|
66
|
+
},
|
|
4
67
|
{
|
|
5
68
|
"id": "maude-v2-canvas-window",
|
|
6
69
|
"version": "2.0.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
3
|
+
// manifest 4ae7b6bdb900
|
|
4
4
|
|
|
5
5
|
export const DESIGN_VERB_TIERS_HELP =
|
|
6
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 · export · curl-local · draw-build · to-lottie · generate · audio-search\n fetch-asset · ensure-browser · transcribe · import-figma · import-brand\n photo-bg-remove · describe · init · ds-upgrade · bulk-deletes · history restore\n trash · history undo · history name · exports · sync resync · sync · runs · ds\n comments reply · comments resolve · comments reopen · comments add · comments\n 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";
|
|
@@ -629,6 +629,20 @@ services:
|
|
|
629
629
|
# without this the project's only record is its current bytes.
|
|
630
630
|
MAUDE_REPO_DIR: /repo
|
|
631
631
|
${envLines(hubEnv)}
|
|
632
|
+
# Tuning for a big project on a small or shared host (docs: Workspace →
|
|
633
|
+
# Big projects on small hosts). Set a value in .env to change it.
|
|
634
|
+
# How long the studio may boot without progress, and its hard ceiling.
|
|
635
|
+
# Defaults written out: an empty value read as 0 by older hub images.
|
|
636
|
+
MAUDE_STUDIO_READY_MS: \${MAUDE_STUDIO_READY_MS:-60000}
|
|
637
|
+
MAUDE_STUDIO_READY_CEILING_MS: \${MAUDE_STUDIO_READY_CEILING_MS:-600000}
|
|
638
|
+
# The sandboxed canvas build: its hard ceiling, how long one request waits
|
|
639
|
+
# for it, its memory limit and how many built canvases are kept. Empty
|
|
640
|
+
# means the built-in default (90000 / 20000 / 768 / 64).
|
|
641
|
+
MAUDE_CANVAS_BUILD_TIMEOUT_MS: \${MAUDE_CANVAS_BUILD_TIMEOUT_MS:-}
|
|
642
|
+
MAUDE_CANVAS_BUILD_WAIT_MS: \${MAUDE_CANVAS_BUILD_WAIT_MS:-}
|
|
643
|
+
MAUDE_CANVAS_BUILD_RSS_MB: \${MAUDE_CANVAS_BUILD_RSS_MB:-}
|
|
644
|
+
MAUDE_CANVAS_CACHE_ENTRIES: \${MAUDE_CANVAS_CACHE_ENTRIES:-}
|
|
645
|
+
MAUDE_CANVAS_MODULE_CACHE_MB: \${MAUDE_CANVAS_MODULE_CACHE_MB:-}
|
|
632
646
|
volumes:
|
|
633
647
|
- hub-data:/data
|
|
634
648
|
# A SEPARATE volume from hub-data on purpose: the checkout is the one
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1agh/maude",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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": {
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"test:e2e:desktop:parity:cloud": "pnpm --filter @maude/desktop-e2e e2e:parity:cloud"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@1agh/maude-darwin-arm64": "2.0.
|
|
69
|
-
"@1agh/maude-darwin-x64": "2.0.
|
|
70
|
-
"@1agh/maude-linux-arm64": "2.0.
|
|
71
|
-
"@1agh/maude-linux-arm64-musl": "2.0.
|
|
72
|
-
"@1agh/maude-linux-x64": "2.0.
|
|
73
|
-
"@1agh/maude-linux-x64-musl": "2.0.
|
|
74
|
-
"@1agh/maude-win32-x64": "2.0.
|
|
68
|
+
"@1agh/maude-darwin-arm64": "2.0.4",
|
|
69
|
+
"@1agh/maude-darwin-x64": "2.0.4",
|
|
70
|
+
"@1agh/maude-linux-arm64": "2.0.4",
|
|
71
|
+
"@1agh/maude-linux-arm64-musl": "2.0.4",
|
|
72
|
+
"@1agh/maude-linux-x64": "2.0.4",
|
|
73
|
+
"@1agh/maude-linux-x64-musl": "2.0.4",
|
|
74
|
+
"@1agh/maude-win32-x64": "2.0.4"
|
|
75
75
|
},
|
|
76
76
|
"files": [
|
|
77
77
|
"cli",
|