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
package/bin/anymous.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const { spawnSync, spawn } = require("child_process")
|
|
3
|
-
const path = require("path")
|
|
4
|
-
const fs = require("fs")
|
|
5
|
-
|
|
6
|
-
function findBun() {
|
|
7
|
-
try {
|
|
8
|
-
const r = spawnSync("where", ["bun"], { shell: false, windowsHide: false, encoding: "utf8", timeout: 3000 })
|
|
9
|
-
if (r.status === 0) return r.stdout.trim().split("\n")[0]
|
|
10
|
-
} catch {}
|
|
11
|
-
try {
|
|
12
|
-
const r = spawnSync("which", ["bun"], { shell: false, windowsHide: false, encoding: "utf8", timeout: 3000 })
|
|
13
|
-
if (r.status === 0) return r.stdout.trim()
|
|
14
|
-
} catch {}
|
|
15
|
-
return null
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const scriptDir = path.dirname(__filename)
|
|
19
|
-
const pkgDir = path.resolve(scriptDir, "..")
|
|
20
|
-
const src = path.join(pkgDir, "src", "index.ts")
|
|
21
|
-
|
|
22
|
-
if (!fs.existsSync(src)) {
|
|
23
|
-
console.error("Anymous source not found. Run 'bun install' in " + pkgDir)
|
|
24
|
-
process.exit(1)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const bun = findBun()
|
|
28
|
-
if (!bun) {
|
|
29
|
-
console.error("Anymous requires Bun. Install: https://bun.sh")
|
|
30
|
-
process.exit(1)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const child = spawn(bun, ["run", "--conditions=browser", src, ...process.argv.slice(2)], {
|
|
34
|
-
stdio: "inherit",
|
|
35
|
-
cwd: pkgDir,
|
|
36
|
-
env: { ...process.env, ANYMOUS: "1" },
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
child.on("exit", (code, signal) => {
|
|
40
|
-
if (signal) process.kill(process.pid, signal)
|
|
41
|
-
else process.exit(typeof code === "number" ? code : 0)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const signals = ["SIGINT", "SIGTERM", "SIGHUP"]
|
|
45
|
-
for (const sig of signals) process.on(sig, () => child.kill(sig))
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawnSync, spawn } = require("child_process")
|
|
3
|
+
const path = require("path")
|
|
4
|
+
const fs = require("fs")
|
|
5
|
+
|
|
6
|
+
function findBun() {
|
|
7
|
+
try {
|
|
8
|
+
const r = spawnSync("where", ["bun"], { shell: false, windowsHide: false, encoding: "utf8", timeout: 3000 })
|
|
9
|
+
if (r.status === 0) return r.stdout.trim().split("\n")[0]
|
|
10
|
+
} catch {}
|
|
11
|
+
try {
|
|
12
|
+
const r = spawnSync("which", ["bun"], { shell: false, windowsHide: false, encoding: "utf8", timeout: 3000 })
|
|
13
|
+
if (r.status === 0) return r.stdout.trim()
|
|
14
|
+
} catch {}
|
|
15
|
+
return null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const scriptDir = path.dirname(__filename)
|
|
19
|
+
const pkgDir = path.resolve(scriptDir, "..")
|
|
20
|
+
const src = path.join(pkgDir, "src", "index.ts")
|
|
21
|
+
|
|
22
|
+
if (!fs.existsSync(src)) {
|
|
23
|
+
console.error("Anymous source not found. Run 'bun install' in " + pkgDir)
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const bun = findBun()
|
|
28
|
+
if (!bun) {
|
|
29
|
+
console.error("Anymous requires Bun. Install: https://bun.sh")
|
|
30
|
+
process.exit(1)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const child = spawn(bun, ["run", "--conditions=browser", src, ...process.argv.slice(2)], {
|
|
34
|
+
stdio: "inherit",
|
|
35
|
+
cwd: pkgDir,
|
|
36
|
+
env: { ...process.env, ANYMOUS: "1" },
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
child.on("exit", (code, signal) => {
|
|
40
|
+
if (signal) process.kill(process.pid, signal)
|
|
41
|
+
else process.exit(typeof code === "number" ? code : 0)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP"]
|
|
45
|
+
for (const sig of signals) process.on(sig, () => child.kill(sig))
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anymous",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "AI-powered reverse engineering platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://github.com/
|
|
7
|
+
"homepage": "https://github.com/anymousdark/anymous",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/
|
|
10
|
+
"url": "https://github.com/anymousdark/anymous"
|
|
11
11
|
},
|
|
12
12
|
"bin": {
|
|
13
13
|
"anymous": "./bin/anymous.cjs"
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"@ai-sdk/xai": "3.0.102",
|
|
53
53
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
54
54
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
55
|
-
"@effect/opentelemetry": "
|
|
56
|
-
"@effect/platform-node": "
|
|
55
|
+
"@effect/opentelemetry": "^4.0.0-beta.83",
|
|
56
|
+
"@effect/platform-node": "^4.0.0-beta.83",
|
|
57
57
|
"@ff-labs/fff-bun": "0.9.4",
|
|
58
58
|
"@gitlab/opencode-gitlab-auth": "1.3.3",
|
|
59
59
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
60
60
|
"@octokit/graphql": "9.0.2",
|
|
61
|
-
"@octokit/rest": "
|
|
62
|
-
"@openauthjs/openauth": "
|
|
61
|
+
"@octokit/rest": "^22.0.0",
|
|
62
|
+
"@openauthjs/openauth": "^0.0.0-20250322224806",
|
|
63
63
|
"@opencode-ai/codemode": "^1.18.5",
|
|
64
64
|
"@opencode-ai/llm": "^1.18.5",
|
|
65
65
|
"@opencode-ai/plugin": "^1.18.5",
|
|
@@ -75,26 +75,26 @@
|
|
|
75
75
|
"@opentelemetry/exporter-trace-otlp-http": "0.214.0",
|
|
76
76
|
"@opentelemetry/sdk-trace-base": "2.6.1",
|
|
77
77
|
"@opentelemetry/sdk-trace-node": "2.6.1",
|
|
78
|
-
"@opentui/core": "
|
|
79
|
-
"@opentui/keymap": "
|
|
80
|
-
"@opentui/solid": "
|
|
78
|
+
"@opentui/core": "^0.4.5",
|
|
79
|
+
"@opentui/keymap": "^0.4.5",
|
|
80
|
+
"@opentui/solid": "^0.4.5",
|
|
81
81
|
"@parcel/watcher": "2.5.1",
|
|
82
|
-
"@pierre/diffs": "
|
|
82
|
+
"@pierre/diffs": "^1.2.10",
|
|
83
83
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
84
84
|
"@solid-primitives/event-bus": "1.1.2",
|
|
85
85
|
"@solid-primitives/scheduled": "1.5.2",
|
|
86
86
|
"@standard-schema/spec": "1.0.0",
|
|
87
87
|
"@types/ws": "8.18.1",
|
|
88
88
|
"@zip.js/zip.js": "2.7.62",
|
|
89
|
-
"ai": "
|
|
89
|
+
"ai": "^6.0.168",
|
|
90
90
|
"ai-gateway-provider": "3.1.2",
|
|
91
91
|
"bonjour-service": "1.3.0",
|
|
92
92
|
"chokidar": "4.0.3",
|
|
93
|
-
"cross-spawn": "
|
|
93
|
+
"cross-spawn": "^7.0.6",
|
|
94
94
|
"decimal.js": "10.5.0",
|
|
95
|
-
"diff": "
|
|
96
|
-
"drizzle-orm": "
|
|
97
|
-
"effect": "
|
|
95
|
+
"diff": "^8.0.3",
|
|
96
|
+
"drizzle-orm": "^1.0.0-rc.2",
|
|
97
|
+
"effect": "^4.0.0-beta.83",
|
|
98
98
|
"fuzzysort": "3.1.0",
|
|
99
99
|
"gitlab-ai-provider": "6.11.1",
|
|
100
100
|
"glob": "13.0.5",
|
|
@@ -110,46 +110,46 @@
|
|
|
110
110
|
"open": "10.1.2",
|
|
111
111
|
"opencode-gitlab-auth": "2.1.0",
|
|
112
112
|
"opencode-poe-auth": "0.0.1",
|
|
113
|
-
"opentui-spinner": "
|
|
113
|
+
"opentui-spinner": "^0.0.7",
|
|
114
114
|
"partial-json": "0.1.7",
|
|
115
|
-
"remeda": "
|
|
115
|
+
"remeda": "^2.26.0",
|
|
116
116
|
"semver": "^7.6.3",
|
|
117
|
-
"solid-js": "
|
|
117
|
+
"solid-js": "^1.9.10",
|
|
118
118
|
"strip-ansi": "7.1.2",
|
|
119
119
|
"tree-sitter-bash": "0.25.0",
|
|
120
120
|
"tree-sitter-powershell": "0.25.10",
|
|
121
121
|
"turndown": "7.2.0",
|
|
122
|
-
"ulid": "
|
|
122
|
+
"ulid": "^3.0.1",
|
|
123
123
|
"venice-ai-sdk-provider": "2.1.1",
|
|
124
124
|
"vscode-jsonrpc": "8.2.1",
|
|
125
125
|
"web-tree-sitter": "0.25.10",
|
|
126
126
|
"ws": "8.21.0",
|
|
127
127
|
"xdg-basedir": "5.1.0",
|
|
128
128
|
"yargs": "18.0.0",
|
|
129
|
-
"zod": "
|
|
129
|
+
"zod": "^4.1.8",
|
|
130
130
|
"bun": "^1.0.0"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
133
|
"@babel/core": "7.28.4",
|
|
134
134
|
"@octokit/webhooks-types": "7.6.1",
|
|
135
135
|
"@standard-schema/spec": "1.0.0",
|
|
136
|
-
"@tsconfig/bun": "
|
|
136
|
+
"@tsconfig/bun": "^1.0.9",
|
|
137
137
|
"@types/babel__core": "7.20.5",
|
|
138
|
-
"@types/bun": "
|
|
139
|
-
"@types/cross-spawn": "
|
|
138
|
+
"@types/bun": "^1.3.13",
|
|
139
|
+
"@types/cross-spawn": "^6.0.6",
|
|
140
140
|
"@types/mime-types": "3.0.1",
|
|
141
141
|
"@types/npm-package-arg": "6.1.4",
|
|
142
142
|
"@types/semver": "^7.5.8",
|
|
143
143
|
"@types/turndown": "5.0.5",
|
|
144
144
|
"@types/yargs": "17.0.33",
|
|
145
|
-
"@typescript/native-preview": "
|
|
146
|
-
"drizzle-orm": "
|
|
145
|
+
"@typescript/native-preview": "^7.0.0-dev.20251207.1",
|
|
146
|
+
"drizzle-orm": "^1.0.0-rc.2",
|
|
147
147
|
"prettier": "3.6.2",
|
|
148
|
-
"typescript": "
|
|
148
|
+
"typescript": "^5.8.2",
|
|
149
149
|
"vscode-languageserver-types": "3.17.5",
|
|
150
150
|
"why-is-node-running": "3.2.2"
|
|
151
151
|
},
|
|
152
152
|
"overrides": {
|
|
153
|
-
"drizzle-orm": "
|
|
153
|
+
"drizzle-orm": "^1.0.0-rc.2"
|
|
154
154
|
}
|
|
155
155
|
}
|
package/src/account/account.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { httpClient } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { httpClient } from "@anymous-ai/core/effect/app-node-platform"
|
|
3
3
|
import { Cache, Clock, Duration, Effect, Layer, Option, Schema, SchemaGetter, Context } from "effect"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
5
5
|
import {
|
|
6
6
|
FetchHttpClient,
|
|
7
7
|
HttpClient,
|
|
@@ -134,7 +134,7 @@ class TokenRefreshRequest extends Schema.Class<TokenRefreshRequest>("TokenRefres
|
|
|
134
134
|
client_id: Schema.String,
|
|
135
135
|
}) {}
|
|
136
136
|
|
|
137
|
-
const clientId = "
|
|
137
|
+
const clientId = "anymous-cli"
|
|
138
138
|
const eagerRefreshThreshold = Duration.minutes(5)
|
|
139
139
|
const eagerRefreshThresholdMs = Duration.toMillis(eagerRefreshThreshold)
|
|
140
140
|
|
|
@@ -182,7 +182,7 @@ export interface Interface {
|
|
|
182
182
|
readonly poll: (input: Login) => Effect.Effect<PollResult, AccountError>
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
185
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Account") {}
|
|
186
186
|
|
|
187
187
|
export const use = serviceUse(Service)
|
|
188
188
|
|
package/src/account/repo.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { eq } from "drizzle-orm"
|
|
3
|
-
import { serviceUse } from "@
|
|
3
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
4
4
|
import { Effect, Layer, Option, Schema, Context } from "effect"
|
|
5
5
|
|
|
6
|
-
import { Database } from "@
|
|
7
|
-
import { AccountStateTable, AccountTable } from "@
|
|
6
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
7
|
+
import { AccountStateTable, AccountTable } from "@anymous-ai/core/account/sql"
|
|
8
8
|
import { AccessToken, AccountID, AccountRepoError, Info, OrgID, RefreshToken } from "./schema"
|
|
9
9
|
import { normalizeServerUrl } from "./url"
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ export interface Interface {
|
|
|
35
35
|
}) => Effect.Effect<void, AccountRepoError>
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
38
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/AccountRepo") {}
|
|
39
39
|
|
|
40
40
|
export const use = serviceUse(Service)
|
|
41
41
|
|
package/src/acp/agent.ts
CHANGED
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
type SetSessionModeRequest,
|
|
18
18
|
} from "@agentclientprotocol/sdk"
|
|
19
19
|
import { Effect } from "effect"
|
|
20
|
-
import type {
|
|
20
|
+
import type { anymousClient } from "@anymous-ai/sdk/v2"
|
|
21
21
|
import * as ACPError from "./error"
|
|
22
22
|
import * as ACPService from "./service"
|
|
23
23
|
|
|
24
|
-
export function init({ sdk: _sdk }: { sdk:
|
|
24
|
+
export function init({ sdk: _sdk }: { sdk: anymousClient }) {
|
|
25
25
|
return {
|
|
26
26
|
create: (connection: AgentSideConnection) => {
|
|
27
27
|
return new Agent(ACPService.make({ sdk: _sdk, connection }))
|
package/src/acp/content.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ContentBlock, ContentChunk, ResourceLink, Role } from "@agentclientprotocol/sdk"
|
|
2
2
|
import path from "node:path"
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url"
|
|
4
|
-
import { SessionV1 } from "@
|
|
4
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
5
5
|
|
|
6
6
|
export type PromptPart = SessionV1.TextPartInput | SessionV1.FilePartInput
|
|
7
7
|
|
package/src/acp/directory.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Command } from "@/command"
|
|
|
3
3
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
4
4
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
5
5
|
import { InstanceStore } from "@/project/instance-store"
|
|
6
|
-
import { LayerNode } from "@
|
|
7
|
-
import { ProviderV2 } from "@
|
|
8
|
-
import { ModelV2 } from "@
|
|
6
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
7
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
8
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
9
9
|
import { Provider } from "@/provider/provider"
|
|
10
10
|
import { Context, Effect, Layer, SynchronizedRef } from "effect"
|
|
11
11
|
import type * as ACPError from "./error"
|
|
@@ -51,9 +51,9 @@ export interface Interface {
|
|
|
51
51
|
readonly variants: (snapshot: Snapshot, model: DefaultModel) => ModelVariants | undefined
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export class Loader extends Context.Service<Loader, LoaderInterface>()("@
|
|
54
|
+
export class Loader extends Context.Service<Loader, LoaderInterface>()("@anymous/ACPDirectoryLoader") {}
|
|
55
55
|
|
|
56
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
56
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/ACPDirectory") {}
|
|
57
57
|
|
|
58
58
|
export const modelKey = (model: DefaultModel) => `${model.providerID}/${model.modelID}`
|
|
59
59
|
|
package/src/acp/event.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type {
|
|
|
3
3
|
Event,
|
|
4
4
|
EventMessagePartDelta,
|
|
5
5
|
EventMessagePartUpdated,
|
|
6
|
-
|
|
6
|
+
anymousClient,
|
|
7
7
|
Part,
|
|
8
8
|
SessionMessageResponse,
|
|
9
9
|
ToolPart,
|
|
10
|
-
} from "@
|
|
10
|
+
} from "@anymous-ai/sdk/v2"
|
|
11
11
|
import { Effect } from "effect"
|
|
12
12
|
import { ACPSession } from "./session"
|
|
13
13
|
import { ACPPermission } from "./permission"
|
|
@@ -30,7 +30,7 @@ type GlobalEventStream = {
|
|
|
30
30
|
stream: AsyncIterable<GlobalEventEnvelope>
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export function start(input: { sdk:
|
|
33
|
+
export function start(input: { sdk: anymousClient; connection: Connection; session: ACPSession.Interface }) {
|
|
34
34
|
const subscription = new Subscription(input)
|
|
35
35
|
subscription.start()
|
|
36
36
|
return subscription
|
|
@@ -45,7 +45,7 @@ export class Subscription {
|
|
|
45
45
|
|
|
46
46
|
constructor(
|
|
47
47
|
private readonly input: {
|
|
48
|
-
sdk:
|
|
48
|
+
sdk: anymousClient
|
|
49
49
|
connection: Connection
|
|
50
50
|
session: ACPSession.Interface
|
|
51
51
|
},
|
package/src/acp/permission.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
ToolCallLocation,
|
|
7
7
|
ToolCallUpdate,
|
|
8
8
|
} from "@agentclientprotocol/sdk"
|
|
9
|
-
import type { Event,
|
|
9
|
+
import type { Event, anymousClient } from "@anymous-ai/sdk/v2"
|
|
10
10
|
import { applyPatch } from "diff"
|
|
11
11
|
import { exists, readText } from "@/util/filesystem"
|
|
12
12
|
import type { ACPSession } from "./session"
|
|
@@ -28,7 +28,7 @@ export class Handler {
|
|
|
28
28
|
|
|
29
29
|
constructor(
|
|
30
30
|
private readonly input: {
|
|
31
|
-
sdk:
|
|
31
|
+
sdk: anymousClient
|
|
32
32
|
connection: Connection
|
|
33
33
|
session: ACPSession.Interface
|
|
34
34
|
},
|
package/src/acp/profile.ts
CHANGED
package/src/acp/service.ts
CHANGED
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
type SetSessionModeRequest,
|
|
30
30
|
type SetSessionModeResponse,
|
|
31
31
|
} from "@agentclientprotocol/sdk"
|
|
32
|
-
import { InstallationVersion } from "@
|
|
33
|
-
import { AppNodeBuilder } from "@
|
|
34
|
-
import type { AssistantMessage, Message,
|
|
32
|
+
import { InstallationVersion } from "@anymous-ai/core/installation/version"
|
|
33
|
+
import { AppNodeBuilder } from "@anymous-ai/core/effect/app-node-builder"
|
|
34
|
+
import type { AssistantMessage, Message, anymousClient, SessionMessageResponse } from "@anymous-ai/sdk/v2"
|
|
35
35
|
import { Context, Effect, Layer, ManagedRuntime } from "effect"
|
|
36
36
|
import * as ACPError from "./error"
|
|
37
37
|
import { buildConfigOptions, parseModelSelection } from "./config-option"
|
|
@@ -41,12 +41,12 @@ import { ACPEvent } from "./event"
|
|
|
41
41
|
import { ACPSession } from "./session"
|
|
42
42
|
import { UsageService } from "./usage"
|
|
43
43
|
import { ACPProfile } from "./profile"
|
|
44
|
-
import { ProviderV2 } from "@
|
|
45
|
-
import { ModelV2 } from "@
|
|
44
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
45
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
46
46
|
import { Provider } from "@/provider/provider"
|
|
47
47
|
import type { Command } from "@/command"
|
|
48
48
|
|
|
49
|
-
export const AuthMethodID = "
|
|
49
|
+
export const AuthMethodID = "anymous-login"
|
|
50
50
|
|
|
51
51
|
export type Error = ACPError.Error
|
|
52
52
|
type ServiceConnection = Pick<AgentSideConnection, "sessionUpdate"> &
|
|
@@ -70,10 +70,10 @@ export type Interface = {
|
|
|
70
70
|
readonly cancel: (input: CancelNotification) => Effect.Effect<void, Error>
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
73
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/ACP/Service") {}
|
|
74
74
|
|
|
75
75
|
export function make(input: {
|
|
76
|
-
sdk:
|
|
76
|
+
sdk: anymousClient
|
|
77
77
|
connection?: ServiceConnection
|
|
78
78
|
directory?: Directory.Interface
|
|
79
79
|
session?: ACPSession.Interface
|
|
@@ -92,17 +92,17 @@ export function make(input: {
|
|
|
92
92
|
const initialize = Effect.fn("ACP.initialize")(function* (params: InitializeRequest) {
|
|
93
93
|
const started = performance.now()
|
|
94
94
|
const authMethod: AuthMethod = {
|
|
95
|
-
description: "Run `
|
|
96
|
-
name: "Login with
|
|
95
|
+
description: "Run `anymous auth login` in the terminal",
|
|
96
|
+
name: "Login with anymous",
|
|
97
97
|
id: AuthMethodID,
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
if (params.clientCapabilities?._meta?.["terminal-auth"] === true) {
|
|
101
101
|
authMethod._meta = {
|
|
102
102
|
"terminal-auth": {
|
|
103
|
-
command: "
|
|
103
|
+
command: "anymous",
|
|
104
104
|
args: ["auth", "login"],
|
|
105
|
-
label: "
|
|
105
|
+
label: "anymous Login",
|
|
106
106
|
},
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -128,7 +128,7 @@ export function make(input: {
|
|
|
128
128
|
},
|
|
129
129
|
authMethods: [authMethod],
|
|
130
130
|
agentInfo: {
|
|
131
|
-
name: "
|
|
131
|
+
name: "anymous",
|
|
132
132
|
version: InstallationVersion,
|
|
133
133
|
},
|
|
134
134
|
}
|
|
@@ -575,7 +575,7 @@ function makeSessionService() {
|
|
|
575
575
|
)
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
-
function makeDirectoryService(sdk:
|
|
578
|
+
function makeDirectoryService(sdk: anymousClient) {
|
|
579
579
|
return ManagedRuntime.make(
|
|
580
580
|
AppNodeBuilder.build(Directory.node, [
|
|
581
581
|
[
|
|
@@ -591,7 +591,7 @@ function makeDirectoryService(sdk: OpencodeClient) {
|
|
|
591
591
|
).runSync(Directory.Service.use((service) => Effect.succeed(service)))
|
|
592
592
|
}
|
|
593
593
|
|
|
594
|
-
function makeUsageService(sdk:
|
|
594
|
+
function makeUsageService(sdk: anymousClient) {
|
|
595
595
|
const limits = new Map<string, Promise<number | undefined>>()
|
|
596
596
|
const contextLimit: UsageService.Interface["contextLimit"] = Effect.fn("ACP.promptUsage.contextLimit")(
|
|
597
597
|
function* (params) {
|
|
@@ -717,7 +717,7 @@ function profiledRequest<T>(name: string, fn: () => Promise<T | SdkResponse<T>>,
|
|
|
717
717
|
return request(() => ACPProfile.measure(name, fn), service)
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
-
async function loadDirectorySnapshot(sdk:
|
|
720
|
+
async function loadDirectorySnapshot(sdk: anymousClient, directory: string) {
|
|
721
721
|
return ACPProfile.measure("acp.directory.load", async () => {
|
|
722
722
|
const [providersResponse, agentsResponse, commandsResponse, skillsResponse, configResponse] = await Promise.all([
|
|
723
723
|
ACPProfile.measure("acp.directory.provider.list", () =>
|
|
@@ -782,11 +782,11 @@ function defaultModelFromConfig(
|
|
|
782
782
|
if (configured && providers[configured.providerID]?.models[configured.modelID]) return configured
|
|
783
783
|
|
|
784
784
|
// First-session ACP startup must not scan historical sessions just to infer
|
|
785
|
-
// a default. Configured model,
|
|
785
|
+
// a default. Configured model, anymous provider, then sorted best model keep
|
|
786
786
|
// the protocol response deterministic without extra session/message reads.
|
|
787
|
-
const
|
|
788
|
-
const
|
|
789
|
-
if (
|
|
787
|
+
const anymousProvider = providers[ProviderV2.ID.make("anymous")]
|
|
788
|
+
const anymousModel = anymousProvider ? Provider.sort(Object.values(anymousProvider.models))[0] : undefined
|
|
789
|
+
if (anymousProvider && anymousModel) return { providerID: anymousProvider.id, modelID: anymousModel.id }
|
|
790
790
|
|
|
791
791
|
const best = Provider.sort(Object.values(providers).flatMap((provider) => Object.values(provider.models)))[0]
|
|
792
792
|
if (best) return { providerID: best.providerID, modelID: best.id }
|
|
@@ -866,12 +866,12 @@ const promptResponse = Effect.fn("ACP.promptResponse")(function* (
|
|
|
866
866
|
|
|
867
867
|
function promptErrorMessage(error: AssistantError) {
|
|
868
868
|
if ("message" in error.data && typeof error.data.message === "string") return error.data.message
|
|
869
|
-
return "
|
|
869
|
+
return "anymous prompt failed"
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
function sendUsageUpdate(
|
|
873
873
|
usage: UsageService.Interface | undefined,
|
|
874
|
-
sdk:
|
|
874
|
+
sdk: anymousClient,
|
|
875
875
|
connection: ServiceConnection | undefined,
|
|
876
876
|
sessionID: string,
|
|
877
877
|
directory: string,
|
|
@@ -948,7 +948,7 @@ function sendAvailableCommands(
|
|
|
948
948
|
}
|
|
949
949
|
|
|
950
950
|
function registerMcpServers(
|
|
951
|
-
sdk:
|
|
951
|
+
sdk: anymousClient,
|
|
952
952
|
registered: Map<string, Set<string>>,
|
|
953
953
|
directory: string,
|
|
954
954
|
sessionId: string,
|
|
@@ -1059,7 +1059,7 @@ function fromUnknownError(error: unknown, service?: string): Error {
|
|
|
1059
1059
|
if (isAuthRequired(error)) {
|
|
1060
1060
|
return new ACPError.AuthRequiredError({ providerId: findProviderID(error) })
|
|
1061
1061
|
}
|
|
1062
|
-
return new ACPError.ServiceFailureError({ safeMessage: "
|
|
1062
|
+
return new ACPError.ServiceFailureError({ safeMessage: "anymous service failure", service })
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
1065
1065
|
function isACPError(error: unknown): error is Error {
|
package/src/acp/session.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { McpServer } from "@agentclientprotocol/sdk"
|
|
2
|
-
import type { Message, Part } from "@
|
|
3
|
-
import { LayerNode } from "@
|
|
4
|
-
import { ProviderV2 } from "@
|
|
5
|
-
import { ModelV2 } from "@
|
|
2
|
+
import type { Message, Part } from "@anymous-ai/sdk/v2"
|
|
3
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
4
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
5
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
6
6
|
import { Context, Effect, Layer, Ref } from "effect"
|
|
7
7
|
import * as ACPError from "./error"
|
|
8
8
|
|
|
@@ -90,7 +90,7 @@ export type Interface = {
|
|
|
90
90
|
readonly tryGetPartMetadata: (input: PartMetadataLookupInput) => Effect.Effect<KnownMessagePartMetadata | undefined>
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
93
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/ACP/Session") {}
|
|
94
94
|
|
|
95
95
|
type State = Map<string, Info>
|
|
96
96
|
|
package/src/acp/usage.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { AgentSideConnection, Usage } from "@agentclientprotocol/sdk"
|
|
2
|
-
import type { AssistantMessage as
|
|
2
|
+
import type { AssistantMessage as anymousAssistantMessage, Message } from "@anymous-ai/sdk/v2"
|
|
3
3
|
import { InstanceRef } from "@/effect/instance-ref"
|
|
4
4
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
5
5
|
import { InstanceStore } from "@/project/instance-store"
|
|
6
|
-
import { makeGlobalNode, Node } from "@
|
|
7
|
-
import { LayerNode } from "@
|
|
8
|
-
import { ProviderV2 } from "@
|
|
9
|
-
import { ModelV2 } from "@
|
|
6
|
+
import { makeGlobalNode, Node } from "@anymous-ai/core/effect/app-node"
|
|
7
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
8
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
9
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
10
10
|
import { Provider } from "@/provider/provider"
|
|
11
11
|
import { Context, Effect, Layer, SynchronizedRef } from "effect"
|
|
12
12
|
|
|
13
|
-
export type AssistantTokenCost = Pick<
|
|
13
|
+
export type AssistantTokenCost = Pick<anymousAssistantMessage, "cost" | "tokens">
|
|
14
14
|
|
|
15
15
|
export type AssistantMessage = AssistantTokenCost &
|
|
16
|
-
Pick<
|
|
17
|
-
Partial<Pick<
|
|
16
|
+
Pick<anymousAssistantMessage, "role"> &
|
|
17
|
+
Partial<Pick<anymousAssistantMessage, "providerID" | "modelID">>
|
|
18
18
|
|
|
19
19
|
export type SessionMessage = {
|
|
20
20
|
readonly info: { readonly role: Message["role"] } | AssistantMessage
|
|
@@ -61,14 +61,14 @@ export interface Interface {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export class MessageLoader extends Context.Service<MessageLoader, MessageLoaderInterface>()(
|
|
64
|
-
"@
|
|
64
|
+
"@anymous/ACPUsageMessageLoader",
|
|
65
65
|
) {}
|
|
66
66
|
|
|
67
67
|
export class ContextLimitLoader extends Context.Service<ContextLimitLoader, ContextLimitLoaderInterface>()(
|
|
68
|
-
"@
|
|
68
|
+
"@anymous/ACPUsageContextLimitLoader",
|
|
69
69
|
) {}
|
|
70
70
|
|
|
71
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
71
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/ACPUsage") {}
|
|
72
72
|
|
|
73
73
|
export function messageLoaderFromSDK(sdk: SDK): MessageLoaderInterface {
|
|
74
74
|
return MessageLoader.of({
|