@engenty/wizards-runtime 0.7.7 → 0.7.9
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/authoring/guide.js +8 -3
- package/apps/runtime/dist/browser/fast/classifier.js +9 -4
- package/apps/runtime/dist/cli/main.js +1 -1
- package/apps/runtime/dist/cli/menu.js +5 -1
- package/apps/runtime/dist/cli/ollama.js +302 -0
- package/apps/runtime/dist/cli/setup.js +102 -2
- package/apps/runtime/dist/clients.js +118 -0
- package/apps/runtime/dist/db/client.js +37 -3
- package/apps/runtime/dist/db/migrations/tenant/0017_run_client.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0017_snapshot.json +3333 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +2 -0
- package/apps/runtime/dist/decision-model.js +33 -0
- package/apps/runtime/dist/docs/dev/api.md +39 -0
- package/apps/runtime/dist/docs/dev/index.md +1 -0
- package/apps/runtime/dist/docs/dev/integration/openui.md +5 -3
- package/apps/runtime/dist/docs/dev/meta.json +1 -1
- package/apps/runtime/dist/docs/user/ai-apps.md +14 -3
- package/apps/runtime/dist/docs/user/command-line.md +1 -1
- package/apps/runtime/dist/docs/user/install.md +1 -0
- package/apps/runtime/dist/engine/decide.js +3 -1
- package/apps/runtime/dist/engine/runner.js +1 -0
- package/apps/runtime/dist/film/project.js +221 -65
- package/apps/runtime/dist/film/step.js +16 -5
- package/apps/runtime/dist/index.js +13 -4
- package/apps/runtime/dist/models.js +43 -3
- package/apps/runtime/dist/plugin.js +24 -8
- package/apps/runtime/dist/routes/runs.js +9 -0
- package/apps/runtime/dist/tools/code.js +53 -13
- package/apps/web/dist/assets/AboutDialog-CShc0mRo.js +1 -0
- package/apps/web/dist/assets/ChangelogDialog-C4dVSwtN.js +1 -0
- package/apps/web/dist/assets/ChatView-KkOboyOo.js +10 -0
- package/apps/web/dist/assets/EditorPage-lQ3YgsFT.js +4 -0
- package/apps/web/dist/assets/{FlowPreview-Dj2gAfuf.js → FlowPreview-oX_Emm7u.js} +1 -1
- package/apps/web/dist/assets/{Harness-SLbsntQF.js → Harness-D6mgLWTb.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-CsDMlji7.js → NewWizardChannels-CPlh_37J.js} +1 -1
- package/apps/web/dist/assets/NewWizardPage-D0FVJtXK.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-BXPOMrQR.js +1 -0
- package/apps/web/dist/assets/ProjectPage-DroTprqs.js +1 -0
- package/apps/web/dist/assets/PublicRunner-j3qoKjQQ.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-CK0piLUV.js → ReadOnly-CKgSQ2z1.js} +1 -1
- package/apps/web/dist/assets/RunDrawer-CJZ_ISAd.js +4 -0
- package/apps/web/dist/assets/RunnerView-BW1h4x63.js +1 -0
- package/apps/web/dist/assets/SettingsPage-BHZ0Z-og.js +1 -0
- package/apps/web/dist/assets/SetupPage-CDkYkjJX.js +1 -0
- package/apps/web/dist/assets/{SharePage-Cc3Opj2F.js → SharePage-BlVjVjHG.js} +1 -1
- package/apps/web/dist/assets/changelog-Be0i5Jjw.js +1 -0
- package/apps/web/dist/assets/engenty-WpMi3xwq.js +1 -0
- package/apps/web/dist/assets/{esm-CfnFE_jE.js → esm-C-ZWeuhU.js} +1 -1
- package/apps/web/dist/assets/{fluffy-engenty-ClRou7yu.js → fluffy-engenty-DPNHytrz.js} +135 -16
- package/apps/web/dist/assets/goose-helmet-Cvc7KjUg.bin +0 -0
- package/apps/web/dist/assets/goose-helmet-livery-CZD9u0XS.webp +0 -0
- package/apps/web/dist/assets/index-C4aHMcg9.css +1 -0
- package/apps/web/dist/assets/index-C61HAltK.js +14 -0
- package/apps/web/dist/assets/oss-credits-qGhcbqiM.js +1 -0
- package/apps/web/dist/assets/{phone-BWOB67tX.js → phone-BjmhIKuT.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-CEQlVs1O.js → settings-menu-Dpkp3f56.js} +1 -1
- package/apps/web/dist/assets/ui-DMmT-cSO.js +137 -0
- package/apps/web/dist/assets/{upload-pBKn2EFp.js → upload-JX9BcMTq.js} +1 -1
- package/apps/web/dist/assets/{lock-DAvRJY4B.js → wrench-BSxnPs2_.js} +1 -1
- package/apps/web/dist/index.html +4 -4
- package/apps/web/dist/install.sh +2 -2
- package/apps/web/dist/mcp/flow.html +142 -23
- package/node_modules/@engenty/wizards/package.json +1 -4
- package/node_modules/@engenty-wizards/shared/dist/claude-plugin.d.ts +7 -0
- package/node_modules/@engenty-wizards/shared/dist/claude-plugin.js +10 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +3 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +15 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +2 -0
- package/node_modules/@engenty-wizards/shared/dist/run.js +4 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +28 -6
- package/plugin/README.md +58 -0
- package/plugin/hooks/engenty.ts +140 -0
- package/plugin/hooks/hooks.json +1 -0
- package/plugin/hooks/pane.test.tsx +177 -0
- package/plugin/hooks/register.tsx +396 -0
- package/plugin/types/index.d.ts +44 -0
- package/apps/web/dist/assets/AboutDialog-BP8-Ugxf.js +0 -1
- package/apps/web/dist/assets/ChangelogDialog-CD6CQNW9.js +0 -1
- package/apps/web/dist/assets/ChatView-4T0QarEr.js +0 -10
- package/apps/web/dist/assets/EditorPage-CWdV7Xdn.js +0 -3
- package/apps/web/dist/assets/NewWizardPage-_bFYjlgh.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-DObQeCDg.js +0 -1
- package/apps/web/dist/assets/ProjectPage-DX-oNLWy.js +0 -1
- package/apps/web/dist/assets/PublicRunner-Bn9rVNEb.js +0 -1
- package/apps/web/dist/assets/RunDrawer-CVMTLse_.js +0 -4
- package/apps/web/dist/assets/RunnerView-Cjhuu9ua.js +0 -1
- package/apps/web/dist/assets/SettingsPage-DTzuiSAj.js +0 -1
- package/apps/web/dist/assets/SetupPage-D9jlhgiP.js +0 -1
- package/apps/web/dist/assets/changelog-CJNkd1_L.js +0 -1
- package/apps/web/dist/assets/engenty-eXZ-EAwd.js +0 -1
- package/apps/web/dist/assets/index-AfUa8xKD.css +0 -1
- package/apps/web/dist/assets/index-B5F1_qA_.js +0 -14
- package/apps/web/dist/assets/oss-credits-X2JPiMOR.js +0 -1
- package/apps/web/dist/assets/ui-BmR_4eL2.js +0 -137
- package/node_modules/@engenty/wizards/dist/openui/Wizard.d.ts +0 -20
- package/node_modules/@engenty/wizards/dist/openui/Wizard.js +0 -62
- package/node_modules/@engenty/wizards/dist/openui/index.d.ts +0 -9
- package/node_modules/@engenty/wizards/dist/openui/index.js +0 -9
- package/node_modules/@engenty/wizards/dist/openui/message.d.ts +0 -11
- package/node_modules/@engenty/wizards/dist/openui/message.js +0 -69
- package/node_modules/@engenty/wizards/dist/openui/run.d.ts +0 -8
- package/node_modules/@engenty/wizards/dist/openui/run.js +0 -137
- package/node_modules/@engenty/wizards/dist/openui/server.d.ts +0 -37
- package/node_modules/@engenty/wizards/dist/openui/server.js +0 -77
- package/plugin/.mcp.json +0 -8
|
@@ -21,8 +21,10 @@ function open(url, authToken) {
|
|
|
21
21
|
}
|
|
22
22
|
async function prepare(client, url) {
|
|
23
23
|
if (url.startsWith("file:")) {
|
|
24
|
-
|
|
24
|
+
// The wait first: studio, doors and runner share the files, and switching to WAL waits
|
|
25
|
+
// too while another process recovers the log after a restart.
|
|
25
26
|
await client.execute("PRAGMA busy_timeout = 5000");
|
|
27
|
+
await client.execute("PRAGMA journal_mode = WAL");
|
|
26
28
|
}
|
|
27
29
|
await client.execute("PRAGMA foreign_keys = ON");
|
|
28
30
|
}
|
|
@@ -52,6 +54,28 @@ function tenantUrl(id, dbUrl) {
|
|
|
52
54
|
}
|
|
53
55
|
return `file:${join(env.dataDir, "tenants", `${id}.db`)}`;
|
|
54
56
|
}
|
|
57
|
+
function isBusy(err) {
|
|
58
|
+
for (let e = err; e; e = e.cause) {
|
|
59
|
+
if (String(e.code ?? "").startsWith("SQLITE_BUSY")) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
/** `fn` again while another process holds the database: 1, 2, 4, 8 and 16 seconds apart. */
|
|
66
|
+
async function whileBusy(fn) {
|
|
67
|
+
for (let attempt = 0;; attempt++) {
|
|
68
|
+
try {
|
|
69
|
+
return await fn();
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (attempt >= 5 || !isBusy(err)) {
|
|
73
|
+
throw err;
|
|
74
|
+
}
|
|
75
|
+
await new Promise((resolve) => setTimeout(resolve, 1000 * 2 ** attempt));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
55
79
|
async function openTenant(id) {
|
|
56
80
|
let row = await controlDb.query.tenant.findFirst({ where: eq(control.tenant.id, id) });
|
|
57
81
|
if (!row) {
|
|
@@ -61,10 +85,20 @@ async function openTenant(id) {
|
|
|
61
85
|
const url = tenantUrl(id, row.dbUrl);
|
|
62
86
|
const client = open(url, url.startsWith("file:") ? "" : env.tenantDbAuthToken);
|
|
63
87
|
clients.set(id, client);
|
|
64
|
-
await prepare(client, url);
|
|
65
88
|
const db = makeTenantDb(client);
|
|
66
89
|
// Every database is brought to the current schema when it is first opened.
|
|
67
|
-
|
|
90
|
+
try {
|
|
91
|
+
await whileBusy(async () => {
|
|
92
|
+
await prepare(client, url);
|
|
93
|
+
await migrate(db, { migrationsFolder: migrationsFolder("tenant") });
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
// The next use opens it afresh (tenantDb forgets the failed attempt).
|
|
98
|
+
clients.delete(id);
|
|
99
|
+
client.close();
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
68
102
|
for (const hook of openHooks) {
|
|
69
103
|
await hook(id, client);
|
|
70
104
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `run` ADD `client` text;
|