@onlyworlds/sdk 4.40.0 → 4.41.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 +6 -4
- package/CHANGELOG.md +20 -0
- package/README.md +1 -0
- package/SCHEMA.md +2 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +35 -0
- 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.32.1-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.32.1-dist.28** (canonical 00.32.01).
|
|
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
|
|
|
@@ -108,9 +108,11 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
|
|
|
108
108
|
seat's key is recorded as an agent without the option. Never set it in a tool people use.
|
|
109
109
|
- A guest or player reads what its own Character's sheet links to as a **stub**, marked
|
|
110
110
|
`known_of: true` (`isKnownOf(el)`): only `id`, `type`, `name`, `description`, `supertype`,
|
|
111
|
-
`subtype`, `image_url
|
|
112
|
-
files are 404. Render it as known of, never
|
|
113
|
-
write it back: `upsert`, `patch`, `create`
|
|
111
|
+
`subtype`, `image_url`, the timestamps and the fields its type lists in `PUBLIC_FIELDS` are
|
|
112
|
+
real; every other field reads unset, and its files are 404. Render it as known of, never
|
|
113
|
+
merge its empties over a whole copy, and never write it back: `upsert`, `patch`, `create`
|
|
114
|
+
and `bulk` throw a TypeError on one before sending. keel refuses any write carrying
|
|
115
|
+
`known_of` with 422 `known_of_not_writable` (`err.isKnownOfNotWritable`).
|
|
114
116
|
- A string holding an unpaired surrogate (text cut mid-emoji) is a 422 naming the field.
|
|
115
117
|
Slice strings by code point, not by UTF-16 unit.
|
|
116
118
|
- Colour carries the element's FAMILY (`elementColor(type, mode)`); the icon
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.41.0] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
A known-of stub's public fields (keel PR 117, keel #448), live in production, and schema-dist v0.32.1-dist.28, which publishes them.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **`PUBLIC_FIELDS`** (generated from the distribution's `presentation.json`, `types.<type>.public`): per element type,
|
|
14
|
+
the fields onlyworlds.com shows on a known-of stub besides the base fields, with their values, as a readonly
|
|
15
|
+
`as const` array; all 22 types present. A Character's are `physicality`, `height`, `weight`, `species` and
|
|
16
|
+
`reputation`; every other type's list is empty for now. Platform behaviour, not a default to override. Codegen
|
|
17
|
+
exits 1 on a tree without the sidecar, a type without the key, or a name that is not a field of its type.
|
|
18
|
+
- **`err.isKnownOfNotWritable`**: keel's named refusal of a write carrying `known_of`, true or false (422
|
|
19
|
+
`known_of_not_writable`, `param` known_of). This client never sends `known_of` (4.40.0's strip and refusal are
|
|
20
|
+
unchanged), so it reaches you only through `request()`; `/bulk` puts it in the item's slot.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- Repinned to schema-dist v0.32.1-dist.28: `presentation.json` gains `types.<type>.public` and `_meta.public`; no
|
|
24
|
+
schema file moved, so the generated interfaces change only their source lines.
|
|
25
|
+
- **A stub's description** on `known_of` (the generated doc comment, `SCHEMA.md` and `AGENTS.md`) says a stub
|
|
26
|
+
keeps its type's `PUBLIC_FIELDS` with their values too; it said every other field reads unset.
|
|
27
|
+
|
|
8
28
|
## [4.40.0] - 2026-10-20
|
|
9
29
|
|
|
10
30
|
The "known of" stub's client half (keel PR 113, B16; keel #421 §7g), live in production since 2026-10-20 13:47.
|
package/README.md
CHANGED
|
@@ -285,6 +285,7 @@ import {
|
|
|
285
285
|
ELEMENT_LABELS, // plural display labels
|
|
286
286
|
ELEMENT_SECTIONS, // field grouping and display order
|
|
287
287
|
FIELD_SCHEMA, // per-field type and link target
|
|
288
|
+
PUBLIC_FIELDS, // per type, the fields a known-of stub carries besides the base fields
|
|
288
289
|
elementColor, // colour by family; the icon carries the type
|
|
289
290
|
} from '@onlyworlds/sdk';
|
|
290
291
|
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.32.1-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.32.1-dist.28** — canonical schema **00.32.01**, published 2026-10-20.
|
|
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.
|
|
@@ -8,7 +8,7 @@ Written for both humans and AI agents reading this package locally.
|
|
|
8
8
|
**The shape rules** (v2 wire dialect): every element carries `id` (UUID), `name`, optional
|
|
9
9
|
`description`/`supertype`/`subtype`/`image_url`, server-managed `type`/`created_at`/`updated_at`/`change_seq`/`created_by`,
|
|
10
10
|
`known_of: true` only on a stub (an element a guest knows of through its Character's sheet:
|
|
11
|
-
its other fields read unset and are not values; never write a stub back),
|
|
11
|
+
its type's `PUBLIC_FIELDS` carry values, its other fields read unset and are not values; never write a stub back),
|
|
12
12
|
and namespaced extension fields (`x_*` etc.) returned verbatim. Link fields use ONE bare
|
|
13
13
|
name in both read and write (no `_ids` suffix). Single links are `UUID | null`; multi links
|
|
14
14
|
are `UUID[]`. **Links are owned one-way**: the type listed below owns the field (e.g.
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface OwElementBase {
|
|
|
31
31
|
changed_by?: string | null;
|
|
32
32
|
/** The door of the last write (server-managed, read-only): `seat` (an agent seat), `mcp`, `declared` (a client that sent X-OW-Agent), then `api`, `v1`, `sync`, or `server` (keel's own writes). The first three are agent-made. Null for anything last changed before writes recorded it. */
|
|
33
33
|
changed_via?: 'seat' | 'mcp' | 'declared' | 'api' | 'v1' | 'sync' | 'server' | null;
|
|
34
|
-
/** Present, and true, only on a stub (server-managed, read-only): an element a guest or player reaches only through its own Character's sheet. A stub keeps id, type, name, description, supertype, subtype, image_url, created_at, updated_at and change_seq; every other field reads unset ("", null, []), created_by/changed_by/changed_via null, no extension fields, and its files are 404. Its empties are not values and not a deletion: never write a stub back. Absent: the element is whole. See isKnownOf(). */
|
|
34
|
+
/** Present, and true, only on a stub (server-managed, read-only): an element a guest or player reaches only through its own Character's sheet. A stub keeps id, type, name, description, supertype, subtype, image_url, created_at, updated_at and change_seq, and the fields its type lists in PUBLIC_FIELDS with their values; every other field reads unset ("", null, []), created_by/changed_by/changed_via null, no extension fields, and its files are 404. Its empties are not values and not a deletion: never write a stub back. Absent: the element is whole. See isKnownOf(). */
|
|
35
35
|
known_of?: true;
|
|
36
36
|
/** Namespaced extension fields (atlas_* / shadow_* / x_*), returned verbatim. */
|
|
37
37
|
[ext: string]: unknown;
|
|
@@ -50,6 +50,34 @@ type ElementFamily = 'agents' | 'world' | 'abstract' | 'temporal';
|
|
|
50
50
|
declare const ELEMENT_FAMILIES: Record<ElementType, ElementFamily>;
|
|
51
51
|
/** Material Symbols icon name per type. Source: the distribution's `presentation.json` sidecar. */
|
|
52
52
|
declare const ELEMENT_ICONS: Record<ElementType, string>;
|
|
53
|
+
/** The fields onlyworlds.com shows on a known-of element (`known_of: true`, see isKnownOf)
|
|
54
|
+
* besides the base fields, with their values; every other field of a stub reads unset.
|
|
55
|
+
* Platform behaviour, not a default to override. Source: the distribution's
|
|
56
|
+
* `presentation.json` sidecar, `types.<type>.public` (keel PR 117). */
|
|
57
|
+
declare const PUBLIC_FIELDS: {
|
|
58
|
+
readonly ability: readonly [];
|
|
59
|
+
readonly character: readonly ["physicality", "height", "weight", "species", "reputation"];
|
|
60
|
+
readonly collective: readonly [];
|
|
61
|
+
readonly construct: readonly [];
|
|
62
|
+
readonly creature: readonly [];
|
|
63
|
+
readonly event: readonly [];
|
|
64
|
+
readonly family: readonly [];
|
|
65
|
+
readonly institution: readonly [];
|
|
66
|
+
readonly language: readonly [];
|
|
67
|
+
readonly law: readonly [];
|
|
68
|
+
readonly location: readonly [];
|
|
69
|
+
readonly map: readonly [];
|
|
70
|
+
readonly marker: readonly [];
|
|
71
|
+
readonly narrative: readonly [];
|
|
72
|
+
readonly object: readonly [];
|
|
73
|
+
readonly phenomenon: readonly [];
|
|
74
|
+
readonly pin: readonly [];
|
|
75
|
+
readonly relation: readonly [];
|
|
76
|
+
readonly species: readonly [];
|
|
77
|
+
readonly title: readonly [];
|
|
78
|
+
readonly trait: readonly [];
|
|
79
|
+
readonly zone: readonly [];
|
|
80
|
+
};
|
|
53
81
|
/** Field grouping for display. DERIVED from the canonical schema's own document
|
|
54
82
|
* structure (top-level property groups, document order = display order). */
|
|
55
83
|
interface SectionInfo {
|
|
@@ -2744,6 +2772,14 @@ declare class OwApiError extends Error {
|
|
|
2744
2772
|
* keel's hidden mark is on; until then `viewAs` is an unknown parameter (422).
|
|
2745
2773
|
*/
|
|
2746
2774
|
get isViewAsOwnerOnly(): boolean;
|
|
2775
|
+
/**
|
|
2776
|
+
* An element write carried `known_of` (422 `known_of_not_writable`, `param` known_of; keel
|
|
2777
|
+
* PR 117), true or false: the key marks a stub and is never written. Drop it and send only
|
|
2778
|
+
* the fields you mean. This client never sends it (`known_of` is stripped, a stub is a
|
|
2779
|
+
* TypeError before sending), so it reaches you only through `request()`. `/bulk` never
|
|
2780
|
+
* throws for it: the item's slot carries the code, and its siblings apply.
|
|
2781
|
+
*/
|
|
2782
|
+
get isKnownOfNotWritable(): boolean;
|
|
2747
2783
|
/**
|
|
2748
2784
|
* A `patch` or `editLinks` sent with `ifMatch` found the element moved past that
|
|
2749
2785
|
* `change_seq` (412 `precondition_failed`, keel #210): nothing was written and nothing
|
|
@@ -4403,4 +4439,4 @@ declare class TokenResource {
|
|
|
4403
4439
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
4404
4440
|
}
|
|
4405
4441
|
|
|
4406
|
-
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 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, 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, OwSignInError, type OwSignInReason, 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, 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, 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, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
|
4442
|
+
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 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, 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, OwSignInError, type OwSignInReason, 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, 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, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -160,6 +160,16 @@ var OwApiError = class extends Error {
|
|
|
160
160
|
get isViewAsOwnerOnly() {
|
|
161
161
|
return this.status === 403 && this.code === "view_as_owner_only";
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* An element write carried `known_of` (422 `known_of_not_writable`, `param` known_of; keel
|
|
165
|
+
* PR 117), true or false: the key marks a stub and is never written. Drop it and send only
|
|
166
|
+
* the fields you mean. This client never sends it (`known_of` is stripped, a stub is a
|
|
167
|
+
* TypeError before sending), so it reaches you only through `request()`. `/bulk` never
|
|
168
|
+
* throws for it: the item's slot carries the code, and its siblings apply.
|
|
169
|
+
*/
|
|
170
|
+
get isKnownOfNotWritable() {
|
|
171
|
+
return this.status === 422 && this.code === "known_of_not_writable";
|
|
172
|
+
}
|
|
163
173
|
/**
|
|
164
174
|
* A `patch` or `editLinks` sent with `ifMatch` found the element moved past that
|
|
165
175
|
* `change_seq` (412 `precondition_failed`, keel #210): nothing was written and nothing
|
|
@@ -1386,6 +1396,30 @@ var ELEMENT_ICONS = {
|
|
|
1386
1396
|
trait: "flaky",
|
|
1387
1397
|
zone: "pentagon"
|
|
1388
1398
|
};
|
|
1399
|
+
var PUBLIC_FIELDS = {
|
|
1400
|
+
ability: [],
|
|
1401
|
+
character: ["physicality", "height", "weight", "species", "reputation"],
|
|
1402
|
+
collective: [],
|
|
1403
|
+
construct: [],
|
|
1404
|
+
creature: [],
|
|
1405
|
+
event: [],
|
|
1406
|
+
family: [],
|
|
1407
|
+
institution: [],
|
|
1408
|
+
language: [],
|
|
1409
|
+
law: [],
|
|
1410
|
+
location: [],
|
|
1411
|
+
map: [],
|
|
1412
|
+
marker: [],
|
|
1413
|
+
narrative: [],
|
|
1414
|
+
object: [],
|
|
1415
|
+
phenomenon: [],
|
|
1416
|
+
pin: [],
|
|
1417
|
+
relation: [],
|
|
1418
|
+
species: [],
|
|
1419
|
+
title: [],
|
|
1420
|
+
trait: [],
|
|
1421
|
+
zone: []
|
|
1422
|
+
};
|
|
1389
1423
|
var ELEMENT_SECTIONS = {
|
|
1390
1424
|
ability: [
|
|
1391
1425
|
{ name: "Mechanics", order: 1, fields: ["activation", "duration", "potency", "range", "effects", "challenges", "talents", "requisites"] },
|
|
@@ -3557,6 +3591,7 @@ export {
|
|
|
3557
3591
|
OwWorldFileError,
|
|
3558
3592
|
PHOTO_MAX_BYTES,
|
|
3559
3593
|
PHOTO_TYPES,
|
|
3594
|
+
PUBLIC_FIELDS,
|
|
3560
3595
|
SPATIAL_TYPES,
|
|
3561
3596
|
TokenResource,
|
|
3562
3597
|
WORLD_FILE_MAX_BYTES,
|