@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
|
@@ -1,98 +1,115 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS } from "./agent-authored-durable-text";
|
|
3
4
|
import { KnowledgeEntryEvidence } from "./knowledge-entries";
|
|
4
5
|
import { WorkspaceInstructionPolicyTarget } from "./workspace-instruction-policies";
|
|
5
6
|
|
|
6
|
-
export const AgentInstructionEditMode =
|
|
7
|
+
export const AgentInstructionEditMode = /* @__PURE__ */ defineSchema(() =>
|
|
8
|
+
z.enum(["append", "edit"]),
|
|
9
|
+
);
|
|
7
10
|
export type AgentInstructionEditMode = z.infer<typeof AgentInstructionEditMode>;
|
|
8
11
|
|
|
9
|
-
export const AgentInstructionSaveRequest =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
export const AgentInstructionSaveRequest = /* @__PURE__ */ defineSchema(() =>
|
|
13
|
+
z
|
|
14
|
+
.object({
|
|
15
|
+
operationId: z.uuid(),
|
|
16
|
+
target: WorkspaceInstructionPolicyTarget,
|
|
17
|
+
editMode: AgentInstructionEditMode,
|
|
18
|
+
content: z.string().max(AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS).optional(),
|
|
19
|
+
oldText: z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.max(AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS)
|
|
23
|
+
.optional(),
|
|
24
|
+
newText: z.string().max(AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS).optional(),
|
|
25
|
+
expectedCurrentRevisionId: z.uuid().nullable(),
|
|
26
|
+
expectedActivationVersion: z.number().int().nonnegative(),
|
|
27
|
+
evidence: z.array(KnowledgeEntryEvidence).max(32).default([]),
|
|
28
|
+
reason: z.string().min(1).max(4096),
|
|
29
|
+
})
|
|
30
|
+
.superRefine((value, context) => {
|
|
31
|
+
if (value.editMode === "edit") {
|
|
32
|
+
if (value.oldText === undefined) {
|
|
33
|
+
context.addIssue({
|
|
34
|
+
code: "custom",
|
|
35
|
+
path: ["oldText"],
|
|
36
|
+
message: "An exact edit requires oldText",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (value.newText === undefined) {
|
|
40
|
+
context.addIssue({
|
|
41
|
+
code: "custom",
|
|
42
|
+
path: ["newText"],
|
|
43
|
+
message: "An exact edit requires newText (use an empty string to remove the text)",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (value.content !== undefined) {
|
|
47
|
+
context.addIssue({
|
|
48
|
+
code: "custom",
|
|
49
|
+
path: ["content"],
|
|
50
|
+
message: "An exact edit uses oldText and newText, not content",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
30
54
|
}
|
|
31
|
-
if (value.
|
|
55
|
+
if (value.content === undefined || value.content.trim().length === 0) {
|
|
32
56
|
context.addIssue({
|
|
33
57
|
code: "custom",
|
|
34
|
-
path: ["
|
|
35
|
-
message: "
|
|
58
|
+
path: ["content"],
|
|
59
|
+
message: "Append changes require non-empty content",
|
|
36
60
|
});
|
|
37
61
|
}
|
|
38
|
-
if (value.
|
|
62
|
+
if (value.oldText !== undefined || value.newText !== undefined) {
|
|
39
63
|
context.addIssue({
|
|
40
64
|
code: "custom",
|
|
41
|
-
path: ["
|
|
42
|
-
message: "
|
|
65
|
+
path: [value.oldText !== undefined ? "oldText" : "newText"],
|
|
66
|
+
message: "Append changes use content, not oldText or newText",
|
|
43
67
|
});
|
|
44
68
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
context.addIssue({
|
|
49
|
-
code: "custom",
|
|
50
|
-
path: ["content"],
|
|
51
|
-
message: "Append and replace changes require non-empty content",
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (value.oldText !== undefined || value.newText !== undefined) {
|
|
55
|
-
context.addIssue({
|
|
56
|
-
code: "custom",
|
|
57
|
-
path: [value.oldText !== undefined ? "oldText" : "newText"],
|
|
58
|
-
message: "Append and replace changes use content, not oldText or newText",
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
.strict();
|
|
69
|
+
})
|
|
70
|
+
.strict(),
|
|
71
|
+
);
|
|
63
72
|
export type AgentInstructionSaveRequest = z.input<typeof AgentInstructionSaveRequest>;
|
|
64
73
|
|
|
65
|
-
export const AgentInstructionReviewRequest =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
export const AgentInstructionReviewRequest = /* @__PURE__ */ defineSchema(() =>
|
|
75
|
+
z
|
|
76
|
+
.object({
|
|
77
|
+
operationId: z.uuid(),
|
|
78
|
+
revisionId: z.uuid(),
|
|
79
|
+
decision: z.enum(["approve", "reject"]),
|
|
80
|
+
reason: z.string().min(1).max(4096),
|
|
81
|
+
})
|
|
82
|
+
.strict(),
|
|
83
|
+
);
|
|
73
84
|
export type AgentInstructionReviewRequest = z.infer<typeof AgentInstructionReviewRequest>;
|
|
74
85
|
|
|
75
|
-
export const AgentInstructionReceipt =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
export const AgentInstructionReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
87
|
+
z.object({
|
|
88
|
+
operationId: z.uuid(),
|
|
89
|
+
revisionId: z.uuid(),
|
|
90
|
+
outcome: z.enum(["published", "pending", "rejected"]),
|
|
91
|
+
reviewBatchId: z.uuid().nullable(),
|
|
92
|
+
replayed: z.boolean(),
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
82
95
|
export type AgentInstructionReceipt = z.infer<typeof AgentInstructionReceipt>;
|
|
83
96
|
|
|
84
|
-
export const AgentInstructionReviewItem =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
export const AgentInstructionReviewItem = /* @__PURE__ */ defineSchema(() =>
|
|
98
|
+
z.object({
|
|
99
|
+
revisionId: z.uuid(),
|
|
100
|
+
content: z.string(),
|
|
101
|
+
target: WorkspaceInstructionPolicyTarget,
|
|
102
|
+
reviewBatchId: z.uuid().nullable(),
|
|
103
|
+
sessionId: z.uuid().nullable(),
|
|
104
|
+
reason: z.string(),
|
|
105
|
+
createdAt: z.string(),
|
|
106
|
+
}),
|
|
107
|
+
);
|
|
93
108
|
export type AgentInstructionReviewItem = z.infer<typeof AgentInstructionReviewItem>;
|
|
94
|
-
export const AgentInstructionReviewListResponse =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
109
|
+
export const AgentInstructionReviewListResponse = /* @__PURE__ */ defineSchema(() =>
|
|
110
|
+
z.object({
|
|
111
|
+
entries: z.array(AgentInstructionReviewItem),
|
|
112
|
+
nextCursor: z.string().nullable(),
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
98
115
|
export type AgentInstructionReviewListResponse = z.infer<typeof AgentInstructionReviewListResponse>;
|
package/src/agent-learning.ts
CHANGED
|
@@ -1,85 +1,108 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
/** Review controls publication. It never grants content or external-action authority. */
|
|
4
|
-
export const AgentLearningMode =
|
|
5
|
+
export const AgentLearningMode = /* @__PURE__ */ defineSchema(() =>
|
|
6
|
+
z.enum(["automatic", "review_first", "off"]),
|
|
7
|
+
);
|
|
5
8
|
export type AgentLearningMode = z.infer<typeof AgentLearningMode>;
|
|
6
9
|
|
|
7
|
-
export const AgentLearningCategory =
|
|
10
|
+
export const AgentLearningCategory = /* @__PURE__ */ defineSchema(() =>
|
|
11
|
+
z.enum(["knowledge", "instructions", "skills"]),
|
|
12
|
+
);
|
|
8
13
|
export type AgentLearningCategory = z.infer<typeof AgentLearningCategory>;
|
|
9
14
|
|
|
10
|
-
export const AgentLearningDefaults =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
export const AgentLearningDefaults = /* @__PURE__ */ defineSchema(() =>
|
|
16
|
+
z
|
|
17
|
+
.object({
|
|
18
|
+
knowledge: AgentLearningMode,
|
|
19
|
+
instructions: AgentLearningMode,
|
|
20
|
+
skills: AgentLearningMode,
|
|
21
|
+
})
|
|
22
|
+
.strict(),
|
|
23
|
+
);
|
|
17
24
|
export type AgentLearningDefaults = z.infer<typeof AgentLearningDefaults>;
|
|
18
25
|
|
|
19
26
|
export const DEFAULT_AGENT_LEARNING: Readonly<AgentLearningDefaults> = Object.freeze({
|
|
20
27
|
knowledge: "automatic",
|
|
21
|
-
instructions: "
|
|
22
|
-
skills: "
|
|
28
|
+
instructions: "automatic",
|
|
29
|
+
skills: "automatic",
|
|
23
30
|
});
|
|
24
31
|
|
|
25
32
|
/** An absent category inherits. `inherit` is a reset request, not persisted policy. */
|
|
26
|
-
export const AgentLearningOverrides =
|
|
33
|
+
export const AgentLearningOverrides = /* @__PURE__ */ defineSchema(() =>
|
|
34
|
+
AgentLearningDefaults.partial(),
|
|
35
|
+
);
|
|
27
36
|
export type AgentLearningOverrides = z.infer<typeof AgentLearningOverrides>;
|
|
28
37
|
|
|
29
|
-
export const AgentLearningOverridePatch =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
export const AgentLearningOverridePatch = /* @__PURE__ */ defineSchema(() =>
|
|
39
|
+
z
|
|
40
|
+
.object({
|
|
41
|
+
knowledge: AgentLearningMode.or(z.literal("inherit")).optional(),
|
|
42
|
+
instructions: AgentLearningMode.or(z.literal("inherit")).optional(),
|
|
43
|
+
skills: AgentLearningMode.or(z.literal("inherit")).optional(),
|
|
44
|
+
})
|
|
45
|
+
.strict(),
|
|
46
|
+
);
|
|
36
47
|
export type AgentLearningOverridePatch = z.infer<typeof AgentLearningOverridePatch>;
|
|
37
48
|
|
|
38
|
-
export const AgentLearningContext =
|
|
39
|
-
z.
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
export const AgentLearningContext = /* @__PURE__ */ defineSchema(() =>
|
|
50
|
+
z.discriminatedUnion("kind", [
|
|
51
|
+
z.object({ kind: z.literal("chat"), id: z.uuid() }).strict(),
|
|
52
|
+
z.object({ kind: z.literal("scheduled_task"), id: z.uuid() }).strict(),
|
|
53
|
+
]),
|
|
54
|
+
);
|
|
42
55
|
export type AgentLearningContext = z.infer<typeof AgentLearningContext>;
|
|
43
56
|
|
|
44
|
-
export const AgentLearningOwner =
|
|
45
|
-
z.
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
export const AgentLearningOwner = /* @__PURE__ */ defineSchema(() =>
|
|
58
|
+
z.discriminatedUnion("kind", [
|
|
59
|
+
z.object({ kind: z.literal("workspace"), workspaceId: z.uuid() }).strict(),
|
|
60
|
+
z.object({ kind: z.literal("personal"), subjectId: z.string().min(1).max(1024) }).strict(),
|
|
61
|
+
]),
|
|
62
|
+
);
|
|
48
63
|
export type AgentLearningOwner = z.infer<typeof AgentLearningOwner>;
|
|
49
64
|
|
|
50
|
-
export const AgentLearningSettings =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
export const AgentLearningSettings = /* @__PURE__ */ defineSchema(() =>
|
|
66
|
+
z
|
|
67
|
+
.object({
|
|
68
|
+
owner: AgentLearningOwner,
|
|
69
|
+
version: z.number().int().nonnegative(),
|
|
70
|
+
defaults: AgentLearningDefaults,
|
|
71
|
+
})
|
|
72
|
+
.strict(),
|
|
73
|
+
);
|
|
57
74
|
export type AgentLearningSettings = z.infer<typeof AgentLearningSettings>;
|
|
58
75
|
|
|
59
|
-
export const AgentLearningContextSettings =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
export const AgentLearningContextSettings = /* @__PURE__ */ defineSchema(() =>
|
|
77
|
+
z
|
|
78
|
+
.object({
|
|
79
|
+
context: AgentLearningContext,
|
|
80
|
+
version: z.number().int().nonnegative(),
|
|
81
|
+
overrides: AgentLearningOverrides,
|
|
82
|
+
})
|
|
83
|
+
.strict(),
|
|
84
|
+
);
|
|
66
85
|
export type AgentLearningContextSettings = z.infer<typeof AgentLearningContextSettings>;
|
|
67
86
|
|
|
68
87
|
/** Versioned settings returned by both central and contextual editors. */
|
|
69
|
-
export const AgentLearningSettingsRecord =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
export const AgentLearningSettingsRecord = /* @__PURE__ */ defineSchema(() =>
|
|
89
|
+
z.object({
|
|
90
|
+
ownerKey: z.string(),
|
|
91
|
+
contextKey: z.string(),
|
|
92
|
+
version: z.number().int().nonnegative(),
|
|
93
|
+
settings: AgentLearningOverrides,
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
75
96
|
export type AgentLearningSettingsRecord = z.infer<typeof AgentLearningSettingsRecord>;
|
|
76
|
-
export const AgentLearningOverrideRecord =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
97
|
+
export const AgentLearningOverrideRecord = /* @__PURE__ */ defineSchema(() =>
|
|
98
|
+
z.object({
|
|
99
|
+
contextKey: z.string(),
|
|
100
|
+
version: z.number().int().positive(),
|
|
101
|
+
settings: AgentLearningOverrides,
|
|
102
|
+
updatedAt: z.string(),
|
|
103
|
+
label: z.string(),
|
|
104
|
+
}),
|
|
105
|
+
);
|
|
83
106
|
export type AgentLearningOverrideRecord = z.infer<typeof AgentLearningOverrideRecord>;
|
|
84
107
|
export type SaveAgentLearningSettingsRequest = {
|
|
85
108
|
scope: "workspace" | "personal";
|
|
@@ -89,19 +112,23 @@ export type SaveAgentLearningSettingsRequest = {
|
|
|
89
112
|
settings: AgentLearningOverridePatch;
|
|
90
113
|
};
|
|
91
114
|
|
|
92
|
-
export const AgentLearningEffectiveCategory =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
export const AgentLearningEffectiveCategory = /* @__PURE__ */ defineSchema(() =>
|
|
116
|
+
z
|
|
117
|
+
.object({
|
|
118
|
+
mode: AgentLearningMode,
|
|
119
|
+
inherited: z.boolean(),
|
|
120
|
+
})
|
|
121
|
+
.strict(),
|
|
122
|
+
);
|
|
123
|
+
export const AgentLearningEffectivePolicy = /* @__PURE__ */ defineSchema(() =>
|
|
124
|
+
z
|
|
125
|
+
.object({
|
|
126
|
+
knowledge: AgentLearningEffectiveCategory,
|
|
127
|
+
instructions: AgentLearningEffectiveCategory,
|
|
128
|
+
skills: AgentLearningEffectiveCategory,
|
|
129
|
+
})
|
|
130
|
+
.strict(),
|
|
131
|
+
);
|
|
105
132
|
export type AgentLearningEffectivePolicy = z.infer<typeof AgentLearningEffectivePolicy>;
|
|
106
133
|
|
|
107
134
|
/** Apply only at an authorized settings boundary; this function confers no authority. */
|
package/src/agent-topology.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
import {
|
|
@@ -8,62 +9,66 @@ import {
|
|
|
8
9
|
import { WorkDiscoveryProjection } from "./work-claims";
|
|
9
10
|
|
|
10
11
|
/** Compact, bounded session projection for workspace agent-topology browsers. */
|
|
11
|
-
export const AgentTopologySession =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
z.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
status: SessionGoalStatus,
|
|
29
|
-
summary: z.string(),
|
|
30
|
-
summaryTruncated: z.boolean(),
|
|
31
|
-
})
|
|
32
|
-
.nullable(),
|
|
33
|
-
pause: z.object({
|
|
34
|
-
state: z.enum(["active", "paused"]),
|
|
35
|
-
additionalBlockerCount: z.number().int().nonnegative(),
|
|
36
|
-
source: z
|
|
12
|
+
export const AgentTopologySession = /* @__PURE__ */ defineSchema(() =>
|
|
13
|
+
z.object({
|
|
14
|
+
id: z.string().uuid(),
|
|
15
|
+
title: z.string().nullable(),
|
|
16
|
+
titleTruncated: z.boolean(),
|
|
17
|
+
parentSessionId: z.string().uuid().nullable(),
|
|
18
|
+
rootSessionId: z.string().uuid(),
|
|
19
|
+
nestedAgentDepth: NestedAgentDepthValue,
|
|
20
|
+
ancestorPath: z.array(
|
|
21
|
+
z.object({
|
|
22
|
+
id: z.string().uuid(),
|
|
23
|
+
title: z.string().nullable(),
|
|
24
|
+
titleTruncated: z.boolean(),
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
status: SessionStatus,
|
|
28
|
+
goal: z
|
|
37
29
|
.object({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
displayNameTruncated: z.boolean(),
|
|
30
|
+
status: SessionGoalStatus,
|
|
31
|
+
summary: z.string(),
|
|
32
|
+
summaryTruncated: z.boolean(),
|
|
42
33
|
})
|
|
43
34
|
.nullable(),
|
|
35
|
+
pause: z.object({
|
|
36
|
+
state: z.enum(["active", "paused"]),
|
|
37
|
+
additionalBlockerCount: z.number().int().nonnegative(),
|
|
38
|
+
source: z
|
|
39
|
+
.object({
|
|
40
|
+
kind: z.enum(["session", "workspace"]),
|
|
41
|
+
sessionId: z.string().uuid().optional(),
|
|
42
|
+
displayName: z.string(),
|
|
43
|
+
displayNameTruncated: z.boolean(),
|
|
44
|
+
})
|
|
45
|
+
.nullable(),
|
|
46
|
+
}),
|
|
47
|
+
children: z.object({
|
|
48
|
+
directChildren: z.number().int().nonnegative(),
|
|
49
|
+
totalDescendants: z.number().int().nonnegative(),
|
|
50
|
+
runningDescendants: z.number().int().nonnegative(),
|
|
51
|
+
queuedDescendants: z.number().int().nonnegative(),
|
|
52
|
+
attentionDescendants: z.number().int().nonnegative(),
|
|
53
|
+
pausedDescendants: z.number().int().nonnegative(),
|
|
54
|
+
failedDescendants: z.number().int().nonnegative(),
|
|
55
|
+
truncated: z.boolean(),
|
|
56
|
+
}),
|
|
57
|
+
relatedWork: WorkDiscoveryProjection,
|
|
58
|
+
createdAt: z.string(),
|
|
59
|
+
updatedAt: z.string(),
|
|
44
60
|
}),
|
|
45
|
-
|
|
46
|
-
directChildren: z.number().int().nonnegative(),
|
|
47
|
-
totalDescendants: z.number().int().nonnegative(),
|
|
48
|
-
runningDescendants: z.number().int().nonnegative(),
|
|
49
|
-
queuedDescendants: z.number().int().nonnegative(),
|
|
50
|
-
attentionDescendants: z.number().int().nonnegative(),
|
|
51
|
-
pausedDescendants: z.number().int().nonnegative(),
|
|
52
|
-
failedDescendants: z.number().int().nonnegative(),
|
|
53
|
-
truncated: z.boolean(),
|
|
54
|
-
}),
|
|
55
|
-
relatedWork: WorkDiscoveryProjection,
|
|
56
|
-
createdAt: z.string(),
|
|
57
|
-
updatedAt: z.string(),
|
|
58
|
-
});
|
|
61
|
+
);
|
|
59
62
|
export type AgentTopologySession = z.infer<typeof AgentTopologySession>;
|
|
60
63
|
|
|
61
|
-
export const AgentTopologyPageResponse =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
export const AgentTopologyPageResponse = /* @__PURE__ */ defineSchema(() =>
|
|
65
|
+
z.object({
|
|
66
|
+
sessions: z.array(AgentTopologySession),
|
|
67
|
+
total: z.number().int().nonnegative(),
|
|
68
|
+
hasMore: z.boolean(),
|
|
69
|
+
/** Operator rollout decision for human advisory presentation. */
|
|
70
|
+
humanAdvisoriesEnabled: z.boolean().optional(),
|
|
71
|
+
nextCursor: z.string().nullable(),
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
69
74
|
export type AgentTopologyPageResponse = z.infer<typeof AgentTopologyPageResponse>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { AllowanceExhaustedRefusal } from "./usage-allowances";
|
|
2
|
+
|
|
3
|
+
const MESSAGE_MAX_UTF8_BYTES = 1_024;
|
|
4
|
+
|
|
5
|
+
function record(value: unknown): Record<string, unknown> | null {
|
|
6
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
7
|
+
? (value as Record<string, unknown>)
|
|
8
|
+
: null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Mirror the canonical offset datetime's calendar/time bounds without loading
|
|
12
|
+
* the schema runtime into synchronous browser/React Native session projection.
|
|
13
|
+
* Contract-parity tests guard this deliberately small, bounded wire leaf.
|
|
14
|
+
*/
|
|
15
|
+
function resetTimestamp(value: unknown): value is string | null {
|
|
16
|
+
if (value === null) return true;
|
|
17
|
+
if (typeof value !== "string" || value.length > 64) return false;
|
|
18
|
+
const parts =
|
|
19
|
+
/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.exec(
|
|
20
|
+
value,
|
|
21
|
+
);
|
|
22
|
+
if (!parts || !Number.isFinite(Date.parse(value))) return false;
|
|
23
|
+
const year = Number(parts[1]);
|
|
24
|
+
const month = Number(parts[2]);
|
|
25
|
+
const day = Number(parts[3]);
|
|
26
|
+
const leapYear = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
27
|
+
const days = [31, leapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
28
|
+
return day <= days[month - 1]!;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Select only public refusal fields, including from an API error's details.
|
|
32
|
+
* LimitDecision's allowed:false and transport/SQL diagnostics never cross out.
|
|
33
|
+
*/
|
|
34
|
+
export function parseAllowanceExhaustedRefusal(value: unknown): AllowanceExhaustedRefusal | null {
|
|
35
|
+
const source = record(value);
|
|
36
|
+
if (source?.code !== "allowance_exhausted") return null;
|
|
37
|
+
const fields = record(source.details) ?? source;
|
|
38
|
+
const scope = fields.scope;
|
|
39
|
+
const subjectId = scope === "member" ? fields.subjectId : undefined;
|
|
40
|
+
if (
|
|
41
|
+
typeof source.message !== "string" ||
|
|
42
|
+
(scope !== "workspace" && scope !== "member") ||
|
|
43
|
+
!resetTimestamp(fields.resetsAt) ||
|
|
44
|
+
(subjectId !== undefined &&
|
|
45
|
+
(typeof subjectId !== "string" ||
|
|
46
|
+
subjectId.length === 0 ||
|
|
47
|
+
subjectId.length > 1_024 ||
|
|
48
|
+
subjectId.includes("\0")))
|
|
49
|
+
) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const normalized = source.message
|
|
53
|
+
.slice(0, MESSAGE_MAX_UTF8_BYTES * 2)
|
|
54
|
+
.replace(/[\u0000-\u001f\u007f]+/g, " ")
|
|
55
|
+
.trim();
|
|
56
|
+
const bytes = new TextEncoder().encode(normalized.slice(0, MESSAGE_MAX_UTF8_BYTES * 2));
|
|
57
|
+
let end = Math.min(bytes.length, MESSAGE_MAX_UTF8_BYTES);
|
|
58
|
+
while (end > 0 && end < bytes.length && (bytes[end]! & 0xc0) === 0x80) end -= 1;
|
|
59
|
+
return {
|
|
60
|
+
code: "allowance_exhausted",
|
|
61
|
+
scope,
|
|
62
|
+
resetsAt: fields.resetsAt,
|
|
63
|
+
...(typeof subjectId === "string" ? { subjectId } : {}),
|
|
64
|
+
message: new TextDecoder().decode(bytes.slice(0, end)).trim(),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Bounded, fixed remedies: a ceiling is not an exhausted billing source.
|
|
69
|
+
* Never interpolate arbitrary exception prose or a member identifier.
|
|
70
|
+
*/
|
|
71
|
+
export function allowanceExhaustedMessage(refusal: AllowanceExhaustedRefusal): string {
|
|
72
|
+
const remedy =
|
|
73
|
+
refusal.scope === "workspace"
|
|
74
|
+
? "The workspace usage allowance is exhausted. An organization administrator or a full-access organization API key can raise the workspace ceiling or add an allowance grant."
|
|
75
|
+
: "The member usage allowance is exhausted. A workspace administrator or a full-access organization API key can adjust the member ceiling.";
|
|
76
|
+
const reset =
|
|
77
|
+
refusal.resetsAt === null
|
|
78
|
+
? "This allowance has no automatic reset."
|
|
79
|
+
: `It resets at ${new Date(refusal.resetsAt).toISOString().slice(0, 16).replace("T", " ")} UTC.`;
|
|
80
|
+
return `${remedy} ${reset}`;
|
|
81
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire grammar of the content-free analytics consent beacon
|
|
3
|
+
* (`POST /v1/analytics-consent`).
|
|
4
|
+
*
|
|
5
|
+
* When a person answers the web console's optional-analytics banner, the
|
|
6
|
+
* browser reports only the closed decision so the API can count choices in
|
|
7
|
+
* `opengeni_analytics_consent_total{decision}`. The count shows how much of
|
|
8
|
+
* the audience the consent-gated analytics providers never see. A report
|
|
9
|
+
* carries no identifier, URL, cookie, or user content, and the web client and
|
|
10
|
+
* the API route both validate against these exact values.
|
|
11
|
+
*/
|
|
12
|
+
export const ANALYTICS_CONSENT_PATH = "/v1/analytics-consent";
|
|
13
|
+
|
|
14
|
+
export const ANALYTICS_CONSENT_DECISIONS = ["granted", "denied"] as const;
|
|
15
|
+
export type AnalyticsConsentDecision = (typeof ANALYTICS_CONSENT_DECISIONS)[number];
|
|
16
|
+
|
|
17
|
+
/** Largest accepted report body. A valid report is under 32 bytes. */
|
|
18
|
+
export const ANALYTICS_CONSENT_REPORT_MAX_BYTES = 128;
|
|
19
|
+
|
|
20
|
+
export type AnalyticsConsentReport = { decision: AnalyticsConsentDecision };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { Permission } from "./permissions";
|
|
4
|
+
|
|
5
|
+
/** Optional creation alias for the developer_setup organization access tier. */
|
|
6
|
+
export const OrganizationApiKeyPreset = /* @__PURE__ */ defineSchema(() =>
|
|
7
|
+
z.enum(["developer_setup"]),
|
|
8
|
+
);
|
|
9
|
+
export type OrganizationApiKeyPreset = z.infer<typeof OrganizationApiKeyPreset>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The current setup-route floor: workspace provisioning, configuration/cleanup,
|
|
13
|
+
* and explicit literal budget authority. workspace:admin also covers discovery and session/tool/
|
|
14
|
+
* schedule guards. It is broad authority, not setup-only, and never confers
|
|
15
|
+
* literal secrets:read. No account:admin, billing, or redundant read scopes.
|
|
16
|
+
*/
|
|
17
|
+
export const DEVELOPER_SETUP_API_KEY_PRESET = {
|
|
18
|
+
id: "developer_setup",
|
|
19
|
+
label: "Developer setup",
|
|
20
|
+
description:
|
|
21
|
+
"Set up shared workspaces, tools and budgets. Includes broad workspace administration and expires after 24 hours. Can't manage API keys.",
|
|
22
|
+
permissions: [
|
|
23
|
+
"workspace:create",
|
|
24
|
+
"workspace:admin",
|
|
25
|
+
"usage_allowances:manage",
|
|
26
|
+
] satisfies Permission[],
|
|
27
|
+
defaultExpiryHours: 24,
|
|
28
|
+
} as const;
|