@heynixie/contract 0.0.0 → 0.54.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.
@@ -0,0 +1,334 @@
1
+ import { z } from 'zod';
2
+ export declare const momentContract: {
3
+ keepMoment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
4
+ clientActionID: z.ZodUUID;
5
+ firstSequence: z.ZodInt;
6
+ lastSequence: z.ZodInt;
7
+ thread: z.ZodString;
8
+ title: z.ZodString;
9
+ }, z.core.$strip>, z.ZodObject<{
10
+ momentID: z.ZodString;
11
+ shortID: z.ZodString;
12
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
13
+ UNAUTHORIZED: {
14
+ message: string;
15
+ status: number;
16
+ };
17
+ }>, {
18
+ CLIENT_ACTION_ID_REUSED: {
19
+ message: string;
20
+ status: number;
21
+ };
22
+ }>, {
23
+ MEMORY_NOT_STARTED: {
24
+ message: string;
25
+ status: number;
26
+ };
27
+ BAD_SPAN: {
28
+ message: string;
29
+ status: number;
30
+ };
31
+ }>, Record<never, never>>;
32
+ listMoments: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
33
+ before: z.ZodOptional<z.ZodInt>;
34
+ includeRetired: z.ZodBoolean;
35
+ query: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ moments: z.ZodArray<z.ZodObject<{
38
+ editedAt: z.ZodNullable<z.ZodDate>;
39
+ keptAt: z.ZodDate;
40
+ keptBy: z.ZodEnum<{
41
+ model: "model";
42
+ owner: "owner";
43
+ }>;
44
+ momentID: z.ZodString;
45
+ shortID: z.ZodString;
46
+ state: z.ZodEnum<{
47
+ active: "active";
48
+ retired: "retired";
49
+ }>;
50
+ title: z.ZodNullable<z.ZodString>;
51
+ }, z.core.$strip>>;
52
+ next: z.ZodNullable<z.ZodInt>;
53
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
54
+ UNAUTHORIZED: {
55
+ message: string;
56
+ status: number;
57
+ };
58
+ }>, {
59
+ MEMORY_NOT_STARTED: {
60
+ message: string;
61
+ status: number;
62
+ };
63
+ }>, Record<never, never>>;
64
+ readMoment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
65
+ momentID: z.ZodString;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ editedAt: z.ZodNullable<z.ZodDate>;
68
+ keptAt: z.ZodDate;
69
+ keptBy: z.ZodEnum<{
70
+ model: "model";
71
+ owner: "owner";
72
+ }>;
73
+ momentID: z.ZodString;
74
+ shortID: z.ZodString;
75
+ state: z.ZodEnum<{
76
+ active: "active";
77
+ retired: "retired";
78
+ }>;
79
+ title: z.ZodNullable<z.ZodString>;
80
+ firstSequence: z.ZodInt;
81
+ lastSequence: z.ZodInt;
82
+ links: z.ZodArray<z.ZodObject<{
83
+ itemID: z.ZodString;
84
+ shortID: z.ZodString;
85
+ text: z.ZodNullable<z.ZodString>;
86
+ }, z.core.$strip>>;
87
+ note: z.ZodNullable<z.ZodObject<{
88
+ text: z.ZodString;
89
+ writtenAt: z.ZodDate;
90
+ }, z.core.$strip>>;
91
+ reflections: z.ZodArray<z.ZodObject<{
92
+ model: z.ZodString;
93
+ text: z.ZodNullable<z.ZodString>;
94
+ writtenAt: z.ZodDate;
95
+ reflectionID: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ thread: z.ZodString;
98
+ titleBy: z.ZodEnum<{
99
+ model: "model";
100
+ owner: "owner";
101
+ }>;
102
+ version: z.ZodInt;
103
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
104
+ UNAUTHORIZED: {
105
+ message: string;
106
+ status: number;
107
+ };
108
+ }>, {
109
+ MEMORY_NOT_STARTED: {
110
+ message: string;
111
+ status: number;
112
+ };
113
+ MOMENT_NOT_FOUND: {
114
+ message: string;
115
+ status: number;
116
+ };
117
+ STALE_VERSION: {
118
+ message: string;
119
+ status: number;
120
+ };
121
+ }>, Record<never, never>>;
122
+ readMomentSpan: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
123
+ momentID: z.ZodString;
124
+ after: z.ZodOptional<z.ZodInt>;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ records: z.ZodArray<z.ZodObject<{
127
+ isGap: z.ZodBoolean;
128
+ kind: z.ZodString;
129
+ recordedAt: z.ZodDate;
130
+ sequence: z.ZodInt;
131
+ text: z.ZodNullable<z.ZodString>;
132
+ tool: z.ZodNullable<z.ZodString>;
133
+ }, z.core.$strip>>;
134
+ next: z.ZodNullable<z.ZodInt>;
135
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
136
+ UNAUTHORIZED: {
137
+ message: string;
138
+ status: number;
139
+ };
140
+ }>, {
141
+ MEMORY_NOT_STARTED: {
142
+ message: string;
143
+ status: number;
144
+ };
145
+ MOMENT_NOT_FOUND: {
146
+ message: string;
147
+ status: number;
148
+ };
149
+ STALE_VERSION: {
150
+ message: string;
151
+ status: number;
152
+ };
153
+ }>, Record<never, never>>;
154
+ editMoment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
155
+ momentID: z.ZodString;
156
+ version: z.ZodInt;
157
+ clientActionID: z.ZodUUID;
158
+ change: z.ZodDiscriminatedUnion<[z.ZodObject<{
159
+ kind: z.ZodLiteral<"title">;
160
+ title: z.ZodString;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ kind: z.ZodLiteral<"edges">;
163
+ firstSequence: z.ZodInt;
164
+ lastSequence: z.ZodInt;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ kind: z.ZodLiteral<"note">;
167
+ note: z.ZodString;
168
+ }, z.core.$strip>, z.ZodObject<{
169
+ kind: z.ZodLiteral<"reflection_removed">;
170
+ reflectionID: z.ZodString;
171
+ }, z.core.$strip>], "kind">;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ momentID: z.ZodString;
174
+ version: z.ZodInt;
175
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
176
+ UNAUTHORIZED: {
177
+ message: string;
178
+ status: number;
179
+ };
180
+ }>, {
181
+ MEMORY_NOT_STARTED: {
182
+ message: string;
183
+ status: number;
184
+ };
185
+ MOMENT_NOT_FOUND: {
186
+ message: string;
187
+ status: number;
188
+ };
189
+ STALE_VERSION: {
190
+ message: string;
191
+ status: number;
192
+ };
193
+ }>, {
194
+ CLIENT_ACTION_ID_REUSED: {
195
+ message: string;
196
+ status: number;
197
+ };
198
+ }>, {
199
+ BAD_SPAN: {
200
+ message: string;
201
+ status: number;
202
+ };
203
+ REFLECTION_NOT_FOUND: {
204
+ message: string;
205
+ status: number;
206
+ };
207
+ }>, Record<never, never>>;
208
+ linkMoment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
209
+ momentID: z.ZodString;
210
+ version: z.ZodInt;
211
+ clientActionID: z.ZodUUID;
212
+ isLinked: z.ZodBoolean;
213
+ itemID: z.ZodString;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ momentID: z.ZodString;
216
+ version: z.ZodInt;
217
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
218
+ UNAUTHORIZED: {
219
+ message: string;
220
+ status: number;
221
+ };
222
+ }>, {
223
+ MEMORY_NOT_STARTED: {
224
+ message: string;
225
+ status: number;
226
+ };
227
+ MOMENT_NOT_FOUND: {
228
+ message: string;
229
+ status: number;
230
+ };
231
+ STALE_VERSION: {
232
+ message: string;
233
+ status: number;
234
+ };
235
+ }>, {
236
+ CLIENT_ACTION_ID_REUSED: {
237
+ message: string;
238
+ status: number;
239
+ };
240
+ }>, {
241
+ MEMORY_ITEM_NOT_FOUND: {
242
+ message: string;
243
+ status: number;
244
+ };
245
+ ALREADY_LINKED: {
246
+ message: string;
247
+ status: number;
248
+ };
249
+ NOT_LINKED: {
250
+ message: string;
251
+ status: number;
252
+ };
253
+ }>, Record<never, never>>;
254
+ previewMomentDestroy: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
255
+ momentID: z.ZodString;
256
+ version: z.ZodInt;
257
+ }, z.core.$strip>, z.ZodObject<{
258
+ keptAt: z.ZodDate;
259
+ keptBy: z.ZodEnum<{
260
+ model: "model";
261
+ owner: "owner";
262
+ }>;
263
+ kept: z.ZodObject<{
264
+ records: z.ZodInt;
265
+ }, z.core.$strip>;
266
+ lost: z.ZodObject<{
267
+ links: z.ZodInt;
268
+ texts: z.ZodInt;
269
+ }, z.core.$strip>;
270
+ momentID: z.ZodString;
271
+ note: z.ZodNullable<z.ZodString>;
272
+ reflections: z.ZodArray<z.ZodObject<{
273
+ model: z.ZodString;
274
+ text: z.ZodNullable<z.ZodString>;
275
+ writtenAt: z.ZodDate;
276
+ }, z.core.$strip>>;
277
+ shortID: z.ZodString;
278
+ state: z.ZodEnum<{
279
+ active: "active";
280
+ retired: "retired";
281
+ }>;
282
+ thread: z.ZodString;
283
+ title: z.ZodNullable<z.ZodString>;
284
+ version: z.ZodInt;
285
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
286
+ UNAUTHORIZED: {
287
+ message: string;
288
+ status: number;
289
+ };
290
+ }>, {
291
+ MEMORY_NOT_STARTED: {
292
+ message: string;
293
+ status: number;
294
+ };
295
+ MOMENT_NOT_FOUND: {
296
+ message: string;
297
+ status: number;
298
+ };
299
+ STALE_VERSION: {
300
+ message: string;
301
+ status: number;
302
+ };
303
+ }>, Record<never, never>>;
304
+ destroyMoment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
305
+ momentID: z.ZodString;
306
+ version: z.ZodInt;
307
+ clientActionID: z.ZodUUID;
308
+ }, z.core.$strip>, z.ZodObject<{
309
+ momentID: z.ZodString;
310
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
311
+ UNAUTHORIZED: {
312
+ message: string;
313
+ status: number;
314
+ };
315
+ }>, {
316
+ MEMORY_NOT_STARTED: {
317
+ message: string;
318
+ status: number;
319
+ };
320
+ MOMENT_NOT_FOUND: {
321
+ message: string;
322
+ status: number;
323
+ };
324
+ STALE_VERSION: {
325
+ message: string;
326
+ status: number;
327
+ };
328
+ }>, {
329
+ CLIENT_ACTION_ID_REUSED: {
330
+ message: string;
331
+ status: number;
332
+ };
333
+ }>, Record<never, never>>;
334
+ };
@@ -0,0 +1,2 @@
1
+ import type { SpanSource } from './types.js';
2
+ export declare function pickSpanSource(inputType: string, data: string | null): SpanSource;
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ export declare const proposalOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ proposalID: z.ZodString;
4
+ status: z.ZodLiteral<"applied">;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ proposalID: z.ZodString;
7
+ status: z.ZodLiteral<"rejected">;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ item: z.ZodObject<{
10
+ itemID: z.ZodString;
11
+ text: z.ZodString;
12
+ version: z.ZodInt;
13
+ }, z.core.$strip>;
14
+ proposalID: z.ZodString;
15
+ status: z.ZodLiteral<"close_match">;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ cause: z.ZodEnum<{
18
+ answered: "answered";
19
+ changed: "changed";
20
+ gone: "gone";
21
+ lapsed: "lapsed";
22
+ moved: "moved";
23
+ }>;
24
+ proposalID: z.ZodString;
25
+ status: z.ZodLiteral<"stale">;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ code: z.ZodEnum<{
28
+ CLIENT_ACTION_ID_REUSED: "CLIENT_ACTION_ID_REUSED";
29
+ PINNED_CORE_FULL: "PINNED_CORE_FULL";
30
+ PIN_EDIT: "PIN_EDIT";
31
+ RETIREMENT_EDIT: "RETIREMENT_EDIT";
32
+ REVISION_TARGET: "REVISION_TARGET";
33
+ WRONG_STATE: "WRONG_STATE";
34
+ }>;
35
+ proposalID: z.ZodString;
36
+ status: z.ZodLiteral<"refused">;
37
+ }, z.core.$strip>], "status">;
@@ -0,0 +1 @@
1
+ export declare function renderSessionCookie(token: string | null): string;
@@ -0,0 +1,6 @@
1
+ export declare const reusedIDErrors: {
2
+ CLIENT_ACTION_ID_REUSED: {
3
+ message: string;
4
+ status: number;
5
+ };
6
+ };
@@ -0,0 +1 @@
1
+ export declare const sessionCookieName = "nixie_session";
@@ -0,0 +1,6 @@
1
+ export declare const signedIn: import("@orpc/contract").ContractBuilder<import("@orpc/contract").Schema<unknown, unknown>, import("@orpc/contract").Schema<unknown, unknown>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
2
+ UNAUTHORIZED: {
3
+ message: string;
4
+ status: number;
5
+ };
6
+ }>, Record<never, never>>;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const spanSchema: z.ZodObject<{
3
+ end: z.ZodInt;
4
+ source: z.ZodEnum<{
5
+ dropped: "dropped";
6
+ pasted: "pasted";
7
+ typed: "typed";
8
+ unknown: "unknown";
9
+ }>;
10
+ start: z.ZodInt;
11
+ }, z.core.$strip>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export declare const taskSchema: z.ZodObject<{
3
+ error: z.ZodOptional<z.ZodString>;
4
+ errorLimit: z.ZodOptional<z.ZodInt>;
5
+ errors: z.ZodOptional<z.ZodInt>;
6
+ retryAt: z.ZodOptional<z.ZodDate>;
7
+ stepKey: z.ZodOptional<z.ZodString>;
8
+ taskID: z.ZodString;
9
+ }, z.core.$strip>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const toolCallSchema: z.ZodObject<{
3
+ callID: z.ZodString;
4
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6
+ outcome: z.ZodOptional<z.ZodString>;
7
+ tool: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>;
@@ -0,0 +1,30 @@
1
+ import type { ContractRouterClient, InferContractRouterInputs, InferContractRouterOutputs } from '@orpc/contract';
2
+ import type { contract } from './contract.js';
3
+ import type { hostContract } from './host-contract.js';
4
+ import type { imageLimits } from './image-limits.js';
5
+ export type ContractClient = ContractRouterClient<typeof contract>;
6
+ export type ContractInputs = InferContractRouterInputs<typeof contract>;
7
+ export type ContractOutputs = InferContractRouterOutputs<typeof contract>;
8
+ export type HostContractClient = ContractRouterClient<typeof hostContract>;
9
+ export type HostContractInputs = InferContractRouterInputs<typeof hostContract>;
10
+ export type LogRecord = ContractOutputs['conversation']['read']['records'][number];
11
+ export type Span = ContractInputs['conversation']['send']['spans'][number];
12
+ export type SpanSource = Span['source'];
13
+ export interface SpanState {
14
+ readonly spans: readonly Span[];
15
+ readonly text: string;
16
+ readonly removed?: {
17
+ readonly at: number;
18
+ readonly text: string;
19
+ };
20
+ }
21
+ export interface PendingInput {
22
+ readonly selection: {
23
+ readonly backward: boolean;
24
+ readonly end: number;
25
+ readonly start: number;
26
+ };
27
+ readonly source: SpanSource;
28
+ readonly respacing?: string;
29
+ }
30
+ export type ImageMediaType = (typeof imageLimits.mediaTypes)[number];
package/package.json CHANGED
@@ -1 +1,36 @@
1
- { "name": "@heynixie/contract", "version": "0.0.0" }
1
+ {
2
+ "name": "@heynixie/contract",
3
+ "version": "0.54.0",
4
+ "description": "The oRPC contract of the nixie API, with the types a client needs",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/zgeoff/nixie.git",
9
+ "directory": "libs/contract"
10
+ },
11
+ "type": "module",
12
+ "sideEffects": false,
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "openapi": "bun src/run-openapi-document.ts",
21
+ "typecheck": "tsrs --noEmit"
22
+ },
23
+ "dependencies": {
24
+ "@orpc/client": "1.16.0",
25
+ "@orpc/contract": "1.16.0",
26
+ "@orpc/openapi": "1.16.0",
27
+ "@orpc/tanstack-query": "1.16.0",
28
+ "@orpc/zod": "1.16.0",
29
+ "@tanstack/query-core": "5.104.5",
30
+ "zod": "4.6.7"
31
+ },
32
+ "files": [
33
+ "README.md",
34
+ "dist"
35
+ ]
36
+ }