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.
Files changed (34) hide show
  1. package/apps/runtime/dist/cli/menu.js +49 -18
  2. package/apps/runtime/dist/cli/update.js +7 -2
  3. package/apps/runtime/dist/db/migrations/tenant/0015_device_calls.sql +13 -0
  4. package/apps/runtime/dist/db/migrations/tenant/meta/0015_snapshot.json +3243 -0
  5. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  6. package/apps/runtime/dist/db/schema.js +19 -0
  7. package/apps/runtime/dist/engine/device.js +61 -49
  8. package/apps/runtime/dist/engine/events.js +30 -7
  9. package/apps/runtime/dist/engine/runner.js +4 -1
  10. package/apps/runtime/dist/models.js +1 -1
  11. package/apps/runtime/dist/plugins/runs.js +2 -6
  12. package/apps/runtime/dist/routes/runs.js +16 -9
  13. package/apps/web/dist/assets/{AboutDialog-DEZCEQlN.js → AboutDialog-DBoAyoKO.js} +1 -1
  14. package/apps/web/dist/assets/{ChangelogDialog-CgnnJj4G.js → ChangelogDialog-BmFgf8E1.js} +1 -1
  15. package/apps/web/dist/assets/{ChatView-BnnKdwk4.js → ChatView-CGsHD-N7.js} +1 -1
  16. package/apps/web/dist/assets/{EditorPage-CeDWjq4z.js → EditorPage-BhfI0l0z.js} +1 -1
  17. package/apps/web/dist/assets/{FlowPreview-Du028FI3.js → FlowPreview-C7AlCnP2.js} +1 -1
  18. package/apps/web/dist/assets/{Harness-CEPy4MEp.js → Harness-BOXAOCTP.js} +1 -1
  19. package/apps/web/dist/assets/{Marketplace-ms58DQJ9.js → Marketplace-COvClHLm.js} +2 -2
  20. package/apps/web/dist/assets/{NewWizardPage-CEQSNXeZ.js → NewWizardPage-PS_2wDRH.js} +1 -1
  21. package/apps/web/dist/assets/{ProjectPage-CXDpKoK2.js → ProjectPage-DHXoZbtr.js} +1 -1
  22. package/apps/web/dist/assets/{PublicRunner-DMmtmzBX.js → PublicRunner-GFi75MT5.js} +1 -1
  23. package/apps/web/dist/assets/{RunDrawer-BIojYB0g.js → RunDrawer-D-mr7W0a.js} +1 -1
  24. package/apps/web/dist/assets/{RunnerView-D8OGEoMl.js → RunnerView-XKLQktRM.js} +1 -1
  25. package/apps/web/dist/assets/{SettingsPage-BlMZL4_d.js → SettingsPage-CNx6q9hk.js} +1 -1
  26. package/apps/web/dist/assets/{SetupPage-Doz9T3kv.js → SetupPage-H84QxAhW.js} +1 -1
  27. package/apps/web/dist/assets/{SharePage-DOJXdsyi.js → SharePage-GqXS15BS.js} +1 -1
  28. package/apps/web/dist/assets/changelog-Byp2KBUH.js +1 -0
  29. package/apps/web/dist/assets/{esm-D6fM9MdG.js → esm-BCeL0PFC.js} +1 -1
  30. package/apps/web/dist/assets/{index-nfRuCdVt.js → index-DZtkpyLG.js} +4 -4
  31. package/apps/web/dist/assets/{settings-menu-BGfn4LJE.js → settings-menu-MX7j6SCB.js} +1 -1
  32. package/apps/web/dist/index.html +2 -2
  33. package/package.json +1 -1
  34. package/apps/web/dist/assets/changelog-B1jhC7Fv.js +0 -1
@@ -39,7 +39,7 @@ function choices({ running, atLogin, release }) {
39
39
  { value: "stop", label: "Stop", hint: "the data is kept" },
40
40
  ]
41
41
  : [
42
- { value: "start", label: "Start", hint: "in the background, opens the studio" },
42
+ { value: "start", label: "Start as service", hint: "in the background, opens the studio" },
43
43
  { value: "foreground", label: "Start here", hint: "in this terminal; Ctrl-C stops it" },
44
44
  ];
45
45
  options.push({
@@ -53,13 +53,52 @@ function choices({ running, atLogin, release }) {
53
53
  });
54
54
  if (!("unavailable" in atLogin)) {
55
55
  options.push({
56
- value: "autostart",
57
- label: atLogin.on ? "Don't start at login" : "Start at login",
56
+ value: "service",
57
+ label: "Service settings",
58
+ hint: atLogin.on ? "starts at login" : "does not start at login",
58
59
  });
59
60
  }
60
61
  options.push({ value: "connect", label: "Connect AI apps", hint: "your wizards in Claude, Cursor, Codex …" }, { value: "status", label: "Status", hint: "what is installed, and what is wrong" }, { value: "setup", label: "Setup", hint: "AI client, ffmpeg, start at login" }, { value: "help", label: "Help", hint: "every command" }, { value: "quit", label: "Quit", hint: running ? "it keeps running" : undefined });
61
62
  return options;
62
63
  }
