@teamlearners/clawops 0.23.0 → 0.24.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.
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkNXMTLS2U_cjs = require('./chunk-NXMTLS2U.cjs');
5
+ var chunkLUA53NPZ_cjs = require('./chunk-LUA53NPZ.cjs');
6
6
  var zod = require('zod');
7
7
  var crypto = require('crypto');
8
8
 
@@ -13,11 +13,11 @@ function validateBaseUrl(url) {
13
13
  try {
14
14
  parsed = new URL(url);
15
15
  } catch {
16
- throw new chunkNXMTLS2U_cjs.ClawOpsError(`Invalid base_url: ${url}`);
16
+ throw new chunkLUA53NPZ_cjs.ClawOpsError(`Invalid base_url: ${url}`);
17
17
  }
18
18
  if (parsed.protocol === "https:") return url;
19
19
  if (parsed.protocol === "http:" && LOCALHOST_HOSTS.has(parsed.hostname)) return url;
20
- throw new chunkNXMTLS2U_cjs.ClawOpsError(
20
+ throw new chunkLUA53NPZ_cjs.ClawOpsError(
21
21
  `base_url\uC740 HTTPS\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4 (\uBC1B\uC740 \uAC12: '${url}'). \uB85C\uCEEC \uAC1C\uBC1C \uC2DC\uC5D0\uB294 http://localhost\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`
22
22
  );
23
23
  }
@@ -30,9 +30,9 @@ var APIClient = class {
30
30
  _defaultHeaders;
31
31
  constructor(options) {
32
32
  this._apiKey = options.apiKey;
33
- this._baseURL = validateBaseUrl((options.baseURL ?? chunkNXMTLS2U_cjs.DEFAULT_BASE_URL).replace(/\/+$/, ""));
34
- this._maxRetries = options.maxRetries ?? chunkNXMTLS2U_cjs.DEFAULT_MAX_RETRIES;
35
- this._timeout = options.timeout ?? chunkNXMTLS2U_cjs.DEFAULT_TIMEOUT;
33
+ this._baseURL = validateBaseUrl((options.baseURL ?? chunkLUA53NPZ_cjs.DEFAULT_BASE_URL).replace(/\/+$/, ""));
34
+ this._maxRetries = options.maxRetries ?? chunkLUA53NPZ_cjs.DEFAULT_MAX_RETRIES;
35
+ this._timeout = options.timeout ?? chunkLUA53NPZ_cjs.DEFAULT_TIMEOUT;
36
36
  this._fetch = options.fetch ?? globalThis.fetch;
37
37
  this._defaultHeaders = options.defaultHeaders ?? {};
38
38
  }
@@ -41,7 +41,7 @@ var APIClient = class {
41
41
  Authorization: `Bearer ${this._apiKey}`,
42
42
  "Content-Type": "application/json",
43
43
  Accept: "application/json",
44
- "User-Agent": `claw-ops-node/${chunkNXMTLS2U_cjs.VERSION}`,
44
+ "User-Agent": `claw-ops-node/${chunkLUA53NPZ_cjs.VERSION}`,
45
45
  ...this._defaultHeaders
46
46
  };
47
47
  if (extra) Object.assign(headers, extra);
@@ -77,14 +77,14 @@ var APIClient = class {
77
77
  await this._sleep(this._retryDelay(this._maxRetries - retriesLeft));
78
78
  continue;
79
79
  }
80
- throw new chunkNXMTLS2U_cjs.APITimeoutError({ method: method2, url });
80
+ throw new chunkLUA53NPZ_cjs.APITimeoutError({ method: method2, url });
81
81
  }
82
82
  if (retriesLeft > 0) {
83
83
  retriesLeft--;
84
84
  await this._sleep(this._retryDelay(this._maxRetries - retriesLeft));
85
85
  continue;
86
86
  }
87
- throw new chunkNXMTLS2U_cjs.APIConnectionError({ method: method2, url });
87
+ throw new chunkLUA53NPZ_cjs.APIConnectionError({ method: method2, url });
88
88
  } finally {
89
89
  clearTimeout(timeoutId);
90
90
  }
@@ -100,7 +100,7 @@ var APIClient = class {
100
100
  } catch {
101
101
  body = null;
102
102
  }
