@dxos/assistant 0.9.0 → 0.9.1-staging.ee54ba693a
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/neutral/extraction/index.mjs +108 -119
- package/dist/lib/neutral/extraction/index.mjs.map +4 -4
- package/dist/lib/neutral/index.mjs +395 -234
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts +2 -0
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/proper-noun-extraction.d.ts +26 -0
- package/dist/types/src/extraction/extraction-llm-function/proper-noun-extraction.d.ts.map +1 -0
- package/dist/types/src/extraction/index.d.ts +1 -1
- package/dist/types/src/extraction/index.d.ts.map +1 -1
- package/dist/types/src/extraction/quotes.d.ts +8 -1
- package/dist/types/src/extraction/quotes.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/request/AiRequest.d.ts +19 -208
- package/dist/types/src/request/AiRequest.d.ts.map +1 -1
- package/dist/types/src/request/format.d.ts +1 -1
- package/dist/types/src/request/format.d.ts.map +1 -1
- package/dist/types/src/session/AiContext.d.ts +27 -105
- package/dist/types/src/session/AiContext.d.ts.map +1 -1
- package/dist/types/src/session/AiSession.d.ts +11 -29
- package/dist/types/src/session/AiSession.d.ts.map +1 -1
- package/dist/types/src/session/Harness.d.ts +122 -0
- package/dist/types/src/session/Harness.d.ts.map +1 -0
- package/dist/types/src/session/SessionLink.d.ts +8 -11
- package/dist/types/src/session/SessionLink.d.ts.map +1 -1
- package/dist/types/src/session/SessionLoader.d.ts +2 -2
- package/dist/types/src/session/SessionLoader.d.ts.map +1 -1
- package/dist/types/src/session/SkillHooks.d.ts +28 -0
- package/dist/types/src/session/SkillHooks.d.ts.map +1 -0
- package/dist/types/src/session/harness-control.d.ts +177 -0
- package/dist/types/src/session/harness-control.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/toolkit.d.ts +4 -4
- package/dist/types/src/session/toolkit.d.ts.map +1 -1
- package/dist/types/src/templates/system.d.ts +4 -6
- package/dist/types/src/templates/system.d.ts.map +1 -1
- package/dist/types/src/tool-runtime/index.d.ts.map +1 -0
- package/dist/types/src/tool-runtime/services.d.ts.map +1 -0
- package/dist/types/src/util/artifact.d.ts.map +1 -1
- package/dist/types/src/util/diff.d.ts +9 -3
- package/dist/types/src/util/diff.d.ts.map +1 -1
- package/dist/types/src/util/tracing.d.ts +40 -0
- package/dist/types/src/util/tracing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -25
- package/src/extraction/extraction-llm-function/index.ts +5 -0
- package/src/extraction/extraction-llm-function/proper-noun-extraction.ts +78 -0
- package/src/extraction/index.ts +1 -1
- package/src/extraction/quotes.test.ts +67 -2
- package/src/extraction/quotes.ts +47 -13
- package/src/index.ts +1 -1
- package/src/request/AiRequest.ts +45 -14
- package/src/request/format.ts +9 -11
- package/src/session/AiContext.test.ts +52 -32
- package/src/session/AiContext.ts +73 -95
- package/src/session/AiSession.test.ts +4 -4
- package/src/session/AiSession.ts +51 -83
- package/src/session/Harness.ts +241 -0
- package/src/session/SessionLink.ts +8 -8
- package/src/session/SessionLoader.ts +4 -4
- package/src/session/SkillHooks.ts +71 -0
- package/src/session/harness-control.ts +30 -0
- package/src/session/index.ts +3 -0
- package/src/session/toolkit.ts +8 -8
- package/src/templates/instructions/format.tpl +3 -3
- package/src/templates/instructions/system.tpl +10 -12
- package/src/templates/system.ts +6 -2
- package/src/util/artifact.ts +9 -2
- package/src/util/diff.test.ts +4 -4
- package/src/util/diff.ts +15 -8
- package/src/util/tracing.ts +1 -1
- package/dist/types/src/extraction/extraction.d.ts +0 -1677
- package/dist/types/src/extraction/extraction.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/services.d.ts.map +0 -1
- package/src/extraction/extraction-llm-function/transcription-instructions.tpl +0 -28
- package/src/extraction/extraction.ts +0 -105
- /package/dist/types/src/{functions → tool-runtime}/index.d.ts +0 -0
- /package/dist/types/src/{functions → tool-runtime}/services.d.ts +0 -0
- /package/src/{functions → tool-runtime}/index.ts +0 -0
- /package/src/{functions → tool-runtime}/services.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/request/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,SAAS,EAAY,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,KAAK,QAAQ,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAIzD,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAG9C;;GAEG;AAEH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/request/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,SAAS,EAAY,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,KAAK,QAAQ,EAAO,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAIzD,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAG9C;;GAEG;AAEH,eAAO,MAAM,kBAAkB,iCAI5B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAC1E,MAAM,EACN,qBAAqB,GAAG,mBAAmB,EAC3C,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAqCT,CAAC;AAEjD;;GAEG;AAGH,eAAO,MAAM,gBAAgB,yBAG1B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAoCvD,CAAC"}
|
|
@@ -1,145 +1,74 @@
|
|
|
1
1
|
import { Atom, Registry as AtomRegistry } from '@effect-atom/atom-react';
|
|
2
|
-
import * as Context from 'effect/Context';
|
|
3
|
-
import * as Effect from 'effect/Effect';
|
|
4
2
|
import * as Runtime from 'effect/Runtime';
|
|
5
|
-
import
|
|
6
|
-
import { Blueprint } from '@dxos/compute';
|
|
3
|
+
import { Skill } from '@dxos/compute';
|
|
7
4
|
import { Resource } from '@dxos/context';
|
|
8
|
-
import { Feed, Obj, Ref, Type } from '@dxos/echo';
|
|
5
|
+
import { Database, Feed, Obj, Ref, Type } from '@dxos/echo';
|
|
9
6
|
import { type URI } from '@dxos/keys';
|
|
10
7
|
import { ComplexSet } from '@dxos/util';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly blueprints: {
|
|
16
|
-
readonly added: readonly import("@dxos/echo/internal").Ref<{
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly description?: string | undefined;
|
|
19
|
-
readonly instructions: {
|
|
20
|
-
readonly source: import("@dxos/echo/internal").Ref<{
|
|
21
|
-
readonly name?: string | undefined;
|
|
22
|
-
readonly content: string;
|
|
23
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
24
|
-
readonly inputs?: readonly {
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly kind: "operation" | "value";
|
|
27
|
-
readonly default?: any;
|
|
28
|
-
readonly operation?: string | undefined;
|
|
29
|
-
}[] | undefined;
|
|
30
|
-
};
|
|
31
|
-
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
32
|
-
readonly agentCanEnable?: boolean | undefined;
|
|
33
|
-
readonly mcpServers?: readonly {
|
|
34
|
-
readonly name?: string | undefined;
|
|
35
|
-
readonly url: string;
|
|
36
|
-
readonly protocol: "http" | "sse";
|
|
37
|
-
readonly apiKey?: string | undefined;
|
|
38
|
-
}[] | undefined;
|
|
39
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
|
|
40
|
-
readonly removed: readonly import("@dxos/echo/internal").Ref<{
|
|
41
|
-
readonly name: string;
|
|
42
|
-
readonly description?: string | undefined;
|
|
43
|
-
readonly instructions: {
|
|
44
|
-
readonly source: import("@dxos/echo/internal").Ref<{
|
|
45
|
-
readonly name?: string | undefined;
|
|
46
|
-
readonly content: string;
|
|
47
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
48
|
-
readonly inputs?: readonly {
|
|
49
|
-
readonly name: string;
|
|
50
|
-
readonly kind: "operation" | "value";
|
|
51
|
-
readonly default?: any;
|
|
52
|
-
readonly operation?: string | undefined;
|
|
53
|
-
}[] | undefined;
|
|
54
|
-
};
|
|
55
|
-
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
56
|
-
readonly agentCanEnable?: boolean | undefined;
|
|
57
|
-
readonly mcpServers?: readonly {
|
|
58
|
-
readonly name?: string | undefined;
|
|
59
|
-
readonly url: string;
|
|
60
|
-
readonly protocol: "http" | "sse";
|
|
61
|
-
readonly apiKey?: string | undefined;
|
|
62
|
-
}[] | undefined;
|
|
63
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
|
|
8
|
+
declare const Binding_base: Type.ObjClass<Binding, {
|
|
9
|
+
readonly skills: {
|
|
10
|
+
readonly added: readonly import("@dxos/echo/internal").Ref<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
|
|
11
|
+
readonly removed: readonly import("@dxos/echo/internal").Ref<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
|
|
64
12
|
};
|
|
65
13
|
readonly objects: {
|
|
66
14
|
readonly added: readonly import("@dxos/echo/internal").Ref<Obj.Unknown>[];
|
|
67
15
|
readonly removed: readonly import("@dxos/echo/internal").Ref<Obj.Unknown>[];
|
|
68
16
|
};
|
|
69
|
-
},
|
|
70
|
-
|
|
17
|
+
}, {}>;
|
|
18
|
+
/**
|
|
19
|
+
* Thread message that binds or unbinds contextual objects to a conversation.
|
|
20
|
+
*/
|
|
21
|
+
export declare class Binding extends Binding_base {
|
|
22
|
+
}
|
|
71
23
|
export type BindingProps = Partial<{
|
|
72
|
-
|
|
24
|
+
skills: Ref.Ref<Skill.Skill>[];
|
|
73
25
|
objects: Ref.Ref<Obj.Unknown>[];
|
|
74
26
|
}>;
|
|
75
27
|
export declare class Bindings {
|
|
76
|
-
readonly
|
|
77
|
-
readonly name: string;
|
|
78
|
-
readonly description?: string | undefined;
|
|
79
|
-
readonly instructions: {
|
|
80
|
-
readonly source: import("@dxos/echo/internal").Ref<{
|
|
81
|
-
readonly name?: string | undefined;
|
|
82
|
-
readonly content: string;
|
|
83
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
84
|
-
readonly inputs?: readonly {
|
|
85
|
-
readonly name: string;
|
|
86
|
-
readonly kind: "operation" | "value";
|
|
87
|
-
readonly default?: any;
|
|
88
|
-
readonly operation?: string | undefined;
|
|
89
|
-
}[] | undefined;
|
|
90
|
-
};
|
|
91
|
-
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
92
|
-
readonly agentCanEnable?: boolean | undefined;
|
|
93
|
-
readonly mcpServers?: readonly {
|
|
94
|
-
readonly name?: string | undefined;
|
|
95
|
-
readonly url: string;
|
|
96
|
-
readonly protocol: "http" | "sse";
|
|
97
|
-
readonly apiKey?: string | undefined;
|
|
98
|
-
}[] | undefined;
|
|
99
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>>>;
|
|
28
|
+
readonly skills: ComplexSet<Ref.Ref<Skill.Skill>>;
|
|
100
29
|
readonly objects: ComplexSet<Ref.Ref<Obj.Unknown>>;
|
|
101
30
|
toJSON(): {
|
|
102
|
-
|
|
31
|
+
skills: URI.URI[];
|
|
103
32
|
objects: URI.URI[];
|
|
104
33
|
};
|
|
105
34
|
}
|
|
106
35
|
export type BinderOptions = {
|
|
107
36
|
feed: Feed.Feed;
|
|
108
|
-
runtime: Runtime.Runtime<
|
|
37
|
+
runtime: Runtime.Runtime<Database.Service>;
|
|
109
38
|
/** @effect-atom/atom-react Registry for reactive state management. */
|
|
110
39
|
registry?: AtomRegistry.Registry;
|
|
111
40
|
};
|
|
112
41
|
/**
|
|
113
|
-
* Manages bindings of
|
|
42
|
+
* Manages bindings of skills and objects to a conversation.
|
|
114
43
|
*/
|
|
115
44
|
export declare class Binder extends Resource {
|
|
116
45
|
#private;
|
|
117
|
-
private readonly
|
|
46
|
+
private readonly _skills;
|
|
118
47
|
private readonly _objects;
|
|
119
48
|
private readonly _registry;
|
|
120
49
|
private readonly _feed;
|
|
121
50
|
private readonly _runtime;
|
|
122
51
|
constructor(options: BinderOptions);
|
|
123
52
|
/**
|
|
124
|
-
* Returns the
|
|
53
|
+
* Returns the skills atom for subscription.
|
|
125
54
|
*/
|
|
126
|
-
get
|
|
55
|
+
get skills(): Atom.Atom<Skill.Skill[]>;
|
|
127
56
|
/**
|
|
128
57
|
* Returns the objects atom for subscription.
|
|
129
58
|
*/
|
|
130
59
|
get objects(): Atom.Atom<Obj.Unknown[]>;
|
|
131
60
|
/**
|
|
132
|
-
* Gets the current
|
|
61
|
+
* Gets the current skills value.
|
|
133
62
|
*/
|
|
134
|
-
|
|
63
|
+
getSkills(): Skill.Skill[];
|
|
135
64
|
/**
|
|
136
65
|
* Gets the current objects value.
|
|
137
66
|
*/
|
|
138
67
|
getObjects(): Obj.Unknown[];
|
|
139
68
|
/**
|
|
140
|
-
* Subscribe to changes in
|
|
69
|
+
* Subscribe to changes in skills.
|
|
141
70
|
*/
|
|
142
|
-
|
|
71
|
+
subscribeSkills(cb: (skills: Skill.Skill[]) => void): () => void;
|
|
143
72
|
/**
|
|
144
73
|
* Subscribe to changes in objects.
|
|
145
74
|
*/
|
|
@@ -151,14 +80,14 @@ export declare class Binder extends Resource {
|
|
|
151
80
|
sync(): Promise<void>;
|
|
152
81
|
private _updateBindings;
|
|
153
82
|
protected _close(): Promise<void>;
|
|
154
|
-
bind({
|
|
155
|
-
unbind({
|
|
83
|
+
bind({ skills, objects }: BindingProps): Promise<void>;
|
|
84
|
+
unbind({ skills, objects }: BindingProps): Promise<void>;
|
|
156
85
|
/**
|
|
157
86
|
* Process bindings to filter duplicates and determine next state.
|
|
158
87
|
*/
|
|
159
88
|
private _processBindings;
|
|
160
89
|
/**
|
|
161
|
-
* Reduce results into sets of
|
|
90
|
+
* Reduce results into sets of skills and objects.
|
|
162
91
|
*/
|
|
163
92
|
private _reduce;
|
|
164
93
|
/**
|
|
@@ -167,12 +96,5 @@ export declare class Binder extends Resource {
|
|
|
167
96
|
private _mergeInto;
|
|
168
97
|
private _resolve;
|
|
169
98
|
}
|
|
170
|
-
declare const Service_base: Context.TagClass<Service, "@dxos/assistant/AiContextService", {
|
|
171
|
-
binder: Binder;
|
|
172
|
-
}>;
|
|
173
|
-
export declare class Service extends Service_base {
|
|
174
|
-
static bindContext: ({ blueprints, objects }: BindingProps) => Effect.Effect<void, never, Service>;
|
|
175
|
-
static findObjects: <T extends Type.AnyObj>(type: T) => Effect.Effect<Type.InstanceType<T>[], never, Service>;
|
|
176
|
-
}
|
|
177
99
|
export {};
|
|
178
100
|
//# sourceMappingURL=AiContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiContext.d.ts","sourceRoot":"","sources":["../../../../src/session/AiContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"AiContext.d.ts","sourceRoot":"","sources":["../../../../src/session/AiContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGzE,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAc,QAAQ,EAAO,IAAI,EAAE,GAAG,EAA2B,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEtG,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;;;;;;;;;;;AAEvD;;GAEG;AACH,qBAAa,OAAQ,SAAQ,YAY5B;CAAG;AACJ,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IACjC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;IAC/B,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;CACjC,CAAC,CAAC;AAEH,qBAAa,QAAQ;IACnB,QAA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OAAO,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI,CAEjE;IAED,UAAyB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAa9C;IAED;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAU1B;YAEa,eAAe;IA0D7B,UAAyB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAI/C;IAEK,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B3D;IAEK,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC7D;IAED;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA+BxB;;OAEG;IACH,OAAO,CAAC,OAAO;IA0Bf;;OAEG;IACH,OAAO,CAAC,UAAU;YAkBJ,QAAQ;CAmBvB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Registry as AtomRegistry } from '@effect-atom/atom-react';
|
|
2
|
-
import * as Context from 'effect/Context';
|
|
3
2
|
import * as Effect from 'effect/Effect';
|
|
4
3
|
import * as Layer from 'effect/Layer';
|
|
5
4
|
import * as Runtime from 'effect/Runtime';
|
|
@@ -7,7 +6,7 @@ import { type OpaqueToolkit, type ToolExecutionService, type ToolResolverService
|
|
|
7
6
|
import { McpServer, Operation } from '@dxos/compute';
|
|
8
7
|
import { Resource } from '@dxos/context';
|
|
9
8
|
import { Database, Feed, Registry } from '@dxos/echo';
|
|
10
|
-
import {
|
|
9
|
+
import { type ContentBlock, Message } from '@dxos/types';
|
|
11
10
|
import { AiRequest, type GenerationObserver } from '../request';
|
|
12
11
|
import * as AiContext from './AiContext';
|
|
13
12
|
export type RunProps<R = never> = {
|
|
@@ -16,13 +15,19 @@ export type RunProps<R = never> = {
|
|
|
16
15
|
observer?: GenerationObserver;
|
|
17
16
|
toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
|
|
18
17
|
/**
|
|
19
|
-
* Space-level MCP servers to connect alongside
|
|
18
|
+
* Space-level MCP servers to connect alongside skill-defined ones.
|
|
20
19
|
*/
|
|
21
20
|
mcpServers?: readonly McpServer.McpServer[];
|
|
21
|
+
/**
|
|
22
|
+
* When false, messages from this request are not appended to the feed or persisted to trace.
|
|
23
|
+
*
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
persist?: boolean;
|
|
22
27
|
};
|
|
23
28
|
export type Options = {
|
|
24
29
|
feed: Feed.Feed;
|
|
25
|
-
runtime: Runtime.Runtime<
|
|
30
|
+
runtime: Runtime.Runtime<Database.Service>;
|
|
26
31
|
/** @effect-atom/atom-react Registry for reactive state. */
|
|
27
32
|
registry?: AtomRegistry.Registry;
|
|
28
33
|
};
|
|
@@ -32,7 +37,7 @@ export type Options = {
|
|
|
32
37
|
*/
|
|
33
38
|
export declare class Session extends Resource {
|
|
34
39
|
/**
|
|
35
|
-
*
|
|
40
|
+
* Skills and objects bound to the session.
|
|
36
41
|
*/
|
|
37
42
|
private readonly _binder;
|
|
38
43
|
private readonly _feed;
|
|
@@ -40,11 +45,7 @@ export declare class Session extends Resource {
|
|
|
40
45
|
private readonly _sessionLoader;
|
|
41
46
|
constructor(options: Options);
|
|
42
47
|
protected _open(): Promise<void>;
|
|
43
|
-
get feed():
|
|
44
|
-
readonly name?: string | undefined;
|
|
45
|
-
readonly kind?: string | undefined;
|
|
46
|
-
readonly namespace?: "data" | "trace" | undefined;
|
|
47
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>;
|
|
48
|
+
get feed(): Feed.Feed;
|
|
48
49
|
get context(): AiContext.Binder;
|
|
49
50
|
getHistory(): Promise<Message.Message[]>;
|
|
50
51
|
getTools(): Effect.Effect<Record<string, import('@effect/ai/Tool').Any>, never, ToolExecutionService | ToolResolverService>;
|
|
@@ -57,23 +58,4 @@ export declare class Session extends Resource {
|
|
|
57
58
|
*/
|
|
58
59
|
createRequest<R = never>(params: RunProps<R>): Effect.Effect<Message.Message[], AiRequest.RunError, AiRequest.RunRequirements | R>;
|
|
59
60
|
}
|
|
60
|
-
declare const Service_base: Context.TagClass<Service, "@dxos/assistant/AiSessionService", Session>;
|
|
61
|
-
/**
|
|
62
|
-
* Gives access to the ai session.
|
|
63
|
-
*/
|
|
64
|
-
export declare class Service extends Service_base {
|
|
65
|
-
/**
|
|
66
|
-
* Create a new session layer from options.
|
|
67
|
-
*/
|
|
68
|
-
static layer: (options: Options) => Layer.Layer<Service | AiContext.Service>;
|
|
69
|
-
/**
|
|
70
|
-
* Create a new session with a new feed.
|
|
71
|
-
*/
|
|
72
|
-
static layerNewFeed: (options?: Omit<Options, 'feed' | 'runtime'>) => Layer.Layer<Service | AiContext.Service, never, Database.Service | Feed.FeedService>;
|
|
73
|
-
/**
|
|
74
|
-
* Run a prompt in the current session.
|
|
75
|
-
*/
|
|
76
|
-
static run: <R = never>(params: RunProps<R>) => Effect.Effect<Message.Message[], AiRequest.RunError, AiRequest.RunRequirements | Service | R>;
|
|
77
|
-
}
|
|
78
|
-
export {};
|
|
79
61
|
//# sourceMappingURL=AiSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiSession.d.ts","sourceRoot":"","sources":["../../../../src/session/AiSession.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AiSession.d.ts","sourceRoot":"","sources":["../../../../src/session/AiSession.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,a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CAAC,QAAQ,CAAoC;IAC7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IAEtD,YAAmB,OAAO,EAAE,OAAO,EAWlC;IAED,UAAyB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9C;IAED,IAAW,IAAI,cAEd;IAED,IAAW,OAAO,qBAEjB;IAEY,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAKpD;IAED,QAAQ,IAAI,MAAM,CAAC,MAAM,CACvB,MAAM,CAAC,MAAM,EAAE,OAAO,iBAAiB,EAAE,GAAG,CAAC,EAC7C,KAAK,EACL,oBAAoB,GAAG,mBAAmB,CAC3C,CAKA;IAED;;OAEG;IACH,yBAAyB,IAAI,KAAK,CAAC,KAAK,CACtC,oBAAoB,GAAG,mBAAmB,EAC1C,KAAK,EACL,aAAa,CAAC,qBAAqB,GAAG,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAC3E,CAIA;IAED;;OAEG;IACI,aAAa,CAAC,CAAC,GAAG,KAAK,EAC5B,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAClB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,CAAC,CAAC,CAyFrF;CACF"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as DateTime from 'effect/DateTime';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import type * as Runtime from 'effect/Runtime';
|
|
5
|
+
import type * as Scope from 'effect/Scope';
|
|
6
|
+
import { LayerSpec } from '@dxos/compute';
|
|
7
|
+
import { ProcessManager } from '@dxos/compute-runtime';
|
|
8
|
+
import { Database, Feed, Filter, Obj, type URI } from '@dxos/echo';
|
|
9
|
+
import { BaseError } from '@dxos/errors';
|
|
10
|
+
import { type ContentBlock, Message } from '@dxos/types';
|
|
11
|
+
import * as AiContext from './AiContext';
|
|
12
|
+
export interface Service {
|
|
13
|
+
/** The conversation {@link AiContext.Binder} (Tier A). */
|
|
14
|
+
binder: Effect.Effect<AiContext.Binder, NotSupportedError>;
|
|
15
|
+
/** The conversation message history (Tier A). */
|
|
16
|
+
history: Effect.Effect<Message.Message[], NotSupportedError>;
|
|
17
|
+
/** Objects bound to the conversation that match the filter (Tier A). */
|
|
18
|
+
queryContext<T extends Obj.Unknown>(filter: Filter.Filter<T>): Effect.Effect<T[], NotSupportedError>;
|
|
19
|
+
/** Enqueue a message into the owning host's input queue (Tier B). */
|
|
20
|
+
enqueueMessage(options: EnqueueMessageOptions): Effect.Effect<void, NotSupportedError>;
|
|
21
|
+
/** Schedule a self-wake on the owning host (Tier B). */
|
|
22
|
+
setAlarm(options: SetAlarmOptions): Effect.Effect<void, NotSupportedError>;
|
|
23
|
+
}
|
|
24
|
+
declare const HarnessService_base: Context.TagClass<HarnessService, "@dxos/assistant/HarnessService", Service>;
|
|
25
|
+
/**
|
|
26
|
+
* Provides access to the controlling harness for tools and operations that are executed by the agent.
|
|
27
|
+
*
|
|
28
|
+
* Replaces AiContextService and AiSessionService.
|
|
29
|
+
*/
|
|
30
|
+
export declare class HarnessService extends HarnessService_base {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Acess current context binder.
|
|
34
|
+
*/
|
|
35
|
+
export declare const binder: Effect.Effect<AiContext.Binder, NotSupportedError, HarnessService>;
|
|
36
|
+
/**
|
|
37
|
+
* Query the context using a filter.
|
|
38
|
+
*/
|
|
39
|
+
export declare const queryContext: <T extends Obj.Unknown>(filter: Filter.Filter<T>) => Effect.Effect<T[], NotSupportedError, HarnessService>;
|
|
40
|
+
interface EnqueueMessageOptions {
|
|
41
|
+
content: ContentBlock.Any[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Query the session history.
|
|
45
|
+
*/
|
|
46
|
+
export declare const history: Effect.Effect<Message.Message[], NotSupportedError, HarnessService>;
|
|
47
|
+
/**
|
|
48
|
+
* Enqueue a message to the harness.
|
|
49
|
+
*/
|
|
50
|
+
export declare const enqueueMessage: (options: EnqueueMessageOptions) => Effect.Effect<void, NotSupportedError, HarnessService>;
|
|
51
|
+
interface SetAlarmOptions {
|
|
52
|
+
at: DateTime.DateTime;
|
|
53
|
+
/**
|
|
54
|
+
* Message to send when the alarm fires.
|
|
55
|
+
*/
|
|
56
|
+
message: string | null;
|
|
57
|
+
}
|
|
58
|
+
export declare const setAlarm: (options: SetAlarmOptions) => Effect.Effect<void, NotSupportedError, HarnessService>;
|
|
59
|
+
/**
|
|
60
|
+
* Binds skills and/or objects to the conversation context.
|
|
61
|
+
*/
|
|
62
|
+
export declare const bindContext: ({ skills, objects, }: AiContext.BindingProps) => Effect.Effect<void, NotSupportedError, HarnessService>;
|
|
63
|
+
declare const NotSupportedError_base: {
|
|
64
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
65
|
+
cause?: unknown;
|
|
66
|
+
stack?: string;
|
|
67
|
+
name: "NotSupportedError";
|
|
68
|
+
context: Record<string, unknown>;
|
|
69
|
+
readonly message: string;
|
|
70
|
+
readonly _tag: "NotSupportedError";
|
|
71
|
+
};
|
|
72
|
+
isError(error: unknown): error is Error;
|
|
73
|
+
name: "NotSupportedError";
|
|
74
|
+
is(error: unknown): error is BaseError;
|
|
75
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
|
|
76
|
+
ifTypeDiffers?: boolean;
|
|
77
|
+
}): (error: unknown) => {
|
|
78
|
+
cause?: unknown;
|
|
79
|
+
stack?: string;
|
|
80
|
+
name: "NotSupportedError";
|
|
81
|
+
context: Record<string, unknown>;
|
|
82
|
+
readonly message: string;
|
|
83
|
+
readonly _tag: "NotSupportedError";
|
|
84
|
+
};
|
|
85
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
86
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
87
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
88
|
+
stackTraceLimit: number;
|
|
89
|
+
};
|
|
90
|
+
export declare class NotSupportedError extends NotSupportedError_base {
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Process-affinity {@link LayerSpec} that materialises {@link HarnessService} from the resolution
|
|
94
|
+
* context's `conversation` DXN. Merges the former `AiContext.Service` (Tier A) with live host
|
|
95
|
+
* dispatch (Tier B).
|
|
96
|
+
*/
|
|
97
|
+
export declare const layerSpec: LayerSpec.LayerSpec;
|
|
98
|
+
interface MakeOptions {
|
|
99
|
+
conversation: URI.URI;
|
|
100
|
+
processManager: Context.Tag.Service<ProcessManager.Service>;
|
|
101
|
+
runtime: Runtime.Runtime<Database.Service>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Builds the {@link Service} for a conversation-scoped resolution context. Tier A resolves the
|
|
105
|
+
* conversation feed / {@link AiContext.Binder} once; Tier B looks up the owning host process lazily per call
|
|
106
|
+
* and dispatches over its `Handle.rpc` control surface (raising {@link NotSupportedError} when no
|
|
107
|
+
* live host owns the conversation).
|
|
108
|
+
*/
|
|
109
|
+
export declare const make: ({ conversation, processManager, runtime, }: MakeOptions) => Effect.Effect<Service, never, Scope.Scope>;
|
|
110
|
+
interface FromBinderOptions {
|
|
111
|
+
feed: Feed.Feed;
|
|
112
|
+
runtime: Runtime.Runtime<Database.Service>;
|
|
113
|
+
binder: AiContext.Binder;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Builds the {@link Service} from a {@link AiContext.Binder} already opened for the conversation (e.g. the
|
|
117
|
+
* agent's own turn fiber, which has no `ProcessManager.Service` in scope). Tier A is fully served;
|
|
118
|
+
* Tier B raises {@link NotSupportedError} since the live-host control surface is not reachable here.
|
|
119
|
+
*/
|
|
120
|
+
export declare const fromBinder: ({ feed, runtime, binder }: FromBinderOptions) => Service;
|
|
121
|
+
export {};
|
|
122
|
+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CAI7E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,iBAAkB,SAAQ,sBAAgE;CAAG;AAE1G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,SA0BjC,CAAC;AAEF,UAAU,WAAW;IACnB,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5D,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,+CAId,WAAW,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAatD,CAAC;AAEL,UAAU,iBAAiB;IACzB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,8BAA+B,iBAAiB,KAAG,OACgB,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Feed, Obj, Type } from '@dxos/echo';
|
|
2
|
+
declare const SessionLink_base: Type.ObjClass<SessionLink, {
|
|
3
|
+
readonly feedRef: import("@dxos/echo/internal").Ref<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
4
|
+
readonly messageId: string;
|
|
5
|
+
}, {}>;
|
|
3
6
|
/**
|
|
4
7
|
* Feed-level record that links this session to a point in another session's history.
|
|
5
8
|
* When present in a feed, the messages from the referenced feed up to and including
|
|
6
9
|
* `messageId` are prepended to the conversation history before each turn.
|
|
7
10
|
*/
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly kind?: string | undefined;
|
|
12
|
-
readonly namespace?: "data" | "trace" | undefined;
|
|
13
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
14
|
-
readonly messageId: string;
|
|
15
|
-
}, Schema.Struct.Fields>;
|
|
16
|
-
export type SessionLink = Type.InstanceType<typeof SessionLink>;
|
|
11
|
+
export declare class SessionLink extends SessionLink_base {
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
17
14
|
//# sourceMappingURL=SessionLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionLink.d.ts","sourceRoot":"","sources":["../../../../src/session/SessionLink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionLink.d.ts","sourceRoot":"","sources":["../../../../src/session/SessionLink.ts"],"names":[],"mappings":"AAQA,OAAO,EAAO,IAAI,EAAE,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;;;;;AAEvD;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,gBAOhC;CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Feed } from '@dxos/echo';
|
|
2
|
+
import { Database, Feed } from '@dxos/echo';
|
|
3
3
|
import { Message } from '@dxos/types';
|
|
4
4
|
/**
|
|
5
5
|
* Loads and reifies conversation history by resolving SessionLink feed records.
|
|
@@ -10,6 +10,6 @@ export declare class SessionLoader {
|
|
|
10
10
|
* Queries the feed for any SessionLink record; if found, loads messages from
|
|
11
11
|
* the referenced feed up to and including `messageId` and prepends them.
|
|
12
12
|
*/
|
|
13
|
-
reifyHistory(feed: Feed.Feed, messages: Message.Message[]): Effect.Effect<Message.Message[], never,
|
|
13
|
+
reifyHistory(feed: Feed.Feed, messages: Message.Message[]): Effect.Effect<Message.Message[], never, Database.Service>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=SessionLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionLoader.d.ts","sourceRoot":"","sources":["../../../../src/session/SessionLoader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionLoader.d.ts","sourceRoot":"","sources":["../../../../src/session/SessionLoader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC;;GAEG;AACH,qBAAa,aAAa;IACxB;;;;OAIG;IACH,YAAY,CACV,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE,GAC1B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CA8B3D;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Operation, Skill } from '@dxos/compute';
|
|
3
|
+
import { Database } from '@dxos/echo';
|
|
4
|
+
/**
|
|
5
|
+
* Tag of the lifecycle point a hook fires at, matching {@link Skill.HookSpec}.
|
|
6
|
+
*/
|
|
7
|
+
export type HookPhase = 'begin-request' | 'end-request';
|
|
8
|
+
/**
|
|
9
|
+
* Invokes a resolved operation with the hook's templated input. Begin and end hooks fire in
|
|
10
|
+
* different contexts (the agent's turn fiber vs. a child process with Tier B reachable), so the
|
|
11
|
+
* invocation strategy is supplied by the caller rather than fixed here. `R` carries the invoker's
|
|
12
|
+
* own requirements (e.g. `Operation.Service`) up into {@link runHooks}.
|
|
13
|
+
*/
|
|
14
|
+
export type HookInvoker<R> = (operation: Operation.Definition.Any, input: Record<string, unknown>) => Effect.Effect<void, never, R>;
|
|
15
|
+
/**
|
|
16
|
+
* Runs every {@link Skill.Hook} on `skills` whose spec matches `phase`. Each hook resolves its
|
|
17
|
+
* `function` ref to a {@link Operation.PersistentOperation}, deserializes it to a definition, and
|
|
18
|
+
* invokes it with the templated `input` via `invoke`. Hooks without a function ref are skipped.
|
|
19
|
+
*
|
|
20
|
+
* Hook failures are isolated: a throwing hook logs and is swallowed so one skill's hook cannot
|
|
21
|
+
* abort the request lifecycle (or the sibling hooks).
|
|
22
|
+
*/
|
|
23
|
+
export declare const runHooks: <R>({ skills, phase, invoke, }: {
|
|
24
|
+
skills: readonly Skill.Skill[];
|
|
25
|
+
phase: HookPhase;
|
|
26
|
+
invoke: HookInvoker<R>;
|
|
27
|
+
}) => Effect.Effect<void, never, Database.Service | R>;
|
|
28
|
+
//# sourceMappingURL=SkillHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillHooks.d.ts","sourceRoot":"","sources":["../../../../src/session/SkillHooks.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAO,MAAM,YAAY,CAAC;AAI3C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,aAAa,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAC3B,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EACnC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,8BAIvB;IACD,MAAM,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACxB,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,CAAC,CAyB/C,CAAC"}
|