@dxos/blueprints 0.8.4-main.2e9d522

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.
Files changed (38) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +3 -0
  3. package/dist/lib/browser/index.mjs +153 -0
  4. package/dist/lib/browser/index.mjs.map +7 -0
  5. package/dist/lib/browser/meta.json +1 -0
  6. package/dist/lib/node-esm/index.mjs +154 -0
  7. package/dist/lib/node-esm/index.mjs.map +7 -0
  8. package/dist/lib/node-esm/meta.json +1 -0
  9. package/dist/types/src/artifacts.d.ts +40 -0
  10. package/dist/types/src/artifacts.d.ts.map +1 -0
  11. package/dist/types/src/blueprint/blueprint.d.ts +47 -0
  12. package/dist/types/src/blueprint/blueprint.d.ts.map +1 -0
  13. package/dist/types/src/blueprint/index.d.ts +3 -0
  14. package/dist/types/src/blueprint/index.d.ts.map +1 -0
  15. package/dist/types/src/blueprint/registry.d.ts +11 -0
  16. package/dist/types/src/blueprint/registry.d.ts.map +1 -0
  17. package/dist/types/src/index.d.ts +4 -0
  18. package/dist/types/src/index.d.ts.map +1 -0
  19. package/dist/types/src/template/index.d.ts +3 -0
  20. package/dist/types/src/template/index.d.ts.map +1 -0
  21. package/dist/types/src/template/prompt.d.ts +5 -0
  22. package/dist/types/src/template/prompt.d.ts.map +1 -0
  23. package/dist/types/src/template/prompt.test.d.ts +2 -0
  24. package/dist/types/src/template/prompt.test.d.ts.map +1 -0
  25. package/dist/types/src/template/template.d.ts +50 -0
  26. package/dist/types/src/template/template.d.ts.map +1 -0
  27. package/dist/types/tsconfig.tsbuildinfo +1 -0
  28. package/package.json +44 -0
  29. package/src/artifacts.ts +60 -0
  30. package/src/blueprint/blueprint.ts +70 -0
  31. package/src/blueprint/index.ts +6 -0
  32. package/src/blueprint/registry.ts +22 -0
  33. package/src/index.ts +7 -0
  34. package/src/template/index.ts +6 -0
  35. package/src/template/prompt.test.ts +44 -0
  36. package/src/template/prompt.ts +19 -0
  37. package/src/template/template.ts +66 -0
  38. package/src/vite-env.d.ts +20 -0
