pi2dsh 0.12.0 → 0.12.2
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/dist/{analyzer-CsrBeS8r.mjs → analyzer-CEjVQKXA.mjs} +3 -3
- package/dist/{analyzer-CsrBeS8r.mjs.map → analyzer-CEjVQKXA.mjs.map} +1 -1
- package/dist/cli.mjs +7 -44
- package/dist/cli.mjs.map +1 -1
- package/dist/compat/pi-coding-agent.d.mts +82 -14
- package/dist/compat/pi-coding-agent.d.mts.map +1 -1
- package/dist/compat/pi-coding-agent.mjs +1 -1
- package/dist/credentials-oauth.mjs +1 -1
- package/dist/host.d.mts +1 -11
- package/dist/host.d.mts.map +1 -1
- package/dist/host.mjs +3 -98
- package/dist/host.mjs.map +1 -1
- package/dist/index.d.mts +2 -15
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -14
- package/dist/index.mjs.map +1 -1
- package/dist/{mcp-config-Cn5gWemZ.mjs → mcp-config-DHkfjdvX.mjs} +22 -22
- package/dist/mcp-config-DHkfjdvX.mjs.map +1 -0
- package/dist/{pi-coding-agent-Ctw-BhoY.mjs → pi-coding-agent-CYnmeJEx.mjs} +0 -0
- package/dist/pi-coding-agent-CYnmeJEx.mjs.map +1 -0
- package/dist/{runtime-Bh5k4Kjt.mjs → runtime-DsPaznXJ.mjs} +993 -221
- package/dist/runtime-DsPaznXJ.mjs.map +1 -0
- package/dist/runtime.d.mts +33 -0
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +1 -1
- package/package.json +11 -8
- package/dist/generator-CSOv6wYT.mjs +0 -298
- package/dist/generator-CSOv6wYT.mjs.map +0 -1
- package/dist/mcp-config-Cn5gWemZ.mjs.map +0 -1
- package/dist/pi-coding-agent-Ctw-BhoY.mjs.map +0 -1
- package/dist/runtime-Bh5k4Kjt.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi-coding-agent.d.mts","names":[],"sources":["../../src/compat/vendor/pi-messages.ts","../../src/compat/vendor/pi-session-manager.ts","../../src/compat/vendor/pi-truncate.ts","../../src/compat/vendor/pi-file-mutation-queue.ts","../../src/compat/vendor/pi-config-shim.ts","../../src/compat/vendor/pi-extension-runtime.ts","../../src/compat/vendor/pi-tools/bash.ts","../../src/compat/vendor/pi-tools/read.ts","../../src/compat/vendor/pi-tools/edit.ts","../../src/compat/vendor/pi-tools/write.ts","../../src/compat/vendor/pi-tools/grep.ts","../../src/compat/vendor/pi-tools/find.ts","../../src/compat/vendor/pi-tools/ls.ts","../../src/compat/vendor/pi-compaction.ts","../../src/compat/vendor/pi-frontmatter.ts","../../src/compat/vendor/pi-tool-wrapper.ts","../../src/compat/vendor/pi-trust-store.ts","../../src/compat/vendor/pi-skills-load.ts","../../src/compat/vendor/pi-skills-format.ts","../../src/compat/pi-coding-agent.ts"],"mappings":";;;;;;cAUa;cAKA;cAGA;cAKA;;;;UAKI;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;;;;;UAOgB,cAAc;EAC9B;EACA;EACA,mBAAmB,cAAc;EACjC;EACA,UAAU;EACV;;UAGgB;EAChB;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;;;;;iBAOe,oBAAoB,KAAK;iBAkBzB,2BAA2B,iBAAiB,gBAAgB,oBAAoB;iBAShF,+BACf,iBACA,sBACA,oBACE;;iBAUa,oBACf,oBACA,mBAAmB,cAAc,iBACjC,kBACA,8BACA,oBACE;;;;;;;;;iBAmBa,aAAa,UAAU,iBAAiB;;;cC5G3C;UAEI;EAChB;EACA;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;;UAGgB;EAChB;EACA;EACA;EACA;;UAGgB,4BAA4B;EAC5C;EACA,SAAS;;UAGO,iCAAiC;EACjD;EACA;;UAGgB,yBAAyB;EACzC;EACA;EACA;;UAGgB,gBAAgB,qBAAqB;EACrD;EACA;EACA;EACA;;EAEA,UAAU;;EAEV,QAAQ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B;UA6P7D;EACf;EACA;EACA;EACA;EACA;EACA;;UASe;;EAEf;;EAEA,SAAS;;EAET;;UAGe;;EAEf;;EAEA;;UAGe;EACf;EACA;EACA,UAAU;EACV,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;;;;;;;;;iBAUc,+BAA+B,cAAS,gBAAW,gBAAW;;;;;;;iBAwE9D,qBAAqB,cAAS,uBAA0B;;;KC5pCnE,kBAAkB,UAAU;EAC/B,aAAa;EACb;;cAuBW,mBAAoB,UAAU,0BAA0B,yBACnE,oBACC,kBAAkB;cASR,mBAAoB;;;;iBCjCjB,mBAAmB,iBAAY;;;;;;;;;;;iBAe/B,oBAAoB,kBAAa;;;;;iBAQjC,mBAAmB,qBAAgB;yEAAnC;;;;;;;;;;;;;iBA0BA,oBAAoB,sBAAiB;;;KC7CzC;UAEK;EACf;EACA;;UAGe;EACf;EACA,UAAU;;cAwGC;UACH;EAEI,YAAA;EAIZ,IAAI,cAAc;EAIlB,SAAS,cAAc;EAOvB,IAAI,aAAa,UAAU;EAI3B,QAAQ,WAAW;;;;UCvDJ;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;;UA4Ce;;EAEf;;EAEA;;;;;;;;;;iBAmCc,kBAAkB,SAAS,2BAA2B;UA4JrD;;EAEf;;EAEA;;EAEA;;EAEA;;;;;;iBAOc,WAAW,SAAS,oBAAoB;;;;;;;;;;;iBC1VxC,sBAAsB;;;
|
|
1
|
+
{"version":3,"file":"pi-coding-agent.d.mts","names":[],"sources":["../../src/compat/vendor/pi-messages.ts","../../src/compat/vendor/pi-session-manager.ts","../../src/compat/vendor/pi-truncate.ts","../../src/compat/vendor/pi-file-mutation-queue.ts","../../src/compat/vendor/pi-config-shim.ts","../../src/compat/vendor/pi-extension-runtime.ts","../../src/compat/vendor/pi-tools/bash.ts","../../src/compat/vendor/pi-tools/read.ts","../../src/compat/vendor/pi-tools/edit.ts","../../src/compat/vendor/pi-tools/write.ts","../../src/compat/vendor/pi-tools/grep.ts","../../src/compat/vendor/pi-tools/find.ts","../../src/compat/vendor/pi-tools/ls.ts","../../src/compat/vendor/pi-compaction.ts","../../src/compat/vendor/pi-frontmatter.ts","../../src/compat/vendor/pi-tool-wrapper.ts","../../src/compat/vendor/pi-trust-store.ts","../../src/compat/vendor/pi-skills-load.ts","../../src/compat/vendor/pi-skills-format.ts","../../src/compat/vendor/pi-shell-config.ts","../../src/compat/vendor/pi-tools/visual-truncate.ts","../../src/compat/vendor/pi-tools/diff-component.ts","../../src/compat/pi-coding-agent.ts"],"mappings":";;;;;;cAUa;cAKA;cAGA;cAKA;;;;UAKI;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;;;;;UAOgB,cAAc;EAC9B;EACA;EACA,mBAAmB,cAAc;EACjC;EACA,UAAU;EACV;;UAGgB;EAChB;EACA;EACA;EACA;;UAGgB;EAChB;EACA;EACA;EACA;;;;;iBAOe,oBAAoB,KAAK;iBAkBzB,2BAA2B,iBAAiB,gBAAgB,oBAAoB;iBAShF,+BACf,iBACA,sBACA,oBACE;;iBAUa,oBACf,oBACA,mBAAmB,cAAc,iBACjC,kBACA,8BACA,oBACE;;;;;;;;;iBAmBa,aAAa,UAAU,iBAAiB;;;cC5G3C;UAEI;EAChB;EACA;EACA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;;UAGgB;EAChB;EACA;EACA;EACA;;UAGgB,4BAA4B;EAC5C;EACA,SAAS;;UAGO,iCAAiC;EACjD;EACA;;UAGgB,yBAAyB;EACzC;EACA;EACA;;UAGgB,gBAAgB,qBAAqB;EACrD;EACA;EACA;EACA;;EAEA,UAAU;;EAEV,QAAQ;;EAER;;UAGgB,mBAAmB,qBAAqB;EACxD;EACA;EACA;;EAEA,UAAU;;EAEV,QAAQ;;EAER;;;;;;;;;;;;UAagB,YAAY,qBAAqB;EACjD;EACA;EACA,OAAO;;;UAIS,mBAAmB;EACnC;EACA;EACA;;;UAIgB,yBAAyB;EACzC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AO;EAGP;;cAGW,+BAA+B;cAC/B,wBAAwB;cACxB,uBAAuB;EAClC;EACA;EACA;;cAEW,+BAA+B;cAC/B,kCAAkC;cAClC,6BAA6B;cAC7B,mCAAmC;cACnC,gCAAgC;cAChC,iCAAiC;cACjC,kCAAkC;cAElC,qBAAqB;UACxB;EACR,YAAY;EACZ,YAAY;EACZ;EAGA,QAAQ;EAIR,YAAY;;UASG;GACd;;UAEc;GACd;;UAEc;GACd;;UAEc;GACd;;UAKc;EACf;EACA;;iBAKc,QAAQ,oBAAoB;iBAI5B,QAAQ;iBAIR,WAAW,aAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as isToolCallEventType, $t as formatSize, A as createEventBus, At as shouldCompact, B as getPackageDir, Bt as createEditToolDefinition, C as VERSION, Cn as createCustomMessage, Ct as estimateTokens, D as copyToClipboard, Dt as prepareBranchEntries, E as convertToPng, Et as getLastAssistantUsage, F as generateSummary, Ft as createGrepTool, G as highlightCode, Gt as createBashTool, H as getSelectListTheme, Ht as createReadTool, I as generateSummaryWithUsage, It as createGrepToolDefinition, J as isEditToolResult, Jt as truncateToVisualLines, K as initTheme, Kt as createBashToolDefinition, L as getBinDir, Lt as createWriteTool, M as defineTool, Mt as createLsToolDefinition, N as ensureTool, Nt as createFindTool, O as createAgentSession, Ot as prepareCompaction, P as generateBranchSummary, Pt as createFindToolDefinition, Q as isReadToolResult, Qt as DEFAULT_MAX_LINES, R as getLanguageFromPath, Rt as createWriteToolDefinition, S as UserMessageComponent, Sn as createCompactionSummaryMessage, St as collectEntriesForBranchSummary, T as compact, Tt as findTurnStartIndex, U as getSettingsListTheme, Ut as createReadToolDefinition, V as getReadmePath, Vt as renderDiff, W as getToolPath, Wt as bashToolSystemPromptContribution, X as isGrepToolResult, Xt as withFileMutationQueue, Y as isFindToolResult, Yt as createExtensionRuntime, Z as isLsToolResult, Zt as DEFAULT_MAX_BYTES, _ as ModelRuntime, _n as COMPACTION_SUMMARY_PREFIX, _t as wrapToolDefinitions, a as CustomMessageComponent, an as assertValidSessionId, at as rawKeyHint, b as Theme, bn as convertToLlm, bt as DEFAULT_COMPACTION_SETTINGS, c as DynamicBorder, cn as findMostRecentSession, ct as theme, d as ExtensionRunner, dn as loadEntriesFromFile, dt as loadSkills, en as truncateHead, et as isWriteToolResult, f as ExtensionSelectorComponent, fn as migrateSessionEntries, ft as loadSkillsFromDir, g as ModelRegistry, gn as BRANCH_SUMMARY_SUFFIX, gt as wrapToolDefinition, h as InMemorySettingsStorage, hn as BRANCH_SUMMARY_PREFIX, ht as wrapRegisteredTools, i as CustomEditor, in as SessionManager, it as processImage, j as createReadOnlyTools, jt as createLsTool, k as createCodingTools, kt as serializeConversation, l as ExtensionEditorComponent, ln as getDefaultSessionDir, lt as getShellConfig, m as FooterComponent, mn as sessionEntryToContextMessages, mt as wrapRegisteredTool, n as BorderedLoader, nn as truncateTail, nt as keyText, o as DefaultPackageManager, on as buildContextEntries, ot as readStoredCredential, p as FileSettingsStorage, pn as parseSessionEntries, pt as ProjectTrustStore, q as isBashToolResult, qt as createLocalBashOperations, r as CONFIG_DIR_NAME, rn as CURRENT_SESSION_VERSION, rt as parseSkillBlock, s as DefaultResourceLoader, sn as buildSessionContext, st as resizeImage, t as AssistantMessageComponent, tn as truncateLine, tt as keyHint, u as ExtensionInputComponent, un as getLatestCompactionEntry, ut as formatSkillsForPrompt, v as SettingsManager, vn as COMPACTION_SUMMARY_SUFFIX, vt as parseFrontmatter, w as __setSubagentSessionFactory, wt as findCutPoint, x as ToolExecutionComponent, xn as createBranchSummaryMessage, xt as calculateContextTokens, y as SettingsSelectorComponent, yn as bashExecutionToText, yt as stripFrontmatter, z as getMarkdownTheme, zt as createEditTool } from "../pi-coding-agent-CYnmeJEx.mjs";
|
|
3
3
|
import { t as getAgentDir } from "../pi-config-shim-CZ1wFzqM.mjs";
|
|
4
4
|
export { AssistantMessageComponent, BRANCH_SUMMARY_PREFIX, BRANCH_SUMMARY_SUFFIX, BorderedLoader, COMPACTION_SUMMARY_PREFIX, COMPACTION_SUMMARY_SUFFIX, CONFIG_DIR_NAME, CURRENT_SESSION_VERSION, CustomEditor, CustomMessageComponent, DEFAULT_COMPACTION_SETTINGS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DefaultPackageManager, DefaultResourceLoader, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionRunner, ExtensionSelectorComponent, FileSettingsStorage, FooterComponent, InMemorySettingsStorage, ModelRegistry, ModelRuntime, ProjectTrustStore, SessionManager, SettingsManager, SettingsSelectorComponent, Theme, ToolExecutionComponent, UserMessageComponent, VERSION, __setSubagentSessionFactory, assertValidSessionId, bashExecutionToText, bashToolSystemPromptContribution, buildContextEntries, buildSessionContext, calculateContextTokens, collectEntriesForBranchSummary, compact, convertToLlm, convertToPng, copyToClipboard, createAgentSession, createBashTool, createBashToolDefinition, createBranchSummaryMessage, createCodingTools, createCompactionSummaryMessage, createCustomMessage, createEditTool, createEditToolDefinition, createEventBus, createExtensionRuntime, createFindTool, createFindToolDefinition, createGrepTool, createGrepToolDefinition, createLocalBashOperations, createLsTool, createLsToolDefinition, createReadOnlyTools, createReadTool, createReadToolDefinition, createWriteTool, createWriteToolDefinition, defineTool, ensureTool, estimateTokens, findCutPoint, findMostRecentSession, findTurnStartIndex, formatSize, formatSkillsForPrompt, generateBranchSummary, generateSummary, generateSummaryWithUsage, getAgentDir, getBinDir, getDefaultSessionDir, getLanguageFromPath, getLastAssistantUsage, getLatestCompactionEntry, getMarkdownTheme, getPackageDir, getReadmePath, getSelectListTheme, getSettingsListTheme, getShellConfig, getToolPath, highlightCode, initTheme, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, keyHint, keyText, loadEntriesFromFile, loadSkills, loadSkillsFromDir, migrateSessionEntries, parseFrontmatter, parseSessionEntries, parseSkillBlock, prepareBranchEntries, prepareCompaction, processImage, rawKeyHint, readStoredCredential, renderDiff, resizeImage, serializeConversation, sessionEntryToContextMessages, shouldCompact, stripFrontmatter, theme, truncateHead, truncateLine, truncateTail, truncateToVisualLines, withFileMutationQueue, wrapRegisteredTool, wrapRegisteredTools, wrapToolDefinition, wrapToolDefinitions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as builtinProviders } from "./pi-ai-Dyg4zyLZ.mjs";
|
|
3
|
-
import "./pi-coding-agent-
|
|
3
|
+
import "./pi-coding-agent-CYnmeJEx.mjs";
|
|
4
4
|
import { t as getAgentDir } from "./pi-config-shim-CZ1wFzqM.mjs";
|
|
5
5
|
import { i as resolveOAuthApiKey, o as storedOAuthCredential, r as providerSupportsOAuth, t as FileCredentialStore } from "./oauth-bridge-CfyImWx4.mjs";
|
|
6
6
|
import { join } from "node:path";
|
package/dist/host.d.mts
CHANGED
|
@@ -22,16 +22,6 @@ declare function manifestForInstalled(pkg: ResolvedPiPackage): Promise<Generated
|
|
|
22
22
|
* host or their siblings — matching Pi's own per-extension error isolation.
|
|
23
23
|
*/
|
|
24
24
|
declare function applyPiHost(ctx: Context, config: PiHostConfig, anchor?: string): Promise<void>;
|
|
25
|
-
interface HostBundleOptions {
|
|
26
|
-
outDir: string;
|
|
27
|
-
/** npm specs, e.g. "@narumitw/pi-lsp@0.49.4" or "pi-ask-user". */
|
|
28
|
-
packages: string[];
|
|
29
|
-
bundleName?: string;
|
|
30
|
-
}
|
|
31
|
-
declare function generateHostBundle(options: HostBundleOptions): Promise<{
|
|
32
|
-
outDir: string;
|
|
33
|
-
packageName: string;
|
|
34
|
-
}>;
|
|
35
25
|
//#endregion
|
|
36
|
-
export {
|
|
26
|
+
export { PiHostConfig, PiHostPackageSpec, applyPiHost, manifestForInstalled };
|
|
37
27
|
//# sourceMappingURL=host.d.mts.map
|
package/dist/host.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.mts","names":[],"sources":["../src/host.ts"],"mappings":";;;;KAmBK,gBAAgB;UAEJ;;EAEf;;EAEA,SAAS;;UAGM;EACf,UAAU,eAAe;;EAEzB,2BAA2B;;;iBAuBP,qBAAqB,KAAK,oBAAoB,QAAQ;;;;;;iBA8DtD,YAAY,KAAK,SAAS,QAAQ,cAAc,kBAAkB
|
|
1
|
+
{"version":3,"file":"host.d.mts","names":[],"sources":["../src/host.ts"],"mappings":";;;;KAmBK,gBAAgB;UAEJ;;EAEf;;EAEA,SAAS;;UAGM;EACf,UAAU,eAAe;;EAEzB,2BAA2B;;;iBAuBP,qBAAqB,KAAK,oBAAoB,QAAQ;;;;;;iBA8DtD,YAAY,KAAK,SAAS,QAAQ,cAAc,kBAAkB"}
|
package/dist/host.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { r as registerVisionCompanions, t as applyPiPackage } from "./runtime-
|
|
2
|
+
import { r as registerVisionCompanions, t as applyPiPackage } from "./runtime-DsPaznXJ.mjs";
|
|
3
3
|
import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
-
import {
|
|
5
|
+
import { readFile } from "node:fs/promises";
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
7
7
|
import { basename, dirname, join, relative } from "node:path";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -109,102 +109,7 @@ async function applyPiHost(ctx, config, anchor) {
|
|
|
109
109
|
}
|
|
110
110
|
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}`);
|
|
111
111
|
}
|
|
112
|
-
function splitSpec(spec) {
|
|
113
|
-
const at = spec.lastIndexOf("@");
|
|
114
|
-
if (at > 0) return {
|
|
115
|
-
name: spec.slice(0, at),
|
|
116
|
-
range: spec.slice(at + 1)
|
|
117
|
-
};
|
|
118
|
-
return {
|
|
119
|
-
name: spec,
|
|
120
|
-
range: "*"
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async function firstExisting(paths) {
|
|
124
|
-
for (const path of paths) try {
|
|
125
|
-
await stat(path);
|
|
126
|
-
return path;
|
|
127
|
-
} catch {}
|
|
128
|
-
throw new Error(`cannot locate pi2dsh runtime artifact; tried: ${paths.join(", ")}`);
|
|
129
|
-
}
|
|
130
|
-
async function copyEmbeddedHostRuntime(outDir) {
|
|
131
|
-
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
132
|
-
const hostSource = await firstExisting([join(moduleDir, "host.mjs"), join(moduleDir, "../dist/host.mjs")]);
|
|
133
|
-
const distRoot = dirname(hostSource);
|
|
134
|
-
const targetRoot = join(outDir, "runtime");
|
|
135
|
-
await mkdir(join(targetRoot, "compat", "vendor"), { recursive: true });
|
|
136
|
-
for (const entry of await readdir(distRoot)) if (entry.endsWith(".mjs") || entry.endsWith(".d.mts")) await cp(join(distRoot, entry), join(targetRoot, entry));
|
|
137
|
-
for (const sub of ["compat", join("compat", "vendor")]) {
|
|
138
|
-
const dir = join(distRoot, sub);
|
|
139
|
-
try {
|
|
140
|
-
for (const entry of await readdir(dir)) if (entry.endsWith(".mjs")) await cp(join(dir, entry), join(targetRoot, sub, entry));
|
|
141
|
-
} catch {}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async function generateHostBundle(options) {
|
|
145
|
-
const specs = options.packages.map(splitSpec);
|
|
146
|
-
if (specs.length === 0) throw new Error("host bundle requires at least one Pi package spec");
|
|
147
|
-
const packageName = options.bundleName ?? "dsh-pi-host";
|
|
148
|
-
await mkdir(options.outDir, { recursive: true });
|
|
149
|
-
await copyEmbeddedHostRuntime(options.outDir);
|
|
150
|
-
const packageJson = {
|
|
151
|
-
name: packageName,
|
|
152
|
-
version: "0.1.0",
|
|
153
|
-
description: `pi2dsh host bundle mounting ${specs.map((spec) => spec.name).join(", ")} as native DSH plugins`,
|
|
154
|
-
type: "module",
|
|
155
|
-
main: "./index.js",
|
|
156
|
-
files: [
|
|
157
|
-
"index.js",
|
|
158
|
-
"cordis.patch.yml",
|
|
159
|
-
"runtime",
|
|
160
|
-
"PI2DSH-LICENSE",
|
|
161
|
-
"README.md"
|
|
162
|
-
],
|
|
163
|
-
dependencies: {
|
|
164
|
-
...Object.fromEntries(specs.map((spec) => [spec.name, spec.range])),
|
|
165
|
-
jiti: "^2.7.0",
|
|
166
|
-
"get-east-asian-width": "^1.6.0",
|
|
167
|
-
marked: "^16.4.1",
|
|
168
|
-
typebox: "^1.0.4",
|
|
169
|
-
tinyglobby: "^0.2.15",
|
|
170
|
-
"cross-spawn": "^7.0.6",
|
|
171
|
-
diff: "^9.0.0",
|
|
172
|
-
"@deepseek-ai/dsh-skill-filesystem": "^0.1.0-rc.6",
|
|
173
|
-
openai: "^6.40.0"
|
|
174
|
-
},
|
|
175
|
-
peerDependencies: {
|
|
176
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
177
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6"
|
|
178
|
-
},
|
|
179
|
-
keywords: [
|
|
180
|
-
"dsh-plugin",
|
|
181
|
-
"deepseek-harness",
|
|
182
|
-
"pi-package",
|
|
183
|
-
"pi2dsh",
|
|
184
|
-
"pi-host"
|
|
185
|
-
],
|
|
186
|
-
license: "MIT",
|
|
187
|
-
dsh: { bundle: { patch: "./cordis.patch.yml" } }
|
|
188
|
-
};
|
|
189
|
-
await writeFile(join(options.outDir, "package.json"), `${JSON.stringify(packageJson, null, 2)}\n`);
|
|
190
|
-
const hostConfig = { packages: specs.map((spec) => spec.name) };
|
|
191
|
-
const indexSource = `import { applyPiHost } from './runtime/host.mjs'\n\nexport const name = ${JSON.stringify(packageName)}\nexport const inject = ${JSON.stringify([
|
|
192
|
-
"tools",
|
|
193
|
-
"systemPrompt",
|
|
194
|
-
"commands",
|
|
195
|
-
"skills"
|
|
196
|
-
])}\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`;
|
|
197
|
-
await writeFile(join(options.outDir, "index.js"), indexSource);
|
|
198
|
-
await writeFile(join(options.outDir, "cordis.patch.yml"), `- insert:\n - id: ${packageName}\n name: ${JSON.stringify(packageName)}\n`);
|
|
199
|
-
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")]);
|
|
200
|
-
await cp(licenseSource, join(options.outDir, "PI2DSH-LICENSE"));
|
|
201
|
-
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");
|
|
202
|
-
return {
|
|
203
|
-
outDir: options.outDir,
|
|
204
|
-
packageName
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
112
|
//#endregion
|
|
208
|
-
export { applyPiHost,
|
|
113
|
+
export { applyPiHost, manifestForInstalled };
|
|
209
114
|
|
|
210
115
|
//# sourceMappingURL=host.mjs.map
|
package/dist/host.mjs.map
CHANGED
|
@@ -1 +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 { existsSync, readFileSync } from 'node:fs'\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, registerVisionCompanions } 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 /** Image-admission companions: default automatic; `false` off; explicit map narrows. */\n visionCompanions?: false | Record<string, readonly string[]>\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 try {\n return dirname(require.resolve(`${packageName}/package.json`))\n } catch {\n // Modern strict `exports` maps refuse the package.json subpath, and pure\n // ESM packages (no \"require\" condition) refuse CJS entry resolution too.\n // Locate the installed directory on the filesystem instead: probe every\n // node_modules candidate on the resolution path — no exports involved.\n for (const candidate of require.resolve.paths(packageName) ?? []) {\n const dir = join(candidate, packageName)\n if (existsSync(join(dir, 'package.json'))) return dir\n }\n throw new Error(`cannot locate the installed package directory for ${JSON.stringify(packageName)} near ${JSON.stringify(anchor)}`)\n }\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 registerVisionCompanions(ctx, config.visionCompanions)\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 // The vendored Pi built-in tool constructors spawn through cross-spawn\n // and diff exactly as Pi does — same runtime set the convert bundle\n // carries (generator.ts keeps the sibling list).\n 'cross-spawn': '^7.0.6',\n diff: '^9.0.0',\n '@deepseek-ai/dsh-skill-filesystem': '^0.1.0-rc.6',\n // The bridge's own openai-completions client (openai SDK) serves the\n // common gateway protocol; rarer apis lazily use a real pi-ai from\n // the mounted packages' own dependency trees. A direct pi-ai\n // dependency would drag @google/genai → protobufjs, whose blocked\n // install script fails `dsh plugin add` for transitive dependencies.\n openai: '^6.40.0',\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":";;;;;;;;;AAkCA,SAAS,iBAAiB,MAAoE;CAC5F,MAAM,aAAa,KAAK,QAAQ,WAAW,IAAI;CAC/C,IAAI,CAAC,WAAW,WAAW,KAAK,GAAG,OAAO;EAAE,YAAY,CAAC;EAAG,MAAM;CAAW;CAC7E,MAAM,WAAW,WAAW,QAAQ,SAAS,CAAC;CAC9C,IAAI,aAAa,IAAI,OAAO;EAAE,YAAY,CAAC;EAAG,MAAM;CAAW;CAC/D,MAAM,aAAqC,CAAC;CAC5C,KAAK,MAAM,QAAQ,WAAW,MAAM,GAAG,QAAQ,CAAC,CAAC,MAAM,IAAI,GAAG;EAC5D,MAAM,YAAY,KAAK,QAAQ,GAAG;EAClC,IAAI,cAAc,IAAI;EACtB,MAAM,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC,KAAK;EAC1C,IAAI,QAAQ,KAAK,MAAM,YAAY,CAAC,CAAC,CAAC,KAAK;EAC3C,IAAK,MAAM,WAAW,IAAG,KAAK,MAAM,SAAS,IAAG,KAAO,MAAM,WAAW,GAAG,KAAK,MAAM,SAAS,GAAG,GAChG,QAAQ,MAAM,MAAM,GAAG,EAAE;EAE3B,IAAI,IAAI,SAAS,GAAG,WAAW,OAAO;CACxC;CACA,OAAO;EAAE;EAAY,MAAM,WAAW,MAAM,WAAW,CAAC,CAAC,CAAC,KAAK;CAAE;AACnE;;AAGA,eAAsB,qBAAqB,KAA2D;CACpG,MAAM,cAAc,SAAyB,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG;CAE7F,MAAM,4BAAY,IAAI,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AAU,KAAK,QAAQ,QAAQ,UAAU,GAAG,WAAW;CAE7D,MAAM,UAAU,KAAK,QAAQ,QAAQ,kBAAkB,GACrD,wBAAwB,YAAY,gBAAgB,KAAK,UAAU,WAAW,EAAE,GAAG;CAErF,MAAM,gBAAgB,MAAM,cAAc,CACxC,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,0BAA0B,GACxE,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,iCAAiC,CACjF,CAAC;CACD,MAAM,GAAG,eAAe,KAAK,QAAQ,QAAQ,gBAAgB,CAAC;CAE9D,MAAM,UAAU,KAAK,QAAQ,QAAQ,WAAW,GAC9C,KAAK,YAAY,8NAEf,MAAM,KAAI,SAAQ,OAAO,KAAK,KAAK,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,IAC/D,8SACmM;CAEvM,OAAO;EAAE,QAAQ,QAAQ;EAAQ;CAAY;AAC/C"}
|
|
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 { existsSync, readFileSync } from 'node:fs'\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, registerVisionCompanions } 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 /** Image-admission companions: default automatic; `false` off; explicit map narrows. */\n visionCompanions?: false | Record<string, readonly string[]>\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 try {\n return dirname(require.resolve(`${packageName}/package.json`))\n } catch {\n // Modern strict `exports` maps refuse the package.json subpath, and pure\n // ESM packages (no \"require\" condition) refuse CJS entry resolution too.\n // Locate the installed directory on the filesystem instead: probe every\n // node_modules candidate on the resolution path — no exports involved.\n for (const candidate of require.resolve.paths(packageName) ?? []) {\n const dir = join(candidate, packageName)\n if (existsSync(join(dir, 'package.json'))) return dir\n }\n throw new Error(`cannot locate the installed package directory for ${JSON.stringify(packageName)} near ${JSON.stringify(anchor)}`)\n }\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 registerVisionCompanions(ctx, config.visionCompanions)\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"],"mappings":";;;;;;;;;AAkCA,SAAS,iBAAiB,MAAoE;CAC5F,MAAM,aAAa,KAAK,QAAQ,WAAW,IAAI;CAC/C,IAAI,CAAC,WAAW,WAAW,KAAK,GAAG,OAAO;EAAE,YAAY,CAAC;EAAG,MAAM;CAAW;CAC7E,MAAM,WAAW,WAAW,QAAQ,SAAS,CAAC;CAC9C,IAAI,aAAa,IAAI,OAAO;EAAE,YAAY,CAAC;EAAG,MAAM;CAAW;CAC/D,MAAM,aAAqC,CAAC;CAC5C,KAAK,MAAM,QAAQ,WAAW,MAAM,GAAG,QAAQ,CAAC,CAAC,MAAM,IAAI,GAAG;EAC5D,MAAM,YAAY,KAAK,QAAQ,GAAG;EAClC,IAAI,cAAc,IAAI;EACtB,MAAM,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC,KAAK;EAC1C,IAAI,QAAQ,KAAK,MAAM,YAAY,CAAC,CAAC,CAAC,KAAK;EAC3C,IAAK,MAAM,WAAW,IAAG,KAAK,MAAM,SAAS,IAAG,KAAO,MAAM,WAAW,GAAG,KAAK,MAAM,SAAS,GAAG,GAChG,QAAQ,MAAM,MAAM,GAAG,EAAE;EAE3B,IAAI,IAAI,SAAS,GAAG,WAAW,OAAO;CACxC;CACA,OAAO;EAAE;EAAY,MAAM,WAAW,MAAM,WAAW,CAAC,CAAC,CAAC,KAAK;CAAE;AACnE;;AAGA,e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,KAAK,MAAM,KAAK,GAAG,KAAK,QAAQ,KAAA,CACxC,iCAAiC,QAAQ,KAAK,IAAI,QAAQ,OAAO;CACxE;CACA,IAAI,OAAO,SAAS,KAAK,OAAO,WAAW,eAAe,MAAM,CAAC,CAAC,QAChE,MAAM,IAAI,MAAM,mDAAmD,OAAO,EAAE,CAAE,KAAK,IAAI,OAAO,EAAE,CAAE,OAAO;AAE7G"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { a as GeneratedRuntimeManifest, c as ResourceInventory, i as GenerateOptions, n as CompatibilityLevel, o as PackageIdentity, r as CompatibilityReport, s as ResolvedPiPackage, t as CompatibilityFinding } from "./types-7IWJPPvS.mjs";
|
|
3
|
-
import { applyPiHost,
|
|
3
|
+
import { applyPiHost, manifestForInstalled } from "./host.mjs";
|
|
4
4
|
import { Context } from "@deepseek-ai/cordis";
|
|
5
|
-
//#region src/generator.d.ts
|
|
6
|
-
declare function generateBundle$1(pkg: ResolvedPiPackage, options: GenerateOptions): Promise<{
|
|
7
|
-
outDir: string;
|
|
8
|
-
report: CompatibilityReport;
|
|
9
|
-
packageName: string;
|
|
10
|
-
}>;
|
|
11
|
-
//#endregion
|
|
12
5
|
//#region src/engine.d.ts
|
|
13
6
|
interface EngineConfig {
|
|
14
7
|
/** Mount exactly these packages (skips discovery). */
|
|
@@ -106,12 +99,6 @@ declare function resolvePiPackage(source: string, cwd?: string): Promise<Resolve
|
|
|
106
99
|
* @returns the compatibility report.
|
|
107
100
|
*/
|
|
108
101
|
declare function analyzePackage(pkg: ResolvedPiPackage): Promise<CompatibilityReport>;
|
|
109
|
-
/**
|
|
110
|
-
* Generate a vendored per-package bundle (CLI `convert`).
|
|
111
|
-
* @param options - generation options (see the generator module).
|
|
112
|
-
* @returns the generation result.
|
|
113
|
-
*/
|
|
114
|
-
declare function generateBundle(...args: Parameters<typeof generateBundle$1>): ReturnType<typeof generateBundle$1>;
|
|
115
102
|
//#endregion
|
|
116
|
-
export { API_RULES, CONTEXT_RULES, type CompatibilityFinding, type CompatibilityLevel, type CompatibilityReport, EVENT_RULES, type EngineConfig, 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, apply, applyPiHost, collectPiMcpServers, convertPiMcpConfig, discoverProfilePiPackages, findProfileRoot,
|
|
103
|
+
export { API_RULES, CONTEXT_RULES, type CompatibilityFinding, type CompatibilityLevel, type CompatibilityReport, EVENT_RULES, type EngineConfig, 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, apply, applyPiHost, collectPiMcpServers, convertPiMcpConfig, discoverProfilePiPackages, findProfileRoot, inject, manifestForInstalled, name, renderMcpPatch, resolvePiPackage, ruleForApi, ruleForContextProperty, ruleForEvent, ruleForHostImport, ruleForUiContextProperty };
|
|
117
104
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/engine.ts","../src/compatibility.ts","../src/mcp-config.ts","../src/source.ts","../src/index.ts"],"mappings":";;;;;UA6BiB;;EAEf;;EAEA;;;;;;;;EAQA,2BAA2B;;;iBAIb,gBAAgB;UAUtB;EACR;EACA;;;;;;;;iBAgBoB,0BACpB,qBACA;EAAW;EAAoB,QAAQ;IACtC,QAAQ;;cA4CE;cACA;iBAES,MAAM,KAAK,SAAS,SAAQ,eAAoB;;;UCzH5D;EACR,OAAO;EACP;;cAKW;cAKA;cAKA;cAWA,mBAAmB,SAAS,eAAe,SAAS,eAAe;cAmNnE,eAAe,SAAS,eAAe;cA4BvC,kBAAkB,SAAS,eAAe;cA+B1C,WAAW,SAAS,eAAe;cAkHnC,aAAa,SAAS,eAAe;iBA6FlC,WAAW,iBAAiB;iBAI5B,aAAa,gBAAgB;iBAO7B,kBAAkB,qBAAqB,uBAAuB;iBAS9D,uBAAuB,mBAAmB;iBAI1C,yBAAyB,mBAAmB;;;KCtgBvD,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;;;iBC5EjB,iBAAiB,gBAAgB,eAAsB,QAAQ;;;;;;;;iBChH/D,eAAe,KAAK,oBAAoB,QAAQ"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { r as registerVisionCompanions } from "./runtime-
|
|
2
|
+
import { r as registerVisionCompanions } from "./runtime-DsPaznXJ.mjs";
|
|
3
3
|
import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
|
|
4
|
-
import { applyPiHost,
|
|
5
|
-
import { a as CONTEXT_RULES, c as PI_AI_PACKAGES, d as UI_CONTEXT_RULES, f as ruleForApi, g as ruleForUiContextProperty, h as ruleForHostImport, i as API_RULES, l as PI_CODING_AGENT_PACKAGES, m as ruleForEvent, n as convertPiMcpConfig, o as EVENT_RULES, p as ruleForContextProperty, r as renderMcpPatch, s as HOST_IMPORT_RULES, t as collectPiMcpServers, u as PI_TUI_PACKAGES } from "./mcp-config-
|
|
4
|
+
import { applyPiHost, manifestForInstalled } from "./host.mjs";
|
|
5
|
+
import { a as CONTEXT_RULES, c as PI_AI_PACKAGES, d as UI_CONTEXT_RULES, f as ruleForApi, g as ruleForUiContextProperty, h as ruleForHostImport, i as API_RULES, l as PI_CODING_AGENT_PACKAGES, m as ruleForEvent, n as convertPiMcpConfig, o as EVENT_RULES, p as ruleForContextProperty, r as renderMcpPatch, s as HOST_IMPORT_RULES, t as collectPiMcpServers, u as PI_TUI_PACKAGES } from "./mcp-config-DHkfjdvX.mjs";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
7
7
|
import { existsSync } from "node:fs";
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
@@ -114,19 +114,10 @@ async function apply(ctx, config = {}) {
|
|
|
114
114
|
* @returns the compatibility report.
|
|
115
115
|
*/
|
|
116
116
|
async function analyzePackage(pkg) {
|
|
117
|
-
const { analyzePackage: run } = await import("./analyzer-
|
|
117
|
+
const { analyzePackage: run } = await import("./analyzer-CEjVQKXA.mjs");
|
|
118
118
|
return run(pkg);
|
|
119
119
|
}
|
|
120
|
-
/**
|
|
121
|
-
* Generate a vendored per-package bundle (CLI `convert`).
|
|
122
|
-
* @param options - generation options (see the generator module).
|
|
123
|
-
* @returns the generation result.
|
|
124
|
-
*/
|
|
125
|
-
async function generateBundle(...args) {
|
|
126
|
-
const { generateBundle: run } = await import("./generator-CSOv6wYT.mjs");
|
|
127
|
-
return run(...args);
|
|
128
|
-
}
|
|
129
120
|
//#endregion
|
|
130
|
-
export { API_RULES, CONTEXT_RULES, EVENT_RULES, HOST_IMPORT_RULES, PI_AI_PACKAGES, PI_CODING_AGENT_PACKAGES, PI_TUI_PACKAGES, UI_CONTEXT_RULES, analyzePackage, apply, applyPiHost, collectPiMcpServers, convertPiMcpConfig, discoverProfilePiPackages, findProfileRoot,
|
|
121
|
+
export { API_RULES, CONTEXT_RULES, EVENT_RULES, HOST_IMPORT_RULES, PI_AI_PACKAGES, PI_CODING_AGENT_PACKAGES, PI_TUI_PACKAGES, UI_CONTEXT_RULES, analyzePackage, apply, applyPiHost, collectPiMcpServers, convertPiMcpConfig, discoverProfilePiPackages, findProfileRoot, inject, manifestForInstalled, name, renderMcpPatch, resolvePiPackage, ruleForApi, ruleForContextProperty, ruleForEvent, ruleForHostImport, ruleForUiContextProperty };
|
|
131
122
|
|
|
132
123
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/engine.ts","../src/index.ts"],"sourcesContent":["// The pi2dsh engine: ONE installed copy of the bridge that mounts every Pi\n// package the user has added to their DSH profile.\n//\n// dsh plugin --profile p add pi2dsh ← the engine (this plugin)\n// dsh plugin --profile p add @kassing/pi-vision ← plain npm dependency\n// dsh plugin --profile p add pi-vision-tool ← plain npm dependency\n//\n// DSH's plugin manager records only packages that declare `dsh.bundle` as\n// profile layers; everything else stays an ordinary dependency (\"a plain\n// library is fine\"). The engine reads the profile manifest's DIRECT\n// dependencies — every entry there was an explicit `dsh plugin add` — and\n// mounts each package that identifies as a Pi package, all through one\n// bridge instance: one model ledger, one command space, one upgrade unit.\n//\n// Discovery is manifest-driven, never a node_modules scan (the lesson from\n// Prettier 3 dropping directory-based plugin discovery): the dependency list\n// is the user's explicit intent, and package identification uses the same\n// Pi markers `resolvePiPackage` has always used (the `pi` manifest field,\n// with Pi's directory conventions as fallback).\n\nimport { readFile } from 'node:fs/promises'\nimport { existsSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { applyPiHost } from './host.js'\nimport { registerVisionCompanions } from './runtime.js'\nimport { resolvePiPackage } from './source.js'\n\nexport interface EngineConfig {\n /** Mount exactly these packages (skips discovery). */\n packages?: string[]\n /** Never mount these packages even when discovered. */\n exclude?: string[]\n /**\n * Image-admission companion routes. Default: AUTOMATIC — every text-only\n * llm route gets a \\`<route>-vision\\` companion that admits pasted images\n * (a mounted vision extension analyzes them; without one the image is\n * materialized to a file any image-capable tool can read). \\`false\\`\n * turns companions off; an explicit \\`{ <route>: [modelIds] }\\` narrows.\n */\n visionCompanions?: false | Record<string, readonly string[]>\n}\n\n/** Locate the DSH profile root: the nearest ancestor holding cordis.yml. */\nexport function findProfileRoot(start: string): string | undefined {\n let dir = start\n for (;;) {\n if (existsSync(join(dir, 'cordis.yml')) && existsSync(join(dir, 'package.json'))) return dir\n const parent = dirname(dir)\n if (parent === dir) return undefined\n dir = parent\n }\n}\n\ninterface DiscoveredPackage {\n name: string\n dir: string\n}\n\nfunction resolveDependencyDir(profileRoot: string, name: string): string | undefined {\n // Direct dependencies of the profile live under its node_modules by name\n // (pnpm links them there); resolving by path needs no exports gymnastics.\n const dir = join(profileRoot, 'node_modules', name)\n return existsSync(join(dir, 'package.json')) ? dir : undefined\n}\n\n/**\n * The profile's direct dependencies that identify as Pi packages: not the\n * engine itself, not a `dsh.bundle` (those are DSH plugins, not Pi\n * packages), carrying either Pi's `pi` manifest field or extension sources\n * under Pi's directory conventions.\n */\nexport async function discoverProfilePiPackages(\n profileRoot: string,\n options: { exclude?: string[], warn?: (message: string) => void } = {},\n): Promise<DiscoveredPackage[]> {\n const warn = options.warn ?? (() => {})\n const excluded = new Set(options.exclude ?? [])\n const manifestText = await readFile(join(profileRoot, 'package.json'), 'utf8')\n const manifest = JSON.parse(manifestText) as { dependencies?: Record<string, string> }\n const discovered: DiscoveredPackage[] = []\n for (const name of Object.keys(manifest.dependencies ?? {})) {\n if (name === 'pi2dsh' || excluded.has(name)) continue\n const dir = resolveDependencyDir(profileRoot, name)\n if (dir === undefined) {\n warn(`[pi2dsh engine] dependency ${JSON.stringify(name)} is not installed under the profile; skipping`)\n continue\n }\n let packageJson: Record<string, unknown>\n try {\n packageJson = JSON.parse(await readFile(join(dir, 'package.json'), 'utf8')) as Record<string, unknown>\n } catch (error) {\n warn(`[pi2dsh engine] cannot read ${name}/package.json (${error instanceof Error ? error.message : String(error)}); skipping`)\n continue\n }\n // A dsh.bundle-declaring package is a DSH plugin layer, never a Pi package.\n if ((packageJson.dsh as { bundle?: unknown } | undefined)?.bundle !== undefined) continue\n if (packageJson.pi !== undefined && typeof packageJson.pi === 'object') {\n discovered.push({ name, dir })\n continue\n }\n // No `pi` field: fall back to Pi's directory conventions via the same\n // resolver every other mount path uses (a package with zero extension\n // sources is a plain library and stays unmounted).\n try {\n const pkg = await resolvePiPackage(dir)\n try {\n if (pkg.resources.extensions.length > 0) discovered.push({ name, dir })\n } finally {\n await pkg.dispose()\n }\n } catch {\n // Not resolvable as a Pi package — a plain library.\n }\n }\n return discovered\n}\n\n/** Cordis plugin surface: `dsh plugin add pi2dsh` mounts this. */\nexport const name = 'pi2dsh'\nexport const inject = ['tools', 'systemPrompt', 'commands', 'skills']\n\nexport async function apply(ctx: Context, config: EngineConfig = {}): Promise<void> {\n // Same emission as the runtime's logger helper: the cordis logger AND the\n // console — profile logger levels must never hide what the engine mounted.\n const log = (ctx as unknown as { logger?: { info?(m: string): void, warn?(m: string): void } }).logger\n const warn = (message: string): void => { log?.warn?.(message); console.warn(message) }\n const info = (message: string): void => { log?.info?.(message); console.log(message) }\n\n // The loader resolves plugins against the profile's baseUrl; that IS the\n // profile root. The ancestor walk from the installed engine is the\n // fallback for compositions without a loader (tests, hand-built hosts).\n const baseUrl = (ctx as unknown as { baseUrl?: string }).baseUrl\n const profileRoot = (baseUrl !== undefined ? findProfileRoot(fileURLToPath(new URL('.', baseUrl))) : undefined)\n ?? findProfileRoot(dirname(fileURLToPath(import.meta.url)))\n if (profileRoot === undefined) {\n throw new Error('pi2dsh engine: no DSH profile root (cordis.yml + package.json) above the installed engine — is pi2dsh installed via `dsh plugin add pi2dsh`?')\n }\n\n const packages = Array.isArray(config.packages) && config.packages.length > 0\n ? config.packages.map(name => ({ name }))\n : await discoverProfilePiPackages(profileRoot, {\n ...(Array.isArray(config.exclude) ? { exclude: config.exclude } : {}),\n warn,\n })\n if (packages.length === 0) {\n // Companion routes are the bridge's own capability — they work with\n // zero Pi packages installed.\n registerVisionCompanions(ctx, config.visionCompanions)\n info('[pi2dsh engine] no Pi packages installed in this profile yet — add one with: dsh plugin --profile <p> add <pi-package>')\n return\n }\n info(`[pi2dsh engine] mounting ${packages.length} Pi package(s): ${packages.map(pkg => pkg.name).join(', ')}`)\n await applyPiHost(\n ctx,\n {\n packages: packages.map(pkg => ({ name: pkg.name })),\n ...(config.visionCompanions === undefined ? {} : { visionCompanions: config.visionCompanions }),\n },\n join(profileRoot, 'package.json'),\n )\n}\n","// Engine surface: `dsh plugin add pi2dsh` resolves this entry as a cordis\n// plugin (named exports, no default — a default export would make the\n// loader discard the function-plugin namespace).\nexport { apply, inject, name, discoverProfilePiPackages, findProfileRoot, type EngineConfig } from './engine.js'\n\n// CLI-only analysis surfaces load lazily: their static-analysis dependency\n// (the 23 MB typescript compiler, an optional peer) must never be pulled\n// into a profile that installs the ENGINE. The dynamic imports below keep\n// analyzer/generator in their own chunks, off the engine's load path.\nimport type { CompatibilityReport, ResolvedPiPackage } from './types.js'\n\n/**\n * Static compatibility analysis of one resolved Pi package (CLI `inspect`).\n * @param pkg - the resolved package.\n * @returns the compatibility report.\n */\nexport async function analyzePackage(pkg: ResolvedPiPackage): Promise<CompatibilityReport> {\n const { analyzePackage: run } = await import('./analyzer.js')\n return run(pkg)\n}\n\n/**\n * Generate a vendored per-package bundle (CLI `convert`).\n * @param options - generation options (see the generator module).\n * @returns the generation result.\n */\nexport async function generateBundle(...args: Parameters<typeof import('./generator.js').generateBundle>): ReturnType<typeof import('./generator.js').generateBundle> {\n const { generateBundle: run } = await import('./generator.js')\n return run(...args)\n}\nexport {\n API_RULES,\n CONTEXT_RULES,\n EVENT_RULES,\n HOST_IMPORT_RULES,\n PI_AI_PACKAGES,\n PI_CODING_AGENT_PACKAGES,\n PI_TUI_PACKAGES,\n UI_CONTEXT_RULES,\n ruleForApi,\n ruleForContextProperty,\n ruleForEvent,\n ruleForHostImport,\n ruleForUiContextProperty,\n} from './compatibility.js'\nexport { applyPiHost, generateHostBundle, manifestForInstalled } from './host.js'\nexport { collectPiMcpServers, convertPiMcpConfig, renderMcpPatch } from './mcp-config.js'\nexport { resolvePiPackage } from './source.js'\nexport type * from './types.js'\n"],"mappings":";;;;;;;;;;;AA6CA,SAAgB,gBAAgB,OAAmC;CACjE,IAAI,MAAM;CACV,SAAS;EACP,IAAI,WAAW,KAAK,KAAK,YAAY,CAAC,KAAK,WAAW,KAAK,KAAK,cAAc,CAAC,GAAG,OAAO;EACzF,MAAM,SAAS,QAAQ,GAAG;EAC1B,IAAI,WAAW,KAAK,OAAO,KAAA;EAC3B,MAAM;CACR;AACF;AAOA,SAAS,qBAAqB,aAAqB,MAAkC;CAGnF,MAAM,MAAM,KAAK,aAAa,gBAAgB,IAAI;CAClD,OAAO,WAAW,KAAK,KAAK,cAAc,CAAC,IAAI,MAAM,KAAA;AACvD;;;;;;;AAQA,eAAsB,0BACpB,aACA,UAAoE,CAAC,GACvC;CAC9B,MAAM,OAAO,QAAQ,eAAe,CAAC;CACrC,MAAM,WAAW,IAAI,IAAI,QAAQ,WAAW,CAAC,CAAC;CAC9C,MAAM,eAAe,MAAM,SAAS,KAAK,aAAa,cAAc,GAAG,MAAM;CAC7E,MAAM,WAAW,KAAK,MAAM,YAAY;CACxC,MAAM,aAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,OAAO,KAAK,SAAS,gBAAgB,CAAC,CAAC,GAAG;EAC3D,IAAI,SAAS,YAAY,SAAS,IAAI,IAAI,GAAG;EAC7C,MAAM,MAAM,qBAAqB,aAAa,IAAI;EAClD,IAAI,QAAQ,KAAA,GAAW;GACrB,KAAK,8BAA8B,KAAK,UAAU,IAAI,EAAE,8CAA8C;GACtG;EACF;EACA,IAAI;EACJ,IAAI;GACF,cAAc,KAAK,MAAM,MAAM,SAAS,KAAK,KAAK,cAAc,GAAG,MAAM,CAAC;EAC5E,SAAS,OAAO;GACd,KAAK,+BAA+B,KAAK,iBAAiB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,YAAY;GAC7H;EACF;EAE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AK,wHAAwH;EAC7H;CACF;CACA,KAAK,4BAA4B,SAAS,OAAO,kBAAkB,SAAS,KAAI,QAAO,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG;CAC7G,MAAM,YACJ,KACA;EACE,UAAU,SAAS,KAAI,SAAQ,EAAE,MAAM,IAAI,KAAK,EAAE;EAClD,GAAI,OAAO,qBAAqB,KAAA,IAAY,CAAC,IAAI,EAAE,kBAAkB,OAAO,iBAAiB;CAC/F,GACA,KAAK,aAAa,cAAc,CAClC;AACF;;;;;;;;AClJA,eAAsB,eAAe,KAAsD;CACzF,MAAM,EAAE,gBAAgB,QAAQ,MAAM,OAAO;CAC7C,OAAO,IAAI,GAAG;AAChB;;;;;;AAOA,eAAsB,eAAe,GAAG,MAA8H;CACpK,MAAM,EAAE,gBAAgB,QAAQ,MAAM,OAAO;CAC7C,OAAO,IAAI,GAAG,IAAI;AACpB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/engine.ts","../src/index.ts"],"sourcesContent":["// The pi2dsh engine: ONE installed copy of the bridge that mounts every Pi\n// package the user has added to their DSH profile.\n//\n// dsh plugin --profile p add pi2dsh ← the engine (this plugin)\n// dsh plugin --profile p add @kassing/pi-vision ← plain npm dependency\n// dsh plugin --profile p add pi-vision-tool ← plain npm dependency\n//\n// DSH's plugin manager records only packages that declare `dsh.bundle` as\n// profile layers; everything else stays an ordinary dependency (\"a plain\n// library is fine\"). The engine reads the profile manifest's DIRECT\n// dependencies — every entry there was an explicit `dsh plugin add` — and\n// mounts each package that identifies as a Pi package, all through one\n// bridge instance: one model ledger, one command space, one upgrade unit.\n//\n// Discovery is manifest-driven, never a node_modules scan (the lesson from\n// Prettier 3 dropping directory-based plugin discovery): the dependency list\n// is the user's explicit intent, and package identification uses the same\n// Pi markers `resolvePiPackage` has always used (the `pi` manifest field,\n// with Pi's directory conventions as fallback).\n\nimport { readFile } from 'node:fs/promises'\nimport { existsSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { applyPiHost } from './host.js'\nimport { registerVisionCompanions } from './runtime.js'\nimport { resolvePiPackage } from './source.js'\n\nexport interface EngineConfig {\n /** Mount exactly these packages (skips discovery). */\n packages?: string[]\n /** Never mount these packages even when discovered. */\n exclude?: string[]\n /**\n * Image-admission companion routes. Default: AUTOMATIC — every text-only\n * llm route gets a \\`<route>-vision\\` companion that admits pasted images\n * (a mounted vision extension analyzes them; without one the image is\n * materialized to a file any image-capable tool can read). \\`false\\`\n * turns companions off; an explicit \\`{ <route>: [modelIds] }\\` narrows.\n */\n visionCompanions?: false | Record<string, readonly string[]>\n}\n\n/** Locate the DSH profile root: the nearest ancestor holding cordis.yml. */\nexport function findProfileRoot(start: string): string | undefined {\n let dir = start\n for (;;) {\n if (existsSync(join(dir, 'cordis.yml')) && existsSync(join(dir, 'package.json'))) return dir\n const parent = dirname(dir)\n if (parent === dir) return undefined\n dir = parent\n }\n}\n\ninterface DiscoveredPackage {\n name: string\n dir: string\n}\n\nfunction resolveDependencyDir(profileRoot: string, name: string): string | undefined {\n // Direct dependencies of the profile live under its node_modules by name\n // (pnpm links them there); resolving by path needs no exports gymnastics.\n const dir = join(profileRoot, 'node_modules', name)\n return existsSync(join(dir, 'package.json')) ? dir : undefined\n}\n\n/**\n * The profile's direct dependencies that identify as Pi packages: not the\n * engine itself, not a `dsh.bundle` (those are DSH plugins, not Pi\n * packages), carrying either Pi's `pi` manifest field or extension sources\n * under Pi's directory conventions.\n */\nexport async function discoverProfilePiPackages(\n profileRoot: string,\n options: { exclude?: string[], warn?: (message: string) => void } = {},\n): Promise<DiscoveredPackage[]> {\n const warn = options.warn ?? (() => {})\n const excluded = new Set(options.exclude ?? [])\n const manifestText = await readFile(join(profileRoot, 'package.json'), 'utf8')\n const manifest = JSON.parse(manifestText) as { dependencies?: Record<string, string> }\n const discovered: DiscoveredPackage[] = []\n for (const name of Object.keys(manifest.dependencies ?? {})) {\n if (name === 'pi2dsh' || excluded.has(name)) continue\n const dir = resolveDependencyDir(profileRoot, name)\n if (dir === undefined) {\n warn(`[pi2dsh engine] dependency ${JSON.stringify(name)} is not installed under the profile; skipping`)\n continue\n }\n let packageJson: Record<string, unknown>\n try {\n packageJson = JSON.parse(await readFile(join(dir, 'package.json'), 'utf8')) as Record<string, unknown>\n } catch (error) {\n warn(`[pi2dsh engine] cannot read ${name}/package.json (${error instanceof Error ? error.message : String(error)}); skipping`)\n continue\n }\n // A dsh.bundle-declaring package is a DSH plugin layer, never a Pi package.\n if ((packageJson.dsh as { bundle?: unknown } | undefined)?.bundle !== undefined) continue\n if (packageJson.pi !== undefined && typeof packageJson.pi === 'object') {\n discovered.push({ name, dir })\n continue\n }\n // No `pi` field: fall back to Pi's directory conventions via the same\n // resolver every other mount path uses (a package with zero extension\n // sources is a plain library and stays unmounted).\n try {\n const pkg = await resolvePiPackage(dir)\n try {\n if (pkg.resources.extensions.length > 0) discovered.push({ name, dir })\n } finally {\n await pkg.dispose()\n }\n } catch {\n // Not resolvable as a Pi package — a plain library.\n }\n }\n return discovered\n}\n\n/** Cordis plugin surface: `dsh plugin add pi2dsh` mounts this. */\nexport const name = 'pi2dsh'\nexport const inject = ['tools', 'systemPrompt', 'commands', 'skills']\n\nexport async function apply(ctx: Context, config: EngineConfig = {}): Promise<void> {\n // Same emission as the runtime's logger helper: the cordis logger AND the\n // console — profile logger levels must never hide what the engine mounted.\n const log = (ctx as unknown as { logger?: { info?(m: string): void, warn?(m: string): void } }).logger\n const warn = (message: string): void => { log?.warn?.(message); console.warn(message) }\n const info = (message: string): void => { log?.info?.(message); console.log(message) }\n\n // The loader resolves plugins against the profile's baseUrl; that IS the\n // profile root. The ancestor walk from the installed engine is the\n // fallback for compositions without a loader (tests, hand-built hosts).\n const baseUrl = (ctx as unknown as { baseUrl?: string }).baseUrl\n const profileRoot = (baseUrl !== undefined ? findProfileRoot(fileURLToPath(new URL('.', baseUrl))) : undefined)\n ?? findProfileRoot(dirname(fileURLToPath(import.meta.url)))\n if (profileRoot === undefined) {\n throw new Error('pi2dsh engine: no DSH profile root (cordis.yml + package.json) above the installed engine — is pi2dsh installed via `dsh plugin add pi2dsh`?')\n }\n\n const packages = Array.isArray(config.packages) && config.packages.length > 0\n ? config.packages.map(name => ({ name }))\n : await discoverProfilePiPackages(profileRoot, {\n ...(Array.isArray(config.exclude) ? { exclude: config.exclude } : {}),\n warn,\n })\n if (packages.length === 0) {\n // Companion routes are the bridge's own capability — they work with\n // zero Pi packages installed.\n registerVisionCompanions(ctx, config.visionCompanions)\n info('[pi2dsh engine] no Pi packages installed in this profile yet — add one with: dsh plugin --profile <p> add <pi-package>')\n return\n }\n info(`[pi2dsh engine] mounting ${packages.length} Pi package(s): ${packages.map(pkg => pkg.name).join(', ')}`)\n await applyPiHost(\n ctx,\n {\n packages: packages.map(pkg => ({ name: pkg.name })),\n ...(config.visionCompanions === undefined ? {} : { visionCompanions: config.visionCompanions }),\n },\n join(profileRoot, 'package.json'),\n )\n}\n","// Engine surface: `dsh plugin add pi2dsh` resolves this entry as a cordis\n// plugin (named exports, no default — a default export would make the\n// loader discard the function-plugin namespace).\nexport { apply, inject, name, discoverProfilePiPackages, findProfileRoot, type EngineConfig } from './engine.js'\n\n// The CLI-only analysis surface loads lazily: its static-analysis dependency\n// (the 23 MB typescript compiler, an optional peer) must never be pulled\n// into a profile that installs the ENGINE. The dynamic import below keeps\n// the analyzer in its own chunk, off the engine's load path.\nimport type { CompatibilityReport, ResolvedPiPackage } from './types.js'\n\n/**\n * Static compatibility analysis of one resolved Pi package (CLI `inspect`).\n * @param pkg - the resolved package.\n * @returns the compatibility report.\n */\nexport async function analyzePackage(pkg: ResolvedPiPackage): Promise<CompatibilityReport> {\n const { analyzePackage: run } = await import('./analyzer.js')\n return run(pkg)\n}\n\nexport {\n API_RULES,\n CONTEXT_RULES,\n EVENT_RULES,\n HOST_IMPORT_RULES,\n PI_AI_PACKAGES,\n PI_CODING_AGENT_PACKAGES,\n PI_TUI_PACKAGES,\n UI_CONTEXT_RULES,\n ruleForApi,\n ruleForContextProperty,\n ruleForEvent,\n ruleForHostImport,\n ruleForUiContextProperty,\n} from './compatibility.js'\nexport { applyPiHost, manifestForInstalled } from './host.js'\nexport { collectPiMcpServers, convertPiMcpConfig, renderMcpPatch } from './mcp-config.js'\nexport { resolvePiPackage } from './source.js'\nexport type * from './types.js'\n"],"mappings":";;;;;;;;;;;AA6CA,SAAgB,gBAAgB,OAAmC;CACjE,IAAI,MAAM;CACV,SAAS;EACP,IAAI,WAAW,KAAK,KAAK,YAAY,CAAC,KAAK,WAAW,KAAK,KAAK,cAAc,CAAC,GAAG,OAAO;EACzF,MAAM,SAAS,QAAQ,GAAG;EAC1B,IAAI,WAAW,KAAK,OAAO,KAAA;EAC3B,MAAM;CACR;AACF;AAOA,SAAS,qBAAqB,aAAqB,MAAkC;CAGnF,MAAM,MAAM,KAAK,aAAa,gBAAgB,IAAI;CAClD,OAAO,WAAW,KAAK,KAAK,cAAc,CAAC,IAAI,MAAM,KAAA;AACvD;;;;;;;AAQA,eAAsB,0BACpB,aACA,UAAoE,CAAC,GACvC;CAC9B,MAAM,OAAO,QAAQ,eAAe,CAAC;CACrC,MAAM,WAAW,IAAI,IAAI,QAAQ,WAAW,CAAC,CAAC;CAC9C,MAAM,eAAe,MAAM,SAAS,KAAK,aAAa,cAAc,GAAG,MAAM;CAC7E,MAAM,WAAW,KAAK,MAAM,YAAY;CACxC,MAAM,aAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,OAAO,KAAK,SAAS,gBAAgB,CAAC,CAAC,GAAG;EAC3D,IAAI,SAAS,YAAY,SAAS,IAAI,IAAI,GAAG;EAC7C,MAAM,MAAM,qBAAqB,aAAa,IAAI;EAClD,IAAI,QAAQ,KAAA,GAAW;GACrB,KAAK,8BAA8B,KAAK,UAAU,IAAI,EAAE,8CAA8C;GACtG;EACF;EACA,IAAI;EACJ,IAAI;GACF,cAAc,KAAK,M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;EAC3C,GAAI,MAAM,QAAQ,OAAO,OAAO,IAAI,EAAE,SAAS,OAAO,QAAQ,IAAI,CAAC;EACnE;CACF,CAAC;CACL,IAAI,SAAS,WAAW,GAAG;EAGzB,yBAAyB,KAAK,OAAO,gBAAgB;EACrD,KAAK,wHAAwH;EAC7H;CACF;CACA,KAAK,4BAA4B,SAAS,OAAO,kBAAkB,SAAS,KAAI,QAAO,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG;CAC7G,MAAM,YACJ,KACA;EACE,UAAU,SAAS,KAAI,SAAQ,EAAE,MAAM,IAAI,KAAK,EAAE;EAClD,GAAI,OAAO,qBAAqB,KAAA,IAAY,CAAC,IAAI,EAAE,kBAAkB,OAAO,iBAAiB;CAC/F,GACA,KAAK,aAAa,cAAc,CAClC;AACF;;;;;;;;AClJA,eAAsB,eAAe,KAAsD;CACzF,MAAM,EAAE,gBAAgB,QAAQ,MAAM,OAAO;CAC7C,OAAO,IAAI,GAAG;AAChB"}
|
|
@@ -229,38 +229,38 @@ const HOST_IMPORT_RULES = Object.freeze({
|
|
|
229
229
|
const CONTEXT_RULES = Object.freeze({
|
|
230
230
|
cwd: rule("full", "Mapped to the active DSH agent session working directory."),
|
|
231
231
|
signal: rule("full", "Mapped to the active DSH cancellation signal when one is available."),
|
|
232
|
-
hasUI: rule("full", "Reports whether
|
|
232
|
+
hasUI: rule("full", "Reports whether a human can actually answer: false when no questions service is mounted, false when the service is mounted with no provider registered (the headless posture), and false inside a child agent, which DSH refuses to let ask."),
|
|
233
233
|
mode: rule("partial", "Reports rpc mode so Pi extensions can choose their documented headless fallback."),
|
|
234
234
|
isIdle: rule("partial", "Command contexts report idle; tool/lifecycle contexts conservatively report non-idle."),
|
|
235
235
|
isProjectTrusted: rule("partial", "Fails closed as untrusted because DSH does not expose Pi project-trust state."),
|
|
236
|
-
hasPendingMessages: rule("
|
|
236
|
+
hasPendingMessages: rule("full", "Reads the DSH agent inbox — next-step plus next-turn input — which is exactly Pi's steering plus follow-up queue."),
|
|
237
237
|
getContextUsage: rule("partial", "Returns no Pi token-usage projection."),
|
|
238
238
|
getSystemPrompt: rule("full", "Returns the system prompt currently assembled by the bridge."),
|
|
239
239
|
getSystemPromptOptions: rule("partial", "Returns an empty Pi option projection in command contexts."),
|
|
240
240
|
waitForIdle: rule("partial", "Mapped to the DSH agent idle boundary when available."),
|
|
241
|
-
sessionManager: rule("partial", "A real read-only projection: DSH durable messages plus pi2dsh sidecar entries, exposed through Pi's exact 14-method surface as a single-branch tree."),
|
|
242
|
-
modelRegistry: rule("partial", "A live registry over the ONE model directory — the DSH llm directory — projected exactly into Pi vocabulary; package-registered Pi-native routes keep api/baseUrl and the full Model shape through the round trip. Custom gateways are HOST configuration (the official llm-pi-ai adapter's settings), never a Pi-side file: Pi's ~/.pi/agent/models.json is deliberately NOT read — user-facing configuration is DSH-shaped only. getProviderAuth/getApiKeyAndHeaders run Pi's full credential chain for package-registered providers and the host's configurable-provider + credentials seams for DSH routes. Host configuration may declare \"<route>-vision\" image-admission companions: real DSH routes that admit images, replace image blocks with explicit path-carrying notices (materialized attachment files any path-taking tool can read), and forward text-only to the original route; Pi's ctx.model reports the original route for a companion selection."),
|
|
241
|
+
sessionManager: rule("partial", "A real read-only projection: DSH durable messages plus pi2dsh sidecar entries, exposed through Pi's exact 14-method surface as a single-branch tree. buildContextEntries is compaction-aware — entries a compaction summarized away are gone, exactly as they are for the model — while getEntries stays the append-only log, which is the same split Pi makes."),
|
|
242
|
+
modelRegistry: rule("partial", "A live registry over the ONE model directory — the DSH llm directory — projected exactly into Pi vocabulary; package-registered Pi-native routes keep api/baseUrl and the full Model shape through the round trip. DSH describes one model across two seams (a listing for directory membership, an exact per-route resolve for capacity) while Pi puts everything on one Model object read synchronously, so the projection joins them when the directory is read: entries carry contextWindow, maxTokens and reasoning, and a settings change re-reads them rather than serving the retired numbers. Custom gateways are HOST configuration (the official llm-pi-ai adapter's settings), never a Pi-side file: Pi's ~/.pi/agent/models.json is deliberately NOT read — user-facing configuration is DSH-shaped only. getProviderAuth/getApiKeyAndHeaders run Pi's full credential chain for package-registered providers and the host's configurable-provider + credentials seams for DSH routes. Host configuration may declare \"<route>-vision\" image-admission companions: real DSH routes that admit images, replace image blocks with explicit path-carrying notices (materialized attachment files any path-taking tool can read), and forward text-only to the original route; Pi's ctx.model reports the original route for a companion selection."),
|
|
243
243
|
model: rule("partial", "The agent's real provider/model route (a setModel() override wins), enriched from the projected catalog. When the selected route is an image-admission companion, ctx.model reports the ORIGINAL route with its true modalities — the generating model is the original text-only one, which is the truth extensions branching on input modalities (a vision bridge's activation check) need."),
|
|
244
|
-
scopedModels: rule("
|
|
244
|
+
scopedModels: rule("full", "Empty, carrying Pi's own meaning for empty: no model scope is configured, so every available model is usable. DSH has no model-scope concept to narrow it."),
|
|
245
245
|
hasConfiguredAuth: rule("partial", "Configuration check on the projected registry: true when the model's provider has a live route or package registration (not a key-liveness probe)."),
|
|
246
246
|
thinkingLevel: rule("partial", "Reflects the level recorded by setThinkingLevel(); applied as reasoningEffort on the next request."),
|
|
247
247
|
abort: rule("partial", "Mapped to agent.cancel({ kind: \"hook\" }) on the live DSH agent."),
|
|
248
248
|
shutdown: rule("partial", "Pi defines shutdown behavior as host-provided (runner.ts bindExtensions); this host absorbs the request — the user owns DSH process exit — and informs the user once. The package keeps running."),
|
|
249
249
|
compact: rule("partial", "Pi's fire-and-forget trigger, translated to DSH's official manual compaction (ctx.compaction.compactNow on the live agent). onComplete receives the real summary text and the shadowed-content token estimate as tokensBefore; firstKeptEntryId is empty because the DSH log has no Pi entry ids. Without a compaction service the gap flows through Pi's onError callback and the capability ledger."),
|
|
250
|
-
newSession: rule("partial", "Really creates a DSH session (ctx.sessions.create) with parent lineage; withSession runs against a projection context bound to it. DSH has no host-level \"current session pointer\" a plugin could move — which session the surface shows stays a host choice, announced once."),
|
|
250
|
+
newSession: rule("partial", "Really creates a DSH session (ctx.sessions.create) with parent lineage; withSession runs against a projection context bound to it, whose sendMessage/sendUserMessage/appendEntry write into THAT session rather than the one the call came from. DSH has no host-level \"current session pointer\" a plugin could move — which session the surface shows stays a host choice, announced once."),
|
|
251
251
|
fork: rule("partial", "Really forks on DSH's official prefix-fork surface (ctx.sessions.fork with lineage metadata). Anchors are durable-log entries (projected ids \"dsh-<seq>\"); Pi's default position \"before\" is honored, and the boundary shrinks to the nearest completed-turn edge because DSH seeds must not split an open turn. Sidecar entries cannot anchor a fork."),
|
|
252
252
|
navigateTree: rule("partial", "Expressed through DSH's session model: the DSH tree lives BETWEEN sessions (fork lineage), not inside one log, so navigation forks at the target boundary. summarize runs Pi's vendored branch summarizer over the abandoned durable slice (model call on the DSH llm bridge) and lands the summary as a branch_summary entry in the new session's projection; label lands as a label entry."),
|
|
253
253
|
switchSession: rule("partial", "Targets a LIVE DSH session by id (or a Pi-style path whose basename is \"<id>.jsonl\"); withSession runs against its projection. Switching to persisted sessions is host-owned — resume them from the DSH surface first. Which session the surface shows stays a host choice."),
|
|
254
254
|
reload: rule("partial", "Really remounts every mounted package's extension entries through a fresh loader (registrations replaced via the same-name path, event handlers reset), so edited plugin code takes effect. Skills, prompts, and themes are host-managed and reload with dsh itself.")
|
|
255
255
|
});
|
|
256
256
|
const UI_CONTEXT_RULES = Object.freeze({
|
|
257
|
-
notify: rule("full", "Captured as a command result when applicable and emitted through DSH logging."),
|
|
257
|
+
notify: rule("full", "Captured as a command result when applicable and emitted through DSH logging at the severity the caller passed (warning and error log as warnings)."),
|
|
258
258
|
setStatus: rule("partial", "Accepted as a no-op because DSH owns status presentation."),
|
|
259
259
|
setWidget: rule("partial", "Accepted as a no-op because Pi terminal widgets cannot render in DSH."),
|
|
260
260
|
select: rule("full", "Mapped to one native DSH userQuestions single-select request."),
|
|
261
261
|
confirm: rule("full", "Mapped to one native DSH userQuestions Yes/No request."),
|
|
262
262
|
input: rule("full", "Mapped to one native DSH userQuestions free-text request."),
|
|
263
|
-
editor: rule("partial", "Mapped to one DSH userQuestions free-text request
|
|
263
|
+
editor: rule("partial", "Mapped to one DSH userQuestions free-text request. The prefill is shown as context but is NOT editable text: the caller receives what the user typed fresh, not an edit of the prefill."),
|
|
264
264
|
custom: rule("partial", "Resolves undefined, exactly like Pi's own rpc mode; guarded fallbacks keep working."),
|
|
265
265
|
onTerminalInput: rule("partial", "Raw terminal input is absent; feature-detected listeners remain disabled."),
|
|
266
266
|
setWorkingMessage: rule("partial", "Accepted as a no-op; DSH owns progress presentation."),
|
|
@@ -310,7 +310,7 @@ const API_RULES = Object.freeze({
|
|
|
310
310
|
},
|
|
311
311
|
registerProvider: {
|
|
312
312
|
level: "partial",
|
|
313
|
-
detail: "
|
|
313
|
+
detail: "Two outcomes, by whether the provider carries its own transport. WITH a transport (pi-ai createProvider and friends): it becomes a real DSH llm route through llm.registerAdapter, and from then on the package's own HTTP client carries the turn — its API key or OAuth token is resolved by Pi's credential chain and persisted in the bridge's auth.json, not by DSH credentials. WITHOUT one (catalog-only): the declaration is recorded and introspectable, no bridge transport is synthesized, and model calls stay on native DSH llm adapters and credentials."
|
|
314
314
|
},
|
|
315
315
|
unregisterProvider: {
|
|
316
316
|
level: "partial",
|
|
@@ -330,7 +330,7 @@ const API_RULES = Object.freeze({
|
|
|
330
330
|
},
|
|
331
331
|
sendMessage: {
|
|
332
332
|
level: "partial",
|
|
333
|
-
detail: "
|
|
333
|
+
detail: "Durable by the time it returns, as in Pi: the no-turn call appends to the session log and announces its message events immediately, so the message IS in the conversation when the call resolves. Steering and follow-up drive a turn through the agent. Pi display/details metadata awaits the custom session-entry seam."
|
|
334
334
|
},
|
|
335
335
|
sendUserMessage: {
|
|
336
336
|
level: "full",
|
|
@@ -341,12 +341,12 @@ const API_RULES = Object.freeze({
|
|
|
341
341
|
detail: "Persisted in a pi2dsh sidecar next to the DSH session and replayed on session start; DSH's main log stays untouched because it has no out-of-repo plugin-event channel yet."
|
|
342
342
|
},
|
|
343
343
|
setSessionName: {
|
|
344
|
-
level: "
|
|
345
|
-
detail: "
|
|
344
|
+
level: "full",
|
|
345
|
+
detail: "Renames the DSH session through ctx.sessionTitle, so every DSH surface shows it and the title is pinned against automatic regeneration, and announces it through session_info_changed. A composition that mounts no title service falls back to the pi2dsh sidecar, as does a blank name (DSH requires visible characters in a title; Pi does not)."
|
|
346
346
|
},
|
|
347
347
|
getSessionName: {
|
|
348
|
-
level: "
|
|
349
|
-
detail: "Reads the sidecar
|
|
348
|
+
level: "full",
|
|
349
|
+
detail: "Reads DSH's own session title, so it agrees with what DSH displays and sees titles DSH generated itself; falls back to the sidecar when no title service is mounted."
|
|
350
350
|
},
|
|
351
351
|
setLabel: {
|
|
352
352
|
level: "partial",
|
|
@@ -366,7 +366,7 @@ const API_RULES = Object.freeze({
|
|
|
366
366
|
},
|
|
367
367
|
setActiveTools: {
|
|
368
368
|
level: "partial",
|
|
369
|
-
detail: "Mapped to the active DSH agent scope through tools.restrict
|
|
369
|
+
detail: "Mapped to the active DSH agent scope through tools.restrict, per-agent and without mutating other agents. Names DSH does not know are skipped exactly as Pi skips them. A tool DSH does not permit restricting (a scope's own registration, or a reserved transport name) cannot be deactivated at all and is reported once rather than silently left running."
|
|
370
370
|
},
|
|
371
371
|
getCommands: {
|
|
372
372
|
level: "partial",
|
|
@@ -416,7 +416,7 @@ const EVENT_RULES = Object.freeze({
|
|
|
416
416
|
},
|
|
417
417
|
turn_start: {
|
|
418
418
|
level: "full",
|
|
419
|
-
detail: "
|
|
419
|
+
detail: "Fires once per MODEL CALL, as in Pi — DSH calls that a step — with turnIndex counting from zero and resetting at each new prompt."
|
|
420
420
|
},
|
|
421
421
|
tool_execution_start: {
|
|
422
422
|
level: "full",
|
|
@@ -432,7 +432,7 @@ const EVENT_RULES = Object.freeze({
|
|
|
432
432
|
},
|
|
433
433
|
tool_call: {
|
|
434
434
|
level: "partial",
|
|
435
|
-
detail: "Blocking is supported,
|
|
435
|
+
detail: "Blocking is supported, in-place argument mutation reaches migrated Pi tools, and `terminate` follows Pi's batch rule — the loop stops after a tool batch only when every call in it was blocked asking to stop. Mutating a DSH-native tool's arguments is rejected because DSH logs arguments before policy."
|
|
436
436
|
},
|
|
437
437
|
tool_result: {
|
|
438
438
|
level: "partial",
|
|
@@ -440,15 +440,15 @@ const EVENT_RULES = Object.freeze({
|
|
|
440
440
|
},
|
|
441
441
|
before_agent_start: {
|
|
442
442
|
level: "full",
|
|
443
|
-
detail: "Fires
|
|
443
|
+
detail: "Fires once per user prompt, inside the assembly of the turn it belongs to, with the real prompt text and image attachments; returned custom messages enter that same turn beside the user message, and a returned systemPrompt overrides that turn's own assembly and resets at the next turn."
|
|
444
444
|
},
|
|
445
445
|
agent_end: {
|
|
446
446
|
level: "partial",
|
|
447
447
|
detail: "The lifecycle boundary is mapped, but the reconstructed Pi message history is intentionally minimal."
|
|
448
448
|
},
|
|
449
449
|
turn_end: {
|
|
450
|
-
level: "
|
|
451
|
-
detail: "
|
|
450
|
+
level: "full",
|
|
451
|
+
detail: "Fires once per MODEL CALL, as in Pi — DSH calls that a step — carrying that call's own assistant message and its own tool results, with turnIndex counting model calls from zero and resetting each prompt."
|
|
452
452
|
},
|
|
453
453
|
message_start: {
|
|
454
454
|
level: "partial",
|
|
@@ -468,7 +468,7 @@ const EVENT_RULES = Object.freeze({
|
|
|
468
468
|
},
|
|
469
469
|
session_compact: {
|
|
470
470
|
level: "partial",
|
|
471
|
-
detail: "
|
|
471
|
+
detail: "Fires once per SUCCESSFUL compaction, from DSH's summary event, with the summary rendered to the string Pi's CompactionEntry declares. A manual compaction is identified as manual; DSH does not record which automatic trigger fired, so automatic ones report \"threshold\" and willRetry is always false."
|
|
472
472
|
},
|
|
473
473
|
model_select: {
|
|
474
474
|
level: "partial",
|
|
@@ -704,4 +704,4 @@ function renderMcpPatch(result) {
|
|
|
704
704
|
//#endregion
|
|
705
705
|
export { CONTEXT_RULES as a, PI_AI_PACKAGES as c, UI_CONTEXT_RULES as d, ruleForApi as f, ruleForUiContextProperty as g, ruleForHostImport as h, API_RULES as i, PI_CODING_AGENT_PACKAGES as l, ruleForEvent as m, convertPiMcpConfig as n, EVENT_RULES as o, ruleForContextProperty as p, renderMcpPatch as r, HOST_IMPORT_RULES as s, collectPiMcpServers as t, PI_TUI_PACKAGES as u };
|
|
706
706
|
|
|
707
|
-
//# sourceMappingURL=mcp-config-
|
|
707
|
+
//# sourceMappingURL=mcp-config-DHkfjdvX.mjs.map
|