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/cli/cmd/pr.ts
CHANGED
|
@@ -76,11 +76,11 @@ export const PrCommand = effectCmd({
|
|
|
76
76
|
const sessionMatch = prInfo.body.match(/https:\/\/opncd\.ai\/s\/([a-zA-Z0-9_-]+)/)
|
|
77
77
|
if (sessionMatch) {
|
|
78
78
|
const sessionUrl = sessionMatch[0]
|
|
79
|
-
UI.println(`Found
|
|
79
|
+
UI.println(`Found anymous session: ${sessionUrl}`)
|
|
80
80
|
UI.println(`Importing session...`)
|
|
81
81
|
|
|
82
82
|
const importResult = yield* Effect.promise(() =>
|
|
83
|
-
Process.text(["
|
|
83
|
+
Process.text(["anymous", "import", sessionUrl], { nothrow: true }),
|
|
84
84
|
)
|
|
85
85
|
if (importResult.code === 0) {
|
|
86
86
|
const sessionIdMatch = importResult.text.trim().match(/Imported session: ([a-zA-Z0-9_-]+)/)
|
|
@@ -95,13 +95,13 @@ export const PrCommand = effectCmd({
|
|
|
95
95
|
|
|
96
96
|
UI.println(`Successfully checked out PR #${prNumber} as branch '${localBranchName}'`)
|
|
97
97
|
UI.println()
|
|
98
|
-
UI.println("Starting
|
|
98
|
+
UI.println("Starting anymous...")
|
|
99
99
|
UI.println()
|
|
100
100
|
|
|
101
|
-
const
|
|
101
|
+
const anymousArgs = sessionId ? ["-s", sessionId] : []
|
|
102
102
|
const code = yield* Effect.promise(
|
|
103
103
|
() =>
|
|
104
|
-
Process.spawn(["
|
|
104
|
+
Process.spawn(["anymous", ...anymousArgs], {
|
|
105
105
|
stdin: "inherit",
|
|
106
106
|
stdout: "inherit",
|
|
107
107
|
stderr: "inherit",
|
|
@@ -110,6 +110,6 @@ export const PrCommand = effectCmd({
|
|
|
110
110
|
)
|
|
111
111
|
// Match legacy throw semantics — propagate as a defect so the top-level
|
|
112
112
|
// index.ts catch handles it identically (exit 1, "Unexpected error" banner).
|
|
113
|
-
if (code !== 0) return yield* Effect.die(new Error(`
|
|
113
|
+
if (code !== 0) return yield* Effect.die(new Error(`anymous exited with code ${code}`))
|
|
114
114
|
}),
|
|
115
115
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "@
|
|
1
|
+
export * from "@anymous-ai/tui/prompt/display"
|
package/src/cli/cmd/providers.ts
CHANGED
|
@@ -4,15 +4,15 @@ import { cmd } from "./cmd"
|
|
|
4
4
|
import { CliError, effectCmd, fail } from "../effect-cmd"
|
|
5
5
|
import { UI } from "../ui"
|
|
6
6
|
import * as Prompt from "../effect/prompt"
|
|
7
|
-
import { ModelsDev } from "@
|
|
7
|
+
import { ModelsDev } from "@anymous-ai/core/models-dev"
|
|
8
8
|
|
|
9
9
|
import { map, pipe, sortBy, values } from "remeda"
|
|
10
10
|
import path from "path"
|
|
11
11
|
import os from "os"
|
|
12
12
|
import { Config } from "@/config/config"
|
|
13
|
-
import { Global } from "@
|
|
13
|
+
import { Global } from "@anymous-ai/core/global"
|
|
14
14
|
import { Plugin } from "../../plugin"
|
|
15
|
-
import type { Hooks } from "@
|
|
15
|
+
import type { Hooks } from "@anymous-ai/plugin"
|
|
16
16
|
import { Process } from "@/util/process"
|
|
17
17
|
import { errorMessage } from "@/util/error"
|
|
18
18
|
import { text } from "node:stream/consumers"
|
|
@@ -304,7 +304,7 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
304
304
|
builder: (yargs: Argv) =>
|
|
305
305
|
yargs
|
|
306
306
|
.positional("url", {
|
|
307
|
-
describe: "
|
|
307
|
+
describe: "anymous auth provider",
|
|
308
308
|
type: "string",
|
|
309
309
|
})
|
|
310
310
|
.option("provider", {
|
|
@@ -325,7 +325,7 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
325
325
|
if (args.url) {
|
|
326
326
|
const url = args.url.replace(/\/+$/, "")
|
|
327
327
|
const wellknown = (yield* cliTry(`Failed to load auth provider metadata from ${url}: `, () =>
|
|
328
|
-
fetch(`${url}/.well-known/
|
|
328
|
+
fetch(`${url}/.well-known/anymous`).then((x) => x.json()),
|
|
329
329
|
)) as {
|
|
330
330
|
auth: { command: string[]; env: string }
|
|
331
331
|
}
|
|
@@ -369,7 +369,7 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
369
369
|
const hooks = yield* pluginSvc.list()
|
|
370
370
|
|
|
371
371
|
const priority: Record<string, number> = {
|
|
372
|
-
|
|
372
|
+
anymous: 0,
|
|
373
373
|
openai: 1,
|
|
374
374
|
"github-copilot": 2,
|
|
375
375
|
google: 3,
|
|
@@ -396,7 +396,7 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
396
396
|
label: x.name,
|
|
397
397
|
value: x.id,
|
|
398
398
|
hint: {
|
|
399
|
-
|
|
399
|
+
anymous: "recommended",
|
|
400
400
|
openai: "ChatGPT Plus/Pro or API key",
|
|
401
401
|
}[x.id],
|
|
402
402
|
})),
|
|
@@ -449,7 +449,7 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
yield* Prompt.log.warn(
|
|
452
|
-
`This only stores a credential for ${provider} - you will need configure it in
|
|
452
|
+
`This only stores a credential for ${provider} - you will need configure it in anymous.json, check the docs for examples.`,
|
|
453
453
|
)
|
|
454
454
|
}
|
|
455
455
|
|
|
@@ -458,13 +458,13 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
458
458
|
"Amazon Bedrock authentication priority:\n" +
|
|
459
459
|
" 1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)\n" +
|
|
460
460
|
" 2. AWS credential chain (profile, access keys, IAM roles, EKS IRSA)\n\n" +
|
|
461
|
-
"Configure via
|
|
461
|
+
"Configure via anymous.json options (profile, region, endpoint) or\n" +
|
|
462
462
|
"AWS environment variables (AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_WEB_IDENTITY_TOKEN_FILE).",
|
|
463
463
|
)
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
if (provider === "
|
|
467
|
-
yield* Prompt.log.info("Create an api key at https://
|
|
466
|
+
if (provider === "anymous") {
|
|
467
|
+
yield* Prompt.log.info("Create an api key at https://anymous-cli.vercel.app/auth")
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
if (provider === "vercel") {
|
|
@@ -473,7 +473,7 @@ export const ProvidersLoginCommand = effectCmd({
|
|
|
473
473
|
|
|
474
474
|
if (["cloudflare", "cloudflare-ai-gateway"].includes(provider)) {
|
|
475
475
|
yield* Prompt.log.info(
|
|
476
|
-
"Cloudflare AI Gateway can be configured with CLOUDFLARE_GATEWAY_ID, CLOUDFLARE_ACCOUNT_ID, and CLOUDFLARE_API_TOKEN environment variables. Read more: https://
|
|
476
|
+
"Cloudflare AI Gateway can be configured with CLOUDFLARE_GATEWAY_ID, CLOUDFLARE_ACCOUNT_ID, and CLOUDFLARE_API_TOKEN environment variables. Read more: https://anymous-cli.vercel.app/docs/providers/#cloudflare-ai-gateway",
|
|
477
477
|
)
|
|
478
478
|
}
|
|
479
479
|
|
package/src/cli/cmd/run/demo.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// Demo mode also handles permission and question replies locally, completing
|
|
16
16
|
// or failing the synthetic tool parts as appropriate.
|
|
17
17
|
import path from "path"
|
|
18
|
-
import type { Event, ToolPart } from "@
|
|
18
|
+
import type { Event, ToolPart } from "@anymous-ai/sdk/v2"
|
|
19
19
|
import { createSessionData, reduceSessionData, type SessionData } from "./session-data"
|
|
20
20
|
import { writeSessionOutput } from "./stream"
|
|
21
21
|
import type { FooterApi, PermissionReply, QuestionReject, QuestionReply, RunPrompt, StreamCommit } from "./types"
|
|
@@ -678,7 +678,7 @@ function emitTask(state: State): void {
|
|
|
678
678
|
state: {
|
|
679
679
|
status: "running",
|
|
680
680
|
input: {
|
|
681
|
-
filePath: "packages/
|
|
681
|
+
filePath: "packages/anymous/src/cli/cmd/run/stream.ts",
|
|
682
682
|
offset: 1,
|
|
683
683
|
limit: 200,
|
|
684
684
|
},
|
|
@@ -831,7 +831,7 @@ function emitPermission(state: State, kind: PermissionKind = "edit"): void {
|
|
|
831
831
|
always: [target],
|
|
832
832
|
done: {
|
|
833
833
|
title: "read",
|
|
834
|
-
output: ["1: {", '2: "name": "
|
|
834
|
+
output: ["1: {", '2: "name": "anymous",', '3: "private": true', "4: }"].join("\n"),
|
|
835
835
|
metadata: {},
|
|
836
836
|
},
|
|
837
837
|
})
|
|
@@ -966,7 +966,7 @@ export function RunModelSelectBody(props: {
|
|
|
966
966
|
const current = props.current()?.providerID === provider.id && props.current()?.modelID === modelID
|
|
967
967
|
const footer = current
|
|
968
968
|
? "current"
|
|
969
|
-
: model.cost?.input === 0 && provider.id === "
|
|
969
|
+
: model.cost?.input === 0 && provider.id === "anymous"
|
|
970
970
|
? "Free"
|
|
971
971
|
: title !== modelID
|
|
972
972
|
? modelID
|
|
@@ -984,7 +984,7 @@ export function RunModelSelectBody(props: {
|
|
|
984
984
|
}),
|
|
985
985
|
)
|
|
986
986
|
.sort((a, b) => {
|
|
987
|
-
const provider = Number(a.providerID !== "
|
|
987
|
+
const provider = Number(a.providerID !== "anymous") - Number(b.providerID !== "anymous")
|
|
988
988
|
if (provider !== 0) {
|
|
989
989
|
return provider
|
|
990
990
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type { TextareaRenderable } from "@opentui/core"
|
|
15
15
|
import { useKeyboard, useTerminalDimensions } from "@opentui/solid"
|
|
16
16
|
import { For, Match, Show, Switch, createEffect, createMemo, createSignal } from "solid-js"
|
|
17
|
-
import type { PermissionRequest } from "@
|
|
17
|
+
import type { PermissionRequest } from "@anymous-ai/sdk/v2"
|
|
18
18
|
import {
|
|
19
19
|
createPermissionBodyState,
|
|
20
20
|
permissionAlwaysLines,
|
|
@@ -100,7 +100,7 @@ export function RejectField(props: {
|
|
|
100
100
|
minHeight={1}
|
|
101
101
|
maxHeight={3}
|
|
102
102
|
wrapMode="word"
|
|
103
|
-
placeholder="Tell
|
|
103
|
+
placeholder="Tell anymous what to do differently"
|
|
104
104
|
placeholderColor={props.theme.muted}
|
|
105
105
|
textColor={props.theme.text}
|
|
106
106
|
focusedTextColor={props.theme.text}
|
|
@@ -284,7 +284,7 @@ export function RunPermissionBody(props: {
|
|
|
284
284
|
</Match>
|
|
285
285
|
<Match when={state().stage === "reject"}>
|
|
286
286
|
<box paddingLeft={1}>
|
|
287
|
-
<text fg={props.theme.muted}>Tell
|
|
287
|
+
<text fg={props.theme.muted}>Tell anymous what to do differently</text>
|
|
288
288
|
</box>
|
|
289
289
|
</Match>
|
|
290
290
|
</Switch>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { pathToFileURL } from "bun"
|
|
9
9
|
import { StyledText, fg, type ColorInput, type KeyEvent, type TextareaRenderable } from "@opentui/core"
|
|
10
10
|
import { useRenderer } from "@opentui/solid"
|
|
11
|
-
import { normalizePromptContent } from "@
|
|
11
|
+
import { normalizePromptContent } from "@anymous-ai/tui/editor"
|
|
12
12
|
import fuzzysort from "fuzzysort"
|
|
13
13
|
import path from "path"
|
|
14
14
|
import { createEffect, createMemo, createResource, createSignal, onCleanup, onMount, type Accessor } from "solid-js"
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
movePromptHistory,
|
|
24
24
|
pushPromptHistory,
|
|
25
25
|
} from "./prompt.shared"
|
|
26
|
-
import {
|
|
26
|
+
import { ANYMOUS_BASE_MODE, useBindings } from "@anymous-ai/tui/keymap"
|
|
27
27
|
import { unlock, lock, unrestricted } from "@/permission"
|
|
28
28
|
import { realignEditorPromptParts, resolveEditorSlashValue } from "./prompt.editor"
|
|
29
29
|
import { FOOTER_MENU_ROWS, createFooterMenuState, type RunFooterMenuItem } from "./footer.menu"
|
|
@@ -985,7 +985,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
985
985
|
}
|
|
986
986
|
|
|
987
987
|
useBindings(() => ({
|
|
988
|
-
mode:
|
|
988
|
+
mode: ANYMOUS_BASE_MODE,
|
|
989
989
|
enabled: baseBindingsEnabled(),
|
|
990
990
|
commands: [
|
|
991
991
|
{
|
|
@@ -1002,7 +1002,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
1002
1002
|
}))
|
|
1003
1003
|
|
|
1004
1004
|
useBindings(() => ({
|
|
1005
|
-
mode:
|
|
1005
|
+
mode: ANYMOUS_BASE_MODE,
|
|
1006
1006
|
enabled: input.prompt(),
|
|
1007
1007
|
commands: [
|
|
1008
1008
|
{
|
|
@@ -1019,7 +1019,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
1019
1019
|
}))
|
|
1020
1020
|
|
|
1021
1021
|
useBindings(() => ({
|
|
1022
|
-
mode:
|
|
1022
|
+
mode: ANYMOUS_BASE_MODE,
|
|
1023
1023
|
enabled: input.prompt() && !visible(),
|
|
1024
1024
|
commands: [
|
|
1025
1025
|
{
|
|
@@ -1035,7 +1035,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
1035
1035
|
}))
|
|
1036
1036
|
|
|
1037
1037
|
useBindings(() => ({
|
|
1038
|
-
mode:
|
|
1038
|
+
mode: ANYMOUS_BASE_MODE,
|
|
1039
1039
|
enabled: input.prompt() && !visible(),
|
|
1040
1040
|
commands: [
|
|
1041
1041
|
{
|
|
@@ -1062,7 +1062,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
1062
1062
|
}))
|
|
1063
1063
|
|
|
1064
1064
|
useBindings(() => ({
|
|
1065
|
-
mode:
|
|
1065
|
+
mode: ANYMOUS_BASE_MODE,
|
|
1066
1066
|
enabled: input.prompt() && !visible(),
|
|
1067
1067
|
bindings: [
|
|
1068
1068
|
{
|
|
@@ -1080,7 +1080,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
1080
1080
|
}))
|
|
1081
1081
|
|
|
1082
1082
|
useBindings(() => ({
|
|
1083
|
-
mode:
|
|
1083
|
+
mode: ANYMOUS_BASE_MODE,
|
|
1084
1084
|
enabled: input.prompt() && shell() && !visible(),
|
|
1085
1085
|
bindings: [
|
|
1086
1086
|
{
|
|
@@ -1103,7 +1103,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
|
|
1103
1103
|
}))
|
|
1104
1104
|
|
|
1105
1105
|
useBindings(() => ({
|
|
1106
|
-
mode:
|
|
1106
|
+
mode: ANYMOUS_BASE_MODE,
|
|
1107
1107
|
enabled: input.prompt() && visible(),
|
|
1108
1108
|
commands: [
|
|
1109
1109
|
{
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { TextareaRenderable } from "@opentui/core"
|
|
17
17
|
import { useKeyboard, useTerminalDimensions } from "@opentui/solid"
|
|
18
18
|
import { For, Show, createEffect, createMemo, createSignal } from "solid-js"
|
|
19
|
-
import type { QuestionRequest } from "@
|
|
19
|
+
import type { QuestionRequest } from "@anymous-ai/sdk/v2"
|
|
20
20
|
import {
|
|
21
21
|
createQuestionBodyState,
|
|
22
22
|
questionConfirm,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** @jsxImportSource @opentui/solid */
|
|
2
2
|
import type { ScrollBoxRenderable } from "@opentui/core"
|
|
3
3
|
import { useKeyboard } from "@opentui/solid"
|
|
4
|
-
import {
|
|
4
|
+
import { registeranymousSpinner } from "@anymous-ai/tui/component/register-spinner"
|
|
5
5
|
import { Show, createMemo, indexArray } from "solid-js"
|
|
6
|
-
import { SPINNER_FRAMES } from "@
|
|
6
|
+
import { SPINNER_FRAMES } from "@anymous-ai/tui/component/spinner"
|
|
7
7
|
import { RunEntryContent, separatorRows } from "./scrollback.writer"
|
|
8
8
|
import type { FooterSubagentDetail, FooterSubagentTab, RunDiffStyle } from "./types"
|
|
9
9
|
import type { RunFooterTheme, RunTheme } from "./theme"
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
registeranymousSpinner()
|
|
12
12
|
|
|
13
13
|
export const SUBAGENT_INSPECTOR_ROWS = 14
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ import type { Keymap } from "@opentui/keymap"
|
|
|
29
29
|
import { render } from "@opentui/solid"
|
|
30
30
|
import { createComponent, createSignal, type Accessor, type Setter } from "solid-js"
|
|
31
31
|
import { createStore, reconcile } from "solid-js/store"
|
|
32
|
-
import {
|
|
32
|
+
import { anymousKeymapProvider } from "@anymous-ai/tui/keymap"
|
|
33
33
|
import { RUN_COMMAND_PANEL_ROWS, RUN_SUBAGENT_PANEL_ROWS } from "./footer.command"
|
|
34
34
|
import { SUBAGENT_INSPECTOR_ROWS } from "./footer.subagent"
|
|
35
35
|
import { PROMPT_MAX_ROWS, TEXTAREA_MIN_ROWS } from "./footer.prompt"
|
|
@@ -300,7 +300,7 @@ export class RunFooter implements FooterApi {
|
|
|
300
300
|
const footer = this
|
|
301
301
|
void render(
|
|
302
302
|
() =>
|
|
303
|
-
createComponent(
|
|
303
|
+
createComponent(anymousKeymapProvider, {
|
|
304
304
|
keymap: options.keymap,
|
|
305
305
|
get children() {
|
|
306
306
|
return createComponent(RunFooterView, {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
/** @jsxImportSource @opentui/solid */
|
|
11
11
|
import { useTerminalDimensions } from "@opentui/solid"
|
|
12
12
|
import { For, Match, Show, Switch, createEffect, createMemo, createSignal, onCleanup } from "solid-js"
|
|
13
|
-
import {
|
|
14
|
-
import { createColors, createFrames } from "@
|
|
13
|
+
import { registeranymousSpinner } from "@anymous-ai/tui/component/register-spinner"
|
|
14
|
+
import { createColors, createFrames } from "@anymous-ai/tui/ui/spinner"
|
|
15
15
|
import {
|
|
16
16
|
RUN_SUBAGENT_PANEL_ROWS,
|
|
17
17
|
RunCommandMenuBody,
|
|
@@ -28,13 +28,13 @@ import { RunPermissionBody } from "./footer.permission"
|
|
|
28
28
|
import { RunQuestionBody } from "./footer.question"
|
|
29
29
|
import { footerWidthPolicy } from "./footer.width"
|
|
30
30
|
import {
|
|
31
|
-
|
|
31
|
+
ANYMOUS_BASE_MODE,
|
|
32
32
|
formatKeyBindings,
|
|
33
33
|
formatKeySequence,
|
|
34
34
|
useBindings,
|
|
35
35
|
useKeymapSelector,
|
|
36
36
|
type OpenTuiKeymap,
|
|
37
|
-
} from "@
|
|
37
|
+
} from "@anymous-ai/tui/keymap"
|
|
38
38
|
import type {
|
|
39
39
|
FooterPromptRoute,
|
|
40
40
|
FooterQueuedPrompt,
|
|
@@ -56,7 +56,7 @@ import type {
|
|
|
56
56
|
import type { RunTheme } from "./theme"
|
|
57
57
|
import { modelInfo } from "./variant.shared"
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
registeranymousSpinner()
|
|
60
60
|
|
|
61
61
|
const EMPTY_BORDER = {
|
|
62
62
|
topLeft: "",
|
|
@@ -498,7 +498,7 @@ export function RunFooterView(props: RunFooterViewProps) {
|
|
|
498
498
|
})
|
|
499
499
|
|
|
500
500
|
useBindings(() => ({
|
|
501
|
-
mode:
|
|
501
|
+
mode: ANYMOUS_BASE_MODE,
|
|
502
502
|
enabled: active().type === "prompt" && route().type === "composer" && !composer.visible(),
|
|
503
503
|
commands: [
|
|
504
504
|
{
|
|
@@ -521,7 +521,7 @@ export function RunFooterView(props: RunFooterViewProps) {
|
|
|
521
521
|
}))
|
|
522
522
|
|
|
523
523
|
useBindings(() => ({
|
|
524
|
-
mode:
|
|
524
|
+
mode: ANYMOUS_BASE_MODE,
|
|
525
525
|
enabled: active().type === "prompt" && route().type === "composer" && foregroundSubagents(),
|
|
526
526
|
priority: 1,
|
|
527
527
|
commands: [
|
|
@@ -536,7 +536,7 @@ export function RunFooterView(props: RunFooterViewProps) {
|
|
|
536
536
|
}))
|
|
537
537
|
|
|
538
538
|
useBindings(() => ({
|
|
539
|
-
mode:
|
|
539
|
+
mode: ANYMOUS_BASE_MODE,
|
|
540
540
|
enabled: active().type === "prompt" && route().type === "composer" && tabs().length > 0,
|
|
541
541
|
commands: [
|
|
542
542
|
{
|
|
@@ -550,7 +550,7 @@ export function RunFooterView(props: RunFooterViewProps) {
|
|
|
550
550
|
}))
|
|
551
551
|
|
|
552
552
|
useBindings(() => ({
|
|
553
|
-
mode:
|
|
553
|
+
mode: ANYMOUS_BASE_MODE,
|
|
554
554
|
enabled: active().type === "prompt" && route().type === "composer" && queuedPrompts().length > 0,
|
|
555
555
|
commands: [
|
|
556
556
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// permissionInfo() extracts display info (icon, title, lines, diff) from
|
|
15
15
|
// the request, delegating to tool.ts for tool-specific formatting.
|
|
16
|
-
import type { PermissionRequest } from "@
|
|
16
|
+
import type { PermissionRequest } from "@anymous-ai/sdk/v2"
|
|
17
17
|
import type { PermissionReply } from "./types"
|
|
18
18
|
import { toolPath, toolPermissionInfo } from "./tool"
|
|
19
19
|
|
|
@@ -125,11 +125,11 @@ export function permissionInfo(request: PermissionRequest): PermissionInfo {
|
|
|
125
125
|
|
|
126
126
|
export function permissionAlwaysLines(request: PermissionRequest): string[] {
|
|
127
127
|
if (request.always.length === 1 && request.always[0] === "*") {
|
|
128
|
-
return [`This will allow ${request.permission} until
|
|
128
|
+
return [`This will allow ${request.permission} until anymous is restarted.`]
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
return [
|
|
132
|
-
"This will allow the following patterns until
|
|
132
|
+
"This will allow the following patterns until anymous is restarted.",
|
|
133
133
|
...request.always.map((item) => `- ${item}`),
|
|
134
134
|
]
|
|
135
135
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// Custom answers: if a question has custom=true, an extra "Type your own
|
|
15
15
|
// answer" option appears. Selecting it enters editing mode with a text field.
|
|
16
|
-
import type { QuestionInfo, QuestionRequest } from "@
|
|
16
|
+
import type { QuestionInfo, QuestionRequest } from "@anymous-ai/sdk/v2"
|
|
17
17
|
import type { QuestionReject, QuestionReply } from "./types"
|
|
18
18
|
|
|
19
19
|
export type QuestionBodyState = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// history ring. All are async because they read config or hit the SDK, but
|
|
7
7
|
// none block each other.
|
|
8
8
|
import { Context, Effect, Layer } from "effect"
|
|
9
|
-
import { resolve } from "@
|
|
9
|
+
import { resolve } from "@anymous-ai/tui/config"
|
|
10
10
|
import { TuiConfig } from "@/config/tui"
|
|
11
11
|
import { makeRuntime } from "@/effect/run-service"
|
|
12
12
|
import { reusePendingTask } from "./runtime.shared"
|
|
@@ -44,7 +44,7 @@ type BootService = {
|
|
|
44
44
|
|
|
45
45
|
const configTask: { current?: Promise<Config> } = {}
|
|
46
46
|
|
|
47
|
-
class Service extends Context.Service<Service, BootService>()("@
|
|
47
|
+
class Service extends Context.Service<Service, BootService>()("@anymous/RunBoot") {}
|
|
48
48
|
|
|
49
49
|
function loadConfig() {
|
|
50
50
|
return reusePendingTask(configTask, () => TuiConfig.get())
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
import path from "path"
|
|
12
12
|
import { CliRenderEvents, createCliRenderer, type CliRenderer, type ScrollbackWriter } from "@opentui/core"
|
|
13
13
|
import { createDefaultOpenTuiKeymap } from "@opentui/keymap/opentui"
|
|
14
|
-
import { Global } from "@
|
|
15
|
-
import { openEditor } from "@
|
|
16
|
-
import {
|
|
14
|
+
import { Global } from "@anymous-ai/core/global"
|
|
15
|
+
import { openEditor } from "@anymous-ai/tui/editor"
|
|
16
|
+
import { registeranymousKeymap } from "@anymous-ai/tui/keymap"
|
|
17
17
|
import { Session as SessionApi } from "@/session/session"
|
|
18
18
|
import * as Locale from "@/util/locale"
|
|
19
19
|
import { resolveInteractiveStdin } from "./runtime.stdin"
|
|
@@ -196,7 +196,7 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
|
|
|
196
196
|
const theme = await resolveRunTheme(renderer)
|
|
197
197
|
renderer.setBackgroundColor(theme.background)
|
|
198
198
|
const keymap = createDefaultOpenTuiKeymap(renderer)
|
|
199
|
-
unregisterKeymap =
|
|
199
|
+
unregisterKeymap = registeranymousKeymap(keymap, renderer, input.tuiConfig)
|
|
200
200
|
const state: SplashState = {
|
|
201
201
|
entry: false,
|
|
202
202
|
exit: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Top-level orchestrator for `
|
|
1
|
+
// Top-level orchestrator for `anymous --mini`.
|
|
2
2
|
//
|
|
3
3
|
// Wires the boot sequence, lifecycle (renderer + footer), stream transport,
|
|
4
4
|
// and prompt queue together into a single session loop. Two entry points:
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// 3. starts the stream transport (SDK event subscription), lazily for fresh
|
|
13
13
|
// local sessions,
|
|
14
14
|
// 4. runs the prompt queue until the footer closes.
|
|
15
|
-
import {
|
|
16
|
-
import { Flag } from "@
|
|
15
|
+
import { createanymousClient } from "@anymous-ai/sdk/v2"
|
|
16
|
+
import { Flag } from "@anymous-ai/core/flag/flag"
|
|
17
17
|
import { MessageID } from "@/session/schema"
|
|
18
18
|
import { createRunDemo } from "./demo"
|
|
19
19
|
import { resolveModelInfo, resolveRunTuiConfig, resolveSessionInfo } from "./runtime.boot"
|
|
@@ -404,7 +404,7 @@ async function runInteractiveRuntime(input: RunRuntimeInput, deps: RunRuntimeDep
|
|
|
404
404
|
.then(loadCatalog)
|
|
405
405
|
.catch(() => {})
|
|
406
406
|
|
|
407
|
-
if (Flag.
|
|
407
|
+
if (Flag.ANYMOUS_SHOW_TTFD) {
|
|
408
408
|
footer.append({
|
|
409
409
|
kind: "system",
|
|
410
410
|
text: `startup ${Math.max(0, Math.round(performance.now() - start))}ms`,
|
|
@@ -733,8 +733,8 @@ async function runInteractiveRuntime(input: RunRuntimeInput, deps: RunRuntimeDep
|
|
|
733
733
|
// Local in-process mode. Creates an SDK client backed by a direct fetch to
|
|
734
734
|
// the in-process server, so no external HTTP server is needed.
|
|
735
735
|
export async function runInteractiveLocalMode(input: RunLocalInput): Promise<void> {
|
|
736
|
-
const sdk =
|
|
737
|
-
baseUrl: "http://
|
|
736
|
+
const sdk = createanymousClient({
|
|
737
|
+
baseUrl: "http://anymous.internal",
|
|
738
738
|
fetch: input.fetch,
|
|
739
739
|
directory: input.directory,
|
|
740
740
|
})
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
// `data.questions`. The footer shows whichever is first. When a reply
|
|
25
25
|
// event arrives, the queue entry is removed and the footer falls back
|
|
26
26
|
// to the next pending request or to the prompt view.
|
|
27
|
-
import type { Event, Part, PermissionRequest, QuestionRequest, ToolPart } from "@
|
|
27
|
+
import type { Event, Part, PermissionRequest, QuestionRequest, ToolPart } from "@anymous-ai/sdk/v2"
|
|
28
28
|
import * as Locale from "@/util/locale"
|
|
29
29
|
import { toolView } from "./tool"
|
|
30
30
|
import type { FooterOutput, FooterPatch, FooterView, StreamCommit } from "./types"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Event, PermissionRequest, QuestionRequest } from "@
|
|
1
|
+
import type { Event, PermissionRequest, QuestionRequest } from "@anymous-ai/sdk/v2"
|
|
2
2
|
import { bootstrapSessionData, createSessionData, reduceSessionData, type SessionData } from "./session-data"
|
|
3
3
|
import { messagePrompt, type SessionMessages } from "./session.shared"
|
|
4
4
|
import { messageTurnSummaryCommit } from "./turn-summary"
|
|
@@ -171,6 +171,8 @@ function draw(
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
const VERSION = "1.0.5"
|
|
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"
|