brainfile 0.19.0 → 0.21.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 +18 -24
- package/dist/__tests__/helpers/mcp-wire.d.ts +45 -0
- package/dist/__tests__/helpers/mcp-wire.d.ts.map +1 -0
- package/dist/__tests__/helpers/mcp-wire.js +133 -0
- package/dist/__tests__/helpers/mcp-wire.js.map +1 -0
- package/dist/{chunk-YTFLC673.mjs → chunk-FOLBAGJS.mjs} +2483 -1075
- package/dist/cli.mjs +2526 -1656
- package/dist/commands/adr.d.ts +1 -9
- package/dist/commands/adr.d.ts.map +1 -1
- package/dist/commands/adr.js +11 -88
- package/dist/commands/adr.js.map +1 -1
- package/dist/commands/archive.d.ts +2 -5
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +43 -11
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/brief.d.ts +32 -0
- package/dist/commands/brief.d.ts.map +1 -0
- package/dist/commands/brief.js +161 -0
- package/dist/commands/brief.js.map +1 -0
- package/dist/commands/complete.js +1 -1
- package/dist/commands/complete.js.map +1 -1
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +115 -15
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/log.js +31 -18
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +72 -17
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/merge-driver.d.ts +26 -0
- package/dist/commands/merge-driver.d.ts.map +1 -0
- package/dist/commands/merge-driver.js +195 -0
- package/dist/commands/merge-driver.js.map +1 -0
- package/dist/commands/migrate-tracked.d.ts +8 -0
- package/dist/commands/migrate-tracked.d.ts.map +1 -0
- package/dist/commands/migrate-tracked.js +428 -0
- package/dist/commands/migrate-tracked.js.map +1 -0
- package/dist/commands/migrate.d.ts +6 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +19 -12
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/sync.d.ts +16 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +152 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/where.d.ts +21 -0
- package/dist/commands/where.d.ts.map +1 -0
- package/dist/commands/where.js +135 -0
- package/dist/commands/where.js.map +1 -0
- package/dist/mcp/helpers.d.ts +8 -0
- package/dist/mcp/helpers.d.ts.map +1 -1
- package/dist/mcp/helpers.js +44 -0
- package/dist/mcp/helpers.js.map +1 -1
- package/dist/mcp/schemas.d.ts +297 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +328 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/tools/brief_tool.d.ts +14 -0
- package/dist/mcp/tools/brief_tool.d.ts.map +1 -0
- package/dist/mcp/tools/brief_tool.js +96 -0
- package/dist/mcp/tools/brief_tool.js.map +1 -0
- package/dist/mcp/tools/contract_tool.d.ts.map +1 -1
- package/dist/mcp/tools/contract_tool.js +43 -18
- package/dist/mcp/tools/contract_tool.js.map +1 -1
- package/dist/mcp/tools/get_task_tool.d.ts.map +1 -1
- package/dist/mcp/tools/get_task_tool.js +7 -2
- package/dist/mcp/tools/get_task_tool.js.map +1 -1
- package/dist/mcp/tools/list_tasks_tool.d.ts.map +1 -1
- package/dist/mcp/tools/list_tasks_tool.js +9 -3
- package/dist/mcp/tools/list_tasks_tool.js.map +1 -1
- package/dist/mcp/tools/search_tool.d.ts.map +1 -1
- package/dist/mcp/tools/search_tool.js +17 -4
- package/dist/mcp/tools/search_tool.js.map +1 -1
- package/dist/mcp/tools/subtask_tool.d.ts.map +1 -1
- package/dist/mcp/tools/subtask_tool.js +52 -17
- package/dist/mcp/tools/subtask_tool.js.map +1 -1
- package/dist/mcp/tools/task_add_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_add_tool.js +13 -7
- package/dist/mcp/tools/task_add_tool.js.map +1 -1
- package/dist/mcp/tools/task_complete_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_complete_tool.js +39 -10
- package/dist/mcp/tools/task_complete_tool.js.map +1 -1
- package/dist/mcp/tools/task_delete_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_delete_tool.js +12 -6
- package/dist/mcp/tools/task_delete_tool.js.map +1 -1
- package/dist/mcp/tools/task_move_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_move_tool.js +21 -11
- package/dist/mcp/tools/task_move_tool.js.map +1 -1
- package/dist/mcp/tools/task_patch_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_patch_tool.js +23 -10
- package/dist/mcp/tools/task_patch_tool.js.map +1 -1
- package/dist/schemas/board.json +1 -1
- package/dist/tui/theme.d.ts +98 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +141 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/{tui-P56H4X7N.mjs → tui-M2KWIG2E.mjs} +1707 -2006
- package/dist/utils/board-autosync.d.ts +22 -0
- package/dist/utils/board-autosync.d.ts.map +1 -0
- package/dist/utils/board-autosync.js +166 -0
- package/dist/utils/board-autosync.js.map +1 -0
- package/dist/utils/board-commit-hooks.d.ts +12 -0
- package/dist/utils/board-commit-hooks.d.ts.map +1 -0
- package/dist/utils/board-commit-hooks.js +51 -0
- package/dist/utils/board-commit-hooks.js.map +1 -0
- package/dist/utils/board-repo.d.ts +108 -0
- package/dist/utils/board-repo.d.ts.map +1 -0
- package/dist/utils/board-repo.js +501 -0
- package/dist/utils/board-repo.js.map +1 -0
- package/dist/utils/board-sync.d.ts +111 -0
- package/dist/utils/board-sync.d.ts.map +1 -0
- package/dist/utils/board-sync.js +469 -0
- package/dist/utils/board-sync.js.map +1 -0
- package/dist/utils/brainfile-path.d.ts +11 -1
- package/dist/utils/brainfile-path.d.ts.map +1 -1
- package/dist/utils/brainfile-path.js +39 -2
- package/dist/utils/brainfile-path.js.map +1 -1
- package/dist/utils/cli-error.d.ts +20 -0
- package/dist/utils/cli-error.d.ts.map +1 -1
- package/dist/utils/cli-error.js +36 -0
- package/dist/utils/cli-error.js.map +1 -1
- package/package.json +3 -3
- package/dist/commands/rules.d.ts +0 -68
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js +0 -322
- package/dist/commands/rules.js.map +0 -1
package/dist/mcp/helpers.js
CHANGED
|
@@ -37,10 +37,12 @@ exports.resolveBrainfile = resolveBrainfile;
|
|
|
37
37
|
exports.requireV2 = requireV2;
|
|
38
38
|
exports.mcpStructuredError = mcpStructuredError;
|
|
39
39
|
exports.findGitRoot = findGitRoot;
|
|
40
|
+
exports.withBoardCommit = withBoardCommit;
|
|
40
41
|
const fs = __importStar(require("fs"));
|
|
41
42
|
const path = __importStar(require("path"));
|
|
42
43
|
const core_1 = require("@brainfile/core");
|
|
43
44
|
const v2_only_1 = require("../utils/v2-only");
|
|
45
|
+
const board_autosync_1 = require("../utils/board-autosync");
|
|
44
46
|
function resolveBrainfile(filePath) {
|
|
45
47
|
return path.resolve(filePath);
|
|
46
48
|
}
|
|
@@ -56,6 +58,9 @@ function requireV2(filePath) {
|
|
|
56
58
|
if (!(0, core_1.isV2)(resolvedPath)) {
|
|
57
59
|
return { content: [{ type: 'text', text: `Error: ${v2_only_1.V1_UNSUPPORTED_MESSAGE}` }], isError: true };
|
|
58
60
|
}
|
|
61
|
+
// A shared board in autosync=full mode fetches before stale reads.
|
|
62
|
+
(0, board_autosync_1.installAutosync)();
|
|
63
|
+
(0, board_autosync_1.fetchBeforeRead)(path.dirname(resolvedPath));
|
|
59
64
|
return null;
|
|
60
65
|
}
|
|
61
66
|
function mcpStructuredError(message, field, value) {
|
|
@@ -85,4 +90,43 @@ function findGitRoot(startDir) {
|
|
|
85
90
|
}
|
|
86
91
|
return null;
|
|
87
92
|
}
|
|
93
|
+
// ── Board-on-a-branch (spec-9): one commit per mutating tool call ─────────
|
|
94
|
+
const board_repo_1 = require("../utils/board-repo");
|
|
95
|
+
function isErrorResult(result) {
|
|
96
|
+
return typeof result === 'object' && result !== null && result.isError === true;
|
|
97
|
+
}
|
|
98
|
+
function describeToolCall(toolName, input) {
|
|
99
|
+
const action = typeof input.action === 'string' ? ` ${input.action}` : '';
|
|
100
|
+
const rawId = input.taskId ?? input.task;
|
|
101
|
+
const id = Array.isArray(rawId) ? ` ${rawId.join(',')}` : typeof rawId === 'string' ? ` ${rawId}` : '';
|
|
102
|
+
const detail = [input.title, input.column]
|
|
103
|
+
.find((v) => typeof v === 'string' && v.length > 0);
|
|
104
|
+
return `${toolName}${action}${id}${detail ? `: ${detail}` : ''}`;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Wrap a mutating tool handler so a successful call commits the board when it
|
|
108
|
+
* is tracked. A failed commit never fails the tool. The acting agent comes
|
|
109
|
+
* from `BRAINFILE_AGENT`, which the MCP host sets per agent.
|
|
110
|
+
*/
|
|
111
|
+
function withBoardCommit(toolName, defaultFile, handler) {
|
|
112
|
+
return async (input, extra) => {
|
|
113
|
+
const result = await handler(input, extra);
|
|
114
|
+
try {
|
|
115
|
+
if (!isErrorResult(result)) {
|
|
116
|
+
const filePath = typeof input.file === 'string' && input.file ? input.file : defaultFile;
|
|
117
|
+
const dotDir = path.dirname(resolveBrainfile(filePath));
|
|
118
|
+
if ((0, board_repo_1.isTrackedBoard)(dotDir)) {
|
|
119
|
+
(0, board_repo_1.commitBoard)(dotDir, {
|
|
120
|
+
message: describeToolCall(toolName, input),
|
|
121
|
+
agent: process.env.BRAINFILE_AGENT ?? null,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
/* recording is best-effort */
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
88
132
|
//# sourceMappingURL=helpers.js.map
|
package/dist/mcp/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/mcp/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/mcp/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,4CAEC;AAMD,8BAgBC;AAED,gDAYC;AAKD,kCAeC;AA0BD,0CAuBC;AArHD,uCAAyB;AACzB,2CAA6B;AAC7B,0CAAuC;AACvC,8CAA0D;AAC1D,4DAA2E;AAM3E,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,QAAgB;IACxC,MAAM,YAAY,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEhD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,0BAA0B,YAAY,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjH,CAAC;IAED,IAAI,CAAC,IAAA,WAAI,EAAC,YAAY,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,gCAAsB,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3G,CAAC;IAED,mEAAmE;IACnE,IAAA,gCAAe,GAAE,CAAC;IAClB,IAAA,gCAAe,EAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAE5C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,kBAA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AAI,IAAA,2BAAc,EAAC,MAAM,CAAC,EAAE,CAAC;oBAC3B,IAAA,wBAAW,EAAC,MAAM,EAAE;wBAClB,OAAO,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC;wBAC1C,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI;qBAC3C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schemas for the 11 consolidated MCP tools.
|
|
3
|
+
*
|
|
4
|
+
* Each tool declares one of these as `outputSchema`, and every non-error
|
|
5
|
+
* success path returns the matching object as `structuredContent` alongside
|
|
6
|
+
* the `content` text block it already emitted. The text block is never
|
|
7
|
+
* removed, so clients that read only `content` are unaffected.
|
|
8
|
+
*
|
|
9
|
+
* Three SDK behaviours (v2.0.0) shape everything here — all verified against
|
|
10
|
+
* the installed `@modelcontextprotocol/server` runtime:
|
|
11
|
+
*
|
|
12
|
+
* 1. Declaring `outputSchema` makes `structuredContent` MANDATORY on every
|
|
13
|
+
* result that is not `isError: true`. `McpServer.validateToolOutput`
|
|
14
|
+
* throws `Output validation error: … no structured content was provided`
|
|
15
|
+
* otherwise. Adding a schema to a tool therefore means auditing *every*
|
|
16
|
+
* success `return` in that tool, not just the main one.
|
|
17
|
+
*
|
|
18
|
+
* 2. Output validation is SKIPPED when `isError: true`, so error paths need
|
|
19
|
+
* neither `structuredContent` nor schema conformance. Error returns are
|
|
20
|
+
* left exactly as they were.
|
|
21
|
+
*
|
|
22
|
+
* 3. Root shape decides whether the two protocol eras agree. The 2025-era
|
|
23
|
+
* wire codec re-wraps `structuredContent` as `{result: …}` whenever the
|
|
24
|
+
* ADVERTISED schema root is not `type: "object"`, while the 2026-era codec
|
|
25
|
+
* is identity — so a non-object root would hand the two eras different
|
|
26
|
+
* bytes. Unions are still safe: the SDK's `standardSchemaToJsonSchema`
|
|
27
|
+
* injects `type: "object"` for any `oneOf`/`anyOf` whose members are all
|
|
28
|
+
* object-shaped (`isProvablyObjectShapedRoot`). Every union below is a
|
|
29
|
+
* union of objects for exactly that reason — adding a non-object member
|
|
30
|
+
* (a bare `z.string()`, say) would silently split the eras apart.
|
|
31
|
+
*
|
|
32
|
+
* Enum-ish fields that originate in hand-editable YAML (notably `priority`)
|
|
33
|
+
* are typed `z.string()` rather than `z.enum([...])`. A board carrying
|
|
34
|
+
* `priority: urgent` would otherwise fail output validation and turn a
|
|
35
|
+
* working call into an error result.
|
|
36
|
+
*/
|
|
37
|
+
import { z } from 'zod';
|
|
38
|
+
export declare const listTasksOutputSchema: z.ZodObject<{
|
|
39
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
40
|
+
column: z.ZodString;
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
title: z.ZodString;
|
|
43
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
44
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
count: z.ZodNumber;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
/**
|
|
50
|
+
* `get_task` spreads the raw `Task`, whose TypeScript type carries an open
|
|
51
|
+
* `[key: string]: unknown` index signature so extension fields (`x-otto`,
|
|
52
|
+
* `x-cursor`, …) round-trip. Modelled with `z.looseObject` so the advertised
|
|
53
|
+
* JSON Schema says `additionalProperties: {}` instead of `false` — a closed
|
|
54
|
+
* object would advertise those extension fields as illegal.
|
|
55
|
+
*
|
|
56
|
+
* `id` and `title` are required because `parseTaskContent` returns null for
|
|
57
|
+
* any task file missing either, so a task that reached this point has both.
|
|
58
|
+
* `column` is always set by the handler.
|
|
59
|
+
*/
|
|
60
|
+
export declare const getTaskOutputSchema: z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
title: z.ZodString;
|
|
63
|
+
column: z.ZodString;
|
|
64
|
+
type: z.ZodOptional<z.ZodString>;
|
|
65
|
+
description: z.ZodOptional<z.ZodString>;
|
|
66
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
blockedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
+
relatedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
71
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
73
|
+
dueDate: z.ZodOptional<z.ZodString>;
|
|
74
|
+
subtasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
title: z.ZodString;
|
|
77
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
}, z.core.$loose>>>;
|
|
79
|
+
contract: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
80
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
81
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
82
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
83
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
}, z.core.$loose>;
|
|
86
|
+
/**
|
|
87
|
+
* Three genuinely different payloads selected by which input was supplied.
|
|
88
|
+
* The variants' required-field sets don't overlap (`isLog` scalar vs `logs`
|
|
89
|
+
* array vs `results` array), so an untagged union discriminates structurally
|
|
90
|
+
* and no payload had to change to add a tag.
|
|
91
|
+
*/
|
|
92
|
+
export declare const searchOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
title: z.ZodString;
|
|
95
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
96
|
+
isLog: z.ZodBoolean;
|
|
97
|
+
description: z.ZodOptional<z.ZodString>;
|
|
98
|
+
log: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
title: z.ZodString;
|
|
103
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
count: z.ZodNumber;
|
|
106
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
107
|
+
results: z.ZodArray<z.ZodObject<{
|
|
108
|
+
column: z.ZodOptional<z.ZodString>;
|
|
109
|
+
score: z.ZodNumber;
|
|
110
|
+
isLog: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
title: z.ZodString;
|
|
113
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
114
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
115
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
count: z.ZodNumber;
|
|
118
|
+
}, z.core.$strip>]>;
|
|
119
|
+
/** New payload: `task_add` previously returned only a prose confirmation. */
|
|
120
|
+
export declare const taskAddOutputSchema: z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
title: z.ZodString;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
/**
|
|
125
|
+
* Both tools branch their TEXT on single-vs-batch, but the structured payload
|
|
126
|
+
* is always the batch shape (a one-element `results` array for a single move),
|
|
127
|
+
* so agents parse one shape regardless of how many IDs they passed.
|
|
128
|
+
*/
|
|
129
|
+
export declare const taskMoveOutputSchema: z.ZodObject<{
|
|
130
|
+
success: z.ZodBoolean;
|
|
131
|
+
successCount: z.ZodNumber;
|
|
132
|
+
failureCount: z.ZodNumber;
|
|
133
|
+
results: z.ZodArray<z.ZodObject<{
|
|
134
|
+
taskId: z.ZodString;
|
|
135
|
+
success: z.ZodBoolean;
|
|
136
|
+
message: z.ZodOptional<z.ZodString>;
|
|
137
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
138
|
+
error: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export declare const taskPatchOutputSchema: z.ZodObject<{
|
|
142
|
+
success: z.ZodBoolean;
|
|
143
|
+
successCount: z.ZodNumber;
|
|
144
|
+
failureCount: z.ZodNumber;
|
|
145
|
+
results: z.ZodArray<z.ZodObject<{
|
|
146
|
+
taskId: z.ZodString;
|
|
147
|
+
success: z.ZodBoolean;
|
|
148
|
+
error: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
/** New payload: `task_delete` previously returned only a prose confirmation. */
|
|
152
|
+
export declare const taskDeleteOutputSchema: z.ZodObject<{
|
|
153
|
+
id: z.ZodString;
|
|
154
|
+
deleted: z.ZodLiteral<true>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
/**
|
|
157
|
+
* `toggle` and `update` both key their payload `updated` but carry different
|
|
158
|
+
* item shapes (`{id, completed}` vs `{id, title}`), which is ambiguous without
|
|
159
|
+
* a tag. The tool's own `action` input is echoed into the output to
|
|
160
|
+
* discriminate — an added field, nothing renamed.
|
|
161
|
+
*
|
|
162
|
+
* The singular paths (which used to emit prose only) now emit the same plural
|
|
163
|
+
* array shape, so item count never changes the structure.
|
|
164
|
+
*/
|
|
165
|
+
export declare const subtaskOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
166
|
+
action: z.ZodLiteral<"add">;
|
|
167
|
+
added: z.ZodArray<z.ZodObject<{
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
title: z.ZodString;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
count: z.ZodNumber;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
action: z.ZodLiteral<"delete">;
|
|
174
|
+
deleted: z.ZodArray<z.ZodString>;
|
|
175
|
+
missing: z.ZodArray<z.ZodString>;
|
|
176
|
+
count: z.ZodNumber;
|
|
177
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
178
|
+
action: z.ZodLiteral<"toggle">;
|
|
179
|
+
updated: z.ZodArray<z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
count: z.ZodNumber;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
action: z.ZodLiteral<"update">;
|
|
186
|
+
updated: z.ZodArray<z.ZodObject<{
|
|
187
|
+
id: z.ZodString;
|
|
188
|
+
title: z.ZodString;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
count: z.ZodNumber;
|
|
191
|
+
}, z.core.$strip>], "action">;
|
|
192
|
+
/**
|
|
193
|
+
* Six heterogeneous actions, tagged by the `action` input the caller already
|
|
194
|
+
* supplied. `pickup`'s payload is genuinely free-text agent-context markdown,
|
|
195
|
+
* so its variant is deliberately thin — an output schema does not have to
|
|
196
|
+
* invent structure that the payload does not have.
|
|
197
|
+
*/
|
|
198
|
+
export declare const contractOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
|
+
action: z.ZodLiteral<"attach">;
|
|
200
|
+
task: z.ZodString;
|
|
201
|
+
status: z.ZodString;
|
|
202
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
203
|
+
action: z.ZodLiteral<"pickup">;
|
|
204
|
+
task: z.ZodString;
|
|
205
|
+
markdown: z.ZodString;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
action: z.ZodLiteral<"deliver">;
|
|
208
|
+
task: z.ZodString;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
action: z.ZodLiteral<"validate">;
|
|
211
|
+
ok: z.ZodBoolean;
|
|
212
|
+
status: z.ZodString;
|
|
213
|
+
deliverables: z.ZodArray<z.ZodObject<{
|
|
214
|
+
deliverable: z.ZodObject<{
|
|
215
|
+
type: z.ZodOptional<z.ZodString>;
|
|
216
|
+
path: z.ZodString;
|
|
217
|
+
description: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$loose>;
|
|
219
|
+
ok: z.ZodBoolean;
|
|
220
|
+
resolvedPath: z.ZodOptional<z.ZodString>;
|
|
221
|
+
error: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$loose>>;
|
|
223
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
224
|
+
command: z.ZodString;
|
|
225
|
+
exitCode: z.ZodNumber;
|
|
226
|
+
stdout: z.ZodString;
|
|
227
|
+
stderr: z.ZodString;
|
|
228
|
+
}, z.core.$loose>>;
|
|
229
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
230
|
+
command: z.ZodString;
|
|
231
|
+
message: z.ZodString;
|
|
232
|
+
}, z.core.$loose>>;
|
|
233
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
+
action: z.ZodLiteral<"graph">;
|
|
235
|
+
attached: z.ZodArray<z.ZodString>;
|
|
236
|
+
count: z.ZodNumber;
|
|
237
|
+
order: z.ZodArray<z.ZodString>;
|
|
238
|
+
graph: z.ZodString;
|
|
239
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
+
action: z.ZodLiteral<"activate">;
|
|
241
|
+
activated: z.ZodArray<z.ZodString>;
|
|
242
|
+
count: z.ZodNumber;
|
|
243
|
+
}, z.core.$strip>], "action">;
|
|
244
|
+
/**
|
|
245
|
+
* New payload: every success path previously returned prose only, with the
|
|
246
|
+
* interesting values (`completedAt`, issue number/id, issue URL) interpolated
|
|
247
|
+
* into the message. They are now also returned as real fields.
|
|
248
|
+
*
|
|
249
|
+
* Tagged by the `destination` input. The default path (no `destination`) and
|
|
250
|
+
* `destination: 'local'` share the `local` variant and are told apart by
|
|
251
|
+
* `archived`.
|
|
252
|
+
*/
|
|
253
|
+
export declare const taskCompleteOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
+
destination: z.ZodLiteral<"local">;
|
|
255
|
+
taskId: z.ZodString;
|
|
256
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
257
|
+
archived: z.ZodBoolean;
|
|
258
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
259
|
+
destination: z.ZodLiteral<"github">;
|
|
260
|
+
taskId: z.ZodString;
|
|
261
|
+
issueNumber: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
issueUrl: z.ZodOptional<z.ZodString>;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
destination: z.ZodLiteral<"linear">;
|
|
265
|
+
taskId: z.ZodString;
|
|
266
|
+
issueId: z.ZodOptional<z.ZodString>;
|
|
267
|
+
issueUrl: z.ZodOptional<z.ZodString>;
|
|
268
|
+
}, z.core.$strip>], "destination">;
|
|
269
|
+
/**
|
|
270
|
+
* `brief` — per-agent attention digest.
|
|
271
|
+
*
|
|
272
|
+
* Object root (not a bare array of lanes) so both protocol eras hand clients
|
|
273
|
+
* identical bytes, per note 3 above. `lastBriefAt` is nullable rather than
|
|
274
|
+
* optional: "this agent has never briefed" is a meaningful state a client must
|
|
275
|
+
* be able to distinguish from an omitted field.
|
|
276
|
+
*/
|
|
277
|
+
export declare const briefOutputSchema: z.ZodObject<{
|
|
278
|
+
agent: z.ZodString;
|
|
279
|
+
mode: z.ZodEnum<{
|
|
280
|
+
full: "full";
|
|
281
|
+
delta: "delta";
|
|
282
|
+
}>;
|
|
283
|
+
generatedAt: z.ZodString;
|
|
284
|
+
lastBriefAt: z.ZodNullable<z.ZodString>;
|
|
285
|
+
peek: z.ZodBoolean;
|
|
286
|
+
lanes: z.ZodArray<z.ZodObject<{
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
label: z.ZodString;
|
|
289
|
+
items: z.ZodArray<z.ZodObject<{
|
|
290
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
291
|
+
text: z.ZodString;
|
|
292
|
+
why: z.ZodString;
|
|
293
|
+
at: z.ZodOptional<z.ZodString>;
|
|
294
|
+
}, z.core.$strip>>;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/mcp/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAGhC,CAAC;AAIH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;iBAqB9B,CAAC;AAmCH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;mBAI7B,CAAC;AAIH,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AAIH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;iBAW/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;iBAShC,CAAC;AAIH,gFAAgF;AAChF,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAC;AAIH;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;6BAsB9B,CAAC;AAaH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAgD/B,CAAC;AAIH;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;kCAmBnC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;iBAgB5B,CAAC"}
|