@nylorun/core 0.54.0-beta → 0.56.0-beta
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/CHANGELOG.md +26 -0
- package/dist/harness-api/harness-api.schema.json +27 -1
- package/dist/harness-api/json-schema.js +4 -2
- package/dist/harness-api/schema.d.ts +11 -0
- package/dist/harness-api/schema.js +9 -0
- package/dist/harness-api/transport.d.ts +1 -0
- package/dist/harness-api/transport.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.56.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 54315b4: A Runtime can host Tenants. With `NYLORUN_TENANT_CREATION=on` (chart `tenant.creation`), the
|
|
8
|
+
Tenant's management key creates, lists, reads and deletes other Tenants in the same database
|
|
9
|
+
(`/v1/tenants`); each is given its own management and application keys, shown once. A request
|
|
10
|
+
reaches a hosted Tenant by naming it (`Nylorun-Tenant`) with one of its own keys. Hosted Tenants
|
|
11
|
+
are opened at start and on first use; each has its own directory (`tenants/<id>/`) and Object
|
|
12
|
+
store prefix, and trusts no identity-file issuer. Our harness connects to each hosted Tenant too
|
|
13
|
+
(the Harness API's new `tenants` request), a pod's engine names its Tenant when it joins
|
|
14
|
+
(`HostJoinRequest.tenantId`, `NYLORUN_TENANT_ID`), and the gateway serves each Tenant's model and
|
|
15
|
+
tool calls from its own vault.
|
|
16
|
+
|
|
17
|
+
## 0.55.0-beta
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- f2ce855: A computer's awake time is recorded, and an idle computer waits for a command that outlives its turn.
|
|
22
|
+
|
|
23
|
+
- **`agent.resumed`.** Each time a pod becomes ready (its first start, a resume, a restart, or a move off a draining worker, cause `drain`, written with the drain's `agent.suspended`), its Agent's stream gets `agent.resumed`. Its awake time ends at the same Agent's next `agent.suspended`, `.failed`, `.lost`, `.reset`, `.deleted`, `.start_failed` or `.resumed`; an event's `time` is its commit time.
|
|
24
|
+
- **`GET /v1/tenant/agent-events`** (management key; `client.tenant.exportAgentEvents()` in `@nylorun/admin`) exports every Agent's events in safe transaction order, filtered by `types`, resumable from `next`, so an operator's meter can pair them into intervals. Migration 0051 adds `agent_events.txid` and its index. The Runtime meters nothing itself.
|
|
25
|
+
- **`GET /v1/activity`** on a computer (the computer agent and the engine's `--service computer`) answers `{ running, lastActivityAt }`. Before an idle suspend the Runtime asks it, and a computer with a command running, or one that started or ended within the idle period, stays awake until none has. A computer that can't answer (an older computer agent) is suspended as before.
|
|
26
|
+
- The disk measure before an idle suspend runs at most once an hour per computer, so a short `limits.idle` doesn't wait for `du` every time.
|
|
27
|
+
- Fixed: the idle timer could suspend a pod that had just become ready, before the Runtime saw it running.
|
|
28
|
+
|
|
3
29
|
## 0.54.0-beta
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://docs.nylorun.com/schemas/harness-api/v5.
|
|
3
|
+
"$id": "https://docs.nylorun.com/schemas/harness-api/v5.9.json",
|
|
4
4
|
"title": "Nylorun Harness API 5",
|
|
5
5
|
"$defs": {
|
|
6
6
|
"ArtifactMeta": {
|
|
@@ -3217,6 +3217,10 @@
|
|
|
3217
3217
|
"volumeId": {
|
|
3218
3218
|
"type": "string",
|
|
3219
3219
|
"pattern": "^[A-Za-z0-9-]{1,64}$"
|
|
3220
|
+
},
|
|
3221
|
+
"tenantId": {
|
|
3222
|
+
"type": "string",
|
|
3223
|
+
"minLength": 1
|
|
3220
3224
|
}
|
|
3221
3225
|
},
|
|
3222
3226
|
"required": [
|
|
@@ -3297,6 +3301,28 @@
|
|
|
3297
3301
|
],
|
|
3298
3302
|
"additionalProperties": false
|
|
3299
3303
|
},
|
|
3304
|
+
"tenants.params": {
|
|
3305
|
+
"type": "object",
|
|
3306
|
+
"properties": {},
|
|
3307
|
+
"additionalProperties": false
|
|
3308
|
+
},
|
|
3309
|
+
"tenants.result": {
|
|
3310
|
+
"type": "object",
|
|
3311
|
+
"properties": {
|
|
3312
|
+
"tenants": {
|
|
3313
|
+
"type": "array",
|
|
3314
|
+
"items": {
|
|
3315
|
+
"type": "string",
|
|
3316
|
+
"minLength": 1,
|
|
3317
|
+
"maxLength": 512
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
},
|
|
3321
|
+
"required": [
|
|
3322
|
+
"tenants"
|
|
3323
|
+
],
|
|
3324
|
+
"additionalProperties": false
|
|
3325
|
+
},
|
|
3300
3326
|
"lease.params": {
|
|
3301
3327
|
"type": "object",
|
|
3302
3328
|
"properties": {
|
|
@@ -62,9 +62,11 @@ export function harnessApiSchemas() {
|
|
|
62
62
|
`routing.sandbox.computer` and the request `computer.open`, which a v5 harness never
|
|
63
63
|
sees unless the Tenant's pod Agents are computers. Revision 7: the request `computer.current`,
|
|
64
64
|
which only a harness that drives computers sends. Revision 8: `turn.start.role`, the
|
|
65
|
-
session's role, which the Runtime sends only to our own harness.
|
|
65
|
+
session's role, which the Runtime sends only to our own harness. Revision 9: the request
|
|
66
|
+
`tenants` and the join's `tenantId`, for a Host serving hosted Tenants; a harness that never
|
|
67
|
+
asks is unchanged.
|
|
66
68
|
*/
|
|
67
|
-
const SCHEMA_REVISION =
|
|
69
|
+
const SCHEMA_REVISION = 9;
|
|
68
70
|
/** The JSON Schema document of the Harness API (draft 2020-12). */
|
|
69
71
|
export function harnessApiJsonSchema() {
|
|
70
72
|
const $defs = {};
|
|
@@ -670,6 +670,17 @@ export declare const harnessRequests: {
|
|
|
670
670
|
renewEveryMs: z.ZodNumber;
|
|
671
671
|
}, z.core.$strict>;
|
|
672
672
|
};
|
|
673
|
+
/**
|
|
674
|
+
* The hosted Tenants open on the Host, asked by our harness on the Host's own Tenant's
|
|
675
|
+
* connection: it connects to each of them too, naming it (`Nylorun-Tenant`). Empty on any
|
|
676
|
+
* other connection.
|
|
677
|
+
*/
|
|
678
|
+
tenants: {
|
|
679
|
+
params: z.ZodObject<{}, z.core.$strict>;
|
|
680
|
+
result: z.ZodObject<{
|
|
681
|
+
tenants: z.ZodArray<z.ZodString>;
|
|
682
|
+
}, z.core.$strict>;
|
|
683
|
+
};
|
|
673
684
|
lease: {
|
|
674
685
|
params: z.ZodObject<{
|
|
675
686
|
slots: z.ZodOptional<z.ZodNumber>;
|
|
@@ -523,6 +523,15 @@ export const harnessRequests = {
|
|
|
523
523
|
})
|
|
524
524
|
.strict(),
|
|
525
525
|
},
|
|
526
|
+
/**
|
|
527
|
+
* The hosted Tenants open on the Host, asked by our harness on the Host's own Tenant's
|
|
528
|
+
* connection: it connects to each of them too, naming it (`Nylorun-Tenant`). Empty on any
|
|
529
|
+
* other connection.
|
|
530
|
+
*/
|
|
531
|
+
tenants: {
|
|
532
|
+
params: empty,
|
|
533
|
+
result: z.object({ tenants: z.array(id) }).strict(),
|
|
534
|
+
},
|
|
526
535
|
lease: {
|
|
527
536
|
params: z.object({ slots: z.number().int().positive().optional() }).strict(),
|
|
528
537
|
result: z.object({ run: RunGrantSchema, input: TurnStartSchema }).strict(),
|
|
@@ -40,6 +40,7 @@ export declare const HostJoinRequestSchema: z.ZodObject<{
|
|
|
40
40
|
podUid: z.ZodString;
|
|
41
41
|
joinToken: z.ZodString;
|
|
42
42
|
volumeId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
43
44
|
}, z.core.$strict>;
|
|
44
45
|
export type HostJoinRequest = z.infer<typeof HostJoinRequestSchema>;
|
|
45
46
|
/**
|
|
@@ -40,6 +40,11 @@ export const HostJoinRequestSchema = z.strictObject({
|
|
|
40
40
|
podUid: z.string().regex(POD_UID_PATTERN),
|
|
41
41
|
joinToken: z.string().min(1).max(JOIN_TOKEN_MAX),
|
|
42
42
|
volumeId: z.string().regex(POD_UID_PATTERN).optional(),
|
|
43
|
+
/**
|
|
44
|
+
* The Tenant the pod's Agent is of (`NYLORUN_TENANT_ID`), for a Host serving several: sandbox
|
|
45
|
+
* ids are a Tenant's own. Absent, the Host's own Tenant.
|
|
46
|
+
*/
|
|
47
|
+
tenantId: z.string().min(1).optional(),
|
|
43
48
|
});
|
|
44
49
|
/**
|
|
45
50
|
* What `host/join` and `host/renew` answer. The host token is the WebSocket bearer; the egress
|