@engenty/wizards-runtime 0.11.5 → 0.11.7
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/agents/architect.js +40 -55
- package/apps/runtime/dist/agents/chat-clients.js +3 -0
- package/apps/runtime/dist/agents/company.js +4 -12
- package/apps/runtime/dist/agents/studio-assistant.js +82 -74
- package/apps/runtime/dist/agents/subscription.js +27 -17
- package/apps/runtime/dist/assistant/knows.js +19 -19
- package/apps/runtime/dist/auth/account.js +51 -12
- package/apps/runtime/dist/auth/index.js +15 -2
- package/apps/runtime/dist/authoring/guide.js +20 -447
- package/apps/runtime/dist/browser/fast/run.js +18 -12
- package/apps/runtime/dist/cli/account.js +127 -10
- package/apps/runtime/dist/cli/main.js +4 -2
- package/apps/runtime/dist/connectors/mail.js +4 -3
- package/apps/runtime/dist/data/chat-models.json +116 -0
- package/apps/runtime/dist/docs/user-guide/models.md +15 -5
- package/apps/runtime/dist/documents/parse.js +5 -14
- package/apps/runtime/dist/engine/decide.js +2 -1
- package/apps/runtime/dist/engine/runner.js +4 -3
- package/apps/runtime/dist/engine/steps.js +82 -91
- package/apps/runtime/dist/engine/template.js +2 -3
- package/apps/runtime/dist/env.js +5 -0
- package/apps/runtime/dist/harness/antigravity.js +2 -2
- package/apps/runtime/dist/harness/apple.js +4 -6
- package/apps/runtime/dist/harness/codex.js +5 -6
- package/apps/runtime/dist/harness/prompt.js +8 -8
- package/apps/runtime/dist/mcp/handler.js +5 -7
- package/apps/runtime/dist/mcp/tools.js +33 -54
- package/apps/runtime/dist/media/conversation.js +18 -23
- package/apps/runtime/dist/media/generate.js +18 -3
- package/apps/runtime/dist/media/transcribe.js +5 -4
- package/apps/runtime/dist/models.js +8 -9
- package/apps/runtime/dist/motion-graphics/project.js +19 -53
- package/apps/runtime/dist/motion-graphics/sounds.js +2 -1
- package/apps/runtime/dist/motion-graphics/step.js +31 -16
- package/apps/runtime/dist/prompts/README.md +48 -0
- package/apps/runtime/dist/prompts/architect.md +89 -0
- package/apps/runtime/dist/prompts/authoring.md +503 -0
- package/apps/runtime/dist/prompts/goose.md +229 -0
- package/apps/runtime/dist/prompts/mcp.md +156 -0
- package/apps/runtime/dist/prompts/safety.md +23 -0
- package/apps/runtime/dist/prompts/services.md +151 -0
- package/apps/runtime/dist/prompts/step.md +334 -0
- package/apps/runtime/dist/prompts/tools.md +330 -0
- package/apps/runtime/dist/prompts/voice.md +53 -0
- package/apps/runtime/dist/prompts.js +50 -0
- package/apps/runtime/dist/routes/studio.js +58 -7
- package/apps/runtime/dist/safety.js +45 -0
- package/apps/runtime/dist/sandbox/index.js +8 -3
- package/apps/runtime/dist/services/architect.js +5 -4
- package/apps/runtime/dist/services/assistant-chats.js +5 -8
- package/apps/runtime/dist/services/brand.js +2 -7
- package/apps/runtime/dist/services/chat-models.js +58 -0
- package/apps/runtime/dist/services/cloud.js +8 -4
- package/apps/runtime/dist/services/knowledge-model.js +17 -8
- package/apps/runtime/dist/services/knowledge.js +5 -9
- package/apps/runtime/dist/services/project-files.js +3 -8
- package/apps/runtime/dist/services/relevance.js +4 -3
- package/apps/runtime/dist/services/runs.js +6 -7
- package/apps/runtime/dist/services/site.js +2 -2
- package/apps/runtime/dist/services/translations.js +17 -10
- package/apps/runtime/dist/services/wizards.js +8 -0
- package/apps/runtime/dist/sync/client.js +116 -1
- package/apps/runtime/dist/tools/browser.js +36 -33
- package/apps/runtime/dist/tools/code.js +20 -6
- package/apps/runtime/dist/tools/connector.js +23 -9
- package/apps/runtime/dist/tools/index.js +14 -11
- package/apps/runtime/dist/tools/mail.js +5 -5
- package/apps/runtime/dist/tools/net-guard.js +4 -4
- package/apps/runtime/dist/tools/pages.js +3 -2
- package/apps/runtime/dist/tools/project.js +7 -8
- package/apps/runtime/dist/tools/store.js +14 -10
- package/apps/web/dist/assets/{AboutDialog-B525L37O.js → AboutDialog-J9rRhJTJ.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-gInSm1Xe.js → ChangelogDialog-D9bBSuLQ.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-C0TmdCrb.js → CodeEditor-CiRJjYpm.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-7t3vhZi6.js → EditorPage-ChLV09jO.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-BBN-APkG.js → FlowPreview-QRnLE4JM.js} +1 -1
- package/apps/web/dist/assets/{Harness-fAoC908y.js → Harness-dM1CDgnx.js} +1 -1
- package/apps/web/dist/assets/Marketplace-8rU-MhWj.js +2 -0
- package/apps/web/dist/assets/{NewWizardChannels-X32lBGMf.js → NewWizardChannels--JqgVT-t.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-DMoqDhsh.js → NewWizardPage-CNv5UuBn.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-BjZy-bhI.js → OnboardingPage-CDuhfBEI.js} +1 -1
- package/apps/web/dist/assets/{PreviewPane-Bt-ForJG.js → PreviewPane-BsMrHW8b.js} +2 -2
- package/apps/web/dist/assets/{ProjectPage-B5a-nod-.js → ProjectPage-CoVMEoB1.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-Cq_XzX54.js → PublicRunner-Ckte5NnM.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-DX3beZJz.js → ReadOnly-Ch-ss9Mh.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-CGp6G_fp.js +2 -0
- package/apps/web/dist/assets/{SetupPage-BI9bgEkI.js → SetupPage-DgFT_646.js} +1 -1
- package/apps/web/dist/assets/{SharePage-Ch-1oLBs.js → SharePage-CEcFKE3b.js} +1 -1
- package/apps/web/dist/assets/changelog-DMhLfQmS.js +1 -0
- package/apps/web/dist/assets/i18n-AXoEWXfv.js +55 -0
- package/apps/web/dist/assets/index-BYZBN0xx.css +1 -0
- package/apps/web/dist/assets/index-Dx7qMiM3.js +34 -0
- package/apps/web/dist/assets/{oss-credits-CZT1KRIp.js → oss-credits-Da4KrYmP.js} +1 -1
- package/apps/web/dist/assets/{phone-DxC6eM6O.js → phone-De-HF0g7.js} +1 -1
- package/apps/web/dist/assets/{runners-SQHfvvNQ.js → runners-UIPj9xyX.js} +1 -1
- package/apps/web/dist/assets/{session-4CTNIlai.js → session-DUxZmhqy.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-B0af5EBE.js → settings-menu-Bo1yXMGF.js} +1 -1
- package/apps/web/dist/assets/{theme-mtamawa_.js → theme-CSuPPxre.js} +1 -1
- package/apps/web/dist/assets/ui-CBDsXUoA.js +83 -0
- package/apps/web/dist/assets/{upload-DXJQU2lL.js → upload-CZgdEF60.js} +1 -1
- package/apps/web/dist/assets/{useMutation-DwRYrG3V.js → useMutation-ZHWqRSPd.js} +1 -1
- package/apps/web/dist/assets/{volume-2-CYbbBiXP.js → volume-2-c641MxaU.js} +1 -1
- package/apps/web/dist/assets/{wrench-D8lG2BH7.js → wrench-DCEAyYuR.js} +1 -1
- package/apps/web/dist/index.html +8 -9
- package/apps/web/dist/mcp/flow.html +87 -87
- package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +1 -0
- package/node_modules/@engenty/wizards-shared/dist/assistant.js +2 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +12 -0
- package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +0 -2
- package/node_modules/@engenty/wizards-shared/dist/surface.js +0 -29
- package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +5 -0
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/assistant/primer.js +0 -26
- package/apps/web/dist/assets/Marketplace-CotMMcJ-.js +0 -2
- package/apps/web/dist/assets/SettingsPage-DPuwA3QL.js +0 -2
- package/apps/web/dist/assets/changelog-BlJc9UFS.js +0 -1
- package/apps/web/dist/assets/coins-D_yN56kT.js +0 -1
- package/apps/web/dist/assets/i18n-Dy3fTQM3.js +0 -55
- package/apps/web/dist/assets/index-Dt1Ps3ge.js +0 -34
- package/apps/web/dist/assets/index-rX7eCvWh.css +0 -1
- package/apps/web/dist/assets/ui-CL8v8Goa.js +0 -83
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// the step budget, an ambiguous step (the planner LLM takes over), or
|
|
3
3
|
// the seat is gone. Ported from engenty-pro, which took it from jev-ultrafast
|
|
4
4
|
// `agent.py` `Agent.command`.
|
|
5
|
+
import { prompt } from "../../prompts.js";
|
|
5
6
|
import { buildActionSpace } from "./action-space.js";
|
|
6
7
|
import { decide, tiebreak } from "./decide.js";
|
|
7
8
|
import { FastLoopDriver, StalePageError } from "./driver.js";
|
|
@@ -16,7 +17,9 @@ const STUCK_WINDOW = 3;
|
|
|
16
17
|
*/
|
|
17
18
|
const STALE_RETRIES_PER_STEP = 3;
|
|
18
19
|
/** Every note that stops short of DONE ends with the way back. */
|
|
19
|
-
const
|
|
20
|
+
const resume = (note) => `${note} ${prompt("tools", "note.fast_resume")}`;
|
|
21
|
+
/** Why the classifier or a step failed, for a note. */
|
|
22
|
+
const why = (error) => (error instanceof Error ? error.message : String(error));
|
|
20
23
|
function describe(step) {
|
|
21
24
|
return step.target === null
|
|
22
25
|
? step.operation
|
|
@@ -88,7 +91,7 @@ export async function runFastLoop(input) {
|
|
|
88
91
|
let staleRetries = 0;
|
|
89
92
|
while (history.length < input.maxSteps) {
|
|
90
93
|
if (input.shouldStop?.()) {
|
|
91
|
-
return finish("interrupted", "
|
|
94
|
+
return finish("interrupted", prompt("tools", "note.fast_interrupted"), false);
|
|
92
95
|
}
|
|
93
96
|
if (!(await driver.fresh(page))) {
|
|
94
97
|
page = await driver.observe();
|
|
@@ -106,7 +109,7 @@ export async function runFastLoop(input) {
|
|
|
106
109
|
decision = await decide(decideInput);
|
|
107
110
|
}
|
|
108
111
|
catch (error) {
|
|
109
|
-
return finish("error",
|
|
112
|
+
return finish("error", resume(prompt("tools", "note.fast_no_decision", { error: why(error) })), true);
|
|
110
113
|
}
|
|
111
114
|
totals.jev_latency_ms += decision.latency_ms;
|
|
112
115
|
totals.input_tokens += decision.usage?.input_tokens ?? 0;
|
|
@@ -127,12 +130,15 @@ export async function runFastLoop(input) {
|
|
|
127
130
|
verdict = await tiebreak({ ...decideInput, decision });
|
|
128
131
|
}
|
|
129
132
|
catch (error) {
|
|
130
|
-
return finish("error",
|
|
133
|
+
return finish("error", resume(prompt("tools", "note.fast_tiebreak_failed", { error: why(error) })), true);
|
|
131
134
|
}
|
|
132
135
|
totals.jev_latency_ms += verdict.latency_ms;
|
|
133
136
|
totals.input_tokens += verdict.usage?.input_tokens ?? 0;
|
|
134
137
|
if (verdict.winner === null) {
|
|
135
|
-
return finish("uncertain",
|
|
138
|
+
return finish("uncertain", resume(prompt("tools", "note.fast_undecided", {
|
|
139
|
+
contest,
|
|
140
|
+
probability: verdict.probability.toFixed(2),
|
|
141
|
+
})), true);
|
|
136
142
|
}
|
|
137
143
|
tiebreakProbability = verdict.probability;
|
|
138
144
|
if (verdict.winner === "runner_up" && decision.runnerUp) {
|
|
@@ -154,12 +160,12 @@ export async function runFastLoop(input) {
|
|
|
154
160
|
}
|
|
155
161
|
const done = decision.choice === "DONE";
|
|
156
162
|
return finish(done ? "done" : "blocked", done
|
|
157
|
-
? "
|
|
158
|
-
:
|
|
163
|
+
? prompt("tools", "note.fast_done")
|
|
164
|
+
: `${resume(prompt("tools", "note.fast_blocked"))} ${prompt("tools", "note.fast_blocked_ask")}`, !done);
|
|
159
165
|
}
|
|
160
166
|
const action = page.actions.find((a) => a.id === decision.choice);
|
|
161
167
|
if (!action) {
|
|
162
|
-
return finish("error",
|
|
168
|
+
return finish("error", resume(prompt("tools", "note.fast_unknown_action")), true);
|
|
163
169
|
}
|
|
164
170
|
let text = null;
|
|
165
171
|
let textWait = 0;
|
|
@@ -182,7 +188,7 @@ export async function runFastLoop(input) {
|
|
|
182
188
|
text = result.text;
|
|
183
189
|
textSource = result.source;
|
|
184
190
|
if (text === null) {
|
|
185
|
-
return finish("uncertain",
|
|
191
|
+
return finish("uncertain", prompt("tools", "note.fast_needs_value", { label: action.label }), true);
|
|
186
192
|
}
|
|
187
193
|
}
|
|
188
194
|
await driver.act(action, page, text);
|
|
@@ -199,7 +205,7 @@ export async function runFastLoop(input) {
|
|
|
199
205
|
prefetchText(page);
|
|
200
206
|
continue;
|
|
201
207
|
}
|
|
202
|
-
return finish("error",
|
|
208
|
+
return finish("error", resume(prompt("tools", "note.fast_step_failed", { error: why(error) })), true);
|
|
203
209
|
}
|
|
204
210
|
const entry = {
|
|
205
211
|
action: action.label,
|
|
@@ -242,8 +248,8 @@ export async function runFastLoop(input) {
|
|
|
242
248
|
const recent = history.slice(-STUCK_WINDOW);
|
|
243
249
|
if (recent.length === STUCK_WINDOW &&
|
|
244
250
|
recent.every((h) => h.page_changed === false && h.kind !== "wait")) {
|
|
245
|
-
return finish("blocked",
|
|
251
|
+
return finish("blocked", resume(prompt("tools", "note.fast_stuck", { count: STUCK_WINDOW })), true);
|
|
246
252
|
}
|
|
247
253
|
}
|
|
248
|
-
return finish("budget",
|
|
254
|
+
return finish("budget", prompt("tools", "note.fast_budget", { max: input.maxSteps }), true);
|
|
249
255
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as p from "@clack/prompts";
|
|
2
2
|
import { accountOverview, knownOrganization, linkedAccount, unlink, } from "../auth/account.js";
|
|
3
3
|
import { DeviceSignInError, requestDeviceCode, waitForDeviceSignIn } from "../auth/device.js";
|
|
4
|
-
import { migrateControlDb } from "../db/client.js";
|
|
4
|
+
import { migrateControlDb, withTenant } from "../db/client.js";
|
|
5
5
|
import { env } from "../env.js";
|
|
6
6
|
import { featuresFile, fileFeatures, writeFeature } from "../features.js";
|
|
7
|
+
import { LOCAL_TENANT } from "../tenants/tenant.js";
|
|
7
8
|
import { readInstallNote, writeInstallNote } from "./home.js";
|
|
8
9
|
import { openBrowser, runningRuntime, settings } from "./start.js";
|
|
9
10
|
import { bold, busy, cmd, cyan, dim, spelled, tilde } from "./ui.js";
|
|
@@ -154,7 +155,9 @@ function onKeys(keys) {
|
|
|
154
155
|
* terminal, Enter opens the page again and Esc goes on without an account: someone without an
|
|
155
156
|
* invitation code yet is not stuck in the wait. Null when it ended without an account.
|
|
156
157
|
*/
|
|
157
|
-
async function deviceSignIn(interactive
|
|
158
|
+
async function deviceSignIn(interactive,
|
|
159
|
+
/** The organization to pick on the page, for a switch: the page shows the person's list. */
|
|
160
|
+
organization) {
|
|
158
161
|
let code;
|
|
159
162
|
try {
|
|
160
163
|
code = await requestDeviceCode();
|
|
@@ -165,10 +168,17 @@ async function deviceSignIn(interactive) {
|
|
|
165
168
|
}
|
|
166
169
|
const shown = groupedCode(code.userCode);
|
|
167
170
|
// The complete link carries the code: the page only asks to check it.
|
|
168
|
-
const
|
|
171
|
+
const page = new URL(code.verificationUriComplete ?? code.verificationUri);
|
|
172
|
+
if (organization) {
|
|
173
|
+
page.searchParams.set("organization", organization.id);
|
|
174
|
+
}
|
|
175
|
+
const link = page.toString();
|
|
169
176
|
p.log.message(code.verificationUriComplete
|
|
170
177
|
? `Open ${cyan(link)}\nThe page shows the code ${bold(shown)}: check that it matches.`
|
|
171
178
|
: `Open ${cyan(link)} and enter the code ${bold(shown)}.`);
|
|
179
|
+
if (organization) {
|
|
180
|
+
p.log.message(`On that page, pick ${bold(organization.name)}.`);
|
|
181
|
+
}
|
|
172
182
|
const opened = openBrowser(link);
|
|
173
183
|
const newHere = (await signupByCode())
|
|
174
184
|
? "New here? Create your account on that page with your invitation code, or join the waitlist there."
|
|
@@ -237,7 +247,7 @@ async function signIn(paths, interactive) {
|
|
|
237
247
|
return 0;
|
|
238
248
|
}
|
|
239
249
|
if (linked) {
|
|
240
|
-
p.log.info(`Already signed in as ${described(linked, await knownOrganization(), false)}. ${dim(`
|
|
250
|
+
p.log.info(`Already signed in as ${described(linked, await knownOrganization(), false)}. ${dim(`Another organization: ${cmd("account switch")}. Another account: ${cmd("account sign-out")} first.`)}`);
|
|
241
251
|
return 0;
|
|
242
252
|
}
|
|
243
253
|
const account = await deviceSignIn(interactive);
|
|
@@ -250,6 +260,97 @@ async function signIn(paths, interactive) {
|
|
|
250
260
|
await pickUp(paths, interactive, SIGNED_IN);
|
|
251
261
|
return 0;
|
|
252
262
|
}
|
|
263
|
+
/** A name at the end of a sentence: "engrd." takes no second full stop. */
|
|
264
|
+
const ended = (name) => (name.endsWith(".") ? name : `${name}.`);
|
|
265
|
+
/** The organization a name, address or id on the command line means, of the person's. */
|
|
266
|
+
export function organizationNamed(organizations, wanted) {
|
|
267
|
+
const plain = wanted.trim().toLowerCase();
|
|
268
|
+
return (organizations.find((o) => o.id === wanted.trim()) ??
|
|
269
|
+
organizations.find((o) => o.name.toLowerCase() === plain) ??
|
|
270
|
+
organizations.find((o) => o.name.toLowerCase().startsWith(plain)) ??
|
|
271
|
+
null);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* `wizards account switch [organization]`: the same account, signed in to another of its
|
|
275
|
+
* organizations. What changed here goes up to the organization it belongs to first; its
|
|
276
|
+
* spaces stay on this computer and sync again after a switch back (sync/client.ts).
|
|
277
|
+
*/
|
|
278
|
+
async function switchOrganization(paths, interactive, wanted) {
|
|
279
|
+
await ready();
|
|
280
|
+
const linked = await linkedAccount();
|
|
281
|
+
if (!linked) {
|
|
282
|
+
console.log(`Not signed in. ${dim(`To sign in: ${cmd("account sign-in")}`)}`);
|
|
283
|
+
return 1;
|
|
284
|
+
}
|
|
285
|
+
const overview = await accountOverview();
|
|
286
|
+
if (!overview) {
|
|
287
|
+
p.log.error(`${host()} didn’t respond, so your organizations aren’t known. Try again later.`);
|
|
288
|
+
return 1;
|
|
289
|
+
}
|
|
290
|
+
const organizations = overview.tenants ?? [];
|
|
291
|
+
const others = organizations.filter((o) => o.id !== linked.tenantId);
|
|
292
|
+
if (!others.length) {
|
|
293
|
+
p.log.info(`${overview.tenant.name} is your only organization, so there’s nothing to switch to.`);
|
|
294
|
+
return 0;
|
|
295
|
+
}
|
|
296
|
+
let target = wanted ? organizationNamed(organizations, wanted) : null;
|
|
297
|
+
if (wanted && !target) {
|
|
298
|
+
p.log.error(`You aren’t in an organization called “${wanted}”. Yours: ${organizations.map((o) => o.name).join(", ")}.`);
|
|
299
|
+
return 1;
|
|
300
|
+
}
|
|
301
|
+
if (!target) {
|
|
302
|
+
if (!interactive) {
|
|
303
|
+
console.error(`Usage: ${cmd("account switch <organization>")}`);
|
|
304
|
+
return 2;
|
|
305
|
+
}
|
|
306
|
+
const picked = await p.select({
|
|
307
|
+
message: `Signed in to ${overview.tenant.name}. Switch to:`,
|
|
308
|
+
options: others.map((o) => ({ value: o.id, label: o.name, hint: o.role })),
|
|
309
|
+
});
|
|
310
|
+
if (p.isCancel(picked)) {
|
|
311
|
+
return 1;
|
|
312
|
+
}
|
|
313
|
+
target = others.find((o) => o.id === picked) ?? null;
|
|
314
|
+
}
|
|
315
|
+
if (!target || target.id === linked.tenantId) {
|
|
316
|
+
p.log.info(`Already signed in to ${ended(overview.tenant.name)}`);
|
|
317
|
+
return 0;
|
|
318
|
+
}
|
|
319
|
+
const chosen = target;
|
|
320
|
+
return withTenant(LOCAL_TENANT, async () => {
|
|
321
|
+
const { sendBeforeSwitch } = await import("../sync/client.js");
|
|
322
|
+
const spinner = busy(`Sending what changed here to ${overview.tenant.name}…`);
|
|
323
|
+
const stuck = await sendBeforeSwitch();
|
|
324
|
+
if (stuck.length) {
|
|
325
|
+
spinner.fail(`Not everything arrived in ${ended(overview.tenant.name)}`);
|
|
326
|
+
for (const space of stuck) {
|
|
327
|
+
p.log.message(`${space.name}: ${space.message}`);
|
|
328
|
+
}
|
|
329
|
+
const anyway = interactive &&
|
|
330
|
+
(await p.confirm({
|
|
331
|
+
message: "Switch anyway? What didn’t arrive stays on this computer and arrives when you switch back.",
|
|
332
|
+
initialValue: false,
|
|
333
|
+
}));
|
|
334
|
+
if (p.isCancel(anyway) || !anyway) {
|
|
335
|
+
p.log.info(dim(`Still signed in to ${ended(overview.tenant.name)}`));
|
|
336
|
+
return 1;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
spinner.stop(`Everything here arrived in ${ended(overview.tenant.name)}`);
|
|
341
|
+
}
|
|
342
|
+
const account = await deviceSignIn(interactive, chosen);
|
|
343
|
+
if (!account) {
|
|
344
|
+
p.log.info(dim(`Still signed in to ${ended(overview.tenant.name)}`));
|
|
345
|
+
return 1;
|
|
346
|
+
}
|
|
347
|
+
if (account.tenantId !== linked.tenantId) {
|
|
348
|
+
p.log.message(dim(`The spaces of ${overview.tenant.name} stay on this computer and arrive in the cloud again when you switch back.`));
|
|
349
|
+
}
|
|
350
|
+
await pickUp(paths, interactive, "it works in the new organization");
|
|
351
|
+
return 0;
|
|
352
|
+
});
|
|
353
|
+
}
|
|
253
354
|
/**
|
|
254
355
|
* Ends the link to the account: the same as the studio's sign-out (DELETE /api/studio/account).
|
|
255
356
|
*/
|
|
@@ -264,7 +365,7 @@ async function disconnect() {
|
|
|
264
365
|
import("../plugins/pro.js"),
|
|
265
366
|
import("../models.js"),
|
|
266
367
|
]);
|
|
267
|
-
await forgetCloud
|
|
368
|
+
await withTenant(LOCAL_TENANT, forgetCloud);
|
|
268
369
|
await refreshPro();
|
|
269
370
|
await models.loadLocalModels();
|
|
270
371
|
if (models.localModelSettings().source === "account") {
|
|
@@ -287,7 +388,7 @@ async function signOut(paths, interactive) {
|
|
|
287
388
|
await pickUp(paths, interactive, "it disconnects from the account");
|
|
288
389
|
return 0;
|
|
289
390
|
}
|
|
290
|
-
/** `wizards account [sign-in|sign-out]`. */
|
|
391
|
+
/** `wizards account [sign-in|sign-out|switch [organization]]`. */
|
|
291
392
|
export async function accountCommand(paths, value, options) {
|
|
292
393
|
const interactive = !options.yes && Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
293
394
|
switch (value) {
|
|
@@ -301,8 +402,10 @@ export async function accountCommand(paths, value, options) {
|
|
|
301
402
|
case "signout":
|
|
302
403
|
case "logout":
|
|
303
404
|
return signOut(paths, interactive);
|
|
405
|
+
case "switch":
|
|
406
|
+
return switchOrganization(paths, interactive, options.organization ?? "");
|
|
304
407
|
default:
|
|
305
|
-
console.error(`Usage: ${cmd("account [sign-in|sign-out]")}`);
|
|
408
|
+
console.error(`Usage: ${cmd("account [sign-in|sign-out|switch]")}`);
|
|
306
409
|
return 2;
|
|
307
410
|
}
|
|
308
411
|
}
|
|
@@ -313,9 +416,20 @@ export async function accountMenu(paths) {
|
|
|
313
416
|
const action = await p.select({
|
|
314
417
|
message: "Account",
|
|
315
418
|
options: [
|
|
316
|
-
state.kind === "linked"
|
|
317
|
-
?
|
|
318
|
-
|
|
419
|
+
...(state.kind === "linked"
|
|
420
|
+
? [
|
|
421
|
+
{
|
|
422
|
+
value: "switch",
|
|
423
|
+
label: "Switch organization",
|
|
424
|
+
hint: "for someone in several",
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
value: "sign-out",
|
|
428
|
+
label: "Sign out",
|
|
429
|
+
hint: "your wizards and results stay here",
|
|
430
|
+
},
|
|
431
|
+
]
|
|
432
|
+
: [{ value: "sign-in", label: "Sign in", hint: "with a code, in your browser" }]),
|
|
319
433
|
{ value: "back", label: "Back" },
|
|
320
434
|
],
|
|
321
435
|
});
|
|
@@ -325,6 +439,9 @@ export async function accountMenu(paths) {
|
|
|
325
439
|
if (action === "sign-in") {
|
|
326
440
|
await signIn(paths, true);
|
|
327
441
|
}
|
|
442
|
+
else if (action === "switch") {
|
|
443
|
+
await switchOrganization(paths, true, "");
|
|
444
|
+
}
|
|
328
445
|
else {
|
|
329
446
|
await signOut(paths, true);
|
|
330
447
|
}
|
|
@@ -33,6 +33,7 @@ ${line(`${command()} start`, "start it in this terminal and open the studio (Ctr
|
|
|
33
33
|
${line(`${command()} studio`, "open the studio, starting it in the background if needed")}
|
|
34
34
|
${line(`${command()} setup`, "set up your engenty account, an AI client, ffmpeg, a decision model and start at login")}
|
|
35
35
|
${line(`${command()} account`, "show your engenty account; add sign-in or sign-out to change it")}
|
|
36
|
+
${line(`${command()} account switch`, "sign in to another of your organizations")}
|
|
36
37
|
${line(`${command()} open`, "sign this browser in to the running studio (--print: only print the link)")}
|
|
37
38
|
${line(`${command()} status`, "show what’s installed and running")}
|
|
38
39
|
${line(`${command()} doctor`, "show the status and check for problems")}
|
|
@@ -126,7 +127,8 @@ function parse(argv) {
|
|
|
126
127
|
!args.value) {
|
|
127
128
|
args.value = arg;
|
|
128
129
|
}
|
|
129
|
-
else if (args.command === "sandbox" &&
|
|
130
|
+
else if ((args.command === "sandbox" || (args.command === "account" && args.value === "switch")) &&
|
|
131
|
+
!args.engine) {
|
|
130
132
|
args.engine = arg;
|
|
131
133
|
}
|
|
132
134
|
else if (["connect", "disconnect", "features"].includes(args.command)) {
|
|
@@ -207,7 +209,7 @@ async function main(argv) {
|
|
|
207
209
|
case "autoupdate":
|
|
208
210
|
return autoUpdateCommand(paths, args.value);
|
|
209
211
|
case "account":
|
|
210
|
-
return accountCommand(paths, args.value, { yes: args.yes });
|
|
212
|
+
return accountCommand(paths, args.value, { yes: args.yes, organization: args.engine });
|
|
211
213
|
case "sandbox":
|
|
212
214
|
return sandboxCommand(paths, args.value, args.engine);
|
|
213
215
|
case "connect":
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { prompt } from "../prompts.js";
|
|
2
3
|
/**
|
|
3
4
|
* Mail as wizards use it: read-only, and the same three actions whichever provider the person
|
|
4
5
|
* connected. Every mail connector is an engenty `ConnectorDefinition` whose actions are these.
|
|
@@ -23,7 +24,7 @@ export function mailActions(backend, providerScopes) {
|
|
|
23
24
|
id: "search",
|
|
24
25
|
group: "read",
|
|
25
26
|
summary: "Search the mailbox",
|
|
26
|
-
description: "
|
|
27
|
+
description: prompt("tools", "connector.mail.search"),
|
|
27
28
|
inputSchema: mailSearchInput,
|
|
28
29
|
providerScopes,
|
|
29
30
|
handler: async (input, ctx) => ({
|
|
@@ -34,7 +35,7 @@ export function mailActions(backend, providerScopes) {
|
|
|
34
35
|
id: "read",
|
|
35
36
|
group: "read",
|
|
36
37
|
summary: "Read one mail",
|
|
37
|
-
description: "
|
|
38
|
+
description: prompt("tools", "connector.mail.read"),
|
|
38
39
|
inputSchema: mailReadInput,
|
|
39
40
|
providerScopes,
|
|
40
41
|
handler: (input, ctx) => backend.read(mailReadInput.parse(input).id, ctx),
|
|
@@ -43,7 +44,7 @@ export function mailActions(backend, providerScopes) {
|
|
|
43
44
|
id: "get_attachment",
|
|
44
45
|
group: "read",
|
|
45
46
|
summary: "Fetch an attachment",
|
|
46
|
-
description: "
|
|
47
|
+
description: prompt("tools", "connector.mail.get_attachment"),
|
|
47
48
|
inputSchema: mailAttachmentInput,
|
|
48
49
|
providerScopes,
|
|
49
50
|
handler: (input, ctx) => {
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"updated": "2026-10-22",
|
|
4
|
+
"ways": {
|
|
5
|
+
"claude": {
|
|
6
|
+
"normal": "sonnet",
|
|
7
|
+
"extra": "opus",
|
|
8
|
+
"models": [
|
|
9
|
+
{
|
|
10
|
+
"id": "sonnet",
|
|
11
|
+
"label": "Sonnet"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "opus",
|
|
15
|
+
"label": "Opus"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "haiku",
|
|
19
|
+
"label": "Haiku"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"codex": {
|
|
24
|
+
"normal": "gpt-6.1-sol",
|
|
25
|
+
"extra": "gpt-6-astra",
|
|
26
|
+
"models": [
|
|
27
|
+
{
|
|
28
|
+
"id": "gpt-6.1-sol",
|
|
29
|
+
"label": "GPT-6.1 Sol"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "gpt-6-astra",
|
|
33
|
+
"label": "GPT-6 Astra"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "gpt-6-luna",
|
|
37
|
+
"label": "GPT-6 Luna"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"cursor": {
|
|
42
|
+
"normal": "auto",
|
|
43
|
+
"extra": "auto",
|
|
44
|
+
"models": [
|
|
45
|
+
{
|
|
46
|
+
"id": "auto",
|
|
47
|
+
"label": "Auto"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"openai": {
|
|
52
|
+
"normal": "openai:gpt-5.5",
|
|
53
|
+
"extra": "openai:gpt-5.5",
|
|
54
|
+
"models": [
|
|
55
|
+
{
|
|
56
|
+
"id": "openai:gpt-5.5",
|
|
57
|
+
"label": "GPT-5.5"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "openai:gpt-5.4-mini",
|
|
61
|
+
"label": "GPT-5.4 mini"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"anthropic": {
|
|
66
|
+
"normal": "anthropic:claude-sonnet-5-5",
|
|
67
|
+
"extra": "anthropic:claude-opus-5-5",
|
|
68
|
+
"models": [
|
|
69
|
+
{
|
|
70
|
+
"id": "anthropic:claude-sonnet-5-5",
|
|
71
|
+
"label": "Claude Sonnet 5.5"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "anthropic:claude-opus-5-5",
|
|
75
|
+
"label": "Claude Opus 5.5"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "anthropic:claude-haiku-4-5",
|
|
79
|
+
"label": "Claude Haiku 4.5"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"google": {
|
|
84
|
+
"normal": "google:gemini-flash-latest",
|
|
85
|
+
"extra": "google:gemini-pro-latest",
|
|
86
|
+
"models": [
|
|
87
|
+
{
|
|
88
|
+
"id": "google:gemini-pro-latest",
|
|
89
|
+
"label": "Gemini Pro"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "google:gemini-flash-latest",
|
|
93
|
+
"label": "Gemini Flash"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"gateway": {
|
|
98
|
+
"normal": "deepseek/deepseek-v4.1-flash",
|
|
99
|
+
"extra": "moonshotai/kimi-k3",
|
|
100
|
+
"models": [
|
|
101
|
+
{
|
|
102
|
+
"id": "moonshotai/kimi-k3",
|
|
103
|
+
"label": "Kimi K3"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "deepseek/deepseek-v4.1-flash",
|
|
107
|
+
"label": "DeepSeek V4.1 Flash"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "zai/glm-5.3",
|
|
111
|
+
"label": "GLM 5.3"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Models and account
|
|
3
3
|
description: What runs the AI in your wizards – an AI client on your computer, your own API keys, a local model or credits.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.11.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Settings → Models decides what runs the AI in your wizards. On your computer you set it up
|
|
@@ -127,11 +127,21 @@ images, video, voice and voice notes.
|
|
|
127
127
|
|---|---|
|
|
128
128
|
| Your subscription: Claude Code, Codex, Cursor Agent | The program on this computer answers, using your sign-in there. It works only through the tools of engenty wizards: it runs no commands and changes no files of its own |
|
|
129
129
|
| Your own API key: OpenAI, Anthropic, Google Gemini, Vercel AI Gateway | A model of that provider answers, on your key |
|
|
130
|
-
|
|
|
131
|
-
| engenty credits | The credits pay, through your account |
|
|
130
|
+
| engenty credits | The credits pay, through your account. engenty picks the models |
|
|
132
131
|
|
|
133
|
-
The list shows each program that is installed and signed in. Without a choice,
|
|
134
|
-
|
|
132
|
+
The list shows each program that is installed and signed in. Without a choice, Claude Code answers
|
|
133
|
+
where it is the source of your models, else the first way that is ready. With none ready, the chat
|
|
134
|
+
says what to set up. The chat has its own models, apart from Text & reasoning.
|
|
135
|
+
|
|
136
|
+
Under the choice, **Model** is what answers everyday questions and **Extra effort** is the more
|
|
137
|
+
capable one. Both default to the newest model of the way, which the runtime asks the server for
|
|
138
|
+
every day, so a new model needs no update. Pick another from the list, or **Another model …** to
|
|
139
|
+
type any name.
|
|
140
|
+
|
|
141
|
+
In a message box’s **+** menu, **Extra effort** switches the chat to the more capable model for the
|
|
142
|
+
conversation. The editor chat starts with it on, Goose with it off. When Goose sees demanding work,
|
|
143
|
+
it offers a button under its answer. In the cloud, the organization’s credits pay and engenty picks
|
|
144
|
+
the models.
|
|
135
145
|
|
|
136
146
|
## Account
|
|
137
147
|
|
|
@@ -14,6 +14,7 @@ import { invoiceSchema, receiptSchema } from "../engenty/document-scanner/schema
|
|
|
14
14
|
import { env } from "../env.js";
|
|
15
15
|
import { NotedError } from "../model-errors.js";
|
|
16
16
|
import { costOf, textModel } from "../models.js";
|
|
17
|
+
import { prompt } from "../prompts.js";
|
|
17
18
|
import { htmlToMarkdown } from "../render/convert.js";
|
|
18
19
|
export class UnreadableDocument extends NotedError {
|
|
19
20
|
}
|
|
@@ -92,20 +93,13 @@ class VisionProvider {
|
|
|
92
93
|
model: reader.model,
|
|
93
94
|
abortSignal: this.signal,
|
|
94
95
|
maxOutputTokens: 16_000,
|
|
95
|
-
system:
|
|
96
|
-
"You transcribe documents into clean Markdown, faithfully and completely.",
|
|
97
|
-
"Keep every number, date, name and amount exactly as printed. Tables become Markdown tables.",
|
|
98
|
-
"Do not summarise, do not comment, do not wrap the result in a code fence.",
|
|
99
|
-
'For a PDF with several pages, start each page with this line: <page-break number="N" total="T"></page-break>',
|
|
100
|
-
"If a part is illegible, write [unleserlich] there.",
|
|
101
|
-
"A photo that is no document (a room, an object, a damage): describe precisely what it shows instead — what is there, how many, materials, condition, visible defects — without guessing what cannot be seen.",
|
|
102
|
-
].join("\n"),
|
|
96
|
+
system: prompt("services", "ocr.system"),
|
|
103
97
|
messages: [
|
|
104
98
|
{
|
|
105
99
|
role: "user",
|
|
106
100
|
content: [
|
|
107
101
|
{ type: "file", data, mediaType: mimeType, filename: filename || "document" },
|
|
108
|
-
{ type: "text", text: "
|
|
102
|
+
{ type: "text", text: prompt("services", "ocr.user") },
|
|
109
103
|
],
|
|
110
104
|
},
|
|
111
105
|
],
|
|
@@ -218,10 +212,7 @@ async function read(input, opts) {
|
|
|
218
212
|
}
|
|
219
213
|
// --- structured extraction -----------------------------------------------------
|
|
220
214
|
/** The scanner's schemas say nothing about the currency; SaaS invoices come in several. */
|
|
221
|
-
const currency = z
|
|
222
|
-
.string()
|
|
223
|
-
.nullable()
|
|
224
|
-
.describe("ISO 4217 code of the currency the amounts are printed in (EUR, USD, …)");
|
|
215
|
+
const currency = z.string().nullable().describe(prompt("services", "scan.currency"));
|
|
225
216
|
const SCHEMAS = {
|
|
226
217
|
invoice: invoiceSchema.extend({ currency }),
|
|
227
218
|
receipt: receiptSchema.extend({ currency }),
|
|
@@ -238,7 +229,7 @@ export async function scanDocument(input, kind, opts = {}) {
|
|
|
238
229
|
model: extractor.model,
|
|
239
230
|
abortSignal: opts.signal,
|
|
240
231
|
output: Output.object({ schema: SCHEMAS[kind] }),
|
|
241
|
-
prompt:
|
|
232
|
+
prompt: `${prompt("services", "scan.prompt", { kind })}\n\nFile: ${input.name}\n\n${doc.markdown.slice(0, 30_000)}`,
|
|
242
233
|
});
|
|
243
234
|
await opts.charge?.(costOf(extractor, result.usage));
|
|
244
235
|
return result.output;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { decisionSchema, readObject, readSystemOne, } from "@engenty/wizards-shared/decision";
|
|
2
2
|
import { generateText, Output } from "ai";
|
|
3
3
|
import { costOf, systemOneAccess, textModel } from "../models.js";
|
|
4
|
+
import { prompt } from "../prompts.js";
|
|
4
5
|
export class DecisionError extends Error {
|
|
5
6
|
}
|
|
6
7
|
/** Roughly 60 000 tokens of state; decision models take 64 000. */
|
|
@@ -53,7 +54,7 @@ async function askLanguageModel(input, questions, signal) {
|
|
|
53
54
|
model: resolved.model,
|
|
54
55
|
abortSignal: signal,
|
|
55
56
|
output: Output.object({ schema: decisionSchema(questions) }),
|
|
56
|
-
prompt:
|
|
57
|
+
prompt: prompt("step", "decide.state", { state: stateText(input.state) }),
|
|
57
58
|
});
|
|
58
59
|
await input.charge?.(costOf(resolved, result.usage));
|
|
59
60
|
const answers = readObject(questions, result.output);
|
|
@@ -17,6 +17,7 @@ import { hasFfmpeg } from "../media/ffmpeg.js";
|
|
|
17
17
|
import { NotedError, noteOf, saidOf } from "../model-errors.js";
|
|
18
18
|
import { conversationAvailable, freeTierRefusal, freeTierText, ModelUnavailableError, noteFreeTierRefusal, } from "../models.js";
|
|
19
19
|
import { runEnded } from "../plugins/events.js";
|
|
20
|
+
import { prompt } from "../prompts.js";
|
|
20
21
|
import { reportRun } from "../services/manage-reports.js";
|
|
21
22
|
import { projectFiles } from "../services/project-files.js";
|
|
22
23
|
import { projectProfile } from "../services/projects.js";
|
|
@@ -448,14 +449,14 @@ async function decideBranch(run, step, state, signal) {
|
|
|
448
449
|
for (const i of rules) {
|
|
449
450
|
criteria[`r${i}`] = step.next?.[i]?.ask ?? "";
|
|
450
451
|
}
|
|
451
|
-
criteria.none = "
|
|
452
|
+
criteria.none = prompt("step", "decide.branch_none");
|
|
452
453
|
await emitEvent(run.id, step.id, "info", { code: "deciding" });
|
|
453
454
|
const decision = await decide({
|
|
454
455
|
state: runSummary(run, state),
|
|
455
456
|
questions: {
|
|
456
457
|
next: {
|
|
457
458
|
type: "choice",
|
|
458
|
-
instructions: "
|
|
459
|
+
instructions: prompt("step", "decide.branch"),
|
|
459
460
|
criteria,
|
|
460
461
|
},
|
|
461
462
|
},
|
|
@@ -498,7 +499,7 @@ async function decidePageFields(run, page, state, signal) {
|
|
|
498
499
|
for (const f of possible.filter((f) => f.ask)) {
|
|
499
500
|
questions[`f_${f.id}`] = {
|
|
500
501
|
type: "noul",
|
|
501
|
-
instructions: `Should the page ask "${f.label}"? It is asked when this holds: ${f.ask}`,
|
|
502
|
+
instructions: `Should the page ask "${f.label}"? It is asked when this holds: ${f.ask ?? ""}`,
|
|
502
503
|
};
|
|
503
504
|
}
|
|
504
505
|
for (const g of page.groups ?? []) {
|