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.
Files changed (188) hide show
  1. package/package.json +12 -26
  2. package/parsers-config.ts +1 -1
  3. package/script/bench-search.ts +3 -3
  4. package/script/build.ts +1 -1
  5. package/script/publish.ts +1 -1
  6. package/script/schema.ts +2 -2
  7. package/specs/tui-plugins.md +7 -7
  8. package/specs/v2/api.ts +2 -2
  9. package/src/account/account.ts +3 -3
  10. package/src/account/repo.ts +4 -4
  11. package/src/acp/agent.ts +1 -1
  12. package/src/acp/content.ts +1 -1
  13. package/src/acp/directory.ts +3 -3
  14. package/src/acp/event.ts +1 -1
  15. package/src/acp/permission.ts +1 -1
  16. package/src/acp/service.ts +5 -5
  17. package/src/acp/session.ts +4 -4
  18. package/src/acp/usage.ts +5 -5
  19. package/src/agent/agent.ts +11 -11
  20. package/src/agent/subagent-permissions.ts +1 -1
  21. package/src/auth/index.ts +4 -4
  22. package/src/background/job.ts +3 -3
  23. package/src/cli/cmd/serve.ts +1 -1
  24. package/src/cli/error.ts +1 -1
  25. package/src/cli/heap.ts +2 -2
  26. package/src/cli/network.ts +1 -1
  27. package/src/command/index.ts +2 -2
  28. package/src/config/agent.ts +2 -2
  29. package/src/config/command.ts +3 -3
  30. package/src/config/config.ts +15 -15
  31. package/src/config/markdown.ts +2 -2
  32. package/src/config/parse.ts +2 -2
  33. package/src/config/paths.ts +3 -3
  34. package/src/config/plugin.ts +2 -2
  35. package/src/config/v2-compat.ts +4 -4
  36. package/src/config/variable.ts +1 -1
  37. package/src/control-plane/adapters/index.ts +1 -1
  38. package/src/control-plane/dev/debug-workspace-plugin.ts +1 -1
  39. package/src/control-plane/types.ts +3 -3
  40. package/src/control-plane/workspace-context.ts +1 -1
  41. package/src/control-plane/workspace.ts +13 -13
  42. package/src/effect/app-node-builder-v1.ts +2 -2
  43. package/src/effect/app-runtime.ts +9 -9
  44. package/src/effect/bootstrap-runtime.ts +4 -4
  45. package/src/effect/bridge.ts +1 -1
  46. package/src/effect/instance-ref.ts +1 -1
  47. package/src/effect/run-service.ts +2 -2
  48. package/src/effect/runtime-flags.ts +1 -1
  49. package/src/env/index.ts +2 -2
  50. package/src/event-manifest.ts +1 -1
  51. package/src/event-v2-bridge.ts +5 -5
  52. package/src/format/formatter.ts +2 -2
  53. package/src/format/index.ts +3 -3
  54. package/src/git/index.ts +2 -2
  55. package/src/ide/index.ts +2 -2
  56. package/src/image/image.ts +2 -2
  57. package/src/index-headless.ts +1 -1
  58. package/src/index.ts +1 -1
  59. package/src/installation/index.ts +9 -9
  60. package/src/lsp/lsp.ts +4 -4
  61. package/src/lsp/server.ts +4 -4
  62. package/src/mcp/auth.ts +5 -5
  63. package/src/mcp/browser.ts +1 -1
  64. package/src/mcp/index.ts +9 -9
  65. package/src/mcp/oauth-callback.ts +1 -1
  66. package/src/node.ts +1 -1
  67. package/src/patch/index.ts +1 -1
  68. package/src/permission/index.ts +4 -4
  69. package/src/plugin/github-copilot/copilot.ts +3 -3
  70. package/src/plugin/github-copilot/models.ts +1 -1
  71. package/src/plugin/index.ts +5 -5
  72. package/src/plugin/install.ts +2 -2
  73. package/src/plugin/loader.ts +2 -2
  74. package/src/plugin/meta.ts +3 -3
  75. package/src/plugin/openai/codex.ts +3 -3
  76. package/src/plugin/pty-environment.ts +1 -1
  77. package/src/plugin/shared.ts +1 -1
  78. package/src/project/bootstrap.ts +1 -1
  79. package/src/project/instance-context.ts +1 -1
  80. package/src/project/instance-store.ts +4 -4
  81. package/src/project/project.ts +16 -16
  82. package/src/project/vcs.ts +4 -4
  83. package/src/provider/auth.ts +5 -5
  84. package/src/provider/error.ts +2 -2
  85. package/src/provider/model-status.ts +1 -1
  86. package/src/provider/provider.ts +13 -13
  87. package/src/provider/transform.ts +1 -1
  88. package/src/question/index.ts +2 -2
  89. package/src/question/schema.ts +1 -1
  90. package/src/server/auth.ts +1 -1
  91. package/src/server/event.ts +1 -1
  92. package/src/server/routes/instance/httpapi/api.ts +7 -7
  93. package/src/server/routes/instance/httpapi/groups/config.ts +1 -1
  94. package/src/server/routes/instance/httpapi/groups/control-plane.ts +1 -1
  95. package/src/server/routes/instance/httpapi/groups/control.ts +1 -1
  96. package/src/server/routes/instance/httpapi/groups/experimental.ts +3 -3
  97. package/src/server/routes/instance/httpapi/groups/file.ts +2 -2
  98. package/src/server/routes/instance/httpapi/groups/global.ts +3 -3
  99. package/src/server/routes/instance/httpapi/groups/mcp.ts +1 -1
  100. package/src/server/routes/instance/httpapi/groups/permission.ts +1 -1
  101. package/src/server/routes/instance/httpapi/groups/project-copy.ts +1 -1
  102. package/src/server/routes/instance/httpapi/groups/project.ts +1 -1
  103. package/src/server/routes/instance/httpapi/groups/provider.ts +1 -1
  104. package/src/server/routes/instance/httpapi/groups/pty.ts +3 -3
  105. package/src/server/routes/instance/httpapi/groups/session.ts +4 -4
  106. package/src/server/routes/instance/httpapi/groups/sync.ts +2 -2
  107. package/src/server/routes/instance/httpapi/handlers/control-plane.ts +2 -2
  108. package/src/server/routes/instance/httpapi/handlers/control.ts +1 -1
  109. package/src/server/routes/instance/httpapi/handlers/event.ts +1 -1
  110. package/src/server/routes/instance/httpapi/handlers/file.ts +6 -6
  111. package/src/server/routes/instance/httpapi/handlers/global.ts +2 -2
  112. package/src/server/routes/instance/httpapi/handlers/instance.ts +1 -1
  113. package/src/server/routes/instance/httpapi/handlers/permission.ts +1 -1
  114. package/src/server/routes/instance/httpapi/handlers/project-copy.ts +2 -2
  115. package/src/server/routes/instance/httpapi/handlers/project.ts +1 -1
  116. package/src/server/routes/instance/httpapi/handlers/provider.ts +2 -2
  117. package/src/server/routes/instance/httpapi/handlers/pty.ts +9 -9
  118. package/src/server/routes/instance/httpapi/handlers/session.ts +3 -3
  119. package/src/server/routes/instance/httpapi/handlers/sync.ts +3 -3
  120. package/src/server/routes/instance/httpapi/middleware/authorization.ts +1 -1
  121. package/src/server/routes/instance/httpapi/middleware/error.ts +2 -2
  122. package/src/server/routes/instance/httpapi/middleware/fence.ts +2 -2
  123. package/src/server/routes/instance/httpapi/middleware/workspace-routing.ts +2 -2
  124. package/src/server/routes/instance/httpapi/server.ts +27 -27
  125. package/src/server/routes/instance/httpapi/websocket-tracker.ts +1 -1
  126. package/src/server/server.ts +2 -2
  127. package/src/server/shared/fence.ts +3 -3
  128. package/src/server/shared/ui.ts +1 -1
  129. package/src/server/tui-event.ts +1 -1
  130. package/src/session/compaction.ts +8 -8
  131. package/src/session/instruction.ts +6 -6
  132. package/src/session/llm/AGENTS.md +8 -8
  133. package/src/session/llm/ai-sdk.ts +2 -2
  134. package/src/session/llm/native-request.ts +4 -4
  135. package/src/session/llm/native-runtime.ts +4 -4
  136. package/src/session/llm/request.ts +3 -3
  137. package/src/session/llm.ts +10 -10
  138. package/src/session/message-error.ts +1 -1
  139. package/src/session/message-v2.ts +7 -7
  140. package/src/session/message.ts +3 -3
  141. package/src/session/overflow.ts +2 -2
  142. package/src/session/processor.ts +5 -5
  143. package/src/session/prompt.ts +13 -13
  144. package/src/session/reminders.ts +2 -2
  145. package/src/session/retry.ts +2 -2
  146. package/src/session/revert.ts +2 -2
  147. package/src/session/run-state.ts +2 -2
  148. package/src/session/schema.ts +2 -2
  149. package/src/session/session.ts +20 -20
  150. package/src/session/status.ts +2 -2
  151. package/src/session/summary.ts +2 -2
  152. package/src/session/system.ts +6 -6
  153. package/src/session/todo.ts +4 -4
  154. package/src/session/tools.ts +3 -3
  155. package/src/share/session.ts +1 -1
  156. package/src/share/share-next.ts +9 -9
  157. package/src/skill/discovery.ts +4 -4
  158. package/src/skill/index.ts +7 -7
  159. package/src/snapshot/index.ts +6 -6
  160. package/src/storage/schema.ts +5 -5
  161. package/src/storage/storage.ts +4 -4
  162. package/src/sync/schema.ts +1 -1
  163. package/src/temporary.ts +1 -1
  164. package/src/tool/apply_patch.ts +3 -3
  165. package/src/tool/code-mode.ts +1 -1
  166. package/src/tool/edit.ts +3 -3
  167. package/src/tool/external-directory.ts +1 -1
  168. package/src/tool/glob.ts +2 -2
  169. package/src/tool/grep.ts +2 -2
  170. package/src/tool/lsp.ts +1 -1
  171. package/src/tool/plan.ts +1 -1
  172. package/src/tool/read.ts +2 -2
  173. package/src/tool/registry.ts +11 -11
  174. package/src/tool/schema.ts +1 -1
  175. package/src/tool/shell/prompt.ts +2 -2
  176. package/src/tool/shell.ts +2 -2
  177. package/src/tool/skill.ts +1 -1
  178. package/src/tool/task.ts +2 -2
  179. package/src/tool/tool.ts +2 -2
  180. package/src/tool/truncate.ts +2 -2
  181. package/src/tool/truncation-dir.ts +1 -1
  182. package/src/tool/websearch.ts +2 -2
  183. package/src/tool/write.ts +3 -3
  184. package/src/util/bom.ts +1 -1
  185. package/src/util/filesystem.ts +2 -2
  186. package/src/util/repository.ts +1 -1
  187. package/src/util/token.ts +1 -1
  188. package/src/worktree/index.ts +10 -10
