soraacode 0.1.0 → 0.1.2
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/package.json +12 -26
- package/parsers-config.ts +1 -1
- package/script/bench-search.ts +3 -3
- package/script/build.ts +1 -1
- package/script/publish.ts +1 -1
- package/script/schema.ts +2 -2
- package/specs/tui-plugins.md +7 -7
- package/specs/v2/api.ts +2 -2
- package/src/account/account.ts +3 -3
- package/src/account/repo.ts +4 -4
- package/src/acp/agent.ts +1 -1
- package/src/acp/content.ts +1 -1
- package/src/acp/directory.ts +3 -3
- package/src/acp/event.ts +1 -1
- package/src/acp/permission.ts +1 -1
- package/src/acp/service.ts +5 -5
- package/src/acp/session.ts +4 -4
- package/src/acp/usage.ts +5 -5
- package/src/agent/agent.ts +11 -11
- package/src/agent/subagent-permissions.ts +1 -1
- package/src/auth/index.ts +4 -4
- package/src/background/job.ts +3 -3
- package/src/cli/cmd/serve.ts +1 -1
- package/src/cli/error.ts +1 -1
- package/src/cli/heap.ts +2 -2
- package/src/cli/network.ts +1 -1
- package/src/command/index.ts +2 -2
- package/src/config/agent.ts +2 -2
- package/src/config/command.ts +3 -3
- package/src/config/config.ts +15 -15
- package/src/config/markdown.ts +2 -2
- package/src/config/parse.ts +2 -2
- package/src/config/paths.ts +3 -3
- package/src/config/plugin.ts +2 -2
- package/src/config/v2-compat.ts +4 -4
- package/src/config/variable.ts +1 -1
- package/src/control-plane/adapters/index.ts +1 -1
- package/src/control-plane/dev/debug-workspace-plugin.ts +1 -1
- package/src/control-plane/types.ts +3 -3
- package/src/control-plane/workspace-context.ts +1 -1
- package/src/control-plane/workspace.ts +13 -13
- package/src/effect/app-node-builder-v1.ts +2 -2
- package/src/effect/app-runtime.ts +9 -9
- package/src/effect/bootstrap-runtime.ts +4 -4
- package/src/effect/bridge.ts +1 -1
- package/src/effect/instance-ref.ts +1 -1
- package/src/effect/run-service.ts +2 -2
- package/src/effect/runtime-flags.ts +1 -1
- package/src/env/index.ts +2 -2
- package/src/event-manifest.ts +1 -1
- package/src/event-v2-bridge.ts +5 -5
- package/src/format/formatter.ts +2 -2
- package/src/format/index.ts +3 -3
- package/src/git/index.ts +2 -2
- package/src/ide/index.ts +2 -2
- package/src/image/image.ts +2 -2
- package/src/index-headless.ts +1 -1
- package/src/index.ts +1 -1
- package/src/installation/index.ts +9 -9
- package/src/lsp/lsp.ts +4 -4
- package/src/lsp/server.ts +4 -4
- package/src/mcp/auth.ts +5 -5
- package/src/mcp/browser.ts +1 -1
- package/src/mcp/index.ts +9 -9
- package/src/mcp/oauth-callback.ts +1 -1
- package/src/node.ts +1 -1
- package/src/patch/index.ts +1 -1
- package/src/permission/index.ts +4 -4
- package/src/plugin/github-copilot/copilot.ts +3 -3
- package/src/plugin/github-copilot/models.ts +1 -1
- package/src/plugin/index.ts +5 -5
- package/src/plugin/install.ts +2 -2
- package/src/plugin/loader.ts +2 -2
- package/src/plugin/meta.ts +3 -3
- package/src/plugin/openai/codex.ts +3 -3
- package/src/plugin/pty-environment.ts +1 -1
- package/src/plugin/shared.ts +1 -1
- package/src/project/bootstrap.ts +1 -1
- package/src/project/instance-context.ts +1 -1
- package/src/project/instance-store.ts +4 -4
- package/src/project/project.ts +16 -16
- package/src/project/vcs.ts +4 -4
- package/src/provider/auth.ts +5 -5
- package/src/provider/error.ts +2 -2
- package/src/provider/model-status.ts +1 -1
- package/src/provider/provider.ts +13 -13
- package/src/provider/transform.ts +1 -1
- package/src/question/index.ts +2 -2
- package/src/question/schema.ts +1 -1
- package/src/server/auth.ts +1 -1
- package/src/server/event.ts +1 -1
- package/src/server/routes/instance/httpapi/api.ts +7 -7
- package/src/server/routes/instance/httpapi/groups/config.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/control-plane.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/control.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/experimental.ts +3 -3
- package/src/server/routes/instance/httpapi/groups/file.ts +2 -2
- package/src/server/routes/instance/httpapi/groups/global.ts +3 -3
- package/src/server/routes/instance/httpapi/groups/mcp.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/permission.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/project-copy.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/project.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/provider.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/pty.ts +3 -3
- package/src/server/routes/instance/httpapi/groups/session.ts +4 -4
- package/src/server/routes/instance/httpapi/groups/sync.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/control-plane.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/control.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/event.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/file.ts +6 -6
- package/src/server/routes/instance/httpapi/handlers/global.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/instance.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/permission.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/project-copy.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/project.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/provider.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/pty.ts +9 -9
- package/src/server/routes/instance/httpapi/handlers/session.ts +3 -3
- package/src/server/routes/instance/httpapi/handlers/sync.ts +3 -3
- package/src/server/routes/instance/httpapi/middleware/authorization.ts +1 -1
- package/src/server/routes/instance/httpapi/middleware/error.ts +2 -2
- package/src/server/routes/instance/httpapi/middleware/fence.ts +2 -2
- package/src/server/routes/instance/httpapi/middleware/workspace-routing.ts +2 -2
- package/src/server/routes/instance/httpapi/server.ts +27 -27
- package/src/server/routes/instance/httpapi/websocket-tracker.ts +1 -1
- package/src/server/server.ts +2 -2
- package/src/server/shared/fence.ts +3 -3
- package/src/server/shared/ui.ts +1 -1
- package/src/server/tui-event.ts +1 -1
- package/src/session/compaction.ts +8 -8
- package/src/session/instruction.ts +6 -6
- package/src/session/llm/AGENTS.md +8 -8
- package/src/session/llm/ai-sdk.ts +2 -2
- package/src/session/llm/native-request.ts +4 -4
- package/src/session/llm/native-runtime.ts +4 -4
- package/src/session/llm/request.ts +3 -3
- package/src/session/llm.ts +10 -10
- package/src/session/message-error.ts +1 -1
- package/src/session/message-v2.ts +7 -7
- package/src/session/message.ts +3 -3
- package/src/session/overflow.ts +2 -2
- package/src/session/processor.ts +5 -5
- package/src/session/prompt.ts +13 -13
- package/src/session/reminders.ts +2 -2
- package/src/session/retry.ts +2 -2
- package/src/session/revert.ts +2 -2
- package/src/session/run-state.ts +2 -2
- package/src/session/schema.ts +2 -2
- package/src/session/session.ts +20 -20
- package/src/session/status.ts +2 -2
- package/src/session/summary.ts +2 -2
- package/src/session/system.ts +6 -6
- package/src/session/todo.ts +4 -4
- package/src/session/tools.ts +3 -3
- package/src/share/session.ts +1 -1
- package/src/share/share-next.ts +9 -9
- package/src/skill/discovery.ts +4 -4
- package/src/skill/index.ts +7 -7
- package/src/snapshot/index.ts +6 -6
- package/src/storage/schema.ts +5 -5
- package/src/storage/storage.ts +4 -4
- package/src/sync/schema.ts +1 -1
- package/src/temporary.ts +1 -1
- package/src/tool/apply_patch.ts +3 -3
- package/src/tool/code-mode.ts +1 -1
- package/src/tool/edit.ts +3 -3
- package/src/tool/external-directory.ts +1 -1
- package/src/tool/glob.ts +2 -2
- package/src/tool/grep.ts +2 -2
- package/src/tool/lsp.ts +1 -1
- package/src/tool/plan.ts +1 -1
- package/src/tool/read.ts +2 -2
- package/src/tool/registry.ts +11 -11
- package/src/tool/schema.ts +1 -1
- package/src/tool/shell/prompt.ts +2 -2
- package/src/tool/shell.ts +2 -2
- package/src/tool/skill.ts +1 -1
- package/src/tool/task.ts +2 -2
- package/src/tool/tool.ts +2 -2
- package/src/tool/truncate.ts +2 -2
- package/src/tool/truncation-dir.ts +1 -1
- package/src/tool/websearch.ts +2 -2
- package/src/tool/write.ts +3 -3
- package/src/util/bom.ts +1 -1
- package/src/util/filesystem.ts +2 -2
- package/src/util/repository.ts +1 -1
- package/src/util/token.ts +1 -1
- package/src/worktree/index.ts +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"name": "soraacode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
32
|
+
"@soraacode/core": "workspace:*",
|
|
33
|
+
"@soraacode/http-recorder": "workspace:*",
|
|
34
|
+
"@soraacode/script": "workspace:*",
|
|
35
35
|
"@tsconfig/bun": "catalog:",
|
|
36
36
|
"@types/bun": "catalog:",
|
|
37
37
|
"@types/cross-spawn": "catalog:",
|
|
@@ -49,33 +49,23 @@
|
|
|
49
49
|
"@ai-sdk/provider": "3.0.16",
|
|
50
50
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
51
51
|
"@effect/platform-node": "catalog:",
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@opencode-ai/sdk": "workspace:*",
|
|
61
|
-
"@opencode-ai/server": "workspace:*",
|
|
62
|
-
"@openrouter/ai-sdk-provider": "2.9.0",
|
|
63
|
-
"@parcel/watcher": "2.5.1",
|
|
64
|
-
"@silvia-odwyer/photon-node": "0.3.4",
|
|
52
|
+
"@soraacode/codemode": "workspace:*",
|
|
53
|
+
"@soraacode/llm": "workspace:*",
|
|
54
|
+
"@soraacode/plugin": "workspace:*",
|
|
55
|
+
"@soraacode/protocol": "workspace:*",
|
|
56
|
+
"@soraacode/schema": "workspace:*",
|
|
57
|
+
"@soraacode/script": "workspace:*",
|
|
58
|
+
"@soraacode/sdk": "workspace:*",
|
|
59
|
+
"@soraacode/server": "workspace:*",
|
|
65
60
|
"@types/ws": "8.18.1",
|
|
66
61
|
"ai": "catalog:",
|
|
67
|
-
"ai-gateway-provider": "3.2.0",
|
|
68
|
-
"bonjour-service": "1.3.0",
|
|
69
62
|
"cross-spawn": "catalog:",
|
|
70
63
|
"decimal.js": "10.5.0",
|
|
71
64
|
"diff": "catalog:",
|
|
72
65
|
"drizzle-orm": "catalog:",
|
|
73
66
|
"effect": "catalog:",
|
|
74
67
|
"fuzzysort": "3.1.0",
|
|
75
|
-
"gitlab-ai-provider": "6.15.0",
|
|
76
68
|
"glob": "13.0.5",
|
|
77
|
-
"google-auth-library": "10.5.0",
|
|
78
|
-
"gray-matter": "4.0.3",
|
|
79
69
|
"htmlparser2": "8.0.2",
|
|
80
70
|
"ignore": "7.0.5",
|
|
81
71
|
"immer": "11.1.4",
|
|
@@ -84,8 +74,6 @@
|
|
|
84
74
|
"minimatch": "10.0.3",
|
|
85
75
|
"npm-package-arg": "13.0.2",
|
|
86
76
|
"open": "10.1.2",
|
|
87
|
-
"opencode-gitlab-auth": "2.1.0",
|
|
88
|
-
"opencode-poe-auth": "0.0.1",
|
|
89
77
|
"remeda": "catalog:",
|
|
90
78
|
"semver": "^7.6.3",
|
|
91
79
|
"strip-ansi": "7.1.2",
|
|
@@ -93,8 +81,6 @@
|
|
|
93
81
|
"tree-sitter-powershell": "0.25.10",
|
|
94
82
|
"turndown": "7.2.0",
|
|
95
83
|
"ulid": "catalog:",
|
|
96
|
-
"venice-ai-sdk-provider": "2.1.1",
|
|
97
|
-
"vscode-jsonrpc": "8.2.1",
|
|
98
84
|
"web-tree-sitter": "0.25.10",
|
|
99
85
|
"ws": "8.21.0",
|
|
100
86
|
"xdg-basedir": "5.1.0",
|
package/parsers-config.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "@
|
|
1
|
+
export { default } from "@soraacode/tui/parsers-config"
|
package/script/bench-search.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from "effect"
|
|
2
|
-
import { Fff } from "@
|
|
2
|
+
import { Fff } from "@soraacode/core/filesystem/fff.bun"
|
|
3
3
|
import { AppRuntime } from "@/effect/app-runtime"
|
|
4
|
-
import { FileSystem } from "@
|
|
5
|
-
import { AbsolutePath } from "@
|
|
4
|
+
import { FileSystem } from "@soraacode/core/filesystem"
|
|
5
|
+
import { AbsolutePath } from "@soraacode/core/schema"
|
|
6
6
|
import { InstanceStore } from "@/project/instance-store"
|
|
7
7
|
|
|
8
8
|
const dir = AbsolutePath.make(process.cwd())
|
package/script/build.ts
CHANGED
|
@@ -12,7 +12,7 @@ process.chdir(dir)
|
|
|
12
12
|
|
|
13
13
|
const generated = await import("./generate.ts")
|
|
14
14
|
|
|
15
|
-
import { Script } from "@
|
|
15
|
+
import { Script } from "@soraacode/script"
|
|
16
16
|
import pkg from "../package.json"
|
|
17
17
|
|
|
18
18
|
const singleFlag = process.argv.includes("--single")
|
package/script/publish.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { $ } from "bun"
|
|
3
3
|
import pkg from "../package.json"
|
|
4
|
-
import { Script } from "@
|
|
4
|
+
import { Script } from "@soraacode/script"
|
|
5
5
|
import { fileURLToPath } from "url"
|
|
6
6
|
|
|
7
7
|
const dir = fileURLToPath(new URL("..", import.meta.url))
|
package/script/schema.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { Config } from "@/config/config"
|
|
4
|
-
import { ConfigV1 } from "@
|
|
5
|
-
import { TuiConfig } from "@
|
|
4
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
5
|
+
import { TuiConfig } from "@soraacode/tui/config"
|
|
6
6
|
import { Schema } from "effect"
|
|
7
7
|
|
|
8
8
|
type JsonSchema = Record<string, unknown>
|
package/specs/tui-plugins.md
CHANGED
|
@@ -5,7 +5,7 @@ Technical reference for the current TUI plugin system.
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
- TUI plugin config lives in `tui.json`.
|
|
8
|
-
- Author package entrypoint is `@
|
|
8
|
+
- Author package entrypoint is `@soraacode/plugin/tui`.
|
|
9
9
|
- Internal plugins load inside the CLI app the same way external TUI plugins do.
|
|
10
10
|
- Package plugins can be installed from CLI or TUI.
|
|
11
11
|
- v1 plugin modules are target-exclusive: a module can export `server` or `tui`, never both.
|
|
@@ -68,14 +68,14 @@ Example:
|
|
|
68
68
|
|
|
69
69
|
Package entrypoint:
|
|
70
70
|
|
|
71
|
-
- Import types from `@
|
|
72
|
-
- `@
|
|
71
|
+
- Import types from `@soraacode/plugin/tui`.
|
|
72
|
+
- `@soraacode/plugin` exports `./tui` and declares optional peer deps on `@opentui/core` and `@opentui/solid`.
|
|
73
73
|
|
|
74
74
|
Minimal module shape:
|
|
75
75
|
|
|
76
76
|
```tsx
|
|
77
77
|
/** @jsxImportSource @opentui/solid */
|
|
78
|
-
import type { TuiPlugin, TuiPluginModule } from "@
|
|
78
|
+
import type { TuiPlugin, TuiPluginModule } from "@soraacode/plugin/tui"
|
|
79
79
|
|
|
80
80
|
const tui: TuiPlugin = async (api, options, meta) => {
|
|
81
81
|
api.keymap.registerLayer({
|
|
@@ -213,14 +213,14 @@ npm plugins can declare a version compatibility range in `package.json` using th
|
|
|
213
213
|
- There is no uninstall, list, or update CLI command for external plugins.
|
|
214
214
|
- Local file plugins are configured directly in `tui.json`.
|
|
215
215
|
|
|
216
|
-
When `plugin` entries exist in a writable `.opencode` dir or `OPENCODE_CONFIG_DIR`, OpenCode installs `@
|
|
216
|
+
When `plugin` entries exist in a writable `.opencode` dir or `OPENCODE_CONFIG_DIR`, OpenCode installs `@soraacode/plugin` into that dir and writes:
|
|
217
217
|
|
|
218
218
|
- `package.json`
|
|
219
219
|
- `bun.lock`
|
|
220
220
|
- `node_modules/`
|
|
221
221
|
- `.gitignore`
|
|
222
222
|
|
|
223
|
-
That is what makes local config-scoped plugins able to import `@
|
|
223
|
+
That is what makes local config-scoped plugins able to import `@soraacode/plugin/tui`.
|
|
224
224
|
|
|
225
225
|
## TUI plugin API
|
|
226
226
|
|
|
@@ -323,7 +323,7 @@ Mode pushes are automatically tracked by the plugin runtime. If a plugin is disa
|
|
|
323
323
|
- `api.keys` exposes host-formatted shortcut display helpers for plugin UI.
|
|
324
324
|
- `formatSequence(parts)` formats parsed key sequence parts using the host's display policy.
|
|
325
325
|
- `formatBindings(bindings)` formats binding lists and returns `undefined` when there is nothing to show.
|
|
326
|
-
- For generic config-to-bindings helpers, import `createBindingLookup` from `@
|
|
326
|
+
- For generic config-to-bindings helpers, import `createBindingLookup` from `@soraacode/plugin/tui`.
|
|
327
327
|
|
|
328
328
|
### Attention
|
|
329
329
|
|
package/specs/v2/api.ts
CHANGED
package/src/account/account.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { httpClient } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { httpClient } from "@soraacode/core/effect/app-node-platform"
|
|
3
3
|
import { Cache, Clock, Duration, Effect, Layer, Option, Schema, SchemaGetter, Context } from "effect"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
5
5
|
import {
|
|
6
6
|
FetchHttpClient,
|
|
7
7
|
HttpClient,
|
package/src/account/repo.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { eq } from "drizzle-orm"
|
|
3
|
-
import { serviceUse } from "@
|
|
3
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
4
4
|
import { Effect, Layer, Option, Schema, Context } from "effect"
|
|
5
5
|
|
|
6
|
-
import { Database } from "@
|
|
7
|
-
import { AccountStateTable, AccountTable } from "@
|
|
6
|
+
import { Database } from "@soraacode/core/database/database"
|
|
7
|
+
import { AccountStateTable, AccountTable } from "@soraacode/core/account/sql"
|
|
8
8
|
import { AccessToken, AccountID, AccountRepoError, Info, OrgID, RefreshToken } from "./schema"
|
|
9
9
|
import { normalizeServerUrl } from "./url"
|
|
10
10
|
|
package/src/acp/agent.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
type SetSessionModeRequest,
|
|
18
18
|
} from "@agentclientprotocol/sdk"
|
|
19
19
|
import { Effect } from "effect"
|
|
20
|
-
import type { OpencodeClient } from "@
|
|
20
|
+
import type { OpencodeClient } from "@soraacode/sdk/v2"
|
|
21
21
|
import * as ACPError from "./error"
|
|
22
22
|
import * as ACPService from "./service"
|
|
23
23
|
|
package/src/acp/content.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ContentBlock, ContentChunk, ResourceLink, Role } from "@agentclientprotocol/sdk"
|
|
2
2
|
import path from "node:path"
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url"
|
|
4
|
-
import { SessionV1 } from "@
|
|
4
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
5
5
|
|
|
6
6
|
export type PromptPart = SessionV1.TextPartInput | SessionV1.FilePartInput
|
|
7
7
|
|
package/src/acp/directory.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Command } from "@/command"
|
|
|
3
3
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
4
4
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
5
5
|
import { InstanceStore } from "@/project/instance-store"
|
|
6
|
-
import { LayerNode } from "@
|
|
7
|
-
import { ProviderV2 } from "@
|
|
8
|
-
import { ModelV2 } from "@
|
|
6
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
7
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
8
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
9
9
|
import { Provider } from "@/provider/provider"
|
|
10
10
|
import { Context, Effect, Layer, SynchronizedRef } from "effect"
|
|
11
11
|
import type * as ACPError from "./error"
|
package/src/acp/event.ts
CHANGED
package/src/acp/permission.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
ToolCallLocation,
|
|
7
7
|
ToolCallUpdate,
|
|
8
8
|
} from "@agentclientprotocol/sdk"
|
|
9
|
-
import type { Event, OpencodeClient } from "@
|
|
9
|
+
import type { Event, OpencodeClient } from "@soraacode/sdk/v2"
|
|
10
10
|
import { applyPatch } from "diff"
|
|
11
11
|
import { exists, readText } from "@/util/filesystem"
|
|
12
12
|
import type { ACPSession } from "./session"
|
package/src/acp/service.ts
CHANGED
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
type SetSessionModeRequest,
|
|
30
30
|
type SetSessionModeResponse,
|
|
31
31
|
} from "@agentclientprotocol/sdk"
|
|
32
|
-
import { InstallationVersion } from "@
|
|
33
|
-
import { AppNodeBuilder } from "@
|
|
34
|
-
import type { AssistantMessage, Message, OpencodeClient, Session, SessionMessageResponse } from "@
|
|
32
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
33
|
+
import { AppNodeBuilder } from "@soraacode/core/effect/app-node-builder"
|
|
34
|
+
import type { AssistantMessage, Message, OpencodeClient, Session, SessionMessageResponse } from "@soraacode/sdk/v2"
|
|
35
35
|
import { Context, Effect, Layer, ManagedRuntime } from "effect"
|
|
36
36
|
import * as ACPError from "./error"
|
|
37
37
|
import { buildConfigOptions, DEFAULT_VARIANT_VALUE, parseModelSelection } from "./config-option"
|
|
@@ -41,8 +41,8 @@ import { ACPEvent } from "./event"
|
|
|
41
41
|
import { ACPSession } from "./session"
|
|
42
42
|
import { UsageService } from "./usage"
|
|
43
43
|
import { ACPProfile } from "./profile"
|
|
44
|
-
import { ProviderV2 } from "@
|
|
45
|
-
import { ModelV2 } from "@
|
|
44
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
45
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
46
46
|
import { Provider } from "@/provider/provider"
|
|
47
47
|
import type { Command } from "@/command"
|
|
48
48
|
|
package/src/acp/session.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { McpServer } from "@agentclientprotocol/sdk"
|
|
2
|
-
import type { Message, Part } from "@
|
|
3
|
-
import { LayerNode } from "@
|
|
4
|
-
import { ProviderV2 } from "@
|
|
5
|
-
import { ModelV2 } from "@
|
|
2
|
+
import type { Message, Part } from "@soraacode/sdk/v2"
|
|
3
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
4
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
5
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
6
6
|
import { Context, Effect, Layer, Ref } from "effect"
|
|
7
7
|
import * as ACPError from "./error"
|
|
8
8
|
|
package/src/acp/usage.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AgentSideConnection, Usage } from "@agentclientprotocol/sdk"
|
|
2
|
-
import type { AssistantMessage as OpenCodeAssistantMessage, Message } from "@
|
|
2
|
+
import type { AssistantMessage as OpenCodeAssistantMessage, Message } from "@soraacode/sdk/v2"
|
|
3
3
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
4
4
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
5
5
|
import { InstanceStore } from "@/project/instance-store"
|
|
6
|
-
import { makeGlobalNode, Node } from "@
|
|
7
|
-
import { LayerNode } from "@
|
|
8
|
-
import { ProviderV2 } from "@
|
|
9
|
-
import { ModelV2 } from "@
|
|
6
|
+
import { makeGlobalNode, Node } from "@soraacode/core/effect/app-node"
|
|
7
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
8
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
9
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
10
10
|
import { Provider } from "@/provider/provider"
|
|
11
11
|
import { Context, Effect, Layer, SynchronizedRef } from "effect"
|
|
12
12
|
|
package/src/agent/agent.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
3
3
|
import { Config } from "@/config/config"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
5
5
|
import { Provider } from "@/provider/provider"
|
|
6
6
|
|
|
7
7
|
import { generateObject, streamObject, type ModelMessage } from "ai"
|
|
@@ -16,20 +16,20 @@ import PROMPT_SUMMARY from "./prompt/summary.txt"
|
|
|
16
16
|
import PROMPT_TITLE from "./prompt/title.txt"
|
|
17
17
|
import { Permission } from "@/permission"
|
|
18
18
|
import { mergeDeep, pipe, sortBy, values } from "remeda"
|
|
19
|
-
import { Global } from "@
|
|
19
|
+
import { Global } from "@soraacode/core/global"
|
|
20
20
|
import path from "path"
|
|
21
21
|
import { Plugin } from "@/plugin"
|
|
22
22
|
import { Skill } from "../skill"
|
|
23
23
|
import { Effect, Context, Layer, Schema } from "effect"
|
|
24
24
|
import { InstanceState } from "@/effect/instance-state"
|
|
25
25
|
import * as Option from "effect/Option"
|
|
26
|
-
import { AbsolutePath, type DeepMutable } from "@
|
|
27
|
-
import { ProviderV2 } from "@
|
|
28
|
-
import { ModelV2 } from "@
|
|
29
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
30
|
-
import { Reference } from "@
|
|
31
|
-
import { Location } from "@
|
|
32
|
-
import { PluginV2 } from "@
|
|
26
|
+
import { AbsolutePath, type DeepMutable } from "@soraacode/core/schema"
|
|
27
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
28
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
29
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@soraacode/core/location-services"
|
|
30
|
+
import { Reference } from "@soraacode/core/reference"
|
|
31
|
+
import { Location } from "@soraacode/core/location"
|
|
32
|
+
import { PluginV2 } from "@soraacode/core/plugin"
|
|
33
33
|
|
|
34
34
|
export const Info = Schema.Struct({
|
|
35
35
|
name: Schema.String,
|
package/src/auth/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import path from "path"
|
|
3
3
|
import { Effect, Layer, Record, Result, Schema, Context } from "effect"
|
|
4
|
-
import { NonNegativeInt } from "@
|
|
5
|
-
import { Global } from "@
|
|
6
|
-
import { FSUtil } from "@
|
|
4
|
+
import { NonNegativeInt } from "@soraacode/core/schema"
|
|
5
|
+
import { Global } from "@soraacode/core/global"
|
|
6
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
7
7
|
|
|
8
8
|
export const OAUTH_DUMMY_KEY = "opencode-oauth-dummy-key"
|
|
9
9
|
|
package/src/background/job.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { BackgroundJob as CoreBackgroundJob } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { BackgroundJob as CoreBackgroundJob } from "@soraacode/core/background-job"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
4
|
import { Effect, Layer } from "effect"
|
|
5
5
|
|
|
@@ -12,7 +12,7 @@ export {
|
|
|
12
12
|
type Status,
|
|
13
13
|
type WaitInput,
|
|
14
14
|
type WaitResult,
|
|
15
|
-
} from "@
|
|
15
|
+
} from "@soraacode/core/background-job"
|
|
16
16
|
|
|
17
17
|
/** Keeps the legacy service instance-scoped while sharing the core registry engine. */
|
|
18
18
|
const layer = Layer.effect(
|
package/src/cli/cmd/serve.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect"
|
|
2
2
|
import { effectCmd } from "../effect-cmd"
|
|
3
3
|
import { withNetworkOptions, resolveNetworkOptions } from "../network"
|
|
4
|
-
import { Flag } from "@
|
|
4
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
5
5
|
|
|
6
6
|
export const ServeCommand = effectCmd({
|
|
7
7
|
command: "serve",
|
package/src/cli/error.ts
CHANGED
package/src/cli/heap.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "path"
|
|
2
2
|
import { writeHeapSnapshot } from "node:v8"
|
|
3
|
-
import { Flag } from "@
|
|
4
|
-
import { Global } from "@
|
|
3
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
4
|
+
import { Global } from "@soraacode/core/global"
|
|
5
5
|
const MINUTE = 60_000
|
|
6
6
|
const LIMIT = 2 * 1024 * 1024 * 1024
|
|
7
7
|
|
package/src/cli/network.ts
CHANGED
package/src/command/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import path from "path"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
4
|
import { EffectBridge } from "@/effect/bridge"
|
|
@@ -9,7 +9,7 @@ import { MCP } from "../mcp"
|
|
|
9
9
|
import { Skill } from "../skill"
|
|
10
10
|
import PROMPT_INITIALIZE from "./template/initialize.txt"
|
|
11
11
|
import PROMPT_REVIEW from "./template/review.txt"
|
|
12
|
-
import { LegacyEvent } from "@
|
|
12
|
+
import { LegacyEvent } from "@soraacode/schema/legacy-event"
|
|
13
13
|
|
|
14
14
|
type State = {
|
|
15
15
|
commands: Record<string, Info>
|
package/src/config/agent.ts
CHANGED
|
@@ -2,8 +2,8 @@ export * as ConfigAgent from "./agent"
|
|
|
2
2
|
|
|
3
3
|
import path from "path"
|
|
4
4
|
import { Exit, Schema } from "effect"
|
|
5
|
-
import { Glob } from "@
|
|
6
|
-
import { ConfigAgentV1 } from "@
|
|
5
|
+
import { Glob } from "@soraacode/core/util/glob"
|
|
6
|
+
import { ConfigAgentV1 } from "@soraacode/core/v1/config/agent"
|
|
7
7
|
import { configEntryNameFromPath } from "./entry-name"
|
|
8
8
|
import * as ConfigMarkdown from "./markdown"
|
|
9
9
|
import { ConfigParse } from "./parse"
|
package/src/config/command.ts
CHANGED
|
@@ -2,10 +2,10 @@ export * as ConfigCommand from "./command"
|
|
|
2
2
|
|
|
3
3
|
import path from "path"
|
|
4
4
|
import { Cause, Exit, Schema } from "effect"
|
|
5
|
-
import { Glob } from "@
|
|
6
|
-
import { ConfigCommandV1 } from "@
|
|
5
|
+
import { Glob } from "@soraacode/core/util/glob"
|
|
6
|
+
import { ConfigCommandV1 } from "@soraacode/core/v1/config/command"
|
|
7
7
|
import { configEntryNameFromPath } from "./entry-name"
|
|
8
|
-
import { InvalidError } from "@
|
|
8
|
+
import { InvalidError } from "@soraacode/core/v1/config/error"
|
|
9
9
|
import * as ConfigMarkdown from "./markdown"
|
|
10
10
|
|
|
11
11
|
const decodeInfo = Schema.decodeUnknownExit(ConfigCommandV1.Info)
|
package/src/config/config.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { httpClient } from "@
|
|
3
|
-
import { serviceUse } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { httpClient } from "@soraacode/core/effect/app-node-platform"
|
|
3
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
4
4
|
import path from "path"
|
|
5
5
|
import { pathToFileURL } from "url"
|
|
6
6
|
import os from "os"
|
|
7
7
|
import { mergeDeep } from "remeda"
|
|
8
|
-
import { Global } from "@
|
|
8
|
+
import { Global } from "@soraacode/core/global"
|
|
9
9
|
import fsNode from "fs/promises"
|
|
10
|
-
import { Flag } from "@
|
|
10
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
11
11
|
import { Auth } from "../auth"
|
|
12
12
|
import { Env } from "../env"
|
|
13
13
|
import { applyEdits, modify } from "jsonc-parser"
|
|
14
|
-
import { InstallationLocal, InstallationVersion } from "@
|
|
14
|
+
import { InstallationLocal, InstallationVersion } from "@soraacode/core/installation/version"
|
|
15
15
|
|
|
16
16
|
import { Account } from "@/account/account"
|
|
17
17
|
import { isRecord } from "@/util/record"
|
|
18
|
-
import type { ConsoleState } from "@
|
|
19
|
-
import { FSUtil } from "@
|
|
18
|
+
import type { ConsoleState } from "@soraacode/core/v1/config/console-state"
|
|
19
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
20
20
|
import { InstanceState } from "@/effect/instance-state"
|
|
21
21
|
import { Context, Duration, Effect, Exit, Fiber, Layer, Option, Schema } from "effect"
|
|
22
22
|
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"
|
|
23
|
-
import { EffectFlock } from "@
|
|
23
|
+
import { EffectFlock } from "@soraacode/core/util/effect-flock"
|
|
24
24
|
import { containsPath, type InstanceContext } from "../project/instance-context"
|
|
25
|
-
import { ConfigV1 } from "@
|
|
26
|
-
import { RemoteAuthError } from "@
|
|
27
|
-
import { ConfigPermissionV1 } from "@
|
|
28
|
-
import { ConfigPluginV1 } from "@
|
|
25
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
26
|
+
import { RemoteAuthError } from "@soraacode/core/v1/config/error"
|
|
27
|
+
import { ConfigPermissionV1 } from "@soraacode/core/v1/config/permission"
|
|
28
|
+
import { ConfigPluginV1 } from "@soraacode/core/v1/config/plugin"
|
|
29
29
|
import { ConfigAgent } from "./agent"
|
|
30
30
|
import { ConfigCommand } from "./command"
|
|
31
31
|
import { ConfigManaged } from "./managed"
|
|
@@ -34,7 +34,7 @@ import { ConfigPaths } from "./paths"
|
|
|
34
34
|
import { ConfigPlugin } from "./plugin"
|
|
35
35
|
import { ConfigVariable } from "./variable"
|
|
36
36
|
import { ConfigV2Compat } from "./v2-compat"
|
|
37
|
-
import { Npm } from "@
|
|
37
|
+
import { Npm } from "@soraacode/core/npm"
|
|
38
38
|
import { withTransientReadRetry } from "@/util/effect-http-client"
|
|
39
39
|
|
|
40
40
|
// Custom merge function that concatenates array fields instead of replacing them
|
|
@@ -458,7 +458,7 @@ const layer = Layer.effect(
|
|
|
458
458
|
.install(dir, {
|
|
459
459
|
add: [
|
|
460
460
|
{
|
|
461
|
-
name: "@
|
|
461
|
+
name: "@soraacode/plugin",
|
|
462
462
|
version: InstallationLocal ? undefined : InstallationVersion,
|
|
463
463
|
},
|
|
464
464
|
],
|
package/src/config/markdown.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Filesystem } from "@/util/filesystem"
|
|
2
|
-
import { FrontmatterError } from "@
|
|
3
|
-
import { ConfigMarkdown as ConfigMarkdownCore } from "@
|
|
2
|
+
import { FrontmatterError } from "@soraacode/core/v1/config/error"
|
|
3
|
+
import { ConfigMarkdown as ConfigMarkdownCore } from "@soraacode/core/config/markdown"
|
|
4
4
|
|
|
5
5
|
export const FILE_REGEX = /(?<![\w`])@(\.?[^\s`,.]*(?:\.[^\s`,.]+)*)/g
|
|
6
6
|
export const SHELL_REGEX = /!`([^`]+)`/g
|
package/src/config/parse.ts
CHANGED
|
@@ -2,8 +2,8 @@ export * as ConfigParse from "./parse"
|
|
|
2
2
|
|
|
3
3
|
import { type ParseError as JsoncParseError, parse as parseJsoncImpl, printParseErrorCode } from "jsonc-parser"
|
|
4
4
|
import { Cause, Exit, Schema as EffectSchema, SchemaIssue } from "effect"
|
|
5
|
-
import type { DeepMutable } from "@
|
|
6
|
-
import { InvalidError, JsonError } from "@
|
|
5
|
+
import type { DeepMutable } from "@soraacode/core/schema"
|
|
6
|
+
import { InvalidError, JsonError } from "@soraacode/core/v1/config/error"
|
|
7
7
|
|
|
8
8
|
export function jsonc(text: string, filepath: string): unknown {
|
|
9
9
|
const errors: JsoncParseError[] = []
|
package/src/config/paths.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * as ConfigPaths from "./paths"
|
|
2
2
|
|
|
3
3
|
import path from "path"
|
|
4
|
-
import { Flag } from "@
|
|
5
|
-
import { Global } from "@
|
|
4
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
5
|
+
import { Global } from "@soraacode/core/global"
|
|
6
6
|
import { unique } from "remeda"
|
|
7
7
|
import * as Effect from "effect/Effect"
|
|
8
|
-
import { FSUtil } from "@
|
|
8
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
9
9
|
|
|
10
10
|
export const files = Effect.fn("ConfigPaths.projectFiles")(function* (
|
|
11
11
|
name: string,
|
package/src/config/plugin.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Glob } from "@
|
|
2
|
-
import { ConfigPluginV1 } from "@
|
|
1
|
+
import { Glob } from "@soraacode/core/util/glob"
|
|
2
|
+
import { ConfigPluginV1 } from "@soraacode/core/v1/config/plugin"
|
|
3
3
|
import { pathToFileURL } from "url"
|
|
4
4
|
import { isPathPluginSpec, parsePluginSpecifier, resolvePathPluginTarget } from "@/plugin/shared"
|
|
5
5
|
import path from "path"
|