@agent-deck/backend 1.1.5 → 1.1.7

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.
Files changed (57) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/config/oauth-redirect.d.ts +6 -1
  3. package/dist/config/oauth-redirect.d.ts.map +1 -1
  4. package/dist/config/oauth-redirect.js +29 -3
  5. package/dist/config/oauth-redirect.js.map +1 -1
  6. package/dist/data/default-mcp-services.d.ts +3 -0
  7. package/dist/data/default-mcp-services.d.ts.map +1 -1
  8. package/dist/data/default-mcp-services.js +4 -29
  9. package/dist/data/default-mcp-services.js.map +1 -1
  10. package/dist/data/oauth-provider-guides.d.ts +14 -2
  11. package/dist/data/oauth-provider-guides.d.ts.map +1 -1
  12. package/dist/data/oauth-provider-guides.js +143 -25
  13. package/dist/data/oauth-provider-guides.js.map +1 -1
  14. package/dist/lib/mcp-connection-error.d.ts +4 -0
  15. package/dist/lib/mcp-connection-error.d.ts.map +1 -0
  16. package/dist/lib/mcp-connection-error.js +45 -0
  17. package/dist/lib/mcp-connection-error.js.map +1 -0
  18. package/dist/lib/oauth-token-response.d.ts +11 -0
  19. package/dist/lib/oauth-token-response.d.ts.map +1 -0
  20. package/dist/lib/oauth-token-response.js +48 -0
  21. package/dist/lib/oauth-token-response.js.map +1 -0
  22. package/dist/mcp-server.d.ts +4 -3
  23. package/dist/mcp-server.d.ts.map +1 -1
  24. package/dist/mcp-server.js +128 -32
  25. package/dist/mcp-server.js.map +1 -1
  26. package/dist/mcp-session-binding.d.ts +29 -0
  27. package/dist/mcp-session-binding.d.ts.map +1 -0
  28. package/dist/mcp-session-binding.js +74 -0
  29. package/dist/mcp-session-binding.js.map +1 -0
  30. package/dist/server/index.d.ts.map +1 -1
  31. package/dist/server/index.js +1 -0
  32. package/dist/server/index.js.map +1 -1
  33. package/dist/services/config-manager.d.ts.map +1 -1
  34. package/dist/services/config-manager.js +5 -5
  35. package/dist/services/config-manager.js.map +1 -1
  36. package/dist/services/mcp-client-manager.d.ts.map +1 -1
  37. package/dist/services/mcp-client-manager.js +6 -1
  38. package/dist/services/mcp-client-manager.js.map +1 -1
  39. package/dist/services/oauth-connect-service.d.ts.map +1 -1
  40. package/dist/services/oauth-connect-service.js +21 -3
  41. package/dist/services/oauth-connect-service.js.map +1 -1
  42. package/dist/services/oauth-manager.d.ts.map +1 -1
  43. package/dist/services/oauth-manager.js +5 -8
  44. package/dist/services/oauth-manager.js.map +1 -1
  45. package/dist/services/service-manager.d.ts +2 -0
  46. package/dist/services/service-manager.d.ts.map +1 -1
  47. package/dist/services/service-manager.js +22 -3
  48. package/dist/services/service-manager.js.map +1 -1
  49. package/package.json +2 -2
  50. package/static-ui/assets/AgentDeckLogo3-X5qCXS2A.png +0 -0
  51. package/static-ui/assets/index-Df5pC3f-.css +1 -0
  52. package/static-ui/assets/index-Z9Ok_u4n.js +362 -0
  53. package/static-ui/favicon.png +0 -0
  54. package/static-ui/index.html +2 -2
  55. package/static-ui/assets/AgentDeckLogo2-z3pVqJJ3.png +0 -0
  56. package/static-ui/assets/index-C9xsIiR9.css +0 -1
  57. package/static-ui/assets/index-CExp-xnm.js +0 -344
