@diegoaltoworks/talker 0.1.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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +299 -0
  3. package/dist/adapters/twilio.d.ts +12 -0
  4. package/dist/adapters/twilio.d.ts.map +1 -0
  5. package/dist/core/chat.d.ts +14 -0
  6. package/dist/core/chat.d.ts.map +1 -0
  7. package/dist/core/chatbot/client.d.ts +12 -0
  8. package/dist/core/chatbot/client.d.ts.map +1 -0
  9. package/dist/core/chatbot/conversations.d.ts +14 -0
  10. package/dist/core/chatbot/conversations.d.ts.map +1 -0
  11. package/dist/core/chatbot/index.d.ts +9 -0
  12. package/dist/core/chatbot/index.d.ts.map +1 -0
  13. package/dist/core/chatbot/types.d.ts +25 -0
  14. package/dist/core/chatbot/types.d.ts.map +1 -0
  15. package/dist/core/context.d.ts +61 -0
  16. package/dist/core/context.d.ts.map +1 -0
  17. package/dist/core/context.test.d.ts +2 -0
  18. package/dist/core/context.test.d.ts.map +1 -0
  19. package/dist/core/errors.d.ts +8 -0
  20. package/dist/core/errors.d.ts.map +1 -0
  21. package/dist/core/errors.test.d.ts +2 -0
  22. package/dist/core/errors.test.d.ts.map +1 -0
  23. package/dist/core/logger.d.ts +11 -0
  24. package/dist/core/logger.d.ts.map +1 -0
  25. package/dist/core/phrases.d.ts +30 -0
  26. package/dist/core/phrases.d.ts.map +1 -0
  27. package/dist/core/phrases.test.d.ts +2 -0
  28. package/dist/core/phrases.test.d.ts.map +1 -0
  29. package/dist/core/processing/incoming.d.ts +12 -0
  30. package/dist/core/processing/incoming.d.ts.map +1 -0
  31. package/dist/core/processing/index.d.ts +10 -0
  32. package/dist/core/processing/index.d.ts.map +1 -0
  33. package/dist/core/processing/openai.d.ts +15 -0
  34. package/dist/core/processing/openai.d.ts.map +1 -0
  35. package/dist/core/processing/outgoing.d.ts +12 -0
  36. package/dist/core/processing/outgoing.d.ts.map +1 -0
  37. package/dist/core/processing/prompts.d.ts +14 -0
  38. package/dist/core/processing/prompts.d.ts.map +1 -0
  39. package/dist/core/twiml.d.ts +31 -0
  40. package/dist/core/twiml.d.ts.map +1 -0
  41. package/dist/core/twiml.test.d.ts +2 -0
  42. package/dist/core/twiml.test.d.ts.map +1 -0
  43. package/dist/core/voice.d.ts +16 -0
  44. package/dist/core/voice.d.ts.map +1 -0
  45. package/dist/core/voice.test.d.ts +2 -0
  46. package/dist/core/voice.test.d.ts.map +1 -0
  47. package/dist/core/xml.d.ts +8 -0
  48. package/dist/core/xml.d.ts.map +1 -0
  49. package/dist/core/xml.test.d.ts +2 -0
  50. package/dist/core/xml.test.d.ts.map +1 -0
  51. package/dist/db/client.d.ts +25 -0
  52. package/dist/db/client.d.ts.map +1 -0
  53. package/dist/db/index.d.ts +12 -0
  54. package/dist/db/index.d.ts.map +1 -0
  55. package/dist/db/migrate.d.ts +8 -0
  56. package/dist/db/migrate.d.ts.map +1 -0
  57. package/dist/db/persist.d.ts +18 -0
  58. package/dist/db/persist.d.ts.map +1 -0
  59. package/dist/db/sessions.d.ts +57 -0
  60. package/dist/db/sessions.d.ts.map +1 -0
  61. package/dist/flows/index.d.ts +12 -0
  62. package/dist/flows/index.d.ts.map +1 -0
  63. package/dist/flows/intent.d.ts +11 -0
  64. package/dist/flows/intent.d.ts.map +1 -0
  65. package/dist/flows/loader.d.ts +12 -0
  66. package/dist/flows/loader.d.ts.map +1 -0
  67. package/dist/flows/manager.d.ts +14 -0
  68. package/dist/flows/manager.d.ts.map +1 -0
  69. package/dist/flows/params.d.ts +12 -0
  70. package/dist/flows/params.d.ts.map +1 -0
  71. package/dist/flows/registry.d.ts +35 -0
  72. package/dist/flows/registry.d.ts.map +1 -0
  73. package/dist/flows/utils.d.ts +12 -0
  74. package/dist/flows/utils.d.ts.map +1 -0
  75. package/dist/flows/utils.test.d.ts +2 -0
  76. package/dist/flows/utils.test.d.ts.map +1 -0
  77. package/dist/index.d.ts +62 -0
  78. package/dist/index.d.ts.map +1 -0
  79. package/dist/index.js +1840 -0
  80. package/dist/index.mjs +1771 -0
  81. package/dist/plugin.d.ts +31 -0
  82. package/dist/plugin.d.ts.map +1 -0
  83. package/dist/routes/call/handle-answer.d.ts +10 -0
  84. package/dist/routes/call/handle-answer.d.ts.map +1 -0
  85. package/dist/routes/call/handle-initial.d.ts +10 -0
  86. package/dist/routes/call/handle-initial.d.ts.map +1 -0
  87. package/dist/routes/call/handle-nospeech.d.ts +10 -0
  88. package/dist/routes/call/handle-nospeech.d.ts.map +1 -0
  89. package/dist/routes/call/handle-respond.d.ts +11 -0
  90. package/dist/routes/call/handle-respond.d.ts.map +1 -0
  91. package/dist/routes/call/handle-status.d.ts +9 -0
  92. package/dist/routes/call/handle-status.d.ts.map +1 -0
  93. package/dist/routes/call/index.d.ts +14 -0
  94. package/dist/routes/call/index.d.ts.map +1 -0
  95. package/dist/routes/call/pending.d.ts +20 -0
  96. package/dist/routes/call/pending.d.ts.map +1 -0
  97. package/dist/routes/call/processor.d.ts +13 -0
  98. package/dist/routes/call/processor.d.ts.map +1 -0
  99. package/dist/routes/sms/handle-incoming.d.ts +10 -0
  100. package/dist/routes/sms/handle-incoming.d.ts.map +1 -0
  101. package/dist/routes/sms/index.d.ts +13 -0
  102. package/dist/routes/sms/index.d.ts.map +1 -0
  103. package/dist/routes/sms/processor.d.ts +12 -0
  104. package/dist/routes/sms/processor.d.ts.map +1 -0
  105. package/dist/standalone.d.ts +44 -0
  106. package/dist/standalone.d.ts.map +1 -0
  107. package/dist/types.d.ts +240 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/language/de.json +27 -0
  110. package/language/en.json +27 -0
  111. package/language/es.json +27 -0
  112. package/language/fr.json +27 -0
  113. package/language/nl.json +27 -0
  114. package/language/pt.json +27 -0
  115. package/package.json +103 -0
  116. package/prompts/incoming.md +88 -0
  117. package/prompts/outgoing.md +58 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Talker Plugin
