guardian-framework 0.1.64 → 0.1.65
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 +36 -12
- package/dist/exports.js +33 -11
- package/package.json +1 -1
- package/templates/pi/preflight_report.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2930,6 +2930,25 @@ import * as crypto2 from "crypto";
|
|
|
2930
2930
|
import * as fs3 from "fs";
|
|
2931
2931
|
import * as path4 from "path";
|
|
2932
2932
|
import { fileURLToPath } from "url";
|
|
2933
|
+
function loadFrameworkVersion() {
|
|
2934
|
+
if (_cachedVersion)
|
|
2935
|
+
return _cachedVersion;
|
|
2936
|
+
try {
|
|
2937
|
+
const dir = path4.dirname(_filename);
|
|
2938
|
+
const candidates = [
|
|
2939
|
+
path4.resolve(dir, "..", "..", "package.json"),
|
|
2940
|
+
path4.resolve(dir, "..", "package.json")
|
|
2941
|
+
];
|
|
2942
|
+
for (const candidate of candidates) {
|
|
2943
|
+
if (fs3.existsSync(candidate)) {
|
|
2944
|
+
_cachedVersion = JSON.parse(fs3.readFileSync(candidate, "utf-8")).version;
|
|
2945
|
+
return _cachedVersion;
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
} catch {}
|
|
2949
|
+
_cachedVersion = "0.0.0";
|
|
2950
|
+
return _cachedVersion;
|
|
2951
|
+
}
|
|
2933
2952
|
function hashFile(filePath) {
|
|
2934
2953
|
if (!fs3.existsSync(filePath)) {
|
|
2935
2954
|
return "";
|
|
@@ -3099,10 +3118,11 @@ function calculateTokenStats(targetDir, manifest) {
|
|
|
3099
3118
|
lastCalculatedAt: new Date().toISOString()
|
|
3100
3119
|
};
|
|
3101
3120
|
}
|
|
3102
|
-
var _filename, _dirname, MANIFEST_FILE = "guardian-manifest.json", FRAMEWORK_VERSION
|
|
3121
|
+
var _filename, _dirname, MANIFEST_FILE = "guardian-manifest.json", _cachedVersion, FRAMEWORK_VERSION, SCHEMA_VERSION = "0.1";
|
|
3103
3122
|
var init_manifest = __esm(() => {
|
|
3104
3123
|
_filename = fileURLToPath(import.meta.url);
|
|
3105
3124
|
_dirname = path4.dirname(_filename);
|
|
3125
|
+
FRAMEWORK_VERSION = loadFrameworkVersion();
|
|
3106
3126
|
});
|
|
3107
3127
|
|
|
3108
3128
|
// src/lib/retry.ts
|
|
@@ -3129,7 +3149,7 @@ function calculateBackoff(attempt, baseDelayMs, maxBackoffMs) {
|
|
|
3129
3149
|
return Math.min(delay, maxBackoffMs);
|
|
3130
3150
|
}
|
|
3131
3151
|
function sleep(ms) {
|
|
3132
|
-
return new Promise((
|
|
3152
|
+
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
3133
3153
|
}
|
|
3134
3154
|
var DEFAULT_OPTIONS;
|
|
3135
3155
|
var init_retry = __esm(() => {
|
|
@@ -3178,7 +3198,7 @@ __export(exports_package, {
|
|
|
3178
3198
|
bin: () => bin,
|
|
3179
3199
|
author: () => author
|
|
3180
3200
|
});
|
|
3181
|
-
var name = "guardian-framework", version = "0.1.
|
|
3201
|
+
var name = "guardian-framework", version = "0.1.65", 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;
|
|
3182
3202
|
var init_package = __esm(() => {
|
|
3183
3203
|
exports = {
|
|
3184
3204
|
".": {
|
|
@@ -10657,7 +10677,7 @@ import * as child_process from "child_process";
|
|
|
10657
10677
|
import * as fs6 from "fs";
|
|
10658
10678
|
async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
10659
10679
|
const startTime = Date.now();
|
|
10660
|
-
return new Promise((
|
|
10680
|
+
return new Promise((resolve5) => {
|
|
10661
10681
|
const proc = child_process.spawn("bash", ["-lc", script], {
|
|
10662
10682
|
cwd: workspacePath,
|
|
10663
10683
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -10698,7 +10718,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
10698
10718
|
clearTimeout(hardTimer);
|
|
10699
10719
|
if (stallTimer)
|
|
10700
10720
|
clearTimeout(stallTimer);
|
|
10701
|
-
|
|
10721
|
+
resolve5({
|
|
10702
10722
|
success: code === 0,
|
|
10703
10723
|
exitCode: code ?? 1,
|
|
10704
10724
|
stdout: stdout2.trim(),
|
|
@@ -10710,7 +10730,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
10710
10730
|
clearTimeout(hardTimer);
|
|
10711
10731
|
if (stallTimer)
|
|
10712
10732
|
clearTimeout(stallTimer);
|
|
10713
|
-
|
|
10733
|
+
resolve5({
|
|
10714
10734
|
success: false,
|
|
10715
10735
|
exitCode: 1,
|
|
10716
10736
|
stdout: "",
|
|
@@ -14454,6 +14474,7 @@ init_update();
|
|
|
14454
14474
|
// src/commands/upgrade.ts
|
|
14455
14475
|
init_dist4();
|
|
14456
14476
|
init_manifest();
|
|
14477
|
+
init_update();
|
|
14457
14478
|
async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
14458
14479
|
const manifest = readManifest(targetDir);
|
|
14459
14480
|
if (!manifest) {
|
|
@@ -14462,10 +14483,11 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14462
14483
|
}
|
|
14463
14484
|
const currentSchema = manifest.schemaVersion ?? "unknown";
|
|
14464
14485
|
const currentFramework = manifest.frameworkVersion ?? "unknown";
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14486
|
+
await runUpdate(targetDir, {
|
|
14487
|
+
dryRun: options.dryRun,
|
|
14488
|
+
force: options.force,
|
|
14489
|
+
regenerate: options.regenerate
|
|
14490
|
+
});
|
|
14469
14491
|
const migrations = [];
|
|
14470
14492
|
if (currentSchema !== SCHEMA_VERSION) {
|
|
14471
14493
|
migrations.push(`Schema: ${currentSchema} \u2192 ${SCHEMA_VERSION}`);
|
|
@@ -14477,7 +14499,7 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14477
14499
|
migrations.push(`Framework: ${currentFramework} \u2192 ${FRAMEWORK_VERSION}`);
|
|
14478
14500
|
}
|
|
14479
14501
|
if (migrations.length === 0) {
|
|
14480
|
-
outro("
|
|
14502
|
+
outro("Project is on the latest version. Template files synced.");
|
|
14481
14503
|
return;
|
|
14482
14504
|
}
|
|
14483
14505
|
if (options.dryRun) {
|
|
@@ -15257,7 +15279,9 @@ async function runCommand(command, args) {
|
|
|
15257
15279
|
break;
|
|
15258
15280
|
case "upgrade":
|
|
15259
15281
|
await runUpgrade(targetDir, {
|
|
15260
|
-
dryRun: args.values.dryRun
|
|
15282
|
+
dryRun: args.values.dryRun,
|
|
15283
|
+
force: args.values.force,
|
|
15284
|
+
regenerate: args.values.regenerate
|
|
15261
15285
|
});
|
|
15262
15286
|
break;
|
|
15263
15287
|
case "uninstall":
|
package/dist/exports.js
CHANGED
|
@@ -1750,6 +1750,25 @@ import * as crypto from "node:crypto";
|
|
|
1750
1750
|
import * as fs from "node:fs";
|
|
1751
1751
|
import * as path from "node:path";
|
|
1752
1752
|
import { fileURLToPath } from "node:url";
|
|
1753
|
+
function loadFrameworkVersion() {
|
|
1754
|
+
if (_cachedVersion)
|
|
1755
|
+
return _cachedVersion;
|
|
1756
|
+
try {
|
|
1757
|
+
const dir = path.dirname(_filename);
|
|
1758
|
+
const candidates = [
|
|
1759
|
+
path.resolve(dir, "..", "..", "package.json"),
|
|
1760
|
+
path.resolve(dir, "..", "package.json")
|
|
1761
|
+
];
|
|
1762
|
+
for (const candidate of candidates) {
|
|
1763
|
+
if (fs.existsSync(candidate)) {
|
|
1764
|
+
_cachedVersion = JSON.parse(fs.readFileSync(candidate, "utf-8")).version;
|
|
1765
|
+
return _cachedVersion;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
} catch {}
|
|
1769
|
+
_cachedVersion = "0.0.0";
|
|
1770
|
+
return _cachedVersion;
|
|
1771
|
+
}
|
|
1753
1772
|
function hashFile(filePath) {
|
|
1754
1773
|
if (!fs.existsSync(filePath)) {
|
|
1755
1774
|
return "";
|
|
@@ -1919,10 +1938,11 @@ function calculateTokenStats(targetDir, manifest) {
|
|
|
1919
1938
|
lastCalculatedAt: new Date().toISOString()
|
|
1920
1939
|
};
|
|
1921
1940
|
}
|
|
1922
|
-
var _filename, _dirname, MANIFEST_FILE = "guardian-manifest.json", FRAMEWORK_VERSION
|
|
1941
|
+
var _filename, _dirname, MANIFEST_FILE = "guardian-manifest.json", _cachedVersion, FRAMEWORK_VERSION, SCHEMA_VERSION = "0.1";
|
|
1923
1942
|
var init_manifest = __esm(() => {
|
|
1924
1943
|
_filename = fileURLToPath(import.meta.url);
|
|
1925
1944
|
_dirname = path.dirname(_filename);
|
|
1945
|
+
FRAMEWORK_VERSION = loadFrameworkVersion();
|
|
1926
1946
|
});
|
|
1927
1947
|
|
|
1928
1948
|
// src/lib/result.ts
|
|
@@ -1963,7 +1983,7 @@ __export(exports_package, {
|
|
|
1963
1983
|
bin: () => bin,
|
|
1964
1984
|
author: () => author
|
|
1965
1985
|
});
|
|
1966
|
-
var name = "guardian-framework", version = "0.1.
|
|
1986
|
+
var name = "guardian-framework", version = "0.1.65", 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;
|
|
1967
1987
|
var init_package = __esm(() => {
|
|
1968
1988
|
exports = {
|
|
1969
1989
|
".": {
|
|
@@ -2668,7 +2688,7 @@ function calculateBackoff(attempt, baseDelayMs, maxBackoffMs) {
|
|
|
2668
2688
|
return Math.min(delay, maxBackoffMs);
|
|
2669
2689
|
}
|
|
2670
2690
|
function sleep(ms) {
|
|
2671
|
-
return new Promise((
|
|
2691
|
+
return new Promise((resolve3) => setTimeout(resolve3, ms));
|
|
2672
2692
|
}
|
|
2673
2693
|
var DEFAULT_OPTIONS;
|
|
2674
2694
|
var init_retry = __esm(() => {
|
|
@@ -9781,7 +9801,7 @@ import * as child_process from "node:child_process";
|
|
|
9781
9801
|
import * as fs4 from "node:fs";
|
|
9782
9802
|
async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
9783
9803
|
const startTime = Date.now();
|
|
9784
|
-
return new Promise((
|
|
9804
|
+
return new Promise((resolve3) => {
|
|
9785
9805
|
const proc = child_process.spawn("bash", ["-lc", script], {
|
|
9786
9806
|
cwd: workspacePath,
|
|
9787
9807
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -9822,7 +9842,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
9822
9842
|
clearTimeout(hardTimer);
|
|
9823
9843
|
if (stallTimer)
|
|
9824
9844
|
clearTimeout(stallTimer);
|
|
9825
|
-
|
|
9845
|
+
resolve3({
|
|
9826
9846
|
success: code === 0,
|
|
9827
9847
|
exitCode: code ?? 1,
|
|
9828
9848
|
stdout: stdout2.trim(),
|
|
@@ -9834,7 +9854,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
9834
9854
|
clearTimeout(hardTimer);
|
|
9835
9855
|
if (stallTimer)
|
|
9836
9856
|
clearTimeout(stallTimer);
|
|
9837
|
-
|
|
9857
|
+
resolve3({
|
|
9838
9858
|
success: false,
|
|
9839
9859
|
exitCode: 1,
|
|
9840
9860
|
stdout: "",
|
|
@@ -14122,6 +14142,7 @@ function collectDirectoriesToPrune(files2) {
|
|
|
14122
14142
|
// src/commands/upgrade.ts
|
|
14123
14143
|
init_dist4();
|
|
14124
14144
|
init_manifest();
|
|
14145
|
+
init_update();
|
|
14125
14146
|
async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
14126
14147
|
const manifest = readManifest(targetDir);
|
|
14127
14148
|
if (!manifest) {
|
|
@@ -14130,10 +14151,11 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14130
14151
|
}
|
|
14131
14152
|
const currentSchema = manifest.schemaVersion ?? "unknown";
|
|
14132
14153
|
const currentFramework = manifest.frameworkVersion ?? "unknown";
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14154
|
+
await runUpdate(targetDir, {
|
|
14155
|
+
dryRun: options.dryRun,
|
|
14156
|
+
force: options.force,
|
|
14157
|
+
regenerate: options.regenerate
|
|
14158
|
+
});
|
|
14137
14159
|
const migrations = [];
|
|
14138
14160
|
if (currentSchema !== SCHEMA_VERSION) {
|
|
14139
14161
|
migrations.push(`Schema: ${currentSchema} → ${SCHEMA_VERSION}`);
|
|
@@ -14145,7 +14167,7 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14145
14167
|
migrations.push(`Framework: ${currentFramework} → ${FRAMEWORK_VERSION}`);
|
|
14146
14168
|
}
|
|
14147
14169
|
if (migrations.length === 0) {
|
|
14148
|
-
outro("
|
|
14170
|
+
outro("Project is on the latest version. Template files synced.");
|
|
14149
14171
|
return;
|
|
14150
14172
|
}
|
|
14151
14173
|
if (options.dryRun) {
|
package/package.json
CHANGED