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,480 +0,0 @@
|
|
|
1
|
-
import { FONT_WEIGHTS } from "@engenty-wizards/shared/projects";
|
|
2
|
-
import { webContext } from "../render/chromium.js";
|
|
3
|
-
import { htmlToMarkdown } from "../render/convert.js";
|
|
4
|
-
import { safeFetch } from "../tools/net-guard.js";
|
|
5
|
-
const UA = { "user-agent": "Mozilla/5.0 (compatible; engenty-wizards/0.1)" };
|
|
6
|
-
const attr = (tag, name) => tag
|
|
7
|
-
.match(new RegExp(`\\b${name}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"))
|
|
8
|
-
?.slice(2)
|
|
9
|
-
.find(Boolean) ?? "";
|
|
10
|
-
function absolute(href, base) {
|
|
11
|
-
try {
|
|
12
|
-
const url = new URL(href.trim(), base);
|
|
13
|
-
return url.protocol === "http:" || url.protocol === "https:" ? url.toString() : null;
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function hex(value) {
|
|
20
|
-
const v = value.trim().toLowerCase();
|
|
21
|
-
const short = v.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/);
|
|
22
|
-
if (short) {
|
|
23
|
-
return `#${short[1]}${short[1]}${short[2]}${short[2]}${short[3]}${short[3]}`;
|
|
24
|
-
}
|
|
25
|
-
if (/^#[0-9a-f]{6}$/.test(v)) {
|
|
26
|
-
return v;
|
|
27
|
-
}
|
|
28
|
-
if (/^#[0-9a-f]{8}$/.test(v)) {
|
|
29
|
-
return v.slice(0, 7);
|
|
30
|
-
}
|
|
31
|
-
const rgb = v.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/);
|
|
32
|
-
if (rgb) {
|
|
33
|
-
return toHex(rgb.slice(1, 4).map(Number));
|
|
34
|
-
}
|
|
35
|
-
const hsl = v.match(/^hsla?\(\s*([\d.]+)(?:deg)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%/);
|
|
36
|
-
if (hsl) {
|
|
37
|
-
const [h, sat, l] = [Number(hsl[1]), Number(hsl[2]) / 100, Number(hsl[3]) / 100];
|
|
38
|
-
const f = (n) => {
|
|
39
|
-
const k = (n + h / 30) % 12;
|
|
40
|
-
return 255 * (l - sat * Math.min(l, 1 - l) * Math.max(-1, Math.min(k - 3, 9 - k, 1)));
|
|
41
|
-
};
|
|
42
|
-
return toHex([f(0), f(8), f(4)]);
|
|
43
|
-
}
|
|
44
|
-
const ok = v.match(/^oklch\(\s*([\d.]+)(%?)\s+([\d.]+)\s+([\d.]+)/);
|
|
45
|
-
if (ok) {
|
|
46
|
-
return toHex(oklchToRgb(Number(ok[1]) / (ok[2] ? 100 : 1), Number(ok[3]), Number(ok[4])));
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const toHex = (rgb) => `#${rgb
|
|
51
|
-
.map((n) => Math.round(Math.max(0, Math.min(255, n)))
|
|
52
|
-
.toString(16)
|
|
53
|
-
.padStart(2, "0"))
|
|
54
|
-
.join("")}`;
|
|
55
|
-
/** OKLCH (as CSS writes it, Tailwind 4 among others) in sRGB, 0–255. */
|
|
56
|
-
function oklchToRgb(l, c, h) {
|
|
57
|
-
const a = c * Math.cos((h * Math.PI) / 180);
|
|
58
|
-
const b = c * Math.sin((h * Math.PI) / 180);
|
|
59
|
-
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
60
|
-
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
61
|
-
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
62
|
-
const linear = [
|
|
63
|
-
4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,
|
|
64
|
-
-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,
|
|
65
|
-
-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_,
|
|
66
|
-
];
|
|
67
|
-
return linear.map((x) => 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.max(0, x) ** (1 / 2.4) - 0.055));
|
|
68
|
-
}
|
|
69
|
-
/** How far a colour is from grey, 0–255. */
|
|
70
|
-
function chroma(color) {
|
|
71
|
-
const [r, g, b] = [1, 3, 5].map((i) => Number.parseInt(color.slice(i, i + 2), 16));
|
|
72
|
-
return Math.max(r, g, b) - Math.min(r, g, b);
|
|
73
|
-
}
|
|
74
|
-
/** A colour as CSS writes it: hex, rgb(), hsl() or oklch(). */
|
|
75
|
-
const COLOUR = /#[0-9a-fA-F]{3,8}\b|rgba?\([^)]*\)|hsla?\([^)]*\)|oklch\([^)]*\)/;
|
|
76
|
-
function coloursOf(css) {
|
|
77
|
-
const variables = [];
|
|
78
|
-
for (const m of css.matchAll(new RegExp(`(--[\\w-]+)\\s*:\\s*(${COLOUR.source})`, "g"))) {
|
|
79
|
-
const value = hex(m[2]);
|
|
80
|
-
// Tailwind's own variables are its machinery, not the site's colours.
|
|
81
|
-
if (value && !m[1].startsWith("--tw-") && !variables.some((v) => v.name === m[1])) {
|
|
82
|
-
variables.push({ name: m[1], value });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const counts = new Map();
|
|
86
|
-
for (const m of css.matchAll(new RegExp(COLOUR.source, "g"))) {
|
|
87
|
-
const value = hex(m[0]);
|
|
88
|
-
if (value) {
|
|
89
|
-
counts.set(value, (counts.get(value) ?? 0) + 1);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const telling = /brand|primary|accent|main|theme|secondary|highlight|cta|link/i;
|
|
93
|
-
return {
|
|
94
|
-
variables: variables
|
|
95
|
-
.sort((a, b) => Number(telling.test(b.name)) - Number(telling.test(a.name)))
|
|
96
|
-
.slice(0, 24),
|
|
97
|
-
frequent: [...counts.entries()]
|
|
98
|
-
.sort((a, b) => Number(chroma(b[0]) > 24) - Number(chroma(a[0]) > 24) || b[1] - a[1])
|
|
99
|
-
.slice(0, 12)
|
|
100
|
-
.map(([value]) => value),
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
async function stylesheet(url, signal) {
|
|
104
|
-
try {
|
|
105
|
-
const res = await safeFetch(url, {
|
|
106
|
-
headers: UA,
|
|
107
|
-
signal: AbortSignal.any([AbortSignal.timeout(10_000), ...(signal ? [signal] : [])]),
|
|
108
|
-
});
|
|
109
|
-
return res.ok ? (await res.text()).slice(0, 400_000) : "";
|
|
110
|
-
}
|
|
111
|
-
catch {
|
|
112
|
-
return "";
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/** The page as a browser shows it, for sites that write their text with scripts. */
|
|
116
|
-
async function rendered(url) {
|
|
117
|
-
try {
|
|
118
|
-
const context = await webContext();
|
|
119
|
-
try {
|
|
120
|
-
const page = await context.newPage();
|
|
121
|
-
await page.goto(url, { waitUntil: "networkidle", timeout: 25_000 }).catch(() => undefined);
|
|
122
|
-
return await page.content();
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
await context.close();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
catch {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
/** A page's HTML, drawn in a browser when it has hardly any text without its scripts. */
|
|
133
|
-
async function loadPage(raw, signal) {
|
|
134
|
-
const res = await safeFetch(/^https?:\/\//i.test(raw) ? raw : `https://${raw}`, {
|
|
135
|
-
headers: UA,
|
|
136
|
-
signal: AbortSignal.any([AbortSignal.timeout(20_000), ...(signal ? [signal] : [])]),
|
|
137
|
-
});
|
|
138
|
-
const base = res.url;
|
|
139
|
-
let html = (await res.text()).slice(0, 1_500_000);
|
|
140
|
-
// Hardly any text in the page as sent: it is written in the browser.
|
|
141
|
-
if (res.ok && htmlToMarkdown(html).replace(/\s+/g, " ").length < 500) {
|
|
142
|
-
html = ((await rendered(base)) ?? html).slice(0, 1_500_000);
|
|
143
|
-
}
|
|
144
|
-
return { res, base, html };
|
|
145
|
-
}
|
|
146
|
-
const tagsOf = (html, name) => [...html.matchAll(new RegExp(`<${name}\\b[^>]*>`, "gi"))].map((m) => m[0]);
|
|
147
|
-
/** A `<meta>` by its name or property. */
|
|
148
|
-
function metaOf(html, key) {
|
|
149
|
-
const tag = tagsOf(html, "meta").find((t) => [attr(t, "name"), attr(t, "property")].some((v) => v.toLowerCase() === key));
|
|
150
|
-
return tag ? attr(tag, "content") : "";
|
|
151
|
-
}
|
|
152
|
-
const titleOf = (html) => html
|
|
153
|
-
.match(/<title[^>]*>([\s\S]*?)<\/title>/i)?.[1]
|
|
154
|
-
.replace(/\s+/g, " ")
|
|
155
|
-
.trim() ?? "";
|
|
156
|
-
/** The text of a link, as a reader sees it. */
|
|
157
|
-
const linkText = (inner) => inner
|
|
158
|
-
.replace(/<[^>]+>/g, " ")
|
|
159
|
-
.replace(/\s+/g, " ")
|
|
160
|
-
.trim()
|
|
161
|
-
.slice(0, 120);
|
|
162
|
-
/** The `<script type="application/ld+json">` blocks of a page, parsed; a `@graph` is spread out. */
|
|
163
|
-
export function jsonLdOf(html) {
|
|
164
|
-
const out = [];
|
|
165
|
-
for (const m of html.matchAll(/<script\b[^>]*type\s*=\s*["']application\/ld\+json["'][^>]*>([\s\S]*?)<\/script>/gi)) {
|
|
166
|
-
let parsed;
|
|
167
|
-
try {
|
|
168
|
-
parsed = JSON.parse(m[1].trim());
|
|
169
|
-
}
|
|
170
|
-
catch {
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
for (const item of Array.isArray(parsed) ? parsed : [parsed]) {
|
|
174
|
-
const graph = item?.["@graph"];
|
|
175
|
-
out.push(...(Array.isArray(graph) ? graph : [item]));
|
|
176
|
-
}
|
|
177
|
-
if (out.length >= 50) {
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return out.slice(0, 50);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* A page for a plugin (`server.web.read`): its whole text as Markdown, every link and its
|
|
185
|
-
* structured data, as against `readWebsite`, which picks what the assistant needs of a
|
|
186
|
-
* company's site.
|
|
187
|
-
*/
|
|
188
|
-
export async function readPage(raw, signal) {
|
|
189
|
-
const { res, base, html } = await loadPage(raw, signal);
|
|
190
|
-
const links = [];
|
|
191
|
-
for (const m of html.matchAll(/<a\b([^>]*)>([\s\S]*?)<\/a>/gi)) {
|
|
192
|
-
const url = absolute(attr(`<a ${m[1]}>`, "href"), base)?.replace(/#.*$/, "");
|
|
193
|
-
if (url && !links.some((l) => l.url === url) && links.length < 2000) {
|
|
194
|
-
links.push({ url, text: linkText(m[2]) });
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
url: base,
|
|
199
|
-
status: res.status,
|
|
200
|
-
etag: res.headers.get("etag"),
|
|
201
|
-
lastModified: res.headers.get("last-modified"),
|
|
202
|
-
title: titleOf(html),
|
|
203
|
-
description: metaOf(html, "description") || metaOf(html, "og:description"),
|
|
204
|
-
text: htmlToMarkdown(html).slice(0, 400_000),
|
|
205
|
-
links,
|
|
206
|
-
jsonld: jsonLdOf(html),
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
const saysLogo = (tag) => /logo/i.test([
|
|
210
|
-
attr(tag, "src"),
|
|
211
|
-
attr(tag, "alt"),
|
|
212
|
-
attr(tag, "class"),
|
|
213
|
-
attr(tag, "id"),
|
|
214
|
-
attr(tag, "aria-label"),
|
|
215
|
-
]
|
|
216
|
-
.filter(Boolean)
|
|
217
|
-
.join(" "));
|
|
218
|
-
/**
|
|
219
|
-
* The logos a page shows, best first: the logo its structured data names, pictures that say
|
|
220
|
-
* "logo", what its home link in the header shows, and its icons. `inline`: SVGs drawn into the
|
|
221
|
-
* page count too, as `data:` addresses — for a person to pick from, too long for a model to read.
|
|
222
|
-
*/
|
|
223
|
-
function logosOf(html, base, inline = false) {
|
|
224
|
-
const logos = [];
|
|
225
|
-
const add = (href, hint) => {
|
|
226
|
-
const url = href.startsWith("data:image/svg+xml") ? href : absolute(href, base);
|
|
227
|
-
if (url && !logos.some((l) => l.url === url)) {
|
|
228
|
-
logos.push({ url, hint });
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
for (const item of jsonLdOf(html)) {
|
|
232
|
-
const logo = item?.logo;
|
|
233
|
-
const href = typeof logo === "string" ? logo : logo?.url;
|
|
234
|
-
if (typeof href === "string") {
|
|
235
|
-
add(href, "the logo the page names in its structured data");
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
for (const tag of tagsOf(html, "img")) {
|
|
239
|
-
const src = attr(tag, "src") || attr(tag, "data-src");
|
|
240
|
-
if (src && !src.startsWith("data:") && saysLogo(tag)) {
|
|
241
|
-
const alt = attr(tag, "alt");
|
|
242
|
-
add(src, `image on the page${alt ? `, alt "${alt}"` : ""}`);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
// What the link home shows is the logo on most sites, said so or not.
|
|
246
|
-
for (const m of html.matchAll(/<a\b([^>]*)>([\s\S]*?)<\/a>/gi)) {
|
|
247
|
-
const href = absolute(attr(`<a ${m[1]}>`, "href"), base);
|
|
248
|
-
if (!href || new URL(href).pathname !== "/" || new URL(href).host !== new URL(base).host) {
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
const img = tagsOf(m[2], "img")[0];
|
|
252
|
-
const src = img && (attr(img, "src") || attr(img, "data-src"));
|
|
253
|
-
if (src && !src.startsWith("data:")) {
|
|
254
|
-
add(src, "image in the link to the home page");
|
|
255
|
-
}
|
|
256
|
-
const svg = inline ? m[2].match(/<svg\b[\s\S]*?<\/svg>/i)?.[0] : undefined;
|
|
257
|
-
if (svg) {
|
|
258
|
-
add(svgUrl(svg), "drawing in the link to the home page");
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
if (inline) {
|
|
262
|
-
for (const m of html.matchAll(/<svg\b[^>]*>[\s\S]*?<\/svg>/gi)) {
|
|
263
|
-
const open = m[0].match(/^<svg\b[^>]*>/i)?.[0] ?? "";
|
|
264
|
-
const title = m[0].match(/<title[^>]*>([\s\S]*?)<\/title>/i)?.[1] ?? "";
|
|
265
|
-
if (saysLogo(open) || /logo/i.test(title)) {
|
|
266
|
-
add(svgUrl(m[0]), "drawing on the page");
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
for (const tag of tagsOf(html, "link")) {
|
|
271
|
-
const rel = attr(tag, "rel").toLowerCase();
|
|
272
|
-
if (/apple-touch-icon|mask-icon|(^|\s)icon/.test(rel)) {
|
|
273
|
-
add(attr(tag, "href"), `${rel} ${attr(tag, "sizes")}`.trim());
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
return logos;
|
|
277
|
-
}
|
|
278
|
-
/** An inline SVG as a picture of its own: with its namespace, as a `data:` address. */
|
|
279
|
-
function svgUrl(svg) {
|
|
280
|
-
const own = /\bxmlns\s*=/.test(svg.match(/^<svg\b[^>]*>/i)?.[0] ?? "")
|
|
281
|
-
? svg
|
|
282
|
-
: svg.replace(/^<svg\b/i, '<svg xmlns="http://www.w3.org/2000/svg"');
|
|
283
|
-
return `data:image/svg+xml;base64,${Buffer.from(own).toString("base64")}`;
|
|
284
|
-
}
|
|
285
|
-
/** The logos on a web page, for a person to pick from (Logos › from a web address). */
|
|
286
|
-
export async function scanLogos(raw, signal) {
|
|
287
|
-
const { base, html } = await loadPage(raw, signal);
|
|
288
|
-
return logosOf(html, base, true)
|
|
289
|
-
.filter((l) => !l.url.startsWith("data:") || l.url.length < 400_000)
|
|
290
|
-
.slice(0, 16);
|
|
291
|
-
}
|
|
292
|
-
/** The CSS a page brings: its `<style>` blocks, style attributes and first stylesheets. */
|
|
293
|
-
async function cssOf(html, base, signal) {
|
|
294
|
-
const sheets = tagsOf(html, "link")
|
|
295
|
-
.filter((t) => /stylesheet/i.test(attr(t, "rel")))
|
|
296
|
-
.map((t) => absolute(attr(t, "href"), base))
|
|
297
|
-
.filter((u) => Boolean(u))
|
|
298
|
-
.slice(0, 4);
|
|
299
|
-
const inline = [...html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map((m) => m[1]);
|
|
300
|
-
const styled = [...html.matchAll(/\bstyle\s*=\s*"([^"]*)"/gi)].map((m) => m[1]);
|
|
301
|
-
return [
|
|
302
|
-
...inline,
|
|
303
|
-
...styled,
|
|
304
|
-
...(await Promise.all(sheets.map((s) => stylesheet(s, signal)))),
|
|
305
|
-
].join("\n");
|
|
306
|
-
}
|
|
307
|
-
/** Family names that are no brand's own: generic and system faces. */
|
|
308
|
-
const GENERIC_FONT = /^(serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-[a-z-]+|-apple-system|blinkmacsystemfont|inherit|initial|unset|revert|emoji|math|fangsong|segoe ui( emoji| symbol)?|helvetica( neue)?|arial|roboto|noto (sans|color emoji)|apple color emoji|courier( new)?|times( new roman)?|georgia|menlo|monaco|consolas|var\(.*|liberation mono|sfmono-regular|sf mono|sf pro( text| display)?|dejavu sans( mono)?)$/i;
|
|
309
|
-
/** "Geist Variable" is Geist: a variable font's file name, not another family. */
|
|
310
|
-
const familyName = (raw) => raw
|
|
311
|
-
.replace(/^[\s"'(]+|[\s"')]+$/g, "")
|
|
312
|
-
.replace(/\s+variable$/i, "")
|
|
313
|
-
.trim();
|
|
314
|
-
/**
|
|
315
|
-
* The typefaces a page uses, most used first, with the weights its `@font-face` rules or its
|
|
316
|
-
* Google / Bunny Fonts links name.
|
|
317
|
-
*/
|
|
318
|
-
function fontsOf(css, html) {
|
|
319
|
-
const counts = new Map();
|
|
320
|
-
const weights = new Map();
|
|
321
|
-
const count = (family, n = 1) => counts.set(family, (counts.get(family) ?? 0) + n);
|
|
322
|
-
const weigh = (family, list) => {
|
|
323
|
-
const set = weights.get(family) ?? new Set();
|
|
324
|
-
for (const w of list) {
|
|
325
|
-
set.add(w);
|
|
326
|
-
}
|
|
327
|
-
weights.set(family, set);
|
|
328
|
-
};
|
|
329
|
-
const first = (decl) => decl
|
|
330
|
-
.split(",")
|
|
331
|
-
.map(familyName)
|
|
332
|
-
.find((f) => /[a-z]/i.test(f) && !GENERIC_FONT.test(f));
|
|
333
|
-
// --font-weight-…, --font-size-… and the like are no families.
|
|
334
|
-
for (const m of css.matchAll(/(?:font-family|--font-(?!weight|size|feature|variation|style|stretch)[\w-]+)\s*:\s*([^;}]+)/gi)) {
|
|
335
|
-
const family = first(m[1]);
|
|
336
|
-
if (family) {
|
|
337
|
-
count(family);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
for (const m of css.matchAll(/@font-face\s*\{([^}]*)\}/gi)) {
|
|
341
|
-
const family = first(m[1].match(/font-family\s*:\s*([^;]+)/i)?.[1] ?? "");
|
|
342
|
-
const range = (m[1].match(/font-weight\s*:\s*([^;]+)/i)?.[1] ?? "400")
|
|
343
|
-
.split(/\s+/)
|
|
344
|
-
.map(Number)
|
|
345
|
-
.filter((n) => n >= 100 && n <= 900);
|
|
346
|
-
if (family && range.length) {
|
|
347
|
-
const [lo, hi] = [Math.min(...range), Math.max(...range)];
|
|
348
|
-
weigh(family, FONT_WEIGHTS.filter((w) => w >= lo && w <= hi));
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
// fonts.googleapis.com/css2?family=Inter:wght@400;700 and fonts.bunny.net/css?family=inter:400,700
|
|
352
|
-
for (const m of html.matchAll(/fonts\.(?:googleapis\.com|bunny\.net)\/css2?\?([^"'\s>]+)/gi)) {
|
|
353
|
-
for (const part of m[1].replace(/&/g, "&").split("&")) {
|
|
354
|
-
if (!part.startsWith("family=")) {
|
|
355
|
-
continue;
|
|
356
|
-
}
|
|
357
|
-
for (const one of decodeURIComponent(part.slice(7)).split("|")) {
|
|
358
|
-
const [name, spec = ""] = one.split(":");
|
|
359
|
-
const family = familyName(name.replace(/\+/g, " ").replace(/-/g, " ")).replace(/\b\w/g, (c) => c.toUpperCase());
|
|
360
|
-
count(family, 3);
|
|
361
|
-
weigh(family, (spec.match(/\d{3}/g) ?? []).map(Number).filter((w) => w >= 100 && w <= 900));
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return [...counts.entries()]
|
|
366
|
-
.sort((a, b) => b[1] - a[1])
|
|
367
|
-
.slice(0, 6)
|
|
368
|
-
.map(([family]) => ({
|
|
369
|
-
family,
|
|
370
|
-
weights: [...(weights.get(family) ?? [])].sort((a, b) => a - b),
|
|
371
|
-
}));
|
|
372
|
-
}
|
|
373
|
-
/** The typefaces of a web page, for a person to pick from (Typography › from a web address). */
|
|
374
|
-
export async function scanFonts(raw, signal) {
|
|
375
|
-
const { base, html } = await loadPage(raw, signal);
|
|
376
|
-
return fontsOf(await cssOf(html, base, signal), html);
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* The colours of a web page, for a person to pick from (Colours › from a web address): its
|
|
380
|
-
* theme colour, the colours its stylesheet names, then the ones it uses most. A named one is
|
|
381
|
-
* named after its variable ("--brand-primary" → "brand primary").
|
|
382
|
-
*/
|
|
383
|
-
export async function scanColors(raw, signal) {
|
|
384
|
-
const { base, html } = await loadPage(raw, signal);
|
|
385
|
-
const { variables, frequent } = coloursOf(await cssOf(html, base, signal));
|
|
386
|
-
const out = [];
|
|
387
|
-
const add = (name, value) => {
|
|
388
|
-
if (value && !out.some((c) => c.value === value)) {
|
|
389
|
-
out.push({ name, value });
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
add("theme color", hex(metaOf(html, "theme-color")));
|
|
393
|
-
for (const v of variables) {
|
|
394
|
-
add(v.name.replace(/^--/, "").replace(/[-_]+/g, " "), v.value);
|
|
395
|
-
}
|
|
396
|
-
for (const value of frequent) {
|
|
397
|
-
add("", value);
|
|
398
|
-
}
|
|
399
|
-
return out.slice(0, 24);
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* The pictures of a web page, for a person to pick assets from: its share image, then the
|
|
403
|
-
* images it shows, logos left out.
|
|
404
|
-
*/
|
|
405
|
-
export async function scanImages(raw, signal) {
|
|
406
|
-
const { base, html } = await loadPage(raw, signal);
|
|
407
|
-
const out = [];
|
|
408
|
-
const add = (href, hint) => {
|
|
409
|
-
const url = absolute(href, base);
|
|
410
|
-
if (url && !out.some((i) => i.url === url)) {
|
|
411
|
-
out.push({ url, hint });
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
const og = metaOf(html, "og:image");
|
|
415
|
-
if (og) {
|
|
416
|
-
add(og, "share image");
|
|
417
|
-
}
|
|
418
|
-
for (const tag of tagsOf(html, "img")) {
|
|
419
|
-
const src = attr(tag, "src") || attr(tag, "data-src");
|
|
420
|
-
if (src && !src.startsWith("data:") && !saysLogo(tag)) {
|
|
421
|
-
add(src, attr(tag, "alt"));
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
return out.slice(0, 24);
|
|
425
|
-
}
|
|
426
|
-
export async function readWebsite(raw, signal) {
|
|
427
|
-
const { res, base, html } = await loadPage(raw, signal);
|
|
428
|
-
const tags = (name) => tagsOf(html, name);
|
|
429
|
-
const meta = (key) => metaOf(html, key);
|
|
430
|
-
const logos = logosOf(html, base);
|
|
431
|
-
const images = [];
|
|
432
|
-
for (const tag of tags("img")) {
|
|
433
|
-
const src = attr(tag, "src") || attr(tag, "data-src");
|
|
434
|
-
if (!src || src.startsWith("data:") || saysLogo(tag)) {
|
|
435
|
-
continue;
|
|
436
|
-
}
|
|
437
|
-
const url = absolute(src, base);
|
|
438
|
-
if (url && images.length < 12 && !images.some((i) => i.url === url)) {
|
|
439
|
-
images.push({ url, alt: attr(tag, "alt") });
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
const og = meta("og:image");
|
|
443
|
-
if (og) {
|
|
444
|
-
const url = absolute(og, base);
|
|
445
|
-
if (url) {
|
|
446
|
-
images.unshift({ url, alt: "share image (og:image)" });
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
const css = await cssOf(html, base, signal);
|
|
450
|
-
const host = new URL(base).hostname;
|
|
451
|
-
const links = [];
|
|
452
|
-
for (const m of html.matchAll(/<a\b([^>]*)>([\s\S]*?)<\/a>/gi)) {
|
|
453
|
-
const url = absolute(attr(`<a ${m[1]}>`, "href"), base);
|
|
454
|
-
const text = linkText(m[2]).slice(0, 60);
|
|
455
|
-
if (url &&
|
|
456
|
-
new URL(url).hostname === host &&
|
|
457
|
-
/impressum|imprint|kontakt|contact|about|ueber|über|team|legal|unternehmen|company/i.test(`${url} ${text}`) &&
|
|
458
|
-
!links.some((l) => l.url === url)) {
|
|
459
|
-
links.push({ url, text });
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
const text = htmlToMarkdown(html);
|
|
463
|
-
return {
|
|
464
|
-
url: base,
|
|
465
|
-
status: res.status,
|
|
466
|
-
title: html.match(/<title[^>]*>([\s\S]*?)<\/title>/i)?.[1].trim() ?? "",
|
|
467
|
-
description: meta("description") || meta("og:description"),
|
|
468
|
-
text: text.length > 9000
|
|
469
|
-
? `${text.slice(0, 9000)}\n…[${text.length - 9000} more characters]`
|
|
470
|
-
: text,
|
|
471
|
-
brand: {
|
|
472
|
-
themeColor: hex(meta("theme-color")),
|
|
473
|
-
...coloursOf(css),
|
|
474
|
-
logos: logos.slice(0, 10),
|
|
475
|
-
images,
|
|
476
|
-
fonts: fontsOf(css, html),
|
|
477
|
-
},
|
|
478
|
-
links: links.slice(0, 10),
|
|
479
|
-
};
|
|
480
|
-
}
|