anymous 1.0.4 → 1.1.0
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/LICENSE +21 -0
- package/bin/anymous.cjs +45 -45
- package/package.json +1 -1
- package/{script/postinstall.mjs → postinstall.mjs} +5 -5
- package/src/account/account.ts +5 -5
- package/src/account/repo.ts +5 -5
- package/src/acp/agent.ts +2 -2
- package/src/acp/content.ts +1 -1
- package/src/acp/directory.ts +5 -5
- package/src/acp/event.ts +4 -4
- package/src/acp/permission.ts +2 -2
- package/src/acp/profile.ts +1 -1
- package/src/acp/service.ts +24 -24
- package/src/acp/session.ts +5 -5
- package/src/acp/usage.ts +11 -11
- package/src/agent/agent.ts +13 -13
- package/src/agent/prompt/debug-tools.txt +40 -40
- package/src/agent/prompt/exe-extractor.txt +39 -39
- package/src/agent/prompt/memory-dump.txt +37 -37
- package/src/agent/prompt/reverser-automator.txt +38 -38
- package/src/agent/prompt/reverser-binary.txt +39 -39
- package/src/agent/prompt/reverser-dynamic.txt +36 -36
- package/src/agent/prompt/reverser-source.txt +38 -38
- package/src/agent/prompt/reverser-static.txt +35 -35
- package/src/agent/subagent-permissions.ts +1 -1
- package/src/auth/index.ts +8 -8
- package/src/background/job.ts +3 -3
- package/src/cli/cmd/account.ts +1 -1
- package/src/cli/cmd/acp.ts +3 -3
- package/src/cli/cmd/agent.ts +2 -2
- package/src/cli/cmd/attach.ts +3 -3
- package/src/cli/cmd/db.ts +1 -1
- package/src/cli/cmd/debug/agent.handler.ts +2 -2
- package/src/cli/cmd/debug/file.ts +4 -4
- package/src/cli/cmd/debug/index.ts +5 -5
- package/src/cli/cmd/debug/ripgrep.ts +1 -1
- package/src/cli/cmd/debug/scrap.ts +2 -2
- package/src/cli/cmd/debug/v2.ts +4 -4
- package/src/cli/cmd/export.ts +1 -1
- package/src/cli/cmd/generate.ts +2 -2
- package/src/cli/cmd/github.handler.ts +27 -27
- package/src/cli/cmd/github.shared.ts +1 -1
- package/src/cli/cmd/import.ts +5 -5
- package/src/cli/cmd/mcp.ts +13 -13
- package/src/cli/cmd/models.ts +6 -6
- package/src/cli/cmd/plug.ts +2 -2
- package/src/cli/cmd/pr.ts +6 -6
- package/src/cli/cmd/prompt-display.ts +1 -1
- package/src/cli/cmd/providers.ts +12 -12
- package/src/cli/cmd/run/demo.ts +3 -3
- package/src/cli/cmd/run/footer.command.tsx +2 -2
- package/src/cli/cmd/run/footer.permission.tsx +3 -3
- package/src/cli/cmd/run/footer.prompt.tsx +9 -9
- package/src/cli/cmd/run/footer.question.tsx +1 -1
- package/src/cli/cmd/run/footer.subagent.tsx +3 -3
- package/src/cli/cmd/run/footer.ts +2 -2
- package/src/cli/cmd/run/footer.view.tsx +9 -9
- package/src/cli/cmd/run/permission.shared.ts +3 -3
- package/src/cli/cmd/run/question.shared.ts +1 -1
- package/src/cli/cmd/run/runtime.boot.ts +2 -2
- package/src/cli/cmd/run/runtime.lifecycle.ts +4 -4
- package/src/cli/cmd/run/runtime.ts +6 -6
- package/src/cli/cmd/run/session-data.ts +1 -1
- package/src/cli/cmd/run/session-replay.ts +1 -1
- package/src/cli/cmd/run/splash.ts +13 -5
- package/src/cli/cmd/run/stream.transport.ts +3 -3
- package/src/cli/cmd/run/subagent-data.ts +1 -1
- package/src/cli/cmd/run/theme.ts +2 -2
- package/src/cli/cmd/run/tool.ts +2 -2
- package/src/cli/cmd/run/trace.ts +4 -4
- package/src/cli/cmd/run/types.ts +13 -13
- package/src/cli/cmd/run/variant.shared.ts +5 -5
- package/src/cli/cmd/run.ts +22 -22
- package/src/cli/cmd/serve.ts +4 -4
- package/src/cli/cmd/session.ts +4 -4
- package/src/cli/cmd/stats.ts +2 -2
- package/src/cli/cmd/tui.ts +7 -7
- package/src/cli/cmd/uninstall.ts +21 -21
- package/src/cli/cmd/upgrade.ts +14 -14
- package/src/cli/cmd/web.ts +4 -4
- package/src/cli/error.ts +1 -1
- package/src/cli/heap.ts +3 -3
- package/src/cli/logo.ts +1 -1
- package/src/cli/network.ts +1 -1
- package/src/cli/tui/layer.ts +3 -3
- package/src/cli/tui/validate-session.ts +2 -2
- package/src/cli/ui.ts +12 -9
- package/src/cli/upgrade.ts +11 -11
- package/src/command/index.ts +3 -3
- package/src/command/template/initialize.txt +3 -3
- package/src/config/agent.ts +2 -2
- package/src/config/command.ts +3 -3
- package/src/config/config.ts +49 -49
- package/src/config/managed.ts +6 -6
- package/src/config/markdown.ts +2 -2
- package/src/config/parse.ts +2 -2
- package/src/config/paths.ts +7 -7
- package/src/config/plugin.ts +2 -2
- package/src/config/tui-host-attention.ts +2 -2
- package/src/config/tui-migrate.ts +12 -12
- package/src/config/tui.ts +23 -23
- package/src/config/variable.ts +1 -1
- package/src/control-plane/adapters/index.ts +1 -1
- package/src/control-plane/dev/README.md +5 -5
- package/src/control-plane/dev/debug-workspace-plugin.ts +2 -2
- package/src/control-plane/types.ts +3 -3
- package/src/control-plane/workspace-context.ts +1 -1
- package/src/control-plane/workspace.ts +17 -17
- 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/config-service.ts +3 -3
- package/src/effect/instance-ref.ts +3 -3
- package/src/effect/instance-state.ts +1 -1
- package/src/effect/run-service.ts +2 -2
- package/src/effect/runtime-flags.ts +34 -34
- package/src/env/index.ts +3 -3
- package/src/event-manifest.ts +1 -1
- package/src/event-v2-bridge.ts +7 -7
- package/src/format/formatter.ts +2 -2
- package/src/format/index.ts +4 -4
- package/src/git/index.ts +3 -3
- package/src/ide/index.ts +4 -4
- package/src/image/image.ts +4 -4
- package/src/index.ts +1 -1
- package/src/installation/index.ts +32 -32
- package/src/lsp/lsp.ts +5 -5
- package/src/lsp/server.ts +5 -5
- package/src/mcp/auth.ts +6 -6
- package/src/mcp/browser.ts +2 -2
- package/src/mcp/index.ts +17 -17
- package/src/mcp/oauth-callback.ts +1 -1
- package/src/mcp/oauth-provider.ts +2 -2
- package/src/node.ts +1 -1
- package/src/patch/index.ts +1 -1
- package/src/permission/index.ts +5 -5
- package/src/plugin/azure.ts +1 -1
- package/src/plugin/cloudflare.ts +1 -1
- package/src/plugin/digitalocean.ts +6 -6
- package/src/plugin/github-copilot/copilot.ts +7 -7
- package/src/plugin/github-copilot/models.ts +2 -2
- package/src/plugin/index.ts +7 -7
- package/src/plugin/install.ts +6 -6
- package/src/plugin/loader.ts +3 -3
- package/src/plugin/meta.ts +4 -4
- package/src/plugin/openai/README.md +1 -1
- package/src/plugin/openai/codex.ts +8 -8
- package/src/plugin/openai/ws-pool.ts +1 -1
- package/src/plugin/pty-environment.ts +1 -1
- package/src/plugin/shared.ts +7 -7
- package/src/plugin/snowflake-cortex.ts +6 -6
- package/src/plugin/tui/internal.ts +1 -1
- package/src/plugin/tui/runtime.ts +17 -17
- package/src/plugin/xai.ts +8 -8
- package/src/project/bootstrap-service.ts +1 -1
- package/src/project/bootstrap.ts +1 -1
- package/src/project/instance-context.ts +1 -1
- package/src/project/instance-store.ts +5 -5
- package/src/project/project.ts +18 -18
- package/src/project/vcs.ts +5 -5
- package/src/provider/auth.ts +6 -6
- package/src/provider/error.ts +3 -3
- package/src/provider/model-status.ts +1 -1
- package/src/provider/provider.ts +38 -38
- package/src/provider/transform.ts +4 -4
- package/src/question/index.ts +3 -3
- package/src/question/schema.ts +1 -1
- package/src/server/auth.ts +6 -6
- package/src/server/event.ts +1 -1
- package/src/server/mdns.ts +2 -2
- package/src/server/proxy-util.ts +2 -2
- package/src/server/routes/instance/httpapi/api.ts +10 -10
- package/src/server/routes/instance/httpapi/groups/config.ts +4 -4
- 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 +7 -7
- package/src/server/routes/instance/httpapi/groups/file.ts +3 -3
- package/src/server/routes/instance/httpapi/groups/global.ts +10 -10
- package/src/server/routes/instance/httpapi/groups/instance.ts +6 -6
- package/src/server/routes/instance/httpapi/groups/mcp.ts +2 -2
- package/src/server/routes/instance/httpapi/groups/permission.ts +2 -2
- package/src/server/routes/instance/httpapi/groups/project-copy.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/project.ts +4 -4
- package/src/server/routes/instance/httpapi/groups/provider.ts +2 -2
- package/src/server/routes/instance/httpapi/groups/pty.ts +5 -5
- package/src/server/routes/instance/httpapi/groups/question.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/session.ts +8 -8
- package/src/server/routes/instance/httpapi/groups/sync.ts +3 -3
- package/src/server/routes/instance/httpapi/groups/tui.ts +1 -1
- package/src/server/routes/instance/httpapi/groups/workspace.ts +1 -1
- 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 +3 -3
- package/src/server/routes/instance/httpapi/middleware/error.ts +2 -2
- package/src/server/routes/instance/httpapi/middleware/fence.ts +3 -3
- package/src/server/routes/instance/httpapi/middleware/instance-context.ts +1 -1
- package/src/server/routes/instance/httpapi/middleware/schema-error.ts +1 -1
- package/src/server/routes/instance/httpapi/middleware/workspace-routing.ts +6 -6
- package/src/server/routes/instance/httpapi/public.ts +6 -6
- package/src/server/routes/instance/httpapi/server.ts +27 -27
- package/src/server/routes/instance/httpapi/websocket-tracker.ts +2 -2
- package/src/server/server.ts +3 -3
- package/src/server/shared/fence.ts +4 -4
- package/src/server/shared/pty-ticket.ts +1 -1
- package/src/server/shared/ui.ts +3 -3
- package/src/server/tui-event.ts +1 -1
- package/src/session/compaction.ts +9 -9
- package/src/session/instruction.ts +9 -9
- package/src/session/llm/AGENTS.md +12 -12
- 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 +7 -7
- package/src/session/llm/request.ts +10 -10
- package/src/session/llm.ts +12 -12
- 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 +6 -6
- package/src/session/prompt/anthropic.txt +2 -11
- package/src/session/prompt/beast.txt +147 -147
- package/src/session/prompt/codex.txt +1 -1
- package/src/session/prompt/copilot-gpt-5.txt +1 -1
- package/src/session/prompt/default.txt +1 -7
- package/src/session/prompt/gemini.txt +1 -1
- package/src/session/prompt/gpt.txt +1 -1
- package/src/session/prompt/kimi.txt +1 -1
- package/src/session/prompt/meta.txt +3 -4
- package/src/session/prompt/trinity.txt +1 -1
- package/src/session/prompt.ts +14 -14
- package/src/session/reminders.ts +2 -2
- package/src/session/retry.ts +5 -5
- package/src/session/revert.ts +3 -3
- package/src/session/run-state.ts +3 -3
- package/src/session/schema.ts +2 -2
- package/src/session/session.ts +22 -22
- package/src/session/status.ts +3 -3
- package/src/session/summary.ts +3 -3
- package/src/session/system.ts +7 -7
- package/src/session/todo.ts +5 -5
- package/src/session/tools.ts +3 -3
- package/src/share/session.ts +2 -2
- package/src/share/share-next.ts +11 -11
- package/src/skill/discovery.ts +7 -7
- package/src/skill/index.ts +21 -21
- package/src/snapshot/index.ts +7 -7
- package/src/storage/schema.ts +5 -5
- package/src/storage/storage.ts +5 -5
- package/src/sync/schema.ts +1 -1
- package/src/temporary.ts +4 -4
- 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/lsp.txt +1 -1
- package/src/tool/plan.ts +1 -1
- package/src/tool/read.ts +2 -2
- package/src/tool/registry.ts +13 -13
- package/src/tool/schema.ts +1 -1
- package/src/tool/shell/id.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 +3 -3
- package/src/tool/tool.ts +2 -2
- package/src/tool/truncate.ts +4 -4
- package/src/tool/truncation-dir.ts +1 -1
- package/src/tool/webfetch.ts +1 -1
- package/src/tool/websearch.ts +4 -4
- package/src/tool/write.ts +3 -3
- package/src/util/bom.ts +1 -1
- package/src/util/error.ts +1 -1
- package/src/util/filesystem.ts +2 -2
- package/src/util/locale.ts +2 -2
- package/src/util/process.ts +1 -1
- package/src/util/record.ts +1 -1
- package/src/util/repository.ts +2 -2
- package/src/util/token.ts +1 -1
- package/src/worktree/index.ts +12 -12
package/src/config/tui.ts
CHANGED
|
@@ -2,27 +2,27 @@ export * as TuiConfig from "./tui"
|
|
|
2
2
|
|
|
3
3
|
import path from "path"
|
|
4
4
|
import { mergeDeep, unique } from "remeda"
|
|
5
|
-
import { AppNodeBuilder } from "@
|
|
6
|
-
import { LayerNode } from "@
|
|
5
|
+
import { AppNodeBuilder } from "@anymous-ai/core/effect/app-node-builder"
|
|
6
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
7
7
|
import { Cause, Context, Effect, Fiber, Layer } from "effect"
|
|
8
8
|
import { ConfigParse } from "@/config/parse"
|
|
9
9
|
import * as ConfigPaths from "@/config/paths"
|
|
10
10
|
import { migrateTuiConfig } from "./tui-migrate"
|
|
11
11
|
import { resolveHostAttentionSoundPaths } from "./tui-host-attention"
|
|
12
|
-
import { Flag } from "@
|
|
13
|
-
import { isRecord } from "@
|
|
14
|
-
import { Global } from "@
|
|
15
|
-
import { FSUtil } from "@
|
|
12
|
+
import { Flag } from "@anymous-ai/core/flag/flag"
|
|
13
|
+
import { isRecord } from "@anymous-ai/tui/util/record"
|
|
14
|
+
import { Global } from "@anymous-ai/core/global"
|
|
15
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
16
16
|
import { CurrentWorkingDirectory } from "./tui-cwd"
|
|
17
17
|
import { ConfigPlugin } from "@/config/plugin"
|
|
18
|
-
import { TuiKeybind } from "@
|
|
19
|
-
import { InstallationLocal, InstallationVersion } from "@
|
|
20
|
-
import { makeRuntime } from "@
|
|
18
|
+
import { TuiKeybind } from "@anymous-ai/tui/config/keybind"
|
|
19
|
+
import { InstallationLocal, InstallationVersion } from "@anymous-ai/core/installation/version"
|
|
20
|
+
import { makeRuntime } from "@anymous-ai/core/effect/runtime"
|
|
21
21
|
import { Filesystem } from "@/util/filesystem"
|
|
22
22
|
import { ConfigVariable } from "@/config/variable"
|
|
23
|
-
import { Npm } from "@
|
|
23
|
+
import { Npm } from "@anymous-ai/core/npm"
|
|
24
24
|
import { FormatError, FormatUnknownError } from "@/cli/error"
|
|
25
|
-
import { TuiConfig } from "@
|
|
25
|
+
import { TuiConfig } from "@anymous-ai/tui/config"
|
|
26
26
|
|
|
27
27
|
export const Info = TuiConfig.Info
|
|
28
28
|
export type Info = TuiConfig.Info
|
|
@@ -44,7 +44,7 @@ export interface Interface {
|
|
|
44
44
|
readonly waitForDependencies: () => Effect.Effect<void>
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
47
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/TuiConfig") {}
|
|
48
48
|
|
|
49
49
|
function pluginScope(file: string, ctx: { directory: string }): ConfigPlugin.Scope {
|
|
50
50
|
if (Filesystem.contains(ctx.directory, file)) return "local"
|
|
@@ -104,7 +104,7 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory:
|
|
|
104
104
|
const data = ConfigParse.jsonc(expanded, configFilepath)
|
|
105
105
|
if (!isRecord(data)) return {} as Info
|
|
106
106
|
// Flatten a nested "tui" key so users who wrote `{ "tui": { ... } }` inside tui.json
|
|
107
|
-
// (mirroring the old
|
|
107
|
+
// (mirroring the old anymous.json shape) still get their settings applied.
|
|
108
108
|
const normalized = dropUnknownKeybinds(normalize(data))
|
|
109
109
|
const parsed = ConfigParse.schema(Info, normalized, configFilepath)
|
|
110
110
|
const validated = parsed.attention?.sounds
|
|
@@ -168,12 +168,12 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory:
|
|
|
168
168
|
acc.plugin_origins = plugins
|
|
169
169
|
})
|
|
170
170
|
|
|
171
|
-
// Every config dir we may read from: global config dir, any `.
|
|
172
|
-
// folders between cwd and home, and
|
|
171
|
+
// Every config dir we may read from: global config dir, any `.anymous`
|
|
172
|
+
// folders between cwd and home, and ANYMOUS_CONFIG_DIR.
|
|
173
173
|
const directories = yield* ConfigPaths.directories(ctx.directory)
|
|
174
174
|
yield* Effect.promise(() => migrateTuiConfig({ directories, cwd: ctx.directory }))
|
|
175
175
|
|
|
176
|
-
const projectFiles = Flag.
|
|
176
|
+
const projectFiles = Flag.ANYMOUS_DISABLE_PROJECT_CONFIG ? [] : yield* ConfigPaths.files("tui", ctx.directory)
|
|
177
177
|
|
|
178
178
|
const acc: Acc = {
|
|
179
179
|
result: {},
|
|
@@ -185,9 +185,9 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory:
|
|
|
185
185
|
yield* mergeFile(acc, file)
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
// 2. Explicit
|
|
189
|
-
if (Flag.
|
|
190
|
-
const configFile = Flag.
|
|
188
|
+
// 2. Explicit ANYMOUS_TUI_CONFIG override, if set.
|
|
189
|
+
if (Flag.ANYMOUS_TUI_CONFIG) {
|
|
190
|
+
const configFile = Flag.ANYMOUS_TUI_CONFIG
|
|
191
191
|
yield* mergeFile(acc, configFile)
|
|
192
192
|
yield* Effect.logDebug("loaded custom tui config", { path: configFile })
|
|
193
193
|
}
|
|
@@ -197,13 +197,13 @@ const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory:
|
|
|
197
197
|
yield* mergeFile(acc, file)
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
// 4. `.
|
|
200
|
+
// 4. `.anymous` directories (and ANYMOUS_CONFIG_DIR) discovered while
|
|
201
201
|
// walking up the tree. Also returned below so callers can install plugin
|
|
202
202
|
// dependencies from each location.
|
|
203
|
-
const dirs = unique(directories).filter((dir) => dir.endsWith(".
|
|
203
|
+
const dirs = unique(directories).filter((dir) => dir.endsWith(".anymous") || dir === Flag.ANYMOUS_CONFIG_DIR)
|
|
204
204
|
|
|
205
205
|
for (const dir of dirs) {
|
|
206
|
-
if (!dir.endsWith(".
|
|
206
|
+
if (!dir.endsWith(".anymous") && dir !== Flag.ANYMOUS_CONFIG_DIR) continue
|
|
207
207
|
for (const file of ConfigPaths.fileInDirectory(dir, "tui")) {
|
|
208
208
|
yield* mergeFile(acc, file)
|
|
209
209
|
}
|
|
@@ -238,7 +238,7 @@ const layer = Layer.effect(
|
|
|
238
238
|
.install(dir, {
|
|
239
239
|
add: [
|
|
240
240
|
{
|
|
241
|
-
name: "@
|
|
241
|
+
name: "@anymous-ai/plugin",
|
|
242
242
|
version: InstallationLocal ? undefined : InstallationVersion,
|
|
243
243
|
},
|
|
244
244
|
],
|
package/src/config/variable.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * as ConfigVariable from "./variable"
|
|
|
3
3
|
import path from "path"
|
|
4
4
|
import os from "os"
|
|
5
5
|
import { Filesystem } from "@/util/filesystem"
|
|
6
|
-
import { InvalidError } from "@
|
|
6
|
+
import { InvalidError } from "@anymous-ai/core/v1/config/error"
|
|
7
7
|
|
|
8
8
|
type ParseSource =
|
|
9
9
|
| {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
This is a plugin to simulate a remote environment locally. Add this to `.
|
|
1
|
+
This is a plugin to simulate a remote environment locally. Add this to `.anymous/anymous.jsonc`:
|
|
2
2
|
|
|
3
3
|
```json
|
|
4
|
-
"plugin": ["../packages/
|
|
4
|
+
"plugin": ["../packages/anymous/src/control-plane/dev/debug-workspace-plugin.ts"],
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
In a separate terminal, run a separate
|
|
7
|
+
In a separate terminal, run a separate anymous server. This will act like a remote server and the local instance will proxy all requests to it:
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
./packages/
|
|
10
|
+
./packages/anymous/script/run-workspace-server
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
With the plugin install, you can now run
|
|
13
|
+
With the plugin install, you can now run anymous and create a `debug` workspace type. This will create a "remote" workspace which talks to the second workspace server started above.
|
|
14
14
|
|
|
15
15
|
How this works:
|
|
16
16
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Plugin } from "@
|
|
1
|
+
import type { Plugin } from "@anymous-ai/plugin"
|
|
2
2
|
import { rename, writeFile } from "node:fs/promises"
|
|
3
3
|
import { randomInt } from "node:crypto"
|
|
4
4
|
import { setTimeout as sleep } from "node:timers/promises"
|
|
5
5
|
|
|
6
|
-
const DEV_DATA_FILE = "/tmp/
|
|
6
|
+
const DEV_DATA_FILE = "/tmp/anymous-workspace-dev-data.json"
|
|
7
7
|
const DEV_DATA_TEMP_FILE = `${DEV_DATA_FILE}.tmp`
|
|
8
8
|
|
|
9
9
|
async function waitForHealth(port: number) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema, Struct } from "effect"
|
|
2
|
-
import { ProjectV2 } from "@
|
|
2
|
+
import { ProjectV2 } from "@anymous-ai/core/project"
|
|
3
3
|
import type { InstanceContext } from "@/project/instance-context"
|
|
4
|
-
import { WorkspaceV2 } from "@
|
|
5
|
-
import type { DeepMutable } from "@
|
|
4
|
+
import { WorkspaceV2 } from "@anymous-ai/core/workspace"
|
|
5
|
+
import type { DeepMutable } from "@anymous-ai/core/schema"
|
|
6
6
|
|
|
7
7
|
export const WorkspaceInfo = Schema.Struct({
|
|
8
8
|
id: WorkspaceV2.ID,
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { httpClient } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { httpClient } from "@anymous-ai/core/effect/app-node-platform"
|
|
3
3
|
import { Context, Effect, FiberMap, Iterable, Layer, Schema, Stream } from "effect"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
5
5
|
import { FetchHttpClient, HttpBody, HttpClient, HttpClientError, HttpClientRequest } from "effect/unstable/http"
|
|
6
|
-
import { Database } from "@
|
|
6
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
7
7
|
import { asc } from "drizzle-orm"
|
|
8
8
|
import { eq } from "drizzle-orm"
|
|
9
9
|
import { inArray } from "drizzle-orm"
|
|
10
10
|
import { Project } from "@/project/project"
|
|
11
11
|
import { GlobalBus } from "@/bus/global"
|
|
12
12
|
import { Auth } from "@/auth"
|
|
13
|
-
import { EventV2 } from "@
|
|
13
|
+
import { EventV2 } from "@anymous-ai/core/event"
|
|
14
14
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
15
|
-
import { EventSequenceTable, EventTable } from "@
|
|
16
|
-
import { FSUtil } from "@
|
|
15
|
+
import { EventSequenceTable, EventTable } from "@anymous-ai/core/event/sql"
|
|
16
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
17
17
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
18
|
-
import { ProjectV2 } from "@
|
|
19
|
-
import { Slug } from "@
|
|
20
|
-
import { WorkspaceTable } from "@
|
|
18
|
+
import { ProjectV2 } from "@anymous-ai/core/project"
|
|
19
|
+
import { Slug } from "@anymous-ai/core/util/slug"
|
|
20
|
+
import { WorkspaceTable } from "@anymous-ai/core/control-plane/workspace.sql"
|
|
21
21
|
import { getAdapter, registeredAdapters } from "./adapters"
|
|
22
22
|
import { type Target, type WorkspaceInfo, WorkspaceInfo as WorkspaceInfoSchema } from "./types"
|
|
23
|
-
import { WorkspaceV2 } from "@
|
|
23
|
+
import { WorkspaceV2 } from "@anymous-ai/core/workspace"
|
|
24
24
|
import { Session } from "@/session/session"
|
|
25
25
|
import { SessionPrompt } from "@/session/prompt"
|
|
26
|
-
import { SessionTable } from "@
|
|
26
|
+
import { SessionTable } from "@anymous-ai/core/session/sql"
|
|
27
27
|
import { SessionID } from "@/session/schema"
|
|
28
28
|
import { NotFoundError } from "@/storage/storage"
|
|
29
29
|
import { errorData } from "@/util/error"
|
|
@@ -33,7 +33,7 @@ import { Vcs } from "@/project/vcs"
|
|
|
33
33
|
import { InstanceStore } from "@/project/instance-store"
|
|
34
34
|
import { WorkspaceAdapterRuntime } from "./workspace-adapter-runtime"
|
|
35
35
|
import { AppNodeBuilderV1 } from "@/effect/app-node-builder-v1"
|
|
36
|
-
import { WorkspaceEvent } from "@
|
|
36
|
+
import { WorkspaceEvent } from "@anymous-ai/schema/workspace-event"
|
|
37
37
|
|
|
38
38
|
export const Info = Schema.Struct({
|
|
39
39
|
...WorkspaceInfoSchema.fields,
|
|
@@ -146,7 +146,7 @@ export interface Interface {
|
|
|
146
146
|
readonly startWorkspaceSyncing: (projectID: ProjectV2.ID) => Effect.Effect<void>
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
149
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Workspace") {}
|
|
150
150
|
|
|
151
151
|
export const use = serviceUse(Service)
|
|
152
152
|
|
|
@@ -527,9 +527,9 @@ const layer = Layer.effect(
|
|
|
527
527
|
.pipe(Effect.orDie)
|
|
528
528
|
|
|
529
529
|
const env = {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
ANYMOUS_AUTH_CONTENT: JSON.stringify(yield* auth.all()),
|
|
531
|
+
ANYMOUS_WORKSPACE_ID: config.id,
|
|
532
|
+
ANYMOUS_EXPERIMENTAL_WORKSPACES: "true",
|
|
533
533
|
OTEL_EXPORTER_OTLP_HEADERS: process.env.OTEL_EXPORTER_OTLP_HEADERS,
|
|
534
534
|
OTEL_EXPORTER_OTLP_ENDPOINT: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
|
|
535
535
|
OTEL_RESOURCE_ATTRIBUTES: process.env.OTEL_RESOURCE_ATTRIBUTES,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppNodeBuilder } from "@
|
|
2
|
-
import { LayerNode } from "@
|
|
1
|
+
import { AppNodeBuilder } from "@anymous-ai/core/effect/app-node-builder"
|
|
2
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
3
3
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
4
4
|
import { InstanceStore } from "@/project/instance-store"
|
|
5
5
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Layer, ManagedRuntime } from "effect"
|
|
2
2
|
import { attach } from "./run-service"
|
|
3
|
-
import * as Observability from "@
|
|
3
|
+
import * as Observability from "@anymous-ai/core/observability"
|
|
4
4
|
|
|
5
|
-
import { FSUtil } from "@
|
|
6
|
-
import { Database } from "@
|
|
5
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
6
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
7
7
|
import { Auth } from "@/auth"
|
|
8
8
|
import { Account } from "@/account/account"
|
|
9
9
|
import { Config } from "@/config/config"
|
|
10
10
|
import { Git } from "@/git"
|
|
11
|
-
import { Ripgrep } from "@
|
|
11
|
+
import { Ripgrep } from "@anymous-ai/core/ripgrep"
|
|
12
12
|
import { Storage } from "@/storage/storage"
|
|
13
13
|
import { Snapshot } from "@/snapshot"
|
|
14
14
|
import { Plugin } from "@/plugin"
|
|
15
|
-
import { ModelsDev } from "@
|
|
15
|
+
import { ModelsDev } from "@anymous-ai/core/models-dev"
|
|
16
16
|
import { Provider } from "@/provider/provider"
|
|
17
17
|
import { ProviderAuth } from "@/provider/auth"
|
|
18
18
|
import { Agent } from "@/agent/agent"
|
|
@@ -46,14 +46,14 @@ import { Worktree } from "@/worktree"
|
|
|
46
46
|
import { Installation } from "@/installation"
|
|
47
47
|
import { ShareNext } from "@/share/share-next"
|
|
48
48
|
import { SessionShare } from "@/share/session"
|
|
49
|
-
import { Npm } from "@
|
|
50
|
-
import { memoMap } from "@
|
|
49
|
+
import { Npm } from "@anymous-ai/core/npm"
|
|
50
|
+
import { memoMap } from "@anymous-ai/core/effect/memo-map"
|
|
51
51
|
import { BackgroundJob } from "@/background/job"
|
|
52
52
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
53
53
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
54
|
-
import { LayerNode } from "@
|
|
54
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
55
55
|
import { AppNodeBuilderV1 } from "./app-node-builder-v1"
|
|
56
|
-
import { SessionProjector } from "@
|
|
56
|
+
import { SessionProjector } from "@anymous-ai/core/session/projector"
|
|
57
57
|
|
|
58
58
|
export const AppLayer = AppNodeBuilderV1.build(
|
|
59
59
|
LayerNode.group([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Layer, ManagedRuntime } from "effect"
|
|
2
|
-
import { AppNodeBuilder } from "@
|
|
3
|
-
import { LayerNode } from "@
|
|
2
|
+
import { AppNodeBuilder } from "@anymous-ai/core/effect/app-node-builder"
|
|
3
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
4
4
|
|
|
5
5
|
import { Plugin } from "@/plugin"
|
|
6
6
|
import { LSP } from "@/lsp/lsp"
|
|
@@ -9,8 +9,8 @@ import { ShareNext } from "@/share/share-next"
|
|
|
9
9
|
import { Vcs } from "@/project/vcs"
|
|
10
10
|
import { Snapshot } from "@/snapshot"
|
|
11
11
|
import { Config } from "@/config/config"
|
|
12
|
-
import * as Observability from "@
|
|
13
|
-
import { memoMap } from "@
|
|
12
|
+
import * as Observability from "@anymous-ai/core/observability"
|
|
13
|
+
import { memoMap } from "@anymous-ai/core/effect/memo-map"
|
|
14
14
|
|
|
15
15
|
export const BootstrapLayer = AppNodeBuilder.build(
|
|
16
16
|
LayerNode.group([Config.node, Plugin.node, ShareNext.node, Format.node, LSP.node, Vcs.node, Snapshot.node]),
|
package/src/effect/bridge.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, Exit, Fiber } from "effect"
|
|
2
2
|
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
|
3
|
-
import type { WorkspaceV2 } from "@
|
|
3
|
+
import type { WorkspaceV2 } from "@anymous-ai/core/workspace"
|
|
4
4
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
|
5
5
|
import { attachWith } from "./run-service"
|
|
6
6
|
|
|
@@ -28,10 +28,10 @@ export type ServiceClass<Self, Id extends string, Service> = Context.ServiceClas
|
|
|
28
28
|
*
|
|
29
29
|
* ```ts
|
|
30
30
|
* class ServerAuthConfig extends ConfigService.Service<ServerAuthConfig>()(
|
|
31
|
-
* "@
|
|
31
|
+
* "@anymous/ServerAuthConfig",
|
|
32
32
|
* {
|
|
33
|
-
* password: Config.string("
|
|
34
|
-
* username: Config.string("
|
|
33
|
+
* password: Config.string("ANYMOUS_SERVER_PASSWORD").pipe(Config.option),
|
|
34
|
+
* username: Config.string("ANYMOUS_SERVER_USERNAME").pipe(Config.withDefault("anymous")),
|
|
35
35
|
* },
|
|
36
36
|
* ) {}
|
|
37
37
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Context } from "effect"
|
|
2
2
|
import type { InstanceContext } from "@/project/instance-context"
|
|
3
|
-
import type { WorkspaceV2 } from "@
|
|
3
|
+
import type { WorkspaceV2 } from "@anymous-ai/core/workspace"
|
|
4
4
|
|
|
5
|
-
export const InstanceRef = Context.Reference<InstanceContext | undefined>("~
|
|
5
|
+
export const InstanceRef = Context.Reference<InstanceContext | undefined>("~anymous/InstanceRef", {
|
|
6
6
|
defaultValue: () => undefined,
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
export const WorkspaceRef = Context.Reference<WorkspaceV2.ID | undefined>("~
|
|
9
|
+
export const WorkspaceRef = Context.Reference<WorkspaceV2.ID | undefined>("~anymous/WorkspaceRef", {
|
|
10
10
|
defaultValue: () => undefined,
|
|
11
11
|
})
|
|
@@ -4,7 +4,7 @@ import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
|
|
4
4
|
import { registerDisposer } from "./instance-registry"
|
|
5
5
|
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
|
6
6
|
|
|
7
|
-
const TypeId = "~
|
|
7
|
+
const TypeId = "~anymous/InstanceState"
|
|
8
8
|
|
|
9
9
|
export interface InstanceState<A, E = never, R = never> {
|
|
10
10
|
readonly [TypeId]: typeof TypeId
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Fiber, Layer, ManagedRuntime } from "effect"
|
|
2
2
|
import * as Context from "effect/Context"
|
|
3
3
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
|
4
|
-
import * as Observability from "@
|
|
4
|
+
import * as Observability from "@anymous-ai/core/observability"
|
|
5
5
|
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
|
6
6
|
import type { InstanceContext } from "@/project/instance-context"
|
|
7
|
-
import { memoMap } from "@
|
|
7
|
+
import { memoMap } from "@anymous-ai/core/effect/memo-map"
|
|
8
8
|
|
|
9
9
|
type Refs = {
|
|
10
10
|
instance?: InstanceContext
|
|
@@ -7,53 +7,53 @@ const positiveInteger = (name: string) =>
|
|
|
7
7
|
Config.map((value) => (Number.isInteger(value) && value > 0 ? value : undefined)),
|
|
8
8
|
Config.orElse(() => Config.succeed(undefined)),
|
|
9
9
|
)
|
|
10
|
-
const experimental = bool("
|
|
10
|
+
const experimental = bool("ANYMOUS_EXPERIMENTAL")
|
|
11
11
|
const enabledByExperimental = (name: string) =>
|
|
12
12
|
Config.all({ experimental, enabled: Config.boolean(name).pipe(Config.option) }).pipe(
|
|
13
13
|
Config.map((flags) => Option.getOrElse(flags.enabled, () => flags.experimental)),
|
|
14
14
|
)
|
|
15
15
|
|
|
16
|
-
export class Service extends ConfigService.Service<Service>()("@
|
|
17
|
-
autoShare: bool("
|
|
18
|
-
pure: bool("
|
|
19
|
-
disableDefaultPlugins: bool("
|
|
20
|
-
disableEmbeddedWebUi: bool("
|
|
21
|
-
disableExternalSkills: bool("
|
|
22
|
-
disableLspDownload: bool("
|
|
16
|
+
export class Service extends ConfigService.Service<Service>()("@anymous/RuntimeFlags", {
|
|
17
|
+
autoShare: bool("ANYMOUS_AUTO_SHARE"),
|
|
18
|
+
pure: bool("ANYMOUS_PURE"),
|
|
19
|
+
disableDefaultPlugins: bool("ANYMOUS_DISABLE_DEFAULT_PLUGINS"),
|
|
20
|
+
disableEmbeddedWebUi: bool("ANYMOUS_DISABLE_EMBEDDED_WEB_UI"),
|
|
21
|
+
disableExternalSkills: bool("ANYMOUS_DISABLE_EXTERNAL_SKILLS"),
|
|
22
|
+
disableLspDownload: bool("ANYMOUS_DISABLE_LSP_DOWNLOAD"),
|
|
23
23
|
disableClaudeCodePrompt: Config.all({
|
|
24
|
-
broad: bool("
|
|
25
|
-
direct: bool("
|
|
24
|
+
broad: bool("ANYMOUS_DISABLE_CLAUDE_CODE"),
|
|
25
|
+
direct: bool("ANYMOUS_DISABLE_CLAUDE_CODE_PROMPT"),
|
|
26
26
|
}).pipe(Config.map((flags) => flags.broad || flags.direct)),
|
|
27
27
|
disableClaudeCodeSkills: Config.all({
|
|
28
|
-
broad: bool("
|
|
29
|
-
direct: bool("
|
|
28
|
+
broad: bool("ANYMOUS_DISABLE_CLAUDE_CODE"),
|
|
29
|
+
direct: bool("ANYMOUS_DISABLE_CLAUDE_CODE_SKILLS"),
|
|
30
30
|
}).pipe(Config.map((flags) => flags.broad || flags.direct)),
|
|
31
31
|
enableExa: Config.all({
|
|
32
32
|
experimental,
|
|
33
|
-
enabled: bool("
|
|
34
|
-
legacy: bool("
|
|
33
|
+
enabled: bool("ANYMOUS_ENABLE_EXA"),
|
|
34
|
+
legacy: bool("ANYMOUS_EXPERIMENTAL_EXA"),
|
|
35
35
|
}).pipe(Config.map((flags) => flags.experimental || flags.enabled || flags.legacy)),
|
|
36
36
|
enableParallel: Config.all({
|
|
37
|
-
enabled: bool("
|
|
38
|
-
legacy: bool("
|
|
37
|
+
enabled: bool("ANYMOUS_ENABLE_PARALLEL"),
|
|
38
|
+
legacy: bool("ANYMOUS_EXPERIMENTAL_PARALLEL"),
|
|
39
39
|
}).pipe(Config.map((flags) => flags.enabled || flags.legacy)),
|
|
40
|
-
enableExperimentalModels: bool("
|
|
41
|
-
enableQuestionTool: bool("
|
|
42
|
-
experimentalReferences: enabledByExperimental("
|
|
43
|
-
experimentalBackgroundSubagents: enabledByExperimental("
|
|
44
|
-
experimentalLspTy: bool("
|
|
45
|
-
experimentalLspTool: enabledByExperimental("
|
|
46
|
-
experimentalOxfmt: enabledByExperimental("
|
|
47
|
-
experimentalPlanMode: enabledByExperimental("
|
|
48
|
-
experimentalCodeMode: enabledByExperimental("
|
|
49
|
-
experimentalEventSystem: enabledByExperimental("
|
|
50
|
-
experimentalWorkspaces: enabledByExperimental("
|
|
51
|
-
experimentalIconDiscovery: enabledByExperimental("
|
|
52
|
-
outputTokenMax: positiveInteger("
|
|
53
|
-
bashDefaultTimeoutMs: positiveInteger("
|
|
54
|
-
experimentalNativeLlm: bool("
|
|
55
|
-
experimentalWebSockets: bool("
|
|
56
|
-
client: Config.string("
|
|
40
|
+
enableExperimentalModels: bool("ANYMOUS_ENABLE_EXPERIMENTAL_MODELS"),
|
|
41
|
+
enableQuestionTool: bool("ANYMOUS_ENABLE_QUESTION_TOOL"),
|
|
42
|
+
experimentalReferences: enabledByExperimental("ANYMOUS_EXPERIMENTAL_REFERENCES"),
|
|
43
|
+
experimentalBackgroundSubagents: enabledByExperimental("ANYMOUS_EXPERIMENTAL_BACKGROUND_SUBAGENTS"),
|
|
44
|
+
experimentalLspTy: bool("ANYMOUS_EXPERIMENTAL_LSP_TY"),
|
|
45
|
+
experimentalLspTool: enabledByExperimental("ANYMOUS_EXPERIMENTAL_LSP_TOOL"),
|
|
46
|
+
experimentalOxfmt: enabledByExperimental("ANYMOUS_EXPERIMENTAL_OXFMT"),
|
|
47
|
+
experimentalPlanMode: enabledByExperimental("ANYMOUS_EXPERIMENTAL_PLAN_MODE"),
|
|
48
|
+
experimentalCodeMode: enabledByExperimental("ANYMOUS_EXPERIMENTAL_CODE_MODE"),
|
|
49
|
+
experimentalEventSystem: enabledByExperimental("ANYMOUS_EXPERIMENTAL_EVENT_SYSTEM"),
|
|
50
|
+
experimentalWorkspaces: enabledByExperimental("ANYMOUS_EXPERIMENTAL_WORKSPACES"),
|
|
51
|
+
experimentalIconDiscovery: enabledByExperimental("ANYMOUS_EXPERIMENTAL_ICON_DISCOVERY"),
|
|
52
|
+
outputTokenMax: positiveInteger("ANYMOUS_EXPERIMENTAL_OUTPUT_TOKEN_MAX"),
|
|
53
|
+
bashDefaultTimeoutMs: positiveInteger("ANYMOUS_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS"),
|
|
54
|
+
experimentalNativeLlm: bool("ANYMOUS_EXPERIMENTAL_NATIVE_LLM"),
|
|
55
|
+
experimentalWebSockets: bool("ANYMOUS_EXPERIMENTAL_WEBSOCKETS"),
|
|
56
|
+
client: Config.string("ANYMOUS_CLIENT").pipe(Config.withDefault("cli")),
|
|
57
57
|
}) {}
|
|
58
58
|
|
|
59
59
|
export type Info = Context.Service.Shape<typeof Service>
|
|
@@ -75,4 +75,4 @@ export const layer = (overrides: Partial<Info> = {}) =>
|
|
|
75
75
|
export const node = LayerNode.make({ service: Service, layer: Service.layer.pipe(Layer.orDie), deps: [] })
|
|
76
76
|
|
|
77
77
|
export * as RuntimeFlags from "./runtime-flags"
|
|
78
|
-
import { LayerNode } from "@
|
|
78
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
package/src/env/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { Context, Effect, Layer } from "effect"
|
|
3
|
-
import { serviceUse } from "@
|
|
3
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
4
4
|
import { InstanceState } from "@/effect/instance-state"
|
|
5
5
|
|
|
6
6
|
type State = Record<string, string | undefined>
|
|
@@ -12,7 +12,7 @@ export interface Interface {
|
|
|
12
12
|
readonly remove: (key: string) => Effect.Effect<void>
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
15
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Env") {}
|
|
16
16
|
|
|
17
17
|
export const use = serviceUse(Service)
|
|
18
18
|
|
package/src/event-manifest.ts
CHANGED
package/src/event-v2-bridge.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
//
|
|
1
|
+
// anymous publish boundary for core events. Attach routed instance location
|
|
2
2
|
// so direct EventV2 consumers can isolate directory/workspace streams.
|
|
3
|
-
import { LayerNode } from "@
|
|
3
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
4
4
|
import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref"
|
|
5
5
|
import { GlobalBus } from "@/bus/global"
|
|
6
|
-
import { EventV2 } from "@
|
|
7
|
-
import { Location } from "@
|
|
8
|
-
import { Project } from "@
|
|
9
|
-
import { AbsolutePath } from "@
|
|
6
|
+
import { EventV2 } from "@anymous-ai/core/event"
|
|
7
|
+
import { Location } from "@anymous-ai/core/location"
|
|
8
|
+
import { Project } from "@anymous-ai/core/project"
|
|
9
|
+
import { AbsolutePath } from "@anymous-ai/core/schema"
|
|
10
10
|
import { Context, Effect, Layer } from "effect"
|
|
11
11
|
|
|
12
|
-
export class Service extends Context.Service<Service, EventV2.Interface>()("@
|
|
12
|
+
export class Service extends Context.Service<Service, EventV2.Interface>()("@anymous/EventV2Bridge") {}
|
|
13
13
|
|
|
14
14
|
const layer = Layer.effect(
|
|
15
15
|
Service,
|
package/src/format/formatter.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Npm } from "@
|
|
1
|
+
import { Npm } from "@anymous-ai/core/npm"
|
|
2
2
|
import type { InstanceContext } from "../project/instance-context"
|
|
3
3
|
import { Filesystem } from "@/util/filesystem"
|
|
4
4
|
import { Process } from "@/util/process"
|
|
5
|
-
import { which } from "@
|
|
5
|
+
import { which } from "@anymous-ai/core/util/which"
|
|
6
6
|
|
|
7
7
|
export interface Context extends Pick<InstanceContext, "directory" | "worktree"> {
|
|
8
8
|
experimentalOxfmt: boolean
|
package/src/format/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { Effect, Layer, Context, Schema } from "effect"
|
|
3
|
-
import { serviceUse } from "@
|
|
3
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
4
4
|
import { ChildProcess } from "effect/unstable/process"
|
|
5
|
-
import { AppProcess } from "@
|
|
5
|
+
import { AppProcess } from "@anymous-ai/core/process"
|
|
6
6
|
import { InstanceState } from "@/effect/instance-state"
|
|
7
7
|
import path from "path"
|
|
8
8
|
import { mergeDeep } from "remeda"
|
|
@@ -24,7 +24,7 @@ export interface Interface {
|
|
|
24
24
|
readonly file: (filepath: string) => Effect.Effect<boolean>
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
27
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Format") {}
|
|
28
28
|
|
|
29
29
|
export const use = serviceUse(Service)
|
|
30
30
|
|
package/src/git/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { AppProcess } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { AppProcess } from "@anymous-ai/core/process"
|
|
3
3
|
import { Effect, Layer, Context, Stream } from "effect"
|
|
4
4
|
import { ChildProcess } from "effect/unstable/process"
|
|
5
5
|
|
|
@@ -98,7 +98,7 @@ const kind = (code: string): Kind => {
|
|
|
98
98
|
return "modified"
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
101
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Git") {}
|
|
102
102
|
|
|
103
103
|
const layer = Layer.effect(
|
|
104
104
|
Service,
|
package/src/ide/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
|
-
import { NamedError } from "@
|
|
2
|
+
import { NamedError } from "@anymous-ai/core/util/error"
|
|
3
3
|
import { Process } from "@/util/process"
|
|
4
|
-
import { IdeEvent } from "@
|
|
4
|
+
import { IdeEvent } from "@anymous-ai/schema/ide-event"
|
|
5
5
|
|
|
6
6
|
const SUPPORTED_IDES = [
|
|
7
7
|
{ name: "Windsurf" as const, cmd: "windsurf" },
|
|
@@ -30,14 +30,14 @@ export function ide() {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function alreadyInstalled() {
|
|
33
|
-
return process.env["
|
|
33
|
+
return process.env["ANYMOUS_CALLER"] === "vscode" || process.env["ANYMOUS_CALLER"] === "vscode-insiders"
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export async function install(ide: (typeof SUPPORTED_IDES)[number]["name"]) {
|
|
37
37
|
const cmd = SUPPORTED_IDES.find((i) => i.name === ide)?.cmd
|
|
38
38
|
if (!cmd) throw new Error(`Unknown IDE: ${ide}`)
|
|
39
39
|
|
|
40
|
-
const p = await Process.run([cmd, "--install-extension", "sst-dev.
|
|
40
|
+
const p = await Process.run([cmd, "--install-extension", "sst-dev.anymous"], {
|
|
41
41
|
nothrow: true,
|
|
42
42
|
})
|
|
43
43
|
const stdout = p.stdout.toString()
|