@wildshard/shard-format 0.79.2 → 0.80.0
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 +21 -20
- package/src/format/clientNative.ts +0 -42
- package/src/format/clientOwnership.ts +4 -4
- package/src/format/clientPlan.ts +6 -14
- package/src/format/deprecations.ts +3 -47
- package/src/format/feature-sides.ts +0 -3
- package/src/format/format-migrations.ts +6 -29
- package/src/format/headless-sections.ts +0 -1
- package/src/format/items.ts +3 -4
- package/src/format/outputFields.ts +0 -3
- package/src/format/platformDataSections.ts +0 -16
- package/src/format/rig-looks.ts +4 -14
- package/src/format/riggedHulls.ts +3 -99
- package/src/format/sections.ts +0 -6
- package/src/format/shardSchema.ts +1 -5
- package/src/format/speciesLooks.ts +1 -686
- package/src/format/speciesPrograms.ts +3 -2
- package/src/format/tierSelection.ts +0 -12
- package/src/format/version.ts +17 -28
- package/src/format/weapon-slot.ts +5 -26
- package/src/tools/runtime-hosts.json +0 -22
- package/src/format/species-deprecations.ts +0 -79
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/shard-format",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.80.0",
|
|
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": {
|
|
@@ -457,18 +457,20 @@
|
|
|
457
457
|
"./rigLooks": "./src/format/rig-looks.ts"
|
|
458
458
|
},
|
|
459
459
|
"engines": {
|
|
460
|
-
"node": ">=24.18.0 <
|
|
460
|
+
"node": ">=24.18.0 <27"
|
|
461
461
|
},
|
|
462
462
|
"packageManager": "pnpm@10.34.9",
|
|
463
463
|
"scripts": {
|
|
464
|
+
"dev": "node --test --watch 'src/!(format|ci)/**/*.test.ts'",
|
|
465
|
+
"build": "npm pack --dry-run --ignore-scripts",
|
|
464
466
|
"pnpm:devPreinstall": "git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath .githooks || true",
|
|
465
|
-
"typecheck": "
|
|
466
|
-
"lint": "node
|
|
467
|
-
"
|
|
467
|
+
"typecheck": "node src/scripts/.kit/typecheck.mjs && npr tsc -p src/format/tsconfig.json && npr tsc -p src/format/tsconfig.lib.json && npr tsc -p tsconfig.browser-tools.json",
|
|
468
|
+
"lint": "node src/scripts/.kit/bin-tools.mjs -c .oxlintrc.author.json --type-aware --deny-warnings --no-error-on-unmatched-pattern src packages",
|
|
469
|
+
"format:check": "npr oxfmt --check src '!src/format/**'",
|
|
470
|
+
"fix": "node src/scripts/.kit/bin-tools.mjs -c .oxlintrc.author.json --type-aware --no-error-on-unmatched-pattern src packages --fix && npr oxfmt --no-error-on-unmatched-pattern src '!src/format/**'",
|
|
471
|
+
"format": "npr oxfmt --no-error-on-unmatched-pattern src '!src/format/**'",
|
|
472
|
+
"test": "node --test 'src/!(format|ci)/**/*.test.ts' 'src/test/*.test.mjs' 'src/test/.kit/*.test.mjs' '.githooks/*.test.mjs' '.agents/hooks/test/*.test.mjs'",
|
|
468
473
|
"lint:format": "node src/tools/format-ratchet.ts",
|
|
469
|
-
"format": "npr oxfmt -c kit/.oxfmtrc.json kit src '!src/format/**' '!src/test/fixtures/**'",
|
|
470
|
-
"format:check": "npr oxfmt -c kit/.oxfmtrc.json --check kit src '!src/format/**' '!src/test/fixtures/**'",
|
|
471
|
-
"test": "node --test 'src/!(format|ci)/**/*.test.ts'",
|
|
472
474
|
"test:ci": "node --test 'src/ci/**/*.test.ts'",
|
|
473
475
|
"test:chain": "node --test 'src/tools/*.chain.ts'",
|
|
474
476
|
"test:format": "vitest run src/format --testTimeout=30000 --maxWorkers=2",
|
|
@@ -477,19 +479,17 @@
|
|
|
477
479
|
"check:format-gate": "node src/tools/format-gate.ts",
|
|
478
480
|
"check:zone-snapshots": "node src/tools/zone-snapshot-guard.ts",
|
|
479
481
|
"corpus:usage": "node src/cli/main.ts corpus --cache tmp/corpus --usage corpus/usage.json",
|
|
480
|
-
"check:asks": "node
|
|
482
|
+
"check:asks": "node src/scripts/.kit/asks.mjs check",
|
|
481
483
|
"check:agents": "node .githooks/agents-md.mjs lint",
|
|
482
|
-
"check:parity": "node scripts/agent-parity.mjs --strict",
|
|
483
|
-
"check:agent-sync": "node scripts/agent-sync.mjs --check",
|
|
484
|
-
"
|
|
485
|
-
"
|
|
486
|
-
"
|
|
487
|
-
"test:hooks": "node --test '.githooks/*.test.mjs'",
|
|
488
|
-
"check": "pnpm check:bin-pins && pnpm typecheck && pnpm lint && pnpm lint:format && pnpm format:check && pnpm test && pnpm check:lock && pnpm check:format-gate && pnpm check:zone-snapshots && node --test src/ci/exports-unique.test.ts && pnpm test:format && pnpm check:asks && pnpm check:agents && pnpm check:agent-sync && pnpm test:agent-hooks && pnpm check:parity && node --check scripts/chromium-keychain-check.mjs && node --test test/tooling/chrome-keychain.test.mjs test/tooling/disk-land.test.mjs test/tooling/lane-live.test.mjs test/tooling/keep-copy.test.mjs test/tooling/leftovers-report.test.mjs test/tooling/reap-report.test.mjs test/tooling/engine-typecheck.test.mjs && pnpm check:wire && node scripts/engine-typecheck.mjs",
|
|
484
|
+
"check:parity": "node src/scripts/.kit/agent-parity.mjs --strict",
|
|
485
|
+
"check:agent-sync": "node src/scripts/.kit/agent-sync.mjs --check",
|
|
486
|
+
"agents:sync": "node src/scripts/.kit/agent-sync.mjs",
|
|
487
|
+
"md:wrap": "node src/scripts/.kit/md-wrap.mjs",
|
|
488
|
+
"check": "pnpm check:bin-pins && pnpm typecheck && pnpm lint && pnpm lint:format && pnpm format:check --no-error-on-unmatched-pattern && pnpm test && pnpm check:lock && pnpm check:format-gate && pnpm check:zone-snapshots && node --test src/ci/exports-unique.test.ts && pnpm test:format && pnpm check:asks && pnpm check:agents && pnpm check:agent-sync && pnpm check:parity && node --check src/scripts/.kit/chromium-keychain-check.mjs && pnpm check:wire && node src/scripts/engine-typecheck.mjs",
|
|
489
489
|
"check:wire": "pnpm --dir packages/wire check && pnpm --dir packages/wire test && pnpm check:wire-proofs",
|
|
490
490
|
"check:wire-proofs": "node --test src/scripts/wire/recordings-proof.mjs src/scripts/wire/graph-proof.mjs src/scripts/wire/prepared-frame-proof.mjs",
|
|
491
491
|
"bench": "pnpm --dir packages/wire bench",
|
|
492
|
-
"check:bin-pins": "node
|
|
492
|
+
"check:bin-pins": "node src/scripts/.kit/bin-pins.mjs",
|
|
493
493
|
"reupload": "node src/tools/reupload.ts"
|
|
494
494
|
},
|
|
495
495
|
"dependencies": {
|
|
@@ -502,11 +502,11 @@
|
|
|
502
502
|
"@typescript/typescript6": "6.0.2",
|
|
503
503
|
"binaryen": "132.0.0",
|
|
504
504
|
"fflate": "0.8.3",
|
|
505
|
+
"npm-bin-deps": "2.2.0",
|
|
505
506
|
"oxlint": "1.89.0",
|
|
506
507
|
"playwright": "1.64.1",
|
|
507
508
|
"vite": "8.3.0",
|
|
508
|
-
"vitest": "5.0.1"
|
|
509
|
-
"npm-bin-deps": "2.1.0"
|
|
509
|
+
"vitest": "5.0.1"
|
|
510
510
|
},
|
|
511
511
|
"pnpm": {
|
|
512
512
|
"ignoredOptionalDependencies": [
|
|
@@ -597,5 +597,6 @@
|
|
|
597
597
|
"oxfmt": "0.74.0",
|
|
598
598
|
"oxlint-tsgolint": "7.0.2004"
|
|
599
599
|
},
|
|
600
|
-
"binDependenciesInstaller": "
|
|
600
|
+
"binDependenciesInstaller": "pnpm",
|
|
601
|
+
"binDependenciesProjectSettings": false
|
|
601
602
|
}
|
|
@@ -4,7 +4,6 @@ import { MarkedBossPresentationSchema } from './bossProfiles.ts';
|
|
|
4
4
|
|
|
5
5
|
const finite = v.pipe(v.number(), v.finite());
|
|
6
6
|
const id = v.pipe(v.string(), v.minLength(1), v.maxLength(128));
|
|
7
|
-
const home = v.strictObject({ x: finite, y: finite, z: finite, r: v.pipe(finite, v.minValue(Number.MIN_VALUE)) });
|
|
8
7
|
const capture = v.union([
|
|
9
8
|
v.strictObject({ flag: id }), v.strictObject({ action: id }),
|
|
10
9
|
v.strictObject({ finish: v.literal(true) }), v.strictObject({ settle: v.literal('weather.fields') }),
|
|
@@ -24,13 +23,6 @@ export const ClientHeldMeleeSchema: v.StrictObjectSchema<{ readonly kind: v.Gene
|
|
|
24
23
|
composed: v.optional(v.boolean(), false), stowedMode: v.exactOptional(id),
|
|
25
24
|
finish: v.exactOptional(v.strictObject({ part: id, look: id, image: id, library: id })),
|
|
26
25
|
});
|
|
27
|
-
/** The existing SpeciesBrains catalogue, with original registration order and
|
|
28
|
-
* body homes. The program and rig rows are referenced, never copied here. */
|
|
29
|
-
export const ClientSpeciesProgramSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{ readonly kind: v.GenericSchema<ClientSpeciesProgramRowsInput['kind'], ClientSpeciesProgramRows['kind']>; readonly library: v.ExactOptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['library'], undefined>, Exclude<ClientSpeciesProgramRows['library'], undefined>>, undefined>; readonly catalogue: v.ExactOptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['catalogue'], undefined>, Exclude<ClientSpeciesProgramRows['catalogue'], undefined>>, undefined>; readonly homes: v.ExactOptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['homes'], undefined>, Exclude<ClientSpeciesProgramRows['homes'], undefined>>, undefined>; readonly shove: v.OptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['shove'], undefined>, Exclude<ClientSpeciesProgramRows['shove'], undefined>>, false>; }, undefined>, v.CheckAction<{ [K in keyof ClientSpeciesProgramRows]: ClientSpeciesProgramRows[K] }, 'Species program requires one source'>]> = v.pipe(v.strictObject({ kind: v.literal('species.program'), library: v.exactOptional(id),
|
|
30
|
-
catalogue: v.exactOptional(v.strictObject({ owner: id, actors: id, looks: id })),
|
|
31
|
-
homes: v.exactOptional(v.pipe(v.record(id, home), v.maxEntries(256))), shove: v.optional(v.boolean(), false),
|
|
32
|
-
}), v.check(row => row.catalogue === undefined ? row.library !== undefined
|
|
33
|
-
: row.library === undefined && row.homes === undefined && !row.shove, 'Species program requires one source'));
|
|
34
26
|
/** Saved page composition on the original flag/reward/NPC owners. Captures
|
|
35
27
|
* select bounded platform actions, never a method or property path. */
|
|
36
28
|
export const ClientQuestPageSchema: v.StrictObjectSchema<{ readonly kind: v.GenericSchema<ClientQuestPageRowsInput['kind'], ClientQuestPageRows['kind']>; readonly rows: v.GenericSchema<ClientQuestPageRowsInput['rows'], ClientQuestPageRows['rows']>; readonly progress: v.OptionalSchema<v.GenericSchema<Exclude<ClientQuestPageRowsInput['progress'], undefined>, Exclude<ClientQuestPageRows['progress'], undefined>>, false>; readonly promptOrder: v.GenericSchema<ClientQuestPageRowsInput['promptOrder'], ClientQuestPageRows['promptOrder']>; readonly endpoints: v.OptionalSchema<v.GenericSchema<Exclude<ClientQuestPageRowsInput['endpoints'], undefined>, Exclude<ClientQuestPageRows['endpoints'], undefined>>, readonly []>; readonly capture: v.OptionalSchema<v.GenericSchema<Exclude<ClientQuestPageRowsInput['capture'], undefined>, Exclude<ClientQuestPageRows['capture'], undefined>>, Record<never, never>>; }, undefined> = v.strictObject({ kind: v.literal('quest.page'),
|
|
@@ -105,40 +97,6 @@ interface ClientHeldMeleeRowsFields {
|
|
|
105
97
|
};
|
|
106
98
|
}
|
|
107
99
|
export type ClientHeldMeleeRows = { [Key in keyof ClientHeldMeleeRowsFields]: ClientHeldMeleeRowsFields[Key] };
|
|
108
|
-
interface ClientSpeciesProgramRowsInputFields {
|
|
109
|
-
kind: 'species.program';
|
|
110
|
-
library?: string;
|
|
111
|
-
catalogue?: {
|
|
112
|
-
owner: string;
|
|
113
|
-
actors: string;
|
|
114
|
-
looks: string;
|
|
115
|
-
};
|
|
116
|
-
homes?: Record<string, {
|
|
117
|
-
x: number;
|
|
118
|
-
y: number;
|
|
119
|
-
z: number;
|
|
120
|
-
r: number;
|
|
121
|
-
}>;
|
|
122
|
-
shove?: boolean | undefined;
|
|
123
|
-
}
|
|
124
|
-
export type ClientSpeciesProgramRowsInput = { [Key in keyof ClientSpeciesProgramRowsInputFields]: ClientSpeciesProgramRowsInputFields[Key] };
|
|
125
|
-
interface ClientSpeciesProgramRowsFields {
|
|
126
|
-
kind: 'species.program';
|
|
127
|
-
library?: string;
|
|
128
|
-
catalogue?: {
|
|
129
|
-
owner: string;
|
|
130
|
-
actors: string;
|
|
131
|
-
looks: string;
|
|
132
|
-
};
|
|
133
|
-
homes?: Record<string, {
|
|
134
|
-
x: number;
|
|
135
|
-
y: number;
|
|
136
|
-
z: number;
|
|
137
|
-
r: number;
|
|
138
|
-
}>;
|
|
139
|
-
shove: boolean;
|
|
140
|
-
}
|
|
141
|
-
export type ClientSpeciesProgramRows = { [Key in keyof ClientSpeciesProgramRowsFields]: ClientSpeciesProgramRowsFields[Key] };
|
|
142
100
|
interface ClientQuestPageRowsInputFields {
|
|
143
101
|
kind: 'quest.page';
|
|
144
102
|
rows: Omit<v.InferInput<typeof PersistedQuestPageSchema>, 'capture'>;
|
|
@@ -11,10 +11,10 @@ export function clientOwnershipRules(source: Shardfile, sections: ReadonlyMap<st
|
|
|
11
11
|
const features = raw === undefined ? [] : parseClientPlan(raw).features;
|
|
12
12
|
const page = hasDeclaredClientPage(source);
|
|
13
13
|
if (!page) return rigs;
|
|
14
|
-
// OF19d1: a page
|
|
15
|
-
const errors: string[] = [...rigs
|
|
14
|
+
// OF19d1, FORMAT-PRUNE FP20: a page draws its declared bodies from their looks (the species program is deleted)
|
|
15
|
+
const declaredPlan = sections.get('sim/runtime-plan'), errors: string[] = [...rigs, ...declaredPlan === undefined || pageDrawsDeclaredLooks(source, declaredPlan) ? [] : ['Data page draws its creatures from their declared looks']];
|
|
16
16
|
if (source.runtime !== null) errors.push('Native client features require their typed data page owner');
|
|
17
|
-
for (const kind of ['world.scenes', 'motion.channels',
|
|
17
|
+
for (const kind of ['world.scenes', 'motion.channels', 'held.melee', 'quest.page'] as const)
|
|
18
18
|
if (!features.some(row => row.kind === kind)) errors.push(`Data page requires ${kind}`);
|
|
19
19
|
const quest = features.find(row => row.kind === 'quest.page'), held = features.find(row => row.kind === 'held.melee');
|
|
20
20
|
const declared = source.questHost?.page;
|
|
@@ -26,7 +26,7 @@ export function clientOwnershipRules(source: Shardfile, sections: ReadonlyMap<st
|
|
|
26
26
|
// ONE-FORMAT OF19b0/OF19c0: declared spawns, their species and encounters run beside the plan's keeper (the engine
|
|
27
27
|
// refuses a body both own); declared crowds do not
|
|
28
28
|
if (source.crowds.length > 0) errors.push('Data page native roster cannot also install declared crowds');
|
|
29
|
-
for (const name of ['world/scenes', 'world/targets',
|
|
29
|
+
for (const name of ['world/scenes', 'world/targets', 'sim/runtime-plan', 'sim/scripts', 'look/painted'])
|
|
30
30
|
if (!sections.has(name)) errors.push(`Data page requires ${name}`);
|
|
31
31
|
const channels = new Set(source.clientChannels?.map(row => row.id));
|
|
32
32
|
for (const feature of features) if (feature.kind === 'motion.channels') {
|
package/src/format/clientPlan.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { isJsonData } from './json.ts';
|
|
|
17
17
|
import { LightEmittersSchema } from './lightEmitters.ts';
|
|
18
18
|
import { EasedFieldsSchema } from './easedFields.ts';
|
|
19
19
|
import { SceneMotionSchema } from './sceneMotion.ts';
|
|
20
|
-
import { ClientHeldMeleeSchema,
|
|
20
|
+
import { ClientHeldMeleeSchema, ClientQuestPageSchema, ClientHeldBossSchema, ClientSpawnedBossSchema, ClientPlayerEnterSchema, ClientBossTelegraphSchema } from './clientNative.ts';
|
|
21
21
|
|
|
22
22
|
const finite=v.pipe(v.number(),v.finite()),rgb=v.tuple([finite,finite,finite]);
|
|
23
23
|
const label=v.pipe(v.string(),v.minLength(1),v.maxLength(512));
|
|
@@ -98,10 +98,6 @@ export const ClientFeatureSchema: v.GenericSchema<ClientFeatureInput, ClientFeat
|
|
|
98
98
|
v.strictObject({ kind: v.literal('practice.course'), course: v.picklist(['horse', 'grapple']),
|
|
99
99
|
title: label, blurb: label, icon: v.pipe(v.string(), v.minLength(1), v.maxLength(4096)), art: label, file: label }),
|
|
100
100
|
v.strictObject({ kind: v.literal('held.claims.prepare'), id, source: v.exactOptional(v.strictObject({ slots: label, library: label })) }),
|
|
101
|
-
// OF30: retired (no pinned product names it since OF22; the engine runs nothing for it), still admitted so retained
|
|
102
|
-
// originals (Driftwood r4 to r6) keep validating; species-deprecations counts it until the J486 delete.
|
|
103
|
-
v.strictObject({ kind: v.literal('population.product-creatures') }),
|
|
104
|
-
v.strictObject({ kind: v.literal('population.hull-book') }),
|
|
105
101
|
v.strictObject({ kind: v.literal('held.claims.install'), claims: id, preparation: v.exactOptional(v.picklist(['kit','world'])) }),
|
|
106
102
|
v.strictObject({ kind: v.literal('held.claims.enter'), claims: id,
|
|
107
103
|
grapple: v.strictObject({ item: id, profile: GrappleProfileSchema, hooks: GrappleHooksSchema, presentation: label }) }),
|
|
@@ -135,7 +131,7 @@ export const ClientFeatureSchema: v.GenericSchema<ClientFeatureInput, ClientFeat
|
|
|
135
131
|
v.strictObject({ kind: v.literal('world.scenes') }),
|
|
136
132
|
v.strictObject({ kind: v.literal('world.baked'), rows: v.pipe(v.array(BakedTilesSchema), v.minLength(1), v.maxLength(4), v.check(rows => new Set(rows.map(row => row.id)).size === rows.length, 'unique baked tile ids')) }),
|
|
137
133
|
v.strictObject({ kind: v.literal('motion.channels'), rows: SceneMotionSchema }),
|
|
138
|
-
ClientHeldMeleeSchema,
|
|
134
|
+
ClientHeldMeleeSchema, ClientQuestPageSchema, ClientTrailsSchema, ClientCuesSchema,
|
|
139
135
|
ClientHeldBossSchema, ClientSpawnedBossSchema, ClientPlayerEnterSchema, ClientBossTelegraphSchema,
|
|
140
136
|
v.strictObject({ kind: v.literal('light.emitters'), rows: LightEmittersSchema }),
|
|
141
137
|
v.strictObject({ kind: v.literal('weather.fields'), rows: EasedFieldsSchema, quest: id }),
|
|
@@ -177,8 +173,7 @@ export type ClientFeatureInput = { kind: 'strings.register'; } | { kind: 'conten
|
|
|
177
173
|
species: string; guest: string; weather: string; sites?: string; figures: { rider: string; captain: string;
|
|
178
174
|
storm: 'rider' | 'captain'; }; } | { kind: 'practice.course'; course: 'horse' | 'grapple'; title: string;
|
|
179
175
|
blurb: string; icon: string; art: string; file: string; } | { kind: 'held.claims.prepare'; id: string;
|
|
180
|
-
source?: { slots: string; library: string; }; } | { kind: '
|
|
181
|
-
'population.hull-book'; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
|
|
176
|
+
source?: { slots: string; library: string; }; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
|
|
182
177
|
{ kind: 'held.claims.enter'; claims: string; grapple: { item: string; profile: v.InferInput<typeof GrappleProfileSchema>; hooks: v.InferOutput<typeof GrappleHooksSchema>; presentation: string; };
|
|
183
178
|
} | { kind: 'portal.ride'; rows: v.InferInput<typeof DeclaredPortalRideSchema>; } | { kind: 'held.cosmetics'; } | { kind: 'held.ranged-feel'; } | {
|
|
184
179
|
kind: 'bag.finds'; id: string; quest: string; file: string; } | { kind: 'look.painterly'; shadeTint: [number,
|
|
@@ -206,8 +201,7 @@ export type ClientFeatureInput = { kind: 'strings.register'; } | { kind: 'conten
|
|
|
206
201
|
Record<string, 'uCloudShadow' | 'uToonNight' | 'uSeaLevel' | 'uCloudTime'>; toonSeaLevel: boolean; }; })[]; }
|
|
207
202
|
| { kind: 'world.scenes'; } | { kind: 'world.baked'; rows: (v.InferInput<typeof BakedTilesSchema>)[]; } | {
|
|
208
203
|
kind: 'motion.channels'; rows: v.InferInput<typeof SceneMotionSchema>; } | v.InferInput<typeof
|
|
209
|
-
ClientHeldMeleeSchema> | v.InferInput<typeof
|
|
210
|
-
ClientQuestPageSchema> | v.InferInput<typeof ClientTrailsSchema>
|
|
204
|
+
ClientHeldMeleeSchema> | v.InferInput<typeof ClientQuestPageSchema> | v.InferInput<typeof ClientTrailsSchema>
|
|
211
205
|
| v.InferInput<typeof ClientCuesSchema> | v.InferInput<typeof ClientHeldBossSchema> | v.InferInput<typeof
|
|
212
206
|
ClientSpawnedBossSchema> | v.InferInput<typeof ClientPlayerEnterSchema> | v.InferInput<typeof
|
|
213
207
|
ClientBossTelegraphSchema> | { kind: 'light.emitters'; rows: v.InferInput<typeof LightEmittersSchema>; } | {
|
|
@@ -241,8 +235,7 @@ export type ClientFeatureRow = { kind: 'strings.register'; } | { kind: 'content.
|
|
|
241
235
|
species: string; guest: string; weather: string; sites?: string; figures: { rider: string; captain: string;
|
|
242
236
|
storm: 'rider' | 'captain'; }; } | { kind: 'practice.course'; course: 'horse' | 'grapple'; title: string;
|
|
243
237
|
blurb: string; icon: string; art: string; file: string; } | { kind: 'held.claims.prepare'; id: string;
|
|
244
|
-
source?: { slots: string; library: string; }; } | { kind: '
|
|
245
|
-
'population.hull-book'; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
|
|
238
|
+
source?: { slots: string; library: string; }; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
|
|
246
239
|
{ kind: 'held.claims.enter'; claims: string; grapple: { item: string; profile: v.InferOutput<typeof GrappleProfileSchema>; hooks: v.InferOutput<typeof GrappleHooksSchema>; presentation: string; };
|
|
247
240
|
} | { kind: 'portal.ride'; rows: v.InferOutput<typeof DeclaredPortalRideSchema>; } | { kind: 'held.cosmetics'; } | { kind: 'held.ranged-feel'; } | {
|
|
248
241
|
kind: 'bag.finds'; id: string; quest: string; file: string; } | { kind: 'look.painterly'; shadeTint: [number,
|
|
@@ -270,8 +263,7 @@ export type ClientFeatureRow = { kind: 'strings.register'; } | { kind: 'content.
|
|
|
270
263
|
number; })[]; lent: Record<string, 'uCloudShadow' | 'uToonNight' | 'uSeaLevel' | 'uCloudTime'>; toonSeaLevel:
|
|
271
264
|
boolean; }; })[]; } | { kind: 'world.scenes'; } | { kind: 'world.baked'; rows: (v.InferOutput<typeof
|
|
272
265
|
BakedTilesSchema>)[]; } | { kind: 'motion.channels'; rows: v.InferOutput<typeof SceneMotionSchema>; } |
|
|
273
|
-
v.InferOutput<typeof ClientHeldMeleeSchema> | v.InferOutput<typeof
|
|
274
|
-
v.InferOutput<typeof ClientQuestPageSchema> |
|
|
266
|
+
v.InferOutput<typeof ClientHeldMeleeSchema> | v.InferOutput<typeof ClientQuestPageSchema> |
|
|
275
267
|
v.InferOutput<typeof ClientTrailsSchema> | v.InferOutput<typeof ClientCuesSchema> | v.InferOutput<typeof
|
|
276
268
|
ClientHeldBossSchema> | v.InferOutput<typeof ClientSpawnedBossSchema> | v.InferOutput<typeof
|
|
277
269
|
ClientPlayerEnterSchema> | v.InferOutput<typeof ClientBossTelegraphSchema> | { kind: 'light.emitters'; rows:
|
|
@@ -10,10 +10,6 @@ import {
|
|
|
10
10
|
} from './manifest-deprecations.ts'
|
|
11
11
|
import { SAVE_REVISION_DEPRECATION } from './save-revision.ts'
|
|
12
12
|
import { SCHEMA_SOURCE_DEPRECATION } from './schema-source.ts'
|
|
13
|
-
import {
|
|
14
|
-
SPECIES_FEATURE_DEPRECATIONS,
|
|
15
|
-
SPECIES_SECTION_DEPRECATIONS,
|
|
16
|
-
} from './species-deprecations.ts'
|
|
17
13
|
|
|
18
14
|
import type { OutputIndex } from './outputIndex.ts'
|
|
19
15
|
|
|
@@ -42,8 +38,6 @@ interface DeprecationRule extends Deprecation {
|
|
|
42
38
|
readonly uses: (shard: Readonly<DeprecationInput>) => boolean
|
|
43
39
|
}
|
|
44
40
|
|
|
45
|
-
const LEGACY_SPELLING = '0.1'
|
|
46
|
-
const NONE = 0
|
|
47
41
|
/** Deprecated in the current format with no data change: a shard file of any version may still carry it. */
|
|
48
42
|
const CURRENT = '0.1.0.1'
|
|
49
43
|
/** Format 0.1.0.2's envelope (SHARD-COMPAT CP14, FORMAT-PRUNE FP4 and FP25). */
|
|
@@ -64,32 +58,8 @@ function field(value: unknown, key: string): unknown {
|
|
|
64
58
|
: undefined
|
|
65
59
|
}
|
|
66
60
|
|
|
67
|
-
/**
|
|
68
|
-
function hasKey(value: unknown, key: string): boolean {
|
|
69
|
-
const pending: unknown[] = [value]
|
|
70
|
-
while (pending.length > NONE) {
|
|
71
|
-
const next = pending.pop()
|
|
72
|
-
if (typeof next === 'object' && next !== null) {
|
|
73
|
-
if (!Array.isArray(next) && Object.hasOwn(next, key)) {
|
|
74
|
-
return true
|
|
75
|
-
}
|
|
76
|
-
const children: readonly unknown[] = Object.values(next)
|
|
77
|
-
pending.push(...children)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return false
|
|
81
|
-
}
|
|
82
|
-
|
|
61
|
+
/** FORMAT-PRUNE FP24 deleted `version.two-part` with the spelling and its chain step: the format no longer admits `0.1`. */
|
|
83
62
|
const RULES: readonly DeprecationRule[] = [
|
|
84
|
-
{
|
|
85
|
-
id: 'version.two-part',
|
|
86
|
-
path: 'shard.json version and requires.sdk spelled "0.1"',
|
|
87
|
-
since: '0.1.0.0',
|
|
88
|
-
replacement: 'the four-part "0.1.0.0"',
|
|
89
|
-
migration: 'fp6-four-part-version',
|
|
90
|
-
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
91
|
-
field(shard.index, 'version') === LEGACY_SPELLING,
|
|
92
|
-
},
|
|
93
63
|
{
|
|
94
64
|
id: 'shard.version',
|
|
95
65
|
path: 'shard.json version beside the layout marker formatVersion 2 (SHARD-COMPAT CP14)',
|
|
@@ -127,7 +97,6 @@ const RULES: readonly DeprecationRule[] = [
|
|
|
127
97
|
SAVE_REVISION_DEPRECATION,
|
|
128
98
|
SCHEMA_SOURCE_DEPRECATION,
|
|
129
99
|
...COOK_DEPRECATIONS,
|
|
130
|
-
...SPECIES_FEATURE_DEPRECATIONS,
|
|
131
100
|
{
|
|
132
101
|
id: 'requires.capabilities',
|
|
133
102
|
path: 'shard.json requires.capabilities (FORMAT-PRUNE FP4): always empty, never read',
|
|
@@ -150,19 +119,6 @@ const RULES: readonly DeprecationRule[] = [
|
|
|
150
119
|
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
151
120
|
field(field(shard.index, 'runtime'), 'trust') !== undefined,
|
|
152
121
|
},
|
|
153
|
-
...SPECIES_SECTION_DEPRECATIONS,
|
|
154
|
-
{
|
|
155
|
-
id: 'items.legacySlot',
|
|
156
|
-
path: 'an item equipment row legacySlot: a closed list of engine-native weapon names (FORMAT-PRUNE FP17)',
|
|
157
|
-
since: CURRENT,
|
|
158
|
-
replacement:
|
|
159
|
-
'none yet: it goes with engine native weapon slots, so a new item names no slot',
|
|
160
|
-
migration: undefined,
|
|
161
|
-
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
162
|
-
[...shard.sections.values()].some((section: unknown): boolean =>
|
|
163
|
-
hasKey(section, 'legacySlot'),
|
|
164
|
-
),
|
|
165
|
-
},
|
|
166
122
|
{
|
|
167
123
|
id: 'admission.server',
|
|
168
124
|
path: 'shard.json admission.server (native assembly, FORMAT-PRUNE FP16)',
|
|
@@ -183,8 +139,8 @@ interface SaveBridge {
|
|
|
183
139
|
readonly reader: string
|
|
184
140
|
}
|
|
185
141
|
|
|
186
|
-
/** FP17's sort of the `legacy*` fields.
|
|
187
|
-
* species
|
|
142
|
+
/** FP17's sort of the `legacy*` fields. The closed item slot field was shard data only and is deleted (FP22e); the
|
|
143
|
+
* species-program family is deleted (FP20), its hunt bands' old kinds list optional until no kept file writes it. */
|
|
188
144
|
const SAVE_BRIDGES: readonly SaveBridge[] = [
|
|
189
145
|
{
|
|
190
146
|
path: 'loadout bow.legacyItem',
|
|
@@ -57,8 +57,6 @@ const CLIENT_FEATURE_SIDES: Readonly<Record<ClientFeatureKind, SideEntry>> =
|
|
|
57
57
|
'motion.channels': VIEW,
|
|
58
58
|
'page.life': VIEW,
|
|
59
59
|
'player.enter': both('fallFloor'),
|
|
60
|
-
'population.hull-book': VIEW,
|
|
61
|
-
'population.product-creatures': VIEW,
|
|
62
60
|
'population.wildlife': VIEW,
|
|
63
61
|
'portal.ride': both('portalRide'),
|
|
64
62
|
'practice.course': VIEW,
|
|
@@ -71,7 +69,6 @@ const CLIENT_FEATURE_SIDES: Readonly<Record<ClientFeatureKind, SideEntry>> =
|
|
|
71
69
|
'quest.views': VIEW,
|
|
72
70
|
'quest.world': both('places'),
|
|
73
71
|
'riding.session': VIEW,
|
|
74
|
-
'species.program': VIEW,
|
|
75
72
|
'state.adventure': both('saves'),
|
|
76
73
|
'stealth.entry': both('stealth'),
|
|
77
74
|
'strings.register': VIEW,
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
} from './format-migration-prune.ts'
|
|
26
26
|
import { validationSourceBytes } from './validationReceipt.ts'
|
|
27
27
|
import {
|
|
28
|
+
SHARDFILE_FLOOR,
|
|
28
29
|
SHARDFILE_VERSIONS,
|
|
29
30
|
compareShardfileVersions,
|
|
30
31
|
parseShardfileVersion,
|
|
@@ -55,33 +56,12 @@ interface FormatMigration {
|
|
|
55
56
|
readonly repairs?: (shard: Readonly<MigratingShard>) => boolean
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
const TWO_PART = 2
|
|
59
59
|
const ZERO = 0
|
|
60
60
|
const ONE = 1
|
|
61
|
-
const LEGACY_SPELLING = '0.1'
|
|
62
|
-
const FOUR_PART_ZERO = '0.1.0.0'
|
|
63
61
|
|
|
64
|
-
/** FORMAT-PRUNE FP6
|
|
65
|
-
|
|
66
|
-
id: 'fp6-four-part-version',
|
|
67
|
-
to: FOUR_PART_ZERO,
|
|
68
|
-
touches: 'data',
|
|
69
|
-
affects: [],
|
|
70
|
-
apply: (shard: Readonly<MigratingShard>): void => {
|
|
71
|
-
const { requires } = shard.index
|
|
72
|
-
if (
|
|
73
|
-
typeof requires === 'object' &&
|
|
74
|
-
requires !== null &&
|
|
75
|
-
Reflect.get(requires, 'sdk') === LEGACY_SPELLING
|
|
76
|
-
) {
|
|
77
|
-
Reflect.set(requires, 'sdk', FOUR_PART_ZERO)
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** Every migration, oldest first. */
|
|
62
|
+
/** Every migration, oldest first. FORMAT-PRUNE FP24 deleted FP6's `fp6-four-part-version` (`0.1` to `0.1.0.0`) with
|
|
63
|
+
* the two-part spelling: the chain starts at the floor. */
|
|
83
64
|
const FORMAT_MIGRATIONS: readonly FormatMigration[] = [
|
|
84
|
-
fourPartVersion,
|
|
85
65
|
journalGlyphImages,
|
|
86
66
|
shardfilePointer,
|
|
87
67
|
dropRuntimeTrust,
|
|
@@ -98,8 +78,7 @@ const FORMAT_MIGRATIONS: readonly FormatMigration[] = [
|
|
|
98
78
|
levelLook,
|
|
99
79
|
]
|
|
100
80
|
|
|
101
|
-
/** Whether a file at `version` still needs a step that writes `to`.
|
|
102
|
-
* four-part twin, so the spelling step runs once and never again. */
|
|
81
|
+
/** Whether a file at `version` still needs a step that writes `to`. */
|
|
103
82
|
function versionBelow(version: string, to: string): boolean {
|
|
104
83
|
const left = parseShardfileVersion(version)
|
|
105
84
|
const right = parseShardfileVersion(to)
|
|
@@ -109,9 +88,7 @@ function versionBelow(version: string, to: string): boolean {
|
|
|
109
88
|
return difference < ZERO
|
|
110
89
|
}
|
|
111
90
|
}
|
|
112
|
-
return
|
|
113
|
-
version.split('.').length === TWO_PART && to.split('.').length > TWO_PART
|
|
114
|
-
)
|
|
91
|
+
return false
|
|
115
92
|
}
|
|
116
93
|
|
|
117
94
|
/** Refuse one step: a `to` that is no format version, out of version order after `last`, or a save-affecting step with
|
|
@@ -135,7 +112,7 @@ function checkStep(step: Readonly<FormatMigration>, last: string): void {
|
|
|
135
112
|
/** Refuse a registry the chain cannot run as written (FE8): a repeated id, or a step `checkStep` refuses. */
|
|
136
113
|
function checkMigrations(migrations: readonly FormatMigration[]): void {
|
|
137
114
|
const ids = new Set<string>()
|
|
138
|
-
let last: string =
|
|
115
|
+
let last: string = SHARDFILE_FLOOR
|
|
139
116
|
for (const step of migrations) {
|
|
140
117
|
if (ids.has(step.id)) {
|
|
141
118
|
throw new Error(`Migration ${step.id} is registered twice`)
|
|
@@ -4,7 +4,6 @@ import { parsePlatformDataSection } from './platformDataSections.ts'
|
|
|
4
4
|
|
|
5
5
|
/** One defining context catalogue for author-build intake and worker transport. */
|
|
6
6
|
export const HEADLESS_CONTEXT_SECTIONS = [
|
|
7
|
-
'actors/species-programs',
|
|
8
7
|
'view/modules',
|
|
9
8
|
'sim/scripts',
|
|
10
9
|
'actors/spawn-scripts',
|
package/src/format/items.ts
CHANGED
|
@@ -43,8 +43,7 @@ export const CatalogueIconSchema: v.GenericSchema<CatalogueIconNameInput, Catalo
|
|
|
43
43
|
'sword', 'deer', 'elk', 'boar', 'bear', 'ghost', 'ironhide', 'meat', 'hide', 'tusk', 'antlers', 'bolt', 'claw', 'shell', 'coconut', 'coin', 'seaglass', 'rope', 'whetstone', 'chart', 'bearclaw', 'boartusk', 'crossbow', 'rifle', 'lever', 'longbow', 'hat', 'cape', 'charm', 'necklace', 'glyph', 'purse', 'talon', 'leopard', 'wolf', 'eagle', 'rider', 'horse', 'grapple']);
|
|
44
44
|
const equipmentNumber = v.pipe(finite, v.minValue(0), v.maxValue(10000));
|
|
45
45
|
const cue = v.pipe(v.string(), v.regex(/^cue\.[a-z][a-zA-Z0-9.-]*$/u), v.maxLength(128));
|
|
46
|
-
const equipment: v.StrictObjectSchema<{ readonly id: v.GenericSchema<ItemEquipmentRowsInput['id'], ItemEquipmentRows['id']>; readonly
|
|
47
|
-
legacySlot: v.exactOptional(v.picklist(['crossbow', 'sword', 'rifle', 'sword-iron', 'bow', 'sabre', 'spear', 'empty'])),
|
|
46
|
+
const equipment: v.StrictObjectSchema<{ readonly id: v.GenericSchema<ItemEquipmentRowsInput['id'], ItemEquipmentRows['id']>; readonly ui: v.GenericSchema<ItemEquipmentRowsInput['ui'], ItemEquipmentRows['ui']>; readonly meta: v.StrictObjectSchema<{ readonly name: v.GenericSchema<ItemEquipmentRowsInput['meta']['name'], ItemEquipmentRows['meta']['name']>; readonly icon: v.GenericSchema<ItemEquipmentRowsInput['meta']['icon'], ItemEquipmentRows['meta']['icon']>; readonly blurb: v.GenericSchema<ItemEquipmentRowsInput['meta']['blurb'], ItemEquipmentRows['meta']['blurb']>; readonly category: v.GenericSchema<ItemEquipmentRowsInput['meta']['category'], ItemEquipmentRows['meta']['category']>; }, undefined>; readonly cues: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['cues'], undefined>, Exclude<ItemEquipmentRows['cues'], undefined>>, undefined>; readonly hitStop: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['hitStop'], undefined>, Exclude<ItemEquipmentRows['hitStop'], undefined>>, undefined>; readonly rangedFeel: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['rangedFeel'], undefined>, Exclude<ItemEquipmentRows['rangedFeel'], undefined>>, undefined>; readonly tags: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['tags'], undefined>, Exclude<ItemEquipmentRows['tags'], undefined>>, undefined>; }, undefined> = v.strictObject({ id: v.pipe(v.string(), v.regex(/^weapon\.[a-z][a-zA-Z0-9.-]*$/u), v.maxLength(128)),
|
|
48
47
|
ui: v.strictObject({ name: text, icon: CatalogueIconSchema, swapIcon: v.pipe(text, v.maxLength(512)),
|
|
49
48
|
touch: v.picklist(['melee', 'bow', 'ranged', 'throwing']), lockOn: v.boolean(), melee: v.boolean(), tracers: v.boolean(),
|
|
50
49
|
inputContext: v.exactOptional(name), swapName: v.exactOptional(text), huntersEye: v.exactOptional(v.boolean()),
|
|
@@ -249,5 +248,5 @@ export interface ShardItemsInput { version: 1; catalogue?: ({ id: ItemFamilyName
|
|
|
249
248
|
export interface ShardItems { version: 1; catalogue?: ({ id: ItemFamilyNameRows; label: string; icon: CatalogueIconName; travels: boolean; })[]; kept?: KeptItemRows[]; rows: ((WeaponItemRows) | (ToolItemRows))[]; launches?: Record<string, v.InferOutput<typeof BodyLaunchSchema>>; pickups?: Record<string, v.InferOutput<typeof ClaimedPickupSchema>>; contexts: (ItemContextRows)[]; runtimeContexts?: (ItemFamilyNameRows)[]; loadout: { effects?: { statuses: boolean; player: v.InferOutput<typeof LootEconomySchema.entries.grants.entries.player>; worn: v.InferOutput<typeof LootEconomySchema.entries.grants.entries.worn>; weapons: ({ items: (`weapon.${string}`)[]; grants: v.InferOutput<typeof LootEconomySchema.entries.grants.entries.weapons>; })[]; hitCap?: `effect.${string}`; }; runtime?: { pause: boolean; sliceMs?: number; owners: ({ item: `weapon.${string}`; slot: 'primary' | 'rifle' | 'secondary' | 'extra'; row: 'native' | 'declared'; presentation?: boolean; })[]; }; native?: v.InferOutput<typeof NativeLoadoutRowSchema>; inventory?: { kinds: (ItemFamilyNameRows)[]; slots: number; counts: { min: number; max: number; integer: boolean; complete: boolean; }; quantity: 'unchecked' | 'positive-safe-integer'; snapshot: 'order' | 'roster'; stackLimit?: number; restoreError: string; }; primary: (`weapon.${string}`) | null; secondary: (`weapon.${string}`) | null; tools: (`tool.${string}`)[]; level?: LevelLoadout; }; }
|
|
250
249
|
export interface NativeSweptPolicyRowsInput { kind: 'swept'; step: ItemFamilyNameRowsInput; selection?: v.InferInput<typeof NativeLoadoutRowSchema>; eye: number; initial: number; source: 'env' | 'owner'; slots: ({ item: `weapon.${string}`; weapon: `weapon.${string}`; tags: (`${string}.${string}`)[]; combo: (ItemFamilyNameRowsInput)[]; heavy: ItemFamilyNameRowsInput; })[]; contact: { slack: number; direction: [number, number, number]; push: [number, number]; running: number; }; lunge: { maxHeight: number; minDistance: number; minRadius: number; lengthScale: number; }; }
|
|
251
250
|
export interface NativeSweptPolicyRows { kind: 'swept'; step: ItemFamilyNameRows; selection?: v.InferOutput<typeof NativeLoadoutRowSchema>; eye: number; initial: number; source: 'env' | 'owner'; slots: ({ item: `weapon.${string}`; weapon: `weapon.${string}`; tags: (`${string}.${string}`)[]; combo: (ItemFamilyNameRows)[]; heavy: ItemFamilyNameRows; })[]; contact: { slack: number; direction: [number, number, number]; push: [number, number]; running: number; }; lunge: { maxHeight: number; minDistance: number; minRadius: number; lengthScale: number; }; }
|
|
252
|
-
export interface ItemEquipmentRowsInput { id: string;
|
|
253
|
-
export interface ItemEquipmentRows { id: string;
|
|
251
|
+
export interface ItemEquipmentRowsInput { id: string; ui: { name: string; icon: CatalogueIconNameInput; swapIcon: string; touch: 'melee' | 'bow' | 'ranged' | 'throwing'; lockOn: boolean; melee: boolean; tracers: boolean; inputContext?: ItemFamilyNameRowsInput; swapName?: string; huntersEye?: boolean; ammo?: { label: string; segments: number; magazine?: boolean; bagLabel?: string; bagLabelFor?: string; }; }; meta: { name: string; icon: CatalogueIconNameInput; blurb: string; category: ItemFamilyNameRowsInput; }; cues?: { fire: string; reload: string; impact: string; dry?: string; hit?: string; heavy?: string; charge?: Record<string, string>; }; hitStop?: { body: number; head: number; kill: number; }; rangedFeel?: { kick: { body: number; head: number; kill: number; side: number; killSide: number; }; trauma: { kill: number; head: number; killKinds: (ItemFamilyNameRowsInput)[]; headKinds: (ItemFamilyNameRowsInput)[]; }; }; tags?: (`${string}.${string}`)[]; }
|
|
252
|
+
export interface ItemEquipmentRows { id: string; ui: { name: string; icon: CatalogueIconName; swapIcon: string; touch: 'melee' | 'bow' | 'ranged' | 'throwing'; lockOn: boolean; melee: boolean; tracers: boolean; inputContext?: ItemFamilyNameRows; swapName?: string; huntersEye?: boolean; ammo?: { label: string; segments: number; magazine?: boolean; bagLabel?: string; bagLabelFor?: string; }; }; meta: { name: string; icon: CatalogueIconName; blurb: string; category: ItemFamilyNameRows; }; cues?: { fire: string; reload: string; impact: string; dry?: string; hit?: string; heavy?: string; charge?: Record<string, string>; }; hitStop?: { body: number; head: number; kill: number; }; rangedFeel?: { kick: { body: number; head: number; kill: number; side: number; killSide: number; }; trauma: { kill: number; head: number; killKinds: (ItemFamilyNameRows)[]; headKinds: (ItemFamilyNameRows)[]; }; }; tags?: (`${string}.${string}`)[]; }
|
|
@@ -53,8 +53,6 @@ const DATA_SECTION_NAMES: Readonly<Record<keyof PlatformDataSections, true>> = {
|
|
|
53
53
|
'models/island-library': true,
|
|
54
54
|
"player/stealth": true,
|
|
55
55
|
"explore/catalogue": true,
|
|
56
|
-
"look/rigged-hulls": true,
|
|
57
|
-
"look/hull-book": true,
|
|
58
56
|
"look/toon": true,
|
|
59
57
|
"look/painted": true,
|
|
60
58
|
"look/colour-functions": true,
|
|
@@ -75,7 +73,6 @@ const DATA_SECTION_NAMES: Readonly<Record<keyof PlatformDataSections, true>> = {
|
|
|
75
73
|
"held/melee": true,
|
|
76
74
|
"ui/completion": true,
|
|
77
75
|
"sim/runtime-plan": true,
|
|
78
|
-
"actors/species-programs": true,
|
|
79
76
|
"actors/moves": true,
|
|
80
77
|
"actors/spawn-scripts": true,
|
|
81
78
|
"actors/return-scripts": true,
|
|
@@ -4,8 +4,6 @@ import { DeclaredBodyOpsSchema, type DeclaredBodyOpsRows } from './bodySlots.ts'
|
|
|
4
4
|
import {StealthRowsSchema,type StealthRows} from './stealth.ts';
|
|
5
5
|
import { PaintedLookSchema, type PaintedLookRow } from './paintedLook.ts';
|
|
6
6
|
import { ColourFunctionBookSchema, type ColourFunctionBook } from './colourFunction.ts';
|
|
7
|
-
import { RiggedHullBookSchema, type RiggedHullBook } from './riggedHulls.ts';
|
|
8
|
-
import { HullLookBookSchema, type HullLookBookRows } from './speciesLooks.ts';
|
|
9
7
|
import { ExplorerCatalogueSchema, type ExplorerCatalogue } from './explorerCatalogue.ts';
|
|
10
8
|
import { ToonLookSchema, type ToonLookRow } from './toonLook.ts';
|
|
11
9
|
import { KEYED_SKY, type KeyedSkyStyle } from './keyedSky.ts';
|
|
@@ -25,7 +23,6 @@ import { LoadoutSchema, type LoadoutRows } from './loadout.ts';
|
|
|
25
23
|
import { HeldFinishesSchema, type HeldFinishesRows } from './heldFinishes.ts';
|
|
26
24
|
import { HeldGearSchema, type HeldGearRows } from './heldGear.ts';
|
|
27
25
|
import * as v from 'valibot';
|
|
28
|
-
import { isJsonData } from './json.ts';
|
|
29
26
|
import { HeldEquipmentSchema, type HeldEquipmentRows } from './heldEquipment.ts';
|
|
30
27
|
import { HeldMeleeSchema } from './items.ts';
|
|
31
28
|
import type { NativeSweptPolicyRows } from './items.ts';
|
|
@@ -45,17 +42,12 @@ import { WaterFieldSchema } from './water-field.ts';
|
|
|
45
42
|
import type { WaterFieldRows } from './water-field.ts';
|
|
46
43
|
import type { Vehicles } from './vehicles.ts';
|
|
47
44
|
|
|
48
|
-
/** ONE-FORMAT OF30: a retired section an older product may still carry: plain JSON, read by nothing. */
|
|
49
|
-
const RETIRED_SECTION: v.GenericSchema<unknown, unknown> = v.pipe(v.unknown(), v.check(isJsonData, 'A retired section must be plain JSON'));
|
|
50
|
-
|
|
51
45
|
/** New plain-value sections supplement the unchanged v1 model assembled from the older section envelopes. */
|
|
52
46
|
export interface PlatformDataSections {
|
|
53
47
|
'collections/displays': CollectionDisplaysRows;
|
|
54
48
|
'models/island-library': ResolvedIslandLibraryRows;
|
|
55
49
|
'player/stealth':StealthRows;
|
|
56
50
|
'explore/catalogue': ExplorerCatalogue;
|
|
57
|
-
'look/rigged-hulls': RiggedHullBook;
|
|
58
|
-
'look/hull-book': HullLookBookRows;
|
|
59
51
|
'look/toon': ToonLookRow;
|
|
60
52
|
'look/painted': PaintedLookRow;
|
|
61
53
|
'look/colour-functions': ColourFunctionBook;
|
|
@@ -77,8 +69,6 @@ export interface PlatformDataSections {
|
|
|
77
69
|
'held/melee': NativeSweptPolicyRows;
|
|
78
70
|
'ui/completion': CompletionRows;
|
|
79
71
|
'sim/runtime-plan': NativeRuntimePlanData;
|
|
80
|
-
/** ONE-FORMAT OF30: retired. An older product still carrying it admits; nothing reads it. */
|
|
81
|
-
'actors/species-programs': unknown;
|
|
82
72
|
'actors/moves': ActorMoves;
|
|
83
73
|
'actors/spawn-scripts': SpawnScriptRows[];
|
|
84
74
|
'actors/return-scripts': ReturnModuleRow[];
|
|
@@ -101,9 +91,6 @@ export const PLATFORM_DATA_SECTIONS: Readonly<{ [Name in keyof PlatformDataSecti
|
|
|
101
91
|
'models/island-library': { schema: ResolvedIslandLibrarySchema },
|
|
102
92
|
'player/stealth':{schema:StealthRowsSchema},
|
|
103
93
|
'explore/catalogue': { schema: ExplorerCatalogueSchema },
|
|
104
|
-
'actors/species-programs': { schema: RETIRED_SECTION },
|
|
105
|
-
'look/rigged-hulls': { schema: RiggedHullBookSchema },
|
|
106
|
-
'look/hull-book': { schema: HullLookBookSchema },
|
|
107
94
|
'look/toon': { schema: ToonLookSchema },
|
|
108
95
|
'look/painted': { schema: PaintedLookSchema },
|
|
109
96
|
'look/colour-functions': { schema: ColourFunctionBookSchema },
|
|
@@ -151,8 +138,6 @@ export function parsePlatformDataSection(name: 'collections/displays', value: un
|
|
|
151
138
|
export function parsePlatformDataSection(name: 'models/island-library', value: unknown): ResolvedIslandLibraryRows;
|
|
152
139
|
export function parsePlatformDataSection(name:'player/stealth',value:unknown):StealthRows;
|
|
153
140
|
export function parsePlatformDataSection(name: 'explore/catalogue', value: unknown): ExplorerCatalogue;
|
|
154
|
-
export function parsePlatformDataSection(name: 'look/rigged-hulls', value: unknown): RiggedHullBook;
|
|
155
|
-
export function parsePlatformDataSection(name: 'look/hull-book', value: unknown): HullLookBookRows;
|
|
156
141
|
export function parsePlatformDataSection(name: 'look/toon', value: unknown): ToonLookRow;
|
|
157
142
|
export function parsePlatformDataSection(name: 'look/painted', value: unknown): PaintedLookRow;
|
|
158
143
|
export function parsePlatformDataSection(name: 'look/colour-functions', value: unknown): ColourFunctionBook;
|
|
@@ -164,7 +149,6 @@ export function parsePlatformDataSection(name: 'held/loadout', value: unknown):
|
|
|
164
149
|
export function parsePlatformDataSection(name: 'held/finishes', value: unknown): HeldFinishesRows;
|
|
165
150
|
export function parsePlatformDataSection(name: 'held/gear', value: unknown): HeldGearRows;
|
|
166
151
|
export function parsePlatformDataSection(name: 'held/equipment', value: unknown): HeldEquipmentRows;
|
|
167
|
-
export function parsePlatformDataSection(name: 'actors/species-programs', value: unknown): unknown;
|
|
168
152
|
export function parsePlatformDataSection(name: 'actors/moves', value: unknown): ActorMoves;
|
|
169
153
|
export function parsePlatformDataSection(name: 'actors/strikes', value: unknown): CreatureStrikes;
|
|
170
154
|
export function parsePlatformDataSection(name: 'actors/spawn-scripts', value: unknown): SpawnScriptRows[];
|
package/src/format/rig-looks.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `platform.rig` names the `world/scenes` models library (`parameters.library`) whose rigs carry the body, and optionally
|
|
4
4
|
* the rig body (`parameters.body`, else the species' kind). The rig brings its own skeleton, surfaces and clips, so the row
|
|
5
5
|
* names no material and its animation is the rig's own (`platform.rig`, no parameters). This replaces a page's
|
|
6
|
-
*
|
|
6
|
+
* deleted species program for drawing declared bodies (Sunscar Dunes' ray, strider and Matriarch).
|
|
7
7
|
*/
|
|
8
8
|
import {
|
|
9
9
|
exactOptional,
|
|
@@ -139,7 +139,7 @@ function rigLookRules(
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/** OF19d1: a page whose plan keeper stands no body (`keeper` is its actor ids), and whose every declared spawn's species
|
|
142
|
-
* has a look row, draws its creatures as an ordinary upload does
|
|
142
|
+
* has a look row, draws its creatures as an ordinary upload does. */
|
|
143
143
|
function declaredLooksDraw(
|
|
144
144
|
shard: Readonly<RigLookShard>,
|
|
145
145
|
keeper: readonly string[],
|
|
@@ -156,22 +156,12 @@ function declaredLooksDraw(
|
|
|
156
156
|
)
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
/** Whether a data page draws its declared bodies from their looks:
|
|
160
|
-
*
|
|
159
|
+
/** Whether a data page draws its declared bodies from their looks: its runtime plan's keeper (`plan`, the
|
|
160
|
+
* `sim/runtime-plan` section) stands no body, and every declared spawn's species has a look. */
|
|
161
161
|
function pageDrawsDeclaredLooks(
|
|
162
162
|
shard: Readonly<RigLookShard>,
|
|
163
163
|
plan: unknown,
|
|
164
|
-
features: readonly Readonly<{ kind: string }>[],
|
|
165
164
|
): boolean {
|
|
166
|
-
if (
|
|
167
|
-
plan === undefined ||
|
|
168
|
-
features.some(
|
|
169
|
-
(row: Readonly<{ kind: string }>): boolean =>
|
|
170
|
-
row.kind === 'species.program',
|
|
171
|
-
)
|
|
172
|
-
) {
|
|
173
|
-
return false
|
|
174
|
-
}
|
|
175
165
|
return declaredLooksDraw(shard, nativeRuntimeActorIds(plan))
|
|
176
166
|
}
|
|
177
167
|
|