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,11 +1,11 @@
|
|
|
1
|
-
import type { Hooks, PluginInput } from "@
|
|
2
|
-
import { InstallationVersion } from "@
|
|
1
|
+
import type { Hooks, PluginInput } from "@soraacode/plugin"
|
|
2
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
3
3
|
import { OAUTH_DUMMY_KEY } from "../../auth"
|
|
4
4
|
import os from "os"
|
|
5
5
|
import { setTimeout as sleep } from "node:timers/promises"
|
|
6
6
|
import { createServer } from "http"
|
|
7
7
|
import { OpenAIWebSocketPool } from "./ws-pool"
|
|
8
|
-
import { OauthCallbackPage } from "@
|
|
8
|
+
import { OauthCallbackPage } from "@soraacode/core/oauth/page"
|
|
9
9
|
|
|
10
10
|
const CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann"
|
|
11
11
|
const ISSUER = "https://auth.openai.com"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as PluginPtyEnvironment from "./pty-environment"
|
|
2
2
|
|
|
3
|
-
import { PtyEnvironment } from "@
|
|
3
|
+
import { PtyEnvironment } from "@soraacode/server/pty-environment"
|
|
4
4
|
import { Effect, Layer } from "effect"
|
|
5
5
|
import { InstanceStore } from "@/project/instance-store"
|
|
6
6
|
import { Plugin } from "."
|
package/src/plugin/shared.ts
CHANGED
|
@@ -4,7 +4,7 @@ import npa from "npm-package-arg"
|
|
|
4
4
|
import semver from "semver"
|
|
5
5
|
import { Filesystem } from "@/util/filesystem"
|
|
6
6
|
import { isRecord } from "@/util/record"
|
|
7
|
-
import { Npm } from "@
|
|
7
|
+
import { Npm } from "@soraacode/core/npm"
|
|
8
8
|
|
|
9
9
|
// Old npm package names for plugins that are now built-in
|
|
10
10
|
export const DEPRECATED_PLUGIN_PACKAGES = ["opencode-openai-codex-auth", "opencode-copilot-auth"]
|
package/src/project/bootstrap.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { makeGlobalNode, Node } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import { makeGlobalNode, Node } from "@soraacode/core/effect/app-node"
|
|
3
3
|
import { GlobalBus } from "@/bus/global"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
5
5
|
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
|
6
6
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
7
7
|
import { disposeInstance as runDisposers } from "@/effect/instance-registry"
|
|
8
|
-
import { FSUtil } from "@
|
|
8
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
9
9
|
import { Context, Deferred, Duration, Effect, Exit, Layer, Scope } from "effect"
|
|
10
10
|
import { type InstanceContext } from "./instance-context"
|
|
11
11
|
import { InstanceBootstrap } from "./bootstrap-service"
|
package/src/project/project.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { and, eq, sql } from "drizzle-orm"
|
|
3
|
-
import { Database } from "@
|
|
4
|
-
import { ProjectDirectoryTable, ProjectTable } from "@
|
|
5
|
-
import { ProjectDirectories } from "@
|
|
6
|
-
import { SessionTable } from "@
|
|
7
|
-
import { WorkspaceTable } from "@
|
|
8
|
-
import { Flag } from "@
|
|
3
|
+
import { Database } from "@soraacode/core/database/database"
|
|
4
|
+
import { ProjectDirectoryTable, ProjectTable } from "@soraacode/core/project/sql"
|
|
5
|
+
import { ProjectDirectories } from "@soraacode/core/project/directories"
|
|
6
|
+
import { SessionTable } from "@soraacode/core/session/sql"
|
|
7
|
+
import { WorkspaceTable } from "@soraacode/core/control-plane/workspace.sql"
|
|
8
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
9
9
|
import { GlobalBus } from "@/bus/global"
|
|
10
|
-
import { which } from "@
|
|
10
|
+
import { which } from "@soraacode/core/util/which"
|
|
11
11
|
import { Command } from "@/command"
|
|
12
12
|
import { InstanceState } from "@/effect/instance-state"
|
|
13
13
|
import { Effect, Layer, Scope, Context, Stream, Types, Schema } from "effect"
|
|
14
14
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
|
|
15
|
-
import { FSUtil } from "@
|
|
16
|
-
import { AppProcess } from "@
|
|
17
|
-
import { ProjectV2 } from "@
|
|
18
|
-
import { CrossSpawnSpawner } from "@
|
|
19
|
-
import { AbsolutePath } from "@
|
|
20
|
-
import { serviceUse } from "@
|
|
15
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
16
|
+
import { AppProcess } from "@soraacode/core/process"
|
|
17
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
18
|
+
import { CrossSpawnSpawner } from "@soraacode/core/cross-spawn-spawner"
|
|
19
|
+
import { AbsolutePath } from "@soraacode/core/schema"
|
|
20
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
21
21
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
22
22
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
23
|
-
import { EventV2 } from "@
|
|
24
|
-
import { Project } from "@
|
|
23
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
24
|
+
import { Project } from "@soraacode/schema/project"
|
|
25
25
|
|
|
26
26
|
export const Info = Project.Info
|
|
27
27
|
export type Info = Types.DeepMutable<Schema.Schema.Type<typeof Info>>
|
package/src/project/vcs.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { Effect, Layer, Context, Schema, Scope } from "effect"
|
|
3
3
|
import { formatPatch, structuredPatch } from "diff"
|
|
4
4
|
import { InstanceState } from "@/effect/instance-state"
|
|
5
|
-
import { Watcher } from "@
|
|
5
|
+
import { Watcher } from "@soraacode/core/filesystem/watcher"
|
|
6
6
|
import { Git } from "@/git"
|
|
7
7
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
8
|
-
import { EventV2 } from "@
|
|
9
|
-
import { VcsEvent } from "@
|
|
8
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
9
|
+
import { VcsEvent } from "@soraacode/schema/vcs-event"
|
|
10
10
|
|
|
11
11
|
const PATCH_CONTEXT_LINES = 2_147_483_647
|
|
12
12
|
const MAX_PATCH_BYTES = 10_000_000
|
package/src/provider/auth.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import type { AuthOAuthResult, Hooks } from "@
|
|
3
|
-
import { serviceUse } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
|
+
import type { AuthOAuthResult, Hooks } from "@soraacode/plugin"
|
|
3
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
4
4
|
import { Auth } from "@/auth"
|
|
5
5
|
import { InstanceState } from "@/effect/instance-state"
|
|
6
|
-
import { optional } from "@
|
|
6
|
+
import { optional } from "@soraacode/core/schema"
|
|
7
7
|
import { Plugin } from "../plugin"
|
|
8
|
-
import { ProviderV2 } from "@
|
|
8
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
9
9
|
import { Array as Arr, Effect, Layer, Record, Result, Context, Schema } from "effect"
|
|
10
10
|
|
|
11
11
|
const When = Schema.Struct({
|
package/src/provider/error.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { APICallError } from "ai"
|
|
2
2
|
import { STATUS_CODES } from "http"
|
|
3
3
|
import { iife } from "@/util/iife"
|
|
4
|
-
import type { ProviderV2 } from "@
|
|
5
|
-
import { isContextOverflow } from "@
|
|
4
|
+
import type { ProviderV2 } from "@soraacode/core/provider"
|
|
5
|
+
import { isContextOverflow } from "@soraacode/llm"
|
|
6
6
|
|
|
7
7
|
export class HeaderTimeoutError extends Error {
|
|
8
8
|
public override readonly name = "ProviderHeaderTimeoutError"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
2
|
|
|
3
|
-
export { CatalogModelStatus } from "@
|
|
3
|
+
export { CatalogModelStatus } from "@soraacode/core/models-dev"
|
|
4
4
|
|
|
5
5
|
export const ModelStatus = Schema.Literals(["alpha", "beta", "deprecated", "active"])
|
|
6
6
|
export type ModelStatus = typeof ModelStatus.Type
|
package/src/provider/provider.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import os from "os"
|
|
3
|
-
import { ConfigV1 } from "@
|
|
3
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
4
4
|
import fuzzysort from "fuzzysort"
|
|
5
5
|
import { Config } from "@/config/config"
|
|
6
6
|
import { mapValues, mergeDeep, omit, pickBy, sortBy } from "remeda"
|
|
7
7
|
import { NoSuchModelError, type Provider as SDK } from "ai"
|
|
8
|
-
import { Npm } from "@
|
|
9
|
-
import { Hash } from "@
|
|
8
|
+
import { Npm } from "@soraacode/core/npm"
|
|
9
|
+
import { Hash } from "@soraacode/core/util/hash"
|
|
10
10
|
import { Plugin } from "../plugin"
|
|
11
|
-
import { serviceUse } from "@
|
|
11
|
+
import { serviceUse } from "@soraacode/core/effect/service-use"
|
|
12
12
|
import { type LanguageModelV3 } from "@ai-sdk/provider"
|
|
13
|
-
import { ModelsDev } from "@
|
|
13
|
+
import { ModelsDev } from "@soraacode/core/models-dev"
|
|
14
14
|
import { Auth } from "../auth"
|
|
15
15
|
import { Env } from "../env"
|
|
16
|
-
import { InstallationVersion } from "@
|
|
16
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
17
17
|
import { iife } from "@/util/iife"
|
|
18
|
-
import { Global } from "@
|
|
18
|
+
import { Global } from "@soraacode/core/global"
|
|
19
19
|
import path from "path"
|
|
20
20
|
import { pathToFileURL } from "url"
|
|
21
21
|
import { Effect, Layer, Context, Schema, Types } from "effect"
|
|
22
22
|
import { EffectBridge } from "@/effect/bridge"
|
|
23
23
|
import { InstanceState } from "@/effect/instance-state"
|
|
24
24
|
import { EffectPromise } from "@/effect/promise"
|
|
25
|
-
import { FSUtil } from "@
|
|
25
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
26
26
|
import { isRecord } from "@/util/record"
|
|
27
|
-
import { optional } from "@
|
|
27
|
+
import { optional } from "@soraacode/core/schema"
|
|
28
28
|
import { ProviderTransform } from "./transform"
|
|
29
|
-
import { ProviderV2 } from "@
|
|
30
|
-
import { ModelV2 } from "@
|
|
29
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
30
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
31
31
|
import { ModelStatus } from "./model-status"
|
|
32
32
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
33
33
|
import { ProviderError } from "./error"
|
|
@@ -135,7 +135,7 @@ const BUNDLED_PROVIDERS: Record<string, () => Promise<(opts: any) => BundledSDK>
|
|
|
135
135
|
"@ai-sdk/alibaba": () => import("@ai-sdk/alibaba").then((m) => m.createAlibaba),
|
|
136
136
|
"gitlab-ai-provider": () => import("gitlab-ai-provider").then((m) => m.createGitLab),
|
|
137
137
|
"@ai-sdk/github-copilot": () =>
|
|
138
|
-
import("@
|
|
138
|
+
import("@soraacode/core/github-copilot/copilot-provider").then((m) => m.createOpenaiCompatible),
|
|
139
139
|
"venice-ai-sdk-provider": () => import("venice-ai-sdk-provider").then((m) => m.createVenice),
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -2,7 +2,7 @@ import type { ModelMessage, ToolResultPart } from "ai"
|
|
|
2
2
|
import { mergeDeep, unique } from "remeda"
|
|
3
3
|
import type { JSONSchema7 } from "@ai-sdk/provider"
|
|
4
4
|
import type * as Provider from "./provider"
|
|
5
|
-
import type * as ModelsDev from "@
|
|
5
|
+
import type * as ModelsDev from "@soraacode/core/models-dev"
|
|
6
6
|
import { iife } from "@/util/iife"
|
|
7
7
|
|
|
8
8
|
type Modality = NonNullable<ModelsDev.Model["modalities"]>["input"][number]
|
package/src/question/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@soraacode/core/effect/layer-node"
|
|
2
2
|
import { Deferred, Effect, Layer, Schema, Context } from "effect"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
4
|
import { SessionID } from "@/session/schema"
|
|
5
5
|
import { QuestionID } from "./schema"
|
|
6
6
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
7
|
-
import { QuestionV1 } from "@
|
|
7
|
+
import { QuestionV1 } from "@soraacode/schema/question-v1"
|
|
8
8
|
|
|
9
9
|
export const Option = QuestionV1.Option
|
|
10
10
|
export type Option = typeof Option.Type
|
package/src/question/schema.ts
CHANGED
package/src/server/auth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as ServerAuth from "./auth"
|
|
2
2
|
|
|
3
3
|
import { ConfigService } from "@/effect/config-service"
|
|
4
|
-
import { Flag } from "@
|
|
4
|
+
import { Flag } from "@soraacode/core/flag/flag"
|
|
5
5
|
import { Config as EffectConfig, Context, Option, Redacted } from "effect"
|
|
6
6
|
|
|
7
7
|
export type Credentials = {
|
package/src/server/event.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
2
|
import { HttpApi } from "effect/unstable/httpapi"
|
|
3
|
-
import { EventV2 } from "@
|
|
3
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
4
4
|
import { EventManifest } from "@/event-manifest"
|
|
5
|
-
import { Credential } from "@
|
|
6
|
-
import { Integration } from "@
|
|
7
|
-
import { SkillV2 } from "@
|
|
5
|
+
import { Credential } from "@soraacode/core/credential"
|
|
6
|
+
import { Integration } from "@soraacode/core/integration"
|
|
7
|
+
import { SkillV2 } from "@soraacode/core/skill"
|
|
8
8
|
import { InstanceDisposed } from "@/server/event"
|
|
9
9
|
import { Question } from "@/question"
|
|
10
10
|
import { ConfigApi } from "./groups/config"
|
|
@@ -25,9 +25,9 @@ import { SessionApi } from "./groups/session"
|
|
|
25
25
|
import { SyncApi } from "./groups/sync"
|
|
26
26
|
import { TuiApi } from "./groups/tui"
|
|
27
27
|
import { WorkspaceApi } from "./groups/workspace"
|
|
28
|
-
import { makeApi } from "@
|
|
29
|
-
import { LocationMiddleware } from "@
|
|
30
|
-
import { SessionLocationMiddleware } from "@
|
|
28
|
+
import { makeApi } from "@soraacode/protocol/api"
|
|
29
|
+
import { LocationMiddleware } from "@soraacode/server/location"
|
|
30
|
+
import { SessionLocationMiddleware } from "@soraacode/server/middleware/session-location"
|
|
31
31
|
import { GlobalApi } from "./groups/global"
|
|
32
32
|
import { Authorization } from "./middleware/authorization"
|
|
33
33
|
import { SchemaErrorMiddleware } from "./middleware/schema-error"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from "@/config/config"
|
|
2
|
-
import { ConfigV1 } from "@
|
|
2
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
3
3
|
import { Provider } from "@/provider/provider"
|
|
4
4
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
5
5
|
import { Authorization } from "../middleware/authorization"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MoveSession } from "@
|
|
1
|
+
import { MoveSession } from "@soraacode/core/control-plane/move-session"
|
|
2
2
|
import { Schema } from "effect"
|
|
3
3
|
import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"
|
|
4
4
|
import { described } from "./metadata"
|
|
@@ -3,7 +3,7 @@ import { Auth } from "@/auth"
|
|
|
3
3
|
import { Schema } from "effect"
|
|
4
4
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
5
5
|
import { described } from "./metadata"
|
|
6
|
-
import { ProviderV2 } from "@
|
|
6
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
7
7
|
|
|
8
8
|
const AuthParams = Schema.Struct({
|
|
9
9
|
providerID: ProviderV2.ID,
|
|
@@ -4,7 +4,7 @@ import { MCP } from "@/mcp"
|
|
|
4
4
|
import { Session } from "@/session/session"
|
|
5
5
|
import { SessionID } from "@/session/schema"
|
|
6
6
|
import { Worktree } from "@/worktree"
|
|
7
|
-
import { NonNegativeInt } from "@
|
|
7
|
+
import { NonNegativeInt } from "@soraacode/core/schema"
|
|
8
8
|
import { Schema } from "effect"
|
|
9
9
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"
|
|
10
10
|
import { Authorization } from "../middleware/authorization"
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
} from "../middleware/workspace-routing"
|
|
17
17
|
import { described } from "./metadata"
|
|
18
18
|
import { QueryBoolean } from "./query"
|
|
19
|
-
import { ProviderV2 } from "@
|
|
20
|
-
import { ModelV2 } from "@
|
|
19
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
20
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
21
21
|
|
|
22
22
|
const ConsoleStateResponse = Schema.Struct({
|
|
23
23
|
consoleManagedProviders: Schema.mutable(Schema.Array(Schema.String)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FileSystem } from "@
|
|
2
|
-
import { NonNegativeInt } from "@
|
|
1
|
+
import { FileSystem } from "@soraacode/core/filesystem"
|
|
2
|
+
import { NonNegativeInt } from "@soraacode/core/schema"
|
|
3
3
|
import { LSP } from "@/lsp/lsp"
|
|
4
4
|
import { Schema } from "effect"
|
|
5
5
|
import { HttpApi, HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ConfigV1 } from "@
|
|
2
|
-
import { EventV2 } from "@
|
|
1
|
+
import { ConfigV1 } from "@soraacode/core/v1/config/config"
|
|
2
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
3
3
|
import { EventManifest } from "@/event-manifest"
|
|
4
4
|
import { InstanceDisposed } from "@/server/event"
|
|
5
|
-
import "@
|
|
5
|
+
import "@soraacode/core/account"
|
|
6
6
|
import "@/server/event"
|
|
7
7
|
import { Schema } from "effect"
|
|
8
8
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MCP } from "@/mcp"
|
|
2
|
-
import { ConfigMCPV1 } from "@
|
|
2
|
+
import { ConfigMCPV1 } from "@soraacode/core/v1/config/mcp"
|
|
3
3
|
import { Schema } from "effect"
|
|
4
4
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
5
5
|
import { McpServerNotFoundError } from "../errors"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
2
2
|
import { Permission } from "@/permission"
|
|
3
3
|
import { Schema } from "effect"
|
|
4
4
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProjectV2 } from "@
|
|
1
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
2
2
|
import { Schema } from "effect"
|
|
3
3
|
import { HttpApi, HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
4
4
|
import { Authorization } from "../middleware/authorization"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Project } from "@/project/project"
|
|
2
|
-
import { ProjectV2 } from "@
|
|
2
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
3
3
|
import { Schema } from "effect"
|
|
4
4
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
5
5
|
import { ProjectNotFoundError } from "../errors"
|
|
@@ -7,7 +7,7 @@ import { Authorization } from "../middleware/authorization"
|
|
|
7
7
|
import { InstanceContextMiddleware } from "../middleware/instance-context"
|
|
8
8
|
import { WorkspaceRoutingMiddleware, WorkspaceRoutingQuery } from "../middleware/workspace-routing"
|
|
9
9
|
import { described } from "./metadata"
|
|
10
|
-
import { ProviderV2 } from "@
|
|
10
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
11
11
|
|
|
12
12
|
const root = "/provider"
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Pty } from "@
|
|
2
|
-
import { PtyTicket } from "@
|
|
3
|
-
import { PtyID } from "@
|
|
1
|
+
import { Pty } from "@soraacode/core/pty"
|
|
2
|
+
import { PtyTicket } from "@soraacode/core/pty/ticket"
|
|
3
|
+
import { PtyID } from "@soraacode/core/pty/schema"
|
|
4
4
|
import { PTY_CONNECT_TICKET_QUERY } from "@/server/shared/pty-ticket"
|
|
5
5
|
import { Schema } from "effect"
|
|
6
6
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { PermissionV1 } from "@soraacode/core/v1/permission"
|
|
2
2
|
import { Permission } from "@/permission"
|
|
3
|
-
import { SessionV1 } from "@
|
|
3
|
+
import { SessionV1 } from "@soraacode/core/v1/session"
|
|
4
4
|
|
|
5
5
|
import { Session } from "@/session/session"
|
|
6
6
|
import { MessageV2 } from "@/session/message-v2"
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
import { ApiNotFoundError, PermissionNotFoundError, SessionBusyError } from "../errors"
|
|
24
24
|
import { described } from "./metadata"
|
|
25
25
|
import { QueryBoolean } from "./query"
|
|
26
|
-
import { ProviderV2 } from "@
|
|
27
|
-
import { ModelV2 } from "@
|
|
26
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
27
|
+
import { ModelV2 } from "@soraacode/core/model"
|
|
28
28
|
|
|
29
29
|
const root = "/session"
|
|
30
30
|
export const ListQuery = Schema.Struct({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NonNegativeInt } from "@
|
|
2
|
-
import { EventV2 } from "@
|
|
1
|
+
import { NonNegativeInt } from "@soraacode/core/schema"
|
|
2
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
3
3
|
import { SessionID } from "@/session/schema"
|
|
4
4
|
import { Schema } from "effect"
|
|
5
5
|
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MoveSession } from "@
|
|
2
|
-
import { SessionV2 } from "@
|
|
1
|
+
import { MoveSession } from "@soraacode/core/control-plane/move-session"
|
|
2
|
+
import { SessionV2 } from "@soraacode/core/session"
|
|
3
3
|
import { Effect } from "effect"
|
|
4
4
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
5
5
|
import { RootHttpApi } from "../api"
|
|
@@ -4,7 +4,7 @@ import { Effect } from "effect"
|
|
|
4
4
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
5
5
|
import { RootHttpApi } from "../api"
|
|
6
6
|
import { LogInput } from "../groups/control"
|
|
7
|
-
import { ProviderV2 } from "@
|
|
7
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
8
8
|
|
|
9
9
|
export const controlHandlers = HttpApiBuilder.group(RootHttpApi, "control", (handlers) =>
|
|
10
10
|
Effect.gen(function* () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
2
2
|
import { InstanceState } from "@/effect/instance-state"
|
|
3
3
|
import { GlobalBus } from "@/bus/global"
|
|
4
|
-
import { EventV2 } from "@
|
|
4
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
5
5
|
import { Effect, Queue } from "effect"
|
|
6
6
|
import * as Stream from "effect/Stream"
|
|
7
7
|
import { HttpServerResponse } from "effect/unstable/http"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as InstanceState from "@/effect/instance-state"
|
|
2
|
-
import { FileSystem } from "@
|
|
3
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
4
|
-
import { Ripgrep } from "@
|
|
5
|
-
import { FSUtil } from "@
|
|
6
|
-
import { Location } from "@
|
|
7
|
-
import { AbsolutePath, RelativePath } from "@
|
|
2
|
+
import { FileSystem } from "@soraacode/core/filesystem"
|
|
3
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@soraacode/core/location-services"
|
|
4
|
+
import { Ripgrep } from "@soraacode/core/ripgrep"
|
|
5
|
+
import { FSUtil } from "@soraacode/core/fs-util"
|
|
6
|
+
import { Location } from "@soraacode/core/location"
|
|
7
|
+
import { AbsolutePath, RelativePath } from "@soraacode/core/schema"
|
|
8
8
|
import { Effect, Layer, Option } from "effect"
|
|
9
9
|
import ignore from "ignore"
|
|
10
10
|
import path from "path"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Config } from "@/config/config"
|
|
2
2
|
import { GlobalBus, type GlobalEvent as GlobalBusEvent } from "@/bus/global"
|
|
3
3
|
import { EffectBridge } from "@/effect/bridge"
|
|
4
|
-
import { EventV2 } from "@
|
|
4
|
+
import { EventV2 } from "@soraacode/core/event"
|
|
5
5
|
import { Installation } from "@/installation"
|
|
6
6
|
import { disposeAllInstancesAndEmitGlobalDisposed } from "@/server/global-lifecycle"
|
|
7
|
-
import { InstallationVersion } from "@
|
|
7
|
+
import { InstallationVersion } from "@soraacode/core/installation/version"
|
|
8
8
|
import { Effect, Queue } from "effect"
|
|
9
9
|
import * as Stream from "effect/Stream"
|
|
10
10
|
import { HttpServerResponse } from "effect/unstable/http"
|
|
@@ -2,7 +2,7 @@ import { Agent } from "@/agent/agent"
|
|
|
2
2
|
import { Command } from "@/command"
|
|
3
3
|
import * as InstanceState from "@/effect/instance-state"
|
|
4
4
|
import { Format } from "@/format"
|
|
5
|
-
import { Global } from "@
|
|
5
|
+
import { Global } from "@soraacode/core/global"
|
|
6
6
|
import { LSP } from "@/lsp/lsp"
|
|
7
7
|
import { Vcs } from "@/project/vcs"
|
|
8
8
|
import { Skill } from "@/skill"
|
|
@@ -2,8 +2,8 @@ import { Agent } from "@/agent/agent"
|
|
|
2
2
|
import { Provider } from "@/provider/provider"
|
|
3
3
|
import { LLM } from "@/session/llm"
|
|
4
4
|
import { MessageID, SessionID } from "@/session/schema"
|
|
5
|
-
import { Slug } from "@
|
|
6
|
-
import { LLMEvent } from "@
|
|
5
|
+
import { Slug } from "@soraacode/core/util/slug"
|
|
6
|
+
import { LLMEvent } from "@soraacode/llm"
|
|
7
7
|
import { Effect, Stream } from "effect"
|
|
8
8
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
9
9
|
import { InstanceHttpApi } from "../api"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as InstanceState from "@/effect/instance-state"
|
|
2
2
|
import { Project } from "@/project/project"
|
|
3
|
-
import { ProjectV2 } from "@
|
|
3
|
+
import { ProjectV2 } from "@soraacode/core/project"
|
|
4
4
|
import { Effect } from "effect"
|
|
5
5
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
6
6
|
import { InstanceHttpApi } from "../api"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderAuth } from "@/provider/auth"
|
|
2
2
|
import { Config } from "@/config/config"
|
|
3
|
-
import { ModelsDev } from "@
|
|
3
|
+
import { ModelsDev } from "@soraacode/core/models-dev"
|
|
4
4
|
import { Provider } from "@/provider/provider"
|
|
5
5
|
import { Auth } from "@/auth"
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http"
|
|
|
10
10
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
11
11
|
import { InstanceHttpApi } from "../api"
|
|
12
12
|
import { ProviderAuthApiError } from "../groups/provider"
|
|
13
|
-
import { ProviderV2 } from "@
|
|
13
|
+
import { ProviderV2 } from "@soraacode/core/provider"
|
|
14
14
|
|
|
15
15
|
function mapProviderAuthError<A, R>(self: Effect.Effect<A, ProviderAuth.Error, R>) {
|
|
16
16
|
return self.pipe(
|
|
@@ -2,15 +2,15 @@ import * as InstanceState from "@/effect/instance-state"
|
|
|
2
2
|
import { registerDisposer } from "@/effect/instance-registry"
|
|
3
3
|
import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref"
|
|
4
4
|
import { Plugin } from "@/plugin"
|
|
5
|
-
import { Pty } from "@
|
|
6
|
-
import { PtyProtocol } from "@
|
|
7
|
-
import { PtyID } from "@
|
|
8
|
-
import { PtyTicket } from "@
|
|
9
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
10
|
-
import { Location } from "@
|
|
11
|
-
import { AbsolutePath } from "@
|
|
12
|
-
import { Shell } from "@
|
|
13
|
-
import { CorsConfig, isAllowedRequestOrigin, type CorsOptions } from "@
|
|
5
|
+
import { Pty } from "@soraacode/core/pty"
|
|
6
|
+
import { PtyProtocol } from "@soraacode/core/pty/protocol"
|
|
7
|
+
import { PtyID } from "@soraacode/core/pty/schema"
|
|
8
|
+
import { PtyTicket } from "@soraacode/core/pty/ticket"
|
|
9
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@soraacode/core/location-services"
|
|
10
|
+
import { Location } from "@soraacode/core/location"
|
|
11
|
+
import { AbsolutePath } from "@soraacode/core/schema"
|
|
12
|
+
import { Shell } from "@soraacode/core/shell"
|
|
13
|
+
import { CorsConfig, isAllowedRequestOrigin, type CorsOptions } from "@soraacode/server/cors"
|
|
14
14
|
import {
|
|
15
15
|
PTY_CONNECT_TICKET_QUERY,
|
|
16
16
|
PTY_CONNECT_TOKEN_HEADER,
|