@studiometa/productive-mcp 0.10.10 → 0.10.12
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/README.md +120 -0
- package/dist/api-reference/generated.d.ts +3 -0
- package/dist/api-reference/generated.d.ts.map +1 -0
- package/dist/api-reference/types.d.ts +31 -0
- package/dist/api-reference/types.d.ts.map +1 -0
- package/dist/auth.js.map +1 -1
- package/dist/crypto.js +3 -3
- package/dist/crypto.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/handlers/activities.d.ts +3 -99
- package/dist/handlers/activities.d.ts.map +1 -1
- package/dist/handlers/api-read.d.ts +14 -0
- package/dist/handlers/api-read.d.ts.map +1 -0
- package/dist/handlers/api-utils.d.ts +27 -0
- package/dist/handlers/api-utils.d.ts.map +1 -0
- package/dist/handlers/api-write.d.ts +10 -0
- package/dist/handlers/api-write.d.ts.map +1 -0
- package/dist/handlers/attachments.d.ts +3 -99
- package/dist/handlers/attachments.d.ts.map +1 -1
- package/dist/handlers/bookings.d.ts +3 -99
- package/dist/handlers/bookings.d.ts.map +1 -1
- package/dist/handlers/comments.d.ts +3 -99
- package/dist/handlers/comments.d.ts.map +1 -1
- package/dist/handlers/companies.d.ts +3 -99
- package/dist/handlers/companies.d.ts.map +1 -1
- package/dist/handlers/custom-fields.d.ts +3 -99
- package/dist/handlers/custom-fields.d.ts.map +1 -1
- package/dist/handlers/deals.d.ts +3 -99
- package/dist/handlers/deals.d.ts.map +1 -1
- package/dist/handlers/discussions.d.ts +3 -99
- package/dist/handlers/discussions.d.ts.map +1 -1
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/pages.d.ts +3 -99
- package/dist/handlers/pages.d.ts.map +1 -1
- package/dist/handlers/projects.d.ts +3 -99
- package/dist/handlers/projects.d.ts.map +1 -1
- package/dist/handlers/search.d.ts +1 -1
- package/dist/handlers/search.d.ts.map +1 -1
- package/dist/handlers/services.d.ts +3 -99
- package/dist/handlers/services.d.ts.map +1 -1
- package/dist/handlers/tasks.d.ts +3 -99
- package/dist/handlers/tasks.d.ts.map +1 -1
- package/dist/handlers/time.d.ts +3 -99
- package/dist/handlers/time.d.ts.map +1 -1
- package/dist/handlers/timers.d.ts +3 -99
- package/dist/handlers/timers.d.ts.map +1 -1
- package/dist/handlers-DonE83xo.js +41289 -0
- package/dist/handlers-DonE83xo.js.map +1 -0
- package/dist/handlers.js +1 -1
- package/dist/http-QQVUnV2e.js +3238 -0
- package/dist/http-QQVUnV2e.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/oauth.js.map +1 -1
- package/dist/schema.d.ts +32 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/{stdio-BFK9AcdQ.js → stdio-CRD2nJPs.js} +2 -2
- package/dist/{stdio-BFK9AcdQ.js.map → stdio-CRD2nJPs.js.map} +1 -1
- package/dist/stdio.js +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +193 -119
- package/dist/tools.js.map +1 -1
- package/dist/{version-Cy8UEAT1.js → version-DMEaGciu.js} +3 -3
- package/dist/{version-Cy8UEAT1.js.map → version-DMEaGciu.js.map} +1 -1
- package/package.json +6 -6
- package/skills/SKILL.md +113 -1
- package/dist/handlers-vtRpc-Lx.js +0 -4301
- package/dist/handlers-vtRpc-Lx.js.map +0 -1
- package/dist/http-CVE4qtko.js +0 -6541
- package/dist/http-CVE4qtko.js.map +0 -1
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ MCP (Model Context Protocol) server for [Productive.io](https://productive.io).
|
|
|
17
17
|
- Two modes: **local (stdio)** for personal use, **remote (HTTP)** for teams
|
|
18
18
|
- OAuth 2.0 support for Claude Desktop custom connectors
|
|
19
19
|
- Built-in `help` action for self-documentation
|
|
20
|
+
- Raw API escape hatches: `api_read` for documented GET endpoints and gated `api_write` for documented writes
|
|
20
21
|
|
|
21
22
|
## Mode 1: Local (stdio)
|
|
22
23
|
|
|
@@ -144,6 +145,125 @@ Use `action="help"` with any resource for detailed documentation on available pa
|
|
|
144
145
|
| `include` | string[] | Related resources to include (e.g. `["project", "assignee"]`) |
|
|
145
146
|
| `query` | string | Text search for `list` actions |
|
|
146
147
|
|
|
148
|
+
### Raw API Tools
|
|
149
|
+
|
|
150
|
+
In addition to the unified `productive` tool, the server exposes two low-level tools for documented Productive API endpoints.
|
|
151
|
+
|
|
152
|
+
| Tool | Description |
|
|
153
|
+
| ----------- | ---------------------------------------------------------------------------------------- |
|
|
154
|
+
| `api_read` | Read-only raw API access for documented `GET` endpoints |
|
|
155
|
+
| `api_write` | Gated raw API write access for documented `POST`, `PATCH`, `PUT`, and `DELETE` endpoints |
|
|
156
|
+
|
|
157
|
+
#### `api_read`
|
|
158
|
+
|
|
159
|
+
Use `api_read` when you need a documented endpoint that is not yet covered by the higher-level `productive` tool.
|
|
160
|
+
|
|
161
|
+
**Parameters**
|
|
162
|
+
|
|
163
|
+
| Parameter | Type | Description |
|
|
164
|
+
| ----------- | -------- | -------------------------------------------------------- |
|
|
165
|
+
| `path` | string | Required relative API path, starting with `/` |
|
|
166
|
+
| `describe` | boolean | Return endpoint docs instead of executing the request |
|
|
167
|
+
| `filter` | object | Filter object, validated against the documented endpoint |
|
|
168
|
+
| `include` | string[] | Related resources to include |
|
|
169
|
+
| `sort` | string[] | Sort values, validated against the documented endpoint |
|
|
170
|
+
| `page` | number | Page number |
|
|
171
|
+
| `per_page` | number | Page size, max `200` |
|
|
172
|
+
| `paginate` | boolean | Follow pagination automatically |
|
|
173
|
+
| `max_pages` | number | Max pages when `paginate=true`, default `20`, max `50` |
|
|
174
|
+
|
|
175
|
+
**Safety model**
|
|
176
|
+
|
|
177
|
+
- `GET` only
|
|
178
|
+
- Path must be relative and start with `/`
|
|
179
|
+
- Absolute URLs and path traversal are rejected
|
|
180
|
+
- Only documented Productive endpoints are allowed
|
|
181
|
+
- Filters and sort values are validated against the endpoint spec
|
|
182
|
+
- `describe=true` is the safest way to inspect an endpoint before calling it
|
|
183
|
+
|
|
184
|
+
**Examples**
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"path": "/invoices",
|
|
189
|
+
"describe": true
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"path": "/projects/123/tasks",
|
|
196
|
+
"filter": { "status": "open" },
|
|
197
|
+
"sort": ["due_date"],
|
|
198
|
+
"page": 1,
|
|
199
|
+
"per_page": 50
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"path": "/time_entries",
|
|
206
|
+
"filter": { "person_id": ["me"], "after": "2025-01-01", "before": "2025-01-31" },
|
|
207
|
+
"paginate": true,
|
|
208
|
+
"max_pages": 5
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### `api_write`
|
|
213
|
+
|
|
214
|
+
Use `api_write` only when the higher-level `productive` tool does not expose the mutation you need.
|
|
215
|
+
|
|
216
|
+
**Parameters**
|
|
217
|
+
|
|
218
|
+
| Parameter | Type | Description |
|
|
219
|
+
| --------- | ------- | -------------------------------------------------- |
|
|
220
|
+
| `method` | string | Required, one of `POST`, `PATCH`, `PUT`, `DELETE` |
|
|
221
|
+
| `path` | string | Required relative API path |
|
|
222
|
+
| `body` | object | Request body for write methods |
|
|
223
|
+
| `confirm` | boolean | Required, must be `true` |
|
|
224
|
+
| `dry_run` | boolean | Return the normalized request without executing it |
|
|
225
|
+
|
|
226
|
+
**Safety model**
|
|
227
|
+
|
|
228
|
+
- Disabled by default
|
|
229
|
+
- Requires `PRODUCTIVE_MCP_ENABLE_API_WRITE=true` on the server
|
|
230
|
+
- Requires `confirm=true` on every call
|
|
231
|
+
- Only documented Productive endpoints are allowed
|
|
232
|
+
- Path must be relative; absolute URLs and traversal are rejected
|
|
233
|
+
- `dry_run=true` lets you verify the exact method, path, and body before execution
|
|
234
|
+
|
|
235
|
+
To enable writes in local or remote deployments:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
PRODUCTIVE_MCP_ENABLE_API_WRITE=true productive-mcp-server
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Examples**
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"method": "PATCH",
|
|
246
|
+
"path": "/tasks/123",
|
|
247
|
+
"body": {
|
|
248
|
+
"data": {
|
|
249
|
+
"type": "tasks",
|
|
250
|
+
"id": "123",
|
|
251
|
+
"attributes": { "name": "Updated title" }
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"confirm": true,
|
|
255
|
+
"dry_run": true
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
{
|
|
261
|
+
"method": "DELETE",
|
|
262
|
+
"path": "/attachments/456",
|
|
263
|
+
"confirm": true
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
147
267
|
### Configuration Tools (Local mode only)
|
|
148
268
|
|
|
149
269
|
| Tool | Description |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../src/api-reference/generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,wBAAwB,EAAE,YAk3jD7B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface ApiFilterOperatorSpec {
|
|
2
|
+
description?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ApiFilterSpec {
|
|
5
|
+
type?: string;
|
|
6
|
+
format?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
enum?: Array<string | number>;
|
|
9
|
+
operators?: Record<string, ApiFilterOperatorSpec>;
|
|
10
|
+
}
|
|
11
|
+
export interface ApiQueryParamSpec {
|
|
12
|
+
type?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ApiMethodSpec {
|
|
16
|
+
summary: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
operationId?: string;
|
|
19
|
+
query?: Record<string, ApiQueryParamSpec>;
|
|
20
|
+
filters?: Record<string, ApiFilterSpec>;
|
|
21
|
+
sort?: string[];
|
|
22
|
+
pathParams?: Record<string, ApiQueryParamSpec>;
|
|
23
|
+
requestBodyFields?: string[];
|
|
24
|
+
supportsBody?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ApiEndpointSpec {
|
|
27
|
+
path: string;
|
|
28
|
+
methods: Partial<Record<'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE', ApiMethodSpec>>;
|
|
29
|
+
}
|
|
30
|
+
export type ApiReference = Record<string, ApiEndpointSpec>;
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api-reference/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;CACtF;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC"}
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["/**\n * Authentication utilities for Productive MCP server\n */\n\nexport interface ProductiveCredentials {\n organizationId: string;\n apiToken: string;\n userId?: string;\n}\n\n/**\n * Parse Bearer token containing Productive credentials\n * Token format: base64(organizationId:apiToken) or base64(organizationId:apiToken:userId)\n *\n * @param authHeader - Authorization header value (e.g., \"Bearer base64...\")\n * @returns Parsed credentials or null if invalid\n */\nexport function parseAuthHeader(\n authHeader: string | undefined | null,\n): ProductiveCredentials | null {\n if (!authHeader) {\n return null;\n }\n\n const match = authHeader.match(/^Bearer\\s+(.+)$/i);\n if (!match) {\n return null;\n }\n\n const token = match[1];\n\n try {\n const decoded = Buffer.from(token, 'base64').toString('utf-8');\n const parts = decoded.split(':');\n\n if (parts.length < 2) {\n return null;\n }\n\n const [organizationId, apiToken, userId] = parts;\n\n if (!organizationId || !apiToken) {\n return null;\n }\n\n return {\n organizationId,\n apiToken,\n userId: userId || undefined,\n };\n } catch {\n return null;\n }\n}\n\n/**\n * Create a Bearer token from Productive credentials\n * Useful for documentation and testing\n *\n * @param credentials - Productive credentials\n * @returns Base64 encoded token (without \"Bearer \" prefix)\n */\nexport function createAuthToken(credentials: ProductiveCredentials): string {\n const parts = [credentials.organizationId, credentials.apiToken];\n if (credentials.userId) {\n parts.push(credentials.userId);\n }\n return Buffer.from(parts.join(':')).toString('base64');\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,gBACd,YAC8B;
|
|
1
|
+
{"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["/**\n * Authentication utilities for Productive MCP server\n */\n\nexport interface ProductiveCredentials {\n organizationId: string;\n apiToken: string;\n userId?: string;\n}\n\n/**\n * Parse Bearer token containing Productive credentials\n * Token format: base64(organizationId:apiToken) or base64(organizationId:apiToken:userId)\n *\n * @param authHeader - Authorization header value (e.g., \"Bearer base64...\")\n * @returns Parsed credentials or null if invalid\n */\nexport function parseAuthHeader(\n authHeader: string | undefined | null,\n): ProductiveCredentials | null {\n if (!authHeader) {\n return null;\n }\n\n const match = authHeader.match(/^Bearer\\s+(.+)$/i);\n if (!match) {\n return null;\n }\n\n const token = match[1];\n\n try {\n const decoded = Buffer.from(token, 'base64').toString('utf-8');\n const parts = decoded.split(':');\n\n if (parts.length < 2) {\n return null;\n }\n\n const [organizationId, apiToken, userId] = parts;\n\n if (!organizationId || !apiToken) {\n return null;\n }\n\n return {\n organizationId,\n apiToken,\n userId: userId || undefined,\n };\n } catch {\n return null;\n }\n}\n\n/**\n * Create a Bearer token from Productive credentials\n * Useful for documentation and testing\n *\n * @param credentials - Productive credentials\n * @returns Base64 encoded token (without \"Bearer \" prefix)\n */\nexport function createAuthToken(credentials: ProductiveCredentials): string {\n const parts = [credentials.organizationId, credentials.apiToken];\n if (credentials.userId) {\n parts.push(credentials.userId);\n }\n return Buffer.from(parts.join(':')).toString('base64');\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,gBACd,YAC8B;CAC9B,IAAI,CAAC,YACH,OAAO;CAGT,MAAM,QAAQ,WAAW,MAAM,kBAAkB;CACjD,IAAI,CAAC,OACH,OAAO;CAGT,MAAM,QAAQ,MAAM;CAEpB,IAAI;EAEF,MAAM,QADU,OAAO,KAAK,OAAO,QAAQ,EAAE,SAAS,OACxC,EAAQ,MAAM,GAAG;EAE/B,IAAI,MAAM,SAAS,GACjB,OAAO;EAGT,MAAM,CAAC,gBAAgB,UAAU,UAAU;EAE3C,IAAI,CAAC,kBAAkB,CAAC,UACtB,OAAO;EAGT,OAAO;GACL;GACA;GACA,QAAQ,UAAU,KAAA;EACpB;CACF,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,SAAgB,gBAAgB,aAA4C;CAC1E,MAAM,QAAQ,CAAC,YAAY,gBAAgB,YAAY,QAAQ;CAC/D,IAAI,YAAY,QACd,MAAM,KAAK,YAAY,MAAM;CAE/B,OAAO,OAAO,KAAK,MAAM,KAAK,GAAG,CAAC,EAAE,SAAS,QAAQ;AACvD"}
|
package/dist/crypto.js
CHANGED
|
@@ -64,9 +64,9 @@ function decrypt(ciphertext, secret = getSecret()) {
|
|
|
64
64
|
try {
|
|
65
65
|
const combined = Buffer.from(ciphertext, "base64url");
|
|
66
66
|
const salt = combined.subarray(0, SALT_LENGTH);
|
|
67
|
-
const iv = combined.subarray(SALT_LENGTH,
|
|
68
|
-
const authTag = combined.subarray(
|
|
69
|
-
const encrypted = combined.subarray(
|
|
67
|
+
const iv = combined.subarray(SALT_LENGTH, 28);
|
|
68
|
+
const authTag = combined.subarray(28, 44);
|
|
69
|
+
const encrypted = combined.subarray(44);
|
|
70
70
|
const decipher = createDecipheriv(ALGORITHM, deriveKey(secret, salt), iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
71
71
|
decipher.setAuthTag(authTag);
|
|
72
72
|
return Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
|
package/dist/crypto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","names":[],"sources":["../src/crypto.ts"],"sourcesContent":["/**\n * Cryptographic utilities for stateless OAuth tokens\n *\n * Uses AES-256-GCM for authenticated encryption.\n * The authorization code contains encrypted credentials that can be\n * decrypted without server-side storage.\n */\n\nimport { createCipheriv, createDecipheriv, randomBytes, scryptSync } from 'node:crypto';\n\nconst ALGORITHM = 'aes-256-gcm';\nconst IV_LENGTH = 12; // GCM recommended IV length\nconst AUTH_TAG_LENGTH = 16;\nconst SALT_LENGTH = 16;\n\n/**\n * Derive a 256-bit key from a password using scrypt\n */\nfunction deriveKey(password: string, salt: Buffer): Buffer {\n return scryptSync(password, salt, 32);\n}\n\n/**\n * Get the encryption secret from environment or generate a default\n * In production, OAUTH_SECRET should always be set\n */\nexport function getSecret(): string {\n const secret = process.env.OAUTH_SECRET;\n if (!secret) {\n console.warn(\n 'WARNING: OAUTH_SECRET not set. Using default secret. Set OAUTH_SECRET in production!',\n );\n return 'productive-mcp-default-secret-change-me';\n }\n return secret;\n}\n\n/**\n * Encrypt data using AES-256-GCM\n *\n * Output format: base64(salt + iv + authTag + ciphertext)\n *\n * @param plaintext - Data to encrypt\n * @param secret - Encryption secret (defaults to OAUTH_SECRET env var)\n * @returns Base64-encoded encrypted data\n */\nexport function encrypt(plaintext: string, secret: string = getSecret()): string {\n const salt = randomBytes(SALT_LENGTH);\n const key = deriveKey(secret, salt);\n const iv = randomBytes(IV_LENGTH);\n\n const cipher = createCipheriv(ALGORITHM, key, iv);\n const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);\n const authTag = cipher.getAuthTag();\n\n // Combine: salt + iv + authTag + ciphertext\n const combined = Buffer.concat([salt, iv, authTag, encrypted]);\n\n return combined.toString('base64url');\n}\n\n/**\n * Decrypt data encrypted with encrypt()\n *\n * @param ciphertext - Base64-encoded encrypted data\n * @param secret - Encryption secret (defaults to OAUTH_SECRET env var)\n * @returns Decrypted plaintext\n * @throws Error if decryption fails (invalid data or wrong secret)\n */\nexport function decrypt(ciphertext: string, secret: string = getSecret()): string {\n try {\n const combined = Buffer.from(ciphertext, 'base64url');\n\n // Extract components\n const salt = combined.subarray(0, SALT_LENGTH);\n const iv = combined.subarray(SALT_LENGTH, SALT_LENGTH + IV_LENGTH);\n const authTag = combined.subarray(\n SALT_LENGTH + IV_LENGTH,\n SALT_LENGTH + IV_LENGTH + AUTH_TAG_LENGTH,\n );\n const encrypted = combined.subarray(SALT_LENGTH + IV_LENGTH + AUTH_TAG_LENGTH);\n\n const key = deriveKey(secret, salt);\n\n const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });\n decipher.setAuthTag(authTag);\n\n const decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);\n\n return decrypted.toString('utf8');\n } catch {\n throw new Error('Decryption failed: invalid token or secret');\n }\n}\n\n/**\n * Authorization code payload structure\n */\nexport interface AuthCodePayload {\n orgId: string;\n apiToken: string;\n userId?: string;\n codeChallenge?: string;\n codeChallengeMethod?: string;\n}\n\n/**\n * Create an encrypted authorization code containing credentials and PKCE challenge\n *\n * @param credentials - Object with orgId, apiToken, userId, and optional PKCE params\n * @param expiresInSeconds - Code expiration time (default: 5 minutes)\n * @returns Encrypted authorization code\n */\nexport function createAuthCode(\n credentials: AuthCodePayload,\n expiresInSeconds: number = 300,\n): string {\n const payload = {\n ...credentials,\n exp: Date.now() + expiresInSeconds * 1000,\n };\n return encrypt(JSON.stringify(payload));\n}\n\n/**\n * Decode and validate an authorization code\n *\n * @param code - Encrypted authorization code\n * @returns Decoded payload with credentials and PKCE challenge\n * @throws Error if code is invalid or expired\n */\nexport function decodeAuthCode(code: string): AuthCodePayload {\n const payload = JSON.parse(decrypt(code));\n\n if (payload.exp && Date.now() > payload.exp) {\n throw new Error('Authorization code expired');\n }\n\n const { orgId, apiToken, userId, codeChallenge, codeChallengeMethod } = payload;\n\n if (!orgId || !apiToken) {\n throw new Error('Invalid authorization code: missing credentials');\n }\n\n return { orgId, apiToken, userId, codeChallenge, codeChallengeMethod };\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,kBAAkB;AACxB,IAAM,cAAc;;;;AAKpB,SAAS,UAAU,UAAkB,MAAsB;
|
|
1
|
+
{"version":3,"file":"crypto.js","names":[],"sources":["../src/crypto.ts"],"sourcesContent":["/**\n * Cryptographic utilities for stateless OAuth tokens\n *\n * Uses AES-256-GCM for authenticated encryption.\n * The authorization code contains encrypted credentials that can be\n * decrypted without server-side storage.\n */\n\nimport { createCipheriv, createDecipheriv, randomBytes, scryptSync } from 'node:crypto';\n\nconst ALGORITHM = 'aes-256-gcm';\nconst IV_LENGTH = 12; // GCM recommended IV length\nconst AUTH_TAG_LENGTH = 16;\nconst SALT_LENGTH = 16;\n\n/**\n * Derive a 256-bit key from a password using scrypt\n */\nfunction deriveKey(password: string, salt: Buffer): Buffer {\n return scryptSync(password, salt, 32);\n}\n\n/**\n * Get the encryption secret from environment or generate a default\n * In production, OAUTH_SECRET should always be set\n */\nexport function getSecret(): string {\n const secret = process.env.OAUTH_SECRET;\n if (!secret) {\n console.warn(\n 'WARNING: OAUTH_SECRET not set. Using default secret. Set OAUTH_SECRET in production!',\n );\n return 'productive-mcp-default-secret-change-me';\n }\n return secret;\n}\n\n/**\n * Encrypt data using AES-256-GCM\n *\n * Output format: base64(salt + iv + authTag + ciphertext)\n *\n * @param plaintext - Data to encrypt\n * @param secret - Encryption secret (defaults to OAUTH_SECRET env var)\n * @returns Base64-encoded encrypted data\n */\nexport function encrypt(plaintext: string, secret: string = getSecret()): string {\n const salt = randomBytes(SALT_LENGTH);\n const key = deriveKey(secret, salt);\n const iv = randomBytes(IV_LENGTH);\n\n const cipher = createCipheriv(ALGORITHM, key, iv);\n const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);\n const authTag = cipher.getAuthTag();\n\n // Combine: salt + iv + authTag + ciphertext\n const combined = Buffer.concat([salt, iv, authTag, encrypted]);\n\n return combined.toString('base64url');\n}\n\n/**\n * Decrypt data encrypted with encrypt()\n *\n * @param ciphertext - Base64-encoded encrypted data\n * @param secret - Encryption secret (defaults to OAUTH_SECRET env var)\n * @returns Decrypted plaintext\n * @throws Error if decryption fails (invalid data or wrong secret)\n */\nexport function decrypt(ciphertext: string, secret: string = getSecret()): string {\n try {\n const combined = Buffer.from(ciphertext, 'base64url');\n\n // Extract components\n const salt = combined.subarray(0, SALT_LENGTH);\n const iv = combined.subarray(SALT_LENGTH, SALT_LENGTH + IV_LENGTH);\n const authTag = combined.subarray(\n SALT_LENGTH + IV_LENGTH,\n SALT_LENGTH + IV_LENGTH + AUTH_TAG_LENGTH,\n );\n const encrypted = combined.subarray(SALT_LENGTH + IV_LENGTH + AUTH_TAG_LENGTH);\n\n const key = deriveKey(secret, salt);\n\n const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });\n decipher.setAuthTag(authTag);\n\n const decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);\n\n return decrypted.toString('utf8');\n } catch {\n throw new Error('Decryption failed: invalid token or secret');\n }\n}\n\n/**\n * Authorization code payload structure\n */\nexport interface AuthCodePayload {\n orgId: string;\n apiToken: string;\n userId?: string;\n codeChallenge?: string;\n codeChallengeMethod?: string;\n}\n\n/**\n * Create an encrypted authorization code containing credentials and PKCE challenge\n *\n * @param credentials - Object with orgId, apiToken, userId, and optional PKCE params\n * @param expiresInSeconds - Code expiration time (default: 5 minutes)\n * @returns Encrypted authorization code\n */\nexport function createAuthCode(\n credentials: AuthCodePayload,\n expiresInSeconds: number = 300,\n): string {\n const payload = {\n ...credentials,\n exp: Date.now() + expiresInSeconds * 1000,\n };\n return encrypt(JSON.stringify(payload));\n}\n\n/**\n * Decode and validate an authorization code\n *\n * @param code - Encrypted authorization code\n * @returns Decoded payload with credentials and PKCE challenge\n * @throws Error if code is invalid or expired\n */\nexport function decodeAuthCode(code: string): AuthCodePayload {\n const payload = JSON.parse(decrypt(code));\n\n if (payload.exp && Date.now() > payload.exp) {\n throw new Error('Authorization code expired');\n }\n\n const { orgId, apiToken, userId, codeChallenge, codeChallengeMethod } = payload;\n\n if (!orgId || !apiToken) {\n throw new Error('Invalid authorization code: missing credentials');\n }\n\n return { orgId, apiToken, userId, codeChallenge, codeChallengeMethod };\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,kBAAkB;AACxB,IAAM,cAAc;;;;AAKpB,SAAS,UAAU,UAAkB,MAAsB;CACzD,OAAO,WAAW,UAAU,MAAM,EAAE;AACtC;;;;;AAMA,SAAgB,YAAoB;CAClC,MAAM,SAAS,QAAQ,IAAI;CAC3B,IAAI,CAAC,QAAQ;EACX,QAAQ,KACN,sFACF;EACA,OAAO;CACT;CACA,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,QAAQ,WAAmB,SAAiB,UAAU,GAAW;CAC/E,MAAM,OAAO,YAAY,WAAW;CACpC,MAAM,MAAM,UAAU,QAAQ,IAAI;CAClC,MAAM,KAAK,YAAY,SAAS;CAEhC,MAAM,SAAS,eAAe,WAAW,KAAK,EAAE;CAChD,MAAM,YAAY,OAAO,OAAO,CAAC,OAAO,OAAO,WAAW,MAAM,GAAG,OAAO,MAAM,CAAC,CAAC;CAClF,MAAM,UAAU,OAAO,WAAW;CAKlC,OAFiB,OAAO,OAAO;EAAC;EAAM;EAAI;EAAS;CAAS,CAErD,EAAS,SAAS,WAAW;AACtC;;;;;;;;;AAUA,SAAgB,QAAQ,YAAoB,SAAiB,UAAU,GAAW;CAChF,IAAI;EACF,MAAM,WAAW,OAAO,KAAK,YAAY,WAAW;EAGpD,MAAM,OAAO,SAAS,SAAS,GAAG,WAAW;EAC7C,MAAM,KAAK,SAAS,SAAS,aAAa,EAAuB;EACjE,MAAM,UAAU,SAAS,SACvB,IACA,EACF;EACA,MAAM,YAAY,SAAS,SAAS,EAAyC;EAI7E,MAAM,WAAW,iBAAiB,WAFtB,UAAU,QAAQ,IAEe,GAAK,IAAI,EAAE,eAAe,gBAAgB,CAAC;EACxF,SAAS,WAAW,OAAO;EAI3B,OAFkB,OAAO,OAAO,CAAC,SAAS,OAAO,SAAS,GAAG,SAAS,MAAM,CAAC,CAEtE,EAAU,SAAS,MAAM;CAClC,QAAQ;EACN,MAAM,IAAI,MAAM,4CAA4C;CAC9D;AACF;;;;;;;;AAoBA,SAAgB,eACd,aACA,mBAA2B,KACnB;CACR,MAAM,UAAU;EACd,GAAG;EACH,KAAK,KAAK,IAAI,IAAI,mBAAmB;CACvC;CACA,OAAO,QAAQ,KAAK,UAAU,OAAO,CAAC;AACxC;;;;;;;;AASA,SAAgB,eAAe,MAA+B;CAC5D,MAAM,UAAU,KAAK,MAAM,QAAQ,IAAI,CAAC;CAExC,IAAI,QAAQ,OAAO,KAAK,IAAI,IAAI,QAAQ,KACtC,MAAM,IAAI,MAAM,4BAA4B;CAG9C,MAAM,EAAE,OAAO,UAAU,QAAQ,eAAe,wBAAwB;CAExE,IAAI,CAAC,SAAS,CAAC,UACb,MAAM,IAAI,MAAM,iDAAiD;CAGnE,OAAO;EAAE;EAAO;EAAU;EAAQ;EAAe;CAAoB;AACvE"}
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC,YAAY,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,EAI5C;IAED;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAM3B;CACF;AAED;;GAEG;AACH,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC,YAAY,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,EAI5C;IAED;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAM3B;CACF;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;aAExB,SAAS,WAAW,MAAM;aAM1B,qBAAqB,aAAa,MAAM,UAAU,MAAM,EAAE;aAU1D,aAAa,WAAW,MAAM,YAAY,MAAM,gBAAgB,MAAM,EAAE;aAOxE,eAAe,aAAa,MAAM,kBAAkB,MAAM,EAAE;aAO5D,iBAAiB;aAMjB,iBAAiB,eAAe,MAAM,cAAc,MAAM,EAAE;aAO5D,sBAAsB;aAOtB,kBAAkB;aAOlB,oBAAoB;aAOpB,oBAAoB;aAOpB,uBAAuB,kBAAkB,MAAM,EAAE;aAOjD,QAAQ,eAAe,MAAM,WAAW,MAAM;CAuBtC,CAAC;AAEX;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE"}
|
|
@@ -20,103 +20,7 @@ export interface ActivityArgs extends CommonArgs {
|
|
|
20
20
|
* Supports: list
|
|
21
21
|
*/
|
|
22
22
|
export declare const handleActivities: (action: string, args: ActivityArgs & {
|
|
23
|
-
query?: string
|
|
24
|
-
type?: import("@studiometa/productive-core").ResolvableResourceType
|
|
25
|
-
}, ctx: import("./types.js").HandlerContext) => Promise<
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
_meta?: {
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
progressToken?: string | number | undefined;
|
|
30
|
-
"io.modelcontextprotocol/related-task"?: {
|
|
31
|
-
taskId: string;
|
|
32
|
-
} | undefined;
|
|
33
|
-
} | undefined;
|
|
34
|
-
content: ({
|
|
35
|
-
type: "text";
|
|
36
|
-
text: string;
|
|
37
|
-
annotations?: {
|
|
38
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
39
|
-
priority?: number | undefined;
|
|
40
|
-
lastModified?: string | undefined;
|
|
41
|
-
} | undefined;
|
|
42
|
-
_meta?: {
|
|
43
|
-
[x: string]: unknown;
|
|
44
|
-
} | undefined;
|
|
45
|
-
} | {
|
|
46
|
-
type: "image";
|
|
47
|
-
data: string;
|
|
48
|
-
mimeType: string;
|
|
49
|
-
annotations?: {
|
|
50
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
51
|
-
priority?: number | undefined;
|
|
52
|
-
lastModified?: string | undefined;
|
|
53
|
-
} | undefined;
|
|
54
|
-
_meta?: {
|
|
55
|
-
[x: string]: unknown;
|
|
56
|
-
} | undefined;
|
|
57
|
-
} | {
|
|
58
|
-
type: "audio";
|
|
59
|
-
data: string;
|
|
60
|
-
mimeType: string;
|
|
61
|
-
annotations?: {
|
|
62
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
63
|
-
priority?: number | undefined;
|
|
64
|
-
lastModified?: string | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
_meta?: {
|
|
67
|
-
[x: string]: unknown;
|
|
68
|
-
} | undefined;
|
|
69
|
-
} | {
|
|
70
|
-
uri: string;
|
|
71
|
-
description?: string | undefined;
|
|
72
|
-
mimeType?: string | undefined;
|
|
73
|
-
size?: number | undefined;
|
|
74
|
-
annotations?: {
|
|
75
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
76
|
-
priority?: number | undefined;
|
|
77
|
-
lastModified?: string | undefined;
|
|
78
|
-
} | undefined;
|
|
79
|
-
_meta?: {
|
|
80
|
-
[x: string]: unknown;
|
|
81
|
-
} | undefined;
|
|
82
|
-
icons?: {
|
|
83
|
-
src: string;
|
|
84
|
-
mimeType?: string | undefined;
|
|
85
|
-
sizes?: string[] | undefined;
|
|
86
|
-
theme?: "dark" | "light" | undefined;
|
|
87
|
-
}[] | undefined;
|
|
88
|
-
name: string;
|
|
89
|
-
title?: string | undefined;
|
|
90
|
-
type: "resource_link";
|
|
91
|
-
} | {
|
|
92
|
-
type: "resource";
|
|
93
|
-
resource: {
|
|
94
|
-
uri: string;
|
|
95
|
-
mimeType?: string | undefined;
|
|
96
|
-
_meta?: {
|
|
97
|
-
[x: string]: unknown;
|
|
98
|
-
} | undefined;
|
|
99
|
-
text: string;
|
|
100
|
-
} | {
|
|
101
|
-
uri: string;
|
|
102
|
-
mimeType?: string | undefined;
|
|
103
|
-
_meta?: {
|
|
104
|
-
[x: string]: unknown;
|
|
105
|
-
} | undefined;
|
|
106
|
-
blob: string;
|
|
107
|
-
};
|
|
108
|
-
annotations?: {
|
|
109
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
110
|
-
priority?: number | undefined;
|
|
111
|
-
lastModified?: string | undefined;
|
|
112
|
-
} | undefined;
|
|
113
|
-
_meta?: {
|
|
114
|
-
[x: string]: unknown;
|
|
115
|
-
} | undefined;
|
|
116
|
-
})[];
|
|
117
|
-
structuredContent?: {
|
|
118
|
-
[x: string]: unknown;
|
|
119
|
-
} | undefined;
|
|
120
|
-
isError?: boolean | undefined;
|
|
121
|
-
}>;
|
|
23
|
+
query?: string;
|
|
24
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
25
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
122
26
|
//# sourceMappingURL=activities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activities.d.ts","sourceRoot":"","sources":["../../src/handlers/activities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK7C;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"activities.d.ts","sourceRoot":"","sources":["../../src/handlers/activities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK7C;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;wFAc3B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HandlerContext, ToolResult } from './types.js';
|
|
2
|
+
export interface ApiReadArgs {
|
|
3
|
+
path: string;
|
|
4
|
+
describe?: boolean;
|
|
5
|
+
filter?: Record<string, unknown>;
|
|
6
|
+
include?: string[];
|
|
7
|
+
sort?: string[];
|
|
8
|
+
page?: number;
|
|
9
|
+
per_page?: number;
|
|
10
|
+
paginate?: boolean;
|
|
11
|
+
max_pages?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function handleApiRead(args: ApiReadArgs, ctx: HandlerContext): Promise<ToolResult>;
|
|
14
|
+
//# sourceMappingURL=api-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-read.d.ts","sourceRoot":"","sources":["../../src/handlers/api-read.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAa7D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CA0B/F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ApiEndpointSpec, ApiMethodSpec } from '../api-reference/types.js';
|
|
2
|
+
export declare const MAX_PER_PAGE = 200;
|
|
3
|
+
export declare const DEFAULT_MAX_PAGES = 20;
|
|
4
|
+
export declare const MAX_MAX_PAGES = 50;
|
|
5
|
+
export interface ResolvedApiEndpoint {
|
|
6
|
+
spec: ApiEndpointSpec;
|
|
7
|
+
methodSpec: ApiMethodSpec;
|
|
8
|
+
normalizedPath: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function normalizeApiPath(path: string): string;
|
|
11
|
+
export declare function resolveApiEndpoint(path: string, method: keyof ApiEndpointSpec['methods']): ResolvedApiEndpoint;
|
|
12
|
+
export declare function serializeFilter(filter?: Record<string, unknown>): Record<string, string>;
|
|
13
|
+
export declare function buildApiReadQuery(args: {
|
|
14
|
+
filter?: Record<string, unknown>;
|
|
15
|
+
include?: string[];
|
|
16
|
+
sort?: string[];
|
|
17
|
+
page?: number;
|
|
18
|
+
per_page?: number;
|
|
19
|
+
}): Record<string, string>;
|
|
20
|
+
export declare function validatePagination(args: {
|
|
21
|
+
per_page?: number;
|
|
22
|
+
max_pages?: number;
|
|
23
|
+
}): void;
|
|
24
|
+
export declare function validateFilterSpec(filter: Record<string, unknown> | undefined, methodSpec: ApiMethodSpec): void;
|
|
25
|
+
export declare function validateSort(sort: string[] | undefined, methodSpec: ApiMethodSpec): void;
|
|
26
|
+
export declare function describeApiEndpoint(path: string): Record<string, unknown>;
|
|
27
|
+
//# sourceMappingURL=api-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-utils.d.ts","sourceRoot":"","sources":["../../src/handlers/api-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAKhF,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,EAAE,aAAa,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB;AAMD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAerD;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,eAAe,CAAC,SAAS,CAAC,GACvC,mBAAmB,CAgBrB;AAwBD,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASzB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQxF;AAwCD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,UAAU,EAAE,aAAa,GACxB,IAAI,CAIN;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,UAAU,EAAE,aAAa,GAAG,IAAI,CAYxF;AA+CD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCzE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HandlerContext, ToolResult } from './types.js';
|
|
2
|
+
export interface ApiWriteArgs {
|
|
3
|
+
method: 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
4
|
+
path: string;
|
|
5
|
+
body?: unknown;
|
|
6
|
+
confirm?: boolean;
|
|
7
|
+
dry_run?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function handleApiWrite(args: ApiWriteArgs, ctx: HandlerContext): Promise<ToolResult>;
|
|
10
|
+
//# sourceMappingURL=api-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-write.d.ts","sourceRoot":"","sources":["../../src/handlers/api-write.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7D,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAoCjG"}
|
|
@@ -3,103 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { AttachmentArgs } from './types.js';
|
|
5
5
|
export declare const handleAttachments: (action: string, args: AttachmentArgs & {
|
|
6
|
-
query?: string
|
|
7
|
-
type?: import("@studiometa/productive-core").ResolvableResourceType
|
|
8
|
-
}, ctx: import("./types.js").HandlerContext) => Promise<
|
|
9
|
-
[x: string]: unknown;
|
|
10
|
-
_meta?: {
|
|
11
|
-
[x: string]: unknown;
|
|
12
|
-
progressToken?: string | number | undefined;
|
|
13
|
-
"io.modelcontextprotocol/related-task"?: {
|
|
14
|
-
taskId: string;
|
|
15
|
-
} | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
content: ({
|
|
18
|
-
type: "text";
|
|
19
|
-
text: string;
|
|
20
|
-
annotations?: {
|
|
21
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
22
|
-
priority?: number | undefined;
|
|
23
|
-
lastModified?: string | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
_meta?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
} | {
|
|
29
|
-
type: "image";
|
|
30
|
-
data: string;
|
|
31
|
-
mimeType: string;
|
|
32
|
-
annotations?: {
|
|
33
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
34
|
-
priority?: number | undefined;
|
|
35
|
-
lastModified?: string | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
_meta?: {
|
|
38
|
-
[x: string]: unknown;
|
|
39
|
-
} | undefined;
|
|
40
|
-
} | {
|
|
41
|
-
type: "audio";
|
|
42
|
-
data: string;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
annotations?: {
|
|
45
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
46
|
-
priority?: number | undefined;
|
|
47
|
-
lastModified?: string | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
_meta?: {
|
|
50
|
-
[x: string]: unknown;
|
|
51
|
-
} | undefined;
|
|
52
|
-
} | {
|
|
53
|
-
uri: string;
|
|
54
|
-
description?: string | undefined;
|
|
55
|
-
mimeType?: string | undefined;
|
|
56
|
-
size?: number | undefined;
|
|
57
|
-
annotations?: {
|
|
58
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
59
|
-
priority?: number | undefined;
|
|
60
|
-
lastModified?: string | undefined;
|
|
61
|
-
} | undefined;
|
|
62
|
-
_meta?: {
|
|
63
|
-
[x: string]: unknown;
|
|
64
|
-
} | undefined;
|
|
65
|
-
icons?: {
|
|
66
|
-
src: string;
|
|
67
|
-
mimeType?: string | undefined;
|
|
68
|
-
sizes?: string[] | undefined;
|
|
69
|
-
theme?: "dark" | "light" | undefined;
|
|
70
|
-
}[] | undefined;
|
|
71
|
-
name: string;
|
|
72
|
-
title?: string | undefined;
|
|
73
|
-
type: "resource_link";
|
|
74
|
-
} | {
|
|
75
|
-
type: "resource";
|
|
76
|
-
resource: {
|
|
77
|
-
uri: string;
|
|
78
|
-
mimeType?: string | undefined;
|
|
79
|
-
_meta?: {
|
|
80
|
-
[x: string]: unknown;
|
|
81
|
-
} | undefined;
|
|
82
|
-
text: string;
|
|
83
|
-
} | {
|
|
84
|
-
uri: string;
|
|
85
|
-
mimeType?: string | undefined;
|
|
86
|
-
_meta?: {
|
|
87
|
-
[x: string]: unknown;
|
|
88
|
-
} | undefined;
|
|
89
|
-
blob: string;
|
|
90
|
-
};
|
|
91
|
-
annotations?: {
|
|
92
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
93
|
-
priority?: number | undefined;
|
|
94
|
-
lastModified?: string | undefined;
|
|
95
|
-
} | undefined;
|
|
96
|
-
_meta?: {
|
|
97
|
-
[x: string]: unknown;
|
|
98
|
-
} | undefined;
|
|
99
|
-
})[];
|
|
100
|
-
structuredContent?: {
|
|
101
|
-
[x: string]: unknown;
|
|
102
|
-
} | undefined;
|
|
103
|
-
isError?: boolean | undefined;
|
|
104
|
-
}>;
|
|
6
|
+
query?: string;
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
105
9
|
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/handlers/attachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/handlers/attachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,eAAO,MAAM,iBAAiB;;;wFAoB5B,CAAC"}
|
|
@@ -3,103 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { BookingArgs } from './types.js';
|
|
5
5
|
export declare const handleBookings: (action: string, args: BookingArgs & {
|
|
6
|
-
query?: string
|
|
7
|
-
type?: import("@studiometa/productive-core").ResolvableResourceType
|
|
8
|
-
}, ctx: import("./types.js").HandlerContext) => Promise<
|
|
9
|
-
[x: string]: unknown;
|
|
10
|
-
_meta?: {
|
|
11
|
-
[x: string]: unknown;
|
|
12
|
-
progressToken?: string | number | undefined;
|
|
13
|
-
"io.modelcontextprotocol/related-task"?: {
|
|
14
|
-
taskId: string;
|
|
15
|
-
} | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
content: ({
|
|
18
|
-
type: "text";
|
|
19
|
-
text: string;
|
|
20
|
-
annotations?: {
|
|
21
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
22
|
-
priority?: number | undefined;
|
|
23
|
-
lastModified?: string | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
_meta?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
} | {
|
|
29
|
-
type: "image";
|
|
30
|
-
data: string;
|
|
31
|
-
mimeType: string;
|
|
32
|
-
annotations?: {
|
|
33
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
34
|
-
priority?: number | undefined;
|
|
35
|
-
lastModified?: string | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
_meta?: {
|
|
38
|
-
[x: string]: unknown;
|
|
39
|
-
} | undefined;
|
|
40
|
-
} | {
|
|
41
|
-
type: "audio";
|
|
42
|
-
data: string;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
annotations?: {
|
|
45
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
46
|
-
priority?: number | undefined;
|
|
47
|
-
lastModified?: string | undefined;
|
|
48
|
-
} | undefined;
|
|
49
|
-
_meta?: {
|
|
50
|
-
[x: string]: unknown;
|
|
51
|
-
} | undefined;
|
|
52
|
-
} | {
|
|
53
|
-
uri: string;
|
|
54
|
-
description?: string | undefined;
|
|
55
|
-
mimeType?: string | undefined;
|
|
56
|
-
size?: number | undefined;
|
|
57
|
-
annotations?: {
|
|
58
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
59
|
-
priority?: number | undefined;
|
|
60
|
-
lastModified?: string | undefined;
|
|
61
|
-
} | undefined;
|
|
62
|
-
_meta?: {
|
|
63
|
-
[x: string]: unknown;
|
|
64
|
-
} | undefined;
|
|
65
|
-
icons?: {
|
|
66
|
-
src: string;
|
|
67
|
-
mimeType?: string | undefined;
|
|
68
|
-
sizes?: string[] | undefined;
|
|
69
|
-
theme?: "dark" | "light" | undefined;
|
|
70
|
-
}[] | undefined;
|
|
71
|
-
name: string;
|
|
72
|
-
title?: string | undefined;
|
|
73
|
-
type: "resource_link";
|
|
74
|
-
} | {
|
|
75
|
-
type: "resource";
|
|
76
|
-
resource: {
|
|
77
|
-
uri: string;
|
|
78
|
-
mimeType?: string | undefined;
|
|
79
|
-
_meta?: {
|
|
80
|
-
[x: string]: unknown;
|
|
81
|
-
} | undefined;
|
|
82
|
-
text: string;
|
|
83
|
-
} | {
|
|
84
|
-
uri: string;
|
|
85
|
-
mimeType?: string | undefined;
|
|
86
|
-
_meta?: {
|
|
87
|
-
[x: string]: unknown;
|
|
88
|
-
} | undefined;
|
|
89
|
-
blob: string;
|
|
90
|
-
};
|
|
91
|
-
annotations?: {
|
|
92
|
-
audience?: ("assistant" | "user")[] | undefined;
|
|
93
|
-
priority?: number | undefined;
|
|
94
|
-
lastModified?: string | undefined;
|
|
95
|
-
} | undefined;
|
|
96
|
-
_meta?: {
|
|
97
|
-
[x: string]: unknown;
|
|
98
|
-
} | undefined;
|
|
99
|
-
})[];
|
|
100
|
-
structuredContent?: {
|
|
101
|
-
[x: string]: unknown;
|
|
102
|
-
} | undefined;
|
|
103
|
-
isError?: boolean | undefined;
|
|
104
|
-
}>;
|
|
6
|
+
query?: string;
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
105
9
|
//# sourceMappingURL=bookings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings.d.ts","sourceRoot":"","sources":["../../src/handlers/bookings.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQ9C,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"bookings.d.ts","sourceRoot":"","sources":["../../src/handlers/bookings.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQ9C,eAAO,MAAM,cAAc;;;wFA6CzB,CAAC"}
|