@engenty/wizards-runtime 0.0.0-stage → 0.7.5
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/LICENSE +110 -0
- package/README.md +214 -2
- package/apps/runtime/dist/agents/architect.js +444 -0
- package/apps/runtime/dist/agents/studio-assistant.js +883 -0
- package/apps/runtime/dist/agents/subscription.js +207 -0
- package/apps/runtime/dist/agents/thought.js +21 -0
- package/apps/runtime/dist/agents/website.js +480 -0
- package/apps/runtime/dist/app.js +359 -0
- package/apps/runtime/dist/apple/wizards-apple +0 -0
- package/apps/runtime/dist/assistant/browser.js +26 -0
- package/apps/runtime/dist/assistant/docs.js +158 -0
- package/apps/runtime/dist/assistant/knows.js +353 -0
- package/apps/runtime/dist/assistant/primer.js +26 -0
- package/apps/runtime/dist/assistant/runs.js +24 -0
- package/apps/runtime/dist/auth/account.js +175 -0
- package/apps/runtime/dist/auth/device.js +112 -0
- package/apps/runtime/dist/auth/index.js +358 -0
- package/apps/runtime/dist/auth/keys.js +55 -0
- package/apps/runtime/dist/auth/local-ticket.js +26 -0
- package/apps/runtime/dist/authoring/example.js +74 -0
- package/apps/runtime/dist/authoring/guide.js +433 -0
- package/apps/runtime/dist/authoring/ops.js +117 -0
- package/apps/runtime/dist/browser/fast/action-space.js +160 -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/cli/account.js +385 -0
- package/apps/runtime/dist/cli/autostart.js +182 -0
- package/apps/runtime/dist/cli/autoupdate.js +221 -0
- package/apps/runtime/dist/cli/clients.js +44 -0
- package/apps/runtime/dist/cli/connect.js +540 -0
- package/apps/runtime/dist/cli/environment.js +93 -0
- package/apps/runtime/dist/cli/exec.js +45 -0
- package/apps/runtime/dist/cli/features.js +50 -0
- package/apps/runtime/dist/cli/home.js +88 -0
- package/apps/runtime/dist/cli/install-env.js +33 -0
- package/apps/runtime/dist/cli/machine.js +107 -0
- package/apps/runtime/dist/cli/main.js +222 -0
- package/apps/runtime/dist/cli/mcp.js +136 -0
- package/apps/runtime/dist/cli/menu.js +202 -0
- package/apps/runtime/dist/cli/processes.js +72 -0
- package/apps/runtime/dist/cli/report.js +66 -0
- package/apps/runtime/dist/cli/setup.js +335 -0
- package/apps/runtime/dist/cli/start.js +276 -0
- package/apps/runtime/dist/cli/status.js +203 -0
- package/apps/runtime/dist/cli/ui.js +59 -0
- package/apps/runtime/dist/cli/uninstall-main.js +20 -0
- package/apps/runtime/dist/cli/uninstall.js +231 -0
- package/apps/runtime/dist/cli/update.js +86 -0
- package/apps/runtime/dist/cli/validate.js +75 -0
- package/apps/runtime/dist/cli/versions.js +123 -0
- package/apps/runtime/dist/connectors/builtin.js +86 -0
- package/apps/runtime/dist/connectors/external.js +409 -0
- package/apps/runtime/dist/connectors/gmail.js +107 -0
- package/apps/runtime/dist/connectors/imap.js +261 -0
- package/apps/runtime/dist/connectors/index.js +325 -0
- package/apps/runtime/dist/connectors/mail.js +72 -0
- package/apps/runtime/dist/connectors/outlook.js +90 -0
- package/apps/runtime/dist/connectors/plugin-connections.js +343 -0
- package/apps/runtime/dist/connectors/via-account.js +65 -0
- package/apps/runtime/dist/credits/credits.js +100 -0
- package/apps/runtime/dist/credits/estimate.js +152 -0
- package/apps/runtime/dist/db/adopt.js +149 -0
- package/apps/runtime/dist/db/client.js +173 -0
- package/apps/runtime/dist/db/control-schema.js +133 -0
- package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +47 -0
- package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +41 -0
- package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +1 -0
- package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +3 -0
- package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +6 -0
- package/apps/runtime/dist/db/migrations/control/0005_chilly_oracle.sql +1 -0
- package/apps/runtime/dist/db/migrations/control/0006_sleepy_mojo.sql +1 -0
- package/apps/runtime/dist/db/migrations/control/0007_common_the_hand.sql +15 -0
- package/apps/runtime/dist/db/migrations/control/0008_runner.sql +8 -0
- package/apps/runtime/dist/db/migrations/control/0009_plugin_claim.sql +9 -0
- package/apps/runtime/dist/db/migrations/control/0010_tan_snowbird.sql +6 -0
- package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +311 -0
- package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +599 -0
- package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +607 -0
- package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +311 -0
- package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +350 -0
- package/apps/runtime/dist/db/migrations/control/meta/0005_snapshot.json +358 -0
- package/apps/runtime/dist/db/migrations/control/meta/0006_snapshot.json +365 -0
- package/apps/runtime/dist/db/migrations/control/meta/0007_snapshot.json +460 -0
- package/apps/runtime/dist/db/migrations/control/meta/0008_snapshot.json +505 -0
- package/apps/runtime/dist/db/migrations/control/meta/0009_snapshot.json +561 -0
- package/apps/runtime/dist/db/migrations/control/meta/0010_snapshot.json +600 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +83 -0
- package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +188 -0
- package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +52 -0
- package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +6 -0
- package/apps/runtime/dist/db/migrations/tenant/0005_reflective_forgotten_one.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0006_hard_war_machine.sql +30 -0
- package/apps/runtime/dist/db/migrations/tenant/0007_space_data.sql +43 -0
- package/apps/runtime/dist/db/migrations/tenant/0008_run_event_note.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0009_knowledge.sql +104 -0
- package/apps/runtime/dist/db/migrations/tenant/0010_plugin_connection.sql +15 -0
- package/apps/runtime/dist/db/migrations/tenant/0011_runners.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0012_assistant_chat.sql +40 -0
- package/apps/runtime/dist/db/migrations/tenant/0013_run_origin.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0014_run_answer.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0015_device_calls.sql +13 -0
- package/apps/runtime/dist/db/migrations/tenant/0016_even_trish_tilby.sql +12 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +1323 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +1330 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +1337 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +1605 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +1645 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0005_snapshot.json +1659 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0006_snapshot.json +1696 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0007_snapshot.json +2012 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0008_snapshot.json +2019 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0009_snapshot.json +2837 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0010_snapshot.json +2942 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0011_snapshot.json +2956 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0012_snapshot.json +3132 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0013_snapshot.json +3139 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0014_snapshot.json +3154 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0015_snapshot.json +3243 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0016_snapshot.json +3326 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +125 -0
- package/apps/runtime/dist/db/schema.js +602 -0
- package/apps/runtime/dist/debug.js +196 -0
- package/apps/runtime/dist/docs/dev/index.md +41 -0
- package/apps/runtime/dist/docs/dev/meta.json +7 -0
- package/apps/runtime/dist/docs/dev/plugins/connections.md +74 -0
- package/apps/runtime/dist/docs/dev/plugins/events.md +89 -0
- package/apps/runtime/dist/docs/dev/plugins/examples.md +101 -0
- package/apps/runtime/dist/docs/dev/plugins/index.md +78 -0
- package/apps/runtime/dist/docs/dev/plugins/layout.md +90 -0
- package/apps/runtime/dist/docs/dev/plugins/meta.json +28 -0
- package/apps/runtime/dist/docs/dev/plugins/quick-start.md +94 -0
- package/apps/runtime/dist/docs/dev/plugins/reference.md +348 -0
- package/apps/runtime/dist/docs/dev/plugins/reloading.md +76 -0
- package/apps/runtime/dist/docs/dev/plugins/routes.md +185 -0
- package/apps/runtime/dist/docs/dev/plugins/runners.md +230 -0
- package/apps/runtime/dist/docs/dev/plugins/server.md +281 -0
- package/apps/runtime/dist/docs/dev/plugins/shipping.md +79 -0
- package/apps/runtime/dist/docs/dev/plugins/space.md +297 -0
- package/apps/runtime/dist/docs/dev/plugins/starters.md +70 -0
- package/apps/runtime/dist/docs/dev/plugins/studio.md +363 -0
- package/apps/runtime/dist/docs/dev/plugins/styling.md +129 -0
- package/apps/runtime/dist/docs/dev/plugins/tables.md +104 -0
- package/apps/runtime/dist/docs/dev/plugins/tools.md +139 -0
- package/apps/runtime/dist/docs/dev/wizard-format.md +125 -0
- package/apps/runtime/dist/docs/meta.json +3 -0
- package/apps/runtime/dist/docs/user/ai-apps.md +112 -0
- package/apps/runtime/dist/docs/user/assistant.md +77 -0
- package/apps/runtime/dist/docs/user/build-a-wizard.md +116 -0
- package/apps/runtime/dist/docs/user/command-line.md +83 -0
- package/apps/runtime/dist/docs/user/connectors.md +90 -0
- package/apps/runtime/dist/docs/user/create-account.md +52 -0
- package/apps/runtime/dist/docs/user/data.md +66 -0
- package/apps/runtime/dist/docs/user/first-start.md +60 -0
- package/apps/runtime/dist/docs/user/index.md +49 -0
- package/apps/runtime/dist/docs/user/install.md +123 -0
- package/apps/runtime/dist/docs/user/local-only.md +42 -0
- package/apps/runtime/dist/docs/user/meta.json +32 -0
- package/apps/runtime/dist/docs/user/models.md +156 -0
- package/apps/runtime/dist/docs/user/plugins.md +71 -0
- package/apps/runtime/dist/docs/user/run.md +98 -0
- package/apps/runtime/dist/docs/user/server.md +52 -0
- package/apps/runtime/dist/docs/user/space.md +126 -0
- package/apps/runtime/dist/docs/user/steps.md +220 -0
- package/apps/runtime/dist/docs/user/test-and-share.md +224 -0
- package/apps/runtime/dist/docs/user/troubleshooting.md +67 -0
- package/apps/runtime/dist/docs/user/wordpress.md +121 -0
- package/apps/runtime/dist/documents/parse.js +246 -0
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +193 -0
- package/apps/runtime/dist/engenty/connections-external/errors.js +11 -0
- package/apps/runtime/dist/engenty/connections-external/import-service.js +270 -0
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +34 -0
- package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +185 -0
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +63 -0
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +130 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +143 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +143 -0
- package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +119 -0
- package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +88 -0
- package/apps/runtime/dist/engenty/connections-external/registry-client.js +336 -0
- package/apps/runtime/dist/engenty/connections-external/registry-source.js +82 -0
- package/apps/runtime/dist/engenty/connections-external/types.js +7 -0
- package/apps/runtime/dist/engenty/connections-github/connector.js +209 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +381 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +94 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +290 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +567 -0
- package/apps/runtime/dist/engenty/connections-google/definitions.js +11 -0
- package/apps/runtime/dist/engenty/connections-google/shared.js +73 -0
- package/apps/runtime/dist/engenty/connections-hubspot/connector.js +140 -0
- package/apps/runtime/dist/engenty/connections-microsoft/action.js +17 -0
- package/apps/runtime/dist/engenty/connections-microsoft/graph.js +114 -0
- package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +286 -0
- package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +492 -0
- package/apps/runtime/dist/engenty/connections-s3/s3.js +328 -0
- package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +86 -0
- package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +150 -0
- package/apps/runtime/dist/engenty/connections-sdk/registry.js +89 -0
- package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +84 -0
- package/apps/runtime/dist/engenty/connections-sdk/types.js +30 -0
- package/apps/runtime/dist/engenty/connections-slack/connector.js +360 -0
- package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +178 -0
- package/apps/runtime/dist/engenty/csv-import/import-sources.js +87 -0
- package/apps/runtime/dist/engenty/csv-import/parse-csv.js +129 -0
- package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +20 -0
- package/apps/runtime/dist/engenty/csv-import/types.js +1 -0
- package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +159 -0
- package/apps/runtime/dist/engenty/doc-converter/interface.js +9 -0
- package/apps/runtime/dist/engenty/doc-converter/page-break.js +92 -0
- package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +72 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +30 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +4 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +73 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +63 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +40 -0
- package/apps/runtime/dist/engenty/search-index/chunks.js +164 -0
- package/apps/runtime/dist/engenty/search-index/contracts.js +9 -0
- package/apps/runtime/dist/engenty/shims/connections-sdk.js +39 -0
- package/apps/runtime/dist/engenty/shims/plugin-sdk.js +1 -0
- package/apps/runtime/dist/engenty/shims/web-ingest.js +19 -0
- package/apps/runtime/dist/engenty/web-ingest/ssrf.js +277 -0
- package/apps/runtime/dist/engine/asks.js +82 -0
- package/apps/runtime/dist/engine/decide.js +82 -0
- package/apps/runtime/dist/engine/device.js +194 -0
- package/apps/runtime/dist/engine/events.js +128 -0
- package/apps/runtime/dist/engine/input.js +208 -0
- package/apps/runtime/dist/engine/owner.js +32 -0
- package/apps/runtime/dist/engine/prepare.js +90 -0
- package/apps/runtime/dist/engine/push.js +58 -0
- package/apps/runtime/dist/engine/requirements.js +355 -0
- package/apps/runtime/dist/engine/resources.js +198 -0
- package/apps/runtime/dist/engine/runner.js +970 -0
- package/apps/runtime/dist/engine/steps.js +1000 -0
- package/apps/runtime/dist/engine/surface.js +91 -0
- package/apps/runtime/dist/engine/template.js +240 -0
- package/apps/runtime/dist/engine/types.js +4 -0
- package/apps/runtime/dist/env.js +295 -0
- package/apps/runtime/dist/features.js +123 -0
- package/apps/runtime/dist/files/blobs.js +22 -0
- package/apps/runtime/dist/files/objects.js +86 -0
- package/apps/runtime/dist/files/storage.js +120 -0
- package/apps/runtime/dist/files/web-images.js +101 -0
- package/apps/runtime/dist/film/project.js +257 -0
- package/apps/runtime/dist/film/skills.js +91 -0
- package/apps/runtime/dist/film/sounds.js +122 -0
- package/apps/runtime/dist/film/step.js +289 -0
- package/apps/runtime/dist/film/tools.js +99 -0
- package/apps/runtime/dist/geocode.js +58 -0
- package/apps/runtime/dist/harness/antigravity.js +129 -0
- package/apps/runtime/dist/harness/apple.js +270 -0
- package/apps/runtime/dist/harness/claude.js +147 -0
- package/apps/runtime/dist/harness/codex.js +229 -0
- package/apps/runtime/dist/harness/cursor.js +93 -0
- package/apps/runtime/dist/harness/env.js +124 -0
- package/apps/runtime/dist/harness/index.js +95 -0
- package/apps/runtime/dist/harness/model.js +279 -0
- package/apps/runtime/dist/harness/prompt.js +121 -0
- package/apps/runtime/dist/harness/terminal.js +194 -0
- package/apps/runtime/dist/harness/types.js +7 -0
- package/apps/runtime/dist/index.js +113 -0
- package/apps/runtime/dist/limits.js +81 -0
- package/apps/runtime/dist/link-preview.js +60 -0
- package/apps/runtime/dist/log.js +106 -0
- package/apps/runtime/dist/manage.js +249 -0
- package/apps/runtime/dist/mcp/auth.js +161 -0
- package/apps/runtime/dist/mcp/bridge.js +59 -0
- package/apps/runtime/dist/mcp/flow-app.js +97 -0
- package/apps/runtime/dist/mcp/handler.js +54 -0
- package/apps/runtime/dist/mcp/scopes.js +14 -0
- package/apps/runtime/dist/mcp/seen.js +65 -0
- package/apps/runtime/dist/mcp/tools.js +572 -0
- package/apps/runtime/dist/media/conversation.js +167 -0
- package/apps/runtime/dist/media/ffmpeg.js +121 -0
- package/apps/runtime/dist/media/generate.js +120 -0
- package/apps/runtime/dist/media/marking.js +121 -0
- package/apps/runtime/dist/media/transcribe.js +198 -0
- package/apps/runtime/dist/model-errors.js +42 -0
- package/apps/runtime/dist/models.js +1164 -0
- package/apps/runtime/dist/plugin.js +61 -0
- package/apps/runtime/dist/plugins/channels.js +78 -0
- package/apps/runtime/dist/plugins/claims.js +56 -0
- package/apps/runtime/dist/plugins/discovery.js +155 -0
- package/apps/runtime/dist/plugins/events.js +63 -0
- package/apps/runtime/dist/plugins/jobs.js +64 -0
- package/apps/runtime/dist/plugins/loader.js +508 -0
- package/apps/runtime/dist/plugins/migrations.js +69 -0
- package/apps/runtime/dist/plugins/pro-keys.js +34 -0
- package/apps/runtime/dist/plugins/pro-state.js +83 -0
- package/apps/runtime/dist/plugins/pro.js +310 -0
- package/apps/runtime/dist/plugins/public.js +44 -0
- package/apps/runtime/dist/plugins/registry.js +122 -0
- package/apps/runtime/dist/plugins/runs.js +210 -0
- package/apps/runtime/dist/render/browser-path.js +54 -0
- package/apps/runtime/dist/render/chromium.js +98 -0
- package/apps/runtime/dist/render/convert.js +158 -0
- package/apps/runtime/dist/render/downloads.js +299 -0
- package/apps/runtime/dist/render/guard.js +25 -0
- package/apps/runtime/dist/render/shaped.js +137 -0
- package/apps/runtime/dist/routes/api.js +440 -0
- package/apps/runtime/dist/routes/debug.js +42 -0
- package/apps/runtime/dist/routes/delivery.js +90 -0
- package/apps/runtime/dist/routes/internal.js +81 -0
- package/apps/runtime/dist/routes/lang.js +25 -0
- package/apps/runtime/dist/routes/marketplace.js +43 -0
- package/apps/runtime/dist/routes/plugin-public.js +113 -0
- package/apps/runtime/dist/routes/plugins.js +212 -0
- package/apps/runtime/dist/routes/runs.js +1422 -0
- package/apps/runtime/dist/routes/studio.js +1629 -0
- package/apps/runtime/dist/routes/wizard-stream.js +30 -0
- package/apps/runtime/dist/running.js +39 -0
- package/apps/runtime/dist/sandbox/docker.js +75 -0
- package/apps/runtime/dist/sandbox/index.js +23 -0
- package/apps/runtime/dist/sandbox/types.js +1 -0
- package/apps/runtime/dist/secrets/crypto.js +28 -0
- package/apps/runtime/dist/secrets/signing.js +52 -0
- package/apps/runtime/dist/secrets/vault.js +59 -0
- package/apps/runtime/dist/services/access.js +88 -0
- package/apps/runtime/dist/services/api.js +248 -0
- package/apps/runtime/dist/services/architect.js +95 -0
- package/apps/runtime/dist/services/assistant-chats.js +311 -0
- package/apps/runtime/dist/services/brand.js +85 -0
- package/apps/runtime/dist/services/cloud.js +456 -0
- package/apps/runtime/dist/services/draft-events.js +27 -0
- package/apps/runtime/dist/services/engenty-shapes.js +71 -0
- package/apps/runtime/dist/services/errors.js +29 -0
- package/apps/runtime/dist/services/files.js +178 -0
- package/apps/runtime/dist/services/knowledge-model.js +559 -0
- package/apps/runtime/dist/services/knowledge.js +721 -0
- package/apps/runtime/dist/services/links.js +16 -0
- package/apps/runtime/dist/services/marketplace.js +492 -0
- package/apps/runtime/dist/services/onboarding.js +152 -0
- package/apps/runtime/dist/services/package-file.js +82 -0
- package/apps/runtime/dist/services/package.js +170 -0
- package/apps/runtime/dist/services/profile.js +51 -0
- package/apps/runtime/dist/services/project-files.js +439 -0
- package/apps/runtime/dist/services/project-index.js +707 -0
- package/apps/runtime/dist/services/projects.js +387 -0
- package/apps/runtime/dist/services/relevance.js +58 -0
- package/apps/runtime/dist/services/runners.js +178 -0
- package/apps/runtime/dist/services/runs.js +524 -0
- package/apps/runtime/dist/services/shares.js +130 -0
- package/apps/runtime/dist/services/site.js +270 -0
- package/apps/runtime/dist/services/space-categories.js +861 -0
- package/apps/runtime/dist/services/space-data.js +792 -0
- package/apps/runtime/dist/services/space-origin.js +207 -0
- package/apps/runtime/dist/services/spaces.js +656 -0
- package/apps/runtime/dist/services/translations.js +306 -0
- package/apps/runtime/dist/services/widgets.js +34 -0
- package/apps/runtime/dist/services/wizard-icon.js +157 -0
- package/apps/runtime/dist/services/wizards.js +420 -0
- package/apps/runtime/dist/settings.js +16 -0
- package/apps/runtime/dist/store/errors.js +4 -0
- package/apps/runtime/dist/store/index.js +299 -0
- package/apps/runtime/dist/store/shared-lists.js +123 -0
- package/apps/runtime/dist/tenants/control.js +238 -0
- package/apps/runtime/dist/tenants/tenant.js +26 -0
- package/apps/runtime/dist/texts.js +207 -0
- package/apps/runtime/dist/tools/browser.js +703 -0
- package/apps/runtime/dist/tools/connector.js +204 -0
- package/apps/runtime/dist/tools/index.js +291 -0
- package/apps/runtime/dist/tools/mail.js +104 -0
- package/apps/runtime/dist/tools/net-guard.js +170 -0
- package/apps/runtime/dist/tools/pages.js +81 -0
- package/apps/runtime/dist/tools/plugin.js +180 -0
- package/apps/runtime/dist/tools/project.js +154 -0
- package/apps/runtime/dist/tools/shared.js +69 -0
- package/apps/runtime/dist/tools/store.js +238 -0
- package/apps/runtime/dist/update.js +113 -0
- package/apps/runtime/dist/widgets/bundle.js +99 -0
- package/apps/runtime/dist/widgets/render.js +329 -0
- package/apps/runtime/dist/widgets/runtime.js +108 -0
- package/apps/runtime/dist/widgets/script.js +30 -0
- package/apps/runtime/dist/widgets/step.js +223 -0
- package/apps/web/dist/ai-labels/ai-black.svg +20 -0
- package/apps/web/dist/ai-labels/ai-generated-black.svg +31 -0
- package/apps/web/dist/ai-labels/ai-generated-white.svg +32 -0
- package/apps/web/dist/ai-labels/ai-modified-black.svg +30 -0
- package/apps/web/dist/ai-labels/ai-modified-white.svg +31 -0
- package/apps/web/dist/ai-labels/ai-white.svg +21 -0
- package/apps/web/dist/assets/AboutDialog-D4mvc-zu.js +1 -0
- package/apps/web/dist/assets/ChangelogDialog-DLqpJsF6.js +1 -0
- package/apps/web/dist/assets/ChatView-3laypRcE.js +10 -0
- package/apps/web/dist/assets/EditorPage-BalA5U2Y.js +3 -0
- package/apps/web/dist/assets/FlowPreview-CusP7ci9.js +1 -0
- package/apps/web/dist/assets/Harness-BrP-ENHg.css +1 -0
- package/apps/web/dist/assets/Harness-iYLtOLaK.js +16 -0
- package/apps/web/dist/assets/NewWizardChannels-CbwJ9A56.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BOBYiB9i.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-CUwCiVIr.js +1 -0
- package/apps/web/dist/assets/ProjectPage-Bb16MdYG.js +1 -0
- package/apps/web/dist/assets/PublicRunner-BCt7Q6C-.js +1 -0
- package/apps/web/dist/assets/ReadOnly-kIHX2TEy.js +1 -0
- package/apps/web/dist/assets/RunDrawer-hZ9oeSXu.js +4 -0
- package/apps/web/dist/assets/RunnerView-DUS9fPmx.js +1 -0
- package/apps/web/dist/assets/SettingsPage-BzwR50fi.js +1 -0
- package/apps/web/dist/assets/SetupPage-gAp7rPxp.js +1 -0
- package/apps/web/dist/assets/SharePage-DqZWHva_.js +1 -0
- package/apps/web/dist/assets/changelog-DugmCNSf.js +1 -0
- package/apps/web/dist/assets/engenty-eXZ-EAwd.js +1 -0
- package/apps/web/dist/assets/esm-DXeMu8Lb.js +7 -0
- package/apps/web/dist/assets/fluffy-engenty-ClRou7yu.js +456 -0
- package/apps/web/dist/assets/index-AfUa8xKD.css +1 -0
- package/apps/web/dist/assets/index-C5Sm7tTR.js +14 -0
- package/apps/web/dist/assets/jsx-runtime-BNakU3Ej.js +1 -0
- package/apps/web/dist/assets/lock-R_CfU0Xo.js +1 -0
- package/apps/web/dist/assets/oss-credits-cZ9NUaLZ.js +1 -0
- package/apps/web/dist/assets/pdfmake-Cx9scTbD.js +228 -0
- package/apps/web/dist/assets/phone-CgrIS4_-.js +1 -0
- package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +1 -0
- package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +98 -0
- package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +1 -0
- package/apps/web/dist/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/apps/web/dist/assets/settings-menu-2IMOOlLl.js +1 -0
- package/apps/web/dist/assets/ui-dzGvc3xk.js +137 -0
- package/apps/web/dist/assets/upload-BSuTilFF.js +1 -0
- package/apps/web/dist/assets/vfs_fonts-DllDSYt1.js +1 -0
- package/apps/web/dist/embed.js +266 -0
- package/apps/web/dist/favicon.svg +1 -0
- package/apps/web/dist/icons/apple-touch-icon.png +0 -0
- package/apps/web/dist/icons/icon-192.png +0 -0
- package/apps/web/dist/icons/icon-512.png +0 -0
- package/apps/web/dist/icons/icon-maskable-512.png +0 -0
- package/apps/web/dist/index.html +48 -0
- package/apps/web/dist/install.sh +577 -0
- package/apps/web/dist/manifest.webmanifest +21 -0
- package/apps/web/dist/mcp/flow.html +980 -0
- package/apps/web/dist/sw.js +15 -0
- package/bin/wizards.mjs +288 -0
- package/modules/README.md +15 -0
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +1150 -0
- package/node_modules/@engenty/wizards/dist/plugin/index.js +4 -0
- package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +322 -0
- package/node_modules/@engenty/wizards/dist/plugin/studio.js +4 -0
- package/node_modules/@engenty/wizards/dist/plugin/thread.d.ts +174 -0
- package/node_modules/@engenty/wizards/dist/plugin/thread.js +821 -0
- package/node_modules/@engenty/wizards/package.json +11 -0
- package/node_modules/@engenty-wizards/shared/dist/assistant.d.ts +174 -0
- package/node_modules/@engenty-wizards/shared/dist/assistant.js +65 -0
- package/node_modules/@engenty-wizards/shared/dist/changes.d.ts +22 -0
- package/node_modules/@engenty-wizards/shared/dist/changes.js +61 -0
- package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +77 -0
- package/node_modules/@engenty-wizards/shared/dist/connectors.js +2 -0
- package/node_modules/@engenty-wizards/shared/dist/decision.d.ts +76 -0
- package/node_modules/@engenty-wizards/shared/dist/decision.js +147 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +2922 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +1920 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +5 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +132 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +11 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +209 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +532 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +217 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +3 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +3 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +166 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +99 -0
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +78 -0
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +70 -0
- package/node_modules/@engenty-wizards/shared/dist/features.d.ts +41 -0
- package/node_modules/@engenty-wizards/shared/dist/features.js +89 -0
- package/node_modules/@engenty-wizards/shared/dist/fit.d.ts +71 -0
- package/node_modules/@engenty-wizards/shared/dist/fit.js +382 -0
- package/node_modules/@engenty-wizards/shared/dist/json-schema.d.ts +14 -0
- package/node_modules/@engenty-wizards/shared/dist/json-schema.js +66 -0
- package/node_modules/@engenty-wizards/shared/dist/knowledge.d.ts +199 -0
- package/node_modules/@engenty-wizards/shared/dist/knowledge.js +68 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +35 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +107 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +20 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +136 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +227 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +354 -0
- package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +7 -0
- package/node_modules/@engenty-wizards/shared/dist/merge.js +40 -0
- package/node_modules/@engenty-wizards/shared/dist/numbers.d.ts +24 -0
- package/node_modules/@engenty-wizards/shared/dist/numbers.js +54 -0
- package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +224 -0
- package/node_modules/@engenty-wizards/shared/dist/projects.js +319 -0
- package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +101 -0
- package/node_modules/@engenty-wizards/shared/dist/providers.js +390 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +680 -0
- package/node_modules/@engenty-wizards/shared/dist/run.js +620 -0
- package/node_modules/@engenty-wizards/shared/dist/runner-texts.d.ts +546 -0
- package/node_modules/@engenty-wizards/shared/dist/runner-texts.js +523 -0
- package/node_modules/@engenty-wizards/shared/dist/runners.d.ts +93 -0
- package/node_modules/@engenty-wizards/shared/dist/runners.js +146 -0
- package/node_modules/@engenty-wizards/shared/dist/shape.d.ts +102 -0
- package/node_modules/@engenty-wizards/shared/dist/shape.js +318 -0
- package/node_modules/@engenty-wizards/shared/dist/space-data.d.ts +89 -0
- package/node_modules/@engenty-wizards/shared/dist/space-data.js +47 -0
- package/node_modules/@engenty-wizards/shared/dist/store.d.ts +117 -0
- package/node_modules/@engenty-wizards/shared/dist/store.js +81 -0
- package/node_modules/@engenty-wizards/shared/dist/surface.d.ts +115 -0
- package/node_modules/@engenty-wizards/shared/dist/surface.js +442 -0
- package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +45 -0
- package/node_modules/@engenty-wizards/shared/dist/texts.js +54 -0
- package/node_modules/@engenty-wizards/shared/dist/translation.d.ts +23 -0
- package/node_modules/@engenty-wizards/shared/dist/translation.js +154 -0
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.d.ts +48 -0
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.js +49 -0
- package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +16 -0
- package/node_modules/@engenty-wizards/shared/dist/workspace.js +51 -0
- package/node_modules/@engenty-wizards/shared/package.json +10 -0
- package/package.json +77 -4
- package/plugin/.claude-plugin/plugin.json +9 -0
- package/plugin/.mcp.json +8 -0
- package/plugin/commands/wizard.md +8 -0
- package/plugin/skills/build-wizard/SKILL.md +27 -0
- package/plugin/skills/use-wizard/SKILL.md +18 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Routes
|
|
3
|
+
description: HTTP routes below the plugin's own address – signed in, inside the person's tenant.
|
|
4
|
+
version: 0.5.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
A plugin’s routes live below `/api/studio/plugins/<id>`, and for programs with a key below
|
|
8
|
+
`/api/v1/plugins/<id>`. Every request is a signed-in person’s, inside that person’s tenant.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
// GET /api/studio/plugins/contacts/
|
|
12
|
+
server.registerHttpRoute({
|
|
13
|
+
method: "GET",
|
|
14
|
+
path: "/",
|
|
15
|
+
handler: async () => ({
|
|
16
|
+
contacts: await db().select().from(person).orderBy(desc(person.seenAt)).limit(200),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// DELETE /api/studio/plugins/contacts/42
|
|
21
|
+
server.registerHttpRoute({
|
|
22
|
+
method: "DELETE",
|
|
23
|
+
path: "/:id",
|
|
24
|
+
role: "admin",
|
|
25
|
+
handler: async ({ params }) => {
|
|
26
|
+
const [gone] = await db()
|
|
27
|
+
.delete(person)
|
|
28
|
+
.where(eq(person.id, Number(params.id)))
|
|
29
|
+
.returning();
|
|
30
|
+
if (!gone) {
|
|
31
|
+
throw Object.assign(new Error("No such contact."), { status: 404, code: "no_contact" });
|
|
32
|
+
}
|
|
33
|
+
return { ok: true };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
| Field | |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `method` | `GET`, `POST`, `PUT`, `PATCH` or `DELETE` |
|
|
41
|
+
| `path` | `/`, `/items`, `/items/:id`. A `:name` part matches one segment |
|
|
42
|
+
| `role` | `"admin"`: owners and admins only; others get `403`. Default: every member of the tenant |
|
|
43
|
+
| `handler(request)` | Answers with a value, sent as JSON, or with a `Response` |
|
|
44
|
+
|
|
45
|
+
## The request
|
|
46
|
+
|
|
47
|
+
| | |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `request.params` | What the `:name` parts matched |
|
|
50
|
+
| `request.query` | The query string, as `URLSearchParams` |
|
|
51
|
+
| `request.json()` | The body as JSON. An empty body is `{}` |
|
|
52
|
+
| `request.user` | `{ id, tenantId, role, name, email }`: the signed-in person. `role` is `owner`, `admin` or `member` |
|
|
53
|
+
| `request.path` | The address below the plugin’s own |
|
|
54
|
+
| `request.request` | The web `Request` as it came in: headers, a body that is not JSON |
|
|
55
|
+
|
|
56
|
+
## The answer
|
|
57
|
+
|
|
58
|
+
| The handler | The client gets |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Returns a value | `200` with the value as JSON. `undefined` becomes `null` |
|
|
61
|
+
| Returns a `Response` | That response: a file, a redirect, another status |
|
|
62
|
+
| Throws an error with a `status` (400 to 599) and a `code` (a string) | That status with `{ "error": "<message>", "code": "<code>" }` |
|
|
63
|
+
| Throws anything else | `500` with `{ "error": "The plugin failed.", "code": "plugin_failed" }`. The error itself is logged, not sent |
|
|
64
|
+
|
|
65
|
+
Send a `code`, not a sentence for the person. The studio half says it in the person’s language:
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
throw Object.assign(new Error("No such contact."), { status: 404, code: "no_contact" });
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Who can call a route
|
|
72
|
+
|
|
73
|
+
- The studio, signed in. A request without a session gets `401` before it reaches the plugin.
|
|
74
|
+
- A program with a key, at a second address: [With a key](#with-a-key).
|
|
75
|
+
- Only people of a tenant that has the plugin. For any other tenant the studio’s address
|
|
76
|
+
answers `404`.
|
|
77
|
+
- Not the people who run a wizard on its link, and not the outside world. For a webhook of
|
|
78
|
+
another service, a plugin has [public routes](#public-routes).
|
|
79
|
+
|
|
80
|
+
## With a key
|
|
81
|
+
|
|
82
|
+
A program that is not the studio, such as the [WordPress plugin](../../user/wordpress.md),
|
|
83
|
+
calls the same routes below `/api/v1/plugins/<id>`. It signs in with an API key or with an
|
|
84
|
+
access token of engenty.ai. On a runtime that runs alone, you create the key under Settings →
|
|
85
|
+
Integrate; on engenty.ai, in your account:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
curl -H "Authorization: Bearer $KEY" https://wizards.example.com/api/v1/plugins/contacts/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- The route runs as the key’s person, inside that person’s tenant: `request.user` is that
|
|
92
|
+
person, with the role. A `role: "admin"` route answers a member’s key with `403`. `name` and
|
|
93
|
+
`email` can be empty.
|
|
94
|
+
- `GET` needs the scope `wizards:read`, every other method `wizards:write`. A key has every
|
|
95
|
+
scope, a token the ones the person granted. A call without the scope gets `403` with the code
|
|
96
|
+
`insufficient_scope`.
|
|
97
|
+
- A plugin that the runtime has but the key’s account does not have answers `403` with the code
|
|
98
|
+
`plugin`. An id the runtime does not know answers `404`.
|
|
99
|
+
- `x-api-key: <key>` works in place of the `Authorization` header.
|
|
100
|
+
- The answers and errors are the same as at the studio’s address.
|
|
101
|
+
|
|
102
|
+
## Public routes
|
|
103
|
+
|
|
104
|
+
A public route answers anyone: a CMS that says a page changed, another service’s webhook. Its
|
|
105
|
+
address names the tenant without giving its id away; the plugin hands it out:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
server.registerPublicRoute({
|
|
109
|
+
method: "POST",
|
|
110
|
+
path: "/signal/:token",
|
|
111
|
+
handler: async ({ params, tenantId, json }) => {
|
|
112
|
+
const source = await sourceByToken(params.token);
|
|
113
|
+
if (!source) {
|
|
114
|
+
throw Object.assign(new Error("Unknown."), { status: 404, code: "unknown" });
|
|
115
|
+
}
|
|
116
|
+
await refreshSoon(source, await json());
|
|
117
|
+
return { ok: true };
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// In a route of the studio: the address to paste into the CMS.
|
|
122
|
+
const address = await server.publicUrl(`/signal/${source.token}`);
|
|
123
|
+
// https://…/api/public/plugins/<id>/<ref>/signal/<token>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- Nobody is signed in. Check a secret of your own: a token in the address, a signature of the
|
|
127
|
+
body. Keep only a hash of it.
|
|
128
|
+
- The handler runs inside the tenant of the address: `server.getTenantDb()` is its database.
|
|
129
|
+
- `publicUrl` gives the same address for a tenant every time.
|
|
130
|
+
- A body is taken up to 4 MB. Answers and errors work as for the plugin’s other routes.
|
|
131
|
+
- A tenant without the plugin, or a suspended one, answers `404`.
|
|
132
|
+
|
|
133
|
+
## Shared routes
|
|
134
|
+
|
|
135
|
+
Some services post to one webhook for everyone: one account of the runtime’s, one app. A shared
|
|
136
|
+
route has one address for all tenants, and the call itself says which tenant it is for, with
|
|
137
|
+
the ref the plugin handed the service before:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
// Handed to the service with the call it is about to make: names the tenant.
|
|
141
|
+
const ref = await server.publicRef();
|
|
142
|
+
|
|
143
|
+
server.registerSharedRoute({
|
|
144
|
+
method: "POST",
|
|
145
|
+
path: "/incoming",
|
|
146
|
+
handler: async ({ request, inTenant }) => {
|
|
147
|
+
const raw = await request.text();
|
|
148
|
+
if (!signedByTheService(raw, request.headers)) {
|
|
149
|
+
throw Object.assign(new Error("Bad signature."), { status: 401, code: "bad_signature" });
|
|
150
|
+
}
|
|
151
|
+
const event = JSON.parse(raw);
|
|
152
|
+
return inTenant(event.ref, () => pickUp(event));
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// The address to enter at the service, once: the same for every tenant.
|
|
157
|
+
server.sharedUrl("/incoming");
|
|
158
|
+
// https://…/api/public/plugins/<id>/shared/incoming
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
- The handler runs outside any tenant: check the service’s signature, then call `inTenant`.
|
|
162
|
+
- `inTenant(ref, work)` runs `work` inside the tenant of that ref, as a public route of the
|
|
163
|
+
tenant would run. A ref no tenant has, a suspended tenant and one without the plugin throw
|
|
164
|
+
`404` / `not_found`.
|
|
165
|
+
- `publicRef()` is the part of `publicUrl` that names the tenant; it is the same every time.
|
|
166
|
+
- A body is taken up to 4 MB, as on a public route.
|
|
167
|
+
- Where the call does not carry a ref (a keyword written to a number every tenant shares),
|
|
168
|
+
[`server.claims`](./server.md#keys-across-tenants) finds it: `holder(key)` is the ref of the
|
|
169
|
+
tenant that holds the key.
|
|
170
|
+
|
|
171
|
+
## From the studio half
|
|
172
|
+
|
|
173
|
+
`studio.api` calls the plugin’s own routes and gives the parsed JSON:
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
const { contacts } = await studio.api.get<{ contacts: Person[] }>("/");
|
|
177
|
+
await studio.api.del(`/${id}`);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
See [The studio half](./studio.md#the-plugins-own-routes).
|
|
181
|
+
|
|
182
|
+
## Addresses that are taken
|
|
183
|
+
|
|
184
|
+
`/api/studio/plugins/-/…` is the runtime’s own part: the built files, reloading. No plugin is
|
|
185
|
+
called `-`, so the two never meet.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Runners
|
|
3
|
+
description: A door a wizard runs through, beside the page and the chat (a call, a messenger, a kiosk), and the run API that drives runs from it.
|
|
4
|
+
version: 0.5.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
A runner is a way to run a wizard. The runtime has four: the stepped page at `/w/<token>`, the
|
|
8
|
+
chat at `/w/<token>/chat`, live voice at `/w/<token>/talk` and the video call at
|
|
9
|
+
`/w/<token>/video`. The last two are there only where a speech model is set up. A plugin adds
|
|
10
|
+
more. The owner picks them per wizard when it is made, and later under “Change” in the share
|
|
11
|
+
dialog. The link opens the first page runner that is on; the others answer under their own
|
|
12
|
+
address or from their own channel.
|
|
13
|
+
|
|
14
|
+
## Register a runner
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
server.registerRunner({
|
|
18
|
+
id: "kiosk",
|
|
19
|
+
label: { de: "Kiosk", en: "Kiosk" },
|
|
20
|
+
kind: "page",
|
|
21
|
+
capabilities: {
|
|
22
|
+
input: ["text", "select", "multiselect", "toggle", "number", "date"],
|
|
23
|
+
output: { shows: ["text", "image"], pictures: ["dashboard", "widget"] },
|
|
24
|
+
asks: ["confirm"],
|
|
25
|
+
review: ["accept", "regenerate"],
|
|
26
|
+
waits: true,
|
|
27
|
+
handoff: ["screen"],
|
|
28
|
+
},
|
|
29
|
+
page: ({ wizard, path, query }) => new Response(renderKiosk(wizard, path, query)),
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| | |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `id` | Lower case, digits and `-`, starting with a letter, at most 24 characters. The sub-path of the wizard’s address. Not one of the built-in runners (`steps`, `chat`, `talk`, `video`), `runs` or `icons`: such an id throws “is taken” |
|
|
36
|
+
| `label` | `{ de, en }`: its name in German and English |
|
|
37
|
+
| `kind` | `page`: the person opens an address. `channel`: the runner has an address of its own (a number, a bot) and drives runs from its webhooks |
|
|
38
|
+
| `capabilities` | What the runner takes in and shows; see below |
|
|
39
|
+
| `page` | A page runner’s handler: what `/w/<token>/<id>` answers with. Nobody is signed in. A page runner without one throws when it is registered |
|
|
40
|
+
| `problem` | `() => string \| { text, kind?, note?, plan? } \| null`, may be async: why the runner cannot be used in the current tenant right now (“Not connected: Settings → WhatsApp”). The runtime asks it inside the tenant whenever the studio lists the runners, and a runner with a problem can’t be switched on. A text is something to set up: the share dialog’s row says “Not set up yet” and offers “Set up”. An object says its `kind`: `setup` (the same), `waiting` (asked for and waiting for someone else; the row says “Waiting” and has no button) or `plan` (the tenant’s plan does not have it; the row says “Not in your plan” and offers “See {plan}” with the `plan` it names, else “See the plans”). `note` (`{ de, en }`) is what the row says instead (“Number requested”, “From Pro”) |
|
|
41
|
+
| `address` | A channel runner: `(wizard: { id, title, token }) => { number?, keyword?, link? } \| null`, may be async. Where a person reaches that wizard: the number, the keyword that picks it there, and a link that opens the channel with the keyword written (`sms:…`, `https://wa.me/…`). The share dialog shows the keyword and number under the runner’s name, copies the link (else the number) and offers the link as a QR code. Asked for each wizard that has the runner on; null while it is not set up |
|
|
42
|
+
|
|
43
|
+
A page runner is served at `/w/<token>/<id>` for every wizard that switched it on. When you run
|
|
44
|
+
from source, where Vite serves the pages, the same handler answers at
|
|
45
|
+
`/api/public/wizards/<token>/runners/<id>`; the public wizard’s `runners` list carries the
|
|
46
|
+
right address either way.
|
|
47
|
+
|
|
48
|
+
### Capabilities
|
|
49
|
+
|
|
50
|
+
The runner declares what it can do. The runtime works out per wizard how far it gets:
|
|
51
|
+
everything in the channel, a hand-off to the run page at some steps, or not possible. Where it is
|
|
52
|
+
not possible, the share dialog’s row says “Not possible:” with the steps. A kind the runtime does
|
|
53
|
+
not know throws when the runner is registered.
|
|
54
|
+
|
|
55
|
+
| Field | Says |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `input` | The field kinds the runner asks itself. Any other field hands off to the run page |
|
|
58
|
+
| `output.shows` | What it shows as it is: `text`, `data`, `image`, `video`, `voice`, `document`, `dashboard`, `widget`, `film`, `surface` |
|
|
59
|
+
| `output.pictures` | What it shows as a picture with a link to the real thing. Anything else is a link |
|
|
60
|
+
| `asks` | `confirm` for a running step that asks before it changes something; `login` only where a browser types the sign-in |
|
|
61
|
+
| `review` | `accept`, `regenerate`, `edit` |
|
|
62
|
+
| `waits` | Whether it stays through a step that takes minutes. A runner that can’t is not possible for such wizards |
|
|
63
|
+
| `handoff` | How a link to the run page reaches the person: `screen`, `thread`, `sms`, `push`. A runner with none cannot hand off |
|
|
64
|
+
|
|
65
|
+
## Drive a run
|
|
66
|
+
|
|
67
|
+
`server.runs` holds the functions behind the MCP tools, for the plugin’s own door. A run
|
|
68
|
+
started here is a live run of the published wizard for a person of that door.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
server.registerPublicRoute({
|
|
72
|
+
method: "POST",
|
|
73
|
+
path: "/call/:token",
|
|
74
|
+
handler: async ({ params, json }) => {
|
|
75
|
+
const { from, said } = await json<{ from: string; said: string }>();
|
|
76
|
+
const { runId, ticket, refused } = await server.runs.start({
|
|
77
|
+
token: params.token,
|
|
78
|
+
person: { channel: "phone", id: from },
|
|
79
|
+
answers: { name: said },
|
|
80
|
+
});
|
|
81
|
+
const report = await server.runs.report(runId, { waitSeconds: 20 });
|
|
82
|
+
if (report.waitingFor && "page" in report.waitingFor) {
|
|
83
|
+
// Ask the next field; fields with inChat=false need the run page.
|
|
84
|
+
const link = await server.runs.handoffUrl(runId);
|
|
85
|
+
}
|
|
86
|
+
return { runId, ticket, refused, report };
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| Call | |
|
|
92
|
+
|---|---|
|
|
93
|
+
| `runs.start({ token \| wizardId, person, answers?, runner? })` | Starts a live run. `person` names who it is for on the door; the runtime keeps a hash of it as the run’s visitor, so what the wizard remembers is theirs on the run page too. `answers` fills the first page; what did not fit comes back as `refused`. Gives the run’s ticket |
|
|
94
|
+
| `runs.report(runId, { waitSeconds?, draft? })` | The run as it stands: `lang`, `waitingFor` (a page with the fields shown and what they know, a review, a question), outputs with signed links and a `picture` (a PNG of a document, a dashboard or a widget), cost, `browserUrl`. Waits up to 45 seconds while the run works. A door that asks a page one field at a time passes what it has as `draft`: a field’s `shown` then follows those answers, as the form on the screen does |
|
|
95
|
+
| `runs.wizards(runner)` | The published wizards of the tenant that switched the runner on: what the door offers, with `token`, `title` and `lang` |
|
|
96
|
+
| `runs.answerPage(runId, stepId, values)` | Fills the page the run waits for |
|
|
97
|
+
| `runs.review(runId, stepId, action)` | Accepts a review, or asks for one of the shown steps again with a note |
|
|
98
|
+
| `runs.answerAsk(runId, askId, "allow" \| "skip")` | Answers a running step’s question. A sign-in cannot be answered here: hand off |
|
|
99
|
+
| `runs.control(runId, "back" \| "retry" \| "cancel")` | |
|
|
100
|
+
| `runs.subscribe(runId, listener)` | Hears every change of the run: its events with their note in both languages, or a status change. Returns the function that stops it |
|
|
101
|
+
| `runs.handoffUrl(runId)` | The run page with the run’s ticket: the link to send for what the door cannot do. The person who opens it and the door’s person are one to the wizard |
|
|
102
|
+
| `runs.upload(runId, { data, mime, name })` | A file of the person; the asset id goes into an image or file field with `answerPage` |
|
|
103
|
+
| `runs.transcribe(runId, { data, mime })` | What is said in a recording of the person (a voice message), written down with the tenant’s audio model and charged to the run. Up to 10 MB |
|
|
104
|
+
|
|
105
|
+
A refused command throws an error with a `status` and a `code` (`not_found`, `invalid`,
|
|
106
|
+
`refused`, `no_credits`); an `invalid` one also carries the fields that did not fit as
|
|
107
|
+
`data.fields`. A route that lets it through answers that status with `{ error, code }`.
|
|
108
|
+
|
|
109
|
+
## What the person sees
|
|
110
|
+
|
|
111
|
+
- The wizard’s first page offers the runners that are on beside “Let’s go”.
|
|
112
|
+
- A hand-off is a link to the same run; nothing is asked twice. The run page knows the
|
|
113
|
+
door’s person through the run, and “What this wizard remembers” is theirs there too.
|
|
114
|
+
- The space’s results carry the door a run came through.
|
|
115
|
+
|
|
116
|
+
## The runner’s part of the share dialog
|
|
117
|
+
|
|
118
|
+
The row of a channel runner, with its number, keyword, link and QR code, comes from its
|
|
119
|
+
`address`. What the owner changes per wizard, such as the keyword, the studio half registers as
|
|
120
|
+
a section, and the share dialog draws it under its gear while the runner is on and set up:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
studio.registerShareSection({ runner: "whatsapp", component: ShareSection });
|
|
124
|
+
|
|
125
|
+
function ShareSection({ wizard }: StudioShareSectionProps) {
|
|
126
|
+
// wizard: { id, title }; the plugin's own routes hold the rest.
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
One section per runner. After a change, invalidating the query `["wizard-runners", wizard.id]`
|
|
131
|
+
redraws the row. The settings a channel needs once per tenant (the number, the token)
|
|
132
|
+
go into a [settings section](./studio.md).
|
|
133
|
+
|
|
134
|
+
### Setting up inside the dialog
|
|
135
|
+
|
|
136
|
+
“Set up” in a row opens the plugin’s settings section, unless the studio half registers a
|
|
137
|
+
setup. That setup opens inside the dialog instead, as a view with a back arrow, at the dialog’s
|
|
138
|
+
height:
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
studio.registerShareSetup({
|
|
142
|
+
runner: "sms",
|
|
143
|
+
title: () => t("setupTitle"),
|
|
144
|
+
component: Setup,
|
|
145
|
+
notice: Notice,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
function Setup({ wizard, Actions, done }: StudioShareSetupProps) {
|
|
149
|
+
return (
|
|
150
|
+
<>
|
|
151
|
+
<p>…</p>
|
|
152
|
+
<Actions>
|
|
153
|
+
<Button onClick={() => ask.mutate()}>{t("request")}</Button>
|
|
154
|
+
</Actions>
|
|
155
|
+
</>
|
|
156
|
+
);
|
|
157
|
+
// done({ title: t("requested"), text: "…", tone: "waiting" }) goes back.
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
| | |
|
|
162
|
+
|---|---|
|
|
163
|
+
| `title` | The view’s heading, a function: the language can change |
|
|
164
|
+
| `component` | Gets `{ wizard: { id, title }, Actions, done }`. What it renders inside `Actions` goes to the foot of the dialog, where the dialog’s own buttons are. `done(banner?)` goes back to the main view and asks the rows again; `banner` (`{ title, text?, tone? }`, `tone` `done` green or `waiting` plain) shows on top |
|
|
165
|
+
| `notice` | Optional: a banner above the rows while the runner has news (“Your number is here”), drawn by the plugin. It draws nothing while there is no news. It gets `{ wizard, open }`; `open()` opens the setup. The dialog shows the banner of the first runner that is on |
|
|
166
|
+
|
|
167
|
+
One setup per runner. A setup that asks the server for something calls the plugin’s own routes;
|
|
168
|
+
the rows show what `problem` answers after `done`.
|
|
169
|
+
|
|
170
|
+
## A thread door from the SDK
|
|
171
|
+
|
|
172
|
+
A messenger runs a wizard one message at a time: a field per question, options to tap or to
|
|
173
|
+
number, a link to the screen for what the thread cannot take, the result as pictures and links.
|
|
174
|
+
That conversation is the same on every messenger; the SDK holds it, and a plugin brings the
|
|
175
|
+
surface: how a question is drawn there, how a file is fetched.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import { ThreadDoor, type ThreadSurface } from "@engenty/wizards/plugin/thread";
|
|
179
|
+
|
|
180
|
+
const surface: ThreadSurface = {
|
|
181
|
+
runner: "sms",
|
|
182
|
+
asks: ["text", "number", "select", "multiselect", "toggle", "date", "email", "url", "location"],
|
|
183
|
+
async send(thread, prompt) {
|
|
184
|
+
// prompt.kind: "text" | "choice" | "location" | "link" | "media": draw it as the channel allows.
|
|
185
|
+
await twilio.send(thread.id, toText(prompt, thread.state.lang));
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const door = new ThreadDoor({ runs: server.runs, surface, offered, watch, unwatch, log });
|
|
190
|
+
// A webhook: door.inbound(thread, message). A run that changed: door.resume(thread).
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
| | |
|
|
194
|
+
|---|---|
|
|
195
|
+
| `ThreadSurface.asks` | The field kinds the thread asks itself; a page with any other field goes to the screen as a link |
|
|
196
|
+
| `send(thread, prompt)` | A `choice` is drawn as buttons, a list or numbered lines; a typed number or title counts as a tap, the door works that out. `link` and `media` carry a URL |
|
|
197
|
+
| `media(ref)` | A file the person sent, by what the webhook named; without it files hand off |
|
|
198
|
+
| `mayDeliver`, `reach` | A messenger with a window (WhatsApp’s 24 hours): whether a free message may go out now, and the link by other means when not |
|
|
199
|
+
| `offered()` | The wizards switched on for the runner (`runs.wizards`) with their keywords; a keyword in the thread starts its wizard, else the door offers the menu |
|
|
200
|
+
| `watch(thread)`, `unwatch(runId)` | Hear the run (`runs.subscribe`) and call `door.resume` when it moves; the plugin keeps the subscriptions |
|
|
201
|
+
| `Thread` | `{ id, name, runId, state, lastInboundAt, lastMessageId }`: the plugin keeps it in a table per person and hands it to the door before and after |
|
|
202
|
+
|
|
203
|
+
Once a wizard runs, the door speaks the wizard’s language. Before that, it speaks the language
|
|
204
|
+
all offered wizards share; when they differ, it keeps the language it spoke last, which is
|
|
205
|
+
English in a new thread.
|
|
206
|
+
|
|
207
|
+
A messenger plugin is a surface of this door: the webhook on a public route, the keyword table,
|
|
208
|
+
the number and the keyword in the share dialog are the plugin’s; buttons and lists, or numbered
|
|
209
|
+
lines and links, are its surface.
|
|
210
|
+
|
|
211
|
+
## A call
|
|
212
|
+
|
|
213
|
+
A call has no thread and no screen: the person talks with a realtime speech model, and the
|
|
214
|
+
model fills the run through tools, as the chat’s live voice does in the browser. The runtime
|
|
215
|
+
hands a plugin the tenant’s speech model for it:
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
const { apiKey, model } = await server.speech.conversation();
|
|
219
|
+
// Throws with the status 503 and the code `no_model` while no OpenAI key is set under Models.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
A call plugin keeps the audio out of the runtime: the telephony provider hands the call to the
|
|
223
|
+
speech model’s SIP endpoint with a token in a header, the model’s provider posts the incoming
|
|
224
|
+
call to the plugin’s public route, and the plugin accepts it with the wizard’s rules and tools
|
|
225
|
+
and answers the model’s tool calls over a WebSocket, driving the run with `server.runs`. What a
|
|
226
|
+
voice cannot take goes out as a link.
|
|
227
|
+
|
|
228
|
+
## Not there yet
|
|
229
|
+
|
|
230
|
+
- An event when a wizard is published, for a runner that prepares something per wizard.
|