Commit Graph

20 Commits

Author SHA1 Message Date
Steve Biedermann b63666bcc2 feat!: rename server and CLI and adopt Clap arguments
Rename the server crate and executable to runa and the REPL to runa-cli. Parse executable arguments with Clap derive/env, default the server to loopback port 3737, and support RUNA_LISTEN and RUNA_CONNECT with explicit flag precedence.

Remove the stdio transport and child-process client. Make mise start launch the server and mise cli launch the REPL, updating extension integration runners and documentation.

BREAKING CHANGE: runa now starts the WebSocket image server rather than the REPL; use runa-cli for the REPL. The runa-server package, stdio transport, LocalClient, ProtocolClient, and serve/serve-network mise tasks are removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-03 15:49:35 +01:00
Steve Biedermann 72a37b178c feat!: use runa-debug WebSockets with live image notifications
Replace plain TCP JSON-lines connections with bounded loopback WebSockets using the required runa-debug subprotocol. Keep single-threaded image dispatch and stdio framing unchanged.

Broadcast coalesced, non-destructive image_changed invalidations after successful mutations. Update the REPL client and automatically refresh VS Code actor trees and open inspectors, preserving request correlation and connection-session isolation.

Validate negotiation, message limits and fragmentation, multi-client notifications, real REPL interoperability, and automatic mailbox/lifecycle/failure inspection in a VS Code extension host.

BREAKING CHANGE: the network endpoint now accepts only runa-debug WebSockets at the root path, not plain TCP JSON Lines. Rust network integrations must use WebSocketClient and serve_websocket. Request/response DTOs remain protocol v3; stdio is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-03 15:36:21 +01:00
Steve Biedermann ad63e286d9 feat!: add structured actor state and messages
Introduce owned portable values with distinct actor references, bounded Rune conversion, JSON REPL literals, and nested reference completion. Preserve isolation and atomic transitions across state, messages, effects, migration, inspection, and TCP clients.

BREAKING CHANGE: protocol v3 replaces integer state and kind/value/target_ref messages with tagged values. Rune handlers now take (state, message) and return (new_state, [(actor_reference, message)]). The REPL send command accepts one JSON message.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 16:56:03 +01:00
Steve Biedermann 350ddba0ce feat!: connect the REPL to the localhost image
Add a reusable loopback TCP client, server-owned counter bootstrap, and shared-image reconnect coverage. Preserve actor state and behavior revisions across client disconnects without retrying uncertain requests.

BREAKING CHANGE: the REPL no longer starts an embedded image. Start runa-server with --listen before connecting; use --connect to select a loopback endpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 15:57:26 +01:00
Steve Biedermann 4f6e7ccfa2 feat: add NanoID actor refs and REPL bindings
Require explicit behavior selection on spawn, expose randomized actor references, and add named REPL bindings, completion, history navigation, and protocol v2 routing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 15:19:25 +01:00
Steve Biedermann ce7bb5602a refactor: route CLI through protocol dispatcher
Replace the CLI's direct ImageApi dependency with protocol commands dispatched through runa-server. Render typed protocol replies for behavior, actor, event, lifecycle, and scheduler operations, preserving the interactive workflow while exercising the same contract used by the local JSON-lines transport.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 14:30:22 +01:00
Steve Biedermann 3146423f78 feat: add local JSON-lines server transport
Expose the runa-server protocol dispatcher over newline-delimited JSON on stdin/stdout for a trusted parent process. Bound request lines to 1 MiB, return one correlated response for each valid request, and fail explicitly on malformed or oversized input. Add the mise serve task and document that this is not a network listener or an authenticated service.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 14:18:45 +01:00
Steve Biedermann adf0eaf4f8 feat: add protocol request dispatcher
Add a transport-neutral runa-server dispatcher that validates protocol requests, routes supported operations through runa-image-api, and converts actor snapshots, behavior revisions, events, and failures into wire DTOs. Document that event retrieval drains the in-memory queue and that network transport and authentication remain future work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 13:44:33 +01:00
Steve Biedermann a65c66db01 feat: define versioned Runa protocol DTOs
Add the runa-protocol crate with version-1 request, response, and event DTOs, serde serialization, and basic envelope and input validation. Document the wire contract and clarify that transport, dispatch, and authentication remain future work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 13:36:32 +01:00
Steve Biedermann 515a6439b5 feat: add trusted in-process image API
Introduce the runa-image-api service boundary for behavior source retrieval, publishing, history, rollback, actor lifecycle, messaging, scheduling, snapshots, and events. Route the local CLI through the API and document that it is trusted and process-local, with no network authentication.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 13:20:45 +01:00
Steve Biedermann 8d3496c621 feat: expose active execution telemetry
Expose the latest completed Rune step count, instruction pointer, and call-frame depth on active actor snapshots. Preserve telemetry while paused and clear it when execution ends or is cancelled. Document that this is not source-level debugging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 13:11:11 +01:00
Steve Biedermann 1916814c2e feat: add explicit handler cancellation
Expose cancellation for active and paused handler invocations. Cancellation drops the invocation, preserves committed state, moves reserved input to the mailbox front for retry, and emits an event. Document that native side effects are not rolled back; test cancelling pending async work and retrying an input under a newly installed behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 13:04:47 +01:00
Steve Biedermann bdc34d037c feat: support atomic state migration on upgrade
Add a safe-point runtime API for explicit state migration during implementation installation. Migration failures preserve both committed actor state and the current implementation; successful changes emit a migration event. Document the current i64-only contract and leave schema-aware or Rune-authored migrations as future work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 12:45:02 +01:00
Steve Biedermann 42a5884f45 feat: add cooperative actor pause and resume
Add pause/resume lifecycle operations that retain active Rune invocations and restore their prior runnable or awaiting state. Expose both operations in the CLI and document the between-tick, non-preemptive guarantee.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 12:35:29 +01:00
Steve Biedermann c857853cf5 feat: expose behavior versions in CLI
Add a mise launcher for the Runa CLI and expose named behavior publish, history, rollback, install, and spawn operations. Update usage documentation and changelog.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 10:24:43 +01:00
Steve Biedermann 3be18f2f53 feat: add versioned behavior registry
Add optimistic behavior publishing, immutable revision history and rollback, plus runtime implementation installation at idle handler boundaries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 10:18:07 +01:00
Steve Biedermann c04a7ed12f feat: add content-addressed Rune code store
Add stable versioned source and implementation IDs, exact original-source retention, compiler fingerprints, and an in-memory compiled artifact cache. Use implementation content IDs in runtime actor references.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 10:08:49 +01:00
Steve Biedermann 2230b666ab feat: add interactive local runtime CLI
Add a REPL for spawning actors, sending messages, ticking, inspection, events, stop, and restart. Expose ordered actor snapshots and document the local control surface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 09:31:25 +01:00
Steve Biedermann e27a40cbf5 test: define actor retry and transition guarantees
Cover failed-message retries from committed state and stop/restart FIFO preservation. Document in-memory all-or-nothing transitions and their process-local limits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 09:27:29 +01:00
Steve Biedermann d766a1b055 feat: add minimal single-worker actor runtime
Implement typed, budgeted Rune invocation slices and a minimal in-memory actor runtime with bounded mailboxes, state transitions, effects, and lifecycle operations. Add feasibility and runtime documentation with tests for async resumption, cancellation, and scheduler fairness.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 09:19:04 +01:00