@studiometa/productive-mcp 0.10.0 → 0.10.2

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.
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Batch handler - execute multiple operations in a single call
3
+ *
4
+ * Enables AI agents to reduce round-trips by batching multiple
5
+ * Productive.io operations into one MCP tool call.
6
+ */
7
+ import type { ProductiveCredentials } from '../auth.js';
8
+ import type { ToolResult } from './types.js';
9
+ /** Maximum number of operations allowed in a single batch */
10
+ export declare const MAX_BATCH_SIZE = 10;
11
+ /**
12
+ * A single operation within a batch request
13
+ */
14
+ export interface BatchOperation {
15
+ resource: string;
16
+ action: string;
17
+ [key: string]: unknown;
18
+ }
19
+ /**
20
+ * Result of a single batch operation
21
+ */
22
+ export interface BatchOperationResult {
23
+ resource: string;
24
+ action: string;
25
+ index: number;
26
+ data?: unknown;
27
+ error?: string;
28
+ }
29
+ /**
30
+ * Summary of batch execution
31
+ */
32
+ export interface BatchSummary {
33
+ total: number;
34
+ succeeded: number;
35
+ failed: number;
36
+ }
37
+ /**
38
+ * Full batch response
39
+ */
40
+ export interface BatchResponse {
41
+ _batch: BatchSummary;
42
+ results: BatchOperationResult[];
43
+ }
44
+ /**
45
+ * Function signature for executing a single tool operation
46
+ * Injected for testability - in production this is executeToolWithCredentials
47
+ */
48
+ export type ExecuteFunction = (name: string, args: Record<string, unknown>, credentials: ProductiveCredentials) => Promise<ToolResult>;
49
+ /**
50
+ * Handle batch operation - execute multiple operations in parallel
51
+ *
52
+ * @param operations - Array of operations to execute
53
+ * @param credentials - API credentials
54
+ * @param execute - Function to execute individual operations (injected for testability)
55
+ * @returns Batch response with summary and individual results
56
+ */
57
+ export declare function handleBatch(operations: unknown, credentials: ProductiveCredentials, execute: ExecuteFunction): Promise<ToolResult>;
58
+ //# sourceMappingURL=batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/handlers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AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3C,eAAO,MAAM,WAAW;;;wFAwBtB,CAAC"}
1
+ {"version":3,"file":"deals.d.ts","sourceRoot":"","sources":["../../src/handlers/deals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,eAAO,MAAM,WAAW;;;wFAsCtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/handlers/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA2mB7C;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAcvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,UAAU,CAW/C"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/handlers/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAgrB7C;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAevD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,UAAU,CAY/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,YAAY,CAAC;AAuB7D,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA2D7C;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,EAAE,qBAAqB,GACjC,OAAO,CAAC,UAAU,CAAC,CA6IrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,YAAY,CAAC;AA2B7D,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA8D7C;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,EAAE,qBAAqB,GACjC,OAAO,CAAC,UAAU,CAAC,CAoKrB"}
@@ -7,7 +7,7 @@ import type { CommonArgs } from './types.js';
7
7
  /**
8
8
  * Handle projects resource.
9
9
  *
10
- * Supports: list, get, resolve
10
+ * Supports: list, get, resolve, context
11
11
  */
12
12
  export declare const handleProjects: (action: string, args: CommonArgs & {
13
13
  query?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/handlers/projects.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;wFAUzB,CAAC"}
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/handlers/projects.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ7C;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;wFAwBzB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Schema handler - provides compact, machine-readable resource specifications
3
+ *
4
+ * More concise than action=help, optimized for LLM consumption when only
5
+ * field metadata is needed (filters, create fields, includes).
6
+ */
7
+ import type { ToolResult } from './types.js';
8
+ /**
9
+ * Field specification for create/update operations
10
+ */
11
+ export interface ResourceFieldSpec {
12
+ required: boolean;
13
+ type: string;
14
+ }
15
+ /**
16
+ * Compact schema data for a resource
17
+ */
18
+ export interface ResourceSchemaData {
19
+ actions: string[];
20
+ filters: Record<string, string>;
21
+ create?: Record<string, ResourceFieldSpec>;
22
+ update?: string[];
23
+ includes?: string[];
24
+ }
25
+ /**
26
+ * Handle schema action - returns compact specification for a specific resource
27
+ */
28
+ export declare function handleSchema(resource: string): ToolResult;
29
+ /**
30
+ * Get schema overview for all resources
31
+ */
32
+ export declare function handleSchemaOverview(): ToolResult;
33
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/handlers/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AA0MD;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAazD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,CAUjD"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Cross-resource search handler for MCP.
3
+ *
4
+ * Fans out a text query across multiple resource types simultaneously,
5
+ * returning grouped results in a single tool call.
6
+ */
7
+ import type { ProductiveCredentials } from '../auth.js';
8
+ import type { ToolResult } from './types.js';
9
+ /**
10
+ * Resources that support the query filter for text search
11
+ */
12
+ export declare const SEARCHABLE_RESOURCES: readonly ["projects", "companies", "people", "tasks", "deals"];
13
+ export type SearchableResource = (typeof SEARCHABLE_RESOURCES)[number];
14
+ /**
15
+ * Type for the execute function injected for delegation
16
+ */
17
+ export type ExecuteFunction = (name: string, args: Record<string, unknown>, credentials: ProductiveCredentials) => Promise<ToolResult>;
18
+ /**
19
+ * Handle cross-resource search.
20
+ *
21
+ * @param query - Search query text (required)
22
+ * @param resources - Resource types to search (optional, defaults to DEFAULT_SEARCH_RESOURCES)
23
+ * @param credentials - Productive API credentials
24
+ * @param execute - Function to execute tool calls (injected for delegation and testing)
25
+ * @returns Grouped search results across all requested resources
26
+ */
27
+ export declare function handleSearch(query: string | undefined, resources: string[] | undefined, credentials: ProductiveCredentials, execute: ExecuteFunction): Promise<ToolResult>;
28
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/handlers/search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C;;GAEG;AACH,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;AACnG,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAOvE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,EAAE,qBAAqB,KAC/B,OAAO,CAAC,UAAU,CAAC,CAAC;AAUzB;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,EAC/B,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,UAAU,CAAC,CAmFrB"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Summaries MCP handler.
3
+ *
4
+ * Custom handler for dashboard-style summaries (not using createResourceHandler).
5
+ * Routes actions to the appropriate summary executor.
6
+ */
7
+ import type { HandlerContext, ToolResult } from './types.js';
8
+ interface SummaryArgs {
9
+ project_id?: string;
10
+ }
11
+ /**
12
+ * Handle summaries resource.
13
+ *
14
+ * Supports: my_day, project_health, team_pulse
15
+ */
16
+ export declare function handleSummaries(action: string, args: SummaryArgs, ctx: HandlerContext): Promise<ToolResult>;
17
+ export {};
18
+ //# sourceMappingURL=summaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summaries.d.ts","sourceRoot":"","sources":["../../src/handlers/summaries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAO7D,UAAU,WAAW;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,UAAU,CAAC,CA2ErB"}
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/handlers/tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3C,eAAO,MAAM,WAAW;;;wFAsCtB,CAAC"}
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/handlers/tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,eAAO,MAAM,WAAW;;;wFAsDtB,CAAC"}