π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
#!/usr/bin/env node
// cost-outcome β thin wrapper around `hooks model-outcome` so cost-optimize
// recommendations can be emitted as pre-formatted shell commands. The agent
// (or human) runs this once per applied recommendation and the router learns.
//
// Usage:
// node scripts/outcome.mjs <task-description> <model> <outcome>
// outcome β { success, escalated, failure }
//
// Example:
// node scripts/outcome.mjs "format imports" haiku success
// node scripts/outcome.mjs "design auth flow" sonnet escalated
//
// Why a wrapper: `hooks model-outcome` takes `-t -m -o` and quoting through
// shell pipelines is error-prone. This script uses spawnSync with explicit
// argv so a task description with quotes/newlines is preserved.
import { spawnNpxSync } from './_npx.mjs';
const ALLOWED = new Set(['success', 'escalated', 'failure']);
function main() {
const [task, model, outcome] = process.argv.slice(2);
if (!task || !model || !outcome) {
console.error('usage: outcome.mjs <task-description> <model> <outcome>');
console.error(' outcome β {success, escalated, failure}');
process.exit(2);
}
if (!ALLOWED.has(outcome)) {
console.error(`invalid outcome '${outcome}' β must be one of: success, escalated, failure`);
process.exit(2);
}
const r = spawnNpxSync([
'@claude-flow/cli@latest', 'hooks', 'model-outcome',
'-t', task, '-m', model, '-o', outcome,
], { stdio: 'inherit', shell: process.platform === 'win32' });
if (r.status !== 0) {
console.error(`emit failed (exit ${r.status})`);
process.exit(r.status || 1);
}
}
main();