@opengeni/contracts 1.0.1 → 2.2.0-canary.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 +64 -0
- package/dist/atlassian.d.ts +1 -0
- package/dist/atlassian.js +14 -13
- package/dist/{chunk-Y3MLSLB4.js → chunk-3SIZGL3O.js} +42 -30
- package/dist/chunk-3SIZGL3O.js.map +1 -0
- package/dist/{chunk-JBCIY7QD.js → chunk-7RMTKFJW.js} +45 -22
- package/dist/chunk-7RMTKFJW.js.map +1 -0
- package/dist/{chunk-NX5JNF4L.js → chunk-7ZZ3R27P.js} +9322 -5798
- package/dist/chunk-7ZZ3R27P.js.map +1 -0
- package/dist/{chunk-5UDNP7AO.js → chunk-MRWYRAS5.js} +56 -8
- package/dist/chunk-MRWYRAS5.js.map +1 -0
- package/dist/{chunk-LW7OH6CS.js → chunk-N6GRVXAJ.js} +6 -5
- package/dist/chunk-N6GRVXAJ.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-PX3VCKAU.js +29 -0
- package/dist/chunk-PX3VCKAU.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-CADSX6UN.js → chunk-Y3KNXVTD.js} +2 -2
- package/dist/chunk-YBW5JSA3.js +251 -0
- package/dist/chunk-YBW5JSA3.js.map +1 -0
- package/dist/company-brain-governed-writes.d.ts +475 -0
- package/dist/company-brain.d.ts +398 -0
- package/dist/company-profile.d.ts +268 -0
- package/dist/connection-authority.d.ts +501 -0
- package/dist/connection-authority.js +364 -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/editable-artifact-codec-registry.d.ts +16 -7
- package/dist/editable-artifact-codec-registry.js +18 -8
- 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 +111 -46
- 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 +9 -8
- 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 +51 -39
- package/dist/google-drive.d.ts +1 -0
- package/dist/google-drive.js +14 -13
- 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/index.d.ts +12224 -1328
- package/dist/index.js +831 -115
- package/dist/interaction.d.ts +68 -0
- package/dist/knowledge.d.ts +119 -0
- package/dist/organization-membership-lifecycle.d.ts +516 -0
- package/dist/permissions.d.ts +52 -0
- package/dist/personal-github.d.ts +319 -0
- package/dist/personal-github.js +209 -0
- package/dist/personal-github.js.map +1 -0
- package/dist/preference-registry.d.ts +17 -0
- package/dist/remember.d.ts +331 -0
- package/dist/sandbox-file-artifacts.d.ts +56 -0
- package/dist/sandbox-snapshots.d.ts +21 -0
- package/dist/slack-bot-scopes.d.ts +34 -14
- package/dist/slack-bot-scopes.js +5 -1
- 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/task-notes.d.ts +42 -1
- package/dist/tool-result-spill.d.ts +16 -0
- package/dist/workspace-instruction-policies.d.ts +81 -0
- package/dist/workspace-learning-administration.d.ts +289 -0
- package/package.json +13 -1
- package/src/agent-authored-durable-text.ts +105 -0
- package/src/company-brain-governed-writes.ts +356 -0
- package/src/company-brain.ts +201 -0
- package/src/company-profile.ts +122 -1
- package/src/connection-authority.ts +413 -0
- package/src/connector-attachments.ts +327 -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/governed-learning-activation.ts +191 -0
- package/src/governed-learning-evaluator.ts +176 -0
- package/src/index.ts +3033 -392
- package/src/interaction.ts +55 -1
- package/src/knowledge.ts +118 -6
- package/src/organization-membership-lifecycle.ts +330 -0
- package/src/permissions.ts +55 -0
- package/src/personal-github.ts +267 -0
- package/src/preference-registry.ts +17 -0
- package/src/remember.ts +242 -0
- package/src/sandbox-file-artifacts.ts +65 -0
- package/src/sandbox-snapshots.ts +78 -0
- package/src/slack-bot-scopes.ts +81 -9
- package/src/spreadsheet-artifact-commands.ts +12 -13
- package/src/task-notes.ts +14 -1
- package/src/tool-result-spill.ts +35 -0
- package/src/workspace-instruction-policies.ts +30 -0
- package/src/workspace-learning-administration.ts +88 -0
- 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-JBCIY7QD.js.map +0 -1
- package/dist/chunk-LSB7GRLG.js.map +0 -1
- package/dist/chunk-LW7OH6CS.js.map +0 -1
- package/dist/chunk-NX5JNF4L.js.map +0 -1
- package/dist/chunk-TZ6YEYN4.js.map +0 -1
- package/dist/chunk-Y3MLSLB4.js.map +0 -1
- /package/dist/{chunk-CADSX6UN.js.map → chunk-Y3KNXVTD.js.map} +0 -0
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
EDITABLE_ARTIFACT_INTENT_MAX_BYTES,
|
|
4
4
|
EDITABLE_ARTIFACT_INTENT_MAX_CAUSAL_ACTORS,
|
|
5
5
|
EDITABLE_ARTIFACT_INTENT_MAX_UNDO_TARGETS,
|
|
6
|
+
EDITABLE_ARTIFACT_INTENT_PROTOCOL_VERSION,
|
|
6
7
|
EDITABLE_ARTIFACT_INTENT_VERSION,
|
|
7
8
|
EDITABLE_ARTIFACT_KERNEL_VERSION_MAX_BYTES,
|
|
8
9
|
EDITABLE_ARTIFACT_PRODUCT_MAX_SNAPSHOT_BYTES,
|
|
@@ -11,19 +12,35 @@ import {
|
|
|
11
12
|
encodeEditableArtifactMutationIntent,
|
|
12
13
|
hashEditableArtifactMutationIntent,
|
|
13
14
|
hashEditableArtifactMutationIntentBytes
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_MAX_BYTES,
|
|
17
|
-
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_MAX_REPLICAS,
|
|
18
|
-
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_VERSION,
|
|
19
|
-
assertCanonicalEditableArtifactCausalFrontierBytes,
|
|
20
|
-
decodeEditableArtifactCausalFrontier,
|
|
21
|
-
encodeEditableArtifactCausalFrontier
|
|
22
|
-
} from "./chunk-YRKRZ6OF.js";
|
|
15
|
+
} from "./chunk-NVJMJWLL.js";
|
|
23
16
|
import {
|
|
24
17
|
EDITABLE_ARTIFACT_CODEC_REGISTRY,
|
|
18
|
+
currentEditableArtifactCompatibility,
|
|
25
19
|
editableArtifactCodecFor
|
|
26
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-7RMTKFJW.js";
|
|
21
|
+
import {
|
|
22
|
+
SPREADSHEET_ARTIFACT_METADATA_MAX_SHEETS,
|
|
23
|
+
SPREADSHEET_ARTIFACT_METADATA_MIN_RESPONSE_BYTES,
|
|
24
|
+
SPREADSHEET_ARTIFACT_PROJECTION_MAX_BYTES,
|
|
25
|
+
SPREADSHEET_ARTIFACT_PROJECTION_MAX_STRING_BYTES,
|
|
26
|
+
SPREADSHEET_ARTIFACT_QUERY_MAX_BYTES,
|
|
27
|
+
SPREADSHEET_ARTIFACT_QUERY_VERSION,
|
|
28
|
+
SPREADSHEET_ARTIFACT_VIEWPORT_MAX_AREA,
|
|
29
|
+
SPREADSHEET_ARTIFACT_VIEWPORT_MAX_CELLS,
|
|
30
|
+
SPREADSHEET_ARTIFACT_VIEWPORT_MIN_RESPONSE_BYTES,
|
|
31
|
+
assertCanonicalSpreadsheetArtifactKernelProjectionBytes,
|
|
32
|
+
assertCanonicalSpreadsheetArtifactKernelQueryBytes,
|
|
33
|
+
decodeSpreadsheetArtifactKernelProjection,
|
|
34
|
+
decodeSpreadsheetArtifactKernelQuery,
|
|
35
|
+
decodeSpreadsheetMetadataKernelProjection,
|
|
36
|
+
decodeSpreadsheetViewportKernelProjection,
|
|
37
|
+
encodeSpreadsheetArtifactKernelProjection,
|
|
38
|
+
encodeSpreadsheetArtifactKernelQuery,
|
|
39
|
+
encodeSpreadsheetMetadataKernelProjection,
|
|
40
|
+
encodeSpreadsheetMetadataKernelQuery,
|
|
41
|
+
encodeSpreadsheetViewportKernelProjection,
|
|
42
|
+
encodeSpreadsheetViewportKernelQuery
|
|
43
|
+
} from "./chunk-Y3KNXVTD.js";
|
|
27
44
|
import {
|
|
28
45
|
DOCUMENT_ARTIFACT_COMMAND_MAX_BYTES,
|
|
29
46
|
DOCUMENT_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
@@ -51,28 +68,13 @@ import {
|
|
|
51
68
|
encodeDocumentArtifactQueryResponse
|
|
52
69
|
} from "./chunk-RIY7GYQS.js";
|
|
53
70
|
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
SPREADSHEET_ARTIFACT_VIEWPORT_MAX_CELLS,
|
|
62
|
-
SPREADSHEET_ARTIFACT_VIEWPORT_MIN_RESPONSE_BYTES,
|
|
63
|
-
assertCanonicalSpreadsheetArtifactKernelProjectionBytes,
|
|
64
|
-
assertCanonicalSpreadsheetArtifactKernelQueryBytes,
|
|
65
|
-
decodeSpreadsheetArtifactKernelProjection,
|
|
66
|
-
decodeSpreadsheetArtifactKernelQuery,
|
|
67
|
-
decodeSpreadsheetMetadataKernelProjection,
|
|
68
|
-
decodeSpreadsheetViewportKernelProjection,
|
|
69
|
-
encodeSpreadsheetArtifactKernelProjection,
|
|
70
|
-
encodeSpreadsheetArtifactKernelQuery,
|
|
71
|
-
encodeSpreadsheetMetadataKernelProjection,
|
|
72
|
-
encodeSpreadsheetMetadataKernelQuery,
|
|
73
|
-
encodeSpreadsheetViewportKernelProjection,
|
|
74
|
-
encodeSpreadsheetViewportKernelQuery
|
|
75
|
-
} from "./chunk-CADSX6UN.js";
|
|
71
|
+
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_MAX_BYTES,
|
|
72
|
+
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_MAX_REPLICAS,
|
|
73
|
+
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_VERSION,
|
|
74
|
+
assertCanonicalEditableArtifactCausalFrontierBytes,
|
|
75
|
+
decodeEditableArtifactCausalFrontier,
|
|
76
|
+
encodeEditableArtifactCausalFrontier
|
|
77
|
+
} from "./chunk-YRKRZ6OF.js";
|
|
76
78
|
import {
|
|
77
79
|
PRESENTATION_ARTIFACT_COMMAND_MAX_BYTES,
|
|
78
80
|
PRESENTATION_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
@@ -111,18 +113,22 @@ import {
|
|
|
111
113
|
SPREADSHEET_ARTIFACT_COMMAND_MAX_CELLS,
|
|
112
114
|
SPREADSHEET_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
113
115
|
SPREADSHEET_ARTIFACT_COMMAND_MAX_STRING_BYTES,
|
|
114
|
-
SPREADSHEET_ARTIFACT_COMMAND_VERSION,
|
|
115
116
|
SPREADSHEET_ARTIFACT_SHEET_NAME_MAX_UTF16_UNITS,
|
|
116
117
|
assertCanonicalSpreadsheetArtifactCommandBytes,
|
|
117
118
|
decodeSpreadsheetArtifactCommandBatch,
|
|
118
119
|
editableArtifactStableId,
|
|
119
120
|
encodeSpreadsheetArtifactCommandBatch,
|
|
120
121
|
spreadsheetSheetId
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-TXTQIYCV.js";
|
|
122
123
|
import {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
DOCUMENT_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
125
|
+
DOCUMENT_ARTIFACT_SNAPSHOT_VERSION,
|
|
126
|
+
PRESENTATION_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
127
|
+
PRESENTATION_ARTIFACT_SNAPSHOT_VERSION,
|
|
128
|
+
SPREADSHEET_ARTIFACT_COMMAND_VERSION,
|
|
129
|
+
SPREADSHEET_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
130
|
+
SPREADSHEET_COLLABORATION_SNAPSHOT_VERSION
|
|
131
|
+
} from "./chunk-PX3VCKAU.js";
|
|
126
132
|
export {
|
|
127
133
|
DOCUMENT_ARTIFACT_COMMAND_MAX_BYTES,
|
|
128
134
|
DOCUMENT_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
@@ -132,6 +138,7 @@ export {
|
|
|
132
138
|
DOCUMENT_ARTIFACT_MAX_TABLE_CELLS,
|
|
133
139
|
DOCUMENT_ARTIFACT_MAX_TEXT_RUNS,
|
|
134
140
|
DOCUMENT_ARTIFACT_MAX_TEXT_UTF16,
|
|
141
|
+
DOCUMENT_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
135
142
|
DOCUMENT_ARTIFACT_QUERY_MAX_BYTES,
|
|
136
143
|
DOCUMENT_ARTIFACT_QUERY_MAX_ITEMS,
|
|
137
144
|
DOCUMENT_ARTIFACT_QUERY_MAX_TABLE_CELLS,
|
|
@@ -139,6 +146,7 @@ export {
|
|
|
139
146
|
DOCUMENT_ARTIFACT_QUERY_RESPONSE_MAX_BYTES,
|
|
140
147
|
DOCUMENT_ARTIFACT_QUERY_RESPONSE_VERSION,
|
|
141
148
|
DOCUMENT_ARTIFACT_QUERY_VERSION,
|
|
149
|
+
DOCUMENT_ARTIFACT_SNAPSHOT_VERSION,
|
|
142
150
|
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_MAX_BYTES,
|
|
143
151
|
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_MAX_REPLICAS,
|
|
144
152
|
EDITABLE_ARTIFACT_CAUSAL_FRONTIER_VERSION,
|
|
@@ -147,11 +155,10 @@ export {
|
|
|
147
155
|
EDITABLE_ARTIFACT_INTENT_MAX_BYTES,
|
|
148
156
|
EDITABLE_ARTIFACT_INTENT_MAX_CAUSAL_ACTORS,
|
|
149
157
|
EDITABLE_ARTIFACT_INTENT_MAX_UNDO_TARGETS,
|
|
158
|
+
EDITABLE_ARTIFACT_INTENT_PROTOCOL_VERSION,
|
|
150
159
|
EDITABLE_ARTIFACT_INTENT_VERSION,
|
|
151
160
|
EDITABLE_ARTIFACT_KERNEL_VERSION_MAX_BYTES,
|
|
152
|
-
EDITABLE_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
153
161
|
EDITABLE_ARTIFACT_PRODUCT_MAX_SNAPSHOT_BYTES,
|
|
154
|
-
EDITABLE_ARTIFACT_SNAPSHOT_VERSION,
|
|
155
162
|
PRESENTATION_ARTIFACT_COMMAND_MAX_BYTES,
|
|
156
163
|
PRESENTATION_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
157
164
|
PRESENTATION_ARTIFACT_COMMAND_VERSION,
|
|
@@ -166,6 +173,7 @@ export {
|
|
|
166
173
|
PRESENTATION_ARTIFACT_MAX_TEXT_BYTES,
|
|
167
174
|
PRESENTATION_ARTIFACT_MAX_TEXT_PARAGRAPHS,
|
|
168
175
|
PRESENTATION_ARTIFACT_MAX_TEXT_RUNS,
|
|
176
|
+
PRESENTATION_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
169
177
|
PRESENTATION_ARTIFACT_QUERY_MAX_BYTES,
|
|
170
178
|
PRESENTATION_ARTIFACT_QUERY_MAX_NODES,
|
|
171
179
|
PRESENTATION_ARTIFACT_QUERY_MAX_SLIDES,
|
|
@@ -173,6 +181,7 @@ export {
|
|
|
173
181
|
PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES,
|
|
174
182
|
PRESENTATION_ARTIFACT_QUERY_RESPONSE_VERSION,
|
|
175
183
|
PRESENTATION_ARTIFACT_QUERY_VERSION,
|
|
184
|
+
PRESENTATION_ARTIFACT_SNAPSHOT_VERSION,
|
|
176
185
|
SPREADSHEET_ARTIFACT_COMMAND_MAX_BYTES,
|
|
177
186
|
SPREADSHEET_ARTIFACT_COMMAND_MAX_CELLS,
|
|
178
187
|
SPREADSHEET_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
@@ -180,6 +189,7 @@ export {
|
|
|
180
189
|
SPREADSHEET_ARTIFACT_COMMAND_VERSION,
|
|
181
190
|
SPREADSHEET_ARTIFACT_METADATA_MAX_SHEETS,
|
|
182
191
|
SPREADSHEET_ARTIFACT_METADATA_MIN_RESPONSE_BYTES,
|
|
192
|
+
SPREADSHEET_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
183
193
|
SPREADSHEET_ARTIFACT_PROJECTION_MAX_BYTES,
|
|
184
194
|
SPREADSHEET_ARTIFACT_PROJECTION_MAX_STRING_BYTES,
|
|
185
195
|
SPREADSHEET_ARTIFACT_QUERY_MAX_BYTES,
|
|
@@ -188,6 +198,7 @@ export {
|
|
|
188
198
|
SPREADSHEET_ARTIFACT_VIEWPORT_MAX_AREA,
|
|
189
199
|
SPREADSHEET_ARTIFACT_VIEWPORT_MAX_CELLS,
|
|
190
200
|
SPREADSHEET_ARTIFACT_VIEWPORT_MIN_RESPONSE_BYTES,
|
|
201
|
+
SPREADSHEET_COLLABORATION_SNAPSHOT_VERSION,
|
|
191
202
|
assertCanonicalDocumentArtifactCommandBytes,
|
|
192
203
|
assertCanonicalDocumentArtifactQueryBytes,
|
|
193
204
|
assertCanonicalDocumentArtifactQueryResponseBytes,
|
|
@@ -199,6 +210,7 @@ export {
|
|
|
199
210
|
assertCanonicalSpreadsheetArtifactKernelProjectionBytes,
|
|
200
211
|
assertCanonicalSpreadsheetArtifactKernelQueryBytes,
|
|
201
212
|
assertEditableArtifactRequestHash,
|
|
213
|
+
currentEditableArtifactCompatibility,
|
|
202
214
|
decodeDocumentArtifactCommandBatch,
|
|
203
215
|
decodeDocumentArtifactQuery,
|
|
204
216
|
decodeDocumentArtifactQueryResponse,
|
package/dist/google-drive.d.ts
CHANGED
|
@@ -371,6 +371,7 @@ export type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;
|
|
|
371
371
|
export declare const GoogleDriveBrowseResponse: z.ZodObject<{
|
|
372
372
|
connection: z.ZodLazy<z.ZodObject<{
|
|
373
373
|
id: z.ZodString;
|
|
374
|
+
authorityId: z.ZodOptional<z.ZodString>;
|
|
374
375
|
accountId: z.ZodString;
|
|
375
376
|
workspaceId: z.ZodString;
|
|
376
377
|
subjectId: z.ZodNullable<z.ZodString>;
|
package/dist/google-drive.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7ZZ3R27P.js";
|
|
4
|
+
import "./chunk-MRWYRAS5.js";
|
|
5
|
+
import "./chunk-JUFK3T4Q.js";
|
|
4
6
|
import {
|
|
5
7
|
ConnectorDocumentDestination,
|
|
6
8
|
ConnectorDocumentDestinationSelection
|
|
7
9
|
} from "./chunk-WYBDERIY.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-LW7OH6CS.js";
|
|
14
|
-
import "./chunk-TZ6YEYN4.js";
|
|
15
|
-
import "./chunk-YRKRZ6OF.js";
|
|
16
|
-
import "./chunk-JBCIY7QD.js";
|
|
10
|
+
import "./chunk-N6GRVXAJ.js";
|
|
11
|
+
import "./chunk-3SIZGL3O.js";
|
|
12
|
+
import "./chunk-NVJMJWLL.js";
|
|
13
|
+
import "./chunk-7RMTKFJW.js";
|
|
14
|
+
import "./chunk-Y3KNXVTD.js";
|
|
17
15
|
import "./chunk-RIY7GYQS.js";
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-YRKRZ6OF.js";
|
|
17
|
+
import "./chunk-CM6BMECR.js";
|
|
19
18
|
import "./chunk-D2HKF2EF.js";
|
|
20
19
|
import "./chunk-MYBZRDTY.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-TXTQIYCV.js";
|
|
21
|
+
import "./chunk-PX3VCKAU.js";
|
|
22
|
+
import "./chunk-M5ZGRVIQ.js";
|
|
23
|
+
import "./chunk-YBW5JSA3.js";
|
|
23
24
|
|
|
24
25
|
// src/google-drive.ts
|
|
25
26
|
import { z } from "zod";
|
package/dist/google-drive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/google-drive.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\nimport {\n ConnectorDocumentDestination,\n ConnectorDocumentDestinationSelection,\n} from \"./connector-destinations\";\n\nexport const GOOGLE_DRIVE_PROVIDER_DOMAIN = \"googleapis.com\" as const;\nexport const GOOGLE_DRIVE_FULL_SCOPE = \"https://www.googleapis.com/auth/drive\" as const;\nexport const GOOGLE_DRIVE_FILE_SCOPE = \"https://www.googleapis.com/auth/drive.file\" as const;\nexport const GOOGLE_DRIVE_METADATA_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.metadata.readonly\" as const;\nexport const GOOGLE_DRIVE_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.readonly\" as const;\n/** Stable serialized role retained for existing connection rows; not product-facing copy. */\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive read-only source sync\" as const;\nexport const GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL = \"Google Drive metadata browser\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_SERVER_ID = \"google-drive-publishing\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_TOOL_NAME = \"google_drive_publish_file\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_CREATE_ACTION = \"create\" as const;\n\nexport const GoogleDriveOAuthCapability = z.enum([\n \"picker_file_read\",\n \"publish_file\",\n \"source_metadata_discovery\",\n \"source_content_read\",\n \"recursive_source_sync\",\n]);\nexport type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;\n\nexport type GoogleDriveOAuthScopeDecision = {\n accessMode: \"file_only\" | \"metadata_readonly\" | \"readonly\" | null;\n capabilities: GoogleDriveOAuthCapability[];\n};\n\n/**\n * Converts exact Google OAuth grants into the Drive capabilities OpenGeni may\n * rely on. Unknown or malformed grants add no authority. In particular,\n * drive.file covers only files explicitly opened or shared with the app and\n * never authorizes arbitrary recursive descendant discovery.\n */\nexport function googleDriveOAuthScopeDecision(\n grantedScopes: readonly string[],\n): GoogleDriveOAuthScopeDecision {\n const granted = new Set(grantedScopes);\n const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);\n const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);\n const hasFileWrite = hasFullDrive || granted.has(GOOGLE_DRIVE_FILE_SCOPE);\n const hasSourceMetadataDiscovery =\n hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);\n const hasPickerFileRead = hasSourceContentRead || hasFileWrite;\n const capabilities: GoogleDriveOAuthCapability[] = [];\n if (hasPickerFileRead) capabilities.push(\"picker_file_read\");\n if (hasFileWrite) capabilities.push(\"publish_file\");\n if (hasSourceMetadataDiscovery) capabilities.push(\"source_metadata_discovery\");\n if (hasSourceContentRead) {\n capabilities.push(\"source_content_read\", \"recursive_source_sync\");\n }\n return {\n accessMode: hasSourceContentRead\n ? \"readonly\"\n : hasSourceMetadataDiscovery\n ? \"metadata_readonly\"\n : hasFileWrite\n ? \"file_only\"\n : null,\n capabilities,\n };\n}\n\nexport function googleDriveScopesAllowCapability(\n grantedScopes: readonly string[],\n capability: GoogleDriveOAuthCapability,\n): boolean {\n return googleDriveOAuthScopeDecision(grantedScopes).capabilities.includes(capability);\n}\n\n/** @deprecated Connector document destinations use organization/workspace/personal authority. */\nexport const GoogleDriveTargetScope = z.enum([\"user\", \"workspace\", \"organization\"]);\nexport type GoogleDriveTargetScope = z.infer<typeof GoogleDriveTargetScope>;\n\nexport const GoogleDriveSyncCadence = z.enum([\"manual\", \"hourly\", \"daily\"]);\nexport type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;\n\nexport const GoogleDriveReadPolicy = z.enum([\"allow\", \"ask\", \"block\"]);\nexport type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;\n\nexport const GoogleDriveConnectionLifecycleState = z.enum([\n \"active\",\n \"paused\",\n \"token_revoked\",\n \"app_removed\",\n \"disconnected\",\n \"reconnect_required\",\n \"reconsent_required\",\n]);\nexport type GoogleDriveConnectionLifecycleState = z.infer<\n typeof GoogleDriveConnectionLifecycleState\n>;\n\nconst GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });\nexport const GoogleDriveConnectionLifecycle = z.discriminatedUnion(\"state\", [\n z.object({\n state: z.literal(\"active\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"paused\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"token_revoked\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"app_removed\"),\n recoverable: z.literal(false),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"disconnected\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconnect_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconsent_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n]);\nexport type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;\n\nexport const GoogleDriveSelectedSource = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(256).nullable().default(null),\n destination: ConnectorDocumentDestination.optional(),\n /** @deprecated Missing destinations resolve to the current workspace boundary. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n configGeneration: z.number().int().positive().default(1),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n selectedAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;\n\nexport const GoogleDriveOutputDestination = z\n .object({\n folderId: z.string().min(1).max(256),\n folderName: z.string().min(1).max(1024),\n driveId: z.string().min(1).max(256).nullable(),\n location: z.enum([\"my_drive\", \"shared_drive\"]),\n selectedAt: z.string().datetime({ offset: true }),\n })\n .strict()\n .superRefine((value, context) => {\n if ((value.location === \"my_drive\") !== (value.driveId === null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"driveId\"],\n message: \"Google Drive destination location does not match its drive identity\",\n });\n }\n });\nexport type GoogleDriveOutputDestination = z.infer<typeof GoogleDriveOutputDestination>;\n\nexport const GoogleDriveConnectionMetadata = z\n .object({\n credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),\n credentialLabel: z.union([\n z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n z.literal(GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL),\n ]),\n googlePermissionId: z.string().min(1).max(256),\n googleEmail: z.string().email().max(320),\n googleDisplayName: z.string().min(1).max(512).nullable(),\n verifiedAt: z.string().datetime({ offset: true }),\n accessMode: z.enum([\"file_only\", \"metadata_readonly\", \"readonly\"]),\n lifecycle: GoogleDriveConnectionLifecycle.optional(),\n outputDestination: GoogleDriveOutputDestination.optional(),\n documentDestination: ConnectorDocumentDestination.optional(),\n selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),\n /** @deprecated Read `selectedSources`; retained while existing connections migrate. */\n selectedSource: GoogleDriveSelectedSource.nullable().optional(),\n })\n .passthrough();\nexport type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnectionMetadata>;\n\nexport const GoogleDriveOAuthStartRequest = z.object({\n connectionId: z.string().uuid().optional(),\n capability: z.enum([\"source_read\", \"publish\"]).default(\"source_read\"),\n});\nexport type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;\n\nexport const GoogleDriveOAuthStartResponse = z.object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;\n\nexport const GoogleDriveLifecycleActionRequest = z.object({\n action: z.enum([\"pause\", \"resume\"]),\n expectedVersion: z.number().int().positive(),\n});\nexport type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;\n\nexport const GoogleDriveDisconnectRequest = z.object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n});\nexport type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;\n\nexport const GoogleDrivePublicationExportFile = z\n .object({\n fileId: z.string().uuid(),\n filename: z.string().trim().min(1).max(512),\n contentType: z.string().trim().min(1).max(256),\n sizeBytes: z.number().int().positive(),\n sha256: z.string().regex(/^[0-9a-f]{64}$/u),\n artifactId: z.string().regex(/^[0-9a-f]{32}$/u),\n versionId: z.string().regex(/^[0-9a-f]{32}$/u),\n materializationJobId: z.string().regex(/^[0-9a-f]{32}$/u),\n sourceHeadSequence: z.number().int().nonnegative(),\n sourceStateHash: z.string().regex(/^sha256:[0-9a-f]{64}$/u),\n })\n .strict();\nexport type GoogleDrivePublicationExportFile = z.infer<typeof GoogleDrivePublicationExportFile>;\n\nexport const GoogleDrivePublicationToolInput = z\n .object({\n title: z.string().trim().min(1).max(512),\n modality: z.enum([\"document\", \"spreadsheet\", \"presentation\"]),\n file: GoogleDrivePublicationExportFile,\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type GoogleDrivePublicationToolInput = z.infer<typeof GoogleDrivePublicationToolInput>;\n\nexport const GoogleDrivePublicationReceipt = z\n .object({\n connectionId: z.string().uuid(),\n providerFileId: z.string().min(1).max(256),\n webViewLink: z.string().url(),\n mimeType: z.enum([\n \"application/vnd.google-apps.document\",\n \"application/vnd.google-apps.spreadsheet\",\n \"application/vnd.google-apps.presentation\",\n ]),\n destination: GoogleDriveOutputDestination,\n replayed: z.boolean(),\n })\n .strict();\nexport type GoogleDrivePublicationReceipt = z.infer<typeof GoogleDrivePublicationReceipt>;\n\nexport const GoogleDriveBrowseItem = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n kind: z.enum([\"folder\", \"file\"]),\n driveId: z.string().min(1).max(256).nullable(),\n modifiedTime: z.string().datetime({ offset: true }).nullable(),\n size: z.string().regex(/^\\d+$/).nullable(),\n webViewLink: z.string().url().nullable(),\n});\nexport type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;\n\nexport const GoogleDriveBrowseResponse = z.object({\n connection: z.lazy(() => ConnectionMetadata),\n parentId: z.string().min(1).max(256),\n current: GoogleDriveBrowseItem.nullable(),\n items: z.array(GoogleDriveBrowseItem),\n nextPageToken: z.string().min(1).max(4096).nullable(),\n incompleteSearch: z.boolean(),\n});\nexport type GoogleDriveBrowseResponse = z.infer<typeof GoogleDriveBrowseResponse>;\n\nconst GoogleDriveSourceSelection = z\n .array(\n GoogleDriveBrowseItem.pick({\n id: true,\n name: true,\n mimeType: true,\n driveId: true,\n }),\n )\n .max(100)\n .refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {\n message: \"Google Drive sources must be unique\",\n });\n\nexport const SaveGoogleDriveSourceRequest = z\n .object({\n sources: GoogleDriveSourceSelection,\n destination: ConnectorDocumentDestinationSelection.optional(),\n /** @deprecated Legacy requests are accepted but resolve to workspace authority. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n })\n .refine((request) => request.destination !== undefined || request.targetScope !== undefined, {\n message: \"Google Drive document destination is required\",\n });\nexport type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;\n\nexport const GoogleDriveKnowledgeSourceItem = z.object({\n id: z.string().min(1).max(512),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(512).optional(),\n sourceKind: z.enum([\"my_drive\", \"shared_drive\", \"folder\"]),\n includeDescendants: z.boolean(),\n});\nexport type GoogleDriveKnowledgeSourceItem = z.infer<typeof GoogleDriveKnowledgeSourceItem>;\n\nexport const GoogleDriveKnowledgeSourceDestination = z.object({\n authorityKind: z.enum([\"organization\", \"workspace\", \"personal\"]),\n authorityAccountId: z.string().min(1).max(128),\n authorityWorkspaceId: z.string().min(1).max(128).optional(),\n authoritySubjectId: z.string().min(1).max(512).optional(),\n collectionId: z.string().min(1).max(512).optional(),\n});\nexport type GoogleDriveKnowledgeSourceDestination = z.infer<\n typeof GoogleDriveKnowledgeSourceDestination\n>;\n\nexport const GoogleDriveKnowledgeSourceConfig = z.object({\n sources: z.array(GoogleDriveKnowledgeSourceItem).min(1).max(100),\n destination: GoogleDriveKnowledgeSourceDestination,\n syncCadence: GoogleDriveSyncCadence,\n readPolicy: GoogleDriveReadPolicy,\n});\nexport type GoogleDriveKnowledgeSourceConfig = z.infer<typeof GoogleDriveKnowledgeSourceConfig>;\n\nexport const SaveGoogleDriveIntegrationSourceRequest = z.intersection(\n SaveGoogleDriveSourceRequest,\n z.object({\n sources: GoogleDriveSourceSelection.refine((sources) => sources.length > 0, {\n message: \"At least one Google Drive source is required\",\n }),\n expectedVersion: z.number().int().positive().optional(),\n idempotencyKey: z.string().uuid(),\n }),\n);\nexport type SaveGoogleDriveIntegrationSourceRequest = z.infer<\n typeof SaveGoogleDriveIntegrationSourceRequest\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAQX,IAAM,+BAA+B;AACrC,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,uCACX;AACK,IAAM,8BACX;AAEK,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AACtC,IAAM,uCAAuC;AAC7C,IAAM,qCAAqC;AAC3C,IAAM,qCAAqC;AAC3C,IAAM,yCAAyC;AAE/C,IAAM,6BAA6B,EAAE,KAAK;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAcM,SAAS,8BACd,eAC+B;AAC/B,QAAM,UAAU,IAAI,IAAI,aAAa;AACrC,QAAM,eAAe,QAAQ,IAAI,uBAAuB;AACxD,QAAM,uBAAuB,gBAAgB,QAAQ,IAAI,2BAA2B;AACpF,QAAM,eAAe,gBAAgB,QAAQ,IAAI,uBAAuB;AACxE,QAAM,6BACJ,wBAAwB,QAAQ,IAAI,oCAAoC;AAC1E,QAAM,oBAAoB,wBAAwB;AAClD,QAAM,eAA6C,CAAC;AACpD,MAAI,kBAAmB,cAAa,KAAK,kBAAkB;AAC3D,MA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";\n\nimport { ConnectionMetadata } from \"./index\";\nimport {\n ConnectorDocumentDestination,\n ConnectorDocumentDestinationSelection,\n} from \"./connector-destinations\";\n\nexport const GOOGLE_DRIVE_PROVIDER_DOMAIN = \"googleapis.com\" as const;\nexport const GOOGLE_DRIVE_FULL_SCOPE = \"https://www.googleapis.com/auth/drive\" as const;\nexport const GOOGLE_DRIVE_FILE_SCOPE = \"https://www.googleapis.com/auth/drive.file\" as const;\nexport const GOOGLE_DRIVE_METADATA_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.metadata.readonly\" as const;\nexport const GOOGLE_DRIVE_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.readonly\" as const;\n/** Stable serialized role retained for existing connection rows; not product-facing copy. */\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive read-only source sync\" as const;\nexport const GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL = \"Google Drive metadata browser\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_SERVER_ID = \"google-drive-publishing\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_TOOL_NAME = \"google_drive_publish_file\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_CREATE_ACTION = \"create\" as const;\n\nexport const GoogleDriveOAuthCapability = z.enum([\n \"picker_file_read\",\n \"publish_file\",\n \"source_metadata_discovery\",\n \"source_content_read\",\n \"recursive_source_sync\",\n]);\nexport type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;\n\nexport type GoogleDriveOAuthScopeDecision = {\n accessMode: \"file_only\" | \"metadata_readonly\" | \"readonly\" | null;\n capabilities: GoogleDriveOAuthCapability[];\n};\n\n/**\n * Converts exact Google OAuth grants into the Drive capabilities OpenGeni may\n * rely on. Unknown or malformed grants add no authority. In particular,\n * drive.file covers only files explicitly opened or shared with the app and\n * never authorizes arbitrary recursive descendant discovery.\n */\nexport function googleDriveOAuthScopeDecision(\n grantedScopes: readonly string[],\n): GoogleDriveOAuthScopeDecision {\n const granted = new Set(grantedScopes);\n const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);\n const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);\n const hasFileWrite = hasFullDrive || granted.has(GOOGLE_DRIVE_FILE_SCOPE);\n const hasSourceMetadataDiscovery =\n hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);\n const hasPickerFileRead = hasSourceContentRead || hasFileWrite;\n const capabilities: GoogleDriveOAuthCapability[] = [];\n if (hasPickerFileRead) capabilities.push(\"picker_file_read\");\n if (hasFileWrite) capabilities.push(\"publish_file\");\n if (hasSourceMetadataDiscovery) capabilities.push(\"source_metadata_discovery\");\n if (hasSourceContentRead) {\n capabilities.push(\"source_content_read\", \"recursive_source_sync\");\n }\n return {\n accessMode: hasSourceContentRead\n ? \"readonly\"\n : hasSourceMetadataDiscovery\n ? \"metadata_readonly\"\n : hasFileWrite\n ? \"file_only\"\n : null,\n capabilities,\n };\n}\n\nexport function googleDriveScopesAllowCapability(\n grantedScopes: readonly string[],\n capability: GoogleDriveOAuthCapability,\n): boolean {\n return googleDriveOAuthScopeDecision(grantedScopes).capabilities.includes(capability);\n}\n\n/** @deprecated Connector document destinations use organization/workspace/personal authority. */\nexport const GoogleDriveTargetScope = z.enum([\"user\", \"workspace\", \"organization\"]);\nexport type GoogleDriveTargetScope = z.infer<typeof GoogleDriveTargetScope>;\n\nexport const GoogleDriveSyncCadence = z.enum([\"manual\", \"hourly\", \"daily\"]);\nexport type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;\n\nexport const GoogleDriveReadPolicy = z.enum([\"allow\", \"ask\", \"block\"]);\nexport type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;\n\nexport const GoogleDriveConnectionLifecycleState = z.enum([\n \"active\",\n \"paused\",\n \"token_revoked\",\n \"app_removed\",\n \"disconnected\",\n \"reconnect_required\",\n \"reconsent_required\",\n]);\nexport type GoogleDriveConnectionLifecycleState = z.infer<\n typeof GoogleDriveConnectionLifecycleState\n>;\n\nconst GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });\nexport const GoogleDriveConnectionLifecycle = z.discriminatedUnion(\"state\", [\n z.object({\n state: z.literal(\"active\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"paused\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"token_revoked\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"app_removed\"),\n recoverable: z.literal(false),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"disconnected\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconnect_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconsent_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n]);\nexport type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;\n\nexport const GoogleDriveSelectedSource = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(256).nullable().default(null),\n destination: ConnectorDocumentDestination.optional(),\n /** @deprecated Missing destinations resolve to the current workspace boundary. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n configGeneration: z.number().int().positive().default(1),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n selectedAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;\n\nexport const GoogleDriveOutputDestination = z\n .object({\n folderId: z.string().min(1).max(256),\n folderName: z.string().min(1).max(1024),\n driveId: z.string().min(1).max(256).nullable(),\n location: z.enum([\"my_drive\", \"shared_drive\"]),\n selectedAt: z.string().datetime({ offset: true }),\n })\n .strict()\n .superRefine((value, context) => {\n if ((value.location === \"my_drive\") !== (value.driveId === null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"driveId\"],\n message: \"Google Drive destination location does not match its drive identity\",\n });\n }\n });\nexport type GoogleDriveOutputDestination = z.infer<typeof GoogleDriveOutputDestination>;\n\nexport const GoogleDriveConnectionMetadata = z\n .object({\n credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),\n credentialLabel: z.union([\n z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n z.literal(GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL),\n ]),\n googlePermissionId: z.string().min(1).max(256),\n googleEmail: z.string().email().max(320),\n googleDisplayName: z.string().min(1).max(512).nullable(),\n verifiedAt: z.string().datetime({ offset: true }),\n accessMode: z.enum([\"file_only\", \"metadata_readonly\", \"readonly\"]),\n lifecycle: GoogleDriveConnectionLifecycle.optional(),\n outputDestination: GoogleDriveOutputDestination.optional(),\n documentDestination: ConnectorDocumentDestination.optional(),\n selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),\n /** @deprecated Read `selectedSources`; retained while existing connections migrate. */\n selectedSource: GoogleDriveSelectedSource.nullable().optional(),\n })\n .passthrough();\nexport type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnectionMetadata>;\n\nexport const GoogleDriveOAuthStartRequest = z.object({\n connectionId: z.string().uuid().optional(),\n capability: z.enum([\"source_read\", \"publish\"]).default(\"source_read\"),\n});\nexport type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;\n\nexport const GoogleDriveOAuthStartResponse = z.object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;\n\nexport const GoogleDriveLifecycleActionRequest = z.object({\n action: z.enum([\"pause\", \"resume\"]),\n expectedVersion: z.number().int().positive(),\n});\nexport type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;\n\nexport const GoogleDriveDisconnectRequest = z.object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n});\nexport type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;\n\nexport const GoogleDrivePublicationExportFile = z\n .object({\n fileId: z.string().uuid(),\n filename: z.string().trim().min(1).max(512),\n contentType: z.string().trim().min(1).max(256),\n sizeBytes: z.number().int().positive(),\n sha256: z.string().regex(/^[0-9a-f]{64}$/u),\n artifactId: z.string().regex(/^[0-9a-f]{32}$/u),\n versionId: z.string().regex(/^[0-9a-f]{32}$/u),\n materializationJobId: z.string().regex(/^[0-9a-f]{32}$/u),\n sourceHeadSequence: z.number().int().nonnegative(),\n sourceStateHash: z.string().regex(/^sha256:[0-9a-f]{64}$/u),\n })\n .strict();\nexport type GoogleDrivePublicationExportFile = z.infer<typeof GoogleDrivePublicationExportFile>;\n\nexport const GoogleDrivePublicationToolInput = z\n .object({\n title: z.string().trim().min(1).max(512),\n modality: z.enum([\"document\", \"spreadsheet\", \"presentation\"]),\n file: GoogleDrivePublicationExportFile,\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type GoogleDrivePublicationToolInput = z.infer<typeof GoogleDrivePublicationToolInput>;\n\nexport const GoogleDrivePublicationReceipt = z\n .object({\n connectionId: z.string().uuid(),\n providerFileId: z.string().min(1).max(256),\n webViewLink: z.string().url(),\n mimeType: z.enum([\n \"application/vnd.google-apps.document\",\n \"application/vnd.google-apps.spreadsheet\",\n \"application/vnd.google-apps.presentation\",\n ]),\n destination: GoogleDriveOutputDestination,\n replayed: z.boolean(),\n })\n .strict();\nexport type GoogleDrivePublicationReceipt = z.infer<typeof GoogleDrivePublicationReceipt>;\n\nexport const GoogleDriveBrowseItem = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n kind: z.enum([\"folder\", \"file\"]),\n driveId: z.string().min(1).max(256).nullable(),\n modifiedTime: z.string().datetime({ offset: true }).nullable(),\n size: z.string().regex(/^\\d+$/).nullable(),\n webViewLink: z.string().url().nullable(),\n});\nexport type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;\n\nexport const GoogleDriveBrowseResponse = z.object({\n connection: z.lazy(() => ConnectionMetadata),\n parentId: z.string().min(1).max(256),\n current: GoogleDriveBrowseItem.nullable(),\n items: z.array(GoogleDriveBrowseItem),\n nextPageToken: z.string().min(1).max(4096).nullable(),\n incompleteSearch: z.boolean(),\n});\nexport type GoogleDriveBrowseResponse = z.infer<typeof GoogleDriveBrowseResponse>;\n\nconst GoogleDriveSourceSelection = z\n .array(\n GoogleDriveBrowseItem.pick({\n id: true,\n name: true,\n mimeType: true,\n driveId: true,\n }),\n )\n .max(100)\n .refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {\n message: \"Google Drive sources must be unique\",\n });\n\nexport const SaveGoogleDriveSourceRequest = z\n .object({\n sources: GoogleDriveSourceSelection,\n destination: ConnectorDocumentDestinationSelection.optional(),\n /** @deprecated Legacy requests are accepted but resolve to workspace authority. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n })\n .refine((request) => request.destination !== undefined || request.targetScope !== undefined, {\n message: \"Google Drive document destination is required\",\n });\nexport type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;\n\nexport const GoogleDriveKnowledgeSourceItem = z.object({\n id: z.string().min(1).max(512),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(512).optional(),\n sourceKind: z.enum([\"my_drive\", \"shared_drive\", \"folder\"]),\n includeDescendants: z.boolean(),\n});\nexport type GoogleDriveKnowledgeSourceItem = z.infer<typeof GoogleDriveKnowledgeSourceItem>;\n\nexport const GoogleDriveKnowledgeSourceDestination = z.object({\n authorityKind: z.enum([\"organization\", \"workspace\", \"personal\"]),\n authorityAccountId: z.string().min(1).max(128),\n authorityWorkspaceId: z.string().min(1).max(128).optional(),\n authoritySubjectId: z.string().min(1).max(512).optional(),\n collectionId: z.string().min(1).max(512).optional(),\n});\nexport type GoogleDriveKnowledgeSourceDestination = z.infer<\n typeof GoogleDriveKnowledgeSourceDestination\n>;\n\nexport const GoogleDriveKnowledgeSourceConfig = z.object({\n sources: z.array(GoogleDriveKnowledgeSourceItem).min(1).max(100),\n destination: GoogleDriveKnowledgeSourceDestination,\n syncCadence: GoogleDriveSyncCadence,\n readPolicy: GoogleDriveReadPolicy,\n});\nexport type GoogleDriveKnowledgeSourceConfig = z.infer<typeof GoogleDriveKnowledgeSourceConfig>;\n\nexport const SaveGoogleDriveIntegrationSourceRequest = z.intersection(\n SaveGoogleDriveSourceRequest,\n z.object({\n sources: GoogleDriveSourceSelection.refine((sources) => sources.length > 0, {\n message: \"At least one Google Drive source is required\",\n }),\n expectedVersion: z.number().int().positive().optional(),\n idempotencyKey: z.string().uuid(),\n }),\n);\nexport type SaveGoogleDriveIntegrationSourceRequest = z.infer<\n typeof SaveGoogleDriveIntegrationSourceRequest\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAQX,IAAM,+BAA+B;AACrC,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,uCACX;AACK,IAAM,8BACX;AAEK,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AACtC,IAAM,uCAAuC;AAC7C,IAAM,qCAAqC;AAC3C,IAAM,qCA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AE,MAAM,8BAA8B,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AACd,CAAC;AAGM,IAAM,0CAA0C,EAAE;AAAA,EACvD;AAAA,EACA,EAAE,OAAO;AAAA,IACP,SAAS,2BAA2B,OAAO,CAAC,YAAY,QAAQ,SAAS,GAAG;AAAA,MAC1E,SAAS;AAAA,IACX,CAAC;AAAA,IACD,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,IACtD,gBAAgB,EAAE,OAAO,EAAE,KAAK;AAAA,EAClC,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GovernedLearningActivationDestination: z.ZodEnum<{
|
|
3
|
+
instruction_policy: "instruction_policy";
|
|
4
|
+
preference: "preference";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const GovernedLearningActivationAuthorityKind: z.ZodEnum<{
|
|
7
|
+
automatic: "automatic";
|
|
8
|
+
human_confirmed: "human_confirmed";
|
|
9
|
+
}>;
|
|
10
|
+
export type GovernedLearningActivationAuthorityKind = z.infer<typeof GovernedLearningActivationAuthorityKind>;
|
|
11
|
+
export type GovernedLearningActivationDestination = z.infer<typeof GovernedLearningActivationDestination>;
|
|
12
|
+
export declare const GovernedLearningActivationCaller: z.ZodObject<{
|
|
13
|
+
workspaceId: z.ZodString;
|
|
14
|
+
subjectId: z.ZodString;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type GovernedLearningActivationCaller = z.infer<typeof GovernedLearningActivationCaller>;
|
|
17
|
+
export declare const ActivateGovernedLearningDecisionRequest: z.ZodObject<{
|
|
18
|
+
operationId: z.ZodString;
|
|
19
|
+
decisionReceiptId: z.ZodString;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export type ActivateGovernedLearningDecisionRequest = z.infer<typeof ActivateGovernedLearningDecisionRequest>;
|
|
22
|
+
export declare const UndoGovernedLearningActivationRequest: z.ZodObject<{
|
|
23
|
+
operationId: z.ZodString;
|
|
24
|
+
activationReceiptId: z.ZodString;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type UndoGovernedLearningActivationRequest = z.infer<typeof UndoGovernedLearningActivationRequest>;
|
|
27
|
+
/**
|
|
28
|
+
* Immutable content-free proof that one final automatic evaluator receipt was
|
|
29
|
+
* revalidated and applied through the destination-owned lifecycle.
|
|
30
|
+
*/
|
|
31
|
+
export declare const GovernedLearningActivationReceipt: z.ZodObject<{
|
|
32
|
+
destination: z.ZodEnum<{
|
|
33
|
+
instruction_policy: "instruction_policy";
|
|
34
|
+
preference: "preference";
|
|
35
|
+
}>;
|
|
36
|
+
destinationProposalId: z.ZodString;
|
|
37
|
+
destinationRevisionId: z.ZodString;
|
|
38
|
+
destinationOldRevisionId: z.ZodNullable<z.ZodString>;
|
|
39
|
+
destinationOldContentHash: z.ZodNullable<z.ZodString>;
|
|
40
|
+
destinationOldVersion: z.ZodNumber;
|
|
41
|
+
destinationNewContentHash: z.ZodString;
|
|
42
|
+
destinationNewVersion: z.ZodNumber;
|
|
43
|
+
destinationEventId: z.ZodString;
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
operationId: z.ZodString;
|
|
46
|
+
inputHash: z.ZodString;
|
|
47
|
+
accountId: z.ZodString;
|
|
48
|
+
workspaceId: z.ZodString;
|
|
49
|
+
decisionReceiptId: z.ZodString;
|
|
50
|
+
initiatingHumanSubjectId: z.ZodString;
|
|
51
|
+
serviceActorSubjectId: z.ZodString;
|
|
52
|
+
policyRevisionId: z.ZodString;
|
|
53
|
+
policyHash: z.ZodString;
|
|
54
|
+
policyActivationVersion: z.ZodNumber;
|
|
55
|
+
sourceKind: z.ZodEnum<{
|
|
56
|
+
"scoped-knowledge-evidence": "scoped-knowledge-evidence";
|
|
57
|
+
"task-note": "task-note";
|
|
58
|
+
}>;
|
|
59
|
+
sourceId: z.ZodString;
|
|
60
|
+
sourceAuthorityHash: z.ZodString;
|
|
61
|
+
proposalId: z.ZodString;
|
|
62
|
+
claimId: z.ZodString;
|
|
63
|
+
evidenceId: z.ZodString;
|
|
64
|
+
knowledgePreviousReviewId: z.ZodString;
|
|
65
|
+
knowledgePreviousReviewRevision: z.ZodNumber;
|
|
66
|
+
knowledgeApprovalReviewId: z.ZodString;
|
|
67
|
+
knowledgeApprovalReviewRevision: z.ZodNumber;
|
|
68
|
+
knowledgeApprovalInputHash: z.ZodString;
|
|
69
|
+
outcome: z.ZodLiteral<"activated">;
|
|
70
|
+
effectiveAt: z.ZodString;
|
|
71
|
+
authorityKind: z.ZodEnum<{
|
|
72
|
+
automatic: "automatic";
|
|
73
|
+
human_confirmed: "human_confirmed";
|
|
74
|
+
}>;
|
|
75
|
+
humanInputRequestId: z.ZodNullable<z.ZodString>;
|
|
76
|
+
rollback: z.ZodObject<{
|
|
77
|
+
supported: z.ZodLiteral<true>;
|
|
78
|
+
mechanism: z.ZodLiteral<"exact_head_and_latest_review">;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
createdAt: z.ZodString;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type GovernedLearningActivationReceipt = z.infer<typeof GovernedLearningActivationReceipt>;
|
|
83
|
+
export declare const ActivateHumanConfirmedLearningDecisionRequest: z.ZodObject<{
|
|
84
|
+
operationId: z.ZodString;
|
|
85
|
+
decisionReceiptId: z.ZodString;
|
|
86
|
+
humanInputRequestId: z.ZodString;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export type ActivateHumanConfirmedLearningDecisionRequest = z.infer<typeof ActivateHumanConfirmedLearningDecisionRequest>;
|
|
89
|
+
/** Append-only compensation proof. Undo never deletes prior evidence. */
|
|
90
|
+
export declare const GovernedLearningActivationUndoReceipt: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
operationId: z.ZodString;
|
|
93
|
+
inputHash: z.ZodString;
|
|
94
|
+
accountId: z.ZodString;
|
|
95
|
+
workspaceId: z.ZodString;
|
|
96
|
+
activationReceiptId: z.ZodString;
|
|
97
|
+
initiatingHumanSubjectId: z.ZodString;
|
|
98
|
+
serviceActorSubjectId: z.ZodString;
|
|
99
|
+
destination: z.ZodEnum<{
|
|
100
|
+
instruction_policy: "instruction_policy";
|
|
101
|
+
preference: "preference";
|
|
102
|
+
}>;
|
|
103
|
+
knowledgeApprovalReviewId: z.ZodString;
|
|
104
|
+
knowledgeRevocationReviewId: z.ZodString;
|
|
105
|
+
knowledgeRevocationReviewRevision: z.ZodNumber;
|
|
106
|
+
knowledgeRevocationInputHash: z.ZodString;
|
|
107
|
+
destinationActivatedRevisionId: z.ZodString;
|
|
108
|
+
destinationRestoredRevisionId: z.ZodNullable<z.ZodString>;
|
|
109
|
+
destinationActivatedContentHash: z.ZodString;
|
|
110
|
+
destinationRestoredContentHash: z.ZodNullable<z.ZodString>;
|
|
111
|
+
destinationOldVersion: z.ZodNumber;
|
|
112
|
+
destinationNewVersion: z.ZodNumber;
|
|
113
|
+
destinationEventId: z.ZodString;
|
|
114
|
+
outcome: z.ZodLiteral<"undone">;
|
|
115
|
+
superseded: z.ZodLiteral<false>;
|
|
116
|
+
effectiveAt: z.ZodString;
|
|
117
|
+
createdAt: z.ZodString;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
export type GovernedLearningActivationUndoReceipt = z.infer<typeof GovernedLearningActivationUndoReceipt>;
|
|
120
|
+
/**
|
|
121
|
+
* Immutable content-free proof that the exact initiating human confirmed a
|
|
122
|
+
* user-directed Knowledge claim (`remember` with lane `knowledge`) through the
|
|
123
|
+
* bound structured human-input question, after which the claim's latest
|
|
124
|
+
* `proposed` review was superseded by an `approved` service review.
|
|
125
|
+
*/
|
|
126
|
+
export declare const RememberKnowledgeConfirmationReceipt: z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
operationId: z.ZodString;
|
|
129
|
+
inputHash: z.ZodString;
|
|
130
|
+
accountId: z.ZodString;
|
|
131
|
+
workspaceId: z.ZodString;
|
|
132
|
+
sessionId: z.ZodString;
|
|
133
|
+
turnId: z.ZodString;
|
|
134
|
+
executionGeneration: z.ZodNumber;
|
|
135
|
+
initiatingHumanSubjectId: z.ZodString;
|
|
136
|
+
serviceActorSubjectId: z.ZodString;
|
|
137
|
+
claimId: z.ZodString;
|
|
138
|
+
evidenceId: z.ZodString;
|
|
139
|
+
taskNoteId: z.ZodString;
|
|
140
|
+
taskNoteTextHash: z.ZodString;
|
|
141
|
+
humanInputRequestId: z.ZodString;
|
|
142
|
+
previousReviewId: z.ZodString;
|
|
143
|
+
previousReviewRevision: z.ZodNumber;
|
|
144
|
+
approvalReviewId: z.ZodString;
|
|
145
|
+
approvalReviewRevision: z.ZodNumber;
|
|
146
|
+
createdAt: z.ZodString;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
export type RememberKnowledgeConfirmationReceipt = z.infer<typeof RememberKnowledgeConfirmationReceipt>;
|
|
149
|
+
export declare const ConfirmRememberKnowledgeClaimRequest: z.ZodObject<{
|
|
150
|
+
operationId: z.ZodString;
|
|
151
|
+
claimId: z.ZodString;
|
|
152
|
+
humanInputRequestId: z.ZodString;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
export type ConfirmRememberKnowledgeClaimRequest = z.infer<typeof ConfirmRememberKnowledgeClaimRequest>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Automatic is intentionally conservative in the first evaluator tranche.
|
|
4
|
+
* This constant is platform-owned rather than caller-selectable so an agent or
|
|
5
|
+
* connector cannot lower the admission floor inside one request.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GOVERNED_LEARNING_AUTOMATIC_CONFIDENCE_FLOOR_BPS = 8500;
|
|
8
|
+
export declare const GOVERNED_LEARNING_MAX_CONFLICT_COUNT = 1000;
|
|
9
|
+
export declare const GovernedLearningDecisionOutcome: z.ZodEnum<{
|
|
10
|
+
automatic: "automatic";
|
|
11
|
+
confidence: "confidence";
|
|
12
|
+
conflict: "conflict";
|
|
13
|
+
off: "off";
|
|
14
|
+
revoked: "revoked";
|
|
15
|
+
stale: "stale";
|
|
16
|
+
suggest: "suggest";
|
|
17
|
+
}>;
|
|
18
|
+
export type GovernedLearningDecisionOutcome = z.infer<typeof GovernedLearningDecisionOutcome>;
|
|
19
|
+
/** Stable order used by TypeScript, SQL constraints, and public receipts. */
|
|
20
|
+
export declare const GOVERNED_LEARNING_REASON_ORDER: readonly ["policy_off", "evidence_revoked", "proposal_stale", "evidence_conflict", "confidence_below_floor", "policy_suggest", "policy_automatic"];
|
|
21
|
+
export declare const GovernedLearningDecisionReason: z.ZodEnum<{
|
|
22
|
+
confidence_below_floor: "confidence_below_floor";
|
|
23
|
+
evidence_conflict: "evidence_conflict";
|
|
24
|
+
evidence_revoked: "evidence_revoked";
|
|
25
|
+
policy_automatic: "policy_automatic";
|
|
26
|
+
policy_off: "policy_off";
|
|
27
|
+
policy_suggest: "policy_suggest";
|
|
28
|
+
proposal_stale: "proposal_stale";
|
|
29
|
+
}>;
|
|
30
|
+
export type GovernedLearningDecisionReason = z.infer<typeof GovernedLearningDecisionReason>;
|
|
31
|
+
export declare const GovernedLearningDecisionFacts: z.ZodObject<{
|
|
32
|
+
effectiveMode: z.ZodEnum<{
|
|
33
|
+
automatic: "automatic";
|
|
34
|
+
off: "off";
|
|
35
|
+
suggest: "suggest";
|
|
36
|
+
}>;
|
|
37
|
+
confidenceBps: z.ZodNumber;
|
|
38
|
+
conflictCount: z.ZodNumber;
|
|
39
|
+
stale: z.ZodBoolean;
|
|
40
|
+
revoked: z.ZodBoolean;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type GovernedLearningDecisionFacts = z.infer<typeof GovernedLearningDecisionFacts>;
|
|
43
|
+
export declare const GovernedLearningDecision: z.ZodObject<{
|
|
44
|
+
outcome: z.ZodEnum<{
|
|
45
|
+
automatic: "automatic";
|
|
46
|
+
confidence: "confidence";
|
|
47
|
+
conflict: "conflict";
|
|
48
|
+
off: "off";
|
|
49
|
+
revoked: "revoked";
|
|
50
|
+
stale: "stale";
|
|
51
|
+
suggest: "suggest";
|
|
52
|
+
}>;
|
|
53
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
54
|
+
confidence_below_floor: "confidence_below_floor";
|
|
55
|
+
evidence_conflict: "evidence_conflict";
|
|
56
|
+
evidence_revoked: "evidence_revoked";
|
|
57
|
+
policy_automatic: "policy_automatic";
|
|
58
|
+
policy_off: "policy_off";
|
|
59
|
+
policy_suggest: "policy_suggest";
|
|
60
|
+
proposal_stale: "proposal_stale";
|
|
61
|
+
}>>;
|
|
62
|
+
automaticEligible: z.ZodBoolean;
|
|
63
|
+
confidenceFloorBps: z.ZodLiteral<8500>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type GovernedLearningDecision = z.infer<typeof GovernedLearningDecision>;
|
|
66
|
+
export declare const GovernedLearningEvaluationAttempt: z.ZodObject<{
|
|
67
|
+
workspaceId: z.ZodString;
|
|
68
|
+
subjectId: z.ZodString;
|
|
69
|
+
sessionId: z.ZodString;
|
|
70
|
+
turnId: z.ZodString;
|
|
71
|
+
attemptId: z.ZodString;
|
|
72
|
+
executionGeneration: z.ZodNumber;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export type GovernedLearningEvaluationAttempt = z.infer<typeof GovernedLearningEvaluationAttempt>;
|
|
75
|
+
export declare const EvaluateGovernedLearningProposalRequest: z.ZodObject<{
|
|
76
|
+
operationId: z.ZodString;
|
|
77
|
+
policySnapshotId: z.ZodString;
|
|
78
|
+
proposalId: z.ZodString;
|
|
79
|
+
claimId: z.ZodString;
|
|
80
|
+
evidenceId: z.ZodString;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type EvaluateGovernedLearningProposalRequest = z.infer<typeof EvaluateGovernedLearningProposalRequest>;
|
|
83
|
+
/**
|
|
84
|
+
* Content-free immutable evidence. Hashes and bounded enums identify exactly
|
|
85
|
+
* what was evaluated without copying proposal, fact, citation, or note text.
|
|
86
|
+
*/
|
|
87
|
+
export declare const GovernedLearningDecisionReceipt: z.ZodObject<{
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
operationId: z.ZodString;
|
|
90
|
+
inputHash: z.ZodString;
|
|
91
|
+
accountId: z.ZodString;
|
|
92
|
+
workspaceId: z.ZodString;
|
|
93
|
+
sessionId: z.ZodString;
|
|
94
|
+
turnId: z.ZodString;
|
|
95
|
+
attemptId: z.ZodString;
|
|
96
|
+
executionGeneration: z.ZodNumber;
|
|
97
|
+
initiatingHumanSubjectId: z.ZodString;
|
|
98
|
+
policySnapshotId: z.ZodString;
|
|
99
|
+
policySnapshotHash: z.ZodString;
|
|
100
|
+
policyRevisionId: z.ZodNullable<z.ZodString>;
|
|
101
|
+
policyActivationVersion: z.ZodNumber;
|
|
102
|
+
sourceKind: z.ZodEnum<{
|
|
103
|
+
"scoped-knowledge-evidence": "scoped-knowledge-evidence";
|
|
104
|
+
"task-note": "task-note";
|
|
105
|
+
}>;
|
|
106
|
+
sourceId: z.ZodString;
|
|
107
|
+
proposalId: z.ZodString;
|
|
108
|
+
proposalInputHash: z.ZodString;
|
|
109
|
+
proposalContentHash: z.ZodString;
|
|
110
|
+
claimId: z.ZodString;
|
|
111
|
+
claimInputHash: z.ZodString;
|
|
112
|
+
evidenceId: z.ZodString;
|
|
113
|
+
evidenceInputHash: z.ZodString;
|
|
114
|
+
evidenceContentHash: z.ZodString;
|
|
115
|
+
evidenceAuthorityHash: z.ZodString;
|
|
116
|
+
reviewRevision: z.ZodNumber;
|
|
117
|
+
reviewState: z.ZodEnum<{
|
|
118
|
+
approved: "approved";
|
|
119
|
+
proposed: "proposed";
|
|
120
|
+
rejected: "rejected";
|
|
121
|
+
revoked: "revoked";
|
|
122
|
+
}>;
|
|
123
|
+
effectiveMode: z.ZodEnum<{
|
|
124
|
+
automatic: "automatic";
|
|
125
|
+
off: "off";
|
|
126
|
+
suggest: "suggest";
|
|
127
|
+
}>;
|
|
128
|
+
confidenceBps: z.ZodNumber;
|
|
129
|
+
conflictCount: z.ZodNumber;
|
|
130
|
+
outcome: z.ZodEnum<{
|
|
131
|
+
automatic: "automatic";
|
|
132
|
+
confidence: "confidence";
|
|
133
|
+
conflict: "conflict";
|
|
134
|
+
off: "off";
|
|
135
|
+
revoked: "revoked";
|
|
136
|
+
stale: "stale";
|
|
137
|
+
suggest: "suggest";
|
|
138
|
+
}>;
|
|
139
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
140
|
+
confidence_below_floor: "confidence_below_floor";
|
|
141
|
+
evidence_conflict: "evidence_conflict";
|
|
142
|
+
evidence_revoked: "evidence_revoked";
|
|
143
|
+
policy_automatic: "policy_automatic";
|
|
144
|
+
policy_off: "policy_off";
|
|
145
|
+
policy_suggest: "policy_suggest";
|
|
146
|
+
proposal_stale: "proposal_stale";
|
|
147
|
+
}>>;
|
|
148
|
+
automaticEligible: z.ZodBoolean;
|
|
149
|
+
confidenceFloorBps: z.ZodLiteral<8500>;
|
|
150
|
+
createdAt: z.ZodString;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
export type GovernedLearningDecisionReceipt = z.infer<typeof GovernedLearningDecisionReceipt>;
|