pi2dsh 0.13.0 → 0.13.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.
Files changed (32) hide show
  1. package/README.md +35 -26
  2. package/README.zh.md +30 -21
  3. package/dist/{analyzer-CXNbeBAe.mjs → analyzer-CJFwQlSG.mjs} +2 -2
  4. package/dist/{analyzer-CXNbeBAe.mjs.map → analyzer-CJFwQlSG.mjs.map} +1 -1
  5. package/dist/cli.mjs +2 -2
  6. package/dist/compat/pi-ai.d.mts +2281 -5
  7. package/dist/compat/pi-ai.d.mts.map +1 -1
  8. package/dist/compat/pi-ai.mjs +2 -2
  9. package/dist/compat/pi-coding-agent.mjs +1 -1
  10. package/dist/{credentials-oauth-BakY-0PA.mjs → credentials-oauth-Txs6oew8.mjs} +13 -6
  11. package/dist/credentials-oauth-Txs6oew8.mjs.map +1 -0
  12. package/dist/credentials-oauth.mjs +1 -1
  13. package/dist/host.mjs +1 -1
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +18 -4
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/{mcp-config-CZepacin.mjs → mcp-config-_idn-pzI.mjs} +8 -7
  18. package/dist/mcp-config-_idn-pzI.mjs.map +1 -0
  19. package/dist/pi-ai-D7PqVeWs.mjs +11717 -0
  20. package/dist/pi-ai-D7PqVeWs.mjs.map +1 -0
  21. package/dist/{pi-coding-agent-D9skobb6.mjs → pi-coding-agent-BVZu0dHG.mjs} +0 -0
  22. package/dist/{pi-coding-agent-D9skobb6.mjs.map → pi-coding-agent-BVZu0dHG.mjs.map} +1 -1
  23. package/dist/{runtime-B-SlR8mJ.mjs → runtime-DEjs_Qlf.mjs} +143 -18
  24. package/dist/runtime-DEjs_Qlf.mjs.map +1 -0
  25. package/dist/runtime.d.mts.map +1 -1
  26. package/dist/runtime.mjs +1 -1
  27. package/package.json +30 -32
  28. package/dist/credentials-oauth-BakY-0PA.mjs.map +0 -1
  29. package/dist/mcp-config-CZepacin.mjs.map +0 -1
  30. package/dist/pi-ai-BA3V_J0V.mjs +0 -3104
  31. package/dist/pi-ai-BA3V_J0V.mjs.map +0 -1
  32. package/dist/runtime-B-SlR8mJ.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pi-ai.d.mts","names":[],"sources":["../../src/compat/vendor/pi-ai-overflow.ts","../../src/compat/vendor/pi-ai-retry.ts","../../src/compat/vendor/pi-uuid.ts","../../src/compat/vendor/pi-ai-provider.ts","../../src/compat/vendor/pi-ai-event-stream.ts","../../src/compat/vendor/pi-ai-lazy.ts","../../src/compat/vendor/pi-oauth-flows/openai-codex.ts","../../src/compat/vendor/pi-oauth-flows/anthropic.ts","../../src/compat/vendor/pi-oauth-flows/github-copilot.ts","../../src/compat/vendor/pi-oauth-flows/kimi-coding.ts","../../src/compat/vendor/pi-oauth-flows/pkce.ts","../../src/compat/vendor/pi-oauth-flows/device-code.ts","../../src/compat/pi-ai.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsIgB,kBAAkB,SAAS,kBAAkB;;;;;;;iBAqC7C,oBAAoB,SAAS,kBAAkB;;;;;;;;;;;;iBCoD/C,0BAA0B,SAAS;;;;iBChNnC;;;cCLH,oBAAoB;EAC7B;EACY,YAAA,WAAM,cAAS;;;;;;;;iBAYf,eAAe;;;;;;;oCAAf;;;;;;;cCtBH;EACT;EACA;EACA;EACA,oBAAkB;EAClB;EACA;EACA;EACY,YAAA,iBAAY;EAOxB,KAAK;EAgBL,IAAI;GAWI,OAAO,kBAAc;EAgB7B,UAAM;;cAIG,oCAAoC;EAAA;;;;;;;;;iBC5BjC,WAAW,YAAO,aAAK;iBAWvB,QAAQ,WAAM;sDAAd;4DAAA;;;;cC2XH;;;;;;;;;;;;;;;;;;;;;;;iBC7OE,eAAe,mBAAW;;;;;;cA+G5B;;;;;;;;;;;;;;;;iBCvBE,mBAAmB,mBAAW;;;;;;;;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7C,0BAAyB,kBAAkB;cAC3C,+BAA8B,kBAAkB;cAChD,+BAA8B,kBAAkB;cAChD,6BAA4B,kBAAkB;cAC9C,uBAAsB,kBAAkB;cACxC,+BAA8B,kBAAkB;cAChD,gCAA+B,kBAAkB;cACjD,qBAAoB,kBAAkB;UAElC,kBAAkB;EACjC;EACA,UAAU;;iBAGI,WAAW,6BACzB,QAAQ,GACR,UAAS,kBAAkB;EACxB;EAAgB,MAAM;EAAG;EAAsB,UAAU"}
