@engenty/wizards-runtime 0.10.0 → 0.11.0
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/runtime/dist/app.js +18 -2
- package/apps/runtime/dist/db/live-triggers.js +144 -0
- package/apps/runtime/dist/db/migrations/tenant/0023_live_change.sql +167 -0
- package/apps/runtime/dist/db/migrations/tenant/0024_live_presence.sql +28 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0023_snapshot.json +3860 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0024_snapshot.json +3967 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +14 -0
- package/apps/runtime/dist/db/schema.js +41 -0
- package/apps/runtime/dist/docs/user-guide/meta.json +1 -0
- package/apps/runtime/dist/docs/user-guide/together.md +60 -0
- package/apps/runtime/dist/index.js +5 -1
- package/apps/runtime/dist/live/feed.js +34 -0
- package/apps/runtime/dist/live/hub.js +200 -0
- package/apps/runtime/dist/live/origin.js +53 -0
- package/apps/runtime/dist/live/views.js +146 -0
- package/apps/runtime/dist/mcp/handler.js +7 -1
- package/apps/runtime/dist/mcp/tools.js +51 -2
- package/apps/runtime/dist/routes/api.js +71 -2
- package/apps/runtime/dist/routes/live.js +85 -0
- package/apps/runtime/dist/routes/studio.js +47 -85
- package/apps/runtime/dist/services/presence.js +132 -0
- package/apps/runtime/dist/services/space-data.js +33 -6
- package/apps/runtime/dist/sync/apply.js +4 -0
- package/apps/runtime/dist/sync/client.js +146 -1
- package/apps/runtime/dist/texts.js +2 -0
- package/apps/web/dist/assets/AboutDialog-9VcgySrQ.js +1 -0
- package/apps/web/dist/assets/{ChangelogDialog-Bv02g8av.js → ChangelogDialog-BXvT2VMU.js} +1 -1
- package/apps/web/dist/assets/EditorPage-Cvzd0nah.js +4 -0
- package/apps/web/dist/assets/{FlowPreview-dc5C92kK.js → FlowPreview-BV1NJ0rF.js} +1 -1
- package/apps/web/dist/assets/{Harness-D0nFOIVx.js → Harness-DYviBlHB.js} +2 -2
- package/apps/web/dist/assets/Marketplace-DTSg7_U7.js +2 -0
- package/apps/web/dist/assets/{NewWizardChannels-i62Y_2DZ.js → NewWizardChannels-DiujJzOR.js} +1 -1
- package/apps/web/dist/assets/NewWizardPage-CngUh9g-.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-DFKJnWtw.js +1 -0
- package/apps/web/dist/assets/PreviewPane-C0E9OLzB.js +9 -0
- package/apps/web/dist/assets/ProjectPage-CYDX-JYc.js +1 -0
- package/apps/web/dist/assets/PublicRunner-CkRO_Pw-.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-Mv5M2OV9.js → ReadOnly-E-h9y_QO.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-BMgP3aRV.js +2 -0
- package/apps/web/dist/assets/SetupPage-DBO_rzj7.js +1 -0
- package/apps/web/dist/assets/{SharePage-CBSRK0wF.js → SharePage-BvvmYB5N.js} +1 -1
- package/apps/web/dist/assets/changelog-zllICQ4q.js +1 -0
- package/apps/web/dist/assets/{coins-BGZKYmu6.js → coins-DQ91VJAB.js} +1 -1
- package/apps/web/dist/assets/index-Bjn557f1.js +20 -0
- package/apps/web/dist/assets/index-DN0VMwsS.css +1 -0
- package/apps/web/dist/assets/{phone-BzHhwehj.js → phone-jIuRIwyg.js} +1 -1
- package/apps/web/dist/assets/{runners-C1-zIlry.js → runners-DloOxEbh.js} +1 -1
- package/apps/web/dist/assets/session-BpsCkDv6.js +2 -0
- package/apps/web/dist/assets/{settings-menu-BZRGhsIO.js → settings-menu-CoLUNJGQ.js} +1 -1
- package/apps/web/dist/assets/theme-2XjIQXH3.js +11 -0
- package/apps/web/dist/assets/{ui-BI1RPFWT.js → ui-BIWmkPh6.js} +3 -3
- package/apps/web/dist/assets/{upload-CwT8oMz0.js → upload-BcOvBWHS.js} +1 -1
- package/apps/web/dist/assets/{useMutation-byk81dDj.js → useMutation-CD7HmAxR.js} +1 -1
- package/apps/web/dist/assets/{volume-2-B1Pz6Iwt.js → volume-2-D2To9w5D.js} +1 -1
- package/apps/web/dist/assets/{wrench-CvzXRbWN.js → wrench-B98ubRvB.js} +1 -1
- package/apps/web/dist/index.html +8 -8
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/live.d.ts +46 -0
- package/node_modules/@engenty/wizards-shared/dist/live.js +9 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +1 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +2 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/AboutDialog-D1YHT0jc.js +0 -1
- package/apps/web/dist/assets/EditorPage-BThoZwqO.js +0 -4
- package/apps/web/dist/assets/Marketplace-Cnd8BF3q.js +0 -2
- package/apps/web/dist/assets/NewWizardPage-BcpRA1fx.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-BcMDEXNq.js +0 -1
- package/apps/web/dist/assets/PreviewPane-GHcVV2Hu.js +0 -4
- package/apps/web/dist/assets/ProjectPage-TDywzUOd.js +0 -1
- package/apps/web/dist/assets/PublicRunner-B6JINLpR.js +0 -1
- package/apps/web/dist/assets/SettingsPage-B-F1dLgt.js +0 -2
- package/apps/web/dist/assets/SetupPage-CVdsdVBW.js +0 -1
- package/apps/web/dist/assets/changelog-BR1lxaWv.js +0 -1
- package/apps/web/dist/assets/index-D3-kv1WF.js +0 -14
- package/apps/web/dist/assets/index-DcUL6teA.css +0 -1
- package/apps/web/dist/assets/session-B_JeZnJ0.js +0 -2
- package/apps/web/dist/assets/theme-HcCfZDzS.js +0 -11
|
@@ -161,12 +161,17 @@ async function tableKnowledge(table) {
|
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
export async function getTable(userId, tableId) {
|
|
164
|
-
const
|
|
165
|
-
const project = await ownedProject(userId, table.projectId);
|
|
164
|
+
const header = await getTableHeader(userId, tableId);
|
|
166
165
|
const rows = await db.query.spaceTableRow.findMany({
|
|
167
|
-
where: eq(schema.spaceTableRow.tableId,
|
|
166
|
+
where: eq(schema.spaceTableRow.tableId, header.id),
|
|
168
167
|
orderBy: [asc(schema.spaceTableRow.createdAt), asc(schema.spaceTableRow.id)],
|
|
169
168
|
});
|
|
169
|
+
return { ...header, rows: rows.map(rowView) };
|
|
170
|
+
}
|
|
171
|
+
/** A table without its rows: what a change of its title or columns needs (live/views.ts). */
|
|
172
|
+
export async function getTableHeader(userId, tableId) {
|
|
173
|
+
const table = await tableRow(tableId);
|
|
174
|
+
const project = await ownedProject(userId, table.projectId);
|
|
170
175
|
return {
|
|
171
176
|
id: table.id,
|
|
172
177
|
projectId: table.projectId,
|
|
@@ -175,11 +180,23 @@ export async function getTable(userId, tableId) {
|
|
|
175
180
|
title: table.title,
|
|
176
181
|
format: table.format,
|
|
177
182
|
columns: table.columns,
|
|
178
|
-
rows: rows.map((r) => ({ id: r.id, cells: r.cells, updatedAt: r.updatedAt.toISOString() })),
|
|
179
183
|
readOnly: !(await projectWritable(project)),
|
|
180
184
|
knowledge: await tableKnowledge(table),
|
|
181
185
|
};
|
|
182
186
|
}
|
|
187
|
+
/** One row of a table, as the table shows it; null when it is gone. */
|
|
188
|
+
export async function getRow(_userId, tableId, rowId) {
|
|
189
|
+
await tableRow(tableId);
|
|
190
|
+
const row = await db.query.spaceTableRow.findFirst({
|
|
191
|
+
where: and(eq(schema.spaceTableRow.id, rowId), eq(schema.spaceTableRow.tableId, tableId)),
|
|
192
|
+
});
|
|
193
|
+
return row ? rowView(row) : null;
|
|
194
|
+
}
|
|
195
|
+
const rowView = (r) => ({
|
|
196
|
+
id: r.id,
|
|
197
|
+
cells: r.cells,
|
|
198
|
+
updatedAt: r.updatedAt.toISOString(),
|
|
199
|
+
});
|
|
183
200
|
/**
|
|
184
201
|
* A new title, owner or columns. Rows keep their cells: a removed column's cells are dropped
|
|
185
202
|
* the next time the row changes, and are not shown before. `review: null`: a person looked.
|
|
@@ -284,7 +301,10 @@ export async function addTableRow(_userId, tableId, cells = {}) {
|
|
|
284
301
|
await db.insert(schema.spaceTableRow).values(row);
|
|
285
302
|
await touchTable(table);
|
|
286
303
|
await rowChanged(table, row.id);
|
|
287
|
-
|
|
304
|
+
const saved = await db.query.spaceTableRow.findFirst({
|
|
305
|
+
where: eq(schema.spaceTableRow.id, row.id),
|
|
306
|
+
});
|
|
307
|
+
return { id: row.id, cells: value, updatedAt: (saved?.updatedAt ?? new Date()).toISOString() };
|
|
288
308
|
}
|
|
289
309
|
/** Changes the cells named in `cells`; the others stay. */
|
|
290
310
|
export async function updateTableRow(_userId, tableId, rowId, cells) {
|
|
@@ -423,6 +443,11 @@ export async function getPage(userId, pageId) {
|
|
|
423
443
|
export async function updatePage(_userId, pageId, patch) {
|
|
424
444
|
const page = await pageRow(pageId);
|
|
425
445
|
await requireWritableProject(page.projectId);
|
|
446
|
+
if (patch.baseUpdatedAt && page.updatedAt.getTime() > Date.parse(patch.baseUpdatedAt)) {
|
|
447
|
+
throw new ServiceError("revision_conflict", note("itemChangedMeantime"), {
|
|
448
|
+
page: await getPage(_userId, pageId),
|
|
449
|
+
});
|
|
450
|
+
}
|
|
426
451
|
const title = patch.title !== undefined ? patch.title.trim() || page.title : page.title;
|
|
427
452
|
const wizardId = patch.wizardId !== undefined ? await ownerOf(page.projectId, patch.wizardId) : page.wizardId;
|
|
428
453
|
const parentId = wizardId !== null
|
|
@@ -432,6 +457,7 @@ export async function updatePage(_userId, pageId, patch) {
|
|
|
432
457
|
: page.parentId;
|
|
433
458
|
const moved = title !== page.title || wizardId !== page.wizardId || parentId !== page.parentId;
|
|
434
459
|
const edited = moved || (patch.markdown !== undefined && patch.markdown !== page.markdown);
|
|
460
|
+
const at = new Date();
|
|
435
461
|
await db
|
|
436
462
|
.update(schema.spacePage)
|
|
437
463
|
.set({
|
|
@@ -449,7 +475,7 @@ export async function updatePage(_userId, pageId, patch) {
|
|
|
449
475
|
...(patch.markdown !== undefined ? { markdown: checkMarkdown(patch.markdown) } : {}),
|
|
450
476
|
...(patch.review === null ? { review: null } : {}),
|
|
451
477
|
...(edited && page.origin ? { kept: true } : {}),
|
|
452
|
-
updatedAt:
|
|
478
|
+
updatedAt: at,
|
|
453
479
|
})
|
|
454
480
|
.where(eq(schema.spacePage.id, page.id));
|
|
455
481
|
if (moved) {
|
|
@@ -458,6 +484,7 @@ export async function updatePage(_userId, pageId, patch) {
|
|
|
458
484
|
else if (edited) {
|
|
459
485
|
queueIndex(`p:${page.id}`);
|
|
460
486
|
}
|
|
487
|
+
return { updatedAt: at.toISOString() };
|
|
461
488
|
}
|
|
462
489
|
export async function deletePage(_userId, pageId) {
|
|
463
490
|
const page = await pageRow(pageId);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { sql } from "drizzle-orm";
|
|
2
2
|
import { db, inTransaction } from "../db/client.js";
|
|
3
|
+
import { nudge } from "../live/hub.js";
|
|
3
4
|
import { asSync } from "../services/access.js";
|
|
5
|
+
import { currentTenantOrNull } from "../tenants/tenant.js";
|
|
4
6
|
import { quietly } from "./log.js";
|
|
5
7
|
import { KIND_ORDER, KINDS, letDanglingGo } from "./records.js";
|
|
6
8
|
/**
|
|
@@ -36,4 +38,6 @@ export async function applyItems(items, options) {
|
|
|
36
38
|
for (const after of afters) {
|
|
37
39
|
await Promise.resolve(after()).catch((err) => console.error("[sync] after a write:", err));
|
|
38
40
|
}
|
|
41
|
+
// A pull here, a push received in the cloud: open studios hear of it now.
|
|
42
|
+
nudge(currentTenantOrNull());
|
|
39
43
|
}
|
|
@@ -5,18 +5,30 @@ import { generateText } from "ai";
|
|
|
5
5
|
import { and, desc, eq, gt, inArray, like } from "drizzle-orm";
|
|
6
6
|
import { nanoid } from "nanoid";
|
|
7
7
|
import { accountToken, linkedAccount } from "../auth/account.js";
|
|
8
|
-
import { control, controlDb, db, schema, tenantSchemaVersion } from "../db/client.js";
|
|
8
|
+
import { control, controlDb, db, schema, tenantSchemaVersion, withTenant as withTenantOf, } from "../db/client.js";
|
|
9
9
|
import { env } from "../env.js";
|
|
10
10
|
import { feature, remoteFeatures } from "../features.js";
|
|
11
11
|
import { getBlob, hasBlob, putBlob, putBlobOf } from "../files/blobs.js";
|
|
12
|
+
import { signal } from "../live/hub.js";
|
|
12
13
|
import { managed } from "../manage.js";
|
|
13
14
|
import { textModel } from "../models.js";
|
|
14
15
|
import { ServiceError } from "../services/errors.js";
|
|
15
16
|
import { deleteSetting, readSetting, writeSetting } from "../settings.js";
|
|
17
|
+
import { currentTenantOrNull, LOCAL_TENANT } from "../tenants/tenant.js";
|
|
16
18
|
import { applyItems } from "./apply.js";
|
|
17
19
|
import { dropPushed, notePending, seqKey } from "./log.js";
|
|
18
20
|
import { canonical, KIND_ORDER, KINDS } from "./records.js";
|
|
19
21
|
import { setCloudSpaceLimit, setTwoWayActive, twoWayActive } from "./state.js";
|
|
22
|
+
/** This install, to the cloud: its live call leaves out what this install pushed itself. */
|
|
23
|
+
async function installId() {
|
|
24
|
+
const known = await readSetting("install-id");
|
|
25
|
+
if (known) {
|
|
26
|
+
return known;
|
|
27
|
+
}
|
|
28
|
+
const id = nanoid();
|
|
29
|
+
await writeSetting("install-id", id);
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
20
32
|
async function call(method, path, body) {
|
|
21
33
|
const token = await accountToken();
|
|
22
34
|
if (!token) {
|
|
@@ -27,6 +39,7 @@ async function call(method, path, body) {
|
|
|
27
39
|
method,
|
|
28
40
|
headers: {
|
|
29
41
|
authorization: `Bearer ${token}`,
|
|
42
|
+
"x-wizards-install": await installId(),
|
|
30
43
|
...(body === undefined
|
|
31
44
|
? {}
|
|
32
45
|
: { "content-type": raw ? "application/octet-stream" : "application/json" }),
|
|
@@ -65,6 +78,56 @@ const httpTransport = {
|
|
|
65
78
|
adopt: async (id) => {
|
|
66
79
|
await call("POST", `${space(id)}/adopt`);
|
|
67
80
|
},
|
|
81
|
+
follow: async (since, hear, signal) => {
|
|
82
|
+
const token = await accountToken();
|
|
83
|
+
if (!token) {
|
|
84
|
+
throw new ServiceError("refused", note("accountSignedOut"), { reason: "signed_out" });
|
|
85
|
+
}
|
|
86
|
+
const res = await fetch(`${env.local.cloudUrl}/api/v1/sync/live`, {
|
|
87
|
+
headers: {
|
|
88
|
+
authorization: `Bearer ${token}`,
|
|
89
|
+
accept: "text/event-stream",
|
|
90
|
+
"x-wizards-install": await installId(),
|
|
91
|
+
...(since === null ? {} : { "last-event-id": String(since) }),
|
|
92
|
+
},
|
|
93
|
+
signal,
|
|
94
|
+
});
|
|
95
|
+
if (!res.ok || !res.body) {
|
|
96
|
+
throw new ServiceError("refused", `The cloud answered ${res.status}.`, {
|
|
97
|
+
reason: res.status === 404 ? "no_live" : "refused",
|
|
98
|
+
status: res.status,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const reader = res.body.getReader();
|
|
102
|
+
const decoder = new TextDecoder();
|
|
103
|
+
let buffer = "";
|
|
104
|
+
for (;;) {
|
|
105
|
+
const { done, value } = await reader.read();
|
|
106
|
+
if (done) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
buffer += decoder.decode(value, { stream: true });
|
|
110
|
+
let cut = buffer.indexOf("\n\n");
|
|
111
|
+
while (cut >= 0) {
|
|
112
|
+
const block = buffer.slice(0, cut);
|
|
113
|
+
buffer = buffer.slice(cut + 2);
|
|
114
|
+
let event = "";
|
|
115
|
+
let data = "";
|
|
116
|
+
for (const line of block.split("\n")) {
|
|
117
|
+
if (line.startsWith("event:")) {
|
|
118
|
+
event = line.slice(6).trim();
|
|
119
|
+
}
|
|
120
|
+
else if (line.startsWith("data:")) {
|
|
121
|
+
data += line.slice(5).trim();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (event === "changes" || event === "hello" || event === "reset") {
|
|
125
|
+
hear({ event, ...JSON.parse(data) });
|
|
126
|
+
}
|
|
127
|
+
cut = buffer.indexOf("\n\n");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
68
131
|
};
|
|
69
132
|
let transport = httpTransport;
|
|
70
133
|
/** For tests: the cloud as a stand-in answers. */
|
|
@@ -503,8 +566,11 @@ async function runSync(projectId, what) {
|
|
|
503
566
|
if (await readState(projectId)) {
|
|
504
567
|
await writeState(projectId, st);
|
|
505
568
|
}
|
|
569
|
+
changed();
|
|
506
570
|
}
|
|
507
571
|
}
|
|
572
|
+
/** The sync's view changed: an open studio shows it again (live/hub.ts). */
|
|
573
|
+
const changed = () => signal(currentTenantOrNull(), "sync");
|
|
508
574
|
/**
|
|
509
575
|
* Every space that syncs; and every space of either side that does not yet, but those the
|
|
510
576
|
* person turned off: a space made here or in the cloud joins by itself.
|
|
@@ -826,3 +892,82 @@ export async function forgetTwoWay() {
|
|
|
826
892
|
await db.delete(table);
|
|
827
893
|
}
|
|
828
894
|
}
|
|
895
|
+
// --- following the cloud as it changes (docs/plans/live-changes.md, 7) -----------------------
|
|
896
|
+
const LIVE_SEQ = "sync:live-seq";
|
|
897
|
+
/** A space is pulled at most this often for the live call; more changes wait for the next. */
|
|
898
|
+
const LIVE_PULL_MS = 2000;
|
|
899
|
+
const livePulled = new Map();
|
|
900
|
+
const livePending = new Map();
|
|
901
|
+
function pullSoon(tenant, projectId) {
|
|
902
|
+
if (livePending.has(projectId)) {
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
const wait = Math.max(0, LIVE_PULL_MS - (Date.now() - (livePulled.get(projectId) ?? 0)));
|
|
906
|
+
const timer = setTimeout(() => {
|
|
907
|
+
livePending.delete(projectId);
|
|
908
|
+
livePulled.set(projectId, Date.now());
|
|
909
|
+
void withTenantOf(tenant, () => syncSpace(projectId, "pull")).catch((err) => console.error(`[sync] live pull of ${projectId}:`, err));
|
|
910
|
+
}, wait);
|
|
911
|
+
timer.unref?.();
|
|
912
|
+
livePending.set(projectId, timer);
|
|
913
|
+
}
|
|
914
|
+
/** What the cloud's live call said: pulls the spaces that sync here and changed there. */
|
|
915
|
+
async function heardFromCloud(tenant, e) {
|
|
916
|
+
const synced = new Set(await syncedSpaceIds());
|
|
917
|
+
if (e.event === "changes") {
|
|
918
|
+
for (const id of e.spaces) {
|
|
919
|
+
if (synced.has(id)) {
|
|
920
|
+
pullSoon(tenant, id);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
else if (e.event === "reset") {
|
|
925
|
+
for (const id of synced) {
|
|
926
|
+
pullSoon(tenant, id);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
await writeSetting(LIVE_SEQ, e.seq);
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Keeps the cloud's live call open while the two-way sync and live changes are on, so a change
|
|
933
|
+
* made in the cloud reaches this computer in a second or two, not at the next round. The rounds
|
|
934
|
+
* (every minute, before a page opens) stay for when the call is down.
|
|
935
|
+
*/
|
|
936
|
+
export async function followCloud(signal) {
|
|
937
|
+
// The install's own tenant: what is heard is pulled there, whoever calls `hear`.
|
|
938
|
+
const tenant = currentTenantOrNull() ?? LOCAL_TENANT;
|
|
939
|
+
let wait = 2000;
|
|
940
|
+
while (!signal.aborted) {
|
|
941
|
+
const on = twoWayActive() &&
|
|
942
|
+
Boolean(transport.follow) &&
|
|
943
|
+
feature("liveChanges", await remoteFeatures().catch(() => null));
|
|
944
|
+
if (!on) {
|
|
945
|
+
await pause(30_000, signal);
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
const since = (await readSetting(LIVE_SEQ)) ?? null;
|
|
949
|
+
try {
|
|
950
|
+
await transport.follow?.(since, (e) => void withTenantOf(tenant, () => heardFromCloud(tenant, e)).catch((err) => console.error("[sync] live:", err)), signal);
|
|
951
|
+
wait = 2000;
|
|
952
|
+
}
|
|
953
|
+
catch (err) {
|
|
954
|
+
if (signal.aborted) {
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
// An older cloud has no live call: ask again much later.
|
|
958
|
+
if (err instanceof ServiceError && err.data.reason === "no_live") {
|
|
959
|
+
wait = 10 * 60_000;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
await pause(wait, signal);
|
|
963
|
+
wait = Math.min(wait * 2, 60_000);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
const pause = (ms, signal) => new Promise((done) => {
|
|
967
|
+
const timer = setTimeout(done, ms);
|
|
968
|
+
timer.unref?.();
|
|
969
|
+
signal.addEventListener("abort", () => {
|
|
970
|
+
clearTimeout(timer);
|
|
971
|
+
done();
|
|
972
|
+
}, { once: true });
|
|
973
|
+
});
|
|
@@ -84,6 +84,7 @@ const EN = {
|
|
|
84
84
|
notSignedIn: "You’re not signed in.",
|
|
85
85
|
accountSuspended: "This account is suspended.",
|
|
86
86
|
tooLarge: "That is too large.",
|
|
87
|
+
tooManyStreams: "Too many studio windows are open. Close one, or reload in a moment.",
|
|
87
88
|
tooManyTriesWait: "Too many tries. Wait a moment and try again.",
|
|
88
89
|
tooManyTransfersTry: "Too many transfers. Try again later.",
|
|
89
90
|
pluginNotPartPlan: "This plugin is not part of your plan. It comes with Pro.",
|
|
@@ -260,6 +261,7 @@ const DE = {
|
|
|
260
261
|
notSignedIn: "Du bist nicht angemeldet.",
|
|
261
262
|
accountSuspended: "Dieses Konto ist gesperrt.",
|
|
262
263
|
tooLarge: "Das ist zu groß.",
|
|
264
|
+
tooManyStreams: "Zu viele Fenster des Studios sind offen. Schließ eines, oder lade gleich neu.",
|
|
263
265
|
tooManyTriesWait: "Zu viele Versuche. Warte kurz und versuch es noch einmal.",
|
|
264
266
|
tooManyTransfersTry: "Zu viele Übertragungen. Versuch es später noch einmal.",
|
|
265
267
|
pluginNotPartPlan: "Dieses Plugin gehört nicht zu deinem Paket. Mit Pro ist es dabei.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Ht as r,Nr as i,Qt as a,Ut as o,Vt as s,Wt as c,Yt as l,cr as u,en as d,sn as f,zr as p}from"./ui-BIWmkPh6.js";import{t as m}from"./preload-helper-DpV6A1kQ.js";import{t as h}from"./logo-CGNoptDg.js";import{ht as g,mt as _,tt as v}from"./index-Bjn557f1.js";import{c as y,f as b}from"./settings-menu-CoLUNJGQ.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-BXvT2VMU.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:r,description:a}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(i,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),a?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:a}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:f(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[i,a]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return m(()=>import(`./oss-credits-C2JUsf2d.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||a(``)},[e]);let o=i.trim().toLowerCase(),s=e=>o?e.filter(e=>k(o,e.name,e.license,f(e.description))):e,u=e=>o?e.filter(e=>k(o,e.name,e.license,e.version)):e,d=s(E),p=s(D),h=t?[{id:`shared`,label:f(`about.creditsShared`),packages:u(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:u(e.packages)}))].filter(e=>e.packages.length>0):[],g=d.length===0&&p.length===0&&h.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:f(`about.creditsHint`)}),(0,O.jsx)(c,{type:`search`,value:i,placeholder:f(`about.search`),onChange:e=>a(e.target.value)}),d.length>0?(0,O.jsx)(j,{title:f(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:d})}):null,p.length>0?(0,O.jsx)(j,{title:f(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:p})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(l,{})}):h.length>0?(0,O.jsx)(j,{title:f(`about.creditsDeps`),hint:o?void 0:f(`about.creditsDepsHint`),children:h.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(r,{children:f(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>f(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?f(`about.change`):f(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let r=e?.mode===`local`,{data:i,latest:o}=_(r&&t),[s,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(n);(0,T.useEffect)(()=>m(n),[n]);let E=b(F.indexOf(u)),D=i?.newer&&o?o:g;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return c(null),S(D===`0.11.0`?void 0:D).then(t=>{e||c(t)}),()=>{e=!0}},[t,D]);let k=s?.find(e=>e.version===`v${D}`)??s?.[0]??null,A=s?.filter(e=>e!==k)??[],j=r?i?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(h,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[f(`about.version`,{v:g}),j?` · ${f(`about.kind.${j}`)}`:``]})]}),r?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(v,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(a,{value:u,onChange:m,options:F.map(e=>({id:e,label:I(e)})),label:f(`about.title`)})}),(0,O.jsxs)(`div`,{className:d(`mt-5`,y(E)),children:[u===`new`?s===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(l,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:f(`about.changelogEmpty`)}):null,u===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(p,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,u===`credits`?(0,O.jsx)(P,{active:!0}):null]},u)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(s,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(o,{label:f(`common.close`),onClick:t,children:(0,O.jsx)(u,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Ht as r,Vt as i,Wt as a,Yt as o,en as s,sn as c}from"./ui-BIWmkPh6.js";import{t as l}from"./preload-helper-DpV6A1kQ.js";var u=e(t(),1),d=e(n(),1);function f(e){switch(e.group){case`Added`:return{label:`NEW`,dot:`bg-moss`};case`Fixed`:return{label:`FIXED`,dot:`bg-amber`};case`Changed`:return{label:`CHANGED`,dot:`bg-cobalt`};case`Performance`:return{label:`PERFORMANCE`,dot:`bg-ember`};case`Deploy`:return{label:`DEPLOY`,dot:`bg-ink-4`};case`Docs`:return{label:`DOCS`,dot:`bg-ink-4`};default:return{label:`OTHER`,dot:`bg-ink-4`}}}var p=e=>e.version?e.version.replace(/^v/,``):c(`about.unreleased`),m=e=>e.timestamp?new Date(e.timestamp*1e3).toISOString().slice(0,10):``,h=e=>e.charAt(0).toUpperCase()+e.slice(1);function g(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){if(`${p(t)} ${m(t)}`.toLowerCase().includes(n)){r.push(t);continue}let e=t.commits.filter(e=>`${f(e).label} ${e.scope??``} ${e.message}`.toLowerCase().includes(n));e.length>0&&r.push({...t,commits:e})}return r}async function _(e){if(e)try{let t=await fetch(`https://raw.githubusercontent.com/engenty/wizards/v${e}/apps/web/src/about/changelog.json`,{signal:AbortSignal.timeout(5e3)});if(t.ok)return await t.json()}catch{}return(await l(async()=>{let{default:e}=await import(`./changelog-zllICQ4q.js`);return{default:e}},[])).default}function v({release:e}){return(0,d.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.commits.map(e=>{let t=f(e);return(0,d.jsxs)(`li`,{className:`flex items-start gap-2.5 text-[0.875rem]`,children:[(0,d.jsx)(`span`,{className:s(`mt-[7px] size-1.5 shrink-0 rounded-full`,t.dot)}),(0,d.jsxs)(`span`,{className:`min-w-0 text-ink-2`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-[0.75rem] text-ink tracking-wide`,children:[t.label,e.scope?` [${e.scope}]`:``]}),` `,h(e.message),e.breaking?(0,d.jsx)(`span`,{className:`ml-1.5 rounded-full bg-rose-tint px-1.5 py-0.5 font-medium text-[0.75rem] text-rose`,children:c(`about.breaking`)}):null]})]},e.id)})})}function y({open:e,onClose:t,version:n}){let[s,l]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||s)return;let t=!1;return _(n).then(e=>{t||l(e)}),()=>{t=!0}},[e,s,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=s?g(s,f):[];return(0,d.jsxs)(i,{open:e,onClose:t,title:c(`about.changelog`),wide:!0,height:`tall`,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:c(`about.changelogHint`)}),s===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(o,{})}):s.length===0?(0,d.jsx)(r,{children:c(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a,{type:`search`,value:f,placeholder:c(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(r,{children:c(`about.noMatches`)}):null,y.map(e=>(0,d.jsxs)(`section`,{className:`mt-6`,children:[(0,d.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[p(e),(0,d.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:m(e)})]}),(0,d.jsx)(`div`,{className:`mt-3`,children:(0,d.jsx)(v,{release:e})})]},e.version??`unreleased`))]})]})}export{y as ChangelogDialog,v as ReleaseNotes,_ as loadReleases,m as releaseDate,p as releaseLabel};
|