@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,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Plugins",
|
|
3
|
+
"defaultOpen": true,
|
|
4
|
+
"pages": [
|
|
5
|
+
"index",
|
|
6
|
+
"quick-start",
|
|
7
|
+
"layout",
|
|
8
|
+
"---Server half---",
|
|
9
|
+
"server",
|
|
10
|
+
"tools",
|
|
11
|
+
"runners",
|
|
12
|
+
"routes",
|
|
13
|
+
"tables",
|
|
14
|
+
"events",
|
|
15
|
+
"space",
|
|
16
|
+
"connections",
|
|
17
|
+
"starters",
|
|
18
|
+
"---Studio half---",
|
|
19
|
+
"studio",
|
|
20
|
+
"styling",
|
|
21
|
+
"---Running---",
|
|
22
|
+
"reloading",
|
|
23
|
+
"shipping",
|
|
24
|
+
"---Reference---",
|
|
25
|
+
"reference",
|
|
26
|
+
"examples"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Quick start
|
|
3
|
+
description: A tool for AI steps in one file. No build, no restart.
|
|
4
|
+
version: 0.5.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You write one file. The running app finds it, and every AI step can use the tool in it.
|
|
8
|
+
|
|
9
|
+
## 1. Find the plugins folder
|
|
10
|
+
|
|
11
|
+
| You run | The folder |
|
|
12
|
+
|---|---|
|
|
13
|
+
| engenty wizards on your computer (`wizards`) | `~/.engenty/wizards/plugins` |
|
|
14
|
+
| A checkout (`pnpm dev`) | The folders that `PLUGINS_DIR` names in `.env.local`, for example `PLUGINS_DIR=../my-plugins`. A relative path starts at the checkout’s root |
|
|
15
|
+
|
|
16
|
+
Start the app. It creates the folder if it is missing and watches it while it runs.
|
|
17
|
+
|
|
18
|
+
## 2. Write the plugin
|
|
19
|
+
|
|
20
|
+
Save this as `workdays.ts` in the plugins folder:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { definePlugin } from "@engenty/wizards/plugin";
|
|
24
|
+
import { z } from "zod";
|
|
25
|
+
|
|
26
|
+
export default definePlugin((wizards) => {
|
|
27
|
+
wizards.server.registerTool({
|
|
28
|
+
name: "count",
|
|
29
|
+
title: "Working days",
|
|
30
|
+
description:
|
|
31
|
+
"Counts the working days (Monday to Friday) from one date to another, both included.",
|
|
32
|
+
inputSchema: z.object({
|
|
33
|
+
from: z.string().describe("First day, YYYY-MM-DD"),
|
|
34
|
+
to: z.string().describe("Last day, YYYY-MM-DD"),
|
|
35
|
+
}),
|
|
36
|
+
execute: async ({ from, to }, step) => {
|
|
37
|
+
await step.emit("Counting working days …");
|
|
38
|
+
const last = new Date(`${to}T00:00:00Z`);
|
|
39
|
+
let workingDays = 0;
|
|
40
|
+
for (let day = new Date(`${from}T00:00:00Z`); day <= last; day.setUTCDate(day.getUTCDate() + 1)) {
|
|
41
|
+
if (day.getUTCDay() % 6 !== 0) {
|
|
42
|
+
workingDays += 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return { from, to, workingDays };
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- The file’s name is the plugin’s id: `workdays`.
|
|
52
|
+
- The tool’s full id is `workdays.count`.
|
|
53
|
+
- `@engenty/wizards/plugin` and `zod` come from the app, so you don’t install anything.
|
|
54
|
+
|
|
55
|
+
## 3. See it
|
|
56
|
+
|
|
57
|
+
The app loaded the file the moment you saved it.
|
|
58
|
+
|
|
59
|
+
- **Settings → Plugins** lists `workdays`, with `workdays.count` under “Tools for steps”.
|
|
60
|
+
- **In the editor**, open an AI step: `workdays.count` is in its list of tools, beside
|
|
61
|
+
`web_search` and the other built-in ones. The line below the list says “workdays.count =
|
|
62
|
+
Working days”.
|
|
63
|
+
- **In the editor’s chat**, ask for it: “Add a step that counts the working days between the
|
|
64
|
+
two dates.” The assistant knows the tool from its description.
|
|
65
|
+
|
|
66
|
+
In a wizard’s definition the step lists the tool by its full id:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"id": "countDays",
|
|
71
|
+
"type": "agent",
|
|
72
|
+
"title": "Count the working days",
|
|
73
|
+
"instructions": "Count the working days from {{start}} to {{end}}.",
|
|
74
|
+
"tools": ["workdays.count"],
|
|
75
|
+
"model": "standard",
|
|
76
|
+
"output": { "format": "json", "fields": [{ "id": "days", "kind": "number", "description": "Working days" }] }
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 4. Change it
|
|
81
|
+
|
|
82
|
+
Edit the file and save. The plugin loads again, and the next step that runs uses the new code.
|
|
83
|
+
|
|
84
|
+
If the file has an error, Settings → Plugins says “The server part didn’t load. Check the plugin
|
|
85
|
+
and reload” with the reason. Fix the file and save it again.
|
|
86
|
+
|
|
87
|
+
## Next
|
|
88
|
+
|
|
89
|
+
| To | Read |
|
|
90
|
+
|---|---|
|
|
91
|
+
| Keep data | [Tables](./tables.md) |
|
|
92
|
+
| React when a run ends | [Events](./events.md) |
|
|
93
|
+
| Show a page in the studio | [The studio half](./studio.md) |
|
|
94
|
+
| Give the plugin a name, a version and more than one file | [Files and manifest](./layout.md) |
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Reference
|
|
3
|
+
description: Every call, type, address and setting of the plugin framework on one page.
|
|
4
|
+
version: 0.5.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Server half
|
|
8
|
+
|
|
9
|
+
`import { definePlugin } from "@engenty/wizards/plugin"`
|
|
10
|
+
|
|
11
|
+
`import { ThreadDoor } from "@engenty/wizards/plugin/thread"`: a wizard run in a
|
|
12
|
+
messenger’s thread, one message at a time, for which a plugin brings the surface. See
|
|
13
|
+
[Runners](./runners.md#a-thread-door-from-the-sdk).
|
|
14
|
+
|
|
15
|
+
The default export is a `WizardsPluginFactory`: `(wizards: WizardsPluginApi) => void | Promise<void>`.
|
|
16
|
+
|
|
17
|
+
### `wizards`
|
|
18
|
+
|
|
19
|
+
| | Type | |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `plugin` | `PluginManifest` | The manifest |
|
|
22
|
+
| `server` | `PluginServerApi` | Below |
|
|
23
|
+
| `config.get(key)` | `string \| undefined` | A setting of the install: a line of its `.env` |
|
|
24
|
+
| `features.has(name)`, `features.all()` | `Promise<boolean>`, `Promise<Record<string, boolean>>` | The tenant’s feature switches. A short name is the plugin’s own switch from its manifest (`<id>.<name>`); a full name asks for any switch. Off unless something turned it on |
|
|
25
|
+
| `log.info`, `log.warn`, `log.error` | `(...args) => void` | A log line with the plugin’s name |
|
|
26
|
+
| `resolvePath(relative)` | `string` | A file of the plugin as an absolute path |
|
|
27
|
+
|
|
28
|
+
### `wizards.server`
|
|
29
|
+
|
|
30
|
+
| Call | |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `registerTool(tool: PluginTool)` | [Tools](./tools.md) |
|
|
33
|
+
| `registerRunner(runner: PluginRunner)` | [Runners](./runners.md). A door a wizard runs through; `page` runners answer at `/w/<token>/<id>` |
|
|
34
|
+
| `runs` | [Runners](./runners.md#drive-a-run). `start`, `report`, `wizards`, `answerPage`, `review`, `answerAsk`, `control`, `subscribe`, `handoffUrl`, `upload`, `transcribe`: the functions behind the MCP tools, for the plugin’s door |
|
|
35
|
+
| `speech.conversation()` | [Runners](./runners.md#a-call). `{ provider: "openai", apiKey, model }`: the tenant’s realtime speech model, for a call a plugin drives itself. Throws `503` / `no_model` while none is set up |
|
|
36
|
+
| `registerSpaceContext({ block, tools?, steps? })` | [The space](./space.md). `block(space): string \| null`; `steps`: `agent` (default), `html` (steps that write a document or a dashboard, without the tools) |
|
|
37
|
+
| `spaces.brand(space)` | [The space](./space.md#the-spaces-brand). `{ name, colors, fonts }` of the space, or `null` |
|
|
38
|
+
| `registerAssistantTool(tool: PluginAssistantTool)` | [The space](./space.md#tools-of-the-space-assistant) |
|
|
39
|
+
| `index.put({ space, key, title, text, link? })`, `index.remove(space, key?)` | [The space](./space.md#the-search-index) |
|
|
40
|
+
| `spaceData.putCategories`, `.putPage`, `.putTable`, `.putFile`, `.putDocument`, `.list`, `.readPages`, `.files`, `.readFile`, `.remove`, `.summarize` | [The space](./space.md#knowledge-a-plugin-writes). Knowledge of a space: pages, tables and files under keys of the plugin’s own, with their categories; and the space’s own pages and files to read |
|
|
41
|
+
| `registerHttpRoute(route: PluginRoute)` | [Routes](./routes.md) |
|
|
42
|
+
| `registerPublicRoute(route: PluginPublicRoute)` | [Routes](./routes.md#public-routes) |
|
|
43
|
+
| `publicUrl(path): Promise<string>` | The full address of a public route for the current tenant |
|
|
44
|
+
| `publicRef(): Promise<string>` | [Routes](./routes.md#shared-routes). The part of `publicUrl` that names the current tenant |
|
|
45
|
+
| `registerSharedRoute(route: PluginSharedRoute)` | [Routes](./routes.md#shared-routes). One route for every tenant; `handler({ request, path, params, query, inTenant })` |
|
|
46
|
+
| `sharedUrl(path): string` | The full address of a shared route, the same for every tenant |
|
|
47
|
+
| `claims.take(key)`, `.put(key)`, `.drop(key)`, `.holder(key)`, `.mine(key)` | [Keys across tenants](./server.md#keys-across-tenants). Each key for one tenant at a time; `holder` gives the tenant’s ref for `inTenant` |
|
|
48
|
+
| `channels.get()`, `.request({ userId, country, wish?, lang })`, `.withdraw()`, `.book({ kind: "sms" \| "call" \| "whatsapp", quantity, key, runId? })` | [Numbers of the Manage-App](./server.md#numbers-of-the-manage-app). `get`: `{ number, request, shared, allowed }` or `null` without a Manage-App |
|
|
49
|
+
| `registerMigrations(folder: string)` | [Tables](./tables.md). The folder is relative to the plugin’s |
|
|
50
|
+
| `on(event, listener)` | [Events](./events.md). `event`: `"run.done"`, `"run.failed"`, `"run.cancelled"`, `"space.created"`, `"space.updated"`, `"space.deleted"`, `"space.file.ready"`, `"space.file.removed"` |
|
|
51
|
+
| `every(name, everyMs, handler)` | [Jobs](./server.md#jobs). Per tenant that has the plugin, at most once per `everyMs` (a minute at least). `handler({ tenantId, lastRun, signal })` |
|
|
52
|
+
| `web.fetch(url, init?)`, `web.read(url, { signal? })` | [The web](./server.md#the-web) |
|
|
53
|
+
| `documents.parse({ data, name, mime }, { signal? })` | [Documents](./server.md#documents). `{ markdown, pages }` |
|
|
54
|
+
| `getTenantDb(): PluginDb` | The current tenant’s database, a Drizzle libSQL database |
|
|
55
|
+
| `generate(request): Promise<{ text, object }>` | Asks a model of the current tenant: `prompt`, `system?`, `schema?`, `model?`, `maxOutputTokens?`, `signal?`, `files?` (pictures and PDFs: `{ data, mediaType, name? }[]`). See [The server half](./server.md#asking-a-model) |
|
|
56
|
+
| `connections.available(ids)`, `.start({ space, connector, actions, lang? })`, `.connect({ space, connector, actions, credentials })`, `.list(space)`, `.get(id)`, `.call(id, action, input)`, `.remove(id)` | [Accounts](./connections.md). `lang`: the language of the page the person comes back to |
|
|
57
|
+
| `secrets.seal(value): string`, `secrets.unseal(sealed)` | [Keys of the plugin’s own](./server.md#keys-of-the-plugins-own). `unseal` gives null for a value sealed on another install |
|
|
58
|
+
| `registerAssistantContext({ block })` | [The space](./space.md#the-assistant-on-the-plugins-own-page). `block(space): string \| null` |
|
|
59
|
+
| `registerStarter(starter: PluginStarter)` | [Starters](./starters.md). Known as `<plugin id>.<starter id>` |
|
|
60
|
+
| `onUnload(fn)` | Runs when the plugin unloads or loads again |
|
|
61
|
+
|
|
62
|
+
### `PluginTool`
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
interface PluginTool<S extends z.ZodType = z.ZodType> {
|
|
66
|
+
name: string; // lower case, digits and "_"
|
|
67
|
+
title?: string; // what the editor calls it
|
|
68
|
+
description: string; // for the model
|
|
69
|
+
inputSchema: S;
|
|
70
|
+
execute(input: z.infer<S>, step: PluginStepContext): unknown | Promise<unknown>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface PluginStepContext {
|
|
74
|
+
runId: string;
|
|
75
|
+
stepId: string;
|
|
76
|
+
tenantId: string;
|
|
77
|
+
space: { id: string; name: string }; // the space of the step's wizard
|
|
78
|
+
project: { id: string; name: string }; // the same, by its older name
|
|
79
|
+
wizard: { id: string; title: string };
|
|
80
|
+
mode: "test" | "live"; // "test": a test run from the studio
|
|
81
|
+
signal: AbortSignal; // aborted when the run is cancelled
|
|
82
|
+
emit(message: string): Promise<void>; // tells the person what the step is doing
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### `PluginRunner`
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
interface PluginRunner {
|
|
90
|
+
id: string; // lower case, digits and "-", at most 24 characters
|
|
91
|
+
label: { de: string; en: string };
|
|
92
|
+
kind: "page" | "channel"; // an address the person opens, or a channel of its own
|
|
93
|
+
capabilities: {
|
|
94
|
+
input: string[]; // field kinds asked by the runner itself
|
|
95
|
+
output: { shows: string[]; pictures: string[] };
|
|
96
|
+
asks: ("confirm" | "login")[];
|
|
97
|
+
review: ("accept" | "regenerate" | "edit")[];
|
|
98
|
+
waits: boolean;
|
|
99
|
+
handoff: ("screen" | "thread" | "sms" | "push")[];
|
|
100
|
+
};
|
|
101
|
+
page?(request: PluginRunnerRequest): Response | Promise<Response>;
|
|
102
|
+
problem?(): string | PluginRunnerProblem | null | Promise<string | PluginRunnerProblem | null>; // why not usable in this tenant right now
|
|
103
|
+
address?(wizard: { id: string; title: string; token: string }):
|
|
104
|
+
| PluginRunnerAddress | null | Promise<PluginRunnerAddress | null>; // where a person reaches the wizard
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface PluginRunnerProblem {
|
|
108
|
+
text: string; // in the owner's words
|
|
109
|
+
kind?: "setup" | "waiting" | "plan"; // default "setup"
|
|
110
|
+
note?: { de: string; en: string }; // what the share dialog's row says instead
|
|
111
|
+
plan?: string; // "plan": the plan that has it
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface PluginRunnerAddress {
|
|
115
|
+
number?: string | null; // the number people write to or call, with the country code
|
|
116
|
+
keyword?: string | null; // the word that picks this wizard on that number
|
|
117
|
+
link?: string | null; // opens the channel with the keyword written: copied, and as a QR code
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface PluginRunnerRequest {
|
|
121
|
+
request: Request;
|
|
122
|
+
tenantId: string;
|
|
123
|
+
wizard: { id: string; token: string; title: string };
|
|
124
|
+
path: string; // below /w/<token>/<id>
|
|
125
|
+
query: URLSearchParams;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### `PluginRuns`
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
interface PluginRuns {
|
|
133
|
+
start(input: ({ token: string } | { wizardId: string }) & {
|
|
134
|
+
person: { channel: string; id: string };
|
|
135
|
+
answers?: Record<string, unknown>;
|
|
136
|
+
runner?: string;
|
|
137
|
+
}): Promise<{ runId: string; ticket: string; refused: { field: string; message: string }[] | null }>;
|
|
138
|
+
report(runId: string, options?: { waitSeconds?: number; draft?: Record<string, unknown> }): Promise<PluginRunReport>;
|
|
139
|
+
wizards(runner: string): Promise<{ wizardId: string; token: string; title: string; lang: "de" | "en" }[]>;
|
|
140
|
+
answerPage(runId: string, stepId: string, values: Record<string, unknown>): Promise<void>;
|
|
141
|
+
review(runId: string, stepId: string, action: PluginReviewAction): Promise<void>;
|
|
142
|
+
answerAsk(runId: string, askId: string, answer: "allow" | "skip"): Promise<void>;
|
|
143
|
+
control(runId: string, action: "back" | "retry" | "cancel"): Promise<void>;
|
|
144
|
+
subscribe(runId: string, listener: (signal: PluginRunSignal) => void): () => void;
|
|
145
|
+
handoffUrl(runId: string): Promise<string>;
|
|
146
|
+
upload(runId: string, file: { data: Uint8Array | ArrayBuffer; mime: string; name: string }): Promise<{ assetId: string }>;
|
|
147
|
+
transcribe(runId: string, file: { data: Uint8Array | ArrayBuffer; mime: string }): Promise<{ text: string }>;
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`waitSeconds` is at most 45. `draft`: the answers a door has so far for the page shown, so a
|
|
152
|
+
field’s `shown` follows them. `wizards(runner)`: the published wizards that switched the runner
|
|
153
|
+
on. `transcribe`: a recording of the person written down, charged to the run.
|
|
154
|
+
|
|
155
|
+
`PluginRunReport` is what `get_run` gives an MCP client: status, the step, `waitingFor` (a
|
|
156
|
+
page with its fields shown, a review, a question), outputs with signed links, cost,
|
|
157
|
+
`browserUrl`. The types carry the fields.
|
|
158
|
+
|
|
159
|
+
### `PluginRoute`
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
interface PluginRoute {
|
|
163
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
164
|
+
path: string; // "/", "/items", "/items/:id"
|
|
165
|
+
role?: "member" | "admin"; // "admin": owners and admins only
|
|
166
|
+
handler(request: PluginRequest): unknown | Promise<unknown>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
interface PluginRequest {
|
|
170
|
+
request: Request;
|
|
171
|
+
path: string;
|
|
172
|
+
params: Record<string, string>;
|
|
173
|
+
query: URLSearchParams;
|
|
174
|
+
user: { id: string; tenantId: string; role: "owner" | "admin" | "member"; name: string; email: string };
|
|
175
|
+
json<T = unknown>(): Promise<T>;
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### `PluginAssistantTool`
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
interface PluginAssistantTool<S extends z.ZodType = z.ZodType> {
|
|
183
|
+
name: string; // lower case, digits and "_"
|
|
184
|
+
description: string; // for the model
|
|
185
|
+
inputSchema: S;
|
|
186
|
+
card?: boolean; // the result also goes to the chat, for the studio half's card
|
|
187
|
+
execute(input: z.infer<S>, turn: PluginAssistantContext): unknown | Promise<unknown>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface PluginAssistantContext {
|
|
191
|
+
tenantId: string;
|
|
192
|
+
space: { id: string; name: string };
|
|
193
|
+
userId: string;
|
|
194
|
+
signal: AbortSignal;
|
|
195
|
+
emit(message: string): void; // the line the chat shows
|
|
196
|
+
changed(): void; // the space page draws again
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### `PluginPublicRoute`
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
interface PluginPublicRoute {
|
|
204
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
205
|
+
path: string;
|
|
206
|
+
handler(request: PluginPublicRequest): unknown | Promise<unknown>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
interface PluginPublicRequest {
|
|
210
|
+
request: Request;
|
|
211
|
+
path: string;
|
|
212
|
+
params: Record<string, string>;
|
|
213
|
+
query: URLSearchParams;
|
|
214
|
+
tenantId: string; // the tenant of the address; nobody is signed in
|
|
215
|
+
json<T = unknown>(): Promise<T>;
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### `PluginStarter`
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
interface PluginStarter {
|
|
223
|
+
id: string; // lower case, digits and "-"
|
|
224
|
+
title: string;
|
|
225
|
+
description: string; // what it makes, in one or two sentences
|
|
226
|
+
language?: "de" | "en"; // the language of its texts; default "en"
|
|
227
|
+
definition: unknown; // a complete wizard definition, checked when it is registered
|
|
228
|
+
files?: Record<string, string | Uint8Array>; // workspace files by path; a string is UTF-8
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### `PluginRunEvent`
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
interface PluginRunEvent {
|
|
236
|
+
run: { id: string; wizardId: string; mode: "test" | "live"; status: "done" | "failed" | "cancelled" };
|
|
237
|
+
wizard: { id: string; title: string; projectId: string };
|
|
238
|
+
values: Record<string, unknown>; // what the person answered, by field id
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Studio half
|
|
243
|
+
|
|
244
|
+
`import { defineStudioPlugin } from "@engenty/wizards/plugin/studio"`
|
|
245
|
+
|
|
246
|
+
The default export is a `StudioPlugin`: `(studio: StudioPluginContext) => void`.
|
|
247
|
+
|
|
248
|
+
| | |
|
|
249
|
+
|---|---|
|
|
250
|
+
| `studio.plugin` | `{ id, name, version }` |
|
|
251
|
+
| `studio.registerPage({ path, component, wide? })` | A page at `/studio<path>` |
|
|
252
|
+
| `studio.registerNav({ to, label, icon })` | An icon in the app bar. `label: () => string` |
|
|
253
|
+
| `studio.registerSettingsSection({ id, label, icon, component, menu? })` | A section at `/studio/settings/<id>` |
|
|
254
|
+
| `studio.registerShareSection({ runner, component })` | [Runners](./runners.md#the-runners-part-of-the-share-dialog). The runner’s own settings for a wizard (a keyword), under the share dialog’s gear once it is switched on and set up. `component` gets `{ wizard: { id, title } }` |
|
|
255
|
+
| `studio.registerShareSetup({ runner, title, component, notice? })` | [Runners](./runners.md#setting-up-inside-the-dialog). What “Set up” in the runner’s row opens inside the share dialog. `component` gets `{ wizard, Actions, done(banner?) }`, `notice` `{ wizard, open }` |
|
|
256
|
+
| `studio.registerAssistantCard({ tool, component })` | Draws a tool’s result in the space assistant’s chat. `component` gets `{ data, send }` |
|
|
257
|
+
| `studio.registerSpaceSection({ id, group?, label, hint?, component })` | A section of a part of the space page at `/studio/space/<group>#<id>`; `group`: `info`, `knowledge` (default), `data` or `results` |
|
|
258
|
+
| `studio.registerSpacePart({ id, label, icon, after?, component })` | [A part of the plugin’s own](./studio.md#a-part-of-the-plugins-own) at `/studio/space/<id>`, after `info`, `knowledge` or `data` (default) in the menu |
|
|
259
|
+
| `studio.useSpaceMenu(entries)` | A hook in a plugin’s part: its menu, `{ id, label, icon? }[]`, each jumping to the element with that id |
|
|
260
|
+
| `studio.useCrumbs(items)` | A hook: the trail in the top bar for the page shown, `{ label, to? }[]`, instead of a heading of the page’s own |
|
|
261
|
+
| `studio.Assistant` | Tells the studio’s assistant what to say on a page of the plugin: `title?`, `hello?`, `placeholder?`, `suggestions?: { label, message?, fill? }[]`, `onChanged?`. Draws nothing |
|
|
262
|
+
| `studio.useAssistantPage(page)` | A hook: what the page shows, for the assistant: `open?: { kind, id?, label }`, `selection?`, `summary?`, `fields?: { id, label, value }[]`, `compact?`, and the words of `studio.Assistant` |
|
|
263
|
+
| `studio.useAssistantTool(name, { description, parameters? }, run)` | A hook: a tool the assistant runs in the page while it is shown, as `<plugin>_<name>`. `parameters`: JSON Schema; `run(args)` returns what the assistant learns |
|
|
264
|
+
| `studio.useSpace()` | A hook: `{ id, name, readOnly, brand }` of the space the studio shows, or `null`; `brand` is `{ name, colors, fonts }` |
|
|
265
|
+
| `studio.i18n.register({ de, en })` | Gives `t(key, vars?)`. A key missing in the language shown falls back to `de` |
|
|
266
|
+
| `studio.i18n.lang()` | `"de"` or `"en"` |
|
|
267
|
+
| `studio.api.get`, `.post`, `.put`, `.patch`, `.del` | The plugin’s own routes |
|
|
268
|
+
| `studio.me()` | `{ user: { id, name, email }, tenant: { id, role }, mode: "managed" \| "local" }` |
|
|
269
|
+
| `studio.onUnload(fn)` | Runs when the studio half loads again |
|
|
270
|
+
|
|
271
|
+
## Ids and names
|
|
272
|
+
|
|
273
|
+
| | Rule | Example |
|
|
274
|
+
|---|---|---|
|
|
275
|
+
| Plugin id | Lower case, digits and `-`, starting with a letter, at most 40 characters | `run-log` |
|
|
276
|
+
| Tool name | Lower case, digits and `_`, starting with a letter, at most 40 characters | `recent` |
|
|
277
|
+
| Tool id in a wizard | `<plugin id>.<tool name>` | `run-log.recent` |
|
|
278
|
+
| Tool name for the model | The id with `_` for `.` and `-` | `run_log_recent` |
|
|
279
|
+
| Starter id | Lower case, digits and `-`, starting with a letter, at most 40 characters | `book` |
|
|
280
|
+
| Starter id in a list of templates | `<plugin id>.<starter id>` | `contacts.follow-up` |
|
|
281
|
+
| Table name | Begins with the plugin’s id | `run_log_entry` |
|
|
282
|
+
| Runner id | Lower case, digits and `-`, starting with a letter, at most 24 characters; not a built-in runner (`steps`, `chat`, `talk`, `video`) or a sub-path of a wizard’s address (`runs`, `icons`) | `kiosk` |
|
|
283
|
+
| Element around what a plugin draws | `data-plugin="<plugin id>"` | |
|
|
284
|
+
|
|
285
|
+
## Addresses
|
|
286
|
+
|
|
287
|
+
All below `/api/studio/plugins`, all signed in:
|
|
288
|
+
|
|
289
|
+
| Address | | Who |
|
|
290
|
+
|---|---|---|
|
|
291
|
+
| `GET /` | The tenant’s plugins: id, name, version, description, tools, where the built files are, why a server half did not load; and what looked like a plugin and is none | Everyone; what is none: owners and admins, alone |
|
|
292
|
+
| `ALL /<id>/…` | The plugin’s own routes | Members of a tenant that has the plugin; `role: "admin"` routes owners and admins |
|
|
293
|
+
| `GET /-/assets/<id>/client.js`, `/client.css` | The built studio half | Members of a tenant that has the plugin |
|
|
294
|
+
| `GET /-/events` | A stream that says when a plugin loaded again | Everyone, alone |
|
|
295
|
+
| `POST /-/reload` | Loads every plugin again | Owners and admins, alone |
|
|
296
|
+
| `POST /-/reload/<id>` | Loads one plugin again | Owners and admins, alone |
|
|
297
|
+
|
|
298
|
+
“Alone”: where the runtime runs on its own, not as the runtime of engenty.ai.
|
|
299
|
+
|
|
300
|
+
For programs, with an API key or an access token:
|
|
301
|
+
|
|
302
|
+
| Address | | Who |
|
|
303
|
+
|---|---|---|
|
|
304
|
+
| `ALL /api/v1/plugins/<id>/…` | The plugin’s own routes, as the key’s person. [With a key](./routes.md#with-a-key) | `GET` with `wizards:read`, the rest with `wizards:write`; `403` `plugin` where the account lacks the plugin |
|
|
305
|
+
|
|
306
|
+
And public, nobody signed in:
|
|
307
|
+
|
|
308
|
+
| Address | |
|
|
309
|
+
|---|---|
|
|
310
|
+
| `ALL /api/public/plugins/<id>/<ref>/…` | A plugin’s public routes; `<ref>` names the tenant. `server.publicUrl` gives the full address |
|
|
311
|
+
| `ALL /api/public/plugins/<id>/shared/…` | A plugin’s shared routes, one address for every tenant. `server.sharedUrl` gives the full address |
|
|
312
|
+
| `/w/<token>/<runner>` | A plugin’s page runner for a wizard that switched it on (built; from source `/api/public/wizards/<token>/runners/<runner>`) |
|
|
313
|
+
|
|
314
|
+
The studio’s addresses of a plugin: `/studio<path>` for its pages, `/studio/settings/<id>` for a
|
|
315
|
+
settings section, `/studio/space/<group>#<id>` for a section of the space page and
|
|
316
|
+
`/studio/space/<id>` for a part of it.
|
|
317
|
+
|
|
318
|
+
## Settings
|
|
319
|
+
|
|
320
|
+
In the install’s `.env`:
|
|
321
|
+
|
|
322
|
+
| Setting | | Default |
|
|
323
|
+
|---|---|---|
|
|
324
|
+
| `PLUGINS_DIR` | Folders to look for plugins in, comma-separated, besides the runtime’s `modules/` | Installed app: `~/.engenty/wizards/plugins`. Checkout: none |
|
|
325
|
+
| `PLUGINS_WATCH` | `0`: plugins do not load again when their files change. A runtime of engenty.ai never reloads them | `1` |
|
|
326
|
+
| `PLUGINS_DEFAULT` | On engenty.ai: the ids of the plugins every tenant has, comma-separated | none |
|
|
327
|
+
| `PLUGIN_JOBS` | `0`: this runtime runs no jobs (`server.every`), for one whose jobs another process runs | `1` |
|
|
328
|
+
|
|
329
|
+
## Files
|
|
330
|
+
|
|
331
|
+
| File | |
|
|
332
|
+
|---|---|
|
|
333
|
+
| `engenty.plugin.json` | The manifest: [Files and manifest](./layout.md#the-manifest) |
|
|
334
|
+
| `src/plugin.ts` | The server half |
|
|
335
|
+
| `migrations/*.sql` | Tables, where the server half registers the folder |
|
|
336
|
+
| `ui/plugin.tsx` | The studio half’s source |
|
|
337
|
+
| `dist/client.js`, `dist/client.css` | The studio half, built by `node scripts/build-plugin.mjs <folder>` |
|
|
338
|
+
|
|
339
|
+
## In the repository
|
|
340
|
+
|
|
341
|
+
| | |
|
|
342
|
+
|---|---|
|
|
343
|
+
| `packages/wizards/src/plugin/` | The types, with their comments |
|
|
344
|
+
| `apps/runtime/src/plugins/` | Finding, loading, tables, events |
|
|
345
|
+
| `apps/runtime/src/routes/plugins.ts` | The addresses above; `apps/runtime/src/routes/api.ts` the ones for programs |
|
|
346
|
+
| `apps/web/src/plugins/` | The studio’s side |
|
|
347
|
+
| `scripts/build-plugin.mjs` | The build of a studio half |
|
|
348
|
+
| `apps/runtime/test/plugins.test.ts` | Loading, routes, tools, tables per tenant, reloading |
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: While it runs
|
|
3
|
+
description: Save a file and the plugin loads again – what reloads, what survives, and how to work on a plugin.
|
|
4
|
+
version: 0.5.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
A runtime that runs alone watches its plugins. You don’t need to restart it while you write one.
|
|
8
|
+
|
|
9
|
+
## What happens on a change
|
|
10
|
+
|
|
11
|
+
| You change | What happens |
|
|
12
|
+
|---|---|
|
|
13
|
+
| A file of the server half | The plugin loads again: what it registered is removed, its `onUnload` functions run, and its files are read again |
|
|
14
|
+
| `dist/client.js`, `dist/client.css` | The open studio takes the new files in place. A page of the plugin that is open stays open |
|
|
15
|
+
| A file below `ui/` | Nothing happens until it is built: the change counts once `dist/` changes |
|
|
16
|
+
| A new file or folder in a plugins folder | The runtime looks again: new plugins load, the others stay as they are |
|
|
17
|
+
| A plugin’s file or folder is removed | That plugin unloads. Its tables stay |
|
|
18
|
+
| A new `.sql` file | It runs on the open tenant databases with the reload |
|
|
19
|
+
| An npm dependency of the plugin | It needs a restart: Node keeps a package once it is imported |
|
|
20
|
+
| The manifest’s `id` | The plugin is gone under the old id and loads under the new one |
|
|
21
|
+
|
|
22
|
+
A reload takes about as long as reading the files: well under a second.
|
|
23
|
+
|
|
24
|
+
## What survives a reload
|
|
25
|
+
|
|
26
|
+
| | |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Rows in the plugin’s tables | Stay |
|
|
29
|
+
| Variables of the module | Start again |
|
|
30
|
+
| A step that is running | Keeps the tools it started with |
|
|
31
|
+
| Timers, sockets, watchers | Are yours to stop: `server.onUnload`, `studio.onUnload` |
|
|
32
|
+
| A plugin page open in the studio | Stays open, drawn by the new code |
|
|
33
|
+
|
|
34
|
+
## A plugin that breaks
|
|
35
|
+
|
|
36
|
+
A plugin that fails when it loads again stays out until you fix its file: its tools are gone and
|
|
37
|
+
its routes answer `404`. Settings → Plugins shows the error. Save the fixed file and the plugin
|
|
38
|
+
is back.
|
|
39
|
+
|
|
40
|
+
## By hand
|
|
41
|
+
|
|
42
|
+
Settings → Plugins has two buttons for owners and admins of a runtime that runs alone:
|
|
43
|
+
|
|
44
|
+
| Button | What it does |
|
|
45
|
+
|---|---|
|
|
46
|
+
| “Reload”, the arrow on a plugin’s row | Loads that plugin again |
|
|
47
|
+
| “Look again” | Loads every plugin again, finds new ones and drops missing ones |
|
|
48
|
+
|
|
49
|
+
`PLUGINS_WATCH=0` in the install’s `.env` turns the watching off; the buttons still work.
|
|
50
|
+
|
|
51
|
+
## Working on a plugin
|
|
52
|
+
|
|
53
|
+
A loop that needs no restart, from a checkout:
|
|
54
|
+
|
|
55
|
+
1. Put the plugin’s folder somewhere and name its parent in `PLUGINS_DIR` (`.env.local`).
|
|
56
|
+
2. Start the app:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pnpm dev
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
3. In a second terminal, build the studio half on every save:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
node scripts/build-plugin.mjs <plugin folder> --watch
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
4. Open the plugin’s page in the studio and edit. The server half reloads when you save, and
|
|
69
|
+
the page updates once the build has finished.
|
|
70
|
+
|
|
71
|
+
The runtime’s log names the plugins it loaded at start (`plugins: contacts, workdays`) and says
|
|
72
|
+
why a plugin did not load.
|
|
73
|
+
|
|
74
|
+
## On engenty.ai
|
|
75
|
+
|
|
76
|
+
Nothing reloads there: a new version of a plugin arrives when the service starts again.
|