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,409 +0,0 @@
|
|
|
1
|
-
import { note } from "@engenty-wizards/shared/run";
|
|
2
|
-
import { and, asc, eq } from "drizzle-orm";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { db, schema } from "../db/client.js";
|
|
5
|
-
import { buildImportedConnector, mcpHeaders, } from "../engenty/connections-external/build-connector.js";
|
|
6
|
-
import { ImportValidationError } from "../engenty/connections-external/errors.js";
|
|
7
|
-
import { assembleRecord, connectorIdFromSlug, prepareSource, resolveRequiredHeaders, surfaceRequiresAuth, toolPrefixFromSlug, } from "../engenty/connections-external/import-service.js";
|
|
8
|
-
import { createGuardedFetch } from "../engenty/connections-external/net/guarded-fetch.js";
|
|
9
|
-
import { discoverImportableSources, discoverOAuthFacts, registryDiscover, registrySearch, resolveMcpTransport, } from "../engenty/connections-external/registry-client.js";
|
|
10
|
-
import { resolveRegistrySource } from "../engenty/connections-external/registry-source.js";
|
|
11
|
-
import { encryptToken } from "../engenty/shims/connections-sdk.js";
|
|
12
|
-
import { env } from "../env.js";
|
|
13
|
-
import { requireAdmin, requireWritableProject } from "../services/access.js";
|
|
14
|
-
import { ServiceError } from "../services/errors.js";
|
|
15
|
-
import { BUILTIN_CONNECTORS, builtinConnector, missingSetup, usable } from "./builtin.js";
|
|
16
|
-
/**
|
|
17
|
-
* Imported connectors: any service becomes a connector from its OpenAPI spec or MCP server,
|
|
18
|
-
* found through the integrations registry or pasted as a URL. Searching, normalising, auth
|
|
19
|
-
* mapping and invoking are engenty's (`apps/runtime/src/engenty/connections-external`); kept here is what
|
|
20
|
-
* engenty leaves to its host — where the records live and who may import.
|
|
21
|
-
*/
|
|
22
|
-
// engenty's dynamic client registration reads the redirect from this variable.
|
|
23
|
-
process.env.CONNECTIONS_REDIRECT_URI ??=
|
|
24
|
-
env.connectRedirectUrl || `${env.appUrl}/api/connect/callback`;
|
|
25
|
-
const where = (projectId, id) => and(eq(schema.projectConnector.projectId, projectId), eq(schema.projectConnector.id, id));
|
|
26
|
-
async function load(projectId, id) {
|
|
27
|
-
const row = await db.query.projectConnector.findFirst({ where: where(projectId, id) });
|
|
28
|
-
return row?.record ?? null;
|
|
29
|
-
}
|
|
30
|
-
async function save(projectId, record) {
|
|
31
|
-
await db
|
|
32
|
-
.insert(schema.projectConnector)
|
|
33
|
-
.values({ projectId, id: record.id, record })
|
|
34
|
-
.onConflictDoUpdate({
|
|
35
|
-
target: [schema.projectConnector.projectId, schema.projectConnector.id],
|
|
36
|
-
set: { record, updatedAt: new Date() },
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
const actionView = (a) => ({
|
|
40
|
-
id: a.id,
|
|
41
|
-
summary: (a.summary || a.description).slice(0, 160),
|
|
42
|
-
group: a.classification,
|
|
43
|
-
});
|
|
44
|
-
function view(record) {
|
|
45
|
-
const auth = record.auth_config;
|
|
46
|
-
const needsOAuthClient = auth.kind === "oauth2" && !record.client_id_enc && !(auth.dcr && auth.registration_endpoint);
|
|
47
|
-
return {
|
|
48
|
-
usable: !needsOAuthClient,
|
|
49
|
-
missingSetup: null,
|
|
50
|
-
id: record.id,
|
|
51
|
-
name: record.name,
|
|
52
|
-
domain: record.domain,
|
|
53
|
-
sourceKind: record.source_kind,
|
|
54
|
-
sourceUrl: record.source_url,
|
|
55
|
-
toolPrefix: record.tool_prefix,
|
|
56
|
-
auth: auth.kind,
|
|
57
|
-
needsOAuthClient,
|
|
58
|
-
toolsPending: record.source_kind === "mcp" && record.actions.length === 0,
|
|
59
|
-
actions: record.actions.map(actionView),
|
|
60
|
-
importedAt: record.imported_at,
|
|
61
|
-
refreshedAt: record.refreshed_at,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/** What the admin can fix is told as it is; anything else is the registry or the source failing. */
|
|
65
|
-
function importFailure(err) {
|
|
66
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
67
|
-
return new ServiceError(err instanceof ImportValidationError ? "invalid" : "refused", message);
|
|
68
|
-
}
|
|
69
|
-
/** What the studio, the architect and MCP clients send to import a connector. */
|
|
70
|
-
export const connectorImportSchema = z.object({
|
|
71
|
-
domain: z.string().min(1).max(253),
|
|
72
|
-
sourceKind: z.enum(["openapi", "mcp"]),
|
|
73
|
-
sourceUrl: z.string().url(),
|
|
74
|
-
id: z.string().min(2).max(60),
|
|
75
|
-
toolPrefix: z.string().min(2).max(31),
|
|
76
|
-
name: z.string().min(1).max(120).optional(),
|
|
77
|
-
actions: z.array(z.string()).max(500).optional(),
|
|
78
|
-
oauthClientId: z.string().max(500).optional(),
|
|
79
|
-
oauthClientSecret: z.string().max(500).optional(),
|
|
80
|
-
});
|
|
81
|
-
// --- the registry ----------------------------------------------------------------
|
|
82
|
-
export async function searchRegistry(query) {
|
|
83
|
-
const results = await registrySearch({ query, limit: 12 });
|
|
84
|
-
return results.map((r) => ({
|
|
85
|
-
domain: r.domain,
|
|
86
|
-
name: r.name,
|
|
87
|
-
description: r.description,
|
|
88
|
-
kinds: r.kinds.filter((k) => k === "openapi" || k === "mcp"),
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
export async function registryService(domain) {
|
|
92
|
-
const { parsed } = await registryDiscover(domain).catch((err) => {
|
|
93
|
-
throw importFailure(err);
|
|
94
|
-
});
|
|
95
|
-
return {
|
|
96
|
-
domain: parsed.domain,
|
|
97
|
-
summary: parsed.summary ?? parsed.description ?? null,
|
|
98
|
-
sources: discoverImportableSources(parsed).map((s) => ({
|
|
99
|
-
sourceKind: s.source_kind,
|
|
100
|
-
sourceUrl: s.source_url,
|
|
101
|
-
name: s.surface.name,
|
|
102
|
-
blocked: s.blocked_reason,
|
|
103
|
-
auth: s.surface.auth.status,
|
|
104
|
-
suggestedId: connectorIdFromSlug(s.surface.slug),
|
|
105
|
-
suggestedToolPrefix: toolPrefixFromSlug(s.surface.slug),
|
|
106
|
-
})),
|
|
107
|
-
credentials: Object.values(parsed.credentials).map((c) => ({
|
|
108
|
-
label: c.label ?? c.type,
|
|
109
|
-
setup: c.setup ?? null,
|
|
110
|
-
url: c.generateUrl ?? null,
|
|
111
|
-
})),
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* OAuth facts straight from an MCP server. The registry says "OAuth, see the server's well-known
|
|
116
|
-
* document" for most MCP servers but probes only the service's main domain, so its own document
|
|
117
|
-
* carries no endpoints for them. The server publishes them itself (RFC 9728, RFC 8414).
|
|
118
|
-
*/
|
|
119
|
-
async function probeOAuth(sourceUrl) {
|
|
120
|
-
const guarded = createGuardedFetch();
|
|
121
|
-
const json = async (url) => {
|
|
122
|
-
const res = await guarded(url, {
|
|
123
|
-
headers: { accept: "application/json" },
|
|
124
|
-
signal: AbortSignal.timeout(10_000),
|
|
125
|
-
}).catch(() => null);
|
|
126
|
-
return res?.ok
|
|
127
|
-
? (await res.json().catch(() => null))
|
|
128
|
-
: null;
|
|
129
|
-
};
|
|
130
|
-
const origin = new URL(sourceUrl).origin;
|
|
131
|
-
const resource = await json(`${origin}/.well-known/oauth-protected-resource`);
|
|
132
|
-
const issuer = resource?.authorization_servers?.[0] ?? origin;
|
|
133
|
-
const server = (await json(`${issuer.replace(/\/+$/, "")}/.well-known/oauth-authorization-server`)) ??
|
|
134
|
-
(await json(`${origin}/.well-known/oauth-authorization-server`));
|
|
135
|
-
const text = (v) => (typeof v === "string" && v ? v : undefined);
|
|
136
|
-
const list = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === "string") : []);
|
|
137
|
-
const authorizationEndpoint = text(server?.authorization_endpoint);
|
|
138
|
-
const tokenEndpoint = text(server?.token_endpoint);
|
|
139
|
-
if (!(authorizationEndpoint && tokenEndpoint)) {
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
const registrationEndpoint = text(server?.registration_endpoint);
|
|
143
|
-
const scopes = list(server?.scopes_supported);
|
|
144
|
-
return {
|
|
145
|
-
authorizationEndpoint,
|
|
146
|
-
tokenEndpoint,
|
|
147
|
-
grantTypes: list(server?.grant_types_supported),
|
|
148
|
-
// A long list is a catalogue, not what one client should ask for.
|
|
149
|
-
scopes: scopes.length <= 8 ? scopes : [],
|
|
150
|
-
...(registrationEndpoint ? { registrationEndpoint, dcr: true } : {}),
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
/** Fetch and normalise a source with the facts the registry holds about it. */
|
|
154
|
-
async function prepare(input) {
|
|
155
|
-
const resolved = input.domain
|
|
156
|
-
? await resolveRegistrySource({ domain: input.domain, sourceUrl: input.sourceUrl })
|
|
157
|
-
: { discover: null, surface: null };
|
|
158
|
-
const { surface } = resolved;
|
|
159
|
-
if (input.sourceKind === "mcp" &&
|
|
160
|
-
resolved.discover &&
|
|
161
|
-
surfaceRequiresAuth(surface) &&
|
|
162
|
-
!discoverOAuthFacts(resolved.discover.parsed)) {
|
|
163
|
-
const oauth = await probeOAuth(input.sourceUrl);
|
|
164
|
-
if (oauth) {
|
|
165
|
-
const parsed = resolved.discover.parsed;
|
|
166
|
-
resolved.discover.parsed = {
|
|
167
|
-
...parsed,
|
|
168
|
-
detect: { ...parsed.detect, auth: { ...parsed.detect?.auth, oauth } },
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
const blockers = [];
|
|
173
|
-
if (surface) {
|
|
174
|
-
try {
|
|
175
|
-
resolveRequiredHeaders(surface);
|
|
176
|
-
}
|
|
177
|
-
catch (err) {
|
|
178
|
-
blockers.push(err.message);
|
|
179
|
-
}
|
|
180
|
-
if (surface.variables.length) {
|
|
181
|
-
blockers.push(`this source needs ${surface.variables.map((v) => v.name).join(", ")} in its address — paste the resolved URL instead`);
|
|
182
|
-
}
|
|
183
|
-
if (input.sourceKind === "mcp" && !resolveMcpTransport(surface)) {
|
|
184
|
-
blockers.push(`unsupported MCP transport (${surface.transports.join(", ")})`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const prepared = await prepareSource({
|
|
188
|
-
deferMcpTools: input.sourceKind === "mcp" && surfaceRequiresAuth(surface),
|
|
189
|
-
requiredHeaders: !blockers.length && surface ? resolveRequiredHeaders(surface) : [],
|
|
190
|
-
sourceKind: input.sourceKind,
|
|
191
|
-
sourceUrl: input.sourceUrl,
|
|
192
|
-
specOverrides: surface?.spec_overrides ?? [],
|
|
193
|
-
transport: surface ? resolveMcpTransport(surface) : null,
|
|
194
|
-
});
|
|
195
|
-
return { ...resolved, prepared, blockers };
|
|
196
|
-
}
|
|
197
|
-
export async function previewSource(input) {
|
|
198
|
-
const { prepared, blockers } = await prepare(input).catch((err) => {
|
|
199
|
-
throw importFailure(err);
|
|
200
|
-
});
|
|
201
|
-
return {
|
|
202
|
-
title: prepared.normalized.title,
|
|
203
|
-
actions: prepared.normalized.actions.map(actionView),
|
|
204
|
-
blockers,
|
|
205
|
-
dropped: prepared.normalized.dropped_count,
|
|
206
|
-
toolsPending: prepared.deferred_mcp_tools === true,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
// --- a project's connectors --------------------------------------------------------
|
|
210
|
-
async function builtinView(connector) {
|
|
211
|
-
const ready = await usable(connector);
|
|
212
|
-
return {
|
|
213
|
-
id: connector.id,
|
|
214
|
-
name: connector.name,
|
|
215
|
-
domain: "",
|
|
216
|
-
sourceKind: "builtin",
|
|
217
|
-
sourceUrl: "",
|
|
218
|
-
toolPrefix: connector.toolPrefix,
|
|
219
|
-
auth: connector.auth.kind === "oauth2" ? "oauth2" : "api_key",
|
|
220
|
-
usable: ready,
|
|
221
|
-
missingSetup: ready ? null : missingSetup(connector),
|
|
222
|
-
needsOAuthClient: false,
|
|
223
|
-
toolsPending: false,
|
|
224
|
-
actions: connector.actions.map((a) => ({
|
|
225
|
-
id: a.id,
|
|
226
|
-
summary: a.summary.slice(0, 160),
|
|
227
|
-
group: a.group,
|
|
228
|
-
})),
|
|
229
|
-
importedAt: "",
|
|
230
|
-
refreshedAt: null,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
/** Every connector a wizard of the project can name: the built-in ones, then its imports. */
|
|
234
|
-
export async function listConnectors(projectId) {
|
|
235
|
-
const rows = await db.query.projectConnector.findMany({
|
|
236
|
-
where: eq(schema.projectConnector.projectId, projectId),
|
|
237
|
-
orderBy: [asc(schema.projectConnector.createdAt)],
|
|
238
|
-
});
|
|
239
|
-
return [
|
|
240
|
-
...(await Promise.all(BUILTIN_CONNECTORS.map(builtinView))),
|
|
241
|
-
...rows.map((r) => view(r.record)),
|
|
242
|
-
];
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* A connector by id, ready to run, with the JSON schema of each action's input: a built-in one,
|
|
246
|
-
* or one the project imported.
|
|
247
|
-
*/
|
|
248
|
-
export async function resolveConnector(projectId, id) {
|
|
249
|
-
const builtin = builtinConnector(id);
|
|
250
|
-
if (builtin) {
|
|
251
|
-
return {
|
|
252
|
-
connector: builtin,
|
|
253
|
-
imported: false,
|
|
254
|
-
inputSchema: (actionId) => {
|
|
255
|
-
const action = builtin.actions.find((a) => a.id === actionId);
|
|
256
|
-
try {
|
|
257
|
-
return action ? z.toJSONSchema(action.inputSchema) : {};
|
|
258
|
-
}
|
|
259
|
-
catch {
|
|
260
|
-
return {};
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
const found = await importedConnector(projectId, id);
|
|
266
|
-
return found
|
|
267
|
-
? {
|
|
268
|
-
connector: found.connector,
|
|
269
|
-
imported: true,
|
|
270
|
-
inputSchema: (actionId) => found.record.actions.find((a) => a.id === actionId)?.input_json_schema ?? {},
|
|
271
|
-
}
|
|
272
|
-
: null;
|
|
273
|
-
}
|
|
274
|
-
export async function importConnector(userId, projectId, input) {
|
|
275
|
-
await requireWritableProject(projectId);
|
|
276
|
-
await requireAdmin();
|
|
277
|
-
if (await load(projectId, input.id)) {
|
|
278
|
-
throw new ServiceError("invalid", note("connectorAlreadyExistsSpace", { id: input.id }));
|
|
279
|
-
}
|
|
280
|
-
try {
|
|
281
|
-
const { discover, surface, prepared } = await prepare(input);
|
|
282
|
-
const { record, warnings } = assembleRecord({
|
|
283
|
-
actionFilter: input.actions ?? null,
|
|
284
|
-
discover: discover?.parsed ?? null,
|
|
285
|
-
domain: input.domain,
|
|
286
|
-
id: input.id,
|
|
287
|
-
importedBy: userId,
|
|
288
|
-
name: input.name ?? null,
|
|
289
|
-
oauthClient: input.oauthClientId && input.oauthClientSecret
|
|
290
|
-
? { clientId: input.oauthClientId, clientSecret: input.oauthClientSecret }
|
|
291
|
-
: null,
|
|
292
|
-
prepared,
|
|
293
|
-
// The registry's own document is not kept: the record holds what was made of it.
|
|
294
|
-
rawDiscover: null,
|
|
295
|
-
sourceKind: input.sourceKind,
|
|
296
|
-
sourceUrl: input.sourceUrl,
|
|
297
|
-
surface,
|
|
298
|
-
tenantId: projectId,
|
|
299
|
-
toolPrefix: input.toolPrefix,
|
|
300
|
-
});
|
|
301
|
-
const { skippedActions } = buildImportedConnector(record);
|
|
302
|
-
if (skippedActions.length) {
|
|
303
|
-
warnings.push(`${skippedActions.length} action(s) have an input the tools cannot express`);
|
|
304
|
-
}
|
|
305
|
-
await save(projectId, record);
|
|
306
|
-
return { connector: view(record), warnings };
|
|
307
|
-
}
|
|
308
|
-
catch (err) {
|
|
309
|
-
throw err instanceof ServiceError ? err : importFailure(err);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Imports a registry service by its domain, for callers that do not pick a source by hand (the
|
|
314
|
-
* architect, MCP clients): the first importable source of the wanted kind, MCP before OpenAPI —
|
|
315
|
-
* an MCP server is the service's own, curated set of actions.
|
|
316
|
-
*/
|
|
317
|
-
export async function importFromRegistry(userId, projectId, input) {
|
|
318
|
-
await requireWritableProject(projectId);
|
|
319
|
-
await requireAdmin();
|
|
320
|
-
const service = await registryService(input.domain);
|
|
321
|
-
const order = input.kind ? [input.kind] : ["mcp", "openapi"];
|
|
322
|
-
const source = order
|
|
323
|
-
.flatMap((kind) => service.sources.filter((s) => s.sourceKind === kind))
|
|
324
|
-
.find((s) => !s.blocked);
|
|
325
|
-
if (!source) {
|
|
326
|
-
const why = service.sources.map((s) => `${s.sourceKind}: ${s.blocked}`).join("; ");
|
|
327
|
-
throw new ServiceError("invalid", `${input.domain} has nothing that can be imported${why ? ` (${why})` : ""}.`);
|
|
328
|
-
}
|
|
329
|
-
const taken = (await listConnectors(projectId)).find((c) => c.id === source.suggestedId);
|
|
330
|
-
if (taken) {
|
|
331
|
-
return { connector: taken, warnings: ["already imported"] };
|
|
332
|
-
}
|
|
333
|
-
return importConnector(userId, projectId, {
|
|
334
|
-
domain: service.domain,
|
|
335
|
-
sourceKind: source.sourceKind,
|
|
336
|
-
sourceUrl: source.sourceUrl,
|
|
337
|
-
id: source.suggestedId,
|
|
338
|
-
toolPrefix: source.suggestedToolPrefix,
|
|
339
|
-
...(source.name ? { name: source.name } : {}),
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
export async function removeConnector(projectId, id) {
|
|
343
|
-
await requireWritableProject(projectId);
|
|
344
|
-
await requireAdmin();
|
|
345
|
-
await db.delete(schema.projectConnector).where(where(projectId, id));
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Re-reads the source and replaces the connector's actions. An MCP server that only lists its
|
|
349
|
-
* tools to a signed-in account needs that account's token.
|
|
350
|
-
*/
|
|
351
|
-
export async function refreshConnector(projectId, id, accessToken) {
|
|
352
|
-
await requireWritableProject(projectId);
|
|
353
|
-
const record = await load(projectId, id);
|
|
354
|
-
if (!record) {
|
|
355
|
-
throw new ServiceError("not_found", note("connectorNotExist"));
|
|
356
|
-
}
|
|
357
|
-
try {
|
|
358
|
-
const { surface } = record.registry_surface_slug
|
|
359
|
-
? await resolveRegistrySource({ domain: record.domain, sourceUrl: record.source_url })
|
|
360
|
-
: { surface: null };
|
|
361
|
-
const requiredHeaders = surface ? resolveRequiredHeaders(surface) : record.required_headers;
|
|
362
|
-
const transport = record.source_kind === "mcp"
|
|
363
|
-
? ((surface ? resolveMcpTransport(surface) : null) ??
|
|
364
|
-
record.mcp_transport ??
|
|
365
|
-
"streamable-http")
|
|
366
|
-
: null;
|
|
367
|
-
const prepared = await prepareSource({
|
|
368
|
-
deferOnUnauthorized: false,
|
|
369
|
-
mcpHeaders: accessToken ? mcpHeaders(record, accessToken) : undefined,
|
|
370
|
-
requiredHeaders,
|
|
371
|
-
sourceKind: record.source_kind,
|
|
372
|
-
sourceUrl: record.source_url,
|
|
373
|
-
specOverrides: surface?.spec_overrides ?? [],
|
|
374
|
-
transport,
|
|
375
|
-
});
|
|
376
|
-
const updated = {
|
|
377
|
-
...record,
|
|
378
|
-
actions: prepared.normalized.actions,
|
|
379
|
-
base_url: record.base_url ?? prepared.normalized.base_url,
|
|
380
|
-
mcp_transport: transport,
|
|
381
|
-
refreshed_at: new Date().toISOString(),
|
|
382
|
-
required_headers: requiredHeaders,
|
|
383
|
-
spec_hash: prepared.spec_hash,
|
|
384
|
-
};
|
|
385
|
-
await save(projectId, updated);
|
|
386
|
-
return view(updated);
|
|
387
|
-
}
|
|
388
|
-
catch (err) {
|
|
389
|
-
throw importFailure(err);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
/** The connector as engenty's framework runs it: actions with handlers, auth with its flows. */
|
|
393
|
-
export async function importedConnector(projectId, id) {
|
|
394
|
-
const record = await load(projectId, id);
|
|
395
|
-
if (!record) {
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
// The record is read at call time, so a client registered a moment ago is the one used.
|
|
399
|
-
let current = record;
|
|
400
|
-
const { connector } = buildImportedConnector(record, () => current, async (client) => {
|
|
401
|
-
current = {
|
|
402
|
-
...current,
|
|
403
|
-
client_id_enc: encryptToken(client.clientId),
|
|
404
|
-
client_secret_enc: client.clientSecret ? encryptToken(client.clientSecret) : null,
|
|
405
|
-
};
|
|
406
|
-
await save(projectId, current);
|
|
407
|
-
});
|
|
408
|
-
return { connector, record };
|
|
409
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { GOOGLE_OAUTH2, googleJson } from "../engenty/connections-google/shared.js";
|
|
2
|
-
import { htmlToMarkdown } from "../render/convert.js";
|
|
3
|
-
import { dayAfter, mailActions, snippetOf, } from "./mail.js";
|
|
4
|
-
const GMAIL_API = "https://gmail.googleapis.com/gmail/v1/users/me";
|
|
5
|
-
const SCOPE_READONLY = "https://www.googleapis.com/auth/gmail.readonly";
|
|
6
|
-
const header = (payload, name) => payload?.headers?.find((h) => h.name.toLowerCase() === name.toLowerCase())?.value ?? null;
|
|
7
|
-
function body(payload, mime) {
|
|
8
|
-
if (!payload) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
if (payload.mimeType === mime && payload.body?.data) {
|
|
12
|
-
return Buffer.from(payload.body.data, "base64url").toString("utf8");
|
|
13
|
-
}
|
|
14
|
-
for (const part of payload.parts ?? []) {
|
|
15
|
-
const found = body(part, mime);
|
|
16
|
-
if (found) {
|
|
17
|
-
return found;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
function attachments(payload, out = []) {
|
|
23
|
-
if (payload?.filename && payload.body?.attachmentId) {
|
|
24
|
-
out.push({
|
|
25
|
-
id: payload.body.attachmentId,
|
|
26
|
-
name: payload.filename,
|
|
27
|
-
mime: payload.mimeType ?? "application/octet-stream",
|
|
28
|
-
size: payload.body.size ?? null,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
for (const part of payload?.parts ?? []) {
|
|
32
|
-
attachments(part, out);
|
|
33
|
-
}
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
function toMessage(raw) {
|
|
37
|
-
const html = body(raw.payload, "text/html");
|
|
38
|
-
const text = body(raw.payload, "text/plain") ?? (html ? htmlToMarkdown(html) : (raw.snippet ?? ""));
|
|
39
|
-
return {
|
|
40
|
-
id: raw.id,
|
|
41
|
-
date: raw.internalDate ? new Date(Number(raw.internalDate)).toISOString() : null,
|
|
42
|
-
from: header(raw.payload, "From"),
|
|
43
|
-
to: (header(raw.payload, "To") ?? "")
|
|
44
|
-
.split(",")
|
|
45
|
-
.map((s) => s.trim())
|
|
46
|
-
.filter(Boolean),
|
|
47
|
-
subject: header(raw.payload, "Subject"),
|
|
48
|
-
snippet: raw.snippet ?? snippetOf(text),
|
|
49
|
-
attachments: attachments(raw.payload),
|
|
50
|
-
text,
|
|
51
|
-
html,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/** Gmail's own search syntax: `{a b}` is "a OR b", dates are `after:`/`before:` days. */
|
|
55
|
-
function query(input) {
|
|
56
|
-
const quoted = (input.terms ?? []).map((t) => (/\s/.test(t) ? `"${t.replace(/"/g, "")}"` : t));
|
|
57
|
-
return [
|
|
58
|
-
quoted.length ? `{${quoted.join(" ")}}` : "",
|
|
59
|
-
input.from ? `from:${input.from}` : "",
|
|
60
|
-
input.since ? `after:${input.since.replace(/-/g, "/")}` : "",
|
|
61
|
-
input.until ? `before:${dayAfter(input.until).replace(/-/g, "/")}` : "",
|
|
62
|
-
input.has_attachment ? "has:attachment" : "",
|
|
63
|
-
]
|
|
64
|
-
.filter(Boolean)
|
|
65
|
-
.join(" ");
|
|
66
|
-
}
|
|
67
|
-
const getMessage = (ctx, id) => googleJson(ctx, `${GMAIL_API}/messages/${encodeURIComponent(id)}?format=full`);
|
|
68
|
-
const backend = {
|
|
69
|
-
async search(input, ctx) {
|
|
70
|
-
const url = new URL(`${GMAIL_API}/messages`);
|
|
71
|
-
url.searchParams.set("q", query(input));
|
|
72
|
-
url.searchParams.set("maxResults", String(input.limit ?? 40));
|
|
73
|
-
const list = await googleJson(ctx, url.toString());
|
|
74
|
-
const out = [];
|
|
75
|
-
const ids = (list.messages ?? []).map((m) => m.id);
|
|
76
|
-
for (let i = 0; i < ids.length; i += 10) {
|
|
77
|
-
const batch = await Promise.all(ids.slice(i, i + 10).map((id) => getMessage(ctx, id)));
|
|
78
|
-
out.push(...batch.map(toMessage));
|
|
79
|
-
}
|
|
80
|
-
return out.map(({ text: _text, html: _html, to: _to, ...summary }) => summary);
|
|
81
|
-
},
|
|
82
|
-
async read(id, ctx) {
|
|
83
|
-
return toMessage(await getMessage(ctx, id));
|
|
84
|
-
},
|
|
85
|
-
async attachment(id, attachmentId, ctx) {
|
|
86
|
-
const info = attachments((await getMessage(ctx, id)).payload).find((a) => a.id === attachmentId);
|
|
87
|
-
const data = await googleJson(ctx, `${GMAIL_API}/messages/${encodeURIComponent(id)}/attachments/${encodeURIComponent(attachmentId)}`);
|
|
88
|
-
if (!data.data) {
|
|
89
|
-
throw new Error("gmail attachment has no data");
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
name: info?.name ?? "attachment",
|
|
93
|
-
mime: info?.mime ?? "application/octet-stream",
|
|
94
|
-
data_base64: Buffer.from(data.data, "base64url").toString("base64"),
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
export const gmailConnector = {
|
|
99
|
-
id: "mail-gmail",
|
|
100
|
-
moduleId: "wizards-mail",
|
|
101
|
-
name: "Gmail",
|
|
102
|
-
description: "Read mail in a Gmail or Google Workspace account.",
|
|
103
|
-
icon: "logo:gmail",
|
|
104
|
-
toolPrefix: "mail",
|
|
105
|
-
auth: { kind: "oauth2", oauth2: GOOGLE_OAUTH2 },
|
|
106
|
-
actions: mailActions(backend, [SCOPE_READONLY]),
|
|
107
|
-
};
|