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,420 +0,0 @@
|
|
|
1
|
-
import { versionChanges } from "@engenty-wizards/shared/changes";
|
|
2
|
-
import { pluginToolOf, shapeIssues, validateWizard, wizardSchema, } from "@engenty-wizards/shared/definition";
|
|
3
|
-
import { note } from "@engenty-wizards/shared/run";
|
|
4
|
-
import { and, desc, eq, sql } from "drizzle-orm";
|
|
5
|
-
import { nanoid } from "nanoid";
|
|
6
|
-
import { applyOps, OpError } from "../authoring/ops.js";
|
|
7
|
-
import { listConnectors } from "../connectors/external.js";
|
|
8
|
-
import { db, schema } from "../db/client.js";
|
|
9
|
-
import { env } from "../env.js";
|
|
10
|
-
import { saidOf } from "../model-errors.js";
|
|
11
|
-
import { pluginToolsOf } from "../plugins/registry.js";
|
|
12
|
-
import { dropLinks, putLink } from "../tenants/control.js";
|
|
13
|
-
import { currentTenant } from "../tenants/tenant.js";
|
|
14
|
-
import { serverText } from "../texts.js";
|
|
15
|
-
import { requireAdmin, requireBuild, requireWritable, requireWritableProject } from "./access.js";
|
|
16
|
-
import { changedSteps, emitDraftChanged } from "./draft-events.js";
|
|
17
|
-
import { notFound, ServiceError } from "./errors.js";
|
|
18
|
-
import { copyFiles, draftFiles, sameFiles, seedFiles } from "./files.js";
|
|
19
|
-
import { forgetWizardLinks } from "./links.js";
|
|
20
|
-
import { asLang, countInstall, marketplaceWizard } from "./marketplace.js";
|
|
21
|
-
import { defaultProject, ownedProject } from "./projects.js";
|
|
22
|
-
import { checkRunnerSettings } from "./runners.js";
|
|
23
|
-
/** The wizard a new one starts as, in the language of whoever makes it. */
|
|
24
|
-
function blankWizard(lang) {
|
|
25
|
-
return {
|
|
26
|
-
version: 1,
|
|
27
|
-
title: serverText(lang, "newWizard"),
|
|
28
|
-
description: "",
|
|
29
|
-
avatar: "round",
|
|
30
|
-
lang,
|
|
31
|
-
steps: [
|
|
32
|
-
{
|
|
33
|
-
id: "start",
|
|
34
|
-
type: "page",
|
|
35
|
-
title: serverText(lang, "newWizardStart"),
|
|
36
|
-
fields: [
|
|
37
|
-
{
|
|
38
|
-
id: "input",
|
|
39
|
-
label: serverText(lang, "newWizardAsk"),
|
|
40
|
-
kind: "textarea",
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
{ id: "done", type: "result", title: serverText(lang, "newWizardDone"), deliverables: [] },
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export const studioUrl = (wizardId) => `${env.appUrl}/studio/edit/${wizardId}`;
|
|
50
|
-
export const shareUrl = (token) => `${env.publicUrl}/w/${token}`;
|
|
51
|
-
const newShareToken = () => nanoid(14);
|
|
52
|
-
export async function ownedWizard(_userId, wizardId) {
|
|
53
|
-
const w = await db.query.wizard.findFirst({
|
|
54
|
-
where: and(eq(schema.wizard.id, wizardId), eq(schema.wizard.tenantId, currentTenant())),
|
|
55
|
-
});
|
|
56
|
-
if (!w) {
|
|
57
|
-
throw notFound();
|
|
58
|
-
}
|
|
59
|
-
return w;
|
|
60
|
-
}
|
|
61
|
-
/** The wizard, for a change: refused where its project is a local install's or nothing is built here. */
|
|
62
|
-
export async function writableWizard(userId, wizardId) {
|
|
63
|
-
const w = await ownedWizard(userId, wizardId);
|
|
64
|
-
await requireWritableProject(w.projectId);
|
|
65
|
-
return w;
|
|
66
|
-
}
|
|
67
|
-
export function wizardSummary(w) {
|
|
68
|
-
return {
|
|
69
|
-
id: w.id,
|
|
70
|
-
projectId: w.projectId,
|
|
71
|
-
title: w.title,
|
|
72
|
-
description: w.draft.description,
|
|
73
|
-
avatar: w.draft.avatar,
|
|
74
|
-
revision: w.revision,
|
|
75
|
-
published: w.publishedVersion !== null,
|
|
76
|
-
publishedVersion: w.publishedVersion,
|
|
77
|
-
shareToken: w.shareToken,
|
|
78
|
-
shareEnabled: w.shareEnabled,
|
|
79
|
-
dailyRunLimit: w.dailyRunLimit,
|
|
80
|
-
/** How it is offered; null: the link opens the page, the chat is on beside it. */
|
|
81
|
-
runners: w.runners,
|
|
82
|
-
/** Its page offers it in the viewer's language, translated on request. */
|
|
83
|
-
translate: w.translate,
|
|
84
|
-
stepCount: w.draft.steps.length,
|
|
85
|
-
updatedAt: w.updatedAt.toISOString(),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
export async function listWizards(_userId, projectId) {
|
|
89
|
-
const rows = await db.query.wizard.findMany({
|
|
90
|
-
where: and(eq(schema.wizard.tenantId, currentTenant()), projectId ? eq(schema.wizard.projectId, projectId) : undefined),
|
|
91
|
-
orderBy: [desc(schema.wizard.updatedAt)],
|
|
92
|
-
});
|
|
93
|
-
return rows.map(wizardSummary);
|
|
94
|
-
}
|
|
95
|
-
export async function publishedVersion(w) {
|
|
96
|
-
if (w.publishedVersion === null) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const v = await db.query.wizardVersion.findFirst({
|
|
100
|
-
where: and(eq(schema.wizardVersion.wizardId, w.id), eq(schema.wizardVersion.version, w.publishedVersion)),
|
|
101
|
-
});
|
|
102
|
-
return v ?? null;
|
|
103
|
-
}
|
|
104
|
-
/** Connections must name connectors the project has imported, and actions those connectors have. */
|
|
105
|
-
async function connectorIssues(projectId, draft) {
|
|
106
|
-
const wanted = (draft.connections ?? []).filter((c) => c.connector);
|
|
107
|
-
if (!wanted.length) {
|
|
108
|
-
return [];
|
|
109
|
-
}
|
|
110
|
-
const issues = [];
|
|
111
|
-
const connectors = await listConnectors(projectId);
|
|
112
|
-
for (const connection of wanted) {
|
|
113
|
-
const connector = connectors.find((c) => c.id === connection.connector);
|
|
114
|
-
if (!connector) {
|
|
115
|
-
issues.push({
|
|
116
|
-
message: `Connection "${connection.id}" uses connector "${connection.connector}", which this project has not imported.`,
|
|
117
|
-
});
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
const unknown = (connection.actions ?? []).filter((a) => !connector.actions.some((x) => x.id === a));
|
|
121
|
-
if (unknown.length && !connector.toolsPending) {
|
|
122
|
-
issues.push({
|
|
123
|
-
message: `Connection "${connection.id}": ${connector.name} has no action ${unknown.map((a) => `"${a}"`).join(", ")}.`,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return issues;
|
|
128
|
-
}
|
|
129
|
-
/** Tools of plugins the draft's steps list that this tenant does not have. */
|
|
130
|
-
async function pluginIssues(draft) {
|
|
131
|
-
const issues = [];
|
|
132
|
-
let known = null;
|
|
133
|
-
for (const step of draft.steps) {
|
|
134
|
-
for (const id of step.type === "agent" ? step.tools : []) {
|
|
135
|
-
const named = pluginToolOf(id);
|
|
136
|
-
if (!named) {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
known ??= new Set((await pluginToolsOf(currentTenant())).map((tool) => tool.id));
|
|
140
|
-
if (!known.has(id)) {
|
|
141
|
-
issues.push({
|
|
142
|
-
stepId: step.id,
|
|
143
|
-
message: `Step “${step.id}”: the tool “${id}” isn’t available here – the plugin “${named.plugin}” isn’t installed or has no such tool.`,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return issues;
|
|
149
|
-
}
|
|
150
|
-
/** Everything wrong with a draft: its structure, its workspace files, its project's connectors and plugins. */
|
|
151
|
-
async function checkDraft(projectId, draft, files) {
|
|
152
|
-
return [
|
|
153
|
-
...validateWizard(draft, files),
|
|
154
|
-
...(await connectorIssues(projectId, draft)),
|
|
155
|
-
...(await pluginIssues(draft)),
|
|
156
|
-
];
|
|
157
|
-
}
|
|
158
|
-
/** Validator issues of the draft, checked against its workspace and the project's connectors. */
|
|
159
|
-
export async function draftIssues(w) {
|
|
160
|
-
const files = await draftFiles(w.id);
|
|
161
|
-
return checkDraft(w.projectId, w.draft, files.map((f) => f.path));
|
|
162
|
-
}
|
|
163
|
-
/** The draft with its validator issues and whether it differs from the published version. */
|
|
164
|
-
export async function wizardState(w) {
|
|
165
|
-
const published = await publishedVersion(w);
|
|
166
|
-
const files = await draftFiles(w.id);
|
|
167
|
-
return {
|
|
168
|
-
...wizardSummary(w),
|
|
169
|
-
draft: w.draft,
|
|
170
|
-
files,
|
|
171
|
-
issues: await checkDraft(w.projectId, w.draft, files.map((f) => f.path)),
|
|
172
|
-
dirty: !published ||
|
|
173
|
-
JSON.stringify(published.definition) !== JSON.stringify(w.draft) ||
|
|
174
|
-
!sameFiles(published.files, files),
|
|
175
|
-
shareUrl: shareUrl(w.shareToken),
|
|
176
|
-
studioUrl: studioUrl(w.id),
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* What "Änderungen live schalten" says: the version people run, what the draft changes of it,
|
|
181
|
-
* and the latest test run of exactly this draft and its files.
|
|
182
|
-
*/
|
|
183
|
-
export async function draftChanges(w) {
|
|
184
|
-
const published = await publishedVersion(w);
|
|
185
|
-
const files = await draftFiles(w.id);
|
|
186
|
-
const draft = JSON.stringify(w.draft);
|
|
187
|
-
const tests = await db.query.run.findMany({
|
|
188
|
-
where: and(eq(schema.run.wizardId, w.id), eq(schema.run.mode, "test")),
|
|
189
|
-
orderBy: [desc(schema.run.createdAt)],
|
|
190
|
-
columns: { id: true, definition: true, files: true, createdAt: true, status: true },
|
|
191
|
-
limit: 20,
|
|
192
|
-
});
|
|
193
|
-
const tested = tests.find((r) => JSON.stringify(r.definition) === draft && sameFiles(r.files, files));
|
|
194
|
-
return {
|
|
195
|
-
version: published?.version ?? null,
|
|
196
|
-
published: published?.definition ?? null,
|
|
197
|
-
changes: published ? versionChanges(published, { definition: w.draft, files }) : [],
|
|
198
|
-
tested: tested
|
|
199
|
-
? { runId: tested.id, at: tested.createdAt.toISOString(), status: tested.status }
|
|
200
|
-
: null,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
export async function wizardMessages(wizardId) {
|
|
204
|
-
return db.query.wizardMessage.findMany({
|
|
205
|
-
where: eq(schema.wizardMessage.wizardId, wizardId),
|
|
206
|
-
orderBy: [schema.wizardMessage.createdAt],
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
export async function addMessage(wizardId, message, writer = { source: "studio" }) {
|
|
210
|
-
const id = nanoid(12);
|
|
211
|
-
await db.insert(schema.wizardMessage).values({
|
|
212
|
-
id,
|
|
213
|
-
wizardId,
|
|
214
|
-
role: message.role,
|
|
215
|
-
content: message.content,
|
|
216
|
-
changed: message.changed ?? false,
|
|
217
|
-
source: writer.source,
|
|
218
|
-
client: writer.source === "mcp" ? writer.client : null,
|
|
219
|
-
});
|
|
220
|
-
return id;
|
|
221
|
-
}
|
|
222
|
-
/** The schema check every write passes. Validator issues are allowed in a draft; a wrong shape is not. */
|
|
223
|
-
export function parseDraft(raw, files) {
|
|
224
|
-
const parsed = wizardSchema.safeParse(raw);
|
|
225
|
-
if (!parsed.success) {
|
|
226
|
-
throw new ServiceError("invalid", { server: "schemaMismatch" }, {
|
|
227
|
-
issues: shapeIssues(parsed.error, raw),
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
return { draft: parsed.data, issues: validateWizard(parsed.data, files) };
|
|
231
|
-
}
|
|
232
|
-
export async function createWizard(userId, input, writer = { source: "studio" }) {
|
|
233
|
-
// Asked first: a tenant that builds nothing here has no project of its own to name.
|
|
234
|
-
await requireBuild();
|
|
235
|
-
await requireAdmin();
|
|
236
|
-
const project = input.projectId
|
|
237
|
-
? await ownedProject(userId, input.projectId)
|
|
238
|
-
: await defaultProject(userId);
|
|
239
|
-
await requireWritable(project);
|
|
240
|
-
const starter = input.starterId
|
|
241
|
-
? await marketplaceWizard(input.starterId, asLang(input.lang))
|
|
242
|
-
: undefined;
|
|
243
|
-
if (input.starterId && !starter) {
|
|
244
|
-
throw new ServiceError("invalid", note("unknownTemplate", { starterId: input.starterId }));
|
|
245
|
-
}
|
|
246
|
-
const maker = input.lang?.toLowerCase().startsWith("de") ? "de" : "en";
|
|
247
|
-
const { draft, issues } = input.definition !== undefined
|
|
248
|
-
? parseDraft(input.definition)
|
|
249
|
-
: starter
|
|
250
|
-
? // A starter names the language it is written in, where its definition does not.
|
|
251
|
-
{
|
|
252
|
-
draft: { ...starter.definition, lang: starter.definition.lang ?? starter.language },
|
|
253
|
-
issues: [],
|
|
254
|
-
}
|
|
255
|
-
: { draft: blankWizard(maker), issues: [] };
|
|
256
|
-
const fromStarter = input.definition === undefined ? starter : undefined;
|
|
257
|
-
const id = nanoid(12);
|
|
258
|
-
const shareToken = newShareToken();
|
|
259
|
-
await db.insert(schema.wizard).values({
|
|
260
|
-
id,
|
|
261
|
-
projectId: project.id,
|
|
262
|
-
tenantId: currentTenant(),
|
|
263
|
-
title: draft.title,
|
|
264
|
-
draft,
|
|
265
|
-
shareToken,
|
|
266
|
-
dailyRunLimit: env.limits.defaultDailyRuns,
|
|
267
|
-
starter: fromStarter?.id ?? null,
|
|
268
|
-
starterRevision: fromStarter?.revision ?? null,
|
|
269
|
-
});
|
|
270
|
-
await putLink(shareToken, "wizard", id);
|
|
271
|
-
if (fromStarter) {
|
|
272
|
-
await seedFiles(id, fromStarter.files);
|
|
273
|
-
// Counted at the marketplace, beside the request; a plugin's starter is not the marketplace's.
|
|
274
|
-
if (!fromStarter.plugin) {
|
|
275
|
-
void countInstall(fromStarter.id);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
if (input.note) {
|
|
279
|
-
await addMessage(id, { role: "assistant", content: input.note, changed: true }, writer);
|
|
280
|
-
}
|
|
281
|
-
else if (fromStarter) {
|
|
282
|
-
await addMessage(id, {
|
|
283
|
-
role: "assistant",
|
|
284
|
-
content: serverText(fromStarter.language, "templateSetUp", { title: fromStarter.title }),
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
return { id, revision: 0, issues, studioUrl: studioUrl(id) };
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Replaces the draft if nobody wrote since `baseRevision`. Every draft write — studio inspector,
|
|
291
|
-
* architect, MCP — goes through here, so the revision counts all of them.
|
|
292
|
-
*/
|
|
293
|
-
export async function writeDraft(userId, wizardId, input, writer = { source: "studio" }) {
|
|
294
|
-
const w = await writableWizard(userId, wizardId);
|
|
295
|
-
const files = await draftFiles(w.id);
|
|
296
|
-
const paths = files.map((f) => f.path);
|
|
297
|
-
const { draft } = parseDraft(input.definition, paths);
|
|
298
|
-
const issues = await checkDraft(w.projectId, draft, paths);
|
|
299
|
-
const [row] = await db
|
|
300
|
-
.update(schema.wizard)
|
|
301
|
-
.set({
|
|
302
|
-
draft,
|
|
303
|
-
title: draft.title,
|
|
304
|
-
revision: sql `${schema.wizard.revision} + 1`,
|
|
305
|
-
updatedAt: new Date(),
|
|
306
|
-
})
|
|
307
|
-
.where(and(eq(schema.wizard.id, w.id), eq(schema.wizard.revision, input.baseRevision)))
|
|
308
|
-
.returning({ revision: schema.wizard.revision });
|
|
309
|
-
if (!row) {
|
|
310
|
-
const current = await ownedWizard(userId, wizardId);
|
|
311
|
-
throw new ServiceError("revision_conflict", note("wizardChangedMeantime"), {
|
|
312
|
-
revision: current.revision,
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
if (input.note) {
|
|
316
|
-
await addMessage(w.id, { role: "assistant", content: input.note, changed: true }, writer);
|
|
317
|
-
}
|
|
318
|
-
emitDraftChanged({
|
|
319
|
-
wizardId: w.id,
|
|
320
|
-
kind: "draft",
|
|
321
|
-
revision: row.revision,
|
|
322
|
-
source: writer.source,
|
|
323
|
-
client: writer.source === "mcp" ? writer.client : null,
|
|
324
|
-
note: input.note ?? null,
|
|
325
|
-
touched: changedSteps(w.draft, draft),
|
|
326
|
-
});
|
|
327
|
-
return { revision: row.revision, issues, draft };
|
|
328
|
-
}
|
|
329
|
-
export async function editWizard(userId, wizardId, input, writer) {
|
|
330
|
-
const w = await writableWizard(userId, wizardId);
|
|
331
|
-
if (w.revision !== input.baseRevision) {
|
|
332
|
-
throw new ServiceError("revision_conflict", note("wizardChangedMeantime"), {
|
|
333
|
-
revision: w.revision,
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
let definition;
|
|
337
|
-
try {
|
|
338
|
-
definition = applyOps(w.draft, input.ops);
|
|
339
|
-
}
|
|
340
|
-
catch (err) {
|
|
341
|
-
if (err instanceof OpError) {
|
|
342
|
-
throw new ServiceError("invalid", saidOf(err));
|
|
343
|
-
}
|
|
344
|
-
throw err;
|
|
345
|
-
}
|
|
346
|
-
return writeDraft(userId, wizardId, { definition, baseRevision: input.baseRevision, note: input.note }, writer);
|
|
347
|
-
}
|
|
348
|
-
export async function updateWizardSettings(userId, wizardId, patch) {
|
|
349
|
-
const w = await writableWizard(userId, wizardId);
|
|
350
|
-
if (patch.projectId) {
|
|
351
|
-
await requireWritable(await ownedProject(userId, patch.projectId));
|
|
352
|
-
}
|
|
353
|
-
const runners = patch.runners ? await checkRunnerSettings(patch.runners) : undefined;
|
|
354
|
-
await db
|
|
355
|
-
.update(schema.wizard)
|
|
356
|
-
.set({ ...patch, ...(runners ? { runners } : {}), updatedAt: new Date() })
|
|
357
|
-
.where(eq(schema.wizard.id, w.id));
|
|
358
|
-
return wizardSummary(await ownedWizard(userId, wizardId));
|
|
359
|
-
}
|
|
360
|
-
export async function rotateShareLink(userId, wizardId) {
|
|
361
|
-
const w = await writableWizard(userId, wizardId);
|
|
362
|
-
const token = newShareToken();
|
|
363
|
-
await db
|
|
364
|
-
.update(schema.wizard)
|
|
365
|
-
.set({ shareToken: token, updatedAt: new Date() })
|
|
366
|
-
.where(eq(schema.wizard.id, w.id));
|
|
367
|
-
await dropLinks([w.shareToken]);
|
|
368
|
-
await putLink(token, "wizard", w.id);
|
|
369
|
-
return { shareToken: token, shareUrl: shareUrl(token) };
|
|
370
|
-
}
|
|
371
|
-
export async function duplicateWizard(userId, wizardId) {
|
|
372
|
-
await requireAdmin();
|
|
373
|
-
const w = await writableWizard(userId, wizardId);
|
|
374
|
-
const id = nanoid(12);
|
|
375
|
-
const draft = { ...w.draft, title: `${w.draft.title} (Kopie)` };
|
|
376
|
-
const shareToken = newShareToken();
|
|
377
|
-
await db.insert(schema.wizard).values({
|
|
378
|
-
id,
|
|
379
|
-
projectId: w.projectId,
|
|
380
|
-
tenantId: currentTenant(),
|
|
381
|
-
title: draft.title,
|
|
382
|
-
draft,
|
|
383
|
-
shareToken,
|
|
384
|
-
dailyRunLimit: w.dailyRunLimit,
|
|
385
|
-
starter: w.starter,
|
|
386
|
-
});
|
|
387
|
-
await putLink(shareToken, "wizard", id);
|
|
388
|
-
await copyFiles(w.id, id);
|
|
389
|
-
return { id };
|
|
390
|
-
}
|
|
391
|
-
export async function deleteWizard(userId, wizardId) {
|
|
392
|
-
await requireAdmin();
|
|
393
|
-
await writableWizard(userId, wizardId);
|
|
394
|
-
await forgetWizardLinks(wizardId);
|
|
395
|
-
await db
|
|
396
|
-
.delete(schema.wizard)
|
|
397
|
-
.where(and(eq(schema.wizard.id, wizardId), eq(schema.wizard.tenantId, currentTenant())));
|
|
398
|
-
}
|
|
399
|
-
/** A wizard with validator issues is never published — same rule for studio and MCP. */
|
|
400
|
-
export async function requireClean(w) {
|
|
401
|
-
const files = await draftFiles(w.id);
|
|
402
|
-
const issues = await checkDraft(w.projectId, w.draft, files.map((f) => f.path));
|
|
403
|
-
if (issues.length) {
|
|
404
|
-
throw new ServiceError("has_issues", note("wizardStillErrors"), { issues });
|
|
405
|
-
}
|
|
406
|
-
return { definition: w.draft, files };
|
|
407
|
-
}
|
|
408
|
-
export async function publishWizard(userId, wizardId) {
|
|
409
|
-
const w = await writableWizard(userId, wizardId);
|
|
410
|
-
const { definition, files } = await requireClean(w);
|
|
411
|
-
const version = (w.publishedVersion ?? 0) + 1;
|
|
412
|
-
await db
|
|
413
|
-
.insert(schema.wizardVersion)
|
|
414
|
-
.values({ id: nanoid(12), wizardId: w.id, version, definition, files });
|
|
415
|
-
await db
|
|
416
|
-
.update(schema.wizard)
|
|
417
|
-
.set({ publishedVersion: version, updatedAt: new Date() })
|
|
418
|
-
.where(eq(schema.wizard.id, w.id));
|
|
419
|
-
return { version, shareUrl: shareUrl(w.shareToken), shareEnabled: w.shareEnabled };
|
|
420
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { eq } from "drizzle-orm";
|
|
2
|
-
import { control, controlDb } from "./db/client.js";
|
|
3
|
-
/** Settings of a runtime that runs alone, kept in the control database. Never secrets. */
|
|
4
|
-
export async function readSetting(key) {
|
|
5
|
-
const row = await controlDb.query.setting.findFirst({ where: eq(control.setting.key, key) });
|
|
6
|
-
return row?.value ?? null;
|
|
7
|
-
}
|
|
8
|
-
export async function writeSetting(key, value) {
|
|
9
|
-
await controlDb
|
|
10
|
-
.insert(control.setting)
|
|
11
|
-
.values({ key, value })
|
|
12
|
-
.onConflictDoUpdate({ target: control.setting.key, set: { value } });
|
|
13
|
-
}
|
|
14
|
-
export async function deleteSetting(key) {
|
|
15
|
-
await controlDb.delete(control.setting).where(eq(control.setting.key, key));
|
|
16
|
-
}
|