@lssm/module.ai-chat 1.41.1 → 1.42.2
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 +3 -0
- package/dist/ai-chat.feature.d.ts +12 -0
- package/dist/ai-chat.feature.d.ts.map +1 -0
- package/dist/ai-chat.feature.js +95 -1
- package/dist/ai-chat.feature.js.map +1 -0
- package/dist/ai-chat.operations.d.ts +243 -0
- package/dist/ai-chat.operations.d.ts.map +1 -0
- package/dist/ai-chat.operations.js +174 -0
- package/dist/ai-chat.operations.js.map +1 -0
- package/dist/context/context-builder.d.ts +57 -0
- package/dist/context/context-builder.d.ts.map +1 -0
- package/dist/context/context-builder.js +148 -2
- package/dist/context/context-builder.js.map +1 -0
- package/dist/context/file-operations.d.ts +100 -0
- package/dist/context/file-operations.d.ts.map +1 -0
- package/dist/context/file-operations.js +175 -1
- package/dist/context/file-operations.js.map +1 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.js +5 -1
- package/dist/context/workspace-context.d.ts +117 -0
- package/dist/context/workspace-context.d.ts.map +1 -0
- package/dist/context/workspace-context.js +124 -2
- package/dist/context/workspace-context.js.map +1 -0
- package/dist/core/chat-service.d.ts +73 -0
- package/dist/core/chat-service.d.ts.map +1 -0
- package/dist/core/chat-service.js +215 -2
- package/dist/core/chat-service.js.map +1 -0
- package/dist/core/conversation-store.d.ts +74 -0
- package/dist/core/conversation-store.d.ts.map +1 -0
- package/dist/core/conversation-store.js +109 -1
- package/dist/core/conversation-store.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +4 -1
- package/dist/core/message-types.d.ts +150 -0
- package/dist/core/message-types.d.ts.map +1 -0
- package/dist/events.d.ts +115 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +100 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +23 -1
- package/dist/libs/schema/dist/EnumType.js +2 -0
- package/dist/libs/schema/dist/FieldType.js +50 -0
- package/dist/libs/schema/dist/FieldType.js.map +1 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +237 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js.map +1 -0
- package/dist/libs/schema/dist/SchemaModel.js +40 -0
- package/dist/libs/schema/dist/SchemaModel.js.map +1 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/schema/dist/entity/index.js +2 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +6 -0
- package/dist/presentation/components/ChatContainer.d.ts +21 -0
- package/dist/presentation/components/ChatContainer.d.ts.map +1 -0
- package/dist/presentation/components/ChatContainer.js +63 -1
- package/dist/presentation/components/ChatContainer.js.map +1 -0
- package/dist/presentation/components/ChatInput.d.ts +35 -0
- package/dist/presentation/components/ChatInput.d.ts.map +1 -0
- package/dist/presentation/components/ChatInput.js +149 -1
- package/dist/presentation/components/ChatInput.js.map +1 -0
- package/dist/presentation/components/ChatMessage.d.ts +24 -0
- package/dist/presentation/components/ChatMessage.d.ts.map +1 -0
- package/dist/presentation/components/ChatMessage.js +136 -1
- package/dist/presentation/components/ChatMessage.js.map +1 -0
- package/dist/presentation/components/CodePreview.d.ts +40 -0
- package/dist/presentation/components/CodePreview.d.ts.map +1 -0
- package/dist/presentation/components/CodePreview.js +127 -2
- package/dist/presentation/components/CodePreview.js.map +1 -0
- package/dist/presentation/components/ContextIndicator.d.ts +26 -0
- package/dist/presentation/components/ContextIndicator.d.ts.map +1 -0
- package/dist/presentation/components/ContextIndicator.js +97 -1
- package/dist/presentation/components/ContextIndicator.js.map +1 -0
- package/dist/presentation/components/ModelPicker.d.ts +39 -0
- package/dist/presentation/components/ModelPicker.d.ts.map +1 -0
- package/dist/presentation/components/ModelPicker.js +202 -1
- package/dist/presentation/components/ModelPicker.js.map +1 -0
- package/dist/presentation/components/index.d.ts +7 -0
- package/dist/presentation/components/index.js +8 -1
- package/dist/presentation/hooks/index.d.ts +3 -0
- package/dist/presentation/hooks/index.js +4 -1
- package/dist/presentation/hooks/useChat.d.ts +67 -0
- package/dist/presentation/hooks/useChat.d.ts.map +1 -0
- package/dist/presentation/hooks/useChat.js +172 -1
- package/dist/presentation/hooks/useChat.js.map +1 -0
- package/dist/presentation/hooks/useProviders.d.ts +38 -0
- package/dist/presentation/hooks/useProviders.d.ts.map +1 -0
- package/dist/presentation/hooks/useProviders.js +41 -1
- package/dist/presentation/hooks/useProviders.js.map +1 -0
- package/dist/presentation/index.d.ts +11 -0
- package/dist/presentation/index.js +12 -1
- package/dist/providers/chat-utilities.d.ts +15 -0
- package/dist/providers/chat-utilities.d.ts.map +1 -0
- package/dist/providers/chat-utilities.js +17 -1
- package/dist/providers/chat-utilities.js.map +1 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.js +4 -1
- package/dist/schema.d.ts +222 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +102 -0
- package/dist/schema.js.map +1 -0
- package/package.json +29 -22
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FeatureModuleSpec } from "@lssm/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/ai-chat.feature.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AI Chat feature module that bundles conversational AI assistance
|
|
7
|
+
* for ContractSpec development across CLI, VSCode, and Studio.
|
|
8
|
+
*/
|
|
9
|
+
declare const AiChatFeature: FeatureModuleSpec;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AiChatFeature };
|
|
12
|
+
//# sourceMappingURL=ai-chat.feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.feature.d.ts","names":[],"sources":["../src/ai-chat.feature.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAWa,eAAe"}
|
package/dist/ai-chat.feature.js
CHANGED
|
@@ -1 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/ai-chat.feature.ts
|
|
2
|
+
/**
|
|
3
|
+
* AI Chat feature module that bundles conversational AI assistance
|
|
4
|
+
* for ContractSpec development across CLI, VSCode, and Studio.
|
|
5
|
+
*/
|
|
6
|
+
const AiChatFeature = {
|
|
7
|
+
meta: {
|
|
8
|
+
key: "ai-chat",
|
|
9
|
+
version: 1,
|
|
10
|
+
title: "AI Vibe Coding Chat",
|
|
11
|
+
description: "AI-powered conversational coding assistant with full workspace context",
|
|
12
|
+
domain: "platform",
|
|
13
|
+
owners: ["@platform.ai"],
|
|
14
|
+
tags: [
|
|
15
|
+
"ai",
|
|
16
|
+
"chat",
|
|
17
|
+
"llm",
|
|
18
|
+
"vibe-coding",
|
|
19
|
+
"assistant"
|
|
20
|
+
],
|
|
21
|
+
stability: "experimental"
|
|
22
|
+
},
|
|
23
|
+
operations: [
|
|
24
|
+
{
|
|
25
|
+
key: "ai-chat.send",
|
|
26
|
+
version: 1
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: "ai-chat.stream",
|
|
30
|
+
version: 1
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "ai-chat.conversations.list",
|
|
34
|
+
version: 1
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: "ai-chat.conversations.get",
|
|
38
|
+
version: 1
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "ai-chat.conversations.delete",
|
|
42
|
+
version: 1
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "ai-chat.providers.list",
|
|
46
|
+
version: 1
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "ai-chat.context.scan",
|
|
50
|
+
version: 1
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
events: [
|
|
54
|
+
{
|
|
55
|
+
key: "ai-chat.message.sent",
|
|
56
|
+
version: 1
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "ai-chat.message.received",
|
|
60
|
+
version: 1
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: "ai-chat.conversation.created",
|
|
64
|
+
version: 1
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "ai-chat.conversation.deleted",
|
|
68
|
+
version: 1
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "ai-chat.error",
|
|
72
|
+
version: 1
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
presentations: [],
|
|
76
|
+
opToPresentation: [],
|
|
77
|
+
presentationsTargets: [],
|
|
78
|
+
capabilities: {
|
|
79
|
+
provides: [{
|
|
80
|
+
key: "ai-chat",
|
|
81
|
+
version: 1
|
|
82
|
+
}],
|
|
83
|
+
requires: [{
|
|
84
|
+
key: "identity",
|
|
85
|
+
version: 1
|
|
86
|
+
}, {
|
|
87
|
+
key: "metering",
|
|
88
|
+
version: 1
|
|
89
|
+
}]
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { AiChatFeature };
|
|
95
|
+
//# sourceMappingURL=ai-chat.feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.feature.js","names":["AiChatFeature: FeatureModuleSpec"],"sources":["../src/ai-chat.feature.ts"],"sourcesContent":["/**\n * AI Chat Feature Module Specification\n *\n * Defines the feature module for AI-powered vibe coding chat.\n */\nimport type { FeatureModuleSpec } from '@lssm/lib.contracts';\n\n/**\n * AI Chat feature module that bundles conversational AI assistance\n * for ContractSpec development across CLI, VSCode, and Studio.\n */\nexport const AiChatFeature: FeatureModuleSpec = {\n meta: {\n key: 'ai-chat',\n version: 1,\n title: 'AI Vibe Coding Chat',\n description:\n 'AI-powered conversational coding assistant with full workspace context',\n domain: 'platform',\n owners: ['@platform.ai'],\n tags: ['ai', 'chat', 'llm', 'vibe-coding', 'assistant'],\n stability: 'experimental',\n },\n\n // Contract operations for chat functionality\n operations: [\n { key: 'ai-chat.send', version: 1 },\n { key: 'ai-chat.stream', version: 1 },\n { key: 'ai-chat.conversations.list', version: 1 },\n { key: 'ai-chat.conversations.get', version: 1 },\n { key: 'ai-chat.conversations.delete', version: 1 },\n { key: 'ai-chat.providers.list', version: 1 },\n { key: 'ai-chat.context.scan', version: 1 },\n ],\n\n // Events emitted by the chat system\n events: [\n { key: 'ai-chat.message.sent', version: 1 },\n { key: 'ai-chat.message.received', version: 1 },\n { key: 'ai-chat.conversation.created', version: 1 },\n { key: 'ai-chat.conversation.deleted', version: 1 },\n { key: 'ai-chat.error', version: 1 },\n ],\n\n // No presentations for core module\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n\n // Capability definitions\n capabilities: {\n provides: [{ key: 'ai-chat', version: 1 }],\n requires: [\n { key: 'identity', version: 1 },\n { key: 'metering', version: 1 },\n ],\n },\n};\n"],"mappings":";;;;;AAWA,MAAaA,gBAAmC;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,eAAe;EACxB,MAAM;GAAC;GAAM;GAAQ;GAAO;GAAe;GAAY;EACvD,WAAW;EACZ;CAGD,YAAY;EACV;GAAE,KAAK;GAAgB,SAAS;GAAG;EACnC;GAAE,KAAK;GAAkB,SAAS;GAAG;EACrC;GAAE,KAAK;GAA8B,SAAS;GAAG;EACjD;GAAE,KAAK;GAA6B,SAAS;GAAG;EAChD;GAAE,KAAK;GAAgC,SAAS;GAAG;EACnD;GAAE,KAAK;GAA0B,SAAS;GAAG;EAC7C;GAAE,KAAK;GAAwB,SAAS;GAAG;EAC5C;CAGD,QAAQ;EACN;GAAE,KAAK;GAAwB,SAAS;GAAG;EAC3C;GAAE,KAAK;GAA4B,SAAS;GAAG;EAC/C;GAAE,KAAK;GAAgC,SAAS;GAAG;EACnD;GAAE,KAAK;GAAgC,SAAS;GAAG;EACnD;GAAE,KAAK;GAAiB,SAAS;GAAG;EACrC;CAGD,eAAe,EAAE;CACjB,kBAAkB,EAAE;CACpB,sBAAsB,EAAE;CAGxB,cAAc;EACZ,UAAU,CAAC;GAAE,KAAK;GAAW,SAAS;GAAG,CAAC;EAC1C,UAAU,CACR;GAAE,KAAK;GAAY,SAAS;GAAG,EAC/B;GAAE,KAAK;GAAY,SAAS;GAAG,CAChC;EACF;CACF"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as _lssm_lib_contracts4 from "@lssm/lib.contracts";
|
|
2
|
+
import * as _lssm_lib_schema82 from "@lssm/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/ai-chat.operations.d.ts
|
|
5
|
+
declare const SendMessageContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{
|
|
6
|
+
conversationId: {
|
|
7
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
8
|
+
isOptional: true;
|
|
9
|
+
};
|
|
10
|
+
content: {
|
|
11
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
12
|
+
isOptional: false;
|
|
13
|
+
};
|
|
14
|
+
stream: {
|
|
15
|
+
type: _lssm_lib_schema82.FieldType<boolean, boolean>;
|
|
16
|
+
isOptional: true;
|
|
17
|
+
};
|
|
18
|
+
}>, _lssm_lib_schema82.SchemaModel<{
|
|
19
|
+
message: {
|
|
20
|
+
type: _lssm_lib_schema82.SchemaModel<{
|
|
21
|
+
id: {
|
|
22
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
role: {
|
|
26
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
content: {
|
|
30
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
31
|
+
isOptional: false;
|
|
32
|
+
};
|
|
33
|
+
status: {
|
|
34
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
35
|
+
isOptional: false;
|
|
36
|
+
};
|
|
37
|
+
createdAt: {
|
|
38
|
+
type: _lssm_lib_schema82.FieldType<Date, string>;
|
|
39
|
+
isOptional: false;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
isOptional: false;
|
|
43
|
+
};
|
|
44
|
+
conversation: {
|
|
45
|
+
type: _lssm_lib_schema82.SchemaModel<{
|
|
46
|
+
id: {
|
|
47
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
title: {
|
|
51
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
54
|
+
status: {
|
|
55
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
messages: {
|
|
59
|
+
type: _lssm_lib_schema82.SchemaModel<{
|
|
60
|
+
id: {
|
|
61
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
62
|
+
isOptional: false;
|
|
63
|
+
};
|
|
64
|
+
role: {
|
|
65
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
66
|
+
isOptional: false;
|
|
67
|
+
};
|
|
68
|
+
content: {
|
|
69
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
70
|
+
isOptional: false;
|
|
71
|
+
};
|
|
72
|
+
status: {
|
|
73
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
74
|
+
isOptional: false;
|
|
75
|
+
};
|
|
76
|
+
createdAt: {
|
|
77
|
+
type: _lssm_lib_schema82.FieldType<Date, string>;
|
|
78
|
+
isOptional: false;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
isArray: true;
|
|
82
|
+
isOptional: false;
|
|
83
|
+
};
|
|
84
|
+
provider: {
|
|
85
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
86
|
+
isOptional: false;
|
|
87
|
+
};
|
|
88
|
+
model: {
|
|
89
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
90
|
+
isOptional: false;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
isOptional: false;
|
|
94
|
+
};
|
|
95
|
+
}>, undefined>;
|
|
96
|
+
declare const StreamMessageContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{
|
|
97
|
+
conversationId: {
|
|
98
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
99
|
+
isOptional: true;
|
|
100
|
+
};
|
|
101
|
+
content: {
|
|
102
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
103
|
+
isOptional: false;
|
|
104
|
+
};
|
|
105
|
+
stream: {
|
|
106
|
+
type: _lssm_lib_schema82.FieldType<boolean, boolean>;
|
|
107
|
+
isOptional: true;
|
|
108
|
+
};
|
|
109
|
+
}>, _lssm_lib_schema82.SchemaModel<{
|
|
110
|
+
stream: {
|
|
111
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
112
|
+
isOptional: false;
|
|
113
|
+
};
|
|
114
|
+
}>, undefined>;
|
|
115
|
+
declare const ListConversationsContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{}>, _lssm_lib_schema82.SchemaModel<{
|
|
116
|
+
conversations: {
|
|
117
|
+
type: _lssm_lib_schema82.SchemaModel<{
|
|
118
|
+
id: {
|
|
119
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
120
|
+
isOptional: false;
|
|
121
|
+
};
|
|
122
|
+
title: {
|
|
123
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
124
|
+
isOptional: true;
|
|
125
|
+
};
|
|
126
|
+
status: {
|
|
127
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
128
|
+
isOptional: false;
|
|
129
|
+
};
|
|
130
|
+
messages: {
|
|
131
|
+
type: _lssm_lib_schema82.SchemaModel<{
|
|
132
|
+
id: {
|
|
133
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
134
|
+
isOptional: false;
|
|
135
|
+
};
|
|
136
|
+
role: {
|
|
137
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
138
|
+
isOptional: false;
|
|
139
|
+
};
|
|
140
|
+
content: {
|
|
141
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
142
|
+
isOptional: false;
|
|
143
|
+
};
|
|
144
|
+
status: {
|
|
145
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
146
|
+
isOptional: false;
|
|
147
|
+
};
|
|
148
|
+
createdAt: {
|
|
149
|
+
type: _lssm_lib_schema82.FieldType<Date, string>;
|
|
150
|
+
isOptional: false;
|
|
151
|
+
};
|
|
152
|
+
}>;
|
|
153
|
+
isArray: true;
|
|
154
|
+
isOptional: false;
|
|
155
|
+
};
|
|
156
|
+
provider: {
|
|
157
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
158
|
+
isOptional: false;
|
|
159
|
+
};
|
|
160
|
+
model: {
|
|
161
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
162
|
+
isOptional: false;
|
|
163
|
+
};
|
|
164
|
+
}>;
|
|
165
|
+
isArray: true;
|
|
166
|
+
isOptional: false;
|
|
167
|
+
};
|
|
168
|
+
}>, undefined>;
|
|
169
|
+
declare const GetConversationContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{
|
|
170
|
+
id: {
|
|
171
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
172
|
+
isOptional: false;
|
|
173
|
+
};
|
|
174
|
+
}>, _lssm_lib_schema82.SchemaModel<{
|
|
175
|
+
id: {
|
|
176
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
177
|
+
isOptional: false;
|
|
178
|
+
};
|
|
179
|
+
title: {
|
|
180
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
181
|
+
isOptional: true;
|
|
182
|
+
};
|
|
183
|
+
status: {
|
|
184
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
185
|
+
isOptional: false;
|
|
186
|
+
};
|
|
187
|
+
messages: {
|
|
188
|
+
type: _lssm_lib_schema82.SchemaModel<{
|
|
189
|
+
id: {
|
|
190
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
191
|
+
isOptional: false;
|
|
192
|
+
};
|
|
193
|
+
role: {
|
|
194
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
195
|
+
isOptional: false;
|
|
196
|
+
};
|
|
197
|
+
content: {
|
|
198
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
199
|
+
isOptional: false;
|
|
200
|
+
};
|
|
201
|
+
status: {
|
|
202
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
203
|
+
isOptional: false;
|
|
204
|
+
};
|
|
205
|
+
createdAt: {
|
|
206
|
+
type: _lssm_lib_schema82.FieldType<Date, string>;
|
|
207
|
+
isOptional: false;
|
|
208
|
+
};
|
|
209
|
+
}>;
|
|
210
|
+
isArray: true;
|
|
211
|
+
isOptional: false;
|
|
212
|
+
};
|
|
213
|
+
provider: {
|
|
214
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
215
|
+
isOptional: false;
|
|
216
|
+
};
|
|
217
|
+
model: {
|
|
218
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
219
|
+
isOptional: false;
|
|
220
|
+
};
|
|
221
|
+
}>, undefined>;
|
|
222
|
+
declare const DeleteConversationContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{
|
|
223
|
+
id: {
|
|
224
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
225
|
+
isOptional: false;
|
|
226
|
+
};
|
|
227
|
+
}>, _lssm_lib_schema82.SchemaModel<{}>, undefined>;
|
|
228
|
+
declare const ListProvidersContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{}>, _lssm_lib_schema82.SchemaModel<{
|
|
229
|
+
providers: {
|
|
230
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
231
|
+
isArray: true;
|
|
232
|
+
isOptional: false;
|
|
233
|
+
};
|
|
234
|
+
}>, undefined>;
|
|
235
|
+
declare const ScanContextContract: _lssm_lib_contracts4.OperationSpec<_lssm_lib_schema82.SchemaModel<{
|
|
236
|
+
path: {
|
|
237
|
+
type: _lssm_lib_schema82.FieldType<string, string>;
|
|
238
|
+
isOptional: false;
|
|
239
|
+
};
|
|
240
|
+
}>, _lssm_lib_schema82.SchemaModel<{}>, undefined>;
|
|
241
|
+
//#endregion
|
|
242
|
+
export { DeleteConversationContract, GetConversationContract, ListConversationsContract, ListProvidersContract, ScanContextContract, SendMessageContract, StreamMessageContract };
|
|
243
|
+
//# sourceMappingURL=ai-chat.operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.operations.d.ts","names":[],"sources":["../src/ai-chat.operations.ts"],"sourcesContent":[],"mappings":";;;;cASa,0CAAmB,iCAAA;;UAa9B,kBAAA,CAAA;;EAbW,CAAA;EAaX,OAAA,EAAA;;;;EAb8B,MAAA,EAAA;;;;;;;;cAAA,kBAAA,CAAA;;;;;;;;;;;;;kBAAA,EAAA,KAAA;MAAA,CAAA;MAsBnB,SAAA,EAAA;QAaX,IAAA,8BAAA,KAAA,EAAA,MAAA,CAAA;;;;IAbgC,UAAA,EAAA,KAAA;;;IAAA,IAAA,gCAAA,CAAA;MAerB,EAAA,EAAA;QAgBX,IAhBoC,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;YAAA,IAAA,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;YAAA,UAAA,EAAA,KAAA;UAAA,CAAA;UAkBzB,IAAA,EAAA;YAqBX,IAAA,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;YArBkC,UAAA,EAAA,KAAA;UAAA,CAAA;;;;;;;;;;;;;;QAAA,OAAA,EAAA,IAAA;QAuBvB,UAAA,EAAA,KAqBX;MAAA,CAAA;cArBqC,EAAA;QAAA,IAAA,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;kBAAA,EAAA,KAAA;MAAA,CAAA;MAuB1B,KAAA,EAAA;QAyBX,IAzBgC,8BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;;IAAA,CAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EA2BrB,CAAA;CAqBX,CAAA,EAAA,SAAA,CAAA;cA/HW,qBA0GmB,uBA1GE,aA0GF,oBA1GE,WA0GF,CAAA;EAAA,cAAA,EAAA;UA7F9B,kBAAA,CAAA,SA6F8B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;;;UA1GE,kBAAA,CAAA;;;;cAerB,2BAAyB,oBAAA,CAAA,cAgBpC,kBAAA,CAhBoC,oCAAA;;;;cAAA,kBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBzB,8CAAuB,iCAAA;;UAqBlC,kBAAA,CAAA;;;;;UArBkC,kBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBvB,iDAA0B,iCAAA;;UAqBrC,kBAAA,CAAA;;;IArBqC,kBAAA,CAAA;cAuB1B,uBAAqB,oBAAA,CAAA,cAyBhC,kBAAA,CAzBgC,oCAAA;;UAAA,kBAAA,CAAA;;;;;cA2BrB,0CAAmB,iCAAA;;UAqB9B,kBAAA,CAAA;;;IArB8B,kBAAA,CAAA"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { ScalarTypeEnum } from "./libs/schema/dist/ScalarTypeEnum.js";
|
|
2
|
+
import { defineSchemaModel } from "./libs/schema/dist/SchemaModel.js";
|
|
3
|
+
import "./libs/schema/dist/index.js";
|
|
4
|
+
import { ChatConversationModel, ListConversationsOutputModel, SendMessageInputModel, SendMessageOutputModel } from "./schema.js";
|
|
5
|
+
import { defineCommand, defineQuery } from "@lssm/lib.contracts";
|
|
6
|
+
|
|
7
|
+
//#region src/ai-chat.operations.ts
|
|
8
|
+
const SendMessageContract = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
key: "ai-chat.send",
|
|
11
|
+
version: 1,
|
|
12
|
+
owners: ["@ai-team"],
|
|
13
|
+
stability: "experimental",
|
|
14
|
+
description: "Send a message to the AI chat.",
|
|
15
|
+
tags: ["chat", "send"],
|
|
16
|
+
goal: "Send message",
|
|
17
|
+
context: "Chat UI"
|
|
18
|
+
},
|
|
19
|
+
io: {
|
|
20
|
+
input: SendMessageInputModel,
|
|
21
|
+
output: SendMessageOutputModel
|
|
22
|
+
},
|
|
23
|
+
policy: { auth: "user" }
|
|
24
|
+
});
|
|
25
|
+
const StreamMessageOutputModel = defineSchemaModel({
|
|
26
|
+
name: "StreamMessageOutput",
|
|
27
|
+
fields: { stream: {
|
|
28
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
+
isOptional: false
|
|
30
|
+
} }
|
|
31
|
+
});
|
|
32
|
+
const StreamMessageContract = defineCommand({
|
|
33
|
+
meta: {
|
|
34
|
+
key: "ai-chat.stream",
|
|
35
|
+
version: 1,
|
|
36
|
+
owners: ["@ai-team"],
|
|
37
|
+
stability: "experimental",
|
|
38
|
+
description: "Stream a message response from the AI chat.",
|
|
39
|
+
tags: ["chat", "stream"],
|
|
40
|
+
goal: "Stream response",
|
|
41
|
+
context: "Chat UI"
|
|
42
|
+
},
|
|
43
|
+
io: {
|
|
44
|
+
input: SendMessageInputModel,
|
|
45
|
+
output: StreamMessageOutputModel
|
|
46
|
+
},
|
|
47
|
+
policy: { auth: "user" }
|
|
48
|
+
});
|
|
49
|
+
const ListConversationsContract = defineQuery({
|
|
50
|
+
meta: {
|
|
51
|
+
key: "ai-chat.conversations.list",
|
|
52
|
+
version: 1,
|
|
53
|
+
owners: ["@ai-team"],
|
|
54
|
+
stability: "experimental",
|
|
55
|
+
description: "List user conversations.",
|
|
56
|
+
tags: ["chat", "list"],
|
|
57
|
+
goal: "List conversations",
|
|
58
|
+
context: "Chat History"
|
|
59
|
+
},
|
|
60
|
+
io: {
|
|
61
|
+
input: defineSchemaModel({
|
|
62
|
+
name: "VoidInput",
|
|
63
|
+
fields: {}
|
|
64
|
+
}),
|
|
65
|
+
output: ListConversationsOutputModel
|
|
66
|
+
},
|
|
67
|
+
policy: { auth: "user" }
|
|
68
|
+
});
|
|
69
|
+
const GetConversationContract = defineQuery({
|
|
70
|
+
meta: {
|
|
71
|
+
key: "ai-chat.conversations.get",
|
|
72
|
+
version: 1,
|
|
73
|
+
owners: ["@ai-team"],
|
|
74
|
+
stability: "experimental",
|
|
75
|
+
description: "Get a specific conversation.",
|
|
76
|
+
tags: ["chat", "get"],
|
|
77
|
+
goal: "Get conversation",
|
|
78
|
+
context: "Chat UI"
|
|
79
|
+
},
|
|
80
|
+
io: {
|
|
81
|
+
input: defineSchemaModel({
|
|
82
|
+
name: "GetConversationInput",
|
|
83
|
+
fields: { id: {
|
|
84
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
85
|
+
isOptional: false
|
|
86
|
+
} }
|
|
87
|
+
}),
|
|
88
|
+
output: ChatConversationModel
|
|
89
|
+
},
|
|
90
|
+
policy: { auth: "user" }
|
|
91
|
+
});
|
|
92
|
+
const DeleteConversationContract = defineCommand({
|
|
93
|
+
meta: {
|
|
94
|
+
key: "ai-chat.conversations.delete",
|
|
95
|
+
version: 1,
|
|
96
|
+
owners: ["@ai-team"],
|
|
97
|
+
stability: "experimental",
|
|
98
|
+
description: "Delete a conversation.",
|
|
99
|
+
tags: ["chat", "delete"],
|
|
100
|
+
goal: "Delete conversation",
|
|
101
|
+
context: "Chat History"
|
|
102
|
+
},
|
|
103
|
+
io: {
|
|
104
|
+
input: defineSchemaModel({
|
|
105
|
+
name: "DeleteConversationInput",
|
|
106
|
+
fields: { id: {
|
|
107
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
108
|
+
isOptional: false
|
|
109
|
+
} }
|
|
110
|
+
}),
|
|
111
|
+
output: defineSchemaModel({
|
|
112
|
+
name: "VoidOutput",
|
|
113
|
+
fields: {}
|
|
114
|
+
})
|
|
115
|
+
},
|
|
116
|
+
policy: { auth: "user" }
|
|
117
|
+
});
|
|
118
|
+
const ListProvidersContract = defineQuery({
|
|
119
|
+
meta: {
|
|
120
|
+
key: "ai-chat.providers.list",
|
|
121
|
+
version: 1,
|
|
122
|
+
owners: ["@ai-team"],
|
|
123
|
+
stability: "experimental",
|
|
124
|
+
description: "List available AI providers.",
|
|
125
|
+
tags: ["chat", "providers"],
|
|
126
|
+
goal: "List providers",
|
|
127
|
+
context: "Settings"
|
|
128
|
+
},
|
|
129
|
+
io: {
|
|
130
|
+
input: defineSchemaModel({
|
|
131
|
+
name: "VoidInput2",
|
|
132
|
+
fields: {}
|
|
133
|
+
}),
|
|
134
|
+
output: defineSchemaModel({
|
|
135
|
+
name: "ProviderList",
|
|
136
|
+
fields: { providers: {
|
|
137
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
138
|
+
isArray: true,
|
|
139
|
+
isOptional: false
|
|
140
|
+
} }
|
|
141
|
+
})
|
|
142
|
+
},
|
|
143
|
+
policy: { auth: "user" }
|
|
144
|
+
});
|
|
145
|
+
const ScanContextContract = defineCommand({
|
|
146
|
+
meta: {
|
|
147
|
+
key: "ai-chat.context.scan",
|
|
148
|
+
version: 1,
|
|
149
|
+
owners: ["@ai-team"],
|
|
150
|
+
stability: "experimental",
|
|
151
|
+
description: "Scan workspace context.",
|
|
152
|
+
tags: ["chat", "context"],
|
|
153
|
+
goal: "Scan context",
|
|
154
|
+
context: "Background"
|
|
155
|
+
},
|
|
156
|
+
io: {
|
|
157
|
+
input: defineSchemaModel({
|
|
158
|
+
name: "ScanContextInput",
|
|
159
|
+
fields: { path: {
|
|
160
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
161
|
+
isOptional: false
|
|
162
|
+
} }
|
|
163
|
+
}),
|
|
164
|
+
output: defineSchemaModel({
|
|
165
|
+
name: "VoidOutput2",
|
|
166
|
+
fields: {}
|
|
167
|
+
})
|
|
168
|
+
},
|
|
169
|
+
policy: { auth: "user" }
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
export { DeleteConversationContract, GetConversationContract, ListConversationsContract, ListProvidersContract, ScanContextContract, SendMessageContract, StreamMessageContract };
|
|
174
|
+
//# sourceMappingURL=ai-chat.operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.operations.js","names":[],"sources":["../src/ai-chat.operations.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts';\nimport { ScalarTypeEnum, defineSchemaModel } from '@lssm/lib.schema';\nimport {\n ChatConversationModel,\n ListConversationsOutputModel,\n SendMessageInputModel,\n SendMessageOutputModel,\n} from './schema';\n\nexport const SendMessageContract = defineCommand({\n meta: {\n key: 'ai-chat.send',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'Send a message to the AI chat.',\n tags: ['chat', 'send'],\n goal: 'Send message',\n context: 'Chat UI',\n },\n io: { input: SendMessageInputModel, output: SendMessageOutputModel },\n policy: { auth: 'user' },\n});\n\nconst StreamMessageOutputModel = defineSchemaModel({\n name: 'StreamMessageOutput',\n fields: {\n stream: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // Placeholder for stream content\n },\n});\n\nexport const StreamMessageContract = defineCommand({\n meta: {\n key: 'ai-chat.stream',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'Stream a message response from the AI chat.',\n tags: ['chat', 'stream'],\n goal: 'Stream response',\n context: 'Chat UI',\n },\n io: { input: SendMessageInputModel, output: StreamMessageOutputModel },\n policy: { auth: 'user' },\n});\n\nexport const ListConversationsContract = defineQuery({\n meta: {\n key: 'ai-chat.conversations.list',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'List user conversations.',\n tags: ['chat', 'list'],\n goal: 'List conversations',\n context: 'Chat History',\n },\n io: {\n input: defineSchemaModel({ name: 'VoidInput', fields: {} }),\n output: ListConversationsOutputModel,\n },\n policy: { auth: 'user' },\n});\n\nexport const GetConversationContract = defineQuery({\n meta: {\n key: 'ai-chat.conversations.get',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'Get a specific conversation.',\n tags: ['chat', 'get'],\n goal: 'Get conversation',\n context: 'Chat UI',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetConversationInput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: ChatConversationModel,\n },\n policy: { auth: 'user' },\n});\n\nexport const DeleteConversationContract = defineCommand({\n meta: {\n key: 'ai-chat.conversations.delete',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'Delete a conversation.',\n tags: ['chat', 'delete'],\n goal: 'Delete conversation',\n context: 'Chat History',\n },\n io: {\n input: defineSchemaModel({\n name: 'DeleteConversationInput',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({ name: 'VoidOutput', fields: {} }),\n },\n policy: { auth: 'user' },\n});\n\nexport const ListProvidersContract = defineQuery({\n meta: {\n key: 'ai-chat.providers.list',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'List available AI providers.',\n tags: ['chat', 'providers'],\n goal: 'List providers',\n context: 'Settings',\n },\n io: {\n input: defineSchemaModel({ name: 'VoidInput2', fields: {} }),\n output: defineSchemaModel({\n name: 'ProviderList',\n fields: {\n providers: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: false,\n },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n\nexport const ScanContextContract = defineCommand({\n meta: {\n key: 'ai-chat.context.scan',\n version: 1,\n owners: ['@ai-team'],\n stability: 'experimental',\n description: 'Scan workspace context.',\n tags: ['chat', 'context'],\n goal: 'Scan context',\n context: 'Background',\n },\n io: {\n input: defineSchemaModel({\n name: 'ScanContextInput',\n fields: {\n path: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({ name: 'VoidOutput2', fields: {} }),\n },\n policy: { auth: 'user' },\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { WorkspaceContext } from "./workspace-context.js";
|
|
2
|
+
|
|
3
|
+
//#region src/context/context-builder.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Context entry for a file or spec
|
|
7
|
+
*/
|
|
8
|
+
interface ContextEntry {
|
|
9
|
+
type: 'spec' | 'file' | 'reference';
|
|
10
|
+
path: string;
|
|
11
|
+
content?: string;
|
|
12
|
+
summary?: string;
|
|
13
|
+
relevance: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Built context for LLM
|
|
17
|
+
*/
|
|
18
|
+
interface BuiltContext {
|
|
19
|
+
entries: ContextEntry[];
|
|
20
|
+
summary: string;
|
|
21
|
+
totalTokensEstimate: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Options for building context
|
|
25
|
+
*/
|
|
26
|
+
interface ContextBuilderOptions {
|
|
27
|
+
/** Maximum estimated tokens for context */
|
|
28
|
+
maxTokens?: number;
|
|
29
|
+
/** Query to use for relevance scoring */
|
|
30
|
+
query?: string;
|
|
31
|
+
/** Specific files to include */
|
|
32
|
+
includeFiles?: string[];
|
|
33
|
+
/** Specific specs to include */
|
|
34
|
+
includeSpecs?: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Context builder for creating rich LLM context
|
|
38
|
+
*/
|
|
39
|
+
declare class ContextBuilder {
|
|
40
|
+
private readonly context;
|
|
41
|
+
constructor(context: WorkspaceContext);
|
|
42
|
+
/**
|
|
43
|
+
* Build context for a chat message
|
|
44
|
+
*/
|
|
45
|
+
build(options?: ContextBuilderOptions): BuiltContext;
|
|
46
|
+
/**
|
|
47
|
+
* Build a text summary of the context entries
|
|
48
|
+
*/
|
|
49
|
+
private buildSummary;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a context builder
|
|
53
|
+
*/
|
|
54
|
+
declare function createContextBuilder(context: WorkspaceContext): ContextBuilder;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { BuiltContext, ContextBuilder, ContextBuilderOptions, ContextEntry, createContextBuilder };
|
|
57
|
+
//# sourceMappingURL=context-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-builder.d.ts","names":[],"sources":["../../src/context/context-builder.ts"],"sourcesContent":[],"mappings":";;;;AA0GA;;;AAU8C,UA1G7B,YAAA,CA0G6B;EAAY,IAAA,EAAA,MAAA,GAAA,MAAA,GAAA,WAAA;EAwI1C,IAAA,EAAA,MAAA;;;;;;;;UAvOC,YAAA;WACN;;;;;;;UAQM,qBAAA;;;;;;;;;;;;;cA4EJ,cAAA;;uBAGU;;;;kBAON,wBAA6B;;;;;;;;;iBAwI9B,oBAAA,UACL,mBACR"}
|