weave-typescript 0.25.0 → 0.27.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.
@@ -29,7 +29,7 @@ export declare function processTypeToJSON(object: ProcessType): string;
29
29
  */
30
30
  export declare enum ProcessAuthorityLevel {
31
31
  PROCESS_AUTHORITY_LEVEL_UNSPECIFIED = 0,
32
- PROCESS_AUTHORITY_LEVEL_OPAQUE = 1,
32
+ PROCESS_AUTHORITY_LEVEL_EXTERNAL = 1,
33
33
  PROCESS_AUTHORITY_LEVEL_OBSERVE = 2,
34
34
  PROCESS_AUTHORITY_LEVEL_OPERATE = 3,
35
35
  PROCESS_AUTHORITY_LEVEL_CONTROL = 4,
@@ -130,7 +130,7 @@ function processTypeToJSON(object) {
130
130
  var ProcessAuthorityLevel;
131
131
  (function (ProcessAuthorityLevel) {
132
132
  ProcessAuthorityLevel[ProcessAuthorityLevel["PROCESS_AUTHORITY_LEVEL_UNSPECIFIED"] = 0] = "PROCESS_AUTHORITY_LEVEL_UNSPECIFIED";
133
- ProcessAuthorityLevel[ProcessAuthorityLevel["PROCESS_AUTHORITY_LEVEL_OPAQUE"] = 1] = "PROCESS_AUTHORITY_LEVEL_OPAQUE";
133
+ ProcessAuthorityLevel[ProcessAuthorityLevel["PROCESS_AUTHORITY_LEVEL_EXTERNAL"] = 1] = "PROCESS_AUTHORITY_LEVEL_EXTERNAL";
134
134
  ProcessAuthorityLevel[ProcessAuthorityLevel["PROCESS_AUTHORITY_LEVEL_OBSERVE"] = 2] = "PROCESS_AUTHORITY_LEVEL_OBSERVE";
135
135
  ProcessAuthorityLevel[ProcessAuthorityLevel["PROCESS_AUTHORITY_LEVEL_OPERATE"] = 3] = "PROCESS_AUTHORITY_LEVEL_OPERATE";
136
136
  ProcessAuthorityLevel[ProcessAuthorityLevel["PROCESS_AUTHORITY_LEVEL_CONTROL"] = 4] = "PROCESS_AUTHORITY_LEVEL_CONTROL";
@@ -142,8 +142,8 @@ function processAuthorityLevelFromJSON(object) {
142
142
  case "PROCESS_AUTHORITY_LEVEL_UNSPECIFIED":
143
143
  return ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_UNSPECIFIED;
144
144
  case 1:
145
- case "PROCESS_AUTHORITY_LEVEL_OPAQUE":
146
- return ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_OPAQUE;
145
+ case "PROCESS_AUTHORITY_LEVEL_EXTERNAL":
146
+ return ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_EXTERNAL;
147
147
  case 2:
148
148
  case "PROCESS_AUTHORITY_LEVEL_OBSERVE":
149
149
  return ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_OBSERVE;
@@ -163,8 +163,8 @@ function processAuthorityLevelToJSON(object) {
163
163
  switch (object) {
164
164
  case ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_UNSPECIFIED:
165
165
  return "PROCESS_AUTHORITY_LEVEL_UNSPECIFIED";
166
- case ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_OPAQUE:
167
- return "PROCESS_AUTHORITY_LEVEL_OPAQUE";
166
+ case ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_EXTERNAL:
167
+ return "PROCESS_AUTHORITY_LEVEL_EXTERNAL";
168
168
  case ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_OBSERVE:
169
169
  return "PROCESS_AUTHORITY_LEVEL_OBSERVE";
170
170
  case ProcessAuthorityLevel.PROCESS_AUTHORITY_LEVEL_OPERATE:
@@ -151,12 +151,13 @@ export interface ListProjectsForChatSessionRow {
151
151
  projectId: string;
152
152
  }
153
153
  export declare function listProjectsForChatSession(client: Client, args: ListProjectsForChatSessionArgs): Promise<ListProjectsForChatSessionRow[]>;
154
- export declare const insertChatMessageQuery = "-- name: InsertChatMessage :one\nINSERT INTO weave.chat_messages (\n id, session_id, role, content,\n parent_message_id, tool_call_id, tool_call_state,\n model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types,\n token_usage, stream_state\n) VALUES (\n $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12\n)\nRETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at";
154
+ export declare const insertChatMessageQuery = "-- name: InsertChatMessage :one\nINSERT INTO weave.chat_messages (\n id, session_id, role, content,\n reasoning_content,\n parent_message_id, tool_call_id, tool_call_state,\n model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types,\n token_usage, stream_state\n) VALUES (\n $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13\n)\nRETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content";
155
155
  export interface InsertChatMessageArgs {
156
156
  id: string;
157
157
  sessionId: string;
158
158
  role: string;
159
159
  content: string;
160
+ reasoningContent: string;
160
161
  parentMessageId: string | null;
161
162
  toolCallId: string | null;
162
163
  toolCallState: string;
@@ -181,9 +182,10 @@ export interface InsertChatMessageRow {
181
182
  streamState: string;
182
183
  createdAt: Date;
183
184
  completedAt: Date | null;
185
+ reasoningContent: string;
184
186
  }
185
187
  export declare function insertChatMessage(client: Client, args: InsertChatMessageArgs): Promise<InsertChatMessageRow | null>;
186
- export declare const getChatMessageQuery = "-- name: GetChatMessage :one\nSELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at FROM weave.chat_messages WHERE id = $1";
188
+ export declare const getChatMessageQuery = "-- name: GetChatMessage :one\nSELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content FROM weave.chat_messages WHERE id = $1";
187
189
  export interface GetChatMessageArgs {
188
190
  id: string;
189
191
  }
@@ -202,9 +204,10 @@ export interface GetChatMessageRow {
202
204
  streamState: string;
203
205
  createdAt: Date;
204
206
  completedAt: Date | null;
207
+ reasoningContent: string;
205
208
  }
206
209
  export declare function getChatMessage(client: Client, args: GetChatMessageArgs): Promise<GetChatMessageRow | null>;
207
- export declare const listChatMessagesForSessionQuery = "-- name: ListChatMessagesForSession :many\nSELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at FROM weave.chat_messages\nWHERE session_id = $1\nORDER BY created_at";
210
+ export declare const listChatMessagesForSessionQuery = "-- name: ListChatMessagesForSession :many\nSELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content FROM weave.chat_messages\nWHERE session_id = $1\nORDER BY created_at";
208
211
  export interface ListChatMessagesForSessionArgs {
209
212
  sessionId: string;
210
213
  }
@@ -223,9 +226,10 @@ export interface ListChatMessagesForSessionRow {
223
226
  streamState: string;
224
227
  createdAt: Date;
225
228
  completedAt: Date | null;
229
+ reasoningContent: string;
226
230
  }
227
231
  export declare function listChatMessagesForSession(client: Client, args: ListChatMessagesForSessionArgs): Promise<ListChatMessagesForSessionRow[]>;
228
- export declare const updateChatMessageToolCallStateQuery = "-- name: UpdateChatMessageToolCallState :one\nUPDATE weave.chat_messages\nSET tool_call_state = $2\nWHERE id = $1\nRETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at";
232
+ export declare const updateChatMessageToolCallStateQuery = "-- name: UpdateChatMessageToolCallState :one\nUPDATE weave.chat_messages\nSET tool_call_state = $2\nWHERE id = $1\nRETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content";
229
233
  export interface UpdateChatMessageToolCallStateArgs {
230
234
  id: string;
231
235
  toolCallState: string;
@@ -245,13 +249,15 @@ export interface UpdateChatMessageToolCallStateRow {
245
249
  streamState: string;
246
250
  createdAt: Date;
247
251
  completedAt: Date | null;
252
+ reasoningContent: string;
248
253
  }
249
254
  export declare function updateChatMessageToolCallState(client: Client, args: UpdateChatMessageToolCallStateArgs): Promise<UpdateChatMessageToolCallStateRow | null>;
250
- export declare const completeChatMessageQuery = "-- name: CompleteChatMessage :one\nUPDATE weave.chat_messages\nSET stream_state = $2,\n content = $3,\n token_usage = $4,\n completed_at = now()\nWHERE id = $1\nRETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at";
255
+ export declare const completeChatMessageQuery = "-- name: CompleteChatMessage :one\nUPDATE weave.chat_messages\nSET stream_state = $2,\n content = $3,\n reasoning_content = $4,\n token_usage = $5,\n completed_at = now()\nWHERE id = $1\nRETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content";
251
256
  export interface CompleteChatMessageArgs {
252
257
  id: string;
253
258
  streamState: string;
254
259
  content: string;
260
+ reasoningContent: string;
255
261
  tokenUsage: any | null;
256
262
  }
257
263
  export interface CompleteChatMessageRow {
@@ -269,6 +275,7 @@ export interface CompleteChatMessageRow {
269
275
  streamState: string;
270
276
  createdAt: Date;
271
277
  completedAt: Date | null;
278
+ reasoningContent: string;
272
279
  }
273
280
  export declare function completeChatMessage(client: Client, args: CompleteChatMessageArgs): Promise<CompleteChatMessageRow | null>;
274
281
  export declare const createOrganizationApprovedModelQuery = "-- name: CreateOrganizationApprovedModel :one\nINSERT INTO weave.organization_approved_models (\n id, organization_id, provider_configuration_id, model_id, approved_by_user_id\n) VALUES (\n $1, $2, $3, $4, $5\n)\nRETURNING id, organization_id, provider_configuration_id, model_id, approved_by_user_id, approved_at";
@@ -266,17 +266,18 @@ async function listProjectsForChatSession(client, args) {
266
266
  exports.insertChatMessageQuery = `-- name: InsertChatMessage :one
267
267
  INSERT INTO weave.chat_messages (
268
268
  id, session_id, role, content,
269
+ reasoning_content,
269
270
  parent_message_id, tool_call_id, tool_call_state,
270
271
  model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types,
271
272
  token_usage, stream_state
272
273
  ) VALUES (
273
- $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12
274
+ $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13
274
275
  )
275
- RETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at`;
276
+ RETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content`;
276
277
  async function insertChatMessage(client, args) {
277
278
  const result = await client.query({
278
279
  text: exports.insertChatMessageQuery,
279
- values: [args.id, args.sessionId, args.role, args.content, args.parentMessageId, args.toolCallId, args.toolCallState, args.modelId, args.ephemeralAttachmentCount, args.ephemeralAttachmentMimeTypes, args.tokenUsage, args.streamState],
280
+ values: [args.id, args.sessionId, args.role, args.content, args.reasoningContent, args.parentMessageId, args.toolCallId, args.toolCallState, args.modelId, args.ephemeralAttachmentCount, args.ephemeralAttachmentMimeTypes, args.tokenUsage, args.streamState],
280
281
  rowMode: "array"
281
282
  });
282
283
  if (result.rows.length !== 1) {
@@ -297,11 +298,12 @@ async function insertChatMessage(client, args) {
297
298
  tokenUsage: row[10],
298
299
  streamState: row[11],
299
300
  createdAt: row[12],
300
- completedAt: row[13]
301
+ completedAt: row[13],
302
+ reasoningContent: row[14]
301
303
  };
302
304
  }
303
305
  exports.getChatMessageQuery = `-- name: GetChatMessage :one
304
- SELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at FROM weave.chat_messages WHERE id = $1`;
306
+ SELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content FROM weave.chat_messages WHERE id = $1`;
305
307
  async function getChatMessage(client, args) {
306
308
  const result = await client.query({
307
309
  text: exports.getChatMessageQuery,
@@ -326,11 +328,12 @@ async function getChatMessage(client, args) {
326
328
  tokenUsage: row[10],
327
329
  streamState: row[11],
328
330
  createdAt: row[12],
329
- completedAt: row[13]
331
+ completedAt: row[13],
332
+ reasoningContent: row[14]
330
333
  };
331
334
  }
332
335
  exports.listChatMessagesForSessionQuery = `-- name: ListChatMessagesForSession :many
333
- SELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at FROM weave.chat_messages
336
+ SELECT id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content FROM weave.chat_messages
334
337
  WHERE session_id = $1
335
338
  ORDER BY created_at`;
336
339
  async function listChatMessagesForSession(client, args) {
@@ -354,7 +357,8 @@ async function listChatMessagesForSession(client, args) {
354
357
  tokenUsage: row[10],
355
358
  streamState: row[11],
356
359
  createdAt: row[12],
357
- completedAt: row[13]
360
+ completedAt: row[13],
361
+ reasoningContent: row[14]
358
362
  };
359
363
  });
360
364
  }
@@ -362,7 +366,7 @@ exports.updateChatMessageToolCallStateQuery = `-- name: UpdateChatMessageToolCal
362
366
  UPDATE weave.chat_messages
363
367
  SET tool_call_state = $2
364
368
  WHERE id = $1
365
- RETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at`;
369
+ RETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content`;
366
370
  async function updateChatMessageToolCallState(client, args) {
367
371
  const result = await client.query({
368
372
  text: exports.updateChatMessageToolCallStateQuery,
@@ -387,21 +391,23 @@ async function updateChatMessageToolCallState(client, args) {
387
391
  tokenUsage: row[10],
388
392
  streamState: row[11],
389
393
  createdAt: row[12],
390
- completedAt: row[13]
394
+ completedAt: row[13],
395
+ reasoningContent: row[14]
391
396
  };
392
397
  }
393
398
  exports.completeChatMessageQuery = `-- name: CompleteChatMessage :one
394
399
  UPDATE weave.chat_messages
395
400
  SET stream_state = $2,
396
401
  content = $3,
397
- token_usage = $4,
402
+ reasoning_content = $4,
403
+ token_usage = $5,
398
404
  completed_at = now()
399
405
  WHERE id = $1
400
- RETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at`;
406
+ RETURNING id, session_id, role, content, parent_message_id, tool_call_id, tool_call_state, model_id, ephemeral_attachment_count, ephemeral_attachment_mime_types, token_usage, stream_state, created_at, completed_at, reasoning_content`;
401
407
  async function completeChatMessage(client, args) {
402
408
  const result = await client.query({
403
409
  text: exports.completeChatMessageQuery,
404
- values: [args.id, args.streamState, args.content, args.tokenUsage],
410
+ values: [args.id, args.streamState, args.content, args.reasoningContent, args.tokenUsage],
405
411
  rowMode: "array"
406
412
  });
407
413
  if (result.rows.length !== 1) {
@@ -422,7 +428,8 @@ async function completeChatMessage(client, args) {
422
428
  tokenUsage: row[10],
423
429
  streamState: row[11],
424
430
  createdAt: row[12],
425
- completedAt: row[13]
431
+ completedAt: row[13],
432
+ reasoningContent: row[14]
426
433
  };
427
434
  }
428
435
  exports.createOrganizationApprovedModelQuery = `-- name: CreateOrganizationApprovedModel :one
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weave-typescript",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -31,7 +31,7 @@
31
31
  "devDependencies": {
32
32
  "@types/node": "^25.2.0",
33
33
  "@types/pg": "^8.15.5",
34
- "@typescript/native-preview": "7.0.0-dev.20260417.1"
34
+ "@typescript/native-preview": "7.0.0-dev.20260419.1"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "node tools/sqlcgen.test.js",