@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/company-profile.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import {
|
|
3
4
|
AGENT_AUTHORED_COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES,
|
|
@@ -16,30 +17,33 @@ export const COMPANY_PROFILE_SOURCE_ID_MAX_CHARS = 512;
|
|
|
16
17
|
export const COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES = 28_672;
|
|
17
18
|
export const COMPANY_PROFILE_PROMPT_MAX_UTF8_BYTES = 32_768;
|
|
18
19
|
|
|
19
|
-
export const CompanyProfileStableKey =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export const CompanyProfileStableKey = /* @__PURE__ */ defineSchema(() =>
|
|
21
|
+
z
|
|
22
|
+
.string()
|
|
23
|
+
.min(1)
|
|
24
|
+
.max(COMPANY_PROFILE_STABLE_KEY_MAX_CHARS)
|
|
25
|
+
.regex(/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/),
|
|
26
|
+
);
|
|
24
27
|
export type CompanyProfileStableKey = z.infer<typeof CompanyProfileStableKey>;
|
|
25
28
|
|
|
26
29
|
export function normalizeCompanyProfileStableKey(value: string): string {
|
|
27
30
|
return value.normalize("NFKC").trim().toLowerCase().replace(/\s+/gu, "-").replace(/-+/g, "-");
|
|
28
31
|
}
|
|
29
32
|
|
|
30
|
-
export const CompanyProfileStableKeyInput =
|
|
31
|
-
.string()
|
|
32
|
-
|
|
33
|
-
.pipe(CompanyProfileStableKey);
|
|
33
|
+
export const CompanyProfileStableKeyInput = /* @__PURE__ */ defineSchema(() =>
|
|
34
|
+
z.string().transform(normalizeCompanyProfileStableKey).pipe(CompanyProfileStableKey),
|
|
35
|
+
);
|
|
34
36
|
|
|
35
|
-
export const CompanyProfileEntry =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
export const CompanyProfileEntry = /* @__PURE__ */ defineSchema(() =>
|
|
38
|
+
z.object({
|
|
39
|
+
key: CompanyProfileStableKeyInput,
|
|
40
|
+
content: z
|
|
41
|
+
.string()
|
|
42
|
+
.min(1)
|
|
43
|
+
.max(COMPANY_PROFILE_ENTRY_MAX_CHARS)
|
|
44
|
+
.refine((value) => value.trim().length > 0, "company-profile entries must not be blank"),
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
43
47
|
export type CompanyProfileEntry = z.infer<typeof CompanyProfileEntry>;
|
|
44
48
|
|
|
45
49
|
function boundedScalar() {
|
|
@@ -69,42 +73,44 @@ function uniqueEntryKeys(
|
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
|
-
export const CompanyProfileContent =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
76
|
+
export const CompanyProfileContent = /* @__PURE__ */ defineSchema(() =>
|
|
77
|
+
z
|
|
78
|
+
.object({
|
|
79
|
+
identity: boundedScalar(),
|
|
80
|
+
mission: boundedScalar(),
|
|
81
|
+
products: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
82
|
+
customers: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
83
|
+
goals: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
84
|
+
constraints: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
85
|
+
})
|
|
86
|
+
.strict()
|
|
87
|
+
.superRefine((value, context) => {
|
|
88
|
+
uniqueEntryKeys(value.products, "products", context);
|
|
89
|
+
uniqueEntryKeys(value.customers, "customers", context);
|
|
90
|
+
uniqueEntryKeys(value.goals, "goals", context);
|
|
91
|
+
uniqueEntryKeys(value.constraints, "constraints", context);
|
|
92
|
+
if (
|
|
93
|
+
value.identity === null &&
|
|
94
|
+
value.mission === null &&
|
|
95
|
+
value.products.length === 0 &&
|
|
96
|
+
value.customers.length === 0 &&
|
|
97
|
+
value.goals.length === 0 &&
|
|
98
|
+
value.constraints.length === 0
|
|
99
|
+
) {
|
|
100
|
+
context.addIssue({
|
|
101
|
+
code: "custom",
|
|
102
|
+
message: "a company profile must contain at least one field",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const contentBytes = new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
106
|
+
if (contentBytes > COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES) {
|
|
107
|
+
context.addIssue({
|
|
108
|
+
code: "custom",
|
|
109
|
+
message: `company profile is ${contentBytes} UTF-8 bytes; limit is ${COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES}`,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
108
114
|
export type CompanyProfileContent = z.infer<typeof CompanyProfileContent>;
|
|
109
115
|
|
|
110
116
|
/**
|
|
@@ -114,8 +120,8 @@ export type CompanyProfileContent = z.infer<typeof CompanyProfileContent>;
|
|
|
114
120
|
* accepts only identity and mission and writes empty compatibility lists, but
|
|
115
121
|
* the validator must still read historical revisions without rewriting them.
|
|
116
122
|
*/
|
|
117
|
-
export const AgentAuthoredCompanyProfileContent =
|
|
118
|
-
(value, context) => {
|
|
123
|
+
export const AgentAuthoredCompanyProfileContent = /* @__PURE__ */ defineSchema(() =>
|
|
124
|
+
CompanyProfileContent.superRefine((value, context) => {
|
|
119
125
|
for (const field of ["identity", "mission"] as const) {
|
|
120
126
|
const scalar = value[field];
|
|
121
127
|
if (scalar !== null && scalar.length > AGENT_AUTHORED_COMPANY_PROFILE_SCALAR_MAX_CHARS) {
|
|
@@ -144,329 +150,396 @@ export const AgentAuthoredCompanyProfileContent = CompanyProfileContent.superRef
|
|
|
144
150
|
message: `this profile is ${contentBytes} UTF-8 bytes. ${AGENT_AUTHORED_COMPANY_PROFILE_TOO_LONG_MESSAGE}`,
|
|
145
151
|
});
|
|
146
152
|
}
|
|
147
|
-
},
|
|
153
|
+
}),
|
|
148
154
|
);
|
|
149
155
|
export type AgentAuthoredCompanyProfileContent = z.infer<typeof AgentAuthoredCompanyProfileContent>;
|
|
150
156
|
|
|
151
|
-
export const CompanyProfileRevisionIntent =
|
|
157
|
+
export const CompanyProfileRevisionIntent = /* @__PURE__ */ defineSchema(() =>
|
|
158
|
+
z.enum(["active", "proposal"]),
|
|
159
|
+
);
|
|
152
160
|
export type CompanyProfileRevisionIntent = z.infer<typeof CompanyProfileRevisionIntent>;
|
|
153
161
|
|
|
154
|
-
export const CompanyProfileProvenanceSource =
|
|
155
|
-
"human",
|
|
156
|
-
|
|
157
|
-
"durable_learning",
|
|
158
|
-
"migration",
|
|
159
|
-
]);
|
|
162
|
+
export const CompanyProfileProvenanceSource = /* @__PURE__ */ defineSchema(() =>
|
|
163
|
+
z.enum(["human", "agent_admin", "durable_learning", "migration"]),
|
|
164
|
+
);
|
|
160
165
|
export type CompanyProfileProvenanceSource = z.infer<typeof CompanyProfileProvenanceSource>;
|
|
161
166
|
|
|
162
|
-
export const CompanyProfilePrincipalKind =
|
|
167
|
+
export const CompanyProfilePrincipalKind = /* @__PURE__ */ defineSchema(() =>
|
|
168
|
+
z.enum(["human_session", "agent_attempt", "service"]),
|
|
169
|
+
);
|
|
163
170
|
export type CompanyProfilePrincipalKind = z.infer<typeof CompanyProfilePrincipalKind>;
|
|
164
171
|
|
|
165
|
-
export const CompanyProfileActivationType =
|
|
172
|
+
export const CompanyProfileActivationType = /* @__PURE__ */ defineSchema(() =>
|
|
173
|
+
z.enum(["activate", "rollback"]),
|
|
174
|
+
);
|
|
166
175
|
export type CompanyProfileActivationType = z.infer<typeof CompanyProfileActivationType>;
|
|
167
176
|
|
|
168
|
-
export const CompanyProfileRevisionIdentity =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
})
|
|
177
|
+
export const CompanyProfileRevisionIdentity = /* @__PURE__ */ defineSchema(() =>
|
|
178
|
+
z.object({
|
|
179
|
+
id: z.string().uuid(),
|
|
180
|
+
revision: z.number().int().positive(),
|
|
181
|
+
contentHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
173
184
|
export type CompanyProfileRevisionIdentity = z.infer<typeof CompanyProfileRevisionIdentity>;
|
|
174
185
|
|
|
175
|
-
export const CompanyProfileRevision =
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
186
|
+
export const CompanyProfileRevision = /* @__PURE__ */ defineSchema(() =>
|
|
187
|
+
CompanyProfileRevisionIdentity.extend({
|
|
188
|
+
operationId: z.string().uuid(),
|
|
189
|
+
accountId: z.string().uuid(),
|
|
190
|
+
intent: CompanyProfileRevisionIntent,
|
|
191
|
+
profile: CompanyProfileContent,
|
|
192
|
+
provenance: z.object({
|
|
193
|
+
source: CompanyProfileProvenanceSource,
|
|
194
|
+
sourceId: z.string().min(1).max(COMPANY_PROFILE_SOURCE_ID_MAX_CHARS).nullable(),
|
|
195
|
+
}),
|
|
196
|
+
supersedesRevisionId: z.string().uuid().nullable(),
|
|
197
|
+
createdBySubjectId: z.string().min(1).max(1_024),
|
|
198
|
+
createdAt: z.string().datetime(),
|
|
183
199
|
}),
|
|
184
|
-
|
|
185
|
-
createdBySubjectId: z.string().min(1).max(1_024),
|
|
186
|
-
createdAt: z.string().datetime(),
|
|
187
|
-
});
|
|
200
|
+
);
|
|
188
201
|
export type CompanyProfileRevision = z.infer<typeof CompanyProfileRevision>;
|
|
189
202
|
|
|
190
|
-
export const CompanyProfileHead =
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
203
|
+
export const CompanyProfileHead = /* @__PURE__ */ defineSchema(() =>
|
|
204
|
+
z.object({
|
|
205
|
+
accountId: z.string().uuid(),
|
|
206
|
+
revisionId: z.string().uuid(),
|
|
207
|
+
revision: z.number().int().positive(),
|
|
208
|
+
contentHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
209
|
+
activationVersion: z.number().int().positive(),
|
|
210
|
+
activatedAt: z.string().datetime(),
|
|
211
|
+
}),
|
|
212
|
+
);
|
|
198
213
|
export type CompanyProfileHead = z.infer<typeof CompanyProfileHead>;
|
|
199
214
|
|
|
200
|
-
export const CompanyProfileActivationEvent =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
215
|
+
export const CompanyProfileActivationEvent = /* @__PURE__ */ defineSchema(() =>
|
|
216
|
+
z.object({
|
|
217
|
+
id: z.string().uuid(),
|
|
218
|
+
operationId: z.string().uuid(),
|
|
219
|
+
accountId: z.string().uuid(),
|
|
220
|
+
type: CompanyProfileActivationType,
|
|
221
|
+
activationVersion: z.number().int().positive(),
|
|
222
|
+
oldRevision: CompanyProfileRevisionIdentity.nullable(),
|
|
223
|
+
newRevision: CompanyProfileRevisionIdentity.nullable(),
|
|
224
|
+
actorSubjectId: z.string().min(1).max(1_024),
|
|
225
|
+
reason: z.string().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
226
|
+
createdAt: z.string().datetime(),
|
|
227
|
+
}),
|
|
228
|
+
);
|
|
212
229
|
export type CompanyProfileActivationEvent = z.infer<typeof CompanyProfileActivationEvent>;
|
|
213
230
|
|
|
214
|
-
export const CompanyProfileSnapshotEntry =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
231
|
+
export const CompanyProfileSnapshotEntry = /* @__PURE__ */ defineSchema(() =>
|
|
232
|
+
CompanyProfileRevisionIdentity.extend({
|
|
233
|
+
activationVersion: z.number().int().positive(),
|
|
234
|
+
activatedAt: z.string().datetime(),
|
|
235
|
+
provenance: z.object({
|
|
236
|
+
source: CompanyProfileProvenanceSource,
|
|
237
|
+
sourceIdHash: z
|
|
238
|
+
.string()
|
|
239
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
240
|
+
.nullable(),
|
|
241
|
+
}),
|
|
223
242
|
}),
|
|
224
|
-
|
|
243
|
+
);
|
|
225
244
|
export type CompanyProfileSnapshotEntry = z.infer<typeof CompanyProfileSnapshotEntry>;
|
|
226
245
|
|
|
227
|
-
export const CompanyProfileSnapshot =
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
export const CompanyProfileSnapshot = /* @__PURE__ */ defineSchema(() =>
|
|
247
|
+
z.object({
|
|
248
|
+
id: z.string().uuid(),
|
|
249
|
+
accountId: z.string().uuid(),
|
|
250
|
+
workspaceId: z.string().uuid(),
|
|
251
|
+
sessionId: z.string().uuid(),
|
|
252
|
+
turnId: z.string().uuid(),
|
|
253
|
+
attemptId: z.string().uuid(),
|
|
254
|
+
executionGeneration: z.number().int().positive(),
|
|
255
|
+
profile: CompanyProfileSnapshotEntry.nullable(),
|
|
256
|
+
snapshotHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
257
|
+
createdAt: z.string().datetime(),
|
|
258
|
+
}),
|
|
259
|
+
);
|
|
239
260
|
export type CompanyProfileSnapshot = z.infer<typeof CompanyProfileSnapshot>;
|
|
240
261
|
|
|
241
|
-
export const ResolvedCompanyProfileSnapshot =
|
|
242
|
-
|
|
243
|
-
})
|
|
262
|
+
export const ResolvedCompanyProfileSnapshot = /* @__PURE__ */ defineSchema(() =>
|
|
263
|
+
CompanyProfileSnapshot.extend({
|
|
264
|
+
profile: CompanyProfileSnapshotEntry.extend({ profile: CompanyProfileContent }).nullable(),
|
|
265
|
+
}),
|
|
266
|
+
);
|
|
244
267
|
export type ResolvedCompanyProfileSnapshot = z.infer<typeof ResolvedCompanyProfileSnapshot>;
|
|
245
268
|
|
|
246
|
-
export const CompanyProfileListQuery =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
269
|
+
export const CompanyProfileListQuery = /* @__PURE__ */ defineSchema(() =>
|
|
270
|
+
z.object({
|
|
271
|
+
afterRevision: z.coerce.number().int().positive().optional(),
|
|
272
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
273
|
+
}),
|
|
274
|
+
);
|
|
250
275
|
export type CompanyProfileListQuery = z.infer<typeof CompanyProfileListQuery>;
|
|
251
276
|
|
|
252
|
-
export const CompanyProfileListResponse =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
277
|
+
export const CompanyProfileListResponse = /* @__PURE__ */ defineSchema(() =>
|
|
278
|
+
z.object({
|
|
279
|
+
current: CompanyProfileHead.nullable(),
|
|
280
|
+
activeRevision: CompanyProfileRevision.nullable(),
|
|
281
|
+
revisions: z.array(CompanyProfileRevision),
|
|
282
|
+
activationEvents: z.array(CompanyProfileActivationEvent),
|
|
283
|
+
nextAfterRevision: z.number().int().positive().nullable(),
|
|
284
|
+
}),
|
|
285
|
+
);
|
|
259
286
|
export type CompanyProfileListResponse = z.infer<typeof CompanyProfileListResponse>;
|
|
260
287
|
|
|
261
|
-
export const UpdateCompanyProfileRequest =
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
288
|
+
export const UpdateCompanyProfileRequest = /* @__PURE__ */ defineSchema(() =>
|
|
289
|
+
z.object({
|
|
290
|
+
operationId: z.string().uuid().optional(),
|
|
291
|
+
profile: CompanyProfileContent,
|
|
292
|
+
expectedCurrentRevisionId: z.string().uuid().nullable(),
|
|
293
|
+
expectedActivationVersion: z.number().int().nonnegative(),
|
|
294
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
295
|
+
}),
|
|
296
|
+
);
|
|
268
297
|
export type UpdateCompanyProfileRequest = z.infer<typeof UpdateCompanyProfileRequest>;
|
|
269
298
|
|
|
270
|
-
export const ActivateCompanyProfileRevisionRequest =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
299
|
+
export const ActivateCompanyProfileRevisionRequest = /* @__PURE__ */ defineSchema(() =>
|
|
300
|
+
z.object({
|
|
301
|
+
operationId: z.string().uuid().optional(),
|
|
302
|
+
expectedCurrentRevisionId: z.string().uuid().nullable(),
|
|
303
|
+
expectedActivationVersion: z.number().int().nonnegative(),
|
|
304
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
305
|
+
}),
|
|
306
|
+
);
|
|
276
307
|
export type ActivateCompanyProfileRevisionRequest = z.infer<
|
|
277
308
|
typeof ActivateCompanyProfileRevisionRequest
|
|
278
309
|
>;
|
|
279
310
|
|
|
280
|
-
export const RollbackCompanyProfileRequest =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
311
|
+
export const RollbackCompanyProfileRequest = /* @__PURE__ */ defineSchema(() =>
|
|
312
|
+
z.object({
|
|
313
|
+
operationId: z.string().uuid().optional(),
|
|
314
|
+
targetRevisionId: z.string().uuid(),
|
|
315
|
+
expectedCurrentRevisionId: z.string().uuid(),
|
|
316
|
+
expectedActivationVersion: z.number().int().positive(),
|
|
317
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
318
|
+
}),
|
|
319
|
+
);
|
|
287
320
|
export type RollbackCompanyProfileRequest = z.infer<typeof RollbackCompanyProfileRequest>;
|
|
288
321
|
|
|
289
|
-
export const CompanyProfileMutationResponse =
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
322
|
+
export const CompanyProfileMutationResponse = /* @__PURE__ */ defineSchema(() =>
|
|
323
|
+
z.object({
|
|
324
|
+
revision: CompanyProfileRevision.nullable(),
|
|
325
|
+
head: CompanyProfileHead.nullable(),
|
|
326
|
+
event: CompanyProfileActivationEvent.nullable(),
|
|
327
|
+
}),
|
|
328
|
+
);
|
|
294
329
|
export type CompanyProfileMutationResponse = z.infer<typeof CompanyProfileMutationResponse>;
|
|
295
330
|
|
|
296
331
|
export const COMPANY_PROFILE_AGENT_APPROVE_OPTION = "activate" as const;
|
|
297
332
|
export const COMPANY_PROFILE_AGENT_REJECT_OPTION = "skip" as const;
|
|
298
333
|
|
|
299
|
-
export const CompanyProfileAgentPolicyMode =
|
|
334
|
+
export const CompanyProfileAgentPolicyMode = /* @__PURE__ */ defineSchema(() =>
|
|
335
|
+
z.enum(["off", "suggest", "automatic"]),
|
|
336
|
+
);
|
|
300
337
|
export type CompanyProfileAgentPolicyMode = z.infer<typeof CompanyProfileAgentPolicyMode>;
|
|
301
338
|
|
|
302
|
-
export const CompanyProfileAgentPolicy =
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
339
|
+
export const CompanyProfileAgentPolicy = /* @__PURE__ */ defineSchema(() =>
|
|
340
|
+
z.object({
|
|
341
|
+
organizationId: z.string().uuid(),
|
|
342
|
+
mode: CompanyProfileAgentPolicyMode,
|
|
343
|
+
version: z.number().int().nonnegative(),
|
|
344
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
345
|
+
changed: z.boolean().optional(),
|
|
346
|
+
}),
|
|
347
|
+
);
|
|
309
348
|
export type CompanyProfileAgentPolicy = z.infer<typeof CompanyProfileAgentPolicy>;
|
|
310
349
|
|
|
311
|
-
export const UpdateCompanyProfileAgentPolicyRequest =
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
350
|
+
export const UpdateCompanyProfileAgentPolicyRequest = /* @__PURE__ */ defineSchema(() =>
|
|
351
|
+
z
|
|
352
|
+
.object({
|
|
353
|
+
mode: CompanyProfileAgentPolicyMode,
|
|
354
|
+
expectedVersion: z.number().int().nonnegative(),
|
|
355
|
+
operationId: z.string().uuid(),
|
|
356
|
+
})
|
|
357
|
+
.strict(),
|
|
358
|
+
);
|
|
318
359
|
export type UpdateCompanyProfileAgentPolicyRequest = z.infer<
|
|
319
360
|
typeof UpdateCompanyProfileAgentPolicyRequest
|
|
320
361
|
>;
|
|
321
362
|
|
|
322
|
-
export const CompanyProfileAgentAttempt =
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
363
|
+
export const CompanyProfileAgentAttempt = /* @__PURE__ */ defineSchema(() =>
|
|
364
|
+
z
|
|
365
|
+
.object({
|
|
366
|
+
accountId: z.string().uuid(),
|
|
367
|
+
workspaceId: z.string().uuid(),
|
|
368
|
+
sessionId: z.string().uuid(),
|
|
369
|
+
turnId: z.string().uuid(),
|
|
370
|
+
attemptId: z.string().uuid(),
|
|
371
|
+
executionGeneration: z.number().int().positive(),
|
|
372
|
+
agentSubjectId: z.string().trim().min(1).max(1_024),
|
|
373
|
+
})
|
|
374
|
+
.strict(),
|
|
375
|
+
);
|
|
333
376
|
export type CompanyProfileAgentAttempt = z.infer<typeof CompanyProfileAgentAttempt>;
|
|
334
377
|
|
|
335
|
-
export const CompanyProfileAgentProposalRequest =
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
378
|
+
export const CompanyProfileAgentProposalRequest = /* @__PURE__ */ defineSchema(() =>
|
|
379
|
+
z
|
|
380
|
+
.object({
|
|
381
|
+
operationId: z.string().uuid(),
|
|
382
|
+
profile: CompanyProfileContent,
|
|
383
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
384
|
+
})
|
|
385
|
+
.strict(),
|
|
386
|
+
);
|
|
342
387
|
export type CompanyProfileAgentProposalRequest = z.infer<typeof CompanyProfileAgentProposalRequest>;
|
|
343
388
|
|
|
344
389
|
// z.lazy avoids an import cycle because HumanInputQuestion is declared in the
|
|
345
390
|
// root contracts module that re-exports this file.
|
|
346
|
-
export const CompanyProfileAgentHumanInputPrompt =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
391
|
+
export const CompanyProfileAgentHumanInputPrompt = /* @__PURE__ */ defineSchema(() =>
|
|
392
|
+
z.object({
|
|
393
|
+
questions: z.array(z.lazy(() => HumanInputQuestion)).length(1),
|
|
394
|
+
allowSkip: z.literal(false),
|
|
395
|
+
}),
|
|
396
|
+
);
|
|
350
397
|
export type CompanyProfileAgentHumanInputPrompt = z.infer<
|
|
351
398
|
typeof CompanyProfileAgentHumanInputPrompt
|
|
352
399
|
>;
|
|
353
400
|
|
|
354
|
-
export const CompanyProfileAgentReviewRequiredReceipt =
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
401
|
+
export const CompanyProfileAgentReviewRequiredReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
402
|
+
z.object({
|
|
403
|
+
status: z.literal("confirmation_required"),
|
|
404
|
+
operationId: z.string().uuid(),
|
|
405
|
+
proposalReceiptId: z.string().uuid(),
|
|
406
|
+
revision: CompanyProfileRevision,
|
|
407
|
+
policyMode: z.literal("suggest"),
|
|
408
|
+
humanInput: CompanyProfileAgentHumanInputPrompt,
|
|
409
|
+
confirmWith: z.literal("company_profile_confirm"),
|
|
410
|
+
replayed: z.boolean(),
|
|
411
|
+
}),
|
|
412
|
+
);
|
|
364
413
|
export type CompanyProfileAgentReviewRequiredReceipt = z.infer<
|
|
365
414
|
typeof CompanyProfileAgentReviewRequiredReceipt
|
|
366
415
|
>;
|
|
367
416
|
|
|
368
|
-
export const CompanyProfileAgentAutomaticActivationReceipt =
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
417
|
+
export const CompanyProfileAgentAutomaticActivationReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
418
|
+
z.object({
|
|
419
|
+
status: z.literal("activated"),
|
|
420
|
+
operationId: z.string().uuid(),
|
|
421
|
+
proposalReceiptId: z.string().uuid(),
|
|
422
|
+
automaticActivationReceiptId: z.string().uuid(),
|
|
423
|
+
policyMode: z.literal("automatic"),
|
|
424
|
+
mutation: CompanyProfileMutationResponse,
|
|
425
|
+
replayed: z.boolean(),
|
|
426
|
+
}),
|
|
427
|
+
);
|
|
377
428
|
export type CompanyProfileAgentAutomaticActivationReceipt = z.infer<
|
|
378
429
|
typeof CompanyProfileAgentAutomaticActivationReceipt
|
|
379
430
|
>;
|
|
380
431
|
|
|
381
|
-
export const CompanyProfileAgentProposalReceipt =
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
432
|
+
export const CompanyProfileAgentProposalReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
433
|
+
z.discriminatedUnion("status", [
|
|
434
|
+
CompanyProfileAgentReviewRequiredReceipt,
|
|
435
|
+
CompanyProfileAgentAutomaticActivationReceipt,
|
|
436
|
+
]),
|
|
437
|
+
);
|
|
385
438
|
export type CompanyProfileAgentProposalReceipt = z.infer<typeof CompanyProfileAgentProposalReceipt>;
|
|
386
439
|
|
|
387
|
-
export const CompanyProfileAgentConfirmRequest =
|
|
388
|
-
|
|
440
|
+
export const CompanyProfileAgentConfirmRequest = /* @__PURE__ */ defineSchema(() =>
|
|
441
|
+
z
|
|
442
|
+
.object({
|
|
443
|
+
operationId: z.string().uuid(),
|
|
444
|
+
proposalReceiptId: z.string().uuid(),
|
|
445
|
+
humanInputRequestId: z.string().uuid(),
|
|
446
|
+
})
|
|
447
|
+
.strict(),
|
|
448
|
+
);
|
|
449
|
+
export type CompanyProfileAgentConfirmRequest = z.infer<typeof CompanyProfileAgentConfirmRequest>;
|
|
450
|
+
|
|
451
|
+
export const CompanyProfileAgentConfirmationReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
452
|
+
z.object({
|
|
453
|
+
status: z.literal("activated"),
|
|
389
454
|
operationId: z.string().uuid(),
|
|
455
|
+
confirmationReceiptId: z.string().uuid(),
|
|
390
456
|
proposalReceiptId: z.string().uuid(),
|
|
391
457
|
humanInputRequestId: z.string().uuid(),
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
export const CompanyProfileAgentConfirmationReceipt = z.object({
|
|
397
|
-
status: z.literal("activated"),
|
|
398
|
-
operationId: z.string().uuid(),
|
|
399
|
-
confirmationReceiptId: z.string().uuid(),
|
|
400
|
-
proposalReceiptId: z.string().uuid(),
|
|
401
|
-
humanInputRequestId: z.string().uuid(),
|
|
402
|
-
mutation: CompanyProfileMutationResponse,
|
|
403
|
-
replayed: z.boolean(),
|
|
404
|
-
});
|
|
458
|
+
mutation: CompanyProfileMutationResponse,
|
|
459
|
+
replayed: z.boolean(),
|
|
460
|
+
}),
|
|
461
|
+
);
|
|
405
462
|
export type CompanyProfileAgentConfirmationReceipt = z.infer<
|
|
406
463
|
typeof CompanyProfileAgentConfirmationReceipt
|
|
407
464
|
>;
|
|
408
465
|
|
|
409
|
-
export const CompanyProfileDiffRequest =
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
466
|
+
export const CompanyProfileDiffRequest = /* @__PURE__ */ defineSchema(() =>
|
|
467
|
+
z
|
|
468
|
+
.object({ fromRevisionId: z.string().uuid(), toRevisionId: z.string().uuid() })
|
|
469
|
+
.refine((value) => value.fromRevisionId !== value.toRevisionId, {
|
|
470
|
+
path: ["toRevisionId"],
|
|
471
|
+
message: "diff revisions must be different",
|
|
472
|
+
}),
|
|
473
|
+
);
|
|
415
474
|
export type CompanyProfileDiffRequest = z.infer<typeof CompanyProfileDiffRequest>;
|
|
416
475
|
|
|
417
|
-
export const CompanyProfileDiffResponse =
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
476
|
+
export const CompanyProfileDiffResponse = /* @__PURE__ */ defineSchema(() =>
|
|
477
|
+
z.object({
|
|
478
|
+
from: CompanyProfileRevision,
|
|
479
|
+
to: CompanyProfileRevision,
|
|
480
|
+
format: z.literal("unified_json"),
|
|
481
|
+
diff: z.string(),
|
|
482
|
+
}),
|
|
483
|
+
);
|
|
423
484
|
export type CompanyProfileDiffResponse = z.infer<typeof CompanyProfileDiffResponse>;
|
|
424
485
|
|
|
425
|
-
export const CompanyProfileConflictResponse =
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
486
|
+
export const CompanyProfileConflictResponse = /* @__PURE__ */ defineSchema(() =>
|
|
487
|
+
z.object({
|
|
488
|
+
code: z.literal("COMPANY_PROFILE_CONFLICT"),
|
|
489
|
+
message: z.string(),
|
|
490
|
+
currentHead: CompanyProfileHead.nullable(),
|
|
491
|
+
}),
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
export const CompanyProfileOperationReuseResponse = /* @__PURE__ */ defineSchema(() =>
|
|
495
|
+
z.object({
|
|
496
|
+
code: z.literal("COMPANY_PROFILE_OPERATION_REUSED"),
|
|
497
|
+
message: z.string(),
|
|
498
|
+
}),
|
|
499
|
+
);
|
|
500
|
+
|
|
501
|
+
export const CompanyProfileLearningSubjectKind = /* @__PURE__ */ defineSchema(() =>
|
|
502
|
+
z.enum([
|
|
503
|
+
"company_identity",
|
|
504
|
+
"company_mission",
|
|
505
|
+
"company_product",
|
|
506
|
+
"company_customer",
|
|
507
|
+
"company_goal",
|
|
508
|
+
"company_constraint",
|
|
509
|
+
]),
|
|
510
|
+
);
|
|
444
511
|
export type CompanyProfileLearningSubjectKind = z.infer<typeof CompanyProfileLearningSubjectKind>;
|
|
445
512
|
|
|
446
|
-
const CompanyProfileScalarLearningSubject =
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
513
|
+
const CompanyProfileScalarLearningSubject = /* @__PURE__ */ defineSchema(() =>
|
|
514
|
+
z.object({
|
|
515
|
+
kind: z.enum(["company_identity", "company_mission"]),
|
|
516
|
+
content: z.string().trim().min(1).max(COMPANY_PROFILE_SCALAR_MAX_CHARS),
|
|
517
|
+
stableKey: z.null(),
|
|
518
|
+
}),
|
|
519
|
+
);
|
|
451
520
|
|
|
452
|
-
const CompanyProfileRepeatableLearningSubject =
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
521
|
+
const CompanyProfileRepeatableLearningSubject = /* @__PURE__ */ defineSchema(() =>
|
|
522
|
+
z.object({
|
|
523
|
+
kind: z.enum(["company_product", "company_customer", "company_goal", "company_constraint"]),
|
|
524
|
+
content: z.string().trim().min(1).max(COMPANY_PROFILE_ENTRY_MAX_CHARS),
|
|
525
|
+
stableKey: CompanyProfileStableKeyInput,
|
|
526
|
+
}),
|
|
527
|
+
);
|
|
457
528
|
|
|
458
529
|
/** Authority-native seam invoked only by the canonical durable-learning router adapter. */
|
|
459
|
-
export const CompanyProfileLearningWrite =
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
530
|
+
export const CompanyProfileLearningWrite = /* @__PURE__ */ defineSchema(() =>
|
|
531
|
+
z.object({
|
|
532
|
+
operationId: z.string().uuid(),
|
|
533
|
+
accountId: z.string().uuid(),
|
|
534
|
+
workspaceId: z.string().uuid(),
|
|
535
|
+
actorSubjectId: z.string().min(1).max(1_024),
|
|
536
|
+
actorKind: z.enum(["human", "agent", "service"]),
|
|
537
|
+
authority: z.enum(["active", "proposal"]),
|
|
538
|
+
subject: z.discriminatedUnion("kind", [
|
|
539
|
+
CompanyProfileScalarLearningSubject,
|
|
540
|
+
CompanyProfileRepeatableLearningSubject,
|
|
541
|
+
]),
|
|
542
|
+
sourceId: z.string().min(1).max(COMPANY_PROFILE_SOURCE_ID_MAX_CHARS),
|
|
543
|
+
}),
|
|
544
|
+
);
|
|
472
545
|
export type CompanyProfileLearningWrite = z.infer<typeof CompanyProfileLearningWrite>;
|