@x-otto/install 0.1.0-alpha.43 → 0.3.0-beta.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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@x-otto/install",
3
- "version": "0.1.0-alpha.43",
3
+ "version": "0.3.0-beta.0",
4
+ "description": "安装服务:源解析(目录/归档)+ 原子落盘 + 来源元数据 + 响应式 installed 清单;激活由消费方经内核 keyed mount 承担",
4
5
  "files": [
5
- "dist",
6
- "README.md"
6
+ "dist"
7
7
  ],
8
8
  "type": "module",
9
9
  "main": "./dist/index.js",
@@ -15,25 +15,18 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "semver": "7.7.4",
19
- "@x-otto/mcp": "0.1.0-alpha.43",
20
- "@x-otto/env": "0.1.0-alpha.43",
21
- "@x-otto/plugin": "0.1.0-alpha.43",
22
- "@x-otto/shared": "0.1.0-alpha.43",
23
- "@x-otto/skill": "0.1.0-alpha.43"
18
+ "@x-otto/atomic-fs": "^0.3.0-beta.0",
19
+ "@x-otto/hooks": "^0.3.0-beta.0",
20
+ "@x-otto/i18n": "^0.3.0-beta.0",
21
+ "@x-otto/kernel": "^0.3.0-beta.0",
22
+ "@x-otto/runtime-layout": "^0.3.0-beta.0",
23
+ "@x-otto/settings": "^0.3.0-beta.0",
24
+ "@x-otto/shared": "^0.3.0-beta.0",
25
+ "@x-otto/universal": "^0.3.0-beta.0",
26
+ "minimatch": "^10.0.1"
24
27
  },
25
- "devDependencies": {
26
- "@types/semver": "7.7.1"
27
- },
28
- "private": false,
29
28
  "publishConfig": {
30
29
  "access": "public",
31
- "registry": "https://registry.npmjs.org",
32
- "tag": "alpha"
33
- },
34
- "scripts": {
35
- "build": "tsdown",
36
- "dev": "tsdown --watch",
37
- "typecheck": "tsc --noEmit"
30
+ "tag": "beta"
38
31
  }
39
- }
32
+ }
package/README.md DELETED
@@ -1,84 +0,0 @@
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 { install } from '@x-otto/install'
17
-
18
- // Install a skill from a local .tgz archive
19
- const result = await install('./my-skill.tgz', {
20
- workspaceDir: '/path/to/project',
21
- onProgress: (p) => console.log(`[${p.phase}] ${p.message}`),
22
- })
23
-
24
- // Install a plugin from npm
25
- const pluginResult = await install('@scope/my-plugin', {
26
- global: true,
27
- })
28
-
29
- // Install an MCP server from a git repo tag (MCP needs settings accessors)
30
- const mcpResult = await install(
31
- 'https://github.com/user/mcp-server.git',
32
- { ref: 'v1.2.0', env: { API_KEY: 'xxx' } },
33
- () => readMcpSettings(),
34
- (servers) => persistMcpSettings(servers),
35
- )
36
- ```
37
-
38
- `install()` 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 install('./dir', { as: 'plugin' })
43
- ```
44
-
45
- > **Note (endgame review 2026-08-14):** `install` is a pure function — it replaced the
46
- > stateless `InstallManager` class (which held no instance state, so `new InstallManager()`
47
- > was an empty shell). MCP settings access is injected via the optional `getMcpSettings` /
48
- > `persistMcpSettings` callbacks; single-install semantics stay in `options`.
49
-
50
- ## Key Exports
51
-
52
- ### Installation
53
- - `install()` — Top-level orchestrator (auto-detect source + content, dispatch to installer)
54
- - `installSkill()` — Convenience wrapper forcing `as: 'skill'`
55
- - `InstallOptions` — Workspace, scope, force, dry-run, sub-path, ref, progress callbacks
56
- - `InstallResult` — Success status, target path, definition/manifest, warnings, pending capabilities
57
-
58
- ### Uninstallation
59
- - `uninstall()` — Remove skill/plugin/mcp by name
60
- - `detectUninstallTarget()` — Determine installed type from name
61
- - `listInstalledItems()` — Enumerate all installed items across scopes
62
-
63
- ### Upgrades
64
- - `scanInstalledVersions()` — Collect version info from installed items
65
- - `checkUpgrades()` — Check npm/git remote for newer versions
66
- - `checkGitUpgrades()` — Git-specific `ls-remote` comparison
67
-
68
- ### Utilities
69
- - `extractArchive()` / `createArchive()` — `.tar.gz`/`.tar`/`.zip` extraction and packaging
70
- - `validateExtractedPaths()` / `checkArchiveBomb()` — Security validation (traversal, bomb, size)
71
- - `sanitizeSourceUrl()` — Strip credentials from stored URLs
72
-
73
- ### Registry Discovery
74
- - `RegistryClient` — Multi-source registry index fetch/cache/aggregation
75
- - `parseRegistry()` — Zod-validated registry JSON parsing with fail-soft per-entry handling
76
-
77
- ## Dependencies
78
-
79
- - **Internal**: `@x-otto/env`, `@x-otto/mcp`, `@x-otto/plugin`, `@x-otto/skill`, `@x-otto/shared`
80
- - **External**: `semver`, `zod`, Node.js built-ins (fs, path, os, child_process)
81
-
82
- ## Related
83
-
84
- - [Architecture](./ARCHITECTURE.md)