@dxos/blueprints 0.8.4-main.3a94e84 → 0.8.4-main.5acf9ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +23 -24
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +23 -24
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/blueprint/blueprint.d.ts +33 -10
- package/dist/types/src/blueprint/blueprint.d.ts.map +1 -1
- package/dist/types/src/template/template.d.ts +1 -18
- package/dist/types/src/template/template.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -10
- package/src/blueprint/blueprint.ts +28 -2
- package/src/template/template.ts +2 -20
|
@@ -11,14 +11,17 @@ var defineArtifact = (definition) => definition;
|
|
|
11
11
|
var blueprint_exports = {};
|
|
12
12
|
__export(blueprint_exports, {
|
|
13
13
|
Blueprint: () => Blueprint,
|
|
14
|
-
Registry: () => Registry
|
|
14
|
+
Registry: () => Registry,
|
|
15
|
+
make: () => make
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
// src/blueprint/blueprint.ts
|
|
18
19
|
import { Schema as Schema2 } from "effect";
|
|
19
20
|
import { ToolId } from "@dxos/ai";
|
|
20
|
-
import { Type as Type2 } from "@dxos/echo";
|
|
21
|
-
import { LabelAnnotation
|
|
21
|
+
import { Obj, Ref, Type as Type2 } from "@dxos/echo";
|
|
22
|
+
import { LabelAnnotation } from "@dxos/echo-schema";
|
|
23
|
+
import { PublicKey } from "@dxos/keys";
|
|
24
|
+
import { DataType as DataType2 } from "@dxos/schema";
|
|
22
25
|
|
|
23
26
|
// src/template/index.ts
|
|
24
27
|
var template_exports = {};
|
|
@@ -26,8 +29,7 @@ __export(template_exports, {
|
|
|
26
29
|
Input: () => Input,
|
|
27
30
|
InputKind: () => InputKind,
|
|
28
31
|
Template: () => Template,
|
|
29
|
-
createPrompt: () => createPrompt
|
|
30
|
-
make: () => make
|
|
32
|
+
createPrompt: () => createPrompt
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
// src/template/prompt.ts
|
|
@@ -55,8 +57,7 @@ var createPrompt = (source, options = {}) => {
|
|
|
55
57
|
|
|
56
58
|
// src/template/template.ts
|
|
57
59
|
import { Schema } from "effect";
|
|
58
|
-
import {
|
|
59
|
-
import { LabelAnnotation } from "@dxos/echo-schema";
|
|
60
|
+
import { Type } from "@dxos/echo";
|
|
60
61
|
import { DataType } from "@dxos/schema";
|
|
61
62
|
var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
|
|
62
63
|
var Input = Schema.mutable(Schema.Struct({
|
|
@@ -65,25 +66,11 @@ var Input = Schema.mutable(Schema.Struct({
|
|
|
65
66
|
default: Schema.optional(Schema.Any)
|
|
66
67
|
}));
|
|
67
68
|
var Template = Schema.Struct({
|
|
68
|
-
name: Schema.optional(Schema.String),
|
|
69
69
|
source: Type.Ref(DataType.Text).annotations({
|
|
70
70
|
description: "Handlebars template source"
|
|
71
71
|
}),
|
|
72
72
|
inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
|
|
73
|
-
}).pipe(
|
|
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
|
-
};
|
|
73
|
+
}).pipe(Schema.mutable);
|
|
87
74
|
|
|
88
75
|
// src/blueprint/blueprint.ts
|
|
89
76
|
var Blueprint = Schema2.Struct({
|
|
@@ -111,7 +98,7 @@ var Blueprint = Schema2.Struct({
|
|
|
111
98
|
* Instructions that guide the AI assistant's behavior and responses.
|
|
112
99
|
* These are system prompts or guidelines that the AI should follow.
|
|
113
100
|
*/
|
|
114
|
-
instructions:
|
|
101
|
+
instructions: Template.annotations({
|
|
115
102
|
description: "Instructions that guide the AI assistant's behavior and responses"
|
|
116
103
|
}),
|
|
117
104
|
/**
|
|
@@ -127,10 +114,22 @@ var Blueprint = Schema2.Struct({
|
|
|
127
114
|
version: "0.1.0"
|
|
128
115
|
}),
|
|
129
116
|
// TODO(burdon): Move to Type.Obj def?
|
|
130
|
-
|
|
117
|
+
LabelAnnotation.set([
|
|
131
118
|
"name"
|
|
132
119
|
])
|
|
133
120
|
);
|
|
121
|
+
var make = ({ key = `example.com/blueprint/${PublicKey.random().truncate()}`, name, description, instructions = {
|
|
122
|
+
source: ""
|
|
123
|
+
}, tools = [] }) => Obj.make(Blueprint, {
|
|
124
|
+
key,
|
|
125
|
+
name,
|
|
126
|
+
description,
|
|
127
|
+
instructions: {
|
|
128
|
+
source: Ref.make(DataType2.makeText(instructions.source)),
|
|
129
|
+
inputs: instructions.inputs
|
|
130
|
+
},
|
|
131
|
+
tools
|
|
132
|
+
});
|
|
134
133
|
|
|
135
134
|
// src/blueprint/registry.ts
|
|
136
135
|
var Registry = class {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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:
|
|
5
|
-
"mappings": ";;;;;;;AA2DO,IAAMA,iBAAiB,CAACC,eAAuDA;;;AC3DtF
|
|
6
|
-
"names": ["defineArtifact", "definition", "Schema", "ToolId", "Type", "LabelAnnotation", "handlebars", "defaultsDeep", "invariant", "createPrompt", "source", "options", "section", "registerHelper", "String", "template", "compile", "suggestions", "trim", "Schema", "
|
|
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 { Obj, Ref, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\nimport { PublicKey } from '@dxos/keys';\nimport { DataType } from '@dxos/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 = ({\n key = `example.com/blueprint/${PublicKey.random().truncate()}`,\n name,\n description,\n instructions = { source: '' },\n tools = [],\n}: Pick<Blueprint, 'name'> &\n Omit<Partial<Blueprint>, 'name' | 'instructions'> & {\n instructions?: Omit<Partial<Template>, 'source'> & { source: string };\n }) =>\n Obj.make(Blueprint, {\n key,\n name,\n description,\n instructions: {\n source: Ref.make(DataType.makeText(instructions.source)),\n inputs: instructions.inputs,\n },\n tools,\n });\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 { 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", "//\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": ";;;;;;;AA2DO,IAAMA,iBAAiB,CAACC,eAAuDA;;;AC3DtF;;;;;;;;ACIA,SAASC,UAAAA,eAAc;AAEvB,SAASC,cAAc;AACvB,SAASC,KAAKC,KAAKC,QAAAA,aAAY;AAC/B,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,YAAAA,iBAAgB;;;ACVzB;;;;;;;;;ACIA,OAAOC,gBAAgB;AACvB,OAAOC,kBAAkB;AAEzB,SAASC,iBAAiB;;AAKnB,IAAMC,eAAe,CAAqBC,QAAgBC,UAAmB,CAAC,MAAY;AAC/FH,YAAUE,QAAAA,QAAAA;;;;;;;;;AACV,MAAIE,UAAU;AACdN,aAAWO,eAAe,WAAW,MAAMC,OAAO,EAAEF,OAAAA,CAAAA;AACpD,QAAMG,WAAWT,WAAWU,QAAQN,MAAAA;AACpC,SAAOK,SAASR,aAAa,CAAC,GAAGI,SAAS;IAAEM,aAAa;EAAK,CAAA,CAAA,EAAIC,KAAI;AACxE;;;ACdA,SAASC,cAAc;AAEvB,SAASC,YAAY;AACrB,SAASC,gBAAgB;AAKlB,IAAMC,YAAYC,OAAOC,QAC9B,SACA,gBACA,aACA,YACA,SACA,YACA,WACA,QAAA;AASK,IAAMC,QAAQF,OAAOG,QAC1BH,OAAOI,OAAO;EACZC,MAAML,OAAOM;EACbC,MAAMP,OAAOQ,SAAST,SAAAA;EACtBU,SAAST,OAAOQ,SAASR,OAAOU,GAAG;AACrC,CAAA,CAAA;AAQK,IAAMC,WAAWX,OAAOI,OAAO;EACpCQ,QAAQC,KAAKC,IAAIC,SAASC,IAAI,EAAEC,YAAY;IAAEC,aAAa;EAA6B,CAAA;EACxFC,QAAQnB,OAAOQ,SAASR,OAAOG,QAAQH,OAAOoB,MAAMlB,KAAAA,CAAAA,CAAAA;AACtD,CAAA,EAAGmB,KAAKrB,OAAOG,OAAO;;;AH1Bf,IAAMmB,YAAYC,QAAOC,OAAO;;;;;;EAMrCC,KAAKF,QAAOG,OAAOC,YAAY;IAC7BC,aAAa;EACf,CAAA;;;;EAKAC,MAAMN,QAAOG,OAAOC,YAAY;IAC9BC,aAAa;EACf,CAAA;;;;EAKAA,aAAaL,QAAOO,SAASP,QAAOG,MAAM,EAAEC,YAAY;IACtDC,aAAa;EACf,CAAA;;;;;EAMAG,cAAcC,SAASL,YAAY;IACjCC,aAAa;EACf,CAAA;;;;EAKAK,OAAOV,QAAOW,MAAMC,MAAAA,EAAQR,YAAY;IACtCC,aAAa;EACf,CAAA;AACF,CAAA,EAAGQ;EACDC,MAAKC,IAAI;;IAEPC,UAAU;IACVC,SAAS;EACX,CAAA;;EAGAC,gBAAgBC,IAAI;IAAC;GAAO;AAAA;AAWvB,IAAMC,OAAO,CAAC,EACnBlB,MAAM,yBAAyBmB,UAAUC,OAAM,EAAGC,SAAQ,CAAA,IAC1DjB,MACAD,aACAG,eAAe;EAAEgB,QAAQ;AAAG,GAC5Bd,QAAQ,CAAA,EAAE,MAKVK,IAAIK,KAAKrB,WAAW;EAClBG;EACAI;EACAD;EACAG,cAAc;IACZgB,QAAQC,IAAIL,KAAKM,UAASC,SAASnB,aAAagB,MAAM,CAAA;IACtDI,QAAQpB,aAAaoB;EACvB;EACAlB;AACF,CAAA;;;AItFK,IAAMmB,WAAN,MAAMA;EACX,YAA6BC,aAA0B;SAA1BA,cAAAA;AAC3B,SAAKA,YAAYC,KAAK,CAAC,EAAEC,MAAMC,EAAC,GAAI,EAAED,MAAME,EAAC,MAAOD,EAAEE,cAAcD,CAAAA,CAAAA;EACtE;EAEAE,SAASC,KAAoC;AAC3C,WAAO,KAAKP,YAAYQ,KAAK,CAACC,cAAcA,UAAUF,QAAQA,GAAAA;EAChE;EAEAG,QAAqB;AACnB,WAAO,KAAKV;EACd;AACF;",
|
|
6
|
+
"names": ["defineArtifact", "definition", "Schema", "ToolId", "Obj", "Ref", "Type", "LabelAnnotation", "PublicKey", "DataType", "handlebars", "defaultsDeep", "invariant", "createPrompt", "source", "options", "section", "registerHelper", "String", "template", "compile", "suggestions", "trim", "Schema", "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", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "Template", "tools", "Array", "ToolId", "pipe", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "make", "PublicKey", "random", "truncate", "source", "Ref", "DataType", "makeText", "inputs", "Registry", "_blueprints", "sort", "name", "a", "b", "localeCompare", "getByKey", "key", "find", "blueprint", "query"]
|
|
7
7
|
}
|
|
@@ -1 +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":
|
|
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":3654,"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":8476,"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":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/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":9962},"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":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["Blueprint","Template","defineArtifact"],"entryPoint":"src/index.ts","inputs":{"src/artifacts.ts":{"bytesInOutput":49},"src/index.ts":{"bytesInOutput":0},"src/blueprint/index.ts":{"bytesInOutput":139},"src/blueprint/blueprint.ts":{"bytesInOutput":2075},"src/template/index.ts":{"bytesInOutput":175},"src/template/prompt.ts":{"bytesInOutput":601},"src/template/template.ts":{"bytesInOutput":598},"src/blueprint/registry.ts":{"bytesInOutput":311}},"bytes":4467}}}
|
|
@@ -12,14 +12,17 @@ var defineArtifact = (definition) => definition;
|
|
|
12
12
|
var blueprint_exports = {};
|
|
13
13
|
__export(blueprint_exports, {
|
|
14
14
|
Blueprint: () => Blueprint,
|
|
15
|
-
Registry: () => Registry
|
|
15
|
+
Registry: () => Registry,
|
|
16
|
+
make: () => make
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
// src/blueprint/blueprint.ts
|
|
19
20
|
import { Schema as Schema2 } from "effect";
|
|
20
21
|
import { ToolId } from "@dxos/ai";
|
|
21
|
-
import { Type as Type2 } from "@dxos/echo";
|
|
22
|
-
import { LabelAnnotation
|
|
22
|
+
import { Obj, Ref, Type as Type2 } from "@dxos/echo";
|
|
23
|
+
import { LabelAnnotation } from "@dxos/echo-schema";
|
|
24
|
+
import { PublicKey } from "@dxos/keys";
|
|
25
|
+
import { DataType as DataType2 } from "@dxos/schema";
|
|
23
26
|
|
|
24
27
|
// src/template/index.ts
|
|
25
28
|
var template_exports = {};
|
|
@@ -27,8 +30,7 @@ __export(template_exports, {
|
|
|
27
30
|
Input: () => Input,
|
|
28
31
|
InputKind: () => InputKind,
|
|
29
32
|
Template: () => Template,
|
|
30
|
-
createPrompt: () => createPrompt
|
|
31
|
-
make: () => make
|
|
33
|
+
createPrompt: () => createPrompt
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
// src/template/prompt.ts
|
|
@@ -56,8 +58,7 @@ var createPrompt = (source, options = {}) => {
|
|
|
56
58
|
|
|
57
59
|
// src/template/template.ts
|
|
58
60
|
import { Schema } from "effect";
|
|
59
|
-
import {
|
|
60
|
-
import { LabelAnnotation } from "@dxos/echo-schema";
|
|
61
|
+
import { Type } from "@dxos/echo";
|
|
61
62
|
import { DataType } from "@dxos/schema";
|
|
62
63
|
var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
|
|
63
64
|
var Input = Schema.mutable(Schema.Struct({
|
|
@@ -66,25 +67,11 @@ var Input = Schema.mutable(Schema.Struct({
|
|
|
66
67
|
default: Schema.optional(Schema.Any)
|
|
67
68
|
}));
|
|
68
69
|
var Template = Schema.Struct({
|
|
69
|
-
name: Schema.optional(Schema.String),
|
|
70
70
|
source: Type.Ref(DataType.Text).annotations({
|
|
71
71
|
description: "Handlebars template source"
|
|
72
72
|
}),
|
|
73
73
|
inputs: Schema.optional(Schema.mutable(Schema.Array(Input)))
|
|
74
|
-
}).pipe(
|
|
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
|
-
};
|
|
74
|
+
}).pipe(Schema.mutable);
|
|
88
75
|
|
|
89
76
|
// src/blueprint/blueprint.ts
|
|
90
77
|
var Blueprint = Schema2.Struct({
|
|
@@ -112,7 +99,7 @@ var Blueprint = Schema2.Struct({
|
|
|
112
99
|
* Instructions that guide the AI assistant's behavior and responses.
|
|
113
100
|
* These are system prompts or guidelines that the AI should follow.
|
|
114
101
|
*/
|
|
115
|
-
instructions:
|
|
102
|
+
instructions: Template.annotations({
|
|
116
103
|
description: "Instructions that guide the AI assistant's behavior and responses"
|
|
117
104
|
}),
|
|
118
105
|
/**
|
|
@@ -128,10 +115,22 @@ var Blueprint = Schema2.Struct({
|
|
|
128
115
|
version: "0.1.0"
|
|
129
116
|
}),
|
|
130
117
|
// TODO(burdon): Move to Type.Obj def?
|
|
131
|
-
|
|
118
|
+
LabelAnnotation.set([
|
|
132
119
|
"name"
|
|
133
120
|
])
|
|
134
121
|
);
|
|
122
|
+
var make = ({ key = `example.com/blueprint/${PublicKey.random().truncate()}`, name, description, instructions = {
|
|
123
|
+
source: ""
|
|
124
|
+
}, tools = [] }) => Obj.make(Blueprint, {
|
|
125
|
+
key,
|
|
126
|
+
name,
|
|
127
|
+
description,
|
|
128
|
+
instructions: {
|
|
129
|
+
source: Ref.make(DataType2.makeText(instructions.source)),
|
|
130
|
+
inputs: instructions.inputs
|
|
131
|
+
},
|
|
132
|
+
tools
|
|
133
|
+
});
|
|
135
134
|
|
|
136
135
|
// src/blueprint/registry.ts
|
|
137
136
|
var Registry = class {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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:
|
|
5
|
-
"mappings": ";;;;;;;;AA2DO,IAAMA,iBAAiB,CAACC,eAAuDA;;;AC3DtF
|
|
6
|
-
"names": ["defineArtifact", "definition", "Schema", "ToolId", "Type", "LabelAnnotation", "handlebars", "defaultsDeep", "invariant", "createPrompt", "source", "options", "section", "registerHelper", "String", "template", "compile", "suggestions", "trim", "Schema", "
|
|
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 { Obj, Ref, Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\nimport { PublicKey } from '@dxos/keys';\nimport { DataType } from '@dxos/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 = ({\n key = `example.com/blueprint/${PublicKey.random().truncate()}`,\n name,\n description,\n instructions = { source: '' },\n tools = [],\n}: Pick<Blueprint, 'name'> &\n Omit<Partial<Blueprint>, 'name' | 'instructions'> & {\n instructions?: Omit<Partial<Template>, 'source'> & { source: string };\n }) =>\n Obj.make(Blueprint, {\n key,\n name,\n description,\n instructions: {\n source: Ref.make(DataType.makeText(instructions.source)),\n inputs: instructions.inputs,\n },\n tools,\n });\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 { 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", "//\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": ";;;;;;;;AA2DO,IAAMA,iBAAiB,CAACC,eAAuDA;;;AC3DtF;;;;;;;;ACIA,SAASC,UAAAA,eAAc;AAEvB,SAASC,cAAc;AACvB,SAASC,KAAKC,KAAKC,QAAAA,aAAY;AAC/B,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,YAAAA,iBAAgB;;;ACVzB;;;;;;;;;ACIA,OAAOC,gBAAgB;AACvB,OAAOC,kBAAkB;AAEzB,SAASC,iBAAiB;;AAKnB,IAAMC,eAAe,CAAqBC,QAAgBC,UAAmB,CAAC,MAAY;AAC/FH,YAAUE,QAAAA,QAAAA;;;;;;;;;AACV,MAAIE,UAAU;AACdN,aAAWO,eAAe,WAAW,MAAMC,OAAO,EAAEF,OAAAA,CAAAA;AACpD,QAAMG,WAAWT,WAAWU,QAAQN,MAAAA;AACpC,SAAOK,SAASR,aAAa,CAAC,GAAGI,SAAS;IAAEM,aAAa;EAAK,CAAA,CAAA,EAAIC,KAAI;AACxE;;;ACdA,SAASC,cAAc;AAEvB,SAASC,YAAY;AACrB,SAASC,gBAAgB;AAKlB,IAAMC,YAAYC,OAAOC,QAC9B,SACA,gBACA,aACA,YACA,SACA,YACA,WACA,QAAA;AASK,IAAMC,QAAQF,OAAOG,QAC1BH,OAAOI,OAAO;EACZC,MAAML,OAAOM;EACbC,MAAMP,OAAOQ,SAAST,SAAAA;EACtBU,SAAST,OAAOQ,SAASR,OAAOU,GAAG;AACrC,CAAA,CAAA;AAQK,IAAMC,WAAWX,OAAOI,OAAO;EACpCQ,QAAQC,KAAKC,IAAIC,SAASC,IAAI,EAAEC,YAAY;IAAEC,aAAa;EAA6B,CAAA;EACxFC,QAAQnB,OAAOQ,SAASR,OAAOG,QAAQH,OAAOoB,MAAMlB,KAAAA,CAAAA,CAAAA;AACtD,CAAA,EAAGmB,KAAKrB,OAAOG,OAAO;;;AH1Bf,IAAMmB,YAAYC,QAAOC,OAAO;;;;;;EAMrCC,KAAKF,QAAOG,OAAOC,YAAY;IAC7BC,aAAa;EACf,CAAA;;;;EAKAC,MAAMN,QAAOG,OAAOC,YAAY;IAC9BC,aAAa;EACf,CAAA;;;;EAKAA,aAAaL,QAAOO,SAASP,QAAOG,MAAM,EAAEC,YAAY;IACtDC,aAAa;EACf,CAAA;;;;;EAMAG,cAAcC,SAASL,YAAY;IACjCC,aAAa;EACf,CAAA;;;;EAKAK,OAAOV,QAAOW,MAAMC,MAAAA,EAAQR,YAAY;IACtCC,aAAa;EACf,CAAA;AACF,CAAA,EAAGQ;EACDC,MAAKC,IAAI;;IAEPC,UAAU;IACVC,SAAS;EACX,CAAA;;EAGAC,gBAAgBC,IAAI;IAAC;GAAO;AAAA;AAWvB,IAAMC,OAAO,CAAC,EACnBlB,MAAM,yBAAyBmB,UAAUC,OAAM,EAAGC,SAAQ,CAAA,IAC1DjB,MACAD,aACAG,eAAe;EAAEgB,QAAQ;AAAG,GAC5Bd,QAAQ,CAAA,EAAE,MAKVK,IAAIK,KAAKrB,WAAW;EAClBG;EACAI;EACAD;EACAG,cAAc;IACZgB,QAAQC,IAAIL,KAAKM,UAASC,SAASnB,aAAagB,MAAM,CAAA;IACtDI,QAAQpB,aAAaoB;EACvB;EACAlB;AACF,CAAA;;;AItFK,IAAMmB,WAAN,MAAMA;EACX,YAA6BC,aAA0B;SAA1BA,cAAAA;AAC3B,SAAKA,YAAYC,KAAK,CAAC,EAAEC,MAAMC,EAAC,GAAI,EAAED,MAAME,EAAC,MAAOD,EAAEE,cAAcD,CAAAA,CAAAA;EACtE;EAEAE,SAASC,KAAoC;AAC3C,WAAO,KAAKP,YAAYQ,KAAK,CAACC,cAAcA,UAAUF,QAAQA,GAAAA;EAChE;EAEAG,QAAqB;AACnB,WAAO,KAAKV;EACd;AACF;",
|
|
6
|
+
"names": ["defineArtifact", "definition", "Schema", "ToolId", "Obj", "Ref", "Type", "LabelAnnotation", "PublicKey", "DataType", "handlebars", "defaultsDeep", "invariant", "createPrompt", "source", "options", "section", "registerHelper", "String", "template", "compile", "suggestions", "trim", "Schema", "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", "Blueprint", "Schema", "Struct", "key", "String", "annotations", "description", "name", "optional", "instructions", "Template", "tools", "Array", "ToolId", "pipe", "Type", "Obj", "typename", "version", "LabelAnnotation", "set", "make", "PublicKey", "random", "truncate", "source", "Ref", "DataType", "makeText", "inputs", "Registry", "_blueprints", "sort", "name", "a", "b", "localeCompare", "getByKey", "key", "find", "blueprint", "query"]
|
|
7
7
|
}
|
|
@@ -1 +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":
|
|
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":3654,"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":8476,"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":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/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":9963},"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":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["Blueprint","Template","defineArtifact"],"entryPoint":"src/index.ts","inputs":{"src/artifacts.ts":{"bytesInOutput":49},"src/index.ts":{"bytesInOutput":0},"src/blueprint/index.ts":{"bytesInOutput":139},"src/blueprint/blueprint.ts":{"bytesInOutput":2075},"src/template/index.ts":{"bytesInOutput":175},"src/template/prompt.ts":{"bytesInOutput":601},"src/template/template.ts":{"bytesInOutput":598},"src/blueprint/registry.ts":{"bytesInOutput":311}},"bytes":4559}}}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import { Type } from '@dxos/echo';
|
|
3
|
+
import { Template } from '../template';
|
|
3
4
|
/**
|
|
4
5
|
* Blueprint schema defines the structure for AI assistant blueprints.
|
|
5
6
|
* Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.
|
|
@@ -23,17 +24,16 @@ export declare const Blueprint: Type.obj<Schema.Struct<{
|
|
|
23
24
|
* Instructions that guide the AI assistant's behavior and responses.
|
|
24
25
|
* These are system prompts or guidelines that the AI should follow.
|
|
25
26
|
*/
|
|
26
|
-
instructions: Schema.
|
|
27
|
-
|
|
28
|
-
source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
27
|
+
instructions: Schema.mutable<Schema.Struct<{
|
|
28
|
+
source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
29
29
|
content: string;
|
|
30
|
-
}>;
|
|
31
|
-
inputs
|
|
32
|
-
name:
|
|
33
|
-
kind
|
|
34
|
-
default
|
|
35
|
-
}
|
|
36
|
-
}
|
|
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
37
|
/**
|
|
38
38
|
* Array of tools that the AI assistant can use when this blueprint is active.
|
|
39
39
|
*/
|
|
@@ -44,4 +44,27 @@ export declare const Blueprint: Type.obj<Schema.Struct<{
|
|
|
44
44
|
*/
|
|
45
45
|
export interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Create a new Blueprint.
|
|
49
|
+
*/
|
|
50
|
+
export declare const make: ({ key, name, description, instructions, tools, }: Pick<Blueprint, "name"> & Omit<Partial<Blueprint>, "name" | "instructions"> & {
|
|
51
|
+
instructions?: Omit<Partial<Template>, "source"> & {
|
|
52
|
+
source: string;
|
|
53
|
+
};
|
|
54
|
+
}) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
55
|
+
key: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description?: string | undefined;
|
|
58
|
+
instructions: {
|
|
59
|
+
source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
60
|
+
content: string;
|
|
61
|
+
}>;
|
|
62
|
+
inputs?: {
|
|
63
|
+
name: string;
|
|
64
|
+
kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
|
|
65
|
+
default?: any;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
};
|
|
68
|
+
tools: (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
69
|
+
}>;
|
|
47
70
|
//# sourceMappingURL=blueprint.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAK5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;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,kDAMlB,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GACxB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG;IAClD,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACvE;;;;;;;;;;;;;;;EAUC,CAAC"}
|
|
@@ -18,8 +18,7 @@ export type Input = Schema.Schema.Type<typeof Input>;
|
|
|
18
18
|
/**
|
|
19
19
|
* Template type.
|
|
20
20
|
*/
|
|
21
|
-
export declare const Template:
|
|
22
|
-
name: Schema.optional<typeof Schema.String>;
|
|
21
|
+
export declare const Template: Schema.mutable<Schema.Struct<{
|
|
23
22
|
source: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
24
23
|
content: string;
|
|
25
24
|
}>, import("@dxos/echo-protocol").EncodedReference, never>;
|
|
@@ -31,20 +30,4 @@ export declare const Template: Type.obj<Schema.Struct<{
|
|
|
31
30
|
}>>;
|
|
32
31
|
export interface Template extends Schema.Schema.Type<typeof Template> {
|
|
33
32
|
}
|
|
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
33
|
//# sourceMappingURL=template.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC;;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"}
|