planko-mcp-server 0.9.0 → 0.10.0
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 +2 -2
- package/package.json +1 -1
- package/src/runnerTools.js +27 -3
package/README.md
CHANGED
|
@@ -333,9 +333,9 @@ CRUD, no folder sync), all authenticated with the runner token:
|
|
|
333
333
|
|
|
334
334
|
| Tool | What it does |
|
|
335
335
|
|---|---|
|
|
336
|
-
| `planko_agent_claim` | Long-poll for the oldest queued agentic task (`waitSeconds` 0–25). Returns its id, `claimSeq`, name, project, timeout, instructions (Markdown) and the parent context for a subtask, or `No task available.` |
|
|
336
|
+
| `planko_agent_claim` | Long-poll for the oldest queued agentic task (`waitSeconds` 0–25). Returns its id, `claimSeq`, name, project, timeout, instructions (Markdown), the owner's `humanInstructions` (+ `humanInstructionsLabel`, null when empty) and the parent context for a subtask, or `No task available.` |
|
|
337
337
|
| `planko_agent_finish` | Report the result (Markdown) of a claimed task with the `claimSeq` returned by the claim, and `error: true` when it failed. The task goes to validation, or is concluded automatically when its recurring model does not require validation. |
|
|
338
|
-
| `planko_agent_suggest_subtask` | Suggest a subtask (name, Markdown instructions, optional `timeoutMin`) under an agentic task. The owner accepts or rejects it in the app. |
|
|
338
|
+
| `planko_agent_suggest_subtask` | Suggest a subtask (name, Markdown instructions, optional `timeoutMin`) under an agentic task. The owner accepts or rejects it in the app. With `requireHumanInstructions: true` (+ `humanInstructionsLabel`, ≤200 chars, e.g. "Decidir entre A, B, C ou outro") the owner must fill in "Instruções humanas" before accepting — for a decision between options or an instruction only the owner can give. |
|
|
339
339
|
|
|
340
340
|
Every error (invalid/revoked token, task outside the token's scope, stale claim) is
|
|
341
341
|
returned as a tool error carrying the HTTP status.
|
package/package.json
CHANGED
package/src/runnerTools.js
CHANGED
|
@@ -45,6 +45,9 @@ export function registerRunnerTools(server, { api }) {
|
|
|
45
45
|
projectName: task.projectName ?? null,
|
|
46
46
|
timeoutMin: task.agentTimeoutMin ?? null,
|
|
47
47
|
instructions: descriptionToMarkdown(task.description),
|
|
48
|
+
// PL331: the owner's instructions prevail over the description
|
|
49
|
+
humanInstructions: task.humanInstructions ?? null,
|
|
50
|
+
humanInstructionsLabel: task.humanInstructionsLabel ?? null,
|
|
48
51
|
parentContext: task.parent
|
|
49
52
|
? {
|
|
50
53
|
id: task.parent.id,
|
|
@@ -92,22 +95,43 @@ export function registerRunnerTools(server, { api }) {
|
|
|
92
95
|
{
|
|
93
96
|
title: 'Suggest subtask',
|
|
94
97
|
description:
|
|
95
|
-
'Suggest a subtask under an agentic task. It is created as a suggestion that the owner accepts or rejects; it never runs before being accepted.'
|
|
98
|
+
'Suggest a subtask under an agentic task. It is created as a suggestion that the owner accepts or rejects; it never runs before being accepted. ' +
|
|
99
|
+
'When the subtask needs a decision between options or an instruction only the owner can give, set requireHumanInstructions=true: ' +
|
|
100
|
+
'the owner must fill in the "Instruções humanas" field before accepting, and the run receives that text. ' +
|
|
101
|
+
'Detail the options in the description (e.g. "A) …, B) …, C) …, or another one") and summarize them in humanInstructionsLabel, ' +
|
|
102
|
+
'e.g. "Decidir entre A, B, C ou outro".',
|
|
96
103
|
inputSchema: {
|
|
97
104
|
parentTaskId: objectId.describe('Id of the agentic parent task'),
|
|
98
105
|
name: z.string().min(1).max(200).describe('Subtask title'),
|
|
99
106
|
description: z.string().optional().describe('Instructions for the subtask, as Markdown'),
|
|
100
107
|
timeoutMin: z.number().int().min(1).max(1440).optional().describe('Timeout in minutes (default 60)'),
|
|
108
|
+
requireHumanInstructions: z
|
|
109
|
+
.boolean()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('true when the owner must write instructions (e.g. pick an option) before accepting'),
|
|
112
|
+
humanInstructionsLabel: z
|
|
113
|
+
.string()
|
|
114
|
+
.trim()
|
|
115
|
+
.min(1)
|
|
116
|
+
.max(200)
|
|
117
|
+
.optional()
|
|
118
|
+
.describe('Caption of the owner instructions field, e.g. "Decidir entre A, B, C ou outro". Required when requireHumanInstructions=true'),
|
|
101
119
|
},
|
|
102
120
|
annotations: ANNOTATIONS.WRITE,
|
|
103
121
|
},
|
|
104
|
-
async ({ parentTaskId, name, description, timeoutMin }) => {
|
|
122
|
+
async ({ parentTaskId, name, description, timeoutMin, requireHumanInstructions, humanInstructionsLabel }) => {
|
|
123
|
+
if (requireHumanInstructions === true && !humanInstructionsLabel?.trim()) {
|
|
124
|
+
return toolError('planko_agent_suggest_subtask failed: humanInstructionsLabel is required when requireHumanInstructions is true');
|
|
125
|
+
}
|
|
105
126
|
try {
|
|
106
127
|
const body = { name, description: markdownToDescription(description) };
|
|
107
128
|
if (timeoutMin !== undefined) body.agentTimeoutMin = timeoutMin;
|
|
129
|
+
if (requireHumanInstructions !== undefined) body.requireHumanInstructions = requireHumanInstructions;
|
|
130
|
+
if (humanInstructionsLabel !== undefined) body.humanInstructionsLabel = humanInstructionsLabel;
|
|
108
131
|
if (body.description == null) delete body.description;
|
|
109
132
|
const { task } = await api.suggestSubtask(parentTaskId, body);
|
|
110
|
-
|
|
133
|
+
const needs = requireHumanInstructions === true ? ' (needs the owner instructions)' : '';
|
|
134
|
+
return toolOk(`Suggested subtask "${task.name}" (id: ${task.id}) under ${parentTaskId}: ${task.agentStatus}${needs}`);
|
|
111
135
|
} catch (err) {
|
|
112
136
|
return toolError(`planko_agent_suggest_subtask failed: ${err.message}`);
|
|
113
137
|
}
|