@dxos/assistant 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (152) hide show
  1. package/README.md +1 -0
  2. package/dist/lib/neutral/extraction/index.mjs +202 -0
  3. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  4. package/dist/lib/neutral/index.mjs +1736 -0
  5. package/dist/lib/neutral/index.mjs.map +7 -0
  6. package/dist/lib/neutral/meta.json +1 -0
  7. package/dist/types/src/conversation/context.d.ts +124 -64
  8. package/dist/types/src/conversation/context.d.ts.map +1 -1
  9. package/dist/types/src/conversation/context.test.d.ts +2 -0
  10. package/dist/types/src/conversation/context.test.d.ts.map +1 -0
  11. package/dist/types/src/conversation/index.d.ts +1 -1
  12. package/dist/types/src/conversation/index.d.ts.map +1 -1
  13. package/dist/types/src/conversation/session.d.ts +73 -0
  14. package/dist/types/src/conversation/session.d.ts.map +1 -0
  15. package/dist/types/src/diff.d.ts +3 -1
  16. package/dist/types/src/diff.d.ts.map +1 -1
  17. package/dist/types/src/errors.d.ts +40 -48
  18. package/dist/types/src/errors.d.ts.map +1 -1
  19. package/dist/types/src/execution-graph.d.ts +85 -0
  20. package/dist/types/src/execution-graph.d.ts.map +1 -0
  21. package/dist/types/src/execution-graph.test.d.ts +2 -0
  22. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  23. package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
  24. package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -1
  25. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  26. package/dist/types/src/extraction/extraction.d.ts +1066 -303
  27. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  28. package/dist/types/src/extraction/index.d.ts +0 -1
  29. package/dist/types/src/extraction/index.d.ts.map +1 -1
  30. package/dist/types/src/extraction/quotes.d.ts +3 -3
  31. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  32. package/dist/types/src/functions/services.d.ts +15 -5
  33. package/dist/types/src/functions/services.d.ts.map +1 -1
  34. package/dist/types/src/index.d.ts +3 -1
  35. package/dist/types/src/index.d.ts.map +1 -1
  36. package/dist/types/src/session/artifact-diff.d.ts +2 -2
  37. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  38. package/dist/types/src/session/error-handling.d.ts +2 -2
  39. package/dist/types/src/session/error-handling.d.ts.map +1 -1
  40. package/dist/types/src/session/format.d.ts +8 -175
  41. package/dist/types/src/session/format.d.ts.map +1 -1
  42. package/dist/types/src/session/index.d.ts +2 -1
  43. package/dist/types/src/session/index.d.ts.map +1 -1
  44. package/dist/types/src/session/observer.d.ts +7 -6
  45. package/dist/types/src/session/observer.d.ts.map +1 -1
  46. package/dist/types/src/session/request.d.ts +104 -0
  47. package/dist/types/src/session/request.d.ts.map +1 -0
  48. package/dist/types/src/session/toolkit.d.ts +11 -9
  49. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  50. package/dist/types/src/session/version-pin.d.ts +4 -4
  51. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  52. package/dist/types/src/templates/system.d.ts +1 -2
  53. package/dist/types/src/templates/system.d.ts.map +1 -1
  54. package/dist/types/src/tracing.d.ts +233 -0
  55. package/dist/types/src/tracing.d.ts.map +1 -0
  56. package/dist/types/src/types/artifact.d.ts +28 -0
  57. package/dist/types/src/types/artifact.d.ts.map +1 -0
  58. package/dist/types/src/types/index.d.ts +2 -0
  59. package/dist/types/src/types/index.d.ts.map +1 -0
  60. package/dist/types/tsconfig.tsbuildinfo +1 -1
  61. package/package.json +35 -46
  62. package/src/conversation/context.test.ts +52 -0
  63. package/src/conversation/context.ts +324 -75
  64. package/src/conversation/index.ts +1 -1
  65. package/src/conversation/session.ts +323 -0
  66. package/src/diff.test.ts +37 -6
  67. package/src/diff.ts +18 -4
  68. package/src/errors.ts +4 -4
  69. package/src/execution-graph.test.ts +740 -0
  70. package/src/execution-graph.ts +519 -0
  71. package/src/extraction/extraction-ner-function/index.ts +0 -1
  72. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  73. package/src/extraction/extraction.ts +44 -15
  74. package/src/extraction/index.ts +0 -1
  75. package/src/extraction/quotes.test.ts +2 -2
  76. package/src/extraction/quotes.ts +6 -7
  77. package/src/functions/services.ts +156 -61
  78. package/src/index.ts +3 -1
  79. package/src/session/artifact-diff.ts +2 -2
  80. package/src/session/error-handling.ts +11 -6
  81. package/src/session/format.ts +35 -27
  82. package/src/session/index.ts +2 -1
  83. package/src/session/observer.ts +8 -4
  84. package/src/session/request.ts +347 -0
  85. package/src/session/toolkit.ts +32 -27
  86. package/src/session/version-pin.ts +7 -7
  87. package/src/templates/{format.tpl → instructions/format.tpl} +1 -4
  88. package/src/templates/instructions/system.tpl +96 -0
  89. package/src/templates/system.ts +9 -8
  90. package/src/tracing.ts +57 -0
  91. package/src/{types.ts → types/artifact.ts} +44 -7
  92. package/src/types/index.ts +5 -0
  93. package/dist/lib/browser/chunk-5GJYG2ML.mjs +0 -396
  94. package/dist/lib/browser/chunk-5GJYG2ML.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  96. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  97. package/dist/lib/browser/extraction/index.mjs +0 -268
  98. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  99. package/dist/lib/browser/index.mjs +0 -469
  100. package/dist/lib/browser/index.mjs.map +0 -7
  101. package/dist/lib/browser/meta.json +0 -1
  102. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  103. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs.map +0 -7
  104. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +0 -91
  105. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-FLFCEB4P.mjs +0 -398
  107. package/dist/lib/node-esm/chunk-FLFCEB4P.mjs.map +0 -7
  108. package/dist/lib/node-esm/extraction/index.mjs +0 -269
  109. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  110. package/dist/lib/node-esm/index.mjs +0 -470
  111. package/dist/lib/node-esm/index.mjs.map +0 -7
  112. package/dist/lib/node-esm/meta.json +0 -1
  113. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +0 -14
  114. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs.map +0 -7
  115. package/dist/types/src/conversation/conversation.d.ts +0 -42
  116. package/dist/types/src/conversation/conversation.d.ts.map +0 -1
  117. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
  118. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
  119. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
  120. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
  121. package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
  122. package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
  123. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -337
  124. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
  125. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
  126. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
  127. package/dist/types/src/session/format.test.d.ts +0 -2
  128. package/dist/types/src/session/format.test.d.ts.map +0 -1
  129. package/dist/types/src/session/session.d.ts +0 -47
  130. package/dist/types/src/session/session.d.ts.map +0 -1
  131. package/dist/types/src/session/session.test.d.ts +0 -2
  132. package/dist/types/src/session/session.test.d.ts.map +0 -1
  133. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  134. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  135. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  136. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  137. package/dist/types/src/types.d.ts +0 -16
  138. package/dist/types/src/types.d.ts.map +0 -1
  139. package/src/conversation/conversation.ts +0 -123
  140. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -84
  141. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -70
  142. package/src/extraction/extraction-llm-function/index.ts +0 -5
  143. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
  144. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -62
  145. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  146. package/src/session/format.test.ts +0 -60
  147. package/src/session/session.test.ts +0 -308
  148. package/src/session/session.ts +0 -201
  149. package/src/session/version-pin.test.ts +0 -7
  150. package/src/summarization/summarization.test.ts +0 -197
  151. package/src/templates/system.tpl +0 -50
  152. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1,14 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- combineNerTokens,
