@dxos/blueprints 0.8.4-main.28f8d3d

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 (35) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +3 -0
  3. package/dist/lib/browser/index.mjs +161 -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 +162 -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/blueprint/blueprint.d.ts +65 -0
  10. package/dist/types/src/blueprint/blueprint.d.ts.map +1 -0
  11. package/dist/types/src/blueprint/index.d.ts +3 -0
  12. package/dist/types/src/blueprint/index.d.ts.map +1 -0
  13. package/dist/types/src/blueprint/registry.d.ts +11 -0
  14. package/dist/types/src/blueprint/registry.d.ts.map +1 -0
  15. package/dist/types/src/index.d.ts +3 -0
  16. package/dist/types/src/index.d.ts.map +1 -0
  17. package/dist/types/src/template/index.d.ts +3 -0
  18. package/dist/types/src/template/index.d.ts.map +1 -0
  19. package/dist/types/src/template/prompt.d.ts +5 -0
  20. package/dist/types/src/template/prompt.d.ts.map +1 -0
  21. package/dist/types/src/template/prompt.test.d.ts +2 -0
  22. package/dist/types/src/template/prompt.test.d.ts.map +1 -0
  23. package/dist/types/src/template/template.d.ts +37 -0
  24. package/dist/types/src/template/template.d.ts.map +1 -0
  25. package/dist/types/tsconfig.tsbuildinfo +1 -0
  26. package/package.json +45 -0
  27. package/src/blueprint/blueprint.ts +76 -0
  28. package/src/blueprint/index.ts +6 -0
  29. package/src/blueprint/registry.ts +36 -0
  30. package/src/index.ts +6 -0
  31. package/src/template/index.ts +6 -0
  32. package/src/template/prompt.test.ts +44 -0
  33. package/src/template/prompt.ts +21 -0
  34. package/src/template/template.ts +53 -0
  35. 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,161 @@
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/blueprint/index.ts
8
+ var blueprint_exports = {};
9
+ __export(blueprint_exports, {
10
+ Blueprint: () => Blueprint,
11
+ Registry: () => Registry,
12
+ make: () => make2
13
+ });
14
+
15
+ // src/blueprint/blueprint.ts
16
+ import { Schema as Schema2 } from "effect";
17
+ import { ToolId } from "@dxos/ai";
18
+ import { Obj, Type as Type2 } from "@dxos/echo";
19
+ import { LabelAnnotation } from "@dxos/echo-schema";
20
+
21
+ // src/template/index.ts
22
+ var template_exports = {};
23
+ __export(template_exports, {
24
+ Input: () => Input,
25
+ InputKind: () => InputKind,
26
+ Template: () => Template,
27
+ make: () => make,
28
+ process: () => process
29
+ });
30
+
31
+ // src/template/prompt.ts
32
+ import handlebars from "handlebars";
33
+ import defaultsDeep from "lodash.defaultsdeep";
34
+ import { invariant } from "@dxos/invariant";
35
+ var __dxlog_file = "/__w/dxos/dxos/packages/core/blueprints/src/template/prompt.ts";
36
+ var process = (source, options = {}) => {
37
+ invariant(source, void 0, {
38
+ F: __dxlog_file,
39
+ L: 14,
40
+ S: void 0,
41
+ A: [
42
+ "source",
43
+ ""
44
+ ]
45
+ });
46
+ let section = 0;
47
+ handlebars.registerHelper("section", () => String(++section));
48
+ const template = handlebars.compile(source.trim());
49
+ return template(defaultsDeep({}, options, {
50
+ suggestions: true
51
+ })).trim().replace(/(\n\s*){3,}/g, "\n\n");
52
+ };
53
+
54
+ // src/template/template.ts
55
+ import { Schema } from "effect";
56
+ import { Ref, Type } from "@dxos/echo";
57
+ import { DataType } from "@dxos/schema";
58
+ var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
59
+ var Input = Schema.mutable(Schema.Struct({
60
+ name: Schema.String,
61
+ kind: Schema.optional(InputKind),
62
+ default: Schema.optional(Schema.Any)
63
+ }));
64
+ var Template = Schema.Struct({
65
+ source: Type.Ref(DataType.Text).annotations({
66
+ description: "Handlebars template source"
67
+ }),
68
+ inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
69
+ }).pipe(Schema.mutable);
70
+ var make = ({ source, inputs = [] }) => ({
71
+ source: Ref.make(DataType.makeText(source)),
72
+ inputs
73
+ });
74
+
75
+ // src/blueprint/blueprint.ts
76
+ var Blueprint = Schema2.Struct({
77
+ /**
78
+ * Global registry ID.
79
+ * NOTE: The `key` property refers to the original registry entry.
80
+ */
81
+ // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.
82
+ key: Schema2.String.annotations({
83
+ description: "Unique registration key for the blueprint"
84
+ }),
85
+ /**
86
+ * Human-readable name of the blueprint.
87
+ */
88
+ name: Schema2.String.annotations({
89
+ description: "Human-readable name of the blueprint"
90
+ }),
91
+ /**
92
+ * Description of the blueprint's purpose and functionality.
93
+ */
94
+ description: Schema2.optional(Schema2.String).annotations({
95
+ description: "Description of the blueprint's purpose and functionality"
96
+ }),
97
+ /**
98
+ * Instructions that guide the AI assistant's behavior and responses.
99
+ * These are system prompts or guidelines that the AI should follow.
100
+ */
101
+ instructions: Template.annotations({
102
+ description: "Instructions that guide the AI assistant's behavior and responses"
103
+ }),
104
+ /**
105
+ * Array of tools that the AI assistant can use when this blueprint is active.
106
+ */
107
+ tools: Schema2.Array(ToolId).annotations({
108
+ description: "Array of tools that the AI assistant can use when this blueprint is active"
109
+ })
110
+ }).pipe(
111
+ Type2.Obj({
112
+ // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
113
+ typename: "dxos.org/type/Blueprint",
114
+ version: "0.1.0"
115
+ }),
116
+ // TODO(burdon): Move to Type.Obj def?
117
+ LabelAnnotation.set([
118
+ "name"
119
+ ])
120
+ );
121
+ var make2 = ({ tools = [], ...props }) => Obj.make(Blueprint, {
122
+ tools,
123
+ ...props
124
+ });
125
+
126
+ // src/blueprint/registry.ts
127
+ import { log } from "@dxos/log";
128
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/core/blueprints/src/blueprint/registry.ts";
129
+ var Registry = class {
130
+ _blueprints = [];
131
+ constructor(blueprints) {
132
+ const seen = /* @__PURE__ */ new Set();
133
+ blueprints.forEach((blueprint) => {
134
+ if (seen.has(blueprint.key)) {
135
+ log.warn("duplicate blueprint", {
136
+ key: blueprint.key
137
+ }, {
138
+ F: __dxlog_file2,
139
+ L: 19,
140
+ S: this,
141
+ C: (f, a) => f(...a)
142
+ });
143
+ } else {
144
+ seen.add(blueprint.key);
145
+ this._blueprints.push(blueprint);
146
+ }
147
+ });
148
+ this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
149
+ }
150
+ getByKey(key) {
151
+ return this._blueprints.find((blueprint) => blueprint.key === key);
152
+ }
153
+ query() {
154
+ return this._blueprints;
155
+ }
156
+ };
157
+ export {
158
+ blueprint_exports as Blueprint,
159
+ template_exports as Template
160
+ };
161
+ //# sourceMappingURL=index.mjs.map
@@ -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"],
4
+ "sourcesContent": ["//\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 { Obj, 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: 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/**\n * Create a new Blueprint.\n */\nexport const make = ({ tools = [], ...props }: Pick<Blueprint, 'key' | 'name' | 'instructions'> & Partial<Blueprint>) =>\n Obj.make(Blueprint, { tools, ...props });\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 process = <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.trim());\n return template(defaultsDeep({}, options, { suggestions: true }))\n .trim()\n .replace(/(\\n\\s*){3,}/g, '\\n\\n');\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Ref, Type } from '@dxos/echo';\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 source: Type.Ref(DataType.Text).annotations({ description: 'Handlebars template source' }),\n inputs: Schema.optional(Schema.mutable(Schema.Array(Input))),\n}).pipe(Schema.mutable);\n\nexport interface Template extends Schema.Schema.Type<typeof Template> {}\n\nexport const make = ({ source, inputs = [] }: { source: string; inputs?: Input[] }): Template => ({\n source: Ref.make(DataType.makeText(source)),\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 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": ["make", "Schema", "ToolId", "Obj", "Type", "LabelAnnotation", "handlebars", "defaultsDeep", "invariant", "process", "source", "options", "section", "registerHelper", "String", "template", "compile", "trim", "suggestions", "replace", "Schema", "Ref", "Type", "DataType", "InputKind", "Schema", "Literal", "Input", "mutable", "Struct", "name", "String", "kind", "optional", "default", "Any", "Template", "source", "Type", "Ref", "DataType", "Text", "annotations", "description", "inputs", "Array", "pipe", "make", "makeText", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "Template", "tools", "Array", "ToolId", "pipe", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "make", "props", "log", "Registry", "_blueprints", "blueprints", "seen", "Set", "forEach", "blueprint", "has", "key", "warn", "add", "push", "sort", "name", "a", "b", "localeCompare", "getByKey", "find", "query"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/template/prompt.ts":{"bytes":2492,"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":4245,"imports":[{"path":"effect","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":7015,"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":3436,"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/index.ts":{"bytes":673,"imports":[{"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":8774},"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/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Blueprint","Template"],"entryPoint":"src/index.ts","inputs":{"src/blueprint/index.ts":{"bytesInOutput":140},"src/blueprint/blueprint.ts":{"bytesInOutput":1735},"src/template/index.ts":{"bytesInOutput":185},"src/template/prompt.ts":{"bytesInOutput":635},"src/template/template.ts":{"bytesInOutput":706},"src/blueprint/registry.ts":{"bytesInOutput":834},"src/index.ts":{"bytesInOutput":0}},"bytes":4715}}}
@@ -0,0 +1,162 @@
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/blueprint/index.ts
9
+ var blueprint_exports = {};
10
+ __export(blueprint_exports, {
11
+ Blueprint: () => Blueprint,
12
+ Registry: () => Registry,
13
+ make: () => make2
14
+ });
15
+
16
+ // src/blueprint/blueprint.ts
17
+ import { Schema as Schema2 } from "effect";
18
+ import { ToolId } from "@dxos/ai";
19
+ import { Obj, Type as Type2 } from "@dxos/echo";
20
+ import { LabelAnnotation } from "@dxos/echo-schema";
21
+
22
+ // src/template/index.ts
23
+ var template_exports = {};
24
+ __export(template_exports, {
25
+ Input: () => Input,
26
+ InputKind: () => InputKind,
27
+ Template: () => Template,
28
+ make: () => make,
29
+ process: () => process
30
+ });
31
+
32
+ // src/template/prompt.ts
33
+ import handlebars from "handlebars";
34
+ import defaultsDeep from "lodash.defaultsdeep";
35
+ import { invariant } from "@dxos/invariant";
36
+ var __dxlog_file = "/__w/dxos/dxos/packages/core/blueprints/src/template/prompt.ts";
37
+ var process = (source, options = {}) => {
38
+ invariant(source, void 0, {
39
+ F: __dxlog_file,
40
+ L: 14,
41
+ S: void 0,
42
+ A: [
43
+ "source",
44
+ ""
45
+ ]
46
+ });
47
+ let section = 0;
48
+ handlebars.registerHelper("section", () => String(++section));
49
+ const template = handlebars.compile(source.trim());
50
+ return template(defaultsDeep({}, options, {
51
+ suggestions: true
52
+ })).trim().replace(/(\n\s*){3,}/g, "\n\n");
53
+ };
54
+
55
+ // src/template/template.ts
56
+ import { Schema } from "effect";
57
+ import { Ref, Type } from "@dxos/echo";
58
+ import { DataType } from "@dxos/schema";
59
+ var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
60
+ var Input = Schema.mutable(Schema.Struct({
61
+ name: Schema.String,
62
+ kind: Schema.optional(InputKind),
63
+ default: Schema.optional(Schema.Any)
64
+ }));
65
+ var Template = Schema.Struct({
66
+ source: Type.Ref(DataType.Text).annotations({
67
+ description: "Handlebars template source"
68
+ }),
69
+ inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
70
+ }).pipe(Schema.mutable);
71
+ var make = ({ source, inputs = [] }) => ({
72
+ source: Ref.make(DataType.makeText(source)),
73
+ inputs
74
+ });
75
+
76
+ // src/blueprint/blueprint.ts
77
+ var Blueprint = Schema2.Struct({
78
+ /**
79
+ * Global registry ID.
80
+ * NOTE: The `key` property refers to the original registry entry.
81
+ */
82
+ // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.
83
+ key: Schema2.String.annotations({
84
+ description: "Unique registration key for the blueprint"
85
+ }),
86
+ /**
87
+ * Human-readable name of the blueprint.
88
+ */
89
+ name: Schema2.String.annotations({
90
+ description: "Human-readable name of the blueprint"
91
+ }),
92
+ /**
93
+ * Description of the blueprint's purpose and functionality.
94
+ */
95
+ description: Schema2.optional(Schema2.String).annotations({
96
+ description: "Description of the blueprint's purpose and functionality"
97
+ }),
98
+ /**
99
+ * Instructions that guide the AI assistant's behavior and responses.
100
+ * These are system prompts or guidelines that the AI should follow.
101
+ */
102
+ instructions: Template.annotations({
103
+ description: "Instructions that guide the AI assistant's behavior and responses"
104
+ }),
105
+ /**
106
+ * Array of tools that the AI assistant can use when this blueprint is active.
107
+ */
108
+ tools: Schema2.Array(ToolId).annotations({
109
+ description: "Array of tools that the AI assistant can use when this blueprint is active"
110
+ })
111
+ }).pipe(
112
+ Type2.Obj({
113
+ // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
114
+ typename: "dxos.org/type/Blueprint",
115
+ version: "0.1.0"
116
+ }),
117
+ // TODO(burdon): Move to Type.Obj def?
118
+ LabelAnnotation.set([
119
+ "name"
120
+ ])
121
+ );
122
+ var make2 = ({ tools = [], ...props }) => Obj.make(Blueprint, {
123
+ tools,
124
+ ...props
125
+ });
126
+
127
+ // src/blueprint/registry.ts
128
+ import { log } from "@dxos/log";
129
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/core/blueprints/src/blueprint/registry.ts";
130
+ var Registry = class {
131
+ _blueprints = [];
132
+ constructor(blueprints) {
133
+ const seen = /* @__PURE__ */ new Set();
134
+ blueprints.forEach((blueprint) => {
135
+ if (seen.has(blueprint.key)) {
136
+ log.warn("duplicate blueprint", {
137
+ key: blueprint.key
138
+ }, {
139
+ F: __dxlog_file2,
140
+ L: 19,
141
+ S: this,
142
+ C: (f, a) => f(...a)
143
+ });
144
+ } else {
145
+ seen.add(blueprint.key);
146
+ this._blueprints.push(blueprint);
147
+ }
148
+ });
149
+ this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
150
+ }
151
+ getByKey(key) {
152
+ return this._blueprints.find((blueprint) => blueprint.key === key);
153
+ }
154
+ query() {
155
+ return this._blueprints;
156
+ }
157
+ };
158
+ export {
159
+ blueprint_exports as Blueprint,
160
+ template_exports as Template
161
+ };
162
+ //# sourceMappingURL=index.mjs.map
@@ -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"],
4
+ "sourcesContent": ["//\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 { Obj, 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: 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/**\n * Create a new Blueprint.\n */\nexport const make = ({ tools = [], ...props }: Pick<Blueprint, 'key' | 'name' | 'instructions'> & Partial<Blueprint>) =>\n Obj.make(Blueprint, { tools, ...props });\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 process = <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.trim());\n return template(defaultsDeep({}, options, { suggestions: true }))\n .trim()\n .replace(/(\\n\\s*){3,}/g, '\\n\\n');\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Ref, Type } from '@dxos/echo';\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 source: Type.Ref(DataType.Text).annotations({ description: 'Handlebars template source' }),\n inputs: Schema.optional(Schema.mutable(Schema.Array(Input))),\n}).pipe(Schema.mutable);\n\nexport interface Template extends Schema.Schema.Type<typeof Template> {}\n\nexport const make = ({ source, inputs = [] }: { source: string; inputs?: Input[] }): Template => ({\n source: Ref.make(DataType.makeText(source)),\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 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": ["make", "Schema", "ToolId", "Obj", "Type", "LabelAnnotation", "handlebars", "defaultsDeep", "invariant", "process", "source", "options", "section", "registerHelper", "String", "template", "compile", "trim", "suggestions", "replace", "Schema", "Ref", "Type", "DataType", "InputKind", "Schema", "Literal", "Input", "mutable", "Struct", "name", "String", "kind", "optional", "default", "Any", "Template", "source", "Type", "Ref", "DataType", "Text", "annotations", "description", "inputs", "Array", "pipe", "make", "makeText", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "Template", "tools", "Array", "ToolId", "pipe", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "make", "props", "log", "Registry", "_blueprints", "blueprints", "seen", "Set", "forEach", "blueprint", "has", "key", "warn", "add", "push", "sort", "name", "a", "b", "localeCompare", "getByKey", "find", "query"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/template/prompt.ts":{"bytes":2492,"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":4245,"imports":[{"path":"effect","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":7015,"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":3436,"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/index.ts":{"bytes":673,"imports":[{"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":8775},"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/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Blueprint","Template"],"entryPoint":"src/index.ts","inputs":{"src/blueprint/index.ts":{"bytesInOutput":140},"src/blueprint/blueprint.ts":{"bytesInOutput":1735},"src/template/index.ts":{"bytesInOutput":185},"src/template/prompt.ts":{"bytesInOutput":635},"src/template/template.ts":{"bytesInOutput":706},"src/blueprint/registry.ts":{"bytesInOutput":834},"src/index.ts":{"bytesInOutput":0}},"bytes":4807}}}
@@ -0,0 +1,65 @@
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.mutable<Schema.Struct<{
27
+ source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
28
+ content: string;
29
+ }>, import("@dxos/echo-protocol").EncodedReference, never>;
30
+ inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
31
+ name: typeof Schema.String;
32
+ kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
33
+ default: Schema.optional<typeof Schema.Any>;
34
+ }>>>>>;
35
+ }>>;
36
+ /**
37
+ * Array of tools that the AI assistant can use when this blueprint is active.
38
+ */
39
+ tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
40
+ }>>;
41
+ /**
42
+ * TypeScript type for Blueprint.
43
+ */
44
+ export interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {
45
+ }
46
+ /**
47
+ * Create a new Blueprint.
48
+ */
49
+ export declare const make: ({ tools, ...props }: Pick<Blueprint, "key" | "name" | "instructions"> & Partial<Blueprint>) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
50
+ key: string;
51
+ name: string;
52
+ description?: string | undefined;
53
+ instructions: {
54
+ source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
55
+ content: string;
56
+ }>;
57
+ inputs?: {
58
+ name: string;
59
+ kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
60
+ default?: any;
61
+ }[] | undefined;
62
+ };
63
+ tools: (string & import("effect/Brand").Brand<"ToolId">)[];
64
+ }>;
65
+ //# 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,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAKvC;;;;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;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,qBAA0B,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,cAAc,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;EAC1E,CAAC"}
@@ -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":"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"}
@@ -0,0 +1,3 @@
1
+ export * as Blueprint from './blueprint';
2
+ export * as Template from './template';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,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 process: <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,OAAO,GAAI,OAAO,SAAS,EAAE,EAAE,QAAQ,MAAM,EAAE,UAAS,OAAuB,KAAG,MAQ9F,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,37 @@
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: Schema.mutable<Schema.Struct<{
22
+ source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
23
+ content: string;
24
+ }>, import("@dxos/echo-protocol").EncodedReference, never>;
25
+ inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
26
+ name: typeof Schema.String;
27
+ kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
28
+ default: Schema.optional<typeof Schema.Any>;
29
+ }>>>>>;
30
+ }>>;
31
+ export interface Template extends Schema.Schema.Type<typeof Template> {
32
+ }
33
+ export declare const make: ({ source, inputs }: {
34
+ source: string;
35
+ inputs?: Input[];
36
+ }) => Template;
37
+ //# 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,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC;;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;;;;;;;;;GAGE,CAAC;AAExB,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE,eAAO,MAAM,IAAI,GAAI,oBAAyB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;CAAE,KAAG,QAGnF,CAAC"}