Files
open-design/apps/daemon/package.json
T
Cursor AgentandTom Huang b9d40094b5 feat(plugins): github tarball + https archive install sources
Plan §3.A6 / spec §7.2.

The installer gains a top-level dispatcher `installPlugin` that picks
the right backend off the source string:

  - ./folder, /abs/path  → installFromLocalFolder (existing behavior)
  - github:owner/repo[@ref][/subpath]
                          → fetch codeload tarball, extract via tar.x,
                            optionally chroot into a subpath, then re-use
                            the local backend for copy / persist
  - https://*.tar.gz, *.tgz
                          → same archive backend, recorded as source_kind=url

Hard guards inherited from spec §7.2:
  - Symbolic / hard link entries inside the archive abort the install with
    a clean error.
  - Path-traversal segments (..) abort.
  - Total extracted size is measured against maxBytes (50 MiB default) and
    rejected if exceeded.
  - Local-folder backend now preserves the recorded source / source_kind
    when called from the archive backend so installed_plugins records
    accurate provenance.

POST /api/plugins/install accepts the new shapes; the SSE event stream
shape is unchanged. The fetcher is pluggable so tests don't need network.

apps/daemon/package.json adds tar@^7 + @types/tar@^6.

Daemon tests: 1429 → 1434 (added plugins-installer-archive with 5 cases).

Co-authored-by: Tom Huang <1043269994@qq.com>
2026-05-09 11:26:54 +00:00

63 lines
1.7 KiB
JSON

{
"name": "@open-design/daemon",
"version": "0.5.0",
"private": true,
"type": "module",
"main": "./dist/cli.js",
"types": "./dist/cli.d.ts",
"bin": {
"od": "./dist/cli.js"
},
"exports": {
".": {
"types": "./dist/cli.d.ts",
"default": "./dist/cli.js"
},
"./package.json": "./package.json",
"./sidecar": {
"types": "./dist/sidecar/index.d.ts",
"default": "./dist/sidecar/index.js"
}
},
"files": [
"dist",
"package.json"
],
"scripts": {
"build": "tsc -p tsconfig.json",
"daemon": "pnpm run build && node dist/cli.js --no-open",
"dev": "pnpm run build && node dist/cli.js --no-open",
"start": "pnpm run build && node dist/cli.js",
"test": "vitest run -c vitest.config.ts",
"typecheck": "pnpm --filter @open-design/contracts build && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json --noEmit"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.0",
"@open-design/contracts": "workspace:*",
"@open-design/platform": "workspace:*",
"@open-design/plugin-runtime": "workspace:*",
"@open-design/sidecar": "workspace:*",
"@open-design/sidecar-proto": "workspace:*",
"better-sqlite3": "^12.9.0",
"blake3-wasm": "2.1.5",
"chokidar": "^5.0.0",
"express": "^4.19.2",
"jszip": "^3.10.1",
"multer": "^2.1.1",
"tar": "^7.5.13",
"undici": "^7.16.0"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.13",
"@types/express": "^4.17.21",
"@types/multer": "^2.1.0",
"@types/node": "^20.17.10",
"@types/tar": "^6.1.13",
"typescript": "^5.6.3",
"vitest": "^2.1.8"
},
"engines": {
"node": "~24"
}
}