package/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ MIT License
2
+ Copyright (c) 2022 DXOS
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @dxos/blueprints
2
+
3
+ Low-level definitions for Blueprints, Templates, and related utilities.
@@ -0,0 +1,153 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/artifacts.ts
8
+ var defineArtifact = (definition) => definition;
9
+
10
+ // src/blueprint/index.ts
11
+ var blueprint_exports = {};
12
+ __export(blueprint_exports, {
13
+ Blueprint: () => Blueprint,
14
+ Registry: () => Registry
15
+ });
16
+
17
+ // src/blueprint/blueprint.ts
18
+ import { Schema as Schema2 } from "effect";
19
+ import { ToolId } from "@dxos/ai";
20
+ import { Type as Type2 } from "@dxos/echo";
21
+ import { LabelAnnotation as LabelAnnotation2 } from "@dxos/echo-schema";
22
+
23
+ // src/template/index.ts
24
+ var template_exports = {};
25
+ __export(template_exports, {
26
+ Input: () => Input,
27
+ InputKind: () => InputKind,
28
+ Template: () => Template,
29
+ createPrompt: () => createPrompt,
30
+ make: () => make
31
+ });
32
+
33
+ // src/template/prompt.ts
34
+ import handlebars from "handlebars";
35
+ import defaultsDeep from "lodash.defaultsdeep";
36
+ import { invariant } from "@dxos/invariant";
37
+ var __dxlog_file = "/__w/dxos/dxos/packages/core/blueprints/src/template/prompt.ts";
38
+ var createPrompt = (source, options = {}) => {
39
+ invariant(source, void 0, {
40
+ F: __dxlog_file,
41
+ L: 14,
42
+ S: void 0,
43
+ A: [
44
+ "source",
45
+ ""
46
+ ]
47
+ });
48
+ let section = 0;
49
+ handlebars.registerHelper("section", () => String(++section));
50
+ const template = handlebars.compile(source);
51
+ return template(defaultsDeep({}, options, {
52
+ suggestions: true
53
+ })).trim();
54
+ };
55
+
56
+ // src/template/template.ts
57
+ import { Schema } from "effect";
58
+ import { Obj, Ref, Type } from "@dxos/echo";
59
+ import { LabelAnnotation } from "@dxos/echo-schema";
60
+ import { DataType } from "@dxos/schema";
61
+ var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
62
+ var Input = Schema.mutable(Schema.Struct({
63
+ name: Schema.String,
64
+ kind: Schema.optional(InputKind),
65
+ default: Schema.optional(Schema.Any)
66
+ }));
67
+ var Template = Schema.Struct({
68
+ name: Schema.optional(Schema.String),
69
+ source: Type.Ref(DataType.Text).annotations({
70
+ description: "Handlebars template source"
71
+ }),
72
+ inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
73
+ }).pipe(Type.Obj({
74
+ typename: "dxos.org/type/Template",
75
+ version: "0.1.0"
76
+ }), LabelAnnotation.set([
77
+ "name"
78
+ ]));
79
+ var make = ({ source = "", ...props }) => {
80
+ return Obj.make(Template, {
81
+ source: Ref.make(Obj.make(DataType.Text, {
82
+ content: source
83
+ })),
84
+ ...props
85
+ });
86
+ };
87
+
88
+ // src/blueprint/blueprint.ts
89
+ var Blueprint = Schema2.Struct({
90
+ /**
91
+ * Global registry ID.
92
+ * NOTE: The `key` property refers to the original registry entry.
93
+ */
94
+ // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.
95
+ key: Schema2.String.annotations({
96
+ description: "Unique registration key for the blueprint"
97
+ }),
98
+ /**
99
+ * Human-readable name of the blueprint.
100
+ */
101
+ name: Schema2.String.annotations({
102
+ description: "Human-readable name of the blueprint"
103
+ }),
104
+ /**
105
+ * Description of the blueprint's purpose and functionality.
106
+ */
107
+ description: Schema2.optional(Schema2.String).annotations({
108
+ description: "Description of the blueprint's purpose and functionality"
109
+ }),
110
+ /**
111
+ * Instructions that guide the AI assistant's behavior and responses.
112
+ * These are system prompts or guidelines that the AI should follow.
113
+ */
114
+ instructions: Type2.Ref(Template).annotations({
115
+ description: "Instructions that guide the AI assistant's behavior and responses"
116
+ }),
117
+ /**
118
+ * Array of tools that the AI assistant can use when this blueprint is active.
119
+ */
120
+ tools: Schema2.Array(ToolId).annotations({
121
+ description: "Array of tools that the AI assistant can use when this blueprint is active"
122
+ })
123
+ }).pipe(
124
+ Type2.Obj({
125
+ // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
126
+ typename: "dxos.org/type/Blueprint",
127
+ version: "0.1.0"
128
+ }),
129
+ // TODO(burdon): Move to Type.Obj def?
130
+ LabelAnnotation2.set([
131
+ "name"
132
+ ])
133
+ );
134
+
135
+ // src/blueprint/registry.ts
136
+ var Registry = class {
137
+ constructor(_blueprints) {
138
+ this._blueprints = _blueprints;
139
+ this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
140
+ }
141
+ getByKey(key) {
142
+ return this._blueprints.find((blueprint) => blueprint.key === key);
143
+ }
144
+ query() {
145
+ return this._blueprints;
146
+ }
147
+ };
148
+ export {
149
+ blueprint_exports as Blueprint,
150
+ template_exports as Template,
151
+ defineArtifact
152
+ };
153
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/artifacts.ts", "../../../src/blueprint/index.ts", "../../../src/blueprint/blueprint.ts", "../../../src/template/index.ts", "../../../src/template/prompt.ts", "../../../src/template/template.ts", "../../../src/blueprint/registry.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport { type ExecutableTool } from '@dxos/ai';\nimport { type SpaceId } from '@dxos/keys';\n\n/**\n * @deprecated\n */\n// TODO(burdon): Replace with Ref.\nexport type AssociatedArtifact = {\n spaceId: SpaceId;\n typename: string;\n id: string;\n};\n\n/**\n * Static artifact definition.\n * @deprecated\n */\n// TODO(burdon): Convert to effect schema.\nexport type ArtifactDefinition = {\n // TODO(wittjosiah): Is this actually an ObjectId or should it be a uri?\n // TODO(burdon): Plugin id?\n id: string;\n\n /**\n * Name.\n */\n name: string;\n\n /**\n * Description.\n */\n description?: string;\n\n /**\n * Instructions for how to use the artifact.\n */\n // TODO(burdon): Reference template object.\n instructions: string;\n\n /**\n * Schema that describes the shape of data which matches the artifact.\n */\n schema: Schema.Schema.AnyNoContext;\n\n /**\n * Tools that can be used to act on data which matches the artifact.\n */\n tools: ExecutableTool[];\n\n // TODO(wittjosiah): Add `component` field for rendering data which matches the artifact?\n // NOTE(burdon): I think that could just be provided separately by the plugin (since there might be multiple surface types).\n};\n\nexport const defineArtifact = (definition: ArtifactDefinition): ArtifactDefinition => definition;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './blueprint';\nexport * from './registry';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { ToolId } from '@dxos/ai';\nimport { Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\n\nimport { Template } from '../template';\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: Type.Ref(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}).pipe(\n Type.Obj({\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\n // TODO(burdon): Move to Type.Obj def?\n LabelAnnotation.set(['name']),\n);\n\n/**\n * TypeScript type for Blueprint.\n */\nexport interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './prompt';\nexport * from './template';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport handlebars from 'handlebars';\nimport defaultsDeep from 'lodash.defaultsdeep';\n\nimport { invariant } from '@dxos/invariant';\n\n/**\n * Process Handlebars template.\n */\nexport const createPrompt = <Options extends {}>(source: string, options: Options = {} as Options): string => {\n invariant(source);\n let section = 0;\n handlebars.registerHelper('section', () => String(++section));\n const template = handlebars.compile(source);\n return template(defaultsDeep({}, options, { suggestions: true })).trim();\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\nimport { DataType } 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.mutable(\n Schema.Struct({\n name: Schema.String,\n kind: Schema.optional(InputKind),\n default: Schema.optional(Schema.Any),\n }),\n);\n\nexport type Input = Schema.Schema.Type<typeof Input>;\n\n/**\n * Template type.\n */\nexport const Template = Schema.Struct({\n name: Schema.optional(Schema.String),\n source: Type.Ref(DataType.Text).annotations({ description: 'Handlebars template source' }),\n inputs: Schema.optional(Schema.mutable(Schema.Array(Input))),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Template',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n);\n\nexport interface Template extends Schema.Schema.Type<typeof Template> {}\n\n/**\n * Creates a template.\n */\nexport const make = ({ source = '', ...props }: Partial<Omit<Template, 'source'> & { source: string }>) => {\n return Obj.make(Template, {\n source: Ref.make(Obj.make(DataType.Text, { content: source })),\n ...props,\n });\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Blueprint } from './blueprint';\n\n/**\n * Blueprint registry.\n */\nexport class Registry {\n constructor(private readonly _blueprints: Blueprint[]) {\n this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));\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"],
5
+ "mappings": "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",
6
+ "names": ["defineArtifact", "definition", "Schema", "ToolId", "Type", "LabelAnnotation", "handlebars", "defaultsDeep", "invariant", "createPrompt", "source", "options", "section", "registerHelper", "String", "template", "compile", "suggestions", "trim", "Schema", "Obj", "Ref", "Type", "LabelAnnotation", "DataType", "InputKind", "Schema", "Literal", "Input", "mutable", "Struct", "name", "String", "kind", "optional", "default", "Any", "Template", "source", "Type", "Ref", "DataType", "Text", "annotations", "description", "inputs", "Array", "pipe", "Obj", "typename", "version", "LabelAnnotation", "set", "make", "props", "content", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "Type", "Ref", "Template", "tools", "Array", "ToolId", "pipe", "Obj", "typename", "version", "LabelAnnotation", "set", "Registry", "_blueprints", "sort", "name", "a", "b", "localeCompare", "getByKey", "key", "find", "blueprint", "query"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/artifacts.ts":{"bytes":2355,"imports":[],"format":"esm"},"src/template/prompt.ts":{"bytes":2338,"imports":[{"path":"handlebars","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/template/template.ts":{"bytes":5350,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","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":6427,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/blueprint/registry.ts":{"bytes":1958,"imports":[],"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/index.ts":{"bytes":762,"imports":[{"path":"src/artifacts.ts","kind":"import-statement","original":"./artifacts"},{"path":"src/blueprint/index.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"./template"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9767},"dist/lib/browser/index.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["Blueprint","Template","defineArtifact"],"entryPoint":"src/index.ts","inputs":{"src/artifacts.ts":{"bytesInOutput":49},"src/index.ts":{"bytesInOutput":0},"src/blueprint/index.ts":{"bytesInOutput":119},"src/blueprint/blueprint.ts":{"bytesInOutput":1674},"src/template/index.ts":{"bytesInOutput":195},"src/template/prompt.ts":{"bytesInOutput":601},"src/template/template.ts":{"bytesInOutput":966},"src/blueprint/registry.ts":{"bytesInOutput":311}},"bytes":4434}}}
@@ -0,0 +1,154 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+
8
+ // src/artifacts.ts
9
+ var defineArtifact = (definition) => definition;
10
+
11
+ // src/blueprint/index.ts
12
+ var blueprint_exports = {};
13
+ __export(blueprint_exports, {
14
+ Blueprint: () => Blueprint,
15
+ Registry: () => Registry
16
+ });
17
+
18
+ // src/blueprint/blueprint.ts
19
+ import { Schema as Schema2 } from "effect";
20
+ import { ToolId } from "@dxos/ai";
21
+ import { Type as Type2 } from "@dxos/echo";
22
+ import { LabelAnnotation as LabelAnnotation2 } from "@dxos/echo-schema";
23
+
24
+ // src/template/index.ts
25
+ var template_exports = {};
26
+ __export(template_exports, {
27
+ Input: () => Input,
28
+ InputKind: () => InputKind,
29
+ Template: () => Template,
30
+ createPrompt: () => createPrompt,
31
+ make: () => make
32
+ });
33
+
34
+ // src/template/prompt.ts
35
+ import handlebars from "handlebars";
36
+ import defaultsDeep from "lodash.defaultsdeep";
37
+ import { invariant } from "@dxos/invariant";
38
+ var __dxlog_file = "/__w/dxos/dxos/packages/core/blueprints/src/template/prompt.ts";
39
+ var createPrompt = (source, options = {}) => {
40
+ invariant(source, void 0, {
41
+ F: __dxlog_file,
42
+ L: 14,
43
+ S: void 0,
44
+ A: [
45
+ "source",
46
+ ""
47
+ ]
48
+ });
49
+ let section = 0;
50
+ handlebars.registerHelper("section", () => String(++section));
51
+ const template = handlebars.compile(source);
52
+ return template(defaultsDeep({}, options, {
53
+ suggestions: true
54
+ })).trim();
55
+ };
56
+
57
+ // src/template/template.ts
58
+ import { Schema } from "effect";
59
+ import { Obj, Ref, Type } from "@dxos/echo";
60
+ import { LabelAnnotation } from "@dxos/echo-schema";
61
+ import { DataType } from "@dxos/schema";
62
+ var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
63
+ var Input = Schema.mutable(Schema.Struct({
64
+ name: Schema.String,
65
+ kind: Schema.optional(InputKind),
66
+ default: Schema.optional(Schema.Any)
67
+ }));
68
+ var Template = Schema.Struct({
69
+ name: Schema.optional(Schema.String),
70
+ source: Type.Ref(DataType.Text).annotations({
71
+ description: "Handlebars template source"
72
+ }),
73
+ inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
74
+ }).pipe(Type.Obj({
75
+ typename: "dxos.org/type/Template",
76
+ version: "0.1.0"
77
+ }), LabelAnnotation.set([
78
+ "name"
79
+ ]));
80
+ var make = ({ source = "", ...props }) => {
81
+ return Obj.make(Template, {
82
+ source: Ref.make(Obj.make(DataType.Text, {
83
+ content: source
84
+ })),
85
+ ...props
86
+ });
87
+ };
88
+
89
+ // src/blueprint/blueprint.ts
90
+ var Blueprint = Schema2.Struct({
91
+ /**
92
+ * Global registry ID.
93
+ * NOTE: The `key` property refers to the original registry entry.
94
+ */
95
+ // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.
96
+ key: Schema2.String.annotations({
97
+ description: "Unique registration key for the blueprint"
98
+ }),
99
+ /**
100
+ * Human-readable name of the blueprint.
101
+ */
102
+ name: Schema2.String.annotations({
103
+ description: "Human-readable name of the blueprint"
104
+ }),
105
+ /**
106
+ * Description of the blueprint's purpose and functionality.
107
+ */
108
+ description: Schema2.optional(Schema2.String).annotations({
109
+ description: "Description of the blueprint's purpose and functionality"
110
+ }),
111
+ /**
112
+ * Instructions that guide the AI assistant's behavior and responses.
113
+ * These are system prompts or guidelines that the AI should follow.
114
+ */
115
+ instructions: Type2.Ref(Template).annotations({
116
+ description: "Instructions that guide the AI assistant's behavior and responses"
117
+ }),
118
+ /**
119
+ * Array of tools that the AI assistant can use when this blueprint is active.
120
+ */
121
+ tools: Schema2.Array(ToolId).annotations({
122
+ description: "Array of tools that the AI assistant can use when this blueprint is active"
123
+ })
124
+ }).pipe(
125
+ Type2.Obj({
126
+ // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
127
+ typename: "dxos.org/type/Blueprint",
128
+ version: "0.1.0"
129
+ }),
130
+ // TODO(burdon): Move to Type.Obj def?
131
+ LabelAnnotation2.set([
132
+ "name"
133
+ ])
134
+ );
135
+
136
+ // src/blueprint/registry.ts
137
+ var Registry = class {
138
+ constructor(_blueprints) {
139
+ this._blueprints = _blueprints;
140
+ this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
141
+ }
142
+ getByKey(key) {
143
+ return this._blueprints.find((blueprint) => blueprint.key === key);
144
+ }
145
+ query() {
146
+ return this._blueprints;
147
+ }
148
+ };
149
+ export {
150
+ blueprint_exports as Blueprint,
151
+ template_exports as Template,
152
+ defineArtifact
153
+ };
154
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/artifacts.ts", "../../../src/blueprint/index.ts", "../../../src/blueprint/blueprint.ts", "../../../src/template/index.ts", "../../../src/template/prompt.ts", "../../../src/template/template.ts", "../../../src/blueprint/registry.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport { type ExecutableTool } from '@dxos/ai';\nimport { type SpaceId } from '@dxos/keys';\n\n/**\n * @deprecated\n */\n// TODO(burdon): Replace with Ref.\nexport type AssociatedArtifact = {\n spaceId: SpaceId;\n typename: string;\n id: string;\n};\n\n/**\n * Static artifact definition.\n * @deprecated\n */\n// TODO(burdon): Convert to effect schema.\nexport type ArtifactDefinition = {\n // TODO(wittjosiah): Is this actually an ObjectId or should it be a uri?\n // TODO(burdon): Plugin id?\n id: string;\n\n /**\n * Name.\n */\n name: string;\n\n /**\n * Description.\n */\n description?: string;\n\n /**\n * Instructions for how to use the artifact.\n */\n // TODO(burdon): Reference template object.\n instructions: string;\n\n /**\n * Schema that describes the shape of data which matches the artifact.\n */\n schema: Schema.Schema.AnyNoContext;\n\n /**\n * Tools that can be used to act on data which matches the artifact.\n */\n tools: ExecutableTool[];\n\n // TODO(wittjosiah): Add `component` field for rendering data which matches the artifact?\n // NOTE(burdon): I think that could just be provided separately by the plugin (since there might be multiple surface types).\n};\n\nexport const defineArtifact = (definition: ArtifactDefinition): ArtifactDefinition => definition;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './blueprint';\nexport * from './registry';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { ToolId } from '@dxos/ai';\nimport { Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\n\nimport { Template } from '../template';\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: Type.Ref(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}).pipe(\n Type.Obj({\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\n // TODO(burdon): Move to Type.Obj def?\n LabelAnnotation.set(['name']),\n);\n\n/**\n * TypeScript type for Blueprint.\n */\nexport interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './prompt';\nexport * from './template';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport handlebars from 'handlebars';\nimport defaultsDeep from 'lodash.defaultsdeep';\n\nimport { invariant } from '@dxos/invariant';\n\n/**\n * Process Handlebars template.\n */\nexport const createPrompt = <Options extends {}>(source: string, options: Options = {} as Options): string => {\n invariant(source);\n let section = 0;\n handlebars.registerHelper('section', () => String(++section));\n const template = handlebars.compile(source);\n return template(defaultsDeep({}, options, { suggestions: true })).trim();\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\nimport { DataType } 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.mutable(\n Schema.Struct({\n name: Schema.String,\n kind: Schema.optional(InputKind),\n default: Schema.optional(Schema.Any),\n }),\n);\n\nexport type Input = Schema.Schema.Type<typeof Input>;\n\n/**\n * Template type.\n */\nexport const Template = Schema.Struct({\n name: Schema.optional(Schema.String),\n source: Type.Ref(DataType.Text).annotations({ description: 'Handlebars template source' }),\n inputs: Schema.optional(Schema.mutable(Schema.Array(Input))),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Template',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n);\n\nexport interface Template extends Schema.Schema.Type<typeof Template> {}\n\n/**\n * Creates a template.\n */\nexport const make = ({ source = '', ...props }: Partial<Omit<Template, 'source'> & { source: string }>) => {\n return Obj.make(Template, {\n source: Ref.make(Obj.make(DataType.Text, { content: source })),\n ...props,\n });\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Blueprint } from './blueprint';\n\n/**\n * Blueprint registry.\n */\nexport class Registry {\n constructor(private readonly _blueprints: Blueprint[]) {\n this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));\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"],
5
+ "mappings": "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",
6
+ "names": ["defineArtifact", "definition", "Schema", "ToolId", "Type", "LabelAnnotation", "handlebars", "defaultsDeep", "invariant", "createPrompt", "source", "options", "section", "registerHelper", "String", "template", "compile", "suggestions", "trim", "Schema", "Obj", "Ref", "Type", "LabelAnnotation", "DataType", "InputKind", "Schema", "Literal", "Input", "mutable", "Struct", "name", "String", "kind", "optional", "default", "Any", "Template", "source", "Type", "Ref", "DataType", "Text", "annotations", "description", "inputs", "Array", "pipe", "Obj", "typename", "version", "LabelAnnotation", "set", "make", "props", "content", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "Type", "Ref", "Template", "tools", "Array", "ToolId", "pipe", "Obj", "typename", "version", "LabelAnnotation", "set", "Registry", "_blueprints", "sort", "name", "a", "b", "localeCompare", "getByKey", "key", "find", "blueprint", "query"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/artifacts.ts":{"bytes":2355,"imports":[],"format":"esm"},"src/template/prompt.ts":{"bytes":2338,"imports":[{"path":"handlebars","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/template/template.ts":{"bytes":5350,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","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":6427,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/blueprint/registry.ts":{"bytes":1958,"imports":[],"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/index.ts":{"bytes":762,"imports":[{"path":"src/artifacts.ts","kind":"import-statement","original":"./artifacts"},{"path":"src/blueprint/index.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"./template"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9768},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["Blueprint","Template","defineArtifact"],"entryPoint":"src/index.ts","inputs":{"src/artifacts.ts":{"bytesInOutput":49},"src/index.ts":{"bytesInOutput":0},"src/blueprint/index.ts":{"bytesInOutput":119},"src/blueprint/blueprint.ts":{"bytesInOutput":1674},"src/template/index.ts":{"bytesInOutput":195},"src/template/prompt.ts":{"bytesInOutput":601},"src/template/template.ts":{"bytesInOutput":966},"src/blueprint/registry.ts":{"bytesInOutput":311}},"bytes":4526}}}
@@ -0,0 +1,40 @@
1
+ import { type Schema } from 'effect';
2
+ import { type ExecutableTool } from '@dxos/ai';
3
+ import { type SpaceId } from '@dxos/keys';
4
+ /**
5
+ * @deprecated
6
+ */
7
+ export type AssociatedArtifact = {
8
+ spaceId: SpaceId;
9
+ typename: string;
10
+ id: string;
11
+ };
12
+ /**
13
+ * Static artifact definition.
14
+ * @deprecated
15
+ */
16
+ export type ArtifactDefinition = {
17
+ id: string;
18
+ /**
19
+ * Name.
20
+ */
21
+ name: string;
22
+ /**
23
+ * Description.
24
+ */
25
+ description?: string;
26
+ /**
27
+ * Instructions for how to use the artifact.
28
+ */
29
+ instructions: string;
30
+ /**
31
+ * Schema that describes the shape of data which matches the artifact.
32
+ */
33
+ schema: Schema.Schema.AnyNoContext;
34
+ /**
35
+ * Tools that can be used to act on data which matches the artifact.
36
+ */
37
+ tools: ExecutableTool[];
38
+ };
39
+ export declare const defineArtifact: (definition: ArtifactDefinition) => ArtifactDefinition;
40
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/artifacts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;GAEG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;GAGG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAG/B,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IAEH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAEnC;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;CAIzB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,YAAY,kBAAkB,KAAG,kBAAgC,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { Schema } from 'effect';
2
+ import { Type } from '@dxos/echo';
3
+ /**
4
+ * Blueprint schema defines the structure for AI assistant blueprints.
5
+ * Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.
6
+ * Blueprints may use tools to create and read artifacts, which are managed by the assistant.
7
+ */
8
+ export declare const Blueprint: Type.obj<Schema.Struct<{
9
+ /**
10
+ * Global registry ID.
11
+ * NOTE: The `key` property refers to the original registry entry.
12
+ */
13
+ key: Schema.SchemaClass<string, string, never>;
14
+ /**
15
+ * Human-readable name of the blueprint.
16
+ */
17
+ name: Schema.SchemaClass<string, string, never>;
18
+ /**
19
+ * Description of the blueprint's purpose and functionality.
20
+ */
21
+ description: Schema.optional<typeof Schema.String>;
22
+ /**
23
+ * Instructions that guide the AI assistant's behavior and responses.
24
+ * These are system prompts or guidelines that the AI should follow.
25
+ */
26
+ instructions: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
27
+ name?: string | undefined;
28
+ source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
29
+ content: string;
30
+ }>;
31
+ inputs?: {
32
+ name: string;
33
+ kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
34
+ default?: any;
35
+ }[] | undefined;
36
+ }>, import("@dxos/echo-protocol").EncodedReference, never>;
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
+ }>>;
42
+ /**
43
+ * TypeScript type for Blueprint.
44
+ */
45
+ export interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {
46
+ }
47
+ //# sourceMappingURL=blueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/blueprint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAKlC;;;;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"}
@@ -0,0 +1,3 @@
1
+ export * from './blueprint';
2
+ export * from './registry';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type Blueprint } from './blueprint';
2
+ /**
3
+ * Blueprint registry.
4
+ */
5
+ export declare class Registry {
6
+ private readonly _blueprints;
7
+ constructor(_blueprints: Blueprint[]);
8
+ getByKey(key: string): Blueprint | undefined;
9
+ query(): Blueprint[];
10
+ }
11
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,SAAS,EAAE;IAIrD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5C,KAAK,IAAI,SAAS,EAAE;CAGrB"}
@@ -0,0 +1,4 @@
1
+ export * from './artifacts';
2
+ export * as Blueprint from './blueprint';
3
+ export * as Template from './template';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './prompt';
2
+ export * from './template';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Process Handlebars template.
3
+ */
4
+ export declare const createPrompt: <Options extends {}>(source: string, options?: Options) => string;
5
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/template/prompt.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,EAAE,EAAE,QAAQ,MAAM,EAAE,UAAS,OAAuB,KAAG,MAMnG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prompt.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.test.d.ts","sourceRoot":"","sources":["../../../../src/template/prompt.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import { Schema } from 'effect';
2
+ import { Type } from '@dxos/echo';
3
+ /**
4
+ * Template input kind determines how template variables are resolved.
5
+ */
6
+ export declare const InputKind: Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>;
7
+ export type InputKind = Schema.Schema.Type<typeof InputKind>;
8
+ /**
9
+ * Template input variable.
10
+ * E.g., {{foo}}
11
+ */
12
+ export declare const Input: Schema.mutable<Schema.Struct<{
13
+ name: typeof Schema.String;
14
+ kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
15
+ default: Schema.optional<typeof Schema.Any>;
16
+ }>>;
17
+ export type Input = Schema.Schema.Type<typeof Input>;
18
+ /**
19
+ * Template type.
20
+ */
21
+ export declare const Template: Type.obj<Schema.Struct<{
22
+ name: Schema.optional<typeof Schema.String>;
23
+ source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
24
+ content: string;
25
+ }>, import("@dxos/echo-protocol").EncodedReference, never>;
26
+ inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
27
+ name: typeof Schema.String;
28
+ kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
29
+ default: Schema.optional<typeof Schema.Any>;
30
+ }>>>>>;
31
+ }>>;
32
+ export interface Template extends Schema.Schema.Type<typeof Template> {
33
+ }
34
+ /**
35
+ * Creates a template.
36
+ */
37
+ export declare const make: ({ source, ...props }: Partial<Omit<Template, "source"> & {
38
+ source: string;
39
+ }>) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
40
+ name?: string | undefined;
41
+ source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
42
+ content: string;
43
+ }>;
44
+ inputs?: {
45
+ name: string;
46
+ kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
47
+ default?: any;
48
+ }[] | undefined;
49
+ }>;
50
+ //# sourceMappingURL=template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/template/template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,SAAS,8GASrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;GAMjB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;GAUpB,CAAC;AAEF,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,sBAA2B,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;;;;;;;;;;EAKrG,CAAC"}