@onlyworlds/sdk 4.169.2 → 4.170.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 +13 -0
- package/SCHEMA.md +1 -1
- package/dist/index.d.ts +22 -3
- package/dist/index.js +56 -32
- 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.132** (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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.170.0] - 2026-11-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`unplacedByKind` and `unplacedAround`: what a saved default layout does not place.** Given the graph and the ids of the elements a layout Map's Pins stand for (a list or a Set), each answers the ids its method would place that the Map has no Pin for, by id in code point order: for `by-kind` every node of the graph, for `around` the focus and every node within its steps. An id among the placed ones that the method would not place is no part of the answer. A tool shows the answer's length as its count; neither function places anything.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **The schema pin moves to `v0.34.1-dist.132`** (canonical 00.34.01 unchanged; no schema file moved). The distribution gains the layout profile: the page for the two default methods, `by-kind` and `around`, and for what a saved layout does not place, with its fixture. The map-space profile's rule 8 names it, and says that reading or drawing a layout map changes nothing of its layout.
|
|
17
|
+
- **A method's word is its version.** The layout profile rules that a method which changes takes a new word, so a saved layout says what made it by `method` alone. The answers of `layoutByKind` and `layoutAround` keep `version: 1` as it is; their comments now say to read `method`.
|
|
18
|
+
- Tests: the layout tests read the profile's own fixture from the pinned distribution (`profiles/layout.fixture.json`); the package's copy, the same bytes, is removed.
|
|
19
|
+
- Tests: the layout fixture gains eight cases for `layoutByKind` and `layoutAround` (an index of ten or more ordered by number, an edge with no field, one with no index, an edge to an id that is no node, the same link twice, names where code point order and UTF-16 order differ, a null name beside an absent one, two steps past sixty neighbours) and a suite for the two new readings. No answer of a released function changes.
|
|
20
|
+
|
|
8
21
|
## [4.169.2] - 2026-11-15
|
|
9
22
|
|
|
10
23
|
### 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.1-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.132** — canonical schema **00.34.01**, published 2026-11-16.
|
|
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
|
@@ -6722,6 +6722,7 @@ interface OwLayoutPoint {
|
|
|
6722
6722
|
/** What `layoutByKind` answers: one point per node, in the graph's node order, and the method that made them. */
|
|
6723
6723
|
interface OwLayoutByKind {
|
|
6724
6724
|
method: 'by-kind';
|
|
6725
|
+
/** Always 1. A method's word is its version: a method that changes takes a new word, so read `method`, never this number. */
|
|
6725
6726
|
version: 1;
|
|
6726
6727
|
points: OwLayoutPoint[];
|
|
6727
6728
|
}
|
|
@@ -6736,6 +6737,7 @@ interface OwLayoutAroundPoint {
|
|
|
6736
6737
|
/** What `layoutAround` answers: the focus and every element within the steps, in the graph's node order. */
|
|
6737
6738
|
interface OwLayoutAround {
|
|
6738
6739
|
method: 'around';
|
|
6740
|
+
/** Always 1. A method's word is its version: a method that changes takes a new word, so read `method`, never this number. */
|
|
6739
6741
|
version: 1;
|
|
6740
6742
|
points: OwLayoutAroundPoint[];
|
|
6741
6743
|
}
|
|
@@ -6754,7 +6756,7 @@ interface OwLayoutAroundOptions {
|
|
|
6754
6756
|
*
|
|
6755
6757
|
* The graph is first put in one order (nodes by id; links by source, field, index, then target), so the order the
|
|
6756
6758
|
* nodes and links are handed in moves nothing. Answers one point per node in the order the nodes were handed in, with
|
|
6757
|
-
* the method's name
|
|
6759
|
+
* the method's name (`by-kind`; the word is the method's version, and `version` stays 1), so a saved layout can say what made it. An empty graph answers no points; a graph of one element answers 0, 0.
|
|
6758
6760
|
* The same graph gives the same points to the last bit in every browser and language: the anchors are a baked
|
|
6759
6761
|
* table of numbers, never computed, and the rest is arithmetic every runtime rounds alike. Self-links pull nothing;
|
|
6760
6762
|
* a link to an id that is not a node is passed over. Throws a TypeError, naming what, on a graph it cannot read:
|
|
@@ -6769,12 +6771,29 @@ declare function layoutByKind(graph: OwLayoutGraph): OwLayoutByKind;
|
|
|
6769
6771
|
*
|
|
6770
6772
|
* The graph is first put in one order, as `layoutByKind` puts it, so the order the nodes and links are handed in
|
|
6771
6773
|
* moves nothing. Answers the focus and every element within the steps, in the order the nodes were handed in, each
|
|
6772
|
-
* with its depth (0, 1 or 2), and the method's name
|
|
6774
|
+
* with its depth (0, 1 or 2), and the method's name (`around`; the word is the method's version, and `version` stays 1). Nothing iterates, so each point is one cosine and one sine of an
|
|
6773
6775
|
* angle the method computes exactly; runtimes agree to within about 1e-12. Throws a TypeError on an unknown option
|
|
6774
6776
|
* (before anything else), a `steps` that is not 1 or 2, a graph it cannot read (as `layoutByKind`), or a focus that
|
|
6775
6777
|
* is not one of the graph's nodes.
|
|
6776
6778
|
*/
|
|
6777
6779
|
declare function layoutAround(graph: OwLayoutGraph, focus: string, options?: OwLayoutAroundOptions): OwLayoutAround;
|
|
6780
|
+
/**
|
|
6781
|
+
* What a saved `by-kind` layout map does not place (the default layouts' page, `unplaced`): the ids of the graph's
|
|
6782
|
+
* nodes that are not in `placed`, by id in code point order. `placed` is the ids of the elements the Map's Pins
|
|
6783
|
+
* stand for, a list or a Set: from `mapSpace`, the `element_id` of each pin whose `map` is this Map. A member that
|
|
6784
|
+
* is not a non-empty string (a Pin that stands for no element) is passed over, and an id that is no node of the
|
|
6785
|
+
* graph is no part of the answer. The answer's length is the count a tool shows; it does not say why an element has
|
|
6786
|
+
* no Pin, and a saved layout map changes only when a person asks (the map-space profile's rule 8). Throws a
|
|
6787
|
+
* TypeError on a graph it cannot read (as `layoutByKind`) or a `placed` that is not a list or a Set.
|
|
6788
|
+
*/
|
|
6789
|
+
declare function unplacedByKind(graph: OwLayoutGraph, placed: Iterable<unknown>): string[];
|
|
6790
|
+
/**
|
|
6791
|
+
* What a saved `around` layout map does not place: the ids of the focus and every node within the steps that are
|
|
6792
|
+
* not in `placed`, by id in code point order. `placed` is read as `unplacedByKind` reads it; an id in it that
|
|
6793
|
+
* `around` would not place (no node, or a node further out than the steps) is no part of the answer. Throws as
|
|
6794
|
+
* `layoutAround` does, and on a `placed` that is not a list or a Set.
|
|
6795
|
+
*/
|
|
6796
|
+
declare function unplacedAround(graph: OwLayoutGraph, focus: string, placed: Iterable<unknown>, options?: OwLayoutAroundOptions): string[];
|
|
6778
6797
|
|
|
6779
6798
|
/** One word pair of a names map: `one` for a single thing, `many` for a plural (absent: `one`). */
|
|
6780
6799
|
interface OwWordPair {
|
|
@@ -8117,4 +8136,4 @@ declare class TokenResource {
|
|
|
8117
8136
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
8118
8137
|
}
|
|
8119
8138
|
|
|
8120
|
-
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, DECLARED_LINKS, 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, type OwAddressAt, OwAddressError, type OwAddressForm, type OwAddressFound, 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 OwInstant, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayoutAround, type OwLayoutAroundOptions, type OwLayoutAroundPoint, type OwLayoutByKind, type OwLayoutGraph, type OwLayoutOf, type OwLayoutPoint, 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 OwReportGroup, type OwReportLine, type OwReportLineOptions, type OwReportLint, type OwReportParentKind, type OwReportThreads, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSearchResult, type OwSearchResults, 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, compareInstants, dateOf, degreeOf, 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, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, 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, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
8139
|
+
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, DECLARED_LINKS, 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, type OwAddressAt, OwAddressError, type OwAddressForm, type OwAddressFound, 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 OwInstant, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayoutAround, type OwLayoutAroundOptions, type OwLayoutAroundPoint, type OwLayoutByKind, type OwLayoutGraph, type OwLayoutOf, type OwLayoutPoint, 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 OwReportGroup, type OwReportLine, type OwReportLineOptions, type OwReportLint, type OwReportParentKind, type OwReportThreads, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSearchResult, type OwSearchResults, 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, compareInstants, dateOf, degreeOf, 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, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, 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, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unplacedAround, unplacedByKind, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -5305,38 +5305,7 @@ function layoutByKind(graph) {
|
|
|
5305
5305
|
};
|
|
5306
5306
|
}
|
|
5307
5307
|
function layoutAround(graph, focus, options) {
|
|
5308
|
-
|
|
5309
|
-
throw new TypeError("layoutAround: options is an object, { steps }");
|
|
5310
|
-
}
|
|
5311
|
-
refuseUnknownOptions("layoutAround", options, ["steps"]);
|
|
5312
|
-
const steps = options?.steps ?? 1;
|
|
5313
|
-
if (steps !== 1 && steps !== 2) throw new TypeError(`layoutAround: steps is 1 or 2, not ${String(steps)}`);
|
|
5314
|
-
const { nodes: N, edges: links, index } = readGraph("layoutAround", graph);
|
|
5315
|
-
const centre = typeof focus === "string" ? index.get(focus) : void 0;
|
|
5316
|
-
if (centre === void 0) throw new TypeError(`layoutAround: the focus ${String(focus)} is not a node of the graph`);
|
|
5317
|
-
const adj = N.map(() => []);
|
|
5318
|
-
for (const e of links) {
|
|
5319
|
-
const a = index.get(e.source);
|
|
5320
|
-
const b = index.get(e.target);
|
|
5321
|
-
if (a === void 0 || b === void 0) continue;
|
|
5322
|
-
adj[a].push(b);
|
|
5323
|
-
if (a !== b) adj[b].push(a);
|
|
5324
|
-
}
|
|
5325
|
-
const depth = /* @__PURE__ */ new Map([[centre, 0]]);
|
|
5326
|
-
const via = /* @__PURE__ */ new Map();
|
|
5327
|
-
let frontier = [centre];
|
|
5328
|
-
for (let s = 1; s <= steps; s++) {
|
|
5329
|
-
const next = [];
|
|
5330
|
-
for (const a of frontier) {
|
|
5331
|
-
for (const to of adj[a]) {
|
|
5332
|
-
if (depth.has(to)) continue;
|
|
5333
|
-
depth.set(to, s);
|
|
5334
|
-
via.set(to, a);
|
|
5335
|
-
next.push(to);
|
|
5336
|
-
}
|
|
5337
|
-
}
|
|
5338
|
-
frontier = next;
|
|
5339
|
-
}
|
|
5308
|
+
const { N, index, centre, depth, via } = reachAround("layoutAround", graph, focus, options);
|
|
5340
5309
|
const name = (j) => N[j].name ?? "";
|
|
5341
5310
|
const ring1 = [...depth].filter(([, s]) => s === 1).map(([j]) => j).sort((a, b) => groupRank(N[a].type) - groupRank(N[b].type) || byCodePoint(N[a].type, N[b].type) || byCodePoint(name(a), name(b)) || a - b);
|
|
5342
5311
|
const at = /* @__PURE__ */ new Map([[centre, [0, 0]]]);
|
|
@@ -5384,6 +5353,59 @@ function layoutAround(graph, focus, options) {
|
|
|
5384
5353
|
}
|
|
5385
5354
|
return { method: "around", version: 1, points };
|
|
5386
5355
|
}
|
|
5356
|
+
function reachAround(fn, graph, focus, options) {
|
|
5357
|
+
if (options !== void 0 && options !== null && (typeof options !== "object" || Array.isArray(options))) {
|
|
5358
|
+
throw new TypeError(`${fn}: options is an object, { steps }`);
|
|
5359
|
+
}
|
|
5360
|
+
refuseUnknownOptions(fn, options, ["steps"]);
|
|
5361
|
+
const steps = options?.steps ?? 1;
|
|
5362
|
+
if (steps !== 1 && steps !== 2) throw new TypeError(`${fn}: steps is 1 or 2, not ${String(steps)}`);
|
|
5363
|
+
const { nodes: N, edges: links, index } = readGraph(fn, graph);
|
|
5364
|
+
const centre = typeof focus === "string" ? index.get(focus) : void 0;
|
|
5365
|
+
if (centre === void 0) throw new TypeError(`${fn}: the focus ${String(focus)} is not a node of the graph`);
|
|
5366
|
+
const adj = N.map(() => []);
|
|
5367
|
+
for (const e of links) {
|
|
5368
|
+
const a = index.get(e.source);
|
|
5369
|
+
const b = index.get(e.target);
|
|
5370
|
+
if (a === void 0 || b === void 0) continue;
|
|
5371
|
+
adj[a].push(b);
|
|
5372
|
+
if (a !== b) adj[b].push(a);
|
|
5373
|
+
}
|
|
5374
|
+
const depth = /* @__PURE__ */ new Map([[centre, 0]]);
|
|
5375
|
+
const via = /* @__PURE__ */ new Map();
|
|
5376
|
+
let frontier = [centre];
|
|
5377
|
+
for (let s = 1; s <= steps; s++) {
|
|
5378
|
+
const next = [];
|
|
5379
|
+
for (const a of frontier) {
|
|
5380
|
+
for (const to of adj[a]) {
|
|
5381
|
+
if (depth.has(to)) continue;
|
|
5382
|
+
depth.set(to, s);
|
|
5383
|
+
via.set(to, a);
|
|
5384
|
+
next.push(to);
|
|
5385
|
+
}
|
|
5386
|
+
}
|
|
5387
|
+
frontier = next;
|
|
5388
|
+
}
|
|
5389
|
+
return { N, index, centre, depth, via };
|
|
5390
|
+
}
|
|
5391
|
+
function placedIds(fn, placed) {
|
|
5392
|
+
if (placed === null || placed === void 0 || typeof placed === "string" || typeof placed[Symbol.iterator] !== "function") {
|
|
5393
|
+
throw new TypeError(`${fn}: placed is a list or a Set of element ids`);
|
|
5394
|
+
}
|
|
5395
|
+
const ids = /* @__PURE__ */ new Set();
|
|
5396
|
+
for (const v of placed) if (typeof v === "string" && v !== "") ids.add(v);
|
|
5397
|
+
return ids;
|
|
5398
|
+
}
|
|
5399
|
+
function unplacedByKind(graph, placed) {
|
|
5400
|
+
const ids = placedIds("unplacedByKind", placed);
|
|
5401
|
+
const { nodes } = readGraph("unplacedByKind", graph);
|
|
5402
|
+
return nodes.map((x) => x.id).filter((id) => !ids.has(id));
|
|
5403
|
+
}
|
|
5404
|
+
function unplacedAround(graph, focus, placed, options) {
|
|
5405
|
+
const { N, depth } = reachAround("unplacedAround", graph, focus, options);
|
|
5406
|
+
const ids = placedIds("unplacedAround", placed);
|
|
5407
|
+
return N.filter((x, j) => depth.has(j) && !ids.has(x.id)).map((x) => x.id);
|
|
5408
|
+
}
|
|
5387
5409
|
|
|
5388
5410
|
// src/drag.ts
|
|
5389
5411
|
var TYPES = new Set(ELEMENT_TYPES);
|
|
@@ -7837,6 +7859,8 @@ export {
|
|
|
7837
7859
|
threadOf,
|
|
7838
7860
|
trailByPlace,
|
|
7839
7861
|
typeWord,
|
|
7862
|
+
unplacedAround,
|
|
7863
|
+
unplacedByKind,
|
|
7840
7864
|
unreadFor,
|
|
7841
7865
|
validateCalendarConfig,
|
|
7842
7866
|
viewOf,
|