wizards 0.2.57 → 0.2.59
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/cli/menu.js +49 -18
- package/apps/runtime/dist/cli/update.js +7 -2
- package/apps/runtime/dist/db/migrations/tenant/0015_device_calls.sql +13 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0015_snapshot.json +3243 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +19 -0
- package/apps/runtime/dist/engine/device.js +61 -49
- package/apps/runtime/dist/engine/events.js +30 -7
- package/apps/runtime/dist/engine/runner.js +4 -1
- package/apps/runtime/dist/models.js +1 -1
- package/apps/runtime/dist/plugins/runs.js +2 -6
- package/apps/runtime/dist/routes/runs.js +16 -9
- package/apps/web/dist/assets/{AboutDialog-DEZCEQlN.js → AboutDialog-DBoAyoKO.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-CgnnJj4G.js → ChangelogDialog-BmFgf8E1.js} +1 -1
- package/apps/web/dist/assets/{ChatView-BnnKdwk4.js → ChatView-CGsHD-N7.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-CeDWjq4z.js → EditorPage-BhfI0l0z.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-Du028FI3.js → FlowPreview-C7AlCnP2.js} +1 -1
- package/apps/web/dist/assets/{Harness-CEPy4MEp.js → Harness-BOXAOCTP.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-ms58DQJ9.js → Marketplace-COvClHLm.js} +2 -2
- package/apps/web/dist/assets/{NewWizardPage-CEQSNXeZ.js → NewWizardPage-PS_2wDRH.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-CXDpKoK2.js → ProjectPage-DHXoZbtr.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-DMmtmzBX.js → PublicRunner-GFi75MT5.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-BIojYB0g.js → RunDrawer-D-mr7W0a.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-D8OGEoMl.js → RunnerView-XKLQktRM.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-BlMZL4_d.js → SettingsPage-CNx6q9hk.js} +1 -1
- package/apps/web/dist/assets/{SetupPage-Doz9T3kv.js → SetupPage-H84QxAhW.js} +1 -1
- package/apps/web/dist/assets/{SharePage-DOJXdsyi.js → SharePage-GqXS15BS.js} +1 -1
- package/apps/web/dist/assets/changelog-Byp2KBUH.js +1 -0
- package/apps/web/dist/assets/{esm-D6fM9MdG.js → esm-BCeL0PFC.js} +1 -1
- package/apps/web/dist/assets/{index-nfRuCdVt.js → index-DZtkpyLG.js} +4 -4
- package/apps/web/dist/assets/{settings-menu-BGfn4LJE.js → settings-menu-MX7j6SCB.js} +1 -1
- package/apps/web/dist/index.html +2 -2
- package/package.json +1 -1
- package/apps/web/dist/assets/changelog-B1jhC7Fv.js +0 -1
|
@@ -119,6 +119,11 @@ export const run = sqliteTable("run", {
|
|
|
119
119
|
answer: text("answer", { mode: "json" }).$type(),
|
|
120
120
|
/** An autopilot drives this test run (an MCP client fills its pages): it asks nobody. */
|
|
121
121
|
unattended: integer("unattended", { mode: "boolean" }).notNull().default(false),
|
|
122
|
+
/**
|
|
123
|
+
* What the device the run is watched from offers as a model (the app's Apple Intelligence),
|
|
124
|
+
* with when it last said so; written by the web, read by the runner (engine/device.ts).
|
|
125
|
+
*/
|
|
126
|
+
deviceOffer: text("device_offer", { mode: "json" }).$type(),
|
|
122
127
|
costMicros: integer("cost_micros").notNull().default(0),
|
|
123
128
|
/** Set once the result is shared: `/s/<token>` shows it read-only. */
|
|
124
129
|
shareToken: text("share_token"),
|
|
@@ -148,6 +153,20 @@ export const runEvent = sqliteTable("run_event", {
|
|
|
148
153
|
assetId: text("asset_id"),
|
|
149
154
|
createdAt: createdAt(),
|
|
150
155
|
}, (t) => [index("run_event_run").on(t.runId, t.id)]);
|
|
156
|
+
/**
|
|
157
|
+
* A call the runner put to the run's device, open until the device answers or the runner stops
|
|
158
|
+
* waiting: the stream (any web process) carries it to the phone, and the answer comes back here.
|
|
159
|
+
*/
|
|
160
|
+
export const deviceCall = sqliteTable("device_call", {
|
|
161
|
+
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
162
|
+
runId: text("run_id")
|
|
163
|
+
.notNull()
|
|
164
|
+
.references(() => run.id, { onDelete: "cascade" }),
|
|
165
|
+
reqId: text("req_id").notNull(),
|
|
166
|
+
request: text("request", { mode: "json" }).$type().notNull(),
|
|
167
|
+
answer: text("answer", { mode: "json" }).$type(),
|
|
168
|
+
createdAt: createdAt(),
|
|
169
|
+
}, (t) => [uniqueIndex("device_call_req").on(t.reqId), index("device_call_run").on(t.runId)]);
|
|
151
170
|
/** What each step of a run cost, in credit micros: the measurements estimates are made from. */
|
|
152
171
|
export const runCost = sqliteTable("run_cost", {
|
|
153
172
|
runId: text("run_id")
|
|
@@ -1,71 +1,83 @@
|
|
|
1
|
+
import { and, asc, eq, isNull } from "drizzle-orm";
|
|
1
2
|
import { nanoid } from "nanoid";
|
|
3
|
+
import { db, schema } from "../db/client.js";
|
|
2
4
|
import { parseJsonAnswer, renderPrompt } from "../harness/prompt.js";
|
|
3
|
-
import { signalDevice } from "./events.js";
|
|
4
5
|
/** An offer not renewed for this long is forgotten: the person left the run. */
|
|
5
6
|
const OFFER_TTL_MS = 30 * 60_000;
|
|
6
7
|
/** How long the phone has to answer before the runtime thinks on its own. */
|
|
7
8
|
export const DEVICE_TIMEOUT_MS = 60_000;
|
|
8
|
-
|
|
9
|
-
const
|
|
9
|
+
/** How often a waiting call looks for the answer in the database. */
|
|
10
|
+
const ANSWER_POLL_MS = 250;
|
|
10
11
|
/** The runner says what the device around it can do; renewed on every (re)connect. */
|
|
11
|
-
export function offerDevice(runId, offer) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
offers.delete(runId);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export function forgetDevice(runId) {
|
|
20
|
-
offers.delete(runId);
|
|
12
|
+
export async function offerDevice(runId, offer) {
|
|
13
|
+
await db
|
|
14
|
+
.update(schema.run)
|
|
15
|
+
.set({ deviceOffer: offer.think?.classes.length ? { offer, at: Date.now() } : null })
|
|
16
|
+
.where(eq(schema.run.id, runId));
|
|
21
17
|
}
|
|
22
18
|
/** Whether the device of this run thinks the class, and how much it takes. */
|
|
23
|
-
export function deviceThinks(runId, cls) {
|
|
24
|
-
const
|
|
19
|
+
export async function deviceThinks(runId, cls) {
|
|
20
|
+
const row = await db.query.run.findFirst({
|
|
21
|
+
where: eq(schema.run.id, runId),
|
|
22
|
+
columns: { deviceOffer: true },
|
|
23
|
+
});
|
|
24
|
+
const hit = row?.deviceOffer;
|
|
25
25
|
if (!hit || Date.now() - hit.at > OFFER_TTL_MS) {
|
|
26
|
-
offers.delete(runId);
|
|
27
26
|
return null;
|
|
28
27
|
}
|
|
29
28
|
const think = hit.offer.think;
|
|
30
29
|
return think?.classes.includes(cls) ? { maxChars: think.maxChars } : null;
|
|
31
30
|
}
|
|
31
|
+
/** The calls of a run still waiting for the device, oldest first: what its stream carries. */
|
|
32
|
+
export async function openDeviceCalls(runId) {
|
|
33
|
+
const rows = await db
|
|
34
|
+
.select({ request: schema.deviceCall.request })
|
|
35
|
+
.from(schema.deviceCall)
|
|
36
|
+
.where(and(eq(schema.deviceCall.runId, runId), isNull(schema.deviceCall.answer)))
|
|
37
|
+
.orderBy(asc(schema.deviceCall.id));
|
|
38
|
+
return rows.map((r) => r.request);
|
|
39
|
+
}
|
|
32
40
|
/** Sends one call to the device and waits for its answer. */
|
|
33
|
-
export function askDevice(runId, request, timeoutMs = DEVICE_TIMEOUT_MS) {
|
|
41
|
+
export async function askDevice(runId, request, timeoutMs = DEVICE_TIMEOUT_MS) {
|
|
34
42
|
const id = nanoid(10);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/** The device's answer to one call; false when the call is unknown or not this run's. */
|
|
55
|
-
export function answerDevice(runId, reqId, answer) {
|
|
56
|
-
const hit = pending.get(reqId);
|
|
57
|
-
if (!hit || hit.runId !== runId) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
pending.delete(reqId);
|
|
61
|
-
if (typeof answer.text === "string") {
|
|
62
|
-
console.log(`[run ${runId}] the device answered a ${answer.text.length}-character call`);
|
|
63
|
-
hit.resolve(answer.text);
|
|
43
|
+
await db.insert(schema.deviceCall).values({ runId, reqId: id, request: { id, ...request } });
|
|
44
|
+
const until = Date.now() + timeoutMs;
|
|
45
|
+
try {
|
|
46
|
+
while (Date.now() < until) {
|
|
47
|
+
const row = await db.query.deviceCall.findFirst({
|
|
48
|
+
where: eq(schema.deviceCall.reqId, id),
|
|
49
|
+
columns: { answer: true },
|
|
50
|
+
});
|
|
51
|
+
const answer = row?.answer;
|
|
52
|
+
if (answer) {
|
|
53
|
+
if (typeof answer.text === "string") {
|
|
54
|
+
console.log(`[run ${runId}] the device answered a ${answer.text.length}-character call`);
|
|
55
|
+
return answer.text;
|
|
56
|
+
}
|
|
57
|
+
throw new Error(answer.error || "the device could not answer");
|
|
58
|
+
}
|
|
59
|
+
await new Promise((r) => setTimeout(r, Math.min(ANSWER_POLL_MS, until - Date.now())));
|
|
60
|
+
}
|
|
61
|
+
throw new Error("the device did not answer in time");
|
|
64
62
|
}
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
finally {
|
|
64
|
+
await db
|
|
65
|
+
.delete(schema.deviceCall)
|
|
66
|
+
.where(eq(schema.deviceCall.reqId, id))
|
|
67
|
+
.catch(() => undefined);
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
}
|
|
70
|
+
/** The device's answer to one call; false when the call is unknown, answered or not this run's. */
|
|
71
|
+
export async function answerDevice(runId, reqId, answer) {
|
|
72
|
+
const result = await db
|
|
73
|
+
.update(schema.deviceCall)
|
|
74
|
+
.set({ answer })
|
|
75
|
+
.where(and(eq(schema.deviceCall.reqId, reqId), eq(schema.deviceCall.runId, runId), isNull(schema.deviceCall.answer)));
|
|
76
|
+
return result.rowsAffected > 0;
|
|
77
|
+
}
|
|
78
|
+
/** A run a runner takes starts its step afresh: calls left in the database have no one waiting. */
|
|
79
|
+
export async function clearDeviceCalls(runId) {
|
|
80
|
+
await db.delete(schema.deviceCall).where(eq(schema.deviceCall.runId, runId));
|
|
69
81
|
}
|
|
70
82
|
/**
|
|
71
83
|
* The run's device first, the runtime's own model where the device cannot: a call with tools
|
|
@@ -5,9 +5,6 @@ import { and, desc, eq, gt, sql } from "drizzle-orm";
|
|
|
5
5
|
import { db, schema } from "../db/client.js";
|
|
6
6
|
const bus = new EventEmitter();
|
|
7
7
|
bus.setMaxListeners(0);
|
|
8
|
-
export function signalDevice(runId, request) {
|
|
9
|
-
bus.emit(runId, { runId, event: null, device: request });
|
|
10
|
-
}
|
|
11
8
|
export async function emitEvent(runId, stepId, type, said, asset) {
|
|
12
9
|
const note = typeof said === "string" ? null : said;
|
|
13
10
|
const message = note ? noteText(note, "de") : said;
|
|
@@ -46,10 +43,22 @@ export function subscribe(runId, listener) {
|
|
|
46
43
|
const WATCH_POLL_MS = 1000;
|
|
47
44
|
/**
|
|
48
45
|
* Tells of every change on a run: at once when this process made it, within a second when the
|
|
49
|
-
* runner (another process) wrote to the row
|
|
46
|
+
* runner (another process) wrote to the row, added an event or put a call to the run's device.
|
|
47
|
+
* Each event row reaches the listener once, whichever process wrote it. Call it in the run's
|
|
48
|
+
* tenant.
|
|
50
49
|
*/
|
|
51
50
|
export function watchRun(runId, listener) {
|
|
52
|
-
|
|
51
|
+
/** The newest event the listener has had; null until the first look. */
|
|
52
|
+
let told = null;
|
|
53
|
+
const unsubscribe = subscribe(runId, (signal) => {
|
|
54
|
+
if (signal.event) {
|
|
55
|
+
if (told !== null && signal.event.id <= told) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
told = Math.max(told ?? 0, signal.event.id);
|
|
59
|
+
}
|
|
60
|
+
listener(signal);
|
|
61
|
+
});
|
|
53
62
|
let last = null;
|
|
54
63
|
let busy = false;
|
|
55
64
|
const look = async () => {
|
|
@@ -62,12 +71,26 @@ export function watchRun(runId, listener) {
|
|
|
62
71
|
.select({
|
|
63
72
|
updatedAt: schema.run.updatedAt,
|
|
64
73
|
event: sql `(select max(${schema.runEvent.id}) from ${schema.runEvent} where ${schema.runEvent.runId} = ${runId})`,
|
|
74
|
+
call: sql `(select max(${schema.deviceCall.id}) from ${schema.deviceCall} where ${schema.deviceCall.runId} = ${runId})`,
|
|
65
75
|
})
|
|
66
76
|
.from(schema.run)
|
|
67
77
|
.where(eq(schema.run.id, runId));
|
|
68
|
-
const
|
|
78
|
+
const newest = row?.event ?? 0;
|
|
79
|
+
if (told === null) {
|
|
80
|
+
told = newest;
|
|
81
|
+
}
|
|
82
|
+
else if (newest > told) {
|
|
83
|
+
// Events another process wrote, in order; at most a page per look.
|
|
84
|
+
for (const event of await recentEvents(runId, told, 100)) {
|
|
85
|
+
if (event.id > (told ?? 0)) {
|
|
86
|
+
told = event.id;
|
|
87
|
+
listener({ runId, event });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const mark = row ? `${row.updatedAt.getTime()}:${row.call ?? 0}` : null;
|
|
69
92
|
if (last !== null && mark !== last) {
|
|
70
|
-
listener();
|
|
93
|
+
listener({ runId, event: null });
|
|
71
94
|
}
|
|
72
95
|
last = mark;
|
|
73
96
|
}
|
|
@@ -22,6 +22,7 @@ import { claimRun, disownRuns, heartbeatRuns, indexRun, restRun, waitingRuns, wa
|
|
|
22
22
|
import { currentTenant } from "../tenants/tenant.js";
|
|
23
23
|
import { askPerson, clearStaleAsk } from "./asks.js";
|
|
24
24
|
import { decide } from "./decide.js";
|
|
25
|
+
import { clearDeviceCalls } from "./device.js";
|
|
25
26
|
import { emitEvent, recentEvents, signalChanged } from "./events.js";
|
|
26
27
|
import { readPageInput } from "./input.js";
|
|
27
28
|
import { pushRun } from "./push.js";
|
|
@@ -501,8 +502,10 @@ async function decidePageFields(run, page, state, signal) {
|
|
|
501
502
|
.map((f) => f.id);
|
|
502
503
|
}
|
|
503
504
|
async function drive(runId, signal) {
|
|
504
|
-
// The step starts afresh here: a question another process left
|
|
505
|
+
// The step starts afresh here: a question or a device call another process left has no one
|
|
506
|
+
// waiting.
|
|
505
507
|
await clearStaleAsk(runId);
|
|
508
|
+
await clearDeviceCalls(runId);
|
|
506
509
|
while (!signal.aborted) {
|
|
507
510
|
const run = await loadRun(runId);
|
|
508
511
|
if (run?.status !== "running") {
|
|
@@ -417,7 +417,7 @@ async function ownLanguageModel(cfg, ref, meta) {
|
|
|
417
417
|
*/
|
|
418
418
|
export async function textModel(cls, meta = {}) {
|
|
419
419
|
const resolved = await ownTextModel(cls, meta);
|
|
420
|
-
const device = meta.runId && isText(cls) ? deviceThinks(meta.runId, cls) : null;
|
|
420
|
+
const device = meta.runId && isText(cls) ? await deviceThinks(meta.runId, cls) : null;
|
|
421
421
|
return device
|
|
422
422
|
? { ...resolved, model: new DeviceModel(meta.runId, resolved.model, device.maxChars) }
|
|
423
423
|
: resolved;
|
|
@@ -138,13 +138,9 @@ export function runsApiFor(pluginId) {
|
|
|
138
138
|
subscribe(runId, listener) {
|
|
139
139
|
// The listener runs inside the tenant the subscription was made in, as the events do.
|
|
140
140
|
const tenantId = currentTenant();
|
|
141
|
+
// Changes the runner makes in another process reach the plugin too, each event once.
|
|
141
142
|
return watchRun(runId, (signal) => {
|
|
142
|
-
|
|
143
|
-
if (signal?.device) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
// No signal: the run changed in another process (the runner), which tells no event.
|
|
147
|
-
const event = signal?.event;
|
|
143
|
+
const event = signal.event;
|
|
148
144
|
const shaped = {
|
|
149
145
|
runId,
|
|
150
146
|
event: event
|
|
@@ -14,7 +14,7 @@ import { ConnectError, connectionViews, connectWithCredentials, disconnect, fini
|
|
|
14
14
|
import { finishPluginOAuth, pluginStateTenant } from "../connectors/plugin-connections.js";
|
|
15
15
|
import { db, schema, withTenant } from "../db/client.js";
|
|
16
16
|
import { answerAsk, pendingAsk } from "../engine/asks.js";
|
|
17
|
-
import { answerDevice, offerDevice } from "../engine/device.js";
|
|
17
|
+
import { answerDevice, offerDevice, openDeviceCalls } from "../engine/device.js";
|
|
18
18
|
import { emitEvent, signalChanged, watchRun } from "../engine/events.js";
|
|
19
19
|
import { fromOwner } from "../engine/owner.js";
|
|
20
20
|
import { pushAvailable, setPushDevice } from "../engine/push.js";
|
|
@@ -404,13 +404,19 @@ export const runRoutes = new Hono()
|
|
|
404
404
|
await stream.writeSSE({ event: "view", data: JSON.stringify(await viewOf(run)) });
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
407
|
+
// Calls the runner put to the device the run is watched from, each sent once per stream.
|
|
408
|
+
const sent = new Set();
|
|
409
|
+
const sendDeviceCalls = async () => {
|
|
410
|
+
for (const call of await openDeviceCalls(id)) {
|
|
411
|
+
if (!(closed || sent.has(call.id))) {
|
|
412
|
+
sent.add(call.id);
|
|
413
|
+
await stream.writeSSE({ event: "device", data: JSON.stringify(call) });
|
|
412
414
|
}
|
|
413
|
-
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
const unsubscribe = watchRun(id, (signal) => {
|
|
418
|
+
if (!signal.event) {
|
|
419
|
+
void sendDeviceCalls().catch(() => undefined);
|
|
414
420
|
}
|
|
415
421
|
void push();
|
|
416
422
|
});
|
|
@@ -419,6 +425,7 @@ export const runRoutes = new Hono()
|
|
|
419
425
|
unsubscribe();
|
|
420
426
|
});
|
|
421
427
|
await stream.writeSSE({ event: "view", data: JSON.stringify(await viewOf(first)) });
|
|
428
|
+
await sendDeviceCalls();
|
|
422
429
|
while (!closed) {
|
|
423
430
|
await stream.sleep(20_000);
|
|
424
431
|
if (!closed) {
|
|
@@ -444,7 +451,7 @@ export const runRoutes = new Hono()
|
|
|
444
451
|
.optional(),
|
|
445
452
|
})
|
|
446
453
|
.parse(await c.req.json().catch(() => ({})));
|
|
447
|
-
offerDevice(run.id, offer);
|
|
454
|
+
await offerDevice(run.id, offer);
|
|
448
455
|
return c.json({ ok: true });
|
|
449
456
|
})
|
|
450
457
|
// The device's answer to one call the stream carried as a `device` event.
|
|
@@ -456,7 +463,7 @@ export const runRoutes = new Hono()
|
|
|
456
463
|
const answer = z
|
|
457
464
|
.object({ text: z.string().max(200_000).optional(), error: z.string().max(500).optional() })
|
|
458
465
|
.parse(await c.req.json().catch(() => ({})));
|
|
459
|
-
return c.json({ ok: answerDevice(run.id, c.req.param("reqId"), answer) });
|
|
466
|
+
return c.json({ ok: await answerDevice(run.id, c.req.param("reqId"), answer) });
|
|
460
467
|
})
|
|
461
468
|
.post("/:id/pages/:stepId", async (c) => {
|
|
462
469
|
const run = await accessibleRun(c, c.req.param("id"));
|
|
@@ -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-FW7ypPI6.js";import{$ as b,v as x}from"./index-nfRuCdVt.js";import{c as S,f as C}from"./settings-menu-BGfn4LJE.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-CgnnJj4G.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/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.57`?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-FW7ypPI6.js";import{$ as b,v as x}from"./index-DZtkpyLG.js";import{c as S,f as C}from"./settings-menu-MX7j6SCB.js";import{ReleaseNotes as w,loadReleases as T,releaseDate as E,releaseLabel as D}from"./ChangelogDialog-BmFgf8E1.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/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.59`?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 +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"./preload-helper-CNEI7N0N.js";import{Ct as i,lt as a,mt as o,ot as s,st as c,yt as l}from"./ui-FW7ypPI6.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{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"./preload-helper-CNEI7N0N.js";import{Ct as i,lt as a,mt as o,ot as s,st as c,yt as l}from"./ui-FW7ypPI6.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-Byp2KBUH.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:l(`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,l]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||r)return;let t=!1;return _(n).then(e=>{t||l(e)}),()=>{t=!0}},[e,r,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=r?g(r,f):[];return(0,d.jsxs)(s,{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)(o,{})}):r.length===0?(0,d.jsx)(c,{children:i(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a,{type:`search`,value:f,placeholder:i(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(c,{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{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,At as i,C as a,Ct as o,D as s,E as c,Et as l,H as u,J as d,Lt as f,N as p,Ot as m,Pt as h,Q as g,Qt as _,S as v,T as y,X as b,Z as x,a as S,b as C,bt as w,ct as T,dt as E,en as D,f as O,g as k,h as A,i as j,in as M,jt as N,kt as P,m as F,mt as I,vt as L,w as ee,xt as R,yt as z,zt as B}from"./ui-FW7ypPI6.js";import{r as te}from"./brand-DIKyySmf.js";import{n as ne,r as re}from"./RunnerView-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,At as i,C as a,Ct as o,D as s,E as c,Et as l,H as u,J as d,Lt as f,N as p,Ot as m,Pt as h,Q as g,Qt as _,S as v,T as y,X as b,Z as x,a as S,b as C,bt as w,ct as T,dt as E,en as D,f as O,g as k,h as A,i as j,in as M,jt as N,kt as P,m as F,mt as I,vt as L,w as ee,xt as R,yt as z,zt as B}from"./ui-FW7ypPI6.js";import{r as te}from"./brand-DIKyySmf.js";import{n as ne,r as re}from"./RunnerView-XKLQktRM.js";import{t as ie}from"./volume-2-B1mj20eS.js";import{J as ae,X as oe,Y as se,at as ce,ft as le,nt as ue,t as de}from"./index-DZtkpyLG.js";var fe={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`}]]};fe.node;var pe=M(fe),me={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`}]]};me.node;var he=M(me),ge={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`}]]};ge.node;var V=M(ge),_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=M(_e),ye=le(),H=e(t(),1),U=e(n(),1),be=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function xe({since:e}){let[t,n]=(0,H.useState)(Date.now());if((0,H.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:z(`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)(I,{className:`size-5`}):a})}function Se({voice:e}){let t=(0,H.useRef)(null),{captions:n}=e;return(0,H.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:z(`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 Ce({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,a=e.state===`connecting`,[s,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1);(0,H.useEffect)(()=>{c(i?Date.now():null)},[i]);let f=async()=>{d(!1),await e.start(),n&&await e.startCamera()},p=()=>{e.stop(),d(!0)},h=n||e.camera,g=[...e.captions].reverse().find(e=>e.who===`bot`),_=[...e.captions].reverse().find(e=>e.who===`me`),v=e.speaking?o(`talk.speaking`):e.listening?o(`talk.listening`):i?o(`talk.live`):a?o(`talk.connecting`):u?o(`video.ended`):``;return(0,U.jsxs)(`section`,{className:z(`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??``}),v?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,U.jsx)(`span`,{className:z(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,v]}):null,(0,U.jsx)(xe,{since:s})]}),(0,U.jsxs)(`div`,{className:z(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,h?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!h&&i&&e.captions.length?`h-[38%]`:h?``:`flex-1`),children:[(0,U.jsxs)(`div`,{className:z(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!h&&`hidden`),children:[(0,U.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:z(`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)(V,{className:`size-8`}),(0,U.jsx)(`span`,{className:`text-[0.8125rem]`,children:o(`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:[o(`video.you`),e.muted?(0,U.jsx)(ce,{className:`ml-1.5 inline size-3`}):null]})]}),(0,U.jsxs)(`div`,{className:z(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,h?`bg-neutral-900`:`bg-transparent`,h&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,U.jsx)(`div`,{className:z(`rounded-full transition-shadow duration-500`,!h&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!h&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,U.jsx)(te,{kind:t?.wizard.avatar??`round`,size:h?140:200,fluffy:!0,interactive:!1})}),h?(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&&!h?(0,U.jsx)(Se,{voice:e}):i&&(g||_)?(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:[_?(0,U.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:_.text}):null,g?(0,U.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:g.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:o(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,U.jsx)(ce,{className:`size-5`}):(0,U.jsx)(B,{className:`size-5`})}),(0,U.jsx)(W,{label:o(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,U.jsx)(l,{className:`size-5`}):(0,U.jsx)(V,{className:`size-5`})}),e.camera&&be?(0,U.jsx)(W,{label:o(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,U.jsx)(m,{className:`size-5`})}):null,(0,U.jsx)(W,{label:o(`video.leave`),danger:!0,onClick:p,children:(0,U.jsx)(ue,{className:`size-5`})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:a||!t?.talk,onClick:()=>void f(),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:[a?(0,U.jsx)(I,{className:`size-4`}):n?(0,U.jsx)(l,{className:`size-5`}):(0,U.jsx)(B,{className:`size-5`}),o(u?`video.rejoin`:n?`video.join`:`talk.start`)]}),!u&&!e.error?(0,U.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:o(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var we=e=>p[e.kind]!==`device`,Te=1024,Ee=4e3;function De(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Oe(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: ${w(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}: ${De(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(`
|