@dxos/blueprints 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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.
@@ -8,6 +8,7 @@ var __export = (target, all) => {
8
8
  var blueprint_exports = {};
9
9
  __export(blueprint_exports, {
10
10
  Blueprint: () => Blueprint,
11
+ McpServer: () => McpServer,
11
12
  Registry: () => Registry,
12
13
  make: () => make2,
13
14
  toolDefinitions: () => toolDefinitions
@@ -16,8 +17,7 @@ __export(blueprint_exports, {
16
17
  // src/blueprint/blueprint.ts
17
18
  import * as Schema2 from "effect/Schema";
18
19
  import { ToolId } from "@dxos/ai";
19
- import { Obj, Type as Type2 } from "@dxos/echo";
20
- import { LabelAnnotation } from "@dxos/echo/internal";
20
+ import { Annotation, Obj, Type } from "@dxos/echo";
21
21
 
22
22
  // src/template/index.ts
23
23
  var template_exports = {};
@@ -26,17 +26,23 @@ __export(template_exports, {
26
26
  InputKind: () => InputKind,
27
27
  Template: () => Template,
28
28
  make: () => make,
29
- process: () => process
29
+ process: () => process,
30
+ processTemplate: () => processTemplate
30
31
  });
31
32
 
32
33
  // src/template/prompt.ts
34
+ import * as Effect from "effect/Effect";
35
+ import * as Record from "effect/Record";
33
36
  import handlebars from "handlebars";
37
+ import { Database } from "@dxos/echo";
38
+ import { FunctionInvocationService } from "@dxos/functions";
34
39
  import { invariant } from "@dxos/invariant";
40
+ import { log } from "@dxos/log";
35
41
  var __dxlog_file = "/__w/dxos/dxos/packages/core/blueprints/src/template/prompt.ts";
36
42
  var process = (source, variables = {}) => {
37
43
  invariant(typeof source === "string", void 0, {
38
44
  F: __dxlog_file,
39
- L: 13,
45
+ L: 26,
40
46
  S: void 0,
41
47
  A: [
42
48
  "typeof source === 'string'",
@@ -49,29 +55,68 @@ var process = (source, variables = {}) => {
49
55
  const output = template(variables);
50
56
  return output.trim().replace(/(\n\s*){3,}/g, "\n\n");
51
57
  };
58
+ var processTemplate = (template) => Effect.gen(function* () {
59
+ const functionInvoker = yield* FunctionInvocationService;
60
+ const variables = yield* Effect.forEach(template.inputs ?? [], (input) => Effect.gen(function* () {
61
+ if (input.kind === "function") {
62
+ const fn = yield* functionInvoker.resolveFunction(input.function);
63
+ const result = yield* functionInvoker.invokeFunction(fn, {});
64
+ return [
65
+ input.name,
66
+ result
67
+ ];
68
+ } else {
69
+ return yield* Effect.dieMessage(`Unsupported input kind: ${input.kind}`);
70
+ }
71
+ })).pipe(Effect.map(Record.fromEntries));
72
+ log("processTemplate", {
73
+ variables
74
+ }, {
75
+ F: __dxlog_file,
76
+ L: 56,
77
+ S: this,
78
+ C: (f, a) => f(...a)
79
+ });
80
+ return process((yield* Database.load(template.source)).content, variables);
81
+ });
52
82
 
53
83
  // src/template/template.ts
54
84
  import * as Schema from "effect/Schema";
55
- import { Ref, Type } from "@dxos/echo";
56
- import { DataType } from "@dxos/schema";
85
+ import { Ref } from "@dxos/echo";
86
+ import { Text } from "@dxos/schema";
57
87
  var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
58
- var Input = Schema.mutable(Schema.Struct({
88
+ var Input = Schema.Struct({
59
89
  name: Schema.String,
60
90
  kind: Schema.optional(InputKind),
61
- default: Schema.optional(Schema.Any)
62
- }));
91
+ default: Schema.optional(Schema.Any),
92
+ /**
93
+ * Function to call if the kind is 'function'.
94
+ */
95
+ function: Schema.optional(Schema.String)
96
+ });
63
97
  var Template = Schema.Struct({
64
- source: Type.Ref(DataType.Text).annotations({
98
+ source: Ref.Ref(Text.Text).annotations({
65
99
  description: "Handlebars template source"
66
100
  }),
67
- inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
68
- }).pipe(Schema.mutable);
69
- var make = ({ source, inputs = [], id }) => ({
70
- source: Ref.make(DataType.makeText(source, id)),
101
+ inputs: Schema.optional(Schema.Array(Input))
102
+ });
103
+ var make = ({ source, inputs = [], id } = {}) => ({
104
+ source: Ref.make(Text.make(source, id)),
71
105
  inputs
72
106
  });
73
107
 
74
108
  // src/blueprint/blueprint.ts
109
+ var McpServer = Schema2.Struct({
110
+ /**
111
+ * URL of the MCP server.
112
+ */
113
+ url: Schema2.String.annotations({
114
+ description: "URL of the MCP server"
115
+ }),
116
+ protocol: Schema2.Union(Schema2.Literal("sse"), Schema2.Literal("http")).annotations({
117
+ description: "Protocol of the MCP server"
118
+ })
119
+ });
75
120
  var Blueprint = Schema2.Struct({
76
121
  /**
77
122
  * Global registry ID.
@@ -105,20 +150,24 @@ var Blueprint = Schema2.Struct({
105
150
  */
106
151
  tools: Schema2.Array(ToolId).annotations({
107
152
  description: "Array of tools that the AI assistant can use when this blueprint is active"
108
- })
109
- }).pipe(
110
- Type2.Obj({
111
- // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
112
- typename: "dxos.org/type/Blueprint",
113
- version: "0.1.0"
114
153
  }),
115
- // TODO(burdon): Move to Type.Obj def?
116
- LabelAnnotation.set([
117
- "name"
118
- ])
119
- );
120
- var make2 = ({ tools = [], ...props }) => Obj.make(Blueprint, {
154
+ /**
155
+ * Array of MCP servers that the AI assistant can use when this blueprint is active.
156
+ */
157
+ mcpServers: Schema2.optional(Schema2.Array(McpServer))
158
+ }).pipe(Type.object({
159
+ // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
160
+ typename: "dxos.org/type/Blueprint",
161
+ version: "0.1.0"
162
+ }), Annotation.LabelAnnotation.set([
163
+ "name"
164
+ ]), Annotation.IconAnnotation.set({
165
+ icon: "ph--blueprint--regular",
166
+ hue: "blue"
167
+ }));
168
+ var make2 = ({ tools = [], instructions = make(), ...props }) => Obj.make(Blueprint, {
121
169
  tools,
170
+ instructions,
122
171
  ...props
123
172
  });
124
173
  var toolDefinitions = ({ tools = [], functions = [] }) => [
@@ -127,34 +176,15 @@ var toolDefinitions = ({ tools = [], functions = [] }) => [
127
176
  ];
128
177
 
129
178
  // src/blueprint/registry.ts
130
- import { log } from "@dxos/log";
131
- function _define_property(obj, key, value) {
132
- if (key in obj) {
133
- Object.defineProperty(obj, key, {
134
- value,
135
- enumerable: true,
136
- configurable: true,
137
- writable: true
138
- });
139
- } else {
140
- obj[key] = value;
141
- }
142
- return obj;
143
- }
179
+ import { log as log2 } from "@dxos/log";
144
180
  var __dxlog_file2 = "/__w/dxos/dxos/packages/core/blueprints/src/blueprint/registry.ts";
145
181
  var Registry = class {
146
- getByKey(key) {
147
- return this._blueprints.find((blueprint) => blueprint.key === key);
148
- }
149
- query() {
150
- return this._blueprints;
151
- }
182
+ _blueprints = [];
152
183
  constructor(blueprints) {
153
- _define_property(this, "_blueprints", []);
154
184
  const seen = /* @__PURE__ */ new Set();
155
185
  blueprints.forEach((blueprint) => {
156
186
  if (seen.has(blueprint.key)) {
157
- log.warn("duplicate blueprint", {
187
+ log2.warn("duplicate blueprint", {
158
188
  key: blueprint.key
159
189
  }, {
160
190
  F: __dxlog_file2,
@@ -169,6 +199,15 @@ var Registry = class {
169
199
  });
170
200
  this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
171
201
  }
202
+ get blueprints() {
203
+ return this._blueprints;
204
+ }
205
+ getByKey(key) {
206
+ return this._blueprints.find((blueprint) => blueprint.key === key);
207
+ }
208
+ query() {
209
+ return this._blueprints;
210
+ }
172
211
  };
173
212
 
174
213
  // src/prompt/index.ts
@@ -180,13 +219,12 @@ __export(prompt_exports, {
180
219
 
181
220
  // src/prompt/prompt.ts
182
221
  import * as Schema3 from "effect/Schema";
183
- import { Obj as Obj2, Type as Type3 } from "@dxos/echo";
184
- import { JsonSchemaType, toJsonSchema } from "@dxos/echo/internal";
185
- var Prompt_ = Schema3.Struct({
222
+ import { Annotation as Annotation2, JsonSchema, Obj as Obj2, Ref as Ref2, Type as Type2 } from "@dxos/echo";
223
+ var Prompt = Schema3.Struct({
186
224
  /**
187
225
  * Name of the prompt.
188
226
  */
189
- name: Schema3.String,
227
+ name: Schema3.optional(Schema3.String),
190
228
  /**
191
229
  * Description of the prompt's purpose and functionality.
192
230
  * Allows AI agents to execute prompts automatically as tools.
@@ -195,37 +233,41 @@ var Prompt_ = Schema3.Struct({
195
233
  /**
196
234
  * Input schema of the prompt.
197
235
  */
198
- input: JsonSchemaType,
236
+ input: JsonSchema.JsonSchema.pipe(Annotation2.FormInputAnnotation.set(false)),
199
237
  /**
200
238
  * Output schema of the prompt.
201
239
  */
202
- output: JsonSchemaType,
240
+ output: JsonSchema.JsonSchema.pipe(Annotation2.FormInputAnnotation.set(false)),
203
241
  /**
204
242
  * Natural language instructions for the prompt.
205
243
  * These should provide concrete course of action for the AI to follow.
206
244
  */
207
- instructions: Schema3.String,
245
+ instructions: Template.pipe(Annotation2.FormInputAnnotation.set(false)),
208
246
  /**
209
247
  * Blueprints that the prompt may utilize.
210
248
  */
211
- blueprints: Schema3.Array(Type3.Ref(Blueprint)),
249
+ blueprints: Schema3.Array(Ref2.Ref(Blueprint)),
212
250
  /**
213
251
  * Additional context that the prompt may utilize.
214
252
  */
215
- context: Schema3.Array(Schema3.Any)
216
- }).pipe(Type3.Obj({
253
+ context: Schema3.Array(Schema3.Any).pipe(Annotation2.FormInputAnnotation.set(false))
254
+ }).pipe(Type2.object({
217
255
  typename: "dxos.org/type/Prompt",
218
256
  version: "0.1.0"
257
+ }), Annotation2.IconAnnotation.set({
258
+ icon: "ph--scroll--regular",
259
+ hue: "blue"
219
260
  }));
220
- var Prompt = Prompt_;
221
- var make3 = (opts) => Obj2.make(Prompt, {
222
- name: opts.name,
223
- description: opts.description,
224
- input: toJsonSchema(opts.input),
225
- output: toJsonSchema(opts.output),
226
- instructions: opts.instructions,
227
- blueprints: opts.blueprints ?? [],
228
- context: opts.context ?? []
261
+ var make3 = (params) => Obj2.make(Prompt, {
262
+ name: params.name,
263
+ description: params.description,
264
+ input: JsonSchema.toJsonSchema(params.input ?? Schema3.Void),
265
+ output: JsonSchema.toJsonSchema(params.output ?? Schema3.Void),
266
+ instructions: make({
267
+ source: params.instructions
268
+ }),
269
+ blueprints: params.blueprints ?? [],
270
+ context: params.context ?? []
229
271
  });
230
272
  export {
231
273
  blueprint_exports as Blueprint,
@@ -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: 'dxos.org/type/Blueprint',\n version: '0.1.0',\n }),\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--blueprint--regular',\n hue: 'blue',\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 { type Blueprint } from './blueprint';\n\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", "//\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: 'dxos.org/type/Prompt',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--scroll--regular',\n hue: 'blue',\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;AAC1B,SAASC,WAAW;;AAOb,IAAMC,UAAU,CAAqBC,QAAgBC,YAA8B,CAAC,MAAC;AAC1FJ,YAAU,OAAOG,WAAW,UAAA,QAAA;;;;;;;;;AAC5B,MAAIE,UAAU;AACdR,aAAWS,eAAe,WAAW,MAAMC,OAAO,EAAEF,OAAAA,CAAAA;AACpD,QAAMG,WAAWX,WAAWY,QAAQN,OAAOO,KAAI,CAAA;AAC/C,Q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I,WAAG,EAAEZ,KAAKC,YAAWC,oBAAoBC,IAAI,KAAA,CAAA;AAC5E,CAAA,EAAGH,KACDa,MAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAf,YAAWgB,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", "Registry", "_blueprints", "blueprints", "seen", "Set", "forEach", "blueprint", "has", "key", "warn", "add", "push", "sort", "name", "a", "b", "localeCompare", "getByKey", "find", "query", "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":10287,"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":3662,"imports":[{"path":"@dxos/log","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":7401,"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":16597},"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/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":212},"src/blueprint/blueprint.ts":{"bytesInOutput":2369},"src/template/index.ts":{"bytesInOutput":227},"src/template/prompt.ts":{"bytesInOutput":1634},"src/template/template.ts":{"bytesInOutput":754},"src/blueprint/registry.ts":{"bytesInOutput":897},"src/index.ts":{"bytesInOutput":0},"src/prompt/index.ts":{"bytesInOutput":100},"src/prompt/prompt.ts":{"bytesInOutput":1686}},"bytes":8436}}}
@@ -1,67 +1,73 @@
1
1
  import * as Schema from 'effect/Schema';
2
- import { Type } from '@dxos/echo';
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.
7
19
  * Blueprints may use tools to create and read artifacts, which are managed by the assistant.
8
20
  */
9
- export declare const Blueprint: Type.obj<Schema.Struct<{
10
- /**
11
- * Global registry ID.
12
- * NOTE: The `key` property refers to the original registry entry.
13
- */
14
- key: Schema.SchemaClass<string, string, never>;
15
- /**
16
- * Human-readable name of the blueprint.
17
- */
18
- name: Schema.SchemaClass<string, string, never>;
19
- /**
20
- * Description of the blueprint's purpose and functionality.
21
- */
22
- description: Schema.optional<typeof Schema.String>;
23
- /**
24
- * Instructions that guide the AI assistant's behavior and responses.
25
- * These are system prompts or guidelines that the AI should follow.
26
- */
27
- instructions: Schema.mutable<Schema.Struct<{
28
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
29
- content: string;
30
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
31
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
32
- name: typeof Schema.String;
33
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
34
- default: Schema.optional<typeof Schema.Any>;
35
- }>>>>>;
36
- }>>;
37
- /**
38
- * Array of tools that the AI assistant can use when this blueprint is active.
39
- */
40
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
41
- }>>;
21
+ export declare const Blueprint: Type.Obj<{
22
+ readonly description?: string | undefined;
23
+ readonly name: string;
24
+ readonly key: string;
25
+ readonly instructions: {
26
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
27
+ readonly content: string;
28
+ }>;
29
+ readonly inputs?: readonly {
30
+ readonly function?: string | undefined;
31
+ readonly name: string;
32
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
33
+ readonly default?: any;
34
+ }[] | undefined;
35
+ };
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;
41
+ }, Schema.Struct.Fields>;
42
42
  /**
43
43
  * TypeScript type for Blueprint.
44
44
  */
45
45
  export interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {
46
46
  }
47
+ type MakeProps = Pick<Blueprint, 'key' | 'name'> & Partial<Blueprint>;
47
48
  /**
48
49
  * Create a new Blueprint.
49
50
  */
50
- export declare const make: ({ tools, ...props }: Pick<Blueprint, "key" | "name" | "instructions"> & Partial<Blueprint>) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
51
- key: string;
52
- name: string;
53
- description?: string | undefined;
54
- instructions: {
55
- source: import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
56
- content: string;
51
+ export declare const make: ({ tools, instructions, ...props }: MakeProps) => Obj.OfShape<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
52
+ readonly description?: string | undefined;
53
+ readonly name: string;
54
+ readonly key: string;
55
+ readonly instructions: {
56
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
57
+ readonly content: string;
57
58
  }>;
58
- inputs?: {
59
- name: string;
60
- kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
61
- default?: any;
59
+ readonly inputs?: readonly {
60
+ readonly function?: string | undefined;
61
+ readonly name: string;
62
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
63
+ readonly default?: any;
62
64
  }[] | undefined;
63
65
  };
64
- tools: (string & import("effect/Brand").Brand<"ToolId">)[];
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;
65
71
  }>;
66
72
  /**
67
73
  * Util to create tool definitions for a blueprint.
@@ -70,4 +76,5 @@ export declare const toolDefinitions: ({ tools, functions, }: {
70
76
  tools?: string[];
71
77
  functions?: FunctionDefinition[];
72
78
  }) => (string & import("effect/Brand").Brand<"ToolId">)[];
79
+ export {};
73
80
  //# sourceMappingURL=blueprint.d.ts.map
@@ -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,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D;;;;GAIG;AACH,eAAO,MAAM,SAAS;IACpB;;;OAGG;;IAMH;;OAEG;;IAKH;;OAEG;;IAKH;;;OAGG;;;;;;;;;;;IAKH;;OAEG;;GAaJ,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG;AAE1E;;GAE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E,CAAC;CAClC,wDAA+F,CAAC"}
@@ -5,6 +5,7 @@ import { type Blueprint } from './blueprint';
5
5
  export declare class Registry {
6
6
  private readonly _blueprints;
7
7
  constructor(blueprints: Blueprint[]);
8
+ get blueprints(): Blueprint[];
8
9
  getByKey(key: string): Blueprint | undefined;
9
10
  query(): Blueprint[];
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAEnC,UAAU,EAAE,SAAS,EAAE;IAcnC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5C,KAAK,IAAI,SAAS,EAAE;CAGrB"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;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"}
@@ -1,72 +1,58 @@
1
1
  import * as Schema from 'effect/Schema';
2
- import { type Ref, Type } from '@dxos/echo';
2
+ import { Ref, Type } from '@dxos/echo';
3
3
  import { Blueprint } from '../blueprint';
4
4
  /**
5
- * Executable instructions.
6
- * Declare input and output schema.
7
- * May utilize blueprints.
5
+ * Executable instructions, which may use Blueprints.
8
6
  * May reference additional context.
9
7
  */
10
- declare const Prompt_: Type.obj<Schema.Struct<{
11
- /**
12
- * Name of the prompt.
13
- */
14
- name: typeof Schema.String;
15
- /**
16
- * Description of the prompt's purpose and functionality.
17
- * Allows AI agents to execute prompts automatically as tools.
18
- */
19
- description: Schema.optional<typeof Schema.String>;
20
- /**
21
- * Input schema of the prompt.
22
- */
23
- input: Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>;
24
- /**
25
- * Output schema of the prompt.
26
- */
27
- output: Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>;
28
- /**
29
- * Natural language instructions for the prompt.
30
- * These should provide concrete course of action for the AI to follow.
31
- */
32
- instructions: typeof Schema.String;
33
- /**
34
- * Blueprints that the prompt may utilize.
35
- */
36
- blueprints: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
37
- key: Schema.SchemaClass<string, string, never>;
38
- name: Schema.SchemaClass<string, string, never>;
39
- description: Schema.optional<typeof Schema.String>;
40
- instructions: Schema.mutable<Schema.Struct<{
41
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
42
- content: string;
43
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
44
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
45
- name: typeof Schema.String;
46
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
47
- default: Schema.optional<typeof Schema.Any>;
48
- }>>>>>;
49
- }>>;
50
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
51
- }>>>>;
52
- /**
53
- * Additional context that the prompt may utilize.
54
- */
55
- context: Schema.Array$<typeof Schema.Any>;
56
- }>>;
57
- export interface Prompt extends Schema.Schema.Type<typeof Prompt_> {
8
+ export declare const Prompt: Type.Obj<{
9
+ readonly description?: string | undefined;
10
+ readonly name?: string | undefined;
11
+ readonly context: readonly any[];
12
+ readonly instructions: {
13
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
14
+ readonly content: string;
15
+ }>;
16
+ readonly inputs?: readonly {
17
+ readonly function?: string | undefined;
18
+ readonly name: string;
19
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
20
+ readonly default?: any;
21
+ }[] | undefined;
22
+ };
23
+ readonly input: import("@dxos/echo/internal").JsonSchemaType;
24
+ readonly output: import("@dxos/echo/internal").JsonSchemaType;
25
+ readonly blueprints: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
26
+ readonly description?: string | undefined;
27
+ readonly name: string;
28
+ readonly key: string;
29
+ readonly instructions: {
30
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
31
+ readonly content: string;
32
+ }>;
33
+ readonly inputs?: readonly {
34
+ readonly function?: string | undefined;
35
+ readonly name: string;
36
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
37
+ readonly default?: any;
38
+ }[] | undefined;
39
+ };
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;
45
+ }>[];
46
+ }, Schema.Struct.Fields>;
47
+ export interface Prompt extends Schema.Schema.Type<typeof Prompt> {
58
48
  }
59
- export interface Prompt_Encoded extends Schema.Schema.Encoded<typeof Prompt_> {
60
- }
61
- export declare const Prompt: Schema.Schema<Prompt, Prompt_Encoded>;
62
- export declare const make: (opts: {
63
- name: string;
49
+ export declare const make: (params: {
50
+ name?: string;
64
51
  description?: string;
65
- input: Schema.Schema.AnyNoContext;
66
- output: Schema.Schema.AnyNoContext;
67
- instructions: string;
52
+ input?: Schema.Schema.AnyNoContext;
53
+ output?: Schema.Schema.AnyNoContext;
54
+ instructions?: string;
68
55
  blueprints?: Ref.Ref<Blueprint>[];
69
56
  context?: any[];
70
57
  }) => Prompt;
71
- export {};
72
58
  //# sourceMappingURL=prompt.d.ts.map
@@ -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,EAAO,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;GAKG;AACH,QAAA,MAAM,OAAO;IACX;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;IAGH;;OAEG;;GAOJ,CAAC;AACF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC;CAAG;AACrE,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,OAAO,CAAC;CAAG;AAChF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAW,CAAC;AAErE,eAAO,MAAM,IAAI,GAAI,MAAM;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB,KAAG,MASA,CAAC"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/promp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