@contractspec/lib.support-bot 1.56.1 → 1.58.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 (216) hide show
  1. package/dist/bot/auto-responder.d.ts +19 -23
  2. package/dist/bot/auto-responder.d.ts.map +1 -1
  3. package/dist/bot/auto-responder.js +86 -68
  4. package/dist/bot/feedback-loop.d.ts +13 -17
  5. package/dist/bot/feedback-loop.d.ts.map +1 -1
  6. package/dist/bot/feedback-loop.js +38 -34
  7. package/dist/bot/index.d.ts +4 -4
  8. package/dist/bot/index.d.ts.map +1 -0
  9. package/dist/bot/index.js +268 -4
  10. package/dist/bot/tools.d.ts +9 -13
  11. package/dist/bot/tools.d.ts.map +1 -1
  12. package/dist/bot/tools.js +118 -123
  13. package/dist/browser/bot/auto-responder.js +101 -0
  14. package/dist/browser/bot/feedback-loop.js +38 -0
  15. package/dist/browser/bot/index.js +268 -0
  16. package/dist/browser/bot/tools.js +131 -0
  17. package/dist/browser/index.js +517 -0
  18. package/dist/browser/rag/index.js +65 -0
  19. package/dist/browser/rag/ticket-resolver.js +65 -0
  20. package/dist/browser/spec.js +33 -0
  21. package/dist/browser/tickets/classifier.js +156 -0
  22. package/dist/browser/tickets/index.js +156 -0
  23. package/dist/browser/types.js +0 -0
  24. package/dist/index.d.ts +6 -11
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +518 -9
  27. package/dist/node/bot/auto-responder.js +101 -0
  28. package/dist/node/bot/feedback-loop.js +38 -0
  29. package/dist/node/bot/index.js +268 -0
  30. package/dist/node/bot/tools.js +131 -0
  31. package/dist/node/index.js +517 -0
  32. package/dist/node/rag/index.js +65 -0
  33. package/dist/node/rag/ticket-resolver.js +65 -0
  34. package/dist/node/spec.js +33 -0
  35. package/dist/node/tickets/classifier.js +156 -0
  36. package/dist/node/tickets/index.js +156 -0
  37. package/dist/node/types.js +0 -0
  38. package/dist/rag/index.d.ts +2 -2
  39. package/dist/rag/index.d.ts.map +1 -0
  40. package/dist/rag/index.js +66 -3
  41. package/dist/rag/ticket-resolver.d.ts +17 -21
  42. package/dist/rag/ticket-resolver.d.ts.map +1 -1
  43. package/dist/rag/ticket-resolver.js +65 -63
  44. package/dist/spec.d.ts +7 -12
  45. package/dist/spec.d.ts.map +1 -1
  46. package/dist/spec.js +31 -32
  47. package/dist/tickets/classifier.d.ts +18 -22
  48. package/dist/tickets/classifier.d.ts.map +1 -1
  49. package/dist/tickets/classifier.js +153 -195
  50. package/dist/tickets/index.d.ts +2 -2
  51. package/dist/tickets/index.d.ts.map +1 -0
  52. package/dist/tickets/index.js +156 -2
  53. package/dist/types.d.ts +62 -67
  54. package/dist/types.d.ts.map +1 -1
  55. package/dist/types.js +1 -0
  56. package/package.json +127 -38
  57. package/dist/ai-agent/src/agent/contract-spec-agent.d.ts +0 -5
  58. package/dist/ai-agent/src/agent/index.d.ts +0 -2
  59. package/dist/ai-agent/src/agent/unified-agent.d.ts +0 -3
  60. package/dist/ai-agent/src/approval/index.d.ts +0 -1
  61. package/dist/ai-agent/src/approval/workflow.d.ts +0 -1
  62. package/dist/ai-agent/src/exporters/claude-agent-exporter.d.ts +0 -2
  63. package/dist/ai-agent/src/exporters/index.d.ts +0 -3
  64. package/dist/ai-agent/src/exporters/opencode-exporter.d.ts +0 -2
  65. package/dist/ai-agent/src/exporters/types.d.ts +0 -2
  66. package/dist/ai-agent/src/index.d.ts +0 -14
  67. package/dist/ai-agent/src/interop/index.d.ts +0 -3
  68. package/dist/ai-agent/src/interop/spec-consumer.d.ts +0 -2
  69. package/dist/ai-agent/src/interop/tool-consumer.d.ts +0 -3
  70. package/dist/ai-agent/src/interop/types.d.ts +0 -2
  71. package/dist/ai-agent/src/knowledge/index.d.ts +0 -1
  72. package/dist/ai-agent/src/knowledge/injector.d.ts +0 -1
  73. package/dist/ai-agent/src/providers/claude-agent-sdk/adapter.d.ts +0 -2
  74. package/dist/ai-agent/src/providers/claude-agent-sdk/index.d.ts +0 -3
  75. package/dist/ai-agent/src/providers/claude-agent-sdk/session-bridge.d.ts +0 -1
  76. package/dist/ai-agent/src/providers/claude-agent-sdk/tool-bridge.d.ts +0 -3
  77. package/dist/ai-agent/src/providers/index.d.ts +0 -4
  78. package/dist/ai-agent/src/providers/opencode-sdk/adapter.d.ts +0 -2
  79. package/dist/ai-agent/src/providers/opencode-sdk/agent-bridge.d.ts +0 -3
  80. package/dist/ai-agent/src/providers/opencode-sdk/index.d.ts +0 -3
  81. package/dist/ai-agent/src/providers/opencode-sdk/tool-bridge.d.ts +0 -3
  82. package/dist/ai-agent/src/providers/registry.d.ts +0 -1
  83. package/dist/ai-agent/src/providers/types.d.ts +0 -3
  84. package/dist/ai-agent/src/schema/index.d.ts +0 -2
  85. package/dist/ai-agent/src/schema/json-schema-to-zod.d.ts +0 -1
  86. package/dist/ai-agent/src/schema/schema-output.d.ts +0 -2
  87. package/dist/ai-agent/src/session/index.d.ts +0 -1
  88. package/dist/ai-agent/src/session/store.d.ts +0 -2
  89. package/dist/ai-agent/src/spec/index.d.ts +0 -2
  90. package/dist/ai-agent/src/spec/registry.d.ts +0 -2
  91. package/dist/ai-agent/src/spec/spec.d.ts +0 -115
  92. package/dist/ai-agent/src/spec/spec.d.ts.map +0 -1
  93. package/dist/ai-agent/src/telemetry/adapter.d.ts +0 -1
  94. package/dist/ai-agent/src/telemetry/index.d.ts +0 -1
  95. package/dist/ai-agent/src/tools/index.d.ts +0 -4
  96. package/dist/ai-agent/src/tools/knowledge-tool.d.ts +0 -2
  97. package/dist/ai-agent/src/tools/mcp-client.d.ts +0 -1
  98. package/dist/ai-agent/src/tools/mcp-server.d.ts +0 -3
  99. package/dist/ai-agent/src/tools/tool-adapter.d.ts +0 -3
  100. package/dist/ai-agent/src/types.d.ts +0 -1
  101. package/dist/bot/auto-responder.js.map +0 -1
  102. package/dist/bot/feedback-loop.js.map +0 -1
  103. package/dist/bot/tools.js.map +0 -1
  104. package/dist/contracts/src/app-config/lifecycle.d.ts +0 -1
  105. package/dist/contracts/src/app-config/runtime.d.ts +0 -13
  106. package/dist/contracts/src/app-config/spec.d.ts +0 -9
  107. package/dist/contracts/src/capabilities/capabilities.d.ts +0 -1
  108. package/dist/contracts/src/capabilities/context.d.ts +0 -1
  109. package/dist/contracts/src/capabilities/guards.d.ts +0 -4
  110. package/dist/contracts/src/capabilities/index.d.ts +0 -5
  111. package/dist/contracts/src/capabilities/openbanking.d.ts +0 -1
  112. package/dist/contracts/src/capabilities/validation.d.ts +0 -4
  113. package/dist/contracts/src/data-views/index.d.ts +0 -3
  114. package/dist/contracts/src/data-views/registry.d.ts +0 -2
  115. package/dist/contracts/src/data-views/report/contractVerificationTable.d.ts +0 -1
  116. package/dist/contracts/src/data-views/spec.d.ts +0 -3
  117. package/dist/contracts/src/data-views/types.d.ts +0 -2
  118. package/dist/contracts/src/docs/accessibility_wcag_compliance_specs.docblock.d.ts +0 -1
  119. package/dist/contracts/src/docs/commands/docsGenerate.command.d.ts +0 -1
  120. package/dist/contracts/src/docs/commands/docsPublish.command.d.ts +0 -1
  121. package/dist/contracts/src/docs/commands/index.d.ts +0 -2
  122. package/dist/contracts/src/docs/contracts.d.ts +0 -6
  123. package/dist/contracts/src/docs/events/docsGenerated.event.d.ts +0 -1
  124. package/dist/contracts/src/docs/events/docsPublished.event.d.ts +0 -1
  125. package/dist/contracts/src/docs/events/index.d.ts +0 -2
  126. package/dist/contracts/src/docs/forms/docsSearch.form.d.ts +0 -1
  127. package/dist/contracts/src/docs/forms/index.d.ts +0 -1
  128. package/dist/contracts/src/docs/index.d.ts +0 -30
  129. package/dist/contracts/src/docs/presentations.d.ts +0 -2
  130. package/dist/contracts/src/docs/queries/contractReference.query.d.ts +0 -1
  131. package/dist/contracts/src/docs/queries/docsIndex.query.d.ts +0 -1
  132. package/dist/contracts/src/docs/queries/index.d.ts +0 -2
  133. package/dist/contracts/src/docs/registry.d.ts +0 -10
  134. package/dist/contracts/src/docs/registry.d.ts.map +0 -1
  135. package/dist/contracts/src/docs/tech/auth/better-auth-nextjs.docblock.d.ts +0 -1
  136. package/dist/contracts/src/docs/tech/contracts/README.docblock.d.ts +0 -1
  137. package/dist/contracts/src/docs/tech/contracts/openapi-export.docblock.d.ts +0 -1
  138. package/dist/contracts/src/docs/tech/contracts/openapi-import.docblock.d.ts +0 -1
  139. package/dist/contracts/src/docs/tech/lifecycle-stage-system.docblock.d.ts +0 -1
  140. package/dist/contracts/src/docs/tech/llm/llm-integration.docblock.d.ts +0 -1
  141. package/dist/contracts/src/docs/tech/mcp-endpoints.docblock.d.ts +0 -1
  142. package/dist/contracts/src/docs/tech/presentation-runtime.docblock.d.ts +0 -1
  143. package/dist/contracts/src/docs/tech/schema/README.docblock.d.ts +0 -1
  144. package/dist/contracts/src/docs/tech/studio/learning-events.docblock.d.ts +0 -1
  145. package/dist/contracts/src/docs/tech/studio/learning-journeys.docblock.d.ts +0 -1
  146. package/dist/contracts/src/docs/tech/studio/platform-admin-panel.docblock.d.ts +0 -1
  147. package/dist/contracts/src/docs/tech/studio/project-access-teams.docblock.d.ts +0 -1
  148. package/dist/contracts/src/docs/tech/studio/project-routing.docblock.d.ts +0 -1
  149. package/dist/contracts/src/docs/tech/studio/sandbox-unlogged.docblock.d.ts +0 -1
  150. package/dist/contracts/src/docs/tech/studio/team-invitations.docblock.d.ts +0 -1
  151. package/dist/contracts/src/docs/tech/studio/workspace-ops.docblock.d.ts +0 -1
  152. package/dist/contracts/src/docs/tech/studio/workspaces.docblock.d.ts +0 -1
  153. package/dist/contracts/src/docs/tech/telemetry-ingest.docblock.d.ts +0 -1
  154. package/dist/contracts/src/docs/tech/vscode-extension.docblock.d.ts +0 -1
  155. package/dist/contracts/src/events.d.ts +0 -5
  156. package/dist/contracts/src/experiments/spec-resolver.d.ts +0 -4
  157. package/dist/contracts/src/experiments/spec.d.ts +0 -4
  158. package/dist/contracts/src/features/index.d.ts +0 -4
  159. package/dist/contracts/src/features/install.d.ts +0 -6
  160. package/dist/contracts/src/features/registry.d.ts +0 -2
  161. package/dist/contracts/src/features/types.d.ts +0 -5
  162. package/dist/contracts/src/features/validation.d.ts +0 -2
  163. package/dist/contracts/src/forms/forms.d.ts +0 -3
  164. package/dist/contracts/src/forms/index.d.ts +0 -1
  165. package/dist/contracts/src/install.d.ts +0 -7
  166. package/dist/contracts/src/integrations/connection.d.ts +0 -1
  167. package/dist/contracts/src/integrations/providers/llm.d.ts +0 -83
  168. package/dist/contracts/src/integrations/providers/llm.d.ts.map +0 -1
  169. package/dist/contracts/src/integrations/spec.d.ts +0 -3
  170. package/dist/contracts/src/knowledge/spec.d.ts +0 -9
  171. package/dist/contracts/src/knowledge/spec.d.ts.map +0 -1
  172. package/dist/contracts/src/operations/index.d.ts +0 -3
  173. package/dist/contracts/src/operations/operation.d.ts +0 -7
  174. package/dist/contracts/src/operations/registry.d.ts +0 -6
  175. package/dist/contracts/src/operations/report/getContractVerificationStatus.d.ts +0 -3
  176. package/dist/contracts/src/operations/report/index.d.ts +0 -4
  177. package/dist/contracts/src/ownership.d.ts +0 -164
  178. package/dist/contracts/src/ownership.d.ts.map +0 -1
  179. package/dist/contracts/src/policy/registry.d.ts +0 -2
  180. package/dist/contracts/src/policy/spec.d.ts +0 -13
  181. package/dist/contracts/src/policy/spec.d.ts.map +0 -1
  182. package/dist/contracts/src/presentations/index.d.ts +0 -3
  183. package/dist/contracts/src/presentations/presentations.d.ts +0 -3
  184. package/dist/contracts/src/presentations/registry.d.ts +0 -2
  185. package/dist/contracts/src/presentations/transform-engine.d.ts +0 -2
  186. package/dist/contracts/src/registry-utils.d.ts +0 -1
  187. package/dist/contracts/src/registry.d.ts +0 -3
  188. package/dist/contracts/src/resources.d.ts +0 -2
  189. package/dist/contracts/src/telemetry/anomaly.d.ts +0 -2
  190. package/dist/contracts/src/telemetry/index.d.ts +0 -3
  191. package/dist/contracts/src/telemetry/spec.d.ts +0 -2
  192. package/dist/contracts/src/telemetry/tracker.d.ts +0 -3
  193. package/dist/contracts/src/tests/spec.d.ts +0 -1
  194. package/dist/contracts/src/themes.d.ts +0 -2
  195. package/dist/contracts/src/types.d.ts +0 -5
  196. package/dist/contracts/src/versioning/refs.d.ts +0 -28
  197. package/dist/contracts/src/versioning/refs.d.ts.map +0 -1
  198. package/dist/contracts/src/workflow/overview.docblock.d.ts +0 -1
  199. package/dist/contracts/src/workflow/spec.d.ts +0 -5
  200. package/dist/contracts/src/workspace-config/workspace-config.docblock.d.ts +0 -1
  201. package/dist/rag/ticket-resolver.js.map +0 -1
  202. package/dist/schema/src/EnumType.d.ts +0 -2
  203. package/dist/schema/src/FieldType.d.ts +0 -2
  204. package/dist/schema/src/GraphQLSchemaType.d.ts +0 -2
  205. package/dist/schema/src/JsonSchemaType.d.ts +0 -2
  206. package/dist/schema/src/ScalarTypeEnum.d.ts +0 -1
  207. package/dist/schema/src/SchemaModel.d.ts +0 -4
  208. package/dist/schema/src/SchemaModelType.d.ts +0 -1
  209. package/dist/schema/src/ZodSchemaType.d.ts +0 -2
  210. package/dist/schema/src/entity/defineEntity.d.ts +0 -1
  211. package/dist/schema/src/entity/generator.d.ts +0 -1
  212. package/dist/schema/src/entity/index.d.ts +0 -3
  213. package/dist/schema/src/entity/types.d.ts +0 -1
  214. package/dist/schema/src/index.d.ts +0 -9
  215. package/dist/spec.js.map +0 -1
  216. package/dist/tickets/classifier.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../ai-agent/src/spec/spec.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAOA;AAKiB,KALL,SAAA,GAAY,aAWb;AAgBX;AAgBA;AAcA;AAUiB,UA9DA,eAAA,CA8DqB;EAcrB;EAUA,IAAA,EAAA,MAAS;EAClB;EAQC,WAAA,CAAA,EAAA,MAAA;EAEE;EAEG,MAAA,CAAA,EA7FH,MA6FG,CAAA,MAAA,EAAA,OAAA,CAAA;EAEH;EAAW,UAAA,CAAA,EAAA,MAAA;;;;;;;;WArFX;;;;;UAMM,iBAAA;;;;;;aAMJ;;;;;;;;;UAUI,iBAAA;;;;;;;;;;;;;UAcA,qBAAA;;;;;;;;;UAUA,qBAAA;;;;;;;;;;;;;UAcA,WAAA;eACF;eACA;;;;;;;UAQE,SAAA;QACT;;;;;;;;SAQC;;WAEE;;cAEG;;WAEH"}
