@ouro.bot/cli 0.1.0-alpha.710 → 0.1.0-alpha.712
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/changelog.json +13 -0
- package/dist/repertoire/bitwarden-store.js +37 -13
- package/dist/rsvp/cli.js +9 -6
- package/dist/rsvp/diff-renderer.js +1 -3
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.712",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Render native RSVP habit updates without script-era first-check/disclaimer copy.",
|
|
8
|
+
"Use the native outbound RSVP baseline as the diff baseline when legacy baseline state is absent."
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"version": "0.1.0-alpha.711",
|
|
13
|
+
"changes": [
|
|
14
|
+
"Allow structured Bitwarden slash-name lookup to ignore malformed unrelated vault items while still failing malformed exact matches."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
4
17
|
{
|
|
5
18
|
"version": "0.1.0-alpha.710",
|
|
6
19
|
"changes": [
|
|
@@ -417,25 +417,44 @@ function isBwLoginItem(value) {
|
|
|
417
417
|
return false;
|
|
418
418
|
return true;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function parseBwItemArray(stdout, context) {
|
|
421
421
|
let parsed;
|
|
422
422
|
try {
|
|
423
423
|
parsed = JSON.parse(stdout);
|
|
424
424
|
if (!Array.isArray(parsed)) {
|
|
425
425
|
throw new Error("expected item array");
|
|
426
426
|
}
|
|
427
|
-
const items = parsed;
|
|
428
|
-
if (!items.every(isBwLoginItem)) {
|
|
429
|
-
throw new Error("expected login items");
|
|
430
|
-
}
|
|
431
|
-
return items;
|
|
432
427
|
}
|
|
433
428
|
catch {
|
|
434
|
-
if (Array.isArray(parsed)) {
|
|
435
|
-
throw new Error(`bw CLI error: invalid item from ${context}`);
|
|
436
|
-
}
|
|
437
429
|
throw new Error(`bw CLI error: invalid JSON from ${context}`);
|
|
438
430
|
}
|
|
431
|
+
return parsed;
|
|
432
|
+
}
|
|
433
|
+
function parseBwItems(stdout, context) {
|
|
434
|
+
const items = parseBwItemArray(stdout, context);
|
|
435
|
+
if (!items.every(isBwLoginItem)) {
|
|
436
|
+
throw new Error(`bw CLI error: invalid item from ${context}`);
|
|
437
|
+
}
|
|
438
|
+
return items;
|
|
439
|
+
}
|
|
440
|
+
function parseStructuredBwItems(stdout, context) {
|
|
441
|
+
const rawItems = parseBwItemArray(stdout, context);
|
|
442
|
+
const items = new Map();
|
|
443
|
+
const malformedNames = new Set();
|
|
444
|
+
for (const rawItem of rawItems) {
|
|
445
|
+
if (!rawItem || typeof rawItem !== "object" || Array.isArray(rawItem))
|
|
446
|
+
continue;
|
|
447
|
+
const name = rawItem.name;
|
|
448
|
+
if (typeof name !== "string" || name.trim().length === 0)
|
|
449
|
+
continue;
|
|
450
|
+
if (isBwLoginItem(rawItem)) {
|
|
451
|
+
items.set(name, rawItem);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
malformedNames.add(name);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return { items, malformedNames };
|
|
439
458
|
}
|
|
440
459
|
function parseBwItem(stdout, context) {
|
|
441
460
|
let parsed;
|
|
@@ -944,8 +963,14 @@ class BitwardenCredentialStore {
|
|
|
944
963
|
// --- Private ---
|
|
945
964
|
async findItemByDomain(domain, session) {
|
|
946
965
|
if (shouldUseStructuredItemLookup(domain)) {
|
|
947
|
-
const
|
|
948
|
-
|
|
966
|
+
const cache = await this.readStructuredItemCache(session);
|
|
967
|
+
if (cache.malformedNames.has(domain)) {
|
|
968
|
+
throw new Error("bw CLI error: invalid item from bw list items");
|
|
969
|
+
}
|
|
970
|
+
const item = cache.items.get(domain);
|
|
971
|
+
if (item)
|
|
972
|
+
return item;
|
|
973
|
+
return null;
|
|
949
974
|
}
|
|
950
975
|
const stdout = await this.execBw(["list", "items", "--search", domain], session);
|
|
951
976
|
const items = parseBwItems(stdout, "bw list items --search");
|
|
@@ -995,8 +1020,7 @@ class BitwardenCredentialStore {
|
|
|
995
1020
|
if (this.structuredItemCache)
|
|
996
1021
|
return this.structuredItemCache;
|
|
997
1022
|
const stdout = await this.execBw(["list", "items"], session);
|
|
998
|
-
|
|
999
|
-
this.structuredItemCache = new Map(items.map((item) => [item.name, item]));
|
|
1023
|
+
this.structuredItemCache = parseStructuredBwItems(stdout, "bw list items");
|
|
1000
1024
|
return this.structuredItemCache;
|
|
1001
1025
|
}
|
|
1002
1026
|
assertStoredCredentialMatches(domain, data, item) {
|
package/dist/rsvp/cli.js
CHANGED
|
@@ -167,13 +167,16 @@ function parseSnapshotFromFile(filePath) {
|
|
|
167
167
|
return result.snapshot;
|
|
168
168
|
}
|
|
169
169
|
function readBaselineSnapshot(agentRoot) {
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
? baseline.nativeSnapshotId
|
|
170
|
+
const rsvpRoot = rsvpStateRoot(agentRoot);
|
|
171
|
+
const baselinePath = path.join(rsvpRoot, "baseline.json");
|
|
172
|
+
const legacyBaseline = fs.existsSync(baselinePath) ? readJsonFile(baselinePath) : null;
|
|
173
|
+
const legacySnapshotId = legacyBaseline && typeof legacyBaseline === "object" && !Array.isArray(legacyBaseline)
|
|
174
|
+
? legacyBaseline.nativeSnapshotId
|
|
176
175
|
: null;
|
|
176
|
+
const outboundSnapshotId = (0, outbound_state_1.readRsvpOutboundState)(agentRoot).baseline?.snapshotId;
|
|
177
|
+
const snapshotId = typeof legacySnapshotId === "string"
|
|
178
|
+
? legacySnapshotId
|
|
179
|
+
: outboundSnapshotId;
|
|
177
180
|
return typeof snapshotId === "string" && fs.existsSync(snapshotFilePath(agentRoot, snapshotId))
|
|
178
181
|
? parseSnapshotFromFile(snapshotFilePath(agentRoot, snapshotId))
|
|
179
182
|
: null;
|
|
@@ -4,7 +4,6 @@ exports.guestDisplayName = guestDisplayName;
|
|
|
4
4
|
exports.computeRsvpDelta = computeRsvpDelta;
|
|
5
5
|
exports.renderRsvpReport = renderRsvpReport;
|
|
6
6
|
const runtime_1 = require("../nerves/runtime");
|
|
7
|
-
const RSVP_REPORT_FOOTER = "🤖 Beep boop! I'm a script, not Slugger — no need to reply here!";
|
|
8
7
|
function byId(left, right) {
|
|
9
8
|
return left.id.localeCompare(right.id);
|
|
10
9
|
}
|
|
@@ -109,7 +108,7 @@ function hasChanges(delta) {
|
|
|
109
108
|
function renderRsvpReport(delta) {
|
|
110
109
|
const lines = ["RSVP Update — Ari & Rachel", ""];
|
|
111
110
|
if (delta.isFirstRun) {
|
|
112
|
-
lines.push("
|
|
111
|
+
lines.push("Current RSVP summary:", "");
|
|
113
112
|
}
|
|
114
113
|
else if (!hasChanges(delta)) {
|
|
115
114
|
lines.push("No changes since last check.", "");
|
|
@@ -145,7 +144,6 @@ function renderRsvpReport(delta) {
|
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
lines.push(summaryLine(delta.summary));
|
|
148
|
-
lines.push("", RSVP_REPORT_FOOTER);
|
|
149
147
|
const report = lines.join("\n");
|
|
150
148
|
(0, runtime_1.emitNervesEvent)({
|
|
151
149
|
component: "rsvp",
|