@dxos/assistant 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3

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 (117) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/extraction/index.mjs +121 -164
  3. package/dist/lib/browser/extraction/index.mjs.map +4 -4
  4. package/dist/lib/browser/index.mjs +978 -157
  5. package/dist/lib/browser/index.mjs.map +4 -4
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  8. package/dist/lib/node-esm/extraction/index.mjs +121 -164
  9. package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/index.mjs +978 -157
  11. package/dist/lib/node-esm/index.mjs.map +4 -4
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/types/src/conversation/context.d.ts +14 -7
  14. package/dist/types/src/conversation/context.d.ts.map +1 -1
  15. package/dist/types/src/conversation/conversation.d.ts +11 -12
  16. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  17. package/dist/types/src/diff.d.ts.map +1 -1
  18. package/dist/types/src/errors.d.ts +38 -42
  19. package/dist/types/src/errors.d.ts.map +1 -1
  20. package/dist/types/src/execution-graph.d.ts +85 -0
  21. package/dist/types/src/execution-graph.d.ts.map +1 -0
  22. package/dist/types/src/execution-graph.test.d.ts +2 -0
  23. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  24. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
  25. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  26. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +64 -53
  27. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  28. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  29. package/dist/types/src/extraction/extraction.d.ts +24 -13
  30. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  31. package/dist/types/src/extraction/quotes.d.ts +1 -1
  32. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  33. package/dist/types/src/functions/services.d.ts +18 -5
  34. package/dist/types/src/functions/services.d.ts.map +1 -1
  35. package/dist/types/src/index.d.ts +2 -1
  36. package/dist/types/src/index.d.ts.map +1 -1
  37. package/dist/types/src/session/GenericToolkit.d.ts +84 -0
  38. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
  39. package/dist/types/src/session/artifact-diff.d.ts +2 -2
  40. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  41. package/dist/types/src/session/error-handling.d.ts +2 -2
  42. package/dist/types/src/session/error-handling.d.ts.map +1 -1
  43. package/dist/types/src/session/format.d.ts +4 -174
  44. package/dist/types/src/session/format.d.ts.map +1 -1
  45. package/dist/types/src/session/index.d.ts +1 -0
  46. package/dist/types/src/session/index.d.ts.map +1 -1
  47. package/dist/types/src/session/observer.d.ts +3 -3
  48. package/dist/types/src/session/observer.d.ts.map +1 -1
  49. package/dist/types/src/session/session.d.ts +15 -11
  50. package/dist/types/src/session/session.d.ts.map +1 -1
  51. package/dist/types/src/session/toolkit.d.ts +7 -6
  52. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  53. package/dist/types/src/session/version-pin.d.ts +3 -3
  54. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  55. package/dist/types/src/types/artifact.d.ts +20 -0
  56. package/dist/types/src/types/artifact.d.ts.map +1 -0
  57. package/dist/types/src/types/index.d.ts +2 -0
  58. package/dist/types/src/types/index.d.ts.map +1 -0
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +29 -32
  61. package/src/conversation/context.ts +49 -17
  62. package/src/conversation/conversation.ts +30 -25
  63. package/src/diff.test.ts +3 -3
  64. package/src/diff.ts +7 -0
  65. package/src/errors.ts +4 -4
  66. package/src/execution-graph.test.ts +740 -0
  67. package/src/execution-graph.ts +509 -0
  68. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +9 -9
  69. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +47 -55
  70. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +16 -16
  71. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +42 -43
  72. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  73. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
  74. package/src/extraction/extraction.ts +7 -6
  75. package/src/extraction/quotes.test.ts +2 -2
  76. package/src/extraction/quotes.ts +3 -3
  77. package/src/functions/services.ts +93 -50
  78. package/src/index.ts +2 -1
  79. package/src/session/GenericToolkit.ts +130 -0
  80. package/src/session/artifact-diff.ts +2 -2
  81. package/src/session/error-handling.ts +11 -6
  82. package/src/session/format.test.ts +5 -4
  83. package/src/session/format.ts +19 -14
  84. package/src/session/index.ts +2 -0
  85. package/src/session/observer.ts +4 -3
  86. package/src/session/session.conversations.json +1 -0
  87. package/src/session/session.test.ts +51 -210
  88. package/src/session/session.ts +41 -29
  89. package/src/session/toolkit.ts +19 -13
  90. package/src/session/version-pin.ts +4 -5
  91. package/src/templates/{format.tpl → instructions/format.tpl} +4 -2
  92. package/src/templates/{system.tpl → instructions/system.tpl} +10 -12
  93. package/src/templates/system.ts +2 -2
  94. package/src/{types.ts → types/artifact.ts} +22 -3
  95. package/src/types/index.ts +5 -0
  96. package/dist/lib/browser/chunk-6WRGDEMH.mjs +0 -89
  97. package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
  98. package/dist/lib/browser/chunk-N4O3C3T5.mjs +0 -396
  99. package/dist/lib/browser/chunk-N4O3C3T5.mjs.map +0 -7
  100. package/dist/lib/browser/named-entity-recognition-O46UTCLR.mjs +0 -13
  101. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs +0 -91
  102. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-QVJ7EAM2.mjs +0 -398
  104. package/dist/lib/node-esm/chunk-QVJ7EAM2.mjs.map +0 -7
  105. package/dist/lib/node-esm/named-entity-recognition-W4VMRCH6.mjs +0 -14
  106. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  107. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  108. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  109. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  110. package/dist/types/src/types.d.ts +0 -16
  111. package/dist/types/src/types.d.ts.map +0 -1
  112. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  113. package/src/session/version-pin.test.ts +0 -7
  114. package/src/summarization/summarization.test.ts +0 -197
  115. /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  116. /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
  117. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1,5 +1,6 @@
