@ai-matrx/vault 0.1.18 → 0.1.20

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
@@ -116,6 +116,8 @@ interface VaultLocation {
116
116
  /** New-item flow: the chosen definition, and the URL pasted at the start (kept across steps). */
117
117
  kind: string | null;
118
118
  url: string;
119
+ /** New-item flow: a name the opener chose ("Instagram login"); beats the one guessed from the address. */
120
+ name?: string;
119
121
  /** A panel open over the workspace: `share`, `history`, `activity`, `files`, `move`, `import`, … */
120
122
  panel: string | null;
121
123
  }
@@ -150,17 +152,25 @@ declare function siteDomainOf(host: string): string;
150
152
  * order, then everything never opened by name. Without it `viewed` sorts by name.
151
153
  */
152
154
  declare function sortItems(items: readonly VaultItem[], sort: VaultSort, recents?: readonly string[] | null): VaultItem[];
153
- interface NewSecretField {
154
- key: string;
155
- label: string;
156
- value: string;
155
+ /** A secret's automation settings, chosen before it is saved. */
156
+ interface FieldSettingsDraft {
157
157
  /** The name sandboxes and workflows find it by (`GITHUB_TOKEN`); absent = none. */
158
158
  envKey?: string;
159
- /** Who may see it; absent = `revealable` (shown after "Confirm it's you"). */
159
+ /** Who may see it; absent = `revealable` (or what its type declares). */
160
160
  handling?: FieldHandling;
161
161
  /** Sandboxes get it as an env variable (needs `envKey`). */
162
162
  injectIntoSandbox?: boolean;
163
163
  }
164
+ interface NewSecretField extends FieldSettingsDraft {
165
+ /** The stored field key; empty = made from the label. */
166
+ key: string;
167
+ label: string;
168
+ value: string;
169
+ /** Several lines (a secure note): edited in a multi-line box. */
170
+ multiline?: boolean;
171
+ /** Plain words stored with the field. */
172
+ description?: string;
173
+ }
164
174
  /** How the browser treats a NEW item, chosen before its first save (afterwards: item settings). */
165
175
  interface DraftBrowserSettings {
166
176
  uriMatchMode: UriMatchMode;
@@ -184,6 +194,8 @@ interface ItemDraft {
184
194
  authenticator: string;
185
195
  /** New item only: website matching and browser fill chosen before the first save; absent = the defaults. */
186
196
  browser?: DraftBrowserSettings;
197
+ /** New item only: env key, who can see it and sandbox use of each declared secret, by field key. */
198
+ fieldSettings?: Record<string, FieldSettingsDraft>;
187
199
  }
188
200
 
189
201
  /** One recorded earlier value of a secret field. Value-free: the value comes only from `revealHistory`. */
@@ -950,6 +962,15 @@ interface RecentsPort {
950
962
  * anything with a supabase-js style `rpc`. The server API has no endpoint for it (see FEATURE.md),
951
963
  * so the HOST supplies it; without it `favorites` and `recents` are absent and their controls hide.
952
964
  */
965
+ /** The one read Trash needs beyond the platform's trash list: each deleted item's type (row security decides what comes back). */
966
+ interface DeletedTypeRead {
967
+ in(column: "id", values: readonly string[]): PromiseLike<{
968
+ data?: unknown;
969
+ error?: {
970
+ message?: string;
971
+ } | null;
972
+ }>;
973
+ }
953
974
  interface VaultUserStateDoor {
954
975
  rpc(fn: string, args?: Record<string, unknown>): PromiseLike<{
955
976
  data?: unknown;
@@ -957,6 +978,12 @@ interface VaultUserStateDoor {
957
978
  message?: string;
958
979
  } | null;
959
980
  }>;
981
+ /** The host's supabase client gives this; without it Trash rows say "Credential" instead of the item's type. */
982
+ schema?(name: "users"): {
983
+ from(table: "credential_items"): {
984
+ select(columns: "id,definition_key"): DeletedTypeRead;
985
+ };
986
+ };
960
987
  }
961
988
  /** List-level state: trash and restore, favorites, recently opened. */
962
989
  interface ListsPort {
@@ -1202,6 +1229,23 @@ interface VaultHostCapabilities {
1202
1229
  clipboard?: VaultClipboard;
1203
1230
  /** How long a shown value stays shown, in seconds (an organization knob the host reads); default 20. */
1204
1231
  revealSeconds?: number;
1232
+ /**
1233
+ * How often the list re-reads itself while the vault is on screen, in seconds (the desktop's
1234
+ * refresh knob). Without it the organization's `vault.list.refresh_seconds` knob decides; with
1235
+ * neither, the list still re-reads whenever the window or panel comes back into focus.
1236
+ */
1237
+ refreshSeconds?: number;
1238
+ /**
1239
+ * Who answers a right-click on a list row. `package` (default): the row's own menu (copy any
1240
+ * field, open, copy name, plus `rowMenuItems`). `host`: the host wraps the vault in its own
1241
+ * right-click menu (the website's agents menu) and the row leaves the event alone.
1242
+ */
1243
+ rowContextMenu?: "package" | "host";
1244
+ /** Extra entries a host adds to every row's menu (the More button and the right-click menu). */
1245
+ rowMenuItems?: (item: VaultItem) => readonly {
1246
+ label: string;
1247
+ onSelect: () => void;
1248
+ }[];
1205
1249
  nativeProvider?: {
1206
1250
  status: "ready" | "needs_setup" | "unavailable";
1207
1251
  openSetup: () => void;
package/dist/index.d.ts CHANGED
@@ -116,6 +116,8 @@ interface VaultLocation {
116
116
  /** New-item flow: the chosen definition, and the URL pasted at the start (kept across steps). */
117
117
  kind: string | null;
118
118
  url: string;
119
+ /** New-item flow: a name the opener chose ("Instagram login"); beats the one guessed from the address. */
120
+ name?: string;
119
121
  /** A panel open over the workspace: `share`, `history`, `activity`, `files`, `move`, `import`, … */
120
122
  panel: string | null;
121
123
  }
@@ -150,17 +152,25 @@ declare function siteDomainOf(host: string): string;
150
152
  * order, then everything never opened by name. Without it `viewed` sorts by name.
151
153
  */
152
154
  declare function sortItems(items: readonly VaultItem[], sort: VaultSort, recents?: readonly string[] | null): VaultItem[];
153
- interface NewSecretField {
154
- key: string;
155
- label: string;
156
- value: string;
155
+ /** A secret's automation settings, chosen before it is saved. */
156
+ interface FieldSettingsDraft {
157
157
  /** The name sandboxes and workflows find it by (`GITHUB_TOKEN`); absent = none. */
158
158
  envKey?: string;
159
- /** Who may see it; absent = `revealable` (shown after "Confirm it's you"). */
159
+ /** Who may see it; absent = `revealable` (or what its type declares). */
160
160
  handling?: FieldHandling;
161
161
  /** Sandboxes get it as an env variable (needs `envKey`). */
162
162
  injectIntoSandbox?: boolean;
163
163
  }
164
+ interface NewSecretField extends FieldSettingsDraft {
165
+ /** The stored field key; empty = made from the label. */
166
+ key: string;
167
+ label: string;
168
+ value: string;
169
+ /** Several lines (a secure note): edited in a multi-line box. */
170
+ multiline?: boolean;
171
+ /** Plain words stored with the field. */
172
+ description?: string;
173
+ }
164
174
  /** How the browser treats a NEW item, chosen before its first save (afterwards: item settings). */
165
175
  interface DraftBrowserSettings {
166
176
  uriMatchMode: UriMatchMode;
@@ -184,6 +194,8 @@ interface ItemDraft {
184
194
  authenticator: string;
185
195
  /** New item only: website matching and browser fill chosen before the first save; absent = the defaults. */
186
196
  browser?: DraftBrowserSettings;
197
+ /** New item only: env key, who can see it and sandbox use of each declared secret, by field key. */
198
+ fieldSettings?: Record<string, FieldSettingsDraft>;
187
199
  }
188
200
 
189
201
  /** One recorded earlier value of a secret field. Value-free: the value comes only from `revealHistory`. */
@@ -950,6 +962,15 @@ interface RecentsPort {
950
962
  * anything with a supabase-js style `rpc`. The server API has no endpoint for it (see FEATURE.md),
951
963
  * so the HOST supplies it; without it `favorites` and `recents` are absent and their controls hide.
952
964
  */
965
+ /** The one read Trash needs beyond the platform's trash list: each deleted item's type (row security decides what comes back). */
966
+ interface DeletedTypeRead {
967
+ in(column: "id", values: readonly string[]): PromiseLike<{
968
+ data?: unknown;
969
+ error?: {
970
+ message?: string;
971
+ } | null;
972
+ }>;
973
+ }
953
974
  interface VaultUserStateDoor {
954
975
  rpc(fn: string, args?: Record<string, unknown>): PromiseLike<{
955
976
  data?: unknown;
@@ -957,6 +978,12 @@ interface VaultUserStateDoor {
957
978
  message?: string;
958
979
  } | null;
959
980
  }>;
981
+ /** The host's supabase client gives this; without it Trash rows say "Credential" instead of the item's type. */
982
+ schema?(name: "users"): {
983
+ from(table: "credential_items"): {
984
+ select(columns: "id,definition_key"): DeletedTypeRead;
985
+ };
986
+ };
960
987
  }
961
988
  /** List-level state: trash and restore, favorites, recently opened. */
962
989
  interface ListsPort {
@@ -1202,6 +1229,23 @@ interface VaultHostCapabilities {
1202
1229
  clipboard?: VaultClipboard;
1203
1230
  /** How long a shown value stays shown, in seconds (an organization knob the host reads); default 20. */
1204
1231
  revealSeconds?: number;
1232
+ /**
1233
+ * How often the list re-reads itself while the vault is on screen, in seconds (the desktop's
1234
+ * refresh knob). Without it the organization's `vault.list.refresh_seconds` knob decides; with
1235
+ * neither, the list still re-reads whenever the window or panel comes back into focus.
1236
+ */
1237
+ refreshSeconds?: number;
1238
+ /**
1239
+ * Who answers a right-click on a list row. `package` (default): the row's own menu (copy any
1240
+ * field, open, copy name, plus `rowMenuItems`). `host`: the host wraps the vault in its own
1241
+ * right-click menu (the website's agents menu) and the row leaves the event alone.
1242
+ */
1243
+ rowContextMenu?: "package" | "host";
1244
+ /** Extra entries a host adds to every row's menu (the More button and the right-click menu). */
1245
+ rowMenuItems?: (item: VaultItem) => readonly {
1246
+ label: string;
1247
+ onSelect: () => void;
1248
+ }[];
1205
1249
  nativeProvider?: {
1206
1250
  status: "ready" | "needs_setup" | "unavailable";
1207
1251
  openSetup: () => void;