@dxos/blueprints 0.8.4-main.ae835ea → 0.8.4-main.bc674ce

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.
@@ -1 +1 @@
1
- {"inputs":{"src/template/prompt.ts":{"bytes":2322,"imports":[{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/template/template.ts":{"bytes":4385,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/template/index.ts":{"bytes":546,"imports":[{"path":"src/template/prompt.ts","kind":"import-statement","original":"./prompt"},{"path":"src/template/template.ts","kind":"import-statement","original":"./template"}],"format":"esm"},"src/blueprint/blueprint.ts":{"bytes":8092,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","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/prompt/prompt.ts":{"bytes":6623,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"src/blueprint/index.ts","kind":"import-statement","original":"../blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/prompt/index.ts":{"bytes":456,"imports":[{"path":"src/prompt/prompt.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"},"src/index.ts":{"bytes":813,"imports":[{"path":"src/blueprint/index.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"./template"},{"path":"src/prompt/index.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12645},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true}],"exports":["Blueprint","Prompt","Template"],"entryPoint":"src/index.ts","inputs":{"src/blueprint/index.ts":{"bytesInOutput":182},"src/blueprint/blueprint.ts":{"bytesInOutput":1891},"src/template/index.ts":{"bytesInOutput":185},"src/template/prompt.ts":{"bytesInOutput":609},"src/template/template.ts":{"bytesInOutput":722},"src/blueprint/registry.ts":{"bytesInOutput":834},"src/index.ts":{"bytesInOutput":0},"src/prompt/index.ts":{"bytesInOutput":100},"src/prompt/prompt.ts":{"bytesInOutput":1409}},"bytes":6581}}}
1
+ {"inputs":{"src/template/prompt.ts":{"bytes":6924,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/template/template.ts":{"bytes":4450,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/template/index.ts":{"bytes":546,"imports":[{"path":"src/template/prompt.ts","kind":"import-statement","original":"./prompt"},{"path":"src/template/template.ts","kind":"import-statement","original":"./template"}],"format":"esm"},"src/blueprint/blueprint.ts":{"bytes":8164,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/blueprint/registry.ts":{"bytes":3662,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/blueprint/index.ts":{"bytes":554,"imports":[{"path":"src/blueprint/blueprint.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/blueprint/registry.ts","kind":"import-statement","original":"./registry"}],"format":"esm"},"src/prompt/prompt.ts":{"bytes":7056,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/blueprint/index.ts","kind":"import-statement","original":"../blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"../template"}],"format":"esm"},"src/prompt/index.ts":{"bytes":456,"imports":[{"path":"src/prompt/prompt.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"},"src/index.ts":{"bytes":813,"imports":[{"path":"src/blueprint/index.ts","kind":"import-statement","original":"./blueprint"},{"path":"src/template/index.ts","kind":"import-statement","original":"./template"},{"path":"src/prompt/index.ts","kind":"import-statement","original":"./prompt"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15389},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["Blueprint","Prompt","Template"],"entryPoint":"src/index.ts","inputs":{"src/blueprint/index.ts":{"bytesInOutput":182},"src/blueprint/blueprint.ts":{"bytesInOutput":1842},"src/template/index.ts":{"bytesInOutput":227},"src/template/prompt.ts":{"bytesInOutput":1642},"src/template/template.ts":{"bytesInOutput":761},"src/blueprint/registry.ts":{"bytesInOutput":897},"src/index.ts":{"bytesInOutput":0},"src/prompt/index.ts":{"bytesInOutput":100},"src/prompt/prompt.ts":{"bytesInOutput":1592}},"bytes":7892}}}
@@ -1,67 +1,53 @@
1
1
  import * as Schema from 'effect/Schema';
2
- import { Type } from '@dxos/echo';
2
+ import { Obj, Type } from '@dxos/echo';
3
3
  import { type FunctionDefinition } from '@dxos/functions';
4
4
  /**
5
5
  * Blueprint schema defines the structure for AI assistant blueprints.
6
6
  * Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.
7
7
  * Blueprints may use tools to create and read artifacts, which are managed by the assistant.
8
8
  */
9
- export declare const Blueprint: Type.obj<Schema.Struct<{
10
- /**
11
- * Global registry ID.
12
- * NOTE: The `key` property refers to the original registry entry.
13
- */
14
- key: Schema.SchemaClass<string, string, never>;
15
- /**
16
- * Human-readable name of the blueprint.
17
- */
18
- name: Schema.SchemaClass<string, string, never>;
19
- /**
20
- * Description of the blueprint's purpose and functionality.
21
- */
22
- description: Schema.optional<typeof Schema.String>;
23
- /**
24
- * Instructions that guide the AI assistant's behavior and responses.
25
- * These are system prompts or guidelines that the AI should follow.
26
- */
27
- instructions: Schema.mutable<Schema.Struct<{
28
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
29
- content: string;
30
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
31
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
32
- name: typeof Schema.String;
33
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
34
- default: Schema.optional<typeof Schema.Any>;
35
- }>>>>>;
36
- }>>;
37
- /**
38
- * Array of tools that the AI assistant can use when this blueprint is active.
39
- */
40
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
41
- }>>;
9
+ export declare const Blueprint: Type.Obj<{
10
+ readonly description?: string | undefined;
11
+ readonly name: string;
12
+ readonly key: string;
13
+ readonly instructions: {
14
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
15
+ readonly content: string;
16
+ }>;
17
+ readonly inputs?: readonly {
18
+ readonly function?: string | undefined;
19
+ readonly name: string;
20
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
21
+ readonly default?: any;
22
+ }[] | undefined;
23
+ };
24
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
25
+ }, Schema.Struct.Fields>;
42
26
  /**
43
27
  * TypeScript type for Blueprint.
44
28
  */
45
29
  export interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {
46
30
  }
31
+ type MakeProps = Pick<Blueprint, 'key' | 'name'> & Partial<Blueprint>;
47
32
  /**
48
33
  * Create a new Blueprint.
49
34
  */
50
- export declare const make: ({ tools, ...props }: Pick<Blueprint, "key" | "name" | "instructions"> & Partial<Blueprint>) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
51
- key: string;
52
- name: string;
53
- description?: string | undefined;
54
- instructions: {
55
- source: import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
56
- content: string;
35
+ export declare const make: ({ tools, instructions, ...props }: MakeProps) => Obj.Obj<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
36
+ readonly description?: string | undefined;
37
+ readonly name: string;
38
+ readonly key: string;
39
+ readonly instructions: {
40
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
41
+ readonly content: string;
57
42
  }>;
58
- inputs?: {
59
- name: string;
60
- kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
61
- default?: any;
43
+ readonly inputs?: readonly {
44
+ readonly function?: string | undefined;
45
+ readonly name: string;
46
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
47
+ readonly default?: any;
62
48
  }[] | undefined;
63
49
  };
64
- tools: (string & import("effect/Brand").Brand<"ToolId">)[];
50
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
65
51
  }>;
66
52
  /**
67
53
  * Util to create tool definitions for a blueprint.
@@ -70,4 +56,5 @@ export declare const toolDefinitions: ({ tools, functions, }: {
70
56
  tools?: string[];
71
57
  functions?: FunctionDefinition[];
72
58
  }) => (string & import("effect/Brand").Brand<"ToolId">)[];
59
+ export {};
73
60
  //# sourceMappingURL=blueprint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/blueprint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D;;;;GAIG;AACH,eAAO,MAAM,SAAS;IACpB;;;OAGG;;IAMH;;OAEG;;IAKH;;OAEG;;IAKH;;;OAGG;;;;;;;;;;;IAKH;;OAEG;;GAaJ,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG;AAE1E;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,qBAA0B,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,cAAc,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;EAC1E,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,uBAG7B;IACD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC,wDAA+F,CAAC"}
1
+ {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/blueprint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAc,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;wBA6CrB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG;AAE1E,KAAK,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,mCAA0D,SAAS;;;;;;;;;;;;;;;;EAKpF,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,uBAG7B;IACD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC,wDAA+F,CAAC"}
@@ -5,6 +5,7 @@ import { type Blueprint } from './blueprint';
5
5
  export declare class Registry {
6
6
  private readonly _blueprints;
7
7
  constructor(blueprints: Blueprint[]);
8
+ get blueprints(): Blueprint[];
8
9
  getByKey(key: string): Blueprint | undefined;
9
10
  query(): Blueprint[];
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAEnC,UAAU,EAAE,SAAS,EAAE;IAcnC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5C,KAAK,IAAI,SAAS,EAAE;CAGrB"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;gBAEnC,UAAU,EAAE,SAAS,EAAE;IAcnC,IAAI,UAAU,IAAI,SAAS,EAAE,CAE5B;IAED,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI5C,KAAK,IAAI,SAAS,EAAE;CAGrB"}
@@ -2,80 +2,53 @@ import * as Schema from 'effect/Schema';
2
2
  import { type Ref, Type } from '@dxos/echo';
3
3
  import { Blueprint } from '../blueprint';
4
4
  /**
5
- * Executable instructions.
6
- * Declare input and output schema.
7
- * May utilize blueprints.
5
+ * Executable instructions, which may use Blueprints.
8
6
  * May reference additional context.
9
7
  */
10
- declare const Prompt_: Type.obj<Schema.Struct<{
11
- /**
12
- * Name of the prompt.
13
- */
14
- name: Schema.optional<typeof Schema.String>;
15
- /**
16
- * Description of the prompt's purpose and functionality.
17
- * Allows AI agents to execute prompts automatically as tools.
18
- */
19
- description: Schema.optional<typeof Schema.String>;
20
- /**
21
- * Input schema of the prompt.
22
- */
23
- input: Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>;
24
- /**
25
- * Output schema of the prompt.
26
- */
27
- output: Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>;
28
- /**
29
- * Natural language instructions for the prompt.
30
- * These should provide concrete course of action for the AI to follow.
31
- */
32
- instructions: Schema.mutable<Schema.Struct<{
33
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
34
- content: string;
35
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
36
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
37
- name: typeof Schema.String;
38
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
39
- default: Schema.optional<typeof Schema.Any>;
40
- }>>>>>;
41
- }>>;
42
- /**
43
- * Blueprints that the prompt may utilize.
44
- */
45
- blueprints: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
46
- key: Schema.SchemaClass<string, string, never>;
47
- name: Schema.SchemaClass<string, string, never>;
48
- description: Schema.optional<typeof Schema.String>;
49
- instructions: Schema.mutable<Schema.Struct<{
50
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
51
- content: string;
52
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
53
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
54
- name: typeof Schema.String;
55
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
56
- default: Schema.optional<typeof Schema.Any>;
57
- }>>>>>;
58
- }>>;
59
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
60
- }>>>>;
61
- /**
62
- * Additional context that the prompt may utilize.
63
- */
64
- context: Schema.Array$<typeof Schema.Any>;
65
- }>>;
66
- export interface Prompt extends Schema.Schema.Type<typeof Prompt_> {
8
+ export declare const Prompt: Type.Obj<{
9
+ readonly description?: string | undefined;
10
+ readonly name?: string | undefined;
11
+ readonly context: readonly any[];
12
+ readonly instructions: {
13
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
14
+ readonly content: string;
15
+ }>;
16
+ readonly inputs?: readonly {
17
+ readonly function?: string | undefined;
18
+ readonly name: string;
19
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
20
+ readonly default?: any;
21
+ }[] | undefined;
22
+ };
23
+ readonly input: import("@dxos/echo/internal").JsonSchemaType;
24
+ readonly output: import("@dxos/echo/internal").JsonSchemaType;
25
+ readonly blueprints: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
26
+ readonly description?: string | undefined;
27
+ readonly name: string;
28
+ readonly key: string;
29
+ readonly instructions: {
30
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
31
+ readonly content: string;
32
+ }>;
33
+ readonly inputs?: readonly {
34
+ readonly function?: string | undefined;
35
+ readonly name: string;
36
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
37
+ readonly default?: any;
38
+ }[] | undefined;
39
+ };
40
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
41
+ }>[];
42
+ }, Schema.Struct.Fields>;
43
+ export interface Prompt extends Schema.Schema.Type<typeof Prompt> {
67
44
  }
68
- export interface Prompt_Encoded extends Schema.Schema.Encoded<typeof Prompt_> {
69
- }
70
- export declare const Prompt: Schema.Schema<Prompt, Prompt_Encoded>;
71
45
  export declare const make: (params: {
72
46
  name?: string;
73
47
  description?: string;
74
48
  input?: Schema.Schema.AnyNoContext;
75
49
  output?: Schema.Schema.AnyNoContext;
76
- instructions: string;
50
+ instructions?: string;
77
51
  blueprints?: Ref.Ref<Blueprint>[];
78
52
  context?: any[];
79
53
  }) => Prompt;
80
- export {};
81
54
  //# sourceMappingURL=prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAO,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC;;;;;GAKG;AACH,QAAA,MAAM,OAAO;IACX;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;;;;;;;;;;IAGH;;OAEG;;;;;;;;;;;;;;;;;IAGH;;OAEG;;GAOJ,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC;CAAG;AACrE,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,OAAO,CAAC;CAAG;AAChF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAW,CAAC;AAErE,eAAO,MAAM,IAAI,GAAI,QAAQ;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB,KAAG,MASA,CAAC"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAA+B,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0ClB,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,eAAO,MAAM,IAAI,GAAI,QAAQ;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB,KAAG,MASA,CAAC"}
@@ -1,5 +1,10 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import type { ObjectNotFoundError } from '@dxos/echo/Err';
3
+ import { FunctionInvocationService, type FunctionNotFoundError, type TracingService } from '@dxos/functions';
4
+ import type { Template } from '..';
1
5
  /**
2
6
  * Process Handlebars template.
3
7
  */
4
8
  export declare const process: <Options extends {}>(source: string, variables?: Partial<Options>) => string;
9
+ export declare const processTemplate: (template: Template.Template) => Effect.Effect<string, ObjectNotFoundError | FunctionNotFoundError, FunctionInvocationService | TracingService>;
5
10
  //# sourceMappingURL=prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/template/prompt.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,EAAE,EAAE,QAAQ,MAAM,EAAE,YAAW,OAAO,CAAC,OAAO,CAAM,KAAG,MAO9F,CAAC"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/template/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAEL,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,EAAE,EAAE,QAAQ,MAAM,EAAE,YAAW,OAAO,CAAC,OAAO,CAAM,KAAG,MAO9F,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,UAAU,QAAQ,CAAC,QAAQ,KAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,qBAAqB,EAAE,yBAAyB,GAAG,cAAc,CAuB5G,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import * as Schema from 'effect/Schema';
2
- import { Type } from '@dxos/echo';
3
2
  import { type ObjectId } from '@dxos/keys';
4
3
  /**
5
4
  * Template input kind determines how template variables are resolved.
@@ -10,29 +9,37 @@ export type InputKind = Schema.Schema.Type<typeof InputKind>;
10
9
  * Template input variable.
11
10
  * E.g., {{foo}}
12
11
  */
13
- export declare const Input: Schema.mutable<Schema.Struct<{
12
+ export declare const Input: Schema.Struct<{
14
13
  name: typeof Schema.String;
15
14
  kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
16
15
  default: Schema.optional<typeof Schema.Any>;
17
- }>>;
16
+ /**
17
+ * Function to call if the kind is 'function'.
18
+ */
19
+ function: Schema.optional<typeof Schema.String>;
20
+ }>;
18
21
  export type Input = Schema.Schema.Type<typeof Input>;
19
22
  /**
20
23
  * Template type.
21
24
  */
22
- export declare const Template: Schema.mutable<Schema.Struct<{
23
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
24
- content: string;
25
+ export declare const Template: Schema.Struct<{
26
+ source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
27
+ readonly content: string;
25
28
  }>, import("@dxos/echo-protocol").EncodedReference, never>;
26
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
29
+ inputs: Schema.optional<Schema.Array$<Schema.Struct<{
27
30
  name: typeof Schema.String;
28
31
  kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
29
32
  default: Schema.optional<typeof Schema.Any>;
30
- }>>>>>;
31
- }>>;
33
+ /**
34
+ * Function to call if the kind is 'function'.
35
+ */
36
+ function: Schema.optional<typeof Schema.String>;
37
+ }>>>;
38
+ }>;
32
39
  export interface Template extends Schema.Schema.Type<typeof Template> {
33
40
  }
34
- export declare const make: ({ source, inputs, id }: {
35
- source: string;
41
+ export declare const make: ({ source, inputs, id, }?: {
42
+ source?: string;
36
43
  inputs?: Input[];
37
44
  id?: ObjectId;
38
45
  }) => Template;
@@ -1 +1 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/template/template.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;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,wBAA6B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAAC,EAAE,CAAC,EAAE,QAAQ,CAAA;CAAE,KAAG,QAGtG,CAAC"}
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/template/template.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;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;;;;IAKhB;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;QAXnB;;WAEG;;;EAYH,CAAC;AAEH,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE,eAAO,MAAM,IAAI,GAAI,0BAIlB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAAC,EAAE,CAAC,EAAE,QAAQ,CAAA;CAAO,KAAG,QAG7D,CAAC"}