Files
deepseek-harness/packages/bundle/acp-app/src/index.ts
T
Tianyi Cui 47a46e4cca feat(profiles): add the ACP application bundle
Introduce @deepseek-ai/dsh-acp-app as the thin application layer for the built-in acp profile. It contributes only the ACP protocol bridge and profile metadata; dsh-base remains the single owner of shared agent composition, providers, persistence, permissions, and tools.

Wire the bundle into CLI resolution, catalogs, workspace configuration, and built-bin coverage. The focused bundle and startup tests prove that base plus acp-app exposes automation sessions while keeping stdout reserved for ACP JSON-RPC.
2026-08-23 10:59:00 +08:00

49 lines
1.5 KiB
TypeScript

/**
* The ACP profile's command-line and stdin-lifetime provider. A successful
* parse publishes {@link ACP_APP_STARTUP_SERVICE}; the ACP bridge waits for
* that service, so help starts no transport.
* @module @deepseek-ai/dsh-acp-app
*/
import { Command } from 'commander'
import type { Context } from '@deepseek-ai/cordis'
import { exitOnStdinEnd, parseCmdline } from '@deepseek-ai/dsh-cmdline'
/** Stable Cordis plugin name. */
export const name = 'acp-app-startup'
/** Launcher service required before this app can parse its invocation. */
export const inject = ['cmdlineArgs']
/** Service the ACP bridge row waits for before claiming stdio. */
export const ACP_APP_STARTUP_SERVICE = 'acpAppStartup'
/**
* Build this app's zero-option command and help.
* @returns a fresh program for one invocation.
*/
function acpCommand(): Command {
return new Command()
.name('dsh --profile acp')
.description('Serve automation clients over Agent Client Protocol stdio.')
.helpOption('-h, --help', 'show this help')
.addHelpText('after', `
Example:
dsh --profile acp serve ACP until the client disconnects
`)
}
/**
* Accept an ACP profile invocation, publish readiness, and bind EOF to the
* launcher's bounded shutdown.
* @param ctx - plugin context carrying command-line and exit launcher values.
*/
export function apply(ctx: Context): void {
const program = acpCommand()
program.action(() => {
exitOnStdinEnd(ctx, 'acp-app.stdin')
ctx.provide(ACP_APP_STARTUP_SERVICE, { accepted: true })
})
parseCmdline(ctx, program)
}