getprismo 0.1.58 → 0.1.59
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/lib/prismo-dev/agent.js +1 -0
- package/lib/prismo-dev/cli.js +26 -3
- package/lib/prismo-dev-scan.js +2 -0
- package/package.json +1 -1
package/lib/prismo-dev/agent.js
CHANGED
package/lib/prismo-dev/cli.js
CHANGED
|
@@ -135,6 +135,7 @@ function createCli(deps) {
|
|
|
135
135
|
buildMultiSessionTimeline: _timeline,
|
|
136
136
|
buildSyncPayload,
|
|
137
137
|
loadConfig,
|
|
138
|
+
registerSelfRepair,
|
|
138
139
|
buildReceipt: _receipt,
|
|
139
140
|
buildReplay: _replay,
|
|
140
141
|
runFirewall: _firewall,
|
|
@@ -841,15 +842,37 @@ function createCli(deps) {
|
|
|
841
842
|
else console.log(renderPlannerTerminal(result));
|
|
842
843
|
return;
|
|
843
844
|
}
|
|
845
|
+
const tier = (tierIndex >= 0 ? ownArgs[tierIndex + 1] : null) || "mild";
|
|
844
846
|
const result = await runRepair(target, cause, {
|
|
845
847
|
limit: parsePositiveInt(limitIndex >= 0 ? ownArgs[limitIndex + 1] : null, 5),
|
|
846
848
|
tokenBudget: parseTokenBudget(budgetIndex >= 0 ? ownArgs[budgetIndex + 1] : null),
|
|
847
849
|
scope: scopeIndex >= 0 ? ownArgs[scopeIndex + 1] : null,
|
|
848
|
-
tier
|
|
850
|
+
tier,
|
|
849
851
|
commandArgs,
|
|
850
852
|
});
|
|
851
|
-
|
|
852
|
-
|
|
853
|
+
// Register a completed manual repair with the cloud so the backend
|
|
854
|
+
// verification loop measures it like a dashboard-queued repair —
|
|
855
|
+
// otherwise hand-run repairs never become verified savings.
|
|
856
|
+
let registered = false;
|
|
857
|
+
if (result.status === "completed" && typeof registerSelfRepair === "function") {
|
|
858
|
+
const config = loadConfig();
|
|
859
|
+
if (config && config.token) {
|
|
860
|
+
registered = await registerSelfRepair(config, {
|
|
861
|
+
generatedAt: result.generatedAt,
|
|
862
|
+
decision: { cause: result.cause, tier },
|
|
863
|
+
outcome: {
|
|
864
|
+
status: result.status,
|
|
865
|
+
statusMessage: result.statusMessage,
|
|
866
|
+
generatedFiles: (result.result && result.result.generatedFiles) || [],
|
|
867
|
+
},
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
if (json) console.log(JSON.stringify({ ...result, registered }, null, 2));
|
|
872
|
+
else {
|
|
873
|
+
console.log(renderRepairTerminal(result));
|
|
874
|
+
if (registered) console.log("\nReported to Prismo Cloud — savings will verify as new sessions come in.");
|
|
875
|
+
}
|
|
853
876
|
if (result.status === "failed") process.exitCode = 1;
|
|
854
877
|
return;
|
|
855
878
|
}
|
package/lib/prismo-dev-scan.js
CHANGED
|
@@ -383,6 +383,7 @@ const {
|
|
|
383
383
|
const {
|
|
384
384
|
renderAgentTerminal,
|
|
385
385
|
runAgent,
|
|
386
|
+
registerSelfRepair,
|
|
386
387
|
VALID_MODES: AGENT_VALID_MODES,
|
|
387
388
|
} = require("./prismo-dev/agent")({
|
|
388
389
|
fs,
|
|
@@ -479,6 +480,7 @@ const { runCli } = require("./prismo-dev/cli")({
|
|
|
479
480
|
NPX_COMMAND,
|
|
480
481
|
DEFAULT_PRISMO_PROXY_URL,
|
|
481
482
|
AGENT_VALID_MODES,
|
|
483
|
+
registerSelfRepair,
|
|
482
484
|
openUrl,
|
|
483
485
|
printStep,
|
|
484
486
|
getPositionals,
|
package/package.json
CHANGED