@pinepaper.studio/mcp-server 1.5.1 → 1.5.4
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 +6 -4
- package/dist/agent/types.d.ts +16 -16
- package/dist/browser/puppeteer-controller.d.ts +5 -1
- package/dist/browser/puppeteer-controller.d.ts.map +1 -1
- package/dist/browser/puppeteer-controller.js +11 -3
- package/dist/browser/puppeteer-controller.js.map +1 -1
- package/dist/browser/url-target.d.ts +26 -0
- package/dist/browser/url-target.d.ts.map +1 -0
- package/dist/browser/url-target.js +50 -0
- package/dist/browser/url-target.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +128 -109
- package/dist/index.js.map +1 -1
- package/dist/ontology/design-graph.d.ts +85 -0
- package/dist/ontology/design-graph.d.ts.map +1 -0
- package/dist/ontology/design-graph.js +944 -0
- package/dist/ontology/design-graph.js.map +1 -0
- package/dist/ontology/hints.d.ts +71 -0
- package/dist/ontology/hints.d.ts.map +1 -0
- package/dist/ontology/hints.js +189 -0
- package/dist/ontology/hints.js.map +1 -0
- package/dist/ontology/index.d.ts +11 -0
- package/dist/ontology/index.d.ts.map +1 -0
- package/dist/ontology/index.js +14 -0
- package/dist/ontology/index.js.map +1 -0
- package/dist/ontology/semantic-vocabulary.d.ts +12 -0
- package/dist/ontology/semantic-vocabulary.d.ts.map +1 -0
- package/dist/ontology/semantic-vocabulary.js +26 -0
- package/dist/ontology/semantic-vocabulary.js.map +1 -0
- package/dist/ontology/types.d.ts +255 -0
- package/dist/ontology/types.d.ts.map +1 -0
- package/dist/ontology/types.js +10 -0
- package/dist/ontology/types.js.map +1 -0
- package/dist/ontology/validator.d.ts +36 -0
- package/dist/ontology/validator.d.ts.map +1 -0
- package/dist/ontology/validator.js +374 -0
- package/dist/ontology/validator.js.map +1 -0
- package/dist/ontology/vocabulary.d.ts +34 -0
- package/dist/ontology/vocabulary.d.ts.map +1 -0
- package/dist/ontology/vocabulary.js +429 -0
- package/dist/ontology/vocabulary.js.map +1 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +146 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/tools/compact-descriptions.d.ts +5 -2
- package/dist/tools/compact-descriptions.d.ts.map +1 -1
- package/dist/tools/compact-descriptions.js +56 -235
- package/dist/tools/compact-descriptions.js.map +1 -1
- package/dist/tools/definitions.d.ts +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +1842 -1784
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/handlers/camera.d.ts +19 -0
- package/dist/tools/handlers/camera.d.ts.map +1 -0
- package/dist/tools/handlers/camera.js +94 -0
- package/dist/tools/handlers/camera.js.map +1 -0
- package/dist/tools/handlers/export.d.ts +12 -0
- package/dist/tools/handlers/export.d.ts.map +1 -0
- package/dist/tools/handlers/export.js +30 -0
- package/dist/tools/handlers/export.js.map +1 -0
- package/dist/tools/handlers/font.d.ts +12 -0
- package/dist/tools/handlers/font.d.ts.map +1 -0
- package/dist/tools/handlers/font.js +135 -0
- package/dist/tools/handlers/font.js.map +1 -0
- package/dist/tools/handlers/maps.d.ts +19 -0
- package/dist/tools/handlers/maps.d.ts.map +1 -0
- package/dist/tools/handlers/maps.js +184 -0
- package/dist/tools/handlers/maps.js.map +1 -0
- package/dist/tools/handlers/ontology.d.ts +20 -0
- package/dist/tools/handlers/ontology.d.ts.map +1 -0
- package/dist/tools/handlers/ontology.js +185 -0
- package/dist/tools/handlers/ontology.js.map +1 -0
- package/dist/tools/handlers/tool-guide.d.ts +14 -0
- package/dist/tools/handlers/tool-guide.d.ts.map +1 -0
- package/dist/tools/handlers/tool-guide.js +52 -0
- package/dist/tools/handlers/tool-guide.js.map +1 -0
- package/dist/tools/handlers.d.ts +18 -0
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +321 -574
- package/dist/tools/handlers.js.map +1 -1
- package/dist/tools/minimal-descriptions.d.ts +4 -0
- package/dist/tools/minimal-descriptions.d.ts.map +1 -1
- package/dist/tools/minimal-descriptions.js +65 -54
- package/dist/tools/minimal-descriptions.js.map +1 -1
- package/dist/tools/toolkits.d.ts.map +1 -1
- package/dist/tools/toolkits.js +67 -46
- package/dist/tools/toolkits.js.map +1 -1
- package/dist/types/code-generator.d.ts +49 -2
- package/dist/types/code-generator.d.ts.map +1 -1
- package/dist/types/code-generator.js +1456 -39
- package/dist/types/code-generator.js.map +1 -1
- package/dist/types/schemas.d.ts +1381 -404
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +426 -20
- package/dist/types/schemas.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool guide handler — extracted from src/tools/handlers.ts.
|
|
3
|
+
*
|
|
4
|
+
* Returns the full AI Agent Guide when called with no args, the verbose
|
|
5
|
+
* description for a specific tool when given a tool name, or every tool in
|
|
6
|
+
* a category when given a category. Uses dynamic imports for the tool list
|
|
7
|
+
* + tag map so the module load cost only hits when the guide is actually
|
|
8
|
+
* requested.
|
|
9
|
+
*/
|
|
10
|
+
import { ToolGuideInputSchema } from '../../types/schemas.js';
|
|
11
|
+
export const toolGuideHandlers = {
|
|
12
|
+
pinepaper_tool_guide: async (args, _options) => {
|
|
13
|
+
const input = ToolGuideInputSchema.parse(args);
|
|
14
|
+
const { PINEPAPER_TOOLS, AI_AGENT_GUIDE } = await import('../definitions.js');
|
|
15
|
+
const { TOOL_TAGS } = await import('../toolkits.js');
|
|
16
|
+
// No args → full AI Agent Guide
|
|
17
|
+
if (!input.tool && !input.category) {
|
|
18
|
+
return { content: [{ type: 'text', text: AI_AGENT_GUIDE }] };
|
|
19
|
+
}
|
|
20
|
+
// Specific tool → full verbose description
|
|
21
|
+
if (input.tool) {
|
|
22
|
+
const tool = PINEPAPER_TOOLS.find((t) => t.name === input.tool);
|
|
23
|
+
if (!tool) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: `Unknown tool: ${input.tool}. Use pinepaper_tool_guide with no args to see the AI Agent Guide.` }],
|
|
26
|
+
isError: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return { content: [{ type: 'text', text: `# ${tool.name}\n\n${tool.description}` }] };
|
|
30
|
+
}
|
|
31
|
+
// Category → all tools in that tag with descriptions
|
|
32
|
+
if (input.category) {
|
|
33
|
+
const toolNames = TOOL_TAGS[input.category];
|
|
34
|
+
if (!toolNames) {
|
|
35
|
+
const available = Object.keys(TOOL_TAGS).join(', ');
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: 'text', text: `Unknown category: ${input.category}. Available: ${available}` }],
|
|
38
|
+
isError: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const lines = [`# Category: ${input.category}\n`];
|
|
42
|
+
for (const name of toolNames) {
|
|
43
|
+
const tool = PINEPAPER_TOOLS.find((t) => t.name === name);
|
|
44
|
+
if (tool)
|
|
45
|
+
lines.push(`## ${tool.name}\n${tool.description}\n`);
|
|
46
|
+
}
|
|
47
|
+
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
48
|
+
}
|
|
49
|
+
return { content: [{ type: 'text', text: AI_AGENT_GUIDE }] };
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=tool-guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-guide.js","sourceRoot":"","sources":["../../../src/tools/handlers/tool-guide.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D,MAAM,CAAC,MAAM,iBAAiB,GAAqC;IACjE,oBAAoB,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAC7C,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,EAAE,eAAe,E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MAAM,EAAE,IAAI,EAAE,qBAAqB,KAAK,CAAC,QAAQ,gBAAgB,SAAS,EAAE,EAAE,CAAC;oBACjG,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,GAAa,CAAC,eAAe,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC;YAC5D,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;gBAC7B,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;gBAC5E,IAAI,IAAI;oBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;YACjE,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACjE,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC;IAC/D,CAAC;CACF,CAAC"}
|
package/dist/tools/handlers.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
9
9
|
import { I18nManager } from '../i18n/index.js';
|
|
10
10
|
import { PinePaperBrowserController } from '../browser/puppeteer-controller.js';
|
|
11
|
+
import { ErrorContext } from '../execution/index.js';
|
|
11
12
|
/**
|
|
12
13
|
* Screenshot modes for performance optimization.
|
|
13
14
|
* Based on best practices: "Take 1 screenshot per creative task, not per operation"
|
|
@@ -51,5 +52,22 @@ export interface HandlerOptions {
|
|
|
51
52
|
/** Execution mode: 'puppeteer' (default) or 'code' (generate only) */
|
|
52
53
|
executionMode?: ExecutionMode;
|
|
53
54
|
}
|
|
55
|
+
export declare function errorResult(code: string, message: string, details?: unknown, context?: ErrorContext): CallToolResult;
|
|
56
|
+
/**
|
|
57
|
+
* Execute code in browser if connected, otherwise return generated code.
|
|
58
|
+
*
|
|
59
|
+
* Execution mode is controlled by PINEPAPER_EXECUTION_MODE environment variable:
|
|
60
|
+
* - 'puppeteer': Execute code in browser via Puppeteer (default)
|
|
61
|
+
* - 'code': Generate code only - user copies/pastes into PinePaper console
|
|
62
|
+
*
|
|
63
|
+
* Screenshot behavior is controlled by PINEPAPER_SCREENSHOT_MODE environment variable:
|
|
64
|
+
* - 'on_request': No automatic screenshots (use pinepaper_browser_screenshot explicitly)
|
|
65
|
+
* - 'always': Take screenshot after every execution (legacy, slower)
|
|
66
|
+
* - 'never': Never take screenshots
|
|
67
|
+
*
|
|
68
|
+
* Default is 'on_request' for optimal performance per best practices.
|
|
69
|
+
*/
|
|
70
|
+
export declare function executeOrGenerate(code: string, description: string, options: HandlerOptions, toolName: string): Promise<CallToolResult>;
|
|
71
|
+
export declare function getLocalizedSuccessMessage(i18n: I18nManager | undefined, key: string, params: Record<string, string | number>): string;
|
|
54
72
|
export declare function handleToolCall(toolName: string, args: Record<string, unknown>, options?: HandlerOptions): Promise<CallToolResult>;
|
|
55
73
|
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/tools/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAA6B,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/tools/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAA6B,MAAM,oCAAoC,CAAC;AAsI/F,OAAO,EAAE,WAAW,EAAW,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,0BAA0B,EAI3B,M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