@freelancercom/phabricator-mcp 2.0.15 → 2.0.17
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.
|
@@ -12,7 +12,6 @@ export function registerDifferentialTools(server, client) {
|
|
|
12
12
|
repositoryPHIDs: z.array(z.string()).optional().describe('Repository PHIDs'),
|
|
13
13
|
statuses: z.array(z.string()).optional().describe('Statuses: needs-review, needs-revision, accepted, published, abandoned, changes-planned, draft'),
|
|
14
14
|
responsiblePHIDs: z.array(z.string()).optional().describe('User PHIDs who are responsible (as author or reviewer)'),
|
|
15
|
-
affectedPaths: z.array(z.string()).optional().describe('File paths affected by the revision'),
|
|
16
15
|
createdStart: z.coerce.number().optional().describe('Created after (epoch timestamp)'),
|
|
17
16
|
createdEnd: z.coerce.number().optional().describe('Created before (epoch timestamp)'),
|
|
18
17
|
modifiedStart: z.coerce.number().optional().describe('Modified after (epoch timestamp)'),
|
package/dist/tools/diffusion.js
CHANGED
|
@@ -11,8 +11,6 @@ export function registerDiffusionTools(server, client) {
|
|
|
11
11
|
shortNames: z.array(z.string()).optional().describe('Repository short names'),
|
|
12
12
|
types: z.array(z.string()).optional().describe('VCS types: git, hg, svn'),
|
|
13
13
|
uris: z.array(z.string()).optional().describe('Repository URIs'),
|
|
14
|
-
status: z.string().optional().describe('Repository status: "open" (active) or "closed" (inactive)'),
|
|
15
|
-
hosted: z.string().optional().describe('Hosting: "phabricator" (hosted) or "remote"'),
|
|
16
14
|
projects: z.array(z.string()).optional().describe('Project PHIDs'),
|
|
17
15
|
spaces: z.array(z.string()).optional().describe('Space PHIDs (for multi-space installations)'),
|
|
18
16
|
query: z.string().optional().describe('Full-text search query'),
|
|
@@ -53,7 +51,6 @@ export function registerDiffusionTools(server, client) {
|
|
|
53
51
|
attachments: jsonCoerce(z.object({
|
|
54
52
|
projects: z.boolean().optional().describe('Include projects'),
|
|
55
53
|
subscribers: z.boolean().optional().describe('Include subscribers'),
|
|
56
|
-
auditors: z.boolean().optional().describe('Include auditor info'),
|
|
57
54
|
})).optional().describe('Data attachments'),
|
|
58
55
|
order: z.string().optional().describe('Result order'),
|
|
59
56
|
limit: z.coerce.number().max(100).optional().describe('Maximum results (max 100)'),
|
|
@@ -64,11 +61,10 @@ export function registerDiffusionTools(server, client) {
|
|
|
64
61
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
65
62
|
});
|
|
66
63
|
// Browse repository file tree
|
|
67
|
-
server.tool('phabricator_repository_browse', 'Browse a repository directory tree at a given path and commit/branch', {
|
|
64
|
+
server.tool('phabricator_repository_browse', 'Browse a repository directory tree at a given path and commit/branch. Pass a branch name via the commit parameter.', {
|
|
68
65
|
path: z.string().optional().describe('Path to browse (default: "/")'),
|
|
69
66
|
repository: z.string().optional().describe('Repository callsign, short name, or PHID'),
|
|
70
|
-
commit: z.string().optional().describe('Commit hash or branch name (default: HEAD)'),
|
|
71
|
-
branch: z.string().optional().describe('Branch name'),
|
|
67
|
+
commit: z.string().optional().describe('Commit hash or branch name (default: HEAD). Pass branch names here.'),
|
|
72
68
|
needValidityOnly: z.boolean().optional().describe('Only check path validity without loading the full tree'),
|
|
73
69
|
limit: z.coerce.number().optional().describe('Maximum entries to return'),
|
|
74
70
|
offset: z.coerce.number().optional().describe('Result offset for pagination'),
|
|
@@ -158,7 +154,7 @@ export function registerDiffusionTools(server, client) {
|
|
|
158
154
|
offset: z.coerce.number().optional().describe('Result offset for pagination'),
|
|
159
155
|
}, async (params) => {
|
|
160
156
|
const result = await client.call('diffusion.searchquery', {
|
|
161
|
-
path: params.path ?? '
|
|
157
|
+
path: params.path ?? '',
|
|
162
158
|
repository: params.repository,
|
|
163
159
|
grep: params.query,
|
|
164
160
|
commit: params.commit,
|
|
@@ -49,13 +49,6 @@ export function registerHarbormasterTools(server, client) {
|
|
|
49
49
|
ids: z.array(z.coerce.number()).optional().describe('Target IDs'),
|
|
50
50
|
phids: z.array(z.string()).optional().describe('Target PHIDs'),
|
|
51
51
|
buildPHIDs: z.array(z.string()).optional().describe('Build PHIDs'),
|
|
52
|
-
statuses: z.array(z.string()).optional().describe('Target statuses'),
|
|
53
|
-
createdStart: z.coerce.number().optional().describe('Created after (epoch timestamp)'),
|
|
54
|
-
createdEnd: z.coerce.number().optional().describe('Created before (epoch timestamp)'),
|
|
55
|
-
startedStart: z.coerce.number().optional().describe('Started executing after (epoch timestamp)'),
|
|
56
|
-
startedEnd: z.coerce.number().optional().describe('Started executing before (epoch timestamp)'),
|
|
57
|
-
completedStart: z.coerce.number().optional().describe('Completed after (epoch timestamp)'),
|
|
58
|
-
completedEnd: z.coerce.number().optional().describe('Completed before (epoch timestamp)'),
|
|
59
52
|
})).optional().describe('Search constraints'),
|
|
60
53
|
order: z.string().optional().describe('Result order'),
|
|
61
54
|
limit: z.coerce.number().max(100).optional().describe('Maximum results (max 100)'),
|
|
@@ -82,9 +75,9 @@ export function registerHarbormasterTools(server, client) {
|
|
|
82
75
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
83
76
|
});
|
|
84
77
|
// Send build command
|
|
85
|
-
server.tool('phabricator_build_command', 'Send a command to Harbormaster.
|
|
86
|
-
|
|
87
|
-
type: z.enum(['pass', 'fail', 'work'
|
|
78
|
+
server.tool('phabricator_build_command', 'Send a command to a Harbormaster build target. Report build status (pass/fail/work) with optional unit test and lint results.', {
|
|
79
|
+
buildTargetPHID: z.string().describe('PHID of the build target (PHID-HMBT-...) to send the message to'),
|
|
80
|
+
type: z.enum(['pass', 'fail', 'work']).describe('Message type: "pass" (target passed), "fail" (target failed), "work" (target still working, resets timeout)'),
|
|
88
81
|
unit: jsonCoerce(z.array(z.object({
|
|
89
82
|
name: z.string().describe('Test name'),
|
|
90
83
|
result: z.string().describe('Result: "pass", "fail", "skip", "broken", "unsound"'),
|
|
@@ -107,7 +100,7 @@ export function registerHarbormasterTools(server, client) {
|
|
|
107
100
|
}))).optional().describe('Lint results to report'),
|
|
108
101
|
}, async (params) => {
|
|
109
102
|
const apiParams = {
|
|
110
|
-
|
|
103
|
+
buildTargetPHID: params.buildTargetPHID,
|
|
111
104
|
type: params.type,
|
|
112
105
|
};
|
|
113
106
|
if (params.unit !== undefined) {
|
package/dist/tools/maniphest.js
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { jsonCoerce } from './coerce.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve revision identifiers (e.g. "D223125", "PHID-DREV-xxx") to PHIDs.
|
|
5
|
+
* Accepts a mix of D-prefixed IDs and raw PHIDs.
|
|
6
|
+
*/
|
|
7
|
+
async function resolveRevisionPHIDs(client, ids) {
|
|
8
|
+
const phids = [];
|
|
9
|
+
const namesToLookup = [];
|
|
10
|
+
for (const id of ids) {
|
|
11
|
+
if (id.startsWith('PHID-')) {
|
|
12
|
+
phids.push(id);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// Normalize to D-prefixed format if just a number
|
|
16
|
+
const name = /^\d+$/.test(id) ? `D${id}` : id;
|
|
17
|
+
namesToLookup.push(name);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (namesToLookup.length > 0) {
|
|
21
|
+
const lookupResult = await client.call('phid.lookup', { names: namesToLookup });
|
|
22
|
+
for (const name of namesToLookup) {
|
|
23
|
+
const entry = lookupResult[name];
|
|
24
|
+
if (entry) {
|
|
25
|
+
phids.push(entry.phid);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw new Error(`Could not resolve revision identifier: ${name}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return phids;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Link or unlink revisions to/from a task by calling differential.revision.edit
|
|
36
|
+
* with tasks.add / tasks.remove transactions.
|
|
37
|
+
*/
|
|
38
|
+
async function linkRevisionsToTask(client, taskIdentifier, revisionPHIDs, action) {
|
|
39
|
+
// Resolve the task identifier to a PHID if it's a T-prefixed ID
|
|
40
|
+
let taskPHID = taskIdentifier;
|
|
41
|
+
if (!taskIdentifier.startsWith('PHID-')) {
|
|
42
|
+
const lookupResult = await client.call('phid.lookup', { names: [taskIdentifier] });
|
|
43
|
+
const entry = lookupResult[taskIdentifier];
|
|
44
|
+
if (entry) {
|
|
45
|
+
taskPHID = entry.phid;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new Error(`Could not resolve task identifier: ${taskIdentifier}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const results = [];
|
|
52
|
+
for (const revPHID of revisionPHIDs) {
|
|
53
|
+
const result = await client.call('differential.revision.edit', {
|
|
54
|
+
objectIdentifier: revPHID,
|
|
55
|
+
transactions: [{ type: `tasks.${action}`, value: [taskPHID] }],
|
|
56
|
+
});
|
|
57
|
+
results.push(result);
|
|
58
|
+
}
|
|
59
|
+
return results;
|
|
60
|
+
}
|
|
3
61
|
export function registerManiphestTools(server, client) {
|
|
4
62
|
// Search tasks
|
|
5
63
|
server.tool('phabricator_task_search', 'Search Maniphest tasks with optional filters', {
|
|
@@ -51,9 +109,11 @@ export function registerManiphestTools(server, client) {
|
|
|
51
109
|
projectPHIDs: z.array(z.string()).optional().describe('Project PHIDs to tag'),
|
|
52
110
|
subscriberPHIDs: z.array(z.string()).optional().describe('Subscriber PHIDs'),
|
|
53
111
|
status: z.string().optional().describe('Initial status'),
|
|
112
|
+
subtype: z.string().optional().describe('Task subtype (e.g. "default", "incident")'),
|
|
54
113
|
parentPHIDs: z.array(z.string()).optional().describe('Parent task PHIDs'),
|
|
55
114
|
subtaskPHIDs: z.array(z.string()).optional().describe('Subtask PHIDs'),
|
|
56
|
-
commitPHIDs: z.array(z.string()).optional().describe('Commit PHIDs to associate'),
|
|
115
|
+
commitPHIDs: z.array(z.string()).optional().describe('Commit PHIDs to associate (for actual commits only, not revisions)'),
|
|
116
|
+
revisionIDs: z.array(z.string()).optional().describe('Differential revision IDs to link (e.g. ["D223125"] or ["PHID-DREV-xxx"]). Creates a bidirectional link between the revision and the task.'),
|
|
57
117
|
points: z.coerce.number().nullable().optional().describe('Story points value (if points are enabled on this instance)'),
|
|
58
118
|
space: z.string().optional().describe('Space PHID to place the task in (for multi-space installations)'),
|
|
59
119
|
comment: z.string().optional().describe('Initial comment on the task (supports Remarkup)'),
|
|
@@ -80,6 +140,9 @@ export function registerManiphestTools(server, client) {
|
|
|
80
140
|
if (params.status !== undefined) {
|
|
81
141
|
transactions.push({ type: 'status', value: params.status });
|
|
82
142
|
}
|
|
143
|
+
if (params.subtype !== undefined) {
|
|
144
|
+
transactions.push({ type: 'subtype', value: params.subtype });
|
|
145
|
+
}
|
|
83
146
|
if (params.parentPHIDs !== undefined) {
|
|
84
147
|
transactions.push({ type: 'parents.set', value: params.parentPHIDs });
|
|
85
148
|
}
|
|
@@ -104,6 +167,18 @@ export function registerManiphestTools(server, client) {
|
|
|
104
167
|
}
|
|
105
168
|
}
|
|
106
169
|
const result = await client.call('maniphest.edit', { transactions });
|
|
170
|
+
// Link revisions to the newly created task via differential.revision.edit
|
|
171
|
+
if (params.revisionIDs !== undefined && params.revisionIDs.length > 0) {
|
|
172
|
+
const revPHIDs = await resolveRevisionPHIDs(client, params.revisionIDs);
|
|
173
|
+
const taskId = `T${result.object.id}`;
|
|
174
|
+
const linkResults = await linkRevisionsToTask(client, taskId, revPHIDs, 'add');
|
|
175
|
+
return {
|
|
176
|
+
content: [{
|
|
177
|
+
type: 'text',
|
|
178
|
+
text: JSON.stringify({ ...result, linkedRevisions: linkResults }, null, 2),
|
|
179
|
+
}],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
107
182
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
108
183
|
});
|
|
109
184
|
// Edit task
|
|
@@ -114,6 +189,7 @@ export function registerManiphestTools(server, client) {
|
|
|
114
189
|
ownerPHID: z.string().nullable().optional().describe('New owner PHID (null to unassign)'),
|
|
115
190
|
priority: z.string().optional().describe('New priority'),
|
|
116
191
|
status: z.string().optional().describe('New status: open, resolved, wontfix, invalid, spite, duplicate'),
|
|
192
|
+
subtype: z.string().optional().describe('Task subtype (e.g. "default", "incident")'),
|
|
117
193
|
addProjectPHIDs: z.array(z.string()).optional().describe('Project PHIDs to add'),
|
|
118
194
|
removeProjectPHIDs: z.array(z.string()).optional().describe('Project PHIDs to remove'),
|
|
119
195
|
addSubscriberPHIDs: z.array(z.string()).optional().describe('Subscriber PHIDs to add'),
|
|
@@ -122,8 +198,10 @@ export function registerManiphestTools(server, client) {
|
|
|
122
198
|
removeParentPHIDs: z.array(z.string()).optional().describe('Parent task PHIDs to remove'),
|
|
123
199
|
addSubtaskPHIDs: z.array(z.string()).optional().describe('Subtask PHIDs to add'),
|
|
124
200
|
removeSubtaskPHIDs: z.array(z.string()).optional().describe('Subtask PHIDs to remove'),
|
|
125
|
-
addCommitPHIDs: z.array(z.string()).optional().describe('Commit PHIDs to associate'),
|
|
126
|
-
removeCommitPHIDs: z.array(z.string()).optional().describe('Commit PHIDs to disassociate'),
|
|
201
|
+
addCommitPHIDs: z.array(z.string()).optional().describe('Commit PHIDs to associate (for actual commits only, not revisions)'),
|
|
202
|
+
removeCommitPHIDs: z.array(z.string()).optional().describe('Commit PHIDs to disassociate (for actual commits only, not revisions)'),
|
|
203
|
+
addRevisionIDs: z.array(z.string()).optional().describe('Differential revision IDs to link (e.g. ["D223125"] or ["PHID-DREV-xxx"]). Creates a bidirectional link between the revision and the task.'),
|
|
204
|
+
removeRevisionIDs: z.array(z.string()).optional().describe('Differential revision IDs to unlink (e.g. ["D223125"] or ["PHID-DREV-xxx"]).'),
|
|
127
205
|
points: z.coerce.number().nullable().optional().describe('Story points value (null to clear)'),
|
|
128
206
|
columnPHID: z.string().optional().describe('Move to workboard column'),
|
|
129
207
|
space: z.string().optional().describe('Space PHID to move the task to (for multi-space installations)'),
|
|
@@ -146,6 +224,9 @@ export function registerManiphestTools(server, client) {
|
|
|
146
224
|
if (params.status !== undefined) {
|
|
147
225
|
transactions.push({ type: 'status', value: params.status });
|
|
148
226
|
}
|
|
227
|
+
if (params.subtype !== undefined) {
|
|
228
|
+
transactions.push({ type: 'subtype', value: params.subtype });
|
|
229
|
+
}
|
|
149
230
|
if (params.addProjectPHIDs !== undefined) {
|
|
150
231
|
transactions.push({ type: 'projects.add', value: params.addProjectPHIDs });
|
|
151
232
|
}
|
|
@@ -193,14 +274,32 @@ export function registerManiphestTools(server, client) {
|
|
|
193
274
|
transactions.push({ type: key, value });
|
|
194
275
|
}
|
|
195
276
|
}
|
|
196
|
-
|
|
277
|
+
const hasRevisionChanges = (params.addRevisionIDs !== undefined && params.addRevisionIDs.length > 0) ||
|
|
278
|
+
(params.removeRevisionIDs !== undefined && params.removeRevisionIDs.length > 0);
|
|
279
|
+
if (transactions.length === 0 && !hasRevisionChanges) {
|
|
197
280
|
return { content: [{ type: 'text', text: 'No changes specified' }] };
|
|
198
281
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
282
|
+
let result = undefined;
|
|
283
|
+
if (transactions.length > 0) {
|
|
284
|
+
result = await client.call('maniphest.edit', {
|
|
285
|
+
objectIdentifier: params.objectIdentifier,
|
|
286
|
+
transactions,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
// Link/unlink revisions via differential.revision.edit
|
|
290
|
+
const revisionResults = {};
|
|
291
|
+
if (params.addRevisionIDs !== undefined && params.addRevisionIDs.length > 0) {
|
|
292
|
+
const revPHIDs = await resolveRevisionPHIDs(client, params.addRevisionIDs);
|
|
293
|
+
revisionResults.added = await linkRevisionsToTask(client, params.objectIdentifier, revPHIDs, 'add');
|
|
294
|
+
}
|
|
295
|
+
if (params.removeRevisionIDs !== undefined && params.removeRevisionIDs.length > 0) {
|
|
296
|
+
const revPHIDs = await resolveRevisionPHIDs(client, params.removeRevisionIDs);
|
|
297
|
+
revisionResults.removed = await linkRevisionsToTask(client, params.objectIdentifier, revPHIDs, 'remove');
|
|
298
|
+
}
|
|
299
|
+
const output = hasRevisionChanges
|
|
300
|
+
? { ...(result !== undefined ? { task: result } : {}), linkedRevisions: revisionResults }
|
|
301
|
+
: result;
|
|
302
|
+
return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }] };
|
|
204
303
|
});
|
|
205
304
|
// Add comment to task
|
|
206
305
|
server.tool('phabricator_task_add_comment', 'Add a comment to a Maniphest task', {
|
package/dist/tools/phame.js
CHANGED
|
@@ -7,7 +7,6 @@ export function registerPhameTools(server, client) {
|
|
|
7
7
|
constraints: jsonCoerce(z.object({
|
|
8
8
|
ids: z.array(z.coerce.number()).optional().describe('Blog IDs'),
|
|
9
9
|
phids: z.array(z.string()).optional().describe('Blog PHIDs'),
|
|
10
|
-
statuses: z.string().optional().describe('Blog status: "active" or "archived"'),
|
|
11
10
|
subscribers: z.array(z.string()).optional().describe('Subscriber user/project PHIDs'),
|
|
12
11
|
projects: z.array(z.string()).optional().describe('Project PHIDs'),
|
|
13
12
|
query: z.string().optional().describe('Full-text search query'),
|
|
@@ -36,7 +35,6 @@ export function registerPhameTools(server, client) {
|
|
|
36
35
|
status: z.string().optional().describe('Blog status'),
|
|
37
36
|
addSubscriberPHIDs: z.array(z.string()).optional().describe('Subscriber PHIDs to add'),
|
|
38
37
|
removeSubscriberPHIDs: z.array(z.string()).optional().describe('Subscriber PHIDs to remove'),
|
|
39
|
-
comment: z.string().optional().describe('Add a comment alongside the edit (supports Remarkup)'),
|
|
40
38
|
}, async (params) => {
|
|
41
39
|
const transactions = [];
|
|
42
40
|
if (params.name !== undefined) {
|
|
@@ -66,9 +64,6 @@ export function registerPhameTools(server, client) {
|
|
|
66
64
|
if (params.removeSubscriberPHIDs !== undefined) {
|
|
67
65
|
transactions.push({ type: 'subscribers.remove', value: params.removeSubscriberPHIDs });
|
|
68
66
|
}
|
|
69
|
-
if (params.comment !== undefined) {
|
|
70
|
-
transactions.push({ type: 'comment', value: params.comment });
|
|
71
|
-
}
|
|
72
67
|
if (transactions.length === 0) {
|
|
73
68
|
return { content: [{ type: 'text', text: 'No changes specified' }] };
|
|
74
69
|
}
|
package/dist/tools/project.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsonCoerce } from './coerce.js';
|
|
|
3
3
|
export function registerProjectTools(server, client) {
|
|
4
4
|
// Search projects
|
|
5
5
|
server.tool('phabricator_project_search', 'Search Phabricator projects', {
|
|
6
|
-
queryKey: z.string().optional().describe('Built-in query: "all", "active", "joined", "watching"'),
|
|
6
|
+
queryKey: z.string().optional().describe('Built-in query: "all", "active" (non-archived), "joined", "watching"'),
|
|
7
7
|
constraints: jsonCoerce(z.object({
|
|
8
8
|
ids: z.array(z.coerce.number()).optional().describe('Project IDs'),
|
|
9
9
|
phids: z.array(z.string()).optional().describe('Project PHIDs'),
|
|
@@ -13,7 +13,6 @@ export function registerProjectTools(server, client) {
|
|
|
13
13
|
watchers: z.array(z.string()).optional().describe('Watcher user PHIDs'),
|
|
14
14
|
ancestors: z.array(z.string()).optional().describe('Ancestor project PHIDs'),
|
|
15
15
|
parents: z.array(z.string()).optional().describe('Parent project PHIDs (find subprojects)'),
|
|
16
|
-
status: z.string().optional().describe('Project status: "active" (default), "archived"'),
|
|
17
16
|
icons: z.array(z.string()).optional().describe('Filter by project icon'),
|
|
18
17
|
isMilestone: z.boolean().optional().describe('Filter milestones'),
|
|
19
18
|
isRoot: z.boolean().optional().describe('Filter root projects'),
|
|
@@ -41,6 +40,7 @@ export function registerProjectTools(server, client) {
|
|
|
41
40
|
server.tool('phabricator_project_edit', 'Create or edit a Phabricator project. Omit objectIdentifier to create a new project (name is required for creation).', {
|
|
42
41
|
objectIdentifier: z.string().optional().describe('Project PHID or ID. Omit to create a new project.'),
|
|
43
42
|
name: z.string().optional().describe('New name'),
|
|
43
|
+
description: z.string().optional().describe('Project description (supports Remarkup)'),
|
|
44
44
|
icon: z.string().optional().describe('New icon'),
|
|
45
45
|
color: z.string().optional().describe('New color'),
|
|
46
46
|
addMemberPHIDs: z.array(z.string()).optional().describe('Add members'),
|
|
@@ -49,12 +49,14 @@ export function registerProjectTools(server, client) {
|
|
|
49
49
|
parent: z.string().optional().describe('Parent project PHID (to create as a subproject)'),
|
|
50
50
|
milestone: z.string().optional().describe('Parent project PHID (to create as a milestone of that project)'),
|
|
51
51
|
slug: z.string().optional().describe('Project URL slug (replaces ALL existing slugs with this one)'),
|
|
52
|
-
comment: z.string().optional().describe('Add a comment alongside the edit (supports Remarkup)'),
|
|
53
52
|
}, async (params) => {
|
|
54
53
|
const transactions = [];
|
|
55
54
|
if (params.name !== undefined) {
|
|
56
55
|
transactions.push({ type: 'name', value: params.name });
|
|
57
56
|
}
|
|
57
|
+
if (params.description !== undefined) {
|
|
58
|
+
transactions.push({ type: 'description', value: params.description });
|
|
59
|
+
}
|
|
58
60
|
if (params.space !== undefined) {
|
|
59
61
|
transactions.push({ type: 'space', value: params.space });
|
|
60
62
|
}
|
|
@@ -79,9 +81,6 @@ export function registerProjectTools(server, client) {
|
|
|
79
81
|
if (params.removeMemberPHIDs !== undefined) {
|
|
80
82
|
transactions.push({ type: 'members.remove', value: params.removeMemberPHIDs });
|
|
81
83
|
}
|
|
82
|
-
if (params.comment !== undefined) {
|
|
83
|
-
transactions.push({ type: 'comment', value: params.comment });
|
|
84
|
-
}
|
|
85
84
|
if (transactions.length === 0) {
|
|
86
85
|
return { content: [{ type: 'text', text: 'No changes specified' }] };
|
|
87
86
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { jsonCoerce } from './coerce.js';
|
|
3
3
|
export function registerTransactionTools(server, client) {
|
|
4
|
-
server.tool('phabricator_transaction_search', 'Search transactions (comments, status changes, etc.) on
|
|
5
|
-
objectIdentifier: z.string().
|
|
6
|
-
objectType: z.string().optional().describe('Object type group to query (e.g., "TASK", "DREV", "CMIT"). Queries all transactions of that type. Provide this or objectIdentifier, not both.'),
|
|
4
|
+
server.tool('phabricator_transaction_search', 'Search transactions (comments, status changes, etc.) on a Phabricator object (e.g., "D123", "T456")', {
|
|
5
|
+
objectIdentifier: z.string().describe('Object ID (e.g., "D123", "T456") or PHID to get transactions for'),
|
|
7
6
|
constraints: jsonCoerce(z.object({
|
|
8
7
|
phids: z.array(z.string()).optional().describe('Transaction PHIDs'),
|
|
9
8
|
authorPHIDs: z.array(z.string()).optional().describe('Author PHIDs'),
|
|
@@ -12,12 +11,7 @@ export function registerTransactionTools(server, client) {
|
|
|
12
11
|
after: z.string().optional().describe('Cursor for next-page pagination'),
|
|
13
12
|
before: z.string().optional().describe('Cursor for previous-page pagination'),
|
|
14
13
|
}, async (params) => {
|
|
15
|
-
const
|
|
16
|
-
const result = await client.call('transaction.search', {
|
|
17
|
-
objectIdentifier,
|
|
18
|
-
objectType,
|
|
19
|
-
...searchParams,
|
|
20
|
-
});
|
|
14
|
+
const result = await client.call('transaction.search', params);
|
|
21
15
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
22
16
|
});
|
|
23
17
|
}
|
package/package.json
CHANGED