guardian-framework 0.1.64 → 0.1.66
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 -13
- package/dist/exports.js +33 -12
- 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,10 @@ function calculateTokenStats(targetDir, manifest) {
|
|
|
3099
3118
|
lastCalculatedAt: new Date().toISOString()
|
|
3100
3119
|
};
|
|
3101
3120
|
}
|
|
3102
|
-
var _filename,
|
|
3121
|
+
var _filename, 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
|
+
FRAMEWORK_VERSION = loadFrameworkVersion();
|
|
3106
3125
|
});
|
|
3107
3126
|
|
|
3108
3127
|
// src/lib/retry.ts
|
|
@@ -3129,7 +3148,7 @@ function calculateBackoff(attempt, baseDelayMs, maxBackoffMs) {
|
|
|
3129
3148
|
return Math.min(delay, maxBackoffMs);
|
|
3130
3149
|
}
|
|
3131
3150
|
function sleep(ms) {
|
|
3132
|
-
return new Promise((
|
|
3151
|
+
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
3133
3152
|
}
|
|
3134
3153
|
var DEFAULT_OPTIONS;
|
|
3135
3154
|
var init_retry = __esm(() => {
|
|
@@ -3178,7 +3197,7 @@ __export(exports_package, {
|
|
|
3178
3197
|
bin: () => bin,
|
|
3179
3198
|
author: () => author
|
|
3180
3199
|
});
|
|
3181
|
-
var name = "guardian-framework", version = "0.1.
|
|
3200
|
+
var name = "guardian-framework", version = "0.1.66", 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
3201
|
var init_package = __esm(() => {
|
|
3183
3202
|
exports = {
|
|
3184
3203
|
".": {
|
|
@@ -10657,7 +10676,7 @@ import * as child_process from "child_process";
|
|
|
10657
10676
|
import * as fs6 from "fs";
|
|
10658
10677
|
async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
10659
10678
|
const startTime = Date.now();
|
|
10660
|
-
return new Promise((
|
|
10679
|
+
return new Promise((resolve5) => {
|
|
10661
10680
|
const proc = child_process.spawn("bash", ["-lc", script], {
|
|
10662
10681
|
cwd: workspacePath,
|
|
10663
10682
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -10698,7 +10717,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
10698
10717
|
clearTimeout(hardTimer);
|
|
10699
10718
|
if (stallTimer)
|
|
10700
10719
|
clearTimeout(stallTimer);
|
|
10701
|
-
|
|
10720
|
+
resolve5({
|
|
10702
10721
|
success: code === 0,
|
|
10703
10722
|
exitCode: code ?? 1,
|
|
10704
10723
|
stdout: stdout2.trim(),
|
|
@@ -10710,7 +10729,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
10710
10729
|
clearTimeout(hardTimer);
|
|
10711
10730
|
if (stallTimer)
|
|
10712
10731
|
clearTimeout(stallTimer);
|
|
10713
|
-
|
|
10732
|
+
resolve5({
|
|
10714
10733
|
success: false,
|
|
10715
10734
|
exitCode: 1,
|
|
10716
10735
|
stdout: "",
|
|
@@ -14454,6 +14473,7 @@ init_update();
|
|
|
14454
14473
|
// src/commands/upgrade.ts
|
|
14455
14474
|
init_dist4();
|
|
14456
14475
|
init_manifest();
|
|
14476
|
+
init_update();
|
|
14457
14477
|
async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
14458
14478
|
const manifest = readManifest(targetDir);
|
|
14459
14479
|
if (!manifest) {
|
|
@@ -14462,10 +14482,11 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14462
14482
|
}
|
|
14463
14483
|
const currentSchema = manifest.schemaVersion ?? "unknown";
|
|
14464
14484
|
const currentFramework = manifest.frameworkVersion ?? "unknown";
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14485
|
+
await runUpdate(targetDir, {
|
|
14486
|
+
dryRun: options.dryRun,
|
|
14487
|
+
force: options.force,
|
|
14488
|
+
regenerate: options.regenerate
|
|
14489
|
+
});
|
|
14469
14490
|
const migrations = [];
|
|
14470
14491
|
if (currentSchema !== SCHEMA_VERSION) {
|
|
14471
14492
|
migrations.push(`Schema: ${currentSchema} \u2192 ${SCHEMA_VERSION}`);
|
|
@@ -14477,7 +14498,7 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14477
14498
|
migrations.push(`Framework: ${currentFramework} \u2192 ${FRAMEWORK_VERSION}`);
|
|
14478
14499
|
}
|
|
14479
14500
|
if (migrations.length === 0) {
|
|
14480
|
-
outro("
|
|
14501
|
+
outro("Project is on the latest version. Template files synced.");
|
|
14481
14502
|
return;
|
|
14482
14503
|
}
|
|
14483
14504
|
if (options.dryRun) {
|
|
@@ -15257,7 +15278,9 @@ async function runCommand(command, args) {
|
|
|
15257
15278
|
break;
|
|
15258
15279
|
case "upgrade":
|
|
15259
15280
|
await runUpgrade(targetDir, {
|
|
15260
|
-
dryRun: args.values.dryRun
|
|
15281
|
+
dryRun: args.values.dryRun,
|
|
15282
|
+
force: args.values.force,
|
|
15283
|
+
regenerate: args.values.regenerate
|
|
15261
15284
|
});
|
|
15262
15285
|
break;
|
|
15263
15286
|
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,10 @@ function calculateTokenStats(targetDir, manifest) {
|
|
|
1919
1938
|
lastCalculatedAt: new Date().toISOString()
|
|
1920
1939
|
};
|
|
1921
1940
|
}
|
|
1922
|
-
var _filename,
|
|
1941
|
+
var _filename, 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
|
+
FRAMEWORK_VERSION = loadFrameworkVersion();
|
|
1926
1945
|
});
|
|
1927
1946
|
|
|
1928
1947
|
// src/lib/result.ts
|
|
@@ -1963,7 +1982,7 @@ __export(exports_package, {
|
|
|
1963
1982
|
bin: () => bin,
|
|
1964
1983
|
author: () => author
|
|
1965
1984
|
});
|
|
1966
|
-
var name = "guardian-framework", version = "0.1.
|
|
1985
|
+
var name = "guardian-framework", version = "0.1.66", 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
1986
|
var init_package = __esm(() => {
|
|
1968
1987
|
exports = {
|
|
1969
1988
|
".": {
|
|
@@ -2668,7 +2687,7 @@ function calculateBackoff(attempt, baseDelayMs, maxBackoffMs) {
|
|
|
2668
2687
|
return Math.min(delay, maxBackoffMs);
|
|
2669
2688
|
}
|
|
2670
2689
|
function sleep(ms) {
|
|
2671
|
-
return new Promise((
|
|
2690
|
+
return new Promise((resolve3) => setTimeout(resolve3, ms));
|
|
2672
2691
|
}
|
|
2673
2692
|
var DEFAULT_OPTIONS;
|
|
2674
2693
|
var init_retry = __esm(() => {
|
|
@@ -9781,7 +9800,7 @@ import * as child_process from "node:child_process";
|
|
|
9781
9800
|
import * as fs4 from "node:fs";
|
|
9782
9801
|
async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
9783
9802
|
const startTime = Date.now();
|
|
9784
|
-
return new Promise((
|
|
9803
|
+
return new Promise((resolve3) => {
|
|
9785
9804
|
const proc = child_process.spawn("bash", ["-lc", script], {
|
|
9786
9805
|
cwd: workspacePath,
|
|
9787
9806
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -9822,7 +9841,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
9822
9841
|
clearTimeout(hardTimer);
|
|
9823
9842
|
if (stallTimer)
|
|
9824
9843
|
clearTimeout(stallTimer);
|
|
9825
|
-
|
|
9844
|
+
resolve3({
|
|
9826
9845
|
success: code === 0,
|
|
9827
9846
|
exitCode: code ?? 1,
|
|
9828
9847
|
stdout: stdout2.trim(),
|
|
@@ -9834,7 +9853,7 @@ async function executeHook(hookName, script, workspacePath, timeoutMs) {
|
|
|
9834
9853
|
clearTimeout(hardTimer);
|
|
9835
9854
|
if (stallTimer)
|
|
9836
9855
|
clearTimeout(stallTimer);
|
|
9837
|
-
|
|
9856
|
+
resolve3({
|
|
9838
9857
|
success: false,
|
|
9839
9858
|
exitCode: 1,
|
|
9840
9859
|
stdout: "",
|
|
@@ -14122,6 +14141,7 @@ function collectDirectoriesToPrune(files2) {
|
|
|
14122
14141
|
// src/commands/upgrade.ts
|
|
14123
14142
|
init_dist4();
|
|
14124
14143
|
init_manifest();
|
|
14144
|
+
init_update();
|
|
14125
14145
|
async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
14126
14146
|
const manifest = readManifest(targetDir);
|
|
14127
14147
|
if (!manifest) {
|
|
@@ -14130,10 +14150,11 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14130
14150
|
}
|
|
14131
14151
|
const currentSchema = manifest.schemaVersion ?? "unknown";
|
|
14132
14152
|
const currentFramework = manifest.frameworkVersion ?? "unknown";
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14153
|
+
await runUpdate(targetDir, {
|
|
14154
|
+
dryRun: options.dryRun,
|
|
14155
|
+
force: options.force,
|
|
14156
|
+
regenerate: options.regenerate
|
|
14157
|
+
});
|
|
14137
14158
|
const migrations = [];
|
|
14138
14159
|
if (currentSchema !== SCHEMA_VERSION) {
|
|
14139
14160
|
migrations.push(`Schema: ${currentSchema} → ${SCHEMA_VERSION}`);
|
|
@@ -14145,7 +14166,7 @@ async function runUpgrade(targetDir = process.cwd(), options = {}) {
|
|
|
14145
14166
|
migrations.push(`Framework: ${currentFramework} → ${FRAMEWORK_VERSION}`);
|
|
14146
14167
|
}
|
|
14147
14168
|
if (migrations.length === 0) {
|
|
14148
|
-
outro("
|
|
14169
|
+
outro("Project is on the latest version. Template files synced.");
|
|
14149
14170
|
return;
|
|
14150
14171
|
}
|
|
14151
14172
|
if (options.dryRun) {
|
package/package.json
CHANGED