@ai-matrx/vault 0.1.15 → 0.1.16
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.md +9 -1
- package/dist/index.cjs +1148 -783
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -3
- package/dist/index.d.ts +62 -3
- package/dist/index.js +1079 -714
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -100,7 +100,8 @@ interface VaultOrganizationRef {
|
|
|
100
100
|
id: string;
|
|
101
101
|
name: string;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
/** `name` A–Z, `name-desc` Z–A, `viewed` = most recently opened first (needs the host's Recently opened door). */
|
|
104
|
+
type VaultSort = "name" | "name-desc" | "website" | "updated" | "created" | "viewed";
|
|
104
105
|
/** Which vault to look in. `all` is everything the person can see, shared with them included. */
|
|
105
106
|
type VaultSelection = "all" | "mine" | "shared" | (string & {});
|
|
106
107
|
interface VaultLocation {
|
|
@@ -144,11 +145,26 @@ declare function loginSiteOf(item: Pick<VaultItem, "loginUrls">): string;
|
|
|
144
145
|
* `shop.example.co.uk` → `example.co.uk`. An address or a one-label host is returned as it is.
|
|
145
146
|
*/
|
|
146
147
|
declare function siteDomainOf(host: string): string;
|
|
147
|
-
|
|
148
|
+
/**
|
|
149
|
+
* `recents` is the person's Recently opened ids, newest first: `viewed` puts those first in that
|
|
150
|
+
* order, then everything never opened by name. Without it `viewed` sorts by name.
|
|
151
|
+
*/
|
|
152
|
+
declare function sortItems(items: readonly VaultItem[], sort: VaultSort, recents?: readonly string[] | null): VaultItem[];
|
|
148
153
|
interface NewSecretField {
|
|
149
154
|
key: string;
|
|
150
155
|
label: string;
|
|
151
156
|
value: string;
|
|
157
|
+
/** The name sandboxes and workflows find it by (`GITHUB_TOKEN`); absent = none. */
|
|
158
|
+
envKey?: string;
|
|
159
|
+
/** Who may see it; absent = `revealable` (shown after "Confirm it's you"). */
|
|
160
|
+
handling?: FieldHandling;
|
|
161
|
+
/** Sandboxes get it as an env variable (needs `envKey`). */
|
|
162
|
+
injectIntoSandbox?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/** How the browser treats a NEW item, chosen before its first save (afterwards: item settings). */
|
|
165
|
+
interface DraftBrowserSettings {
|
|
166
|
+
uriMatchMode: UriMatchMode;
|
|
167
|
+
browserFillEnabled: boolean;
|
|
152
168
|
}
|
|
153
169
|
interface ItemDraft {
|
|
154
170
|
name: string;
|
|
@@ -166,6 +182,8 @@ interface ItemDraft {
|
|
|
166
182
|
removed: string[];
|
|
167
183
|
/** A seed or otpauth address to enrol as the item's one-time password; empty = leave alone. */
|
|
168
184
|
authenticator: string;
|
|
185
|
+
/** New item only: website matching and browser fill chosen before the first save; absent = the defaults. */
|
|
186
|
+
browser?: DraftBrowserSettings;
|
|
169
187
|
}
|
|
170
188
|
|
|
171
189
|
/** One recorded earlier value of a secret field. Value-free: the value comes only from `revealHistory`. */
|
|
@@ -1172,6 +1190,8 @@ interface VaultHostCapabilities {
|
|
|
1172
1190
|
/** Desktop: the native passkey importer (file chooser, parsing and keys stay native). */
|
|
1173
1191
|
nativeImport?: NativeImportBridge;
|
|
1174
1192
|
openUrl?: (url: string) => void;
|
|
1193
|
+
/** The browser extension: opens the full vault on the website. Without it there is no "Open on the web". */
|
|
1194
|
+
openWebVault?: () => void;
|
|
1175
1195
|
/** Opens one item in a new browser tab (the web app: `/vault/<id>`). Without it there is no "Open in new tab". */
|
|
1176
1196
|
openItemInNewTab?: (itemId: string) => void;
|
|
1177
1197
|
/** The host's own sign-in, offered when the session has ended (the web app: its login page, back here after). */
|
|
@@ -1241,6 +1261,40 @@ declare function copyValue(text: string, label: string, options: CopyOptions, de
|
|
|
1241
1261
|
notify: Notify;
|
|
1242
1262
|
}): Promise<boolean>;
|
|
1243
1263
|
|
|
1264
|
+
/**
|
|
1265
|
+
* What an agent may know about the vault: its NON-SECRET shape, never a value.
|
|
1266
|
+
*
|
|
1267
|
+
* A host that offers agents on the vault (the web app's right-click menu and its Agents menu, surface
|
|
1268
|
+
* `matrx-user/vault`) builds their context here, so every host says the same thing and none can leak
|
|
1269
|
+
* more. `VaultItem` carries no plaintext (a revealed value lives only in the row that showed it), but
|
|
1270
|
+
* a person can type a secret into a free-text box, so notes, descriptions and custom-field VALUES are
|
|
1271
|
+
* left out on purpose: names, type, provider, websites' hosts, status, tags and field KEYS only.
|
|
1272
|
+
*/
|
|
1273
|
+
|
|
1274
|
+
/** Everything the person can see, as `VaultApp`'s `onInventory` reports it. */
|
|
1275
|
+
interface VaultInventory {
|
|
1276
|
+
items: readonly VaultItem[];
|
|
1277
|
+
definitions: readonly VaultDefinition[];
|
|
1278
|
+
}
|
|
1279
|
+
/** The surface values `matrx-user/vault` declares (count, names, providers) plus the menu's content. */
|
|
1280
|
+
interface VaultAgentScope {
|
|
1281
|
+
content: string;
|
|
1282
|
+
credential_count: number;
|
|
1283
|
+
credential_labels: string[];
|
|
1284
|
+
credential_providers: string[];
|
|
1285
|
+
}
|
|
1286
|
+
/** The provider an item is for (`github`, `openai`), from its type; null for generic types. */
|
|
1287
|
+
declare function providerOf(item: VaultItem, definitions: readonly VaultDefinition[]): string | null;
|
|
1288
|
+
/** One item, as lines an agent may read. Never a value: field KEYS only. */
|
|
1289
|
+
declare function vaultItemFacts(item: VaultItem, definitions: readonly VaultDefinition[]): string[];
|
|
1290
|
+
/**
|
|
1291
|
+
* The vault scope for an agent: the right-clicked item's facts when there is one, else the whole
|
|
1292
|
+
* inventory by name and type; plus the three values the surface always carries.
|
|
1293
|
+
*/
|
|
1294
|
+
declare function vaultInventoryScope(inventory: VaultInventory, clicked?: VaultItem | null): VaultAgentScope;
|
|
1295
|
+
/** The item a right-click landed on: every list row carries `data-item="<id>"`. */
|
|
1296
|
+
declare function itemIdAt(target: Element | null | undefined): string | null;
|
|
1297
|
+
|
|
1244
1298
|
type VaultLayout = "auto" | "full" | "split" | "stack";
|
|
1245
1299
|
interface VaultAppProps {
|
|
1246
1300
|
port: VaultPort;
|
|
@@ -1262,6 +1316,11 @@ interface VaultAppProps {
|
|
|
1262
1316
|
* Apple's text styles, AppKit controls and grouped boxes, sheets for panels, light and dark).
|
|
1263
1317
|
*/
|
|
1264
1318
|
look?: Look;
|
|
1319
|
+
/**
|
|
1320
|
+
* Every item the person can see, each time the list changes: the host builds its agent context
|
|
1321
|
+
* from it (`vaultInventoryScope`), never from secrets — items carry none.
|
|
1322
|
+
*/
|
|
1323
|
+
onInventory?: (inventory: VaultInventory) => void;
|
|
1265
1324
|
}
|
|
1266
1325
|
/** THE VAULT WORKSPACE: one component for the web app, the extension side panel and the desktop app. */
|
|
1267
1326
|
declare function VaultApp(props: VaultAppProps): react.JSX.Element;
|
|
@@ -1324,4 +1383,4 @@ declare function GenerateButton({ onUse, label, limits, disabled }: {
|
|
|
1324
1383
|
disabled?: boolean;
|
|
1325
1384
|
}): react.JSX.Element | null;
|
|
1326
1385
|
|
|
1327
|
-
export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type VaultIdentity, 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, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, siteDomainOf, sortItems, useConfirmed, wasCancelled };
|
|
1386
|
+
export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type 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, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, providerOf, siteDomainOf, sortItems, useConfirmed, vaultInventoryScope, vaultItemFacts, wasCancelled };
|
package/dist/index.d.ts
CHANGED
|
@@ -100,7 +100,8 @@ interface VaultOrganizationRef {
|
|
|
100
100
|
id: string;
|
|
101
101
|
name: string;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
/** `name` A–Z, `name-desc` Z–A, `viewed` = most recently opened first (needs the host's Recently opened door). */
|
|
104
|
+
type VaultSort = "name" | "name-desc" | "website" | "updated" | "created" | "viewed";
|
|
104
105
|
/** Which vault to look in. `all` is everything the person can see, shared with them included. */
|
|
105
106
|
type VaultSelection = "all" | "mine" | "shared" | (string & {});
|
|
106
107
|
interface VaultLocation {
|
|
@@ -144,11 +145,26 @@ declare function loginSiteOf(item: Pick<VaultItem, "loginUrls">): string;
|
|
|
144
145
|
* `shop.example.co.uk` → `example.co.uk`. An address or a one-label host is returned as it is.
|
|
145
146
|
*/
|
|
146
147
|
declare function siteDomainOf(host: string): string;
|
|
147
|
-
|
|
148
|
+
/**
|
|
149
|
+
* `recents` is the person's Recently opened ids, newest first: `viewed` puts those first in that
|
|
150
|
+
* order, then everything never opened by name. Without it `viewed` sorts by name.
|
|
151
|
+
*/
|
|
152
|
+
declare function sortItems(items: readonly VaultItem[], sort: VaultSort, recents?: readonly string[] | null): VaultItem[];
|
|
148
153
|
interface NewSecretField {
|
|
149
154
|
key: string;
|
|
150
155
|
label: string;
|
|
151
156
|
value: string;
|
|
157
|
+
/** The name sandboxes and workflows find it by (`GITHUB_TOKEN`); absent = none. */
|
|
158
|
+
envKey?: string;
|
|
159
|
+
/** Who may see it; absent = `revealable` (shown after "Confirm it's you"). */
|
|
160
|
+
handling?: FieldHandling;
|
|
161
|
+
/** Sandboxes get it as an env variable (needs `envKey`). */
|
|
162
|
+
injectIntoSandbox?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/** How the browser treats a NEW item, chosen before its first save (afterwards: item settings). */
|
|
165
|
+
interface DraftBrowserSettings {
|
|
166
|
+
uriMatchMode: UriMatchMode;
|
|
167
|
+
browserFillEnabled: boolean;
|
|
152
168
|
}
|
|
153
169
|
interface ItemDraft {
|
|
154
170
|
name: string;
|
|
@@ -166,6 +182,8 @@ interface ItemDraft {
|
|
|
166
182
|
removed: string[];
|
|
167
183
|
/** A seed or otpauth address to enrol as the item's one-time password; empty = leave alone. */
|
|
168
184
|
authenticator: string;
|
|
185
|
+
/** New item only: website matching and browser fill chosen before the first save; absent = the defaults. */
|
|
186
|
+
browser?: DraftBrowserSettings;
|
|
169
187
|
}
|
|
170
188
|
|
|
171
189
|
/** One recorded earlier value of a secret field. Value-free: the value comes only from `revealHistory`. */
|
|
@@ -1172,6 +1190,8 @@ interface VaultHostCapabilities {
|
|
|
1172
1190
|
/** Desktop: the native passkey importer (file chooser, parsing and keys stay native). */
|
|
1173
1191
|
nativeImport?: NativeImportBridge;
|
|
1174
1192
|
openUrl?: (url: string) => void;
|
|
1193
|
+
/** The browser extension: opens the full vault on the website. Without it there is no "Open on the web". */
|
|
1194
|
+
openWebVault?: () => void;
|
|
1175
1195
|
/** Opens one item in a new browser tab (the web app: `/vault/<id>`). Without it there is no "Open in new tab". */
|
|
1176
1196
|
openItemInNewTab?: (itemId: string) => void;
|
|
1177
1197
|
/** The host's own sign-in, offered when the session has ended (the web app: its login page, back here after). */
|
|
@@ -1241,6 +1261,40 @@ declare function copyValue(text: string, label: string, options: CopyOptions, de
|
|
|
1241
1261
|
notify: Notify;
|
|
1242
1262
|
}): Promise<boolean>;
|
|
1243
1263
|
|
|
1264
|
+
/**
|
|
1265
|
+
* What an agent may know about the vault: its NON-SECRET shape, never a value.
|
|
1266
|
+
*
|
|
1267
|
+
* A host that offers agents on the vault (the web app's right-click menu and its Agents menu, surface
|
|
1268
|
+
* `matrx-user/vault`) builds their context here, so every host says the same thing and none can leak
|
|
1269
|
+
* more. `VaultItem` carries no plaintext (a revealed value lives only in the row that showed it), but
|
|
1270
|
+
* a person can type a secret into a free-text box, so notes, descriptions and custom-field VALUES are
|
|
1271
|
+
* left out on purpose: names, type, provider, websites' hosts, status, tags and field KEYS only.
|
|
1272
|
+
*/
|
|
1273
|
+
|
|
1274
|
+
/** Everything the person can see, as `VaultApp`'s `onInventory` reports it. */
|
|
1275
|
+
interface VaultInventory {
|
|
1276
|
+
items: readonly VaultItem[];
|
|
1277
|
+
definitions: readonly VaultDefinition[];
|
|
1278
|
+
}
|
|
1279
|
+
/** The surface values `matrx-user/vault` declares (count, names, providers) plus the menu's content. */
|
|
1280
|
+
interface VaultAgentScope {
|
|
1281
|
+
content: string;
|
|
1282
|
+
credential_count: number;
|
|
1283
|
+
credential_labels: string[];
|
|
1284
|
+
credential_providers: string[];
|
|
1285
|
+
}
|
|
1286
|
+
/** The provider an item is for (`github`, `openai`), from its type; null for generic types. */
|
|
1287
|
+
declare function providerOf(item: VaultItem, definitions: readonly VaultDefinition[]): string | null;
|
|
1288
|
+
/** One item, as lines an agent may read. Never a value: field KEYS only. */
|
|
1289
|
+
declare function vaultItemFacts(item: VaultItem, definitions: readonly VaultDefinition[]): string[];
|
|
1290
|
+
/**
|
|
1291
|
+
* The vault scope for an agent: the right-clicked item's facts when there is one, else the whole
|
|
1292
|
+
* inventory by name and type; plus the three values the surface always carries.
|
|
1293
|
+
*/
|
|
1294
|
+
declare function vaultInventoryScope(inventory: VaultInventory, clicked?: VaultItem | null): VaultAgentScope;
|
|
1295
|
+
/** The item a right-click landed on: every list row carries `data-item="<id>"`. */
|
|
1296
|
+
declare function itemIdAt(target: Element | null | undefined): string | null;
|
|
1297
|
+
|
|
1244
1298
|
type VaultLayout = "auto" | "full" | "split" | "stack";
|
|
1245
1299
|
interface VaultAppProps {
|
|
1246
1300
|
port: VaultPort;
|
|
@@ -1262,6 +1316,11 @@ interface VaultAppProps {
|
|
|
1262
1316
|
* Apple's text styles, AppKit controls and grouped boxes, sheets for panels, light and dark).
|
|
1263
1317
|
*/
|
|
1264
1318
|
look?: Look;
|
|
1319
|
+
/**
|
|
1320
|
+
* Every item the person can see, each time the list changes: the host builds its agent context
|
|
1321
|
+
* from it (`vaultInventoryScope`), never from secrets — items carry none.
|
|
1322
|
+
*/
|
|
1323
|
+
onInventory?: (inventory: VaultInventory) => void;
|
|
1265
1324
|
}
|
|
1266
1325
|
/** THE VAULT WORKSPACE: one component for the web app, the extension side panel and the desktop app. */
|
|
1267
1326
|
declare function VaultApp(props: VaultAppProps): react.JSX.Element;
|
|
@@ -1324,4 +1383,4 @@ declare function GenerateButton({ onUse, label, limits, disabled }: {
|
|
|
1324
1383
|
disabled?: boolean;
|
|
1325
1384
|
}): react.JSX.Element | null;
|
|
1326
1385
|
|
|
1327
|
-
export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type VaultIdentity, 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, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, siteDomainOf, sortItems, useConfirmed, wasCancelled };
|
|
1386
|
+
export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type 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, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, providerOf, siteDomainOf, sortItems, useConfirmed, vaultInventoryScope, vaultItemFacts, wasCancelled };
|