Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ members = [
"src/crates/assembly/external-sources",
"src/crates/adapters/ai-adapters",
"src/crates/adapters/opencode-adapter",
"src/crates/adapters/dsh-adapter",
"src/crates/adapters/claude-code-adapter",
"src/crates/adapters/codex-adapter",
"src/crates/adapters/static-hook-support",
Expand Down
1 change: 1 addition & 0 deletions scripts/core-boundaries/rules/crate-layout.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const crateLayoutRules = [
{ crateName: 'claude-code-adapter', layer: 'adapters', path: 'src/crates/adapters/claude-code-adapter' },
{ crateName: 'codex-adapter', layer: 'adapters', path: 'src/crates/adapters/codex-adapter' },
{ crateName: 'opencode-adapter', layer: 'adapters', path: 'src/crates/adapters/opencode-adapter' },
{ crateName: 'dsh-adapter', layer: 'adapters', path: 'src/crates/adapters/dsh-adapter' },
{ crateName: 'static-hook-support', layer: 'adapters', path: 'src/crates/adapters/static-hook-support' },
{ crateName: 'transport', layer: 'adapters', path: 'src/crates/adapters/transport' },
{ crateName: 'webdriver', layer: 'adapters', path: 'src/crates/adapters/webdriver' },
Expand Down
15 changes: 15 additions & 0 deletions scripts/core-boundaries/rules/crate-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const agentRuntimeIpcForbiddenDeps = [
'bitfun-codex-adapter',
'bitfun-core',
'bitfun-core-types',
'bitfun-dsh-adapter',
'bitfun-external-sources',
'bitfun-harness',
'bitfun-opencode-adapter',
Expand Down Expand Up @@ -62,6 +63,7 @@ export const noCoreDependencyCrates = [
'product-domains',
'claude-code-adapter',
'codex-adapter',
'dsh-adapter',
'opencode-adapter',
'static-hook-support',
'external-sources',
Expand Down Expand Up @@ -117,6 +119,19 @@ export const forbiddenManifestDependencyRules = [
message:
'only bitfun-core product-full assembly may register bitfun-opencode-adapter through reviewed capability composition roots',
},
{
dependencyNames: ['bitfun-dsh-adapter'],
scanRoots: ['src/apps', 'src/crates', 'BitFun-Installer/src-tauri'],
workspaceManifestPath: 'Cargo.toml',
allowManifestPaths: [
'src/crates/adapters/dsh-adapter/Cargo.toml',
'src/crates/assembly/core/Cargo.toml',
],
reason:
'DeepSeek Harness adapter production dependencies are limited to the reviewed product composition root',
message:
'only bitfun-core product-full assembly may register bitfun-dsh-adapter through reviewed capability composition roots',
},
...[
['bitfun-claude-code-adapter', 'claude-code-adapter'],
['bitfun-codex-adapter', 'codex-adapter'],
Expand Down
5 changes: 5 additions & 0 deletions scripts/core-boundaries/rules/feature-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const optionalDependencyFeatureOwnerRules = [
{ depName: 'bitfun-external-sources', ownerFeatures: ['external-sources'] },
{ depName: 'bitfun-harness', ownerFeatures: ['agent-runtime'] },
{ depName: 'bitfun-opencode-adapter', ownerFeatures: ['external-sources'] },
{ depName: 'bitfun-dsh-adapter', ownerFeatures: ['external-sources'] },
{ depName: 'bitfun-plugin-runtime-client', ownerFeatures: ['plugin-runtime'] },
{ depName: 'bitfun-product-capabilities', ownerFeatures: ['product-capabilities'] },
{
Expand Down Expand Up @@ -390,6 +391,9 @@ export const capabilityContractDependencyRules = [
capabilityEdge(['plugin-runtime']),
capabilityEdge(['script-tool-runtime'], { kind: 'dev' }),
])],
['bitfun-dsh-adapter', capabilityConsumer([
capabilityEdge(['plugin-runtime']),
])],
['bitfun-plugin-runtime-client', capabilityConsumer([
capabilityEdge(['plugin-runtime']),
])],
Expand Down Expand Up @@ -712,6 +716,7 @@ export const coreClosedFeatureProfileRules = [
'mcp-runtime',
'script-tool-runtime',
'dep:bitfun-opencode-adapter',
'dep:bitfun-dsh-adapter',
'dep:bitfun-claude-code-adapter',
'dep:bitfun-codex-adapter',
'dep:bitfun-external-sources',
Expand Down
1 change: 1 addition & 0 deletions src/crates/adapters/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services.
| `agent-runtime-ipc` | Non-published private local IPC adapter for the opt-in first-party Shared TUI Runtime; closed interactive operations only | [AGENTS.md](agent-runtime-ipc/AGENTS.md) |
| `ai-adapters` | AI provider request/response adapters and stream protocol glue | [AGENTS.md](ai-adapters/AGENTS.md) |
| `opencode-adapter` | OpenCode source semantics for user Instructions plus the live Command, standalone Tool, Subagent, MCP, and static Hook providers; managed-package static preview | [AGENTS.md](opencode-adapter/AGENTS.md) |
| `dsh-adapter` | DeepSeek Harness (`dsh`) bundle/profile source projection for managed packages; static preview only | [AGENTS.md](dsh-adapter/AGENTS.md) |
| `claude-code-adapter` | Runtime-free Claude Code user Instructions, Command, Subagent, MCP, and Hook source semantics with redacted projection | [AGENTS.md](claude-code-adapter/AGENTS.md) |
| `codex-adapter` | Runtime-free Codex user Instructions, Subagent, MCP, and Hook source semantics with redacted projection | [AGENTS.md](codex-adapter/AGENTS.md) |
| `static-hook-support` | Shared bounded/redacting static-source utilities plus the JSON/TOML Hook parser used by sibling ecosystem adapters; no ecosystem policy or runtime | inherited |
Expand Down
34 changes: 34 additions & 0 deletions src/crates/adapters/dsh-adapter/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# DeepSeek Harness (dsh) Adapter

This crate owns the static, runtime-free projection of DeepSeek Harness (`dsh`)
plugin package sources. It reads a BitFun-managed package whose
`bitfun.plugin.json` declares `adapter: "dsh_compatible"`, parses the package's
`package.json` `dsh` declaration, and projects the discovered bundle entries
(`dsh.bundle.patch` -> `cordis.patch.yml` rows) and/or profile bundle references
(`dsh.profile.bundles`) as projection-only plugin sources.

It does not execute Cordis plugins, install npm packages, or depend on a
user-local `dsh` CLI. Execution of dsh bundles belongs to future Plugin Host /
external-ACP work, not this adapter boundary.

## Boundary Rules

- Depend on stable contracts (`bitfun-runtime-ports`, `bitfun-product-domains`)
and the `PluginRuntimeAdapter` boundary trait. Do not depend on `bitfun-core`,
app crates, Tauri APIs, product UI, or concrete service managers.
- Keep the dsh `package.json` `dsh` field shape and `cordis.patch.yml` entry
extraction inside this crate. Cross-crate outputs use typed
`PluginSourceRef` / `PluginStatusSnapshot` / `PluginDiagnostic` DTOs; do not
expose raw dsh YAML or JSON as product contracts.
- Cordis rows may mount services that register model-facing tools when dsh runs
them, but static row metadata is not an executable BitFun provider candidate.
`load_dsh_package_adapter` therefore returns no provider dispatch targets.
Unsupported or unparsable content must produce typed invalid projections and
diagnostics, never silent success.
- New ecosystems are sibling adapters registered by Product Assembly
(`bitfun-core/plugin_runtime`), not modes of this adapter.

## Verification

- `cargo test --locked -p bitfun-dsh-adapter --test dsh_source_adapter`
- `cargo test --locked -p bitfun-core --no-default-features --features plugin-runtime --lib plugin_runtime::tests`
33 changes: 33 additions & 0 deletions src/crates/adapters/dsh-adapter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "bitfun-dsh-adapter"
version.workspace = true
authors.workspace = true
edition.workspace = true
description = "DeepSeek Harness (dsh) bundle source projection adapter for BitFun"
autotests = false

[lib]
name = "bitfun_dsh_adapter"
crate-type = ["rlib"]

[dependencies]
async-trait = { workspace = true }
bitfun-plugin-runtime-client = { path = "../../execution/plugin-runtime-client" }
bitfun-product-domains = { path = "../../contracts/product-domains", features = ["plugin-source"] }
bitfun-runtime-ports = { path = "../../contracts/runtime-ports", features = ["plugin-runtime"] }
hex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
sha2 = { workspace = true }
urlencoding = { workspace = true }

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt"] }

[[test]]
name = "dsh_source_adapter"
path = "tests/dsh_source_adapter.rs"

[lints]
workspace = true
11 changes: 11 additions & 0 deletions src/crates/adapters/dsh-adapter/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! DeepSeek Harness (`dsh`) bundle source adapter.
//!
//! The production surface is intentionally small: load a `dsh`-compatible
//! managed package (its `package.json` bundle/profile declaration and any
//! declared `cordis.patch.yml` bundle patch) as a projection-only plugin runtime
//! adapter. The adapter does not execute Cordis plugins, install npm packages,
//! or depend on a user-local `dsh` CLI.
mod source_adapter;

pub use source_adapter::load_dsh_package_adapter;
Loading