@teamlearners/clawops 0.11.0 → 0.12.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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCOBPAA3N_cjs = require('../chunk-COBPAA3N.cjs');
3
+ var chunkX6VG5NNG_cjs = require('../chunk-X6VG5NNG.cjs');
4
4
  var pino = require('pino');
5
5
  var fs = require('fs');
6
6
  var path = require('path');
@@ -1043,7 +1043,7 @@ var MAX_ERROR_MESSAGE_LENGTH = 200;
1043
1043
  function getSdkInfo() {
1044
1044
  return {
1045
1045
  name: "clawops-node",
1046
- version: chunkCOBPAA3N_cjs.VERSION,
1046
+ version: chunkX6VG5NNG_cjs.VERSION,
1047
1047
  runtime: `node/${process.versions.node}`,
1048
1048
  os: `${process.platform}/${os__default.default.arch()}`
1049
1049
  };
@@ -1724,7 +1724,7 @@ var ClawOpsAgent = class {
1724
1724
  constructor(options) {
1725
1725
  this._apiKey = options.apiKey ?? process.env["CLAWOPS_API_KEY"] ?? "";
1726
1726
  this._accountId = options.accountId ?? process.env["CLAWOPS_ACCOUNT_ID"] ?? "";
1727
- this._baseUrl = options.baseUrl ?? chunkCOBPAA3N_cjs.DEFAULT_BASE_URL;
1727
+ this._baseUrl = options.baseUrl ?? chunkX6VG5NNG_cjs.DEFAULT_BASE_URL;
1728
1728
  this._fromNumber = options.from;
1729
1729
  this._session = options.session;
1730
1730
  this._recording = options.recording ?? false;
@@ -1752,7 +1752,7 @@ var ClawOpsAgent = class {
1752
1752
  tool(nameOrTool, description, parameters, handler) {
1753
1753
  if (typeof nameOrTool === "string") {
1754
1754
  if (!description || !parameters || !handler) {
1755
- throw new chunkCOBPAA3N_cjs.AgentError(
1755
+ throw new chunkX6VG5NNG_cjs.AgentError(
1756
1756
  "tool(name, description, parameters, handler) requires all arguments."
1757
1757
  );
1758
1758
  }
@@ -1788,10 +1788,10 @@ var ClawOpsAgent = class {
1788
1788
  async connect() {
1789
1789
  if (this._controlWs) return;
1790
1790
  if (!this._apiKey) {
1791
- throw new chunkCOBPAA3N_cjs.AgentError("API key is required. Set CLAWOPS_API_KEY or pass apiKey option.");
1791
+ throw new chunkX6VG5NNG_cjs.AgentError("API key is required. Set CLAWOPS_API_KEY or pass apiKey option.");
1792
1792
  }
1793
1793
  if (!this._accountId) {
1794
- throw new chunkCOBPAA3N_cjs.AgentError(
1794
+ throw new chunkX6VG5NNG_cjs.AgentError(
1795
1795
  "Account ID is required. Set CLAWOPS_ACCOUNT_ID or pass accountId option."
1796
1796
  );
1797
1797
  }
@@ -1815,7 +1815,7 @@ var ClawOpsAgent = class {
1815
1815
  } catch {
1816
1816
  }
1817
1817
  } catch (err) {
1818
- throw new chunkCOBPAA3N_cjs.AgentConnectionError(
1818
+ throw new chunkX6VG5NNG_cjs.AgentConnectionError(
1819
1819
  `Failed to connect to ClawOps: ${err instanceof Error ? err.message : String(err)}`
1820
1820
  );
1821
1821
  }
@@ -1866,7 +1866,7 @@ var ClawOpsAgent = class {
1866
1866
  });
1867
1867
  if (resp.status !== 201) {
1868
1868
  const error = await resp.json();
1869
- throw new chunkCOBPAA3N_cjs.AgentError(`\uBC1C\uC2E0 \uC2E4\uD328 (${resp.status}): ${error["error"] ?? ""}`);
1869
+ throw new chunkX6VG5NNG_cjs.AgentError(`\uBC1C\uC2E0 \uC2E4\uD328 (${resp.status}): ${error["error"] ?? ""}`);
1870
1870
  }
1871
1871
  const data = await resp.json();
1872
1872
  const callSession = new CallSession({
@@ -3074,11 +3074,8 @@ var GeminiRealtime = class _GeminiRealtime {
3074
3074
  this._closed = false;
3075
3075
  this._sentAudioChunks = 0;
3076
3076
  this._audioRemainder = Buffer.alloc(0);
3077
- if (!this._apiKey) {
3078
- throw new Error("Google API key is required. Set GOOGLE_API_KEY or pass apiKey option.");
3079
- }
3080
3077
  const { GoogleGenAI } = await import('@google/genai/node');
3081
- const client = new GoogleGenAI({ apiKey: this._apiKey });
3078
+ const client = this._apiKey ? new GoogleGenAI({ apiKey: this._apiKey }) : new GoogleGenAI({});
3082
3079
  const config = {
3083
3080
  responseModalities: ["AUDIO"],
3084
3081
  speechConfig: {
@@ -3845,9 +3842,8 @@ var GeminiLLM = class {
3845
3842
  }
3846
3843
  async *generate(messages, options) {
3847
3844
  const { GoogleGenAI } = await import('@google/genai');
3848
- const client = new GoogleGenAI({
3849
- apiKey: this._options.apiKey ?? process.env["GOOGLE_API_KEY"]
3850
- });
3845
+ const apiKey = this._options.apiKey ?? process.env["GOOGLE_API_KEY"];
3846
+ const client = apiKey ? new GoogleGenAI({ apiKey }) : new GoogleGenAI();
3851
3847
  let systemInstruction;
3852
3848
  const contents = [];
3853
3849
  for (const msg of messages) {