@opencode-ai/client 0.0.0-next-14944 → 0.0.0
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/README.md +1 -25
- package/package.json +2 -56
- package/dist/contract.d.ts +0 -1
- package/dist/contract.js +0 -1
- package/dist/effect/api/api.d.ts +0 -814
- package/dist/effect/api/api.js +0 -0
- package/dist/effect/api.d.ts +0 -6
- package/dist/effect/api.js +0 -0
- package/dist/effect/generated/client-error.d.ts +0 -7
- package/dist/effect/generated/client-error.js +0 -5
- package/dist/effect/generated/client.d.ts +0 -6112
- package/dist/effect/generated/client.js +0 -376
- package/dist/effect/generated/index.d.ts +0 -2
- package/dist/effect/generated/index.js +0 -2
- package/dist/effect/index.d.ts +0 -30
- package/dist/effect/index.js +0 -26
- package/dist/effect/service.d.ts +0 -28
- package/dist/effect/service.js +0 -113
- package/dist/promise/api.d.ts +0 -21
- package/dist/promise/api.js +0 -0
- package/dist/promise/generated/client-error.d.ts +0 -6
- package/dist/promise/generated/client-error.js +0 -8
- package/dist/promise/generated/client.d.ts +0 -1298
- package/dist/promise/generated/client.js +0 -970
- package/dist/promise/generated/index.d.ts +0 -3
- package/dist/promise/generated/index.js +0 -3
- package/dist/promise/generated/types.d.ts +0 -8306
- package/dist/promise/generated/types.js +0 -21
- package/dist/promise/index.d.ts +0 -4
- package/dist/promise/index.js +0 -1
package/README.md
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
1
|
# @opencode-ai/client
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Entrypoints
|
|
6
|
-
|
|
7
|
-
- `@opencode-ai/client`: zero-Effect Promise client using `fetch`.
|
|
8
|
-
- `@opencode-ai/client/effect`: rich Effect network client using an environment-provided `HttpClient`.
|
|
9
|
-
|
|
10
|
-
The generated surface includes every standard HTTP group from Server's concrete API. The build compiler reads `@opencode-ai/server/api`; the generated Effect runtime imports a client-local projection built from Protocol, with a generation-equivalence test preventing transport drift. Custom transports such as the PTY WebSocket connection remain outside the generic HTTP client. Run `bun run generate` after changing the contract and `bun run check:generated` to detect committed-output drift.
|
|
11
|
-
|
|
12
|
-
The Effect entrypoint uses canonical decoded values such as `Session.ID`, `Location.Ref`, and `Prompt`. These datatypes come from the lightweight `@opencode-ai/schema` package and are re-exported so callers depend only on the client surface. Protocol owns endpoint construction and middleware placement; Server supplies the concrete middleware keys used by the build-time API.
|
|
13
|
-
|
|
14
|
-
The Promise root remains structural and has no Core or Effect runtime dependency. `/effect` depends only on Effect, Schema, and Protocol and is browser-bundle safe. Bundle-boundary tests enforce both import graphs.
|
|
15
|
-
|
|
16
|
-
Effect consumers construct canonical decoded inputs:
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import { AbsolutePath, Location, OpenCode, Prompt } from "@opencode-ai/client/effect"
|
|
20
|
-
|
|
21
|
-
const client = yield * OpenCode.make({ baseUrl: "https://opencode.example" })
|
|
22
|
-
yield *
|
|
23
|
-
client.sessions.create({
|
|
24
|
-
location: Location.Ref.make({ directory: AbsolutePath.make("/workspace") }),
|
|
25
|
-
})
|
|
26
|
-
yield * client.sessions.prompt({ sessionID, prompt: Prompt.make({ text: "Hello" }) })
|
|
27
|
-
```
|
|
3
|
+
Reserved for the OpenCode client package.
|
package/package.json
CHANGED
|
@@ -1,63 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/package.json",
|
|
3
2
|
"name": "@opencode-ai/client",
|
|
4
|
-
"version": "0.0.0
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Reserved for the OpenCode client package",
|
|
6
5
|
"license": "MIT",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/anomalyco/opencode.git",
|
|
10
|
-
"directory": "packages/client"
|
|
11
|
-
},
|
|
12
6
|
"publishConfig": {
|
|
13
7
|
"access": "public"
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"exports": {
|
|
19
|
-
"./promise": {
|
|
20
|
-
"import": "./dist/promise/index.js",
|
|
21
|
-
"types": "./dist/promise/index.d.ts"
|
|
22
|
-
},
|
|
23
|
-
"./promise/api": {
|
|
24
|
-
"import": "./dist/promise/api.js",
|
|
25
|
-
"types": "./dist/promise/api.d.ts"
|
|
26
|
-
},
|
|
27
|
-
"./effect": {
|
|
28
|
-
"import": "./dist/effect/index.js",
|
|
29
|
-
"types": "./dist/effect/index.d.ts"
|
|
30
|
-
},
|
|
31
|
-
"./effect/api": {
|
|
32
|
-
"import": "./dist/effect/api.js",
|
|
33
|
-
"types": "./dist/effect/api.d.ts"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "bun run script/build-package.ts",
|
|
38
|
-
"generate": "bun run script/build.ts",
|
|
39
|
-
"check:generated": "bun run generate && git diff --exit-code -- src/promise/generated src/effect/generated src/effect/api",
|
|
40
|
-
"test": "bun test --timeout 5000",
|
|
41
|
-
"typecheck": "tsgo --noEmit"
|
|
42
|
-
},
|
|
43
|
-
"dependencies": {
|
|
44
|
-
"@opencode-ai/schema": "0.0.0-next-14944",
|
|
45
|
-
"@opencode-ai/protocol": "0.0.0-next-14944"
|
|
46
|
-
},
|
|
47
|
-
"peerDependencies": {
|
|
48
|
-
"effect": "4.0.0-beta.83"
|
|
49
|
-
},
|
|
50
|
-
"peerDependenciesMeta": {
|
|
51
|
-
"effect": {
|
|
52
|
-
"optional": true
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@effect/platform-node": "4.0.0-beta.83",
|
|
57
|
-
"@opencode-ai/httpapi-codegen": "0.0.0-next-14944",
|
|
58
|
-
"@tsconfig/bun": "1.0.9",
|
|
59
|
-
"@types/bun": "1.3.13",
|
|
60
|
-
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
61
|
-
"effect": "4.0.0-beta.83"
|
|
62
8
|
}
|
|
63
9
|
}
|
package/dist/contract.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ClientApi, effectOmitEndpoints, endpointNames, groupNames, promiseOmitEndpoints, } from "@opencode-ai/protocol/client";
|
package/dist/contract.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ClientApi, effectOmitEndpoints, endpointNames, groupNames, promiseOmitEndpoints, } from "@opencode-ai/protocol/client";
|