@hasna/todos 0.11.38 → 0.11.40
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 +1 -11
- package/dist/capabilities.d.ts +32 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/cli/index.js +16830 -29235
- package/dist/contracts.d.ts +58 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +823 -0
- package/dist/db/builtin-templates.d.ts.map +1 -1
- package/dist/index.d.ts +14 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4712 -13636
- package/dist/json-contracts.d.ts +56 -0
- package/dist/json-contracts.d.ts.map +1 -0
- package/dist/lib/config.d.ts +17 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/logger.d.ts +6 -12
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +4435 -16629
- package/dist/mcp/token-utils.d.ts.map +1 -1
- package/dist/mcp/tools/code-tools.d.ts.map +1 -1
- package/dist/mcp/tools/task-meta-tools.d.ts.map +1 -1
- package/dist/mcp.d.ts +42 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +359 -0
- package/dist/registry.d.ts +33 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +1382 -0
- package/dist/sdk/client.d.ts +1 -1
- package/dist/sdk/client.d.ts.map +1 -1
- package/dist/sdk/index.js +635 -0
- package/dist/server/index.js +4 -4
- package/dist/storage/index.d.ts +4 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/interfaces.d.ts +185 -0
- package/dist/storage/interfaces.d.ts.map +1 -0
- package/dist/storage/local-sqlite.d.ts +7 -0
- package/dist/storage/local-sqlite.d.ts.map +1 -0
- package/dist/storage.d.ts +4 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +4984 -0
- package/package.json +22 -4
- package/dist/cli/commands/cloud-commands.d.ts +0 -3
- package/dist/cli/commands/cloud-commands.d.ts.map +0 -1
- package/dist/db/pg-migrate.d.ts +0 -14
- package/dist/db/pg-migrate.d.ts.map +0 -1
- package/dist/db/pg-migrations.d.ts +0 -8
- package/dist/db/pg-migrations.d.ts.map +0 -1
- package/dist/mcp/tools/cloud.d.ts +0 -12
- package/dist/mcp/tools/cloud.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-utils.d.ts","sourceRoot":"","sources":["../../src/mcp/token-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3C,eAAO,MAAM,cAAc,aAoBzB,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"token-utils.d.ts","sourceRoot":"","sources":["../../src/mcp/token-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3C,eAAO,MAAM,cAAc,aAoBzB,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CA6J7D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAMhE,CAAC;AAgBF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,YAAY,qBAA+B,EAC3C,UAAU,qBAAmC,GAC5C,OAAO,CAqCT;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,SAAM,GAAG,MAAM,GAAG,IAAI,CAK5F;AAED,wBAAgB,WAAW,CAAC,IAAI,E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ources":["../../../src/mcp/tools/code-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEjD,UAAU,gBAAgB;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACzD,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;IACxC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;CACpC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,gBAAgB,QAiDzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-meta-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task-meta-tools.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,UAAU,eAAe;IACvB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"task-meta-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task-meta-tools.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,UAAU,eAAe;IACvB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CACzC;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,QAgJ5E"}
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CORE_MCP_TOOLS, MCP_PROFILE_GROUPS, MCP_TOOL_GROUPS, shouldRegisterToolForProfile } from "./mcp/token-utils.js";
|
|
2
|
+
export type TodosMcpStability = "stable" | "experimental";
|
|
3
|
+
export interface CreateMcpManifestOptions {
|
|
4
|
+
version?: string;
|
|
5
|
+
generatedAt?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GetMcpToolNamesOptions {
|
|
8
|
+
profile?: string;
|
|
9
|
+
groups?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TodosMcpPackageSource {
|
|
12
|
+
packageName: "@hasna/todos";
|
|
13
|
+
repository: "hasna/todos";
|
|
14
|
+
version: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TodosMcpToolContract {
|
|
17
|
+
name: string;
|
|
18
|
+
groups: string[];
|
|
19
|
+
profiles: string[];
|
|
20
|
+
core: boolean;
|
|
21
|
+
stability: TodosMcpStability;
|
|
22
|
+
}
|
|
23
|
+
export interface TodosMcpManifest {
|
|
24
|
+
schemaVersion: 1;
|
|
25
|
+
generatedAt: string;
|
|
26
|
+
package: TodosMcpPackageSource;
|
|
27
|
+
server: {
|
|
28
|
+
name: "todos";
|
|
29
|
+
binary: "todos-mcp";
|
|
30
|
+
transport: "stdio";
|
|
31
|
+
profileEnvironmentVariable: "TODOS_PROFILE";
|
|
32
|
+
groupEnvironmentVariable: "TODOS_TOOL_GROUPS";
|
|
33
|
+
};
|
|
34
|
+
groups: Record<string, readonly string[]>;
|
|
35
|
+
profiles: Record<string, readonly string[]>;
|
|
36
|
+
tools: TodosMcpToolContract[];
|
|
37
|
+
}
|
|
38
|
+
export { CORE_MCP_TOOLS, MCP_PROFILE_GROUPS, MCP_TOOL_GROUPS, shouldRegisterToolForProfile, };
|
|
39
|
+
export declare function getMcpToolNames(options?: GetMcpToolNamesOptions): string[];
|
|
40
|
+
export declare function createMcpManifest(options?: CreateMcpManifestOptions): TodosMcpManifest;
|
|
41
|
+
export declare const TODOS_MCP_MANIFEST: TodosMcpManifest;
|
|
42
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,cAAc,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,aAAa,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,CAAC,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,MAAM,EAAE;QACN,IAAI,EAAE,OAAO,CAAC;QACd,MAAM,EAAE,WAAW,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;QACnB,0BAA0B,EAAE,eAAe,CAAC;QAC5C,wBAAwB,EAAE,mBAAmB,CAAC;KAC/C,CAAC;IACF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAC5C,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B;AAED,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,4BAA4B,GAC7B,CAAC;AAgCF,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,EAAE,CAM9E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,gBAAgB,CAuB1F;AAED,eAAO,MAAM,kBAAkB,kBAE7B,CAAC"}
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
function __accessProp(key) {
|
|
7
|
+
return this[key];
|
|
8
|
+
}
|
|
9
|
+
var __toCommonJS = (from) => {
|
|
10
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
+
if (entry)
|
|
12
|
+
return entry;
|
|
13
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (var key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(entry, key))
|
|
17
|
+
__defProp(entry, key, {
|
|
18
|
+
get: __accessProp.bind(from, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
__moduleCache.set(from, entry);
|
|
23
|
+
return entry;
|
|
24
|
+
};
|
|
25
|
+
var __moduleCache;
|
|
26
|
+
var __returnValue = (v) => v;
|
|
27
|
+
function __exportSetter(name, newValue) {
|
|
28
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
+
}
|
|
30
|
+
var __export = (target, all) => {
|
|
31
|
+
for (var name in all)
|
|
32
|
+
__defProp(target, name, {
|
|
33
|
+
get: all[name],
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
set: __exportSetter.bind(all, name)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
40
|
+
|
|
41
|
+
// src/lib/package-version.ts
|
|
42
|
+
import { existsSync, readFileSync } from "fs";
|
|
43
|
+
import { dirname, join } from "path";
|
|
44
|
+
import { fileURLToPath } from "url";
|
|
45
|
+
function getPackageVersion(fromUrl = import.meta.url) {
|
|
46
|
+
try {
|
|
47
|
+
let dir = dirname(fileURLToPath(fromUrl));
|
|
48
|
+
for (let i = 0;i < 5; i++) {
|
|
49
|
+
const pkgPath = join(dir, "package.json");
|
|
50
|
+
if (existsSync(pkgPath)) {
|
|
51
|
+
return JSON.parse(readFileSync(pkgPath, "utf-8")).version || "0.0.0";
|
|
52
|
+
}
|
|
53
|
+
const parent = dirname(dir);
|
|
54
|
+
if (parent === dir)
|
|
55
|
+
break;
|
|
56
|
+
dir = parent;
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
return "0.0.0";
|
|
60
|
+
}
|
|
61
|
+
return "0.0.0";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/mcp/token-utils.ts
|
|
65
|
+
var CORE_MCP_TOOLS = new Set([
|
|
66
|
+
"add_comment",
|
|
67
|
+
"bootstrap",
|
|
68
|
+
"claim_next_task",
|
|
69
|
+
"complete_task",
|
|
70
|
+
"create_task",
|
|
71
|
+
"fail_task",
|
|
72
|
+
"get_context",
|
|
73
|
+
"get_health",
|
|
74
|
+
"get_next_task",
|
|
75
|
+
"get_status",
|
|
76
|
+
"get_task",
|
|
77
|
+
"get_tasks_changed_since",
|
|
78
|
+
"heartbeat",
|
|
79
|
+
"list_agents",
|
|
80
|
+
"list_tasks",
|
|
81
|
+
"register_agent",
|
|
82
|
+
"release_agent",
|
|
83
|
+
"start_task",
|
|
84
|
+
"suggest_agent_name"
|
|
85
|
+
]);
|
|
86
|
+
var MCP_TOOL_GROUPS = {
|
|
87
|
+
core: [...CORE_MCP_TOOLS],
|
|
88
|
+
tasks: [
|
|
89
|
+
"archive_completed",
|
|
90
|
+
"approve_task",
|
|
91
|
+
"bulk_create_tasks",
|
|
92
|
+
"bulk_delete_tasks",
|
|
93
|
+
"bulk_update_tasks",
|
|
94
|
+
"cancel_task",
|
|
95
|
+
"claim_task",
|
|
96
|
+
"clone_task",
|
|
97
|
+
"delete_task",
|
|
98
|
+
"extend_task",
|
|
99
|
+
"get_active_work",
|
|
100
|
+
"get_archived_tasks",
|
|
101
|
+
"get_blocked_tasks",
|
|
102
|
+
"get_blocking_tasks",
|
|
103
|
+
"get_my_tasks",
|
|
104
|
+
"get_review_queue",
|
|
105
|
+
"get_stale_tasks",
|
|
106
|
+
"list_my_tasks",
|
|
107
|
+
"move_task",
|
|
108
|
+
"patrol_tasks",
|
|
109
|
+
"prioritize_task",
|
|
110
|
+
"reassign_task",
|
|
111
|
+
"release_task",
|
|
112
|
+
"reschedule_task",
|
|
113
|
+
"search_tasks",
|
|
114
|
+
"standup",
|
|
115
|
+
"task_context",
|
|
116
|
+
"unarchive_task",
|
|
117
|
+
"update_task"
|
|
118
|
+
],
|
|
119
|
+
projects: [
|
|
120
|
+
"create_plan",
|
|
121
|
+
"create_project",
|
|
122
|
+
"create_task_list",
|
|
123
|
+
"delete_plan",
|
|
124
|
+
"delete_project",
|
|
125
|
+
"delete_task_list",
|
|
126
|
+
"get_focus",
|
|
127
|
+
"get_plan",
|
|
128
|
+
"get_project",
|
|
129
|
+
"get_task_list",
|
|
130
|
+
"list_plans",
|
|
131
|
+
"list_projects",
|
|
132
|
+
"list_task_lists",
|
|
133
|
+
"set_focus",
|
|
134
|
+
"unfocus",
|
|
135
|
+
"update_plan",
|
|
136
|
+
"update_project",
|
|
137
|
+
"update_task_list"
|
|
138
|
+
],
|
|
139
|
+
resources: [
|
|
140
|
+
"add_task_dependency",
|
|
141
|
+
"add_task_file",
|
|
142
|
+
"add_task_relationship",
|
|
143
|
+
"bulk_find_tasks_by_files",
|
|
144
|
+
"check_file_lock",
|
|
145
|
+
"create_comment",
|
|
146
|
+
"delete_comment",
|
|
147
|
+
"detect_file_relationships",
|
|
148
|
+
"find_path",
|
|
149
|
+
"find_task_by_commit",
|
|
150
|
+
"find_tasks_by_file",
|
|
151
|
+
"get_comments",
|
|
152
|
+
"get_critical_path",
|
|
153
|
+
"get_file_heat_map",
|
|
154
|
+
"get_impact_analysis",
|
|
155
|
+
"get_latest_handoff",
|
|
156
|
+
"get_related_entities",
|
|
157
|
+
"get_task_commits",
|
|
158
|
+
"get_task_dependencies",
|
|
159
|
+
"get_task_relationships",
|
|
160
|
+
"get_task_watchers",
|
|
161
|
+
"link_task_to_commit",
|
|
162
|
+
"list_active_files",
|
|
163
|
+
"list_comments",
|
|
164
|
+
"list_file_locks",
|
|
165
|
+
"list_task_files",
|
|
166
|
+
"lock_file",
|
|
167
|
+
"log_time",
|
|
168
|
+
"remove_task_dependency",
|
|
169
|
+
"remove_task_relationship",
|
|
170
|
+
"sync_kg",
|
|
171
|
+
"unlock_file",
|
|
172
|
+
"unwatch_task",
|
|
173
|
+
"update_comment",
|
|
174
|
+
"watch_task"
|
|
175
|
+
],
|
|
176
|
+
agents: [
|
|
177
|
+
"auto_assign_task",
|
|
178
|
+
"delete_agent",
|
|
179
|
+
"get_agent",
|
|
180
|
+
"get_agent_metrics",
|
|
181
|
+
"get_capable_agents",
|
|
182
|
+
"get_leaderboard",
|
|
183
|
+
"get_my_workload",
|
|
184
|
+
"get_org_chart",
|
|
185
|
+
"get_project_org_chart",
|
|
186
|
+
"get_time_report",
|
|
187
|
+
"list_project_agent_roles",
|
|
188
|
+
"rebalance_workload",
|
|
189
|
+
"rename_agent",
|
|
190
|
+
"set_project_agent_role",
|
|
191
|
+
"set_reports_to",
|
|
192
|
+
"unarchive_agent",
|
|
193
|
+
"update_agent"
|
|
194
|
+
],
|
|
195
|
+
metadata: [
|
|
196
|
+
"create_label",
|
|
197
|
+
"create_tag",
|
|
198
|
+
"delete_label",
|
|
199
|
+
"delete_tag",
|
|
200
|
+
"get_label",
|
|
201
|
+
"get_recent_activity",
|
|
202
|
+
"get_tag",
|
|
203
|
+
"get_task_graph",
|
|
204
|
+
"get_task_history",
|
|
205
|
+
"get_task_stats",
|
|
206
|
+
"list_labels",
|
|
207
|
+
"list_tags",
|
|
208
|
+
"search_tools",
|
|
209
|
+
"describe_tools",
|
|
210
|
+
"update_label",
|
|
211
|
+
"update_tag"
|
|
212
|
+
],
|
|
213
|
+
dispatch: [
|
|
214
|
+
"cancel_dispatch",
|
|
215
|
+
"dispatch_task_list",
|
|
216
|
+
"dispatch_tasks",
|
|
217
|
+
"dispatch_to_multiple",
|
|
218
|
+
"list_dispatches",
|
|
219
|
+
"run_due_dispatches"
|
|
220
|
+
],
|
|
221
|
+
templates: [
|
|
222
|
+
"create_task_from_template",
|
|
223
|
+
"create_template",
|
|
224
|
+
"delete_template",
|
|
225
|
+
"export_template",
|
|
226
|
+
"import_template",
|
|
227
|
+
"init_templates",
|
|
228
|
+
"list_templates",
|
|
229
|
+
"preview_template",
|
|
230
|
+
"template_history",
|
|
231
|
+
"update_template"
|
|
232
|
+
],
|
|
233
|
+
webhooks: ["create_webhook", "delete_webhook", "list_webhooks"],
|
|
234
|
+
machines: [
|
|
235
|
+
"machines_archive",
|
|
236
|
+
"machines_delete",
|
|
237
|
+
"machines_list",
|
|
238
|
+
"machines_register",
|
|
239
|
+
"machines_set_primary",
|
|
240
|
+
"machines_unarchive"
|
|
241
|
+
],
|
|
242
|
+
maintenance: ["extract_todos", "notify_upcoming_deadlines", "score_task"]
|
|
243
|
+
};
|
|
244
|
+
var MCP_PROFILE_GROUPS = {
|
|
245
|
+
minimal: ["core"],
|
|
246
|
+
core: ["core"],
|
|
247
|
+
standard: ["core", "tasks", "projects", "resources", "agents", "metadata"],
|
|
248
|
+
agent: ["core", "tasks", "projects", "resources"],
|
|
249
|
+
maintainer: ["core", "tasks", "projects", "resources", "agents", "metadata", "dispatch", "maintenance"]
|
|
250
|
+
};
|
|
251
|
+
function splitTokens(value) {
|
|
252
|
+
return (value || "").split(",").map((item) => item.trim().toLowerCase()).filter(Boolean);
|
|
253
|
+
}
|
|
254
|
+
function addGroupTools(toolNames, groupName) {
|
|
255
|
+
const tools = MCP_TOOL_GROUPS[groupName];
|
|
256
|
+
if (!tools)
|
|
257
|
+
return false;
|
|
258
|
+
for (const tool of tools)
|
|
259
|
+
toolNames.add(tool);
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
function shouldRegisterToolForProfile(name, profileValue = process.env["TODOS_PROFILE"], groupValue = process.env["TODOS_TOOL_GROUPS"]) {
|
|
263
|
+
const profileTokens = splitTokens(profileValue || "minimal");
|
|
264
|
+
const groupTokens = splitTokens(groupValue);
|
|
265
|
+
if (profileTokens.includes("full") || profileTokens.includes("all"))
|
|
266
|
+
return true;
|
|
267
|
+
const tools = new Set;
|
|
268
|
+
let matchedProfile = false;
|
|
269
|
+
for (const token of profileTokens) {
|
|
270
|
+
const profileGroups = MCP_PROFILE_GROUPS[token];
|
|
271
|
+
if (profileGroups) {
|
|
272
|
+
matchedProfile = true;
|
|
273
|
+
for (const group of profileGroups)
|
|
274
|
+
addGroupTools(tools, group);
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (addGroupTools(tools, token)) {
|
|
278
|
+
matchedProfile = true;
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (token.startsWith("tool:")) {
|
|
282
|
+
matchedProfile = true;
|
|
283
|
+
tools.add(token.slice("tool:".length));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (!matchedProfile) {
|
|
287
|
+
addGroupTools(tools, "core");
|
|
288
|
+
}
|
|
289
|
+
for (const token of groupTokens) {
|
|
290
|
+
if (token === "full" || token === "all")
|
|
291
|
+
return true;
|
|
292
|
+
if (!addGroupTools(tools, token) && token.startsWith("tool:")) {
|
|
293
|
+
tools.add(token.slice("tool:".length));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return tools.has(name);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// src/mcp.ts
|
|
300
|
+
function source(version) {
|
|
301
|
+
return {
|
|
302
|
+
packageName: "@hasna/todos",
|
|
303
|
+
repository: "hasna/todos",
|
|
304
|
+
version
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function uniqueSorted(values) {
|
|
308
|
+
return [...new Set(values)].sort((left, right) => left.localeCompare(right));
|
|
309
|
+
}
|
|
310
|
+
function getAllMcpToolNames() {
|
|
311
|
+
return uniqueSorted(Object.values(MCP_TOOL_GROUPS).flatMap((tools) => [...tools]));
|
|
312
|
+
}
|
|
313
|
+
function groupsForTool(toolName) {
|
|
314
|
+
return Object.entries(MCP_TOOL_GROUPS).filter(([, tools]) => tools.includes(toolName)).map(([group]) => group).sort((left, right) => left.localeCompare(right));
|
|
315
|
+
}
|
|
316
|
+
function profilesForTool(toolName) {
|
|
317
|
+
return Object.entries(MCP_PROFILE_GROUPS).filter(([, groups]) => groups.some((group) => MCP_TOOL_GROUPS[group]?.includes(toolName))).map(([profile]) => profile).sort((left, right) => left.localeCompare(right));
|
|
318
|
+
}
|
|
319
|
+
function getMcpToolNames(options = {}) {
|
|
320
|
+
const profile = options.profile ?? "minimal";
|
|
321
|
+
const groups = options.groups ?? "";
|
|
322
|
+
return getAllMcpToolNames().filter((toolName) => shouldRegisterToolForProfile(toolName, profile, groups));
|
|
323
|
+
}
|
|
324
|
+
function createMcpManifest(options = {}) {
|
|
325
|
+
const version = options.version ?? getPackageVersion(import.meta.url);
|
|
326
|
+
return {
|
|
327
|
+
schemaVersion: 1,
|
|
328
|
+
generatedAt: options.generatedAt ?? new Date().toISOString(),
|
|
329
|
+
package: source(version),
|
|
330
|
+
server: {
|
|
331
|
+
name: "todos",
|
|
332
|
+
binary: "todos-mcp",
|
|
333
|
+
transport: "stdio",
|
|
334
|
+
profileEnvironmentVariable: "TODOS_PROFILE",
|
|
335
|
+
groupEnvironmentVariable: "TODOS_TOOL_GROUPS"
|
|
336
|
+
},
|
|
337
|
+
groups: MCP_TOOL_GROUPS,
|
|
338
|
+
profiles: MCP_PROFILE_GROUPS,
|
|
339
|
+
tools: getAllMcpToolNames().map((toolName) => ({
|
|
340
|
+
name: toolName,
|
|
341
|
+
groups: groupsForTool(toolName),
|
|
342
|
+
profiles: profilesForTool(toolName),
|
|
343
|
+
core: CORE_MCP_TOOLS.has(toolName),
|
|
344
|
+
stability: CORE_MCP_TOOLS.has(toolName) ? "stable" : "experimental"
|
|
345
|
+
}))
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
var TODOS_MCP_MANIFEST = createMcpManifest({
|
|
349
|
+
generatedAt: "1970-01-01T00:00:00.000Z"
|
|
350
|
+
});
|
|
351
|
+
export {
|
|
352
|
+
shouldRegisterToolForProfile,
|
|
353
|
+
getMcpToolNames,
|
|
354
|
+
createMcpManifest,
|
|
355
|
+
TODOS_MCP_MANIFEST,
|
|
356
|
+
MCP_TOOL_GROUPS,
|
|
357
|
+
MCP_PROFILE_GROUPS,
|
|
358
|
+
CORE_MCP_TOOLS
|
|
359
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TodosCapabilityManifest } from "./capabilities.js";
|
|
2
|
+
import type { TodosContractsManifest } from "./contracts.js";
|
|
3
|
+
import type { TodosMcpManifest } from "./mcp.js";
|
|
4
|
+
export interface CreateTodosRegistryOptions {
|
|
5
|
+
version?: string;
|
|
6
|
+
generatedAt?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TodosPackageSource {
|
|
9
|
+
packageName: "@hasna/todos";
|
|
10
|
+
repository: "hasna/todos";
|
|
11
|
+
version: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TodosPackageExportContract {
|
|
14
|
+
subpath: "." | "./sdk" | "./mcp" | "./registry" | "./contracts" | "./storage";
|
|
15
|
+
import: string;
|
|
16
|
+
types: string;
|
|
17
|
+
description: string;
|
|
18
|
+
stability: "stable";
|
|
19
|
+
}
|
|
20
|
+
export interface TodosRegistry {
|
|
21
|
+
schemaVersion: 1;
|
|
22
|
+
generatedAt: string;
|
|
23
|
+
package: TodosPackageSource;
|
|
24
|
+
exports: TodosPackageExportContract[];
|
|
25
|
+
jsonContractDocsPath: "docs/json-contracts.md";
|
|
26
|
+
capabilities: TodosCapabilityManifest;
|
|
27
|
+
contracts: TodosContractsManifest;
|
|
28
|
+
mcp: TodosMcpManifest;
|
|
29
|
+
}
|
|
30
|
+
export declare const TODOS_PACKAGE_EXPORTS: TodosPackageExportContract[];
|
|
31
|
+
export declare function createTodosRegistry(options?: CreateTodosRegistryOptions): TodosRegistry;
|
|
32
|
+
export declare const TODOS_REGISTRY: TodosRegistry;
|
|
33
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAG7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;I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