@nylorun/core 0.55.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 CHANGED
@@ -1,5 +1,19 @@
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
+
3
17
  ## 0.55.0-beta
4
18
 
5
19
  ### 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.8.json",
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 = 8;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/core",
3
- "version": "0.55.0-beta",
3
+ "version": "0.56.0-beta",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Shared agent definitions and wire contracts",