wyrm-mcp 7.3.2 → 7.3.3
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 +8 -14
- package/dist/activation.js +59 -1
- package/dist/agent-daemon.js +281 -4
- package/dist/agent-loop.js +332 -7
- package/dist/analytics.js +236 -13
- package/dist/attribution.js +49 -1
- package/dist/audit.js +457 -2
- package/dist/auto-capture.js +138 -3
- package/dist/auto-orchestrator.js +325 -1
- package/dist/autoconfig.d.ts +50 -0
- package/dist/autoconfig.d.ts.map +1 -1
- package/dist/autoconfig.js +1115 -39
- package/dist/autoconfig.js.map +1 -1
- package/dist/buddy-runner.js +109 -1
- package/dist/buddy.js +564 -14
- package/dist/build-flags.js +15 -1
- package/dist/capabilities.js +183 -3
- package/dist/capture.js +56 -1
- package/dist/causality.js +148 -8
- package/dist/cli.js +281 -20
- package/dist/cloud/cli.js +541 -5
- package/dist/cloud/client.js +221 -1
- package/dist/cloud/crypto.js +85 -1
- package/dist/cloud/machine-id.js +113 -2
- package/dist/cloud/recovery.js +60 -1
- package/dist/cloud/sync-engine.js +543 -7
- package/dist/cloud-backup.js +579 -5
- package/dist/cloud-profile.js +138 -1
- package/dist/cloud-sync-entrypoint.js +47 -1
- package/dist/cloud-sync.js +309 -2
- package/dist/connectors/bridge-source.d.ts +46 -0
- package/dist/connectors/bridge-source.d.ts.map +1 -0
- package/dist/connectors/bridge-source.js +77 -0
- package/dist/connectors/bridge-source.js.map +1 -0
- package/dist/connectors/index.d.ts +24 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +69 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors/ingest.d.ts +16 -0
- package/dist/connectors/ingest.d.ts.map +1 -0
- package/dist/connectors/ingest.js +116 -0
- package/dist/connectors/ingest.js.map +1 -0
- package/dist/connectors/types.d.ts +99 -0
- package/dist/connectors/types.d.ts.map +1 -0
- package/dist/connectors/types.js +17 -0
- package/dist/connectors/types.js.map +1 -0
- package/dist/constellation.js +168 -12
- package/dist/content-signature.js +45 -1
- package/dist/context-build-budgeted.js +144 -4
- package/dist/context-ranking.js +69 -1
- package/dist/crypto.js +179 -1
- package/dist/daemon-write-endpoint.js +290 -1
- package/dist/daemon-writer.js +406 -2
- package/dist/database.js +1278 -53
- package/dist/deprecations.js +162 -2
- package/dist/design.js +141 -13
- package/dist/event-replication.js +112 -1
- package/dist/events-sse.js +43 -7
- package/dist/events.js +238 -6
- package/dist/failure-patterns.d.ts +107 -0
- package/dist/failure-patterns.d.ts.map +1 -1
- package/dist/failure-patterns.js +924 -43
- package/dist/failure-patterns.js.map +1 -1
- package/dist/federation.js +236 -12
- package/dist/goals.js +101 -13
- package/dist/golden.js +355 -3
- package/dist/handlers/agent.js +165 -4
- package/dist/handlers/alias-adapters.js +129 -1
- package/dist/handlers/aliases.js +171 -1
- package/dist/handlers/audit.js +87 -1
- package/dist/handlers/boundary.js +221 -1
- package/dist/handlers/capture.js +1114 -73
- package/dist/handlers/causality.js +119 -9
- package/dist/handlers/cloud.js +382 -85
- package/dist/handlers/companion.js +459 -28
- package/dist/handlers/datalake.js +187 -7
- package/dist/handlers/dispatch-context.js +22 -0
- package/dist/handlers/entity.js +256 -25
- package/dist/handlers/events.js +335 -16
- package/dist/handlers/failure.d.ts.map +1 -1
- package/dist/handlers/failure.js +408 -13
- package/dist/handlers/failure.js.map +1 -1
- package/dist/handlers/goals.js +296 -4
- package/dist/handlers/intelligence.js +681 -126
- package/dist/handlers/invoicing.js +70 -1
- package/dist/handlers/mcpclient.js +137 -6
- package/dist/handlers/orchestration.js +125 -40
- package/dist/handlers/output-schemas.js +24 -1
- package/dist/handlers/presence.js +99 -3
- package/dist/handlers/project.js +182 -28
- package/dist/handlers/prompts.js +157 -6
- package/dist/handlers/quest.js +224 -4
- package/dist/handlers/recall.js +237 -13
- package/dist/handlers/registry.js +167 -1
- package/dist/handlers/resources.js +288 -1
- package/dist/handlers/review.js +74 -11
- package/dist/handlers/run.js +498 -16
- package/dist/handlers/search.js +338 -15
- package/dist/handlers/session.js +643 -31
- package/dist/handlers/share.js +184 -8
- package/dist/handlers/shims.js +464 -1
- package/dist/handlers/skill.js +449 -67
- package/dist/handlers/survivors.js +120 -1
- package/dist/handlers/symbols.js +109 -8
- package/dist/handlers/syncops.js +302 -4
- package/dist/handlers/types.js +27 -1
- package/dist/harvest.js +191 -5
- package/dist/hours.js +156 -7
- package/dist/http-auth.js +321 -3
- package/dist/http-fast.js +1302 -22
- package/dist/icons.js +47 -1
- package/dist/importers.js +268 -1
- package/dist/index.js +840 -2
- package/dist/indexer.js +145 -4
- package/dist/intelligence.js +261 -31
- package/dist/internal-dispatch.js +212 -3
- package/dist/keyset.js +110 -1
- package/dist/knowledge-graph.js +176 -12
- package/dist/license.js +441 -2
- package/dist/logger.js +199 -2
- package/dist/maintenance.js +148 -2
- package/dist/mcp-client.js +262 -6
- package/dist/memory-artifacts.js +596 -32
- package/dist/migrate-prompt.js +124 -2
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +799 -42
- package/dist/migrations.js.map +1 -1
- package/dist/performance.js +228 -1
- package/dist/presence.js +140 -11
- package/dist/priority-embed.js +164 -5
- package/dist/providers/embedding-provider.js +196 -1
- package/dist/readonly-gate.js +29 -1
- package/dist/receipt.js +43 -1
- package/dist/rehydration.js +157 -9
- package/dist/reindex.js +88 -1
- package/dist/render-target.js +544 -21
- package/dist/render.js +280 -4
- package/dist/repl-guard.js +173 -1
- package/dist/replication-daemon-entrypoint.js +31 -1
- package/dist/replication-daemon.js +262 -2
- package/dist/rerank.js +142 -1
- package/dist/resilience.js +591 -1
- package/dist/reverse-bridge.js +360 -5
- package/dist/security.js +244 -1
- package/dist/session-seen.js +51 -3
- package/dist/setup.js +260 -1
- package/dist/skill-author.js +168 -5
- package/dist/spec-kit.js +191 -1
- package/dist/sqlite-busy.js +154 -1
- package/dist/statusline.js +315 -11
- package/dist/sub-agent.js +262 -13
- package/dist/summarizer.js +139 -13
- package/dist/symbols.js +283 -7
- package/dist/sync.js +359 -5
- package/dist/tasks-dispatch.js +84 -1
- package/dist/tasks.js +282 -1
- package/dist/token-budget.js +143 -1
- package/dist/tool-analytics.js +129 -7
- package/dist/tool-annotations.js +365 -1
- package/dist/tool-manifest-v2.json +1 -1
- package/dist/tool-manifest.json +1 -1
- package/dist/tool-profiles.js +75 -1
- package/dist/trace-harvest.js +244 -6
- package/dist/types.js +30 -1
- package/dist/ui-dashboard.js +50 -41
- package/dist/ulid.js +81 -1
- package/dist/usage-tracker.js +66 -1
- package/dist/validate.js +129 -1
- package/dist/vault.js +534 -1
- package/dist/vector-init.js +67 -1
- package/dist/vectors.js +184 -3
- package/dist/version-check.js +136 -4
- package/dist/visibility.js +155 -19
- package/dist/wyrm-cli.js +2845 -101
- package/dist/wyrm-cli.js.map +1 -1
- package/dist/wyrm-guard.d.ts.map +1 -1
- package/dist/wyrm-guard.js +475 -14
- package/dist/wyrm-guard.js.map +1 -1
- package/dist/wyrm-loop.js +150 -3
- package/dist/wyrm-manifest.json +1 -1
- package/dist/wyrm-statusline-daemon.js +11 -1
- package/dist/wyrm-statusline.js +56 -4
- package/dist/wyrm-ui.js +77 -9
- package/package.json +1 -1
package/dist/handlers/skill.js
CHANGED
|
@@ -1,67 +1,449 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @copyright 2026 Ghost Protocol (Pvt) Ltd.
|
|
3
|
+
* @license Proprietary — (c) 2026 Ghost Protocol (Pvt) Ltd. All rights reserved. See LICENSE.
|
|
4
|
+
*/
|
|
5
|
+
import { TOOL_ANNOTATIONS } from "../tool-annotations.js";
|
|
6
|
+
import { currentReadCacheKey } from "./boundary.js";
|
|
7
|
+
import { cache } from "../performance.js";
|
|
8
|
+
import { sanitizeFtsQuery } from "../security.js";
|
|
9
|
+
import { deploySkill, validateAtomicSkill } from "../skill-author.js";
|
|
10
|
+
export const skillToolSpecs = [
|
|
11
|
+
{
|
|
12
|
+
name: "wyrm_skill_create",
|
|
13
|
+
description: "Author + deploy + register an ATOMIC skill in one clean step. Validates atomicity (one focused capability, discoverable 12–280 char description, proper frontmatter), writes <skillsDir>/<slug>/SKILL.md, and registers it so it's instantly findable via wyrm_skill_search. Refuses to clobber an existing skill unless force=true. Use this to create skills as they're needed instead of leaving them un-deployed.",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
name: { type: "string", description: "Skill name (slugified to kebab-case)" },
|
|
18
|
+
description: { type: "string", description: "One-line description, 12–280 chars — used for discovery/recall ranking" },
|
|
19
|
+
body: { type: "string", description: "The SKILL.md markdown body (the actual skill content; should be ONE focused capability)" },
|
|
20
|
+
argumentHint: { type: "string", description: "Optional argument-hint frontmatter (for user-invocable skills)" },
|
|
21
|
+
userInvocable: { type: "boolean", description: "Whether it's a user-invocable slash command" },
|
|
22
|
+
category: { type: "string", description: "Optional category" },
|
|
23
|
+
tags: { type: "array", items: { type: "string" }, description: "Optional tags" },
|
|
24
|
+
force: { type: "boolean", description: "Overwrite an existing skill of the same slug (default false)" },
|
|
25
|
+
register: { type: "boolean", description: "Register in the skill registry for discovery (default true)" },
|
|
26
|
+
},
|
|
27
|
+
required: ["name", "description", "body"],
|
|
28
|
+
},
|
|
29
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_create"],
|
|
30
|
+
aliases: [],
|
|
31
|
+
handler: async (args, ctx) => {
|
|
32
|
+
const { db } = ctx;
|
|
33
|
+
const a = args || {};
|
|
34
|
+
const requireArgs = (fields) => {
|
|
35
|
+
const missing = fields.filter(f => !a[f] && a[f] !== 0 && a[f] !== false);
|
|
36
|
+
if (missing.length > 0) {
|
|
37
|
+
return { content: [{ type: "text", text: `Missing required arguments: ${missing.join(', ')}` }], isError: true };
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
};
|
|
41
|
+
const argErr = requireArgs(['name', 'description', 'body']);
|
|
42
|
+
if (argErr)
|
|
43
|
+
return argErr;
|
|
44
|
+
const { name, description, body, argumentHint, userInvocable, category, tags, force, register } = args;
|
|
45
|
+
const spec = { name, description, body, argumentHint, userInvocable, category, tags };
|
|
46
|
+
const v = validateAtomicSkill(spec);
|
|
47
|
+
if (!v.ok) {
|
|
48
|
+
return { content: [{ type: "text", text: `❌ Skill rejected (not clean/atomic):\n- ${v.errors.join('\n- ')}` }] };
|
|
49
|
+
}
|
|
50
|
+
let deploy;
|
|
51
|
+
try {
|
|
52
|
+
deploy = deploySkill(spec, { force });
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
return { content: [{ type: "text", text: `❌ Deploy failed: ${e instanceof Error ? e.message : String(e)}` }] };
|
|
56
|
+
}
|
|
57
|
+
let registered = false;
|
|
58
|
+
if (register !== false) {
|
|
59
|
+
try {
|
|
60
|
+
db.registerSkill(v.slug, description, deploy.path, category, 'Ghost Protocol', '1.0.0', (tags || []).join(','));
|
|
61
|
+
registered = true;
|
|
62
|
+
}
|
|
63
|
+
catch { /* registry optional; file is deployed regardless */ }
|
|
64
|
+
}
|
|
65
|
+
const warn = v.warnings.length ? `\n\n⚠️ ${v.warnings.join('\n⚠️ ')}` : '';
|
|
66
|
+
return { content: [{ type: "text", text: ` Skill "${v.slug}" ${deploy.action}${registered ? ' + registered (discoverable via wyrm_skill_search)' : ''}\n ${deploy.path}${warn}` }] };
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "wyrm_skill_register",
|
|
71
|
+
description: "Register or update a skill and store metadata in Wyrm. Supports GOD-SKILL SPEC v2 apex tiers (god > mega > atomic) with governs/composes routing.",
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
name: { type: "string", description: "Skill name (e.g., 'professional-lead-scraping')" },
|
|
76
|
+
description: { type: "string", description: "Skill description" },
|
|
77
|
+
skillPath: { type: "string", description: "File path to skill (e.g., ~/.copilot/skills/name or project relative path)" },
|
|
78
|
+
category: { type: "string", description: "Skill category (e.g., 'data-extraction', 'testing', 'documentation')" },
|
|
79
|
+
author: { type: "string", description: "Skill author or creator" },
|
|
80
|
+
version: { type: "string", description: "Skill version" },
|
|
81
|
+
tags: { type: "string", description: "Comma-separated tags (e.g., 'scraping,leads,email-validation')" },
|
|
82
|
+
tier: { type: "string", enum: ["atomic", "mega", "god"], description: "GOD-SKILL SPEC v2 apex tier. Default 'atomic'. 'mega' composes atomics; 'god' governs megas." },
|
|
83
|
+
governs: { type: "array", items: { type: "string" }, description: "Skill names this node routes DOWN to (god→megas, mega→atomics). Default []." },
|
|
84
|
+
composes: { type: "array", items: { type: "string" }, description: "Skill names this node pulls in laterally. Default []." },
|
|
85
|
+
},
|
|
86
|
+
required: ["name", "description", "skillPath"],
|
|
87
|
+
},
|
|
88
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_register"],
|
|
89
|
+
aliases: [],
|
|
90
|
+
handler: async (args, ctx) => {
|
|
91
|
+
const { db } = ctx;
|
|
92
|
+
const { name, description, skillPath, category, author, version, tags, tier, governs, composes } = args;
|
|
93
|
+
const governance = (tier || governs || composes)
|
|
94
|
+
? { tier, governs, composes }
|
|
95
|
+
: undefined;
|
|
96
|
+
const skill = db.registerSkill(name, description, skillPath, category, author, version, tags, governance);
|
|
97
|
+
cache.invalidate('wyrm_skill_list');
|
|
98
|
+
cache.invalidate('wyrm_skill_stats');
|
|
99
|
+
const governsList = skill.governs ? JSON.parse(skill.governs) : [];
|
|
100
|
+
const composesList = skill.composes ? JSON.parse(skill.composes) : [];
|
|
101
|
+
let text = ` **Skill Registered**\n\nName: ${skill.name}\nPath: ${skill.skill_path}\nCategory: ${skill.category || 'uncategorized'}\nVersion: ${skill.version || '1.0.0'}\nTier: ${skill.tier}\nStatus: ${skill.is_active ? 'Active' : 'Inactive'}`;
|
|
102
|
+
if (governsList.length)
|
|
103
|
+
text += `\nGoverns: ${governsList.join(', ')}`;
|
|
104
|
+
if (composesList.length)
|
|
105
|
+
text += `\nComposes: ${composesList.join(', ')}`;
|
|
106
|
+
return { content: [{ type: "text", text }] };
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "wyrm_skill_list",
|
|
111
|
+
description: "List registered skills with filtering options",
|
|
112
|
+
inputSchema: {
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: {
|
|
115
|
+
active: { type: "boolean", description: "Filter by active status" },
|
|
116
|
+
category: { type: "string", description: "Filter by category" },
|
|
117
|
+
search: { type: "string", description: "Full-text search by name, description, or tags" },
|
|
118
|
+
tier: { type: "string", enum: ["atomic", "mega", "god"], description: "Filter by GOD-SKILL SPEC v2 tier (atomic|mega|god)" },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_list"],
|
|
122
|
+
aliases: [],
|
|
123
|
+
handler: async (args, ctx) => {
|
|
124
|
+
const { cachedResponse, db } = ctx;
|
|
125
|
+
const cacheKey = currentReadCacheKey();
|
|
126
|
+
const { active, category, search, tier } = args;
|
|
127
|
+
const skills = db.listSkills(active, category, search, tier);
|
|
128
|
+
if (skills.length === 0) {
|
|
129
|
+
return {
|
|
130
|
+
content: [{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: ` **Skills**\n\nNo skills found matching your criteria.`
|
|
133
|
+
}]
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
let text = ` **Skills Registry** (${skills.length} total)\n\n`;
|
|
137
|
+
for (const skill of skills) {
|
|
138
|
+
const tierBadge = skill.tier && skill.tier !== 'atomic' ? ` [${skill.tier.toUpperCase()}]` : '';
|
|
139
|
+
text += `### ${skill.name}${tierBadge} ${skill.is_active ? '✅' : '❌'}\n`;
|
|
140
|
+
text += `Category: ${skill.category || 'uncategorized'}\n`;
|
|
141
|
+
text += `Description: ${skill.description}\n`;
|
|
142
|
+
if (skill.version)
|
|
143
|
+
text += `Version: ${skill.version}\n`;
|
|
144
|
+
if (skill.author)
|
|
145
|
+
text += `Author: ${skill.author}\n`;
|
|
146
|
+
if (skill.tags)
|
|
147
|
+
text += `Tags: ${skill.tags}\n`;
|
|
148
|
+
text += `Path: \`${skill.skill_path}\`\n`;
|
|
149
|
+
text += `Used: ${skill.usage_count} times`;
|
|
150
|
+
if (skill.last_used)
|
|
151
|
+
text += ` (last: ${skill.last_used})`;
|
|
152
|
+
text += '\n\n';
|
|
153
|
+
}
|
|
154
|
+
const response = cachedResponse(text);
|
|
155
|
+
if (cacheKey)
|
|
156
|
+
cache.set(cacheKey, response, 30000);
|
|
157
|
+
return response;
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "wyrm_skill_get",
|
|
162
|
+
description: "Get detailed information about a specific skill",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
name: { type: "string", description: "Skill name" },
|
|
167
|
+
},
|
|
168
|
+
required: ["name"],
|
|
169
|
+
},
|
|
170
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_get"],
|
|
171
|
+
aliases: [],
|
|
172
|
+
handler: async (args, ctx) => {
|
|
173
|
+
const { cachedResponse, db } = ctx;
|
|
174
|
+
const cacheKey = currentReadCacheKey();
|
|
175
|
+
const { name } = args;
|
|
176
|
+
const skill = db.getSkill(name);
|
|
177
|
+
if (!skill) {
|
|
178
|
+
return {
|
|
179
|
+
content: [{
|
|
180
|
+
type: "text",
|
|
181
|
+
text: ` **Skill Not Found**: ${name}`
|
|
182
|
+
}]
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
let text = ` **Skill: ${skill.name}** ${skill.is_active ? '✅ Active' : '❌ Inactive'}\n\n`;
|
|
186
|
+
text += `**Description:** ${skill.description}\n`;
|
|
187
|
+
text += `**Path:** \`${skill.skill_path}\`\n`;
|
|
188
|
+
text += `**Category:** ${skill.category || 'uncategorized'}\n`;
|
|
189
|
+
if (skill.author)
|
|
190
|
+
text += `**Author:** ${skill.author}\n`;
|
|
191
|
+
if (skill.version)
|
|
192
|
+
text += `**Version:** ${skill.version}\n`;
|
|
193
|
+
if (skill.tags)
|
|
194
|
+
text += `**Tags:** ${skill.tags}\n`;
|
|
195
|
+
text += `**Usage Count:** ${skill.usage_count}\n`;
|
|
196
|
+
if (skill.last_used)
|
|
197
|
+
text += `**Last Used:** ${skill.last_used}\n`;
|
|
198
|
+
text += `**Created:** ${skill.created_at}\n`;
|
|
199
|
+
text += `**Updated:** ${skill.updated_at}\n`;
|
|
200
|
+
const response = cachedResponse(text);
|
|
201
|
+
if (cacheKey)
|
|
202
|
+
cache.set(cacheKey, response, 30000);
|
|
203
|
+
return response;
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "wyrm_skill_delete",
|
|
208
|
+
description: "Delete a skill from Wyrm registry",
|
|
209
|
+
inputSchema: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
name: { type: "string", description: "Skill name" },
|
|
213
|
+
},
|
|
214
|
+
required: ["name"],
|
|
215
|
+
},
|
|
216
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_delete"],
|
|
217
|
+
aliases: [],
|
|
218
|
+
handler: async (args, ctx) => {
|
|
219
|
+
const { db } = ctx;
|
|
220
|
+
const { name } = args;
|
|
221
|
+
const success = db.deleteSkill(name);
|
|
222
|
+
cache.invalidate('wyrm_skill_list');
|
|
223
|
+
cache.invalidate('wyrm_skill_stats');
|
|
224
|
+
if (success) {
|
|
225
|
+
return {
|
|
226
|
+
content: [{
|
|
227
|
+
type: "text",
|
|
228
|
+
text: ` **Skill Deleted**: ${name}`
|
|
229
|
+
}]
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return {
|
|
234
|
+
content: [{
|
|
235
|
+
type: "text",
|
|
236
|
+
text: ` **Skill Not Found**: ${name}`
|
|
237
|
+
}]
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "wyrm_skill_activate",
|
|
244
|
+
description: "Activate a skill (mark as active)",
|
|
245
|
+
inputSchema: {
|
|
246
|
+
type: "object",
|
|
247
|
+
properties: {
|
|
248
|
+
name: { type: "string", description: "Skill name" },
|
|
249
|
+
},
|
|
250
|
+
required: ["name"],
|
|
251
|
+
},
|
|
252
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_activate"],
|
|
253
|
+
aliases: [],
|
|
254
|
+
handler: async (args, ctx) => {
|
|
255
|
+
const { db } = ctx;
|
|
256
|
+
const { name } = args;
|
|
257
|
+
const skill = db.activateSkill(name);
|
|
258
|
+
cache.invalidate('wyrm_skill_list');
|
|
259
|
+
cache.invalidate('wyrm_skill_stats');
|
|
260
|
+
if (skill) {
|
|
261
|
+
return {
|
|
262
|
+
content: [{
|
|
263
|
+
type: "text",
|
|
264
|
+
text: ` **Skill Activated**: ${name}`
|
|
265
|
+
}]
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
return {
|
|
270
|
+
content: [{
|
|
271
|
+
type: "text",
|
|
272
|
+
text: ` **Skill Not Found**: ${name}`
|
|
273
|
+
}]
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "wyrm_skill_deactivate",
|
|
280
|
+
description: "Deactivate a skill (mark as inactive)",
|
|
281
|
+
inputSchema: {
|
|
282
|
+
type: "object",
|
|
283
|
+
properties: {
|
|
284
|
+
name: { type: "string", description: "Skill name" },
|
|
285
|
+
},
|
|
286
|
+
required: ["name"],
|
|
287
|
+
},
|
|
288
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_deactivate"],
|
|
289
|
+
aliases: [],
|
|
290
|
+
handler: async (args, ctx) => {
|
|
291
|
+
const { db } = ctx;
|
|
292
|
+
const { name } = args;
|
|
293
|
+
const skill = db.deactivateSkill(name);
|
|
294
|
+
cache.invalidate('wyrm_skill_list');
|
|
295
|
+
cache.invalidate('wyrm_skill_stats');
|
|
296
|
+
if (skill) {
|
|
297
|
+
return {
|
|
298
|
+
content: [{
|
|
299
|
+
type: "text",
|
|
300
|
+
text: ` **Skill Deactivated**: ${name}`
|
|
301
|
+
}]
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
return {
|
|
306
|
+
content: [{
|
|
307
|
+
type: "text",
|
|
308
|
+
text: ` **Skill Not Found**: ${name}`
|
|
309
|
+
}]
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "wyrm_skill_search",
|
|
316
|
+
description: "Search for skills by name, description, or tags. Optionally filter by GOD-SKILL SPEC v2 tier.",
|
|
317
|
+
inputSchema: {
|
|
318
|
+
type: "object",
|
|
319
|
+
properties: {
|
|
320
|
+
query: { type: "string", description: "Search query" },
|
|
321
|
+
limit: { type: "number", description: "Max results (default: 20)" },
|
|
322
|
+
tier: { type: "string", enum: ["atomic", "mega", "god"], description: "Restrict results to a GOD-SKILL SPEC v2 tier (atomic|mega|god)" },
|
|
323
|
+
},
|
|
324
|
+
required: ["query"],
|
|
325
|
+
},
|
|
326
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_search"],
|
|
327
|
+
aliases: [],
|
|
328
|
+
handler: async (args, ctx) => {
|
|
329
|
+
const { cachedResponse, db } = ctx;
|
|
330
|
+
const cacheKey = currentReadCacheKey();
|
|
331
|
+
const { query, limit, tier } = args;
|
|
332
|
+
const sanitizedQuery = sanitizeFtsQuery(query);
|
|
333
|
+
const skills = db.searchSkills(sanitizedQuery, limit || 20, tier);
|
|
334
|
+
if (skills.length === 0) {
|
|
335
|
+
return {
|
|
336
|
+
content: [{
|
|
337
|
+
type: "text",
|
|
338
|
+
text: ` **Search Skills**: No results found for "${query}"${tier ? ` (tier=${tier})` : ''}`
|
|
339
|
+
}]
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
let text = ` **Skill Search Results for "${query}"** (${skills.length} found)\n\n`;
|
|
343
|
+
for (const skill of skills) {
|
|
344
|
+
const tierBadge = skill.tier && skill.tier !== 'atomic' ? ` [${skill.tier.toUpperCase()}]` : '';
|
|
345
|
+
text += `- **${skill.name}**${tierBadge} (${skill.category || 'uncategorized'}) ${skill.is_active ? '✅' : '❌'}\n`;
|
|
346
|
+
text += ` ${skill.description}\n\n`;
|
|
347
|
+
}
|
|
348
|
+
const response = cachedResponse(text);
|
|
349
|
+
if (cacheKey)
|
|
350
|
+
cache.set(cacheKey, response, 30000);
|
|
351
|
+
return response;
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "wyrm_skill_stats",
|
|
356
|
+
description: "Get statistics on registered skills",
|
|
357
|
+
inputSchema: {
|
|
358
|
+
type: "object",
|
|
359
|
+
properties: {},
|
|
360
|
+
},
|
|
361
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_stats"],
|
|
362
|
+
aliases: [],
|
|
363
|
+
handler: async (args, ctx) => {
|
|
364
|
+
const { cachedResponse, db } = ctx;
|
|
365
|
+
const cacheKey = currentReadCacheKey();
|
|
366
|
+
const stats = db.getSkillStats();
|
|
367
|
+
let text = ` **Skill Statistics**\n\n`;
|
|
368
|
+
text += `**Total Skills:** ${stats.total}\n`;
|
|
369
|
+
text += `**Active Skills:** ${stats.active}\n`;
|
|
370
|
+
text += `**Inactive Skills:** ${stats.total - stats.active}\n\n`;
|
|
371
|
+
if (Object.keys(stats.byCategory).length > 0) {
|
|
372
|
+
text += `**By Category:**\n`;
|
|
373
|
+
for (const [category, count] of Object.entries(stats.byCategory)) {
|
|
374
|
+
text += `- ${category}: ${count}\n`;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const response = cachedResponse(text);
|
|
378
|
+
if (cacheKey)
|
|
379
|
+
cache.set(cacheKey, response, 30000);
|
|
380
|
+
return response;
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: "wyrm_skill_graph",
|
|
385
|
+
description: "Return the GOD-SKILL SPEC v2 governance graph: walks god → governs(mega) → governs(atomic) plus each node's composes, as a tree + edge-list the caller can render. Pass a root skill to scope to one apex; omit it to get the forest of every 'god' tier skill.",
|
|
386
|
+
inputSchema: {
|
|
387
|
+
type: "object",
|
|
388
|
+
properties: {
|
|
389
|
+
root: { type: "string", description: "Optional root skill name to scope the graph (e.g. 'ghost-godhead'). Omit for all god-tier apexes." },
|
|
390
|
+
format: { type: "string", enum: ["tree", "edges", "both"], description: "Output shape: 'tree' (nested), 'edges' (flat edge-list), or 'both' (default)." },
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
annotations: TOOL_ANNOTATIONS["wyrm_skill_graph"],
|
|
394
|
+
aliases: [],
|
|
395
|
+
handler: async (args, ctx) => {
|
|
396
|
+
const { db, graph } = ctx;
|
|
397
|
+
const { root, format } = args;
|
|
398
|
+
const fmt = format || 'both';
|
|
399
|
+
const forest = db.getSkillGraph(root);
|
|
400
|
+
if (forest.length === 0) {
|
|
401
|
+
const reason = root
|
|
402
|
+
? `Skill "${root}" is not registered (or has no graph).`
|
|
403
|
+
: `No god-tier skills registered. Register one with wyrm_skill_register tier='god' + governs=[...].`;
|
|
404
|
+
return { content: [{ type: "text", text: ` **Skill Graph**\n\n${reason}` }] };
|
|
405
|
+
}
|
|
406
|
+
const edges = [];
|
|
407
|
+
const walk = (n) => {
|
|
408
|
+
for (const g of n.governs) {
|
|
409
|
+
edges.push({ from: n.name, to: g, kind: 'governs', resolved: n.children.some((c) => c.name === g) });
|
|
410
|
+
}
|
|
411
|
+
for (const c of n.composes) {
|
|
412
|
+
edges.push({ from: n.name, to: c, kind: 'composes', resolved: false });
|
|
413
|
+
}
|
|
414
|
+
for (const child of n.children)
|
|
415
|
+
walk(child);
|
|
416
|
+
};
|
|
417
|
+
for (const r of forest)
|
|
418
|
+
walk(r);
|
|
419
|
+
// Human-readable tree render.
|
|
420
|
+
const tierIcon = (t) => (t === 'god' ? '👑' : t === 'mega' ? '◆' : '·');
|
|
421
|
+
const renderTree = (n, depth) => {
|
|
422
|
+
const indent = ' '.repeat(depth);
|
|
423
|
+
let out = `${indent}${tierIcon(n.tier)} ${n.name} (${n.tier})\n`;
|
|
424
|
+
if (n.composes.length)
|
|
425
|
+
out += `${indent} ~composes: ${n.composes.join(', ')}\n`;
|
|
426
|
+
if (n.missing && n.missing.length)
|
|
427
|
+
out += `${indent} ⚠ missing: ${n.missing.join(', ')}\n`;
|
|
428
|
+
for (const child of n.children)
|
|
429
|
+
out += renderTree(child, depth + 1);
|
|
430
|
+
return out;
|
|
431
|
+
};
|
|
432
|
+
let text = ` **Skill Governance Graph**${root ? ` (root: ${root})` : ' (all god apexes)'}\n\n`;
|
|
433
|
+
if (fmt === 'tree' || fmt === 'both') {
|
|
434
|
+
for (const r of forest)
|
|
435
|
+
text += renderTree(r, 0);
|
|
436
|
+
}
|
|
437
|
+
if (fmt === 'edges' || fmt === 'both') {
|
|
438
|
+
text += `\n**Edges (${edges.length}):**\n`;
|
|
439
|
+
for (const e of edges) {
|
|
440
|
+
text += `- ${e.from} —${e.kind}→ ${e.to}${e.kind === 'governs' && !e.resolved ? ' (unresolved)' : ''}\n`;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
// Machine-readable payload appended for programmatic callers.
|
|
444
|
+
text += `\n\`\`\`json\n${JSON.stringify({ tree: forest, edges }, null, 2)}\n\`\`\``;
|
|
445
|
+
return { content: [{ type: "text", text }] };
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
];
|
|
449
|
+
//# sourceMappingURL=skill.js.map
|