@studiometa/productive-mcp 0.9.2 → 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/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/formatters.d.ts +0 -4
- package/dist/formatters.d.ts.map +1 -1
- package/dist/handlers/attachments.d.ts +5 -2
- package/dist/handlers/attachments.d.ts.map +1 -1
- package/dist/handlers/batch.d.ts +58 -0
- package/dist/handlers/batch.d.ts.map +1 -0
- package/dist/handlers/bookings.d.ts +5 -2
- package/dist/handlers/bookings.d.ts.map +1 -1
- package/dist/handlers/comments.d.ts +5 -2
- package/dist/handlers/comments.d.ts.map +1 -1
- package/dist/handlers/companies.d.ts +11 -5
- package/dist/handlers/companies.d.ts.map +1 -1
- package/dist/handlers/deals.d.ts +4 -5
- package/dist/handlers/deals.d.ts.map +1 -1
- package/dist/handlers/discussions.d.ts +5 -9
- package/dist/handlers/discussions.d.ts.map +1 -1
- package/dist/handlers/factory.d.ts +116 -0
- package/dist/handlers/factory.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/pages.d.ts +12 -9
- package/dist/handlers/pages.d.ts.map +1 -1
- package/dist/handlers/projects.d.ts +11 -5
- package/dist/handlers/projects.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/services.d.ts +12 -2
- package/dist/handlers/services.d.ts.map +1 -1
- package/dist/handlers/tasks.d.ts +4 -5
- package/dist/handlers/tasks.d.ts.map +1 -1
- package/dist/handlers/time.d.ts +4 -6
- package/dist/handlers/time.d.ts.map +1 -1
- package/dist/handlers/timers.d.ts +5 -2
- package/dist/handlers/timers.d.ts.map +1 -1
- package/dist/handlers/types.d.ts +6 -0
- package/dist/handlers/types.d.ts.map +1 -1
- package/dist/{handlers-D4tRd30c.js → handlers-DWowqxFA.js} +1247 -898
- package/dist/handlers-DWowqxFA.js.map +1 -0
- package/dist/handlers.js +1 -1
- package/dist/hints.d.ts +0 -4
- package/dist/hints.d.ts.map +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/schema.d.ts +17 -2
- 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-IB2ulmSy.js → version-DoRPyhTL.js} +2 -2
- package/dist/{version-IB2ulmSy.js.map → version-DoRPyhTL.js.map} +1 -1
- package/package.json +3 -3
- package/skills/SKILL.md +35 -54
- package/dist/handlers/budgets.d.ts +0 -9
- package/dist/handlers/budgets.d.ts.map +0 -1
- package/dist/handlers-D4tRd30c.js.map +0 -1
package/dist/errors.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare const ErrorMessages: {
|
|
|
32
32
|
readonly noUserIdConfigured: () => UserInputError;
|
|
33
33
|
readonly missingCommentTarget: () => UserInputError;
|
|
34
34
|
readonly missingBookingTarget: () => UserInputError;
|
|
35
|
+
readonly noUpdateFieldsSpecified: (allowedFields: string[]) => UserInputError;
|
|
35
36
|
readonly apiError: (statusCode: number, message: string) => UserInputError;
|
|
36
37
|
};
|
|
37
38
|
/**
|
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;gBAErB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE;IAM7C;;OAEG;IACH,kBAAkB,IAAI,MAAM;CAO7B;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;iCAEJ,MAAM;+CAMQ,MAAM,UAAU,MAAM,EAAE;qCAUlC,MAAM,YAAY,MAAM,gBAAgB,MAAM,EAAE;yCAO5C,MAAM,kBAAkB,MAAM,EAAE;;6CAa5B,MAAM,cAAc,MAAM,EAAE;;;;;
|
|
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;gBAErB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE;IAM7C;;OAEG;IACH,kBAAkB,IAAI,MAAM;CAO7B;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;iCAEJ,MAAM;+CAMQ,MAAM,UAAU,MAAM,EAAE;qCAUlC,MAAM,YAAY,MAAM,gBAAgB,MAAM,EAAE;yCAO5C,MAAM,kBAAkB,MAAM,EAAE;;6CAa5B,MAAM,cAAc,MAAM,EAAE;;;;;sDAmCnB,MAAM,EAAE;oCAO1B,MAAM,WAAW,MAAM;CAuBtC,CAAC;AAEX;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE"}
|
package/dist/formatters.d.ts
CHANGED
|
@@ -37,10 +37,6 @@ export declare function formatPerson(person: JsonApiResource, options?: McpForma
|
|
|
37
37
|
* Format service for agent consumption
|
|
38
38
|
*/
|
|
39
39
|
export declare function formatService(service: JsonApiResource, options?: McpFormatOptions): Record<string, unknown>;
|
|
40
|
-
/**
|
|
41
|
-
* Format budget for agent consumption
|
|
42
|
-
*/
|
|
43
|
-
export declare function formatBudget(budget: JsonApiResource, options?: McpFormatOptions): Record<string, unknown>;
|
|
44
40
|
/**
|
|
45
41
|
* Format company for agent consumption
|
|
46
42
|
*/
|
package/dist/formatters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAeL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC;AAcjF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAaD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,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SAAS,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,CAAC,EACnE,IAAI,CAAC,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,gBAAgB,GACzB;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,mBAAmB,CAAA;CAAE,CAY3C"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Attachments MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type { AttachmentArgs
|
|
5
|
-
export declare
|
|
4
|
+
import type { AttachmentArgs } from './types.js';
|
|
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<import("./types.js").ToolResult>;
|
|
6
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,
|
|
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"}
|
|
@@ -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 +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@@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bookings MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type { BookingArgs
|
|
5
|
-
export declare
|
|
4
|
+
import type { BookingArgs } from './types.js';
|
|
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<import("./types.js").ToolResult>;
|
|
6
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,
|
|
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"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Comments MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type { CommentArgs
|
|
5
|
-
export declare
|
|
4
|
+
import type { CommentArgs } from './types.js';
|
|
5
|
+
export declare const handleComments: (action: string, args: CommentArgs & {
|
|
6
|
+
query?: string;
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
6
9
|
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/handlers/comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/handlers/comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQ9C,eAAO,MAAM,cAAc;;;wFA6CzB,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Companies MCP handler.
|
|
3
|
+
*
|
|
4
|
+
* Uses the createResourceHandler factory for the common list/get/create/update/resolve pattern.
|
|
3
5
|
*/
|
|
4
|
-
import type { CompanyArgs
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import type { CompanyArgs } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Handle companies resource.
|
|
9
|
+
*
|
|
10
|
+
* Supports: list, get, create, update, resolve
|
|
11
|
+
*/
|
|
12
|
+
export declare const handleCompanies: (action: string, args: CompanyArgs & {
|
|
7
13
|
query?: string;
|
|
8
|
-
type?: ResolvableResourceType;
|
|
9
|
-
}, ctx: HandlerContext)
|
|
14
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
15
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
10
16
|
//# sourceMappingURL=companies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/handlers/companies.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"companies.d.ts","sourceRoot":"","sources":["../../src/handlers/companies.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAS9C;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;wFAmB1B,CAAC"}
|
package/dist/handlers/deals.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deals MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type { DealArgs
|
|
5
|
-
|
|
6
|
-
export declare function handleDeals(action: string, args: DealArgs & {
|
|
4
|
+
import type { DealArgs } from './types.js';
|
|
5
|
+
export declare const handleDeals: (action: string, args: DealArgs & {
|
|
7
6
|
query?: string;
|
|
8
|
-
type?: ResolvableResourceType;
|
|
9
|
-
}, ctx: HandlerContext)
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
10
9
|
//# sourceMappingURL=deals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deals.d.ts","sourceRoot":"","sources":["../../src/handlers/deals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"deals.d.ts","sourceRoot":"","sources":["../../src/handlers/deals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3C,eAAO,MAAM,WAAW;;;wFAwBtB,CAAC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Discussions MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
page_id?: string;
|
|
10
|
-
status?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function handleDiscussions(action: string, args: DiscussionArgs, ctx: HandlerContext): Promise<ToolResult>;
|
|
4
|
+
import type { DiscussionArgs } from './types.js';
|
|
5
|
+
export declare const handleDiscussions: (action: string, args: DiscussionArgs & {
|
|
6
|
+
query?: string;
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
13
9
|
//# sourceMappingURL=discussions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discussions.d.ts","sourceRoot":"","sources":["../../src/handlers/discussions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"discussions.d.ts","sourceRoot":"","sources":["../../src/handlers/discussions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAcjD,eAAO,MAAM,iBAAiB;;;wFA+C5B,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory for creating resource handlers.
|
|
3
|
+
*
|
|
4
|
+
* Encapsulates the repetitive list/get/create/update/delete/resolve pattern
|
|
5
|
+
* shared by all MCP resource handlers.
|
|
6
|
+
*/
|
|
7
|
+
import type { JsonApiResource } from '@studiometa/productive-api';
|
|
8
|
+
import type { ExecutorContext, ResolvedInfo } from '@studiometa/productive-core';
|
|
9
|
+
import type { McpFormatOptions } from '../formatters.js';
|
|
10
|
+
import type { ContextualHints } from '../hints.js';
|
|
11
|
+
import type { CommonArgs, HandlerContext, ToolResult } from './types.js';
|
|
12
|
+
import { type ResolvableResourceType } from './resolve.js';
|
|
13
|
+
export type { ExecutorContext };
|
|
14
|
+
/**
|
|
15
|
+
* Result type from executors (list operations)
|
|
16
|
+
*/
|
|
17
|
+
interface ListExecutorResult {
|
|
18
|
+
data: JsonApiResource[];
|
|
19
|
+
meta?: {
|
|
20
|
+
total_count?: number;
|
|
21
|
+
total_pages?: number;
|
|
22
|
+
current_page?: number;
|
|
23
|
+
};
|
|
24
|
+
included?: JsonApiResource[];
|
|
25
|
+
resolved?: Record<string, ResolvedInfo>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Result type from executors (single resource operations)
|
|
29
|
+
*/
|
|
30
|
+
interface SingleExecutorResult {
|
|
31
|
+
data: JsonApiResource;
|
|
32
|
+
included?: JsonApiResource[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Configuration for the create action
|
|
36
|
+
*/
|
|
37
|
+
interface CreateConfig<TArgs> {
|
|
38
|
+
/** Fields that must be present for create */
|
|
39
|
+
required: (keyof TArgs)[];
|
|
40
|
+
/** Custom validation that returns a ToolResult on error, or undefined if valid */
|
|
41
|
+
validateArgs?: (args: TArgs) => ToolResult | undefined;
|
|
42
|
+
/** Map args to executor options */
|
|
43
|
+
mapOptions: (args: TArgs) => Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Configuration for the update action
|
|
47
|
+
*/
|
|
48
|
+
interface UpdateConfig<TArgs> {
|
|
49
|
+
/** Fields that can be updated - if none provided, error is returned */
|
|
50
|
+
allowedFields?: (keyof TArgs)[];
|
|
51
|
+
/** Map args to executor options (id is handled automatically) */
|
|
52
|
+
mapOptions: (args: TArgs) => Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Configuration for a resource handler
|
|
56
|
+
*/
|
|
57
|
+
export interface ResourceHandlerConfig<TArgs extends CommonArgs = CommonArgs> {
|
|
58
|
+
/** Resource name (e.g., 'projects', 'tasks') */
|
|
59
|
+
resource: string;
|
|
60
|
+
/** Display name for error messages (defaults to resource) */
|
|
61
|
+
displayName?: string;
|
|
62
|
+
/** Valid actions for this resource */
|
|
63
|
+
actions: string[];
|
|
64
|
+
/** Formatter function for this resource */
|
|
65
|
+
formatter: (item: JsonApiResource, options?: McpFormatOptions) => Record<string, unknown>;
|
|
66
|
+
/** Optional hints generator for get action */
|
|
67
|
+
hints?: (data: JsonApiResource, id: string) => ContextualHints;
|
|
68
|
+
/** Default include for list/get operations */
|
|
69
|
+
defaultInclude?: {
|
|
70
|
+
list?: string[];
|
|
71
|
+
get?: string[];
|
|
72
|
+
};
|
|
73
|
+
/** Whether this resource supports the resolve action */
|
|
74
|
+
supportsResolve?: boolean;
|
|
75
|
+
/** Extract additional filters from args for list operations */
|
|
76
|
+
listFilterFromArgs?: (args: TArgs) => Record<string, string>;
|
|
77
|
+
/** Extract extra args to pass to handleResolve (e.g., project_id for tasks/time) */
|
|
78
|
+
resolveArgsFromArgs?: (args: TArgs) => Record<string, string | undefined>;
|
|
79
|
+
/** Custom action handlers for non-CRUD actions (e.g., resolve/reopen for discussions, start/stop for timers) */
|
|
80
|
+
customActions?: Record<string, (args: TArgs, ctx: HandlerContext, execCtx: ExecutorContext) => Promise<ToolResult>>;
|
|
81
|
+
/** Create action configuration (if supported) */
|
|
82
|
+
create?: CreateConfig<TArgs>;
|
|
83
|
+
/** Update action configuration (if supported) */
|
|
84
|
+
update?: UpdateConfig<TArgs>;
|
|
85
|
+
/** Executors for each action */
|
|
86
|
+
executors: {
|
|
87
|
+
list: (options: any, ctx: ExecutorContext) => Promise<ListExecutorResult>;
|
|
88
|
+
get?: (options: any, ctx: ExecutorContext) => Promise<SingleExecutorResult>;
|
|
89
|
+
create?: (options: any, ctx: ExecutorContext) => Promise<SingleExecutorResult>;
|
|
90
|
+
update?: (options: any, ctx: ExecutorContext) => Promise<SingleExecutorResult>;
|
|
91
|
+
delete?: (options: any, ctx: ExecutorContext) => Promise<unknown>;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Create a resource handler function from configuration.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* export const handleProjects = createResourceHandler({
|
|
100
|
+
* resource: 'projects',
|
|
101
|
+
* actions: ['list', 'get', 'resolve'],
|
|
102
|
+
* formatter: formatProject,
|
|
103
|
+
* hints: (data, id) => getProjectHints(id),
|
|
104
|
+
* supportsResolve: true,
|
|
105
|
+
* executors: {
|
|
106
|
+
* list: listProjects,
|
|
107
|
+
* get: getProject,
|
|
108
|
+
* },
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare function createResourceHandler<TArgs extends CommonArgs = CommonArgs>(config: ResourceHandlerConfig<TArgs>): (action: string, args: TArgs & {
|
|
113
|
+
query?: string;
|
|
114
|
+
type?: ResolvableResourceType;
|
|
115
|
+
}, ctx: HandlerContext) => Promise<ToolResult>;
|
|
116
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/handlers/factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIzE,OAAO,EAAiB,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAI1E,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;GAEG;AACH,UAAU,kBAAkB;IAC1B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7E,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED;;GAEG;AACH,UAAU,YAAY,CAAC,KAAK;IAC1B,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,MAAM,KAAK,CAAC,E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,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,sBAAsB,CAAA;CAAE,EAC/D,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC,UAAU,CAAC,CAgJvB"}
|
|
@@ -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;
|
|
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;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"}
|
package/dist/handlers/pages.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pages MCP handler.
|
|
3
|
+
*
|
|
4
|
+
* Uses the createResourceHandler factory for the common list/get/create/update/delete pattern.
|
|
3
5
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import type { PageArgs } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Handle pages resource.
|
|
9
|
+
*
|
|
10
|
+
* Supports: list, get, create, update, delete
|
|
11
|
+
*/
|
|
12
|
+
export declare const handlePages: (action: string, args: PageArgs & {
|
|
13
|
+
query?: string;
|
|
14
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
15
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
13
16
|
//# sourceMappingURL=pages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/handlers/pages.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/handlers/pages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAS3C;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;wFAyBtB,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Projects MCP handler.
|
|
3
|
+
*
|
|
4
|
+
* Uses the createResourceHandler factory for the common list/get/resolve pattern.
|
|
3
5
|
*/
|
|
4
|
-
import type { CommonArgs
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import type { CommonArgs } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Handle projects resource.
|
|
9
|
+
*
|
|
10
|
+
* Supports: list, get, resolve
|
|
11
|
+
*/
|
|
12
|
+
export declare const handleProjects: (action: string, args: CommonArgs & {
|
|
7
13
|
query?: string;
|
|
8
|
-
type?: ResolvableResourceType;
|
|
9
|
-
}, ctx: HandlerContext)
|
|
14
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
15
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
10
16
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/handlers/projects.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
|
@@ -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"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Services MCP handler.
|
|
3
|
+
*
|
|
4
|
+
* Uses the createResourceHandler factory for the common list pattern.
|
|
3
5
|
*/
|
|
4
|
-
import type { CommonArgs
|
|
5
|
-
|
|
6
|
+
import type { CommonArgs } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Handle services resource.
|
|
9
|
+
*
|
|
10
|
+
* Supports: list
|
|
11
|
+
*/
|
|
12
|
+
export declare const handleServices: (action: string, args: CommonArgs & {
|
|
13
|
+
query?: string;
|
|
14
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
15
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
6
16
|
//# sourceMappingURL=services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/handlers/services.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/handlers/services.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK7C;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;wFAOzB,CAAC"}
|
package/dist/handlers/tasks.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tasks MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export declare function handleTasks(action: string, args: TaskArgs & {
|
|
4
|
+
import type { TaskArgs } from './types.js';
|
|
5
|
+
export declare const handleTasks: (action: string, args: TaskArgs & {
|
|
7
6
|
query?: string;
|
|
8
|
-
type?: ResolvableResourceType;
|
|
9
|
-
}, ctx: HandlerContext)
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
10
9
|
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/handlers/tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,
|
|
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"}
|
package/dist/handlers/time.d.ts
CHANGED
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
* Thin adapter that delegates business logic to core executors
|
|
5
5
|
* and handles MCP-specific concerns (hints, error formatting, JSON results).
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
export declare function handleTime(action: string, args: CommonArgs & {
|
|
7
|
+
import type { TimeArgs } from './types.js';
|
|
8
|
+
export declare const handleTime: (action: string, args: TimeArgs & {
|
|
10
9
|
query?: string;
|
|
11
|
-
type?: ResolvableResourceType;
|
|
12
|
-
|
|
13
|
-
}, ctx: HandlerContext): Promise<ToolResult>;
|
|
10
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
11
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
14
12
|
//# sourceMappingURL=time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/handlers/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/handlers/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3C,eAAO,MAAM,UAAU;;;wFAqCrB,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Timers MCP handler.
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
export declare
|
|
4
|
+
import type { TimerArgs } from './types.js';
|
|
5
|
+
export declare const handleTimers: (action: string, args: TimerArgs & {
|
|
6
|
+
query?: string;
|
|
7
|
+
type?: import("@studiometa/productive-core").ResolvableResourceType;
|
|
8
|
+
}, ctx: import("./types.js").HandlerContext) => Promise<import("./types.js").ToolResult>;
|
|
6
9
|
//# sourceMappingURL=timers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timers.d.ts","sourceRoot":"","sources":["../../src/handlers/timers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"timers.d.ts","sourceRoot":"","sources":["../../src/handlers/timers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,eAAO,MAAM,YAAY;;;wFAqCvB,CAAC"}
|
package/dist/handlers/types.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ export interface TaskArgs extends CommonArgs {
|
|
|
55
55
|
description?: string;
|
|
56
56
|
assignee_id?: string;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Time entry-specific args
|
|
60
|
+
*/
|
|
61
|
+
export interface TimeArgs extends CommonArgs {
|
|
62
|
+
project_id?: string;
|
|
63
|
+
}
|
|
58
64
|
/**
|
|
59
65
|
* Comment-specific args
|
|
60
66
|
*/
|