@engenty/wizards-runtime 0.16.0 → 0.16.2
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/assistant/knows.js +3 -1
- package/apps/runtime/dist/cli/move-files.js +27 -11
- package/apps/runtime/dist/db/control-schema.js +7 -0
- package/apps/runtime/dist/db/migrations/control/0014_run_index_generation.sql +1 -0
- package/apps/runtime/dist/db/migrations/control/0015_run_index_wake.sql +3 -0
- package/apps/runtime/dist/db/migrations/control/meta/0014_snapshot.json +629 -0
- package/apps/runtime/dist/db/migrations/control/meta/0015_snapshot.json +650 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +14 -0
- package/apps/runtime/dist/db/migrations/tenant/0056_run_claim_rev.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0057_run_wake_at.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0056_snapshot.json +6520 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0057_snapshot.json +6527 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +14 -0
- package/apps/runtime/dist/db/schema.js +17 -3
- package/apps/runtime/dist/documents/parse.js +9 -0
- package/apps/runtime/dist/elements/knowledge.js +1 -0
- package/apps/runtime/dist/engine/runner.js +344 -52
- package/apps/runtime/dist/env.js +18 -0
- package/apps/runtime/dist/mounts/mounts.js +3 -0
- package/apps/runtime/dist/plugins/runs.js +3 -0
- package/apps/runtime/dist/prompts/mcp.md +3 -0
- package/apps/runtime/dist/routes/runs.js +17 -14
- package/apps/runtime/dist/services/api.js +1 -1
- package/apps/runtime/dist/services/knowledge.js +2 -1
- package/apps/runtime/dist/services/manage-reports.js +2 -0
- package/apps/runtime/dist/services/query-vectors.js +60 -0
- package/apps/runtime/dist/services/relevance.js +12 -0
- package/apps/runtime/dist/services/runs.js +16 -2
- package/apps/runtime/dist/services/space-index.js +22 -6
- package/apps/runtime/dist/services/work-files.js +25 -1
- package/apps/runtime/dist/sharing/index.js +3 -0
- package/apps/runtime/dist/tenants/control.js +46 -14
- package/apps/web/dist/assets/{AboutDialog-0q4P80yv.js → AboutDialog-BCcD8hKm.js} +1 -1
- package/apps/web/dist/assets/{BlockEditor-CUYFH_CU.js → BlockEditor-DgaUm2pR.js} +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-DuJJV1ll.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-CDN7kMs1.js → ChangelogDialog-B08elwyr.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-D-Y16fdk.js → CodeEditor-BiyOk_SC.js} +1 -1
- package/apps/web/dist/assets/EditorPage-EMFTHEYD.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-DXnk7m9P.js → FlowPreview-DF_6TvZ0.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-Dkd0FBIH.js → LangSwitch-Ba4OWLzJ.js} +1 -1
- package/apps/web/dist/assets/Marketplace-DqziLf66.js +2 -0
- package/apps/web/dist/assets/{NewWizardChannels-Czool7s1.js → NewWizardChannels-CsIGp0nZ.js} +1 -1
- package/apps/web/dist/assets/NewWizardPage-CzQAkKMy.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-B9gr2OX5.js +1 -0
- package/apps/web/dist/assets/PreviewPane-DSOV3o-1.js +7 -0
- package/apps/web/dist/assets/PublicRunner-BVs8-Vu3.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-B7MUySpC.js → ReadOnly--4CIJCDD.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-z2u8lSe2.js +2 -0
- package/apps/web/dist/assets/SetupPage-9Zk-KUGA.js +1 -0
- package/apps/web/dist/assets/{SharePage-UwEJBIzq.js → SharePage-D_Ab0gjr.js} +1 -1
- package/apps/web/dist/assets/SkillEditor-DvtameHg.js +1 -0
- package/apps/web/dist/assets/{Skills-Bv6XbKxc.js → Skills-Cf1Kl4Fy.js} +6 -6
- package/apps/web/dist/assets/SpacePage-CyqVzX9b.js +2 -0
- package/apps/web/dist/assets/{UpdateCheck-C7I43zFZ.js → UpdateCheck-DweZBVP6.js} +2 -2
- package/apps/web/dist/assets/changelog-C85v9OWg.js +1 -0
- package/apps/web/dist/assets/{code-editor-Ca5EAxmd.js → code-editor-B1RbFTAZ.js} +2 -2
- package/apps/web/dist/assets/connection-sign-in-CaVvh5GQ.js +1 -0
- package/apps/web/dist/assets/{host-D5hNHbhF.js → host-CKS5U5Vg.js} +18 -18
- package/apps/web/dist/assets/i18n-Bymk5Ev-.js +55 -0
- package/apps/web/dist/assets/{index-CyBrvupM.js → index-Ckcn5vy7.js} +4 -4
- package/apps/web/dist/assets/{read-aloud-Bfp9_bUY.js → read-aloud-Bq88XUHC.js} +1 -1
- package/apps/web/dist/assets/{runners-CUpBpSji.js → runners-DvYVe9Dt.js} +1 -1
- package/apps/web/dist/assets/session-D2bjiA3P.js +2 -0
- package/apps/web/dist/assets/theme-CNJIC2be.js +12 -0
- package/apps/web/dist/assets/ui-Mplfhz_Z.js +16 -0
- package/apps/web/dist/assets/{useMutation-1fV4Nnxq.js → useMutation-8QRM-z4M.js} +1 -1
- package/apps/web/dist/assets/{viewers-ChriFcRy.js → viewers-CEocUV_2.js} +2 -2
- package/apps/web/dist/index.html +11 -11
- package/apps/web/dist/mcp/flow.html +65 -65
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +8 -2
- package/node_modules/@engenty/wizards/dist/plugin/thread.js +30 -0
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +168 -0
- package/node_modules/@engenty/wizards-shared/dist/definition.js +52 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/fit.d.ts +2 -0
- package/node_modules/@engenty/wizards-shared/dist/fit.js +4 -0
- package/node_modules/@engenty/wizards-shared/dist/knowledge.d.ts +5 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +8 -1
- package/node_modules/@engenty/wizards-shared/dist/run.js +8 -0
- package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +7 -1
- package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +6 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-BlZP8DYb.js +0 -2
- package/apps/web/dist/assets/EditorPage-CrMVsgUt.js +0 -3
- package/apps/web/dist/assets/Marketplace-Cty40VwG.js +0 -2
- package/apps/web/dist/assets/NewWizardPage-CfVe_4a2.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-D3SEpTmt.js +0 -1
- package/apps/web/dist/assets/PreviewPane-CQDKQO6z.js +0 -7
- package/apps/web/dist/assets/PublicRunner-BDZNnlQw.js +0 -1
- package/apps/web/dist/assets/SettingsPage-Bgurv3l2.js +0 -2
- package/apps/web/dist/assets/SetupPage-C3km8vqv.js +0 -1
- package/apps/web/dist/assets/SkillEditor-BaEiqqXl.js +0 -1
- package/apps/web/dist/assets/SpacePage-D9PXLSU_.js +0 -2
- package/apps/web/dist/assets/changelog-DwgWiSZb.js +0 -1
- package/apps/web/dist/assets/connection-sign-in-hI3HXhq4.js +0 -1
- package/apps/web/dist/assets/i18n-BBzMbGoo.js +0 -55
- package/apps/web/dist/assets/session-CMQo8P-G.js +0 -2
- package/apps/web/dist/assets/theme-CdX0marK.js +0 -11
- package/apps/web/dist/assets/ui-BCfu5sia.js +0 -16
|
@@ -261,7 +261,9 @@ export function knowsTools(ctx) {
|
|
|
261
261
|
id: "runs",
|
|
262
262
|
description: prompt("goose", "tool.runs"),
|
|
263
263
|
inputSchema: z.object({
|
|
264
|
-
status: z
|
|
264
|
+
status: z
|
|
265
|
+
.enum(["failed", "done", "running", "waiting_input", "sleeping", "cancelled"])
|
|
266
|
+
.optional(),
|
|
265
267
|
limit: z.number().int().min(1).max(40).optional(),
|
|
266
268
|
}),
|
|
267
269
|
execute: ({ status, limit }) => attempt(async () => {
|
|
@@ -17,14 +17,16 @@ export async function moveFiles() {
|
|
|
17
17
|
for (const tenant of await knownTenants()) {
|
|
18
18
|
const { moved, missing } = await withTenant(tenant, moveTenantFiles);
|
|
19
19
|
if (moved || missing.length) {
|
|
20
|
-
console.log(`${tenant}: ${moved} moved${missing.length ? `, ${missing.length}
|
|
20
|
+
console.log(`${tenant}: ${moved} moved${missing.length ? `, ${missing.length} not` : ""}`);
|
|
21
21
|
}
|
|
22
22
|
for (const file of missing) {
|
|
23
23
|
console.log(` ${file}`);
|
|
24
24
|
}
|
|
25
25
|
failed += missing.length;
|
|
26
26
|
}
|
|
27
|
-
console.log(failed
|
|
27
|
+
console.log(failed
|
|
28
|
+
? "Done; the files listed did not move: without their bytes, or with the reason given."
|
|
29
|
+
: "Done.");
|
|
28
30
|
return failed ? 1 : 0;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
@@ -37,11 +39,11 @@ export async function moveFilesAtStart() {
|
|
|
37
39
|
try {
|
|
38
40
|
const { moved, missing } = await withTenant(tenant, moveTenantFiles);
|
|
39
41
|
if (moved || missing.length) {
|
|
40
|
-
console.log(`[move-files] ${tenant}: ${moved} moved${missing.length ? `, ${missing.length}
|
|
42
|
+
console.log(`[move-files] ${tenant}: ${moved} moved${missing.length ? `, ${missing.length} not: ${missing.join("; ")}` : ""}`);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
catch (err) {
|
|
44
|
-
console.error(`[move-files] ${tenant}:`, err
|
|
46
|
+
console.error(`[move-files] ${tenant}:`, causeOf(err));
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -56,13 +58,27 @@ async function moveTenantFiles() {
|
|
|
56
58
|
missing.push(`${row.name} (${row.id}, space ${row.spaceId})`);
|
|
57
59
|
continue;
|
|
58
60
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
// One file that fails doesn't keep the others where they are; it is tried again next time.
|
|
62
|
+
try {
|
|
63
|
+
const hash = await putBlob(bytes);
|
|
64
|
+
await db.update(schema.spaceFile).set({ hash }).where(eq(schema.spaceFile.id, row.id));
|
|
65
|
+
// The file reads from the blob now; its asset goes.
|
|
66
|
+
await db.delete(schema.asset).where(eq(schema.asset.id, asset.id));
|
|
67
|
+
await objects.remove(`assets/${asset.path}`);
|
|
68
|
+
await blobThumb(hash, row.mime);
|
|
69
|
+
moved++;
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
missing.push(`${row.name} (${row.id}, space ${row.spaceId}): ${causeOf(err)}`);
|
|
73
|
+
}
|
|
66
74
|
}
|
|
67
75
|
return { moved, missing };
|
|
68
76
|
}
|
|
77
|
+
/** What went wrong, down to the database's own words: a failed query wraps them as its cause. */
|
|
78
|
+
function causeOf(err) {
|
|
79
|
+
let e = err;
|
|
80
|
+
while (e?.cause) {
|
|
81
|
+
e = e.cause;
|
|
82
|
+
}
|
|
83
|
+
return String(e?.message ?? err).slice(0, 300);
|
|
84
|
+
}
|
|
@@ -40,6 +40,12 @@ export const runIndex = sqliteTable("run_index", {
|
|
|
40
40
|
owner: text("owner"),
|
|
41
41
|
/** The owner's last heartbeat; one silent for RUNNER_STALE_MS has lost the run. */
|
|
42
42
|
seen: integer("seen", { mode: "timestamp_ms" }),
|
|
43
|
+
/** Counts the claims on this run: a newer claim has a higher number. */
|
|
44
|
+
generation: integer("generation").notNull().default(0),
|
|
45
|
+
/** A copy of the run's `wake_at`, so one statement finds what is due in every tenant. */
|
|
46
|
+
wakeAt: integer("wake_at", { mode: "timestamp_ms" }),
|
|
47
|
+
/** When it last went in line; null: when it was made. The line's order and age go by it. */
|
|
48
|
+
wokenAt: integer("woken_at", { mode: "timestamp_ms" }),
|
|
43
49
|
/**
|
|
44
50
|
* The mobile app's device for push, set by the app for this run (`POST /api/runs/:id/notify`):
|
|
45
51
|
* `{ token, platform: "ios" | "android", lang }`. Told through the Manage-App when the run is
|
|
@@ -51,6 +57,7 @@ export const runIndex = sqliteTable("run_index", {
|
|
|
51
57
|
index("run_index_visitor").on(t.visitorId, t.createdAt),
|
|
52
58
|
index("run_index_ip").on(t.ipHash, t.createdAt),
|
|
53
59
|
index("run_index_active").on(t.active, t.tenantId),
|
|
60
|
+
index("run_index_wake").on(t.wakeAt),
|
|
54
61
|
]);
|
|
55
62
|
/**
|
|
56
63
|
* The runners that execute runs (RUNTIME_ROLE=runner or all): where the web reaches one for what
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `run_index` ADD `generation` integer DEFAULT 0 NOT NULL;
|