@roj-ai/client 0.0.2

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,297 @@
1
+ import type { InstanceStatus } from './enums';
2
+ import type { VcsType } from './enums';
3
+ export type JSONPrimitive = string | number | boolean | null;
4
+ export type JSONValue = JSONPrimitive | JSONObject | JSONArray;
5
+ export type JSONObject = {
6
+ readonly [K in string]?: JSONValue;
7
+ };
8
+ export type JSONArray = readonly JSONValue[];
9
+ export type AgentBundle<OverRelation extends string | never = never> = {
10
+ name: 'AgentBundle';
11
+ unique: Omit<{
12
+ id: string;
13
+ }, OverRelation> | Omit<{
14
+ slug: string;
15
+ organization: Organization['unique'];
16
+ }, OverRelation> | Omit<{
17
+ revisions: AgentBundleRevision['unique'];
18
+ }, OverRelation>;
19
+ columns: {
20
+ id: string;
21
+ createdAt: string;
22
+ slug: string;
23
+ name: string | null;
24
+ description: string | null;
25
+ };
26
+ hasOne: {
27
+ organization: Organization;
28
+ };
29
+ hasMany: {
30
+ revisions: AgentBundleRevision<'bundle'>;
31
+ };
32
+ hasManyBy: {
33
+ revisionsByInstances: {
34
+ entity: AgentBundleRevision;
35
+ by: {
36
+ instances: Instance['unique'];
37
+ };
38
+ };
39
+ };
40
+ };
41
+ export type AgentBundleRevision<OverRelation extends string | never = never> = {
42
+ name: 'AgentBundleRevision';
43
+ unique: Omit<{
44
+ id: string;
45
+ }, OverRelation> | Omit<{
46
+ instances: Instance['unique'];
47
+ }, OverRelation>;
48
+ columns: {
49
+ id: string;
50
+ createdAt: string;
51
+ version: string | null;
52
+ };
53
+ hasOne: {
54
+ bundle: AgentBundle;
55
+ file: File;
56
+ };
57
+ hasMany: {
58
+ instances: Instance<'agentBundleRevision'>;
59
+ };
60
+ hasManyBy: {};
61
+ };
62
+ export type ApiKey<OverRelation extends string | never = never> = {
63
+ name: 'ApiKey';
64
+ unique: Omit<{
65
+ id: string;
66
+ }, OverRelation> | Omit<{
67
+ keyHash: string;
68
+ }, OverRelation>;
69
+ columns: {
70
+ id: string;
71
+ createdAt: string;
72
+ keyHash: string;
73
+ label: string;
74
+ lastUsedAt: string | null;
75
+ revoked: boolean;
76
+ };
77
+ hasOne: {
78
+ organization: Organization;
79
+ };
80
+ hasMany: {};
81
+ hasManyBy: {};
82
+ };
83
+ export type File<OverRelation extends string | never = never> = {
84
+ name: 'File';
85
+ unique: Omit<{
86
+ id: string;
87
+ }, OverRelation>;
88
+ columns: {
89
+ id: string;
90
+ createdAt: string;
91
+ r2Key: string;
92
+ filename: string;
93
+ mimeType: string;
94
+ size: number;
95
+ };
96
+ hasOne: {
97
+ organization: Organization;
98
+ };
99
+ hasMany: {};
100
+ hasManyBy: {};
101
+ };
102
+ export type Instance<OverRelation extends string | never = never> = {
103
+ name: 'Instance';
104
+ unique: Omit<{
105
+ id: string;
106
+ }, OverRelation>;
107
+ columns: {
108
+ id: string;
109
+ createdAt: string;
110
+ name: string;
111
+ vcsType: VcsType;
112
+ status: InstanceStatus;
113
+ metadata: JSONValue | null;
114
+ };
115
+ hasOne: {
116
+ organization: Organization;
117
+ sandboxTemplate: SandboxTemplate;
118
+ agentBundleRevision: AgentBundleRevision;
119
+ };
120
+ hasMany: {};
121
+ hasManyBy: {};
122
+ };
123
+ export type Organization<OverRelation extends string | never = never> = {
124
+ name: 'Organization';
125
+ unique: Omit<{
126
+ id: string;
127
+ }, OverRelation> | Omit<{
128
+ slug: string;
129
+ }, OverRelation> | Omit<{
130
+ betterAuthId: string;
131
+ }, OverRelation> | Omit<{
132
+ instances: Instance['unique'];
133
+ }, OverRelation> | Omit<{
134
+ agentBundles: AgentBundle['unique'];
135
+ }, OverRelation> | Omit<{
136
+ apiKeys: ApiKey['unique'];
137
+ }, OverRelation> | Omit<{
138
+ files: File['unique'];
139
+ }, OverRelation> | Omit<{
140
+ resources: Resource['unique'];
141
+ }, OverRelation>;
142
+ columns: {
143
+ id: string;
144
+ createdAt: string;
145
+ name: string | null;
146
+ slug: string | null;
147
+ betterAuthId: string | null;
148
+ llmProvider: string | null;
149
+ llmApiKey: string | null;
150
+ e2bApiKey: string | null;
151
+ githubAppId: string | null;
152
+ githubInstallationId: number | null;
153
+ githubOrg: string | null;
154
+ vcsDefault: VcsType;
155
+ webhookUrl: string | null;
156
+ webhookSecret: string | null;
157
+ };
158
+ hasOne: {};
159
+ hasMany: {
160
+ instances: Instance<'organization'>;
161
+ agentBundles: AgentBundle<'organization'>;
162
+ apiKeys: ApiKey<'organization'>;
163
+ files: File<'organization'>;
164
+ resources: Resource<'organization'>;
165
+ };
166
+ hasManyBy: {
167
+ agentBundlesBySlug: {
168
+ entity: AgentBundle;
169
+ by: {
170
+ slug: string;
171
+ };
172
+ };
173
+ agentBundlesByRevisions: {
174
+ entity: AgentBundle;
175
+ by: {
176
+ revisions: AgentBundleRevision['unique'];
177
+ };
178
+ };
179
+ apiKeysByKeyHash: {
180
+ entity: ApiKey;
181
+ by: {
182
+ keyHash: string;
183
+ };
184
+ };
185
+ resourcesBySlug: {
186
+ entity: Resource;
187
+ by: {
188
+ slug: string;
189
+ };
190
+ };
191
+ resourcesByRevisions: {
192
+ entity: Resource;
193
+ by: {
194
+ revisions: ResourceRevision['unique'];
195
+ };
196
+ };
197
+ };
198
+ };
199
+ export type Resource<OverRelation extends string | never = never> = {
200
+ name: 'Resource';
201
+ unique: Omit<{
202
+ id: string;
203
+ }, OverRelation> | Omit<{
204
+ slug: string;
205
+ organization: Organization['unique'];
206
+ }, OverRelation> | Omit<{
207
+ revisions: ResourceRevision['unique'];
208
+ }, OverRelation>;
209
+ columns: {
210
+ id: string;
211
+ createdAt: string;
212
+ slug: string;
213
+ name: string | null;
214
+ description: string | null;
215
+ };
216
+ hasOne: {
217
+ organization: Organization;
218
+ };
219
+ hasMany: {
220
+ revisions: ResourceRevision<'resource'>;
221
+ };
222
+ hasManyBy: {};
223
+ };
224
+ export type ResourceRevision<OverRelation extends string | never = never> = {
225
+ name: 'ResourceRevision';
226
+ unique: Omit<{
227
+ id: string;
228
+ }, OverRelation>;
229
+ columns: {
230
+ id: string;
231
+ createdAt: string;
232
+ label: string | null;
233
+ };
234
+ hasOne: {
235
+ resource: Resource;
236
+ file: File;
237
+ };
238
+ hasMany: {};
239
+ hasManyBy: {};
240
+ };
241
+ export type SandboxTemplate<OverRelation extends string | never = never> = {
242
+ name: 'SandboxTemplate';
243
+ unique: Omit<{
244
+ id: string;
245
+ }, OverRelation> | Omit<{
246
+ slug: string;
247
+ }, OverRelation> | Omit<{
248
+ instances: Instance['unique'];
249
+ }, OverRelation>;
250
+ columns: {
251
+ id: string;
252
+ createdAt: string;
253
+ slug: string;
254
+ name: string;
255
+ description: string | null;
256
+ e2bTemplateId: string;
257
+ version: string | null;
258
+ };
259
+ hasOne: {};
260
+ hasMany: {
261
+ instances: Instance<'sandboxTemplate'>;
262
+ };
263
+ hasManyBy: {};
264
+ };
265
+ export type User<OverRelation extends string | never = never> = {
266
+ name: 'User';
267
+ unique: Omit<{
268
+ id: string;
269
+ }, OverRelation> | Omit<{
270
+ betterAuthId: string;
271
+ }, OverRelation>;
272
+ columns: {
273
+ id: string;
274
+ createdAt: string;
275
+ email: string | null;
276
+ name: string | null;
277
+ betterAuthId: string | null;
278
+ };
279
+ hasOne: {};
280
+ hasMany: {};
281
+ hasManyBy: {};
282
+ };
283
+ export type ContemberClientEntities = {
284
+ AgentBundle: AgentBundle;
285
+ AgentBundleRevision: AgentBundleRevision;
286
+ ApiKey: ApiKey;
287
+ File: File;
288
+ Instance: Instance;
289
+ Organization: Organization;
290
+ Resource: Resource;
291
+ ResourceRevision: ResourceRevision;
292
+ SandboxTemplate: SandboxTemplate;
293
+ User: User;
294
+ };
295
+ export type ContemberClientSchema = {
296
+ entities: ContemberClientEntities;
297
+ };
@@ -0,0 +1,6 @@
1
+ export type InstanceStatus = "created" | "initializing" | "ready" | "initFailed" | "archived";
2
+ export type VcsType = "github" | "gitLocal" | "none";
3
+ export type ContemberClientEnums = {
4
+ InstanceStatus: InstanceStatus;
5
+ VcsType: VcsType;
6
+ };
@@ -0,0 +1,8 @@
1
+ import type { ContemberClientSchema } from './entities';
2
+ import { TypedContentQueryBuilder, TypedEntitySelection } from '@contember/client-content';
3
+ export * from './names';
4
+ export * from './enums';
5
+ export * from './entities';
6
+ export declare const queryBuilder: TypedContentQueryBuilder<ContemberClientSchema>;
7
+ export type FragmentOf<EntityName extends keyof ContemberClientSchema['entities'] & string, Data = unknown> = TypedEntitySelection<ContemberClientSchema, EntityName, ContemberClientSchema['entities'][EntityName], Data>;
8
+ export type FragmentType<T extends TypedEntitySelection<any, any, any, any> = any> = T extends TypedEntitySelection<any, any, any, infer TFields> ? TFields : never;
@@ -0,0 +1,2 @@
1
+ import { SchemaNames } from '@contember/client-content';
2
+ export declare const ContemberClientNames: SchemaNames;
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/enums.ts","../src/entities.ts","../../../node_modules/.bun/@contember+graphql-client@2.1.0-alpha.30/node_modules/@contember/graphql-client/dist/types/GraphQlClientRequestOptions.d.ts","../../../node_modules/.bun/@contember+graphql-client@2.1.0-alpha.30/node_modules/@contember/graphql-client/dist/types/GraphQlClient.d.ts","../../../node_modules/.bun/@contember+graphql-client@2.1.0-alpha.30/node_modules/@contember/graphql-client/dist/types/GraphQlClientError.d.ts","../../../node_modules/.bun/@contember+graphql-client@2.1.0-alpha.30/node_modules/@contember/graphql-client/dist/types/index.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/value.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/input.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/json.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/acl.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/actions.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/actionsPayload.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/model.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/result.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/settings.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/validation.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/schema/index.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/ProjectRole.d.ts","../../../node_modules/.bun/@contember+schema@2.1.0-alpha.30/node_modules/@contember/schema/dist/types/index.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/types/Schema.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/types/Input.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/types/Result.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/types/index.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/nodes/GraphQlFragmentSpread.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/nodes/GraphQlInlineFragment.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/nodes/GraphQlField.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/nodes/GraphQlFragment.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/nodes/index.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/GraphQlQueryPrinter.d.ts","../../../node_modules/.bun/@contember+graphql-builder@2.1.0-alpha.30/node_modules/@contember/graphql-builder/dist/types/index.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/nodes/ContentEntitySelection.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/nodes/ContentOperation.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/nodes/TypedEntitySelection.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/nodes/index.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/ContentClient.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/ContentQueryBuilder.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/TypedContentQueryBuilder.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/utils/mutationFragments.d.ts","../../../node_modules/.bun/@contember+client-content@2.1.0-alpha.30/node_modules/@contember/client-content/dist/types/index.d.ts","../src/names.ts","../src/index.ts","../../../node_modules/.bun/@types+react@19.2.14/node_modules/@types/react/global.d.ts","../../../node_modules/.bun/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../node_modules/.bun/@types+react@19.2.14/node_modules/@types/react/index.d.ts","../../../node_modules/.bun/@types+react-dom@19.2.3+273cdfb19a04c3e9/node_modules/@types/react-dom/index.d.ts"],"fileIdsList":[[86,103,114],[99,103,114],[103,114,116],[103,114,115,116,117,118],[99,103,110],[110],[103,111],[111,112,113],[99,100],[99],[100,101,102],[99,108],[108,109],[99,104,105],[106],[104,105,106,107],[83],[83,84,85],[97,98],[88,89],[89],[87,88,89,90,91,92,93,94,95,96],[87],[124],[122,123],[81],[81,82,119,120],[119]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"2ab096661c711e4a81cc464fa1e6feb929a54f5340b46b0a07ac6bbf857471f0","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"73f78680d4c08509933daf80947902f6ff41b6230f94dd002ae372620adb0f60","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5239f5c01bcfa9cd32f37c496cf19c61d69d37e48be9de612b541aac915805b","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1105afd6d643818e9bd5b757751fd3b19aaa884119b07354b17c04626e3d66e6","signature":"131c1669e7714030c200782970162623346951aa4eb287ce338d3d1a7e58fedc"},{"version":"995c5389dfd2c62bc9178b0ba4c493fd9768b0c7d64ae1568a1cfb3a749ba932","signature":"925d91c5d1d347422b2481f41440e3201e77de32f5888b65a9dbfccb0bf0dd2c"},{"version":"063a16a89e56dc3a27c4c353ff81f80e4a5074817db8f8989f6d4553df2f3850","impliedFormat":99},{"version":"8ef2193f6663c97e78c2a1b304b315620665bde3d5ec88cb9e6cdebbeab88291","impliedFormat":99},{"version":"9380030f7e24b1db8a92db237e4114eb9ec4e0e4fb1f9a74977f89bf27345a2f","impliedFormat":99},{"version":"e17fbde86ef68adc663fff12c63cce11175482b3f108afd90fa3c11754afe6c6","impliedFormat":99},{"version":"67070445e9cb6a031953839e5f673d751255409d0ecd2ce8a8bd8f09bb4a07f2","impliedFormat":99},{"version":"133c04d375f49a00f3d1ca37e28fcc4a8612a9f97d0710a156a60a3dc130ce3c","impliedFormat":99},{"version":"b1296831e111197bd9ebd73f0d15ad0fe2e11fcc51a6302edb23ffd93794db36","impliedFormat":99},{"version":"91cfb34ae55944c482e431423108c36d8c75af476c710149ce898d3ff9f2d9ad","impliedFormat":99},{"version":"12116061f71489aecf94d66b26d180d03084a6e808a6565a2ff21379e27b7d42","impliedFormat":99},{"version":"b6d7fc508e7470fb60f562f23aac5ed26caceb34d78e8f1eea970f39693e4b75","impliedFormat":99},{"version":"de7ad039850ffa74e3024945a4fd222e5037143b38e6d546c7419a184adb7b13","impliedFormat":99},{"version":"f42116e2e8ad600dc90bdf8ceade9dcf593c35812d8aaba9c03a3f1dbb87330e","impliedFormat":99},{"version":"54410f2253354330ff63801044c8d826de679724d9b60d5d3053d3af6aee993f","impliedFormat":99},{"version":"dff2fee737ebe5174f549c9f28e114c0cabac4b5fe4e364654465ba528979ba4","impliedFormat":99},{"version":"ad1f130d5fb49665e218d5366db67ead55593335a2c02733ae5f8466a99def53","impliedFormat":99},{"version":"466df547af9cf3861658b08baf3ecbd41c0eaad2101378fadfa54ab24db103e6","impliedFormat":99},{"version":"92404f0f42ffd8d939cf6fb1a911235e931981f94dcab0e85f9ae5faf876ea3c","impliedFormat":99},{"version":"e7899ed2786c9741e938d5264867f578606f0939f66a7446404920f7ada404bd","impliedFormat":99},{"version":"33491243e9e60504ee3d733817b089c90d639dc3f1238a3d6417083e9dd5b683","impliedFormat":99},{"version":"22929f35cddcea05db649fc52ca9cddfecd8c6e66ee8c6a1d7bea1cea4620037","impliedFormat":99},{"version":"feaceef383869ce3addd7d620c89fa6ff1d5753f7b451cffb1e926998df2b5e4","impliedFormat":99},{"version":"34e5c5b2be8aa1b3f75ccd21529ae8b9163f510dbdabae4caae3fec3010cc33b","impliedFormat":99},{"version":"45fb3525f5c652416e54f91bd8378464d41e22b0ccc108de7db918cf8e92ffd3","impliedFormat":99},{"version":"e2402a646d4471b0985495b6bfca6c9c731d335195bf206e8c982d8ca362692f","impliedFormat":99},{"version":"08d34fcbf615950f6d3dd6858437159f0c0af08d5af645ec415ebfeaeacf3bd0","impliedFormat":99},{"version":"13ce162c8088b92a985e41a2ddf61cbb191101c280214a74dd9e8d2fd3c9c905","impliedFormat":99},{"version":"d2689735d2498972d6f02fbaff989b1fa500b5a140af7e7c08a15fbc36c1d3d3","impliedFormat":99},{"version":"4b47e095287cc1351b5fa9c5112d1d2d255bd8916ce76347225837b244e97ed5","impliedFormat":99},{"version":"6f73050a9040c3249e56915d35c77d7c044a3dc325af21172e2b7daa692a66e9","impliedFormat":99},{"version":"06c1e22ce1921cfd383c800f9e191972c5dfaca8996cca54d85c4b4cb41db49d","impliedFormat":99},{"version":"65259471fe42be2ecacabc88f86895bf559d5957ef84c37fb60a6a08a6af0699","impliedFormat":99},{"version":"6c7327831239ec38e57c18eb15c5b191aa258ada0528de8dc93092efcba20896","impliedFormat":99},{"version":"36015894d199644a1e629e301f97ac8f17fc6252a613ee3c22b567de69ba0911","impliedFormat":99},{"version":"62ca877d3c090576b3ca1cd3e576c931eaedefc3af1b5ef405e41fd22c8b2955","impliedFormat":99},{"version":"5e8c7ad4619cc15007aa5bc3f4e1a30cb01540c14beaa609fb8d17d21acaceba","impliedFormat":99},{"version":"016e695348eb662b9adead21973e3da689bbff9c65811491644e2ed594fca800","impliedFormat":99},{"version":"1702404293385fb18761a3cf716b3c2888c6fa95d3ef96bc8e4e8f5a6e679689","impliedFormat":99},{"version":"495be5c51586c2e4c22151177c0e40da1e493327161303e74f6f5f1a64795f5e","signature":"c6e8569692d8011243c372b08766f81a5aca87e4cf65a4fa4660675adea6dd35"},{"version":"9a8dd274e50031caf70c202793d53a554ba9534340cf03a2bcf3a06fd96c8e8c","signature":"57800dae2029082b2fefa923762031f593b799bfe2f311b68807b9156f8cb9d4"},{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"dc0a7f107690ee5cd8afc8dbf05c4df78085471ce16bdd9881642ec738bc81fe","impliedFormat":1},{"version":"be1cc4d94ea60cbe567bc29ed479d42587bf1e6cba490f123d329976b0fe4ee5","impliedFormat":1}],"root":[81,82,120,121],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"module":99,"noImplicitAny":true,"outDir":"./","skipLibCheck":true,"strict":true,"target":99},"referencedMap":[[115,1],[116,2],[117,3],[119,4],[111,5],[112,6],[113,7],[114,8],[101,9],[102,10],[100,10],[103,11],[118,6],[109,12],[110,13],[106,14],[107,15],[105,15],[108,16],[84,17],[86,18],[99,19],[90,20],[91,21],[92,20],[97,22],[88,23],[93,20],[94,23],[96,21],[125,24],[124,25],[82,26],[121,27],[120,28]],"latestChangedDtsFile":"./src/index.d.ts","version":"5.9.3"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@roj-ai/client",
3
+ "version": "0.0.2",
4
+ "type": "module",
5
+ "main": "./src/index.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./src/index.ts",
10
+ "default": "./src/index.ts"
11
+ },
12
+ "./api": {
13
+ "types": "./dist/api/client.d.ts",
14
+ "import": "./src/api/client.ts",
15
+ "default": "./src/api/client.ts"
16
+ },
17
+ "./platform": {
18
+ "types": "./dist/platform/index.d.ts",
19
+ "import": "./src/platform/index.ts",
20
+ "default": "./src/platform/index.ts"
21
+ }
22
+ },
23
+ "files": [
24
+ "src",
25
+ "dist"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "type-check": "tsc --noEmit"
32
+ },
33
+ "dependencies": {
34
+ "@roj-ai/shared": "^0.0.2"
35
+ },
36
+ "devDependencies": {
37
+ "typescript": "5.9.3"
38
+ },
39
+ "types": "./dist/index.d.ts"
40
+ }
@@ -0,0 +1,75 @@
1
+ import { RpcClient, RpcError } from '@roj-ai/shared/rpc'
2
+ import type { Result, RpcErrorInfo, RpcInput, RpcMethodName, RpcOutput } from '@roj-ai/shared/rpc'
3
+
4
+ export { RpcClient, RpcError }
5
+ export type { RpcErrorInfo }
6
+
7
+ export interface ApiClient {
8
+ call<M extends RpcMethodName>(method: M, input: RpcInput<M>): Promise<Result<RpcOutput<M>, RpcErrorInfo>>
9
+ uploadFile(sessionId: string, file: File): Promise<{ uploadId: string; status: 'ready' | 'failed'; extractedContent?: string }>
10
+ }
11
+
12
+ function createApiClientFromRpc(getClient: () => RpcClient): ApiClient {
13
+ return {
14
+ call: (method, input) => getClient().call(method, input),
15
+ async uploadFile(sessionId, file) {
16
+ const formData = new FormData()
17
+ formData.append('file', file)
18
+
19
+ const client = getClient()
20
+ const baseUrl = client.getBaseUrl()
21
+ const projectId = client.getProjectId()
22
+ let url = `${baseUrl}/sessions/${sessionId}/upload`
23
+ if (projectId) {
24
+ url += `?project=${encodeURIComponent(projectId)}`
25
+ }
26
+ const response = await fetch(url, {
27
+ method: 'POST',
28
+ body: formData,
29
+ credentials: 'include',
30
+ })
31
+
32
+ if (!response.ok) {
33
+ const error = await response.json() as { error?: { message?: string } }
34
+ throw new Error(error.error?.message || 'Upload failed')
35
+ }
36
+
37
+ return response.json()
38
+ },
39
+ }
40
+ }
41
+
42
+ let rpcClient = new RpcClient('')
43
+
44
+ export function configureApiBaseUrl(url: string): void {
45
+ const projectId = rpcClient.getProjectId()
46
+ rpcClient = new RpcClient(url)
47
+ if (projectId) {
48
+ rpcClient.setProjectId(projectId)
49
+ }
50
+ }
51
+
52
+ export function getApiBaseUrl(): string {
53
+ return rpcClient.getBaseUrl()
54
+ }
55
+
56
+ export function configureProjectId(projectId: string | null): void {
57
+ rpcClient.setProjectId(projectId)
58
+ }
59
+
60
+ export function createApiClient(baseUrl: string = ''): ApiClient {
61
+ const client = new RpcClient(baseUrl)
62
+ return createApiClientFromRpc(() => client)
63
+ }
64
+
65
+ export const api: ApiClient = createApiClientFromRpc(() => rpcClient)
66
+
67
+ export function useApiError(error: unknown): string | null {
68
+ if (error instanceof RpcError) {
69
+ return error.error.message
70
+ }
71
+ if (error instanceof Error) {
72
+ return error.message
73
+ }
74
+ return null
75
+ }
@@ -0,0 +1,7 @@
1
+ import { RpcError } from '@roj-ai/shared/rpc'
2
+ import type { Result, RpcErrorInfo } from '@roj-ai/shared/rpc'
3
+
4
+ export function unwrap<T>(result: Result<T, RpcErrorInfo>): T {
5
+ if (result.ok) return result.value
6
+ throw new RpcError(0, result.error)
7
+ }
package/src/index.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @roj-ai/client
3
+ *
4
+ * Vanilla TypeScript client for the roj agent server. No React — React hooks
5
+ * and chat components live in `@roj-ai/client-react`.
6
+ */
7
+
8
+ export {
9
+ api,
10
+ configureApiBaseUrl,
11
+ createApiClient,
12
+ getApiBaseUrl,
13
+ configureProjectId,
14
+ RpcClient,
15
+ RpcError,
16
+ useApiError,
17
+ } from './api/client'
18
+ export type { ApiClient } from './api/client'
19
+ export { unwrap } from './api/unwrap'
@@ -0,0 +1,11 @@
1
+ import type { RpcError } from './rpc-definition'
2
+
3
+ export class RojApiError extends Error {
4
+ public readonly type: string
5
+
6
+ constructor(public readonly error: RpcError) {
7
+ super(error.message)
8
+ this.name = 'RojApiError'
9
+ this.type = error.type
10
+ }
11
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @roj-ai/client/platform
3
+ *
4
+ * Client SDK for the roj platform REST API. Works against both the full
5
+ * platform (Cloudflare worker) and the standalone server.
6
+ */
7
+
8
+ // Generic RPC framework
9
+ export { defineMethods, method } from './rpc-definition'
10
+ export type { MethodDef, MethodInput, MethodOutput, RpcRequest, RpcResponse, RpcError } from './rpc-definition'
11
+ export { createRpcClient } from './rpc-client'
12
+ export type { RpcClient, RpcClientOptions, RpcResult } from './rpc-client'
13
+ export { createRpcRouter } from './rpc-server'
14
+ export type { RpcRouter, MethodHandler, MethodHandlers } from './rpc-server'
15
+
16
+ // Platform method contracts
17
+ export { platformMethods } from './methods'
18
+ export type { PlatformMethods, PlatformMethodName } from './methods'
19
+ export type * from './methods'
20
+
21
+ export { instanceMethods } from './instance-methods'
22
+ export type { InstanceMethods, InstanceMethodName } from './instance-methods'
23
+ export type * from './instance-methods'
24
+
25
+ // Types
26
+ export type { SandboxState } from './sandbox-state'
27
+
28
+ // URL builders
29
+ export { buildPreviewUrl, buildWsUrl, buildApiBaseUrl, instanceIdToHex } from './urls'
30
+ export type { BuildPreviewUrlOptions, BuildWsUrlOptions } from './urls'
31
+
32
+ // REST client
33
+ export { createRojClient } from './rest-client'
34
+ export type { RojClient, RojClientOptions } from './rest-client'
35
+
36
+ // Errors
37
+ export { RojApiError } from './errors'