wizards 0.2.50 → 0.2.52
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/LICENSE +1 -1
- package/apps/runtime/dist/authoring/guide.js +2 -0
- package/apps/runtime/dist/cli/main.js +14 -0
- package/apps/runtime/dist/cli/validate.js +75 -0
- package/apps/runtime/dist/docs/dev/index.md +5 -0
- package/apps/runtime/dist/docs/dev/meta.json +1 -1
- package/apps/runtime/dist/docs/dev/wizard-format.md +102 -0
- package/apps/runtime/dist/routes/api.js +2 -1
- package/apps/runtime/dist/routes/studio.js +2 -1
- package/apps/runtime/dist/services/package-file.js +81 -0
- package/apps/runtime/dist/services/package.js +9 -117
- package/apps/runtime/dist/services/wizards.js +1 -15
- package/apps/web/dist/assets/{AboutDialog-BRjyFW7N.js → AboutDialog-ImRp4Wrj.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-DU-fYMNG.js → ChangelogDialog-BOip6ZiX.js} +1 -1
- package/apps/web/dist/assets/{ChatView-Chv8rH9v.js → ChatView-LYMpu-ey.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-BEEiRjpL.js → EditorPage-BpfkiGn5.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-911P5v6v.js → FlowPreview-CWTisQVQ.js} +1 -1
- package/apps/web/dist/assets/{Harness-DE9pS-ZP.js → Harness-B-MVMz8D.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-DfoRgS49.js → Marketplace-CtyX--Z8.js} +2 -2
- package/apps/web/dist/assets/{NewWizardPage-BwZ39he_.js → NewWizardPage-EPh2II8j.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-BB8feiW1.js → ProjectPage-B0vA9ikX.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-JsgGibnC.js → PublicRunner-8aitf9FW.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-CxJtIQlP.js → RunDrawer-BlZmLdli.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-DvIBDzr1.js → RunnerView-CYwtDqaQ.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-DJBQvyom.js → SettingsPage-BZCYr_hq.js} +1 -1
- package/apps/web/dist/assets/{SetupPage-BVqbshmT.js → SetupPage-C0NTB3Pm.js} +1 -1
- package/apps/web/dist/assets/{SharePage-ChQxeHFC.js → SharePage-CrWTToRJ.js} +1 -1
- package/apps/web/dist/assets/changelog-Bp9Q6C5Z.js +1 -0
- package/apps/web/dist/assets/{esm-cYET-omK.js → esm-0BcZy2iG.js} +1 -1
- package/apps/web/dist/assets/{index-CDgxPZY_.js → index-BpflEQyq.js} +4 -4
- package/apps/web/dist/assets/{settings-menu-B763_KXf.js → settings-menu-C0GPfSzY.js} +1 -1
- package/apps/web/dist/index.html +2 -2
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +2 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +16 -4
- package/node_modules/@engenty-wizards/shared/dist/json-schema.d.ts +14 -0
- package/node_modules/@engenty-wizards/shared/dist/json-schema.js +62 -0
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.d.ts +46 -0
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.js +47 -0
- package/package.json +1 -1
- package/apps/web/dist/assets/changelog-OdE5-SsX.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SURFACE_GUIDE } from "@engenty-wizards/shared/surface";
|
|
2
|
+
import { WIZARD_SCHEMA_URL } from "@engenty-wizards/shared/wizard-package";
|
|
2
3
|
import { sandboxGuideLine } from "../sandbox/index.js";
|
|
3
4
|
import { EXAMPLE_WIZARD } from "./example.js";
|
|
4
5
|
/**
|
|
@@ -363,6 +364,7 @@ Editing:
|
|
|
363
364
|
- Prefer edit_wizard with small ops; use replace_wizard only to rewrite most of the wizard.
|
|
364
365
|
- A draft may have issues while you work. publish_wizard and start_test_run refuse until there are none.
|
|
365
366
|
- Put a short "note" on writes (what changed, in the admin's language) — the admin sees it in the studio.
|
|
367
|
+
- A wizard written as a file instead (a .wizard package, its wizard.json, or the JSON alone) follows the JSON Schema at ${WIZARD_SCHEMA_URL}; \`wizards validate <path>\` checks it as the import does.
|
|
366
368
|
- Test runs and published runs spend the admin's credits (research ~150, video ~250, short copy with an image ~15).
|
|
367
369
|
|
|
368
370
|
Example of a complete wizard:
|
|
@@ -9,6 +9,7 @@ import { setup } from "./setup.js";
|
|
|
9
9
|
import { open, start, studio } from "./start.js";
|
|
10
10
|
import { autostart, restart, status, stop } from "./status.js";
|
|
11
11
|
import { update } from "./update.js";
|
|
12
|
+
import { validateCommand } from "./validate.js";
|
|
12
13
|
const HELP = `engenty wizards ${packageVersion()}
|
|
13
14
|
|
|
14
15
|
${command()} what runs, and a menu: start, stop, update …; the first time, the setup runs first
|
|
@@ -31,6 +32,9 @@ const HELP = `engenty wizards ${packageVersion()}
|
|
|
31
32
|
.join(", ")}
|
|
32
33
|
${command()} disconnect take them out again (same names)
|
|
33
34
|
${command()} mcp the MCP server over stdio, as the AI apps start it
|
|
35
|
+
${command()} validate check wizards without the studio: .wizard files, unpacked packages, wizard JSON
|
|
36
|
+
(--json for the issues as JSON); a project's connectors and plugins are
|
|
37
|
+
checked on import
|
|
34
38
|
|
|
35
39
|
--yes, -y ask nothing and install nothing optional
|
|
36
40
|
--client <name> install this AI client without asking: ${CLIENTS.map((c) => c.id).join(", ")}
|
|
@@ -45,6 +49,8 @@ function parse(argv) {
|
|
|
45
49
|
command: "",
|
|
46
50
|
value: "",
|
|
47
51
|
apps: [],
|
|
52
|
+
paths: [],
|
|
53
|
+
json: false,
|
|
48
54
|
yes: false,
|
|
49
55
|
open: true,
|
|
50
56
|
service: false,
|
|
@@ -65,6 +71,9 @@ function parse(argv) {
|
|
|
65
71
|
else if (arg === "--print") {
|
|
66
72
|
args.print = true;
|
|
67
73
|
}
|
|
74
|
+
else if (arg === "--json") {
|
|
75
|
+
args.json = true;
|
|
76
|
+
}
|
|
68
77
|
else if (arg === "--client") {
|
|
69
78
|
const id = argv[++i];
|
|
70
79
|
if (!CLIENTS.some((client) => client.id === id)) {
|
|
@@ -87,6 +96,9 @@ function parse(argv) {
|
|
|
87
96
|
else if (["connect", "disconnect", "features"].includes(args.command)) {
|
|
88
97
|
args.apps.push(arg);
|
|
89
98
|
}
|
|
99
|
+
else if (args.command === "validate") {
|
|
100
|
+
args.paths.push(arg);
|
|
101
|
+
}
|
|
90
102
|
else if (args.command) {
|
|
91
103
|
return `Unexpected argument ${arg}.`;
|
|
92
104
|
}
|
|
@@ -163,6 +175,8 @@ async function main(argv) {
|
|
|
163
175
|
return mcp(paths);
|
|
164
176
|
case "features":
|
|
165
177
|
return featuresCommand(args.apps);
|
|
178
|
+
case "validate":
|
|
179
|
+
return validateCommand(args.paths, args.json);
|
|
166
180
|
default:
|
|
167
181
|
console.error(`Unknown command ${args.command}.\n\n${HELP}`);
|
|
168
182
|
return 2;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
3
|
+
import { parseWizard } from "@engenty-wizards/shared/definition";
|
|
4
|
+
import { PACKAGE_FILES, PACKAGE_MANIFEST } from "@engenty-wizards/shared/wizard-package";
|
|
5
|
+
import { json, readManifest, readPackage } from "../services/package-file.js";
|
|
6
|
+
import { bad, dim, ok } from "./ui.js";
|
|
7
|
+
function workspace(folder) {
|
|
8
|
+
const root = join(folder, PACKAGE_FILES);
|
|
9
|
+
try {
|
|
10
|
+
return readdirSync(root, { recursive: true, withFileTypes: true })
|
|
11
|
+
.filter((entry) => entry.isFile() && entry.name !== ".DS_Store")
|
|
12
|
+
.map((entry) => relative(root, join(entry.parentPath, entry.name)).split("\\").join("/"));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** The definition and the workspace's paths, read the way the import reads them. */
|
|
19
|
+
function read(path) {
|
|
20
|
+
const folder = statSync(path).isDirectory()
|
|
21
|
+
? path
|
|
22
|
+
: basename(path) === PACKAGE_MANIFEST
|
|
23
|
+
? dirname(path)
|
|
24
|
+
: null;
|
|
25
|
+
if (folder) {
|
|
26
|
+
const manifest = readManifest(json(readFileSync(join(folder, PACKAGE_MANIFEST))));
|
|
27
|
+
return { definition: manifest.definition, files: workspace(folder) };
|
|
28
|
+
}
|
|
29
|
+
const { manifest, files } = readPackage(readFileSync(path));
|
|
30
|
+
return { definition: manifest.definition, files: files.map((f) => f.path) };
|
|
31
|
+
}
|
|
32
|
+
export function validatePath(path) {
|
|
33
|
+
let given;
|
|
34
|
+
try {
|
|
35
|
+
given = read(path);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
const message = err.code === "ENOENT"
|
|
39
|
+
? "No such file or folder."
|
|
40
|
+
: err.message;
|
|
41
|
+
return { path, ok: false, issues: [{ message }] };
|
|
42
|
+
}
|
|
43
|
+
const parsed = parseWizard(given.definition, given.files);
|
|
44
|
+
return {
|
|
45
|
+
path,
|
|
46
|
+
ok: parsed.ok && parsed.issues.length === 0,
|
|
47
|
+
steps: parsed.ok ? parsed.wizard.steps.length : undefined,
|
|
48
|
+
files: given.files.length,
|
|
49
|
+
issues: parsed.issues,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function validateCommand(paths, asJson) {
|
|
53
|
+
if (!paths.length) {
|
|
54
|
+
console.error("Name a .wizard file, an unpacked package or a wizard's JSON.");
|
|
55
|
+
return 2;
|
|
56
|
+
}
|
|
57
|
+
const results = paths.map(validatePath);
|
|
58
|
+
if (asJson) {
|
|
59
|
+
console.log(JSON.stringify(results, null, 2));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
for (const r of results) {
|
|
63
|
+
if (r.ok) {
|
|
64
|
+
console.log(`${ok} ${r.path} ${dim(`${r.steps} ${r.steps === 1 ? "step" : "steps"}, ${r.files} ${r.files === 1 ? "file" : "files"}`)}`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const count = `${r.issues.length} ${r.issues.length === 1 ? "issue" : "issues"}`;
|
|
68
|
+
console.log(`${bad} ${r.path} ${dim(count)}`);
|
|
69
|
+
for (const issue of r.issues) {
|
|
70
|
+
console.log(` ${issue.message}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return results.every((r) => r.ok) ? 0 : 1;
|
|
75
|
+
}
|
|
@@ -15,6 +15,11 @@ code, and it loads from its files while the app runs.
|
|
|
15
15
|
| [Reference](./plugins/reference.md) | Every call, type, address and setting |
|
|
16
16
|
| [Examples](./plugins/examples.md) | Two plugins to read and copy |
|
|
17
17
|
|
|
18
|
+
## Wizards as files
|
|
19
|
+
|
|
20
|
+
A wizard is JSON, and it travels as a `.wizard` package. Its format, the JSON Schema for your
|
|
21
|
+
editor and `wizards validate` are on [The wizard format](./wizard-format.md).
|
|
22
|
+
|
|
18
23
|
## What you need
|
|
19
24
|
|
|
20
25
|
- An install of engenty wizards, or a checkout of
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: The wizard format
|
|
3
|
+
description: A wizard as JSON and as a .wizard file, its JSON Schema, and checking it with wizards validate.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A wizard is one JSON document, its **definition**. The studio exports it as a `.wizard` file,
|
|
7
|
+
and imports one back. Both can be written by hand or by a tool, checked in your editor against a
|
|
8
|
+
JSON Schema, and checked completely with `wizards validate`.
|
|
9
|
+
|
|
10
|
+
## The definition
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"$schema": "https://engenty.ai/docs/schema/wizard/1.json",
|
|
15
|
+
"version": 1,
|
|
16
|
+
"title": "Rechnung erstellen",
|
|
17
|
+
"description": "Aus ein paar Angaben wird eine fertige Rechnung.",
|
|
18
|
+
"avatar": "round",
|
|
19
|
+
"steps": [ … ]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`steps` run top to bottom, and the last one is always a `result` step. The step types and their
|
|
24
|
+
fields are in the schema below. The studio's MCP tool `get_authoring_guide` explains them with a
|
|
25
|
+
complete example.
|
|
26
|
+
|
|
27
|
+
`version` is the definition's version. It changes only with a breaking change; the schema of
|
|
28
|
+
each version stays online under its number.
|
|
29
|
+
|
|
30
|
+
## The `.wizard` file
|
|
31
|
+
|
|
32
|
+
A zip with two things in it:
|
|
33
|
+
|
|
34
|
+
| Path | What it holds |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `wizard.json` | The manifest: the definition, plus what it needs from its project |
|
|
37
|
+
| `files/…` | The wizard's workspace: widget pages, templates, images. At most 200 files and 25 MB |
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"$schema": "https://engenty.ai/docs/schema/wizard-package/1.json",
|
|
42
|
+
"format": "engenty-wizard",
|
|
43
|
+
"version": 1,
|
|
44
|
+
"definition": { … },
|
|
45
|
+
"connectors": [{ "id": "billomat", "name": "Billomat", "domain": "billomat.com" }],
|
|
46
|
+
"mcpServers": [{ "id": "notion", "name": "Notion" }]
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`connectors` and `mcpServers` name what the wizard's steps use from its project, without
|
|
51
|
+
addresses or credentials. A project that lacks one is told so on import.
|
|
52
|
+
|
|
53
|
+
The import also takes a `wizard.json` on its own, or a definition on its own.
|
|
54
|
+
The file's media type is `application/vnd.engenty.wizard+zip`.
|
|
55
|
+
|
|
56
|
+
## JSON Schema
|
|
57
|
+
|
|
58
|
+
| For | Schema |
|
|
59
|
+
|---|---|
|
|
60
|
+
| A definition | [`https://engenty.ai/docs/schema/wizard/1.json`](https://engenty.ai/docs/schema/wizard/1.json) |
|
|
61
|
+
| `wizard.json` in a package | [`https://engenty.ai/docs/schema/wizard-package/1.json`](https://engenty.ai/docs/schema/wizard-package/1.json) |
|
|
62
|
+
|
|
63
|
+
Put the address under `"$schema"`, and editors such as VS Code complete keys and mark mistakes
|
|
64
|
+
as you type. The studio's export writes it into every `wizard.json`.
|
|
65
|
+
|
|
66
|
+
The schemas are written from the code that reads wizards, so they match it. They are stricter
|
|
67
|
+
in one way: a key the app does not know is an error. The app would drop such a key without a
|
|
68
|
+
word.
|
|
69
|
+
|
|
70
|
+
What a JSON Schema cannot say is left to `wizards validate`: unique ids, steps and fields that
|
|
71
|
+
refer to each other, templates naming answers that exist by then, and files in the workspace.
|
|
72
|
+
|
|
73
|
+
## `wizards validate`
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
wizards validate invoice.wizard
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
It checks a wizard the way the studio's import does, with no running studio and no account.
|
|
80
|
+
It takes any number of paths:
|
|
81
|
+
|
|
82
|
+
| Path | Read as |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `invoice.wizard` | A package |
|
|
85
|
+
| `invoice/` or `invoice/wizard.json` | An unpacked package, its workspace under `invoice/files/` |
|
|
86
|
+
| `invoice.json` | A definition on its own, or a `wizard.json` |
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
✗ invoice.json 2 issues
|
|
90
|
+
The last step must be a result step.
|
|
91
|
+
"{{nope}}" refers to a field that is not asked before "g".
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`--json` prints the issues as JSON. The exit code is `0` when every wizard is fine, `1` when one
|
|
95
|
+
has issues and `2` when no path was given. That is enough for a check in CI:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx wizards validate wizards/*.wizard
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The project's own things are checked on import, because only a project has them: its
|
|
102
|
+
connectors and their actions, its MCP servers and its plugins' tools.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PACKAGE_MIME } from "@engenty-wizards/shared/wizard-package";
|
|
1
2
|
import { Hono } from "hono";
|
|
2
3
|
import { bodyLimit } from "hono/body-limit";
|
|
3
4
|
import { z } from "zod";
|
|
@@ -13,7 +14,7 @@ import { apiRun, apiRuns, apiSpaceDetails, apiSpaces, apiWizards } from "../serv
|
|
|
13
14
|
import { ServiceError } from "../services/errors.js";
|
|
14
15
|
import { deleteFile, draftFiles, writeFile } from "../services/files.js";
|
|
15
16
|
import { asLang, searchMarketplace } from "../services/marketplace.js";
|
|
16
|
-
import { exportWizard
|
|
17
|
+
import { exportWizard } from "../services/package.js";
|
|
17
18
|
import { siteJob, siteSchema, startSiteJob } from "../services/site.js";
|
|
18
19
|
import { checkOnServer, checkSchema, listSyncedSpaces, patchSyncedWizard, removeSyncedSpace, removeSyncedWizard, rotateSyncedLink, syncDataSchema, syncSettingsSchema, syncSpaceData, syncWizard, syncWizardSchema, } from "../services/spaces.js";
|
|
19
20
|
import { createWizard, ownedWizard, publishWizard, writeDraft } from "../services/wizards.js";
|
|
@@ -5,6 +5,7 @@ import { MODEL_CLASSES, TEXT_CLASSES } from "@engenty-wizards/shared/definition"
|
|
|
5
5
|
import { CATEGORY_TYPES, whereSchema } from "@engenty-wizards/shared/knowledge";
|
|
6
6
|
import { PROJECT_FILE_KINDS } from "@engenty-wizards/shared/projects";
|
|
7
7
|
import { isCreditsRef } from "@engenty-wizards/shared/providers";
|
|
8
|
+
import { PACKAGE_EXTENSION, PACKAGE_MAX_BYTES, PACKAGE_MIME, } from "@engenty-wizards/shared/wizard-package";
|
|
8
9
|
import { generateText } from "ai";
|
|
9
10
|
import { Hono } from "hono";
|
|
10
11
|
import { streamSSE } from "hono/streaming";
|
|
@@ -42,7 +43,7 @@ import { notFound, ServiceError } from "../services/errors.js";
|
|
|
42
43
|
import { deleteFile, listFiles, readFile, writeFile } from "../services/files.js";
|
|
43
44
|
import { categoryContents, listKnowledge, resolvePath, valueContents, } from "../services/knowledge.js";
|
|
44
45
|
import { writeSummary } from "../services/knowledge-model.js";
|
|
45
|
-
import { exportWizard, importWizard
|
|
46
|
+
import { exportWizard, importWizard } from "../services/package.js";
|
|
46
47
|
import { profileSchema, saveProfile, userProfile } from "../services/profile.js";
|
|
47
48
|
import { addProjectFile, fileView, orderProjectFiles, projectFile, projectFileContent, projectFiles, reindexProjectFile, removeProjectFile, updateProjectFile, } from "../services/project-files.js";
|
|
48
49
|
import { documentText, queueIndex, searchKnowledge } from "../services/project-index.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { manifestSchema, PACKAGE_FILES, PACKAGE_FORMAT, PACKAGE_MANIFEST, PACKAGE_MAX_BYTES, } from "@engenty-wizards/shared/wizard-package";
|
|
2
|
+
import { cleanPath, WORKSPACE_LIMITS } from "@engenty-wizards/shared/workspace";
|
|
3
|
+
import { strFromU8, unzipSync } from "fflate";
|
|
4
|
+
import { ServiceError } from "./errors.js";
|
|
5
|
+
/**
|
|
6
|
+
* Reading a `.wizard` package, with nothing of a project or a database: the studio's import and
|
|
7
|
+
* `wizards validate` both start here.
|
|
8
|
+
*/
|
|
9
|
+
const invalid = (message) => new ServiceError("invalid", message);
|
|
10
|
+
export function json(data) {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(strFromU8(data));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
throw invalid("Das ist kein Wizard-Paket: wizard.json ist kein gültiges JSON.");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** A manifest, or a bare definition: a wizard without workspace is fully told by its JSON. */
|
|
19
|
+
export function readManifest(raw) {
|
|
20
|
+
if (raw?.format !== PACKAGE_FORMAT) {
|
|
21
|
+
return { format: PACKAGE_FORMAT, version: 1, definition: raw, connectors: [], mcpServers: [] };
|
|
22
|
+
}
|
|
23
|
+
const parsed = manifestSchema.safeParse(raw);
|
|
24
|
+
if (!parsed.success) {
|
|
25
|
+
throw invalid("Dieses Wizard-Paket stammt aus einer neueren Version oder ist beschädigt.");
|
|
26
|
+
}
|
|
27
|
+
return parsed.data;
|
|
28
|
+
}
|
|
29
|
+
/** The package's content, checked against the workspace limits before anything is unpacked. */
|
|
30
|
+
export function readPackage(data) {
|
|
31
|
+
const zipped = data[0] === 0x50 && data[1] === 0x4b;
|
|
32
|
+
if (!zipped) {
|
|
33
|
+
return { manifest: readManifest(json(data)), files: [] };
|
|
34
|
+
}
|
|
35
|
+
let total = 0;
|
|
36
|
+
let count = 0;
|
|
37
|
+
let entries;
|
|
38
|
+
try {
|
|
39
|
+
entries = unzipSync(data, {
|
|
40
|
+
filter: (file) => {
|
|
41
|
+
// Folders, and what the Finder adds when a package is zipped by hand.
|
|
42
|
+
if (file.name.endsWith("/") || /(^|\/)(__MACOSX\/|\.DS_Store$)/.test(file.name)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
total += file.originalSize;
|
|
46
|
+
count += 1;
|
|
47
|
+
if (file.originalSize > WORKSPACE_LIMITS.fileBytes) {
|
|
48
|
+
throw invalid(`${file.name} ist größer als 5 MB.`);
|
|
49
|
+
}
|
|
50
|
+
if (count > WORKSPACE_LIMITS.files + 1 || total > PACKAGE_MAX_BYTES) {
|
|
51
|
+
throw invalid("Das Paket ist größer als ein Workspace sein darf (200 Dateien, 25 MB).");
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
throw err instanceof ServiceError ? err : invalid("Das Paket lässt sich nicht entpacken.");
|
|
59
|
+
}
|
|
60
|
+
// A package unpacked and zipped again often sits in a folder of its own.
|
|
61
|
+
const manifestPath = Object.keys(entries)
|
|
62
|
+
.filter((name) => name === PACKAGE_MANIFEST || name.endsWith(`/${PACKAGE_MANIFEST}`))
|
|
63
|
+
.sort((a, b) => a.length - b.length)[0];
|
|
64
|
+
if (manifestPath === undefined) {
|
|
65
|
+
throw invalid("Das ist kein Wizard-Paket: wizard.json fehlt.");
|
|
66
|
+
}
|
|
67
|
+
const root = manifestPath.slice(0, -PACKAGE_MANIFEST.length);
|
|
68
|
+
const files = Object.entries(entries)
|
|
69
|
+
.filter(([name]) => name.startsWith(root + PACKAGE_FILES))
|
|
70
|
+
.map(([name, content]) => {
|
|
71
|
+
const path = cleanPath(name.slice(root.length + PACKAGE_FILES.length));
|
|
72
|
+
if (!path) {
|
|
73
|
+
throw invalid(`"${name}" ist kein gültiger Dateipfad.`);
|
|
74
|
+
}
|
|
75
|
+
return { path, data: content };
|
|
76
|
+
});
|
|
77
|
+
if (files.reduce((n, f) => n + f.data.byteLength, 0) > WORKSPACE_LIMITS.totalBytes) {
|
|
78
|
+
throw invalid("Der Workspace im Paket ist größer als 25 MB.");
|
|
79
|
+
}
|
|
80
|
+
return { manifest: readManifest(json(entries[manifestPath])), files };
|
|
81
|
+
}
|
|
@@ -1,58 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PACKAGE_EXTENSION, PACKAGE_FILES, PACKAGE_FORMAT, PACKAGE_MANIFEST, PACKAGE_SCHEMA_URL, } from "@engenty-wizards/shared/wizard-package";
|
|
2
2
|
import { and, eq, isNull } from "drizzle-orm";
|
|
3
|
-
import {
|
|
4
|
-
import { z } from "zod";
|
|
3
|
+
import { strToU8, zipSync } from "fflate";
|
|
5
4
|
import { listConnectors } from "../connectors/external.js";
|
|
6
5
|
import { db, schema } from "../db/client.js";
|
|
7
6
|
import { getBlob } from "../files/blobs.js";
|
|
8
7
|
import { requireAdmin } from "./access.js";
|
|
9
|
-
import { ServiceError } from "./errors.js";
|
|
10
8
|
import { draftFiles, writeFile } from "./files.js";
|
|
11
9
|
import { pageTree } from "./knowledge.js";
|
|
10
|
+
import { readPackage } from "./package-file.js";
|
|
12
11
|
import { ownedProject } from "./projects.js";
|
|
13
12
|
import { createWizard, deleteWizard, draftIssues, ownedWizard, parseDraft } from "./wizards.js";
|
|
14
|
-
/**
|
|
15
|
-
* A wizard as a file, `<title>.wizard`: a zip with `wizard.json` — the definition and what it
|
|
16
|
-
* needs from its project — and the workspace under `files/`. What belongs to people (runs, lists, connected
|
|
17
|
-
* accounts) and to the project (brand, credentials) stays where it is.
|
|
18
|
-
*/
|
|
19
|
-
const FORMAT = "engenty-wizard";
|
|
20
|
-
const MANIFEST = "wizard.json";
|
|
21
|
-
const FILES = "files/";
|
|
22
|
-
export const PACKAGE_EXTENSION = ".wizard";
|
|
23
|
-
/** A type of its own: under `application/zip` a browser may save the file as `.zip`. */
|
|
24
|
-
export const PACKAGE_MIME = "application/vnd.engenty.wizard+zip";
|
|
25
|
-
/** The workspace's 25 MB, with room for the manifest and the zip's own overhead. */
|
|
26
|
-
export const PACKAGE_MAX_BYTES = 30_000_000;
|
|
13
|
+
/** A wizard as a file — the format is `@engenty-wizards/shared/wizard-package`'s. */
|
|
27
14
|
/** Where the project's pages go in a package, as Markdown the standalone runner reads inline. */
|
|
28
15
|
export const KNOWLEDGE_DIR = "wissen/";
|
|
29
16
|
/** How much of the project's knowledge a package takes along: enough pages, never the whole space. */
|
|
30
17
|
export const KNOWLEDGE_MAX_CHARS = 2_000_000;
|
|
31
18
|
/** What one page may hold in the package (the plugin hands a file to the model up to there). */
|
|
32
19
|
export const KNOWLEDGE_PAGE_CHARS = 60_000;
|
|
33
|
-
const manifestSchema = z.object({
|
|
34
|
-
format: z.literal(FORMAT),
|
|
35
|
-
version: z.literal(1),
|
|
36
|
-
exportedAt: z.string().optional(),
|
|
37
|
-
definition: z.unknown(),
|
|
38
|
-
/** Imported connectors the wizard's connections name. No address: one pasted by hand can hold a secret. */
|
|
39
|
-
connectors: z
|
|
40
|
-
.array(z.object({
|
|
41
|
-
id: z.string().max(60),
|
|
42
|
-
name: z.string().max(120),
|
|
43
|
-
domain: z.string().max(253).optional(),
|
|
44
|
-
sourceKind: z.enum(["openapi", "mcp"]).optional(),
|
|
45
|
-
}))
|
|
46
|
-
.max(50)
|
|
47
|
-
.default([]),
|
|
48
|
-
/** Project MCP servers the wizard's steps name — by name only, their address and headers are credentials. */
|
|
49
|
-
mcpServers: z
|
|
50
|
-
.array(z.object({ id: z.string().max(31), name: z.string().max(60) }))
|
|
51
|
-
.max(10)
|
|
52
|
-
.default([]),
|
|
53
|
-
/** The project's pages under `files/wissen/`, when they were asked for: how many, and whether the cap cut some. */
|
|
54
|
-
knowledge: z.object({ pages: z.number().int(), truncated: z.boolean() }).optional(),
|
|
55
|
-
});
|
|
56
20
|
function fileName(title) {
|
|
57
21
|
const slug = title
|
|
58
22
|
.normalize("NFKD")
|
|
@@ -82,7 +46,8 @@ export async function exportWizard(userId, wizardId, options = {}) {
|
|
|
82
46
|
const named = new Set((definition.connections ?? []).map((c) => c.connector));
|
|
83
47
|
const servers = new Set(definition.steps.flatMap((s) => (s.type === "agent" ? (s.mcp ?? []) : [])));
|
|
84
48
|
const manifest = {
|
|
85
|
-
|
|
49
|
+
$schema: PACKAGE_SCHEMA_URL,
|
|
50
|
+
format: PACKAGE_FORMAT,
|
|
86
51
|
version: 1,
|
|
87
52
|
exportedAt: new Date().toISOString(),
|
|
88
53
|
definition,
|
|
@@ -100,16 +65,16 @@ export async function exportWizard(userId, wizardId, options = {}) {
|
|
|
100
65
|
};
|
|
101
66
|
const entries = {};
|
|
102
67
|
for (const f of live ? live.files : await draftFiles(w.id)) {
|
|
103
|
-
entries[
|
|
68
|
+
entries[PACKAGE_FILES + f.path] = new Uint8Array(await getBlob(f.hash));
|
|
104
69
|
}
|
|
105
70
|
if (options.knowledge) {
|
|
106
71
|
const snapshot = await knowledgeSnapshot(project.id);
|
|
107
72
|
manifest.knowledge = { pages: snapshot.pages.length, truncated: snapshot.truncated };
|
|
108
73
|
for (const page of snapshot.pages) {
|
|
109
|
-
entries[
|
|
74
|
+
entries[PACKAGE_FILES + KNOWLEDGE_DIR + page.path] = strToU8(page.text);
|
|
110
75
|
}
|
|
111
76
|
}
|
|
112
|
-
entries[
|
|
77
|
+
entries[PACKAGE_MANIFEST] = strToU8(JSON.stringify(manifest, null, 2));
|
|
113
78
|
return { name: fileName(definition.title), zip: zipSync(entries, { level: 6 }) };
|
|
114
79
|
}
|
|
115
80
|
/**
|
|
@@ -150,79 +115,6 @@ export async function knowledgeSnapshot(projectId) {
|
|
|
150
115
|
function yamlValue(s) {
|
|
151
116
|
return JSON.stringify(s);
|
|
152
117
|
}
|
|
153
|
-
const invalid = (message) => new ServiceError("invalid", message);
|
|
154
|
-
function json(data) {
|
|
155
|
-
try {
|
|
156
|
-
return JSON.parse(strFromU8(data));
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
throw invalid("Das ist kein Wizard-Paket: wizard.json ist kein gültiges JSON.");
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/** A manifest, or a bare definition: a wizard without workspace is fully told by its JSON. */
|
|
163
|
-
function readManifest(raw) {
|
|
164
|
-
if (raw?.format !== FORMAT) {
|
|
165
|
-
return { format: FORMAT, version: 1, definition: raw, connectors: [], mcpServers: [] };
|
|
166
|
-
}
|
|
167
|
-
const parsed = manifestSchema.safeParse(raw);
|
|
168
|
-
if (!parsed.success) {
|
|
169
|
-
throw invalid("Dieses Wizard-Paket stammt aus einer neueren Version oder ist beschädigt.");
|
|
170
|
-
}
|
|
171
|
-
return parsed.data;
|
|
172
|
-
}
|
|
173
|
-
/** The package's content, checked against the workspace limits before anything is unpacked. */
|
|
174
|
-
function readPackage(data) {
|
|
175
|
-
const zipped = data[0] === 0x50 && data[1] === 0x4b;
|
|
176
|
-
if (!zipped) {
|
|
177
|
-
return { manifest: readManifest(json(data)), files: [] };
|
|
178
|
-
}
|
|
179
|
-
let total = 0;
|
|
180
|
-
let count = 0;
|
|
181
|
-
let entries;
|
|
182
|
-
try {
|
|
183
|
-
entries = unzipSync(data, {
|
|
184
|
-
filter: (file) => {
|
|
185
|
-
// Folders, and what the Finder adds when a package is zipped by hand.
|
|
186
|
-
if (file.name.endsWith("/") || /(^|\/)(__MACOSX\/|\.DS_Store$)/.test(file.name)) {
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
|
-
total += file.originalSize;
|
|
190
|
-
count += 1;
|
|
191
|
-
if (file.originalSize > WORKSPACE_LIMITS.fileBytes) {
|
|
192
|
-
throw invalid(`${file.name} ist größer als 5 MB.`);
|
|
193
|
-
}
|
|
194
|
-
if (count > WORKSPACE_LIMITS.files + 1 || total > PACKAGE_MAX_BYTES) {
|
|
195
|
-
throw invalid("Das Paket ist größer als ein Workspace sein darf (200 Dateien, 25 MB).");
|
|
196
|
-
}
|
|
197
|
-
return true;
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
catch (err) {
|
|
202
|
-
throw err instanceof ServiceError ? err : invalid("Das Paket lässt sich nicht entpacken.");
|
|
203
|
-
}
|
|
204
|
-
// A package unpacked and zipped again often sits in a folder of its own.
|
|
205
|
-
const manifestPath = Object.keys(entries)
|
|
206
|
-
.filter((name) => name === MANIFEST || name.endsWith(`/${MANIFEST}`))
|
|
207
|
-
.sort((a, b) => a.length - b.length)[0];
|
|
208
|
-
if (manifestPath === undefined) {
|
|
209
|
-
throw invalid("Das ist kein Wizard-Paket: wizard.json fehlt.");
|
|
210
|
-
}
|
|
211
|
-
const root = manifestPath.slice(0, -MANIFEST.length);
|
|
212
|
-
const files = Object.entries(entries)
|
|
213
|
-
.filter(([name]) => name.startsWith(root + FILES))
|
|
214
|
-
.map(([name, content]) => {
|
|
215
|
-
const path = cleanPath(name.slice(root.length + FILES.length));
|
|
216
|
-
if (!path) {
|
|
217
|
-
throw invalid(`"${name}" ist kein gültiger Dateipfad.`);
|
|
218
|
-
}
|
|
219
|
-
return { path, data: content };
|
|
220
|
-
});
|
|
221
|
-
if (files.reduce((n, f) => n + f.data.byteLength, 0) > WORKSPACE_LIMITS.totalBytes) {
|
|
222
|
-
throw invalid("Der Workspace im Paket ist größer als 25 MB.");
|
|
223
|
-
}
|
|
224
|
-
return { manifest: readManifest(json(entries[manifestPath])), files };
|
|
225
|
-
}
|
|
226
118
|
/** What the wizard names that the project does not have, in words for the chat. */
|
|
227
119
|
async function missing(userId, projectId, draft, manifest) {
|
|
228
120
|
const project = await ownedProject(userId, projectId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pluginToolOf, validateWizard, wizardSchema, } from "@engenty-wizards/shared/definition";
|
|
1
|
+
import { pluginToolOf, shapeIssues, validateWizard, wizardSchema, } from "@engenty-wizards/shared/definition";
|
|
2
2
|
import { and, desc, eq, sql } from "drizzle-orm";
|
|
3
3
|
import { nanoid } from "nanoid";
|
|
4
4
|
import { applyOps, OpError } from "../authoring/ops.js";
|
|
@@ -178,11 +178,6 @@ export async function addMessage(wizardId, message, writer = { source: "studio"
|
|
|
178
178
|
});
|
|
179
179
|
return id;
|
|
180
180
|
}
|
|
181
|
-
function stepLabel(raw, index) {
|
|
182
|
-
const steps = raw?.steps;
|
|
183
|
-
const id = steps?.[index]?.id;
|
|
184
|
-
return typeof id === "string" ? `steps[${index}] "${id}"` : `steps[${index}]`;
|
|
185
|
-
}
|
|
186
181
|
/** The schema check every write passes. Validator issues are allowed in a draft; a wrong shape is not. */
|
|
187
182
|
export function parseDraft(raw, files) {
|
|
188
183
|
const parsed = wizardSchema.safeParse(raw);
|
|
@@ -193,15 +188,6 @@ export function parseDraft(raw, files) {
|
|
|
193
188
|
}
|
|
194
189
|
return { draft: parsed.data, issues: validateWizard(parsed.data, files) };
|
|
195
190
|
}
|
|
196
|
-
export function shapeIssues(error, raw) {
|
|
197
|
-
return error.issues.map((i) => {
|
|
198
|
-
const [head, index, ...rest] = i.path;
|
|
199
|
-
const where = head === "steps" && typeof index === "number"
|
|
200
|
-
? [stepLabel(raw, index), ...rest].join(".")
|
|
201
|
-
: i.path.join(".");
|
|
202
|
-
return { message: `${where || "wizard"}: ${i.message}` };
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
191
|
export async function createWizard(userId, input, writer = { source: "studio" }) {
|
|
206
192
|
// Asked first: a tenant that builds nothing here has no project of its own to name.
|
|
207
193
|
await requireBuild();
|
|
@@ -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{t as r}from"./logo-C4V2_3Ar.js";import{t as i}from"./preload-helper-CNEI7N0N.js";import{Ct as a,Gt as o,Mt as s,Tt as c,Wt as l,Yt as u,_t as d,ct as f,lt as p,mt as m,ot as h,rt as g,st as _,xt as v,yt as y}from"./ui-DKcggL84.js";import{$ as b,v as x}from"./index-CDgxPZY_.js";import{c as S,f as C}from"./settings-menu-B763_KXf.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-DU-fYMNG.js";var O=e(t(),1),k=[{name:`engenty wizards`,description:{de:`KI-Wizards aus einer Beschreibung, mit einem Link geteilt.`,en:`AI wizards built from a description, shared with a link.`},homepage:`https://github.com/engenty/engenty-wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:{de:`Konnektoren, Datentabellen, Suche und die Engenties stammen aus dem engenty-Framework.`,en:`Connectors, data tables, search and the engenties come from the engenty framework.`},homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],A=[{name:`Mastra`,description:{de:`Agent-Framework hinter den KI-Schritten.`,en:`Agent framework behind the AI steps.`},homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:{de:`Modell-Aufrufe für Text, Bild, Video und Sprache.`,en:`Model calls for text, image, video and speech.`},homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:{de:`MCP-Server zum Bauen von Wizards, MCP-Client für Werkzeuge der Schritte.`,en:`MCP server for building wizards, MCP client for the steps' tools.`},homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:{de:`HTTP-API der Runtime.`,en:`The runtime's HTTP API.`},homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:{de:`Schema und Migrationen der Datenbanken.`,en:`Schema and migrations of the databases.`},homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:{de:`Eine Datenbank je Mandant, lokal als Datei oder bei Turso.`,en:`One database per tenant, a local file or at Turso.`},homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:{de:`Browser-Schritte sowie PDF- und PNG-Export.`,en:`Browser steps and the PDF and PNG export.`},homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`agentOS`,description:{de:`Sandbox für Code-Schritte ohne Docker.`,en:`Sandbox for code steps without Docker.`},homepage:`https://github.com/rivet-dev/agentos`,license:`Apache-2.0`},{name:`React`,description:{de:`UI-Bibliothek der Web-App.`,en:`UI library of the web app.`},homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:{de:`Build-Werkzeug der Web-App.`,en:`Build tool of the web app.`},homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:{de:`Styling der Oberfläche.`,en:`Styling of the interface.`},homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:{de:`Das Diagramm der Schritte im Editor.`,en:`The diagram of steps in the editor.`},homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:{de:`Server-Daten in der Web-App.`,en:`Server data in the web app.`},homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:{de:`Das Terminal auf der Seite, in dem sich KI-Clients anmelden.`,en:`The terminal on the page where AI clients sign in.`},homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:{de:`Icons.`,en:`Icons.`},homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:{de:`Schrift der Oberfläche.`,en:`Typeface of the interface.`},homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:{de:`Schrift der Überschriften.`,en:`Typeface of the headings.`},homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:{de:`Erzeugt den Changelog aus den Commits.`,en:`Generates the changelog from the commits.`},homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],j=e(n(),1),M=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function N({name:e,homepage:t,version:n,license:r,description:i}){return(0,j.jsxs)(`li`,{className:`py-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,j.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,j.jsx)(l,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,j.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,j.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,j.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,j.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function P({title:e,hint:t,children:n}){return(0,j.jsxs)(`section`,{className:`mt-6`,children:[(0,j.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,j.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function F({credits:e}){return(0,j.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,j.jsx)(N,{name:e.name,homepage:e.homepage,license:e.license,description:e.description[v]},e.name))})}function I({label:e,packages:t}){return(0,j.jsxs)(`div`,{className:`mt-4`,children:[(0,j.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,j.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,j.jsx)(N,{...e},e.name))})]})}function L({active:e}){let[t,n]=(0,O.useState)(null),[r,o]=(0,O.useState)(``);(0,O.useEffect)(()=>{if(!e||t)return;let r=!1;return i(()=>import(`./oss-credits-BQQX0kvk.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,O.useEffect)(()=>{e||o(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>M(s,e.name,e.license,e.description.de,e.description.en)):e,l=e=>s?e.filter(e=>M(s,e.name,e.license,e.version)):e,u=c(k),d=c(A),f=t?[{id:`shared`,label:a(`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):[],h=u.length===0&&d.length===0&&f.length===0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:a(`about.creditsHint`)}),(0,j.jsx)(p,{type:`search`,value:r,placeholder:a(`about.search`),onChange:e=>o(e.target.value)}),u.length>0?(0,j.jsx)(P,{title:a(`about.creditsProduct`),children:(0,j.jsx)(F,{credits:u})}):null,d.length>0?(0,j.jsx)(P,{title:a(`about.creditsBuiltWith`),children:(0,j.jsx)(F,{credits:d})}):null,t===null?(0,j.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,j.jsx)(m,{})}):f.length>0?(0,j.jsx)(P,{title:a(`about.creditsDeps`),hint:s?void 0:a(`about.creditsDepsHint`),children:f.map(e=>(0,j.jsx)(I,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&h?(0,j.jsx)(_,{children:a(`about.noMatches`)}):null]})}var R=[`new`,`earlier`,`credits`],z=e=>a(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),B=e=>e===1?a(`about.change`):a(`about.changes`,{n:e});function V({open:e,onClose:t,me:n}){let i=n?.mode===`local`,{status:p,data:_,latest:v,check:k,apply:A,busy:M,progress:N}=x(i&&e),[P,F]=(0,O.useState)(null),[I,V]=(0,O.useState)(`new`),H=C(R.indexOf(I)),U=_?.newer&&v?v:b;(0,O.useEffect)(()=>{if(!e)return;let t=!1;return F(null),T(U===`0.2.50`?void 0:U).then(e=>{t||F(e)}),()=>{t=!0}},[e,U]);let W=P?.find(e=>e.version===`v${U}`)??P?.[0]??null,G=P?.filter(e=>e!==W)??[],K=i?_?.kind??null:`cloud`,q=_?.checkedAt?new Date(_.checkedAt).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):null;return(0,j.jsxs)(h,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,j.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,j.jsx)(f,{label:a(`common.close`),onClick:t,children:(0,j.jsx)(c,{className:`size-4`})})}),(0,j.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,j.jsx)(r,{size:96}),(0,j.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,j.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,j.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,j.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[a(`about.version`,{v:b}),K?` · ${a(`about.kind.${K}`)}`:``]})]}),i?(0,j.jsxs)(`div`,{className:`mt-5 flex flex-col items-center gap-3 text-center text-[0.875rem] text-ink-2`,children:[p.isPending||k.isPending?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(m,{className:`size-4 text-ember-strong`}),a(`about.update.checking`)]}):N?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[M?(0,j.jsx)(m,{className:`size-4 text-ember-strong`}):null,N]}):_?.newer&&v?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,j.jsx)(o,{className:`size-4 shrink-0 text-ember-strong`}),a(`about.update.available`,{v})]}),_.canApply?null:(0,j.jsx)(`p`,{className:`text-ink-3`,children:a(`about.update.manual`)})]}):_?.enabled?_.latest===null?(0,j.jsx)(`p`,{children:a(`about.update.unknown`)}):(0,j.jsxs)(`p`,{children:[a(`about.update.upToDate`),q?(0,j.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,a(`about.update.checkedAt`,{when:q})]}):null]}):(0,j.jsx)(`p`,{children:a(`about.update.off`)}),M||p.isPending?null:(0,j.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[_?.newer&&_.canApply&&_.applying!==`running`?(0,j.jsxs)(g,{size:`sm`,disabled:A.isPending,onClick:()=>A.mutate(),children:[(0,j.jsx)(o,{className:`size-4`}),` `,a(`about.update.install`)]}):null,_?.newer&&_.url?(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,onClick:()=>window.open(_.url??``,`_blank`),children:[a(`about.update.release`),` `,(0,j.jsx)(l,{className:`size-4`})]}):null,_?.enabled===!1?null:(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,disabled:k.isPending,onClick:()=>k.mutate(),children:[(0,j.jsx)(s,{className:y(`size-4`,k.isPending&&`animate-spin`)}),` `,a(`about.update.check`)]})]})]}):null,(0,j.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,j.jsx)(d,{value:I,onChange:V,options:R.map(e=>({id:e,label:z(e)})),label:a(`about.title`)})}),(0,j.jsxs)(`div`,{className:y(`mt-5`,S(H)),children:[I===`new`?P===null?(0,j.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,j.jsx)(m,{})}):W?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[D(W),(0,j.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:E(W)})]}),(0,j.jsx)(`div`,{className:`mt-3`,children:(0,j.jsx)(w,{release:W})})]}):(0,j.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:a(`about.changelogEmpty`)}):null,I===`earlier`?(0,j.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:G.map(e=>(0,j.jsxs)(`details`,{className:`group/r py-2`,children:[(0,j.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,j.jsx)(u,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,j.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:D(e)}),(0,j.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:E(e)}),(0,j.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:B(e.commits.length)})]}),(0,j.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,j.jsx)(w,{release:e})})]},e.version??`unreleased`))}):null,I===`credits`?(0,j.jsx)(L,{active:!0}):null]},I)]})}export{V as AboutDialog};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{t as r}from"./logo-C4V2_3Ar.js";import{t as i}from"./preload-helper-CNEI7N0N.js";import{Ct as a,Gt as o,Mt as s,Tt as c,Wt as l,Yt as u,_t as d,ct as f,lt as p,mt as m,ot as h,rt as g,st as _,xt as v,yt as y}from"./ui-DKcggL84.js";import{$ as b,v as x}from"./index-BpflEQyq.js";import{c as S,f as C}from"./settings-menu-C0GPfSzY.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-BOip6ZiX.js";var O=e(t(),1),k=[{name:`engenty wizards`,description:{de:`KI-Wizards aus einer Beschreibung, mit einem Link geteilt.`,en:`AI wizards built from a description, shared with a link.`},homepage:`https://github.com/engenty/engenty-wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:{de:`Konnektoren, Datentabellen, Suche und die Engenties stammen aus dem engenty-Framework.`,en:`Connectors, data tables, search and the engenties come from the engenty framework.`},homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],A=[{name:`Mastra`,description:{de:`Agent-Framework hinter den KI-Schritten.`,en:`Agent framework behind the AI steps.`},homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:{de:`Modell-Aufrufe für Text, Bild, Video und Sprache.`,en:`Model calls for text, image, video and speech.`},homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:{de:`MCP-Server zum Bauen von Wizards, MCP-Client für Werkzeuge der Schritte.`,en:`MCP server for building wizards, MCP client for the steps' tools.`},homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:{de:`HTTP-API der Runtime.`,en:`The runtime's HTTP API.`},homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:{de:`Schema und Migrationen der Datenbanken.`,en:`Schema and migrations of the databases.`},homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:{de:`Eine Datenbank je Mandant, lokal als Datei oder bei Turso.`,en:`One database per tenant, a local file or at Turso.`},homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:{de:`Browser-Schritte sowie PDF- und PNG-Export.`,en:`Browser steps and the PDF and PNG export.`},homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`agentOS`,description:{de:`Sandbox für Code-Schritte ohne Docker.`,en:`Sandbox for code steps without Docker.`},homepage:`https://github.com/rivet-dev/agentos`,license:`Apache-2.0`},{name:`React`,description:{de:`UI-Bibliothek der Web-App.`,en:`UI library of the web app.`},homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:{de:`Build-Werkzeug der Web-App.`,en:`Build tool of the web app.`},homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:{de:`Styling der Oberfläche.`,en:`Styling of the interface.`},homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:{de:`Das Diagramm der Schritte im Editor.`,en:`The diagram of steps in the editor.`},homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:{de:`Server-Daten in der Web-App.`,en:`Server data in the web app.`},homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:{de:`Das Terminal auf der Seite, in dem sich KI-Clients anmelden.`,en:`The terminal on the page where AI clients sign in.`},homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:{de:`Icons.`,en:`Icons.`},homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:{de:`Schrift der Oberfläche.`,en:`Typeface of the interface.`},homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:{de:`Schrift der Überschriften.`,en:`Typeface of the headings.`},homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:{de:`Erzeugt den Changelog aus den Commits.`,en:`Generates the changelog from the commits.`},homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],j=e(n(),1),M=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function N({name:e,homepage:t,version:n,license:r,description:i}){return(0,j.jsxs)(`li`,{className:`py-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,j.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,j.jsx)(l,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,j.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,j.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,j.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,j.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function P({title:e,hint:t,children:n}){return(0,j.jsxs)(`section`,{className:`mt-6`,children:[(0,j.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,j.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function F({credits:e}){return(0,j.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,j.jsx)(N,{name:e.name,homepage:e.homepage,license:e.license,description:e.description[v]},e.name))})}function I({label:e,packages:t}){return(0,j.jsxs)(`div`,{className:`mt-4`,children:[(0,j.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,j.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,j.jsx)(N,{...e},e.name))})]})}function L({active:e}){let[t,n]=(0,O.useState)(null),[r,o]=(0,O.useState)(``);(0,O.useEffect)(()=>{if(!e||t)return;let r=!1;return i(()=>import(`./oss-credits-BQQX0kvk.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,O.useEffect)(()=>{e||o(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>M(s,e.name,e.license,e.description.de,e.description.en)):e,l=e=>s?e.filter(e=>M(s,e.name,e.license,e.version)):e,u=c(k),d=c(A),f=t?[{id:`shared`,label:a(`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):[],h=u.length===0&&d.length===0&&f.length===0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:a(`about.creditsHint`)}),(0,j.jsx)(p,{type:`search`,value:r,placeholder:a(`about.search`),onChange:e=>o(e.target.value)}),u.length>0?(0,j.jsx)(P,{title:a(`about.creditsProduct`),children:(0,j.jsx)(F,{credits:u})}):null,d.length>0?(0,j.jsx)(P,{title:a(`about.creditsBuiltWith`),children:(0,j.jsx)(F,{credits:d})}):null,t===null?(0,j.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,j.jsx)(m,{})}):f.length>0?(0,j.jsx)(P,{title:a(`about.creditsDeps`),hint:s?void 0:a(`about.creditsDepsHint`),children:f.map(e=>(0,j.jsx)(I,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&h?(0,j.jsx)(_,{children:a(`about.noMatches`)}):null]})}var R=[`new`,`earlier`,`credits`],z=e=>a(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),B=e=>e===1?a(`about.change`):a(`about.changes`,{n:e});function V({open:e,onClose:t,me:n}){let i=n?.mode===`local`,{status:p,data:_,latest:v,check:k,apply:A,busy:M,progress:N}=x(i&&e),[P,F]=(0,O.useState)(null),[I,V]=(0,O.useState)(`new`),H=C(R.indexOf(I)),U=_?.newer&&v?v:b;(0,O.useEffect)(()=>{if(!e)return;let t=!1;return F(null),T(U===`0.2.52`?void 0:U).then(e=>{t||F(e)}),()=>{t=!0}},[e,U]);let W=P?.find(e=>e.version===`v${U}`)??P?.[0]??null,G=P?.filter(e=>e!==W)??[],K=i?_?.kind??null:`cloud`,q=_?.checkedAt?new Date(_.checkedAt).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):null;return(0,j.jsxs)(h,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,j.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,j.jsx)(f,{label:a(`common.close`),onClick:t,children:(0,j.jsx)(c,{className:`size-4`})})}),(0,j.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,j.jsx)(r,{size:96}),(0,j.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,j.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,j.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,j.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[a(`about.version`,{v:b}),K?` · ${a(`about.kind.${K}`)}`:``]})]}),i?(0,j.jsxs)(`div`,{className:`mt-5 flex flex-col items-center gap-3 text-center text-[0.875rem] text-ink-2`,children:[p.isPending||k.isPending?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(m,{className:`size-4 text-ember-strong`}),a(`about.update.checking`)]}):N?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[M?(0,j.jsx)(m,{className:`size-4 text-ember-strong`}):null,N]}):_?.newer&&v?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,j.jsx)(o,{className:`size-4 shrink-0 text-ember-strong`}),a(`about.update.available`,{v})]}),_.canApply?null:(0,j.jsx)(`p`,{className:`text-ink-3`,children:a(`about.update.manual`)})]}):_?.enabled?_.latest===null?(0,j.jsx)(`p`,{children:a(`about.update.unknown`)}):(0,j.jsxs)(`p`,{children:[a(`about.update.upToDate`),q?(0,j.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,a(`about.update.checkedAt`,{when:q})]}):null]}):(0,j.jsx)(`p`,{children:a(`about.update.off`)}),M||p.isPending?null:(0,j.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[_?.newer&&_.canApply&&_.applying!==`running`?(0,j.jsxs)(g,{size:`sm`,disabled:A.isPending,onClick:()=>A.mutate(),children:[(0,j.jsx)(o,{className:`size-4`}),` `,a(`about.update.install`)]}):null,_?.newer&&_.url?(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,onClick:()=>window.open(_.url??``,`_blank`),children:[a(`about.update.release`),` `,(0,j.jsx)(l,{className:`size-4`})]}):null,_?.enabled===!1?null:(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,disabled:k.isPending,onClick:()=>k.mutate(),children:[(0,j.jsx)(s,{className:y(`size-4`,k.isPending&&`animate-spin`)}),` `,a(`about.update.check`)]})]})]}):null,(0,j.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,j.jsx)(d,{value:I,onChange:V,options:R.map(e=>({id:e,label:z(e)})),label:a(`about.title`)})}),(0,j.jsxs)(`div`,{className:y(`mt-5`,S(H)),children:[I===`new`?P===null?(0,j.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,j.jsx)(m,{})}):W?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[D(W),(0,j.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:E(W)})]}),(0,j.jsx)(`div`,{className:`mt-3`,children:(0,j.jsx)(w,{release:W})})]}):(0,j.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:a(`about.changelogEmpty`)}):null,I===`earlier`?(0,j.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:G.map(e=>(0,j.jsxs)(`details`,{className:`group/r py-2`,children:[(0,j.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,j.jsx)(u,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,j.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:D(e)}),(0,j.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:E(e)}),(0,j.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:B(e.commits.length)})]}),(0,j.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,j.jsx)(w,{release:e})})]},e.version??`unreleased`))}):null,I===`credits`?(0,j.jsx)(L,{active:!0}):null]},I)]})}export{V as AboutDialog};
|