@onlyworlds/sdk 4.118.0 → 4.120.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 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.97** (canonical 00.33.00).
3
+ **Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.99** (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,27 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.120.0] - 2026-10-31
9
+
10
+ ### Changed
11
+
12
+ - **A strand begins when its story is chosen** (schema-dist serial 99). `x_strand` needs only `narrative`: `event` and `location` may each be `null` or absent, read as unset, so a world whose story is chosen before its happening and place reads as a strand begun, the story, hero and now filled and the other slots empty. A place named with no event is an empty place. The value is still no mark when `narrative` is missing or not a non-empty string, or when `event` or `location` is anything but a non-empty string, `null` or absent (an empty string, a number, an object), so a broken writer never shows as a half-built strand. `strandOf` reads every case of the serial's 26-case fixture.
13
+ - **The schema pin moves to schema-dist serial 99** (`v0.33.0-dist.99`). No schema file moved.
14
+
15
+ ### Fixed
16
+
17
+ - **No `X-OW-Agent` on hide, unhide, `setMyCharacter` and `mintWorldKey`.** An `agent: true` client sent the header on these four, where the API document declares none and the server reads none. It now sends it only where the document lists it: the element writes, the links route, `bulk`, `adopt` and the file ticket.
18
+
19
+ ## [4.119.0] - 2026-10-30
20
+
21
+ ### Added
22
+
23
+ - **`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.
24
+
25
+ ### Changed
26
+
27
+ - **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.
28
+
8
29
  ## [4.118.0] - 2026-10-30
9
30
 
10
31
  ### 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.97** — canonical schema **00.33.00**, published 2026-10-30.
3
+ **Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.99** — 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
@@ -4809,7 +4809,7 @@ declare class OwV2Client {
4809
4809
  allowEmpty?: boolean;
4810
4810
  replayAware?: boolean;
4811
4811
  /** A `change_seq` to send as `If-Match`; a whole number, else TypeError before sending. */
4812
- /** A write keel's document lists X-OW-Agent on (the element writes, hide and unhide, the file ticket, setMyCharacter, mintWorldKey): where an agent client sends it. */
4812
+ /** A write keel's document lists X-OW-Agent on (the element writes, the links route, bulk, adopt, the file ticket): where an agent client sends it. Hide, unhide, setMyCharacter and mintWorldKey are not, and keel reads no agent there. */
4813
4813
  write?: boolean;
4814
4814
  /** One of the writes keel reads X-OW-Client on (create, put, patch, delete, links, bulk, adopt, propose, accept): where the client's name goes. */
4815
4815
  elementWrite?: boolean;
@@ -5346,6 +5346,59 @@ 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}`: the story's id, the other two ids or unset (null or absent); 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`. Only the story is required: `event` and `location` null or
5390
+ * absent read as unset (a strand begun, its empty slots the next thing to make), and a place with no event is an
5391
+ * empty place. A mark whose `narrative` is not a non-empty string, or whose `event` or `location` is anything but a
5392
+ * non-empty string, null or absent, is no mark, and the strand is empty.
5393
+ *
5394
+ * `world` holds the elements as the owner is served them (the hidden in `hidden` or each element's own `hidden`),
5395
+ * the World's `x_strand`, and `open: true` for a world open to anyone; `reader` is a lens reader (`OwLensReader`):
5396
+ * the owner, a contributor, a guest (its `whole` and `known_of` ids) or the public, which reads nothing of a world
5397
+ * 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
5398
+ * fills its own slot and nothing past it. Pure.
5399
+ */
5400
+ declare function strandOf(world: OwStrandWorld, reader: OwLensReader): OwStrand;
5401
+
5349
5402
  /**
5350
5403
  * The review profile's proposed mark (schema-dist profiles/review.md): an element whose
5351
5404
  * `x_review_proposed` is an object was written as proposed (an AI seat's new element on a world
@@ -6828,4 +6881,4 @@ declare class TokenResource {
6828
6881
  getEncryptionInfo(): Promise<EncryptionInfo>;
6829
6882
  }
6830
6883
 
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 };
6884
+ 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
@@ -773,7 +773,7 @@ var OwV2Client = class {
773
773
  if (this.keyKind === "account") {
774
774
  throw new TypeError("setMyCharacter needs a world key: an account token is not a member of one world");
775
775
  }
776
- return this.request("PUT", "/me/character", { write: true, body: { character } });
776
+ return this.request("PUT", "/me/character", { body: { character } });
777
777
  }
778
778
  /**
779
779
  * PUT /me/lenses -- choose the lenses this key's holder starts with: lens ids in order, 0 to 20,
@@ -1714,11 +1714,11 @@ var OwV2Client = class {
1714
1714
  * lists, search, counts and the link arrays that name it. 204, no body. No Idempotency-Key.
1715
1715
  */
1716
1716
  async hide(type, id) {
1717
- await this.request("PUT", `/${type}/${id}/hidden`, { write: true, body: {}, allowEmpty: true });
1717
+ await this.request("PUT", `/${type}/${id}/hidden`, { body: {}, allowEmpty: true });
1718
1718
  }
1719
1719
  /** DELETE /{type}/{id}/hidden -- clear the mark; an element that is not hidden stays as it is. 204. */
1720
1720
  async unhide(type, id) {
1721
- await this.request("DELETE", `/${type}/${id}/hidden`, { write: true, allowEmpty: true });
1721
+ await this.request("DELETE", `/${type}/${id}/hidden`, { allowEmpty: true });
1722
1722
  }
1723
1723
  /**
1724
1724
  * GET /world/hidden -- every hidden element of the world, newest first: `{type, id, set_at,
@@ -1928,7 +1928,7 @@ var OwV2Client = class {
1928
1928
  if (opts.scope !== void 0) body.scope = opts.scope;
1929
1929
  if (opts.name !== void 0) body.name = opts.name;
1930
1930
  if (opts.keep !== void 0) body.keep = opts.keep;
1931
- return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { write: true, body });
1931
+ return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { body });
1932
1932
  }
1933
1933
  /**
1934
1934
  * DELETE /account/worlds/{worldId}/keys/{keyId} -- revoke a world key, by the `id` mintWorldKey
@@ -3435,6 +3435,59 @@ 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 EMPTY = () => ({ narrative: null, event: null, location: null, character: null, now: null, same: null });
3441
+ function optionalId(value) {
3442
+ if (value === null || value === void 0) return null;
3443
+ return typeof value === "string" && value !== "" ? value : void 0;
3444
+ }
3445
+ function markOf(value) {
3446
+ if (!isBody2(value)) return null;
3447
+ const v = value;
3448
+ if (typeof v.narrative !== "string" || v.narrative === "") return null;
3449
+ const event = optionalId(v.event);
3450
+ const location = optionalId(v.location);
3451
+ if (event === void 0 || location === void 0) return null;
3452
+ return { narrative: v.narrative, event, location };
3453
+ }
3454
+ function strandOf(world, reader) {
3455
+ if (!isBody2(world) || !Array.isArray(world.elements)) {
3456
+ throw new TypeError("strandOf: world is an object with an elements list.");
3457
+ }
3458
+ checkReader(reader, "strandOf: reader");
3459
+ const out = EMPTY();
3460
+ const mark = markOf(world[STRAND_FIELD]);
3461
+ if (mark === null) return out;
3462
+ const r = new Reading(world, reader, null);
3463
+ if (r.seenRung === "public" && world.open !== true) return out;
3464
+ const seen = (id, type) => typeof id === "string" && r.view.has(id) && r.typeOf.get(id) === type;
3465
+ const slot = (id) => {
3466
+ const name = r.body(id).name;
3467
+ return { id, name: typeof name === "string" ? name : "" };
3468
+ };
3469
+ const listed = (holder, field, id) => {
3470
+ const v = r.body(holder)[field];
3471
+ return Array.isArray(v) && v.includes(id);
3472
+ };
3473
+ if (!seen(mark.narrative, "narrative")) return out;
3474
+ out.narrative = slot(mark.narrative);
3475
+ if (seen(mark.event, "event") && listed(mark.narrative, "events", mark.event)) {
3476
+ out.event = slot(mark.event);
3477
+ if (seen(mark.location, "location") && listed(mark.event, "locations", mark.location)) {
3478
+ out.location = slot(mark.location);
3479
+ }
3480
+ }
3481
+ const hero = r.body(mark.narrative).protagonist;
3482
+ if (seen(hero, "character")) {
3483
+ out.character = slot(hero);
3484
+ const now = r.body(hero).location;
3485
+ if (seen(now, "location")) out.now = slot(now);
3486
+ }
3487
+ if (out.now !== null && out.location !== null) out.same = out.now.id === out.location.id;
3488
+ return out;
3489
+ }
3490
+
3438
3491
  // src/graph.ts
3439
3492
  var GRAPH_OPTION_KEYS = ["lens", "asOf", "clock", "rooms", "hidden", "proposed", "mapSpace"];
3440
3493
  var DECLARED_LINKS = ["x_lens_leads_to", "x_spine_depends_on"];
@@ -4734,7 +4787,7 @@ function readOptions(opts) {
4734
4787
  }
4735
4788
  function buildAskContext(items, index, opts = {}) {
4736
4789
  const o = readOptions(opts);
4737
- const markOf = (el) => {
4790
+ const markOf2 = (el) => {
4738
4791
  if (!o.includeHidden && isHidden(el)) return "hidden";
4739
4792
  if (!o.includeProposed && isProposed(el)) return "proposed";
4740
4793
  if (!o.includeRoom && isRoomElement(el)) return "room";
@@ -4742,7 +4795,7 @@ function buildAskContext(items, index, opts = {}) {
4742
4795
  };
4743
4796
  const withheld = (id) => {
4744
4797
  const el = index.byId.get(id);
4745
- return el !== void 0 && markOf(el) !== null;
4798
+ return el !== void 0 && markOf2(el) !== null;
4746
4799
  };
4747
4800
  const viewFor = (el) => {
4748
4801
  const out2 = index.out.get(el.id) ?? [];
@@ -4760,7 +4813,7 @@ function buildAskContext(items, index, opts = {}) {
4760
4813
  let full = false;
4761
4814
  for (const item of items) {
4762
4815
  const el = item && typeof item === "object" && "element" in item ? item.element : item;
4763
- const mark = markOf(el);
4816
+ const mark = markOf2(el);
4764
4817
  if (mark) {
4765
4818
  out.leftOut[mark].push(el.id);
4766
4819
  continue;
@@ -5839,6 +5892,7 @@ export {
5839
5892
  REVIEW_PROPOSED_LABEL,
5840
5893
  ROOM_PAIRS,
5841
5894
  SPATIAL_TYPES,
5895
+ STRAND_FIELD,
5842
5896
  TOOLS,
5843
5897
  TokenResource,
5844
5898
  WORLD_FILE_MAX_BYTES,
@@ -5924,6 +5978,7 @@ export {
5924
5978
  resolveLens,
5925
5979
  senderStatus,
5926
5980
  simpleCaseFold,
5981
+ strandOf,
5927
5982
  threadOf,
5928
5983
  typeWord,
5929
5984
  unreadFor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.118.0",
3
+ "version": "4.120.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {