@dxos/blueprints 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{browser → neutral}/index.mjs +72 -15
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/types/src/blueprint/blueprint.d.ts +21 -1
- package/dist/types/src/blueprint/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprint/registry.d.ts +49 -1
- package/dist/types/src/blueprint/registry.d.ts.map +1 -1
- package/dist/types/src/prompt/prompt.d.ts +5 -1
- package/dist/types/src/prompt/prompt.d.ts.map +1 -1
- package/dist/types/src/template/prompt.d.ts +1 -1
- package/dist/types/src/template/prompt.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/blueprint/blueprint.ts +27 -1
- package/src/blueprint/registry.ts +37 -2
- package/src/prompt/prompt.ts +7 -3
- package/src/template/prompt.ts +2 -3
- package/src/template/template.ts +2 -2
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/index.mjs +0 -256
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
|
@@ -8,15 +8,20 @@ var __export = (target, all) => {
|
|
|
8
8
|
var blueprint_exports = {};
|
|
9
9
|
__export(blueprint_exports, {
|
|
10
10
|
Blueprint: () => Blueprint,
|
|
11
|
+
McpServer: () => McpServer,
|
|
12
|
+
NotFoundError: () => NotFoundError,
|
|
11
13
|
Registry: () => Registry,
|
|
14
|
+
RegistryService: () => RegistryService,
|
|
12
15
|
make: () => make2,
|
|
13
|
-
|
|
16
|
+
resolve: () => resolve,
|
|
17
|
+
toolDefinitions: () => toolDefinitions,
|
|
18
|
+
upsert: () => upsert
|
|
14
19
|
});
|
|
15
20
|
|
|
16
21
|
// src/blueprint/blueprint.ts
|
|
17
22
|
import * as Schema2 from "effect/Schema";
|
|
18
23
|
import { ToolId } from "@dxos/ai";
|
|
19
|
-
import { Annotation, Obj, Type
|
|
24
|
+
import { Annotation, Obj, Type } from "@dxos/echo";
|
|
20
25
|
|
|
21
26
|
// src/template/index.ts
|
|
22
27
|
var template_exports = {};
|
|
@@ -76,12 +81,12 @@ var processTemplate = (template) => Effect.gen(function* () {
|
|
|
76
81
|
S: this,
|
|
77
82
|
C: (f, a) => f(...a)
|
|
78
83
|
});
|
|
79
|
-
return process((yield* Database.
|
|
84
|
+
return process((yield* Database.load(template.source)).content, variables);
|
|
80
85
|
});
|
|
81
86
|
|
|
82
87
|
// src/template/template.ts
|
|
83
88
|
import * as Schema from "effect/Schema";
|
|
84
|
-
import { Ref
|
|
89
|
+
import { Ref } from "@dxos/echo";
|
|
85
90
|
import { Text } from "@dxos/schema";
|
|
86
91
|
var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
|
|
87
92
|
var Input = Schema.Struct({
|
|
@@ -94,7 +99,7 @@ var Input = Schema.Struct({
|
|
|
94
99
|
function: Schema.optional(Schema.String)
|
|
95
100
|
});
|
|
96
101
|
var Template = Schema.Struct({
|
|
97
|
-
source:
|
|
102
|
+
source: Ref.Ref(Text.Text).annotations({
|
|
98
103
|
description: "Handlebars template source"
|
|
99
104
|
}),
|
|
100
105
|
inputs: Schema.optional(Schema.Array(Input))
|
|
@@ -105,6 +110,17 @@ var make = ({ source, inputs = [], id } = {}) => ({
|
|
|
105
110
|
});
|
|
106
111
|
|
|
107
112
|
// src/blueprint/blueprint.ts
|
|
113
|
+
var McpServer = Schema2.Struct({
|
|
114
|
+
/**
|
|
115
|
+
* URL of the MCP server.
|
|
116
|
+
*/
|
|
117
|
+
url: Schema2.String.annotations({
|
|
118
|
+
description: "URL of the MCP server"
|
|
119
|
+
}),
|
|
120
|
+
protocol: Schema2.Union(Schema2.Literal("sse"), Schema2.Literal("http")).annotations({
|
|
121
|
+
description: "Protocol of the MCP server"
|
|
122
|
+
})
|
|
123
|
+
});
|
|
108
124
|
var Blueprint = Schema2.Struct({
|
|
109
125
|
/**
|
|
110
126
|
* Global registry ID.
|
|
@@ -138,14 +154,21 @@ var Blueprint = Schema2.Struct({
|
|
|
138
154
|
*/
|
|
139
155
|
tools: Schema2.Array(ToolId).annotations({
|
|
140
156
|
description: "Array of tools that the AI assistant can use when this blueprint is active"
|
|
141
|
-
})
|
|
142
|
-
|
|
157
|
+
}),
|
|
158
|
+
/**
|
|
159
|
+
* Array of MCP servers that the AI assistant can use when this blueprint is active.
|
|
160
|
+
*/
|
|
161
|
+
mcpServers: Schema2.optional(Schema2.Array(McpServer))
|
|
162
|
+
}).pipe(Type.object({
|
|
143
163
|
// TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
|
|
144
|
-
typename: "dxos.
|
|
164
|
+
typename: "org.dxos.type.blueprint",
|
|
145
165
|
version: "0.1.0"
|
|
146
166
|
}), Annotation.LabelAnnotation.set([
|
|
147
167
|
"name"
|
|
148
|
-
])
|
|
168
|
+
]), Annotation.IconAnnotation.set({
|
|
169
|
+
icon: "ph--blueprint--regular",
|
|
170
|
+
hue: "sky"
|
|
171
|
+
}));
|
|
149
172
|
var make2 = ({ tools = [], instructions = make(), ...props }) => Obj.make(Blueprint, {
|
|
150
173
|
tools,
|
|
151
174
|
instructions,
|
|
@@ -158,6 +181,10 @@ var toolDefinitions = ({ tools = [], functions = [] }) => [
|
|
|
158
181
|
|
|
159
182
|
// src/blueprint/registry.ts
|
|
160
183
|
import { log as log2 } from "@dxos/log";
|
|
184
|
+
import * as Context from "effect/Context";
|
|
185
|
+
import { BaseError } from "@dxos/errors";
|
|
186
|
+
import * as Effect2 from "effect/Effect";
|
|
187
|
+
import { Database as Database2, Filter, Obj as Obj2 } from "@dxos/echo";
|
|
161
188
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/core/blueprints/src/blueprint/registry.ts";
|
|
162
189
|
var Registry = class {
|
|
163
190
|
_blueprints = [];
|
|
@@ -169,7 +196,7 @@ var Registry = class {
|
|
|
169
196
|
key: blueprint.key
|
|
170
197
|
}, {
|
|
171
198
|
F: __dxlog_file2,
|
|
172
|
-
L:
|
|
199
|
+
L: 22,
|
|
173
200
|
S: this,
|
|
174
201
|
C: (f, a) => f(...a)
|
|
175
202
|
});
|
|
@@ -190,6 +217,33 @@ var Registry = class {
|
|
|
190
217
|
return this._blueprints;
|
|
191
218
|
}
|
|
192
219
|
};
|
|
220
|
+
var RegistryService = class extends Context.Tag("@dxos/blueprints/RegistryService")() {
|
|
221
|
+
};
|
|
222
|
+
var resolve = (key) => Effect2.gen(function* () {
|
|
223
|
+
const registry = yield* RegistryService;
|
|
224
|
+
const blueprint = registry.getByKey(key);
|
|
225
|
+
if (!blueprint) {
|
|
226
|
+
return yield* Effect2.fail(new NotFoundError({
|
|
227
|
+
context: {
|
|
228
|
+
key
|
|
229
|
+
}
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
return blueprint;
|
|
233
|
+
});
|
|
234
|
+
var upsert = (key) => Effect2.gen(function* () {
|
|
235
|
+
const local = yield* Database2.runQuery(Filter.type(Blueprint, {
|
|
236
|
+
key
|
|
237
|
+
}));
|
|
238
|
+
if (local.length > 0) {
|
|
239
|
+
return local[0];
|
|
240
|
+
}
|
|
241
|
+
return yield* Database2.add(Obj2.clone(yield* resolve(key), {
|
|
242
|
+
deep: true
|
|
243
|
+
}));
|
|
244
|
+
});
|
|
245
|
+
var NotFoundError = class extends BaseError.extend("BlueprintNotFound", "Blueprint not found") {
|
|
246
|
+
};
|
|
193
247
|
|
|
194
248
|
// src/prompt/index.ts
|
|
195
249
|
var prompt_exports = {};
|
|
@@ -200,7 +254,7 @@ __export(prompt_exports, {
|
|
|
200
254
|
|
|
201
255
|
// src/prompt/prompt.ts
|
|
202
256
|
import * as Schema3 from "effect/Schema";
|
|
203
|
-
import { Annotation as Annotation2, JsonSchema, Obj as
|
|
257
|
+
import { Annotation as Annotation2, JsonSchema, Obj as Obj3, Ref as Ref2, Type as Type2 } from "@dxos/echo";
|
|
204
258
|
var Prompt = Schema3.Struct({
|
|
205
259
|
/**
|
|
206
260
|
* Name of the prompt.
|
|
@@ -227,16 +281,19 @@ var Prompt = Schema3.Struct({
|
|
|
227
281
|
/**
|
|
228
282
|
* Blueprints that the prompt may utilize.
|
|
229
283
|
*/
|
|
230
|
-
blueprints: Schema3.Array(
|
|
284
|
+
blueprints: Schema3.Array(Ref2.Ref(Blueprint)),
|
|
231
285
|
/**
|
|
232
286
|
* Additional context that the prompt may utilize.
|
|
233
287
|
*/
|
|
234
288
|
context: Schema3.Array(Schema3.Any).pipe(Annotation2.FormInputAnnotation.set(false))
|
|
235
|
-
}).pipe(
|
|
236
|
-
typename: "dxos.
|
|
289
|
+
}).pipe(Type2.object({
|
|
290
|
+
typename: "org.dxos.type.prompt",
|
|
237
291
|
version: "0.1.0"
|
|
292
|
+
}), Annotation2.IconAnnotation.set({
|
|
293
|
+
icon: "ph--scroll--regular",
|
|
294
|
+
hue: "sky"
|
|
238
295
|
}));
|
|
239
|
-
var make3 = (params) =>
|
|
296
|
+
var make3 = (params) => Obj3.make(Prompt, {
|
|
240
297
|
name: params.name,
|
|
241
298
|
description: params.description,
|
|
242
299
|
input: JsonSchema.toJsonSchema(params.input ?? Schema3.Void),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprint/index.ts", "../../../src/blueprint/blueprint.ts", "../../../src/template/index.ts", "../../../src/template/prompt.ts", "../../../src/template/template.ts", "../../../src/blueprint/registry.ts", "../../../src/prompt/index.ts", "../../../src/prompt/prompt.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './blueprint';\nexport * from './registry';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { ToolId } from '@dxos/ai';\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { type FunctionDefinition } from '@dxos/functions';\n\nimport * as Template from '../template';\n\n/**\n * MCP server definition.\n */\nexport const McpServer = Schema.Struct({\n /**\n * URL of the MCP server.\n */\n url: Schema.String.annotations({\n description: 'URL of the MCP server',\n }),\n\n protocol: Schema.Union(Schema.Literal('sse'), Schema.Literal('http')).annotations({\n description: 'Protocol of the MCP server',\n }),\n});\nexport interface McpServer extends Schema.Schema.Type<typeof McpServer> {}\n\n/**\n * Blueprint schema defines the structure for AI assistant blueprints.\n * Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.\n * Blueprints may use tools to create and read artifacts, which are managed by the assistant.\n */\nexport const Blueprint = Schema.Struct({\n /**\n * Global registry ID.\n * NOTE: The `key` property refers to the original registry entry.\n */\n // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.\n key: Schema.String.annotations({\n description: 'Unique registration key for the blueprint',\n }),\n\n /**\n * Human-readable name of the blueprint.\n */\n name: Schema.String.annotations({\n description: 'Human-readable name of the blueprint',\n }),\n\n /**\n * Description of the blueprint's purpose and functionality.\n */\n description: Schema.optional(Schema.String).annotations({\n description: \"Description of the blueprint's purpose and functionality\",\n }),\n\n /**\n * Instructions that guide the AI assistant's behavior and responses.\n * These are system prompts or guidelines that the AI should follow.\n */\n instructions: Template.Template.annotations({\n description: \"Instructions that guide the AI assistant's behavior and responses\",\n }),\n\n /**\n * Array of tools that the AI assistant can use when this blueprint is active.\n */\n tools: Schema.Array(ToolId).annotations({\n description: 'Array of tools that the AI assistant can use when this blueprint is active',\n }),\n\n /**\n * Array of MCP servers that the AI assistant can use when this blueprint is active.\n */\n mcpServers: Schema.optional(Schema.Array(McpServer)),\n}).pipe(\n Type.object({\n // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.\n typename: 'org.dxos.type.blueprint',\n version: '0.1.0',\n }),\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--blueprint--regular',\n hue: 'sky',\n }),\n);\n\n/**\n * TypeScript type for Blueprint.\n */\nexport interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {}\n\ntype MakeProps = Pick<Blueprint, 'key' | 'name'> & Partial<Blueprint>;\n\n/**\n * Create a new Blueprint.\n */\nexport const make = ({ tools = [], instructions = Template.make(), ...props }: MakeProps) =>\n Obj.make(Blueprint, {\n tools,\n instructions,\n ...props,\n });\n\n/**\n * Util to create tool definitions for a blueprint.\n */\nexport const toolDefinitions = ({\n tools = [],\n functions = [],\n}: {\n tools?: string[];\n functions?: FunctionDefinition[];\n}) => [...functions.map((fn) => ToolId.make(fn.key)), ...tools.map((tool) => ToolId.make(tool))];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './prompt';\nexport * from './template';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Record from 'effect/Record';\nimport handlebars from 'handlebars';\n\nimport { Database } from '@dxos/echo';\nimport type { ObjectNotFoundError } from '@dxos/echo/Err';\nimport {\n type FunctionDefinition,\n FunctionInvocationService,\n type FunctionNotFoundError,\n type TracingService,\n} from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport type { Template } from '../index';\n\n/**\n * Process Handlebars template.\n */\nexport const process = <Options extends {}>(source: string, variables: Partial<Options> = {}): string => {\n invariant(typeof source === 'string');\n let section = 0;\n handlebars.registerHelper('section', () => String(++section));\n const template = handlebars.compile(source.trim());\n const output = template(variables);\n return output.trim().replace(/(\\n\\s*){3,}/g, '\\n\\n');\n};\n\nexport const processTemplate = (\n template: Template.Template,\n): Effect.Effect<string, ObjectNotFoundError | FunctionNotFoundError, FunctionInvocationService | TracingService> =>\n Effect.gen(function* () {\n const functionInvoker = yield* FunctionInvocationService;\n\n const variables = yield* Effect.forEach(template.inputs ?? [], (input) =>\n Effect.gen(function* () {\n if (input.kind === 'function') {\n const fn = (yield* functionInvoker.resolveFunction(input.function!)) as FunctionDefinition<\n {},\n unknown,\n never\n >;\n const result = yield* functionInvoker.invokeFunction(fn, {});\n return [input.name, result] as const;\n } else {\n return yield* Effect.dieMessage(`Unsupported input kind: ${input.kind}`);\n }\n }),\n ).pipe(Effect.map(Record.fromEntries));\n\n log('processTemplate', { variables });\n return process((yield* Database.load(template.source)).content, variables);\n });\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Ref } from '@dxos/echo';\nimport { type ObjectId } from '@dxos/keys';\nimport { Text } from '@dxos/schema';\n\n/**\n * Template input kind determines how template variables are resolved.\n */\nexport const InputKind = Schema.Literal(\n 'value', // Literal value.\n 'pass-through',\n 'retriever',\n 'function',\n 'query',\n 'resolver',\n 'context',\n 'schema',\n);\n\nexport type InputKind = Schema.Schema.Type<typeof InputKind>;\n\n/**\n * Template input variable.\n * E.g., {{foo}}\n */\nexport const Input = Schema.Struct({\n name: Schema.String,\n kind: Schema.optional(InputKind),\n default: Schema.optional(Schema.Any),\n\n /**\n * Function to call if the kind is 'function'.\n */\n function: Schema.optional(Schema.String),\n});\n\nexport type Input = Schema.Schema.Type<typeof Input>;\n\n/**\n * Template type.\n */\nexport const Template = Schema.Struct({\n source: Ref.Ref(Text.Text).annotations({ description: 'Handlebars template source' }),\n inputs: Schema.optional(Schema.Array(Input)),\n});\n\nexport interface Template extends Schema.Schema.Type<typeof Template> {}\n\nexport const make = ({\n source,\n inputs = [],\n id,\n}: { source?: string; inputs?: Input[]; id?: ObjectId } = {}): Template => ({\n source: Ref.make(Text.make(source, id)),\n inputs,\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { log } from '@dxos/log';\n\nimport { Blueprint } from './blueprint';\nimport * as Context from 'effect/Context';\nimport { BaseError } from '@dxos/errors';\nimport * as Effect from 'effect/Effect';\nimport { Database, Filter, Obj } from '@dxos/echo';\n/**\n * Blueprint registry.\n */\nexport class Registry {\n private readonly _blueprints: Blueprint[] = [];\n\n constructor(blueprints: Blueprint[]) {\n const seen = new Set<string>();\n blueprints.forEach((blueprint) => {\n if (seen.has(blueprint.key)) {\n log.warn('duplicate blueprint', { key: blueprint.key });\n } else {\n seen.add(blueprint.key);\n this._blueprints.push(blueprint);\n }\n });\n\n this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));\n }\n\n get blueprints(): Blueprint[] {\n return this._blueprints;\n }\n\n getByKey(key: string): Blueprint | undefined {\n return this._blueprints.find((blueprint) => blueprint.key === key);\n }\n\n query(): Blueprint[] {\n return this._blueprints;\n }\n}\n\nexport class RegistryService extends Context.Tag('@dxos/blueprints/RegistryService')<RegistryService, Registry>() {}\n\n/**\n * Resolves a blueprint from the registry.\n * Does not check the local database for the blueprint.\n */\nexport const resolve = (key: string): Effect.Effect<Blueprint, NotFoundError, RegistryService> =>\n Effect.gen(function* () {\n const registry = yield* RegistryService;\n const blueprint = registry.getByKey(key);\n if (!blueprint) {\n return yield* Effect.fail(new NotFoundError({ context: { key } }));\n }\n return blueprint;\n });\n\n/**\n * Upserts a blueprint into the database.\n * If the blueprint already exists in the database, local blueprint is returned.\n * Otherwise, it will be added.\n */\nexport const upsert = (key: string): Effect.Effect<Blueprint, NotFoundError, RegistryService | Database.Service> =>\n Effect.gen(function* () {\n const local = yield* Database.runQuery(Filter.type(Blueprint, { key }));\n if (local.length > 0) {\n return local[0];\n }\n return yield* Database.add(Obj.clone(yield* resolve(key), { deep: true }));\n });\n\nexport class NotFoundError extends BaseError.extend('BlueprintNotFound', 'Blueprint not found') {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './prompt';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, JsonSchema, Obj, Ref, Type } from '@dxos/echo';\n\nimport { Blueprint } from '../blueprint';\nimport * as Template from '../template';\n\n/**\n * Executable instructions, which may use Blueprints.\n * May reference additional context.\n */\nexport const Prompt = Schema.Struct({\n /**\n * Name of the prompt.\n */\n name: Schema.optional(Schema.String),\n\n /**\n * Description of the prompt's purpose and functionality.\n * Allows AI agents to execute prompts automatically as tools.\n */\n description: Schema.optional(Schema.String),\n\n /**\n * Input schema of the prompt.\n */\n input: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)),\n\n /**\n * Output schema of the prompt.\n */\n output: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)),\n\n /**\n * Natural language instructions for the prompt.\n * These should provide concrete course of action for the AI to follow.\n */\n instructions: Template.Template.pipe(Annotation.FormInputAnnotation.set(false)),\n\n /**\n * Blueprints that the prompt may utilize.\n */\n blueprints: Schema.Array(Ref.Ref(Blueprint)),\n\n /**\n * Additional context that the prompt may utilize.\n */\n context: Schema.Array(Schema.Any).pipe(Annotation.FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.prompt',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--scroll--regular',\n hue: 'sky',\n }),\n);\n\nexport interface Prompt extends Schema.Schema.Type<typeof Prompt> {}\n\nexport const make = (params: {\n name?: string;\n description?: string;\n input?: Schema.Schema.AnyNoContext;\n output?: Schema.Schema.AnyNoContext;\n instructions?: string;\n blueprints?: Ref.Ref<Blueprint>[];\n context?: any[];\n}): Prompt =>\n Obj.make(Prompt, {\n name: params.name,\n description: params.description,\n input: JsonSchema.toJsonSchema(params.input ?? Schema.Void),\n output: JsonSchema.toJsonSchema(params.output ?? Schema.Void),\n instructions: Template.make({ source: params.instructions }),\n blueprints: params.blueprints ?? [],\n context: params.context ?? [],\n });\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAAA;;;;;;;cAAAA;EAAA;;;;;;ACIA,YAAYC,aAAY;AAExB,SAASC,cAAc;AACvB,SAASC,YAAYC,KAAKC,YAAY;;;ACPtC;;;;;;;;;;;ACIA,YAAYC,YAAY;AACxB,YAAYC,YAAY;AACxB,OAAOC,gBAAgB;AAEvB,SAASC,gBAAgB;AAEzB,SAEEC,iCAGK;AACP,SAASC,iBAAiB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WgB,eAAed,IAAI;EAC5Be,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,QAAO,CAACC,WASnBC,KAAIF,KAAK5B,QAAQ;EACfE,MAAM2B,OAAO3B;EACbG,aAAawB,OAAOxB;EACpBC,OAAOC,WAAWwB,aAAaF,OAAOvB,SAAgB0B,YAAI;EAC1DpB,QAAQL,WAAWwB,aAAaF,OAAOjB,UAAiBoB,YAAI;EAC5DnB,cAAuBe,KAAK;IAAEK,QAAQJ,OAAOhB;EAAa,CAAA;EAC1DE,YAAYc,OAAOd,cAAc,CAAA;EACjCI,SAASU,OAAOV,WAAW,CAAA;AAC7B,CAAA;",
|
|
6
|
+
"names": ["make", "Schema", "ToolId", "Annotation", "Obj", "Type", "Effect", "Record", "handlebars", "Database", "FunctionInvocationService", "invariant", "log", "process", "source", "variables", "section", "registerHelper", "String", "template", "compile", "trim", "output", "replace", "processTemplate", "gen", "functionInvoker", "forEach", "inputs", "input", "kind", "fn", "resolveFunction", "function", "result", "invokeFunction", "name", "dieMessage", "pipe", "map", "fromEntries", "load", "content", "Schema", "Ref", "Text", "InputKind", "Literal", "Input", "Struct", "name", "String", "kind", "optional", "default", "Any", "function", "Template", "source", "Ref", "Text", "annotations", "description", "inputs", "Array", "make", "id", "McpServer", "Struct", "url", "String", "annotations", "description", "protocol", "Union", "Literal", "Blueprint", "key", "name", "optional", "instructions", "Template", "tools", "Array", "ToolId", "mcpServers", "pipe", "Type", "object", "typename", "version", "Annotation", "LabelAnnotation", "set", "IconAnnotation", "icon", "hue", "make", "props", "Obj", "toolDefinitions", "functions", "map", "fn", "tool", "log", "Context", "BaseError", "Effect", "Database", "Filter", "Obj", "Registry", "_blueprints", "blueprints", "seen", "Set", "forEach", "blueprint", "has", "key", "log", "warn", "add", "push", "sort", "name", "a", "b", "localeCompare", "getByKey", "find", "query", "RegistryService", "Tag", "resolve", "gen", "registry", "fail", "NotFoundError", "context", "upsert", "local", "runQuery", "type", "Blueprint", "length", "clone", "deep", "extend", "make", "Schema", "Annotation", "JsonSchema", "Obj", "Ref", "Type", "Prompt", "Struct", "name", "optional", "String", "description", "input", "JsonSchema", "pipe", "Annotation", "FormInputAnnotation", "set", "output", "instructions", "Template", "blueprints", "Array", "Ref", "Blueprint", "context", "Any", "Type", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "params", "Obj", "toJsonSchema", "Void", "source"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/template/prompt.ts":{"bytes":6880,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/template/template.ts":{"bytes":4411,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/template/index.ts":{"bytes":546,"imports":[{"path":"src/template/prompt.ts","kind":"import-statement","original":"./prompt"},{"path":"src/template/template.ts","kind":"import-statement","original":"./template"}],"format":"esm"},"src/blueprint/blueprint.ts":{"bytes":10282,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/blueprint/registry.ts":{"bytes":8314,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/blueprint/blueprint.ts","kind":"import-statement","original":"./blueprint"},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/blueprint/index.ts":{"bytes":554,"imports":[{"path":"src/blueprint/blueprint.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/blueprint/registry.ts","kind":"import-statement","original":"./registry"}],"format":"esm"},"src/prompt/prompt.ts":{"bytes":7400,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/blueprint/index.ts","kind":"import-statement","original":"../blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/prompt/index.ts":{"bytes":456,"imports":[{"path":"src/prompt/prompt.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"},"src/index.ts":{"bytes":813,"imports":[{"path":"src/blueprint/index.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"./template"},{"path":"src/prompt/index.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18961},"dist/lib/neutral/index.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["Blueprint","Prompt","Template"],"entryPoint":"src/index.ts","inputs":{"src/blueprint/index.ts":{"bytesInOutput":342},"src/blueprint/blueprint.ts":{"bytesInOutput":2368},"src/template/index.ts":{"bytesInOutput":227},"src/template/prompt.ts":{"bytesInOutput":1634},"src/template/template.ts":{"bytesInOutput":754},"src/blueprint/registry.ts":{"bytesInOutput":1842},"src/index.ts":{"bytesInOutput":0},"src/prompt/index.ts":{"bytesInOutput":100},"src/prompt/prompt.ts":{"bytesInOutput":1685}},"bytes":9509}}}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
2
|
import { Obj, Type } from '@dxos/echo';
|
|
3
3
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
4
|
+
/**
|
|
5
|
+
* MCP server definition.
|
|
6
|
+
*/
|
|
7
|
+
export declare const McpServer: Schema.Struct<{
|
|
8
|
+
/**
|
|
9
|
+
* URL of the MCP server.
|
|
10
|
+
*/
|
|
11
|
+
url: Schema.SchemaClass<string, string, never>;
|
|
12
|
+
protocol: Schema.Union<[Schema.Literal<["sse"]>, Schema.Literal<["http"]>]>;
|
|
13
|
+
}>;
|
|
14
|
+
export interface McpServer extends Schema.Schema.Type<typeof McpServer> {
|
|
15
|
+
}
|
|
4
16
|
/**
|
|
5
17
|
* Blueprint schema defines the structure for AI assistant blueprints.
|
|
6
18
|
* Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.
|
|
@@ -22,6 +34,10 @@ export declare const Blueprint: Type.Obj<{
|
|
|
22
34
|
}[] | undefined;
|
|
23
35
|
};
|
|
24
36
|
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
37
|
+
readonly mcpServers?: readonly {
|
|
38
|
+
readonly url: string;
|
|
39
|
+
readonly protocol: "sse" | "http";
|
|
40
|
+
}[] | undefined;
|
|
25
41
|
}, Schema.Struct.Fields>;
|
|
26
42
|
/**
|
|
27
43
|
* TypeScript type for Blueprint.
|
|
@@ -32,7 +48,7 @@ type MakeProps = Pick<Blueprint, 'key' | 'name'> & Partial<Blueprint>;
|
|
|
32
48
|
/**
|
|
33
49
|
* Create a new Blueprint.
|
|
34
50
|
*/
|
|
35
|
-
export declare const make: ({ tools, instructions, ...props }: MakeProps) => Obj.
|
|
51
|
+
export declare const make: ({ tools, instructions, ...props }: MakeProps) => Obj.OfShape<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
36
52
|
readonly description?: string | undefined;
|
|
37
53
|
readonly name: string;
|
|
38
54
|
readonly key: string;
|
|
@@ -48,6 +64,10 @@ export declare const make: ({ tools, instructions, ...props }: MakeProps) => Obj
|
|
|
48
64
|
}[] | undefined;
|
|
49
65
|
};
|
|
50
66
|
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
67
|
+
readonly mcpServers?: readonly {
|
|
68
|
+
readonly url: string;
|
|
69
|
+
readonly protocol: "sse" | "http";
|
|
70
|
+
}[] | undefined;
|
|
51
71
|
}>;
|
|
52
72
|
/**
|
|
53
73
|
* Util to create tool definitions for a blueprint.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/blueprint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAc,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D;;;;GAIG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/blueprint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAc,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D;;GAEG;AACH,eAAO,MAAM,SAAS;IACpB;;OAEG;;;EAQH,CAAC;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG;AAE1E;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;wBAsDrB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG;AAE1E,KAAK,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,mCAA0D,SAAS;;;;;;;;;;;;;;;;;;;;EAKpF,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,uBAG7B;IACD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC,wDAA+F,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Blueprint } from './blueprint';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import { BaseError } from '@dxos/errors';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import { Database } from '@dxos/echo';
|
|
2
6
|
/**
|
|
3
7
|
* Blueprint registry.
|
|
4
8
|
*/
|
|
@@ -9,4 +13,48 @@ export declare class Registry {
|
|
|
9
13
|
getByKey(key: string): Blueprint | undefined;
|
|
10
14
|
query(): Blueprint[];
|
|
11
15
|
}
|
|
16
|
+
declare const RegistryService_base: Context.TagClass<RegistryService, "@dxos/blueprints/RegistryService", Registry>;
|
|
17
|
+
export declare class RegistryService extends RegistryService_base {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolves a blueprint from the registry.
|
|
21
|
+
* Does not check the local database for the blueprint.
|
|
22
|
+
*/
|
|
23
|
+
export declare const resolve: (key: string) => Effect.Effect<Blueprint, NotFoundError, RegistryService>;
|
|
24
|
+
/**
|
|
25
|
+
* Upserts a blueprint into the database.
|
|
26
|
+
* If the blueprint already exists in the database, local blueprint is returned.
|
|
27
|
+
* Otherwise, it will be added.
|
|
28
|
+
*/
|
|
29
|
+
export declare const upsert: (key: string) => Effect.Effect<Blueprint, NotFoundError, RegistryService | Database.Service>;
|
|
30
|
+
declare const NotFoundError_base: {
|
|
31
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
32
|
+
name: "BlueprintNotFound";
|
|
33
|
+
context: Record<string, unknown>;
|
|
34
|
+
readonly message: string;
|
|
35
|
+
readonly _tag: "BlueprintNotFound";
|
|
36
|
+
stack?: string;
|
|
37
|
+
cause?: unknown;
|
|
38
|
+
};
|
|
39
|
+
name: "BlueprintNotFound";
|
|
40
|
+
is(error: unknown): error is BaseError;
|
|
41
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
|
|
42
|
+
ifTypeDiffers?: boolean;
|
|
43
|
+
}): (error: unknown) => {
|
|
44
|
+
name: "BlueprintNotFound";
|
|
45
|
+
context: Record<string, unknown>;
|
|
46
|
+
readonly message: string;
|
|
47
|
+
readonly _tag: "BlueprintNotFound";
|
|
48
|
+
stack?: string;
|
|
49
|
+
cause?: unknown;
|
|
50
|
+
};
|
|
51
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
52
|
+
isError(error: unknown): error is Error;
|
|
53
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
54
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
55
|
+
stackTraceLimit: number;
|
|
56
|
+
};
|
|
57
|
+
export declare class NotFoundError extends NotFoundError_base {
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
12
60
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAe,MAAM,YAAY,CAAC;AACnD;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAEnC,UAAU,EAAE,SAAS,EAAE;IAcnC,IAAI,UAAU,IAAI,SAAS,EAAE,CAE5B;IAED,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5C,KAAK,IAAI,SAAS,EAAE;CAGrB;;AAED,qBAAa,eAAgB,SAAQ,oBAA4E;CAAG;AAEpH;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,eAAe,CAQzF,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,eAAe,GAAG,QAAQ,CAAC,OAAO,CAO3G,CAAC;;;;;;;;;;;;;qBA5B8D,CAAC;;;;;;;;;;;;;;;AA8BpE,qBAAa,aAAc,SAAQ,kBAA4D;CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
-
import {
|
|
2
|
+
import { Ref, Type } from '@dxos/echo';
|
|
3
3
|
import { Blueprint } from '../blueprint';
|
|
4
4
|
/**
|
|
5
5
|
* Executable instructions, which may use Blueprints.
|
|
@@ -38,6 +38,10 @@ export declare const Prompt: Type.Obj<{
|
|
|
38
38
|
}[] | undefined;
|
|
39
39
|
};
|
|
40
40
|
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
41
|
+
readonly mcpServers?: readonly {
|
|
42
|
+
readonly url: string;
|
|
43
|
+
readonly protocol: "sse" | "http";
|
|
44
|
+
}[] | undefined;
|
|
41
45
|
}>[];
|
|
42
46
|
}, Schema.Struct.Fields>;
|
|
43
47
|
export interface Prompt extends Schema.Schema.Type<typeof Prompt> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAA+B,
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAA+B,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8ClB,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,eAAO,MAAM,IAAI,GAAI,QAAQ;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB,KAAG,MASA,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import type { ObjectNotFoundError } from '@dxos/echo/Err';
|
|
3
3
|
import { FunctionInvocationService, type FunctionNotFoundError, type TracingService } from '@dxos/functions';
|
|
4
|
-
import type { Template } from '
|
|
4
|
+
import type { Template } from '../index';
|
|
5
5
|
/**
|
|
6
6
|
* Process Handlebars template.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/template/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAEL,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/template/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAEL,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,EAAE,EAAE,QAAQ,MAAM,EAAE,YAAW,OAAO,CAAC,OAAO,CAAM,KAAG,MAO9F,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,UAAU,QAAQ,CAAC,QAAQ,KAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,qBAAqB,EAAE,yBAAyB,GAAG,cAAc,CAsB5G,CAAC"}
|