pi2dsh 0.2.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 +21 -0
- package/README.md +122 -0
- package/README.zh.md +122 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.mjs +128 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/compat/pi-ai.d.mts +2597 -0
- package/dist/compat/pi-ai.d.mts.map +1 -0
- package/dist/compat/pi-ai.mjs +4669 -0
- package/dist/compat/pi-ai.mjs.map +1 -0
- package/dist/compat/pi-coding-agent.d.mts +745 -0
- package/dist/compat/pi-coding-agent.d.mts.map +1 -0
- package/dist/compat/pi-coding-agent.mjs +4 -0
- package/dist/compat/pi-tui.d.mts +3 -0
- package/dist/compat/pi-tui.mjs +3622 -0
- package/dist/compat/pi-tui.mjs.map +1 -0
- package/dist/host.d.mts +35 -0
- package/dist/host.d.mts.map +1 -0
- package/dist/host.mjs +197 -0
- package/dist/host.mjs.map +1 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/mcp-config-jL9w70It.mjs +1535 -0
- package/dist/mcp-config-jL9w70It.mjs.map +1 -0
- package/dist/pi-coding-agent-Dsg6_0ua.mjs +2060 -0
- package/dist/pi-coding-agent-Dsg6_0ua.mjs.map +1 -0
- package/dist/pi-config-shim-CZ1wFzqM.mjs +27 -0
- package/dist/pi-config-shim-CZ1wFzqM.mjs.map +1 -0
- package/dist/pi-tui-iHoF2tFc.d.mts +1043 -0
- package/dist/pi-tui-iHoF2tFc.d.mts.map +1 -0
- package/dist/pi-tui-utils-CcaVtm-3.mjs +895 -0
- package/dist/pi-tui-utils-CcaVtm-3.mjs.map +1 -0
- package/dist/pi-types-KazmR2O5.d.mts +62 -0
- package/dist/pi-types-KazmR2O5.d.mts.map +1 -0
- package/dist/pi-uuid-Db8ShZsK.mjs +47 -0
- package/dist/pi-uuid-Db8ShZsK.mjs.map +1 -0
- package/dist/rolldown-runtime-C2Q2p085.mjs +15 -0
- package/dist/runtime-D84Hv_3m.mjs +1499 -0
- package/dist/runtime-D84Hv_3m.mjs.map +1 -0
- package/dist/runtime.d.mts +31 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +3 -0
- package/dist/source-D7Ir-rPT.mjs +154 -0
- package/dist/source-D7Ir-rPT.mjs.map +1 -0
- package/dist/types-7IWJPPvS.d.mts +59 -0
- package/dist/types-7IWJPPvS.d.mts.map +1 -0
- package/package.json +135 -0
package/dist/host.d.mts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
import { a as GeneratedRuntimeManifest, s as ResolvedPiPackage } from "./types-7IWJPPvS.mjs";
|
|
3
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
//#region src/host.d.ts
|
|
5
|
+
type UnknownRecord = Record<string, unknown>;
|
|
6
|
+
interface PiHostPackageSpec {
|
|
7
|
+
/** npm package name as installed in the host bundle's node_modules. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Optional per-package config forwarded to the runtime. */
|
|
10
|
+
config?: UnknownRecord;
|
|
11
|
+
}
|
|
12
|
+
interface PiHostConfig {
|
|
13
|
+
packages: Array<string | PiHostPackageSpec>;
|
|
14
|
+
}
|
|
15
|
+
/** Build a runtime manifest in place over an installed Pi package directory. */
|
|
16
|
+
declare function manifestForInstalled(pkg: ResolvedPiPackage): Promise<GeneratedRuntimeManifest>;
|
|
17
|
+
/**
|
|
18
|
+
* Mount every configured Pi package from the host bundle's own node_modules.
|
|
19
|
+
* Packages that fail to mount report their error and do not take down the
|
|
20
|
+
* host or their siblings — matching Pi's own per-extension error isolation.
|
|
21
|
+
*/
|
|
22
|
+
declare function applyPiHost(ctx: Context, config: PiHostConfig, anchor?: string): Promise<void>;
|
|
23
|
+
interface HostBundleOptions {
|
|
24
|
+
outDir: string;
|
|
25
|
+
/** npm specs, e.g. "@narumitw/pi-lsp@0.49.4" or "pi-ask-user". */
|
|
26
|
+
packages: string[];
|
|
27
|
+
bundleName?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function generateHostBundle(options: HostBundleOptions): Promise<{
|
|
30
|
+
outDir: string;
|
|
31
|
+
packageName: string;
|
|
32
|
+
}>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { HostBundleOptions, PiHostConfig, PiHostPackageSpec, applyPiHost, generateHostBundle, manifestForInstalled };
|
|
35
|
+
//# sourceMappingURL=host.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.mts","names":[],"sources":["../src/host.ts"],"mappings":";;;;KAkBK,gBAAgB;UAEJ;;EAEf;;EAEA,SAAS;;UAGM;EACf,UAAU,eAAe;;;iBAuBL,qBAAqB,KAAK,oBAAoB,QAAQ;;;;;;iBAkDtD,YAAY,KAAK,SAAS,QAAQ,cAAc,kBAAkB;UAmCvE;EACf;;EAEA;EACA;;iBA+CoB,mBAAmB,SAAS,oBAAoB;EAAU;EAAgB"}
|
package/dist/host.mjs
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
|
|
2
|
+
import { t as applyPiPackage } from "./runtime-D84Hv_3m.mjs";
|
|
3
|
+
import { t as resolvePiPackage } from "./source-D7Ir-rPT.mjs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { cp, mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
6
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
|
+
//#region src/host.ts
|
|
9
|
+
function parseFrontmatter(text) {
|
|
10
|
+
const normalized = text.replace(/\r\n?/gu, "\n");
|
|
11
|
+
if (!normalized.startsWith("---")) return {
|
|
12
|
+
attributes: {},
|
|
13
|
+
body: normalized
|
|
14
|
+
};
|
|
15
|
+
const endIndex = normalized.indexOf("\n---", 3);
|
|
16
|
+
if (endIndex === -1) return {
|
|
17
|
+
attributes: {},
|
|
18
|
+
body: normalized
|
|
19
|
+
};
|
|
20
|
+
const attributes = {};
|
|
21
|
+
for (const line of normalized.slice(4, endIndex).split("\n")) {
|
|
22
|
+
const separator = line.indexOf(":");
|
|
23
|
+
if (separator === -1) continue;
|
|
24
|
+
const key = line.slice(0, separator).trim();
|
|
25
|
+
let value = line.slice(separator + 1).trim();
|
|
26
|
+
if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
|
|
27
|
+
if (key.length > 0) attributes[key] = value;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
attributes,
|
|
31
|
+
body: normalized.slice(endIndex + 4).trim()
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Build a runtime manifest in place over an installed Pi package directory. */
|
|
35
|
+
async function manifestForInstalled(pkg) {
|
|
36
|
+
const relativeTo = (file) => relative(pkg.rootDir, file).replaceAll("\\", "/");
|
|
37
|
+
const skillDirs = /* @__PURE__ */ new Set();
|
|
38
|
+
for (const file of pkg.resources.skills) skillDirs.add(relativeTo(basename(file) === "SKILL.md" ? dirname(dirname(file)) : dirname(file)));
|
|
39
|
+
const prompts = [];
|
|
40
|
+
const promptNames = /* @__PURE__ */ new Set();
|
|
41
|
+
for (const source of pkg.resources.prompts) {
|
|
42
|
+
const name = basename(source, ".md").toLowerCase().replace(/[^a-z0-9_-]+/gu, "-");
|
|
43
|
+
if (promptNames.has(name)) throw new Error(`prompt command name collision in ${pkg.identity.name}: ${name}`);
|
|
44
|
+
promptNames.add(name);
|
|
45
|
+
const { attributes, body } = parseFrontmatter(await readFile(source, "utf8"));
|
|
46
|
+
const firstLine = body.split(/\r?\n/u).map((line) => line.trim()).find(Boolean);
|
|
47
|
+
prompts.push({
|
|
48
|
+
name,
|
|
49
|
+
description: attributes.description ?? firstLine ?? `Run migrated Pi prompt ${name}`,
|
|
50
|
+
...attributes["argument-hint"] !== void 0 ? { argumentHint: attributes["argument-hint"] } : {},
|
|
51
|
+
path: relativeTo(source)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
schemaVersion: 1,
|
|
56
|
+
package: pkg.identity,
|
|
57
|
+
extensions: pkg.resources.extensions.map(relativeTo),
|
|
58
|
+
skillDirs: [...skillDirs].sort(),
|
|
59
|
+
prompts
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function normalizeSpecs(config) {
|
|
63
|
+
return (Array.isArray(config?.packages) ? config.packages : []).map((spec) => typeof spec === "string" ? { name: spec } : spec).filter((spec) => typeof spec?.name === "string" && spec.name.length > 0);
|
|
64
|
+
}
|
|
65
|
+
function resolveInstalledDir(anchor, packageName) {
|
|
66
|
+
const require = createRequire(anchor);
|
|
67
|
+
return dirname(require.resolve(`${packageName}/package.json`));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Mount every configured Pi package from the host bundle's own node_modules.
|
|
71
|
+
* Packages that fail to mount report their error and do not take down the
|
|
72
|
+
* host or their siblings — matching Pi's own per-extension error isolation.
|
|
73
|
+
*/
|
|
74
|
+
async function applyPiHost(ctx, config, anchor) {
|
|
75
|
+
const anchorPath = anchor ?? fileURLToPath(import.meta.url);
|
|
76
|
+
const errors = [];
|
|
77
|
+
for (const spec of normalizeSpecs(config)) try {
|
|
78
|
+
const dir = resolveInstalledDir(anchorPath, spec.name);
|
|
79
|
+
const pkg = await resolvePiPackage(dir);
|
|
80
|
+
try {
|
|
81
|
+
const manifest = await manifestForInstalled(pkg);
|
|
82
|
+
await applyPiPackage(ctx, {
|
|
83
|
+
rootUrl: pathToFileURL(`${pkg.rootDir}/`),
|
|
84
|
+
manifest,
|
|
85
|
+
...spec.config === void 0 ? {} : { config: spec.config }
|
|
86
|
+
});
|
|
87
|
+
} finally {
|
|
88
|
+
await pkg.dispose();
|
|
89
|
+
}
|
|
90
|
+
} catch (error) {
|
|
91
|
+
errors.push({
|
|
92
|
+
name: spec.name,
|
|
93
|
+
error: error instanceof Error ? error.message : String(error)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
for (const failure of errors) {
|
|
97
|
+
const log = ctx.logger;
|
|
98
|
+
(log?.warn?.bind(log) ?? console.warn)(`[pi2dsh host] failed to mount ${failure.name}: ${failure.error}`);
|
|
99
|
+
}
|
|
100
|
+
if (errors.length > 0 && errors.length === normalizeSpecs(config).length) throw new Error(`pi2dsh host mounted no packages; first failure: ${errors[0].name}: ${errors[0].error}`);
|
|
101
|
+
}
|
|
102
|
+
function splitSpec(spec) {
|
|
103
|
+
const at = spec.lastIndexOf("@");
|
|
104
|
+
if (at > 0) return {
|
|
105
|
+
name: spec.slice(0, at),
|
|
106
|
+
range: spec.slice(at + 1)
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
name: spec,
|
|
110
|
+
range: "*"
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
async function firstExisting(paths) {
|
|
114
|
+
for (const path of paths) try {
|
|
115
|
+
await stat(path);
|
|
116
|
+
return path;
|
|
117
|
+
} catch {}
|
|
118
|
+
throw new Error(`cannot locate pi2dsh runtime artifact; tried: ${paths.join(", ")}`);
|
|
119
|
+
}
|
|
120
|
+
async function copyEmbeddedHostRuntime(outDir) {
|
|
121
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
122
|
+
const hostSource = await firstExisting([join(moduleDir, "host.mjs"), join(moduleDir, "../dist/host.mjs")]);
|
|
123
|
+
const distRoot = dirname(hostSource);
|
|
124
|
+
const targetRoot = join(outDir, "runtime");
|
|
125
|
+
await mkdir(join(targetRoot, "compat", "vendor"), { recursive: true });
|
|
126
|
+
for (const entry of await readdir(distRoot)) if (entry.endsWith(".mjs") || entry.endsWith(".d.mts")) await cp(join(distRoot, entry), join(targetRoot, entry));
|
|
127
|
+
for (const sub of ["compat", join("compat", "vendor")]) {
|
|
128
|
+
const dir = join(distRoot, sub);
|
|
129
|
+
try {
|
|
130
|
+
for (const entry of await readdir(dir)) if (entry.endsWith(".mjs")) await cp(join(dir, entry), join(targetRoot, sub, entry));
|
|
131
|
+
} catch {}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function generateHostBundle(options) {
|
|
135
|
+
const specs = options.packages.map(splitSpec);
|
|
136
|
+
if (specs.length === 0) throw new Error("host bundle requires at least one Pi package spec");
|
|
137
|
+
const packageName = options.bundleName ?? "dsh-pi-host";
|
|
138
|
+
await mkdir(options.outDir, { recursive: true });
|
|
139
|
+
await copyEmbeddedHostRuntime(options.outDir);
|
|
140
|
+
const packageJson = {
|
|
141
|
+
name: packageName,
|
|
142
|
+
version: "0.1.0",
|
|
143
|
+
description: `pi2dsh host bundle mounting ${specs.map((spec) => spec.name).join(", ")} as native DSH plugins`,
|
|
144
|
+
type: "module",
|
|
145
|
+
main: "./index.js",
|
|
146
|
+
files: [
|
|
147
|
+
"index.js",
|
|
148
|
+
"cordis.patch.yml",
|
|
149
|
+
"runtime",
|
|
150
|
+
"PI2DSH-LICENSE",
|
|
151
|
+
"README.md"
|
|
152
|
+
],
|
|
153
|
+
dependencies: {
|
|
154
|
+
...Object.fromEntries(specs.map((spec) => [spec.name, spec.range])),
|
|
155
|
+
jiti: "^2.7.0",
|
|
156
|
+
"get-east-asian-width": "^1.6.0",
|
|
157
|
+
marked: "^16.4.1",
|
|
158
|
+
typebox: "^1.0.4",
|
|
159
|
+
tinyglobby: "^0.2.15",
|
|
160
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.1.0-rc.6"
|
|
161
|
+
},
|
|
162
|
+
peerDependencies: {
|
|
163
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
164
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6"
|
|
165
|
+
},
|
|
166
|
+
keywords: [
|
|
167
|
+
"dsh-plugin",
|
|
168
|
+
"deepseek-harness",
|
|
169
|
+
"pi-package",
|
|
170
|
+
"pi2dsh",
|
|
171
|
+
"pi-host"
|
|
172
|
+
],
|
|
173
|
+
license: "MIT",
|
|
174
|
+
dsh: { bundle: { patch: "./cordis.patch.yml" } }
|
|
175
|
+
};
|
|
176
|
+
await writeFile(join(options.outDir, "package.json"), `${JSON.stringify(packageJson, null, 2)}\n`);
|
|
177
|
+
const hostConfig = { packages: specs.map((spec) => spec.name) };
|
|
178
|
+
const indexSource = `import { applyPiHost } from './runtime/host.mjs'\n\nexport const name = ${JSON.stringify(packageName)}\nexport const inject = ${JSON.stringify([
|
|
179
|
+
"tools",
|
|
180
|
+
"systemPrompt",
|
|
181
|
+
"commands",
|
|
182
|
+
"skills"
|
|
183
|
+
])}\n\nconst hostConfig = ${JSON.stringify(hostConfig, null, 2)}\n\nexport async function apply(ctx, config = {}) {\n await applyPiHost(ctx, { ...hostConfig, ...config }, new URL(import.meta.url).pathname)\n}\n`;
|
|
184
|
+
await writeFile(join(options.outDir, "index.js"), indexSource);
|
|
185
|
+
await writeFile(join(options.outDir, "cordis.patch.yml"), `- insert:\n - id: ${packageName}\n name: ${JSON.stringify(packageName)}\n`);
|
|
186
|
+
const licenseSource = await firstExisting([join(dirname(fileURLToPath(import.meta.url)), "compat/vendor/PI-LICENSE"), join(dirname(fileURLToPath(import.meta.url)), "../src/compat/vendor/PI-LICENSE")]);
|
|
187
|
+
await cp(licenseSource, join(options.outDir, "PI2DSH-LICENSE"));
|
|
188
|
+
await writeFile(join(options.outDir, "README.md"), `# ${packageName}\n\nA [pi2dsh](https://github.com/weijiafu14/pi2dsh) host bundle. The Pi packages below are installed as ordinary npm dependencies and mounted at load time — no per-package conversion, no vendored source snapshots.\n\n` + specs.map((spec) => `- \`${spec.name}@${spec.range}\`\n`).join("") + "\nInstall:\n\n```sh\ndsh plugin --profile headless add file:$PWD\ndsh --profile headless --dump-config\n```\n\nThe packages execute their original Pi extension source inside the pi2dsh Host ABI; install only sources you trust. Run `pi2dsh inspect <package>` for each package's compatibility report.\n");
|
|
189
|
+
return {
|
|
190
|
+
outDir: options.outDir,
|
|
191
|
+
packageName
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
export { applyPiHost, generateHostBundle, manifestForInstalled };
|
|
196
|
+
|
|
197
|
+
//# sourceMappingURL=host.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.mjs","names":[],"sources":["../src/host.ts"],"sourcesContent":["// PiHostOnDSH: one DSH plugin that hosts unmodified Pi packages.\n//\n// Instead of converting each package into a vendored bundle, the host bundle\n// declares Pi packages as ordinary npm dependencies; DSH's plugin manager\n// (pnpm) installs them, and at load time this module resolves each installed\n// package, discovers its Pi entry points, and mounts it through the same\n// package-agnostic runtime as converted bundles. One host, any package —\n// there is deliberately no per-package branching here.\n\nimport { readdir, readFile, stat, writeFile, mkdir, cp } from 'node:fs/promises'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join, relative } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { applyPiPackage } from './runtime.js'\nimport { resolvePiPackage } from './source.js'\nimport type { GeneratedRuntimeManifest, ResolvedPiPackage } from './types.js'\n\ntype UnknownRecord = Record<string, unknown>\n\nexport interface PiHostPackageSpec {\n /** npm package name as installed in the host bundle's node_modules. */\n name: string\n /** Optional per-package config forwarded to the runtime. */\n config?: UnknownRecord\n}\n\nexport interface PiHostConfig {\n packages: Array<string | PiHostPackageSpec>\n}\n\nfunction parseFrontmatter(text: string): { attributes: Record<string, string>; body: string } {\n const normalized = text.replace(/\\r\\n?/gu, '\\n')\n if (!normalized.startsWith('---')) return { attributes: {}, body: normalized }\n const endIndex = normalized.indexOf('\\n---', 3)\n if (endIndex === -1) return { attributes: {}, body: normalized }\n const attributes: Record<string, string> = {}\n for (const line of normalized.slice(4, endIndex).split('\\n')) {\n const separator = line.indexOf(':')\n if (separator === -1) continue\n const key = line.slice(0, separator).trim()\n let value = line.slice(separator + 1).trim()\n if ((value.startsWith('\"') && value.endsWith('\"')) || (value.startsWith(\"'\") && value.endsWith(\"'\"))) {\n value = value.slice(1, -1)\n }\n if (key.length > 0) attributes[key] = value\n }\n return { attributes, body: normalized.slice(endIndex + 4).trim() }\n}\n\n/** Build a runtime manifest in place over an installed Pi package directory. */\nexport async function manifestForInstalled(pkg: ResolvedPiPackage): Promise<GeneratedRuntimeManifest> {\n const relativeTo = (file: string): string => relative(pkg.rootDir, file).replaceAll('\\\\', '/')\n\n const skillDirs = new Set<string>()\n for (const file of pkg.resources.skills) {\n // <dir>/<name>/SKILL.md contributes <dir>; a flat <dir>/<name>.md contributes <dir>.\n skillDirs.add(relativeTo(basename(file) === 'SKILL.md' ? dirname(dirname(file)) : dirname(file)))\n }\n\n const prompts: GeneratedRuntimeManifest['prompts'] = []\n const promptNames = new Set<string>()\n for (const source of pkg.resources.prompts) {\n const name = basename(source, '.md').toLowerCase().replace(/[^a-z0-9_-]+/gu, '-')\n if (promptNames.has(name)) throw new Error(`prompt command name collision in ${pkg.identity.name}: ${name}`)\n promptNames.add(name)\n const { attributes, body } = parseFrontmatter(await readFile(source, 'utf8'))\n const firstLine = body.split(/\\r?\\n/u).map(line => line.trim()).find(Boolean)\n prompts.push({\n name,\n description: attributes.description ?? firstLine ?? `Run migrated Pi prompt ${name}`,\n ...(attributes['argument-hint'] !== undefined ? { argumentHint: attributes['argument-hint'] } : {}),\n path: relativeTo(source),\n })\n }\n\n return {\n schemaVersion: 1,\n package: pkg.identity,\n extensions: pkg.resources.extensions.map(relativeTo),\n skillDirs: [...skillDirs].sort(),\n prompts,\n }\n}\n\nfunction normalizeSpecs(config: PiHostConfig): PiHostPackageSpec[] {\n const packages = Array.isArray(config?.packages) ? config.packages : []\n return packages.map(spec => (typeof spec === 'string' ? { name: spec } : spec))\n .filter(spec => typeof spec?.name === 'string' && spec.name.length > 0)\n}\n\nfunction resolveInstalledDir(anchor: string, packageName: string): string {\n const require = createRequire(anchor)\n return dirname(require.resolve(`${packageName}/package.json`))\n}\n\n/**\n * Mount every configured Pi package from the host bundle's own node_modules.\n * Packages that fail to mount report their error and do not take down the\n * host or their siblings — matching Pi's own per-extension error isolation.\n */\nexport async function applyPiHost(ctx: Context, config: PiHostConfig, anchor?: string): Promise<void> {\n const anchorPath = anchor ?? fileURLToPath(import.meta.url)\n const errors: Array<{ name: string; error: string }> = []\n for (const spec of normalizeSpecs(config)) {\n try {\n const dir = resolveInstalledDir(anchorPath, spec.name)\n const pkg = await resolvePiPackage(dir)\n try {\n const manifest = await manifestForInstalled(pkg)\n await applyPiPackage(ctx, {\n rootUrl: pathToFileURL(`${pkg.rootDir}/`),\n manifest,\n ...(spec.config === undefined ? {} : { config: spec.config }),\n })\n } finally {\n await pkg.dispose()\n }\n } catch (error) {\n errors.push({ name: spec.name, error: error instanceof Error ? error.message : String(error) })\n }\n }\n for (const failure of errors) {\n const log = (ctx as unknown as { logger?: { warn?(message: string): void } }).logger\n const warn = log?.warn?.bind(log) ?? console.warn\n warn(`[pi2dsh host] failed to mount ${failure.name}: ${failure.error}`)\n }\n if (errors.length > 0 && errors.length === normalizeSpecs(config).length) {\n throw new Error(`pi2dsh host mounted no packages; first failure: ${errors[0]!.name}: ${errors[0]!.error}`)\n }\n}\n\n// ---------------------------------------------------------------------------\n// Host bundle generation\n// ---------------------------------------------------------------------------\n\nexport interface HostBundleOptions {\n outDir: string\n /** npm specs, e.g. \"@narumitw/pi-lsp@0.49.4\" or \"pi-ask-user\". */\n packages: string[]\n bundleName?: string\n}\n\nfunction splitSpec(spec: string): { name: string; range: string } {\n const at = spec.lastIndexOf('@')\n if (at > 0) return { name: spec.slice(0, at), range: spec.slice(at + 1) }\n return { name: spec, range: '*' }\n}\n\nasync function firstExisting(paths: string[]): Promise<string> {\n for (const path of paths) {\n try {\n await stat(path)\n return path\n } catch {\n // Try the next layout.\n }\n }\n throw new Error(`cannot locate pi2dsh runtime artifact; tried: ${paths.join(', ')}`)\n}\n\nasync function copyEmbeddedHostRuntime(outDir: string): Promise<void> {\n const moduleDir = dirname(fileURLToPath(import.meta.url))\n const hostSource = await firstExisting([\n join(moduleDir, 'host.mjs'),\n join(moduleDir, '../dist/host.mjs'),\n ])\n const distRoot = dirname(hostSource)\n const targetRoot = join(outDir, 'runtime')\n await mkdir(join(targetRoot, 'compat', 'vendor'), { recursive: true })\n for (const entry of await readdir(distRoot)) {\n if (entry.endsWith('.mjs') || entry.endsWith('.d.mts')) {\n await cp(join(distRoot, entry), join(targetRoot, entry))\n }\n }\n for (const sub of ['compat', join('compat', 'vendor')]) {\n const dir = join(distRoot, sub)\n try {\n for (const entry of await readdir(dir)) {\n if (entry.endsWith('.mjs')) await cp(join(dir, entry), join(targetRoot, sub, entry))\n }\n } catch {\n // dist layout without that subdirectory\n }\n }\n}\n\nexport async function generateHostBundle(options: HostBundleOptions): Promise<{ outDir: string; packageName: string }> {\n const specs = options.packages.map(splitSpec)\n if (specs.length === 0) throw new Error('host bundle requires at least one Pi package spec')\n const packageName = options.bundleName ?? 'dsh-pi-host'\n await mkdir(options.outDir, { recursive: true })\n await copyEmbeddedHostRuntime(options.outDir)\n\n const packageJson = {\n name: packageName,\n version: '0.1.0',\n description: `pi2dsh host bundle mounting ${specs.map(spec => spec.name).join(', ')} as native DSH plugins`,\n type: 'module',\n main: './index.js',\n files: ['index.js', 'cordis.patch.yml', 'runtime', 'PI2DSH-LICENSE', 'README.md'],\n dependencies: {\n ...Object.fromEntries(specs.map(spec => [spec.name, spec.range])),\n jiti: '^2.7.0',\n 'get-east-asian-width': '^1.6.0',\n marked: '^16.4.1',\n typebox: '^1.0.4',\n tinyglobby: '^0.2.15',\n '@deepseek-ai/dsh-skill-filesystem': '^0.1.0-rc.6',\n },\n peerDependencies: {\n '@deepseek-ai/dsh-llm': '^0.1.0-rc.6',\n '@deepseek-ai/dsh-system-prompt': '^0.1.0-rc.6',\n },\n keywords: ['dsh-plugin', 'deepseek-harness', 'pi-package', 'pi2dsh', 'pi-host'],\n license: 'MIT',\n dsh: { bundle: { patch: './cordis.patch.yml' } },\n }\n await writeFile(join(options.outDir, 'package.json'), `${JSON.stringify(packageJson, null, 2)}\\n`)\n\n const hostConfig: PiHostConfig = { packages: specs.map(spec => spec.name) }\n const indexSource = `import { applyPiHost } from './runtime/host.mjs'\\n\\n`\n + `export const name = ${JSON.stringify(packageName)}\\n`\n + `export const inject = ${JSON.stringify(['tools', 'systemPrompt', 'commands', 'skills'])}\\n\\n`\n + `const hostConfig = ${JSON.stringify(hostConfig, null, 2)}\\n\\n`\n + `export async function apply(ctx, config = {}) {\\n`\n + ` await applyPiHost(ctx, { ...hostConfig, ...config }, new URL(import.meta.url).pathname)\\n`\n + `}\\n`\n await writeFile(join(options.outDir, 'index.js'), indexSource)\n\n await writeFile(join(options.outDir, 'cordis.patch.yml'),\n `- insert:\\n - id: ${packageName}\\n name: ${JSON.stringify(packageName)}\\n`)\n\n const licenseSource = await firstExisting([\n join(dirname(fileURLToPath(import.meta.url)), 'compat/vendor/PI-LICENSE'),\n join(dirname(fileURLToPath(import.meta.url)), '../src/compat/vendor/PI-LICENSE'),\n ])\n await cp(licenseSource, join(options.outDir, 'PI2DSH-LICENSE'))\n\n await writeFile(join(options.outDir, 'README.md'),\n `# ${packageName}\\n\\n`\n + `A [pi2dsh](https://github.com/weijiafu14/pi2dsh) host bundle. The Pi packages below are installed as ordinary npm dependencies and mounted at load time — no per-package conversion, no vendored source snapshots.\\n\\n`\n + specs.map(spec => `- \\`${spec.name}@${spec.range}\\`\\n`).join('')\n + `\\nInstall:\\n\\n\\`\\`\\`sh\\ndsh plugin --profile headless add file:$PWD\\ndsh --profile headless --dump-config\\n\\`\\`\\`\\n`\n + `\\nThe packages execute their original Pi extension source inside the pi2dsh Host ABI; install only sources you trust. Run \\`pi2dsh inspect <package>\\` for each package's compatibility report.\\n`)\n\n return { outDir: options.outDir, packageName }\n}\n"],"mappings":";;;;;;;;AA+BA,SAAS,iBAAiB,MAAoE;CAC5F,MAAM,aAAa,KAAK,QAAQ,WAAW,IAAI;CAC/C,IAAI,CAAC,WAAW,WAAW,KAAK,GAAG,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, o as PackageIdentity, r as CompatibilityReport, s as ResolvedPiPackage, t as CompatibilityFinding } from "./types-7IWJPPvS.mjs";
|
|
3
|
+
import { applyPiHost, generateHostBundle, manifestForInstalled } from "./host.mjs";
|
|
4
|
+
//#region src/analyzer.d.ts
|
|
5
|
+
declare function analyzePackage(pkg: ResolvedPiPackage): Promise<CompatibilityReport>;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/compatibility.d.ts
|
|
8
|
+
interface Rule {
|
|
9
|
+
level: CompatibilityLevel;
|
|
10
|
+
detail: string;
|
|
11
|
+
}
|
|
12
|
+
declare const PI_CODING_AGENT_PACKAGES: readonly ["@earendil-works/pi-coding-agent", "@mariozechner/pi-coding-agent"];
|
|
13
|
+
declare const PI_TUI_PACKAGES: readonly ["@earendil-works/pi-tui", "@mariozechner/pi-tui"];
|
|
14
|
+
declare const PI_AI_PACKAGES: readonly ["@earendil-works/pi-ai", "@mariozechner/pi-ai"];
|
|
15
|
+
declare const HOST_IMPORT_RULES: Readonly<Record<string, Readonly<Record<string, Rule>>>>;
|
|
16
|
+
declare const CONTEXT_RULES: Readonly<Record<string, Rule>>;
|
|
17
|
+
declare const UI_CONTEXT_RULES: Readonly<Record<string, Rule>>;
|
|
18
|
+
declare const API_RULES: Readonly<Record<string, Rule>>;
|
|
19
|
+
declare const EVENT_RULES: Readonly<Record<string, Rule>>;
|
|
20
|
+
declare function ruleForApi(method: string): Rule | undefined;
|
|
21
|
+
declare function ruleForEvent(event: string): Rule;
|
|
22
|
+
declare function ruleForHostImport(packageName: string, importedName: string): Rule | undefined;
|
|
23
|
+
declare function ruleForContextProperty(property: string): Rule | undefined;
|
|
24
|
+
declare function ruleForUiContextProperty(property: string): Rule | undefined;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/generator.d.ts
|
|
27
|
+
declare function generateBundle(pkg: ResolvedPiPackage, options: GenerateOptions): Promise<{
|
|
28
|
+
outDir: string;
|
|
29
|
+
report: CompatibilityReport;
|
|
30
|
+
packageName: string;
|
|
31
|
+
}>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/mcp-config.d.ts
|
|
34
|
+
type UnknownRecord = Record<string, unknown>;
|
|
35
|
+
interface PiMcpServer {
|
|
36
|
+
name: string;
|
|
37
|
+
sourcePath: string;
|
|
38
|
+
transport: 'stdio' | 'streamable-http';
|
|
39
|
+
command?: string;
|
|
40
|
+
args?: string[];
|
|
41
|
+
env?: Record<string, string>;
|
|
42
|
+
cwd?: string;
|
|
43
|
+
url?: string;
|
|
44
|
+
headers?: Record<string, string>;
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface McpConversionWarning {
|
|
48
|
+
server: string;
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
interface McpConversionResult {
|
|
52
|
+
servers: PiMcpServer[];
|
|
53
|
+
entries: UnknownRecord[];
|
|
54
|
+
warnings: McpConversionWarning[];
|
|
55
|
+
sources: string[];
|
|
56
|
+
}
|
|
57
|
+
declare function collectPiMcpServers(cwd: string, extraPaths?: string[]): {
|
|
58
|
+
servers: Map<string, PiMcpServer>;
|
|
59
|
+
sources: string[];
|
|
60
|
+
};
|
|
61
|
+
declare function convertPiMcpConfig(cwd: string, extraPaths?: string[]): McpConversionResult;
|
|
62
|
+
/** Render the converted entries as a cordis.patch.yml `insert` block. */
|
|
63
|
+
declare function renderMcpPatch(result: McpConversionResult): string;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/source.d.ts
|
|
66
|
+
declare function resolvePiPackage(source: string, cwd?: string): Promise<ResolvedPiPackage>;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { API_RULES, CONTEXT_RULES, type CompatibilityFinding, type CompatibilityLevel, type CompatibilityReport, EVENT_RULES, type GenerateOptions, type GeneratedRuntimeManifest, HOST_IMPORT_RULES, PI_AI_PACKAGES, PI_CODING_AGENT_PACKAGES, PI_TUI_PACKAGES, type PackageIdentity, type ResolvedPiPackage, type ResourceInventory, UI_CONTEXT_RULES, analyzePackage, applyPiHost, collectPiMcpServers, convertPiMcpConfig, generateBundle, generateHostBundle, manifestForInstalled, renderMcpPatch, resolvePiPackage, ruleForApi, ruleForContextProperty, ruleForEvent, ruleForHostImport, ruleForUiContextProperty };
|
|
69
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/analyzer.ts","../src/compatibility.ts","../src/generator.ts","../src/mcp-config.ts","../src/source.ts"],"mappings":";;;;iBAgbsB,eAAe,KAAK,oBAAoB,QAAQ;;;UC9a5D;EACR,OAAO;EACP;;cAKW;cAKA;cAKA;cASA,mBAAmB,SAAS,eAAe,SAAS,eAAe;cAoMnE,eAAe,SAAS,eAAe;cA2BvC,kBAAkB,SAAS,eAAe;cA+B1C,WAAW,SAAS,eAAe;cAgHnC,aAAa,SAAS,eAAe;iBA6FlC,WAAW,iBAAiB;iBAI5B,aAAa,gBAAgB;iBAO7B,kBAAkB,qBAAqB,uBAAuB;iBAS9D,uBAAuB,mBAAmB;iBAI1C,yBAAyB,mBAAmB;;;iBChMtC,eACpB,KAAK,mBACL,SAAS,kBACR;EAAU;EAAgB,QAAQ;EAAqB;;;;KCrTrD,gBAAgB;UAEJ;EACf;EACA;EACA;EACA;EACA;EACA,MAAM;EACN;EACA;EACA,UAAU;EACV;;UAGe;EACf;EACA;;UAGe;EACf,SAAS;EACT,SAAS;EACT,UAAU;EACV;;iBA6Cc,oBAAoB,aAAa;EAA8B,SAAS,YAAY;EAAc;;iBAoElG,mBAAmB,aAAa,wBAA4B;;iBAsD5D,eAAe,QAAQ;;;iBClFjB,iBAAiB,gBAAgB,eAAsB,QAAQ"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
import { _ as ruleForHostImport, a as analyzePackage, c as EVENT_RULES, d as PI_CODING_AGENT_PACKAGES, f as PI_TUI_PACKAGES, g as ruleForEvent, h as ruleForContextProperty, i as generateBundle, l as HOST_IMPORT_RULES, m as ruleForApi, n as convertPiMcpConfig, o as API_RULES, p as UI_CONTEXT_RULES, r as renderMcpPatch, s as CONTEXT_RULES, t as collectPiMcpServers, u as PI_AI_PACKAGES, v as ruleForUiContextProperty } from "./mcp-config-jL9w70It.mjs";
|
|
3
|
+
import { t as resolvePiPackage } from "./source-D7Ir-rPT.mjs";
|
|
4
|
+
import { applyPiHost, generateHostBundle, manifestForInstalled } from "./host.mjs";
|
|
5
|
+
export { API_RULES, CONTEXT_RULES, EVENT_RULES, HOST_IMPORT_RULES, PI_AI_PACKAGES, PI_CODING_AGENT_PACKAGES, PI_TUI_PACKAGES, UI_CONTEXT_RULES, analyzePackage, applyPiHost, collectPiMcpServers, convertPiMcpConfig, generateBundle, generateHostBundle, manifestForInstalled, renderMcpPatch, resolvePiPackage, ruleForApi, ruleForContextProperty, ruleForEvent, ruleForHostImport, ruleForUiContextProperty };
|