/** * Addressing a suggested command to the workspace scope it must run in. * * A kernel suggestion spells a route and its arguments; only this application * knows which registered routes accept `--scope`. In a user-scope workspace a * suggested command is appended `--scope user` exactly when its route takes * the flag, it does not already carry one, and the suggestion did not declare * itself `global` (a command that runs for the whole installation). */ import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as ServiceMap from "effect/Context"; import type * as CliCommand from "effect/cli/Command"; import type { SuggestedAction } from "@agentxm/registry-protocol/unstable/suggested-action"; import type { FailureSuggestedAction } from "@agentxm/workspace-kernel/operations"; import { type WorkspaceScope } from "@agentxm/extension-model/unstable/workspace-scope"; import { AppError } from "../../app-error/index.js"; declare const ScopedRoutes_base: ServiceMap.ServiceClass; }>; /** * The registered routes whose flags include `--scope`, each as its words after * `axm` joined by one space (`"skills list"`), read once from the command tree. */ export declare class ScopedRoutes extends ScopedRoutes_base { } export declare const scopedRoutesOf: (root: CliCommand.Command.Any) => ReadonlySet; export declare const ScopedRoutesLive: (root: CliCommand.Command.Any) => Layer.Layer; /** No route takes `--scope`: the answer where no command tree is in context. */ export declare const NO_SCOPED_ROUTES: ReadonlySet; export declare const commandForScope: (command: string, scope: WorkspaceScope, routes: ReadonlySet) => string; export declare const suggestionsForScope: (suggestions: ReadonlyArray, scope: WorkspaceScope, routes: ReadonlySet) => ReadonlyArray; export interface WorkspaceScoping { readonly scope: WorkspaceScope; readonly routes: ReadonlySet; } /** * The workspace a running command addresses its suggestions to: the scope it * ran in, and the routes the running command tree registers with `--scope`. * Without a workspace in context the scope is the project's; without a * command tree no route takes the flag. */ export declare const currentWorkspaceScoping: Effect.Effect; /** * Address suggestions to the current workspace. Without a workspace or a * command tree in context nothing is addressed, and the suggestions leave * only their public fields behind. */ export declare const suggestionsForCurrentWorkspace: (suggestions: ReadonlyArray) => Effect.Effect; /** * A command's failure as the workspace it ran in reports it: a workspace * failure projects into its envelope, and each suggested command addresses the * workspace's scope unless it runs for the whole installation. Any other * failure passes through unchanged. */ export declare const failureForWorkspaceScope: (error: E, scope: WorkspaceScope, routes: ReadonlySet) => E | AppError; export {}; //# sourceMappingURL=scoped-command.d.ts.map