@runuai/host 0.9.120 → 0.9.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/protocol.ts CHANGED
@@ -1074,6 +1074,9 @@ export interface HostCapabilities {
1074
1074
  * Present when the host is configured for them; the cloud shows the
1075
1075
  * provider/region on the host page and, eventually, per-task backing
1076
1076
  * choice keys off it. */
1077
+ /** ADR-133 sidecar mode: this host IS the task's machine — exactly one
1078
+ * task, no container runtime, tunnels on loopback. */
1079
+ sidecar?: { taskId: string };
1077
1080
  machineTasks?: {
1078
1081
  provider: string;
1079
1082
  region?: string;
@@ -1695,9 +1698,32 @@ export type CloudToHost =
1695
1698
  // only entries it never transmitted, replaying nothing.
1696
1699
  | { kind: "event.resume"; afterSeq: number | null }
1697
1700
  // ADR-103: cumulative — the host trims outbox entries with seq <= seq.
1698
- | { kind: "event.ack"; seq: number };
1701
+ | { kind: "event.ack"; seq: number }
1702
+ // ADR-133 leases: the cloud's answer to a sidecar's `lease.request`.
1703
+ | { kind: "lease.grant"; opId: string; lease: TaskLease }
1704
+ | { kind: "lease.deny"; opId: string; error: string };
1699
1705
 
1700
1706
  /** One MCP-connection operation (ADR-057), executed by the host. */
1707
+ /**
1708
+ * ADR-133: the short-lived AWS credentials a task machine runs on — an STS
1709
+ * session tagged with the task's workspace and owner, issued by the cloud
1710
+ * over the bridge and held in the sidecar's memory only. `expiresAt` is the
1711
+ * session expiry (epoch ms); the sidecar re-requests before it.
1712
+ */
1713
+ export interface TaskLease {
1714
+ accessKeyId: string;
1715
+ secretAccessKey: string;
1716
+ sessionToken: string;
1717
+ expiresAt: number;
1718
+ region: string;
1719
+ /** Files bucket and this task's prefixes inside it (S3 shared files). */
1720
+ files: {
1721
+ bucket: string;
1722
+ orgPrefix: string | null;
1723
+ userPrefix: string;
1724
+ };
1725
+ }
1726
+
1701
1727
  export type McpOp =
1702
1728
  // Probe `url` (MCP initialize). No auth → connected. 401 → walk the OAuth
1703
1729
  // discovery chain (RFC 9728 → 8414 → 7591), prepare PKCE, and ack
@@ -1751,6 +1777,8 @@ export type HostToCloud =
1751
1777
  // a task's containers, so the cloud mirrors the status (currently "stopped").
1752
1778
  | { kind: "task.status"; taskId: string; status: string }
1753
1779
  | { kind: "ping"; ts: number }
1780
+ // ADR-133: a sidecar asks for (or refreshes) its task-scoped AWS lease.
1781
+ | { kind: "lease.request"; opId: string; taskId: string }
1754
1782
  | {
1755
1783
  kind: "tunnel.ack";
1756
1784
  tunnelId: string;