guardian-framework 0.1.49 → 0.1.51

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/dist/cli.js CHANGED
@@ -1335,7 +1335,7 @@ __export(exports_package, {
1335
1335
  bin: () => bin,
1336
1336
  author: () => author
1337
1337
  });
1338
- var name = "guardian-framework", version = "0.1.49", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
1338
+ var name = "guardian-framework", version = "0.1.51", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
1339
1339
  var init_package = __esm(() => {
1340
1340
  exports = {
1341
1341
  ".": {
package/dist/exports.js CHANGED
@@ -995,7 +995,7 @@ __export(exports_package, {
995
995
  bin: () => bin,
996
996
  author: () => author
997
997
  });
998
- var name = "guardian-framework", version = "0.1.49", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
998
+ var name = "guardian-framework", version = "0.1.51", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
999
999
  var init_package = __esm(() => {
1000
1000
  exports = {
1001
1001
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardian-framework",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "Token-optimized agentic framework scaffolder with pi-first architecture",
5
5
  "type": "module",
6
6
  "main": "dist/exports.js",
@@ -22,13 +22,13 @@ import {
22
22
  readRepository,
23
23
  readRepoTool,
24
24
  runScript,
25
- } from "./architect-lib/helpers.ts";
25
+ } from "./architect-lib/helpers";
26
26
  import {
27
27
  generateArchitectureReadinessMarkdown,
28
28
  generateContractFreezeMarkdown,
29
29
  generateIssueMarkdown,
30
30
  generateProofingMarkdown,
31
- } from "./architect-lib/generators.ts";
31
+ } from "./architect-lib/generators";
32
32
 
33
33
  // ── Epic State Persistence ──
34
34
 
@@ -19,8 +19,18 @@ import * as child_process from "node:child_process";
19
19
  import * as crypto from "node:crypto";
20
20
  import * as fs from "node:fs";
21
21
  import * as path from "node:path";
22
+ // @ts-ignore — typebox is provided at runtime by pi
22
23
  import { Type } from "typebox";
23
24
 
25
+ // Strip markdown formatting (**bold**, *italic*, `code`) from a string
26
+ function stripMarkdown(text: string): string {
27
+ return text
28
+ .replace(/\*\*(.+?)\*\*/g, "$1")
29
+ .replace(/\*(.+?)\*/g, "$1")
30
+ .replace(/`(.+?)`/g, "$1")
31
+ .trim();
32
+ }
33
+
24
34
  // ── Minimal pi ExtensionAPI types (same pattern as coordinator.ts) ──
25
35
 
26
36
  type ShellResult = {
@@ -45,6 +55,24 @@ type ExtensionContext = {
45
55
  * Execute a shell command, preferring ctx.shell if available,
46
56
  * falling back to child_process.execSync otherwise.
47
57
  */
58
+ function readLanguage(cwd: string): string {
59
+ try {
60
+ const manifestPath = path.join(cwd, "guardian-manifest.json");
61
+ if (fs.existsSync(manifestPath)) {
62
+ const data = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
63
+ if (data.language) return data.language;
64
+ }
65
+ const piManifestPath = path.join(cwd, ".pi", "guardian-manifest.json");
66
+ if (fs.existsSync(piManifestPath)) {
67
+ const data = JSON.parse(fs.readFileSync(piManifestPath, "utf-8"));
68
+ if (data.language) return data.language;
69
+ }
70
+ } catch {
71
+ // ignore
72
+ }
73
+ return "typescript";
74
+ }
75
+
48
76
  function shellExec(
49
77
  ctx: ExtensionContext,
50
78
  command: string,
@@ -285,7 +313,7 @@ export default function (pi: ExtensionAPI) {
285
313
 
286
314
  function toRow(arr: unknown[], fields: string[]): string {
287
315
  if (!Array.isArray(arr) || arr.length === 0) return "None identified yet.";
288
- return arr.map((item: Record<string, unknown>) => {
316
+ return (arr as Record<string, unknown>[]).map((item) => {
289
317
  const vals = fields.map((f) => String(item[f] ?? "").replace(/\n/g, " "));
290
318
  return "| " + vals.join(" | ") + " |";
291
319
  }).join("\n");
@@ -376,7 +404,7 @@ export default function (pi: ExtensionAPI) {
376
404
  }
377
405
  }
378
406
 
379
- onUpdate({ content: [{ type: "text", text: "Domain exploration saved for session: " + sessionId }] });
407
+ onUpdate({ type: "update", message: "Domain exploration saved for session: " + sessionId });
380
408
  return { content: [{ type: "text" as const, text: "Domain exploration saved for " + sessionId + ". Next: /domain --architect-scaffold " + sessionId + " or review .pi/domain/exploration.md" }] };
381
409
  },
382
410
  });
@@ -724,14 +752,7 @@ export default function (pi: ExtensionAPI) {
724
752
  }
725
753
 
726
754
  // Parse bounded context names from (now synced) session content
727
- // Strip markdown formatting (**bold**, *italic*, `code`) from a string
728
- function stripMarkdown(text: string): string {
729
- return text
730
- .replace(/\*\*(.+?)\*\*/g, "$1")
731
- .replace(/\*(.+?)\*/g, "$1")
732
- .replace(/`(.+?)`/g, "$1")
733
- .trim();
734
- }
755
+ // stripMarkdown moved to module level to avoid ES5 strict mode issue
735
756
 
736
757
  const bcNames: string[] = [];
737
758
  const sourceForBC = analysisContent || sessionContent;
@@ -527,10 +527,6 @@ class PipelineManager {
527
527
  return this.state;
528
528
  }
529
529
 
530
- getState(): PipelineState | null {
531
- return this.state;
532
- }
533
-
534
530
  create(
535
531
  name: string,
536
532
  items: string[],
@@ -1107,7 +1103,8 @@ export default function (pi: ExtensionAPI) {
1107
1103
  return { content: [{ type: "text" as const, text: "No steps specified." }] };
1108
1104
  }
1109
1105
 
1110
- const state = manager.create(name, items, steps, { mergeOnValid: !!params.mergeOnValid });
1106
+ const stepConfigs = buildSteps(steps);
1107
+ const state = manager.create(name, items, stepConfigs, { mergeOnValid: !!params.mergeOnValid });
1111
1108
  ctx.ui.setStatus(
1112
1109
  "pipeline",
1113
1110
  `▶ ${name} (${state.items.length} items × ${state.steps.length} steps)`,
@@ -1258,6 +1255,10 @@ export default function (pi: ExtensionAPI) {
1258
1255
  return { content: [{ type: "text" as const, text: lines.join("\n") }] };
1259
1256
  }
1260
1257
 
1258
+ if (acceptance.type !== "validator") {
1259
+ return { content: [{ type: "text" as const, text: "Unknown acceptance type: " + acceptance.type }] };
1260
+ }
1261
+
1261
1262
  const lines: string[] = ["## Acceptance Gate: " + step.name + "\n"];
1262
1263
  let allPassed = true;
1263
1264
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-07-04T10:41:45Z",
2
+ "timestamp": "2026-07-04T10:54:40Z",
3
3
  "mode": "all",
4
4
  "stages_run": [],
5
5
  "summary": {
@@ -92,6 +92,12 @@ Each step can have a different acceptance condition:
92
92
  | `pipeline_advance` | Mark current step as passed and advance |
93
93
  | `pipeline_fail` | Mark current step as failed, skip remaining steps for this item |
94
94
 
95
+ ## Behavioral Rules
96
+
97
+ → Auto-advance: pipeline_advance (no asking)│
98
+
99
+ After completing any pipeline step, call `pipeline_advance` immediately without asking the user. The next step is already defined in the pipeline state — just advance and continue the loop.
100
+
95
101
  ## Pipeline States
96
102
 
97
103
  ```