@ai-matrx/vault 0.1.40 → 0.1.42

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/dist/index.d.cts CHANGED
@@ -1419,4 +1419,5 @@ declare function holdingsDoorIsAbsent(code: string | undefined | null): boolean;
1419
1419
  */
1420
1420
  declare function emptyReadAlarm(total: number, emptyIds: readonly string[], holdings: Holdings): string | null;
1421
1421
 
1422
- export { type ApiVaultPortOptions, BACKUP_PASSPHRASE_MIN_KNOB, CATEGORIES, type CategoryId, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, HOLDINGS_DOOR_MIGRATION, type HoldingRow, type Holdings, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, REVEAL_SECONDS_KNOB, type RowItemAction, type RowMenuEntry, type RowMenuEntryKind, type SaveResult, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCopied, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, VaultIdentity, type VaultInventory, type VaultItem, type VaultItemCapabilities, type VaultKnobs, type VaultLayout, type VaultLocation, type VaultLock, VaultLockedError, type VaultOrganizationRef, type VaultOwner, type VaultPort, type VaultSelection, type VaultSnapshot, type VaultSort, type VaultUserStateDoor, categoryOf, copiedLine, copyValue, createApiVaultPort, createVaultKnobs, emptyReadAlarm, guardPort, holdingsDoorIsAbsent, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, parseDefinitions, positiveKnob, providerOf, rowMenuEntriesAt, siteDomainOf, sortItems, useDisposable, vaultInventoryScope, vaultItemFacts };
1422
+ export { BACKUP_PASSPHRASE_MIN_KNOB, CATEGORIES, DEFAULT_LOCATION, GenerateButton, HIDDEN_ITEM_TAG, HOLDINGS_DOOR_MIGRATION, LOCKED_MESSAGE, REVEAL_SECONDS_KNOB, VaultApp, VaultIdentity, VaultLockedError, categoryOf, copiedLine, copyValue, createApiVaultPort, createVaultKnobs, emptyReadAlarm, guardPort, holdingsDoorIsAbsent, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, parseDefinitions, positiveKnob, providerOf, rowMenuEntriesAt, siteDomainOf, sortItems, useDisposable, vaultInventoryScope, vaultItemFacts };
1423
+ export type { ApiVaultPortOptions, CategoryId, CopyOptions, DefinitionField, FieldHandling, FieldKind, HoldingRow, Holdings, ItemDraft, NoticeKind, Notify, RowItemAction, RowMenuEntry, RowMenuEntryKind, SaveResult, TotpReading, UriMatchMode, UrlGuess, VaultAgentScope, VaultAppProps, VaultAttachment, VaultAuthenticator, VaultClipboard, VaultCopied, VaultCustomField, VaultDefinition, VaultField, VaultHostCapabilities, VaultInventory, VaultItem, VaultItemCapabilities, VaultKnobs, VaultLayout, VaultLocation, VaultLock, VaultOrganizationRef, VaultOwner, VaultPort, VaultSelection, VaultSnapshot, VaultSort, VaultUserStateDoor };
package/dist/index.d.ts CHANGED
@@ -1419,4 +1419,5 @@ declare function holdingsDoorIsAbsent(code: string | undefined | null): boolean;
1419
1419
  */
1420
1420
  declare function emptyReadAlarm(total: number, emptyIds: readonly string[], holdings: Holdings): string | null;
1421
1421
 
