🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@opencode-ai/sdk

Package Overview
Dependencies
Maintainers
2
Versions
9664
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencode-ai/sdk - npm Package Compare versions

Comparing version
0.6.4
to
0.6.5
+20
-4
dist/gen/types.gen.d.ts

@@ -1001,5 +1001,24 @@ export type Project = {

path: string;
absolute: string;
type: "file" | "directory";
ignored: boolean;
};
export type FileContent = {
content: string;
diff?: string;
patch?: {
oldFileName: string;
newFileName: string;
oldHeader?: string;
newHeader?: string;
hunks: Array<{
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
lines: Array<string>;
}>;
index?: string;
};
};
export type File = {

@@ -1670,6 +1689,3 @@ path: string;

*/
200: {
type: "raw" | "patch";
content: string;
};
200: FileContent;
};

@@ -1676,0 +1692,0 @@ export type FileReadResponse = FileReadResponses[keyof FileReadResponses];

@@ -9,2 +9,10 @@ import { type Config } from "./gen/types.gen.js";

};
export type TuiOptions = {
project?: string;
model?: string;
session?: string;
agent?: string;
signal?: AbortSignal;
config?: Config;
};
export declare function createOpencodeServer(options?: ServerOptions): Promise<{

@@ -14,1 +22,4 @@ url: string;

}>;
export declare function createOpencodeTui(options?: TuiOptions): {
close(): void;
};

@@ -64,1 +64,29 @@ import { spawn } from "node:child_process";

}
export function createOpencodeTui(options) {
const args = [];
if (options?.project) {
args.push(`--project=${options.project}`);
}
if (options?.model) {
args.push(`--model=${options.model}`);
}
if (options?.session) {
args.push(`--session=${options.session}`);
}
if (options?.agent) {
args.push(`--agent=${options.agent}`);
}
const proc = spawn(`opencode`, args, {
signal: options?.signal,
stdio: 'inherit',
env: {
...process.env,
OPENCODE_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}),
},
});
return {
close() {
proc.kill();
},
};
}
+1
-1
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/sdk",
"version": "0.6.4",
"version": "0.6.5",
"type": "module",

@@ -6,0 +6,0 @@ "scripts": {