@teamlearners/clawops 0.20.2 → 0.22.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 +21 -12
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +8 -1
- package/dist/agent/index.d.ts +8 -1
- package/dist/agent/index.js +13 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/{chunk-NFIXFBG7.js → chunk-5PLVSC2U.js} +3 -3
- package/dist/{chunk-NFIXFBG7.js.map → chunk-5PLVSC2U.js.map} +1 -1
- package/dist/{chunk-VFSF6CKS.cjs → chunk-CJ2LJZDQ.cjs} +3 -3
- package/dist/{chunk-VFSF6CKS.cjs.map → chunk-CJ2LJZDQ.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/dist/agent/index.d.cts
CHANGED
|
@@ -246,8 +246,15 @@ declare class CallSession {
|
|
|
246
246
|
}): Promise<string>;
|
|
247
247
|
/** Send a sequence of DTMF digits. */
|
|
248
248
|
sendDtmfSequence(digits: string): Promise<void>;
|
|
249
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* Transfer the call to a phone number or SIP endpoint.
|
|
251
|
+
*
|
|
252
|
+
* destinationType='pstn' (default): `to` is a phone number dialed via carrier.
|
|
253
|
+
* destinationType='sip': `to` is a SIP URI (e.g. `sip:user@host`) connected
|
|
254
|
+
* directly to a SIP endpoint without going through the PSTN carrier.
|
|
255
|
+
*/
|
|
250
256
|
transfer(to: string, options?: {
|
|
257
|
+
destinationType?: 'pstn' | 'sip';
|
|
251
258
|
mode?: 'blind' | 'warm';
|
|
252
259
|
afterTransfer?: 'terminate' | 'return';
|
|
253
260
|
holdMedia?: string;
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -246,8 +246,15 @@ declare class CallSession {
|
|
|
246
246
|
}): Promise<string>;
|
|
247
247
|
/** Send a sequence of DTMF digits. */
|
|
248
248
|
sendDtmfSequence(digits: string): Promise<void>;
|
|
249
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* Transfer the call to a phone number or SIP endpoint.
|
|
251
|
+
*
|
|
252
|
+
* destinationType='pstn' (default): `to` is a phone number dialed via carrier.
|
|
253
|
+
* destinationType='sip': `to` is a SIP URI (e.g. `sip:user@host`) connected
|
|
254
|
+
* directly to a SIP endpoint without going through the PSTN carrier.
|
|
255
|
+
*/
|
|
250
256
|
transfer(to: string, options?: {
|
|
257
|
+
destinationType?: 'pstn' | 'sip';
|
|
251
258
|
mode?: 'blind' | 'warm';
|
|
252
259
|
afterTransfer?: 'terminate' | 'return';
|
|
253
260
|
holdMedia?: string;
|
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_BASE_URL, AgentError, AgentConnectionError, VERSION } from '../chunk-
|
|
1
|
+
import { DEFAULT_BASE_URL, AgentError, AgentConnectionError, VERSION } from '../chunk-5PLVSC2U.js';
|
|
2
2
|
import pino from 'pino';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as path from 'path';
|
|
@@ -1247,13 +1247,20 @@ var CallSession = class {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
|
-
/**
|
|
1250
|
+
/**
|
|
1251
|
+
* Transfer the call to a phone number or SIP endpoint.
|
|
1252
|
+
*
|
|
1253
|
+
* destinationType='pstn' (default): `to` is a phone number dialed via carrier.
|
|
1254
|
+
* destinationType='sip': `to` is a SIP URI (e.g. `sip:user@host`) connected
|
|
1255
|
+
* directly to a SIP endpoint without going through the PSTN carrier.
|
|
1256
|
+
*/
|
|
1251
1257
|
async transfer(to, options) {
|
|
1252
1258
|
if (!this._transferFn) {
|
|
1253
1259
|
throw new Error("transfer not available");
|
|
1254
1260
|
}
|
|
1255
1261
|
return this._transferFn({
|
|
1256
1262
|
to,
|
|
1263
|
+
destinationType: options?.destinationType ?? "pstn",
|
|
1257
1264
|
mode: options?.mode ?? "blind",
|
|
1258
1265
|
afterTransfer: options?.afterTransfer ?? "terminate",
|
|
1259
1266
|
holdMedia: options?.holdMedia ?? "ringback",
|
|
@@ -2334,11 +2341,12 @@ var SEND_DTMF = {
|
|
|
2334
2341
|
};
|
|
2335
2342
|
var TRANSFER_CALL = {
|
|
2336
2343
|
name: "transfer_call",
|
|
2337
|
-
description: "Transfer the current call to another phone number. Use for blind transfer (direct handoff) or warm transfer (with whisper message to the target).",
|
|
2344
|
+
description: "Transfer the current call to another phone number or SIP endpoint. Use for blind transfer (direct handoff) or warm transfer (with whisper message to the target).",
|
|
2338
2345
|
parameters: {
|
|
2339
2346
|
type: "object",
|
|
2340
2347
|
properties: {
|
|
2341
|
-
to: { type: "string", description: "
|
|
2348
|
+
to: { type: "string", description: "Transfer destination. A phone number when destination_type is 'pstn', or a SIP URI (e.g. 'sip:user@host') when destination_type is 'sip'." },
|
|
2349
|
+
destination_type: { type: "string", enum: ["pstn", "sip"], description: "pstn: dial a phone number via carrier (default). sip: connect directly to a SIP endpoint (no carrier/PSTN)." },
|
|
2342
2350
|
mode: { type: "string", enum: ["blind", "warm"], description: "blind: direct transfer (default), warm: play whisper to target first" },
|
|
2343
2351
|
after_transfer: { type: "string", enum: ["terminate", "return"], description: "terminate: end AI session (default), return: AI resumes after transfer ends" },
|
|
2344
2352
|
whisper: { type: "string", description: "Message to speak to transfer target before connecting customer (warm mode only)" },
|
|
@@ -2428,6 +2436,7 @@ async function executeBuiltinTool(funcName, args, call) {
|
|
|
2428
2436
|
if (funcName === "transfer_call") {
|
|
2429
2437
|
try {
|
|
2430
2438
|
call.transfer(args["to"], {
|
|
2439
|
+
destinationType: args["destination_type"] ?? void 0,
|
|
2431
2440
|
mode: args["mode"] ?? void 0,
|
|
2432
2441
|
afterTransfer: args["after_transfer"] ?? void 0,
|
|
2433
2442
|
whisper: args["whisper"] ?? void 0,
|