@opencode/sdk 2.1.2 → 2.1.4

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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  create5
3
- } from "./logging-agveg28k.js";
3
+ } from "./promise-hp200032.js";
4
4
  import {
5
5
  __export
6
- } from "./logging-9rqn6x4v.js";
6
+ } from "./promise-9rqn6x4v.js";
7
7
 
8
8
  // src/effect/opencode.ts
9
9
  var exports_opencode = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  create4
3
- } from "./logging-z91nkf8q.js";
3
+ } from "./promise-kfnfv948.js";
4
4
  import {
5
5
  __export
6
- } from "./logging-9rqn6x4v.js";
6
+ } from "./promise-9rqn6x4v.js";
7
7
 
8
8
  // src/opencode.ts
9
9
  var exports_opencode2 = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./logging-9rqn6x4v.js";
3
+ } from "./promise-9rqn6x4v.js";
4
4
 
5
5
  // src/internal/fetch.ts
6
6
  var exports_fetch = {};
@@ -1,17 +1,17 @@
1
1
  import {
2
- layer3,
2
+ layer4,
3
3
  context2
4
- } from "./logging-vvs370xz.js";
4
+ } from "./promise-t7drb6e9.js";
5
5
  import {
6
6
  make3
7
- } from "./logging-yqn72msb.js";
7
+ } from "./promise-f8tdk121.js";
8
8
  import {
9
9
  provide2,
10
10
  node2
11
- } from "./logging-m53bc19j.js";
11
+ } from "./promise-q6shpj80.js";
12
12
  import {
13
13
  __export
14
- } from "./logging-9rqn6x4v.js";
14
+ } from "./promise-9rqn6x4v.js";
15
15
 
16
16
  // src/internal/host.ts
17
17
  var exports_host = {};
@@ -34,7 +34,7 @@ var create5 = Effect.fn("EmbeddedHost.create")(function* (options = {}, embed =
34
34
  ...server,
35
35
  app: { ...server.app, name: server.app?.name ?? "sdk" },
36
36
  database: { path: ":memory:", ...server.database }
37
- }, workspaceProviders ? [...embed.overrides ?? [], WorkspaceDriver.node.replace(WorkspaceDriver.registryNode(workspaceProviders))] : embed.overrides, selector ? (replacements) => node2(selector, replacements) : undefined).pipe(Layer.provide(HttpServer.layerServices), Layer.provideMerge(layer3(log))));
37
+ }, workspaceProviders ? [...embed.overrides ?? [], WorkspaceDriver.node.replace(WorkspaceDriver.registryNode(workspaceProviders))] : embed.overrides, selector ? (replacements) => node2(selector, replacements) : undefined).pipe(Layer.provide(HttpServer.layerServices), Layer.provideMerge(layer4(log))));
38
38
  return yield* Effect.gen(function* () {
39
39
  const services = yield* runtime.contextEffect;
40
40
  const sdkPlugins = Context.get(services, SdkPlugins.Service);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  create5
3
- } from "./logging-agveg28k.js";
3
+ } from "./promise-hp200032.js";
4
4
  import {
5
5
  __export
6
- } from "./logging-9rqn6x4v.js";
6
+ } from "./promise-9rqn6x4v.js";
7
7
 
8
8
  // src/promise.ts
9
9
  var exports_promise = {};
@@ -1,19 +1,18 @@
1
1
  import {
2
2
  __export
3
- } from "./logging-9rqn6x4v.js";
3
+ } from "./promise-9rqn6x4v.js";
4
4
 
5
5
  // src/internal/instances.ts
6
6
  var exports_instances = {};
7
7
  __export(exports_instances, {
8
8
  SdkInstances: () => exports_instances,
9
- layer: () => layer4,
9
+ layer: () => layer3,
10
10
  node: () => node2,
11
11
  provide: () => provide2
12
12
  });
13
13
  import { Instance } from "@opencode/core/instance";
14
14
  import { LocationServiceMap } from "@opencode/core/location-service-map";
15
15
  import { Plugin } from "@opencode/core/plugin";
16
- import { Location } from "@opencode/schema/location";
17
16
  import { makeGlobalNode } from "@opencode/util/effect/app-node";
18
17
  import { Context, Duration, Effect, Layer, LayerMap } from "effect";