4
- createTokenGroups,
5
- extractFullEntities,
6
- getNer
7
- } from "./chunk-BCFXTNSK.mjs";
8
- export {
9
- combineNerTokens,
10
- createTokenGroups,
11
- extractFullEntities,
12
- getNer
13
- };
14
- //# sourceMappingURL=named-entity-recognition-2HDF46YX.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,42 +0,0 @@
1
- import { type AiTool, type AiToolkit } from '@effect/ai';
2
- import { Effect } from 'effect';
3
- import { type Queue } from '@dxos/echo-db';
4
- import { DataType } from '@dxos/schema';
5
- import { type AiSessionRunError, type AiSessionRunRequirements, type GenerationObserver } from '../session';
6
- import { AiContextBinder, type ContextBinding } from './context';
7
- export type AiConversationRunRequirements<Tools extends AiTool.Any> = AiSessionRunRequirements | AiTool.ToHandler<Tools>;
8
- export interface AiConversationRunParams {
9
- prompt: string;
10
- system?: string;
11
- observer?: GenerationObserver;
12
- }
13
- export type AiConversationOptions = {
14
- queue: Queue<DataType.Message | ContextBinding>;
15
- };
16
- /**
17
- * Durable conversation state (initiated by users and agents) backed by a Queue.
18
- * Executes tools based on AI responses and supports cancellation of in-progress requests.
19
- */
20
- export declare class AiConversation {
21
- /**
22
- * Message and binding queue.
23
- */
24
- private readonly _queue;
25
- /**
26
- * Blueprints bound to the conversation.
27
- */
28
- private readonly _context;
29
- /**
30
- * Toolkit from the current session request.
31
- */
32
- private _toolkit;
33
- constructor(options: AiConversationOptions);
34
- get context(): AiContextBinder;
35
- get toolkit(): AiToolkit.ToHandler<AiTool.Any> | undefined;
36
- getHistory(): Promise<DataType.Message[]>;
37
- /**
38
- * Creates a new cancelable request effect.
39
- */
40
- createRequest<Tools extends AiTool.Any>(params: AiConversationRunParams): Effect.Effect<DataType.Message[], AiSessionRunError, AiConversationRunRequirements<Tools>>;
41
- }
42
- //# sourceMappingURL=conversation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAS,MAAM,EAAU,MAAM,QAAQ,CAAC;AAG/C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAoB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEnF,MAAM,MAAM,6BAA6B,CAAC,KAAK,SAAS,MAAM,CAAC,GAAG,IAC9D,wBAAwB,GACxB,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAE5B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAG,cAAc,CAAC,CAAC;CACjD,CAAC;AAEF;;;GAGG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAElE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAA8C;gBAE3C,OAAO,EAAE,qBAAqB;IAKjD,IAAW,OAAO,oBAEjB;IAED,IAAW,OAAO,gDAEjB;IAEY,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAKtD;;OAEG;IACH,aAAa,CAAC,KAAK,SAAS,MAAM,CAAC,GAAG,EACpC,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,6BAA6B,CAAC,KAAK,CAAC,CAAC;CA0C9F"}
@@ -1,4 +0,0 @@
1
- import { type FunctionDefinition } from '@dxos/functions';
2
- import { ExtractionInput, ExtractionOutput } from '../extraction';
3
- export declare const extractionAnthropicFunction: FunctionDefinition<ExtractionInput, ExtractionOutput>;
4
- //# sourceMappingURL=extraction-llm-function.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-llm-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKlE,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAkD5F,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=extraction-llm-function.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-llm-function.test.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './extraction-llm-function';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/index.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC"}
@@ -1,337 +0,0 @@
1
- /**
2
- * Named Entity Recognition model
3
- */
4
- export declare const extractionNerFunction: import("@dxos/functions").FunctionDefinition<{
5
- readonly objects?: readonly import("@dxos/echo-schema").Expando[] | undefined;
6
- readonly options?: {
7
- readonly timeout?: number | undefined;
8
- readonly fallbackToRaw?: boolean | undefined;
9
- } | undefined;
10
- readonly message: 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
- description?: string | undefined;
29
- name?: 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
- }, {
173
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
174
- id: string;
175
- parentMessage?: string | undefined;
176
- created: string;
177
- sender: {
178
- name?: string | undefined;
179
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
180
- fields?: {
181
- readonly value: string;
182
- readonly category?: string | undefined;
183
- readonly label: string;
184
- }[] | undefined;
185
- image?: string | undefined;
186
- fullName?: string | undefined;
187
- preferredName?: string | undefined;
188
- nickname?: string | undefined;
189
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
190
- id: string;
191
- description?: string | undefined;
192
- name?: string | undefined;
193
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
194
- image?: string | undefined;
195
- website?: string | undefined;
196
- }> | undefined;
197
- jobTitle?: string | undefined;
198
- department?: string | undefined;
199
- notes?: string | undefined;
200
- emails?: {
201
- readonly value: string;
202
- readonly label?: string | undefined;
203
- }[] | undefined;
204
- identities?: {
205
- readonly value: string;
206
- readonly label?: string | undefined;
207
- }[] | undefined;
208
- phoneNumbers?: {
209
- readonly value: string;
210
- readonly label?: string | undefined;
211
- }[] | undefined;
212
- addresses?: {
213
- readonly value: {
214
- readonly street?: string | undefined;
215
- readonly extended?: string | undefined;
216
- readonly locality?: string | undefined;
217
- readonly region?: string | undefined;
218
- readonly postalCode?: string | undefined;
219
- readonly postOfficeBoxNumber?: string | undefined;
220
- readonly country?: string | undefined;
221
- };
222
- readonly label?: string | undefined;
223
- }[] | undefined;
224
- urls?: {
225
- readonly value: string;
226
- readonly label?: string | undefined;
227
- }[] | undefined;
228
- birthday?: string | undefined;
229
- }> | undefined;
230
- identityDid?: string | undefined;
231
- identityKey?: string | undefined;
232
- email?: string | undefined;
233
- role?: "user" | "assistant" | undefined;
234
- };
235
- blocks: ({
236
- version: unknown;
237
- _tag: "anchor";
238
- pending?: boolean | undefined;
239
- objectId: string;
240
- } | {
241
- name?: string | undefined;
242
- _tag: "file";
243
- url: string;
244
- pending?: boolean | undefined;
245
- mediaType?: string | undefined;
246
- } | {
247
- id?: string | undefined;
248
- source?: {
249
- type: "base64";
250
- mediaType: string;
251
- data: string;
252
- } | {
253
- type: "http";
254
- url: string;
255
- } | undefined;
256
- _tag: "image";
257
- pending?: boolean | undefined;
258
- } | {
259
- _tag: "json";
260
- pending?: boolean | undefined;
261
- data: string;
262
- disposition?: string | undefined;
263
- } | {
264
- text: string;
265
- _tag: "proposal";
266
- pending?: boolean | undefined;
267
- } | {
268
- _tag: "reasoning";
269
- reasoningText?: string | undefined;
270
- signature?: string | undefined;
271
- redactedText?: string | undefined;
272
- pending?: boolean | undefined;
273
- } | {
274
- _tag: "reference";
275
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
276
- pending?: boolean | undefined;
277
- } | {
278
- _tag: "select";
279
- pending?: boolean | undefined;
280
- options: readonly string[];
281
- } | {
282
- _tag: "status";
283
- pending?: boolean | undefined;
284
- statusText: string;
285
- } | {
286
- text: string;
287
- _tag: "suggestion";
288
- pending?: boolean | undefined;
289
- } | {
290
- _tag: "summary";
291
- model?: string | undefined;
292
- usage?: {
293
- readonly inputTokens?: number | undefined;
294
- readonly outputTokens?: number | undefined;
295
- readonly totalTokens?: number | undefined;
296
- } | undefined;
297
- pending?: boolean | undefined;
298
- mimeType?: string | undefined;
299
- message?: string | undefined;
300
- toolCalls?: number | undefined;
301
- errors?: number | undefined;
302
- duration?: number | undefined;
303
- } | {
304
- text: string;
305
- _tag: "text";
306
- pending?: boolean | undefined;
307
- disposition?: string | undefined;
308
- mimeType?: string | undefined;
309
- } | {
310
- _tag: "toolkit";
311
- pending?: boolean | undefined;
312
- } | {
313
- name: string;
314
- _tag: "toolCall";
315
- pending?: boolean | undefined;
316
- toolCallId: string;
317
- input: string;
318
- } | {
319
- name: string;
320
- _tag: "toolResult";
321
- error?: string | undefined;
322
- pending?: boolean | undefined;
323
- toolCallId: string;
324
- result?: string | undefined;
325
- } | {
326
- text: string;
327
- _tag: "transcript";
328
- pending?: boolean | undefined;
329
- started: string;
330
- })[];
331
- properties?: {
332
- [x: string]: any;
333
- } | undefined;
334
- };
335
- readonly timeElapsed: number;
336
- }>;
337
- //# sourceMappingURL=extraction-ner-function.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAiBA;;GAEG;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwChC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=extraction-ner-function.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-ner-function.test.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=format.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../../../src/session/format.test.ts"],"names":[],"mappings":""}
@@ -1,47 +0,0 @@
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';
4
- import { type Blueprint } from '@dxos/blueprints';
5
- import { Obj } from '@dxos/echo';
6
- import { TracingService } from '@dxos/functions';
7
- import { DataType } from '@dxos/schema';
8
- import { type AiAssistantError } from '../errors';
9
- 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> = {
13
- prompt: string;
14
- system?: string;
15
- history?: DataType.Message[];
16
- objects?: Obj.Any[];
17
- blueprints?: Blueprint.Blueprint[];
18
- toolkit?: AiToolkit.ToHandler<Tools>;
19
- observer?: GenerationObserver;
20
- };
21
- export type AiSessionOptions = {};
22
- /**
23
- * Contains message history, tools, current context.
24
- * Current context means the state of the app, time of day, and other contextual information.
25
- * It makes requests to the model, its a state machine.
26
- * It keeps track of the current goal.
27
- * It manages the context window.
28
- * Tracks the success criteria of reaching the goal, exposing metrics (stretch).
29
- * Could be run locally in the app or remotely.
30
- * Could be personal or shared.
31
- */
32
- export declare class AiSession {
33
- private readonly _options;
34
- /** Prevents concurrent execution of session. */
35
- private readonly _semaphore;
36
- /** Message history from queue. */
37
- private _history;
38
- /** Pending messages for this session (incl. the current prompt). */
39
- private _pending;
40
- 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>;
42
- /**
43
- * @deprecated
44
- */
45
- runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<AiTool.Any>): Promise<Schema.Schema.Type<S>>;
46
- }
47
- //# sourceMappingURL=session.d.ts.map
@@ -1 +0,0 @@
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,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,yBAAyB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAErH,MAAM,MAAM,wBAAwB,GAChC,eAAe,CAAC,eAAe,GAC/B,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,CAAC;AAEnB,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,CAAC,GAAG,IAAI;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC;;;;;;;;;GASG;AACH,qBAAa,SAAS;IAWR,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAVrC,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA2C;IAEtE,kCAAkC;IAElC,OAAO,CAAC,QAAQ,CAA0B;IAE1C,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAA0B;gBAEb,QAAQ,GAAE,gBAAqB;IAE5D,GAAG,GAAI,KAAK,SAAS,MAAM,CAAC,GAAG,EAAE,sFAQ9B,kBAAkB,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC,CAkGjC;IAE5E;;OAEG;IAEG,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,EACtD,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CASlC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=session.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session.test.d.ts","sourceRoot":"","sources":["../../../../src/session/session.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=version-pin.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version-pin.test.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=summarization.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"summarization.test.d.ts","sourceRoot":"","sources":["../../../../src/summarization/summarization.test.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- import { Schema } from 'effect';
2
- import { type ObjectId } from '@dxos/echo-schema';
3
- import { DXN, type SpaceId } from '@dxos/keys';
4
- /**
5
- * @deprecated
6
- */
7
- export declare const createArtifactElement: (id: ObjectId) => string;
8
- /**
9
- * A model-friendly way to reference an object.
10
- * Supports vairous formats that will be normalized to a DXN.
11
- */
12
- export declare const ArtifactId: Schema.Schema<string> & {
13
- toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
14
- };
15
- export type ArtifactId = Schema.Schema.Type<typeof ArtifactId>;
16
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,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;CA4BhE,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC"}