wizards 0.2.46 → 0.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/runtime/dist/app.js +3 -0
- package/apps/runtime/dist/cli/features.js +50 -0
- package/apps/runtime/dist/cli/main.js +4 -1
- package/apps/runtime/dist/features.js +123 -0
- package/apps/runtime/dist/manage.js +13 -0
- package/apps/runtime/dist/plugins/discovery.js +11 -0
- package/apps/runtime/dist/plugins/loader.js +10 -0
- package/apps/runtime/dist/routes/internal.js +3 -0
- package/apps/runtime/dist/routes/studio.js +7 -5
- package/apps/web/dist/assets/{AboutDialog-DkY1j7k6.js → AboutDialog-t7bpiasT.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-820LI5Jt.js → ChangelogDialog-B87yS6aN.js} +1 -1
- package/apps/web/dist/assets/{ChatView-DBl0iRMg.js → ChatView-Dm764bYy.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-BwJ-hqPg.js → EditorPage-BG_Ue2iC.js} +3 -3
- package/apps/web/dist/assets/{Harness-CfUfchNw.js → Harness-zKMptCzB.js} +1 -1
- package/apps/web/dist/assets/HomePage-BXSg5P5k.js +1 -0
- package/apps/web/dist/assets/{ProjectPage-Btf0TeP_.js → ProjectPage-D6Fy7uTV.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-BxYinn04.js → PublicRunner-ChgJs0C9.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-DfnEMPTq.js → RunDrawer-CvIKLphz.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-CLrGb-oq.js → RunnerView-Bmayop7s.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-QkwtRFoD.js +1 -0
- package/apps/web/dist/assets/SetupPage-B3IOQLO3.js +1 -0
- package/apps/web/dist/assets/{SharePage-D5AvnhlY.js → SharePage-C3QEzicl.js} +1 -1
- package/apps/web/dist/assets/ThemeSwitch-3IzIOlNz.js +1 -0
- package/apps/web/dist/assets/changelog-Du2gWzlN.js +1 -0
- package/apps/web/dist/assets/{index-CIO9W4pe.js → index-Cz6c1S5g.js} +4 -4
- package/apps/web/dist/index.html +3 -3
- package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +21 -0
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +54 -0
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +46 -0
- package/node_modules/@engenty-wizards/shared/dist/features.d.ts +36 -0
- package/node_modules/@engenty-wizards/shared/dist/features.js +78 -0
- package/package.json +1 -1
- package/apps/web/dist/assets/HomePage-BG5OZJkv.js +0 -1
- package/apps/web/dist/assets/SettingsPage-FWH84btd.js +0 -1
- package/apps/web/dist/assets/SetupPage-BI0kUNVW.js +0 -1
- package/apps/web/dist/assets/ThemeSwitch-C1qYFoYP.js +0 -1
- package/apps/web/dist/assets/changelog-B6QMrVxX.js +0 -1
package/apps/runtime/dist/app.js
CHANGED
|
@@ -12,6 +12,7 @@ import { ZodError } from "zod";
|
|
|
12
12
|
import { authRoutes, principalOf } from "./auth/index.js";
|
|
13
13
|
import { db, schema, withTenant } from "./db/client.js";
|
|
14
14
|
import { basePath, env } from "./env.js";
|
|
15
|
+
import { features } from "./features.js";
|
|
15
16
|
import { allowed, hashIp } from "./limits.js";
|
|
16
17
|
import { linkPreview } from "./link-preview.js";
|
|
17
18
|
import { discovery, managed } from "./manage.js";
|
|
@@ -134,6 +135,8 @@ app.get("/api/config", (c) => c.json({
|
|
|
134
135
|
devLogin: !managed && env.devLogin,
|
|
135
136
|
/** The product's own site, for a runtime that runs alone. */
|
|
136
137
|
site: managed ? null : env.local.cloudUrl,
|
|
138
|
+
/** The feature switches before anyone is signed in: the code's, the environment's, the file's. */
|
|
139
|
+
features: features(),
|
|
137
140
|
}));
|
|
138
141
|
// OAuth discovery for MCP clients (RFC 9728): the Manage-App is the authorization server.
|
|
139
142
|
app.get("/.well-known/oauth-protected-resource/*", async (c) => {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defaultFeatures, FEATURE_NAME, parseFeatures, resolveFeatures, } from "@engenty-wizards/shared/features";
|
|
2
|
+
import { declaredFeatures, featuresFile, fileFeatures, writeFeature } from "../features.js";
|
|
3
|
+
import { discoverPlugins } from "../plugins/discovery.js";
|
|
4
|
+
import { pluginDirs } from "../plugins/loader.js";
|
|
5
|
+
import { proModulesDir } from "../plugins/pro-state.js";
|
|
6
|
+
import { command } from "./home.js";
|
|
7
|
+
/**
|
|
8
|
+
* `wizards features` — the feature switches of this install, from its `.features` file. Not in
|
|
9
|
+
* the help: for whoever works on a part before it is on for everyone.
|
|
10
|
+
*
|
|
11
|
+
* features what is on, and where that comes from
|
|
12
|
+
* features <name> on|off put a switch into the file
|
|
13
|
+
* features <name> default take it out again
|
|
14
|
+
*/
|
|
15
|
+
export function featuresCommand(args) {
|
|
16
|
+
const [name, value] = args;
|
|
17
|
+
const file = featuresFile();
|
|
18
|
+
if (!name) {
|
|
19
|
+
// The core's switches and those the plugins here declare, without loading them.
|
|
20
|
+
const found = discoverPlugins([...pluginDirs(), proModulesDir()]).found;
|
|
21
|
+
const declared = declaredFeatures(found);
|
|
22
|
+
const fromEnv = parseFeatures(process.env.FEATURES ?? "");
|
|
23
|
+
const fromFile = fileFeatures(file);
|
|
24
|
+
const all = resolveFeatures(defaultFeatures(declared), fromEnv, fromFile);
|
|
25
|
+
const names = [
|
|
26
|
+
...new Set([...Object.keys(declared), ...Object.keys(fromEnv), ...Object.keys(fromFile)]),
|
|
27
|
+
];
|
|
28
|
+
for (const n of names) {
|
|
29
|
+
const source = n in fromFile ? "file" : n in fromEnv ? "FEATURES" : "default";
|
|
30
|
+
const d = declared[n];
|
|
31
|
+
const kind = d ? d.kind : "?";
|
|
32
|
+
console.log(`${all[n] ? "on " : "off"} ${n.padEnd(28)} ${kind.padEnd(8)} ${source.padEnd(9)} ${d?.label ?? ""}`);
|
|
33
|
+
}
|
|
34
|
+
console.log(`\nfile: ${file}\nAn account's or a team's switches come on top of these while the runtime runs.`);
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
if (!FEATURE_NAME.test(name)) {
|
|
38
|
+
console.error(`"${name}" is no switch name (teamPlans, contacts.leadScoring).`);
|
|
39
|
+
return 2;
|
|
40
|
+
}
|
|
41
|
+
if (value === "on" || value === "off" || value === "default") {
|
|
42
|
+
writeFeature(name, value === "default" ? null : value === "on", file);
|
|
43
|
+
console.log(value === "default"
|
|
44
|
+
? `${name} follows the default again (${file}). A running runtime reads it at once.`
|
|
45
|
+
: `${name} is ${value} on this machine (${file}). A running runtime reads it at once.`);
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
console.error(`${command()} features ${name} on|off|default`);
|
|
49
|
+
return 2;
|
|
50
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { apps, connectCommand } from "./connect.js";
|
|
2
|
+
import { featuresCommand } from "./features.js";
|
|
2
3
|
import { command, layout, packageVersion, readInstallNote } from "./home.js";
|
|
3
4
|
import { CLIENTS, nodeIsCurrent } from "./machine.js";
|
|
4
5
|
import { mcp } from "./mcp.js";
|
|
@@ -83,7 +84,7 @@ function parse(argv) {
|
|
|
83
84
|
else if ((args.command === "autostart" || args.command === "logs") && !args.value) {
|
|
84
85
|
args.value = arg;
|
|
85
86
|
}
|
|
86
|
-
else if (
|
|
87
|
+
else if (["connect", "disconnect", "features"].includes(args.command)) {
|
|
87
88
|
args.apps.push(arg);
|
|
88
89
|
}
|
|
89
90
|
else if (args.command) {
|
|
@@ -160,6 +161,8 @@ async function main(argv) {
|
|
|
160
161
|
return connectCommand(paths, args.apps, args.command === "disconnect");
|
|
161
162
|
case "mcp":
|
|
162
163
|
return mcp(paths);
|
|
164
|
+
case "features":
|
|
165
|
+
return featuresCommand(args.apps);
|
|
163
166
|
default:
|
|
164
167
|
console.error(`Unknown command ${args.command}.\n\n${HELP}`);
|
|
165
168
|
return 2;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { declaredByPlugin, defaultFeatures, FEATURES, parseFeatures, resolveFeatures, } from "@engenty-wizards/shared/features";
|
|
4
|
+
import { accountOverview } from "./auth/account.js";
|
|
5
|
+
import { isCheckout, layout, packageRoot } from "./cli/home.js";
|
|
6
|
+
import { env } from "./env.js";
|
|
7
|
+
import { managed, tenantInfo } from "./manage.js";
|
|
8
|
+
import { loadedPlugins } from "./plugins/registry.js";
|
|
9
|
+
import { currentTenantOrNull } from "./tenants/tenant.js";
|
|
10
|
+
/**
|
|
11
|
+
* Which feature switches are on for this runtime (packages/shared/src/features.ts), laid over
|
|
12
|
+
* each other, the last winning:
|
|
13
|
+
*
|
|
14
|
+
* 1. the defaults the code declares: the core's (packages/shared/src/feature-flags.ts) and the
|
|
15
|
+
* loaded plugins' (their manifests' `features`, under the plugin's id)
|
|
16
|
+
* 2. the `FEATURES` environment variable (`teamPlans=on,site=off`): the cloud image, compose, dev
|
|
17
|
+
* 3. what the Manage-App says — for the team of a cloud runtime, for the linked account of a
|
|
18
|
+
* local one; a plan's switches and what an admin set for the team or for everyone
|
|
19
|
+
* 4. the `.features` file of this install (`~/.engenty/wizards/.features`; a checkout reads
|
|
20
|
+
* the repo root's, a cloud runtime its data folder's) — this machine's word is the last
|
|
21
|
+
*
|
|
22
|
+
* The file is read on every call, so a change counts at once. Nothing here is documented
|
|
23
|
+
* outside the code.
|
|
24
|
+
*/
|
|
25
|
+
/** The `.features` file this runtime reads: the install's, the checkout's root, or the data folder's. */
|
|
26
|
+
export function featuresFile() {
|
|
27
|
+
if (managed) {
|
|
28
|
+
return join(env.dataDir, ".features");
|
|
29
|
+
}
|
|
30
|
+
return isCheckout() ? join(packageRoot, ".features") : join(layout().home, ".features");
|
|
31
|
+
}
|
|
32
|
+
let fileCache = null;
|
|
33
|
+
/** What the `.features` file says, read again when it changed. */
|
|
34
|
+
export function fileFeatures(file = featuresFile()) {
|
|
35
|
+
let mtime = -1;
|
|
36
|
+
try {
|
|
37
|
+
mtime = statSync(file).mtimeMs;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
fileCache = null;
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
if (fileCache && fileCache.file === file && fileCache.mtime === mtime) {
|
|
44
|
+
return fileCache.value;
|
|
45
|
+
}
|
|
46
|
+
const value = parseFeatures(readFileSync(file, "utf8"));
|
|
47
|
+
fileCache = { file, mtime, value };
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
const envFeatures = () => parseFeatures(process.env.FEATURES ?? "");
|
|
51
|
+
/** Every switch something declared: the core's, then each plugin's under its id. */
|
|
52
|
+
export function declaredFeatures(sources = loadedPlugins().map((p) => p.source)) {
|
|
53
|
+
const out = { ...FEATURES };
|
|
54
|
+
for (const source of sources) {
|
|
55
|
+
Object.assign(out, declaredByPlugin(source.id, source.manifest.features));
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
/** The switches, with what the Manage-App said for the team or account laid in. */
|
|
60
|
+
export function features(remote) {
|
|
61
|
+
return resolveFeatures(defaultFeatures(declaredFeatures()), envFeatures(), remote, fileFeatures());
|
|
62
|
+
}
|
|
63
|
+
export function feature(name, remote) {
|
|
64
|
+
return features(remote)[name] === true;
|
|
65
|
+
}
|
|
66
|
+
let accountCache = null;
|
|
67
|
+
/**
|
|
68
|
+
* What the Manage-App says for the tenant at hand: the team's switches on a cloud runtime
|
|
69
|
+
* (cached a minute by `tenantInfo`), the linked account's on a local one (cached a minute
|
|
70
|
+
* here). Null when nothing is linked or the Manage-App does not answer.
|
|
71
|
+
*/
|
|
72
|
+
export async function remoteFeatures() {
|
|
73
|
+
if (managed) {
|
|
74
|
+
const id = currentTenantOrNull();
|
|
75
|
+
if (!id) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return tenantInfo(id)
|
|
79
|
+
.then((info) => info.features ?? null)
|
|
80
|
+
.catch(() => null);
|
|
81
|
+
}
|
|
82
|
+
if (accountCache && Date.now() - accountCache.at < 60_000) {
|
|
83
|
+
return accountCache.value;
|
|
84
|
+
}
|
|
85
|
+
const overview = await accountOverview().catch(() => null);
|
|
86
|
+
accountCache = { at: Date.now(), value: overview?.tenant.features ?? null };
|
|
87
|
+
return accountCache.value;
|
|
88
|
+
}
|
|
89
|
+
/** The switches for the tenant at hand, with what the Manage-App says fetched. */
|
|
90
|
+
export async function currentFeatures() {
|
|
91
|
+
return features(await remoteFeatures());
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Writes one switch into the `.features` file as `name=on` or `name=off`, on the line that
|
|
95
|
+
* names it when there is one (commented out or not), else at the end; `null` turns the line
|
|
96
|
+
* back into the template's `# name=on|off`. Other lines and comments stay as they are. For the
|
|
97
|
+
* `wizards features` command.
|
|
98
|
+
*/
|
|
99
|
+
export function writeFeature(name, on, file = featuresFile()) {
|
|
100
|
+
let lines = [];
|
|
101
|
+
try {
|
|
102
|
+
lines = readFileSync(file, "utf8").replace(/\n+$/, "").split("\n");
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
lines = [];
|
|
106
|
+
}
|
|
107
|
+
const names = (line) => {
|
|
108
|
+
const m = /^\s*#?\s*([A-Za-z0-9.]+)\s*=\s*\S+\s*(?:#.*)?$/.exec(line);
|
|
109
|
+
return m?.[1] === name;
|
|
110
|
+
};
|
|
111
|
+
const written = on === null ? `# ${name}=on|off` : `${name}=${on ? "on" : "off"}`;
|
|
112
|
+
const at = lines.findIndex(names);
|
|
113
|
+
if (at === -1) {
|
|
114
|
+
lines.push(written);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
lines[at] = written;
|
|
118
|
+
}
|
|
119
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
120
|
+
writeFileSync(file, `${lines.join("\n")}\n`);
|
|
121
|
+
fileCache = null;
|
|
122
|
+
return fileFeatures(file);
|
|
123
|
+
}
|
|
@@ -109,6 +109,19 @@ async function call(method, path, body) {
|
|
|
109
109
|
export function tenantMembers(id) {
|
|
110
110
|
return call("GET", `/v1/tenants/${encodeURIComponent(id)}/members`);
|
|
111
111
|
}
|
|
112
|
+
const users = new Map();
|
|
113
|
+
/** A person's own feature switches, as an admin set them at the Manage-App; cached a minute. */
|
|
114
|
+
export async function userFeatures(userId) {
|
|
115
|
+
const hit = users.get(userId);
|
|
116
|
+
if (hit && Date.now() - hit.at < 60_000) {
|
|
117
|
+
return hit.value;
|
|
118
|
+
}
|
|
119
|
+
const value = await call("GET", `/v1/users/${encodeURIComponent(userId)}`)
|
|
120
|
+
.then((u) => u.features ?? {})
|
|
121
|
+
.catch(() => hit?.value ?? {});
|
|
122
|
+
users.set(userId, { at: Date.now(), value });
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
112
125
|
const tenants = new Map();
|
|
113
126
|
/** Plan, limits and balance of a tenant, cached for a minute. */
|
|
114
127
|
export async function tenantInfo(id, fresh = false) {
|
|
@@ -20,6 +20,17 @@ const manifestSchema = z.looseObject({
|
|
|
20
20
|
server: z.string().optional(),
|
|
21
21
|
studio: z.string().optional(),
|
|
22
22
|
styles: z.string().optional(),
|
|
23
|
+
features: z
|
|
24
|
+
.record(z.string().regex(/^[a-z][a-zA-Z0-9]*$/), z.union([
|
|
25
|
+
z.boolean(),
|
|
26
|
+
z.object({
|
|
27
|
+
kind: z.enum(["release", "plan"]).optional(),
|
|
28
|
+
default: z.boolean().optional(),
|
|
29
|
+
label: z.string().max(80).optional(),
|
|
30
|
+
hint: z.string().max(300).optional(),
|
|
31
|
+
}),
|
|
32
|
+
]))
|
|
33
|
+
.optional(),
|
|
23
34
|
});
|
|
24
35
|
/** `.mjs` is left out: Node keeps such a file once imported, so a reload would not read it again. */
|
|
25
36
|
const CODE = new Set([".ts", ".js"]);
|
|
@@ -12,6 +12,7 @@ import { pluginConnections } from "../connectors/plugin-connections.js";
|
|
|
12
12
|
import { db, onTenantOpen } from "../db/client.js";
|
|
13
13
|
import { parseDocument } from "../documents/parse.js";
|
|
14
14
|
import { env } from "../env.js";
|
|
15
|
+
import { currentFeatures } from "../features.js";
|
|
15
16
|
import { managed } from "../manage.js";
|
|
16
17
|
import { conversationAccess, ModelUnavailableError, textModel } from "../models.js";
|
|
17
18
|
import { putIndexEntry, removeIndexEntries } from "../services/project-index.js";
|
|
@@ -92,6 +93,15 @@ function apiFor(record) {
|
|
|
92
93
|
plugin: source.manifest,
|
|
93
94
|
resolvePath: (relative) => resolve(source.root, relative),
|
|
94
95
|
config: { get: (key) => process.env[key]?.trim() || undefined },
|
|
96
|
+
features: {
|
|
97
|
+
// A short name is the plugin's own switch; a dotted or core name is taken as it is.
|
|
98
|
+
has: async (name) => {
|
|
99
|
+
const all = await currentFeatures();
|
|
100
|
+
const own = `${source.id}.${name}`;
|
|
101
|
+
return (own in all ? all[own] : all[name]) === true;
|
|
102
|
+
},
|
|
103
|
+
all: currentFeatures,
|
|
104
|
+
},
|
|
95
105
|
log: {
|
|
96
106
|
info: (...args) => console.log(tag, ...args),
|
|
97
107
|
warn: (...args) => console.warn(tag, ...args),
|
|
@@ -6,6 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
import { closeTenantDb, tenantDb } from "../db/client.js";
|
|
7
7
|
import { logs, runDetail, status, tenantModels } from "../debug.js";
|
|
8
8
|
import { env } from "../env.js";
|
|
9
|
+
import { declaredFeatures } from "../features.js";
|
|
9
10
|
import { removeTenantObjects } from "../files/objects.js";
|
|
10
11
|
import { tailQuery } from "../log.js";
|
|
11
12
|
import { forgetTenant, managed } from "../manage.js";
|
|
@@ -51,6 +52,8 @@ export const internalRoutes = new Hono()
|
|
|
51
52
|
description: p.source.manifest.description ?? "",
|
|
52
53
|
version: p.source.manifest.version ?? null,
|
|
53
54
|
})),
|
|
55
|
+
/** Every feature switch this runtime knows: the core's and its plugins' (under their ids). */
|
|
56
|
+
features: declaredFeatures(),
|
|
54
57
|
});
|
|
55
58
|
})
|
|
56
59
|
.post("/tenants/:id", async (c) => {
|
|
@@ -19,10 +19,11 @@ import { balanceCredits, canSpend } from "../credits/credits.js";
|
|
|
19
19
|
import { estimateRun } from "../credits/estimate.js";
|
|
20
20
|
import { missingModels, stepsWithoutModel } from "../engine/requirements.js";
|
|
21
21
|
import { env } from "../env.js";
|
|
22
|
+
import { feature, features } from "../features.js";
|
|
22
23
|
import { freshAuth, loginEnv } from "../harness/env.js";
|
|
23
24
|
import { detectHarness, detectHarnesses, HARNESS_IDS, harness, installSpec, } from "../harness/index.js";
|
|
24
25
|
import { closeTerminal, openTerminal, resizeTerminal, subscribeTerminal, writeTerminal, } from "../harness/terminal.js";
|
|
25
|
-
import { managed, tenantInfo, tenantMembers } from "../manage.js";
|
|
26
|
+
import { managed, tenantInfo, tenantMembers, userFeatures } from "../manage.js";
|
|
26
27
|
import { seenApps } from "../mcp/seen.js";
|
|
27
28
|
import { generateImageMedia, generateSpeechMedia, generateVideoMedia } from "../media/generate.js";
|
|
28
29
|
import { transcribeAudio } from "../media/transcribe.js";
|
|
@@ -189,8 +190,9 @@ export const studio = new Hono()
|
|
|
189
190
|
const linked = managed ? null : await linkedAccount();
|
|
190
191
|
const overview = linked ? await accountOverview() : null;
|
|
191
192
|
const profile = await userProfile(user);
|
|
192
|
-
// What the Manage-App says of the tenant: its plan and feature switches.
|
|
193
|
+
// What the Manage-App says of the tenant: its plan and feature switches; and of the person.
|
|
193
194
|
const info = managed ? await tenantInfo(user.tenantId).catch(() => null) : null;
|
|
195
|
+
const own = managed ? await userFeatures(user.id) : null;
|
|
194
196
|
return c.json({
|
|
195
197
|
user: { id: user.id, name: profile.name, email: profile.email, image: user.image ?? null },
|
|
196
198
|
/** What the person says about themselves; name and e-mail are the account's when managed. */
|
|
@@ -201,8 +203,8 @@ export const studio = new Hono()
|
|
|
201
203
|
/** The plan the team is on; null alone, or where the Manage-App names none. */
|
|
202
204
|
plan: info?.plan ?? null,
|
|
203
205
|
},
|
|
204
|
-
/** The
|
|
205
|
-
features: managed ?
|
|
206
|
+
/** The feature switches: the code's defaults, what the Manage-App says of the team and the person, this install's file. */
|
|
207
|
+
features: features(managed ? { ...info?.features, ...own } : overview?.tenant.features),
|
|
206
208
|
mode: managed ? "managed" : "local",
|
|
207
209
|
/** The tenant's balance; null where the runtime resolves models itself. */
|
|
208
210
|
credits: managed ? await balanceCredits() : null,
|
|
@@ -1034,7 +1036,7 @@ export const studio = new Hono()
|
|
|
1034
1036
|
const info = await tenantInfo(c.get("user").tenantId).catch(() => null);
|
|
1035
1037
|
const own = Object.values(input.keys ?? {}).some((key) => key?.trim()) ||
|
|
1036
1038
|
Object.values(input.bindings ?? {}).some((ref) => ref && !isCreditsRef(ref));
|
|
1037
|
-
if (own && info && info.features
|
|
1039
|
+
if (own && info && !feature("ownKeys", info.features)) {
|
|
1038
1040
|
return c.json({
|
|
1039
1041
|
error: `Eigene API Keys gibt es nicht im Paket ${info.plan?.name ?? "des Teams"}.`,
|
|
1040
1042
|
code: "plan",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./logo-C80CWCDM.js";import{t as i}from"./preload-helper-CNEI7N0N.js";import{H as a,I as o,M as s,P as c,_ as l,a as u,f as d,h as f,i as p,o as m,s as h,t as g}from"./ui-D92EkdEB.js";import{t as _}from"./external-link-CpU8aJY2.js";import{t as v}from"./refresh-cw-Cli5WGnW.js";import{F as y,L as b,V as x}from"./index-CIO9W4pe.js";import{c as S,f as C}from"./settings-menu-ROT8Lbbj.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-820LI5Jt.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)(_,{"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[s]},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,a]=(0,O.useState)(``);(0,O.useEffect)(()=>{if(!e||t)return;let r=!1;return i(()=>import(`./oss-credits-CIxnNZor.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,O.useEffect)(()=>{e||a(``)},[e]);let o=r.trim().toLowerCase(),s=e=>o?e.filter(e=>M(o,e.name,e.license,e.description.de,e.description.en)):e,l=e=>o?e.filter(e=>M(o,e.name,e.license,e.version)):e,f=s(k),p=s(A),m=t?[{id:`shared`,label:c(`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=f.length===0&&p.length===0&&m.length===0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:c(`about.creditsHint`)}),(0,j.jsx)(h,{type:`search`,value:r,placeholder:c(`about.search`),onChange:e=>a(e.target.value)}),f.length>0?(0,j.jsx)(P,{title:c(`about.creditsProduct`),children:(0,j.jsx)(F,{credits:f})}):null,p.length>0?(0,j.jsx)(P,{title:c(`about.creditsBuiltWith`),children:(0,j.jsx)(F,{credits:p})}):null,t===null?(0,j.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,j.jsx)(d,{})}):m.length>0?(0,j.jsx)(P,{title:c(`about.creditsDeps`),hint:o?void 0:c(`about.creditsDepsHint`),children:m.map(e=>(0,j.jsx)(I,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,j.jsx)(u,{children:c(`about.noMatches`)}):null]})}var R=[`new`,`earlier`,`credits`],z=e=>c(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),B=e=>e===1?c(`about.change`):c(`about.changes`,{n:e});function V({open:e,onClose:t,me:n}){let i=n?.mode===`local`,{status:s,data:u,latest:h,check:k,apply:A,busy:M,progress:N}=y(i&&e),[P,F]=(0,O.useState)(null),[I,V]=(0,O.useState)(`new`),H=C(R.indexOf(I)),U=u?.newer&&h?h:b;(0,O.useEffect)(()=>{if(!e)return;let t=!1;return F(null),T(U===`0.2.46`?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?u?.kind??null:`cloud`,q=u?.checkedAt?new Date(u.checkedAt).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):null;return(0,j.jsxs)(p,{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)(m,{label:c(`common.close`),onClick:t,children:(0,j.jsx)(o,{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:[c(`about.version`,{v:b}),K?` · ${c(`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:[s.isPending||k.isPending?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(d,{className:`size-4 text-ember-strong`}),c(`about.update.checking`)]}):N?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[M?(0,j.jsx)(d,{className:`size-4 text-ember-strong`}):null,N]}):u?.newer&&h?(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)(x,{className:`size-4 shrink-0 text-ember-strong`}),c(`about.update.available`,{v:h})]}),u.canApply?null:(0,j.jsx)(`p`,{className:`text-ink-3`,children:c(`about.update.manual`)})]}):u?.enabled?u.latest===null?(0,j.jsx)(`p`,{children:c(`about.update.unknown`)}):(0,j.jsxs)(`p`,{children:[c(`about.update.upToDate`),q?(0,j.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,c(`about.update.checkedAt`,{when:q})]}):null]}):(0,j.jsx)(`p`,{children:c(`about.update.off`)}),M||s.isPending?null:(0,j.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[u?.newer&&u.canApply&&u.applying!==`running`?(0,j.jsxs)(g,{size:`sm`,disabled:A.isPending,onClick:()=>A.mutate(),children:[(0,j.jsx)(x,{className:`size-4`}),` `,c(`about.update.install`)]}):null,u?.newer&&u.url?(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,onClick:()=>window.open(u.url??``,`_blank`),children:[c(`about.update.release`),` `,(0,j.jsx)(_,{className:`size-4`})]}):null,u?.enabled===!1?null:(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,disabled:k.isPending,onClick:()=>k.mutate(),children:[(0,j.jsx)(v,{className:l(`size-4`,k.isPending&&`animate-spin`)}),` `,c(`about.update.check`)]})]})]}):null,(0,j.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,j.jsx)(f,{value:I,onChange:V,options:R.map(e=>({id:e,label:z(e)})),label:c(`about.title`)})}),(0,j.jsxs)(`div`,{className:l(`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)(d,{})}):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:c(`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)(a,{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{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./logo-C80CWCDM.js";import{t as i}from"./preload-helper-CNEI7N0N.js";import{H as a,I as o,M as s,P as c,_ as l,a as u,f as d,h as f,i as p,o as m,s as h,t as g}from"./ui-D92EkdEB.js";import{t as _}from"./external-link-CpU8aJY2.js";import{t as v}from"./refresh-cw-Cli5WGnW.js";import{F as y,L as b,V as x}from"./index-Cz6c1S5g.js";import{c as S,f as C}from"./settings-menu-ROT8Lbbj.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-B87yS6aN.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)(_,{"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[s]},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,a]=(0,O.useState)(``);(0,O.useEffect)(()=>{if(!e||t)return;let r=!1;return i(()=>import(`./oss-credits-CIxnNZor.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,O.useEffect)(()=>{e||a(``)},[e]);let o=r.trim().toLowerCase(),s=e=>o?e.filter(e=>M(o,e.name,e.license,e.description.de,e.description.en)):e,l=e=>o?e.filter(e=>M(o,e.name,e.license,e.version)):e,f=s(k),p=s(A),m=t?[{id:`shared`,label:c(`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=f.length===0&&p.length===0&&m.length===0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:c(`about.creditsHint`)}),(0,j.jsx)(h,{type:`search`,value:r,placeholder:c(`about.search`),onChange:e=>a(e.target.value)}),f.length>0?(0,j.jsx)(P,{title:c(`about.creditsProduct`),children:(0,j.jsx)(F,{credits:f})}):null,p.length>0?(0,j.jsx)(P,{title:c(`about.creditsBuiltWith`),children:(0,j.jsx)(F,{credits:p})}):null,t===null?(0,j.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,j.jsx)(d,{})}):m.length>0?(0,j.jsx)(P,{title:c(`about.creditsDeps`),hint:o?void 0:c(`about.creditsDepsHint`),children:m.map(e=>(0,j.jsx)(I,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,j.jsx)(u,{children:c(`about.noMatches`)}):null]})}var R=[`new`,`earlier`,`credits`],z=e=>c(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),B=e=>e===1?c(`about.change`):c(`about.changes`,{n:e});function V({open:e,onClose:t,me:n}){let i=n?.mode===`local`,{status:s,data:u,latest:h,check:k,apply:A,busy:M,progress:N}=y(i&&e),[P,F]=(0,O.useState)(null),[I,V]=(0,O.useState)(`new`),H=C(R.indexOf(I)),U=u?.newer&&h?h:b;(0,O.useEffect)(()=>{if(!e)return;let t=!1;return F(null),T(U===`0.2.47`?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?u?.kind??null:`cloud`,q=u?.checkedAt?new Date(u.checkedAt).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):null;return(0,j.jsxs)(p,{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)(m,{label:c(`common.close`),onClick:t,children:(0,j.jsx)(o,{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:[c(`about.version`,{v:b}),K?` · ${c(`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:[s.isPending||k.isPending?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(d,{className:`size-4 text-ember-strong`}),c(`about.update.checking`)]}):N?(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[M?(0,j.jsx)(d,{className:`size-4 text-ember-strong`}):null,N]}):u?.newer&&h?(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)(x,{className:`size-4 shrink-0 text-ember-strong`}),c(`about.update.available`,{v:h})]}),u.canApply?null:(0,j.jsx)(`p`,{className:`text-ink-3`,children:c(`about.update.manual`)})]}):u?.enabled?u.latest===null?(0,j.jsx)(`p`,{children:c(`about.update.unknown`)}):(0,j.jsxs)(`p`,{children:[c(`about.update.upToDate`),q?(0,j.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,c(`about.update.checkedAt`,{when:q})]}):null]}):(0,j.jsx)(`p`,{children:c(`about.update.off`)}),M||s.isPending?null:(0,j.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[u?.newer&&u.canApply&&u.applying!==`running`?(0,j.jsxs)(g,{size:`sm`,disabled:A.isPending,onClick:()=>A.mutate(),children:[(0,j.jsx)(x,{className:`size-4`}),` `,c(`about.update.install`)]}):null,u?.newer&&u.url?(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,onClick:()=>window.open(u.url??``,`_blank`),children:[c(`about.update.release`),` `,(0,j.jsx)(_,{className:`size-4`})]}):null,u?.enabled===!1?null:(0,j.jsxs)(g,{size:`sm`,variant:`secondary`,disabled:k.isPending,onClick:()=>k.mutate(),children:[(0,j.jsx)(v,{className:l(`size-4`,k.isPending&&`animate-spin`)}),` `,c(`about.update.check`)]})]})]}):null,(0,j.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,j.jsx)(f,{value:I,onChange:V,options:R.map(e=>({id:e,label:z(e)})),label:c(`about.title`)})}),(0,j.jsxs)(`div`,{className:l(`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)(d,{})}):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:c(`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)(a,{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 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./preload-helper-CNEI7N0N.js";import{P as i,_ as a,a as o,f as s,i as c,s as l}from"./ui-D92EkdEB.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/,``):i(`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 r(async()=>{let{default:e}=await import(`./changelog-
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./preload-helper-CNEI7N0N.js";import{P as i,_ as a,a as o,f as s,i as c,s as l}from"./ui-D92EkdEB.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/,``):i(`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 r(async()=>{let{default:e}=await import(`./changelog-Du2gWzlN.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:a(`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:i(`about.breaking`)}):null]})]},e.id)})})}function y({open:e,onClose:t,version:n}){let[r,a]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||r)return;let t=!1;return _(n).then(e=>{t||a(e)}),()=>{t=!0}},[e,r,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=r?g(r,f):[];return(0,d.jsxs)(c,{open:e,onClose:t,title:i(`about.changelog`),wide:!0,height:`tall`,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:i(`about.changelogHint`)}),r===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(s,{})}):r.length===0?(0,d.jsx)(o,{children:i(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l,{type:`search`,value:f,placeholder:i(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(o,{children:i(`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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./react-dom-DenslgJm.js";import{A as i,B as a,C as o,G as s,J as c,K as l,L as u,M as d,P as f,_ as p,f as m,g as h,j as g,l as _,o as v,x as y,z as b}from"./ui-D92EkdEB.js";import{_ as x,a as S,c as C,d as w,f as T,g as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,u as F,v as I}from"./RunnerView-CLrGb-oq.js";import{t as L}from"./sparkles-CP5H-O1E.js";import{n as R,t as ee}from"./volume-2-0SfkvOho.js";import{O as z,S as B,g as te,o as ne}from"./definition-CQGiBQ4X.js";import{T as re,b as ie,f as ae,h as oe}from"./index-CIO9W4pe.js";var se={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};se.node;var ce=c(se),le={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]};le.node;var ue=c(le),de={name:`phone-off`,size:24,node:[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]};de.node;var fe=c(de),pe={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};pe.node;var me=c(pe),he={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};he.node;var ge=c(he),_e={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};_e.node;var ve=c(_e),ye=r(),V=e(t(),1),be=`wz.readAloud`,H=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function xe(){try{return localStorage.getItem(be)===`1`}catch{return!1}}function Se(e){try{localStorage.setItem(be,e?`1`:`0`)}catch{}}function Ce(e){let t=window.speechSynthesis.getVoices(),n=e.slice(0,2);return t.find(t=>t.lang===e&&t.default)??t.find(t=>t.lang===e)??t.find(e=>e.lang.startsWith(n)&&e.default)??t.find(e=>e.lang.startsWith(n))??null}function we(e,t=d,n=!1){if(!H||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=t===`de`?`de-DE`:`en-US`,a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=Ce(i);o&&(a.voice=o),r.speak(a)}function Te(){H&&window.speechSynthesis.cancel()}function Ee(){let[e,t]=(0,V.useState)(()=>H&&xe()),n=(0,V.useCallback)(e=>{t(e),Se(e),e||Te()},[]);return(0,V.useEffect)(()=>{H&&window.speechSynthesis.getVoices()},[]),(0,V.useEffect)(()=>()=>Te(),[]),[e,n]}function De(e,t,n,r){let i=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(!e){i.current=null;return}let a=n.map(e=>e.key);if(!i.current){i.current=new Set(a);let e=[...n].reverse().find(e=>e.who===`bot`&&e.spoken!==!1);if(e){let n=r(e.key);n&&we(n,t,!0)}return}let o=n.filter(e=>!i.current?.has(e.key));for(let e of a)i.current.add(e);o.some(e=>e.who===`me`)&&Te();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&we(n,t)}},[e,t,n,r])}var U=e(n(),1),Oe=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function ke({since:e}){let[t,n]=(0,V.useState)(Date.now());if((0,V.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,U.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function W({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:p(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,U.jsx)(m,{className:`size-5`}):a})}function Ae({voice:e}){let t=(0,V.useRef)(null),{captions:n}=e;return(0,V.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,U.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,U.jsx)(`li`,{className:p(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,U.jsx)(`div`,{ref:t})]})}):null}function je({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,o=e.state===`connecting`,[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(!1);(0,V.useEffect)(()=>{c(i?Date.now():null)},[i]);let d=async()=>{u(!1),await e.start(),n&&await e.startCamera()},h=()=>{e.stop(),u(!0)},g=n||e.camera,_=[...e.captions].reverse().find(e=>e.who===`bot`),v=[...e.captions].reverse().find(e=>e.who===`me`),y=e.speaking?f(`talk.speaking`):e.listening?f(`talk.listening`):i?f(`talk.live`):o?f(`talk.connecting`):l?f(`video.ended`):``;return(0,U.jsxs)(`section`,{className:p(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,U.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),y?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,U.jsx)(`span`,{className:p(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,y]}):null,(0,U.jsx)(ke,{since:s})]}),(0,U.jsxs)(`div`,{className:p(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,g?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!g&&i&&e.captions.length?`h-[38%]`:g?``:`flex-1`),children:[(0,U.jsxs)(`div`,{className:p(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!g&&`hidden`),children:[(0,U.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:p(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,U.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,U.jsx)(ge,{className:`size-8`}),(0,U.jsx)(`span`,{className:`text-[0.8125rem]`,children:f(`video.cameraOff`)})]}),(0,U.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[f(`video.you`),e.muted?(0,U.jsx)(ue,{className:`ml-1.5 inline size-3`}):null]})]}),(0,U.jsxs)(`div`,{className:p(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,g?`bg-neutral-900`:`bg-transparent`,g&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,U.jsx)(`div`,{className:p(`rounded-full transition-shadow duration-500`,!g&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!g&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,U.jsx)(z,{kind:t?.wizard.avatar??`round`,size:g?140:200,fluffy:!0,interactive:!1})}),g?(0,U.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),i&&!g?(0,U.jsx)(Ae,{voice:e}):i&&(_||v)?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[v?(0,U.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:v.text}):null,_?(0,U.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:_.text}):null]})}):null,e.error?(0,U.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,U.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(W,{label:f(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,U.jsx)(ue,{className:`size-5`}):(0,U.jsx)(a,{className:`size-5`})}),(0,U.jsx)(W,{label:f(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,U.jsx)(R,{className:`size-5`}):(0,U.jsx)(ge,{className:`size-5`})}),e.camera&&Oe?(0,U.jsx)(W,{label:f(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,U.jsx)(k,{className:`size-5`})}):null,(0,U.jsx)(W,{label:f(`video.leave`),danger:!0,onClick:h,children:(0,U.jsx)(fe,{className:`size-5`})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:o||!t?.talk,onClick:()=>void d(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[o?(0,U.jsx)(m,{className:`size-4`}):n?(0,U.jsx)(R,{className:`size-5`}):(0,U.jsx)(a,{className:`size-5`}),f(l?`video.rejoin`:n?`video.join`:`talk.start`)]}),!l&&!e.error?(0,U.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:f(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var Me=e=>ne[e.kind]!==`device`,Ne=1024,Pe=4e3;function Fe(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Ie(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./react-dom-DenslgJm.js";import{A as i,B as a,C as o,G as s,J as c,K as l,L as u,M as d,P as f,_ as p,f as m,g as h,j as g,l as _,o as v,x as y,z as b}from"./ui-D92EkdEB.js";import{_ as x,a as S,c as C,d as w,f as T,g as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,u as F,v as I}from"./RunnerView-Bmayop7s.js";import{t as L}from"./sparkles-CP5H-O1E.js";import{n as R,t as ee}from"./volume-2-0SfkvOho.js";import{O as z,S as B,g as te,o as ne}from"./definition-CQGiBQ4X.js";import{T as re,b as ie,f as ae,h as oe}from"./index-Cz6c1S5g.js";var se={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};se.node;var ce=c(se),le={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]};le.node;var ue=c(le),de={name:`phone-off`,size:24,node:[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]};de.node;var fe=c(de),pe={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};pe.node;var me=c(pe),he={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};he.node;var ge=c(he),_e={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};_e.node;var ve=c(_e),ye=r(),V=e(t(),1),be=`wz.readAloud`,H=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function xe(){try{return localStorage.getItem(be)===`1`}catch{return!1}}function Se(e){try{localStorage.setItem(be,e?`1`:`0`)}catch{}}function Ce(e){let t=window.speechSynthesis.getVoices(),n=e.slice(0,2);return t.find(t=>t.lang===e&&t.default)??t.find(t=>t.lang===e)??t.find(e=>e.lang.startsWith(n)&&e.default)??t.find(e=>e.lang.startsWith(n))??null}function we(e,t=d,n=!1){if(!H||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=t===`de`?`de-DE`:`en-US`,a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=Ce(i);o&&(a.voice=o),r.speak(a)}function Te(){H&&window.speechSynthesis.cancel()}function Ee(){let[e,t]=(0,V.useState)(()=>H&&xe()),n=(0,V.useCallback)(e=>{t(e),Se(e),e||Te()},[]);return(0,V.useEffect)(()=>{H&&window.speechSynthesis.getVoices()},[]),(0,V.useEffect)(()=>()=>Te(),[]),[e,n]}function De(e,t,n,r){let i=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(!e){i.current=null;return}let a=n.map(e=>e.key);if(!i.current){i.current=new Set(a);let e=[...n].reverse().find(e=>e.who===`bot`&&e.spoken!==!1);if(e){let n=r(e.key);n&&we(n,t,!0)}return}let o=n.filter(e=>!i.current?.has(e.key));for(let e of a)i.current.add(e);o.some(e=>e.who===`me`)&&Te();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&we(n,t)}},[e,t,n,r])}var U=e(n(),1),Oe=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function ke({since:e}){let[t,n]=(0,V.useState)(Date.now());if((0,V.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,U.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function W({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:p(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,U.jsx)(m,{className:`size-5`}):a})}function Ae({voice:e}){let t=(0,V.useRef)(null),{captions:n}=e;return(0,V.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,U.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,U.jsx)(`li`,{className:p(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,U.jsx)(`div`,{ref:t})]})}):null}function je({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,o=e.state===`connecting`,[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(!1);(0,V.useEffect)(()=>{c(i?Date.now():null)},[i]);let d=async()=>{u(!1),await e.start(),n&&await e.startCamera()},h=()=>{e.stop(),u(!0)},g=n||e.camera,_=[...e.captions].reverse().find(e=>e.who===`bot`),v=[...e.captions].reverse().find(e=>e.who===`me`),y=e.speaking?f(`talk.speaking`):e.listening?f(`talk.listening`):i?f(`talk.live`):o?f(`talk.connecting`):l?f(`video.ended`):``;return(0,U.jsxs)(`section`,{className:p(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,U.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),y?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,U.jsx)(`span`,{className:p(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,y]}):null,(0,U.jsx)(ke,{since:s})]}),(0,U.jsxs)(`div`,{className:p(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,g?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!g&&i&&e.captions.length?`h-[38%]`:g?``:`flex-1`),children:[(0,U.jsxs)(`div`,{className:p(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!g&&`hidden`),children:[(0,U.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:p(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,U.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,U.jsx)(ge,{className:`size-8`}),(0,U.jsx)(`span`,{className:`text-[0.8125rem]`,children:f(`video.cameraOff`)})]}),(0,U.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[f(`video.you`),e.muted?(0,U.jsx)(ue,{className:`ml-1.5 inline size-3`}):null]})]}),(0,U.jsxs)(`div`,{className:p(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,g?`bg-neutral-900`:`bg-transparent`,g&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,U.jsx)(`div`,{className:p(`rounded-full transition-shadow duration-500`,!g&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!g&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,U.jsx)(z,{kind:t?.wizard.avatar??`round`,size:g?140:200,fluffy:!0,interactive:!1})}),g?(0,U.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),i&&!g?(0,U.jsx)(Ae,{voice:e}):i&&(_||v)?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[v?(0,U.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:v.text}):null,_?(0,U.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:_.text}):null]})}):null,e.error?(0,U.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,U.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(W,{label:f(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,U.jsx)(ue,{className:`size-5`}):(0,U.jsx)(a,{className:`size-5`})}),(0,U.jsx)(W,{label:f(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,U.jsx)(R,{className:`size-5`}):(0,U.jsx)(ge,{className:`size-5`})}),e.camera&&Oe?(0,U.jsx)(W,{label:f(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,U.jsx)(k,{className:`size-5`})}):null,(0,U.jsx)(W,{label:f(`video.leave`),danger:!0,onClick:h,children:(0,U.jsx)(fe,{className:`size-5`})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:o||!t?.talk,onClick:()=>void d(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[o?(0,U.jsx)(m,{className:`size-4`}):n?(0,U.jsx)(R,{className:`size-5`}):(0,U.jsx)(a,{className:`size-5`}),f(l?`video.rejoin`:n?`video.join`:`talk.start`)]}),!l&&!e.error?(0,U.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:f(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var Me=e=>ne[e.kind]!==`device`,Ne=1024,Pe=4e3;function Fe(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Ie(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
|
|
2
2
|
`);if(e.status===`running`){let t=[...e.events].reverse().find(e=>e.type===`tool`||e.type===`info`||e.type===`step_started`);return r.push(`working on: ${e.step?.title??``}`),t&&r.push(`doing: ${g(t)}`),r.join(`
|
|
3
3
|
`)}if(e.status===`done`){r.push(`done. made:`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.title}: ${Fe(n?.text,400)||`(a file, on the screen)`}`);return r.join(`
|
|
4
4
|
`)}if(e.status===`failed`)return r.push(`failed: ${e.error??``}; go_back or the person retries on the screen`),r.join(`
|