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/src/config/v2-compat.ts
CHANGED
|
@@ -2,10 +2,10 @@ export * as ConfigV2Compat from "./v2-compat"
|
|
|
2
2
|
|
|
3
3
|
import { isDeepStrictEqual } from "node:util"
|
|
4
4
|
import { Option, Schema } from "effect"
|
|
5
|
-
import { NonNegativeInt, PositiveInt } from "@
|
|
6
|
-
import { ConfigAttachmentV1 } from "@
|
|
7
|
-
import { ConfigLSPV1 } from "@
|
|
8
|
-
import { InvalidError } from "@
|
|
5
|
+
import { NonNegativeInt, PositiveInt } from "@soraacode/core/schema"
|
|
6
|
+
import { ConfigAttachmentV1 } from "@soraacode/core/v1/config/attachment"
|
|
7
|
+
import { ConfigLSPV1 } from "@soraacode/core/v1/config/lsp"
|
|
8
|
+
import { InvalidError } from "@soraacode/core/v1/config/error"
|
|
9
9
|
|
|
10
10
|
export interface Diagnostic {
|
|
11
11
|
readonly kind: "invalid" | "unsupported" | "conflict"
|
package/src/config/variable.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * as ConfigVariable from "./variable"
|
|
|
3
3
|
import path from "path"
|
|
4
4
|
import os from "os"
|
|
5
5
|
import { Filesystem } from "@/util/filesystem"
|
|
6
|
-
import { InvalidError } from "@
|
|
6
|
+
import { InvalidError } from "@soraacode/core/v1/config/error"
|
|
7
7
|
|
|
8
8
|
type ParseSource =
|
|
9
9
|
| {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema, Struct } from "effect"
|
|
2
|
-
import { ProjectV2 } from "@
|
|
2
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
3
3
|
import type { InstanceContext } from "@/project/instance-context"
|
|
4
|
-
import { WorkspaceV2 } from "@
|
|
5
|
-
import type { DeepMutable } from "@
|
|
4
|
+
import { WorkspaceV2 } from "@soraacode/core/workspace"
|
|
5
|
+
import type { DeepMutable } from "@soraacode/core/schema"
|
|
6
6
|
|
|
7
7
|
export const WorkspaceInfo = Schema.Struct({
|
|
8
8
|
id: WorkspaceV2.ID,
|
|
@@ -1,29 +1,29 @@
|
|
|
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 { Context, Effect, FiberMap, Iterable, Layer, Schema, Stream } from "effect"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
5
5
|
import { FetchHttpClient, HttpBody, HttpClient, HttpClientError, HttpClientRequest } from "effect/unstable/http"
|
|
6
|
-
import { Database } from "@
|
|
6
|
+
import { Database } from "@soraacode/core/database/database"
|
|
7
7
|
import { asc } from "drizzle-orm"
|
|
8
8
|
import { eq } from "drizzle-orm"
|
|
9
9
|
import { inArray } from "drizzle-orm"
|
|
10
10
|
import { Project } from "@/project/project"
|
|
11
11
|
import { GlobalBus } from "@/bus/global"
|
|
12
12
|
import { Auth } from "@/auth"
|
|
13
|
-
import { EventV2 } from "@
|
|
13
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
14
14
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
15
|
-
import { EventSequenceTable, EventTable } from "@
|
|
16
|
-
import { FSUtil } from "@
|
|
15
|
+
import { EventSequenceTable, EventTable } from "@soraacode/core/event/sql"
|
|
16
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
17
17
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
18
|
-
import { ProjectV2 } from "@
|
|
19
|
-
import { Slug } from "@
|
|
20
|
-
import { WorkspaceTable } from "@
|
|
18
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
19
|
+
import { Slug } from "@soraacode/core/util/slug"
|
|
20
|
+
import { WorkspaceTable } from "@soraacode/core/control-plane/workspace.sql"
|
|
21
21
|
import { getAdapter, registeredAdapters } from "./adapters"
|
|
22
22
|
import { type Target, type WorkspaceInfo, WorkspaceInfo as WorkspaceInfoSchema } from "./types"
|
|
23
|
-
import { WorkspaceV2 } from "@
|
|
23
|
+
import { WorkspaceV2 } from "@soraacode/core/workspace"
|
|
24
24
|
import { Session } from "@/session/session"
|
|
25
25
|
import { SessionPrompt } from "@/session/prompt"
|
|
26
|
-
import { SessionTable } from "@
|
|
26
|
+
import { SessionTable } from "@soraacode/core/session/sql"
|
|
27
27
|
import { SessionID } from "@/session/schema"
|
|
28
28
|
import { NotFoundError } from "@/storage/storage"
|
|
29
29
|
import { errorData } from "@/util/error"
|
|
@@ -33,7 +33,7 @@ import { Vcs } from "@/project/vcs"
|
|
|
33
33
|
import { InstanceStore } from "@/project/instance-store"
|
|
34
34
|
import { WorkspaceAdapterRuntime } from "./workspace-adapter-runtime"
|
|
35
35
|
import { AppNodeBuilderV1 } from "@/effect/app-node-builder-v1"
|
|
36
|
-
import { WorkspaceEvent } from "@
|
|
36
|
+
import { WorkspaceEvent } from "@soraacode/schema/workspace-event"
|
|
37
37
|
|
|
38
38
|
export const Info = Schema.Struct({
|
|
39
39
|
...WorkspaceInfoSchema.fields,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppNodeBuilder } from "@
|
|
2
|
-
import { LayerNode } from "@
|
|
1
|
+
import { AppNodeBuilder } from "@soraacode/core/effect/app-node-builder"
|
|
2
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
3
3
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
4
4
|
import { InstanceStore } from "@/project/instance-store"
|
|
5
5
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Layer, ManagedRuntime } from "effect"
|
|
2
2
|
import { attach } from "./run-service"
|
|
3
|
-
import * as Observability from "@
|
|
3
|
+
import * as Observability from "@soraacode/core/observability"
|
|
4
4
|
|
|
5
|
-
import { FSUtil } from "@
|
|
6
|
-
import { Database } from "@
|
|
5
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
6
|
+
import { Database } from "@soraacode/core/database/database"
|
|
7
7
|
import { Auth } from "@/auth"
|
|
8
8
|
import { Account } from "@/account/account"
|
|
9
9
|
import { Config } from "@/config/config"
|
|
10
10
|
import { Git } from "@/git"
|
|
11
|
-
import { Ripgrep } from "@
|
|
11
|
+
import { Ripgrep } from "@soraacode/core/ripgrep"
|
|
12
12
|
import { Storage } from "@/storage/storage"
|
|
13
13
|
import { Snapshot } from "@/snapshot"
|
|
14
14
|
import { Plugin } from "@/plugin"
|
|
15
|
-
import { ModelsDev } from "@
|
|
15
|
+
import { ModelsDev } from "@soraacode/core/models-dev"
|
|
16
16
|
import { Provider } from "@/provider/provider"
|
|
17
17
|
import { ProviderAuth } from "@/provider/auth"
|
|
18
18
|
import { Agent } from "@/agent/agent"
|
|
@@ -46,14 +46,14 @@ import { Worktree } from "@/worktree"
|
|
|
46
46
|
import { Installation } from "@/installation"
|
|
47
47
|
import { ShareNext } from "@/share/share-next"
|
|
48
48
|
import { SessionShare } from "@/share/session"
|
|
49
|
-
import { Npm } from "@
|
|
50
|
-
import { memoMap } from "@
|
|
49
|
+
import { Npm } from "@soraacode/core/npm"
|
|
50
|
+
import { memoMap } from "@soraacode/core/effect/memo-map"
|
|
51
51
|
import { BackgroundJob } from "@/background/job"
|
|
52
52
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
53
53
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
54
|
-
import { LayerNode } from "@
|
|
54
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
55
55
|
import { AppNodeBuilderV1 } from "./app-node-builder-v1"
|
|
56
|
-
import { SessionProjector } from "@
|
|
56
|
+
import { SessionProjector } from "@soraacode/core/session/projector"
|
|
57
57
|
|
|
58
58
|
export const AppLayer = AppNodeBuilderV1.build(
|
|
59
59
|
LayerNode.group([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Layer, ManagedRuntime } from "effect"
|
|
2
|
-
import { AppNodeBuilder } from "@
|
|
3
|
-
import { LayerNode } from "@
|
|
2
|
+
import { AppNodeBuilder } from "@soraacode/core/effect/app-node-builder"
|
|
3
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
4
4
|
|
|
5
5
|
import { Plugin } from "@/plugin"
|
|
6
6
|
import { LSP } from "@/lsp/lsp"
|
|
@@ -9,8 +9,8 @@ import { ShareNext } from "@/share/share-next"
|
|
|
9
9
|
import { Vcs } from "@/project/vcs"
|
|
10
10
|
import { Snapshot } from "@/snapshot"
|
|
11
11
|
import { Config } from "@/config/config"
|
|
12
|
-
import * as Observability from "@
|
|
13
|
-
import { memoMap } from "@
|
|
12
|
+
import * as Observability from "@soraacode/core/observability"
|
|
13
|
+
import { memoMap } from "@soraacode/core/effect/memo-map"
|
|
14
14
|
|
|
15
15
|
export const BootstrapLayer = AppNodeBuilder.build(
|
|
16
16
|
LayerNode.group([Config.node, Plugin.node, ShareNext.node, Format.node, LSP.node, Vcs.node, Snapshot.node]),
|
package/src/effect/bridge.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, Exit, Fiber } from "effect"
|
|
2
2
|
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
|
3
|
-
import type { WorkspaceV2 } from "@
|
|
3
|
+
import type { WorkspaceV2 } from "@soraacode/core/workspace"
|
|
4
4
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
|
5
5
|
import { attachWith } from "./run-service"
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "effect"
|
|
2
2
|
import type { InstanceContext } from "@/project/instance-context"
|
|
3
|
-
import type { WorkspaceV2 } from "@
|
|
3
|
+
import type { WorkspaceV2 } from "@soraacode/core/workspace"
|
|
4
4
|
|
|
5
5
|
export const InstanceRef = Context.Reference<InstanceContext | undefined>("~opencode/InstanceRef", {
|
|
6
6
|
defaultValue: () => undefined,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Fiber, Layer, ManagedRuntime } from "effect"
|
|
2
2
|
import * as Context from "effect/Context"
|
|
3
3
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
|
4
|
-
import * as Observability from "@
|
|
4
|
+
import * as Observability from "@soraacode/core/observability"
|
|
5
5
|
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
|
6
6
|
import type { InstanceContext } from "@/project/instance-context"
|
|
7
|
-
import { memoMap } from "@
|
|
7
|
+
import { memoMap } from "@soraacode/core/effect/memo-map"
|
|
8
8
|
|
|
9
9
|
type Refs = {
|
|
10
10
|
instance?: InstanceContext
|
|
@@ -75,4 +75,4 @@ export const layer = (overrides: Partial<Info> = {}) =>
|
|
|
75
75
|
export const node = LayerNode.make({ service: Service, layer: Service.layer.pipe(Layer.orDie), deps: [] })
|
|
76
76
|
|
|
77
77
|
export * as RuntimeFlags from "./runtime-flags"
|
|
78
|
-
import { LayerNode } from "@
|
|
78
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
package/src/env/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { Context, Effect, Layer } from "effect"
|
|
3
|
-
import { serviceUse } from "@
|
|
3
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
4
4
|
import { InstanceState } from "@/effect/instance-state"
|
|
5
5
|
|
|
6
6
|
type State = Record<string, string | undefined>
|
package/src/event-manifest.ts
CHANGED
package/src/event-v2-bridge.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Opencode publish boundary for core events. Attach routed instance location
|
|
2
2
|
// so direct EventV2 consumers can isolate directory/workspace streams.
|
|
3
|
-
import { LayerNode } from "@
|
|
3
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
4
4
|
import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref"
|
|
5
5
|
import { GlobalBus } from "@/bus/global"
|
|
6
|
-
import { EventV2 } from "@
|
|
7
|
-
import { Location } from "@
|
|
8
|
-
import { Project } from "@
|
|
9
|
-
import { AbsolutePath } from "@
|
|
6
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
7
|
+
import { Location } from "@soraacode/core/location"
|
|
8
|
+
import { Project } from "@soraacode/core/project"
|
|
9
|
+
import { AbsolutePath } from "@soraacode/core/schema"
|
|
10
10
|
import { Context, Effect, Layer } from "effect"
|
|
11
11
|
|
|
12
12
|
export class Service extends Context.Service<Service, EventV2.Interface>()("@opencode/EventV2Bridge") {}
|
package/src/format/formatter.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Npm } from "@
|
|
1
|
+
import { Npm } from "@soraacode/core/npm"
|
|
2
2
|
import type { InstanceContext } from "../project/instance-context"
|
|
3
3
|
import { Filesystem } from "@/util/filesystem"
|
|
4
4
|
import { Process } from "@/util/process"
|
|
5
|
-
import { which } from "@
|
|
5
|
+
import { which } from "@soraacode/core/util/which"
|
|
6
6
|
|
|
7
7
|
export interface Context extends Pick<InstanceContext, "directory" | "worktree"> {
|
|
8
8
|
experimentalOxfmt: boolean
|
package/src/format/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { Effect, Layer, Context, Schema } from "effect"
|
|
3
|
-
import { serviceUse } from "@
|
|
3
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
4
4
|
import { ChildProcess } from "effect/unstable/process"
|
|
5
|
-
import { AppProcess } from "@
|
|
5
|
+
import { AppProcess } from "@soraacode/core/process"
|
|
6
6
|
import { InstanceState } from "@/effect/instance-state"
|
|
7
7
|
import path from "path"
|
|
8
8
|
import { mergeDeep } from "remeda"
|
package/src/git/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { AppProcess } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { AppProcess } from "@soraacode/core/process"
|
|
3
3
|
import { Effect, Layer, Context, Stream } from "effect"
|
|
4
4
|
import { ChildProcess } from "effect/unstable/process"
|
|
5
5
|
|
package/src/ide/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
|
-
import { NamedError } from "@
|
|
2
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
3
3
|
import { Process } from "@/util/process"
|
|
4
|
-
import { IdeEvent } from "@
|
|
4
|
+
import { IdeEvent } from "@soraacode/schema/ide-event"
|
|
5
5
|
|
|
6
6
|
const SUPPORTED_IDES = [
|
|
7
7
|
{ name: "Windsurf" as const, cmd: "windsurf" },
|
package/src/image/image.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { Config } from "@/config/config"
|
|
3
|
-
import { SessionV1 } from "@
|
|
3
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
4
4
|
import type { MessageV2 } from "@/session/message-v2"
|
|
5
5
|
import photonWasm from "@silvia-odwyer/photon-node/photon_rs_bg.wasm" with { type: "file" }
|
|
6
6
|
import { Context, Effect, Layer, Schema } from "effect"
|
package/src/index-headless.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import yargs from "yargs"
|
|
2
2
|
import { hideBin } from "yargs/helpers"
|
|
3
|
-
import { InstallationVersion } from "@
|
|
3
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
4
4
|
import { FormatError } from "./cli/error"
|
|
5
5
|
import { ServeCommand } from "./cli/cmd/serve"
|
|
6
6
|
import { EOL } from "os"
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import yargs from "yargs"
|
|
2
2
|
import { hideBin } from "yargs/helpers"
|
|
3
3
|
import { UI } from "./cli/ui"
|
|
4
|
-
import { InstallationVersion } from "@
|
|
4
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
5
5
|
import { FormatError } from "./cli/error"
|
|
6
6
|
import { ServeCommand } from "./cli/cmd/serve"
|
|
7
7
|
import { EOL } from "os"
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { AppNodeBuilder } from "@
|
|
3
|
-
import { httpClient } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { AppNodeBuilder } from "@soraacode/core/effect/app-node-builder"
|
|
3
|
+
import { httpClient } from "@soraacode/core/effect/app-node-platform"
|
|
4
4
|
import { Effect, Layer, Schema, Context, Stream } from "effect"
|
|
5
|
-
import { serviceUse } from "@
|
|
5
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
6
6
|
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
|
|
7
7
|
import { withTransientReadRetry } from "@/util/effect-http-client"
|
|
8
8
|
import { errorMessage } from "@/util/error"
|
|
9
9
|
import { ChildProcess } from "effect/unstable/process"
|
|
10
|
-
import { AppProcess } from "@
|
|
10
|
+
import { AppProcess } from "@soraacode/core/process"
|
|
11
11
|
import path from "path"
|
|
12
|
-
import { makeRuntime } from "@
|
|
12
|
+
import { makeRuntime } from "@soraacode/core/effect/runtime"
|
|
13
13
|
import semver from "semver"
|
|
14
|
-
import { InstallationChannel, InstallationVersion } from "@
|
|
15
|
-
import { NpmConfig } from "@
|
|
16
|
-
import { InstallationEvent } from "@
|
|
14
|
+
import { InstallationChannel, InstallationVersion } from "@soraacode/core/installation/version"
|
|
15
|
+
import { NpmConfig } from "@soraacode/core/npm-config"
|
|
16
|
+
import { InstallationEvent } from "@soraacode/schema/installation-event"
|
|
17
17
|
|
|
18
18
|
export type Method = "curl" | "npm" | "yarn" | "pnpm" | "bun" | "brew" | "scoop" | "choco" | "unknown"
|
|
19
19
|
|
package/src/lsp/lsp.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { FSUtil } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
3
3
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
4
4
|
import * as LSPClient from "./client"
|
|
5
5
|
import path from "path"
|
|
@@ -11,9 +11,9 @@ import { spawn as lspspawn } from "./launch"
|
|
|
11
11
|
import { Effect, Layer, Context, Schema } from "effect"
|
|
12
12
|
import { InstanceState } from "@/effect/instance-state"
|
|
13
13
|
import { containsPath } from "@/project/instance-context"
|
|
14
|
-
import { NonNegativeInt } from "@
|
|
14
|
+
import { NonNegativeInt } from "@soraacode/core/schema"
|
|
15
15
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
16
|
-
import { LspEvent } from "@
|
|
16
|
+
import { LspEvent } from "@soraacode/schema/lsp-event"
|
|
17
17
|
|
|
18
18
|
export const Event = LspEvent
|
|
19
19
|
|
package/src/lsp/server.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { ChildProcessWithoutNullStreams } from "child_process"
|
|
2
2
|
import path from "path"
|
|
3
3
|
import os from "os"
|
|
4
|
-
import { Global } from "@
|
|
4
|
+
import { Global } from "@soraacode/core/global"
|
|
5
5
|
import { text } from "node:stream/consumers"
|
|
6
6
|
import fs from "fs/promises"
|
|
7
7
|
import { Filesystem } from "@/util/filesystem"
|
|
8
8
|
import type { InstanceContext } from "../project/instance-context"
|
|
9
9
|
import { Archive } from "@/util/archive"
|
|
10
10
|
import { Process } from "@/util/process"
|
|
11
|
-
import { which } from "@
|
|
12
|
-
import { Module } from "@
|
|
11
|
+
import { which } from "@soraacode/core/util/which"
|
|
12
|
+
import { Module } from "@soraacode/core/util/module"
|
|
13
13
|
import { spawn } from "./launch"
|
|
14
|
-
import { Npm } from "@
|
|
14
|
+
import { Npm } from "@soraacode/core/npm"
|
|
15
15
|
import type { RuntimeFlags } from "@/effect/runtime-flags"
|
|
16
16
|
|
|
17
17
|
const pathExists = async (p: string) =>
|
package/src/mcp/auth.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import path from "path"
|
|
3
|
-
import { serviceUse } from "@
|
|
4
|
-
import { Global } from "@
|
|
3
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
4
|
+
import { Global } from "@soraacode/core/global"
|
|
5
5
|
import { Effect, Layer, Context, Option, Schema } from "effect"
|
|
6
|
-
import { FSUtil } from "@
|
|
7
|
-
import { EffectFlock } from "@
|
|
6
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
7
|
+
import { EffectFlock } from "@soraacode/core/util/effect-flock"
|
|
8
8
|
|
|
9
9
|
export const Tokens = Schema.Struct({
|
|
10
10
|
accessToken: Schema.mutableKey(Schema.String),
|
package/src/mcp/browser.ts
CHANGED
package/src/mcp/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path"
|
|
2
2
|
import { pathToFileURL } from "node:url"
|
|
3
|
-
import { LayerNode } from "@
|
|
4
|
-
import { ConfigV1 } from "@
|
|
5
|
-
import { serviceUse } from "@
|
|
3
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
4
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
5
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
6
6
|
import { Client, type ClientOptions } from "@modelcontextprotocol/sdk/client/index.js"
|
|
7
7
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
|
|
8
8
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
ToolListChangedNotificationSchema,
|
|
17
17
|
} from "@modelcontextprotocol/sdk/types.js"
|
|
18
18
|
import { Config } from "@/config/config"
|
|
19
|
-
import { ConfigMCPV1 } from "@
|
|
20
|
-
import { NamedError } from "@
|
|
21
|
-
import { InstallationVersion } from "@
|
|
19
|
+
import { ConfigMCPV1 } from "@soraacode/core/v1/config/mcp"
|
|
20
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
21
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
22
22
|
import { withTimeout } from "@/util/timeout"
|
|
23
|
-
import { FSUtil } from "@
|
|
23
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
24
24
|
import { McpOAuthPendingProvider, McpOAuthProvider, OAUTH_CALLBACK_PATH } from "./oauth-provider"
|
|
25
25
|
import { McpOAuthCallback } from "./oauth-callback"
|
|
26
26
|
import { McpAuth } from "./auth"
|
|
@@ -30,9 +30,9 @@ import { Cause, Effect, Exit, Layer, Context, Schema, Stream } from "effect"
|
|
|
30
30
|
import { EffectBridge } from "@/effect/bridge"
|
|
31
31
|
import { InstanceState } from "@/effect/instance-state"
|
|
32
32
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
|
|
33
|
-
import { CrossSpawnSpawner } from "@
|
|
33
|
+
import { CrossSpawnSpawner } from "@soraacode/core/cross-spawn-spawner"
|
|
34
34
|
import { McpCatalog } from "./catalog"
|
|
35
|
-
import { McpEvent } from "@
|
|
35
|
+
import { McpEvent } from "@soraacode/schema/mcp-event"
|
|
36
36
|
import { McpBrowser } from "./browser"
|
|
37
37
|
|
|
38
38
|
const DEFAULT_TIMEOUT = 30_000
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createConnection } from "net"
|
|
2
2
|
import { createServer } from "http"
|
|
3
|
-
import { OauthCallbackPage } from "@
|
|
3
|
+
import { OauthCallbackPage } from "@soraacode/core/oauth/page"
|
|
4
4
|
import { OAUTH_CALLBACK_PORT, OAUTH_CALLBACK_PATH, parseRedirectUri } from "./oauth-provider"
|
|
5
5
|
|
|
6
6
|
const OAUTH_CALLBACK_HOST = "127.0.0.1"
|
package/src/node.ts
CHANGED
package/src/patch/index.ts
CHANGED
package/src/permission/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { ConfigPermissionV1 } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { ConfigPermissionV1 } from "@soraacode/core/v1/config/permission"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
|
-
import { Wildcard } from "@
|
|
4
|
+
import { Wildcard } from "@soraacode/core/util/wildcard"
|
|
5
5
|
import { Deferred, Effect, Layer, Context } from "effect"
|
|
6
6
|
import os from "os"
|
|
7
|
-
import { PermissionV1 } from "@
|
|
7
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
8
8
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
9
9
|
|
|
10
10
|
export const Event = PermissionV1.Event
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Hooks, PluginInput } from "@
|
|
2
|
-
import type { Model } from "@
|
|
3
|
-
import { InstallationVersion } from "@
|
|
1
|
+
import type { Hooks, PluginInput } from "@soraacode/plugin"
|
|
2
|
+
import type { Model } from "@soraacode/sdk/v2"
|
|
3
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
4
4
|
import { iife } from "@/util/iife"
|
|
5
5
|
import { setTimeout as sleep } from "node:timers/promises"
|
|
6
6
|
import { CopilotModels } from "./models"
|
package/src/plugin/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import type {
|
|
3
3
|
Hooks,
|
|
4
4
|
PluginInput,
|
|
5
5
|
Plugin as PluginInstance,
|
|
6
6
|
PluginModule,
|
|
7
7
|
WorkspaceAdapter as PluginWorkspaceAdapter,
|
|
8
|
-
} from "@
|
|
8
|
+
} from "@soraacode/plugin"
|
|
9
9
|
import { Config } from "@/config/config"
|
|
10
|
-
import { createOpencodeClient } from "@
|
|
10
|
+
import { createOpencodeClient } from "@soraacode/sdk"
|
|
11
11
|
import { ServerAuth } from "@/server/auth"
|
|
12
12
|
import { CodexAuthPlugin } from "./openai/codex"
|
|
13
13
|
import { CopilotAuthPlugin } from "./github-copilot/copilot"
|
|
14
14
|
import { Session } from "@/session/session"
|
|
15
|
-
import { NamedError } from "@
|
|
15
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
16
16
|
import { Effect, Layer, Context } from "effect"
|
|
17
17
|
import { EffectBridge } from "@/effect/bridge"
|
|
18
18
|
import { InstanceState } from "@/effect/instance-state"
|
|
@@ -23,7 +23,7 @@ import { registerAdapter } from "@/control-plane/adapters"
|
|
|
23
23
|
import type { WorkspaceAdapter } from "@/control-plane/types"
|
|
24
24
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
25
25
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
26
|
-
import { InstallationChannel } from "@
|
|
26
|
+
import { InstallationChannel } from "@soraacode/core/installation/version"
|
|
27
27
|
|
|
28
28
|
type State = {
|
|
29
29
|
hooks: Hooks[]
|
package/src/plugin/install.ts
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "jsonc-parser"
|
|
9
9
|
|
|
10
10
|
import * as ConfigPaths from "@/config/paths"
|
|
11
|
-
import { Global } from "@
|
|
11
|
+
import { Global } from "@soraacode/core/global"
|
|
12
12
|
import { Filesystem } from "@/util/filesystem"
|
|
13
|
-
import { Flock } from "@
|
|
13
|
+
import { Flock } from "@soraacode/core/util/flock"
|
|
14
14
|
import { isRecord } from "@/util/record"
|
|
15
15
|
|
|
16
16
|
import { parsePluginSpecifier, readPackageThemes, readPluginPackage, resolvePluginTarget } from "./shared"
|
package/src/plugin/loader.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
type PluginSource,
|
|
10
10
|
} from "./shared"
|
|
11
11
|
import { ConfigPlugin } from "@/config/plugin"
|
|
12
|
-
import { ConfigPluginV1 } from "@
|
|
13
|
-
import { InstallationVersion } from "@
|
|
12
|
+
import { ConfigPluginV1 } from "@soraacode/core/v1/config/plugin"
|
|
13
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
14
14
|
|
|
15
15
|
export namespace PluginLoader {
|
|
16
16
|
// A normalized plugin declaration derived from config before any filesystem or npm work happens.
|
package/src/plugin/meta.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import path from "path"
|
|
2
2
|
import { fileURLToPath } from "url"
|
|
3
3
|
|
|
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 { Filesystem } from "@/util/filesystem"
|
|
7
|
-
import { Flock } from "@
|
|
7
|
+
import { Flock } from "@soraacode/core/util/flock"
|
|
8
8
|
|
|
9
9
|
import { parsePluginSpecifier, pluginSource } from "./shared"
|
|
10
10
|
|