@42ch/spoke-schemas 0.1.0-alpha.1
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/LICENSE +201 -0
- package/dist/index.d.mts +2296 -0
- package/dist/index.d.ts +2296 -0
- package/dist/index.js +18 -0
- package/dist/index.mjs +0 -0
- package/package.json +48 -0
- package/src/generated/common/common.ts +159 -0
- package/src/generated/common/error-envelope.ts +36 -0
- package/src/generated/common/index.ts +8 -0
- package/src/generated/data/assemble-packet.ts +56 -0
- package/src/generated/data/finding.ts +109 -0
- package/src/generated/data/index.ts +13 -0
- package/src/generated/data/knowledge-entry.ts +111 -0
- package/src/generated/data/relation.ts +60 -0
- package/src/generated/data/rule.ts +103 -0
- package/src/generated/data/source-anchor.ts +52 -0
- package/src/generated/data/timeline-event.ts +151 -0
- package/src/generated/index.ts +9 -0
- package/src/generated/ops/assemble-request.ts +60 -0
- package/src/generated/ops/assemble-response.ts +109 -0
- package/src/generated/ops/check-request.ts +165 -0
- package/src/generated/ops/check-response.ts +165 -0
- package/src/generated/ops/compute-request.ts +41 -0
- package/src/generated/ops/compute-response.ts +90 -0
- package/src/generated/ops/index.ts +20 -0
- package/src/generated/ops/project-request.ts +37 -0
- package/src/generated/ops/project-response.ts +83 -0
- package/src/generated/ops/promote-request.ts +132 -0
- package/src/generated/ops/promote-response.ts +168 -0
- package/src/generated/ops/relate-request.ts +77 -0
- package/src/generated/ops/relate-response.ts +113 -0
- package/src/generated/ops/upsert-request.ts +137 -0
- package/src/generated/ops/upsert-response.ts +185 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FROM JSON SCHEMA - DO NOT MODIFY
|
|
3
|
+
* Source: schemas/
|
|
4
|
+
* Generated by: pnpm run codegen
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Promoted KnowledgeEntry or wire error. Use knowledge_entry OR error — not both.
|
|
9
|
+
*/
|
|
10
|
+
export type PromoteResponse =
|
|
11
|
+
| {
|
|
12
|
+
knowledge_entry: KnowledgeEntry;
|
|
13
|
+
/**
|
|
14
|
+
* Optional id of KnowledgeEntry superseded during merge.
|
|
15
|
+
*/
|
|
16
|
+
superseded_id?: string;
|
|
17
|
+
extensions?: ExtensionMap1;
|
|
18
|
+
}
|
|
19
|
+
| {
|
|
20
|
+
error: ErrorEnvelope;
|
|
21
|
+
extensions?: ExtensionMap2;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Success: promoted KnowledgeEntry.
|
|
26
|
+
*/
|
|
27
|
+
export interface KnowledgeEntry {
|
|
28
|
+
/**
|
|
29
|
+
* Wire schema version (integer >= 1).
|
|
30
|
+
*/
|
|
31
|
+
schema_version: number;
|
|
32
|
+
/**
|
|
33
|
+
* Stable KnowledgeEntry id (opaque to protocol).
|
|
34
|
+
*/
|
|
35
|
+
entry_id: string;
|
|
36
|
+
/**
|
|
37
|
+
* Open string. Core vocabulary (documented, not enforced): character, location, event (ontology label; ≠ TimelineEvent wire object), scene, act, organization, item, conflict, info_point, era, worldbuilding, note, research, ability, rule (ontology label; ≠ L6 Rule wire object). Products MAY emit values outside this list.
|
|
38
|
+
*/
|
|
39
|
+
entry_type: string;
|
|
40
|
+
/**
|
|
41
|
+
* Human-stable name.
|
|
42
|
+
*/
|
|
43
|
+
canonical_name: string;
|
|
44
|
+
/**
|
|
45
|
+
* Open string. Core vocabulary (documented, not enforced): provisional, confirmed, deprecated, merged, deleted.
|
|
46
|
+
*/
|
|
47
|
+
status: string;
|
|
48
|
+
/**
|
|
49
|
+
* Structured payload. Typed attributes (summary, tags, attributes) live here — not as protocol siblings. Under l2-computable: optional state (static durable computable) and computable (dynamic Session-scoped projection).
|
|
50
|
+
*/
|
|
51
|
+
body: {
|
|
52
|
+
state?: ComputableFieldMap;
|
|
53
|
+
computable?: ComputableFieldMap1;
|
|
54
|
+
[k: string]: unknown | undefined;
|
|
55
|
+
};
|
|
56
|
+
source_anchor?: SourceAnchor;
|
|
57
|
+
/**
|
|
58
|
+
* Optimistic concurrency revision.
|
|
59
|
+
*/
|
|
60
|
+
revision?: number;
|
|
61
|
+
/**
|
|
62
|
+
* RFC 3339 UTC datetime string.
|
|
63
|
+
*/
|
|
64
|
+
created_at?: string;
|
|
65
|
+
/**
|
|
66
|
+
* RFC 3339 UTC datetime string.
|
|
67
|
+
*/
|
|
68
|
+
updated_at?: string;
|
|
69
|
+
extensions: ExtensionMap;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Static durable computable state (l2-computable optional). Authoritative pre-Session and after settle.
|
|
73
|
+
*/
|
|
74
|
+
export interface ComputableFieldMap {
|
|
75
|
+
[k: string]: unknown | undefined;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Dynamic Session-scoped computable projection (l2-computable optional). Absent or inert pre-Session; mutates mid-Session only.
|
|
79
|
+
*/
|
|
80
|
+
export interface ComputableFieldMap1 {
|
|
81
|
+
[k: string]: unknown | undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Optional provenance pointer.
|
|
85
|
+
*/
|
|
86
|
+
export interface SourceAnchor {
|
|
87
|
+
/**
|
|
88
|
+
* Wire schema version (integer >= 1).
|
|
89
|
+
*/
|
|
90
|
+
schema_version: number;
|
|
91
|
+
/**
|
|
92
|
+
* Opaque source locator; products define grammar.
|
|
93
|
+
*/
|
|
94
|
+
source_id: string;
|
|
95
|
+
span?: SourceSpan;
|
|
96
|
+
/**
|
|
97
|
+
* Optional human label for the anchor.
|
|
98
|
+
*/
|
|
99
|
+
label?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Optional MIME type of the referenced source.
|
|
102
|
+
*/
|
|
103
|
+
mime_type?: string;
|
|
104
|
+
extensions: ExtensionMap;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Optional byte or character span within the source.
|
|
108
|
+
*/
|
|
109
|
+
export interface SourceSpan {
|
|
110
|
+
/**
|
|
111
|
+
* Start offset (inclusive).
|
|
112
|
+
*/
|
|
113
|
+
start: number;
|
|
114
|
+
/**
|
|
115
|
+
* End offset (exclusive).
|
|
116
|
+
*/
|
|
117
|
+
end: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
121
|
+
*/
|
|
122
|
+
export interface ExtensionMap {
|
|
123
|
+
[k: string]:
|
|
124
|
+
| {
|
|
125
|
+
[k: string]: unknown | undefined;
|
|
126
|
+
}
|
|
127
|
+
| undefined;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
131
|
+
*/
|
|
132
|
+
export interface ExtensionMap1 {
|
|
133
|
+
[k: string]:
|
|
134
|
+
| {
|
|
135
|
+
[k: string]: unknown | undefined;
|
|
136
|
+
}
|
|
137
|
+
| undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Failure: shared error envelope.
|
|
141
|
+
*/
|
|
142
|
+
export interface ErrorEnvelope {
|
|
143
|
+
/**
|
|
144
|
+
* Machine-readable error code.
|
|
145
|
+
*/
|
|
146
|
+
code: string;
|
|
147
|
+
/**
|
|
148
|
+
* Human-readable error message.
|
|
149
|
+
*/
|
|
150
|
+
message: string;
|
|
151
|
+
/**
|
|
152
|
+
* Optional structured error context.
|
|
153
|
+
*/
|
|
154
|
+
details?: {
|
|
155
|
+
[k: string]: unknown | undefined;
|
|
156
|
+
};
|
|
157
|
+
extensions: ExtensionMap;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
161
|
+
*/
|
|
162
|
+
export interface ExtensionMap2 {
|
|
163
|
+
[k: string]:
|
|
164
|
+
| {
|
|
165
|
+
[k: string]: unknown | undefined;
|
|
166
|
+
}
|
|
167
|
+
| undefined;
|
|
168
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FROM JSON SCHEMA - DO NOT MODIFY
|
|
3
|
+
* Source: schemas/
|
|
4
|
+
* Generated by: pnpm run codegen
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create or update a Relation.
|
|
9
|
+
*/
|
|
10
|
+
export interface RelateRequest {
|
|
11
|
+
relation: Relation;
|
|
12
|
+
extensions?: ExtensionMap1;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Relation to create or update.
|
|
16
|
+
*/
|
|
17
|
+
export interface Relation {
|
|
18
|
+
/**
|
|
19
|
+
* Wire schema version (integer >= 1).
|
|
20
|
+
*/
|
|
21
|
+
schema_version: number;
|
|
22
|
+
/**
|
|
23
|
+
* Stable relation id.
|
|
24
|
+
*/
|
|
25
|
+
relation_id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Open string. Core vocabulary (documented, not enforced): related_to, parent_of, member_of, located_in, participates_in, causes, foreshadows.
|
|
28
|
+
*/
|
|
29
|
+
relation_type: string;
|
|
30
|
+
/**
|
|
31
|
+
* Source endpoint id (KnowledgeEntry or anchor id).
|
|
32
|
+
*/
|
|
33
|
+
from_id: string;
|
|
34
|
+
/**
|
|
35
|
+
* Target endpoint id (KnowledgeEntry or anchor id).
|
|
36
|
+
*/
|
|
37
|
+
to_id: string;
|
|
38
|
+
/**
|
|
39
|
+
* Optional human label.
|
|
40
|
+
*/
|
|
41
|
+
label?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Optional open metadata bag.
|
|
44
|
+
*/
|
|
45
|
+
metadata?: {
|
|
46
|
+
[k: string]: unknown | undefined;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* RFC 3339 UTC datetime string.
|
|
50
|
+
*/
|
|
51
|
+
created_at?: string;
|
|
52
|
+
/**
|
|
53
|
+
* RFC 3339 UTC datetime string.
|
|
54
|
+
*/
|
|
55
|
+
updated_at?: string;
|
|
56
|
+
extensions: ExtensionMap;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
60
|
+
*/
|
|
61
|
+
export interface ExtensionMap {
|
|
62
|
+
[k: string]:
|
|
63
|
+
| {
|
|
64
|
+
[k: string]: unknown | undefined;
|
|
65
|
+
}
|
|
66
|
+
| undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
70
|
+
*/
|
|
71
|
+
export interface ExtensionMap1 {
|
|
72
|
+
[k: string]:
|
|
73
|
+
| {
|
|
74
|
+
[k: string]: unknown | undefined;
|
|
75
|
+
}
|
|
76
|
+
| undefined;
|
|
77
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FROM JSON SCHEMA - DO NOT MODIFY
|
|
3
|
+
* Source: schemas/
|
|
4
|
+
* Generated by: pnpm run codegen
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Persisted Relation or wire error. Use relation OR error — not both.
|
|
9
|
+
*/
|
|
10
|
+
export type RelateResponse =
|
|
11
|
+
| {
|
|
12
|
+
relation: Relation;
|
|
13
|
+
extensions?: ExtensionMap1;
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
error: ErrorEnvelope;
|
|
17
|
+
extensions?: ExtensionMap2;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Success: persisted Relation.
|
|
22
|
+
*/
|
|
23
|
+
export interface Relation {
|
|
24
|
+
/**
|
|
25
|
+
* Wire schema version (integer >= 1).
|
|
26
|
+
*/
|
|
27
|
+
schema_version: number;
|
|
28
|
+
/**
|
|
29
|
+
* Stable relation id.
|
|
30
|
+
*/
|
|
31
|
+
relation_id: string;
|
|
32
|
+
/**
|
|
33
|
+
* Open string. Core vocabulary (documented, not enforced): related_to, parent_of, member_of, located_in, participates_in, causes, foreshadows.
|
|
34
|
+
*/
|
|
35
|
+
relation_type: string;
|
|
36
|
+
/**
|
|
37
|
+
* Source endpoint id (KnowledgeEntry or anchor id).
|
|
38
|
+
*/
|
|
39
|
+
from_id: string;
|
|
40
|
+
/**
|
|
41
|
+
* Target endpoint id (KnowledgeEntry or anchor id).
|
|
42
|
+
*/
|
|
43
|
+
to_id: string;
|
|
44
|
+
/**
|
|
45
|
+
* Optional human label.
|
|
46
|
+
*/
|
|
47
|
+
label?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Optional open metadata bag.
|
|
50
|
+
*/
|
|
51
|
+
metadata?: {
|
|
52
|
+
[k: string]: unknown | undefined;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* RFC 3339 UTC datetime string.
|
|
56
|
+
*/
|
|
57
|
+
created_at?: string;
|
|
58
|
+
/**
|
|
59
|
+
* RFC 3339 UTC datetime string.
|
|
60
|
+
*/
|
|
61
|
+
updated_at?: string;
|
|
62
|
+
extensions: ExtensionMap;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
66
|
+
*/
|
|
67
|
+
export interface ExtensionMap {
|
|
68
|
+
[k: string]:
|
|
69
|
+
| {
|
|
70
|
+
[k: string]: unknown | undefined;
|
|
71
|
+
}
|
|
72
|
+
| undefined;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
76
|
+
*/
|
|
77
|
+
export interface ExtensionMap1 {
|
|
78
|
+
[k: string]:
|
|
79
|
+
| {
|
|
80
|
+
[k: string]: unknown | undefined;
|
|
81
|
+
}
|
|
82
|
+
| undefined;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Failure: shared error envelope.
|
|
86
|
+
*/
|
|
87
|
+
export interface ErrorEnvelope {
|
|
88
|
+
/**
|
|
89
|
+
* Machine-readable error code.
|
|
90
|
+
*/
|
|
91
|
+
code: string;
|
|
92
|
+
/**
|
|
93
|
+
* Human-readable error message.
|
|
94
|
+
*/
|
|
95
|
+
message: string;
|
|
96
|
+
/**
|
|
97
|
+
* Optional structured error context.
|
|
98
|
+
*/
|
|
99
|
+
details?: {
|
|
100
|
+
[k: string]: unknown | undefined;
|
|
101
|
+
};
|
|
102
|
+
extensions: ExtensionMap;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
106
|
+
*/
|
|
107
|
+
export interface ExtensionMap2 {
|
|
108
|
+
[k: string]:
|
|
109
|
+
| {
|
|
110
|
+
[k: string]: unknown | undefined;
|
|
111
|
+
}
|
|
112
|
+
| undefined;
|
|
113
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FROM JSON SCHEMA - DO NOT MODIFY
|
|
3
|
+
* Source: schemas/
|
|
4
|
+
* Generated by: pnpm run codegen
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create or update one or more KnowledgeEntries by stable id.
|
|
9
|
+
*/
|
|
10
|
+
export interface UpsertRequest {
|
|
11
|
+
/**
|
|
12
|
+
* KnowledgeEntries to create or update.
|
|
13
|
+
*
|
|
14
|
+
* @minItems 1
|
|
15
|
+
*/
|
|
16
|
+
knowledge_entries: [KnowledgeEntry, ...KnowledgeEntry[]];
|
|
17
|
+
/**
|
|
18
|
+
* Opaque idempotency hint (no server semantics in v0.1).
|
|
19
|
+
*/
|
|
20
|
+
idempotency_key?: string;
|
|
21
|
+
extensions?: ExtensionMap1;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Atomic narrative knowledge unit: identity, typed body, provenance envelope.
|
|
25
|
+
*/
|
|
26
|
+
export interface KnowledgeEntry {
|
|
27
|
+
/**
|
|
28
|
+
* Wire schema version (integer >= 1).
|
|
29
|
+
*/
|
|
30
|
+
schema_version: number;
|
|
31
|
+
/**
|
|
32
|
+
* Stable KnowledgeEntry id (opaque to protocol).
|
|
33
|
+
*/
|
|
34
|
+
entry_id: string;
|
|
35
|
+
/**
|
|
36
|
+
* Open string. Core vocabulary (documented, not enforced): character, location, event (ontology label; ≠ TimelineEvent wire object), scene, act, organization, item, conflict, info_point, era, worldbuilding, note, research, ability, rule (ontology label; ≠ L6 Rule wire object). Products MAY emit values outside this list.
|
|
37
|
+
*/
|
|
38
|
+
entry_type: string;
|
|
39
|
+
/**
|
|
40
|
+
* Human-stable name.
|
|
41
|
+
*/
|
|
42
|
+
canonical_name: string;
|
|
43
|
+
/**
|
|
44
|
+
* Open string. Core vocabulary (documented, not enforced): provisional, confirmed, deprecated, merged, deleted.
|
|
45
|
+
*/
|
|
46
|
+
status: string;
|
|
47
|
+
/**
|
|
48
|
+
* Structured payload. Typed attributes (summary, tags, attributes) live here — not as protocol siblings. Under l2-computable: optional state (static durable computable) and computable (dynamic Session-scoped projection).
|
|
49
|
+
*/
|
|
50
|
+
body: {
|
|
51
|
+
state?: ComputableFieldMap;
|
|
52
|
+
computable?: ComputableFieldMap1;
|
|
53
|
+
[k: string]: unknown | undefined;
|
|
54
|
+
};
|
|
55
|
+
source_anchor?: SourceAnchor;
|
|
56
|
+
/**
|
|
57
|
+
* Optimistic concurrency revision.
|
|
58
|
+
*/
|
|
59
|
+
revision?: number;
|
|
60
|
+
/**
|
|
61
|
+
* RFC 3339 UTC datetime string.
|
|
62
|
+
*/
|
|
63
|
+
created_at?: string;
|
|
64
|
+
/**
|
|
65
|
+
* RFC 3339 UTC datetime string.
|
|
66
|
+
*/
|
|
67
|
+
updated_at?: string;
|
|
68
|
+
extensions: ExtensionMap;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Static durable computable state (l2-computable optional). Authoritative pre-Session and after settle.
|
|
72
|
+
*/
|
|
73
|
+
export interface ComputableFieldMap {
|
|
74
|
+
[k: string]: unknown | undefined;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Dynamic Session-scoped computable projection (l2-computable optional). Absent or inert pre-Session; mutates mid-Session only.
|
|
78
|
+
*/
|
|
79
|
+
export interface ComputableFieldMap1 {
|
|
80
|
+
[k: string]: unknown | undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Optional provenance pointer.
|
|
84
|
+
*/
|
|
85
|
+
export interface SourceAnchor {
|
|
86
|
+
/**
|
|
87
|
+
* Wire schema version (integer >= 1).
|
|
88
|
+
*/
|
|
89
|
+
schema_version: number;
|
|
90
|
+
/**
|
|
91
|
+
* Opaque source locator; products define grammar.
|
|
92
|
+
*/
|
|
93
|
+
source_id: string;
|
|
94
|
+
span?: SourceSpan;
|
|
95
|
+
/**
|
|
96
|
+
* Optional human label for the anchor.
|
|
97
|
+
*/
|
|
98
|
+
label?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Optional MIME type of the referenced source.
|
|
101
|
+
*/
|
|
102
|
+
mime_type?: string;
|
|
103
|
+
extensions: ExtensionMap;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Optional byte or character span within the source.
|
|
107
|
+
*/
|
|
108
|
+
export interface SourceSpan {
|
|
109
|
+
/**
|
|
110
|
+
* Start offset (inclusive).
|
|
111
|
+
*/
|
|
112
|
+
start: number;
|
|
113
|
+
/**
|
|
114
|
+
* End offset (exclusive).
|
|
115
|
+
*/
|
|
116
|
+
end: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
120
|
+
*/
|
|
121
|
+
export interface ExtensionMap {
|
|
122
|
+
[k: string]:
|
|
123
|
+
| {
|
|
124
|
+
[k: string]: unknown | undefined;
|
|
125
|
+
}
|
|
126
|
+
| undefined;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
130
|
+
*/
|
|
131
|
+
export interface ExtensionMap1 {
|
|
132
|
+
[k: string]:
|
|
133
|
+
| {
|
|
134
|
+
[k: string]: unknown | undefined;
|
|
135
|
+
}
|
|
136
|
+
| undefined;
|
|
137
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FROM JSON SCHEMA - DO NOT MODIFY
|
|
3
|
+
* Source: schemas/
|
|
4
|
+
* Generated by: pnpm run codegen
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Persisted KnowledgeEntry view or wire error. Use knowledge_entries OR error — not both.
|
|
9
|
+
*/
|
|
10
|
+
export type UpsertResponse =
|
|
11
|
+
| {
|
|
12
|
+
/**
|
|
13
|
+
* Success: persisted KnowledgeEntries.
|
|
14
|
+
*/
|
|
15
|
+
knowledge_entries: KnowledgeEntry[];
|
|
16
|
+
/**
|
|
17
|
+
* Optional per-KnowledgeEntry rejections (success branch only).
|
|
18
|
+
*/
|
|
19
|
+
rejected?: UpsertRejected[];
|
|
20
|
+
extensions?: ExtensionMap1;
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
error: ErrorEnvelope;
|
|
24
|
+
extensions?: ExtensionMap2;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Atomic narrative knowledge unit: identity, typed body, provenance envelope.
|
|
29
|
+
*/
|
|
30
|
+
export interface KnowledgeEntry {
|
|
31
|
+
/**
|
|
32
|
+
* Wire schema version (integer >= 1).
|
|
33
|
+
*/
|
|
34
|
+
schema_version: number;
|
|
35
|
+
/**
|
|
36
|
+
* Stable KnowledgeEntry id (opaque to protocol).
|
|
37
|
+
*/
|
|
38
|
+
entry_id: string;
|
|
39
|
+
/**
|
|
40
|
+
* Open string. Core vocabulary (documented, not enforced): character, location, event (ontology label; ≠ TimelineEvent wire object), scene, act, organization, item, conflict, info_point, era, worldbuilding, note, research, ability, rule (ontology label; ≠ L6 Rule wire object). Products MAY emit values outside this list.
|
|
41
|
+
*/
|
|
42
|
+
entry_type: string;
|
|
43
|
+
/**
|
|
44
|
+
* Human-stable name.
|
|
45
|
+
*/
|
|
46
|
+
canonical_name: string;
|
|
47
|
+
/**
|
|
48
|
+
* Open string. Core vocabulary (documented, not enforced): provisional, confirmed, deprecated, merged, deleted.
|
|
49
|
+
*/
|
|
50
|
+
status: string;
|
|
51
|
+
/**
|
|
52
|
+
* Structured payload. Typed attributes (summary, tags, attributes) live here — not as protocol siblings. Under l2-computable: optional state (static durable computable) and computable (dynamic Session-scoped projection).
|
|
53
|
+
*/
|
|
54
|
+
body: {
|
|
55
|
+
state?: ComputableFieldMap;
|
|
56
|
+
computable?: ComputableFieldMap1;
|
|
57
|
+
[k: string]: unknown | undefined;
|
|
58
|
+
};
|
|
59
|
+
source_anchor?: SourceAnchor;
|
|
60
|
+
/**
|
|
61
|
+
* Optimistic concurrency revision.
|
|
62
|
+
*/
|
|
63
|
+
revision?: number;
|
|
64
|
+
/**
|
|
65
|
+
* RFC 3339 UTC datetime string.
|
|
66
|
+
*/
|
|
67
|
+
created_at?: string;
|
|
68
|
+
/**
|
|
69
|
+
* RFC 3339 UTC datetime string.
|
|
70
|
+
*/
|
|
71
|
+
updated_at?: string;
|
|
72
|
+
extensions: ExtensionMap;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Static durable computable state (l2-computable optional). Authoritative pre-Session and after settle.
|
|
76
|
+
*/
|
|
77
|
+
export interface ComputableFieldMap {
|
|
78
|
+
[k: string]: unknown | undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Dynamic Session-scoped computable projection (l2-computable optional). Absent or inert pre-Session; mutates mid-Session only.
|
|
82
|
+
*/
|
|
83
|
+
export interface ComputableFieldMap1 {
|
|
84
|
+
[k: string]: unknown | undefined;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Optional provenance pointer.
|
|
88
|
+
*/
|
|
89
|
+
export interface SourceAnchor {
|
|
90
|
+
/**
|
|
91
|
+
* Wire schema version (integer >= 1).
|
|
92
|
+
*/
|
|
93
|
+
schema_version: number;
|
|
94
|
+
/**
|
|
95
|
+
* Opaque source locator; products define grammar.
|
|
96
|
+
*/
|
|
97
|
+
source_id: string;
|
|
98
|
+
span?: SourceSpan;
|
|
99
|
+
/**
|
|
100
|
+
* Optional human label for the anchor.
|
|
101
|
+
*/
|
|
102
|
+
label?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Optional MIME type of the referenced source.
|
|
105
|
+
*/
|
|
106
|
+
mime_type?: string;
|
|
107
|
+
extensions: ExtensionMap;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Optional byte or character span within the source.
|
|
111
|
+
*/
|
|
112
|
+
export interface SourceSpan {
|
|
113
|
+
/**
|
|
114
|
+
* Start offset (inclusive).
|
|
115
|
+
*/
|
|
116
|
+
start: number;
|
|
117
|
+
/**
|
|
118
|
+
* End offset (exclusive).
|
|
119
|
+
*/
|
|
120
|
+
end: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
124
|
+
*/
|
|
125
|
+
export interface ExtensionMap {
|
|
126
|
+
[k: string]:
|
|
127
|
+
| {
|
|
128
|
+
[k: string]: unknown | undefined;
|
|
129
|
+
}
|
|
130
|
+
| undefined;
|
|
131
|
+
}
|
|
132
|
+
export interface UpsertRejected {
|
|
133
|
+
/**
|
|
134
|
+
* Rejected KnowledgeEntry id.
|
|
135
|
+
*/
|
|
136
|
+
entry_id: string;
|
|
137
|
+
/**
|
|
138
|
+
* Machine-readable rejection code.
|
|
139
|
+
*/
|
|
140
|
+
code: string;
|
|
141
|
+
/**
|
|
142
|
+
* Human-readable rejection message.
|
|
143
|
+
*/
|
|
144
|
+
message: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
148
|
+
*/
|
|
149
|
+
export interface ExtensionMap1 {
|
|
150
|
+
[k: string]:
|
|
151
|
+
| {
|
|
152
|
+
[k: string]: unknown | undefined;
|
|
153
|
+
}
|
|
154
|
+
| undefined;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Failure: shared error envelope.
|
|
158
|
+
*/
|
|
159
|
+
export interface ErrorEnvelope {
|
|
160
|
+
/**
|
|
161
|
+
* Machine-readable error code.
|
|
162
|
+
*/
|
|
163
|
+
code: string;
|
|
164
|
+
/**
|
|
165
|
+
* Human-readable error message.
|
|
166
|
+
*/
|
|
167
|
+
message: string;
|
|
168
|
+
/**
|
|
169
|
+
* Optional structured error context.
|
|
170
|
+
*/
|
|
171
|
+
details?: {
|
|
172
|
+
[k: string]: unknown | undefined;
|
|
173
|
+
};
|
|
174
|
+
extensions: ExtensionMap;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Product namespace bag keyed by product-chosen ids matching ^[a-z][a-z0-9_-]*$. Values are opaque JSON objects. Adapters MUST preserve unknown namespaces and keys on round-trip.
|
|
178
|
+
*/
|
|
179
|
+
export interface ExtensionMap2 {
|
|
180
|
+
[k: string]:
|
|
181
|
+
| {
|
|
182
|
+
[k: string]: unknown | undefined;
|
|
183
|
+
}
|
|
184
|
+
| undefined;
|
|
185
|
+
}
|
package/src/index.ts
ADDED