@@ -1,6 +1,6 @@
1
- import { PermissionV1 } from "@opencode-ai/core/v1/permission"
1
+ import { PermissionV1 } from "@soraacode/core/v1/permission"
2
2
  import { Agent } from "@/agent/agent"
3
- import { SessionV1 } from "@opencode-ai/core/v1/session"
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 "@opencode-ai/core/util/error"
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 "@opencode-ai/core/database/database"
5
- import { EventV2 } from "@opencode-ai/core/event"
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 "@opencode-ai/core/event/sql"
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 "@opencode-ai/server/middleware/authorization"
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 "@opencode-ai/core/util/error"
2
- import { ConfigErrorV1 } from "@opencode-ai/core/v1/config/error"
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 "@opencode-ai/core/flag/flag"
2
- import { Database } from "@opencode-ai/core/database/database"
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 "@opencode-ai/core/workspace"
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 "@opencode-ai/core/flag/flag"
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 "@opencode-ai/core/fs-util"
6
- import * as Observability from "@opencode-ai/core/observability"
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 "@opencode-ai/core/control-plane/move-session"
53
- import { Database } from "@opencode-ai/core/database/database"
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 "@opencode-ai/core/effect/layer-node"
56
- import { httpClient } from "@opencode-ai/core/effect/app-node-platform"
57
- import { EventV2 } from "@opencode-ai/core/event"
58
- import { ModelsDev } from "@opencode-ai/core/models-dev"
59
- import { Npm } from "@opencode-ai/core/npm"
60
- import { PermissionSaved } from "@opencode-ai/core/permission/saved"
61
- import { ProjectV2 } from "@opencode-ai/core/project"
62
- import { ProjectCopy } from "@opencode-ai/core/project/copy"
63
- import { PtyTicket } from "@opencode-ai/core/pty/ticket"
64
- import { Ripgrep } from "@opencode-ai/core/ripgrep"
65
- import { SessionProjector } from "@opencode-ai/core/session/projector"
66
- import { SessionV2 } from "@opencode-ai/core/session"
67
- import { SessionExecution } from "@opencode-ai/core/session/execution"
68
- import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"
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 "@opencode-ai/server/cors"
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 "@opencode-ai/server/api"
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 "@opencode-ai/server/handlers"
103
- import { buildLocationServiceMap, LocationServiceMap } from "@opencode-ai/core/location-services"
104
- import { layer as locationLayer } from "@opencode-ai/server/location"
105
- import { sessionLocationLayer } from "@opencode-ai/server/middleware/session-location"
106
- import { PtyEnvironment } from "@opencode-ai/server/pty-environment"
107
- import { schemaErrorLayer as v2SchemaErrorLayer } from "@opencode-ai/server/middleware/schema-error"
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 "@opencode-ai/core/effect/memo-map"
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 "@opencode-ai/core/effect/layer-node"
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")
@@ -1,5 +1,5 @@
1
1
  import { NodeHttpServer } from "@effect/platform-node"
