@opengeni/contracts 0.44.1 → 1.0.0
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 +70 -0
- package/dist/agent-config.d.ts +869 -0
- package/dist/agent-instruction-changes.d.ts +110 -0
- package/dist/agent-learning.d.ts +243 -0
- package/dist/agent-topology.d.ts +292 -0
- 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 +161 -0
- package/dist/artifacts.d.ts +135 -11
- 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 +2 -0
- package/dist/atlassian.js +27 -11
- 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 +40 -0
- package/dist/canonical-human-identities.d.ts +157 -0
- package/dist/canonical-human-identities.js +23 -0
- package/dist/canonical-human-identities.js.map +1 -0
- package/dist/chunk-2ACYHZFB.js +292 -0
- package/dist/chunk-2ACYHZFB.js.map +1 -0
- package/dist/chunk-2VORLN2R.js +353 -0
- package/dist/chunk-2VORLN2R.js.map +1 -0
- package/dist/{chunk-Y3MLSLB4.js → chunk-3SIZGL3O.js} +42 -30
- package/dist/chunk-3SIZGL3O.js.map +1 -0
- package/dist/chunk-46KLD2UH.js +186 -0
- package/dist/chunk-46KLD2UH.js.map +1 -0
- package/dist/chunk-4JGHSSB7.js +11 -0
- package/dist/chunk-4JGHSSB7.js.map +1 -0
- package/dist/{chunk-52SGB2QO.js → chunk-5IXYF6XN.js} +50 -10
- package/dist/chunk-5IXYF6XN.js.map +1 -0
- package/dist/chunk-BCS7WHCK.js +139 -0
- package/dist/chunk-BCS7WHCK.js.map +1 -0
- package/dist/chunk-EK7NDGFR.js +128 -0
- package/dist/chunk-EK7NDGFR.js.map +1 -0
- package/dist/{chunk-5UDNP7AO.js → chunk-FZ6BXQHL.js} +78 -38
- package/dist/chunk-FZ6BXQHL.js.map +1 -0
- package/dist/chunk-GRG7PHWQ.js +25 -0
- package/dist/chunk-GRG7PHWQ.js.map +1 -0
- package/dist/chunk-JUFK3T4Q.js +80 -0
- package/dist/chunk-JUFK3T4Q.js.map +1 -0
- package/dist/chunk-KHHZTBP7.js +11 -0
- package/dist/chunk-KHHZTBP7.js.map +1 -0
- package/dist/chunk-KR2V42UZ.js +187 -0
- package/dist/chunk-KR2V42UZ.js.map +1 -0
- package/dist/chunk-MZLBPKFE.js +168 -0
- package/dist/chunk-MZLBPKFE.js.map +1 -0
- package/dist/{chunk-H5BVCZKF.js → chunk-NRMCVHAU.js} +6 -5
- package/dist/chunk-NRMCVHAU.js.map +1 -0
- package/dist/{chunk-TZ6YEYN4.js → chunk-NVJMJWLL.js} +3 -1
- package/dist/chunk-NVJMJWLL.js.map +1 -0
- package/dist/chunk-O77VSFYZ.js +70 -0
- package/dist/chunk-O77VSFYZ.js.map +1 -0
- package/dist/chunk-PX3VCKAU.js +29 -0
- package/dist/chunk-PX3VCKAU.js.map +1 -0
- package/dist/chunk-QR5D2IQC.js +61 -0
- package/dist/chunk-QR5D2IQC.js.map +1 -0
- package/dist/chunk-RJ76DRPO.js +117 -0
- package/dist/chunk-RJ76DRPO.js.map +1 -0
- package/dist/chunk-RKX3NQYS.js +28 -0
- package/dist/chunk-RKX3NQYS.js.map +1 -0
- package/dist/{chunk-FJBG5E4O.js → chunk-SIOU2K4U.js} +45 -22
- package/dist/chunk-SIOU2K4U.js.map +1 -0
- package/dist/chunk-TSCDAGET.js +75 -0
- package/dist/chunk-TSCDAGET.js.map +1 -0
- package/dist/{chunk-LSB7GRLG.js → chunk-TXTQIYCV.js} +15 -11
- package/dist/chunk-TXTQIYCV.js.map +1 -0
- package/dist/chunk-X7ETVO4P.js +26544 -0
- package/dist/chunk-X7ETVO4P.js.map +1 -0
- package/dist/{chunk-CADSX6UN.js → chunk-Y3KNXVTD.js} +2 -2
- package/dist/chunk-YBW5JSA3.js +251 -0
- package/dist/chunk-YBW5JSA3.js.map +1 -0
- package/dist/chunk-YRXAWWCU.js +45 -0
- package/dist/chunk-YRXAWWCU.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 +109 -0
- package/dist/client-error-report.js +87 -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.d.ts +23 -0
- package/dist/codex-provider-account-authority.js +23 -0
- package/dist/codex-provider-account-authority.js.map +1 -0
- package/dist/company-brain-governed-writes.d.ts +475 -0
- package/dist/company-brain.d.ts +336 -0
- package/dist/company-profile.d.ts +566 -0
- package/dist/connect.d.ts +325 -0
- package/dist/connect.js +191 -0
- package/dist/connect.js.map +1 -0
- 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 +193 -0
- package/dist/connection-authority.js +50 -0
- package/dist/connection-authority.js.map +1 -0
- package/dist/connector-attachments.d.ts +95 -0
- package/dist/connector-attachments.js +51 -0
- package/dist/connector-attachments.js.map +1 -0
- package/dist/connector-tool-permissions.d.ts +73 -0
- package/dist/direct-model-provider.d.ts +36 -0
- package/dist/editable-artifact-codec-registry.d.ts +16 -7
- package/dist/editable-artifact-codec-registry.js +19 -9
- package/dist/editable-artifact-committed-transaction.d.ts +2 -2
- package/dist/editable-artifact-committed-transaction.js +2 -2
- package/dist/editable-artifact-live.d.ts +11 -12
- package/dist/editable-artifact-live.js +110 -45
- package/dist/editable-artifact-live.js.map +1 -1
- package/dist/editable-artifact-serialized-commit.d.ts +2 -1
- package/dist/editable-artifact-serialized-commit.js +8 -7
- package/dist/editable-artifact-versions.d.ts +20 -5
- package/dist/editable-artifact-versions.js +23 -5
- package/dist/editable-artifacts.d.ts +2 -0
- package/dist/editable-artifacts.js +48 -36
- package/dist/external-identities.d.ts +784 -0
- package/dist/external-identities.js +44 -0
- package/dist/external-identities.js.map +1 -0
- package/dist/feedback.d.ts +51 -0
- package/dist/github-repository-contracts.d.ts +36 -0
- package/dist/github-repository-contracts.js +59 -0
- package/dist/github-repository-contracts.js.map +1 -0
- package/dist/github-repository.d.ts +14 -0
- package/dist/github-repository.js +36 -0
- package/dist/github-repository.js.map +1 -0
- package/dist/google-drive.d.ts +90 -1
- package/dist/google-drive.js +91 -15
- package/dist/google-drive.js.map +1 -1
- package/dist/governed-learning-activation.d.ts +154 -0
- package/dist/governed-learning-evaluator.d.ts +152 -0
- package/dist/host-mcp-bindings.d.ts +326 -0
- package/dist/host-mcp-bindings.js +252 -0
- package/dist/host-mcp-bindings.js.map +1 -0
- package/dist/image-generation.d.ts +1 -0
- package/dist/index.d.ts +27574 -5374
- package/dist/index.js +2531 -177
- package/dist/insights-usage.d.ts +877 -0
- package/dist/insights-usage.js +509 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +1752 -13
- package/dist/knowledge-entries.d.ts +982 -0
- package/dist/knowledge-preparation.d.ts +237 -0
- package/dist/knowledge.d.ts +740 -0
- package/dist/managed-auth-session-sets.d.ts +241 -0
- package/dist/managed-auth-session-sets.js +191 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/managed-sign-in-methods.d.ts +56 -0
- package/dist/managed-sign-in-methods.js +46 -0
- package/dist/managed-sign-in-methods.js.map +1 -0
- package/dist/mcp-catalog-limits.d.ts +2 -0
- package/dist/mcp-endpoint.d.ts +7 -0
- package/dist/mcp-endpoint.js +9 -0
- package/dist/mcp-endpoint.js.map +1 -0
- package/dist/mcp-oauth.d.ts +71 -0
- package/dist/modal-native-proof-v2.d.ts +587 -0
- package/dist/modal-native-proof-v2.js +37 -0
- package/dist/modal-native-proof-v2.js.map +1 -0
- package/dist/model-availability.d.ts +15 -0
- package/dist/model-connection-access.d.ts +24 -0
- package/dist/model-context-inspector.d.ts +329 -0
- package/dist/model-display.d.ts +38 -0
- package/dist/model-display.js +134 -0
- package/dist/model-display.js.map +1 -0
- package/dist/model-picker-order.d.ts +25 -0
- package/dist/model-picker-order.js +42 -0
- package/dist/model-picker-order.js.map +1 -0
- package/dist/organization-access.d.ts +231 -0
- package/dist/organization-access.js +34 -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 +1022 -0
- package/dist/organization-model-usage.d.ts +146 -0
- package/dist/organization-model-usage.js +67 -0
- package/dist/organization-model-usage.js.map +1 -0
- package/dist/organization-recovery.d.ts +337 -0
- package/dist/organization-recovery.js +37 -0
- package/dist/organization-recovery.js.map +1 -0
- package/dist/organization-usage.d.ts +138 -0
- package/dist/permissions.d.ts +54 -0
- package/dist/personal-github.d.ts +320 -0
- package/dist/personal-github.js +222 -0
- package/dist/personal-github.js.map +1 -0
- package/dist/plugin-discovery.d.ts +35 -0
- package/dist/plugin-discovery.js +7 -0
- package/dist/plugin-discovery.js.map +1 -0
- package/dist/preference-registry.d.ts +44 -1
- package/dist/product-analytics.d.ts +113 -0
- package/dist/product-lifecycle-facts.d.ts +73 -0
- package/dist/remember.d.ts +350 -0
- package/dist/retained-output.d.ts +8 -0
- package/dist/sandbox-file-artifacts.d.ts +57 -0
- package/dist/sandbox-provider-command.d.ts +113 -0
- package/dist/sandbox-recovery.d.ts +146 -0
- package/dist/sandbox-snapshots.d.ts +39 -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 +947 -0
- package/dist/session-list-entries.d.ts +4 -0
- package/dist/session-list-entries.js +51 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-mcp-projections.d.ts +215 -0
- package/dist/session-message-search.d.ts +68 -0
- package/dist/session-titles.d.ts +68 -0
- package/dist/session-titles.js +25 -0
- package/dist/session-titles.js.map +1 -0
- package/dist/session-topology-primitives.d.ts +22 -0
- package/dist/signup-attribution.d.ts +39 -0
- package/dist/site-request-headers.test.d.ts +1 -0
- package/dist/site-session-http.d.ts +11 -0
- package/dist/site-session-http.js +11 -0
- package/dist/site-session-http.js.map +1 -0
- package/dist/skill-catalog-context.d.ts +7 -0
- package/dist/skill-files.d.ts +12 -0
- package/dist/skill-metadata.d.ts +9 -0
- package/dist/skill-use.d.ts +61 -0
- package/dist/skills.d.ts +185 -0
- package/dist/slack-bot-scopes.d.ts +46 -21
- package/dist/slack-bot-scopes.js +14 -3
- package/dist/slack-rest-mcp.d.ts +31 -0
- package/dist/slack-rest-mcp.js +19 -0
- package/dist/slack-rest-mcp.js.map +1 -0
- package/dist/slack-task-policy.d.ts +294 -0
- package/dist/spreadsheet-artifact-commands.d.ts +2 -3
- package/dist/spreadsheet-artifact-commands.js +4 -2
- package/dist/spreadsheet-artifact-query.js +3 -2
- package/dist/subscription-account-pools.d.ts +292 -0
- package/dist/task-notes.d.ts +169 -0
- package/dist/tool-catalog.d.ts +286 -0
- package/dist/tool-result-spill.d.ts +16 -0
- package/dist/usage-allowances.d.ts +285 -0
- package/dist/usage-allowances.js +49 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/video-generation.d.ts +51 -0
- package/dist/video-generation.js +9 -1
- package/dist/work-claims.d.ts +411 -0
- package/dist/workspace-instruction-policies.d.ts +94 -0
- 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 +948 -0
- package/dist/workspace-learning-administration.d.ts +289 -0
- package/dist/workspace-learning-policy.d.ts +1 -1
- package/dist/workspace-state.d.ts +85 -416
- package/dist/xai-provider-account-authority.d.ts +26 -0
- package/dist/xai-provider-account-authority.js +9 -0
- package/dist/xai-provider-account-authority.js.map +1 -0
- package/package.json +146 -1
- package/src/agent-authored-durable-text.ts +116 -0
- package/src/agent-config.ts +1527 -0
- package/src/agent-instruction-changes.ts +98 -0
- package/src/agent-learning.ts +161 -0
- package/src/agent-topology.ts +69 -0
- package/src/allowance-refusal.ts +81 -0
- package/src/analytics-consent-report.ts +20 -0
- package/src/api-key-presets.ts +25 -0
- package/src/artifact-catalog.ts +60 -0
- package/src/artifacts.ts +146 -18
- package/src/atlassian-native-retirement.ts +33 -0
- package/src/browser-storage.ts +10 -0
- package/src/bundled-skills.ts +73 -0
- package/src/canonical-human-identities.ts +93 -0
- package/src/claude-provider-account-authority.ts +12 -0
- package/src/claude-subscription-oauth.ts +62 -0
- package/src/claude-subscription-usage.ts +59 -0
- package/src/client-error-report.ts +184 -0
- package/src/code-search.ts +105 -0
- package/src/codex-provider-account-authority.ts +37 -0
- package/src/company-brain-governed-writes.ts +356 -0
- package/src/company-brain.ts +201 -0
- package/src/company-profile.ts +167 -1
- package/src/connect.ts +202 -0
- package/src/connection-account-label.ts +46 -0
- package/src/connection-authority.ts +213 -0
- package/src/connector-attachments.ts +327 -0
- package/src/connector-tool-permissions.ts +60 -0
- package/src/direct-model-provider.ts +98 -0
- package/src/editable-artifact-codec-registry.ts +55 -17
- package/src/editable-artifact-committed-transaction.ts +44 -31
- package/src/editable-artifact-live.ts +123 -57
- package/src/editable-artifact-serialized-commit.ts +2 -1
- package/src/editable-artifact-versions.ts +26 -5
- package/src/editable-artifacts.ts +2 -0
- package/src/external-identities.ts +285 -0
- package/src/feedback.ts +39 -0
- package/src/github-repository-contracts.ts +85 -0
- package/src/github-repository.ts +59 -0
- package/src/google-drive.ts +76 -4
- package/src/governed-learning-activation.ts +191 -0
- package/src/governed-learning-evaluator.ts +176 -0
- package/src/host-mcp-bindings.ts +298 -0
- package/src/image-generation.ts +8 -2
- package/src/index.ts +8019 -1799
- package/src/insights-usage.ts +679 -0
- package/src/interaction.ts +1102 -6
- package/src/knowledge-entries.ts +375 -0
- package/src/knowledge-preparation.ts +50 -0
- package/src/knowledge.ts +335 -0
- package/src/managed-auth-session-sets.ts +253 -0
- package/src/managed-sign-in-methods.ts +37 -0
- package/src/mcp-catalog-limits.ts +2 -0
- package/src/mcp-endpoint.ts +30 -0
- package/src/mcp-oauth.ts +66 -0
- package/src/modal-native-proof-v2.ts +398 -0
- package/src/model-availability.ts +22 -0
- package/src/model-connection-access.ts +17 -0
- package/src/model-context-inspector.ts +139 -0
- package/src/model-display.ts +195 -0
- package/src/model-picker-order.ts +97 -0
- package/src/organization-access.ts +176 -0
- package/src/organization-integration-policy.ts +54 -0
- package/src/organization-membership-lifecycle.ts +559 -0
- package/src/organization-model-usage.ts +72 -0
- package/src/organization-recovery.ts +186 -0
- package/src/organization-usage.ts +79 -0
- package/src/permissions.ts +58 -0
- package/src/personal-github.ts +267 -0
- package/src/plugin-discovery.ts +33 -0
- package/src/preference-registry.ts +20 -1
- package/src/product-analytics.ts +253 -0
- package/src/product-lifecycle-facts.ts +121 -0
- package/src/remember.ts +243 -0
- package/src/retained-output.ts +20 -3
- package/src/sandbox-file-artifacts.ts +73 -0
- package/src/sandbox-provider-command.ts +82 -0
- package/src/sandbox-recovery.ts +116 -0
- package/src/sandbox-snapshots.ts +142 -0
- package/src/session-final-reply.ts +16 -0
- package/src/session-goal-reports.ts +55 -0
- package/src/session-history-import.ts +159 -0
- package/src/session-list-entries.ts +91 -0
- package/src/session-mcp-projections.ts +273 -0
- package/src/session-message-search.ts +54 -0
- package/src/session-titles.ts +467 -0
- package/src/session-topology-primitives.ts +21 -0
- package/src/signup-attribution.ts +81 -0
- package/src/site-request-headers.test.ts +28 -0
- package/src/site-session-http.ts +63 -0
- package/src/skill-catalog-context.ts +50 -0
- package/src/skill-files.ts +52 -0
- package/src/skill-metadata.ts +40 -0
- package/src/skill-use.ts +77 -0
- package/src/skills.ts +136 -0
- package/src/slack-bot-scopes.ts +106 -42
- package/src/slack-rest-mcp.ts +194 -0
- package/src/slack-task-policy.ts +215 -0
- package/src/spreadsheet-artifact-commands.ts +12 -13
- package/src/subscription-account-pools.ts +44 -0
- package/src/task-notes.ts +105 -0
- package/src/tool-catalog.ts +155 -0
- package/src/tool-result-spill.ts +35 -0
- package/src/usage-allowances.ts +187 -0
- package/src/video-generation.ts +43 -6
- package/src/work-claims.ts +266 -0
- package/src/workspace-instruction-policies.ts +31 -0
- package/src/workspace-integration-wire.ts +99 -0
- package/src/workspace-integrations.ts +640 -0
- package/src/workspace-learning-administration.ts +88 -0
- package/src/workspace-learning-policy.ts +4 -3
- package/src/workspace-state.ts +16 -126
- package/src/xai-provider-account-authority.ts +38 -0
- package/dist/chunk-52SGB2QO.js.map +0 -1
- package/dist/chunk-5UDNP7AO.js.map +0 -1
- package/dist/chunk-BVGIYW7D.js +0 -11
- package/dist/chunk-BVGIYW7D.js.map +0 -1
- package/dist/chunk-FJBG5E4O.js.map +0 -1
- package/dist/chunk-H5BVCZKF.js.map +0 -1
- package/dist/chunk-LSB7GRLG.js.map +0 -1
- package/dist/chunk-TZ6YEYN4.js.map +0 -1
- package/dist/chunk-VA22KRHS.js +0 -15177
- package/dist/chunk-VA22KRHS.js.map +0 -1
- package/dist/chunk-Y3MLSLB4.js.map +0 -1
- /package/dist/{chunk-CADSX6UN.js.map → chunk-Y3KNXVTD.js.map} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS } from "./agent-authored-durable-text";
|
|
3
|
+
import { KnowledgeEntryEvidence } from "./knowledge-entries";
|
|
4
|
+
import { WorkspaceInstructionPolicyTarget } from "./workspace-instruction-policies";
|
|
5
|
+
|
|
6
|
+
export const AgentInstructionEditMode = z.enum(["append", "edit"]);
|
|
7
|
+
export type AgentInstructionEditMode = z.infer<typeof AgentInstructionEditMode>;
|
|
8
|
+
|
|
9
|
+
export const AgentInstructionSaveRequest = z
|
|
10
|
+
.object({
|
|
11
|
+
operationId: z.uuid(),
|
|
12
|
+
target: WorkspaceInstructionPolicyTarget,
|
|
13
|
+
editMode: AgentInstructionEditMode,
|
|
14
|
+
content: z.string().max(AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS).optional(),
|
|
15
|
+
oldText: z.string().min(1).max(AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS).optional(),
|
|
16
|
+
newText: z.string().max(AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS).optional(),
|
|
17
|
+
expectedCurrentRevisionId: z.uuid().nullable(),
|
|
18
|
+
expectedActivationVersion: z.number().int().nonnegative(),
|
|
19
|
+
evidence: z.array(KnowledgeEntryEvidence).max(32).default([]),
|
|
20
|
+
reason: z.string().min(1).max(4096),
|
|
21
|
+
})
|
|
22
|
+
.superRefine((value, context) => {
|
|
23
|
+
if (value.editMode === "edit") {
|
|
24
|
+
if (value.oldText === undefined) {
|
|
25
|
+
context.addIssue({
|
|
26
|
+
code: "custom",
|
|
27
|
+
path: ["oldText"],
|
|
28
|
+
message: "An exact edit requires oldText",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (value.newText === undefined) {
|
|
32
|
+
context.addIssue({
|
|
33
|
+
code: "custom",
|
|
34
|
+
path: ["newText"],
|
|
35
|
+
message: "An exact edit requires newText (use an empty string to remove the text)",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (value.content !== undefined) {
|
|
39
|
+
context.addIssue({
|
|
40
|
+
code: "custom",
|
|
41
|
+
path: ["content"],
|
|
42
|
+
message: "An exact edit uses oldText and newText, not content",
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (value.content === undefined || value.content.trim().length === 0) {
|
|
48
|
+
context.addIssue({
|
|
49
|
+
code: "custom",
|
|
50
|
+
path: ["content"],
|
|
51
|
+
message: "Append 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 changes use content, not oldText or newText",
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
export type AgentInstructionSaveRequest = z.input<typeof AgentInstructionSaveRequest>;
|
|
64
|
+
|
|
65
|
+
export const AgentInstructionReviewRequest = z
|
|
66
|
+
.object({
|
|
67
|
+
operationId: z.uuid(),
|
|
68
|
+
revisionId: z.uuid(),
|
|
69
|
+
decision: z.enum(["approve", "reject"]),
|
|
70
|
+
reason: z.string().min(1).max(4096),
|
|
71
|
+
})
|
|
72
|
+
.strict();
|
|
73
|
+
export type AgentInstructionReviewRequest = z.infer<typeof AgentInstructionReviewRequest>;
|
|
74
|
+
|
|
75
|
+
export const AgentInstructionReceipt = z.object({
|
|
76
|
+
operationId: z.uuid(),
|
|
77
|
+
revisionId: z.uuid(),
|
|
78
|
+
outcome: z.enum(["published", "pending", "rejected"]),
|
|
79
|
+
reviewBatchId: z.uuid().nullable(),
|
|
80
|
+
replayed: z.boolean(),
|
|
81
|
+
});
|
|
82
|
+
export type AgentInstructionReceipt = z.infer<typeof AgentInstructionReceipt>;
|
|
83
|
+
|
|
84
|
+
export const AgentInstructionReviewItem = z.object({
|
|
85
|
+
revisionId: z.uuid(),
|
|
86
|
+
content: z.string(),
|
|
87
|
+
target: WorkspaceInstructionPolicyTarget,
|
|
88
|
+
reviewBatchId: z.uuid().nullable(),
|
|
89
|
+
sessionId: z.uuid().nullable(),
|
|
90
|
+
reason: z.string(),
|
|
91
|
+
createdAt: z.string(),
|
|
92
|
+
});
|
|
93
|
+
export type AgentInstructionReviewItem = z.infer<typeof AgentInstructionReviewItem>;
|
|
94
|
+
export const AgentInstructionReviewListResponse = z.object({
|
|
95
|
+
entries: z.array(AgentInstructionReviewItem),
|
|
96
|
+
nextCursor: z.string().nullable(),
|
|
97
|
+
});
|
|
98
|
+
export type AgentInstructionReviewListResponse = z.infer<typeof AgentInstructionReviewListResponse>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/** Review controls publication. It never grants content or external-action authority. */
|
|
4
|
+
export const AgentLearningMode = z.enum(["automatic", "review_first", "off"]);
|
|
5
|
+
export type AgentLearningMode = z.infer<typeof AgentLearningMode>;
|
|
6
|
+
|
|
7
|
+
export const AgentLearningCategory = z.enum(["knowledge", "instructions", "skills"]);
|
|
8
|
+
export type AgentLearningCategory = z.infer<typeof AgentLearningCategory>;
|
|
9
|
+
|
|
10
|
+
export const AgentLearningDefaults = z
|
|
11
|
+
.object({
|
|
12
|
+
knowledge: AgentLearningMode,
|
|
13
|
+
instructions: AgentLearningMode,
|
|
14
|
+
skills: AgentLearningMode,
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
export type AgentLearningDefaults = z.infer<typeof AgentLearningDefaults>;
|
|
18
|
+
|
|
19
|
+
export const DEFAULT_AGENT_LEARNING: Readonly<AgentLearningDefaults> = Object.freeze({
|
|
20
|
+
knowledge: "automatic",
|
|
21
|
+
instructions: "automatic",
|
|
22
|
+
skills: "automatic",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** An absent category inherits. `inherit` is a reset request, not persisted policy. */
|
|
26
|
+
export const AgentLearningOverrides = AgentLearningDefaults.partial();
|
|
27
|
+
export type AgentLearningOverrides = z.infer<typeof AgentLearningOverrides>;
|
|
28
|
+
|
|
29
|
+
export const AgentLearningOverridePatch = z
|
|
30
|
+
.object({
|
|
31
|
+
knowledge: AgentLearningMode.or(z.literal("inherit")).optional(),
|
|
32
|
+
instructions: AgentLearningMode.or(z.literal("inherit")).optional(),
|
|
33
|
+
skills: AgentLearningMode.or(z.literal("inherit")).optional(),
|
|
34
|
+
})
|
|
35
|
+
.strict();
|
|
36
|
+
export type AgentLearningOverridePatch = z.infer<typeof AgentLearningOverridePatch>;
|
|
37
|
+
|
|
38
|
+
export const AgentLearningContext = z.discriminatedUnion("kind", [
|
|
39
|
+
z.object({ kind: z.literal("chat"), id: z.uuid() }).strict(),
|
|
40
|
+
z.object({ kind: z.literal("scheduled_task"), id: z.uuid() }).strict(),
|
|
41
|
+
]);
|
|
42
|
+
export type AgentLearningContext = z.infer<typeof AgentLearningContext>;
|
|
43
|
+
|
|
44
|
+
export const AgentLearningOwner = z.discriminatedUnion("kind", [
|
|
45
|
+
z.object({ kind: z.literal("workspace"), workspaceId: z.uuid() }).strict(),
|
|
46
|
+
z.object({ kind: z.literal("personal"), subjectId: z.string().min(1).max(1024) }).strict(),
|
|
47
|
+
]);
|
|
48
|
+
export type AgentLearningOwner = z.infer<typeof AgentLearningOwner>;
|
|
49
|
+
|
|
50
|
+
export const AgentLearningSettings = z
|
|
51
|
+
.object({
|
|
52
|
+
owner: AgentLearningOwner,
|
|
53
|
+
version: z.number().int().nonnegative(),
|
|
54
|
+
defaults: AgentLearningDefaults,
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
export type AgentLearningSettings = z.infer<typeof AgentLearningSettings>;
|
|
58
|
+
|
|
59
|
+
export const AgentLearningContextSettings = z
|
|
60
|
+
.object({
|
|
61
|
+
context: AgentLearningContext,
|
|
62
|
+
version: z.number().int().nonnegative(),
|
|
63
|
+
overrides: AgentLearningOverrides,
|
|
64
|
+
})
|
|
65
|
+
.strict();
|
|
66
|
+
export type AgentLearningContextSettings = z.infer<typeof AgentLearningContextSettings>;
|
|
67
|
+
|
|
68
|
+
/** Versioned settings returned by both central and contextual editors. */
|
|
69
|
+
export const AgentLearningSettingsRecord = z.object({
|
|
70
|
+
ownerKey: z.string(),
|
|
71
|
+
contextKey: z.string(),
|
|
72
|
+
version: z.number().int().nonnegative(),
|
|
73
|
+
settings: AgentLearningOverrides,
|
|
74
|
+
});
|
|
75
|
+
export type AgentLearningSettingsRecord = z.infer<typeof AgentLearningSettingsRecord>;
|
|
76
|
+
export const AgentLearningOverrideRecord = z.object({
|
|
77
|
+
contextKey: z.string(),
|
|
78
|
+
version: z.number().int().positive(),
|
|
79
|
+
settings: AgentLearningOverrides,
|
|
80
|
+
updatedAt: z.string(),
|
|
81
|
+
label: z.string(),
|
|
82
|
+
});
|
|
83
|
+
export type AgentLearningOverrideRecord = z.infer<typeof AgentLearningOverrideRecord>;
|
|
84
|
+
export type SaveAgentLearningSettingsRequest = {
|
|
85
|
+
scope: "workspace" | "personal";
|
|
86
|
+
source?: AgentLearningContext;
|
|
87
|
+
operationId: string;
|
|
88
|
+
expectedVersion: number;
|
|
89
|
+
settings: AgentLearningOverridePatch;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const AgentLearningEffectiveCategory = z
|
|
93
|
+
.object({
|
|
94
|
+
mode: AgentLearningMode,
|
|
95
|
+
inherited: z.boolean(),
|
|
96
|
+
})
|
|
97
|
+
.strict();
|
|
98
|
+
export const AgentLearningEffectivePolicy = z
|
|
99
|
+
.object({
|
|
100
|
+
knowledge: AgentLearningEffectiveCategory,
|
|
101
|
+
instructions: AgentLearningEffectiveCategory,
|
|
102
|
+
skills: AgentLearningEffectiveCategory,
|
|
103
|
+
})
|
|
104
|
+
.strict();
|
|
105
|
+
export type AgentLearningEffectivePolicy = z.infer<typeof AgentLearningEffectivePolicy>;
|
|
106
|
+
|
|
107
|
+
/** Apply only at an authorized settings boundary; this function confers no authority. */
|
|
108
|
+
export function patchAgentLearningOverrides(
|
|
109
|
+
current: AgentLearningOverrides,
|
|
110
|
+
patch: AgentLearningOverridePatch,
|
|
111
|
+
): AgentLearningOverrides {
|
|
112
|
+
const result = AgentLearningOverrides.parse(current);
|
|
113
|
+
const changes = AgentLearningOverridePatch.parse(patch);
|
|
114
|
+
for (const category of AgentLearningCategory.options) {
|
|
115
|
+
const value = changes[category];
|
|
116
|
+
if (value === "inherit") delete result[category];
|
|
117
|
+
else if (value !== undefined) result[category] = value;
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Pure resolution over accepted settings. Runtime callers persist the resulting snapshot. */
|
|
123
|
+
export function resolveAgentLearningPolicy(
|
|
124
|
+
defaults: AgentLearningDefaults,
|
|
125
|
+
overrides: AgentLearningOverrides,
|
|
126
|
+
): AgentLearningEffectivePolicy {
|
|
127
|
+
const base = AgentLearningDefaults.parse(defaults);
|
|
128
|
+
const context = AgentLearningOverrides.parse(overrides);
|
|
129
|
+
return Object.fromEntries(
|
|
130
|
+
AgentLearningCategory.options.map((category) => [
|
|
131
|
+
category,
|
|
132
|
+
{ mode: context[category] ?? base[category], inherited: context[category] === undefined },
|
|
133
|
+
]),
|
|
134
|
+
) as AgentLearningEffectivePolicy;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Migration adapter preserves explicit opt-outs and existing instruction/Skill choices. */
|
|
138
|
+
export function agentLearningDefaultsFromLegacy(input: {
|
|
139
|
+
memoryEnabled?: boolean;
|
|
140
|
+
workspaceMode?: "off" | "suggest" | "automatic";
|
|
141
|
+
}): AgentLearningDefaults {
|
|
142
|
+
const parsed = z
|
|
143
|
+
.object({
|
|
144
|
+
memoryEnabled: z.boolean().optional(),
|
|
145
|
+
workspaceMode: z.enum(["off", "suggest", "automatic"]).optional(),
|
|
146
|
+
})
|
|
147
|
+
.strict()
|
|
148
|
+
.parse(input);
|
|
149
|
+
const behavior = parsed.workspaceMode ?? "suggest";
|
|
150
|
+
return {
|
|
151
|
+
knowledge: parsed.memoryEnabled === false ? "off" : "automatic",
|
|
152
|
+
instructions: behavior === "suggest" ? "review_first" : behavior,
|
|
153
|
+
skills: behavior === "suggest" ? "review_first" : behavior,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Existing instruction and Skill lifecycles retain their native mode vocabulary. */
|
|
158
|
+
export function agentLearningDestinationMode(mode: AgentLearningMode) {
|
|
159
|
+
const parsed = AgentLearningMode.parse(mode);
|
|
160
|
+
return parsed === "review_first" ? ("suggest" as const) : parsed;
|
|
161
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
NestedAgentDepthValue,
|
|
5
|
+
SessionGoalStatus,
|
|
6
|
+
SessionStatus,
|
|
7
|
+
} from "./session-topology-primitives";
|
|
8
|
+
import { WorkDiscoveryProjection } from "./work-claims";
|
|
9
|
+
|
|
10
|
+
/** Compact, bounded session projection for workspace agent-topology browsers. */
|
|
11
|
+
export const AgentTopologySession = z.object({
|
|
12
|
+
id: z.string().uuid(),
|
|
13
|
+
title: z.string().nullable(),
|
|
14
|
+
titleTruncated: z.boolean(),
|
|
15
|
+
parentSessionId: z.string().uuid().nullable(),
|
|
16
|
+
rootSessionId: z.string().uuid(),
|
|
17
|
+
nestedAgentDepth: NestedAgentDepthValue,
|
|
18
|
+
ancestorPath: z.array(
|
|
19
|
+
z.object({
|
|
20
|
+
id: z.string().uuid(),
|
|
21
|
+
title: z.string().nullable(),
|
|
22
|
+
titleTruncated: z.boolean(),
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
status: SessionStatus,
|
|
26
|
+
goal: z
|
|
27
|
+
.object({
|
|
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
|
|
37
|
+
.object({
|
|
38
|
+
kind: z.enum(["session", "workspace"]),
|
|
39
|
+
sessionId: z.string().uuid().optional(),
|
|
40
|
+
displayName: z.string(),
|
|
41
|
+
displayNameTruncated: z.boolean(),
|
|
42
|
+
})
|
|
43
|
+
.nullable(),
|
|
44
|
+
}),
|
|
45
|
+
children: z.object({
|
|
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
|
+
});
|
|
59
|
+
export type AgentTopologySession = z.infer<typeof AgentTopologySession>;
|
|
60
|
+
|
|
61
|
+
export const AgentTopologyPageResponse = z.object({
|
|
62
|
+
sessions: z.array(AgentTopologySession),
|
|
63
|
+
total: z.number().int().nonnegative(),
|
|
64
|
+
hasMore: z.boolean(),
|
|
65
|
+
/** Operator rollout decision for human advisory presentation. */
|
|
66
|
+
humanAdvisoriesEnabled: z.boolean().optional(),
|
|
67
|
+
nextCursor: z.string().nullable(),
|
|
68
|
+
});
|
|
69
|
+
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,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Permission } from "./permissions";
|
|
3
|
+
|
|
4
|
+
/** Optional creation alias for the developer_setup organization access tier. */
|
|
5
|
+
export const OrganizationApiKeyPreset = z.enum(["developer_setup"]);
|
|
6
|
+
export type OrganizationApiKeyPreset = z.infer<typeof OrganizationApiKeyPreset>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The current setup-route floor: workspace provisioning, configuration/cleanup,
|
|
10
|
+
* and explicit literal budget authority. workspace:admin also covers discovery and session/tool/
|
|
11
|
+
* schedule guards. It is broad authority, not setup-only, and never confers
|
|
12
|
+
* literal secrets:read. No account:admin, billing, or redundant read scopes.
|
|
13
|
+
*/
|
|
14
|
+
export const DEVELOPER_SETUP_API_KEY_PRESET = {
|
|
15
|
+
id: "developer_setup",
|
|
16
|
+
label: "Developer setup",
|
|
17
|
+
description:
|
|
18
|
+
"Set up shared workspaces, tools and budgets. Includes broad workspace administration and expires after 24 hours. Can't manage API keys.",
|
|
19
|
+
permissions: [
|
|
20
|
+
"workspace:create",
|
|
21
|
+
"workspace:admin",
|
|
22
|
+
"usage_allowances:manage",
|
|
23
|
+
] satisfies Permission[],
|
|
24
|
+
defaultExpiryHours: 24,
|
|
25
|
+
} as const;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RetainedArtifactReferenceSchema } from "./retained-output";
|
|
3
|
+
|
|
4
|
+
export const ArtifactCatalogKind = z.enum([
|
|
5
|
+
"site",
|
|
6
|
+
"document",
|
|
7
|
+
"spreadsheet",
|
|
8
|
+
"presentation",
|
|
9
|
+
"image",
|
|
10
|
+
"file",
|
|
11
|
+
]);
|
|
12
|
+
export type ArtifactCatalogKind = z.infer<typeof ArtifactCatalogKind>;
|
|
13
|
+
|
|
14
|
+
/** Metadata only: native domain IDs, never content, storage keys or credentials. */
|
|
15
|
+
export const ArtifactCatalogItem = z
|
|
16
|
+
.object({
|
|
17
|
+
id: z.string().min(1).max(128),
|
|
18
|
+
kind: ArtifactCatalogKind,
|
|
19
|
+
title: z.string().min(1).max(1024),
|
|
20
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
21
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
22
|
+
status: z.enum(["active", "archived"]),
|
|
23
|
+
sourceSessionId: z.string().uuid().optional(),
|
|
24
|
+
versionId: z.string().min(1).max(128).optional(),
|
|
25
|
+
file: RetainedArtifactReferenceSchema.optional(),
|
|
26
|
+
filename: z.string().max(1024).optional(),
|
|
27
|
+
contentType: z.string().max(127).optional(),
|
|
28
|
+
sizeBytes: z.number().int().nonnegative().safe().optional(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
export type ArtifactCatalogItem = z.infer<typeof ArtifactCatalogItem>;
|
|
32
|
+
|
|
33
|
+
export const ArtifactCatalogListQuery = z
|
|
34
|
+
.object({
|
|
35
|
+
sourceSessionId: z.string().uuid().optional(),
|
|
36
|
+
q: z
|
|
37
|
+
.string()
|
|
38
|
+
.trim()
|
|
39
|
+
.max(200)
|
|
40
|
+
.refine((value) => !value.includes("\0"))
|
|
41
|
+
.optional(),
|
|
42
|
+
kind: ArtifactCatalogKind.optional(),
|
|
43
|
+
sort: z.enum(["updated", "newest", "title"]).default("updated"),
|
|
44
|
+
status: z.enum(["active", "archived"]).default("active"),
|
|
45
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
46
|
+
cursor: z.string().min(1).max(8192).optional(),
|
|
47
|
+
})
|
|
48
|
+
.strict();
|
|
49
|
+
export type ArtifactCatalogListQuery = z.infer<typeof ArtifactCatalogListQuery>;
|
|
50
|
+
export type ArtifactCatalogListOptions = Omit<z.input<typeof ArtifactCatalogListQuery>, "limit"> & {
|
|
51
|
+
limit?: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const ArtifactCatalogListResponse = z
|
|
55
|
+
.object({
|
|
56
|
+
items: z.array(ArtifactCatalogItem).max(100),
|
|
57
|
+
nextCursor: z.string().max(8192).nullable(),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
export type ArtifactCatalogListResponse = z.infer<typeof ArtifactCatalogListResponse>;
|