1
- import { Effect } from 'effect';
2
- import { type AiSessionRunParams } from './session';
1
+ import * as Effect from 'effect/Effect';
2
+ import { Message } from '@dxos/types';
3
+ import { type AiSessionRunError, type AiSessionRunParams } from './session';
3
4
  /**
4
5
  * Formats the system prompt.
5
6
  */
@@ -7,176 +8,5 @@ export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick
7
8
  /**
8
9
  * Formats the user prompt.
9
10
  */
10
- export declare const formatUserPrompt: ({ prompt, history }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<import("@dxos/live-object").Live<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
11
- id: string;
12
- parentMessage?: string | undefined;
13
- created: string;
14
- sender: {
15
- name?: string | undefined;
16
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
17
- fields?: {
18
- readonly value: string;
19
- readonly category?: string | undefined;
20
- readonly label: string;
21
- }[] | undefined;
22
- image?: string | undefined;
23
- fullName?: string | undefined;
24
- preferredName?: string | undefined;
25
- nickname?: string | undefined;
26
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
27
- id: string;
28
- name?: string | undefined;
29
- description?: string | undefined;
30
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
31
- image?: string | undefined;
32
- website?: string | undefined;
33
- }> | undefined;
34
- jobTitle?: string | undefined;
35
- department?: string | undefined;
36
- notes?: string | undefined;
37
- emails?: {
38
- readonly value: string;
39
- readonly label?: string | undefined;
40
- }[] | undefined;
41
- identities?: {
42
- readonly value: string;
43
- readonly label?: string | undefined;
44
- }[] | undefined;
45
- phoneNumbers?: {
46
- readonly value: string;
47
- readonly label?: string | undefined;
48
- }[] | undefined;
49
- addresses?: {
50
- readonly value: {
51
- readonly street?: string | undefined;
52
- readonly extended?: string | undefined;
53
- readonly locality?: string | undefined;
54
- readonly region?: string | undefined;
55
- readonly postalCode?: string | undefined;
56
- readonly postOfficeBoxNumber?: string | undefined;
57
- readonly country?: string | undefined;
58
- };
59
- readonly label?: string | undefined;
60
- }[] | undefined;
61
- urls?: {
62
- readonly value: string;
63
- readonly label?: string | undefined;
64
- }[] | undefined;
65
- birthday?: string | undefined;
66
- }> | undefined;
67
- identityDid?: string | undefined;
68
- identityKey?: string | undefined;
69
- email?: string | undefined;
70
- role?: "user" | "assistant" | undefined;
71
- };
72
- blocks: ({
73
- version: unknown;
74
- _tag: "anchor";
75
- pending?: boolean | undefined;
76
- objectId: string;
77
- } | {
78
- name?: string | undefined;
79
- _tag: "file";
80
- url: string;
81
- pending?: boolean | undefined;
82
- mediaType?: string | undefined;
83
- } | {
84
- id?: string | undefined;
85
- source?: {
86
- type: "base64";
87
- mediaType: string;
88
- data: string;
89
- } | {
90
- type: "http";
91
- url: string;
92
- } | undefined;
93
- _tag: "image";
94
- pending?: boolean | undefined;
95
- } | {
96
- _tag: "json";
97
- pending?: boolean | undefined;
98
- data: string;
99
- disposition?: string | undefined;
100
- } | {
101
- text: string;
102
- _tag: "proposal";
103
- pending?: boolean | undefined;
104
- } | {
105
- _tag: "reasoning";
106
- reasoningText?: string | undefined;
107
- signature?: string | undefined;
108
- redactedText?: string | undefined;
109
- pending?: boolean | undefined;
110
- } | {
111
- _tag: "reference";
112
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
113
- pending?: boolean | undefined;
114
- } | {
115
- _tag: "select";
116
- pending?: boolean | undefined;
117
- options: readonly string[];
118
- } | {
119
- _tag: "status";
120
- pending?: boolean | undefined;
121
- statusText: string;
122
- } | {
123
- text: string;
124
- _tag: "suggestion";
125
- pending?: boolean | undefined;
126
- } | {
127
- _tag: "summary";
128
- model?: string | undefined;
129
- usage?: {
130
- readonly inputTokens?: number | undefined;
131
- readonly outputTokens?: number | undefined;
132
- readonly totalTokens?: number | undefined;
133
- } | undefined;
134
- pending?: boolean | undefined;
135
- mimeType?: string | undefined;
136
- message?: string | undefined;
137
- toolCalls?: number | undefined;
138
- errors?: number | undefined;
139
- duration?: number | undefined;
140
- } | {
141
- text: string;
142
- _tag: "text";
143
- pending?: boolean | undefined;
144
- disposition?: string | undefined;
145
- mimeType?: string | undefined;
146
- } | {
147
- _tag: "toolkit";
148
- pending?: boolean | undefined;
149
- } | {
150
- name: string;
151
- _tag: "toolCall";
152
- pending?: boolean | undefined;
153
- toolCallId: string;
154
- input: string;
155
- } | {
156
- name: string;
157
- _tag: "toolResult";
158
- error?: string | undefined;
159
- pending?: boolean | undefined;
160
- toolCallId: string;
161
- result?: string | undefined;
162
- } | {
163
- text: string;
164
- _tag: "transcript";
165
- pending?: boolean | undefined;
166
- started: string;
167
- })[];
168
- properties?: {
169
- [x: string]: any;
170
- } | undefined;
171
- }>, {
172
- #code: "AI_ASSISTANT_ERROR";
173
- #context: Record<string, unknown>;
174
- readonly name: "AI_ASSISTANT_ERROR";
175
- readonly code: "AI_ASSISTANT_ERROR";
176
- readonly _tag: "AI_ASSISTANT_ERROR";
177
- readonly context: Record<string, unknown>;
178
- message: string;
179
- stack?: string;
180
- cause?: unknown;
181
- }, never>;
11
+ export declare const formatUserPrompt: ({ prompt, history, }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<Message.Message, AiSessionRunError>;
182
12
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"AAIA,OAAO,EAAS,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAcrD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;GAEG;AAEH,eAAO,MAAM,kBAAkB,GAAI,kCAIhC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,wCAsCjE,CAAC;AAEL;;GAEG;AAGH,eAAO,MAAM,gBAAgB,GAAI,qBAA0B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoC1G,CAAC"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AASxC,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAMzD,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE5E;;GAEG;AAEH,eAAO,MAAM,kBAAkB,GAAI,kCAIhC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,wCAsCjE,CAAC;AAEL;;GAEG;AAGH,eAAO,MAAM,gBAAgB,GAAI,sBAG9B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAoCrG,CAAC"}
@@ -3,4 +3,5 @@ export * from './observer';
3
3
  export * from './session';
4
4
  export * from './toolkit';
5
5
  export * from './version-pin';
6
+ export * as GenericToolkit from './GenericToolkit';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAE9B,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC"}
@@ -1,6 +1,6 @@
1
- import { Effect } from 'effect';
1
+ import * as Effect from 'effect/Effect';
2
2
  import { type AiParser, type ConsolePrinter } from '@dxos/ai';
3
- import { type DataType } from '@dxos/schema';
3
+ import { type Message } from '@dxos/types';
4
4
  /**
5
5
  * Live observer of the generation process.
6
6
  */
@@ -9,7 +9,7 @@ export interface GenerationObserver extends AiParser.ParseResponseCallbacks {
9
9
  * Complete messages fired during the session, both from the model and from the user.
10
10
  * This message will contain all message blocks emitted through the `onBlock` callback.
11
11
  */
12
- onMessage: (message: DataType.Message) => Effect.Effect<void>;
12
+ onMessage: (message: Message.Message) => Effect.Effect<void>;
13
13
  }
14
14
  export declare const GenerationObserver: Readonly<{
15
15
  make: ({ onBegin, onPart, onBlock, onEnd, onMessage, }?: Partial<GenerationObserver>) => GenerationObserver;
@@ -1 +1 @@
1
- {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAY,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ,CAAC,sBAAsB;IACzE;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
1
+ {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ,CAAC,sBAAsB;IACzE;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
@@ -1,21 +1,25 @@
1
- import { type AiError, AiLanguageModel, type AiTool, type AiToolkit } from '@effect/ai';
2
- import { Effect, type Schema } from 'effect';
3
- import { type AiInputPreprocessingError, type AiToolNotFoundError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
1
+ import type * as AiError from '@effect/ai/AiError';
2
+ import * as LanguageModel from '@effect/ai/LanguageModel';
3
+ import type * as Tool from '@effect/ai/Tool';
4
+ import type * as Toolkit from '@effect/ai/Toolkit';
5
+ import * as Effect from 'effect/Effect';
6
+ import type * as Schema from 'effect/Schema';
7
+ import { type AiToolNotFoundError, type PromptPreprocessingError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
4
8
  import { type Blueprint } from '@dxos/blueprints';
5
9
  import { Obj } from '@dxos/echo';
6
10
  import { TracingService } from '@dxos/functions';
7
- import { DataType } from '@dxos/schema';
11
+ import { Message } from '@dxos/types';
8
12
  import { type AiAssistantError } from '../errors';
9
13
  import { GenerationObserver } from './observer';
10
- export type AiSessionRunError = AiError.AiError | AiInputPreprocessingError | AiToolNotFoundError | AiAssistantError;
11
- export type AiSessionRunRequirements = AiLanguageModel.AiLanguageModel | ToolExecutionService | ToolResolverService | TracingService;
12
- export type AiSessionRunParams<Tools extends AiTool.Any> = {
14
+ export type AiSessionRunError = AiError.AiError | PromptPreprocessingError | AiToolNotFoundError | AiAssistantError;
15
+ export type AiSessionRunRequirements = LanguageModel.LanguageModel | ToolExecutionService | ToolResolverService | TracingService;
16
+ export type AiSessionRunParams<Tools extends Record<string, Tool.Any>> = {
13
17
  prompt: string;
14
18
  system?: string;
15
- history?: DataType.Message[];
19
+ history?: Message.Message[];
16
20
  objects?: Obj.Any[];
17
21
  blueprints?: Blueprint.Blueprint[];
18
- toolkit?: AiToolkit.ToHandler<Tools>;
22
+ toolkit?: Toolkit.WithHandler<Tools>;
19
23
  observer?: GenerationObserver;
20
24
  };
21
25
  export type AiSessionOptions = {};
@@ -38,10 +42,10 @@ export declare class AiSession {
38
42
  /** Pending messages for this session (incl. the current prompt). */
39
43
  private _pending;
40
44
  constructor(_options?: AiSessionOptions);
41
- run: <Tools extends AiTool.Any>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, observer, }: AiSessionRunParams<Tools>) => Effect.Effect<DataType.Message[], AiSessionRunError, AiSessionRunRequirements>;
45
+ run: <Tools extends Record<string, Tool.Any>>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, observer, }: AiSessionRunParams<Tools>) => Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
42
46
  /**
43
47
  * @deprecated
44
48
  */
45
- runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<AiTool.Any>): Promise<Schema.Schema.Type<S>>;
49
+ runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<any>): Promise<Schema.Schema.Type<S>>;
46
50
  }
47
51
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/session/session.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,eAAe,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EAAS,MAAM,EAAE,KAAK,MAAM,EAAU,MAAM,QAAQ,CAAC;AAE5D,OAAO,EACL,KAAK,yBAAyB,EAG9B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAGzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CASlC"}
@@ -1,14 +1,15 @@
1
- import { type AiTool, AiToolkit } from '@effect/ai';
2
- import { Effect } from 'effect';
3
- import { ToolExecutionService, type ToolId, ToolResolverService } from '@dxos/ai';
1
+ import type * as Tool from '@effect/ai/Tool';
2
+ import * as Toolkit from '@effect/ai/Toolkit';
3
+ import * as Effect from 'effect/Effect';
4
+ import { type AiToolNotFoundError, ToolExecutionService, type ToolId, ToolResolverService } from '@dxos/ai';
4
5
  import { type Blueprint } from '@dxos/blueprints';
5
- export type ToolkitParams<Tools extends AiTool.Any> = {
6
- toolkit?: AiToolkit.AiToolkit<Tools>;
6
+ export type ToolkitParams<Tools extends Record<string, Tool.Any>> = {
7
+ toolkit?: Toolkit.Toolkit<Tools>;
7
8
  toolIds?: ToolId[];
8
9
  blueprints?: Blueprint.Blueprint[];
9
10
  };
10
11
  /**
11
12
  * Build a combined toolkit from the blueprint tools and the provided toolkit.
12
13
  */
13
- export declare const createToolkit: <Tools extends AiTool.Any>({ toolkit: toolkitParam, toolIds, blueprints, }: ToolkitParams<Tools>) => Effect.Effect<AiToolkit.ToHandler<any>, import("@dxos/ai").AiToolNotFoundError, ToolExecutionService | ToolResolverService | AiTool.ToHandler<Tools>>;
14
+ export declare const createToolkit: <Tools extends Record<string, Tool.Any> = {}>({ toolkit: toolkitParam, toolIds, blueprints, }: ToolkitParams<Tools>) => Effect.Effect<Toolkit.WithHandler<any>, AiToolNotFoundError, ToolResolverService | ToolExecutionService | Tool.HandlersFor<Tools>>;
14
15
  //# sourceMappingURL=toolkit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAgB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,oBAAoB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CAAC,GAAG,EAAE,EAAE,iDAIxE,aAAa,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,MAAM,CACrC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EACxB,mBAAmB,EACnB,mBAAmB,GAAG,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAkBlE,CAAC"}
@@ -1,7 +1,7 @@
1
- import { Schema } from 'effect';
1
+ import * as Schema from 'effect/Schema';
2
+ import { type AnyEchoObject } from '@dxos/echo/internal';
2
3
  import { type ObjectVersion } from '@dxos/echo-db';
3
- import { type AnyEchoObject } from '@dxos/echo-schema';
4
- import { type ContentBlock } from '@dxos/schema';
4
+ import { type ContentBlock } from '@dxos/types';
5
5
  declare const VersionPinSchema: Schema.Struct<{
6
6
  objectId: import("@dxos/keys").ObjectIdClass;
7
7
  version: Schema.Schema<ObjectVersion, ObjectVersion, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD,QAAA,MAAM,gBAAgB;;;EAKpB,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAElF,eAAO,MAAM,UAAU,EAAE,OAAO,gBAAgB,GAAG;IACjD,WAAW,EAAE,aAAa,CAAC;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,UAAU,CAAC;IAClD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,YAAY,CAAC,GAAG,CAAC;CAiBpD,CAAC"}
1
+ {"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,QAAA,MAAM,gBAAgB;;;EAKpB,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAElF,eAAO,MAAM,UAAU,EAAE,OAAO,gBAAgB,GAAG;IACjD,WAAW,EAAE,aAAa,CAAC;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,UAAU,CAAC;IAClD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,YAAY,CAAC,GAAG,CAAC;CAiBpD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type * as Effect from 'effect/Effect';
2
+ import * as Schema from 'effect/Schema';
3
+ import { type ObjectNotFoundError, type Type } from '@dxos/echo';
4
+ import { type ObjectId } from '@dxos/echo/internal';
5
+ import { DatabaseService } from '@dxos/echo-db';
6
+ import { DXN, type SpaceId } from '@dxos/keys';
7
+ /**
8
+ * @deprecated
9
+ */
10
+ export declare const createArtifactElement: (id: ObjectId) => string;
11
+ /**
12
+ * A model-friendly way to reference an object.
13
+ * Supports vairous formats that will be normalized to a DXN.
14
+ */
15
+ export declare const ArtifactId: Schema.Schema<string> & {
16
+ toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
17
+ resolve: <S extends Type.Obj.Any | Type.Relation.Any>(schema: S, ref: ArtifactId) => Effect.Effect<Schema.Schema.Type<S>, ObjectNotFoundError, DatabaseService>;
18
+ };
19
+ export type ArtifactId = Schema.Schema.Type<typeof ArtifactId>;
20
+ //# sourceMappingURL=artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../../src/types/artifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,GAAG,EAAmB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAGhE;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,IAAI,QAAQ,WAA4B,CAAC;AAE/E;;;GAGG;AAEH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG;IAC/C,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC;IAC/D,OAAO,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAClD,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,UAAU,KACZ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC;CAwCjF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './artifact';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}