@convex-dev/agent 0.0.15-alpha.1 → 0.0.16
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/README.md +24 -0
- package/dist/commonjs/client/index.d.ts +225 -53
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +75 -31
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/component/messages.d.ts +5 -6
- package/dist/commonjs/component/messages.d.ts.map +1 -1
- package/dist/commonjs/component/messages.js +1 -6
- package/dist/commonjs/component/messages.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +10 -10
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +1 -2
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/esm/client/index.d.ts +225 -53
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +75 -31
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/component/messages.d.ts +5 -6
- package/dist/esm/component/messages.d.ts.map +1 -1
- package/dist/esm/component/messages.js +1 -6
- package/dist/esm/component/messages.js.map +1 -1
- package/dist/esm/component/schema.d.ts +10 -10
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +1 -2
- package/dist/esm/component/schema.js.map +1 -1
- package/package.json +3 -2
- package/src/client/index.test.ts +68 -0
- package/src/client/index.ts +141 -86
- package/src/component/_generated/api.d.ts +0 -1
- package/src/component/messages.ts +1 -8
- package/src/component/schema.ts +1 -2
|
@@ -226,21 +226,21 @@ export declare const schema: import("convex/server").SchemaDefinition<{
|
|
|
226
226
|
}>;
|
|
227
227
|
threads: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
228
228
|
userId?: string | undefined;
|
|
229
|
-
defaultSystemPrompt?: string | undefined;
|
|
230
229
|
title?: string | undefined;
|
|
231
230
|
summary?: string | undefined;
|
|
231
|
+
defaultSystemPrompt?: string | undefined;
|
|
232
232
|
parentThreadIds?: import("convex/values").GenericId<"threads">[] | undefined;
|
|
233
233
|
order?: number | undefined;
|
|
234
234
|
status: "active" | "archived";
|
|
235
235
|
}, {
|
|
236
236
|
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
237
|
-
defaultSystemPrompt: import("convex/values").VString<string | undefined, "optional">;
|
|
238
237
|
title: import("convex/values").VString<string | undefined, "optional">;
|
|
239
238
|
summary: import("convex/values").VString<string | undefined, "optional">;
|
|
240
239
|
status: import("convex/values").VUnion<"active" | "archived", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"archived", "required">], "required", never>;
|
|
240
|
+
defaultSystemPrompt: import("convex/values").VString<string | undefined, "optional">;
|
|
241
241
|
parentThreadIds: import("convex/values").VArray<import("convex/values").GenericId<"threads">[] | undefined, import("convex/values").VId<import("convex/values").GenericId<"threads">, "required">, "optional">;
|
|
242
242
|
order: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
243
|
-
}, "required", "status" | "userId" | "
|
|
243
|
+
}, "required", "status" | "userId" | "title" | "summary" | "defaultSystemPrompt" | "parentThreadIds" | "order">, {
|
|
244
244
|
userId: ["userId", "_creationTime"];
|
|
245
245
|
}, {}, {}>;
|
|
246
246
|
messages: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
@@ -2281,14 +2281,14 @@ export declare const vv: {
|
|
|
2281
2281
|
_id: import("convex/values").GenericId<"threads">;
|
|
2282
2282
|
_creationTime: number;
|
|
2283
2283
|
userId?: string | undefined;
|
|
2284
|
-
defaultSystemPrompt?: string | undefined;
|
|
2285
2284
|
title?: string | undefined;
|
|
2286
2285
|
summary?: string | undefined;
|
|
2286
|
+
defaultSystemPrompt?: string | undefined;
|
|
2287
2287
|
parentThreadIds?: import("convex/values").GenericId<"threads">[] | undefined;
|
|
2288
2288
|
order?: number | undefined;
|
|
2289
2289
|
status: "active" | "archived";
|
|
2290
2290
|
};
|
|
2291
|
-
fieldPaths: ("status" | "userId" | "
|
|
2291
|
+
fieldPaths: ("status" | "userId" | "title" | "summary" | "defaultSystemPrompt" | "parentThreadIds" | "order" | "_creationTime") | "_id";
|
|
2292
2292
|
indexes: {
|
|
2293
2293
|
userId: ["userId", "_creationTime"];
|
|
2294
2294
|
by_id: ["_id"];
|
|
@@ -2915,14 +2915,14 @@ export declare const vv: {
|
|
|
2915
2915
|
_id: import("convex/values").GenericId<"threads">;
|
|
2916
2916
|
_creationTime: number;
|
|
2917
2917
|
userId?: string | undefined;
|
|
2918
|
-
defaultSystemPrompt?: string | undefined;
|
|
2919
2918
|
title?: string | undefined;
|
|
2920
2919
|
summary?: string | undefined;
|
|
2920
|
+
defaultSystemPrompt?: string | undefined;
|
|
2921
2921
|
parentThreadIds?: import("convex/values").GenericId<"threads">[] | undefined;
|
|
2922
2922
|
order?: number | undefined;
|
|
2923
2923
|
status: "active" | "archived";
|
|
2924
2924
|
};
|
|
2925
|
-
fieldPaths: ("status" | "userId" | "
|
|
2925
|
+
fieldPaths: ("status" | "userId" | "title" | "summary" | "defaultSystemPrompt" | "parentThreadIds" | "order" | "_creationTime") | "_id";
|
|
2926
2926
|
indexes: {
|
|
2927
2927
|
userId: ["userId", "_creationTime"];
|
|
2928
2928
|
by_id: ["_id"];
|
|
@@ -3770,21 +3770,21 @@ export declare const vv: {
|
|
|
3770
3770
|
}>;
|
|
3771
3771
|
threads: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3772
3772
|
userId?: string | undefined;
|
|
3773
|
-
defaultSystemPrompt?: string | undefined;
|
|
3774
3773
|
title?: string | undefined;
|
|
3775
3774
|
summary?: string | undefined;
|
|
3775
|
+
defaultSystemPrompt?: string | undefined;
|
|
3776
3776
|
parentThreadIds?: import("convex/values").GenericId<"threads">[] | undefined;
|
|
3777
3777
|
order?: number | undefined;
|
|
3778
3778
|
status: "active" | "archived";
|
|
3779
3779
|
}, {
|
|
3780
3780
|
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
3781
|
-
defaultSystemPrompt: import("convex/values").VString<string | undefined, "optional">;
|
|
3782
3781
|
title: import("convex/values").VString<string | undefined, "optional">;
|
|
3783
3782
|
summary: import("convex/values").VString<string | undefined, "optional">;
|
|
3784
3783
|
status: import("convex/values").VUnion<"active" | "archived", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"archived", "required">], "required", never>;
|
|
3784
|
+
defaultSystemPrompt: import("convex/values").VString<string | undefined, "optional">;
|
|
3785
3785
|
parentThreadIds: import("convex/values").VArray<import("convex/values").GenericId<"threads">[] | undefined, import("convex/values").VId<import("convex/values").GenericId<"threads">, "required">, "optional">;
|
|
3786
3786
|
order: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
3787
|
-
}, "required", "status" | "userId" | "
|
|
3787
|
+
}, "required", "status" | "userId" | "title" | "summary" | "defaultSystemPrompt" | "parentThreadIds" | "order">, {
|
|
3788
3788
|
userId: ["userId", "_creationTime"];
|
|
3789
3789
|
}, {}, {}>;
|
|
3790
3790
|
messages: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/schema.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gMAIg+K,eAAgB,qEAAqE,CAAC,mJAAkJ,aAAc,+MAA+M,eAAe;;mFAA0W,GAAG,gDAAwB,WAAW,2BAA0B,WAAY;;;CAJz1M,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;AAEnB,eAAe,MAAM,CAAC"}
|
|
@@ -6,12 +6,11 @@ import vectorTables, { vVectorId } from "./vector/tables.js";
|
|
|
6
6
|
export const schema = defineSchema({
|
|
7
7
|
threads: defineTable({
|
|
8
8
|
userId: v.optional(v.string()), // Unset for anonymous
|
|
9
|
-
// TODO: is this bubbling up in continue?
|
|
10
|
-
defaultSystemPrompt: v.optional(v.string()),
|
|
11
9
|
title: v.optional(v.string()),
|
|
12
10
|
summary: v.optional(v.string()),
|
|
13
11
|
status: vThreadStatus,
|
|
14
12
|
// DEPRECATED
|
|
13
|
+
defaultSystemPrompt: v.optional(v.string()),
|
|
15
14
|
parentThreadIds: v.optional(v.array(v.id("threads"))),
|
|
16
15
|
order: /*DEPRECATED*/ v.optional(v.number()),
|
|
17
16
|
}).index("userId", ["userId"]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,cAAc,EACd,KAAK,EACL,MAAM,EACN,OAAO,EACP,2BAA2B,EAC3B,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;IACjC,OAAO,EAAE,WAAW,CAAC;QACnB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,sBAAsB;QACtD,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,cAAc,EACd,KAAK,EACL,MAAM,EACN,OAAO,EACP,2BAA2B,EAC3B,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;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EAAE,CAAC;QAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;KACnC,CAAC;SACC,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC;SAC/B,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;SAC3B,KAAK,CAAC,aAAa,EAAE,CAAC,aAAa,CAAC,CAAC;IAExC,KAAK,EAAE,WAAW,CAAC;QACjB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB,CAAC;SACC,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;SACvB,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC;IAClC,GAAG,YAAY;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;AAEnB,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"email": "support@convex.dev",
|
|
8
8
|
"url": "https://github.com/get-convex/agent/issues"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.0.
|
|
10
|
+
"version": "0.0.16",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"convex",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"test": "vitest run --typecheck",
|
|
29
29
|
"test:watch": "vitest --typecheck",
|
|
30
30
|
"test:debug": "vitest --inspect-brk --no-file-parallelism",
|
|
31
|
-
"test:coverage": "vitest run --coverage --coverage.reporter=text"
|
|
31
|
+
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
32
|
+
"version": "pbcopy <<<$version; vim CHANGELOG.md && git add CHANGELOG.md"
|
|
32
33
|
},
|
|
33
34
|
"files": [
|
|
34
35
|
"dist",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { filterOutOrphanedToolMessages, MessageDoc } from ".";
|
|
3
|
+
|
|
4
|
+
describe("filterOutOrphanedToolMessages", () => {
|
|
5
|
+
const call1: MessageDoc = {
|
|
6
|
+
_id: "call1",
|
|
7
|
+
_creationTime: Date.now(),
|
|
8
|
+
order: 1,
|
|
9
|
+
stepOrder: 1,
|
|
10
|
+
tool: true,
|
|
11
|
+
message: {
|
|
12
|
+
role: "assistant",
|
|
13
|
+
content: [
|
|
14
|
+
{
|
|
15
|
+
type: "tool-call",
|
|
16
|
+
toolCallId: "1",
|
|
17
|
+
toolName: "tool1",
|
|
18
|
+
args: { test: "test" },
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
status: "success",
|
|
23
|
+
threadId: "1",
|
|
24
|
+
};
|
|
25
|
+
const response1: MessageDoc = {
|
|
26
|
+
_id: "response1",
|
|
27
|
+
_creationTime: Date.now(),
|
|
28
|
+
order: 1,
|
|
29
|
+
stepOrder: 1,
|
|
30
|
+
tool: true,
|
|
31
|
+
message: {
|
|
32
|
+
role: "tool",
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "tool-result",
|
|
36
|
+
toolCallId: "1",
|
|
37
|
+
toolName: "tool1",
|
|
38
|
+
result: { test: "test" },
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
status: "success",
|
|
43
|
+
threadId: "1",
|
|
44
|
+
};
|
|
45
|
+
const call2: MessageDoc = {
|
|
46
|
+
_id: "call2",
|
|
47
|
+
_creationTime: Date.now(),
|
|
48
|
+
order: 1,
|
|
49
|
+
stepOrder: 2,
|
|
50
|
+
tool: true,
|
|
51
|
+
message: {
|
|
52
|
+
role: "assistant",
|
|
53
|
+
content: [{ type: "text", text: "Hello" }],
|
|
54
|
+
},
|
|
55
|
+
status: "success",
|
|
56
|
+
threadId: "1",
|
|
57
|
+
};
|
|
58
|
+
test("should not filter out extra tool calls", () => {
|
|
59
|
+
expect(filterOutOrphanedToolMessages([call1, response1, call2])).toEqual([
|
|
60
|
+
call1,
|
|
61
|
+
response1,
|
|
62
|
+
call2,
|
|
63
|
+
]);
|
|
64
|
+
});
|
|
65
|
+
test("should filter out extra tool calls", () => {
|
|
66
|
+
expect(filterOutOrphanedToolMessages([response1, call2])).toEqual([call2]);
|
|
67
|
+
});
|
|
68
|
+
});
|