mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-29 06:13:46 +00:00
fix(dsh): default ACP entrypoint to the official dsh CLI (#2031)
* fix(dsh): default ACP entrypoint to the official dsh CLI The default spawn command was `dsh-acp-demo` — the standalone legacy demo package. Since `@deepseek-ai/dsh` 0.2.0 the ACP profile ships with the main CLI, so `dsh --profile acp` is the maintained entrypoint and the one a plain `npm i -g @deepseek-ai/dsh` install provides. The old default required every self-hoster to also discover and pin the demo package (whose npm `latest` tag is stale) before `hapi dsh` worked at all. - resolveDshAcpCommand defaults to `dsh --profile acp` when no DSH env is set; any explicit `HAPI_DSH_ACP_COMMAND` keeps bare `[]` args so custom wrappers never silently receive the official CLI's flags - DEFAULT_COMMANDS/availability follow, so the PATH probe now checks `dsh` itself - the demo package remains fully supported via explicit `HAPI_DSH_ACP_COMMAND=dsh-acp-demo`; docs updated accordingly Co-Authored-By: Claude Code <noreply@anthropic.com> * Apply config-only DSH overrides through the official CLI's patch overlay HAPI_DSH_ACP_CONFIG without HAPI_DSH_ACP_COMMAND fell through to the default official CLI but passed `--config <path>`, a flag the official dsh CLI does not have — and dropped the required `--profile acp`, so the boot would run the wrong entrypoint with an unknown flag. A config-only override now composes the path as a `--patch` overlay on top of the ACP profile (verified against dsh 0.2.0-rc.2 --dump-config). The `--config` form remains available for legacy community servers pinned via HAPI_DSH_ACP_COMMAND, and both READMEs now document the split. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,7 @@ describe('agent executable resolution', () => {
|
||||
|
||||
it('rejects malformed or missing DSH static configuration', async () => {
|
||||
const directory = await mkdtemp(join(tmpdir(), 'hapi-agent-path-'))
|
||||
await makeExecutable(directory, 'dsh')
|
||||
await makeExecutable(directory, 'dsh-acp-demo')
|
||||
expect(getAgentAvailability('dsh', {
|
||||
PATH: directory,
|
||||
@@ -107,6 +108,11 @@ describe('agent executable resolution', () => {
|
||||
PATH: directory,
|
||||
HAPI_DSH_ACP_CONFIG: config,
|
||||
})).toEqual({ agent: 'dsh', available: true })
|
||||
expect(getAgentAvailability('dsh', {
|
||||
PATH: directory,
|
||||
HAPI_DSH_ACP_COMMAND: 'dsh-acp-demo',
|
||||
HAPI_DSH_ACP_CONFIG: config,
|
||||
})).toEqual({ agent: 'dsh', available: true })
|
||||
})
|
||||
|
||||
it('accepts a macOS Codex app executable when the CLI is absent', async () => {
|
||||
|
||||
@@ -11,7 +11,7 @@ const DEFAULT_COMMANDS: Record<AgentFlavor, string> = {
|
||||
codex: 'codex',
|
||||
copilot: 'copilot',
|
||||
cursor: 'agent',
|
||||
dsh: 'dsh-acp-demo',
|
||||
dsh: 'dsh',
|
||||
gemini: 'gemini',
|
||||
grok: 'grok',
|
||||
kimi: 'kimi',
|
||||
|
||||
Reference in New Issue
Block a user