@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,289 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { readFile, rm, stat } from "node:fs/promises";
|
|
4
|
+
import { isAbsolute, join, normalize } from "node:path";
|
|
5
|
+
import { note as runNote } from "@engenty-wizards/shared/run";
|
|
6
|
+
import { StepError } from "../engine/types.js";
|
|
7
|
+
import { CLAUDE_BIN, claudeEnv } from "../harness/claude.js";
|
|
8
|
+
import { failureOf } from "../harness/model.js";
|
|
9
|
+
import { openBridge } from "../mcp/bridge.js";
|
|
10
|
+
import { saidOf } from "../model-errors.js";
|
|
11
|
+
import { filmClient } from "../models.js";
|
|
12
|
+
import { prepareFilmFolder, savedSession, saveSession } from "./project.js";
|
|
13
|
+
import { runHyperframes } from "./tools.js";
|
|
14
|
+
/**
|
|
15
|
+
* A film step: the installed client (Claude Code) works in the film's folder with the skills,
|
|
16
|
+
* the style kit, the brand and the run's material, and writes the film as code. Its shell runs
|
|
17
|
+
* in the client's sandbox — writes only inside the folder, no network; HyperFrames (render,
|
|
18
|
+
* snapshots, checks) runs outside it, through the `hyperframes` tool of this step, limited to
|
|
19
|
+
* the folder. The final render is the runtime's, not the client's. A run that stops (a limit,
|
|
20
|
+
* a crash) keeps the folder and the client's session: the next attempt picks up from there.
|
|
21
|
+
*/
|
|
22
|
+
/** What the client may run through the tool; everything that reaches the network stays out. */
|
|
23
|
+
const ALLOWED = new Set([
|
|
24
|
+
"lint",
|
|
25
|
+
"check",
|
|
26
|
+
"validate",
|
|
27
|
+
"inspect",
|
|
28
|
+
"snapshot",
|
|
29
|
+
"render",
|
|
30
|
+
"compositions",
|
|
31
|
+
"timeline",
|
|
32
|
+
"info",
|
|
33
|
+
"keyframes",
|
|
34
|
+
"compare",
|
|
35
|
+
"grade-compare",
|
|
36
|
+
"beats",
|
|
37
|
+
"normalize-audio",
|
|
38
|
+
"media-treatment",
|
|
39
|
+
"transcribe",
|
|
40
|
+
"docs",
|
|
41
|
+
]);
|
|
42
|
+
/** The longest a film may take the client before the step gives up. */
|
|
43
|
+
const LIMIT_MS = 3 * 60 * 60_000;
|
|
44
|
+
function hyperframesTool(root, signal) {
|
|
45
|
+
return {
|
|
46
|
+
name: "hyperframes",
|
|
47
|
+
description: "Runs the HyperFrames CLI in the film folder: lint, check, snapshot, render, inspect, timeline, transcribe, keyframes, compare, docs and the like. Paths are relative to the folder. Returns what it printed.",
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: "object",
|
|
50
|
+
properties: {
|
|
51
|
+
args: {
|
|
52
|
+
type: "array",
|
|
53
|
+
items: { type: "string" },
|
|
54
|
+
description: 'The arguments, e.g. ["snapshot", "film", "--at", "1,4,8"].',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ["args"],
|
|
58
|
+
},
|
|
59
|
+
async execute(input) {
|
|
60
|
+
const args = (input.args ?? []);
|
|
61
|
+
if (!args.length || !args.every((a) => typeof a === "string")) {
|
|
62
|
+
return "args: a list of strings, the subcommand first.";
|
|
63
|
+
}
|
|
64
|
+
const [cmd] = args;
|
|
65
|
+
if (!ALLOWED.has(cmd)) {
|
|
66
|
+
return `"${cmd}" is not available here. Available: ${[...ALLOWED].join(", ")}.`;
|
|
67
|
+
}
|
|
68
|
+
// Every path stays inside the folder.
|
|
69
|
+
for (const a of args) {
|
|
70
|
+
const value = a.includes("=") && a.startsWith("-") ? a.slice(a.indexOf("=") + 1) : a;
|
|
71
|
+
if (isAbsolute(value) || normalize(value).startsWith("..")) {
|
|
72
|
+
return `"${a}" leaves the film folder.`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const extra = cmd === "transcribe" ? ["--no-runtime-install"] : [];
|
|
76
|
+
const { code, out } = await runHyperframes([...args, ...extra], {
|
|
77
|
+
cwd: root,
|
|
78
|
+
signal,
|
|
79
|
+
timeoutMs: 20 * 60_000,
|
|
80
|
+
});
|
|
81
|
+
return `exit ${code}\n${out.slice(-6000)}`;
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Lines of a failed render worth reading: what failed and why, not the progress bars. */
|
|
86
|
+
function renderProblem(out) {
|
|
87
|
+
const lines = out
|
|
88
|
+
.split("\n")
|
|
89
|
+
.map((l) => l.trim())
|
|
90
|
+
.filter((l) => /✗|fail|error|blocked|warning|cannot|undefined/i.test(l) && l.length < 600);
|
|
91
|
+
return (lines.join("\n") || out.slice(-800)).slice(0, 2500);
|
|
92
|
+
}
|
|
93
|
+
/** How many times a failed final render goes back to the client to be fixed. */
|
|
94
|
+
const RENDER_FIXES = 2;
|
|
95
|
+
export async function runFilmStep(step, ctx) {
|
|
96
|
+
const found = await filmClient(step.model ?? "standard");
|
|
97
|
+
if ("problem" in found) {
|
|
98
|
+
throw new StepError(found.problem);
|
|
99
|
+
}
|
|
100
|
+
const { client, alias } = found;
|
|
101
|
+
await ctx.emit("info", { code: "filmSetup" });
|
|
102
|
+
const { root, brief } = await prepareFilmFolder(step, ctx);
|
|
103
|
+
const resume = await savedSession(root);
|
|
104
|
+
await ctx.emit("info", resume ? { code: "filmResume" } : { code: "filmClient", params: { client: client.name } });
|
|
105
|
+
const limit = AbortSignal.any([ctx.signal, AbortSignal.timeout(LIMIT_MS)]);
|
|
106
|
+
const bridge = openBridge([hyperframesTool(root, limit)]);
|
|
107
|
+
/** One turn of the client in the folder; returns its final event. */
|
|
108
|
+
const turn = async (prompt, session) => {
|
|
109
|
+
const args = [
|
|
110
|
+
"-p",
|
|
111
|
+
"--output-format",
|
|
112
|
+
"stream-json",
|
|
113
|
+
"--verbose",
|
|
114
|
+
"--model",
|
|
115
|
+
alias,
|
|
116
|
+
"--setting-sources",
|
|
117
|
+
"project",
|
|
118
|
+
"--strict-mcp-config",
|
|
119
|
+
"--mcp-config",
|
|
120
|
+
JSON.stringify({ mcpServers: { film: { type: "http", url: bridge.url } } }),
|
|
121
|
+
// The shell writes only inside the folder and has no network.
|
|
122
|
+
"--settings",
|
|
123
|
+
JSON.stringify({
|
|
124
|
+
sandbox: { enabled: true, autoAllowBashIfSandboxed: true, allowUnsandboxedCommands: false },
|
|
125
|
+
}),
|
|
126
|
+
"--allowedTools",
|
|
127
|
+
[
|
|
128
|
+
"Bash",
|
|
129
|
+
"Read(./**)",
|
|
130
|
+
"Edit(./**)",
|
|
131
|
+
"Write(./**)",
|
|
132
|
+
"Glob",
|
|
133
|
+
"Grep",
|
|
134
|
+
"Task",
|
|
135
|
+
"TodoWrite",
|
|
136
|
+
"TaskCreate",
|
|
137
|
+
"TaskUpdate",
|
|
138
|
+
"TaskList",
|
|
139
|
+
"TaskGet",
|
|
140
|
+
"Skill",
|
|
141
|
+
"mcp__film",
|
|
142
|
+
].join(","),
|
|
143
|
+
"--disallowedTools",
|
|
144
|
+
"WebFetch,WebSearch",
|
|
145
|
+
];
|
|
146
|
+
if (step.effort) {
|
|
147
|
+
args.push("--effort", step.effort);
|
|
148
|
+
}
|
|
149
|
+
if (session) {
|
|
150
|
+
args.push("--resume", session);
|
|
151
|
+
}
|
|
152
|
+
let last = null;
|
|
153
|
+
let stderr = "";
|
|
154
|
+
await new Promise((resolve, reject) => {
|
|
155
|
+
void (async () => {
|
|
156
|
+
const child = spawn(CLAUDE_BIN, args, {
|
|
157
|
+
cwd: root,
|
|
158
|
+
env: await claudeEnv(),
|
|
159
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
160
|
+
signal: limit,
|
|
161
|
+
});
|
|
162
|
+
let buffer = "";
|
|
163
|
+
let lastLook = 0;
|
|
164
|
+
let lastTask = "";
|
|
165
|
+
const subjects = [];
|
|
166
|
+
const task = async (now) => {
|
|
167
|
+
if (now && now !== lastTask) {
|
|
168
|
+
lastTask = now;
|
|
169
|
+
await ctx.emit("tool", { code: "filmTask", params: { task: now.slice(0, 90) } });
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const onEvent = async (event) => {
|
|
173
|
+
if (event.session_id && event.type === "system") {
|
|
174
|
+
await saveSession(root, event.session_id);
|
|
175
|
+
}
|
|
176
|
+
if (event.type === "result") {
|
|
177
|
+
last = event;
|
|
178
|
+
}
|
|
179
|
+
for (const part of event.message?.content ?? []) {
|
|
180
|
+
if (part.type !== "tool_use") {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
const input = part.input ?? {};
|
|
184
|
+
// What the client is on, as its own task list says; else a look at its frames.
|
|
185
|
+
if (part.name === "TodoWrite") {
|
|
186
|
+
const todos = (input.todos ?? []);
|
|
187
|
+
await task(todos.find((t) => t.status === "in_progress")?.content);
|
|
188
|
+
}
|
|
189
|
+
else if (part.name === "TaskCreate") {
|
|
190
|
+
subjects.push(String(input.subject ?? ""));
|
|
191
|
+
}
|
|
192
|
+
else if (part.name === "TaskUpdate" && input.status === "in_progress") {
|
|
193
|
+
const id = Number(input.taskId);
|
|
194
|
+
await task(typeof input.subject === "string" ? input.subject : subjects[id - 1] || undefined);
|
|
195
|
+
}
|
|
196
|
+
else if (part.name === "mcp__film__hyperframes" &&
|
|
197
|
+
input.args?.[0] === "snapshot" &&
|
|
198
|
+
Date.now() - lastLook > 60_000) {
|
|
199
|
+
lastLook = Date.now();
|
|
200
|
+
await ctx.emit("tool", { code: "filmLooks" });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
child.stdout.on("data", (chunk) => {
|
|
205
|
+
buffer += String(chunk);
|
|
206
|
+
let nl = buffer.indexOf("\n");
|
|
207
|
+
while (nl >= 0) {
|
|
208
|
+
const line = buffer.slice(0, nl).trim();
|
|
209
|
+
buffer = buffer.slice(nl + 1);
|
|
210
|
+
nl = buffer.indexOf("\n");
|
|
211
|
+
if (line.startsWith("{")) {
|
|
212
|
+
try {
|
|
213
|
+
void onEvent(JSON.parse(line)).catch(() => { });
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
// not a line of the stream
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
child.stderr.on("data", (chunk) => {
|
|
222
|
+
stderr = (stderr + String(chunk)).slice(-4000);
|
|
223
|
+
});
|
|
224
|
+
child.on("error", reject);
|
|
225
|
+
child.on("close", () => resolve());
|
|
226
|
+
child.stdin.end(prompt);
|
|
227
|
+
})().catch(reject);
|
|
228
|
+
}).catch((err) => {
|
|
229
|
+
if (ctx.signal.aborted) {
|
|
230
|
+
throw err;
|
|
231
|
+
}
|
|
232
|
+
throw new StepError(runNote("filmClientStopped", { name: client.name, detail: err.message }));
|
|
233
|
+
});
|
|
234
|
+
const result = last;
|
|
235
|
+
if (!result || result.is_error) {
|
|
236
|
+
const detail = String(result?.result ?? (stderr.trim() || "no result")).slice(0, 400);
|
|
237
|
+
const failure = failureOf(client, detail);
|
|
238
|
+
throw new StepError(runNote("filmWorkSaved", { problem: saidOf(failure) }));
|
|
239
|
+
}
|
|
240
|
+
return result;
|
|
241
|
+
};
|
|
242
|
+
const out = join(root, "film", "renders", "film.mp4");
|
|
243
|
+
let summary = "";
|
|
244
|
+
try {
|
|
245
|
+
// A review's note asks for a change: the film's code is there, so it is edited, not redone.
|
|
246
|
+
const note = ctx.state.notes[step.id]?.trim();
|
|
247
|
+
const prompt = resume && note
|
|
248
|
+
? `The person watched the film and asks for this change:\n\n${note}\n\nChange the film in film/ accordingly — keep what they did not mention — check the frames again, and end with a short summary of what you changed.`
|
|
249
|
+
: resume
|
|
250
|
+
? "Carry on with the film where you stopped. Read PROGRESS.md and the folder to see where that was, then finish it."
|
|
251
|
+
: `Make the film BRIEF.md asks for, following CLAUDE.md.\n\n${brief}`;
|
|
252
|
+
const first = await turn(prompt, resume);
|
|
253
|
+
summary = typeof first.result === "string" ? first.result.trim() : "";
|
|
254
|
+
// The final render is ours: it does not depend on the client still running. What fails
|
|
255
|
+
// goes back to the client, which fixes its code.
|
|
256
|
+
for (let attempt = 0;; attempt++) {
|
|
257
|
+
if (!existsSync(join(root, "film", "index.html"))) {
|
|
258
|
+
throw new StepError(`${client.name} hat keinen Film hinterlassen.`);
|
|
259
|
+
}
|
|
260
|
+
await ctx.emit("info", { code: "videoRendering" });
|
|
261
|
+
await rm(out, { force: true });
|
|
262
|
+
const render = await runHyperframes(["render", "film", "-o", "film/renders/film.mp4", "--crf", "23", "--quiet"], { cwd: root, signal: ctx.signal, timeoutMs: 30 * 60_000 });
|
|
263
|
+
if (render.code === 0 && existsSync(out) && (await stat(out)).size > 0) {
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
const problem = renderProblem(render.out);
|
|
267
|
+
if (attempt >= RENDER_FIXES) {
|
|
268
|
+
throw new StepError(runNote("filmRenderFailed", { detail: problem.slice(0, 400) }));
|
|
269
|
+
}
|
|
270
|
+
await ctx.emit("tool", { code: "filmFix" });
|
|
271
|
+
const fixed = await turn(`The final render of film/ failed:\n\n${problem}\n\nFind the cause in the composition's code, fix it, run \`check\` and a draft render through the hyperframes tool until both pass, and end with one line on what you fixed.`, await savedSession(root));
|
|
272
|
+
if (typeof fixed.result === "string" && fixed.result.trim()) {
|
|
273
|
+
summary = `${summary}\n\n${fixed.result.trim()}`.trim();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
finally {
|
|
278
|
+
bridge.close();
|
|
279
|
+
}
|
|
280
|
+
const ref = await ctx.saveAsset({
|
|
281
|
+
stepId: step.id,
|
|
282
|
+
kind: "video",
|
|
283
|
+
mime: "video/mp4",
|
|
284
|
+
name: `${step.id}.mp4`,
|
|
285
|
+
data: new Uint8Array(await readFile(out)),
|
|
286
|
+
ai: "generated",
|
|
287
|
+
});
|
|
288
|
+
return { text: summary.slice(0, 3000), assets: [ref], at: new Date().toISOString() };
|
|
289
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { mkdir } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { env } from "../env.js";
|
|
6
|
+
/**
|
|
7
|
+
* The HyperFrames CLI (github.com/heygen-com/hyperframes, Apache 2.0): renders a composition of
|
|
8
|
+
* HTML, CSS and JS to MP4 frame by frame in headless Chrome. Installed once into the data folder
|
|
9
|
+
* on the first film, pinned to a version; Chrome comes with it on its first render.
|
|
10
|
+
*/
|
|
11
|
+
export const HYPERFRAMES_VERSION = "0.8.137";
|
|
12
|
+
const home = join(env.dataDir, "tools", `hyperframes-${HYPERFRAMES_VERSION}`);
|
|
13
|
+
const entry = join(home, "node_modules", "hyperframes", "bin", "hyperframes.mjs");
|
|
14
|
+
let installing = null;
|
|
15
|
+
/** Terminal colour codes. */
|
|
16
|
+
const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
|
|
17
|
+
/** The CLI's entry script; installs it on first use. */
|
|
18
|
+
export function hyperframesEntry() {
|
|
19
|
+
if (existsSync(entry)) {
|
|
20
|
+
return Promise.resolve(entry);
|
|
21
|
+
}
|
|
22
|
+
installing ??= install().finally(() => {
|
|
23
|
+
installing = null;
|
|
24
|
+
});
|
|
25
|
+
return installing;
|
|
26
|
+
}
|
|
27
|
+
async function install() {
|
|
28
|
+
await mkdir(home, { recursive: true });
|
|
29
|
+
// npm sits next to the node that runs us; else the one on PATH.
|
|
30
|
+
const local = join(dirname(process.execPath), "npm");
|
|
31
|
+
const npm = existsSync(local) ? local : "npm";
|
|
32
|
+
const { code, out } = await spawnText(npm, [
|
|
33
|
+
"install",
|
|
34
|
+
"--prefix",
|
|
35
|
+
home,
|
|
36
|
+
"--no-audit",
|
|
37
|
+
"--no-fund",
|
|
38
|
+
"--loglevel",
|
|
39
|
+
"error",
|
|
40
|
+
`hyperframes@${HYPERFRAMES_VERSION}`,
|
|
41
|
+
], { cwd: home, timeoutMs: 10 * 60_000 });
|
|
42
|
+
if (code !== 0 || !existsSync(entry)) {
|
|
43
|
+
throw new Error(`HyperFrames could not be installed: ${out.slice(-400)}`);
|
|
44
|
+
}
|
|
45
|
+
return entry;
|
|
46
|
+
}
|
|
47
|
+
/** What the CLI and the renderer see: no keys of ours, no telemetry. */
|
|
48
|
+
function cliEnv() {
|
|
49
|
+
const pass = ["PATH", "HOME", "USER", "LOGNAME", "LANG", "TMPDIR", "SHELL"];
|
|
50
|
+
const out = {};
|
|
51
|
+
for (const k of pass) {
|
|
52
|
+
if (process.env[k]) {
|
|
53
|
+
out[k] = process.env[k];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// ffmpeg as the runtime finds it, first on the PATH.
|
|
57
|
+
if (env.ffmpegPath.includes("/")) {
|
|
58
|
+
out.PATH = `${dirname(env.ffmpegPath)}:${out.PATH ?? ""}`;
|
|
59
|
+
}
|
|
60
|
+
out.HYPERFRAMES_NO_TELEMETRY = "1";
|
|
61
|
+
out.HYPERFRAMES_SKIP_SKILLS = "1";
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
/** Runs `hyperframes <args>` in a project folder and returns what it printed (the tail). */
|
|
65
|
+
export async function runHyperframes(args, opts) {
|
|
66
|
+
const cli = await hyperframesEntry();
|
|
67
|
+
return spawnText(process.execPath, [cli, ...args], {
|
|
68
|
+
cwd: opts.cwd,
|
|
69
|
+
signal: opts.signal,
|
|
70
|
+
timeoutMs: opts.timeoutMs ?? 20 * 60_000,
|
|
71
|
+
env: cliEnv(),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function spawnText(bin, args, opts) {
|
|
75
|
+
return new Promise((resolve) => {
|
|
76
|
+
let out = "";
|
|
77
|
+
const child = spawn(bin, args, {
|
|
78
|
+
cwd: opts.cwd,
|
|
79
|
+
env: opts.env ?? cliEnv(),
|
|
80
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
81
|
+
signal: opts.signal,
|
|
82
|
+
});
|
|
83
|
+
const keep = (d) => {
|
|
84
|
+
out = (out + String(d)).slice(-30_000);
|
|
85
|
+
};
|
|
86
|
+
child.stdout.on("data", keep);
|
|
87
|
+
child.stderr.on("data", keep);
|
|
88
|
+
const timer = setTimeout(() => child.kill("SIGTERM"), opts.timeoutMs);
|
|
89
|
+
child.on("error", (err) => {
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
resolve({ code: 1, out: `${out}\n${err.message}` });
|
|
92
|
+
});
|
|
93
|
+
child.on("close", (code) => {
|
|
94
|
+
clearTimeout(timer);
|
|
95
|
+
// Colours and progress bars mean nothing to a model reading this.
|
|
96
|
+
resolve({ code: code ?? 1, out: out.replace(ANSI, "") });
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { env } from "./env.js";
|
|
2
|
+
const cache = new Map();
|
|
3
|
+
let queue = Promise.resolve();
|
|
4
|
+
let lastCall = 0;
|
|
5
|
+
/** "Herrengasse 16, 8010 Graz" from a reverse-geocoding answer; null when it names nothing. */
|
|
6
|
+
export function placeLabel(result) {
|
|
7
|
+
const a = result.address;
|
|
8
|
+
if (!a) {
|
|
9
|
+
return result.display_name?.split(",").slice(0, 3).join(",").trim() || null;
|
|
10
|
+
}
|
|
11
|
+
const street = [a.road ?? a.pedestrian ?? a.footway ?? a.path, a.house_number]
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join(" ");
|
|
14
|
+
const town = a.city ?? a.town ?? a.village ?? a.municipality ?? a.hamlet ?? a.county;
|
|
15
|
+
const place = [a.postcode, town].filter(Boolean).join(" ");
|
|
16
|
+
return [street, place].filter(Boolean).join(", ") || null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The address of a position, when the server has a geocoder (`GEOCODER_URL`). Calls go out one
|
|
20
|
+
* at a time and at most one a second — what a public Nominatim asks of its users.
|
|
21
|
+
*/
|
|
22
|
+
export function reverseGeocode(lat, lng, language = "en") {
|
|
23
|
+
if (!env.geocoderUrl) {
|
|
24
|
+
return Promise.resolve(null);
|
|
25
|
+
}
|
|
26
|
+
// ~10 m: the same spot asked twice is one call.
|
|
27
|
+
const key = `${lat.toFixed(4)},${lng.toFixed(4)},${language}`;
|
|
28
|
+
if (cache.has(key)) {
|
|
29
|
+
return Promise.resolve(cache.get(key) ?? null);
|
|
30
|
+
}
|
|
31
|
+
const call = queue.then(async () => {
|
|
32
|
+
await new Promise((r) => setTimeout(r, Math.max(0, lastCall + 1000 - Date.now())));
|
|
33
|
+
lastCall = Date.now();
|
|
34
|
+
try {
|
|
35
|
+
const url = new URL(env.geocoderUrl);
|
|
36
|
+
url.searchParams.set("format", "jsonv2");
|
|
37
|
+
url.searchParams.set("lat", String(lat));
|
|
38
|
+
url.searchParams.set("lon", String(lng));
|
|
39
|
+
url.searchParams.set("zoom", "18");
|
|
40
|
+
url.searchParams.set("addressdetails", "1");
|
|
41
|
+
const res = await fetch(url, {
|
|
42
|
+
headers: { "accept-language": language, "user-agent": `engenty-wizards (${env.appUrl})` },
|
|
43
|
+
signal: AbortSignal.timeout(4000),
|
|
44
|
+
});
|
|
45
|
+
const label = res.ok ? placeLabel((await res.json())) : null;
|
|
46
|
+
if (cache.size > 500) {
|
|
47
|
+
cache.clear();
|
|
48
|
+
}
|
|
49
|
+
cache.set(key, label);
|
|
50
|
+
return label;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
queue = call;
|
|
57
|
+
return call;
|
|
58
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { resolveEnv, run } from "./env.js";
|
|
4
|
+
import { failureOf, HarnessModel, runClient, } from "./model.js";
|
|
5
|
+
/**
|
|
6
|
+
* Antigravity CLI: `agy` answers on the Google sign-in it cached — the Google AI subscription,
|
|
7
|
+
* which Gemini CLI no longer serves. The prompt goes on stdin as one stream-json message, the
|
|
8
|
+
* instructions in front of it: the client reads no system prompt and no rules of a folder it
|
|
9
|
+
* does not trust. It searches the web and reads the call's files with its own tools; the step's
|
|
10
|
+
* tools it cannot take, as it reads MCP servers only from the person's own config. The answer
|
|
11
|
+
* is checked against the schema by the client itself.
|
|
12
|
+
*/
|
|
13
|
+
export const AGY_BIN = process.env.AGY_BIN?.trim() || "agy";
|
|
14
|
+
/** The models carry their effort in the name: `gemini-3.8-flash-<low|medium|high>`. */
|
|
15
|
+
const CLASSES = {
|
|
16
|
+
classifier: "gemini-3.8-flash-low",
|
|
17
|
+
standard: "gemini-3.8-flash-medium",
|
|
18
|
+
high: "gemini-3.8-flash-high",
|
|
19
|
+
highest: "gemini-3.8-flash-high",
|
|
20
|
+
};
|
|
21
|
+
/** The model of that name at the effort a step asks for, where the name carries one. */
|
|
22
|
+
export function withEffort(model, effort) {
|
|
23
|
+
return effort ? model.replace(/-(low|medium|high)$/, `-${effort}`) : model;
|
|
24
|
+
}
|
|
25
|
+
const spec = {
|
|
26
|
+
id: "antigravity",
|
|
27
|
+
passThrough: /^(AGY_ADC_AUTH|GOOGLE_APPLICATION_CREDENTIALS|GOOGLE_CLOUD_PROJECT)$/,
|
|
28
|
+
keyVars: [],
|
|
29
|
+
// No status command, and a call without a sign-in waits a minute for one in the browser:
|
|
30
|
+
// listing the models is quick, and refuses at once when nobody is signed in.
|
|
31
|
+
async auth(env) {
|
|
32
|
+
try {
|
|
33
|
+
await run(AGY_BIN, ["models"], { timeout: 20_000, env });
|
|
34
|
+
return "subscription";
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return "none";
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
/** The client's result among the events it prints; null when it printed none. */
|
|
42
|
+
export function antigravityAnswer(stdout) {
|
|
43
|
+
for (const line of stdout.trim().split("\n").reverse()) {
|
|
44
|
+
try {
|
|
45
|
+
const event = JSON.parse(line);
|
|
46
|
+
if (event?.event === "result" && event.result) {
|
|
47
|
+
return event.result;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// a line it logs
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
/** The instructions in front of the prompt: the client takes one message and nothing besides. */
|
|
57
|
+
export function antigravityMessage(system, prompt) {
|
|
58
|
+
const content = system ? `<instructions>\n${system}\n</instructions>\n\n${prompt}` : prompt;
|
|
59
|
+
return `${JSON.stringify({ event: "user", message: { content } })}\n`;
|
|
60
|
+
}
|
|
61
|
+
class AntigravityModel extends HarnessModel {
|
|
62
|
+
provider = "antigravity";
|
|
63
|
+
nativeSchema = true;
|
|
64
|
+
usesTools = false;
|
|
65
|
+
async invoke(call) {
|
|
66
|
+
const { env, auth } = await resolveEnv(spec);
|
|
67
|
+
if (auth === "none") {
|
|
68
|
+
throw failureOf(this.harness, "not logged in");
|
|
69
|
+
}
|
|
70
|
+
const args = [
|
|
71
|
+
"--input-format",
|
|
72
|
+
"stream-json",
|
|
73
|
+
"--output-format",
|
|
74
|
+
"stream-json",
|
|
75
|
+
"--model",
|
|
76
|
+
withEffort(this.modelId, call.effort),
|
|
77
|
+
"--disable-slash-commands",
|
|
78
|
+
];
|
|
79
|
+
if (call.schema) {
|
|
80
|
+
const schemaFile = join(call.dir, "schema.json");
|
|
81
|
+
writeFileSync(schemaFile, JSON.stringify(call.schema));
|
|
82
|
+
args.push("--json-schema", schemaFile);
|
|
83
|
+
}
|
|
84
|
+
const { stdout, stderr, code } = await runClient(AGY_BIN, args, {
|
|
85
|
+
cwd: call.dir,
|
|
86
|
+
env: { ...env, NO_COLOR: "1" },
|
|
87
|
+
signal: call.signal,
|
|
88
|
+
stdin: antigravityMessage(call.system, call.prompt),
|
|
89
|
+
});
|
|
90
|
+
const result = antigravityAnswer(stdout);
|
|
91
|
+
if (!result) {
|
|
92
|
+
throw failureOf(this.harness, stderr.trim() || `exit ${code}`);
|
|
93
|
+
}
|
|
94
|
+
if (result.status !== "SUCCESS") {
|
|
95
|
+
throw failureOf(this.harness, result.error || stderr.trim() || result.status || "error");
|
|
96
|
+
}
|
|
97
|
+
const u = result.usage ?? {};
|
|
98
|
+
return {
|
|
99
|
+
text: result.structured_output !== undefined
|
|
100
|
+
? JSON.stringify(result.structured_output)
|
|
101
|
+
: (result.response ?? ""),
|
|
102
|
+
usage: {
|
|
103
|
+
input: u.input_tokens ?? 0,
|
|
104
|
+
cacheRead: u.cache_read_tokens ?? 0,
|
|
105
|
+
output: (u.output_tokens ?? 0) + (u.thinking_tokens ?? 0),
|
|
106
|
+
},
|
|
107
|
+
sessionId: result.conversation_id,
|
|
108
|
+
meta: { turns: result.num_turns ?? 0, seconds: result.duration_seconds ?? 0 },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export const antigravity = {
|
|
113
|
+
...spec,
|
|
114
|
+
name: "Antigravity",
|
|
115
|
+
bin: AGY_BIN,
|
|
116
|
+
classes: CLASSES,
|
|
117
|
+
async version(env) {
|
|
118
|
+
try {
|
|
119
|
+
const { stdout } = await run(AGY_BIN, ["--version"], { timeout: 10_000, env });
|
|
120
|
+
return stdout.trim().split("\n").pop()?.trim() || null;
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
// No login command: the client asks for the Google sign-in when it starts without one.
|
|
127
|
+
login: { args: [], interactive: true },
|
|
128
|
+
model: (alias, effort) => new AntigravityModel(antigravity, alias || CLASSES.standard, effort),
|
|
129
|
+
};
|