@opengeni/contracts 0.26.1 → 0.27.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.
@@ -0,0 +1,303 @@
1
+ import { z } from "zod";
2
+ export declare const WORKSPACE_ARTIFACT_HTML_MAX_UTF8_BYTES: number;
3
+ export declare const WORKSPACE_ARTIFACT_TITLE_MAX_CHARS = 120;
4
+ export declare const WORKSPACE_ARTIFACT_DESCRIPTION_MAX_CHARS = 2000;
5
+ export declare const WORKSPACE_ARTIFACT_LIST_MAX = 100;
6
+ export declare const WORKSPACE_ARTIFACT_LIST_DEFAULT = 50;
7
+ export declare const WORKSPACE_ARTIFACT_CURSOR_MAX_CHARS = 512;
8
+ export declare const WorkspaceArtifactSlug: z.ZodString;
9
+ export type WorkspaceArtifactSlug = z.infer<typeof WorkspaceArtifactSlug>;
10
+ export declare const WorkspaceArtifactStatus: z.ZodEnum<{
11
+ active: "active";
12
+ archived: "archived";
13
+ }>;
14
+ export type WorkspaceArtifactStatus = z.infer<typeof WorkspaceArtifactStatus>;
15
+ export declare const WorkspaceArtifactVersion: z.ZodObject<{
16
+ id: z.ZodString;
17
+ accountId: z.ZodString;
18
+ workspaceId: z.ZodString;
19
+ artifactId: z.ZodString;
20
+ revision: z.ZodNumber;
21
+ contentType: z.ZodLiteral<"text/html">;
22
+ contentSha256: z.ZodString;
23
+ sizeBytes: z.ZodNumber;
24
+ sourceSessionId: z.ZodNullable<z.ZodString>;
25
+ sourceTurnId: z.ZodNullable<z.ZodString>;
26
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
27
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
28
+ createdBySubjectId: z.ZodString;
29
+ createdAt: z.ZodString;
30
+ }, z.core.$strip>;
31
+ export type WorkspaceArtifactVersion = z.infer<typeof WorkspaceArtifactVersion>;
32
+ export declare const WorkspaceArtifact: z.ZodObject<{
33
+ id: z.ZodString;
34
+ accountId: z.ZodString;
35
+ workspaceId: z.ZodString;
36
+ slug: z.ZodString;
37
+ title: z.ZodString;
38
+ description: z.ZodNullable<z.ZodString>;
39
+ status: z.ZodEnum<{
40
+ active: "active";
41
+ archived: "archived";
42
+ }>;
43
+ currentVersion: z.ZodNullable<z.ZodObject<{
44
+ id: z.ZodString;
45
+ accountId: z.ZodString;
46
+ workspaceId: z.ZodString;
47
+ artifactId: z.ZodString;
48
+ revision: z.ZodNumber;
49
+ contentType: z.ZodLiteral<"text/html">;
50
+ contentSha256: z.ZodString;
51
+ sizeBytes: z.ZodNumber;
52
+ sourceSessionId: z.ZodNullable<z.ZodString>;
53
+ sourceTurnId: z.ZodNullable<z.ZodString>;
54
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
55
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
56
+ createdBySubjectId: z.ZodString;
57
+ createdAt: z.ZodString;
58
+ }, z.core.$strip>>;
59
+ createdBySubjectId: z.ZodString;
60
+ createdAt: z.ZodString;
61
+ updatedAt: z.ZodString;
62
+ }, z.core.$strip>;
63
+ export type WorkspaceArtifact = z.infer<typeof WorkspaceArtifact>;
64
+ export declare const WorkspaceArtifactEventType: z.ZodEnum<{
65
+ published: "published";
66
+ rolled_back: "rolled_back";
67
+ }>;
68
+ export type WorkspaceArtifactEventType = z.infer<typeof WorkspaceArtifactEventType>;
69
+ export declare const WorkspaceArtifactEvent: z.ZodObject<{
70
+ id: z.ZodString;
71
+ accountId: z.ZodString;
72
+ workspaceId: z.ZodString;
73
+ artifactId: z.ZodString;
74
+ type: z.ZodEnum<{
75
+ published: "published";
76
+ rolled_back: "rolled_back";
77
+ }>;
78
+ fromVersionId: z.ZodNullable<z.ZodString>;
79
+ toVersionId: z.ZodString;
80
+ sourceSessionId: z.ZodNullable<z.ZodString>;
81
+ sourceTurnId: z.ZodNullable<z.ZodString>;
82
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
83
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
84
+ actorSubjectId: z.ZodString;
85
+ reason: z.ZodString;
86
+ createdAt: z.ZodString;
87
+ }, z.core.$strip>;
88
+ export type WorkspaceArtifactEvent = z.infer<typeof WorkspaceArtifactEvent>;
89
+ export declare const WorkspaceArtifactListQuery: z.ZodObject<{
90
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
91
+ cursor: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>;
93
+ export type WorkspaceArtifactListQuery = z.infer<typeof WorkspaceArtifactListQuery>;
94
+ export declare const WorkspaceArtifactListResponse: z.ZodObject<{
95
+ artifacts: z.ZodArray<z.ZodObject<{
96
+ id: z.ZodString;
97
+ accountId: z.ZodString;
98
+ workspaceId: z.ZodString;
99
+ slug: z.ZodString;
100
+ title: z.ZodString;
101
+ description: z.ZodNullable<z.ZodString>;
102
+ status: z.ZodEnum<{
103
+ active: "active";
104
+ archived: "archived";
105
+ }>;
106
+ currentVersion: z.ZodNullable<z.ZodObject<{
107
+ id: z.ZodString;
108
+ accountId: z.ZodString;
109
+ workspaceId: z.ZodString;
110
+ artifactId: z.ZodString;
111
+ revision: z.ZodNumber;
112
+ contentType: z.ZodLiteral<"text/html">;
113
+ contentSha256: z.ZodString;
114
+ sizeBytes: z.ZodNumber;
115
+ sourceSessionId: z.ZodNullable<z.ZodString>;
116
+ sourceTurnId: z.ZodNullable<z.ZodString>;
117
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
118
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
119
+ createdBySubjectId: z.ZodString;
120
+ createdAt: z.ZodString;
121
+ }, z.core.$strip>>;
122
+ createdBySubjectId: z.ZodString;
123
+ createdAt: z.ZodString;
124
+ updatedAt: z.ZodString;
125
+ }, z.core.$strip>>;
126
+ nextCursor: z.ZodNullable<z.ZodString>;
127
+ truncated: z.ZodBoolean;
128
+ }, z.core.$strip>;
129
+ export type WorkspaceArtifactListResponse = z.infer<typeof WorkspaceArtifactListResponse>;
130
+ export declare const WorkspaceArtifactDetailResponse: z.ZodObject<{
131
+ artifact: z.ZodObject<{
132
+ id: z.ZodString;
133
+ accountId: z.ZodString;
134
+ workspaceId: z.ZodString;
135
+ slug: z.ZodString;
136
+ title: z.ZodString;
137
+ description: z.ZodNullable<z.ZodString>;
138
+ status: z.ZodEnum<{
139
+ active: "active";
140
+ archived: "archived";
141
+ }>;
142
+ currentVersion: z.ZodNullable<z.ZodObject<{
143
+ id: z.ZodString;
144
+ accountId: z.ZodString;
145
+ workspaceId: z.ZodString;
146
+ artifactId: z.ZodString;
147
+ revision: z.ZodNumber;
148
+ contentType: z.ZodLiteral<"text/html">;
149
+ contentSha256: z.ZodString;
150
+ sizeBytes: z.ZodNumber;
151
+ sourceSessionId: z.ZodNullable<z.ZodString>;
152
+ sourceTurnId: z.ZodNullable<z.ZodString>;
153
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
154
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
155
+ createdBySubjectId: z.ZodString;
156
+ createdAt: z.ZodString;
157
+ }, z.core.$strip>>;
158
+ createdBySubjectId: z.ZodString;
159
+ createdAt: z.ZodString;
160
+ updatedAt: z.ZodString;
161
+ }, z.core.$strip>;
162
+ versions: z.ZodArray<z.ZodObject<{
163
+ id: z.ZodString;
164
+ accountId: z.ZodString;
165
+ workspaceId: z.ZodString;
166
+ artifactId: z.ZodString;
167
+ revision: z.ZodNumber;
168
+ contentType: z.ZodLiteral<"text/html">;
169
+ contentSha256: z.ZodString;
170
+ sizeBytes: z.ZodNumber;
171
+ sourceSessionId: z.ZodNullable<z.ZodString>;
172
+ sourceTurnId: z.ZodNullable<z.ZodString>;
173
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
174
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
175
+ createdBySubjectId: z.ZodString;
176
+ createdAt: z.ZodString;
177
+ }, z.core.$strip>>;
178
+ events: z.ZodArray<z.ZodObject<{
179
+ id: z.ZodString;
180
+ accountId: z.ZodString;
181
+ workspaceId: z.ZodString;
182
+ artifactId: z.ZodString;
183
+ type: z.ZodEnum<{
184
+ published: "published";
185
+ rolled_back: "rolled_back";
186
+ }>;
187
+ fromVersionId: z.ZodNullable<z.ZodString>;
188
+ toVersionId: z.ZodString;
189
+ sourceSessionId: z.ZodNullable<z.ZodString>;
190
+ sourceTurnId: z.ZodNullable<z.ZodString>;
191
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
192
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
193
+ actorSubjectId: z.ZodString;
194
+ reason: z.ZodString;
195
+ createdAt: z.ZodString;
196
+ }, z.core.$strip>>;
197
+ versionsTruncated: z.ZodBoolean;
198
+ eventsTruncated: z.ZodBoolean;
199
+ }, z.core.$strip>;
200
+ export type WorkspaceArtifactDetailResponse = z.infer<typeof WorkspaceArtifactDetailResponse>;
201
+ export declare const WorkspaceArtifactHtml: z.ZodString;
202
+ export declare const CreateWorkspaceArtifactRequest: z.ZodObject<{
203
+ slug: z.ZodOptional<z.ZodString>;
204
+ title: z.ZodString;
205
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
206
+ html: z.ZodString;
207
+ idempotencyKey: z.ZodString;
208
+ }, z.core.$strip>;
209
+ export type CreateWorkspaceArtifactRequest = z.infer<typeof CreateWorkspaceArtifactRequest>;
210
+ export declare const PublishWorkspaceArtifactVersionRequest: z.ZodObject<{
211
+ title: z.ZodOptional<z.ZodString>;
212
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
+ html: z.ZodString;
214
+ expectedCurrentVersionId: z.ZodString;
215
+ idempotencyKey: z.ZodString;
216
+ }, z.core.$strip>;
217
+ export type PublishWorkspaceArtifactVersionRequest = z.infer<typeof PublishWorkspaceArtifactVersionRequest>;
218
+ export declare const RollbackWorkspaceArtifactRequest: z.ZodObject<{
219
+ versionId: z.ZodString;
220
+ expectedCurrentVersionId: z.ZodString;
221
+ reason: z.ZodString;
222
+ idempotencyKey: z.ZodString;
223
+ }, z.core.$strip>;
224
+ export type RollbackWorkspaceArtifactRequest = z.infer<typeof RollbackWorkspaceArtifactRequest>;
225
+ export declare const WorkspaceArtifactMutationResponse: z.ZodObject<{
226
+ artifact: z.ZodObject<{
227
+ id: z.ZodString;
228
+ accountId: z.ZodString;
229
+ workspaceId: z.ZodString;
230
+ slug: z.ZodString;
231
+ title: z.ZodString;
232
+ description: z.ZodNullable<z.ZodString>;
233
+ status: z.ZodEnum<{
234
+ active: "active";
235
+ archived: "archived";
236
+ }>;
237
+ currentVersion: z.ZodNullable<z.ZodObject<{
238
+ id: z.ZodString;
239
+ accountId: z.ZodString;
240
+ workspaceId: z.ZodString;
241
+ artifactId: z.ZodString;
242
+ revision: z.ZodNumber;
243
+ contentType: z.ZodLiteral<"text/html">;
244
+ contentSha256: z.ZodString;
245
+ sizeBytes: z.ZodNumber;
246
+ sourceSessionId: z.ZodNullable<z.ZodString>;
247
+ sourceTurnId: z.ZodNullable<z.ZodString>;
248
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
249
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
250
+ createdBySubjectId: z.ZodString;
251
+ createdAt: z.ZodString;
252
+ }, z.core.$strip>>;
253
+ createdBySubjectId: z.ZodString;
254
+ createdAt: z.ZodString;
255
+ updatedAt: z.ZodString;
256
+ }, z.core.$strip>;
257
+ version: z.ZodObject<{
258
+ id: z.ZodString;
259
+ accountId: z.ZodString;
260
+ workspaceId: z.ZodString;
261
+ artifactId: z.ZodString;
262
+ revision: z.ZodNumber;
263
+ contentType: z.ZodLiteral<"text/html">;
264
+ contentSha256: z.ZodString;
265
+ sizeBytes: z.ZodNumber;
266
+ sourceSessionId: z.ZodNullable<z.ZodString>;
267
+ sourceTurnId: z.ZodNullable<z.ZodString>;
268
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
269
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
270
+ createdBySubjectId: z.ZodString;
271
+ createdAt: z.ZodString;
272
+ }, z.core.$strip>;
273
+ event: z.ZodObject<{
274
+ id: z.ZodString;
275
+ accountId: z.ZodString;
276
+ workspaceId: z.ZodString;
277
+ artifactId: z.ZodString;
278
+ type: z.ZodEnum<{
279
+ published: "published";
280
+ rolled_back: "rolled_back";
281
+ }>;
282
+ fromVersionId: z.ZodNullable<z.ZodString>;
283
+ toVersionId: z.ZodString;
284
+ sourceSessionId: z.ZodNullable<z.ZodString>;
285
+ sourceTurnId: z.ZodNullable<z.ZodString>;
286
+ sourceAttemptId: z.ZodNullable<z.ZodString>;
287
+ sourceExecutionGeneration: z.ZodNullable<z.ZodNumber>;
288
+ actorSubjectId: z.ZodString;
289
+ reason: z.ZodString;
290
+ createdAt: z.ZodString;
291
+ }, z.core.$strip>;
292
+ replayed: z.ZodBoolean;
293
+ }, z.core.$strip>;
294
+ export type WorkspaceArtifactMutationResponse = z.infer<typeof WorkspaceArtifactMutationResponse>;
295
+ export declare const WorkspaceArtifactContentResponse: z.ZodObject<{
296
+ artifactId: z.ZodString;
297
+ versionId: z.ZodString;
298
+ contentType: z.ZodLiteral<"text/html">;
299
+ contentSha256: z.ZodString;
300
+ html: z.ZodString;
301
+ }, z.core.$strip>;
302
+ export type WorkspaceArtifactContentResponse = z.infer<typeof WorkspaceArtifactContentResponse>;
303
+ export declare function normalizeWorkspaceArtifactSlug(value: string): string;
@@ -1,9 +1,11 @@
1
1
  // src/slack-bot-scopes.ts
2
2
  var OPENGENI_SLACK_BOT_REQUIRED_SCOPES = [
3
+ "app_mentions:read",
3
4
  "canvases:read",
4
5
  "channels:history",
5
6
  "channels:read",
6
7
  "chat:write",
8
+ "commands",
7
9
  "files:read",
8
10
  "groups:history",
9
11
  "groups:read",
@@ -40,4 +42,4 @@ export {
40
42
  areOpenGeniSlackBotScopesAccepted,
41
43
  evaluateOpenGeniSlackBotScopes
42
44
  };
43
- //# sourceMappingURL=chunk-3B3XEYMN.js.map
45
+ //# sourceMappingURL=chunk-KGL5BVGF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/slack-bot-scopes.ts"],"sourcesContent":["export const OPENGENI_SLACK_BOT_REQUIRED_SCOPES = [\n \"app_mentions:read\",\n \"canvases:read\",\n \"channels:history\",\n \"channels:read\",\n \"chat:write\",\n \"commands\",\n \"files:read\",\n \"groups:history\",\n \"groups:read\",\n \"im:history\",\n \"im:read\",\n \"im:write\",\n \"mpim:history\",\n \"mpim:read\",\n \"users:read\",\n] as const;\n\n/**\n * Optional bot grants that remain inside the shipped bot's read/identity\n * boundary. Every other unrequired scope fails closed, including unknown future\n * Slack scopes, so verification, core routing, and UI eligibility cannot drift.\n */\nexport const OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES = [\"team:read\"] as const;\n\n/** @deprecated Use evaluateOpenGeniSlackBotScopes; an allowlist is the policy. */\nexport const OPENGENI_SLACK_BOT_FORBIDDEN_SCOPES = [\"channels:join\", \"chat:write.public\"] as const;\n\nexport type OpenGeniSlackBotScopePolicy = {\n accepted: boolean;\n missingRequired: string[];\n unsupported: string[];\n};\n\nfunction isOpenGeniSlackBotScopeAllowed(scope: string): boolean {\n return (\n (OPENGENI_SLACK_BOT_REQUIRED_SCOPES as readonly string[]).includes(scope) ||\n (OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES as readonly string[]).includes(scope)\n );\n}\n\nexport function areOpenGeniSlackBotScopesAccepted(grantedScopes: readonly string[]): boolean {\n return (\n OPENGENI_SLACK_BOT_REQUIRED_SCOPES.every((scope) => grantedScopes.includes(scope)) &&\n grantedScopes.every(isOpenGeniSlackBotScopeAllowed)\n );\n}\n\nexport function evaluateOpenGeniSlackBotScopes(\n grantedScopes: readonly string[],\n): OpenGeniSlackBotScopePolicy {\n const granted = new Set(grantedScopes);\n const missingRequired = OPENGENI_SLACK_BOT_REQUIRED_SCOPES.filter((scope) => !granted.has(scope));\n const unsupported = [...granted].filter((scope) => !isOpenGeniSlackBotScopeAllowed(scope)).sort();\n return {\n accepted: areOpenGeniSlackBotScopesAccepted(grantedScopes),\n missingRequired,\n unsupported,\n };\n}\n"],"mappings":";AAAO,IAAM,qCAAqC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,IAAM,0CAA0C,CAAC,WAAW;AAG5D,IAAM,sCAAsC,CAAC,iBAAiB,mBAAmB;AAQxF,SAAS,+BAA+B,OAAwB;AAC9D,SACG,mCAAyD,SAAS,KAAK,KACvE,wCAA8D,SAAS,KAAK;AAEjF;AAEO,SAAS,kCAAkC,eAA2C;AAC3F,SACE,mCAAmC,MAAM,CAAC,UAAU,cAAc,SAAS,KAAK,CAAC,KACjF,cAAc,MAAM,8BAA8B;AAEtD;AAEO,SAAS,+BACd,eAC6B;AAC7B,QAAM,UAAU,IAAI,IAAI,aAAa;AACrC,QAAM,kBAAkB,mCAAmC,OAAO,CAAC,UAAU,CAAC,QAAQ,IAAI,KAAK,CAAC;AAChG,QAAM,cAAc,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,+BAA+B,KAAK,CAAC,EAAE,KAAK;AAChG,SAAO;AAAA,IACL,UAAU,kCAAkC,aAAa;AAAA,IACzD;AAAA,IACA;AAAA,EACF;AACF;","names":[]}