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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
2
2
|
import { Agent } from "@/agent/agent"
|
|
3
|
-
import { SessionV1 } from "@
|
|
3
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
4
4
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
5
5
|
import { Command } from "@/command"
|
|
6
6
|
import { Permission } from "@/permission"
|
|
@@ -15,7 +15,7 @@ import { SessionStatus } from "@/session/status"
|
|
|
15
15
|
import { SessionSummary } from "@/session/summary"
|
|
16
16
|
import { Todo } from "@/session/todo"
|
|
17
17
|
import { MessageID, PartID, SessionID } from "@/session/schema"
|
|
18
|
-
import { NamedError } from "@
|
|
18
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
19
19
|
import { Cause, Effect, Option, Schema, Scope } from "effect"
|
|
20
20
|
import * as Stream from "effect/Stream"
|
|
21
21
|
import { InstanceState } from "@/effect/instance-state"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Workspace } from "@/control-plane/workspace"
|
|
2
2
|
import * as InstanceState from "@/effect/instance-state"
|
|
3
3
|
import { Session } from "@/session/session"
|
|
4
|
-
import { Database } from "@
|
|
5
|
-
import { EventV2 } from "@
|
|
4
|
+
import { Database } from "@soraacode/core/database/database"
|
|
5
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
6
6
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
7
|
-
import { EventTable } from "@
|
|
7
|
+
import { EventTable } from "@soraacode/core/event/sql"
|
|
8
8
|
import { asc } from "drizzle-orm"
|
|
9
9
|
import { and } from "drizzle-orm"
|
|
10
10
|
import { eq } from "drizzle-orm"
|
|
@@ -7,7 +7,7 @@ import { isPublicUIPath } from "@/server/shared/public-ui"
|
|
|
7
7
|
export {
|
|
8
8
|
Authorization as ServerAuthorization,
|
|
9
9
|
authorizationLayer as serverAuthorizationLayer,
|
|
10
|
-
} from "@
|
|
10
|
+
} from "@soraacode/server/middleware/authorization"
|
|
11
11
|
|
|
12
12
|
const AUTH_TOKEN_QUERY = "auth_token"
|
|
13
13
|
const UNAUTHORIZED = 401
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NamedError } from "@
|
|
2
|
-
import { ConfigErrorV1 } from "@
|
|
1
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
2
|
+
import { ConfigErrorV1 } from "@soraacode/core/v1/config/error"
|
|
3
3
|
import { Cause, Effect } from "effect"
|
|
4
4
|
import { HttpRouter, HttpServerError, HttpServerRespondable, HttpServerResponse } from "effect/unstable/http"
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Flag } from "@
|
|
2
|
-
import { Database } from "@
|
|
1
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
2
|
+
import { Database } from "@soraacode/core/database/database"
|
|
3
3
|
import { Effect } from "effect"
|
|
4
4
|
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/unstable/http"
|
|
5
5
|
import * as Fence from "@/server/shared/fence"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorkspaceV2 } from "@
|
|
1
|
+
import { WorkspaceV2 } from "@soraacode/core/workspace"
|
|
2
2
|
import type { Target } from "@/control-plane/types"
|
|
3
3
|
import { Workspace } from "@/control-plane/workspace"
|
|
4
4
|
import { WorkspaceAdapterRuntime } from "@/control-plane/workspace-adapter-runtime"
|
|
@@ -7,7 +7,7 @@ import { HttpApiProxy } from "./proxy"
|
|
|
7
7
|
import * as Fence from "@/server/shared/fence"
|
|
8
8
|
import { getWorkspaceRouteSessionID, isLocalWorkspaceRoute, workspaceProxyURL } from "@/server/shared/workspace-routing"
|
|
9
9
|
import { NotFoundError } from "@/storage/storage"
|
|
10
|
-
import { Flag } from "@
|
|
10
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
11
11
|
import { Context, Data, Effect, Layer, Option, Schema } from "effect"
|
|
12
12
|
import { HttpClient, HttpServerRequest, HttpServerResponse } from "effect/unstable/http"
|
|
13
13
|
import { HttpApiMiddleware } from "effect/unstable/httpapi"
|
|
@@ -2,8 +2,8 @@ import { Config as EffectConfig, Context, Effect, Layer } from "effect"
|
|
|
2
2
|
import { HttpApiBuilder, OpenApi } from "effect/unstable/httpapi"
|
|
3
3
|
import { HttpClient, HttpMiddleware, HttpRouter, HttpServer, HttpServerResponse } from "effect/unstable/http"
|
|
4
4
|
import * as Socket from "effect/unstable/socket/Socket"
|
|
5
|
-
import { FSUtil } from "@
|
|
6
|
-
import * as Observability from "@
|
|
5
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
6
|
+
import * as Observability from "@soraacode/core/observability"
|
|
7
7
|
import { Account } from "@/account/account"
|
|
8
8
|
import { Agent } from "@/agent/agent"
|
|
9
9
|
import { Auth } from "@/auth"
|
|
@@ -49,29 +49,29 @@ import { ToolRegistry } from "@/tool/registry"
|
|
|
49
49
|
import { Truncate } from "@/tool/truncate"
|
|
50
50
|
import { Worktree } from "@/worktree"
|
|
51
51
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
52
|
-
import { MoveSession } from "@
|
|
53
|
-
import { Database } from "@
|
|
52
|
+
import { MoveSession } from "@soraacode/core/control-plane/move-session"
|
|
53
|
+
import { Database } from "@soraacode/core/database/database"
|
|
54
54
|
import { AppNodeBuilderV1 } from "@/effect/app-node-builder-v1"
|
|
55
|
-
import { LayerNode } from "@
|
|
56
|
-
import { httpClient } from "@
|
|
57
|
-
import { EventV2 } from "@
|
|
58
|
-
import { ModelsDev } from "@
|
|
59
|
-
import { Npm } from "@
|
|
60
|
-
import { PermissionSaved } from "@
|
|
61
|
-
import { ProjectV2 } from "@
|
|
62
|
-
import { ProjectCopy } from "@
|
|
63
|
-
import { PtyTicket } from "@
|
|
64
|
-
import { Ripgrep } from "@
|
|
65
|
-
import { SessionProjector } from "@
|
|
66
|
-
import { SessionV2 } from "@
|
|
67
|
-
import { SessionExecution } from "@
|
|
68
|
-
import * as SessionExecutionLocal from "@
|
|
55
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
56
|
+
import { httpClient } from "@soraacode/core/effect/app-node-platform"
|
|
57
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
58
|
+
import { ModelsDev } from "@soraacode/core/models-dev"
|
|
59
|
+
import { Npm } from "@soraacode/core/npm"
|
|
60
|
+
import { PermissionSaved } from "@soraacode/core/permission/saved"
|
|
61
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
62
|
+
import { ProjectCopy } from "@soraacode/core/project/copy"
|
|
63
|
+
import { PtyTicket } from "@soraacode/core/pty/ticket"
|
|
64
|
+
import { Ripgrep } from "@soraacode/core/ripgrep"
|
|
65
|
+
import { SessionProjector } from "@soraacode/core/session/projector"
|
|
66
|
+
import { SessionV2 } from "@soraacode/core/session"
|
|
67
|
+
import { SessionExecution } from "@soraacode/core/session/execution"
|
|
68
|
+
import * as SessionExecutionLocal from "@soraacode/core/session/execution/local"
|
|
69
69
|
import { lazy } from "@/util/lazy"
|
|
70
|
-
import { CorsConfig, isAllowedCorsOrigin, type CorsOptions } from "@
|
|
70
|
+
import { CorsConfig, isAllowedCorsOrigin, type CorsOptions } from "@soraacode/server/cors"
|
|
71
71
|
import { serveUIEffect } from "@/server/shared/ui"
|
|
72
72
|
import { ServerAuth } from "@/server/auth"
|
|
73
73
|
import { InstanceHttpApi, RootHttpApi } from "./api"
|
|
74
|
-
import { Api } from "@
|
|
74
|
+
import { Api } from "@soraacode/server/api"
|
|
75
75
|
import { PublicApi } from "./public"
|
|
76
76
|
import {
|
|
77
77
|
authorizationLayer,
|
|
@@ -99,17 +99,17 @@ import { questionHandlers } from "./handlers/question"
|
|
|
99
99
|
import { sessionHandlers } from "./handlers/session"
|
|
100
100
|
import { syncHandlers } from "./handlers/sync"
|
|
101
101
|
import { tuiHandlers } from "./handlers/tui"
|
|
102
|
-
import { handlers } from "@
|
|
103
|
-
import { buildLocationServiceMap, LocationServiceMap } from "@
|
|
104
|
-
import { layer as locationLayer } from "@
|
|
105
|
-
import { sessionLocationLayer } from "@
|
|
106
|
-
import { PtyEnvironment } from "@
|
|
107
|
-
import { schemaErrorLayer as v2SchemaErrorLayer } from "@
|
|
102
|
+
import { handlers } from "@soraacode/server/handlers"
|
|
103
|
+
import { buildLocationServiceMap, LocationServiceMap } from "@soraacode/core/location-services"
|
|
104
|
+
import { layer as locationLayer } from "@soraacode/server/location"
|
|
105
|
+
import { sessionLocationLayer } from "@soraacode/server/middleware/session-location"
|
|
106
|
+
import { PtyEnvironment } from "@soraacode/server/pty-environment"
|
|
107
|
+
import { schemaErrorLayer as v2SchemaErrorLayer } from "@soraacode/server/middleware/schema-error"
|
|
108
108
|
import { workspaceHandlers } from "./handlers/workspace"
|
|
109
109
|
import { instanceContextLayer } from "./middleware/instance-context"
|
|
110
110
|
import { workspaceRoutingLayer } from "./middleware/workspace-routing"
|
|
111
111
|
import { disposeMiddleware } from "./lifecycle"
|
|
112
|
-
import { memoMap } from "@
|
|
112
|
+
import { memoMap } from "@soraacode/core/effect/memo-map"
|
|
113
113
|
import { compressionLayer } from "./middleware/compression"
|
|
114
114
|
import { corsVaryFix } from "./middleware/cors-vary"
|
|
115
115
|
import { errorLayer } from "./middleware/error"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Option } from "effect"
|
|
2
|
-
import { LayerNode } from "@
|
|
2
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
3
3
|
import * as Socket from "effect/unstable/socket/Socket"
|
|
4
4
|
|
|
5
5
|
export const SERVER_CLOSING_EVENT = () => new Socket.CloseEvent(1001, "server closing")
|
package/src/server/server.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeHttpServer } from "@effect/platform-node"
|
|
2
|
-
import { AppNodeBuilder } from "@
|
|
2
|
+
import { AppNodeBuilder } from "@soraacode/core/effect/app-node-builder"
|
|
3
3
|
import { ConfigProvider, Context, Effect, Exit, Layer, Scope } from "effect"
|
|
4
4
|
import { HttpRouter, HttpServer } from "effect/unstable/http"
|
|
5
5
|
import { OpenApi } from "effect/unstable/httpapi"
|
|
@@ -9,7 +9,7 @@ import { HttpApiApp } from "./routes/instance/httpapi/server"
|
|
|
9
9
|
import { disposeMiddleware } from "./routes/instance/httpapi/lifecycle"
|
|
10
10
|
import { WebSocketTracker } from "./routes/instance/httpapi/websocket-tracker"
|
|
11
11
|
import { PublicApi } from "./routes/instance/httpapi/public"
|
|
12
|
-
import type { CorsOptions } from "@
|
|
12
|
+
import type { CorsOptions } from "@soraacode/server/cors"
|
|
13
13
|
import { lazy } from "@/util/lazy"
|
|
14
14
|
|
|
15
15
|
// @ts-ignore This global is needed to prevent ai-sdk from logging warnings to stdout https://github.com/vercel/ai/blob/2dc67e0ef538307f21368db32d5a12345d98831b/packages/ai/src/logger/log-warnings.ts#L85
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Database } from "@
|
|
1
|
+
import { Database } from "@soraacode/core/database/database"
|
|
2
2
|
import { inArray } from "drizzle-orm"
|
|
3
|
-
import { EventSequenceTable } from "@
|
|
3
|
+
import { EventSequenceTable } from "@soraacode/core/event/sql"
|
|
4
4
|
import { Workspace } from "@/control-plane/workspace"
|
|
5
|
-
import type { WorkspaceV2 } from "@
|
|
5
|
+
import type { WorkspaceV2 } from "@soraacode/core/workspace"
|
|
6
6
|
import { Effect } from "effect"
|
|
7
7
|
|
|
8
8
|
export const HEADER = "x-opencode-sync"
|
package/src/server/shared/ui.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FSUtil } from "@
|
|
1
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
2
2
|
import { Effect, Stream } from "effect"
|
|
3
3
|
import { HttpBody, HttpClient, HttpClientRequest, HttpServerRequest, HttpServerResponse } from "effect/unstable/http"
|
|
4
4
|
import { createHash } from "node:crypto"
|
package/src/server/tui-event.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TuiEvent } from "@
|
|
1
|
+
export { TuiEvent } from "@soraacode/schema/tui-event"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { SessionV1 } from "@
|
|
3
|
-
import { ConfigV1 } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
3
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
4
4
|
import { Session } from "./session"
|
|
5
5
|
import { SessionID, MessageID, PartID } from "./schema"
|
|
6
6
|
import { Provider } from "@/provider/provider"
|
|
@@ -15,13 +15,13 @@ import { NotFoundError } from "@/storage/storage"
|
|
|
15
15
|
import { Effect, Layer, Context } from "effect"
|
|
16
16
|
import { InstanceState } from "@/effect/instance-state"
|
|
17
17
|
import { isOverflow as overflow, usable } from "./overflow"
|
|
18
|
-
import { serviceUse } from "@
|
|
18
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
19
19
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
20
20
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
21
|
-
import { ProviderV2 } from "@
|
|
22
|
-
import { ModelV2 } from "@
|
|
23
|
-
import { buildPrompt } from "@
|
|
24
|
-
import { SessionCompactionEvent } from "@
|
|
21
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
22
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
23
|
+
import { buildPrompt } from "@soraacode/core/session/compaction"
|
|
24
|
+
import { SessionCompactionEvent } from "@soraacode/schema/session-compaction-event"
|
|
25
25
|
|
|
26
26
|
export const Event = SessionCompactionEvent
|
|
27
27
|
|
|
@@ -1,16 +1,16 @@
|
|
|
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 path from "path"
|
|
4
|
-
import { SessionV1 } from "@
|
|
4
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
5
5
|
import { Effect, Layer, Context } from "effect"
|
|
6
6
|
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"
|
|
7
7
|
import { Config } from "@/config/config"
|
|
8
8
|
import { InstanceState } from "@/effect/instance-state"
|
|
9
9
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
10
|
-
import { Flag } from "@
|
|
11
|
-
import { FSUtil } from "@
|
|
10
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
11
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
12
12
|
import { withTransientReadRetry } from "@/util/effect-http-client"
|
|
13
|
-
import { Global } from "@
|
|
13
|
+
import { Global } from "@soraacode/core/global"
|
|
14
14
|
import type { MessageV2 } from "./message-v2"
|
|
15
15
|
import type { MessageID } from "./schema"
|
|
16
16
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
This folder contains adapters behind that service boundary:
|
|
6
6
|
|
|
7
|
-
- `ai-sdk.ts` converts AI SDK `fullStream` parts into `@
|
|
8
|
-
- `native-request.ts` converts opencode's normalized session input into a native `@
|
|
7
|
+
- `ai-sdk.ts` converts AI SDK `fullStream` parts into `@soraacode/llm` `LLMEvent`s. This is the default runtime path.
|
|
8
|
+
- `native-request.ts` converts opencode's normalized session input into a native `@soraacode/llm` `LLMRequest`. It does not execute requests.
|
|
9
9
|
- `native-runtime.ts` is the opt-in native runtime adapter. It decides whether a selected model is supported, builds the native request, bridges opencode tools into native executable tools, and delegates transport to `LLMClient` / `RequestExecutor`.
|
|
10
10
|
|
|
11
11
|
## File Structure
|
|
@@ -15,19 +15,19 @@ src/session/
|
|
|
15
15
|
llm.ts session-owned orchestration and runtime selection
|
|
16
16
|
llm/
|
|
17
17
|
AGENTS.md boundary notes for the adapter layer
|
|
18
|
-
ai-sdk.ts AI SDK fullStream -> @
|
|
19
|
-
native-request.ts opencode/AI SDK-shaped input -> @
|
|
18
|
+
ai-sdk.ts AI SDK fullStream -> @soraacode/llm LLMEvent adapter
|
|
19
|
+
native-request.ts opencode/AI SDK-shaped input -> @soraacode/llm LLMRequest
|
|
20
20
|
native-runtime.ts native runtime gate, tool bridge, and LLMClient handoff
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Integration points:
|
|
24
24
|
|
|
25
|
-
- `../llm.ts` imports `LLMClient` from `@
|
|
25
|
+
- `../llm.ts` imports `LLMClient` from `@soraacode/llm/route`; native execution is the only path that calls it directly.
|
|
26
26
|
- `../llm.ts` imports `LLMAISDK` from `./llm/ai-sdk`; the AI SDK path still calls `streamText(...)` locally, then adapts `result.fullStream` into shared `LLMEvent`s.
|
|
27
27
|
- `../llm.ts` imports `LLMNativeRuntime` from `./llm/native-runtime`; this is the runtime-selection seam. Unsupported native requests return a reason and fall back to AI SDK.
|
|
28
28
|
- `native-runtime.ts` imports `LLMNative` from `./native-request`; this keeps request lowering separate from transport and tool execution.
|
|
29
|
-
- `native-request.ts` is the only adapter file that should construct `LLM.request(...)`, `LLM.model(...)`, `Message.*`, `SystemPart`, `ToolCallPart`, `ToolResultPart`, or `ToolDefinition` values from `@
|
|
30
|
-
- `ai-sdk.ts` and `native-runtime.ts` both emit `@
|
|
29
|
+
- `native-request.ts` is the only adapter file that should construct `LLM.request(...)`, `LLM.model(...)`, `Message.*`, `SystemPart`, `ToolCallPart`, `ToolResultPart`, or `ToolDefinition` values from `@soraacode/llm`.
|
|
30
|
+
- `ai-sdk.ts` and `native-runtime.ts` both emit `@soraacode/llm` `LLMEvent`s so downstream session processing does not care which runtime handled the request.
|
|
31
31
|
|
|
32
32
|
Keep new integration code on one of these seams. Avoid importing session services into `native-request.ts`; pass normalized data through `RequestInput` instead.
|
|
33
33
|
|
|
@@ -80,7 +80,7 @@ Both runtimes converge on the same `LLMEvent` stream consumed by the session pro
|
|
|
80
80
|
╰─────────────────╯ ╰─────────────────────────────╯
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
`native-runtime.ts` evaluates the gate and either bridges into `@
|
|
83
|
+
`native-runtime.ts` evaluates the gate and either bridges into `@soraacode/llm` or returns control so `llm.ts` can take the AI SDK path. Tool execution stays opencode-owned in both branches; only request lowering and transport differ.
|
|
84
84
|
|
|
85
85
|
Safety boundary:
|
|
86
86
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FinishReason, LLMEvent, ProviderMetadata, ToolResultValue } from "@
|
|
1
|
+
import { FinishReason, LLMEvent, ProviderMetadata, ToolResultValue } from "@soraacode/llm"
|
|
2
2
|
import { Effect, Schema } from "effect"
|
|
3
3
|
import { type streamText } from "ai"
|
|
4
4
|
import { errorMessage } from "@/util/error"
|
|
@@ -29,7 +29,7 @@ function providerMetadata(value: unknown): ProviderMetadata | undefined {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// Temporary AI SDK bridge: Copilot billing survives only in raw provider chunks here.
|
|
32
|
-
// Move this extraction into @
|
|
32
|
+
// Move this extraction into @soraacode/llm when Copilot is handled by the native runtime.
|
|
33
33
|
function copilotTotalNanoAiu(value: unknown) {
|
|
34
34
|
if (!value || typeof value !== "object") return
|
|
35
35
|
const raw = value as Record<string, unknown>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { JsonSchema, LLMRequest, ProviderMetadata } from "@
|
|
2
|
-
import { LLM, Message, SystemPart, ToolCallPart, ToolDefinition, ToolResultPart } from "@
|
|
1
|
+
import type { JsonSchema, LLMRequest, ProviderMetadata } from "@soraacode/llm"
|
|
2
|
+
import { LLM, Message, SystemPart, ToolCallPart, ToolDefinition, ToolResultPart } from "@soraacode/llm"
|
|
3
3
|
import {
|
|
4
4
|
AmazonBedrock,
|
|
5
5
|
Anthropic,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
OpenAI,
|
|
9
9
|
OpenAICompatible,
|
|
10
10
|
OpenRouter,
|
|
11
|
-
} from "@
|
|
11
|
+
} from "@soraacode/llm/providers"
|
|
12
12
|
import type { ModelMessage } from "ai"
|
|
13
13
|
import type { Provider } from "@/provider/provider"
|
|
14
14
|
import { isRecord } from "@/util/record"
|
|
@@ -181,7 +181,7 @@ export const model = (input: Provider.Model | RequestInput, headers?: Record<str
|
|
|
181
181
|
export const request = (input: RequestInput) => {
|
|
182
182
|
const converted = messages(input.messages)
|
|
183
183
|
// This is the only native adapter boundary that should construct canonical
|
|
184
|
-
// @
|
|
184
|
+
// @soraacode/llm request objects from opencode's session/AI SDK-shaped data.
|
|
185
185
|
return LLM.request({
|
|
186
186
|
model: model(input, input.headers),
|
|
187
187
|
system: [...(input.system ?? []).map(SystemPart.make), ...converted.system],
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
toDefinitions,
|
|
16
16
|
type JsonSchema,
|
|
17
17
|
type LLMEvent,
|
|
18
|
-
} from "@
|
|
19
|
-
import type { LLMClientShape } from "@
|
|
18
|
+
} from "@soraacode/llm"
|
|
19
|
+
import type { LLMClientShape } from "@soraacode/llm/route"
|
|
20
20
|
import { LLMNative } from "./native-request"
|
|
21
21
|
|
|
22
22
|
export type RuntimeStatus =
|
|
@@ -76,7 +76,7 @@ export function stream(input: StreamInput): StreamResult {
|
|
|
76
76
|
const current = statusWithFetch(input, fetch)
|
|
77
77
|
if (current.type === "unsupported") return current
|
|
78
78
|
|
|
79
|
-
// Integration point with @
|
|
79
|
+
// Integration point with @soraacode/llm: native-request lowers session data
|
|
80
80
|
// into an LLMRequest, then LLMClient handles route selection and transport.
|
|
81
81
|
//
|
|
82
82
|
// ProviderTransform.providerOptions builds AI-SDK-shaped options for the
|
|
@@ -171,7 +171,7 @@ export function nativeTools(tools: Record<string, Tool>, input: Pick<StreamInput
|
|
|
171
171
|
Object.entries(tools).map(([name, item]) => [
|
|
172
172
|
name,
|
|
173
173
|
// Tool execution remains opencode-owned. The native runtime only adapts
|
|
174
|
-
// the @
|
|
174
|
+
// the @soraacode/llm tool call back into the AI SDK Tool.execute shape.
|
|
175
175
|
NativeTool.make({
|
|
176
176
|
description: item.description ?? "",
|
|
177
177
|
jsonSchema: nativeSchema(item.inputSchema),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
2
2
|
import type { Auth } from "@/auth"
|
|
3
|
-
import { SessionV1 } from "@
|
|
3
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
4
4
|
import type { RuntimeFlags } from "@/effect/runtime-flags"
|
|
5
5
|
import { InstanceState } from "@/effect/instance-state"
|
|
6
6
|
import { Permission } from "@/permission"
|
|
@@ -9,7 +9,7 @@ import type { MessageV2 } from "../message-v2"
|
|
|
9
9
|
import type { Provider } from "@/provider/provider"
|
|
10
10
|
import { ProviderTransform } from "@/provider/transform"
|
|
11
11
|
import { SystemPrompt } from "../system"
|
|
12
|
-
import { InstallationVersion } from "@
|
|
12
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
13
13
|
import { Effect, Record } from "effect"
|
|
14
14
|
import { jsonSchema, tool as aiTool, type ModelMessage, type Tool } from "ai"
|
|
15
15
|
import type { Plugin } from "@/plugin"
|
package/src/session/llm.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { llmClient } from "@
|
|
3
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { llmClient } from "@soraacode/core/effect/app-node-platform"
|
|
3
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
4
4
|
import { Provider } from "@/provider/provider"
|
|
5
|
-
import { SessionV1 } from "@
|
|
6
|
-
import { serviceUse } from "@
|
|
5
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
6
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
7
7
|
import { Context, Effect, Layer } from "effect"
|
|
8
8
|
import * as Stream from "effect/Stream"
|
|
9
9
|
import { streamText, wrapLanguageModel, type ModelMessage, type Tool } from "ai"
|
|
10
|
-
import type { LLMEvent } from "@
|
|
11
|
-
import { LLMClient } from "@
|
|
12
|
-
import type { LLMClientService } from "@
|
|
10
|
+
import type { LLMEvent } from "@soraacode/llm"
|
|
11
|
+
import { LLMClient } from "@soraacode/llm/route"
|
|
12
|
+
import type { LLMClientService } from "@soraacode/llm/route"
|
|
13
13
|
import { GitLabWorkflowLanguageModel } from "gitlab-ai-provider"
|
|
14
14
|
import { ProviderTransform } from "@/provider/transform"
|
|
15
15
|
import { Config } from "@/config/config"
|
|
@@ -18,7 +18,7 @@ import type { MessageV2 } from "./message-v2"
|
|
|
18
18
|
import { Plugin } from "@/plugin"
|
|
19
19
|
import { Permission } from "@/permission"
|
|
20
20
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
21
|
-
import { EventV2 } from "@
|
|
21
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
22
22
|
import { Wildcard } from "@/util/wildcard"
|
|
23
23
|
import { SessionID } from "@/session/schema"
|
|
24
24
|
import { Auth } from "@/auth"
|
|
@@ -207,7 +207,7 @@ const live: Layer.Layer<
|
|
|
207
207
|
const tracer = undefined
|
|
208
208
|
const telemetryTracer = undefined
|
|
209
209
|
|
|
210
|
-
// Runtime seam: native is an opt-in adapter over @
|
|
210
|
+
// Runtime seam: native is an opt-in adapter over @soraacode/llm. It
|
|
211
211
|
// either returns a ready LLMEvent stream or a concrete fallback reason.
|
|
212
212
|
if (flags.experimentalNativeLlm) {
|
|
213
213
|
const native = LLMNativeRuntime.stream({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SessionID, MessageID } from "./schema"
|
|
2
|
-
import { SessionV1 } from "@
|
|
3
|
-
import { ProviderV2 } from "@
|
|
2
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
3
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
4
4
|
import {
|
|
5
5
|
APIError,
|
|
6
6
|
AbortedError,
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
SubtaskPart,
|
|
15
15
|
User,
|
|
16
16
|
WithParts,
|
|
17
|
-
} from "@
|
|
17
|
+
} from "@soraacode/core/v1/session"
|
|
18
18
|
|
|
19
|
-
import { NamedError } from "@
|
|
19
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
20
20
|
import { APICallError, convertToModelMessages, LoadAPIKeyError, type ModelMessage, type UIMessage } from "ai"
|
|
21
|
-
import { Database } from "@
|
|
22
|
-
import { LayerNode } from "@
|
|
21
|
+
import { Database } from "@soraacode/core/database/database"
|
|
22
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
23
23
|
import { NotFoundError } from "@/storage/storage"
|
|
24
24
|
import { and } from "drizzle-orm"
|
|
25
25
|
import { desc } from "drizzle-orm"
|
|
@@ -27,7 +27,7 @@ import { eq } from "drizzle-orm"
|
|
|
27
27
|
import { inArray } from "drizzle-orm"
|
|
28
28
|
import { lt } from "drizzle-orm"
|
|
29
29
|
import { or } from "drizzle-orm"
|
|
30
|
-
import { MessageTable, PartTable, SessionTable } from "@
|
|
30
|
+
import { MessageTable, PartTable, SessionTable } from "@soraacode/core/session/sql"
|
|
31
31
|
import { ProviderError } from "@/provider/error"
|
|
32
32
|
import { iife } from "@/util/iife"
|
|
33
33
|
import { errorMessage } from "@/util/error"
|
package/src/session/message.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
2
|
import { SessionID } from "./schema"
|
|
3
3
|
|
|
4
|
-
import { NonNegativeInt } from "@
|
|
4
|
+
import { NonNegativeInt } from "@soraacode/core/schema"
|
|
5
5
|
import { MessageError } from "./message-error"
|
|
6
6
|
import { AuthError, OutputLengthError } from "./message-error"
|
|
7
|
-
import { ProviderV2 } from "@
|
|
8
|
-
import { ModelV2 } from "@
|
|
7
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
8
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
9
9
|
export { AuthError, OutputLengthError } from "./message-error"
|
|
10
10
|
|
|
11
11
|
export const ToolCall = Schema.Struct({
|
package/src/session/overflow.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from "@/config/config"
|
|
2
|
-
import { ConfigV1 } from "@
|
|
3
|
-
import { SessionV1 } from "@
|
|
2
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
3
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
4
4
|
import type { Provider } from "@/provider/provider"
|
|
5
5
|
import { ProviderTransform } from "@/provider/transform"
|
|
6
6
|
import type { MessageV2 } from "./message-v2"
|
package/src/session/processor.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 { Image } from "@/image/image"
|
|
4
|
-
import { SessionV1 } from "@
|
|
4
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
5
5
|
import { Cause, Deferred, Effect, Exit, Layer, Context, Scope, Schema } from "effect"
|
|
6
6
|
import * as Stream from "effect/Stream"
|
|
7
7
|
import { Agent } from "@/agent/agent"
|
|
@@ -23,8 +23,8 @@ import { Question } from "@/question"
|
|
|
23
23
|
import { errorMessage } from "@/util/error"
|
|
24
24
|
import { isRecord } from "@/util/record"
|
|
25
25
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
26
|
-
import { Database } from "@
|
|
27
|
-
import { Usage, type LLMEvent } from "@
|
|
26
|
+
import { Database } from "@soraacode/core/database/database"
|
|
27
|
+
import { Usage, type LLMEvent } from "@soraacode/llm"
|
|
28
28
|
|
|
29
29
|
const DOOM_LOOP_THRESHOLD = 3
|
|
30
30
|
export type Result = "compact" | "stop" | "continue"
|
package/src/session/prompt.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 path from "path"
|
|
4
|
-
import { SessionV1 } from "@
|
|
4
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
5
5
|
import os from "os"
|
|
6
6
|
import { SessionID, MessageID, PartID } from "./schema"
|
|
7
7
|
import { MessageV2 } from "./message-v2"
|
|
@@ -16,28 +16,28 @@ import { SessionCompaction } from "./compaction"
|
|
|
16
16
|
import { SystemPrompt } from "./system"
|
|
17
17
|
import { Instruction } from "./instruction"
|
|
18
18
|
import { Plugin } from "../plugin"
|
|
19
|
-
import { MAX_STEPS_PROMPT } from "@
|
|
19
|
+
import { MAX_STEPS_PROMPT } from "@soraacode/core/session/runner/max-steps"
|
|
20
20
|
import { ToolRegistry } from "@/tool/registry"
|
|
21
21
|
import { MCP } from "../mcp"
|
|
22
22
|
import { LSP } from "@/lsp/lsp"
|
|
23
23
|
import { ulid } from "ulid"
|
|
24
24
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
|
|
25
|
-
import { CrossSpawnSpawner } from "@
|
|
25
|
+
import { CrossSpawnSpawner } from "@soraacode/core/cross-spawn-spawner"
|
|
26
26
|
import * as Stream from "effect/Stream"
|
|
27
27
|
import { Command } from "../command"
|
|
28
28
|
import { pathToFileURL, fileURLToPath } from "url"
|
|
29
29
|
import { Config } from "@/config/config"
|
|
30
30
|
import { ConfigMarkdown } from "@/config/markdown"
|
|
31
31
|
import { SessionSummary } from "./summary"
|
|
32
|
-
import { NamedError } from "@
|
|
32
|
+
import { NamedError } from "@soraacode/core/util/error"
|
|
33
33
|
import { SessionProcessor } from "./processor"
|
|
34
34
|
import { Tool } from "@/tool/tool"
|
|
35
35
|
import { Permission } from "@/permission"
|
|
36
36
|
import { SessionStatus } from "./status"
|
|
37
37
|
import { LLM } from "./llm"
|
|
38
|
-
import { Shell } from "@
|
|
38
|
+
import { Shell } from "@soraacode/core/shell"
|
|
39
39
|
import { ShellID } from "@/tool/shell/id"
|
|
40
|
-
import { FSUtil } from "@
|
|
40
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
41
41
|
import { Truncate } from "@/tool/truncate"
|
|
42
42
|
import { Image } from "@/image/image"
|
|
43
43
|
import { decodeDataUrl } from "@/util/data-url"
|
|
@@ -48,14 +48,14 @@ import { TaskTool, type TaskPromptOps } from "@/tool/task"
|
|
|
48
48
|
import { SessionRunState } from "./run-state"
|
|
49
49
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
50
50
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
51
|
-
import { Database } from "@
|
|
52
|
-
import { ModelV2 } from "@
|
|
53
|
-
import { ProviderV2 } from "@
|
|
51
|
+
import { Database } from "@soraacode/core/database/database"
|
|
52
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
53
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
54
54
|
import { eq } from "drizzle-orm"
|
|
55
|
-
import { SessionTable } from "@
|
|
55
|
+
import { SessionTable } from "@soraacode/core/session/sql"
|
|
56
56
|
import { SessionReminders } from "./reminders"
|
|
57
57
|
import { SessionTools } from "./tools"
|
|
58
|
-
import { LLMEvent } from "@
|
|
58
|
+
import { LLMEvent } from "@soraacode/llm"
|
|
59
59
|
|
|
60
60
|
// @ts-ignore
|
|
61
61
|
globalThis.AI_SDK_LOG_WARNINGS = false
|