wizards 0.7.4 → 0.7.6
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/bin/wizards.mjs +95 -26
- package/{apps/web/dist/install.sh → install.sh} +23 -5
- package/package.json +2 -58
- package/apps/runtime/dist/agents/architect.js +0 -444
- package/apps/runtime/dist/agents/studio-assistant.js +0 -883
- package/apps/runtime/dist/agents/subscription.js +0 -207
- package/apps/runtime/dist/agents/thought.js +0 -21
- package/apps/runtime/dist/agents/website.js +0 -480
- package/apps/runtime/dist/app.js +0 -359
- package/apps/runtime/dist/apple/wizards-apple +0 -0
- package/apps/runtime/dist/assistant/browser.js +0 -26
- package/apps/runtime/dist/assistant/docs.js +0 -158
- package/apps/runtime/dist/assistant/knows.js +0 -353
- package/apps/runtime/dist/assistant/primer.js +0 -26
- package/apps/runtime/dist/assistant/runs.js +0 -24
- package/apps/runtime/dist/auth/account.js +0 -175
- package/apps/runtime/dist/auth/device.js +0 -112
- package/apps/runtime/dist/auth/index.js +0 -358
- package/apps/runtime/dist/auth/keys.js +0 -55
- package/apps/runtime/dist/auth/local-ticket.js +0 -26
- package/apps/runtime/dist/authoring/example.js +0 -74
- package/apps/runtime/dist/authoring/guide.js +0 -433
- package/apps/runtime/dist/authoring/ops.js +0 -117
- package/apps/runtime/dist/browser/fast/action-space.js +0 -160
- package/apps/runtime/dist/browser/fast/classifier.js +0 -91
- package/apps/runtime/dist/browser/fast/decide.js +0 -171
- package/apps/runtime/dist/browser/fast/driver.js +0 -141
- package/apps/runtime/dist/browser/fast/instructions.js +0 -33
- package/apps/runtime/dist/browser/fast/run.js +0 -249
- package/apps/runtime/dist/browser/fast/span-picker.js +0 -153
- package/apps/runtime/dist/browser/fast/text-helper.js +0 -178
- package/apps/runtime/dist/browser/snapshot.js +0 -335
- package/apps/runtime/dist/cli/account.js +0 -385
- package/apps/runtime/dist/cli/autostart.js +0 -182
- package/apps/runtime/dist/cli/autoupdate.js +0 -221
- package/apps/runtime/dist/cli/clients.js +0 -44
- package/apps/runtime/dist/cli/connect.js +0 -540
- package/apps/runtime/dist/cli/environment.js +0 -93
- package/apps/runtime/dist/cli/exec.js +0 -45
- package/apps/runtime/dist/cli/features.js +0 -50
- package/apps/runtime/dist/cli/home.js +0 -88
- package/apps/runtime/dist/cli/install-env.js +0 -33
- package/apps/runtime/dist/cli/machine.js +0 -107
- package/apps/runtime/dist/cli/main.js +0 -222
- package/apps/runtime/dist/cli/mcp.js +0 -136
- package/apps/runtime/dist/cli/menu.js +0 -202
- package/apps/runtime/dist/cli/processes.js +0 -72
- package/apps/runtime/dist/cli/report.js +0 -66
- package/apps/runtime/dist/cli/setup.js +0 -335
- package/apps/runtime/dist/cli/start.js +0 -276
- package/apps/runtime/dist/cli/status.js +0 -203
- package/apps/runtime/dist/cli/ui.js +0 -59
- package/apps/runtime/dist/cli/uninstall-main.js +0 -20
- package/apps/runtime/dist/cli/uninstall.js +0 -231
- package/apps/runtime/dist/cli/update.js +0 -86
- package/apps/runtime/dist/cli/validate.js +0 -75
- package/apps/runtime/dist/cli/versions.js +0 -106
- package/apps/runtime/dist/connectors/builtin.js +0 -86
- package/apps/runtime/dist/connectors/external.js +0 -409
- package/apps/runtime/dist/connectors/gmail.js +0 -107
- package/apps/runtime/dist/connectors/imap.js +0 -261
- package/apps/runtime/dist/connectors/index.js +0 -325
- package/apps/runtime/dist/connectors/mail.js +0 -72
- package/apps/runtime/dist/connectors/outlook.js +0 -90
- package/apps/runtime/dist/connectors/plugin-connections.js +0 -343
- package/apps/runtime/dist/connectors/via-account.js +0 -65
- package/apps/runtime/dist/credits/credits.js +0 -100
- package/apps/runtime/dist/credits/estimate.js +0 -152
- package/apps/runtime/dist/db/adopt.js +0 -149
- package/apps/runtime/dist/db/client.js +0 -173
- package/apps/runtime/dist/db/control-schema.js +0 -133
- package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +0 -47
- package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +0 -41
- package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +0 -1
- package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +0 -3
- package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +0 -6
- package/apps/runtime/dist/db/migrations/control/0005_chilly_oracle.sql +0 -1
- package/apps/runtime/dist/db/migrations/control/0006_sleepy_mojo.sql +0 -1
- package/apps/runtime/dist/db/migrations/control/0007_common_the_hand.sql +0 -15
- package/apps/runtime/dist/db/migrations/control/0008_runner.sql +0 -8
- package/apps/runtime/dist/db/migrations/control/0009_plugin_claim.sql +0 -9
- package/apps/runtime/dist/db/migrations/control/0010_tan_snowbird.sql +0 -6
- package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +0 -311
- package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +0 -599
- package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +0 -607
- package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +0 -311
- package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +0 -350
- package/apps/runtime/dist/db/migrations/control/meta/0005_snapshot.json +0 -358
- package/apps/runtime/dist/db/migrations/control/meta/0006_snapshot.json +0 -365
- package/apps/runtime/dist/db/migrations/control/meta/0007_snapshot.json +0 -460
- package/apps/runtime/dist/db/migrations/control/meta/0008_snapshot.json +0 -505
- package/apps/runtime/dist/db/migrations/control/meta/0009_snapshot.json +0 -561
- package/apps/runtime/dist/db/migrations/control/meta/0010_snapshot.json +0 -600
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +0 -83
- package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +0 -188
- package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +0 -1
- package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +0 -1
- package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +0 -52
- package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +0 -6
- package/apps/runtime/dist/db/migrations/tenant/0005_reflective_forgotten_one.sql +0 -2
- package/apps/runtime/dist/db/migrations/tenant/0006_hard_war_machine.sql +0 -30
- package/apps/runtime/dist/db/migrations/tenant/0007_space_data.sql +0 -43
- package/apps/runtime/dist/db/migrations/tenant/0008_run_event_note.sql +0 -1
- package/apps/runtime/dist/db/migrations/tenant/0009_knowledge.sql +0 -104
- package/apps/runtime/dist/db/migrations/tenant/0010_plugin_connection.sql +0 -15
- package/apps/runtime/dist/db/migrations/tenant/0011_runners.sql +0 -2
- package/apps/runtime/dist/db/migrations/tenant/0012_assistant_chat.sql +0 -40
- package/apps/runtime/dist/db/migrations/tenant/0013_run_origin.sql +0 -1
- package/apps/runtime/dist/db/migrations/tenant/0014_run_answer.sql +0 -2
- package/apps/runtime/dist/db/migrations/tenant/0015_device_calls.sql +0 -13
- package/apps/runtime/dist/db/migrations/tenant/0016_even_trish_tilby.sql +0 -12
- package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +0 -1323
- package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +0 -1330
- package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +0 -1337
- package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +0 -1605
- package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +0 -1645
- package/apps/runtime/dist/db/migrations/tenant/meta/0005_snapshot.json +0 -1659
- package/apps/runtime/dist/db/migrations/tenant/meta/0006_snapshot.json +0 -1696
- package/apps/runtime/dist/db/migrations/tenant/meta/0007_snapshot.json +0 -2012
- package/apps/runtime/dist/db/migrations/tenant/meta/0008_snapshot.json +0 -2019
- package/apps/runtime/dist/db/migrations/tenant/meta/0009_snapshot.json +0 -2837
- package/apps/runtime/dist/db/migrations/tenant/meta/0010_snapshot.json +0 -2942
- package/apps/runtime/dist/db/migrations/tenant/meta/0011_snapshot.json +0 -2956
- package/apps/runtime/dist/db/migrations/tenant/meta/0012_snapshot.json +0 -3132
- package/apps/runtime/dist/db/migrations/tenant/meta/0013_snapshot.json +0 -3139
- package/apps/runtime/dist/db/migrations/tenant/meta/0014_snapshot.json +0 -3154
- package/apps/runtime/dist/db/migrations/tenant/meta/0015_snapshot.json +0 -3243
- package/apps/runtime/dist/db/migrations/tenant/meta/0016_snapshot.json +0 -3326
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +0 -125
- package/apps/runtime/dist/db/schema.js +0 -602
- package/apps/runtime/dist/debug.js +0 -196
- package/apps/runtime/dist/docs/dev/index.md +0 -41
- package/apps/runtime/dist/docs/dev/meta.json +0 -7
- package/apps/runtime/dist/docs/dev/plugins/connections.md +0 -74
- package/apps/runtime/dist/docs/dev/plugins/events.md +0 -89
- package/apps/runtime/dist/docs/dev/plugins/examples.md +0 -101
- package/apps/runtime/dist/docs/dev/plugins/index.md +0 -78
- package/apps/runtime/dist/docs/dev/plugins/layout.md +0 -90
- package/apps/runtime/dist/docs/dev/plugins/meta.json +0 -28
- package/apps/runtime/dist/docs/dev/plugins/quick-start.md +0 -94
- package/apps/runtime/dist/docs/dev/plugins/reference.md +0 -348
- package/apps/runtime/dist/docs/dev/plugins/reloading.md +0 -76
- package/apps/runtime/dist/docs/dev/plugins/routes.md +0 -185
- package/apps/runtime/dist/docs/dev/plugins/runners.md +0 -230
- package/apps/runtime/dist/docs/dev/plugins/server.md +0 -281
- package/apps/runtime/dist/docs/dev/plugins/shipping.md +0 -79
- package/apps/runtime/dist/docs/dev/plugins/space.md +0 -297
- package/apps/runtime/dist/docs/dev/plugins/starters.md +0 -70
- package/apps/runtime/dist/docs/dev/plugins/studio.md +0 -363
- package/apps/runtime/dist/docs/dev/plugins/styling.md +0 -129
- package/apps/runtime/dist/docs/dev/plugins/tables.md +0 -104
- package/apps/runtime/dist/docs/dev/plugins/tools.md +0 -139
- package/apps/runtime/dist/docs/dev/wizard-format.md +0 -121
- package/apps/runtime/dist/docs/meta.json +0 -3
- package/apps/runtime/dist/docs/user/ai-apps.md +0 -112
- package/apps/runtime/dist/docs/user/assistant.md +0 -77
- package/apps/runtime/dist/docs/user/build-a-wizard.md +0 -116
- package/apps/runtime/dist/docs/user/command-line.md +0 -83
- package/apps/runtime/dist/docs/user/connectors.md +0 -90
- package/apps/runtime/dist/docs/user/create-account.md +0 -52
- package/apps/runtime/dist/docs/user/data.md +0 -66
- package/apps/runtime/dist/docs/user/first-start.md +0 -60
- package/apps/runtime/dist/docs/user/index.md +0 -49
- package/apps/runtime/dist/docs/user/install.md +0 -121
- package/apps/runtime/dist/docs/user/local-only.md +0 -42
- package/apps/runtime/dist/docs/user/meta.json +0 -32
- package/apps/runtime/dist/docs/user/models.md +0 -156
- package/apps/runtime/dist/docs/user/plugins.md +0 -71
- package/apps/runtime/dist/docs/user/run.md +0 -98
- package/apps/runtime/dist/docs/user/server.md +0 -52
- package/apps/runtime/dist/docs/user/space.md +0 -126
- package/apps/runtime/dist/docs/user/steps.md +0 -220
- package/apps/runtime/dist/docs/user/test-and-share.md +0 -224
- package/apps/runtime/dist/docs/user/troubleshooting.md +0 -67
- package/apps/runtime/dist/docs/user/wordpress.md +0 -121
- package/apps/runtime/dist/documents/parse.js +0 -246
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +0 -193
- package/apps/runtime/dist/engenty/connections-external/errors.js +0 -11
- package/apps/runtime/dist/engenty/connections-external/import-service.js +0 -270
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +0 -34
- package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +0 -185
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +0 -63
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +0 -130
- package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +0 -143
- package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +0 -143
- package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +0 -119
- package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +0 -88
- package/apps/runtime/dist/engenty/connections-external/registry-client.js +0 -336
- package/apps/runtime/dist/engenty/connections-external/registry-source.js +0 -82
- package/apps/runtime/dist/engenty/connections-external/types.js +0 -7
- package/apps/runtime/dist/engenty/connections-github/connector.js +0 -209
- package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +0 -381
- package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +0 -94
- package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +0 -290
- package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +0 -567
- package/apps/runtime/dist/engenty/connections-google/definitions.js +0 -11
- package/apps/runtime/dist/engenty/connections-google/shared.js +0 -73
- package/apps/runtime/dist/engenty/connections-hubspot/connector.js +0 -140
- package/apps/runtime/dist/engenty/connections-microsoft/action.js +0 -17
- package/apps/runtime/dist/engenty/connections-microsoft/graph.js +0 -114
- package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +0 -286
- package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +0 -492
- package/apps/runtime/dist/engenty/connections-s3/s3.js +0 -328
- package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +0 -86
- package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +0 -150
- package/apps/runtime/dist/engenty/connections-sdk/registry.js +0 -89
- package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +0 -84
- package/apps/runtime/dist/engenty/connections-sdk/types.js +0 -30
- package/apps/runtime/dist/engenty/connections-slack/connector.js +0 -360
- package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +0 -178
- package/apps/runtime/dist/engenty/csv-import/import-sources.js +0 -87
- package/apps/runtime/dist/engenty/csv-import/parse-csv.js +0 -129
- package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +0 -20
- package/apps/runtime/dist/engenty/csv-import/types.js +0 -1
- package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +0 -159
- package/apps/runtime/dist/engenty/doc-converter/interface.js +0 -9
- package/apps/runtime/dist/engenty/doc-converter/page-break.js +0 -92
- package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +0 -72
- package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +0 -30
- package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +0 -4
- package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +0 -73
- package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +0 -63
- package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +0 -40
- package/apps/runtime/dist/engenty/search-index/chunks.js +0 -164
- package/apps/runtime/dist/engenty/search-index/contracts.js +0 -9
- package/apps/runtime/dist/engenty/shims/connections-sdk.js +0 -39
- package/apps/runtime/dist/engenty/shims/plugin-sdk.js +0 -1
- package/apps/runtime/dist/engenty/shims/web-ingest.js +0 -19
- package/apps/runtime/dist/engenty/web-ingest/ssrf.js +0 -277
- package/apps/runtime/dist/engine/asks.js +0 -82
- package/apps/runtime/dist/engine/decide.js +0 -82
- package/apps/runtime/dist/engine/device.js +0 -194
- package/apps/runtime/dist/engine/events.js +0 -128
- package/apps/runtime/dist/engine/input.js +0 -208
- package/apps/runtime/dist/engine/owner.js +0 -32
- package/apps/runtime/dist/engine/prepare.js +0 -90
- package/apps/runtime/dist/engine/push.js +0 -58
- package/apps/runtime/dist/engine/requirements.js +0 -355
- package/apps/runtime/dist/engine/resources.js +0 -198
- package/apps/runtime/dist/engine/runner.js +0 -970
- package/apps/runtime/dist/engine/steps.js +0 -1000
- package/apps/runtime/dist/engine/surface.js +0 -91
- package/apps/runtime/dist/engine/template.js +0 -240
- package/apps/runtime/dist/engine/types.js +0 -4
- package/apps/runtime/dist/env.js +0 -295
- package/apps/runtime/dist/features.js +0 -123
- package/apps/runtime/dist/files/blobs.js +0 -22
- package/apps/runtime/dist/files/objects.js +0 -86
- package/apps/runtime/dist/files/storage.js +0 -120
- package/apps/runtime/dist/files/web-images.js +0 -101
- package/apps/runtime/dist/film/project.js +0 -257
- package/apps/runtime/dist/film/skills.js +0 -91
- package/apps/runtime/dist/film/sounds.js +0 -122
- package/apps/runtime/dist/film/step.js +0 -289
- package/apps/runtime/dist/film/tools.js +0 -99
- package/apps/runtime/dist/geocode.js +0 -58
- package/apps/runtime/dist/harness/antigravity.js +0 -129
- package/apps/runtime/dist/harness/apple.js +0 -270
- package/apps/runtime/dist/harness/claude.js +0 -147
- package/apps/runtime/dist/harness/codex.js +0 -229
- package/apps/runtime/dist/harness/cursor.js +0 -93
- package/apps/runtime/dist/harness/env.js +0 -124
- package/apps/runtime/dist/harness/index.js +0 -95
- package/apps/runtime/dist/harness/model.js +0 -279
- package/apps/runtime/dist/harness/prompt.js +0 -121
- package/apps/runtime/dist/harness/terminal.js +0 -194
- package/apps/runtime/dist/harness/types.js +0 -7
- package/apps/runtime/dist/index.js +0 -113
- package/apps/runtime/dist/limits.js +0 -81
- package/apps/runtime/dist/link-preview.js +0 -60
- package/apps/runtime/dist/log.js +0 -106
- package/apps/runtime/dist/manage.js +0 -249
- package/apps/runtime/dist/mcp/auth.js +0 -161
- package/apps/runtime/dist/mcp/bridge.js +0 -59
- package/apps/runtime/dist/mcp/flow-app.js +0 -97
- package/apps/runtime/dist/mcp/handler.js +0 -54
- package/apps/runtime/dist/mcp/scopes.js +0 -14
- package/apps/runtime/dist/mcp/seen.js +0 -65
- package/apps/runtime/dist/mcp/tools.js +0 -572
- package/apps/runtime/dist/media/conversation.js +0 -167
- package/apps/runtime/dist/media/ffmpeg.js +0 -121
- package/apps/runtime/dist/media/generate.js +0 -120
- package/apps/runtime/dist/media/marking.js +0 -121
- package/apps/runtime/dist/media/transcribe.js +0 -198
- package/apps/runtime/dist/model-errors.js +0 -42
- package/apps/runtime/dist/models.js +0 -1164
- package/apps/runtime/dist/plugin.js +0 -61
- package/apps/runtime/dist/plugins/channels.js +0 -78
- package/apps/runtime/dist/plugins/claims.js +0 -56
- package/apps/runtime/dist/plugins/discovery.js +0 -155
- package/apps/runtime/dist/plugins/events.js +0 -63
- package/apps/runtime/dist/plugins/jobs.js +0 -64
- package/apps/runtime/dist/plugins/loader.js +0 -508
- package/apps/runtime/dist/plugins/migrations.js +0 -69
- package/apps/runtime/dist/plugins/pro-keys.js +0 -34
- package/apps/runtime/dist/plugins/pro-state.js +0 -83
- package/apps/runtime/dist/plugins/pro.js +0 -310
- package/apps/runtime/dist/plugins/public.js +0 -44
- package/apps/runtime/dist/plugins/registry.js +0 -122
- package/apps/runtime/dist/plugins/runs.js +0 -210
- package/apps/runtime/dist/render/browser-path.js +0 -54
- package/apps/runtime/dist/render/chromium.js +0 -98
- package/apps/runtime/dist/render/convert.js +0 -158
- package/apps/runtime/dist/render/downloads.js +0 -299
- package/apps/runtime/dist/render/guard.js +0 -25
- package/apps/runtime/dist/render/shaped.js +0 -137
- package/apps/runtime/dist/routes/api.js +0 -440
- package/apps/runtime/dist/routes/debug.js +0 -42
- package/apps/runtime/dist/routes/delivery.js +0 -90
- package/apps/runtime/dist/routes/internal.js +0 -81
- package/apps/runtime/dist/routes/lang.js +0 -25
- package/apps/runtime/dist/routes/marketplace.js +0 -43
- package/apps/runtime/dist/routes/plugin-public.js +0 -113
- package/apps/runtime/dist/routes/plugins.js +0 -212
- package/apps/runtime/dist/routes/runs.js +0 -1422
- package/apps/runtime/dist/routes/studio.js +0 -1629
- package/apps/runtime/dist/routes/wizard-stream.js +0 -30
- package/apps/runtime/dist/running.js +0 -39
- package/apps/runtime/dist/sandbox/docker.js +0 -75
- package/apps/runtime/dist/sandbox/index.js +0 -23
- package/apps/runtime/dist/sandbox/types.js +0 -1
- package/apps/runtime/dist/secrets/crypto.js +0 -28
- package/apps/runtime/dist/secrets/signing.js +0 -52
- package/apps/runtime/dist/secrets/vault.js +0 -59
- package/apps/runtime/dist/services/access.js +0 -88
- package/apps/runtime/dist/services/api.js +0 -248
- package/apps/runtime/dist/services/architect.js +0 -95
- package/apps/runtime/dist/services/assistant-chats.js +0 -311
- package/apps/runtime/dist/services/brand.js +0 -85
- package/apps/runtime/dist/services/cloud.js +0 -456
- package/apps/runtime/dist/services/draft-events.js +0 -27
- package/apps/runtime/dist/services/engenty-shapes.js +0 -71
- package/apps/runtime/dist/services/errors.js +0 -29
- package/apps/runtime/dist/services/files.js +0 -178
- package/apps/runtime/dist/services/knowledge-model.js +0 -559
- package/apps/runtime/dist/services/knowledge.js +0 -721
- package/apps/runtime/dist/services/links.js +0 -16
- package/apps/runtime/dist/services/marketplace.js +0 -492
- package/apps/runtime/dist/services/onboarding.js +0 -152
- package/apps/runtime/dist/services/package-file.js +0 -82
- package/apps/runtime/dist/services/package.js +0 -170
- package/apps/runtime/dist/services/profile.js +0 -51
- package/apps/runtime/dist/services/project-files.js +0 -439
- package/apps/runtime/dist/services/project-index.js +0 -707
- package/apps/runtime/dist/services/projects.js +0 -387
- package/apps/runtime/dist/services/relevance.js +0 -58
- package/apps/runtime/dist/services/runners.js +0 -178
- package/apps/runtime/dist/services/runs.js +0 -524
- package/apps/runtime/dist/services/shares.js +0 -130
- package/apps/runtime/dist/services/site.js +0 -270
- package/apps/runtime/dist/services/space-categories.js +0 -861
- package/apps/runtime/dist/services/space-data.js +0 -792
- package/apps/runtime/dist/services/space-origin.js +0 -207
- package/apps/runtime/dist/services/spaces.js +0 -656
- package/apps/runtime/dist/services/translations.js +0 -306
- package/apps/runtime/dist/services/widgets.js +0 -34
- package/apps/runtime/dist/services/wizard-icon.js +0 -157
- package/apps/runtime/dist/services/wizards.js +0 -420
- package/apps/runtime/dist/settings.js +0 -16
- package/apps/runtime/dist/store/errors.js +0 -4
- package/apps/runtime/dist/store/index.js +0 -299
- package/apps/runtime/dist/store/shared-lists.js +0 -123
- package/apps/runtime/dist/tenants/control.js +0 -238
- package/apps/runtime/dist/tenants/tenant.js +0 -26
- package/apps/runtime/dist/texts.js +0 -207
- package/apps/runtime/dist/tools/browser.js +0 -703
- package/apps/runtime/dist/tools/connector.js +0 -204
- package/apps/runtime/dist/tools/index.js +0 -291
- package/apps/runtime/dist/tools/mail.js +0 -104
- package/apps/runtime/dist/tools/net-guard.js +0 -170
- package/apps/runtime/dist/tools/pages.js +0 -81
- package/apps/runtime/dist/tools/plugin.js +0 -180
- package/apps/runtime/dist/tools/project.js +0 -154
- package/apps/runtime/dist/tools/shared.js +0 -69
- package/apps/runtime/dist/tools/store.js +0 -238
- package/apps/runtime/dist/update.js +0 -113
- package/apps/runtime/dist/widgets/bundle.js +0 -99
- package/apps/runtime/dist/widgets/render.js +0 -329
- package/apps/runtime/dist/widgets/runtime.js +0 -108
- package/apps/runtime/dist/widgets/script.js +0 -30
- package/apps/runtime/dist/widgets/step.js +0 -223
- package/apps/web/dist/ai-labels/ai-black.svg +0 -20
- package/apps/web/dist/ai-labels/ai-generated-black.svg +0 -31
- package/apps/web/dist/ai-labels/ai-generated-white.svg +0 -32
- package/apps/web/dist/ai-labels/ai-modified-black.svg +0 -30
- package/apps/web/dist/ai-labels/ai-modified-white.svg +0 -31
- package/apps/web/dist/ai-labels/ai-white.svg +0 -21
- package/apps/web/dist/assets/AboutDialog-BI6487_s.js +0 -1
- package/apps/web/dist/assets/ChangelogDialog-B63QWuUV.js +0 -1
- package/apps/web/dist/assets/ChatView-BjQVHGjn.js +0 -10
- package/apps/web/dist/assets/EditorPage-DrprS19h.js +0 -3
- package/apps/web/dist/assets/FlowPreview-CusP7ci9.js +0 -1
- package/apps/web/dist/assets/Harness-BrP-ENHg.css +0 -1
- package/apps/web/dist/assets/Harness-CCMqhtuk.js +0 -16
- package/apps/web/dist/assets/NewWizardChannels-DpcWsST7.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-BXePNBa9.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-BtZ6sHJi.js +0 -1
- package/apps/web/dist/assets/ProjectPage-DHOL8FXt.js +0 -1
- package/apps/web/dist/assets/PublicRunner-BLRVe7G0.js +0 -1
- package/apps/web/dist/assets/ReadOnly-BV8o_HtK.js +0 -1
- package/apps/web/dist/assets/RunDrawer-D-T8pYfB.js +0 -4
- package/apps/web/dist/assets/RunnerView-BinlRsGF.js +0 -1
- package/apps/web/dist/assets/SettingsPage-B6M-jFJw.js +0 -1
- package/apps/web/dist/assets/SetupPage-DI6c--4V.js +0 -1
- package/apps/web/dist/assets/SharePage-C4cESaes.js +0 -1
- package/apps/web/dist/assets/changelog-Dj_yd2vG.js +0 -1
- package/apps/web/dist/assets/engenty-eXZ-EAwd.js +0 -1
- package/apps/web/dist/assets/esm-DXeMu8Lb.js +0 -7
- package/apps/web/dist/assets/fluffy-engenty-ClRou7yu.js +0 -456
- package/apps/web/dist/assets/index-AfUa8xKD.css +0 -1
- package/apps/web/dist/assets/index-yiE9Lun0.js +0 -14
- package/apps/web/dist/assets/jsx-runtime-BNakU3Ej.js +0 -1
- package/apps/web/dist/assets/lock-R_CfU0Xo.js +0 -1
- package/apps/web/dist/assets/oss-credits-cZ9NUaLZ.js +0 -1
- package/apps/web/dist/assets/pdfmake-Cx9scTbD.js +0 -228
- package/apps/web/dist/assets/phone-CgrIS4_-.js +0 -1
- package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +0 -1
- package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +0 -98
- package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +0 -1
- package/apps/web/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
- package/apps/web/dist/assets/settings-menu-2IMOOlLl.js +0 -1
- package/apps/web/dist/assets/ui-dzGvc3xk.js +0 -137
- package/apps/web/dist/assets/upload-BSuTilFF.js +0 -1
- package/apps/web/dist/assets/vfs_fonts-DllDSYt1.js +0 -1
- package/apps/web/dist/embed.js +0 -266
- package/apps/web/dist/favicon.svg +0 -1
- 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 +0 -48
- package/apps/web/dist/manifest.webmanifest +0 -21
- package/apps/web/dist/mcp/flow.html +0 -980
- package/apps/web/dist/sw.js +0 -15
- package/modules/README.md +0 -15
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +0 -1150
- package/node_modules/@engenty/wizards/dist/plugin/index.js +0 -4
- package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +0 -322
- package/node_modules/@engenty/wizards/dist/plugin/studio.js +0 -4
- package/node_modules/@engenty/wizards/dist/plugin/thread.d.ts +0 -174
- package/node_modules/@engenty/wizards/dist/plugin/thread.js +0 -821
- package/node_modules/@engenty/wizards/package.json +0 -11
- package/node_modules/@engenty-wizards/shared/dist/assistant.d.ts +0 -174
- package/node_modules/@engenty-wizards/shared/dist/assistant.js +0 -65
- package/node_modules/@engenty-wizards/shared/dist/changes.d.ts +0 -22
- package/node_modules/@engenty-wizards/shared/dist/changes.js +0 -61
- package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +0 -77
- package/node_modules/@engenty-wizards/shared/dist/connectors.js +0 -2
- package/node_modules/@engenty-wizards/shared/dist/decision.d.ts +0 -76
- package/node_modules/@engenty-wizards/shared/dist/decision.js +0 -147
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +0 -2922
- package/node_modules/@engenty-wizards/shared/dist/definition.js +0 -1920
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +0 -5
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +0 -132
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +0 -11
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +0 -209
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +0 -532
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +0 -217
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +0 -3
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +0 -3
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +0 -14
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +0 -166
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +0 -33
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +0 -99
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +0 -78
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +0 -70
- package/node_modules/@engenty-wizards/shared/dist/features.d.ts +0 -41
- package/node_modules/@engenty-wizards/shared/dist/features.js +0 -89
- package/node_modules/@engenty-wizards/shared/dist/fit.d.ts +0 -71
- package/node_modules/@engenty-wizards/shared/dist/fit.js +0 -382
- package/node_modules/@engenty-wizards/shared/dist/json-schema.d.ts +0 -14
- package/node_modules/@engenty-wizards/shared/dist/json-schema.js +0 -66
- package/node_modules/@engenty-wizards/shared/dist/knowledge.d.ts +0 -199
- package/node_modules/@engenty-wizards/shared/dist/knowledge.js +0 -68
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +0 -35
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +0 -107
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +0 -20
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +0 -136
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +0 -227
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +0 -354
- package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +0 -7
- package/node_modules/@engenty-wizards/shared/dist/merge.js +0 -40
- package/node_modules/@engenty-wizards/shared/dist/numbers.d.ts +0 -24
- package/node_modules/@engenty-wizards/shared/dist/numbers.js +0 -54
- package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +0 -224
- package/node_modules/@engenty-wizards/shared/dist/projects.js +0 -319
- package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +0 -101
- package/node_modules/@engenty-wizards/shared/dist/providers.js +0 -390
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +0 -680
- package/node_modules/@engenty-wizards/shared/dist/run.js +0 -620
- package/node_modules/@engenty-wizards/shared/dist/runner-texts.d.ts +0 -546
- package/node_modules/@engenty-wizards/shared/dist/runner-texts.js +0 -523
- package/node_modules/@engenty-wizards/shared/dist/runners.d.ts +0 -93
- package/node_modules/@engenty-wizards/shared/dist/runners.js +0 -146
- package/node_modules/@engenty-wizards/shared/dist/shape.d.ts +0 -102
- package/node_modules/@engenty-wizards/shared/dist/shape.js +0 -318
- package/node_modules/@engenty-wizards/shared/dist/space-data.d.ts +0 -89
- package/node_modules/@engenty-wizards/shared/dist/space-data.js +0 -47
- package/node_modules/@engenty-wizards/shared/dist/store.d.ts +0 -117
- package/node_modules/@engenty-wizards/shared/dist/store.js +0 -81
- package/node_modules/@engenty-wizards/shared/dist/surface.d.ts +0 -115
- package/node_modules/@engenty-wizards/shared/dist/surface.js +0 -442
- package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +0 -45
- package/node_modules/@engenty-wizards/shared/dist/texts.js +0 -54
- package/node_modules/@engenty-wizards/shared/dist/translation.d.ts +0 -23
- package/node_modules/@engenty-wizards/shared/dist/translation.js +0 -154
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.d.ts +0 -48
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.js +0 -49
- package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +0 -16
- package/node_modules/@engenty-wizards/shared/dist/workspace.js +0 -51
- package/node_modules/@engenty-wizards/shared/package.json +0 -10
- package/plugin/.claude-plugin/plugin.json +0 -9
- package/plugin/.mcp.json +0 -8
- package/plugin/commands/wizard.md +0 -8
- package/plugin/skills/build-wizard/SKILL.md +0 -27
- package/plugin/skills/use-wizard/SKILL.md +0 -18
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { env } from "../env.js";
|
|
5
|
-
import { extFor } from "../files/storage.js";
|
|
6
|
-
import { ffmpeg, hasFfmpeg, probeMedia, withTempDir } from "../media/ffmpeg.js";
|
|
7
|
-
import { newContext, offlineContext } from "../render/chromium.js";
|
|
8
|
-
export { hasFfmpeg } from "../media/ffmpeg.js";
|
|
9
|
-
const FPS = 25;
|
|
10
|
-
const MAX_SECONDS = 60;
|
|
11
|
-
/** Exports set `wizard.mode` to "export" so the widget hides its controls and does not autoplay. */
|
|
12
|
-
function forExport(html) {
|
|
13
|
-
return html.replace('<script type="application/json" id="wizard-payload">', '<script>window.__WIZARD_EXPORT=true</script><script type="application/json" id="wizard-payload">');
|
|
14
|
-
}
|
|
15
|
-
async function withWidget(html, size, scale, use) {
|
|
16
|
-
const context = await offlineContext({
|
|
17
|
-
viewport: { width: size.width, height: size.height },
|
|
18
|
-
deviceScaleFactor: scale,
|
|
19
|
-
});
|
|
20
|
-
const errors = [];
|
|
21
|
-
try {
|
|
22
|
-
const page = await context.newPage();
|
|
23
|
-
page.on("pageerror", (err) => errors.push(err.message));
|
|
24
|
-
page.on("console", (msg) => {
|
|
25
|
-
if (msg.type() === "error") {
|
|
26
|
-
errors.push(msg.text());
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
await page.setContent(forExport(html), { waitUntil: "load", timeout: 30_000 });
|
|
30
|
-
// A widget calls wizard.ready() after its first frame; one that never does gets 3 seconds.
|
|
31
|
-
await page.evaluate(() => Promise.race([window.wizard?.__ready, new Promise((r) => setTimeout(r, 3000))]));
|
|
32
|
-
return await use(page, errors);
|
|
33
|
-
}
|
|
34
|
-
finally {
|
|
35
|
-
await context.close();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function timelineOf(page) {
|
|
39
|
-
return page.evaluate(() => {
|
|
40
|
-
const t = window.wizard?.__timeline?.();
|
|
41
|
-
return t ? { duration: Number(t.duration), poster: Number(t.poster ?? 0) } : null;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
async function seek(page, seconds) {
|
|
45
|
-
await page.evaluate(async (t) => {
|
|
46
|
-
// A film's seek waits for its clips to reach the frame; a drawn animation returns at once.
|
|
47
|
-
await window.wizard.__timeline().seek(t);
|
|
48
|
-
await new Promise((r) => requestAnimationFrame(() => r(null)));
|
|
49
|
-
}, seconds);
|
|
50
|
-
}
|
|
51
|
-
/** Loads the widget once: does it run, and does it animate? */
|
|
52
|
-
export async function probeWidget(html, size) {
|
|
53
|
-
return withWidget(html, size, 1, async (page, errors) => {
|
|
54
|
-
const timeline = await timelineOf(page);
|
|
55
|
-
if (timeline) {
|
|
56
|
-
await seek(page, timeline.poster);
|
|
57
|
-
}
|
|
58
|
-
const png = await page.screenshot({ type: "png" });
|
|
59
|
-
return {
|
|
60
|
-
duration: timeline ? Math.min(timeline.duration, MAX_SECONDS) : null,
|
|
61
|
-
errors: [...new Set(errors)].slice(0, 10),
|
|
62
|
-
png,
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
export async function widgetPng(html, size) {
|
|
67
|
-
return withWidget(html, size, 2, async (page) => {
|
|
68
|
-
const timeline = await timelineOf(page);
|
|
69
|
-
if (timeline) {
|
|
70
|
-
await seek(page, timeline.poster);
|
|
71
|
-
}
|
|
72
|
-
return page.screenshot({ type: "png", fullPage: true });
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
export async function widgetPdf(html, size) {
|
|
76
|
-
return withWidget(html, size, 1, async (page) => {
|
|
77
|
-
const timeline = await timelineOf(page);
|
|
78
|
-
if (timeline) {
|
|
79
|
-
await seek(page, timeline.poster);
|
|
80
|
-
}
|
|
81
|
-
const height = await page.evaluate(() => document.documentElement.scrollHeight);
|
|
82
|
-
return page.pdf({
|
|
83
|
-
width: `${size.width}px`,
|
|
84
|
-
height: `${Math.max(size.height, height)}px`,
|
|
85
|
-
printBackground: true,
|
|
86
|
-
pageRanges: "1",
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/** Steps through the timeline frame by frame and encodes the frames as H.264 (no sound). */
|
|
91
|
-
async function encodeFrames(page, seconds, out, onProgress) {
|
|
92
|
-
const encoder = spawn(env.ffmpegPath, [
|
|
93
|
-
"-y",
|
|
94
|
-
"-loglevel",
|
|
95
|
-
"error",
|
|
96
|
-
"-f",
|
|
97
|
-
"image2pipe",
|
|
98
|
-
"-framerate",
|
|
99
|
-
String(FPS),
|
|
100
|
-
"-i",
|
|
101
|
-
"-",
|
|
102
|
-
"-c:v",
|
|
103
|
-
"libx264",
|
|
104
|
-
"-preset",
|
|
105
|
-
"veryfast",
|
|
106
|
-
"-crf",
|
|
107
|
-
"20",
|
|
108
|
-
"-pix_fmt",
|
|
109
|
-
"yuv420p",
|
|
110
|
-
"-movflags",
|
|
111
|
-
"+faststart",
|
|
112
|
-
out,
|
|
113
|
-
], { stdio: ["pipe", "ignore", "pipe"] });
|
|
114
|
-
let stderr = "";
|
|
115
|
-
encoder.stderr.on("data", (d) => {
|
|
116
|
-
stderr += String(d);
|
|
117
|
-
});
|
|
118
|
-
const done = new Promise((resolve, reject) => {
|
|
119
|
-
encoder.on("error", reject);
|
|
120
|
-
encoder.on("exit", (code) => code === 0 ? resolve() : reject(new Error(`ffmpeg: ${stderr.slice(0, 300)}`)));
|
|
121
|
-
});
|
|
122
|
-
const frames = Math.max(1, Math.round(seconds * FPS));
|
|
123
|
-
for (let i = 0; i < frames; i++) {
|
|
124
|
-
await seek(page, (i * seconds) / frames);
|
|
125
|
-
const jpeg = await page.screenshot({ type: "jpeg", quality: 92 });
|
|
126
|
-
if (!encoder.stdin.write(jpeg)) {
|
|
127
|
-
await new Promise((r) => encoder.stdin.once("drain", r));
|
|
128
|
-
}
|
|
129
|
-
if (i % FPS === 0) {
|
|
130
|
-
onProgress?.(i / frames);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
encoder.stdin.end();
|
|
134
|
-
await done;
|
|
135
|
-
}
|
|
136
|
-
/** Steps through the widget's timeline frame by frame and encodes the frames as H.264. */
|
|
137
|
-
export async function widgetMp4(html, size) {
|
|
138
|
-
if (!(await hasFfmpeg())) {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
const even = { width: size.width - (size.width % 2), height: size.height - (size.height % 2) };
|
|
142
|
-
return withTempDir(async (dir) => {
|
|
143
|
-
const out = join(dir, "out.mp4");
|
|
144
|
-
return withWidget(html, even, 1, async (page) => {
|
|
145
|
-
const timeline = await timelineOf(page);
|
|
146
|
-
if (!timeline) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
await encodeFrames(page, Math.min(timeline.duration, MAX_SECONDS), out);
|
|
150
|
-
return new Uint8Array(await readFile(out));
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
// --- films: a timeline of clips and stills, with sound ---------------------------------
|
|
155
|
-
/** Where a film's page finds this run's clips, images and voice-over while it is rendered. */
|
|
156
|
-
export const FILM_MEDIA_ORIGIN = "http://wizard.media";
|
|
157
|
-
/** A film names at most this many sound tracks: voice-over, music, and every cut of a recording. */
|
|
158
|
-
const MAX_TRACKS = 48;
|
|
159
|
-
/**
|
|
160
|
-
* Renders a film widget: its page draws every frame from this run's clips and images, and names
|
|
161
|
-
* the sound that belongs to it (voice-over, the clips' own sound). Clips are re-encoded with a
|
|
162
|
-
* key frame every few frames first, so the page reaches any frame quickly and exactly.
|
|
163
|
-
*/
|
|
164
|
-
export async function renderFilm(html, size, media, onProgress) {
|
|
165
|
-
if (!(await hasFfmpeg())) {
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
const even = { width: size.width - (size.width % 2), height: size.height - (size.height % 2) };
|
|
169
|
-
return withTempDir(async (dir) => {
|
|
170
|
-
// url → the file as it came (for its sound) and what the page is served.
|
|
171
|
-
const files = new Map();
|
|
172
|
-
let n = 0;
|
|
173
|
-
for (const [url, file] of media) {
|
|
174
|
-
const path = join(dir, `media-${n++}.${extFor(file.mime)}`);
|
|
175
|
-
await writeFile(path, file.bytes);
|
|
176
|
-
let served = file;
|
|
177
|
-
if (file.mime.startsWith("video/")) {
|
|
178
|
-
const seekable = join(dir, `seek-${n}.mp4`);
|
|
179
|
-
const { code } = await ffmpeg([
|
|
180
|
-
"-y",
|
|
181
|
-
"-loglevel",
|
|
182
|
-
"error",
|
|
183
|
-
"-i",
|
|
184
|
-
path,
|
|
185
|
-
"-an",
|
|
186
|
-
"-c:v",
|
|
187
|
-
"libx264",
|
|
188
|
-
"-preset",
|
|
189
|
-
"veryfast",
|
|
190
|
-
"-crf",
|
|
191
|
-
"20",
|
|
192
|
-
"-g",
|
|
193
|
-
"5",
|
|
194
|
-
"-pix_fmt",
|
|
195
|
-
"yuv420p",
|
|
196
|
-
"-movflags",
|
|
197
|
-
"+faststart",
|
|
198
|
-
seekable,
|
|
199
|
-
]);
|
|
200
|
-
if (code === 0) {
|
|
201
|
-
served = { bytes: new Uint8Array(await readFile(seekable)), mime: "video/mp4" };
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
files.set(url, { path, served });
|
|
205
|
-
}
|
|
206
|
-
const context = await newContext({ viewport: even, deviceScaleFactor: 1 });
|
|
207
|
-
const errors = [];
|
|
208
|
-
try {
|
|
209
|
-
await context.route("**/*", async (route) => {
|
|
210
|
-
const request = route.request();
|
|
211
|
-
const file = files.get(request.url().split(/[?#]/)[0])?.served;
|
|
212
|
-
if (!file) {
|
|
213
|
-
await route.abort("blockedbyclient");
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
// Players ask for byte ranges and only seek freely when they get them.
|
|
217
|
-
const total = file.bytes.byteLength;
|
|
218
|
-
const range = request.headers().range?.match(/^bytes=(\d+)-(\d*)$/);
|
|
219
|
-
const from = range ? Math.min(Number(range[1]), total - 1) : 0;
|
|
220
|
-
const to = range?.[2] ? Math.min(Number(range[2]), total - 1) : total - 1;
|
|
221
|
-
await route.fulfill({
|
|
222
|
-
status: range ? 206 : 200,
|
|
223
|
-
contentType: file.mime,
|
|
224
|
-
headers: {
|
|
225
|
-
"accept-ranges": "bytes",
|
|
226
|
-
...(range ? { "content-range": `bytes ${from}-${to}/${total}` } : {}),
|
|
227
|
-
},
|
|
228
|
-
body: Buffer.from(file.bytes.subarray(from, to + 1)),
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
const page = await context.newPage();
|
|
232
|
-
page.on("pageerror", (err) => errors.push(err.message));
|
|
233
|
-
await page.setContent(forExport(html), { waitUntil: "load", timeout: 30_000 });
|
|
234
|
-
// A film is ready once its clips are loaded; that takes longer than a drawn widget.
|
|
235
|
-
await page.evaluate(() => Promise.race([window.wizard?.__ready, new Promise((r) => setTimeout(r, 45_000))]));
|
|
236
|
-
const timeline = await page.evaluate(() => {
|
|
237
|
-
const t = window.wizard?.__timeline?.();
|
|
238
|
-
return t
|
|
239
|
-
? {
|
|
240
|
-
duration: Number(t.duration),
|
|
241
|
-
poster: Number(t.poster ?? 0),
|
|
242
|
-
audio: (Array.isArray(t.audio) ? t.audio : []),
|
|
243
|
-
}
|
|
244
|
-
: null;
|
|
245
|
-
});
|
|
246
|
-
if (!timeline) {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
const seconds = Math.min(timeline.duration, MAX_SECONDS);
|
|
250
|
-
const silent = join(dir, "silent.mp4");
|
|
251
|
-
await encodeFrames(page, seconds, silent, onProgress);
|
|
252
|
-
await seek(page, Math.min(timeline.poster, seconds));
|
|
253
|
-
const png = await page.screenshot({ type: "png" });
|
|
254
|
-
const tracks = [];
|
|
255
|
-
// Sounds from the wizard's workspace (wizard.url) arrive as data URLs.
|
|
256
|
-
const inline = new Map();
|
|
257
|
-
for (const track of timeline.audio.slice(0, MAX_TRACKS)) {
|
|
258
|
-
const data = String(track.src).match(/^data:(audio\/[\w.+-]+);base64,(.+)$/);
|
|
259
|
-
if (data && !inline.has(track.src)) {
|
|
260
|
-
const path = join(dir, `sound-${inline.size}.${extFor(data[1])}`);
|
|
261
|
-
await writeFile(path, Buffer.from(data[2], "base64"));
|
|
262
|
-
inline.set(track.src, path);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
for (const track of timeline.audio.slice(0, MAX_TRACKS)) {
|
|
266
|
-
const path = inline.get(track.src) ?? files.get(String(track.src).split(/[?#]/)[0])?.path;
|
|
267
|
-
if (path && track.start < seconds && (await probeMedia(path)).audio) {
|
|
268
|
-
tracks.push({ ...track, path });
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
let out = silent;
|
|
272
|
-
if (tracks.length) {
|
|
273
|
-
const mixed = join(dir, "film.mp4");
|
|
274
|
-
const chains = tracks.map((track, i) => {
|
|
275
|
-
const length = Math.min(track.duration ?? seconds, seconds - track.start);
|
|
276
|
-
const volume = Math.max(0, Math.min(2, track.volume ?? 1));
|
|
277
|
-
const delay = Math.round(Math.max(0, track.start) * 1000);
|
|
278
|
-
const cut = track.from !== undefined;
|
|
279
|
-
const from = Math.max(0, Number(track.from) || 0);
|
|
280
|
-
// A cut out of a recording gets short fades, so the hard cut does not click.
|
|
281
|
-
const fade = cut ? Math.min(0.03, length / 4) : 0.25;
|
|
282
|
-
const fadeIn = cut ? `afade=t=in:d=${fade.toFixed(3)},` : "";
|
|
283
|
-
return `[${i + 1}:a]atrim=${from.toFixed(3)}:${(from + length).toFixed(3)},asetpts=PTS-STARTPTS,${fadeIn}afade=t=out:st=${Math.max(0, length - fade).toFixed(3)}:d=${fade.toFixed(3)},adelay=${delay}:all=1,volume=${volume}[a${i}]`;
|
|
284
|
-
});
|
|
285
|
-
const mix = `${tracks.map((_, i) => `[a${i}]`).join("")}amix=inputs=${tracks.length}:normalize=0:duration=longest[mix]`;
|
|
286
|
-
const { code, stderr } = await ffmpeg([
|
|
287
|
-
"-y",
|
|
288
|
-
"-loglevel",
|
|
289
|
-
"error",
|
|
290
|
-
"-i",
|
|
291
|
-
silent,
|
|
292
|
-
...tracks.flatMap((track) => ["-i", track.path]),
|
|
293
|
-
"-filter_complex",
|
|
294
|
-
[...chains, mix].join(";"),
|
|
295
|
-
"-map",
|
|
296
|
-
"0:v",
|
|
297
|
-
"-map",
|
|
298
|
-
"[mix]",
|
|
299
|
-
"-c:v",
|
|
300
|
-
"copy",
|
|
301
|
-
"-c:a",
|
|
302
|
-
"aac",
|
|
303
|
-
"-b:a",
|
|
304
|
-
"160k",
|
|
305
|
-
"-t",
|
|
306
|
-
seconds.toFixed(3),
|
|
307
|
-
"-movflags",
|
|
308
|
-
"+faststart",
|
|
309
|
-
mixed,
|
|
310
|
-
]);
|
|
311
|
-
if (code === 0) {
|
|
312
|
-
out = mixed;
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
errors.push(`The sound could not be mixed: ${stderr.slice(-200)}`);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return {
|
|
319
|
-
mp4: new Uint8Array(await readFile(out)),
|
|
320
|
-
png,
|
|
321
|
-
duration: seconds,
|
|
322
|
-
errors: [...new Set(errors)].slice(0, 10),
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
finally {
|
|
326
|
-
await context.close();
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `window.wizard` — the whole contract between a widget and the platform. Injected ahead of the
|
|
3
|
-
* widget's own scripts; reads its payload from <script type="application/json" id="wizard-payload">.
|
|
4
|
-
*
|
|
5
|
-
* wizard.data the run's data (keys from the widget step's `data` map)
|
|
6
|
-
* wizard.brand { name, accent, logo, colors, facts, theme } — logo as a data URL or
|
|
7
|
-
* null, colors [{ name, value }], facts { key: value }, theme { accent,
|
|
8
|
-
* second, background, display, body, dark } as the run page uses it
|
|
9
|
-
* wizard.state what the person did last time (ticks, an open tab), kept with the run
|
|
10
|
-
* wizard.save(state) keeps `state` with the run (small JSON); the next visit reads it
|
|
11
|
-
* wizard.share(text) hands text to the device's share sheet (or copies it)
|
|
12
|
-
* wizard.ai "generated" | "edited" when the run's media in `data` was made or
|
|
13
|
-
* changed by a model, else null — a film labels itself with it
|
|
14
|
-
* wizard.mode "view" in the browser, "export" while a PNG/PDF/MP4 is rendered
|
|
15
|
-
* wizard.file(path) text of a workspace file (JSON, CSV, SVG, …)
|
|
16
|
-
* wizard.json(path) a workspace JSON file, parsed
|
|
17
|
-
* wizard.url(path) a workspace file as a data URL (images, fonts, audio)
|
|
18
|
-
* wizard.ready() call once the first frame is drawn; exports wait for it
|
|
19
|
-
* wizard.timeline({ duration, seek, poster?, audio? })
|
|
20
|
-
* an animation of `duration` seconds; seek(t) must draw time t —
|
|
21
|
-
* synchronously, or as a promise that resolves once it is drawn (a
|
|
22
|
-
* film waits for its clips). Enables the MP4 export; `poster` is the
|
|
23
|
-
* second the PNG/PDF show (default 0). A film names its sound in
|
|
24
|
-
* `audio`: [{ src, start, duration?, from?, volume? }] — `from` is the
|
|
25
|
-
* second of the source a cut plays from.
|
|
26
|
-
*/
|
|
27
|
-
export const WIDGET_RUNTIME = `(function () {
|
|
28
|
-
var el = document.getElementById("wizard-payload");
|
|
29
|
-
var payload = el ? JSON.parse(el.textContent) : { data: {}, brand: {}, files: {}, base: "" };
|
|
30
|
-
var files = payload.files || {};
|
|
31
|
-
var resolveReady;
|
|
32
|
-
var readyPromise = new Promise(function (r) { resolveReady = r; });
|
|
33
|
-
var timeline = null;
|
|
34
|
-
function find(path) {
|
|
35
|
-
var p = String(path || "").replace(/^\\.?\\/+/, "");
|
|
36
|
-
return files[p] || files[payload.base + p] || null;
|
|
37
|
-
}
|
|
38
|
-
function utf8ToB64(text) {
|
|
39
|
-
var bytes = new TextEncoder().encode(text);
|
|
40
|
-
var bin = "";
|
|
41
|
-
for (var i = 0; i < bytes.length; i++) bin += String.fromCharCode(bytes[i]);
|
|
42
|
-
return btoa(bin);
|
|
43
|
-
}
|
|
44
|
-
function b64ToUtf8(b64) {
|
|
45
|
-
var bin = atob(b64);
|
|
46
|
-
var bytes = new Uint8Array(bin.length);
|
|
47
|
-
for (var i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
|
|
48
|
-
return new TextDecoder().decode(bytes);
|
|
49
|
-
}
|
|
50
|
-
window.wizard = {
|
|
51
|
-
data: payload.data || {},
|
|
52
|
-
brand: payload.brand || {},
|
|
53
|
-
ai: payload.ai || null,
|
|
54
|
-
mode: window.__WIZARD_EXPORT ? "export" : "view",
|
|
55
|
-
file: function (path) {
|
|
56
|
-
var f = find(path);
|
|
57
|
-
if (!f) return undefined;
|
|
58
|
-
return f.text != null ? f.text : b64ToUtf8(f.b64);
|
|
59
|
-
},
|
|
60
|
-
json: function (path) {
|
|
61
|
-
var t = this.file(path);
|
|
62
|
-
return t == null ? undefined : JSON.parse(t);
|
|
63
|
-
},
|
|
64
|
-
url: function (path) {
|
|
65
|
-
var f = find(path);
|
|
66
|
-
if (!f) return "";
|
|
67
|
-
return "data:" + f.mime + ";base64," + (f.b64 != null ? f.b64 : utf8ToB64(f.text));
|
|
68
|
-
},
|
|
69
|
-
state: window.__WIZARD_STATE || {},
|
|
70
|
-
save: function (state) {
|
|
71
|
-
this.state = state;
|
|
72
|
-
if (parent !== window) parent.postMessage({ wizard: "state", state: state }, "*");
|
|
73
|
-
},
|
|
74
|
-
share: function (text) {
|
|
75
|
-
if (parent !== window) parent.postMessage({ wizard: "share", text: String(text) }, "*");
|
|
76
|
-
},
|
|
77
|
-
ready: function () { resolveReady(); },
|
|
78
|
-
timeline: function (t) {
|
|
79
|
-
if (t && typeof t.seek === "function" && t.duration > 0) timeline = t;
|
|
80
|
-
},
|
|
81
|
-
__ready: readyPromise,
|
|
82
|
-
__timeline: function () { return timeline; }
|
|
83
|
-
};
|
|
84
|
-
// A sandboxed frame can start at 0×0 and get its real size later without a "resize" event;
|
|
85
|
-
// widgets that fit themselves to the window would stay at scale 0. Fire it for them.
|
|
86
|
-
var lastW = innerWidth, lastH = innerHeight;
|
|
87
|
-
addEventListener("resize", function () { lastW = innerWidth; lastH = innerHeight; });
|
|
88
|
-
// A widget laid out as part of the page tells the page how tall its content is.
|
|
89
|
-
var lastTall = 0;
|
|
90
|
-
function tell() {
|
|
91
|
-
var tall = Math.ceil(document.documentElement.scrollHeight);
|
|
92
|
-
if (parent !== window && tall !== lastTall) {
|
|
93
|
-
lastTall = tall;
|
|
94
|
-
parent.postMessage({ wizard: "height", height: tall }, "*");
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
addEventListener("load", tell);
|
|
98
|
-
if (window.ResizeObserver) {
|
|
99
|
-
new ResizeObserver(function () {
|
|
100
|
-
if (innerWidth !== lastW || innerHeight !== lastH) {
|
|
101
|
-
lastW = innerWidth;
|
|
102
|
-
lastH = innerHeight;
|
|
103
|
-
dispatchEvent(new Event("resize"));
|
|
104
|
-
}
|
|
105
|
-
tell();
|
|
106
|
-
}).observe(document.documentElement);
|
|
107
|
-
}
|
|
108
|
-
})();`;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { offlineContext } from "../render/chromium.js";
|
|
2
|
-
/**
|
|
3
|
-
* Runs a model-written script over workspace files inside Chromium with no network: reshaping
|
|
4
|
-
* downloaded data (simplify outlines, merge files, precompute paths) without passing it through
|
|
5
|
-
* the model. `files` maps paths to text; the script's return value is the result.
|
|
6
|
-
*/
|
|
7
|
-
export async function runScript(script, files, timeoutMs = 20_000) {
|
|
8
|
-
const context = await offlineContext();
|
|
9
|
-
try {
|
|
10
|
-
const page = await context.newPage();
|
|
11
|
-
await page.setContent("<!doctype html><html><body></body></html>");
|
|
12
|
-
const run = page.evaluate(async ({ script, files }) => {
|
|
13
|
-
const fn = new Function("files", `return (async () => {\n${script}\n})();`);
|
|
14
|
-
return await fn(files);
|
|
15
|
-
}, { script, files });
|
|
16
|
-
let timer;
|
|
17
|
-
const timeout = new Promise((_, reject) => {
|
|
18
|
-
timer = setTimeout(() => reject(new Error(`The script ran longer than ${timeoutMs / 1000} seconds.`)), timeoutMs);
|
|
19
|
-
});
|
|
20
|
-
try {
|
|
21
|
-
return await Promise.race([run, timeout]);
|
|
22
|
-
}
|
|
23
|
-
finally {
|
|
24
|
-
clearTimeout(timer);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
finally {
|
|
28
|
-
await context.close();
|
|
29
|
-
}
|
|
30
|
-
}
|