diff --git a/package.json b/package.json index d987ad00..beeff3d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tangle-network/agent-runtime", - "version": "0.53.0", + "version": "0.54.0", "description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.", "homepage": "https://github.com/tangle-network/agent-runtime#readme", "repository": { diff --git a/src/runtime/index.ts b/src/runtime/index.ts index e4a924e1..850ac491 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -301,6 +301,9 @@ export { type DriverToolCall, type DriverTurn, } from './supervise/coordination-driver' +// Supervisor-as-MCP: serve the coordination verbs as a real HTTP MCP over a live Scope, so any +// harness (claude-code / codex / opencode) BECOMES the supervisor by mounting one MCP server. +export { type CoordinationMcpHandle, serveCoordinationMcp } from './supervise/coordination-mcp' // The recursive driver-executor: a spawned child can BE a driver (agents drive agents), // resolved through `withDriverExecutor` and run over a nested `Scope` one depth deeper on // the SAME conserved pool. @@ -311,9 +314,6 @@ export { isDriverSpec, withDriverExecutor, } from './supervise/driver-executor' -// Supervisor-as-MCP: serve the coordination verbs as a real HTTP MCP over a live Scope, so any -// harness (claude-code / codex / opencode) BECOMES the supervisor by mounting one MCP server. -export { type CoordinationMcpHandle, serveCoordinationMcp } from './supervise/coordination-mcp' // The ONE built-in executor entrypoint: backend-as-data (`createExecutor({backend})`). // The per-backend factories are internal case-arms; BYO agents implement `Executor`. export { diff --git a/src/runtime/strategy.ts b/src/runtime/strategy.ts index e2c5cbc1..4519172c 100644 --- a/src/runtime/strategy.ts +++ b/src/runtime/strategy.ts @@ -27,8 +27,8 @@ import type { RuntimeHooks } from '../runtime-hooks' import { observe } from './observe' import type { Outcome } from './personify/types' import type { Corpus } from './personify/wave-types' -import { withDriverExecutor } from './supervise/driver-executor' import { routerToolLoop } from './router-client' +import { withDriverExecutor } from './supervise/driver-executor' import { createSupervisor } from './supervise/supervisor' import type { Agent, diff --git a/src/runtime/waterfall.ts b/src/runtime/waterfall.ts index 653b2133..f2c40114 100644 --- a/src/runtime/waterfall.ts +++ b/src/runtime/waterfall.ts @@ -103,7 +103,11 @@ export function createWaterfallCollector(): WaterfallCollector { totalTokens.input += s.tokens.input totalTokens.output += s.tokens.output const kind = s.label.includes(':') ? (s.label.split(':')[0] as string) : s.label - const k = (byKind[kind] ??= { count: 0, ms: 0, usd: 0, tokens: { input: 0, output: 0 } }) + let k = byKind[kind] + if (!k) { + k = { count: 0, ms: 0, usd: 0, tokens: { input: 0, output: 0 } } + byKind[kind] = k + } k.count += 1 k.ms += (s.endMs ?? s.startMs) - s.startMs k.usd += s.usd diff --git a/tests/build-composition.test.ts b/tests/build-composition.test.ts index 24cfc707..8f0b068f 100644 --- a/tests/build-composition.test.ts +++ b/tests/build-composition.test.ts @@ -10,7 +10,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import type { AnalystFinding } from '@tangle-network/agent-eval' import { gitWorktreeAdapter } from '@tangle-network/agent-eval/campaign' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { agenticGenerator, commandVerifier } from '../src/improvement/agentic-generator' import { mcpBuildPrompt, toolBuildPrompt } from '../src/improvement/build-prompts' import { mcpServeVerifier } from '../src/improvement/mcp-serve-verifier'