@teamlearners/clawops 0.17.2 → 0.19.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/README.md +5 -0
- package/dist/agent/index.cjs +21 -11
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +5 -1
- package/dist/agent/index.d.ts +5 -1
- package/dist/agent/index.js +13 -3
- package/dist/agent/index.js.map +1 -1
- package/dist/{chunk-7TODEYCG.js → chunk-XBU5Z7IX.js} +3 -3
- package/dist/{chunk-7TODEYCG.js.map → chunk-XBU5Z7IX.js.map} +1 -1
- package/dist/{chunk-CNOCAN5A.cjs → chunk-XV7KWXOK.cjs} +3 -3
- package/dist/{chunk-CNOCAN5A.cjs.map → chunk-XV7KWXOK.cjs.map} +1 -1
- package/dist/index.cjs +46 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -250,6 +250,11 @@ for (const call of list.data) {
|
|
|
250
250
|
|
|
251
251
|
녹음이 없는 통화(`recordingUrl: null`)에 호출하면 `NotFoundError(404)` 가 발생합니다.
|
|
252
252
|
|
|
253
|
+
```typescript
|
|
254
|
+
// 녹음 삭제 (멱등 — 이미 없어도 성공)
|
|
255
|
+
await client.recordings.delete('CAabcdef1234567890');
|
|
256
|
+
```
|
|
257
|
+
|
|
253
258
|
### 전화번호 (Numbers)
|
|
254
259
|
|
|
255
260
|
```typescript
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXV7KWXOK_cjs = require('../chunk-XV7KWXOK.cjs');
|
|
4
4
|
var pino = require('pino');
|
|
5
5
|
var fs = require('fs');
|
|
6
6
|
var path = require('path');
|
|
@@ -1079,7 +1079,7 @@ var MAX_ERROR_MESSAGE_LENGTH = 200;
|
|
|
1079
1079
|
function getSdkInfo() {
|
|
1080
1080
|
return {
|
|
1081
1081
|
name: "clawops-node",
|
|
1082
|
-
version:
|
|
1082
|
+
version: chunkXV7KWXOK_cjs.VERSION,
|
|
1083
1083
|
runtime: `node/${process.versions.node}`,
|
|
1084
1084
|
os: `${process.platform}/${os__default.default.arch()}`
|
|
1085
1085
|
};
|
|
@@ -1767,7 +1767,7 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1767
1767
|
constructor(options) {
|
|
1768
1768
|
this._apiKey = options.apiKey ?? process.env["CLAWOPS_API_KEY"] ?? "";
|
|
1769
1769
|
this._accountId = options.accountId ?? process.env["CLAWOPS_ACCOUNT_ID"] ?? "";
|
|
1770
|
-
this._baseUrl = options.baseUrl ??
|
|
1770
|
+
this._baseUrl = options.baseUrl ?? chunkXV7KWXOK_cjs.DEFAULT_BASE_URL;
|
|
1771
1771
|
this._fromNumber = options.from;
|
|
1772
1772
|
this._session = options.session;
|
|
1773
1773
|
this._recording = options.recording ?? false;
|
|
@@ -1790,7 +1790,7 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
static _validateGain(name, gain) {
|
|
1792
1792
|
if (typeof gain !== "number" || !Number.isFinite(gain) || gain < 0) {
|
|
1793
|
-
throw new
|
|
1793
|
+
throw new chunkXV7KWXOK_cjs.AgentError(`${name}=${gain} must be a finite number >= 0`);
|
|
1794
1794
|
}
|
|
1795
1795
|
return gain;
|
|
1796
1796
|
}
|
|
@@ -1804,7 +1804,7 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1804
1804
|
tool(nameOrTool, description, parameters, handler) {
|
|
1805
1805
|
if (typeof nameOrTool === "string") {
|
|
1806
1806
|
if (!description || !parameters || !handler) {
|
|
1807
|
-
throw new
|
|
1807
|
+
throw new chunkXV7KWXOK_cjs.AgentError(
|
|
1808
1808
|
"tool(name, description, parameters, handler) requires all arguments."
|
|
1809
1809
|
);
|
|
1810
1810
|
}
|
|
@@ -1840,10 +1840,10 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1840
1840
|
async connect() {
|
|
1841
1841
|
if (this._controlWs) return;
|
|
1842
1842
|
if (!this._apiKey) {
|
|
1843
|
-
throw new
|
|
1843
|
+
throw new chunkXV7KWXOK_cjs.AgentError("API key is required. Set CLAWOPS_API_KEY or pass apiKey option.");
|
|
1844
1844
|
}
|
|
1845
1845
|
if (!this._accountId) {
|
|
1846
|
-
throw new
|
|
1846
|
+
throw new chunkXV7KWXOK_cjs.AgentError(
|
|
1847
1847
|
"Account ID is required. Set CLAWOPS_ACCOUNT_ID or pass accountId option."
|
|
1848
1848
|
);
|
|
1849
1849
|
}
|
|
@@ -1867,7 +1867,7 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1867
1867
|
} catch {
|
|
1868
1868
|
}
|
|
1869
1869
|
} catch (err) {
|
|
1870
|
-
throw new
|
|
1870
|
+
throw new chunkXV7KWXOK_cjs.AgentConnectionError(
|
|
1871
1871
|
`Failed to connect to ClawOps: ${err instanceof Error ? err.message : String(err)}`
|
|
1872
1872
|
);
|
|
1873
1873
|
}
|
|
@@ -1902,12 +1902,22 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
/**
|
|
1904
1904
|
* Initiate an outbound call.
|
|
1905
|
-
* Matches Python SDK: agent.call(to, { timeout })
|
|
1905
|
+
* Matches Python SDK: agent.call(to, { timeout, machineDetection })
|
|
1906
|
+
*
|
|
1907
|
+
* @param options.machineDetection 자동응답기/음성사서함 감지(AMD).
|
|
1908
|
+
* `'Enable'`=감지 후 `AnsweredBy` 통보(통화 계속), `'Hangup'`=음성사서함 감지 시 자동 종료.
|
|
1906
1909
|
*/
|
|
1907
1910
|
async call(to, options) {
|
|
1908
1911
|
await this.connect();
|
|
1909
1912
|
const url = `${this._baseUrl}/v1/accounts/${this._accountId}/calls`;
|
|
1910
|
-
const body = {
|
|
1913
|
+
const body = {
|
|
1914
|
+
To: to,
|
|
1915
|
+
From: this._fromNumber,
|
|
1916
|
+
Timeout: options?.timeout ?? 60
|
|
1917
|
+
};
|
|
1918
|
+
if (options?.machineDetection) {
|
|
1919
|
+
body["MachineDetection"] = options.machineDetection;
|
|
1920
|
+
}
|
|
1911
1921
|
const resp = await fetch(url, {
|
|
1912
1922
|
method: "POST",
|
|
1913
1923
|
headers: {
|
|
@@ -1918,7 +1928,7 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1918
1928
|
});
|
|
1919
1929
|
if (resp.status !== 201) {
|
|
1920
1930
|
const error = await resp.json();
|
|
1921
|
-
throw new
|
|
1931
|
+
throw new chunkXV7KWXOK_cjs.AgentError(`\uBC1C\uC2E0 \uC2E4\uD328 (${resp.status}): ${error["error"] ?? ""}`);
|
|
1922
1932
|
}
|
|
1923
1933
|
const data = await resp.json();
|
|
1924
1934
|
const callSession = new CallSession({
|