Use Realmroot only for human and machine authentication, authorize AMA through the browser user's multi-resource grant, and restore AK-managed Ed25519 Agent sessions.
Preserve Better Auth source tables while removing the mistaken Realmroot Agent binding and machine M2M paths.
BREAKING CHANGE: AK no longer accepts Realmroot Agent tokens or AMA machine credentials; active browser users must sign in again to authorize the AMA resource.
Replace Better Auth user, machine, and agent authentication with Realmroot native flows, migrate tenant ownership, and route AMA access through the cutover adapter. Preserve this deployed migration state as the baseline for the narrower user-auth-only redesign.
Bundle a pure C Node-API process ancestry addon, support Windows runner installation and executable discovery, and make runner lifecycle and logs cross-platform.\n\nAdd Windows CI and release packaging for the native addon.\n\nCloses #210
Backward compatibility for the session-event/relay migration: after the new
server deploys, an un-upgraded ak (legacy daemon) must keep showing its task's
session in the web chat alongside a new ak (AMA runner).
- ChatPanel branches per task: ama.sessionId annotation present -> the AMA path
(snapshot of the AMA session events, now sourced from the Session DO for
cloud-loop runtimes); absent -> the surviving RelayRuntimeProvider legacy
tunnel keyed by the task's active_session_id. The AMA snapshot logic moved
into an AmaSessionChat sub-component so its hooks stay unconditional.
- TaskChatDrawer derives amaSessionId + relaySessionId and threads them through.
Neither path blanks the other; each task detail shows its own transcript.
- Bump @any-managed-agents/sdk to 2ce8c56 (Session DO + stream() facade).
Gate: pnpm build + pnpm typecheck + npx vitest run green (2600 + 17 new
ChatPanel branch tests).
Replace the hand-written `new AmaClient().request("opId", body)` calls (body
typed `unknown`) with the SDK's resource facade — `createAmaClient(...)
.<resource>.<verb>(...)` — so every request body and response is checked
against the OpenAPI contract at compile time. Drops the four internal
Ama*Response shadow interfaces (the generated models are their supertypes).
Pin @any-managed-agents/sdk to 3a435be (community-generated SDK + facade).
AMA test fetch mocks updated for the standards-compliant client: it calls
fetch(new Request(...)) with one argument and parses JSON by content-type.
build + typecheck + full suite (2600) green.
Deleting a maintainer now truly removes it on both sides: the AK board_maintainers
row is deleted, and the AMA trigger (plus its runs) is deleted via the new
deleteTrigger endpoint — no more soft archive. Pause/resume still covers "stop but
keep"; delete is permanent.
- Bump @any-managed-agents/sdk to a929816 (adds the deleteTrigger operation).
- amaRuntime: archiveAmaScheduledAgentTrigger → deleteAmaScheduledAgentTrigger
(calls deleteTrigger; AMA returns 204).
- boardMaintainerRepo: add deleteBoardMaintainer (hard delete).
- routes: maintainer DELETE now deletes both sides, returns { ok: true }.
- console: the maintainer "Archive" action becomes a destructive "Delete" with a
confirm.
- tests: the maintainer DELETE tests assert the trigger DELETE + row removal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AMA de-tenanted its model catalog into a single global vendor catalog
auto-discovered from models.dev, removing per-tenant provider CRUD and the
per-runtime cloud-models endpoint. Adapt AK to match (SDK pin 5d2d602->e921866):
- listRuntimeModels (GET /runtimes/{runtime}/models, REMOVED) -> listModels
(GET /api/v1/providers/models, runtime-agnostic global catalog). modelCatalog
cloud path fetches it and re-imposes AK's preferred order (kimi-k2.7-code,
gpt-oss-120b first) since the global catalog is unordered; self-hosted still
discovers models from live runner capabilities.
- createProvider/upsertProviderModel/listProviders (REMOVED): provider identity
is now the vendor slug (providers.id === slug), so resolveAmaProviderModelProfile
is pure -- it derives the vendor from the model id (vendorFromModelId) for cloud
and uses a runtime->vendor map for self-hosted. No more per-dispatch AMA calls.
Smoke (live ama.tftt.cc): claude 11/11, ama 10/10, mixed 11/11.
The cloud model list was duplicated: AMA's RUNTIME_CATALOG.ama and AK's own
CLOUD_RUNTIME_MODELS. Make AMA the single source of truth — AK's
listRuntimeModels now fetches GET /api/v1/runtimes/{runtime}/models (new SDK op
listRuntimeModels, SDK pin 9a918c8->5d2d602). A non-empty result is a cloud
runtime; self-hosted runtimes return [] and fall through to runner-capability
discovery. The smoke's ama default model is likewise dynamic now
(ak get model --runtime ama -> data[0] = kimi-k2.7-code), so a catalog change
applies everywhere from one place. Verified end-to-end against the live AMA.
AMA rewrote its control plane as a strict RESTful /api/v1 API (#60) and
hardened its v1 schema (resetting data). Adapt AK to the new contract and
re-verify the full self-hosted + cloud task lifecycle.
- Bump @any-managed-agents/sdk pin to the refactored main (9a918c8).
- Rewrite amaRuntime.ts to /api/v1 operations and shapes:
createSessionCommand->createSessionMessage (message->content),
stopSession->updateSession{state:stopped},
createExternalProjectBinding->createFederatedTenant (+session:poll/claim
caps, 409-idempotent), scheduled-trigger ops->trigger ops,
readUsageSummary->listUsageRecords (summed, cursor-paginated, limit 100).
Field renames: runtimeEnv->env, secretEnv credentialRef{credentialId,
versionId}, provider->providerId, session status->state, runner
state->status.
- taskDispatch/routes updated for the new secret-env, session.state and
federated-tenant call sites.
- Pin ama-runner v0.3.1 (/api/v1 self-hosted runner protocol + 404 re-register
self-heal).
- Smoke: mixed scenario now runs claude locally (+ ama cloud).
- Update AMA-contract unit/integration tests to the new shapes.
Verified locally: daemon smoke claude 11/11, ama 10/10, mixed 11/11;
build + typecheck + 1768 unit/integration tests green.
Server-side AMA fixes pushed to main + deployed separately: AMA_VAULT_
ENCRYPTION_KEY secret, runner 404 self-heal (v0.3.1), idle-session resume
via work item, live-prompt turn-end fix, sandbox.exec AbortSignal-over-RPC fix.
The claude/codex/copilot/ACP SDKs are only exercised by optional
provider features (model listing, dormant execute/history paths) —
execution lives in the external ama-runner. Load them lazily with a
graceful not-installed error and ship them as devDependencies: a fresh
npm install shrinks from ~851MB to ~6MB, small enough for environments
without a populated npm cache. The standalone bundle keeps its stubs;
the workspace-linked dev CLI still resolves the SDKs.
Introduces a runtime-agnostic Agent Client Protocol (ACP) provider via
`createAcpProvider(config)`. Registering a new ACP-compliant agent is a
one-row config entry in registry.ts; hermes is the first runtime to use
it. Existing claude/codex/gemini/copilot providers are left untouched
pending ACP protocol stabilization.
Also promotes `AgentProvider.getHistory` from optional to required so
every provider commits to a uniform contract. Gemini returns `[]` (no
exposed session store); ACP implements real history via `session/load`.
- Add 'copilot' to AgentRuntime union, AGENT_RUNTIMES, RUNTIME_LABELS, RUNTIME_ALIASES in shared types
- Implement CopilotProvider with execute(), getHistory(), fetchUsage()
- Map SDK SessionEvent → AgentEvent via mapCopilotEvent() generator
- Track active sessions for concurrency-safe getHistory() during execution
- Fetch usage via GET /copilot_internal/user with gh auth token
- Register provider in registry.ts and add COPILOT_CLI env var detection in runtime.ts
- Add 43 unit tests for mapCopilotEvent and copilot.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CLI sends X-CLI-Version header with every API request. Server middleware
rejects outdated clients with 426 when MIN_CLI_VERSION is set (heartbeat
excluded so old machines can still report in). CLI checks npm registry
for updates on startup (24h cache, skipped for npx/worker-agent) and
prints a stderr notification. `ak upgrade` command detects install
method (npx/volta/npm -g) and runs the appropriate upgrade command.
Unify the app into a single Worker deployment:
- Move functions/api/ → server/, add worker/index.ts entry point
- Merge relay-worker DO (TunnelRelay) into the main worker
- Replace Pages Functions with @cloudflare/vite-plugin build
- Integrate share SSR (OG meta injection) into Hono routes
- Remove dayjs dep from shared (native Date suffices)
- Simplify dev to single `vite dev`, deploy via CF Git integration
- Delete packages/relay-worker/ and Pages-specific _routes.json
Extracts ChatPanel internals into components/chat/ and registers
per-tool renderers via makeAssistantToolUI so each Claude Code tool
(Bash, Read, Edit, MultiEdit, Write, Grep, Glob, Task, TodoWrite,
WebFetch, WebSearch, AskUserQuestion, ExitPlanMode, SlashCommand,
NotebookEdit) gets a compact collapsible with a one-line summary and
purpose-built details. Unknown tools and mcp__* calls fall through to
a smarter ChatToolFallback that parses the MCP namespace.
- FileDiff uses react-diff-viewer-continued (word-level highlight,
line numbers, auto light/dark palette)
- CodeBlock uses prism-react-renderer with lang autodetect from file
extension, auto light/dark theme via a useIsDarkMode hook
- Adds /mock/chat route backed by useExternalStoreRuntime with
ThreadMessageLike fixtures (including a running message to exercise
loading/spinner states) so the mock page exercises the exact same
component tree as the live ChatPanel