@studiometa/productive-mcp 0.10.0 → 0.10.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/dist/handlers/batch.d.ts +58 -0
- package/dist/handlers/batch.d.ts.map +1 -0
- package/dist/handlers/help.d.ts.map +1 -1
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/schema.d.ts +33 -0
- package/dist/handlers/schema.d.ts.map +1 -0
- package/dist/handlers/search.d.ts +28 -0
- package/dist/handlers/search.d.ts.map +1 -0
- package/dist/{handlers-BE3CYyVX.js → handlers-DWowqxFA.js} +615 -5
- package/dist/handlers-DWowqxFA.js.map +1 -0
- package/dist/handlers.js +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/schema.d.ts +17 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/stdio.js +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +63 -15
- package/dist/tools.js.map +1 -1
- package/dist/{version-BKUpCCHx.js → version-DoRPyhTL.js} +2 -2
- package/dist/{version-BKUpCCHx.js.map → version-DoRPyhTL.js.map} +1 -1
- package/package.json +3 -3
- package/skills/SKILL.md +4 -0
- package/dist/handlers-BE3CYyVX.js.map +0 -1
|
@@ -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/batch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;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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;AA8pB7C;;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;
|
|
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;AA0B7D,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,CAgKrB"}
|
|
@@ -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"}
|