argsbarg 6.1.9 → 6.2.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/CHANGELOG.md +17 -1
- package/README.md +187 -93
- package/docs/README.md +3 -2
- package/docs/ai-skills.md +36 -23
- package/docs/cli-program.md +12 -11
- package/docs/config-schema.md +3 -3
- package/docs/configure.md +12 -16
- package/docs/decisions.md +74 -37
- package/docs/developing.md +6 -6
- package/docs/distribution-homebrew.md +117 -104
- package/docs/mcp.md +21 -57
- package/docs/output-schema.md +2 -2
- package/examples/formats.ts +5 -6
- package/examples/full-example/README.md +7 -69
- package/examples/full-example/docs/cli-schema.json +1 -1659
- package/examples/full-example/docs/cli.md +2 -1538
- package/examples/full-example/docs/http.md +3 -8
- package/examples/full-example/docs/mcp.md +23 -59
- package/examples/full-example/docs/openapi.json +2 -782
- package/examples/full-example/docs/skill.md +18 -14
- package/examples/full-example/justfile +22 -14
- package/examples/full-example/scripts/create-identity.ts +2 -1
- package/examples/full-example/src/commands/status/command.test.ts +2 -2
- package/examples/full-example/src/commands/status/command.ts +7 -6
- package/examples/full-example/src/program.ts +4 -10
- package/examples/full-example-json/Formula/.gitkeep +0 -0
- package/examples/full-example-json/Formula/full-example-json.rb +35 -0
- package/examples/full-example-json/README.md +27 -0
- package/examples/full-example-json/biome.json +22 -0
- package/examples/full-example-json/bun.lock +48 -0
- package/examples/full-example-json/docs/README.md +27 -0
- package/examples/full-example-json/docs/cli-schema.json +2145 -0
- package/examples/full-example-json/docs/cli.md +1990 -0
- package/examples/full-example-json/docs/http.md +92 -0
- package/examples/full-example-json/docs/mcp.md +116 -0
- package/examples/full-example-json/docs/openapi.json +1246 -0
- package/examples/full-example-json/docs/skill.md +57 -0
- package/examples/full-example-json/justfile +171 -0
- package/examples/full-example-json/package.json +22 -0
- package/examples/full-example-json/scripts/create-identity.ts +12 -0
- package/examples/full-example-json/scripts/dev-formula.ts +97 -0
- package/examples/full-example-json/scripts/formula-shared.test.ts +68 -0
- package/examples/full-example-json/scripts/formula-shared.ts +170 -0
- package/examples/full-example-json/scripts/print-identity.ts +28 -0
- package/examples/full-example-json/scripts/release.ts +212 -0
- package/examples/full-example-json/src/commands/echo/command.ts +26 -0
- package/examples/full-example-json/src/commands/status/command.test.ts +10 -0
- package/examples/full-example-json/src/commands/status/command.ts +28 -0
- package/examples/full-example-json/src/index.ts +10 -0
- package/examples/full-example-json/src/program.ts +33 -0
- package/examples/full-example-json/src/types/md.d.ts +4 -0
- package/examples/full-example-json/tsconfig.json +17 -0
- package/examples/minimal.ts +17 -17
- package/examples/nested.ts +10 -10
- package/examples/option-required.ts +13 -13
- package/examples/servers.ts +10 -10
- package/index.d.ts +17 -43
- package/package.json +1 -1
- package/src/cli-tool/create.test.ts +44 -68
- package/src/cli-tool/create.ts +81 -17
- package/src/cli-tool/full-example-capabilities.test.ts +33 -18
- package/src/cli-tool/post-create.ts +31 -17
- package/src/cli-tool/program.ts +16 -7
- package/src/cli-tool/prompt.ts +27 -0
- package/src/cli-tool/run-create.ts +19 -7
- package/src/cli-tool/schemagen/schemagen.test.ts +3 -3
- package/src/configure/artifacts/install-validate.test.ts +20 -33
- package/src/configure/artifacts/paths.ts +9 -53
- package/src/configure/artifacts/status.test.ts +13 -16
- package/src/configure/artifacts/status.ts +5 -22
- package/src/configure/artifacts/target-base.ts +6 -15
- package/src/configure/artifacts/target-effective.ts +16 -54
- package/src/configure/artifacts/target-mcp-json.ts +2 -5
- package/src/configure/artifacts/target-registry.ts +0 -7
- package/src/configure/artifacts/target-scope.ts +7 -17
- package/src/configure/artifacts/target-skill.ts +6 -15
- package/src/configure/artifacts/target-types.ts +6 -54
- package/src/configure/artifacts/targets/agents-mcp.ts +11 -0
- package/src/configure/artifacts/targets/configure.ts +1 -5
- package/src/configure/artifacts/targets/index.ts +4 -44
- package/src/configure/artifacts/targets/skill.ts +12 -0
- package/src/configure/artifacts/targets.test.ts +21 -59
- package/src/configure/configure.test.ts +35 -46
- package/src/configure/index.ts +19 -19
- package/src/configure/prompt.ts +2 -12
- package/src/core/parse.test.ts +21 -32
- package/src/core/types.ts +18 -44
- package/src/core/validate.ts +28 -45
- package/src/docs/docs.test.ts +4 -4
- package/src/docs/http-guide.ts +1 -1
- package/src/docs/mcp-guide.ts +41 -71
- package/src/docs/resolve.ts +1 -1
- package/src/docs/save.ts +1 -1
- package/src/exports/cli.ts +1 -1
- package/src/index.ts +1 -1
- package/src/skill/generate.ts +26 -45
- package/src/skill/install.ts +18 -38
- package/src/skill/naming.ts +3 -27
- package/src/test/integration/config.test.ts +3 -3
- package/src/test/integration/mcp.test.ts +4 -4
- package/{examples/mcp-test.ts → src/test/mcp-integration-fixture.ts} +20 -22
- package/src/configure/artifacts/target-mcp-cli.ts +0 -127
- package/src/configure/artifacts/targets/chatgpt-mcp.ts +0 -12
- package/src/configure/artifacts/targets/claude-code-mcp.ts +0 -15
- package/src/configure/artifacts/targets/claude-desktop-mcp.ts +0 -12
- package/src/configure/artifacts/targets/claude-skill.ts +0 -16
- package/src/configure/artifacts/targets/codex-mcp.ts +0 -25
- package/src/configure/artifacts/targets/codex-skill.ts +0 -14
- package/src/configure/artifacts/targets/cursor-mcp.ts +0 -15
- package/src/configure/artifacts/targets/cursor-skill.ts +0 -16
- package/src/configure/artifacts/targets/openclaw-mcp.ts +0 -25
- package/src/configure/artifacts/targets/openclaw-skill.ts +0 -17
- package/src/configure/artifacts/targets/opencode-mcp.ts +0 -96
- package/src/configure/artifacts/targets/opencode-skill.ts +0 -15
- /package/examples/{full-example → full-example-json}/src/commands/render-json/__generated__/RenderJsonInputSchema.json +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/render-json/__generated__/index.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/render-json/command.test.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/render-json/command.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/render-json/types.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/status/__generated__/StatusJsonOutputSchema.json +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/status/__generated__/index.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/status/types.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/workspaces/__generated__/index.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/workspaces/command.test.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/workspaces/command.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/commands/workspaces/types.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/db/index.test.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/db/index.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/db/migrate.test.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/db/migrate.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/db/migrations/001_workspaces.sql +0 -0
- /package/examples/{full-example → full-example-json}/src/db/tables/workspaces.ts +0 -0
- /package/examples/{full-example → full-example-json}/src/types/argsbarg.d.ts +0 -0
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { CliProgram } from "../../../core/types.ts";
|
|
2
|
-
import {
|
|
3
|
-
checkOpenCodeMcpConflict,
|
|
4
|
-
detectOpenCodeMcpConfigPath,
|
|
5
|
-
expectedOpenCodeMcpEntry,
|
|
6
|
-
mergeOpenCodeMcpConfig,
|
|
7
|
-
opencodePresent,
|
|
8
|
-
removeOpenCodeMcpConfig,
|
|
9
|
-
} from "../mcp-opencode.ts";
|
|
10
|
-
import { displayInstallPath, type InstallPaths, userHome } from "../paths.ts";
|
|
11
|
-
import { InstallTarget } from "../target-base.ts";
|
|
12
|
-
import type {
|
|
13
|
-
DetectedSnapshot,
|
|
14
|
-
InstallAction,
|
|
15
|
-
InstalledArtifacts,
|
|
16
|
-
InstallStatus,
|
|
17
|
-
TargetPlanContext,
|
|
18
|
-
UninstallAction,
|
|
19
|
-
} from "../target-types.ts";
|
|
20
|
-
|
|
21
|
-
function resolveConfigPath(paths: InstallPaths, home: string): string {
|
|
22
|
-
return detectOpenCodeMcpConfigPath(home, paths.mcpName) ?? paths.opencodeMcpPath;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** OpenCode MCP (top-level `mcp` key, not `mcpServers`). */
|
|
26
|
-
class OpenCodeMcpInstallTarget extends InstallTarget {
|
|
27
|
-
readonly key = "opencodeMcp" as const;
|
|
28
|
-
readonly actionKind = "opencode-mcp" as const;
|
|
29
|
-
readonly category = "mcp" as const;
|
|
30
|
-
readonly pairedKey = "opencodeSkill" as const;
|
|
31
|
-
|
|
32
|
-
isAvailable(_root: CliProgram, _paths: InstallPaths): boolean {
|
|
33
|
-
return opencodePresent(userHome());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
isDetected(paths: InstallPaths, _root: CliProgram): boolean {
|
|
37
|
-
return detectOpenCodeMcpConfigPath(userHome(), paths.mcpName) !== undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
applyDetected(paths: InstallPaths, root: CliProgram, out: InstalledArtifacts): void {
|
|
41
|
-
out.opencodeMcp = this.isDetected(paths, root);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
protected isDetectedFromSnapshot(detected: DetectedSnapshot): boolean {
|
|
45
|
-
return detected.opencodeMcp;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
protected formatStatusLine(paths: InstallPaths, _root: CliProgram): string {
|
|
49
|
-
const home = userHome();
|
|
50
|
-
const path = detectOpenCodeMcpConfigPath(home, paths.mcpName) ?? paths.opencodeMcpPath;
|
|
51
|
-
return `${displayInstallPath(path)} (server "${paths.mcpName}")`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
protected assignStatusLine(status: InstallStatus, line: string): void {
|
|
55
|
-
status.opencodeMcp = line;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
preflight(ctx: TargetPlanContext): string | null {
|
|
59
|
-
const entry = expectedOpenCodeMcpEntry(ctx.root);
|
|
60
|
-
return checkOpenCodeMcpConflict(ctx.paths.opencodeMcpPath, ctx.paths.mcpName, entry, !!ctx.opts.yes);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
protected buildInstallActions(ctx: TargetPlanContext): InstallAction[] {
|
|
64
|
-
const entry = expectedOpenCodeMcpEntry(ctx.root);
|
|
65
|
-
const configPath = ctx.paths.opencodeMcpPath;
|
|
66
|
-
return [
|
|
67
|
-
{
|
|
68
|
-
kind: this.actionKind,
|
|
69
|
-
summary: `opencode mcp: ${displayInstallPath(configPath)}`,
|
|
70
|
-
message: `Merging MCP server "${ctx.paths.mcpName}" into ${displayInstallPath(configPath)}`,
|
|
71
|
-
run: () => {
|
|
72
|
-
mergeOpenCodeMcpConfig(configPath, ctx.paths.mcpName, entry, ctx.dry);
|
|
73
|
-
return [configPath];
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
protected buildUninstallActions(ctx: TargetPlanContext): UninstallAction[] {
|
|
80
|
-
const home = userHome();
|
|
81
|
-
const configPath = resolveConfigPath(ctx.paths, home);
|
|
82
|
-
return [
|
|
83
|
-
{
|
|
84
|
-
kind: this.actionKind,
|
|
85
|
-
summary: `opencode mcp: ${displayInstallPath(configPath)}`,
|
|
86
|
-
message: `Removing MCP server "${ctx.paths.mcpName}" from ${displayInstallPath(configPath)}`,
|
|
87
|
-
run: () => {
|
|
88
|
-
removeOpenCodeMcpConfig(configPath, ctx.paths.mcpName, ctx.dry);
|
|
89
|
-
return [configPath];
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export const opencodeMcpTarget = new OpenCodeMcpInstallTarget();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { opencodePresent } from "../mcp-opencode.ts";
|
|
2
|
-
import { userHome } from "../paths.ts";
|
|
3
|
-
import { SkillInstallTarget } from "../target-skill.ts";
|
|
4
|
-
|
|
5
|
-
export const opencodeSkillTarget = new SkillInstallTarget({
|
|
6
|
-
key: "opencodeSkill",
|
|
7
|
-
actionKind: "opencode-skill",
|
|
8
|
-
label: "OpenCode",
|
|
9
|
-
uninstallPrefix: "opencode skill",
|
|
10
|
-
pairedMcpKey: "opencodeMcp",
|
|
11
|
-
skillDir: (p) => p.opencodeSkillDir,
|
|
12
|
-
detectedKey: "opencodeSkill",
|
|
13
|
-
statusField: "opencodeSkill",
|
|
14
|
-
isAvailable: () => opencodePresent(userHome()),
|
|
15
|
-
});
|
|
File without changes
|
/package/examples/{full-example → full-example-json}/src/commands/render-json/__generated__/index.ts
RENAMED
|
File without changes
|
/package/examples/{full-example → full-example-json}/src/commands/render-json/command.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/examples/{full-example → full-example-json}/src/commands/status/__generated__/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/examples/{full-example → full-example-json}/src/commands/workspaces/__generated__/index.ts
RENAMED
|
File without changes
|
/package/examples/{full-example → full-example-json}/src/commands/workspaces/command.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|