@lssm/lib.support-bot 0.0.0-canary-20251217062139 → 0.0.0-canary-20251217060834
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/bot/tools.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/spec.js +1 -1
- package/package.json +5 -5
- package/dist/ai-agent/dist/agent/agent-factory.js +0 -1
- package/dist/ai-agent/dist/agent/contract-spec-agent.js +0 -1
- package/dist/ai-agent/dist/agent/index.js +0 -1
- package/dist/ai-agent/dist/approval/index.js +0 -1
- package/dist/ai-agent/dist/approval/workflow.js +0 -1
- package/dist/ai-agent/dist/index.js +0 -1
- package/dist/ai-agent/dist/schema/index.js +0 -1
- package/dist/ai-agent/dist/schema/json-schema-to-zod.js +0 -1
- package/dist/ai-agent/dist/schema/schema-output.js +0 -1
- package/dist/ai-agent/dist/spec/spec.js +0 -1
- package/dist/ai-agent/dist/tools/index.js +0 -1
- package/dist/ai-agent/dist/tools/knowledge-tool.js +0 -1
- package/dist/ai-agent/dist/tools/mcp-client.js +0 -1
- package/dist/ai-agent/dist/tools/mcp-server.js +0 -1
- package/dist/ai-agent/dist/tools/tool-adapter.js +0 -1
package/dist/bot/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{_enum as e,array as t,boolean as n,number as r,object as i,record as a,string as o}from"../node_modules/zod/v4/classic/schemas.js";const s=i({id:o(),subject:o(),body:o(),channel:e([`email`,`chat`,`phone`,`portal`]),customerName:o().optional(),customerEmail:o().optional(),metadata:i().optional()}),c=i({label:o(),url:o().optional(),snippet:o().optional(),score:r().optional()}),l=i({type:e([`respond`,`escalate`,`refund`,`manual`]),label:o(),payload:a(o(),o())}),u=i({ticketId:o(),answer:o(),confidence:r(),citations:c.array(),actions:l.array(),escalationReason:o().optional(),knowledgeUpdates:t(o()).optional()}),d=i({ticketId:o(),category:e([`billing`,`technical`,`product`,`account`,`compliance`,`other`]),priority:e([`urgent`,`high`,`medium`,`low`]),sentiment:e([`positive`,`neutral`,`negative`,`frustrated`]),intents:t(o()),tags:t(o()),confidence:r(),escalationRequired:n().optional()});function f(e){if(!e||typeof e!=`object`||!(`ticket`in e))throw Error(`Input must include ticket`);let t=e.ticket;if(!t?.id)throw Error(`Ticket is missing id`);return t}function p(e){if(!(!e||typeof e!=`object`||!(`resolution`in e)))return e.resolution}function m(e){if(!(!e||typeof e!=`object`||!(`classification`in e)))return e.classification}function h(e){return[{title:`support_classify_ticket`,description:`Classify a ticket for priority, sentiment, and category`,inputSchema:i({ticket:s}),execute:async t=>{let n=f(t),r=await e.classifier.classify(n);return{content:JSON.stringify(r),metadata:{ticketId:n.id}}}},{title:`support_resolve_ticket`,description:`Generate a knowledge-grounded resolution for a ticket`,inputSchema:i({ticket:s}),execute:async t=>{let n=f(t),r=await e.resolver.resolve(n);return{content:JSON.stringify(r),metadata:{ticketId:n.id}}}},{title:`support_draft_response`,description:`Draft a user-facing reply based on resolution + classification`,inputSchema:i({ticket:s,resolution:u,classification:d}),execute:async t=>{let n=f(t),r=p(t),i=m(t);if(!r||!i)throw Error(`resolution and classification are required`);let a=await e.responder.draft(n,r,i);return{content:JSON.stringify(a),metadata:{ticketId:n.id}}}}]}export{h as createSupportTools};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,8 @@ import { FeedbackMetrics, SupportFeedbackLoop } from "./bot/feedback-loop.js";
|
|
|
4
4
|
import { KnowledgeRetriever, TicketResolver, TicketResolverOptions } from "./rag/ticket-resolver.js";
|
|
5
5
|
import { TicketClassifier, TicketClassifierOptions } from "./tickets/classifier.js";
|
|
6
6
|
import { SupportToolsetOptions, createSupportTools } from "./bot/tools.js";
|
|
7
|
+
import "./bot/index.js";
|
|
7
8
|
import { SupportBotDefinition, defineSupportBot } from "./spec.js";
|
|
9
|
+
import "./rag/index.js";
|
|
10
|
+
import "./tickets/index.js";
|
|
8
11
|
export { AutoResponder, AutoResponderOptions, ClassificationResultPayload, FeedbackMetrics, KnowledgeRetriever, ResolutionResultPayload, SupportAction, SupportBotDefinition, SupportBotSpec, SupportCitation, SupportFeedbackLoop, SupportResolution, SupportResponseDraft, SupportTicket, SupportToolsetOptions, TicketCategory, TicketChannel, TicketClassification, TicketClassifier, TicketClassifierOptions, TicketPriority, TicketResolver, TicketResolverOptions, TicketSentiment, createSupportTools, defineSupportBot };
|
package/dist/spec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"
|
|
1
|
+
import{defineAgent as e}from"@lssm/lib.ai-agent";function t(t){return{...e({...t.base,policy:{...t.base.policy,confidence:{min:t.base.policy?.confidence?.min??.7,default:t.base.policy?.confidence?.default??.6},escalation:{confidenceThreshold:t.autoEscalateThreshold??t.base.policy?.escalation?.confidenceThreshold??t.base.policy?.confidence?.min??.7,...t.base.policy?.escalation}},memory:t.base.memory??{maxEntries:120,ttlMinutes:120},tools:t.tools??t.base.tools,instructions:`${t.base.instructions}\n\nAlways cite support knowledge sources and flag compliance/billing issues for human review when unsure.`}),thresholds:{autoResolveMinConfidence:t.autoEscalateThreshold??.75,maxIterations:6}}}export{t as defineSupportBot};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.support-bot",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217060834",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"test": "bun run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@lssm/lib.ai-agent": "0.0.0-canary-
|
|
27
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
26
|
+
"@lssm/lib.ai-agent": "0.0.0-canary-20251217060834",
|
|
27
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217060834"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
31
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
30
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217060834",
|
|
31
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217060834",
|
|
32
32
|
"tsdown": "^0.17.4",
|
|
33
33
|
"typescript": "^5.9.3"
|
|
34
34
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./contract-spec-agent.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../tools/tool-adapter.js";import"../tools/knowledge-tool.js";import*as e from"zod";import"ai";e.object({tenantId:e.string().optional(),actorId:e.string().optional(),sessionId:e.string().optional(),metadata:e.record(e.string(),e.unknown()).optional()});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./contract-spec-agent.js";import"./agent-factory.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./workflow.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"node:crypto";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e}from"./spec/spec.js";import"./schema/json-schema-to-zod.js";import"./tools/tool-adapter.js";import"./tools/knowledge-tool.js";import"./agent/contract-spec-agent.js";import"./agent/agent-factory.js";import"./agent/index.js";import"./tools/mcp-client.js";import"./tools/mcp-server.js";import"./tools/index.js";import"./schema/schema-output.js";import"./schema/index.js";import"./approval/workflow.js";import"./approval/index.js";import"ai";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./json-schema-to-zod.js";import"./schema-output.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"zod";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./json-schema-to-zod.js";import"zod";import"ai";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){if(!e.meta?.name)throw Error(`Agent name is required`);if(!Number.isFinite(e.meta.version))throw Error(`Agent ${e.meta.name} is missing a numeric version`);if(!e.instructions?.trim())throw Error(`Agent ${e.meta.name} requires instructions`);if(!e.tools?.length)throw Error(`Agent ${e.meta.name} must expose at least one tool`);let t=new Set;for(let n of e.tools){if(t.has(n.name))throw Error(`Agent ${e.meta.name} has duplicate tool name: ${n.name}`);t.add(n.name)}return Object.freeze(e)}export{e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./tool-adapter.js";import"./knowledge-tool.js";import"./mcp-client.js";import"./mcp-server.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"zod";import"ai";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"@ai-sdk/mcp";import"@ai-sdk/mcp/mcp-stdio";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../schema/json-schema-to-zod.js";import"zod";import"@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../schema/json-schema-to-zod.js";import"ai";
|