@monadsag/productive-mcp 1.2.61 → 1.2.62
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/build/prompts/registry.js +24 -0
- package/build/server.js +3 -17
- package/build/tools/projects.js +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { generateTimesheetPrompt, timesheetPromptDefinition, generateQuickTimesheetPrompt, quickTimesheetPromptDefinition, } from './timesheet.js';
|
|
3
|
+
/**
|
|
4
|
+
* Register the prompt handlers on a server. Shared by both entry points (stdio
|
|
5
|
+
* and Worker), like `registerToolsOnServer`; the server must declare the
|
|
6
|
+
* `prompts` capability. The prompts are static guidance and need no API token,
|
|
7
|
+
* so the Worker registers them on the no-token path as well.
|
|
8
|
+
*/
|
|
9
|
+
export function registerPromptsOnServer(server) {
|
|
10
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
11
|
+
prompts: [timesheetPromptDefinition, quickTimesheetPromptDefinition],
|
|
12
|
+
}));
|
|
13
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
14
|
+
const { name, arguments: args } = request.params;
|
|
15
|
+
switch (name) {
|
|
16
|
+
case 'timesheet_entry':
|
|
17
|
+
return await generateTimesheetPrompt(args);
|
|
18
|
+
case 'timesheet_step':
|
|
19
|
+
return await generateQuickTimesheetPrompt(args);
|
|
20
|
+
default:
|
|
21
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
package/build/server.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
import { ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
4
|
import { getConfig } from './config/index.js';
|
|
6
5
|
import { ProductiveAPIClient } from './api/client.js';
|
|
7
6
|
import { withSelfPersonId } from './auth/self-resolver.js';
|
|
8
7
|
import { registerToolsOnServer } from './tools/registry.js';
|
|
9
8
|
import { getEnabledToolNames } from './tools/toolsets.js';
|
|
10
9
|
import { LOGO_DATA_URI } from './auth/logo.js';
|
|
11
|
-
import {
|
|
10
|
+
import { registerPromptsOnServer } from './prompts/registry.js';
|
|
12
11
|
// The npm release sets the patch per CI run, so the version lives only in
|
|
13
12
|
// package.json. Resolves from both src/ (tests) and build/ (the package).
|
|
14
13
|
const { version } = createRequire(import.meta.url)('../package.json');
|
|
@@ -33,21 +32,8 @@ export async function createServer() {
|
|
|
33
32
|
const enabledToolNames = getEnabledToolNames(config.PRODUCTIVE_TOOLSETS);
|
|
34
33
|
// Register all tools via shared registry
|
|
35
34
|
registerToolsOnServer(server, apiClient, config, enabledToolNames);
|
|
36
|
-
// Register prompt handlers
|
|
37
|
-
server
|
|
38
|
-
prompts: [timesheetPromptDefinition, quickTimesheetPromptDefinition],
|
|
39
|
-
}));
|
|
40
|
-
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
41
|
-
const { name, arguments: args } = request.params;
|
|
42
|
-
switch (name) {
|
|
43
|
-
case 'timesheet_entry':
|
|
44
|
-
return await generateTimesheetPrompt(args);
|
|
45
|
-
case 'timesheet_step':
|
|
46
|
-
return await generateQuickTimesheetPrompt(args);
|
|
47
|
-
default:
|
|
48
|
-
throw new Error(`Unknown prompt: ${name}`);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
35
|
+
// Register prompt handlers via shared registry
|
|
36
|
+
registerPromptsOnServer(server);
|
|
51
37
|
// Connect to stdio transport
|
|
52
38
|
const transport = new StdioServerTransport();
|
|
53
39
|
await server.connect(transport);
|
package/build/tools/projects.js
CHANGED
|
@@ -30,8 +30,9 @@ export async function listProjectsTool(client, args) {
|
|
|
30
30
|
.map((project) => {
|
|
31
31
|
const companyId = project.relationships?.company?.data?.id;
|
|
32
32
|
const companyName = resolveName(nameMap, 'companies', companyId);
|
|
33
|
+
const archived = !!project.attributes.archived_at || project.attributes.status === 2;
|
|
33
34
|
return `• ${project.attributes.name} (ID: ${project.id})
|
|
34
|
-
Status: ${
|
|
35
|
+
Status: ${archived ? 'archived' : 'active'}
|
|
35
36
|
${companyName ? `Company: ${companyName}` : companyId ? `Company ID: ${companyId}` : ''}`;
|
|
36
37
|
})
|
|
37
38
|
.join('\n\n');
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monadsag/productive-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.62",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@monadsag/productive-mcp",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.62",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/sdk": "^1.13.2",
|