wizards 0.2.42 → 0.2.44
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/app.js +37 -3
- package/apps/runtime/dist/authoring/guide.js +5 -2
- package/apps/runtime/dist/browser/fast/action-space.js +162 -0
- package/apps/runtime/dist/browser/fast/classifier.js +91 -0
- package/apps/runtime/dist/browser/fast/decide.js +171 -0
- package/apps/runtime/dist/browser/fast/driver.js +141 -0
- package/apps/runtime/dist/browser/fast/instructions.js +33 -0
- package/apps/runtime/dist/browser/fast/run.js +249 -0
- package/apps/runtime/dist/browser/fast/span-picker.js +153 -0
- package/apps/runtime/dist/browser/fast/text-helper.js +178 -0
- package/apps/runtime/dist/browser/snapshot.js +335 -0
- package/apps/runtime/dist/db/migrations/tenant/0011_runners.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0011_snapshot.json +2956 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +4 -0
- package/apps/runtime/dist/engine/resources.js +109 -0
- package/apps/runtime/dist/engine/runner.js +7 -3
- package/apps/runtime/dist/engine/steps.js +89 -10
- package/apps/runtime/dist/env.js +9 -0
- package/apps/runtime/dist/harness/claude.js +9 -1
- package/apps/runtime/dist/link-preview.js +4 -3
- package/apps/runtime/dist/mcp/tools.js +1 -1
- package/apps/runtime/dist/media/conversation.js +177 -0
- package/apps/runtime/dist/models.js +17 -0
- package/apps/runtime/dist/plugins/loader.js +48 -2
- package/apps/runtime/dist/plugins/registry.js +1 -0
- package/apps/runtime/dist/plugins/runs.js +205 -0
- package/apps/runtime/dist/routes/runs.js +206 -22
- package/apps/runtime/dist/routes/studio.js +12 -1
- package/apps/runtime/dist/services/cloud.js +1 -0
- package/apps/runtime/dist/services/runners.js +138 -0
- package/apps/runtime/dist/services/runs.js +83 -45
- package/apps/runtime/dist/services/wizard-icon.js +12 -0
- package/apps/runtime/dist/services/wizards.js +5 -1
- package/apps/runtime/dist/tools/browser.js +426 -97
- package/apps/runtime/dist/tools/index.js +50 -3
- package/apps/web/dist/assets/ChangelogDialog-C1_ZvuwE.js +1 -0
- package/apps/web/dist/assets/ChatView-DLG771z6.js +10 -0
- package/apps/web/dist/assets/{CreditsDialog-DPglouDr.js → CreditsDialog-Ce7Czhxq.js} +1 -1
- package/apps/web/dist/assets/EditorPage-CXx32-a7.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-CQN5acxA.js → FlowPreview-DgZiepFR.js} +1 -1
- package/apps/web/dist/assets/{Harness-BFxUFB7B.js → Harness-ffZUxkbb.js} +2 -2
- package/apps/web/dist/assets/HomePage-B3RVPuUu.js +1 -0
- package/apps/web/dist/assets/ImportWizard-CHlCjPEo.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BQW7PoZq.js +2 -0
- package/apps/web/dist/assets/ProjectPage-D-_A4iZz.js +2 -0
- package/apps/web/dist/assets/PublicRunner-sbya6PXg.js +1 -0
- package/apps/web/dist/assets/RunDrawer-BgLxai9C.js +4 -0
- package/apps/web/dist/assets/RunnerView-BVm9fL62.js +2 -0
- package/apps/web/dist/assets/SettingsPage-Ce6k9xDs.js +1 -0
- package/apps/web/dist/assets/SetupPage-CLymFxat.js +1 -0
- package/apps/web/dist/assets/SharePage-1Ni5ejt6.js +1 -0
- package/apps/web/dist/assets/ThemeSwitch-DN42WOTx.js +1 -0
- package/apps/web/dist/assets/arrow-right-BgKM1Npq.js +1 -0
- package/apps/web/dist/assets/changelog-CH4sN8Dm.js +1 -0
- package/apps/web/dist/assets/{circle-alert-B0rwkpC7.js → circle-alert-D_6s0Xgw.js} +1 -1
- package/apps/web/dist/assets/{copy-DgbMaHoj.js → copy-BAtcCufT.js} +1 -1
- package/apps/web/dist/assets/definition-CfFlylCM.js +56 -0
- package/apps/web/dist/assets/{external-link-pP6YfR9-.js → external-link-DitV3n6l.js} +1 -1
- package/apps/web/dist/assets/globe-CoQ1BSyl.js +1 -0
- package/apps/web/dist/assets/{image-D2X6TWdq.js → image-B1a1ax-P.js} +1 -1
- package/apps/web/dist/assets/index-B8VsYgck.js +78 -0
- package/apps/web/dist/assets/index-mB3Du8ho.css +1 -0
- package/apps/web/dist/assets/{lock-BG4mi_lJ.js → lock-DSPinlFN.js} +1 -1
- package/apps/web/dist/assets/{meta-BD9yulXs.js → meta-Bpe6vzmM.js} +1 -1
- package/apps/web/dist/assets/mouse-pointer-click-SHJL7g1i.js +1 -0
- package/apps/web/dist/assets/{pen-line-D54vxrGl.js → pen-line-DgSzJ60H.js} +1 -1
- package/apps/web/dist/assets/{refresh-cw-DvTgdpdf.js → refresh-cw-CWRkEENy.js} +1 -1
- package/apps/web/dist/assets/{session-CT1AZIlE.js → session-C24kIPr-.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-DJATAPGg.js → settings-menu-e8OMChHm.js} +1 -1
- package/apps/web/dist/assets/star-ClV5w6K4.js +1 -0
- package/apps/web/dist/assets/{trash-DAcf34LR.js → trash-t3O7FdUR.js} +1 -1
- package/apps/web/dist/assets/{type-BU0mWqf3.js → type-BbMmv2qL.js} +1 -1
- package/apps/web/dist/assets/ui-C4b__6Oo.js +9 -0
- package/apps/web/dist/assets/{video-C6qoFAAs.js → video-D04-GeyG.js} +1 -1
- package/apps/web/dist/assets/volume-2-FUU7z0rq.js +1 -0
- package/apps/web/dist/assets/{wand-sparkles-Bw4tu2An.js → wand-sparkles-BsD2e8V6.js} +1 -1
- package/apps/web/dist/embed.js +119 -4
- package/apps/web/dist/index.html +12 -11
- package/apps/web/dist/mcp/flow.html +45 -45
- package/modules/calls/dist/client.css +3 -0
- package/modules/calls/dist/client.js +1 -0
- package/modules/calls/engenty.plugin.json +8 -0
- package/modules/calls/migrations/0001_init.sql +26 -0
- package/modules/calls/package.json +25 -0
- package/modules/calls/src/openai.ts +155 -0
- package/modules/calls/src/plugin.ts +407 -0
- package/modules/calls/src/rules.ts +226 -0
- package/modules/calls/src/schema.ts +39 -0
- package/modules/calls/src/session.ts +353 -0
- package/modules/calls/src/store.ts +124 -0
- package/modules/calls/src/twilio.ts +90 -0
- package/modules/calls/tsconfig.json +10 -0
- package/modules/calls/ui/Settings.tsx +137 -0
- package/modules/calls/ui/app.ts +50 -0
- package/modules/calls/ui/messages.ts +81 -0
- package/modules/calls/ui/parts.tsx +36 -0
- package/modules/calls/ui/plugin.tsx +15 -0
- package/modules/sms/dist/client.css +3 -0
- package/modules/sms/dist/client.js +1 -0
- package/modules/sms/engenty.plugin.json +8 -0
- package/modules/sms/migrations/0001_init.sql +26 -0
- package/modules/sms/package.json +25 -0
- package/modules/sms/src/plugin.ts +324 -0
- package/modules/sms/src/schema.ts +26 -0
- package/modules/sms/src/store.ts +140 -0
- package/modules/sms/src/surface.ts +70 -0
- package/modules/sms/src/twilio.ts +130 -0
- package/modules/sms/tsconfig.json +10 -0
- package/modules/sms/ui/Settings.tsx +113 -0
- package/modules/sms/ui/Share.tsx +78 -0
- package/modules/sms/ui/app.ts +51 -0
- package/modules/sms/ui/messages.ts +72 -0
- package/modules/sms/ui/parts.tsx +36 -0
- package/modules/sms/ui/plugin.tsx +20 -0
- package/modules/whatsapp/dist/client.css +3 -0
- package/modules/whatsapp/dist/client.js +1 -0
- package/modules/whatsapp/engenty.plugin.json +8 -0
- package/modules/whatsapp/migrations/0001_init.sql +30 -0
- package/modules/whatsapp/package.json +25 -0
- package/modules/whatsapp/src/graph.ts +271 -0
- package/modules/whatsapp/src/inbound.ts +143 -0
- package/modules/whatsapp/src/plugin.ts +369 -0
- package/modules/whatsapp/src/schema.ts +32 -0
- package/modules/whatsapp/src/store.ts +156 -0
- package/modules/whatsapp/src/surface.ts +127 -0
- package/modules/whatsapp/tsconfig.json +10 -0
- package/modules/whatsapp/ui/Settings.tsx +141 -0
- package/modules/whatsapp/ui/Share.tsx +78 -0
- package/modules/whatsapp/ui/app.ts +54 -0
- package/modules/whatsapp/ui/messages.ts +82 -0
- package/modules/whatsapp/ui/parts.tsx +36 -0
- package/modules/whatsapp/ui/plugin.tsx +20 -0
- package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +259 -0
- package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +17 -0
- package/node_modules/@engenty-wizards/plugin-sdk/dist/thread.d.ts +174 -0
- package/node_modules/@engenty-wizards/plugin-sdk/dist/thread.js +816 -0
- package/node_modules/@engenty-wizards/plugin-sdk/package.json +2 -1
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +8 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +21 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +61 -3
- package/node_modules/@engenty-wizards/shared/dist/run.js +16 -0
- package/node_modules/@engenty-wizards/shared/dist/runners.d.ts +81 -0
- package/node_modules/@engenty-wizards/shared/dist/runners.js +146 -0
- package/package.json +1 -1
- package/apps/web/dist/assets/ChangelogDialog-BxRBTR8P.js +0 -1
- package/apps/web/dist/assets/EditorPage-BKAFzzWk.js +0 -3
- package/apps/web/dist/assets/HomePage-BZuwrr-b.js +0 -1
- package/apps/web/dist/assets/ImportWizard-JGMemER4.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-BwHAsJwj.js +0 -2
- package/apps/web/dist/assets/ProjectPage--ijr1jPE.js +0 -2
- package/apps/web/dist/assets/PublicRunner-D9Oe-_vs.js +0 -1
- package/apps/web/dist/assets/RunDrawer-BfociUm2.js +0 -4
- package/apps/web/dist/assets/RunnerView-D2b84UTY.js +0 -2
- package/apps/web/dist/assets/SettingsPage-9rk9IRdr.js +0 -1
- package/apps/web/dist/assets/SetupPage-BUJh_v9q.js +0 -1
- package/apps/web/dist/assets/SharePage-sNJ_s1RE.js +0 -1
- package/apps/web/dist/assets/ThemeSwitch-NDTEeh0R.js +0 -1
- package/apps/web/dist/assets/arrow-right-C1xLSnNa.js +0 -1
- package/apps/web/dist/assets/changelog-BSVi9hHS.js +0 -1
- package/apps/web/dist/assets/definition-FVgbAXOo.js +0 -56
- package/apps/web/dist/assets/index-CBjgitjd.js +0 -78
- package/apps/web/dist/assets/index-gTcC8eX6.css +0 -1
- package/apps/web/dist/assets/star-CaOg5c-D.js +0 -1
- package/apps/web/dist/assets/ui-Bxf6zX5k.js +0 -9
- package/apps/web/dist/assets/volume-2-Dw4p9Ln4.js +0 -1
|
@@ -56,6 +56,22 @@ export interface StudioSpaceSection {
|
|
|
56
56
|
hint?: () => string;
|
|
57
57
|
component: ComponentType;
|
|
58
58
|
}
|
|
59
|
+
/** What a runner's section of the share dialog is handed: the wizard the dialog is about. */
|
|
60
|
+
export interface StudioShareSectionProps {
|
|
61
|
+
wizard: {
|
|
62
|
+
id: string;
|
|
63
|
+
title: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A runner's own part of the share dialog, under the runner's row once it is switched on for
|
|
68
|
+
* the wizard: the keyword, the number, the link and its QR code. One per runner.
|
|
69
|
+
*/
|
|
70
|
+
export interface StudioShareSection {
|
|
71
|
+
/** The runner's id, as the server half registered it. */
|
|
72
|
+
runner: string;
|
|
73
|
+
component: ComponentType<StudioShareSectionProps>;
|
|
74
|
+
}
|
|
59
75
|
/** What a card in the assistant's chat is handed. */
|
|
60
76
|
export interface StudioAssistantCardProps<T = unknown> {
|
|
61
77
|
/** What the assistant tool returned. */
|
|
@@ -112,6 +128,7 @@ export interface StudioPluginContext {
|
|
|
112
128
|
registerNav(entry: StudioNavEntry): void;
|
|
113
129
|
registerSettingsSection(section: StudioSettingsSection): void;
|
|
114
130
|
registerSpaceSection(section: StudioSpaceSection): void;
|
|
131
|
+
registerShareSection(section: StudioShareSection): void;
|
|
115
132
|
registerAssistantCard(card: StudioAssistantCard): void;
|
|
116
133
|
/**
|
|
117
134
|
* A hook: the space the studio shows, `null` while it has none. A component that calls it draws
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { PluginRuns } from "./index.js";
|
|
2
|
+
/**
|
|
3
|
+
* A thread door: a wizard run in a messenger's thread, one message at a time. The door holds
|
|
4
|
+
* the conversation (which field is asked, what a reply means, when a page is sent, when the
|
|
5
|
+
* screen takes over, what is sent at the end); a channel plugin brings the surface (how a
|
|
6
|
+
* question is drawn there, how a file is fetched) and the plumbing (the webhook, the thread
|
|
7
|
+
* rows, the keywords). WhatsApp and SMS are two surfaces of the same door.
|
|
8
|
+
*/
|
|
9
|
+
export type ThreadLang = "de" | "en";
|
|
10
|
+
/** What the person sent, as every channel can say it. */
|
|
11
|
+
export interface ThreadInbound {
|
|
12
|
+
id: string;
|
|
13
|
+
/** The person's address on the channel: a number, an account. */
|
|
14
|
+
from: string;
|
|
15
|
+
name?: string | null;
|
|
16
|
+
at: number;
|
|
17
|
+
kind: "text" | "reply" | "image" | "document" | "video" | "audio" | "location" | "other";
|
|
18
|
+
text?: string;
|
|
19
|
+
/** The id of the option the person tapped, where the channel has buttons. */
|
|
20
|
+
replyId?: string;
|
|
21
|
+
replyTitle?: string;
|
|
22
|
+
media?: {
|
|
23
|
+
id: string;
|
|
24
|
+
mime: string;
|
|
25
|
+
filename?: string;
|
|
26
|
+
caption?: string;
|
|
27
|
+
};
|
|
28
|
+
location?: {
|
|
29
|
+
lat: number;
|
|
30
|
+
lng: number;
|
|
31
|
+
name?: string;
|
|
32
|
+
address?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ThreadOption {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
/** Of a multiple choice: picked already. */
|
|
39
|
+
picked?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** What the door says; the surface draws it as the channel allows. */
|
|
42
|
+
export type ThreadPrompt = {
|
|
43
|
+
kind: "text";
|
|
44
|
+
text: string;
|
|
45
|
+
}
|
|
46
|
+
/** A question with options: buttons, a list, or numbered lines — the surface decides. A typed number or title counts as a tap. */
|
|
47
|
+
| {
|
|
48
|
+
kind: "choice";
|
|
49
|
+
text: string;
|
|
50
|
+
options: ThreadOption[];
|
|
51
|
+
multiple?: boolean;
|
|
52
|
+
button: string;
|
|
53
|
+
} | {
|
|
54
|
+
kind: "location";
|
|
55
|
+
text: string;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "link";
|
|
58
|
+
text: string;
|
|
59
|
+
url: string;
|
|
60
|
+
label: string;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "media";
|
|
63
|
+
media: "image" | "document" | "video" | "audio";
|
|
64
|
+
url: string;
|
|
65
|
+
caption?: string;
|
|
66
|
+
filename?: string;
|
|
67
|
+
};
|
|
68
|
+
export interface ThreadWizard {
|
|
69
|
+
wizardId: string;
|
|
70
|
+
token: string;
|
|
71
|
+
title: string;
|
|
72
|
+
lang: ThreadLang;
|
|
73
|
+
/** The word that starts it in the thread. */
|
|
74
|
+
keyword: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ThreadPageDraft {
|
|
77
|
+
step: string;
|
|
78
|
+
values: Record<string, unknown>;
|
|
79
|
+
/** The field the last question was about. */
|
|
80
|
+
asking: string | null;
|
|
81
|
+
/** A multiple choice so far, and the files of a field that takes several. */
|
|
82
|
+
picks: string[];
|
|
83
|
+
files: string[];
|
|
84
|
+
}
|
|
85
|
+
export interface ThreadState {
|
|
86
|
+
lang: ThreadLang;
|
|
87
|
+
wizardId: string | null;
|
|
88
|
+
page: ThreadPageDraft | null;
|
|
89
|
+
/** At a review: which output to make again, then what should change. */
|
|
90
|
+
awaiting: "target" | "note" | null;
|
|
91
|
+
target: string | null;
|
|
92
|
+
/** What was said once already: "working on X", the review, the question, the link to the screen. */
|
|
93
|
+
said: string | null;
|
|
94
|
+
delivered: boolean;
|
|
95
|
+
/** The options of the last question, so a typed number or title counts as a tap. */
|
|
96
|
+
choices: ThreadOption[] | null;
|
|
97
|
+
}
|
|
98
|
+
export interface Thread {
|
|
99
|
+
/** The person's address on the channel. */
|
|
100
|
+
id: string;
|
|
101
|
+
name: string | null;
|
|
102
|
+
runId: string | null;
|
|
103
|
+
state: ThreadState;
|
|
104
|
+
lastInboundAt: number;
|
|
105
|
+
lastMessageId: string | null;
|
|
106
|
+
}
|
|
107
|
+
export declare const freshThreadState: (lang?: ThreadLang) => ThreadState;
|
|
108
|
+
export interface ThreadSurface {
|
|
109
|
+
/** The runner's id: kept on the run, and the person's channel. */
|
|
110
|
+
runner: string;
|
|
111
|
+
/** The field kinds the surface asks itself; any other on a page hands the page to the screen. */
|
|
112
|
+
asks: Iterable<string>;
|
|
113
|
+
send(thread: Thread, prompt: ThreadPrompt): Promise<void>;
|
|
114
|
+
/** A file the person sent, by what the inbound named. Without it, files hand off. */
|
|
115
|
+
media?(ref: NonNullable<ThreadInbound["media"]>): Promise<{
|
|
116
|
+
data: Uint8Array;
|
|
117
|
+
mime: string;
|
|
118
|
+
}>;
|
|
119
|
+
/** Whether something may be sent now with nobody having written (a messenger's window). Default: yes. */
|
|
120
|
+
mayDeliver?(thread: Thread): boolean;
|
|
121
|
+
/** When it may not: the link by other means (a template). True when something went out. */
|
|
122
|
+
reach?(thread: Thread, url: string): Promise<boolean>;
|
|
123
|
+
}
|
|
124
|
+
export interface ThreadDoorOptions {
|
|
125
|
+
runs: PluginRuns;
|
|
126
|
+
surface: ThreadSurface;
|
|
127
|
+
/** The wizards the door may start: the ones switched on, with their keywords. */
|
|
128
|
+
offered(): Promise<ThreadWizard[]>;
|
|
129
|
+
/** Keep hearing the run, and call `resume` for the thread when it changes. */
|
|
130
|
+
watch(thread: Thread): void;
|
|
131
|
+
unwatch(runId: string): void;
|
|
132
|
+
log: {
|
|
133
|
+
warn(...args: unknown[]): void;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/** `24.12.2026`, `24/12/26` or an ISO date, as the page's date input gives it. */
|
|
137
|
+
export declare function toIso(text: string): string | null;
|
|
138
|
+
/** Cut to a length, with an ellipsis where something was cut. */
|
|
139
|
+
export declare function clipText(text: string, max: number): string;
|
|
140
|
+
export declare class ThreadDoor {
|
|
141
|
+
private readonly o;
|
|
142
|
+
private readonly asks;
|
|
143
|
+
constructor(o: ThreadDoorOptions);
|
|
144
|
+
/** A message of the person arrived. The caller keeps the thread before and after. */
|
|
145
|
+
inbound(thread: Thread, given: ThreadInbound): Promise<void>;
|
|
146
|
+
/** The run changed while nobody wrote: a step ended, the page was filled on the screen. */
|
|
147
|
+
resume(thread: Thread): Promise<void>;
|
|
148
|
+
/** A typed number or the words of an option of the last question count as a tap on it. */
|
|
149
|
+
private asTap;
|
|
150
|
+
private report;
|
|
151
|
+
private start;
|
|
152
|
+
private stop;
|
|
153
|
+
private menu;
|
|
154
|
+
/** Where the run stands, and what to do about it. `msg`: what the person just sent, if anything. */
|
|
155
|
+
private step;
|
|
156
|
+
/** The run moved on after a command: wait a little for it, then look again. */
|
|
157
|
+
private after;
|
|
158
|
+
private page;
|
|
159
|
+
/** The question for a field, with the options it takes. `hint` first: what was wrong. */
|
|
160
|
+
private askField;
|
|
161
|
+
/** What the message means for the field: its value, a second try with a hint, or more to come. */
|
|
162
|
+
private take;
|
|
163
|
+
private upload;
|
|
164
|
+
private transcribe;
|
|
165
|
+
private review;
|
|
166
|
+
private ask;
|
|
167
|
+
/** The link to the run page, for what the thread cannot do. */
|
|
168
|
+
private handoff;
|
|
169
|
+
/** One output as a thread can carry it: text, pictures, documents, the picture of a widget. */
|
|
170
|
+
private sendOutput;
|
|
171
|
+
/** The run reached its end: what it made, then the link to all of it. */
|
|
172
|
+
private deliver;
|
|
173
|
+
private send;
|
|
174
|
+
}
|