@contractspec/example.ai-support-bot 3.7.20 → 3.7.21

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.
@@ -1,34 +1,35 @@
1
- $ contractspec-bun-build prebuild
2
- $ bun run build:bundle && bun run build:types
3
- $ contractspec-bun-build transpile
4
- [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
5
- Bundled 6 modules in 14ms
6
-
7
- ./ai-support-bot.feature.js 0.52 KB (entry point)
8
- ./index.js 3.33 KB (entry point)
9
- docs/index.js 1.17 KB (entry point)
10
- docs/ai-support-bot.docblock.js 1.17 KB (entry point)
11
- ./example.js 0.72 KB (entry point)
12
- ./setup.js 0.95 KB (entry point)
13
-
14
- [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
15
- Bundled 6 modules in 18ms
16
-
17
- ./ai-support-bot.feature.js 0.52 KB (entry point)
18
- ./index.js 3.31 KB (entry point)
19
- docs/index.js 1.16 KB (entry point)
20
- docs/ai-support-bot.docblock.js 1.16 KB (entry point)
21
- ./example.js 0.71 KB (entry point)
22
- ./setup.js 0.94 KB (entry point)
23
-
24
- [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
25
- Bundled 6 modules in 46ms
26
-
27
- ./ai-support-bot.feature.js 0.52 KB (entry point)
28
- ./index.js 3.31 KB (entry point)
29
- docs/index.js 1.16 KB (entry point)
30
- docs/ai-support-bot.docblock.js 1.16 KB (entry point)
31
- ./example.js 0.71 KB (entry point)
32
- ./setup.js 0.94 KB (entry point)
33
-
34
- $ contractspec-bun-build types
1
+
2
+ $ contractspec-bun-build prebuild
3
+ $ bun run build:bundle && bun run build:types
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
6
+ Bundled 6 modules in 22ms
7
+
8
+ ./ai-support-bot.feature.js 0.53 KB (entry point)
9
+ ./index.js 3.29 KB (entry point)
10
+ docs/index.js 1.17 KB (entry point)
11
+ docs/ai-support-bot.docblock.js 1.17 KB (entry point)
12
+ ./example.js 0.67 KB (entry point)
13
+ ./setup.js 0.95 KB (entry point)
14
+
15
+ [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
16
+ Bundled 6 modules in 29ms
17
+
18
+ ./ai-support-bot.feature.js 0.53 KB (entry point)
19
+ ./index.js 3.27 KB (entry point)
20
+ docs/index.js 1.16 KB (entry point)
21
+ docs/ai-support-bot.docblock.js 1.16 KB (entry point)
22
+ ./example.js 0.67 KB (entry point)
23
+ ./setup.js 0.94 KB (entry point)
24
+
25
+ [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
26
+ Bundled 6 modules in 25ms
27
+
28
+ ./ai-support-bot.feature.js 0.53 KB (entry point)
29
+ ./index.js 3.27 KB (entry point)
30
+ docs/index.js 1.16 KB (entry point)
31
+ docs/ai-support-bot.docblock.js 1.16 KB (entry point)
32
+ ./example.js 0.67 KB (entry point)
33
+ ./setup.js 0.94 KB (entry point)
34
+
35
+ $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @contractspec/example.ai-support-bot
2
2
 
3
+ ## 3.7.21
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: auto-bump internal dependents
8
+ - Updated dependencies because of chore: auto-bump internal dependents
9
+ - Updated dependencies because of Add FormSpec layout hints, semantic field rendering, and portable text/textarea input-group addons.
10
+ - Updated dependencies because of Add ThemeSpec light/dark modes and a design-system Tailwind bridge for CSS variables, presets, CSS text, and OKLCH color pass-through.
11
+ - Updated dependencies because of Add a canonical typed result system for ContractSpec success and failure propagation across operations, workflows, jobs, server adapters, MCP, GraphQL, and React clients.
12
+ - @contractspec/lib.knowledge@3.7.21
13
+ - @contractspec/lib.logger@3.7.14
14
+ - @contractspec/lib.support-bot@4.0.1
15
+ - @contractspec/lib.contracts-spec@5.5.0
16
+
3
17
  ## 3.7.20
4
18
 
5
19
  ### Patch Changes
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});export{j as AiSupportBotFeature};
2
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});export{j as AiSupportBotFeature};
@@ -1 +1 @@
1
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});export{j as AiSupportBotFeature};
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});export{j as AiSupportBotFeature};
@@ -1 +1 @@
1
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["support","ai","tickets","knowledge"]},docs:{rootDocId:"docs.examples.ai-support-bot",usageDocId:"docs.examples.ai-support-bot.usage"},entrypoints:{packageName:"@contractspec/example.ai-support-bot",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
1
+ import{defineExample as g}from"@contractspec/lib.contracts-spec/examples";var h=g({meta:{key:"examples.ai-support-bot",version:"1.0.0",title:"Ai Support Bot",description:"AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","ai-support-bot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.ai-support-bot"}}),q=h;export{q as default,h as ExamplesAiSupportBotExample};
@@ -1,4 +1,4 @@
1
- import{defineFeature as H}from"@contractspec/lib.contracts-spec";var Y=H({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});import{registerDocBlocks as I}from"@contractspec/lib.contracts-spec/docs";var J=[{id:"docs.examples.ai-support-bot",title:"AI Support Bot (example)",summary:"Ticket classification + knowledge-grounded resolution + response drafting.",kind:"reference",visibility:"public",route:"/docs/examples/ai-support-bot",tags:["support","ai","example"],body:`## What this example shows
1
+ import{defineFeature as I}from"@contractspec/lib.contracts-spec/features";var _=I({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});import{registerDocBlocks as J}from"@contractspec/lib.contracts-spec/docs";var K=[{id:"docs.examples.ai-support-bot",title:"AI Support Bot (example)",summary:"Ticket classification + knowledge-grounded resolution + response drafting.",kind:"reference",visibility:"public",route:"/docs/examples/ai-support-bot",tags:["support","ai","example"],body:`## What this example shows
2
2
  - Classify a ticket into a support category.
3
3
  - Use a knowledge port to generate a grounded resolution.
4
4
  - Draft a response (email body) from the resolution.
@@ -11,4 +11,4 @@ import{defineFeature as H}from"@contractspec/lib.contracts-spec";var Y=H({meta:{
11
11
 
12
12
  ## Notes
13
13
  - Keep outputs structured.
14
- - Use policy gates before exposing drafted replies to end-users.`}];I(J);import{defineExample as K}from"@contractspec/lib.contracts-spec";var M=K({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["support","ai","tickets","knowledge"]},docs:{rootDocId:"docs.examples.ai-support-bot",usageDocId:"docs.examples.ai-support-bot.usage"},entrypoints:{packageName:"@contractspec/example.ai-support-bot",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),N=M;import{Logger as O,LogLevel as P}from"@contractspec/lib.logger";import{AutoResponder as Q}from"@contractspec/lib.support-bot/bot";import{TicketResolver as S}from"@contractspec/lib.support-bot/rag";import{TicketClassifier as U}from"@contractspec/lib.support-bot/tickets";var V=new O({level:P.INFO,environment:"production",enableColors:!1});async function q(){let w=new S({knowledge:{async query(G){return{answer:`The payout will retrigger automatically. (${G.slice(0,40)}…)`,references:[]}}}}),y=new U,z=new Q,m={id:"TIC-42",subject:"Payout failed",body:"Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",channel:"email",customerName:"Ivy",metadata:{accountId:"acct_789"}},x=await y.classify(m),h=await w.resolve(m),j=await z.draft(m,h,x);V.info("Support bot run completed",{ticketId:m.id,classification:x,resolution:h,emailDraft:{subject:j.subject,body:j.body}})}export{q as runAiSupportBotExample,N as example,Y as AiSupportBotFeature};
14
+ - Use policy gates before exposing drafted replies to end-users.`}];J(K);import{defineExample as M}from"@contractspec/lib.contracts-spec/examples";var N=M({meta:{key:"examples.ai-support-bot",version:"1.0.0",title:"Ai Support Bot",description:"AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","ai-support-bot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.ai-support-bot"}}),O=N;import{Logger as P,LogLevel as Q}from"@contractspec/lib.logger";import{AutoResponder as U}from"@contractspec/lib.support-bot/bot";import{TicketResolver as V}from"@contractspec/lib.support-bot/rag";import{TicketClassifier as W}from"@contractspec/lib.support-bot/tickets";var X=new P({level:Q.INFO,environment:"production",enableColors:!1});async function v(){let y=new V({knowledge:{async query(H){return{answer:`The payout will retrigger automatically. (${H.slice(0,40)}…)`,references:[]}}}}),z=new W,G=new U,m={id:"TIC-42",subject:"Payout failed",body:"Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",channel:"email",customerName:"Ivy",metadata:{accountId:"acct_789"}},h=await z.classify(m),j=await y.resolve(m),w=await G.draft(m,j,h);X.info("Support bot run completed",{ticketId:m.id,classification:h,resolution:j,emailDraft:{subject:w.subject,body:w.body}})}export{v as runAiSupportBotExample,O as example,N as ExamplesAiSupportBotExample,_ as AiSupportBotFeature};
package/dist/example.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- declare const example: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
- export default example;
1
+ declare const ExamplesAiSupportBotExample: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
+ export default ExamplesAiSupportBotExample;
3
+ export { ExamplesAiSupportBotExample };
package/dist/example.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["support","ai","tickets","knowledge"]},docs:{rootDocId:"docs.examples.ai-support-bot",usageDocId:"docs.examples.ai-support-bot.usage"},entrypoints:{packageName:"@contractspec/example.ai-support-bot",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
2
+ import{defineExample as g}from"@contractspec/lib.contracts-spec/examples";var h=g({meta:{key:"examples.ai-support-bot",version:"1.0.0",title:"Ai Support Bot",description:"AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","ai-support-bot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.ai-support-bot"}}),q=h;export{q as default,h as ExamplesAiSupportBotExample};
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './ai-support-bot.feature';
2
2
  export { default as example } from './example';
3
3
  export * from './setup';
4
4
  import './docs';
5
+ export * from './example';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{defineFeature as H}from"@contractspec/lib.contracts-spec";var Y=H({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});import{registerDocBlocks as I}from"@contractspec/lib.contracts-spec/docs";var J=[{id:"docs.examples.ai-support-bot",title:"AI Support Bot (example)",summary:"Ticket classification + knowledge-grounded resolution + response drafting.",kind:"reference",visibility:"public",route:"/docs/examples/ai-support-bot",tags:["support","ai","example"],body:`## What this example shows
2
+ import{defineFeature as I}from"@contractspec/lib.contracts-spec/features";var _=I({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});import{registerDocBlocks as J}from"@contractspec/lib.contracts-spec/docs";var K=[{id:"docs.examples.ai-support-bot",title:"AI Support Bot (example)",summary:"Ticket classification + knowledge-grounded resolution + response drafting.",kind:"reference",visibility:"public",route:"/docs/examples/ai-support-bot",tags:["support","ai","example"],body:`## What this example shows
3
3
  - Classify a ticket into a support category.
4
4
  - Use a knowledge port to generate a grounded resolution.
5
5
  - Draft a response (email body) from the resolution.
@@ -12,4 +12,4 @@ import{defineFeature as H}from"@contractspec/lib.contracts-spec";var Y=H({meta:{
12
12
 
13
13
  ## Notes
14
14
  - Keep outputs structured.
15
- - Use policy gates before exposing drafted replies to end-users.`}];I(J);import{defineExample as K}from"@contractspec/lib.contracts-spec";var M=K({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["support","ai","tickets","knowledge"]},docs:{rootDocId:"docs.examples.ai-support-bot",usageDocId:"docs.examples.ai-support-bot.usage"},entrypoints:{packageName:"@contractspec/example.ai-support-bot",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),N=M;import{Logger as O,LogLevel as P}from"@contractspec/lib.logger";import{AutoResponder as Q}from"@contractspec/lib.support-bot/bot";import{TicketResolver as S}from"@contractspec/lib.support-bot/rag";import{TicketClassifier as U}from"@contractspec/lib.support-bot/tickets";var V=new O({level:P.INFO,environment:"production",enableColors:!1});async function q(){let w=new S({knowledge:{async query(G){return{answer:`The payout will retrigger automatically. (${G.slice(0,40)}\u2026)`,references:[]}}}}),y=new U,z=new Q,m={id:"TIC-42",subject:"Payout failed",body:"Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",channel:"email",customerName:"Ivy",metadata:{accountId:"acct_789"}},x=await y.classify(m),h=await w.resolve(m),j=await z.draft(m,h,x);V.info("Support bot run completed",{ticketId:m.id,classification:x,resolution:h,emailDraft:{subject:j.subject,body:j.body}})}export{q as runAiSupportBotExample,N as example,Y as AiSupportBotFeature};
15
+ - Use policy gates before exposing drafted replies to end-users.`}];J(K);import{defineExample as M}from"@contractspec/lib.contracts-spec/examples";var N=M({meta:{key:"examples.ai-support-bot",version:"1.0.0",title:"Ai Support Bot",description:"AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","ai-support-bot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.ai-support-bot"}}),O=N;import{Logger as P,LogLevel as Q}from"@contractspec/lib.logger";import{AutoResponder as U}from"@contractspec/lib.support-bot/bot";import{TicketResolver as V}from"@contractspec/lib.support-bot/rag";import{TicketClassifier as W}from"@contractspec/lib.support-bot/tickets";var X=new P({level:Q.INFO,environment:"production",enableColors:!1});async function v(){let y=new V({knowledge:{async query(H){return{answer:`The payout will retrigger automatically. (${H.slice(0,40)}\u2026)`,references:[]}}}}),z=new W,G=new U,m={id:"TIC-42",subject:"Payout failed",body:"Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",channel:"email",customerName:"Ivy",metadata:{accountId:"acct_789"}},h=await z.classify(m),j=await y.resolve(m),w=await G.draft(m,j,h);X.info("Support bot run completed",{ticketId:m.id,classification:h,resolution:j,emailDraft:{subject:w.subject,body:w.body}})}export{v as runAiSupportBotExample,O as example,N as ExamplesAiSupportBotExample,_ as AiSupportBotFeature};
@@ -1 +1 @@
1
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});export{j as AiSupportBotFeature};
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});export{j as AiSupportBotFeature};
@@ -1 +1 @@
1
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["support","ai","tickets","knowledge"]},docs:{rootDocId:"docs.examples.ai-support-bot",usageDocId:"docs.examples.ai-support-bot.usage"},entrypoints:{packageName:"@contractspec/example.ai-support-bot",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
1
+ import{defineExample as g}from"@contractspec/lib.contracts-spec/examples";var h=g({meta:{key:"examples.ai-support-bot",version:"1.0.0",title:"Ai Support Bot",description:"AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","ai-support-bot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.ai-support-bot"}}),q=h;export{q as default,h as ExamplesAiSupportBotExample};
@@ -1,4 +1,4 @@
1
- import{defineFeature as H}from"@contractspec/lib.contracts-spec";var Y=H({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});import{registerDocBlocks as I}from"@contractspec/lib.contracts-spec/docs";var J=[{id:"docs.examples.ai-support-bot",title:"AI Support Bot (example)",summary:"Ticket classification + knowledge-grounded resolution + response drafting.",kind:"reference",visibility:"public",route:"/docs/examples/ai-support-bot",tags:["support","ai","example"],body:`## What this example shows
1
+ import{defineFeature as I}from"@contractspec/lib.contracts-spec/features";var _=I({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"AI support ticket classification and resolution using grounded knowledge",domain:"support",owners:["@examples"],tags:["ai","support","knowledge","tickets"],stability:"experimental"},knowledge:[{key:"ai-support-bot.knowledge.articles",version:"1.0.0"}],docs:["docs.examples.ai-support-bot","docs.examples.ai-support-bot.usage"]});import{registerDocBlocks as J}from"@contractspec/lib.contracts-spec/docs";var K=[{id:"docs.examples.ai-support-bot",title:"AI Support Bot (example)",summary:"Ticket classification + knowledge-grounded resolution + response drafting.",kind:"reference",visibility:"public",route:"/docs/examples/ai-support-bot",tags:["support","ai","example"],body:`## What this example shows
2
2
  - Classify a ticket into a support category.
3
3
  - Use a knowledge port to generate a grounded resolution.
4
4
  - Draft a response (email body) from the resolution.
@@ -11,4 +11,4 @@ import{defineFeature as H}from"@contractspec/lib.contracts-spec";var Y=H({meta:{
11
11
 
12
12
  ## Notes
13
13
  - Keep outputs structured.
14
- - Use policy gates before exposing drafted replies to end-users.`}];I(J);import{defineExample as K}from"@contractspec/lib.contracts-spec";var M=K({meta:{key:"ai-support-bot",version:"1.0.0",title:"AI Support Bot",description:"Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["support","ai","tickets","knowledge"]},docs:{rootDocId:"docs.examples.ai-support-bot",usageDocId:"docs.examples.ai-support-bot.usage"},entrypoints:{packageName:"@contractspec/example.ai-support-bot",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),N=M;import{Logger as O,LogLevel as P}from"@contractspec/lib.logger";import{AutoResponder as Q}from"@contractspec/lib.support-bot/bot";import{TicketResolver as S}from"@contractspec/lib.support-bot/rag";import{TicketClassifier as U}from"@contractspec/lib.support-bot/tickets";var V=new O({level:P.INFO,environment:"production",enableColors:!1});async function q(){let w=new S({knowledge:{async query(G){return{answer:`The payout will retrigger automatically. (${G.slice(0,40)}…)`,references:[]}}}}),y=new U,z=new Q,m={id:"TIC-42",subject:"Payout failed",body:"Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",channel:"email",customerName:"Ivy",metadata:{accountId:"acct_789"}},x=await y.classify(m),h=await w.resolve(m),j=await z.draft(m,h,x);V.info("Support bot run completed",{ticketId:m.id,classification:x,resolution:h,emailDraft:{subject:j.subject,body:j.body}})}export{q as runAiSupportBotExample,N as example,Y as AiSupportBotFeature};
14
+ - Use policy gates before exposing drafted replies to end-users.`}];J(K);import{defineExample as M}from"@contractspec/lib.contracts-spec/examples";var N=M({meta:{key:"examples.ai-support-bot",version:"1.0.0",title:"Ai Support Bot",description:"AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","ai-support-bot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.ai-support-bot"}}),O=N;import{Logger as P,LogLevel as Q}from"@contractspec/lib.logger";import{AutoResponder as U}from"@contractspec/lib.support-bot/bot";import{TicketResolver as V}from"@contractspec/lib.support-bot/rag";import{TicketClassifier as W}from"@contractspec/lib.support-bot/tickets";var X=new P({level:Q.INFO,environment:"production",enableColors:!1});async function v(){let y=new V({knowledge:{async query(H){return{answer:`The payout will retrigger automatically. (${H.slice(0,40)}…)`,references:[]}}}}),z=new W,G=new U,m={id:"TIC-42",subject:"Payout failed",body:"Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",channel:"email",customerName:"Ivy",metadata:{accountId:"acct_789"}},h=await z.classify(m),j=await y.resolve(m),w=await G.draft(m,j,h);X.info("Support bot run completed",{ticketId:m.id,classification:h,resolution:j,emailDraft:{subject:w.subject,body:w.body}})}export{v as runAiSupportBotExample,O as example,N as ExamplesAiSupportBotExample,_ as AiSupportBotFeature};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.ai-support-bot",
3
- "version": "3.7.20",
3
+ "version": "3.7.21",
4
4
  "description": "AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -64,15 +64,15 @@
64
64
  "typecheck": "tsc --noEmit"
65
65
  },
66
66
  "dependencies": {
67
- "@contractspec/lib.support-bot": "4.0.0",
68
- "@contractspec/lib.knowledge": "3.7.20",
69
- "@contractspec/lib.contracts-spec": "5.4.0",
70
- "@contractspec/lib.logger": "3.7.13"
67
+ "@contractspec/lib.support-bot": "4.0.1",
68
+ "@contractspec/lib.knowledge": "3.7.21",
69
+ "@contractspec/lib.contracts-spec": "5.5.0",
70
+ "@contractspec/lib.logger": "3.7.14"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@contractspec/tool.typescript": "3.7.13",
74
74
  "typescript": "^5.9.3",
75
- "@contractspec/tool.bun": "3.7.14"
75
+ "@contractspec/tool.bun": "3.7.15"
76
76
  },
77
77
  "publishConfig": {
78
78
  "access": "public",
@@ -1,4 +1,4 @@
1
- import { defineFeature } from '@contractspec/lib.contracts-spec';
1
+ import { defineFeature } from '@contractspec/lib.contracts-spec/features';
2
2
 
3
3
  export const AiSupportBotFeature = defineFeature({
4
4
  meta: {
package/src/example.ts CHANGED
@@ -1,32 +1,28 @@
1
- import { defineExample } from '@contractspec/lib.contracts-spec';
1
+ import { defineExample } from '@contractspec/lib.contracts-spec/examples';
2
2
 
3
- const example = defineExample({
3
+ const ExamplesAiSupportBotExample = defineExample({
4
4
  meta: {
5
- key: 'ai-support-bot',
5
+ key: 'examples.ai-support-bot',
6
6
  version: '1.0.0',
7
- title: 'AI Support Bot',
7
+ title: 'Ai Support Bot',
8
8
  description:
9
- 'Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.',
10
- kind: 'script',
11
- visibility: 'public',
9
+ 'AI support bot example: classify and resolve a support ticket using @contractspec/lib.support-bot.',
10
+ kind: 'template',
11
+ visibility: 'experimental',
12
12
  stability: 'experimental',
13
- owners: ['@platform.core'],
14
- tags: ['support', 'ai', 'tickets', 'knowledge'],
13
+ owners: ['@contractspec-core'],
14
+ tags: ['package', 'examples', 'ai-support-bot'],
15
15
  },
16
- docs: {
17
- rootDocId: 'docs.examples.ai-support-bot',
18
- usageDocId: 'docs.examples.ai-support-bot.usage',
16
+ surfaces: {
17
+ templates: true,
18
+ sandbox: { enabled: true, modes: ['playground', 'specs'] },
19
+ studio: { enabled: false, installable: false },
20
+ mcp: { enabled: false },
19
21
  },
20
22
  entrypoints: {
21
23
  packageName: '@contractspec/example.ai-support-bot',
22
- docs: './docs',
23
- },
24
- surfaces: {
25
- templates: true,
26
- sandbox: { enabled: true, modes: ['markdown'] },
27
- studio: { enabled: true, installable: true },
28
- mcp: { enabled: true },
29
24
  },
30
25
  });
31
26
 
32
- export default example;
27
+ export default ExamplesAiSupportBotExample;
28
+ export { ExamplesAiSupportBotExample };
package/src/index.ts CHANGED
@@ -2,3 +2,5 @@ export * from './ai-support-bot.feature';
2
2
  export { default as example } from './example';
3
3
  export * from './setup';
4
4
  import './docs';
5
+
6
+ export * from './example';