1422
- export { type ApiVaultPortOptions, BACKUP_PASSPHRASE_MIN_KNOB, CATEGORIES, type CategoryId, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, HOLDINGS_DOOR_MIGRATION, type HoldingRow, type Holdings, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, REVEAL_SECONDS_KNOB, type RowItemAction, type RowMenuEntry, type RowMenuEntryKind, type SaveResult, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCopied, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, VaultIdentity, type VaultInventory, type VaultItem, type VaultItemCapabilities, type VaultKnobs, type VaultLayout, type VaultLocation, type VaultLock, VaultLockedError, type VaultOrganizationRef, type VaultOwner, type VaultPort, type VaultSelection, type VaultSnapshot, type VaultSort, type VaultUserStateDoor, categoryOf, copiedLine, copyValue, createApiVaultPort, createVaultKnobs, emptyReadAlarm, guardPort, holdingsDoorIsAbsent, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, parseDefinitions, positiveKnob, providerOf, rowMenuEntriesAt, siteDomainOf, sortItems, useDisposable, vaultInventoryScope, vaultItemFacts };
1422
+ export { BACKUP_PASSPHRASE_MIN_KNOB, CATEGORIES, DEFAULT_LOCATION, GenerateButton, HIDDEN_ITEM_TAG, HOLDINGS_DOOR_MIGRATION, LOCKED_MESSAGE, REVEAL_SECONDS_KNOB, VaultApp, VaultIdentity, VaultLockedError, categoryOf, copiedLine, copyValue, createApiVaultPort, createVaultKnobs, emptyReadAlarm, guardPort, holdingsDoorIsAbsent, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, parseDefinitions, positiveKnob, providerOf, rowMenuEntriesAt, siteDomainOf, sortItems, useDisposable, vaultInventoryScope, vaultItemFacts };
1423
+ export type { ApiVaultPortOptions, CategoryId, CopyOptions, DefinitionField, FieldHandling, FieldKind, HoldingRow, Holdings, ItemDraft, NoticeKind, Notify, RowItemAction, RowMenuEntry, RowMenuEntryKind, SaveResult, TotpReading, UriMatchMode, UrlGuess, VaultAgentScope, VaultAppProps, VaultAttachment, VaultAuthenticator, VaultClipboard, VaultCopied, VaultCustomField, VaultDefinition, VaultField, VaultHostCapabilities, VaultInventory, VaultItem, VaultItemCapabilities, VaultKnobs, VaultLayout, VaultLocation, VaultLock, VaultOrganizationRef, VaultOwner, VaultPort, VaultSelection, VaultSnapshot, VaultSort, VaultUserStateDoor };
package/dist/index.js CHANGED
@@ -2764,7 +2764,6 @@ function positiveKnob(resolved, key) {
2764
2764
  }
2765
2765
 
2766
2766
  // src/organizations.ts
2767
- import { shortUuid } from "@ai-matrx/design-system/record-id-format";
2768
2767
  function orderOrganizations(orgs, items, recentItemIds) {
2769
2768
  const counts = /* @__PURE__ */ new Map();
2770
2769
  for (const i of items) if (i.owner.organizationId) counts.set(i.owner.organizationId, (counts.get(i.owner.organizationId) ?? 0) + 1);
@@ -2778,9 +2777,22 @@ function orderOrganizations(orgs, items, recentItemIds) {
2778
2777
  return [...orgs].sort((a, b) => group(a) - group(b) || (recent.get(a.id) ?? 0) - (recent.get(b.id) ?? 0) || a.name.localeCompare(b.name, void 0, { sensitivity: "base" }) || a.id.localeCompare(b.id));
2779
2778
  }
2780
2779
  function organizationHints(orgs) {
2781
- const seen = /* @__PURE__ */ new Map();
2782
- for (const o of orgs) seen.set(o.name.trim().toLowerCase(), (seen.get(o.name.trim().toLowerCase()) ?? 0) + 1);
2783
- return new Map(orgs.filter((o) => (seen.get(o.name.trim().toLowerCase()) ?? 0) > 1).map((o) => [o.id, shortUuid(o.id)]));
2780
+ const groups = /* @__PURE__ */ new Map();
2781
+ for (const o of orgs) {
2782
+ const key = o.name.trim().toLowerCase();
2783
+ groups.set(key, [...groups.get(key) ?? [], o]);
2784
+ }
2785
+ const hints = /* @__PURE__ */ new Map();
2786
+ for (const group of groups.values()) {
2787
+ if (group.length < 2) continue;
2788
+ const longest = Math.max(...group.map((o) => o.id.length));
2789
+ const fragment = (o, n2) => o.id.slice(0, n2);
2790
+ let n = 8;
2791
+ while (n < longest && new Set(group.map((o) => fragment(o, n))).size < group.length) n += 1;
2792
+ const useSuffix = new Set(group.map((o) => fragment(o, n))).size < group.length;
2793
+ for (const o of group) hints.set(o.id, useSuffix ? o.id.slice(-8) : fragment(o, n));
2794
+ }
2795
+ return hints;
2784
2796
  }
2785
2797
 
2786
2798
  // src/shown-until-move.ts