@teamlearners/clawops 0.12.0 → 0.13.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/agent/index.cjs +17 -9
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +6 -0
- package/dist/agent/index.d.ts +6 -0
- package/dist/agent/index.js +10 -2
- package/dist/agent/index.js.map +1 -1
- package/dist/{chunk-X6VG5NNG.cjs → chunk-T563RQOL.cjs} +3 -3
- package/dist/{chunk-X6VG5NNG.cjs.map → chunk-T563RQOL.cjs.map} +1 -1
- package/dist/{chunk-KK3OXQT6.js → chunk-WH65DGWI.js} +3 -3
- package/dist/{chunk-KK3OXQT6.js.map → chunk-WH65DGWI.js.map} +1 -1
- package/dist/index.cjs +38 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- 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 chunkT563RQOL_cjs = require('../chunk-T563RQOL.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:
|
|
1046
|
+
version: chunkT563RQOL_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 ??
|
|
1727
|
+
this._baseUrl = options.baseUrl ?? chunkT563RQOL_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
|
|
1755
|
+
throw new chunkT563RQOL_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
|
|
1791
|
+
throw new chunkT563RQOL_cjs.AgentError("API key is required. Set CLAWOPS_API_KEY or pass apiKey option.");
|
|
1792
1792
|
}
|
|
1793
1793
|
if (!this._accountId) {
|
|
1794
|
-
throw new
|
|
1794
|
+
throw new chunkT563RQOL_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
|
|
1818
|
+
throw new chunkT563RQOL_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
|
|
1869
|
+
throw new chunkT563RQOL_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({
|
|
@@ -3013,6 +3013,8 @@ var GeminiRealtime = class _GeminiRealtime {
|
|
|
3013
3013
|
_voice;
|
|
3014
3014
|
_language;
|
|
3015
3015
|
_greeting;
|
|
3016
|
+
_realtimeInputConfig;
|
|
3017
|
+
_inputAudioTranscription;
|
|
3016
3018
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3017
3019
|
_session = null;
|
|
3018
3020
|
_call = null;
|
|
@@ -3034,6 +3036,8 @@ var GeminiRealtime = class _GeminiRealtime {
|
|
|
3034
3036
|
this._voice = options.voice ?? "Kore";
|
|
3035
3037
|
this._language = options.language ?? "ko";
|
|
3036
3038
|
this._greeting = options.greeting ?? true;
|
|
3039
|
+
this._realtimeInputConfig = options.realtimeInputConfig ?? null;
|
|
3040
|
+
this._inputAudioTranscription = options.inputAudioTranscription ?? {};
|
|
3037
3041
|
}
|
|
3038
3042
|
/** Inject per-call ToolRegistry. */
|
|
3039
3043
|
setToolRegistry(registry) {
|
|
@@ -3085,9 +3089,12 @@ var GeminiRealtime = class _GeminiRealtime {
|
|
|
3085
3089
|
}
|
|
3086
3090
|
}
|
|
3087
3091
|
},
|
|
3088
|
-
inputAudioTranscription:
|
|
3092
|
+
inputAudioTranscription: this._inputAudioTranscription,
|
|
3089
3093
|
outputAudioTranscription: {}
|
|
3090
3094
|
};
|
|
3095
|
+
if (this._realtimeInputConfig) {
|
|
3096
|
+
config["realtimeInputConfig"] = this._realtimeInputConfig;
|
|
3097
|
+
}
|
|
3091
3098
|
if (this._systemPrompt) {
|
|
3092
3099
|
config["systemInstruction"] = {
|
|
3093
3100
|
parts: [{ text: this._systemPrompt }]
|
|
@@ -3097,6 +3104,7 @@ var GeminiRealtime = class _GeminiRealtime {
|
|
|
3097
3104
|
if (toolSchemas.length > 0) {
|
|
3098
3105
|
config["tools"] = [{ functionDeclarations: toolSchemas }];
|
|
3099
3106
|
}
|
|
3107
|
+
this._log.debug({ config }, "Gemini SDK final config");
|
|
3100
3108
|
this._session = await client.live.connect({
|
|
3101
3109
|
model: this._model,
|
|
3102
3110
|
config,
|