{"_id":"@buddhilive/dsh-base","name":"@buddhilive/dsh-base","dist-tags":{"alpha":"0.1.2-alpha.3","latest":"0.1.2-alpha.3"},"versions":{"0.1.2-alpha.3":{"name":"@buddhilive/dsh-base","description":"The shared dsh core as a profile bundle: the first patch layer of base-backed profiles, inserting core rows over the empty profile root","version":"0.1.2-alpha.3","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Buddhilive/buddhi-ai-harness.git","directory":"packages/bundle/base"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./cordis.patch.yml":"./cordis.patch.yml","./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dependencies":{"@deepseek-ai/cordis-plugin-hmr":"^1.0.17","@deepseek-ai/cordis-plugin-timer":"^1.1.4","@buddhilive/dsh-agent":"^0.1.2-alpha.3","@buddhilive/dsh-agent-loop":"^0.1.2-alpha.3","@buddhilive/dsh-agent-default-model":"^0.1.2-alpha.3","@buddhilive/dsh-shell-env":"^0.1.2-alpha.3","@buddhilive/dsh-bash-sandbox":"^0.1.2-alpha.3","@buddhilive/dsh-command-compact":"^0.1.2-alpha.3","@buddhilive/dsh-command-goal":"^0.1.2-alpha.3","@buddhilive/dsh-command-feedback":"^0.1.2-alpha.3","@buddhilive/dsh-commands":"^0.1.2-alpha.3","@buddhilive/dsh-compaction-basic":"^0.1.2-alpha.3","@buddhilive/dsh-compaction-tool-result-pruner":"^0.1.2-alpha.3","@buddhilive/dsh-attachment-local":"^0.1.2-alpha.3","@buddhilive/dsh-credentials-local":"^0.1.2-alpha.3","@buddhilive/dsh-deepseek-llm-api-extensions":"^0.1.2-alpha.3","@buddhilive/dsh-plugin-package-inventory-deepseek":"^0.1.2-alpha.3","@buddhilive/dsh-fs-observation-policy":"^0.1.2-alpha.3","@buddhilive/dsh-fs-local":"^0.1.2-alpha.3","@buddhilive/dsh-fs-sandbox":"^0.1.2-alpha.3","@buddhilive/dsh-goal":"^0.1.2-alpha.3","@buddhilive/dsh-goal-round-driver":"^0.1.2-alpha.3","@buddhilive/dsh-api-gateway":"^0.1.2-alpha.3","@buddhilive/dsh-llm":"^0.1.2-alpha.3","@buddhilive/bah-llm-buddhi":"^0.1.2-alpha.3","@buddhilive/dsh-llm-deepseek":"^0.1.2-alpha.3","@buddhilive/dsh-llm-pi-ai":"^0.1.2-alpha.3","@buddhilive/dsh-llm-retry":"^0.1.2-alpha.3","@buddhilive/dsh-plan-mode":"^0.1.2-alpha.3","@buddhilive/dsh-pwsh-sandbox":"^0.1.2-alpha.3","@buddhilive/dsh-sandbox-local":"^0.1.2-alpha.3","@buddhilive/dsh-sandbox-policy":"^0.1.2-alpha.3","@buddhilive/dsh-repeat-tool-reminder":"^0.1.2-alpha.3","@buddhilive/dsh-session-checkpoint-policy":"^0.1.2-alpha.3","@buddhilive/dsh-session":"^0.1.2-alpha.3","@buddhilive/dsh-permission-presets":"^0.1.2-alpha.3","@buddhilive/dsh-session-log-deepseek":"^0.1.2-alpha.3","@buddhilive/dsh-session-persistence-jsonl":"^0.1.2-alpha.3","@buddhilive/dsh-session-projection-cache":"^0.1.2-alpha.3","@buddhilive/dsh-session-projection":"^0.1.2-alpha.3","@buddhilive/dsh-session-query-sqlite":"^0.1.2-alpha.3","@buddhilive/dsh-session-telemetry-otel":"^0.1.2-alpha.3","@buddhilive/dsh-session-title":"^0.1.2-alpha.3","@buddhilive/dsh-session-title-first-prompt-llm":"^0.1.2-alpha.3","@buddhilive/dsh-settings-file":"^0.1.2-alpha.3","@buddhilive/dsh-skill":"^0.1.2-alpha.3","@buddhilive/dsh-skill-filesystem":"^0.1.2-alpha.3","@buddhilive/dsh-skill-badge":"^0.1.2-alpha.3","@buddhilive/dsh-spill-policy":"^0.1.2-alpha.3","@buddhilive/dsh-storage":"^0.1.2-alpha.3","@buddhilive/dsh-storage-domain":"^0.1.2-alpha.3","@buddhilive/dsh-storage-json":"^0.1.2-alpha.3","@buddhilive/dsh-subagent":"^0.1.2-alpha.3","@buddhilive/dsh-subagent-fork-in-process":"^0.1.2-alpha.3","@buddhilive/dsh-subagent-spawn-in-process":"^0.1.2-alpha.3","@buddhilive/dsh-spill-local":"^0.1.2-alpha.3","@buddhilive/dsh-system-prompt":"^0.1.2-alpha.3","@buddhilive/dsh-jobs-local":"^0.1.2-alpha.3","@buddhilive/dsh-tool-call-timeout-policy":"^0.1.2-alpha.3","@buddhilive/dsh-token-meter":"^0.1.2-alpha.3","@buddhilive/dsh-tool-bash":"^0.1.2-alpha.3","@buddhilive/dsh-tool-goal":"^0.1.2-alpha.3","@buddhilive/dsh-tool-ralph":"^0.1.2-alpha.3","@buddhilive/dsh-tool-pwsh":"^0.1.2-alpha.3","@buddhilive/dsh-tool-skill":"^0.1.2-alpha.3","@buddhilive/dsh-tool-fs":"^0.1.2-alpha.3","@buddhilive/dsh-tool-fs-search":"^0.1.2-alpha.3","@buddhilive/dsh-tool-str-replace-editor":"^0.1.2-alpha.3","@buddhilive/dsh-tool-subagent":"^0.1.2-alpha.3","@buddhilive/dsh-subprocess-local":"^0.1.2-alpha.3","@buddhilive/dsh-tool-subagent-control":"^0.1.2-alpha.3","@buddhilive/dsh-tool-subagent-report":"^0.1.2-alpha.3","@buddhilive/dsh-tool-jobs":"^0.1.2-alpha.3","@buddhilive/dsh-tool-web":"^0.1.2-alpha.3","@buddhilive/dsh-tool-workflow":"^0.1.2-alpha.3","@buddhilive/dsh-tools":"^0.1.2-alpha.3","@buddhilive/dsh-typert-loader":"^0.1.2-alpha.3","@buddhilive/dsh-user-questions":"^0.1.2-alpha.3","@buddhilive/dsh-typert-registry":"^0.1.2-alpha.3","@buddhilive/dsh-user-approval":"^0.1.2-alpha.3","@buddhilive/dsh-tool-todo":"^0.1.2-alpha.3","@buddhilive/dsh-web":"^0.1.2-alpha.3","@buddhilive/dsh-web-fetch-http":"^0.1.2-alpha.3","@buddhilive/bah-web-search-searxng":"^0.1.2-alpha.3","@buddhilive/dsh-web-search-deepseek":"^0.1.2-alpha.3","@buddhilive/dsh-workflow-worker-thread":"^0.1.2-alpha.3","@buddhilive/dsh-agent-instructions":"^0.1.2-alpha.3"},"peerDependencies":{"@buddhilive/dsh-invariants":"^0.1.2-alpha.3","@deepseek-ai/cordis":"^4.0.2"},"devDependencies":{"@buddhilive/dsh-invariants":"^0.1.2-alpha.3","@deepseek-ai/cordis":"^4.0.2"},"_id":"@buddhilive/dsh-base@0.1.2-alpha.3","bugs":{"url":"https://github.com/Buddhilive/buddhi-ai-harness/issues"},"homepage":"https://github.com/Buddhilive/buddhi-ai-harness#readme","_integrity":"sha512-N4VbX2oSWlq00UDzYFZ0yZRW8gPDes80NWS2um/VqLhp3VpIDI6Q2kYXbWbpI23hBWiYy9W5tKq/KbB5WvH13g==","_resolved":"C:\\DevDojo\\Buddhi\\buddhi-ai-harness\\dist\\npm\\buddhilive-dsh-base-0.1.2-alpha.3.tgz","_from":"file:C:/DevDojo/Buddhi/buddhi-ai-harness/dist/npm/buddhilive-dsh-base-0.1.2-alpha.3.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-N4VbX2oSWlq00UDzYFZ0yZRW8gPDes80NWS2um/VqLhp3VpIDI6Q2kYXbWbpI23hBWiYy9W5tKq/KbB5WvH13g==","shasum":"9364b8145f16c8a2f59aebeb6f9760f7c644b194","tarball":"https://registry.npmjs.org/@buddhilive/dsh-base/-/dsh-base-0.1.2-alpha.3.tgz","fileCount":10,"unpackedSize":45563,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCFkBrEpgHNe7PBpRsJ0AXJjkIYOmUYiOrFiQhiQ/wyuQIgDSz6IqqJElwR71uIzYBjNBShFGynSQOF4rFwV8DKelQ="}]},"_npmUser":{"name":"buddhilive","email":"visitbudkavin@gmail.com"},"directories":{},"maintainers":[{"name":"buddhilive","email":"visitbudkavin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-base_0.1.2-alpha.3_1788165980351_0.1723937199776635"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-31T08:46:20.140Z","0.1.2-alpha.3":"2026-08-31T08:46:20.466Z","modified":"2026-08-31T08:46:20.798Z"},"maintainers":[{"name":"buddhilive","email":"visitbudkavin@gmail.com"}],"description":"The shared dsh core as a profile bundle: the first patch layer of base-backed profiles, inserting core rows over the empty profile root","homepage":"https://github.com/Buddhilive/buddhi-ai-harness#readme","repository":{"type":"git","url":"git+https://github.com/Buddhilive/buddhi-ai-harness.git","directory":"packages/bundle/base"},"bugs":{"url":"https://github.com/Buddhilive/buddhi-ai-harness/issues"},"license":"MIT","readme":"---\ndescription: \"共享的 dsh 核心：为每个 dsh --profile 表层提供模型访问、工具、持久会话与安全默认值，供用户组合或定制 profile。\"\nkind: \"package-bundle\"\n---\n\n# @buddhilive/dsh-base\n\n[English](README.md) | 中文\n\n## 概述\n\n每个基于 base 的 `dsh --profile` 表层都运行在 `dsh-base` 上，因此这些表层共享模型连接、完整工具集、持久会话历史和 workspace 安全默认值。随附的 `sdk-minimal` profile 刻意改用完整的独立配置树。你通常不直接操作本 bundle——随附的 base-backed profile 已经包含它，自定义 base-backed profile 则把它放在第一位。需要其他默认值时，应修改自己的 profile patch 或添加后续 bundle；本包不是供导入的库。\n\n## 目录\n\n- [使用本包](#use-this-package)\n- [理解实现](#understand-the-implementation)\n- [进一步探索](#further-exploration)\n- [模型体验](#model-experience)\n- [已知限制与延期工作](#known-limitations-and-deferred-work)\n- [开发备注](#dev-note)\n\n-----\n\n<a id=\"use-this-package\"></a>\n## 使用本包\n\n你会自动获得 dsh 核心：随发行版交付的 `web` 与 `headless` profile 已包含它，自定义 profile 则把它列为第一个组合包。之后一切无需任何额外配置即可工作。\n\n### 最小自定义 profile\n\n要在共享核心之上构建 profile，请创建一个 profile，其 `package.json` 把 `@buddhilive/dsh-base` 列在首位：\n\n```json\n{\n  \"name\": \"my-profile\",\n  \"private\": true,\n  \"dsh\": {\n    \"profile\": {\n      \"bundles\": [\"@buddhilive/dsh-base\"]\n    }\n  }\n}\n```\n\n运行 `dsh --profile my-profile \"your task\"`，你就得到一个可用的 agent（智能体），带模型访问、工具、持久化与默认权限策略。随发行版交付的 `web` 与 `headless` profile 会在首次使用时为你创建。要添加更多组合包，运行 `dsh plugin --profile <name> add <package>`；内置组合包从 dsh 安装目录解析。profile 约定见 [app-boot 的 profile 章节](../../boot/app-boot/README.zh.md)。\n\n### 你得到什么\n\n开箱即用，基于本核心构建的每个 profile 都提供：DeepSeek 模型连接（provider 与模型可配置，你还可以在设置中启用额外 provider）、完整工具集——文件编辑、shell 命令、web 搜索、subagent、任务与目标跟踪——可跨重启存活的持久会话，以及默认权限策略：把文件写入限制在工作区内，危险操作前征询许可。遥测默认关闭，除非你主动开启。\n\n### 各平台的 shell 工具\n\n在 macOS 与 Linux 上你获得 bash shell 工具；在 Windows 上则获得对应的 PowerShell 孪生工具，因此每台机器恰好有一套 shell 栈。各平台的安全行为完全一致。偏好不受沙盒约束的 PowerShell 执行器的 Windows 主机可以在其 profile patch 中切换 shell 行——切换必须同时禁用两个 PowerShell 行并重新启用两个 bash 行，否则 profile 无法加载。\n\n### 更改默认值\n\n要改变基于本核心构建的 profile 提供的内容——不同的默认模型、更严格的权限模式、更多或更少的工具——请编辑 profile 的 `cordis.patch.yml` 或添加后面的组合包。每个 patch 条目会替换目标的整个配置，因此请重述每个想保留的设置。保持沙箱化文件系统提供方作为唯一的文件写入路径：在其之上再添加普通文件系统提供方会导致 profile 加载失败。\n\n-----\n\n<a id=\"understand-the-implementation\"></a>\n## 理解实现\n\n<details>\n<summary>实现细节——点击展开</summary>\n\n本组合包是一份静态 patch 文档：一个应用到空 profile 根之上的 `insert` 列表。它不挂载任何服务、不发出任何事件、也不持有任何可变状态；每条插入行所属的包负责该行的行为与不变式。\n\n### 组合机制\n\npatch 会替换目标行的整个 `config`，而不是合并进它。后续组合包层与用户的 profile `cordis.patch.yml` 按 id 覆盖行，每行最后一次写入生效。按模式取值不同的行不属于这里：每个模式组合包重述自己的完整配置，让任何单一行最多只属于一个组合包层加用户层。完整行集合及其设计依据以行内注释写在 [`cordis.patch.yml`](cordis.patch.yml) 里；[生成的组合图](../../../apps/cli/composition.md)负责渲染它。\n\n### 平台门控\n\npatch 在自身上按平台门控两个 shell 栈：`bash-sandbox` 与 `tool-bash` 携带 `disabled: !!js process.platform === 'win32'`，孪生行 `pwsh-sandbox` 与 `tool-pwsh` 以取反的表达式仅在 win32 挂载。权限面与 POSIX 完全一致：沙箱策略通过 Windows ACL 受限令牌 runner（`dsh-sandbox-local` → `@buddhilive/dsh-sandbox-windows-acl`）执行相同的文件效果策略，`fs-sandbox` 继续围栏 `ctx.fs` 写入——在其旁再挂载 `dsh-fs-local` 会重复注册 `ctx.fs` 并在加载时失败。\n\n### 源码地图\n\n| 文件 | 职责 |\n|---|---|\n| [`cordis.patch.yml`](cordis.patch.yml) | 组合包的实体：基础插件行，附以行内注释说明各行依据 |\n| [`src/index.ts`](src/index.ts) | 包入口；不携带任何运行时 API |\n| [`src/invariant.ts`](src/invariant.ts) | 不变式伴生插件：无运行时不变式；每条插入行所属的包负责自己的不变式 |\n| [`tests/base.spec.ts`](tests/base.spec.ts) | manifest 声明与平台门控检查 |\n\n### 不变式归属\n\n不变式伴生插件注册一个空安装器，因为本包是静态 patch 列表载体：每条插入行由所属的包携带其不变式，组合包自身没有任何可审计的可变关系。\n\n</details>\n\n-----\n\n<a id=\"further-exploration\"></a>\n## 进一步探索\n\n当你想深入了解 profile、基于本核心构建的表层或确切组合时，阅读以下页面。\n\n- [app-boot 的 profile 章节](../../boot/app-boot/README.zh.md)——profile 如何解析、分层与定制。\n- [组合包包映射](../README.zh.md)——基于本核心构建的表层。\n- [生成组合图](../../../apps/cli/composition.md)——每个已发布 profile 使用的确切插件集合。\n- [Profile 组合包设计笔记](../../../.agents/notes/implemented/architecture/2026-08-05-profile-plugin-bundles.zh.md)——profile 与组合包的组合设计。\n- [Codex 与 Claude Code provider 组合包](../../subagent/README.zh.md)——可叠加安装的可选 provider 组合包。\n\n-----\n\n<a id=\"model-experience\"></a>\n## 模型体验\n\n通过每条插入行所属的包间接产生影响，由各包负责其行的模型可见行为。\n\n#### KV Cache 影响\n\n组合包本身不添加任何请求前缀；每条插入行所属的包负责各自的缓存影响。\n\n## 已知限制与延期工作\n\n<a id=\"known-limitations-and-deferred-work\"></a>\n\n\n这些限制告诉你核心何时需要额外注意、覆盖应放在哪里。它们是当前包约束，不是通用对比或任务积压。\n\n- **覆盖会替换整个设置块**——patch 条目会替换目标的整个配置，因此你的覆盖必须重述每个想保留的设置；不会自动合并。\n- **按表层的设置属于该表层的组合包**——web GUI 与 headless 模式取值不同的默认值放在对应表层的组合包里，而不是共享核心。\n- **Windows 的临时目录授权是按会话的私有子目录**——`workspace-write` 把写入限制在工作区与会话自己的 temp 子目录（`<temp>\\dsh-<hash>`，受限子进程的 TMP/TEMP 被改写）；`read-only` 不授予任何临时目录写入权限。见 `@buddhilive/dsh-sandbox-windows-acl`。\n- **在沙箱化文件系统提供方之上添加普通提供方会导致 profile 失败**——两者注册同一个服务，profile 因此拒绝加载；二选一。\n\n<a id=\"dev-note\"></a>\n### 开发备注\n\n<details>\n<summary>维护者的工作上下文——点击展开</summary>\n\n无。\n\n</details>\n","readmeFilename":"README.zh.md","_rev":"1-acac4f94c8bc44e1a7042e7f89746097"}