@teamlearners/clawops 0.20.1 → 0.21.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 +13 -0
- package/dist/agent/index.cjs +10 -10
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/index.js.map +1 -1
- package/dist/{chunk-QSLVO7PM.js → chunk-MSQH3MCJ.js} +3 -3
- package/dist/{chunk-QSLVO7PM.js.map → chunk-MSQH3MCJ.js.map} +1 -1
- package/dist/{chunk-H7ENUYGN.cjs → chunk-TRLJ6I3F.cjs} +3 -3
- package/dist/{chunk-H7ENUYGN.cjs.map → chunk-TRLJ6I3F.cjs.map} +1 -1
- package/dist/index.cjs +120 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +149 -13
- package/dist/index.d.ts +149 -13
- package/dist/index.js +86 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -280,6 +280,19 @@ const numbers = await client.numbers.list();
|
|
|
280
280
|
// 웹훅 URL 변경
|
|
281
281
|
await client.numbers.update('07012340001', { webhookUrl: 'https://my-app.com/webhook' });
|
|
282
282
|
|
|
283
|
+
// 인바운드 소프트폰 착신으로 라우팅 변경 (sip_trunk 부가서비스 + 등록 단말 필요)
|
|
284
|
+
// 1) 등록된 SIP 단말(credential) 목록에서 id 조회
|
|
285
|
+
const creds = await client.sipCredentials.list({ status: 'active' });
|
|
286
|
+
// 2) 그 id 로 라우팅 설정
|
|
287
|
+
await client.numbers.update('07012340001', {
|
|
288
|
+
routingType: 'softphone',
|
|
289
|
+
sipCredentialId: creds[0].id,
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// (sip 라우팅의 경우) SIP 엔드포인트 id 조회
|
|
293
|
+
const endpoints = await client.sipEndpoints.list({ status: 'active' });
|
|
294
|
+
await client.numbers.update('07012340001', { routingType: 'sip', sipEndpointId: endpoints[0].id });
|
|
295
|
+
|
|
283
296
|
// 번호 해제
|
|
284
297
|
await client.numbers.delete('07012340001');
|
|
285
298
|
```
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTRLJ6I3F_cjs = require('../chunk-TRLJ6I3F.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: chunkTRLJ6I3F_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 ?? chunkTRLJ6I3F_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 chunkTRLJ6I3F_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 chunkTRLJ6I3F_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 chunkTRLJ6I3F_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 chunkTRLJ6I3F_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 chunkTRLJ6I3F_cjs.AgentConnectionError(
|
|
1871
1871
|
`Failed to connect to ClawOps: ${err instanceof Error ? err.message : String(err)}`
|
|
1872
1872
|
);
|
|
1873
1873
|
}
|
|
@@ -1928,7 +1928,7 @@ var ClawOpsAgent = class _ClawOpsAgent {
|
|
|
1928
1928
|
});
|
|
1929
1929
|
if (resp.status !== 201) {
|
|
1930
1930
|
const error = await resp.json();
|
|
1931
|
-
throw new
|
|
1931
|
+
throw new chunkTRLJ6I3F_cjs.AgentError(`\uBC1C\uC2E0 \uC2E4\uD328 (${resp.status}): ${error["error"] ?? ""}`);
|
|
1932
1932
|
}
|
|
1933
1933
|
const data = await resp.json();
|
|
1934
1934
|
const callSession = new CallSession({
|
|
@@ -3045,7 +3045,7 @@ var OpenAIRealtime = class {
|
|
|
3045
3045
|
format: { type: "audio/pcmu" },
|
|
3046
3046
|
noise_reduction: { type: "near_field" },
|
|
3047
3047
|
transcription: {
|
|
3048
|
-
model: "gpt-4o-transcribe
|
|
3048
|
+
model: "gpt-4o-transcribe",
|
|
3049
3049
|
language: this._language
|
|
3050
3050
|
},
|
|
3051
3051
|
turn_detection: this._turnDetection
|