3
+ *
4
+ * Main entry point for integrating talker with chatter via the customRoutes hook.
5
+ * Creates telephony routes and mounts them on the Hono app.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { createServer } from "@diegoaltoworks/chatter";
10
+ * import { createTelephonyRoutes } from "@diegoaltoworks/talker";
11
+ *
12
+ * const app = await createServer({
13
+ * ...chatterConfig,
14
+ * customRoutes: (app, deps) => {
15
+ * createTelephonyRoutes(app, deps, {
16
+ * twilio: { accountSid, authToken, phoneNumber },
17
+ * transferNumber: "+44...",
18
+ * flowsDir: "./config/flows",
19
+ * });
20
+ * },
21
+ * });
22
+ * ```
23
+ */
24
+ import type { ServerDependencies } from "@diegoaltoworks/chatter";
25
+ import type { Hono } from "hono";
26
+ import type { TalkerConfig } from "./types";
27
+ /**
28
+ * Create and mount telephony routes on a Hono app (chatter plugin mode)
29
+ */
30
+ export declare function createTelephonyRoutes(app: Hono, chatterDeps: ServerDependencies, config: TalkerConfig): Promise<void>;
31
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAQjC,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AAMhE;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,IAAI,EACT,WAAW,EAAE,kBAAkB,EAC/B,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CA2Cf"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Answer Handler
3
+ *
4
+ * Handles POST /call/answer — called after the acknowledgment redirect.
5
+ * Waits for the background processing to complete and returns the result.
6
+ */
7
+ import type { Context } from "hono";
8
+ import type { TalkerConfig } from "../../types";
9
+ export declare function handleAnswer(c: Context, config: TalkerConfig): Promise<Response>;
10
+ //# sourceMappingURL=handle-answer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-answer.d.ts","sourceRoot":"","sources":["../../../src/routes/call/handle-answer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CA+BtF"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Initial Call Handler
3
+ *
4
+ * Handles POST /call — the first webhook when a call arrives.
5
+ * Clears previous state, greets the caller, and starts listening for speech.
6
+ */
7
+ import type { Context } from "hono";
8
+ import type { TalkerConfig } from "../../types";
9
+ export declare function handleInitialCall(c: Context, config: TalkerConfig): Promise<Response>;
10
+ //# sourceMappingURL=handle-initial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-initial.d.ts","sourceRoot":"","sources":["../../../src/routes/call/handle-initial.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqB3F"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * No-Speech Handler
3
+ *
4
+ * Handles POST /call/no-speech — called when Twilio detects silence.
5
+ * Implements retry logic with configurable max retries.
6
+ */
7
+ import type { Context } from "hono";
8
+ import type { TalkerConfig } from "../../types";
9
+ export declare function handleNoSpeech(c: Context, config: TalkerConfig): Promise<Response>;
10
+ //# sourceMappingURL=handle-nospeech.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-nospeech.d.ts","sourceRoot":"","sources":["../../../src/routes/call/handle-nospeech.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAsB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CA4BxF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Speech Response Handler
3
+ *
4
+ * Handles POST /call/respond — called by Twilio when speech is detected.
5
+ * Supports both synchronous and async acknowledgment patterns.
6
+ */
7
+ import type { Context } from "hono";
8
+ import type { FlowRegistry } from "../../flows/registry";
9
+ import type { TalkerDependencies } from "../../types";
10
+ export declare function handleRespond(c: Context, deps: TalkerDependencies, registry: FlowRegistry): Promise<Response>;
11
+ //# sourceMappingURL=handle-respond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-respond.d.ts","sourceRoot":"","sources":["../../../src/routes/call/handle-respond.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAOpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAItD,wBAAsB,aAAa,CACjC,CAAC,EAAE,OAAO,EACV,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC,CAqEnB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Call Status Handler
3
+ *
4
+ * Handles POST /call/status — called by Twilio when call state changes.
5
+ * Persists the final session state, then cleans up conversation context.
6
+ */
7
+ import type { Context } from "hono";
8
+ export declare function handleStatus(c: Context): Promise<Response>;
9
+ //# sourceMappingURL=handle-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-status.d.ts","sourceRoot":"","sources":["../../../src/routes/call/handle-status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAehE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Call Routes
3
+ *
4
+ * Hono route factory for voice call webhooks.
5
+ * Mounts individual handlers for each call lifecycle event.
6
+ */
7
+ import { Hono } from "hono";
8
+ import type { FlowRegistry } from "../../flows/registry";
9
+ import type { TalkerDependencies } from "../../types";
10
+ /**
11
+ * Create call routes
12
+ */
13
+ export declare function callRoutes(deps: TalkerDependencies, registry: FlowRegistry): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/call/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAOtD;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,8EAU1E"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pending Queries
3
+ *
4
+ * Manages async query state for the "one moment please" acknowledgment pattern.
5
+ * When a query is processing in the background, the pending promise is stored
6
+ * here and resolved when processing completes.
7
+ */
8
+ export interface PendingQuery {
9
+ speechResult: string;
10
+ promise: Promise<{
11
+ twiml: string;
12
+ }>;
13
+ resolve: (value: {
14
+ twiml: string;
15
+ }) => void;
16
+ }
17
+ export declare function setPending(phoneNumber: string, query: PendingQuery): void;
18
+ export declare function getPending(phoneNumber: string): PendingQuery | undefined;
19
+ export declare function deletePending(phoneNumber: string): void;
20
+ //# sourceMappingURL=pending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending.d.ts","sourceRoot":"","sources":["../../../src/routes/call/pending.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC,OAAO,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7C;AAID,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAEzE;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAExE;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAEvD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Call Processor
3
+ *
4
+ * End-to-end processing pipeline for a single voice call interaction:
5
+ * incoming pre-processing -> flow check -> chatbot -> outgoing post-processing -> TwiML
6
+ */
7
+ import type { FlowRegistry } from "../../flows/registry";
8
+ import type { TalkerDependencies } from "../../types";
9
+ /**
10
+ * Process a call interaction and generate TwiML response
11
+ */
12
+ export declare function processCall(deps: TalkerDependencies, registry: FlowRegistry, phoneNumber: string, speechResult: string): Promise<string>;
13
+ //# sourceMappingURL=processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/routes/call/processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CA6DjB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Incoming SMS Handler
3
+ *
4
+ * Handles POST /sms — called by Twilio when an SMS arrives.
5
+ */
6
+ import type { Context } from "hono";
7
+ import type { FlowRegistry } from "../../flows/registry";
8
+ import type { TalkerDependencies } from "../../types";
9
+ export declare function handleIncomingSMS(c: Context, deps: TalkerDependencies, registry: FlowRegistry): Promise<Response>;
10
+ //# sourceMappingURL=handle-incoming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-incoming.d.ts","sourceRoot":"","sources":["../../../src/routes/sms/handle-incoming.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAMpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,wBAAsB,iBAAiB,CACrC,CAAC,EAAE,OAAO,EACV,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC,CA0BnB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * SMS Routes
3
+ *
4
+ * Hono route factory for SMS webhooks.
5
+ */
6
+ import { Hono } from "hono";
7
+ import type { FlowRegistry } from "../../flows/registry";
8
+ import type { TalkerDependencies } from "../../types";
9
+ /**
10
+ * Create SMS routes
11
+ */
12
+ export declare function smsRoutes(deps: TalkerDependencies, registry: FlowRegistry): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/sms/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,8EAOzE"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SMS Processor
3
+ *
4
+ * End-to-end processing pipeline for a single SMS interaction.
5
+ */
6
+ import type { FlowRegistry } from "../../flows/registry";
7
+ import type { TalkerDependencies } from "../../types";
8
+ /**
9
+ * Process an SMS interaction and generate TwiML response
10
+ */
11
+ export declare function processSms(deps: TalkerDependencies, registry: FlowRegistry, phoneNumber: string, messageBody: string): Promise<string>;
12
+ //# sourceMappingURL=processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/routes/sms/processor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAmCjB"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Standalone Server
3
+ *
4
+ * Creates a self-contained Hono server with telephony routes.
5
+ * Use this when running talker WITHOUT chatter — you provide your own
6
+ * chatFn to handle the actual chatbot logic.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { createStandaloneServer } from "@diegoaltoworks/talker";
11
+ *
12
+ * const app = await createStandaloneServer({
13
+ * openaiApiKey: process.env.OPENAI_API_KEY!,
14
+ * twilio: {
15
+ * accountSid: process.env.TWILIO_ACCOUNT_SID,
16
+ * authToken: process.env.TWILIO_AUTH_TOKEN,
17
+ * phoneNumber: process.env.TWILIO_PHONE_NUMBER,
18
+ * },
19
+ * transferNumber: "+441234567890",
20
+ * chatFn: async (phoneNumber, message) => {
21
+ * // Your chatbot logic here
22
+ * return "I received your message: " + message;
23
+ * },
24
+ * });
25
+ *
26
+ * Bun.serve({ port: 3000, fetch: app.fetch });
27
+ * ```
28
+ */
29
+ import { Hono } from "hono";
30
+ import type { TalkerConfig } from "./types";
31
+ export interface StandaloneConfig extends TalkerConfig {
32
+ /** OpenAI API key (required in standalone mode) */
33
+ openaiApiKey: string;
34
+ /** Enable CORS. Default: true */
35
+ cors?: boolean;
36
+ }
37
+ /**
38
+ * Create a standalone Hono server with telephony routes.
39
+ *
40
+ * This does NOT require chatter. Provide a `chatFn` to handle chatbot logic,
41
+ * or leave it undefined for a telephony-only server (flows + transfer only).
42
+ */
43
+ export declare function createStandaloneServer(config: StandaloneConfig): Promise<Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">>;
44
+ //# sourceMappingURL=standalone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../src/standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAQ5B,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AAMhE,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,uFA0DpE"}
@@ -0,0 +1,240 @@
1
+ /**
2
+ * Talker Type Definitions
3
+ *
4
+ * Core types for the Talker telephony plugin.
5
+ * These types define the public API and configuration interface.
6
+ */
7
+ import type { ServerDependencies } from "@diegoaltoworks/chatter";
8
+ /**
9
+ * Channel type for telephony interactions
10
+ */
11
+ export type Channel = "call" | "sms";
12
+ /**
13
+ * Voice configuration for text-to-speech
14
+ */
15
+ export interface VoiceConfig {
16
+ /** TTS voice identifier (e.g., "Polly.Brian") */
17
+ voice: string;
18
+ /** BCP-47 language tag (e.g., "en-GB") */
19
+ language: string;
20
+ }
21
+ /**
22
+ * Twilio adapter configuration
23
+ */
24
+ export interface TwilioConfig {
25
+ /** Twilio account SID */
26
+ accountSid?: string;
27
+ /** Twilio auth token */
28
+ authToken?: string;
29
+ /** Twilio phone number for outbound SMS */
30
+ phoneNumber?: string;
31
+ }
32
+ /**
33
+ * Remote chatbot API configuration (standalone mode)
34
+ *
35
+ * When running without chatter, talker calls a remote chatbot API over HTTP.
36
+ * This matches chatter's /api/public/chat endpoint format.
37
+ */
38
+ export interface ChatbotConfig {
39
+ /** Chatbot API URL (e.g., "https://bot.example.com/api/public/chat") */
40
+ url: string;
41
+ /** API key for the chatbot (sent as x-api-key header) */
42
+ apiKey?: string;
43
+ /** System message prepended to conversation. Overrides the default */
44
+ systemMessage?: string;
45
+ }
46
+ /**
47
+ * Processing pipeline configuration
48
+ */
49
+ export interface ProcessingConfig {
50
+ /** OpenAI model for pre/post-processing. Default: gpt-4o-mini */
51
+ model?: string;
52
+ /** Path to incoming message system prompt */
53
+ incomingPromptPath?: string;
54
+ /** Path to outgoing message system prompt */
55
+ outgoingPromptPath?: string;
56
+ }
57
+ /**
58
+ * Feature flags for telephony behavior
59
+ */
60
+ export interface TelephonyFeatureFlags {
61
+ /** Enable "one moment please" async acknowledgment pattern. Default: false */
62
+ thinkingAcknowledgmentEnabled?: boolean;
63
+ }
64
+ /**
65
+ * Main configuration for Talker telephony plugin
66
+ */
67
+ export interface TalkerConfig {
68
+ /** Twilio credentials and phone number */
69
+ twilio?: TwilioConfig;
70
+ /** Phone number to transfer calls to when human handoff is requested */
71
+ transferNumber?: string;
72
+ /** Voice configuration per language code. Keys are ISO 639-1 codes (e.g., "en", "fr") */
73
+ voices?: Record<string, VoiceConfig>;
74
+ /** Directory containing flow definitions. Each flow is a subdirectory with flow.json, handler.ts, instructions.md */
75
+ flowsDir?: string;
76
+ /** Directory containing language phrase files (en.json, fr.json, etc.) */
77
+ languageDir?: string;
78
+ /** Processing pipeline configuration */
79
+ processing?: ProcessingConfig;
80
+ /** Feature flags */
81
+ features?: TelephonyFeatureFlags;
82
+ /** Remote chatbot API (standalone mode). Not needed in plugin mode — chatter's RAG is used directly */
83
+ chatbot?: ChatbotConfig;
84
+ /** Database config for session persistence. In plugin mode, falls back to chatter's database config */
85
+ database?: {
86
+ /** Turso/libSQL database URL */
87
+ url: string;
88
+ /** Turso auth token */
89
+ authToken: string;
90
+ };
91
+ /** OpenAI API key for the pre/post-processing pipeline. Falls back to chatter's OpenAI client */
92
+ openaiApiKey?: string;
93
+ /** Route prefix for telephony endpoints. Default: "" (mounts at /call and /sms) */
94
+ routePrefix?: string;
95
+ /** Conversation context TTL in milliseconds. Default: 1800000 (30 minutes) */
96
+ contextTtlMs?: number;
97
+ /** Context cleanup interval in milliseconds. Default: 300000 (5 minutes) */
98
+ cleanupIntervalMs?: number;
99
+ /** Maximum no-speech retries before ending call. Default: 3 */
100
+ maxNoSpeechRetries?: number;
101
+ /** Chat function override. By default, talker queries chatter's RAG pipeline directly */
102
+ chatFn?: (phoneNumber: string, message: string) => Promise<string>;
103
+ }
104
+ /**
105
+ * Dependencies available to talker routes and handlers
106
+ */
107
+ export interface TalkerDependencies {
108
+ /** Chatter server dependencies (OpenAI client, VectorStore, PromptLoader, config) */
109
+ chatter: ServerDependencies;
110
+ /** Talker-specific configuration */
111
+ config: TalkerConfig;
112
+ /** Resolved OpenAI API key for the processing pipeline */
113
+ openaiApiKey: string;
114
+ /** Resolved OpenAI model for the processing pipeline */
115
+ openaiModel: string;
116
+ }
117
+ /**
118
+ * Result from the incoming message pre-processor
119
+ */
120
+ export interface IncomingResult {
121
+ /** Whether the caller should be transferred to a human */
122
+ shouldTransfer: boolean;
123
+ /** Whether the caller wants to end the conversation */
124
+ shouldEndCall: boolean;
125
+ /** Detected language code (ISO 639-1) */
126
+ detectedLanguage: string;
127
+ /** Cleaned and processed message */
128
+ processedMessage: string;
129
+ }
130
+ /**
131
+ * Flow-related types
132
+ */
133
+ export interface FlowSchemaProperty {
134
+ type: "string" | "number" | "boolean";
135
+ description?: string;
136
+ }
137
+ export interface FlowSchema {
138
+ type: "object";
139
+ properties: Record<string, FlowSchemaProperty>;
140
+ required: string[];
141
+ }
142
+ export interface FlowDefinition {
143
+ id: string;
144
+ name: string;
145
+ description: string;
146
+ triggerKeywords: string[];
147
+ schema: FlowSchema;
148
+ }
149
+ export interface FlowState {
150
+ flowName: string;
151
+ params: Record<string, unknown>;
152
+ attempts: number;
153
+ startedAt: number;
154
+ }
155
+ export interface FlowHandlerResult {
156
+ success: boolean;
157
+ result?: unknown;
158
+ /** What to say via voice/call */
159
+ say: string;
160
+ /** Optional: different content for SMS */
161
+ sms?: string;
162
+ }
163
+ export interface FlowHandlerContext {
164
+ phoneNumber: string;
165
+ channel: Channel;
166
+ }
167
+ export type FlowHandler = (params: Record<string, unknown>, context: FlowHandlerContext) => Promise<FlowHandlerResult>;
168
+ export type FlowPrefill = (phoneNumber: string, context: Record<string, unknown>) => Record<string, unknown>;
169
+ export interface FlowExtractionResult {
170
+ extractedParams: Record<string, unknown>;
171
+ allParamsFilled: boolean;
172
+ nextPrompt?: string;
173
+ }
174
+ export interface IntentDetection {
175
+ intent: string;
176
+ confidence: number;
177
+ reasoning?: string;
178
+ }
179
+ export interface LoadedFlow {
180
+ definition: FlowDefinition;
181
+ handler: FlowHandler;
182
+ instructionsPath: string;
183
+ prefill?: FlowPrefill;
184
+ }
185
+ export interface FlowResult {
186
+ isFlowActive: boolean;
187
+ response: string;
188
+ flowCompleted: boolean;
189
+ smsContent?: string;
190
+ flowSuccess?: boolean;
191
+ }
192
+ /**
193
+ * Conversation context stored per phone number
194
+ */
195
+ export interface TelephonyContext {
196
+ phoneNumber: string;
197
+ channel: Channel;
198
+ detectedLanguage: string | null;
199
+ messageHistory: Array<{
200
+ role: "user" | "assistant";
201
+ content: string;
202
+ timestamp: number;
203
+ }>;
204
+ activeFlow: FlowState | null;
205
+ noSpeechRetries: number;
206
+ lastPrompt: string | null;
207
+ createdAt: number;
208
+ lastActivity: number;
209
+ }
210
+ /**
211
+ * Phrase file structure for each language
212
+ */
213
+ export interface Phrases {
214
+ greeting: string;
215
+ didNotCatch: string;
216
+ didNotHear: string;
217
+ didNotHearRetry: string;
218
+ didNotHearFinal: string;
219
+ transfer: string;
220
+ acknowledgment: string;
221
+ farewell: {
222
+ morning: string;
223
+ afternoon: string;
224
+ evening: string;
225
+ };
226
+ error: string;
227
+ timeout: string;
228
+ lostQuestion: string;
229
+ flow: {
230
+ cancelled: string;
231
+ };
232
+ sms: {
233
+ greeting: string;
234
+ greetingShort: string;
235
+ callForHelp: string;
236
+ processingError: string;
237
+ genericError: string;
238
+ };
239
+ }
240
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,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AAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,GAAG,EAAE;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
@@ -0,0 +1,27 @@
1
+ {
2
+ "greeting": "Hallo! Ich bin Ihr Sprachassistent. Wie kann ich Ihnen heute helfen?",
3
+ "didNotCatch": "Das habe ich nicht verstanden. Koennten Sie das bitte wiederholen?",
4
+ "didNotHear": "Ich habe nichts gehoert. Auf Wiedersehen.",
5
+ "didNotHearRetry": "Entschuldigung, ich habe das nicht verstanden. Koennten Sie es noch einmal versuchen?",
6
+ "didNotHearFinal": "Es tut mir wirklich leid, aber ich kann nicht hoeren, was Sie sagen. Bitte rufen Sie erneut an. Bis bald.",
7
+ "transfer": "Kein Problem, ich verbinde Sie jetzt.",
8
+ "acknowledgment": "Einen Moment bitte.",
9
+ "farewell": {
10
+ "morning": "Gern geschehen! Einen schoenen Tag noch. Auf Wiedersehen!",
11
+ "afternoon": "Gern geschehen! Einen schoenen Nachmittag noch. Auf Wiedersehen!",
12
+ "evening": "Gern geschehen! Einen schoenen Abend noch. Auf Wiedersehen!"
13
+ },
14
+ "error": "Entschuldigung, es ist ein Fehler aufgetreten. Bitte versuchen Sie es spaeter erneut. Auf Wiedersehen.",
15
+ "timeout": "Entschuldigung, ich habe zu lange gebraucht. Bitte versuchen Sie es erneut. Auf Wiedersehen.",
16
+ "lostQuestion": "Es tut mir leid, ich habe Ihre Frage verloren. Koennten Sie das wiederholen?",
17
+ "flow": {
18
+ "cancelled": "Kein Problem! Ich habe das abgebrochen. Wie kann ich helfen?"
19
+ },
20
+ "sms": {
21
+ "greeting": "Hallo! Ich bin Ihr Sprachassistent. Wie kann ich Ihnen helfen?",
22
+ "greetingShort": "Hallo! Senden Sie mir Ihre Frage!",
23
+ "callForHelp": "Fuer komplexe Fragen rufen Sie uns direkt an.",
24
+ "processingError": "Ich habe Schwierigkeiten, das zu verarbeiten. Bitte versuchen Sie es erneut oder rufen Sie uns an.",
25
+ "genericError": "Entschuldigung, etwas ist schief gelaufen. Bitte versuchen Sie es erneut."
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "greeting": "Hello! I'm your voice assistant. How can I help you today?",
3
+ "didNotCatch": "I didn't catch that. Could you please repeat?",
4
+ "didNotHear": "I didn't hear anything. Goodbye.",
5
+ "didNotHearRetry": "Sorry, I didn't catch that. Could you try again?",
6
+ "didNotHearFinal": "I'm really sorry but I cannot hear what you're saying. Please call again. Bye for now.",
7
+ "transfer": "Let me connect you with someone directly.",
8
+ "acknowledgment": "One moment please...",
9
+ "farewell": {
10
+ "morning": "You're welcome! Have a wonderful day. Goodbye!",
11
+ "afternoon": "You're welcome! Have a lovely afternoon. Goodbye!",
12
+ "evening": "You're welcome! Have a good evening. Goodbye!"
13
+ },
14
+ "error": "Sorry, I encountered an error. Please try again later. Goodbye.",
15
+ "timeout": "Sorry, I took too long to respond. Please try again. Goodbye.",
16
+ "lostQuestion": "I'm sorry, I lost track of your question. Could you please repeat?",
17
+ "flow": {
18
+ "cancelled": "No problem! I've cancelled that. What else would you like to know?"
19
+ },
20
+ "sms": {
21
+ "greeting": "Hi! I'm your voice assistant. Ask me anything!",
22
+ "greetingShort": "Hi! Ask me anything!",
23
+ "callForHelp": "For more complex questions, feel free to call back or reach us directly.",
24
+ "processingError": "I'm having trouble processing that. Please try texting again or call back.",
25
+ "genericError": "Sorry, something went wrong. Please try again."
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "greeting": "Hola! Soy su asistente de voz. Como puedo ayudarle hoy?",
3
+ "didNotCatch": "No entendi eso. Podria repetirlo, por favor?",
4
+ "didNotHear": "No escuche nada. Adios!",
5
+ "didNotHearRetry": "Lo siento, no entendi eso. Podria intentarlo de nuevo?",
6
+ "didNotHearFinal": "Lo siento mucho pero no puedo escuchar lo que dice. Por favor, llame de nuevo. Hasta pronto.",
7
+ "transfer": "No hay problema, le transfiero ahora.",
8
+ "acknowledgment": "Un momento, por favor.",
9
+ "farewell": {
10
+ "morning": "De nada! Que tenga un buen dia. Adios!",
11
+ "afternoon": "De nada! Que tenga una buena tarde. Adios!",
12
+ "evening": "De nada! Que tenga una buena noche. Adios!"
13
+ },
14
+ "error": "Lo siento, encontre un error. Por favor, intentelo mas tarde. Adios!",
15
+ "timeout": "Lo siento, tarde demasiado en responder. Por favor, intentelo de nuevo. Adios!",
16
+ "lostQuestion": "Lo siento, perdi el hilo de su pregunta. Podria repetir?",
17
+ "flow": {
18
+ "cancelled": "No hay problema! He cancelado eso. En que mas puedo ayudar?"
19
+ },
20
+ "sms": {
21
+ "greeting": "Hola! Soy su asistente de voz. Como puedo ayudarle?",
22
+ "greetingShort": "Hola! Enviame su pregunta!",
23
+ "callForHelp": "Para consultas complejas, llamenos directamente.",
24
+ "processingError": "Tengo problemas para procesar eso. Por favor intentelo de nuevo o llamenos.",
25
+ "genericError": "Lo siento, algo salio mal. Por favor intente de nuevo."
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "greeting": "Bonjour! Je suis votre assistant vocal. Comment puis-je vous aider aujourd'hui?",
3
+ "didNotCatch": "Je n'ai pas compris. Pourriez-vous repeter, s'il vous plait?",
4
+ "didNotHear": "Je n'ai rien entendu. Au revoir.",
5
+ "didNotHearRetry": "Desolee, je n'ai pas compris. Pourriez-vous reessayer?",
6
+ "didNotHearFinal": "Je suis vraiment desolee mais je n'arrive pas a entendre ce que vous dites. Veuillez rappeler. A bientot.",
7
+ "transfer": "Pas de probleme, je vous transfiere.",
8
+ "acknowledgment": "Un instant, s'il vous plait.",
9
+ "farewell": {
10
+ "morning": "Je vous en prie! Passez une excellente journee. Au revoir!",
11
+ "afternoon": "Je vous en prie! Passez un bon apres-midi. Au revoir!",
12
+ "evening": "Je vous en prie! Passez une bonne soiree. Au revoir!"
13
+ },
14
+ "error": "Desole, j'ai rencontre une erreur. Veuillez reessayer plus tard. Au revoir.",
15
+ "timeout": "Desole, j'ai mis trop de temps a repondre. Veuillez reessayer. Au revoir.",
16
+ "lostQuestion": "Je suis desole, j'ai perdu le fil de votre question. Pourriez-vous repeter?",
17
+ "flow": {
18
+ "cancelled": "Pas de probleme! J'ai annule ca. Comment puis-je vous aider?"
19
+ },
20
+ "sms": {
21
+ "greeting": "Bonjour! Je suis votre assistant vocal. Comment puis-je vous aider?",
22
+ "greetingShort": "Bonjour! Envoyez-moi votre question!",
23
+ "callForHelp": "Pour des questions complexes, appelez-nous directement.",
24
+ "processingError": "J'ai du mal a traiter cela. Veuillez reessayer ou nous appeler.",
25
+ "genericError": "Desole, quelque chose s'est mal passe. Veuillez reessayer."
26
+ }
27
+ }