@onlyworlds/sdk 4.16.0 → 4.18.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 +23 -0
- package/dist/index.d.ts +101 -2
- package/dist/index.js +22 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,27 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.18.0] — 2026-10-12
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **`client.sort({ worldId, notes, slice })`**: POST /account/sort, ask's sibling (Temper for
|
|
12
|
+
Lantern, h37 #3599; Skeld's route, #3591, #3594, #3596, #3597). Notes as words or
|
|
13
|
+
`{ text, image_url }`; the slice is the app's own lookup. Rows of four kinds come back to
|
|
14
|
+
review (`make`, `add_to`, `link`, `ask` with an optional `then`) and `not_proposed` with
|
|
15
|
+
reasons; nothing is written. One allowance with `ask`, and the same refusals. Types
|
|
16
|
+
`OwSortRef`, `OwSortNote`, `OwSortRow` and its four kinds, `OwSortAnswer`. Built against
|
|
17
|
+
keel PR #4 (90961fa, Skeld's final for the types, #3618), released once it was on keel
|
|
18
|
+
main and in production (#3663): verify-sdk-wire PASS 1,111 against production's document.
|
|
19
|
+
|
|
20
|
+
## [4.17.0] — 2026-10-12
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- **`changesAll` returns `epoch`** beside `cursor` and `head`: the last page's, so a full walk
|
|
24
|
+
says which view epoch it ran under (a guest's integer; `null` for other keys or a keel
|
|
25
|
+
without the field) and the first poll after it needs no extra walk to learn it. Live on
|
|
26
|
+
Moppetopia: a full walk of 465 changes returns `{ cursor, head: 818, epoch: null }`. The first
|
|
27
|
+
tests of `changesAll`'s return value (Temper, h29 #3534).
|
|
28
|
+
|
|
8
29
|
## [4.16.0] — 2026-10-12
|
|
9
30
|
|
|
10
31
|
### Added
|
|
@@ -16,6 +37,8 @@ earlier history lives in git log only.
|
|
|
16
37
|
page both carry `epoch: null`). The wire gate now holds `OwChangesPage` and `OwBulkResponse`
|
|
17
38
|
to keel's `ChangesPage` and `BulkResult` (keel #108), and failed on 4.15.0 for the missing
|
|
18
39
|
`epoch` before this release.
|
|
40
|
+
Published from tag `v4.16.0`; the workflow's read-back gave up before npm showed the
|
|
41
|
+
version, so the tarball (shasum `d08de22b`) was read back by hand against a build of the tag.
|
|
19
42
|
|
|
20
43
|
## [4.15.0] — 2026-10-12
|
|
21
44
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2013,6 +2013,87 @@ interface OwAskAnswer {
|
|
|
2013
2013
|
remaining: number;
|
|
2014
2014
|
[k: string]: unknown;
|
|
2015
2015
|
}
|
|
2016
|
+
/**
|
|
2017
|
+
* One element the notes may be about, as POST /account/sort takes it (the slice), and as a
|
|
2018
|
+
* row names it back: keel copies a target's name, type and anchor from the slice, never
|
|
2019
|
+
* from the model. `type` is lowercase going in; keel answers with its own spelling.
|
|
2020
|
+
*/
|
|
2021
|
+
interface OwSortRef {
|
|
2022
|
+
id: string;
|
|
2023
|
+
type: string;
|
|
2024
|
+
name: string;
|
|
2025
|
+
/** A short phrase that tells two same-named elements apart (up to 120 characters). */
|
|
2026
|
+
anchor?: string;
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* A note for sorting: its words, or an object with words and/or a picture already uploaded
|
|
2030
|
+
* into this world (`https://media.onlyworlds.com/u/<world id>/<name>`, no query). An object
|
|
2031
|
+
* needs at least one of the two; the picture is read as a photographed note.
|
|
2032
|
+
*/
|
|
2033
|
+
type OwSortNote = string | {
|
|
2034
|
+
text?: string;
|
|
2035
|
+
image_url?: string | null;
|
|
2036
|
+
};
|
|
2037
|
+
/** A new element the notes describe. */
|
|
2038
|
+
interface OwSortMakeRow {
|
|
2039
|
+
kind: 'make';
|
|
2040
|
+
source_line: string;
|
|
2041
|
+
proposal: {
|
|
2042
|
+
type: string;
|
|
2043
|
+
name: string;
|
|
2044
|
+
description: string;
|
|
2045
|
+
};
|
|
2046
|
+
}
|
|
2047
|
+
/** Text to append to a field of a slice element. */
|
|
2048
|
+
interface OwSortAddToRow {
|
|
2049
|
+
kind: 'add_to';
|
|
2050
|
+
source_line: string;
|
|
2051
|
+
target: OwSortRef;
|
|
2052
|
+
field: string;
|
|
2053
|
+
op: 'append';
|
|
2054
|
+
value: string;
|
|
2055
|
+
}
|
|
2056
|
+
/** A link from one slice element to another, through a named field. */
|
|
2057
|
+
interface OwSortLinkRow {
|
|
2058
|
+
kind: 'link';
|
|
2059
|
+
source_line: string;
|
|
2060
|
+
target: OwSortRef;
|
|
2061
|
+
field: string;
|
|
2062
|
+
value_id: string;
|
|
2063
|
+
value_name: string;
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
* A question for the user: a name matches two or more slice elements, or the sorter is
|
|
2067
|
+
* unsure a thing exists. `then`, when sent, is the add_to or link the question stands for,
|
|
2068
|
+
* its target left out: the user's pick fills it.
|
|
2069
|
+
*/
|
|
2070
|
+
interface OwSortAskRow {
|
|
2071
|
+
kind: 'ask';
|
|
2072
|
+
source_line: string;
|
|
2073
|
+
question: string;
|
|
2074
|
+
candidates: OwSortRef[];
|
|
2075
|
+
then?: Omit<OwSortAddToRow, 'source_line' | 'target'> | Omit<OwSortLinkRow, 'source_line' | 'target'>;
|
|
2076
|
+
}
|
|
2077
|
+
type OwSortRow = OwSortMakeRow | OwSortAddToRow | OwSortLinkRow | OwSortAskRow;
|
|
2078
|
+
/** POST /account/sort: proposed changes for the user to review. Nothing is written to the world. */
|
|
2079
|
+
interface OwSortAnswer {
|
|
2080
|
+
/** Every id in a row is from the request's slice. */
|
|
2081
|
+
rows: OwSortRow[];
|
|
2082
|
+
/** The lines the sorter could not place, and rows keel refused, each with a reason. */
|
|
2083
|
+
not_proposed: {
|
|
2084
|
+
source_line: string;
|
|
2085
|
+
reason: string;
|
|
2086
|
+
}[];
|
|
2087
|
+
model: string;
|
|
2088
|
+
stop_reason: string | null;
|
|
2089
|
+
usage: {
|
|
2090
|
+
input_tokens: number;
|
|
2091
|
+
output_tokens: number;
|
|
2092
|
+
};
|
|
2093
|
+
/** Questions the account has left today: a sort counts as one ask. */
|
|
2094
|
+
remaining: number;
|
|
2095
|
+
[k: string]: unknown;
|
|
2096
|
+
}
|
|
2016
2097
|
/** POST /join/preview: what a join code holds, read without using it (keel #212). */
|
|
2017
2098
|
interface OwJoinPreview {
|
|
2018
2099
|
/** `person`: an invite link, accepted with acceptJoin. `agent`: redeemed by an AI agent at POST /join. */
|
|
@@ -2388,11 +2469,13 @@ declare class OwV2Client {
|
|
|
2388
2469
|
/**
|
|
2389
2470
|
* Walk the feed from `since` (or from zero = full export) to the current
|
|
2390
2471
|
* tail, yielding ops in order. Returns the final cursor via the generator's
|
|
2391
|
-
* return value; persist it for the next incremental pull
|
|
2472
|
+
* return value; persist it for the next incremental pull (with the last page's
|
|
2473
|
+
* `head` and `epoch`: the view epoch the walk ran under, for a guest).
|
|
2392
2474
|
*/
|
|
2393
2475
|
changesAll(since?: string): AsyncGenerator<OwChange, {
|
|
2394
2476
|
cursor: string;
|
|
2395
2477
|
head: number;
|
|
2478
|
+
epoch: number | null;
|
|
2396
2479
|
}>;
|
|
2397
2480
|
/**
|
|
2398
2481
|
* POST /media/ticket -- permission to upload ONE image into this world (a write
|
|
@@ -2484,6 +2567,22 @@ declare class OwV2Client {
|
|
|
2484
2567
|
question: string;
|
|
2485
2568
|
context: string[];
|
|
2486
2569
|
}): Promise<OwAskAnswer>;
|
|
2570
|
+
/**
|
|
2571
|
+
* POST /account/sort -- the user's unsorted notes, and the elements the app's own search
|
|
2572
|
+
* found for them (`slice`: id, lowercase type, name, optional anchor; build it from
|
|
2573
|
+
* lookupWorld's hits), sorted by the same proxy as ask into rows to review: `make`, `add_to`,
|
|
2574
|
+
* `link`, `ask`. Nothing is written; the app applies what the user accepts. Every id in a
|
|
2575
|
+
* row is from the slice; keel moves any other row to `not_proposed` with its reason.
|
|
2576
|
+
* A sort counts as one ask: the same account token, allowance and refusals as ask. 422
|
|
2577
|
+
* names the param: notes 1 to 8, each up to 4,000 characters and 16,000 in all (text
|
|
2578
|
+
* only), at most four pictures, each uploaded into this world; slice up to 100, names up
|
|
2579
|
+
* to 200 characters, anchors up to 120.
|
|
2580
|
+
*/
|
|
2581
|
+
sort(req: {
|
|
2582
|
+
worldId: string;
|
|
2583
|
+
notes: OwSortNote[];
|
|
2584
|
+
slice: OwSortRef[];
|
|
2585
|
+
}): Promise<OwSortAnswer>;
|
|
2487
2586
|
/**
|
|
2488
2587
|
* Raw authenticated request against this client's baseUrl. Public since 4.0
|
|
2489
2588
|
* so auxiliary resources can ride the same transport — it structurally
|
|
@@ -3164,4 +3263,4 @@ declare class TokenResource {
|
|
|
3164
3263
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
3165
3264
|
}
|
|
3166
3265
|
|
|
3167
|
-
export { ASK_LIMITS, type AccessKeyResponse, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, FAMILY_COLORS, FAMILY_ORDER, FIELD_SCHEMA, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwChange, type OwChangesPage, type OwClientConfig, type OwElement, type OwElementBase, type OwErrorBody, type OwJoinPreview, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMediaTicket, type OwMemberRole, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldIndex, type OwWorldMeta, PHOTO_MAX_BYTES, PHOTO_TYPES, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, buildAskContext, buildWorldIndex, detectKeyKind, elementColor, errorFromResponse, familyOf, getElementIcon, getElementLabel, isDemoKey, kindCanWrite, lookupWorld, parseErrorEnvelope, pinExpectation, planPhoto, preparePhoto, readWorldFile, renderElement, writeWorldFile };
|
|
3266
|
+
export { ASK_LIMITS, type AccessKeyResponse, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, FAMILY_COLORS, FAMILY_ORDER, FIELD_SCHEMA, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwChange, type OwChangesPage, type OwClientConfig, type OwElement, type OwElementBase, type OwErrorBody, type OwJoinPreview, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMediaTicket, type OwMemberRole, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldIndex, type OwWorldMeta, PHOTO_MAX_BYTES, PHOTO_TYPES, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, buildAskContext, buildWorldIndex, detectKeyKind, elementColor, errorFromResponse, familyOf, getElementIcon, getElementLabel, isDemoKey, kindCanWrite, lookupWorld, parseErrorEnvelope, pinExpectation, planPhoto, preparePhoto, readWorldFile, renderElement, writeWorldFile };
|
package/dist/index.js
CHANGED
|
@@ -347,7 +347,8 @@ var OwV2Client = class {
|
|
|
347
347
|
/**
|
|
348
348
|
* Walk the feed from `since` (or from zero = full export) to the current
|
|
349
349
|
* tail, yielding ops in order. Returns the final cursor via the generator's
|
|
350
|
-
* return value; persist it for the next incremental pull
|
|
350
|
+
* return value; persist it for the next incremental pull (with the last page's
|
|
351
|
+
* `head` and `epoch`: the view epoch the walk ran under, for a guest).
|
|
351
352
|
*/
|
|
352
353
|
async *changesAll(since) {
|
|
353
354
|
let cursor = since;
|
|
@@ -357,7 +358,7 @@ var OwV2Client = class {
|
|
|
357
358
|
for (const op of page.changes) yield op;
|
|
358
359
|
cursor = page.cursor;
|
|
359
360
|
} while (page.has_more);
|
|
360
|
-
return { cursor: page.cursor, head: page.head };
|
|
361
|
+
return { cursor: page.cursor, head: page.head, epoch: page.epoch ?? null };
|
|
361
362
|
}
|
|
362
363
|
// -- Images ---------------------------------------------------------------
|
|
363
364
|
/**
|
|
@@ -493,6 +494,25 @@ var OwV2Client = class {
|
|
|
493
494
|
body: { world_id: req.worldId, question: req.question, context: req.context }
|
|
494
495
|
});
|
|
495
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* POST /account/sort -- the user's unsorted notes, and the elements the app's own search
|
|
499
|
+
* found for them (`slice`: id, lowercase type, name, optional anchor; build it from
|
|
500
|
+
* lookupWorld's hits), sorted by the same proxy as ask into rows to review: `make`, `add_to`,
|
|
501
|
+
* `link`, `ask`. Nothing is written; the app applies what the user accepts. Every id in a
|
|
502
|
+
* row is from the slice; keel moves any other row to `not_proposed` with its reason.
|
|
503
|
+
* A sort counts as one ask: the same account token, allowance and refusals as ask. 422
|
|
504
|
+
* names the param: notes 1 to 8, each up to 4,000 characters and 16,000 in all (text
|
|
505
|
+
* only), at most four pictures, each uploaded into this world; slice up to 100, names up
|
|
506
|
+
* to 200 characters, anchors up to 120.
|
|
507
|
+
*/
|
|
508
|
+
async sort(req) {
|
|
509
|
+
if (this.keyKind !== "account") {
|
|
510
|
+
throw new TypeError("sort needs an account token (ow_a_): the proxy meters per account");
|
|
511
|
+
}
|
|
512
|
+
return this.request("POST", "/account/sort", {
|
|
513
|
+
body: { world_id: req.worldId, notes: req.notes, slice: req.slice }
|
|
514
|
+
});
|
|
515
|
+
}
|
|
496
516
|
// -- Core request machinery ----------------------------------------------
|
|
497
517
|
/**
|
|
498
518
|
* Raw authenticated request against this client's baseUrl. Public since 4.0
|