@voicethere/agent 0.7.13 → 0.8.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.
Files changed (58) hide show
  1. package/README.md +14 -3
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/runtime.d.ts.map +1 -1
  7. package/dist/runtime.js +11 -2
  8. package/dist/runtime.js.map +1 -1
  9. package/dist/templates/echo/agent.js +1 -1
  10. package/dist/templates/echo-dc/agent.js +1 -1
  11. package/dist/templates/game-sync/agent.js +162 -125
  12. package/dist/templates/registry.d.ts +1 -1
  13. package/dist/templates/registry.d.ts.map +1 -1
  14. package/dist/templates/registry.js +42 -26
  15. package/dist/templates/registry.js.map +1 -1
  16. package/dist/templates/voice-starter/agent.js +1 -1
  17. package/dist/templates/webhooks/agent.js +2 -2
  18. package/dist/templates/webhooks-redis/agent.js +11 -4
  19. package/dist/templates/world-sync/agent.js +829 -0
  20. package/dist/templates/world-sync-binary/agent.js +1031 -0
  21. package/package.json +3 -2
  22. package/templates/README.md +41 -69
  23. package/templates/crash/README.md +13 -0
  24. package/templates/echo/README.md +13 -0
  25. package/templates/{echo.ts → echo/agent.ts} +1 -1
  26. package/templates/echo-dc/README.md +13 -0
  27. package/templates/{echo-dc.ts → echo-dc/agent.ts} +1 -1
  28. package/templates/echo-smoke/README.md +13 -0
  29. package/templates/game-sync/README.md +21 -0
  30. package/templates/{game-sync.ts → game-sync/agent.ts} +126 -94
  31. package/templates/{game-sync-redis.ts → game-sync/redis.ts} +4 -13
  32. package/templates/{game-sync-sim.ts → game-sync/sim.ts} +14 -7
  33. package/templates/{game-sync-world-layout.ts → game-sync/world-layout.ts} +72 -30
  34. package/templates/game-sync-smoke/README.md +13 -0
  35. package/templates/mix-smoke/README.md +13 -0
  36. package/templates/positional-tts/README.md +13 -0
  37. package/templates/recording-consent/README.md +13 -0
  38. package/templates/redis-sync/README.md +23 -0
  39. package/templates/redis-sync/agent.ts +72 -95
  40. package/templates/redis-sync/world-layout.ts +103 -26
  41. package/templates/spatial-showcase/README.md +13 -0
  42. package/templates/voice-showcase/README.md +13 -0
  43. package/templates/voice-starter/README.md +13 -0
  44. package/templates/webhooks/README.md +13 -0
  45. package/templates/{webhooks.ts → webhooks/agent.ts} +1 -1
  46. package/templates/webhooks-redis/README.md +13 -0
  47. package/templates/{webhooks-redis.ts → webhooks-redis/agent.ts} +9 -9
  48. package/templates/world-sync/README.md +20 -0
  49. package/templates/world-sync/agent.ts +62 -0
  50. package/templates/world-sync-binary/README.md +21 -0
  51. package/templates/world-sync-binary/agent.ts +107 -0
  52. package/templates/world-sync-binary/protocol.ts +281 -0
  53. /package/templates/{crash.ts → crash/agent.ts} +0 -0
  54. /package/templates/{echo-smoke.ts → echo-smoke/agent.ts} +0 -0
  55. /package/templates/{game-sync-protocol.ts → game-sync/protocol.ts} +0 -0
  56. /package/templates/{game-sync-smoke.ts → game-sync-smoke/agent.ts} +0 -0
  57. /package/templates/{mix-smoke.ts → mix-smoke/agent.ts} +0 -0
  58. /package/templates/{agent.ts → voice-starter/agent.ts} +0 -0
@@ -10753,7 +10753,7 @@ var require_built3 = __commonJS({
10753
10753
  }
10754
10754
  });
10755
10755
 
10756
- // templates/webhooks-redis.ts
10756
+ // templates/webhooks-redis/agent.ts
10757
10757
  var import_ioredis = __toESM(require_built3(), 1);
10758
10758
  import { createHmac, timingSafeEqual } from "node:crypto";
10759
10759
 
@@ -11539,7 +11539,7 @@ function agentLog(level, message, fieldsOrSessionId, sessionId) {
11539
11539
  sendParentMessage(buildAgentLogPayload(level, message, fields, resolvedSessionId));
11540
11540
  }
11541
11541
 
11542
- // templates/webhooks-redis.ts
11542
+ // templates/webhooks-redis/agent.ts
11543
11543
  var WEBHOOK_SIGNATURE_HEADER = "x-agent-webhook-signature";
11544
11544
  var REDIS_COUNTER_KEY = "agent:webhook:event_count";
11545
11545
  var LUA_INCREMENT_COUNTER = `
@@ -11582,7 +11582,7 @@ defineAgent({
11582
11582
  );
11583
11583
  return;
11584
11584
  }
11585
- redis = new import_ioredis.default(redisUrl, {
11585
+ redis = new import_ioredis.Redis(redisUrl, {
11586
11586
  maxRetriesPerRequest: 3,
11587
11587
  lazyConnect: true
11588
11588
  });
@@ -11614,7 +11614,11 @@ defineAgent({
11614
11614
  }
11615
11615
  let eventCount = null;
11616
11616
  if (redis) {
11617
- const result = await redis.eval(LUA_INCREMENT_COUNTER, 1, REDIS_COUNTER_KEY);
11617
+ const result = await redis.eval(
11618
+ LUA_INCREMENT_COUNTER,
11619
+ 1,
11620
+ REDIS_COUNTER_KEY
11621
+ );
11618
11622
  eventCount = typeof result === "number" ? result : Number(result);
11619
11623
  }
11620
11624
  const sessionIds = ctx.sessionIds.length > 0 ? ctx.sessionIds : [...connectedSessions];
@@ -11641,3 +11645,6 @@ defineAgent({
11641
11645
  );
11642
11646
  }
11643
11647
  });
11648
+ export {
11649
+ LUA_INCREMENT_COUNTER
11650
+ };