@opengeni/contracts 3.1.0-canary.2 → 3.1.2
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/agent-authored-durable-text.d.ts +9 -9
- package/dist/agent-config.d.ts +971 -0
- package/dist/agent-instruction-changes.d.ts +0 -2
- package/dist/allowance-refusal.d.ts +9 -0
- package/dist/allowance-refusal.js +50 -0
- package/dist/allowance-refusal.js.map +1 -0
- package/dist/analytics-consent-report.d.ts +19 -0
- package/dist/analytics-consent-report.js +10 -0
- package/dist/analytics-consent-report.js.map +1 -0
- package/dist/api-key-presets.d.ts +19 -0
- package/dist/artifact-catalog.d.ts +188 -0
- package/dist/artifacts.d.ts +86 -0
- package/dist/atlassian-native-retirement.d.ts +16 -0
- package/dist/atlassian-native-retirement.js +30 -0
- package/dist/atlassian-native-retirement.js.map +1 -0
- package/dist/atlassian.d.ts +1 -0
- package/dist/atlassian.js +34 -19
- package/dist/browser-storage.d.ts +5 -0
- package/dist/browser-storage.js +9 -0
- package/dist/browser-storage.js.map +1 -0
- package/dist/bundled-skills.d.ts +24 -1
- package/dist/canonical-human-identities.js +2 -1
- package/dist/chunk-2ZIHHL72.js +153 -0
- package/dist/chunk-2ZIHHL72.js.map +1 -0
- package/dist/{chunk-5LYFSZ7O.js → chunk-352X6ENP.js} +31 -31
- package/dist/chunk-4JGHSSB7.js +11 -0
- package/dist/chunk-4JGHSSB7.js.map +1 -0
- package/dist/chunk-4QO6GJUX.js +85 -0
- package/dist/chunk-4QO6GJUX.js.map +1 -0
- package/dist/chunk-4VDMHLLL.js +49 -0
- package/dist/chunk-4VDMHLLL.js.map +1 -0
- package/dist/chunk-56SNIMDO.js +9 -0
- package/dist/chunk-56SNIMDO.js.map +1 -0
- package/dist/chunk-6C2HKFTU.js +207 -0
- package/dist/chunk-6C2HKFTU.js.map +1 -0
- package/dist/chunk-6IXO76Z6.js +72 -0
- package/dist/chunk-6IXO76Z6.js.map +1 -0
- package/dist/chunk-7272KVWZ.js +60 -0
- package/dist/chunk-7272KVWZ.js.map +1 -0
- package/dist/{chunk-7ABONTXE.js → chunk-E3GGUBHS.js} +49 -5
- package/dist/chunk-E3GGUBHS.js.map +1 -0
- package/dist/chunk-EFZYKUE2.js +767 -0
- package/dist/chunk-EFZYKUE2.js.map +1 -0
- package/dist/chunk-EKWNTOG3.js +154 -0
- package/dist/chunk-EKWNTOG3.js.map +1 -0
- package/dist/chunk-HABQ7ADB.js +234 -0
- package/dist/chunk-HABQ7ADB.js.map +1 -0
- package/dist/chunk-HRRU4QPI.js +91 -0
- package/dist/chunk-HRRU4QPI.js.map +1 -0
- package/dist/{chunk-3SIZGL3O.js → chunk-IK36LXKC.js} +18 -2
- package/dist/chunk-IK36LXKC.js.map +1 -0
- package/dist/{chunk-TXTQIYCV.js → chunk-ILJ72KPO.js} +56 -3
- package/dist/chunk-ILJ72KPO.js.map +1 -0
- package/dist/chunk-J4HQ3UKY.js +93 -0
- package/dist/chunk-J4HQ3UKY.js.map +1 -0
- package/dist/chunk-KHHZTBP7.js +11 -0
- package/dist/chunk-KHHZTBP7.js.map +1 -0
- package/dist/{chunk-WYBDERIY.js → chunk-LZ2LAHIX.js} +47 -41
- package/dist/chunk-LZ2LAHIX.js.map +1 -0
- package/dist/chunk-NDZHPTCL.js +400 -0
- package/dist/chunk-NDZHPTCL.js.map +1 -0
- package/dist/chunk-OF6OKOBF.js +54793 -0
- package/dist/chunk-OF6OKOBF.js.map +1 -0
- package/dist/chunk-OL23ARTF.js +94 -0
- package/dist/chunk-OL23ARTF.js.map +1 -0
- package/dist/chunk-PUIUXIOL.js +189 -0
- package/dist/chunk-PUIUXIOL.js.map +1 -0
- package/dist/{chunk-Y3KNXVTD.js → chunk-RMWXDZEO.js} +128 -21
- package/dist/chunk-RMWXDZEO.js.map +1 -0
- package/dist/{chunk-MRWYRAS5.js → chunk-SHO4YO4B.js} +27 -35
- package/dist/chunk-SHO4YO4B.js.map +1 -0
- package/dist/chunk-SWRN2DJ3.js +153 -0
- package/dist/chunk-SWRN2DJ3.js.map +1 -0
- package/dist/chunk-TCXCRBPF.js +267 -0
- package/dist/chunk-TCXCRBPF.js.map +1 -0
- package/dist/chunk-TLU3UEMD.js +324 -0
- package/dist/chunk-TLU3UEMD.js.map +1 -0
- package/dist/chunk-TSWWZMUS.js +186 -0
- package/dist/chunk-TSWWZMUS.js.map +1 -0
- package/dist/{chunk-PX3VCKAU.js → chunk-WVCFSOUZ.js} +1 -1
- package/dist/{chunk-PX3VCKAU.js.map → chunk-WVCFSOUZ.js.map} +1 -1
- package/dist/chunk-XDLAGX66.js +127 -0
- package/dist/chunk-XDLAGX66.js.map +1 -0
- package/dist/chunk-YKZ4WU4P.js +33 -0
- package/dist/chunk-YKZ4WU4P.js.map +1 -0
- package/dist/{chunk-O5LEQHDM.js → chunk-Z7WEVGCL.js} +3 -3
- package/dist/{chunk-YBW5JSA3.js → chunk-ZDCRWCGZ.js} +119 -101
- package/dist/chunk-ZDCRWCGZ.js.map +1 -0
- package/dist/claude-provider-account-authority.d.ts +18 -0
- package/dist/claude-subscription-oauth.d.ts +42 -0
- package/dist/claude-subscription-usage.d.ts +159 -0
- package/dist/client-error-report.d.ts +158 -0
- package/dist/client-error-report.js +164 -0
- package/dist/client-error-report.js.map +1 -0
- package/dist/code-search.d.ts +52 -0
- package/dist/code-search.js +40 -0
- package/dist/code-search.js.map +1 -0
- package/dist/codex-provider-account-authority.js +20 -12
- package/dist/codex-provider-account-authority.js.map +1 -1
- package/dist/company-profile.d.ts +144 -6
- package/dist/connect.d.ts +37 -0
- package/dist/connect.js +216 -159
- package/dist/connect.js.map +1 -1
- package/dist/connection-account-label.d.ts +2 -0
- package/dist/connection-account-label.js +35 -0
- package/dist/connection-account-label.js.map +1 -0
- package/dist/connection-authority.d.ts +9 -317
- package/dist/connection-authority.js +37 -42
- package/dist/connector-attachments.js +2 -1
- package/dist/connector-destinations.js +2 -1
- package/dist/connector-tool-permissions.d.ts +137 -0
- package/dist/cua-desktop-tools.d.ts +17 -0
- package/dist/define-schema.d.ts +8 -0
- package/dist/direct-model-provider.d.ts +36 -0
- package/dist/editable-artifact-codec-registry.js +5 -5
- package/dist/editable-artifact-committed-transaction.js +3 -2
- package/dist/editable-artifact-live.js +5 -5
- package/dist/editable-artifact-serialized-commit.js +6 -6
- package/dist/editable-artifact-versions.d.ts +7 -1
- package/dist/editable-artifact-versions.js +1 -1
- package/dist/editable-artifacts.js +62 -56
- package/dist/event-preview.d.ts +22 -0
- package/dist/external-identities.d.ts +138 -0
- package/dist/external-identities.js +9 -4
- package/dist/first-party-tool-authorization.d.ts +815 -0
- package/dist/github-repository-contracts.js +60 -43
- package/dist/github-repository-contracts.js.map +1 -1
- package/dist/google-drive.d.ts +2 -1
- package/dist/google-drive.js +305 -238
- package/dist/google-drive.js.map +1 -1
- package/dist/host-mcp-bindings.d.ts +5 -0
- package/dist/host-mcp-bindings.js +233 -170
- package/dist/host-mcp-bindings.js.map +1 -1
- package/dist/image-generation.d.ts +1 -0
- package/dist/index.d.ts +16761 -5946
- package/dist/index.js +1973 -260
- package/dist/insights-usage.d.ts +877 -0
- package/dist/insights-usage.js +559 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +1176 -829
- package/dist/knowledge-entries.d.ts +81 -2
- package/dist/knowledge-preparation.d.ts +239 -0
- package/dist/managed-auth-session-sets.d.ts +7 -0
- package/dist/managed-auth-session-sets.js +198 -132
- package/dist/managed-auth-session-sets.js.map +1 -1
- package/dist/managed-sign-in-methods.d.ts +56 -0
- package/dist/managed-sign-in-methods.js +64 -0
- package/dist/managed-sign-in-methods.js.map +1 -0
- package/dist/mcp-catalog-limits.d.ts +2 -0
- package/dist/mcp-oauth.d.ts +2 -2
- package/dist/mcp-structured-content.d.ts +25 -0
- package/dist/modal-native-proof-v2.d.ts +587 -0
- package/dist/modal-native-proof-v2.js +38 -0
- package/dist/modal-native-proof-v2.js.map +1 -0
- package/dist/model-account-choice.d.ts +235 -0
- package/dist/model-account-settings.d.ts +422 -0
- package/dist/model-availability.d.ts +15 -0
- package/dist/model-connection-access.d.ts +13 -0
- package/dist/model-context-inspector.d.ts +98 -0
- package/dist/model-display.d.ts +43 -0
- package/dist/model-display.js +17 -0
- package/dist/model-display.js.map +1 -0
- package/dist/model-picker-order.d.ts +3 -1
- package/dist/model-picker-order.js +3 -0
- package/dist/model-picker-order.js.map +1 -1
- package/dist/organization-access.d.ts +412 -0
- package/dist/organization-access.js +39 -0
- package/dist/organization-access.js.map +1 -0
- package/dist/organization-integration-policy.d.ts +27 -0
- package/dist/organization-membership-lifecycle.d.ts +38 -0
- package/dist/organization-model-usage.d.ts +146 -0
- package/dist/organization-model-usage.js +78 -0
- package/dist/organization-model-usage.js.map +1 -0
- package/dist/organization-recovery.js +2 -1
- package/dist/organization-usage.d.ts +138 -0
- package/dist/permissions.d.ts +18 -0
- package/dist/personal-github.d.ts +1 -0
- package/dist/personal-github.js +199 -144
- package/dist/personal-github.js.map +1 -1
- package/dist/prepared-mcp-setup.d.ts +54 -0
- package/dist/prepared-mcp-setup.js +12 -0
- package/dist/prepared-mcp-setup.js.map +1 -0
- package/dist/product-analytics.d.ts +116 -0
- package/dist/product-lifecycle-facts.d.ts +73 -0
- package/dist/remember.d.ts +98 -6
- package/dist/retained-output.d.ts +8 -0
- package/dist/sandbox-file-artifacts.d.ts +1 -0
- package/dist/sandbox-provider-command.d.ts +91 -1
- package/dist/sandbox-recovery.d.ts +146 -0
- package/dist/secret-generator.d.ts +44 -0
- package/dist/secret-references.d.ts +90 -0
- package/dist/secret-resolution.d.ts +111 -0
- package/dist/secret-totp.d.ts +41 -0
- package/dist/session-final-reply.d.ts +6 -0
- package/dist/session-final-reply.js +9 -0
- package/dist/session-final-reply.js.map +1 -0
- package/dist/session-goal-reports.d.ts +21 -0
- package/dist/session-history-import.d.ts +1272 -0
- package/dist/session-list-entries.d.ts +4 -0
- package/dist/session-list-entries.js +56 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-mcp-projections.d.ts +6 -0
- package/dist/session-mcp-tool-permissions.d.ts +62 -0
- package/dist/session-message-search.d.ts +68 -0
- package/dist/session-target.d.ts +18 -0
- package/dist/session-titles.d.ts +8 -0
- package/dist/session-titles.js +5 -1
- package/dist/session-usage-limit-refusal.d.ts +34 -0
- package/dist/session-usage-limit-refusal.js +15 -0
- package/dist/session-usage-limit-refusal.js.map +1 -0
- package/dist/session-usage-limits.d.ts +127 -0
- package/dist/session-usage-limits.js +41 -0
- package/dist/session-usage-limits.js.map +1 -0
- package/dist/signup-attribution.d.ts +39 -0
- package/dist/site-data.d.ts +286 -0
- package/dist/site-operations.d.ts +39 -0
- package/dist/site-publishing.d.ts +778 -0
- package/dist/site-session-http.d.ts +89 -4
- package/dist/site-session-http.js +25 -1
- package/dist/site-sql.d.ts +421 -0
- package/dist/skill-catalog-context.d.ts +7 -0
- package/dist/skill-files.d.ts +1 -1
- package/dist/skill-use.d.ts +61 -0
- package/dist/skills.d.ts +15 -0
- package/dist/slack-bot-scopes.d.ts +17 -12
- package/dist/slack-bot-scopes.js +10 -3
- package/dist/slack-rest-mcp.d.ts +36 -0
- package/dist/slack-rest-mcp.js +25 -0
- package/dist/slack-rest-mcp.js.map +1 -0
- package/dist/spreadsheet-artifact-commands.d.ts +14 -1
- package/dist/spreadsheet-artifact-commands.js +8 -2
- package/dist/spreadsheet-artifact-query.d.ts +13 -6
- package/dist/spreadsheet-artifact-query.js +3 -3
- package/dist/subscription-account-actions.d.ts +64 -0
- package/dist/subscription-account-pools.d.ts +292 -0
- package/dist/subscription-personal-authority-v2.d.ts +28 -0
- package/dist/subscription-personal-authority-v2.js +12 -0
- package/dist/subscription-personal-authority-v2.js.map +1 -0
- package/dist/tool-action-review.d.ts +132 -0
- package/dist/tool-catalog.d.ts +408 -0
- package/dist/tool-policy.d.ts +5 -0
- package/dist/tool-review-presentation.d.ts +12 -0
- package/dist/tool-review-presentation.js +17 -0
- package/dist/tool-review-presentation.js.map +1 -0
- package/dist/transcription-recordings.d.ts +21 -0
- package/dist/turn-serving-policy.d.ts +221 -0
- package/dist/usage-allowances.d.ts +314 -0
- package/dist/usage-allowances.js +52 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/vaults.d.ts +1286 -0
- package/dist/video-generation.d.ts +3 -0
- package/dist/video-generation.js +2 -1
- package/dist/workspace-integration-wire.d.ts +36 -0
- package/dist/workspace-integration-wire.js +23 -0
- package/dist/workspace-integration-wire.js.map +1 -0
- package/dist/workspace-integrations.d.ts +1028 -0
- package/dist/xai-provider-account-authority.js +2 -1
- package/package.json +93 -5
- package/src/agent-authored-durable-text.ts +14 -11
- package/src/agent-config.ts +1698 -0
- package/src/agent-instruction-changes.ts +91 -74
- package/src/agent-learning.ts +94 -67
- package/src/agent-topology.ts +57 -52
- package/src/allowance-refusal.ts +81 -0
- package/src/analytics-consent-report.ts +20 -0
- package/src/api-key-presets.ts +28 -0
- package/src/artifact-catalog.ts +82 -0
- package/src/artifacts.ts +299 -227
- package/src/atlassian-native-retirement.ts +33 -0
- package/src/atlassian.ts +135 -108
- package/src/browser-storage.ts +10 -0
- package/src/bundled-skills.ts +60 -17
- package/src/canonical-human-identities.ts +60 -58
- package/src/claude-provider-account-authority.ts +12 -0
- package/src/claude-subscription-oauth.ts +73 -0
- package/src/claude-subscription-usage.ts +68 -0
- package/src/client-error-report.ts +343 -0
- package/src/code-search.ts +105 -0
- package/src/codex-provider-account-authority.ts +21 -16
- package/src/company-brain-governed-writes.ts +255 -233
- package/src/company-brain.ts +164 -153
- package/src/company-profile.ts +365 -292
- package/src/connect.ts +212 -173
- package/src/connection-account-label.ts +46 -0
- package/src/connection-authority.ts +183 -364
- package/src/connector-attachments.ts +137 -122
- package/src/connector-destinations.ts +46 -42
- package/src/connector-tool-permissions.ts +117 -0
- package/src/cua-desktop-tools.gen.json +6512 -0
- package/src/cua-desktop-tools.linux.gen.json +6600 -0
- package/src/cua-desktop-tools.ts +36 -0
- package/src/cua-desktop-tools.windows.gen.json +6353 -0
- package/src/define-schema.ts +10 -0
- package/src/direct-model-provider.ts +108 -0
- package/src/editable-artifact-committed-transaction.ts +17 -0
- package/src/editable-artifact-versions.ts +7 -1
- package/src/event-preview.ts +53 -3
- package/src/external-identities.ts +249 -176
- package/src/feedback.ts +43 -30
- package/src/first-party-tool-authorization.ts +356 -0
- package/src/github-repository-contracts.ts +78 -64
- package/src/google-drive.ts +285 -234
- package/src/governed-learning-activation.ts +152 -131
- package/src/governed-learning-evaluator.ts +140 -133
- package/src/host-mcp-bindings.ts +252 -198
- package/src/image-generation.ts +104 -95
- package/src/index.ts +13235 -8687
- package/src/insights-usage.ts +727 -0
- package/src/interaction.ts +3070 -2326
- package/src/knowledge-entries.ts +361 -276
- package/src/knowledge-preparation.ts +57 -0
- package/src/knowledge.ts +246 -213
- package/src/managed-auth-session-sets.ts +220 -144
- package/src/managed-sign-in-methods.ts +52 -0
- package/src/mcp-catalog-limits.ts +2 -0
- package/src/mcp-oauth.ts +43 -34
- package/src/mcp-receipts.ts +192 -192
- package/src/mcp-structured-content.ts +81 -0
- package/src/memory-slack-delivery.ts +171 -142
- package/src/modal-native-proof-v2.ts +429 -0
- package/src/model-account-choice.ts +177 -0
- package/src/model-account-settings.ts +210 -0
- package/src/model-availability.ts +22 -0
- package/src/model-connection-access.ts +61 -14
- package/src/model-context-inspector.ts +133 -99
- package/src/model-display.ts +221 -0
- package/src/model-picker-order.ts +12 -1
- package/src/organization-access.ts +217 -0
- package/src/organization-integration-policy.ts +63 -0
- package/src/organization-membership-lifecycle.ts +528 -382
- package/src/organization-model-usage.ts +81 -0
- package/src/organization-recovery.ts +147 -135
- package/src/organization-usage.ts +94 -0
- package/src/permissions.ts +88 -52
- package/src/personal-github.ts +210 -171
- package/src/preference-registry.ts +314 -258
- package/src/prepared-mcp-setup.ts +189 -0
- package/src/product-analytics.ts +261 -0
- package/src/product-lifecycle-facts.ts +122 -0
- package/src/remember.ts +181 -167
- package/src/retained-output.ts +194 -165
- package/src/sandbox-file-artifacts.ts +60 -47
- package/src/sandbox-provider-command.ts +88 -20
- package/src/sandbox-recovery.ts +129 -0
- package/src/scoped-knowledge.ts +61 -43
- package/src/secret-generator.ts +155 -0
- package/src/secret-references.ts +414 -0
- package/src/secret-resolution.ts +274 -0
- package/src/secret-totp.ts +188 -0
- package/src/session-final-reply.ts +16 -0
- package/src/session-goal-reports.ts +64 -0
- package/src/session-history-import.ts +177 -0
- package/src/session-list-entries.ts +96 -0
- package/src/session-mcp-projections.ts +11 -0
- package/src/session-mcp-tool-permissions.ts +108 -0
- package/src/session-message-search.ts +61 -0
- package/src/session-target.ts +57 -0
- package/src/session-titles.ts +80 -10
- package/src/session-topology-primitives.ts +19 -12
- package/src/session-usage-limit-refusal.ts +101 -0
- package/src/session-usage-limits.ts +171 -0
- package/src/signup-attribution.ts +86 -0
- package/src/site-data.ts +339 -0
- package/src/site-operations.ts +154 -0
- package/src/site-publishing.ts +876 -0
- package/src/site-session-http.ts +294 -16
- package/src/site-sql.ts +1123 -0
- package/src/skill-catalog-context.ts +50 -0
- package/src/skill-files.ts +3 -3
- package/src/skill-use.ts +80 -0
- package/src/skills.ts +82 -54
- package/src/slack-bot-scopes.ts +31 -39
- package/src/slack-rest-mcp.ts +222 -0
- package/src/slack-task-policy.ts +96 -73
- package/src/spreadsheet-artifact-commands.ts +73 -2
- package/src/spreadsheet-artifact-query.ts +187 -39
- package/src/subscription-account-actions.ts +84 -0
- package/src/subscription-account-pools.ts +53 -0
- package/src/subscription-personal-authority-v2.ts +66 -0
- package/src/task-notes.ts +55 -51
- package/src/tool-action-review.ts +258 -0
- package/src/tool-catalog.ts +609 -372
- package/src/tool-policy.ts +82 -0
- package/src/tool-result-spill.ts +12 -9
- package/src/tool-review-presentation.ts +385 -0
- package/src/transcription-recordings.ts +145 -131
- package/src/turn-serving-policy.ts +166 -0
- package/src/usage-allowances.ts +248 -0
- package/src/vaults.ts +850 -0
- package/src/video-generation.ts +385 -360
- package/src/work-claims.ts +173 -149
- package/src/workspace-instruction-policies.ts +349 -276
- package/src/workspace-integration-wire.ts +101 -0
- package/src/workspace-integrations.ts +724 -0
- package/src/workspace-learning-administration.ts +57 -44
- package/src/workspace-learning-policy.ts +127 -96
- package/src/workspace-state.ts +250 -220
- package/src/xai-provider-account-authority.ts +22 -17
- package/dist/chunk-2AC63F4S.js +0 -171
- package/dist/chunk-2AC63F4S.js.map +0 -1
- package/dist/chunk-3SIZGL3O.js.map +0 -1
- package/dist/chunk-7ABONTXE.js.map +0 -1
- package/dist/chunk-BCS7WHCK.js +0 -139
- package/dist/chunk-BCS7WHCK.js.map +0 -1
- package/dist/chunk-GRG7PHWQ.js +0 -25
- package/dist/chunk-GRG7PHWQ.js.map +0 -1
- package/dist/chunk-JUFK3T4Q.js +0 -80
- package/dist/chunk-JUFK3T4Q.js.map +0 -1
- package/dist/chunk-M5ZGRVIQ.js +0 -719
- package/dist/chunk-M5ZGRVIQ.js.map +0 -1
- package/dist/chunk-MRWYRAS5.js.map +0 -1
- package/dist/chunk-OVFORMPW.js +0 -348
- package/dist/chunk-OVFORMPW.js.map +0 -1
- package/dist/chunk-P3HLDT77.js +0 -59
- package/dist/chunk-P3HLDT77.js.map +0 -1
- package/dist/chunk-QQUJ6NPW.js +0 -23093
- package/dist/chunk-QQUJ6NPW.js.map +0 -1
- package/dist/chunk-TXTQIYCV.js.map +0 -1
- package/dist/chunk-WYBDERIY.js.map +0 -1
- package/dist/chunk-Y3KNXVTD.js.map +0 -1
- package/dist/chunk-YBW5JSA3.js.map +0 -1
- package/dist/chunk-YRXAWWCU.js +0 -45
- package/dist/chunk-YRXAWWCU.js.map +0 -1
- package/dist/host-mcp-resolvers.d.ts +0 -32
- package/dist/host-mcp-resolvers.js +0 -34
- package/dist/host-mcp-resolvers.js.map +0 -1
- package/src/host-mcp-resolvers.ts +0 -50
- /package/dist/{chunk-5LYFSZ7O.js.map → chunk-352X6ENP.js.map} +0 -0
- /package/dist/{chunk-O5LEQHDM.js.map → chunk-Z7WEVGCL.js.map} +0 -0
package/src/vaults.ts
ADDED
|
@@ -0,0 +1,850 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
2
|
+
/**
|
|
3
|
+
* Vaults: the Opengeni secrets model (replaces variable sets).
|
|
4
|
+
*
|
|
5
|
+
* A vault holds a flat list of items; an item holds named fields; hosted
|
|
6
|
+
* fields keep encrypted versions. Every type here is `z.infer` of its schema.
|
|
7
|
+
*
|
|
8
|
+
* This module must not import runtime values from `./index` (the index
|
|
9
|
+
* re-exports it); only types cross that edge.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { GeneratePasswordSpec } from "./secret-generator";
|
|
13
|
+
|
|
14
|
+
export const VaultOwnerKind = /* @__PURE__ */ defineSchema(() =>
|
|
15
|
+
z.enum(["user", "workspace", "organization", "task"]),
|
|
16
|
+
);
|
|
17
|
+
export type VaultOwnerKind = z.infer<typeof VaultOwnerKind>;
|
|
18
|
+
export const VaultSource = /* @__PURE__ */ defineSchema(() =>
|
|
19
|
+
z.enum(["opengeni", "onepassword", "host"]),
|
|
20
|
+
);
|
|
21
|
+
export type VaultSource = z.infer<typeof VaultSource>;
|
|
22
|
+
export const VaultMode = /* @__PURE__ */ defineSchema(() => z.enum(["read_write", "read_only"]));
|
|
23
|
+
export type VaultMode = z.infer<typeof VaultMode>;
|
|
24
|
+
export const VaultSyncStatus = /* @__PURE__ */ defineSchema(() =>
|
|
25
|
+
z.enum(["ok", "syncing", "error", "auth_expired", "rate_limited"]),
|
|
26
|
+
);
|
|
27
|
+
export type VaultSyncStatus = z.infer<typeof VaultSyncStatus>;
|
|
28
|
+
export const VaultItemType = /* @__PURE__ */ defineSchema(() =>
|
|
29
|
+
z.enum(["login", "api_key", "note", "file", "passkey"]),
|
|
30
|
+
);
|
|
31
|
+
export type VaultItemType = z.infer<typeof VaultItemType>;
|
|
32
|
+
export const VaultFieldKind = /* @__PURE__ */ defineSchema(() =>
|
|
33
|
+
z.enum(["text", "concealed", "totp", "file"]),
|
|
34
|
+
);
|
|
35
|
+
export type VaultFieldKind = z.infer<typeof VaultFieldKind>;
|
|
36
|
+
/** Lookup order for references that name no vault; index = tier. */
|
|
37
|
+
export const VAULT_LOOKUP_TIERS = ["task", "user", "workspace", "organization"] as const;
|
|
38
|
+
export type VaultLookupTier = (typeof VAULT_LOOKUP_TIERS)[number];
|
|
39
|
+
|
|
40
|
+
export const VAULT_LIMITS = {
|
|
41
|
+
vaultsPerOwnerScope: 200,
|
|
42
|
+
itemsPerVault: 2_000,
|
|
43
|
+
fieldsPerItem: 50,
|
|
44
|
+
versionsPerField: 10,
|
|
45
|
+
nameMaxChars: 120,
|
|
46
|
+
descriptionMaxChars: 2_000,
|
|
47
|
+
websitesPerItem: 20,
|
|
48
|
+
websiteMaxChars: 2_048,
|
|
49
|
+
textValueMaxBytes: 65_536,
|
|
50
|
+
fileValueMaxBytes: 262_144,
|
|
51
|
+
referenceMaxChars: 300,
|
|
52
|
+
execEnvMaxBytes: 262_144,
|
|
53
|
+
execValueMaxBytes: 102_400,
|
|
54
|
+
policyVaultIdsMax: 200,
|
|
55
|
+
searchResultsMax: 50,
|
|
56
|
+
/** Items one agent search call examines before it returns a cursor. */
|
|
57
|
+
searchScanMax: 1_000,
|
|
58
|
+
searchCursorMaxChars: 1_024,
|
|
59
|
+
providerReadsPerAttempt: 50,
|
|
60
|
+
providerValueCacheMs: 60_000,
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
/** Default names of lazily created hosted vaults (Q-06). */
|
|
64
|
+
export const DEFAULT_VAULT_NAMES = {
|
|
65
|
+
user: "Private",
|
|
66
|
+
workspace: "Shared",
|
|
67
|
+
task: "Task",
|
|
68
|
+
} as const;
|
|
69
|
+
|
|
70
|
+
/** Default primary field per item type (§10B.2); passkeys have none. */
|
|
71
|
+
export const VAULT_DEFAULT_PRIMARY_FIELD: Readonly<Record<VaultItemType, string | null>> = {
|
|
72
|
+
login: "password",
|
|
73
|
+
api_key: "value",
|
|
74
|
+
note: "note",
|
|
75
|
+
file: "file",
|
|
76
|
+
passkey: null,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** Fixed passkey fields (D20). `privateKey` is concealed; the rest are text. */
|
|
80
|
+
export const PASSKEY_FIELD_NAMES = [
|
|
81
|
+
"rpId",
|
|
82
|
+
"credentialId",
|
|
83
|
+
"userHandle",
|
|
84
|
+
"userName",
|
|
85
|
+
"privateKey",
|
|
86
|
+
] as const;
|
|
87
|
+
|
|
88
|
+
// Forbidden anywhere in a name: / { } # \ and C0/C1 control characters.
|
|
89
|
+
// oxlint-disable-next-line no-control-regex
|
|
90
|
+
const FORBIDDEN_NAME_CHARACTERS = /[/{}#\\\u0000-\u001f\u007f-\u009f]/;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Q-10: 1–120 characters, no `/ { } # \` or control characters, no leading
|
|
94
|
+
* or trailing whitespace, and not starting with `id:` (reserved for the ID
|
|
95
|
+
* reference form). Interior spaces and any other Unicode are allowed.
|
|
96
|
+
*/
|
|
97
|
+
export function isValidSecretName(name: string): boolean {
|
|
98
|
+
if (typeof name !== "string") return false;
|
|
99
|
+
const length = [...name].length;
|
|
100
|
+
if (length < 1 || length > VAULT_LIMITS.nameMaxChars) return false;
|
|
101
|
+
if (FORBIDDEN_NAME_CHARACTERS.test(name)) return false;
|
|
102
|
+
if (name.trim() !== name) return false;
|
|
103
|
+
if (name.toLowerCase().startsWith("id:")) return false;
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** True when `name` is reserved as a field name (the `/otp` suffix). */
|
|
108
|
+
export function isReservedVaultFieldName(name: string): boolean {
|
|
109
|
+
return name.normalize("NFC").trim().toLowerCase() === "otp";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const VaultName = /* @__PURE__ */ defineSchema(() =>
|
|
113
|
+
z.string().min(1).max(VAULT_LIMITS.nameMaxChars).refine(isValidSecretName, "invalid_secret_name"),
|
|
114
|
+
);
|
|
115
|
+
export const VaultFieldName = /* @__PURE__ */ defineSchema(() =>
|
|
116
|
+
VaultName.refine((name) => !isReservedVaultFieldName(name), "invalid_secret_name"),
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
export const VaultPolicy = /* @__PURE__ */ defineSchema(() =>
|
|
120
|
+
z.discriminatedUnion("mode", [
|
|
121
|
+
z.object({ mode: z.literal("all") }).strict(),
|
|
122
|
+
z
|
|
123
|
+
.object({
|
|
124
|
+
mode: z.literal("selected"),
|
|
125
|
+
vaultIds: z.array(z.string().uuid()).max(VAULT_LIMITS.policyVaultIdsMax),
|
|
126
|
+
})
|
|
127
|
+
.strict(),
|
|
128
|
+
]),
|
|
129
|
+
);
|
|
130
|
+
export type VaultPolicy = z.infer<typeof VaultPolicy>;
|
|
131
|
+
export const VAULT_POLICY_ALL: VaultPolicy = Object.freeze({ mode: "all" }) as VaultPolicy;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Intersect two policies. `all` is the identity; two selections keep the IDs
|
|
135
|
+
* present in both (order of `a`).
|
|
136
|
+
*/
|
|
137
|
+
export function intersectVaultPolicies(a: VaultPolicy, b: VaultPolicy): VaultPolicy {
|
|
138
|
+
if (a.mode === "all")
|
|
139
|
+
return b.mode === "all" ? VAULT_POLICY_ALL : { mode: "selected", vaultIds: [...b.vaultIds] };
|
|
140
|
+
if (b.mode === "all") return { mode: "selected", vaultIds: [...a.vaultIds] };
|
|
141
|
+
const allowed = new Set(b.vaultIds);
|
|
142
|
+
return { mode: "selected", vaultIds: a.vaultIds.filter((id) => allowed.has(id)) };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const VaultAvailability = /* @__PURE__ */ defineSchema(() =>
|
|
146
|
+
z
|
|
147
|
+
.object({
|
|
148
|
+
allowedWorkspaceIds: z.array(z.string().uuid()).max(500).nullable(), // null = every workspace
|
|
149
|
+
allowPersonalWorkspaces: z.boolean(),
|
|
150
|
+
})
|
|
151
|
+
.strict(),
|
|
152
|
+
);
|
|
153
|
+
export type VaultAvailability = z.infer<typeof VaultAvailability>;
|
|
154
|
+
|
|
155
|
+
export const VaultSummary = /* @__PURE__ */ defineSchema(() =>
|
|
156
|
+
z.object({
|
|
157
|
+
id: z.string().uuid(),
|
|
158
|
+
workspaceId: z.string().uuid(),
|
|
159
|
+
ownerKind: VaultOwnerKind,
|
|
160
|
+
/** "Only me" | workspace name | organization name | "This task" */
|
|
161
|
+
ownerLabel: z.string(),
|
|
162
|
+
rootSessionId: z.string().uuid().nullable(),
|
|
163
|
+
name: z.string(),
|
|
164
|
+
description: z.string().nullable(),
|
|
165
|
+
source: VaultSource,
|
|
166
|
+
mode: VaultMode,
|
|
167
|
+
syncStatus: VaultSyncStatus,
|
|
168
|
+
syncErrorCode: z.string().nullable(),
|
|
169
|
+
syncErrorMessage: z.string().nullable(),
|
|
170
|
+
lastSyncedAt: z.string().nullable(),
|
|
171
|
+
rateLimitedUntil: z.string().nullable(),
|
|
172
|
+
providerConnectionId: z.string().uuid().nullable(),
|
|
173
|
+
/** Organization and Only-me vaults; null for workspace and task vaults. */
|
|
174
|
+
availability: VaultAvailability.nullable(),
|
|
175
|
+
isDefault: z.boolean(),
|
|
176
|
+
itemCount: z.number().int(),
|
|
177
|
+
canWrite: z.boolean(),
|
|
178
|
+
canManage: z.boolean(),
|
|
179
|
+
generation: z.number().int(),
|
|
180
|
+
createdAt: z.string(),
|
|
181
|
+
updatedAt: z.string(),
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
184
|
+
export type VaultSummary = z.infer<typeof VaultSummary>;
|
|
185
|
+
|
|
186
|
+
export const VaultItemReferences = /* @__PURE__ */ defineSchema(() =>
|
|
187
|
+
z.object({
|
|
188
|
+
primary: z.string().nullable(),
|
|
189
|
+
otp: z.string().nullable(),
|
|
190
|
+
byField: z.record(z.string(), z.string()),
|
|
191
|
+
}),
|
|
192
|
+
);
|
|
193
|
+
export type VaultItemReferences = z.infer<typeof VaultItemReferences>;
|
|
194
|
+
|
|
195
|
+
export const VaultItemSummary = /* @__PURE__ */ defineSchema(() =>
|
|
196
|
+
z.object({
|
|
197
|
+
id: z.string().uuid(),
|
|
198
|
+
vaultId: z.string().uuid(),
|
|
199
|
+
type: VaultItemType,
|
|
200
|
+
name: z.string(),
|
|
201
|
+
websites: z.array(z.string()),
|
|
202
|
+
/** Value of a text field named "username". */
|
|
203
|
+
username: z.string().nullable(),
|
|
204
|
+
hasTotp: z.boolean(),
|
|
205
|
+
hasPasskey: z.boolean(),
|
|
206
|
+
expiresAt: z.string().nullable(),
|
|
207
|
+
archivedAt: z.string().nullable(),
|
|
208
|
+
lastUsedAt: z.string().nullable(),
|
|
209
|
+
updatedAt: z.string(),
|
|
210
|
+
references: VaultItemReferences,
|
|
211
|
+
}),
|
|
212
|
+
);
|
|
213
|
+
export type VaultItemSummary = z.infer<typeof VaultItemSummary>;
|
|
214
|
+
|
|
215
|
+
export const VaultItemField = /* @__PURE__ */ defineSchema(() =>
|
|
216
|
+
z.object({
|
|
217
|
+
id: z.string().uuid(),
|
|
218
|
+
name: z.string(),
|
|
219
|
+
kind: VaultFieldKind,
|
|
220
|
+
position: z.number().int(),
|
|
221
|
+
/** null for provider fields */
|
|
222
|
+
currentVersion: z.number().int().nullable(),
|
|
223
|
+
/** Plaintext ONLY for kind "text"; null otherwise. */
|
|
224
|
+
value: z.string().nullable(),
|
|
225
|
+
fileName: z.string().nullable(),
|
|
226
|
+
fileSize: z.number().int().nullable(),
|
|
227
|
+
reference: z.string(),
|
|
228
|
+
updatedAt: z.string(),
|
|
229
|
+
}),
|
|
230
|
+
);
|
|
231
|
+
export type VaultItemField = z.infer<typeof VaultItemField>;
|
|
232
|
+
|
|
233
|
+
export const PasskeySummary = /* @__PURE__ */ defineSchema(() =>
|
|
234
|
+
z.object({
|
|
235
|
+
rpId: z.string(),
|
|
236
|
+
userName: z.string().nullable(),
|
|
237
|
+
/** Last 8 characters of the credential ID. */
|
|
238
|
+
credentialIdSuffix: z.string(),
|
|
239
|
+
signCount: z.number().int(),
|
|
240
|
+
leasedUntil: z.string().nullable(),
|
|
241
|
+
lastUsedAt: z.string().nullable(),
|
|
242
|
+
}),
|
|
243
|
+
);
|
|
244
|
+
export type PasskeySummary = z.infer<typeof PasskeySummary>;
|
|
245
|
+
|
|
246
|
+
export const VaultItem = /* @__PURE__ */ defineSchema(() =>
|
|
247
|
+
VaultItemSummary.extend({
|
|
248
|
+
fields: z.array(VaultItemField),
|
|
249
|
+
passkey: PasskeySummary.nullable(),
|
|
250
|
+
aliases: z.array(z.string()),
|
|
251
|
+
primaryFieldId: z.string().uuid().nullable(),
|
|
252
|
+
createdBySubjectId: z.string().nullable(),
|
|
253
|
+
createdAt: z.string(),
|
|
254
|
+
generation: z.number().int(),
|
|
255
|
+
}),
|
|
256
|
+
);
|
|
257
|
+
export type VaultItem = z.infer<typeof VaultItem>;
|
|
258
|
+
|
|
259
|
+
export const VaultVersionCreatedByKind = /* @__PURE__ */ defineSchema(() =>
|
|
260
|
+
z.enum(["human", "agent", "api_key", "migration", "provider", "system"]),
|
|
261
|
+
);
|
|
262
|
+
export type VaultVersionCreatedByKind = z.infer<typeof VaultVersionCreatedByKind>;
|
|
263
|
+
|
|
264
|
+
export const VaultFieldVersionMeta = /* @__PURE__ */ defineSchema(() =>
|
|
265
|
+
z.object({
|
|
266
|
+
version: z.number().int(),
|
|
267
|
+
current: z.boolean(),
|
|
268
|
+
createdAt: z.string(),
|
|
269
|
+
createdByKind: VaultVersionCreatedByKind,
|
|
270
|
+
createdBySubjectId: z.string().nullable(),
|
|
271
|
+
}),
|
|
272
|
+
);
|
|
273
|
+
export type VaultFieldVersionMeta = z.infer<typeof VaultFieldVersionMeta>;
|
|
274
|
+
|
|
275
|
+
// ---------------------------------------------------------------------------
|
|
276
|
+
// Requests
|
|
277
|
+
// ---------------------------------------------------------------------------
|
|
278
|
+
|
|
279
|
+
export const CreateVaultRequest = /* @__PURE__ */ defineSchema(() =>
|
|
280
|
+
z
|
|
281
|
+
.object({
|
|
282
|
+
name: VaultName,
|
|
283
|
+
description: z.string().max(VAULT_LIMITS.descriptionMaxChars).optional(),
|
|
284
|
+
ownerKind: z.enum(["user", "workspace", "organization"]),
|
|
285
|
+
availability: VaultAvailability.optional(),
|
|
286
|
+
})
|
|
287
|
+
.strict(),
|
|
288
|
+
);
|
|
289
|
+
export type CreateVaultRequest = z.infer<typeof CreateVaultRequest>;
|
|
290
|
+
|
|
291
|
+
export const UpdateVaultRequest = /* @__PURE__ */ defineSchema(() =>
|
|
292
|
+
z
|
|
293
|
+
.object({
|
|
294
|
+
expectedGeneration: z.number().int(),
|
|
295
|
+
name: VaultName.optional(),
|
|
296
|
+
description: z.string().max(VAULT_LIMITS.descriptionMaxChars).nullable().optional(),
|
|
297
|
+
availability: VaultAvailability.optional(),
|
|
298
|
+
})
|
|
299
|
+
.strict(),
|
|
300
|
+
);
|
|
301
|
+
export type UpdateVaultRequest = z.infer<typeof UpdateVaultRequest>;
|
|
302
|
+
|
|
303
|
+
export const DeleteVaultRequest = /* @__PURE__ */ defineSchema(() =>
|
|
304
|
+
z.object({ confirmName: z.string().min(1) }).strict(),
|
|
305
|
+
);
|
|
306
|
+
export type DeleteVaultRequest = z.infer<typeof DeleteVaultRequest>;
|
|
307
|
+
|
|
308
|
+
const VALUE_SOURCE_KEYS = [
|
|
309
|
+
"value",
|
|
310
|
+
"generate",
|
|
311
|
+
"fromReference",
|
|
312
|
+
"fileBase64",
|
|
313
|
+
"restoreVersion",
|
|
314
|
+
"remove",
|
|
315
|
+
] as const;
|
|
316
|
+
|
|
317
|
+
/** Exactly one value source per field input. */
|
|
318
|
+
export function exactlyOneValueSource(
|
|
319
|
+
input: Partial<Record<(typeof VALUE_SOURCE_KEYS)[number], unknown>>,
|
|
320
|
+
): boolean {
|
|
321
|
+
return VALUE_SOURCE_KEYS.filter((key) => input[key] !== undefined).length === 1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export const VaultFieldInput = /* @__PURE__ */ defineSchema(() =>
|
|
325
|
+
z
|
|
326
|
+
.object({
|
|
327
|
+
fieldId: z.string().uuid().optional(),
|
|
328
|
+
name: VaultFieldName,
|
|
329
|
+
/** Default concealed; a field named "username" defaults to text. */
|
|
330
|
+
kind: VaultFieldKind.optional(),
|
|
331
|
+
value: z.string().optional(),
|
|
332
|
+
generate: GeneratePasswordSpec.optional(),
|
|
333
|
+
fromReference: z.string().max(VAULT_LIMITS.referenceMaxChars).optional(),
|
|
334
|
+
fileBase64: z.string().optional(),
|
|
335
|
+
fileName: z.string().max(255).optional(),
|
|
336
|
+
restoreVersion: z.number().int().optional(),
|
|
337
|
+
remove: z.literal(true).optional(),
|
|
338
|
+
})
|
|
339
|
+
.strict()
|
|
340
|
+
.refine(
|
|
341
|
+
exactlyOneValueSource,
|
|
342
|
+
"exactly one of value|generate|fromReference|fileBase64|restoreVersion|remove",
|
|
343
|
+
),
|
|
344
|
+
);
|
|
345
|
+
export type VaultFieldInput = z.infer<typeof VaultFieldInput>;
|
|
346
|
+
|
|
347
|
+
const CreateVaultItemShape = /* @__PURE__ */ defineSchema(() =>
|
|
348
|
+
z
|
|
349
|
+
.object({
|
|
350
|
+
type: VaultItemType,
|
|
351
|
+
name: VaultName,
|
|
352
|
+
websites: z
|
|
353
|
+
.array(z.string().max(VAULT_LIMITS.websiteMaxChars))
|
|
354
|
+
.max(VAULT_LIMITS.websitesPerItem)
|
|
355
|
+
.optional(),
|
|
356
|
+
expiresAt: z.string().datetime({ offset: true }).nullable().optional(),
|
|
357
|
+
fields: z.array(VaultFieldInput).max(VAULT_LIMITS.fieldsPerItem),
|
|
358
|
+
primaryFieldName: z.string().optional(),
|
|
359
|
+
})
|
|
360
|
+
.strict(),
|
|
361
|
+
);
|
|
362
|
+
export const CreateVaultItemRequest = CreateVaultItemShape;
|
|
363
|
+
export type CreateVaultItemRequest = z.infer<typeof CreateVaultItemRequest>;
|
|
364
|
+
|
|
365
|
+
export const UpdateVaultItemRequest = /* @__PURE__ */ defineSchema(() =>
|
|
366
|
+
CreateVaultItemShape.partial().extend({ expectedGeneration: z.number().int() }).strict(),
|
|
367
|
+
);
|
|
368
|
+
export type UpdateVaultItemRequest = z.infer<typeof UpdateVaultItemRequest>;
|
|
369
|
+
|
|
370
|
+
export const MoveVaultItemRequest = /* @__PURE__ */ defineSchema(() =>
|
|
371
|
+
z
|
|
372
|
+
.object({
|
|
373
|
+
targetVaultId: z.string().uuid(),
|
|
374
|
+
mode: z.enum(["move", "copy"]),
|
|
375
|
+
newName: VaultName.optional(),
|
|
376
|
+
})
|
|
377
|
+
.strict(),
|
|
378
|
+
);
|
|
379
|
+
export type MoveVaultItemRequest = z.infer<typeof MoveVaultItemRequest>;
|
|
380
|
+
|
|
381
|
+
export const RevealVaultFieldRequest = /* @__PURE__ */ defineSchema(() =>
|
|
382
|
+
z.object({ version: z.number().int().optional() }).strict(),
|
|
383
|
+
);
|
|
384
|
+
export type RevealVaultFieldRequest = z.infer<typeof RevealVaultFieldRequest>;
|
|
385
|
+
|
|
386
|
+
export const RevealVaultFieldResponse = /* @__PURE__ */ defineSchema(() =>
|
|
387
|
+
z.object({
|
|
388
|
+
value: z.string(),
|
|
389
|
+
encoding: z.enum(["utf8", "base64"]),
|
|
390
|
+
version: z.number().int().nullable(),
|
|
391
|
+
totp: z
|
|
392
|
+
.object({ code: z.string(), periodSeconds: z.number().int(), expiresAt: z.string() })
|
|
393
|
+
.nullable(),
|
|
394
|
+
}),
|
|
395
|
+
);
|
|
396
|
+
export type RevealVaultFieldResponse = z.infer<typeof RevealVaultFieldResponse>;
|
|
397
|
+
|
|
398
|
+
export const RestoreVaultFieldVersionRequest = /* @__PURE__ */ defineSchema(() =>
|
|
399
|
+
z.object({ version: z.number().int().positive() }).strict(),
|
|
400
|
+
);
|
|
401
|
+
export type RestoreVaultFieldVersionRequest = z.infer<typeof RestoreVaultFieldVersionRequest>;
|
|
402
|
+
|
|
403
|
+
const QueryBoolean = /* @__PURE__ */ defineSchema(() =>
|
|
404
|
+
z.preprocess(
|
|
405
|
+
(value) => (value === "true" ? true : value === "false" ? false : value),
|
|
406
|
+
z.boolean(),
|
|
407
|
+
),
|
|
408
|
+
);
|
|
409
|
+
const QueryInt = /* @__PURE__ */ defineSchema(() =>
|
|
410
|
+
z.preprocess(
|
|
411
|
+
(value) => (typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value),
|
|
412
|
+
z.number().int().min(1).max(200),
|
|
413
|
+
),
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
/** Query strings are accepted as strings too ("true", "50"). */
|
|
417
|
+
export const ListVaultItemsQuery = /* @__PURE__ */ defineSchema(() =>
|
|
418
|
+
z.object({
|
|
419
|
+
q: z.string().max(200).optional(),
|
|
420
|
+
type: VaultItemType.optional(),
|
|
421
|
+
includeArchived: QueryBoolean.optional(),
|
|
422
|
+
cursor: z.string().optional(),
|
|
423
|
+
limit: QueryInt.optional(),
|
|
424
|
+
}),
|
|
425
|
+
);
|
|
426
|
+
export type ListVaultItemsQuery = z.infer<typeof ListVaultItemsQuery>;
|
|
427
|
+
|
|
428
|
+
export const ListVaultsResponse = /* @__PURE__ */ defineSchema(() =>
|
|
429
|
+
z.object({ vaults: z.array(VaultSummary) }),
|
|
430
|
+
);
|
|
431
|
+
export type ListVaultsResponse = z.infer<typeof ListVaultsResponse>;
|
|
432
|
+
export const ListVaultItemsResponse = /* @__PURE__ */ defineSchema(() =>
|
|
433
|
+
z.object({
|
|
434
|
+
items: z.array(VaultItemSummary),
|
|
435
|
+
nextCursor: z.string().nullable(),
|
|
436
|
+
}),
|
|
437
|
+
);
|
|
438
|
+
export type ListVaultItemsResponse = z.infer<typeof ListVaultItemsResponse>;
|
|
439
|
+
export const ListVaultFieldVersionsResponse = /* @__PURE__ */ defineSchema(() =>
|
|
440
|
+
z.object({
|
|
441
|
+
versions: z.array(VaultFieldVersionMeta),
|
|
442
|
+
}),
|
|
443
|
+
);
|
|
444
|
+
export type ListVaultFieldVersionsResponse = z.infer<typeof ListVaultFieldVersionsResponse>;
|
|
445
|
+
|
|
446
|
+
export const SetSessionVaultPolicyRequest = /* @__PURE__ */ defineSchema(() =>
|
|
447
|
+
z.object({ policy: VaultPolicy }).strict(),
|
|
448
|
+
);
|
|
449
|
+
export type SetSessionVaultPolicyRequest = z.infer<typeof SetSessionVaultPolicyRequest>;
|
|
450
|
+
|
|
451
|
+
export const SessionSecretsView = /* @__PURE__ */ defineSchema(() =>
|
|
452
|
+
z.object({
|
|
453
|
+
capabilityEnabled: z.boolean(),
|
|
454
|
+
policy: VaultPolicy,
|
|
455
|
+
effectiveVaultIds: z.array(z.string().uuid()),
|
|
456
|
+
/** Nearest ancestor that narrowed, if any. */
|
|
457
|
+
narrowedBySessionId: z.string().uuid().nullable(),
|
|
458
|
+
taskVault: VaultSummary.nullable(),
|
|
459
|
+
taskItems: z.array(VaultItemSummary),
|
|
460
|
+
reachableVaults: z.array(
|
|
461
|
+
VaultSummary.extend({ selected: z.boolean(), selectable: z.boolean() }),
|
|
462
|
+
),
|
|
463
|
+
}),
|
|
464
|
+
);
|
|
465
|
+
export type SessionSecretsView = z.infer<typeof SessionSecretsView>;
|
|
466
|
+
|
|
467
|
+
export const InstallOnePasswordRequest = /* @__PURE__ */ defineSchema(() =>
|
|
468
|
+
z
|
|
469
|
+
.object({
|
|
470
|
+
// Real service-account tokens are long; the dev fakes (ops_fake_healthy) are 16 chars.
|
|
471
|
+
token: z.string().trim().min(16).max(4_096),
|
|
472
|
+
ownership: z.enum(["user", "workspace", "organization"]),
|
|
473
|
+
planTier: z.enum(["family", "teams", "business"]).default("teams"),
|
|
474
|
+
label: z.string().max(120).optional(),
|
|
475
|
+
})
|
|
476
|
+
.strict(),
|
|
477
|
+
);
|
|
478
|
+
export type InstallOnePasswordRequest = z.infer<typeof InstallOnePasswordRequest>;
|
|
479
|
+
|
|
480
|
+
export const ProviderVaultMeta = /* @__PURE__ */ defineSchema(() =>
|
|
481
|
+
z.object({
|
|
482
|
+
externalVaultId: z.string(),
|
|
483
|
+
name: z.string(),
|
|
484
|
+
itemCount: z.number().int().nullable(),
|
|
485
|
+
linkedVaultId: z.string().uuid().nullable(),
|
|
486
|
+
}),
|
|
487
|
+
);
|
|
488
|
+
export type ProviderVaultMeta = z.infer<typeof ProviderVaultMeta>;
|
|
489
|
+
|
|
490
|
+
export const InstallOnePasswordResponse = /* @__PURE__ */ defineSchema(() =>
|
|
491
|
+
z.object({
|
|
492
|
+
connectionId: z.string().uuid(),
|
|
493
|
+
accountName: z.string().nullable(),
|
|
494
|
+
vaults: z.array(ProviderVaultMeta),
|
|
495
|
+
}),
|
|
496
|
+
);
|
|
497
|
+
export type InstallOnePasswordResponse = z.infer<typeof InstallOnePasswordResponse>;
|
|
498
|
+
|
|
499
|
+
/** A 1Password service account connected in a workspace. Never carries the token. */
|
|
500
|
+
export const OnePasswordConnectionSummary = /* @__PURE__ */ defineSchema(() =>
|
|
501
|
+
z.object({
|
|
502
|
+
id: z.string().uuid(),
|
|
503
|
+
/** Who can use the vaults linked through it. */
|
|
504
|
+
ownership: z.enum(["user", "workspace", "organization"]),
|
|
505
|
+
/** Sign-in host from the token, for example "my.1password.com". */
|
|
506
|
+
accountName: z.string().nullable(),
|
|
507
|
+
label: z.string().nullable(),
|
|
508
|
+
planTier: z.enum(["family", "teams", "business"]),
|
|
509
|
+
/** When the current token was last checked against 1Password. */
|
|
510
|
+
verifiedAt: z.string(),
|
|
511
|
+
createdAt: z.string(),
|
|
512
|
+
createdBySubjectId: z.string().nullable(),
|
|
513
|
+
/** The caller can link vaults, replace the token and disconnect it. */
|
|
514
|
+
canManage: z.boolean(),
|
|
515
|
+
}),
|
|
516
|
+
);
|
|
517
|
+
export type OnePasswordConnectionSummary = z.infer<typeof OnePasswordConnectionSummary>;
|
|
518
|
+
|
|
519
|
+
export const ListOnePasswordConnectionsResponse = /* @__PURE__ */ defineSchema(() =>
|
|
520
|
+
z.object({
|
|
521
|
+
connections: z.array(OnePasswordConnectionSummary),
|
|
522
|
+
}),
|
|
523
|
+
);
|
|
524
|
+
export type ListOnePasswordConnectionsResponse = z.infer<typeof ListOnePasswordConnectionsResponse>;
|
|
525
|
+
|
|
526
|
+
/** A new token for an existing connection; its linked vaults keep working. */
|
|
527
|
+
export const ReplaceOnePasswordTokenRequest = /* @__PURE__ */ defineSchema(() =>
|
|
528
|
+
z
|
|
529
|
+
.object({
|
|
530
|
+
token: z.string().trim().min(16).max(4_096),
|
|
531
|
+
planTier: z.enum(["family", "teams", "business"]).optional(),
|
|
532
|
+
})
|
|
533
|
+
.strict(),
|
|
534
|
+
);
|
|
535
|
+
export type ReplaceOnePasswordTokenRequest = z.infer<typeof ReplaceOnePasswordTokenRequest>;
|
|
536
|
+
|
|
537
|
+
export const DisconnectOnePasswordResponse = /* @__PURE__ */ defineSchema(() =>
|
|
538
|
+
z.object({
|
|
539
|
+
/** The Opengeni vaults that were unlinked. Nothing is deleted in 1Password. */
|
|
540
|
+
unlinkedVaultIds: z.array(z.string().uuid()),
|
|
541
|
+
}),
|
|
542
|
+
);
|
|
543
|
+
export type DisconnectOnePasswordResponse = z.infer<typeof DisconnectOnePasswordResponse>;
|
|
544
|
+
|
|
545
|
+
export const LinkProviderVaultRequest = /* @__PURE__ */ defineSchema(() =>
|
|
546
|
+
z
|
|
547
|
+
.object({
|
|
548
|
+
provider: z.enum(["onepassword", "host"]),
|
|
549
|
+
/** Required for onepassword. */
|
|
550
|
+
connectionId: z.string().uuid().optional(),
|
|
551
|
+
externalVaultId: z.string(),
|
|
552
|
+
ownerKind: z.enum(["user", "workspace", "organization"]),
|
|
553
|
+
mode: VaultMode,
|
|
554
|
+
name: VaultName.optional(),
|
|
555
|
+
availability: VaultAvailability.optional(),
|
|
556
|
+
})
|
|
557
|
+
.strict(),
|
|
558
|
+
);
|
|
559
|
+
export type LinkProviderVaultRequest = z.infer<typeof LinkProviderVaultRequest>;
|
|
560
|
+
|
|
561
|
+
export const CreateManagedProviderVaultRequest = /* @__PURE__ */ defineSchema(() =>
|
|
562
|
+
z
|
|
563
|
+
.object({
|
|
564
|
+
name: VaultName,
|
|
565
|
+
ownerKind: z.enum(["user", "workspace", "organization"]),
|
|
566
|
+
groupId: z.string().optional(),
|
|
567
|
+
})
|
|
568
|
+
.strict(),
|
|
569
|
+
);
|
|
570
|
+
export type CreateManagedProviderVaultRequest = z.infer<typeof CreateManagedProviderVaultRequest>;
|
|
571
|
+
|
|
572
|
+
// ---------------------------------------------------------------------------
|
|
573
|
+
// Errors
|
|
574
|
+
// ---------------------------------------------------------------------------
|
|
575
|
+
|
|
576
|
+
export const VaultErrorCode = /* @__PURE__ */ defineSchema(() =>
|
|
577
|
+
z.enum([
|
|
578
|
+
"vault_not_found",
|
|
579
|
+
"vault_item_not_found",
|
|
580
|
+
"vault_field_not_found",
|
|
581
|
+
"vault_name_conflict",
|
|
582
|
+
"vault_item_name_conflict",
|
|
583
|
+
"vault_limit_reached",
|
|
584
|
+
"vault_read_only",
|
|
585
|
+
"vault_generation_conflict",
|
|
586
|
+
"vault_permission_denied",
|
|
587
|
+
/** A session's vault policy reaches outside its parent's effective vaults (AX-2). */
|
|
588
|
+
"vault_policy_outside_parent",
|
|
589
|
+
"vault_reveal_requires_human",
|
|
590
|
+
"encryption_key_missing",
|
|
591
|
+
"provider_auth_invalid",
|
|
592
|
+
"provider_auth_expired",
|
|
593
|
+
"provider_rate_limited",
|
|
594
|
+
"provider_unavailable",
|
|
595
|
+
"provider_conflict",
|
|
596
|
+
"variable_sets_removed",
|
|
597
|
+
"secret_save_forbidden",
|
|
598
|
+
"invalid_secret_name",
|
|
599
|
+
"secret_value_too_large",
|
|
600
|
+
"human_auth_required",
|
|
601
|
+
"secret_search_cursor_invalid",
|
|
602
|
+
]),
|
|
603
|
+
);
|
|
604
|
+
export type VaultErrorCode = z.infer<typeof VaultErrorCode>;
|
|
605
|
+
|
|
606
|
+
export const VaultApiError = /* @__PURE__ */ defineSchema(() =>
|
|
607
|
+
z.object({
|
|
608
|
+
error: VaultErrorCode,
|
|
609
|
+
message: z.string(),
|
|
610
|
+
details: z.record(z.string(), z.unknown()).optional(),
|
|
611
|
+
}),
|
|
612
|
+
);
|
|
613
|
+
export type VaultApiError = z.infer<typeof VaultApiError>;
|
|
614
|
+
|
|
615
|
+
/** HTTP status for every vault error code (§10B.1.1). */
|
|
616
|
+
export const VAULT_ERROR_HTTP_STATUS: Readonly<Record<VaultErrorCode, number>> = {
|
|
617
|
+
vault_not_found: 404,
|
|
618
|
+
vault_item_not_found: 404,
|
|
619
|
+
vault_field_not_found: 404,
|
|
620
|
+
vault_name_conflict: 409,
|
|
621
|
+
vault_item_name_conflict: 409,
|
|
622
|
+
vault_generation_conflict: 409,
|
|
623
|
+
provider_conflict: 409,
|
|
624
|
+
vault_limit_reached: 422,
|
|
625
|
+
invalid_secret_name: 422,
|
|
626
|
+
secret_value_too_large: 422,
|
|
627
|
+
secret_save_forbidden: 422,
|
|
628
|
+
secret_search_cursor_invalid: 422,
|
|
629
|
+
vault_policy_outside_parent: 422,
|
|
630
|
+
vault_read_only: 403,
|
|
631
|
+
vault_permission_denied: 403,
|
|
632
|
+
vault_reveal_requires_human: 403,
|
|
633
|
+
human_auth_required: 403,
|
|
634
|
+
variable_sets_removed: 410,
|
|
635
|
+
encryption_key_missing: 503,
|
|
636
|
+
provider_unavailable: 503,
|
|
637
|
+
provider_rate_limited: 429,
|
|
638
|
+
provider_auth_invalid: 401,
|
|
639
|
+
provider_auth_expired: 401,
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
// ---------------------------------------------------------------------------
|
|
643
|
+
// Agent tools (capability `secrets`)
|
|
644
|
+
// ---------------------------------------------------------------------------
|
|
645
|
+
|
|
646
|
+
export const SECRET_TOOL_NAMES = [
|
|
647
|
+
"secret_search",
|
|
648
|
+
"secret_save",
|
|
649
|
+
"secret_get",
|
|
650
|
+
"secret_move",
|
|
651
|
+
"secret_delete",
|
|
652
|
+
] as const;
|
|
653
|
+
export type SecretToolName = (typeof SECRET_TOOL_NAMES)[number];
|
|
654
|
+
|
|
655
|
+
export const SECRET_SAVE_TO = /* @__PURE__ */ defineSchema(() =>
|
|
656
|
+
z.enum(["user", "task", "workspace"]),
|
|
657
|
+
);
|
|
658
|
+
export type SecretSaveTo = z.infer<typeof SECRET_SAVE_TO>;
|
|
659
|
+
|
|
660
|
+
export const SecretSearchInput = /* @__PURE__ */ defineSchema(() =>
|
|
661
|
+
z
|
|
662
|
+
.object({
|
|
663
|
+
query: z.string().max(200).optional(),
|
|
664
|
+
website: z.string().max(VAULT_LIMITS.websiteMaxChars).optional(),
|
|
665
|
+
type: VaultItemType.optional(),
|
|
666
|
+
/** Vault name or ID. */
|
|
667
|
+
vault: z.string().max(200).optional(),
|
|
668
|
+
limit: z.number().int().min(1).max(VAULT_LIMITS.searchResultsMax).default(20),
|
|
669
|
+
/** `nextCursor` from the previous call with the same filters. */
|
|
670
|
+
cursor: z.string().max(VAULT_LIMITS.searchCursorMaxChars).optional(),
|
|
671
|
+
})
|
|
672
|
+
.strict(),
|
|
673
|
+
);
|
|
674
|
+
export type SecretSearchInput = z.infer<typeof SecretSearchInput>;
|
|
675
|
+
|
|
676
|
+
export const SecretSearchResult = /* @__PURE__ */ defineSchema(() =>
|
|
677
|
+
z.object({
|
|
678
|
+
vault: z.object({
|
|
679
|
+
id: z.string().uuid(),
|
|
680
|
+
name: z.string(),
|
|
681
|
+
ownerKind: VaultOwnerKind,
|
|
682
|
+
source: VaultSource,
|
|
683
|
+
mode: VaultMode,
|
|
684
|
+
}),
|
|
685
|
+
item: z.object({
|
|
686
|
+
id: z.string().uuid(),
|
|
687
|
+
name: z.string(),
|
|
688
|
+
type: VaultItemType,
|
|
689
|
+
websites: z.array(z.string()),
|
|
690
|
+
username: z.string().nullable(),
|
|
691
|
+
hasTotp: z.boolean(),
|
|
692
|
+
hasPasskey: z.boolean(),
|
|
693
|
+
expiresAt: z.string().nullable(),
|
|
694
|
+
}),
|
|
695
|
+
fields: z.array(z.object({ name: z.string(), kind: VaultFieldKind })),
|
|
696
|
+
references: VaultItemReferences,
|
|
697
|
+
}),
|
|
698
|
+
);
|
|
699
|
+
export type SecretSearchResult = z.infer<typeof SecretSearchResult>;
|
|
700
|
+
export const SecretSearchVault = /* @__PURE__ */ defineSchema(() =>
|
|
701
|
+
z.object({
|
|
702
|
+
id: z.string().uuid(),
|
|
703
|
+
name: z.string(),
|
|
704
|
+
ownerKind: VaultOwnerKind,
|
|
705
|
+
source: VaultSource,
|
|
706
|
+
mode: VaultMode,
|
|
707
|
+
itemCount: z.number().int().nonnegative(),
|
|
708
|
+
}),
|
|
709
|
+
);
|
|
710
|
+
export type SecretSearchVault = z.infer<typeof SecretSearchVault>;
|
|
711
|
+
export const SecretSearchOutput = /* @__PURE__ */ defineSchema(() =>
|
|
712
|
+
z.object({
|
|
713
|
+
items: z.array(SecretSearchResult),
|
|
714
|
+
/** True when more matches remain; pass `nextCursor` to continue. */
|
|
715
|
+
truncated: z.boolean(),
|
|
716
|
+
nextCursor: z.string().nullable(),
|
|
717
|
+
/** Every vault the caller can reach, on the first page only. */
|
|
718
|
+
vaults: z.array(SecretSearchVault).optional(),
|
|
719
|
+
}),
|
|
720
|
+
);
|
|
721
|
+
export type SecretSearchOutput = z.infer<typeof SecretSearchOutput>;
|
|
722
|
+
|
|
723
|
+
export const SecretSaveFieldInput = /* @__PURE__ */ defineSchema(() =>
|
|
724
|
+
z
|
|
725
|
+
.object({
|
|
726
|
+
name: VaultFieldName,
|
|
727
|
+
kind: VaultFieldKind.optional(),
|
|
728
|
+
value: z.string().optional(),
|
|
729
|
+
generate: GeneratePasswordSpec.optional(),
|
|
730
|
+
fromReference: z.string().max(VAULT_LIMITS.referenceMaxChars).optional(),
|
|
731
|
+
restoreVersion: z.number().int().optional(),
|
|
732
|
+
})
|
|
733
|
+
.strict()
|
|
734
|
+
.refine(exactlyOneValueSource, "exactly one of value|generate|fromReference|restoreVersion"),
|
|
735
|
+
);
|
|
736
|
+
export type SecretSaveFieldInput = z.infer<typeof SecretSaveFieldInput>;
|
|
737
|
+
|
|
738
|
+
export const SecretSaveInput = /* @__PURE__ */ defineSchema(() =>
|
|
739
|
+
z
|
|
740
|
+
.object({
|
|
741
|
+
item: VaultName,
|
|
742
|
+
/** Vault name or ID; defaults to the saveTo scope's default vault. */
|
|
743
|
+
vault: z.string().max(200).optional(),
|
|
744
|
+
saveTo: SECRET_SAVE_TO.optional(),
|
|
745
|
+
type: VaultItemType.default("login"),
|
|
746
|
+
websites: z
|
|
747
|
+
.array(z.string().max(VAULT_LIMITS.websiteMaxChars))
|
|
748
|
+
.max(VAULT_LIMITS.websitesPerItem)
|
|
749
|
+
.optional(),
|
|
750
|
+
username: z.string().max(512).optional(),
|
|
751
|
+
fields: z.array(SecretSaveFieldInput).max(VAULT_LIMITS.fieldsPerItem).optional(),
|
|
752
|
+
mode: z.enum(["create", "update", "upsert"]).default("upsert"),
|
|
753
|
+
})
|
|
754
|
+
.strict(),
|
|
755
|
+
);
|
|
756
|
+
export type SecretSaveInput = z.infer<typeof SecretSaveInput>;
|
|
757
|
+
export const SecretSaveOutput = /* @__PURE__ */ defineSchema(() =>
|
|
758
|
+
z.object({
|
|
759
|
+
item: VaultItemSummary,
|
|
760
|
+
references: VaultItemReferences,
|
|
761
|
+
generatedFields: z.array(z.string()),
|
|
762
|
+
}),
|
|
763
|
+
);
|
|
764
|
+
export type SecretSaveOutput = z.infer<typeof SecretSaveOutput>;
|
|
765
|
+
|
|
766
|
+
export const SecretGetInput = /* @__PURE__ */ defineSchema(() =>
|
|
767
|
+
z
|
|
768
|
+
.object({
|
|
769
|
+
reference: z.string().min(1).max(VAULT_LIMITS.referenceMaxChars),
|
|
770
|
+
version: z.number().int().optional(),
|
|
771
|
+
})
|
|
772
|
+
.strict(),
|
|
773
|
+
);
|
|
774
|
+
export type SecretGetInput = z.infer<typeof SecretGetInput>;
|
|
775
|
+
export const SecretGetOutput = RevealVaultFieldResponse;
|
|
776
|
+
export type SecretGetOutput = RevealVaultFieldResponse;
|
|
777
|
+
|
|
778
|
+
export const SecretMoveInput = /* @__PURE__ */ defineSchema(() =>
|
|
779
|
+
z
|
|
780
|
+
.object({
|
|
781
|
+
reference: z.string().min(1).max(VAULT_LIMITS.referenceMaxChars),
|
|
782
|
+
/** Vault name or ID. */
|
|
783
|
+
toVault: z.string().min(1).max(200),
|
|
784
|
+
mode: z.enum(["move", "copy"]).default("move"),
|
|
785
|
+
newName: VaultName.optional(),
|
|
786
|
+
})
|
|
787
|
+
.strict(),
|
|
788
|
+
);
|
|
789
|
+
export type SecretMoveInput = z.infer<typeof SecretMoveInput>;
|
|
790
|
+
export const SecretMoveOutput = /* @__PURE__ */ defineSchema(() =>
|
|
791
|
+
z.object({
|
|
792
|
+
item: VaultItemSummary,
|
|
793
|
+
references: VaultItemReferences,
|
|
794
|
+
}),
|
|
795
|
+
);
|
|
796
|
+
export type SecretMoveOutput = z.infer<typeof SecretMoveOutput>;
|
|
797
|
+
|
|
798
|
+
export const SecretDeleteInput = /* @__PURE__ */ defineSchema(() =>
|
|
799
|
+
z.object({ reference: z.string().min(1).max(VAULT_LIMITS.referenceMaxChars) }).strict(),
|
|
800
|
+
);
|
|
801
|
+
export type SecretDeleteInput = z.infer<typeof SecretDeleteInput>;
|
|
802
|
+
export const SecretDeleteOutput = /* @__PURE__ */ defineSchema(() =>
|
|
803
|
+
z.object({ archived: z.literal(true), restoreHint: z.string() }),
|
|
804
|
+
);
|
|
805
|
+
export type SecretDeleteOutput = z.infer<typeof SecretDeleteOutput>;
|
|
806
|
+
|
|
807
|
+
// ---------------------------------------------------------------------------
|
|
808
|
+
// Events, audit and metrics (§10B.1.9)
|
|
809
|
+
// ---------------------------------------------------------------------------
|
|
810
|
+
|
|
811
|
+
export const VAULT_POLICY_UPDATED_EVENT_TYPE = "session.vaultPolicy.updated" as const;
|
|
812
|
+
|
|
813
|
+
export const VAULT_AUDIT_ACTIONS = [
|
|
814
|
+
"vault.created",
|
|
815
|
+
"vault.updated",
|
|
816
|
+
"vault.deleted",
|
|
817
|
+
"vault.item.created",
|
|
818
|
+
"vault.item.updated",
|
|
819
|
+
"vault.item.archived",
|
|
820
|
+
"vault.item.restored",
|
|
821
|
+
"vault.item.deleted",
|
|
822
|
+
"vault.item.moved",
|
|
823
|
+
"vault.item.copied",
|
|
824
|
+
"vault.field.set",
|
|
825
|
+
"vault.field.revealed",
|
|
826
|
+
"vault.secret.used",
|
|
827
|
+
"vault.secret.read",
|
|
828
|
+
"vault.secret.read.denied",
|
|
829
|
+
"vault.reference.failed",
|
|
830
|
+
"vault.provider.connected",
|
|
831
|
+
"vault.provider.linked",
|
|
832
|
+
"vault.provider.synced",
|
|
833
|
+
"vault.provider.error",
|
|
834
|
+
"vault.passkey.registered",
|
|
835
|
+
"vault.passkey.asserted",
|
|
836
|
+
"vault.policy.updated",
|
|
837
|
+
"vault.migrated",
|
|
838
|
+
] as const;
|
|
839
|
+
export const VaultAuditAction = /* @__PURE__ */ defineSchema(() => z.enum(VAULT_AUDIT_ACTIONS));
|
|
840
|
+
export type VaultAuditAction = z.infer<typeof VaultAuditAction>;
|
|
841
|
+
export const VAULT_AUDIT_TARGET_TYPES = ["vault", "vault_item"] as const;
|
|
842
|
+
|
|
843
|
+
export const VAULT_METRIC_NAMES = {
|
|
844
|
+
resolutions: "opengeni_secret_resolutions_total",
|
|
845
|
+
resolutionDuration: "opengeni_secret_resolution_duration_seconds",
|
|
846
|
+
execEnvBytes: "opengeni_secret_exec_env_bytes",
|
|
847
|
+
providerCalls: "opengeni_vault_provider_calls_total",
|
|
848
|
+
providerRateLimited: "opengeni_vault_provider_rate_limited_total",
|
|
849
|
+
passkeyAssertions: "opengeni_passkey_assertions_total",
|
|
850
|
+
} as const;
|