anymous 1.0.5 → 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 +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.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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 opencode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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
|
@@ -24,9 +24,9 @@ const archMap = {
|
|
|
24
24
|
|
|
25
25
|
const platform = platformMap[os.platform()] ?? os.platform()
|
|
26
26
|
const arch = archMap[os.arch()] ?? os.arch()
|
|
27
|
-
const base = `
|
|
28
|
-
const sourceBinary = platform === "windows" ? "
|
|
29
|
-
const targetBinary = path.join(__dirname, "bin", "
|
|
27
|
+
const base = `anymous-${platform}-${arch}`
|
|
28
|
+
const sourceBinary = platform === "windows" ? "anymous.exe" : "anymous"
|
|
29
|
+
const targetBinary = path.join(__dirname, "bin", "anymous.exe")
|
|
30
30
|
|
|
31
31
|
function supportsAvx2() {
|
|
32
32
|
if (arch !== "x64") return false
|
|
@@ -127,7 +127,7 @@ function installPackage(name) {
|
|
|
127
127
|
const version = packageJson.optionalDependencies?.[name]
|
|
128
128
|
if (!version) return
|
|
129
129
|
|
|
130
|
-
const temp = fs.mkdtempSync(path.join(os.tmpdir(), "
|
|
130
|
+
const temp = fs.mkdtempSync(path.join(os.tmpdir(), "anymous-install-"))
|
|
131
131
|
try {
|
|
132
132
|
const result = childProcess.spawnSync(
|
|
133
133
|
"npm",
|
|
@@ -175,7 +175,7 @@ function main() {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
throw new Error(
|
|
178
|
-
`It seems your package manager failed to install the right
|
|
178
|
+
`It seems your package manager failed to install the right anymous CLI package. Try manually installing ${packageNames()
|
|
179
179
|
.map((name) => JSON.stringify(name))
|
|
180
180
|
.join(" or ")}.`,
|
|
181
181
|
)
|
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({
|
package/src/agent/agent.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { PermissionV1 } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { PermissionV1 } from "@anymous-ai/core/v1/permission"
|
|
3
3
|
import { Config } from "@/config/config"
|
|
4
|
-
import { serviceUse } from "@
|
|
4
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
5
5
|
import { Provider } from "@/provider/provider"
|
|
6
6
|
|
|
7
7
|
import { generateObject, streamObject, type ModelMessage } from "ai"
|
|
@@ -34,7 +34,7 @@ import PROMPT_PENTEST_CRITIC from "./prompt/pentest-critic.txt"
|
|
|
34
34
|
import PROMPT_PENTEST_REPORTER from "./prompt/pentest-reporter.txt"
|
|
35
35
|
import { Permission } from "@/permission"
|
|
36
36
|
import { mergeDeep, pipe, sortBy, values } from "remeda"
|
|
37
|
-
import { Global } from "@
|
|
37
|
+
import { Global } from "@anymous-ai/core/global"
|
|
38
38
|
import path from "path"
|
|
39
39
|
import { Plugin } from "@/plugin"
|
|
40
40
|
import { Skill } from "../skill"
|
|
@@ -42,13 +42,13 @@ import { Effect, Context, Layer, Schema } from "effect"
|
|
|
42
42
|
import { InstanceState } from "@/effect/instance-state"
|
|
43
43
|
import * as Option from "effect/Option"
|
|
44
44
|
import * as OtelTracer from "@effect/opentelemetry/Tracer"
|
|
45
|
-
import { AbsolutePath, type DeepMutable } from "@
|
|
46
|
-
import { ProviderV2 } from "@
|
|
47
|
-
import { ModelV2 } from "@
|
|
48
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
49
|
-
import { Reference } from "@
|
|
50
|
-
import { Location } from "@
|
|
51
|
-
import { PluginV2 } from "@
|
|
45
|
+
import { AbsolutePath, type DeepMutable } from "@anymous-ai/core/schema"
|
|
46
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
47
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
48
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@anymous-ai/core/location-services"
|
|
49
|
+
import { Reference } from "@anymous-ai/core/reference"
|
|
50
|
+
import { Location } from "@anymous-ai/core/location"
|
|
51
|
+
import { PluginV2 } from "@anymous-ai/core/plugin"
|
|
52
52
|
|
|
53
53
|
export const Info = Schema.Struct({
|
|
54
54
|
name: Schema.String,
|
|
@@ -99,7 +99,7 @@ export interface Interface {
|
|
|
99
99
|
|
|
100
100
|
type State = Omit<Interface, "generate">
|
|
101
101
|
|
|
102
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
102
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Agent") {}
|
|
103
103
|
|
|
104
104
|
export const use = serviceUse(Service)
|
|
105
105
|
|
|
@@ -188,7 +188,7 @@ const layer = Layer.effect(
|
|
|
188
188
|
},
|
|
189
189
|
edit: {
|
|
190
190
|
"*": "deny",
|
|
191
|
-
[path.join(".
|
|
191
|
+
[path.join(".anymous", "plans", "*.md")]: "allow",
|
|
192
192
|
[path.relative(ctx.worktree, path.join(Global.Path.data, path.join("plans", "*.md")))]: "allow",
|
|
193
193
|
},
|
|
194
194
|
}),
|