@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
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as Rpc from '@effect/rpc/Rpc';
|
|
2
|
+
import * as RpcGroup from '@effect/rpc/RpcGroup';
|
|
3
|
+
import * as Schema from 'effect/Schema';
|
|
4
|
+
/**
|
|
5
|
+
* Typed control surface on the live host process that owns a conversation's harness.
|
|
6
|
+
*
|
|
7
|
+
* The same group is declared as the agent process's `rpcs` (so its handlers run on the host's
|
|
8
|
+
* server fiber with the live `AlarmManager`/`inputQueue` in scope) and used by {@link HarnessService}
|
|
9
|
+
* Tier B to dispatch over the discovered host's `Handle.rpc` — keeping both ends on one contract.
|
|
10
|
+
*/
|
|
11
|
+
export declare const HarnessControl: RpcGroup.RpcGroup<Rpc.Rpc<"enqueueMessage", Schema.Struct<{
|
|
12
|
+
content: Schema.Array$<Schema.Union<[Schema.TaggedStruct<"anchor", {
|
|
13
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
14
|
+
objectId: import("@dxos/keys").EntityIdClass;
|
|
15
|
+
version: typeof Schema.Unknown;
|
|
16
|
+
}>, Schema.TaggedStruct<"file", {
|
|
17
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
18
|
+
url: typeof Schema.String;
|
|
19
|
+
name: Schema.optional<typeof Schema.String>;
|
|
20
|
+
mediaType: Schema.optional<typeof Schema.String>;
|
|
21
|
+
}>, Schema.TaggedStruct<"image", {
|
|
22
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
23
|
+
id: Schema.optional<typeof Schema.String>;
|
|
24
|
+
source: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
25
|
+
type: Schema.Literal<["base64"]>;
|
|
26
|
+
mediaType: typeof Schema.String;
|
|
27
|
+
data: typeof Schema.String;
|
|
28
|
+
}>, Schema.Struct<{
|
|
29
|
+
type: Schema.Literal<["http"]>;
|
|
30
|
+
url: typeof Schema.String;
|
|
31
|
+
}>]>>;
|
|
32
|
+
}>, Schema.TaggedStruct<"json", {
|
|
33
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
34
|
+
disposition: Schema.optional<Schema.Literal<["user", "synthetic", "cot", "version-pin"]>>;
|
|
35
|
+
data: typeof Schema.String;
|
|
36
|
+
}>, Schema.TaggedStruct<"proposal", {
|
|
37
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
38
|
+
text: typeof Schema.String;
|
|
39
|
+
}>, Schema.TaggedStruct<"reasoning", {
|
|
40
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
41
|
+
reasoningText: Schema.optional<typeof Schema.String>;
|
|
42
|
+
redactedText: Schema.optional<typeof Schema.String>;
|
|
43
|
+
signature: Schema.optional<typeof Schema.String>;
|
|
44
|
+
}>, Schema.TaggedStruct<"reference", {
|
|
45
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
46
|
+
reference: import("@dxos/echo/Ref").RefSchema<import("@dxos/echo/Obj").Unknown>;
|
|
47
|
+
}>, Schema.TaggedStruct<"select", {
|
|
48
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
49
|
+
options: Schema.mutable<Schema.Array$<typeof Schema.String>>;
|
|
50
|
+
}>, Schema.TaggedStruct<"status", {
|
|
51
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
52
|
+
statusText: typeof Schema.String;
|
|
53
|
+
}>, Schema.TaggedStruct<"suggestion", {
|
|
54
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
55
|
+
text: typeof Schema.String;
|
|
56
|
+
}>, Schema.TaggedStruct<"stats", {
|
|
57
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
58
|
+
mimeType: Schema.optional<typeof Schema.String>;
|
|
59
|
+
message: Schema.optional<typeof Schema.String>;
|
|
60
|
+
model: Schema.optional<typeof Schema.String>;
|
|
61
|
+
usage: Schema.optional<Schema.Struct<{
|
|
62
|
+
inputTokens: Schema.optional<typeof Schema.Number>;
|
|
63
|
+
outputTokens: Schema.optional<typeof Schema.Number>;
|
|
64
|
+
totalTokens: Schema.optional<typeof Schema.Number>;
|
|
65
|
+
}>>;
|
|
66
|
+
toolCalls: Schema.optional<typeof Schema.Number>;
|
|
67
|
+
errors: Schema.optional<typeof Schema.Number>;
|
|
68
|
+
duration: Schema.optional<typeof Schema.Number>;
|
|
69
|
+
finishReason: Schema.optional<Schema.Literal<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
|
|
70
|
+
}>, Schema.TaggedStruct<"surface", {
|
|
71
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
72
|
+
role: typeof Schema.String;
|
|
73
|
+
data: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
74
|
+
}>, Schema.TaggedStruct<"text", {
|
|
75
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
76
|
+
mimeType: Schema.optional<typeof Schema.String>;
|
|
77
|
+
text: typeof Schema.String;
|
|
78
|
+
disposition: Schema.optional<Schema.Literal<["user", "synthetic", "cot", "version-pin"]>>;
|
|
79
|
+
}>, Schema.TaggedStruct<"summary", {
|
|
80
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
81
|
+
content: typeof Schema.String;
|
|
82
|
+
}>, Schema.TaggedStruct<"toolkit", {
|
|
83
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
84
|
+
}>, Schema.TaggedStruct<"toolCall", {
|
|
85
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
86
|
+
toolCallId: typeof Schema.String;
|
|
87
|
+
name: typeof Schema.String;
|
|
88
|
+
input: typeof Schema.String;
|
|
89
|
+
providerExecuted: typeof Schema.Boolean;
|
|
90
|
+
operationKey: Schema.optional<typeof Schema.String>;
|
|
91
|
+
operationName: Schema.optional<typeof Schema.String>;
|
|
92
|
+
operationIcon: Schema.optional<typeof Schema.String>;
|
|
93
|
+
}>, Schema.TaggedStruct<"toolResult", {
|
|
94
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
95
|
+
toolCallId: typeof Schema.String;
|
|
96
|
+
name: typeof Schema.String;
|
|
97
|
+
result: Schema.optional<Schema.Union<[typeof Schema.String, Schema.suspend<{
|
|
98
|
+
readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
|
|
99
|
+
readonly content: readonly ({
|
|
100
|
+
readonly _tag: "text";
|
|
101
|
+
readonly pending?: boolean | undefined;
|
|
102
|
+
readonly mimeType?: string | undefined;
|
|
103
|
+
readonly text: string;
|
|
104
|
+
readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
|
|
105
|
+
} | {
|
|
106
|
+
readonly _tag: "image";
|
|
107
|
+
readonly pending?: boolean | undefined;
|
|
108
|
+
readonly id?: string | undefined;
|
|
109
|
+
readonly source?: {
|
|
110
|
+
readonly type: "base64";
|
|
111
|
+
readonly mediaType: string;
|
|
112
|
+
readonly data: string;
|
|
113
|
+
} | {
|
|
114
|
+
readonly type: "http";
|
|
115
|
+
readonly url: string;
|
|
116
|
+
} | undefined;
|
|
117
|
+
} | {
|
|
118
|
+
readonly _tag: "file";
|
|
119
|
+
readonly pending?: boolean | undefined;
|
|
120
|
+
readonly url: string;
|
|
121
|
+
readonly name?: string | undefined;
|
|
122
|
+
readonly mediaType?: string | undefined;
|
|
123
|
+
})[];
|
|
124
|
+
}, {
|
|
125
|
+
readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
|
|
126
|
+
readonly content: readonly ({
|
|
127
|
+
readonly _tag: "text";
|
|
128
|
+
readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
|
|
129
|
+
readonly mimeType?: string | undefined;
|
|
130
|
+
readonly pending?: boolean | undefined;
|
|
131
|
+
readonly text: string;
|
|
132
|
+
} | {
|
|
133
|
+
readonly _tag: "image";
|
|
134
|
+
readonly id?: string | undefined;
|
|
135
|
+
readonly pending?: boolean | undefined;
|
|
136
|
+
readonly source?: {
|
|
137
|
+
readonly data: string;
|
|
138
|
+
readonly mediaType: string;
|
|
139
|
+
readonly type: "base64";
|
|
140
|
+
} | {
|
|
141
|
+
readonly type: "http";
|
|
142
|
+
readonly url: string;
|
|
143
|
+
} | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
readonly _tag: "file";
|
|
146
|
+
readonly mediaType?: string | undefined;
|
|
147
|
+
readonly name?: string | undefined;
|
|
148
|
+
readonly pending?: boolean | undefined;
|
|
149
|
+
readonly url: string;
|
|
150
|
+
})[];
|
|
151
|
+
}, never>]>>;
|
|
152
|
+
error: Schema.optional<typeof Schema.String>;
|
|
153
|
+
providerExecuted: typeof Schema.Boolean;
|
|
154
|
+
}>, Schema.TaggedStruct<"transcript", {
|
|
155
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
156
|
+
started: typeof Schema.String;
|
|
157
|
+
text: typeof Schema.String;
|
|
158
|
+
corrected: Schema.optional<typeof Schema.String>;
|
|
159
|
+
references: Schema.optional<Schema.mutable<Schema.Array$<import("@dxos/echo/Ref").RefSchema<import("@dxos/echo/Obj").Unknown>>>>;
|
|
160
|
+
candidates: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
161
|
+
text: typeof Schema.String;
|
|
162
|
+
kind: Schema.Literal<["noun", "proper-noun"]>;
|
|
163
|
+
start: typeof Schema.Number;
|
|
164
|
+
end: typeof Schema.Number;
|
|
165
|
+
suggested: Schema.optional<Schema.Struct<{
|
|
166
|
+
typename: typeof Schema.String;
|
|
167
|
+
}>>;
|
|
168
|
+
}>>>>;
|
|
169
|
+
translation: Schema.optional<typeof Schema.String>;
|
|
170
|
+
}>]>>;
|
|
171
|
+
}>, typeof Schema.Void, typeof Schema.Never, never> | Rpc.Rpc<"setAlarm", Schema.Struct<{
|
|
172
|
+
at: typeof Schema.DateTimeUtc;
|
|
173
|
+
message: Schema.NullOr<typeof Schema.String>;
|
|
174
|
+
}>, typeof Schema.Void, typeof Schema.Never, never>>;
|
|
175
|
+
/** Union of the RPCs declared in {@link HarnessControl}. */
|
|
176
|
+
export type HarnessControlRpcs = RpcGroup.Rpcs<typeof HarnessControl>;
|
|
177
|
+
//# sourceMappingURL=harness-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-control.d.ts","sourceRoot":"","sources":["../../../../src/session/harness-control.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAS1B,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './toolkit';
|
|
2
2
|
export * as AiContext from './AiContext';
|
|
3
3
|
export * as AiSession from './AiSession';
|
|
4
|
+
export * as Harness from './Harness';
|
|
5
|
+
export * as SkillHooks from './SkillHooks';
|
|
6
|
+
export { HarnessControl, type HarnessControlRpcs } from './harness-control';
|
|
4
7
|
export { SessionLoader } from './SessionLoader';
|
|
5
8
|
export * as SessionLink from './SessionLink';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAE1B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAE1B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { type AiToolNotFoundError, OpaqueToolkit, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
3
|
-
import { type
|
|
3
|
+
import { type Skill } from '@dxos/compute';
|
|
4
4
|
export type CreateToolkitProps = {
|
|
5
5
|
toolkit?: OpaqueToolkit.Any;
|
|
6
|
-
|
|
6
|
+
skills?: readonly Skill.Skill[];
|
|
7
7
|
/**
|
|
8
8
|
* Self-contained with handlers toolkits.
|
|
9
9
|
*/
|
|
10
10
|
opaqueToolkits?: readonly OpaqueToolkit.Any[];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Build a combined toolkit from the
|
|
13
|
+
* Build a combined toolkit from the skill tools and the provided toolkit.
|
|
14
14
|
*/
|
|
15
|
-
export declare const createToolkit: ({ toolkit: toolkitProp,
|
|
15
|
+
export declare const createToolkit: ({ toolkit: toolkitProp, skills, opaqueToolkits, }: CreateToolkitProps) => Effect.Effect<OpaqueToolkit.OpaqueToolkit, AiToolNotFoundError, ToolResolverService | ToolExecutionService>;
|
|
16
16
|
//# sourceMappingURL=toolkit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,CAAC;IAChC;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,aAAa,CAAC,GAAG,EAAE,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,sDAIvB,kBAAkB,KAAG,MAAM,CAAC,MAAM,CACnC,aAAa,CAAC,aAAa,EAC3B,mBAAmB,EACnB,mBAAmB,GAAG,oBAAoB,CAeuE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Model } from '@dxos/ai';
|
|
2
|
+
import { type Text } from '@dxos/schema';
|
|
2
3
|
/**
|
|
3
4
|
* System template variables.
|
|
4
5
|
*/
|
|
5
|
-
export type SystemPromptOptions =
|
|
6
|
+
export type SystemPromptOptions = Model.Capabilities & {
|
|
6
7
|
DATETIME: string;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
@@ -12,10 +13,7 @@ export type SystemPromptOptions = ModelCapabilities & {
|
|
|
12
13
|
export declare const createSystemPrompt: (options?: Partial<SystemPromptOptions>) => string;
|
|
13
14
|
export declare const templates: {
|
|
14
15
|
system: {
|
|
15
|
-
readonly source: import("@dxos/echo/internal").Ref<
|
|
16
|
-
readonly name?: string | undefined;
|
|
17
|
-
readonly content: string;
|
|
18
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
16
|
+
readonly source: import("@dxos/echo/internal").Ref<Text.Text & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
19
17
|
readonly inputs?: readonly {
|
|
20
18
|
readonly name: string;
|
|
21
19
|
readonly kind: "operation" | "value";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/templates/system.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/templates/system.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAKzC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,YAAY,GAAG;IACrD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,aAAa,OAAO,CAAC,mBAAmB,CAAC,WAMrE,CAAC;AAOJ,eAAO,MAAM,SAAS;IACpB,MAAM;;;;;;;;;CAIP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tool-runtime/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/tool-runtime/services.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAuB,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAoB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKxD,eAAO,MAAM,8BAA8B,GAAI,CAAC,GAAG,KAAK,+BAErD;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;CAAE,KAAQ,KAAK,CAAC,KAAK,CAC9E,mBAAmB,EACnB,KAAK,EACL,aAAa,CAAC,qBAAqB,GAAG,QAAQ,CAAC,OAAO,GAAG,CAAC,CA8B3D,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAE,CAAC,QAAQ;IACnD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;CACpE,KAAG,KAAK,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,EAAE,aAAa,CAAC,qBAAqB,CAkC7E,CAAC;AAEJ,eAAO,MAAM,4CAA4C,QAAO,KAAK,CAAC,KAAK,CACzE,oBAAoB,EACpB,KAAK,EACL,SAAS,CAAC,OAAO,GAAG,aAAa,CAAC,qBAAqB,CAgBxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,4IAGjC,CAAC;AAOF,eAAO,MAAM,oBAAoB,SAAU,IAAI,CAAC,GAAG,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAE3F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../../src/util/artifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGpD;;GAEG;AACH,eAAO,MAAM,qBAAqB,OAAQ,QAAQ,WAA4B,CAAC;AAqE/E,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,UAAU;eAjEV,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG;aAC9D,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,EAChC,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,WAAW,KACb,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../../src/util/artifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGpD;;GAEG;AACH,eAAO,MAAM,qBAAqB,OAAQ,QAAQ,WAA4B,CAAC;AAqE/E,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,UAAU;eAjEV,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG;aAC9D,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,EAChC,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,WAAW,KACb,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC;8BA0EnF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Doc } from '@dxos/echo-doc';
|
|
2
2
|
export type Diff = {
|
|
3
3
|
match: string;
|
|
4
4
|
replace: string;
|
|
@@ -7,11 +7,17 @@ export type Diff = {
|
|
|
7
7
|
* Convert a list of diffs into a list of operations.
|
|
8
8
|
*/
|
|
9
9
|
export declare const reduceDiffs: (diffs: readonly string[]) => Diff[];
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Resolves text diffs against the accessor's current value into cursor-anchored replacements.
|
|
12
|
+
*/
|
|
13
|
+
export declare const computeDiffsWithCursors: <T>(accessor: Doc.Accessor<T>, diffs: readonly string[]) => {
|
|
11
14
|
cursor: string;
|
|
12
15
|
text: string;
|
|
13
16
|
}[];
|
|
14
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Applies text diffs to the accessor-backed document and returns the resulting string.
|
|
19
|
+
*/
|
|
20
|
+
export declare const applyDiffs: <T>(accessor: Doc.Accessor<T>, diffs: readonly string[], { errorOnNotFound }?: {
|
|
15
21
|
errorOnNotFound?: boolean;
|
|
16
22
|
}) => string;
|
|
17
23
|
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../src/util/diff.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../src/util/diff.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAcrC,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,UAAW,SAAS,MAAM,EAAE,KAAG,IAAI,EA0B1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,YAAY,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE;;;GAU7F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,YAChB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,SAClB,SAAS,MAAM,EAAE,wBACK;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,KACzD,MAoBF,CAAC"}
|
|
@@ -66,6 +66,7 @@ export declare const PartialBlock: Trace.EventType<{
|
|
|
66
66
|
readonly toolCalls?: number | undefined;
|
|
67
67
|
readonly errors?: number | undefined;
|
|
68
68
|
readonly duration?: number | undefined;
|
|
69
|
+
readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
|
|
69
70
|
} | {
|
|
70
71
|
readonly _tag: "status";
|
|
71
72
|
readonly pending?: boolean | undefined;
|
|
@@ -78,6 +79,13 @@ export declare const PartialBlock: Trace.EventType<{
|
|
|
78
79
|
readonly _tag: "summary";
|
|
79
80
|
readonly pending?: boolean | undefined;
|
|
80
81
|
readonly content: string;
|
|
82
|
+
} | {
|
|
83
|
+
readonly _tag: "surface";
|
|
84
|
+
readonly pending?: boolean | undefined;
|
|
85
|
+
readonly role: string;
|
|
86
|
+
readonly data?: {
|
|
87
|
+
readonly [x: string]: unknown;
|
|
88
|
+
} | undefined;
|
|
81
89
|
} | {
|
|
82
90
|
readonly _tag: "text";
|
|
83
91
|
readonly pending?: boolean | undefined;
|
|
@@ -137,6 +145,18 @@ export declare const PartialBlock: Trace.EventType<{
|
|
|
137
145
|
readonly pending?: boolean | undefined;
|
|
138
146
|
readonly started: string;
|
|
139
147
|
readonly text: string;
|
|
148
|
+
readonly corrected?: string | undefined;
|
|
149
|
+
readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
|
|
150
|
+
readonly candidates?: {
|
|
151
|
+
readonly text: string;
|
|
152
|
+
readonly kind: "noun" | "proper-noun";
|
|
153
|
+
readonly start: number;
|
|
154
|
+
readonly end: number;
|
|
155
|
+
readonly suggested?: {
|
|
156
|
+
readonly typename: string;
|
|
157
|
+
} | undefined;
|
|
158
|
+
}[] | undefined;
|
|
159
|
+
readonly translation?: string | undefined;
|
|
140
160
|
};
|
|
141
161
|
}>;
|
|
142
162
|
/**
|
|
@@ -205,6 +225,7 @@ export declare const CompleteBlock: Trace.EventType<{
|
|
|
205
225
|
readonly toolCalls?: number | undefined;
|
|
206
226
|
readonly errors?: number | undefined;
|
|
207
227
|
readonly duration?: number | undefined;
|
|
228
|
+
readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
|
|
208
229
|
} | {
|
|
209
230
|
readonly _tag: "status";
|
|
210
231
|
readonly pending?: boolean | undefined;
|
|
@@ -217,6 +238,13 @@ export declare const CompleteBlock: Trace.EventType<{
|
|
|
217
238
|
readonly _tag: "summary";
|
|
218
239
|
readonly pending?: boolean | undefined;
|
|
219
240
|
readonly content: string;
|
|
241
|
+
} | {
|
|
242
|
+
readonly _tag: "surface";
|
|
243
|
+
readonly pending?: boolean | undefined;
|
|
244
|
+
readonly role: string;
|
|
245
|
+
readonly data?: {
|
|
246
|
+
readonly [x: string]: unknown;
|
|
247
|
+
} | undefined;
|
|
220
248
|
} | {
|
|
221
249
|
readonly _tag: "text";
|
|
222
250
|
readonly pending?: boolean | undefined;
|
|
@@ -276,6 +304,18 @@ export declare const CompleteBlock: Trace.EventType<{
|
|
|
276
304
|
readonly pending?: boolean | undefined;
|
|
277
305
|
readonly started: string;
|
|
278
306
|
readonly text: string;
|
|
307
|
+
readonly corrected?: string | undefined;
|
|
308
|
+
readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
|
|
309
|
+
readonly candidates?: {
|
|
310
|
+
readonly text: string;
|
|
311
|
+
readonly kind: "noun" | "proper-noun";
|
|
312
|
+
readonly start: number;
|
|
313
|
+
readonly end: number;
|
|
314
|
+
readonly suggested?: {
|
|
315
|
+
readonly typename: string;
|
|
316
|
+
} | undefined;
|
|
317
|
+
}[] | undefined;
|
|
318
|
+
readonly translation?: string | undefined;
|
|
279
319
|
};
|
|
280
320
|
}>;
|
|
281
321
|
export declare const AgentRequestBegin: Trace.EventType<{}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/util/tracing.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC;;GAEG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/util/tracing.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,eAAO,MAAM,iBAAiB,qBAG5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;EAM1B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;EAOzB,CAAC"}
|