argsbarg 6.1.2 → 6.1.3
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/CHANGELOG.md +65 -1
- package/README.md +17 -19
- package/bin/argsbarg +10 -0
- package/docs/README.md +4 -3
- package/docs/ai-skills.md +4 -2
- package/docs/bundled-docs.md +50 -25
- package/docs/cli-program.md +52 -10
- package/docs/config-schema.md +10 -11
- package/docs/configure.md +2 -0
- package/docs/decisions.md +40 -0
- package/docs/developing.md +43 -5
- package/docs/http-server.md +171 -0
- package/docs/json-schema-subset.md +51 -0
- package/docs/mcp.md +4 -2
- package/docs/output-schema.md +55 -62
- package/examples/formats.ts +6 -6
- package/examples/full-example/Formula/full-example.rb +35 -0
- package/examples/full-example/README.md +20 -21
- package/examples/full-example/docs/README.md +1 -1
- package/examples/full-example/docs/cli-schema.json +1790 -98
- package/examples/full-example/docs/cli.md +1990 -0
- package/examples/full-example/docs/http.md +28 -29
- package/examples/full-example/docs/mcp.md +8 -22
- package/examples/full-example/docs/openapi.json +783 -50
- package/examples/full-example/docs/skill.md +10 -10
- package/examples/full-example/justfile +11 -1
- package/examples/full-example/src/commands/render-json/__generated__/RenderJsonInputSchema.json +15 -0
- package/examples/full-example/src/commands/render-json/__generated__/index.ts +5 -0
- package/examples/full-example/src/commands/render-json/command.test.ts +46 -0
- package/examples/full-example/src/commands/render-json/command.ts +30 -0
- package/examples/full-example/src/commands/render-json/types.ts +9 -0
- package/examples/full-example/src/commands/status/__generated__/StatusJsonOutputSchema.json +15 -0
- package/examples/full-example/src/commands/status/__generated__/index.ts +2 -2
- package/examples/full-example/src/commands/status/command.ts +5 -13
- package/examples/full-example/src/commands/status/types.ts +1 -14
- package/examples/full-example/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +15 -0
- package/examples/full-example/src/commands/workspaces/__generated__/index.ts +5 -0
- package/examples/full-example/src/commands/workspaces/command.test.ts +58 -0
- package/examples/full-example/src/commands/workspaces/command.ts +94 -0
- package/examples/full-example/src/commands/workspaces/types.ts +6 -0
- package/examples/full-example/src/db/index.test.ts +86 -0
- package/examples/full-example/src/db/index.ts +101 -0
- package/examples/full-example/src/db/migrate.test.ts +35 -0
- package/examples/full-example/src/db/migrate.ts +69 -0
- package/examples/full-example/src/db/migrations/001_workspaces.sql +6 -0
- package/examples/full-example/src/db/tables/workspaces.ts +66 -0
- package/examples/full-example/src/program.ts +11 -36
- package/examples/full-example/src/types/argsbarg.d.ts +11 -0
- package/examples/full-example/src/types/md.d.ts +4 -0
- package/examples/full-example/tsconfig.json +5 -2
- package/examples/mcp-test.ts +1 -2
- package/examples/minimal.ts +1 -7
- package/examples/nested.ts +1 -2
- package/examples/option-required.ts +1 -1
- package/examples/servers.ts +4 -5
- package/index.d.ts +431 -136
- package/package.json +19 -2
- package/src/builtins/builtins.test.ts +7 -7
- package/src/builtins/completion-bash.ts +1 -1
- package/src/builtins/completion-fish.ts +1 -1
- package/src/builtins/completion-group.ts +4 -4
- package/src/builtins/completion-simulate-shared.ts +9 -0
- package/src/builtins/completion-zsh.ts +1 -1
- package/src/builtins/config.test.ts +3 -3
- package/src/builtins/config.ts +9 -9
- package/src/builtins/configure-copy.ts +2 -2
- package/src/builtins/configure.ts +4 -4
- package/src/builtins/dispatch.ts +19 -18
- package/src/builtins/export.ts +7 -5
- package/src/builtins/http.ts +68 -0
- package/src/builtins/mcp.ts +28 -4
- package/src/builtins/presentation.ts +6 -6
- package/src/builtins/registry.ts +6 -6
- package/src/builtins/scopes.ts +2 -2
- package/src/builtins/version.ts +1 -1
- package/src/cli-tool/full-example-capabilities.test.ts +10 -15
- package/src/cli-tool/main.ts +1 -1
- package/src/cli-tool/program.ts +3 -2
- package/src/cli-tool/prompt.ts +1 -1
- package/src/cli-tool/run-schemagen.ts +1 -3
- package/src/cli-tool/schemagen/cleanup.ts +6 -7
- package/src/cli-tool/schemagen/discover-schema-roots.ts +66 -120
- package/src/cli-tool/schemagen/index.ts +2 -2
- package/src/cli-tool/schemagen/names.ts +8 -13
- package/src/cli-tool/schemagen/run.ts +21 -28
- package/src/cli-tool/schemagen/schemagen.test.ts +136 -46
- package/src/config/bindings.test.ts +1 -1
- package/src/config/bindings.ts +1 -1
- package/src/config/bootstrap.test.ts +1 -1
- package/src/config/bootstrap.ts +36 -4
- package/src/config/context.test.ts +1 -1
- package/src/config/context.ts +1 -1
- package/src/config/entry.ts +1 -1
- package/src/config/file.test.ts +1 -1
- package/src/config/file.ts +3 -3
- package/src/config/manifest.ts +1 -1
- package/src/config/resolve.test.ts +1 -1
- package/src/config/resolve.ts +1 -1
- package/src/config/schema.ts +1 -1
- package/src/config/validate.ts +1 -1
- package/src/{install → configure/artifacts}/binary-placement.test.ts +1 -1
- package/src/{install → configure/artifacts}/binary-placement.ts +1 -1
- package/src/{install → configure/artifacts}/gh-release-update.ts +1 -1
- package/src/{install → configure/artifacts}/install-validate.test.ts +3 -3
- package/src/{install → configure/artifacts}/mcp-config.ts +1 -1
- package/src/{install → configure/artifacts}/mcp-opencode.test.ts +1 -1
- package/src/{install → configure/artifacts}/mcp-opencode.ts +1 -1
- package/src/{install → configure/artifacts}/paths.ts +5 -5
- package/src/configure/artifacts/plan.ts +24 -0
- package/src/{install → configure/artifacts}/status.test.ts +1 -1
- package/src/{install → configure/artifacts}/status.ts +2 -2
- package/src/{install → configure/artifacts}/target-base.ts +1 -1
- package/src/{install → configure/artifacts}/target-detect.ts +1 -1
- package/src/{install → configure/artifacts}/target-effective.ts +3 -9
- package/src/{install → configure/artifacts}/target-mcp-cli.ts +1 -1
- package/src/{install → configure/artifacts}/target-mcp-json.ts +1 -1
- package/src/{install → configure/artifacts}/target-plan-build.ts +2 -2
- package/src/{install → configure/artifacts}/target-registry.ts +2 -2
- package/src/{install → configure/artifacts}/target-scope.ts +3 -3
- package/src/{install → configure/artifacts}/target-skill.ts +1 -1
- package/src/{install → configure/artifacts}/target-types.ts +2 -2
- package/src/{install → configure/artifacts}/targets/app.ts +5 -5
- package/src/{install → configure/artifacts}/targets/chatgpt-mcp.ts +2 -2
- package/src/{install → configure/artifacts}/targets/claude-code-mcp.ts +2 -2
- package/src/{install → configure/artifacts}/targets/claude-desktop-mcp.ts +2 -2
- package/src/{install → configure/artifacts}/targets/claude-skill.ts +2 -2
- package/src/{install → configure/artifacts}/targets/codex-mcp.ts +2 -2
- package/src/{install → configure/artifacts}/targets/codex-skill.ts +2 -2
- package/src/{install → configure/artifacts}/targets/configure.ts +5 -5
- package/src/{install → configure/artifacts}/targets/cursor-mcp.ts +2 -2
- package/src/{install → configure/artifacts}/targets/cursor-skill.ts +2 -2
- package/src/{install → configure/artifacts}/targets/index.ts +1 -1
- package/src/{install → configure/artifacts}/targets/openclaw-mcp.ts +2 -2
- package/src/{install → configure/artifacts}/targets/openclaw-skill.ts +3 -3
- package/src/{install → configure/artifacts}/targets/opencode-mcp.ts +5 -5
- package/src/{install → configure/artifacts}/targets/opencode-skill.ts +3 -3
- package/src/{install → configure/artifacts}/targets.test.ts +1 -1
- package/src/{install → configure/artifacts}/uninstall.ts +1 -1
- package/src/configure/configure.test.ts +11 -11
- package/src/configure/index.ts +14 -14
- package/src/configure/prompt.ts +2 -2
- package/src/{context.ts → core/context.ts} +26 -20
- package/src/{json-leaf.test.ts → core/json-leaf.test.ts} +4 -4
- package/src/{leaf-inputs.test.ts → core/leaf-inputs.test.ts} +7 -7
- package/src/{leaf-inputs.ts → core/leaf-inputs.ts} +16 -12
- package/src/{parse.test.ts → core/parse.test.ts} +97 -109
- package/src/{parse.ts → core/parse.ts} +129 -31
- package/src/{schema.ts → core/schema.ts} +25 -13
- package/src/{types.ts → core/types.ts} +225 -35
- package/src/{validate.ts → core/validate.ts} +39 -29
- package/src/docs/builtin.ts +8 -19
- package/src/docs/{api-guide.test.ts → cli-guide.test.ts} +21 -21
- package/src/docs/{api-guide.ts → cli-guide.ts} +45 -16
- package/src/docs/docs.test.ts +76 -41
- package/src/docs/http-guide.ts +37 -34
- package/src/docs/mcp-guide.ts +12 -14
- package/src/docs/mcp-resources.test.ts +2 -3
- package/src/docs/mcp-resources.ts +6 -11
- package/src/docs/resolve.ts +22 -30
- package/src/docs/save.ts +3 -3
- package/src/exports/cli.ts +47 -0
- package/src/exports/headless.ts +13 -0
- package/src/exports/http.ts +6 -0
- package/src/exports/mcp.ts +6 -0
- package/src/{headless.test.ts → headless/routing.test.ts} +3 -3
- package/src/{headless.ts → headless/routing.ts} +3 -3
- package/src/headless/tool-call.ts +114 -46
- package/src/help.test.ts +152 -0
- package/src/help.ts +3 -3
- package/src/hooks/builtin.ts +20 -0
- package/src/hooks/run.ts +142 -0
- package/src/http/openapi.ts +182 -0
- package/src/http/readiness.ts +78 -0
- package/src/{api → http}/result.ts +16 -5
- package/src/http/routes.ts +329 -0
- package/src/http/server.ts +225 -0
- package/src/index.ts +36 -25
- package/src/log/ecs.test.ts +43 -0
- package/src/log/ecs.ts +59 -0
- package/src/log/emitter.ts +166 -0
- package/src/mcp/bundle.ts +2 -2
- package/src/mcp/claude.test.ts +1 -1
- package/src/mcp/claude.ts +4 -4
- package/src/{hidden-mcpb.test.ts → mcp/hidden-mcpb.test.ts} +10 -9
- package/src/mcp/result.ts +2 -2
- package/src/mcp/server.ts +54 -6
- package/src/mcp/tools.ts +9 -20
- package/src/{capabilities.ts → runtime/capabilities.ts} +11 -11
- package/src/{cli-errors.ts → runtime/cli-errors.ts} +4 -4
- package/src/{cli.ts → runtime/cli.ts} +159 -49
- package/src/runtime/exposure.ts +102 -0
- package/src/{invoke.test.ts → runtime/invoke.test.ts} +31 -7
- package/src/server/context.ts +25 -0
- package/src/server/overrides.ts +112 -0
- package/src/skill/generate.ts +8 -8
- package/src/skill/hint.ts +1 -1
- package/src/skill/install.ts +2 -2
- package/src/skill/naming.ts +1 -1
- package/src/{test-fixtures.ts → test/fixtures.ts} +3 -2
- package/src/{config.integration.test.ts → test/integration/config.test.ts} +8 -8
- package/src/{api.integration.test.ts → test/integration/http.test.ts} +170 -67
- package/src/{mcp.integration.test.ts → test/integration/mcp.test.ts} +11 -57
- package/docs/api-server.md +0 -141
- package/examples/full-example/docs/api.md +0 -511
- package/examples/full-example/src/commands/status/__generated__/outputSchema.json +0 -28
- package/examples/full-example/src/config/__generated__/configSchema.json +0 -40
- package/examples/full-example/src/config/__generated__/index.ts +0 -5
- package/examples/full-example/src/config/types.ts +0 -24
- package/src/api/openapi.ts +0 -117
- package/src/api/server.ts +0 -120
- package/src/builtins/api.ts +0 -38
- package/src/hidden.ts +0 -30
- package/src/install/plan.ts +0 -53
- /package/src/{install → configure/artifacts}/detect-installed.ts +0 -0
- /package/src/{install → configure/artifacts}/gh-release-update.test.ts +0 -0
- /package/src/{install → configure/artifacts}/mcp-codex.test.ts +0 -0
- /package/src/{install → configure/artifacts}/mcp-codex.ts +0 -0
- /package/src/{install → configure/artifacts}/mcp-openclaw.test.ts +0 -0
- /package/src/{install → configure/artifacts}/mcp-openclaw.ts +0 -0
- /package/src/{install → configure/artifacts}/normalize-uninstall.ts +0 -0
- /package/src/{install → configure/artifacts}/normalize.ts +0 -0
- /package/src/{install → configure/artifacts}/opts.ts +0 -0
- /package/src/{install → configure/artifacts}/shell.ts +0 -0
- /package/src/{formats.test.ts → core/formats.test.ts} +0 -0
- /package/src/{formats.ts → core/formats.ts} +0 -0
- /package/src/{respond.ts → core/respond.ts} +0 -0
- /package/src/{types.test.ts → core/types.test.ts} +0 -0
- /package/src/{api → http}/schema-deref.test.ts +0 -0
- /package/src/{api → http}/schema-deref.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
2
|
+
import { resolveCapabilities } from "~/runtime/capabilities.ts";
|
|
3
3
|
import type { InstallPaths } from "./paths.ts";
|
|
4
4
|
import { mcpCategoryEnabled } from "./target-effective.ts";
|
|
5
5
|
import { INSTALL_TARGETS, installTargetForKey } from "./target-registry.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { InstallTarget } from "./target-base.ts";
|
|
2
2
|
import type { SkillInstallTarget } from "./target-skill.ts";
|
|
3
3
|
import type { CliInstallArtifactKey, InstallActionKind } from "./target-types.ts";
|
|
4
|
-
import { INSTALL_TARGETS } from "./targets
|
|
4
|
+
import { INSTALL_TARGETS } from "./targets";
|
|
5
5
|
|
|
6
|
-
export { INSTALL_TARGETS } from "./targets
|
|
6
|
+
export { INSTALL_TARGETS } from "./targets";
|
|
7
7
|
|
|
8
8
|
export const INSTALL_ARTIFACT_KEYS: CliInstallArtifactKey[] = INSTALL_TARGETS.map((t) => t.key);
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { appConfigFileExists } from "~/config/file.ts";
|
|
2
|
+
import type { CliConfigureTargets, CliProgram } from "~/core/types.ts";
|
|
3
|
+
import { resolveCapabilities } from "~/runtime/capabilities.ts";
|
|
4
4
|
import type { InstallPaths } from "./paths.ts";
|
|
5
5
|
import {
|
|
6
6
|
type InstallPlanMode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import type { CliProgram } from "
|
|
2
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
3
3
|
import { displayInstallPath, type InstallPaths } from "./paths.ts";
|
|
4
4
|
import { InstallTarget } from "./target-base.ts";
|
|
5
5
|
import type {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CliProgram } from "
|
|
1
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
2
2
|
import type { InstallPaths } from "./paths.ts";
|
|
3
3
|
|
|
4
|
-
export type { InstallTargetSpec, ResolvedInstallTarget } from "
|
|
4
|
+
export type { InstallTargetSpec, ResolvedInstallTarget } from "~/core/types.ts";
|
|
5
5
|
|
|
6
6
|
export type InstallPlanMode = "install-all" | "install-scoped" | "uninstall-all" | "uninstall-scoped" | "refresh";
|
|
7
7
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { InstallTarget } from "../target-base.ts";
|
|
1
|
+
import { isExternallyManagedBinary } from "~/configure/artifacts/binary-placement.ts";
|
|
2
|
+
import type { InstallPaths } from "~/configure/artifacts/paths.ts";
|
|
3
|
+
import { InstallTarget } from "~/configure/artifacts/target-base.ts";
|
|
5
4
|
import type {
|
|
6
5
|
DetectedSnapshot,
|
|
7
6
|
InstallAction,
|
|
@@ -9,7 +8,8 @@ import type {
|
|
|
9
8
|
InstallStatus,
|
|
10
9
|
TargetPlanContext,
|
|
11
10
|
UninstallAction,
|
|
12
|
-
} from "
|
|
11
|
+
} from "~/configure/artifacts/target-types.ts";
|
|
12
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
13
13
|
|
|
14
14
|
/** Reports app install location (Homebrew PATH or legacy ~/.local/bin). No self-install actions. */
|
|
15
15
|
class AppInstallTarget extends InstallTarget {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { chatGptDesktopPresent, userHome } from "
|
|
2
|
-
import { McpJsonInstallTarget } from "
|
|
1
|
+
import { chatGptDesktopPresent, userHome } from "~/configure/artifacts/paths.ts";
|
|
2
|
+
import { McpJsonInstallTarget } from "~/configure/artifacts/target-mcp-json.ts";
|
|
3
3
|
|
|
4
4
|
export const chatgptMcpTarget = new McpJsonInstallTarget({
|
|
5
5
|
key: "chatgptMcp",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { userHome } from "
|
|
4
|
-
import { McpJsonInstallTarget } from "
|
|
3
|
+
import { userHome } from "~/configure/artifacts/paths.ts";
|
|
4
|
+
import { McpJsonInstallTarget } from "~/configure/artifacts/target-mcp-json.ts";
|
|
5
5
|
|
|
6
6
|
export const claudeCodeMcpTarget = new McpJsonInstallTarget({
|
|
7
7
|
key: "claudeCodeMcp",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { claudeDesktopPresent, userHome } from "
|
|
2
|
-
import { McpJsonInstallTarget } from "
|
|
1
|
+
import { claudeDesktopPresent, userHome } from "~/configure/artifacts/paths.ts";
|
|
2
|
+
import { McpJsonInstallTarget } from "~/configure/artifacts/target-mcp-json.ts";
|
|
3
3
|
|
|
4
4
|
export const claudeDesktopMcpTarget = new McpJsonInstallTarget({
|
|
5
5
|
key: "claudeDesktopMcp",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { userHome } from "
|
|
4
|
-
import { SkillInstallTarget } from "
|
|
3
|
+
import { userHome } from "~/configure/artifacts/paths.ts";
|
|
4
|
+
import { SkillInstallTarget } from "~/configure/artifacts/target-skill.ts";
|
|
5
5
|
|
|
6
6
|
export const claudeSkillTarget = new SkillInstallTarget({
|
|
7
7
|
key: "claudeSkill",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { codexOnPath } from "
|
|
1
|
+
import { codexOnPath } from "~/configure/artifacts/mcp-codex.ts";
|
|
2
2
|
import {
|
|
3
3
|
checkCodexMcpConflict,
|
|
4
4
|
codexMcpHasServer,
|
|
5
5
|
McpCliInstallTarget,
|
|
6
6
|
mergeCodexMcpConfig,
|
|
7
7
|
removeCodexMcpConfig,
|
|
8
|
-
} from "
|
|
8
|
+
} from "~/configure/artifacts/target-mcp-cli.ts";
|
|
9
9
|
|
|
10
10
|
export const codexMcpTarget = new McpCliInstallTarget({
|
|
11
11
|
key: "codexMcp",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { codexOnPath } from "
|
|
2
|
-
import { SkillInstallTarget } from "
|
|
1
|
+
import { codexOnPath } from "~/configure/artifacts/mcp-codex.ts";
|
|
2
|
+
import { SkillInstallTarget } from "~/configure/artifacts/target-skill.ts";
|
|
3
3
|
|
|
4
4
|
export const codexSkillTarget = new SkillInstallTarget({
|
|
5
5
|
key: "codexSkill",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { appConfigInstalled, displayAppConfigPath, uninstallAppConfig } from "
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import { InstallTarget } from "../target-base.ts";
|
|
1
|
+
import { appConfigInstalled, displayAppConfigPath, uninstallAppConfig } from "~/config/file.ts";
|
|
2
|
+
import type { InstallPaths } from "~/configure/artifacts/paths.ts";
|
|
3
|
+
import { InstallTarget } from "~/configure/artifacts/target-base.ts";
|
|
5
4
|
import type {
|
|
6
5
|
DetectedSnapshot,
|
|
7
6
|
InstallAction,
|
|
@@ -9,7 +8,8 @@ import type {
|
|
|
9
8
|
InstallStatus,
|
|
10
9
|
TargetPlanContext,
|
|
11
10
|
UninstallAction,
|
|
12
|
-
} from "
|
|
11
|
+
} from "~/configure/artifacts/target-types.ts";
|
|
12
|
+
import type { CliProgram, InstallAgentIntegration } from "~/core/types.ts";
|
|
13
13
|
|
|
14
14
|
/** App config file (interactive configure / wizard). */
|
|
15
15
|
class ConfigureInstallTarget extends InstallTarget {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { userHome } from "
|
|
4
|
-
import { McpJsonInstallTarget } from "
|
|
3
|
+
import { userHome } from "~/configure/artifacts/paths.ts";
|
|
4
|
+
import { McpJsonInstallTarget } from "~/configure/artifacts/target-mcp-json.ts";
|
|
5
5
|
|
|
6
6
|
export const cursorMcpTarget = new McpJsonInstallTarget({
|
|
7
7
|
key: "cursorMcp",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { userHome } from "
|
|
4
|
-
import { SkillInstallTarget } from "
|
|
3
|
+
import { userHome } from "~/configure/artifacts/paths.ts";
|
|
4
|
+
import { SkillInstallTarget } from "~/configure/artifacts/target-skill.ts";
|
|
5
5
|
|
|
6
6
|
export const cursorSkillTarget = new SkillInstallTarget({
|
|
7
7
|
key: "cursorSkill",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InstallTarget } from "
|
|
1
|
+
import type { InstallTarget } from "~/configure/artifacts/target-base.ts";
|
|
2
2
|
import { appTarget } from "./app.ts";
|
|
3
3
|
import { chatgptMcpTarget } from "./chatgpt-mcp.ts";
|
|
4
4
|
import { claudeCodeMcpTarget } from "./claude-code-mcp.ts";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { openclawOnPath } from "
|
|
1
|
+
import { openclawOnPath } from "~/configure/artifacts/mcp-openclaw.ts";
|
|
2
2
|
import {
|
|
3
3
|
checkOpenclawMcpConflict,
|
|
4
4
|
McpCliInstallTarget,
|
|
5
5
|
mergeOpenclawMcpConfig,
|
|
6
6
|
openclawMcpHasServer,
|
|
7
7
|
removeOpenclawMcpConfig,
|
|
8
|
-
} from "
|
|
8
|
+
} from "~/configure/artifacts/target-mcp-cli.ts";
|
|
9
9
|
|
|
10
10
|
export const openclawMcpTarget = new McpCliInstallTarget({
|
|
11
11
|
key: "openclawMcp",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { openclawOnPath } from "
|
|
4
|
-
import { userHome } from "
|
|
5
|
-
import { SkillInstallTarget } from "
|
|
3
|
+
import { openclawOnPath } from "~/configure/artifacts/mcp-openclaw.ts";
|
|
4
|
+
import { userHome } from "~/configure/artifacts/paths.ts";
|
|
5
|
+
import { SkillInstallTarget } from "~/configure/artifacts/target-skill.ts";
|
|
6
6
|
|
|
7
7
|
export const openclawSkillTarget = new SkillInstallTarget({
|
|
8
8
|
key: "openclawSkill",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CliProgram } from "../../types.ts";
|
|
2
1
|
import {
|
|
3
2
|
checkOpenCodeMcpConflict,
|
|
4
3
|
detectOpenCodeMcpConfigPath,
|
|
@@ -6,9 +5,9 @@ import {
|
|
|
6
5
|
mergeOpenCodeMcpConfig,
|
|
7
6
|
opencodePresent,
|
|
8
7
|
removeOpenCodeMcpConfig,
|
|
9
|
-
} from "
|
|
10
|
-
import { displayInstallPath, type InstallPaths, userHome } from "
|
|
11
|
-
import { InstallTarget } from "
|
|
8
|
+
} from "~/configure/artifacts/mcp-opencode.ts";
|
|
9
|
+
import { displayInstallPath, type InstallPaths, userHome } from "~/configure/artifacts/paths.ts";
|
|
10
|
+
import { InstallTarget } from "~/configure/artifacts/target-base.ts";
|
|
12
11
|
import type {
|
|
13
12
|
DetectedSnapshot,
|
|
14
13
|
InstallAction,
|
|
@@ -16,7 +15,8 @@ import type {
|
|
|
16
15
|
InstallStatus,
|
|
17
16
|
TargetPlanContext,
|
|
18
17
|
UninstallAction,
|
|
19
|
-
} from "
|
|
18
|
+
} from "~/configure/artifacts/target-types.ts";
|
|
19
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
20
20
|
|
|
21
21
|
function resolveConfigPath(paths: InstallPaths, home: string): string {
|
|
22
22
|
return detectOpenCodeMcpConfigPath(home, paths.mcpName) ?? paths.opencodeMcpPath;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { opencodePresent } from "
|
|
2
|
-
import { userHome } from "
|
|
3
|
-
import { SkillInstallTarget } from "
|
|
1
|
+
import { opencodePresent } from "~/configure/artifacts/mcp-opencode.ts";
|
|
2
|
+
import { userHome } from "~/configure/artifacts/paths.ts";
|
|
3
|
+
import { SkillInstallTarget } from "~/configure/artifacts/target-skill.ts";
|
|
4
4
|
|
|
5
5
|
export const opencodeSkillTarget = new SkillInstallTarget({
|
|
6
6
|
key: "opencodeSkill",
|
|
@@ -3,7 +3,7 @@ Tests for install/targets module behavior.
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, expect, test } from "bun:test";
|
|
6
|
-
import type { CliProgram } from "
|
|
6
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
7
7
|
import { normalizeInstallRawOpts } from "./normalize.ts";
|
|
8
8
|
import { normalizeUninstallRawOpts } from "./normalize-uninstall.ts";
|
|
9
9
|
import { resolveAgentIntegration, resolveEffectiveInstallTargets } from "./target-effective.ts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, rmSync } from "node:fs";
|
|
2
|
-
import type { CliProgram } from "
|
|
2
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
3
3
|
import type { InstallPaths } from "./paths.ts";
|
|
4
4
|
import { buildUninstallPlanFromTargets } from "./target-plan-build.ts";
|
|
5
5
|
import { skillTargetForUninstallSummary } from "./target-registry.ts";
|
|
@@ -6,22 +6,22 @@ import { afterEach, beforeEach, describe, expect, test } from "bun:test";
|
|
|
6
6
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { join } from "node:path";
|
|
9
|
-
import { appConfigFileExists } from "
|
|
9
|
+
import { appConfigFileExists } from "~/config/file.ts";
|
|
10
10
|
import {
|
|
11
11
|
appConfigHasEntries,
|
|
12
12
|
formatConfigureMutationSummary,
|
|
13
13
|
parseConfigureOpts,
|
|
14
14
|
validateConfigureOpts,
|
|
15
|
-
} from "
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
15
|
+
} from "~/configure";
|
|
16
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
17
|
+
import { Cli } from "~/index";
|
|
18
|
+
import { detectInstalledArtifacts } from "./artifacts/detect-installed.ts";
|
|
19
|
+
import { parseInstallOpts } from "./artifacts/opts.ts";
|
|
20
|
+
import { resolveClaudeDesktopMcpPath, resolveInstallPaths } from "./artifacts/paths.ts";
|
|
21
|
+
import { buildInstallPlan, buildUpdatePlan } from "./artifacts/plan.ts";
|
|
22
|
+
import { installTargetForKey } from "./artifacts/target-registry.ts";
|
|
23
|
+
import { buildDetectedSnapshot, buildTargetPlanContext } from "./artifacts/target-scope.ts";
|
|
24
|
+
import { buildUninstallPlan } from "./artifacts/uninstall.ts";
|
|
25
25
|
|
|
26
26
|
const fixture: CliProgram = {
|
|
27
27
|
key: "testapp",
|
package/src/configure/index.ts
CHANGED
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
Interactive and automated `configure` command orchestration (agent artifacts and app config).
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { displayAppConfigPath, runConfigure } from "~/config/bootstrap.ts";
|
|
6
|
+
import { ensureAppConfigFile } from "~/config/file.ts";
|
|
7
|
+
import type { CliProgram } from "~/core/types.ts";
|
|
8
|
+
import { resolveCapabilities } from "~/runtime/capabilities.ts";
|
|
9
|
+
import { cliSkillInstall, skillTargetFromActionKind } from "~/skill/install.ts";
|
|
10
|
+
import { resolveInstallPaths } from "./artifacts/paths.ts";
|
|
11
|
+
import { buildInstallPlan, buildUpdatePlan } from "./artifacts/plan.ts";
|
|
10
12
|
import {
|
|
11
13
|
installErr,
|
|
12
14
|
installInfo,
|
|
13
15
|
installOut,
|
|
14
16
|
printInstallStatus,
|
|
15
17
|
writeInteractiveInstallIntro,
|
|
16
|
-
} from "
|
|
17
|
-
import { resolveEffectiveInstallTargets } from "
|
|
18
|
-
import { runTargetPreflight } from "
|
|
19
|
-
import { INSTALL_TARGETS, installTargetForKey } from "
|
|
20
|
-
import { buildDetectedSnapshot, buildTargetPlanContext } from "
|
|
18
|
+
} from "./artifacts/status.ts";
|
|
19
|
+
import { resolveEffectiveInstallTargets } from "./artifacts/target-effective.ts";
|
|
20
|
+
import { runTargetPreflight } from "./artifacts/target-plan-build.ts";
|
|
21
|
+
import { INSTALL_TARGETS, installTargetForKey } from "./artifacts/target-registry.ts";
|
|
22
|
+
import { buildDetectedSnapshot, buildTargetPlanContext } from "./artifacts/target-scope.ts";
|
|
21
23
|
import type {
|
|
22
24
|
CliInstallArtifactKey,
|
|
23
25
|
InstallAction,
|
|
@@ -25,10 +27,8 @@ import type {
|
|
|
25
27
|
InstallOpts,
|
|
26
28
|
TargetPlanContext,
|
|
27
29
|
UninstallAction,
|
|
28
|
-
} from "
|
|
29
|
-
import { buildUninstallPlan, skillDirFromUninstallSummary, uninstallSkillDir } from "
|
|
30
|
-
import { cliSkillInstall, skillTargetFromActionKind } from "../skill/install.ts";
|
|
31
|
-
import type { CliProgram } from "../types.ts";
|
|
30
|
+
} from "./artifacts/target-types.ts";
|
|
31
|
+
import { buildUninstallPlan, skillDirFromUninstallSummary, uninstallSkillDir } from "./artifacts/uninstall.ts";
|
|
32
32
|
import { artifactPromptLabel, promptTargetAction } from "./prompt.ts";
|
|
33
33
|
|
|
34
34
|
/** True when interactive `configure` should auto-run the app config wizard. */
|
package/src/configure/prompt.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
TTY prompts for per-target install, skip, or uninstall during interactive `configure`.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import { readPromptLine } from "~/prompt.ts";
|
|
6
|
+
import type { CliInstallArtifactKey } from "./artifacts/target-types.ts";
|
|
7
7
|
|
|
8
8
|
/** Human-readable labels for each install artifact key in interactive prompts. */
|
|
9
9
|
const LABELS: Record<CliInstallArtifactKey, string> = {
|
|
@@ -7,14 +7,22 @@ It keeps handlers small with a typed read API for flags, strings, numbers, and c
|
|
|
7
7
|
parsed values.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { AnyAppConfigSnapshot } from "
|
|
11
|
-
import { EmptyAppConfigSnapshot } from "
|
|
10
|
+
import type { AnyAppConfigSnapshot } from "~/config/context.ts";
|
|
11
|
+
import { EmptyAppConfigSnapshot } from "~/config/context.ts";
|
|
12
|
+
import { strictParseDouble } from "~/utils.ts";
|
|
12
13
|
import { parseCommaList, parseDate, parseDateTime, parseDurationMs } from "./formats.ts";
|
|
13
14
|
import { loadLeafInputs, readJsonOptionValue } from "./leaf-inputs.ts";
|
|
14
15
|
import { normalizeRespondOptions, writeRespondBodyToStdout } from "./respond.ts";
|
|
15
|
-
import type {
|
|
16
|
+
import type {
|
|
17
|
+
CliInvocation,
|
|
18
|
+
CliLeaf,
|
|
19
|
+
CliLocals,
|
|
20
|
+
CliNode,
|
|
21
|
+
CliProgram,
|
|
22
|
+
CliRespondOptions,
|
|
23
|
+
ServerRuntime,
|
|
24
|
+
} from "./types.ts";
|
|
16
25
|
import { isCliLeaf, isCliRouter } from "./types.ts";
|
|
17
|
-
import { strictParseDouble } from "./utils.ts";
|
|
18
26
|
|
|
19
27
|
/** Coerced leaf inputs keyed by option and positional names. */
|
|
20
28
|
export type CliLeafInputs = Record<string, boolean | number | string | string[] | unknown | undefined>;
|
|
@@ -25,15 +33,21 @@ export type CliLeafInputs = Record<string, boolean | number | string | string[]
|
|
|
25
33
|
export class CliContext {
|
|
26
34
|
readonly appName: string;
|
|
27
35
|
readonly commandPath: string[];
|
|
28
|
-
|
|
36
|
+
args: string[];
|
|
29
37
|
readonly program: CliProgram;
|
|
30
|
-
|
|
38
|
+
opts: Record<string, string>;
|
|
31
39
|
readonly invocation: CliInvocation;
|
|
32
40
|
readonly appConfig: AnyAppConfigSnapshot;
|
|
33
41
|
/** Original flat tool arguments for API/MCP invocations (when provided). */
|
|
34
42
|
readonly toolArgs?: Record<string, unknown>;
|
|
43
|
+
/** Path parameter values from `:param` router descent. */
|
|
44
|
+
readonly pathParams: Record<string, string>;
|
|
35
45
|
/** Pipable Json option values read from stdin before the handler (CLI only). */
|
|
36
46
|
readonly preloadedJson: Record<string, unknown>;
|
|
47
|
+
/** Per-invocation bag; `beforeInvoke` may write. */
|
|
48
|
+
readonly locals: CliLocals;
|
|
49
|
+
/** Shared server state for HTTP/MCP invocations. */
|
|
50
|
+
runtime?: ServerRuntime;
|
|
37
51
|
|
|
38
52
|
private response?: CliRespondOptions;
|
|
39
53
|
private leafInputsCache?: CliLeafInputs;
|
|
@@ -49,6 +63,9 @@ export class CliContext {
|
|
|
49
63
|
appConfig: AnyAppConfigSnapshot = new EmptyAppConfigSnapshot(program),
|
|
50
64
|
toolArgs?: Record<string, unknown>,
|
|
51
65
|
preloadedJson: Record<string, unknown> = {},
|
|
66
|
+
pathParams: Record<string, string> = {},
|
|
67
|
+
locals: CliLocals = {} as CliLocals,
|
|
68
|
+
runtime?: ServerRuntime,
|
|
52
69
|
) {
|
|
53
70
|
this.appName = appName;
|
|
54
71
|
this.commandPath = commandPath;
|
|
@@ -59,6 +76,9 @@ export class CliContext {
|
|
|
59
76
|
this.appConfig = appConfig;
|
|
60
77
|
this.toolArgs = toolArgs;
|
|
61
78
|
this.preloadedJson = preloadedJson;
|
|
79
|
+
this.pathParams = pathParams;
|
|
80
|
+
this.locals = locals;
|
|
81
|
+
this.runtime = runtime;
|
|
62
82
|
}
|
|
63
83
|
|
|
64
84
|
/**
|
|
@@ -173,20 +193,6 @@ export class CliContext {
|
|
|
173
193
|
return this.inputs as T;
|
|
174
194
|
}
|
|
175
195
|
|
|
176
|
-
/**
|
|
177
|
-
* @deprecated Use {@link inputs} or {@link inputsAs}.
|
|
178
|
-
*/
|
|
179
|
-
readLeafInputs(): CliLeafInputs {
|
|
180
|
-
return this.inputs;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* @deprecated Use sync {@link readLeafInputs} — stdin is preloaded before the handler runs.
|
|
185
|
-
*/
|
|
186
|
-
readLeafInputsAsync(): Promise<CliLeafInputs> {
|
|
187
|
-
return Promise.resolve(this.readLeafInputs());
|
|
188
|
-
}
|
|
189
|
-
|
|
190
196
|
private _leafNode(): CliLeaf | undefined {
|
|
191
197
|
let node: CliNode = this.program;
|
|
192
198
|
for (const seg of this.commandPath) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { Cli } from "
|
|
2
|
+
import { Cli } from "~/index";
|
|
3
3
|
import { ParseKind, parse } from "./parse.ts";
|
|
4
4
|
import { CliOptionKind, type CliProgram, CliSchemaValidationError } from "./types.ts";
|
|
5
5
|
import { cliValidateProgram } from "./validate.ts";
|
|
@@ -101,7 +101,7 @@ describe("kind: json leaf", () => {
|
|
|
101
101
|
test("invoke reads body from toolArgs", async () => {
|
|
102
102
|
const cli = new Cli(jsonLeafProgram());
|
|
103
103
|
const result = await cli.invoke(["render"], {
|
|
104
|
-
invocation: "
|
|
104
|
+
invocation: "http",
|
|
105
105
|
toolArgs: { format: "pdf", invoice: { id: "INV-1" } },
|
|
106
106
|
});
|
|
107
107
|
expect(result.kind).toBe("ok");
|
|
@@ -119,7 +119,7 @@ describe("kind: json leaf", () => {
|
|
|
119
119
|
|
|
120
120
|
test("invoke errors when body missing", async () => {
|
|
121
121
|
const cli = new Cli(jsonLeafProgram());
|
|
122
|
-
const result = await cli.invoke(["render"], { invocation: "
|
|
122
|
+
const result = await cli.invoke(["render"], { invocation: "http" });
|
|
123
123
|
expect(result.kind).toBe("error");
|
|
124
124
|
expect(result.errorMsg).toContain("Missing JSON input");
|
|
125
125
|
});
|
|
@@ -140,7 +140,7 @@ describe("kind: json leaf", () => {
|
|
|
140
140
|
} satisfies CliProgram;
|
|
141
141
|
const cli = new Cli(program);
|
|
142
142
|
const result = await cli.invoke(["render"], {
|
|
143
|
-
invocation: "
|
|
143
|
+
invocation: "http",
|
|
144
144
|
toolArgs: { format: "pdf", invoice: { id: 123 } },
|
|
145
145
|
});
|
|
146
146
|
expect(result.kind).toBe("error");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { Cli, CliContext, CliOptionKind } from "
|
|
3
|
-
import { LeafInputError,
|
|
2
|
+
import { Cli, CliContext, CliOptionKind } from "~/index";
|
|
3
|
+
import { LeafInputError, loadLeafInputs } from "./leaf-inputs.ts";
|
|
4
4
|
import type { CliProgram } from "./types.ts";
|
|
5
5
|
|
|
6
6
|
const invoiceSchema = {
|
|
@@ -46,13 +46,13 @@ function renderProgram(): CliProgram {
|
|
|
46
46
|
required: true,
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
|
-
handler: (ctx) => ctx.
|
|
49
|
+
handler: (ctx) => ctx.inputs,
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
} satisfies CliProgram;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
describe("
|
|
55
|
+
describe("loadLeafInputs / jsonOpt", () => {
|
|
56
56
|
test("reads Json option from MCP toolArgs", async () => {
|
|
57
57
|
const cli = new Cli(renderProgram());
|
|
58
58
|
const result = await cli.invoke(["render", "--format", "pdf"], {
|
|
@@ -212,10 +212,10 @@ describe("readLeafInputs / jsonOpt", () => {
|
|
|
212
212
|
expect(inputs[0]).toEqual(inputs[1]);
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
-
test("
|
|
215
|
+
test("loadLeafInputs throws LeafInputError when required Json is missing", () => {
|
|
216
216
|
const program = renderProgram();
|
|
217
217
|
const ctx = new CliContext("json-pipe-test", ["render"], [], { format: "pdf" }, program, "mcp", undefined, {});
|
|
218
|
-
expect(() =>
|
|
218
|
+
expect(() => loadLeafInputs(ctx)).toThrow(LeafInputError);
|
|
219
219
|
});
|
|
220
220
|
|
|
221
221
|
test("omits undefined optional properties before inputSchema validation", async () => {
|
|
@@ -264,7 +264,7 @@ describe("readLeafInputs / jsonOpt", () => {
|
|
|
264
264
|
required: true,
|
|
265
265
|
},
|
|
266
266
|
],
|
|
267
|
-
handler: (ctx) => ctx.
|
|
267
|
+
handler: (ctx) => ctx.inputs,
|
|
268
268
|
},
|
|
269
269
|
],
|
|
270
270
|
} satisfies CliProgram;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Leaf input reads: Json options (flag, preloaded stdin, or toolArgs), optional inputSchema validation.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { validateConfigDocument } from "
|
|
5
|
+
import { validateConfigDocument } from "~/config/validate.ts";
|
|
6
|
+
import { isInteractiveTty } from "~/utils.ts";
|
|
6
7
|
import type { CliContext, CliLeafInputs } from "./context.ts";
|
|
7
8
|
import { collectOptionDefs } from "./parse.ts";
|
|
8
9
|
import type { CliInvocation, CliLeaf, CliNode, CliOption, CliProgram } from "./types.ts";
|
|
9
10
|
import { CliOptionKind, CliValueFormat, isCliLeaf, isCliRouter, isJsonLeaf } from "./types.ts";
|
|
10
|
-
import { isInteractiveTty } from "./utils.ts";
|
|
11
11
|
|
|
12
12
|
/** Thrown when leaf input resolution or validation fails. */
|
|
13
13
|
export class LeafInputError extends Error {
|
|
@@ -224,6 +224,20 @@ export function loadLeafInputs(ctx: CliContext): CliLeafInputs {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
for (const [name, value] of Object.entries(ctx.pathParams)) {
|
|
228
|
+
if (out[name] === undefined) {
|
|
229
|
+
out[name] = value;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (ctx.toolArgs !== undefined) {
|
|
234
|
+
for (const [key, value] of Object.entries(ctx.toolArgs)) {
|
|
235
|
+
if (out[key] === undefined) {
|
|
236
|
+
out[key] = value;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
227
241
|
for (const opt of options) {
|
|
228
242
|
if (opt.required && out[opt.name] === undefined) {
|
|
229
243
|
if (opt.kind === CliOptionKind.Json && opt.pipable && ctx.invocation === "cli" && isInteractiveTty) {
|
|
@@ -239,13 +253,3 @@ export function loadLeafInputs(ctx: CliContext): CliLeafInputs {
|
|
|
239
253
|
|
|
240
254
|
return omitUndefinedInputs(out);
|
|
241
255
|
}
|
|
242
|
-
|
|
243
|
-
/** @deprecated Use {@link CliContext.inputs} or {@link loadLeafInputs} via `ctx.inputs`. */
|
|
244
|
-
export function readLeafInputs(ctx: CliContext): CliLeafInputs {
|
|
245
|
-
return ctx.inputs;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/** @deprecated Use sync {@link readLeafInputs} — stdin is preloaded before the handler runs. */
|
|
249
|
-
export function readLeafInputsAsync(ctx: CliContext): Promise<CliLeafInputs> {
|
|
250
|
-
return Promise.resolve(readLeafInputs(ctx));
|
|
251
|
-
}
|