argsbarg 6.1.6 → 6.1.7
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 +8 -1
- package/package.json +1 -1
- package/src/builtins/builtins.test.ts +4 -4
- package/src/builtins/completion-bash.ts +1 -1
- package/src/builtins/completion-fish.ts +1 -1
- package/src/builtins/completion-group.ts +3 -3
- 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 +3 -3
- package/src/builtins/dispatch.ts +10 -10
- package/src/builtins/export.ts +4 -4
- package/src/builtins/http.ts +5 -5
- package/src/builtins/mcp.ts +3 -3
- package/src/builtins/presentation.ts +5 -5
- package/src/builtins/registry.ts +3 -3
- package/src/builtins/scopes.ts +2 -2
- package/src/builtins/version.ts +1 -1
- package/src/cli-tool/full-example-capabilities.test.ts +2 -2
- package/src/cli-tool/main.ts +1 -1
- package/src/cli-tool/program.ts +1 -1
- package/src/cli-tool/prompt.ts +1 -1
- 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 +3 -3
- 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/configure/artifacts/binary-placement.test.ts +1 -1
- package/src/configure/artifacts/binary-placement.ts +1 -1
- package/src/configure/artifacts/gh-release-update.ts +1 -1
- package/src/configure/artifacts/install-validate.test.ts +3 -3
- package/src/configure/artifacts/mcp-config.ts +1 -1
- package/src/configure/artifacts/mcp-opencode.test.ts +1 -1
- package/src/configure/artifacts/mcp-opencode.ts +1 -1
- package/src/configure/artifacts/paths.ts +5 -5
- package/src/configure/artifacts/plan.ts +1 -1
- package/src/configure/artifacts/status.test.ts +1 -1
- package/src/configure/artifacts/status.ts +2 -2
- package/src/configure/artifacts/target-base.ts +1 -1
- package/src/configure/artifacts/target-detect.ts +1 -1
- package/src/configure/artifacts/target-effective.ts +3 -3
- package/src/configure/artifacts/target-mcp-cli.ts +1 -1
- package/src/configure/artifacts/target-mcp-json.ts +1 -1
- package/src/configure/artifacts/target-plan-build.ts +2 -2
- package/src/configure/artifacts/target-scope.ts +3 -3
- package/src/configure/artifacts/target-skill.ts +1 -1
- package/src/configure/artifacts/target-types.ts +2 -2
- package/src/configure/artifacts/targets/app.ts +5 -5
- package/src/configure/artifacts/targets/chatgpt-mcp.ts +2 -2
- package/src/configure/artifacts/targets/claude-code-mcp.ts +2 -2
- package/src/configure/artifacts/targets/claude-desktop-mcp.ts +2 -2
- package/src/configure/artifacts/targets/claude-skill.ts +2 -2
- package/src/configure/artifacts/targets/codex-mcp.ts +2 -2
- package/src/configure/artifacts/targets/codex-skill.ts +2 -2
- package/src/configure/artifacts/targets/configure.ts +5 -5
- package/src/configure/artifacts/targets/cursor-mcp.ts +2 -2
- package/src/configure/artifacts/targets/cursor-skill.ts +2 -2
- package/src/configure/artifacts/targets/index.ts +1 -1
- package/src/configure/artifacts/targets/openclaw-mcp.ts +2 -2
- package/src/configure/artifacts/targets/openclaw-skill.ts +3 -3
- package/src/configure/artifacts/targets/opencode-mcp.ts +5 -5
- package/src/configure/artifacts/targets/opencode-skill.ts +3 -3
- package/src/configure/artifacts/targets.test.ts +1 -1
- package/src/configure/artifacts/uninstall.ts +1 -1
- package/src/configure/configure.test.ts +9 -9
- package/src/configure/index.ts +5 -5
- package/src/configure/prompt.ts +1 -1
- package/src/core/context.ts +3 -3
- package/src/core/json-leaf.test.ts +1 -1
- package/src/core/leaf-inputs.test.ts +1 -1
- package/src/core/leaf-inputs.ts +2 -2
- package/src/core/parse.test.ts +9 -9
- package/src/core/parse.ts +2 -2
- package/src/core/schema.ts +3 -3
- package/src/core/types.ts +1 -1
- package/src/core/validate.ts +6 -6
- package/src/docs/builtin.ts +3 -3
- package/src/docs/cli-guide.test.ts +3 -3
- package/src/docs/cli-guide.ts +5 -5
- package/src/docs/docs.test.ts +8 -8
- package/src/docs/http-guide.ts +7 -7
- package/src/docs/mcp-guide.ts +7 -7
- package/src/docs/mcp-resources.test.ts +1 -1
- package/src/docs/mcp-resources.ts +1 -1
- package/src/docs/resolve.ts +4 -4
- package/src/docs/save.ts +2 -2
- package/src/exports/cli.ts +9 -9
- package/src/exports/headless.ts +2 -2
- package/src/exports/http.ts +2 -2
- package/src/exports/mcp.ts +2 -2
- package/src/headless/routing.ts +2 -2
- package/src/headless/tool-call.ts +11 -11
- package/src/hooks/run.ts +6 -6
- package/src/http/openapi.ts +3 -3
- package/src/http/paths.ts +1 -1
- package/src/http/readiness.ts +3 -3
- package/src/http/result.ts +1 -1
- package/src/http/routes.ts +4 -4
- package/src/http/server.ts +6 -6
- package/src/log/emitter.ts +1 -1
- package/src/mcp/bundle.ts +2 -2
- package/src/mcp/claude.test.ts +1 -1
- package/src/mcp/claude.ts +4 -4
- package/src/mcp/hidden-mcpb.test.ts +5 -5
- package/src/mcp/result.ts +2 -2
- package/src/mcp/server.ts +3 -3
- package/src/mcp/tools.ts +7 -7
- package/src/runtime/capabilities.ts +2 -2
- package/src/runtime/cli-errors.ts +3 -3
- package/src/runtime/cli.ts +22 -22
- package/src/runtime/exposure.ts +2 -2
- package/src/runtime/invoke.test.ts +6 -6
- package/src/server/context.ts +3 -3
- package/src/server/overrides.ts +3 -3
- package/src/skill/generate.ts +5 -5
- 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 +2 -2
- package/src/test/integration/config.test.ts +3 -3
- package/src/test/integration/http.test.ts +10 -10
- package/src/test/integration/mcp.test.ts +6 -6
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
CliProgram,
|
|
5
5
|
InstallAgentIntegration,
|
|
6
6
|
InstallTargetSpec,
|
|
7
|
-
} from "
|
|
8
|
-
import { resolveCapabilities } from "
|
|
7
|
+
} from "../../core/types.ts";
|
|
8
|
+
import { resolveCapabilities } from "../../runtime/capabilities.ts";
|
|
9
9
|
import {
|
|
10
10
|
AGENT_PAIRS,
|
|
11
11
|
INSTALL_ARTIFACT_KEYS,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./target-registry.ts";
|
|
15
15
|
import type { CliInstallArtifactKey, InstallPlanMode } from "./target-types.ts";
|
|
16
16
|
|
|
17
|
-
export type { InstallTargetSpec, ResolvedInstallTarget } from "
|
|
17
|
+
export type { InstallTargetSpec, ResolvedInstallTarget } from "../../core/types.ts";
|
|
18
18
|
|
|
19
19
|
export type { InstallPlanMode, InstallScope } from "./target-types.ts";
|
|
20
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CliProgram } from "
|
|
1
|
+
import type { CliProgram } from "../../core/types.ts";
|
|
2
2
|
import { checkCodexMcpConflict, codexMcpHasServer, mergeCodexMcpConfig, removeCodexMcpConfig } from "./mcp-codex.ts";
|
|
3
3
|
import { expectedMcpEntry } from "./mcp-config.ts";
|
|
4
4
|
import {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CliProgram } from "
|
|
2
|
-
import { resolveCapabilities } from "
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { appConfigFileExists } from "
|
|
2
|
-
import type { CliConfigureTargets, CliProgram } from "
|
|
3
|
-
import { resolveCapabilities } from "
|
|
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,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import type { CliProgram } from "../../../core/types.ts";
|
|
2
|
+
import { isExternallyManagedBinary } from "../binary-placement.ts";
|
|
3
|
+
import type { InstallPaths } from "../paths.ts";
|
|
4
|
+
import { InstallTarget } from "../target-base.ts";
|
|
4
5
|
import type {
|
|
5
6
|
DetectedSnapshot,
|
|
6
7
|
InstallAction,
|
|
@@ -8,8 +9,7 @@ import type {
|
|
|
8
9
|
InstallStatus,
|
|
9
10
|
TargetPlanContext,
|
|
10
11
|
UninstallAction,
|
|
11
|
-
} from "
|
|
12
|
-
import type { CliProgram } from "~/core/types.ts";
|
|
12
|
+
} from "../target-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 "../paths.ts";
|
|
2
|
+
import { McpJsonInstallTarget } from "../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 "../paths.ts";
|
|
4
|
+
import { McpJsonInstallTarget } from "../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 "../paths.ts";
|
|
2
|
+
import { McpJsonInstallTarget } from "../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 "../paths.ts";
|
|
4
|
+
import { SkillInstallTarget } from "../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 "../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 "../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 "../mcp-codex.ts";
|
|
2
|
+
import { SkillInstallTarget } from "../target-skill.ts";
|
|
3
3
|
|
|
4
4
|
export const codexSkillTarget = new SkillInstallTarget({
|
|
5
5
|
key: "codexSkill",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { appConfigInstalled, displayAppConfigPath, uninstallAppConfig } from "
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
1
|
+
import { appConfigInstalled, displayAppConfigPath, uninstallAppConfig } from "../../../config/file.ts";
|
|
2
|
+
import type { CliProgram, InstallAgentIntegration } from "../../../core/types.ts";
|
|
3
|
+
import type { InstallPaths } from "../paths.ts";
|
|
4
|
+
import { InstallTarget } from "../target-base.ts";
|
|
4
5
|
import type {
|
|
5
6
|
DetectedSnapshot,
|
|
6
7
|
InstallAction,
|
|
@@ -8,8 +9,7 @@ import type {
|
|
|
8
9
|
InstallStatus,
|
|
9
10
|
TargetPlanContext,
|
|
10
11
|
UninstallAction,
|
|
11
|
-
} from "
|
|
12
|
-
import type { CliProgram, InstallAgentIntegration } from "~/core/types.ts";
|
|
12
|
+
} from "../target-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 "../paths.ts";
|
|
4
|
+
import { McpJsonInstallTarget } from "../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 "../paths.ts";
|
|
4
|
+
import { SkillInstallTarget } from "../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 "../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 "../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 "../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 "../mcp-openclaw.ts";
|
|
4
|
+
import { userHome } from "../paths.ts";
|
|
5
|
+
import { SkillInstallTarget } from "../target-skill.ts";
|
|
6
6
|
|
|
7
7
|
export const openclawSkillTarget = new SkillInstallTarget({
|
|
8
8
|
key: "openclawSkill",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CliProgram } from "../../../core/types.ts";
|
|
1
2
|
import {
|
|
2
3
|
checkOpenCodeMcpConflict,
|
|
3
4
|
detectOpenCodeMcpConfigPath,
|
|
@@ -5,9 +6,9 @@ import {
|
|
|
5
6
|
mergeOpenCodeMcpConfig,
|
|
6
7
|
opencodePresent,
|
|
7
8
|
removeOpenCodeMcpConfig,
|
|
8
|
-
} from "
|
|
9
|
-
import { displayInstallPath, type InstallPaths, userHome } from "
|
|
10
|
-
import { InstallTarget } from "
|
|
9
|
+
} from "../mcp-opencode.ts";
|
|
10
|
+
import { displayInstallPath, type InstallPaths, userHome } from "../paths.ts";
|
|
11
|
+
import { InstallTarget } from "../target-base.ts";
|
|
11
12
|
import type {
|
|
12
13
|
DetectedSnapshot,
|
|
13
14
|
InstallAction,
|
|
@@ -15,8 +16,7 @@ import type {
|
|
|
15
16
|
InstallStatus,
|
|
16
17
|
TargetPlanContext,
|
|
17
18
|
UninstallAction,
|
|
18
|
-
} from "
|
|
19
|
-
import type { CliProgram } from "~/core/types.ts";
|
|
19
|
+
} from "../target-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 "../mcp-opencode.ts";
|
|
2
|
+
import { userHome } from "../paths.ts";
|
|
3
|
+
import { SkillInstallTarget } from "../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,15 +6,9 @@ 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 "
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
formatConfigureMutationSummary,
|
|
13
|
-
parseConfigureOpts,
|
|
14
|
-
validateConfigureOpts,
|
|
15
|
-
} from "~/configure";
|
|
16
|
-
import type { CliProgram } from "~/core/types.ts";
|
|
17
|
-
import { Cli } from "~/index";
|
|
9
|
+
import { appConfigFileExists } from "../config/file.ts";
|
|
10
|
+
import type { CliProgram } from "../core/types.ts";
|
|
11
|
+
import { Cli } from "../index.ts";
|
|
18
12
|
import { detectInstalledArtifacts } from "./artifacts/detect-installed.ts";
|
|
19
13
|
import { parseInstallOpts } from "./artifacts/opts.ts";
|
|
20
14
|
import { resolveClaudeDesktopMcpPath, resolveInstallPaths } from "./artifacts/paths.ts";
|
|
@@ -22,6 +16,12 @@ import { buildInstallPlan, buildUpdatePlan } from "./artifacts/plan.ts";
|
|
|
22
16
|
import { installTargetForKey } from "./artifacts/target-registry.ts";
|
|
23
17
|
import { buildDetectedSnapshot, buildTargetPlanContext } from "./artifacts/target-scope.ts";
|
|
24
18
|
import { buildUninstallPlan } from "./artifacts/uninstall.ts";
|
|
19
|
+
import {
|
|
20
|
+
appConfigHasEntries,
|
|
21
|
+
formatConfigureMutationSummary,
|
|
22
|
+
parseConfigureOpts,
|
|
23
|
+
validateConfigureOpts,
|
|
24
|
+
} from "./index.ts";
|
|
25
25
|
|
|
26
26
|
const fixture: CliProgram = {
|
|
27
27
|
key: "testapp",
|
package/src/configure/index.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Interactive and automated `configure` command orchestration (agent artifacts and app config).
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { displayAppConfigPath, runConfigure } from "
|
|
6
|
-
import { ensureAppConfigFile } from "
|
|
7
|
-
import type { CliProgram } from "
|
|
8
|
-
import { resolveCapabilities } from "
|
|
9
|
-
import { cliSkillInstall, skillTargetFromActionKind } from "
|
|
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
10
|
import { resolveInstallPaths } from "./artifacts/paths.ts";
|
|
11
11
|
import { buildInstallPlan, buildUpdatePlan } from "./artifacts/plan.ts";
|
|
12
12
|
import {
|
package/src/configure/prompt.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
TTY prompts for per-target install, skip, or uninstall during interactive `configure`.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { readPromptLine } from "
|
|
5
|
+
import { readPromptLine } from "../prompt.ts";
|
|
6
6
|
import type { CliInstallArtifactKey } from "./artifacts/target-types.ts";
|
|
7
7
|
|
|
8
8
|
/** Human-readable labels for each install artifact key in interactive prompts. */
|
package/src/core/context.ts
CHANGED
|
@@ -7,9 +7,9 @@ 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 "
|
|
12
|
-
import { strictParseDouble } from "
|
|
10
|
+
import type { AnyAppConfigSnapshot } from "../config/context.ts";
|
|
11
|
+
import { EmptyAppConfigSnapshot } from "../config/context.ts";
|
|
12
|
+
import { strictParseDouble } from "../utils.ts";
|
|
13
13
|
import { parseCommaList, parseDate, parseDateTime, parseDurationMs } from "./formats.ts";
|
|
14
14
|
import { loadLeafInputs, readJsonOptionValue } from "./leaf-inputs.ts";
|
|
15
15
|
import { normalizeRespondOptions, writeRespondBodyToStdout } from "./respond.ts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { Cli } from "
|
|
2
|
+
import { Cli } from "../index.ts";
|
|
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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { Cli, CliContext, CliOptionKind } from "
|
|
2
|
+
import { Cli, CliContext, CliOptionKind } from "../index.ts";
|
|
3
3
|
import { LeafInputError, loadLeafInputs } from "./leaf-inputs.ts";
|
|
4
4
|
import type { CliProgram } from "./types.ts";
|
|
5
5
|
|
package/src/core/leaf-inputs.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Leaf input reads: Json options (flag, preloaded stdin, or toolArgs), optional inputSchema validation.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { validateConfigDocument } from "
|
|
6
|
-
import { isInteractiveTty } from "
|
|
5
|
+
import { validateConfigDocument } from "../config/validate.ts";
|
|
6
|
+
import { isInteractiveTty } from "../utils.ts";
|
|
7
7
|
import type { CliContext, CliLeafInputs } from "./context.ts";
|
|
8
8
|
import { collectOptionDefs } from "./parse.ts";
|
|
9
9
|
import type { CliInvocation, CliLeaf, CliNode, CliOption, CliProgram } from "./types.ts";
|
package/src/core/parse.test.ts
CHANGED
|
@@ -7,21 +7,21 @@ import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "no
|
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { $ } from "bun";
|
|
10
|
-
import { completionBashScript, completionZshScript } from "
|
|
11
|
-
import { cliPresentationRoot } from "
|
|
12
|
-
import { cliHelpRender } from "
|
|
13
|
-
import { Cli, CliFallbackMode, CliOptionKind, type CliProgram } from "
|
|
14
|
-
import { applyShellEnv } from "
|
|
15
|
-
import { allMcpResources, collectMcpTools, mcpToolCallToArgv, resolveMcpSchemaUri } from "
|
|
16
|
-
import { generatePluginSkillBundle, generateSkillBundle } from "
|
|
17
|
-
import { cliSkillInstall } from "
|
|
10
|
+
import { completionBashScript, completionZshScript } from "../builtins/index.ts";
|
|
11
|
+
import { cliPresentationRoot } from "../builtins/presentation.ts";
|
|
12
|
+
import { cliHelpRender } from "../help.ts";
|
|
13
|
+
import { Cli, CliFallbackMode, CliOptionKind, type CliProgram } from "../index.ts";
|
|
14
|
+
import { applyShellEnv } from "../mcp/env.ts";
|
|
15
|
+
import { allMcpResources, collectMcpTools, mcpToolCallToArgv, resolveMcpSchemaUri } from "../mcp/tools.ts";
|
|
16
|
+
import { generatePluginSkillBundle, generateSkillBundle } from "../skill/generate.ts";
|
|
17
|
+
import { cliSkillInstall } from "../skill/install.ts";
|
|
18
18
|
import {
|
|
19
19
|
enumMcpFixture,
|
|
20
20
|
nestedDocsFallbackFixture,
|
|
21
21
|
nestedMcpFixture,
|
|
22
22
|
testProgram,
|
|
23
23
|
varargsReadFixture,
|
|
24
|
-
} from "
|
|
24
|
+
} from "../test/fixtures.ts";
|
|
25
25
|
import { ParseKind, parse, postParseValidate } from "./parse.ts";
|
|
26
26
|
import { cliSchemaJson } from "./schema.ts";
|
|
27
27
|
import { cliValidateProgram } from "./validate.ts";
|
package/src/core/parse.ts
CHANGED
|
@@ -7,8 +7,8 @@ It keeps handler dispatch and help on one parser so the CLI behavior stays consi
|
|
|
7
7
|
across every entry path.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { isCliCallable } from "
|
|
11
|
-
import { fullStringIsDouble } from "
|
|
10
|
+
import { isCliCallable } from "../runtime/exposure.ts";
|
|
11
|
+
import { fullStringIsDouble } from "../utils.ts";
|
|
12
12
|
import { formatValidationError, validateFormatValue } from "./formats.ts";
|
|
13
13
|
import {
|
|
14
14
|
CliFallbackMode,
|
package/src/core/schema.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
This module serializes the CLI schema tree to JSON for machine-readable introspection.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { type CliSchemaExport, exportPresentationBuiltins } from "
|
|
6
|
-
import { cliResolveNotes } from "
|
|
7
|
-
import { isCliSchemaHidden, visibleOptions } from "
|
|
5
|
+
import { type CliSchemaExport, exportPresentationBuiltins } from "../builtins/export.ts";
|
|
6
|
+
import { cliResolveNotes } from "../help.ts";
|
|
7
|
+
import { isCliSchemaHidden, visibleOptions } from "../runtime/exposure.ts";
|
|
8
8
|
import { type CliNode, type CliProgram, isCliLeaf, isCliRouter, leafOutputSchema } from "./types.ts";
|
|
9
9
|
|
|
10
10
|
const RESERVED = new Set(["http", "completion", "configure", "docs", "mcp", "version"]);
|
package/src/core/types.ts
CHANGED
|
@@ -4,7 +4,7 @@ It is the shared declarative model that parsing, validation, help, and completio
|
|
|
4
4
|
read from, so the package has one source of truth.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { AnyAppConfigSnapshot } from "
|
|
7
|
+
import type { AnyAppConfigSnapshot } from "../config/context.ts";
|
|
8
8
|
import type { CliContext } from "./context.ts";
|
|
9
9
|
|
|
10
10
|
/**
|
package/src/core/validate.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
This module validates CLI schemas before execution.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { AGENT_PAIRS, MCP_KEYS, mcpServerRequiredForArtifact } from "
|
|
6
|
-
import { reservedDocsTopicResourceUris } from "
|
|
7
|
-
import { DOCS_BUILTIN_TOPIC_KEYS, docsEnabled } from "
|
|
8
|
-
import { HTTP_RESERVED_TOP_LEVEL_SEGMENTS } from "
|
|
9
|
-
import { resolveMcpSchemaUri } from "
|
|
10
|
-
import { reservedCommandNames, resolveCapabilities } from "
|
|
5
|
+
import { AGENT_PAIRS, MCP_KEYS, mcpServerRequiredForArtifact } from "../configure/artifacts/target-registry.ts";
|
|
6
|
+
import { reservedDocsTopicResourceUris } from "../docs/mcp-resources.ts";
|
|
7
|
+
import { DOCS_BUILTIN_TOPIC_KEYS, docsEnabled } from "../docs/resolve.ts";
|
|
8
|
+
import { HTTP_RESERVED_TOP_LEVEL_SEGMENTS } from "../http/paths.ts";
|
|
9
|
+
import { resolveMcpSchemaUri } from "../mcp/tools.ts";
|
|
10
|
+
import { reservedCommandNames, resolveCapabilities } from "../runtime/capabilities.ts";
|
|
11
11
|
import { validateFormatValue } from "./formats.ts";
|
|
12
12
|
import {
|
|
13
13
|
type CliLeaf,
|
package/src/docs/builtin.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { docsSkillTopicDescription } from "
|
|
2
|
-
import { type CliLeaf, type CliOption, CliOptionKind, type CliProgram, type CliRouter } from "
|
|
3
|
-
import { resolveCapabilities } from "
|
|
1
|
+
import { docsSkillTopicDescription } from "../builtins/configure-copy.ts";
|
|
2
|
+
import { type CliLeaf, type CliOption, CliOptionKind, type CliProgram, type CliRouter } from "../core/types.ts";
|
|
3
|
+
import { resolveCapabilities } from "../runtime/capabilities.ts";
|
|
4
4
|
import {
|
|
5
5
|
DOCS_ROUTER_DESCRIPTION,
|
|
6
6
|
docsEnabled,
|
|
@@ -3,9 +3,9 @@ Tests for docs/cli-guide module behavior.
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { expect, test } from "bun:test";
|
|
6
|
-
import { cliSchemaExport } from "
|
|
7
|
-
import type { CliProgram } from "
|
|
8
|
-
import { CliOptionKind } from "
|
|
6
|
+
import { cliSchemaExport } from "../core/schema.ts";
|
|
7
|
+
import type { CliProgram } from "../core/types.ts";
|
|
8
|
+
import { CliOptionKind } from "../core/types.ts";
|
|
9
9
|
import { generateCliGuide, generateCliGuideBody } from "./cli-guide.ts";
|
|
10
10
|
|
|
11
11
|
const nestedFixture: CliProgram = {
|
package/src/docs/cli-guide.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CliSchemaExport } from "
|
|
2
|
-
import { cliSchemaExport } from "
|
|
3
|
-
import type { CliOption, CliPositional, CliProgram } from "
|
|
4
|
-
import { CliFallbackMode, CliOptionKind } from "
|
|
5
|
-
import { cliPositionalLabel, cliResolveNotes } from "
|
|
1
|
+
import type { CliSchemaExport } from "../builtins/export.ts";
|
|
2
|
+
import { cliSchemaExport } from "../core/schema.ts";
|
|
3
|
+
import type { CliOption, CliPositional, CliProgram } from "../core/types.ts";
|
|
4
|
+
import { CliFallbackMode, CliOptionKind } from "../core/types.ts";
|
|
5
|
+
import { cliPositionalLabel, cliResolveNotes } from "../help.ts";
|
|
6
6
|
|
|
7
7
|
/** Options for {@link generateCliGuideBody} and {@link generateCliGuide}. */
|
|
8
8
|
export interface CliGuideBodyOptions {
|
package/src/docs/docs.test.ts
CHANGED
|
@@ -6,14 +6,14 @@ import { afterEach, beforeEach, expect, test } from "bun:test";
|
|
|
6
6
|
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { join } from "node:path";
|
|
9
|
-
import { completionBashScript } from "
|
|
10
|
-
import { cliPresentationRoot } from "
|
|
11
|
-
import { ParseKind, parse } from "
|
|
12
|
-
import type { CliProgram } from "
|
|
13
|
-
import { cliValidateProgram } from "
|
|
14
|
-
import { cliHelpRender } from "
|
|
15
|
-
import { Cli } from "
|
|
16
|
-
import { resolveCapabilities, skipsRequiredAppConfigExit } from "
|
|
9
|
+
import { completionBashScript } from "../builtins/index.ts";
|
|
10
|
+
import { cliPresentationRoot } from "../builtins/presentation.ts";
|
|
11
|
+
import { ParseKind, parse } from "../core/parse.ts";
|
|
12
|
+
import type { CliProgram } from "../core/types.ts";
|
|
13
|
+
import { cliValidateProgram } from "../core/validate.ts";
|
|
14
|
+
import { cliHelpRender } from "../help.ts";
|
|
15
|
+
import { Cli } from "../index.ts";
|
|
16
|
+
import { resolveCapabilities, skipsRequiredAppConfigExit } from "../runtime/capabilities.ts";
|
|
17
17
|
import { generateMcpGuide } from "./mcp-guide.ts";
|
|
18
18
|
import { saveDocsTopic } from "./save.ts";
|
|
19
19
|
|
package/src/docs/http-guide.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defaultConfigEntryTitle } from "
|
|
2
|
-
import { displayAppConfigPath } from "
|
|
3
|
-
import { collectOptionDefs } from "
|
|
4
|
-
import { CliOptionKind, type CliProgram } from "
|
|
5
|
-
import { httpUserPathGlob, resolveHttpPathPrefix } from "
|
|
6
|
-
import { collectHttpRoutes } from "
|
|
7
|
-
import { resolveHttpListenAddress } from "
|
|
1
|
+
import { defaultConfigEntryTitle } from "../config/entry.ts";
|
|
2
|
+
import { displayAppConfigPath } from "../config/file.ts";
|
|
3
|
+
import { collectOptionDefs } from "../core/parse.ts";
|
|
4
|
+
import { CliOptionKind, type CliProgram } from "../core/types.ts";
|
|
5
|
+
import { httpUserPathGlob, resolveHttpPathPrefix } from "../http/paths.ts";
|
|
6
|
+
import { collectHttpRoutes } from "../http/routes.ts";
|
|
7
|
+
import { resolveHttpListenAddress } from "../http/server.ts";
|
|
8
8
|
|
|
9
9
|
/** Formats one HTTP route for the auto-generated HTTP guide. */
|
|
10
10
|
function formatRouteLine(root: CliProgram, route: ReturnType<typeof collectHttpRoutes>[number]): string {
|
package/src/docs/mcp-guide.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defaultConfigEntryTitle } from "
|
|
2
|
-
import { displayAppConfigPath } from "
|
|
3
|
-
import { expectedOpenCodeMcpEntry, OPENCODE_CONFIG_SCHEMA } from "
|
|
4
|
-
import { collectOptionDefs } from "
|
|
5
|
-
import { CliOptionKind, type CliProgram } from "
|
|
6
|
-
import { collectMcpTools, type McpToolDef, mcpServerId, resolveMcpSchemaUri } from "
|
|
7
|
-
import { resolveCapabilities } from "
|
|
1
|
+
import { defaultConfigEntryTitle } from "../config/entry.ts";
|
|
2
|
+
import { displayAppConfigPath } from "../config/file.ts";
|
|
3
|
+
import { expectedOpenCodeMcpEntry, OPENCODE_CONFIG_SCHEMA } from "../configure/artifacts/mcp-opencode.ts";
|
|
4
|
+
import { collectOptionDefs } from "../core/parse.ts";
|
|
5
|
+
import { CliOptionKind, type CliProgram } from "../core/types.ts";
|
|
6
|
+
import { collectMcpTools, type McpToolDef, mcpServerId, resolveMcpSchemaUri } from "../mcp/tools.ts";
|
|
7
|
+
import { resolveCapabilities } from "../runtime/capabilities.ts";
|
|
8
8
|
import { resolveDocsTopicResourceUri } from "./mcp-resources.ts";
|
|
9
9
|
import { docsEnabled, docsUserTopicKeys, resolveDocsConfig } from "./resolve.ts";
|
|
10
10
|
|