osagent 0.1.97 → 0.1.99

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.
package/cli.js CHANGED
@@ -141747,6 +141747,14 @@ var init_openai = __esm({
141747
141747
  });
141748
141748
 
141749
141749
  // packages/core/dist/src/core/credentialValidator.js
141750
+ var credentialValidator_exports = {};
141751
+ __export(credentialValidator_exports, {
141752
+ getProviderHelpText: () => getProviderHelpText,
141753
+ validateGroqCredentials: () => validateGroqCredentials,
141754
+ validateOllamaCloudCredentials: () => validateOllamaCloudCredentials,
141755
+ validateOllamaLocalCredentials: () => validateOllamaLocalCredentials,
141756
+ validateOpenAICredentials: () => validateOpenAICredentials
141757
+ });
141750
141758
  function getProviderHelpText(authType) {
141751
141759
  return PROVIDER_HELP_TEXT[authType] || "Please check your API key and try again";
141752
141760
  }
@@ -141760,9 +141768,9 @@ async function validateOpenAICredentials(client, authType, timeout2 = DEFAULT_VA
141760
141768
  }
141761
141769
  }
141762
141770
  async function validateOllamaCloudCredentials(apiKey, timeout2 = DEFAULT_VALIDATION_TIMEOUT) {
141763
- const baseUrl = "https://ollama.com/v1";
141771
+ const baseUrl = "https://ollama.com";
141764
141772
  try {
141765
- const response = await fetch(`${baseUrl}/models`, {
141773
+ const response = await fetch(`${baseUrl}/api/tags`, {
141766
141774
  method: "GET",
141767
141775
  headers: {
141768
141776
  Authorization: `Bearer ${apiKey}`,
@@ -141852,9 +141860,9 @@ var init_credentialValidator = __esm({
141852
141860
  init_contentGenerator();
141853
141861
  DEFAULT_VALIDATION_TIMEOUT = 5e3;
141854
141862
  PROVIDER_HELP_TEXT = {
141855
- [AuthType2.USE_GROQ]: "Get your API key at: https://console.groq.com/keys",
141856
- [AuthType2.OLLAMA_CLOUD]: "Get your API key at: https://ollama.com/settings/keys",
141857
- [AuthType2.OLLAMA_LOCAL]: "Ensure Ollama is running with: ollama serve",
141863
+ [AuthType2.USE_GROQ]: "Get your API key at: https://console.groq.com/keys\nSet it with: export GROQ_API_KEY=your_key",
141864
+ [AuthType2.OLLAMA_CLOUD]: "Get your API key at: https://ollama.com/settings/keys\nSet it with: export OLLAMA_API_KEY=your_key\nCloud models use format: qwen3-coder:480b-cloud",
141865
+ [AuthType2.OLLAMA_LOCAL]: "Ensure Ollama is running with: ollama serve\nPull models with: ollama pull qwen3-coder",
141858
141866
  [AuthType2.USE_OPENAI]: "Verify your API key at your provider dashboard"
141859
141867
  };
141860
141868
  __name(getProviderHelpText, "getProviderHelpText");
@@ -148117,6 +148125,435 @@ var init_openaiContentGenerator2 = __esm({
148117
148125
  }
148118
148126
  });
148119
148127
 
148128
+ // packages/core/dist/src/core/ollamaContentGenerator/index.js
148129
+ var ollamaContentGenerator_exports = {};
148130
+ __export(ollamaContentGenerator_exports, {
148131
+ OllamaContentGenerator: () => OllamaContentGenerator,
148132
+ createOllamaContentGenerator: () => createOllamaContentGenerator
148133
+ });
148134
+ function getEffectiveOllamaUrl2() {
148135
+ const ollamaHost = process.env["OLLAMA_HOST"];
148136
+ if (ollamaHost) {
148137
+ const url3 = ollamaHost.startsWith("http") ? ollamaHost : `http://${ollamaHost}`;
148138
+ return url3.replace(/\/$/, "");
148139
+ }
148140
+ const ollamaBaseUrl = process.env["OLLAMA_BASE_URL"];
148141
+ if (ollamaBaseUrl) {
148142
+ return ollamaBaseUrl.replace(/\/v1\/?$/, "").replace(/\/$/, "");
148143
+ }
148144
+ return "http://localhost:11434";
148145
+ }
148146
+ function isContentObject(content) {
148147
+ return typeof content === "object" && content !== null && "role" in content;
148148
+ }
148149
+ function createOllamaContentGenerator(config2, cliConfig) {
148150
+ return new OllamaContentGenerator(config2, cliConfig);
148151
+ }
148152
+ var OllamaContentGenerator;
148153
+ var init_ollamaContentGenerator = __esm({
148154
+ "packages/core/dist/src/core/ollamaContentGenerator/index.js"() {
148155
+ "use strict";
148156
+ init_esbuild_shims();
148157
+ __name(getEffectiveOllamaUrl2, "getEffectiveOllamaUrl");
148158
+ __name(isContentObject, "isContentObject");
148159
+ OllamaContentGenerator = class {
148160
+ static {
148161
+ __name(this, "OllamaContentGenerator");
148162
+ }
148163
+ config;
148164
+ baseUrl;
148165
+ constructor(config2, _cliConfig) {
148166
+ this.config = config2;
148167
+ this.baseUrl = config2.baseUrl?.replace(/\/v1\/?$/, "").replace(/\/$/, "") || getEffectiveOllamaUrl2();
148168
+ }
148169
+ /**
148170
+ * Check if this is Ollama Cloud (requires auth)
148171
+ */
148172
+ isCloud() {
148173
+ return this.baseUrl.includes("ollama.com");
148174
+ }
148175
+ /**
148176
+ * Build headers for Ollama API requests
148177
+ */
148178
+ buildHeaders() {
148179
+ const headers = {
148180
+ "Content-Type": "application/json"
148181
+ };
148182
+ if (this.isCloud() && this.config.apiKey) {
148183
+ headers["Authorization"] = `Bearer ${this.config.apiKey}`;
148184
+ }
148185
+ return headers;
148186
+ }
148187
+ /**
148188
+ * Extract text content from a ContentUnion
148189
+ */
148190
+ extractTextFromContentUnion(content) {
148191
+ if (typeof content === "string") {
148192
+ return content;
148193
+ }
148194
+ if (isContentObject(content) && content.parts) {
148195
+ return this.extractTextFromParts(content.parts);
148196
+ }
148197
+ return "";
148198
+ }
148199
+ /**
148200
+ * Extract text content from parts
148201
+ */
148202
+ extractTextFromParts(parts) {
148203
+ return parts.map((part) => {
148204
+ if (typeof part === "string")
148205
+ return part;
148206
+ if (part && typeof part === "object" && "text" in part)
148207
+ return part.text;
148208
+ return "";
148209
+ }).join("");
148210
+ }
148211
+ /**
148212
+ * Check if a part is a function call
148213
+ */
148214
+ isFunctionCall(part) {
148215
+ return part !== null && typeof part === "object" && "functionCall" in part;
148216
+ }
148217
+ /**
148218
+ * Check if a part is a function response
148219
+ */
148220
+ isFunctionResponse(part) {
148221
+ return part !== null && typeof part === "object" && "functionResponse" in part;
148222
+ }
148223
+ /**
148224
+ * Convert GenerateContentParameters to Ollama format
148225
+ */
148226
+ convertToOllamaRequest(params) {
148227
+ const messages = [];
148228
+ if (params.config?.systemInstruction) {
148229
+ const systemContent = this.extractTextFromContentUnion(params.config.systemInstruction);
148230
+ if (systemContent) {
148231
+ messages.push({
148232
+ role: "system",
148233
+ content: systemContent
148234
+ });
148235
+ }
148236
+ }
148237
+ const contents = params.contents;
148238
+ if (Array.isArray(contents)) {
148239
+ for (const content of contents) {
148240
+ if (!content)
148241
+ continue;
148242
+ if (typeof content === "string") {
148243
+ messages.push({
148244
+ role: "user",
148245
+ content
148246
+ });
148247
+ } else if (isContentObject(content)) {
148248
+ const parts = content.parts || [];
148249
+ const functionCalls = parts.filter((p) => this.isFunctionCall(p));
148250
+ const functionResponses = parts.filter((p) => this.isFunctionResponse(p));
148251
+ if (functionCalls.length > 0 && content.role === "model") {
148252
+ const textParts = parts.filter((p) => !this.isFunctionCall(p) && !this.isFunctionResponse(p));
148253
+ const textContent2 = this.extractTextFromParts(textParts);
148254
+ const toolCalls = functionCalls.map((fc, index) => {
148255
+ const funcCall = fc;
148256
+ return {
148257
+ type: "function",
148258
+ function: {
148259
+ index,
148260
+ name: funcCall.functionCall.name,
148261
+ arguments: funcCall.functionCall.args || {}
148262
+ }
148263
+ };
148264
+ });
148265
+ messages.push({
148266
+ role: "assistant",
148267
+ content: textContent2 || "",
148268
+ tool_calls: toolCalls
148269
+ });
148270
+ } else if (functionResponses.length > 0) {
148271
+ for (const fr of functionResponses) {
148272
+ const funcResp = fr;
148273
+ const responseContent = typeof funcResp.functionResponse.response === "string" ? funcResp.functionResponse.response : JSON.stringify(funcResp.functionResponse.response);
148274
+ messages.push({
148275
+ role: "tool",
148276
+ tool_name: funcResp.functionResponse.name,
148277
+ content: responseContent
148278
+ });
148279
+ }
148280
+ } else {
148281
+ const role = content.role === "model" ? "assistant" : content.role;
148282
+ const text = this.extractTextFromParts(parts);
148283
+ if (text) {
148284
+ messages.push({
148285
+ role,
148286
+ content: text
148287
+ });
148288
+ }
148289
+ }
148290
+ }
148291
+ }
148292
+ } else if (contents) {
148293
+ if (typeof contents === "string") {
148294
+ messages.push({
148295
+ role: "user",
148296
+ content: contents
148297
+ });
148298
+ } else if (isContentObject(contents)) {
148299
+ const role = contents.role === "model" ? "assistant" : contents.role;
148300
+ const text = this.extractTextFromParts(contents.parts || []);
148301
+ if (text) {
148302
+ messages.push({
148303
+ role,
148304
+ content: text
148305
+ });
148306
+ }
148307
+ }
148308
+ }
148309
+ const model = params.model || this.config.model;
148310
+ const request4 = {
148311
+ model,
148312
+ messages,
148313
+ stream: false
148314
+ };
148315
+ if (params.config?.tools && Array.isArray(params.config.tools)) {
148316
+ const ollamaTools = [];
148317
+ for (const tool of params.config.tools) {
148318
+ if (tool && typeof tool === "object" && "functionDeclarations" in tool) {
148319
+ const funcDecls = tool.functionDeclarations;
148320
+ for (const func of funcDecls) {
148321
+ ollamaTools.push({
148322
+ type: "function",
148323
+ function: {
148324
+ name: func.name,
148325
+ description: func.description || "",
148326
+ parameters: func.parameters || { type: "object", properties: {} }
148327
+ }
148328
+ });
148329
+ }
148330
+ }
148331
+ }
148332
+ if (ollamaTools.length > 0) {
148333
+ request4.tools = ollamaTools;
148334
+ }
148335
+ }
148336
+ if (this.config.samplingParams) {
148337
+ request4.options = {};
148338
+ if (this.config.samplingParams.temperature !== void 0) {
148339
+ request4.options.temperature = this.config.samplingParams.temperature;
148340
+ }
148341
+ if (this.config.samplingParams.top_p !== void 0) {
148342
+ request4.options.top_p = this.config.samplingParams.top_p;
148343
+ }
148344
+ if (this.config.samplingParams.top_k !== void 0) {
148345
+ request4.options.top_k = this.config.samplingParams.top_k;
148346
+ }
148347
+ if (this.config.samplingParams.max_tokens !== void 0) {
148348
+ request4.options.num_predict = this.config.samplingParams.max_tokens;
148349
+ }
148350
+ if (this.config.samplingParams.repetition_penalty !== void 0) {
148351
+ request4.options.repeat_penalty = this.config.samplingParams.repetition_penalty;
148352
+ }
148353
+ if (this.config.samplingParams.presence_penalty !== void 0) {
148354
+ request4.options.presence_penalty = this.config.samplingParams.presence_penalty;
148355
+ }
148356
+ if (this.config.samplingParams.frequency_penalty !== void 0) {
148357
+ request4.options.frequency_penalty = this.config.samplingParams.frequency_penalty;
148358
+ }
148359
+ }
148360
+ return request4;
148361
+ }
148362
+ /**
148363
+ * Convert Ollama response to GenerateContentResponse format
148364
+ */
148365
+ convertFromOllamaResponse(response) {
148366
+ const parts = [];
148367
+ if (response.message.content) {
148368
+ parts.push({ text: response.message.content });
148369
+ }
148370
+ if (response.message.tool_calls && response.message.tool_calls.length > 0) {
148371
+ for (const toolCall of response.message.tool_calls) {
148372
+ parts.push({
148373
+ functionCall: {
148374
+ name: toolCall.function.name,
148375
+ args: toolCall.function.arguments
148376
+ }
148377
+ });
148378
+ }
148379
+ }
148380
+ if (parts.length === 0) {
148381
+ parts.push({ text: "" });
148382
+ }
148383
+ return {
148384
+ candidates: [
148385
+ {
148386
+ content: {
148387
+ role: "model",
148388
+ parts
148389
+ },
148390
+ finishReason: response.message.tool_calls?.length ? "TOOL_USE" : response.done_reason === "stop" ? "STOP" : "OTHER",
148391
+ index: 0
148392
+ }
148393
+ ],
148394
+ usageMetadata: {
148395
+ promptTokenCount: response.prompt_eval_count || 0,
148396
+ candidatesTokenCount: response.eval_count || 0,
148397
+ totalTokenCount: (response.prompt_eval_count || 0) + (response.eval_count || 0)
148398
+ },
148399
+ modelVersion: response.model
148400
+ };
148401
+ }
148402
+ /**
148403
+ * Generate content using Ollama API
148404
+ */
148405
+ async generateContent(request4, _userPromptId) {
148406
+ const ollamaRequest = this.convertToOllamaRequest(request4);
148407
+ ollamaRequest.stream = false;
148408
+ const url3 = `${this.baseUrl}/api/chat`;
148409
+ const headers = this.buildHeaders();
148410
+ const response = await fetch(url3, {
148411
+ method: "POST",
148412
+ headers,
148413
+ body: JSON.stringify(ollamaRequest)
148414
+ });
148415
+ if (!response.ok) {
148416
+ const errorText = await response.text();
148417
+ throw new Error(`Ollama API error: ${response.status} ${response.statusText} - ${errorText}`);
148418
+ }
148419
+ const ollamaResponse = await response.json();
148420
+ return this.convertFromOllamaResponse(ollamaResponse);
148421
+ }
148422
+ /**
148423
+ * Generate content stream using Ollama API
148424
+ */
148425
+ async generateContentStream(request4, _userPromptId) {
148426
+ const ollamaRequest = this.convertToOllamaRequest(request4);
148427
+ ollamaRequest.stream = true;
148428
+ const url3 = `${this.baseUrl}/api/chat`;
148429
+ const headers = this.buildHeaders();
148430
+ const response = await fetch(url3, {
148431
+ method: "POST",
148432
+ headers,
148433
+ body: JSON.stringify(ollamaRequest)
148434
+ });
148435
+ if (!response.ok) {
148436
+ const errorText = await response.text();
148437
+ throw new Error(`Ollama API error: ${response.status} ${response.statusText} - ${errorText}`);
148438
+ }
148439
+ const reader = response.body?.getReader();
148440
+ if (!reader) {
148441
+ throw new Error("No response body");
148442
+ }
148443
+ const decoder2 = new TextDecoder();
148444
+ async function* streamGenerator() {
148445
+ let buffer = "";
148446
+ const accumulatedToolCalls = [];
148447
+ while (true) {
148448
+ const { done, value } = await reader.read();
148449
+ if (done)
148450
+ break;
148451
+ buffer += decoder2.decode(value, { stream: true });
148452
+ const lines = buffer.split("\n");
148453
+ buffer = lines.pop() || "";
148454
+ for (const line of lines) {
148455
+ if (!line.trim())
148456
+ continue;
148457
+ try {
148458
+ const chunk = JSON.parse(line);
148459
+ if (chunk.message.tool_calls?.length) {
148460
+ accumulatedToolCalls.push(...chunk.message.tool_calls);
148461
+ }
148462
+ const parts = [];
148463
+ if (chunk.message.content) {
148464
+ parts.push({ text: chunk.message.content });
148465
+ }
148466
+ if (chunk.done && accumulatedToolCalls.length > 0) {
148467
+ for (const toolCall of accumulatedToolCalls) {
148468
+ parts.push({
148469
+ functionCall: {
148470
+ name: toolCall.function.name,
148471
+ args: toolCall.function.arguments
148472
+ }
148473
+ });
148474
+ }
148475
+ }
148476
+ if (parts.length === 0) {
148477
+ parts.push({ text: "" });
148478
+ }
148479
+ yield {
148480
+ candidates: [
148481
+ {
148482
+ content: {
148483
+ role: "model",
148484
+ parts
148485
+ },
148486
+ finishReason: chunk.done ? accumulatedToolCalls.length > 0 ? "TOOL_USE" : "STOP" : void 0,
148487
+ index: 0
148488
+ }
148489
+ ]
148490
+ };
148491
+ } catch {
148492
+ }
148493
+ }
148494
+ }
148495
+ if (buffer.trim()) {
148496
+ try {
148497
+ const chunk = JSON.parse(buffer);
148498
+ if (chunk.message.tool_calls?.length) {
148499
+ accumulatedToolCalls.push(...chunk.message.tool_calls);
148500
+ }
148501
+ const parts = [];
148502
+ if (chunk.message.content) {
148503
+ parts.push({ text: chunk.message.content });
148504
+ }
148505
+ if (accumulatedToolCalls.length > 0) {
148506
+ for (const toolCall of accumulatedToolCalls) {
148507
+ parts.push({
148508
+ functionCall: {
148509
+ name: toolCall.function.name,
148510
+ args: toolCall.function.arguments
148511
+ }
148512
+ });
148513
+ }
148514
+ }
148515
+ if (parts.length === 0) {
148516
+ parts.push({ text: "" });
148517
+ }
148518
+ yield {
148519
+ candidates: [
148520
+ {
148521
+ content: {
148522
+ role: "model",
148523
+ parts
148524
+ },
148525
+ finishReason: chunk.done ? accumulatedToolCalls.length > 0 ? "TOOL_USE" : "STOP" : void 0,
148526
+ index: 0
148527
+ }
148528
+ ]
148529
+ };
148530
+ } catch {
148531
+ }
148532
+ }
148533
+ }
148534
+ __name(streamGenerator, "streamGenerator");
148535
+ return streamGenerator();
148536
+ }
148537
+ /**
148538
+ * Count tokens - Ollama doesn't have a direct token counting API,
148539
+ * so we estimate based on character count
148540
+ */
148541
+ async countTokens(_request) {
148542
+ return {
148543
+ totalTokens: 0
148544
+ };
148545
+ }
148546
+ /**
148547
+ * Embed content - Use Ollama's embedding API if available
148548
+ */
148549
+ async embedContent(_request) {
148550
+ throw new Error("Embedding not supported by Ollama content generator");
148551
+ }
148552
+ };
148553
+ __name(createOllamaContentGenerator, "createOllamaContentGenerator");
148554
+ }
148555
+ });
148556
+
148120
148557
  // packages/core/dist/src/qwen/qwenContentGenerator.js
148121
148558
  var qwenContentGenerator_exports = {};
148122
148559
  __export(qwenContentGenerator_exports, {
@@ -148269,7 +148706,7 @@ var init_qwenContentGenerator = __esm({
148269
148706
  });
148270
148707
 
148271
148708
  // packages/core/dist/src/core/contentGenerator.js
148272
- function getEffectiveOllamaUrl2(includeV1 = true) {
148709
+ function getEffectiveOllamaUrl3(includeV1 = true) {
148273
148710
  const ollamaHost = process.env["OLLAMA_HOST"];
148274
148711
  if (ollamaHost) {
148275
148712
  const url3 = ollamaHost.startsWith("http") ? ollamaHost : `http://${ollamaHost}`;
@@ -148343,7 +148780,8 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
148343
148780
  return {
148344
148781
  ...baseConfig,
148345
148782
  model: ollamaModel,
148346
- baseUrl: "https://ollama.com/v1",
148783
+ // Ollama Cloud uses native API at https://ollama.com/api/chat (NOT OpenAI-compatible)
148784
+ baseUrl: "https://ollama.com",
148347
148785
  apiKey: ollamaApiKey,
148348
148786
  authType: AuthType2.OLLAMA_CLOUD,
148349
148787
  // Ollama doesn't need special cache control handling
@@ -148358,7 +148796,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
148358
148796
  return {
148359
148797
  ...baseConfig,
148360
148798
  model: ollamaModel,
148361
- baseUrl: getEffectiveOllamaUrl2(true),
148799
+ baseUrl: getEffectiveOllamaUrl3(true),
148362
148800
  // Gets OLLAMA_HOST or defaults to localhost:11434/v1
148363
148801
  apiKey: "ollama",
148364
148802
  authType: AuthType2.OLLAMA_LOCAL,
@@ -148394,7 +148832,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
148394
148832
  };
148395
148833
  }
148396
148834
  async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
148397
- const version3 = "0.1.97";
148835
+ const version3 = "0.1.99";
148398
148836
  const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
148399
148837
  const baseHeaders = {
148400
148838
  "User-Agent": userAgent2
@@ -148432,15 +148870,12 @@ async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAu
148432
148870
  return result instanceof Promise ? await result : result;
148433
148871
  }
148434
148872
  if (config2.authType === AuthType2.OLLAMA_CLOUD) {
148435
- const { createOpenAIContentGenerator: createOpenAIContentGenerator2 } = await Promise.resolve().then(() => (init_openaiContentGenerator2(), openaiContentGenerator_exports));
148436
- const cloudConfig = {
148437
- ...config2,
148438
- baseUrl: config2.baseUrl?.includes("/v1") ? config2.baseUrl : `${config2.baseUrl}/v1`
148439
- };
148440
- const result = createOpenAIContentGenerator2(cloudConfig, gcConfig, {
148441
- validateCredentials: isInitialAuth
148442
- });
148443
- return result instanceof Promise ? await result : result;
148873
+ const { createOllamaContentGenerator: createOllamaContentGenerator2 } = await Promise.resolve().then(() => (init_ollamaContentGenerator(), ollamaContentGenerator_exports));
148874
+ if (isInitialAuth && config2.apiKey) {
148875
+ const { validateOllamaCloudCredentials: validateOllamaCloudCredentials2 } = await Promise.resolve().then(() => (init_credentialValidator(), credentialValidator_exports));
148876
+ await validateOllamaCloudCredentials2(config2.apiKey);
148877
+ }
148878
+ return createOllamaContentGenerator2(config2, gcConfig);
148444
148879
  }
148445
148880
  if (config2.authType === AuthType2.OLLAMA_LOCAL) {
148446
148881
  const { createOpenAIContentGenerator: createOpenAIContentGenerator2 } = await Promise.resolve().then(() => (init_openaiContentGenerator2(), openaiContentGenerator_exports));
@@ -148481,7 +148916,7 @@ var init_contentGenerator = __esm({
148481
148916
  init_models();
148482
148917
  init_installationManager();
148483
148918
  init_loggingContentGenerator();
148484
- __name(getEffectiveOllamaUrl2, "getEffectiveOllamaUrl");
148919
+ __name(getEffectiveOllamaUrl3, "getEffectiveOllamaUrl");
148485
148920
  (function(AuthType4) {
148486
148921
  AuthType4["LOGIN_WITH_OSAGENT"] = "oauth-personal";
148487
148922
  AuthType4["USE_OSA"] = "OSA-api-key";
@@ -337381,7 +337816,7 @@ __name(getPackageJson, "getPackageJson");
337381
337816
  // packages/cli/src/utils/version.ts
337382
337817
  async function getCliVersion() {
337383
337818
  const pkgJson = await getPackageJson();
337384
- return "0.1.97";
337819
+ return "0.1.99";
337385
337820
  }
337386
337821
  __name(getCliVersion, "getCliVersion");
337387
337822
 
@@ -341589,8 +342024,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
341589
342024
 
341590
342025
  // packages/cli/src/generated/git-commit.ts
341591
342026
  init_esbuild_shims();
341592
- var GIT_COMMIT_INFO2 = "36be68d";
341593
- var CLI_VERSION2 = "0.1.97";
342027
+ var GIT_COMMIT_INFO2 = "c951f76";
342028
+ var CLI_VERSION2 = "0.1.99";
341594
342029
 
341595
342030
  // packages/cli/src/utils/systemInfo.ts
341596
342031
  async function getNpmVersion() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osagent",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
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.1.85"
23
+ "sandboxImageUri": "ghcr.io/osagent/osagent:0.1.99"
24
24
  },
25
25
  "dependencies": {
26
26
  "punycode": "^2.3.1"
@@ -1,32 +0,0 @@
1
- (version 1)
2
-
3
- ;; allow everything by default
4
- (allow default)
5
-
6
- ;; deny all writes EXCEPT under specific paths
7
- (deny file-write*)
8
- (allow file-write*
9
- (subpath (param "TARGET_DIR"))
10
- (subpath (param "TMP_DIR"))
11
- (subpath (param "CACHE_DIR"))
12
- (subpath (string-append (param "HOME_DIR") "/.OSA"))
13
- (subpath (string-append (param "HOME_DIR") "/.npm"))
14
- (subpath (string-append (param "HOME_DIR") "/.cache"))
15
- (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
16
- ;; Allow writes to included directories from --include-directories
17
- (subpath (param "INCLUDE_DIR_0"))
18
- (subpath (param "INCLUDE_DIR_1"))
19
- (subpath (param "INCLUDE_DIR_2"))
20
- (subpath (param "INCLUDE_DIR_3"))
21
- (subpath (param "INCLUDE_DIR_4"))
22
- (literal "/dev/stdout")
23
- (literal "/dev/stderr")
24
- (literal "/dev/null")
25
- )
26
-
27
- ;; deny all inbound network traffic EXCEPT on debugger port
28
- (deny network-inbound)
29
- (allow network-inbound (local ip "localhost:9229"))
30
-
31
- ;; deny all outbound network traffic
32
- (deny network-outbound)
@@ -1,25 +0,0 @@
1
- (version 1)
2
-
3
- ;; allow everything by default
4
- (allow default)
5
-
6
- ;; deny all writes EXCEPT under specific paths
7
- (deny file-write*)
8
- (allow file-write*
9
- (subpath (param "TARGET_DIR"))
10
- (subpath (param "TMP_DIR"))
11
- (subpath (param "CACHE_DIR"))
12
- (subpath (string-append (param "HOME_DIR") "/.OSA"))
13
- (subpath (string-append (param "HOME_DIR") "/.npm"))
14
- (subpath (string-append (param "HOME_DIR") "/.cache"))
15
- (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
16
- ;; Allow writes to included directories from --include-directories
17
- (subpath (param "INCLUDE_DIR_0"))
18
- (subpath (param "INCLUDE_DIR_1"))
19
- (subpath (param "INCLUDE_DIR_2"))
20
- (subpath (param "INCLUDE_DIR_3"))
21
- (subpath (param "INCLUDE_DIR_4"))
22
- (literal "/dev/stdout")
23
- (literal "/dev/stderr")
24
- (literal "/dev/null")
25
- )
@@ -1,37 +0,0 @@
1
- (version 1)
2
-
3
- ;; allow everything by default
4
- (allow default)
5
-
6
- ;; deny all writes EXCEPT under specific paths
7
- (deny file-write*)
8
- (allow file-write*
9
- (subpath (param "TARGET_DIR"))
10
- (subpath (param "TMP_DIR"))
11
- (subpath (param "CACHE_DIR"))
12
- (subpath (string-append (param "HOME_DIR") "/.OSA"))
13
- (subpath (string-append (param "HOME_DIR") "/.npm"))
14
- (subpath (string-append (param "HOME_DIR") "/.cache"))
15
- (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
16
- ;; Allow writes to included directories from --include-directories
17
- (subpath (param "INCLUDE_DIR_0"))
18
- (subpath (param "INCLUDE_DIR_1"))
19
- (subpath (param "INCLUDE_DIR_2"))
20
- (subpath (param "INCLUDE_DIR_3"))
21
- (subpath (param "INCLUDE_DIR_4"))
22
- (literal "/dev/stdout")
23
- (literal "/dev/stderr")
24
- (literal "/dev/null")
25
- )
26
-
27
- ;; deny all inbound network traffic EXCEPT on debugger port
28
- (deny network-inbound)
29
- (allow network-inbound (local ip "localhost:9229"))
30
-
31
- ;; deny all outbound network traffic EXCEPT through proxy on localhost:8877
32
- ;; set `OSA_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
33
- ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
34
- (deny network-outbound)
35
- (allow network-outbound (remote tcp "localhost:8877"))
36
-
37
- (allow network-bind (local ip "*:*"))
@@ -1,93 +0,0 @@
1
- (version 1)
2
-
3
- ;; deny everything by default
4
- (deny default)
5
-
6
- ;; allow reading files from anywhere on host
7
- (allow file-read*)
8
-
9
- ;; allow exec/fork (children inherit policy)
10
- (allow process-exec)
11
- (allow process-fork)
12
-
13
- ;; allow signals to self, e.g. SIGPIPE on write to closed pipe
14
- (allow signal (target self))
15
-
16
- ;; allow read access to specific information about system
17
- ;; from https://source.chromium.org/chromium/chromium/src/+/main:sandbox/policy/mac/common.sb;l=273-319;drc=7b3962fe2e5fc9e2ee58000dc8fbf3429d84d3bd
18
- (allow sysctl-read
19
- (sysctl-name "hw.activecpu")
20
- (sysctl-name "hw.busfrequency_compat")
21
- (sysctl-name "hw.byteorder")
22
- (sysctl-name "hw.cacheconfig")
23
- (sysctl-name "hw.cachelinesize_compat")
24
- (sysctl-name "hw.cpufamily")
25
- (sysctl-name "hw.cpufrequency_compat")
26
- (sysctl-name "hw.cputype")
27
- (sysctl-name "hw.l1dcachesize_compat")
28
- (sysctl-name "hw.l1icachesize_compat")
29
- (sysctl-name "hw.l2cachesize_compat")
30
- (sysctl-name "hw.l3cachesize_compat")
31
- (sysctl-name "hw.logicalcpu_max")
32
- (sysctl-name "hw.machine")
33
- (sysctl-name "hw.ncpu")
34
- (sysctl-name "hw.nperflevels")
35
- (sysctl-name "hw.optional.arm.FEAT_BF16")
36
- (sysctl-name "hw.optional.arm.FEAT_DotProd")
37
- (sysctl-name "hw.optional.arm.FEAT_FCMA")
38
- (sysctl-name "hw.optional.arm.FEAT_FHM")
39
- (sysctl-name "hw.optional.arm.FEAT_FP16")
40
- (sysctl-name "hw.optional.arm.FEAT_I8MM")
41
- (sysctl-name "hw.optional.arm.FEAT_JSCVT")
42
- (sysctl-name "hw.optional.arm.FEAT_LSE")
43
- (sysctl-name "hw.optional.arm.FEAT_RDM")
44
- (sysctl-name "hw.optional.arm.FEAT_SHA512")
45
- (sysctl-name "hw.optional.armv8_2_sha512")
46
- (sysctl-name "hw.packages")
47
- (sysctl-name "hw.pagesize_compat")
48
- (sysctl-name "hw.physicalcpu_max")
49
- (sysctl-name "hw.tbfrequency_compat")
50
- (sysctl-name "hw.vectorunit")
51
- (sysctl-name "kern.hostname")
52
- (sysctl-name "kern.maxfilesperproc")
53
- (sysctl-name "kern.osproductversion")
54
- (sysctl-name "kern.osrelease")
55
- (sysctl-name "kern.ostype")
56
- (sysctl-name "kern.osvariant_status")
57
- (sysctl-name "kern.osversion")
58
- (sysctl-name "kern.secure_kernel")
59
- (sysctl-name "kern.usrstack64")
60
- (sysctl-name "kern.version")
61
- (sysctl-name "sysctl.proc_cputype")
62
- (sysctl-name-prefix "hw.perflevel")
63
- )
64
-
65
- ;; allow writes to specific paths
66
- (allow file-write*
67
- (subpath (param "TARGET_DIR"))
68
- (subpath (param "TMP_DIR"))
69
- (subpath (param "CACHE_DIR"))
70
- (subpath (string-append (param "HOME_DIR") "/.OSA"))
71
- (subpath (string-append (param "HOME_DIR") "/.npm"))
72
- (subpath (string-append (param "HOME_DIR") "/.cache"))
73
- (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
74
- ;; Allow writes to included directories from --include-directories
75
- (subpath (param "INCLUDE_DIR_0"))
76
- (subpath (param "INCLUDE_DIR_1"))
77
- (subpath (param "INCLUDE_DIR_2"))
78
- (subpath (param "INCLUDE_DIR_3"))
79
- (subpath (param "INCLUDE_DIR_4"))
80
- (literal "/dev/stdout")
81
- (literal "/dev/stderr")
82
- (literal "/dev/null")
83
- )
84
-
85
- ;; allow communication with sysmond for process listing (e.g. for pgrep)
86
- (allow mach-lookup (global-name "com.apple.sysmond"))
87
-
88
- ;; enable terminal access required by ink
89
- ;; fixes setRawMode EPERM failure (at node:tty:81:24)
90
- (allow file-ioctl (regex #"^/dev/tty.*"))
91
-
92
- ;; allow inbound network traffic on debugger port
93
- (allow network-inbound (local ip "localhost:9229"))
@@ -1,96 +0,0 @@
1
- (version 1)
2
-
3
- ;; deny everything by default
4
- (deny default)
5
-
6
- ;; allow reading files from anywhere on host
7
- (allow file-read*)
8
-
9
- ;; allow exec/fork (children inherit policy)
10
- (allow process-exec)
11
- (allow process-fork)
12
-
13
- ;; allow signals to self, e.g. SIGPIPE on write to closed pipe
14
- (allow signal (target self))
15
-
16
- ;; allow read access to specific information about system
17
- ;; from https://source.chromium.org/chromium/chromium/src/+/main:sandbox/policy/mac/common.sb;l=273-319;drc=7b3962fe2e5fc9e2ee58000dc8fbf3429d84d3bd
18
- (allow sysctl-read
19
- (sysctl-name "hw.activecpu")
20
- (sysctl-name "hw.busfrequency_compat")
21
- (sysctl-name "hw.byteorder")
22
- (sysctl-name "hw.cacheconfig")
23
- (sysctl-name "hw.cachelinesize_compat")
24
- (sysctl-name "hw.cpufamily")
25
- (sysctl-name "hw.cpufrequency_compat")
26
- (sysctl-name "hw.cputype")
27
- (sysctl-name "hw.l1dcachesize_compat")
28
- (sysctl-name "hw.l1icachesize_compat")
29
- (sysctl-name "hw.l2cachesize_compat")
30
- (sysctl-name "hw.l3cachesize_compat")
31
- (sysctl-name "hw.logicalcpu_max")
32
- (sysctl-name "hw.machine")
33
- (sysctl-name "hw.ncpu")
34
- (sysctl-name "hw.nperflevels")
35
- (sysctl-name "hw.optional.arm.FEAT_BF16")
36
- (sysctl-name "hw.optional.arm.FEAT_DotProd")
37
- (sysctl-name "hw.optional.arm.FEAT_FCMA")
38
- (sysctl-name "hw.optional.arm.FEAT_FHM")
39
- (sysctl-name "hw.optional.arm.FEAT_FP16")
40
- (sysctl-name "hw.optional.arm.FEAT_I8MM")
41
- (sysctl-name "hw.optional.arm.FEAT_JSCVT")
42
- (sysctl-name "hw.optional.arm.FEAT_LSE")
43
- (sysctl-name "hw.optional.arm.FEAT_RDM")
44
- (sysctl-name "hw.optional.arm.FEAT_SHA512")
45
- (sysctl-name "hw.optional.armv8_2_sha512")
46
- (sysctl-name "hw.packages")
47
- (sysctl-name "hw.pagesize_compat")
48
- (sysctl-name "hw.physicalcpu_max")
49
- (sysctl-name "hw.tbfrequency_compat")
50
- (sysctl-name "hw.vectorunit")
51
- (sysctl-name "kern.hostname")
52
- (sysctl-name "kern.maxfilesperproc")
53
- (sysctl-name "kern.osproductversion")
54
- (sysctl-name "kern.osrelease")
55
- (sysctl-name "kern.ostype")
56
- (sysctl-name "kern.osvariant_status")
57
- (sysctl-name "kern.osversion")
58
- (sysctl-name "kern.secure_kernel")
59
- (sysctl-name "kern.usrstack64")
60
- (sysctl-name "kern.version")
61
- (sysctl-name "sysctl.proc_cputype")
62
- (sysctl-name-prefix "hw.perflevel")
63
- )
64
-
65
- ;; allow writes to specific paths
66
- (allow file-write*
67
- (subpath (param "TARGET_DIR"))
68
- (subpath (param "TMP_DIR"))
69
- (subpath (param "CACHE_DIR"))
70
- (subpath (string-append (param "HOME_DIR") "/.OSA"))
71
- (subpath (string-append (param "HOME_DIR") "/.npm"))
72
- (subpath (string-append (param "HOME_DIR") "/.cache"))
73
- (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
74
- ;; Allow writes to included directories from --include-directories
75
- (subpath (param "INCLUDE_DIR_0"))
76
- (subpath (param "INCLUDE_DIR_1"))
77
- (subpath (param "INCLUDE_DIR_2"))
78
- (subpath (param "INCLUDE_DIR_3"))
79
- (subpath (param "INCLUDE_DIR_4"))
80
- (literal "/dev/stdout")
81
- (literal "/dev/stderr")
82
- (literal "/dev/null")
83
- )
84
-
85
- ;; allow communication with sysmond for process listing (e.g. for pgrep)
86
- (allow mach-lookup (global-name "com.apple.sysmond"))
87
-
88
- ;; enable terminal access required by ink
89
- ;; fixes setRawMode EPERM failure (at node:tty:81:24)
90
- (allow file-ioctl (regex #"^/dev/tty.*"))
91
-
92
- ;; allow inbound network traffic on debugger port
93
- (allow network-inbound (local ip "localhost:9229"))
94
-
95
- ;; allow all outbound network traffic
96
- (allow network-outbound)
@@ -1,98 +0,0 @@
1
- (version 1)
2
-
3
- ;; deny everything by default
4
- (deny default)
5
-
6
- ;; allow reading files from anywhere on host
7
- (allow file-read*)
8
-
9
- ;; allow exec/fork (children inherit policy)
10
- (allow process-exec)
11
- (allow process-fork)
12
-
13
- ;; allow signals to self, e.g. SIGPIPE on write to closed pipe
14
- (allow signal (target self))
15
-
16
- ;; allow read access to specific information about system
17
- ;; from https://source.chromium.org/chromium/chromium/src/+/main:sandbox/policy/mac/common.sb;l=273-319;drc=7b3962fe2e5fc9e2ee58000dc8fbf3429d84d3bd
18
- (allow sysctl-read
19
- (sysctl-name "hw.activecpu")
20
- (sysctl-name "hw.busfrequency_compat")
21
- (sysctl-name "hw.byteorder")
22
- (sysctl-name "hw.cacheconfig")
23
- (sysctl-name "hw.cachelinesize_compat")
24
- (sysctl-name "hw.cpufamily")
25
- (sysctl-name "hw.cpufrequency_compat")
26
- (sysctl-name "hw.cputype")
27
- (sysctl-name "hw.l1dcachesize_compat")
28
- (sysctl-name "hw.l1icachesize_compat")
29
- (sysctl-name "hw.l2cachesize_compat")
30
- (sysctl-name "hw.l3cachesize_compat")
31
- (sysctl-name "hw.logicalcpu_max")
32
- (sysctl-name "hw.machine")
33
- (sysctl-name "hw.ncpu")
34
- (sysctl-name "hw.nperflevels")
35
- (sysctl-name "hw.optional.arm.FEAT_BF16")
36
- (sysctl-name "hw.optional.arm.FEAT_DotProd")
37
- (sysctl-name "hw.optional.arm.FEAT_FCMA")
38
- (sysctl-name "hw.optional.arm.FEAT_FHM")
39
- (sysctl-name "hw.optional.arm.FEAT_FP16")
40
- (sysctl-name "hw.optional.arm.FEAT_I8MM")
41
- (sysctl-name "hw.optional.arm.FEAT_JSCVT")
42
- (sysctl-name "hw.optional.arm.FEAT_LSE")
43
- (sysctl-name "hw.optional.arm.FEAT_RDM")
44
- (sysctl-name "hw.optional.arm.FEAT_SHA512")
45
- (sysctl-name "hw.optional.armv8_2_sha512")
46
- (sysctl-name "hw.packages")
47
- (sysctl-name "hw.pagesize_compat")
48
- (sysctl-name "hw.physicalcpu_max")
49
- (sysctl-name "hw.tbfrequency_compat")
50
- (sysctl-name "hw.vectorunit")
51
- (sysctl-name "kern.hostname")
52
- (sysctl-name "kern.maxfilesperproc")
53
- (sysctl-name "kern.osproductversion")
54
- (sysctl-name "kern.osrelease")
55
- (sysctl-name "kern.ostype")
56
- (sysctl-name "kern.osvariant_status")
57
- (sysctl-name "kern.osversion")
58
- (sysctl-name "kern.secure_kernel")
59
- (sysctl-name "kern.usrstack64")
60
- (sysctl-name "kern.version")
61
- (sysctl-name "sysctl.proc_cputype")
62
- (sysctl-name-prefix "hw.perflevel")
63
- )
64
-
65
- ;; allow writes to specific paths
66
- (allow file-write*
67
- (subpath (param "TARGET_DIR"))
68
- (subpath (param "TMP_DIR"))
69
- (subpath (param "CACHE_DIR"))
70
- (subpath (string-append (param "HOME_DIR") "/.OSA"))
71
- (subpath (string-append (param "HOME_DIR") "/.npm"))
72
- (subpath (string-append (param "HOME_DIR") "/.cache"))
73
- (subpath (string-append (param "HOME_DIR") "/.gitconfig"))
74
- ;; Allow writes to included directories from --include-directories
75
- (subpath (param "INCLUDE_DIR_0"))
76
- (subpath (param "INCLUDE_DIR_1"))
77
- (subpath (param "INCLUDE_DIR_2"))
78
- (subpath (param "INCLUDE_DIR_3"))
79
- (subpath (param "INCLUDE_DIR_4"))
80
- (literal "/dev/stdout")
81
- (literal "/dev/stderr")
82
- (literal "/dev/null")
83
- )
84
-
85
- ;; allow communication with sysmond for process listing (e.g. for pgrep)
86
- (allow mach-lookup (global-name "com.apple.sysmond"))
87
-
88
- ;; enable terminal access required by ink
89
- ;; fixes setRawMode EPERM failure (at node:tty:81:24)
90
- (allow file-ioctl (regex #"^/dev/tty.*"))
91
-
92
- ;; allow inbound network traffic on debugger port
93
- (allow network-inbound (local ip "localhost:9229"))
94
-
95
- ;; allow outbound network traffic through proxy on localhost:8877
96
- ;; set `OSA_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
97
- ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
98
- (allow network-outbound (remote tcp "localhost:8877"))