- Add commandsList handler — returns sorted JSON array of all registered verb strings; satisfies workstream-flag.md + agent tooling discoverability - Register ['commands', commandsList] in DECISION_ROUTING_STATIC_CATALOG - Add golden-policy exemption (SDK-only, no CJS mirror needed) - check.decision-coverage-plan/verify were already registered; commands was the remaining gap Closes #3121
This commit is contained in:
19
sdk/src/query/commands-list.ts
Normal file
19
sdk/src/query/commands-list.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { QueryHandler } from './utils.js';
|
||||
import { createRegistry } from './index.js';
|
||||
|
||||
/**
|
||||
* `commands` — return the full list of registered query command strings.
|
||||
*
|
||||
* Closes #3121: the `commands` verb was referenced in workflow files
|
||||
* (references/workstream-flag.md) but had no native SDK handler, causing
|
||||
* a fallback to gsd-tools.cjs which threw "Unknown command: commands".
|
||||
*
|
||||
* Returns: JSON array of all canonical + alias command strings the SDK
|
||||
* registry accepts, sorted alphabetically. Suitable for discoverability
|
||||
* and for agent auto-complete when constructing `gsd-sdk query` calls.
|
||||
*/
|
||||
export const commandsList: QueryHandler<string[]> = async (_args, _projectDir) => {
|
||||
const registry = createRegistry();
|
||||
const cmds = registry.commands().sort((a, b) => a.localeCompare(b));
|
||||
return { data: cmds };
|
||||
};
|
||||
Reference in New Issue
Block a user