refactor: remove stale SDK router shim wrappers (#298)

* refactor(#297): remove stale sdk router shim wrappers

* test: remove sdk-era refusal wording fixtures
This commit is contained in:
Tom Boucher
2026-05-26 12:21:04 -04:00
committed by GitHub
parent e905ca1c32
commit e4f29feabc
8 changed files with 27 additions and 68 deletions

View File

@@ -9,12 +9,9 @@ const { createHub, ERROR_KINDS, makeInvalidArgs } = require('./command-routing-h
* Manifest-backed phase subcommand router.
* Keeps gsd-tools.cjs thin while preserving existing command semantics.
*
* #175: Hub is CJS-only. The SDK bridge is still separately invokable via
* bin/lib/cjs-sdk-bridge.cjs, but the Hub no longer routes to it.
*
* SDK-only (unsupported in CJS router — error returned before dispatch):
* - list-plans: SDK-only.
* - list-artifacts: SDK-only.
* Unsupported in this router (error returned before dispatch):
* - list-plans.
* - list-artifacts.
* - scaffold: routed through top-level scaffold command.
*
* CJS-only subcommands: mvp-mode (dispatched directly, before hub).
@@ -23,11 +20,11 @@ const { createHub, ERROR_KINDS, makeInvalidArgs } = require('./command-routing-h
* and observable CLI behaviour are unchanged.
*/
function routePhaseCommand({ phase, args, cwd, raw, error }) {
// ── Unsupported / SDK-only subcommands ─────────────────────────────────────
// ── Unsupported subcommands ────────────────────────────────────────────────
// Resolved before dispatch so the error message matches the pre-#3788 text.
const UNSUPPORTED = {
'list-plans': 'phase list-plans is SDK-only. Use: gsd-sdk query phase.list-plans ...',
'list-artifacts': 'phase list-artifacts is SDK-only. Use: gsd-sdk query phase.list-artifacts ...',
'list-plans': 'phase list-plans is not supported in this router.',
'list-artifacts': 'phase list-artifacts is not supported in this router.',
scaffold: 'phase scaffold is routed through the top-level scaffold command.',
};
@@ -149,7 +146,7 @@ function routePhaseCommand({ phase, args, cwd, raw, error }) {
// ── Build manifest (available subcommands for UnknownCommand detection) ─────
// `availableSubcommands` is what the error message shows. It excludes
// SDK-only unsupported commands (already handled above) but does NOT include
// unsupported commands (already handled above) but does NOT include
// 'mvp-mode' because it was absent from PHASE_SUBCOMMANDS in the original
// and was not shown in the "Available:" list there either.
//