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/auth/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import path from "path"
|
|
3
3
|
import { Effect, Layer, Record, Result, Schema, Context } from "effect"
|
|
4
|
-
import { NonNegativeInt } from "@
|
|
5
|
-
import { Global } from "@
|
|
6
|
-
import { FSUtil } from "@
|
|
4
|
+
import { NonNegativeInt } from "@anymous-ai/core/schema"
|
|
5
|
+
import { Global } from "@anymous-ai/core/global"
|
|
6
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
7
7
|
|
|
8
|
-
export const OAUTH_DUMMY_KEY = "
|
|
8
|
+
export const OAUTH_DUMMY_KEY = "anymous-oauth-dummy-key"
|
|
9
9
|
|
|
10
10
|
const file = path.join(Global.Path.data, "auth.json")
|
|
11
11
|
|
|
@@ -47,7 +47,7 @@ export interface Interface {
|
|
|
47
47
|
readonly remove: (key: string) => Effect.Effect<void, AuthError>
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
50
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Auth") {}
|
|
51
51
|
|
|
52
52
|
const layer = Layer.effect(
|
|
53
53
|
Service,
|
|
@@ -56,9 +56,9 @@ const layer = Layer.effect(
|
|
|
56
56
|
const decode = Schema.decodeUnknownOption(Info)
|
|
57
57
|
|
|
58
58
|
const all = Effect.fn("Auth.all")(function* () {
|
|
59
|
-
if (process.env.
|
|
59
|
+
if (process.env.ANYMOUS_AUTH_CONTENT) {
|
|
60
60
|
try {
|
|
61
|
-
return JSON.parse(process.env.
|
|
61
|
+
return JSON.parse(process.env.ANYMOUS_AUTH_CONTENT)
|
|
62
62
|
} catch (err) {}
|
|
63
63
|
}
|
|
64
64
|
|
package/src/background/job.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { BackgroundJob as CoreBackgroundJob } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { BackgroundJob as CoreBackgroundJob } from "@anymous-ai/core/background-job"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
4
|
import { Effect, Layer } from "effect"
|
|
5
5
|
|
|
@@ -12,7 +12,7 @@ export {
|
|
|
12
12
|
type Status,
|
|
13
13
|
type WaitInput,
|
|
14
14
|
type WaitResult,
|
|
15
|
-
} from "@
|
|
15
|
+
} from "@anymous-ai/core/background-job"
|
|
16
16
|
|
|
17
17
|
/** Keeps the legacy service instance-scoped while sharing the core registry engine. */
|
|
18
18
|
const layer = Layer.effect(
|
package/src/cli/cmd/account.ts
CHANGED
|
@@ -15,7 +15,7 @@ const dim = (value: string) => UI.Style.TEXT_DIM + value + UI.Style.TEXT_NORMAL
|
|
|
15
15
|
|
|
16
16
|
const activeSuffix = (isActive: boolean) => (isActive ? dim(" (active)") : "")
|
|
17
17
|
|
|
18
|
-
export const defaultConsoleUrl = "https://
|
|
18
|
+
export const defaultConsoleUrl = "https://anymous-cli.vercel.app"
|
|
19
19
|
|
|
20
20
|
export const formatAccountLabel = (account: { email: string; url: string }, isActive: boolean) =>
|
|
21
21
|
`${account.email} ${dim(account.url)}${activeSuffix(isActive)}`
|
package/src/cli/cmd/acp.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect } from "effect"
|
|
|
2
2
|
import { effectCmd } from "../effect-cmd"
|
|
3
3
|
import { AgentSideConnection, ndJsonStream } from "@agentclientprotocol/sdk"
|
|
4
4
|
import { ServerAuth } from "@/server/auth"
|
|
5
|
-
import {
|
|
5
|
+
import { createanymousClient } from "@anymous-ai/sdk/v2"
|
|
6
6
|
import { withNetworkOptions, resolveNetworkOptions } from "../network"
|
|
7
7
|
import { ACPProfile } from "@/acp/profile"
|
|
8
8
|
|
|
@@ -20,11 +20,11 @@ export const AcpCommand = effectCmd({
|
|
|
20
20
|
const { Server } = yield* Effect.promise(() => import("@/server/server"))
|
|
21
21
|
const { ACP } = yield* Effect.promise(() => import("@/acp/agent"))
|
|
22
22
|
ACPProfile.mark("cli.acp.handler")
|
|
23
|
-
process.env.
|
|
23
|
+
process.env.ANYMOUS_CLIENT = "acp"
|
|
24
24
|
const opts = yield* resolveNetworkOptions(args)
|
|
25
25
|
const server = yield* Effect.promise(() => ACPProfile.measure("cli.acp.server.listen", () => Server.listen(opts)))
|
|
26
26
|
|
|
27
|
-
const sdk =
|
|
27
|
+
const sdk = createanymousClient({
|
|
28
28
|
baseUrl: `http://${server.hostname}:${server.port}`,
|
|
29
29
|
headers: ServerAuth.headers(),
|
|
30
30
|
})
|
package/src/cli/cmd/agent.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cmd } from "./cmd"
|
|
2
2
|
import * as prompts from "@clack/prompts"
|
|
3
3
|
import { UI } from "../ui"
|
|
4
|
-
import { Global } from "@
|
|
4
|
+
import { Global } from "@anymous-ai/core/global"
|
|
5
5
|
import path from "path"
|
|
6
6
|
import fs from "fs/promises"
|
|
7
7
|
import { Filesystem } from "@/util/filesystem"
|
|
@@ -108,7 +108,7 @@ const AgentCreateCommand = effectCmd({
|
|
|
108
108
|
if (prompts.isCancel(scopeResult)) throw new UI.CancelledError()
|
|
109
109
|
scope = scopeResult
|
|
110
110
|
}
|
|
111
|
-
targetPath = path.join(scope === "global" ? Global.Path.config : path.join(ctx.worktree, ".
|
|
111
|
+
targetPath = path.join(scope === "global" ? Global.Path.config : path.join(ctx.worktree, ".anymous"), "agents")
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// Get description
|
package/src/cli/cmd/attach.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cmd } from "./cmd"
|
|
2
2
|
import { UI } from "@/cli/ui"
|
|
3
|
-
import { errorMessage } from "@
|
|
3
|
+
import { errorMessage } from "@anymous-ai/tui/util/error"
|
|
4
4
|
import { validateSession } from "../tui/validate-session"
|
|
5
5
|
import { ServerAuth } from "@/server/auth"
|
|
6
6
|
|
|
@@ -35,12 +35,12 @@ export const AttachCommand = cmd({
|
|
|
35
35
|
.option("password", {
|
|
36
36
|
alias: ["p"],
|
|
37
37
|
type: "string",
|
|
38
|
-
describe: "basic auth password (defaults to
|
|
38
|
+
describe: "basic auth password (defaults to ANYMOUS_SERVER_PASSWORD)",
|
|
39
39
|
})
|
|
40
40
|
.option("username", {
|
|
41
41
|
alias: ["u"],
|
|
42
42
|
type: "string",
|
|
43
|
-
describe: "basic auth username (defaults to
|
|
43
|
+
describe: "basic auth username (defaults to ANYMOUS_SERVER_USERNAME or 'anymous')",
|
|
44
44
|
})
|
|
45
45
|
.option("mini", {
|
|
46
46
|
type: "boolean",
|
package/src/cli/cmd/db.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Argv } from "yargs"
|
|
2
2
|
import { spawn } from "child_process"
|
|
3
|
-
import { Database } from "@
|
|
3
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
4
4
|
import { Effect } from "effect"
|
|
5
5
|
import { sql } from "drizzle-orm"
|
|
6
6
|
import { effectCmd } from "../effect-cmd"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { PermissionV1 } from "@anymous-ai/core/v1/permission"
|
|
2
2
|
import { EOL } from "os"
|
|
3
|
-
import { SessionV1 } from "@
|
|
3
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
4
4
|
import { basename } from "path"
|
|
5
5
|
import { Cause, Effect } from "effect"
|
|
6
6
|
import { Agent } from "../../../agent/agent"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EOL } from "os"
|
|
2
2
|
import { Effect } from "effect"
|
|
3
|
-
import { FileSystem } from "@
|
|
4
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
5
|
-
import { Location } from "@
|
|
6
|
-
import { AbsolutePath, RelativePath } from "@
|
|
3
|
+
import { FileSystem } from "@anymous-ai/core/filesystem"
|
|
4
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@anymous-ai/core/location-services"
|
|
5
|
+
import { Location } from "@anymous-ai/core/location"
|
|
6
|
+
import { AbsolutePath, RelativePath } from "@anymous-ai/core/schema"
|
|
7
7
|
import { effectCmd } from "../../effect-cmd"
|
|
8
8
|
import { cmd } from "../cmd"
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Global } from "@
|
|
2
|
-
import { InstallationVersion } from "@
|
|
3
|
-
import { Flag } from "@
|
|
1
|
+
import { Global } from "@anymous-ai/core/global"
|
|
2
|
+
import { InstallationVersion } from "@anymous-ai/core/installation/version"
|
|
3
|
+
import { Flag } from "@anymous-ai/core/flag/flag"
|
|
4
4
|
import os from "os"
|
|
5
5
|
import { Duration, Effect } from "effect"
|
|
6
6
|
import { effectCmd } from "../../effect-cmd"
|
|
@@ -58,11 +58,11 @@ const InfoCommand = effectCmd({
|
|
|
58
58
|
: undefined
|
|
59
59
|
const terminal = [termProgram, process.env.TERM].filter((item): item is string => Boolean(item)).join(" / ")
|
|
60
60
|
|
|
61
|
-
console.log(`
|
|
61
|
+
console.log(`anymous version: ${InstallationVersion}`)
|
|
62
62
|
console.log(`os: ${os.type()} ${os.release()} ${os.arch()}`)
|
|
63
63
|
console.log(`terminal: ${terminal || "unknown"}`)
|
|
64
64
|
console.log("plugins:")
|
|
65
|
-
if (Flag.
|
|
65
|
+
if (Flag.ANYMOUS_PURE) {
|
|
66
66
|
console.log("external plugins disabled (--pure)")
|
|
67
67
|
return
|
|
68
68
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EOL } from "os"
|
|
2
2
|
import { Effect } from "effect"
|
|
3
|
-
import { Ripgrep } from "@
|
|
3
|
+
import { Ripgrep } from "@anymous-ai/core/ripgrep"
|
|
4
4
|
import { effectCmd } from "../../effect-cmd"
|
|
5
5
|
import { cmd } from "../cmd"
|
|
6
6
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
@@ -7,8 +7,8 @@ export const ScrapCommand = cmd({
|
|
|
7
7
|
builder: (yargs) => yargs,
|
|
8
8
|
async handler() {
|
|
9
9
|
const { Project } = await import("@/project/project")
|
|
10
|
-
const { AppNodeBuilder } = await import("@
|
|
11
|
-
const { makeRuntime } = await import("@
|
|
10
|
+
const { AppNodeBuilder } = await import("@anymous-ai/core/effect/app-node-builder")
|
|
11
|
+
const { makeRuntime } = await import("@anymous-ai/core/effect/runtime")
|
|
12
12
|
const runtime = makeRuntime(Project.Service, AppNodeBuilder.build(Project.node))
|
|
13
13
|
const list = await runtime.runPromise((project) => project.list())
|
|
14
14
|
process.stdout.write(JSON.stringify(list, null, 2) + EOL)
|
package/src/cli/cmd/debug/v2.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EOL } from "os"
|
|
2
2
|
import { Effect } from "effect"
|
|
3
|
-
import { Catalog } from "@
|
|
4
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
5
|
-
import { Location } from "@
|
|
6
|
-
import { AbsolutePath } from "@
|
|
3
|
+
import { Catalog } from "@anymous-ai/core/catalog"
|
|
4
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@anymous-ai/core/location-services"
|
|
5
|
+
import { Location } from "@anymous-ai/core/location"
|
|
6
|
+
import { AbsolutePath } from "@anymous-ai/core/schema"
|
|
7
7
|
import { effectCmd } from "../../effect-cmd"
|
|
8
8
|
|
|
9
9
|
export const V2Command = effectCmd({
|
package/src/cli/cmd/export.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Session } from "@/session/session"
|
|
2
|
-
import { SessionV1 } from "@
|
|
2
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
3
3
|
import { MessageV2 } from "../../session/message-v2"
|
|
4
4
|
import { SessionID } from "../../session/schema"
|
|
5
5
|
import { effectCmd, fail } from "../effect-cmd"
|
package/src/cli/cmd/generate.ts
CHANGED
|
@@ -18,9 +18,9 @@ export const GenerateCommand = {
|
|
|
18
18
|
{
|
|
19
19
|
lang: "js",
|
|
20
20
|
source: [
|
|
21
|
-
`import {
|
|
21
|
+
`import { createanymousClient } from "@anymous-ai/sdk`,
|
|
22
22
|
``,
|
|
23
|
-
`const client =
|
|
23
|
+
`const client = createanymousClient()`,
|
|
24
24
|
`await client.${operation.operationId}({`,
|
|
25
25
|
` ...`,
|
|
26
26
|
`})`,
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
PullRequestEvent,
|
|
18
18
|
} from "@octokit/webhooks-types"
|
|
19
19
|
import { UI } from "../ui"
|
|
20
|
-
import { ModelsDev } from "@
|
|
20
|
+
import { ModelsDev } from "@anymous-ai/core/models-dev"
|
|
21
21
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
22
22
|
import { SessionShare } from "@/share/session"
|
|
23
23
|
import { Session } from "@/session/session"
|
|
@@ -26,7 +26,7 @@ import { MessageID, PartID } from "../../session/schema"
|
|
|
26
26
|
import { Provider } from "@/provider/provider"
|
|
27
27
|
import { MessageV2 } from "../../session/message-v2"
|
|
28
28
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
29
|
-
import { EventV2 } from "@
|
|
29
|
+
import { EventV2 } from "@anymous-ai/core/event"
|
|
30
30
|
import { SessionPrompt } from "@/session/prompt"
|
|
31
31
|
import { Git } from "@/git"
|
|
32
32
|
import { setTimeout as sleep } from "node:timers/promises"
|
|
@@ -138,9 +138,9 @@ type IssueQueryResponse = {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const AGENT_USERNAME = "
|
|
141
|
+
const AGENT_USERNAME = "anymous-agent[bot]"
|
|
142
142
|
const AGENT_REACTION = "eyes"
|
|
143
|
-
const WORKFLOW_FILE = ".github/workflows/
|
|
143
|
+
const WORKFLOW_FILE = ".github/workflows/anymous.yml"
|
|
144
144
|
|
|
145
145
|
// Event categories for routing
|
|
146
146
|
// USER_EVENTS: triggered by user actions, have actor/issueId, support reactions/comments
|
|
@@ -200,7 +200,7 @@ export const githubInstall = Effect.fn("Cli.github.install")(function* () {
|
|
|
200
200
|
"",
|
|
201
201
|
" 3. Go to a GitHub issue and comment `/oc summarize` to see the agent in action",
|
|
202
202
|
"",
|
|
203
|
-
" Learn more about the GitHub agent - https://
|
|
203
|
+
" Learn more about the GitHub agent - https://anymous-cli.vercel.app/docs/github/#usage-examples",
|
|
204
204
|
].join("\n"),
|
|
205
205
|
)
|
|
206
206
|
}
|
|
@@ -226,7 +226,7 @@ export const githubInstall = Effect.fn("Cli.github.install")(function* () {
|
|
|
226
226
|
|
|
227
227
|
async function promptProvider() {
|
|
228
228
|
const priority: Record<string, number> = {
|
|
229
|
-
|
|
229
|
+
anymous: 0,
|
|
230
230
|
anthropic: 1,
|
|
231
231
|
openai: 2,
|
|
232
232
|
google: 3,
|
|
@@ -284,7 +284,7 @@ export const githubInstall = Effect.fn("Cli.github.install")(function* () {
|
|
|
284
284
|
if (installation) return s.stop("GitHub app already installed")
|
|
285
285
|
|
|
286
286
|
// Open browser
|
|
287
|
-
const url = "https://github.com/apps/
|
|
287
|
+
const url = "https://github.com/apps/anymous-agent"
|
|
288
288
|
const command =
|
|
289
289
|
process.platform === "darwin"
|
|
290
290
|
? `open "${url}"`
|
|
@@ -320,7 +320,7 @@ export const githubInstall = Effect.fn("Cli.github.install")(function* () {
|
|
|
320
320
|
s.stop("Installed GitHub app")
|
|
321
321
|
|
|
322
322
|
async function getInstallation() {
|
|
323
|
-
return await fetch(`https://
|
|
323
|
+
return await fetch(`https://anymous-cli.vercel.app/get_github_app_installation?owner=${app.owner}&repo=${app.repo}`)
|
|
324
324
|
.then((res) => res.json())
|
|
325
325
|
.then((data) => data.installation)
|
|
326
326
|
}
|
|
@@ -334,7 +334,7 @@ export const githubInstall = Effect.fn("Cli.github.install")(function* () {
|
|
|
334
334
|
|
|
335
335
|
await Filesystem.write(
|
|
336
336
|
path.join(app.root, WORKFLOW_FILE),
|
|
337
|
-
`name:
|
|
337
|
+
`name: anymous
|
|
338
338
|
|
|
339
339
|
on:
|
|
340
340
|
issue_comment:
|
|
@@ -343,12 +343,12 @@ on:
|
|
|
343
343
|
types: [created]
|
|
344
344
|
|
|
345
345
|
jobs:
|
|
346
|
-
|
|
346
|
+
anymous:
|
|
347
347
|
if: |
|
|
348
348
|
contains(github.event.comment.body, ' /oc') ||
|
|
349
349
|
startsWith(github.event.comment.body, '/oc') ||
|
|
350
|
-
contains(github.event.comment.body, ' /
|
|
351
|
-
startsWith(github.event.comment.body, '/
|
|
350
|
+
contains(github.event.comment.body, ' /anymous') ||
|
|
351
|
+
startsWith(github.event.comment.body, '/anymous')
|
|
352
352
|
runs-on: ubuntu-latest
|
|
353
353
|
permissions:
|
|
354
354
|
id-token: write
|
|
@@ -361,8 +361,8 @@ jobs:
|
|
|
361
361
|
with:
|
|
362
362
|
persist-credentials: false
|
|
363
363
|
|
|
364
|
-
- name: Run
|
|
365
|
-
uses: anomalyco/
|
|
364
|
+
- name: Run anymous
|
|
365
|
+
uses: anomalyco/anymous/github@latest${envStr}
|
|
366
366
|
with:
|
|
367
367
|
model: ${provider}/${model}`,
|
|
368
368
|
)
|
|
@@ -426,7 +426,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
426
426
|
? (payload as IssueCommentEvent | IssuesEvent).issue.number
|
|
427
427
|
: (payload as PullRequestEvent | PullRequestReviewCommentEvent).pull_request.number
|
|
428
428
|
const runUrl = `/${owner}/${repo}/actions/runs/${runId}`
|
|
429
|
-
const shareBaseUrl = isMock ? "https://dev.
|
|
429
|
+
const shareBaseUrl = isMock ? "https://dev.anymous-cli.vercel.app" : "https://anymous-cli.vercel.app"
|
|
430
430
|
|
|
431
431
|
let appToken: string
|
|
432
432
|
let octoRest: Octokit
|
|
@@ -494,7 +494,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
494
494
|
await addReaction(commentType)
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
// Setup
|
|
497
|
+
// Setup anymous session
|
|
498
498
|
const repoData = await fetchRepo()
|
|
499
499
|
session = await runLocalEffect(
|
|
500
500
|
sessionSvc.create({
|
|
@@ -514,7 +514,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
514
514
|
await runLocalEffect(sessionShare.share(session.id))
|
|
515
515
|
return session.id.slice(-8)
|
|
516
516
|
})()
|
|
517
|
-
console.log("
|
|
517
|
+
console.log("anymous session", session.id)
|
|
518
518
|
|
|
519
519
|
// Handle event types:
|
|
520
520
|
// REPO_EVENTS (schedule, workflow_dispatch): no issue/PR context, output to logs/PR only
|
|
@@ -687,7 +687,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
687
687
|
|
|
688
688
|
function normalizeOidcBaseUrl(): string {
|
|
689
689
|
const value = process.env["OIDC_BASE_URL"]
|
|
690
|
-
if (!value) return "https://
|
|
690
|
+
if (!value) return "https://anymous-cli.vercel.app"
|
|
691
691
|
return value.replace(/\/+$/, "")
|
|
692
692
|
}
|
|
693
693
|
|
|
@@ -736,7 +736,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
736
736
|
}
|
|
737
737
|
|
|
738
738
|
const reviewContext = getReviewCommentContext()
|
|
739
|
-
const mentions = (process.env["MENTIONS"] || "/
|
|
739
|
+
const mentions = (process.env["MENTIONS"] || "/anymous,/oc")
|
|
740
740
|
.split(",")
|
|
741
741
|
.map((m) => m.trim().toLowerCase())
|
|
742
742
|
.filter(Boolean)
|
|
@@ -887,7 +887,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
887
887
|
}
|
|
888
888
|
|
|
889
889
|
async function chat(message: string, files: PromptFiles = []) {
|
|
890
|
-
console.log("Sending message to
|
|
890
|
+
console.log("Sending message to anymous...")
|
|
891
891
|
|
|
892
892
|
return runLocalEffect(
|
|
893
893
|
Effect.gen(function* () {
|
|
@@ -975,7 +975,7 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
975
975
|
|
|
976
976
|
async function getOidcToken() {
|
|
977
977
|
try {
|
|
978
|
-
return await core.getIDToken("
|
|
978
|
+
return await core.getIDToken("anymous-github-action")
|
|
979
979
|
} catch (error) {
|
|
980
980
|
console.error("Failed to get OIDC token:", error instanceof Error ? error.message : error)
|
|
981
981
|
throw new Error(
|
|
@@ -1076,9 +1076,9 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
1076
1076
|
.join("")
|
|
1077
1077
|
if (type === "schedule" || type === "dispatch") {
|
|
1078
1078
|
const hex = crypto.randomUUID().slice(0, 6)
|
|
1079
|
-
return `
|
|
1079
|
+
return `anymous/${type}-${hex}-${timestamp}`
|
|
1080
1080
|
}
|
|
1081
|
-
return `
|
|
1081
|
+
return `anymous/${type}${issueId}-${timestamp}`
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
1084
|
async function pushToNewBranch(summary: string, branch: string, commit: boolean, isSchedule: boolean) {
|
|
@@ -1350,9 +1350,9 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:
|
|
|
1350
1350
|
const titleAlt = encodeURIComponent(session.title.substring(0, 50))
|
|
1351
1351
|
const title64 = Buffer.from(session.title.substring(0, 700), "utf8").toString("base64")
|
|
1352
1352
|
|
|
1353
|
-
return `<a href="${shareBaseUrl}/s/${shareId}"><img width="200" alt="${titleAlt}" src="https://social-cards.sst.dev/
|
|
1353
|
+
return `<a href="${shareBaseUrl}/s/${shareId}"><img width="200" alt="${titleAlt}" src="https://social-cards.sst.dev/anymous-share/${title64}.png?model=${providerID}/${modelID}&version=${session.version}&id=${shareId}" /></a>\n`
|
|
1354
1354
|
})()
|
|
1355
|
-
const shareUrl = shareId ? `[
|
|
1355
|
+
const shareUrl = shareId ? `[anymous session](${shareBaseUrl}/s/${shareId}) | ` : ""
|
|
1356
1356
|
return `\n\n${image}${shareUrl}[github run](${runUrl})`
|
|
1357
1357
|
}
|
|
1358
1358
|
|
|
@@ -1413,7 +1413,7 @@ query($owner: String!, $repo: String!, $number: Int!) {
|
|
|
1413
1413
|
return [
|
|
1414
1414
|
"<github_action_context>",
|
|
1415
1415
|
"You are running as a GitHub Action. Important:",
|
|
1416
|
-
"- Git push and PR creation are handled AUTOMATICALLY by the
|
|
1416
|
+
"- Git push and PR creation are handled AUTOMATICALLY by the anymous infrastructure after your response",
|
|
1417
1417
|
"- Do NOT include warnings or disclaimers about GitHub tokens, workflow permissions, or PR creation capabilities",
|
|
1418
1418
|
"- Do NOT suggest manual steps for creating PRs or pushing code - this happens automatically",
|
|
1419
1419
|
"- Focus only on the code changes and your analysis/response",
|
|
@@ -1551,7 +1551,7 @@ query($owner: String!, $repo: String!, $number: Int!) {
|
|
|
1551
1551
|
return [
|
|
1552
1552
|
"<github_action_context>",
|
|
1553
1553
|
"You are running as a GitHub Action. Important:",
|
|
1554
|
-
"- Git push and PR creation are handled AUTOMATICALLY by the
|
|
1554
|
+
"- Git push and PR creation are handled AUTOMATICALLY by the anymous infrastructure after your response",
|
|
1555
1555
|
"- Do NOT include warnings or disclaimers about GitHub tokens, workflow permissions, or PR creation capabilities",
|
|
1556
1556
|
"- Do NOT suggest manual steps for creating PRs or pushing code - this happens automatically",
|
|
1557
1557
|
"- Focus only on the code changes and your analysis/response",
|
package/src/cli/cmd/import.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { Session as SDKSession, Message, Part } from "@
|
|
2
|
-
import { SessionV1 } from "@
|
|
1
|
+
import type { Session as SDKSession, Message, Part } from "@anymous-ai/sdk/v2"
|
|
2
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
3
3
|
import { Session } from "@/session/session"
|
|
4
4
|
import { MessageV2 } from "../../session/message-v2"
|
|
5
5
|
import { CliError, effectCmd } from "../effect-cmd"
|
|
6
|
-
import { Database } from "@
|
|
7
|
-
import { SessionTable, MessageTable, PartTable } from "@
|
|
6
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
7
|
+
import { SessionTable, MessageTable, PartTable } from "@anymous-ai/core/session/sql"
|
|
8
8
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
9
9
|
import { ShareNext } from "@/share/share-next"
|
|
10
10
|
import { EOL } from "os"
|
|
11
11
|
import path from "path"
|
|
12
|
-
import { FSUtil } from "@
|
|
12
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
13
13
|
import { Effect, Schema } from "effect"
|
|
14
14
|
import type { InstanceContext } from "@/project/instance-context"
|
|
15
15
|
|
package/src/cli/cmd/mcp.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cmd } from "./cmd"
|
|
2
|
-
import { ConfigV1 } from "@
|
|
2
|
+
import { ConfigV1 } from "@anymous-ai/core/v1/config/config"
|
|
3
3
|
import { effectCmd } from "../effect-cmd"
|
|
4
4
|
import { Cause } from "effect"
|
|
5
5
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
|
|
@@ -12,11 +12,11 @@ import { MCP } from "../../mcp"
|
|
|
12
12
|
import { McpAuth } from "../../mcp/auth"
|
|
13
13
|
import { McpOAuthProvider } from "../../mcp/oauth-provider"
|
|
14
14
|
import { Config } from "@/config/config"
|
|
15
|
-
import { ConfigMCPV1 } from "@
|
|
15
|
+
import { ConfigMCPV1 } from "@anymous-ai/core/v1/config/mcp"
|
|
16
16
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
17
|
-
import { InstallationVersion } from "@
|
|
17
|
+
import { InstallationVersion } from "@anymous-ai/core/installation/version"
|
|
18
18
|
import path from "path"
|
|
19
|
-
import { Global } from "@
|
|
19
|
+
import { Global } from "@anymous-ai/core/global"
|
|
20
20
|
import { modify, applyEdits } from "jsonc-parser"
|
|
21
21
|
import { Filesystem } from "@/util/filesystem"
|
|
22
22
|
import { Effect } from "effect"
|
|
@@ -119,7 +119,7 @@ export const McpListCommand = effectCmd({
|
|
|
119
119
|
|
|
120
120
|
if (servers.length === 0) {
|
|
121
121
|
prompts.log.warn("No MCP servers configured")
|
|
122
|
-
prompts.outro("Add servers with:
|
|
122
|
+
prompts.outro("Add servers with: anymous mcp add")
|
|
123
123
|
return
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -187,7 +187,7 @@ export const McpAuthCommand = effectCmd({
|
|
|
187
187
|
|
|
188
188
|
if (servers.length === 0) {
|
|
189
189
|
prompts.log.warn("No OAuth-capable MCP servers configured")
|
|
190
|
-
prompts.log.info("Remote MCP servers support OAuth by default. Add a remote server in
|
|
190
|
+
prompts.log.info("Remote MCP servers support OAuth by default. Add a remote server in anymous.json:")
|
|
191
191
|
prompts.log.info(`
|
|
192
192
|
"mcp": {
|
|
193
193
|
"my-server": {
|
|
@@ -392,11 +392,11 @@ export const McpLogoutCommand = effectCmd({
|
|
|
392
392
|
})
|
|
393
393
|
|
|
394
394
|
async function resolveConfigPath(baseDir: string, global = false) {
|
|
395
|
-
// Check for existing config files (prefer .jsonc over .json, check .
|
|
396
|
-
const candidates = [path.join(baseDir, "
|
|
395
|
+
// Check for existing config files (prefer .jsonc over .json, check .anymous/ subdirectory too)
|
|
396
|
+
const candidates = [path.join(baseDir, "anymous.json"), path.join(baseDir, "anymous.jsonc")]
|
|
397
397
|
|
|
398
398
|
if (!global) {
|
|
399
|
-
candidates.push(path.join(baseDir, ".
|
|
399
|
+
candidates.push(path.join(baseDir, ".anymous", "anymous.json"), path.join(baseDir, ".anymous", "anymous.jsonc"))
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
for (const candidate of candidates) {
|
|
@@ -405,7 +405,7 @@ async function resolveConfigPath(baseDir: string, global = false) {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
// Default to
|
|
408
|
+
// Default to anymous.json if none exist
|
|
409
409
|
return candidates[0]
|
|
410
410
|
}
|
|
411
411
|
|
|
@@ -559,7 +559,7 @@ export const McpAddCommand = effectCmd({
|
|
|
559
559
|
if (type === "local") {
|
|
560
560
|
const command = await prompts.text({
|
|
561
561
|
message: "Enter command to run",
|
|
562
|
-
placeholder: "e.g.,
|
|
562
|
+
placeholder: "e.g., anymous x @modelcontextprotocol/server-filesystem",
|
|
563
563
|
validate: (x) => (x && x.length > 0 ? undefined : "Required"),
|
|
564
564
|
})
|
|
565
565
|
if (prompts.isCancel(command)) throw new UI.CancelledError()
|
|
@@ -746,7 +746,7 @@ export const McpDebugCommand = effectCmd({
|
|
|
746
746
|
params: {
|
|
747
747
|
protocolVersion: LATEST_PROTOCOL_VERSION,
|
|
748
748
|
capabilities: {},
|
|
749
|
-
clientInfo: { name: "
|
|
749
|
+
clientInfo: { name: "anymous-debug", version: InstallationVersion },
|
|
750
750
|
},
|
|
751
751
|
id: 1,
|
|
752
752
|
}),
|
|
@@ -790,7 +790,7 @@ export const McpDebugCommand = effectCmd({
|
|
|
790
790
|
|
|
791
791
|
try {
|
|
792
792
|
const client = new Client({
|
|
793
|
-
name: "
|
|
793
|
+
name: "anymous-debug",
|
|
794
794
|
version: InstallationVersion,
|
|
795
795
|
})
|
|
796
796
|
await client.connect(transport)
|
package/src/cli/cmd/models.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EOL } from "os"
|
|
2
2
|
import { Effect } from "effect"
|
|
3
|
-
import { ModelsDev } from "@
|
|
3
|
+
import { ModelsDev } from "@anymous-ai/core/models-dev"
|
|
4
4
|
import { effectCmd, fail } from "../effect-cmd"
|
|
5
5
|
import { UI } from "../ui"
|
|
6
|
-
import { ProviderV2 } from "@
|
|
6
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
7
7
|
|
|
8
8
|
export const ModelsCommand = effectCmd({
|
|
9
9
|
command: "models [provider]",
|
|
@@ -54,10 +54,10 @@ export const ModelsCommand = effectCmd({
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const ids = Object.keys(providers).sort((a, b) => {
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
if (!
|
|
57
|
+
const aIsanymous = a.startsWith("anymous")
|
|
58
|
+
const bIsanymous = b.startsWith("anymous")
|
|
59
|
+
if (aIsanymous && !bIsanymous) return -1
|
|
60
|
+
if (!aIsanymous && bIsanymous) return 1
|
|
61
61
|
return a.localeCompare(b)
|
|
62
62
|
})
|
|
63
63
|
|
package/src/cli/cmd/plug.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { intro, log, outro, spinner } from "@clack/prompts"
|
|
|
2
2
|
import { Effect } from "effect"
|
|
3
3
|
|
|
4
4
|
import { ConfigPaths } from "@/config/paths"
|
|
5
|
-
import { Global } from "@
|
|
5
|
+
import { Global } from "@anymous-ai/core/global"
|
|
6
6
|
import { installPlugin, patchPluginConfig, readPluginManifest } from "../../plugin/install"
|
|
7
7
|
import { resolvePluginTarget } from "../../plugin/shared"
|
|
8
8
|
import { errorMessage } from "../../util/error"
|
|
@@ -28,7 +28,7 @@ export type PlugDeps = {
|
|
|
28
28
|
readText: (file: string) => Promise<string>
|
|
29
29
|
write: (file: string, text: string) => Promise<void>
|
|
30
30
|
exists: (file: string) => Promise<boolean>
|
|
31
|
-
files: (dir: string, name: "
|
|
31
|
+
files: (dir: string, name: "anymous" | "tui") => string[]
|
|
32
32
|
global: string
|
|
33
33
|
}
|
|
34
34
|
|