osagent 0.2.88 → 0.2.90

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.
Files changed (2) hide show
  1. package/cli.js +24 -13
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -133088,7 +133088,7 @@ var init_geminiContentGenerator = __esm({
133088
133088
  }
133089
133089
  models;
133090
133090
  constructor(contentGeneratorConfig, config2) {
133091
- const version3 = "0.2.88";
133091
+ const version3 = "0.2.90";
133092
133092
  const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
133093
133093
  let headers = {
133094
133094
  "User-Agent": userAgent2
@@ -146973,19 +146973,19 @@ var init_nativeOllamaCloudGenerator = __esm({
146973
146973
  type: "function",
146974
146974
  function: {
146975
146975
  name: part.functionCall.name || "",
146976
- arguments: JSON.stringify(part.functionCall.args || {})
146976
+ arguments: part.functionCall.args || {}
146977
146977
  }
146978
146978
  });
146979
146979
  } else if ("functionResponse" in part && part.functionResponse) {
146980
146980
  messages.push({
146981
146981
  role: "tool",
146982
- content: JSON.stringify(part.functionResponse.response),
146982
+ content: typeof part.functionResponse.response === "string" ? part.functionResponse.response : JSON.stringify(part.functionResponse.response),
146983
146983
  tool_call_id: part.functionResponse.name || ""
146984
146984
  });
146985
146985
  continue;
146986
146986
  }
146987
146987
  }
146988
- let role = content.role === "model" ? "assistant" : content.role;
146988
+ const role = content.role === "model" ? "assistant" : content.role;
146989
146989
  if (textContent2 || images.length > 0 || toolCalls.length > 0) {
146990
146990
  const message2 = { role, content: textContent2 };
146991
146991
  if (images.length > 0) {
@@ -147009,10 +147009,11 @@ var init_nativeOllamaCloudGenerator = __esm({
147009
147009
  }
147010
147010
  if (ollamaResponse.message?.tool_calls) {
147011
147011
  for (const toolCall of ollamaResponse.message.tool_calls) {
147012
+ const args = typeof toolCall.function.arguments === "string" ? JSON.parse(toolCall.function.arguments || "{}") : toolCall.function.arguments || {};
147012
147013
  parts.push({
147013
147014
  functionCall: {
147014
147015
  name: toolCall.function.name,
147015
- args: JSON.parse(toolCall.function.arguments || "{}")
147016
+ args
147016
147017
  }
147017
147018
  });
147018
147019
  }
@@ -147065,13 +147066,16 @@ var init_nativeOllamaCloudGenerator = __esm({
147065
147066
  num_predict: request4.config?.maxOutputTokens
147066
147067
  }
147067
147068
  };
147069
+ const requestBody = JSON.stringify(ollamaRequest);
147070
+ console.error(`[DEBUG] Request body length: ${requestBody.length}`);
147071
+ console.error(`[DEBUG] Tools in request:`, JSON.stringify(ollamaRequest.tools?.slice(0, 2), null, 2));
147068
147072
  const controller = new AbortController();
147069
147073
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
147070
147074
  try {
147071
147075
  const response = await fetch(this.baseUrl, {
147072
147076
  method: "POST",
147073
147077
  headers: this.buildHeaders(),
147074
- body: JSON.stringify(ollamaRequest),
147078
+ body: requestBody,
147075
147079
  signal: request4.config?.abortSignal || controller.signal
147076
147080
  });
147077
147081
  clearTimeout(timeoutId);
@@ -147119,10 +147123,15 @@ var init_nativeOllamaCloudGenerator = __esm({
147119
147123
  num_predict: request4.config?.maxOutputTokens
147120
147124
  }
147121
147125
  };
147126
+ const requestBody = JSON.stringify(ollamaRequest);
147127
+ console.error(`[DEBUG STREAM] Request body length: ${requestBody.length}`);
147128
+ console.error(`[DEBUG STREAM] Tools count: ${ollamaTools?.length || 0}`);
147129
+ console.error(`[DEBUG STREAM] Messages count: ${messages.length}`);
147130
+ console.error(`[DEBUG STREAM] Messages:`, JSON.stringify(messages, null, 2));
147122
147131
  const response = await fetch(this.baseUrl, {
147123
147132
  method: "POST",
147124
147133
  headers: this.buildHeaders(),
147125
- body: JSON.stringify(ollamaRequest),
147134
+ body: requestBody,
147126
147135
  signal: request4.config?.abortSignal
147127
147136
  });
147128
147137
  if (!response.ok) {
@@ -147155,10 +147164,11 @@ var init_nativeOllamaCloudGenerator = __esm({
147155
147164
  }
147156
147165
  if (chunk.message?.tool_calls) {
147157
147166
  for (const toolCall of chunk.message.tool_calls) {
147167
+ const args = typeof toolCall.function.arguments === "string" ? JSON.parse(toolCall.function.arguments || "{}") : toolCall.function.arguments || {};
147158
147168
  parts.push({
147159
147169
  functionCall: {
147160
147170
  name: toolCall.function.name,
147161
- args: JSON.parse(toolCall.function.arguments || "{}")
147171
+ args
147162
147172
  }
147163
147173
  });
147164
147174
  }
@@ -147202,10 +147212,11 @@ var init_nativeOllamaCloudGenerator = __esm({
147202
147212
  }
147203
147213
  if (chunk.message?.tool_calls) {
147204
147214
  for (const toolCall of chunk.message.tool_calls) {
147215
+ const args = typeof toolCall.function.arguments === "string" ? JSON.parse(toolCall.function.arguments || "{}") : toolCall.function.arguments || {};
147205
147216
  parts.push({
147206
147217
  functionCall: {
147207
147218
  name: toolCall.function.name,
147208
- args: JSON.parse(toolCall.function.arguments || "{}")
147219
+ args
147209
147220
  }
147210
147221
  });
147211
147222
  }
@@ -153384,7 +153395,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
153384
153395
  };
153385
153396
  }
153386
153397
  async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
153387
- const version3 = "0.2.88";
153398
+ const version3 = "0.2.90";
153388
153399
  const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
153389
153400
  const baseHeaders = {
153390
153401
  "User-Agent": userAgent2
@@ -341285,7 +341296,7 @@ __name(getPackageJson, "getPackageJson");
341285
341296
  // packages/cli/src/utils/version.ts
341286
341297
  async function getCliVersion() {
341287
341298
  const pkgJson = await getPackageJson();
341288
- return "0.2.88";
341299
+ return "0.2.90";
341289
341300
  }
341290
341301
  __name(getCliVersion, "getCliVersion");
341291
341302
 
@@ -341700,8 +341711,8 @@ import { homedir as homedir13, platform as platform14, release as release3, cpus
341700
341711
 
341701
341712
  // packages/cli/src/generated/git-commit.ts
341702
341713
  init_esbuild_shims();
341703
- var GIT_COMMIT_INFO2 = "719f0f9";
341704
- var CLI_VERSION2 = "0.2.88";
341714
+ var GIT_COMMIT_INFO2 = "9967a4d";
341715
+ var CLI_VERSION2 = "0.2.90";
341705
341716
 
341706
341717
  // packages/cli/src/commands/doctor.ts
341707
341718
  var C = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osagent",
3
- "version": "0.2.88",
3
+ "version": "0.2.90",
4
4
  "description": "OS Agent - AI-powered CLI for autonomous coding with Ollama Cloud and Qwen models",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "locales"
21
21
  ],
22
22
  "config": {
23
- "sandboxImageUri": "ghcr.io/osagent/osagent:0.2.88"
23
+ "sandboxImageUri": "ghcr.io/osagent/osagent:0.2.90"
24
24
  },
25
25
  "dependencies": {
26
26
  "punycode": "^2.3.1"