@x-otto/install 0.0.1-alpha.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 +78 -0
- package/dist/index.d.ts +2428 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @x-otto/install
|
|
2
|
+
|
|
3
|
+
> Universal installation engine for otto skills, plugins, and MCP servers.
|
|
4
|
+
|
|
5
|
+
`@x-otto/install` is the single entry point for adding any type of capability to an otto workspace — whether from a local archive, npm registry, git repository, or HTTP URL. It handles source resolution, content-type detection, atomic installation, post-install hooks, and version upgrades, with built-in security gates against archive bombs and path traversal attacks.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @x-otto/install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { InstallManager } from '@x-otto/install'
|
|
17
|
+
|
|
18
|
+
const manager = new InstallManager()
|
|
19
|
+
|
|
20
|
+
// Install a skill from a local .tgz archive
|
|
21
|
+
const result = await manager.install('./my-skill.tgz', {
|
|
22
|
+
workspaceDir: '/path/to/project',
|
|
23
|
+
onProgress: (p) => console.log(`[${p.phase}] ${p.message}`),
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
// Install a plugin from npm
|
|
27
|
+
const pluginResult = await manager.install('@scope/my-plugin', {
|
|
28
|
+
global: true,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
// Install an MCP server from a git repo tag
|
|
32
|
+
const mcpResult = await manager.install('https://github.com/user/mcp-server.git', {
|
|
33
|
+
ref: 'v1.2.0',
|
|
34
|
+
env: { API_KEY: 'xxx' },
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The `InstallManager` auto-detects the source type (file/url/git/npm) and content type (skill/plugin/mcp). Use `--as` to override auto-detection:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
// Force treat content as plugin even if auto-detect might guess skill
|
|
42
|
+
await manager.install('./dir', { as: 'plugin' })
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Key Exports
|
|
46
|
+
|
|
47
|
+
### Installation
|
|
48
|
+
- `InstallManager` — Top-level orchestrator with `install()` and `installSkill()` methods
|
|
49
|
+
- `InstallOptions` — Workspace, scope, force, dry-run, sub-path, ref, progress callbacks
|
|
50
|
+
- `InstallResult` — Success status, target path, definition/manifest, warnings, pending capabilities
|
|
51
|
+
|
|
52
|
+
### Uninstallation
|
|
53
|
+
- `uninstall()` — Remove skill/plugin/mcp by name
|
|
54
|
+
- `detectUninstallTarget()` — Determine installed type from name
|
|
55
|
+
- `listInstalledItems()` — Enumerate all installed items across scopes
|
|
56
|
+
|
|
57
|
+
### Upgrades
|
|
58
|
+
- `scanInstalledVersions()` — Collect version info from installed items
|
|
59
|
+
- `checkUpgrades()` — Check npm/git remote for newer versions
|
|
60
|
+
- `checkGitUpgrades()` — Git-specific `ls-remote` comparison
|
|
61
|
+
|
|
62
|
+
### Utilities
|
|
63
|
+
- `extractArchive()` / `createArchive()` — `.tar.gz`/`.tar`/`.zip` extraction and packaging
|
|
64
|
+
- `validateExtractedPaths()` / `checkArchiveBomb()` — Security validation (traversal, bomb, size)
|
|
65
|
+
- `sanitizeSourceUrl()` — Strip credentials from stored URLs
|
|
66
|
+
|
|
67
|
+
### Registry Discovery
|
|
68
|
+
- `RegistryClient` — Multi-source registry index fetch/cache/aggregation (RFC-201)
|
|
69
|
+
- `parseRegistry()` — Zod-validated registry JSON parsing with fail-soft per-entry handling
|
|
70
|
+
|
|
71
|
+
## Dependencies
|
|
72
|
+
|
|
73
|
+
- **Internal**: `@x-otto/mcp`, `@x-otto/plugin`, `@x-otto/skill`, `@x-otto/shared`
|
|
74
|
+
- **External**: `zod`, Node.js built-ins (fs, path, os, child_process)
|
|
75
|
+
|
|
76
|
+
## Related
|
|
77
|
+
|
|
78
|
+
- [Architecture](./ARCHITECTURE.md)
|