@onlyworlds/sdk 4.182.0 → 4.184.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/README.md +1 -1
- package/SCHEMA.md +1 -1
- package/dist/index.d.ts +60 -17
- package/dist/index.js +97 -20
- 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.1-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.34.1-dist.141** (canonical 00.34.01).
|
|
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/README.md
CHANGED
|
@@ -436,7 +436,7 @@ The world holds the elements as the owner is served them; the reader's `rung` (`
|
|
|
436
436
|
|
|
437
437
|
`DATE_FIELD` is the profile's date table (each dated type's date field; the ten timeless types are not in it), and `dateOf(el)` is an element's date as that table reads it: the whole number in its type's date field, else null. A timeline or a horizon dates elements exactly as the lens reader's fence does.
|
|
438
438
|
|
|
439
|
-
`worldGraph(world, reader, options)` reads the same snapshot, for the same reader, as nodes and edges: `nodes` (`{ id, type, name, family, icon }`, by id; `family` is the type's colour word), `edges` (`{ source, field, target, index }`, one per link, by source, field and index), `edgesCut` (links to elements that are not nodes, by reason; with a lens, `outside_lens` counts links to elements the reader sees that the lens left out), `cut` and `unreadable` (the `x_lens` key a lens could not be read by, else null). Room elements, hidden and proposed ones and map space (Maps, Pins and Markers; a Zone is a node like any other) are out unless `rooms`, `hidden`, `proposed` or `mapSpace` brings them back (`hidden` and `proposed` are the owner's
|
|
439
|
+
`worldGraph(world, reader, options)` reads the same snapshot, for the same reader, as nodes and edges: `nodes` (`{ id, type, name, family, icon }`, by id; `family` is the type's colour word), `edges` (`{ source, field, target, index }`, one per link, by source, field and index), `edgesCut` (links to elements that are not nodes, by reason; with a lens, `outside_lens` counts links to elements the reader sees that the lens left out), `cut` and `unreadable` (the `x_lens` key a lens could not be read by, else null). Room elements, hidden and proposed ones and map space (Maps, Pins and Markers; a Zone is a node like any other) are out unless `rooms`, `hidden`, `proposed` or `mapSpace` brings them back (`hidden` and `proposed` are a keeper's alone, the owner's or a co-builder's, and a public reader takes no flag); the reading aids are out too, counted `reading_aid`, and no flag brings them back; with `{ lens }` the nodes are exactly what the lens kept, an aid among them when the lens names its pair in `types`.
|
|
440
440
|
|
|
441
441
|
```typescript
|
|
442
442
|
import { degreeOf, worldGraph } from '@onlyworlds/sdk';
|
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.1-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.141** — canonical schema **00.34.01**, published 2026-11-20.
|
|
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.
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ interface OwElementBase {
|
|
|
29
29
|
created_by?: string | null;
|
|
30
30
|
/** The membership whose write last changed this element (server-managed, read-only; served to the world's members only, absent for the public reader); null for the world's owner and for anything last changed before writes recorded it. */
|
|
31
31
|
changed_by?: string | null;
|
|
32
|
-
/** The door of the last write (server-managed, read-only; served to the world's members only, absent for the public reader): `seat` (an
|
|
32
|
+
/** The door of the last write (server-managed, read-only; served to the world's members only, absent for the public reader): `seat` (an AI seat), `mcp`, `declared` (a client that sent X-OW-Agent), then `api`, `v1`, `sync`, `server` (keel's own writes) or `site` (the owner signed in on onlyworlds.com). The first three are the doors the platform marks as an AI's. Null for anything last changed before writes recorded it. */
|
|
33
33
|
changed_via?: 'seat' | 'mcp' | 'declared' | 'api' | 'v1' | 'sync' | 'server' | 'site' | null;
|
|
34
34
|
/** The name the client gave in the X-OW-Client header on the last write (server-managed, read-only; served to the world's members only, absent for the public reader): lower case letters, digits and hyphens, 1 to 32 characters, such as `sdk` or `atlas`. It is the client's claim about itself, never proof, and says nothing about whether an agent drove the write (that is `changed_via`). Null when the last write sent no name or one outside the rule, for keel's own writes, and for anything last changed before names were recorded. Sent in a write it is ignored. This SDK sends its `client` option, `sdk` by default. */
|
|
35
35
|
changed_client?: string | null;
|
|
@@ -2647,7 +2647,7 @@ interface OwHiddenRow {
|
|
|
2647
2647
|
* surface for everything else: `api`, `v1`, `sync`, and `server` for keel's own writes.
|
|
2648
2648
|
*/
|
|
2649
2649
|
type OwWriteDoor = NonNullable<OwElementBase['changed_via']>;
|
|
2650
|
-
/** The doors
|
|
2650
|
+
/** The doors the platform marks as an AI's: an AI seat, the MCP server, or a client that declared itself. */
|
|
2651
2651
|
declare const AGENT_DOORS: readonly OwWriteDoor[];
|
|
2652
2652
|
/** Whether a write came through an agent's door (`changed_via` or `deleted_via`); false for null. */
|
|
2653
2653
|
declare function isAgentDoor(door: OwWriteDoor | null | undefined): boolean;
|
|
@@ -3416,7 +3416,7 @@ interface OwJoinPreview {
|
|
|
3416
3416
|
/** The world owner's chosen Character's name, never a username; null when none is set, or when it is hidden. */
|
|
3417
3417
|
owner_character: string | null;
|
|
3418
3418
|
role: OwMemberRole;
|
|
3419
|
-
/** Whether joining gives the joiner a Character of their own (
|
|
3419
|
+
/** Whether joining gives the joiner a Character of their own (AI links). */
|
|
3420
3420
|
with_character: boolean | null;
|
|
3421
3421
|
/** ISO 8601, UTC. */
|
|
3422
3422
|
expires_at: string;
|
|
@@ -3442,7 +3442,7 @@ interface OwWorldLink {
|
|
|
3442
3442
|
/** `person`: accepted signed in, with acceptJoin. `agent`: redeemed by an AI agent at POST /join. `player`: redeemed with no account at POST /join, for a read key. */
|
|
3443
3443
|
reader: 'person' | 'agent' | 'player';
|
|
3444
3444
|
role: OwMemberRole;
|
|
3445
|
-
/** The name the owner gave an
|
|
3445
|
+
/** The name the owner gave an AI link on the website, or empty. */
|
|
3446
3446
|
label: string;
|
|
3447
3447
|
/** The name the link is signed with, or empty (the invite line then reads "Someone"). */
|
|
3448
3448
|
inviter_name: string;
|
|
@@ -3460,7 +3460,7 @@ interface OwWorldLink {
|
|
|
3460
3460
|
status: 'pending' | 'used' | 'revoked' | 'expired';
|
|
3461
3461
|
/** The membership (its id in GET /api/v2/members) of the co-builder who minted the link over POST /api/v2/links; null for a link the owner made. */
|
|
3462
3462
|
minted_by: string | null;
|
|
3463
|
-
/** Whether the link shows the world's name and picture when it is pasted into a chat: then the link is `/join/<world_id>#<code>`, else `/join#<code>`. Never on an
|
|
3463
|
+
/** Whether the link shows the world's name and picture when it is pasted into a chat: then the link is `/join/<world_id>#<code>`, else `/join#<code>`. Never on an AI link. */
|
|
3464
3464
|
preview?: boolean;
|
|
3465
3465
|
/** A player link only: the Character the player reads as; null while a link for a fresh Character is unused, and always null on a table. `name` is null if that Character was deleted (the redeem then makes a fresh one). */
|
|
3466
3466
|
character?: {
|
|
@@ -4239,7 +4239,7 @@ interface OwClientConfig {
|
|
|
4239
4239
|
/**
|
|
4240
4240
|
* Declare this client an AI agent: every element write (create, upsert, patch, delete,
|
|
4241
4241
|
* editLinks, bulk) carries `X-OW-Agent`, the operations the API document declares it on, and onlyworlds.com
|
|
4242
|
-
* records its writes as
|
|
4242
|
+
* records its writes as an AI's (`changed_via: 'declared'`; the server stores that the header
|
|
4243
4243
|
* was there, never its value). Off by default, and it must stay off in a tool people use:
|
|
4244
4244
|
* it describes the caller, so only the caller can set it. An AI seat's key is recorded
|
|
4245
4245
|
* as an agent without it.
|
|
@@ -5405,12 +5405,12 @@ declare class OwV2Client {
|
|
|
5405
5405
|
* `ow_a_` token owns: `reader` is required (`person`, accepted with acceptJoin;
|
|
5406
5406
|
* `agent`, redeemed at POST /join; `player`, a friend with no account, redeemed with
|
|
5407
5407
|
* redeemJoin for a read key); `role`, when left out, is the server's default: guest for a
|
|
5408
|
-
* person link, contributor for an
|
|
5408
|
+
* person link, contributor for an AI link (a player link is guest, and refuses any other), `days` (1, 7 or 30) to 7; `withCharacter` (AI links
|
|
5409
5409
|
* only) to true; `character` (player links only) a Character's id or `new` (the default):
|
|
5410
5410
|
* whoever opens the link first reads as it, until removed. `preview` (person and player links)
|
|
5411
5411
|
* to false: true puts the world's id in the link's path, so a chat that unfurls it
|
|
5412
|
-
* shows the world's name and picture (the code stays after `#`); true on an
|
|
5413
|
-
* 422, param `preview`. `maxUses` (person and player links; an
|
|
5412
|
+
* shows the world's name and picture (the code stays after `#`); true on an AI link is
|
|
5413
|
+
* 422, param `preview`. `maxUses` (person and player links; an AI link takes none) to 1, a
|
|
5414
5414
|
* link for one. On a person link 2 to 50 lets in that many accounts, each
|
|
5415
5415
|
* joining once with the link's role, until every use is taken, it expires or it is revoked;
|
|
5416
5416
|
* who already joined stays. On a player link 2 to 50 makes a table, one
|
|
@@ -5454,7 +5454,7 @@ declare class OwV2Client {
|
|
|
5454
5454
|
/**
|
|
5455
5455
|
* POST /account/worlds/{worldId}/seats -- a seat for your own AI in a world you own or are a
|
|
5456
5456
|
* member of: its own membership, write key and `ow_s_` secret, no join link. You answer for
|
|
5457
|
-
* it, and its writes are marked as an
|
|
5457
|
+
* it, and its writes are marked as an AI's. `name` is required (1 to 80 characters);
|
|
5458
5458
|
* `role` is at most your own (the owner may give any; default contributor, or your own role
|
|
5459
5459
|
* when that is lower); `character` is `new` (default: a Character of its own), `none`, or
|
|
5460
5460
|
* `mine` (members only: it plays the Character you play). 201 with `key`, `pin` and the
|
|
@@ -6587,9 +6587,9 @@ interface OwGraphOptions {
|
|
|
6587
6587
|
clock?: string | null;
|
|
6588
6588
|
/** Bring back room elements. Refused for a public reader. */
|
|
6589
6589
|
rooms?: boolean | null;
|
|
6590
|
-
/** Bring back hidden elements.
|
|
6590
|
+
/** Bring back hidden elements. A keeper's alone (the owner or a co-builder): refused from any other rung. */
|
|
6591
6591
|
hidden?: boolean | null;
|
|
6592
|
-
/** Bring back elements written as proposed.
|
|
6592
|
+
/** Bring back elements written as proposed. A keeper's alone (the owner or a co-builder): refused from any other rung. */
|
|
6593
6593
|
proposed?: boolean | null;
|
|
6594
6594
|
/** Bring back map space: Maps, Pins and Markers (a Zone is a node by default). Refused for a public reader. */
|
|
6595
6595
|
mapSpace?: boolean | null;
|
|
@@ -6635,9 +6635,9 @@ interface OwWorldGraph {
|
|
|
6635
6635
|
nodes: OwGraphNode[];
|
|
6636
6636
|
/** The edges, by source id, then field name (both in code point order), then index. */
|
|
6637
6637
|
edges: OwGraphEdge[];
|
|
6638
|
-
/** The links left out because their target is not a node, counted by the target's reason, in the reasons' one order. A reason with no count is absent; a reader that is not the owner never carries `anchor_not_visible
|
|
6638
|
+
/** The links left out because their target is not a node, counted by the target's reason, in the reasons' one order. A reason with no count is absent; a reader that is not the owner never carries `anchor_not_visible` or `not_visible`, one below a keeper (the owner or a co-builder) never carries `hidden` or `proposed`, and every reader carries `outside_lens`. */
|
|
6639
6639
|
edgesCut: Partial<Record<OwGraphCutReason, number>>;
|
|
6640
|
-
/** With a lens, the lens's own cut, unchanged. Without one, the elements out by default, counted by reason (`room`, `hidden` and `proposed` for
|
|
6640
|
+
/** With a lens, the lens's own cut, unchanged. Without one, the elements out by default, counted by reason (`room`, `hidden` and `proposed` for a keeper only, `map_space`, `reading_aid`). */
|
|
6641
6641
|
cut: Partial<Record<OwGraphCutReason, number>>;
|
|
6642
6642
|
/** With a lens whose `x_lens` the lens reader cannot read, the key it names (as `resolveLens`'s `unreadable`), and the graph is empty. Null otherwise, and always null without a lens. */
|
|
6643
6643
|
unreadable: string | null;
|
|
@@ -6675,7 +6675,7 @@ declare const DECLARED_LINKS: readonly string[];
|
|
|
6675
6675
|
* nor cut (counted for every rung); one of the kinds out by default without a lens; and `not_visible` for one the
|
|
6676
6676
|
* reader does not see. A link to an id that is not in the world is left out and not counted.
|
|
6677
6677
|
*
|
|
6678
|
-
* `hidden` or `proposed` from a reader
|
|
6678
|
+
* `hidden` or `proposed` from a reader below a keeper (the owner or a co-builder), or any flag from a public reader, is refused
|
|
6679
6679
|
* by name before anything is read; of several, the first in the order `hidden`, `proposed`, `rooms`, `mapSpace`,
|
|
6680
6680
|
* `readingAids`. An owner reading `as` another reader is judged by that reader's rung.
|
|
6681
6681
|
*/
|
|
@@ -6831,6 +6831,49 @@ interface OwLayoutOf {
|
|
|
6831
6831
|
*/
|
|
6832
6832
|
declare function layoutOf(map: unknown, maps: readonly unknown[], pins: readonly unknown[]): OwLayoutOf;
|
|
6833
6833
|
|
|
6834
|
+
/**
|
|
6835
|
+
* The map-space profile's frame reading (schema-dist profiles/map-space.md, rules 13 and 14): where a point on a child
|
|
6836
|
+
* Map lies on its parent, and on each Map above it. A child Map says where it lies on the Map its `parent_map` names
|
|
6837
|
+
* with `x_parent_frame`, a box `[x0, y0, x1, y1]` in the parent's pixels. The profile's `frame_cases` are the test.
|
|
6838
|
+
* The map-space reading (`mapSpace`) and the layout reading (`layoutOf`) do not read the key.
|
|
6839
|
+
*/
|
|
6840
|
+
/** Why the walk up `parent_map` ended (rule 14). */
|
|
6841
|
+
type OwCarryStop = 'top' | 'dangling' | 'cycle' | 'no_frame' | 'no_carry';
|
|
6842
|
+
/** What is wrong with a Map's own `x_parent_frame` (rule 13). */
|
|
6843
|
+
type OwCarryLint = 'no_parent' | 'not_four_numbers' | 'not_a_box';
|
|
6844
|
+
/** A point on one Map: its id and the point in its pixels, from its bottom left. */
|
|
6845
|
+
interface OwCarryPoint {
|
|
6846
|
+
map: string;
|
|
6847
|
+
x: number;
|
|
6848
|
+
y: number;
|
|
6849
|
+
}
|
|
6850
|
+
interface OwCarryOf {
|
|
6851
|
+
/** The Map's `x_parent_frame` as written when it is a parent frame, else null. The Map's own: it does not depend on the point. */
|
|
6852
|
+
parent_frame: number[] | null;
|
|
6853
|
+
/** `no_parent`, `not_four_numbers` or `not_a_box` when this Map's own key is one, else null. */
|
|
6854
|
+
lint: OwCarryLint | null;
|
|
6855
|
+
/** The point on this Map as given, then the point on each Map it is carried to, up the `parent_map` chain. */
|
|
6856
|
+
points: OwCarryPoint[];
|
|
6857
|
+
/** Why the last point is carried no further; null only for a row that is no Map. */
|
|
6858
|
+
stop: OwCarryStop | null;
|
|
6859
|
+
}
|
|
6860
|
+
/**
|
|
6861
|
+
* One Map's frame reading: `{parent_frame, lint, points, stop}`, every key always present.
|
|
6862
|
+
*
|
|
6863
|
+
* `map` is the Map read, `point` is `[x, y]` on it (two finite numbers in its pixels from its bottom left, as a Pin's
|
|
6864
|
+
* `x` and `y` or a tap gives them), and `maps` the Maps the reader is served: rows of any other type are skipped, a
|
|
6865
|
+
* row whose `type` is not exactly `map` or that has no non-empty string id is no Map, and of two rows with one id the
|
|
6866
|
+
* last served is read. A `map` that is no Map answers `{parent_frame: null, lint: null, points: [], stop: null}`.
|
|
6867
|
+
*
|
|
6868
|
+
* The point is carried one level at a time up `parent_map`, by each level's own frame, as
|
|
6869
|
+
* `x0 + ((x * (x1 - x0)) / width)` and `y0 + ((y * (y1 - y0)) / height)` in that order, never through one product
|
|
6870
|
+
* of the levels' ratios. The walk ends at a Map with no `parent_map` (`top`), one whose parent is not served
|
|
6871
|
+
* (`dangling`), one whose parent the walk has already reached, itself included (`cycle`), one with no parent frame
|
|
6872
|
+
* (`no_frame`), or one whose written `width` or `height` is not a whole number above 0 (`no_carry`). A point outside
|
|
6873
|
+
* the child is carried as written; `z` is not carried. Pure.
|
|
6874
|
+
*/
|
|
6875
|
+
declare function carryOf(map: unknown, point: readonly [number, number] | readonly number[], maps: readonly unknown[]): OwCarryOf;
|
|
6876
|
+
|
|
6834
6877
|
/** A place on the route, in travel order. Exactly one of `pin`, `between` or `parent` says where it sits. */
|
|
6835
6878
|
interface OwTrailPlace {
|
|
6836
6879
|
id: string;
|
|
@@ -8537,5 +8580,5 @@ declare class TokenResource {
|
|
|
8537
8580
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
8538
8581
|
}
|
|
8539
8582
|
|
|
8540
|
-
export { AGENT_DOORS, ASK_LIMITS, BY_LINKS_3D_REST, BY_LINKS_3D_VERSION, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, DATE_FIELD, DECLARED_LINKS, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, GROUP_COLORS, GROUP_ORDER, GameTier, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, OwAddressError, OwApiError, OwNetworkError, OwPreconditionFailedError, OwProposedError, OwSignInError, OwStaleProposalError, OwV2Client, OwWorldFileError, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, SPATIAL_TYPES, STRAND_FIELD, TOOLS, TRAIL_TIERS, TokenResource, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, absYearForEraYear, absoluteYear, approxYearLength, askerOf, base64url, breakdownStep, buildAskContext, buildWorldIndex, byCodePoint, charterOf, compareInstants, dateOf, degreeOf, designPartsOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, findOwLinks, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isOpenWork, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, layoutByLinks3d, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readReportLine, readReportLines, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportTalksOf, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, talksOf, threadOf, trailByPlace, trimAndFold, typeWord, unplacedAround, unplacedByKind, unplacedByLinks3d, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, workOf, workStateOf, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
8541
|
-
export type { AccessKeyResponse, CalendarConfig, CalendarEra, CalendarIntercalary, CalendarMonths, CalendarWeek, ElementFamily, ElementGroup, ElementType, EncryptionInfo, EraDomain, FieldInfo, FieldType, ListParams, OwAccountToken, OwAccountWorld, OwAddress, OwAddressAt, OwAddressForm, OwAddressFound, OwAddressReading, OwAddressReason, OwAddressingOptions, OwAgentJoined, OwAiAskAnswer, OwAiAskBody, OwAiMeter, OwAiRefusal, OwAiSortAnswer, OwAiSortBody, OwAiToken, OwAiUse, OwAllowance, OwAskAnswer, OwAskContext, OwAskContextOptions, OwAskLeftOut, OwAuthErrorCode, OwBulkItem, OwBulkItemResult, OwBulkResponse, OwCalendarElement, OwChange, OwChangeDelete, OwChangeUpsert, OwChangesPage, OwCharterWorld, OwClientConfig, OwCreateAccountWorldInput, OwCreatedAccountWorld, OwCreatedWorldLink, OwDeleteReason, OwDesignPart, OwDoor, OwDragField, OwDraught, OwDraughtCompact, OwDraughtComponent, OwDraughtItem, OwDraughtLens, OwDraughtPolicy, OwEdited, OwElement, OwElementBase, OwElementMark, OwErrorBody, OwFieldsRefusal, OwFileAddedBy, OwFileDownload, OwFileKind, OwFileRow, OwFileTicket, OwFrontDoor, OwFrontDoorCharter, OwFrontDoorSkill, OwGraphCutReason, OwGraphEdge, OwGraphMark, OwGraphNode, OwGraphOptions, OwHiddenRow, OwInstant, OwJoinPreview, OwJoined, OwJoinedMembership, OwKeyKind, OwLanding, OwLandingCluster, OwLandingGap, OwLandingGapKind, OwLandingMember, OwLandingMode, OwLandingOptions, OwLayout3dHow, OwLayout3dPart, OwLayoutAround, OwLayoutAroundOptions, OwLayoutAroundPoint, OwLayoutByKind, OwLayoutByLinks3d, OwLayoutByLinks3dOptions, OwLayoutGraph, OwLayoutOf, OwLayoutPoint, OwLensCutReason, OwLensMail, OwLensOptions, OwLensReader, OwLensReading, OwLensWorld, OwLinkEdit, OwLookupElement, OwLookupHit, OwLookupLink, OwLookupOptions, OwLookupReason, OwMapSpace, OwMapSpaceMap, OwMapSpaceOutReason, OwMapSpaceOutline, OwMapSpacePin, OwMapSpacePoint, OwMe, OwMediaTicket, OwMember, OwMemberLenses, OwMemberRole, OwMessageMember, OwMintedAiToken, OwMintedKey, OwMySeat, OwNamesMap, OwOpener, OwOpenerKind, OwOpenerState, OwOpenerSurface, OwOpenersOptions, OwPage, OwPaidBy, OwPhotoOptions, OwPhotoPlan, OwPlayerJoined, OwPreparedPhoto, OwProposal, OwProposalAccepted, OwProposalConflict, OwProposalList, OwProposalQuery, OwProposalState, OwProposeInput, OwProposed, OwProposedMark, OwProposedNewElement, OwReadWorldFile, OwReadWorldFileOptions, OwReadingAids, OwReadingAidsCharter, OwReadingAidsDomain, OwReadingAidsGuide, OwReadingAidsHub, OwRecord, OwRecordMark, OwRecordStory, OwRemovalTicket, OwRemovedImage, OwRenderOptions, OwReportGroup, OwReportLine, OwReportLineOptions, OwReportLint, OwReportParentKind, OwReportThreads, OwResyncReason, OwReviewInput, OwReviewed, OwSearchResult, OwSearchResults, OwSeat, OwSeatCreated, OwSender, OwSenderStatus, OwServedReadingAids, OwSignInBegin, OwSignInBegun, OwSignInComplete, OwSignInReason, OwSignInResult, OwSignInStorage, OwSignedIn, OwSortAddToRow, OwSortAnswer, OwSortAskRow, OwSortLinkRow, OwSortMakeRow, OwSortNote, OwSortRef, OwSortRow, OwStrand, OwStrandSlot, OwStrandWorld, OwTalk, OwTool, OwToolNeeds, OwToolOpen, OwTrailGround, OwTrailHanger, OwTrailInput, OwTrailLayout, OwTrailPin, OwTrailPlace, OwTrailSettings, OwTrailSpiral, OwTrailTier, OwUploadedFile, OwUploadedImage, OwView, OwViewRow, OwViewsTable, OwWordPair, OwWork, OwWorkElement, OwWorkLint, OwWorkState, OwWorkWorld, OwWorldFileEntry, OwWorldFileReason, OwWorldFileRow, OwWorldFiles, OwWorldGraph, OwWorldIndex, OwWorldKeyMember, OwWorldKeyRow, OwWorldLens, OwWorldLensReading, OwWorldLenses, OwWorldLink, OwWorldMeta, OwWorldOrigin, OwWorldProducer, OwWorldProposalList, OwWorldProposalQuery, OwWorldProposalRow, OwWorldPublicPage, OwWorldSource, OwWriteDoor, OwWriteWorldFileOptions, OwWriteWorldFileReport, ParseError, ParseOptions, ParseResult, RevokeAllSessionsResponse, RevokeSessionResponse, SectionInfo, StepBreakdown, TokenConsumeParams, TokenConsumeResponse, TokenStatus, TokenTransport, WorldCalendar };
|
|
8583
|
+
export { AGENT_DOORS, ASK_LIMITS, BY_LINKS_3D_REST, BY_LINKS_3D_VERSION, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, DATE_FIELD, DECLARED_LINKS, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, GROUP_COLORS, GROUP_ORDER, GameTier, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, OwAddressError, OwApiError, OwNetworkError, OwPreconditionFailedError, OwProposedError, OwSignInError, OwStaleProposalError, OwV2Client, OwWorldFileError, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, SPATIAL_TYPES, STRAND_FIELD, TOOLS, TRAIL_TIERS, TokenResource, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, absYearForEraYear, absoluteYear, approxYearLength, askerOf, base64url, breakdownStep, buildAskContext, buildWorldIndex, byCodePoint, carryOf, charterOf, compareInstants, dateOf, degreeOf, designPartsOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, findOwLinks, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isOpenWork, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, layoutByLinks3d, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readReportLine, readReportLines, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportTalksOf, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, talksOf, threadOf, trailByPlace, trimAndFold, typeWord, unplacedAround, unplacedByKind, unplacedByLinks3d, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, workOf, workStateOf, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
8584
|
+
export type { AccessKeyResponse, CalendarConfig, CalendarEra, CalendarIntercalary, CalendarMonths, CalendarWeek, ElementFamily, ElementGroup, ElementType, EncryptionInfo, EraDomain, FieldInfo, FieldType, ListParams, OwAccountToken, OwAccountWorld, OwAddress, OwAddressAt, OwAddressForm, OwAddressFound, OwAddressReading, OwAddressReason, OwAddressingOptions, OwAgentJoined, OwAiAskAnswer, OwAiAskBody, OwAiMeter, OwAiRefusal, OwAiSortAnswer, OwAiSortBody, OwAiToken, OwAiUse, OwAllowance, OwAskAnswer, OwAskContext, OwAskContextOptions, OwAskLeftOut, OwAuthErrorCode, OwBulkItem, OwBulkItemResult, OwBulkResponse, OwCalendarElement, OwCarryLint, OwCarryOf, OwCarryPoint, OwCarryStop, OwChange, OwChangeDelete, OwChangeUpsert, OwChangesPage, OwCharterWorld, OwClientConfig, OwCreateAccountWorldInput, OwCreatedAccountWorld, OwCreatedWorldLink, OwDeleteReason, OwDesignPart, OwDoor, OwDragField, OwDraught, OwDraughtCompact, OwDraughtComponent, OwDraughtItem, OwDraughtLens, OwDraughtPolicy, OwEdited, OwElement, OwElementBase, OwElementMark, OwErrorBody, OwFieldsRefusal, OwFileAddedBy, OwFileDownload, OwFileKind, OwFileRow, OwFileTicket, OwFrontDoor, OwFrontDoorCharter, OwFrontDoorSkill, OwGraphCutReason, OwGraphEdge, OwGraphMark, OwGraphNode, OwGraphOptions, OwHiddenRow, OwInstant, OwJoinPreview, OwJoined, OwJoinedMembership, OwKeyKind, OwLanding, OwLandingCluster, OwLandingGap, OwLandingGapKind, OwLandingMember, OwLandingMode, OwLandingOptions, OwLayout3dHow, OwLayout3dPart, OwLayoutAround, OwLayoutAroundOptions, OwLayoutAroundPoint, OwLayoutByKind, OwLayoutByLinks3d, OwLayoutByLinks3dOptions, OwLayoutGraph, OwLayoutOf, OwLayoutPoint, OwLensCutReason, OwLensMail, OwLensOptions, OwLensReader, OwLensReading, OwLensWorld, OwLinkEdit, OwLookupElement, OwLookupHit, OwLookupLink, OwLookupOptions, OwLookupReason, OwMapSpace, OwMapSpaceMap, OwMapSpaceOutReason, OwMapSpaceOutline, OwMapSpacePin, OwMapSpacePoint, OwMe, OwMediaTicket, OwMember, OwMemberLenses, OwMemberRole, OwMessageMember, OwMintedAiToken, OwMintedKey, OwMySeat, OwNamesMap, OwOpener, OwOpenerKind, OwOpenerState, OwOpenerSurface, OwOpenersOptions, OwPage, OwPaidBy, OwPhotoOptions, OwPhotoPlan, OwPlayerJoined, OwPreparedPhoto, OwProposal, OwProposalAccepted, OwProposalConflict, OwProposalList, OwProposalQuery, OwProposalState, OwProposeInput, OwProposed, OwProposedMark, OwProposedNewElement, OwReadWorldFile, OwReadWorldFileOptions, OwReadingAids, OwReadingAidsCharter, OwReadingAidsDomain, OwReadingAidsGuide, OwReadingAidsHub, OwRecord, OwRecordMark, OwRecordStory, OwRemovalTicket, OwRemovedImage, OwRenderOptions, OwReportGroup, OwReportLine, OwReportLineOptions, OwReportLint, OwReportParentKind, OwReportThreads, OwResyncReason, OwReviewInput, OwReviewed, OwSearchResult, OwSearchResults, OwSeat, OwSeatCreated, OwSender, OwSenderStatus, OwServedReadingAids, OwSignInBegin, OwSignInBegun, OwSignInComplete, OwSignInReason, OwSignInResult, OwSignInStorage, OwSignedIn, OwSortAddToRow, OwSortAnswer, OwSortAskRow, OwSortLinkRow, OwSortMakeRow, OwSortNote, OwSortRef, OwSortRow, OwStrand, OwStrandSlot, OwStrandWorld, OwTalk, OwTool, OwToolNeeds, OwToolOpen, OwTrailGround, OwTrailHanger, OwTrailInput, OwTrailLayout, OwTrailPin, OwTrailPlace, OwTrailSettings, OwTrailSpiral, OwTrailTier, OwUploadedFile, OwUploadedImage, OwView, OwViewRow, OwViewsTable, OwWordPair, OwWork, OwWorkElement, OwWorkLint, OwWorkState, OwWorkWorld, OwWorldFileEntry, OwWorldFileReason, OwWorldFileRow, OwWorldFiles, OwWorldGraph, OwWorldIndex, OwWorldKeyMember, OwWorldKeyRow, OwWorldLens, OwWorldLensReading, OwWorldLenses, OwWorldLink, OwWorldMeta, OwWorldOrigin, OwWorldProducer, OwWorldProposalList, OwWorldProposalQuery, OwWorldProposalRow, OwWorldPublicPage, OwWorldSource, OwWriteDoor, OwWriteWorldFileOptions, OwWriteWorldFileReport, ParseError, ParseOptions, ParseResult, RevokeAllSessionsResponse, RevokeSessionResponse, SectionInfo, StepBreakdown, TokenConsumeParams, TokenConsumeResponse, TokenStatus, TokenTransport, WorldCalendar };
|
package/dist/index.js
CHANGED
|
@@ -1767,12 +1767,12 @@ var OwV2Client = class {
|
|
|
1767
1767
|
* `ow_a_` token owns: `reader` is required (`person`, accepted with acceptJoin;
|
|
1768
1768
|
* `agent`, redeemed at POST /join; `player`, a friend with no account, redeemed with
|
|
1769
1769
|
* redeemJoin for a read key); `role`, when left out, is the server's default: guest for a
|
|
1770
|
-
* person link, contributor for an
|
|
1770
|
+
* person link, contributor for an AI link (a player link is guest, and refuses any other), `days` (1, 7 or 30) to 7; `withCharacter` (AI links
|
|
1771
1771
|
* only) to true; `character` (player links only) a Character's id or `new` (the default):
|
|
1772
1772
|
* whoever opens the link first reads as it, until removed. `preview` (person and player links)
|
|
1773
1773
|
* to false: true puts the world's id in the link's path, so a chat that unfurls it
|
|
1774
|
-
* shows the world's name and picture (the code stays after `#`); true on an
|
|
1775
|
-
* 422, param `preview`. `maxUses` (person and player links; an
|
|
1774
|
+
* shows the world's name and picture (the code stays after `#`); true on an AI link is
|
|
1775
|
+
* 422, param `preview`. `maxUses` (person and player links; an AI link takes none) to 1, a
|
|
1776
1776
|
* link for one. On a person link 2 to 50 lets in that many accounts, each
|
|
1777
1777
|
* joining once with the link's role, until every use is taken, it expires or it is revoked;
|
|
1778
1778
|
* who already joined stays. On a player link 2 to 50 makes a table, one
|
|
@@ -1833,7 +1833,7 @@ var OwV2Client = class {
|
|
|
1833
1833
|
/**
|
|
1834
1834
|
* POST /account/worlds/{worldId}/seats -- a seat for your own AI in a world you own or are a
|
|
1835
1835
|
* member of: its own membership, write key and `ow_s_` secret, no join link. You answer for
|
|
1836
|
-
* it, and its writes are marked as an
|
|
1836
|
+
* it, and its writes are marked as an AI's. `name` is required (1 to 80 characters);
|
|
1837
1837
|
* `role` is at most your own (the owner may give any; default contributor, or your own role
|
|
1838
1838
|
* when that is lower); `character` is `new` (default: a Character of its own), `none`, or
|
|
1839
1839
|
* `mine` (members only: it plays the Character you play). 201 with `key`, `pin` and the
|
|
@@ -4188,7 +4188,7 @@ function workOf(items, world, sourceWorld) {
|
|
|
4188
4188
|
var GRAPH_OPTION_KEYS = ["lens", "asOf", "clock", "rooms", "hidden", "proposed", "mapSpace", "readingAids"];
|
|
4189
4189
|
var DECLARED_LINKS = Object.freeze(["x_lens_leads_to", "x_spine_depends_on"]);
|
|
4190
4190
|
var GRAPH_REASONS = [...CUT_REASONS, "room", "hidden", "proposed", "map_space", "reading_aid", "outside_lens"];
|
|
4191
|
-
var
|
|
4191
|
+
var GRAPH_KEEPER_ONLY = /* @__PURE__ */ new Set(["hidden", "proposed"]);
|
|
4192
4192
|
function flag(opts, key3) {
|
|
4193
4193
|
const v = valueOf(opts, key3);
|
|
4194
4194
|
if (v !== null && typeof v !== "boolean") throw new TypeError(`worldGraph: ${key3} is a boolean; got ${JSON.stringify(v)}.`);
|
|
@@ -4213,7 +4213,9 @@ function worldGraph(world, reader, options) {
|
|
|
4213
4213
|
};
|
|
4214
4214
|
const seenRung = reader.rung === "owner" && reader.as != null ? reader.as.rung : reader.rung;
|
|
4215
4215
|
for (const [kind, key3] of [["hidden", "hidden"], ["proposed", "proposed"]]) {
|
|
4216
|
-
if (flags[kind] && seenRung !== "owner"
|
|
4216
|
+
if (flags[kind] && seenRung !== "owner" && seenRung !== "co-builder") {
|
|
4217
|
+
throw new TypeError(`worldGraph: ${key3} is a keeper's alone (the owner or a co-builder); a ${seenRung} reader may not ask it.`);
|
|
4218
|
+
}
|
|
4217
4219
|
}
|
|
4218
4220
|
if (seenRung === "public") {
|
|
4219
4221
|
for (const [kind, key3] of [["room", "rooms"], ["map_space", "mapSpace"], ["reading_aid", "readingAids"]]) {
|
|
@@ -4224,7 +4226,8 @@ function worldGraph(world, reader, options) {
|
|
|
4224
4226
|
const lens = valueOf(opts, "lens");
|
|
4225
4227
|
if (lens !== null && typeof lens !== "string" && !isBody2(lens)) throw new TypeError("worldGraph: lens is a lens body or its id.");
|
|
4226
4228
|
const r = new Reading(world, reader, asOf);
|
|
4227
|
-
const
|
|
4229
|
+
const seenKeeper = r.seenRung === "owner" || r.seenRung === "co-builder";
|
|
4230
|
+
const keeperCounts = seenKeeper || r.owner;
|
|
4228
4231
|
const kinds = (id) => {
|
|
4229
4232
|
const out = [];
|
|
4230
4233
|
if (r.room.has(id)) out.push("room");
|
|
@@ -4235,7 +4238,7 @@ function worldGraph(world, reader, options) {
|
|
|
4235
4238
|
return out;
|
|
4236
4239
|
};
|
|
4237
4240
|
const brought = (k) => flags[k];
|
|
4238
|
-
const candidate = (id) => r.view.has(id) ||
|
|
4241
|
+
const candidate = (id) => r.view.has(id) || seenKeeper && r.proposed.has(id);
|
|
4239
4242
|
const nodeIds = /* @__PURE__ */ new Set();
|
|
4240
4243
|
let cut2;
|
|
4241
4244
|
let reasonOf;
|
|
@@ -4255,7 +4258,7 @@ function worldGraph(world, reader, options) {
|
|
|
4255
4258
|
if (why === null) nodeIds.add(id);
|
|
4256
4259
|
else counts.set(why, (counts.get(why) ?? 0) + 1);
|
|
4257
4260
|
}
|
|
4258
|
-
cut2 = tally(counts, r.owner);
|
|
4261
|
+
cut2 = tally(counts, r.owner, keeperCounts);
|
|
4259
4262
|
reasonOf = (id) => candidate(id) ? outBy(id) : "not_visible";
|
|
4260
4263
|
}
|
|
4261
4264
|
const ids = [...nodeIds].sort(byCodePoint);
|
|
@@ -4300,9 +4303,9 @@ function worldGraph(world, reader, options) {
|
|
|
4300
4303
|
const typed = typeof t === "string" && r.typeOf.get(t) === to;
|
|
4301
4304
|
if (typed && !read.has(t)) {
|
|
4302
4305
|
read.add(t);
|
|
4303
|
-
visit(source, field, t,
|
|
4306
|
+
visit(source, field, t, seenKeeper ? i : served);
|
|
4304
4307
|
}
|
|
4305
|
-
if (
|
|
4308
|
+
if (seenKeeper || typed && r.linkable.has(t)) served++;
|
|
4306
4309
|
}
|
|
4307
4310
|
}
|
|
4308
4311
|
for (const field of DECLARED_LINKS) {
|
|
@@ -4317,12 +4320,13 @@ function worldGraph(world, reader, options) {
|
|
|
4317
4320
|
}
|
|
4318
4321
|
}
|
|
4319
4322
|
edges.sort((a, b) => byCodePoint(a.source, b.source) || byCodePoint(a.field, b.field) || a.index - b.index);
|
|
4320
|
-
return { nodes, edges, edgesCut: tally(cutEdges, r.owner), cut: cut2, unreadable };
|
|
4323
|
+
return { nodes, edges, edgesCut: tally(cutEdges, r.owner, keeperCounts), cut: cut2, unreadable };
|
|
4321
4324
|
}
|
|
4322
|
-
function tally(counts, owner) {
|
|
4325
|
+
function tally(counts, owner, keeper) {
|
|
4323
4326
|
const out = {};
|
|
4324
4327
|
for (const why of GRAPH_REASONS) {
|
|
4325
|
-
if (
|
|
4328
|
+
if (OWNER_ONLY.has(why) && !owner) continue;
|
|
4329
|
+
if (GRAPH_KEEPER_ONLY.has(why) && !keeper) continue;
|
|
4326
4330
|
const n = counts.get(why) ?? 0;
|
|
4327
4331
|
if (n > 0) out[why] = n;
|
|
4328
4332
|
}
|
|
@@ -4594,6 +4598,78 @@ function layoutOf(map, maps, pins) {
|
|
|
4594
4598
|
return { layout: method, ground, hand };
|
|
4595
4599
|
}
|
|
4596
4600
|
|
|
4601
|
+
// src/carry-of.ts
|
|
4602
|
+
var isRow3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
4603
|
+
var idOf4 = (v) => typeof v === "string" && v !== "" ? v : null;
|
|
4604
|
+
var mapId = (v) => isRow3(v) && v.type === "map" ? idOf4(v.id) : null;
|
|
4605
|
+
var isNumber = (v) => typeof v === "number" && Number.isFinite(v);
|
|
4606
|
+
var isCarrySize = (v) => isNumber(v) && Number.isInteger(v) && v > 0;
|
|
4607
|
+
function frameOf(map) {
|
|
4608
|
+
const key3 = map.x_parent_frame;
|
|
4609
|
+
const present = key3 !== void 0 && key3 !== null;
|
|
4610
|
+
if (idOf4(map.parent_map) === null) return { frame: null, lint: present ? "no_parent" : null };
|
|
4611
|
+
if (!present) return { frame: null, lint: null };
|
|
4612
|
+
if (!Array.isArray(key3) || key3.length !== 4 || !key3.every(isNumber)) return { frame: null, lint: "not_four_numbers" };
|
|
4613
|
+
const [x0, y0, x1, y1] = key3;
|
|
4614
|
+
if (!(x0 < x1) || !(y0 < y1)) return { frame: null, lint: "not_a_box" };
|
|
4615
|
+
return { frame: key3, lint: null };
|
|
4616
|
+
}
|
|
4617
|
+
function carryOf(map, point2, maps) {
|
|
4618
|
+
if (!isRow3(map)) throw new TypeError("carryOf: map is one Map element.");
|
|
4619
|
+
if (!Array.isArray(point2) || point2.length !== 2 || !point2.every(isNumber)) {
|
|
4620
|
+
throw new TypeError(`carryOf: point is [x, y], two finite numbers; got ${JSON.stringify(point2) ?? String(point2)}.`);
|
|
4621
|
+
}
|
|
4622
|
+
if (!Array.isArray(maps)) throw new TypeError("carryOf: maps is a list of Map elements.");
|
|
4623
|
+
const id = mapId(map);
|
|
4624
|
+
if (id === null) return { parent_frame: null, lint: null, points: [], stop: null };
|
|
4625
|
+
const served = /* @__PURE__ */ new Map();
|
|
4626
|
+
for (const m of maps) {
|
|
4627
|
+
const mid = mapId(m);
|
|
4628
|
+
if (mid !== null) served.set(mid, m);
|
|
4629
|
+
}
|
|
4630
|
+
const own4 = frameOf(map);
|
|
4631
|
+
let x = point2[0];
|
|
4632
|
+
let y = point2[1];
|
|
4633
|
+
const points2 = [{ map: id, x, y }];
|
|
4634
|
+
const reached = /* @__PURE__ */ new Set([id]);
|
|
4635
|
+
let at = map;
|
|
4636
|
+
let frame = own4.frame;
|
|
4637
|
+
let stop;
|
|
4638
|
+
for (; ; ) {
|
|
4639
|
+
const parentId = idOf4(at.parent_map);
|
|
4640
|
+
if (parentId === null) {
|
|
4641
|
+
stop = "top";
|
|
4642
|
+
break;
|
|
4643
|
+
}
|
|
4644
|
+
const parent = served.get(parentId);
|
|
4645
|
+
if (parent === void 0) {
|
|
4646
|
+
stop = "dangling";
|
|
4647
|
+
break;
|
|
4648
|
+
}
|
|
4649
|
+
if (reached.has(parentId)) {
|
|
4650
|
+
stop = "cycle";
|
|
4651
|
+
break;
|
|
4652
|
+
}
|
|
4653
|
+
if (frame === null) {
|
|
4654
|
+
stop = "no_frame";
|
|
4655
|
+
break;
|
|
4656
|
+
}
|
|
4657
|
+
const { width, height } = at;
|
|
4658
|
+
if (!isCarrySize(width) || !isCarrySize(height)) {
|
|
4659
|
+
stop = "no_carry";
|
|
4660
|
+
break;
|
|
4661
|
+
}
|
|
4662
|
+
const [x0, y0, x1, y1] = frame;
|
|
4663
|
+
x = x0 + x * (x1 - x0) / width;
|
|
4664
|
+
y = y0 + y * (y1 - y0) / height;
|
|
4665
|
+
points2.push({ map: parentId, x, y });
|
|
4666
|
+
reached.add(parentId);
|
|
4667
|
+
at = parent;
|
|
4668
|
+
frame = frameOf(parent).frame;
|
|
4669
|
+
}
|
|
4670
|
+
return { parent_frame: own4.frame, lint: own4.lint, points: points2, stop };
|
|
4671
|
+
}
|
|
4672
|
+
|
|
4597
4673
|
// src/layout-trail.ts
|
|
4598
4674
|
var tier = (name, z, kinds) => /* @__PURE__ */ Object.freeze({ name, z, kinds: /* @__PURE__ */ Object.freeze(kinds) });
|
|
4599
4675
|
var TRAIL_TIERS = /* @__PURE__ */ Object.freeze([
|
|
@@ -6886,7 +6962,7 @@ function readUnit(u) {
|
|
|
6886
6962
|
}
|
|
6887
6963
|
return u;
|
|
6888
6964
|
}
|
|
6889
|
-
function
|
|
6965
|
+
function frameOf2(first, at, hflag, hat, unit) {
|
|
6890
6966
|
const cv = [], cx = [], cy = [];
|
|
6891
6967
|
for (const [id, q] of first) {
|
|
6892
6968
|
const v = at.get(id);
|
|
@@ -7076,7 +7152,7 @@ function layout3d(nodes, edges, rows2, table, opts = {}) {
|
|
|
7076
7152
|
if (rows2) {
|
|
7077
7153
|
plateAns = plate(rows2, new Set(ids));
|
|
7078
7154
|
if (plateAns && hflag) {
|
|
7079
|
-
frame =
|
|
7155
|
+
frame = frameOf2(plateAns.first, at, hflag, hat, unit);
|
|
7080
7156
|
if (frame) plateAns = plate(rows2, new Set(ids), { scale: frame.s });
|
|
7081
7157
|
}
|
|
7082
7158
|
plateAt = plateAns ? plateAns.at : null;
|
|
@@ -7419,15 +7495,15 @@ function layoutPieces(nodes, edges, rows2, table, opts = {}) {
|
|
|
7419
7495
|
}
|
|
7420
7496
|
|
|
7421
7497
|
// src/layout3d/space.ts
|
|
7422
|
-
var
|
|
7423
|
-
var
|
|
7498
|
+
var isRow4 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
7499
|
+
var idOf5 = (v) => typeof v === "string" && v !== "" ? v : null;
|
|
7424
7500
|
function spaceRows(elements) {
|
|
7425
7501
|
if (elements === null || elements === void 0) return null;
|
|
7426
7502
|
const space = mapSpace(elements);
|
|
7427
7503
|
const rawMaps = /* @__PURE__ */ new Map(), rawPins = /* @__PURE__ */ new Map();
|
|
7428
7504
|
for (const e of elements) {
|
|
7429
|
-
if (!
|
|
7430
|
-
const id =
|
|
7505
|
+
if (!isRow4(e) || typeof e.type !== "string") continue;
|
|
7506
|
+
const id = idOf5(e.id);
|
|
7431
7507
|
if (id === null) continue;
|
|
7432
7508
|
if (e.type === "map") rawMaps.set(id, e);
|
|
7433
7509
|
else if (e.type === "pin") rawPins.set(id, e);
|
|
@@ -9831,6 +9907,7 @@ export {
|
|
|
9831
9907
|
buildAskContext,
|
|
9832
9908
|
buildWorldIndex,
|
|
9833
9909
|
byCodePoint,
|
|
9910
|
+
carryOf,
|
|
9834
9911
|
charterOf,
|
|
9835
9912
|
compareInstants,
|
|
9836
9913
|
dateOf,
|