@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/lib/agents/transport.ts +2 -1
- package/lib/browser-testing.ts +2 -1
- package/lib/credential-store.ts +4 -0
- package/lib/lease.ts +216 -0
- package/lib/mcp-gateway.ts +2 -1
- package/lib/orchestrator.ts +4 -3
- package/lib/shared-files-s3.ts +153 -0
- package/lib/sidecar.ts +18 -0
- package/lib/standard-image.ts +7 -0
- package/lib/task-environment/index.ts +27 -6
- package/lib/task-environment/legacy-adoption.ts +2 -1
- package/lib/task-environment/machine-task-up.ts +24 -6
- package/lib/task-environment/self.ts +346 -0
- package/lib/task-environment/types.ts +13 -0
- package/package.json +1 -1
- package/src/cli.ts +7 -2
- package/src/index.ts +5 -4
- package/src/main.ts +115 -47
- package/src/protocol.ts +29 -1
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;
|