@onlyworlds/sdk 4.82.0 → 4.83.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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +44 -4
- package/dist/index.js +28 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.83.0] - 2026-10-26
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **The review profile's readers: `proposedMarkOf`, `handsOnAsProposed`, `PROPOSED_MARK` and `OwProposedMark`.** An element whose `x_review_proposed` is an object was written as proposed and is not canon until a keeper settles it. `proposedMarkOf(element, today?)` gives the mark as a reader that shows a world shows it, `{ by, expires, lapsed }`, or null for a settled element (absent, null, or a value that is not an object); `by` and `expires` are trimmed of Unicode White_Space as the room profile trims, `expires` is read only as a day (YYYY-MM-DD, ASCII digits), and `lapsed` is true from that day on, in UTC as keel reads it (`today` defaults to today in UTC; a `today` that is not a day is a TypeError). `handsOnAsProposed(element)` is what a reader that hands a world on leaves out: `x_review_proposed` with any value but absent or null, so a malformed value (a doubt) is left out too (the profile's rule 4). `buildAskContext` now reads the same function. The profile has no fixture yet; the tests hold 17 cases, the Python package's `tests/test_review.py` the same ones, including one per language default that would read differently (a byte order mark, U+001C, Arabic-Indic digits).
|
|
13
|
+
|
|
14
|
+
## [4.82.1] - 2026-10-26
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **The draught's words follow keel's 2026-10-26 change.** Under `compact: true` every element body in the packet now leaves out each field whose value is `null`, `""`, `[]` or `{}` (`id`, `type` and `name` always stay; `0` and `false` are values and stay), so a compact body is the list route's body less its empty fields, not byte for byte the same. And a Message without the room mark is placed as any Narrative unless `messages` is named, when it is in `messages` and no other section; a room-marked Message is in `messages` or nowhere. The doc comments on `draught()`, `OwDraughtItem.element` and `OwDraughtCompact` said the body was the list route's exactly; they now say both rules. Types only in words: `OwElement` already lets every field but `id`, `type` and `name` be absent, so no type changed.
|
|
19
|
+
|
|
8
20
|
## [4.82.0] - 2026-10-26
|
|
9
21
|
|
|
10
22
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -2822,11 +2822,11 @@ interface OwDraughtItem {
|
|
|
2822
2822
|
grade: 'whole' | 'known_of';
|
|
2823
2823
|
/** In `events` and `knowledge`: false when it carries no date (ranked after the dated). */
|
|
2824
2824
|
dated?: boolean;
|
|
2825
|
-
/** The element's body
|
|
2825
|
+
/** The element's body as the list route serves it to the same reader; under `compact`, less each field that is null, "", [] or {} (`id`, `type` and `name` always stay): read a missing field as empty. */
|
|
2826
2826
|
element: OwElement;
|
|
2827
2827
|
}
|
|
2828
2828
|
/** One Character's context in one read, GET /character/{id}/context (the draught). */
|
|
2829
|
-
/** The draught under `compact`: every section may be absent, and so may `cut` (nothing was cut). */
|
|
2829
|
+
/** The draught under `compact`: every section may be absent, and so may `cut` (nothing was cut); each element body leaves out its empty fields, `id`, `type` and `name` kept. */
|
|
2830
2830
|
type OwDraughtCompact = Omit<OwDraught, 'cut'> & {
|
|
2831
2831
|
cut?: Record<string, number>;
|
|
2832
2832
|
};
|
|
@@ -3706,7 +3706,10 @@ declare class OwV2Client {
|
|
|
3706
3706
|
* 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
|
|
3707
3707
|
* empty means the serving is partial (`cut.proposed` also counts proposed elements left out because
|
|
3708
3708
|
* the component was not named). `compact: true` leaves out every empty section and an empty `cut`,
|
|
3709
|
-
* the frame and every null kept,
|
|
3709
|
+
* the frame and every null kept, and leaves out each element body's empty fields (`null`, `""`,
|
|
3710
|
+
* `[]`, `{}`; `id`, `type` and `name` always stay), answered as `OwDraughtCompact`. A Message
|
|
3711
|
+
* without the room mark is placed as any Narrative unless `messages` is named, when it is there
|
|
3712
|
+
* and in no other section; a room-marked Message is in `messages` or nowhere. Served
|
|
3710
3713
|
* `Cache-Control: private, no-store`.
|
|
3711
3714
|
*/
|
|
3712
3715
|
draught(characterId: string, policy?: OwDraughtPolicy & {
|
|
@@ -4649,6 +4652,43 @@ declare function unreadFor<T extends object>(messages: readonly T[], characterId
|
|
|
4649
4652
|
*/
|
|
4650
4653
|
declare function threadOf<T extends object>(messages: readonly T[], rootId: string): T[];
|
|
4651
4654
|
|
|
4655
|
+
/**
|
|
4656
|
+
* The review profile's proposed mark (schema-dist profiles/review.md): an element whose
|
|
4657
|
+
* `x_review_proposed` is an object was written as proposed (an AI seat's new element on a world
|
|
4658
|
+
* whose keeper reviews them) and is not canon until a keeper settles it: accept writes the mark
|
|
4659
|
+
* null, decline deletes the element.
|
|
4660
|
+
*
|
|
4661
|
+
* Two readings, as the profile's rule 1 and rule 4 give them. A reader that shows a world to its
|
|
4662
|
+
* people shows the mark when it is an object (`proposedMarkOf`); any other value is not a mark and
|
|
4663
|
+
* is reported by a lint, never repaired. A reader that hands a world on leaves out every element
|
|
4664
|
+
* whose `x_review_proposed` is anything but absent or null (`handsOnAsProposed`), so a doubt never
|
|
4665
|
+
* reaches an AI as canon.
|
|
4666
|
+
*/
|
|
4667
|
+
/** The review profile's proposed mark, an extension key. */
|
|
4668
|
+
declare const PROPOSED_MARK = "x_review_proposed";
|
|
4669
|
+
/** A proposed element's mark as a reader shows it. */
|
|
4670
|
+
interface OwProposedMark {
|
|
4671
|
+
/** The membership or seat that proposed it, trimmed of Unicode White_Space as the room profile trims, when the mark names one. */
|
|
4672
|
+
by: string | null;
|
|
4673
|
+
/** The day it lapses (YYYY-MM-DD), trimmed, when the mark gives one in that shape. */
|
|
4674
|
+
expires: string | null;
|
|
4675
|
+
/** `expires` has come (on or before `today`): shown as lapsed, never deleted on its own (rule 2). */
|
|
4676
|
+
lapsed: boolean;
|
|
4677
|
+
}
|
|
4678
|
+
/**
|
|
4679
|
+
* The proposed mark of an element as a reader that shows a world shows it, or null for a settled
|
|
4680
|
+
* element: `x_review_proposed` absent, null, or a value that is not an object (an array included).
|
|
4681
|
+
* `today` is a day as the profile writes one (YYYY-MM-DD), by default today in UTC; anything else
|
|
4682
|
+
* is a TypeError.
|
|
4683
|
+
*/
|
|
4684
|
+
declare function proposedMarkOf(element: unknown, today?: string): OwProposedMark | null;
|
|
4685
|
+
/**
|
|
4686
|
+
* Whether a reader that hands a world on (a pack, a context packet, an AI's context) leaves this
|
|
4687
|
+
* element out as proposed: `x_review_proposed` with any value but absent or null, a value that is
|
|
4688
|
+
* not a proper mark included (a doubt, counted with the proposed).
|
|
4689
|
+
*/
|
|
4690
|
+
declare function handsOnAsProposed(element: unknown): boolean;
|
|
4691
|
+
|
|
4652
4692
|
/** One word pair of a names map: `one` for a single thing, `many` for a plural (absent: `one`). */
|
|
4653
4693
|
interface OwWordPair {
|
|
4654
4694
|
one: string;
|
|
@@ -5694,4 +5734,4 @@ declare class TokenResource {
|
|
|
5694
5734
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
5695
5735
|
}
|
|
5696
5736
|
|
|
5697
|
-
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, MESSAGE_PAIR, ONLYWORLDS_VERSION, type OwAccountWorld, 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 OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMessageMember, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, 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 OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, 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 OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, 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, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, 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, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, intercalaryInYear, isAddressedTo, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isMessage, isParseError, isRoomElement, isSentBy, isToEveryone, kindCanWrite, lookupWorld, monthStartSteps, nfc, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, recipientsOf, renderElement, resolveCalendarLens, resolveEraDomains, senderStatus, simpleCaseFold, threadOf, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
|
5737
|
+
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, MESSAGE_PAIR, ONLYWORLDS_VERSION, type OwAccountWorld, 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 OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMessageMember, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, 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 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 OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, 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, 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, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, handsOnAsProposed, intercalaryInYear, isAddressedTo, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isMessage, isParseError, isRoomElement, isSentBy, isToEveryone, kindCanWrite, lookupWorld, monthStartSteps, nfc, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, recipientsOf, renderElement, resolveCalendarLens, resolveEraDomains, senderStatus, simpleCaseFold, threadOf, typeWord, unreadFor, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -3781,6 +3781,30 @@ function threadOf(messages, rootId) {
|
|
|
3781
3781
|
return inCreatedOrder(messages.filter((m) => isBody(m) && reaches(m)));
|
|
3782
3782
|
}
|
|
3783
3783
|
|
|
3784
|
+
// src/review.ts
|
|
3785
|
+
var PROPOSED_MARK = "x_review_proposed";
|
|
3786
|
+
var DAY = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
|
|
3787
|
+
function todayDay() {
|
|
3788
|
+
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
3789
|
+
}
|
|
3790
|
+
function proposedMarkOf(element, today) {
|
|
3791
|
+
if (today !== void 0 && (typeof today !== "string" || !DAY.test(today))) {
|
|
3792
|
+
throw new TypeError(`proposedMarkOf: today is a day as YYYY-MM-DD; got ${JSON.stringify(today) ?? String(today)}.`);
|
|
3793
|
+
}
|
|
3794
|
+
if (!element || typeof element !== "object") return null;
|
|
3795
|
+
const v = element[PROPOSED_MARK];
|
|
3796
|
+
if (!v || typeof v !== "object" || Array.isArray(v)) return null;
|
|
3797
|
+
const m = v;
|
|
3798
|
+
const by = typeof m.by === "string" && trimWhiteSpace(m.by) ? trimWhiteSpace(m.by) : null;
|
|
3799
|
+
const expires = typeof m.expires === "string" && DAY.test(trimWhiteSpace(m.expires)) ? trimWhiteSpace(m.expires) : null;
|
|
3800
|
+
return { by, expires, lapsed: expires !== null && expires <= (today ?? todayDay()) };
|
|
3801
|
+
}
|
|
3802
|
+
function handsOnAsProposed(element) {
|
|
3803
|
+
if (!element || typeof element !== "object") return false;
|
|
3804
|
+
const v = element[PROPOSED_MARK];
|
|
3805
|
+
return v !== void 0 && v !== null;
|
|
3806
|
+
}
|
|
3807
|
+
|
|
3784
3808
|
// src/names.ts
|
|
3785
3809
|
var SLUGS = new Set(ELEMENT_TYPES);
|
|
3786
3810
|
var OPTION_KEYS = ["supertype", "many"];
|
|
@@ -4298,7 +4322,7 @@ var ASK_OPTION_KEYS = ["includeProposed", "includeHidden", "includeRoom"];
|
|
|
4298
4322
|
var chars = (s) => [...s].length;
|
|
4299
4323
|
var cut = (s, n) => [...s].slice(0, n).join("");
|
|
4300
4324
|
var isHidden = (el) => el.hidden !== void 0 && el.hidden !== null && el.hidden !== false;
|
|
4301
|
-
var isProposed = (el) => el
|
|
4325
|
+
var isProposed = (el) => handsOnAsProposed(el);
|
|
4302
4326
|
function readOptions(opts) {
|
|
4303
4327
|
refuseUnknownOptions("buildAskContext", opts, ASK_OPTION_KEYS);
|
|
4304
4328
|
const o = opts ?? {};
|
|
@@ -5163,6 +5187,7 @@ export {
|
|
|
5163
5187
|
OwWorldFileError,
|
|
5164
5188
|
PHOTO_MAX_BYTES,
|
|
5165
5189
|
PHOTO_TYPES,
|
|
5190
|
+
PROPOSED_MARK,
|
|
5166
5191
|
PUBLIC_FIELDS,
|
|
5167
5192
|
REVIEW_PROPOSED_LABEL,
|
|
5168
5193
|
ROOM_PAIRS,
|
|
@@ -5194,6 +5219,7 @@ export {
|
|
|
5194
5219
|
formatYearLabel,
|
|
5195
5220
|
getElementIcon,
|
|
5196
5221
|
getElementLabel,
|
|
5222
|
+
handsOnAsProposed,
|
|
5197
5223
|
intercalaryInYear,
|
|
5198
5224
|
isAddressedTo,
|
|
5199
5225
|
isAgentDoor,
|
|
@@ -5215,6 +5241,7 @@ export {
|
|
|
5215
5241
|
pkceChallenge,
|
|
5216
5242
|
planPhoto,
|
|
5217
5243
|
preparePhoto,
|
|
5244
|
+
proposedMarkOf,
|
|
5218
5245
|
readCalendarConfig,
|
|
5219
5246
|
readCalendarValue,
|
|
5220
5247
|
readMarkOf,
|