@cuylabs/agent-capability-pack 0.13.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/LICENSE +201 -0
- package/README.md +67 -0
- package/dist/bridge/index.d.ts +77 -0
- package/dist/bridge/index.js +7 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/chunk-2TICMDUA.js +25 -0
- package/dist/chunk-2TICMDUA.js.map +1 -0
- package/dist/chunk-5E66GFAI.js +290 -0
- package/dist/chunk-5E66GFAI.js.map +1 -0
- package/dist/chunk-IUGGMU63.js +220 -0
- package/dist/chunk-IUGGMU63.js.map +1 -0
- package/dist/chunk-LDYHPSNE.js +168 -0
- package/dist/chunk-LDYHPSNE.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/pack/index.d.ts +207 -0
- package/dist/pack/index.js +15 -0
- package/dist/pack/index.js.map +1 -0
- package/dist/sources/index.d.ts +20 -0
- package/dist/sources/index.js +19 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/types-BdapSdPT.d.ts +325 -0
- package/docs/README.md +17 -0
- package/docs/authoring.md +85 -0
- package/docs/mcp-bridge.md +49 -0
- package/docs/sources.md +52 -0
- package/package.json +83 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# MCP Skill Bridge
|
|
2
|
+
|
|
3
|
+
`MCPSkillBridge` makes MCP prompts visible through the skill system.
|
|
4
|
+
|
|
5
|
+
## Behavior
|
|
6
|
+
|
|
7
|
+
After `mcpManager.connect()`:
|
|
8
|
+
|
|
9
|
+
1. `listPrompts()` discovers prompts from connected servers.
|
|
10
|
+
2. Each prompt becomes a skill named `<server>:<prompt>`.
|
|
11
|
+
3. **Static prompts** (no required arguments) are rendered immediately with `getPrompt()` and cached as full L2 skill content.
|
|
12
|
+
4. **Parameterized prompts** (with arguments) get a metadata-backed skill body that lists supported arguments — usable without a live render.
|
|
13
|
+
|
|
14
|
+
This means:
|
|
15
|
+
|
|
16
|
+
- MCP prompts become visible in the skill summary (L1)
|
|
17
|
+
- the `skill` tool can load them without filesystem-backed `SKILL.md` files
|
|
18
|
+
- prompts with arguments still load meaningfully instead of failing outright
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { MCPSkillBridge } from "@cuylabs/agent-capability-pack";
|
|
24
|
+
|
|
25
|
+
await mcpManager.connect();
|
|
26
|
+
|
|
27
|
+
const bridge = new MCPSkillBridge(mcpManager, skillRegistry);
|
|
28
|
+
const result = await bridge.bridge();
|
|
29
|
+
|
|
30
|
+
// Number of prompts newly registered (or updated) as skills.
|
|
31
|
+
// Does not count prompts that were displaced by a higher-scope skill.
|
|
32
|
+
console.log(result.bridgedCount);
|
|
33
|
+
|
|
34
|
+
// Both hard failures AND non-fatal warnings (e.g. getPrompt() failed
|
|
35
|
+
// but a metadata fallback was used instead).
|
|
36
|
+
for (const e of result.errors) {
|
|
37
|
+
console.warn(`[${e.server}] ${e.error}`);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
See [examples/03-mcp-bridge.ts](../examples/03-mcp-bridge.ts) for a full runnable example.
|
|
42
|
+
|
|
43
|
+
## Important Boundary
|
|
44
|
+
|
|
45
|
+
The bridge is an adapter, not the source of truth for MCP itself.
|
|
46
|
+
|
|
47
|
+
- MCP remains owned by `@cuylabs/agent-core/mcp`
|
|
48
|
+
- the bridge only projects MCP prompts into the skill surface
|
|
49
|
+
- MCP tools/resources/prompts still exist natively through `MCPManager`
|
package/docs/sources.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Pack Sources
|
|
2
|
+
|
|
3
|
+
Every source resolves to the same `CapabilityPack` shape.
|
|
4
|
+
|
|
5
|
+
## Inline
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
inlinePack(myPack)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- no I/O
|
|
12
|
+
- best for application-owned packs
|
|
13
|
+
|
|
14
|
+
## Local
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
localPack("./packs/company-tools")
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- reads `pack.json`
|
|
21
|
+
- discovers `skills/`
|
|
22
|
+
- supports a local plugin entry via `pack.json -> plugin`
|
|
23
|
+
|
|
24
|
+
## npm
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
npmPack("@company/agent-pack")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- imports an installed package
|
|
31
|
+
- default export or named export may provide the pack
|
|
32
|
+
- best for reusable published packs
|
|
33
|
+
|
|
34
|
+
## URL
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
urlPack("https://example.com/packs/company-tools.json")
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- HTTPS only
|
|
41
|
+
- JSON only
|
|
42
|
+
- plugin code is blocked for security
|
|
43
|
+
|
|
44
|
+
## Git
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
gitPack("https://github.com/company/agent-pack.git", "main")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- clones into a local cache under `~/.cache/cuylabs/packs/git/`
|
|
51
|
+
- then resolves like a local pack
|
|
52
|
+
- supports `pack.json -> plugin` because it reuses the local resolver
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cuylabs/agent-capability-pack",
|
|
3
|
+
"version": "0.13.0",
|
|
4
|
+
"description": "Capability packs for @cuylabs/agent-core — distributable bundles of skills, MCP servers, and plugin contributions",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./pack": {
|
|
15
|
+
"types": "./dist/pack/index.d.ts",
|
|
16
|
+
"import": "./dist/pack/index.js",
|
|
17
|
+
"default": "./dist/pack/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./sources": {
|
|
20
|
+
"types": "./dist/sources/index.d.ts",
|
|
21
|
+
"import": "./dist/sources/index.js",
|
|
22
|
+
"default": "./dist/sources/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./bridge": {
|
|
25
|
+
"types": "./dist/bridge/index.d.ts",
|
|
26
|
+
"import": "./dist/bridge/index.js",
|
|
27
|
+
"default": "./dist/bridge/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"docs",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@cuylabs/agent-core": "^0.13.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@ai-sdk/openai": "^3.0.0",
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"dotenv": "^17.0.0",
|
|
42
|
+
"tsup": "^8.0.0",
|
|
43
|
+
"typescript": "^5.7.0",
|
|
44
|
+
"vitest": "^3.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@modelcontextprotocol/sdk": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"agent",
|
|
56
|
+
"ai",
|
|
57
|
+
"capability",
|
|
58
|
+
"pack",
|
|
59
|
+
"skills",
|
|
60
|
+
"mcp",
|
|
61
|
+
"plugin"
|
|
62
|
+
],
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/cuylabs-ai/agents-ts.git",
|
|
67
|
+
"directory": "packages/agent-capability-pack"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=20"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"access": "public"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "tsup --config tsup.config.ts",
|
|
77
|
+
"dev": "tsup --config tsup.config.ts --watch",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"test": "vitest run",
|
|
80
|
+
"test:watch": "vitest",
|
|
81
|
+
"clean": "rm -rf dist"
|
|
82
|
+
}
|
|
83
|
+
}
|