wizards 0.5.7 → 0.5.8
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/agents/architect.js +13 -26
- package/apps/runtime/dist/agents/studio-assistant.js +19 -22
- package/apps/runtime/dist/agents/subscription.js +10 -9
- package/apps/runtime/dist/app.js +6 -6
- package/apps/runtime/dist/assistant/knows.js +10 -9
- package/apps/runtime/dist/connectors/external.js +3 -3
- package/apps/runtime/dist/connectors/index.js +23 -23
- package/apps/runtime/dist/connectors/via-account.js +6 -6
- package/apps/runtime/dist/documents/parse.js +3 -3
- package/apps/runtime/dist/engine/input.js +11 -11
- package/apps/runtime/dist/engine/requirements.js +7 -8
- package/apps/runtime/dist/engine/runner.js +10 -14
- package/apps/runtime/dist/engine/steps.js +6 -6
- package/apps/runtime/dist/engine/surface.js +2 -2
- package/apps/runtime/dist/film/step.js +5 -5
- package/apps/runtime/dist/harness/apple.js +2 -1
- package/apps/runtime/dist/harness/claude.js +2 -2
- package/apps/runtime/dist/harness/codex.js +2 -2
- package/apps/runtime/dist/harness/model.js +4 -5
- package/apps/runtime/dist/harness/terminal.js +4 -4
- package/apps/runtime/dist/media/conversation.js +18 -35
- package/apps/runtime/dist/media/transcribe.js +2 -1
- package/apps/runtime/dist/model-errors.js +1 -1
- package/apps/runtime/dist/models.js +32 -40
- package/apps/runtime/dist/plugins/runs.js +3 -5
- package/apps/runtime/dist/routes/api.js +9 -9
- package/apps/runtime/dist/routes/lang.js +14 -9
- package/apps/runtime/dist/routes/runs.js +5 -5
- package/apps/runtime/dist/routes/studio.js +38 -37
- package/apps/runtime/dist/services/access.js +4 -4
- package/apps/runtime/dist/services/architect.js +3 -12
- package/apps/runtime/dist/services/assistant-chats.js +2 -2
- package/apps/runtime/dist/services/brand.js +3 -3
- package/apps/runtime/dist/services/cloud.js +5 -5
- package/apps/runtime/dist/services/errors.js +2 -2
- package/apps/runtime/dist/services/knowledge-model.js +3 -3
- package/apps/runtime/dist/services/marketplace.js +3 -3
- package/apps/runtime/dist/services/package-file.js +9 -11
- package/apps/runtime/dist/services/package.js +8 -9
- package/apps/runtime/dist/services/profile.js +2 -1
- package/apps/runtime/dist/services/project-files.js +13 -13
- package/apps/runtime/dist/services/projects.js +7 -11
- package/apps/runtime/dist/services/runners.js +4 -4
- package/apps/runtime/dist/services/runs.js +7 -10
- package/apps/runtime/dist/services/shares.js +2 -2
- package/apps/runtime/dist/services/site.js +8 -11
- package/apps/runtime/dist/services/space-categories.js +7 -7
- package/apps/runtime/dist/services/space-data.js +20 -20
- package/apps/runtime/dist/services/spaces.js +7 -9
- package/apps/runtime/dist/services/wizards.js +11 -13
- package/apps/runtime/dist/store/index.js +2 -2
- package/apps/runtime/dist/texts.js +195 -0
- package/apps/runtime/dist/tools/plugin.js +7 -3
- package/apps/runtime/dist/widgets/step.js +2 -2
- package/apps/web/dist/assets/AboutDialog-BcTtA42P.js +1 -0
- package/apps/web/dist/assets/{ChangelogDialog-rAtYZjxz.js → ChangelogDialog-DMOWV_Iu.js} +1 -1
- package/apps/web/dist/assets/ChatView-CrnrYHjp.js +10 -0
- package/apps/web/dist/assets/EditorPage-DpEw3eOu.js +3 -0
- package/apps/web/dist/assets/{FlowPreview--3-yI51e.js → FlowPreview-CzmH4JUQ.js} +1 -1
- package/apps/web/dist/assets/{Harness-B9tvFe0U.js → Harness-DipH0Vec.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-BxrBhC9U.js → NewWizardChannels-DShu0PP6.js} +1 -1
- package/apps/web/dist/assets/NewWizardPage-HSa6PNJs.js +7 -0
- package/apps/web/dist/assets/{OnboardingPage-DPdH9sSj.js → OnboardingPage-CPADMs4c.js} +1 -1
- package/apps/web/dist/assets/ProjectPage-DMPcrhgt.js +1 -0
- package/apps/web/dist/assets/{PublicRunner-Bv3TMKw4.js → PublicRunner-DZ5sWmtg.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-CmqIrOAR.js → ReadOnly-B9xaq_M3.js} +1 -1
- package/apps/web/dist/assets/RunDrawer-9nMGhbSm.js +4 -0
- package/apps/web/dist/assets/{RunnerView-Cd1VAlIA.js → RunnerView-NSSP3tc6.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-Dy9MbwQh.js +1 -0
- package/apps/web/dist/assets/SetupPage-kemgI7v5.js +1 -0
- package/apps/web/dist/assets/{SharePage-BT80wI1I.js → SharePage-CQfIdcwy.js} +1 -1
- package/apps/web/dist/assets/changelog-BW40vzI6.js +1 -0
- package/apps/web/dist/assets/{esm-BTVd6EFo.js → esm-BF1nonbH.js} +1 -1
- package/apps/web/dist/assets/index-DQ9qAB4v.js +14 -0
- package/apps/web/dist/assets/{lock-ByHFI96G.js → lock-DVvM6IsA.js} +1 -1
- package/apps/web/dist/assets/{phone-KPwxAM1R.js → phone-3fG1okFs.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-K5bg3QE3.js → settings-menu-D9fbi1Z0.js} +1 -1
- package/apps/web/dist/assets/ui-EuR3jezP.js +134 -0
- package/apps/web/dist/assets/{upload-BsIL8tNR.js → upload-BsMUhEfX.js} +1 -1
- package/apps/web/dist/index.html +2 -2
- package/apps/web/dist/mcp/flow.html +77 -77
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +26 -9
- package/node_modules/@engenty-wizards/shared/dist/definition.js +125 -3
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +1 -1
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +9 -8
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +6 -6
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +78 -205
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +167 -68
- package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +3 -6
- package/node_modules/@engenty-wizards/shared/dist/projects.js +9 -9
- package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +33 -7
- package/node_modules/@engenty-wizards/shared/dist/providers.js +88 -37
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +298 -365
- package/node_modules/@engenty-wizards/shared/dist/run.js +582 -240
- package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +36 -0
- package/node_modules/@engenty-wizards/shared/dist/texts.js +46 -0
- package/package.json +1 -1
- package/apps/web/dist/assets/AboutDialog-t9bayaIs.js +0 -1
- package/apps/web/dist/assets/ChatView-C3VqLT98.js +0 -10
- package/apps/web/dist/assets/EditorPage-D3Ef24b9.js +0 -3
- package/apps/web/dist/assets/NewWizardPage-C1_hsQPr.js +0 -7
- package/apps/web/dist/assets/ProjectPage-P40R1cPE.js +0 -1
- package/apps/web/dist/assets/RunDrawer-9qG1G-OY.js +0 -4
- package/apps/web/dist/assets/SettingsPage-DFz4UMfo.js +0 -1
- package/apps/web/dist/assets/SetupPage-B0UBNMB9.js +0 -1
- package/apps/web/dist/assets/changelog-BpSBMjpm.js +0 -1
- package/apps/web/dist/assets/index-D8vwgldH.js +0 -14
- package/apps/web/dist/assets/ui-4bQx9I1f.js +0 -134
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnValueError, tableColumnsSchema, } from "@engenty-wizards/shared/engenty/data-tables";
|
|
2
|
-
import {
|
|
2
|
+
import { note } from "@engenty-wizards/shared/run";
|
|
3
3
|
import { editCells, SPACE_DATA_LIMITS, } from "@engenty-wizards/shared/space-data";
|
|
4
4
|
import { rowKey } from "@engenty-wizards/shared/store";
|
|
5
5
|
import { and, asc, count, desc, eq, inArray, isNotNull, isNull, max } from "drizzle-orm";
|
|
@@ -7,6 +7,7 @@ import { nanoid } from "nanoid";
|
|
|
7
7
|
import { db, schema } from "../db/client.js";
|
|
8
8
|
import { saidOf } from "../model-errors.js";
|
|
9
9
|
import { currentTenant } from "../tenants/tenant.js";
|
|
10
|
+
import { serverText } from "../texts.js";
|
|
10
11
|
import { projectWritable, requireWritableProject } from "./access.js";
|
|
11
12
|
import { notFound, ServiceError } from "./errors.js";
|
|
12
13
|
import { filePaths, freeSlug, knowledgePage, pageTree, tablePaths } from "./knowledge.js";
|
|
@@ -23,7 +24,7 @@ async function ownerOf(projectId, wizardId) {
|
|
|
23
24
|
columns: { id: true },
|
|
24
25
|
});
|
|
25
26
|
if (!w) {
|
|
26
|
-
throw new ServiceError("invalid",
|
|
27
|
+
throw new ServiceError("invalid", note("wizardNotSpace"));
|
|
27
28
|
}
|
|
28
29
|
return w.id;
|
|
29
30
|
}
|
|
@@ -36,7 +37,7 @@ function cellError(err) {
|
|
|
36
37
|
export function checkColumns(columns) {
|
|
37
38
|
const parsed = tableColumnsSchema.safeParse(columns);
|
|
38
39
|
if (!parsed.success) {
|
|
39
|
-
throw new ServiceError("invalid", parsed.error.issues[0]?.message ??
|
|
40
|
+
throw new ServiceError("invalid", parsed.error.issues[0]?.message ?? note("invalidColumns"));
|
|
40
41
|
}
|
|
41
42
|
return parsed.data;
|
|
42
43
|
}
|
|
@@ -104,11 +105,10 @@ async function tableCount(projectId) {
|
|
|
104
105
|
.from(schema.spaceTable)
|
|
105
106
|
.where(eq(schema.spaceTable.projectId, projectId));
|
|
106
107
|
if (n >= SPACE_DATA_LIMITS.tables) {
|
|
107
|
-
throw new ServiceError("refused",
|
|
108
|
+
throw new ServiceError("refused", note("spaceMostTables", { count: SPACE_DATA_LIMITS.tables }));
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
export async function createTable(userId, projectId, input, lang = "en") {
|
|
111
|
-
const de = lang === "de";
|
|
112
112
|
const project = await ownedProject(userId, projectId);
|
|
113
113
|
await requireWritableProject(project.id);
|
|
114
114
|
await tableCount(project.id);
|
|
@@ -116,10 +116,10 @@ export async function createTable(userId, projectId, input, lang = "en") {
|
|
|
116
116
|
? checkColumns(input.columns)
|
|
117
117
|
: input.format === "faq"
|
|
118
118
|
? [
|
|
119
|
-
{ id: "question", name:
|
|
119
|
+
{ id: "question", name: serverText(lang, "faqQuestion"), type: "text" },
|
|
120
120
|
{
|
|
121
121
|
id: "answer",
|
|
122
|
-
name:
|
|
122
|
+
name: serverText(lang, "faqAnswer"),
|
|
123
123
|
type: "text",
|
|
124
124
|
format: { style: "multiline" },
|
|
125
125
|
},
|
|
@@ -127,7 +127,7 @@ export async function createTable(userId, projectId, input, lang = "en") {
|
|
|
127
127
|
: [{ id: "name", name: "Name", type: "text" }];
|
|
128
128
|
const id = nanoid(12);
|
|
129
129
|
const wizardId = await ownerOf(project.id, input.wizardId);
|
|
130
|
-
const title = input.title.trim() || (
|
|
130
|
+
const title = input.title.trim() || serverText(lang, "tableTitle");
|
|
131
131
|
await db.insert(schema.spaceTable).values({
|
|
132
132
|
id,
|
|
133
133
|
tenantId: currentTenant(),
|
|
@@ -187,7 +187,7 @@ export async function getTable(userId, tableId) {
|
|
|
187
187
|
export async function updateTable(_userId, tableId, patch) {
|
|
188
188
|
const table = await writableTable(tableId);
|
|
189
189
|
if (table.list && (patch.columns !== undefined || patch.wizardId !== undefined)) {
|
|
190
|
-
throw new ServiceError("refused",
|
|
190
|
+
throw new ServiceError("refused", note("tableBelongsOneWizard"));
|
|
191
191
|
}
|
|
192
192
|
const title = patch.title !== undefined ? patch.title.trim() || table.title : table.title;
|
|
193
193
|
const wizardId = patch.wizardId !== undefined ? await ownerOf(table.projectId, patch.wizardId) : table.wizardId;
|
|
@@ -250,7 +250,7 @@ async function refuseClash(tableId, key, rowId) {
|
|
|
250
250
|
columns: { id: true },
|
|
251
251
|
});
|
|
252
252
|
if (other && other.id !== rowId) {
|
|
253
|
-
throw new ServiceError("invalid",
|
|
253
|
+
throw new ServiceError("invalid", note("entryAlreadyExists"));
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
/** After a row of a table of Knowledge changed: its categories from its columns, its unit. */
|
|
@@ -269,7 +269,7 @@ export async function addTableRow(_userId, tableId, cells = {}) {
|
|
|
269
269
|
.from(schema.spaceTableRow)
|
|
270
270
|
.where(eq(schema.spaceTableRow.tableId, table.id));
|
|
271
271
|
if (n >= SPACE_DATA_LIMITS.rowsPerTable) {
|
|
272
|
-
throw new ServiceError("refused",
|
|
272
|
+
throw new ServiceError("refused", note("tableMostRows", { count: SPACE_DATA_LIMITS.rowsPerTable }));
|
|
273
273
|
}
|
|
274
274
|
let value;
|
|
275
275
|
try {
|
|
@@ -334,7 +334,7 @@ async function pageRow(pageId) {
|
|
|
334
334
|
}
|
|
335
335
|
function checkMarkdown(markdown) {
|
|
336
336
|
if (markdown.length > SPACE_DATA_LIMITS.pageChars) {
|
|
337
|
-
throw new ServiceError("refused",
|
|
337
|
+
throw new ServiceError("refused", note("pageMostChars", { count: SPACE_DATA_LIMITS.pageChars }));
|
|
338
338
|
}
|
|
339
339
|
return markdown;
|
|
340
340
|
}
|
|
@@ -344,7 +344,7 @@ async function pageCount(projectId, more = 1) {
|
|
|
344
344
|
.from(schema.spacePage)
|
|
345
345
|
.where(eq(schema.spacePage.projectId, projectId));
|
|
346
346
|
if (n + more > SPACE_DATA_LIMITS.pages) {
|
|
347
|
-
throw new ServiceError("refused",
|
|
347
|
+
throw new ServiceError("refused", note("spaceMostPages", { count: SPACE_DATA_LIMITS.pages }));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
/** A page of the space's own that a sub-page may stand under: never one of its own sub-pages. */
|
|
@@ -357,11 +357,11 @@ async function parentOf(projectId, parentId, pageId) {
|
|
|
357
357
|
columns: { id: true, wizardId: true, parentId: true },
|
|
358
358
|
});
|
|
359
359
|
if (!parent || parent.wizardId) {
|
|
360
|
-
throw new ServiceError("invalid",
|
|
360
|
+
throw new ServiceError("invalid", note("pageNotSubpages"));
|
|
361
361
|
}
|
|
362
362
|
for (let at = parent.id; at && pageId;) {
|
|
363
363
|
if (at === pageId) {
|
|
364
|
-
throw new ServiceError("invalid",
|
|
364
|
+
throw new ServiceError("invalid", note("pageNotOwnSubpage"));
|
|
365
365
|
}
|
|
366
366
|
const up = await db.query.spacePage.findFirst({
|
|
367
367
|
where: eq(schema.spacePage.id, at),
|
|
@@ -492,7 +492,7 @@ export async function runPages(projectId, wizardId) {
|
|
|
492
492
|
export async function writeRunPage(projectId, wizardId, input) {
|
|
493
493
|
const title = input.title.trim();
|
|
494
494
|
if (!title) {
|
|
495
|
-
throw new ServiceError("invalid",
|
|
495
|
+
throw new ServiceError("invalid", note("pageNeedsTitle"));
|
|
496
496
|
}
|
|
497
497
|
const existing = (await db.query.spacePage.findMany({
|
|
498
498
|
where: and(eq(schema.spacePage.projectId, projectId), eq(schema.spacePage.wizardId, wizardId)),
|
|
@@ -513,7 +513,7 @@ export async function writeRunPage(projectId, wizardId, input) {
|
|
|
513
513
|
.from(schema.spacePage)
|
|
514
514
|
.where(eq(schema.spacePage.projectId, projectId));
|
|
515
515
|
if (n >= SPACE_DATA_LIMITS.pages) {
|
|
516
|
-
throw new ServiceError("refused",
|
|
516
|
+
throw new ServiceError("refused", note("spaceMostPages", { count: SPACE_DATA_LIMITS.pages }));
|
|
517
517
|
}
|
|
518
518
|
const id = nanoid(12);
|
|
519
519
|
await db.insert(schema.spacePage).values({
|
|
@@ -532,7 +532,7 @@ async function originSpace(space) {
|
|
|
532
532
|
columns: { id: true },
|
|
533
533
|
});
|
|
534
534
|
if (!project) {
|
|
535
|
-
throw new ServiceError("not_found",
|
|
535
|
+
throw new ServiceError("not_found", note("unknownSpace", { space }));
|
|
536
536
|
}
|
|
537
537
|
await requireWritableProject(project.id);
|
|
538
538
|
return project.id;
|
|
@@ -566,7 +566,7 @@ export async function putOriginPage(origin, input) {
|
|
|
566
566
|
})
|
|
567
567
|
: null;
|
|
568
568
|
if (input.parent && !parent) {
|
|
569
|
-
throw new ServiceError("invalid",
|
|
569
|
+
throw new ServiceError("invalid", note("noParentPage", { parent: input.parent }));
|
|
570
570
|
}
|
|
571
571
|
const title = input.title.replace(/\s+/g, " ").trim().slice(0, 200) || "Seite";
|
|
572
572
|
const markdown = checkMarkdown(input.markdown);
|
|
@@ -630,7 +630,7 @@ export async function putOriginTable(origin, input) {
|
|
|
630
630
|
}
|
|
631
631
|
const columns = checkColumns(input.columns);
|
|
632
632
|
if (input.rows.length > SPACE_DATA_LIMITS.rowsPerTable) {
|
|
633
|
-
throw new ServiceError("refused",
|
|
633
|
+
throw new ServiceError("refused", note("tableMostRows", { count: SPACE_DATA_LIMITS.rowsPerTable }));
|
|
634
634
|
}
|
|
635
635
|
let cells;
|
|
636
636
|
try {
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { tableColumnsSchema } from "@engenty-wizards/shared/engenty/data-tables";
|
|
3
3
|
import { CATEGORY_TYPES } from "@engenty-wizards/shared/knowledge";
|
|
4
4
|
import { PROJECT_LIMITS } from "@engenty-wizards/shared/projects";
|
|
5
|
-
import {
|
|
5
|
+
import { note } from "@engenty-wizards/shared/run";
|
|
6
6
|
import { SPACE_DATA_LIMITS } from "@engenty-wizards/shared/space-data";
|
|
7
7
|
import { WORKSPACE_LIMITS } from "@engenty-wizards/shared/workspace";
|
|
8
8
|
import { and, count, eq, inArray, isNull, notInArray, sql } from "drizzle-orm";
|
|
@@ -150,9 +150,7 @@ async function requireRoom(spaceId) {
|
|
|
150
150
|
.where(and(counted, sql `${schema.project.id} <> ${spaceId}`));
|
|
151
151
|
const limit = await projectLimit();
|
|
152
152
|
if (others.length >= limit) {
|
|
153
|
-
throw new ServiceError("refused", limit === 1
|
|
154
|
-
? bilingual("Dieses Konto hat hier schon einen Space.", "This account already has a space here.")
|
|
155
|
-
: bilingual(`Dieses Konto hat hier schon ${limit} Spaces.`, `This account already has ${limit} spaces here.`), {
|
|
153
|
+
throw new ServiceError("refused", limit === 1 ? note("accountAlreadySpace") : note("accountAlreadySpaces", { count: limit }), {
|
|
156
154
|
reason: "space_limit",
|
|
157
155
|
limit,
|
|
158
156
|
spaces: others.filter((p) => p.origin === "local").map((p) => ({ id: p.id, name: p.name })),
|
|
@@ -166,7 +164,7 @@ async function requireWizardRoom(spaceId) {
|
|
|
166
164
|
.from(schema.wizard)
|
|
167
165
|
.where(eq(schema.wizard.projectId, spaceId));
|
|
168
166
|
if ((row?.n ?? 0) >= env.limits.syncedWizards) {
|
|
169
|
-
throw new ServiceError("refused",
|
|
167
|
+
throw new ServiceError("refused", note("roomMostPublishedWizards", { count: env.limits.syncedWizards }), { reason: "wizard_limit", limit: env.limits.syncedWizards });
|
|
170
168
|
}
|
|
171
169
|
}
|
|
172
170
|
const hashOf = (data) => createHash("sha256").update(data).digest("hex");
|
|
@@ -200,7 +198,7 @@ async function syncLogo(projectId, logo) {
|
|
|
200
198
|
async function syncSpace(spaceId, space) {
|
|
201
199
|
const existing = await syncedProject(spaceId);
|
|
202
200
|
if (existing && existing.origin !== "local") {
|
|
203
|
-
throw new ServiceError("refused",
|
|
201
|
+
throw new ServiceError("refused", note("spaceIdAlreadyExists"), {
|
|
204
202
|
reason: "id_taken",
|
|
205
203
|
});
|
|
206
204
|
}
|
|
@@ -251,7 +249,7 @@ export async function syncWizard(rawSpaceId, rawWizardId, input) {
|
|
|
251
249
|
where: and(eq(schema.wizard.id, wizardId), eq(schema.wizard.tenantId, currentTenant())),
|
|
252
250
|
});
|
|
253
251
|
if (existing && existing.projectId !== spaceId) {
|
|
254
|
-
throw new ServiceError("refused",
|
|
252
|
+
throw new ServiceError("refused", note("wizardIdAlreadyBelongs"), {
|
|
255
253
|
reason: "id_taken",
|
|
256
254
|
});
|
|
257
255
|
}
|
|
@@ -507,7 +505,7 @@ export async function syncSpaceData(rawSpaceId, input) {
|
|
|
507
505
|
: [],
|
|
508
506
|
]);
|
|
509
507
|
if ([...tablesHere, ...pagesHere].some((x) => x.projectId !== spaceId || x.wizardId !== null)) {
|
|
510
|
-
throw new ServiceError("refused",
|
|
508
|
+
throw new ServiceError("refused", note("idAlreadyUse"), {
|
|
511
509
|
reason: "id_taken",
|
|
512
510
|
});
|
|
513
511
|
}
|
|
@@ -585,7 +583,7 @@ async function syncCategories(spaceId, categories, assignments) {
|
|
|
585
583
|
})
|
|
586
584
|
: [];
|
|
587
585
|
if (taken.some((c) => c.projectId !== spaceId)) {
|
|
588
|
-
throw new ServiceError("refused",
|
|
586
|
+
throw new ServiceError("refused", note("idAlreadyUse"), {
|
|
589
587
|
reason: "id_taken",
|
|
590
588
|
});
|
|
591
589
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { versionChanges } from "@engenty-wizards/shared/changes";
|
|
2
2
|
import { pluginToolOf, shapeIssues, validateWizard, wizardSchema, } from "@engenty-wizards/shared/definition";
|
|
3
|
-
import {
|
|
3
|
+
import { note } from "@engenty-wizards/shared/run";
|
|
4
4
|
import { and, desc, eq, sql } from "drizzle-orm";
|
|
5
5
|
import { nanoid } from "nanoid";
|
|
6
6
|
import { applyOps, OpError } from "../authoring/ops.js";
|
|
@@ -11,6 +11,7 @@ import { saidOf } from "../model-errors.js";
|
|
|
11
11
|
import { pluginToolsOf } from "../plugins/registry.js";
|
|
12
12
|
import { dropLinks, putLink } from "../tenants/control.js";
|
|
13
13
|
import { currentTenant } from "../tenants/tenant.js";
|
|
14
|
+
import { serverText } from "../texts.js";
|
|
14
15
|
import { requireAdmin, requireBuild, requireWritable, requireWritableProject } from "./access.js";
|
|
15
16
|
import { changedSteps, emitDraftChanged } from "./draft-events.js";
|
|
16
17
|
import { notFound, ServiceError } from "./errors.js";
|
|
@@ -21,10 +22,9 @@ import { defaultProject, ownedProject } from "./projects.js";
|
|
|
21
22
|
import { checkRunnerSettings } from "./runners.js";
|
|
22
23
|
/** The wizard a new one starts as, in the language of whoever makes it. */
|
|
23
24
|
function blankWizard(lang) {
|
|
24
|
-
const de = lang === "de";
|
|
25
25
|
return {
|
|
26
26
|
version: 1,
|
|
27
|
-
title:
|
|
27
|
+
title: serverText(lang, "newWizard"),
|
|
28
28
|
description: "",
|
|
29
29
|
avatar: "round",
|
|
30
30
|
lang,
|
|
@@ -32,17 +32,17 @@ function blankWizard(lang) {
|
|
|
32
32
|
{
|
|
33
33
|
id: "start",
|
|
34
34
|
type: "page",
|
|
35
|
-
title:
|
|
35
|
+
title: serverText(lang, "newWizardStart"),
|
|
36
36
|
fields: [
|
|
37
37
|
{
|
|
38
38
|
id: "input",
|
|
39
|
-
label:
|
|
39
|
+
label: serverText(lang, "newWizardAsk"),
|
|
40
40
|
kind: "textarea",
|
|
41
41
|
required: true,
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
44
|
},
|
|
45
|
-
{ id: "done", type: "result", title:
|
|
45
|
+
{ id: "done", type: "result", title: serverText(lang, "newWizardDone"), deliverables: [] },
|
|
46
46
|
],
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -239,7 +239,7 @@ export async function createWizard(userId, input, writer = { source: "studio" })
|
|
|
239
239
|
? await marketplaceWizard(input.starterId, asLang(input.lang))
|
|
240
240
|
: undefined;
|
|
241
241
|
if (input.starterId && !starter) {
|
|
242
|
-
throw new ServiceError("invalid",
|
|
242
|
+
throw new ServiceError("invalid", note("unknownTemplate", { starterId: input.starterId }));
|
|
243
243
|
}
|
|
244
244
|
const maker = input.lang?.toLowerCase().startsWith("de") ? "de" : "en";
|
|
245
245
|
const { draft, issues } = input.definition !== undefined
|
|
@@ -279,9 +279,7 @@ export async function createWizard(userId, input, writer = { source: "studio" })
|
|
|
279
279
|
else if (fromStarter) {
|
|
280
280
|
await addMessage(id, {
|
|
281
281
|
role: "assistant",
|
|
282
|
-
content: fromStarter.language
|
|
283
|
-
? `I have set up the template "${fromStarter.title}" for you. Test it at the top right – or tell me what should be different.`
|
|
284
|
-
: `Ich habe die Vorlage „${fromStarter.title}“ für dich angelegt. Teste sie rechts oben – oder sag mir, was anders sein soll.`,
|
|
282
|
+
content: serverText(fromStarter.language, "templateSetUp", { title: fromStarter.title }),
|
|
285
283
|
});
|
|
286
284
|
}
|
|
287
285
|
return { id, revision: 0, issues, studioUrl: studioUrl(id) };
|
|
@@ -308,7 +306,7 @@ export async function writeDraft(userId, wizardId, input, writer = { source: "st
|
|
|
308
306
|
.returning({ revision: schema.wizard.revision });
|
|
309
307
|
if (!row) {
|
|
310
308
|
const current = await ownedWizard(userId, wizardId);
|
|
311
|
-
throw new ServiceError("revision_conflict",
|
|
309
|
+
throw new ServiceError("revision_conflict", note("wizardChangedMeantime"), {
|
|
312
310
|
revision: current.revision,
|
|
313
311
|
});
|
|
314
312
|
}
|
|
@@ -329,7 +327,7 @@ export async function writeDraft(userId, wizardId, input, writer = { source: "st
|
|
|
329
327
|
export async function editWizard(userId, wizardId, input, writer) {
|
|
330
328
|
const w = await writableWizard(userId, wizardId);
|
|
331
329
|
if (w.revision !== input.baseRevision) {
|
|
332
|
-
throw new ServiceError("revision_conflict",
|
|
330
|
+
throw new ServiceError("revision_conflict", note("wizardChangedMeantime"), {
|
|
333
331
|
revision: w.revision,
|
|
334
332
|
});
|
|
335
333
|
}
|
|
@@ -401,7 +399,7 @@ export async function requireClean(w) {
|
|
|
401
399
|
const files = await draftFiles(w.id);
|
|
402
400
|
const issues = await checkDraft(w.projectId, w.draft, files.map((f) => f.path));
|
|
403
401
|
if (issues.length) {
|
|
404
|
-
throw new ServiceError("has_issues",
|
|
402
|
+
throw new ServiceError("has_issues", note("wizardStillErrors"), { issues });
|
|
405
403
|
}
|
|
406
404
|
return { definition: w.draft, files };
|
|
407
405
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { note } from "@engenty-wizards/shared/run";
|
|
2
2
|
import { firstRowAt, newCells, patchCells, rowKey, STORE_LIMITS, } from "@engenty-wizards/shared/store";
|
|
3
3
|
import { cleanPath, mimeForPath } from "@engenty-wizards/shared/workspace";
|
|
4
4
|
import { and, asc, eq, inArray, like, lt, sql } from "drizzle-orm";
|
|
@@ -118,7 +118,7 @@ export async function updateRow(scope, def, rowId, patch) {
|
|
|
118
118
|
})
|
|
119
119
|
: null;
|
|
120
120
|
if (clash) {
|
|
121
|
-
throw new StoreError(
|
|
121
|
+
throw new StoreError(note("entryAlreadyExists"));
|
|
122
122
|
}
|
|
123
123
|
await db
|
|
124
124
|
.update(schema.storeRow)
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { textOf } from "@engenty-wizards/shared/texts";
|
|
2
|
+
/**
|
|
3
|
+
* What the server says itself, in each language: answers to a request, the lines about the
|
|
4
|
+
* assistants' work, the words of what it makes for a person (a first space, a new wizard).
|
|
5
|
+
* What a run reports, and errors that travel on as notes, are `RUN_NOTES` (shared/run).
|
|
6
|
+
*/
|
|
7
|
+
const EN = {
|
|
8
|
+
keyUnknown: "The provider doesn’t recognise this key.",
|
|
9
|
+
providerError: "The provider answered with error {status}.",
|
|
10
|
+
providerUnreachable: "The provider cannot be reached right now.",
|
|
11
|
+
importedFrom: "Imported from “{name}”: {steps}, {files}.",
|
|
12
|
+
imported: "Imported: {steps}, {files}.",
|
|
13
|
+
stepCount: { one: "{count} step", other: "{count} steps" },
|
|
14
|
+
fileCount: { one: "{count} file", other: "{count} files" },
|
|
15
|
+
spaceStillNeeds: "This space still needs: {needs}. Add it under Settings → Connectors.",
|
|
16
|
+
notFinished: "I have not quite finished. Write “continue” and I will carry on right there.",
|
|
17
|
+
done: "Done.",
|
|
18
|
+
notUnderstood: "I did not understand that – could you put it differently?",
|
|
19
|
+
siteTakingOver: "Taking over what the website says …",
|
|
20
|
+
siteWritingPages: "Writing the pages into Knowledge …",
|
|
21
|
+
siteReading: "Reading the details …",
|
|
22
|
+
siteFailed: "The website could not be taken over.",
|
|
23
|
+
faqQuestion: "Question",
|
|
24
|
+
faqAnswer: "Answer",
|
|
25
|
+
tableTitle: "Table",
|
|
26
|
+
newWizard: "New wizard",
|
|
27
|
+
newWizardStart: "Let's start",
|
|
28
|
+
newWizardAsk: "What is it about?",
|
|
29
|
+
newWizardDone: "Done",
|
|
30
|
+
templateSetUp: "I have set up the template “{title}” for you. Test it at the top right – or tell me what should be different.",
|
|
31
|
+
imapHint: "Gmail, iCloud, GMX and web.de need an app password (in your account's security settings), not your normal password.",
|
|
32
|
+
doingSaveLogo: "Fetching the logo …",
|
|
33
|
+
doingSaveFile: "Fetching a file …",
|
|
34
|
+
doingSetLogoSections: "Grouping the logos …",
|
|
35
|
+
doingSetAssetSections: "Grouping the assets …",
|
|
36
|
+
doingSetTypography: "Entering the fonts …",
|
|
37
|
+
doingSetGradients: "Entering the gradients …",
|
|
38
|
+
doingSetRules: "Entering rules …",
|
|
39
|
+
doingSetProfile: "Writing title and description …",
|
|
40
|
+
doingSetFacts: "Entering facts …",
|
|
41
|
+
doingSetColors: "Entering the colours …",
|
|
42
|
+
doingLookAtFile: "Looking at a file …",
|
|
43
|
+
doingDescribeFile: "Describing a file …",
|
|
44
|
+
doingWebSearch: "Searching the web …",
|
|
45
|
+
doingReadSite: "Reading {host} …",
|
|
46
|
+
doingReadWebsite: "Reading the website …",
|
|
47
|
+
doingGuide: "Reading the building guide",
|
|
48
|
+
doingTemplate: "Looking at a template",
|
|
49
|
+
doingReadWizard: "Reading the wizard",
|
|
50
|
+
doingWriteFiles: "Writing files",
|
|
51
|
+
doingRebuild: "Rebuilding the wizard",
|
|
52
|
+
doingCheckWidget: "Checking the widget",
|
|
53
|
+
doingTestWizard: "Testing the wizard",
|
|
54
|
+
doingFindService: "Looking for a service",
|
|
55
|
+
doingWork: "Working",
|
|
56
|
+
doingFlow: "Building the flow …",
|
|
57
|
+
doingWriteFile: "Writing {path} …",
|
|
58
|
+
doingWriteAFile: "Writing a file …",
|
|
59
|
+
doingDownload: "Downloading data …",
|
|
60
|
+
doingReadWeb: "Reading the web …",
|
|
61
|
+
doingTestWidget: "Testing the widget …",
|
|
62
|
+
doingPrepare: "Preparing {output} …",
|
|
63
|
+
doingCalculate: "Calculating …",
|
|
64
|
+
doingLookFiles: "Looking at the files …",
|
|
65
|
+
doingTidyFiles: "Tidying up files …",
|
|
66
|
+
doingReadGuide: "Reading the guide …",
|
|
67
|
+
doingAuthoringGuide: "Reading the authoring guide …",
|
|
68
|
+
doingGallery: "Searching the gallery …",
|
|
69
|
+
doingPlans: "Looking up the plans …",
|
|
70
|
+
doingAccount: "Looking up the account …",
|
|
71
|
+
doingUsage: "Looking up the usage …",
|
|
72
|
+
doingModels: "Looking up the models …",
|
|
73
|
+
doingEarlierChats: "Searching earlier chats …",
|
|
74
|
+
somethingWrong: "Something went wrong. Try again.",
|
|
75
|
+
firstSpaceCloud: "My wizards",
|
|
76
|
+
firstSpaceLocal: "My computer",
|
|
77
|
+
invalidInput: "Invalid input",
|
|
78
|
+
internalError: "Internal error",
|
|
79
|
+
notSignedIn: "You’re not signed in.",
|
|
80
|
+
accountSuspended: "This account is suspended.",
|
|
81
|
+
tooLarge: "That is too large.",
|
|
82
|
+
tooManyTriesWait: "Too many tries. Wait a moment and try again.",
|
|
83
|
+
tooManyTransfersTry: "Too many transfers. Try again later.",
|
|
84
|
+
pluginNotPartPlan: "This plugin is not part of your plan. It comes with Pro.",
|
|
85
|
+
wizardNotPublishedYet: "The wizard is not published yet.",
|
|
86
|
+
tooManyTimesRow: "Too many times in a row. Try again later.",
|
|
87
|
+
onlyAvailableCloud: "This is only available in the cloud.",
|
|
88
|
+
onlyAvailableComputer: "This is only available on your computer.",
|
|
89
|
+
somethingWentWrongTry: "Something went wrong. Try again.",
|
|
90
|
+
unknownApp: "Unknown app.",
|
|
91
|
+
onlyTeamAdminsChange: "Only team admins can change its models.",
|
|
92
|
+
notAvailableCloud: "This isn’t available in the cloud.",
|
|
93
|
+
noApiKeySet: "No API key is set.",
|
|
94
|
+
onlyTeamAdminsTest: "Only team admins can test its models.",
|
|
95
|
+
notFound: "This doesn’t exist or was deleted.",
|
|
96
|
+
ownKeysNotInPlan: "Your own API keys aren’t part of the {plan} plan.",
|
|
97
|
+
ownKeysNotInTeamPlan: "Your own API keys aren’t part of the team’s plan.",
|
|
98
|
+
};
|
|
99
|
+
const DE = {
|
|
100
|
+
keyUnknown: "Der Anbieter kennt diesen API-Key nicht.",
|
|
101
|
+
providerError: "Der Anbieter antwortet mit Fehler {status}.",
|
|
102
|
+
providerUnreachable: "Der Anbieter ist gerade nicht erreichbar.",
|
|
103
|
+
importedFrom: "Importiert aus „{name}“: {steps}, {files}.",
|
|
104
|
+
imported: "Importiert: {steps}, {files}.",
|
|
105
|
+
stepCount: { one: "{count} Schritt", other: "{count} Schritte" },
|
|
106
|
+
fileCount: { one: "{count} Datei", other: "{count} Dateien" },
|
|
107
|
+
spaceStillNeeds: "Diesem Space fehlt noch: {needs}. Füge es unter Einstellungen → Connectors hinzu.",
|
|
108
|
+
notFinished: "Ich bin noch nicht ganz fertig geworden. Schreib „weiter“, dann mache ich genau dort weiter.",
|
|
109
|
+
done: "Erledigt.",
|
|
110
|
+
notUnderstood: "Das habe ich nicht verstanden – magst du es anders formulieren?",
|
|
111
|
+
siteTakingOver: "Übernimmt die Angaben der Website …",
|
|
112
|
+
siteWritingPages: "Schreibt die Seiten in Wissen …",
|
|
113
|
+
siteReading: "Liest die Angaben …",
|
|
114
|
+
siteFailed: "Die Website ließ sich nicht übernehmen.",
|
|
115
|
+
faqQuestion: "Frage",
|
|
116
|
+
faqAnswer: "Antwort",
|
|
117
|
+
tableTitle: "Tabelle",
|
|
118
|
+
newWizard: "Neuer Wizard",
|
|
119
|
+
newWizardStart: "Los geht's",
|
|
120
|
+
newWizardAsk: "Worum geht es?",
|
|
121
|
+
newWizardDone: "Fertig",
|
|
122
|
+
templateSetUp: "Ich habe die Vorlage „{title}“ für dich angelegt. Teste sie rechts oben – oder sag mir, was anders sein soll.",
|
|
123
|
+
imapHint: "Bei Gmail, iCloud, GMX und web.de brauchst du ein App-Passwort (in den Sicherheitseinstellungen deines Kontos), nicht dein normales Passwort.",
|
|
124
|
+
doingSaveLogo: "Holt das Logo …",
|
|
125
|
+
doingSaveFile: "Holt eine Datei …",
|
|
126
|
+
doingSetLogoSections: "Ordnet die Logos …",
|
|
127
|
+
doingSetAssetSections: "Ordnet die Assets …",
|
|
128
|
+
doingSetTypography: "Trägt die Schriften ein …",
|
|
129
|
+
doingSetGradients: "Trägt die Verläufe ein …",
|
|
130
|
+
doingSetRules: "Trägt Regeln ein …",
|
|
131
|
+
doingSetProfile: "Schreibt Titel und Beschreibung …",
|
|
132
|
+
doingSetFacts: "Trägt Fakten ein …",
|
|
133
|
+
doingSetColors: "Trägt die Farben ein …",
|
|
134
|
+
doingLookAtFile: "Sieht sich eine Datei an …",
|
|
135
|
+
doingDescribeFile: "Beschreibt eine Datei …",
|
|
136
|
+
doingWebSearch: "Sucht im Web …",
|
|
137
|
+
doingReadSite: "Liest {host} …",
|
|
138
|
+
doingReadWebsite: "Liest die Website …",
|
|
139
|
+
doingGuide: "Liest die Bauanleitung",
|
|
140
|
+
doingTemplate: "Sieht sich eine Vorlage an",
|
|
141
|
+
doingReadWizard: "Liest den Wizard",
|
|
142
|
+
doingWriteFiles: "Schreibt Dateien",
|
|
143
|
+
doingRebuild: "Baut den Wizard um",
|
|
144
|
+
doingCheckWidget: "Prüft das Widget",
|
|
145
|
+
doingTestWizard: "Testet den Wizard",
|
|
146
|
+
doingFindService: "Sucht einen Dienst",
|
|
147
|
+
doingWork: "Arbeitet",
|
|
148
|
+
doingFlow: "Baut den Ablauf …",
|
|
149
|
+
doingWriteFile: "Schreibt {path} …",
|
|
150
|
+
doingWriteAFile: "Schreibt eine Datei …",
|
|
151
|
+
doingDownload: "Lädt Daten herunter …",
|
|
152
|
+
doingReadWeb: "Liest im Web …",
|
|
153
|
+
doingTestWidget: "Testet das Widget …",
|
|
154
|
+
doingPrepare: "Bereitet {output} vor …",
|
|
155
|
+
doingCalculate: "Rechnet …",
|
|
156
|
+
doingLookFiles: "Sieht sich die Dateien an …",
|
|
157
|
+
doingTidyFiles: "Räumt Dateien auf …",
|
|
158
|
+
doingReadGuide: "Liest in der Anleitung …",
|
|
159
|
+
doingAuthoringGuide: "Liest die Bauanleitung …",
|
|
160
|
+
doingGallery: "Sucht in der Galerie …",
|
|
161
|
+
doingPlans: "Sieht die Pläne nach …",
|
|
162
|
+
doingAccount: "Sieht das Konto nach …",
|
|
163
|
+
doingUsage: "Sieht den Verbrauch nach …",
|
|
164
|
+
doingModels: "Sieht die Modelle nach …",
|
|
165
|
+
doingEarlierChats: "Sucht in früheren Chats …",
|
|
166
|
+
somethingWrong: "Da ist etwas schiefgelaufen. Versuch es noch einmal.",
|
|
167
|
+
firstSpaceCloud: "Meine Wizards",
|
|
168
|
+
firstSpaceLocal: "Mein Computer",
|
|
169
|
+
invalidInput: "Ungültige Eingabe",
|
|
170
|
+
internalError: "Interner Fehler",
|
|
171
|
+
notSignedIn: "Du bist nicht angemeldet.",
|
|
172
|
+
accountSuspended: "Dieses Konto ist gesperrt.",
|
|
173
|
+
tooLarge: "Das ist zu groß.",
|
|
174
|
+
tooManyTriesWait: "Zu viele Versuche. Warte kurz und versuch es noch einmal.",
|
|
175
|
+
tooManyTransfersTry: "Zu viele Übertragungen. Versuch es später noch einmal.",
|
|
176
|
+
pluginNotPartPlan: "Dieses Plugin gehört nicht zu deinem Paket. Mit Pro ist es dabei.",
|
|
177
|
+
wizardNotPublishedYet: "Der Wizard ist noch nicht veröffentlicht.",
|
|
178
|
+
tooManyTimesRow: "Zu oft hintereinander. Versuch es später noch einmal.",
|
|
179
|
+
onlyAvailableCloud: "Das gibt es nur in der Cloud.",
|
|
180
|
+
onlyAvailableComputer: "Das gibt es nur auf deinem Computer.",
|
|
181
|
+
somethingWentWrongTry: "Da ist etwas schiefgelaufen. Versuch es noch einmal.",
|
|
182
|
+
unknownApp: "Diese App gibt es nicht.",
|
|
183
|
+
onlyTeamAdminsChange: "Nur Admins des Teams ändern seine Modelle.",
|
|
184
|
+
notAvailableCloud: "Das gibt es nicht in der Cloud.",
|
|
185
|
+
noApiKeySet: "Kein API-Key hinterlegt.",
|
|
186
|
+
onlyTeamAdminsTest: "Nur Admins des Teams testen seine Modelle.",
|
|
187
|
+
notFound: "Das gibt es nicht oder nicht mehr.",
|
|
188
|
+
ownKeysNotInPlan: "Eigene API-Keys gibt es nicht im Paket {plan}.",
|
|
189
|
+
ownKeysNotInTeamPlan: "Eigene API-Keys gibt es nicht im Paket des Teams.",
|
|
190
|
+
};
|
|
191
|
+
export const SERVER_TEXTS = { en: EN, de: DE };
|
|
192
|
+
/** A line of the server's table in a language; English where the language lacks it. */
|
|
193
|
+
export function serverText(lang, key, params) {
|
|
194
|
+
return textOf(SERVER_TEXTS, key, lang, params);
|
|
195
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pluginToolOf } from "@engenty-wizards/shared/definition";
|
|
2
|
-
import {
|
|
2
|
+
import { note } from "@engenty-wizards/shared/run";
|
|
3
3
|
import { createTool } from "@mastra/core/tools";
|
|
4
4
|
import { StepError } from "../engine/types.js";
|
|
5
5
|
import { loadedPlugin, pluginIdsOf, pluginsOf } from "../plugins/registry.js";
|
|
@@ -39,7 +39,7 @@ async function toolOf(id, ctx) {
|
|
|
39
39
|
const found = named && has.has(named.plugin) ? loadedPlugin(named.plugin)?.tools.get(named.tool) : undefined;
|
|
40
40
|
if (!(named && found)) {
|
|
41
41
|
const plugin = named?.plugin ?? id;
|
|
42
|
-
throw new StepError(
|
|
42
|
+
throw new StepError(note("stepNeedsToolPlugin", { id, plugin }));
|
|
43
43
|
}
|
|
44
44
|
return { plugin: named.plugin, tool: found };
|
|
45
45
|
}
|
|
@@ -52,7 +52,11 @@ export async function callPluginTool(id, input, ctx) {
|
|
|
52
52
|
const parsed = tool.inputSchema.safeParse(input);
|
|
53
53
|
if (!parsed.success) {
|
|
54
54
|
const issue = parsed.error.issues[0];
|
|
55
|
-
throw new StepError(
|
|
55
|
+
throw new StepError(note("pluginInvalidInput", {
|
|
56
|
+
id,
|
|
57
|
+
path: issue?.path.join(".") || "input",
|
|
58
|
+
problem: issue?.message ?? "",
|
|
59
|
+
}));
|
|
56
60
|
}
|
|
57
61
|
try {
|
|
58
62
|
return await tool.execute(parsed.data, toolContext(ctx));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { allFields, dataRef, widgetSize, } from "@engenty-wizards/shared/definition";
|
|
2
|
-
import {
|
|
2
|
+
import { note } from "@engenty-wizards/shared/run";
|
|
3
3
|
import { resolveRef } from "../engine/template.js";
|
|
4
4
|
import { StepError } from "../engine/types.js";
|
|
5
5
|
import { extFor, inlineAssetRefs, loadAsset } from "../files/storage.js";
|
|
@@ -107,7 +107,7 @@ async function runFilmStep(step, ctx, html, data, media, origin) {
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
if (!film) {
|
|
110
|
-
throw new StepError(
|
|
110
|
+
throw new StepError(note("filmNotRenderedNeeds"));
|
|
111
111
|
}
|
|
112
112
|
if (film.errors.length) {
|
|
113
113
|
await ctx.emit("info", {
|
|
@@ -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{$n as r,At as i,Jn as a,Mt as o,Nt as s,Rt as c,Tn as l,Ut as u,Vt as d,Yt as f,jt as p}from"./ui-EuR3jezP.js";import{t as m}from"./preload-helper-CNEI7N0N.js";import{H as h,U as g,W as _,yt as v}from"./index-DQ9qAB4v.js";import{c as y,f as b}from"./settings-menu-D9fbi1Z0.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-DMOWV_Iu.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:`agentOS`,description:`credit.agentos`,homepage:`https://github.com/rivet-dev/agentos`,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:i}){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)(a,{"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})]}),i?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):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),[r,i]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return m(()=>import(`./oss-credits-BJrR7BR1.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||i(``)},[e]);let a=r.trim().toLowerCase(),o=e=>a?e.filter(e=>k(a,e.name,e.license,f(e.description))):e,l=e=>a?e.filter(e=>k(a,e.name,e.license,e.version)):e,u=o(E),d=o(D),h=t?[{id:`shared`,label:f(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],g=u.length===0&&d.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)(s,{type:`search`,value:r,placeholder:f(`about.search`),onChange:e=>i(e.target.value)}),u.length>0?(0,O.jsx)(j,{title:f(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:u})}):null,d.length>0?(0,O.jsx)(j,{title:f(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:d})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(c,{})}):h.length>0?(0,O.jsx)(j,{title:f(`about.creditsDeps`),hint:a?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)(p,{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({open:e,onClose:t,me:n}){let a=n?.mode===`local`,{data:s,latest:p}=_(a&&e),[m,E]=(0,T.useState)(null),[D,k]=(0,T.useState)(`new`),A=b(F.indexOf(D)),j=s?.newer&&p?p:g;(0,T.useEffect)(()=>{if(!e)return;let t=!1;return E(null),S(j===`0.5.8`?void 0:j).then(e=>{t||E(e)}),()=>{t=!0}},[e,j]);let M=m?.find(e=>e.version===`v${j}`)??m?.[0]??null,N=m?.filter(e=>e!==M)??[],R=a?s?.kind??null:`cloud`;return(0,O.jsxs)(i,{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)(l,{className:`size-4`})})}),(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(v,{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}),R?` · ${f(`about.kind.${R}`)}`:``]})]}),a?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(h,{enabled:e})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(d,{value:D,onChange:k,options:F.map(e=>({id:e,label:I(e)})),label:f(`about.title`)})}),(0,O.jsxs)(`div`,{className:u(`mt-5`,y(A)),children:[D===`new`?m===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(c,{})}):M?(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(M),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(M)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:M})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:f(`about.changelogEmpty`)}):null,D===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:N.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)(r,{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,D===`credits`?(0,O.jsx)(P,{active:!0}):null]},D)]})}export{R as AboutDialog};
|
|
@@ -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{At as r,Nt as i,Rt as a,Ut as o,Yt as s,jt as c}from"./ui-EuR3jezP.js";import{t as l}from"./preload-helper-CNEI7N0N.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/,``):s(`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/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-BW40vzI6.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:o(`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:s(`about.breaking`)}):null]})]},e.id)})})}function y({open:e,onClose:t,version:n}){let[o,l]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||o)return;let t=!1;return _(n).then(e=>{t||l(e)}),()=>{t=!0}},[e,o,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=o?g(o,f):[];return(0,d.jsxs)(r,{open:e,onClose:t,title:s(`about.changelog`),wide:!0,height:`tall`,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:s(`about.changelogHint`)}),o===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(a,{})}):o.length===0?(0,d.jsx)(c,{children:s(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{type:`search`,value:f,placeholder:s(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(c,{children:s(`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};
|