@neta-art/cohub 1.24.0 → 1.25.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.
@@ -68,7 +68,7 @@ type FeishuChannelConfig = {
68
68
  };
69
69
  type ChannelConfig = DiscordChannelConfig | FeishuChannelConfig | Record<string, unknown>;
70
70
  //#endregion
71
- //#region ../../node_modules/.pnpm/@neta-art+generation@0.1.2/node_modules/@neta-art/generation/dist/builtins-BE6FhnwP.d.ts
71
+ //#region ../../node_modules/.pnpm/@neta-art+generation@0.1.3/node_modules/@neta-art/generation/dist/builtins-BJ2_TVlr.d.ts
72
72
  //#region src/types.d.ts
73
73
  declare const MODEL_SCHEMA: "neta.generation.model.v1";
74
74
  type GenerationSource = {
@@ -137,11 +137,28 @@ type GenerationParameterSpec = {
137
137
  description?: string;
138
138
  examples?: boolean[];
139
139
  };
140
+ type GenerationMetaFieldSpec = GenerationParameterSpec | {
141
+ type: "object";
142
+ optional?: boolean;
143
+ description?: string;
144
+ };
145
+ type GenerationMetaTaskVariantSpec = {
146
+ description?: string;
147
+ required?: string[];
148
+ requiredContent?: Array<GenerationContentSpec["type"]>;
149
+ sendTask?: boolean;
150
+ };
151
+ type GenerationMetaSpec = {
152
+ fields?: Record<string, GenerationMetaFieldSpec>;
153
+ taskField?: string;
154
+ taskVariants?: Record<string, GenerationMetaTaskVariantSpec>;
155
+ };
140
156
  type GenerationModelDeclaration = {
141
157
  schema: typeof MODEL_SCHEMA;
142
158
  model: string;
143
159
  title?: string;
144
160
  description?: string;
161
+ allowUnknownParameters?: boolean;
145
162
  adapter: {
146
163
  type: string;
147
164
  };
@@ -149,6 +166,7 @@ type GenerationModelDeclaration = {
149
166
  input: GenerationContentSpec[];
150
167
  };
151
168
  parameters?: Record<string, GenerationParameterSpec>;
169
+ meta?: GenerationMetaSpec;
152
170
  examples?: Array<{
153
171
  title?: string;
154
172
  request: GenerateRequest;
@@ -158,9 +176,10 @@ type GenerateRequest = {
158
176
  model: string;
159
177
  content: GenerationContentBlock[];
160
178
  parameters?: Record<string, unknown>;
179
+ meta?: Record<string, unknown>; /** @deprecated Use meta. */
180
+ metadata?: Record<string, unknown>;
161
181
  apiKey?: string;
162
182
  baseUrl?: string;
163
- metadata?: Record<string, unknown>;
164
183
  };
165
184
  //#endregion
166
185
  //#region ../protocol/src/generation/policy.d.ts
@@ -221,7 +240,7 @@ type CreateGenerationTaskRequest = {
221
240
  model: string;
222
241
  content: GenerationContentBlock[];
223
242
  parameters?: Record<string, unknown>;
224
- metadata?: Record<string, unknown>;
243
+ meta?: Record<string, unknown>;
225
244
  };
226
245
  type CreateGenerationTaskResponse = {
227
246
  taskRunId: string;
@@ -231,7 +250,7 @@ type CreateGenerationTaskResponse = {
231
250
  type GenerationTaskResult = {
232
251
  model: string;
233
252
  output: GenerationContentBlock[];
234
- metadata?: Record<string, unknown>;
253
+ meta?: Record<string, unknown>;
235
254
  };
236
255
  type PublicGenerationDeclaration = Omit<GenerationModelDeclaration, "adapter">;
237
256
  type ListGenerationModelsResponse = {
@@ -277,6 +296,8 @@ type BillingCreditGrantStatus = {
277
296
  sourceType: string | null;
278
297
  sourceId: string | null;
279
298
  status: string;
299
+ availableNow: boolean | null;
300
+ unavailableReasons: string[];
280
301
  remainingAmount: number;
281
302
  remainingAmountUsd: number;
282
303
  originalAmount: number | null;
@@ -1982,19 +2003,35 @@ declare class SpaceCanvasApi {
1982
2003
  bootstrap(documentId: string, customFetch?: Fetch): Promise<CanvasBootstrapResponse>;
1983
2004
  sendTransaction(documentId: string, input: CanvasTransactionInput): Promise<CanvasBootstrapResponse>;
1984
2005
  }
1985
- declare class SpaceCheckpointsApi {
2006
+ declare class SpaceCheckpointFilesApi {
1986
2007
  private readonly transport;
1987
2008
  private readonly spaceId;
1988
- constructor(transport: HttpTransport, spaceId: string);
1989
- create(description?: string | null): Promise<{
2009
+ private readonly checkpointId;
2010
+ constructor(transport: HttpTransport, spaceId: string, checkpointId: string);
2011
+ list(path?: string, customFetch?: Fetch): Promise<SpaceFsTreeResponse>;
2012
+ read(path: string, customFetch?: Fetch): Promise<SpaceFsFileResponse>;
2013
+ }
2014
+ declare class SpaceCheckpointApi {
2015
+ private readonly transport;
2016
+ private readonly spaceId;
2017
+ readonly id: string;
2018
+ readonly files: SpaceCheckpointFilesApi;
2019
+ constructor(transport: HttpTransport, spaceId: string, id: string);
2020
+ get(customFetch?: Fetch): Promise<SpaceCheckpointDetailResponse>;
2021
+ }
2022
+ type SpaceCheckpointsApi = ((checkpointId: string) => SpaceCheckpointApi) & {
2023
+ checkpoint: (checkpointId: string) => SpaceCheckpointApi;
2024
+ latest: () => SpaceCheckpointApi;
2025
+ create: (description?: string | null) => Promise<{
1990
2026
  ok: true;
1991
2027
  taskRunId: string;
2028
+ existing?: boolean;
1992
2029
  }>;
1993
- list(): Promise<{
2030
+ list: () => Promise<{
1994
2031
  checkpoints: CheckpointRecord[];
1995
2032
  }>;
1996
- get(checkpointId: string, customFetch?: Fetch): Promise<SpaceCheckpointDetailResponse>;
1997
- }
2033
+ get: (checkpointId: string, customFetch?: Fetch) => Promise<SpaceCheckpointDetailResponse>;
2034
+ };
1998
2035
  declare class SpaceClient {
1999
2036
  readonly id: string;
2000
2037
  private readonly transport;
@@ -1818,27 +1818,55 @@ var SpaceCanvasApi = class {
1818
1818
  });
1819
1819
  }
1820
1820
  };
1821
- var SpaceCheckpointsApi = class {
1821
+ var SpaceCheckpointFilesApi = class {
1822
1822
  transport;
1823
1823
  spaceId;
1824
- constructor(transport, spaceId) {
1824
+ checkpointId;
1825
+ constructor(transport, spaceId, checkpointId) {
1825
1826
  this.transport = transport;
1826
1827
  this.spaceId = spaceId;
1828
+ this.checkpointId = checkpointId;
1827
1829
  }
1828
- create(description) {
1829
- return this.transport.request(`/api/spaces/${this.spaceId}/checkpoints`, {
1830
- method: "POST",
1831
- headers: { "Content-Type": "application/json" },
1832
- body: JSON.stringify({ description: description ?? null })
1833
- });
1830
+ list(path = "", customFetch) {
1831
+ const params = new URLSearchParams();
1832
+ if (path) params.set("path", path);
1833
+ const query = params.toString();
1834
+ return this.transport.request(`/api/spaces/${this.spaceId}/checkpoints/${this.checkpointId}/fs/tree${query ? `?${query}` : ""}`, { fetch: customFetch });
1834
1835
  }
1835
- list() {
1836
- return this.transport.request(`/api/spaces/${this.spaceId}/checkpoints`);
1836
+ read(path, customFetch) {
1837
+ const params = new URLSearchParams({ path });
1838
+ return this.transport.request(`/api/spaces/${this.spaceId}/checkpoints/${this.checkpointId}/fs/file?${params.toString()}`, { fetch: customFetch });
1837
1839
  }
1838
- get(checkpointId, customFetch) {
1839
- return this.transport.request(`/api/spaces/${this.spaceId}/checkpoints/${checkpointId}`, { fetch: customFetch });
1840
+ };
1841
+ var SpaceCheckpointApi = class {
1842
+ transport;
1843
+ spaceId;
1844
+ id;
1845
+ files;
1846
+ constructor(transport, spaceId, id) {
1847
+ this.transport = transport;
1848
+ this.spaceId = spaceId;
1849
+ this.id = id;
1850
+ this.files = new SpaceCheckpointFilesApi(transport, spaceId, id);
1851
+ }
1852
+ get(customFetch) {
1853
+ return this.transport.request(`/api/spaces/${this.spaceId}/checkpoints/${this.id}`, { fetch: customFetch });
1840
1854
  }
1841
1855
  };
1856
+ function createSpaceCheckpointsApi(transport, spaceId) {
1857
+ const checkpoint = (checkpointId) => new SpaceCheckpointApi(transport, spaceId, checkpointId);
1858
+ return Object.assign(checkpoint, {
1859
+ checkpoint,
1860
+ latest: () => checkpoint("latest"),
1861
+ create: (description) => transport.request(`/api/spaces/${spaceId}/checkpoints`, {
1862
+ method: "POST",
1863
+ headers: { "Content-Type": "application/json" },
1864
+ body: JSON.stringify({ description: description ?? null })
1865
+ }),
1866
+ list: () => transport.request(`/api/spaces/${spaceId}/checkpoints`),
1867
+ get: (checkpointId, customFetch) => checkpoint(checkpointId).get(customFetch)
1868
+ });
1869
+ }
1842
1870
  var SpaceClient = class {
1843
1871
  id;
1844
1872
  transport;
@@ -1864,7 +1892,7 @@ var SpaceClient = class {
1864
1892
  this.sessions = new SpaceSessionsApi(transport, id, websocketClient);
1865
1893
  this.members = new SpaceMembersApi(transport, id);
1866
1894
  this.access = new SpaceAccessApi(transport, id);
1867
- this.checkpoints = new SpaceCheckpointsApi(transport, id);
1895
+ this.checkpoints = createSpaceCheckpointsApi(transport, id);
1868
1896
  this.usage = new SpaceUsageApi(transport, id);
1869
1897
  this.channels = new SpaceChannelsApi(transport, id);
1870
1898
  this.mods = new SpaceModsApi(transport, id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub",
3
- "version": "1.24.0",
3
+ "version": "1.25.1",
4
4
  "description": "Cohub SDK for spaces, sessions, checkpoints, and realtime agent collaboration.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,