19
18
  function provide2(options, context) {
@@ -25,11 +24,11 @@ function provide2(options, context) {
25
24
  function node2(options, replacements) {
26
25
  return makeGlobalNode({
27
26
  service: Instance.Service,
28
- layer: layer4(options, replacements),
27
+ layer: layer3(options, replacements),
29
28
  deps: [LocationServiceMap.node]
30
29
  });
31
30
  }
32
- function layer4(options, replacements) {
31
+ function layer3(options, replacements) {
33
32
  return Layer.effect(Instance.Service, Effect.gen(function* () {
34
33
  const scope = yield* Effect.scope;
35
34
  const locations = yield* LocationServiceMap.Service;
@@ -40,7 +39,7 @@ function layer4(options, replacements) {
40
39
  const provide = (session) => Effect.provide(instances.get(key(session)));
41
40
  const instances = yield* LayerMap.make((input) => Layer.unwrap(Effect.gen(function* () {
42
41
  const configuration = yield* options.configure(input.key).pipe(Effect.orDie);
43
- return Instance.layer(Location.Ref.make({ directory: input.directory, workspaceID: input.workspaceID }), {
42
+ return Instance.layer(input, {
44
43
  plugins: configuration.plugins,
45
44
  replacements: [
46
45
  ...replacements(),
@@ -59,4 +58,4 @@ function layer4(options, replacements) {
59
58
  }));
60
59
  }
61
60
 
62
- export { provide2, node2, layer4, exports_instances };
61
+ export { provide2, node2, layer3, exports_instances };
@@ -16,20 +16,17 @@ var levelNames = new Map([
16
16
  [levels.error, "error"],
17
17
  [levels.fatal, "fatal"]
18
18
  ]);
19
- function normalizeLevel(level) {
20
- return levelNames.get(level);
21
- }
22
- function layer3(log) {
19
+ function layer4(log) {
23
20
  const logger = Logger.make((options) => {
24
21
  if (!log)
25
22
  return;
26
- const level = normalizeLevel(options.logLevel);
23
+ const level = levelNames.get(options.logLevel);
27
24
  if (!level)
28
25
  return;
29
26
  const entry = Logger.formatStructured.log(options);
30
27
  const values = Array.isArray(entry.message) ? entry.message : [entry.message];
31
28
  const [message, ...data] = values;
32
- const details = data.length === 1 && !Array.isArray(data[0]) ? data[0] : undefined;
29
+ const details = data.length === 1 && typeof data[0] === "object" && data[0] !== null && !Array.isArray(data[0]) ? data[0] : undefined;
33
30
  const { cause: detailCause, ...detailAttributes } = details ?? {};
34
31
  const attributes = {
35
32
  ...entry.annotations,
@@ -52,4 +49,4 @@ function context2(source) {
52
49
  return Context.make(Logger.CurrentLoggers, Context.get(source, Logger.CurrentLoggers)).pipe(Context.add(References.MinimumLogLevel, Context.get(source, References.MinimumLogLevel)));
53
50
  }
54
51
 
55
- export { layer3, context2 };
52
+ export { layer4, context2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./logging-9rqn6x4v.js";
3
+ } from "./promise-9rqn6x4v.js";
4
4
 
5
5
  // src/effect/tool.ts
6
6
  var exports_tool = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./logging-9rqn6x4v.js";
3
+ } from "./promise-9rqn6x4v.js";
4
4
 
5
5
  // src/internal/workerd.ts
6
6
  var exports_workerd = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./logging-9rqn6x4v.js";
3
+ } from "./promise-9rqn6x4v.js";
4
4
 
5
5
  // src/tool.ts
6
6
  var exports_tool2 = {};
package/dist/contracts.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  SessionMessage2,
27
27
  Skill2,
28
28
  Workspace2
29
- } from "./chunks/logging-j1jhtwv7.js";
29
+ } from "./chunks/promise-j1jhtwv7.js";
30
30
  export {
31
31
  AbsolutePath2 as AbsolutePath,
32
32
  Agent2 as Agent,
@@ -1,13 +1,13 @@
1
- import"../chunks/logging-vvs370xz.js";
2
- import"../chunks/logging-yqn72msb.js";
3
- import"../chunks/logging-m53bc19j.js";
4
- import"../chunks/logging-agveg28k.js";
1
+ import"../chunks/promise-t7drb6e9.js";
2
+ import"../chunks/promise-f8tdk121.js";
3
+ import"../chunks/promise-q6shpj80.js";
4
+ import"../chunks/promise-hp200032.js";
5
5
  import {
6
6
  exports_opencode
7
- } from "../chunks/logging-jjkd910x.js";
7
+ } from "../chunks/promise-4zpjdggv.js";
8
8
  import {
9
9
  exports_tool
10
- } from "../chunks/logging-n1hprnh9.js";
10
+ } from "../chunks/promise-v20ebq3t.js";
11
11
  import {
12
12
  Agent2,
13
13
  Command2,
@@ -36,7 +36,7 @@ import {
36
36
  SessionMessage2,
37
37
  Skill2,
38
38
  Workspace2
39
- } from "../chunks/logging-j1jhtwv7.js";
39
+ } from "../chunks/promise-j1jhtwv7.js";
40
40
 
41
41
  // src/effect/index.ts
42
42
  import { EnvironmentDriver } from "@opencode/core/environment/driver";
@@ -3,11 +3,11 @@ import {
3
3
  Service2,
4
4
  layer2,
5
5
  exports_opencode
6
- } from "../chunks/logging-jjkd910x.js";
7
- import"../chunks/logging-agveg28k.js";
8
- import"../chunks/logging-yqn72msb.js";
9
- import"../chunks/logging-vvs370xz.js";
10
- import"../chunks/logging-m53bc19j.js";
6
+ } from "../chunks/promise-4zpjdggv.js";
7
+ import"../chunks/promise-hp200032.js";
8
+ import"../chunks/promise-q6shpj80.js";
9
+ import"../chunks/promise-t7drb6e9.js";
10
+ import"../chunks/promise-f8tdk121.js";
11
11
  export {
12
12
  exports_opencode as OpenCode,
13
13
  Service2 as Service,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegistrationError2,
3
3
  Error2
4
- } from "../chunks/logging-n1hprnh9.js";
4
+ } from "../chunks/promise-v20ebq3t.js";
5
5
  export {
6
6
  Error2 as Error,
7
7
  RegistrationError2 as RegistrationError
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  make2
3
- } from "../chunks/logging-39225h8g.js";
4
- import"../chunks/logging-vvs370xz.js";
5
- import"../chunks/logging-yqn72msb.js";
6
- import"../chunks/logging-m53bc19j.js";
7
- import"../chunks/logging-agveg28k.js";
3
+ } from "../chunks/promise-v4tj0tsx.js";
4
+ import"../chunks/promise-t7drb6e9.js";
5
+ import"../chunks/promise-f8tdk121.js";
6
+ import"../chunks/promise-q6shpj80.js";
7
+ import"../chunks/promise-hp200032.js";
8
8
  import {
9
9
  create2,
10
10
  Service2
11
- } from "../chunks/logging-jjkd910x.js";
11
+ } from "../chunks/promise-4zpjdggv.js";
12
12
  import {
13
13
  __export
14
- } from "../chunks/logging-9rqn6x4v.js";
14
+ } from "../chunks/promise-9rqn6x4v.js";
15
15
 
16
16
  // src/effect/workerd.ts
17
17
  var exports_workerd = {};
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import"./chunks/logging-vvs370xz.js";
2
- import"./chunks/logging-yqn72msb.js";
3
- import"./chunks/logging-m53bc19j.js";
4
- import"./chunks/logging-agveg28k.js";
5
- import"./chunks/logging-z91nkf8q.js";
1
+ import"./chunks/promise-t7drb6e9.js";
2
+ import"./chunks/promise-f8tdk121.js";
3
+ import"./chunks/promise-q6shpj80.js";
4
+ import"./chunks/promise-hp200032.js";
5
+ import"./chunks/promise-kfnfv948.js";
6
6
  import {
7
7
  exports_opencode2
8
- } from "./chunks/logging-9d9fz857.js";
8
+ } from "./chunks/promise-d77cxa24.js";
9
9
  import {
10
10
  exports_tool2
11
- } from "./chunks/logging-hdqq71na.js";
11
+ } from "./chunks/promise-xk8fc419.js";
12
12
  import {
13
13
  Agent2,
14
14
  Command2,
@@ -37,7 +37,7 @@ import {
37
37
  SessionMessage2,
38
38
  Skill2,
39
39
  Workspace2
40
- } from "./chunks/logging-j1jhtwv7.js";
40
+ } from "./chunks/promise-j1jhtwv7.js";
41
41
 
42
42
  // src/index.ts
43
43
  import { ClientError } from "@opencode/client";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make3,
3
3
  exports_fetch
4
- } from "../chunks/logging-yqn72msb.js";
4
+ } from "../chunks/promise-f8tdk121.js";
5
5
  export {
6
6
  exports_fetch as OwnedFetch,
7
7
  make3 as make
@@ -22,7 +22,7 @@ export interface EmbedOptions {
22
22
  readonly overrides?: LayerNode.Replacements;
23
23
  }
24
24
  export declare const create: <R = never>(options?: CreateOptions<R> | undefined, embed?: EmbedOptions | undefined) => Effect.Effect<{
25
- runtime: ManagedRuntime.ManagedRuntime<import("effect/http/HttpClient").HttpClient | HttpRouter.HttpRouter | import("@opencode/util/global").Service | import("@opencode/core/database/database").Service | import("@opencode/core/project").Service | import("@opencode/core/bus").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/credential").Service | import("@opencode/core/wellknown").Service | Workspace.Service | import("@opencode/core/permission/saved").Service | import("@opencode/core/instance").Service | import("@opencode/core/job").Service | Session.Service | import("@opencode/core/worktree").Service | import("@opencode/core/plugin/update").Service | import("@opencode/core/location-service-map").Service | SdkPlugins.Service | SessionRestart.Service | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("@opencode/core/location-activity").Service | import("@opencode/server/pairing").Service | import("@opencode/server/pty-environment").Service, Error | import("@opencode/core/persistent-pty/index").UnavailableError>;
25
+ runtime: ManagedRuntime.ManagedRuntime<import("effect/http/HttpClient").HttpClient | HttpRouter.HttpRouter | import("@opencode/util/global").Service | import("@opencode/core/database/database").Service | import("@opencode/util/fs-util").FSUtil.Service | import("@opencode/core/project").Service | import("@opencode/core/bus").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/credential").Service | import("@opencode/core/wellknown").Service | Workspace.Service | import("@opencode/core/permission/saved").Service | import("@opencode/core/instance").Service | import("@opencode/core/job").Service | Session.Service | import("@opencode/core/worktree").Service | import("@opencode/core/plugin/update").Service | import("@opencode/core/location-service-map").Service | SdkPlugins.Service | SessionRestart.Service | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("@opencode/core/location-activity").Service | import("@opencode/server/pairing").Service, Error | import("@opencode/core/persistent-pty/index").UnavailableError>;
26
26
  fetch: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) & {
27
27
  preconnect: () => undefined;
28
28
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  create5,
3
3
  exports_host
4
- } from "../chunks/logging-agveg28k.js";
5
- import"../chunks/logging-yqn72msb.js";
6
- import"../chunks/logging-vvs370xz.js";
7
- import"../chunks/logging-m53bc19j.js";
4
+ } from "../chunks/promise-hp200032.js";
5
+ import"../chunks/promise-q6shpj80.js";
6
+ import"../chunks/promise-t7drb6e9.js";
7
+ import"../chunks/promise-f8tdk121.js";
8
8
  export {
9
9
  exports_host as EmbeddedHost,
10
10
  create5 as create
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  provide2,
3
3
  node2,
4
- layer4,
4
+ layer3,
5
5
  exports_instances
6
- } from "../chunks/logging-m53bc19j.js";
6
+ } from "../chunks/promise-q6shpj80.js";
7
7
  export {
8
8
  exports_instances as SdkInstances,
9
- layer4 as layer,
9
+ layer3 as layer,
10
10
  node2 as node,
11
11
  provide2 as provide
12
12
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make2,
3
3
  exports_workerd
4
- } from "../chunks/logging-39225h8g.js";
4
+ } from "../chunks/promise-v4tj0tsx.js";
5
5
  export {
6
6
  exports_workerd as WorkerdProfile,
7
7
  make2 as make
package/dist/logging.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
- layer3,
2
+ layer4,
3
3
  context2
4
- } from "./chunks/logging-vvs370xz.js";
4
+ } from "./chunks/promise-t7drb6e9.js";
5
5
  export {
6
6
  context2 as context,
7
- layer3 as layer
7
+ layer4 as layer
8
8
  };
package/dist/opencode.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  create3
3
- } from "./chunks/logging-9d9fz857.js";
4
- import"./chunks/logging-z91nkf8q.js";
5
- import"./chunks/logging-agveg28k.js";
6
- import"./chunks/logging-yqn72msb.js";
7
- import"./chunks/logging-vvs370xz.js";
8
- import"./chunks/logging-m53bc19j.js";
3
+ } from "./chunks/promise-d77cxa24.js";
4
+ import"./chunks/promise-kfnfv948.js";
5
+ import"./chunks/promise-hp200032.js";
6
+ import"./chunks/promise-q6shpj80.js";
7
+ import"./chunks/promise-t7drb6e9.js";
8
+ import"./chunks/promise-f8tdk121.js";
9
9
  export {
10
10
  create3 as create
11
11
  };
