@opencode/simulation 2.0.26 → 2.0.27
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/backend/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import { makeGlobalNode } from "@opencode/util/effect/app-node";
|
|
|
3
3
|
import { httpClient } from "@opencode/util/effect/app-node-platform";
|
|
4
4
|
import { SdkPlugins } from "@opencode/core/plugin/sdk";
|
|
5
5
|
import { Config, Effect, FileSystem, Layer } from "effect";
|
|
6
|
-
import { HttpClient } from "effect/
|
|
6
|
+
import { HttpClient } from "effect/http";
|
|
7
7
|
import { DriveManifest } from "../manifest";
|
|
8
8
|
import { SimulationNetwork } from "./network";
|
|
9
9
|
import { SimulationOpenAI } from "./openai";
|
|
10
10
|
import { SimulatedProvider } from "./simulated-provider";
|
|
11
11
|
export const simulationReplacements = Effect.fn("Simulation.replacements")(function* (app) {
|
|
12
12
|
const models = SimulationNetwork.json("GET", "https://models.opencode.ai/api.json", {});
|
|
13
|
-
if (!(yield* Config.
|
|
13
|
+
if (!(yield* Config.String("OPENCODE_DRIVE").pipe(Config.withDefault(void 0))))
|
|
14
14
|
return [httpClient.replace(SimulationNetwork.layer([models]))];
|
|
15
15
|
const manifest = yield* DriveManifest.resolve(), networkLayer = Layer.effect(HttpClient.HttpClient, Effect.gen(function* () {
|
|
16
16
|
const provider = yield* SimulatedProvider.Service;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Layer } from "effect";
|
|
2
|
-
import { HttpClient, HttpClientResponse, type HttpMethod } from "effect/
|
|
3
|
-
import { HttpClientError } from "effect/
|
|
4
|
-
import type { HttpClientRequest } from "effect/
|
|
2
|
+
import { HttpClient, HttpClientResponse, type HttpMethod } from "effect/http";
|
|
3
|
+
import { HttpClientError } from "effect/http/HttpClientError";
|
|
4
|
+
import type { HttpClientRequest } from "effect/http";
|
|
5
5
|
import { SimulationProtocol } from "../protocol";
|
|
6
6
|
/**
|
|
7
7
|
* Simulated network.
|
package/dist/backend/network.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Clock, Effect, Layer, Ref } from "effect";
|
|
2
|
-
import { HttpClient, HttpClientResponse } from "effect/
|
|
3
|
-
import { HttpClientError, TransportError } from "effect/
|
|
2
|
+
import { HttpClient, HttpClientResponse } from "effect/http";
|
|
3
|
+
import { HttpClientError, TransportError } from "effect/http/HttpClientError";
|
|
4
4
|
import { SimulationProtocol } from "../protocol";
|
|
5
5
|
const LOG_LIMIT = 1000;
|
|
6
6
|
export function json(method, url, body) {
|
package/dist/backend/openai.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
|
-
import { HttpClientResponse } from "effect/
|
|
3
|
-
import { HttpClientError, TransportError } from "effect/
|
|
2
|
+
import { HttpClientResponse } from "effect/http";
|
|
3
|
+
import { HttpClientError, TransportError } from "effect/http/HttpClientError";
|
|
4
4
|
import { OpenAIChatEvent, DEFAULT_BASE_URL, PATH } from "@opencode/ai/protocols/openai-chat";
|
|
5
5
|
import { SimulationNetwork } from "./network";
|
|
6
6
|
import { SimulatedProvider } from "./simulated-provider";
|
package/dist/frontend/actions.js
CHANGED
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
createMockMouse,
|
|
5
5
|
KeyCodes
|
|
6
6
|
} from "@opentui/core/testing";
|
|
7
|
-
import { Effect,
|
|
7
|
+
import { Effect, Schema } from "effect";
|
|
8
|
+
import { Base64 } from "effect/encoding";
|
|
8
9
|
import { SimulationProtocol } from "../protocol";
|
|
9
10
|
import { SimulationRenderer } from "./renderer";
|
|
10
11
|
import { SimulationSemantics } from "./semantics";
|
|
@@ -142,7 +143,7 @@ function captureImages(renderer) {
|
|
|
142
143
|
height: fitted.height,
|
|
143
144
|
pixelWidth: raw.width,
|
|
144
145
|
pixelHeight: raw.height,
|
|
145
|
-
rgba:
|
|
146
|
+
rgba: Base64.encode(rgba)
|
|
146
147
|
}];
|
|
147
148
|
} finally {
|
|
148
149
|
extracted?.dispose();
|
|
@@ -5,7 +5,7 @@ import { SimulationActions } from "./actions";
|
|
|
5
5
|
import { SimulationRenderer } from "./renderer";
|
|
6
6
|
import { SimulationServer } from "./server";
|
|
7
7
|
export const create = Effect.fn("Drive.create")(function* (options, version) {
|
|
8
|
-
const headless = (yield* Config.
|
|
8
|
+
const headless = (yield* Config.String("OPENCODE_DRIVE_RENDERER").pipe(Config.withDefault("visible"))) === "headless", manifest = yield* DriveManifest.resolve(), renderer = headless ? yield* SimulationRenderer.create(options, manifest.recording?.timeline, manifest.viewport) : yield* Effect.acquireRelease(Effect.tryPromise(() => createCliRenderer(options)), (renderer) => Effect.sync(() => {
|
|
9
9
|
if (!renderer.isDestroyed)
|
|
10
10
|
renderer.destroy();
|
|
11
11
|
}));
|
package/dist/manifest.js
CHANGED
|
@@ -44,7 +44,7 @@ export const resolve = Effect.fn("DriveManifest.resolve")(function* () {
|
|
|
44
44
|
const name = yield* Config.schema(InstanceName, "OPENCODE_DRIVE").pipe(Effect.mapError(configError));
|
|
45
45
|
if (name === "1")
|
|
46
46
|
return defaults;
|
|
47
|
-
const state = yield* Config.
|
|
47
|
+
const state = yield* Config.String("XDG_STATE_HOME").pipe(Config.withDefault(join(homedir(), ".local", "state")), Effect.mapError(configError)), directory = yield* Config.String("DRIVE_REGISTRY_DIR").pipe(Config.withDefault(join(state, "opencode-drive", "instances")), Effect.mapError(configError)), file = join(directory, `${name}.json`), contents = yield* (yield* FileSystem.FileSystem).readFileString(file).pipe(Effect.mapError((cause) => new ResolveError({
|
|
48
48
|
reason: cause.reason._tag === "NotFound" ? "not-found" : "read",
|
|
49
49
|
path: file,
|
|
50
50
|
message: cause.reason._tag === "NotFound" ? `Drive manifest not found: ${file}` : `Failed to read Drive manifest: ${file}: ${cause.message}`,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/simulation",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.27",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"typecheck": "tsgo -b"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@opencode/core": "2.0.
|
|
51
|
-
"@opencode/ai": "2.0.
|
|
52
|
-
"@opencode/plugin": "2.0.
|
|
53
|
-
"@opencode/protocol": "2.0.
|
|
54
|
-
"@opencode/util": "2.0.
|
|
50
|
+
"@opencode/core": "2.0.27",
|
|
51
|
+
"@opencode/ai": "2.0.27",
|
|
52
|
+
"@opencode/plugin": "2.0.27",
|
|
53
|
+
"@opencode/protocol": "2.0.27",
|
|
54
|
+
"@opencode/util": "2.0.27",
|
|
55
55
|
"@opentui/core": "0.5.17",
|
|
56
|
-
"effect": "4.0.
|
|
56
|
+
"effect": "4.0.1",
|
|
57
57
|
"ws": "8.21.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|