@engenty/wizards-runtime 0.12.2 → 0.14.0
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/apps/runtime/dist/agents/architect.js +8 -7
- package/apps/runtime/dist/agents/goose-connections.js +82 -0
- package/apps/runtime/dist/agents/space-agent.js +9 -2
- package/apps/runtime/dist/agents/studio-assistant.js +126 -71
- package/apps/runtime/dist/agents/website.js +1 -1
- package/apps/runtime/dist/app.js +28 -3
- package/apps/runtime/dist/assistant/knows.js +6 -5
- package/apps/runtime/dist/authoring/guide.js +25 -5
- package/apps/runtime/dist/broker/account.js +166 -0
- package/apps/runtime/dist/broker/call.js +417 -0
- package/apps/runtime/dist/broker/caller.js +10 -0
- package/apps/runtime/dist/broker/grant.js +152 -0
- package/apps/runtime/dist/broker/host.js +51 -0
- package/apps/runtime/dist/broker/index.js +8 -0
- package/apps/runtime/dist/broker/kept.js +31 -0
- package/apps/runtime/dist/broker/log.js +240 -0
- package/apps/runtime/dist/broker/registry.js +9 -0
- package/apps/runtime/dist/broker/rwx.js +367 -0
- package/apps/runtime/dist/broker/send.js +189 -0
- package/apps/runtime/dist/connectors/builtin.js +1 -1
- package/apps/runtime/dist/connectors/external.js +38 -37
- package/apps/runtime/dist/connectors/index.js +30 -91
- package/apps/runtime/dist/connectors/mail.js +0 -8
- package/apps/runtime/dist/connectors/person-sign-ins.js +73 -0
- package/apps/runtime/dist/connectors/plugin-connections.js +65 -92
- package/apps/runtime/dist/connectors/smtp.js +1 -1
- package/apps/runtime/dist/connectors/space-connections.js +436 -0
- package/apps/runtime/dist/credits/estimate.js +3 -3
- package/apps/runtime/dist/db/adopt.js +3 -3
- package/apps/runtime/dist/db/client.js +9 -0
- package/apps/runtime/dist/db/live-triggers.js +65 -23
- package/apps/runtime/dist/db/migrations/tenant/0027_work_chats.sql +52 -0
- package/apps/runtime/dist/db/migrations/tenant/0028_chat_approvals.sql +17 -0
- package/apps/runtime/dist/db/migrations/tenant/0029_work_chats_live.sql +49 -0
- package/apps/runtime/dist/db/migrations/tenant/0031_space.sql +624 -0
- package/apps/runtime/dist/db/migrations/tenant/0032_rwx_rule.sql +18 -0
- package/apps/runtime/dist/db/migrations/tenant/0033_broker_log.sql +23 -0
- package/apps/runtime/dist/db/migrations/tenant/0034_space_connection.sql +35 -0
- package/apps/runtime/dist/db/migrations/tenant/0035_run_grant.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0036_approval_held_for.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0037_ways_out.sql +5 -0
- package/apps/runtime/dist/db/migrations/tenant/0038_heard.sql +11 -0
- package/apps/runtime/dist/db/migrations/tenant/0039_members_studio.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0027_snapshot.json +383 -155
- package/apps/runtime/dist/db/migrations/tenant/meta/0028_snapshot.json +4468 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0029_snapshot.json +4475 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0030_snapshot.json +4629 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0031_snapshot.json +4629 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0032_snapshot.json +4757 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0033_snapshot.json +5039 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0034_snapshot.json +5022 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0035_snapshot.json +5029 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0036_snapshot.json +5037 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0037_snapshot.json +5076 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0038_snapshot.json +5145 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0039_snapshot.json +5153 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +86 -2
- package/apps/runtime/dist/db/schema.js +295 -72
- package/apps/runtime/dist/docs/dev/architecture.md +215 -0
- package/apps/runtime/dist/docs/dev/broker.md +298 -0
- package/apps/runtime/dist/docs/dev/index.md +5 -1
- package/apps/runtime/dist/docs/dev/integration/index.md +2 -0
- package/apps/runtime/dist/docs/dev/meta.json +3 -0
- package/apps/runtime/dist/docs/dev/plugins/connections.md +8 -5
- package/apps/runtime/dist/docs/dev/plugins/events.md +1 -1
- package/apps/runtime/dist/docs/dev/plugins/examples.md +1 -0
- package/apps/runtime/dist/docs/dev/plugins/index.md +2 -2
- package/apps/runtime/dist/docs/dev/plugins/reference.md +3 -2
- package/apps/runtime/dist/docs/dev/plugins/space.md +16 -6
- package/apps/runtime/dist/docs/dev/plugins/studio.md +2 -2
- package/apps/runtime/dist/docs/dev/plugins/tools.md +0 -1
- package/apps/runtime/dist/docs/dev/skills.md +16 -9
- package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +59 -6
- package/apps/runtime/dist/docs/dev/wizard-format/lists-and-connections.md +17 -2
- package/apps/runtime/dist/docs/dev/wizard-format/templates.md +2 -0
- package/apps/runtime/dist/docs/dev/wizard-format/views-and-widgets.md +22 -2
- package/apps/runtime/dist/docs/user-guide/capabilities.md +132 -0
- package/apps/runtime/dist/docs/user-guide/cloud-sync.md +2 -0
- package/apps/runtime/dist/docs/user-guide/command-line.md +1 -0
- package/apps/runtime/dist/docs/user-guide/connectors.md +63 -7
- package/apps/runtime/dist/docs/user-guide/index.md +10 -1
- package/apps/runtime/dist/docs/user-guide/meta.json +6 -1
- package/apps/runtime/dist/docs/user-guide/models.md +105 -30
- package/apps/runtime/dist/docs/user-guide/protocol.md +80 -0
- package/apps/runtime/dist/docs/user-guide/skills.md +8 -4
- package/apps/runtime/dist/docs/user-guide/space.md +5 -4
- package/apps/runtime/dist/docs/user-guide/together.md +29 -2
- package/apps/runtime/dist/docs/user-guide/troubleshooting.md +2 -2
- package/apps/runtime/dist/docs/user-guide/work-mode.md +128 -0
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +2 -5
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +72 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +1 -1
- package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +3 -2
- package/apps/runtime/dist/engenty/connections-sdk/types.js +2 -0
- package/apps/runtime/dist/engenty/connections-slack/connector.js +2 -1
- package/apps/runtime/dist/engine/decide.js +1 -1
- package/apps/runtime/dist/engine/requirements.js +139 -11
- package/apps/runtime/dist/engine/resources.js +43 -12
- package/apps/runtime/dist/engine/runner.js +121 -27
- package/apps/runtime/dist/engine/steps.js +42 -16
- package/apps/runtime/dist/engine/template.js +35 -1
- package/apps/runtime/dist/env.js +9 -4
- package/apps/runtime/dist/index.js +18 -2
- package/apps/runtime/dist/link-preview.js +9 -0
- package/apps/runtime/dist/live/feed.js +2 -2
- package/apps/runtime/dist/live/origin.js +2 -2
- package/apps/runtime/dist/live/views.js +51 -26
- package/apps/runtime/dist/manage.js +32 -0
- package/apps/runtime/dist/mcp/flow-app.js +1 -1
- package/apps/runtime/dist/mcp/handler.js +55 -1
- package/apps/runtime/dist/mcp/seen.js +47 -0
- package/apps/runtime/dist/mcp/tools.js +75 -34
- package/apps/runtime/dist/models.js +203 -12
- package/apps/runtime/dist/motion-graphics/project.js +8 -8
- package/apps/runtime/dist/motion-graphics/step.js +2 -2
- package/apps/runtime/dist/motion-graphics/tools.js +1 -1
- package/apps/runtime/dist/plugins/events.js +2 -2
- package/apps/runtime/dist/plugins/jobs.js +4 -1
- package/apps/runtime/dist/plugins/loader.js +2 -2
- package/apps/runtime/dist/prompts/architect.md +3 -3
- package/apps/runtime/dist/prompts/authoring.md +46 -12
- package/apps/runtime/dist/prompts/goose.md +14 -13
- package/apps/runtime/dist/prompts/mcp.md +6 -6
- package/apps/runtime/dist/prompts/safety.md +18 -0
- package/apps/runtime/dist/prompts/services.md +4 -4
- package/apps/runtime/dist/prompts/step.md +3 -3
- package/apps/runtime/dist/prompts/tools.md +39 -10
- package/apps/runtime/dist/routes/api.js +31 -20
- package/apps/runtime/dist/routes/broker.js +316 -0
- package/apps/runtime/dist/routes/connections.js +71 -0
- package/apps/runtime/dist/routes/delivery.js +25 -0
- package/apps/runtime/dist/routes/discover.js +17 -0
- package/apps/runtime/dist/routes/live.js +11 -1
- package/apps/runtime/dist/routes/marketplace.js +3 -3
- package/apps/runtime/dist/routes/person.js +4 -1
- package/apps/runtime/dist/routes/plugins.js +3 -1
- package/apps/runtime/dist/routes/rules.js +26 -0
- package/apps/runtime/dist/routes/runs.js +59 -33
- package/apps/runtime/dist/routes/skills.js +6 -6
- package/apps/runtime/dist/routes/studio.js +256 -148
- package/apps/runtime/dist/routes/work.js +199 -0
- package/apps/runtime/dist/safety.js +60 -18
- package/apps/runtime/dist/sandbox/index.js +27 -0
- package/apps/runtime/dist/services/access.js +38 -17
- package/apps/runtime/dist/services/api.js +38 -13
- package/apps/runtime/dist/services/architect.js +3 -3
- package/apps/runtime/dist/services/assistant-chats.js +9 -1
- package/apps/runtime/dist/services/brand.js +12 -12
- package/apps/runtime/dist/services/broker-bell.js +69 -0
- package/apps/runtime/dist/services/broker-notify.js +127 -0
- package/apps/runtime/dist/services/client-steps.js +79 -0
- package/apps/runtime/dist/services/cloud.js +42 -42
- package/apps/runtime/dist/services/command-risk.js +51 -0
- package/apps/runtime/dist/services/discover.js +85 -0
- package/apps/runtime/dist/services/knowledge-model.js +13 -13
- package/apps/runtime/dist/services/knowledge.js +117 -80
- package/apps/runtime/dist/services/manage-reports.js +77 -7
- package/apps/runtime/dist/services/marketplace.js +7 -31
- package/apps/runtime/dist/services/members-studio.js +165 -0
- package/apps/runtime/dist/services/onboarding.js +22 -22
- package/apps/runtime/dist/services/package-file.js +1 -1
- package/apps/runtime/dist/services/package.js +22 -22
- package/apps/runtime/dist/services/pages.js +13 -9
- package/apps/runtime/dist/services/runs.js +4 -3
- package/apps/runtime/dist/services/seen.js +55 -0
- package/apps/runtime/dist/services/shares.js +28 -13
- package/apps/runtime/dist/services/site.js +23 -23
- package/apps/runtime/dist/services/skills-registry.js +15 -15
- package/apps/runtime/dist/services/skills.js +44 -44
- package/apps/runtime/dist/services/space-categories.js +35 -35
- package/apps/runtime/dist/services/space-data.js +130 -111
- package/apps/runtime/dist/services/{project-files.js → space-files.js} +84 -75
- package/apps/runtime/dist/services/{project-index.js → space-index.js} +116 -73
- package/apps/runtime/dist/services/space-origin.js +19 -11
- package/apps/runtime/dist/services/spaces.js +478 -598
- package/apps/runtime/dist/services/synced-spaces.js +668 -0
- package/apps/runtime/dist/services/themes.js +15 -15
- package/apps/runtime/dist/services/widgets.js +6 -6
- package/apps/runtime/dist/services/wizards.js +112 -38
- package/apps/runtime/dist/services/work-ai.js +257 -0
- package/apps/runtime/dist/services/work-approvals.js +104 -0
- package/apps/runtime/dist/services/work-chats.js +908 -0
- package/apps/runtime/dist/services/work-connections.js +90 -0
- package/apps/runtime/dist/services/work-files.js +85 -0
- package/apps/runtime/dist/services/work-mastra.js +73 -0
- package/apps/runtime/dist/services/work-sandbox.js +42 -0
- package/apps/runtime/dist/sharing/files.js +14 -4
- package/apps/runtime/dist/sharing/index.js +40 -39
- package/apps/runtime/dist/sharing/jobs.js +67 -17
- package/apps/runtime/dist/sharing/targets/connector.js +10 -6
- package/apps/runtime/dist/sharing/targets/email.js +10 -8
- package/apps/runtime/dist/sharing/targets/slack.js +10 -8
- package/apps/runtime/dist/sharing/targets/storage.js +6 -4
- package/apps/runtime/dist/store/index.js +14 -3
- package/apps/runtime/dist/store/shared-lists.js +4 -2
- package/apps/runtime/dist/sync/apply.js +2 -2
- package/apps/runtime/dist/sync/client.js +113 -113
- package/apps/runtime/dist/sync/hub.js +41 -41
- package/apps/runtime/dist/sync/log.js +12 -12
- package/apps/runtime/dist/sync/records.js +118 -120
- package/apps/runtime/dist/texts.js +44 -2
- package/apps/runtime/dist/tools/connections.js +112 -0
- package/apps/runtime/dist/tools/connector.js +157 -67
- package/apps/runtime/dist/tools/index.js +31 -15
- package/apps/runtime/dist/tools/mail.js +40 -11
- package/apps/runtime/dist/tools/pages.js +11 -5
- package/apps/runtime/dist/tools/plugin.js +43 -7
- package/apps/runtime/dist/tools/skills.js +1 -1
- package/apps/runtime/dist/tools/{project.js → space.js} +30 -25
- package/apps/runtime/dist/tools/store.js +3 -2
- package/apps/runtime/dist/widgets/step.js +10 -10
- package/apps/web/dist/assets/AboutDialog-DgfeipUc.js +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-BoYJvgIu.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-CKLgFL6r.js → ChangelogDialog-Duab4zTO.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-B3nto_26.js → CodeEditor-nxoOt8ge.js} +1 -1
- package/apps/web/dist/assets/EditorPage-ZrgGpYMC.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-zJCtixSi.js → FlowPreview-aMfwcPul.js} +1 -1
- package/apps/web/dist/assets/LangSwitch-DpD0inR4.js +1 -0
- package/apps/web/dist/assets/Marketplace-CpzD9pNQ.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-IB18afWN.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-rYbcmPGG.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-ztHT01ah.js +1 -0
- package/apps/web/dist/assets/PreviewPane-DviWTLfi.js +9 -0
- package/apps/web/dist/assets/PublicRunner-C2geZhhM.js +1 -0
- package/apps/web/dist/assets/ReadOnly-kSb_Kbdm.js +1 -0
- package/apps/web/dist/assets/SettingsPage-DM2h8N0J.js +2 -0
- package/apps/web/dist/assets/SetupPage-Wfyz6xH4.js +1 -0
- package/apps/web/dist/assets/SharePage-CyWQorWB.js +1 -0
- package/apps/web/dist/assets/SkillEditor-CqQMg2MC.js +1 -0
- package/apps/web/dist/assets/Skills-CnhpgoOA.js +9 -0
- package/apps/web/dist/assets/SpacePage-q4Bk3N7k.js +2 -0
- package/apps/web/dist/assets/UpdateCheck-C2CE6CC3.js +2 -0
- package/apps/web/dist/assets/changelog-B6hN1Cp7.js +1 -0
- package/apps/web/dist/assets/circle-alert-C8Ma-bPY.js +1 -0
- package/apps/web/dist/assets/circle-check-Bu9Z3mlJ.js +1 -0
- package/apps/web/dist/assets/code-editor-CfTGqOpp.js +2 -0
- package/apps/web/dist/assets/{code-xml-Hx7YxCg0.js → code-xml-B4kLFZSj.js} +1 -1
- package/apps/web/dist/assets/connection-sign-in-CIiv0t2p.js +1 -0
- package/apps/web/dist/assets/esm-Xwn4GtqG.js +7 -0
- package/apps/web/dist/assets/{eye-BkMFLnYu.js → eye-BpoKpIdt.js} +1 -1
- package/apps/web/dist/assets/host-BrP-ENHg.css +1 -0
- package/apps/web/dist/assets/host-DJ7-p0Sc.js +118 -0
- package/apps/web/dist/assets/i18n-BJ7Ld6O6.js +55 -0
- package/apps/web/dist/assets/index-D18DvnxX.css +1 -0
- package/apps/web/dist/assets/index-D2akynS-.js +10 -0
- package/apps/web/dist/assets/logo-BpnjXTRy.js +1 -0
- package/apps/web/dist/assets/oss-credits-IdX5bc71.js +1 -0
- package/apps/web/dist/assets/{phone-DMfwuh9V.js → phone-Ctvf-Am-.js} +1 -1
- package/apps/web/dist/assets/read-aloud-Da_RSm2S.js +1 -0
- package/apps/web/dist/assets/{runners-D5qz6b_s.js → runners-CyIvJIHr.js} +1 -1
- package/apps/web/dist/assets/scroll-text-ChrjRu9Y.js +1 -0
- package/apps/web/dist/assets/session-SXPtTWRK.js +2 -0
- package/apps/web/dist/assets/theme-CbTcTFWy.js +11 -0
- package/apps/web/dist/assets/ui-Uqnx1UpK.js +82 -0
- package/apps/web/dist/assets/{upload-DQJwLSGj.js → upload-BchUnQGV.js} +1 -1
- package/apps/web/dist/assets/{useMutation-C20c2EH3.js → useMutation-DEkZhp5c.js} +1 -1
- package/apps/web/dist/assets/{volume-2-CC5qamYT.js → volume-2-CU_oy81Z.js} +1 -1
- package/apps/web/dist/assets/with-selector-CoMyWBAX.js +1 -0
- package/apps/web/dist/index.html +17 -10
- package/apps/web/dist/mcp/flow.html +119 -64
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +20 -10
- package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +7 -1
- package/node_modules/@engenty/wizards-shared/dist/assistant.js +11 -1
- package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +236 -2
- package/node_modules/@engenty/wizards-shared/dist/connectors.js +52 -2
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +257 -8
- package/node_modules/@engenty/wizards-shared/dist/definition.js +113 -15
- package/node_modules/@engenty/wizards-shared/dist/discover.d.ts +21 -0
- package/node_modules/@engenty/wizards-shared/dist/discover.js +1 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +38 -2
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +38 -2
- package/node_modules/@engenty/wizards-shared/dist/fit.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/json-schema.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/json-schema.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/live.d.ts +2 -2
- package/node_modules/@engenty/wizards-shared/dist/live.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/marketplace.d.ts +0 -5
- package/node_modules/@engenty/wizards-shared/dist/marketplace.js +3 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +115 -6
- package/node_modules/@engenty/wizards-shared/dist/run.js +135 -0
- package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +15 -1
- package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +14 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +42 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +29 -0
- package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/space-data.d.ts +2 -2
- package/node_modules/@engenty/wizards-shared/dist/{projects.d.ts → spaces.d.ts} +39 -15
- package/node_modules/@engenty/wizards-shared/dist/{projects.js → spaces.js} +16 -9
- package/node_modules/@engenty/wizards-shared/dist/store.d.ts +7 -2
- package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +35 -4
- package/node_modules/@engenty/wizards-shared/dist/surface.js +121 -3
- package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/theme-look.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/tiers.d.ts +195 -0
- package/node_modules/@engenty/wizards-shared/dist/tiers.js +98 -0
- package/node_modules/@engenty/wizards-shared/dist/wizard-package.d.ts +2 -2
- package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +3 -3
- package/package.json +4 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/plugin/skills/build-wizard/SKILL.md +1 -1
- package/apps/runtime/dist/services/projects.js +0 -473
- package/apps/web/dist/assets/AboutDialog-CLgnoYTI.js +0 -1
- package/apps/web/dist/assets/EditorPage-D9JDdAAI.js +0 -3
- package/apps/web/dist/assets/Marketplace-D4e0Oac9.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-B4N7GIYh.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-Dpt0Mzk8.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-CDoYVjRC.js +0 -1
- package/apps/web/dist/assets/PreviewPane-DPB5nEd5.js +0 -10
- package/apps/web/dist/assets/ProjectPage-408YOoNa.js +0 -10
- package/apps/web/dist/assets/PublicRunner-BZ66xdRX.js +0 -1
- package/apps/web/dist/assets/ReadOnly-C9oGMkUB.js +0 -1
- package/apps/web/dist/assets/SettingsPage-Dq3AZwJS.js +0 -2
- package/apps/web/dist/assets/SetupPage-CP3lbyZc.js +0 -1
- package/apps/web/dist/assets/SharePage-DdMm1Y8K.js +0 -1
- package/apps/web/dist/assets/SkillEditor-b5NMFB90.js +0 -1
- package/apps/web/dist/assets/changelog-82-DHogQ.js +0 -1
- package/apps/web/dist/assets/esm-BdxDT9Km.js +0 -7
- package/apps/web/dist/assets/i18n-CKKh3Pn0.js +0 -55
- package/apps/web/dist/assets/index-Cy2NHzAx.js +0 -49
- package/apps/web/dist/assets/index-wR_-1hfN.css +0 -1
- package/apps/web/dist/assets/lock-CGXM95Mi.js +0 -1
- package/apps/web/dist/assets/logo-CGNoptDg.js +0 -1
- package/apps/web/dist/assets/oss-credits-DpRWUPjD.js +0 -1
- package/apps/web/dist/assets/session-DRy0k0nh.js +0 -2
- package/apps/web/dist/assets/theme-DNPm6r4e.js +0 -11
- package/apps/web/dist/assets/ui-CwFQAfE-.js +0 -83
- /package/apps/runtime/dist/db/migrations/tenant/{0027_space_skill.sql → 0030_space_skill.sql} +0 -0
|
@@ -4,9 +4,10 @@ import { isTextMime } from "@engenty/wizards-shared/workspace";
|
|
|
4
4
|
import { Agent } from "@mastra/core/agent";
|
|
5
5
|
import { createTool } from "@mastra/core/tools";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { exampleWizard,
|
|
7
|
+
import { exampleWizard, spaceLines, } from "../authoring/guide.js";
|
|
8
8
|
import { wizardOpSchema } from "../authoring/ops.js";
|
|
9
9
|
import { importFromRegistry, listConnectors, searchRegistry } from "../connectors/external.js";
|
|
10
|
+
import { guideSpaceConnections } from "../connectors/space-connections.js";
|
|
10
11
|
import { agentModel, attachTools, chatModel, costOf, gatewayTools, totalUsage, } from "../models.js";
|
|
11
12
|
import { pluginToolsOf } from "../plugins/registry.js";
|
|
12
13
|
import { prompt } from "../prompts.js";
|
|
@@ -23,14 +24,14 @@ import { attempt as attemptTool, imageOutput } from "../tools/shared.js";
|
|
|
23
24
|
import { runScript } from "../widgets/script.js";
|
|
24
25
|
import { thoughtLine } from "./thought.js";
|
|
25
26
|
const MAX_STEPS = 45;
|
|
26
|
-
function systemPrompt(connectors, pluginTools) {
|
|
27
|
+
function systemPrompt(connectors, pluginTools, connections) {
|
|
27
28
|
return `${prompt("architect", "system", {
|
|
28
29
|
persona: prompt("architect", "persona"),
|
|
29
30
|
schema: prompt("authoring", "schema"),
|
|
30
31
|
principles: prompt("authoring", "principles", { sandbox: sandboxGuideLine() }),
|
|
31
32
|
widgets: prompt("authoring", "widgets"),
|
|
32
33
|
surfaces: prompt("authoring", "surfaces"),
|
|
33
|
-
|
|
34
|
+
space_tools: spaceLines(connectors, pluginTools, connections),
|
|
34
35
|
example: exampleWizard(),
|
|
35
36
|
how_you_work: prompt("architect", "how_you_work"),
|
|
36
37
|
})}\n\n${contentPolicy()}`;
|
|
@@ -80,7 +81,7 @@ const attempt = (run) => attemptTool(run, { limit: Number.POSITIVE_INFINITY });
|
|
|
80
81
|
function buildTools(input, resolved, wrote) {
|
|
81
82
|
const { userId, wizardId } = input;
|
|
82
83
|
const signal = input.signal;
|
|
83
|
-
const
|
|
84
|
+
const spaceId = async () => (await ownedWizard(userId, wizardId)).spaceId;
|
|
84
85
|
const tools = {
|
|
85
86
|
find_connectors: createTool({
|
|
86
87
|
id: "find_connectors",
|
|
@@ -99,7 +100,7 @@ function buildTools(input, resolved, wrote) {
|
|
|
99
100
|
.describe("Default: the service's MCP server if it has one, else its OpenAPI spec."),
|
|
100
101
|
}),
|
|
101
102
|
execute: async ({ domain, kind }) => attempt(async () => {
|
|
102
|
-
const result = await importFromRegistry(userId, await
|
|
103
|
+
const result = await importFromRegistry(userId, await spaceId(), { domain, kind });
|
|
103
104
|
wrote();
|
|
104
105
|
return result;
|
|
105
106
|
}),
|
|
@@ -108,7 +109,7 @@ function buildTools(input, resolved, wrote) {
|
|
|
108
109
|
id: "list_connectors",
|
|
109
110
|
description: prompt("mcp", "tool.list_connectors"),
|
|
110
111
|
inputSchema: z.object({}),
|
|
111
|
-
execute: async () => attempt(async () => ({ connectors: await listConnectors(await
|
|
112
|
+
execute: async () => attempt(async () => ({ connectors: await listConnectors(await spaceId()) })),
|
|
112
113
|
}),
|
|
113
114
|
replace_wizard: createTool({
|
|
114
115
|
id: "replace_wizard",
|
|
@@ -316,7 +317,7 @@ export async function runArchitect(input) {
|
|
|
316
317
|
// The system prompt is long and identical on every turn: cache it.
|
|
317
318
|
instructions: {
|
|
318
319
|
role: "system",
|
|
319
|
-
content: systemPrompt(input.connectors, await pluginToolsOf(currentTenant())),
|
|
320
|
+
content: systemPrompt(input.connectors, await pluginToolsOf(currentTenant()), await guideSpaceConnections(w.spaceId)),
|
|
320
321
|
providerOptions: { anthropic: { cacheControl: { type: "ephemeral" } } },
|
|
321
322
|
},
|
|
322
323
|
model: agentModel(resolved),
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CONFIRM_ACTION_TOOL } from "@engenty/wizards-shared/assistant";
|
|
2
|
+
import { and, eq } from "drizzle-orm";
|
|
3
|
+
import { nanoid } from "nanoid";
|
|
4
|
+
import { db, schema } from "../db/client.js";
|
|
5
|
+
import { prompt } from "../prompts.js";
|
|
6
|
+
import { isAdminRole } from "../services/access.js";
|
|
7
|
+
import { closedToMe } from "../services/members-studio.js";
|
|
8
|
+
import { callConnection, connectionResult, connectionToolsOf, makeConnectionTools, usableConnections, } from "../tools/connections.js";
|
|
9
|
+
import { attempt } from "../tools/shared.js";
|
|
10
|
+
/*
|
|
11
|
+
* Goose's connections (docs/plans/capabilities.md, "Who sees what"): a personal copilot works
|
|
12
|
+
* with its person's own sign-ins alone. Its tools are the connections in which each person signs
|
|
13
|
+
* in, in the spaces where this person has, within their audience. Reads run; a write, a send or a
|
|
14
|
+
* delete asks the person first, on a card in Goose's own chat (the browser's `confirm_action`),
|
|
15
|
+
* with no hold for the admins: it is the person's own account. A connection that signs in as the
|
|
16
|
+
* space is never among them.
|
|
17
|
+
*/
|
|
18
|
+
/** The widest the person sees of what would be sent. */
|
|
19
|
+
const ASK_INPUT = 4000;
|
|
20
|
+
/** The person's own sign-ins, with the connection each belongs to. */
|
|
21
|
+
async function signedInConnections(userId) {
|
|
22
|
+
const rows = await db
|
|
23
|
+
.select({ row: schema.spaceConnection })
|
|
24
|
+
.from(schema.spaceConnectionSignIn)
|
|
25
|
+
.innerJoin(schema.spaceConnection, eq(schema.spaceConnection.id, schema.spaceConnectionSignIn.connectionId))
|
|
26
|
+
.where(and(eq(schema.spaceConnectionSignIn.userId, userId), eq(schema.spaceConnection.signIn, "person")));
|
|
27
|
+
return rows.map((r) => r.row);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Asks the person on a card in Goose's chat, where the browser offers one; `undefined` where it
|
|
31
|
+
* does not (an installed AI client as the model), so the broker answers that nobody can be asked.
|
|
32
|
+
*/
|
|
33
|
+
function confirmInChat(input) {
|
|
34
|
+
if (!input.browserTools.some((t) => t.name === CONFIRM_ACTION_TOOL)) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return async (ask) => {
|
|
38
|
+
if (ask.kind !== "confirm") {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const call = {
|
|
42
|
+
toolCallId: nanoid(10),
|
|
43
|
+
toolCallName: CONFIRM_ACTION_TOOL,
|
|
44
|
+
args: {
|
|
45
|
+
service: ask.service,
|
|
46
|
+
action: ask.action.summary,
|
|
47
|
+
destructive: ask.action.destructive,
|
|
48
|
+
input: ask.input.slice(0, ASK_INPUT),
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
input.onToolCall?.(call);
|
|
52
|
+
const out = (await input.callBrowser(call));
|
|
53
|
+
input.onToolResult?.({ toolCallId: call.toolCallId, content: JSON.stringify(out ?? null) });
|
|
54
|
+
return out?.confirmed === true ? { type: "done" } : { type: "skip" };
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const serviceOf = (tool) => `${tool.row.name} (${tool.connector.name})`;
|
|
58
|
+
/** Goose's tools for its person's connections; none where they signed in to none. */
|
|
59
|
+
export async function gooseConnectionTools(input) {
|
|
60
|
+
const userId = input.user.id;
|
|
61
|
+
const who = { kind: "goose", id: userId, admin: isAdminRole(input.user.role) };
|
|
62
|
+
// Not in a space whose Studio is closed to a member: Goose is the Studio's.
|
|
63
|
+
const signedIn = [];
|
|
64
|
+
for (const row of await signedInConnections(userId)) {
|
|
65
|
+
if (!(await closedToMe(row.spaceId))) {
|
|
66
|
+
signedIn.push(row);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const tools = connectionToolsOf(await usableConnections(signedIn, who));
|
|
70
|
+
if (!tools.length) {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
const where = (tool) => ({ chatId: input.chat.id, spaceId: tool.row.spaceId });
|
|
74
|
+
const ask = confirmInChat(input);
|
|
75
|
+
return makeConnectionTools({
|
|
76
|
+
tools,
|
|
77
|
+
who,
|
|
78
|
+
where,
|
|
79
|
+
writeNote: () => prompt("tools", "connection.asks_person"),
|
|
80
|
+
write: (tool, fields) => attempt(async () => connectionResult(await callConnection(tool, who, where(tool), fields, ask ? { ask } : {}), serviceOf(tool))),
|
|
81
|
+
}).tools;
|
|
82
|
+
}
|
|
@@ -36,10 +36,17 @@ export function cacheMarks(prompt) {
|
|
|
36
36
|
return historyEnd || stepEnd ? marked(message) : message;
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/** The input processor that sets those marks on each request. */
|
|
40
|
+
export const cacheMarksProcessor = {
|
|
40
41
|
id: "cache-marks",
|
|
41
42
|
processLLMRequest: ({ prompt }) => ({ prompt: cacheMarks(prompt) }),
|
|
42
43
|
};
|
|
44
|
+
/** Instructions as a system message with Anthropic's cache mark. */
|
|
45
|
+
export const markedInstructions = (content) => ({
|
|
46
|
+
role: "system",
|
|
47
|
+
content,
|
|
48
|
+
providerOptions: EPHEMERAL,
|
|
49
|
+
});
|
|
43
50
|
/** The agent for a request: its model, instructions and tools. */
|
|
44
51
|
export function spaceAgent(options) {
|
|
45
52
|
const tools = sortedTools(options.tools);
|
|
@@ -47,7 +54,7 @@ export function spaceAgent(options) {
|
|
|
47
54
|
return new Agent({
|
|
48
55
|
id: options.id,
|
|
49
56
|
name: options.name,
|
|
50
|
-
instructions:
|
|
57
|
+
instructions: markedInstructions(options.instructions),
|
|
51
58
|
model: agentModel(options.resolved),
|
|
52
59
|
tools: tools,
|
|
53
60
|
inputProcessors: [cacheMarksProcessor],
|