@dxos/assistant 0.8.4-main.ead640a → 0.8.4-main.ef1bc66f44

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 (120) hide show
  1. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/neutral/chunk-ZPC54VRM.mjs +596 -0
  3. package/dist/lib/neutral/chunk-ZPC54VRM.mjs.map +7 -0
  4. package/dist/lib/neutral/extraction/index.mjs +225 -0
  5. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  6. package/dist/lib/{browser → neutral}/index.mjs +346 -350
  7. package/dist/lib/neutral/index.mjs.map +7 -0
  8. package/dist/lib/neutral/meta.json +1 -0
  9. package/dist/lib/neutral/testing/index.mjs +38 -0
  10. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  11. package/dist/types/src/conversation/context.d.ts +97 -62
  12. package/dist/types/src/conversation/context.d.ts.map +1 -1
  13. package/dist/types/src/conversation/context.test.d.ts +2 -0
  14. package/dist/types/src/conversation/context.test.d.ts.map +1 -0
  15. package/dist/types/src/conversation/conversation.d.ts +41 -16
  16. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  17. package/dist/types/src/conversation/conversation.test.d.ts +2 -0
  18. package/dist/types/src/conversation/conversation.test.d.ts.map +1 -0
  19. package/dist/types/src/diff.d.ts +3 -1
  20. package/dist/types/src/diff.d.ts.map +1 -1
  21. package/dist/types/src/errors.d.ts +22 -30
  22. package/dist/types/src/errors.d.ts.map +1 -1
  23. package/dist/types/src/execution-graph.d.ts +5 -2
  24. package/dist/types/src/execution-graph.d.ts.map +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 +254 -248
  27. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  28. package/dist/types/src/extraction/extraction.d.ts +344 -303
  29. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  30. package/dist/types/src/extraction/quotes.d.ts +2 -2
  31. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  32. package/dist/types/src/functions/services.d.ts +6 -6
  33. package/dist/types/src/functions/services.d.ts.map +1 -1
  34. package/dist/types/src/functions.test.d.ts +2 -0
  35. package/dist/types/src/functions.test.d.ts.map +1 -0
  36. package/dist/types/src/session/GenericToolkit.d.ts +107 -0
  37. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
  38. package/dist/types/src/session/artifact-diff.d.ts +1 -1
  39. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  40. package/dist/types/src/session/format.d.ts +4 -176
  41. package/dist/types/src/session/format.d.ts.map +1 -1
  42. package/dist/types/src/session/index.d.ts +2 -0
  43. package/dist/types/src/session/index.d.ts.map +1 -1
  44. package/dist/types/src/session/observer.d.ts +6 -5
  45. package/dist/types/src/session/observer.d.ts.map +1 -1
  46. package/dist/types/src/session/session.d.ts +16 -11
  47. package/dist/types/src/session/session.d.ts.map +1 -1
  48. package/dist/types/src/session/toolkit.d.ts +5 -6
  49. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  50. package/dist/types/src/session/version-pin.d.ts +3 -3
  51. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  52. package/dist/types/src/testing/index.d.ts +2 -0
  53. package/dist/types/src/testing/index.d.ts.map +1 -0
  54. package/dist/types/src/testing/layer.d.ts +22 -0
  55. package/dist/types/src/testing/layer.d.ts.map +1 -0
  56. package/dist/types/src/types/artifact.d.ts +14 -2
  57. package/dist/types/src/types/artifact.d.ts.map +1 -1
  58. package/dist/types/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +40 -31
  60. package/src/conversation/context.test.ts +46 -0
  61. package/src/conversation/context.ts +211 -67
  62. package/src/conversation/conversation.test.ts +65 -0
  63. package/src/conversation/conversation.ts +128 -53
  64. package/src/diff.test.ts +37 -6
  65. package/src/diff.ts +18 -4
  66. package/src/errors.ts +2 -2
  67. package/src/execution-graph.test.ts +45 -43
  68. package/src/execution-graph.ts +23 -14
  69. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +2 -2
  70. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +44 -54
  71. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +15 -14
  72. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +36 -44
  73. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +10 -5
  74. package/src/extraction/extraction.ts +9 -8
  75. package/src/extraction/quotes.ts +4 -5
  76. package/src/functions/services.ts +66 -37
  77. package/src/functions.conversations.json +1 -0
  78. package/src/functions.test.ts +74 -0
  79. package/src/session/GenericToolkit.ts +160 -0
  80. package/src/session/artifact-diff.ts +1 -1
  81. package/src/session/format.test.ts +103 -39
  82. package/src/session/format.ts +17 -16
  83. package/src/session/index.ts +3 -0
  84. package/src/session/observer.ts +5 -3
  85. package/src/session/session.conversations.json +1 -1
  86. package/src/session/session.test.ts +28 -15
  87. package/src/session/session.ts +44 -21
  88. package/src/session/toolkit.ts +13 -22
  89. package/src/session/version-pin.ts +6 -6
  90. package/src/templates/{format.tpl → instructions/format.tpl} +1 -4
  91. package/src/templates/system.ts +2 -2
  92. package/src/testing/index.ts +5 -0
  93. package/src/testing/layer.ts +84 -0
  94. package/src/types/artifact.ts +43 -6
  95. package/dist/lib/browser/chunk-CWGVG235.mjs +0 -380
  96. package/dist/lib/browser/chunk-CWGVG235.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  98. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  99. package/dist/lib/browser/extraction/index.mjs +0 -272
  100. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  101. package/dist/lib/browser/index.mjs.map +0 -7
  102. package/dist/lib/browser/meta.json +0 -1
  103. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  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-OV5PMQPB.mjs +0 -382
  107. package/dist/lib/node-esm/chunk-OV5PMQPB.mjs.map +0 -7
  108. package/dist/lib/node-esm/extraction/index.mjs +0 -273
  109. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  110. package/dist/lib/node-esm/index.mjs +0 -934
  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/summarization/summarization.test.d.ts +0 -2
  116. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  117. package/src/summarization/summarization.test.ts +0 -202
  118. /package/dist/lib/{browser/named-entity-recognition-QPYHML66.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  119. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
  120. /package/src/templates/{system.tpl → instructions/system.tpl} +0 -0
@@ -1,157 +1,180 @@
1
1
  import * as Schema from 'effect/Schema';
2
- import { Expando } from '@dxos/echo/internal';
3
- import { type FunctionDefinition, type FunctionExecutor } from '@dxos/functions';
2
+ import { Type } from '@dxos/echo';
3
+ import { type FunctionDefinition } from '@dxos/functions';
4
+ import { type FunctionExecutor } from '@dxos/functions-runtime';
4
5
  export declare const ExtractionInput: Schema.Struct<{
5
- message: import("@dxos/echo/Type").obj<Schema.Struct<{
6
- id: import("@dxos/keys").ObjectIdClass;
7
- parentMessage: Schema.optional<import("@dxos/keys").ObjectIdClass>;
8
- created: Schema.SchemaClass<string, string, never>;
9
- sender: Schema.mutable<Schema.Struct<{
10
- contact: Schema.optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<Schema.Struct<{
11
- fullName: Schema.optional<Schema.SchemaClass<string, string, never>>;
12
- preferredName: Schema.optional<Schema.SchemaClass<string, string, never>>;
13
- nickname: Schema.optional<Schema.SchemaClass<string, string, never>>;
14
- image: Schema.optional<Schema.SchemaClass<string, string, never>>;
15
- organization: Schema.optional<Schema.Schema<import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
16
- id: string;
17
- description?: string | undefined;
18
- name?: string | undefined;
19
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
20
- image?: string | undefined;
21
- website?: string | undefined;
22
- }>, import("@dxos/echo-protocol").EncodedReference, never>>;
23
- jobTitle: Schema.optional<Schema.SchemaClass<string, string, never>>;
24
- department: Schema.optional<Schema.SchemaClass<string, string, never>>;
25
- notes: Schema.optional<Schema.SchemaClass<string, string, never>>;
26
- emails: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
27
- label: Schema.optional<typeof Schema.String>;
28
- value: Schema.refine<string, typeof Schema.String>;
29
- }>>>>;
30
- identities: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
31
- label: Schema.optional<typeof Schema.String>;
32
- value: typeof Schema.String;
33
- }>>>>;
34
- phoneNumbers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
35
- label: Schema.optional<typeof Schema.String>;
36
- value: typeof Schema.String;
37
- }>>>>;
38
- addresses: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
39
- label: Schema.optional<typeof Schema.String>;
40
- value: Schema.Struct<{
41
- street: Schema.optional<Schema.SchemaClass<string, string, never>>;
42
- extended: Schema.optional<Schema.SchemaClass<string, string, never>>;
43
- locality: Schema.optional<Schema.SchemaClass<string, string, never>>;
44
- region: Schema.optional<Schema.SchemaClass<string, string, never>>;
45
- postalCode: Schema.optional<Schema.SchemaClass<string, string, never>>;
46
- postOfficeBoxNumber: Schema.optional<Schema.SchemaClass<string, string, never>>;
47
- country: Schema.optional<Schema.SchemaClass<string, string, never>>;
48
- }>;
49
- }>>>>;
50
- urls: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
51
- label: Schema.optional<typeof Schema.String>;
52
- value: Schema.refine<string, typeof Schema.String>;
53
- }>>>>;
54
- birthday: Schema.optional<Schema.SchemaClass<string, string, never>>;
55
- fields: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
56
- category: Schema.optional<typeof Schema.String>;
57
- label: typeof Schema.String;
58
- value: typeof Schema.String;
59
- }>>>>;
60
- }>>>>;
61
- identityDid: Schema.optional<typeof Schema.String>;
62
- identityKey: Schema.optional<typeof Schema.String>;
63
- email: Schema.optional<typeof Schema.String>;
64
- name: Schema.optional<typeof Schema.String>;
65
- role: Schema.optional<Schema.Literal<["user", "assistant", "tool"]>>;
66
- }>>;
67
- blocks: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.TaggedStruct<"anchor", {
68
- pending: Schema.optional<typeof Schema.Boolean>;
69
- objectId: import("@dxos/keys").ObjectIdClass;
70
- version: typeof Schema.Unknown;
71
- }>>, Schema.mutable<Schema.TaggedStruct<"file", {
72
- pending: Schema.optional<typeof Schema.Boolean>;
73
- url: typeof Schema.String;
74
- name: Schema.optional<typeof Schema.String>;
75
- mediaType: Schema.optional<typeof Schema.String>;
76
- }>>, Schema.mutable<Schema.TaggedStruct<"image", {
77
- pending: Schema.optional<typeof Schema.Boolean>;
78
- id: Schema.optional<typeof Schema.String>;
79
- source: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
80
- type: Schema.Literal<["base64"]>;
81
- mediaType: typeof Schema.String;
82
- data: typeof Schema.String;
83
- }>>, Schema.mutable<Schema.Struct<{
84
- type: Schema.Literal<["http"]>;
85
- url: typeof Schema.String;
86
- }>>]>>;
87
- }>>, Schema.mutable<Schema.TaggedStruct<"json", {
88
- pending: Schema.optional<typeof Schema.Boolean>;
89
- disposition: Schema.optional<typeof Schema.String>;
90
- data: typeof Schema.String;
91
- }>>, Schema.mutable<Schema.TaggedStruct<"proposal", {
92
- pending: Schema.optional<typeof Schema.Boolean>;
93
- text: typeof Schema.String;
94
- }>>, Schema.mutable<Schema.TaggedStruct<"reasoning", {
95
- pending: Schema.optional<typeof Schema.Boolean>;
96
- reasoningText: Schema.optional<typeof Schema.String>;
97
- redactedText: Schema.optional<typeof Schema.String>;
98
- signature: Schema.optional<typeof Schema.String>;
99
- }>>, Schema.mutable<Schema.TaggedStruct<"reference", {
100
- pending: Schema.optional<typeof Schema.Boolean>;
101
- reference: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo/Type").Expando, {
102
- [x: string]: any;
103
- id: string;
104
- }, never>>;
105
- }>>, Schema.mutable<Schema.TaggedStruct<"select", {
106
- pending: Schema.optional<typeof Schema.Boolean>;
107
- options: Schema.Array$<typeof Schema.String>;
108
- }>>, Schema.mutable<Schema.TaggedStruct<"status", {
109
- pending: Schema.optional<typeof Schema.Boolean>;
110
- statusText: typeof Schema.String;
111
- }>>, Schema.mutable<Schema.TaggedStruct<"suggestion", {
112
- pending: Schema.optional<typeof Schema.Boolean>;
113
- text: typeof Schema.String;
114
- }>>, Schema.mutable<Schema.TaggedStruct<"summary", {
115
- pending: Schema.optional<typeof Schema.Boolean>;
116
- mimeType: Schema.optional<typeof Schema.String>;
117
- message: Schema.optional<typeof Schema.String>;
118
- model: Schema.optional<typeof Schema.String>;
119
- usage: Schema.optional<Schema.Struct<{
120
- inputTokens: Schema.optional<typeof Schema.Number>;
121
- outputTokens: Schema.optional<typeof Schema.Number>;
122
- totalTokens: Schema.optional<typeof Schema.Number>;
123
- }>>;
124
- toolCalls: Schema.optional<typeof Schema.Number>;
125
- errors: Schema.optional<typeof Schema.Number>;
126
- duration: Schema.optional<typeof Schema.Number>;
127
- }>>, Schema.mutable<Schema.TaggedStruct<"text", {
128
- pending: Schema.optional<typeof Schema.Boolean>;
129
- mimeType: Schema.optional<typeof Schema.String>;
130
- text: typeof Schema.String;
131
- disposition: Schema.optional<typeof Schema.String>;
132
- }>>, Schema.mutable<Schema.TaggedStruct<"toolkit", {
133
- pending: Schema.optional<typeof Schema.Boolean>;
134
- }>>, Schema.mutable<Schema.TaggedStruct<"toolCall", {
135
- pending: Schema.optional<typeof Schema.Boolean>;
136
- toolCallId: typeof Schema.String;
137
- name: typeof Schema.String;
138
- input: typeof Schema.String;
139
- providerExecuted: typeof Schema.Boolean;
140
- }>>, Schema.mutable<Schema.TaggedStruct<"toolResult", {
141
- pending: Schema.optional<typeof Schema.Boolean>;
142
- toolCallId: typeof Schema.String;
143
- name: typeof Schema.String;
144
- result: Schema.optional<typeof Schema.String>;
145
- error: Schema.optional<typeof Schema.String>;
146
- providerExecuted: typeof Schema.Boolean;
147
- }>>, Schema.mutable<Schema.TaggedStruct<"transcript", {
148
- pending: Schema.optional<typeof Schema.Boolean>;
149
- started: typeof Schema.String;
150
- text: typeof Schema.String;
151
- }>>]>>>;
152
- properties: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
153
- }>>;
154
- objects: Schema.optional<Schema.Array$<Schema.Schema<Expando, Expando, never>>>;
6
+ message: Type.Obj<{
7
+ readonly id: string;
8
+ readonly parentMessage?: string | undefined;
9
+ readonly created: string;
10
+ readonly sender: {
11
+ readonly name?: string | undefined;
12
+ readonly role?: "user" | "assistant" | "tool" | undefined;
13
+ readonly contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
14
+ readonly image?: string | undefined;
15
+ readonly fullName?: string | undefined;
16
+ readonly preferredName?: string | undefined;
17
+ readonly nickname?: string | undefined;
18
+ readonly organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
19
+ readonly description?: string | undefined;
20
+ readonly name?: string | undefined;
21
+ readonly status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
22
+ readonly image?: string | undefined;
23
+ readonly website?: string | undefined;
24
+ } & {
25
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
26
+ }> | undefined;
27
+ readonly jobTitle?: string | undefined;
28
+ readonly department?: string | undefined;
29
+ readonly notes?: string | undefined;
30
+ readonly emails?: readonly {
31
+ readonly value: string;
32
+ readonly label?: string | undefined;
33
+ }[] | undefined;
34
+ readonly identities?: readonly {
35
+ readonly value: string;
36
+ readonly label?: string | undefined;
37
+ }[] | undefined;
38
+ readonly phoneNumbers?: readonly {
39
+ readonly value: string;
40
+ readonly label?: string | undefined;
41
+ }[] | undefined;
42
+ readonly fields?: readonly {
43
+ readonly value: string;
44
+ readonly label: string;
45
+ readonly category?: string | undefined;
46
+ }[] | undefined;
47
+ readonly addresses?: readonly {
48
+ readonly value: {
49
+ readonly street?: string | undefined;
50
+ readonly extended?: string | undefined;
51
+ readonly locality?: string | undefined;
52
+ readonly region?: string | undefined;
53
+ readonly postalCode?: string | undefined;
54
+ readonly postOfficeBoxNumber?: string | undefined;
55
+ readonly country?: string | undefined;
56
+ };
57
+ readonly label?: string | undefined;
58
+ }[] | undefined;
59
+ readonly urls?: readonly {
60
+ readonly value: string;
61
+ readonly label?: string | undefined;
62
+ }[] | undefined;
63
+ readonly birthday?: string | undefined;
64
+ } & {
65
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
66
+ }> | undefined;
67
+ readonly identityDid?: string | undefined;
68
+ readonly identityKey?: string | undefined;
69
+ readonly email?: string | undefined;
70
+ };
71
+ readonly blocks: readonly ({
72
+ readonly pending?: boolean | undefined;
73
+ readonly text: string;
74
+ readonly mimeType?: string | undefined;
75
+ readonly disposition?: string | undefined;
76
+ readonly _tag: "text";
77
+ } | {
78
+ readonly pending?: boolean | undefined;
79
+ readonly _tag: "reasoning";
80
+ readonly reasoningText?: string | undefined;
81
+ readonly redactedText?: string | undefined;
82
+ readonly signature?: string | undefined;
83
+ } | {
84
+ readonly name: string;
85
+ readonly pending?: boolean | undefined;
86
+ readonly _tag: "toolCall";
87
+ readonly toolCallId: string;
88
+ readonly input: string;
89
+ readonly providerExecuted: boolean;
90
+ } | {
91
+ readonly name: string;
92
+ readonly pending?: boolean | undefined;
93
+ readonly _tag: "toolResult";
94
+ readonly toolCallId: string;
95
+ readonly providerExecuted: boolean;
96
+ readonly result?: string | undefined;
97
+ readonly error?: string | undefined;
98
+ } | {
99
+ readonly pending?: boolean | undefined;
100
+ readonly mimeType?: string | undefined;
101
+ readonly _tag: "summary";
102
+ readonly message?: string | undefined;
103
+ readonly model?: string | undefined;
104
+ readonly usage?: {
105
+ readonly inputTokens?: number | undefined;
106
+ readonly outputTokens?: number | undefined;
107
+ readonly totalTokens?: number | undefined;
108
+ } | undefined;
109
+ readonly toolCalls?: number | undefined;
110
+ readonly errors?: number | undefined;
111
+ readonly duration?: number | undefined;
112
+ } | {
113
+ readonly source?: {
114
+ readonly type: "base64";
115
+ readonly mediaType: string;
116
+ readonly data: string;
117
+ } | {
118
+ readonly type: "http";
119
+ readonly url: string;
120
+ } | undefined;
121
+ readonly id?: string | undefined;
122
+ readonly pending?: boolean | undefined;
123
+ readonly _tag: "image";
124
+ } | {
125
+ readonly name?: string | undefined;
126
+ readonly pending?: boolean | undefined;
127
+ readonly _tag: "file";
128
+ readonly mediaType?: string | undefined;
129
+ readonly url: string;
130
+ } | {
131
+ readonly pending?: boolean | undefined;
132
+ readonly _tag: "reference";
133
+ readonly reference: import("@dxos/echo/internal").Ref<any>;
134
+ } | {
135
+ readonly pending?: boolean | undefined;
136
+ readonly text: string;
137
+ readonly _tag: "transcript";
138
+ readonly started: string;
139
+ } | {
140
+ readonly pending?: boolean | undefined;
141
+ readonly _tag: "status";
142
+ readonly statusText: string;
143
+ } | {
144
+ readonly pending?: boolean | undefined;
145
+ readonly text: string;
146
+ readonly _tag: "suggestion";
147
+ } | {
148
+ readonly pending?: boolean | undefined;
149
+ readonly _tag: "select";
150
+ readonly options: string[];
151
+ } | {
152
+ readonly version: unknown;
153
+ readonly pending?: boolean | undefined;
154
+ readonly _tag: "anchor";
155
+ readonly objectId: string;
156
+ } | {
157
+ readonly pending?: boolean | undefined;
158
+ readonly text: string;
159
+ readonly _tag: "proposal";
160
+ } | {
161
+ readonly pending?: boolean | undefined;
162
+ readonly _tag: "toolkit";
163
+ } | {
164
+ readonly pending?: boolean | undefined;
165
+ readonly disposition?: string | undefined;
166
+ readonly _tag: "json";
167
+ readonly data: string;
168
+ })[];
169
+ readonly properties?: {
170
+ readonly [x: string]: any;
171
+ } | undefined;
172
+ }, Schema.Struct.Fields>;
173
+ objects: Schema.optional<Schema.Array$<Schema.Schema<any, {
174
+ id: string;
175
+ } & import("@dxos/echo/internal").AnyProperties, never> & {
176
+ readonly "~@dxos/echo/SchemaKind": import("@dxos/echo/internal").EntityKind.Object;
177
+ } & import("@dxos/echo/internal").TypeMeta>>;
155
178
  options: Schema.optional<Schema.Struct<{
156
179
  timeout: Schema.optional<typeof Schema.Number>;
157
180
  fallbackToRaw: Schema.optional<typeof Schema.Boolean>;
@@ -160,160 +183,178 @@ export declare const ExtractionInput: Schema.Struct<{
160
183
  export interface ExtractionInput extends Schema.Schema.Type<typeof ExtractionInput> {
161
184
  }
162
185
  export declare const ExtractionOutput: Schema.Struct<{
163
- message: import("@dxos/echo/Type").obj<Schema.Struct<{
164
- id: import("@dxos/keys").ObjectIdClass;
165
- parentMessage: Schema.optional<import("@dxos/keys").ObjectIdClass>;
166
- created: Schema.SchemaClass<string, string, never>;
167
- sender: Schema.mutable<Schema.Struct<{
168
- contact: Schema.optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<Schema.Struct<{
169
- fullName: Schema.optional<Schema.SchemaClass<string, string, never>>;
170
- preferredName: Schema.optional<Schema.SchemaClass<string, string, never>>;
171
- nickname: Schema.optional<Schema.SchemaClass<string, string, never>>;
172
- image: Schema.optional<Schema.SchemaClass<string, string, never>>;
173
- organization: Schema.optional<Schema.Schema<import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
174
- id: string;
175
- description?: string | undefined;
176
- name?: string | undefined;
177
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
178
- image?: string | undefined;
179
- website?: string | undefined;
180
- }>, import("@dxos/echo-protocol").EncodedReference, never>>;
181
- jobTitle: Schema.optional<Schema.SchemaClass<string, string, never>>;
182
- department: Schema.optional<Schema.SchemaClass<string, string, never>>;
183
- notes: Schema.optional<Schema.SchemaClass<string, string, never>>;
184
- emails: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
185
- label: Schema.optional<typeof Schema.String>;
186
- value: Schema.refine<string, typeof Schema.String>;
187
- }>>>>;
188
- identities: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
189
- label: Schema.optional<typeof Schema.String>;
190
- value: typeof Schema.String;
191
- }>>>>;
192
- phoneNumbers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
193
- label: Schema.optional<typeof Schema.String>;
194
- value: typeof Schema.String;
195
- }>>>>;
196
- addresses: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
197
- label: Schema.optional<typeof Schema.String>;
198
- value: Schema.Struct<{
199
- street: Schema.optional<Schema.SchemaClass<string, string, never>>;
200
- extended: Schema.optional<Schema.SchemaClass<string, string, never>>;
201
- locality: Schema.optional<Schema.SchemaClass<string, string, never>>;
202
- region: Schema.optional<Schema.SchemaClass<string, string, never>>;
203
- postalCode: Schema.optional<Schema.SchemaClass<string, string, never>>;
204
- postOfficeBoxNumber: Schema.optional<Schema.SchemaClass<string, string, never>>;
205
- country: Schema.optional<Schema.SchemaClass<string, string, never>>;
206
- }>;
207
- }>>>>;
208
- urls: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
209
- label: Schema.optional<typeof Schema.String>;
210
- value: Schema.refine<string, typeof Schema.String>;
211
- }>>>>;
212
- birthday: Schema.optional<Schema.SchemaClass<string, string, never>>;
213
- fields: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
214
- category: Schema.optional<typeof Schema.String>;
215
- label: typeof Schema.String;
216
- value: typeof Schema.String;
217
- }>>>>;
218
- }>>>>;
219
- identityDid: Schema.optional<typeof Schema.String>;
220
- identityKey: Schema.optional<typeof Schema.String>;
221
- email: Schema.optional<typeof Schema.String>;
222
- name: Schema.optional<typeof Schema.String>;
223
- role: Schema.optional<Schema.Literal<["user", "assistant", "tool"]>>;
224
- }>>;
225
- blocks: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.TaggedStruct<"anchor", {
226
- pending: Schema.optional<typeof Schema.Boolean>;
227
- objectId: import("@dxos/keys").ObjectIdClass;
228
- version: typeof Schema.Unknown;
229
- }>>, Schema.mutable<Schema.TaggedStruct<"file", {
230
- pending: Schema.optional<typeof Schema.Boolean>;
231
- url: typeof Schema.String;
232
- name: Schema.optional<typeof Schema.String>;
233
- mediaType: Schema.optional<typeof Schema.String>;
234
- }>>, Schema.mutable<Schema.TaggedStruct<"image", {
235
- pending: Schema.optional<typeof Schema.Boolean>;
236
- id: Schema.optional<typeof Schema.String>;
237
- source: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
238
- type: Schema.Literal<["base64"]>;
239
- mediaType: typeof Schema.String;
240
- data: typeof Schema.String;
241
- }>>, Schema.mutable<Schema.Struct<{
242
- type: Schema.Literal<["http"]>;
243
- url: typeof Schema.String;
244
- }>>]>>;
245
- }>>, Schema.mutable<Schema.TaggedStruct<"json", {
246
- pending: Schema.optional<typeof Schema.Boolean>;
247
- disposition: Schema.optional<typeof Schema.String>;
248
- data: typeof Schema.String;
249
- }>>, Schema.mutable<Schema.TaggedStruct<"proposal", {
250
- pending: Schema.optional<typeof Schema.Boolean>;
251
- text: typeof Schema.String;
252
- }>>, Schema.mutable<Schema.TaggedStruct<"reasoning", {
253
- pending: Schema.optional<typeof Schema.Boolean>;
254
- reasoningText: Schema.optional<typeof Schema.String>;
255
- redactedText: Schema.optional<typeof Schema.String>;
256
- signature: Schema.optional<typeof Schema.String>;
257
- }>>, Schema.mutable<Schema.TaggedStruct<"reference", {
258
- pending: Schema.optional<typeof Schema.Boolean>;
259
- reference: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo/Type").Expando, {
260
- [x: string]: any;
261
- id: string;
262
- }, never>>;
263
- }>>, Schema.mutable<Schema.TaggedStruct<"select", {
264
- pending: Schema.optional<typeof Schema.Boolean>;
265
- options: Schema.Array$<typeof Schema.String>;
266
- }>>, Schema.mutable<Schema.TaggedStruct<"status", {
267
- pending: Schema.optional<typeof Schema.Boolean>;
268
- statusText: typeof Schema.String;
269
- }>>, Schema.mutable<Schema.TaggedStruct<"suggestion", {
270
- pending: Schema.optional<typeof Schema.Boolean>;
271
- text: typeof Schema.String;
272
- }>>, Schema.mutable<Schema.TaggedStruct<"summary", {
273
- pending: Schema.optional<typeof Schema.Boolean>;
274
- mimeType: Schema.optional<typeof Schema.String>;
275
- message: Schema.optional<typeof Schema.String>;
276
- model: Schema.optional<typeof Schema.String>;
277
- usage: Schema.optional<Schema.Struct<{
278
- inputTokens: Schema.optional<typeof Schema.Number>;
279
- outputTokens: Schema.optional<typeof Schema.Number>;
280
- totalTokens: Schema.optional<typeof Schema.Number>;
281
- }>>;
282
- toolCalls: Schema.optional<typeof Schema.Number>;
283
- errors: Schema.optional<typeof Schema.Number>;
284
- duration: Schema.optional<typeof Schema.Number>;
285
- }>>, Schema.mutable<Schema.TaggedStruct<"text", {
286
- pending: Schema.optional<typeof Schema.Boolean>;
287
- mimeType: Schema.optional<typeof Schema.String>;
288
- text: typeof Schema.String;
289
- disposition: Schema.optional<typeof Schema.String>;
290
- }>>, Schema.mutable<Schema.TaggedStruct<"toolkit", {
291
- pending: Schema.optional<typeof Schema.Boolean>;
292
- }>>, Schema.mutable<Schema.TaggedStruct<"toolCall", {
293
- pending: Schema.optional<typeof Schema.Boolean>;
294
- toolCallId: typeof Schema.String;
295
- name: typeof Schema.String;
296
- input: typeof Schema.String;
297
- providerExecuted: typeof Schema.Boolean;
298
- }>>, Schema.mutable<Schema.TaggedStruct<"toolResult", {
299
- pending: Schema.optional<typeof Schema.Boolean>;
300
- toolCallId: typeof Schema.String;
301
- name: typeof Schema.String;
302
- result: Schema.optional<typeof Schema.String>;
303
- error: Schema.optional<typeof Schema.String>;
304
- providerExecuted: typeof Schema.Boolean;
305
- }>>, Schema.mutable<Schema.TaggedStruct<"transcript", {
306
- pending: Schema.optional<typeof Schema.Boolean>;
307
- started: typeof Schema.String;
308
- text: typeof Schema.String;
309
- }>>]>>>;
310
- properties: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
311
- }>>;
186
+ message: Type.Obj<{
187
+ readonly id: string;
188
+ readonly parentMessage?: string | undefined;
189
+ readonly created: string;
190
+ readonly sender: {
191
+ readonly name?: string | undefined;
192
+ readonly role?: "user" | "assistant" | "tool" | undefined;
193
+ readonly contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
194
+ readonly image?: string | undefined;
195
+ readonly fullName?: string | undefined;
196
+ readonly preferredName?: string | undefined;
197
+ readonly nickname?: string | undefined;
198
+ readonly organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
199
+ readonly description?: string | undefined;
200
+ readonly name?: string | undefined;
201
+ readonly status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
202
+ readonly image?: string | undefined;
203
+ readonly website?: string | undefined;
204
+ } & {
205
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
206
+ }> | undefined;
207
+ readonly jobTitle?: string | undefined;
208
+ readonly department?: string | undefined;
209
+ readonly notes?: string | undefined;
210
+ readonly emails?: readonly {
211
+ readonly value: string;
212
+ readonly label?: string | undefined;
213
+ }[] | undefined;
214
+ readonly identities?: readonly {
215
+ readonly value: string;
216
+ readonly label?: string | undefined;
217
+ }[] | undefined;
218
+ readonly phoneNumbers?: readonly {
219
+ readonly value: string;
220
+ readonly label?: string | undefined;
221
+ }[] | undefined;
222
+ readonly fields?: readonly {
223
+ readonly value: string;
224
+ readonly label: string;
225
+ readonly category?: string | undefined;
226
+ }[] | undefined;
227
+ readonly addresses?: readonly {
228
+ readonly value: {
229
+ readonly street?: string | undefined;
230
+ readonly extended?: string | undefined;
231
+ readonly locality?: string | undefined;
232
+ readonly region?: string | undefined;
233
+ readonly postalCode?: string | undefined;
234
+ readonly postOfficeBoxNumber?: string | undefined;
235
+ readonly country?: string | undefined;
236
+ };
237
+ readonly label?: string | undefined;
238
+ }[] | undefined;
239
+ readonly urls?: readonly {
240
+ readonly value: string;
241
+ readonly label?: string | undefined;
242
+ }[] | undefined;
243
+ readonly birthday?: string | undefined;
244
+ } & {
245
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
246
+ }> | undefined;
247
+ readonly identityDid?: string | undefined;
248
+ readonly identityKey?: string | undefined;
249
+ readonly email?: string | undefined;
250
+ };
251
+ readonly blocks: readonly ({
252
+ readonly pending?: boolean | undefined;
253
+ readonly text: string;
254
+ readonly mimeType?: string | undefined;
255
+ readonly disposition?: string | undefined;
256
+ readonly _tag: "text";
257
+ } | {
258
+ readonly pending?: boolean | undefined;
259
+ readonly _tag: "reasoning";
260
+ readonly reasoningText?: string | undefined;
261
+ readonly redactedText?: string | undefined;
262
+ readonly signature?: string | undefined;
263
+ } | {
264
+ readonly name: string;
265
+ readonly pending?: boolean | undefined;
266
+ readonly _tag: "toolCall";
267
+ readonly toolCallId: string;
268
+ readonly input: string;
269
+ readonly providerExecuted: boolean;
270
+ } | {
271
+ readonly name: string;
272
+ readonly pending?: boolean | undefined;
273
+ readonly _tag: "toolResult";
274
+ readonly toolCallId: string;
275
+ readonly providerExecuted: boolean;
276
+ readonly result?: string | undefined;
277
+ readonly error?: string | undefined;
278
+ } | {
279
+ readonly pending?: boolean | undefined;
280
+ readonly mimeType?: string | undefined;
281
+ readonly _tag: "summary";
282
+ readonly message?: string | undefined;
283
+ readonly model?: string | undefined;
284
+ readonly usage?: {
285
+ readonly inputTokens?: number | undefined;
286
+ readonly outputTokens?: number | undefined;
287
+ readonly totalTokens?: number | undefined;
288
+ } | undefined;
289
+ readonly toolCalls?: number | undefined;
290
+ readonly errors?: number | undefined;
291
+ readonly duration?: number | undefined;
292
+ } | {
293
+ readonly source?: {
294
+ readonly type: "base64";
295
+ readonly mediaType: string;
296
+ readonly data: string;
297
+ } | {
298
+ readonly type: "http";
299
+ readonly url: string;
300
+ } | undefined;
301
+ readonly id?: string | undefined;
302
+ readonly pending?: boolean | undefined;
303
+ readonly _tag: "image";
304
+ } | {
305
+ readonly name?: string | undefined;
306
+ readonly pending?: boolean | undefined;
307
+ readonly _tag: "file";
308
+ readonly mediaType?: string | undefined;
309
+ readonly url: string;
310
+ } | {
311
+ readonly pending?: boolean | undefined;
312
+ readonly _tag: "reference";
313
+ readonly reference: import("@dxos/echo/internal").Ref<any>;
314
+ } | {
315
+ readonly pending?: boolean | undefined;
316
+ readonly text: string;
317
+ readonly _tag: "transcript";
318
+ readonly started: string;
319
+ } | {
320
+ readonly pending?: boolean | undefined;
321
+ readonly _tag: "status";
322
+ readonly statusText: string;
323
+ } | {
324
+ readonly pending?: boolean | undefined;
325
+ readonly text: string;
326
+ readonly _tag: "suggestion";
327
+ } | {
328
+ readonly pending?: boolean | undefined;
329
+ readonly _tag: "select";
330
+ readonly options: string[];
331
+ } | {
332
+ readonly version: unknown;
333
+ readonly pending?: boolean | undefined;
334
+ readonly _tag: "anchor";
335
+ readonly objectId: string;
336
+ } | {
337
+ readonly pending?: boolean | undefined;
338
+ readonly text: string;
339
+ readonly _tag: "proposal";
340
+ } | {
341
+ readonly pending?: boolean | undefined;
342
+ readonly _tag: "toolkit";
343
+ } | {
344
+ readonly pending?: boolean | undefined;
345
+ readonly disposition?: string | undefined;
346
+ readonly _tag: "json";
347
+ readonly data: string;
348
+ })[];
349
+ readonly properties?: {
350
+ readonly [x: string]: any;
351
+ } | undefined;
352
+ }, Schema.Struct.Fields>;
312
353
  timeElapsed: typeof Schema.Number;
313
354
  }>;
314
355
  export interface ExtractionOutput extends Schema.Schema.Type<typeof ExtractionOutput> {
315
356
  }
316
- export type ProcessTranscriptMessageParams = {
357
+ export type ProcessTranscriptMessageProps = {
317
358
  input: ExtractionInput;
318
359
  function: FunctionDefinition<ExtractionInput, ExtractionOutput>;
319
360
  executor: FunctionExecutor;
@@ -334,5 +375,5 @@ export type ExtractionFunction = FunctionDefinition<ExtractionInput, ExtractionO
334
375
  /**
335
376
  * Extract entities from the transcript message and add them to the message.
336
377
  */
337
- export declare const processTranscriptMessage: (params: ProcessTranscriptMessageParams) => Promise<ExtractionOutput>;
378
+ export declare const processTranscriptMessage: (params: ProcessTranscriptMessageProps) => Promise<ExtractionOutput>;
338
379
  //# sourceMappingURL=extraction.d.ts.map