@lovelybunch/mcp 1.0.62 → 1.0.63
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/package.json +2 -2
- package/dist/server.d.ts +0 -2
- package/dist/server.js +0 -155
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +0 -2
- package/dist/src/knowledge-tool.d.ts +0 -6
- package/dist/src/knowledge-tool.js +0 -85
- package/dist/src/proposals-tool.d.ts +0 -19
- package/dist/src/proposals-tool.js +0 -232
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovelybunch/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"description": "MCP tools for Coconut",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dev": "tsc --watch"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@lovelybunch/types": "^1.0.
|
|
12
|
+
"@lovelybunch/types": "^1.0.63",
|
|
13
13
|
"hono": "^4.0.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
package/dist/server.d.ts
DELETED
package/dist/server.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createInterface } from 'readline';
|
|
3
|
-
import { stdin as input, stdout as output } from 'process';
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
function send(id, result, error) {
|
|
7
|
-
const payload = { jsonrpc: '2.0', id };
|
|
8
|
-
if (error)
|
|
9
|
-
payload.error = error;
|
|
10
|
-
else
|
|
11
|
-
payload.result = result;
|
|
12
|
-
output.write(JSON.stringify(payload) + '\n');
|
|
13
|
-
}
|
|
14
|
-
function resolveNutPath() {
|
|
15
|
-
if (process.env.GAIT_DATA_PATH)
|
|
16
|
-
return path.join(process.env.GAIT_DATA_PATH, '.nut');
|
|
17
|
-
// Try to find nearest .nut folder upward from cwd
|
|
18
|
-
let dir = process.cwd();
|
|
19
|
-
for (;;) {
|
|
20
|
-
const p = path.join(dir, '.nut');
|
|
21
|
-
if (fs.existsSync(p))
|
|
22
|
-
return p;
|
|
23
|
-
const parent = path.dirname(dir);
|
|
24
|
-
if (parent === dir)
|
|
25
|
-
break;
|
|
26
|
-
dir = parent;
|
|
27
|
-
}
|
|
28
|
-
return path.join(process.cwd(), '.nut');
|
|
29
|
-
}
|
|
30
|
-
function listProposalFiles() {
|
|
31
|
-
const base = resolveNutPath();
|
|
32
|
-
const p = path.join(base, 'proposals');
|
|
33
|
-
try {
|
|
34
|
-
return fs.readdirSync(p).filter((f) => f.endsWith('.md'));
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function readProposal(id) {
|
|
41
|
-
const base = resolveNutPath();
|
|
42
|
-
const fp = path.join(base, 'proposals', `${id}.md`);
|
|
43
|
-
try {
|
|
44
|
-
const content = fs.readFileSync(fp, 'utf-8');
|
|
45
|
-
// Naive frontmatter parse (best effort, no YAML dependency)
|
|
46
|
-
let frontmatter;
|
|
47
|
-
if (content.startsWith('---')) {
|
|
48
|
-
const end = content.indexOf('\n---', 3);
|
|
49
|
-
if (end > 0) {
|
|
50
|
-
const fm = content.slice(3, end).split('\n');
|
|
51
|
-
frontmatter = {};
|
|
52
|
-
for (const line of fm) {
|
|
53
|
-
const m = /^([A-Za-z0-9_\-]+):\s*(.*)$/.exec(line.trim());
|
|
54
|
-
if (m)
|
|
55
|
-
frontmatter[m[1]] = m[2];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return { content, frontmatter };
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const tools = [
|
|
66
|
-
{
|
|
67
|
-
name: 'list_proposals',
|
|
68
|
-
description: 'List all change proposals with basic metadata',
|
|
69
|
-
input_schema: {
|
|
70
|
-
type: 'object',
|
|
71
|
-
properties: {
|
|
72
|
-
filters: { type: 'object' },
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'change_proposals',
|
|
78
|
-
description: 'Manage change proposals (list, get)',
|
|
79
|
-
input_schema: {
|
|
80
|
-
type: 'object',
|
|
81
|
-
properties: {
|
|
82
|
-
operation: { type: 'string', enum: ['list', 'get'] },
|
|
83
|
-
id: { type: 'string' },
|
|
84
|
-
filters: { type: 'object' },
|
|
85
|
-
},
|
|
86
|
-
required: ['operation'],
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
async function handleCall(params) {
|
|
91
|
-
const name = params?.name || params?.tool?.name;
|
|
92
|
-
const args = params?.arguments || params?.tool?.input || {};
|
|
93
|
-
switch (name) {
|
|
94
|
-
case 'list_proposals': {
|
|
95
|
-
const files = listProposalFiles();
|
|
96
|
-
const data = files.map((f) => ({ id: f.replace(/\.md$/, ''), title: f.replace(/\.md$/, '') }));
|
|
97
|
-
return { success: true, data, message: `Found ${data.length} proposals` };
|
|
98
|
-
}
|
|
99
|
-
case 'change_proposals': {
|
|
100
|
-
const op = args.operation;
|
|
101
|
-
if (op === 'list') {
|
|
102
|
-
const files = listProposalFiles();
|
|
103
|
-
const data = files.map((f) => ({ id: f.replace(/\.md$/, ''), title: f.replace(/\.md$/, '') }));
|
|
104
|
-
return { success: true, data, message: `Found ${data.length} proposals` };
|
|
105
|
-
}
|
|
106
|
-
if (op === 'get') {
|
|
107
|
-
if (!args.id)
|
|
108
|
-
return { success: false, error: 'Proposal ID required' };
|
|
109
|
-
const p = readProposal(args.id);
|
|
110
|
-
if (!p)
|
|
111
|
-
return { success: false, error: 'Proposal not found' };
|
|
112
|
-
return { success: true, data: { id: args.id, content: p.content, frontmatter: p.frontmatter || {} } };
|
|
113
|
-
}
|
|
114
|
-
return { success: false, error: 'Operation not implemented' };
|
|
115
|
-
}
|
|
116
|
-
default:
|
|
117
|
-
return { success: false, error: 'Unknown tool' };
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function start() {
|
|
121
|
-
const rl = createInterface({ input });
|
|
122
|
-
rl.on('line', async (line) => {
|
|
123
|
-
let msg;
|
|
124
|
-
try {
|
|
125
|
-
msg = JSON.parse(line);
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
return; // ignore invalid JSON
|
|
129
|
-
}
|
|
130
|
-
const { id, method, params } = msg || {};
|
|
131
|
-
try {
|
|
132
|
-
if (method === 'initialize') {
|
|
133
|
-
send(id, {
|
|
134
|
-
serverInfo: { name: '@lovelybunch/mcp-proposals', version: '1.0.0' },
|
|
135
|
-
capabilities: { tools: {} },
|
|
136
|
-
});
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (method === 'tools/list') {
|
|
140
|
-
send(id, { tools });
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (method === 'tools/call') {
|
|
144
|
-
const result = await handleCall(params);
|
|
145
|
-
send(id, { content: [{ type: 'text', text: JSON.stringify(result) }] });
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
send(id, undefined, { code: -32601, message: 'Method not found' });
|
|
149
|
-
}
|
|
150
|
-
catch (e) {
|
|
151
|
-
send(id, undefined, { code: -32000, message: e?.message || 'Server error' });
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
start();
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { proposalsTool, listProposalsTool, validateProposalData, createToolCall } from './proposals-tool.js';
|
|
2
|
-
export { knowledgeTool, createKnowledgeToolCall, normalizeKnowledgeMetadata, buildKnowledgeActionPayload } from './knowledge-tool.js';
|
|
3
|
-
export type { MCPTool, MCPToolCall } from './proposals-tool.js';
|
package/dist/src/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { KnowledgeActionPayload, KnowledgeDocumentMetadata } from '@lovelybunch/types';
|
|
2
|
-
import type { MCPTool, MCPToolCall } from './proposals-tool.js';
|
|
3
|
-
export declare const knowledgeTool: MCPTool;
|
|
4
|
-
export declare function createKnowledgeToolCall(operation: string, args: Record<string, unknown>): MCPToolCall;
|
|
5
|
-
export declare function normalizeKnowledgeMetadata(metadata?: KnowledgeDocumentMetadata | null): KnowledgeDocumentMetadata;
|
|
6
|
-
export declare function buildKnowledgeActionPayload(input: KnowledgeActionPayload): KnowledgeActionPayload;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const metadataSchema = {
|
|
2
|
-
type: 'object',
|
|
3
|
-
description: 'Frontmatter metadata to persist alongside the knowledge document',
|
|
4
|
-
properties: {
|
|
5
|
-
version: { type: 'string', description: 'Semantic version of the knowledge document' },
|
|
6
|
-
updated: { type: 'string', description: 'ISO date override for last updated (defaults to today if omitted)' },
|
|
7
|
-
type: { type: 'string', description: 'Document type, defaults to knowledge' },
|
|
8
|
-
category: { type: 'string', description: 'High-level category for grouping documents' },
|
|
9
|
-
tags: { type: 'array', items: { type: 'string' }, description: 'Keyword tags to aid discovery' },
|
|
10
|
-
sources: { type: 'array', items: { type: 'string' }, description: 'URLs or references that informed this knowledge' },
|
|
11
|
-
related: { type: 'array', items: { type: 'string' }, description: 'Paths to related docs (e.g. proposals, specs)' },
|
|
12
|
-
owner: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
name: { type: 'string' },
|
|
16
|
-
email: { type: 'string' }
|
|
17
|
-
},
|
|
18
|
-
additionalProperties: false
|
|
19
|
-
},
|
|
20
|
-
audience: { type: 'array', items: { type: 'string' }, description: 'Intended readers (roles, teams)' },
|
|
21
|
-
status: { type: 'string', description: 'Lifecycle status (draft, active, deprecated, etc.)' }
|
|
22
|
-
},
|
|
23
|
-
additionalProperties: true
|
|
24
|
-
};
|
|
25
|
-
export const knowledgeTool = {
|
|
26
|
-
name: 'knowledge_documents',
|
|
27
|
-
description: 'Manage knowledge base markdown documents stored in .nut/context/knowledge',
|
|
28
|
-
parameters: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
properties: {
|
|
31
|
-
operation: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
enum: ['list', 'get', 'create', 'update', 'preview_update'],
|
|
34
|
-
description: 'The knowledge document operation to execute'
|
|
35
|
-
},
|
|
36
|
-
filename: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'Existing knowledge filename (with or without .md) for get/update/preview operations'
|
|
39
|
-
},
|
|
40
|
-
title: {
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'Human readable title for the knowledge document (used to derive filename on create)'
|
|
43
|
-
},
|
|
44
|
-
content: {
|
|
45
|
-
type: 'string',
|
|
46
|
-
description: 'Markdown body for the knowledge document. Required for create/update/preview operations.'
|
|
47
|
-
},
|
|
48
|
-
summary: {
|
|
49
|
-
type: 'string',
|
|
50
|
-
description: 'Short description of the change. Helpful when presenting updates to the user.'
|
|
51
|
-
},
|
|
52
|
-
metadata: metadataSchema
|
|
53
|
-
},
|
|
54
|
-
required: ['operation'],
|
|
55
|
-
additionalProperties: false
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
export function createKnowledgeToolCall(operation, args) {
|
|
59
|
-
return {
|
|
60
|
-
name: 'knowledge_documents',
|
|
61
|
-
arguments: {
|
|
62
|
-
operation,
|
|
63
|
-
...args
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export function normalizeKnowledgeMetadata(metadata) {
|
|
68
|
-
const baseDate = new Date().toISOString().split('T')[0];
|
|
69
|
-
return {
|
|
70
|
-
type: 'knowledge',
|
|
71
|
-
updated: baseDate,
|
|
72
|
-
...metadata,
|
|
73
|
-
tags: metadata?.tags ? [...metadata.tags] : [],
|
|
74
|
-
sources: metadata?.sources ? [...metadata.sources] : [],
|
|
75
|
-
related: metadata?.related ? [...metadata.related] : [],
|
|
76
|
-
audience: metadata?.audience ? [...metadata.audience] : []
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
export function buildKnowledgeActionPayload(input) {
|
|
80
|
-
const metadata = input.metadata ? normalizeKnowledgeMetadata(input.metadata) : undefined;
|
|
81
|
-
return {
|
|
82
|
-
...input,
|
|
83
|
-
metadata
|
|
84
|
-
};
|
|
85
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ChangeProposal } from '@lovelybunch/types';
|
|
2
|
-
export interface MCPTool {
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
parameters: {
|
|
6
|
-
type: 'object';
|
|
7
|
-
properties: Record<string, any>;
|
|
8
|
-
required?: string[];
|
|
9
|
-
additionalProperties?: boolean;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface MCPToolCall {
|
|
13
|
-
name: string;
|
|
14
|
-
arguments: Record<string, any>;
|
|
15
|
-
}
|
|
16
|
-
export declare const listProposalsTool: MCPTool;
|
|
17
|
-
export declare const proposalsTool: MCPTool;
|
|
18
|
-
export declare function validateProposalData(data: any): Partial<ChangeProposal>;
|
|
19
|
-
export declare function createToolCall(operation: string, args: any): MCPToolCall;
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
export const listProposalsTool = {
|
|
2
|
-
name: "list_proposals",
|
|
3
|
-
description: "List all change proposals with metadata only (title, ID, status, priority, tags)",
|
|
4
|
-
parameters: {
|
|
5
|
-
type: "object",
|
|
6
|
-
properties: {
|
|
7
|
-
filters: {
|
|
8
|
-
type: "object",
|
|
9
|
-
description: "Optional filters for the proposal list",
|
|
10
|
-
properties: {
|
|
11
|
-
status: {
|
|
12
|
-
type: "string",
|
|
13
|
-
enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
|
|
14
|
-
description: "Filter by proposal status"
|
|
15
|
-
},
|
|
16
|
-
priority: {
|
|
17
|
-
type: "string",
|
|
18
|
-
enum: ["low", "medium", "high", "critical"],
|
|
19
|
-
description: "Filter by priority level"
|
|
20
|
-
},
|
|
21
|
-
tags: {
|
|
22
|
-
type: "array",
|
|
23
|
-
items: { type: "string" },
|
|
24
|
-
description: "Filter by tags"
|
|
25
|
-
},
|
|
26
|
-
search: {
|
|
27
|
-
type: "string",
|
|
28
|
-
description: "Search query for proposal content"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
export const proposalsTool = {
|
|
36
|
-
name: "change_proposals",
|
|
37
|
-
description: "Manage change proposals - create, read, update, delete proposals",
|
|
38
|
-
parameters: {
|
|
39
|
-
type: "object",
|
|
40
|
-
properties: {
|
|
41
|
-
operation: {
|
|
42
|
-
type: "string",
|
|
43
|
-
enum: ["list", "get", "create", "update", "delete"],
|
|
44
|
-
description: "The operation to perform on proposals"
|
|
45
|
-
},
|
|
46
|
-
id: {
|
|
47
|
-
type: "string",
|
|
48
|
-
description: "Proposal ID (required for get, update, delete operations)"
|
|
49
|
-
},
|
|
50
|
-
filters: {
|
|
51
|
-
type: "object",
|
|
52
|
-
description: "Filters for list operation",
|
|
53
|
-
properties: {
|
|
54
|
-
status: {
|
|
55
|
-
type: "string",
|
|
56
|
-
enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
|
|
57
|
-
description: "Filter by proposal status"
|
|
58
|
-
},
|
|
59
|
-
author: {
|
|
60
|
-
type: "string",
|
|
61
|
-
description: "Filter by author name or email"
|
|
62
|
-
},
|
|
63
|
-
priority: {
|
|
64
|
-
type: "string",
|
|
65
|
-
enum: ["low", "medium", "high", "critical"],
|
|
66
|
-
description: "Filter by priority level"
|
|
67
|
-
},
|
|
68
|
-
tags: {
|
|
69
|
-
type: "array",
|
|
70
|
-
items: { type: "string" },
|
|
71
|
-
description: "Filter by tags"
|
|
72
|
-
},
|
|
73
|
-
search: {
|
|
74
|
-
type: "string",
|
|
75
|
-
description: "Search query for proposal content"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
proposal: {
|
|
80
|
-
type: "object",
|
|
81
|
-
description: "Proposal data for create/update operations",
|
|
82
|
-
properties: {
|
|
83
|
-
intent: {
|
|
84
|
-
type: "string",
|
|
85
|
-
description: "Brief description of what the proposal aims to achieve"
|
|
86
|
-
},
|
|
87
|
-
content: {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "Detailed content of the proposal"
|
|
90
|
-
},
|
|
91
|
-
author: {
|
|
92
|
-
type: "object",
|
|
93
|
-
description: "Author information",
|
|
94
|
-
properties: {
|
|
95
|
-
id: { type: "string" },
|
|
96
|
-
name: { type: "string" },
|
|
97
|
-
email: { type: "string" },
|
|
98
|
-
role: { type: "string" },
|
|
99
|
-
type: { type: "string", enum: ["human", "agent"] }
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
planSteps: {
|
|
103
|
-
type: "array",
|
|
104
|
-
description: "Implementation plan steps. Each item may be a string (description) or an object with fields.",
|
|
105
|
-
items: {
|
|
106
|
-
oneOf: [
|
|
107
|
-
{ type: "string", description: "Step description" },
|
|
108
|
-
{
|
|
109
|
-
type: "object",
|
|
110
|
-
properties: {
|
|
111
|
-
id: { type: "string", description: "Step identifier (optional)" },
|
|
112
|
-
description: { type: "string", description: "Human-readable step description" },
|
|
113
|
-
status: { type: "string", enum: ["pending", "in-progress", "completed", "failed"], description: "Execution status" },
|
|
114
|
-
command: { type: "string", description: "Optional command to execute" },
|
|
115
|
-
expectedOutcome: { type: "string", description: "Expected outcome of the step" }
|
|
116
|
-
},
|
|
117
|
-
required: ["description"]
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
evidence: {
|
|
123
|
-
type: "array",
|
|
124
|
-
items: { type: "string" },
|
|
125
|
-
description: "Supporting evidence"
|
|
126
|
-
},
|
|
127
|
-
policies: {
|
|
128
|
-
type: "array",
|
|
129
|
-
items: { type: "string" },
|
|
130
|
-
description: "Related policies"
|
|
131
|
-
},
|
|
132
|
-
featureFlags: {
|
|
133
|
-
type: "array",
|
|
134
|
-
items: { type: "string" },
|
|
135
|
-
description: "Feature flags needed"
|
|
136
|
-
},
|
|
137
|
-
experiments: {
|
|
138
|
-
type: "array",
|
|
139
|
-
items: { type: "string" },
|
|
140
|
-
description: "A/B tests or experiments"
|
|
141
|
-
},
|
|
142
|
-
telemetryContracts: {
|
|
143
|
-
type: "array",
|
|
144
|
-
items: { type: "string" },
|
|
145
|
-
description: "Telemetry contracts"
|
|
146
|
-
},
|
|
147
|
-
releasePlan: {
|
|
148
|
-
type: "object",
|
|
149
|
-
description: "Release strategy",
|
|
150
|
-
properties: {
|
|
151
|
-
strategy: {
|
|
152
|
-
type: "string",
|
|
153
|
-
enum: ["immediate", "gradual", "scheduled", "gated"]
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
status: {
|
|
158
|
-
type: "string",
|
|
159
|
-
enum: ["draft", "proposed", "in-review", "code-complete", "approved", "merged", "rejected"],
|
|
160
|
-
description: "Current status of the proposal"
|
|
161
|
-
},
|
|
162
|
-
metadata: {
|
|
163
|
-
type: "object",
|
|
164
|
-
description: "Additional metadata",
|
|
165
|
-
properties: {
|
|
166
|
-
tags: {
|
|
167
|
-
type: "array",
|
|
168
|
-
items: { type: "string" },
|
|
169
|
-
description: "Tags for categorization"
|
|
170
|
-
},
|
|
171
|
-
priority: {
|
|
172
|
-
type: "string",
|
|
173
|
-
enum: ["low", "medium", "high", "critical"],
|
|
174
|
-
description: "Priority level"
|
|
175
|
-
},
|
|
176
|
-
reviewers: {
|
|
177
|
-
type: "array",
|
|
178
|
-
items: { type: "string" },
|
|
179
|
-
description: "List of reviewers"
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
productSpecRef: {
|
|
184
|
-
type: "string",
|
|
185
|
-
description: "Reference to related product specification"
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
required: ["intent", "content"]
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
required: ["operation"]
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
export function validateProposalData(data) {
|
|
195
|
-
const proposal = {};
|
|
196
|
-
if (data.intent)
|
|
197
|
-
proposal.intent = data.intent;
|
|
198
|
-
if (data.content)
|
|
199
|
-
proposal.content = data.content;
|
|
200
|
-
if (data.author)
|
|
201
|
-
proposal.author = data.author;
|
|
202
|
-
if (data.planSteps)
|
|
203
|
-
proposal.planSteps = data.planSteps;
|
|
204
|
-
if (data.evidence)
|
|
205
|
-
proposal.evidence = data.evidence;
|
|
206
|
-
if (data.policies)
|
|
207
|
-
proposal.policies = data.policies;
|
|
208
|
-
if (data.featureFlags)
|
|
209
|
-
proposal.featureFlags = data.featureFlags;
|
|
210
|
-
if (data.experiments)
|
|
211
|
-
proposal.experiments = data.experiments;
|
|
212
|
-
if (data.telemetryContracts)
|
|
213
|
-
proposal.telemetryContracts = data.telemetryContracts;
|
|
214
|
-
if (data.releasePlan)
|
|
215
|
-
proposal.releasePlan = data.releasePlan;
|
|
216
|
-
if (data.status)
|
|
217
|
-
proposal.status = data.status;
|
|
218
|
-
if (data.metadata)
|
|
219
|
-
proposal.metadata = data.metadata;
|
|
220
|
-
if (data.productSpecRef)
|
|
221
|
-
proposal.productSpecRef = data.productSpecRef;
|
|
222
|
-
return proposal;
|
|
223
|
-
}
|
|
224
|
-
export function createToolCall(operation, args) {
|
|
225
|
-
return {
|
|
226
|
-
name: "change_proposals",
|
|
227
|
-
arguments: {
|
|
228
|
-
operation,
|
|
229
|
-
...args
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
}
|