package/dist/promise.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  create4,
3
3
  exports_promise
4
- } from "./chunks/logging-z91nkf8q.js";
5
- import"./chunks/logging-agveg28k.js";
6
- import"./chunks/logging-yqn72msb.js";
7
- import"./chunks/logging-vvs370xz.js";
8
- import"./chunks/logging-m53bc19j.js";
4
+ } from "./chunks/promise-kfnfv948.js";
5
+ import"./chunks/promise-hp200032.js";
6
+ import"./chunks/promise-q6shpj80.js";
7
+ import"./chunks/promise-t7drb6e9.js";
8
+ import"./chunks/promise-f8tdk121.js";
9
9
  export {
10
10
  exports_promise as PromiseSdk,
11
11
  create4 as create
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegistrationError3,
3
3
  Error3
4
- } from "./chunks/logging-hdqq71na.js";
4
+ } from "./chunks/promise-xk8fc419.js";
5
5
  export {
6
6
  Error3 as Error,
7
7
  RegistrationError3 as RegistrationError
package/dist/workerd.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  make2
3
- } from "./chunks/logging-39225h8g.js";
4
- import"./chunks/logging-vvs370xz.js";
5
- import"./chunks/logging-yqn72msb.js";
6
- import"./chunks/logging-m53bc19j.js";
7
- import"./chunks/logging-agveg28k.js";
3
+ } from "./chunks/promise-v4tj0tsx.js";
4
+ import"./chunks/promise-t7drb6e9.js";
5
+ import"./chunks/promise-f8tdk121.js";
6
+ import"./chunks/promise-q6shpj80.js";
7
+ import"./chunks/promise-hp200032.js";
8
8
  import {
9
9
  create4
10
- } from "./chunks/logging-z91nkf8q.js";
10
+ } from "./chunks/promise-kfnfv948.js";
11
11
  import {
12
12
  __export
13
- } from "./chunks/logging-9rqn6x4v.js";
13
+ } from "./chunks/promise-9rqn6x4v.js";
14
14
 
