Problem
toolcraft commands support hidden: true, but toolcraft-openapi loses that bit when handwritten commands are merged into a generated OpenAPI client.
In toolcraft-openapi/dist/define-client.js, cloneCommand copies fields like name, description, examples, aliases, positional, params, secrets, scope, confirm, requires, handler, and render, but does not pass hidden through to defineCommand.
That means a caller cannot add a hidden handwritten command through handwrittenCommands; it becomes visible after cloning.
Repro shape
const hiddenCommand = defineCommand({
name: "install-skill",
hidden: true,
params: S.Object({}),
handler: async () => ({ ok: true }),
});
defineClient({
name: "example",
baseUrl,
auth,
commands: generatedCommands,
handwrittenCommands: [hiddenCommand],
});
Expected: install-skill is runnable but omitted from CLI help.
Actual: the cloned command has hidden: false and appears in help.
Why this matters
poe-agent-tools needs a hidden handwritten install command. Because the hidden flag is not preserved, it currently has to pre-dispatch the command in its handwritten CLI entrypoint instead of using the normal handwrittenCommands extension point.
Acceptance criteria
toolcraft-openapi preserves hidden when cloning handwritten commands.
- Add a regression test covering a hidden handwritten command merged through
defineClient.
Problem
toolcraftcommands supporthidden: true, buttoolcraft-openapiloses that bit when handwritten commands are merged into a generated OpenAPI client.In
toolcraft-openapi/dist/define-client.js,cloneCommandcopies fields likename,description,examples,aliases,positional,params,secrets,scope,confirm,requires,handler, andrender, but does not passhiddenthrough todefineCommand.That means a caller cannot add a hidden handwritten command through
handwrittenCommands; it becomes visible after cloning.Repro shape
Expected:
install-skillis runnable but omitted from CLI help.Actual: the cloned command has
hidden: falseand appears in help.Why this matters
poe-agent-toolsneeds a hidden handwritten install command. Because the hidden flag is not preserved, it currently has to pre-dispatch the command in its handwritten CLI entrypoint instead of using the normalhandwrittenCommandsextension point.Acceptance criteria
toolcraft-openapipreserveshiddenwhen cloning handwritten commands.defineClient.