New:Socket for Asana Is Now Available.Learn more
Get Started

@opencode-ai/ai

Package Overview
Dependencies
Maintainers
2
Versions
1135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencode-ai/ai - npm Package Compare versions

Comparing version
0.0.0-dev-18726
to
0.0.0-dev-18727
+84
-4
dist/schema/messages.d.ts

@@ -84,3 +84,23 @@ import { Schema } from "effect";

}>]> & {
is: (value: unknown) => value is ToolResultValue;
is: <I>(input: I) => input is I & ({
readonly type: "json";
readonly value: unknown;
} | {
readonly type: "text";
readonly value: unknown;
} | {
readonly type: "error";
readonly value: unknown;
} | {
readonly type: "content";
readonly value: readonly ({
readonly type: "text";
readonly text: string;
} | {
readonly type: "file";
readonly uri: string;
readonly mime: string;
readonly name?: string | undefined;
})[];
});
make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;

@@ -146,3 +166,23 @@ };

}>]> & {
is: (value: unknown) => value is ToolResultValue;
is: <I>(input: I) => input is I & ({
readonly type: "json";
readonly value: unknown;
} | {
readonly type: "text";
readonly value: unknown;
} | {
readonly type: "error";
readonly value: unknown;
} | {
readonly type: "content";
readonly value: readonly ({
readonly type: "text";
readonly text: string;
} | {
readonly type: "file";
readonly uri: string;
readonly mime: string;
readonly name?: string | undefined;
})[];
});
make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;

@@ -219,3 +259,23 @@ };

}>]> & {
is: (value: unknown) => value is ToolResultValue;
is: <I>(input: I) => input is I & ({
readonly type: "json";
readonly value: unknown;
} | {
readonly type: "text";
readonly value: unknown;
} | {
readonly type: "error";
readonly value: unknown;
} | {
readonly type: "content";
readonly value: readonly ({
readonly type: "text";
readonly text: string;
} | {
readonly type: "file";
readonly uri: string;
readonly mime: string;
readonly name?: string | undefined;
})[];
});
make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;

@@ -293,3 +353,23 @@ };

}>]> & {
is: (value: unknown) => value is ToolResultValue;
is: <I>(input: I) => input is I & ({
readonly type: "json";
readonly value: unknown;
} | {
readonly type: "text";
readonly value: unknown;
} | {
readonly type: "error";
readonly value: unknown;
} | {
readonly type: "content";
readonly value: readonly ({
readonly type: "text";
readonly text: string;
} | {
readonly type: "file";
readonly uri: string;
readonly mime: string;
readonly name?: string | undefined;
})[];
});
make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;

@@ -296,0 +376,0 @@ };

+1
-4
import { Schema } from "effect";
import { Tool } from "@opencode-ai/schema/tool";
import { CacheHint, CachePolicy, GenerationOptions, HttpOptions, JsonSchema, LanguageModelSchema, ProviderOptions, } from "./options.js";
import { isRecord } from "../utils/record.js";
export const MessageRole = Schema.Literals(["system", "user", "assistant", "tool"]);

@@ -39,5 +38,2 @@ export const ProviderMetadata = Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown)).annotate({

}).annotate({ identifier: "LLM.Content.Media" });
const isToolResultValue = (value) => isRecord(value) &&
(value.type === "text" || value.type === "json" || value.type === "error" || value.type === "content") &&
"value" in value;
const toolResultValueSchema = Schema.Union([

@@ -61,2 +57,3 @@ Schema.Struct({

]).annotate({ identifier: "LLM.ToolResult" });
const isToolResultValue = Schema.is(toolResultValueSchema);
export const ToolResultValue = Object.assign(toolResultValueSchema, {

@@ -63,0 +60,0 @@ is: isToolResultValue,

{
"$schema": "https://json.schemastore.org/package.json",
"version": "0.0.0-dev-18726",
"version": "0.0.0-dev-18727",
"name": "@opencode-ai/ai",

@@ -33,3 +33,3 @@ "type": "module",

"@effect/platform-node": "4.0.0-rc.112",
"@opencode-ai/http-recorder": "0.0.0-dev-18726",
"@opencode-ai/http-recorder": "0.0.0-dev-18727",
"@tsconfig/bun": "1.0.9",

@@ -43,3 +43,3 @@ "@types/bun": "1.3.13",

"@smithy/util-utf8": "4.2.2",
"@opencode-ai/schema": "0.0.0-dev-18726",
"@opencode-ai/schema": "0.0.0-dev-18727",
"aws4fetch": "1.0.20",

@@ -46,0 +46,0 @@ "effect": "4.0.0-rc.112",

Sorry, the diff of this file is too big to display