@runuai/host 0.9.147 → 0.9.148
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/attach-compatibility.ts +51 -0
- package/lib/agents/codex.ts +128 -12
- package/lib/agents/durable-proc.ts +2 -0
- package/lib/agents/machine-durable.ts +15 -0
- package/lib/agents/session-state.ts +107 -0
- package/lib/agents/transport.ts +116 -53
- package/lib/agents/types.ts +3 -3
- package/lib/orchestrator.ts +1294 -73
- package/lib/ulid.ts +10 -1
- package/package.json +1 -1
- package/src/main.ts +2 -0
- package/src/protocol.ts +20 -0
package/lib/ulid.ts
CHANGED
|
@@ -4,4 +4,13 @@ export function newId(): string {
|
|
|
4
4
|
return ulid().toLowerCase();
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* A ULID with its canonical UPPERCASE base32, unlike `newId()` above.
|
|
9
|
+
*
|
|
10
|
+
* Renamed from `monotonicUlid`, which it never was: the plain generator
|
|
11
|
+
* randomises the suffix, so two ids minted in the same millisecond do not
|
|
12
|
+
* sort in call order. Nothing in this package imports it — it is kept only to
|
|
13
|
+
* mirror `lib/ulid.ts`, and it is renamed here too so the false promise is
|
|
14
|
+
* not sitting in the copy someone reads next.
|
|
15
|
+
*/
|
|
16
|
+
export { ulid as rawUlid };
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -212,6 +212,7 @@ import {
|
|
|
212
212
|
HOST_ENGINE_ACCOUNT_SCOPES_PROTOCOL_FEATURE,
|
|
213
213
|
HOST_ENGINE_DISCONNECT_PROTOCOL_FEATURE,
|
|
214
214
|
HOST_ENGINE_LOGIN_PROTOCOL_FEATURE,
|
|
215
|
+
LIVE_ROSTER_EDIT_PROTOCOL_FEATURE,
|
|
215
216
|
isEngineAccountScope,
|
|
216
217
|
HOST_LOGS_PROTOCOL_FEATURE,
|
|
217
218
|
HOST_TASK_INVENTORY_PROTOCOL_FEATURE,
|
|
@@ -916,6 +917,7 @@ function buildCapabilities(): HostCapabilities {
|
|
|
916
917
|
HOST_ENGINE_ACCOUNT_SCOPES_PROTOCOL_FEATURE,
|
|
917
918
|
HOST_ENGINE_ACCOUNT_MANAGE_PROTOCOL_FEATURE,
|
|
918
919
|
HOST_ENGINE_DISCONNECT_PROTOCOL_FEATURE,
|
|
920
|
+
LIVE_ROSTER_EDIT_PROTOCOL_FEATURE,
|
|
919
921
|
// The echo adapter cannot execute the in-task CLI. Advertising typed
|
|
920
922
|
// dispatch in mock mode would let the composer create a Secretary that
|
|
921
923
|
// has no way to wake crew.
|
package/src/protocol.ts
CHANGED
|
@@ -120,6 +120,14 @@ export const HOST_ENGINE_ACCOUNT_MANAGE_PROTOCOL_FEATURE =
|
|
|
120
120
|
"host-engine-account-manage-v1";
|
|
121
121
|
export const HOST_ENGINE_ACCOUNT_SCOPES_PROTOCOL_FEATURE =
|
|
122
122
|
"host-engine-account-scopes-v1";
|
|
123
|
+
/** ADR-049 addendum: live roster edits. On channel.ensure the host diffs the
|
|
124
|
+
* live roster against the spec — an agent whose kind, model or effort changed
|
|
125
|
+
* has its session recycled so the reconciler respawns it on the new settings,
|
|
126
|
+
* and an agent missing from the spec has its session stopped (its session dir
|
|
127
|
+
* stays). A host without this keeps a changed agent's old process until some
|
|
128
|
+
* unrelated respawn and never stops a removed one, so the cloud refuses to
|
|
129
|
+
* edit or remove a running task's agents on it. */
|
|
130
|
+
export const LIVE_ROSTER_EDIT_PROTOCOL_FEATURE = "live-roster-edit-v1";
|
|
123
131
|
/** The owner-level account scope; every pre-scope account lives here. */
|
|
124
132
|
export const HOST_ACCOUNT_SCOPE = "host";
|
|
125
133
|
const ORG_ACCOUNT_SCOPE_RE = /^org:[A-Za-z0-9_-]{1,128}$/;
|
|
@@ -2037,6 +2045,18 @@ export type HostEvent =
|
|
|
2037
2045
|
agentId: string;
|
|
2038
2046
|
reason: string;
|
|
2039
2047
|
}
|
|
2048
|
+
// A roster change moved an agent's session (LIVE_ROSTER_EDIT_PROTOCOL_FEATURE).
|
|
2049
|
+
// `restarting`: its kind/model/effort changed and the old session was stopped
|
|
2050
|
+
// (at once when idle, otherwise when its turn ended) — the reconciler is
|
|
2051
|
+
// respawning it. `ready`: that replacement session bound. `removed`: the
|
|
2052
|
+
// agent left the roster and its session was stopped. An older cloud ignores
|
|
2053
|
+
// the unknown kind.
|
|
2054
|
+
| {
|
|
2055
|
+
kind: "agent.session";
|
|
2056
|
+
taskId: string;
|
|
2057
|
+
agentId: string;
|
|
2058
|
+
state: "restarting" | "ready" | "removed";
|
|
2059
|
+
}
|
|
2040
2060
|
// A host-originated system note for the task channel (ADR-027) — e.g. gh
|
|
2041
2061
|
// auth expired. The cloud renders it as an author:"system" message.
|
|
2042
2062
|
| {
|