@rubytech/create-maxy-code 0.1.416 → 0.1.419
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/dist/__tests__/brand-port-uniqueness.test.js +74 -0
- package/dist/__tests__/outlook-client-id-env.test.js +46 -0
- package/dist/index.js +31 -0
- package/dist/known-brands.js +1 -0
- package/dist/port-resolution.js +8 -1
- package/package.json +1 -1
- package/payload/platform/config/brand-registry.json +8 -0
- package/payload/platform/config/brand.json +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.d.ts +2 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.js +81 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.js.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts +17 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/account-enumeration/dist/index.js +46 -9
- package/payload/platform/lib/account-enumeration/dist/index.js.map +1 -1
- package/payload/platform/lib/account-enumeration/src/__tests__/is-provisioned.test.ts +86 -0
- package/payload/platform/lib/account-enumeration/src/index.ts +45 -9
- package/payload/platform/lib/account-scope/dist/index.d.ts +14 -5
- package/payload/platform/lib/account-scope/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/account-scope/dist/index.js +14 -5
- package/payload/platform/lib/account-scope/dist/index.js.map +1 -1
- package/payload/platform/lib/account-scope/src/index.ts +22 -5
- package/payload/platform/lib/active-rules/dist/index.d.ts +35 -0
- package/payload/platform/lib/active-rules/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/active-rules/dist/index.js +94 -0
- package/payload/platform/lib/active-rules/dist/index.js.map +1 -0
- package/payload/platform/lib/active-rules/package.json +7 -0
- package/payload/platform/lib/active-rules/src/index.test.ts +89 -0
- package/payload/platform/lib/active-rules/src/index.ts +133 -0
- package/payload/platform/lib/active-rules/tsconfig.json +9 -0
- package/payload/platform/package.json +4 -3
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +55 -10
- package/payload/platform/plugins/docs/references/internals.md +10 -0
- package/payload/platform/plugins/docs/references/memory-guide.md +2 -0
- package/payload/platform/plugins/docs/references/outlook-guide.md +42 -9
- package/payload/platform/plugins/email/references/email-reference.md +1 -1
- package/payload/platform/plugins/filesystem/PLUGIN.md +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js +16 -2
- package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js.map +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts.map +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js +8 -3
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js.map +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js +2 -2
- package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js.map +1 -1
- package/payload/platform/plugins/memory/PLUGIN.md +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index-testable.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index-testable.js +14 -5
- package/payload/platform/plugins/memory/mcp/dist/index-testable.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index.js +5 -2
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.d.ts +29 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.js +44 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.js +22 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.js +49 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-read-active-rules.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-bootstrap.test.js +105 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-bootstrap.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.js +78 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.js +99 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-reconcile.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/resolve-tool-account.test.js +2 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/resolve-tool-account.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +0 -5
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +2 -12
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +11 -3
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +22 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +212 -24
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +40 -7
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js +137 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.js +210 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js +110 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js +108 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js +13 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.js +32 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.js +67 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js +7 -5
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.js +141 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts +69 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js +129 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.d.ts +39 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.js +101 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +3 -2
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/index.js +187 -5
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts +34 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +96 -7
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts +31 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.js +30 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts +41 -17
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js +87 -28
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.d.ts +17 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.js +38 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.d.ts +42 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.js +59 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.d.ts +34 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.js +46 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.d.ts +15 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.js +27 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.d.ts +11 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.js +20 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.d.ts +17 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.js +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +11 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.d.ts +14 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.js +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/scripts/verify-doc-impl.sh +2 -2
- package/payload/platform/plugins/outlook/references/auth.md +51 -54
- package/payload/platform/plugins/outlook/references/graph-surfaces.md +97 -4
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +34 -9
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +10 -5
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +9 -1
- package/payload/platform/scripts/__tests__/provision-role-stamp.test.sh +3 -0
- package/payload/platform/scripts/lib/provision-account-dir.sh +9 -1
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts +1 -1
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js +5 -1
- package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +9 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/config.d.ts +18 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/config.js +16 -0
- package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +36 -4
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +14 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.d.ts +46 -0
- package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.js +96 -0
- package/payload/platform/services/claude-session-manager/dist/preference-reconciliation-audit.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +33 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +61 -7
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +5 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +6 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js +20 -0
- package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
- package/payload/platform/services/telegram-channel/dist/instructions.d.ts +9 -0
- package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -0
- package/payload/platform/services/telegram-channel/dist/instructions.js +100 -0
- package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -0
- package/payload/platform/services/telegram-channel/dist/notification.d.ts +93 -0
- package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -0
- package/payload/platform/services/telegram-channel/dist/notification.js +119 -0
- package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -0
- package/payload/platform/services/telegram-channel/dist/server.d.ts +40 -0
- package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -0
- package/payload/platform/services/telegram-channel/dist/server.js +291 -0
- package/payload/platform/services/telegram-channel/dist/server.js.map +1 -0
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +28 -0
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +1 -0
- package/payload/platform/services/telegram-channel/dist/turn-follow.js +188 -0
- package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +1 -0
- package/payload/platform/services/webchat-channel/dist/notification.d.ts +5 -0
- package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/notification.js +6 -1
- package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +6 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.js +8 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
- package/payload/platform/templates/agents/passive/IDENTITY.md +21 -0
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/server/public/assets/{AdminLoginScreens-CBlE6FB4.js → AdminLoginScreens-B1PkOF66.js} +1 -1
- package/payload/server/public/assets/AdminShell-D8wNArGQ.js +2 -0
- package/payload/server/public/assets/{Checkbox-B0pbYJDQ.js → Checkbox-Bm9Er726.js} +1 -1
- package/payload/server/public/assets/{Transcript-CYaAPBFX.js → Transcript-CBIyQ8T5.js} +1 -1
- package/payload/server/public/assets/{admin-CVh9HO-f.js → admin-CWM9G_yA.js} +1 -1
- package/payload/server/public/assets/{browser-C4f_D4Ih.js → browser-D8QhNffV.js} +1 -1
- package/payload/server/public/assets/{calendar-WUxQ4fVo.js → calendar-qob5K4t_.js} +1 -1
- package/payload/server/public/assets/chat-BNrxVUF6.js +1 -0
- package/payload/server/public/assets/chevron-left-BQThFVrd.js +1 -0
- package/payload/server/public/assets/data-C-EqNbRi.js +1 -0
- package/payload/server/public/assets/{graph-BNXE6mKP.js → graph-DZ2HMpIB.js} +1 -1
- package/payload/server/public/assets/{graph-labels-Csnovm_c.js → graph-labels-BFG4bjXQ.js} +1 -1
- package/payload/server/public/assets/{maximize-2-WRUJsg5n.js → maximize-2-DkZ40lSl.js} +1 -1
- package/payload/server/public/assets/{operator-CXtygMh6.js → operator-FrXrSsBj.js} +1 -1
- package/payload/server/public/assets/page-CHWMI9Tm.js +32 -0
- package/payload/server/public/assets/{page-IQDLdebG.js → page-CXKV01gT.js} +1 -1
- package/payload/server/public/assets/{public-DSeYu61E.js → public-2p1pJ4WF.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-BayMWwfc.js → rotate-ccw-D3o_bMBA.js} +1 -1
- package/payload/server/public/assets/useSubAccountSwitcher-8dLvF3Ux.js +9 -0
- package/payload/server/public/assets/useSubAccountSwitcher-BUvlETHN.css +1 -0
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +5 -5
- package/payload/server/public/chat.html +9 -9
- package/payload/server/public/data.html +8 -8
- package/payload/server/public/graph.html +9 -9
- package/payload/server/public/index.html +11 -11
- package/payload/server/public/operator.html +11 -11
- package/payload/server/public/public.html +9 -9
- package/payload/server/server.js +245 -40
- package/payload/server/public/assets/AdminShell-d1WQ3lLu.js +0 -2
- package/payload/server/public/assets/chat-NJ2HXhOf.js +0 -1
- package/payload/server/public/assets/chevron-left-Da-iZGi_.js +0 -1
- package/payload/server/public/assets/data-ZUdT44Ba.js +0 -1
- package/payload/server/public/assets/page-DjpQp_ir.js +0 -32
- package/payload/server/public/assets/useSubAccountSwitcher-C9aLg8yI.js +0 -9
- package/payload/server/public/assets/useSubAccountSwitcher-CRZfyJXR.css +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { callGraph, postGraph, deleteGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { log, trunc } from "../lib/log.js";
|
|
3
|
+
/**
|
|
4
|
+
* Cancel an event. The mode is auto-determined from a lightweight pre-GET: an
|
|
5
|
+
* organiser of a meeting (has attendees) POSTs `/cancel` so attendees are
|
|
6
|
+
* notified; anything else (a personal appointment, or a meeting the account
|
|
7
|
+
* only attends) is a DELETE. The determined mode is logged and returned.
|
|
8
|
+
*/
|
|
9
|
+
export async function runCalendarCancel(config, args) {
|
|
10
|
+
const eventId = args.eventId?.trim();
|
|
11
|
+
if (!eventId) {
|
|
12
|
+
throw new Error("calendar-cancel: eventId is required.");
|
|
13
|
+
}
|
|
14
|
+
const probe = await callGraph(config, (client) => client
|
|
15
|
+
.api(`/me/events/${encodeURIComponent(eventId)}`)
|
|
16
|
+
.select("isOrganizer,attendees")
|
|
17
|
+
.get(), { tool: "calendar-cancel" });
|
|
18
|
+
const isMeeting = probe.isOrganizer === true && (probe.attendees?.length ?? 0) > 0;
|
|
19
|
+
const mode = isMeeting ? "cancel" : "delete";
|
|
20
|
+
log({ event: "cal-cancel-request", account: config.accountId, eventId: trunc(eventId, 16), mode });
|
|
21
|
+
if (mode === "cancel") {
|
|
22
|
+
const { status } = await postGraph(config, `/me/events/${encodeURIComponent(eventId)}/cancel`, { Comment: args.comment ?? "" }, { tool: "calendar-cancel" });
|
|
23
|
+
if (status !== 202) {
|
|
24
|
+
log({ event: "event-cancel-failed", account: config.accountId, eventId: trunc(eventId, 16), mode, status });
|
|
25
|
+
throw new Error(`calendar-cancel: expected HTTP 202 from /cancel, got status=${status}.`);
|
|
26
|
+
}
|
|
27
|
+
log({ event: "event-cancelled", account: config.accountId, eventId: trunc(eventId, 16), mode, status });
|
|
28
|
+
return { eventId, mode };
|
|
29
|
+
}
|
|
30
|
+
const { status } = await deleteGraph(config, `/me/events/${encodeURIComponent(eventId)}`, { tool: "calendar-cancel" });
|
|
31
|
+
if (status !== 204) {
|
|
32
|
+
log({ event: "event-cancel-failed", account: config.accountId, eventId: trunc(eventId, 16), mode, status });
|
|
33
|
+
throw new Error(`calendar-cancel: expected HTTP 204 from delete, got status=${status}.`);
|
|
34
|
+
}
|
|
35
|
+
log({ event: "event-cancelled", account: config.accountId, eventId: trunc(eventId, 16), mode, status });
|
|
36
|
+
return { eventId, mode };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=calendar-cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-cancel.js","sourceRoot":"","sources":["../../src/tools/calendar-cancel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAiB3C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAyB,EACzB,IAAwB;IAExB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,SAAS,CAC3B,MAAM,EACN,CAAC,MAAM,EAAE,EAAE,CACT,MAAM;SACH,GAAG,CAAC,cAAc,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;SAChD,MAAM,CAAC,uBAAuB,CAAC;SAC/B,GAAG,EAA+B,EACvC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAC5B,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACnF,MAAM,IAAI,GAAwB,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClE,GAAG,CAAC,EAAE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AK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5G,MAAM,IAAI,KAAK,CAAC,8DAA8D,MAAM,GAAG,CAAC,CAAC;IAC3F,CAAC;IACD,GAAG,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACxG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
export interface EventTime {
|
|
3
|
+
dateTime: string;
|
|
4
|
+
timeZone: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EventAttendee {
|
|
7
|
+
email: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
type?: "required" | "optional" | "resource";
|
|
10
|
+
}
|
|
11
|
+
/** Fields shared by create (subject/start/end required) and update (all optional). */
|
|
12
|
+
export interface EventInput {
|
|
13
|
+
subject?: string;
|
|
14
|
+
start?: EventTime;
|
|
15
|
+
end?: EventTime;
|
|
16
|
+
body?: string;
|
|
17
|
+
attendees?: EventAttendee[];
|
|
18
|
+
location?: string;
|
|
19
|
+
isOnlineMeeting?: boolean;
|
|
20
|
+
recurrence?: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Two outcomes, distinguished by `eventId`:
|
|
24
|
+
* - id known: Graph returned HTTP 201 with a readable event id.
|
|
25
|
+
* - id unknown: Graph returned HTTP 201 (the event WAS created) but the body
|
|
26
|
+
* could not be parsed for an id (e.g. an interrupted body stream). The
|
|
27
|
+
* distinct `created`/`idUnknown` flags plus `message` tell the agent the
|
|
28
|
+
* event exists so it does not blindly retry and duplicate the booking.
|
|
29
|
+
*/
|
|
30
|
+
export type CalendarCreateResult = {
|
|
31
|
+
eventId: string;
|
|
32
|
+
webLink: string | null;
|
|
33
|
+
} | {
|
|
34
|
+
eventId: null;
|
|
35
|
+
created: true;
|
|
36
|
+
idUnknown: true;
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
39
|
+
/** Build a Graph event body from the supplied fields only. Unset keys are omitted. */
|
|
40
|
+
export declare function buildEventBody(input: EventInput): Record<string, unknown>;
|
|
41
|
+
export declare function runCalendarCreate(config: GraphClientConfig, args: EventInput): Promise<CalendarCreateResult>;
|
|
42
|
+
//# sourceMappingURL=calendar-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-create.d.ts","sourceRoot":"","sources":["../../src/tools/calendar-create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;CAC7C;AAED,sFAAsF;AACtF,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3C;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBzE;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,oBAAoB,CAAC,CAqC/B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { postGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { log, trunc } from "../lib/log.js";
|
|
3
|
+
/** Build a Graph event body from the supplied fields only. Unset keys are omitted. */
|
|
4
|
+
export function buildEventBody(input) {
|
|
5
|
+
const body = {};
|
|
6
|
+
if (input.subject !== undefined)
|
|
7
|
+
body.subject = input.subject;
|
|
8
|
+
if (input.start !== undefined)
|
|
9
|
+
body.start = input.start;
|
|
10
|
+
if (input.end !== undefined)
|
|
11
|
+
body.end = input.end;
|
|
12
|
+
if (input.body !== undefined)
|
|
13
|
+
body.body = { contentType: "HTML", content: input.body };
|
|
14
|
+
if (input.location !== undefined)
|
|
15
|
+
body.location = { displayName: input.location };
|
|
16
|
+
if (input.attendees !== undefined) {
|
|
17
|
+
body.attendees = input.attendees.map((a) => ({
|
|
18
|
+
emailAddress: { address: a.email, name: a.name },
|
|
19
|
+
type: a.type ?? "required",
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
if (input.isOnlineMeeting !== undefined)
|
|
23
|
+
body.isOnlineMeeting = input.isOnlineMeeting;
|
|
24
|
+
if (input.recurrence !== undefined)
|
|
25
|
+
body.recurrence = input.recurrence;
|
|
26
|
+
return body;
|
|
27
|
+
}
|
|
28
|
+
export async function runCalendarCreate(config, args) {
|
|
29
|
+
if (!args.subject || !args.start || !args.end) {
|
|
30
|
+
throw new Error("calendar-create: subject, start, and end are required.");
|
|
31
|
+
}
|
|
32
|
+
const graphBody = buildEventBody(args);
|
|
33
|
+
log({ event: "cal-create-request", account: config.accountId, subj: trunc(args.subject, 64) });
|
|
34
|
+
const { status, json } = await postGraph(config, "/me/events", graphBody, {
|
|
35
|
+
tool: "calendar-create",
|
|
36
|
+
});
|
|
37
|
+
const body = json;
|
|
38
|
+
// Graph did not confirm creation: a genuine failure the agent may safely retry.
|
|
39
|
+
if (status !== 201) {
|
|
40
|
+
log({ event: "event-create-failed", account: config.accountId, status });
|
|
41
|
+
throw new Error(`calendar-create: expected HTTP 201 with an event id, got status=${status}.`);
|
|
42
|
+
}
|
|
43
|
+
// Created (HTTP 201) but the body carried no readable event id (e.g. an
|
|
44
|
+
// interrupted body stream parsed to null). The event exists; return a distinct
|
|
45
|
+
// created-but-id-unknown result so the agent does not blindly retry and
|
|
46
|
+
// duplicate the booking.
|
|
47
|
+
if (!body?.id) {
|
|
48
|
+
log({ event: "event-created-id-unknown", account: config.accountId, status });
|
|
49
|
+
return {
|
|
50
|
+
eventId: null,
|
|
51
|
+
created: true,
|
|
52
|
+
idUnknown: true,
|
|
53
|
+
message: "The event was created (HTTP 201) but Microsoft Graph returned no readable event id. Do not retry, because a retry would create a duplicate. Look up the event in the calendar to obtain its id.",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
log({ event: "event-created", account: config.accountId, eventId: trunc(body.id, 16), status });
|
|
57
|
+
return { eventId: body.id, webLink: body.webLink ?? null };
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=calendar-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-create.js","sourceRoot":"","sources":["../../src/tools/calendar-create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAA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AAC,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAChG,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
import type { EventTime } from "./calendar-create.js";
|
|
3
|
+
export interface FreebusyArgs {
|
|
4
|
+
schedules: string[];
|
|
5
|
+
start: EventTime;
|
|
6
|
+
end: EventTime;
|
|
7
|
+
intervalMinutes?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface FreebusyBusyBlock {
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
status: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FreebusyEntry {
|
|
15
|
+
address: string;
|
|
16
|
+
availabilityView: string;
|
|
17
|
+
busy: FreebusyBusyBlock[];
|
|
18
|
+
error: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface FreebusyResult {
|
|
21
|
+
requested: number;
|
|
22
|
+
resolved: number;
|
|
23
|
+
availability: FreebusyEntry[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Query free/busy for one or more addresses (POST /me/calendar/getSchedule).
|
|
27
|
+
* Graph returns one entry per requested address; an address it cannot resolve
|
|
28
|
+
* (bad address, no permission) comes back with an `error` and an empty
|
|
29
|
+
* availabilityView rather than being omitted. `resolved` counts only the
|
|
30
|
+
* error-free entries, so `resolved < requested` is the partial-result signal
|
|
31
|
+
* and each failed address carries its Graph error rather than reading as free.
|
|
32
|
+
*/
|
|
33
|
+
export declare function runCalendarFreebusy(config: GraphClientConfig, args: FreebusyArgs): Promise<FreebusyResult>;
|
|
34
|
+
//# sourceMappingURL=calendar-freebusy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-freebusy.d.ts","sourceRoot":"","sources":["../../src/tools/calendar-freebusy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,SAAS,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,aAAa,EAAE,CAAC;CAC/B;AAaD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,cAAc,CAAC,CAuCzB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { postGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { log } from "../lib/log.js";
|
|
3
|
+
/**
|
|
4
|
+
* Query free/busy for one or more addresses (POST /me/calendar/getSchedule).
|
|
5
|
+
* Graph returns one entry per requested address; an address it cannot resolve
|
|
6
|
+
* (bad address, no permission) comes back with an `error` and an empty
|
|
7
|
+
* availabilityView rather than being omitted. `resolved` counts only the
|
|
8
|
+
* error-free entries, so `resolved < requested` is the partial-result signal
|
|
9
|
+
* and each failed address carries its Graph error rather than reading as free.
|
|
10
|
+
*/
|
|
11
|
+
export async function runCalendarFreebusy(config, args) {
|
|
12
|
+
const schedules = args.schedules?.filter((s) => s && s.trim().length > 0) ?? [];
|
|
13
|
+
if (schedules.length === 0) {
|
|
14
|
+
throw new Error("calendar-freebusy: at least one schedule address is required.");
|
|
15
|
+
}
|
|
16
|
+
const requested = schedules.length;
|
|
17
|
+
log({ event: "freebusy-request", account: config.accountId, requested });
|
|
18
|
+
const graphBody = {
|
|
19
|
+
schedules,
|
|
20
|
+
startTime: args.start,
|
|
21
|
+
endTime: args.end,
|
|
22
|
+
availabilityViewInterval: args.intervalMinutes ?? 60,
|
|
23
|
+
};
|
|
24
|
+
const { status, json } = await postGraph(config, "/me/calendar/getSchedule", graphBody, {
|
|
25
|
+
tool: "calendar-freebusy",
|
|
26
|
+
});
|
|
27
|
+
if (status !== 200) {
|
|
28
|
+
log({ event: "freebusy-failed", account: config.accountId, requested, status });
|
|
29
|
+
throw new Error(`calendar-freebusy: expected HTTP 200, got status=${status}.`);
|
|
30
|
+
}
|
|
31
|
+
const rows = json?.value ?? [];
|
|
32
|
+
const availability = rows.map((row) => ({
|
|
33
|
+
address: row.scheduleId ?? "",
|
|
34
|
+
availabilityView: row.availabilityView ?? "",
|
|
35
|
+
busy: (row.scheduleItems ?? []).map((item) => ({
|
|
36
|
+
start: item.start?.dateTime ?? "",
|
|
37
|
+
end: item.end?.dateTime ?? "",
|
|
38
|
+
status: item.status ?? "unknown",
|
|
39
|
+
})),
|
|
40
|
+
error: row.error ? (row.error.message ?? row.error.responseCode ?? "unresolved") : null,
|
|
41
|
+
}));
|
|
42
|
+
const resolved = availability.filter((entry) => entry.error === null).length;
|
|
43
|
+
log({ event: "freebusy-result", account: config.accountId, requested, resolved });
|
|
44
|
+
return { requested, resolved, availability };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=calendar-freebusy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-freebusy.js","sourceRoot":"","sources":["../../src/tools/calendar-freebusy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAwCpC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAyB,EACzB,IAAkB;IAElB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAChF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IACD,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC;IACnC,GAAG,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAEzE,MAAM,SAAS,GAAG;QAChB,SAAS;QACT,SAAS,EAAE,IAAI,CAAC,KAAK;QACrB,OAAO,EAAE,IAAI,CAAC,GAAG;QACjB,wBAAwB,EAAE,IAAI,CAAC,eAAe,IAAI,EAAE;KACrD,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,SAAS,EAAE;QACtF,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAC;IAEH,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,C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
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
export type RespondAction = "accept" | "decline" | "tentative";
|
|
3
|
+
export interface CalendarRespondArgs {
|
|
4
|
+
eventId: string;
|
|
5
|
+
action: RespondAction;
|
|
6
|
+
comment?: string;
|
|
7
|
+
sendResponse?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface CalendarRespondResult {
|
|
10
|
+
eventId: string;
|
|
11
|
+
action: RespondAction;
|
|
12
|
+
}
|
|
13
|
+
/** Respond to a meeting invite: accept, decline, or tentatively accept. */
|
|
14
|
+
export declare function runCalendarRespond(config: GraphClientConfig, args: CalendarRespondArgs): Promise<CalendarRespondResult>;
|
|
15
|
+
//# sourceMappingURL=calendar-respond.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-respond.d.ts","sourceRoot":"","sources":["../../src/tools/calendar-respond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAQ/D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,2EAA2E;AAC3E,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,qBAAqB,CAAC,CA0BhC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { postGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { log, trunc } from "../lib/log.js";
|
|
3
|
+
const ENDPOINT = {
|
|
4
|
+
accept: "accept",
|
|
5
|
+
decline: "decline",
|
|
6
|
+
tentative: "tentativelyAccept",
|
|
7
|
+
};
|
|
8
|
+
/** Respond to a meeting invite: accept, decline, or tentatively accept. */
|
|
9
|
+
export async function runCalendarRespond(config, args) {
|
|
10
|
+
const eventId = args.eventId?.trim();
|
|
11
|
+
if (!eventId) {
|
|
12
|
+
throw new Error("calendar-respond: eventId is required.");
|
|
13
|
+
}
|
|
14
|
+
const endpoint = ENDPOINT[args.action];
|
|
15
|
+
if (!endpoint) {
|
|
16
|
+
throw new Error(`calendar-respond: unknown action "${args.action}".`);
|
|
17
|
+
}
|
|
18
|
+
log({ event: "cal-respond-request", account: config.accountId, eventId: trunc(eventId, 16), action: args.action });
|
|
19
|
+
const { status } = await postGraph(config, `/me/events/${encodeURIComponent(eventId)}/${endpoint}`, { Comment: args.comment ?? "", SendResponse: args.sendResponse ?? true }, { tool: "calendar-respond" });
|
|
20
|
+
if (status !== 202) {
|
|
21
|
+
log({ event: "event-respond-failed", account: config.accountId, eventId: trunc(eventId, 16), action: args.action, status });
|
|
22
|
+
throw new Error(`calendar-respond: expected HTTP 202, got status=${status}.`);
|
|
23
|
+
}
|
|
24
|
+
log({ event: "event-responded", account: config.accountId, eventId: trunc(eventId, 16), action: args.action, status });
|
|
25
|
+
return { eventId, action: args.action };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=calendar-respond.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-respond.js","sourceRoot":"","sources":["../../src/tools/calendar-respond.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,QAAQ,GAAkC;IAC9C,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAcF,2EAA2E;A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K,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
import { type EventInput } from "./calendar-create.js";
|
|
3
|
+
export interface CalendarUpdateArgs extends EventInput {
|
|
4
|
+
eventId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CalendarUpdateResult {
|
|
7
|
+
eventId: string;
|
|
8
|
+
updated: true;
|
|
9
|
+
}
|
|
10
|
+
export declare function runCalendarUpdate(config: GraphClientConfig, args: CalendarUpdateArgs): Promise<CalendarUpdateResult>;
|
|
11
|
+
//# sourceMappingURL=calendar-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-update.d.ts","sourceRoot":"","sources":["../../src/tools/calendar-update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAuB/B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { patchGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { log, trunc } from "../lib/log.js";
|
|
3
|
+
import { buildEventBody } from "./calendar-create.js";
|
|
4
|
+
export async function runCalendarUpdate(config, args) {
|
|
5
|
+
const eventId = args.eventId?.trim();
|
|
6
|
+
if (!eventId) {
|
|
7
|
+
throw new Error("calendar-update: eventId is required.");
|
|
8
|
+
}
|
|
9
|
+
const { eventId: _drop, ...fields } = args;
|
|
10
|
+
const graphBody = buildEventBody(fields);
|
|
11
|
+
log({ event: "cal-update-request", account: config.accountId, eventId: trunc(eventId, 16) });
|
|
12
|
+
const { status } = await patchGraph(config, `/me/events/${encodeURIComponent(eventId)}`, graphBody, { tool: "calendar-update" });
|
|
13
|
+
if (status !== 200) {
|
|
14
|
+
log({ event: "event-update-failed", account: config.accountId, eventId: trunc(eventId, 16), status });
|
|
15
|
+
throw new Error(`calendar-update: expected HTTP 200, got status=${status}.`);
|
|
16
|
+
}
|
|
17
|
+
log({ event: "event-updated", account: config.accountId, eventId: trunc(eventId, 16), status });
|
|
18
|
+
return { eventId, updated: true };
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=calendar-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-update.js","sourceRoot":"","sources":["../../src/tools/calendar-update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAmB,MAAM,sBAAsB,CAAC;AAWvE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAyB,EACzB,IAAwB;IAExB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3C,MAAM,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IAE7F,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CACjC,MAAM,EACN,cAAc,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAC3C,SAAS,EACT,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAC5B,CAAC;IAEF,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACtG,MAAM,IAAI,KAAK,CAAC,kDAAkD,MAAM,GAAG,CAAC,CAAC;IAC/E,CAAC;IAED,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAChG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
export interface DraftSendArgs {
|
|
3
|
+
draftId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface DraftSendResult {
|
|
6
|
+
status: "sent";
|
|
7
|
+
draftId: string;
|
|
8
|
+
httpStatus: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Send an existing draft via Graph `POST /me/messages/{id}/send` (empty body).
|
|
12
|
+
* Graph consumes the draft and returns 202. Success is asserted on the 202
|
|
13
|
+
* status. The draft-created / draft-sent id pairing in the logs is the orphan
|
|
14
|
+
* diagnostic: a draft-created id with no matching draft-sent is an orphan.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runDraftSend(config: GraphClientConfig, args: DraftSendArgs): Promise<DraftSendResult>;
|
|
17
|
+
//# sourceMappingURL=draft-send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-send.d.ts","sourceRoot":"","sources":["../../src/tools/draft-send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,eAAe,CAAC,CAoB1B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { postGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { log } from "../lib/log.js";
|
|
3
|
+
/**
|
|
4
|
+
* Send an existing draft via Graph `POST /me/messages/{id}/send` (empty body).
|
|
5
|
+
* Graph consumes the draft and returns 202. Success is asserted on the 202
|
|
6
|
+
* status. The draft-created / draft-sent id pairing in the logs is the orphan
|
|
7
|
+
* diagnostic: a draft-created id with no matching draft-sent is an orphan.
|
|
8
|
+
*/
|
|
9
|
+
export async function runDraftSend(config, args) {
|
|
10
|
+
const account = config.accountId;
|
|
11
|
+
const draftId = args.draftId.trim();
|
|
12
|
+
if (!draftId) {
|
|
13
|
+
throw new Error("outlook-draft-send: draftId is required.");
|
|
14
|
+
}
|
|
15
|
+
log({ event: "draft-send-request", account, id: draftId });
|
|
16
|
+
try {
|
|
17
|
+
const { status } = await postGraph(config, `/me/messages/${encodeURIComponent(draftId)}/send`, undefined, { tool: "draft-send" });
|
|
18
|
+
log({ event: "draft-sent", account, id: draftId, status });
|
|
19
|
+
return { status: "sent", draftId, httpStatus: status };
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
log({ event: "draft-send-failed", account, id: draftId, error: err.message });
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=draft-send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-send.js","sourceRoot":"","sources":["../../src/tools/draft-send.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAYpC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAyB,EACzB,IAAmB;IAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IACD,GAAG,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAChC,MAAM,EACN,gBAAgB,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAClD,SAAS,EACT,EAAE,IAAI,EAAE,YAAY,EAAE,CACvB,CAAC;QACF,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IACzD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACzF,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
import { type MessageInput } from "../lib/message.js";
|
|
3
|
+
export interface DraftResult {
|
|
4
|
+
draftId: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Create a draft via Graph `POST /me/messages`. Graph returns 201 with the
|
|
8
|
+
* created message, whose `id` is the stable handle passed to outlook-draft-send.
|
|
9
|
+
*/
|
|
10
|
+
export declare function runDraft(config: GraphClientConfig, input: MessageInput): Promise<DraftResult>;
|
|
11
|
+
//# sourceMappingURL=draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/tools/draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,WAAW,CAAC,CAgBtB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { postGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { buildMessage } from "../lib/message.js";
|
|
3
|
+
import { log } from "../lib/log.js";
|
|
4
|
+
/**
|
|
5
|
+
* Create a draft via Graph `POST /me/messages`. Graph returns 201 with the
|
|
6
|
+
* created message, whose `id` is the stable handle passed to outlook-draft-send.
|
|
7
|
+
*/
|
|
8
|
+
export async function runDraft(config, input) {
|
|
9
|
+
const account = config.accountId;
|
|
10
|
+
log({ event: "draft-request", account });
|
|
11
|
+
const message = buildMessage(input);
|
|
12
|
+
try {
|
|
13
|
+
const { json } = await postGraph(config, "/me/messages", message, { tool: "draft" });
|
|
14
|
+
const draftId = json?.id;
|
|
15
|
+
if (!draftId) {
|
|
16
|
+
throw new Error("outlook-draft: Graph created the draft but returned no id.");
|
|
17
|
+
}
|
|
18
|
+
log({ event: "draft-created", account, id: draftId });
|
|
19
|
+
return { draftId };
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
log({ event: "draft-failed", account, error: err.message });
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../../src/tools/draft.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAqB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAMpC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAAyB,EACzB,KAAmB;IAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;IACjC,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACrF,MAAM,OAAO,GAAI,IAA+B,EAAE,EAAE,CAAC;QACrD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QACD,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QACtD,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GraphClientConfig } from "../lib/graph-client.js";
|
|
2
|
+
import { type MessageInput } from "../lib/message.js";
|
|
3
|
+
export interface MailSendResult {
|
|
4
|
+
status: "sent";
|
|
5
|
+
httpStatus: number;
|
|
6
|
+
messageId: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Send a message via Graph `POST /me/sendMail`. Graph returns 202 with no body,
|
|
10
|
+
* so `messageId` is null unless a body is ever returned. Success is asserted on
|
|
11
|
+
* the 202 status, not on the absence of a throw.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runMailSend(config: GraphClientConfig, input: MessageInput): Promise<MailSendResult>;
|
|
14
|
+
//# sourceMappingURL=mail-send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-send.d.ts","sourceRoot":"","sources":["../../src/tools/mail-send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,cAAc,CAAC,CAoBzB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { postGraph } from "../lib/graph-client.js";
|
|
2
|
+
import { buildMessage } from "../lib/message.js";
|
|
3
|
+
import { log } from "../lib/log.js";
|
|
4
|
+
/**
|
|
5
|
+
* Send a message via Graph `POST /me/sendMail`. Graph returns 202 with no body,
|
|
6
|
+
* so `messageId` is null unless a body is ever returned. Success is asserted on
|
|
7
|
+
* the 202 status, not on the absence of a throw.
|
|
8
|
+
*/
|
|
9
|
+
export async function runMailSend(config, input) {
|
|
10
|
+
const account = config.accountId;
|
|
11
|
+
log({ event: "send-request", account, to: input.to.length, subjLen: input.subject.length });
|
|
12
|
+
const message = buildMessage(input);
|
|
13
|
+
const recipients = input.to.length + (input.cc?.length ?? 0) + (input.bcc?.length ?? 0);
|
|
14
|
+
log({ event: "send-args", account, recipients, hasBody: input.body.length > 0 });
|
|
15
|
+
try {
|
|
16
|
+
const { status, json } = await postGraph(config, "/me/sendMail", { message, saveToSentItems: true }, { tool: "mail-send" });
|
|
17
|
+
const messageId = json?.id ?? null;
|
|
18
|
+
log({ event: "sent", account, status, messageId });
|
|
19
|
+
return { status: "sent", httpStatus: status, messageId };
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
log({ event: "send-failed", account, error: err.message });
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=mail-send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-send.js","sourceRoot":"","sources":["../../src/tools/mail-send.ts"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AE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC3D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACtE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -45,8 +45,8 @@ TOOLS_REGISTERED=$(grep -oE '"outlook-[a-z\-]+",' "$INDEX_TS" \
|
|
|
45
45
|
# Tool names referenced in outlook-guide.md (backtick-wrapped)
|
|
46
46
|
TOOLS_IN_GUIDE=$(grep -oE '`outlook-[a-z\-]+`' "$GUIDE" | tr -d '`' | sort -u)
|
|
47
47
|
|
|
48
|
-
# Tool names in PLUGIN.md frontmatter (lines
|
|
49
|
-
TOOLS_IN_PLUGIN_MD=$(grep -E '
|
|
48
|
+
# Tool names in PLUGIN.md frontmatter (lines shaped " - name: outlook-...")
|
|
49
|
+
TOOLS_IN_PLUGIN_MD=$(grep -E '^[[:space:]]+- name: outlook-' "$PLUGIN_MD" | sed -E 's/^[[:space:]]*-[[:space:]]+name:[[:space:]]*//' | sort -u)
|
|
50
50
|
|
|
51
51
|
# Set 1: every tool in guide must be registered
|
|
52
52
|
while IFS= read -r tool; do
|