@wildshard/shard-format 0.87.0 → 0.87.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildshard/shard-format",
3
- "version": "0.87.0",
3
+ "version": "0.87.1",
4
4
  "description": "The raw shardfile format: the spec, the validator and a validate CLI. The public, versioned contract every other repo builds on.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1,6 +1,8 @@
1
1
  import * as v from 'valibot';
2
2
  import { AmbientFlockSchema, AmbientPerchesSchema, ForagerPopulationSchema } from './ambientLife.ts';
3
3
  import { CrowdWeaponTargetSchema } from './crowds.ts';
4
+ import { ReturnProjectionV2Schema } from './returnProjectionV2.ts';
5
+ import type { ReturnProjectionV2Rows, ReturnProjectionV2RowsInput } from './returnProjectionV2.ts';
4
6
 
5
7
  const id = v.pipe(v.string(), v.minLength(1), v.maxLength(128));
6
8
  const number = v.pipe(v.number(), v.finite());
@@ -8,6 +10,8 @@ const nonnegative = v.pipe(number, v.minValue(0), v.maxValue(1000000));
8
10
  const count = v.pipe(nonnegative, v.integer(), v.maxValue(256));
9
11
  const range = v.pipe(v.tuple([number, number]), v.check(([lo, hi]) => lo <= hi));
10
12
  const system = v.strictObject({ id, after: v.array(id), before: v.array(id) });
13
+ /** WASM-HOST H13: a programme may run as its v2 projection (a page-only `view` project row; Pine's ambient rules). */
14
+ const program = v.strictObject({ script: v.unknown(), bytes: v.string(), v2: v.exactOptional(ReturnProjectionV2Schema) });
11
15
  /** Client ambient ownership over actual flock, journal, tool and actor services.
12
16
  * Rules are stateless ABI-v1 projections; no executable shard ports cross rows. */
13
17
  export const PageLifeSchema: v.GenericSchema<PageLifeRowsInput, PageLifeRows> = v.strictObject({
@@ -24,7 +28,7 @@ export const PageLifeSchema: v.GenericSchema<PageLifeRowsInput, PageLifeRows> =
24
28
  combat: v.exactOptional(v.strictObject({ target: CrowdWeaponTargetSchema, preyY: number,
25
29
  hits: v.pipe(v.array(v.tuple([number, number, v.pipe(number, v.minValue(0.001), v.maxValue(20))])), v.minLength(1), v.maxLength(16)) })),
26
30
  })), v.maxLength(16)),
27
- program: v.exactOptional(v.strictObject({ script: v.unknown(), bytes: v.string() })),
31
+ program: v.exactOptional(program),
28
32
  carcasses: v.exactOptional(v.strictObject({ group: id, arrival: range, visitors: v.record(id, count),
29
33
  bodyWidths: v.record(id, nonnegative), defaultWidth: nonnegative, defaultVisitors: count,
30
34
  giveUp: nonnegative, reach: nonnegative, tint: nonnegative, untrackedAge: nonnegative, harvestDelay: nonnegative })),
@@ -104,6 +108,7 @@ interface PageLifeRowsInputFields {
104
108
  program?: {
105
109
  script: unknown;
106
110
  bytes: string;
111
+ v2?: ReturnProjectionV2RowsInput;
107
112
  };
108
113
  carcasses?: {
109
114
  group: string;
@@ -228,6 +233,7 @@ interface PageLifeRowsFields {
228
233
  program?: {
229
234
  script: unknown;
230
235
  bytes: string;
236
+ v2?: ReturnProjectionV2Rows;
231
237
  };
232
238
  carcasses?: {
233
239
  group: string;