@dxos/assistant 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/chunk-ILL2CN3G.mjs +374 -0
- package/dist/lib/browser/chunk-ILL2CN3G.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6WRGDEMH.mjs → chunk-UB26N5UF.mjs} +2 -2
- package/dist/lib/browser/chunk-UB26N5UF.mjs.map +7 -0
- package/dist/lib/browser/extraction/index.mjs +32 -29
- package/dist/lib/browser/extraction/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +682 -1035
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs → named-entity-recognition-QPYHML66.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-3UU5V4FS.mjs → chunk-BCFXTNSK.mjs} +2 -2
- package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GVKA7VL3.mjs +376 -0
- package/dist/lib/node-esm/chunk-GVKA7VL3.mjs.map +7 -0
- package/dist/lib/node-esm/extraction/index.mjs +32 -29
- package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +682 -1035
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs → named-entity-recognition-2HDF46YX.mjs} +2 -2
- package/dist/types/src/{context/binding.d.ts → conversation/context.d.ts} +45 -3
- package/dist/types/src/conversation/context.d.ts.map +1 -0
- package/dist/types/src/conversation/conversation.d.ts +24 -21
- package/dist/types/src/conversation/conversation.d.ts.map +1 -1
- package/dist/types/src/conversation/index.d.ts +1 -0
- package/dist/types/src/conversation/index.d.ts.map +1 -1
- package/dist/types/src/diff.d.ts +15 -0
- package/dist/types/src/diff.d.ts.map +1 -0
- package/dist/types/src/diff.test.d.ts +2 -0
- package/dist/types/src/diff.test.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +46 -9
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/execution-graph.d.ts +82 -0
- package/dist/types/src/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +94 -55
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction.d.ts +250 -216
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/functions/services.d.ts +15 -3
- package/dist/types/src/functions/services.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/session/artifact-diff.d.ts +27 -0
- package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
- package/dist/types/src/session/error-handling.d.ts +4 -0
- package/dist/types/src/session/error-handling.d.ts.map +1 -0
- package/dist/types/src/session/format.d.ts +184 -0
- package/dist/types/src/session/format.d.ts.map +1 -0
- package/dist/types/src/session/format.test.d.ts +2 -0
- package/dist/types/src/session/format.test.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +3 -0
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/observer.d.ts +22 -0
- package/dist/types/src/session/observer.d.ts.map +1 -0
- package/dist/types/src/session/session.d.ts +23 -236
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/toolkit.d.ts +14 -0
- package/dist/types/src/session/toolkit.d.ts.map +1 -0
- package/dist/types/src/session/version-pin.d.ts +2 -2
- package/dist/types/src/session/version-pin.d.ts.map +1 -1
- package/dist/types/src/templates/index.d.ts +1 -1
- package/dist/types/src/templates/system.d.ts +18 -0
- package/dist/types/src/templates/system.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +3 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -33
- package/src/conversation/context.ts +154 -0
- package/src/conversation/conversation.ts +76 -53
- package/src/conversation/index.ts +1 -0
- package/src/diff.test.ts +43 -0
- package/src/diff.ts +79 -0
- package/src/errors.ts +6 -1
- package/src/execution-graph.test.ts +738 -0
- package/src/execution-graph.ts +500 -0
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +8 -7
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +12 -10
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +9 -9
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +13 -6
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +2 -1
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
- package/src/extraction/quotes.test.ts +3 -3
- package/src/extraction/quotes.ts +2 -2
- package/src/functions/services.ts +97 -43
- package/src/index.ts +3 -2
- package/src/session/artifact-diff.ts +41 -0
- package/src/session/error-handling.ts +40 -0
- package/src/session/format.test.ts +60 -0
- package/src/session/format.ts +139 -0
- package/src/session/index.ts +3 -0
- package/src/session/observer.ts +58 -0
- package/src/session/session.conversations.json +1 -0
- package/src/session/session.test.ts +33 -197
- package/src/session/session.ts +119 -249
- package/src/session/toolkit.ts +46 -0
- package/src/session/version-pin.ts +4 -4
- package/src/summarization/summarization.test.ts +9 -7
- package/src/templates/format.tpl +60 -0
- package/src/templates/index.ts +1 -1
- package/src/templates/system.tpl +48 -0
- package/src/templates/system.ts +41 -0
- package/src/types.ts +10 -5
- package/src/typings.d.ts +5 -0
- package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-SIXTNSGV.mjs +0 -250
- package/dist/lib/browser/chunk-SIXTNSGV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FD5NXKDP.mjs +0 -252
- package/dist/lib/node-esm/chunk-FD5NXKDP.mjs.map +0 -7
- package/dist/types/bin/chat.d.ts +0 -2
- package/dist/types/bin/chat.d.ts.map +0 -1
- package/dist/types/src/context/binder.d.ts +0 -34
- package/dist/types/src/context/binder.d.ts.map +0 -1
- package/dist/types/src/context/binding.d.ts.map +0 -1
- package/dist/types/src/context/index.d.ts +0 -3
- package/dist/types/src/context/index.d.ts.map +0 -1
- package/dist/types/src/research/exa.d.ts +0 -12
- package/dist/types/src/research/exa.d.ts.map +0 -1
- package/dist/types/src/research/graph.d.ts +0 -51
- package/dist/types/src/research/graph.d.ts.map +0 -1
- package/dist/types/src/research/graph.test.d.ts +0 -2
- package/dist/types/src/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/research/index.d.ts +0 -4
- package/dist/types/src/research/index.d.ts.map +0 -1
- package/dist/types/src/research/research.d.ts +0 -10
- package/dist/types/src/research/research.d.ts.map +0 -1
- package/dist/types/src/research/research.test.d.ts +0 -2
- package/dist/types/src/research/research.test.d.ts.map +0 -1
- package/dist/types/src/session/version-pin.test.d.ts +0 -2
- package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
- package/dist/types/src/templates/prompt.d.ts +0 -30
- package/dist/types/src/templates/prompt.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -3
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/src/context/binder.ts +0 -103
- package/src/context/binding.ts +0 -32
- package/src/context/index.ts +0 -6
- package/src/research/exa.ts +0 -97
- package/src/research/graph.test.ts +0 -64
- package/src/research/graph.ts +0 -369
- package/src/research/index.ts +0 -7
- package/src/research/instructions-research.tpl +0 -98
- package/src/research/research.test.ts +0 -190
- package/src/research/research.ts +0 -87
- package/src/session/__snapshots__/session.test.ts.snap +0 -32
- package/src/session/version-pin.test.ts +0 -7
- package/src/templates/assistant.tpl +0 -111
- package/src/templates/prompt.ts +0 -45
- package/src/testing/exa-search-1748337321991.ts +0 -131
- package/src/testing/exa-search-1748337331526.ts +0 -144
- package/src/testing/exa-search-1748337344119.ts +0 -133
- package/src/testing/index.ts +0 -11
- package/src/typedefs.d.ts +0 -8
- /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → named-entity-recognition-QPYHML66.mjs.map} +0 -0
- /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → named-entity-recognition-2HDF46YX.mjs.map} +0 -0
|
@@ -4,135 +4,152 @@ import { type FunctionDefinition, type FunctionExecutor } from '@dxos/functions'
|
|
|
4
4
|
export declare const ExtractionInput: Schema.Struct<{
|
|
5
5
|
message: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
6
6
|
id: import("@dxos/keys").ObjectIdClass;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
15
16
|
id: string;
|
|
16
|
-
name?: string | undefined;
|
|
17
17
|
description?: string | undefined;
|
|
18
|
+
name?: string | undefined;
|
|
18
19
|
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
19
20
|
image?: string | undefined;
|
|
20
21
|
website?: string | undefined;
|
|
21
22
|
}>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
22
|
-
jobTitle:
|
|
23
|
-
department:
|
|
24
|
-
notes:
|
|
25
|
-
emails:
|
|
26
|
-
label:
|
|
27
|
-
value:
|
|
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>;
|
|
28
29
|
}>>>>;
|
|
29
|
-
identities:
|
|
30
|
-
label:
|
|
31
|
-
value: typeof
|
|
30
|
+
identities: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
31
|
+
label: Schema.optional<typeof Schema.String>;
|
|
32
|
+
value: typeof Schema.String;
|
|
32
33
|
}>>>>;
|
|
33
|
-
phoneNumbers:
|
|
34
|
-
label:
|
|
35
|
-
value: typeof
|
|
34
|
+
phoneNumbers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
35
|
+
label: Schema.optional<typeof Schema.String>;
|
|
36
|
+
value: typeof Schema.String;
|
|
36
37
|
}>>>>;
|
|
37
|
-
addresses:
|
|
38
|
-
label:
|
|
39
|
-
value:
|
|
40
|
-
street:
|
|
41
|
-
extended:
|
|
42
|
-
locality:
|
|
43
|
-
region:
|
|
44
|
-
postalCode:
|
|
45
|
-
postOfficeBoxNumber:
|
|
46
|
-
country:
|
|
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>>;
|
|
47
48
|
}>;
|
|
48
49
|
}>>>>;
|
|
49
|
-
urls:
|
|
50
|
-
label:
|
|
51
|
-
value:
|
|
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>;
|
|
52
53
|
}>>>>;
|
|
53
|
-
birthday:
|
|
54
|
-
fields:
|
|
55
|
-
category:
|
|
56
|
-
label: typeof
|
|
57
|
-
value: typeof
|
|
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;
|
|
58
59
|
}>>>>;
|
|
59
60
|
}>>>>;
|
|
60
|
-
identityDid:
|
|
61
|
-
identityKey:
|
|
62
|
-
email:
|
|
63
|
-
name:
|
|
64
|
-
role:
|
|
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"]>>;
|
|
65
66
|
}>>;
|
|
66
|
-
blocks:
|
|
67
|
-
pending:
|
|
67
|
+
blocks: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.TaggedStruct<"anchor", {
|
|
68
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
68
69
|
objectId: import("@dxos/keys").ObjectIdClass;
|
|
69
|
-
version: typeof
|
|
70
|
-
}>>,
|
|
71
|
-
pending:
|
|
72
|
-
url: typeof
|
|
73
|
-
name:
|
|
74
|
-
mediaType:
|
|
75
|
-
}>>,
|
|
76
|
-
pending:
|
|
77
|
-
id:
|
|
78
|
-
source:
|
|
79
|
-
type:
|
|
80
|
-
mediaType: typeof
|
|
81
|
-
data: typeof
|
|
82
|
-
}>>,
|
|
83
|
-
type:
|
|
84
|
-
url: typeof
|
|
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;
|
|
85
86
|
}>>]>>;
|
|
86
|
-
}>>,
|
|
87
|
-
pending:
|
|
88
|
-
disposition:
|
|
89
|
-
data: typeof
|
|
90
|
-
}>>,
|
|
91
|
-
pending:
|
|
92
|
-
text: typeof
|
|
93
|
-
}>>,
|
|
94
|
-
pending:
|
|
95
|
-
reasoningText:
|
|
96
|
-
redactedText:
|
|
97
|
-
signature:
|
|
98
|
-
}>>,
|
|
99
|
-
pending:
|
|
100
|
-
reference: import("@dxos/echo/Type").ref<
|
|
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, {
|
|
101
102
|
[x: string]: any;
|
|
102
103
|
id: string;
|
|
103
104
|
}, never>>;
|
|
104
|
-
}>>,
|
|
105
|
-
pending:
|
|
106
|
-
options:
|
|
107
|
-
}>>,
|
|
108
|
-
pending:
|
|
109
|
-
statusText: typeof
|
|
110
|
-
}>>,
|
|
111
|
-
pending:
|
|
112
|
-
text: typeof
|
|
113
|
-
}>>,
|
|
114
|
-
pending:
|
|
115
|
-
mimeType:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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;
|
|
134
151
|
}>>]>>>;
|
|
135
|
-
properties:
|
|
152
|
+
properties: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
136
153
|
}>>;
|
|
137
154
|
objects: Schema.optional<Schema.Array$<Schema.Schema<Expando, Expando, never>>>;
|
|
138
155
|
options: Schema.optional<Schema.Struct<{
|
|
@@ -145,135 +162,152 @@ export interface ExtractionInput extends Schema.Schema.Type<typeof ExtractionInp
|
|
|
145
162
|
export declare const ExtractionOutput: Schema.Struct<{
|
|
146
163
|
message: import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
147
164
|
id: import("@dxos/keys").ObjectIdClass;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
156
174
|
id: string;
|
|
157
|
-
name?: string | undefined;
|
|
158
175
|
description?: string | undefined;
|
|
176
|
+
name?: string | undefined;
|
|
159
177
|
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
160
178
|
image?: string | undefined;
|
|
161
179
|
website?: string | undefined;
|
|
162
180
|
}>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
163
|
-
jobTitle:
|
|
164
|
-
department:
|
|
165
|
-
notes:
|
|
166
|
-
emails:
|
|
167
|
-
label:
|
|
168
|
-
value:
|
|
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>;
|
|
169
187
|
}>>>>;
|
|
170
|
-
identities:
|
|
171
|
-
label:
|
|
172
|
-
value: typeof
|
|
188
|
+
identities: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
189
|
+
label: Schema.optional<typeof Schema.String>;
|
|
190
|
+
value: typeof Schema.String;
|
|
173
191
|
}>>>>;
|
|
174
|
-
phoneNumbers:
|
|
175
|
-
label:
|
|
176
|
-
value: typeof
|
|
192
|
+
phoneNumbers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
193
|
+
label: Schema.optional<typeof Schema.String>;
|
|
194
|
+
value: typeof Schema.String;
|
|
177
195
|
}>>>>;
|
|
178
|
-
addresses:
|
|
179
|
-
label:
|
|
180
|
-
value:
|
|
181
|
-
street:
|
|
182
|
-
extended:
|
|
183
|
-
locality:
|
|
184
|
-
region:
|
|
185
|
-
postalCode:
|
|
186
|
-
postOfficeBoxNumber:
|
|
187
|
-
country:
|
|
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>>;
|
|
188
206
|
}>;
|
|
189
207
|
}>>>>;
|
|
190
|
-
urls:
|
|
191
|
-
label:
|
|
192
|
-
value:
|
|
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>;
|
|
193
211
|
}>>>>;
|
|
194
|
-
birthday:
|
|
195
|
-
fields:
|
|
196
|
-
category:
|
|
197
|
-
label: typeof
|
|
198
|
-
value: typeof
|
|
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;
|
|
199
217
|
}>>>>;
|
|
200
218
|
}>>>>;
|
|
201
|
-
identityDid:
|
|
202
|
-
identityKey:
|
|
203
|
-
email:
|
|
204
|
-
name:
|
|
205
|
-
role:
|
|
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"]>>;
|
|
206
224
|
}>>;
|
|
207
|
-
blocks:
|
|
208
|
-
pending:
|
|
225
|
+
blocks: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.TaggedStruct<"anchor", {
|
|
226
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
209
227
|
objectId: import("@dxos/keys").ObjectIdClass;
|
|
210
|
-
version: typeof
|
|
211
|
-
}>>,
|
|
212
|
-
pending:
|
|
213
|
-
url: typeof
|
|
214
|
-
name:
|
|
215
|
-
mediaType:
|
|
216
|
-
}>>,
|
|
217
|
-
pending:
|
|
218
|
-
id:
|
|
219
|
-
source:
|
|
220
|
-
type:
|
|
221
|
-
mediaType: typeof
|
|
222
|
-
data: typeof
|
|
223
|
-
}>>,
|
|
224
|
-
type:
|
|
225
|
-
url: typeof
|
|
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;
|
|
226
244
|
}>>]>>;
|
|
227
|
-
}>>,
|
|
228
|
-
pending:
|
|
229
|
-
disposition:
|
|
230
|
-
data: typeof
|
|
231
|
-
}>>,
|
|
232
|
-
pending:
|
|
233
|
-
text: typeof
|
|
234
|
-
}>>,
|
|
235
|
-
pending:
|
|
236
|
-
reasoningText:
|
|
237
|
-
redactedText:
|
|
238
|
-
signature:
|
|
239
|
-
}>>,
|
|
240
|
-
pending:
|
|
241
|
-
reference: import("@dxos/echo/Type").ref<
|
|
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, {
|
|
242
260
|
[x: string]: any;
|
|
243
261
|
id: string;
|
|
244
262
|
}, never>>;
|
|
245
|
-
}>>,
|
|
246
|
-
pending:
|
|
247
|
-
options:
|
|
248
|
-
}>>,
|
|
249
|
-
pending:
|
|
250
|
-
statusText: typeof
|
|
251
|
-
}>>,
|
|
252
|
-
pending:
|
|
253
|
-
text: typeof
|
|
254
|
-
}>>,
|
|
255
|
-
pending:
|
|
256
|
-
mimeType:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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;
|
|
275
309
|
}>>]>>>;
|
|
276
|
-
properties:
|
|
310
|
+
properties: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
277
311
|
}>>;
|
|
278
312
|
timeElapsed: typeof Schema.Number;
|
|
279
313
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/extraction/extraction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIjF,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/extraction/extraction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIjF,eAAO,MAAM,eAAe;;;;;;;;;;;;;+BA+D8ic,CAAC;wBAA0C,CAAC;0BAA4C,CAAC;yBAA8F,CAAC;2BAA6C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAtD9yc,CAAC;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC;CAAG;AAEtF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;+BAmD6ic,CAAC;wBAA0C,CAAC;0BAA4C,CAAC;yBAA8F,CAAC;2BAA6C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAhD9yc,CAAC;AACH,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAExF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;IAChE,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAEvF;;GAEG;AAEH,eAAO,MAAM,wBAAwB,GAAU,QAAQ,8BAA8B,KAAG,OAAO,CAAC,gBAAgB,CAkB/G,CAAC"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import { Tool, type Toolkit } from '@effect/ai';
|
|
1
2
|
import { Layer } from 'effect';
|
|
2
3
|
import { ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { DatabaseService, FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
|
|
5
|
+
/**
|
|
6
|
+
* Constructs a `ToolResolverService` whose `resolve(id)` looks up tools in the following order:
|
|
7
|
+
* 1. Toolkit: return an existing tool from the provided `toolkit` if one is present under `id`.
|
|
8
|
+
* 2. Functions in DB: query `FunctionType` by `key=id`; if found, deserialize and project to a tool
|
|
9
|
+
* (propagating any `deployedFunctionId` discovered in the object's metadata).
|
|
10
|
+
* 3. Functions passed in: fall back to a matching `FunctionDefinition` from the `functions` array.
|
|
11
|
+
*
|
|
12
|
+
* If none of the above yield a match, the effect fails with `AiToolNotFoundError`.
|
|
13
|
+
*
|
|
14
|
+
* Requires `DatabaseService` in the environment.
|
|
15
|
+
*/
|
|
16
|
+
export declare const makeToolResolverFromFunctions: (functions: FunctionDefinition<any, any>[], toolkit: Toolkit.Toolkit<any>) => Layer.Layer<ToolResolverService, never, DatabaseService>;
|
|
17
|
+
export declare const makeToolExecutionServiceFromFunctions: (toolkit: Toolkit.Toolkit<any>, handlersLayer: Layer.Layer<Tool.Handler<any>, never, never>) => Layer.Layer<ToolExecutionService, never, FunctionInvocationService>;
|
|
6
18
|
//# sourceMappingURL=services.d.ts.map
|