castle-web-cli 0.4.197 → 0.4.199
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/dist/agent-prompts.d.ts +1 -0
- package/dist/agent-prompts.js +9 -3
- package/dist/agent.js +25 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +14 -3
- package/dist/byo-auth.js +4 -5
- package/dist/castle-host/host.js +215 -0
- package/dist/devSessionServer.js +40 -3
- package/dist/devSessionStorage.js +155 -0
- package/dist/filesChanged.d.ts +23 -0
- package/dist/filesChanged.js +15 -9
- package/dist/ide.d.ts +3 -0
- package/dist/ide.js +37 -25
- package/dist/init.js +1 -1
- package/dist/paramsFile.d.ts +80 -0
- package/dist/paramsFile.js +516 -0
- package/dist/paramsRegisterPlugin.d.ts +3 -0
- package/dist/paramsRegisterPlugin.js +81 -0
- package/dist/paramsTunes.d.ts +44 -0
- package/dist/paramsTunes.js +200 -0
- package/dist/paramsWrites.d.ts +30 -0
- package/dist/paramsWrites.js +138 -0
- package/dist/platformDoc.d.ts +1 -1
- package/dist/platformDoc.js +6 -20
- package/dist/save-deck.js +9 -1
- package/dist/serve.js +23 -15
- package/dist/shell/assets/index-DJSLmPmw.js +449 -0
- package/dist/shell/assets/index-uXcYGwQC.css +1 -0
- package/dist/shell/index.html +2 -2
- package/dist/textHash.d.ts +2 -0
- package/dist/textHash.js +28 -0
- package/kits/base/castle.json +1 -1
- package/kits/base/package-lock.json +1 -1
- package/kits/base/sdk/README.md +4 -0
- package/kits/base/sdk/castle.d.ts +4 -0
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/characters.d.ts +26 -0
- package/kits/base/sdk/characters.js +108 -0
- package/kits/base/sdk/commands.d.ts +70 -0
- package/kits/base/sdk/multiplayer.js +68 -0
- package/kits/base/sdk/paramsRegistry.d.ts +32 -0
- package/kits/base/sdk/paramsRegistry.js +100 -0
- package/kits/base/sdk/runtime.d.ts +7 -0
- package/kits/base/sdk/runtime.js +34 -0
- package/kits/base/sdk/server/storage.d.ts +77 -0
- package/kits/base/sdk/server/storage.js +272 -18
- package/kits/base/sdk/server/wrapper.d.ts +1 -1
- package/kits/physics-2d/behaviors/Collider.jsx +3 -3
- package/kits/physics-2d/behaviors/Joints.jsx +2 -2
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/editors/SceneEditor.jsx +5 -5
- package/kits/physics-2d/editors/pxArtTimeline.jsx +1 -1
- package/kits/physics-2d/editors/pxArtTimeline.module.css +73 -73
- package/kits/physics-2d/editors/themeEditor.module.css +17 -17
- package/kits/physics-2d/engine/castle-tokens.css +64 -0
- package/kits/physics-2d/engine/fields/fields.module.css +43 -37
- package/kits/physics-2d/engine/ui.jsx +1 -0
- package/kits/physics-2d/engine/ui.module.css +262 -288
- package/kits/physics-2d/package-lock.json +6 -1
- package/package.json +1 -1
- package/dist/shell/assets/index-MSHtKPXt.css +0 -1
- package/dist/shell/assets/index-yHGXRGlX.js +0 -449
|
@@ -35,6 +35,14 @@ const REQUEST_OVERHEAD_BYTES = 4 * 1024;
|
|
|
35
35
|
*/
|
|
36
36
|
const MAX_KEY_BYTES = 128;
|
|
37
37
|
const MAX_SUBJECT_BYTES = 256;
|
|
38
|
+
const MAX_OPERATION_ID_BYTES = 128;
|
|
39
|
+
const MAX_OPERATION_ID_CHARACTERS = 120;
|
|
40
|
+
const MAX_NARRATIVE_ID_BYTES = 128;
|
|
41
|
+
const MAX_NARRATIVE_ID_CHARACTERS = 100;
|
|
42
|
+
const MAX_EVENT_OCCURRENCE_ID_BYTES = 256;
|
|
43
|
+
const MAX_EVENT_OCCURRENCE_ID_CHARACTERS = 200;
|
|
44
|
+
const MAX_NARRATIVE_IDS = 16;
|
|
45
|
+
const MAX_GENERATION = 2_147_483_647;
|
|
38
46
|
export function createServerStorage(platformHandle) {
|
|
39
47
|
const call = async (op, args) => {
|
|
40
48
|
if (typeof platformHandle.storage !== "function") {
|
|
@@ -67,8 +75,112 @@ export function createServerStorage(platformHandle) {
|
|
|
67
75
|
board(name) {
|
|
68
76
|
return createBoard(call, name);
|
|
69
77
|
},
|
|
78
|
+
async playthrough(userId) {
|
|
79
|
+
const subject = assertUserId(userId, "session.storage.playthrough");
|
|
80
|
+
const opened = await call("playthroughOpen", { subject });
|
|
81
|
+
return createPlaythrough(call, subject, assertGeneration(opened?.generation));
|
|
82
|
+
},
|
|
70
83
|
};
|
|
71
84
|
}
|
|
85
|
+
function createPlaythrough(call, subject, generation) {
|
|
86
|
+
const characters = Object.freeze({
|
|
87
|
+
async recordEvent(input) {
|
|
88
|
+
return call("characterRecordEvent", {
|
|
89
|
+
subject,
|
|
90
|
+
generation,
|
|
91
|
+
operationId: assertOperationId(input?.operationId),
|
|
92
|
+
eventTypeId: assertNarrativeId(input?.eventTypeId, "eventTypeId"),
|
|
93
|
+
...(input?.data === undefined ? {} : { data: assertEventData(input.data) }),
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
async setGameState(input) {
|
|
97
|
+
return call("characterSetGameState", {
|
|
98
|
+
subject, generation,
|
|
99
|
+
operationId: assertOperationId(input?.operationId),
|
|
100
|
+
expectedRevision: assertStateRevision(input?.expectedRevision),
|
|
101
|
+
changes: assertStateChanges(input?.changes),
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
async shareClaim(input) {
|
|
105
|
+
return call("characterShareClaim", {
|
|
106
|
+
subject, generation,
|
|
107
|
+
operationId: assertOperationId(input?.operationId),
|
|
108
|
+
recipientCharacterId: assertNarrativeId(input?.recipientCharacterId, "recipientCharacterId"),
|
|
109
|
+
claimId: assertNarrativeId(input?.claimId, "claimId"),
|
|
110
|
+
source: assertCharacterSource(input?.source),
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
async inspect() {
|
|
114
|
+
return call("characterInspect", { subject, generation });
|
|
115
|
+
},
|
|
116
|
+
async deliverKnowledge(input) {
|
|
117
|
+
return call("characterDeliverKnowledge", {
|
|
118
|
+
subject,
|
|
119
|
+
generation,
|
|
120
|
+
operationId: assertOperationId(input?.operationId),
|
|
121
|
+
recipientCharacterId: assertNarrativeId(input?.recipientCharacterId, "recipientCharacterId"),
|
|
122
|
+
eventOccurrenceId: assertEventOccurrenceId(input?.eventOccurrenceId, "eventOccurrenceId"),
|
|
123
|
+
claimIds: assertNarrativeIds(input?.claimIds, "claimIds"),
|
|
124
|
+
source: assertKnowledgeSource(input?.source),
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
async completeBeat(input) {
|
|
128
|
+
return call("characterCompleteBeat", {
|
|
129
|
+
subject,
|
|
130
|
+
generation,
|
|
131
|
+
operationId: assertOperationId(input?.operationId),
|
|
132
|
+
characterId: assertNarrativeId(input?.characterId, "characterId"),
|
|
133
|
+
beatId: assertNarrativeId(input?.beatId, "beatId"),
|
|
134
|
+
eventOccurrenceId: assertEventOccurrenceId(input?.eventOccurrenceId, "eventOccurrenceId"),
|
|
135
|
+
outcomeId: assertNarrativeId(input?.outcomeId, "outcomeId"),
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
async status(operationId) {
|
|
139
|
+
return call("characterStatus", {
|
|
140
|
+
subject,
|
|
141
|
+
generation,
|
|
142
|
+
operationId: assertOperationId(operationId),
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
async history(options = {}) {
|
|
146
|
+
return call("characterHistory", {
|
|
147
|
+
subject,
|
|
148
|
+
generation,
|
|
149
|
+
limit: assertHistoryLimit(options.limit),
|
|
150
|
+
cursor: options.cursor === undefined || options.cursor === null
|
|
151
|
+
? null
|
|
152
|
+
: assertNarrativeId(options.cursor, "cursor"),
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
return Object.freeze({
|
|
157
|
+
generation,
|
|
158
|
+
characters,
|
|
159
|
+
async get(keys) {
|
|
160
|
+
const entries = await call("playthroughGet", { subject, generation, keys: assertKeys(keys, "session.storage.playthrough.get") });
|
|
161
|
+
return decodeEntries(entries, "session.storage.playthrough.get");
|
|
162
|
+
},
|
|
163
|
+
async set(values) {
|
|
164
|
+
const entries = encodeEntries(values, "session.storage.playthrough.set");
|
|
165
|
+
for (const chunk of batched(entries, "session.storage.playthrough.set")) {
|
|
166
|
+
await call("playthroughSet", { subject, generation, entries: chunk });
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
async remove(keys) {
|
|
170
|
+
for (const chunk of chunked(assertKeys(keys, "session.storage.playthrough.remove"), MAX_KEYS_PER_CALL)) {
|
|
171
|
+
await call("playthroughDelete", { subject, generation, keys: chunk });
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
async reset(operationId) {
|
|
175
|
+
const reset = await call("playthroughReset", {
|
|
176
|
+
subject,
|
|
177
|
+
generation,
|
|
178
|
+
operationId: assertOperationId(operationId),
|
|
179
|
+
});
|
|
180
|
+
return createPlaythrough(call, subject, assertGeneration(reset?.generation));
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
}
|
|
72
184
|
function createScope(call, scope, subject) {
|
|
73
185
|
return {
|
|
74
186
|
async get(keys) {
|
|
@@ -79,24 +191,10 @@ function createScope(call, scope, subject) {
|
|
|
79
191
|
subject,
|
|
80
192
|
keys: assertKeys(keys, "session.storage.get"),
|
|
81
193
|
});
|
|
82
|
-
|
|
83
|
-
for (const entry of entries ?? []) {
|
|
84
|
-
// defineProperty, not assignment: a stored key named "__proto__" would
|
|
85
|
-
// otherwise reach the prototype setter rather than becoming an own property.
|
|
86
|
-
Object.defineProperty(result, entry.key, {
|
|
87
|
-
value: decodeStorageValue(entry.value, "session.storage.get"),
|
|
88
|
-
writable: true,
|
|
89
|
-
enumerable: true,
|
|
90
|
-
configurable: true,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
194
|
+
return decodeEntries(entries, "session.storage.get");
|
|
94
195
|
},
|
|
95
196
|
async set(values) {
|
|
96
|
-
const entries =
|
|
97
|
-
key,
|
|
98
|
-
value: encodeStorageValue(value, "session.storage.set"),
|
|
99
|
-
}));
|
|
197
|
+
const entries = encodeEntries(values, "session.storage.set");
|
|
100
198
|
for (const chunk of batched(entries)) {
|
|
101
199
|
await call("set", { scope, subject, entries: chunk });
|
|
102
200
|
}
|
|
@@ -182,7 +280,7 @@ function assertUserId(userId, operation) {
|
|
|
182
280
|
* Splits entries into requests that fit both limits: the platform's key count and the
|
|
183
281
|
* channel's frame size.
|
|
184
282
|
*/
|
|
185
|
-
function batched(entries) {
|
|
283
|
+
function batched(entries, operation = "session.storage.set") {
|
|
186
284
|
const budget = MAX_REQUEST_BYTES - REQUEST_OVERHEAD_BYTES;
|
|
187
285
|
const batches = [];
|
|
188
286
|
let current = [];
|
|
@@ -190,7 +288,7 @@ function batched(entries) {
|
|
|
190
288
|
for (const entry of entries) {
|
|
191
289
|
const bytes = entryBytes(entry);
|
|
192
290
|
if (bytes > budget) {
|
|
193
|
-
throw storageError("CAULDRON_STORAGE_INVALID_VALUE", `A single stored value must be under ${budget} bytes when written from a session server.`,
|
|
291
|
+
throw storageError("CAULDRON_STORAGE_INVALID_VALUE", `A single stored value must be under ${budget} bytes when written from a session server.`, operation);
|
|
194
292
|
}
|
|
195
293
|
if (current.length === MAX_KEYS_PER_CALL || currentBytes + bytes > budget) {
|
|
196
294
|
batches.push(current);
|
|
@@ -204,6 +302,162 @@ function batched(entries) {
|
|
|
204
302
|
batches.push(current);
|
|
205
303
|
return batches;
|
|
206
304
|
}
|
|
305
|
+
function assertGeneration(value) {
|
|
306
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > MAX_GENERATION) {
|
|
307
|
+
throw storageError("CAULDRON_STORAGE_INVALID_RESPONSE", "The platform returned an invalid playthrough generation.", "session.storage.playthrough");
|
|
308
|
+
}
|
|
309
|
+
return value;
|
|
310
|
+
}
|
|
311
|
+
function assertOperationId(value) {
|
|
312
|
+
if (typeof value !== "string" ||
|
|
313
|
+
value.length === 0 ||
|
|
314
|
+
value.length > MAX_OPERATION_ID_CHARACTERS ||
|
|
315
|
+
value.includes("\0") ||
|
|
316
|
+
hasUnpairedSurrogate(value) ||
|
|
317
|
+
utf8Length(value) > MAX_OPERATION_ID_BYTES) {
|
|
318
|
+
throw storageError("CAULDRON_STORAGE_INVALID_ARGUMENT", `An operation id must be valid text of at most ${MAX_OPERATION_ID_CHARACTERS} characters and ${MAX_OPERATION_ID_BYTES} bytes.`, "session.storage.playthrough.reset");
|
|
319
|
+
}
|
|
320
|
+
return value;
|
|
321
|
+
}
|
|
322
|
+
function assertNarrativeId(value, field) {
|
|
323
|
+
if (typeof value !== "string" ||
|
|
324
|
+
value.length === 0 ||
|
|
325
|
+
value.length > MAX_NARRATIVE_ID_CHARACTERS ||
|
|
326
|
+
value.includes("\0") ||
|
|
327
|
+
hasUnpairedSurrogate(value) ||
|
|
328
|
+
utf8Length(value) > MAX_NARRATIVE_ID_BYTES) {
|
|
329
|
+
throw storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", `${field} must be valid text of at most ${MAX_NARRATIVE_ID_CHARACTERS} characters and ${MAX_NARRATIVE_ID_BYTES} bytes.`, `session.storage.playthrough.characters.${field}`);
|
|
330
|
+
}
|
|
331
|
+
return value;
|
|
332
|
+
}
|
|
333
|
+
function assertEventOccurrenceId(value, field) {
|
|
334
|
+
if (typeof value !== "string" ||
|
|
335
|
+
value.length === 0 ||
|
|
336
|
+
value.length > MAX_EVENT_OCCURRENCE_ID_CHARACTERS ||
|
|
337
|
+
value.includes("\0") ||
|
|
338
|
+
hasUnpairedSurrogate(value) ||
|
|
339
|
+
utf8Length(value) > MAX_EVENT_OCCURRENCE_ID_BYTES) {
|
|
340
|
+
throw storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", `${field} must be valid text of at most ${MAX_EVENT_OCCURRENCE_ID_CHARACTERS} characters and ${MAX_EVENT_OCCURRENCE_ID_BYTES} bytes.`, `session.storage.playthrough.characters.${field}`);
|
|
341
|
+
}
|
|
342
|
+
return value;
|
|
343
|
+
}
|
|
344
|
+
function assertNarrativeIds(value, field) {
|
|
345
|
+
if (!Array.isArray(value) || value.length === 0 || value.length > MAX_NARRATIVE_IDS) {
|
|
346
|
+
throw storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", `${field} must contain between 1 and ${MAX_NARRATIVE_IDS} ids.`, `session.storage.playthrough.characters.${field}`);
|
|
347
|
+
}
|
|
348
|
+
return value.map((item) => assertNarrativeId(item, field));
|
|
349
|
+
}
|
|
350
|
+
function assertKnowledgeSource(value) {
|
|
351
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
352
|
+
throw storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", "source must name creator_event or a character.", "session.storage.playthrough.characters.deliverKnowledge");
|
|
353
|
+
}
|
|
354
|
+
const source = value;
|
|
355
|
+
if (source.type === "creator_event")
|
|
356
|
+
return { type: "creator_event" };
|
|
357
|
+
if (source.type === "character") {
|
|
358
|
+
return {
|
|
359
|
+
type: "character",
|
|
360
|
+
characterId: assertNarrativeId(source.characterId, "source.characterId"),
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
throw storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", "source must name creator_event or a character.", "session.storage.playthrough.characters.deliverKnowledge");
|
|
364
|
+
}
|
|
365
|
+
function characterArgumentError(message) {
|
|
366
|
+
return storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", message, "session.storage.playthrough.characters");
|
|
367
|
+
}
|
|
368
|
+
function assertCharacterSource(value) {
|
|
369
|
+
if (!value || typeof value !== "object" || Array.isArray(value) ||
|
|
370
|
+
value.type !== "character") {
|
|
371
|
+
throw characterArgumentError("source must name a character.");
|
|
372
|
+
}
|
|
373
|
+
return { type: "character", characterId: assertNarrativeId(value.characterId, "source.characterId") };
|
|
374
|
+
}
|
|
375
|
+
function assertScalar(value) {
|
|
376
|
+
return typeof value === "boolean" ||
|
|
377
|
+
(typeof value === "number" && Number.isFinite(value) && Math.abs(value) <= 1_000_000) ||
|
|
378
|
+
(typeof value === "string" && value.length <= 300 && !value.includes("\0") &&
|
|
379
|
+
!hasUnpairedSurrogate(value) && utf8Length(value) <= 1200);
|
|
380
|
+
}
|
|
381
|
+
function assertEventData(value) {
|
|
382
|
+
if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).length > 8) {
|
|
383
|
+
throw characterArgumentError("event data must be an object of at most eight scalar fields.");
|
|
384
|
+
}
|
|
385
|
+
const result = Object.create(null);
|
|
386
|
+
for (const [key, field] of Object.entries(value)) {
|
|
387
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype" ||
|
|
388
|
+
!/^[A-Za-z][A-Za-z0-9_]{0,63}$/.test(key) || !assertScalar(field)) {
|
|
389
|
+
throw characterArgumentError("event data has an invalid field.");
|
|
390
|
+
}
|
|
391
|
+
result[key] = field;
|
|
392
|
+
}
|
|
393
|
+
return result;
|
|
394
|
+
}
|
|
395
|
+
function assertStateRevision(value) {
|
|
396
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
397
|
+
throw characterArgumentError("expectedRevision must be a nonnegative integer.");
|
|
398
|
+
}
|
|
399
|
+
return value;
|
|
400
|
+
}
|
|
401
|
+
function assertStateChanges(value) {
|
|
402
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > 32) {
|
|
403
|
+
throw characterArgumentError("changes must contain one to 32 fields.");
|
|
404
|
+
}
|
|
405
|
+
const seen = new Set();
|
|
406
|
+
return value.map((change) => {
|
|
407
|
+
if (!change || typeof change !== "object" || Array.isArray(change)) {
|
|
408
|
+
throw characterArgumentError("state change must contain a key and scalar value.");
|
|
409
|
+
}
|
|
410
|
+
const { key, value: field } = change;
|
|
411
|
+
if (typeof key !== "string" || !/^[A-Za-z][A-Za-z0-9_]{0,63}$/.test(key) ||
|
|
412
|
+
key === "constructor" || key === "prototype" || seen.has(key) || !assertScalar(field)) {
|
|
413
|
+
throw characterArgumentError("state change has an invalid or duplicate field.");
|
|
414
|
+
}
|
|
415
|
+
seen.add(key);
|
|
416
|
+
return { key, value: field };
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function assertHistoryLimit(value) {
|
|
420
|
+
if (value === undefined || value === null)
|
|
421
|
+
return null;
|
|
422
|
+
if (Number.isSafeInteger(value) && value >= 1 && value <= 50) {
|
|
423
|
+
return value;
|
|
424
|
+
}
|
|
425
|
+
throw storageError("CAULDRON_CHARACTER_INVALID_ARGUMENT", "history limit must be an integer from 1 through 50.", "session.storage.playthrough.characters.history");
|
|
426
|
+
}
|
|
427
|
+
function decodeEntries(entries, operation) {
|
|
428
|
+
const result = {};
|
|
429
|
+
for (const entry of entries ?? []) {
|
|
430
|
+
// defineProperty avoids invoking the prototype setter for a stored "__proto__" key.
|
|
431
|
+
Object.defineProperty(result, entry.key, {
|
|
432
|
+
value: decodeStorageValue(entry.value, operation),
|
|
433
|
+
writable: true,
|
|
434
|
+
enumerable: true,
|
|
435
|
+
configurable: true,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
return result;
|
|
439
|
+
}
|
|
440
|
+
function encodeEntries(values, operation) {
|
|
441
|
+
return Object.entries(values).map(([key, value]) => ({
|
|
442
|
+
key,
|
|
443
|
+
value: encodeStorageValue(value, operation),
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
function hasUnpairedSurrogate(value) {
|
|
447
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
448
|
+
const code = value.charCodeAt(index);
|
|
449
|
+
if (code >= 0xd800 && code <= 0xdbff) {
|
|
450
|
+
const next = value.charCodeAt(index + 1);
|
|
451
|
+
if (!(next >= 0xdc00 && next <= 0xdfff))
|
|
452
|
+
return true;
|
|
453
|
+
index += 1;
|
|
454
|
+
}
|
|
455
|
+
else if (code >= 0xdc00 && code <= 0xdfff) {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
207
461
|
function entryBytes(entry) {
|
|
208
462
|
// The ENCODED size, not the string length. `value` is already JSON, so putting it
|
|
209
463
|
// in the request escapes it a second time -- every quote and backslash doubles.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MultiplayerSessionMode, PlatformHandle, PlayerIdentity } from "./platformHandle";
|
|
2
2
|
import { type ServerStorage } from "./storage";
|
|
3
3
|
export type { MultiplayerSessionMode, PlatformHandle, PlatformSessionConfig, PlayerIdentity, } from "./platformHandle";
|
|
4
|
-
export type { ServerStorage, ServerStorageBoard, ServerStorageBoardScore, ServerStorageListEntry, ServerStorageListOptions, ServerStorageListPage, ServerStorageScope, } from "./storage";
|
|
4
|
+
export type { CharacterKnowledgeSource, CompleteCharacterBeatInput, DeliverCharacterKnowledgeInput, RecordCharacterEventInput, SetCharacterGameStateInput, ShareCharacterClaimInput, ServerStorage, ServerStorageBoard, ServerStorageBoardScore, ServerStorageListEntry, ServerStorageListOptions, ServerStorageListPage, ServerPlaythrough, ServerPlaythroughCharacters, ServerCharacterHistoryOptions, ServerStorageScope, } from "./storage";
|
|
5
5
|
export interface MultiplayerServerPlayer extends PlayerIdentity {
|
|
6
6
|
playerId: string;
|
|
7
7
|
}
|
|
@@ -9,9 +9,9 @@ const rowGap = { display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: 6
|
|
|
9
9
|
const chip = (active) => ({
|
|
10
10
|
padding: '3px 9px',
|
|
11
11
|
borderRadius: 6,
|
|
12
|
-
border: `1px solid ${active ? '#4aa3ff' : 'var(--castle-
|
|
12
|
+
border: `1px solid ${active ? '#4aa3ff' : 'var(--castle-border-1)'}`,
|
|
13
13
|
background: active ? 'rgba(74,163,255,0.15)' : 'transparent',
|
|
14
|
-
color: 'var(--castle-
|
|
14
|
+
color: 'var(--castle-text-primary)',
|
|
15
15
|
fontFamily: 'inherit',
|
|
16
16
|
fontSize: 12,
|
|
17
17
|
cursor: 'pointer',
|
|
@@ -29,7 +29,7 @@ const linkBtn = {
|
|
|
29
29
|
};
|
|
30
30
|
const deleteBtn = { ...linkBtn, color: '#ff7a7a' };
|
|
31
31
|
const actionRow = { display: 'flex', justifyContent: 'space-between', alignItems: 'center', margin: '4px 0 12px' };
|
|
32
|
-
const noteStyle = { fontSize: 12, color: 'var(--castle-
|
|
32
|
+
const noteStyle = { fontSize: 12, color: 'var(--castle-text-muted)', margin: '2px 0 10px' };
|
|
33
33
|
const resetRow = { display: 'flex', justifyContent: 'space-between', alignItems: 'center', margin: '2px 0 10px' };
|
|
34
34
|
const overrideNote = { fontSize: 12, color: '#b58dff' };
|
|
35
35
|
const resetLink = { ...linkBtn, color: '#b58dff' };
|
|
@@ -235,7 +235,7 @@ function AnchorFields({ joint, isPivot, onPatch }) {
|
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
const entryBox = { borderTop: '1px solid var(--castle-
|
|
238
|
+
const entryBox = { borderTop: '1px solid var(--castle-border-1)', paddingTop: 8, marginBottom: 6 };
|
|
239
239
|
const anchorToggle = {
|
|
240
240
|
background: 'none',
|
|
241
241
|
border: 'none',
|
|
@@ -249,7 +249,7 @@ const entryHead = { display: 'flex', justifyContent: 'space-between', alignItems
|
|
|
249
249
|
const entryTitle = { color: '#c9a9ff', fontSize: 13 };
|
|
250
250
|
const removeLink = { background: 'none', border: 'none', padding: 0, color: '#ff7a7a', fontSize: 12, cursor: 'pointer' };
|
|
251
251
|
const targetRow = { display: 'flex', flexDirection: 'column', gap: 6, margin: '4px 0 10px' };
|
|
252
|
-
const targetText = { fontSize: 13, color: 'var(--castle-
|
|
252
|
+
const targetText = { fontSize: 13, color: 'var(--castle-text-primary)' };
|
|
253
253
|
|
|
254
254
|
// Draw the link between two world points, styled by joint type: spring coils,
|
|
255
255
|
// rope dashes, weld doubles the line, rod is a plain line.
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"autoUpdateWhenImported": true,
|
|
68
68
|
"onUpdate": "scripts/onUpdate.mjs",
|
|
69
69
|
"title": "physics-2d",
|
|
70
|
-
"publishedVersion": "2026-09-
|
|
70
|
+
"publishedVersion": "2026-09-22T19:38:31.981Z",
|
|
71
71
|
"imports": {
|
|
72
72
|
"castle.base": {
|
|
73
73
|
"deckId": "yRcmH4_aYllE",
|
|
74
|
-
"version": "2026-09-
|
|
74
|
+
"version": "2026-09-22T19:37:37.345Z"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -1092,7 +1092,7 @@ function setSceneEditorSettings(sceneData, nextEditor) {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
function darkenSceneBackground(background) {
|
|
1094
1094
|
const parsed = parseHexColor(background ?? '#121213');
|
|
1095
|
-
if (!parsed) return 'var(--
|
|
1095
|
+
if (!parsed) return 'var(--kit-stage-workspace-bg)';
|
|
1096
1096
|
const amount = 0.42;
|
|
1097
1097
|
const darken = (channel) => Math.max(0, Math.round(channel * (1 - amount)));
|
|
1098
1098
|
return `rgb(${darken(parsed.r)}, ${darken(parsed.g)}, ${darken(parsed.b)})`;
|
|
@@ -1914,7 +1914,7 @@ function inspectorActionStyle(disabled) {
|
|
|
1914
1914
|
padding: '6px 10px',
|
|
1915
1915
|
background: 'transparent',
|
|
1916
1916
|
color: 'inherit',
|
|
1917
|
-
border: '1px solid var(--castle-
|
|
1917
|
+
border: '1px solid var(--castle-border-1)',
|
|
1918
1918
|
borderRadius: 6,
|
|
1919
1919
|
cursor: disabled ? 'default' : 'pointer',
|
|
1920
1920
|
opacity: disabled ? 0.5 : 1,
|
|
@@ -2397,7 +2397,7 @@ function BehaviorRow({
|
|
|
2397
2397
|
className={cx(styles.behaviorRow, isDragging && styles.behaviorRowDragging)}
|
|
2398
2398
|
style={{
|
|
2399
2399
|
...rowProps.style,
|
|
2400
|
-
borderBottom: isLast ? undefined : '1px solid var(--castle-
|
|
2400
|
+
borderBottom: isLast ? undefined : '1px solid var(--castle-border-1)',
|
|
2401
2401
|
}}>
|
|
2402
2402
|
<BehaviorPanel
|
|
2403
2403
|
summary={behaviorSummary(Behavior, component)}
|
|
@@ -2434,11 +2434,11 @@ function AddBehaviorPicker({ available, onAdd }) {
|
|
|
2434
2434
|
return (
|
|
2435
2435
|
<div
|
|
2436
2436
|
style={{
|
|
2437
|
-
height: 'var(--
|
|
2437
|
+
height: 'var(--kit-hotbar-row-full)',
|
|
2438
2438
|
padding: '0 16px',
|
|
2439
2439
|
display: 'flex',
|
|
2440
2440
|
alignItems: 'center',
|
|
2441
|
-
borderBottom: '1px solid var(--castle-
|
|
2441
|
+
borderBottom: '1px solid var(--castle-border-1)',
|
|
2442
2442
|
}}>
|
|
2443
2443
|
<select
|
|
2444
2444
|
className={cx(fieldStyles.input, fieldStyles.select)}
|