64
+ /** How the service runs: whether it starts at login. Esc goes back to the menu. */
65
+ async function serviceSettings(paths, atLogin) {
66
+ if ("unavailable" in atLogin) {
67
+ return;
68
+ }
69
+ const on = await p.select({
70
+ message: "Start at login?",
71
+ initialValue: atLogin.on,
72
+ options: [
73
+ { value: true, label: "Yes", hint: "runs in the background from login on" },
74
+ { value: false, label: "No", hint: "only when you start it" },
75
+ ],
76
+ });
77
+ if (p.isCancel(on) || on === atLogin.on) {
78
+ return;
79
+ }
80
+ try {
81
+ await setAutostart(paths, on);
82
+ }
83
+ catch (error) {
84
+ p.log.warn(`Starting at login could not be switched: ${error.message}`);
85
+ }
86
+ }
87
+ /** The commands used most, for when the menu ends. */
88
+ function commands() {
89
+ const name = command();
90
+ return [
91
+ [`${name} start`, "start it and open the studio"],
92
+ [`${name} studio`, "open the studio; starts it when it does not run"],
93
+ [`${name} stop`, "stop it; the data is kept"],
94
+ [`${name} status`, "what is installed and what runs"],
95
+ [`${name} update`, "the newest version"],
96
+ [`${name} --version`, "the version you have"],
97
+ [`${name} help`, "every command"],
98
+ ]
99
+ .map(([line, what]) => `${cyan(line.padEnd(name.length + 12))}${dim(what)}`)
100
+ .join("\n");
101
+ }
63
102
  /**
64
103
  * `wizards` on a terminal: what runs, and a menu of what the commands do. The first time, the
65
104
  * setup runs first. Returns the exit code; "Start here" ends it with the runtime in the
@@ -99,25 +138,17 @@ export async function menu(paths, setupOptions, help) {
99
138
  await stop(paths);
100
139
  break;
101
140
  case "update": {
102
- if ((await update(paths)) !== 0) {
141
+ // What runs restarts into the new version.
142
+ if ((await update(paths, { restart: true })) !== 0) {
103
143
  break;
104
144
  }
105
- // This menu is still the old version: what runs restarts into the new one, then it ends.
106
- if (state.running) {
107
- await restart(paths);
108
- }
109
- p.outro(`Updated. ${cyan(command())} opens the new version.`);
145
+ // This menu is still the old version, so it ends here.
146
+ p.note(commands(), "Updated");
147
+ p.outro(dim(`${command()} opens this menu again, in the new version.`));
110
148
  return 0;
111
149
  }
112
- case "autostart":
113
- if (!("unavailable" in state.atLogin)) {
114
- try {
115
- await setAutostart(paths, !state.atLogin.on);
116
- }
117
- catch (error) {
118
- p.log.warn(`Starting at login could not be switched: ${error.message}`);
119
- }
120
- }
150
+ case "service":
151
+ await serviceSettings(paths, state.atLogin);
121
152
  break;
122
153
  case "connect":
123
154
  await connectCommand(paths, [], false);
@@ -3,6 +3,7 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { command, installedByScript, isCheckout } from "./home.js";
5
5
  import { runningRuntime, settings } from "./start.js";
6
+ import { restart } from "./status.js";
6
7
  import { cyan } from "./ui.js";
7
8
  /** The installer this install was made with; it also updates one. */
8
9
  const INSTALLER = "https://engenty.ai/install.sh";
@@ -23,9 +24,10 @@ async function installer(into) {
23
24
  }
24
25
  /**
25
26
  * Brings an install made by install.sh to the newest version by running the installer again
26
- * without its questions: Node, the runtime and the command.
27
+ * without its questions: Node, the runtime and the command. With `restart`, a runtime that runs
28
+ * restarts into the new version; otherwise it says how.
27
29
  */
28
- export async function update(paths) {
30
+ export async function update(paths, options = {}) {
29
31
  if (!installedByScript(paths)) {
30
32
  console.log(isCheckout()
31
33
  ? `This copy is a checkout. The newest version: ${cyan("git pull && pnpm install && pnpm build")}`
@@ -52,6 +54,9 @@ export async function update(paths) {
52
54
  rmSync(tmp, { recursive: true, force: true });
53
55
  }
54
56
  if (await runningRuntime(settings(paths).dataDir)) {
57
+ if (options.restart) {
58
+ return restart(paths);
59
+ }
55
60
  console.log(` The runtime that is running is still the old one. Restart it: ${cyan(`${command()} restart`)}`);
56
61
  }
57
62
  return 0;
@@ -0,0 +1,13 @@
1
+ CREATE TABLE `device_call` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `run_id` text NOT NULL,
4
+ `req_id` text NOT NULL,
5
+ `request` text NOT NULL,
6
+ `answer` text,
7
+ `created_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
8
+ FOREIGN KEY (`run_id`) REFERENCES `run`(`id`) ON UPDATE no action ON DELETE cascade
9
+ );
10
+ --> statement-breakpoint
11
+ CREATE UNIQUE INDEX `device_call_req` ON `device_call` (`req_id`);--> statement-breakpoint
12
+ CREATE INDEX `device_call_run` ON `device_call` (`run_id`);--> statement-breakpoint
13
+ ALTER TABLE `run` ADD `device_offer` text;