wizards 0.1.9
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/LICENSE +110 -0
- package/README.md +170 -0
- package/apps/runtime/dist/agents/architect.js +453 -0
- package/apps/runtime/dist/agents/project-assistant.js +354 -0
- package/apps/runtime/dist/agents/subscription.js +206 -0
- package/apps/runtime/dist/agents/thought.js +21 -0
- package/apps/runtime/dist/agents/website.js +197 -0
- package/apps/runtime/dist/app.js +153 -0
- package/apps/runtime/dist/auth/account.js +121 -0
- package/apps/runtime/dist/auth/index.js +329 -0
- package/apps/runtime/dist/auth/keys.js +55 -0
- package/apps/runtime/dist/auth/local-ticket.js +23 -0
- package/apps/runtime/dist/authoring/example.js +73 -0
- package/apps/runtime/dist/authoring/guide.js +259 -0
- package/apps/runtime/dist/authoring/ops.js +117 -0
- package/apps/runtime/dist/cli/autostart.js +134 -0
- package/apps/runtime/dist/cli/clients.js +44 -0
- package/apps/runtime/dist/cli/environment.js +81 -0
- package/apps/runtime/dist/cli/exec.js +45 -0
- package/apps/runtime/dist/cli/home.js +74 -0
- package/apps/runtime/dist/cli/machine.js +145 -0
- package/apps/runtime/dist/cli/main.js +125 -0
- package/apps/runtime/dist/cli/setup.js +273 -0
- package/apps/runtime/dist/cli/start.js +190 -0
- package/apps/runtime/dist/cli/status.js +120 -0
- package/apps/runtime/dist/cli/ui.js +12 -0
- package/apps/runtime/dist/cli/update.js +58 -0
- package/apps/runtime/dist/connectors/builtin.js +70 -0
- package/apps/runtime/dist/connectors/external.js +400 -0
- package/apps/runtime/dist/connectors/gmail.js +107 -0
- package/apps/runtime/dist/connectors/imap.js +217 -0
- package/apps/runtime/dist/connectors/index.js +266 -0
- package/apps/runtime/dist/connectors/mail.js +72 -0
- package/apps/runtime/dist/connectors/outlook.js +90 -0
- package/apps/runtime/dist/credits/credits.js +103 -0
- package/apps/runtime/dist/credits/estimate.js +132 -0
- package/apps/runtime/dist/db/adopt.js +149 -0
- package/apps/runtime/dist/db/client.js +146 -0
- package/apps/runtime/dist/db/control-schema.js +70 -0
- package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +47 -0
- package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +41 -0
- package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +1 -0
- package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +3 -0
- package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +6 -0
- package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +311 -0
- package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +599 -0
- package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +607 -0
- package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +311 -0
- package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +350 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +41 -0
- package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +188 -0
- package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +52 -0
- package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +6 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +1323 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +1330 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +1337 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +1605 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +1645 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +41 -0
- package/apps/runtime/dist/db/schema.js +278 -0
- package/apps/runtime/dist/documents/parse.js +230 -0
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +193 -0
- package/apps/runtime/dist/engenty/connections-external/errors.js +11 -0
- package/apps/runtime/dist/engenty/connections-external/import-service.js +270 -0
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +34 -0
- package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +185 -0
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +63 -0
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +130 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +143 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +143 -0
- package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +119 -0
- package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +88 -0
- package/apps/runtime/dist/engenty/connections-external/registry-client.js +336 -0
- package/apps/runtime/dist/engenty/connections-external/registry-source.js +82 -0
- package/apps/runtime/dist/engenty/connections-external/types.js +7 -0
- package/apps/runtime/dist/engenty/connections-github/connector.js +209 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +359 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +94 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +290 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +567 -0
- package/apps/runtime/dist/engenty/connections-google/definitions.js +11 -0
- package/apps/runtime/dist/engenty/connections-google/shared.js +73 -0
- package/apps/runtime/dist/engenty/connections-hubspot/connector.js +140 -0
- package/apps/runtime/dist/engenty/connections-microsoft/action.js +17 -0
- package/apps/runtime/dist/engenty/connections-microsoft/graph.js +114 -0
- package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +286 -0
- package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +464 -0
- package/apps/runtime/dist/engenty/connections-s3/s3.js +328 -0
- package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +86 -0
- package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +150 -0
- package/apps/runtime/dist/engenty/connections-sdk/registry.js +89 -0
- package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +84 -0
- package/apps/runtime/dist/engenty/connections-sdk/types.js +30 -0
- package/apps/runtime/dist/engenty/connections-slack/connector.js +360 -0
- package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +178 -0
- package/apps/runtime/dist/engenty/csv-import/import-sources.js +87 -0
- package/apps/runtime/dist/engenty/csv-import/parse-csv.js +129 -0
- package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +20 -0
- package/apps/runtime/dist/engenty/csv-import/types.js +1 -0
- package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +159 -0
- package/apps/runtime/dist/engenty/doc-converter/interface.js +9 -0
- package/apps/runtime/dist/engenty/doc-converter/page-break.js +92 -0
- package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +72 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +30 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +4 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +73 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +63 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +40 -0
- package/apps/runtime/dist/engenty/search-index/chunks.js +164 -0
- package/apps/runtime/dist/engenty/search-index/contracts.js +9 -0
- package/apps/runtime/dist/engenty/shims/connections-sdk.js +39 -0
- package/apps/runtime/dist/engenty/shims/plugin-sdk.js +1 -0
- package/apps/runtime/dist/engenty/shims/web-ingest.js +3 -0
- package/apps/runtime/dist/engenty/web-ingest/ssrf.js +277 -0
- package/apps/runtime/dist/engine/asks.js +60 -0
- package/apps/runtime/dist/engine/events.js +46 -0
- package/apps/runtime/dist/engine/input.js +170 -0
- package/apps/runtime/dist/engine/prepare.js +51 -0
- package/apps/runtime/dist/engine/requirements.js +124 -0
- package/apps/runtime/dist/engine/resources.js +89 -0
- package/apps/runtime/dist/engine/runner.js +560 -0
- package/apps/runtime/dist/engine/steps.js +598 -0
- package/apps/runtime/dist/engine/template.js +183 -0
- package/apps/runtime/dist/engine/types.js +3 -0
- package/apps/runtime/dist/env.js +224 -0
- package/apps/runtime/dist/files/blobs.js +22 -0
- package/apps/runtime/dist/files/objects.js +86 -0
- package/apps/runtime/dist/files/storage.js +95 -0
- package/apps/runtime/dist/geocode.js +58 -0
- package/apps/runtime/dist/harness/claude.js +138 -0
- package/apps/runtime/dist/harness/codex.js +228 -0
- package/apps/runtime/dist/harness/cursor.js +93 -0
- package/apps/runtime/dist/harness/env.js +124 -0
- package/apps/runtime/dist/harness/gemini.js +126 -0
- package/apps/runtime/dist/harness/index.js +99 -0
- package/apps/runtime/dist/harness/model.js +267 -0
- package/apps/runtime/dist/harness/prompt.js +121 -0
- package/apps/runtime/dist/harness/terminal.js +193 -0
- package/apps/runtime/dist/harness/types.js +7 -0
- package/apps/runtime/dist/index.js +76 -0
- package/apps/runtime/dist/limits.js +57 -0
- package/apps/runtime/dist/link-preview.js +59 -0
- package/apps/runtime/dist/manage.js +151 -0
- package/apps/runtime/dist/mcp/auth.js +102 -0
- package/apps/runtime/dist/mcp/bridge.js +59 -0
- package/apps/runtime/dist/mcp/handler.js +42 -0
- package/apps/runtime/dist/mcp/scopes.js +5 -0
- package/apps/runtime/dist/mcp/tools.js +401 -0
- package/apps/runtime/dist/media/ffmpeg.js +121 -0
- package/apps/runtime/dist/media/generate.js +120 -0
- package/apps/runtime/dist/media/marking.js +121 -0
- package/apps/runtime/dist/media/transcribe.js +30 -0
- package/apps/runtime/dist/model-errors.js +3 -0
- package/apps/runtime/dist/models.js +489 -0
- package/apps/runtime/dist/plugin.js +61 -0
- package/apps/runtime/dist/render/chromium.js +85 -0
- package/apps/runtime/dist/render/convert.js +161 -0
- package/apps/runtime/dist/render/downloads.js +277 -0
- package/apps/runtime/dist/render/guard.js +25 -0
- package/apps/runtime/dist/routes/api.js +74 -0
- package/apps/runtime/dist/routes/delivery.js +52 -0
- package/apps/runtime/dist/routes/internal.js +49 -0
- package/apps/runtime/dist/routes/marketplace.js +36 -0
- package/apps/runtime/dist/routes/runs.js +805 -0
- package/apps/runtime/dist/routes/studio.js +702 -0
- package/apps/runtime/dist/routes/wizard-stream.js +30 -0
- package/apps/runtime/dist/running.js +39 -0
- package/apps/runtime/dist/sandbox/agentos.js +191 -0
- package/apps/runtime/dist/sandbox/docker.js +77 -0
- package/apps/runtime/dist/sandbox/index.js +30 -0
- package/apps/runtime/dist/sandbox/types.js +1 -0
- package/apps/runtime/dist/secrets/crypto.js +28 -0
- package/apps/runtime/dist/secrets/signing.js +34 -0
- package/apps/runtime/dist/secrets/vault.js +59 -0
- package/apps/runtime/dist/services/architect.js +92 -0
- package/apps/runtime/dist/services/brand.js +20 -0
- package/apps/runtime/dist/services/cloud.js +52 -0
- package/apps/runtime/dist/services/draft-events.js +27 -0
- package/apps/runtime/dist/services/errors.js +24 -0
- package/apps/runtime/dist/services/files.js +129 -0
- package/apps/runtime/dist/services/links.js +16 -0
- package/apps/runtime/dist/services/marketplace.js +292 -0
- package/apps/runtime/dist/services/package.js +202 -0
- package/apps/runtime/dist/services/profile.js +23 -0
- package/apps/runtime/dist/services/project-files.js +266 -0
- package/apps/runtime/dist/services/project-index.js +109 -0
- package/apps/runtime/dist/services/projects.js +181 -0
- package/apps/runtime/dist/services/runs.js +224 -0
- package/apps/runtime/dist/services/shares.js +129 -0
- package/apps/runtime/dist/services/widgets.js +34 -0
- package/apps/runtime/dist/services/wizards.js +342 -0
- package/apps/runtime/dist/settings.js +16 -0
- package/apps/runtime/dist/store/index.js +279 -0
- package/apps/runtime/dist/tenants/control.js +106 -0
- package/apps/runtime/dist/tenants/tenant.js +26 -0
- package/apps/runtime/dist/tools/browser.js +380 -0
- package/apps/runtime/dist/tools/connector.js +204 -0
- package/apps/runtime/dist/tools/index.js +234 -0
- package/apps/runtime/dist/tools/mail.js +104 -0
- package/apps/runtime/dist/tools/net-guard.js +59 -0
- package/apps/runtime/dist/tools/project.js +53 -0
- package/apps/runtime/dist/tools/shared.js +42 -0
- package/apps/runtime/dist/tools/store.js +238 -0
- package/apps/runtime/dist/update.js +118 -0
- package/apps/runtime/dist/widgets/bundle.js +99 -0
- package/apps/runtime/dist/widgets/render.js +312 -0
- package/apps/runtime/dist/widgets/runtime.js +84 -0
- package/apps/runtime/dist/widgets/script.js +30 -0
- package/apps/runtime/dist/widgets/step.js +192 -0
- package/apps/web/dist/ai-labels/ai-black.svg +20 -0
- package/apps/web/dist/ai-labels/ai-generated-black.svg +31 -0
- package/apps/web/dist/ai-labels/ai-generated-white.svg +32 -0
- package/apps/web/dist/ai-labels/ai-modified-black.svg +30 -0
- package/apps/web/dist/ai-labels/ai-modified-white.svg +31 -0
- package/apps/web/dist/ai-labels/ai-white.svg +21 -0
- package/apps/web/dist/assets/ChangelogDialog-O00vEnbm.js +1 -0
- package/apps/web/dist/assets/ChatPanel-CH9ry0Hp.js +1 -0
- package/apps/web/dist/assets/CreditsDialog-DRzecwUw.js +1 -0
- package/apps/web/dist/assets/EditorPage-BRnBf02Q.js +2 -0
- package/apps/web/dist/assets/FlowPreview-DDOj8IAH.js +1 -0
- package/apps/web/dist/assets/HomePage-CAGTTG3N.js +1 -0
- package/apps/web/dist/assets/ImportWizard-0RRrAnX3.js +1 -0
- package/apps/web/dist/assets/LocalRuntime-BrP-ENHg.css +1 -0
- package/apps/web/dist/assets/LocalRuntime-C-TBYrzs.js +16 -0
- package/apps/web/dist/assets/NewWizardPage-kI90h3_9.js +2 -0
- package/apps/web/dist/assets/PublicRunner-CKRDeIVd.js +1 -0
- package/apps/web/dist/assets/RunnerView-Rc4H8wYH.js +2 -0
- package/apps/web/dist/assets/SettingsPage-CESMuZxq.js +2 -0
- package/apps/web/dist/assets/SetupPage-D1rrYU14.js +1 -0
- package/apps/web/dist/assets/SharePage-COTAmOgh.js +1 -0
- package/apps/web/dist/assets/api-BY28cjGY.js +10 -0
- package/apps/web/dist/assets/arrow-left-UpjOBfQp.js +1 -0
- package/apps/web/dist/assets/arrow-right-CucQycEy.js +1 -0
- package/apps/web/dist/assets/changelog-p3wsaDDS.js +1 -0
- package/apps/web/dist/assets/check-Bjx41xbB.js +1 -0
- package/apps/web/dist/assets/createLucideIcon-DBu2Ovxj.js +1 -0
- package/apps/web/dist/assets/definition-cy7uvY5L.js +55 -0
- package/apps/web/dist/assets/engenty-CWIFpgKq.js +1 -0
- package/apps/web/dist/assets/esm-D1OEhjTK.js +7 -0
- package/apps/web/dist/assets/external-link-CRg6DVdO.js +1 -0
- package/apps/web/dist/assets/fluffy-engenty-CJ3wCQgT.js +456 -0
- package/apps/web/dist/assets/index-CQ_q9iMO.css +1 -0
- package/apps/web/dist/assets/index-D0gxh90t.js +10 -0
- package/apps/web/dist/assets/jsx-runtime-Dk72oS4N.js +1 -0
- package/apps/web/dist/assets/meta-BbSdtTUa.js +1 -0
- package/apps/web/dist/assets/mic-CeqQ89Dj.js +1 -0
- package/apps/web/dist/assets/oss-credits-cPuZUFHD.js +1 -0
- package/apps/web/dist/assets/outputs-D6pxH6ve.js +69 -0
- package/apps/web/dist/assets/plus-HA210wXA.js +1 -0
- package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +1 -0
- package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +98 -0
- package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +1 -0
- package/apps/web/dist/assets/type-BzYgVWKL.js +1 -0
- package/apps/web/dist/assets/ui-Ddwl35A6.js +1 -0
- package/apps/web/dist/assets/upload-DsgLfQ3U.js +1 -0
- package/apps/web/dist/assets/video-Dk1fuTDl.js +1 -0
- package/apps/web/dist/assets/wand-sparkles-Bf97fs8T.js +1 -0
- package/apps/web/dist/embed.js +102 -0
- package/apps/web/dist/favicon.svg +1 -0
- 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 +46 -0
- package/apps/web/dist/install.sh +532 -0
- package/apps/web/dist/manifest.webmanifest +20 -0
- package/apps/web/dist/sw.js +15 -0
- package/bin/wizards.mjs +13 -0
- package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +77 -0
- package/node_modules/@engenty-wizards/shared/dist/connectors.js +2 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +1415 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +762 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +5 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +132 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +11 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +209 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +532 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +216 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +3 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +3 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +166 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +99 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +35 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +86 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +20 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +133 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +298 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +211 -0
- package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +7 -0
- package/node_modules/@engenty-wizards/shared/dist/merge.js +40 -0
- package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +74 -0
- package/node_modules/@engenty-wizards/shared/dist/projects.js +96 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +219 -0
- package/node_modules/@engenty-wizards/shared/dist/run.js +1 -0
- package/node_modules/@engenty-wizards/shared/dist/store.d.ts +100 -0
- package/node_modules/@engenty-wizards/shared/dist/store.js +44 -0
- package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +16 -0
- package/node_modules/@engenty-wizards/shared/dist/workspace.js +51 -0
- package/node_modules/@engenty-wizards/shared/package.json +10 -0
- package/package.json +62 -0
- package/plugin/.claude-plugin/plugin.json +9 -0
- package/plugin/.mcp.json +8 -0
- package/plugin/commands/wizard.md +8 -0
- package/plugin/skills/build-wizard/SKILL.md +27 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { defineConnector } from "../shims/connections-sdk.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { action } from "./action.js";
|
|
4
|
+
import { bodyToText, graphJson, MICROSOFT_OAUTH2 } from "./graph.js";
|
|
5
|
+
const MAX_LIST_TOP = 25;
|
|
6
|
+
function mapRecipient(r) {
|
|
7
|
+
return {
|
|
8
|
+
address: r?.emailAddress?.address ?? null,
|
|
9
|
+
name: r?.emailAddress?.name ?? null,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function mapMessageSummary(m) {
|
|
13
|
+
return {
|
|
14
|
+
bodyPreview: m.bodyPreview ?? null,
|
|
15
|
+
from: mapRecipient(m.from),
|
|
16
|
+
id: m.id,
|
|
17
|
+
receivedDateTime: m.receivedDateTime ?? null,
|
|
18
|
+
subject: m.subject ?? null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function mapEventSummary(e) {
|
|
22
|
+
return {
|
|
23
|
+
end: e.end ?? null,
|
|
24
|
+
id: e.id,
|
|
25
|
+
isAllDay: e.isAllDay ?? false,
|
|
26
|
+
location: e.location?.displayName ?? null,
|
|
27
|
+
organizer: mapRecipient(e.organizer),
|
|
28
|
+
start: e.start ?? null,
|
|
29
|
+
subject: e.subject ?? null,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function mapEventDetail(e) {
|
|
33
|
+
return {
|
|
34
|
+
...mapEventSummary(e),
|
|
35
|
+
attendees: (e.attendees ?? []).map((a) => ({
|
|
36
|
+
...mapRecipient(a),
|
|
37
|
+
response: a.status?.response ?? null,
|
|
38
|
+
})),
|
|
39
|
+
body_text: bodyToText(e.body),
|
|
40
|
+
webLink: e.webLink ?? null,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function toRecipients(addresses) {
|
|
44
|
+
return (addresses ?? []).map((address) => ({ emailAddress: { address } }));
|
|
45
|
+
}
|
|
46
|
+
function toAttendees(addresses) {
|
|
47
|
+
return addresses.map((address) => ({
|
|
48
|
+
emailAddress: { address },
|
|
49
|
+
type: "required",
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
function clampTop(top, fallback) {
|
|
53
|
+
return Math.min(Math.max(top ?? fallback, 1), MAX_LIST_TOP);
|
|
54
|
+
}
|
|
55
|
+
/** Escape a value for use inside single quotes in an OData $filter. */
|
|
56
|
+
function odataQuote(value) {
|
|
57
|
+
return value.replace(/'/g, "''");
|
|
58
|
+
}
|
|
59
|
+
const topField = z
|
|
60
|
+
.number()
|
|
61
|
+
.int()
|
|
62
|
+
.min(1)
|
|
63
|
+
.max(MAX_LIST_TOP)
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Max results to return (1–25, default 10).");
|
|
66
|
+
const calendarIdField = z
|
|
67
|
+
.string()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Calendar id to target (from list_calendars). Defaults to the user's primary calendar.");
|
|
70
|
+
/** Event collection path for a calendar (primary when no id given). */
|
|
71
|
+
function eventsPath(calendarId) {
|
|
72
|
+
return calendarId
|
|
73
|
+
? `/me/calendars/${encodeURIComponent(calendarId)}/events`
|
|
74
|
+
: "/me/events";
|
|
75
|
+
}
|
|
76
|
+
/** calendarView path (recurrence-expanded window) for a calendar. */
|
|
77
|
+
function calendarViewPath(calendarId) {
|
|
78
|
+
return calendarId
|
|
79
|
+
? `/me/calendars/${encodeURIComponent(calendarId)}/calendarView`
|
|
80
|
+
: "/me/calendarView";
|
|
81
|
+
}
|
|
82
|
+
const messageDraftFields = {
|
|
83
|
+
body_text: z.string().describe("Plain-text message body."),
|
|
84
|
+
cc: z.array(z.string()).optional().describe("CC recipient email addresses."),
|
|
85
|
+
subject: z.string().describe("Message subject."),
|
|
86
|
+
to: z.array(z.string()).min(1).describe("Recipient email addresses."),
|
|
87
|
+
};
|
|
88
|
+
function draftMessagePayload(input) {
|
|
89
|
+
return {
|
|
90
|
+
body: { content: input.body_text, contentType: "Text" },
|
|
91
|
+
...(input.cc?.length ? { ccRecipients: toRecipients(input.cc) } : {}),
|
|
92
|
+
subject: input.subject,
|
|
93
|
+
toRecipients: toRecipients(input.to),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const EVENT_SELECT = "id,subject,start,end,location,organizer,isAllDay";
|
|
97
|
+
async function fetchEventDetail(ctx, eventId) {
|
|
98
|
+
const e = await graphJson(ctx, `/me/events/${encodeURIComponent(eventId)}?$select=${EVENT_SELECT},attendees,body,webLink`);
|
|
99
|
+
return mapEventDetail(e);
|
|
100
|
+
}
|
|
101
|
+
export const microsoftOutlookConnector = defineConnector({
|
|
102
|
+
actions: [
|
|
103
|
+
// ── read ────────────────────────────────────────────────────────────
|
|
104
|
+
action({
|
|
105
|
+
description: "Search Outlook messages by free-text query or by sender/subject filter; returns compact summaries.",
|
|
106
|
+
group: "read",
|
|
107
|
+
id: "search_messages",
|
|
108
|
+
inputSchema: z.object({
|
|
109
|
+
from: z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe("Filter: exact sender email address (ignored when query is set)."),
|
|
113
|
+
query: z
|
|
114
|
+
.string()
|
|
115
|
+
.optional()
|
|
116
|
+
.describe("Free-text search across the mailbox (Microsoft Graph $search)."),
|
|
117
|
+
subject_contains: z
|
|
118
|
+
.string()
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("Filter: subject contains this text (ignored when query is set)."),
|
|
121
|
+
top: topField,
|
|
122
|
+
}),
|
|
123
|
+
providerScopes: ["Mail.Read"],
|
|
124
|
+
run: async (input, ctx) => {
|
|
125
|
+
const params = new URLSearchParams();
|
|
126
|
+
params.set("$select", "id,subject,from,receivedDateTime,bodyPreview");
|
|
127
|
+
params.set("$top", String(clampTop(input.top, 10)));
|
|
128
|
+
if (input.query) {
|
|
129
|
+
params.set("$search", `"${input.query.replace(/"/g, '\\"')}"`);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
const filters = [];
|
|
133
|
+
if (input.from) {
|
|
134
|
+
filters.push(`from/emailAddress/address eq '${odataQuote(input.from)}'`);
|
|
135
|
+
}
|
|
136
|
+
if (input.subject_contains) {
|
|
137
|
+
filters.push(`contains(subject,'${odataQuote(input.subject_contains)}')`);
|
|
138
|
+
}
|
|
139
|
+
if (filters.length) {
|
|
140
|
+
params.set("$filter", filters.join(" and "));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const data = await graphJson(ctx, `/me/messages?${params.toString()}`);
|
|
144
|
+
return { messages: (data.value ?? []).map(mapMessageSummary) };
|
|
145
|
+
},
|
|
146
|
+
summary: "Search Outlook messages",
|
|
147
|
+
}),
|
|
148
|
+
action({
|
|
149
|
+
description: "Get a single Outlook message including its body as plain text (HTML bodies are converted).",
|
|
150
|
+
group: "read",
|
|
151
|
+
id: "get_message",
|
|
152
|
+
inputSchema: z.object({
|
|
153
|
+
message_id: z.string().describe("Graph message id."),
|
|
154
|
+
}),
|
|
155
|
+
providerScopes: ["Mail.Read"],
|
|
156
|
+
run: async (input, ctx) => {
|
|
157
|
+
const m = await graphJson(ctx, `/me/messages/${encodeURIComponent(input.message_id)}?$select=id,subject,from,toRecipients,ccRecipients,receivedDateTime,isRead,body,parentFolderId,webLink`);
|
|
158
|
+
return {
|
|
159
|
+
body_text: bodyToText(m.body),
|
|
160
|
+
cc: (m.ccRecipients ?? []).map(mapRecipient),
|
|
161
|
+
from: mapRecipient(m.from),
|
|
162
|
+
id: m.id,
|
|
163
|
+
isRead: m.isRead ?? null,
|
|
164
|
+
parentFolderId: m.parentFolderId ?? null,
|
|
165
|
+
receivedDateTime: m.receivedDateTime ?? null,
|
|
166
|
+
subject: m.subject ?? null,
|
|
167
|
+
to: (m.toRecipients ?? []).map(mapRecipient),
|
|
168
|
+
webLink: m.webLink ?? null,
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
summary: "Get an Outlook message with its text body",
|
|
172
|
+
}),
|
|
173
|
+
action({
|
|
174
|
+
description: "List mail folders in the mailbox (id, name, item counts) for use with move_message.",
|
|
175
|
+
group: "read",
|
|
176
|
+
id: "list_mail_folders",
|
|
177
|
+
inputSchema: z.object({
|
|
178
|
+
top: z
|
|
179
|
+
.number()
|
|
180
|
+
.int()
|
|
181
|
+
.min(1)
|
|
182
|
+
.max(MAX_LIST_TOP)
|
|
183
|
+
.optional()
|
|
184
|
+
.describe("Max folders to return (1–25, default 25)."),
|
|
185
|
+
}),
|
|
186
|
+
providerScopes: ["Mail.Read"],
|
|
187
|
+
run: async (input, ctx) => {
|
|
188
|
+
const data = await graphJson(ctx, `/me/mailFolders?$top=${clampTop(input.top, MAX_LIST_TOP)}&$select=id,displayName,totalItemCount,unreadItemCount`);
|
|
189
|
+
return {
|
|
190
|
+
folders: (data.value ?? []).map((f) => ({
|
|
191
|
+
displayName: f.displayName ?? null,
|
|
192
|
+
id: f.id,
|
|
193
|
+
totalItemCount: f.totalItemCount ?? null,
|
|
194
|
+
unreadItemCount: f.unreadItemCount ?? null,
|
|
195
|
+
})),
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
summary: "List Outlook mail folders",
|
|
199
|
+
}),
|
|
200
|
+
action({
|
|
201
|
+
description: "List the calendars the mailbox can see (id, name, primary flag) for use with the calendar_id parameter on the event actions.",
|
|
202
|
+
group: "read",
|
|
203
|
+
id: "list_calendars",
|
|
204
|
+
inputSchema: z.object({}),
|
|
205
|
+
providerScopes: ["Calendars.Read"],
|
|
206
|
+
run: async (_input, ctx) => {
|
|
207
|
+
const data = await graphJson(ctx, "/me/calendars?$select=id,name,isDefaultCalendar");
|
|
208
|
+
return {
|
|
209
|
+
calendars: (data.value ?? []).map((c) => ({
|
|
210
|
+
id: c.id,
|
|
211
|
+
primary: Boolean(c.isDefaultCalendar),
|
|
212
|
+
summary: c.name ?? null,
|
|
213
|
+
// Graph exposes no per-calendar default zone on this projection.
|
|
214
|
+
time_zone: null,
|
|
215
|
+
})),
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
summary: "List Outlook calendars",
|
|
219
|
+
}),
|
|
220
|
+
action({
|
|
221
|
+
description: "List calendar events from a calendar (default: primary). With start and end, expands recurring events in that window (calendarView); otherwise lists event definitions.",
|
|
222
|
+
group: "read",
|
|
223
|
+
id: "list_events",
|
|
224
|
+
inputSchema: z.object({
|
|
225
|
+
calendar_id: calendarIdField,
|
|
226
|
+
end: z
|
|
227
|
+
.string()
|
|
228
|
+
.optional()
|
|
229
|
+
.describe("Window end (ISO 8601). Provide both start and end to query a window."),
|
|
230
|
+
start: z
|
|
231
|
+
.string()
|
|
232
|
+
.optional()
|
|
233
|
+
.describe("Window start (ISO 8601). Provide both start and end to query a window."),
|
|
234
|
+
top: topField,
|
|
235
|
+
}),
|
|
236
|
+
providerScopes: ["Calendars.Read"],
|
|
237
|
+
run: async (input, ctx) => {
|
|
238
|
+
const params = new URLSearchParams({
|
|
239
|
+
$orderby: "start/dateTime",
|
|
240
|
+
$select: EVENT_SELECT,
|
|
241
|
+
$top: String(clampTop(input.top, 10)),
|
|
242
|
+
});
|
|
243
|
+
let path = `${eventsPath(input.calendar_id)}?${params.toString()}`;
|
|
244
|
+
if (input.start && input.end) {
|
|
245
|
+
params.set("startDateTime", input.start);
|
|
246
|
+
params.set("endDateTime", input.end);
|
|
247
|
+
path = `${calendarViewPath(input.calendar_id)}?${params.toString()}`;
|
|
248
|
+
}
|
|
249
|
+
const data = await graphJson(ctx, path);
|
|
250
|
+
return { events: (data.value ?? []).map(mapEventSummary) };
|
|
251
|
+
},
|
|
252
|
+
summary: "List calendar events",
|
|
253
|
+
}),
|
|
254
|
+
action({
|
|
255
|
+
description: "Get a single calendar event with attendees and its body as plain text.",
|
|
256
|
+
group: "read",
|
|
257
|
+
id: "get_event",
|
|
258
|
+
inputSchema: z.object({
|
|
259
|
+
event_id: z.string().describe("Graph event id."),
|
|
260
|
+
}),
|
|
261
|
+
providerScopes: ["Calendars.Read"],
|
|
262
|
+
run: (input, ctx) => fetchEventDetail(ctx, input.event_id),
|
|
263
|
+
summary: "Get a calendar event",
|
|
264
|
+
}),
|
|
265
|
+
// ── write ───────────────────────────────────────────────────────────
|
|
266
|
+
action({
|
|
267
|
+
description: "Create an email draft in the Drafts folder (not sent). Use send_message to actually send mail.",
|
|
268
|
+
group: "write",
|
|
269
|
+
id: "create_draft",
|
|
270
|
+
inputSchema: z.object(messageDraftFields),
|
|
271
|
+
providerScopes: ["Mail.ReadWrite"],
|
|
272
|
+
run: async (input, ctx) => {
|
|
273
|
+
const m = await graphJson(ctx, "/me/messages", {
|
|
274
|
+
body: draftMessagePayload(input),
|
|
275
|
+
method: "POST",
|
|
276
|
+
});
|
|
277
|
+
return {
|
|
278
|
+
id: m.id,
|
|
279
|
+
subject: m.subject ?? null,
|
|
280
|
+
webLink: m.webLink ?? null,
|
|
281
|
+
};
|
|
282
|
+
},
|
|
283
|
+
summary: "Create an Outlook mail draft",
|
|
284
|
+
}),
|
|
285
|
+
action({
|
|
286
|
+
description: "Move a message to another mail folder (use list_mail_folders for folder ids; well-known names like 'archive' also work).",
|
|
287
|
+
group: "write",
|
|
288
|
+
id: "move_message",
|
|
289
|
+
inputSchema: z.object({
|
|
290
|
+
destination_folder_id: z
|
|
291
|
+
.string()
|
|
292
|
+
.describe("Target folder id or well-known name (e.g. 'archive', 'deleteditems')."),
|
|
293
|
+
message_id: z.string().describe("Graph message id to move."),
|
|
294
|
+
}),
|
|
295
|
+
providerScopes: ["Mail.ReadWrite"],
|
|
296
|
+
run: async (input, ctx) => {
|
|
297
|
+
const m = await graphJson(ctx, `/me/messages/${encodeURIComponent(input.message_id)}/move`, {
|
|
298
|
+
body: { destinationId: input.destination_folder_id },
|
|
299
|
+
method: "POST",
|
|
300
|
+
});
|
|
301
|
+
return {
|
|
302
|
+
id: m.id,
|
|
303
|
+
parentFolderId: m.parentFolderId ?? null,
|
|
304
|
+
subject: m.subject ?? null,
|
|
305
|
+
};
|
|
306
|
+
},
|
|
307
|
+
summary: "Move an Outlook message to a folder",
|
|
308
|
+
}),
|
|
309
|
+
action({
|
|
310
|
+
description: "Create a calendar event in the user's chosen calendar (default: primary).",
|
|
311
|
+
group: "write",
|
|
312
|
+
id: "create_event",
|
|
313
|
+
inputSchema: z.object({
|
|
314
|
+
attendees: z
|
|
315
|
+
.array(z.string())
|
|
316
|
+
.optional()
|
|
317
|
+
.describe("Attendee email addresses (invited as required)."),
|
|
318
|
+
body_text: z
|
|
319
|
+
.string()
|
|
320
|
+
.optional()
|
|
321
|
+
.describe("Plain-text event description."),
|
|
322
|
+
calendar_id: calendarIdField,
|
|
323
|
+
end: z
|
|
324
|
+
.string()
|
|
325
|
+
.describe("Event end, ISO 8601 date-time (e.g. 2026-07-04T15:00:00)."),
|
|
326
|
+
start: z
|
|
327
|
+
.string()
|
|
328
|
+
.describe("Event start, ISO 8601 date-time (e.g. 2026-07-04T14:00:00)."),
|
|
329
|
+
subject: z.string().describe("Event subject/title."),
|
|
330
|
+
time_zone: z
|
|
331
|
+
.string()
|
|
332
|
+
.default("UTC")
|
|
333
|
+
.describe('Time zone for start and end (default "UTC").'),
|
|
334
|
+
}),
|
|
335
|
+
providerScopes: ["Calendars.ReadWrite"],
|
|
336
|
+
run: async (input, ctx) => {
|
|
337
|
+
const e = await graphJson(ctx, eventsPath(input.calendar_id), {
|
|
338
|
+
body: {
|
|
339
|
+
...(input.attendees?.length
|
|
340
|
+
? { attendees: toAttendees(input.attendees) }
|
|
341
|
+
: {}),
|
|
342
|
+
...(input.body_text
|
|
343
|
+
? { body: { content: input.body_text, contentType: "Text" } }
|
|
344
|
+
: {}),
|
|
345
|
+
end: { dateTime: input.end, timeZone: input.time_zone },
|
|
346
|
+
start: { dateTime: input.start, timeZone: input.time_zone },
|
|
347
|
+
subject: input.subject,
|
|
348
|
+
},
|
|
349
|
+
method: "POST",
|
|
350
|
+
});
|
|
351
|
+
return mapEventDetail(e);
|
|
352
|
+
},
|
|
353
|
+
summary: "Create a calendar event",
|
|
354
|
+
}),
|
|
355
|
+
action({
|
|
356
|
+
description: "Update fields of an existing calendar event (only the provided fields are changed).",
|
|
357
|
+
group: "write",
|
|
358
|
+
id: "update_event",
|
|
359
|
+
inputSchema: z.object({
|
|
360
|
+
attendees: z
|
|
361
|
+
.array(z.string())
|
|
362
|
+
.optional()
|
|
363
|
+
.describe("Replace the attendee list with these email addresses."),
|
|
364
|
+
body_text: z
|
|
365
|
+
.string()
|
|
366
|
+
.optional()
|
|
367
|
+
.describe("New plain-text event description."),
|
|
368
|
+
end: z.string().optional().describe("New end, ISO 8601 date-time."),
|
|
369
|
+
event_id: z.string().describe("Graph event id to update."),
|
|
370
|
+
start: z.string().optional().describe("New start, ISO 8601 date-time."),
|
|
371
|
+
subject: z.string().optional().describe("New event subject/title."),
|
|
372
|
+
time_zone: z
|
|
373
|
+
.string()
|
|
374
|
+
.default("UTC")
|
|
375
|
+
.describe('Time zone for start/end when provided (default "UTC").'),
|
|
376
|
+
}),
|
|
377
|
+
providerScopes: ["Calendars.ReadWrite"],
|
|
378
|
+
run: async (input, ctx) => {
|
|
379
|
+
const patch = {};
|
|
380
|
+
if (input.subject !== undefined) {
|
|
381
|
+
patch.subject = input.subject;
|
|
382
|
+
}
|
|
383
|
+
if (input.body_text !== undefined) {
|
|
384
|
+
patch.body = { content: input.body_text, contentType: "Text" };
|
|
385
|
+
}
|
|
386
|
+
if (input.start !== undefined) {
|
|
387
|
+
patch.start = { dateTime: input.start, timeZone: input.time_zone };
|
|
388
|
+
}
|
|
389
|
+
if (input.end !== undefined) {
|
|
390
|
+
patch.end = { dateTime: input.end, timeZone: input.time_zone };
|
|
391
|
+
}
|
|
392
|
+
if (input.attendees !== undefined) {
|
|
393
|
+
patch.attendees = toAttendees(input.attendees);
|
|
394
|
+
}
|
|
395
|
+
if (Object.keys(patch).length === 0) {
|
|
396
|
+
throw new Error("update_event: no fields to update");
|
|
397
|
+
}
|
|
398
|
+
const e = await graphJson(ctx, `/me/events/${encodeURIComponent(input.event_id)}`, { body: patch, method: "PATCH" });
|
|
399
|
+
return mapEventDetail(e);
|
|
400
|
+
},
|
|
401
|
+
summary: "Update a calendar event",
|
|
402
|
+
}),
|
|
403
|
+
// ── destructive ─────────────────────────────────────────────────────
|
|
404
|
+
action({
|
|
405
|
+
description: "Send an email immediately on behalf of the connected account.",
|
|
406
|
+
group: "destructive",
|
|
407
|
+
id: "send_message",
|
|
408
|
+
inputSchema: z.object({
|
|
409
|
+
...messageDraftFields,
|
|
410
|
+
save_to_sent_items: z
|
|
411
|
+
.boolean()
|
|
412
|
+
.default(true)
|
|
413
|
+
.describe("Save a copy to Sent Items (default true)."),
|
|
414
|
+
}),
|
|
415
|
+
providerScopes: ["Mail.Send"],
|
|
416
|
+
run: async (input, ctx) => {
|
|
417
|
+
await graphJson(ctx, "/me/sendMail", {
|
|
418
|
+
body: {
|
|
419
|
+
message: draftMessagePayload(input),
|
|
420
|
+
saveToSentItems: input.save_to_sent_items,
|
|
421
|
+
},
|
|
422
|
+
method: "POST",
|
|
423
|
+
});
|
|
424
|
+
return { sent: true, subject: input.subject, to: input.to };
|
|
425
|
+
},
|
|
426
|
+
summary: "Send an email",
|
|
427
|
+
}),
|
|
428
|
+
action({
|
|
429
|
+
description: "Delete a message (moves it to the Deleted Items folder; recoverable from there).",
|
|
430
|
+
group: "destructive",
|
|
431
|
+
id: "delete_message",
|
|
432
|
+
inputSchema: z.object({
|
|
433
|
+
message_id: z.string().describe("Graph message id to delete."),
|
|
434
|
+
}),
|
|
435
|
+
providerScopes: ["Mail.ReadWrite"],
|
|
436
|
+
run: async (input, ctx) => {
|
|
437
|
+
await graphJson(ctx, `/me/messages/${encodeURIComponent(input.message_id)}`, { method: "DELETE" });
|
|
438
|
+
return { deleted: true, message_id: input.message_id };
|
|
439
|
+
},
|
|
440
|
+
summary: "Delete an Outlook message",
|
|
441
|
+
}),
|
|
442
|
+
action({
|
|
443
|
+
description: "Delete a calendar event (cancels it for attendees if the user is the organizer).",
|
|
444
|
+
group: "destructive",
|
|
445
|
+
id: "delete_event",
|
|
446
|
+
inputSchema: z.object({
|
|
447
|
+
event_id: z.string().describe("Graph event id to delete."),
|
|
448
|
+
}),
|
|
449
|
+
providerScopes: ["Calendars.ReadWrite"],
|
|
450
|
+
run: async (input, ctx) => {
|
|
451
|
+
await graphJson(ctx, `/me/events/${encodeURIComponent(input.event_id)}`, { method: "DELETE" });
|
|
452
|
+
return { deleted: true, event_id: input.event_id };
|
|
453
|
+
},
|
|
454
|
+
summary: "Delete a calendar event",
|
|
455
|
+
}),
|
|
456
|
+
],
|
|
457
|
+
auth: { kind: "oauth2", oauth2: MICROSOFT_OAUTH2 },
|
|
458
|
+
description: "Outlook mail and calendar via Microsoft Graph: search and read messages, drafts, sending, folders, and calendar events.",
|
|
459
|
+
icon: "logo:microsoft-outlook",
|
|
460
|
+
id: "microsoft-outlook",
|
|
461
|
+
moduleId: "connections-microsoft",
|
|
462
|
+
name: "Microsoft Outlook",
|
|
463
|
+
toolPrefix: "outlook",
|
|
464
|
+
});
|