@onlyworlds/sdk 4.146.0 → 4.148.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/AGENTS.md +1 -1
- package/CHANGELOG.md +17 -0
- package/SCHEMA.md +1 -1
- package/dist/{chunk-CV2C2PIW.js → chunk-GWJ3SOZQ.js} +116 -0
- package/dist/index.d.ts +90 -13
- package/dist/index.js +135 -59
- package/dist/waymark.js +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# For AI agents using @onlyworlds/sdk
|
|
2
2
|
|
|
3
|
-
**Current as of**: SDK **4.x** · schema-dist **v0.34.0-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.34.0-dist.113** (canonical 00.34.00).
|
|
4
4
|
This line is asserted by `codegen:check` in CI — if the pin moves and this file is not
|
|
5
5
|
re-read against it, the check fails rather than letting this document rot quietly.
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.148.0] - 2026-11-10
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **A file on an element can be an image**: `OwFileKind` gains `png`, `jpg`, `webp` and `avif`, and `FILE_EXTENSIONS` (so `fileKindOf`, `createFileTicket` and `uploadFile`) reads `.png`, `.jpg`, `.jpeg` (kind `jpg`), `.webp` and `.avif`, as onlyworlds.com now takes them. `uploadFile(type, id, file)` with `screen.png` sends instead of refusing before the request. An image file is private to the element's readers like every file, and is not the element's picture (`image_url`). `.svg` and `.gif` are still refused before sending.
|
|
13
|
+
|
|
14
|
+
## [4.147.0] - 2026-11-10
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`viewOf(element)` and `VIEWS`: how an element is shown by its kind**, from the distribution's new `views.json` (presentation, not the standard). `viewOf` returns the row that matches (a profile's pair with its mark, by that profile's own reader, then a type with a supertype, then a type alone; types and supertypes trimmed and folded as the room profile defines), the one sentence for a card, a list row or a hover (the first field the row names whose value is a string with something in it, trimmed, cut at its first line break, trimmed again), and the marks to show at the head of its page, in order (`known_of` and `hidden` when true, `x_served_trimmed` when it names a field, the review marks when an object with something in it, then the row's own). An element no row matches has no row and draws as its type; the banners still show. Today's rows: a report, a charter, a message and a line in a room. `VIEWS` is the table baked at this release, frozen; codegen refuses a row column this reader does not read, a pair its profile's reader does not match, a field its type lacks, an unknown layout and two rows holding one kind. The fixture's 28 cases are replayed.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- **Schema repinned to schema-dist v0.34.0-dist.113** (from dist.112; same canonical 00.34.00, no schema file moved): `views.json` and `views.fixture.json` new; the room profile says its pairs' order carries no meaning (no pair moved); two examples reworded. The room and checks fixtures are replayed unchanged.
|
|
23
|
+
- `lensesInUse`'s notes say what a null membership means, in the lens profile's words since serial 112: there is no membership (a folder world), and then the Character's `x_lens_uses` is read. Behaviour unchanged.
|
|
24
|
+
|
|
8
25
|
## [4.146.0] - 2026-11-10
|
|
9
26
|
|
|
10
27
|
### Changed
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.0-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.0-dist.113** — canonical schema **00.34.00**, published 2026-11-10.
|
|
4
4
|
|
|
5
5
|
GENERATED from the canonical schema YAML — do not hand-edit (regenerate: `python codegen/generate_types.py`).
|
|
6
6
|
Written for both humans and AI agents reading this package locally.
|
|
@@ -336,6 +336,120 @@ var CHARTER_PAIRS = [
|
|
|
336
336
|
{ type: "construct", supertype: "Guide", aid: "guide" },
|
|
337
337
|
{ type: "construct", supertype: "Domain", aid: "domain" }
|
|
338
338
|
];
|
|
339
|
+
var VIEWS_TABLE = {
|
|
340
|
+
"version": 1,
|
|
341
|
+
"banners": [
|
|
342
|
+
{
|
|
343
|
+
"mark": "known_of",
|
|
344
|
+
"defined_by": "onlyworlds.com, not the standard: a known-of stub, known_of: true (the API document, https://www.onlyworlds.com/api/v2/openapi.json)"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"mark": "hidden",
|
|
348
|
+
"defined_by": "onlyworlds.com, not the standard: hidden: true, served only to readers who still see the element (the API document, https://www.onlyworlds.com/api/v2/openapi.json)"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"mark": "x_review_proposed",
|
|
352
|
+
"defined_by": "profiles/review.md"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"mark": "x_review_checked",
|
|
356
|
+
"defined_by": "profiles/review.md"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"mark": "x_served_trimmed",
|
|
360
|
+
"defined_by": "onlyworlds.com, not the standard: ids the server left out of a list, the field named (the API document, https://www.onlyworlds.com/api/v2/openapi.json; profiles/message.md reads it)"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
"layouts": {
|
|
364
|
+
"document": "the fields in the row's order: lead open, then the rest in the standard's sections, then fold; a kind with no row is a document",
|
|
365
|
+
"conversation": "the element within its chain by the named link, oldest first by created_at, stopping at an id already visited"
|
|
366
|
+
},
|
|
367
|
+
"rows": [
|
|
368
|
+
{
|
|
369
|
+
"id": "report",
|
|
370
|
+
"kind": {
|
|
371
|
+
"profile": "room",
|
|
372
|
+
"pair": "narrative/Report"
|
|
373
|
+
},
|
|
374
|
+
"from": "profiles/report.md (serial 112)",
|
|
375
|
+
"sentence": [
|
|
376
|
+
"description",
|
|
377
|
+
"story"
|
|
378
|
+
],
|
|
379
|
+
"lead": [
|
|
380
|
+
"description",
|
|
381
|
+
"consequences"
|
|
382
|
+
],
|
|
383
|
+
"fold": [
|
|
384
|
+
{
|
|
385
|
+
"field": "story",
|
|
386
|
+
"label": "The full report"
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"layout": {
|
|
390
|
+
"name": "document"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"id": "charter",
|
|
395
|
+
"kind": {
|
|
396
|
+
"profile": "charter",
|
|
397
|
+
"pair": "law/Charter"
|
|
398
|
+
},
|
|
399
|
+
"from": "profiles/charter.md",
|
|
400
|
+
"sentence": [
|
|
401
|
+
"description"
|
|
402
|
+
],
|
|
403
|
+
"lead": [
|
|
404
|
+
"description"
|
|
405
|
+
],
|
|
406
|
+
"layout": {
|
|
407
|
+
"name": "document"
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"id": "message",
|
|
412
|
+
"kind": {
|
|
413
|
+
"type": "narrative",
|
|
414
|
+
"supertype": "Message"
|
|
415
|
+
},
|
|
416
|
+
"from": "profiles/message.md",
|
|
417
|
+
"sentence": [
|
|
418
|
+
"description",
|
|
419
|
+
"story"
|
|
420
|
+
],
|
|
421
|
+
"lead": [
|
|
422
|
+
"story"
|
|
423
|
+
],
|
|
424
|
+
"layout": {
|
|
425
|
+
"name": "conversation",
|
|
426
|
+
"by": "parent_narrative"
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"id": "room-line",
|
|
431
|
+
"kind": {
|
|
432
|
+
"profile": "room",
|
|
433
|
+
"pair": "narrative/Message"
|
|
434
|
+
},
|
|
435
|
+
"from": "profiles/room.md, profiles/message.md",
|
|
436
|
+
"sentence": [
|
|
437
|
+
"description",
|
|
438
|
+
"story"
|
|
439
|
+
],
|
|
440
|
+
"lead": [
|
|
441
|
+
"story"
|
|
442
|
+
],
|
|
443
|
+
"layout": {
|
|
444
|
+
"name": "conversation",
|
|
445
|
+
"by": "parent_narrative"
|
|
446
|
+
},
|
|
447
|
+
"banner": [
|
|
448
|
+
"x_room_of"
|
|
449
|
+
]
|
|
450
|
+
}
|
|
451
|
+
]
|
|
452
|
+
};
|
|
339
453
|
var REVIEW_PROPOSED_LABEL = "proposed, not yet reviewed";
|
|
340
454
|
var MESSAGE_PAIR = { type: "narrative", supertype: "Message" };
|
|
341
455
|
var MESSAGE_READ_MARK = {
|
|
@@ -1568,6 +1682,7 @@ export {
|
|
|
1568
1682
|
DRAG_PAIRS,
|
|
1569
1683
|
ROOM_PAIRS,
|
|
1570
1684
|
CHARTER_PAIRS,
|
|
1685
|
+
VIEWS_TABLE,
|
|
1571
1686
|
REVIEW_PROPOSED_LABEL,
|
|
1572
1687
|
MESSAGE_PAIR,
|
|
1573
1688
|
MESSAGE_READ_MARK,
|
|
@@ -1580,6 +1695,7 @@ export {
|
|
|
1580
1695
|
simpleCaseFold,
|
|
1581
1696
|
trimWhiteSpace,
|
|
1582
1697
|
fold,
|
|
1698
|
+
hasMark,
|
|
1583
1699
|
isRoomElement,
|
|
1584
1700
|
READING_AID_KEYS,
|
|
1585
1701
|
readingAidKey,
|
package/dist/index.d.ts
CHANGED
|
@@ -128,6 +128,50 @@ declare const CHARTER_PAIRS: ReadonlyArray<{
|
|
|
128
128
|
readonly supertype: string;
|
|
129
129
|
readonly aid: 'charter' | 'guide' | 'domain';
|
|
130
130
|
}>;
|
|
131
|
+
/** A row of views.json: how elements of one kind are shown. */
|
|
132
|
+
interface OwViewRow {
|
|
133
|
+
/** The row's own name, distinct in the table. */
|
|
134
|
+
readonly id: string;
|
|
135
|
+
/** What the row matches: a type, a type with a supertype, or a profile's pair (`type/Supertype`), which
|
|
136
|
+
* matches only with that profile's mark, by its own reader (room: isRoomElement; charter: isCharterElement). */
|
|
137
|
+
readonly kind: {
|
|
138
|
+
readonly type: string;
|
|
139
|
+
readonly supertype?: string;
|
|
140
|
+
} | {
|
|
141
|
+
readonly profile: string;
|
|
142
|
+
readonly pair: string;
|
|
143
|
+
};
|
|
144
|
+
/** The page that defines the kind. */
|
|
145
|
+
readonly from: string;
|
|
146
|
+
/** The fields that give the one sentence, the first that holds something winning. */
|
|
147
|
+
readonly sentence?: readonly string[];
|
|
148
|
+
/** The fields shown open first, in order. */
|
|
149
|
+
readonly lead?: readonly string[];
|
|
150
|
+
/** The fields shown folded, each under its label. */
|
|
151
|
+
readonly fold?: readonly {
|
|
152
|
+
readonly field: string;
|
|
153
|
+
readonly label: string;
|
|
154
|
+
}[];
|
|
155
|
+
/** The layout, one of the table's `layouts`; `by` the link a conversation follows. */
|
|
156
|
+
readonly layout: {
|
|
157
|
+
readonly name: string;
|
|
158
|
+
readonly by?: string;
|
|
159
|
+
};
|
|
160
|
+
/** Marks this kind's page shows at its head after the table's own banners. */
|
|
161
|
+
readonly banner?: readonly string[];
|
|
162
|
+
}
|
|
163
|
+
/** views.json without its `_meta`: the banners every page shows, the layouts, the rows. */
|
|
164
|
+
interface OwViewsTable {
|
|
165
|
+
readonly version: 1;
|
|
166
|
+
readonly banners: readonly {
|
|
167
|
+
readonly mark: string;
|
|
168
|
+
readonly defined_by: string;
|
|
169
|
+
}[];
|
|
170
|
+
readonly layouts: {
|
|
171
|
+
readonly [name: string]: string;
|
|
172
|
+
};
|
|
173
|
+
readonly rows: readonly OwViewRow[];
|
|
174
|
+
}
|
|
131
175
|
/** The review profile's label (schema-dist `profiles/review.md`, rule 1): the words a reader that
|
|
132
176
|
* hands a world on (a context for an AI, a pack, a share) puts on each proposed element it keeps,
|
|
133
177
|
* one whose `x_review_proposed` is present (a doubt, rule 4, included; an empty mark is settled).
|
|
@@ -2215,10 +2259,12 @@ declare function isLens(element: object | null | undefined): boolean;
|
|
|
2215
2259
|
*/
|
|
2216
2260
|
declare function isTemplate(element: object | null | undefined): boolean;
|
|
2217
2261
|
/**
|
|
2218
|
-
* The lenses a seat reads, by id: its membership's choice
|
|
2219
|
-
*
|
|
2220
|
-
*
|
|
2221
|
-
*
|
|
2262
|
+
* The lenses a seat reads, by id: its membership's choice (a list, an empty list included: a membership
|
|
2263
|
+
* that chose no lenses has made a choice), or, when `membership` is null, its Character's `x_lens_uses`.
|
|
2264
|
+
* Null means there is no membership, as in a folder world. A membership that exists and never chose is
|
|
2265
|
+
* not this reading's case: onlyworlds.com gives that seat its Titles' lenses and never reads
|
|
2266
|
+
* `x_lens_uses`. Never both: the membership wins. Strings only, each once, in the order given; anything
|
|
2267
|
+
* that is not a list is no choice.
|
|
2222
2268
|
*/
|
|
2223
2269
|
declare function lensesInUse(membership: readonly string[] | null | undefined, xLensUses: unknown): string[];
|
|
2224
2270
|
/**
|
|
@@ -3839,12 +3885,14 @@ interface OwUploadedImage {
|
|
|
3839
3885
|
[k: string]: unknown;
|
|
3840
3886
|
}
|
|
3841
3887
|
/**
|
|
3842
|
-
* What a file on an element can be
|
|
3843
|
-
* `
|
|
3844
|
-
* against the file's first bytes. A file's name ends in its kind's
|
|
3845
|
-
* yaml and `.
|
|
3888
|
+
* What a file on an element can be: text (`txt`, `md`, `json`, `csv`, `yaml`, `toml`), `pdf`,
|
|
3889
|
+
* `zip` only as a world's own bundle, and an image (`png`, `jpg`, `webp`, `avif`; no svg or gif).
|
|
3890
|
+
* The upload host checks each against the file's first bytes. A file's name ends in its kind's
|
|
3891
|
+
* extension; `.yml` counts as yaml, `.markdown` as md and `.jpeg` as jpg. An image file is private
|
|
3892
|
+
* to the element's readers like any file and is served as a download, not as an element's
|
|
3893
|
+
* picture (that is `image_url`).
|
|
3846
3894
|
*/
|
|
3847
|
-
type OwFileKind = 'pdf' | 'txt' | 'md' | 'json' | 'csv' | 'yaml' | 'toml' | 'zip';
|
|
3895
|
+
type OwFileKind = 'pdf' | 'txt' | 'md' | 'json' | 'csv' | 'yaml' | 'toml' | 'zip' | 'png' | 'jpg' | 'webp' | 'avif';
|
|
3848
3896
|
/** Who added a file. */
|
|
3849
3897
|
interface OwFileAddedBy {
|
|
3850
3898
|
/** A member's or a seat's name; the owner's username for the owner's keys. */
|
|
@@ -5017,7 +5065,7 @@ declare class OwV2Client {
|
|
|
5017
5065
|
* (the ticket's file is already stored: an earlier send with this ticket succeeded, so the
|
|
5018
5066
|
* file is there), 413 `too_large`, 415 `unsupported_type` (the bytes are not the kind:
|
|
5019
5067
|
* a pdf must start as one, a text file must be UTF-8 with no NUL in its first 8 KB, a zip
|
|
5020
|
-
* must be a world's own bundle; nothing is stored and the ticket is still unspent), 502
|
|
5068
|
+
* must be a world's own bundle, an image must be the kind its first bytes say; nothing is stored and the ticket is still unspent), 502
|
|
5021
5069
|
* `write_failed` (nothing stored; the ticket is still unspent). A ticket is spent once the
|
|
5022
5070
|
* upload succeeds: another file needs a new one.
|
|
5023
5071
|
*/
|
|
@@ -5612,8 +5660,8 @@ declare class OwV2Client {
|
|
|
5612
5660
|
}): Promise<T>;
|
|
5613
5661
|
}
|
|
5614
5662
|
/**
|
|
5615
|
-
* Every extension a file on an element may end in, to the kind it gives
|
|
5616
|
-
*
|
|
5663
|
+
* Every extension a file on an element may end in, to the kind it gives, as onlyworlds.com reads
|
|
5664
|
+
* a name: `.yml`, `.markdown` and `.jpeg` included. A file picker's accept list is
|
|
5617
5665
|
* `Object.keys(FILE_EXTENSIONS).map((e) => '.' + e)`.
|
|
5618
5666
|
*/
|
|
5619
5667
|
declare const FILE_EXTENSIONS: Readonly<Record<string, OwFileKind>>;
|
|
@@ -6551,6 +6599,35 @@ interface OwDragField {
|
|
|
6551
6599
|
*/
|
|
6552
6600
|
declare function dragField(a: string, b: string): OwDragField | null;
|
|
6553
6601
|
|
|
6602
|
+
/** viewOf's answer for one element. */
|
|
6603
|
+
interface OwView {
|
|
6604
|
+
/** The row that shows it, the table's own (frozen) row; null when no row matches and the element draws as its type. */
|
|
6605
|
+
row: OwViewRow | null;
|
|
6606
|
+
/** The one sentence for a card, a list row or a hover; null when there is no row or no named field holds anything. */
|
|
6607
|
+
sentence: string | null;
|
|
6608
|
+
/** The marks to show at the head of its page, in order: the table's banners the element carries, then the row's own. */
|
|
6609
|
+
banners: string[];
|
|
6610
|
+
}
|
|
6611
|
+
/** views.json as baked at this release, without its `_meta`, frozen throughout. Read one element's view with viewOf. */
|
|
6612
|
+
declare const VIEWS: OwViewsTable;
|
|
6613
|
+
/**
|
|
6614
|
+
* How an element is shown, by the views table baked at this release (`views.json`): the row that matches
|
|
6615
|
+
* it, its one sentence, and the marks to show at the head of its page.
|
|
6616
|
+
*
|
|
6617
|
+
* A row matches by its kind: a profile's pair only with that profile's mark, by the profile's own reader;
|
|
6618
|
+
* a type with a supertype; a type alone; types and supertypes trimmed and folded as the room profile
|
|
6619
|
+
* defines. The most specific row wins. The sentence is the first field the row names in `sentence` that
|
|
6620
|
+
* holds text after trimming, cut at its first line break and trimmed. Pass the element as the reader is
|
|
6621
|
+
* served it: the banners read what was served (a known-of stub, the hidden mark, a trimmed list).
|
|
6622
|
+
*
|
|
6623
|
+
* ```ts
|
|
6624
|
+
* viewOf({ type: 'narrative', supertype: 'Message', story: 'See you at the gate.\nBring the map.' });
|
|
6625
|
+
* // { row: <the message row>, sentence: 'See you at the gate.', banners: [] }
|
|
6626
|
+
* viewOf({ type: 'character', name: 'Ilse' }); // { row: null, sentence: null, banners: [] }
|
|
6627
|
+
* ```
|
|
6628
|
+
*/
|
|
6629
|
+
declare function viewOf(element: unknown): OwView;
|
|
6630
|
+
|
|
6554
6631
|
/**
|
|
6555
6632
|
* The world file, `.owworld` (Folder Format spec §4.7; a `.zip` by another
|
|
6556
6633
|
* name): one archive holding one whole world as a portable copy (§4.1), and
|
|
@@ -7622,4 +7699,4 @@ declare class TokenResource {
|
|
|
7622
7699
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
7623
7700
|
}
|
|
7624
7701
|
|
|
7625
|
-
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, DATE_FIELD, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementGroup, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GROUP_COLORS, GROUP_ORDER, GameTier, type ListParams, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountToken, type OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAiAskAnswer, type OwAiAskBody, type OwAiMeter, type OwAiRefusal, type OwAiSortAnswer, type OwAiSortBody, type OwAiToken, type OwAiUse, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAskContextOptions, type OwAskLeftOut, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwCharterWorld, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDoor, type OwDragField, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwElementMark, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwGraphCutReason, type OwGraphEdge, type OwGraphMark, type OwGraphNode, type OwGraphOptions, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayoutOf, type OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMapSpace, type OwMapSpaceMap, type OwMapSpaceOutReason, type OwMapSpaceOutline, type OwMapSpacePin, type OwMapSpacePoint, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedAiToken, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwOpenersOptions, type OwPage, type OwPaidBy, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedMark, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwReadingAids, type OwReadingAidsCharter, type OwReadingAidsDomain, type OwReadingAidsGuide, type OwReadingAidsHub, type OwRecord, type OwRecordMark, type OwRecordStory, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, type OwServedReadingAids, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwStrand, type OwStrandSlot, type OwStrandWorld, type OwTool, type OwToolNeeds, type OwToolOpen, type OwTrailGround, type OwTrailHanger, type OwTrailInput, type OwTrailLayout, type OwTrailPin, type OwTrailPlace, type OwTrailSettings, type OwTrailSpiral, type OwTrailTier, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, type OwWorldKeyMember, type OwWorldKeyRow, type OwWorldLens, type OwWorldLensReading, type OwWorldLenses, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, type OwWriteWorldFileReport, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, TRAIL_TIERS, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, charterOf, dateOf, degreeOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
7702
|
+
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, DATE_FIELD, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementGroup, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GROUP_COLORS, GROUP_ORDER, GameTier, type ListParams, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountToken, type OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAiAskAnswer, type OwAiAskBody, type OwAiMeter, type OwAiRefusal, type OwAiSortAnswer, type OwAiSortBody, type OwAiToken, type OwAiUse, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAskContextOptions, type OwAskLeftOut, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwCharterWorld, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDoor, type OwDragField, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwElementMark, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwGraphCutReason, type OwGraphEdge, type OwGraphMark, type OwGraphNode, type OwGraphOptions, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayoutOf, type OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMapSpace, type OwMapSpaceMap, type OwMapSpaceOutReason, type OwMapSpaceOutline, type OwMapSpacePin, type OwMapSpacePoint, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedAiToken, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwOpenersOptions, type OwPage, type OwPaidBy, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedMark, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwReadingAids, type OwReadingAidsCharter, type OwReadingAidsDomain, type OwReadingAidsGuide, type OwReadingAidsHub, type OwRecord, type OwRecordMark, type OwRecordStory, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, type OwServedReadingAids, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwStrand, type OwStrandSlot, type OwStrandWorld, type OwTool, type OwToolNeeds, type OwToolOpen, type OwTrailGround, type OwTrailHanger, type OwTrailInput, type OwTrailLayout, type OwTrailPin, type OwTrailPlace, type OwTrailSettings, type OwTrailSpiral, type OwTrailTier, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwView, type OwViewRow, type OwViewsTable, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, type OwWorldKeyMember, type OwWorldKeyRow, type OwWorldLens, type OwWorldLensReading, type OwWorldLenses, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, type OwWriteWorldFileReport, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, TRAIL_TIERS, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, charterOf, dateOf, degreeOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -22,11 +22,13 @@ import {
|
|
|
22
22
|
ROOM_PAIRS,
|
|
23
23
|
SPATIAL_TYPES,
|
|
24
24
|
TOOLS,
|
|
25
|
+
VIEWS_TABLE,
|
|
25
26
|
doorWhere,
|
|
26
27
|
doorsOf,
|
|
27
28
|
elementAddress,
|
|
28
29
|
fold,
|
|
29
30
|
handsOnAsProposed,
|
|
31
|
+
hasMark,
|
|
30
32
|
isAgentDoor,
|
|
31
33
|
isCharterElement,
|
|
32
34
|
isHiddenMark,
|
|
@@ -42,7 +44,7 @@ import {
|
|
|
42
44
|
trimWhiteSpace,
|
|
43
45
|
typeWord,
|
|
44
46
|
unknownKey
|
|
45
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-GWJ3SOZQ.js";
|
|
46
48
|
|
|
47
49
|
// src/v2/keyed-id.ts
|
|
48
50
|
var KEYED_IDS = "0199b6a0-6f0e-7c2a-9d1e-3b5c7a8e4f21";
|
|
@@ -1426,7 +1428,7 @@ var OwV2Client = class {
|
|
|
1426
1428
|
* (the ticket's file is already stored: an earlier send with this ticket succeeded, so the
|
|
1427
1429
|
* file is there), 413 `too_large`, 415 `unsupported_type` (the bytes are not the kind:
|
|
1428
1430
|
* a pdf must start as one, a text file must be UTF-8 with no NUL in its first 8 KB, a zip
|
|
1429
|
-
* must be a world's own bundle; nothing is stored and the ticket is still unspent), 502
|
|
1431
|
+
* must be a world's own bundle, an image must be the kind its first bytes say; nothing is stored and the ticket is still unspent), 502
|
|
1430
1432
|
* `write_failed` (nothing stored; the ticket is still unspent). A ticket is spent once the
|
|
1431
1433
|
* upload succeeds: another file needs a new one.
|
|
1432
1434
|
*/
|
|
@@ -2508,7 +2510,12 @@ var FILE_EXTENSIONS = Object.freeze({
|
|
|
2508
2510
|
yaml: "yaml",
|
|
2509
2511
|
yml: "yaml",
|
|
2510
2512
|
toml: "toml",
|
|
2511
|
-
zip: "zip"
|
|
2513
|
+
zip: "zip",
|
|
2514
|
+
png: "png",
|
|
2515
|
+
jpg: "jpg",
|
|
2516
|
+
jpeg: "jpg",
|
|
2517
|
+
webp: "webp",
|
|
2518
|
+
avif: "avif"
|
|
2512
2519
|
});
|
|
2513
2520
|
function fileKindOf(name) {
|
|
2514
2521
|
const base = name.split(/[\\/]/).pop() ?? "";
|
|
@@ -4169,15 +4176,15 @@ function mapSpace(elements) {
|
|
|
4169
4176
|
const mapRows = [];
|
|
4170
4177
|
for (const mid of [...maps.keys()].sort(byId)) {
|
|
4171
4178
|
const mp = maps.get(mid);
|
|
4172
|
-
const
|
|
4173
|
-
for (const o of outlines) if (o.map === mid)
|
|
4174
|
-
for (const q of pins) if (q.map === mid)
|
|
4179
|
+
const own4 = [];
|
|
4180
|
+
for (const o of outlines) if (o.map === mid) own4.push(...o.points);
|
|
4181
|
+
for (const q of pins) if (q.map === mid) own4.push([q.x, q.y, q.z]);
|
|
4175
4182
|
let measured = false;
|
|
4176
4183
|
const slot = (key, i) => {
|
|
4177
4184
|
const v = mp[key];
|
|
4178
4185
|
if (whole3(v)) return v;
|
|
4179
4186
|
measured = true;
|
|
4180
|
-
return largest(
|
|
4187
|
+
return largest(own4, i);
|
|
4181
4188
|
};
|
|
4182
4189
|
const width = slot("width", 0);
|
|
4183
4190
|
const height = slot("height", 1);
|
|
@@ -4187,7 +4194,7 @@ function mapSpace(elements) {
|
|
|
4187
4194
|
width,
|
|
4188
4195
|
height,
|
|
4189
4196
|
depth: whole3(mp.depth) ? mp.depth : null,
|
|
4190
|
-
z_max: largest(
|
|
4197
|
+
z_max: largest(own4, 2),
|
|
4191
4198
|
scale: typeof sc === "number" && sc > 0 ? sc : null,
|
|
4192
4199
|
location: idOf2(mp.location),
|
|
4193
4200
|
parent_map: idOf2(mp.parent_map)
|
|
@@ -4446,6 +4453,73 @@ function dragField(a, b) {
|
|
|
4446
4453
|
return { on: row.on, field: row.field, holds: row.holds };
|
|
4447
4454
|
}
|
|
4448
4455
|
|
|
4456
|
+
// src/views.ts
|
|
4457
|
+
function deepFreeze(value) {
|
|
4458
|
+
if (value !== null && typeof value === "object") {
|
|
4459
|
+
for (const v of Object.values(value)) deepFreeze(v);
|
|
4460
|
+
Object.freeze(value);
|
|
4461
|
+
}
|
|
4462
|
+
return value;
|
|
4463
|
+
}
|
|
4464
|
+
var VIEWS = /* @__PURE__ */ deepFreeze(VIEWS_TABLE);
|
|
4465
|
+
var own2 = (el, key) => Object.prototype.hasOwnProperty.call(el, key) ? el[key] : void 0;
|
|
4466
|
+
var PROFILE_READERS = {
|
|
4467
|
+
room: (el) => isRoomElement(el),
|
|
4468
|
+
charter: (el) => isCharterElement(el)
|
|
4469
|
+
};
|
|
4470
|
+
function score(row, el) {
|
|
4471
|
+
const type = own2(el, "type");
|
|
4472
|
+
if (typeof type !== "string") return 0;
|
|
4473
|
+
const supertype = own2(el, "supertype");
|
|
4474
|
+
const sameSupertype = (want) => typeof supertype === "string" && fold(supertype) === fold(want);
|
|
4475
|
+
const kind = row.kind;
|
|
4476
|
+
if ("profile" in kind) {
|
|
4477
|
+
const slash = kind.pair.indexOf("/");
|
|
4478
|
+
const reader = PROFILE_READERS[kind.profile];
|
|
4479
|
+
if (!reader || fold(type) !== fold(kind.pair.slice(0, slash)) || !sameSupertype(kind.pair.slice(slash + 1))) return 0;
|
|
4480
|
+
return reader(el) ? 3 : 0;
|
|
4481
|
+
}
|
|
4482
|
+
if (fold(type) !== fold(kind.type)) return 0;
|
|
4483
|
+
if (kind.supertype === void 0) return 1;
|
|
4484
|
+
return sameSupertype(kind.supertype) ? 2 : 0;
|
|
4485
|
+
}
|
|
4486
|
+
function carries2(el, mark) {
|
|
4487
|
+
const v = own2(el, mark);
|
|
4488
|
+
if (mark === "hidden" || mark === "known_of") return v === true;
|
|
4489
|
+
if (mark === "x_served_trimmed") return Array.isArray(v) && v.length > 0;
|
|
4490
|
+
if (mark === "x_review_proposed" || mark === "x_review_checked") {
|
|
4491
|
+
return v !== null && typeof v === "object" && !Array.isArray(v) && Object.keys(v).length > 0;
|
|
4492
|
+
}
|
|
4493
|
+
return hasMark(el, mark);
|
|
4494
|
+
}
|
|
4495
|
+
function viewOf(element) {
|
|
4496
|
+
if (element === null || typeof element !== "object" || Array.isArray(element)) return { row: null, sentence: null, banners: [] };
|
|
4497
|
+
const el = element;
|
|
4498
|
+
let row = null;
|
|
4499
|
+
let best = 0;
|
|
4500
|
+
for (const r of VIEWS.rows) {
|
|
4501
|
+
const s = score(r, el);
|
|
4502
|
+
if (s > best) {
|
|
4503
|
+
best = s;
|
|
4504
|
+
row = r;
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
const banners = VIEWS.banners.map((b) => b.mark).filter((m) => carries2(el, m));
|
|
4508
|
+
if (!row) return { row: null, sentence: null, banners };
|
|
4509
|
+
for (const m of row.banner ?? []) if (carries2(el, m)) banners.push(m);
|
|
4510
|
+
let sentence = null;
|
|
4511
|
+
for (const f of row.sentence ?? []) {
|
|
4512
|
+
const v = own2(el, f);
|
|
4513
|
+
if (typeof v !== "string") continue;
|
|
4514
|
+
const text2 = trimWhiteSpace(v);
|
|
4515
|
+
if (text2 === "") continue;
|
|
4516
|
+
const cut2 = text2.search(/[\n\r]/);
|
|
4517
|
+
sentence = trimWhiteSpace(cut2 < 0 ? text2 : text2.slice(0, cut2));
|
|
4518
|
+
break;
|
|
4519
|
+
}
|
|
4520
|
+
return { row, sentence, banners };
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4449
4523
|
// src/world-file.ts
|
|
4450
4524
|
import { Inflate, inflateSync, zipSync } from "fflate";
|
|
4451
4525
|
|
|
@@ -5392,11 +5466,11 @@ function lookupWorld(index, question, opts = {}) {
|
|
|
5392
5466
|
const q = words(normalize(question));
|
|
5393
5467
|
const qSet = new Set(q);
|
|
5394
5468
|
const cand = /* @__PURE__ */ new Map();
|
|
5395
|
-
const bump = (id,
|
|
5469
|
+
const bump = (id, score2, reason, direct) => {
|
|
5396
5470
|
const c = cand.get(id) || { score: 0, direct: 0, reasons: [] };
|
|
5397
5471
|
c.reasons.push(reason);
|
|
5398
|
-
if (
|
|
5399
|
-
if (direct &&
|
|
5472
|
+
if (score2 > c.score) c.score = score2;
|
|
5473
|
+
if (direct && score2 > c.direct) c.direct = score2;
|
|
5400
5474
|
cand.set(id, c);
|
|
5401
5475
|
};
|
|
5402
5476
|
const qUsed = /* @__PURE__ */ new Map();
|
|
@@ -5432,9 +5506,9 @@ function lookupWorld(index, question, opts = {}) {
|
|
|
5432
5506
|
const nw = index.nameWords.get(id) || [];
|
|
5433
5507
|
const tot = nw.reduce((s, w) => s + index.idf.get(w), 0) || 1;
|
|
5434
5508
|
const got = [...ws].reduce((s, w) => s + index.idf.get(w), 0);
|
|
5435
|
-
const
|
|
5509
|
+
const score2 = 20 + 40 * (got / tot);
|
|
5436
5510
|
const c = cand.get(id);
|
|
5437
|
-
if (!c || c.direct <
|
|
5511
|
+
if (!c || c.direct < score2) bump(id, score2, { kind: "word", text: [...ws].join(" ") }, true);
|
|
5438
5512
|
}
|
|
5439
5513
|
const kindBonus = (id) => {
|
|
5440
5514
|
const el = index.byId.get(id);
|
|
@@ -5667,7 +5741,7 @@ var UNPRINTED = /* @__PURE__ */ new Set([
|
|
|
5667
5741
|
var UNPRINTED_PREFIXES = ["x_", "atlas_", "shadow_"];
|
|
5668
5742
|
var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
5669
5743
|
var isInt = (v) => typeof v === "number" && Number.isInteger(v);
|
|
5670
|
-
var
|
|
5744
|
+
var own3 = (o, k) => Object.prototype.hasOwnProperty.call(o, k) ? o[k] : void 0;
|
|
5671
5745
|
function isSet(v) {
|
|
5672
5746
|
if (v === null || v === void 0 || v === "") return false;
|
|
5673
5747
|
if (Array.isArray(v)) return v.length > 0;
|
|
@@ -5687,21 +5761,21 @@ function fieldsOf(t) {
|
|
|
5687
5761
|
return typeof t === "string" && Object.prototype.hasOwnProperty.call(FIELD_SCHEMA, t) ? FIELD_SCHEMA[t] : {};
|
|
5688
5762
|
}
|
|
5689
5763
|
function isLinkField(t, field) {
|
|
5690
|
-
const info =
|
|
5764
|
+
const info = own3(fieldsOf(t), field);
|
|
5691
5765
|
return isObj(info) && (info.type === "single_link" || info.type === "multi_link");
|
|
5692
5766
|
}
|
|
5693
|
-
var isDatedType = (t) =>
|
|
5767
|
+
var isDatedType = (t) => own3(fieldsOf(t), "start_date") !== void 0;
|
|
5694
5768
|
function kindOf(el) {
|
|
5695
|
-
const sup = text(
|
|
5696
|
-
const sub = text(
|
|
5769
|
+
const sup = text(own3(el, "supertype"));
|
|
5770
|
+
const sub = text(own3(el, "subtype"));
|
|
5697
5771
|
if (sup !== null && sub !== null) return `${sup} / ${sub}`;
|
|
5698
5772
|
return sup ?? sub;
|
|
5699
5773
|
}
|
|
5700
5774
|
function marks(el) {
|
|
5701
|
-
return (
|
|
5775
|
+
return (own3(el, "hidden") === true ? " \xB7 hidden" : "") + (handsOnAsProposed(el) ? " \xB7 proposed" : "");
|
|
5702
5776
|
}
|
|
5703
5777
|
function descriptionLines(el) {
|
|
5704
|
-
const d = text(
|
|
5778
|
+
const d = text(own3(el, "description"));
|
|
5705
5779
|
return d === null ? [] : d.split("\n").map((l) => ` ${l}`);
|
|
5706
5780
|
}
|
|
5707
5781
|
function rowsOf(key, v) {
|
|
@@ -5715,35 +5789,35 @@ function rowsOf(key, v) {
|
|
|
5715
5789
|
function draughtText(draught) {
|
|
5716
5790
|
const d = draught;
|
|
5717
5791
|
if (!isObj(d)) throw new TypeError("draughtText: the draught is an object, as draught() returns it.");
|
|
5718
|
-
const world =
|
|
5792
|
+
const world = own3(d, "world");
|
|
5719
5793
|
if (!isObj(world)) throw new TypeError("draughtText: the draught has no world object.");
|
|
5720
5794
|
const names = /* @__PURE__ */ new Map();
|
|
5721
5795
|
const hold = (el) => {
|
|
5722
5796
|
if (!isObj(el)) return;
|
|
5723
|
-
const id =
|
|
5724
|
-
if (typeof id === "string" && !names.has(id)) names.set(id, text(
|
|
5797
|
+
const id = own3(el, "id");
|
|
5798
|
+
if (typeof id === "string" && !names.has(id)) names.set(id, text(own3(el, "name")) ?? "(unnamed)");
|
|
5725
5799
|
};
|
|
5726
5800
|
const asked = Object.prototype.hasOwnProperty.call(d, "character");
|
|
5727
|
-
const character =
|
|
5728
|
-
const her = isObj(character) && isObj(
|
|
5801
|
+
const character = own3(d, "character");
|
|
5802
|
+
const her = isObj(character) && isObj(own3(character, "element")) ? own3(character, "element") : null;
|
|
5729
5803
|
hold(her);
|
|
5730
5804
|
for (const key of ELEMENT_SECTIONS2) {
|
|
5731
|
-
for (const row of rowsOf(key,
|
|
5805
|
+
for (const row of rowsOf(key, own3(d, key))) if (isObj(row)) hold(own3(row, "element"));
|
|
5732
5806
|
}
|
|
5733
|
-
const calendar =
|
|
5734
|
-
const unit = isObj(calendar) ? text(
|
|
5807
|
+
const calendar = own3(d, "calendar");
|
|
5808
|
+
const unit = isObj(calendar) ? text(own3(calendar, "time_basic_unit")) : null;
|
|
5735
5809
|
const moment = (n) => unit === null ? BigInt(n).toString() : `${unit} ${BigInt(n).toString()}`;
|
|
5736
|
-
const herName = her === null ? "the Character" : text(
|
|
5810
|
+
const herName = her === null ? "the Character" : text(own3(her, "name")) ?? "(unnamed)";
|
|
5737
5811
|
const out = [];
|
|
5738
5812
|
const put = (line, cont = " ") => {
|
|
5739
5813
|
const [first, ...rest] = line.replace(/\r\n/g, "\n").replace(/\r/g, "\n").split("\n");
|
|
5740
5814
|
out.push(first, ...rest.map((l) => cont + l));
|
|
5741
5815
|
};
|
|
5742
|
-
put(`# ${herName}, in ${text(
|
|
5743
|
-
const asOf =
|
|
5744
|
-
const now =
|
|
5745
|
-
const mode =
|
|
5746
|
-
const public_ =
|
|
5816
|
+
put(`# ${herName}, in ${text(own3(world, "name")) ?? "(unnamed)"}`);
|
|
5817
|
+
const asOf = own3(d, "as_of");
|
|
5818
|
+
const now = own3(d, "now");
|
|
5819
|
+
const mode = own3(d, "mode");
|
|
5820
|
+
const public_ = own3(d, "reader") === "public";
|
|
5747
5821
|
put(
|
|
5748
5822
|
`What the record holds around ${herName}` + (isInt(asOf) ? `, dated up to ${moment(asOf)}` : "") + (isInt(now) ? ` (the world's now: ${moment(now)})` : "") + "." + (public_ ? " Read as the public reader." : mode === "voice" ? " Read as the Character's own view." : mode === "act" ? " Read as the caller's view." : "")
|
|
5749
5823
|
);
|
|
@@ -5754,7 +5828,7 @@ function draughtText(draught) {
|
|
|
5754
5828
|
if (asked && her === null) {
|
|
5755
5829
|
out.push("Hidden from this reader.");
|
|
5756
5830
|
} else if (her !== null) {
|
|
5757
|
-
const type =
|
|
5831
|
+
const type = own3(her, "type");
|
|
5758
5832
|
const kind = kindOf(her);
|
|
5759
5833
|
put(typeWordOf(type) + (kind === null ? "" : ` \xB7 ${kind}`) + marks(her));
|
|
5760
5834
|
for (const l of descriptionLines(her)) put(l);
|
|
@@ -5783,54 +5857,54 @@ function draughtText(draught) {
|
|
|
5783
5857
|
if (value !== null) put(` ${key.replace(/_/g, " ")}: ${value}`, " ");
|
|
5784
5858
|
}
|
|
5785
5859
|
}
|
|
5786
|
-
const roster =
|
|
5860
|
+
const roster = own3(d, "roster");
|
|
5787
5861
|
const memberName = (id) => {
|
|
5788
5862
|
if (!Array.isArray(roster) || typeof id !== "string") return null;
|
|
5789
|
-
for (const r of roster) if (isObj(r) &&
|
|
5863
|
+
for (const r of roster) if (isObj(r) && own3(r, "id") === id) return text(own3(r, "name"));
|
|
5790
5864
|
return null;
|
|
5791
5865
|
};
|
|
5792
5866
|
const elementRow = (row) => {
|
|
5793
|
-
const el = isObj(
|
|
5794
|
-
const type =
|
|
5867
|
+
const el = isObj(own3(row, "element")) ? own3(row, "element") : {};
|
|
5868
|
+
const type = own3(el, "type");
|
|
5795
5869
|
const kind = kindOf(el);
|
|
5796
|
-
let line = `- ${text(
|
|
5797
|
-
const viaRaw =
|
|
5870
|
+
let line = `- ${text(own3(el, "name")) ?? "(unnamed)"} (${typeWordOf(type)}${kind === null ? "" : ` \xB7 ${kind}`})`;
|
|
5871
|
+
const viaRaw = own3(row, "via");
|
|
5798
5872
|
const via = (Array.isArray(viaRaw) ? viaRaw : []).map(text).filter((f) => f !== null);
|
|
5799
5873
|
if (via.length) line += ` \xB7 via ${via.map((f) => f.replace(/_/g, " ")).join(", ")}`;
|
|
5800
|
-
const start =
|
|
5801
|
-
if (
|
|
5874
|
+
const start = own3(el, "start_date");
|
|
5875
|
+
if (own3(row, "grade") === "known_of") line += " \xB7 known of";
|
|
5802
5876
|
else if (isInt(start)) line += ` \xB7 ${moment(start)}`;
|
|
5803
5877
|
else if (isDatedType(type)) line += " \xB7 undated";
|
|
5804
5878
|
line += marks(el);
|
|
5805
5879
|
return [line, ...descriptionLines(el)];
|
|
5806
5880
|
};
|
|
5807
5881
|
const recentRow = (row) => {
|
|
5808
|
-
const op =
|
|
5882
|
+
const op = own3(row, "op");
|
|
5809
5883
|
const verb = op === "upsert" ? "changed" : op === "delete" ? "deleted" : text(op) ?? "";
|
|
5810
|
-
const id =
|
|
5884
|
+
const id = own3(row, "id");
|
|
5811
5885
|
const target = (typeof id === "string" ? names.get(id) : void 0) ?? text(id) ?? "";
|
|
5812
|
-
const who =
|
|
5886
|
+
const who = own3(row, "who");
|
|
5813
5887
|
const writer = !isSet(who) ? "an unrecorded writer" : who === "owner" ? "the owner" : memberName(who) ?? "a member";
|
|
5814
|
-
const when = text(
|
|
5815
|
-
const door = text(
|
|
5816
|
-
return `- ${when === null ? "" : `${when} \xB7 `}${verb} ${typeWordOf(
|
|
5888
|
+
const when = text(own3(row, "when"));
|
|
5889
|
+
const door = text(own3(row, "door"));
|
|
5890
|
+
return `- ${when === null ? "" : `${when} \xB7 `}${verb} ${typeWordOf(own3(row, "type"))} ${target} \xB7 by ${writer}` + (door === null ? "" : ` \xB7 through ${door}`);
|
|
5817
5891
|
};
|
|
5818
5892
|
const memberRow = (row) => {
|
|
5819
|
-
let line = `- ${text(
|
|
5820
|
-
const name = text(
|
|
5893
|
+
let line = `- ${text(own3(row, "role")) ?? ""}`;
|
|
5894
|
+
const name = text(own3(row, "name"));
|
|
5821
5895
|
if (name !== null) line += ` \xB7 ${name}`;
|
|
5822
|
-
const plays =
|
|
5896
|
+
const plays = own3(row, "character");
|
|
5823
5897
|
if (isSet(plays)) {
|
|
5824
5898
|
const n = typeof plays === "string" ? names.get(plays) : void 0;
|
|
5825
5899
|
line += n === void 0 ? " \xB7 plays a Character not in this draught" : ` \xB7 plays ${n}`;
|
|
5826
5900
|
}
|
|
5827
|
-
if (
|
|
5901
|
+
if (own3(row, "status") === "removed") line += " \xB7 removed from the world";
|
|
5828
5902
|
return line;
|
|
5829
5903
|
};
|
|
5830
|
-
const recentMore =
|
|
5831
|
-
const sectionSet = (key) => isSet(
|
|
5904
|
+
const recentMore = own3(d, "recent_more") === true;
|
|
5905
|
+
const sectionSet = (key) => isSet(own3(d, key)) || key === "recent" && recentMore;
|
|
5832
5906
|
for (const [key, heading] of SECTIONS) {
|
|
5833
|
-
const v =
|
|
5907
|
+
const v = own3(d, key);
|
|
5834
5908
|
if (!sectionSet(key)) continue;
|
|
5835
5909
|
out.push("", `## ${heading}`);
|
|
5836
5910
|
for (const row of rowsOf(key, v)) {
|
|
@@ -5841,8 +5915,8 @@ function draughtText(draught) {
|
|
|
5841
5915
|
}
|
|
5842
5916
|
if (key === "recent" && recentMore) out.push("More changes than these; read on from recent_cursor.");
|
|
5843
5917
|
}
|
|
5844
|
-
const policy =
|
|
5845
|
-
const components = isObj(policy) ?
|
|
5918
|
+
const policy = own3(d, "policy");
|
|
5919
|
+
const components = isObj(policy) ? own3(policy, "components") : void 0;
|
|
5846
5920
|
if (Array.isArray(components)) {
|
|
5847
5921
|
const empty = components.filter((c) => typeof c === "string" && c !== "self" && !sectionSet(c));
|
|
5848
5922
|
if (empty.length) {
|
|
@@ -5850,7 +5924,7 @@ function draughtText(draught) {
|
|
|
5850
5924
|
put(`Nothing in: ${empty.join(", ")}.`);
|
|
5851
5925
|
}
|
|
5852
5926
|
}
|
|
5853
|
-
const cut2 =
|
|
5927
|
+
const cut2 = own3(d, "cut");
|
|
5854
5928
|
const left = isObj(cut2) ? Object.keys(cut2).filter((k) => isInt(cut2[k])).map((k) => `${BigInt(cut2[k]).toString()} ${k}`) : [];
|
|
5855
5929
|
out.push("");
|
|
5856
5930
|
if (isInt(asOf) && mode === "voice") put(`Not listed: rows dated after ${moment(asOf)}.`);
|
|
@@ -6684,6 +6758,7 @@ export {
|
|
|
6684
6758
|
TOOLS,
|
|
6685
6759
|
TRAIL_TIERS,
|
|
6686
6760
|
TokenResource,
|
|
6761
|
+
VIEWS,
|
|
6687
6762
|
WORLD_FILE_MAX_BYTES,
|
|
6688
6763
|
WORLD_FILE_MAX_ENTRIES,
|
|
6689
6764
|
WORLD_FILE_MEDIA_TYPE,
|
|
@@ -6779,6 +6854,7 @@ export {
|
|
|
6779
6854
|
typeWord,
|
|
6780
6855
|
unreadFor,
|
|
6781
6856
|
validateCalendarConfig,
|
|
6857
|
+
viewOf,
|
|
6782
6858
|
weekdayForStep,
|
|
6783
6859
|
worldCalendars,
|
|
6784
6860
|
worldGraph,
|
package/dist/waymark.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
openersFor,
|
|
7
7
|
refuseUnknownOptions,
|
|
8
8
|
typeWord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GWJ3SOZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/waymark/glyphs.ts
|
|
12
12
|
var MARK_PATH = "M48.8 0.0 43.8 0.4 39.0 1.2 36.0 2.0 33.2 2.9 29.3 4.5 24.8 6.8 20.6 9.5 17.0 12.4 13.6 15.7 10.4 19.4 7.8 23.1 5.8 26.6 4.5 29.3 3.3 32.1 1.8 36.8 0.8 41.2 0.1 46.3 0.0 51.1 0.4 56.2 1.2 61.0 2.0 63.9 2.9 66.8 4.5 70.7 6.8 75.2 9.5 79.4 12.4 82.9 15.7 86.3 19.4 89.5 23.1 92.1 26.6 94.2 29.3 95.5 32.1 96.7 36.8 98.2 41.2 99.2 46.3 99.8 51.1 100.0 56.2 99.6 61.0 98.8 63.9 98.0 66.8 97.1 70.7 95.5 75.2 93.2 79.4 90.4 82.9 87.6 86.3 84.3 89.5 80.5 92.1 76.9 94.2 73.4 95.5 70.7 96.7 67.9 98.2 63.2 99.2 58.7 99.8 53.7 100.0 48.8 99.6 43.8 98.6 38.4 97.1 33.2 95.5 29.3 93.2 24.8 90.4 20.6 87.6 17.0 84.3 13.6 80.5 10.4 76.9 7.8 73.4 5.8 70.7 4.5 67.9 3.3 63.2 1.8 58.7 0.8 53.7 0.1ZM77.5 80.7 74.1 83.4 70.7 85.7 67.0 87.5 64.5 88.6 64.1 88.7 65.7 86.3 67.1 83.9 68.7 80.7 69.9 77.6 72.7 78.5 73.0 78.4ZM22.5 80.7 25.6 79.0 27.3 78.3 30.0 77.6 31.3 80.7 32.8 83.9 34.2 86.3 35.9 88.7 32.9 87.5 29.3 85.7 25.8 83.4ZM51.2 74.5 55.1 74.7 59.9 75.2 64.2 76.0 67.5 76.9 66.0 80.5 64.2 84.0 62.0 87.4 59.6 90.1 55.1 90.9 52.2 91.2 51.2 91.1ZM48.7 74.5 48.8 91.1 47.7 91.2 44.9 90.9 40.3 90.1 38.2 87.8 36.3 85.0 34.2 81.2 32.5 77.0 35.8 76.0 40.5 75.2 44.5 74.7ZM91.1 51.2 91.1 52.9 90.8 56.3 90.1 59.7 89.3 62.5 88.5 64.8 87.2 67.7 85.7 70.7 83.9 73.4 82.0 75.9 79.4 78.9 76.3 77.2 73.8 76.1 76.2 68.8 77.8 62.7 78.7 56.8 79.0 51.2ZM55.8 51.2 67.7 51.2 67.6 55.1 67.2 59.0 66.7 61.5 65.7 65.0 61.0 64.2 55.7 63.6ZM32.5 51.2 44.5 51.2 44.4 63.6 39.7 64.1 34.5 65.0 33.5 61.3 32.9 58.1 32.5 54.2ZM8.8 51.2 21.0 51.2 21.0 53.3 21.4 56.6 22.7 64.0 23.8 68.4 25.0 72.1 26.6 75.9 23.7 77.2 20.6 78.9 18.5 76.7 16.5 74.1 14.8 71.5 13.4 69.1 12.1 66.3 11.0 63.6 10.1 60.5 9.4 57.3 8.9 53.5 8.8 51.3ZM36.2 27.0 39.5 27.5 44.5 28.2 44.4 48.8 32.4 48.7 32.8 44.5 33.6 39.1 35.0 32.0ZM63.9 26.9 65.2 32.1 66.6 39.2 67.4 44.8 67.7 48.7 55.8 48.8 55.7 28.1 60.5 27.5ZM74.8 23.4 76.9 22.5 79.4 21.1 82.0 24.0 84.8 27.8 86.2 30.3 87.5 32.9 88.6 35.4 89.5 38.1 90.3 41.2 90.8 44.0 91.1 47.0 91.1 48.8 79.0 48.7 78.7 44.6 78.0 39.3 76.5 31.2 74.7 23.5ZM25.5 23.5 25.5 23.7 24.5 26.8 23.7 30.2 22.4 36.6 21.5 42.5 21.1 48.7 8.8 48.8 8.8 47.0 9.2 43.7 9.8 40.8 10.5 38.1 11.5 35.2 12.4 32.9 13.8 30.2 15.2 27.8 17.9 24.0 20.6 21.1 23.1 22.5ZM64.1 11.3 67.0 12.4 70.7 14.3 74.1 16.5 77.5 19.3 75.6 20.3 73.2 21.5 70.0 22.6 68.7 19.2 67.1 16.1 65.7 13.6ZM35.9 11.3 34.2 13.6 32.8 16.1 31.3 19.2 30.0 22.5 27.9 21.9 26.4 21.3 22.5 19.3 25.8 16.5 29.3 14.3 32.9 12.4 35.4 11.4ZM51.2 8.8 52.2 8.8 55.1 9.0 59.6 9.9 61.7 12.2 64.2 16.0 66.0 19.5 67.6 23.3 64.3 24.3 59.4 25.2 56.2 25.6 51.2 25.5ZM48.8 8.8 48.7 25.5 44.2 25.6 40.6 25.2 36.4 24.5 32.4 23.2 33.9 19.5 35.7 16.0 38.2 12.2 40.3 9.9 44.9 9.0 47.7 8.8Z";
|