@@ -1,23 +1,35 @@
1
- export type OAuthSetupMode = 'dynamic' | 'managed' | 'manual' | 'unavailable';
1
+ export type OAuthSetupMode = 'dynamic' | 'managed' | 'manual' | 'unavailable' | 'informational';
2
+ export type ServiceGuideContext = {
3
+ serviceName?: string;
4
+ serviceUrl?: string;
5
+ };
2
6
  export type OAuthProviderGuide = {
3
7
  provider: string;
4
8
  setupMode: OAuthSetupMode;
5
9
  title: string;
6
10
  redirectUri: string;
11
+ /** One-line: what this card does in Agent Deck. */
12
+ summary?: string;
13
+ prerequisites?: string[];
7
14
  steps: string[];
15
+ /** What to do after OAuth / first successful tool discovery. */
16
+ afterConnect?: string[];
8
17
  docsUrl?: string;
9
18
  unavailableReason?: string;
10
19
  /** Pre-filled app manifest (Slack: paste at Create New App → From a manifest). */
11
20
  manifestJson?: string;
12
21
  /** Deep link to provider app creation UI. */
13
22
  createAppUrl?: string;
23
+ createAppLabel?: string;
14
24
  /** Shorter alternative when full setup is too heavy. */
15
25
  easierAlternative?: string;
26
+ /** PAT / header auth when OAuth app setup is optional. */
27
+ tokenAlternative?: string;
16
28
  };
17
29
  /** Slack MCP app manifest with redirect URI and common user scopes pre-filled. */
18
30
  export declare function getSlackMcpAppManifest(redirectUri?: string): string;
19
31
  export declare function inferOAuthProvider(serviceUrl: string, authServers?: string[]): string;
20
32
  export declare function resolveOAuthSetupMode(provider: string, supportsDynamicRegistration?: boolean): OAuthSetupMode;
21
- export declare function getOAuthProviderGuide(provider: string): OAuthProviderGuide;
33
+ export declare function getOAuthProviderGuide(provider: string, context?: ServiceGuideContext): OAuthProviderGuide;
22
34
  export { getOAuthRedirectUri } from '../config/oauth-redirect';
23
35
  //# sourceMappingURL=oauth-provider-guides.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-provider-guides.d.ts","sourceRoot":"","sources":["../../src/data/oauth-provider-guides.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAK9E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,kFAAkF;AAClF,wBAAgB,sBAAsB,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AiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAKF,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,WAAW,SAAwB,GAAG,MAAM,CA8ClF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO,GAAG,MAAM,CAczF;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CAOhB;AA2BD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAiMpB;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -7,6 +7,7 @@ exports.resolveOAuthSetupMode = resolveOAuthSetupMode;
7
7
  exports.getOAuthProviderGuide = getOAuthProviderGuide;
8
8
  const shared_oauth_apps_1 = require("../config/shared-oauth-apps");
9
9
  const oauth_redirect_1 = require("../config/oauth-redirect");
10
+ const AFTER_DECK_HINT = 'Drag this card onto a deck in the dashboard, then bind your agent (bind_workspace or switch_bound_deck) so tools appear in chat.';
10
11
  /** Slack MCP app manifest with redirect URI and common user scopes pre-filled. */
