@dxos/assistant 0.7.4 → 0.7.5-labs.5f04cf6
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-37SDA65J.mjs +565 -0
- package/dist/lib/browser/chunk-37SDA65J.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +936 -47
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +14 -8
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node/chunk-UYNIAO5N.cjs +577 -0
- package/dist/lib/node/chunk-UYNIAO5N.cjs.map +7 -0
- package/dist/lib/node/index.cjs +936 -54
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +20 -13
- package/dist/lib/node/testing/index.cjs.map +4 -4
- package/dist/lib/node-esm/chunk-AR24K7TY.mjs +567 -0
- package/dist/lib/node-esm/chunk-AR24K7TY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +936 -47
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +14 -8
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/ai-service/client.d.ts +16 -32
- package/dist/types/src/ai-service/client.d.ts.map +1 -1
- package/dist/types/src/ai-service/defs.d.ts +134 -0
- package/dist/types/src/ai-service/defs.d.ts.map +1 -0
- package/dist/types/src/ai-service/index.d.ts +3 -1
- package/dist/types/src/ai-service/index.d.ts.map +1 -1
- package/dist/types/src/ai-service/parser.d.ts +40 -0
- package/dist/types/src/ai-service/parser.d.ts.map +1 -0
- package/dist/types/src/ai-service/stream.d.ts +35 -0
- package/dist/types/src/ai-service/stream.d.ts.map +1 -0
- package/dist/types/src/ai-service/stream.test.d.ts +2 -0
- package/dist/types/src/ai-service/stream.test.d.ts.map +1 -0
- package/dist/types/src/ai-service/util/index.d.ts +2 -0
- package/dist/types/src/ai-service/util/index.d.ts.map +1 -0
- package/dist/types/src/ai-service/{sse.d.ts → util/sse.d.ts} +5 -0
- package/dist/types/src/ai-service/util/sse.d.ts.map +1 -0
- package/dist/types/src/conversation/conversation.d.ts +56 -5
- package/dist/types/src/conversation/conversation.d.ts.map +1 -1
- package/dist/types/src/conversation/index.d.ts +0 -1
- package/dist/types/src/conversation/index.d.ts.map +1 -1
- package/dist/types/src/conversation/types.d.ts +44 -13
- package/dist/types/src/conversation/types.d.ts.map +1 -1
- package/dist/types/src/cypher/combinators.d.ts.map +1 -1
- package/dist/types/src/cypher/parjs.d.ts +1 -1
- package/dist/types/src/cypher/parjs.d.ts.map +1 -1
- package/dist/types/src/cypher/schema.d.ts.map +1 -1
- package/dist/types/src/testing/artifacts.test.d.ts +1 -0
- package/dist/types/src/testing/artifacts.test.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +2 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/defs.d.ts +5 -0
- package/dist/types/src/testing/defs.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/logger.d.ts +1 -1
- package/dist/types/src/testing/logger.d.ts.map +1 -1
- package/dist/types/src/testing/query-promts.d.ts +1 -1
- package/dist/types/src/testing/query-promts.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +1 -1
- package/dist/types/src/testing/test-data.d.ts.map +1 -1
- package/dist/types/src/testing/test-schema.d.ts +4 -4
- package/package.json +20 -18
- package/src/ai-service/client.test.ts +28 -28
- package/src/ai-service/client.ts +31 -177
- package/src/ai-service/defs.ts +98 -0
- package/src/ai-service/index.ts +3 -1
- package/src/ai-service/parser.ts +183 -0
- package/src/ai-service/stream.test.ts +106 -0
- package/src/ai-service/stream.test.txt +33 -0
- package/src/ai-service/stream.ts +182 -0
- package/src/ai-service/util/index.ts +5 -0
- package/src/ai-service/{sse.ts → util/sse.ts} +5 -0
- package/src/bin/chat.ts +8 -10
- package/src/conversation/conversation.test.ts +13 -17
- package/src/conversation/conversation.ts +113 -18
- package/src/conversation/index.ts +0 -1
- package/src/conversation/types.ts +55 -16
- package/src/cypher/combinators.test.ts +4 -4
- package/src/cypher/combinators.ts +0 -1
- package/src/cypher/execution-plan.test.ts +5 -3
- package/src/cypher/parjs-shims.d.ts +4 -0
- package/src/cypher/parjs.ts +2 -2
- package/src/cypher/query-executor.test.ts +1 -1
- package/src/cypher/schema.ts +0 -1
- package/src/index.ts +1 -1
- package/src/testing/artifacts.test.ts +182 -0
- package/src/testing/data.ts +13 -0
- package/src/testing/defs.ts +8 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/logger.ts +3 -2
- package/src/testing/query-promts.ts +3 -3
- package/src/testing/query.test.ts +11 -10
- package/src/testing/test-data.ts +1 -1
- package/vendor/parjs-browser.mjs +4 -0
- package/vendor/parjs-default.mjs +8 -0
- package/dist/lib/browser/chunk-AKP45LQH.mjs +0 -1394
- package/dist/lib/browser/chunk-AKP45LQH.mjs.map +0 -7
- package/dist/lib/node/chunk-G6CGWEMO.cjs +0 -1418
- package/dist/lib/node/chunk-G6CGWEMO.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-WUPUPEFB.mjs +0 -1396
- package/dist/lib/node-esm/chunk-WUPUPEFB.mjs.map +0 -7
- package/dist/types/src/ai-service/schema.d.ts +0 -296
- package/dist/types/src/ai-service/schema.d.ts.map +0 -1
- package/dist/types/src/ai-service/sse.d.ts.map +0 -1
- package/dist/types/src/sanity.test.d.ts +0 -2
- package/dist/types/src/sanity.test.d.ts.map +0 -1
- package/src/ai-service/schema.ts +0 -260
- package/src/sanity.test.ts +0 -9
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Schema as S } from '@effect/schema';
|
|
2
|
+
import { Message, type MessageContentBlock } from '@dxos/artifact';
|
|
3
|
+
import { ObjectId } from '@dxos/echo-schema';
|
|
4
|
+
export declare const createArtifactElement: (id: ObjectId) => string;
|
|
5
|
+
export declare const LLMModel: S.Literal<["@anthropic/claude-3-5-haiku-20241022", "@anthropic/claude-3-5-sonnet-20241022", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@hf/nousresearch/hermes-2-pro-mistral-7b", "@ollama/llama-3-2-3b", "@ollama/llama-3-1-nemotron-70b-instruct", "@ollama/llama-3-1-nemotron-mini-4b-instruct", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"]>;
|
|
6
|
+
export type LLMModel = S.Schema.Type<typeof LLMModel>;
|
|
7
|
+
export declare const ToolTypes: Readonly<{
|
|
8
|
+
TextToImage: "text_to_image";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare const GenerateRequest: S.Struct<{
|
|
14
|
+
spaceId: S.optional<S.Schema<import("packages/common/keys/dist/types/src").SpaceId, string, never>>;
|
|
15
|
+
threadId: S.optional<import("@dxos/echo-schema").ObjectIdClass>;
|
|
16
|
+
model: S.Literal<["@anthropic/claude-3-5-haiku-20241022", "@anthropic/claude-3-5-sonnet-20241022", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@hf/nousresearch/hermes-2-pro-mistral-7b", "@ollama/llama-3-2-3b", "@ollama/llama-3-1-nemotron-70b-instruct", "@ollama/llama-3-1-nemotron-mini-4b-instruct", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"]>;
|
|
17
|
+
/**
|
|
18
|
+
* History of messages to include in the context window.
|
|
19
|
+
*/
|
|
20
|
+
history: S.optional<S.Array$<S.Schema<{
|
|
21
|
+
readonly id: string;
|
|
22
|
+
spaceId?: import("packages/common/keys/dist/types/src").SpaceId | undefined;
|
|
23
|
+
content: ({
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
disposition?: string | undefined;
|
|
27
|
+
} | {
|
|
28
|
+
type: "json";
|
|
29
|
+
disposition?: string | undefined;
|
|
30
|
+
json: string;
|
|
31
|
+
} | {
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
type: "image";
|
|
34
|
+
source?: {
|
|
35
|
+
type: "base64";
|
|
36
|
+
mediaType: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
|
|
37
|
+
data: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
id: string;
|
|
41
|
+
type: "tool_use";
|
|
42
|
+
name: string;
|
|
43
|
+
input: unknown;
|
|
44
|
+
inputJson?: string | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: "tool_result";
|
|
47
|
+
readonly toolUseId: string;
|
|
48
|
+
readonly content: string;
|
|
49
|
+
readonly isError?: boolean | undefined;
|
|
50
|
+
})[];
|
|
51
|
+
threadId?: string | undefined;
|
|
52
|
+
foreignId?: string | undefined;
|
|
53
|
+
role: "user" | "assistant";
|
|
54
|
+
}, {
|
|
55
|
+
readonly id: string;
|
|
56
|
+
spaceId?: import("packages/common/keys/dist/types/src").SpaceId | undefined;
|
|
57
|
+
content: ({
|
|
58
|
+
type: "text";
|
|
59
|
+
text: string;
|
|
60
|
+
disposition?: string | undefined;
|
|
61
|
+
} | {
|
|
62
|
+
type: "json";
|
|
63
|
+
disposition?: string | undefined;
|
|
64
|
+
json: string;
|
|
65
|
+
} | {
|
|
66
|
+
id?: string | undefined;
|
|
67
|
+
type: "image";
|
|
68
|
+
source?: {
|
|
69
|
+
type: "base64";
|
|
70
|
+
mediaType: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
|
|
71
|
+
data: string;
|
|
72
|
+
} | undefined;
|
|
73
|
+
} | {
|
|
74
|
+
id: string;
|
|
75
|
+
type: "tool_use";
|
|
76
|
+
name: string;
|
|
77
|
+
input: unknown;
|
|
78
|
+
inputJson?: string | undefined;
|
|
79
|
+
} | {
|
|
80
|
+
readonly type: "tool_result";
|
|
81
|
+
readonly toolUseId: string;
|
|
82
|
+
readonly content: string;
|
|
83
|
+
readonly isError?: boolean | undefined;
|
|
84
|
+
})[];
|
|
85
|
+
threadId?: string | undefined;
|
|
86
|
+
foreignId?: string | undefined;
|
|
87
|
+
role: "user" | "assistant";
|
|
88
|
+
}, never>>>;
|
|
89
|
+
/**
|
|
90
|
+
* System instructions to the LLM.
|
|
91
|
+
*/
|
|
92
|
+
systemPrompt: S.optional<typeof S.String>;
|
|
93
|
+
/**
|
|
94
|
+
* Tools available for the LLM.
|
|
95
|
+
*/
|
|
96
|
+
tools: S.optional<S.mutable<S.Array$<S.Struct<{
|
|
97
|
+
name: typeof S.String;
|
|
98
|
+
type: S.optional<typeof S.String>;
|
|
99
|
+
description: S.optional<typeof S.String>;
|
|
100
|
+
parameters: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
101
|
+
options: S.optional<typeof S.Any>;
|
|
102
|
+
}>>>>;
|
|
103
|
+
}>;
|
|
104
|
+
export type GenerateRequest = S.Schema.Type<typeof GenerateRequest>;
|
|
105
|
+
export type LLMStopReason = 'tool_use' | 'end_turn';
|
|
106
|
+
export type ResultStreamEvent = {
|
|
107
|
+
type: 'message_start';
|
|
108
|
+
message: Omit<Message, 'spaceId' | 'threadId'>;
|
|
109
|
+
} | {
|
|
110
|
+
type: 'message_delta';
|
|
111
|
+
delta: {
|
|
112
|
+
stopReason: LLMStopReason;
|
|
113
|
+
};
|
|
114
|
+
} | {
|
|
115
|
+
type: 'message_stop';
|
|
116
|
+
} | {
|
|
117
|
+
type: 'content_block_start';
|
|
118
|
+
index: number;
|
|
119
|
+
content: MessageContentBlock;
|
|
120
|
+
} | {
|
|
121
|
+
type: 'content_block_delta';
|
|
122
|
+
index: number;
|
|
123
|
+
delta: {
|
|
124
|
+
type: 'text_delta';
|
|
125
|
+
text: string;
|
|
126
|
+
} | {
|
|
127
|
+
partial_json: string;
|
|
128
|
+
type: 'input_json_delta';
|
|
129
|
+
};
|
|
130
|
+
} | {
|
|
131
|
+
type: 'content_block_stop';
|
|
132
|
+
index: number;
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAQ,OAAO,EAAE,KAAK,mBAAmB,EAAiB,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,eAAO,MAAM,qBAAqB,OAAQ,QAAQ,WAA4B,CAAC;AAE/E,eAAO,MAAM,QAAQ,4VASpB,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEtD,eAAO,MAAM,SAAS;;EAIpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;IAK1B;;OAEG;;;;;;;uBA2D+1D,CAAC;;;uBAAyE,CAAC;;;cAAgE,CAAC;;kBAA2D,CAAC;;;;;;;;;;qBAAwR,CAAC;;;;;4BAAoK,CAAC;;;;;;;;;;;uBAAwR,CAAC;;;uBAAyE,CAAC;;;cAAgE,CAAC;;kBAA2D,CAAC;;;;;;;;;;qBAAwR,CAAC;;;;;4BAAoK,CAAC;;;;;;IAxDt4G;;OAEG;;IAIH;;OAEG;;qBAUL,EAAG,MAAM;cAgBG,EAAG,QAAQ,QAAO,EAAG,MAC7B;qBAIU,EAAG,QAAQ,QAAO,EAC1B,MAAA;oBAOU,EAAG,QAAQ,CAAC,EAAE,MAE7B;iBAOY,EAAG,QAAQ,QAAO,EAAG,GAAG;;EA9CnC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAIpD,MAAM,MAAM,iBAAiB,GACzB;IAEE,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CAChD,GACD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE;QACL,UAAU,EAAE,aAAa,CAAC;KAC3B,CAAC;CACH,GACD;IACE,IAAI,EAAE,cAAc,CAAC;CACtB,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,mBAAmB,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EACD;QACE,IAAI,EAAE,YAAY,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,YAAY,EAAE,MAAM,CAAC;QAErB,IAAI,EAAE,kBAAkB,CAAC;KAC1B,CAAC;CACP,GACD;IACE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type Block = TextBlock | TagBlock | CodeBlock;
|
|
2
|
+
export type TextBlock = {
|
|
3
|
+
type: 'text';
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
export type TagBlock = {
|
|
7
|
+
type: 'tag';
|
|
8
|
+
name: string;
|
|
9
|
+
content: string;
|
|
10
|
+
attributes: Record<string, string>;
|
|
11
|
+
selfClosing: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type CodeBlock = {
|
|
14
|
+
type: 'code';
|
|
15
|
+
language: string;
|
|
16
|
+
content: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Permissive streaming parser for XML content and plain text.
|
|
20
|
+
*/
|
|
21
|
+
export declare class StreamingParser {
|
|
22
|
+
private readonly onBlock;
|
|
23
|
+
private buffer;
|
|
24
|
+
constructor(onBlock: (block: Block) => void);
|
|
25
|
+
/**
|
|
26
|
+
* Write a chunk of text to the parser.
|
|
27
|
+
*/
|
|
28
|
+
write(chunk: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Signal that no more input will be written.
|
|
31
|
+
*/
|
|
32
|
+
end(): void;
|
|
33
|
+
private processBuffer;
|
|
34
|
+
private tryParseCodeBlock;
|
|
35
|
+
private parseAttributes;
|
|
36
|
+
private emitTextBlock;
|
|
37
|
+
private emitTagBlock;
|
|
38
|
+
private emitCodeBlock;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/parser.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,qBAAa,eAAe;IAGd,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,MAAM,CAAM;gBAES,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAE5D;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM;IAKnB;;OAEG;IACH,GAAG;IAOH,OAAO,CAAC,aAAa;IAsDrB,OAAO,CAAC,iBAAiB;IAiCzB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,aAAa;CAOtB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Message } from '@dxos/artifact';
|
|
2
|
+
import { type ObjectId } from '@dxos/echo-schema';
|
|
3
|
+
import { type SpaceId } from '@dxos/keys';
|
|
4
|
+
import { type ResultStreamEvent } from './defs';
|
|
5
|
+
export type GenerationParams = {
|
|
6
|
+
spaceId?: SpaceId;
|
|
7
|
+
threadId?: ObjectId;
|
|
8
|
+
};
|
|
9
|
+
export declare class GenerationStream implements AsyncIterable<ResultStreamEvent> {
|
|
10
|
+
private readonly _controller;
|
|
11
|
+
private readonly _getIterator;
|
|
12
|
+
private readonly _params;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a stream from an SSE response.
|
|
15
|
+
*/
|
|
16
|
+
static fromSSEResponse(params: GenerationParams, response: Response, controller?: AbortController): GenerationStream;
|
|
17
|
+
private readonly _done;
|
|
18
|
+
private _previousMessages;
|
|
19
|
+
private _accumulatedMessage?;
|
|
20
|
+
private _iterator?;
|
|
21
|
+
constructor(_controller: AbortController, _getIterator: () => AsyncIterableIterator<ResultStreamEvent>, _params: GenerationParams);
|
|
22
|
+
[Symbol.asyncIterator](): AsyncIterator<ResultStreamEvent>;
|
|
23
|
+
get accumulatedMessages(): Message[];
|
|
24
|
+
/**
|
|
25
|
+
* Aborts the stream.
|
|
26
|
+
*/
|
|
27
|
+
abort(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the complete message list generated by the AI service.
|
|
30
|
+
*/
|
|
31
|
+
complete(): Promise<Message[]>;
|
|
32
|
+
private _createIterator;
|
|
33
|
+
private _processEvent;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/stream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,qBAAa,gBAAiB,YAAW,aAAa,CAAC,iBAAiB,CAAC;IAmDrE,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IApD1B;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,kBAAwB;IAyCvG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,mBAAmB,CAAC,CAAsB;IAClD,OAAO,CAAC,SAAS,CAAC,CAA+C;gBAG9C,WAAW,EAAE,eAAe,EAC5B,YAAY,EAAE,MAAM,qBAAqB,CAAC,iBAAiB,CAAC,EAC5D,OAAO,EAAE,gBAAgB;IAG5C,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,iBAAiB,CAAC;IAI1D,IAAI,mBAAmB,IAAI,OAAO,EAAE,CAGnC;IAED;;OAEG;IACH,KAAK;IAIL;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAKpC,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,aAAa;CAgEtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.test.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/stream.test.ts"],"names":[],"mappings":"AA8DA,eAAO,MAAM,gBAAgB,WAAY,MAAM,EAAE,KAAG,cA2CnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server sent events (SSE) iterator.
|
|
3
|
+
* @param response
|
|
4
|
+
* @param controller
|
|
5
|
+
*/
|
|
1
6
|
export declare function iterSSEMessages(response: Response, controller: AbortController): AsyncGenerator<ServerSentEvent, void, unknown>;
|
|
2
7
|
export type ServerSentEvent = {
|
|
3
8
|
event: string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/util/sse.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAuB,eAAe,CACpC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,eAAe,GAC1B,cAAc,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,CAyBhD;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AA8HF,uEAAuE;AACvE,eAAO,MAAM,aAAa,WAAY,MAAM,EAAE,KAAG,MAAM,EAQtD,CAAC;AAWF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,qBAAqB,CAAC,CAAC,CAAC,CA6BpF;AAED,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAElF;;;;;GAKG;AACH,qBAAa,WAAW;IAEtB,MAAM,CAAC,aAAa,cAAyB;IAC7C,MAAM,CAAC,cAAc,SAAkB;IAEvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC;;IAOjB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE;IA0C9B,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;IAuChC,KAAK,IAAI,MAAM,EAAE;CAUlB"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { type Tool, Message } from '@dxos/artifact';
|
|
2
|
+
import { ObjectId } from '@dxos/echo-schema';
|
|
1
3
|
import { type SpaceId } from '@dxos/keys';
|
|
2
|
-
import {
|
|
3
|
-
import { type AIServiceClient, type Message, type ResultStreamEvent, type LLMModel } from '../ai-service';
|
|
4
|
+
import { type AIServiceClient, type ResultStreamEvent, type LLMModel } from '../ai-service';
|
|
4
5
|
export type CreateLLMConversationParams = {
|
|
5
6
|
model: LLMModel;
|
|
6
7
|
/**
|
|
7
8
|
* System prompt that specifies instructions for the LLM.
|
|
8
9
|
*/
|
|
9
10
|
system?: string;
|
|
10
|
-
spaceId
|
|
11
|
-
threadId
|
|
12
|
-
tools:
|
|
11
|
+
spaceId?: SpaceId;
|
|
12
|
+
threadId?: ObjectId;
|
|
13
|
+
tools: Tool[];
|
|
14
|
+
history?: Message[];
|
|
13
15
|
client: AIServiceClient;
|
|
14
16
|
logger?: (event: ConversationEvent) => void;
|
|
15
17
|
};
|
|
@@ -19,5 +21,54 @@ export type ConversationEvent = {
|
|
|
19
21
|
} | ResultStreamEvent;
|
|
20
22
|
export declare const runLLM: (params: CreateLLMConversationParams) => Promise<{
|
|
21
23
|
result: any;
|
|
24
|
+
history: {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
spaceId?: SpaceId | undefined;
|
|
27
|
+
content: ({
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
disposition?: string | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
type: "json";
|
|
33
|
+
disposition?: string | undefined;
|
|
34
|
+
json: string;
|
|
35
|
+
} | {
|
|
36
|
+
id?: string | undefined;
|
|
37
|
+
type: "image";
|
|
38
|
+
source?: {
|
|
39
|
+
type: "base64";
|
|
40
|
+
mediaType: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
|
|
41
|
+
data: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
} | {
|
|
44
|
+
id: string;
|
|
45
|
+
type: "tool_use";
|
|
46
|
+
name: string;
|
|
47
|
+
input: unknown;
|
|
48
|
+
inputJson?: string | undefined;
|
|
49
|
+
} | {
|
|
50
|
+
readonly type: "tool_result";
|
|
51
|
+
readonly toolUseId: string;
|
|
52
|
+
readonly content: string;
|
|
53
|
+
readonly isError?: boolean | undefined;
|
|
54
|
+
})[];
|
|
55
|
+
threadId?: string | undefined;
|
|
56
|
+
foreignId?: string | undefined;
|
|
57
|
+
role: "user" | "assistant";
|
|
58
|
+
}[];
|
|
22
59
|
}>;
|
|
60
|
+
export declare const isToolUse: (message: Message) => boolean;
|
|
61
|
+
export type RunToolsOptions = {
|
|
62
|
+
message: Message;
|
|
63
|
+
tools: Tool[];
|
|
64
|
+
extensions?: ToolContextExtensions;
|
|
65
|
+
};
|
|
66
|
+
export type RunToolsResult = {
|
|
67
|
+
type: 'continue';
|
|
68
|
+
message: Message;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'break';
|
|
71
|
+
result: unknown;
|
|
72
|
+
};
|
|
73
|
+
export declare const runTools: ({ message, tools, extensions }: RunToolsOptions) => Promise<RunToolsResult>;
|
|
23
74
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAc,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAgB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE5F,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE,QAAQ,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IAExB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GACD,iBAAiB,CAAC;AAEtB,eAAO,MAAM,MAAM,WAAkB,2BAA2B;;;;;;;;uBAwH9C,CAAC;;;uBAIqB,CAAC;;;cAAgE,CAAC;;kBACnD,CAAC;;;;;;;;;;qBAUpD,CAAA;;;;;4BAIO,CAAC;;;;;;EAnCX,CAAC;AAEF,eAAO,MAAM,SAAS,YAAa,OAAO,YAAgD,CAAC;AAE3F,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEN,eAAO,MAAM,QAAQ,mCAA0C,eAAe,KAAG,OAAO,CAAC,cAAc,CAmEtG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/conversation/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/conversation/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,24 +1,55 @@
|
|
|
1
1
|
import { Schema as S } from '@effect/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { type Message, type MessageContentBlock } from '@dxos/artifact';
|
|
3
|
+
import { JsonSchemaType, ObjectId } from '@dxos/echo-schema';
|
|
3
4
|
import type { SpaceId } from '@dxos/keys';
|
|
4
|
-
import { ObjectId, type Message } from '../ai-service';
|
|
5
5
|
export declare const createUserMessage: (spaceId: SpaceId, threadId: ObjectId, text: string) => Message;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use {@link LLMTool} instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ToolDefinition: S.Struct<{
|
|
7
10
|
name: typeof S.String;
|
|
8
11
|
description: typeof S.String;
|
|
9
12
|
parameters: S.Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
10
13
|
execute: typeof S.Any;
|
|
11
14
|
}>;
|
|
12
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use {@link LLMTool} instead.
|
|
17
|
+
*/
|
|
18
|
+
export type ToolDefinition = {
|
|
13
19
|
name: string;
|
|
14
20
|
description: string;
|
|
15
21
|
parameters: JsonSchemaType;
|
|
16
|
-
execute: (params: unknown, context: ToolExecutionContext) => Promise<
|
|
22
|
+
execute: (params: unknown, context: ToolExecutionContext) => Promise<ToolResult>;
|
|
17
23
|
};
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
declare global {
|
|
25
|
+
/**
|
|
26
|
+
* Extensions to the tool execution context.
|
|
27
|
+
*
|
|
28
|
+
* Different modules can extend this definition to add their own properties.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* declare global {
|
|
33
|
+
* interface ToolContextExtensions {
|
|
34
|
+
* chess: {
|
|
35
|
+
* board: string;
|
|
36
|
+
* };
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#global-augmentation
|
|
42
|
+
*/
|
|
43
|
+
interface ToolContextExtensions {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export type ToolExecutionContext = {
|
|
47
|
+
extensions: ToolContextExtensions;
|
|
48
|
+
};
|
|
49
|
+
export type ToolResult = {
|
|
20
50
|
kind: 'success';
|
|
21
51
|
result: unknown;
|
|
52
|
+
extractContentBlocks?: MessageContentBlock[];
|
|
22
53
|
} | {
|
|
23
54
|
kind: 'error';
|
|
24
55
|
message: string;
|
|
@@ -26,23 +57,23 @@ export type LLMToolResult = {
|
|
|
26
57
|
kind: 'break';
|
|
27
58
|
result: unknown;
|
|
28
59
|
};
|
|
29
|
-
export declare const
|
|
60
|
+
export declare const ToolResult: Readonly<{
|
|
30
61
|
/**
|
|
31
62
|
* The tool execution was successful.
|
|
32
63
|
* Gives the result back to the LLM.
|
|
33
64
|
*/
|
|
34
|
-
Success: (result: unknown) =>
|
|
35
|
-
Error: (message: string) =>
|
|
65
|
+
Success: (result: unknown, extractContentBlocks?: MessageContentBlock[]) => ToolResult;
|
|
66
|
+
Error: (message: string) => ToolResult;
|
|
36
67
|
/**
|
|
37
68
|
* Stop the conversation and return the result.
|
|
38
69
|
*/
|
|
39
|
-
Break: (result: unknown) =>
|
|
70
|
+
Break: (result: unknown) => ToolResult;
|
|
40
71
|
}>;
|
|
41
72
|
export type DefineToolParams<Params extends S.Schema.AnyNoContext> = {
|
|
42
73
|
name: string;
|
|
43
74
|
description: string;
|
|
44
75
|
schema: Params;
|
|
45
|
-
execute: (params: S.Schema.Type<Params>, context: ToolExecutionContext) => Promise<
|
|
76
|
+
execute: (params: S.Schema.Type<Params>, context: ToolExecutionContext) => Promise<ToolResult>;
|
|
46
77
|
};
|
|
47
|
-
export declare const defineTool: <Params extends S.Schema.AnyNoContext>({ name, description, schema, execute, }: DefineToolParams<Params>) =>
|
|
78
|
+
export declare const defineTool: <Params extends S.Schema.AnyNoContext>({ name, description, schema, execute, }: DefineToolParams<Params>) => ToolDefinition;
|
|
48
79
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/conversation/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/conversation/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAgB,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,iBAAiB,YAAa,OAAO,YAAY,QAAQ,QAAQ,MAAM,KAAG,OAMrF,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAClF,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,qBAAqB;KAAG;CACnC;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,qBAAqB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAA;CAAE,GAClF;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvC,eAAO,MAAM,UAAU;IACrB;;;OAGG;sBACe,OAAO,yBAAyB,mBAAmB,EAAE,KAAG,UAAU;qBAMnE,MAAM,KAAG,UAAU;IACpC;;OAEG;oBACa,OAAO,KAAG,UAAU;EACpC,CAAC;AAEH,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,YAAY,IAAI;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAChG,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,YAAY,2CAK5D,gBAAgB,CAAC,MAAM,CAAC,KAAG,cAU7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combinators.d.ts","sourceRoot":"","sources":["../../../../src/cypher/combinators.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EAEX,YAAY,EAEZ,UAAU,EACV,WAAW,EAEX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,YAAY,EAEZ,WAAW,EACZ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"combinators.d.ts","sourceRoot":"","sources":["../../../../src/cypher/combinators.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EAEX,YAAY,EAEZ,UAAU,EACV,WAAW,EAEX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,YAAY,EAEZ,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAA2B,MAAM,SAAS,CAAC;AAgB3D,eAAO,MAAM,UAAU,qBAEtB,CAAC;AAUF,eAAO,MAAM,KAAK,qBAAwD,CAAC;AAC3E,eAAO,MAAM,QAAQ,mBAGpB,CAAC;AACF,eAAO,MAAM,UAAU,qBAItB,CAAC;AACF,eAAO,MAAM,WAAW,sBAQvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,8BAa/B,CAAC;AAOF,eAAO,MAAM,YAAY,uBAIxB,CAAC;AAEF,eAAO,MAAM,WAAW,sBAIvB,CAAC;AAYF,eAAO,MAAM,WAAW,sBAOvB,CAAC;AAEF,eAAO,MAAM,YAAY,uBAaxB,CAAC;AAEF,eAAO,MAAM,WAAW,sBAUvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parjs.d.ts","sourceRoot":"","sources":["../../../../src/cypher/parjs.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"parjs.d.ts","sourceRoot":"","sources":["../../../../src/cypher/parjs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,KAAK,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/cypher/schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/cypher/schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIjF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gBAAiB,cAAc,EAAE,KAAG,MAAM,EAK5E,CAAC;AAkDF,eAAO,MAAM,eAAe,aAAc,MAAM,WAE/C,CAAC;AAEF,eAAO,MAAM,+BAA+B,aAAc,MAAM,YAAY,MAAM,WAGjF,CAAC;AAEF,eAAO,MAAM,WAAW,WAAY,cAAc,YACoE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=artifacts.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.test.d.ts","sourceRoot":"","sources":["../../../../src/testing/artifacts.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/testing/data.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,UAQzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../src/testing/defs.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/testing/logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/testing/logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,gBAAgB,CAAC;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,eAAO,MAAM,YAAY,kCAItB;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;CACpF,aAIgB,iBAAiB,SA4GjC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from '@effect/schema';
|
|
2
2
|
import { type DataSource } from '../cypher';
|
|
3
|
-
export declare const createCypherTool: (dataSource: DataSource, schemaTypes?: S.Schema.Any[]) => import("
|
|
3
|
+
export declare const createCypherTool: (dataSource: DataSource, schemaTypes?: S.Schema.Any[]) => import("@dxos/artifact").Tool;
|
|
4
4
|
export declare const createSystemPrompt: (schemaTypes: S.Schema.Any[]) => string;
|
|
5
5
|
//# sourceMappingURL=query-promts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-promts.d.ts","sourceRoot":"","sources":["../../../../src/testing/query-promts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGlF,eAAO,MAAM,gBAAgB,eAAgB,UAAU,gBAAe,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"query-promts.d.ts","sourceRoot":"","sources":["../../../../src/testing/query-promts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGlF,eAAO,MAAM,gBAAgB,eAAgB,UAAU,gBAAe,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,kCA0ChF,CAAC;AAEL,eAAO,MAAM,kBAAkB,gBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,WAiB7D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Schema as S } from '@effect/schema';
|
|
2
|
+
import type { EchoDatabase } from '@dxos/echo-db';
|
|
2
3
|
import { type JsonSchemaType } from '@dxos/echo-schema';
|
|
3
4
|
import { type DataSource, type Node, type Relationship } from '../cypher';
|
|
4
|
-
import type { EchoDatabase } from '@dxos/echo-db';
|
|
5
5
|
export declare const seedTestData: (db: EchoDatabase) => void;
|
|
6
6
|
export declare const createTestData: () => MockDataSource;
|
|
7
7
|
export declare class MockDataSource implements DataSource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-data.d.ts","sourceRoot":"","sources":["../../../../src/testing/test-data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAmD,KAAK,cAAc,EAAY,MAAM,mBAAmB,CAAC;AAInH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,YAAY,EAGlB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"test-data.d.ts","sourceRoot":"","sources":["../../../../src/testing/test-data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAmD,KAAK,cAAc,EAAY,MAAM,mBAAmB,CAAC;AAInH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,YAAY,EAGlB,MAAM,WAAW,CAAC;AAGnB,eAAO,MAAM,YAAY,OAAQ,YAAY,SAoH5C,CAAC;AAGF,eAAO,MAAM,cAAc,QAAO,cAuGjC,CAAC;AAEF,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,EAAE,MAAM,CACb,MAAM,EACN;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,OAAO,CAAC;KACf,CACF,CAAM;IAEP,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE,IAAI,EAAE,cAAc,CAAC;QACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;KACxB,CACF,CAAM;IAEP,KAAK,EAAE,IAAI,EAAE,CAAM;IACnB,aAAa,EAAE,YAAY,EAAE,CAAM;IAE7B,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAItC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAIpD,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAsB7D,YAAY;CAoEb"}
|
|
@@ -19,13 +19,13 @@ export declare const Task: S.mutable<S.Struct<{
|
|
|
19
19
|
name: S.SchemaClass<string, string, never>;
|
|
20
20
|
description: S.optional<typeof S.String>;
|
|
21
21
|
project: import("@dxos/echo-schema").Ref$<{
|
|
22
|
-
id: string;
|
|
23
22
|
name: string;
|
|
24
23
|
description?: string | undefined;
|
|
24
|
+
id: string;
|
|
25
25
|
}>;
|
|
26
26
|
assignee: import("@dxos/echo-schema").Ref$<{
|
|
27
|
-
id: string;
|
|
28
27
|
name: string;
|
|
28
|
+
id: string;
|
|
29
29
|
email?: string | undefined;
|
|
30
30
|
}>;
|
|
31
31
|
}>>;
|
|
@@ -35,13 +35,13 @@ export declare const Org: S.mutable<S.Struct<{
|
|
|
35
35
|
id: S.SchemaClass<string, string, never>;
|
|
36
36
|
name: S.SchemaClass<string, string, never>;
|
|
37
37
|
projects: S.Array$<import("@dxos/echo-schema").Ref$<{
|
|
38
|
-
id: string;
|
|
39
38
|
name: string;
|
|
40
39
|
description?: string | undefined;
|
|
40
|
+
id: string;
|
|
41
41
|
}>>;
|
|
42
42
|
employees: S.Array$<import("@dxos/echo-schema").Ref$<{
|
|
43
|
-
id: string;
|
|
44
43
|
name: string;
|
|
44
|
+
id: string;
|
|
45
45
|
email?: string | undefined;
|
|
46
46
|
}>>;
|
|
47
47
|
}>>;
|