103
- throw chunkNXMTLS2U_cjs.makeStatusError(response.status, body, response.headers, { method: method2, url });
103
+ throw chunkLUA53NPZ_cjs.makeStatusError(response.status, body, response.headers, { method: method2, url });
104
104
  }
105
105
  }
106
106
  async _request(method2, path, options = {}) {
@@ -111,11 +111,11 @@ var APIClient = class {
111
111
  try {
112
112
  json = await response.json();
113
113
  } catch {
114
- throw new chunkNXMTLS2U_cjs.APIResponseValidationError({ status: response.status }, { method: method2, url });
114
+ throw new chunkLUA53NPZ_cjs.APIResponseValidationError({ status: response.status }, { method: method2, url });
115
115
  }
116
116
  const parsed = options.castTo.safeParse(json);
117
117
  if (!parsed.success) {
118
- throw new chunkNXMTLS2U_cjs.APIResponseValidationError({ status: response.status }, { method: method2, url });
118
+ throw new chunkLUA53NPZ_cjs.APIResponseValidationError({ status: response.status }, { method: method2, url });
119
119
  }
120
120
  return parsed.data;
121
121
  }
@@ -123,7 +123,7 @@ var APIClient = class {
123
123
  return status === 408 || status === 409 || status === 429 || status >= 500;
124
124
  }
125
125
  _retryDelay(retriesTaken) {
126
- const delay = Math.min(chunkNXMTLS2U_cjs.INITIAL_RETRY_DELAY * 2 ** retriesTaken, chunkNXMTLS2U_cjs.MAX_RETRY_DELAY);
126
+ const delay = Math.min(chunkLUA53NPZ_cjs.INITIAL_RETRY_DELAY * 2 ** retriesTaken, chunkLUA53NPZ_cjs.MAX_RETRY_DELAY);
127
127
  return delay * (1 + Math.random());
128
128
  }
129
129
  _sleep(ms) {
@@ -746,7 +746,7 @@ var AccountContext = class {
746
746
  return new AssignmentLinks(this._client, this._accountId);
747
747
  }
748
748
  };
749
- var WebhookVerificationError = class extends chunkNXMTLS2U_cjs.ClawOpsError {
749
+ var WebhookVerificationError = class extends chunkLUA53NPZ_cjs.ClawOpsError {
750
750
  constructor(message = "Webhook \uC11C\uBA85\uC774 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.") {
751
751
  super(message);
752
752
  this.name = "WebhookVerificationError";
@@ -776,13 +776,13 @@ var ClawOps = class extends APIClient {
776
776
  constructor(options = {}) {
777
777
  let apiKey = options.apiKey ?? process.env.CLAWOPS_API_KEY;
778
778
  if (!apiKey) {
779
- throw new chunkNXMTLS2U_cjs.ClawOpsError("apiKey\uB97C \uC9C0\uC815\uD558\uAC70\uB098 CLAWOPS_API_KEY \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694.");
779
+ throw new chunkLUA53NPZ_cjs.ClawOpsError("apiKey\uB97C \uC9C0\uC815\uD558\uAC70\uB098 CLAWOPS_API_KEY \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694.");
780
780
  }
781
781
  let accountId = options.accountId ?? process.env.CLAWOPS_ACCOUNT_ID;
782
782
  if (!accountId) {
783
- throw new chunkNXMTLS2U_cjs.ClawOpsError("accountId\uB97C \uC9C0\uC815\uD558\uAC70\uB098 CLAWOPS_ACCOUNT_ID \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694.");
783
+ throw new chunkLUA53NPZ_cjs.ClawOpsError("accountId\uB97C \uC9C0\uC815\uD558\uAC70\uB098 CLAWOPS_ACCOUNT_ID \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694.");
784
784
  }
785
- const baseURL = options.baseURL ?? process.env.CLAWOPS_BASE_URL ?? chunkNXMTLS2U_cjs.DEFAULT_BASE_URL;
785
+ const baseURL = options.baseURL ?? process.env.CLAWOPS_BASE_URL ?? chunkLUA53NPZ_cjs.DEFAULT_BASE_URL;
786
786
  super({
787
787
  apiKey,
788
788
  baseURL,
@@ -830,75 +830,75 @@ var client_default_default = ClawOps;
830
830
 
831
831
  Object.defineProperty(exports, "APIConnectionError", {
832
832
  enumerable: true,
833
- get: function () { return chunkNXMTLS2U_cjs.APIConnectionError; }
833
+ get: function () { return chunkLUA53NPZ_cjs.APIConnectionError; }
834
834
  });
835
835
  Object.defineProperty(exports, "APIError", {
836
836
  enumerable: true,
837
- get: function () { return chunkNXMTLS2U_cjs.APIError; }
837
+ get: function () { return chunkLUA53NPZ_cjs.APIError; }
838
838
  });
839
839
  Object.defineProperty(exports, "APIResponseValidationError", {
840
840
  enumerable: true,
841
- get: function () { return chunkNXMTLS2U_cjs.APIResponseValidationError; }
841
+ get: function () { return chunkLUA53NPZ_cjs.APIResponseValidationError; }
842
842
  });
843
843
  Object.defineProperty(exports, "APIStatusError", {
844
844
  enumerable: true,
845
- get: function () { return chunkNXMTLS2U_cjs.APIStatusError; }
845
+ get: function () { return chunkLUA53NPZ_cjs.APIStatusError; }
846
846
  });
847
847
  Object.defineProperty(exports, "APITimeoutError", {
848
848
  enumerable: true,
849
- get: function () { return chunkNXMTLS2U_cjs.APITimeoutError; }
849
+ get: function () { return chunkLUA53NPZ_cjs.APITimeoutError; }
850
850
  });
851
851
  Object.defineProperty(exports, "AgentConnectionError", {
852
852
  enumerable: true,
853
- get: function () { return chunkNXMTLS2U_cjs.AgentConnectionError; }
853
+ get: function () { return chunkLUA53NPZ_cjs.AgentConnectionError; }
854
854
  });
855
855
  Object.defineProperty(exports, "AgentError", {
856
856
  enumerable: true,
857
- get: function () { return chunkNXMTLS2U_cjs.AgentError; }
857
+ get: function () { return chunkLUA53NPZ_cjs.AgentError; }
858
858
  });
859
859
  Object.defineProperty(exports, "AuthenticationError", {
860
860
  enumerable: true,
861
- get: function () { return chunkNXMTLS2U_cjs.AuthenticationError; }
861
+ get: function () { return chunkLUA53NPZ_cjs.AuthenticationError; }
862
862
  });
863
863
  Object.defineProperty(exports, "BadRequestError", {
864
864
  enumerable: true,
865
- get: function () { return chunkNXMTLS2U_cjs.BadRequestError; }
865
+ get: function () { return chunkLUA53NPZ_cjs.BadRequestError; }
866
866
  });
867
867
  Object.defineProperty(exports, "ClawOpsError", {
868
868
  enumerable: true,
869
- get: function () { return chunkNXMTLS2U_cjs.ClawOpsError; }
869
+ get: function () { return chunkLUA53NPZ_cjs.ClawOpsError; }
870
870
  });
871
871
  Object.defineProperty(exports, "ConflictError", {
872
872
  enumerable: true,
873
- get: function () { return chunkNXMTLS2U_cjs.ConflictError; }
873
+ get: function () { return chunkLUA53NPZ_cjs.ConflictError; }
874
874
  });
875
875
  Object.defineProperty(exports, "InternalServerError", {
876
876
  enumerable: true,
877
- get: function () { return chunkNXMTLS2U_cjs.InternalServerError; }
877
+ get: function () { return chunkLUA53NPZ_cjs.InternalServerError; }
878
878
  });
879
879
  Object.defineProperty(exports, "NotFoundError", {
880
880
  enumerable: true,
881
- get: function () { return chunkNXMTLS2U_cjs.NotFoundError; }
881
+ get: function () { return chunkLUA53NPZ_cjs.NotFoundError; }
882
882
  });
883
883
  Object.defineProperty(exports, "PermissionDeniedError", {
884
884
  enumerable: true,
885
- get: function () { return chunkNXMTLS2U_cjs.PermissionDeniedError; }
885
+ get: function () { return chunkLUA53NPZ_cjs.PermissionDeniedError; }
886
886
  });
887
887
  Object.defineProperty(exports, "RateLimitError", {
888
888
  enumerable: true,
889
- get: function () { return chunkNXMTLS2U_cjs.RateLimitError; }
889
+ get: function () { return chunkLUA53NPZ_cjs.RateLimitError; }
890
890
  });
891
891
  Object.defineProperty(exports, "ServiceUnavailableError", {
892
892
  enumerable: true,
893
- get: function () { return chunkNXMTLS2U_cjs.ServiceUnavailableError; }
893
+ get: function () { return chunkLUA53NPZ_cjs.ServiceUnavailableError; }
894
894
  });
895
895
  Object.defineProperty(exports, "UnprocessableEntityError", {
896
896
  enumerable: true,
897
- get: function () { return chunkNXMTLS2U_cjs.UnprocessableEntityError; }
897
+ get: function () { return chunkLUA53NPZ_cjs.UnprocessableEntityError; }
898
898
  });
899
899
  Object.defineProperty(exports, "VERSION", {
900
900
  enumerable: true,
901
- get: function () { return chunkNXMTLS2U_cjs.VERSION; }
901
+ get: function () { return chunkLUA53NPZ_cjs.VERSION; }
902
902
  });
903
903
  exports.APIClient = APIClient;
904
904
  exports.AccountContext = AccountContext;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, VERSION, APITimeoutError, APIConnectionError, makeStatusError, APIResponseValidationError, ClawOpsError, INITIAL_RETRY_DELAY, MAX_RETRY_DELAY } from './chunk-JU36ASTU.js';
2
- export { APIConnectionError, APIError, APIResponseValidationError, APIStatusError, APITimeoutError, AgentConnectionError, AgentError, AuthenticationError, BadRequestError, ClawOpsError, ConflictError, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, ServiceUnavailableError, UnprocessableEntityError, VERSION } from './chunk-JU36ASTU.js';
1
+ import { DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, VERSION, APITimeoutError, APIConnectionError, makeStatusError, APIResponseValidationError, ClawOpsError, INITIAL_RETRY_DELAY, MAX_RETRY_DELAY } from './chunk-7P2HGIPS.js';
2
+ export { APIConnectionError, APIError, APIResponseValidationError, APIStatusError, APITimeoutError, AgentConnectionError, AgentError, AuthenticationError, BadRequestError, ClawOpsError, ConflictError, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, ServiceUnavailableError, UnprocessableEntityError, VERSION } from './chunk-7P2HGIPS.js';
3
3
  import { z } from 'zod';
4
4
  import { timingSafeEqual, createHmac } from 'crypto';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamlearners/clawops",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Official Node.js/TypeScript SDK for the ClawOps Voice API",
5
5
  "type": "module",
6
6
  "exports": {
@@ -13,6 +13,11 @@
13
13
  "types": "./dist/agent/index.d.ts",
14
14
  "import": "./dist/agent/index.js",
15
15
  "require": "./dist/agent/index.cjs"
16
+ },
17
+ "./agent/livekit": {
18
+ "types": "./dist/agent/livekit/index.d.ts",
19
+ "import": "./dist/agent/livekit/index.js",
20
+ "require": "./dist/agent/livekit/index.cjs"
16
21
  }
17
22
  },
18
23
  "main": "./dist/index.cjs",
@@ -41,6 +46,8 @@
41
46
  "@anthropic-ai/sdk": ">=0.30.0",
42
47
  "@deepgram/sdk": ">=3.0.0",
43
48
  "@google/genai": ">=1.0.0",
49
+ "@livekit/agents": ">=1.5.0",
50
+ "@livekit/rtc-node": ">=0.13.0",
44
51
  "@modelcontextprotocol/sdk": "^1.27.1",
45
52
  "@opentelemetry/api": ">=1.20.0",
46
53
  "elevenlabs": ">=1.0.0",
@@ -67,6 +74,12 @@
67
74
  },
68
75
  "@opentelemetry/api": {
69
76
  "optional": true
77
+ },
78
+ "@livekit/agents": {
79
+ "optional": true
80
+ },
81
+ "@livekit/rtc-node": {
82
+ "optional": true
70
83
  }
71
84
  },
72
85
  "devDependencies": {