@onlyworlds/sdk 4.46.0 → 4.48.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 +111 -1
- package/dist/index.js +34 -0
- 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.48.0] - 2026-10-22
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `listHidden()`: `GET /world/hidden`, the world's hidden elements newest first as `OwHiddenRow[]` (`type`, `id`, `set_at`, `set_by`; keel #421). Any key of the owner's or a co-builder's; served with `Cache-Control: no-store`, so read it each time. For the parlor, whose host room marks what it hid (Temper, h66 #9778).
|
|
13
|
+
|
|
14
|
+
## [4.47.0] - 2026-10-22
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `draught(characterId, policy)`: `GET /character/{id}/context` (keel PR 155, D143, live 2026-10-22 02:05), one Character's context in one read, typed as `OwDraught` with the policy's seven keys (`components`, `mode`, `asOf`, `undated`, `since`, `budget`, `depth`) as `OwDraughtPolicy`.
|
|
18
|
+
- `list` takes `ids` (1 to 200, the list's own order; one the key cannot see is absent) and `createdBy` (a membership id, or `'owner'`), the two list filters of the same PR; both were already reachable through `filter`.
|
|
19
|
+
|
|
8
20
|
## [4.46.0] - 2026-10-22
|
|
9
21
|
|
|
10
22
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -1975,6 +1975,17 @@ interface OwChangeDelete {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
/** Why a /changes delete row says the element left the reader's view (keel #421). */
|
|
1977
1977
|
type OwDeleteReason = 'deleted' | 'hidden' | 'out_of_view';
|
|
1978
|
+
/** One row of GET /world/hidden (keel #421): an element the owner or a co-builder hid. */
|
|
1979
|
+
interface OwHiddenRow {
|
|
1980
|
+
/** The element's type. */
|
|
1981
|
+
type: ElementType | string;
|
|
1982
|
+
/** The element's id. */
|
|
1983
|
+
id: string;
|
|
1984
|
+
/** When it was hidden (ISO 8601). */
|
|
1985
|
+
set_at: string;
|
|
1986
|
+
/** The membership (a person's or a seat's) that hid it, or null when the world's owner did (as an element's `created_by`). */
|
|
1987
|
+
set_by: string | null;
|
|
1988
|
+
}
|
|
1978
1989
|
/**
|
|
1979
1990
|
* The door a write came through, as keel records it on every element (`changed_via`) and on a
|
|
1980
1991
|
* delete (`deleted_via`) since keel #299: `seat` (an agent seat), `mcp` (the MCP server),
|
|
@@ -2431,6 +2442,83 @@ interface OwSignedIn {
|
|
|
2431
2442
|
* (`'collaborator'`, with `member_role` the membership's role). Keys by name and last four only,
|
|
2432
2443
|
* never the key; on a shared world only the member's own keys (keel H8).
|
|
2433
2444
|
*/
|
|
2445
|
+
/** The draught's policy (keel PR 155, D143): what GET /character/{id}/context serves and how. */
|
|
2446
|
+
interface OwDraughtPolicy {
|
|
2447
|
+
/** Sections to serve; default every one but `messages`. */
|
|
2448
|
+
components?: OwDraughtComponent[];
|
|
2449
|
+
/** `voice`: her slice, as she would read (default). `act`: through the caller's own view. */
|
|
2450
|
+
mode?: 'voice' | 'act';
|
|
2451
|
+
/** The horizon in the world's time unit; default the world's `time_range_current`. */
|
|
2452
|
+
asOf?: number;
|
|
2453
|
+
/** Undated Events: `include` (default, marked `dated: false`, after the dated) or `exclude`. */
|
|
2454
|
+
undated?: 'include' | 'exclude';
|
|
2455
|
+
/** For `recent`: a /changes cursor, or an ISO 8601 time (as /changes' `after`). Absent, `recent` is empty. */
|
|
2456
|
+
since?: string;
|
|
2457
|
+
/** Items per section, 1 to 1000, default 50; `cut` says what was dropped. */
|
|
2458
|
+
budget?: number;
|
|
2459
|
+
/** The sheet's reach: 1 (default) what her own element links to, 0 none. */
|
|
2460
|
+
depth?: 0 | 1;
|
|
2461
|
+
}
|
|
2462
|
+
type OwDraughtComponent = 'self' | 'role' | 'work' | 'style' | 'events' | 'knowledge' | 'names' | 'sheet' | 'recent' | 'messages' | 'roster';
|
|
2463
|
+
/** An element as the draught serves it: the list route's body plus how it got here. */
|
|
2464
|
+
type OwDraughtItem = OwElement & {
|
|
2465
|
+
/** The link fields that brought it (on the element, or on her own element in `sheet`). */
|
|
2466
|
+
via: string[];
|
|
2467
|
+
/** How many of the packet's elements link to it. */
|
|
2468
|
+
her_links: number;
|
|
2469
|
+
grade: 'whole' | 'known_of';
|
|
2470
|
+
/** On an Event: false when it carries no date (ranked after the dated). */
|
|
2471
|
+
dated?: boolean;
|
|
2472
|
+
};
|
|
2473
|
+
/** One Character's context in one read, GET /character/{id}/context (keel PR 155, D143; the draught). */
|
|
2474
|
+
interface OwDraught {
|
|
2475
|
+
world: {
|
|
2476
|
+
id: string;
|
|
2477
|
+
name: string;
|
|
2478
|
+
description: string;
|
|
2479
|
+
};
|
|
2480
|
+
/** The world's own time fields, as it carries them. */
|
|
2481
|
+
calendar: Record<string, unknown>;
|
|
2482
|
+
as_of: number | null;
|
|
2483
|
+
now: number | null;
|
|
2484
|
+
mode: 'voice' | 'act';
|
|
2485
|
+
/** The policy served under, every key resolved. */
|
|
2486
|
+
policy: Record<string, unknown>;
|
|
2487
|
+
/** {section: items the budget dropped}; empty when whole. */
|
|
2488
|
+
cut: Record<string, number>;
|
|
2489
|
+
recent_cursor: string | null;
|
|
2490
|
+
recent_more: boolean | null;
|
|
2491
|
+
/** Her own element (`self: true`), or a stub when this reader knows her only as known of. */
|
|
2492
|
+
character: (OwElement & {
|
|
2493
|
+
self: true;
|
|
2494
|
+
grade: 'whole' | 'known_of';
|
|
2495
|
+
}) | null;
|
|
2496
|
+
role?: OwDraughtItem[];
|
|
2497
|
+
work?: OwDraughtItem[];
|
|
2498
|
+
style?: OwDraughtItem | null;
|
|
2499
|
+
events?: OwDraughtItem[];
|
|
2500
|
+
knowledge?: OwDraughtItem[];
|
|
2501
|
+
/** Everything else that names her, by type. */
|
|
2502
|
+
names?: Record<string, OwDraughtItem[]>;
|
|
2503
|
+
sheet?: OwDraughtItem[];
|
|
2504
|
+
messages?: OwDraughtItem[];
|
|
2505
|
+
recent?: Array<{
|
|
2506
|
+
op: 'upsert' | 'delete';
|
|
2507
|
+
type: string;
|
|
2508
|
+
id: string;
|
|
2509
|
+
when: string | null;
|
|
2510
|
+
who: string | null;
|
|
2511
|
+
[k: string]: unknown;
|
|
2512
|
+
}>;
|
|
2513
|
+
roster?: Array<{
|
|
2514
|
+
id: string | null;
|
|
2515
|
+
kind: string;
|
|
2516
|
+
role: string;
|
|
2517
|
+
character: string | null;
|
|
2518
|
+
status: string;
|
|
2519
|
+
name: string;
|
|
2520
|
+
}>;
|
|
2521
|
+
}
|
|
2434
2522
|
interface OwAccountWorld {
|
|
2435
2523
|
id: string;
|
|
2436
2524
|
name: string;
|
|
@@ -2639,6 +2727,10 @@ interface OwFileDownload {
|
|
|
2639
2727
|
interface ListParams {
|
|
2640
2728
|
limit?: number;
|
|
2641
2729
|
cursor?: string;
|
|
2730
|
+
/** Only these ids (1 to 200), in the list's own order; one this key cannot see is simply absent (keel PR 155). */
|
|
2731
|
+
ids?: string[];
|
|
2732
|
+
/** A membership id, or `'owner'` for the owner's own writes: only what that member created (keel PR 155). */
|
|
2733
|
+
createdBy?: string;
|
|
2642
2734
|
/** One-level stub expansion, e.g. ['friends', 'location']. */
|
|
2643
2735
|
expand?: string[];
|
|
2644
2736
|
/** Sparse include-set of field names. */
|
|
@@ -3065,6 +3157,18 @@ declare class OwV2Client {
|
|
|
3065
3157
|
members(): Promise<OwMember[]>;
|
|
3066
3158
|
/** GET /{type}/ -- one cursor page. */
|
|
3067
3159
|
list(type: ElementType | string, params?: ListParams): Promise<OwPage>;
|
|
3160
|
+
/**
|
|
3161
|
+
* GET /character/{id}/context -- the draught (keel PR 155, D143): what one Character knows, as the
|
|
3162
|
+
* recorded world holds it, in one read: her element, what she holds and sits in, her open work,
|
|
3163
|
+
* how she works, the Events she was in, the Narratives she knows, everything else that names
|
|
3164
|
+
* her, her sheet, what changed around her (`since`), and who plays whom; the world's name and
|
|
3165
|
+
* calendar beside. Every body is the list route's for the same reader, with `via`, `her_links`
|
|
3166
|
+
* and `grade`; nothing is inferred. The owner's keys, co-builders and contributors for any
|
|
3167
|
+
* Character they can see; a player seat or a guest for its own Character only (another id is
|
|
3168
|
+
* 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
|
|
3169
|
+
* empty means the serving is partial. Served `Cache-Control: private, no-store`.
|
|
3170
|
+
*/
|
|
3171
|
+
draught(characterId: string, policy?: OwDraughtPolicy): Promise<OwDraught>;
|
|
3068
3172
|
/** Cursor-walk every page of a type. Politeness: uses config pageSize. */
|
|
3069
3173
|
listAll(type: ElementType | string, params?: Omit<ListParams, 'cursor'>): AsyncGenerator<OwElement>;
|
|
3070
3174
|
/**
|
|
@@ -3529,6 +3633,12 @@ declare class OwV2Client {
|
|
|
3529
3633
|
hide(type: ElementType | string, id: string): Promise<void>;
|
|
3530
3634
|
/** DELETE /{type}/{id}/hidden -- clear the mark; an element that is not hidden stays as it is. 204. */
|
|
3531
3635
|
unhide(type: ElementType | string, id: string): Promise<void>;
|
|
3636
|
+
/**
|
|
3637
|
+
* GET /world/hidden -- every hidden element of the world, newest first: `{type, id, set_at,
|
|
3638
|
+
* set_by}` each (`set_by` null when the owner hid it). Any key of the owner's or a co-builder's;
|
|
3639
|
+
* any other key is a 403. Served with `Cache-Control: no-store`: read it each time, keep no copy.
|
|
3640
|
+
*/
|
|
3641
|
+
listHidden(): Promise<OwHiddenRow[]>;
|
|
3532
3642
|
/**
|
|
3533
3643
|
* GET /account/worlds -- every world the account owns or is a member of, with its keys by
|
|
3534
3644
|
* name and last four (a member sees only their own keys on a shared world). Account token only.
|
|
@@ -4607,4 +4717,4 @@ declare class TokenResource {
|
|
|
4607
4717
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
4608
4718
|
}
|
|
4609
4719
|
|
|
4610
|
-
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, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, 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 OwMintedKey, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, 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, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, 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, 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, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
|
4720
|
+
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, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, 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 OwMintedKey, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, 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, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, 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, 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, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -559,11 +559,36 @@ var OwV2Client = class {
|
|
|
559
559
|
cursor: params.cursor,
|
|
560
560
|
expand: params.expand?.join(","),
|
|
561
561
|
fields: params.fields?.join(","),
|
|
562
|
+
ids: params.ids?.join(","),
|
|
563
|
+
created_by: params.createdBy,
|
|
562
564
|
...params.filter,
|
|
563
565
|
as: params.viewAs
|
|
564
566
|
});
|
|
565
567
|
return this.request("GET", `/${type}/`, { query });
|
|
566
568
|
}
|
|
569
|
+
/**
|
|
570
|
+
* GET /character/{id}/context -- the draught (keel PR 155, D143): what one Character knows, as the
|
|
571
|
+
* recorded world holds it, in one read: her element, what she holds and sits in, her open work,
|
|
572
|
+
* how she works, the Events she was in, the Narratives she knows, everything else that names
|
|
573
|
+
* her, her sheet, what changed around her (`since`), and who plays whom; the world's name and
|
|
574
|
+
* calendar beside. Every body is the list route's for the same reader, with `via`, `her_links`
|
|
575
|
+
* and `grade`; nothing is inferred. The owner's keys, co-builders and contributors for any
|
|
576
|
+
* Character they can see; a player seat or a guest for its own Character only (another id is
|
|
577
|
+
* 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
|
|
578
|
+
* empty means the serving is partial. Served `Cache-Control: private, no-store`.
|
|
579
|
+
*/
|
|
580
|
+
async draught(characterId, policy = {}) {
|
|
581
|
+
const query = buildQuery({
|
|
582
|
+
components: policy.components?.join(","),
|
|
583
|
+
mode: policy.mode,
|
|
584
|
+
as_of: policy.asOf,
|
|
585
|
+
undated: policy.undated,
|
|
586
|
+
since: policy.since,
|
|
587
|
+
budget: policy.budget,
|
|
588
|
+
depth: policy.depth
|
|
589
|
+
});
|
|
590
|
+
return this.request("GET", `/character/${characterId}/context`, { query });
|
|
591
|
+
}
|
|
567
592
|
/** Cursor-walk every page of a type. Politeness: uses config pageSize. */
|
|
568
593
|
async *listAll(type, params = {}) {
|
|
569
594
|
let cursor;
|
|
@@ -1302,6 +1327,15 @@ var OwV2Client = class {
|
|
|
1302
1327
|
async unhide(type, id) {
|
|
1303
1328
|
await this.request("DELETE", `/${type}/${id}/hidden`, { write: true, allowEmpty: true });
|
|
1304
1329
|
}
|
|
1330
|
+
/**
|
|
1331
|
+
* GET /world/hidden -- every hidden element of the world, newest first: `{type, id, set_at,
|
|
1332
|
+
* set_by}` each (`set_by` null when the owner hid it). Any key of the owner's or a co-builder's;
|
|
1333
|
+
* any other key is a 403. Served with `Cache-Control: no-store`: read it each time, keep no copy.
|
|
1334
|
+
*/
|
|
1335
|
+
async listHidden() {
|
|
1336
|
+
const page = await this.request("GET", "/world/hidden");
|
|
1337
|
+
return page.data;
|
|
1338
|
+
}
|
|
1305
1339
|
// -- The account's worlds and keys (account token) -----------------------
|
|
1306
1340
|
/**
|
|
1307
1341
|
* GET /account/worlds -- every world the account owns or is a member of, with its keys by
|