1
+ {"version":3,"file":"pi-ai.d.mts","names":[],"sources":["../../src/compat/vendor/pi-ai-overflow.ts","../../src/compat/vendor/pi-ai-retry.ts","../../src/compat/vendor/pi-uuid.ts","../../src/compat/vendor/pi-ai-provider.ts","../../src/compat/vendor/pi-ai-event-stream.ts","../../src/compat/vendor/pi-ai-lazy.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/utility.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/header.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/readable.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/fetch.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/formdata.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/connector.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/client-stats.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/client.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/errors.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/dispatcher.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/.pnpm/undici-types@7.18.2/node_modules/undici-types/mock-agent.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/utility.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/header.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/readable.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/fetch.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/formdata.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/connector.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/client-stats.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/client.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/errors.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/dispatcher.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/mock-interceptor.d.ts","../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/types/mock-agent.d.ts","../../node_modules/.pnpm/@earendil-works+pi-telemetry@0.84.1/node_modules/@earendil-works/pi-telemetry/dist/index.d.ts","../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts","../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts","../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/types.d.ts","../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts","../../src/compat/vendor/pi-oauth-flows/openai-codex.ts","../../src/compat/vendor/pi-oauth-flows/anthropic.ts","../../src/compat/vendor/pi-oauth-flows/github-copilot.ts","../../src/compat/vendor/pi-oauth-flows/kimi-coding.ts","../../src/compat/vendor/pi-oauth-flows/pkce.ts","../../src/compat/vendor/pi-oauth-flows/device-code.ts","../../src/compat/pi-ai.ts"],"x_google_ignoreList":[6,7,8,9,10,11,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;EAAa;EAAiB;EAAiB;IAAQ;;;cAYhH,4BAAiC;cACjC,0BAA+B;cAC/B,8BAAmC;cACnC,2BAAgC;UASnC;EACR;EACA,YAAY;EACZ,kBAAkB;;iBAaJ,oBAAoB,UAAU,mBAAmB;iBAWjD,eAAe,cAAc;iBAI7B,mBAAmB;iBAInB,uBAAuB;KAUlC,iBAAiB,OAAO,eAAe,SAAS,eAAe,SAAS;EAC3E,UAAU;GACT,OAAO,kBAAkB;;KAGvB,gBAAgB;iBAIL,mBAAmB,QAAQ;iBAS3B,sBAAsB;iBAWhB,SAAS,OAAO,eAAe,SAAS,eAAe,UAAU,gBAAgB;iBAOvF,OAAO,OAAO,eAAe,SAAS,eAAe,UAAU;;;;;;;;;;;;;;;;;;iBAqBtE,UAAU;EAAgB;EAAa,QAAQ;EAAe,cAAc;;cAKxE,4BAA2B,kBAAkB;cAC7C,4BAA2B,kBAAkB;cAC7C,0BAAyB,kBAAkB;cAC3C,+BAA8B,kBAAkB;cAChD,+BAA8B,kBAAkB;cAChD,6BAA4B,kBAAkB;cAC9C,uBAAsB,kBAAkB;cACxC,+BAA8B,kBAAkB;cAChD,gCAA+B,kBAAkB;cACjD,qBAAoB,kBAAkB;UAElC,kBAAkB;EACjC;EACA,UAAU;;iBAGI,WAAW,6BACzB,QAAQ,GACR,UAAS,kBAAkB;EACxB;EAAgB,MAAM;EAAG;EAAsB,UAAU"}
@@ -1,3 +1,3 @@
1
1
 
2
- import { $ as uuidv7, A as openAICodexResponsesApi, B as anthropicOAuth, C as googleVertexApi, D as loadOpenAICodexOAuth, E as loadKimiCodingOAuth, F as registerProvider, G as createProvider, H as generatePKCE, I as stream, J as AssistantMessageEventStream, K as lazyApi, L as unregisterApiProviders, M as openAIResponsesApi, N as piMessagesApi, O as mistralConversationsApi, P as registerApiProvider, R as kimiCodingOAuth, S as googleGenerativeAIApi, T as loadGitHubCopilotOAuth, U as pollOAuthDeviceCodeFlow, V as openaiCodexOAuth, W as ModelsError, X as isRecoverableLength, Y as isContextOverflow, Z as isRetryableAssistantError, _ as getModel, a as anthropicMessagesApi, b as getProviders, c as builtinProviders, d as contentText, f as getApiProvider, g as getBuiltinProviders, h as getBuiltinModels, i as __setPiAiLlmBridge, j as openAICompletionsApi, k as modelsAreEqual, l as clampThinkingLevel, m as getBuiltinModel, n as Type, o as azureOpenAIResponsesApi, p as getApiProviders, q as lazyStream, r as __getPiAiLlmBridge, s as bedrockConverseStreamApi, t as StringEnum, u as complete, v as getModels, w as loadAnthropicOAuth, x as getSupportedThinkingLevels, y as getProvider, z as githubCopilotOAuth } from "../pi-ai-BA3V_J0V.mjs";
3
- export { AssistantMessageEventStream, ModelsError, StringEnum, Type, __getPiAiLlmBridge, __setPiAiLlmBridge, anthropicMessagesApi, anthropicOAuth, azureOpenAIResponsesApi, bedrockConverseStreamApi, builtinProviders, clampThinkingLevel, complete, contentText, createProvider, generatePKCE, getApiProvider, getApiProviders, getBuiltinModel, getBuiltinModels, getBuiltinProviders, getModel, getModels, getProvider, getProviders, getSupportedThinkingLevels, githubCopilotOAuth, googleGenerativeAIApi, googleVertexApi, isContextOverflow, isRecoverableLength, isRetryableAssistantError, kimiCodingOAuth, lazyApi, lazyStream, loadAnthropicOAuth, loadGitHubCopilotOAuth, loadKimiCodingOAuth, loadOpenAICodexOAuth, mistralConversationsApi, modelsAreEqual, openAICodexResponsesApi, openAICompletionsApi, openAIResponsesApi, openaiCodexOAuth, piMessagesApi, pollOAuthDeviceCodeFlow, registerApiProvider, registerProvider, stream, unregisterApiProviders, uuidv7 };
2
+ import { A as openAICodexResponsesApi, B as anthropicOAuth, C as googleVertexApi, D as loadOpenAICodexOAuth, E as loadKimiCodingOAuth, F as registerProvider, G as ModelsError, H as generatePKCE, I as stream, J as lazyStream, K as createProvider, L as unregisterApiProviders, M as openAIResponsesApi, N as piMessagesApi, O as mistralConversationsApi, P as registerApiProvider, Q as isRetryableAssistantError, R as kimiCodingOAuth, S as googleGenerativeAIApi, T as loadGitHubCopilotOAuth, U as pollOAuthDeviceCodeFlow, V as openaiCodexOAuth, W as streamSimple, X as isContextOverflow, Y as AssistantMessageEventStream, Z as isRecoverableLength, _ as getModel, a as anthropicMessagesApi, b as getProviders, c as builtinProviders, d as contentText, et as uuidv7, f as getApiProvider, g as getBuiltinProviders, h as getBuiltinModels, i as __setPiAiLlmBridge, j as openAICompletionsApi, k as modelsAreEqual, l as clampThinkingLevel, m as getBuiltinModel, n as Type, o as azureOpenAIResponsesApi, p as getApiProviders, q as lazyApi, r as __getPiAiLlmBridge, s as bedrockConverseStreamApi, t as StringEnum, u as complete, v as getModels, w as loadAnthropicOAuth, x as getSupportedThinkingLevels, y as getProvider, z as githubCopilotOAuth } from "../pi-ai-D7PqVeWs.mjs";
3
+ export { AssistantMessageEventStream, ModelsError, StringEnum, Type, __getPiAiLlmBridge, __setPiAiLlmBridge, anthropicMessagesApi, anthropicOAuth, azureOpenAIResponsesApi, bedrockConverseStreamApi, builtinProviders, clampThinkingLevel, complete, contentText, createProvider, generatePKCE, getApiProvider, getApiProviders, getBuiltinModel, getBuiltinModels, getBuiltinProviders, getModel, getModels, getProvider, getProviders, getSupportedThinkingLevels, githubCopilotOAuth, googleGenerativeAIApi, googleVertexApi, isContextOverflow, isRecoverableLength, isRetryableAssistantError, kimiCodingOAuth, lazyApi, lazyStream, loadAnthropicOAuth, loadGitHubCopilotOAuth, loadKimiCodingOAuth, loadOpenAICodexOAuth, mistralConversationsApi, modelsAreEqual, openAICodexResponsesApi, openAICompletionsApi, openAIResponsesApi, openaiCodexOAuth, piMessagesApi, pollOAuthDeviceCodeFlow, registerApiProvider, registerProvider, stream, streamSimple as streamSimpleOpenAIResponses, unregisterApiProviders, uuidv7 };
@@ -1,4 +1,4 @@
1
1
 
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-D9skobb6.mjs";
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-BVZu0dHG.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
- import { c as builtinProviders } from "./pi-ai-BA3V_J0V.mjs";
3
- import "./pi-coding-agent-D9skobb6.mjs";
2
+ import { c as builtinProviders } from "./pi-ai-D7PqVeWs.mjs";
3
+ import "./pi-coding-agent-BVZu0dHG.mjs";
4
4
  import { t as getAgentDir } from "./pi-config-shim-CZ1wFzqM.mjs";
5
5
  import { mkdir, rename, writeFile } from "node:fs/promises";
6
6
  import { existsSync, readFileSync } from "node:fs";
@@ -345,7 +345,7 @@ function openIfPossible(open, url) {
345
345
  open(url);
346
346
  } catch {}
347
347
  }
348
- function oauthInteraction(ui, signal, shorten, open) {
348
+ function oauthInteraction(ui, signal, shorten, open, cancel) {
349
349
  const effectiveSignal = signal ?? new AbortController().signal;
350
350
  let pending;
351
351
  /**
@@ -383,8 +383,15 @@ function oauthInteraction(ui, signal, shorten, open) {
383
383
  openIfPossible(open, event.url);
384
384
  } else if (event.type === "device_code") {
385
385
  const window = typeof event.expiresInSeconds === "number" && event.expiresInSeconds > 0 ? ` (valid for ${Math.round(event.expiresInSeconds / 60)} min)` : "";
386
- pending = `[Open the device login page](${event.verificationUri}) and enter code \`${event.userCode}\`${window}`;
386
+ const detail = `[Open the device login page](${event.verificationUri}) and enter code \`${event.userCode}\`${window}`;
387
+ pending = detail;
387
388
  ui.notify(`Visit ${event.verificationUri} and enter code ${event.userCode}${window}`);
389
+ if (ui.deviceCode !== void 0) {
390
+ pending = void 0;
391
+ ui.deviceCode("Complete login in your browser", detail, effectiveSignal).then(() => {
392
+ if (!effectiveSignal.aborted) cancel?.();
393
+ }, () => void 0);
394
+ }
388
395
  openIfPossible(open, event.verificationUri);
389
396
  } else if (event.message !== void 0) ui.notify(event.message);
390
397
  }
@@ -411,7 +418,7 @@ async function loginPiProvider(options) {
411
418
  else options.signal.addEventListener("abort", () => done.abort(), { once: true });
412
419
  }
413
420
  try {
414
- const credential = await adapter.login(oauthInteraction(options.ui, done.signal, options.shorten, options.open));
421
+ const credential = await adapter.login(oauthInteraction(options.ui, done.signal, options.shorten, options.open, () => done.abort()));
415
422
  await options.store.modify(options.providerId, async () => credential);
416
423
  return credential;
417
424
  } finally {
@@ -531,4 +538,4 @@ function apply(ctx, config = {}) {
531
538
  //#endregion
532
539
  export { FileCredentialStore as a, providerSupportsOAuth as c, oauthCredentialRef as i, resolvePiProviderAuth as l, apply as n, joinSignals as o, name as r, loginPiProvider as s, PiOAuthCredentialProvider as t, storedOAuthCredential as u };
533
540
 
534
- //# sourceMappingURL=credentials-oauth-BakY-0PA.mjs.map
541
+ //# sourceMappingURL=credentials-oauth-Txs6oew8.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-oauth-Txs6oew8.mjs","names":["#path","#persist"],"sources":["../src/compat/vendor/pi-ai-abort.ts","../src/compat/vendor/pi-ai-credential-store.ts","../src/compat/vendor/pi-ai-diagnostics.ts","../src/compat/vendor/pi-ai-auth-resolve.ts","../src/compat/vendor/pi-oauth-adapt.ts","../src/oauth-bridge.ts","../src/credentials-oauth.ts"],"sourcesContent":["// @ts-nocheck — vendored Pi source (pi-ai utils/abort.js @0.84.1, MIT, see ./PI-LICENSE); unchanged.\nfunction abortReason(signal) {\n if (signal.reason !== undefined)\n return signal.reason;\n const error = new Error(\"The operation was aborted\");\n error.name = \"AbortError\";\n return error;\n}\n/** Create an operation-local signal for public APIs whose signal is optional. */\nexport function operationSignal(signal) {\n return signal ?? new AbortController().signal;\n}\n/**\n * Stop waiting for an operation when its signal aborts while continuing to\n * observe the abandoned promise so a later rejection is always handled.\n */\nexport function raceWithAbortSignal(operation, signal) {\n if (signal.aborted) {\n void operation.catch(() => { });\n return Promise.reject(abortReason(signal));\n }\n return new Promise((resolve, reject) => {\n let settled = false;\n const cleanup = () => signal.removeEventListener(\"abort\", onAbort);\n const onAbort = () => {\n if (settled)\n return;\n settled = true;\n cleanup();\n reject(abortReason(signal));\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n void operation.then((value) => {\n if (settled)\n return;\n settled = true;\n cleanup();\n resolve(value);\n }, (error) => {\n if (settled)\n return;\n settled = true;\n cleanup();\n reject(error);\n });\n if (signal.aborted)\n onAbort();\n });\n}\n//# sourceMappingURL=abort.js.map","// @ts-nocheck — vendored Pi source (pi-ai auth/credential-store.js @0.84.1, MIT, see ./PI-LICENSE); import remapped, logic unchanged.\nimport { operationSignal, raceWithAbortSignal } from './pi-ai-abort.js';\n/**\n * Default in-memory credential store. Apps inject persistent stores.\n * Keyed by `Provider.id`, one credential per provider; see `CredentialStore`.\n * Writes are serialized per provider through a promise chain.\n */\nexport class InMemoryCredentialStore {\n credentials = new Map();\n chains = new Map();\n /** Serialize tasks per provider id without releasing the chain before active work settles. */\n enqueue(providerId, task, options) {\n const signal = operationSignal(options?.signal);\n const previous = this.chains.get(providerId) ?? Promise.resolve();\n const queued = (async () => {\n await previous.catch(() => { });\n signal.throwIfAborted();\n return task();\n })();\n const tail = queued.catch(() => { });\n this.chains.set(providerId, tail);\n void tail.then(() => {\n if (this.chains.get(providerId) === tail)\n this.chains.delete(providerId);\n });\n return raceWithAbortSignal(queued, signal);\n }\n async read(providerId, options) {\n options?.signal?.throwIfAborted();\n return this.credentials.get(providerId);\n }\n async list(options) {\n options?.signal?.throwIfAborted();\n return [...this.credentials].map(([providerId, credential]) => ({ providerId, type: credential.type }));\n }\n modify(providerId, fn, options) {\n return this.enqueue(providerId, async () => {\n const current = this.credentials.get(providerId);\n const next = await fn(current);\n options?.signal?.throwIfAborted();\n if (next !== undefined)\n this.credentials.set(providerId, next);\n return next ?? current;\n }, options);\n }\n delete(providerId, options) {\n return this.enqueue(providerId, async () => {\n this.credentials.delete(providerId);\n }, options);\n }\n}\n//# sourceMappingURL=credential-store.js.map","// @ts-nocheck — vendored Pi source (pi-ai utils/diagnostics.js @0.84.1, MIT, see ./PI-LICENSE); unchanged.\nexport function formatThrownValue(value) {\n if (value instanceof Error)\n return value.message || value.name;\n if (typeof value === \"string\")\n return value;\n return String(value);\n}\nexport function extractDiagnosticError(error) {\n if (!(error instanceof Error))\n return { name: \"ThrownValue\", message: formatThrownValue(error) };\n const code = error.code;\n return {\n name: error.name || undefined,\n message: error.message || error.name,\n stack: error.stack,\n code: typeof code === \"string\" || typeof code === \"number\" ? code : undefined,\n };\n}\nexport function createAssistantMessageDiagnostic(type, error, details) {\n return { type, timestamp: Date.now(), error: extractDiagnosticError(error), details };\n}\nexport function appendAssistantMessageDiagnostic(message, diagnostic) {\n message.diagnostics = [...(message.diagnostics ?? []), diagnostic];\n}\n//# sourceMappingURL=diagnostics.js.map","// @ts-nocheck — vendored Pi source (pi-ai auth/resolve.js @0.84.1, MIT, see ./PI-LICENSE); imports remapped, logic unchanged\n// (double-checked-lock OAuth refresh with persistence, no silent env fallback).\nimport { operationSignal, raceWithAbortSignal } from './pi-ai-abort.js';\nimport { formatThrownValue } from './pi-ai-diagnostics.js';\nexport class ModelsError extends Error {\n code;\n constructor(code, message, options) {\n super(withCauseDetail(message, options?.cause), options);\n this.name = \"ModelsError\";\n this.code = code;\n }\n}\n/** Callers surface `error.message` only, so keep the underlying reason in it. */\nfunction withCauseDetail(message, cause) {\n if (cause === undefined || cause === null)\n return message;\n const detail = formatThrownValue(cause).trim();\n if (!detail || message.includes(detail))\n return message;\n return `${message}: ${detail}`;\n}\n/**\n * Auth resolution shared by the `Models` and `ImagesModels` collections.\n * A stored credential owns the provider: ambient/env is consulted only when\n * nothing is stored. No silent env fallback after a failed refresh or for a\n * credential type without a matching handler.\n */\nexport function resolveProviderAuth(provider, credentials, authContext, overrides) {\n const signal = operationSignal(overrides?.signal);\n return raceWithAbortSignal(resolveProviderAuthWithSignal(provider, credentials, authContext, overrides, signal), signal);\n}\nasync function resolveProviderAuthWithSignal(provider, credentials, authContext, overrides, signal) {\n signal.throwIfAborted();\n const requestAuthContext = overrides?.env ? overlayEnvAuthContext(authContext, overrides.env) : authContext;\n if (overrides?.apiKey !== undefined && provider.auth.apiKey) {\n return resolveApiKey(requestAuthContext, provider.auth.apiKey, provider.id, {\n type: \"api_key\",\n key: overrides.apiKey,\n env: overrides.env,\n }, signal);\n }\n const stored = await readCredential(credentials, provider.id, signal);\n if (stored) {\n if (stored.type === \"oauth\" && provider.auth.oauth) {\n return resolveStoredOAuth(credentials, provider.id, provider.auth.oauth, stored, signal, overrides?.minOAuthValidityMs);\n }\n if (stored.type === \"api_key\" && provider.auth.apiKey) {\n const credential = overrides?.env ? { ...stored, env: { ...stored.env, ...overrides.env } } : stored;\n return resolveApiKey(requestAuthContext, provider.auth.apiKey, provider.id, credential, signal);\n }\n return undefined;\n }\n // Ambient (env vars, AWS profiles, ADC files).\n return provider.auth.apiKey\n ? resolveApiKey(requestAuthContext, provider.auth.apiKey, provider.id, undefined, signal)\n : undefined;\n}\nfunction overlayEnvAuthContext(base, env) {\n return {\n env: async (name) => env[name] || (await base.env(name)),\n fileExists: (path) => base.fileExists(path),\n };\n}\nconst DEFAULT_OAUTH_MINIMUM_VALIDITY_MS = 5 * 60 * 1000;\nconst DEFAULT_OAUTH_REFRESH_TIMEOUT_MS = 15_000;\n/**\n * OAuth resolution with double-checked locking: tokens with less than five\n * minutes remaining lock, re-check expiry under the lock, refresh once\n * globally, and persist the rotated credential before release.\n */\nasync function resolveStoredOAuth(credentials, providerId, oauth, stored, signal, minOAuthValidityMs) {\n const minimumValidityMs = Math.max(DEFAULT_OAUTH_MINIMUM_VALIDITY_MS, minOAuthValidityMs ?? 0);\n const expiresSoon = (credential) => Date.now() + minimumValidityMs >= credential.expires;\n let credential = stored;\n if (expiresSoon(credential)) {\n // Optimistic check said expired; the authoritative check runs under the lock.\n let post;\n try {\n post = await credentials.modify(providerId, async (current) => {\n if (current?.type !== \"oauth\")\n return undefined; // logged out meanwhile\n if (!expiresSoon(current))\n return undefined; // another process/request refreshed\n try {\n const refreshSignal = AbortSignal.any([\n signal,\n AbortSignal.timeout(DEFAULT_OAUTH_REFRESH_TIMEOUT_MS),\n ]);\n return await oauth.refresh(current, refreshSignal);\n }\n catch (error) {\n throw new ModelsError(\"oauth\", `OAuth refresh failed for ${providerId}`, { cause: error });\n }\n }, { signal });\n }\n catch (error) {\n if (error instanceof ModelsError)\n throw error;\n throw new ModelsError(\"auth\", `Credential store modify failed for ${providerId}`, { cause: error });\n }\n if (post?.type !== \"oauth\")\n return undefined; // logged out meanwhile\n credential = post;\n // The normal five-minute window triggers a refresh but does not impose a\n // provider contract. Explicit callers (such as bearer-token export) do\n // require the requested minimum after the refresh.\n if (minOAuthValidityMs !== undefined && expiresSoon(credential)) {\n throw new ModelsError(\"oauth\", `OAuth refresh returned a token that expires too soon for ${providerId}`);\n }\n }\n try {\n return { auth: await oauth.toAuth(credential), source: \"OAuth\" };\n }\n catch (error) {\n throw new ModelsError(\"oauth\", `OAuth auth derivation failed for ${providerId}`, { cause: error });\n }\n}\nasync function resolveApiKey(authContext, apiKey, providerId, credential, signal) {\n try {\n return await apiKey.resolve({ ctx: authContext, credential, signal });\n }\n catch (error) {\n throw new ModelsError(\"auth\", `API key auth failed for provider ${providerId}`, { cause: error });\n }\n}\nasync function readCredential(credentials, providerId, signal) {\n try {\n return await credentials.read(providerId, { signal });\n }\n catch (error) {\n throw new ModelsError(\"auth\", `Credential store read failed for ${providerId}`, { cause: error });\n }\n}\n//# sourceMappingURL=resolve.js.map","// @ts-nocheck — vendored Pi source excerpt (pi-coding-agent core/provider-composer.js adaptOAuth @0.84.1, MIT, see ./PI-LICENSE); logic unchanged.\n// The official two-generation adapter: extension oauth callbacks (onAuth/onDeviceCode/onPrompt/onSelect)\n// over the pi-ai interaction surface (prompt/notify/signal), plus refresh and toAuth->getApiKey.\nexport function adaptOAuth(config) {\n return {\n name: config.name,\n isSubscription: config.isSubscription,\n login: async (callbacks) => {\n const credential = await config.login({\n onAuth: (info) => callbacks.notify({ type: \"auth_url\", ...info }),\n onDeviceCode: (info) => callbacks.notify({ type: \"device_code\", ...info }),\n onPrompt: (prompt) => callbacks.prompt({ type: \"text\", ...prompt }),\n onProgress: (message) => callbacks.notify({ type: \"progress\", message }),\n onManualCodeInput: () => callbacks.prompt({ type: \"manual_code\", message: \"Paste the authorization code\" }),\n onSelect: (prompt) => callbacks.prompt({ type: \"select\", ...prompt }),\n signal: callbacks.signal,\n });\n return { ...credential, type: \"oauth\" };\n },\n refresh: async (credential, signal) => ({ ...(await config.refreshToken(credential, signal)), type: \"oauth\" }),\n toAuth: async (credential) => ({ apiKey: config.getApiKey(credential) }),\n };\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { mkdir, rename, writeFile } from 'node:fs/promises'\nimport { dirname } from 'node:path'\nimport { InMemoryCredentialStore } from './compat/vendor/pi-ai-credential-store.js'\nimport { resolveProviderAuth } from './compat/vendor/pi-ai-auth-resolve.js'\nimport { adaptOAuth } from './compat/vendor/pi-oauth-adapt.js'\n\ntype UnknownRecord = Record<string, unknown>\n\n// The interactive OAuth host seam, four layers with one owner each:\n// L1 protocol — the package's own oauth.login/refreshToken/getApiKey code\n// runs verbatim (device-code, auth-code, rotation). The\n// bridge implements zero protocol.\n// L2 interaction— Pi's official adaptOAuth (vendored) turns the package's\n// callbacks into prompt/notify events; this file routes\n// those onto the Pi ui surface, which pi2dsh already maps\n// to DSH userQuestions with real waits.\n// L3 credentials— Pi's auth.json contract: one file keyed by provider id,\n// 0600, atomic replace, per-provider serialized writes\n// (the vendored InMemoryCredentialStore chain), refresh via\n// Pi's vendored double-checked-lock resolver.\n// L4 routing — resolveOAuthApiKey yields the request key for dsh-llm's\n// one-shot credential seam; tokens never enter DSH settings.\n\nexport class FileCredentialStore extends InMemoryCredentialStore {\n readonly #path: string\n\n constructor(path: string) {\n super()\n this.#path = path\n try {\n const data = JSON.parse(readFileSync(path, 'utf8')) as Record<string, UnknownRecord>\n for (const [providerId, credential] of Object.entries(data)) {\n ;(this as unknown as { credentials: Map<string, unknown> }).credentials.set(providerId, credential)\n }\n } catch {\n // Missing or unreadable auth.json starts empty, exactly like Pi.\n }\n }\n\n get path(): string {\n return this.#path\n }\n\n async #persist(): Promise<void> {\n const credentials = (this as unknown as { credentials: Map<string, unknown> }).credentials\n const data = Object.fromEntries(credentials)\n await mkdir(dirname(this.#path), { recursive: true })\n // Atomic replace so a crash mid-write never truncates the store; 0600 so\n // tokens stay owner-readable only. Same contract Pi's file store keeps.\n const temp = `${this.#path}.tmp-${process.pid}-${Math.floor(Math.random() * 1e9).toString(36)}`\n await writeFile(temp, `${JSON.stringify(data, null, 2)}\\n`, { mode: 0o600 })\n await rename(temp, this.#path)\n }\n\n override modify(providerId: string, fn: (current: unknown) => unknown, options?: UnknownRecord): Promise<unknown> {\n // The vendored per-provider chain already serializes writers; persisting\n // inside the chained task keeps disk order identical to memory order.\n return super.modify(providerId, async (current: unknown) => {\n const next = await fn(current)\n if (next !== undefined) {\n const credentials = (this as unknown as { credentials: Map<string, unknown> }).credentials\n credentials.set(providerId, next)\n await this.#persist()\n }\n return next\n }, options)\n }\n\n override delete(providerId: string, options?: UnknownRecord): Promise<void> {\n return super.delete(providerId, options).then(() => this.#persist()) as Promise<void>\n }\n}\n\n/**\n * One signal that fires when EITHER input does.\n *\n * A question on screen has two reasons to close: the flow's own race (the\n * browser callback beating the paste box) and the whole login being called off.\n * @param ambient - the login's signal, live for the whole flow.\n * @param perCall - the flow's signal for this one question, when it sent one.\n * @returns the joined signal, or whichever one exists.\n */\nexport function joinSignals(ambient: AbortSignal | undefined, perCall: unknown): AbortSignal | undefined {\n if (!(perCall instanceof AbortSignal)) return ambient\n if (ambient === undefined) return perCall\n const joined = new AbortController()\n const stop = () => joined.abort()\n if (ambient.aborted || perCall.aborted) joined.abort()\n else {\n ambient.addEventListener('abort', stop, { once: true })\n perCall.addEventListener('abort', stop, { once: true })\n }\n return joined.signal\n}\n\nexport interface OAuthUiSurface {\n /**\n * @param signal cancels THIS question when another path in the flow answers\n * first — the browser callback beating the paste box. Optional because\n * Pi's own ui.input takes two arguments; the bridge's accepts a third.\n */\n input(title: unknown, placeholder?: unknown, signal?: AbortSignal): Promise<string | undefined>\n select(title: unknown, options: unknown[], signal?: AbortSignal): Promise<string | undefined>\n notify(message: unknown): void\n /**\n * Keep a device-code flow visible while the package polls in the background.\n *\n * Unlike auth-code flows, device-code flows normally do not issue a later\n * prompt. A command notice therefore arrives only after the code has expired.\n * Hosts with a live question surface should implement this optional seam;\n * older/headless hosts still receive the plain notification below.\n */\n deviceCode?(title: unknown, detail: unknown, signal?: AbortSignal): Promise<void>\n}\n\ninterface OAuthPromptEvent {\n type: 'text' | 'manual_code' | 'select'\n message: string\n placeholder?: string\n options?: Array<{ id: string, label: string }>\n /** Cancels THIS question when another path in the flow answers first. */\n signal?: AbortSignal\n}\n\ninterface OAuthNotifyEvent {\n type: 'auth_url' | 'device_code' | 'progress'\n url?: string\n instructions?: string\n userCode?: string\n verificationUri?: string\n message?: string\n /** How long the device code stays valid. Every device-code flow sends it. */\n expiresInSeconds?: number\n /** How often the flow polls; sent alongside the expiry. */\n intervalSeconds?: number\n}\n\n// The pi-ai interaction surface ({prompt, notify, signal}) over the Pi ui\n// surface pi2dsh already maps to DSH userQuestions.\n/**\n * Hand a URL to the host's browser opener, when the host gave one.\n *\n * Opening a window is the HOST's action, not the translation layer's, so the\n * opener is injected rather than reached for. Wiring it in here meant every\n * caller opened a real browser tab — including the test suite, which spawned a\n * tab per assertion on the developer's own machine.\n * @param open - the host's opener, absent when the host does not open windows.\n * @param url - the address the flow announced, when it announced one.\n */\nfunction openIfPossible(open: ((url: string) => void) | undefined, url: string | undefined): void {\n if (open === undefined || typeof url !== 'string' || !/^https?:\\/\\//u.test(url)) return\n try {\n open(url)\n } catch {\n // Best effort by design: the URL is in the prompt either way, and a host\n // with no desktop session (a container, a remote box) must still be able to\n // finish the login by pasting the code.\n }\n}\n\nexport function oauthInteraction(\n ui: OAuthUiSurface,\n signal?: AbortSignal,\n shorten?: (url: string) => string | undefined,\n open?: (url: string) => void,\n cancel?: () => void,\n): {\n prompt(prompt: OAuthPromptEvent): Promise<string | undefined>\n notify(event: OAuthNotifyEvent): void\n signal: AbortSignal\n} {\n // Pi hosts always hand flows a live signal; flows attach abort listeners\n // unconditionally, so an absent caller signal becomes a never-aborting one.\n const effectiveSignal = signal ?? new AbortController().signal\n // Where the user has to GO to authorize, held until the next prompt.\n //\n // The flow announces the authorization URL through notify() and then blocks\n // on prompt() for the code. A notice is a command notice on DSH: it reaches\n // the user when the command ENDS — and this command cannot end until the user\n // acts on the notice. So the address was delivered after it was needed, and\n // the dialog on screen showed only the redirect URI (localhost/auth/callback),\n // which does nothing when clicked. Carrying it into the prompt puts it where\n // the user is already looking.\n let pending: string | undefined\n /**\n * Hand the announced address to the prompt as its DETAIL, not its title.\n *\n * An authorization URL is 400 characters of query string. Prepending it to\n * the question turned the dialog into a wall of wrapped text with the actual\n * question buried underneath; `detail` is the slot DSH renders supporting\n * text in.\n * @param placeholder - the flow's own placeholder, kept when it supplied one.\n */\n const takePending = (placeholder: unknown): string | undefined => {\n const carried = pending\n pending = undefined\n // A carried address takes the slot alone. Pi's placeholder is greyed hint\n // text INSIDE its input box; DSH's dialog has no such slot, so it lands in\n // the same body text — and codex's placeholder is the redirect URI\n // (localhost:1455/auth/callback), which GFM autolinks into a second,\n // clickable, useless address sitting right under the real one. That is the\n // trap the user already fell into. Where nothing was announced it is still\n // the only hint there is, so it stays.\n if (carried !== undefined) return carried\n return placeholder === undefined ? undefined : String(placeholder)\n }\n return {\n signal: effectiveSignal,\n async prompt(prompt) {\n if (prompt.type === 'select') {\n const options = prompt.options ?? []\n pending = undefined\n const picked = await ui.select(prompt.message, options.map(option => option.label), effectiveSignal)\n return options.find(option => option.label === picked)?.id ?? picked\n }\n // BOTH signals close this box: the flow's own (another path won the race\n // — the local callback got the code) and the login's (it was called off).\n //\n // The second one is not optional. Cancelling a flow only tells the flow;\n // the question is the HOST's, and Pi's host takes its dialog down, which\n // is how the flow's `await manualPromise` gets to settle. Pi's anthropic\n // flow deadlocks without that: cancelling makes its callback wait return\n // nothing, and it then waits on the paste box forever, because the abort\n // that would close the box sits in a `finally` this wait never reaches.\n return ui.input(prompt.message, takePending(prompt.placeholder), joinSignals(effectiveSignal, prompt.signal))\n },\n notify(event) {\n if (event.type === 'auth_url') {\n // An authorize URL is 400 characters of query string. Pasted whole it\n // filled the dialog with wrapped text and gave the user nothing to\n // click. The dialog's detail slot is rendered as markdown, so the\n // address goes in as a LINK — one short clickable line, opened in a new\n // tab by the host's own renderer. The short redirect on this app's\n // origin is what makes it copyable too (a notice is plain text).\n const shown = (event.url === undefined ? undefined : shorten?.(event.url)) ?? event.url\n const tail = event.instructions === undefined ? '' : `\\n\\n${event.instructions}`\n pending = `[Open the login page](${shown})${tail}`\n ui.notify(`Open this URL to authorize: ${shown}${tail}`)\n // Open it, the way Pi's own login dialog does. The flows themselves\n // print \"A browser window should open\" — that sentence is Pi telling\n // the user what the HOST is about to do, and a host that does not do it\n // leaves a wrapped, unclickable URL and no way to authorize.\n openIfPossible(open, event.url)\n } else if (event.type === 'device_code') {\n // A device code EXPIRES. Dropping that left the user staring at a code\n // with no idea it was on a clock — every device-code flow sends the\n // window, and Pi's own host shows it.\n const window = typeof event.expiresInSeconds === 'number' && event.expiresInSeconds > 0\n ? ` (valid for ${Math.round(event.expiresInSeconds / 60)} min)`\n : ''\n // Same as above: a clickable line in the dialog, plain text in the\n // notice. The code stays as code so it survives the markdown pass.\n const detail = `[Open the device login page](${event.verificationUri}) and enter code \\`${event.userCode}\\`${window}`\n pending = detail\n ui.notify(`Visit ${event.verificationUri} and enter code ${event.userCode}${window}`)\n // A device flow polls without asking a follow-up question. Put a live\n // host dialog on screen NOW; otherwise the only visible artifact is a\n // command notice released after the command ends, when the code is no\n // longer useful. Resolving this dialog means the user cancelled it.\n // Successful/failed login aborts the signal first and merely closes it.\n if (ui.deviceCode !== undefined) {\n pending = undefined\n void ui.deviceCode('Complete login in your browser', detail, effectiveSignal).then(\n () => { if (!effectiveSignal.aborted) cancel?.() },\n () => undefined,\n )\n }\n openIfPossible(open, event.verificationUri)\n } else if (event.message !== undefined) {\n ui.notify(event.message)\n }\n },\n }\n}\n\nfunction oauthConfigOf(providerConfig: UnknownRecord | undefined): UnknownRecord | undefined {\n // Extension-generation configs carry oauth at the top level; pi-ai\n // createProvider() objects carry it under auth.oauth. Pi accepts both.\n const oauth = providerConfig?.oauth\n ?? (providerConfig?.auth as UnknownRecord | undefined)?.oauth\n return typeof oauth === 'object' && oauth !== null && typeof (oauth as UnknownRecord).login === 'function'\n ? oauth as UnknownRecord\n : undefined\n}\n\n// Pi accepts both oauth generations: pi-ai native flows carry toAuth and take\n// the interaction surface directly; extension configs carry getApiKey and go\n// through Pi's adaptOAuth (vendored). Same acceptance here.\nfunction oauthAdapterOf(oauthConfig: UnknownRecord): {\n login(interaction: unknown): Promise<UnknownRecord>\n refresh(credential: unknown, signal?: AbortSignal): Promise<UnknownRecord>\n toAuth(credential: unknown): Promise<UnknownRecord>\n} {\n if (typeof oauthConfig.toAuth === 'function') {\n return oauthConfig as never\n }\n return adaptOAuth(oauthConfig) as never\n}\n\nexport function providerSupportsOAuth(providerConfig: UnknownRecord | undefined): boolean {\n return oauthConfigOf(providerConfig) !== undefined\n}\n\n// Pi models.login semantics: find the provider's oauth surface, run the\n// package's own login through the vendored adapter, persist through the\n// store's serialized modify.\nexport async function loginPiProvider(options: {\n providerId: string\n providerName?: string\n providerConfig: UnknownRecord\n store: FileCredentialStore\n ui: OAuthUiSurface\n signal?: AbortSignal\n /** Turns a long authorize URL into a short one the user can actually click. */\n shorten?: (url: string) => string | undefined\n /** The host's browser opener. Absent = this host opens nothing. */\n open?: (url: string) => void\n}): Promise<UnknownRecord> {\n const oauthConfig = oauthConfigOf(options.providerConfig)\n if (oauthConfig === undefined) {\n throw new Error(`${options.providerName ?? options.providerId} does not support oauth login`)\n }\n const adapter = oauthAdapterOf(oauthConfig)\n // The flow's own signal, so a question still on screen when the login ends\n // gets cancelled. The browser half of an OAuth login finishes at the local\n // callback, not at the paste box — leaving that box open after the flow has\n // resolved (or failed, as a region-blocked token exchange does) strands the\n // user in front of a dialog that can no longer do anything.\n const done = new AbortController()\n if (options.signal !== undefined) {\n if (options.signal.aborted) done.abort()\n else options.signal.addEventListener('abort', () => done.abort(), { once: true })\n }\n try {\n const credential = await adapter.login(oauthInteraction(\n options.ui,\n done.signal,\n options.shorten,\n options.open,\n () => done.abort(),\n ))\n await options.store.modify(options.providerId, async () => credential)\n return credential\n } finally {\n done.abort()\n }\n}\n\n// Pi's resolveProviderAuth over the stored credential: five-minute expiry\n// window, double-checked-lock refresh through the package's own refreshToken,\n// rotated credential persisted before release, key derived by the package's\n// own getApiKey. Returns undefined when nothing is stored.\nexport async function resolveOAuthApiKey(options: {\n providerId: string\n providerName?: string\n providerConfig: UnknownRecord\n store: FileCredentialStore\n signal?: AbortSignal\n}): Promise<string | undefined> {\n const oauthConfig = oauthConfigOf(options.providerConfig)\n if (oauthConfig === undefined) return undefined\n const provider = {\n id: options.providerId,\n name: options.providerName ?? options.providerId,\n auth: { oauth: oauthAdapterOf(oauthConfig) },\n }\n const resolved = await resolveProviderAuth(\n provider,\n options.store,\n { env: async () => undefined },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n ) as { auth?: { apiKey?: string } } | undefined\n return resolved?.auth?.apiKey\n}\n\nexport async function storedOAuthCredential(store: FileCredentialStore, providerId: string): Promise<UnknownRecord | undefined> {\n const stored = await store.read(providerId, undefined) as UnknownRecord | undefined\n return stored?.type === 'oauth' ? stored : undefined\n}\n\n// Pi's FULL getProviderAuth precedence over the vendored resolver — stored\n// OAuth (double-checked-lock refresh), then stored api_key, then the\n// provider's own auth.apiKey ambient resolution (its resolve() reads env vars\n// and probes credential files through the auth context). The package's\n// resolve code runs verbatim; the bridge supplies only the context.\nexport async function resolvePiProviderAuth(options: {\n providerId: string\n providerName?: string\n providerConfig: UnknownRecord\n store: FileCredentialStore\n signal?: AbortSignal\n}): Promise<{ auth?: UnknownRecord, source?: string } | undefined> {\n const oauthConfig = oauthConfigOf(options.providerConfig)\n const declaredApiKey = (options.providerConfig.auth as UnknownRecord | undefined)?.apiKey\n if (oauthConfig === undefined && declaredApiKey === undefined) return undefined\n const auth: UnknownRecord = {}\n if (oauthConfig !== undefined) auth.oauth = oauthAdapterOf(oauthConfig)\n if (declaredApiKey !== undefined) auth.apiKey = declaredApiKey\n const provider = { id: options.providerId, name: options.providerName ?? options.providerId, auth }\n return await resolveProviderAuth(\n provider,\n options.store,\n {\n env: async (name: string) => process.env[name],\n fileExists: async (path: string) => existsSync(path),\n },\n options.signal !== undefined ? { signal: options.signal } : undefined,\n ) as { auth?: UnknownRecord, source?: string } | undefined\n}\n","import { join } from 'node:path'\nimport type { Context } from '@deepseek-ai/cordis'\nimport { CredentialProvider, type CredentialInfo, type CredentialRef, type ResolvedCredential } from '@deepseek-ai/dsh-credentials'\nimport { FileCredentialStore, providerSupportsOAuth, resolveOAuthApiKey, storedOAuthCredential } from './oauth-bridge.js'\nimport { builtinProviders } from './compat/pi-ai.js'\nimport { getAgentDir } from './compat/pi-coding-agent.js'\n\ntype UnknownRecord = Record<string, unknown>\n\n// L4 of the OAuth host seam: a standard dsh-credentials provider that serves\n// Pi OAuth tokens to DSH's native LLM request path. A route configured as\n// `apiKeyEnv: PI2DSH_OAUTH_OPENAI_CODEX` resolves per request through this\n// provider — Pi's double-checked-lock refresh runs on every resolution, so a\n// rotated token reaches the next model call with no restart, exactly the\n// per-operation semantics the credentials seam demands. Every other reference\n// falls through to the process environment, so one provider instance serves a\n// whole composition.\n//\n// Reference convention: PI2DSH_OAUTH_<PROVIDER_ID> where the provider id is\n// upper-cased with `-` as `_` (openai-codex → PI2DSH_OAUTH_OPENAI_CODEX).\n\nconst OAUTH_REF_PREFIX = 'PI2DSH_OAUTH_'\n\nexport function oauthCredentialRef(providerId: string): string {\n return `${OAUTH_REF_PREFIX}${providerId.toUpperCase().replaceAll('-', '_')}`\n}\n\nfunction providerIdOfRef(ref: string): string | undefined {\n if (!ref.startsWith(OAUTH_REF_PREFIX)) return undefined\n return ref.slice(OAUTH_REF_PREFIX.length).toLowerCase().replaceAll('_', '-')\n}\n\nexport interface PiOAuthCredentialProviderOptions {\n /** Path to the Pi-format auth.json; defaults to `$agentDir/auth.json`. */\n authPath?: string\n /** Additional provider configs (id → config with an oauth block), e.g. from packages that registered providers. */\n providers?: ReadonlyMap<string, UnknownRecord>\n}\n\nexport class PiOAuthCredentialProvider extends CredentialProvider {\n private readonly oauthStore: FileCredentialStore\n private readonly extraProviders: ReadonlyMap<string, UnknownRecord>\n\n constructor(ctx: Context, options: PiOAuthCredentialProviderOptions = {}) {\n super(ctx)\n this.oauthStore = new FileCredentialStore(options.authPath ?? join(getAgentDir(), 'auth.json'))\n this.extraProviders = options.providers ?? new Map()\n }\n\n private oauthConfigFor(providerId: string): UnknownRecord | undefined {\n const registered = this.extraProviders.get(providerId)\n if (providerSupportsOAuth(registered)) return registered\n const builtin = builtinProviders().find(provider => provider.id === providerId)\n if (builtin === undefined) return undefined\n return { name: builtin.name, baseUrl: builtin.baseUrl, oauth: builtin.auth.oauth }\n }\n\n async resolve(ref: CredentialRef): Promise<ResolvedCredential | undefined> {\n const providerId = providerIdOfRef(String(ref))\n if (providerId === undefined) {\n const value = process.env[String(ref)]\n return value !== undefined && value.length > 0 ? { value, source: 'env' } : undefined\n }\n const config = this.oauthConfigFor(providerId)\n if (config === undefined) return undefined\n const value = await resolveOAuthApiKey({\n providerId,\n providerName: typeof config.name === 'string' ? config.name : providerId,\n providerConfig: config,\n store: this.oauthStore,\n })\n return value !== undefined && value.length > 0 ? { value, source: 'pi-oauth' } : undefined\n }\n\n async describe(ref: CredentialRef): Promise<CredentialInfo> {\n const providerId = providerIdOfRef(String(ref))\n if (providerId === undefined) {\n const value = process.env[String(ref)]\n return { configured: value !== undefined && value.length > 0, ...(value ? { source: 'env' } : {}), writable: false }\n }\n const stored = await storedOAuthCredential(this.oauthStore, providerId)\n return { configured: stored !== undefined, ...(stored !== undefined ? { source: 'pi-oauth' } : {}), writable: false }\n }\n\n async set(ref: CredentialRef, _value: string): Promise<void> {\n throw new Error(`credential ${String(ref)} is read-only here: OAuth tokens are managed by /login, environment values by the shell`)\n }\n\n async unset(ref: CredentialRef): Promise<void> {\n const providerId = providerIdOfRef(String(ref))\n if (providerId === undefined) {\n throw new Error(`credential ${String(ref)} is read-only here: environment values are managed by the shell`)\n }\n // Logging out is a legitimate unset: drop the stored token.\n await this.oauthStore.delete(providerId, undefined)\n }\n}\n\nexport const name = 'pi2dsh-credentials-oauth'\n\nexport function apply(ctx: Context, config: PiOAuthCredentialProviderOptions = {}): void {\n // The Service constructor registers itself as ctx.credentials.\n void new PiOAuthCredentialProvider(ctx, config)\n}\n"],"mappings":";;;;;;;;;AACA,SAAS,YAAY,QAAQ;CACzB,IAAI,OAAO,WAAW,KAAA,GAClB,OAAO,OAAO;CAClB,MAAM,wBAAQ,IAAI,MAAM,2BAA2B;CACnD,MAAM,OAAO;CACb,OAAO;AACX;;AAEA,SAAgB,gBAAgB,QAAQ;CACpC,OAAO,UAAU,IAAI,gBAAgB,CAAC,CAAC;AAC3C;;;;;AAKA,SAAgB,oBAAoB,WAAW,QAAQ;CACnD,IAAI,OAAO,SAAS;EAChB,UAAe,YAAY,CAAE,CAAC;EAC9B,OAAO,QAAQ,OAAO,YAAY,MAAM,CAAC;CAC7C;CACA,OAAO,IAAI,SAAS,SAAS,WAAW;EACpC,IAAI,UAAU;EACd,MAAM,gBAAgB,OAAO,oBAAoB,SAAS,OAAO;EACjE,MAAM,gBAAgB;GAClB,IAAI,SACA;GACJ,UAAU;GACV,QAAQ;GACR,OAAO,YAAY,MAAM,CAA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,MAAM,QAAQ,QAAQ,IAAI,OAAO,GAAG;GACpC,OAAO;IAAE,YAAY,UAAU,KAAA,KAAa,MAAM,SAAS;IAAG,GAAI,QAAQ,EAAE,QAAQ,MAAM,IAAI,CAAC;IAAI,UAAU;GAAM;EACrH;EACA,MAAM,SAAS,MAAM,sBAAsB,KAAK,YAAY,UAAU;EACtE,OAAO;GAAE,YAAY,WAAW,KAAA;GAAW,GAAI,WAAW,KAAA,IAAY,EAAE,QAAQ,WAAW,IAAI,CAAC;GAAI,UAAU;EAAM;CACtH;CAEA,MAAM,IAAI,KAAoB,QAA+B;EAC3D,MAAM,IAAI,MAAM,cAAc,OAAO,GAAG,EAAE,wFAAwF;CACpI;CAEA,MAAM,MAAM,KAAmC;EAC7C,MAAM,aAAa,gBAAgB,OAAO,GAAG,CAAC;EAC9C,IAAI,eAAe,KAAA,GACjB,MAAM,IAAI,MAAM,cAAc,OAAO,GAAG,EAAE,gEAAgE;EAG5G,MAAM,KAAK,WAAW,OAAO,YAAY,KAAA,CAAS;CACpD;AACF;AAEA,MAAa,OAAO;AAEpB,SAAgB,MAAM,KAAc,SAA2C,CAAC,GAAS;CAEvF,IAAS,0BAA0B,KAAK,MAAM;AAChD"}
@@ -1,3 +1,3 @@
1
1
 
2
- import { i as oauthCredentialRef, n as apply, r as name, t as PiOAuthCredentialProvider } from "./credentials-oauth-BakY-0PA.mjs";
2
+ import { i as oauthCredentialRef, n as apply, r as name, t as PiOAuthCredentialProvider } from "./credentials-oauth-Txs6oew8.mjs";
3
3
  export { PiOAuthCredentialProvider, apply, name, oauthCredentialRef };
package/dist/host.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as registerVisionCompanions, t as applyPiPackage } from "./runtime-B-SlR8mJ.mjs";
2
+ import { r as registerVisionCompanions, t as applyPiPackage } from "./runtime-DEjs_Qlf.mjs";
3
3
  import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { readFile } from "node:fs/promises";
@@ -1 +1 @@
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;;EAEA;;;;;;;;;UAUQ,oBAAoB;EAC5B;;cAQW;cAKA;cAKA;cAWA,mBAAmB,SAAS,eAAe,SAAS,eAAe;cAmNnE,eAAe,SAAS,eAAe;cA4BvC,kBAAkB,SAAS,eAAe;cA+B1C,WAAW,SAAS,eAAe;cA6InC,aAAa,SAAS,eAAe;iBAgHlC,WAAW,iBAAiB;iBAI5B,aAAa,gBAAgB;iBAO7B,kBAAkB,qBAAqB,uBAAuB;iBAS9D,uBAAuB,mBAAmB;iBAI1C,yBAAyB,mBAAmB;;;KCpkBvD,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"}
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;;EAEA;;;;;;;;;UAUQ,oBAAoB;EAC5B;;cAQW;cAKA;cAKA;cAWA,mBAAmB,SAAS,eAAe,SAAS,eAAe;cAoNnE,eAAe,SAAS,eAAe;cA4BvC,kBAAkB,SAAS,eAAe;cA+B1C,WAAW,SAAS,eAAe;cA6InC,aAAa,SAAS,eAAe;iBAgHlC,WAAW,iBAAiB;iBAI5B,aAAa,gBAAgB;iBAO7B,kBAAkB,qBAAqB,uBAAuB;iBAS9D,uBAAuB,mBAAmB;iBAI1C,yBAAyB,mBAAmB;;;KCrkBvD,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-B-SlR8mJ.mjs";
2
+ import { t as applyPiPackage } from "./runtime-DEjs_Qlf.mjs";
3
3
  import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
4
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-CZepacin.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-_idn-pzI.mjs";
6
6
  import { readFile } from "node:fs/promises";
7
7
  import { existsSync } from "node:fs";
8
8
  import { dirname, join } from "node:path";
@@ -96,7 +96,21 @@ async function apply(ctx, config = {}) {
96
96
  warn
97
97
  });
98
98
  if (packages.length === 0) {
99
- registerVisionCompanions(ctx, config.visionCompanions);
99
+ await applyPiPackage(ctx, {
100
+ rootUrl: new URL(".", import.meta.url),
101
+ manifest: {
102
+ schemaVersion: 1,
103
+ package: {
104
+ name: "pi2dsh-builtins",
105
+ version: "0.0.0",
106
+ source: "engine"
107
+ },
108
+ extensions: [],
109
+ skillDirs: [],
110
+ prompts: []
111
+ },
112
+ config: { ...config.visionCompanions === void 0 ? {} : { visionCompanions: config.visionCompanions } }
113
+ });
100
114
  info("[pi2dsh engine] no Pi packages installed in this profile yet — add one with: dsh plugin --profile <p> add <pi-package>");
101
115
  return;
102
116
  }
@@ -114,7 +128,7 @@ async function apply(ctx, config = {}) {
114
128
  * @returns the compatibility report.
115
129
  */
116
130
  async function analyzePackage(pkg) {
117
- const { analyzePackage: run } = await import("./analyzer-CXNbeBAe.mjs");
131
+ const { analyzePackage: run } = await import("./analyzer-CJFwQlSG.mjs");
118
132
  return run(pkg);
119
133
  }
120
134
  //#endregion
@@ -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// 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;AAC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/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 { applyPiPackage } 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 // The host itself owns Pi's built-in provider directory and `/login`.\n // Mount an empty internal package so those host-level capabilities exist\n // even before the user installs their first community Pi package. Calling\n // registerVisionCompanions alone here left a fresh engine unable to run\n // `/login openai-codex`: DSH treated the unknown slash line as a model\n // prompt and failed on the unrelated default provider credential.\n await applyPiPackage(ctx, {\n rootUrl: new URL('.', import.meta.url),\n manifest: {\n schemaVersion: 1,\n package: { name: 'pi2dsh-builtins', version: '0.0.0', source: 'engine' },\n extensions: [],\n skillDirs: [],\n prompts: [],\n },\n config: {\n ...(config.visionCompanions === undefined ? {} : { visionCompanions: config.visionCompanions }),\n },\n })\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;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Z,SAAS,CAAC;GACZ;GACA,QAAQ,EACN,GAAI,OAAO,qBAAqB,KAAA,IAAY,CAAC,IAAI,EAAE,kBAAkB,OAAO,iBAAiB,EAC/F;EACF,CAAC;EACD,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;;;;;;;;AClKA,eAAsB,eAAe,KAAsD;CACzF,MAAM,EAAE,gBAAgB,QAAQ,MAAM,OAAO;CAC7C,OAAO,IAAI,GAAG;AAChB"}
@@ -213,7 +213,8 @@ const HOST_IMPORT_RULES = Object.freeze({
213
213
  }),
214
214
  "pi-ai": Object.freeze({
215
215
  StringEnum: rule("full", "Preserves Pi flat string-enum JSON Schema generation without loading provider SDKs."),
216
- registerProvider: rule("partial", "Recorded in a bridge-local registry; DSH llm adapters own real routing."),
216
+ streamSimpleOpenAIResponses: rule("full", "Pi's real OpenAI Responses simple transport, exported under the legacy symbol used by transport-owning provider packages."),
217
+ registerProvider: rule("partial", "Recorded in the Pi-facing registry, then exposed as a DSH route: a transport-owning provider uses llm.registerAdapter; a catalog-only provider is translated into the official llm-pi-ai profile schema."),
217
218
  getProviders: rule("partial", "Returns the bridge-local registry contents."),
218
219
  getProvider: rule("partial", "Reads the bridge-local registry."),
219
220
  getModel: rule("partial", "Resolves no Pi model objects; DSH owns model routing."),
@@ -321,8 +322,8 @@ const API_RULES = Object.freeze({
321
322
  },
322
323
  registerProvider: {
323
324
  level: "partial",
324
- 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.",
325
- design: "Two mechanisms behind one call. A provider carrying its own transport becomes a real DSH route through llm.registerAdapter, and the package's own HTTP client then carries the turn with its key resolved by Pi's credential chain into the bridge's auth.json. A catalog-only declaration registers no transport at all: those models are served by the host's adapters and DSH credentials, and the declaration only contributes directory entries."
325
+ 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): protocol, endpoint, credential reference, model capabilities, reasoning levels and the compat fields offered by DSH are translated into the official llm-pi-ai profile; no bridge transport is synthesized.",
326
+ design: "Two mechanisms behind one call. A provider carrying its own transport becomes a real DSH route through llm.registerAdapter, and the package's own HTTP client then carries the turn with its key resolved by Pi's credential chain into the bridge's auth.json. A catalog-only declaration becomes configuration for DSH's official llm-pi-ai adapter, which owns credentials and the real HTTP request. Both enter the one DSH model directory."
326
327
  },
327
328
  unregisterProvider: {
328
329
  level: "partial",
@@ -537,9 +538,9 @@ const EVENT_RULES = Object.freeze({
537
538
  design: "DSH's agent/pre-step waterfall, whose decision type distinguishes entering a step from rejecting it. The transform applies to the messages that have not entered the step yet — the slice Pi packages actually rewrite — while entered history stays read-only under DSH's append-only log."
538
539
  },
539
540
  before_provider_request: {
540
- level: "unsupported",
541
- detail: "Provider payload mutation belongs in a native DSH LLM adapter; the handler is accepted but never fires.",
542
- design: "Deliberately not wired. The request body is built inside a DSH llm adapter, and a package that needs to shape it should be one (or register its own provider, which this bridge does support). Faking the moment on the bridge side would let a handler edit a body that is not the one sent."
541
+ level: "partial",
542
+ detail: "Fires with the exact outgoing payload for Pi package-owned transports; native DSH adapters expose no body-builder hook and remain unavailable.",
543
+ design: "A transport-owning Pi provider is wrapped by pi2dsh as a DSH llm adapter and Pi's standard stream helpers expose the exact pre-fetch body through onPayload, so the waterfall is real there. Native DSH adapters build their body behind their own boundary; without an upstream seam this event cannot honestly fire for them."
543
544
  },
544
545
  before_provider_headers: {
545
546
  level: "unsupported",
@@ -763,4 +764,4 @@ function renderMcpPatch(result) {
763
764
  //#endregion
764
765
  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 };
765
766
 
766
- //# sourceMappingURL=mcp-config-CZepacin.mjs.map
767
+ //# sourceMappingURL=mcp-config-_idn-pzI.mjs.map