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/session/schema.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
2
|
|
|
3
3
|
import { Identifier } from "@/id/id"
|
|
4
|
-
import { SessionV2 } from "@
|
|
5
|
-
import { statics } from "@
|
|
4
|
+
import { SessionV2 } from "@anymous-ai/core/session"
|
|
5
|
+
import { statics } from "@anymous-ai/core/schema"
|
|
6
6
|
|
|
7
7
|
export const SessionID = SessionV2.ID
|
|
8
8
|
export type SessionID = Schema.Schema.Type<typeof SessionID>
|
package/src/session/session.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { PermissionV1 } from "@
|
|
3
|
-
import { Slug } from "@
|
|
4
|
-
import { SessionV1 } from "@
|
|
5
|
-
import { serviceUse } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { PermissionV1 } from "@anymous-ai/core/v1/permission"
|
|
3
|
+
import { Slug } from "@anymous-ai/core/util/slug"
|
|
4
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
5
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
6
6
|
import path from "path"
|
|
7
7
|
import { BackgroundJob } from "@/background/job"
|
|
8
8
|
import { Decimal } from "decimal.js"
|
|
9
|
-
import type { ProviderMetadata, Usage } from "@
|
|
10
|
-
import { InstallationVersion } from "@
|
|
11
|
-
import { Database } from "@
|
|
9
|
+
import type { ProviderMetadata, Usage } from "@anymous-ai/llm"
|
|
10
|
+
import { InstallationVersion } from "@anymous-ai/core/installation/version"
|
|
11
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
12
12
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
13
|
-
import { SessionV2 } from "@
|
|
14
|
-
import * as SessionExecutionLocal from "@
|
|
15
|
-
import { locationServiceMapLayer } from "@
|
|
13
|
+
import { SessionV2 } from "@anymous-ai/core/session"
|
|
14
|
+
import * as SessionExecutionLocal from "@anymous-ai/core/session/execution/local"
|
|
15
|
+
import { locationServiceMapLayer } from "@anymous-ai/core/location-services"
|
|
16
16
|
|
|
17
17
|
import { NotFoundError } from "@/storage/storage"
|
|
18
18
|
import { eq } from "drizzle-orm"
|
|
@@ -26,24 +26,24 @@ import { inArray } from "drizzle-orm"
|
|
|
26
26
|
import { lt } from "drizzle-orm"
|
|
27
27
|
import { or } from "drizzle-orm"
|
|
28
28
|
import type { SQL } from "drizzle-orm"
|
|
29
|
-
import { PartTable, SessionTable } from "@
|
|
30
|
-
import { ProjectTable } from "@
|
|
29
|
+
import { PartTable, SessionTable } from "@anymous-ai/core/session/sql"
|
|
30
|
+
import { ProjectTable } from "@anymous-ai/core/project/sql"
|
|
31
31
|
import { MessageV2 } from "./message-v2"
|
|
32
32
|
import type { InstanceContext } from "../project/instance-context"
|
|
33
33
|
import { InstanceState } from "@/effect/instance-state"
|
|
34
34
|
import { Snapshot } from "@/snapshot"
|
|
35
|
-
import { ProjectV2 } from "@
|
|
36
|
-
import { WorkspaceV2 } from "@
|
|
35
|
+
import { ProjectV2 } from "@anymous-ai/core/project"
|
|
36
|
+
import { WorkspaceV2 } from "@anymous-ai/core/workspace"
|
|
37
37
|
import { SessionID, MessageID, PartID } from "./schema"
|
|
38
38
|
|
|
39
39
|
import type { Provider } from "@/provider/provider"
|
|
40
|
-
import { Global } from "@
|
|
40
|
+
import { Global } from "@anymous-ai/core/global"
|
|
41
41
|
import { Effect, Layer, Option, Context, Schema, Types } from "effect"
|
|
42
|
-
import { NonNegativeInt, optional } from "@
|
|
42
|
+
import { NonNegativeInt, optional } from "@anymous-ai/core/schema"
|
|
43
43
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
44
|
-
import { ProviderV2 } from "@
|
|
45
|
-
import { ModelV2 } from "@
|
|
46
|
-
import { SessionMessage } from "@
|
|
44
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
45
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
46
|
+
import { SessionMessage } from "@anymous-ai/schema/session-message"
|
|
47
47
|
|
|
48
48
|
const parentTitlePrefix = "New session - "
|
|
49
49
|
const childTitlePrefix = "Child session - "
|
|
@@ -330,7 +330,7 @@ export const Event = {
|
|
|
330
330
|
|
|
331
331
|
export function plan(input: { slug: string; time: { created: number } }, instance: InstanceContext) {
|
|
332
332
|
const base = instance.project.vcs
|
|
333
|
-
? path.join(instance.worktree, ".
|
|
333
|
+
? path.join(instance.worktree, ".anymous", "plans")
|
|
334
334
|
: path.join(Global.Path.data, "plans")
|
|
335
335
|
return path.join(base, [input.time.created, input.slug].join("-") + ".md")
|
|
336
336
|
}
|
|
@@ -473,7 +473,7 @@ export interface Interface {
|
|
|
473
473
|
) => Effect.Effect<Option.Option<SessionV1.WithParts>, NotFound>
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
476
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Session") {}
|
|
477
477
|
|
|
478
478
|
export const use = serviceUse(Service)
|
|
479
479
|
|
package/src/session/status.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { InstanceState } from "@/effect/instance-state"
|
|
3
3
|
import { SessionID } from "./schema"
|
|
4
4
|
import { Effect, Layer, Context } from "effect"
|
|
5
5
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
6
|
-
import { SessionStatusEvent } from "@
|
|
6
|
+
import { SessionStatusEvent } from "@anymous-ai/schema/session-status-event"
|
|
7
7
|
|
|
8
8
|
export const Info = SessionStatusEvent.Info
|
|
9
9
|
export type Info = SessionStatusEvent.Info
|
|
@@ -16,7 +16,7 @@ export interface Interface {
|
|
|
16
16
|
readonly set: (sessionID: SessionID, status: Info) => Effect.Effect<void>
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
19
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/SessionStatus") {}
|
|
20
20
|
|
|
21
21
|
const layer = Layer.effect(
|
|
22
22
|
Service,
|
package/src/session/summary.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { Effect, Layer, Context, Schema } from "effect"
|
|
3
|
-
import { SessionV1 } from "@
|
|
3
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
4
4
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
5
5
|
import { Snapshot } from "@/snapshot"
|
|
6
6
|
import { Session } from "./session"
|
|
@@ -69,7 +69,7 @@ export interface Interface {
|
|
|
69
69
|
readonly computeDiff: (input: { messages: SessionV1.WithParts[] }) => Effect.Effect<Snapshot.FileDiff[]>
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
72
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/SessionSummary") {}
|
|
73
73
|
|
|
74
74
|
const layer = Layer.effect(
|
|
75
75
|
Service,
|
package/src/session/system.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { Context, Effect, Layer } from "effect"
|
|
3
3
|
|
|
4
4
|
import { InstanceState } from "@/effect/instance-state"
|
|
@@ -17,12 +17,12 @@ import type { Provider } from "@/provider/provider"
|
|
|
17
17
|
import type { Agent } from "@/agent/agent"
|
|
18
18
|
import { Permission } from "@/permission"
|
|
19
19
|
import { Skill } from "@/skill"
|
|
20
|
-
import { AbsolutePath } from "@
|
|
21
|
-
import { Location } from "@
|
|
22
|
-
import { LocationServiceMap, locationServiceMapLayer } from "@
|
|
23
|
-
import { Reference } from "@
|
|
20
|
+
import { AbsolutePath } from "@anymous-ai/core/schema"
|
|
21
|
+
import { Location } from "@anymous-ai/core/location"
|
|
22
|
+
import { LocationServiceMap, locationServiceMapLayer } from "@anymous-ai/core/location-services"
|
|
23
|
+
import { Reference } from "@anymous-ai/core/reference"
|
|
24
24
|
import { MCP } from "@/mcp"
|
|
25
|
-
import { PermissionV1 } from "@
|
|
25
|
+
import { PermissionV1 } from "@anymous-ai/core/v1/permission"
|
|
26
26
|
|
|
27
27
|
export function provider(model: Provider.Model) {
|
|
28
28
|
if (model.api.id.includes("muse-spark")) return [PROMPT_META]
|
|
@@ -47,7 +47,7 @@ export interface Interface {
|
|
|
47
47
|
readonly mcp: (agent: Agent.Info, permission?: PermissionV1.Ruleset) => Effect.Effect<string | undefined>
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
50
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/SystemPrompt") {}
|
|
51
51
|
|
|
52
52
|
const layer = Layer.effect(
|
|
53
53
|
Service,
|
package/src/session/todo.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { SessionID } from "./schema"
|
|
3
3
|
import { Effect, Layer, Context } from "effect"
|
|
4
|
-
import { Database } from "@
|
|
4
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
5
5
|
import { eq } from "drizzle-orm"
|
|
6
6
|
import { asc } from "drizzle-orm"
|
|
7
|
-
import { TodoTable } from "@
|
|
7
|
+
import { TodoTable } from "@anymous-ai/core/session/sql"
|
|
8
8
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
9
|
-
import { SessionTodo } from "@
|
|
9
|
+
import { SessionTodo } from "@anymous-ai/schema/session-todo"
|
|
10
10
|
|
|
11
11
|
export const Info = SessionTodo.Info
|
|
12
12
|
export type Info = SessionTodo.Info
|
|
@@ -18,7 +18,7 @@ export interface Interface {
|
|
|
18
18
|
readonly get: (sessionID: SessionID) => Effect.Effect<Info[]>
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
21
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/SessionTodo") {}
|
|
22
22
|
|
|
23
23
|
const layer = Layer.effect(
|
|
24
24
|
Service,
|
package/src/session/tools.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Agent } from "@/agent/agent"
|
|
2
|
-
import { SessionV1 } from "@
|
|
2
|
+
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
3
3
|
import { Provider } from "@/provider/provider"
|
|
4
4
|
import { ProviderTransform } from "@/provider/transform"
|
|
5
5
|
import { MCP } from "@/mcp"
|
|
@@ -19,8 +19,8 @@ import { Session } from "./session"
|
|
|
19
19
|
import { SessionProcessor } from "./processor"
|
|
20
20
|
import { PartID } from "./schema"
|
|
21
21
|
import { EffectBridge } from "@/effect/bridge"
|
|
22
|
-
import { ProviderV2 } from "@
|
|
23
|
-
import { ModelV2 } from "@
|
|
22
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
23
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
24
24
|
import { isRecord } from "@/util/record"
|
|
25
25
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
26
26
|
|
package/src/share/session.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { Session } from "@/session/session"
|
|
3
3
|
import { SessionID } from "@/session/schema"
|
|
4
4
|
import { Effect, Layer, Scope, Context } from "effect"
|
|
@@ -12,7 +12,7 @@ export interface Interface {
|
|
|
12
12
|
readonly unshare: (sessionID: SessionID) => Effect.Effect<void, unknown>
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
15
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/SessionShare") {}
|
|
16
16
|
|
|
17
17
|
const layer = Layer.effect(
|
|
18
18
|
Service,
|
package/src/share/share-next.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { httpClient } from "@
|
|
3
|
-
import type * as SDK from "@
|
|
4
|
-
import { serviceUse } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { httpClient } from "@anymous-ai/core/effect/app-node-platform"
|
|
3
|
+
import type * as SDK from "@anymous-ai/sdk/v2"
|
|
4
|
+
import { serviceUse } from "@anymous-ai/core/effect/service-use"
|
|
5
5
|
import { Effect, Exit, Layer, Option, Schema, Scope, Context, Stream } from "effect"
|
|
6
6
|
import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
|
|
7
7
|
import { Account } from "@/account/account"
|
|
@@ -12,15 +12,15 @@ import { Provider } from "@/provider/provider"
|
|
|
12
12
|
import { Session } from "@/session/session"
|
|
13
13
|
import { MessageV2 } from "@/session/message-v2"
|
|
14
14
|
import type { SessionID } from "@/session/schema"
|
|
15
|
-
import { Database } from "@
|
|
15
|
+
import { Database } from "@anymous-ai/core/database/database"
|
|
16
16
|
import { eq } from "drizzle-orm"
|
|
17
17
|
import { Config } from "@/config/config"
|
|
18
|
-
import { SessionShareTable } from "@
|
|
19
|
-
import { ProviderV2 } from "@
|
|
20
|
-
import { ModelV2 } from "@
|
|
21
|
-
import { EventV2 } from "@
|
|
18
|
+
import { SessionShareTable } from "@anymous-ai/core/share/sql"
|
|
19
|
+
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
20
|
+
import { ModelV2 } from "@anymous-ai/core/model"
|
|
21
|
+
import { EventV2 } from "@anymous-ai/core/event"
|
|
22
22
|
|
|
23
|
-
const disabled = process.env["
|
|
23
|
+
const disabled = process.env["ANYMOUS_DISABLE_SHARE"] === "true" || process.env["ANYMOUS_DISABLE_SHARE"] === "1"
|
|
24
24
|
|
|
25
25
|
export type Api = {
|
|
26
26
|
create: string
|
|
@@ -78,7 +78,7 @@ export interface Interface {
|
|
|
78
78
|
readonly remove: (sessionID: SessionID) => Effect.Effect<void, unknown>
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
81
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/ShareNext") {}
|
|
82
82
|
|
|
83
83
|
export const use = serviceUse(Service)
|
|
84
84
|
|
package/src/skill/discovery.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
2
|
-
import { httpClient, path } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
|
+
import { httpClient, path } from "@anymous-ai/core/effect/app-node-platform"
|
|
3
3
|
import { NodePath } from "@effect/platform-node"
|
|
4
4
|
import { Effect, Layer, Path, Schema, Context } from "effect"
|
|
5
5
|
import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
|
|
6
6
|
import { withTransientReadRetry } from "@/util/effect-http-client"
|
|
7
|
-
import { FSUtil } from "@
|
|
8
|
-
import { Global } from "@
|
|
7
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
8
|
+
import { Global } from "@anymous-ai/core/global"
|
|
9
9
|
|
|
10
10
|
const skillConcurrency = 4
|
|
11
11
|
const fileConcurrency = 8
|
|
@@ -24,7 +24,7 @@ export interface Interface {
|
|
|
24
24
|
readonly pull: (url: string) => Effect.Effect<string[]>
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
27
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/SkillDiscovery") {}
|
|
28
28
|
|
|
29
29
|
const layer: Layer.Layer<Service, never, FSUtil.Service | Path.Path | HttpClient.HttpClient> = Layer.effect(
|
|
30
30
|
Service,
|
|
@@ -77,7 +77,7 @@ const layer: Layer.Layer<Service, never, FSUtil.Service | Path.Path | HttpClient
|
|
|
77
77
|
(skill) =>
|
|
78
78
|
Effect.gen(function* () {
|
|
79
79
|
const root = path.join(cache, skill.name)
|
|
80
|
-
const versionFile = path.join(root, ".
|
|
80
|
+
const versionFile = path.join(root, ".anymous-version")
|
|
81
81
|
const version = skill.version
|
|
82
82
|
const current =
|
|
83
83
|
version === undefined
|
|
@@ -102,7 +102,7 @@ const layer: Layer.Layer<Service, never, FSUtil.Service | Path.Path | HttpClient
|
|
|
102
102
|
)
|
|
103
103
|
if (!downloaded.every(Boolean)) return
|
|
104
104
|
if (!(yield* fs.exists(path.join(staging, "SKILL.md")).pipe(Effect.orDie))) return
|
|
105
|
-
yield* fs.writeFileString(path.join(staging, ".
|
|
105
|
+
yield* fs.writeFileString(path.join(staging, ".anymous-version"), version)
|
|
106
106
|
yield* Effect.uninterruptible(
|
|
107
107
|
Effect.gen(function* () {
|
|
108
108
|
const cached = yield* fs.exists(root).pipe(Effect.orDie)
|
package/src/skill/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import path from "path"
|
|
3
3
|
import { Effect, Layer, Context, Schema } from "effect"
|
|
4
|
-
import { NamedError } from "@
|
|
4
|
+
import { NamedError } from "@anymous-ai/core/util/error"
|
|
5
5
|
import type { Agent } from "@/agent/agent"
|
|
6
6
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
7
7
|
import { InstanceState } from "@/effect/instance-state"
|
|
8
|
-
import { Global } from "@
|
|
9
|
-
import { SkillPlugin } from "@
|
|
8
|
+
import { Global } from "@anymous-ai/core/global"
|
|
9
|
+
import { SkillPlugin } from "@anymous-ai/core/plugin/skill"
|
|
10
10
|
import { Permission } from "@/permission"
|
|
11
|
-
import { FSUtil } from "@
|
|
11
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
12
12
|
import { Config } from "@/config/config"
|
|
13
|
-
import { FrontmatterError } from "@
|
|
13
|
+
import { FrontmatterError } from "@anymous-ai/core/v1/config/error"
|
|
14
14
|
import { ConfigMarkdown } from "@/config/markdown"
|
|
15
15
|
import { RuntimeFlags } from "@/effect/runtime-flags"
|
|
16
|
-
import { Glob } from "@
|
|
16
|
+
import { Glob } from "@anymous-ai/core/util/glob"
|
|
17
17
|
import { Discovery } from "./discovery"
|
|
18
18
|
import { isRecord } from "@/util/record"
|
|
19
19
|
import { escapeHtml } from "@/util/html"
|
|
@@ -21,18 +21,18 @@ import { escapeHtml } from "@/util/html"
|
|
|
21
21
|
const CLAUDE_EXTERNAL_DIR = ".claude"
|
|
22
22
|
const AGENTS_EXTERNAL_DIR = ".agents"
|
|
23
23
|
const EXTERNAL_SKILL_PATTERN = "skills/**/SKILL.md"
|
|
24
|
-
const
|
|
24
|
+
const ANYMOUS_SKILL_PATTERN = "{skill,skills}/**/SKILL.md"
|
|
25
25
|
const SKILL_PATTERN = "**/SKILL.md"
|
|
26
26
|
|
|
27
|
-
// Built-in skill that ships with
|
|
28
|
-
//
|
|
27
|
+
// Built-in skill that ships with anymous. The model's intuition for what an
|
|
28
|
+
// anymous.json should look like is often wrong, and anymous hard-fails on
|
|
29
29
|
// invalid config, so users hit cryptic startup errors. Loading this skill
|
|
30
|
-
// when the model is asked to touch
|
|
30
|
+
// when the model is asked to touch anymous's own config files gives it the
|
|
31
31
|
// actual schemas instead of guesses.
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
"Use ONLY when the user is editing or creating
|
|
35
|
-
const
|
|
32
|
+
const CUSTOMIZE_ANYMOUS_SKILL_NAME = "customize-anymous"
|
|
33
|
+
const CUSTOMIZE_ANYMOUS_SKILL_DESCRIPTION =
|
|
34
|
+
"Use ONLY when the user is editing or creating anymous's own configuration: anymous.json, anymous.jsonc, files under .anymous/, or files under ~/.config/anymous/. Also use when creating or fixing anymous agents, subagents, skills, plugins, MCP servers, or permission rules. Do not use for the user's own application code, or for any project that is not configuring anymous itself."
|
|
35
|
+
const CUSTOMIZE_ANYMOUS_SKILL_BODY = SkillPlugin.CustomizeanymousContent
|
|
36
36
|
|
|
37
37
|
export const Info = Schema.Struct({
|
|
38
38
|
name: Schema.String,
|
|
@@ -204,7 +204,7 @@ const discoverSkills = Effect.fnUntraced(function* (
|
|
|
204
204
|
|
|
205
205
|
const configDirs = yield* config.directories()
|
|
206
206
|
for (const dir of configDirs) {
|
|
207
|
-
yield* scan(state, dir,
|
|
207
|
+
yield* scan(state, dir, ANYMOUS_SKILL_PATTERN)
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
const cfg = yield* config.get()
|
|
@@ -245,7 +245,7 @@ const loadSkills = Effect.fnUntraced(function* (
|
|
|
245
245
|
yield* Effect.logInfo("init", { count: Object.keys(state.skills).length })
|
|
246
246
|
})
|
|
247
247
|
|
|
248
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
248
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Skill") {}
|
|
249
249
|
|
|
250
250
|
const layer = Layer.effect(
|
|
251
251
|
Service,
|
|
@@ -275,11 +275,11 @@ const layer = Layer.effect(
|
|
|
275
275
|
const s: State = { skills: {}, dirs: new Set() }
|
|
276
276
|
// Register the built-in skill BEFORE disk discovery so a user-disk
|
|
277
277
|
// skill with the same name can override it.
|
|
278
|
-
s.skills[
|
|
279
|
-
name:
|
|
280
|
-
description:
|
|
278
|
+
s.skills[CUSTOMIZE_ANYMOUS_SKILL_NAME] = {
|
|
279
|
+
name: CUSTOMIZE_ANYMOUS_SKILL_NAME,
|
|
280
|
+
description: CUSTOMIZE_ANYMOUS_SKILL_DESCRIPTION,
|
|
281
281
|
location: "<built-in>",
|
|
282
|
-
content:
|
|
282
|
+
content: CUSTOMIZE_ANYMOUS_SKILL_BODY,
|
|
283
283
|
}
|
|
284
284
|
yield* loadSkills(s, yield* InstanceState.get(discovered), events)
|
|
285
285
|
return s
|
package/src/snapshot/index.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import { Cause, Duration, Effect, Layer, Schedule, Schema, Semaphore, Context } from "effect"
|
|
3
3
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
|
|
4
4
|
import { formatPatch, structuredPatch } from "diff"
|
|
5
5
|
import path from "path"
|
|
6
|
-
import { AppProcess } from "@
|
|
6
|
+
import { AppProcess } from "@anymous-ai/core/process"
|
|
7
7
|
import { InstanceState } from "@/effect/instance-state"
|
|
8
|
-
import { FSUtil } from "@
|
|
9
|
-
import { Hash } from "@
|
|
8
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
9
|
+
import { Hash } from "@anymous-ai/core/util/hash"
|
|
10
10
|
import { Config } from "@/config/config"
|
|
11
|
-
import { Global } from "@
|
|
12
|
-
import { Info } from "@
|
|
11
|
+
import { Global } from "@anymous-ai/core/global"
|
|
12
|
+
import { Info } from "@anymous-ai/schema/file-diff"
|
|
13
13
|
|
|
14
14
|
export const Patch = Schema.Struct({
|
|
15
15
|
hash: Schema.String,
|
|
@@ -44,7 +44,7 @@ export interface Interface {
|
|
|
44
44
|
readonly diffFull: (from: string, to: string) => Effect.Effect<FileDiff[]>
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
47
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Snapshot") {}
|
|
48
48
|
|
|
49
49
|
const layer: Layer.Layer<Service, never, FSUtil.Service | AppProcess.Service | Config.Service> = Layer.effect(
|
|
50
50
|
Service,
|
package/src/storage/schema.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AccountTable, AccountStateTable, ControlAccountTable } from "@
|
|
2
|
-
export { ProjectTable } from "@
|
|
3
|
-
export { SessionTable, MessageTable, PartTable, TodoTable } from "@
|
|
4
|
-
export { SessionShareTable } from "@
|
|
5
|
-
export { WorkspaceTable } from "@
|
|
1
|
+
export { AccountTable, AccountStateTable, ControlAccountTable } from "@anymous-ai/core/account/sql"
|
|
2
|
+
export { ProjectTable } from "@anymous-ai/core/project/sql"
|
|
3
|
+
export { SessionTable, MessageTable, PartTable, TodoTable } from "@anymous-ai/core/session/sql"
|
|
4
|
+
export { SessionShareTable } from "@anymous-ai/core/share/sql"
|
|
5
|
+
export { WorkspaceTable } from "@anymous-ai/core/control-plane/workspace.sql"
|
package/src/storage/storage.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LayerNode } from "@
|
|
1
|
+
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
2
2
|
import path from "path"
|
|
3
|
-
import { Global } from "@
|
|
4
|
-
import { FSUtil } from "@
|
|
3
|
+
import { Global } from "@anymous-ai/core/global"
|
|
4
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
5
5
|
import { Effect, Exit, Layer, Option, RcMap, Schema, Context, TxReentrantLock } from "effect"
|
|
6
|
-
import { NonNegativeInt } from "@
|
|
6
|
+
import { NonNegativeInt } from "@anymous-ai/core/schema"
|
|
7
7
|
import { Git } from "@/git"
|
|
8
8
|
|
|
9
9
|
type Migration = (dir: string, fs: FSUtil.Interface, git: Git.Interface) => Effect.Effect<void, FSUtil.Error>
|
|
@@ -58,7 +58,7 @@ export interface Interface {
|
|
|
58
58
|
readonly list: (prefix: string[]) => Effect.Effect<string[][], FSUtil.Error>
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export class Service extends Context.Service<Service, Interface>()("@
|
|
61
|
+
export class Service extends Context.Service<Service, Interface>()("@anymous/Storage") {}
|
|
62
62
|
|
|
63
63
|
function file(dir: string, key: string[]) {
|
|
64
64
|
return path.join(dir, ...key) + ".json"
|
package/src/sync/schema.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect"
|
|
2
2
|
|
|
3
3
|
import { Identifier } from "@/id/id"
|
|
4
|
-
import { statics } from "@
|
|
4
|
+
import { statics } from "@anymous-ai/core/schema"
|
|
5
5
|
|
|
6
6
|
export const EventID = Schema.String.check(Schema.isStartsWith("evt")).pipe(
|
|
7
7
|
Schema.brand("EventID"),
|
package/src/temporary.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import yargs from "yargs"
|
|
2
2
|
import { TuiThreadCommand } from "./cli/cmd/tui"
|
|
3
|
-
import { InstallationVersion } from "@
|
|
3
|
+
import { InstallationVersion } from "@anymous-ai/core/installation/version"
|
|
4
4
|
import { hideBin } from "yargs/helpers"
|
|
5
5
|
const cli = yargs(hideBin(process.argv))
|
|
6
6
|
.parserConfiguration({ "populate--": true })
|
|
7
|
-
.scriptName("
|
|
7
|
+
.scriptName("anymous")
|
|
8
8
|
.wrap(100)
|
|
9
9
|
.help("help", "show help")
|
|
10
10
|
.alias("help", "h")
|
|
@@ -24,8 +24,8 @@ const cli = yargs(hideBin(process.argv))
|
|
|
24
24
|
type: "boolean",
|
|
25
25
|
})
|
|
26
26
|
.middleware((opts) => {
|
|
27
|
-
if (opts.printLogs) process.env.
|
|
28
|
-
if (opts.logLevel) process.env.
|
|
27
|
+
if (opts.printLogs) process.env.ANYMOUS_PRINT_LOGS = "1"
|
|
28
|
+
if (opts.logLevel) process.env.ANYMOUS_LOG_LEVEL = opts.logLevel
|
|
29
29
|
})
|
|
30
30
|
.command(TuiThreadCommand)
|
|
31
31
|
.parse()
|
package/src/tool/apply_patch.ts
CHANGED
|
@@ -2,16 +2,16 @@ import * as path from "path"
|
|
|
2
2
|
import { Effect, Schema } from "effect"
|
|
3
3
|
import * as Tool from "./tool"
|
|
4
4
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
5
|
-
import { Watcher } from "@
|
|
5
|
+
import { Watcher } from "@anymous-ai/core/filesystem/watcher"
|
|
6
6
|
import { InstanceState } from "@/effect/instance-state"
|
|
7
7
|
import { Patch } from "../patch"
|
|
8
8
|
import { createTwoFilesPatch, diffLines } from "diff"
|
|
9
9
|
import { assertExternalDirectoryEffect } from "./external-directory"
|
|
10
10
|
import { trimDiff } from "./edit"
|
|
11
11
|
import { LSP } from "@/lsp/lsp"
|
|
12
|
-
import { FSUtil } from "@
|
|
12
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
13
13
|
import DESCRIPTION from "./apply_patch.txt"
|
|
14
|
-
import { FileSystem } from "@
|
|
14
|
+
import { FileSystem } from "@anymous-ai/core/filesystem"
|
|
15
15
|
import { Format } from "../format"
|
|
16
16
|
import * as Bom from "@/util/bom"
|
|
17
17
|
|
package/src/tool/code-mode.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Tool from "./tool"
|
|
2
2
|
import { CallToolResultSchema, type CallToolResult } from "@modelcontextprotocol/sdk/types.js"
|
|
3
3
|
import { Cause, Effect, Schema } from "effect"
|
|
4
|
-
import { CodeMode, Tool as SandboxTool, toolError } from "@
|
|
4
|
+
import { CodeMode, Tool as SandboxTool, toolError } from "@anymous-ai/codemode"
|
|
5
5
|
import { MCP } from "@/mcp"
|
|
6
6
|
import { McpCatalog } from "@/mcp/catalog"
|
|
7
7
|
import { Agent } from "@/agent/agent"
|
package/src/tool/edit.ts
CHANGED
|
@@ -9,14 +9,14 @@ import * as Tool from "./tool"
|
|
|
9
9
|
import { LSP } from "@/lsp/lsp"
|
|
10
10
|
import { createTwoFilesPatch, diffLines } from "diff"
|
|
11
11
|
import DESCRIPTION from "./edit.txt"
|
|
12
|
-
import { FileSystem } from "@
|
|
13
|
-
import { Watcher } from "@
|
|
12
|
+
import { FileSystem } from "@anymous-ai/core/filesystem"
|
|
13
|
+
import { Watcher } from "@anymous-ai/core/filesystem/watcher"
|
|
14
14
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
|
15
15
|
import { Format } from "../format"
|
|
16
16
|
import { InstanceState } from "@/effect/instance-state"
|
|
17
17
|
import { Snapshot } from "@/snapshot"
|
|
18
18
|
import { assertExternalDirectoryEffect } from "./external-directory"
|
|
19
|
-
import { FSUtil } from "@
|
|
19
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
20
20
|
import * as Bom from "@/util/bom"
|
|
21
21
|
|
|
22
22
|
function normalizeLineEndings(text: string): string {
|
|
@@ -3,7 +3,7 @@ import { Effect } from "effect"
|
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
4
|
import type * as Tool from "./tool"
|
|
5
5
|
import { containsPath } from "../project/instance-context"
|
|
6
|
-
import { FSUtil } from "@
|
|
6
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
7
7
|
|
|
8
8
|
type Kind = "file" | "directory"
|
|
9
9
|
|
package/src/tool/glob.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "path"
|
|
2
2
|
import { Effect, Schema } from "effect"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
|
-
import { FSUtil } from "@
|
|
5
|
-
import { Ripgrep } from "@
|
|
4
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
5
|
+
import { Ripgrep } from "@anymous-ai/core/ripgrep"
|
|
6
6
|
import { assertExternalDirectoryEffect } from "./external-directory"
|
|
7
7
|
import DESCRIPTION from "./glob.txt"
|
|
8
8
|
import * as Tool from "./tool"
|
package/src/tool/grep.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "path"
|
|
2
2
|
import { Effect, Schema } from "effect"
|
|
3
3
|
import { InstanceState } from "@/effect/instance-state"
|
|
4
|
-
import { FSUtil } from "@
|
|
5
|
-
import { Ripgrep } from "@
|
|
4
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
5
|
+
import { Ripgrep } from "@anymous-ai/core/ripgrep"
|
|
6
6
|
import { assertExternalDirectoryEffect } from "./external-directory"
|
|
7
7
|
import DESCRIPTION from "./grep.txt"
|
|
8
8
|
import * as Tool from "./tool"
|
package/src/tool/lsp.ts
CHANGED
|
@@ -6,7 +6,7 @@ import DESCRIPTION from "./lsp.txt"
|
|
|
6
6
|
import { InstanceState } from "@/effect/instance-state"
|
|
7
7
|
import { pathToFileURL } from "url"
|
|
8
8
|
import { assertExternalDirectoryEffect } from "./external-directory"
|
|
9
|
-
import { FSUtil } from "@
|
|
9
|
+
import { FSUtil } from "@anymous-ai/core/fs-util"
|
|
10
10
|
|
|
11
11
|
const operations = [
|
|
12
12
|
"goToDefinition",
|
package/src/tool/lsp.txt
CHANGED
|
@@ -19,6 +19,6 @@ All operations require:
|
|
|
19
19
|
workspaceSymbol also accepts:
|
|
20
20
|
- query: A query string to filter symbols by. Empty string requests all symbols.
|
|
21
21
|
|
|
22
|
-
For workspaceSymbol, filePath is not sent in the LSP workspace/symbol request. It is used by
|
|
22
|
+
For workspaceSymbol, filePath is not sent in the LSP workspace/symbol request. It is used by anymous to select and start the matching LSP server.
|
|
23
23
|
|
|
24
24
|
Note: LSP servers must be configured for the file type. If no server is available, an error will be returned.
|
package/src/tool/plan.ts
CHANGED