@nylorun/core 0.5.0-beta → 0.6.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,38 @@
1
1
  # @nylorun/core
2
2
 
3
+ ## 0.6.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - bf1c2da: **`nylorun dev --ephemeral` runs on the Docker stack, with a Tenant-level fixture model (breaking beta).**
8
+
9
+ - `nylorun dev --ephemeral` creates a temporary Tenant through `@nylorun/admin` (no Project link written), seeds it from `.env` with the fixture model, opens Studio on it and runs the watcher; the Tenant is deleted with its active work cancelled when the watcher ends, Ctrl-C included. It needs a Runtime that advertises `tenant-fixture-model`.
10
+ - `PUT /v1/tenant/config/seed` accepts `fixtureModel: true`, stored as Tenant setting `model.fixture`: that Tenant's model calls use the Runtime's fixture model while other Tenants on the Host keep theirs. `HOST_PROTOCOL` advertises the new optional feature `tenant-fixture-model` (`OPTIONAL_HOST_FEATURES` in `@nylorun/core/compatibility`); clients do not require it.
11
+ - `startEphemeralRuntime()` keeps its signature but its Tenants live in memory instead of SQLite under the Host root; nothing survives `close()`.
12
+ - Closing a Tenant waits for running advances at most the advance grace period (30 s by default) and then abandons them; their lease lapses and the next advance takes over.
13
+ - A Worker stop, Tenant close or ended Restate attempt no longer fails or cancels the turn it interrupts: outcomes already returned are recorded, nothing is settled, and the next advance resumes the turn from its checkpoint. Only a user cancel settles `cancelled`; an advance deadline fails the turn with the deadline's message.
14
+
15
+ - bf1c2da: **The microsandbox backend is removed; the Runtime runs sandbox tools on the virtual backend only.** The optional `microsandbox` dependency is gone. `sandbox.backend` and `NYLORUN_SANDBOX` accept `auto` or `virtual`, and `auto` selects `virtual`. A Tenant that stored `microsandbox` reads it as `auto`. `nylorun doctor sandbox` and the `nylorun dev` banner report only the virtual shell.
16
+ - bf1c2da: **Tenants are Postgres schemas only; SQLite and the `nylorun-runtime` launcher are removed (breaking beta).**
17
+
18
+ - The Runtime runs on Postgres (the Session Store, one schema per Tenant), Restate (Durable Session Execution: one advance per session, fenced by an ownership epoch, and a per-Tenant sweep) and S2 (Durable Streams: every event is written to a Postgres outbox and relayed to the session's stream, which history and SSE read). `--role api|worker|all` selects the process role; `/ready` covers Postgres, Restate and S2.
19
+ - SQLite Tenants are not migrated. On first start the Runtime moves every `tenants/<id>/` directory that holds a `tenant.sqlite` to `trash/<id>-sqlite-<time>/` and logs `sqlite_tenant_moved_to_trash`; recreate those Tenants.
20
+ - `@nylorun/runtime` has no bin: the `nylorun-runtime` launcher and `host-state.json` are gone. The Runtime runs as the `ghcr.io/nylorun/runtime` image (`nylorun start`); its Host entry requires `NYLORUN_DATABASE_URL`.
21
+ - `openTenantRuntime(config, hooks)` requires the Tenant's opened `store` and `envelope`; `OpenTenantRuntime` receives them from the Tenant store. `HostStateFile` is no longer exported.
22
+ - `@nylorun/core`: `LAUNCHER_PROTOCOL` and the launcher error codes are removed; `QuarantineSchema` drops `locked`, `lockPath` and `lockPid`; `TenantStatusSchema.checks.sqlite` is now `checks.store`. `TenantStatusSchema` gains optional `execution` (stuck invocations) and `streams` (basin, outbox depth, relay lag); `HostAggregateSchema` gains optional `outboxDepth` and `relayLagMs`.
23
+
24
+ - bf1c2da: **Tenants can register a Studio principal.** `CreateTenantRequest` gains optional `studioCredentialHash` behind the new protocol feature `studio-principal`; the Runtime stores it as application principal `studio`, and idempotent create compares it too. `@nylorun/admin` exports `deriveStudioToken(adminKey, tenantId)` (HMAC-SHA256 over `nylorun/studio/v1`, NUL, Tenant id) and `createTenant` sends the hash of that key, so Studio can reach any Tenant's API with a key derived from the admin key. Clients require the new feature, so upgrade the Runtime with them.
25
+
26
+ ### Patch Changes
27
+
28
+ - ba1b239: **`nylorun` sets up the local stack; `@nylorun/cli` becomes the Runtime client `nylo` (breaking beta).**
29
+
30
+ - New unscoped package **`nylorun`**: `npx nylorun up` sets up the Docker stack on the first run and starts it after that, from any directory; `npx nylorun down` stops it (volumes are kept). `up` and `down` are aliases of `start` and `stop`. It also owns `status`, `logs`, `studio`, `reset` and `doctor`, pins the Runtime and Studio images (`package.json` `nylorun.runtime` / `nylorun.studio`), depends on `@nylorun/core` only, and never creates Tenants.
31
+ - **`@nylorun/cli`** is the Runtime client with the command **`nylo`**: `nylo tenant create [name]` (creates the Tenant; in a project, writes the Project link and seeds the model provider and sandbox from `.env`), `nylo tenant current|list|use|status|reset|delete`, `nylo configure`, `nylo env` (was `nylorun status --env`) and `nylo doctor sandbox`. It no longer provides the `nylorun` command or the stack commands.
32
+ - **Removed:** `nylorun dev` and `nylorun dev --ephemeral`. Link once with `nylo tenant create`, then run the project's own `npm run dev`. Moved commands exit 2 and name their replacement.
33
+ - **Starter:** the generated project depends on `@nylorun/agents` only (no Nylorun devDependency); `dev` is `tsx watch --env-file-if-exists=.env src/main.ts`. `npm create @nylorun/agent` installs the project and prints the next steps (`npx nylorun up`, `npx @nylorun/cli tenant create`, `npm run dev`) instead of starting development; `--no-open` is accepted and ignored.
34
+ - `connectAgents` names those steps when it finds no Runtime connection. Runtime repair hints, model errors and core's sandbox message name `nylo` and `nylorun up`.
35
+
3
36
  ## 0.5.0-beta
4
37
 
5
38
  ### Minor Changes
package/README.md CHANGED
@@ -9,7 +9,7 @@ HTTP client, Node host or SDK dependencies.
9
9
  - Root: shared contracts and types; no authoring or execution entry points.
10
10
 
11
11
  Applications normally import `@nylorun/agents`. Hosts and the execution engine
12
- consume core directly. See [package architecture](../docs/design/package-architecture.md).
12
+ consume core directly.
13
13
 
14
14
  A built agent's non-enumerable `getBinding()` retains local functions, tool
15
15
  snapshots, ordered declarations and live output schemas. Only its manifest is
@@ -1,7 +1,14 @@
1
1
  export { hashManifest } from "./utils/hash.js";
2
2
  export declare const PROTOCOL_VERSION = 2;
3
- export declare const PROTOCOL_FEATURES: readonly ["runtime-tenants", "admin-status"];
3
+ export declare const PROTOCOL_FEATURES: readonly ["runtime-tenants", "admin-status", "studio-principal"];
4
4
  export type ProtocolFeature = (typeof PROTOCOL_FEATURES)[number];
5
+ /**
6
+ * Host features no client requires: a client that uses one checks the Host's `/health`
7
+ * for it first. `tenant-fixture-model`: `PUT /v1/tenant/config/seed` accepts
8
+ * `fixtureModel: true` (the Tenant's model calls use the Runtime's fixture model).
9
+ */
10
+ export declare const OPTIONAL_HOST_FEATURES: readonly ["tenant-fixture-model"];
11
+ export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
5
12
  export interface ProtocolRange {
6
13
  min: number;
7
14
  max: number;
@@ -9,10 +16,9 @@ export interface ProtocolRange {
9
16
  }
10
17
  export declare const HOST_PROTOCOL: ProtocolRange;
11
18
  export declare const DEFINITION_SCHEMA_VERSION = 2;
12
- export declare const LAUNCHER_PROTOCOL = 1;
13
19
  export declare const TENANT_HEADER = "Nylorun-Tenant";
14
20
  export declare const PROTOCOL_HEADER = "Nylorun-Protocol";
15
- export declare const ERROR_CODES: readonly ["not_found", "protocol_unsupported", "host_rejected", "origin_rejected", "unsupported_media_type", "tenant_conflict", "active_work", "connection_missing", "incompatible_host", "platform_unsupported", "launcher_failed", "lock_timeout", "foreign_port", "host_unresponsive", "host_start_failed", "host_schema_newer", "host_format_newer", "downgrade_refused", "upgrade_failed"];
21
+ export declare const ERROR_CODES: readonly ["not_found", "protocol_unsupported", "host_rejected", "origin_rejected", "unsupported_media_type", "tenant_conflict", "active_work", "connection_missing", "incompatible_host"];
16
22
  export type ErrorCode = (typeof ERROR_CODES)[number];
17
23
  export declare const TENANT_ID_PATTERN: RegExp;
18
24
  export declare const PRINCIPAL_ID_PATTERN: RegExp;
@@ -1,13 +1,22 @@
1
1
  export { hashManifest } from "./utils/hash.js";
2
2
  export const PROTOCOL_VERSION = 2;
3
- export const PROTOCOL_FEATURES = ["runtime-tenants", "admin-status"];
3
+ export const PROTOCOL_FEATURES = [
4
+ "runtime-tenants",
5
+ "admin-status",
6
+ "studio-principal",
7
+ ];
8
+ /**
9
+ * Host features no client requires: a client that uses one checks the Host's `/health`
10
+ * for it first. `tenant-fixture-model`: `PUT /v1/tenant/config/seed` accepts
11
+ * `fixtureModel: true` (the Tenant's model calls use the Runtime's fixture model).
12
+ */
13
+ export const OPTIONAL_HOST_FEATURES = ["tenant-fixture-model"];
4
14
  export const HOST_PROTOCOL = {
5
15
  min: 2,
6
16
  max: 2,
7
- features: PROTOCOL_FEATURES,
17
+ features: [...PROTOCOL_FEATURES, ...OPTIONAL_HOST_FEATURES],
8
18
  };
9
19
  export const DEFINITION_SCHEMA_VERSION = 2;
10
- export const LAUNCHER_PROTOCOL = 1;
11
20
  export const TENANT_HEADER = "Nylorun-Tenant";
12
21
  export const PROTOCOL_HEADER = "Nylorun-Protocol";
13
22
  export const ERROR_CODES = [
@@ -20,16 +29,6 @@ export const ERROR_CODES = [
20
29
  "active_work",
21
30
  "connection_missing",
22
31
  "incompatible_host",
23
- "platform_unsupported",
24
- "launcher_failed",
25
- "lock_timeout",
26
- "foreign_port",
27
- "host_unresponsive",
28
- "host_start_failed",
29
- "host_schema_newer",
30
- "host_format_newer",
31
- "downgrade_refused",
32
- "upgrade_failed",
33
32
  ];
34
33
  /** Crockford Base32 alphabet (lowercase); excludes i, l, o, u. */
35
34
  const CROCKFORD = "0123456789abcdefghjkmnpqrstvwxyz";
@@ -309,23 +309,13 @@ export declare const RejectedResponseSchema: z.ZodObject<{
309
309
  code: z.ZodEnum<{
310
310
  active_work: "active_work";
311
311
  connection_missing: "connection_missing";
312
- downgrade_refused: "downgrade_refused";
313
- foreign_port: "foreign_port";
314
- host_format_newer: "host_format_newer";
315
312
  host_rejected: "host_rejected";
316
- host_schema_newer: "host_schema_newer";
317
- host_start_failed: "host_start_failed";
318
- host_unresponsive: "host_unresponsive";
319
313
  incompatible_host: "incompatible_host";
320
- launcher_failed: "launcher_failed";
321
- lock_timeout: "lock_timeout";
322
314
  not_found: "not_found";
323
315
  origin_rejected: "origin_rejected";
324
- platform_unsupported: "platform_unsupported";
325
316
  protocol_unsupported: "protocol_unsupported";
326
317
  tenant_conflict: "tenant_conflict";
327
318
  unsupported_media_type: "unsupported_media_type";
328
- upgrade_failed: "upgrade_failed";
329
319
  }>;
330
320
  message: z.ZodString;
331
321
  details: z.ZodOptional<z.ZodUnknown>;
@@ -767,6 +757,7 @@ export declare const CreateTenantRequestSchema: z.ZodObject<{
767
757
  principalId: z.ZodString;
768
758
  credentialHash: z.ZodString;
769
759
  idempotencyKey: z.ZodString;
760
+ studioCredentialHash: z.ZodOptional<z.ZodString>;
770
761
  }, z.core.$strict>;
771
762
  export type CreateTenantRequest = z.infer<typeof CreateTenantRequestSchema>;
772
763
  export declare const AdminTenantSchema: z.ZodObject<{
@@ -790,7 +781,6 @@ export declare const QuarantineSchema: z.ZodObject<{
790
781
  corrupt: "corrupt";
791
782
  "envelope-invalid": "envelope-invalid";
792
783
  "kek-missing": "kek-missing";
793
- locked: "locked";
794
784
  "migration-failed": "migration-failed";
795
785
  "open-failed": "open-failed";
796
786
  "open-timeout": "open-timeout";
@@ -798,8 +788,6 @@ export declare const QuarantineSchema: z.ZodObject<{
798
788
  }>;
799
789
  message: z.ZodString;
800
790
  repair: z.ZodString;
801
- lockPath: z.ZodOptional<z.ZodString>;
802
- lockPid: z.ZodOptional<z.ZodNumber>;
803
791
  }, z.core.$strict>;
804
792
  export type QuarantineInfo = z.infer<typeof QuarantineSchema>;
805
793
  export declare const AdminTenantStatusSchema: z.ZodObject<{
@@ -821,7 +809,6 @@ export declare const AdminTenantStatusSchema: z.ZodObject<{
821
809
  corrupt: "corrupt";
822
810
  "envelope-invalid": "envelope-invalid";
823
811
  "kek-missing": "kek-missing";
824
- locked: "locked";
825
812
  "migration-failed": "migration-failed";
826
813
  "open-failed": "open-failed";
827
814
  "open-timeout": "open-timeout";
@@ -829,8 +816,6 @@ export declare const AdminTenantStatusSchema: z.ZodObject<{
829
816
  }>;
830
817
  message: z.ZodString;
831
818
  repair: z.ZodString;
832
- lockPath: z.ZodOptional<z.ZodString>;
833
- lockPid: z.ZodOptional<z.ZodNumber>;
834
819
  }, z.core.$strict>>;
835
820
  }, z.core.$strict>;
836
821
  export type AdminTenantStatus = z.infer<typeof AdminTenantStatusSchema>;
@@ -839,6 +824,8 @@ export declare const HostAggregateSchema: z.ZodObject<{
839
824
  connectedExecutors: z.ZodNumber;
840
825
  pendingActions: z.ZodNumber;
841
826
  uncertainEffects: z.ZodNumber;
827
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
828
+ relayLagMs: z.ZodOptional<z.ZodNumber>;
842
829
  }, z.core.$strict>;
843
830
  export type HostAggregate = z.infer<typeof HostAggregateSchema>;
844
831
  export declare const AdminHostStatusSchema: z.ZodObject<{
@@ -871,6 +858,8 @@ export declare const AdminHostStatusSchema: z.ZodObject<{
871
858
  connectedExecutors: z.ZodNumber;
872
859
  pendingActions: z.ZodNumber;
873
860
  uncertainEffects: z.ZodNumber;
861
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
862
+ relayLagMs: z.ZodOptional<z.ZodNumber>;
874
863
  }, z.core.$strict>;
875
864
  }, z.core.$strict>;
876
865
  export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
@@ -903,6 +892,8 @@ export declare const AdminStatusSchema: z.ZodObject<{
903
892
  connectedExecutors: z.ZodNumber;
904
893
  pendingActions: z.ZodNumber;
905
894
  uncertainEffects: z.ZodNumber;
895
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
896
+ relayLagMs: z.ZodOptional<z.ZodNumber>;
906
897
  }, z.core.$strict>;
907
898
  host: z.ZodOptional<z.ZodObject<{
908
899
  hostId: z.ZodString;
@@ -946,7 +937,7 @@ export declare const TenantStatusSchema: z.ZodObject<{
946
937
  }, z.core.$strict>;
947
938
  path: z.ZodString;
948
939
  checks: z.ZodObject<{
949
- sqlite: z.ZodBoolean;
940
+ store: z.ZodBoolean;
950
941
  scheduler: z.ZodBoolean;
951
942
  model: z.ZodBoolean;
952
943
  executors: z.ZodBoolean;
@@ -979,6 +970,33 @@ export declare const TenantStatusSchema: z.ZodObject<{
979
970
  backend: z.ZodNullable<z.ZodString>;
980
971
  retained: z.ZodNumber;
981
972
  }, z.core.$strict>;
973
+ execution: z.ZodOptional<z.ZodObject<{
974
+ stuckInvocations: z.ZodArray<z.ZodObject<{
975
+ id: z.ZodString;
976
+ status: z.ZodString;
977
+ service: z.ZodString;
978
+ handler: z.ZodString;
979
+ key: z.ZodString;
980
+ retryCount: z.ZodNumber;
981
+ lastFailure: z.ZodOptional<z.ZodString>;
982
+ modifiedAt: z.ZodOptional<z.ZodString>;
983
+ }, z.core.$strict>>;
984
+ error: z.ZodOptional<z.ZodString>;
985
+ }, z.core.$strict>>;
986
+ streams: z.ZodOptional<z.ZodObject<{
987
+ reachable: z.ZodBoolean;
988
+ basin: z.ZodObject<{
989
+ ready: z.ZodBoolean;
990
+ failures: z.ZodNumber;
991
+ lastError: z.ZodNullable<z.ZodString>;
992
+ }, z.core.$strict>;
993
+ outbox: z.ZodObject<{
994
+ depth: z.ZodNumber;
995
+ oldestAgeMs: z.ZodNullable<z.ZodNumber>;
996
+ }, z.core.$strict>;
997
+ relayLagMs: z.ZodNumber;
998
+ collectionPending: z.ZodBoolean;
999
+ }, z.core.$strict>>;
982
1000
  }, z.core.$strict>;
983
1001
  export type TenantStatus = z.infer<typeof TenantStatusSchema>;
984
1002
  export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
@@ -986,7 +1004,6 @@ export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
986
1004
  sandbox: z.ZodOptional<z.ZodObject<{
987
1005
  backend: z.ZodEnum<{
988
1006
  auto: "auto";
989
- microsandbox: "microsandbox";
990
1007
  virtual: "virtual";
991
1008
  }>;
992
1009
  }, z.core.$strict>>;
@@ -1005,6 +1022,7 @@ export declare const SeedTenantConfigRequestSchema: z.ZodObject<{
1005
1022
  expires: z.ZodNumber;
1006
1023
  }, z.core.$loose>], "type">;
1007
1024
  }, z.core.$strict>>;
1025
+ fixtureModel: z.ZodOptional<z.ZodLiteral<true>>;
1008
1026
  }, z.core.$strict>;
1009
1027
  export type SeedTenantConfigRequest = z.infer<typeof SeedTenantConfigRequestSchema>;
1010
1028
  export declare const SeedTenantConfigResponseSchema: z.ZodObject<{
package/dist/contracts.js CHANGED
@@ -763,9 +763,18 @@ export const CreateTenantRequestSchema = z
763
763
  .object({
764
764
  tenantId: z.string().min(1),
765
765
  name: z.string().min(1),
766
- principalId: z.string().min(1),
766
+ /** `studio` is reserved for the derived Studio principal. */
767
+ principalId: z
768
+ .string()
769
+ .min(1)
770
+ .refine((id) => id !== "studio", "principalId `studio` is reserved"),
767
771
  credentialHash: z.string().regex(/^[0-9a-f]{64}$/),
768
772
  idempotencyKey: IdempotencyKeySchema,
773
+ /** SHA-256 of the derived Studio key; registers principal `studio` (feature `studio-principal`). */
774
+ studioCredentialHash: z
775
+ .string()
776
+ .regex(/^[0-9a-f]{64}$/)
777
+ .optional(),
769
778
  })
770
779
  .strict();
771
780
  export const AdminTenantSchema = z
@@ -779,7 +788,6 @@ export const AdminTenantSchema = z
779
788
  export const QuarantineSchema = z
780
789
  .object({
781
790
  code: z.enum([
782
- "locked",
783
791
  "kek-missing",
784
792
  "corrupt",
785
793
  "schema-too-new",
@@ -790,8 +798,6 @@ export const QuarantineSchema = z
790
798
  ]),
791
799
  message: z.string(),
792
800
  repair: z.string(),
793
- lockPath: z.string().optional(),
794
- lockPid: z.number().int().optional(),
795
801
  })
796
802
  .strict();
797
803
  export const AdminTenantStatusSchema = AdminTenantSchema.extend({
@@ -803,6 +809,10 @@ export const HostAggregateSchema = z
803
809
  connectedExecutors: z.number().int().nonnegative(),
804
810
  pendingActions: z.number().int().nonnegative(),
805
811
  uncertainEffects: z.number().int().nonnegative(),
812
+ /** Events committed but not yet relayed to Durable Streams, over the open Tenants. */
813
+ outboxDepth: z.number().int().nonnegative().optional(),
814
+ /** The largest relay lag of an open Tenant: its oldest unrelayed event's age. */
815
+ relayLagMs: z.number().nonnegative().optional(),
806
816
  })
807
817
  .strict();
808
818
  export const AdminHostStatusSchema = z
@@ -867,7 +877,7 @@ export const TenantStatusSchema = z
867
877
  path: z.string().min(1),
868
878
  checks: z
869
879
  .object({
870
- sqlite: z.boolean(),
880
+ store: z.boolean(),
871
881
  scheduler: z.boolean(),
872
882
  model: z.boolean(),
873
883
  executors: z.boolean(),
@@ -896,6 +906,54 @@ export const TenantStatusSchema = z
896
906
  retained: z.number().int().nonnegative(),
897
907
  })
898
908
  .strict(),
909
+ /**
910
+ * Durable Session Execution invocations of this Tenant that need an operator: paused
911
+ * after exhausting retries, or backing off after failures. Absent when the execution
912
+ * cannot report them; `error` when it could not be asked.
913
+ */
914
+ execution: z
915
+ .object({
916
+ stuckInvocations: z.array(z
917
+ .object({
918
+ id: z.string(),
919
+ status: z.string(),
920
+ service: z.string(),
921
+ handler: z.string(),
922
+ key: z.string(),
923
+ retryCount: z.number().int().nonnegative(),
924
+ lastFailure: z.string().optional(),
925
+ modifiedAt: z.string().optional(),
926
+ })
927
+ .strict()),
928
+ error: z.string().optional(),
929
+ })
930
+ .strict()
931
+ .optional(),
932
+ /**
933
+ * This Tenant's Durable Streams: whether the service answers, its basin, the events
934
+ * committed but not yet relayed, and how far the relay is behind.
935
+ */
936
+ streams: z
937
+ .object({
938
+ reachable: z.boolean(),
939
+ basin: z
940
+ .object({
941
+ ready: z.boolean(),
942
+ failures: z.number().int().nonnegative(),
943
+ lastError: z.string().nullable(),
944
+ })
945
+ .strict(),
946
+ outbox: z
947
+ .object({
948
+ depth: z.number().int().nonnegative(),
949
+ oldestAgeMs: z.number().nonnegative().nullable(),
950
+ })
951
+ .strict(),
952
+ relayLagMs: z.number().nonnegative(),
953
+ collectionPending: z.boolean(),
954
+ })
955
+ .strict()
956
+ .optional(),
899
957
  })
900
958
  .strict();
901
959
  const seedModelSchema = PutHostModelRequestSchema.omit({
@@ -907,11 +965,17 @@ export const SeedTenantConfigRequestSchema = z
907
965
  requestId: RequestIdSchema,
908
966
  sandbox: z
909
967
  .object({
910
- backend: z.enum(["auto", "microsandbox", "virtual"]),
968
+ backend: z.enum(["auto", "virtual"]),
911
969
  })
912
970
  .strict()
913
971
  .optional(),
914
972
  model: seedModelSchema.optional(),
973
+ /**
974
+ * The Tenant's model calls use the Runtime's deterministic fixture model instead of its
975
+ * host model, e.g. for a temporary test Tenant (scripts/lib/temporary-tenant.mjs). Stored
976
+ * as Tenant setting `model.fixture`. Host feature `tenant-fixture-model`.
977
+ */
978
+ fixtureModel: z.literal(true).optional(),
915
979
  })
916
980
  .strict();
917
981
  export const SeedTenantConfigResponseSchema = z
@@ -12,7 +12,7 @@ export const SANDBOX_INSTRUCTIONS = `You have an isolated Linux sandbox with a p
12
12
  * reaching this means the agent ran without a Nylorun Runtime.
13
13
  */
14
14
  async function runtimeOnly() {
15
- throw new ToolError("sandbox.runtime-only", "Sandbox tools run in the Nylorun Runtime. Run the agent with `nylorun dev` or `nylorun serve` to use them.");
15
+ throw new ToolError("sandbox.runtime-only", "Sandbox tools run in the Nylorun Runtime. Connect the agent to a Runtime (npx nylorun up, then npm run dev) to use them.");
16
16
  }
17
17
  /** The six built-in sandbox tools. Schemas are part of the hashed manifest; change them deliberately. */
18
18
  export function createSandboxTools() {
@@ -1,7 +1,7 @@
1
- import { sha256 } from "@noble/hashes/sha256";
2
- import { bytesToHex } from "@noble/hashes/utils";
1
+ import { sha256 } from "@noble/hashes/sha2.js";
2
+ import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js";
3
3
  import { canonical } from "./canonical.js";
4
4
  /** Canonical SHA-256 hex digest of an agent or workflow definition document. */
5
5
  export function hashManifest(manifest) {
6
- return bytesToHex(sha256(canonical(manifest)));
6
+ return bytesToHex(sha256(utf8ToBytes(canonical(manifest))));
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/core",
3
- "version": "0.5.0-beta",
3
+ "version": "0.6.0-beta",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Shared agent definitions and wire contracts",
@@ -30,7 +30,7 @@
30
30
  "prepack": "npm run build"
31
31
  },
32
32
  "dependencies": {
33
- "@noble/hashes": "^1.8.0"
33
+ "@noble/hashes": "^2.4.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^26.5.0",