anymous 1.0.5 → 1.1.1
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/bin/anymous.cjs +45 -45
- package/package.json +28 -28
- 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 +1 -1
- 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 +1 -1
- 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 +19 -19
- 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/meta.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/tsconfig.json +1 -1
- package/script/postinstall.mjs +0 -189
|
@@ -171,6 +171,8 @@ function draw(
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
const VERSION = "1.1.0"
|
|
175
|
+
|
|
174
176
|
function build(input: SplashWriterInput, kind: "entry" | "exit", ctx: ScrollbackRenderContext): ScrollbackSnapshot {
|
|
175
177
|
const width = Math.max(1, ctx.width)
|
|
176
178
|
const meta = splashMeta(input)
|
|
@@ -194,18 +196,24 @@ function build(input: SplashWriterInput, kind: "entry" | "exit", ctx: Scrollback
|
|
|
194
196
|
})
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
push(lines, body_left, top, "
|
|
199
|
+
push(lines, body_left, top, "any⋅mous", right, undefined, TextAttributes.BOLD)
|
|
200
|
+
push(lines, body_left + "any⋅mous".length + 2, top, "v" + VERSION, left, undefined, TextAttributes.DIM)
|
|
201
|
+
|
|
202
|
+
const subtitle = "AI-Powered Reverse Engineering & Pentest Platform"
|
|
203
|
+
push(lines, body_left, top + 1, Locale.truncateMiddle(subtitle, Math.max(1, width - body_left)), left, undefined)
|
|
204
|
+
|
|
198
205
|
if (input.detail) {
|
|
199
206
|
push(
|
|
200
207
|
lines,
|
|
201
208
|
body_left,
|
|
202
|
-
top +
|
|
209
|
+
top + 2,
|
|
203
210
|
Locale.truncateMiddle(input.detail, Math.max(1, width - body_left)),
|
|
204
211
|
left,
|
|
205
212
|
undefined,
|
|
213
|
+
TextAttributes.DIM,
|
|
206
214
|
)
|
|
207
215
|
}
|
|
208
|
-
height = top + mark.length
|
|
216
|
+
height = top + mark.length + (input.detail ? 1 : 0)
|
|
209
217
|
}
|
|
210
218
|
|
|
211
219
|
if (kind === "exit") {
|
|
@@ -224,9 +232,9 @@ function build(input: SplashWriterInput, kind: "entry" | "exit", ctx: Scrollback
|
|
|
224
232
|
})
|
|
225
233
|
}
|
|
226
234
|
|
|
235
|
+
push(lines, body_left, top, "any⋅mous", left, undefined, TextAttributes.DIM)
|
|
227
236
|
if (input.showSession !== false) {
|
|
228
|
-
push(lines, body_left, top,
|
|
229
|
-
push(lines, body_left + session.length, top, meta.title, right, undefined, TextAttributes.BOLD)
|
|
237
|
+
push(lines, body_left + "any⋅mous".length + 2, top, meta.title, right, undefined, TextAttributes.BOLD)
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
push(lines, body_left, top + 1, label, left, undefined, TextAttributes.DIM)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// The tick counter prevents stale idle events from resolving the wrong turn.
|
|
16
16
|
// We also re-check live session status before resolving an idle event so a
|
|
17
17
|
// delayed idle from an older turn cannot complete a newer busy turn.
|
|
18
|
-
import type { Event, GlobalEvent,
|
|
18
|
+
import type { Event, GlobalEvent, anymousClient } from "@anymous-ai/sdk/v2"
|
|
19
19
|
import { Context, Deferred, Effect, Exit, Layer, Scope, Stream } from "effect"
|
|
20
20
|
import { makeRuntime } from "@/effect/run-service"
|
|
21
21
|
import {
|
|
@@ -67,7 +67,7 @@ type Trace = {
|
|
|
67
67
|
const StreamClosed = undefined as never
|
|
68
68
|
|
|
69
69
|
type StreamInput = {
|
|
70
|
-
sdk:
|
|
70
|
+
sdk: anymousClient
|
|
71
71
|
directory?: string
|
|
72
72
|
sessionID: string
|
|
73
73
|
thinking: boolean
|
|
@@ -130,7 +130,7 @@ type TransportService = {
|
|
|
130
130
|
readonly close: () => Effect.Effect<void>
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
class Service extends Context.Service<Service, TransportService>()("@
|
|
133
|
+
class Service extends Context.Service<Service, TransportService>()("@anymous/RunStreamTransport") {}
|
|
134
134
|
|
|
135
135
|
function sid(event: Event): string | undefined {
|
|
136
136
|
if (event.type === "message.updated") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Event, Message, Part, PermissionRequest, QuestionRequest, ToolPart } from "@
|
|
1
|
+
import type { Event, Message, Part, PermissionRequest, QuestionRequest, ToolPart } from "@anymous-ai/sdk/v2"
|
|
2
2
|
import * as Locale from "@/util/locale"
|
|
3
3
|
import {
|
|
4
4
|
bootstrapSessionData,
|
package/src/cli/cmd/run/theme.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// the run footer + scrollback color model. Falls back to a hardcoded dark-mode
|
|
7
7
|
// palette if detection fails.
|
|
8
8
|
import { RGBA, SyntaxStyle, type CliRenderer, type ColorInput, type TerminalColors } from "@opentui/core"
|
|
9
|
-
import type { TuiThemeCurrent } from "@
|
|
9
|
+
import type { TuiThemeCurrent } from "@anymous-ai/plugin/tui"
|
|
10
10
|
import type { EntryKind } from "./types"
|
|
11
11
|
|
|
12
12
|
type Tone = {
|
|
@@ -671,7 +671,7 @@ export async function resolveRunTheme(renderer: CliRenderer): Promise<RunTheme>
|
|
|
671
671
|
const footerTheme = resolveTheme(generateSystem(colors, pick), pick)
|
|
672
672
|
const indexed = indexedPalette(colors, 256)
|
|
673
673
|
const scrollbackTheme = quantizeTheme(footerTheme, indexed)
|
|
674
|
-
const shared = await import("@
|
|
674
|
+
const shared = await import("@anymous-ai/tui/context/theme")
|
|
675
675
|
const syntaxTheme: SharedSyntaxTheme = {
|
|
676
676
|
...scrollbackTheme,
|
|
677
677
|
_hasSelectedListItemText: true,
|
package/src/cli/cmd/run/tool.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Per-tool display rules shared across `
|
|
1
|
+
// Per-tool display rules shared across `anymous run` output paths.
|
|
2
2
|
//
|
|
3
3
|
// Each known tool (bash, edit, write, task, etc.) has a ToolRule that controls
|
|
4
4
|
// five display hooks:
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import os from "os"
|
|
16
16
|
import path from "path"
|
|
17
17
|
import stripAnsi from "strip-ansi"
|
|
18
|
-
import type { ToolPart } from "@
|
|
18
|
+
import type { ToolPart } from "@anymous-ai/sdk/v2"
|
|
19
19
|
import type * as Tool from "@/tool/tool"
|
|
20
20
|
import type { ApplyPatchTool } from "@/tool/apply_patch"
|
|
21
21
|
import type { ShellTool as BashTool } from "@/tool/shell"
|
package/src/cli/cmd/run/trace.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Dev-only JSONL event trace for direct interactive mode.
|
|
2
2
|
//
|
|
3
|
-
// Enable with
|
|
4
|
-
// ~/.local/share/
|
|
3
|
+
// Enable with ANYMOUS_DIRECT_TRACE=1. Writes one JSON line per event to
|
|
4
|
+
// ~/.local/share/anymous/log/direct/<timestamp>-<pid>.jsonl. Also writes
|
|
5
5
|
// a latest.json pointer so you can quickly find the most recent trace.
|
|
6
6
|
//
|
|
7
7
|
// The trace captures the full closed loop: outbound prompts, inbound SDK
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// active based on the env var, and subsequent calls return the cached result.
|
|
14
14
|
import fs from "fs"
|
|
15
15
|
import path from "path"
|
|
16
|
-
import { Global } from "@
|
|
16
|
+
import { Global } from "@anymous-ai/core/global"
|
|
17
17
|
|
|
18
18
|
export type Trace = {
|
|
19
19
|
write(type: string, data?: unknown): void
|
|
@@ -55,7 +55,7 @@ export function trace(): Trace | undefined {
|
|
|
55
55
|
return state || undefined
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (!process.env.
|
|
58
|
+
if (!process.env.ANYMOUS_DIRECT_TRACE) {
|
|
59
59
|
state = false
|
|
60
60
|
return undefined
|
|
61
61
|
}
|
package/src/cli/cmd/run/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Shared type vocabulary for the direct interactive mode (`
|
|
1
|
+
// Shared type vocabulary for the direct interactive mode (`anymous --mini`).
|
|
2
2
|
//
|
|
3
3
|
// Direct mode uses a split-footer terminal layout: immutable scrollback for the
|
|
4
4
|
// session transcript, and a mutable footer for prompt input, status, and
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// → stream.ts bridges to footer API
|
|
12
12
|
// → footer.ts queues commits and patches the footer view
|
|
13
13
|
// → OpenTUI split-footer renderer writes to terminal
|
|
14
|
-
import type {
|
|
15
|
-
import type { TuiConfig } from "@
|
|
14
|
+
import type { anymousClient, PermissionRequest, QuestionRequest, ToolPart } from "@anymous-ai/sdk/v2"
|
|
15
|
+
import type { TuiConfig } from "@anymous-ai/tui/config"
|
|
16
16
|
|
|
17
17
|
export type RunFilePart = {
|
|
18
18
|
type: "file"
|
|
@@ -21,14 +21,14 @@ export type RunFilePart = {
|
|
|
21
21
|
mime: string
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type PromptModel = Parameters<
|
|
25
|
-
type PromptInput = Parameters<
|
|
24
|
+
type PromptModel = Parameters<anymousClient["session"]["prompt"]>[0]["model"]
|
|
25
|
+
type PromptInput = Parameters<anymousClient["session"]["prompt"]>[0]
|
|
26
26
|
|
|
27
27
|
export type RunPromptPart = NonNullable<PromptInput["parts"]>[number]
|
|
28
28
|
|
|
29
|
-
export type RunCommand = NonNullable<Awaited<ReturnType<
|
|
29
|
+
export type RunCommand = NonNullable<Awaited<ReturnType<anymousClient["command"]["list"]>>["data"]>[number]
|
|
30
30
|
|
|
31
|
-
export type RunProvider = NonNullable<Awaited<ReturnType<
|
|
31
|
+
export type RunProvider = NonNullable<Awaited<ReturnType<anymousClient["provider"]["list"]>>["data"]>["all"][number]
|
|
32
32
|
|
|
33
33
|
export type RunPrompt = {
|
|
34
34
|
messageID?: string
|
|
@@ -48,14 +48,14 @@ export type FooterQueuedPrompt = {
|
|
|
48
48
|
prompt: RunPrompt
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export type RunAgent = NonNullable<Awaited<ReturnType<
|
|
51
|
+
export type RunAgent = NonNullable<Awaited<ReturnType<anymousClient["app"]["agents"]>>["data"]>[number]
|
|
52
52
|
|
|
53
|
-
type RunResourceMap = NonNullable<Awaited<ReturnType<
|
|
53
|
+
type RunResourceMap = NonNullable<Awaited<ReturnType<anymousClient["experimental"]["resource"]["list"]>>["data"]>
|
|
54
54
|
|
|
55
55
|
export type RunResource = RunResourceMap[string]
|
|
56
56
|
|
|
57
57
|
export type RunInput = {
|
|
58
|
-
sdk:
|
|
58
|
+
sdk: anymousClient
|
|
59
59
|
directory: string
|
|
60
60
|
sessionID: string
|
|
61
61
|
sessionTitle?: string
|
|
@@ -280,11 +280,11 @@ export type FooterEvent =
|
|
|
280
280
|
state: FooterSubagentState
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
export type PermissionReply = Parameters<
|
|
283
|
+
export type PermissionReply = Parameters<anymousClient["permission"]["reply"]>[0]
|
|
284
284
|
|
|
285
|
-
export type QuestionReply = Parameters<
|
|
285
|
+
export type QuestionReply = Parameters<anymousClient["question"]["reply"]>[0]
|
|
286
286
|
|
|
287
|
-
export type QuestionReject = Parameters<
|
|
287
|
+
export type QuestionReject = Parameters<anymousClient["question"]["reject"]>[0]
|
|
288
288
|
|
|
289
289
|
export type RunTuiConfig = Pick<TuiConfig.Resolved, "keybinds" | "leader_timeout" | "diff_style">
|
|
290
290
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
// Variants are provider-specific reasoning effort levels (e.g., "high", "max").
|
|
4
4
|
// Resolution priority: CLI --variant flag > saved preference > session history.
|
|
5
5
|
//
|
|
6
|
-
// The saved variant persists across sessions in ~/.local/state/
|
|
6
|
+
// The saved variant persists across sessions in ~/.local/state/anymous/model.json
|
|
7
7
|
// so your last-used variant sticks. Cycling (ctrl+t) updates both the active
|
|
8
8
|
// variant and the persisted file.
|
|
9
9
|
import path from "path"
|
|
10
|
-
import { FSUtil } from "@
|
|
11
|
-
import { AppNodeBuilder } from "@
|
|
10
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
11
|
+
import { AppNodeBuilder } from "@anymous-ai/core/effect/app-node-builder"
|
|
12
12
|
import { Context, Effect, Layer } from "effect"
|
|
13
13
|
import { makeRuntime } from "@/effect/run-service"
|
|
14
|
-
import { Global } from "@
|
|
14
|
+
import { Global } from "@anymous-ai/core/global"
|
|
15
15
|
import { isRecord } from "@/util/record"
|
|
16
16
|
import { createSession, sessionVariant, type RunSession, type SessionMessages } from "./session.shared"
|
|
17
17
|
import type { RunInput, RunProvider } from "./types"
|
|
@@ -30,7 +30,7 @@ type VariantRuntime = {
|
|
|
30
30
|
saveVariant(model: RunInput["model"], variant: string | undefined): Promise<void>
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
class Service extends Context.Service<Service, VariantService>()("@
|
|
33
|
+
class Service extends Context.Service<Service, VariantService>()("@anymous/RunVariant") {}
|
|
34
34
|
|
|
35
35
|
function modelKey(provider: string, model: string): string {
|
|
36
36
|
return `${provider}/${model}`
|
package/src/cli/cmd/run.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { PermissionV1 } from "@
|
|
2
|
-
import { FSUtil } from "@
|
|
3
|
-
// CLI entry point for `
|
|
1
|
+
import type { PermissionV1 } from "@anymous-ai/core/v1/permission"
|
|
2
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
3
|
+
// CLI entry point for `anymous run` and `anymous --mini`.
|
|
4
4
|
//
|
|
5
5
|
// Handles three modes:
|
|
6
6
|
// 1. Non-interactive (default): sends a single prompt, streams events to
|
|
7
7
|
// stdout, and exits when the session goes idle.
|
|
8
|
-
// 2. Interactive local (`
|
|
8
|
+
// 2. Interactive local (`anymous --mini`): boots the split-footer direct mode
|
|
9
9
|
// with an in-process server (no external HTTP).
|
|
10
|
-
// 3. Interactive attach (`
|
|
11
|
-
//
|
|
10
|
+
// 3. Interactive attach (`anymous --mini --attach`): connects to a running
|
|
11
|
+
// anymous server and runs interactive mode against it.
|
|
12
12
|
//
|
|
13
13
|
// Also supports `--command` for slash-command execution, `--format json` for
|
|
14
14
|
// raw event streaming, `--continue` / `--session` for session resumption,
|
|
@@ -22,11 +22,11 @@ import { UI } from "../ui"
|
|
|
22
22
|
import { effectCmd } from "../effect-cmd"
|
|
23
23
|
import { EOL } from "os"
|
|
24
24
|
import { Filesystem } from "@/util/filesystem"
|
|
25
|
-
import {
|
|
25
|
+
import { createanymousClient, type anymousClient, type ToolPart } from "@anymous-ai/sdk/v2"
|
|
26
26
|
import { FormatError, FormatUnknownError } from "../error"
|
|
27
27
|
import { INTERACTIVE_INPUT_ERROR, resolveInteractiveStdin } from "./run/runtime.stdin"
|
|
28
28
|
|
|
29
|
-
type ModelInput = Parameters<
|
|
29
|
+
type ModelInput = Parameters<anymousClient["session"]["prompt"]>[0]["model"]
|
|
30
30
|
|
|
31
31
|
function pick(value: string | undefined): ModelInput | undefined {
|
|
32
32
|
if (!value) return undefined
|
|
@@ -194,12 +194,12 @@ export const RunCommand = effectCmd({
|
|
|
194
194
|
.option("password", {
|
|
195
195
|
alias: ["p"],
|
|
196
196
|
type: "string",
|
|
197
|
-
describe: "basic auth password (defaults to
|
|
197
|
+
describe: "basic auth password (defaults to ANYMOUS_SERVER_PASSWORD)",
|
|
198
198
|
})
|
|
199
199
|
.option("username", {
|
|
200
200
|
alias: ["u"],
|
|
201
201
|
type: "string",
|
|
202
|
-
describe: "basic auth username (defaults to
|
|
202
|
+
describe: "basic auth username (defaults to ANYMOUS_SERVER_USERNAME or 'anymous')",
|
|
203
203
|
})
|
|
204
204
|
.option("dir", {
|
|
205
205
|
type: "string",
|
|
@@ -347,7 +347,7 @@ export const RunCommand = effectCmd({
|
|
|
347
347
|
? ServerAuth.headers({ password: args.password, username: args.username })
|
|
348
348
|
: undefined
|
|
349
349
|
const attachSDK = (dir?: string) => {
|
|
350
|
-
return
|
|
350
|
+
return createanymousClient({
|
|
351
351
|
baseUrl: args.attach!,
|
|
352
352
|
directory: dir,
|
|
353
353
|
headers: attachHeaders,
|
|
@@ -453,7 +453,7 @@ export const RunCommand = effectCmd({
|
|
|
453
453
|
return message.slice(0, 50) + (message.length > 50 ? "..." : "")
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
-
async function session(sdk:
|
|
456
|
+
async function session(sdk: anymousClient): Promise<SessionInfo | undefined> {
|
|
457
457
|
if (args.session) {
|
|
458
458
|
const current = await sdk.session
|
|
459
459
|
.get({
|
|
@@ -532,7 +532,7 @@ export const RunCommand = effectCmd({
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
-
async function share(sdk:
|
|
535
|
+
async function share(sdk: anymousClient, sessionID: string) {
|
|
536
536
|
const cfg = await sdk.config.get()
|
|
537
537
|
if (!cfg.data) return
|
|
538
538
|
if (cfg.data.share !== "auto" && !flags.autoShare && !args.share) return
|
|
@@ -548,7 +548,7 @@ export const RunCommand = effectCmd({
|
|
|
548
548
|
}
|
|
549
549
|
|
|
550
550
|
async function createFreshSession(
|
|
551
|
-
sdk:
|
|
551
|
+
sdk: anymousClient,
|
|
552
552
|
input: { agent: string | undefined; model: ModelInput | undefined; variant: string | undefined },
|
|
553
553
|
): Promise<SessionInfo> {
|
|
554
554
|
const result = await sdk.session.create({
|
|
@@ -575,7 +575,7 @@ export const RunCommand = effectCmd({
|
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
-
async function current(sdk:
|
|
578
|
+
async function current(sdk: anymousClient): Promise<string> {
|
|
579
579
|
if (!args.attach) {
|
|
580
580
|
return directory ?? root
|
|
581
581
|
}
|
|
@@ -618,7 +618,7 @@ export const RunCommand = effectCmd({
|
|
|
618
618
|
return name
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
-
async function attachAgent(sdk:
|
|
621
|
+
async function attachAgent(sdk: anymousClient) {
|
|
622
622
|
if (!args.agent) return undefined
|
|
623
623
|
const name = args.agent
|
|
624
624
|
|
|
@@ -658,7 +658,7 @@ export const RunCommand = effectCmd({
|
|
|
658
658
|
return name
|
|
659
659
|
}
|
|
660
660
|
|
|
661
|
-
async function pickAgent(sdk:
|
|
661
|
+
async function pickAgent(sdk: anymousClient) {
|
|
662
662
|
if (!args.agent) return undefined
|
|
663
663
|
if (args.attach) {
|
|
664
664
|
return attachAgent(sdk)
|
|
@@ -667,7 +667,7 @@ export const RunCommand = effectCmd({
|
|
|
667
667
|
return localAgent()
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
-
async function execute(sdk:
|
|
670
|
+
async function execute(sdk: anymousClient) {
|
|
671
671
|
const sess = await session(sdk)
|
|
672
672
|
if (!sess?.id) {
|
|
673
673
|
UI.error("Session not found")
|
|
@@ -694,7 +694,7 @@ export const RunCommand = effectCmd({
|
|
|
694
694
|
// to stdout/UI. `client` is passed explicitly because attach mode may
|
|
695
695
|
// rebind the SDK to the session's directory after the subscription is
|
|
696
696
|
// created, and replies issued from inside the loop must use that client.
|
|
697
|
-
async function loop(client:
|
|
697
|
+
async function loop(client: anymousClient, events: Awaited<ReturnType<typeof sdk.event.subscribe>>) {
|
|
698
698
|
const toggles = new Map<string, boolean>()
|
|
699
699
|
let error: string | undefined
|
|
700
700
|
|
|
@@ -948,8 +948,8 @@ export const RunCommand = effectCmd({
|
|
|
948
948
|
if (auth) headers.set("Authorization", auth)
|
|
949
949
|
return Server.Default().app.fetch(new Request(request, { headers }))
|
|
950
950
|
}) as typeof globalThis.fetch
|
|
951
|
-
const sdk =
|
|
952
|
-
baseUrl: "http://
|
|
951
|
+
const sdk = createanymousClient({
|
|
952
|
+
baseUrl: "http://anymous.internal",
|
|
953
953
|
fetch: fetchFn,
|
|
954
954
|
directory,
|
|
955
955
|
})
|
|
@@ -977,7 +977,7 @@ type MiniCommandInput = {
|
|
|
977
977
|
export async function runMini(input: MiniCommandInput) {
|
|
978
978
|
if (!RunCommand.handler) throw new Error("Mini command handler is unavailable")
|
|
979
979
|
await RunCommand.handler({
|
|
980
|
-
$0: "
|
|
980
|
+
$0: "anymous",
|
|
981
981
|
_: ["mini"],
|
|
982
982
|
message: input.prompt ? [input.prompt] : [],
|
|
983
983
|
command: undefined,
|
package/src/cli/cmd/serve.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Effect } from "effect"
|
|
2
2
|
import { effectCmd } from "../effect-cmd"
|
|
3
3
|
import { withNetworkOptions, resolveNetworkOptions } from "../network"
|
|
4
|
-
import { Flag } from "@
|
|
4
|
+
import { Flag } from "@anymous-ai/core/flag/flag"
|
|
5
5
|
|
|
6
6
|
export const ServeCommand = effectCmd({
|
|
7
7
|
command: "serve",
|
|
8
8
|
builder: (yargs) => withNetworkOptions(yargs),
|
|
9
9
|
describe: "starts a headless Anymous server",
|
|
10
|
-
// Server loads instances per-request via x-
|
|
10
|
+
// Server loads instances per-request via x-anymous-directory header — no
|
|
11
11
|
// need for an ambient project InstanceContext at startup.
|
|
12
12
|
instance: false,
|
|
13
13
|
handler: Effect.fn("Cli.serve")(function* (args) {
|
|
14
14
|
const { Server } = yield* Effect.promise(() => import("../../server/server"))
|
|
15
|
-
if (!Flag.
|
|
16
|
-
console.log("Warning:
|
|
15
|
+
if (!Flag.ANYMOUS_SERVER_PASSWORD) {
|
|
16
|
+
console.log("Warning: ANYMOUS_SERVER_PASSWORD is not set; server is unsecured.")
|
|
17
17
|
}
|
|
18
18
|
const opts = yield* resolveNetworkOptions(args)
|
|
19
19
|
const server = yield* Effect.promise(() => Server.listen(opts))
|
package/src/cli/cmd/session.ts
CHANGED
|
@@ -6,13 +6,13 @@ import { Session } from "@/session/session"
|
|
|
6
6
|
import { SessionID } from "../../session/schema"
|
|
7
7
|
import { UI } from "../ui"
|
|
8
8
|
import { Locale } from "@/util/locale"
|
|
9
|
-
import { Flag } from "@
|
|
9
|
+
import { Flag } from "@anymous-ai/core/flag/flag"
|
|
10
10
|
import { Filesystem } from "@/util/filesystem"
|
|
11
11
|
import { Process } from "@/util/process"
|
|
12
12
|
import { NotFoundError } from "@/storage/storage"
|
|
13
13
|
import { EOL } from "os"
|
|
14
14
|
import path from "path"
|
|
15
|
-
import { which } from "@
|
|
15
|
+
import { which } from "@anymous-ai/core/util/which"
|
|
16
16
|
|
|
17
17
|
function pagerCmd(): string[] {
|
|
18
18
|
const lessOptions = ["-R", "-S"]
|
|
@@ -26,8 +26,8 @@ function pagerCmd(): string[] {
|
|
|
26
26
|
if (Filesystem.stat(lessOnPath)?.size) return [lessOnPath, ...lessOptions]
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if (Flag.
|
|
30
|
-
const less = path.join(Flag.
|
|
29
|
+
if (Flag.ANYMOUS_GIT_BASH_PATH) {
|
|
30
|
+
const less = path.join(Flag.ANYMOUS_GIT_BASH_PATH, "..", "..", "usr", "bin", "less.exe")
|
|
31
31
|
if (Filesystem.stat(less)?.size) return [less, ...lessOptions]
|
|
32
32
|
}
|
|
33
33
|
|
package/src/cli/cmd/stats.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { Effect } from "effect"
|
|
|
2
2
|
import { effectCmd } from "../effect-cmd"
|
|
3
3
|
import { Session } from "@/session/session"
|
|
4
4
|
import { NotFoundError } from "@/storage/storage"
|
|
5
|
-
import { Database } from "@
|
|
6
|
-
import { SessionTable } from "@
|
|
5
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
6
|
+
import { SessionTable } from "@anymous-ai/core/session/sql"
|
|
7
7
|
import { Project } from "@/project/project"
|
|
8
8
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
9
9
|
|
package/src/cli/cmd/tui.ts
CHANGED
|
@@ -4,19 +4,19 @@ import { type rpc } from "../tui/worker"
|
|
|
4
4
|
import path from "path"
|
|
5
5
|
import { fileURLToPath } from "url"
|
|
6
6
|
import { UI } from "@/cli/ui"
|
|
7
|
-
import { errorMessage } from "@
|
|
7
|
+
import { errorMessage } from "@anymous-ai/tui/util/error"
|
|
8
8
|
import { withTimeout } from "@/util/timeout"
|
|
9
9
|
import { withNetworkOptions, resolveNetworkOptionsNoConfig, hasArg } from "@/cli/network"
|
|
10
10
|
import { Filesystem } from "@/util/filesystem"
|
|
11
|
-
import type { GlobalEvent } from "@
|
|
12
|
-
import type { EventSource } from "@
|
|
11
|
+
import type { GlobalEvent } from "@anymous-ai/sdk/v2"
|
|
12
|
+
import type { EventSource } from "@anymous-ai/tui/context/sdk"
|
|
13
13
|
import { writeHeapSnapshot } from "v8"
|
|
14
14
|
import { ServerAuth } from "@/server/auth"
|
|
15
15
|
import { validateSession } from "../tui/validate-session"
|
|
16
|
-
import { win32InstallCtrlCGuard } from "@
|
|
16
|
+
import { win32InstallCtrlCGuard } from "@anymous-ai/tui/terminal-win32"
|
|
17
17
|
|
|
18
18
|
declare global {
|
|
19
|
-
const
|
|
19
|
+
const ANYMOUS_WORKER_PATH: string
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
type RpcClient = ReturnType<typeof Rpc.client<typeof rpc>>
|
|
@@ -50,7 +50,7 @@ function createEventSource(client: RpcClient): EventSource {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
async function target() {
|
|
53
|
-
if (typeof
|
|
53
|
+
if (typeof ANYMOUS_WORKER_PATH !== "undefined") return ANYMOUS_WORKER_PATH
|
|
54
54
|
const dist = new URL("./cli/tui/worker.js", import.meta.url)
|
|
55
55
|
if (await Filesystem.exists(fileURLToPath(dist))) return dist
|
|
56
56
|
return new URL("../tui/worker.ts", import.meta.url)
|
|
@@ -243,7 +243,7 @@ export const TuiThreadCommand = cmd({
|
|
|
243
243
|
headers,
|
|
244
244
|
}
|
|
245
245
|
: {
|
|
246
|
-
url: "http://
|
|
246
|
+
url: "http://anymous.internal",
|
|
247
247
|
fetch: createWorkerFetch(client),
|
|
248
248
|
events: createEventSource(client),
|
|
249
249
|
}
|
package/src/cli/cmd/uninstall.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Argv } from "yargs"
|
|
|
2
2
|
import { UI } from "../ui"
|
|
3
3
|
import * as prompts from "@clack/prompts"
|
|
4
4
|
import { Installation } from "../../installation"
|
|
5
|
-
import { Global } from "@
|
|
5
|
+
import { Global } from "@anymous-ai/core/global"
|
|
6
6
|
import fs from "fs/promises"
|
|
7
7
|
import path from "path"
|
|
8
8
|
import os from "os"
|
|
@@ -129,10 +129,10 @@ async function showRemovalSummary(targets: RemovalTargets, method: Installation.
|
|
|
129
129
|
|
|
130
130
|
if (method !== "curl" && method !== "unknown") {
|
|
131
131
|
const cmds: Record<string, string> = {
|
|
132
|
-
npm: "npm uninstall -g
|
|
133
|
-
pnpm: "pnpm uninstall -g
|
|
134
|
-
bun: "bun remove -g
|
|
135
|
-
yarn: "yarn global remove
|
|
132
|
+
npm: "npm uninstall -g anymous-ai",
|
|
133
|
+
pnpm: "pnpm uninstall -g anymous-ai",
|
|
134
|
+
bun: "bun remove -g anymous-ai",
|
|
135
|
+
yarn: "yarn global remove anymous-ai",
|
|
136
136
|
brew: "brew uninstall anymous",
|
|
137
137
|
choco: "choco uninstall anymous",
|
|
138
138
|
scoop: "scoop uninstall anymous",
|
|
@@ -180,19 +180,19 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar
|
|
|
180
180
|
|
|
181
181
|
if (method !== "curl" && method !== "unknown") {
|
|
182
182
|
const cmds: Record<string, string[]> = {
|
|
183
|
-
npm: ["npm", "uninstall", "-g", "
|
|
184
|
-
pnpm: ["pnpm", "uninstall", "-g", "
|
|
185
|
-
bun: ["bun", "remove", "-g", "
|
|
186
|
-
yarn: ["yarn", "global", "remove", "
|
|
187
|
-
brew: ["brew", "uninstall", "
|
|
188
|
-
choco: ["choco", "uninstall", "
|
|
189
|
-
scoop: ["scoop", "uninstall", "
|
|
183
|
+
npm: ["npm", "uninstall", "-g", "anymous-ai"],
|
|
184
|
+
pnpm: ["pnpm", "uninstall", "-g", "anymous-ai"],
|
|
185
|
+
bun: ["bun", "remove", "-g", "anymous-ai"],
|
|
186
|
+
yarn: ["yarn", "global", "remove", "anymous-ai"],
|
|
187
|
+
brew: ["brew", "uninstall", "anymous"],
|
|
188
|
+
choco: ["choco", "uninstall", "anymous"],
|
|
189
|
+
scoop: ["scoop", "uninstall", "anymous"],
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
const cmd = cmds[method]
|
|
193
193
|
if (cmd) {
|
|
194
194
|
spinner.start(`Running ${cmd.join(" ")}...`)
|
|
195
|
-
const result = await Process.run(method === "choco" ? ["choco", "uninstall", "
|
|
195
|
+
const result = await Process.run(method === "choco" ? ["choco", "uninstall", "anymous", "-y", "-r"] : cmd, {
|
|
196
196
|
nothrow: true,
|
|
197
197
|
})
|
|
198
198
|
if (result.code !== 0) {
|
|
@@ -215,7 +215,7 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar
|
|
|
215
215
|
prompts.log.info(` rm "${targets.binary}"`)
|
|
216
216
|
|
|
217
217
|
const binDir = path.dirname(targets.binary)
|
|
218
|
-
if (binDir.includes(".
|
|
218
|
+
if (binDir.includes(".anymous")) {
|
|
219
219
|
prompts.log.info(` rmdir "${binDir}" 2>/dev/null`)
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -266,7 +266,7 @@ async function getShellConfigFile(): Promise<string | null> {
|
|
|
266
266
|
if (!exists) continue
|
|
267
267
|
|
|
268
268
|
const content = await Filesystem.readText(file).catch(() => "")
|
|
269
|
-
if (content.includes("#
|
|
269
|
+
if (content.includes("# anymous") || content.includes(".anymous/bin")) {
|
|
270
270
|
return file
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -284,21 +284,21 @@ async function cleanShellConfig(file: string) {
|
|
|
284
284
|
for (const line of lines) {
|
|
285
285
|
const trimmed = line.trim()
|
|
286
286
|
|
|
287
|
-
if (trimmed === "#
|
|
287
|
+
if (trimmed === "# anymous") {
|
|
288
288
|
skip = true
|
|
289
289
|
continue
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
if (skip) {
|
|
293
293
|
skip = false
|
|
294
|
-
if (trimmed.includes(".
|
|
294
|
+
if (trimmed.includes(".anymous/bin") || trimmed.includes("fish_add_path")) {
|
|
295
295
|
continue
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
if (
|
|
300
|
-
(trimmed.startsWith("export PATH=") && trimmed.includes(".
|
|
301
|
-
(trimmed.startsWith("fish_add_path") && trimmed.includes(".
|
|
300
|
+
(trimmed.startsWith("export PATH=") && trimmed.includes(".anymous/bin")) ||
|
|
301
|
+
(trimmed.startsWith("fish_add_path") && trimmed.includes(".anymous"))
|
|
302
302
|
) {
|
|
303
303
|
continue
|
|
304
304
|
}
|