@grok/agent-sdk 0.6.0 → 0.7.1
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/AGENTS.md +40 -0
- package/dist/channels/github/cursor-account.d.ts +1 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +8 -2
- package/dist/channels/github/forward.d.ts +5 -0
- package/dist/channels/github/forward.d.ts.map +1 -1
- package/dist/channels/github/forward.js +6 -3
- package/dist/channels/origin/cursor-account.d.ts +6 -0
- package/dist/channels/origin/cursor-account.d.ts.map +1 -1
- package/dist/channels/origin/cursor-account.js +17 -0
- package/dist/channels/slack/api.d.ts +18 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +31 -0
- package/dist/channels/slack/approvals.d.ts +19 -2
- package/dist/channels/slack/approvals.d.ts.map +1 -1
- package/dist/channels/slack/approvals.js +90 -19
- package/dist/channels/slack/attachments.d.ts +7 -2
- package/dist/channels/slack/attachments.d.ts.map +1 -1
- package/dist/channels/slack/attachments.js +318 -156
- package/dist/channels/slack/connect-card.d.ts +16 -0
- package/dist/channels/slack/connect-card.d.ts.map +1 -0
- package/dist/channels/slack/connect-card.js +31 -0
- package/dist/channels/slack/credentials.d.ts +10 -2
- package/dist/channels/slack/credentials.d.ts.map +1 -1
- package/dist/channels/slack/credentials.js +17 -15
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +18 -9
- package/dist/channels/slack/dispatch.d.ts +1 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +19 -3
- package/dist/channels/slack/inbound.d.ts +8 -2
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +25 -4
- package/dist/channels/slack/index.d.ts +3 -2
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +3 -2
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +2 -1
- package/dist/channels/slack/mentions.d.ts +28 -0
- package/dist/channels/slack/mentions.d.ts.map +1 -0
- package/dist/channels/slack/mentions.js +178 -0
- package/dist/channels/slack/setup.js +1 -1
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +46 -3
- package/dist/channels/slack/stop.d.ts.map +1 -1
- package/dist/channels/slack/stop.js +7 -1
- package/dist/channels/slack/thread-context.d.ts +3 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -1
- package/dist/channels/slack/thread-context.js +17 -7
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
- package/dist/channels/slack/tool-approval-events.js +55 -2
- package/dist/channels/slack/types.d.ts +2 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/teams/activity.d.ts +33 -0
- package/dist/channels/teams/activity.d.ts.map +1 -0
- package/dist/channels/teams/activity.js +213 -0
- package/dist/channels/teams/auth.d.ts +25 -0
- package/dist/channels/teams/auth.d.ts.map +1 -0
- package/dist/channels/teams/auth.js +55 -0
- package/dist/channels/teams/bot-framework-auth.d.ts +33 -0
- package/dist/channels/teams/bot-framework-auth.d.ts.map +1 -0
- package/dist/channels/teams/bot-framework-auth.js +154 -0
- package/dist/channels/teams/cards.d.ts +23 -0
- package/dist/channels/teams/cards.d.ts.map +1 -0
- package/dist/channels/teams/cards.js +107 -0
- package/dist/channels/teams/connector.d.ts +48 -0
- package/dist/channels/teams/connector.d.ts.map +1 -0
- package/dist/channels/teams/connector.js +159 -0
- package/dist/channels/teams/credentials.d.ts +65 -0
- package/dist/channels/teams/credentials.d.ts.map +1 -0
- package/dist/channels/teams/credentials.js +84 -0
- package/dist/channels/teams/delivery.d.ts +14 -0
- package/dist/channels/teams/delivery.d.ts.map +1 -0
- package/dist/channels/teams/delivery.js +169 -0
- package/dist/channels/teams/dispatch.d.ts +45 -0
- package/dist/channels/teams/dispatch.d.ts.map +1 -0
- package/dist/channels/teams/dispatch.js +402 -0
- package/dist/channels/teams/engagement.d.ts +32 -0
- package/dist/channels/teams/engagement.d.ts.map +1 -0
- package/dist/channels/teams/engagement.js +120 -0
- package/dist/channels/teams/index.d.ts +21 -0
- package/dist/channels/teams/index.d.ts.map +1 -0
- package/dist/channels/teams/index.js +19 -0
- package/dist/channels/teams/marks.d.ts +19 -0
- package/dist/channels/teams/marks.d.ts.map +1 -0
- package/dist/channels/teams/marks.js +96 -0
- package/dist/channels/teams/senders.d.ts +27 -0
- package/dist/channels/teams/senders.d.ts.map +1 -0
- package/dist/channels/teams/senders.js +72 -0
- package/dist/channels/teams/teams-channel.d.ts +43 -0
- package/dist/channels/teams/teams-channel.d.ts.map +1 -0
- package/dist/channels/teams/teams-channel.js +278 -0
- package/dist/channels/teams/text.d.ts +7 -0
- package/dist/channels/teams/text.d.ts.map +1 -0
- package/dist/channels/teams/text.js +63 -0
- package/dist/channels/teams/types.d.ts +306 -0
- package/dist/channels/teams/types.d.ts.map +1 -0
- package/dist/channels/teams/types.js +1 -0
- package/dist/channels.d.ts +31 -0
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +37 -0
- package/dist/connections.d.ts +1 -1
- package/dist/connections.d.ts.map +1 -1
- package/dist/docs/404.html +3 -3
- package/dist/docs/assets/{app.lt-BYgI2.js → app.CpLKJnOA.js} +4 -4
- package/dist/docs/assets/changelog.md.DoOgjnPC.js +1 -0
- package/dist/docs/assets/{changelog.md.DVNB-ApU.lean.js → changelog.md.DoOgjnPC.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BJ_1eI6D.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.v_dV4U2Q.js → VPLocalSearchBox.Cr1HJ_9k.js} +2 -2
- package/dist/docs/assets/chunks/{arc.5o92kOg5.js → arc.BjpgGAMM.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.C-oTwnNq.js → architectureDiagram-Q4EWVU46.CKdhNPPk.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.zJ-VNOib.js → baseUniq.iovoEQbg.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.B9ZJZuPd.js → blockDiagram-DXYQGD6D.BYQIeDre.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.BBMwSIaN.js → c4Diagram-AHTNJAMY.gbWi2q8N.js} +1 -1
- package/dist/docs/assets/chunks/channel.BP0n324b.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.D8qAJpDD.js → chunk-4BX2VUAB.1Mem4UG9.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.B8QR5cdE.js → chunk-4TB4RGXK.Dn3H-X_H.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.BsWxVuew.js → chunk-55IACEB6.BkpSDZwX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BeGygY_i.js → chunk-EDXVE4YY.BScqy1zP.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DdwgH-ZH.js → chunk-FMBD7UC4.Cp394LWf.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.B9zC_ALe.js → chunk-OYMX7WX6.BDv9LhoL.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BIxJ0rcL.js → chunk-QZHKN3VN.CsgCcrKO.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.qiM_23_f.js → chunk-YZCP3GAM.BKBpIC5O.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BhTtyWMA.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BhTtyWMA.js +1 -0
- package/dist/docs/assets/chunks/clone.BVK2rFqj.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.BKB971D5.js → cose-bilkent-S5V4N54A.Bs3ZS9PC.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.CcILjJgp.js → dagre-KV5264BT.CgWi0tY2.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DkY9A0nu.js → diagram-5BDNPKRD.rn6qIo9N.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BbdzmjMt.js → diagram-G4DWMVQ6.ChhW8oww.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.Be0zy1cM.js → diagram-MMDJMWI5.C0wH5KSk.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.zOiEycLe.js → diagram-TYMM5635.CNEcrwA0.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DUd_9HMF.js → erDiagram-SMLLAGMA.DCsnKO-7.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.2KPYoZBO.js → flowDiagram-DWJPFMVM.WCMkfvP0.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.DqE8_YpP.js → ganttDiagram-T4ZO3ILL.BUb1Sxfr.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CO0Tk47h.js → gitGraphDiagram-UUTBAWPF._kORbCzm.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CNe5KbNy.js → graph.PrGRm4KW.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.BBhJ1X1B.js → infoDiagram-42DDH7IO.BxhCjiQM.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.KSIw9w3I.js → ishikawaDiagram-UXIWVN3A.5ddTis2y.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BN2Y5oUJ.js → journeyDiagram-VCZTEJTY.BUStU27-.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.2KFuDYn_.js → kanban-definition-6JOO6SKY.CJd1psl3.js} +1 -1
- package/dist/docs/assets/chunks/{layout.Demb_pzL.js → layout.DqvbZSML.js} +1 -1
- package/dist/docs/assets/chunks/{linear.kYKxzbbR.js → linear.DOmz-1UB.js} +1 -1
- package/dist/docs/assets/chunks/{min.DwmCN5dF.js → min.33k2v8dM.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.CGlz01QG.js → mindmap-definition-QFDTVHPH.iISCqCXC.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.n3qsq4nA.js → pieDiagram-DEJITSTG.BHvVgzmD.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CGNJ1GSb.js → quadrantDiagram-34T5L4WZ.CY3w_-Cn.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.VhAzHDwQ.js → requirementDiagram-MS252O5E.CHXKQS1v.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DmHA5pW-.js → sankeyDiagram-XADWPNL6.DTtRoGss.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23._TC1aKhg.js → sequenceDiagram-FGHM5R23.NnPcQ3eY.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.B-kLjV3O.js → stateDiagram-FHFEXIEX.D8DFciH7.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ESAwmMws.js +1 -0
- package/dist/docs/assets/chunks/{theme.BaVlHHL-.js → theme.CwkiT-Fo.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CresbphV.js → timeline-definition-GMOUNBTQ._wIWkMU6.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.CegHD8Y4.js → vennDiagram-DHZGUBPP.NLVv7R6r.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.DjCmZrUO.js → wardley-RL74JXVD.DbsCXUZp.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.BJ7s1zdZ.js → wardleyDiagram-NUSXRM2D.Dp5uAVDl.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.IrEXlemI.js → xychartDiagram-5P7HB3ND.eOEBq4rX.js} +1 -1
- package/dist/docs/assets/{deployment.md.DJtuDVLh.js → deployment.md.CIRydNl3.js} +3 -3
- package/dist/docs/assets/{deployment.md.DJtuDVLh.lean.js → deployment.md.CIRydNl3.lean.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.BdWqmUGb.js +14 -0
- package/dist/docs/assets/{guides_cloud-agents.md.CiXAW6on.lean.js → guides_cloud-agents.md.BdWqmUGb.lean.js} +1 -1
- package/dist/docs/assets/guides_teams.md.7Lz2sbqB.js +50 -0
- package/dist/docs/assets/guides_teams.md.7Lz2sbqB.lean.js +1 -0
- package/dist/docs/assets/guides_workload-identity.md.DBV6YkXX.js +82 -0
- package/dist/docs/assets/guides_workload-identity.md.DBV6YkXX.lean.js +1 -0
- package/dist/docs/assets/{reference_agent-config.md.Bbqf0lgS.js → reference_agent-config.md.CfM1S6Ac.js} +2 -2
- package/dist/docs/assets/{reference_agent-config.md.Bbqf0lgS.lean.js → reference_agent-config.md.CfM1S6Ac.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.CPWOpdsC.js → reference_channels.md.CRvqgU0n.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.DHm6DmYk.js → reference_cli.md.NS6U5a-7.js} +14 -4
- package/dist/docs/assets/{reference_cli.md.DHm6DmYk.lean.js → reference_cli.md.NS6U5a-7.lean.js} +1 -1
- package/dist/docs/assets/{reference_limits.md.CbdtFr4T.js → reference_limits.md.CW9PTdxr.js} +3 -3
- package/dist/docs/assets/{reference_limits.md.CbdtFr4T.lean.js → reference_limits.md.CW9PTdxr.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.RhQ9ZLo1.js → reference_schedules.md.Dd8_d0WG.js} +3 -3
- package/dist/docs/assets/{reference_sessions.md.NXVQt9mP.js → reference_sessions.md.CoCyQLEz.js} +2 -2
- package/dist/docs/assets/{reference_sessions.md.NXVQt9mP.lean.js → reference_sessions.md.CoCyQLEz.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.DzCPNPkG.js → reference_skills.md.SFRZDC41.js} +4 -4
- package/dist/docs/assets/{reference_skills.md.DzCPNPkG.lean.js → reference_skills.md.SFRZDC41.lean.js} +1 -1
- package/dist/docs/assets/{style.DK0YX1WL.css → style.B7zPxANR.css} +1 -1
- package/dist/docs/assets/troubleshooting.md.CsQTleto.js +3 -0
- package/dist/docs/assets/{troubleshooting.md.DfKKvW1R.lean.js → troubleshooting.md.CsQTleto.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +37 -37
- package/dist/docs/changelog.html +37 -37
- package/dist/docs/changelog.md +43 -0
- package/dist/docs/deployment.html +40 -40
- package/dist/docs/deployment.md +14 -0
- package/dist/docs/evals.html +37 -37
- package/dist/docs/guides/agent-to-agent.html +37 -37
- package/dist/docs/guides/bitbucket.html +37 -37
- package/dist/docs/guides/cloud-agents.html +43 -38
- package/dist/docs/guides/cloud-agents.md +47 -0
- package/dist/docs/guides/convert-automation.html +37 -37
- package/dist/docs/guides/github.html +37 -37
- package/dist/docs/guides/gitlab.html +37 -37
- package/dist/docs/guides/improve.html +37 -37
- package/dist/docs/guides/jev.html +37 -37
- package/dist/docs/guides/mcp-oauth.html +37 -37
- package/dist/docs/guides/migrate.html +37 -37
- package/dist/docs/guides/opentelemetry.html +37 -37
- package/dist/docs/guides/pagerduty.html +37 -37
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/teams.html +109 -0
- package/dist/docs/guides/teams.md +384 -0
- package/dist/docs/guides/webhooks.html +37 -37
- package/dist/docs/guides/workload-identity.html +141 -0
- package/dist/docs/guides/workload-identity.md +227 -0
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +37 -37
- package/dist/docs/index.html +37 -37
- package/dist/docs/llms-full.txt +881 -5
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +37 -37
- package/dist/docs/reference/access.html +36 -36
- package/dist/docs/reference/agent-config.html +39 -39
- package/dist/docs/reference/agent-config.md +1 -1
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/channels.html +38 -38
- package/dist/docs/reference/channels.md +1 -0
- package/dist/docs/reference/cli.html +50 -40
- package/dist/docs/reference/cli.md +116 -0
- package/dist/docs/reference/connections.html +37 -37
- package/dist/docs/reference/evals.html +37 -37
- package/dist/docs/reference/extensions.html +37 -37
- package/dist/docs/reference/hooks.html +37 -37
- package/dist/docs/reference/http-api.html +37 -37
- package/dist/docs/reference/instructions.html +37 -37
- package/dist/docs/reference/limits.html +39 -39
- package/dist/docs/reference/limits.md +4 -4
- package/dist/docs/reference/memory.html +37 -37
- package/dist/docs/reference/playground.html +36 -36
- package/dist/docs/reference/project-layout.html +37 -37
- package/dist/docs/reference/schedules.html +40 -40
- package/dist/docs/reference/sessions.html +38 -38
- package/dist/docs/reference/sessions.md +13 -0
- package/dist/docs/reference/skills.html +40 -40
- package/dist/docs/reference/subagents.html +37 -37
- package/dist/docs/reference/tools.html +37 -37
- package/dist/docs/templates/agentic-owners.html +37 -37
- package/dist/docs/templates/reviews.html +37 -37
- package/dist/docs/troubleshooting.html +38 -38
- package/dist/docs/troubleshooting.md +21 -0
- package/dist/evals/run-facts.d.ts.map +1 -1
- package/dist/evals/run-facts.js +4 -0
- package/dist/extensions/cursor-cloud-agents/channels/cursor-cloud-agents.d.ts +12 -0
- package/dist/extensions/cursor-cloud-agents/channels/cursor-cloud-agents.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/channels/cursor-cloud-agents.js +42 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +10 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +3 -2
- package/dist/extensions/cursor-cloud-agents/lib/agent-id.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/agent-id.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/agent-id.js +10 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +57 -3
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +150 -35
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +32 -4
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +93 -7
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +24 -7
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +158 -25
- package/dist/extensions/cursor-cloud-agents/lib/stop-signal.d.ts +18 -0
- package/dist/extensions/cursor-cloud-agents/lib/stop-signal.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/stop-signal.js +27 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +2 -3
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts +26 -12
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/watch.js +115 -46
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts +16 -5
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +76 -20
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +2 -2
- package/dist/extensions/cursor-cloud-agents/tools/get.js +2 -2
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +1 -1
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +18 -3
- package/dist/files-backends/agent-store-presigned-url.js +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/approval-gate.d.ts +6 -1
- package/dist/internal/approval-gate.d.ts.map +1 -1
- package/dist/internal/approval-gate.js +13 -2
- package/dist/internal/authored-loaders.js +1 -1
- package/dist/internal/channel-architecture.d.ts.map +1 -1
- package/dist/internal/channel-architecture.js +3 -1
- package/dist/internal/cli/commands/channels.d.ts +9 -3
- package/dist/internal/cli/commands/channels.d.ts.map +1 -1
- package/dist/internal/cli/commands/channels.js +193 -4
- package/dist/internal/cli/commands/index.d.ts.map +1 -1
- package/dist/internal/cli/commands/index.js +6 -1
- package/dist/internal/cli/commands/serve.d.ts.map +1 -1
- package/dist/internal/cli/commands/serve.js +25 -5
- package/dist/internal/cli/dispatch.d.ts.map +1 -1
- package/dist/internal/cli/dispatch.js +22 -8
- package/dist/internal/cli/flags.d.ts +14 -0
- package/dist/internal/cli/flags.d.ts.map +1 -1
- package/dist/internal/cli/flags.js +14 -0
- package/dist/internal/cli/help.d.ts.map +1 -1
- package/dist/internal/cli/help.js +3 -1
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +6 -3
- package/dist/internal/cli-cursor.js +2 -2
- package/dist/internal/cli-deploy.d.ts +1 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +19 -1
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +5 -3
- package/dist/internal/cli-teams-doctor.d.ts +39 -0
- package/dist/internal/cli-teams-doctor.d.ts.map +1 -0
- package/dist/internal/cli-teams-doctor.js +508 -0
- package/dist/internal/cli-teams-forward.d.ts +84 -0
- package/dist/internal/cli-teams-forward.d.ts.map +1 -0
- package/dist/internal/cli-teams-forward.js +386 -0
- package/dist/internal/cli-teams-package.d.ts +26 -0
- package/dist/internal/cli-teams-package.d.ts.map +1 -0
- package/dist/internal/cli-teams-package.js +123 -0
- package/dist/internal/cli-teams.d.ts +15 -0
- package/dist/internal/cli-teams.d.ts.map +1 -0
- package/dist/internal/cli-teams.js +253 -0
- package/dist/internal/connect-click.d.ts +12 -0
- package/dist/internal/connect-click.d.ts.map +1 -0
- package/dist/internal/connect-click.js +22 -0
- package/dist/internal/continuation-channel.d.ts +5 -1
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +34 -0
- package/dist/internal/continuation-identity.d.ts +7 -4
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +66 -1
- package/dist/internal/convert-automation/convert-workflow.js +2 -2
- package/dist/internal/credential-env-names.d.ts +36 -0
- package/dist/internal/credential-env-names.d.ts.map +1 -0
- package/dist/internal/credential-env-names.js +68 -0
- package/dist/internal/cursor/account-mcp.d.ts +67 -9
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +206 -25
- package/dist/internal/cursor/backend-client.d.ts +10 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +19 -7
- package/dist/internal/cursor/cloud-agent-identity.d.ts +81 -0
- package/dist/internal/cursor/cloud-agent-identity.d.ts.map +1 -0
- package/dist/internal/cursor/cloud-agent-identity.js +224 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +3 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts +8 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +22 -6
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +34 -2
- package/dist/internal/deploy-manifest.d.ts +51 -3
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +96 -7
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +6 -1
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +2 -1
- package/dist/internal/discovery/connections.d.ts +5 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +71 -1
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +2 -0
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +4 -0
- package/dist/internal/env-file.d.ts +1 -0
- package/dist/internal/env-file.d.ts.map +1 -1
- package/dist/internal/env-file.js +18 -17
- package/dist/internal/env-prefix.d.ts +11 -0
- package/dist/internal/env-prefix.d.ts.map +1 -0
- package/dist/internal/env-prefix.js +23 -0
- package/dist/internal/event-id-dedupe.d.ts +12 -0
- package/dist/internal/event-id-dedupe.d.ts.map +1 -0
- package/dist/{channels/slack → internal}/event-id-dedupe.js +7 -4
- package/dist/internal/event-mapper.d.ts +7 -2
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +7 -0
- package/dist/internal/expected-delivery-failure.d.ts.map +1 -1
- package/dist/internal/expected-delivery-failure.js +3 -0
- package/dist/internal/extension-namespace.d.ts +9 -0
- package/dist/internal/extension-namespace.d.ts.map +1 -0
- package/dist/internal/extension-namespace.js +14 -0
- package/dist/internal/guid.d.ts +2 -0
- package/dist/internal/guid.d.ts.map +1 -0
- package/dist/internal/guid.js +4 -0
- package/dist/internal/host-kv-cas.d.ts +13 -0
- package/dist/internal/host-kv-cas.d.ts.map +1 -0
- package/dist/internal/host-kv-cas.js +26 -0
- package/dist/internal/host-kv.d.ts +4 -1
- package/dist/internal/host-kv.d.ts.map +1 -1
- package/dist/internal/host-kv.js +15 -2
- package/dist/internal/hosted-catch-protocol.d.ts +5 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-catch-protocol.js +5 -0
- package/dist/internal/hosted-catch.d.ts +2 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -1
- package/dist/internal/hosted-catch.js +6 -1
- package/dist/internal/hosted-delivery-protocol.d.ts +4 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +73 -3
- package/dist/internal/hosted-delivery.d.ts +9 -3
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +14 -3
- package/dist/internal/hosted-session-fixture.js +1 -1
- package/dist/internal/hosting.d.ts +5 -0
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +7 -1
- package/dist/internal/ids.d.ts +2 -0
- package/dist/internal/ids.d.ts.map +1 -1
- package/dist/internal/ids.js +5 -0
- package/dist/internal/install-cursor-skills.d.ts +6 -7
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +15 -9
- package/dist/internal/interview/agent-questions.d.ts +1 -1
- package/dist/internal/interview/agent-questions.d.ts.map +1 -1
- package/dist/internal/interview/agent-questions.js +4 -3
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +24 -0
- package/dist/internal/mcp-allowlist-in-use.d.ts +23 -0
- package/dist/internal/mcp-allowlist-in-use.d.ts.map +1 -0
- package/dist/internal/mcp-allowlist-in-use.js +93 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +8 -10
- package/dist/internal/mcp-host.d.ts +19 -1
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +67 -3
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +5 -7
- package/dist/internal/oidcAudiences.d.ts +22 -0
- package/dist/internal/oidcAudiences.d.ts.map +1 -0
- package/dist/internal/oidcAudiences.js +35 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +2 -0
- package/dist/internal/platform-timers.d.ts +2 -0
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +14 -0
- package/dist/internal/private-file.d.ts +32 -1
- package/dist/internal/private-file.d.ts.map +1 -1
- package/dist/internal/private-file.js +209 -7
- package/dist/internal/redact-values.d.ts +3 -0
- package/dist/internal/redact-values.d.ts.map +1 -0
- package/dist/internal/redact-values.js +19 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +7 -1
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
- package/dist/internal/reminder-followup-error.d.ts +23 -0
- package/dist/internal/reminder-followup-error.d.ts.map +1 -0
- package/dist/internal/reminder-followup-error.js +12 -0
- package/dist/internal/reminder-runner.d.ts +15 -1
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +95 -21
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +23 -3
- package/dist/internal/run-client.js +2 -1
- package/dist/internal/run-program.d.ts +31 -0
- package/dist/internal/run-program.d.ts.map +1 -0
- package/dist/internal/run-program.js +150 -0
- package/dist/internal/schedule-runner.d.ts +1 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -1
- package/dist/internal/schedule-runner.js +10 -1
- package/dist/internal/sdk-runner.d.ts +28 -2
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +298 -38
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +53 -8
- package/dist/internal/session-credential.d.ts +14 -0
- package/dist/internal/session-credential.d.ts.map +1 -0
- package/dist/internal/session-credential.js +25 -0
- package/dist/internal/session-engine.d.ts +140 -6
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +583 -93
- package/dist/internal/storage-coordinator.d.ts +3 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +13 -0
- package/dist/internal/storage-roles.d.ts +9 -1
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/teams-channel-profile.d.ts +41 -0
- package/dist/internal/teams-channel-profile.d.ts.map +1 -0
- package/dist/internal/teams-channel-profile.js +91 -0
- package/dist/internal/teams-devtunnel.d.ts +55 -0
- package/dist/internal/teams-devtunnel.d.ts.map +1 -0
- package/dist/internal/teams-devtunnel.js +205 -0
- package/dist/internal/teams-tunnel-proxy.d.ts +17 -0
- package/dist/internal/teams-tunnel-proxy.d.ts.map +1 -0
- package/dist/internal/teams-tunnel-proxy.js +100 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts +7 -1
- package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -1
- package/dist/internal/testing/conversation-identity-vectors.js +67 -0
- package/dist/internal/testing/hosted-http.d.ts +15 -0
- package/dist/internal/testing/hosted-http.d.ts.map +1 -0
- package/dist/internal/testing/hosted-http.js +86 -0
- package/dist/internal/testing/teams-activity-fixtures.d.ts +28 -0
- package/dist/internal/testing/teams-activity-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/teams-activity-fixtures.js +236 -0
- package/dist/internal/testing/teams-doctor-fixtures.d.ts +76 -0
- package/dist/internal/testing/teams-doctor-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/teams-doctor-fixtures.js +216 -0
- package/dist/internal/tunnel-process.d.ts +29 -0
- package/dist/internal/tunnel-process.d.ts.map +1 -0
- package/dist/internal/tunnel-process.js +105 -0
- package/dist/internal/turn-context.d.ts +28 -0
- package/dist/internal/turn-context.d.ts.map +1 -0
- package/dist/internal/turn-context.js +1 -0
- package/dist/oidc-token.d.ts +131 -0
- package/dist/oidc-token.d.ts.map +1 -0
- package/dist/oidc-token.js +221 -0
- package/dist/playground/assets/chunk-YOKDWASO-BPO_8GRX.js +115 -0
- package/dist/playground/assets/highlighted-body-KPVGNVTW-CxEV-T_f.js +1 -0
- package/dist/playground/assets/index-CjFJhCtb.js +62 -0
- package/dist/playground/assets/index-vwUVwmk8.css +1 -0
- package/dist/playground/assets/mermaid-HWGCJPDP-eK-fpbFn.js +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/teams-app-package.d.ts +78 -0
- package/dist/teams-app-package.d.ts.map +1 -0
- package/dist/teams-app-package.js +204 -0
- package/dist/tools.d.ts +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +271 -2
- package/dist/types.d.ts.map +1 -1
- package/docs/changelog.md +43 -0
- package/docs/deployment.md +14 -0
- package/docs/guides/cloud-agents.md +47 -0
- package/docs/guides/teams.md +389 -0
- package/docs/guides/workload-identity.md +232 -0
- package/docs/reference/agent-config.md +1 -1
- package/docs/reference/channels.md +1 -0
- package/docs/reference/cli.md +116 -0
- package/docs/reference/limits.md +4 -4
- package/docs/reference/sessions.md +13 -0
- package/docs/troubleshooting.md +21 -0
- package/package.json +23 -46
- package/skills/create-agent/SKILL.md +17 -4
- package/skills/debug/SKILL.md +1 -0
- package/skills/deploy/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +1 -0
- package/skills/setup-teams/SKILL.md +141 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +1 -0
- package/dist/channels/slack/event-id-dedupe.d.ts +0 -10
- package/dist/channels/slack/event-id-dedupe.d.ts.map +0 -1
- package/dist/docs/assets/changelog.md.DVNB-ApU.js +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DdlR-9Oe.js +0 -1
- package/dist/docs/assets/chunks/channel.CdyTxaXV.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CeUcN6TW.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CeUcN6TW.js +0 -1
- package/dist/docs/assets/chunks/clone.DpIwUbur.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.HtBkUH4J.js +0 -1
- package/dist/docs/assets/guides_cloud-agents.md.CiXAW6on.js +0 -9
- package/dist/docs/assets/troubleshooting.md.DfKKvW1R.js +0 -3
- package/dist/playground/assets/index-CnFd5R1_.js +0 -62
- package/dist/playground/assets/index-DNzRv6G8.css +0 -1
- /package/dist/docs/assets/{reference_channels.md.CPWOpdsC.lean.js → reference_channels.md.CRvqgU0n.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.RhQ9ZLo1.lean.js → reference_schedules.md.Dd8_d0WG.lean.js} +0 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Microsoft Teams"
|
|
3
|
+
description: "Answer mentions, personal chats, and watched channel posts in Microsoft Teams with your own Azure Bot."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Microsoft Teams agents
|
|
7
|
+
|
|
8
|
+
A Teams agent wakes when someone @mentions it in a channel or group chat,
|
|
9
|
+
messages it in a personal chat, or posts in a channel it watches. It
|
|
10
|
+
answers in the same reply chain. `teamsChannel()` takes the same engagement options as
|
|
11
|
+
`slackChannel()`, so an agent that already runs in Slack can run in Teams
|
|
12
|
+
with the same shape of config.
|
|
13
|
+
|
|
14
|
+
The agent answers as an Azure Bot that you register and own. Teams sends
|
|
15
|
+
each message to the bot's messaging endpoint, and the channel checks the
|
|
16
|
+
Bot Framework token on every request before it starts a turn.
|
|
17
|
+
|
|
18
|
+
## Set up with the CLI
|
|
19
|
+
|
|
20
|
+
The `agent-sdk channels teams` commands do every step except the clicks in
|
|
21
|
+
the Azure portal and in Teams:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
agent-sdk channels teams setup
|
|
25
|
+
printf %s "$CLIENT_SECRET" | agent-sdk channels teams init --dir ./helm \
|
|
26
|
+
--app-id <microsoft-app-id> --tenant-id <app-tenant-id>
|
|
27
|
+
agent-sdk channels teams package --dir ./helm
|
|
28
|
+
agent-sdk dev ./helm
|
|
29
|
+
agent-sdk channels teams doctor --dir ./helm --endpoint <printed URL>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
1. `setup` prints the Azure portal steps in
|
|
33
|
+
[Register the Azure Bot](#register-the-azure-bot).
|
|
34
|
+
2. `init` writes `bot/channels/teams.ts` and puts the app id, the client
|
|
35
|
+
secret, and the tenant id in `.env.local`. It reads the secret from a
|
|
36
|
+
hidden prompt or stdin, never from an argument.
|
|
37
|
+
3. `package` writes `helm-teams-app.zip`. Upload it in Teams, as
|
|
38
|
+
[Install the bot in Teams](#install-the-bot-in-teams) describes.
|
|
39
|
+
4. `dev` opens a tunnel and prints the messaging endpoint. Set it on the
|
|
40
|
+
Azure Bot.
|
|
41
|
+
5. `doctor` checks the env names, the token, the Azure Bot, and the
|
|
42
|
+
endpoint, and names the part that fails.
|
|
43
|
+
|
|
44
|
+
The [CLI reference](../reference/cli.md#teams) lists every flag. The rest of
|
|
45
|
+
this guide explains what the commands write and how the channel behaves.
|
|
46
|
+
|
|
47
|
+
## Answer a mention or personal chat
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// bot/channels/teams.ts
|
|
51
|
+
import { teamsChannel } from "@grok/agent-sdk/channels/teams";
|
|
52
|
+
|
|
53
|
+
export default teamsChannel();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
By default the agent answers @mentions in channels and group chats, and
|
|
57
|
+
every message in a personal chat. While a turn runs, Teams shows the
|
|
58
|
+
typing indicator, and the reply arrives as one message in the reply chain.
|
|
59
|
+
In a channel, each reply chain is its own conversation. A personal chat
|
|
60
|
+
and a group chat have no reply chains, so each one is a single
|
|
61
|
+
conversation.
|
|
62
|
+
|
|
63
|
+
The channel reads three variables:
|
|
64
|
+
|
|
65
|
+
| Variable | Value |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `TEAMS_APP_ID` | The Azure Bot's Microsoft App ID |
|
|
68
|
+
| `TEAMS_APP_PASSWORD` | A client secret of that app registration |
|
|
69
|
+
| `TEAMS_TENANT_ID` | Required. The home tenant of your single-tenant Azure Bot |
|
|
70
|
+
|
|
71
|
+
The Azure Bot is a single-tenant bot in your own tenant, because Azure
|
|
72
|
+
does not create new multi-tenant bots after July 31, 2025. The channel
|
|
73
|
+
mints its Bot Connector token in that tenant and ignores activities from
|
|
74
|
+
any other tenant. To run several
|
|
75
|
+
agents in one `agent-sdk dev`, give each its own bot and an `envPrefix`.
|
|
76
|
+
`channels teams init --prefix HELPDESK` writes it for you. The prefix
|
|
77
|
+
starts with a letter.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
export default teamsChannel({ envPrefix: "HELPDESK" });
|
|
81
|
+
// HELPDESK_TEAMS_APP_ID, HELPDESK_TEAMS_APP_PASSWORD, HELPDESK_TEAMS_TENANT_ID
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The channel file owns these names. When the file exists, `init` writes the
|
|
85
|
+
names it reads, and `doctor` and `package` read them from the loaded
|
|
86
|
+
channel.
|
|
87
|
+
|
|
88
|
+
## Register the Azure Bot
|
|
89
|
+
|
|
90
|
+
1. In the Azure portal, create an **Azure Bot** resource. Set **Type of
|
|
91
|
+
App** to **Single Tenant** and **Creation type** to **Create new
|
|
92
|
+
Microsoft App ID**.
|
|
93
|
+
2. Open the bot's **Configuration** page. Copy **Microsoft App ID** and
|
|
94
|
+
**App Tenant ID**. `init` takes them as `--app-id` and `--tenant-id`.
|
|
95
|
+
3. From **Configuration**, open **Manage Password**, add a client secret,
|
|
96
|
+
and copy its value. Azure shows the value once. `init` reads it from
|
|
97
|
+
the hidden prompt or stdin.
|
|
98
|
+
4. Under **Channels**, add **Microsoft Teams**.
|
|
99
|
+
5. Set **Messaging endpoint** to the URL in
|
|
100
|
+
[Messaging endpoint](#messaging-endpoint), or for a hosted deploy, the
|
|
101
|
+
URL in [Deploy](#deploy).
|
|
102
|
+
|
|
103
|
+
## Install the bot in Teams
|
|
104
|
+
|
|
105
|
+
Teams installs a bot from an app package: a zip of `manifest.json` and two
|
|
106
|
+
icons. `agent-sdk channels teams package` builds it from the channel. The
|
|
107
|
+
`bots` entry names the Azure Bot by its app ID and the places people can
|
|
108
|
+
talk to it:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"id": "<TEAMS_APP_ID>",
|
|
113
|
+
"bots": [
|
|
114
|
+
{
|
|
115
|
+
"botId": "<TEAMS_APP_ID>",
|
|
116
|
+
"scopes": ["personal", "team", "groupChat"],
|
|
117
|
+
"isNotificationOnly": false
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
A full manifest also needs `manifestVersion`, `version`, `developer`,
|
|
124
|
+
`name`, `description`, `icons`, and `accentColor`; see the
|
|
125
|
+
[app manifest schema](https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema).
|
|
126
|
+
Upload the package in Teams under **Apps** > **Manage your apps** >
|
|
127
|
+
**Upload an app**, or have a Teams admin publish it to your organization
|
|
128
|
+
in the Teams admin center. Then add the app to a team, a group chat, or a
|
|
129
|
+
personal chat.
|
|
130
|
+
|
|
131
|
+
## Wake on a channel post
|
|
132
|
+
|
|
133
|
+
Teams sends a channel post without a mention only to an app that holds
|
|
134
|
+
the resource-specific consent permission `ChannelMessage.Read.Group`.
|
|
135
|
+
`package` adds it when the channel sets `engagement.channelPosts`, and a
|
|
136
|
+
team owner grants it when they add the app to the team:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"webApplicationInfo": { "id": "<TEAMS_APP_ID>" },
|
|
141
|
+
"authorization": {
|
|
142
|
+
"permissions": {
|
|
143
|
+
"resourceSpecific": [{ "name": "ChannelMessage.Read.Group", "type": "Application" }]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Then name the channels to watch. Copy a channel's ID from its **Get link
|
|
150
|
+
to channel** URL: it's the `19:…@thread.tacv2` part.
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
export default teamsChannel({
|
|
154
|
+
engagement: {
|
|
155
|
+
channelPosts: {
|
|
156
|
+
allow: ["19:4b7c2f9e1d6a4e8f9a3b5c7d1e2f3a4b@thread.tacv2"],
|
|
157
|
+
posts: "all",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Watched posts go to `onChannelPost` when you set it, the same way
|
|
164
|
+
mentions go to `onAppMention` and personal chats to `onDirectMessage`.
|
|
165
|
+
Return `null` from a hook to skip a message. `posts` is `"top-level"` (the
|
|
166
|
+
default), `"replies"`, or `"all"`. Use
|
|
167
|
+
`allow: ["*"]` to watch every channel the app is in, and
|
|
168
|
+
`replies: "joined"` to also answer replies in any reply chain the agent
|
|
169
|
+
already answered. Bot posts stay out unless you set `includeBotPosts: true`;
|
|
170
|
+
the agent's own posts never start a turn.
|
|
171
|
+
|
|
172
|
+
To let another bot wake the agent with an @mention, list it in
|
|
173
|
+
`engagement.botMentions.allowFrom` as `28:<its app ID>`. Each thread allows
|
|
174
|
+
5 bot wakes an hour and 20 in total by default
|
|
175
|
+
(`maxPerThreadPerHour`, `maxPerThreadTotal`).
|
|
176
|
+
|
|
177
|
+
## Stream the reply
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
export default teamsChannel({ reply: { mode: "stream" } });
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
In stream mode the agent posts one message as soon as it starts working.
|
|
184
|
+
That message names the tool the agent is running until text arrives, then
|
|
185
|
+
fills in as the reply grows, and it ends as the final answer. Teams limits
|
|
186
|
+
how often a bot can edit a message, so the channel edits at most once
|
|
187
|
+
every 1.5 seconds; set `updateIntervalMs` to change that.
|
|
188
|
+
|
|
189
|
+
## Approve tool calls in Teams
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
export default teamsChannel({ toolApprovals: true });
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
When a server tool with `needsApproval` is about to run, the agent posts
|
|
196
|
+
an Adaptive Card in the thread with the tool's arguments, secrets
|
|
197
|
+
redacted, and **Approve** and **Deny** buttons. Anyone who could continue
|
|
198
|
+
the conversation can decide; set `policy: { respondTo: "author" }` to
|
|
199
|
+
limit that, and follow-ups, to the person who started it. After the click,
|
|
200
|
+
the card shows the decision and who made it.
|
|
201
|
+
|
|
202
|
+
For your own cards, handle other `Action.Submit` clicks in
|
|
203
|
+
`onCardAction`, which receives the submitted data and can start a turn in
|
|
204
|
+
the card's thread.
|
|
205
|
+
|
|
206
|
+
## Refuse guests and other tenants
|
|
207
|
+
|
|
208
|
+
By default the channel answers only members and owners of the bot's
|
|
209
|
+
tenant. It asks Teams for the sender's role and tenant. It refuses a
|
|
210
|
+
guest, an anonymous meeting user, or a person from another organization.
|
|
211
|
+
This applies when they message the agent and when they click a card.
|
|
212
|
+
**Approve** and **Deny** are card clicks. A sender with no role is
|
|
213
|
+
refused. A sender Teams does not list is refused too.
|
|
214
|
+
|
|
215
|
+
The agent posts one short reply to a refused sender. It posts at most
|
|
216
|
+
once per conversation and sender per hour. The default text is "I can
|
|
217
|
+
only help members of this organization. Ask the agent owner to allow
|
|
218
|
+
guests."
|
|
219
|
+
|
|
220
|
+
Set `policy.refusalMessage` to change the default text. Set
|
|
221
|
+
`policy.refusalMessage` to `false` to stay silent. Silence applies to a
|
|
222
|
+
refused sender and to a sender the lookup could not verify.
|
|
223
|
+
|
|
224
|
+
A failed lookup gets the reply "I couldn't verify your access, try again
|
|
225
|
+
shortly." The agent does not reply to a card click from a refused sender.
|
|
226
|
+
The agent ignores a card click from a bot, including a bot that
|
|
227
|
+
`engagement.botMentions` allows. The agent does not reply to an activity
|
|
228
|
+
from another tenant.
|
|
229
|
+
|
|
230
|
+
To let guests and external members in, set `blockExternals` to `false`.
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
export default teamsChannel({ policy: { blockExternals: false } });
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
export default teamsChannel({
|
|
238
|
+
policy: {
|
|
239
|
+
refusalMessage: "Ask your team owner to add you to this organization.",
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Welcome message
|
|
245
|
+
|
|
246
|
+
When someone installs the app in a conversation, the agent posts one
|
|
247
|
+
greeting there. Teams reports the install as an `installationUpdate`
|
|
248
|
+
activity whose action is `add`. The greeting does not start a model turn.
|
|
249
|
+
The agent posts it once per conversation.
|
|
250
|
+
|
|
251
|
+
The default text is "Hi! Mention me in a channel, or message me here, to
|
|
252
|
+
get started."
|
|
253
|
+
|
|
254
|
+
Set `welcome` to change the greeting. Set `welcome` to `false` to turn
|
|
255
|
+
it off.
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
export default teamsChannel({
|
|
259
|
+
welcome: "Hi. Mention me when you want help with a laptop.",
|
|
260
|
+
});
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Messaging endpoint
|
|
264
|
+
|
|
265
|
+
Under `agent-sdk dev` or self-hosted `agent-sdk serve`, the Azure Bot's
|
|
266
|
+
messaging endpoint is the server's public origin plus the channel's path:
|
|
267
|
+
|
|
268
|
+
```text
|
|
269
|
+
https://<origin>/<slug>/v1/channels/<channel>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
`<slug>` is the agent's slug and `<channel>` is the channel file's name, so
|
|
273
|
+
`bot/channels/teams.ts` in the `helm` agent answers at
|
|
274
|
+
`https://<origin>/helm/v1/channels/teams`. The URL has no trailing slash.
|
|
275
|
+
With `teamsChannel({ path: "/messages" })`, the channel appends that path:
|
|
276
|
+
`https://<origin>/helm/v1/channels/teams/messages`. A hosted deploy has a
|
|
277
|
+
different URL; see [Deploy](#deploy).
|
|
278
|
+
|
|
279
|
+
## Test locally
|
|
280
|
+
|
|
281
|
+
Teams reaches the bot only at a public HTTPS URL. `agent-sdk dev` opens a
|
|
282
|
+
`cloudflared` tunnel and prints the messaging endpoint on the tunnel's
|
|
283
|
+
origin:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
agent-sdk dev ./helm
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Copy the printed URL into the Azure Bot's **Messaging endpoint**, then
|
|
290
|
+
mention the bot in Teams. `--tunnel devtunnel` keeps one URL across
|
|
291
|
+
restarts. Next to a plain `agent-sdk serve`, `agent-sdk channels teams
|
|
292
|
+
forward` opens the same tunnel. `agent-sdk dev --mode single` serves one agent
|
|
293
|
+
without a slug, so its endpoint is `https://<origin>/v1/channels/teams`.
|
|
294
|
+
Without `--mode single`, the endpoint includes the agent's slug:
|
|
295
|
+
`https://<origin>/helm/v1/channels/teams`.
|
|
296
|
+
|
|
297
|
+
To run your own tunnel instead, serve with plain `agent-sdk serve`, which
|
|
298
|
+
opens no tunnel, and point `cloudflared` at its port:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
agent-sdk serve --dir ./helm --mode single --port 3978
|
|
302
|
+
cloudflared tunnel --url http://localhost:3978
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Add `--protocol http2` to `cloudflared` if your network blocks QUIC. Set the
|
|
306
|
+
Azure Bot's **Messaging endpoint** to the printed `<public-url>` plus
|
|
307
|
+
`/v1/channels/teams`, or `<public-url>/helm/v1/channels/teams` without
|
|
308
|
+
`--mode single`. The built-in tunnel forwards only `POST` requests to the
|
|
309
|
+
Teams messaging paths. A tunnel you run yourself exposes every route on the
|
|
310
|
+
port.
|
|
311
|
+
|
|
312
|
+
Requests through a tunnel always get the Bot Framework token check, so only
|
|
313
|
+
Teams can start turns there. A tunnel adds proxy headers or forwards its
|
|
314
|
+
public hostname, and the dev exception for unsigned activities refuses both.
|
|
315
|
+
To replay a saved activity without Teams, POST it to the same path on
|
|
316
|
+
`http://127.0.0.1:<port>` from the same machine; `agent-sdk dev` admits
|
|
317
|
+
unsigned activities from loopback only.
|
|
318
|
+
|
|
319
|
+
## Deploy
|
|
320
|
+
|
|
321
|
+
Hosted, the agent needs its three secrets:
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
// bot/agent.ts
|
|
325
|
+
import { defineAgent } from "@grok/agent-sdk";
|
|
326
|
+
|
|
327
|
+
export default defineAgent({
|
|
328
|
+
hosting: {
|
|
329
|
+
secretNames: ["TEAMS_APP_ID", "TEAMS_APP_PASSWORD", "TEAMS_TENANT_ID"],
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Hosting adds the Microsoft hosts that a Teams channel calls
|
|
335
|
+
(`login.microsoftonline.com`, `login.botframework.com`, and
|
|
336
|
+
`smba.trafficmanager.net`), so you do not list them in `egressDomains`.
|
|
337
|
+
Your team's network settings still apply to them. If your team restricts
|
|
338
|
+
egress, its allowlist must include all three hosts, or the agent's replies
|
|
339
|
+
fail.
|
|
340
|
+
|
|
341
|
+
An `envPrefix` changes the secret names. With
|
|
342
|
+
`teamsChannel({ envPrefix: "ECHO" })`, list `ECHO_TEAMS_APP_ID`,
|
|
343
|
+
`ECHO_TEAMS_APP_PASSWORD`, and `ECHO_TEAMS_TENANT_ID` in `secretNames`, and
|
|
344
|
+
set those names with `agent-sdk secret set`.
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
agent-sdk deploy --dir . --slug helpdesk
|
|
348
|
+
agent-sdk secret set helpdesk TEAMS_APP_ID
|
|
349
|
+
agent-sdk secret set helpdesk TEAMS_APP_PASSWORD
|
|
350
|
+
agent-sdk secret set helpdesk TEAMS_TENANT_ID
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
`agent-sdk deploy` prints the hosted messaging endpoint on a `public:`
|
|
354
|
+
line that ends in `/v1/channels/teams`. Set the Azure Bot's **Messaging
|
|
355
|
+
endpoint** to that URL, not to the slug URL from local testing. With a
|
|
356
|
+
custom `path`, add it after the printed URL.
|
|
357
|
+
|
|
358
|
+
On hosting, Cursor checks the Bot Framework token and the tenant before
|
|
359
|
+
the agent starts. Activities that the channel cannot act on, such as a
|
|
360
|
+
reaction or an unmentioned post outside `channelPosts`, stop there and
|
|
361
|
+
use no compute. Each personal or group chat is one session, and each
|
|
362
|
+
channel reply chain is one session. Tool approvals work on hosting: an
|
|
363
|
+
Approve or Deny click reaches the turn that waits for it, and a call that
|
|
364
|
+
nobody approves in 10 minutes is denied.
|
|
365
|
+
|
|
366
|
+
Hosting runs Teams channels only in the commercial Microsoft cloud, and
|
|
367
|
+
only for teams that have Teams channels turned on. The deploy fails
|
|
368
|
+
otherwise.
|
|
369
|
+
|
|
370
|
+
## How Teams differs from Slack
|
|
371
|
+
|
|
372
|
+
| | Slack | Teams |
|
|
373
|
+
| --- | --- | --- |
|
|
374
|
+
| App | Your Slack app's bot and app tokens | Your Azure Bot's app ID, client secret, and tenant |
|
|
375
|
+
| Local transport | Socket Mode, no public URL | `agent-sdk dev` opens a tunnel to the messaging endpoint |
|
|
376
|
+
| Watch channel posts | `message.channels` subscription | `ChannelMessage.Read.Group` consent at install |
|
|
377
|
+
| Threads | Every message can start a thread | Reply chains in channels; personal and group chats are one conversation each |
|
|
378
|
+
| Bot-to-bot wakes | `maxDepth` from message metadata, plus per-thread caps | Per-thread caps only |
|
|
379
|
+
| Progress | Status chip, streaming API, tool and reasoning cards | Typing indicator, or one edited message in stream mode |
|
|
380
|
+
| Approvals | Block Kit buttons | Adaptive Card buttons |
|
|
381
|
+
| Hosted sessions | One per thread | One per chat, or one per channel reply chain |
|
|
382
|
+
| Not available in Teams | | Reactions, file uploads and downloads, suggested prompts, `eval` commands, edit debounce |
|
|
383
|
+
|
|
384
|
+
## Related
|
|
385
|
+
|
|
386
|
+
- [Slack](./slack.md)
|
|
387
|
+
- [Webhooks](./webhooks.md)
|
|
388
|
+
- [Deployment](../deployment.md)
|
|
389
|
+
- [Channels reference](../reference/channels.md)
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Workload identity (OIDC)"
|
|
3
|
+
description: "Mint short-lived OIDC tokens from a deployed Agent SDK agent to authenticate with cloud providers and external services without static keys."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Authenticate deployed agents with OIDC
|
|
7
|
+
|
|
8
|
+
A deployed Agent SDK agent can mint short-lived OIDC JWTs signed by Cursor and exchange them for temporary cloud credentials or service tokens without storing static access keys in deployment secrets.
|
|
9
|
+
|
|
10
|
+
Agent SDK tokens share the `https://api.cursor.com` issuer, discovery endpoints, signing keys, 5-minute lifetime, socket path, and per-pod rate limits documented in [Cloud Agents OIDC tokens](https://cursor.com/docs/cloud-agent/identity). They differ in four ways:
|
|
11
|
+
|
|
12
|
+
| Aspect | Cloud Agents | Agent SDK deployments |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Audience allowlist | Any valid `aud` string | Must be declared in `hosting.oidc.audiences`; undeclared audiences return HTTP `400`. |
|
|
15
|
+
| Subject (`sub`) | `cloud_agent_id:<id>` (or projected `team_id:<id>` via `sub_claim`) | Always `agent_sdk_deployment_id:<deployment-id>`. Sending `sub_claim` returns HTTP `400`. |
|
|
16
|
+
| Runtime claim (`agent_runtime`) | `"managed"` or `"self_hosted"` | `"agent_sdk"`. |
|
|
17
|
+
| Additional claims | Includes owner, team, repository, branch, and turn claims | See [Token claims](#token-claims). No owner, team, repository, or session claims. |
|
|
18
|
+
|
|
19
|
+
## Declare allowed audiences
|
|
20
|
+
|
|
21
|
+
A deployed agent can only mint tokens for audiences declared in `hosting.oidc.audiences` in `bot/agent.ts`. If you omit `hosting.oidc.audiences`, every mint request fails with HTTP `400`.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// bot/agent.ts
|
|
25
|
+
import { defineAgent } from "@grok/agent-sdk";
|
|
26
|
+
|
|
27
|
+
export default defineAgent({
|
|
28
|
+
hosting: {
|
|
29
|
+
egressDomains: ["sts.amazonaws.com"],
|
|
30
|
+
oidc: {
|
|
31
|
+
audiences: ["sts.amazonaws.com"],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Minting talks to a local Unix socket, so minting itself needs no egress entry. Calling the relying party to exchange the token still requires its hostname in `hosting.egressDomains`, such as `sts.amazonaws.com` (and any AWS service host your agent calls afterward).
|
|
38
|
+
|
|
39
|
+
Audience rules:
|
|
40
|
+
|
|
41
|
+
- List exact audience strings only. Wildcards (`*`) are rejected.
|
|
42
|
+
- Declare at most 8 audiences per deployment.
|
|
43
|
+
- Each audience must be 1 to 512 printable ASCII characters with no spaces or control characters.
|
|
44
|
+
- Cursor-reserved audiences (such as `cursor.com` hosts) are rejected at deploy time and at mint time.
|
|
45
|
+
- Cursor saves `hosting.oidc.audiences` when you deploy. Redeploy to add or remove an audience.
|
|
46
|
+
|
|
47
|
+
## Mint a token with `getOidcToken`
|
|
48
|
+
|
|
49
|
+
Import `getOidcToken` from `@grok/agent-sdk` and call it inside a tool, channel handler, or callback when your agent needs a token.
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
// bot/tools/assume_aws_role.ts
|
|
53
|
+
import { getOidcToken, OidcTokenError } from "@grok/agent-sdk";
|
|
54
|
+
import { defineTool } from "@grok/agent-sdk/tools";
|
|
55
|
+
import { z } from "zod";
|
|
56
|
+
|
|
57
|
+
export default defineTool({
|
|
58
|
+
description: "Exchange an OIDC token for temporary AWS credentials.",
|
|
59
|
+
inputSchema: z.object({}),
|
|
60
|
+
async execute() {
|
|
61
|
+
let token: string;
|
|
62
|
+
try {
|
|
63
|
+
const result = await getOidcToken("sts.amazonaws.com");
|
|
64
|
+
token = result.token;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
if (error instanceof OidcTokenError) {
|
|
67
|
+
return {
|
|
68
|
+
ok: false,
|
|
69
|
+
code: error.code,
|
|
70
|
+
status: error.status ?? null,
|
|
71
|
+
reason: error.reason ?? null,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const body = new URLSearchParams({
|
|
78
|
+
Action: "AssumeRoleWithWebIdentity",
|
|
79
|
+
Version: "2011-06-15",
|
|
80
|
+
RoleArn: "arn:aws:iam::123456789012:role/my-agent-role",
|
|
81
|
+
RoleSessionName: "agent-sdk-session",
|
|
82
|
+
WebIdentityToken: token,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const response = await fetch("https://sts.amazonaws.com/", {
|
|
86
|
+
method: "POST",
|
|
87
|
+
headers: {
|
|
88
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
89
|
+
accept: "application/json",
|
|
90
|
+
},
|
|
91
|
+
body,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
if (!response.ok) {
|
|
95
|
+
return { ok: false, stsStatus: response.status };
|
|
96
|
+
}
|
|
97
|
+
return { ok: true };
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Call `getOidcToken` inside a tool, handler, or callback, not at module load time.
|
|
103
|
+
|
|
104
|
+
### Return value and caching
|
|
105
|
+
|
|
106
|
+
`getOidcToken(audience: string)` returns `Promise<OidcToken>`:
|
|
107
|
+
|
|
108
|
+
| Field | Type | Meaning |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `token` | `string` | Compact RS256-signed JWT. Never log it. |
|
|
111
|
+
| `expiresAt` | `Date` | Token expiration timestamp from the socket's `expires_at` field. |
|
|
112
|
+
|
|
113
|
+
`getOidcToken` caches one token per audience in memory and refreshes it 60 seconds before `expiresAt`. Concurrent callers for the same audience share a single in-flight mint request. Each mint request times out after 20 seconds.
|
|
114
|
+
|
|
115
|
+
### Error handling
|
|
116
|
+
|
|
117
|
+
`getOidcToken` throws `OidcTokenError` (a subclass of `Error` with `name === "OidcTokenError"`) on failure:
|
|
118
|
+
|
|
119
|
+
| Field | Type | Meaning |
|
|
120
|
+
| --- | --- | --- |
|
|
121
|
+
| `code` | `OidcTokenErrorCode` | Failure category listed below. |
|
|
122
|
+
| `status` | `number \| undefined` | HTTP status code from the identity socket when an HTTP response was received. |
|
|
123
|
+
| `reason` | `string \| undefined` | Machine-readable `error` string from the socket's JSON error body, when present. |
|
|
124
|
+
|
|
125
|
+
`OidcTokenErrorCode` values:
|
|
126
|
+
|
|
127
|
+
| `code` | Typical `status` | Cause | What to do |
|
|
128
|
+
| --- | --- | --- | --- |
|
|
129
|
+
| `"not_hosted"` | `undefined` | No identity socket exists (for example, during local `agent-sdk dev` or `agent-sdk serve`). | Use local credentials in development or skip OIDC locally. |
|
|
130
|
+
| `"refused"` | `403` | The deployment is not running (stopped or deleted) or OIDC minting is disabled for this deployment. | Treat as non-retryable. Check deployment status. |
|
|
131
|
+
| `"rate_limited"` | `429` | The per-pod mint rate limit was exceeded. | Back off and retry. Prefer `getOidcToken` caching over repeated raw calls. |
|
|
132
|
+
| `"timeout"` | `undefined` | The mint request did not finish within 20 seconds. | Retry with backoff. |
|
|
133
|
+
| `"malformed"` | `undefined` | The socket returned HTTP `200` with invalid JSON, missing `token` or `expires_at`, or a body larger than 64 KiB. | Retry or inspect runtime logs. |
|
|
134
|
+
| `"failed"` | `400`, `5xx`, or `undefined` | Another HTTP error or socket transport failure. | Check `status`. HTTP `400` means fix the request or declare the audience in `hosting.oidc.audiences`; `5xx` errors are retryable. |
|
|
135
|
+
|
|
136
|
+
When you request an audience that is not listed in `hosting.oidc.audiences`, the socket returns HTTP `400` and `getOidcToken` throws `OidcTokenError` with `code: "failed"` and `status: 400`. Branch on `code` and `status` rather than matching `reason`, which can change.
|
|
137
|
+
|
|
138
|
+
## Call the identity socket directly
|
|
139
|
+
|
|
140
|
+
Use the local Unix domain socket directly from shell scripts, non-JavaScript tools, or when you need a `nonce` claim (which `getOidcToken` does not accept).
|
|
141
|
+
|
|
142
|
+
The socket path is in `$CURSOR_AGENT_SOCKET`, defaulting to `/run/cursor/api.sock`. Send `POST /v1/tokens/oidc` with `Content-Type: application/json` (maximum body size 4 KB):
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
curl --silent --show-error --fail-with-body \
|
|
146
|
+
--unix-socket "${CURSOR_AGENT_SOCKET:-/run/cursor/api.sock}" \
|
|
147
|
+
-H 'Content-Type: application/json' \
|
|
148
|
+
-d '{"aud":"sts.amazonaws.com"}' \
|
|
149
|
+
http://localhost/v1/tokens/oidc
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Request fields:
|
|
153
|
+
|
|
154
|
+
- `aud` (required string): exact audience declared in `hosting.oidc.audiences`.
|
|
155
|
+
- `nonce` (optional string): opaque printable ASCII string with no spaces, up to 512 characters, echoed into the JWT `nonce` claim.
|
|
156
|
+
|
|
157
|
+
Success response (`200 OK`):
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiIsInR5cCI6IkpXVCJ9...",
|
|
162
|
+
"expires_at": 1785500000
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`expires_at` is the token expiration in Unix seconds and matches the JWT `exp` claim.
|
|
167
|
+
|
|
168
|
+
An undeclared audience, a Cursor-reserved audience, an invalid `aud`, or a `sub_claim` field returns HTTP `400` with a JSON error object whose `error` string can change.
|
|
169
|
+
|
|
170
|
+
See [Cloud Agents OIDC tokens](https://cursor.com/docs/cloud-agent/identity) for the full socket HTTP status code table and per-pod rate limits.
|
|
171
|
+
|
|
172
|
+
## Token claims
|
|
173
|
+
|
|
174
|
+
Tokens are signed with `RS256` and include `alg`, `kid`, and `typ: "JWT"` in the header. Every Agent SDK token carries these claims:
|
|
175
|
+
|
|
176
|
+
| Claim | Value | Notes |
|
|
177
|
+
| --- | --- | --- |
|
|
178
|
+
| `iss` | `https://api.cursor.com` | Same issuer as Cloud Agents. |
|
|
179
|
+
| `sub` | `agent_sdk_deployment_id:<deployment-id>` | `<deployment-id>` is the deployment public ID (`asd_` followed by 32 lowercase hex characters). |
|
|
180
|
+
| `aud` | Requested audience string | Always a single string matching an entry in `hosting.oidc.audiences`. |
|
|
181
|
+
| `iat` | Unix seconds | Issued-at time. |
|
|
182
|
+
| `nbf` | `iat - 5` | Allows 5 seconds of clock skew. |
|
|
183
|
+
| `exp` | `iat + 300` | Valid for 5 minutes. |
|
|
184
|
+
| `jti` | UUID | Unique token ID per mint. |
|
|
185
|
+
| `agent_runtime` | `"agent_sdk"` | Identifies an Agent SDK deployment token. |
|
|
186
|
+
| `nonce` | Optional string | Present only when sent on a raw socket request. |
|
|
187
|
+
|
|
188
|
+
## Configure an AWS IAM trust policy
|
|
189
|
+
|
|
190
|
+
1. In AWS IAM, add `https://api.cursor.com` as an OpenID Connect identity provider with `sts.amazonaws.com` as an audience (if your AWS account does not already have one).
|
|
191
|
+
2. Declare `"sts.amazonaws.com"` in `hosting.oidc.audiences` and `hosting.egressDomains`, then deploy your agent.
|
|
192
|
+
3. Find your deployment's exact `sub` claim (`agent_sdk_deployment_id:asd_<32 hex chars>`). You can read `sub` from the JWT payload of a minted token during initial setup. Redeploying the same slug keeps the same deployment public ID; deleting and recreating a deployment generates a new one.
|
|
193
|
+
4. Attach a trust policy to your IAM role that pins both `api.cursor.com:aud` and `api.cursor.com:sub` with `StringEquals`:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"Version": "2012-10-17",
|
|
198
|
+
"Statement": [
|
|
199
|
+
{
|
|
200
|
+
"Effect": "Allow",
|
|
201
|
+
"Principal": {
|
|
202
|
+
"Federated": "arn:aws:iam::123456789012:oidc-provider/api.cursor.com"
|
|
203
|
+
},
|
|
204
|
+
"Action": "sts:AssumeRoleWithWebIdentity",
|
|
205
|
+
"Condition": {
|
|
206
|
+
"StringEquals": {
|
|
207
|
+
"api.cursor.com:aud": "sts.amazonaws.com",
|
|
208
|
+
"api.cursor.com:sub": "agent_sdk_deployment_id:asd_3f9c0a7b1d2e4f60a9b8c7d6e5f40312"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Never replace the `sub` value with a wildcard such as `agent_sdk_deployment_id:*`. A wildcard trusts every Agent SDK deployment on Cursor.
|
|
217
|
+
|
|
218
|
+
## Verification, rate limits, and trust model
|
|
219
|
+
|
|
220
|
+
For OIDC discovery (`https://api.cursor.com/.well-known/openid-configuration`), JWKS (`https://api.cursor.com/keys`), JWT signature verification steps, and per-pod rate limits, see [Cloud Agents OIDC tokens](https://cursor.com/docs/cloud-agent/identity).
|
|
221
|
+
|
|
222
|
+
Keep the deployment trust boundary in mind when scoping external roles:
|
|
223
|
+
|
|
224
|
+
- Any code or tool running inside the deployment pod that can reach the identity socket can mint tokens for any audience declared in `hosting.oidc.audiences`.
|
|
225
|
+
- The platform sets `sub` from the deployment identity, so one deployment cannot impersonate another.
|
|
226
|
+
- Tokens represent the deployment as a whole, not a single session, tool, or end user. Grant the external role only the permissions that the deployment should hold.
|
|
227
|
+
|
|
228
|
+
## Related
|
|
229
|
+
|
|
230
|
+
- [Deployment](../deployment.md)
|
|
231
|
+
- [Agent config](../reference/agent-config.md)
|
|
232
|
+
- [Cloud Agents OIDC tokens](https://cursor.com/docs/cloud-agent/identity)
|
|
@@ -32,7 +32,7 @@ export default defineAgent({
|
|
|
32
32
|
| `description` | string | What the agent is for. Required on subagents, where the parent model reads it to decide when to delegate. |
|
|
33
33
|
| `instructions` | string | Inline instructions for subagents and generated configs. Prefer `instructions.md`. |
|
|
34
34
|
| `local` | `{ cwd?, workspaceDir?, sandbox? }` | Defaults for a local run. See [Local options](#local-options). |
|
|
35
|
-
| `hosting` | `{ egressDomains?, secretNames? }` | The egress allowlist
|
|
35
|
+
| `hosting` | `{ egressDomains?, secretNames?, oidc? }` | The egress allowlist, expected secret names, and [OIDC token audiences](../guides/workload-identity.md) that `agent-sdk deploy` reads. Mounted [extensions](./extensions.md#build-an-extension) add their own egress hosts and secrets. |
|
|
36
36
|
| `concurrency` | `{ maxRunningTurns? }` | Agent-wide limit on concurrent turns. See [Concurrency](#concurrency). |
|
|
37
37
|
| `builtinTools` | `{ reminders? }` | Opt-in tools that Agent SDK provides. See [Built-in tools](#built-in-tools). |
|
|
38
38
|
| `tools` | `ToolName[]` | Allowlist of built-in tools. Omit it for the full standard toolset. See [Harness tools](#harness-tools). |
|
|
@@ -150,6 +150,7 @@ Import each one from `@grok/agent-sdk/channels/<name>`.
|
|
|
150
150
|
| Function | Details |
|
|
151
151
|
| --- | --- |
|
|
152
152
|
| `slackChannel()` | [Slack](../guides/slack.md) |
|
|
153
|
+
| `teamsChannel()` | [Microsoft Teams](../guides/teams.md) |
|
|
153
154
|
| `githubChannel()` | [GitHub](../guides/github.md) |
|
|
154
155
|
| `gitlabChannel()` | [GitLab](../guides/gitlab.md) |
|
|
155
156
|
| `bitbucketChannel()` | [Bitbucket](../guides/bitbucket.md) |
|