A3S Code
Commands
Command surfaces and recommended control flows
Commands
A3S Code is primarily SDK-driven. Product CLIs and UIs usually map commands to session APIs rather than depending on legacy public lifecycle commands.
Recommended Mappings
| User action | Session API |
|---|---|
| Send a prompt | session.send(prompt) |
| Stream a prompt | session.stream(prompt) |
| Ask a side question | session.btw(question) |
| Run a deterministic tool | session.tool(name, args) |
| Read history | session.history() |
| Save state | session.save() |
| Resume state | agent.resumeSession(id, options) |
| Inspect tools | session.toolNames() / session.toolDefinitions() |
| Verify work | session.verifyCommands(subject, commands) |
| Replay run state | session.runs() / session.runEvents(runId) |
| Inspect or cancel the current run | session.currentRun() / session.cancelRun(runId) |
Building Slash Commands
If your app exposes slash commands, keep them thin. Register the handler, list
the available commands, and invoke the command through session.send():
session.registerCommand('docs_status', 'Return docs command status', (args, ctx) => {
return `status args=${args}; session=${ctx.sessionId}; workspace=${ctx.workspace}`;
});
console.log(session.listCommands());
const result = await session.send('/docs_status check');
console.log(result.text);Avoid hidden loops or background schedulers. Make recurring automation explicit in your host application so it can be audited and cancelled.