Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node": "^25.6.0",
"@valibot/to-json-schema": "^1.6.0",
"ajv": "^8.20.0",
"@celados/argc": "^8.0.0",
"@celados/argc": "^9.0.0",
"bun-types": "^1.3.13",
"dataforseo-client": "^2.0.25",
"dotenv": "^17.2.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/gkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gkit",
"version": "0.3.3",
"version": "0.3.4",
"private": true,
"description": "Profile-bound, agent-first growth provider CLI.",
"bin": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"test:site": "bun run ./scripts/test-site-snapshot.ts"
},
"devDependencies": {
"@celados/argc": "^8.0.0",
"@celados/argc": "^9.0.0",
"@standard-schema/spec": "^1.0.0",
"@types/bun": "^1.3.10",
"@types/node": "^25.6.0",
Expand Down
32 changes: 0 additions & 32 deletions packages/gkit/src/capture.test.ts

This file was deleted.

35 changes: 0 additions & 35 deletions packages/gkit/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fileURLToPath } from "node:url";

import { isAgentCapture } from "@celados/argc";
import { ensureTrailingNewline, formatBareSkill } from "@celados/argc/skill";

import { parseArgs, renderHelp } from "./args";
Expand Down Expand Up @@ -138,10 +137,6 @@ export async function main(

try {
const command = parseArgs(argv);
if (refuseCapturedGuide(command, argv)) {
process.exitCode = 1;
return;
}
if (command.kind === "help") {
await emitter.writeText(renderHelp());
process.exitCode = abortController.signal.aborted ? 130 : 0;
Expand Down Expand Up @@ -434,36 +429,6 @@ export async function main(
}
}

/**
* gkit parses its own argv, so argc's output-capture guard (argc
* docs/spec-7.12-output-capture.md) is applied here: help, --schema and @skill
* must be read whole, and an agent piping them into head/grep/$(…) is refused
* before anything prints. Written to stderr, since stdout is the filter.
*/
function refuseCapturedGuide(command: ReturnType<typeof parseArgs>, argv: string[]): boolean {
if (command.kind !== "help" && command.kind !== "schema" && command.kind !== "skill") return false;
if (!isAgentCapture()) return false;
const line = ["gkit", ...argv.map(quoteWord)].join(" ");
const out = ["gkit", command.kind].join("-");
process.stderr.write(
[
`error: OUTPUT_CAPTURED: gkit ${command.kind === "skill" ? "@skill" : command.kind === "schema" ? "--schema" : "help"} is meant to be read whole, and stdout is a pipe or $(…): head/tail/grep/sed/rg would hand you a fragment that reads like the whole. Nothing ran.`,
"run it alone — the shell tool shows all of it:",
` ${line}`,
"or keep it whole in a file, then read the whole file:",
` ${line} > "\${TMPDIR:-/tmp}/${out}.out"`,
"",
].join("\n"),
);
return true;
}

function quoteWord(word: string): string {
if (/^[A-Za-z0-9_@%+:,./-][A-Za-z0-9_@%+=:,./-]*$/.test(word)) return word;
if (!/["$`\\!]/.test(word)) return `"${word}"`;
return `'${word.replaceAll("'", `'\\''`)}'`;
}

async function renderEmbeddedSkill(
path: string | null,
emitter: TerminalEmitter,
Expand Down
Loading