@@ -1 +0,0 @@
1
- import "ai";
@@ -1 +0,0 @@
1
- import "./adapter.js";
@@ -1,4 +0,0 @@
1
- import "./mcp-client.js";
2
- import "./tool-adapter.js";
3
- import "./knowledge-tool.js";
4
- import "./mcp-server.js";
@@ -1,2 +0,0 @@
1
- import "../spec/spec.js";
2
- import "ai";
@@ -1 +0,0 @@
1
- import "ai";
@@ -1,3 +0,0 @@
1
- import "../spec/spec.js";
2
- import "../agent/contract-spec-agent.js";
3
- import "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1,3 +0,0 @@
1
- import "../spec/spec.js";
2
- import "../types.js";
3
- import "ai";
@@ -1 +0,0 @@
1
- import "ai";
@@ -1 +0,0 @@
1
- {"version":3,"file":"auto-responder.js","names":[],"sources":["../../src/bot/auto-responder.ts"],"sourcesContent":["import type { LLMProvider } from '@contractspec/lib.contracts/integrations/providers/llm';\nimport type {\n SupportResponseDraft,\n SupportResolution,\n SupportTicket,\n TicketClassification,\n} from '../types';\n\nexport interface AutoResponderOptions {\n llm?: LLMProvider;\n model?: string;\n tone?: 'friendly' | 'formal';\n closing?: string;\n}\n\nexport class AutoResponder {\n private readonly llm?: LLMProvider;\n private readonly model?: string;\n private readonly tone: 'friendly' | 'formal';\n private readonly closing: string;\n\n constructor(options?: AutoResponderOptions) {\n this.llm = options?.llm;\n this.model = options?.model;\n this.tone = options?.tone ?? 'friendly';\n this.closing =\n options?.closing ??\n (this.tone === 'friendly'\n ? 'We remain available if you need anything else.'\n : 'Please let us know if you require additional assistance.');\n }\n\n async draft(\n ticket: SupportTicket,\n resolution: SupportResolution,\n classification: TicketClassification\n ): Promise<SupportResponseDraft> {\n if (this.llm) {\n return this.generateWithLLM(ticket, resolution, classification);\n }\n return this.generateTemplate(ticket, resolution, classification);\n }\n\n private async generateWithLLM(\n ticket: SupportTicket,\n resolution: SupportResolution,\n classification: TicketClassification\n ): Promise<SupportResponseDraft> {\n const prompt = `You are a ${this.tone} support agent. Draft an email response.\nTicket Subject: ${ticket.subject}\nTicket Body: ${ticket.body}\nDetected Category: ${classification.category}\nDetected Priority: ${classification.priority}\nResolution:\n${resolution.answer}\nCitations: ${resolution.citations.map((c) => c.label).join(', ')}`;\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const response = await this.llm!.chat(\n [\n {\n role: 'system',\n content: [\n {\n type: 'text',\n text: 'Write empathetic, accurate support replies that cite sources when relevant.',\n },\n ],\n },\n {\n role: 'user',\n content: [{ type: 'text', text: prompt }],\n },\n ],\n { model: this.model }\n );\n\n const body = response.message.content\n .map((part) => ('text' in part ? part.text : ''))\n .join('')\n .trim();\n\n return this.buildDraft(ticket, resolution, classification, body);\n }\n\n private generateTemplate(\n ticket: SupportTicket,\n resolution: SupportResolution,\n classification: TicketClassification\n ): SupportResponseDraft {\n const greeting = ticket.customerName\n ? `Hi ${ticket.customerName},`\n : 'Hi there,';\n const body = `${greeting}\n\nThanks for contacting us about \"${ticket.subject}\". ${this.renderCategoryIntro(\n classification\n )}\n\n${resolution.answer}\n\n${this.renderCitations(resolution)}\n${this.closing}\n\n— ContractSpec Support`;\n\n return this.buildDraft(ticket, resolution, classification, body);\n }\n\n private buildDraft(\n ticket: SupportTicket,\n resolution: SupportResolution,\n classification: TicketClassification,\n body: string\n ): SupportResponseDraft {\n return {\n ticketId: ticket.id,\n subject: ticket.subject.startsWith('Re:')\n ? ticket.subject\n : `Re: ${ticket.subject}`,\n body,\n confidence: Math.min(resolution.confidence, classification.confidence),\n requiresEscalation:\n resolution.actions.some((action) => action.type === 'escalate') ||\n Boolean(classification.escalationRequired),\n citations: resolution.citations,\n };\n }\n\n private renderCategoryIntro(classification: TicketClassification) {\n switch (classification.category) {\n case 'billing':\n return 'I understand billing issues can be stressful, so let me clarify the situation.';\n case 'technical':\n return 'I see you encountered a technical issue. Here is what happened and how to fix it.';\n case 'product':\n return 'Thanks for sharing feedback about the product. Here are the next steps.';\n case 'account':\n return 'Account access is critical, so let me walk you through the resolution.';\n case 'compliance':\n return 'Compliance questions require precision. See the policy-aligned answer below.';\n default:\n return 'Here is what we found after reviewing your request.';\n }\n }\n\n private renderCitations(resolution: SupportResolution) {\n if (!resolution.citations.length) return '';\n const lines = resolution.citations.map((citation, index) => {\n const label = citation.label || `Source ${index + 1}`;\n const link = citation.url ? ` (${citation.url})` : '';\n return `- ${label}${link}`;\n });\n return `References:\\n${lines.join('\\n')}`;\n }\n}\n"],"mappings":";AAeA,IAAa,gBAAb,MAA2B;CACzB,AAAiB;CACjB,AAAiB;CACjB,AAAiB;CACjB,AAAiB;CAEjB,YAAY,SAAgC;AAC1C,OAAK,MAAM,SAAS;AACpB,OAAK,QAAQ,SAAS;AACtB,OAAK,OAAO,SAAS,QAAQ;AAC7B,OAAK,UACH,SAAS,YACR,KAAK,SAAS,aACX,mDACA;;CAGR,MAAM,MACJ,QACA,YACA,gBAC+B;AAC/B,MAAI,KAAK,IACP,QAAO,KAAK,gBAAgB,QAAQ,YAAY,eAAe;AAEjE,SAAO,KAAK,iBAAiB,QAAQ,YAAY,eAAe;;CAGlE,MAAc,gBACZ,QACA,YACA,gBAC+B;EAC/B,MAAM,SAAS,aAAa,KAAK,KAAK;kBACxB,OAAO,QAAQ;eAClB,OAAO,KAAK;qBACN,eAAe,SAAS;qBACxB,eAAe,SAAS;;EAE3C,WAAW,OAAO;aACP,WAAW,UAAU,KAAK,MAAM,EAAE,MAAM,CAAC,KAAK,KAAK;EAsB5D,MAAM,QAnBW,MAAM,KAAK,IAAK,KAC/B,CACE;GACE,MAAM;GACN,SAAS,CACP;IACE,MAAM;IACN,MAAM;IACP,CACF;GACF,EACD;GACE,MAAM;GACN,SAAS,CAAC;IAAE,MAAM;IAAQ,MAAM;IAAQ,C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"feedback-loop.js","names":[],"sources":["../../src/bot/feedback-loop.ts"],"sourcesContent":["import type { ResolutionResultPayload } from '../types';\n\nexport interface FeedbackMetrics {\n totalTickets: number;\n autoResolved: number;\n escalated: number;\n avgConfidence: number;\n avgResponseTimeMs: number;\n}\n\nexport class SupportFeedbackLoop {\n private readonly history: ResolutionResultPayload[] = [];\n private readonly responseTimes = new Map<string, number>();\n\n recordResolution(payload: ResolutionResultPayload, responseTimeMs?: number) {\n this.history.push(payload);\n if (responseTimeMs != null) {\n this.responseTimes.set(payload.ticket.id, responseTimeMs);\n }\n }\n\n metrics(): FeedbackMetrics {\n const total = this.history.length;\n const autoResolved = this.history.filter(\n (entry) =>\n !entry.resolution.actions.some((action) => action.type === 'escalate')\n ).length;\n const escalated = total - autoResolved;\n const avgConfidence =\n total === 0\n ? 0\n : this.history.reduce(\n (sum, entry) => sum + entry.resolution.confidence,\n 0\n ) / total;\n const avgResponseTimeMs =\n this.responseTimes.size === 0\n ? 0\n : [...this.responseTimes.values()].reduce((a, b) => a + b, 0) /\n this.responseTimes.size;\n\n return {\n totalTickets: total,\n autoResolved,\n escalated,\n avgConfidence: Number(avgConfidence.toFixed(2)),\n avgResponseTimeMs: Math.round(avgResponseTimeMs),\n };\n }\n\n feedbackSummary(limit = 5): string {\n const recent = this.history.slice(-limit);\n if (!recent.length) return 'No feedback recorded yet.';\n return recent\n .map((entry) => {\n const status = entry.resolution.actions.some(\n (action) => action.type === 'escalate'\n )\n ? 'Escalated'\n : 'Auto-resolved';\n return `${entry.ticket.subject} – ${status} (confidence: ${entry.resolution.confidence})`;\n })\n .join('\\n');\n }\n}\n"],"mappings":";AAUA,IAAa,sBAAb,MAAiC;CAC/B,AAAiB,UAAqC,EAAE;CACxD,AAAiB,gCAAgB,IAAI,KAAqB;CAE1D,iBAAiB,SAAkC,gBAAyB;AAC1E,OAAK,QAAQ,KAAK,QAAQ;AAC1B,MAAI,kBAAkB,KACpB,MAAK,cAAc,IAAI,QAAQ,OAAO,IAAI,eAAe;;CAI7D,UAA2B;EACzB,MAAM,QAAQ,KAAK,QAAQ;EAC3B,MAAM,eAAe,KAAK,QAAQ,QAC/B,UACC,CAAC,MAAM,WAAW,QAAQ,MAAM,WAAW,OAAO,SAAS,WAAW,CACzE,CAAC;EACF,MAAM,YAAY,QAAQ;EAC1B,MAAM,gBACJ,UAAU,IACN,IACA,KAAK,QAAQ,QACV,KAAK,UAAU,MAAM,MAAM,WAAW,YACvC,EACD,GAAG;EACV,MAAM,oBACJ,KAAK,cAAc,SAAS,IACxB,IACA,CAAC,GAAG,KAAK,cAAc,QAAQ,CAAC,CAAC,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,GAC3D,KAAK,cAAc;AAEzB,SAAO;GACL,cAAc;GACd;GACA;GACA,eAAe,OAAO,cAAc,QAAQ,EAAE,CAAC;GAC/C,mBAAmB,KAAK,MAAM,kBAAkB;GACjD;;CAGH,gBAAgB,QAAQ,GAAW;EACjC,MAAM,SAAS,KAAK,QAAQ,MAAM,CAAC,MAAM;AACzC,MAAI,CAAC,OAAO,OAAQ,QAAO;AAC3B,SAAO,OACJ,KAAK,UAAU;GACd,MAAM,SAAS,MAAM,WAAW,QAAQ,MACrC,WAAW,OAAO,SAAS,WAC7B,GACG,cACA;AACJ,UAAO,GAAG,MAAM,OAAO,QAAQ,KAAK,OAAO,gBAAgB,MAAM,WAAW,WAAW;IACvF,CACD,KAAK,KAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","names":[],"sources":["../../src/bot/tools.ts"],"sourcesContent":["import type { TicketResolver } from '../rag/ticket-resolver';\nimport type { TicketClassifier } from '../tickets/classifier';\nimport type { AutoResponder } from './auto-responder';\nimport type {\n SupportAction,\n SupportCitation,\n SupportResolution,\n SupportTicket,\n TicketCategory,\n TicketClassification,\n TicketPriority,\n TicketSentiment,\n} from '../types';\nimport type { Tool } from '@ai-sdk/provider-utils';\nimport * as z from 'zod';\n\nconst ticketSchema = z.object({\n id: z.string(),\n subject: z.string(),\n body: z.string(),\n channel: z.enum(['email', 'chat', 'phone', 'portal']),\n customerName: z.string().optional(),\n customerEmail: z.string().optional(),\n metadata: z.object().optional(),\n}) satisfies z.ZodType<SupportTicket>;\nconst supportCitationSchema = z.object({\n label: z.string(),\n url: z.string().optional(),\n snippet: z.string().optional(),\n score: z.number().optional(),\n}) satisfies z.ZodType<SupportCitation>;\nconst supportActionSchema = z.object({\n type: z.enum(['respond', 'escalate', 'refund', 'manual']),\n label: z.string(),\n payload: z.record(z.string(), z.string()),\n}) satisfies z.ZodType<SupportAction>;\nconst supportResolutionSchema = z.object({\n ticketId: z.string(),\n answer: z.string(),\n confidence: z.number(),\n citations: supportCitationSchema.array(),\n actions: supportActionSchema.array(),\n escalationReason: z.string().optional(),\n knowledgeUpdates: z.array(z.string()).optional(),\n}) satisfies z.ZodType<SupportResolution>;\nconst ticketClassificationSchema = z.object({\n ticketId: z.string(),\n category: z.enum([\n 'billing',\n 'technical',\n 'product',\n 'account',\n 'compliance',\n 'other',\n ]) satisfies z.ZodType<TicketCategory>,\n priority: z.enum([\n 'urgent',\n 'high',\n 'medium',\n 'low',\n ]) satisfies z.ZodType<TicketPriority>,\n sentiment: z.enum([\n 'positive',\n 'neutral',\n 'negative',\n 'frustrated',\n ]) satisfies z.ZodType<TicketSentiment>,\n intents: z.array(z.string()),\n tags: z.array(z.string()),\n confidence: z.number(),\n escalationRequired: z.boolean().optional(),\n}) satisfies z.ZodType<TicketClassification>;\n\nfunction ensureTicket(input: unknown): SupportTicket {\n if (!input || typeof input !== 'object' || !('ticket' in input)) {\n throw new Error('Input must include ticket');\n }\n const ticket = (input as { ticket: SupportTicket }).ticket;\n if (!ticket?.id) throw new Error('Ticket is missing id');\n return ticket;\n}\n\nfunction extractResolution(input: unknown): SupportResolution | undefined {\n if (!input || typeof input !== 'object' || !('resolution' in input))\n return undefined;\n return (input as { resolution?: SupportResolution }).resolution;\n}\n\nfunction extractClassification(\n input: unknown\n): TicketClassification | undefined {\n if (!input || typeof input !== 'object' || !('classification' in input))\n return undefined;\n return (input as { classification?: TicketClassification }).classification;\n}\n\nexport interface SupportToolsetOptions {\n resolver: TicketResolver;\n classifier: TicketClassifier;\n responder: AutoResponder;\n}\n\nexport function createSupportTools(options: SupportToolsetOptions): Tool[] {\n const classifyTool: Tool = {\n title: 'support_classify_ticket',\n description: 'Classify a ticket for priority, sentiment, and category',\n inputSchema: z.object({ ticket: ticketSchema }),\n execute: async (input: unknown) => {\n const ticket = ensureTicket(input);\n const classification = await options.classifier.classify(ticket);\n return {\n content: JSON.stringify(classification),\n metadata: { ticketId: ticket.id },\n };\n },\n };\n\n const resolveTool: Tool = {\n title: 'support_resolve_ticket',\n description: 'Generate a knowledge-grounded resolution for a ticket',\n inputSchema: z.object({ ticket: ticketSchema }),\n execute: async (input: unknown) => {\n const ticket = ensureTicket(input);\n const resolution = await options.resolver.resolve(ticket);\n return {\n content: JSON.stringify(resolution),\n metadata: { ticketId: ticket.id },\n };\n },\n };\n\n const responderTool: Tool = {\n title: 'support_draft_response',\n description:\n 'Draft a user-facing reply based on resolution + classification',\n inputSchema: z.object({\n ticket: ticketSchema,\n resolution: supportResolutionSchema,\n classification: ticketClassificationSchema,\n }),\n execute: async (input: unknown) => {\n const ticket = ensureTicket(input);\n const resolution = extractResolution(input);\n const classification = extractClassification(input);\n if (!resolution || !classification) {\n throw new Error('resolution and classification are required');\n }\n const draft = await options.responder.draft(\n ticket,\n resolution,\n classification\n );\n return {\n content: JSON.stringify(draft),\n metadata: { ticketId: ticket.id },\n };\n },\n };\n\n return [classifyTool, resolveTool, responderTool];\n}\n"],"mappings":";;;AAgBA,MAAM,eAAe,EAAE,OAAO;CAC5B,IAAI,EAAE,QAAQ;CACd,SAAS,EAAE,QAAQ;CACnB,MAAM,EAAE,QAAQ;CAChB,SAAS,EAAE,KAAK;EAAC;EAAS;EAAQ;EAAS;EAAS,CAAC;CACrD,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,eAAe,EAAE,Q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,QAAQ,UAAU,MACpC,QACA,YACA,eACD;AACD,WAAO;KACL,SAAS,KAAK,UAAU,MAAM;KAC9B,UAAU,EAAE,UAAU,OAAO,IAAI;KAClC;;GAEJ;EAEgD"}
@@ -1 +0,0 @@
1
- import "./spec.js";
@@ -1,13 +0,0 @@
1
- import "../policy/spec.js";
2
- import "../telemetry/spec.js";
3
- import "../capabilities/index.js";
4
- import "../experiments/spec.js";
5
- import "../data-views/index.js";
6
- import "../features/index.js";
7
- import "../workflow/spec.js";
8
- import "../policy/registry.js";
9
- import "../themes.js";
10
- import "../integrations/spec.js";
11
- import "../integrations/connection.js";
12
- import "../knowledge/spec.js";
13
- import "./spec.js";
@@ -1,9 +0,0 @@
1
- import "../policy/spec.js";
2
- import "../capabilities/index.js";
3
- import "../experiments/spec.js";
4
- import "../features/index.js";
5
- import "../themes.js";
6
- import "../integrations/spec.js";
7
- import "./lifecycle.js";
8
- import "../registry.js";
9
- import "../ownership.js";
@@ -1 +0,0 @@
1
- import "../ownership.js";
@@ -1 +0,0 @@
1
- import "./capabilities.js";
@@ -1,4 +0,0 @@
1
- import "../presentations/presentations.js";
2
- import "./context.js";
3
- import "../events.js";
4
- import "../operations/operation.js";
@@ -1,5 +0,0 @@
1
- import "./capabilities.js";
2
- import "./validation.js";
3
- import "./context.js";
4
- import "./guards.js";
5
- import "./openbanking.js";
@@ -1 +0,0 @@
1
- import "./index.js";
@@ -1,4 +0,0 @@
1
- import "./capabilities.js";
2
- import "../presentations/index.js";
3
- import "../events.js";
4
- import "../operations/registry.js";
@@ -1,3 +0,0 @@
1
- import "./types.js";
2
- import "./spec.js";
3
- import "./registry.js";
@@ -1,2 +0,0 @@
1
- import "./spec.js";
2
- import "../registry.js";
@@ -1 +0,0 @@
1
- import "../index.js";
@@ -1,3 +0,0 @@
1
- import "../experiments/spec.js";
2
- import "./types.js";
3
- import "../features/types.js";
@@ -1,2 +0,0 @@
1
- import "../features/index.js";
2
- import "../ownership.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1,2 +0,0 @@
1
- import "./docsGenerate.command.js";
2
- import "./docsPublish.command.js";
@@ -1,6 +0,0 @@
1
- import "../../../schema/src/index.js";
2
- import "../presentations/index.js";
3
- import "../data-views/index.js";
4
- import "../events.js";
5
- import "../operations/registry.js";
6
- import "../forms/index.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1,2 +0,0 @@
1
- import "./docsGenerated.event.js";
2
- import "./docsPublished.event.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1 +0,0 @@
1
- import "./docsSearch.form.js";
@@ -1,30 +0,0 @@
1
- import "./commands/index.js";
2
- import "./queries/index.js";
3
- import "./events/index.js";
4
- import "./presentations.js";
5
- import { DocId } from "./registry.js";
6
- import "./contracts.js";
7
- import "./forms/index.js";
8
- import "./accessibility_wcag_compliance_specs.docblock.js";
9
- import "./tech/lifecycle-stage-system.docblock.js";
10
- import "./tech/presentation-runtime.docblock.js";
11
- import "./tech/auth/better-auth-nextjs.docblock.js";
12
- import "./tech/schema/README.docblock.js";
13
- import "../workflow/overview.docblock.js";
14
- import "./tech/mcp-endpoints.docblock.js";
15
- import "./tech/vscode-extension.docblock.js";
16
- import "./tech/telemetry-ingest.docblock.js";
17
- import "./tech/contracts/README.docblock.js";
18
- import "./tech/contracts/openapi-export.docblock.js";
19
- import "./tech/contracts/openapi-import.docblock.js";
20
- import "../workspace-config/workspace-config.docblock.js";
21
- import "./tech/studio/workspaces.docblock.js";
22
- import "./tech/studio/sandbox-unlogged.docblock.js";
23
- import "./tech/studio/workspace-ops.docblock.js";
24
- import "./tech/studio/project-routing.docblock.js";
25
- import "./tech/studio/platform-admin-panel.docblock.js";
26
- import "./tech/studio/learning-events.docblock.js";
27
- import "./tech/studio/learning-journeys.docblock.js";
28
- import "./tech/studio/project-access-teams.docblock.js";
29
- import "./tech/studio/team-invitations.docblock.js";
30
- import "./tech/llm/llm-integration.docblock.js";
@@ -1,2 +0,0 @@
1
- import "../presentations/presentations.js";
2
- import "../ownership.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1 +0,0 @@
1
- import "../../../../schema/src/index.js";
@@ -1,2 +0,0 @@
1
- import "./docsIndex.query.js";
2
- import "./contractReference.query.js";
@@ -1,10 +0,0 @@
1
- import "../presentations/presentations.js";
2
- import "./presentations.js";
3
-
4
- //#region ../contracts/src/docs/registry.d.ts
5
- type DocId = string & {
6
- __docId: true;
7
- };
8
- //#endregion
9
- export { DocId };
10
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","names":[],"sources":["../../../../../contracts/src/docs/registry.ts"],"sourcesContent":[],"mappings":";;;;KASY,KAAA;EAAA,OAAA,EAAK,IAAA"}
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../index.js";
@@ -1 +0,0 @@
1
- import "../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../../index.js";
@@ -1 +0,0 @@
1
- import "../index.js";
@@ -1 +0,0 @@
1
- import "../index.js";
@@ -1,5 +0,0 @@
1
- import "../../schema/src/index.js";
2
- import "./capabilities/capabilities.js";
3
- import "./docs/registry.js";
4
- import "./registry.js";
5
- import "./ownership.js";
@@ -1,4 +0,0 @@
1
- import "../../../schema/src/index.js";
2
- import "../resources.js";
3
- import "../operations/index.js";
4
- import "../types.js";
@@ -1,4 +0,0 @@
1
- import "../policy/spec.js";
2
- import "../telemetry/spec.js";
3
- import "../registry.js";
4
- import "../ownership.js";
@@ -1,4 +0,0 @@
1
- import "./types.js";
2
- import "./registry.js";
3
- import "./install.js";
4
- import "./validation.js";
@@ -1,6 +0,0 @@
1
- import "../presentations/presentations.js";
2
- import "../presentations/index.js";
3
- import "../capabilities/index.js";
4
- import "./types.js";
5
- import "./registry.js";
6
- import "../operations/registry.js";
@@ -1,2 +0,0 @@
1
- import "../registry-utils.js";
2
- import "./types.js";
@@ -1,5 +0,0 @@
1
- import "../presentations/presentations.js";
2
- import "../capabilities/index.js";
3
- import "../experiments/spec.js";
4
- import "../operations/index.js";
5
- import "../ownership.js";
@@ -1,2 +0,0 @@
1
- import "../presentations/presentations.js";
2
- import "./types.js";
@@ -1,3 +0,0 @@
1
- import "../../../schema/src/index.js";
2
- import "../registry-utils.js";
3
- import "../ownership.js";
@@ -1 +0,0 @@
1
- import "./forms.js";
@@ -1,7 +0,0 @@
1
- import "../../schema/src/index.js";
2
- import "./resources.js";
3
- import "./operations/index.js";
4
- import "./types.js";
5
- import "./events.js";
6
- import "./operations/registry.js";
7
- import "zod";
@@ -1 +0,0 @@
1
- import "./spec.js";
@@ -1,83 +0,0 @@
1
- //#region ../contracts/src/integrations/providers/llm.d.ts
2
- type LLMRole = 'system' | 'user' | 'assistant' | 'tool';
3
- interface LLMTextPart {
4
- type: 'text';
5
- text: string;
6
- }
7
- interface LLMToolCallPart {
8
- type: 'tool-call';
9
- id: string;
10
- name: string;
11
- arguments: string;
12
- }
13
- interface LLMToolResultPart {
14
- type: 'tool-result';
15
- toolCallId: string;
16
- output: string;
17
- }
18
- type LLMContentPart = LLMTextPart | LLMToolCallPart | LLMToolResultPart;
19
- interface LLMMessage {
20
- role: LLMRole;
21
- content: LLMContentPart[];
22
- name?: string;
23
- toolCallId?: string;
24
- metadata?: Record<string, string>;
25
- }
26
- interface LLMToolDefinition {
27
- name: string;
28
- description?: string;
29
- inputSchema: unknown;
30
- }
31
- interface LLMTokenUsage {
32
- promptTokens: number;
33
- completionTokens: number;
34
- totalTokens: number;
35
- }
36
- interface LLMChatOptions {
37
- model?: string;
38
- temperature?: number;
39
- topP?: number;
40
- maxOutputTokens?: number;
41
- stopSequences?: string[];
42
- responseFormat?: 'text' | 'json';
43
- tools?: LLMToolDefinition[];
44
- userId?: string;
45
- metadata?: Record<string, string>;
46
- timeoutMs?: number;
47
- signal?: AbortSignal;
48
- }
49
- interface LLMResponse {
50
- message: LLMMessage;
51
- usage?: LLMTokenUsage;
52
- finishReason?: 'stop' | 'length' | 'tool_call' | 'content_filter';
53
- raw?: unknown;
54
- }
55
- type LLMStreamChunk = {
56
- type: 'message_delta';
57
- delta: LLMContentPart;
58
- index: number;
59
- } | {
60
- type: 'tool_call';
61
- call: LLMToolCallPart;
62
- index: number;
63
- } | {
64
- type: 'usage';
65
- usage: LLMTokenUsage;
66
- } | {
67
- type: 'error';
68
- error: Error;
69
- } | {
70
- type: 'end';
71
- response: LLMResponse;
72
- };
73
- interface TokenCountResult {
74
- promptTokens: number;
75
- }
76
- interface LLMProvider {
77
- chat(messages: LLMMessage[], options?: LLMChatOptions): Promise<LLMResponse>;
78
- stream(messages: LLMMessage[], options?: LLMChatOptions): AsyncIterable<LLMStreamChunk>;
79
- countTokens(messages: LLMMessage[]): Promise<TokenCountResult>;
80
- }
81
- //#endregion
82
- export { LLMProvider };
83
- //# sourceMappingURL=llm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"llm.d.ts","names":[],"sources":["../../../../../../contracts/src/integrations/providers/llm.ts"],"sourcesContent":[],"mappings":";KAAY,OAAA;AAAA,UAEK,WAAA,CAFE;EAEF,IAAA,EAAA,MAAA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IA,WAAA;iBACA,wBAAwB,iBAAiB,QAAQ;mBAEpD,wBACA,iBACT,cAAc;wBACK,eAAe,QAAQ"}
@@ -1,3 +0,0 @@
1
- import "../capabilities/index.js";
2
- import "../registry.js";
3
- import "../ownership.js";
@@ -1,9 +0,0 @@
1
- import "../policy/spec.js";
2
- import "../registry.js";
3
- import "../ownership.js";
4
-
5
- //#region ../contracts/src/knowledge/spec.d.ts
6
- type KnowledgeCategory = 'canonical' | 'operational' | 'external' | 'ephemeral';
7
- //#endregion
8
- export { KnowledgeCategory };
9
- //# sourceMappingURL=spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/knowledge/spec.ts"],"sourcesContent":[],"mappings":";;;;;KAIY,iBAAA"}
@@ -1,3 +0,0 @@
1
- import "./report/index.js";
2
- import "./operation.js";
3
- import "./registry.js";
@@ -1,7 +0,0 @@
1
- import "../../../schema/src/index.js";
2
- import "../capabilities/capabilities.js";
3
- import "../policy/spec.js";
4
- import "../resources.js";
5
- import "../events.js";
6
- import "../tests/spec.js";
7
- import "../ownership.js";
@@ -1,6 +0,0 @@
1
- import "../../../schema/src/index.js";
2
- import "../resources.js";
3
- import "../install.js";
4
- import "../types.js";
5
- import "../registry.js";
6
- import "./operation.js";
@@ -1,3 +0,0 @@
1
- import "../../../../schema/src/index.js";
2
- import "../index.js";
3
- import "zod";
@@ -1,4 +0,0 @@
1
- import "./getContractVerificationStatus.js";
2
- import "../../install.js";
3
- import "../../data-views/report/contractVerificationTable.js";
4
- import "../registry.js";