getprismo 0.1.61 → 0.1.62
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/cloud-sync.js +39 -0
- package/package.json +1 -1
|
@@ -187,6 +187,44 @@ module.exports = function createCloudSync(deps) {
|
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
// Read generated context-pack receipts so the dashboard can show each pack's
|
|
191
|
+
// provenance (included/excluded roots, git state, staleness). Receipts carry
|
|
192
|
+
// no source or prompts — only the trust-boundary metadata.
|
|
193
|
+
function readContextPackReceipts(root) {
|
|
194
|
+
const dir = path.join(root, ".prismo");
|
|
195
|
+
let names;
|
|
196
|
+
try {
|
|
197
|
+
names = fs.readdirSync(dir).filter((name) => name.endsWith(".receipt.json"));
|
|
198
|
+
} catch {
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
const packs = [];
|
|
202
|
+
for (const name of names.slice(0, 50)) {
|
|
203
|
+
try {
|
|
204
|
+
const r = JSON.parse(fs.readFileSync(path.join(dir, name), "utf8"));
|
|
205
|
+
if (!r || !r.pack_id) continue;
|
|
206
|
+
packs.push({
|
|
207
|
+
pack_id: r.pack_id,
|
|
208
|
+
pack_path: r.pack_path || null,
|
|
209
|
+
included_source_roots: Array.isArray(r.included_source_roots) ? r.included_source_roots : [],
|
|
210
|
+
excluded_roots: Array.isArray(r.excluded_roots) ? r.excluded_roots : [],
|
|
211
|
+
repo_ref: r.repo_ref || null,
|
|
212
|
+
target_agents: Array.isArray(r.target_agents) ? r.target_agents : [],
|
|
213
|
+
estimated_pack_tokens: typeof r.estimated_pack_tokens === "number" ? r.estimated_pack_tokens : null,
|
|
214
|
+
token_budget: typeof r.token_budget === "number" ? r.token_budget : null,
|
|
215
|
+
stale_if_older_than_ms: typeof r.stale_if_older_than_ms === "number" ? r.stale_if_older_than_ms : null,
|
|
216
|
+
source_globs_digest: r.source_globs_digest || null,
|
|
217
|
+
verify_command: r.verify_command || null,
|
|
218
|
+
prismo_version: r.prismo_version || null,
|
|
219
|
+
generated_at: r.generated_at || null,
|
|
220
|
+
});
|
|
221
|
+
} catch {
|
|
222
|
+
// skip an unreadable receipt
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return packs;
|
|
226
|
+
}
|
|
227
|
+
|
|
190
228
|
function buildSyncPayload(rootDir = process.cwd(), options = {}) {
|
|
191
229
|
const root = path.resolve(rootDir);
|
|
192
230
|
const allRepos = Boolean(options.allRepos);
|
|
@@ -269,6 +307,7 @@ module.exports = function createCloudSync(deps) {
|
|
|
269
307
|
} : null,
|
|
270
308
|
aggregate,
|
|
271
309
|
sessions,
|
|
310
|
+
contextPacks: readContextPackReceipts(root),
|
|
272
311
|
privacy: {
|
|
273
312
|
rawPrompts: false,
|
|
274
313
|
rawCode: false,
|
package/package.json
CHANGED