@teamlearners/clawops 0.20.0 → 0.20.2
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/agent/index.cjs +17 -12
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +9 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/{chunk-VEK4NEET.js → chunk-NFIXFBG7.js} +3 -3
- package/dist/{chunk-VEK4NEET.js.map → chunk-NFIXFBG7.js.map} +1 -1
- package/dist/{chunk-OUO6NTV6.cjs → chunk-VFSF6CKS.cjs} +3 -3
- package/dist/{chunk-OUO6NTV6.cjs.map → chunk-VFSF6CKS.cjs.map} +1 -1
- package/dist/index.cjs +35 -35
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/agent/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVFSF6CKS_cjs = require('../chunk-VFSF6CKS.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: chunkVFSF6CKS_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 ?? chunkVFSF6CKS_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 chunkVFSF6CKS_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 chunkVFSF6CKS_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 chunkVFSF6CKS_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 chunkVFSF6CKS_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 chunkVFSF6CKS_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 chunkVFSF6CKS_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({
|
|
@@ -2908,7 +2908,12 @@ var OpenAIRealtime = class {
|
|
|
2908
2908
|
this._model = options.model ?? "gpt-realtime-2";
|
|
2909
2909
|
this._voice = options.voice ?? "marin";
|
|
2910
2910
|
this._language = options.language ?? "ko";
|
|
2911
|
-
this._turnDetection = options.turnDetection !== void 0 ? options.turnDetection : {
|
|
2911
|
+
this._turnDetection = options.turnDetection !== void 0 ? options.turnDetection : {
|
|
2912
|
+
type: "semantic_vad",
|
|
2913
|
+
eagerness: "low",
|
|
2914
|
+
create_response: true,
|
|
2915
|
+
interrupt_response: true
|
|
2916
|
+
};
|
|
2912
2917
|
this._greeting = options.greeting ?? true;
|
|
2913
2918
|
}
|
|
2914
2919
|
/** Inject per-call ToolRegistry. */
|
|
@@ -3038,9 +3043,9 @@ var OpenAIRealtime = class {
|
|
|
3038
3043
|
audio: {
|
|
3039
3044
|
input: {
|
|
3040
3045
|
format: { type: "audio/pcmu" },
|
|
3041
|
-
noise_reduction: { type: "
|
|
3046
|
+
noise_reduction: { type: "near_field" },
|
|
3042
3047
|
transcription: {
|
|
3043
|
-
model: "gpt-
|
|
3048
|
+
model: "gpt-4o-transcribe",
|
|
3044
3049
|
language: this._language
|
|
3045
3050
|
},
|
|
3046
3051
|
turn_detection: this._turnDetection
|