15
15
  // src/workerd.ts
16
16
  var exports_workerd = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "name": "@opencode/sdk",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,24 +36,25 @@
36
36
  "scripts": {
37
37
  "build": "bun run script/build.ts",
38
38
  "test": "bun test --timeout 5000",
39
- "typecheck": "tsc -b",
39
+ "typecheck": "bun check --no-script -b",
40
+ "typecheck:tsc": "tsc -b",
40
41
  "verify:package": "bun run script/verify-package.ts"
41
42
  },
42
43
  "dependencies": {
43
- "@opencode/client": "2.1.2",
44
- "@opencode/core": "2.1.2",
45
- "@opencode/plugin": "2.1.2",
46
- "@opencode/schema": "2.1.2",
47
- "@opencode/server": "2.1.2",
48
- "@opencode/util": "2.1.2",
44
+ "@opencode/client": "2.1.4",
45
+ "@opencode/core": "2.1.4",
46
+ "@opencode/plugin": "2.1.4",
47
+ "@opencode/schema": "2.1.4",
48
+ "@opencode/server": "2.1.4",
49
+ "@opencode/util": "2.1.4",
49
50
  "effect": "4.0.1"
50
51
  },
51
52
  "devDependencies": {
52
- "@opencode/ai": "2.1.2",
53
- "@opencode/httpapi-codegen": "2.1.2",
54
- "@opencode/protocol": "2.1.2",
53
+ "@opencode/ai": "2.1.4",
54
+ "@opencode/httpapi-codegen": "2.1.4",
55
+ "@opencode/protocol": "2.1.4",
55
56
  "@tsconfig/bun": "1.0.9",
56
- "@types/bun": "1.4.0",
57
- "@typescript/native": "npm:typescript@7.0.2"
57
+ "@types/bun": "1.4.3",
58
+ "@typescript/native": "npm:typescript@7.1.0-beta"
58
59
  }
59
60
  }