wirejs-resources 0.1.166 → 0.1.167

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.
@@ -30,12 +30,11 @@ export type AssistantMessage = {
30
30
  export type ToolMessage = {
31
31
  /** Always 'tool' for tool execution results */
32
32
  role: 'tool';
33
- /** Result content from the tool execution */
34
- content: string;
35
- /** Name of the tool that was executed */
36
- tool_name: string;
37
- /** ID linking this result to the original tool call */
38
- tool_call_id: string;
33
+ content: {
34
+ id: string;
35
+ content: string;
36
+ isError?: boolean;
37
+ }[];
39
38
  };
40
39
  /** Union of all possible message types in conversation history */
41
40
  export type LLMMessage = UserMessage | AssistantMessage | ToolMessage;
@@ -141,7 +141,10 @@ export class LLM extends Resource {
141
141
  content: finalSystemPrompt
142
142
  }
143
143
  ] : []),
144
- ...history
144
+ ...history.map(m => m.role === 'tool' ? {
145
+ role: 'tool',
146
+ content: JSON.stringify(m.content, null, 2)
147
+ } : m)
145
148
  ],
146
149
  stream,
147
150
  ...(ollamaTools.length > 0 ? { tools: ollamaTools } : {}),
@@ -166,11 +169,7 @@ export class LLM extends Resource {
166
169
  return message;
167
170
  }
168
171
  else {
169
- // Fallback: create assistant message
170
- return {
171
- role: 'assistant',
172
- content: message.content
173
- };
172
+ throw new Error(`Unexpected message format: ${message}`);
174
173
  }
175
174
  }
176
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-resources",
3
- "version": "0.1.166",
3
+ "version": "0.1.167",
4
4
  "description": "Basic services and server-side resources for wirejs apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",