promptarch 1.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -243,17 +243,21 @@ var STACK_HINTS = [
243
243
  [/^vitest$|^jest$/, "unit tests"],
244
244
  [/^@playwright\/test$|^playwright$/, "Playwright E2E"]
245
245
  ];
246
+ var FIELD_MAX = 1900;
247
+ function clampField(s) {
248
+ return s.length > FIELD_MAX ? `${s.slice(0, FIELD_MAX - 1)}\u2026` : s;
249
+ }
246
250
  async function extractRepo(cwd) {
247
251
  const pkg = await readJson(join(cwd, "package.json"));
248
252
  const name = pkg?.name || basename(cwd);
249
253
  const description = pkg?.description || await firstReadmeParagraph(cwd) || "";
250
254
  return {
251
- name,
252
- description,
253
- techStack: await detectStack(cwd, pkg),
254
- tree: await buildTree(cwd),
255
- commands: await detectCommands(cwd, pkg),
256
- conventions: await readExistingConfig(cwd)
255
+ name: clampField(name),
256
+ description: clampField(description),
257
+ techStack: clampField(await detectStack(cwd, pkg)),
258
+ tree: clampField(await buildTree(cwd)),
259
+ commands: clampField(await detectCommands(cwd, pkg)),
260
+ conventions: clampField(await readExistingConfig(cwd))
257
261
  };
258
262
  }
259
263
  async function readJson(path) {
@@ -504,7 +508,10 @@ async function initCmd(opts) {
504
508
  return;
505
509
  }
506
510
  if (!res.ok) {
507
- console.error(`Build failed (HTTP ${res.status}).`);
511
+ const detail = await res.json().catch(() => null);
512
+ console.error(
513
+ `Build failed (HTTP ${res.status})${detail?.error ? `: ${detail.error}` : ""}.`
514
+ );
508
515
  process.exitCode = 1;
509
516
  return;
510
517
  }
@@ -1057,7 +1064,7 @@ async function login(opts) {
1057
1064
  var program = new Command();
1058
1065
  program.name("promptarch").description(
1059
1066
  "Generate and lint AI coding-agent context files (CLAUDE.md, AGENTS.md, Cursor rules) from your repo."
1060
- ).version("1.0.2");
1067
+ ).version("1.0.3");
1061
1068
  program.command("login").description("Store a PromptArch API key (pk_...) in ~/.config/promptarch").option("--key <key>", "API key (non-interactive; for CI)").action(login);
1062
1069
  program.command("lint").description("Lint agent context files offline (deterministic, free, CI-friendly)").argument("<files...>", "Files to lint (CLAUDE.md, AGENTS.md, *.mdc, ...)").option("--strict", "Fail on warnings too, not just errors").action((files, opts) => lintCmd(files, opts));
1063
1070
  program.command("init").description("Extract repo context and generate CLAUDE.md / AGENTS.md / Cursor / Copilot files").option("--dry-run", "Print the extracted payload without calling the API").option("--out <dir>", "Output directory (default: current directory)").option("--force", "Overwrite existing files without prompting").action(initCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptarch",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Generate and lint AI coding-agent context files (CLAUDE.md, AGENTS.md, Cursor rules) from your repo.",
5
5
  "keywords": [
6
6
  "claude",