@opencode-ai/ai 0.0.0-next-17030 → 0.0.0-next-17038
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/schema/messages.d.ts +22 -1
- package/dist/schema/messages.js +3 -2
- package/package.json +3 -3
|
@@ -33,6 +33,28 @@ export declare const MediaPart: Schema.Struct<{
|
|
|
33
33
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
34
34
|
}>;
|
|
35
35
|
export type MediaPart = Schema.Schema.Type<typeof MediaPart>;
|
|
36
|
+
declare const toolResultValueSchema: Schema.Union<readonly [Schema.Struct<{
|
|
37
|
+
readonly type: Schema.Literal<"json">;
|
|
38
|
+
readonly value: Schema.Unknown;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly type: Schema.Literal<"text">;
|
|
41
|
+
readonly value: Schema.Unknown;
|
|
42
|
+
}>, Schema.Struct<{
|
|
43
|
+
readonly type: Schema.Literal<"error">;
|
|
44
|
+
readonly value: Schema.Unknown;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly type: Schema.Literal<"content">;
|
|
47
|
+
readonly value: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
48
|
+
readonly type: Schema.Literal<"text">;
|
|
49
|
+
readonly text: Schema.String;
|
|
50
|
+
}>, Schema.Struct<{
|
|
51
|
+
readonly type: Schema.Literal<"file">;
|
|
52
|
+
readonly uri: Schema.String;
|
|
53
|
+
readonly mime: Schema.String;
|
|
54
|
+
readonly name: Schema.optional<Schema.String>;
|
|
55
|
+
}>]>>;
|
|
56
|
+
}>]>;
|
|
57
|
+
export type ToolResultValue = Schema.Schema.Type<typeof toolResultValueSchema>;
|
|
36
58
|
export declare const ToolResultValue: Schema.Union<readonly [Schema.Struct<{
|
|
37
59
|
readonly type: Schema.Literal<"json">;
|
|
38
60
|
readonly value: Schema.Unknown;
|
|
@@ -57,7 +79,6 @@ export declare const ToolResultValue: Schema.Union<readonly [Schema.Struct<{
|
|
|
57
79
|
is: (value: unknown) => value is ToolResultValue;
|
|
58
80
|
make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;
|
|
59
81
|
};
|
|
60
|
-
export type ToolResultValue = Schema.Schema.Type<typeof ToolResultValue>;
|
|
61
82
|
export interface ToolOutput {
|
|
62
83
|
readonly structured: unknown;
|
|
63
84
|
readonly content: ReadonlyArray<Tool.Content>;
|
package/dist/schema/messages.js
CHANGED
|
@@ -35,7 +35,7 @@ export const MediaPart = Schema.Struct({
|
|
|
35
35
|
const isToolResultValue = (value) => isRecord(value) &&
|
|
36
36
|
(value.type === "text" || value.type === "json" || value.type === "error" || value.type === "content") &&
|
|
37
37
|
"value" in value;
|
|
38
|
-
|
|
38
|
+
const toolResultValueSchema = Schema.Union([
|
|
39
39
|
Schema.Struct({
|
|
40
40
|
type: Schema.Literal("json"),
|
|
41
41
|
value: Schema.Unknown,
|
|
@@ -52,7 +52,8 @@ export const ToolResultValue = Object.assign(Schema.Union([
|
|
|
52
52
|
type: Schema.Literal("content"),
|
|
53
53
|
value: Schema.Array(Tool.Content),
|
|
54
54
|
}),
|
|
55
|
-
]).annotate({ identifier: "LLM.ToolResult" })
|
|
55
|
+
]).annotate({ identifier: "LLM.ToolResult" });
|
|
56
|
+
export const ToolResultValue = Object.assign(toolResultValueSchema, {
|
|
56
57
|
is: isToolResultValue,
|
|
57
58
|
make: (value, type = "json") => {
|
|
58
59
|
if (isToolResultValue(value))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-17038",
|
|
4
4
|
"name": "@opencode-ai/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
32
32
|
"@effect/platform-node": "4.0.0-beta.101",
|
|
33
|
-
"@opencode-ai/http-recorder": "0.0.0-next-
|
|
33
|
+
"@opencode-ai/http-recorder": "0.0.0-next-17038",
|
|
34
34
|
"@tsconfig/bun": "1.0.9",
|
|
35
35
|
"@types/bun": "1.3.13",
|
|
36
36
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@smithy/eventstream-codec": "4.2.14",
|
|
41
41
|
"@smithy/util-utf8": "4.2.2",
|
|
42
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
42
|
+
"@opencode-ai/schema": "0.0.0-next-17038",
|
|
43
43
|
"aws4fetch": "1.0.20",
|
|
44
44
|
"effect": "4.0.0-beta.101",
|
|
45
45
|
"google-auth-library": "10.5.0"
|