@voicelayer/sdk 0.1.9 → 0.1.10

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/index.js CHANGED
@@ -3251,11 +3251,12 @@ ${collected}`);
3251
3251
  if (ok && cfg.outputAs && typeof cfg.outputAs === "object") {
3252
3252
  for (const [slot, path] of Object.entries(cfg.outputAs)) {
3253
3253
  if (typeof path !== "string" || !path.trim()) continue;
3254
- const value = resolvePath(result, path.trim());
3255
- if (value === void 0 || value === null) {
3254
+ const raw = resolvePath(result, path.trim());
3255
+ if (raw === void 0 || raw === null) {
3256
3256
  deps.events.note("tool.output_missing", { node: node.id, slot, path });
3257
3257
  continue;
3258
3258
  }
3259
+ const value = typeof raw === "string" ? raw : typeof raw === "number" || typeof raw === "boolean" || typeof raw === "bigint" ? String(raw) : JSON.stringify(raw);
3259
3260
  const captured = deps.processRt.captureField(slot, value);
3260
3261
  deps.events.note(captured ? "tool.output_captured" : "tool.output_rejected", {
3261
3262
  node: node.id,
@@ -7513,6 +7514,18 @@ function buildTextContext(adapter, call, processRt) {
7513
7514
  get process() {
7514
7515
  return { data: processRt.getData(), complete: processRt.isComplete() };
7515
7516
  },
7517
+ // Voice-only actions, stubbed so a flow containing them can still be dry-run
7518
+ // over text. Without these the handoff node threw "deps.ctx.handoff is not
7519
+ // a function" mid-trace (seen in the builder's dry run); the graph now
7520
+ // reaches its handoff outcome cleanly and the trace says why nothing dialed.
7521
+ handoff: async (to) => {
7522
+ processRt.recordEvent({
7523
+ kind: "handoff.simulated",
7524
+ data: { to, reason: "text dry run \u2014 no telephony leg to transfer" }
7525
+ });
7526
+ },
7527
+ endCall: async () => {
7528
+ },
7516
7529
  // Voice-only escape hatch is absent on text; left undefined.
7517
7530
  livekit: { session: {}, job: {} }
7518
7531
  };
@@ -2782,11 +2782,12 @@ ${collected}`);
2782
2782
  if (ok && cfg.outputAs && typeof cfg.outputAs === "object") {
2783
2783
  for (const [slot, path] of Object.entries(cfg.outputAs)) {
2784
2784
  if (typeof path !== "string" || !path.trim()) continue;
2785
- const value = resolvePath(result, path.trim());
2786
- if (value === void 0 || value === null) {
2785
+ const raw = resolvePath(result, path.trim());
2786
+ if (raw === void 0 || raw === null) {
2787
2787
  deps.events.note("tool.output_missing", { node: node.id, slot, path });
2788
2788
  continue;
2789
2789
  }
2790
+ const value = typeof raw === "string" ? raw : typeof raw === "number" || typeof raw === "boolean" || typeof raw === "bigint" ? String(raw) : JSON.stringify(raw);
2790
2791
  const captured = deps.processRt.captureField(slot, value);
2791
2792
  deps.events.note(captured ? "tool.output_captured" : "tool.output_rejected", {
2792
2793
  node: node.id,
@@ -4756,6 +4757,18 @@ function buildTextContext(adapter, call, processRt) {
4756
4757
  get process() {
4757
4758
  return { data: processRt.getData(), complete: processRt.isComplete() };
4758
4759
  },
4760
+ // Voice-only actions, stubbed so a flow containing them can still be dry-run
4761
+ // over text. Without these the handoff node threw "deps.ctx.handoff is not
4762
+ // a function" mid-trace (seen in the builder's dry run); the graph now
4763
+ // reaches its handoff outcome cleanly and the trace says why nothing dialed.
4764
+ handoff: async (to) => {
4765
+ processRt.recordEvent({
4766
+ kind: "handoff.simulated",
4767
+ data: { to, reason: "text dry run \u2014 no telephony leg to transfer" }
4768
+ });
4769
+ },
4770
+ endCall: async () => {
4771
+ },
4759
4772
  // Voice-only escape hatch is absent on text; left undefined.
4760
4773
  livekit: { session: {}, job: {} }
4761
4774
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicelayer/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Official SDK for VoiceLayer — define, run, and orchestrate voice AI agents on the VoiceLayer control plane.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "VoiceLayer",