@alfe.ai/agent-api-client 0.1.0 → 0.1.1

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.cjs CHANGED
@@ -30,55 +30,55 @@ var AgentApiClient = class {
30
30
  return (await res.json()).data;
31
31
  }
32
32
  async syncRegister(args) {
33
- return this.request("/agents/sync/register", {
33
+ return this.request("/agent/sync/register", {
34
34
  method: "POST",
35
35
  body: JSON.stringify(args ?? {})
36
36
  });
37
37
  }
38
38
  async syncGetManifest() {
39
- return this.request("/agents/sync/manifest");
39
+ return this.request("/agent/sync/manifest");
40
40
  }
41
41
  async syncPresign(args) {
42
- return this.request("/agents/sync/presign", {
42
+ return this.request("/agent/sync/presign", {
43
43
  method: "POST",
44
44
  body: JSON.stringify(args)
45
45
  });
46
46
  }
47
47
  async syncConfirmUpload(args) {
48
- return this.request("/agents/sync/confirm", {
48
+ return this.request("/agent/sync/confirm", {
49
49
  method: "POST",
50
50
  body: JSON.stringify(args)
51
51
  });
52
52
  }
53
53
  async syncReconstruct(args) {
54
- return this.request("/agents/sync/reconstruct", {
54
+ return this.request("/agent/sync/reconstruct", {
55
55
  method: "POST",
56
56
  body: JSON.stringify(args)
57
57
  });
58
58
  }
59
59
  async syncGetStats() {
60
- return this.request("/agents/sync/stats");
60
+ return this.request("/agent/sync/stats");
61
61
  }
62
62
  async syncListFiles(args) {
63
63
  const qs = new URLSearchParams();
64
64
  if (args?.prefix) qs.set("prefix", args.prefix);
65
65
  const query = qs.toString();
66
- return this.request(`/agents/sync/files${query ? `?${query}` : ""}`);
66
+ return this.request(`/agent/sync/files${query ? `?${query}` : ""}`);
67
67
  }
68
68
  async syncListSessions() {
69
- return this.request("/agents/sync/sessions");
69
+ return this.request("/agent/sync/sessions");
70
70
  }
71
71
  async syncGetSession(sessionId) {
72
- return this.request(`/agents/sync/sessions/${encodeURIComponent(sessionId)}`);
72
+ return this.request(`/agent/sync/sessions/${encodeURIComponent(sessionId)}`);
73
73
  }
74
74
  async syncDeleteFile(filePath) {
75
- return this.request(`/agents/sync/files/${encodeFilePath(filePath)}`, { method: "DELETE" });
75
+ return this.request(`/agent/sync/files/${encodeFilePath(filePath)}`, { method: "DELETE" });
76
76
  }
77
77
  async sharedListFiles(args) {
78
- return this.request(`/agents/org/files/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}`);
78
+ return this.request(`/agent/org/files/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}`);
79
79
  }
80
80
  async sharedDownloadUrl(args) {
81
- return this.request(`/agents/org/files/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/download/${encodeFilePath(args.filePath)}`);
81
+ return this.request(`/agent/org/files/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/download/${encodeFilePath(args.filePath)}`);
82
82
  }
83
83
  async listIntegrations() {
84
84
  return this.request("/agent/integrations");
@@ -177,9 +177,12 @@ var AgentApiClient = class {
177
177
  });
178
178
  }
179
179
  /**
180
- * Mint a fresh AES-256 data key for a new secret or rotation. The encryption
181
- * context is rebuilt server-side from `auth.tenantId` + the body fields; the
182
- * agent cannot forge context for a scope it doesn't own.
180
+ * Mint a fresh AES-256 data key for a specific (secret, field) pair. The
181
+ * encryption context is rebuilt server-side from `auth.tenantId` + the body
182
+ * fields including `fieldKey`; the agent cannot forge context for a scope
183
+ * or field it doesn't own. Legacy single-envelope secrets are migrated to
184
+ * `field#value` rows by the data migration, so call with `fieldKey: "value"`
185
+ * to reach them.
183
186
  */
184
187
  async generateSecretDataKey(args) {
185
188
  return this.request("/agent/secrets/generate-data-key", {
@@ -189,8 +192,9 @@ var AgentApiClient = class {
189
192
  }
190
193
  /**
191
194
  * Unwrap a wrapped data key so the agent can decrypt the envelope locally.
192
- * KMS Decrypt will fail with `InvalidCiphertextException` if the envelope
193
- * was tampered with in a way that changes `{ tenantId, scope, scopeId, secretId }`.
195
+ * `fieldKey` MUST match the value supplied when the data key was generated
196
+ * (it's bound into KMS encryption context); mismatch fails with
197
+ * `InvalidCiphertextException`.
194
198
  */
195
199
  async decryptSecretDataKey(args) {
196
200
  return this.request("/agent/secrets/decrypt-data-key", {
@@ -198,23 +202,65 @@ var AgentApiClient = class {
198
202
  body: JSON.stringify(args)
199
203
  });
200
204
  }
201
- /** Upload a pre-encrypted envelope for a secret. */
202
- async putSecretEnvelope(args) {
205
+ /**
206
+ * Create a new secret with one or more fields. Encrypted fields must arrive
207
+ * pre-sealed (the agent has already obtained per-field data keys via
208
+ * `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).
209
+ * Plaintext fields ship the value inline.
210
+ */
211
+ async createSecret(args) {
203
212
  const { scope, scopeId, secretId, ...body } = args;
204
213
  return this.request(`/agent/secrets/${encodeURIComponent(scope)}/${encodeURIComponent(scopeId)}/${encodeURIComponent(secretId)}`, {
205
214
  method: "PUT",
206
215
  body: JSON.stringify(body)
207
216
  });
208
217
  }
209
- /** Fetch the encrypted envelope for a single secret. */
210
- async getSecretEnvelope(args) {
218
+ /** Fetch the secret aggregate plus per-field encrypted envelopes. */
219
+ async getSecret(args) {
211
220
  return this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/${encodeURIComponent(args.secretId)}`);
212
221
  }
213
- /** List metadata (never envelopes) for secrets in a scope. */
222
+ /** Fetch one field. Plaintext: value inline. Encrypted: envelope. */
223
+ async getSecretField(args) {
224
+ return this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/${encodeURIComponent(args.secretId)}/fields/${encodeURIComponent(args.fieldKey)}`);
225
+ }
226
+ /** Add OR rotate one field. */
227
+ async setSecretField(args) {
228
+ const { scope, scopeId, secretId, fieldKey, ...body } = args;
229
+ return this.request(`/agent/secrets/${encodeURIComponent(scope)}/${encodeURIComponent(scopeId)}/${encodeURIComponent(secretId)}/fields/${encodeURIComponent(fieldKey)}`, {
230
+ method: "PUT",
231
+ body: JSON.stringify(body)
232
+ });
233
+ }
234
+ /** Remove one field. */
235
+ async removeSecretField(args) {
236
+ await this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/${encodeURIComponent(args.secretId)}/fields/${encodeURIComponent(args.fieldKey)}`, { method: "DELETE" });
237
+ }
238
+ /** Update secret-level metadata (name/description/tags/category). */
239
+ async updateSecretMetadata(args) {
240
+ const { scope, scopeId, secretId, ...body } = args;
241
+ return this.request(`/agent/secrets/${encodeURIComponent(scope)}/${encodeURIComponent(scopeId)}/${encodeURIComponent(secretId)}`, {
242
+ method: "PATCH",
243
+ body: JSON.stringify(body)
244
+ });
245
+ }
246
+ /** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
214
247
  async listSecrets(args) {
215
- return (await this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}`)).secrets;
248
+ const params = new URLSearchParams();
249
+ if (args.category) params.set("category", args.category);
250
+ if (args.tag) params.set("tag", args.tag);
251
+ if (args.fieldKey) params.set("fieldKey", args.fieldKey);
252
+ const qs = params.toString();
253
+ return (await this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}${qs ? `?${qs}` : ""}`)).secrets;
254
+ }
255
+ /** Bounded changelog read — metadata-only audit entries. */
256
+ async getSecretHistory(args) {
257
+ const params = new URLSearchParams();
258
+ if (args.limit) params.set("limit", String(args.limit));
259
+ if (args.cursor) params.set("cursor", args.cursor);
260
+ const qs = params.toString();
261
+ return this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/${encodeURIComponent(args.secretId)}/history${qs ? `?${qs}` : ""}`);
216
262
  }
217
- /** Delete a secret. */
263
+ /** Delete a secret (and all its field rows + tag rows + changelog rows). */
218
264
  async deleteSecret(args) {
219
265
  await this.request(`/agent/secrets/${encodeURIComponent(args.scope)}/${encodeURIComponent(args.scopeId)}/${encodeURIComponent(args.secretId)}`, { method: "DELETE" });
220
266
  }
package/dist/index.d.cts CHANGED
@@ -130,19 +130,89 @@ interface EncryptedEnvelopeV1 {
130
130
  authTag: string;
131
131
  dataKeyCiphertext: string;
132
132
  }
133
- /** Opaque metadata about a secret row — never includes plaintext. */
133
+ /**
134
+ * Display/validation hint for a field's value. `"json"` signals that the
135
+ * string is a JSON-stringified payload that consumers should `JSON.parse`.
136
+ */
137
+ declare const FIELD_FORMATS: readonly ["text", "email", "url", "phone", "date", "number", "json"];
138
+ type FieldFormat = (typeof FIELD_FORMATS)[number];
139
+ /**
140
+ * Whether a field is stored in plaintext (visible to anyone with read access)
141
+ * or encrypted (requires KMS + the right encryption context to read).
142
+ */
143
+ declare const FIELD_SENSITIVITIES: readonly ["plaintext", "encrypted"];
144
+ type FieldSensitivity = (typeof FIELD_SENSITIVITIES)[number];
145
+ /**
146
+ * A field on a secret. `value` is always a string at the wire; for encrypted
147
+ * fields it's the plaintext at the API edge (the service encrypts before
148
+ * persistence). Reads from the dashboard omit `value` for encrypted fields;
149
+ * agents get a `FieldEnvelope` instead and decrypt locally.
150
+ */
151
+ interface Field {
152
+ key: string;
153
+ format?: FieldFormat;
154
+ sensitivity: FieldSensitivity;
155
+ value: string;
156
+ }
157
+ /**
158
+ * Secret category — drives icon/template/filter behaviour. Defaults to
159
+ * `"other"` for migrated rows.
160
+ */
161
+ declare const SECRET_CATEGORIES: readonly ["login", "api_key", "database", "ssh_key", "certificate", "secure_note", "credit_card", "identity", "wifi", "other"];
162
+ type SecretCategory = (typeof SECRET_CATEGORIES)[number];
163
+ /**
164
+ * One field as exposed to readers. Encrypted fields have no `value` on the
165
+ * dashboard read path; the agent-side aggregate carries `envelope` instead.
166
+ */
167
+ interface FieldView {
168
+ key: string;
169
+ format?: FieldFormat;
170
+ sensitivity: FieldSensitivity;
171
+ /** Present for `sensitivity: "plaintext"` only. */
172
+ value?: string;
173
+ /** Present for `sensitivity: "encrypted"` on agent-side reads only. */
174
+ envelope?: EncryptedEnvelopeV1;
175
+ /** Plaintext fields that opt into `format: "json"` are pre-parsed for callers. */
176
+ parsedValue?: unknown;
177
+ rotatedAt?: string;
178
+ createdAt: string;
179
+ updatedAt: string;
180
+ }
181
+ /** A secret as assembled from its multi-row aggregate. */
182
+ interface SecretAggregate {
183
+ secretId: string;
184
+ secretName: string;
185
+ description?: string;
186
+ tags: string[];
187
+ category: SecretCategory;
188
+ fields: FieldView[];
189
+ changelogVersion: number;
190
+ createdAt: string;
191
+ updatedAt: string;
192
+ }
193
+ /** Metadata-only projection — used by list endpoints. */
134
194
  interface SecretMetadata {
135
195
  secretId: string;
136
196
  secretName: string;
137
197
  description?: string;
138
- tags?: string[];
198
+ tags: string[];
199
+ category: SecretCategory;
200
+ fieldKeys: string[];
201
+ changelogVersion: number;
139
202
  createdAt: string;
140
203
  updatedAt: string;
141
- rotatedAt?: string;
142
204
  }
143
- /** A single secret row including its encrypted envelope. */
144
- interface SecretEnvelopeResponse extends SecretMetadata {
205
+ /**
206
+ * Per-field encrypted envelope returned to agents on the agent-side aggregate.
207
+ * Agents decrypt locally using a data key fetched from `/decrypt-data-key`.
208
+ */
209
+ interface FieldEnvelope {
210
+ key: string;
211
+ format?: FieldFormat;
145
212
  envelope: EncryptedEnvelopeV1;
213
+ rotatedAt?: string;
214
+ createdAt: string;
215
+ updatedAt: string;
146
216
  }
147
217
  /** A scope the caller can read or write secrets in. */
148
218
  interface ScopeInfo {
@@ -160,6 +230,30 @@ interface GeneratedDataKey {
160
230
  plaintextKey: string;
161
231
  dataKeyCiphertext: string;
162
232
  }
233
+ /**
234
+ * Action types recorded in the secret changelog. Append-only.
235
+ */
236
+ declare const CHANGELOG_ACTIONS: readonly ["created", "deleted", "metadata_updated", "field_added", "field_rotated", "field_removed", "tag_added", "tag_removed"];
237
+ type ChangelogAction = (typeof CHANGELOG_ACTIONS)[number];
238
+ /** Who triggered a changelog entry. */
239
+ interface ChangelogActor {
240
+ kind: "user" | "agent" | "system";
241
+ id: string;
242
+ }
243
+ /**
244
+ * One audit row from the secret's changelog. Metadata only — never carries
245
+ * field VALUES (old or new). Rolling back a rotated secret is intentionally
246
+ * not supported.
247
+ */
248
+ interface ChangelogEntry {
249
+ changelogVersion: number;
250
+ action: ChangelogAction;
251
+ fieldKey?: string;
252
+ fieldSensitivity?: FieldSensitivity;
253
+ changedBy: ChangelogActor;
254
+ reason?: string;
255
+ timestamp: string;
256
+ }
163
257
  //# sourceMappingURL=secrets.d.ts.map
164
258
  //#endregion
165
259
  //#region src/index.d.ts
@@ -457,52 +551,135 @@ declare class AgentApiClient {
457
551
  recorded: boolean;
458
552
  }>;
459
553
  /**
460
- * Mint a fresh AES-256 data key for a new secret or rotation. The encryption
461
- * context is rebuilt server-side from `auth.tenantId` + the body fields; the
462
- * agent cannot forge context for a scope it doesn't own.
554
+ * Mint a fresh AES-256 data key for a specific (secret, field) pair. The
555
+ * encryption context is rebuilt server-side from `auth.tenantId` + the body
556
+ * fields including `fieldKey`; the agent cannot forge context for a scope
557
+ * or field it doesn't own. Legacy single-envelope secrets are migrated to
558
+ * `field#value` rows by the data migration, so call with `fieldKey: "value"`
559
+ * to reach them.
463
560
  */
464
561
  generateSecretDataKey(args: {
465
562
  scope: SecretScope;
466
563
  scopeId: string;
467
564
  secretId: string;
565
+ fieldKey: string;
468
566
  }): Promise<GeneratedDataKey>;
469
567
  /**
470
568
  * Unwrap a wrapped data key so the agent can decrypt the envelope locally.
471
- * KMS Decrypt will fail with `InvalidCiphertextException` if the envelope
472
- * was tampered with in a way that changes `{ tenantId, scope, scopeId, secretId }`.
569
+ * `fieldKey` MUST match the value supplied when the data key was generated
570
+ * (it's bound into KMS encryption context); mismatch fails with
571
+ * `InvalidCiphertextException`.
473
572
  */
474
573
  decryptSecretDataKey(args: {
475
574
  scope: SecretScope;
476
575
  scopeId: string;
477
576
  secretId: string;
577
+ fieldKey: string;
478
578
  dataKeyCiphertext: string;
479
579
  }): Promise<{
480
580
  plaintextKey: string;
481
581
  }>;
482
- /** Upload a pre-encrypted envelope for a secret. */
483
- putSecretEnvelope(args: {
582
+ /**
583
+ * Create a new secret with one or more fields. Encrypted fields must arrive
584
+ * pre-sealed (the agent has already obtained per-field data keys via
585
+ * `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).
586
+ * Plaintext fields ship the value inline.
587
+ */
588
+ createSecret(args: {
484
589
  scope: SecretScope;
485
590
  scopeId: string;
486
591
  secretId: string;
487
592
  secretName: string;
488
- envelope: EncryptedEnvelopeV1;
593
+ category?: SecretCategory;
489
594
  description?: string;
490
595
  tags?: string[];
596
+ fields: {
597
+ key: string;
598
+ format?: FieldFormat;
599
+ sensitivity: FieldSensitivity;
600
+ value?: string;
601
+ envelope?: EncryptedEnvelopeV1;
602
+ }[];
603
+ reason?: string;
604
+ }): Promise<SecretAggregate>;
605
+ /** Fetch the secret aggregate plus per-field encrypted envelopes. */
606
+ getSecret(args: {
607
+ scope: SecretScope;
608
+ scopeId: string;
609
+ secretId: string;
610
+ }): Promise<{
611
+ aggregate: SecretAggregate;
612
+ envelopes: FieldEnvelope[];
613
+ }>;
614
+ /** Fetch one field. Plaintext: value inline. Encrypted: envelope. */
615
+ getSecretField(args: {
616
+ scope: SecretScope;
617
+ scopeId: string;
618
+ secretId: string;
619
+ fieldKey: string;
491
620
  }): Promise<{
621
+ key: string;
622
+ sensitivity: FieldSensitivity;
623
+ format?: FieldFormat;
624
+ value?: string;
625
+ envelope?: EncryptedEnvelopeV1;
626
+ rotatedAt?: string;
627
+ createdAt: string;
628
+ updatedAt: string;
629
+ }>;
630
+ /** Add OR rotate one field. */
631
+ setSecretField(args: {
632
+ scope: SecretScope;
633
+ scopeId: string;
492
634
  secretId: string;
635
+ fieldKey: string;
636
+ sensitivity: FieldSensitivity;
637
+ format?: FieldFormat;
638
+ value?: string;
639
+ envelope?: EncryptedEnvelopeV1;
640
+ reason?: string;
641
+ }): Promise<{
642
+ fieldKey: string;
643
+ rotated: boolean;
493
644
  }>;
494
- /** Fetch the encrypted envelope for a single secret. */
495
- getSecretEnvelope(args: {
645
+ /** Remove one field. */
646
+ removeSecretField(args: {
647
+ scope: SecretScope;
648
+ scopeId: string;
649
+ secretId: string;
650
+ fieldKey: string;
651
+ }): Promise<void>;
652
+ /** Update secret-level metadata (name/description/tags/category). */
653
+ updateSecretMetadata(args: {
496
654
  scope: SecretScope;
497
655
  scopeId: string;
498
656
  secretId: string;
499
- }): Promise<SecretEnvelopeResponse>;
500
- /** List metadata (never envelopes) for secrets in a scope. */
657
+ secretName?: string;
658
+ description?: string;
659
+ tags?: string[];
660
+ category?: SecretCategory;
661
+ reason?: string;
662
+ }): Promise<SecretAggregate>;
663
+ /** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
501
664
  listSecrets(args: {
502
665
  scope: SecretScope;
503
666
  scopeId: string;
667
+ category?: SecretCategory;
668
+ tag?: string;
669
+ fieldKey?: string;
504
670
  }): Promise<SecretMetadata[]>;
505
- /** Delete a secret. */
671
+ /** Bounded changelog read — metadata-only audit entries. */
672
+ getSecretHistory(args: {
673
+ scope: SecretScope;
674
+ scopeId: string;
675
+ secretId: string;
676
+ limit?: number;
677
+ cursor?: string;
678
+ }): Promise<{
679
+ entries: ChangelogEntry[];
680
+ nextCursor?: string;
681
+ }>;
682
+ /** Delete a secret (and all its field rows + tag rows + changelog rows). */
506
683
  deleteSecret(args: {
507
684
  scope: SecretScope;
508
685
  scopeId: string;
@@ -764,5 +941,5 @@ declare class AgentApiClient {
764
941
  }
765
942
  //# sourceMappingURL=index.d.ts.map
766
943
  //#endregion
767
- export { AgentApiClient, AgentApiClientConfig, type EncryptedEnvelopeV1, type GeneratedDataKey, type IntegrationConfigResult, type IntegrationConfigSchemaField, type IntegrationInstall, type RegistryEntry, type ScopeInfo, type SecretEnvelopeResponse, type SecretMetadata, type SecretScope, SharedFileEntry, SyncAgentInfo, SyncAgentStats, SyncConfirmedUpload, SyncFileEntry, SyncManifest, SyncManifestEntry, SyncPresignedUrl, SyncReconstructBundle, SyncReconstructFile, SyncSessionContent, SyncSessionEntry };
944
+ export { AgentApiClient, AgentApiClientConfig, type ChangelogAction, type ChangelogActor, type ChangelogEntry, type EncryptedEnvelopeV1, type Field, type FieldEnvelope, type FieldFormat, type FieldSensitivity, type FieldView, type GeneratedDataKey, type IntegrationConfigResult, type IntegrationConfigSchemaField, type IntegrationInstall, type RegistryEntry, type ScopeInfo, type SecretAggregate, type SecretCategory, type SecretMetadata, type SecretScope, SharedFileEntry, SyncAgentInfo, SyncAgentStats, SyncConfirmedUpload, SyncFileEntry, SyncManifest, SyncManifestEntry, SyncPresignedUrl, SyncReconstructBundle, SyncReconstructFile, SyncSessionContent, SyncSessionEntry };
768
945
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["PERMISSION_CATALOG","Record","TENANT_ALLOWED_SUBJECTS","TenantAllowedSubject","ResourceScope","RESOURCE_SCOPES","AccessLevel","ScopedAccess","AllScopedAccess","ResourceScope","DEFAULT_INTEGRATIONS","IntegrationVisibility","INTEGRATION_VISIBILITIES","IntegrationScope","INTEGRATION_SCOPES","IntegrationDesiredStatus","INTEGRATION_DESIRED_STATUSES","IntegrationActualStatus","INTEGRATION_ACTUAL_STATUSES","IntegrationInstall","Record","AgentIntegration","OrgIntegration","IntegrationConfigSchemaField","IntegrationConfigResult","RegistryEntry","ResourceScope","SecretScope","SECRET_SCOPES","EncryptedEnvelopeV1","SecretMetadata","SecretEnvelopeResponse","ScopeInfo","GeneratedDataKey"],"sources":["../../../packages-internal/types/dist/access.d.ts","../../../packages-internal/types/dist/integration.d.ts","../../../packages-internal/types/dist/secrets.d.ts","../src/index.ts"],"sourcesContent":["/**\n * Runtime catalog of declared permission subjects + allowed actions.\n *\n * Mirrors the compile-time `PermissionDefinitions` augmentation in\n * `@alfe/api-core/auriclabs-roles.ts`. Kept here so browser code\n * (dashboard) can consume it without pulling in server-only deps\n * (`@middy/core`, `aws-lambda`, etc.).\n */\nexport declare const PERMISSION_CATALOG: Record<string, readonly string[]>;\n/**\n * Subjects a tenant may grant via a custom role.\n *\n * Excludes `all` (platform-admin escape hatch) and `admin_*` subjects.\n */\nexport declare const TENANT_ALLOWED_SUBJECTS: readonly [\"agent\", \"sync\", \"integration\", \"secret\", \"database\", \"template\", \"org_file\", \"team\", \"project\", \"model_policy\", \"role_management\", \"billing\", \"identity\", \"token\", \"user\", \"gateway\", \"voice\"];\nexport type TenantAllowedSubject = (typeof TENANT_ALLOWED_SUBJECTS)[number];\n/**\n * The four resource scopes at which a permission can apply.\n * Order is meaningful: broader scopes first (`org`) → narrower last (`agent`).\n *\n * `IntegrationScope` in integration.ts and `SecretScope` in secrets.ts are\n * intentional aliases of this same enum — there is only one concept of\n * \"scope\" in Alfe.\n */\nexport declare const ResourceScope: {\n readonly Org: \"org\";\n readonly Team: \"team\";\n readonly Project: \"project\";\n readonly Agent: \"agent\";\n};\nexport type ResourceScope = (typeof ResourceScope)[keyof typeof ResourceScope];\n/** Ordered tuple of resource scope string values (broad → narrow). */\nexport declare const RESOURCE_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\nexport declare const AccessLevel: {\n readonly None: \"none\";\n readonly Read: \"read\";\n readonly Write: \"write\";\n readonly Manage: \"manage\";\n};\nexport type AccessLevel = (typeof AccessLevel)[keyof typeof AccessLevel];\nexport interface ScopedAccess {\n scope: ResourceScope;\n scopeId: string;\n accessLevel: AccessLevel;\n /** Resolved role label (e.g. \"org_admin\", \"team_member\") */\n role: string;\n}\nexport interface AllScopedAccess {\n orgAccess: ScopedAccess;\n teamAccess: ScopedAccess[];\n projectAccess: ScopedAccess[];\n}\n//# sourceMappingURL=access.d.ts.map","import { ResourceScope } from \"./access.js\";\n/** Integrations auto-installed for ALL agents regardless of hosting type. Cannot be removed. */\nexport declare const DEFAULT_INTEGRATIONS: readonly string[];\n/** Controls where an integration appears: public (everyone), hidden (nowhere) */\nexport declare const IntegrationVisibility: {\n readonly Public: \"public\";\n readonly Hidden: \"hidden\";\n};\nexport type IntegrationVisibility = (typeof IntegrationVisibility)[keyof typeof IntegrationVisibility];\nexport declare const INTEGRATION_VISIBILITIES: readonly [\"public\" | \"hidden\", ...(\"public\" | \"hidden\")[]];\n/** Scope at which an integration is installed */\nexport declare const IntegrationScope: {\n readonly Org: \"org\";\n readonly Team: \"team\";\n readonly Project: \"project\";\n readonly Agent: \"agent\";\n};\nexport type IntegrationScope = ResourceScope;\nexport declare const INTEGRATION_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\nexport declare const IntegrationDesiredStatus: {\n readonly Active: \"active\";\n readonly Removed: \"removed\";\n};\nexport type IntegrationDesiredStatus = (typeof IntegrationDesiredStatus)[keyof typeof IntegrationDesiredStatus];\nexport declare const INTEGRATION_DESIRED_STATUSES: readonly [\"active\" | \"removed\", ...(\"active\" | \"removed\")[]];\nexport declare const IntegrationActualStatus: {\n readonly Installing: \"installing\";\n readonly Active: \"active\";\n readonly Error: \"error\";\n readonly Removing: \"removing\";\n readonly Inactive: \"inactive\";\n readonly Unknown: \"unknown\";\n};\nexport type IntegrationActualStatus = (typeof IntegrationActualStatus)[keyof typeof IntegrationActualStatus];\nexport declare const INTEGRATION_ACTUAL_STATUSES: readonly [\"active\" | \"error\" | \"installing\" | \"removing\" | \"inactive\" | \"unknown\", ...(\"active\" | \"error\" | \"installing\" | \"removing\" | \"inactive\" | \"unknown\")[]];\nexport interface IntegrationInstall {\n scope: IntegrationScope;\n scopeId: string;\n integrationId: string;\n tenantId: string;\n desiredStatus: IntegrationDesiredStatus;\n actualStatus: IntegrationActualStatus;\n version: string;\n config: Record<string, unknown>;\n errorMessage: string;\n installedAt: string;\n updatedAt: string;\n}\n/** @deprecated Use IntegrationInstall instead */\nexport type AgentIntegration = IntegrationInstall;\n/** Org-scoped integration install */\nexport type OrgIntegration = IntegrationInstall;\nexport interface IntegrationConfigSchemaField {\n key: string;\n label: string;\n type: string;\n description?: string;\n required?: boolean;\n default?: string | number | boolean;\n options?: string[];\n select_options?: {\n value: string;\n label: string;\n }[];\n oauth_provider?: string;\n oauth_scopes?: string[];\n oauth_integration_id?: string;\n editable?: string;\n hidden?: boolean;\n}\nexport interface IntegrationConfigResult {\n integrationId: string;\n config: Record<string, unknown>;\n configSchema: IntegrationConfigSchemaField[];\n}\nexport interface RegistryEntry {\n id: string;\n name: string;\n description: string;\n versions: string[];\n latest: string;\n repository: string;\n commit: string;\n icon?: string;\n author?: {\n name: string;\n url?: string;\n } | string;\n pricing?: {\n type: \"free\" | \"paid\" | \"usage\";\n price?: number;\n currency?: string;\n interval?: \"month\" | \"year\";\n description?: string;\n };\n features?: string[];\n preview_images?: string[];\n config_schema?: IntegrationConfigSchemaField[];\n supported_agents?: string[];\n /** Scopes where this integration can be installed */\n supported_scopes?: IntegrationScope[];\n /** Visibility status — controls where integration appears */\n visibility?: IntegrationVisibility;\n}\n//# sourceMappingURL=integration.d.ts.map","/**\n * Secrets types — shared between services/secrets, @alfe.ai/agent-api-client,\n * the openclaw-secrets plugin, and dashboard clients.\n *\n * Server-side crypto and KMS glue live in @alfe/secret-store (Node/AWS-only);\n * this module is a pure, dependency-free shape contract safe for every\n * environment the agent-api-client ships to.\n */\nimport type { ResourceScope } from \"./access.js\";\n/** Scope levels at which a secret can be owned. Aliased to ResourceScope. */\nexport type SecretScope = ResourceScope;\nexport declare const SECRET_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\n/**\n * v1 encrypted envelope as persisted by services/secrets and exchanged with\n * agents. Values are AES-256-GCM ciphertext; iv/authTag/ciphertext/dataKeyCiphertext\n * are all base64-encoded.\n */\nexport interface EncryptedEnvelopeV1 {\n version: 1;\n iv: string;\n ciphertext: string;\n authTag: string;\n dataKeyCiphertext: string;\n}\n/** Opaque metadata about a secret row — never includes plaintext. */\nexport interface SecretMetadata {\n secretId: string;\n secretName: string;\n description?: string;\n tags?: string[];\n createdAt: string;\n updatedAt: string;\n rotatedAt?: string;\n}\n/** A single secret row including its encrypted envelope. */\nexport interface SecretEnvelopeResponse extends SecretMetadata {\n envelope: EncryptedEnvelopeV1;\n}\n/** A scope the caller can read or write secrets in. */\nexport interface ScopeInfo {\n scope: SecretScope;\n scopeId: string;\n name?: string;\n}\n/**\n * KMS-issued data key, returned by the secrets service's\n * `/secrets/generate-data-key` KMS proxy endpoint. The plaintext key is\n * returned base64-encoded; callers MUST decode it to a Buffer and zero the\n * Buffer after use — never keep the plaintext as a JS string.\n */\nexport interface GeneratedDataKey {\n plaintextKey: string;\n dataKeyCiphertext: string;\n}\n//# sourceMappingURL=secrets.d.ts.map"],"mappings":";;ACWA;AAMA;AAEA;AAIA;;;;;AAEqBiB,cDDAb,aCQpB,EAAA;EACWa,SAAAA,GAAAA,EAAAA,KAAAA;EAAuB,SAAA,IAAA,EAAA,MAAA;WAAWA,OAAAA,EAAAA,SAAAA;WAAsCA,KAAAA,EAAAA,OAAAA;CAAuB;AAE1FE,KDLLf,aAAAA,GCKuB,CAAA,ODLCA,aCKD,CAAA,CAAA,MAAA,ODL6BA,aCK7B,CAAA;;;;;ADLCA,cC1BfO,qBD0BeP,EAAAA;WAA4BA,MAAAA,EAAAA,QAAAA;EAAa,SAAA,MAAA,EAAA,QAAA;;KCtBjEO,qBAAAA,WAAgCA,oCAAoCA;AAJhF;AAIYA,cAGSE,gBAHY,EAAA;EAAA,SAAA,GAAA,EAAA,KAAA;WAAWF,IAAAA,EAAAA,MAAAA;WAAoCA,OAAAA,EAAAA,SAAAA;EAAqB,SAAA,KAAA,EAAA,OAAA;AAGrG,CAAA;AAMYE,KAAAA,gBAAAA,GAAmBJ,aAAAA;AAMnBM,cAJSA,wBAIe,EAAA;EAAA,SAAA,MAAA,EAAA,QAAA;WAAWA,OAAAA,EAAAA,SAAAA;;AAA+D,KAAlGA,wBAAAA,GAAkG,CAAA,OAA/DA,wBAA+D,CAAA,CAAA,MAAA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A,MAAA;MAMjB,QAAA,EAAA,MAAA;MAiBjB,YAAA,EAAA,MAAA;MAUA,eAAA,CAAA,EAAA,MAAA,EAAA;MAWA,SAAA,EAAA,OAAA;MASiC,WAAA,CAAA,EAAA,MAAA;IAcjC,CAAA,EAAA;IAAO,KAAA,EAAA,MAAA;;;;;;;0CAtlBmC;;;;;;;0CAQA;;;;;;;8BAQZ;;;;;;;0BAUJ;;;;wBAOF;;;;;sBAQF;;;;0BAOI;;;;;6BAQG;;;;;;;;;;;;2BAeF;;;;wBAOH;;;;;;sBASF;;;;yBAOG;;;;;;;;;;;;;mBAgBZ;MACb;;;;uBAOuB;;;;;;;;;;;QAM8D;;;;;;;;;;;;;MAarF;;;;;;;;;WAgCK;;;MAGL,QAAQ;;;;;;;WAaH;;;;MAIL;;;;;WASK;;;;cAIG;;;MAGR;;;;;WAaK;;;MAGL,QAAQ;;;WAQH;;MAEL,QAAQ;;;WASH;;;MAGL;;sBAQsB,QAAQ;;;;;;MAe9B;;;;;;;;;;;MAiBA;;;0CAS0C;;;;;;;;;;MAS1C;;;;;;;;;;MASA;;;;;;;;;;;;MAWA;;;;;;;;;;;MAWA;;;;;MASA;;;;;;;;;;MAUA;;;;;;;;;;;;;;;;;;MAkBA;;;;;;;;;;;;;;;;MAiBA;;;;;;;;;;;;;;;;;;MA2BD;;;;;;;;;;;MAeC;;;;;;;;;;;MAsBA;;;;;;;;;;;;;;;;;;;;;;;;MAsBA;;;;;;;;;;;;MAsBA;;;;wDAYwD;;;;uCAWjB;;;;;;;;;;;oBAOnB;;;;;;;;kCAOc;;;iBAMjB;;;;;;;;;;;;MAiBjB;;;;MAUA;;;;;MAWA;iCASiC;;;;;;;;;;;MAcjC"}
1
+ {"version":3,"file":"index.d.cts","names":["PERMISSION_CATALOG","Record","TENANT_ALLOWED_SUBJECTS","TenantAllowedSubject","ResourceScope","RESOURCE_SCOPES","AccessLevel","ScopedAccess","AllScopedAccess","ResourceScope","DEFAULT_INTEGRATIONS","IntegrationVisibility","INTEGRATION_VISIBILITIES","IntegrationScope","INTEGRATION_SCOPES","IntegrationDesiredStatus","INTEGRATION_DESIRED_STATUSES","IntegrationActualStatus","INTEGRATION_ACTUAL_STATUSES","IntegrationInstall","Record","AgentIntegration","OrgIntegration","IntegrationConfigSchemaField","IntegrationConfigResult","RegistryEntry","ResourceScope","SecretScope","SECRET_SCOPES","EncryptedEnvelopeV1","FIELD_FORMATS","FieldFormat","FIELD_SENSITIVITIES","FieldSensitivity","Field","SECRET_CATEGORIES","SecretCategory","FieldView","SecretAggregate","SecretMetadata","FieldEnvelope","ScopeInfo","GeneratedDataKey","CHANGELOG_ACTIONS","ChangelogAction","ChangelogActor","ChangelogEntry"],"sources":["../../../packages-internal/types/dist/access.d.ts","../../../packages-internal/types/dist/integration.d.ts","../../../packages-internal/types/dist/secrets.d.ts","../src/index.ts"],"sourcesContent":["/**\n * Runtime catalog of declared permission subjects + allowed actions.\n *\n * Mirrors the compile-time `PermissionDefinitions` augmentation in\n * `@alfe/api-core/auriclabs-roles.ts`. Kept here so browser code\n * (dashboard) can consume it without pulling in server-only deps\n * (`@middy/core`, `aws-lambda`, etc.).\n */\nexport declare const PERMISSION_CATALOG: Record<string, readonly string[]>;\n/**\n * Subjects a tenant may grant via a custom role.\n *\n * Excludes `all` (platform-admin escape hatch) and `admin_*` subjects.\n */\nexport declare const TENANT_ALLOWED_SUBJECTS: readonly [\"agent\", \"sync\", \"integration\", \"secret\", \"database\", \"template\", \"org_file\", \"team\", \"project\", \"model_policy\", \"role_management\", \"billing\", \"identity\", \"token\", \"user\", \"gateway\", \"voice\"];\nexport type TenantAllowedSubject = (typeof TENANT_ALLOWED_SUBJECTS)[number];\n/**\n * The four resource scopes at which a permission can apply.\n * Order is meaningful: broader scopes first (`org`) → narrower last (`agent`).\n *\n * `IntegrationScope` in integration.ts and `SecretScope` in secrets.ts are\n * intentional aliases of this same enum — there is only one concept of\n * \"scope\" in Alfe.\n */\nexport declare const ResourceScope: {\n readonly Org: \"org\";\n readonly Team: \"team\";\n readonly Project: \"project\";\n readonly Agent: \"agent\";\n};\nexport type ResourceScope = (typeof ResourceScope)[keyof typeof ResourceScope];\n/** Ordered tuple of resource scope string values (broad → narrow). */\nexport declare const RESOURCE_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\nexport declare const AccessLevel: {\n readonly None: \"none\";\n readonly Read: \"read\";\n readonly Write: \"write\";\n readonly Manage: \"manage\";\n};\nexport type AccessLevel = (typeof AccessLevel)[keyof typeof AccessLevel];\nexport interface ScopedAccess {\n scope: ResourceScope;\n scopeId: string;\n accessLevel: AccessLevel;\n /** Resolved role label (e.g. \"org_admin\", \"team_member\") */\n role: string;\n}\nexport interface AllScopedAccess {\n orgAccess: ScopedAccess;\n teamAccess: ScopedAccess[];\n projectAccess: ScopedAccess[];\n}\n//# sourceMappingURL=access.d.ts.map","import { ResourceScope } from \"./access.js\";\n/** Integrations auto-installed for ALL agents regardless of hosting type. Cannot be removed. */\nexport declare const DEFAULT_INTEGRATIONS: readonly string[];\n/** Controls where an integration appears: public (everyone), hidden (nowhere) */\nexport declare const IntegrationVisibility: {\n readonly Public: \"public\";\n readonly Hidden: \"hidden\";\n};\nexport type IntegrationVisibility = (typeof IntegrationVisibility)[keyof typeof IntegrationVisibility];\nexport declare const INTEGRATION_VISIBILITIES: readonly [\"public\" | \"hidden\", ...(\"public\" | \"hidden\")[]];\n/** Scope at which an integration is installed */\nexport declare const IntegrationScope: {\n readonly Org: \"org\";\n readonly Team: \"team\";\n readonly Project: \"project\";\n readonly Agent: \"agent\";\n};\nexport type IntegrationScope = ResourceScope;\nexport declare const INTEGRATION_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\nexport declare const IntegrationDesiredStatus: {\n readonly Active: \"active\";\n readonly Removed: \"removed\";\n};\nexport type IntegrationDesiredStatus = (typeof IntegrationDesiredStatus)[keyof typeof IntegrationDesiredStatus];\nexport declare const INTEGRATION_DESIRED_STATUSES: readonly [\"active\" | \"removed\", ...(\"active\" | \"removed\")[]];\nexport declare const IntegrationActualStatus: {\n readonly Installing: \"installing\";\n readonly Active: \"active\";\n readonly Error: \"error\";\n readonly Removing: \"removing\";\n readonly Inactive: \"inactive\";\n readonly Unknown: \"unknown\";\n};\nexport type IntegrationActualStatus = (typeof IntegrationActualStatus)[keyof typeof IntegrationActualStatus];\nexport declare const INTEGRATION_ACTUAL_STATUSES: readonly [\"active\" | \"error\" | \"installing\" | \"removing\" | \"inactive\" | \"unknown\", ...(\"active\" | \"error\" | \"installing\" | \"removing\" | \"inactive\" | \"unknown\")[]];\nexport interface IntegrationInstall {\n scope: IntegrationScope;\n scopeId: string;\n integrationId: string;\n tenantId: string;\n desiredStatus: IntegrationDesiredStatus;\n actualStatus: IntegrationActualStatus;\n version: string;\n config: Record<string, unknown>;\n errorMessage: string;\n installedAt: string;\n updatedAt: string;\n}\n/** @deprecated Use IntegrationInstall instead */\nexport type AgentIntegration = IntegrationInstall;\n/** Org-scoped integration install */\nexport type OrgIntegration = IntegrationInstall;\nexport interface IntegrationConfigSchemaField {\n key: string;\n label: string;\n type: string;\n description?: string;\n required?: boolean;\n default?: string | number | boolean;\n options?: string[];\n select_options?: {\n value: string;\n label: string;\n }[];\n oauth_provider?: string;\n oauth_scopes?: string[];\n oauth_integration_id?: string;\n editable?: string;\n hidden?: boolean;\n}\nexport interface IntegrationConfigResult {\n integrationId: string;\n config: Record<string, unknown>;\n configSchema: IntegrationConfigSchemaField[];\n}\nexport interface RegistryEntry {\n id: string;\n name: string;\n description: string;\n versions: string[];\n latest: string;\n repository: string;\n commit: string;\n icon?: string;\n author?: {\n name: string;\n url?: string;\n } | string;\n pricing?: {\n type: \"free\" | \"paid\" | \"usage\";\n price?: number;\n currency?: string;\n interval?: \"month\" | \"year\";\n description?: string;\n };\n features?: string[];\n preview_images?: string[];\n config_schema?: IntegrationConfigSchemaField[];\n supported_agents?: string[];\n /** Scopes where this integration can be installed */\n supported_scopes?: IntegrationScope[];\n /** Visibility status — controls where integration appears */\n visibility?: IntegrationVisibility;\n}\n//# sourceMappingURL=integration.d.ts.map","/**\n * Secrets types — shared between services/secrets, @alfe.ai/agent-api-client,\n * the openclaw-secrets plugin, and dashboard clients.\n *\n * Server-side crypto and KMS glue live in @alfe/secret-store (Node/AWS-only);\n * this module is a pure, dependency-free shape contract safe for every\n * environment the agent-api-client ships to.\n */\nimport type { ResourceScope } from \"./access.js\";\n/** Scope levels at which a secret can be owned. Aliased to ResourceScope. */\nexport type SecretScope = ResourceScope;\nexport declare const SECRET_SCOPES: readonly [\"agent\" | \"team\" | \"project\" | \"org\", ...(\"agent\" | \"team\" | \"project\" | \"org\")[]];\n/**\n * v1 encrypted envelope as persisted by services/secrets and exchanged with\n * agents. Values are AES-256-GCM ciphertext; iv/authTag/ciphertext/dataKeyCiphertext\n * are all base64-encoded.\n */\nexport interface EncryptedEnvelopeV1 {\n version: 1;\n iv: string;\n ciphertext: string;\n authTag: string;\n dataKeyCiphertext: string;\n}\n/**\n * Display/validation hint for a field's value. `\"json\"` signals that the\n * string is a JSON-stringified payload that consumers should `JSON.parse`.\n */\nexport declare const FIELD_FORMATS: readonly [\"text\", \"email\", \"url\", \"phone\", \"date\", \"number\", \"json\"];\nexport type FieldFormat = (typeof FIELD_FORMATS)[number];\n/**\n * Whether a field is stored in plaintext (visible to anyone with read access)\n * or encrypted (requires KMS + the right encryption context to read).\n */\nexport declare const FIELD_SENSITIVITIES: readonly [\"plaintext\", \"encrypted\"];\nexport type FieldSensitivity = (typeof FIELD_SENSITIVITIES)[number];\n/**\n * A field on a secret. `value` is always a string at the wire; for encrypted\n * fields it's the plaintext at the API edge (the service encrypts before\n * persistence). Reads from the dashboard omit `value` for encrypted fields;\n * agents get a `FieldEnvelope` instead and decrypt locally.\n */\nexport interface Field {\n key: string;\n format?: FieldFormat;\n sensitivity: FieldSensitivity;\n value: string;\n}\n/**\n * Secret category — drives icon/template/filter behaviour. Defaults to\n * `\"other\"` for migrated rows.\n */\nexport declare const SECRET_CATEGORIES: readonly [\"login\", \"api_key\", \"database\", \"ssh_key\", \"certificate\", \"secure_note\", \"credit_card\", \"identity\", \"wifi\", \"other\"];\nexport type SecretCategory = (typeof SECRET_CATEGORIES)[number];\n/**\n * One field as exposed to readers. Encrypted fields have no `value` on the\n * dashboard read path; the agent-side aggregate carries `envelope` instead.\n */\nexport interface FieldView {\n key: string;\n format?: FieldFormat;\n sensitivity: FieldSensitivity;\n /** Present for `sensitivity: \"plaintext\"` only. */\n value?: string;\n /** Present for `sensitivity: \"encrypted\"` on agent-side reads only. */\n envelope?: EncryptedEnvelopeV1;\n /** Plaintext fields that opt into `format: \"json\"` are pre-parsed for callers. */\n parsedValue?: unknown;\n rotatedAt?: string;\n createdAt: string;\n updatedAt: string;\n}\n/** A secret as assembled from its multi-row aggregate. */\nexport interface SecretAggregate {\n secretId: string;\n secretName: string;\n description?: string;\n tags: string[];\n category: SecretCategory;\n fields: FieldView[];\n changelogVersion: number;\n createdAt: string;\n updatedAt: string;\n}\n/** Metadata-only projection — used by list endpoints. */\nexport interface SecretMetadata {\n secretId: string;\n secretName: string;\n description?: string;\n tags: string[];\n category: SecretCategory;\n fieldKeys: string[];\n changelogVersion: number;\n createdAt: string;\n updatedAt: string;\n}\n/**\n * Per-field encrypted envelope returned to agents on the agent-side aggregate.\n * Agents decrypt locally using a data key fetched from `/decrypt-data-key`.\n */\nexport interface FieldEnvelope {\n key: string;\n format?: FieldFormat;\n envelope: EncryptedEnvelopeV1;\n rotatedAt?: string;\n createdAt: string;\n updatedAt: string;\n}\n/** A scope the caller can read or write secrets in. */\nexport interface ScopeInfo {\n scope: SecretScope;\n scopeId: string;\n name?: string;\n}\n/**\n * KMS-issued data key, returned by the secrets service's\n * `/secrets/generate-data-key` KMS proxy endpoint. The plaintext key is\n * returned base64-encoded; callers MUST decode it to a Buffer and zero the\n * Buffer after use — never keep the plaintext as a JS string.\n */\nexport interface GeneratedDataKey {\n plaintextKey: string;\n dataKeyCiphertext: string;\n}\n/**\n * Action types recorded in the secret changelog. Append-only.\n */\nexport declare const CHANGELOG_ACTIONS: readonly [\"created\", \"deleted\", \"metadata_updated\", \"field_added\", \"field_rotated\", \"field_removed\", \"tag_added\", \"tag_removed\"];\nexport type ChangelogAction = (typeof CHANGELOG_ACTIONS)[number];\n/** Who triggered a changelog entry. */\nexport interface ChangelogActor {\n kind: \"user\" | \"agent\" | \"system\";\n id: string;\n}\n/**\n * One audit row from the secret's changelog. Metadata only — never carries\n * field VALUES (old or new). Rolling back a rotated secret is intentionally\n * not supported.\n */\nexport interface ChangelogEntry {\n changelogVersion: number;\n action: ChangelogAction;\n fieldKey?: string;\n fieldSensitivity?: FieldSensitivity;\n changedBy: ChangelogActor;\n reason?: string;\n timestamp: string;\n}\n//# sourceMappingURL=secrets.d.ts.map"],"mappings":";;ACWA;AAMA;AAEA;AAIA;;;;;AAEqBiB,cDDAb,aCQpB,EAAA;EACWa,SAAAA,GAAAA,EAAAA,KAAAA;EAAuB,SAAA,IAAA,EAAA,MAAA;WAAWA,OAAAA,EAAAA,SAAAA;WAAsCA,KAAAA,EAAAA,OAAAA;CAAuB;AAE1FE,KDLLf,aAAAA,GCKuB,CAAA,ODLCA,aCKD,CAAA,CAAA,MAAA,ODL6BA,aCK7B,CAAA;;;;;ADLCA,cC1BfO,qBD0BeP,EAAAA;WAA4BA,MAAAA,EAAAA,QAAAA;EAAa,SAAA,MAAA,EAAA,QAAA;;KCtBjEO,qBAAAA,WAAgCA,oCAAoCA;AAJhF;AAIYA,cAGSE,gBAHY,EAAA;EAAA,SAAA,GAAA,EAAA,KAAA;WAAWF,IAAAA,EAAAA,MAAAA;WAAoCA,OAAAA,EAAAA,SAAAA;EAAqB,SAAA,KAAA,EAAA,OAAA;AAGrG,CAAA;AAMYE,KAAAA,gBAAAA,GAAmBJ,aAAAA;AAMnBM,cAJSA,wBAIe,EAAA;EAAA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