@contractspec/lib.support-bot 0.0.0-canary-20260113170453
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/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/ai-agent/src/agent/contract-spec-agent.d.ts +5 -0
- package/dist/ai-agent/src/agent/index.d.ts +2 -0
- package/dist/ai-agent/src/agent/unified-agent.d.ts +3 -0
- package/dist/ai-agent/src/approval/index.d.ts +1 -0
- package/dist/ai-agent/src/approval/workflow.d.ts +1 -0
- package/dist/ai-agent/src/exporters/claude-agent-exporter.d.ts +2 -0
- package/dist/ai-agent/src/exporters/index.d.ts +3 -0
- package/dist/ai-agent/src/exporters/opencode-exporter.d.ts +2 -0
- package/dist/ai-agent/src/exporters/types.d.ts +2 -0
- package/dist/ai-agent/src/index.d.ts +14 -0
- package/dist/ai-agent/src/interop/index.d.ts +3 -0
- package/dist/ai-agent/src/interop/spec-consumer.d.ts +2 -0
- package/dist/ai-agent/src/interop/tool-consumer.d.ts +3 -0
- package/dist/ai-agent/src/interop/types.d.ts +2 -0
- package/dist/ai-agent/src/knowledge/index.d.ts +1 -0
- package/dist/ai-agent/src/knowledge/injector.d.ts +1 -0
- package/dist/ai-agent/src/providers/claude-agent-sdk/adapter.d.ts +2 -0
- package/dist/ai-agent/src/providers/claude-agent-sdk/index.d.ts +3 -0
- package/dist/ai-agent/src/providers/claude-agent-sdk/session-bridge.d.ts +1 -0
- package/dist/ai-agent/src/providers/claude-agent-sdk/tool-bridge.d.ts +3 -0
- package/dist/ai-agent/src/providers/index.d.ts +4 -0
- package/dist/ai-agent/src/providers/opencode-sdk/adapter.d.ts +2 -0
- package/dist/ai-agent/src/providers/opencode-sdk/agent-bridge.d.ts +3 -0
- package/dist/ai-agent/src/providers/opencode-sdk/index.d.ts +3 -0
- package/dist/ai-agent/src/providers/opencode-sdk/tool-bridge.d.ts +3 -0
- package/dist/ai-agent/src/providers/registry.d.ts +1 -0
- package/dist/ai-agent/src/providers/types.d.ts +3 -0
- package/dist/ai-agent/src/schema/index.d.ts +2 -0
- package/dist/ai-agent/src/schema/json-schema-to-zod.d.ts +1 -0
- package/dist/ai-agent/src/schema/schema-output.d.ts +2 -0
- package/dist/ai-agent/src/session/index.d.ts +1 -0
- package/dist/ai-agent/src/session/store.d.ts +2 -0
- package/dist/ai-agent/src/spec/index.d.ts +2 -0
- package/dist/ai-agent/src/spec/registry.d.ts +2 -0
- package/dist/ai-agent/src/spec/spec.d.ts +115 -0
- package/dist/ai-agent/src/spec/spec.d.ts.map +1 -0
- package/dist/ai-agent/src/telemetry/adapter.d.ts +1 -0
- package/dist/ai-agent/src/telemetry/index.d.ts +1 -0
- package/dist/ai-agent/src/tools/index.d.ts +4 -0
- package/dist/ai-agent/src/tools/knowledge-tool.d.ts +2 -0
- package/dist/ai-agent/src/tools/mcp-client.d.ts +1 -0
- package/dist/ai-agent/src/tools/mcp-server.d.ts +3 -0
- package/dist/ai-agent/src/tools/tool-adapter.d.ts +3 -0
- package/dist/ai-agent/src/types.d.ts +1 -0
- package/dist/bot/auto-responder.d.ts +26 -0
- package/dist/bot/auto-responder.d.ts.map +1 -0
- package/dist/bot/auto-responder.js +84 -0
- package/dist/bot/auto-responder.js.map +1 -0
- package/dist/bot/feedback-loop.d.ts +20 -0
- package/dist/bot/feedback-loop.d.ts.map +1 -0
- package/dist/bot/feedback-loop.js +35 -0
- package/dist/bot/feedback-loop.js.map +1 -0
- package/dist/bot/index.d.ts +4 -0
- package/dist/bot/index.js +5 -0
- package/dist/bot/tools.d.ts +15 -0
- package/dist/bot/tools.d.ts.map +1 -0
- package/dist/bot/tools.js +137 -0
- package/dist/bot/tools.js.map +1 -0
- package/dist/contracts/src/app-config/lifecycle.d.ts +1 -0
- package/dist/contracts/src/app-config/runtime.d.ts +13 -0
- package/dist/contracts/src/app-config/spec.d.ts +9 -0
- package/dist/contracts/src/capabilities/capabilities.d.ts +1 -0
- package/dist/contracts/src/capabilities/index.d.ts +2 -0
- package/dist/contracts/src/capabilities/openbanking.d.ts +1 -0
- package/dist/contracts/src/data-views/index.d.ts +3 -0
- package/dist/contracts/src/data-views/registry.d.ts +2 -0
- package/dist/contracts/src/data-views/spec.d.ts +2 -0
- package/dist/contracts/src/data-views/types.d.ts +2 -0
- package/dist/contracts/src/docs/accessibility_wcag_compliance_specs.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/index.d.ts +25 -0
- package/dist/contracts/src/docs/presentations.d.ts +2 -0
- package/dist/contracts/src/docs/registry.d.ts +10 -0
- package/dist/contracts/src/docs/registry.d.ts.map +1 -0
- package/dist/contracts/src/docs/tech/auth/better-auth-nextjs.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/contracts/README.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/contracts/openapi-export.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/contracts/openapi-import.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/lifecycle-stage-system.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/llm/llm-integration.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/mcp-endpoints.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/presentation-runtime.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/schema/README.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/learning-events.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/learning-journeys.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/platform-admin-panel.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/project-access-teams.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/project-routing.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/sandbox-unlogged.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/team-invitations.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/workspace-ops.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/studio/workspaces.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/telemetry-ingest.docblock.d.ts +1 -0
- package/dist/contracts/src/docs/tech/vscode-extension.docblock.d.ts +1 -0
- package/dist/contracts/src/events.d.ts +4 -0
- package/dist/contracts/src/experiments/spec-resolver.d.ts +4 -0
- package/dist/contracts/src/experiments/spec.d.ts +4 -0
- package/dist/contracts/src/features/index.d.ts +4 -0
- package/dist/contracts/src/features/install.d.ts +6 -0
- package/dist/contracts/src/features/registry.d.ts +2 -0
- package/dist/contracts/src/features/types.d.ts +5 -0
- package/dist/contracts/src/features/validation.d.ts +2 -0
- package/dist/contracts/src/install.d.ts +7 -0
- package/dist/contracts/src/integrations/connection.d.ts +1 -0
- package/dist/contracts/src/integrations/providers/llm.d.ts +83 -0
- package/dist/contracts/src/integrations/providers/llm.d.ts.map +1 -0
- package/dist/contracts/src/integrations/spec.d.ts +3 -0
- package/dist/contracts/src/knowledge/spec.d.ts +9 -0
- package/dist/contracts/src/knowledge/spec.d.ts.map +1 -0
- package/dist/contracts/src/operations/index.d.ts +2 -0
- package/dist/contracts/src/operations/operation.d.ts +6 -0
- package/dist/contracts/src/operations/registry.d.ts +6 -0
- package/dist/contracts/src/ownership.d.ts +61 -0
- package/dist/contracts/src/ownership.d.ts.map +1 -0
- package/dist/contracts/src/policy/registry.d.ts +2 -0
- package/dist/contracts/src/policy/spec.d.ts +11 -0
- package/dist/contracts/src/policy/spec.d.ts.map +1 -0
- package/dist/contracts/src/presentations/index.d.ts +3 -0
- package/dist/contracts/src/presentations/presentations.d.ts +2 -0
- package/dist/contracts/src/presentations/registry.d.ts +2 -0
- package/dist/contracts/src/presentations/transform-engine.d.ts +2 -0
- package/dist/contracts/src/registry-utils.d.ts +1 -0
- package/dist/contracts/src/registry.d.ts +3 -0
- package/dist/contracts/src/resources.d.ts +2 -0
- package/dist/contracts/src/telemetry/anomaly.d.ts +2 -0
- package/dist/contracts/src/telemetry/index.d.ts +3 -0
- package/dist/contracts/src/telemetry/spec.d.ts +2 -0
- package/dist/contracts/src/telemetry/tracker.d.ts +2 -0
- package/dist/contracts/src/tests/spec.d.ts +1 -0
- package/dist/contracts/src/themes.d.ts +2 -0
- package/dist/contracts/src/types.d.ts +5 -0
- package/dist/contracts/src/workflow/overview.docblock.d.ts +1 -0
- package/dist/contracts/src/workflow/spec.d.ts +5 -0
- package/dist/contracts/src/workspace-config/workspace-config.docblock.d.ts +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +9 -0
- package/dist/rag/index.d.ts +2 -0
- package/dist/rag/index.js +3 -0
- package/dist/rag/ticket-resolver.d.ts +25 -0
- package/dist/rag/ticket-resolver.d.ts.map +1 -0
- package/dist/rag/ticket-resolver.js +64 -0
- package/dist/rag/ticket-resolver.js.map +1 -0
- package/dist/schema/src/EnumType.d.ts +2 -0
- package/dist/schema/src/FieldType.d.ts +2 -0
- package/dist/schema/src/GraphQLSchemaType.d.ts +2 -0
- package/dist/schema/src/JsonSchemaType.d.ts +2 -0
- package/dist/schema/src/ScalarTypeEnum.d.ts +1 -0
- package/dist/schema/src/SchemaModel.d.ts +4 -0
- package/dist/schema/src/SchemaModelType.d.ts +1 -0
- package/dist/schema/src/ZodSchemaType.d.ts +2 -0
- package/dist/schema/src/entity/defineEntity.d.ts +1 -0
- package/dist/schema/src/entity/generator.d.ts +1 -0
- package/dist/schema/src/entity/index.d.ts +3 -0
- package/dist/schema/src/entity/types.d.ts +1 -0
- package/dist/schema/src/index.d.ts +9 -0
- package/dist/spec.d.ts +14 -0
- package/dist/spec.d.ts.map +1 -0
- package/dist/spec.js +35 -0
- package/dist/spec.js.map +1 -0
- package/dist/tickets/classifier.d.ts +25 -0
- package/dist/tickets/classifier.d.ts.map +1 -0
- package/dist/tickets/classifier.js +199 -0
- package/dist/tickets/classifier.js.map +1 -0
- package/dist/tickets/index.d.ts +2 -0
- package/dist/tickets/index.js +3 -0
- package/dist/types.d.ts +77 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/package.json +85 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/bot/tools.ts
|
|
4
|
+
const ticketSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
subject: z.string(),
|
|
7
|
+
body: z.string(),
|
|
8
|
+
channel: z.enum([
|
|
9
|
+
"email",
|
|
10
|
+
"chat",
|
|
11
|
+
"phone",
|
|
12
|
+
"portal"
|
|
13
|
+
]),
|
|
14
|
+
customerName: z.string().optional(),
|
|
15
|
+
customerEmail: z.string().optional(),
|
|
16
|
+
metadata: z.object().optional()
|
|
17
|
+
});
|
|
18
|
+
const supportCitationSchema = z.object({
|
|
19
|
+
label: z.string(),
|
|
20
|
+
url: z.string().optional(),
|
|
21
|
+
snippet: z.string().optional(),
|
|
22
|
+
score: z.number().optional()
|
|
23
|
+
});
|
|
24
|
+
const supportActionSchema = z.object({
|
|
25
|
+
type: z.enum([
|
|
26
|
+
"respond",
|
|
27
|
+
"escalate",
|
|
28
|
+
"refund",
|
|
29
|
+
"manual"
|
|
30
|
+
]),
|
|
31
|
+
label: z.string(),
|
|
32
|
+
payload: z.record(z.string(), z.string())
|
|
33
|
+
});
|
|
34
|
+
const supportResolutionSchema = z.object({
|
|
35
|
+
ticketId: z.string(),
|
|
36
|
+
answer: z.string(),
|
|
37
|
+
confidence: z.number(),
|
|
38
|
+
citations: supportCitationSchema.array(),
|
|
39
|
+
actions: supportActionSchema.array(),
|
|
40
|
+
escalationReason: z.string().optional(),
|
|
41
|
+
knowledgeUpdates: z.array(z.string()).optional()
|
|
42
|
+
});
|
|
43
|
+
const ticketClassificationSchema = z.object({
|
|
44
|
+
ticketId: z.string(),
|
|
45
|
+
category: z.enum([
|
|
46
|
+
"billing",
|
|
47
|
+
"technical",
|
|
48
|
+
"product",
|
|
49
|
+
"account",
|
|
50
|
+
"compliance",
|
|
51
|
+
"other"
|
|
52
|
+
]),
|
|
53
|
+
priority: z.enum([
|
|
54
|
+
"urgent",
|
|
55
|
+
"high",
|
|
56
|
+
"medium",
|
|
57
|
+
"low"
|
|
58
|
+
]),
|
|
59
|
+
sentiment: z.enum([
|
|
60
|
+
"positive",
|
|
61
|
+
"neutral",
|
|
62
|
+
"negative",
|
|
63
|
+
"frustrated"
|
|
64
|
+
]),
|
|
65
|
+
intents: z.array(z.string()),
|
|
66
|
+
tags: z.array(z.string()),
|
|
67
|
+
confidence: z.number(),
|
|
68
|
+
escalationRequired: z.boolean().optional()
|
|
69
|
+
});
|
|
70
|
+
function ensureTicket(input) {
|
|
71
|
+
if (!input || typeof input !== "object" || !("ticket" in input)) throw new Error("Input must include ticket");
|
|
72
|
+
const ticket = input.ticket;
|
|
73
|
+
if (!ticket?.id) throw new Error("Ticket is missing id");
|
|
74
|
+
return ticket;
|
|
75
|
+
}
|
|
76
|
+
function extractResolution(input) {
|
|
77
|
+
if (!input || typeof input !== "object" || !("resolution" in input)) return void 0;
|
|
78
|
+
return input.resolution;
|
|
79
|
+
}
|
|
80
|
+
function extractClassification(input) {
|
|
81
|
+
if (!input || typeof input !== "object" || !("classification" in input)) return void 0;
|
|
82
|
+
return input.classification;
|
|
83
|
+
}
|
|
84
|
+
function createSupportTools(options) {
|
|
85
|
+
return [
|
|
86
|
+
{
|
|
87
|
+
title: "support_classify_ticket",
|
|
88
|
+
description: "Classify a ticket for priority, sentiment, and category",
|
|
89
|
+
inputSchema: z.object({ ticket: ticketSchema }),
|
|
90
|
+
execute: async (input) => {
|
|
91
|
+
const ticket = ensureTicket(input);
|
|
92
|
+
const classification = await options.classifier.classify(ticket);
|
|
93
|
+
return {
|
|
94
|
+
content: JSON.stringify(classification),
|
|
95
|
+
metadata: { ticketId: ticket.id }
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: "support_resolve_ticket",
|
|
101
|
+
description: "Generate a knowledge-grounded resolution for a ticket",
|
|
102
|
+
inputSchema: z.object({ ticket: ticketSchema }),
|
|
103
|
+
execute: async (input) => {
|
|
104
|
+
const ticket = ensureTicket(input);
|
|
105
|
+
const resolution = await options.resolver.resolve(ticket);
|
|
106
|
+
return {
|
|
107
|
+
content: JSON.stringify(resolution),
|
|
108
|
+
metadata: { ticketId: ticket.id }
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
title: "support_draft_response",
|
|
114
|
+
description: "Draft a user-facing reply based on resolution + classification",
|
|
115
|
+
inputSchema: z.object({
|
|
116
|
+
ticket: ticketSchema,
|
|
117
|
+
resolution: supportResolutionSchema,
|
|
118
|
+
classification: ticketClassificationSchema
|
|
119
|
+
}),
|
|
120
|
+
execute: async (input) => {
|
|
121
|
+
const ticket = ensureTicket(input);
|
|
122
|
+
const resolution = extractResolution(input);
|
|
123
|
+
const classification = extractClassification(input);
|
|
124
|
+
if (!resolution || !classification) throw new Error("resolution and classification are required");
|
|
125
|
+
const draft = await options.responder.draft(ticket, resolution, classification);
|
|
126
|
+
return {
|
|
127
|
+
content: JSON.stringify(draft),
|
|
128
|
+
metadata: { ticketId: ticket.id }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
export { createSupportTools };
|
|
137
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,E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,MAAM,QAAQ,UAAU,MACpC,QACA,YACA,eACD;AACD,WAAO;KACL,SAAS,KAAK,UAAU,MAAM;KAC9B,UAAU,EAAE,UAAU,OAAO,IAAI;KAClC;;GAEJ;EAEgD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./spec.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../policy/spec.js";
|
|
2
|
+
import "../telemetry/spec.js";
|
|
3
|
+
import "../capabilities/index.js";
|
|
4
|
+
import "../experiments/spec.js";
|
|
5
|
+
import "../features/index.js";
|
|
6
|
+
import "../data-views/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 "./spec.js";
|
|
13
|
+
import "../knowledge/spec.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../ownership.js";
|
|
2
|
+
import "../policy/spec.js";
|
|
3
|
+
import "../capabilities/index.js";
|
|
4
|
+
import "../experiments/spec.js";
|
|
5
|
+
import "../features/index.js";
|
|
6
|
+
import "../themes.js";
|
|
7
|
+
import "../integrations/spec.js";
|
|
8
|
+
import "./lifecycle.js";
|
|
9
|
+
import "../registry.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../ownership.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./presentations.js";
|
|
2
|
+
import { DocId } from "./registry.js";
|
|
3
|
+
import "./accessibility_wcag_compliance_specs.docblock.js";
|
|
4
|
+
import "./tech/lifecycle-stage-system.docblock.js";
|
|
5
|
+
import "./tech/presentation-runtime.docblock.js";
|
|
6
|
+
import "./tech/auth/better-auth-nextjs.docblock.js";
|
|
7
|
+
import "./tech/schema/README.docblock.js";
|
|
8
|
+
import "../workflow/overview.docblock.js";
|
|
9
|
+
import "./tech/mcp-endpoints.docblock.js";
|
|
10
|
+
import "./tech/vscode-extension.docblock.js";
|
|
11
|
+
import "./tech/telemetry-ingest.docblock.js";
|
|
12
|
+
import "./tech/contracts/README.docblock.js";
|
|
13
|
+
import "./tech/contracts/openapi-export.docblock.js";
|
|
14
|
+
import "./tech/contracts/openapi-import.docblock.js";
|
|
15
|
+
import "../workspace-config/workspace-config.docblock.js";
|
|
16
|
+
import "./tech/studio/workspaces.docblock.js";
|
|
17
|
+
import "./tech/studio/sandbox-unlogged.docblock.js";
|
|
18
|
+
import "./tech/studio/workspace-ops.docblock.js";
|
|
19
|
+
import "./tech/studio/project-routing.docblock.js";
|
|
20
|
+
import "./tech/studio/platform-admin-panel.docblock.js";
|
|
21
|
+
import "./tech/studio/learning-events.docblock.js";
|
|
22
|
+
import "./tech/studio/learning-journeys.docblock.js";
|
|
23
|
+
import "./tech/studio/project-access-teams.docblock.js";
|
|
24
|
+
import "./tech/studio/team-invitations.docblock.js";
|
|
25
|
+
import "./tech/llm/llm-integration.docblock.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","names":[],"sources":["../../../../../contracts/src/docs/registry.ts"],"sourcesContent":[],"mappings":";;;;KASY,KAAA;EAAA,OAAA,EAAK,IAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./spec.js";
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;EAKA,IAAA,EAAA,MAAA;AAOjB;AAMY,UAbK,eAAA,CAaS;EAAG,IAAA,EAAA,WAAA;EAAc,EAAA,EAAA,MAAA;EAAkB,IAAA,EAAA,MAAA;EAAiB,SAAA,EAAA,MAAA;AAE9E;AACQ,UATS,iBAAA,CAST;EACG,IAAA,EAAA,aAAA;EAGE,UAAA,EAAA,MAAA;EAAM,MAAA,EAAA,MAAA;AAGnB;AAMiB,KAhBL,cAAA,GAAiB,WAgBC,GAhBa,eAgBb,GAhB+B,iBAgB/B;AAMb,UApBA,UAAA,CAoBc;EAOrB,IAAA,EA1BF,OA0BE;EAEG,OAAA,EA3BF,cA2BE,EAAA;EAEF,IAAA,CAAA,EAAA,MAAA;EAAW,UAAA,CAAA,EAAA,MAAA;EAGL,QAAA,CAAA,EA7BJ,MA6Be,CAAA,MAAA,EACjB,MAAA,CAAA;AAMX;AAGa,UApCI,iBAAA,CAoCJ;EAKD,IAAA,EAAA,MAAA;EAKC,WAAA,CAAA,EAAA,MAAA;EAIA,WAAA,EAAA,OAAA;;AAIc,UAhDV,aAAA,CAgDU;EAGV,YAAA,EAAA,MAAgB;EAIhB,gBAAW,EAAA,MAAA;EACX,WAAA,EAAA,MAAA;;AAAiD,UAlDjD,cAAA,CAkDiD;EAAR,KAAA,CAAA,EAAA,MAAA;EAE5C,WAAA,CAAA,EAAA,MAAA;EACA,IAAA,CAAA,EAAA,MAAA;EACK,eAAA,CAAA,EAAA,MAAA;EAAd,aAAA,CAAA,EAAA,MAAA,EAAA;EACmB,cAAA,CAAA,EAAA,MAAA,GAAA,MAAA;EAAuB,KAAA,CAAA,EAhDrC,iBAgDqC,EAAA;EAAR,MAAA,CAAA,EAAA,MAAA;EAAO,QAAA,CAAA,EA9CjC,MA8CiC,CAAA,MAAA,EAAA,MAAA,CAAA;;WA5CnC;;UAGM,WAAA;WACN;UACD;;;;KAKE,cAAA;;SAGC;;;;QAKD;;;;SAKC;;;SAIA;;;YAIG;;UAGC,gBAAA;;;UAIA,WAAA;iBACA,wBAAwB,iBAAiB,QAAQ;mBAEpD,wBACA,iBACT,cAAc;wBACK,eAAe,QAAQ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../ownership.js";
|
|
2
|
+
import "../policy/spec.js";
|
|
3
|
+
import "../registry.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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/knowledge/spec.ts"],"sourcesContent":[],"mappings":";;;;;KAIY,iBAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DocId } from "./docs/registry.js";
|
|
2
|
+
import "./docs/index.js";
|
|
3
|
+
|
|
4
|
+
//#region ../contracts/src/ownership.d.ts
|
|
5
|
+
declare const StabilityEnum: {
|
|
6
|
+
readonly Idea: "idea";
|
|
7
|
+
readonly InCreation: "in_creation";
|
|
8
|
+
readonly Experimental: "experimental";
|
|
9
|
+
readonly Beta: "beta";
|
|
10
|
+
readonly Stable: "stable";
|
|
11
|
+
readonly Deprecated: "deprecated";
|
|
12
|
+
};
|
|
13
|
+
type Stability = (typeof StabilityEnum)[keyof typeof StabilityEnum];
|
|
14
|
+
declare const OwnersEnum: {
|
|
15
|
+
readonly PlatformCore: "platform.core";
|
|
16
|
+
readonly PlatformSigil: "platform.sigil";
|
|
17
|
+
readonly PlatformMarketplace: "platform.marketplace";
|
|
18
|
+
readonly PlatformMessaging: "platform.messaging";
|
|
19
|
+
readonly PlatformContent: "platform.content";
|
|
20
|
+
readonly PlatformFeatureFlags: "platform.featureflags";
|
|
21
|
+
readonly PlatformFinance: "platform.finance";
|
|
22
|
+
};
|
|
23
|
+
type Owner = (typeof OwnersEnum)[keyof typeof OwnersEnum] | (string & {});
|
|
24
|
+
declare const TagsEnum: {
|
|
25
|
+
readonly Spots: "spots";
|
|
26
|
+
readonly Collectivity: "collectivity";
|
|
27
|
+
readonly Marketplace: "marketplace";
|
|
28
|
+
readonly Sellers: "sellers";
|
|
29
|
+
readonly Auth: "auth";
|
|
30
|
+
readonly Login: "login";
|
|
31
|
+
readonly Signup: "signup";
|
|
32
|
+
readonly Guide: "guide";
|
|
33
|
+
readonly Docs: "docs";
|
|
34
|
+
readonly I18n: "i18n";
|
|
35
|
+
readonly Incident: "incident";
|
|
36
|
+
readonly Automation: "automation";
|
|
37
|
+
readonly Hygiene: "hygiene";
|
|
38
|
+
};
|
|
39
|
+
type Tag = (typeof TagsEnum)[keyof typeof TagsEnum] | (string & {});
|
|
40
|
+
interface OwnerShipMeta {
|
|
41
|
+
/** Breaking changes => bump version */
|
|
42
|
+
version: string;
|
|
43
|
+
/** Fully-qualified spec key (e.g., "sigil.beginSignup") */
|
|
44
|
+
key: string;
|
|
45
|
+
/** Human-friendly spec title (e.g., "Signup begin") */
|
|
46
|
+
title?: string;
|
|
47
|
+
/** Short human-friendly summary */
|
|
48
|
+
description: string;
|
|
49
|
+
domain?: string;
|
|
50
|
+
/** Lifecycle marker for comms & tooling */
|
|
51
|
+
stability: Stability;
|
|
52
|
+
/** Owners for CODEOWNERS / on-call / approvals */
|
|
53
|
+
owners: Owner[];
|
|
54
|
+
/** Search tags, grouping, docs navigation */
|
|
55
|
+
tags: Tag[];
|
|
56
|
+
/** Doc block(s) for this operation. */
|
|
57
|
+
docId?: DocId[];
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { OwnerShipMeta };
|
|
61
|
+
//# sourceMappingURL=ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","names":[],"sources":["../../../../contracts/src/ownership.ts"],"sourcesContent":[],"mappings":";;;;cAIa;;;EAAA,SAAA,YAOH,EAAA,cAAA;EACE,SAAA,IAAS,EAAA,MAAA;EAGR,SAAA,MAQH,EAAA,QAAA;EACE,SAAK,UAAA,EACL,YAAyB;AAMrC,CAAA;AAeY,KAlCA,SAAA,GAkCc,CAAA,OAlCM,aAkCyB,CAAA,CAAA,MAAA,OAlCG,aAkCH,CAAA;AAIxC,cAnCJ,UAmCiB,EAAA;EAWjB,SAAA,YAAA,EAAA,eAAA;EAEH,SAAA,aAAA,EAAA,gBAAA;EAEF,SAAA,mBAAA,EAAA,sBAAA;EAGE,SAAA,iBAAA,EAAA,oBAAA;EAAK,SAAA,eAAA,EAAA,kBAAA;;;;KA5CH,KAAA,WACA,yBAAyB;cAMxB;;;;;;;;;;;;;;;KAeD,GAAA,WAAc,uBAAuB;UAIhC,aAAA;;;;;;;;;;;aAWJ;;UAEH;;QAEF;;UAGE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/policy/spec.ts"],"sourcesContent":[],"mappings":";;;;UAmHiB,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./ownership.js";
|