@promptscript/cli 1.14.1 → 1.14.2

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/index.js +77 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -12714,6 +12714,7 @@ var init_markdown_instruction_formatter = __esm({
12714
12714
  this.addSection(sections, this.project(ast, renderer));
12715
12715
  this.addSection(sections, this.techStack(ast, renderer));
12716
12716
  this.addSection(sections, this.architecture(ast, renderer));
12717
+ this.addSection(sections, this.context(ast, renderer));
12717
12718
  this.addSection(sections, this.codeStandards(ast, renderer));
12718
12719
  this.addSection(sections, this.gitCommits(ast, renderer));
12719
12720
  this.addSection(sections, this.configFiles(ast, renderer));
@@ -12806,6 +12807,30 @@ var init_markdown_instruction_formatter = __esm({
12806
12807
  const normalizedContent = this.normalizeMarkdownForPrettier(content);
12807
12808
  return renderer.renderSection("Architecture", normalizedContent.trim()) + "\n";
12808
12809
  }
12810
+ /**
12811
+ * Render @context block text content as a "## Context" section.
12812
+ *
12813
+ * The "## Architecture" subsection (with code block) is stripped because
12814
+ * it is already rendered separately by {@link architecture}. Remaining
12815
+ * "## " headings are downgraded to "### " to avoid clashing with the
12816
+ * formatter's own h2 section headings. When no @identity block exists,
12817
+ * the project() fallback already consumes the full @context text, so
12818
+ * this method returns null to avoid duplication.
12819
+ */
12820
+ context(ast, renderer) {
12821
+ const identity = this.findBlock(ast, "identity");
12822
+ if (!identity) return null;
12823
+ const contextBlock = this.findBlock(ast, "context");
12824
+ if (!contextBlock) return null;
12825
+ const text = this.extractText(contextBlock.content);
12826
+ if (!text) return null;
12827
+ const archMatch = this.extractSectionWithCodeBlock(text, "## Architecture");
12828
+ const remainingText = archMatch ? text.replace(archMatch, "").trim() : text.trim();
12829
+ if (!remainingText) return null;
12830
+ const downgradedText = remainingText.replace(/^(\s*)## /gm, "$1### ");
12831
+ const normalizedContent = this.normalizeMarkdownForPrettier(downgradedText);
12832
+ return renderer.renderSection("Context", normalizedContent.trim()) + "\n";
12833
+ }
12809
12834
  codeStandards(ast, renderer) {
12810
12835
  const standards = this.findBlock(ast, "standards");
12811
12836
  if (!standards) return null;
@@ -13844,6 +13869,8 @@ ${f.content}`
13844
13869
  if (techStack) sections.push(techStack);
13845
13870
  const architecture = this.architecture(ast, renderer);
13846
13871
  if (architecture) sections.push(architecture);
13872
+ const contextSection = this.contextSection(ast, renderer);
13873
+ if (contextSection) sections.push(contextSection);
13847
13874
  const codeStandards = this.codeStandards(ast, renderer);
13848
13875
  if (codeStandards) sections.push(codeStandards);
13849
13876
  const shortcuts = this.shortcutsSection(ast, renderer);
@@ -13954,6 +13981,19 @@ ${f.content}`
13954
13981
  const content = archMatch.replace("## Architecture", "").trim();
13955
13982
  return renderer.renderSection("architecture", this.stripAllIndent(content));
13956
13983
  }
13984
+ contextSection(ast, renderer) {
13985
+ const identity = this.findBlock(ast, "identity");
13986
+ if (!identity) return null;
13987
+ const contextBlock = this.findBlock(ast, "context");
13988
+ if (!contextBlock) return null;
13989
+ const text = this.extractText(contextBlock.content);
13990
+ if (!text) return null;
13991
+ const archMatch = this.extractSectionWithCodeBlock(text, "## Architecture");
13992
+ const remainingText = archMatch ? text.replace(archMatch, "").trim() : text.trim();
13993
+ if (!remainingText) return null;
13994
+ const downgradedText = remainingText.replace(/^(\s*)## /gm, "$1### ");
13995
+ return renderer.renderSection("Context", this.stripAllIndent(downgradedText));
13996
+ }
13957
13997
  codeStandards(ast, renderer) {
13958
13998
  const standards = this.findBlock(ast, "standards");
13959
13999
  if (!standards) return null;
@@ -15046,6 +15086,7 @@ ${f.content}`
15046
15086
  this.addSection(sections, this.project(ast, renderer));
15047
15087
  this.addSection(sections, this.techStack(ast, renderer));
15048
15088
  this.addSection(sections, this.architecture(ast, renderer));
15089
+ this.addSection(sections, this.contextSection(ast, renderer));
15049
15090
  this.addSection(sections, this.codeStandards(ast, renderer));
15050
15091
  this.addSection(sections, this.gitCommits(ast, renderer));
15051
15092
  this.addSection(sections, this.configFiles(ast, renderer));
@@ -15138,6 +15179,20 @@ ${f.content}`
15138
15179
  const normalizedContent = this.normalizeMarkdownForPrettier(content);
15139
15180
  return renderer.renderSection("Architecture", normalizedContent.trim()) + "\n";
15140
15181
  }
15182
+ contextSection(ast, renderer) {
15183
+ const identity = this.findBlock(ast, "identity");
15184
+ if (!identity) return null;
15185
+ const contextBlock = this.findBlock(ast, "context");
15186
+ if (!contextBlock) return null;
15187
+ const text = this.extractText(contextBlock.content);
15188
+ if (!text) return null;
15189
+ const archMatch = this.extractSectionWithCodeBlock(text, "## Architecture");
15190
+ const remainingText = archMatch ? text.replace(archMatch, "").trim() : text.trim();
15191
+ if (!remainingText) return null;
15192
+ const downgradedText = remainingText.replace(/^(\s*)## /gm, "$1### ");
15193
+ const normalizedContent = this.normalizeMarkdownForPrettier(downgradedText);
15194
+ return renderer.renderSection("Context", normalizedContent.trim()) + "\n";
15195
+ }
15141
15196
  codeStandards(ast, renderer) {
15142
15197
  const standards = this.findBlock(ast, "standards");
15143
15198
  if (!standards) return null;
@@ -16345,6 +16400,8 @@ ${content}`);
16345
16400
  if (techStack) sections.push(techStack);
16346
16401
  const architecture = this.architecture(ast, renderer);
16347
16402
  if (architecture) sections.push(architecture);
16403
+ const contextSection = this.contextSection(ast, renderer);
16404
+ if (contextSection) sections.push(contextSection);
16348
16405
  const codeStandards = this.codeStandards(ast, renderer);
16349
16406
  if (codeStandards) sections.push(codeStandards);
16350
16407
  const gitCommits = this.gitCommits(ast, renderer);
@@ -16672,6 +16729,21 @@ ${this.stripAllIndent(content)}`;
16672
16729
  }
16673
16730
  return null;
16674
16731
  }
16732
+ contextSection(ast, _renderer) {
16733
+ const identity = this.findBlock(ast, "identity");
16734
+ if (!identity) return null;
16735
+ const contextBlock = this.findBlock(ast, "context");
16736
+ if (!contextBlock) return null;
16737
+ const text = this.extractText(contextBlock.content);
16738
+ if (!text) return null;
16739
+ const archMatch = this.extractSectionWithCodeBlock(text, "## Architecture");
16740
+ const remainingText = archMatch ? text.replace(archMatch, "").trim() : text.trim();
16741
+ if (!remainingText) return null;
16742
+ const downgradedText = remainingText.replace(/^(\s*)## /gm, "$1### ");
16743
+ return `## Context
16744
+
16745
+ ${this.stripAllIndent(downgradedText)}`;
16746
+ }
16675
16747
  /**
16676
16748
  * Extract code standards from @standards block.
16677
16749
  * Uses shared extractor for dynamic key iteration (parity with GitHub/Claude/Cursor).
@@ -17418,6 +17490,7 @@ ${links.join("\n")}
17418
17490
  this.addSection(sections, this.project(ast, renderer));
17419
17491
  this.addSection(sections, this.techStack(ast, renderer));
17420
17492
  this.addSection(sections, this.architecture(ast, renderer));
17493
+ this.addSection(sections, this.context(ast, renderer));
17421
17494
  this.addSection(sections, this.commands(ast, renderer));
17422
17495
  this.addSection(sections, this.postWork(ast, renderer));
17423
17496
  }
@@ -29926,6 +29999,8 @@ var GitRegistry = class {
29926
29999
  options.baseDir = baseDir;
29927
30000
  }
29928
30001
  const git = simpleGit(options);
30002
+ git.env("GIT_TERMINAL_PROMPT", "0");
30003
+ git.env("GCM_INTERACTIVE", "never");
29929
30004
  if (this.auth?.type === "token") {
29930
30005
  const token = this.resolveToken();
29931
30006
  if (token) {
@@ -30098,13 +30173,13 @@ function createGitRegistry(options) {
30098
30173
  return new GitRegistry(options);
30099
30174
  }
30100
30175
  async function validateRemoteAccess(repoUrl, ref) {
30101
- const git = simpleGit();
30176
+ const git = simpleGit().env("GIT_TERMINAL_PROMPT", "0").env("GCM_INTERACTIVE", "never");
30102
30177
  try {
30103
30178
  const isCommit = ref !== void 0 && /^[0-9a-f]{40}$/i.test(ref);
30104
30179
  if (isCommit) {
30105
30180
  const probeDir = await fs2.mkdtemp(join7(tmpdir(), "promptscript-ref-"));
30106
30181
  try {
30107
- const probe = simpleGit(probeDir);
30182
+ const probe = simpleGit(probeDir).env("GIT_TERMINAL_PROMPT", "0").env("GCM_INTERACTIVE", "never");
30108
30183
  await probe.init();
30109
30184
  await probe.addRemote("origin", repoUrl);
30110
30185
  await probe.fetch(["origin", ref, "--depth=1"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptscript/cli",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "description": "CLI for PromptScript - standardize AI instructions across GitHub Copilot, Claude, Cursor and other AI tools",
5
5
  "keywords": [
6
6
  "cli",