11
12
  function getSlackMcpAppManifest(redirectUri = (0, oauth_redirect_1.getOAuthRedirectUri)()) {
12
13
  return JSON.stringify({
@@ -54,6 +55,8 @@ function inferOAuthProvider(serviceUrl, authServers = []) {
54
55
  const url = serviceUrl.toLowerCase();
55
56
  if (url.includes('figma.com'))
56
57
  return 'figma';
58
+ if (url.includes('draw.io'))
59
+ return 'drawio';
57
60
  if (url.includes('slack.com'))
58
61
  return 'slack';
59
62
  if (url.includes('googleapis.com') || authServers.some((s) => s.includes('accounts.google.com'))) {
@@ -71,6 +74,8 @@ function inferOAuthProvider(serviceUrl, authServers = []) {
71
74
  function resolveOAuthSetupMode(provider, supportsDynamicRegistration) {
72
75
  if (provider === 'figma')
73
76
  return 'unavailable';
77
+ if (provider === 'drawio')
78
+ return 'informational';
74
79
  if ((0, shared_oauth_apps_1.hasSharedOAuthApp)(provider))
75
80
  return 'managed';
76
81
  if (supportsDynamicRegistration)
@@ -79,58 +84,119 @@ function resolveOAuthSetupMode(provider, supportsDynamicRegistration) {
79
84
  return 'dynamic';
80
85
  return 'manual';
81
86
  }
82
- function getOAuthProviderGuide(provider) {
87
+ function googleApiSteps(serviceName) {
88
+ const name = serviceName?.toLowerCase() ?? '';
89
+ if (name.includes('gmail')) {
90
+ return [
91
+ 'In Google Cloud Console → APIs & Services → Library, enable the Gmail API for this project.',
92
+ 'OAuth consent screen: add scope https://www.googleapis.com/auth/gmail (and any others Gmail MCP requests).',
93
+ ];
94
+ }
95
+ if (name.includes('calendar')) {
96
+ return [
97
+ 'Enable the Google Calendar API in APIs & Services → Library.',
98
+ 'OAuth consent screen: allow Calendar scopes when prompted during Connect.',
99
+ ];
100
+ }
101
+ if (name.includes('drive')) {
102
+ return [
103
+ 'Enable Google Drive API (drive.googleapis.com) in APIs & Services → Library.',
104
+ 'Enable Google Drive MCP API (drivemcp.googleapis.com) — required for the remote MCP endpoint; easy to miss.',
105
+ 'OAuth consent screen → Data access → manually add scopes: drive.readonly and drive.file (see Google Drive MCP docs).',
106
+ 'If app user type is External: Audience → add your Google account as a Test user while the app is in Testing.',
107
+ ];
108
+ }
109
+ return ['Enable the Gmail, Calendar, or Drive API that matches this card.'];
110
+ }
111
+ function getOAuthProviderGuide(provider, context = {}) {
83
112
  const redirectUri = (0, oauth_redirect_1.getOAuthRedirectUri)();
84
113
  const base = {
85
114
  provider,
86
115
  redirectUri,
87
116
  };
88
117
  switch (provider) {
89
- case 'google':
118
+ case 'google': {
119
+ const isDrive = context.serviceName?.toLowerCase().includes('drive');
90
120
  return {
91
121
  ...base,
92
122
  setupMode: 'manual',
93
- title: 'Google OAuth app',
94
- docsUrl: 'https://developers.google.com/workspace/guides/configure-mcp-servers',
123
+ title: context.serviceName ?? 'Google MCP',
124
+ summary: isDrive
125
+ ? 'Google-hosted Drive MCP (Developer Preview). Heavy GCP setup — see docs/GOOGLE_DRIVE_WORKAROUND.md for a simpler local-MCP path.'
126
+ : 'Google-hosted MCP for Workspace data. One OAuth client can cover multiple Google cards after Drive works.',
127
+ prerequisites: [
128
+ 'Google account with access to the data you want.',
129
+ 'Google Cloud project (free tier OK for personal use).',
130
+ ...(isDrive
131
+ ? ['Remote Drive MCP: enable both drive.googleapis.com and drivemcp.googleapis.com.']
132
+ : []),
133
+ ],
134
+ docsUrl: isDrive
135
+ ? 'https://developers.google.com/workspace/drive/api/guides/configure-mcp-server'
136
+ : 'https://developers.google.com/workspace/guides/configure-mcp-servers',
137
+ createAppUrl: 'https://console.cloud.google.com/apis/credentials',
138
+ createAppLabel: 'Open Google Cloud Credentials',
95
139
  steps: [
96
- 'Open Google Cloud Console → APIs & Services Credentials.',
97
- 'Create an OAuth 2.0 Client ID (type: Web application or Desktop).',
98
- `Add authorized redirect URI: ${redirectUri}`,
99
- 'Enable the Gmail / Calendar / Drive MCP APIs for your project if prompted.',
100
- 'Paste the Client ID and Client Secret below, then click Connect.',
140
+ 'Open Google Cloud Console → select or create a project.',
141
+ ...googleApiSteps(context.serviceName),
142
+ 'Google Auth Platform OAuth consent screen → configure (External + Test users for personal dev is OK).',
143
+ 'Credentials Create credentials OAuth client ID Web application.',
144
+ `Authorized redirect URIs: add exactly ${redirectUri} (127.0.0.1 not localhost if you see redirect_uri_mismatch).`,
145
+ 'Copy Client ID and Client Secret → paste below → Connect with credentials → pick your Google account.',
146
+ ],
147
+ afterConnect: [
148
+ 'If OAuth succeeds but tools fail, confirm drivemcp.googleapis.com is enabled (Drive) or the product MCP API for Gmail/Calendar.',
149
+ AFTER_DECK_HINT,
101
150
  ],
151
+ easierAlternative: isDrive
152
+ ? 'Recommended if remote OAuth failed: register a local Google Drive MCP server (stdio) — full steps in docs/GOOGLE_DRIVE_WORKAROUND.md. Or use Drive in Cursor/Claude natively and skip this card.'
153
+ : 'You only need one GCP project for all three Google cards. Debug Google Drive first; reuse the same Client ID/Secret on other cards once scopes are added.',
102
154
  };
155
+ }
103
156
  case 'slack':
104
157
  if ((0, shared_oauth_apps_1.hasSharedOAuthApp)('slack')) {
105
158
  return {
106
159
  ...base,
107
160
  setupMode: 'managed',
108
- title: 'Slack',
161
+ title: 'Slack MCP',
162
+ summary: 'Official Slack MCP — search channels/DMs, read history, send messages as you.',
109
163
  docsUrl: 'https://docs.slack.dev/ai/slack-mcp-server/',
110
164
  steps: [
111
165
  'Click Connect — Agent Deck uses the shared Slack OAuth app.',
112
- 'Sign in and approve access for your workspace (one time per workspace).',
166
+ 'Sign in and approve access for your workspace (once per workspace).',
113
167
  ],
168
+ afterConnect: [AFTER_DECK_HINT],
114
169
  };
115
170
  }
116
171
  return {
117
172
  ...base,
118
173
  setupMode: 'manual',
119
174
  title: 'Slack MCP (~10 min, one-time)',
175
+ summary: 'Official Slack MCP at mcp.slack.com. Requires your own Slack app with MCP enabled (Slack does not allow auto-registration like Linear).',
176
+ prerequisites: [
177
+ 'Slack workspace where you can create or manage apps.',
178
+ 'Permission to install the app to that workspace.',
179
+ ],
120
180
  docsUrl: 'https://docs.slack.dev/ai/slack-mcp-server/',
121
181
  createAppUrl: 'https://api.slack.com/apps/new',
182
+ createAppLabel: 'Open Slack app creator',
122
183
  manifestJson: getSlackMcpAppManifest(redirectUri),
123
- easierAlternative: 'If this is too much: use Slack MCP inside Cursor or Claude Code (partner apps), and keep this card as a reminder—or wait for a future Agent Deck shared OAuth app.',
184
+ easierAlternative: 'Easier path: use Slack MCP inside Cursor or Claude Code (partner OAuth). Use Agent Deck when you want Slack on a custom deck with other tools.',
124
185
  steps: [
125
186
  ...((0, oauth_redirect_1.isOAuthRedirectHttps)()
126
187
  ? []
127
188
  : [
128
- 'Set AGENT_DECK_PUBLIC_URL to your Agent Deck HTTPS origin (e.g. https://oauth.agent-deck.dev) so the manifest redirect URL uses https:// required for Slack public distribution.',
189
+ 'Dev / single workspace: redirect URI above (http on 127.0.0.1) is fine. Other workspaces need HTTPSset AGENT_DECK_PUBLIC_URL when you host.',
129
190
  ]),
130
- 'Use the buttons below: copy the manifest → open Slack app creator → Create New App → From a manifest → paste → Create.',
131
- 'In the new app: Agents & AI Apps → enable Model Context Protocol (MCP). OAuth & Permissions → opt in to PKCE if shown.',
191
+ 'Copy manifest → Open Slack app creator → Create New App → From a manifest → paste → Create.',
192
+ 'In the app: Agents & AI Apps → enable Model Context Protocol (MCP).',
193
+ 'OAuth & Permissions → enable PKCE if shown; confirm redirect URL matches above.',
132
194
  'Basic Information → copy Client ID and Client Secret → paste below → Connect → approve in browser.',
133
195
  ],
196
+ afterConnect: [
197
+ 'If tools fail with “App is not enabled for Slack MCP”, enable MCP under Agents & AI Apps.',
198
+ AFTER_DECK_HINT,
199
+ ],
134
200
  };
135
201
  case 'figma':
136
202
  return {
@@ -145,33 +211,85 @@ function getOAuthProviderGuide(provider) {
145
211
  return {
146
212
  ...base,
147
213
  setupMode: 'manual',
148
- title: 'GitHub',
149
- docsUrl: 'https://docs.github.com/en/apps/oauth-apps',
214
+ title: 'GitHub MCP',
215
+ summary: 'GitHub’s hosted MCP at api.githubcopilot.com — repos, issues, PRs, Actions, code search. Available to any GitHub account; only certain tools (e.g. Copilot Cloud Agent) need a paid Copilot plan.',
216
+ prerequisites: [
217
+ 'GitHub account with access to the repos you want the agent to touch.',
218
+ 'Permission to create an OAuth App (personal account) or org admin approval for org-owned apps.',
219
+ 'Org/enterprise: admins may need to allow this OAuth app / MCP for non-partner clients (Cursor/VS Code are pre-approved; Agent Deck is BYO).',
220
+ ],
221
+ docsUrl: 'https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp-in-your-ide/set-up-the-github-mcp-server',
222
+ createAppUrl: 'https://github.com/settings/applications/new',
223
+ createAppLabel: 'Create GitHub OAuth App',
224
+ easierAlternative: 'Easier in one IDE: built-in GitHub MCP in Cursor or VS Code (one-click OAuth). Use Agent Deck when GitHub must share a deck with Linear, Slack, etc.',
225
+ tokenAlternative: 'Skip OAuth app: edit this card → Headers → Authorization: Bearer <fine-grained PAT> with the repo scopes you need. Rotate PATs manually.',
150
226
  steps: [
151
- 'Create a GitHub OAuth App or use a fine-grained Personal Access Token.',
152
- `For OAuth app, set callback URL: ${redirectUri}`,
153
- 'Alternatively set Authorization: Bearer <PAT> in service headers.',
154
- 'Paste Client ID and Secret below for OAuth, then Connect.',
227
+ 'GitHub Settings Developer settings OAuth Apps New OAuth App.',
228
+ 'Application name: e.g. Agent Deck (local). Homepage URL: your Agent Deck URL or http://127.0.0.1:8000.',
229
+ `Authorization callback URL: ${redirectUri} (must match exactly — use Copy redirect URI below).`,
230
+ 'Register the app → copy Client ID Generate a new client secret.',
231
+ 'Paste Client ID and Client Secret below → Connect with credentials → approve GitHub access in the browser tab.',
232
+ 'Return here; health should turn green and tools (issues, PRs, repos, …) should appear.',
233
+ ],
234
+ afterConnect: [
235
+ 'Some tools need extra licenses (e.g. Copilot Cloud Agent → Copilot plan; code scanning → GHAS). Most repo/issue/PR tools work on free GitHub.',
236
+ AFTER_DECK_HINT,
155
237
  ],
156
238
  };
157
239
  case 'linear':
240
+ return {
241
+ ...base,
242
+ setupMode: 'dynamic',
243
+ title: 'Linear',
244
+ summary: 'Official Linear MCP — issues, projects, cycles, and team workflows.',
245
+ docsUrl: 'https://linear.app/docs/mcp',
246
+ steps: [
247
+ 'Click Connect — Agent Deck auto-registers with Linear (no developer console).',
248
+ 'Complete sign-in in the browser tab Linear opens.',
249
+ 'When status shows authenticated, refresh tools on this card.',
250
+ ],
251
+ afterConnect: [AFTER_DECK_HINT],
252
+ };
158
253
  case 'notion':
159
254
  return {
160
255
  ...base,
161
256
  setupMode: 'dynamic',
162
- title: provider === 'linear' ? 'Linear' : 'Notion',
163
- steps: ['Click ConnectAgent Deck registers automatically and opens the login page.'],
257
+ title: 'Notion',
258
+ summary: 'Official Notion MCP pages, databases, and workspace search.',
259
+ docsUrl: 'https://developers.notion.com/docs/mcp',
260
+ steps: [
261
+ 'Click Connect — Agent Deck auto-registers with Notion.',
262
+ 'Pick the workspace and approve access in the browser.',
263
+ 'Refresh tools once authenticated.',
264
+ ],
265
+ afterConnect: [AFTER_DECK_HINT],
266
+ };
267
+ case 'drawio':
268
+ return {
269
+ ...base,
270
+ setupMode: 'informational',
271
+ title: 'Draw.io MCP',
272
+ summary: 'Hosted diagrams MCP at mcp.draw.io. Often works without OAuth — open tools on this card first.',
273
+ docsUrl: 'https://www.drawio.com/blog/mcp-server',
274
+ steps: [
275
+ 'Open this card → check Connection Logs / Tools tab. Many users get tools with no setup.',
276
+ 'If tools load: drag the card onto a deck and bind your agent — you are done.',
277
+ 'If discovery fails: check draw.io MCP docs for auth requirements; you may need a draw.io account or API token in card Headers.',
278
+ ],
279
+ afterConnect: [AFTER_DECK_HINT],
164
280
  };
165
281
  default:
166
282
  return {
167
283
  ...base,
168
284
  setupMode: 'manual',
169
- title: 'OAuth application',
285
+ title: context.serviceName ?? 'OAuth application',
286
+ summary: 'Connect this MCP server with a provider-registered OAuth application.',
170
287
  steps: [
171
- 'Create an OAuth app with this MCP provider.',
288
+ 'Create an OAuth app in the provider developer console.',
172
289
  `Set redirect URI to: ${redirectUri}`,
173
290
  'Paste Client ID and Client Secret below, then Connect.',
174
291
  ],
292
+ afterConnect: [AFTER_DECK_HINT],
175
293
  };
176
294
  }
177
295
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-provider-guides.js","sourceRoot":"","sources":["../../src/data/oauth-provider-guides.ts"],"names":[],"mappings":";;;AAsBA,wDA8CC;AAED,gDAaC;AAED,sDASC;AAED,sDAkGC;AAhMD,mEAAgE;AAChE,6DAAqF;AAkBrF,kFAAkF;AAClF,SAAgB,sBAAsB,CAAC,WAAW,GAAG,IAAA,oCAAmB,GAAE;IACxE,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,mBAAmB,EAAE;YACnB,IAAI,EAAE,Y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,KAAK,EAAE,mBAAmB;gBAC1B,KAAK,EAAE;oBACL,6CAA6C;oBAC7C,wBAAwB,WAAW,EAAE;oBACrC,wDAAwD;iBACzD;aACF,CAAC;IACN,CAAC;AACH,CAAC;AAED,2DAA+D;AAAtD,qHAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"oauth-provider-guides.js","sourceRoot":"","sources":["../../src/data/oauth-provider-guides.ts"],"names":[],"mappings":";;;AAsCA,wDA8CC;AAED,gDAcC;AAED,sDAUC;AA2BD,sDAoMC;AA7UD,mEAAgE;AAChE,6DAAqF;AA+BrF,MAAM,eAAe,GACnB,kIAAkI,CAAC;AAErI,kFAAkF;AAClF,SAAgB,sBAAsB,CAAC,WAAW,GAAG,IAAA,oCAAmB,GAAE;IACxE,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,mBAAmB,EAAE;YACnB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,+DAA+D;YAC5E,gBAAgB,EACd,sPAAsP;YACxP,gBAAgB,EAAE,SAAS;SAC5B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,YAAY,EAAE,gBAAgB;gBAC9B,aAAa,EAAE,KAAK;aACrB;SACF;QACD,YAAY,EAAE;YACZ,aAAa,EAAE,CAAC,WAAW,CAAC;YAC5B,MAAM,EAAE;gBACN,GAAG,EAAE,CAAC,YAAY,CAAC;gBACnB,IAAI,EAAE;oBACJ,oBAAoB;oBACpB,qBAAqB;oBACrB,kBAAkB;oBAClB,gBAAgB;oBAChB,mBAAmB;oBACnB,mBAAmB;oBACnB,YAAY;oBACZ,kBAAkB;oBAClB,gBAAgB;oBAChB,cAAc;oBACd,YAAY;oBACZ,eAAe;oBACf,gBAAgB;oBAChB,YAAY;oBACZ,kBAAkB;iBACnB;aACF;SACF;QACD,QAAQ,EAAE;YACR,kBAAkB,EAAE,IAAI;SACzB;KACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,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;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,GAAG,IAAI;gBACP,SAAS,EAAE,SAAS;gBACpB,KAAK,EAAE,QAAQ;gBACf,OAAO,EAAE,+DAA+D;gBACxE,OAAO,EAAE,wCAAwC;gBACjD,KAAK,EAAE;oBACL,wDAAwD;oBACxD,uDAAuD;oBACvD,mCAAmC;iBACpC;gBACD,YAAY,EAAE,CAAC,eAAe,CAAC;aAChC,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,GAAG,IAAI;gBACP,SAAS,EAAE,eAAe;gBAC1B,KAAK,EAAE,aAAa;gBACpB,OAAO,EACL,gGAAgG;gBAClG,OAAO,EAAE,wCAAwC;gBACjD,KAAK,EAAE;oBACL,yFAAyF;oBACzF,8EAA8E;oBAC9E,gIAAgI;iBACjI;gBACD,YAAY,EAAE,CAAC,eAAe,CAAC;aAChC,CAAC;QACJ;YACE,OAAO;gBACL,GAAG,IAAI;gBACP,SAAS,EAAE,QAAQ;gBACnB,KAAK,EAAE,OAAO,CAAC,WAAW,IAAI,mBAAmB;gBACjD,OAAO,EAAE,uEAAuE;gBAChF,KAAK,EAAE;oBACL,wDAAwD;oBACxD,wBAAwB,WAAW,EAAE;oBACrC,wDAAwD;iBACzD;gBACD,YAAY,EAAE,CAAC,eAAe,CAAC;aAChC,CAAC;IACN,CAAC;AACH,CAAC;AAED,2DAA+D;AAAtD,qHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,4 @@
1
+ /** Extract a user-facing message from MCP client connection failures. */
2
+ export declare function formatMcpConnectionError(streamableError: unknown, sseError: unknown): string;
3
+ export declare function extractMcpErrorMessage(err: unknown): string | null;
4
+ //# sourceMappingURL=mcp-connection-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-connection-error.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-connection-error.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,OAAO,EACxB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAcR;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAElE"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatMcpConnectionError = formatMcpConnectionError;
4
+ exports.extractMcpErrorMessage = extractMcpErrorMessage;
5
+ /** Extract a user-facing message from MCP client connection failures. */
6
+ function formatMcpConnectionError(streamableError, sseError) {
7
+ for (const err of [streamableError, sseError]) {
8
+ const parsed = extractMcpErrorMessage(err);
9
+ if (parsed) {
10
+ return parsed;
11
+ }
12
+ }
13
+ const sseMsg = sseError instanceof Error ? sseError.message : String(sseError ?? '');
14
+ if (sseMsg && !sseMsg.includes('Non-200 status code')) {
15
+ return `Failed to connect to MCP service: ${sseMsg}`;
16
+ }
17
+ return 'Failed to connect to MCP service';
18
+ }
19
+ function extractMcpErrorMessage(err) {
20
+ return parseMcpErrorMessage(err);
21
+ }
22
+ function parseMcpErrorMessage(err) {
23
+ const raw = err instanceof Error ? err.message : String(err ?? '');
24
+ if (!raw) {
25
+ return null;
26
+ }
27
+ const jsonStart = raw.indexOf('{');
28
+ if (jsonStart >= 0) {
29
+ try {
30
+ const payload = JSON.parse(raw.slice(jsonStart));
31
+ const message = payload.error?.message?.trim();
32
+ if (message) {
33
+ return message;
34
+ }
35
+ }
36
+ catch {
37
+ // fall through
38
+ }
39
+ }
40
+ if (raw.includes('App is not enabled for Slack MCP')) {
41
+ return raw.replace(/^Error POSTing to endpoint \(HTTP \d+\): /, '');
42
+ }
43
+ return null;
44
+ }
45
+ //# sourceMappingURL=mcp-connection-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-connection-error.js","sourceRoot":"","sources":["../../src/lib/mcp-connection-error.ts"],"names":[],"mappings":";;AACA,4DAiBC;AAED,wDAEC;AAtBD,yEAAyE;AACzE,SAAgB,wBAAwB,CACtC,eAAwB,EACxB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AC;QAAC,MAAM,CAAC;YACP,eAAe;QACjB,CAAC;IACH,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAE,CAAC;QACrD,OAAO,GAAG,CAAC,OAAO,CAAC,2CAA2C,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,11 @@
1
+ export type OAuthTokenResponseBody = {
2
+ access_token: string;
3
+ refresh_token?: string;
4
+ expires_in?: number;
5
+ token_type?: string;
6
+ scope?: string;
7
+ };
8
+ /** Parse OAuth token endpoint body (JSON or application/x-www-form-urlencoded). */
9
+ export declare function parseOAuthTokenResponse(response: Response): Promise<OAuthTokenResponseBody>;
10
+ export declare function oauthTokenRequestHeaders(): Record<string, string>;
11
+ //# sourceMappingURL=oauth-token-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-token-response.d.ts","sourceRoot":"","sources":["../../src/lib/oauth-token-response.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,mFAAmF;AACnF,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA0CjG;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKjE"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseOAuthTokenResponse = parseOAuthTokenResponse;
4
+ exports.oauthTokenRequestHeaders = oauthTokenRequestHeaders;
5
+ /** Parse OAuth token endpoint body (JSON or application/x-www-form-urlencoded). */
6
+ async function parseOAuthTokenResponse(response) {
7
+ const contentType = response.headers.get('content-type') ?? '';
8
+ const text = await response.text();
9
+ const trimmed = text.trim();
10
+ if (!trimmed) {
11
+ throw new Error('OAuth token response was empty');
12
+ }
13
+ if (contentType.includes('application/json') || trimmed.startsWith('{')) {
14
+ const data = JSON.parse(trimmed);
15
+ if (data.error) {
16
+ throw new Error(`OAuth token error: ${data.error}${data.error_description ? ` — ${data.error_description}` : ''}`);
17
+ }
18
+ if (!data.access_token) {
19
+ throw new Error('OAuth token JSON response missing access_token');
20
+ }
21
+ return data;
22
+ }
23
+ const params = new URLSearchParams(trimmed);
24
+ const oauthError = params.get('error');
25
+ if (oauthError) {
26
+ const description = params.get('error_description');
27
+ throw new Error(`OAuth token error: ${oauthError}${description ? ` — ${description}` : ''}`);
28
+ }
29
+ const accessToken = params.get('access_token');
30
+ if (!accessToken) {
31
+ throw new Error(`OAuth token response missing access_token: ${trimmed.slice(0, 200)}`);
32
+ }
33
+ const expiresIn = params.get('expires_in');
34
+ return {
35
+ access_token: accessToken,
36
+ refresh_token: params.get('refresh_token') ?? undefined,
37
+ expires_in: expiresIn ? Number(expiresIn) : undefined,
38
+ token_type: params.get('token_type') ?? undefined,
39
+ scope: params.get('scope') ?? undefined,
40
+ };
41
+ }
42
+ function oauthTokenRequestHeaders() {
43
+ return {
44
+ 'Content-Type': 'application/x-www-form-urlencoded',
45
+ Accept: 'application/json',
46
+ };
47
+ }
48
+ //# sourceMappingURL=oauth-token-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-token-response.js","sourceRoot":"","sources":["../../src/lib/oauth-token-response.ts"],"names":[],"mappings":";;AASA,0DA0CC;AAED,4DAKC;AAlDD,mFAAmF;AAC5E,KAAK,UAAU,uBAAuB,CAAC,QAAkB;IAC9D,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/D,MAAM,IAAI,GAAG,MAAM,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8CAA8C,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC3C,OAAO;QACL,YAAY,EAAE,WAAW;QACzB,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,SAAS;QACvD,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;QACrD,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,SAAS;QACjD,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,SAAS;KACxC,CAAC;AACJ,CAAC;AAED,SAAgB,wBAAwB;IACtC,OAAO;QACL,cAAc,EAAE,mCAAmC;QACnD,MAAM,EAAE,kBAAkB;KAC3B,CAAC;AACJ,CAAC"}
@@ -6,15 +6,16 @@ export declare class AgentDeckMCPServer {
6
6
  private sessions;
7
7
  /** Set only while registerTools/registerResources run for a new session server. */
8
8
  private mcpServerForRegistration;
9
- /** Workspace root per MCP session resolves `.agent-deck/deck.yaml`. */
10
- private workspaceBySession;
9
+ /** Per-session workspace + optional deck override (see mcp-session-binding.ts). */
10
+ private sessionBinding;
11
11
  private activeSessionId;
12
12
  private get server();
13
13
  constructor(port?: number, backendUrl?: string);
14
14
  private createMcpServer;
15
15
  private getSessionId;
16
- private getBoundWorkspace;
17
16
  private getAgentHeaders;
17
+ private fetchDeck;
18
+ private buildBindingPayload;
18
19
  private callBackendAPI;
19
20
  private getBoundDeckId;
20
21
  private toolResult;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAQA,OAAO,OAA8B,MAAM,SAAS,CAAC;AAuBrD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,IAAI,CAAS;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