@icoretech/warden-mcp 0.2.21 → 0.2.22

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.
@@ -115,6 +115,30 @@ function isSshKeyItem(item) {
115
115
  .filter((n) => typeof n === 'string'));
116
116
  return names.has('public_key') && names.has('private_key');
117
117
  }
118
+ function stringValueMatches(value, needle) {
119
+ return typeof value === 'string' && value.toLowerCase().includes(needle);
120
+ }
121
+ function itemMatchesSearchText(item, term) {
122
+ const needle = term.trim().toLowerCase();
123
+ if (needle.length === 0)
124
+ return true;
125
+ if (stringValueMatches(item.name, needle))
126
+ return true;
127
+ const login = item.login;
128
+ if (!login || typeof login !== 'object')
129
+ return false;
130
+ const loginRec = login;
131
+ if (stringValueMatches(loginRec.username, needle))
132
+ return true;
133
+ const uris = loginRec.uris;
134
+ if (!Array.isArray(uris))
135
+ return false;
136
+ return uris.some((rawUri) => {
137
+ if (!rawUri || typeof rawUri !== 'object')
138
+ return false;
139
+ return stringValueMatches(rawUri.uri, needle);
140
+ });
141
+ }
118
142
  export class AmbiguousLoginLookupError extends Error {
119
143
  candidates;
120
144
  constructor(message, candidates) {
@@ -711,7 +735,11 @@ export class KeychainSdk {
711
735
  // NOTE: bw's `--search` does not treat "a | b" as "a OR b". If callers pass
712
736
  // a pipe-delimited string (common when combining name + username), we split
713
737
  // and union the results.
714
- const terms = tokens.length ? tokens : [undefined];
738
+ const terms = input.url
739
+ ? [undefined]
740
+ : tokens.length
741
+ ? tokens
742
+ : [undefined];
715
743
  const byId = new Map();
716
744
  for (const term of terms) {
717
745
  const args = [...baseArgs];
@@ -731,7 +759,17 @@ export class KeychainSdk {
731
759
  }
732
760
  return [...byId.values()];
733
761
  });
734
- const orgFiltered = items.filter((raw) => {
762
+ const textFiltered = input.url
763
+ ? items.filter((raw) => {
764
+ if (tokens.length === 0)
765
+ return true;
766
+ if (!raw || typeof raw !== 'object')
767
+ return false;
768
+ const item = raw;
769
+ return tokens.some((term) => itemMatchesSearchText(item, term));
770
+ })
771
+ : items;
772
+ const orgFiltered = textFiltered.filter((raw) => {
735
773
  if (!raw || typeof raw !== 'object')
736
774
  return false;
737
775
  const item = raw;
@@ -741,6 +779,9 @@ export class KeychainSdk {
741
779
  if (orgFilter === 'notnull') {
742
780
  return typeof item.organizationId === 'string' && item.organizationId;
743
781
  }
782
+ if (typeof orgId === 'string') {
783
+ return item.organizationId === orgId;
784
+ }
744
785
  return true;
745
786
  });
746
787
  const folderFiltered = orgFiltered.filter((raw) => {
@@ -753,9 +794,21 @@ export class KeychainSdk {
753
794
  if (folderFilter === 'notnull') {
754
795
  return typeof item.folderId === 'string' && item.folderId;
755
796
  }
797
+ if (typeof folderId === 'string') {
798
+ return item.folderId === folderId;
799
+ }
756
800
  return true;
757
801
  });
758
- const filtered = folderFiltered.filter((raw) => {
802
+ const collectionFiltered = folderFiltered.filter((raw) => {
803
+ if (!input.collectionId)
804
+ return true;
805
+ if (!raw || typeof raw !== 'object')
806
+ return false;
807
+ const item = raw;
808
+ return (Array.isArray(item.collectionIds) &&
809
+ item.collectionIds.includes(input.collectionId));
810
+ });
811
+ const filtered = collectionFiltered.filter((raw) => {
759
812
  if (!raw || typeof raw !== 'object')
760
813
  return false;
761
814
  const item = raw;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@icoretech/warden-mcp",
4
- "version": "0.2.21",
4
+ "version": "0.2.22",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Vaultwarden/Bitwarden MCP server backed by Bitwarden CLI (bw).",
@@ -56,7 +56,7 @@
56
56
  "@types/express": "^5.0.6",
57
57
  "@types/node": "^25.9.1",
58
58
  "playwright": "1.60.0",
59
- "tsx": "^4.22.3",
59
+ "tsx": "^4.22.4",
60
60
  "typescript": "^6.0.3"
61
61
  },
62
62
  "publishConfig": {