@onlyworlds/sdk 4.118.0 → 4.119.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 +10 -0
- package/SCHEMA.md +1 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +54 -3
- 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.33.0-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.98** (canonical 00.33.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,16 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.119.0] - 2026-10-30
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`strandOf(world, reader)`, the strand profile's reader** (schema-dist serial 98, `profiles/strand.md`). A strand is a world in miniature: one story, one of its happenings, where that happened, the story's hero and where the hero is now, read off four links the standard already has. The World's mark `x_strand` (exported as `STRAND_FIELD`) is an object of three ids, `{narrative, event, location}`; any other shape is no mark. `strandOf` answers `{narrative, event, location, character, now, same}` as `reader` sees the world, each filled slot `{id, name}` and an empty one `null`: `narrative` is the marked Narrative; `event` the marked Event when it is in the story's `events`; `location` the marked Location when it is in that event's `locations`; `character` the story's `protagonist`; `now` the hero's `location`; `same` true when `now` and `location` are one place (compared by id), false when two, else `null`. A slot holds only its own kind, no list order is read, and no slot is filled from another. The world and the reader are `resolveLens`'s (`OwStrandWorld`, `OwLensReader`), so every slot is read through that reader's view and the bodies it is served: a story the reader knows only as a stub fills its own slot and nothing past it, and a public reader reads nothing of a world that is not open. Types `OwStrand`, `OwStrandSlot`. All 17 of the profile's fixture cases are the test.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **The schema pin moves to schema-dist serial 98** (`v0.33.0-dist.98`), which adds the strand profile and its fixture. No schema file moved: the generated output changes only its provenance lines.
|
|
17
|
+
|
|
8
18
|
## [4.118.0] - 2026-10-30
|
|
9
19
|
|
|
10
20
|
### Added
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.98** — canonical schema **00.33.00**, published 2026-10-30.
|
|
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
|
@@ -5346,6 +5346,57 @@ declare function charterOf(world: OwCharterWorld, reader: OwLensReader): OwReadi
|
|
|
5346
5346
|
/** The marked Domains alone, as `charterOf` lists them for the same reader. */
|
|
5347
5347
|
declare function domainsOf(world: OwCharterWorld, reader: OwLensReader): OwReadingAidsDomain[];
|
|
5348
5348
|
|
|
5349
|
+
/** The World's field that carries the strand's mark. */
|
|
5350
|
+
declare const STRAND_FIELD = "x_strand";
|
|
5351
|
+
/** The world snapshot a strand is read from: the lens reader's world, the World's mark, and whether it is open to anyone. */
|
|
5352
|
+
interface OwStrandWorld extends OwLensWorld {
|
|
5353
|
+
/** The mark, `{narrative, event, location}`, three ids; any other shape is no mark. */
|
|
5354
|
+
x_strand?: unknown;
|
|
5355
|
+
/** True for a world open to anyone: only then does the public rung read anything of it. */
|
|
5356
|
+
open?: boolean | null;
|
|
5357
|
+
}
|
|
5358
|
+
/** A filled slot. */
|
|
5359
|
+
interface OwStrandSlot {
|
|
5360
|
+
id: string;
|
|
5361
|
+
name: string;
|
|
5362
|
+
}
|
|
5363
|
+
/** A world's strand as one reader sees it: five slots and whether then and now are one place. An empty slot is null. */
|
|
5364
|
+
interface OwStrand {
|
|
5365
|
+
/** The story: the Narrative the mark names. */
|
|
5366
|
+
narrative: OwStrandSlot | null;
|
|
5367
|
+
/** The happening: the Event the mark names, when it is in the story's `events`. */
|
|
5368
|
+
event: OwStrandSlot | null;
|
|
5369
|
+
/** The place, then: the Location the mark names, when it is in the event's `locations`. */
|
|
5370
|
+
location: OwStrandSlot | null;
|
|
5371
|
+
/** The hero: the story's `protagonist`. */
|
|
5372
|
+
character: OwStrandSlot | null;
|
|
5373
|
+
/** The place, now: the hero's `location`. */
|
|
5374
|
+
now: OwStrandSlot | null;
|
|
5375
|
+
/** True when `now` and `location` are both filled and one place, false when both filled and two, null otherwise. */
|
|
5376
|
+
same: boolean | null;
|
|
5377
|
+
}
|
|
5378
|
+
/**
|
|
5379
|
+
* A world's strand as `reader` sees it (schema-dist profiles/strand.md): `{narrative, event, location, character,
|
|
5380
|
+
* now, same}`, each filled slot `{id, name}` and an empty one null.
|
|
5381
|
+
*
|
|
5382
|
+
* `narrative` is the element the mark names when it is a Narrative in the reader's view; with none, every slot is
|
|
5383
|
+
* empty. `event` is the element the mark names when it is an Event in the reader's view and in the story's `events`
|
|
5384
|
+
* as the reader is served them; `location` the element the mark names when it is a Location in the reader's view and
|
|
5385
|
+
* in that event's `locations`, empty when the event is. `character` is the story's `protagonist` when it is a
|
|
5386
|
+
* Character in the reader's view; `now` the hero's `location` when it is a Location in the reader's view, empty when
|
|
5387
|
+
* the hero is. `same` is true when `now` and `location` are both filled with one id, false when with two, else null.
|
|
5388
|
+
* A list's order is never read, and no slot is filled from another: not the hero from the event's `characters`, not
|
|
5389
|
+
* `location` from `now`, not `now` from `location`. Any mark that is not an object of three non-empty strings is no
|
|
5390
|
+
* mark, and the strand is empty.
|
|
5391
|
+
*
|
|
5392
|
+
* `world` holds the elements as the owner is served them (the hidden in `hidden` or each element's own `hidden`),
|
|
5393
|
+
* the World's `x_strand`, and `open: true` for a world open to anyone; `reader` is a lens reader (`OwLensReader`):
|
|
5394
|
+
* the owner, a contributor, a guest (its `whole` and `known_of` ids) or the public, which reads nothing of a world
|
|
5395
|
+
* that is not open. A slot's links are read from the body the reader is served, so a story known only as a stub
|
|
5396
|
+
* fills its own slot and nothing past it. Pure.
|
|
5397
|
+
*/
|
|
5398
|
+
declare function strandOf(world: OwStrandWorld, reader: OwLensReader): OwStrand;
|
|
5399
|
+
|
|
5349
5400
|
/**
|
|
5350
5401
|
* The review profile's proposed mark (schema-dist profiles/review.md): an element whose
|
|
5351
5402
|
* `x_review_proposed` is an object was written as proposed (an AI seat's new element on a world
|
|
@@ -6828,4 +6879,4 @@ declare class TokenResource {
|
|
|
6828
6879
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
6829
6880
|
}
|
|
6830
6881
|
|
|
6831
|
-
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 OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, 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 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 OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwPage, 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 OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, 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 OwTool, type OwToolNeeds, type OwToolOpen, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, 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, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, TOOLS, 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, lensesInUse, lookupWorld, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, readingAidOf, recipientsOf, renderElement, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, senderStatus, simpleCaseFold, threadOf, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
6882
|
+
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 OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, 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 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 OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwPage, 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 OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, 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 OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, 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, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, 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, lensesInUse, lookupWorld, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, readingAidOf, recipientsOf, renderElement, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, senderStatus, simpleCaseFold, strandOf, threadOf, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -3435,6 +3435,55 @@ function domainsOf(world, reader) {
|
|
|
3435
3435
|
return charterOf(world, reader).domains;
|
|
3436
3436
|
}
|
|
3437
3437
|
|
|
3438
|
+
// src/strand.ts
|
|
3439
|
+
var STRAND_FIELD = "x_strand";
|
|
3440
|
+
var SLOTS = ["narrative", "event", "location"];
|
|
3441
|
+
var EMPTY = () => ({ narrative: null, event: null, location: null, character: null, now: null, same: null });
|
|
3442
|
+
function markOf(value) {
|
|
3443
|
+
if (!isBody2(value)) return null;
|
|
3444
|
+
const v = value;
|
|
3445
|
+
for (const slot of SLOTS) {
|
|
3446
|
+
if (typeof v[slot] !== "string" || v[slot] === "") return null;
|
|
3447
|
+
}
|
|
3448
|
+
return { narrative: v.narrative, event: v.event, location: v.location };
|
|
3449
|
+
}
|
|
3450
|
+
function strandOf(world, reader) {
|
|
3451
|
+
if (!isBody2(world) || !Array.isArray(world.elements)) {
|
|
3452
|
+
throw new TypeError("strandOf: world is an object with an elements list.");
|
|
3453
|
+
}
|
|
3454
|
+
checkReader(reader, "strandOf: reader");
|
|
3455
|
+
const out = EMPTY();
|
|
3456
|
+
const mark = markOf(world[STRAND_FIELD]);
|
|
3457
|
+
if (mark === null) return out;
|
|
3458
|
+
const r = new Reading(world, reader, null);
|
|
3459
|
+
if (r.seenRung === "public" && world.open !== true) return out;
|
|
3460
|
+
const seen = (id, type) => typeof id === "string" && r.view.has(id) && r.typeOf.get(id) === type;
|
|
3461
|
+
const slot = (id) => {
|
|
3462
|
+
const name = r.body(id).name;
|
|
3463
|
+
return { id, name: typeof name === "string" ? name : "" };
|
|
3464
|
+
};
|
|
3465
|
+
const listed = (holder, field, id) => {
|
|
3466
|
+
const v = r.body(holder)[field];
|
|
3467
|
+
return Array.isArray(v) && v.includes(id);
|
|
3468
|
+
};
|
|
3469
|
+
if (!seen(mark.narrative, "narrative")) return out;
|
|
3470
|
+
out.narrative = slot(mark.narrative);
|
|
3471
|
+
if (seen(mark.event, "event") && listed(mark.narrative, "events", mark.event)) {
|
|
3472
|
+
out.event = slot(mark.event);
|
|
3473
|
+
if (seen(mark.location, "location") && listed(mark.event, "locations", mark.location)) {
|
|
3474
|
+
out.location = slot(mark.location);
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
const hero = r.body(mark.narrative).protagonist;
|
|
3478
|
+
if (seen(hero, "character")) {
|
|
3479
|
+
out.character = slot(hero);
|
|
3480
|
+
const now = r.body(hero).location;
|
|
3481
|
+
if (seen(now, "location")) out.now = slot(now);
|
|
3482
|
+
}
|
|
3483
|
+
if (out.now !== null && out.location !== null) out.same = out.now.id === out.location.id;
|
|
3484
|
+
return out;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3438
3487
|
// src/graph.ts
|
|
3439
3488
|
var GRAPH_OPTION_KEYS = ["lens", "asOf", "clock", "rooms", "hidden", "proposed", "mapSpace"];
|
|
3440
3489
|
var DECLARED_LINKS = ["x_lens_leads_to", "x_spine_depends_on"];
|
|
@@ -4734,7 +4783,7 @@ function readOptions(opts) {
|
|
|
4734
4783
|
}
|
|
4735
4784
|
function buildAskContext(items, index, opts = {}) {
|
|
4736
4785
|
const o = readOptions(opts);
|
|
4737
|
-
const
|
|
4786
|
+
const markOf2 = (el) => {
|
|
4738
4787
|
if (!o.includeHidden && isHidden(el)) return "hidden";
|
|
4739
4788
|
if (!o.includeProposed && isProposed(el)) return "proposed";
|
|
4740
4789
|
if (!o.includeRoom && isRoomElement(el)) return "room";
|
|
@@ -4742,7 +4791,7 @@ function buildAskContext(items, index, opts = {}) {
|
|
|
4742
4791
|
};
|
|
4743
4792
|
const withheld = (id) => {
|
|
4744
4793
|
const el = index.byId.get(id);
|
|
4745
|
-
return el !== void 0 &&
|
|
4794
|
+
return el !== void 0 && markOf2(el) !== null;
|
|
4746
4795
|
};
|
|
4747
4796
|
const viewFor = (el) => {
|
|
4748
4797
|
const out2 = index.out.get(el.id) ?? [];
|
|
@@ -4760,7 +4809,7 @@ function buildAskContext(items, index, opts = {}) {
|
|
|
4760
4809
|
let full = false;
|
|
4761
4810
|
for (const item of items) {
|
|
4762
4811
|
const el = item && typeof item === "object" && "element" in item ? item.element : item;
|
|
4763
|
-
const mark =
|
|
4812
|
+
const mark = markOf2(el);
|
|
4764
4813
|
if (mark) {
|
|
4765
4814
|
out.leftOut[mark].push(el.id);
|
|
4766
4815
|
continue;
|
|
@@ -5839,6 +5888,7 @@ export {
|
|
|
5839
5888
|
REVIEW_PROPOSED_LABEL,
|
|
5840
5889
|
ROOM_PAIRS,
|
|
5841
5890
|
SPATIAL_TYPES,
|
|
5891
|
+
STRAND_FIELD,
|
|
5842
5892
|
TOOLS,
|
|
5843
5893
|
TokenResource,
|
|
5844
5894
|
WORLD_FILE_MAX_BYTES,
|
|
@@ -5924,6 +5974,7 @@ export {
|
|
|
5924
5974
|
resolveLens,
|
|
5925
5975
|
senderStatus,
|
|
5926
5976
|
simpleCaseFold,
|
|
5977
|
+
strandOf,
|
|
5927
5978
|
threadOf,
|
|
5928
5979
|
typeWord,
|
|
5929
5980
|
unreadFor,
|