@musher-dev/musher-sdk 0.1.1
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 +21 -0
- package/README.md +102 -0
- package/dist/index.cjs +2135 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1141 -0
- package/dist/index.d.ts +1141 -0
- package/dist/index.js +2056 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Musher Dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# @musher-dev/musher-sdk
|
|
2
|
+
|
|
3
|
+
Official TypeScript SDK for the [Musher](https://musher.dev) platform. Pull, cache, and load bundled AI agent assets — skills, prompts, toolsets, and agent specs — from the Musher registry.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @musher-dev/musher-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Pull and access a bundle
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { pull } from "@musher-dev/musher-sdk";
|
|
17
|
+
|
|
18
|
+
const bundle = await pull("acme/code-review-kit:1.2.0");
|
|
19
|
+
|
|
20
|
+
// Typed handle access
|
|
21
|
+
bundle.prompt("system").content(); // prompt text
|
|
22
|
+
bundle.skill("lint-rules").files(); // skill files
|
|
23
|
+
bundle.toolset("review-tools").content(); // toolset definition
|
|
24
|
+
bundle.agentSpec("reviewer").content(); // agent spec
|
|
25
|
+
|
|
26
|
+
// Raw file access
|
|
27
|
+
bundle.file("prompts/system.md")?.text();
|
|
28
|
+
bundle.files(); // all FileHandle[]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Resolve metadata only
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { resolve } from "@musher-dev/musher-sdk";
|
|
35
|
+
|
|
36
|
+
const meta = await resolve("acme/code-review-kit:1.2.0");
|
|
37
|
+
console.log(meta.version, meta.ref);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Verify integrity and lock
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const result = bundle.verify(); // SHA-256 check on every file
|
|
44
|
+
await bundle.writeLockfile("./musher-lock.json");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Custom client configuration
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { MusherClient } from "@musher-dev/musher-sdk";
|
|
51
|
+
|
|
52
|
+
const client = new MusherClient({
|
|
53
|
+
cacheDir: "/tmp/musher-cache",
|
|
54
|
+
manifestTtlSeconds: 3600,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const bundle = await client.pull("acme/code-review-kit:1.2.0");
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Platform adapters
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import {
|
|
64
|
+
installClaudeSkills,
|
|
65
|
+
exportClaudePlugin,
|
|
66
|
+
exportOpenAILocalSkill,
|
|
67
|
+
exportOpenAIInlineSkill,
|
|
68
|
+
installVSCodeSkills,
|
|
69
|
+
} from "@musher-dev/musher-sdk";
|
|
70
|
+
|
|
71
|
+
// Claude Code — install skills into .claude/skills/<skill-name>/
|
|
72
|
+
await installClaudeSkills(bundle, process.cwd());
|
|
73
|
+
|
|
74
|
+
// OpenAI — export a skill for local shell agents
|
|
75
|
+
const local = await exportOpenAILocalSkill(bundle.skill("lint-rules"), "./skills");
|
|
76
|
+
|
|
77
|
+
// VS Code — install into .agents/skills/
|
|
78
|
+
await installVSCodeSkills(bundle, process.cwd());
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Key exports
|
|
82
|
+
|
|
83
|
+
| Export | Kind | Description |
|
|
84
|
+
|--------|------|-------------|
|
|
85
|
+
| `pull` | function | Pull a bundle (resolve + download + verify + cache) |
|
|
86
|
+
| `resolve` | function | Resolve bundle metadata without downloading |
|
|
87
|
+
| `configure` | function | Set default client config for convenience functions |
|
|
88
|
+
| `MusherClient` | class | Client with custom config, cache management |
|
|
89
|
+
| `Bundle` | class | Typed bundle with handle access and verification |
|
|
90
|
+
| `BundleRef` | class | Parse and represent `namespace/slug:version` refs |
|
|
91
|
+
| `Selection` | class | Lazy filtered view over a bundle |
|
|
92
|
+
| `FileHandle` | class | File content access (text, bytes, stream) |
|
|
93
|
+
| `SkillHandle` | class | Skill file grouping with definition access |
|
|
94
|
+
| `PromptHandle` | class | Single-file prompt with `.content()` |
|
|
95
|
+
| `ToolsetHandle` | class | Single-file toolset with `.content()` |
|
|
96
|
+
| `AgentSpecHandle` | class | Single-file agent spec with `.content()` |
|
|
97
|
+
|
|
98
|
+
See [`examples/`](../../examples/) for runnable integration examples.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|