@ouro.bot/cli 0.1.0-alpha.707 → 0.1.0-alpha.709
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 +12 -0
- package/dist/repertoire/bitwarden-store.js +25 -17
- package/dist/rsvp/cli.js +11 -3
- package/dist/rsvp/cutover.js +4 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
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.709",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Avoid timeout-prone exact Bitwarden get-item lookups for structured runtime credential names by using search plus exact filtering."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.708",
|
|
12
|
+
"changes": [
|
|
13
|
+
"Prefer cached runtime credentials for native RSVP refresh and smoke runs, falling back to vault refresh only on cold start."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.707",
|
|
6
18
|
"changes": [
|
|
@@ -150,10 +150,6 @@ function shouldUseStructuredItemLookup(domain) {
|
|
|
150
150
|
function shouldUseFullListForStructuredLookup(domain, appDataDir) {
|
|
151
151
|
return domain.includes("/") && !appDataDir;
|
|
152
152
|
}
|
|
153
|
-
function isBwItemNotFoundError(error) {
|
|
154
|
-
const message = error.message.toLowerCase();
|
|
155
|
-
return message.includes("not found") || message.includes("no item");
|
|
156
|
-
}
|
|
157
153
|
// ---------------------------------------------------------------------------
|
|
158
154
|
// Cross-process bw CLI lock
|
|
159
155
|
// ---------------------------------------------------------------------------
|
|
@@ -444,6 +440,18 @@ function parseBwItems(stdout, context) {
|
|
|
444
440
|
throw new Error(`bw CLI error: invalid JSON from ${context}`);
|
|
445
441
|
}
|
|
446
442
|
}
|
|
443
|
+
function parseBwSearchItems(stdout, context) {
|
|
444
|
+
try {
|
|
445
|
+
const parsed = JSON.parse(stdout);
|
|
446
|
+
if (!Array.isArray(parsed)) {
|
|
447
|
+
throw new Error("expected item array");
|
|
448
|
+
}
|
|
449
|
+
return parsed;
|
|
450
|
+
}
|
|
451
|
+
catch {
|
|
452
|
+
throw new Error(`bw CLI error: invalid JSON from ${context}`);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
447
455
|
function parseBwItem(stdout, context) {
|
|
448
456
|
let parsed;
|
|
449
457
|
try {
|
|
@@ -948,7 +956,7 @@ class BitwardenCredentialStore {
|
|
|
948
956
|
// --- Private ---
|
|
949
957
|
async findItemByDomain(domain, session, options = {}) {
|
|
950
958
|
if (options.preferExactStructured && shouldUseStructuredItemLookup(domain)) {
|
|
951
|
-
return this.
|
|
959
|
+
return this.findStructuredItemBySearch(domain, session);
|
|
952
960
|
}
|
|
953
961
|
if (shouldUseFullListForStructuredLookup(domain, this.appDataDir)) {
|
|
954
962
|
const items = await this.readStructuredItemCache(session);
|
|
@@ -959,19 +967,19 @@ class BitwardenCredentialStore {
|
|
|
959
967
|
// Find exact match by name
|
|
960
968
|
return items.find((item) => item.name === domain) ?? null;
|
|
961
969
|
}
|
|
962
|
-
async
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
throw err;
|
|
970
|
+
async findStructuredItemBySearch(domain, session) {
|
|
971
|
+
const stdout = await this.execBw(["list", "items", "--search", domain], session);
|
|
972
|
+
const items = parseBwSearchItems(stdout, "bw list items --search");
|
|
973
|
+
const exactItem = items.find((item) => item &&
|
|
974
|
+
typeof item === "object" &&
|
|
975
|
+
!Array.isArray(item) &&
|
|
976
|
+
item.name === domain);
|
|
977
|
+
if (!exactItem)
|
|
978
|
+
return null;
|
|
979
|
+
if (!isBwLoginItem(exactItem)) {
|
|
980
|
+
throw new Error("bw CLI error: invalid item from bw list items --search");
|
|
974
981
|
}
|
|
982
|
+
return exactItem;
|
|
975
983
|
}
|
|
976
984
|
shouldSyncVaultAfterSession(status) {
|
|
977
985
|
if (status.status === "unauthenticated" || !status.status)
|
package/dist/rsvp/cli.js
CHANGED
|
@@ -197,6 +197,14 @@ function resolveLatestSnapshot(agentRoot) {
|
|
|
197
197
|
function machineIdForCli() {
|
|
198
198
|
return (0, machine_identity_1.loadOrCreateMachineIdentity)().machineId;
|
|
199
199
|
}
|
|
200
|
+
async function resolveRsvpRuntimeCredentialConfig(agent) {
|
|
201
|
+
const cached = (0, runtime_credentials_1.readRuntimeCredentialConfig)(agent);
|
|
202
|
+
return cached.ok ? cached : (0, runtime_credentials_1.refreshRuntimeCredentialConfig)(agent, { preserveCachedOnFailure: true });
|
|
203
|
+
}
|
|
204
|
+
async function resolveRsvpMachineRuntimeCredentialConfig(agent) {
|
|
205
|
+
const cached = (0, runtime_credentials_1.readMachineRuntimeCredentialConfig)(agent);
|
|
206
|
+
return cached.ok ? cached : (0, runtime_credentials_1.refreshMachineRuntimeCredentialConfig)(agent, machineIdForCli(), { preserveCachedOnFailure: true });
|
|
207
|
+
}
|
|
200
208
|
function blueBubblesChatFor(config) {
|
|
201
209
|
const sendTarget = config.bluebubblesRoute.chatIdentifier
|
|
202
210
|
? { kind: "chat_identifier", value: config.bluebubblesRoute.chatIdentifier }
|
|
@@ -515,8 +523,8 @@ async function executeRefresh(command, deps) {
|
|
|
515
523
|
result: configResult,
|
|
516
524
|
});
|
|
517
525
|
}
|
|
518
|
-
const runtimeConfig = await (
|
|
519
|
-
const machineRuntimeConfig = await (
|
|
526
|
+
const runtimeConfig = await resolveRsvpRuntimeCredentialConfig(command.agent);
|
|
527
|
+
const machineRuntimeConfig = await resolveRsvpMachineRuntimeCredentialConfig(command.agent);
|
|
520
528
|
const readiness = (0, config_1.validateRsvpReadiness)({
|
|
521
529
|
agent: command.agent,
|
|
522
530
|
agentRoot,
|
|
@@ -703,7 +711,7 @@ async function executeSmoke(command, deps) {
|
|
|
703
711
|
const sendAllowed = wantsLiveSend;
|
|
704
712
|
let delivery;
|
|
705
713
|
if (sendAllowed) {
|
|
706
|
-
const bluebubbles = rsvpBlueBubblesClientConfig(configResult.config, await (
|
|
714
|
+
const bluebubbles = rsvpBlueBubblesClientConfig(configResult.config, await resolveRsvpMachineRuntimeCredentialConfig(command.agent));
|
|
707
715
|
const sent = await (0, client_1.createBlueBubblesClient)(bluebubbles.config, bluebubbles.channelConfig).sendText({
|
|
708
716
|
chat: blueBubblesChatFor(configResult.config),
|
|
709
717
|
text: answer.text,
|
package/dist/rsvp/cutover.js
CHANGED
|
@@ -158,8 +158,10 @@ async function defaultNativeBlueBubblesCredentialHealth(input, deps) {
|
|
|
158
158
|
if (!input.agent) {
|
|
159
159
|
return { ok: false, detail: "native BlueBubbles credential check requires an agent" };
|
|
160
160
|
}
|
|
161
|
-
const
|
|
162
|
-
const runtimeConfig =
|
|
161
|
+
const cachedRuntimeConfig = (0, runtime_credentials_1.readMachineRuntimeCredentialConfig)(input.agent);
|
|
162
|
+
const runtimeConfig = cachedRuntimeConfig.ok
|
|
163
|
+
? cachedRuntimeConfig
|
|
164
|
+
: await (0, runtime_credentials_1.refreshMachineRuntimeCredentialConfig)(input.agent, (0, machine_identity_1.loadOrCreateMachineIdentity)({ homeDir: deps.homeDir() }).machineId, { preserveCachedOnFailure: true });
|
|
163
165
|
if (!runtimeConfig.ok) {
|
|
164
166
|
return { ok: false, detail: "machine runtime/config unavailable" };
|
|
165
167
|
}
|