guardian-framework 0.1.2 → 0.1.4
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/README.md
CHANGED
|
@@ -97,13 +97,6 @@ npx guardian-framework init
|
|
|
97
97
|
npm install -g guardian-framework
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
**Pi package** — load extensions, skills, and prompts directly into a [pi](https://github.com/badlogic/pi-mono) session:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
pi install npm:guardian-framework
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
This makes all Guardian slash commands (`/architect`, `/pipeline`, `/goal`, `/domain`, etc.) available inside pi without running `guardian init` first. Run `/guardian-status` after install to check availability.
|
|
107
100
|
|
|
108
101
|
**Prerequisites:** [Bun](https://bun.sh) >= 1.0.0
|
|
109
102
|
|
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.
|
|
1338
|
+
var name = "guardian-framework", version = "0.1.4", 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
|
".": {
|
|
@@ -1346,7 +1346,11 @@ var init_package = __esm(() => {
|
|
|
1346
1346
|
bin = {
|
|
1347
1347
|
"guardian-framework": "./dist/cli.js"
|
|
1348
1348
|
};
|
|
1349
|
-
files = [
|
|
1349
|
+
files = [
|
|
1350
|
+
"dist/",
|
|
1351
|
+
"templates/",
|
|
1352
|
+
"pi-package/"
|
|
1353
|
+
];
|
|
1350
1354
|
engines = {
|
|
1351
1355
|
bun: ">=1.0.0"
|
|
1352
1356
|
};
|
|
@@ -1364,9 +1368,15 @@ var init_package = __esm(() => {
|
|
|
1364
1368
|
access: "public"
|
|
1365
1369
|
};
|
|
1366
1370
|
pi = {
|
|
1367
|
-
extensions: [
|
|
1368
|
-
|
|
1369
|
-
|
|
1371
|
+
extensions: [
|
|
1372
|
+
"./pi-package/extensions"
|
|
1373
|
+
],
|
|
1374
|
+
skills: [
|
|
1375
|
+
"./pi-package/skills"
|
|
1376
|
+
],
|
|
1377
|
+
prompts: [
|
|
1378
|
+
"./pi-package/prompts"
|
|
1379
|
+
]
|
|
1370
1380
|
};
|
|
1371
1381
|
repository = {
|
|
1372
1382
|
type: "git",
|
|
@@ -11393,17 +11403,6 @@ function scaffoldPiDirectory(piDir, context, scaffoldedFiles) {
|
|
|
11393
11403
|
} else {
|
|
11394
11404
|
errors.push(`INDEX.md: ${indexResult.error.message}`);
|
|
11395
11405
|
}
|
|
11396
|
-
const readmePath = path9.join(piDir, "README.md");
|
|
11397
|
-
const readmeResult = readTemplate("README.md");
|
|
11398
|
-
if (readmeResult.ok) {
|
|
11399
|
-
fs11.writeFileSync(readmePath, readmeResult.value, "utf-8");
|
|
11400
|
-
scaffoldedFiles[`${PI_DIR}/README.md`] = {
|
|
11401
|
-
category: "framework",
|
|
11402
|
-
content: readmeResult.value
|
|
11403
|
-
};
|
|
11404
|
-
} else {
|
|
11405
|
-
errors.push(`README.md: ${readmeResult.error.message}`);
|
|
11406
|
-
}
|
|
11407
11406
|
return errors;
|
|
11408
11407
|
}
|
|
11409
11408
|
function shouldSkipFile(relativePath, language) {
|
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.
|
|
998
|
+
var name = "guardian-framework", version = "0.1.4", 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
|
".": {
|
|
@@ -1006,7 +1006,11 @@ var init_package = __esm(() => {
|
|
|
1006
1006
|
bin = {
|
|
1007
1007
|
"guardian-framework": "./dist/cli.js"
|
|
1008
1008
|
};
|
|
1009
|
-
files = [
|
|
1009
|
+
files = [
|
|
1010
|
+
"dist/",
|
|
1011
|
+
"templates/",
|
|
1012
|
+
"pi-package/"
|
|
1013
|
+
];
|
|
1010
1014
|
engines = {
|
|
1011
1015
|
bun: ">=1.0.0"
|
|
1012
1016
|
};
|
|
@@ -1024,9 +1028,15 @@ var init_package = __esm(() => {
|
|
|
1024
1028
|
access: "public"
|
|
1025
1029
|
};
|
|
1026
1030
|
pi = {
|
|
1027
|
-
extensions: [
|
|
1028
|
-
|
|
1029
|
-
|
|
1031
|
+
extensions: [
|
|
1032
|
+
"./pi-package/extensions"
|
|
1033
|
+
],
|
|
1034
|
+
skills: [
|
|
1035
|
+
"./pi-package/skills"
|
|
1036
|
+
],
|
|
1037
|
+
prompts: [
|
|
1038
|
+
"./pi-package/prompts"
|
|
1039
|
+
]
|
|
1030
1040
|
};
|
|
1031
1041
|
repository = {
|
|
1032
1042
|
type: "git",
|
|
@@ -10156,17 +10166,6 @@ function scaffoldPiDirectory(piDir, context, scaffoldedFiles) {
|
|
|
10156
10166
|
} else {
|
|
10157
10167
|
errors.push(`INDEX.md: ${indexResult.error.message}`);
|
|
10158
10168
|
}
|
|
10159
|
-
const readmePath = path6.join(piDir, "README.md");
|
|
10160
|
-
const readmeResult = readTemplate("README.md");
|
|
10161
|
-
if (readmeResult.ok) {
|
|
10162
|
-
fs7.writeFileSync(readmePath, readmeResult.value, "utf-8");
|
|
10163
|
-
scaffoldedFiles[`${PI_DIR}/README.md`] = {
|
|
10164
|
-
category: "framework",
|
|
10165
|
-
content: readmeResult.value
|
|
10166
|
-
};
|
|
10167
|
-
} else {
|
|
10168
|
-
errors.push(`README.md: ${readmeResult.error.message}`);
|
|
10169
|
-
}
|
|
10170
10169
|
return errors;
|
|
10171
10170
|
}
|
|
10172
10171
|
function shouldSkipFile(relativePath, language) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "guardian-framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Token-optimized agentic framework scaffolder with pi-first architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/exports.js",
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"guardian-framework": "./dist/cli.js"
|
|
16
16
|
},
|
|
17
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/",
|
|
19
|
+
"templates/",
|
|
20
|
+
"pi-package/"
|
|
21
|
+
],
|
|
18
22
|
"engines": {
|
|
19
23
|
"bun": ">=1.0.0"
|
|
20
24
|
},
|
|
@@ -32,9 +36,15 @@
|
|
|
32
36
|
"access": "public"
|
|
33
37
|
},
|
|
34
38
|
"pi": {
|
|
35
|
-
"extensions": [
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
"extensions": [
|
|
40
|
+
"./pi-package/extensions"
|
|
41
|
+
],
|
|
42
|
+
"skills": [
|
|
43
|
+
"./pi-package/skills"
|
|
44
|
+
],
|
|
45
|
+
"prompts": [
|
|
46
|
+
"./pi-package/prompts"
|
|
47
|
+
]
|
|
38
48
|
},
|
|
39
49
|
"repository": {
|
|
40
50
|
"type": "git",
|
|
@@ -224,12 +224,28 @@ export function readGroupId(cwd: string): string {
|
|
|
224
224
|
export function findModuleByName(cwd: string, name: string): string | null {
|
|
225
225
|
const files = discoverModules(cwd);
|
|
226
226
|
const nameLower = name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
227
|
+
|
|
228
|
+
// Pass 1: exact match only (preferred)
|
|
227
229
|
for (const f of files) {
|
|
228
230
|
const key = f.replace(".md", "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
229
|
-
if (key === nameLower
|
|
231
|
+
if (key === nameLower) {
|
|
230
232
|
return f;
|
|
231
233
|
}
|
|
232
234
|
}
|
|
235
|
+
|
|
236
|
+
// Pass 2: substring match — only if unambiguous (exactly one match)
|
|
237
|
+
const substringMatches: string[] = [];
|
|
238
|
+
for (const f of files) {
|
|
239
|
+
const key = f.replace(".md", "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
240
|
+
if (nameLower.includes(key) || key.includes(nameLower)) {
|
|
241
|
+
substringMatches.push(f);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (substringMatches.length === 1) {
|
|
245
|
+
return substringMatches[0];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Ambiguous or no match — let caller decide
|
|
233
249
|
return null;
|
|
234
250
|
}
|
|
235
251
|
|
|
@@ -308,12 +308,28 @@ function readGroupId(cwd: string): string {
|
|
|
308
308
|
function findModuleByName(cwd: string, name: string): string | null {
|
|
309
309
|
const files = discoverModules(cwd);
|
|
310
310
|
const nameLower = name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
311
|
+
|
|
312
|
+
// Pass 1: exact match only (preferred)
|
|
311
313
|
for (const f of files) {
|
|
312
314
|
const key = f.replace(".md", "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
313
|
-
if (key === nameLower
|
|
315
|
+
if (key === nameLower) {
|
|
314
316
|
return f;
|
|
315
317
|
}
|
|
316
318
|
}
|
|
319
|
+
|
|
320
|
+
// Pass 2: substring match — only if unambiguous (exactly one match)
|
|
321
|
+
const substringMatches: string[] = [];
|
|
322
|
+
for (const f of files) {
|
|
323
|
+
const key = f.replace(".md", "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
324
|
+
if (nameLower.includes(key) || key.includes(nameLower)) {
|
|
325
|
+
substringMatches.push(f);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (substringMatches.length === 1) {
|
|
329
|
+
return substringMatches[0];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Ambiguous or no match — let caller decide
|
|
317
333
|
return null;
|
|
318
334
|
}
|
|
319
335
|
|
|
@@ -1021,10 +1037,21 @@ class EpicManager {
|
|
|
1021
1037
|
const planned = components.filter((c: ModuleComponent) => c.status === "planned");
|
|
1022
1038
|
if (planned.length > 0) {
|
|
1023
1039
|
slice = { module: matchedModule.replace(".md", ""), components, nextLogicalSlice: planned };
|
|
1040
|
+
} else {
|
|
1041
|
+
ctx.ui.notify(
|
|
1042
|
+
`Module "${matchedModule}" found for epic "${name}" but has no parseable components. ` +
|
|
1043
|
+
`Make sure its \`## Components\` section uses sub-headings (\`### ComponentName\`) with \`status:\` markers. ` +
|
|
1044
|
+
`Falling back to first module with planned components.`,
|
|
1045
|
+
"warn",
|
|
1046
|
+
);
|
|
1024
1047
|
}
|
|
1025
1048
|
}
|
|
1026
1049
|
// Fallback: first module with planned components
|
|
1027
1050
|
if (!slice) {
|
|
1051
|
+
ctx.ui.notify(
|
|
1052
|
+
`No exact module match with planned components for "${name}". Using first available module instead.`,
|
|
1053
|
+
"warn",
|
|
1054
|
+
);
|
|
1028
1055
|
slice = findNextLogicalSlice(this.cwd, moduleFiles);
|
|
1029
1056
|
}
|
|
1030
1057
|
if (!slice) {
|