@contractspec/example.ai-support-bot 1.57.0 → 1.59.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.
- package/.turbo/turbo-build.log +31 -30
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +29 -0
- package/dist/browser/docs/ai-support-bot.docblock.js +38 -0
- package/dist/browser/docs/index.js +38 -0
- package/dist/browser/example.js +33 -0
- package/dist/browser/index.js +113 -0
- package/dist/browser/setup.js +43 -0
- package/dist/docs/ai-support-bot.docblock.d.ts +2 -1
- package/dist/docs/ai-support-bot.docblock.d.ts.map +1 -0
- package/dist/docs/ai-support-bot.docblock.js +36 -26
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +39 -1
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +32 -43
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +113 -4
- package/dist/node/docs/ai-support-bot.docblock.js +38 -0
- package/dist/node/docs/index.js +38 -0
- package/dist/node/example.js +33 -0
- package/dist/node/index.js +113 -0
- package/dist/node/setup.js +43 -0
- package/dist/setup.d.ts +1 -4
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +38 -39
- package/package.json +63 -26
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -30
- package/dist/docs/ai-support-bot.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/setup.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
$ bun
|
|
2
|
-
$
|
|
3
|
-
$
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[34mℹ[39m target: [34mesnext[39m
|
|
8
|
-
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
-
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1msetup.js[22m [2m1.53 kB[22m [2m│ gzip: 0.75 kB[22m
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mdocs/ai-support-bot.docblock.js[22m [2m1.35 kB[22m [2m│ gzip: 0.66 kB[22m
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m0.96 kB[22m [2m│ gzip: 0.51 kB[22m
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.16 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
15
|
-
[34mℹ[39m [2mdist/[22msetup.js.map [2m2.68 kB[22m [2m│ gzip: 1.18 kB[22m
|
|
16
|
-
[34mℹ[39m [2mdist/[22mdocs/ai-support-bot.docblock.js.map [2m1.84 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
17
|
-
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.43 kB[22m [2m│ gzip: 0.70 kB[22m
|
|
18
|
-
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.13 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
19
|
-
[34mℹ[39m [2mdist/[22msetup.d.ts.map [2m0.12 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
20
|
-
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.25 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
21
|
-
[34mℹ[39m [2mdist/[22m[32m[1msetup.d.ts[22m[39m [2m0.17 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
22
|
-
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.13 kB[22m [2m│ gzip: 0.09 kB[22m
|
|
23
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdocs/ai-support-bot.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
24
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
25
|
-
[34mℹ[39m 15 files, total: 10.80 kB
|
|
26
|
-
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
27
|
-
- tsdown:external (62%)
|
|
28
|
-
- rolldown-plugin-dts:generate (37%)
|
|
29
|
-
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
1
|
+
$ contractspec-bun-build prebuild
|
|
2
|
+
$ bun run prebuild && bun run build:bundle && bun run build:types
|
|
3
|
+
$ contractspec-bun-build prebuild
|
|
4
|
+
$ contractspec-bun-build transpile
|
|
5
|
+
[contractspec-bun-build] transpile target=bun root=src entries=5
|
|
6
|
+
Bundled 5 modules in 19ms
|
|
30
7
|
|
|
31
|
-
|
|
8
|
+
docs/ai-support-bot.docblock.js 1.35 KB (entry point)
|
|
9
|
+
./index.js 3.72 KB (entry point)
|
|
10
|
+
docs/index.js 1.35 KB (entry point)
|
|
11
|
+
./example.js 0.96 KB (entry point)
|
|
12
|
+
./setup.js 1.44 KB (entry point)
|
|
13
|
+
|
|
14
|
+
[contractspec-bun-build] transpile target=node root=src entries=5
|
|
15
|
+
Bundled 5 modules in 29ms
|
|
16
|
+
|
|
17
|
+
docs/ai-support-bot.docblock.js 1.34 KB (entry point)
|
|
18
|
+
./index.js 3.71 KB (entry point)
|
|
19
|
+
docs/index.js 1.34 KB (entry point)
|
|
20
|
+
./example.js 0.95 KB (entry point)
|
|
21
|
+
./setup.js 1.43 KB (entry point)
|
|
22
|
+
|
|
23
|
+
[contractspec-bun-build] transpile target=browser root=src entries=5
|
|
24
|
+
Bundled 5 modules in 37ms
|
|
25
|
+
|
|
26
|
+
docs/ai-support-bot.docblock.js 1.34 KB (entry point)
|
|
27
|
+
./index.js 3.71 KB (entry point)
|
|
28
|
+
docs/index.js 1.34 KB (entry point)
|
|
29
|
+
./example.js 0.95 KB (entry point)
|
|
30
|
+
./setup.js 1.43 KB (entry point)
|
|
31
|
+
|
|
32
|
+
$ contractspec-bun-build types
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ contractspec-bun-build prebuild
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @contractspec/example.ai-support-bot
|
|
2
2
|
|
|
3
|
+
## 1.59.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1a0cf44: fix: publishConfig not supported by bun
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1a0cf44]
|
|
12
|
+
- @contractspec/lib.support-bot@1.59.0
|
|
13
|
+
- @contractspec/lib.contracts@1.59.0
|
|
14
|
+
- @contractspec/lib.knowledge@1.59.0
|
|
15
|
+
- @contractspec/lib.logger@1.59.0
|
|
16
|
+
|
|
17
|
+
## 1.58.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- d1f0fd0: chore: Migrate non-app package builds from tsdown to shared Bun tooling, add `@contractspec/tool.bun`, and standardize `prebuild`/`build`/`typecheck` with platform-aware exports and `tsc` declaration emission into `dist`.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [d1f0fd0]
|
|
26
|
+
- Updated dependencies [4355a9e]
|
|
27
|
+
- @contractspec/lib.support-bot@1.58.0
|
|
28
|
+
- @contractspec/lib.contracts@1.58.0
|
|
29
|
+
- @contractspec/lib.knowledge@1.58.0
|
|
30
|
+
- @contractspec/lib.logger@1.58.0
|
|
31
|
+
|
|
3
32
|
## 1.57.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/docs/ai-support-bot.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
3
|
+
var blocks = [
|
|
4
|
+
{
|
|
5
|
+
id: "docs.examples.ai-support-bot",
|
|
6
|
+
title: "AI Support Bot (example)",
|
|
7
|
+
summary: "Ticket classification + knowledge-grounded resolution + response drafting.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/ai-support-bot",
|
|
11
|
+
tags: ["support", "ai", "example"],
|
|
12
|
+
body: `## What this example shows
|
|
13
|
+
- Classify a ticket into a support category.
|
|
14
|
+
- Use a knowledge port to generate a grounded resolution.
|
|
15
|
+
- Draft a response (email body) from the resolution.
|
|
16
|
+
|
|
17
|
+
## Guardrails
|
|
18
|
+
- Avoid logging raw ticket bodies/PII; prefer structured summaries.
|
|
19
|
+
- Keep knowledge and ticket adapters explicit and testable.`
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "docs.examples.ai-support-bot.usage",
|
|
23
|
+
title: "AI Support Bot — Usage",
|
|
24
|
+
summary: "How to run the example and swap the knowledge adapter.",
|
|
25
|
+
kind: "usage",
|
|
26
|
+
visibility: "public",
|
|
27
|
+
route: "/docs/examples/ai-support-bot/usage",
|
|
28
|
+
tags: ["support", "usage"],
|
|
29
|
+
body: `## Usage
|
|
30
|
+
- Call \`runAiSupportBotExample()\`.
|
|
31
|
+
- Replace the \`knowledge.query\` implementation with a real knowledge service.
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
- Keep outputs structured.
|
|
35
|
+
- Use policy gates before exposing drafted replies to end-users.`
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
registerDocBlocks(blocks);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/docs/ai-support-bot.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
3
|
+
var blocks = [
|
|
4
|
+
{
|
|
5
|
+
id: "docs.examples.ai-support-bot",
|
|
6
|
+
title: "AI Support Bot (example)",
|
|
7
|
+
summary: "Ticket classification + knowledge-grounded resolution + response drafting.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/ai-support-bot",
|
|
11
|
+
tags: ["support", "ai", "example"],
|
|
12
|
+
body: `## What this example shows
|
|
13
|
+
- Classify a ticket into a support category.
|
|
14
|
+
- Use a knowledge port to generate a grounded resolution.
|
|
15
|
+
- Draft a response (email body) from the resolution.
|
|
16
|
+
|
|
17
|
+
## Guardrails
|
|
18
|
+
- Avoid logging raw ticket bodies/PII; prefer structured summaries.
|
|
19
|
+
- Keep knowledge and ticket adapters explicit and testable.`
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "docs.examples.ai-support-bot.usage",
|
|
23
|
+
title: "AI Support Bot — Usage",
|
|
24
|
+
summary: "How to run the example and swap the knowledge adapter.",
|
|
25
|
+
kind: "usage",
|
|
26
|
+
visibility: "public",
|
|
27
|
+
route: "/docs/examples/ai-support-bot/usage",
|
|
28
|
+
tags: ["support", "usage"],
|
|
29
|
+
body: `## Usage
|
|
30
|
+
- Call \`runAiSupportBotExample()\`.
|
|
31
|
+
- Replace the \`knowledge.query\` implementation with a real knowledge service.
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
- Keep outputs structured.
|
|
35
|
+
- Use policy gates before exposing drafted replies to end-users.`
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
registerDocBlocks(blocks);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/example.ts
|
|
2
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
3
|
+
var example = defineExample({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "ai-support-bot",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "AI Support Bot",
|
|
8
|
+
description: "Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",
|
|
9
|
+
kind: "script",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
stability: "experimental",
|
|
12
|
+
owners: ["@platform.core"],
|
|
13
|
+
tags: ["support", "ai", "tickets", "knowledge"]
|
|
14
|
+
},
|
|
15
|
+
docs: {
|
|
16
|
+
rootDocId: "docs.examples.ai-support-bot",
|
|
17
|
+
usageDocId: "docs.examples.ai-support-bot.usage"
|
|
18
|
+
},
|
|
19
|
+
entrypoints: {
|
|
20
|
+
packageName: "@contractspec/example.ai-support-bot",
|
|
21
|
+
docs: "./docs"
|
|
22
|
+
},
|
|
23
|
+
surfaces: {
|
|
24
|
+
templates: true,
|
|
25
|
+
sandbox: { enabled: true, modes: ["markdown"] },
|
|
26
|
+
studio: { enabled: true, installable: true },
|
|
27
|
+
mcp: { enabled: true }
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var example_default = example;
|
|
31
|
+
export {
|
|
32
|
+
example_default as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// src/docs/ai-support-bot.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
3
|
+
var blocks = [
|
|
4
|
+
{
|
|
5
|
+
id: "docs.examples.ai-support-bot",
|
|
6
|
+
title: "AI Support Bot (example)",
|
|
7
|
+
summary: "Ticket classification + knowledge-grounded resolution + response drafting.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/ai-support-bot",
|
|
11
|
+
tags: ["support", "ai", "example"],
|
|
12
|
+
body: `## What this example shows
|
|
13
|
+
- Classify a ticket into a support category.
|
|
14
|
+
- Use a knowledge port to generate a grounded resolution.
|
|
15
|
+
- Draft a response (email body) from the resolution.
|
|
16
|
+
|
|
17
|
+
## Guardrails
|
|
18
|
+
- Avoid logging raw ticket bodies/PII; prefer structured summaries.
|
|
19
|
+
- Keep knowledge and ticket adapters explicit and testable.`
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "docs.examples.ai-support-bot.usage",
|
|
23
|
+
title: "AI Support Bot — Usage",
|
|
24
|
+
summary: "How to run the example and swap the knowledge adapter.",
|
|
25
|
+
kind: "usage",
|
|
26
|
+
visibility: "public",
|
|
27
|
+
route: "/docs/examples/ai-support-bot/usage",
|
|
28
|
+
tags: ["support", "usage"],
|
|
29
|
+
body: `## Usage
|
|
30
|
+
- Call \`runAiSupportBotExample()\`.
|
|
31
|
+
- Replace the \`knowledge.query\` implementation with a real knowledge service.
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
- Keep outputs structured.
|
|
35
|
+
- Use policy gates before exposing drafted replies to end-users.`
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
registerDocBlocks(blocks);
|
|
39
|
+
// src/example.ts
|
|
40
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
41
|
+
var example = defineExample({
|
|
42
|
+
meta: {
|
|
43
|
+
key: "ai-support-bot",
|
|
44
|
+
version: "1.0.0",
|
|
45
|
+
title: "AI Support Bot",
|
|
46
|
+
description: "Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",
|
|
47
|
+
kind: "script",
|
|
48
|
+
visibility: "public",
|
|
49
|
+
stability: "experimental",
|
|
50
|
+
owners: ["@platform.core"],
|
|
51
|
+
tags: ["support", "ai", "tickets", "knowledge"]
|
|
52
|
+
},
|
|
53
|
+
docs: {
|
|
54
|
+
rootDocId: "docs.examples.ai-support-bot",
|
|
55
|
+
usageDocId: "docs.examples.ai-support-bot.usage"
|
|
56
|
+
},
|
|
57
|
+
entrypoints: {
|
|
58
|
+
packageName: "@contractspec/example.ai-support-bot",
|
|
59
|
+
docs: "./docs"
|
|
60
|
+
},
|
|
61
|
+
surfaces: {
|
|
62
|
+
templates: true,
|
|
63
|
+
sandbox: { enabled: true, modes: ["markdown"] },
|
|
64
|
+
studio: { enabled: true, installable: true },
|
|
65
|
+
mcp: { enabled: true }
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var example_default = example;
|
|
69
|
+
|
|
70
|
+
// src/setup.ts
|
|
71
|
+
import { TicketResolver } from "@contractspec/lib.support-bot/rag";
|
|
72
|
+
import { TicketClassifier } from "@contractspec/lib.support-bot/tickets";
|
|
73
|
+
import { AutoResponder } from "@contractspec/lib.support-bot/bot";
|
|
74
|
+
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
75
|
+
var logger = new Logger({
|
|
76
|
+
level: LogLevel.DEBUG,
|
|
77
|
+
environment: "development",
|
|
78
|
+
enableColors: true
|
|
79
|
+
});
|
|
80
|
+
async function runAiSupportBotExample() {
|
|
81
|
+
const knowledge = {
|
|
82
|
+
async query(question) {
|
|
83
|
+
return {
|
|
84
|
+
answer: `The payout will retrigger automatically. (${question.slice(0, 40)}…)`,
|
|
85
|
+
references: []
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const resolver = new TicketResolver({ knowledge });
|
|
90
|
+
const classifier = new TicketClassifier;
|
|
91
|
+
const responder = new AutoResponder;
|
|
92
|
+
const ticket = {
|
|
93
|
+
id: "TIC-42",
|
|
94
|
+
subject: "Payout failed",
|
|
95
|
+
body: "Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",
|
|
96
|
+
channel: "email",
|
|
97
|
+
customerName: "Ivy",
|
|
98
|
+
metadata: { accountId: "acct_789" }
|
|
99
|
+
};
|
|
100
|
+
const classification = await classifier.classify(ticket);
|
|
101
|
+
const resolution = await resolver.resolve(ticket);
|
|
102
|
+
const draft = await responder.draft(ticket, resolution, classification);
|
|
103
|
+
logger.info("Support bot run completed", {
|
|
104
|
+
ticketId: ticket.id,
|
|
105
|
+
classification,
|
|
106
|
+
resolution,
|
|
107
|
+
emailDraft: { subject: draft.subject, body: draft.body }
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
runAiSupportBotExample,
|
|
112
|
+
example_default as example
|
|
113
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/setup.ts
|
|
2
|
+
import { TicketResolver } from "@contractspec/lib.support-bot/rag";
|
|
3
|
+
import { TicketClassifier } from "@contractspec/lib.support-bot/tickets";
|
|
4
|
+
import { AutoResponder } from "@contractspec/lib.support-bot/bot";
|
|
5
|
+
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
6
|
+
var logger = new Logger({
|
|
7
|
+
level: LogLevel.DEBUG,
|
|
8
|
+
environment: "development",
|
|
9
|
+
enableColors: true
|
|
10
|
+
});
|
|
11
|
+
async function runAiSupportBotExample() {
|
|
12
|
+
const knowledge = {
|
|
13
|
+
async query(question) {
|
|
14
|
+
return {
|
|
15
|
+
answer: `The payout will retrigger automatically. (${question.slice(0, 40)}…)`,
|
|
16
|
+
references: []
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const resolver = new TicketResolver({ knowledge });
|
|
21
|
+
const classifier = new TicketClassifier;
|
|
22
|
+
const responder = new AutoResponder;
|
|
23
|
+
const ticket = {
|
|
24
|
+
id: "TIC-42",
|
|
25
|
+
subject: "Payout failed",
|
|
26
|
+
body: "Hello, our supplier payout failed twice yesterday. Can you confirm status? It is urgent.",
|
|
27
|
+
channel: "email",
|
|
28
|
+
customerName: "Ivy",
|
|
29
|
+
metadata: { accountId: "acct_789" }
|
|
30
|
+
};
|
|
31
|
+
const classification = await classifier.classify(ticket);
|
|
32
|
+
const resolution = await resolver.resolve(ticket);
|
|
33
|
+
const draft = await responder.draft(ticket, resolution, classification);
|
|
34
|
+
logger.info("Support bot run completed", {
|
|
35
|
+
ticketId: ticket.id,
|
|
36
|
+
classification,
|
|
37
|
+
resolution,
|
|
38
|
+
emailDraft: { subject: draft.subject, body: draft.body }
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
runAiSupportBotExample
|
|
43
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=ai-support-bot.docblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-support-bot.docblock.d.ts","sourceRoot":"","sources":["../../src/docs/ai-support-bot.docblock.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/ai-support-bot.docblock.ts
|
|
1
3
|
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
4
|
+
var blocks = [
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.ai-support-bot",
|
|
7
|
+
title: "AI Support Bot (example)",
|
|
8
|
+
summary: "Ticket classification + knowledge-grounded resolution + response drafting.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/ai-support-bot",
|
|
12
|
+
tags: ["support", "ai", "example"],
|
|
13
|
+
body: `## What this example shows
|
|
14
|
+
- Classify a ticket into a support category.
|
|
15
|
+
- Use a knowledge port to generate a grounded resolution.
|
|
16
|
+
- Draft a response (email body) from the resolution.
|
|
2
17
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
id: "docs.examples.ai-support-bot.usage",
|
|
19
|
-
title: "AI Support Bot — Usage",
|
|
20
|
-
summary: "How to run the example and swap the knowledge adapter.",
|
|
21
|
-
kind: "usage",
|
|
22
|
-
visibility: "public",
|
|
23
|
-
route: "/docs/examples/ai-support-bot/usage",
|
|
24
|
-
tags: ["support", "usage"],
|
|
25
|
-
body: `## Usage\n- Call \`runAiSupportBotExample()\`.\n- Replace the \`knowledge.query\` implementation with a real knowledge service.\n\n## Notes\n- Keep outputs structured.\n- Use policy gates before exposing drafted replies to end-users.`
|
|
26
|
-
}]);
|
|
18
|
+
## Guardrails
|
|
19
|
+
- Avoid logging raw ticket bodies/PII; prefer structured summaries.
|
|
20
|
+
- Keep knowledge and ticket adapters explicit and testable.`
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "docs.examples.ai-support-bot.usage",
|
|
24
|
+
title: "AI Support Bot \u2014 Usage",
|
|
25
|
+
summary: "How to run the example and swap the knowledge adapter.",
|
|
26
|
+
kind: "usage",
|
|
27
|
+
visibility: "public",
|
|
28
|
+
route: "/docs/examples/ai-support-bot/usage",
|
|
29
|
+
tags: ["support", "usage"],
|
|
30
|
+
body: `## Usage
|
|
31
|
+
- Call \`runAiSupportBotExample()\`.
|
|
32
|
+
- Replace the \`knowledge.query\` implementation with a real knowledge service.
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
## Notes
|
|
35
|
+
- Keep outputs structured.
|
|
36
|
+
- Use policy gates before exposing drafted replies to end-users.`
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
registerDocBlocks(blocks);
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import './ai-support-bot.docblock';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/ai-support-bot.docblock.ts
|
|
3
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
4
|
+
var blocks = [
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.ai-support-bot",
|
|
7
|
+
title: "AI Support Bot (example)",
|
|
8
|
+
summary: "Ticket classification + knowledge-grounded resolution + response drafting.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/ai-support-bot",
|
|
12
|
+
tags: ["support", "ai", "example"],
|
|
13
|
+
body: `## What this example shows
|
|
14
|
+
- Classify a ticket into a support category.
|
|
15
|
+
- Use a knowledge port to generate a grounded resolution.
|
|
16
|
+
- Draft a response (email body) from the resolution.
|
|
17
|
+
|
|
18
|
+
## Guardrails
|
|
19
|
+
- Avoid logging raw ticket bodies/PII; prefer structured summaries.
|
|
20
|
+
- Keep knowledge and ticket adapters explicit and testable.`
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "docs.examples.ai-support-bot.usage",
|
|
24
|
+
title: "AI Support Bot \u2014 Usage",
|
|
25
|
+
summary: "How to run the example and swap the knowledge adapter.",
|
|
26
|
+
kind: "usage",
|
|
27
|
+
visibility: "public",
|
|
28
|
+
route: "/docs/examples/ai-support-bot/usage",
|
|
29
|
+
tags: ["support", "usage"],
|
|
30
|
+
body: `## Usage
|
|
31
|
+
- Call \`runAiSupportBotExample()\`.
|
|
32
|
+
- Replace the \`knowledge.query\` implementation with a real knowledge service.
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
- Keep outputs structured.
|
|
36
|
+
- Use policy gates before exposing drafted replies to end-users.`
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
registerDocBlocks(blocks);
|
package/dist/example.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#region src/example.d.ts
|
|
4
|
-
declare const example: _contractspec_lib_contracts0.ExampleSpec;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { example as default };
|
|
1
|
+
declare const example: import("@contractspec/lib.contracts").ExampleSpec;
|
|
2
|
+
export default example;
|
|
7
3
|
//# sourceMappingURL=example.d.ts.map
|
package/dist/example.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO,mDA2BX,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
package/dist/example.js
CHANGED
|
@@ -1,45 +1,34 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/example.ts
|
|
1
3
|
import { defineExample } from "@contractspec/lib.contracts";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
surfaces: {
|
|
30
|
-
templates: true,
|
|
31
|
-
sandbox: {
|
|
32
|
-
enabled: true,
|
|
33
|
-
modes: ["markdown"]
|
|
34
|
-
},
|
|
35
|
-
studio: {
|
|
36
|
-
enabled: true,
|
|
37
|
-
installable: true
|
|
38
|
-
},
|
|
39
|
-
mcp: { enabled: true }
|
|
40
|
-
}
|
|
4
|
+
var example = defineExample({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "ai-support-bot",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
title: "AI Support Bot",
|
|
9
|
+
description: "Classify and resolve a support ticket (with a drafted response) using the support-bot and knowledge libraries.",
|
|
10
|
+
kind: "script",
|
|
11
|
+
visibility: "public",
|
|
12
|
+
stability: "experimental",
|
|
13
|
+
owners: ["@platform.core"],
|
|
14
|
+
tags: ["support", "ai", "tickets", "knowledge"]
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: "docs.examples.ai-support-bot",
|
|
18
|
+
usageDocId: "docs.examples.ai-support-bot.usage"
|
|
19
|
+
},
|
|
20
|
+
entrypoints: {
|
|
21
|
+
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
|
+
}
|
|
41
30
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
var example_default = example;
|
|
32
|
+
export {
|
|
33
|
+
example_default as default
|
|
34
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from './setup';
|
|
2
|
+
export { default as example } from './example';
|
|
3
|
+
import './docs';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,QAAQ,CAAC"}
|