@opengeni/contracts 0.39.0 → 0.44.1
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/atlassian.d.ts +278 -0
- package/dist/atlassian.js +55 -0
- package/dist/atlassian.js.map +1 -0
- package/dist/chunk-52SGB2QO.js +688 -0
- package/dist/chunk-52SGB2QO.js.map +1 -0
- package/dist/{chunk-7JZMI22I.js → chunk-5UDNP7AO.js} +34 -2
- package/dist/chunk-5UDNP7AO.js.map +1 -0
- package/dist/chunk-BVGIYW7D.js +11 -0
- package/dist/chunk-BVGIYW7D.js.map +1 -0
- package/dist/chunk-CADSX6UN.js +1145 -0
- package/dist/chunk-CADSX6UN.js.map +1 -0
- package/dist/chunk-D2HKF2EF.js +1460 -0
- package/dist/chunk-D2HKF2EF.js.map +1 -0
- package/dist/chunk-FJBG5E4O.js +194 -0
- package/dist/chunk-FJBG5E4O.js.map +1 -0
- package/dist/chunk-H5BVCZKF.js +382 -0
- package/dist/chunk-H5BVCZKF.js.map +1 -0
- package/dist/chunk-LSB7GRLG.js +779 -0
- package/dist/chunk-LSB7GRLG.js.map +1 -0
- package/dist/chunk-MYBZRDTY.js +340 -0
- package/dist/chunk-MYBZRDTY.js.map +1 -0
- package/dist/chunk-RIY7GYQS.js +1204 -0
- package/dist/chunk-RIY7GYQS.js.map +1 -0
- package/dist/chunk-TZ6YEYN4.js +386 -0
- package/dist/chunk-TZ6YEYN4.js.map +1 -0
- package/dist/chunk-VA22KRHS.js +15177 -0
- package/dist/chunk-VA22KRHS.js.map +1 -0
- package/dist/chunk-Y3MLSLB4.js +392 -0
- package/dist/chunk-Y3MLSLB4.js.map +1 -0
- package/dist/chunk-YRKRZ6OF.js +134 -0
- package/dist/chunk-YRKRZ6OF.js.map +1 -0
- package/dist/company-profile.d.ts +629 -0
- package/dist/document-artifact-commands.d.ts +282 -0
- package/dist/document-artifact-commands.js +54 -0
- package/dist/document-artifact-commands.js.map +1 -0
- package/dist/document-artifact-query.d.ts +2 -0
- package/dist/document-artifact-query.js +54 -0
- package/dist/document-artifact-query.js.map +1 -0
- package/dist/editable-artifact-binary.d.ts +56 -0
- package/dist/editable-artifact-causal-frontier.d.ts +12 -0
- package/dist/editable-artifact-causal-frontier.js +18 -0
- package/dist/editable-artifact-causal-frontier.js.map +1 -0
- package/dist/editable-artifact-codec-registry.d.ts +48 -0
- package/dist/editable-artifact-codec-registry.js +20 -0
- package/dist/editable-artifact-codec-registry.js.map +1 -0
- package/dist/editable-artifact-committed-transaction.d.ts +35 -0
- package/dist/editable-artifact-committed-transaction.js +19 -0
- package/dist/editable-artifact-committed-transaction.js.map +1 -0
- package/dist/editable-artifact-live.d.ts +276 -0
- package/dist/editable-artifact-live.js +907 -0
- package/dist/editable-artifact-live.js.map +1 -0
- package/dist/editable-artifact-serialized-commit.d.ts +53 -0
- package/dist/editable-artifact-serialized-commit.js +26 -0
- package/dist/editable-artifact-serialized-commit.js.map +1 -0
- package/dist/editable-artifact-versions.d.ts +6 -0
- package/dist/editable-artifact-versions.js +11 -0
- package/dist/editable-artifact-versions.js.map +1 -0
- package/dist/editable-artifacts.d.ts +46 -0
- package/dist/editable-artifacts.js +236 -0
- package/dist/editable-artifacts.js.map +1 -0
- package/dist/event-preview.d.ts +7 -7
- package/dist/google-drive.d.ts +114 -2
- package/dist/google-drive.js +70 -14
- package/dist/google-drive.js.map +1 -1
- package/dist/image-generation.d.ts +70 -0
- package/dist/index.d.ts +5180 -329
- package/dist/index.js +1173 -40
- package/dist/interaction.d.ts +6895 -0
- package/dist/mcp-receipts.d.ts +96 -0
- package/dist/memory-slack-delivery.d.ts +397 -0
- package/dist/presentation-artifact-commands.d.ts +349 -0
- package/dist/presentation-artifact-commands.js +66 -0
- package/dist/presentation-artifact-commands.js.map +1 -0
- package/dist/presentation-artifact-query.d.ts +2 -0
- package/dist/presentation-artifact-query.js +66 -0
- package/dist/presentation-artifact-query.js.map +1 -0
- package/dist/retained-output.d.ts +83 -6
- package/dist/sandbox-snapshots.d.ts +9 -0
- package/dist/scoped-knowledge.d.ts +14 -13
- package/dist/slack-bot-scopes.d.ts +4 -0
- package/dist/slack-bot-scopes.js +3 -1
- package/dist/spreadsheet-artifact-commands.d.ts +101 -0
- package/dist/spreadsheet-artifact-commands.js +27 -0
- package/dist/spreadsheet-artifact-commands.js.map +1 -0
- package/dist/spreadsheet-artifact-date.d.ts +4 -0
- package/dist/spreadsheet-artifact-query.d.ts +120 -0
- package/dist/spreadsheet-artifact-query.js +48 -0
- package/dist/spreadsheet-artifact-query.js.map +1 -0
- package/dist/tool-catalog.d.ts +576 -0
- package/dist/video-generation.d.ts +532 -0
- package/dist/video-generation.js +51 -0
- package/dist/video-generation.js.map +1 -0
- package/dist/workspace-learning-policy.d.ts +208 -0
- package/package.json +61 -1
- package/src/atlassian.ts +160 -0
- package/src/company-profile.ts +306 -0
- package/src/document-artifact-commands.ts +1709 -0
- package/src/document-artifact-query.ts +2 -0
- package/src/editable-artifact-binary.ts +396 -0
- package/src/editable-artifact-causal-frontier.ts +154 -0
- package/src/editable-artifact-codec-registry.ts +261 -0
- package/src/editable-artifact-committed-transaction.ts +478 -0
- package/src/editable-artifact-live.ts +1379 -0
- package/src/editable-artifact-serialized-commit.ts +494 -0
- package/src/editable-artifact-versions.ts +8 -0
- package/src/editable-artifacts.ts +473 -0
- package/src/event-preview.ts +6 -6
- package/src/google-drive.ts +68 -15
- package/src/image-generation.ts +106 -0
- package/src/index.ts +2535 -282
- package/src/interaction.ts +2292 -0
- package/src/mcp-receipts.ts +281 -0
- package/src/memory-slack-delivery.ts +183 -0
- package/src/presentation-artifact-commands.ts +2035 -0
- package/src/presentation-artifact-query.ts +2 -0
- package/src/retained-output.ts +248 -8
- package/src/sandbox-snapshots.ts +28 -1
- package/src/scoped-knowledge.ts +18 -4
- package/src/slack-bot-scopes.ts +34 -1
- package/src/spreadsheet-artifact-commands.ts +999 -0
- package/src/spreadsheet-artifact-date.ts +21 -0
- package/src/spreadsheet-artifact-query.ts +1411 -0
- package/src/tool-catalog.ts +334 -0
- package/src/video-generation.ts +394 -0
- package/src/workspace-learning-policy.ts +233 -0
- package/dist/chunk-7JZMI22I.js.map +0 -1
- package/dist/chunk-PCTCJEAF.js +0 -10799
- package/dist/chunk-PCTCJEAF.js.map +0 -1
- package/dist/secret-redaction.d.ts +0 -40
- package/src/secret-redaction.ts +0 -364
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const COMPANY_PROFILE_SCALAR_MAX_CHARS = 2_048;
|
|
4
|
+
export const COMPANY_PROFILE_ENTRY_MAX_CHARS = 1_024;
|
|
5
|
+
export const COMPANY_PROFILE_ENTRY_MAX_COUNT = 16;
|
|
6
|
+
export const COMPANY_PROFILE_STABLE_KEY_MAX_CHARS = 96;
|
|
7
|
+
export const COMPANY_PROFILE_REASON_MAX_CHARS = 4_096;
|
|
8
|
+
export const COMPANY_PROFILE_SOURCE_ID_MAX_CHARS = 512;
|
|
9
|
+
export const COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES = 28_672;
|
|
10
|
+
export const COMPANY_PROFILE_PROMPT_MAX_UTF8_BYTES = 32_768;
|
|
11
|
+
|
|
12
|
+
export const CompanyProfileStableKey = z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(COMPANY_PROFILE_STABLE_KEY_MAX_CHARS)
|
|
16
|
+
.regex(/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/);
|
|
17
|
+
export type CompanyProfileStableKey = z.infer<typeof CompanyProfileStableKey>;
|
|
18
|
+
|
|
19
|
+
export function normalizeCompanyProfileStableKey(value: string): string {
|
|
20
|
+
return value.normalize("NFKC").trim().toLowerCase().replace(/\s+/gu, "-").replace(/-+/g, "-");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const CompanyProfileStableKeyInput = z
|
|
24
|
+
.string()
|
|
25
|
+
.transform(normalizeCompanyProfileStableKey)
|
|
26
|
+
.pipe(CompanyProfileStableKey);
|
|
27
|
+
|
|
28
|
+
export const CompanyProfileEntry = z.object({
|
|
29
|
+
key: CompanyProfileStableKeyInput,
|
|
30
|
+
content: z
|
|
31
|
+
.string()
|
|
32
|
+
.min(1)
|
|
33
|
+
.max(COMPANY_PROFILE_ENTRY_MAX_CHARS)
|
|
34
|
+
.refine((value) => value.trim().length > 0, "company-profile entries must not be blank"),
|
|
35
|
+
});
|
|
36
|
+
export type CompanyProfileEntry = z.infer<typeof CompanyProfileEntry>;
|
|
37
|
+
|
|
38
|
+
function boundedScalar() {
|
|
39
|
+
return z
|
|
40
|
+
.string()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(COMPANY_PROFILE_SCALAR_MAX_CHARS)
|
|
43
|
+
.refine((value) => value.trim().length > 0, "company-profile scalar content must not be blank")
|
|
44
|
+
.nullable();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function uniqueEntryKeys(
|
|
48
|
+
entries: CompanyProfileEntry[],
|
|
49
|
+
field: "products" | "customers" | "goals" | "constraints",
|
|
50
|
+
context: z.RefinementCtx,
|
|
51
|
+
): void {
|
|
52
|
+
const seen = new Set<string>();
|
|
53
|
+
for (const [index, entry] of entries.entries()) {
|
|
54
|
+
if (seen.has(entry.key)) {
|
|
55
|
+
context.addIssue({
|
|
56
|
+
code: "custom",
|
|
57
|
+
path: [field, index, "key"],
|
|
58
|
+
message: `duplicate company-profile ${field} key`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
seen.add(entry.key);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const CompanyProfileContent = z
|
|
66
|
+
.object({
|
|
67
|
+
identity: boundedScalar(),
|
|
68
|
+
mission: boundedScalar(),
|
|
69
|
+
products: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
70
|
+
customers: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
71
|
+
goals: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
72
|
+
constraints: z.array(CompanyProfileEntry).max(COMPANY_PROFILE_ENTRY_MAX_COUNT),
|
|
73
|
+
})
|
|
74
|
+
.strict()
|
|
75
|
+
.superRefine((value, context) => {
|
|
76
|
+
uniqueEntryKeys(value.products, "products", context);
|
|
77
|
+
uniqueEntryKeys(value.customers, "customers", context);
|
|
78
|
+
uniqueEntryKeys(value.goals, "goals", context);
|
|
79
|
+
uniqueEntryKeys(value.constraints, "constraints", context);
|
|
80
|
+
if (
|
|
81
|
+
value.identity === null &&
|
|
82
|
+
value.mission === null &&
|
|
83
|
+
value.products.length === 0 &&
|
|
84
|
+
value.customers.length === 0 &&
|
|
85
|
+
value.goals.length === 0 &&
|
|
86
|
+
value.constraints.length === 0
|
|
87
|
+
) {
|
|
88
|
+
context.addIssue({
|
|
89
|
+
code: "custom",
|
|
90
|
+
message: "a company profile must contain at least one field",
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const contentBytes = new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
94
|
+
if (contentBytes > COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES) {
|
|
95
|
+
context.addIssue({
|
|
96
|
+
code: "custom",
|
|
97
|
+
message: `company profile is ${contentBytes} UTF-8 bytes; limit is ${COMPANY_PROFILE_CONTENT_MAX_UTF8_BYTES}`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export type CompanyProfileContent = z.infer<typeof CompanyProfileContent>;
|
|
102
|
+
|
|
103
|
+
export const CompanyProfileRevisionIntent = z.enum(["active", "proposal"]);
|
|
104
|
+
export type CompanyProfileRevisionIntent = z.infer<typeof CompanyProfileRevisionIntent>;
|
|
105
|
+
|
|
106
|
+
export const CompanyProfileProvenanceSource = z.enum(["human", "durable_learning", "migration"]);
|
|
107
|
+
export type CompanyProfileProvenanceSource = z.infer<typeof CompanyProfileProvenanceSource>;
|
|
108
|
+
|
|
109
|
+
export const CompanyProfilePrincipalKind = z.enum(["human_session", "agent_attempt", "service"]);
|
|
110
|
+
export type CompanyProfilePrincipalKind = z.infer<typeof CompanyProfilePrincipalKind>;
|
|
111
|
+
|
|
112
|
+
export const CompanyProfileActivationType = z.enum(["activate", "rollback"]);
|
|
113
|
+
export type CompanyProfileActivationType = z.infer<typeof CompanyProfileActivationType>;
|
|
114
|
+
|
|
115
|
+
export const CompanyProfileRevisionIdentity = z.object({
|
|
116
|
+
id: z.string().uuid(),
|
|
117
|
+
revision: z.number().int().positive(),
|
|
118
|
+
contentHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
119
|
+
});
|
|
120
|
+
export type CompanyProfileRevisionIdentity = z.infer<typeof CompanyProfileRevisionIdentity>;
|
|
121
|
+
|
|
122
|
+
export const CompanyProfileRevision = CompanyProfileRevisionIdentity.extend({
|
|
123
|
+
operationId: z.string().uuid(),
|
|
124
|
+
accountId: z.string().uuid(),
|
|
125
|
+
intent: CompanyProfileRevisionIntent,
|
|
126
|
+
profile: CompanyProfileContent,
|
|
127
|
+
provenance: z.object({
|
|
128
|
+
source: CompanyProfileProvenanceSource,
|
|
129
|
+
sourceId: z.string().min(1).max(COMPANY_PROFILE_SOURCE_ID_MAX_CHARS).nullable(),
|
|
130
|
+
}),
|
|
131
|
+
supersedesRevisionId: z.string().uuid().nullable(),
|
|
132
|
+
createdBySubjectId: z.string().min(1).max(1_024),
|
|
133
|
+
createdAt: z.string().datetime(),
|
|
134
|
+
});
|
|
135
|
+
export type CompanyProfileRevision = z.infer<typeof CompanyProfileRevision>;
|
|
136
|
+
|
|
137
|
+
export const CompanyProfileHead = z.object({
|
|
138
|
+
accountId: z.string().uuid(),
|
|
139
|
+
revisionId: z.string().uuid(),
|
|
140
|
+
revision: z.number().int().positive(),
|
|
141
|
+
contentHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
142
|
+
activationVersion: z.number().int().positive(),
|
|
143
|
+
activatedAt: z.string().datetime(),
|
|
144
|
+
});
|
|
145
|
+
export type CompanyProfileHead = z.infer<typeof CompanyProfileHead>;
|
|
146
|
+
|
|
147
|
+
export const CompanyProfileActivationEvent = z.object({
|
|
148
|
+
id: z.string().uuid(),
|
|
149
|
+
operationId: z.string().uuid(),
|
|
150
|
+
accountId: z.string().uuid(),
|
|
151
|
+
type: CompanyProfileActivationType,
|
|
152
|
+
activationVersion: z.number().int().positive(),
|
|
153
|
+
oldRevision: CompanyProfileRevisionIdentity.nullable(),
|
|
154
|
+
newRevision: CompanyProfileRevisionIdentity.nullable(),
|
|
155
|
+
actorSubjectId: z.string().min(1).max(1_024),
|
|
156
|
+
reason: z.string().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
157
|
+
createdAt: z.string().datetime(),
|
|
158
|
+
});
|
|
159
|
+
export type CompanyProfileActivationEvent = z.infer<typeof CompanyProfileActivationEvent>;
|
|
160
|
+
|
|
161
|
+
export const CompanyProfileSnapshotEntry = CompanyProfileRevisionIdentity.extend({
|
|
162
|
+
activationVersion: z.number().int().positive(),
|
|
163
|
+
activatedAt: z.string().datetime(),
|
|
164
|
+
provenance: z.object({
|
|
165
|
+
source: CompanyProfileProvenanceSource,
|
|
166
|
+
sourceIdHash: z
|
|
167
|
+
.string()
|
|
168
|
+
.regex(/^[0-9a-f]{64}$/)
|
|
169
|
+
.nullable(),
|
|
170
|
+
}),
|
|
171
|
+
});
|
|
172
|
+
export type CompanyProfileSnapshotEntry = z.infer<typeof CompanyProfileSnapshotEntry>;
|
|
173
|
+
|
|
174
|
+
export const CompanyProfileSnapshot = z.object({
|
|
175
|
+
id: z.string().uuid(),
|
|
176
|
+
accountId: z.string().uuid(),
|
|
177
|
+
workspaceId: z.string().uuid(),
|
|
178
|
+
sessionId: z.string().uuid(),
|
|
179
|
+
turnId: z.string().uuid(),
|
|
180
|
+
attemptId: z.string().uuid(),
|
|
181
|
+
executionGeneration: z.number().int().positive(),
|
|
182
|
+
profile: CompanyProfileSnapshotEntry.nullable(),
|
|
183
|
+
snapshotHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
184
|
+
createdAt: z.string().datetime(),
|
|
185
|
+
});
|
|
186
|
+
export type CompanyProfileSnapshot = z.infer<typeof CompanyProfileSnapshot>;
|
|
187
|
+
|
|
188
|
+
export const ResolvedCompanyProfileSnapshot = CompanyProfileSnapshot.extend({
|
|
189
|
+
profile: CompanyProfileSnapshotEntry.extend({ profile: CompanyProfileContent }).nullable(),
|
|
190
|
+
});
|
|
191
|
+
export type ResolvedCompanyProfileSnapshot = z.infer<typeof ResolvedCompanyProfileSnapshot>;
|
|
192
|
+
|
|
193
|
+
export const CompanyProfileListQuery = z.object({
|
|
194
|
+
afterRevision: z.coerce.number().int().positive().optional(),
|
|
195
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
196
|
+
});
|
|
197
|
+
export type CompanyProfileListQuery = z.infer<typeof CompanyProfileListQuery>;
|
|
198
|
+
|
|
199
|
+
export const CompanyProfileListResponse = z.object({
|
|
200
|
+
current: CompanyProfileHead.nullable(),
|
|
201
|
+
activeRevision: CompanyProfileRevision.nullable(),
|
|
202
|
+
revisions: z.array(CompanyProfileRevision),
|
|
203
|
+
activationEvents: z.array(CompanyProfileActivationEvent),
|
|
204
|
+
nextAfterRevision: z.number().int().positive().nullable(),
|
|
205
|
+
});
|
|
206
|
+
export type CompanyProfileListResponse = z.infer<typeof CompanyProfileListResponse>;
|
|
207
|
+
|
|
208
|
+
export const UpdateCompanyProfileRequest = z.object({
|
|
209
|
+
operationId: z.string().uuid().optional(),
|
|
210
|
+
profile: CompanyProfileContent,
|
|
211
|
+
expectedCurrentRevisionId: z.string().uuid().nullable(),
|
|
212
|
+
expectedActivationVersion: z.number().int().nonnegative(),
|
|
213
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
214
|
+
});
|
|
215
|
+
export type UpdateCompanyProfileRequest = z.infer<typeof UpdateCompanyProfileRequest>;
|
|
216
|
+
|
|
217
|
+
export const ActivateCompanyProfileRevisionRequest = z.object({
|
|
218
|
+
operationId: z.string().uuid().optional(),
|
|
219
|
+
expectedCurrentRevisionId: z.string().uuid().nullable(),
|
|
220
|
+
expectedActivationVersion: z.number().int().nonnegative(),
|
|
221
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
222
|
+
});
|
|
223
|
+
export type ActivateCompanyProfileRevisionRequest = z.infer<
|
|
224
|
+
typeof ActivateCompanyProfileRevisionRequest
|
|
225
|
+
>;
|
|
226
|
+
|
|
227
|
+
export const RollbackCompanyProfileRequest = z.object({
|
|
228
|
+
operationId: z.string().uuid().optional(),
|
|
229
|
+
targetRevisionId: z.string().uuid(),
|
|
230
|
+
expectedCurrentRevisionId: z.string().uuid(),
|
|
231
|
+
expectedActivationVersion: z.number().int().positive(),
|
|
232
|
+
reason: z.string().trim().min(1).max(COMPANY_PROFILE_REASON_MAX_CHARS),
|
|
233
|
+
});
|
|
234
|
+
export type RollbackCompanyProfileRequest = z.infer<typeof RollbackCompanyProfileRequest>;
|
|
235
|
+
|
|
236
|
+
export const CompanyProfileMutationResponse = z.object({
|
|
237
|
+
revision: CompanyProfileRevision.nullable(),
|
|
238
|
+
head: CompanyProfileHead.nullable(),
|
|
239
|
+
event: CompanyProfileActivationEvent.nullable(),
|
|
240
|
+
});
|
|
241
|
+
export type CompanyProfileMutationResponse = z.infer<typeof CompanyProfileMutationResponse>;
|
|
242
|
+
|
|
243
|
+
export const CompanyProfileDiffRequest = z
|
|
244
|
+
.object({ fromRevisionId: z.string().uuid(), toRevisionId: z.string().uuid() })
|
|
245
|
+
.refine((value) => value.fromRevisionId !== value.toRevisionId, {
|
|
246
|
+
path: ["toRevisionId"],
|
|
247
|
+
message: "diff revisions must be different",
|
|
248
|
+
});
|
|
249
|
+
export type CompanyProfileDiffRequest = z.infer<typeof CompanyProfileDiffRequest>;
|
|
250
|
+
|
|
251
|
+
export const CompanyProfileDiffResponse = z.object({
|
|
252
|
+
from: CompanyProfileRevision,
|
|
253
|
+
to: CompanyProfileRevision,
|
|
254
|
+
format: z.literal("unified_json"),
|
|
255
|
+
diff: z.string(),
|
|
256
|
+
});
|
|
257
|
+
export type CompanyProfileDiffResponse = z.infer<typeof CompanyProfileDiffResponse>;
|
|
258
|
+
|
|
259
|
+
export const CompanyProfileConflictResponse = z.object({
|
|
260
|
+
code: z.literal("COMPANY_PROFILE_CONFLICT"),
|
|
261
|
+
message: z.string(),
|
|
262
|
+
currentHead: CompanyProfileHead.nullable(),
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export const CompanyProfileOperationReuseResponse = z.object({
|
|
266
|
+
code: z.literal("COMPANY_PROFILE_OPERATION_REUSED"),
|
|
267
|
+
message: z.string(),
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
export const CompanyProfileLearningSubjectKind = z.enum([
|
|
271
|
+
"company_identity",
|
|
272
|
+
"company_mission",
|
|
273
|
+
"company_product",
|
|
274
|
+
"company_customer",
|
|
275
|
+
"company_goal",
|
|
276
|
+
"company_constraint",
|
|
277
|
+
]);
|
|
278
|
+
export type CompanyProfileLearningSubjectKind = z.infer<typeof CompanyProfileLearningSubjectKind>;
|
|
279
|
+
|
|
280
|
+
const CompanyProfileScalarLearningSubject = z.object({
|
|
281
|
+
kind: z.enum(["company_identity", "company_mission"]),
|
|
282
|
+
content: z.string().trim().min(1).max(COMPANY_PROFILE_SCALAR_MAX_CHARS),
|
|
283
|
+
stableKey: z.null(),
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
const CompanyProfileRepeatableLearningSubject = z.object({
|
|
287
|
+
kind: z.enum(["company_product", "company_customer", "company_goal", "company_constraint"]),
|
|
288
|
+
content: z.string().trim().min(1).max(COMPANY_PROFILE_ENTRY_MAX_CHARS),
|
|
289
|
+
stableKey: CompanyProfileStableKeyInput,
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
/** Authority-native seam invoked only by the canonical durable-learning router adapter. */
|
|
293
|
+
export const CompanyProfileLearningWrite = z.object({
|
|
294
|
+
operationId: z.string().uuid(),
|
|
295
|
+
accountId: z.string().uuid(),
|
|
296
|
+
workspaceId: z.string().uuid(),
|
|
297
|
+
actorSubjectId: z.string().min(1).max(1_024),
|
|
298
|
+
actorKind: z.enum(["human", "agent", "service"]),
|
|
299
|
+
authority: z.enum(["active", "proposal"]),
|
|
300
|
+
subject: z.discriminatedUnion("kind", [
|
|
301
|
+
CompanyProfileScalarLearningSubject,
|
|
302
|
+
CompanyProfileRepeatableLearningSubject,
|
|
303
|
+
]),
|
|
304
|
+
sourceId: z.string().min(1).max(COMPANY_PROFILE_SOURCE_ID_MAX_CHARS),
|
|
305
|
+
});
|
|
306
|
+
export type CompanyProfileLearningWrite = z.infer<typeof CompanyProfileLearningWrite>;
|