2
- import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
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 "@opencode-ai/server/cors"
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 "@opencode-ai/core/database/database"
1
+ import { Database } from "@soraacode/core/database/database"
2
2
  import { inArray } from "drizzle-orm"
3
- import { EventSequenceTable } from "@opencode-ai/core/event/sql"
3
+ import { EventSequenceTable } from "@soraacode/core/event/sql"
4
4
  import { Workspace } from "@/control-plane/workspace"
5
- import type { WorkspaceV2 } from "@opencode-ai/core/workspace"
5
+ import type { WorkspaceV2 } from "@soraacode/core/workspace"
6
6
  import { Effect } from "effect"
7
7
 
8
8
  export const HEADER = "x-opencode-sync"
@@ -1,4 +1,4 @@
1
- import { FSUtil } from "@opencode-ai/core/fs-util"
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"
@@ -1 +1 @@
1
- export { TuiEvent } from "@opencode-ai/schema/tui-event"
1
+ export { TuiEvent } from "@soraacode/schema/tui-event"
@@ -1,6 +1,6 @@
1
- import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2
- import { SessionV1 } from "@opencode-ai/core/v1/session"
3
- import { ConfigV1 } from "@opencode-ai/core/v1/config/config"
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 "@opencode-ai/core/effect/service-use"
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 "@opencode-ai/core/provider"
22
- import { ModelV2 } from "@opencode-ai/core/model"
23
- import { buildPrompt } from "@opencode-ai/core/session/compaction"
24
- import { SessionCompactionEvent } from "@opencode-ai/schema/session-compaction-event"
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 "@opencode-ai/core/effect/layer-node"
2
- import { httpClient } from "@opencode-ai/core/effect/app-node-platform"
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 "@opencode-ai/core/v1/session"
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 "@opencode-ai/core/flag/flag"
11
- import { FSUtil } from "@opencode-ai/core/fs-util"
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 "@opencode-ai/core/global"
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 `@opencode-ai/llm` `LLMEvent`s. This is the default runtime path.
8
- - `native-request.ts` converts opencode's normalized session input into a native `@opencode-ai/llm` `LLMRequest`. It does not execute requests.
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 -> @opencode-ai/llm LLMEvent adapter
19
- native-request.ts opencode/AI SDK-shaped input -> @opencode-ai/llm LLMRequest
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 `@opencode-ai/llm/route`; native execution is the only path that calls it directly.
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 `@opencode-ai/llm`.
30
- - `ai-sdk.ts` and `native-runtime.ts` both emit `@opencode-ai/llm` `LLMEvent`s so downstream session processing does not care which runtime handled the request.
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 `@opencode-ai/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.
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 "@opencode-ai/llm"
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 @opencode-ai/llm when Copilot is handled by the native runtime.
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 "@opencode-ai/llm"
2
- import { LLM, Message, SystemPart, ToolCallPart, ToolDefinition, ToolResultPart } from "@opencode-ai/llm"
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 "@opencode-ai/llm/providers"
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
- // @opencode-ai/llm request objects from opencode's session/AI SDK-shaped data.
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 "@opencode-ai/llm"
19
- import type { LLMClientShape } from "@opencode-ai/llm/route"
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 @opencode-ai/llm: native-request lowers session data
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 @opencode-ai/llm tool call back into the AI SDK Tool.execute shape.
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 "@opencode-ai/core/v1/permission"
1
+ import { PermissionV1 } from "@soraacode/core/v1/permission"
2
2
  import type { Auth } from "@/auth"
3
- import { SessionV1 } from "@opencode-ai/core/v1/session"
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 "@opencode-ai/core/installation/version"
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"
@@ -1,15 +1,15 @@
1
- import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2
- import { llmClient } from "@opencode-ai/core/effect/app-node-platform"
3
- import { PermissionV1 } from "@opencode-ai/core/v1/permission"
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 "@opencode-ai/core/v1/session"
6
- import { serviceUse } from "@opencode-ai/core/effect/service-use"
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 "@opencode-ai/llm"
11
- import { LLMClient } from "@opencode-ai/llm/route"
12
- import type { LLMClientService } from "@opencode-ai/llm/route"
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 "@opencode-ai/core/event"
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 @opencode-ai/llm. It
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,5 +1,5 @@
1
1
  import { Schema } from "effect"
2
- import { NamedError } from "@opencode-ai/core/util/error"
2
+ import { NamedError } from "@soraacode/core/util/error"
3
3
 
4
4
  export const OutputLengthError = NamedError.create("MessageOutputLengthError", {})
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { SessionID, MessageID } from "./schema"
2
- import { SessionV1 } from "@opencode-ai/core/v1/session"
3
- import { ProviderV2 } from "@opencode-ai/core/provider"
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 "@opencode-ai/core/v1/session"
17
+ } from "@soraacode/core/v1/session"
18
18
 
19
- import { NamedError } from "@opencode-ai/core/util/error"
19
+ import { NamedError } from "@soraacode/core/util/error"
20
20
  import { APICallError, convertToModelMessages, LoadAPIKeyError, type ModelMessage, type UIMessage } from "ai"
21
- import { Database } from "@opencode-ai/core/database/database"
22
- import { LayerNode } from "@opencode-ai/core/effect/layer-node"
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 "@opencode-ai/core/session/sql"
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"
@@ -1,11 +1,11 @@
1
1
  import { Schema } from "effect"
2
2
  import { SessionID } from "./schema"
3
3
 
4
- import { NonNegativeInt } from "@opencode-ai/core/schema"
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 "@opencode-ai/core/provider"
8
- import { ModelV2 } from "@opencode-ai/core/model"
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({
@@ -1,6 +1,6 @@
1
1
  import type { Config } from "@/config/config"
2
- import { ConfigV1 } from "@opencode-ai/core/v1/config/config"
3
- import { SessionV1 } from "@opencode-ai/core/v1/session"
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"
@@ -1,7 +1,7 @@
1
- import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2
- import { PermissionV1 } from "@opencode-ai/core/v1/permission"
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 "@opencode-ai/core/v1/session"
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 "@opencode-ai/core/database/database"
27
- import { Usage, type LLMEvent } from "@opencode-ai/llm"
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"
@@ -1,7 +1,7 @@
1
- import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2
- import { PermissionV1 } from "@opencode-ai/core/v1/permission"
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 "@opencode-ai/core/v1/session"
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 "@opencode-ai/core/session/runner/max-steps"
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 "@opencode-ai/core/cross-spawn-spawner"
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 "@opencode-ai/core/util/error"
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 "@opencode-ai/core/shell"
38
+ import { Shell } from "@soraacode/core/shell"
39
39
  import { ShellID } from "@/tool/shell/id"
40
- import { FSUtil } from "@opencode-ai/core/fs-util"
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 "@opencode-ai/core/database/database"
52
- import { ModelV2 } from "@opencode-ai/core/model"
53
- import { ProviderV2 } from "@opencode-ai/core/provider"
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 "@opencode-ai/core/session/sql"
55
+ import { SessionTable } from "@soraacode/core/session/sql"
56
56
  import { SessionReminders } from "./reminders"
57
57
  import { SessionTools } from "./tools"
58
- import { LLMEvent } from "@opencode-ai/llm"
58
+ import { LLMEvent } from "@soraacode/llm"
59
59
 
60
60
  // @ts-ignore
61
61
  globalThis.AI_SDK_LOG_WARNINGS = false