@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
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
const fieldId = /* @__PURE__ */ defineSchema(() =>
|
|
5
|
+
z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/),
|
|
6
|
+
);
|
|
7
|
+
const headerName = /* @__PURE__ */ defineSchema(() =>
|
|
8
|
+
z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.max(256)
|
|
12
|
+
.regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/),
|
|
13
|
+
);
|
|
14
|
+
const headerPart = /* @__PURE__ */ defineSchema(() =>
|
|
15
|
+
z
|
|
16
|
+
.string()
|
|
17
|
+
.max(16_384)
|
|
18
|
+
.regex(/^[^\r\n\0]*$/),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/** Configuration is safe to retain; secret values enter only the protected
|
|
22
|
+
* Connect credential request, never this model-visible setup description. */
|
|
23
|
+
export const PreparedMcpSetup = /* @__PURE__ */ defineSchema(() =>
|
|
24
|
+
z
|
|
25
|
+
.object({
|
|
26
|
+
name: z.string().trim().min(1).max(256),
|
|
27
|
+
endpointUrl: z
|
|
28
|
+
.string()
|
|
29
|
+
.url()
|
|
30
|
+
.max(2048)
|
|
31
|
+
.refine((value) => {
|
|
32
|
+
try {
|
|
33
|
+
const url = new URL(value);
|
|
34
|
+
return (
|
|
35
|
+
url.protocol === "https:" &&
|
|
36
|
+
!url.username &&
|
|
37
|
+
!url.password &&
|
|
38
|
+
!url.search &&
|
|
39
|
+
!url.hash
|
|
40
|
+
);
|
|
41
|
+
} catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}, "Use an HTTPS endpoint without credentials, query parameters, or a fragment"),
|
|
45
|
+
headers: z
|
|
46
|
+
.array(
|
|
47
|
+
z.union([
|
|
48
|
+
z.object({ name: headerName, value: headerPart.min(1) }).strict(),
|
|
49
|
+
z
|
|
50
|
+
.object({
|
|
51
|
+
name: headerName,
|
|
52
|
+
secret: fieldId,
|
|
53
|
+
prefix: headerPart.optional(),
|
|
54
|
+
suffix: headerPart.optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict(),
|
|
57
|
+
]),
|
|
58
|
+
)
|
|
59
|
+
.min(1)
|
|
60
|
+
.max(32),
|
|
61
|
+
secretFields: z
|
|
62
|
+
.array(z.object({ id: fieldId, label: z.string().trim().min(1).max(256) }).strict())
|
|
63
|
+
.max(32),
|
|
64
|
+
})
|
|
65
|
+
.strict()
|
|
66
|
+
.superRefine((value, context) => {
|
|
67
|
+
const names = value.headers.map((header) => header.name.toLowerCase());
|
|
68
|
+
const ids = value.secretFields.map((field) => field.id);
|
|
69
|
+
if (new Set(names).size !== names.length)
|
|
70
|
+
context.addIssue({
|
|
71
|
+
code: "custom",
|
|
72
|
+
path: ["headers"],
|
|
73
|
+
message: "Header names must be unique",
|
|
74
|
+
});
|
|
75
|
+
if (new Set(ids).size !== ids.length)
|
|
76
|
+
context.addIssue({
|
|
77
|
+
code: "custom",
|
|
78
|
+
path: ["secretFields"],
|
|
79
|
+
message: "Secret field IDs must be unique",
|
|
80
|
+
});
|
|
81
|
+
const used = new Set(
|
|
82
|
+
value.headers.flatMap((header) => ("secret" in header ? [header.secret] : [])),
|
|
83
|
+
);
|
|
84
|
+
if (used.size !== ids.length || ids.some((id) => !used.has(id)))
|
|
85
|
+
context.addIssue({
|
|
86
|
+
code: "custom",
|
|
87
|
+
path: ["secretFields"],
|
|
88
|
+
message: "Declare exactly the secret fields used by the headers",
|
|
89
|
+
});
|
|
90
|
+
for (const [index, header] of value.headers.entries()) {
|
|
91
|
+
if (
|
|
92
|
+
"value" in header &&
|
|
93
|
+
["authorization", "proxy-authorization", "cookie", "x-api-key", "api-key"].includes(
|
|
94
|
+
header.name.toLowerCase(),
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
context.addIssue({
|
|
98
|
+
code: "custom",
|
|
99
|
+
path: ["headers", index],
|
|
100
|
+
message: "Credential headers must reference a protected secret field",
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
105
|
+
export type PreparedMcpSetup = z.infer<typeof PreparedMcpSetup>;
|
|
106
|
+
|
|
107
|
+
/** A missing-key proposal retains configuration only. Ownership is explicit
|
|
108
|
+
* and the displayed identity must equal the destination actually configured. */
|
|
109
|
+
export const CustomMcpSetupRequest = /* @__PURE__ */ defineSchema(() =>
|
|
110
|
+
z
|
|
111
|
+
.object({
|
|
112
|
+
kind: z.literal("mcp"),
|
|
113
|
+
name: z.string().trim().min(1).max(256),
|
|
114
|
+
endpointUrl: z
|
|
115
|
+
.string()
|
|
116
|
+
.url()
|
|
117
|
+
.max(2048)
|
|
118
|
+
.refine((value) => {
|
|
119
|
+
try {
|
|
120
|
+
const url = new URL(value);
|
|
121
|
+
return (
|
|
122
|
+
url.protocol === "https:" &&
|
|
123
|
+
!url.username &&
|
|
124
|
+
!url.password &&
|
|
125
|
+
!url.hash &&
|
|
126
|
+
!url.search
|
|
127
|
+
);
|
|
128
|
+
} catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
rationale: z.string().trim().min(1).max(2000),
|
|
133
|
+
ownership: z.enum(["personal", "workspace"]).optional(),
|
|
134
|
+
mcpSetup: PreparedMcpSetup.optional(),
|
|
135
|
+
})
|
|
136
|
+
.strict()
|
|
137
|
+
.superRefine((value, context) => {
|
|
138
|
+
if (Boolean(value.ownership) !== Boolean(value.mcpSetup))
|
|
139
|
+
context.addIssue({ code: "custom", message: "Prepared setup requires explicit ownership" });
|
|
140
|
+
if (
|
|
141
|
+
value.mcpSetup &&
|
|
142
|
+
(value.name !== value.mcpSetup.name || value.endpointUrl !== value.mcpSetup.endpointUrl)
|
|
143
|
+
)
|
|
144
|
+
context.addIssue({
|
|
145
|
+
code: "custom",
|
|
146
|
+
message: "Prepared setup must match the displayed server",
|
|
147
|
+
});
|
|
148
|
+
}),
|
|
149
|
+
);
|
|
150
|
+
export type CustomMcpSetupRequest = z.infer<typeof CustomMcpSetupRequest>;
|
|
151
|
+
|
|
152
|
+
/** Values are intentionally accepted separately. Errors name neither supplied
|
|
153
|
+
* values nor undeclared input keys, which may themselves contain credentials. */
|
|
154
|
+
export function preparedMcpHeaders(
|
|
155
|
+
configuration: PreparedMcpSetup,
|
|
156
|
+
values: Readonly<Record<string, string>>,
|
|
157
|
+
): Record<string, string> {
|
|
158
|
+
const setup = PreparedMcpSetup.parse(configuration);
|
|
159
|
+
const supplied = Object.keys(values);
|
|
160
|
+
if (
|
|
161
|
+
supplied.length !== setup.secretFields.length ||
|
|
162
|
+
setup.secretFields.some((field) => !Object.hasOwn(values, field.id)) ||
|
|
163
|
+
supplied.some((key) => {
|
|
164
|
+
const value = values[key];
|
|
165
|
+
return (
|
|
166
|
+
typeof value !== "string" ||
|
|
167
|
+
value.length === 0 ||
|
|
168
|
+
value.length > 16_384 ||
|
|
169
|
+
/[\r\n\0]/.test(value)
|
|
170
|
+
);
|
|
171
|
+
})
|
|
172
|
+
)
|
|
173
|
+
throw new Error("Supply exactly the requested secret fields");
|
|
174
|
+
const headers: Record<string, string> = {};
|
|
175
|
+
for (const header of setup.headers) {
|
|
176
|
+
const value =
|
|
177
|
+
"value" in header
|
|
178
|
+
? header.value
|
|
179
|
+
: `${header.prefix ?? ""}${values[header.secret]}${header.suffix ?? ""}`;
|
|
180
|
+
if (value.length > 16_384) throw new Error("Prepared credential header is too long");
|
|
181
|
+
Object.defineProperty(headers, header.name, {
|
|
182
|
+
value,
|
|
183
|
+
enumerable: true,
|
|
184
|
+
configurable: true,
|
|
185
|
+
writable: true,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return headers;
|
|
189
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
// Content-free product-analytics dimensions carried on durable facts and the
|
|
5
|
+
// optional host export. Every value comes from a fixed list or from Opengeni's
|
|
6
|
+
// own code-defined names. None of them is an authorization input, and none
|
|
7
|
+
// may carry prompt text, tool arguments, customer names, tenant domains, or
|
|
8
|
+
// operator-configured identifiers.
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The product surface through which a turn's request entered Opengeni.
|
|
12
|
+
*
|
|
13
|
+
* - `web`: the Opengeni web app (managed cookie or the local browser context).
|
|
14
|
+
* - `slack`: a Slack mention, command, DM, shortcut, thread reply, or reaction.
|
|
15
|
+
* - `api_key`: an API key or configured key, including the SDK and scripts.
|
|
16
|
+
* - `embedded`: a host that embeds Opengeni through signed delegation or an
|
|
17
|
+
* organization key acting for an external user.
|
|
18
|
+
* - `scheduled`: a scheduled-task occurrence.
|
|
19
|
+
* - `agent`: another agent (a child session, an agent message, or Agent Steer).
|
|
20
|
+
* - `voice`: a realtime voice delegation or its end-of-call handoff.
|
|
21
|
+
* - `site`: a published workspace Site.
|
|
22
|
+
* - `automation`: an event-triggered automation run.
|
|
23
|
+
* - `mcp`: an external MCP client connected through workspace MCP OAuth.
|
|
24
|
+
* - `system`: Opengeni's own maintenance work with no human entry.
|
|
25
|
+
*
|
|
26
|
+
* Turns that no new request entered (goal continuations, child results,
|
|
27
|
+
* command results, wait timeouts, compaction) inherit the surface of the
|
|
28
|
+
* session's latest started turn. Null means no surface was captured: rows
|
|
29
|
+
* written before capture existed, or machine work in a session that has
|
|
30
|
+
* never started a turn with one.
|
|
31
|
+
*/
|
|
32
|
+
export const SESSION_TURN_SURFACES = [
|
|
33
|
+
"web",
|
|
34
|
+
"slack",
|
|
35
|
+
"api_key",
|
|
36
|
+
"embedded",
|
|
37
|
+
"scheduled",
|
|
38
|
+
"agent",
|
|
39
|
+
"voice",
|
|
40
|
+
"site",
|
|
41
|
+
"automation",
|
|
42
|
+
"mcp",
|
|
43
|
+
"system",
|
|
44
|
+
] as const;
|
|
45
|
+
export const SessionTurnSurface = /* @__PURE__ */ defineSchema(() => z.enum(SESSION_TURN_SURFACES));
|
|
46
|
+
export type SessionTurnSurface = z.infer<typeof SessionTurnSurface>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Request header the first-party web console sends while its tab is visible
|
|
50
|
+
* and the person interacted with it in the last few minutes. The API records
|
|
51
|
+
* server-side presence (`opengeni_active_users`, `user.active`) only for
|
|
52
|
+
* canonical managed browser sessions carrying this exact value, so an idle open
|
|
53
|
+
* tab, background polling and stream re-authorization never count as activity.
|
|
54
|
+
* Analytics only: it never grants or narrows access.
|
|
55
|
+
*/
|
|
56
|
+
export const OPENGENI_USER_ACTIVITY_HEADER = "x-opengeni-user-activity";
|
|
57
|
+
export const OPENGENI_USER_ACTIVITY_ACTIVE = "active";
|
|
58
|
+
/** Interaction recency, in milliseconds, behind the activity header. */
|
|
59
|
+
export const OPENGENI_USER_ACTIVITY_WINDOW_MS = 5 * 60_000;
|
|
60
|
+
|
|
61
|
+
/** Parse a stored value; anything outside the fixed list is treated as absent. */
|
|
62
|
+
export function sessionTurnSurfaceOrNull(value: unknown): SessionTurnSurface | null {
|
|
63
|
+
const parsed = SessionTurnSurface.safeParse(value);
|
|
64
|
+
return parsed.success ? parsed.data : null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Model provider families exported for analytics. Reserved Opengeni provider
|
|
69
|
+
* ids pass through unchanged; every operator-configured registry provider is
|
|
70
|
+
* reported as `registry` so a deployment's own naming never leaves it.
|
|
71
|
+
* `opengeni_private.analytics_model_provider` (migration 0533) mirrors this.
|
|
72
|
+
*/
|
|
73
|
+
export const ANALYTICS_MODEL_PROVIDERS = [
|
|
74
|
+
"openai",
|
|
75
|
+
"azure",
|
|
76
|
+
"codex-subscription",
|
|
77
|
+
"supergrok-subscription",
|
|
78
|
+
"opengeni-gateway",
|
|
79
|
+
"workspace-gateway",
|
|
80
|
+
"organization-gateway",
|
|
81
|
+
"openrouter",
|
|
82
|
+
"workspace-openrouter",
|
|
83
|
+
"organization-openrouter",
|
|
84
|
+
"opper",
|
|
85
|
+
"workspace-opper",
|
|
86
|
+
"organization-opper",
|
|
87
|
+
"registry",
|
|
88
|
+
] as const;
|
|
89
|
+
export const AnalyticsModelProvider = /* @__PURE__ */ defineSchema(() =>
|
|
90
|
+
z.enum(ANALYTICS_MODEL_PROVIDERS),
|
|
91
|
+
);
|
|
92
|
+
export type AnalyticsModelProvider = z.infer<typeof AnalyticsModelProvider>;
|
|
93
|
+
|
|
94
|
+
const RESERVED_ANALYTICS_MODEL_PROVIDERS: ReadonlySet<string> = new Set(
|
|
95
|
+
ANALYTICS_MODEL_PROVIDERS.filter((provider) => provider !== "registry"),
|
|
96
|
+
);
|
|
97
|
+
const REGISTRY_PROVIDER_ID = /^[A-Za-z0-9_-]{1,128}$/u;
|
|
98
|
+
|
|
99
|
+
/** Map an accepted turn's execution-policy provider id to its analytics family. */
|
|
100
|
+
export function analyticsModelProvider(
|
|
101
|
+
providerId: string | null | undefined,
|
|
102
|
+
): AnalyticsModelProvider | null {
|
|
103
|
+
if (typeof providerId !== "string") return null;
|
|
104
|
+
if (RESERVED_ANALYTICS_MODEL_PROVIDERS.has(providerId)) {
|
|
105
|
+
return providerId as AnalyticsModelProvider;
|
|
106
|
+
}
|
|
107
|
+
return REGISTRY_PROVIDER_ID.test(providerId) ? "registry" : null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Tool family on a tool-call fact: an Opengeni first-party tool name,
|
|
112
|
+
* `integration:<catalog domain>` for a reviewed catalog integration, or
|
|
113
|
+
* `custom` for any other MCP server (a workspace's own server, a self-hosted
|
|
114
|
+
* provider, or an unreviewed catalog entry). The domain part is limited to
|
|
115
|
+
* {@link TOOL_FAMILY_INTEGRATION_DOMAINS}, so a tenant's own host name is
|
|
116
|
+
* never exported.
|
|
117
|
+
*/
|
|
118
|
+
export const ToolFamily = /* @__PURE__ */ defineSchema(() =>
|
|
119
|
+
z
|
|
120
|
+
.string()
|
|
121
|
+
.max(160)
|
|
122
|
+
.regex(/^(?:custom|integration:[a-z0-9](?:[a-z0-9.-]{0,150}[a-z0-9])?|[a-z][a-z0-9_]{0,63})$/u),
|
|
123
|
+
);
|
|
124
|
+
export type ToolFamily = z.infer<typeof ToolFamily>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Reviewed integration domains that may appear as `integration:<domain>`:
|
|
128
|
+
* Opengeni's native provider domains plus the MCP host of every curated
|
|
129
|
+
* catalog entry (`data/catalog/curated.json`). A test keeps the curated part
|
|
130
|
+
* in sync. Any other domain is reported as `custom`.
|
|
131
|
+
*/
|
|
132
|
+
export const TOOL_FAMILY_INTEGRATION_DOMAINS = [
|
|
133
|
+
// Native provider domains.
|
|
134
|
+
"github.com",
|
|
135
|
+
"gitlab.com",
|
|
136
|
+
"dev.azure.com",
|
|
137
|
+
"slack.com",
|
|
138
|
+
"chatgpt.com",
|
|
139
|
+
"x.com",
|
|
140
|
+
"reddit.com",
|
|
141
|
+
"fiken.no",
|
|
142
|
+
"api.atlassian.com",
|
|
143
|
+
"googleapis.com",
|
|
144
|
+
// Curated catalog MCP hosts.
|
|
145
|
+
"gmailmcp.googleapis.com",
|
|
146
|
+
"mcp.slack.com",
|
|
147
|
+
"api.mobbin.com",
|
|
148
|
+
"mcp.linear.app",
|
|
149
|
+
"mcp.asana.com",
|
|
150
|
+
"mcp.stripe.com",
|
|
151
|
+
"mcp.figma.com",
|
|
152
|
+
"mcp.canva.com",
|
|
153
|
+
"mcp.sentry.dev",
|
|
154
|
+
"mcp.vercel.com",
|
|
155
|
+
"bindings.mcp.cloudflare.com",
|
|
156
|
+
"mcp.paypal.com",
|
|
157
|
+
"mcp.monday.com",
|
|
158
|
+
"mcp.airtable.com",
|
|
159
|
+
"mcp.zapier.com",
|
|
160
|
+
"mcp.webflow.com",
|
|
161
|
+
"mcp.supabase.com",
|
|
162
|
+
"mcp.clickup.com",
|
|
163
|
+
"mcp.calendly.com",
|
|
164
|
+
"mcp.box.com",
|
|
165
|
+
"mcp.dropbox.com",
|
|
166
|
+
"mcp.amplitude.com",
|
|
167
|
+
"mcp.posthog.com",
|
|
168
|
+
"mcp.pagerduty.com",
|
|
169
|
+
"mcp.apollo.io",
|
|
170
|
+
"api.ahrefs.com",
|
|
171
|
+
"mcp.semrush.com",
|
|
172
|
+
"mcp.frontapp.com",
|
|
173
|
+
"mcp.otter.ai",
|
|
174
|
+
"mcp.notion.com",
|
|
175
|
+
"mcp.hubspot.com",
|
|
176
|
+
"mcp.atlassian.com",
|
|
177
|
+
"mcp.intercom.com",
|
|
178
|
+
] as const;
|
|
179
|
+
|
|
180
|
+
const TOOL_FAMILY_INTEGRATION_DOMAIN_SET: ReadonlySet<string> = new Set(
|
|
181
|
+
TOOL_FAMILY_INTEGRATION_DOMAINS,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
function normalizedDomain(value: string | null | undefined): string | null {
|
|
185
|
+
if (typeof value !== "string") return null;
|
|
186
|
+
const domain = value.trim().toLowerCase().replace(/\.$/u, "");
|
|
187
|
+
return domain.length > 0 ? domain : null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Tool family for an MCP server that is not first-party. The first candidate
|
|
192
|
+
* domain on the reviewed list wins; otherwise the server is `custom`.
|
|
193
|
+
*/
|
|
194
|
+
export function integrationToolFamily(
|
|
195
|
+
candidateDomains: readonly (string | null | undefined)[],
|
|
196
|
+
): ToolFamily {
|
|
197
|
+
for (const candidate of candidateDomains) {
|
|
198
|
+
const domain = normalizedDomain(candidate);
|
|
199
|
+
if (domain && TOOL_FAMILY_INTEGRATION_DOMAIN_SET.has(domain)) {
|
|
200
|
+
return `integration:${domain}`;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return "custom";
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* First-party tools the runtime exposes outside any MCP server: base sandbox
|
|
208
|
+
* and runtime tools, progressive-disclosure routers, media generation, and
|
|
209
|
+
* provider-hosted tool calls as the event stream names them.
|
|
210
|
+
*/
|
|
211
|
+
export const FIRST_PARTY_FUNCTION_TOOL_FAMILY_NAMES = [
|
|
212
|
+
"exec_command",
|
|
213
|
+
"write_stdin",
|
|
214
|
+
"view_image",
|
|
215
|
+
"apply_patch",
|
|
216
|
+
"skill_read",
|
|
217
|
+
"repository_skill_read",
|
|
218
|
+
"request_human_input",
|
|
219
|
+
"list_models",
|
|
220
|
+
"code_search",
|
|
221
|
+
"tool_search",
|
|
222
|
+
"tool_list",
|
|
223
|
+
"tool_invoke",
|
|
224
|
+
"generate_image",
|
|
225
|
+
"generate_video",
|
|
226
|
+
"get_video_generation_capabilities",
|
|
227
|
+
"computer_screenshot",
|
|
228
|
+
"web_search_call",
|
|
229
|
+
"image_generation_call",
|
|
230
|
+
"code_interpreter_call",
|
|
231
|
+
"file_search_call",
|
|
232
|
+
"computer_call",
|
|
233
|
+
"local_shell_call",
|
|
234
|
+
"shell_call",
|
|
235
|
+
"apply_patch_call",
|
|
236
|
+
] as const;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* First-party tools served by in-process attempt definitions or the dedicated
|
|
240
|
+
* `files` server rather than the public `opengeni` MCP catalog.
|
|
241
|
+
*/
|
|
242
|
+
export const FIRST_PARTY_ATTEMPT_TOOL_FAMILY_NAMES = [
|
|
243
|
+
"skill_checkout",
|
|
244
|
+
"skill_publish",
|
|
245
|
+
"skill_install",
|
|
246
|
+
"skill_remove",
|
|
247
|
+
"skill_save",
|
|
248
|
+
"skill_search",
|
|
249
|
+
"operation_read",
|
|
250
|
+
"knowledge_source_fetch",
|
|
251
|
+
"knowledge_source_read",
|
|
252
|
+
"files_get_download_url",
|
|
253
|
+
] as const;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Opengeni's in-process integration tools that are not registry MCP servers,
|
|
257
|
+
* keyed by their catalog server id, with the provider domain they act on.
|
|
258
|
+
*/
|
|
259
|
+
export const IN_PROCESS_INTEGRATION_TOOL_FAMILY_DOMAINS: Readonly<Record<string, string>> = {
|
|
260
|
+
"google-drive-publishing": "googleapis.com",
|
|
261
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-free per-person product lifecycle facts.
|
|
3
|
+
*
|
|
4
|
+
* Migration `0532_product_lifecycle_fact_export.sql` captures one fact per
|
|
5
|
+
* product change with row triggers and writes it to the durable host export as
|
|
6
|
+
* the `lifecycle_fact` kind; `0565_usage_analytics_presence_and_facts.sql` adds
|
|
7
|
+
* `user.active`, `credits.granted` and `connection.revoked`. Every value is drawn from a fixed list; the
|
|
8
|
+
* database function `opengeni_private.product_lifecycle_fact_valid` enforces
|
|
9
|
+
* the same lists and a test keeps the two copies identical.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Closed class of a positive credit grant (`grant` or `manual_credit_grant`
|
|
14
|
+
* ledger row). `opengeni_private.credit_grant_class` mirrors this mapping:
|
|
15
|
+
* - `signup_trial`: the one-time verified-signup trial (source `verified_signup_trial`).
|
|
16
|
+
* - `coupon`: a fully discounted Stripe checkout (source `stripe_checkout_coupon`).
|
|
17
|
+
* - `manual`: an operator grant (`manual_credit_grant` or source `operator_adjustment`).
|
|
18
|
+
* - `other`: any other grant source.
|
|
19
|
+
*/
|
|
20
|
+
export const CREDIT_GRANT_CLASSES = ["signup_trial", "coupon", "manual", "other"] as const;
|
|
21
|
+
export type CreditGrantClass = (typeof CREDIT_GRANT_CLASSES)[number];
|
|
22
|
+
|
|
23
|
+
const CONNECTION_PROVIDER_CLASSES = [
|
|
24
|
+
"slack",
|
|
25
|
+
"github",
|
|
26
|
+
"gitlab",
|
|
27
|
+
"azure_devops",
|
|
28
|
+
"bitbucket",
|
|
29
|
+
"google",
|
|
30
|
+
"microsoft",
|
|
31
|
+
"linear",
|
|
32
|
+
"atlassian",
|
|
33
|
+
"notion",
|
|
34
|
+
"supabase",
|
|
35
|
+
"datadog",
|
|
36
|
+
"posthog",
|
|
37
|
+
"openai",
|
|
38
|
+
"x",
|
|
39
|
+
"other",
|
|
40
|
+
] as const;
|
|
41
|
+
|
|
42
|
+
/** Each fact type and the fixed values its `attribute` may carry. */
|
|
43
|
+
export const PRODUCT_LIFECYCLE_FACT_ATTRIBUTES = {
|
|
44
|
+
/** A managed account was created. Attribute: first sign-in method. */
|
|
45
|
+
"auth.sign_up": ["email", "google", "github", "other"],
|
|
46
|
+
/**
|
|
47
|
+
* The account email became verified: by the verification link, or at
|
|
48
|
+
* creation when a social provider already verified it.
|
|
49
|
+
*/
|
|
50
|
+
"auth.email_verified": [],
|
|
51
|
+
/** A live sign-in session was created. Attribute: method of that session. */
|
|
52
|
+
"auth.sign_in": ["email", "google", "github", "other"],
|
|
53
|
+
/** An organization was created by self-service setup or as an additional one. */
|
|
54
|
+
"organization.setup": ["created", "additional"],
|
|
55
|
+
/** A model subscription or organization model provider was connected. */
|
|
56
|
+
"model.connected": [
|
|
57
|
+
"codex",
|
|
58
|
+
"supergrok",
|
|
59
|
+
"vercel_gateway",
|
|
60
|
+
"openrouter",
|
|
61
|
+
"anthropic",
|
|
62
|
+
"claude_subscription",
|
|
63
|
+
"opper",
|
|
64
|
+
],
|
|
65
|
+
/** A credit top-up payment was granted. */
|
|
66
|
+
"credits.purchased": [],
|
|
67
|
+
/** Credits were granted without a purchase. Attribute: grant class. */
|
|
68
|
+
"credits.granted": CREDIT_GRANT_CLASSES,
|
|
69
|
+
/** An integration connection was created. Attribute: provider class. */
|
|
70
|
+
"connection.created": CONNECTION_PROVIDER_CLASSES,
|
|
71
|
+
/**
|
|
72
|
+
* An integration connection was revoked, or deleted while still live.
|
|
73
|
+
* Attribute: provider class, the same list as `connection.created`.
|
|
74
|
+
*/
|
|
75
|
+
"connection.revoked": CONNECTION_PROVIDER_CLASSES,
|
|
76
|
+
"scheduled_task.created": [],
|
|
77
|
+
/** A catalog Skill was installed into a workspace. */
|
|
78
|
+
"skill.installed": [],
|
|
79
|
+
/** A Slack user was linked to an Opengeni user. */
|
|
80
|
+
"slack.user_linked": [],
|
|
81
|
+
/** A new Connected Machine was enrolled. */
|
|
82
|
+
"machine.enrolled": [],
|
|
83
|
+
/** A person became an active member of an organization that already had one. */
|
|
84
|
+
"member.joined": [],
|
|
85
|
+
/**
|
|
86
|
+
* A managed person was active in an authenticated browser session on a new
|
|
87
|
+
* UTC day: at most one fact per person per UTC day, with no organization.
|
|
88
|
+
*/
|
|
89
|
+
"user.active": [],
|
|
90
|
+
} as const satisfies Record<string, readonly string[]>;
|
|
91
|
+
|
|
92
|
+
export type ProductLifecycleFactType = keyof typeof PRODUCT_LIFECYCLE_FACT_ATTRIBUTES;
|
|
93
|
+
|
|
94
|
+
export const PRODUCT_LIFECYCLE_FACT_TYPES = Object.keys(
|
|
95
|
+
PRODUCT_LIFECYCLE_FACT_ATTRIBUTES,
|
|
96
|
+
) as ProductLifecycleFactType[];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* What kind of subject caused the fact. Only `user` and `api_key` facts carry
|
|
100
|
+
* their opaque subject id; every other subject string is reduced to its kind
|
|
101
|
+
* because embedded hosts may put their own identifiers in it.
|
|
102
|
+
*/
|
|
103
|
+
export const PRODUCT_LIFECYCLE_SUBJECT_KINDS = [
|
|
104
|
+
"user",
|
|
105
|
+
"api_key",
|
|
106
|
+
"service",
|
|
107
|
+
"other",
|
|
108
|
+
"none",
|
|
109
|
+
] as const;
|
|
110
|
+
export type ProductLifecycleSubjectKind = (typeof PRODUCT_LIFECYCLE_SUBJECT_KINDS)[number];
|
|
111
|
+
|
|
112
|
+
/** Pseudonymous subject ids that may leave the database. */
|
|
113
|
+
export const PRODUCT_LIFECYCLE_SUBJECT_ID_PATTERN = /^(user|api_key):[A-Za-z0-9_-]{8,128}$/;
|
|
114
|
+
|
|
115
|
+
export function isProductLifecycleFact(type: string, attribute: string | null): boolean {
|
|
116
|
+
if (!Object.hasOwn(PRODUCT_LIFECYCLE_FACT_ATTRIBUTES, type)) return false;
|
|
117
|
+
const allowed: readonly string[] =
|
|
118
|
+
PRODUCT_LIFECYCLE_FACT_ATTRIBUTES[type as ProductLifecycleFactType];
|
|
119
|
+
return allowed.length === 0
|
|
120
|
+
? attribute === null
|
|
121
|
+
: attribute !== null && allowed.includes(attribute);
|
|
122
|
+
}
|