@company-semantics/contracts 86.1.0 → 88.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/package.json +14 -10
  2. package/src/api/generated-spec-hash.ts +2 -2
  3. package/src/api/generated.ts +50 -262
  4. package/src/chat/README.md +8 -20
  5. package/src/chat/__tests__/compaction-boundary.test.ts +1 -0
  6. package/src/chat/__tests__/continuity.test.ts +1 -0
  7. package/src/chat/__tests__/discussion-scope.test.ts +0 -7
  8. package/src/chat/__tests__/message-mentions.test.ts +1 -12
  9. package/src/chat/__tests__/multi-party.test.ts +15 -6
  10. package/src/chat/__tests__/page-context.test.ts +3 -3
  11. package/src/chat/enums.ts +24 -11
  12. package/src/chat/index.ts +4 -16
  13. package/src/chat/schemas.ts +9 -71
  14. package/src/chat/types.ts +25 -77
  15. package/src/generated/openapi-routes.ts +1 -4
  16. package/src/guards/README.md +0 -1
  17. package/src/guards/config.ts +1 -10
  18. package/src/guards/evolution-config.ts +1 -18
  19. package/src/guards/index.ts +0 -1
  20. package/src/index.ts +15 -1279
  21. package/src/notifications/__tests__/__snapshots__/monospace-budget.test.ts.snap +4 -4
  22. package/src/notifications/__tests__/__snapshots__/render-snapshot.test.ts.snap +50 -49
  23. package/src/notifications/__tests__/fixtures.ts +7 -7
  24. package/src/notifications/__tests__/render-snapshot.test.ts +7 -7
  25. package/src/notifications/kinds/chat-shared.ts +11 -5
  26. package/src/notifications/payloads.ts +5 -5
  27. package/src/org/README.md +0 -212
  28. package/src/org/__tests__/view-scopes.test.ts +0 -2
  29. package/src/org/authority-schemas.ts +242 -0
  30. package/src/org/index.ts +26 -249
  31. package/src/org/invite-schemas.ts +596 -0
  32. package/src/org/org-governance-schemas.ts +198 -0
  33. package/src/org/org-unit-api-schemas.ts +226 -0
  34. package/src/org/org-unit-schemas.ts +223 -0
  35. package/src/org/ownership-transfer-types.ts +51 -0
  36. package/src/org/schemas.ts +18 -1658
  37. package/src/org/sso-stepper-types.ts +81 -0
  38. package/src/org/types.ts +15 -115
  39. package/src/org/view-scopes.ts +0 -1
  40. package/src/org/workspace-admin-schemas.ts +240 -0
  41. package/src/root-exports/README.md +91 -0
  42. package/src/root-exports/agent-runtime.ts +213 -0
  43. package/src/root-exports/collaboration.ts +247 -0
  44. package/src/root-exports/delivery.ts +218 -0
  45. package/src/root-exports/org-structure.ts +214 -0
  46. package/src/root-exports/org-workspace.ts +254 -0
  47. package/src/root-exports/platform.ts +205 -0
package/src/chat/types.ts CHANGED
@@ -8,7 +8,6 @@
8
8
 
9
9
  import { z } from "zod";
10
10
  import {
11
- ChatVisibilitySchema,
12
11
  TitleSourceSchema,
13
12
  InvalidationReasonSchema,
14
13
  ChatChangedFieldSchema,
@@ -17,9 +16,6 @@ import {
17
16
  ChatSummaryExtendedSchema,
18
17
  ProactiveChatResolutionSchema,
19
18
  TitleGenerationResponseSchema,
20
- ChatShareInfoSchema,
21
- SharedChatViewSchema,
22
- SharedChatMessageSchema,
23
19
  BaseEventSchema,
24
20
  ChatCreatedEventSchema,
25
21
  ChatUpdatedEventSchema,
@@ -33,13 +29,11 @@ import {
33
29
  ChatByInteractionResponseSchema,
34
30
  ChatListResponseSchema,
35
31
  CreateChatResponseSchema,
36
- CreateShareResponseSchema,
37
- ListSharesResponseSchema,
38
- UpdateShareResponseSchema,
39
32
  ChatMessageSchema,
40
33
  ChatMessageMentionSchema,
41
34
  ChatMentionableResponseSchema,
42
35
  ChatParticipantRoleSchema,
36
+ ChatGrantableRoleSchema,
43
37
  ChatParticipantSchema,
44
38
  ChatParticipantsResponseSchema,
45
39
  ChatDetailSchema,
@@ -48,17 +42,6 @@ import {
48
42
  ChatPageContextSchema,
49
43
  } from "./schemas";
50
44
 
51
- // =============================================================================
52
- // Visibility
53
- // =============================================================================
54
-
55
- /**
56
- * Chat share visibility.
57
- * - private: Token exists but access requires authentication as chat owner
58
- * - public: Token grants anonymous access to anyone with the link
59
- */
60
- export type ChatVisibility = z.infer<typeof ChatVisibilitySchema>;
61
-
62
45
  // =============================================================================
63
46
  // Chat Summary
64
47
  // =============================================================================
@@ -68,53 +51,6 @@ export type ChatVisibility = z.infer<typeof ChatVisibilitySchema>;
68
51
  */
69
52
  export type ChatSummary = z.infer<typeof ChatSummarySchema>;
70
53
 
71
- // =============================================================================
72
- // Share Types
73
- // =============================================================================
74
-
75
- /**
76
- * Chat share record with snapshot metadata.
77
- *
78
- * CRITICAL INVARIANT (SNAPSHOT-1):
79
- * A chat share must never expose messages with sequenceNumber > messageCountAtShare.
80
- * Enforced in ChatShareService.viewSharedChat() only.
81
- */
82
- export type ChatShareInfo = z.infer<typeof ChatShareInfoSchema>;
83
-
84
- /**
85
- * Shared chat view returned to viewers.
86
- * Messages are limited by the snapshot boundary.
87
- */
88
- export type SharedChatView = z.infer<typeof SharedChatViewSchema>;
89
-
90
- /**
91
- * Individual message in a shared chat view.
92
- */
93
- export type SharedChatMessage = z.infer<typeof SharedChatMessageSchema>;
94
-
95
- // =============================================================================
96
- // API Request/Response Types
97
- // =============================================================================
98
-
99
- /**
100
- * Request to create a new share for a chat.
101
- */
102
- export interface CreateShareRequest {
103
- chatId: string;
104
- visibility: ChatVisibility;
105
- /** Optional: send email notification to this address */
106
- recipientEmail?: string;
107
- }
108
-
109
- /**
110
- * Request to update an existing share.
111
- */
112
- export interface UpdateShareRequest {
113
- visibility?: ChatVisibility;
114
- /** If true, update snapshot to include new messages added since share creation */
115
- updateSnapshot?: boolean;
116
- }
117
-
118
54
  // =============================================================================
119
55
  // Chat Lifecycle Types
120
56
  // =============================================================================
@@ -288,15 +224,6 @@ export type ChatListResponse = z.infer<typeof ChatListResponseSchema>;
288
224
  /** Response for POST /api/chats */
289
225
  export type CreateChatResponse = z.infer<typeof CreateChatResponseSchema>;
290
226
 
291
- /** Response for POST /api/chats/:chatId/shares */
292
- export type CreateShareResponse = z.infer<typeof CreateShareResponseSchema>;
293
-
294
- /** Response for GET /api/chats/:chatId/shares */
295
- export type ListSharesResponse = z.infer<typeof ListSharesResponseSchema>;
296
-
297
- /** Response for PATCH /api/shares/:shareId */
298
- export type UpdateShareResponse = z.infer<typeof UpdateShareResponseSchema>;
299
-
300
227
  /** Individual message in a chat response (GET /api/chats/:id). */
301
228
  export type ChatMessage = z.infer<typeof ChatMessageSchema>;
302
229
 
@@ -316,12 +243,33 @@ export type ChatMentionableResponse = z.infer<
316
243
  // =============================================================================
317
244
 
318
245
  /**
319
- * What one person is to a chat: `owner` or `participant`. Participation, not an
320
- * access band — there is no `viewer` and no per-participant scope, because a
321
- * chat you can read half of is not a thing this surface models.
246
+ * What one person is to a chat: `owner`, `participant` (Collaborate) or
247
+ * `viewer` (Read only). Whole-chat access, never a per-participant scope
248
+ * (ADR-CONTRACTS-206).
322
249
  */
323
250
  export type ChatParticipantRole = z.infer<typeof ChatParticipantRoleSchema>;
324
251
 
252
+ /** A role a share can grant: `participant` (Collaborate) or `viewer` (Read only). */
253
+ export type ChatGrantableRole = z.infer<typeof ChatGrantableRoleSchema>;
254
+
255
+ /**
256
+ * Request for POST /api/chats/:chatId/participants — sharing the chat with one
257
+ * org member at a grantable role. A request-only type (no runtime schema), like
258
+ * the other chat requests.
259
+ */
260
+ export interface AddChatParticipantRequest {
261
+ userId: string;
262
+ role: ChatGrantableRole;
263
+ }
264
+
265
+ /**
266
+ * Request for PATCH /api/chats/:chatId/participants/:userId — the owner moving
267
+ * someone between Read only and Collaborate.
268
+ */
269
+ export interface UpdateChatParticipantRequest {
270
+ role: ChatGrantableRole;
271
+ }
272
+
325
273
  /**
326
274
  * One ACTIVE participant of a chat — a user id, a role, a read-time display
327
275
  * name and when they joined. Never a `PrincipalRef`: the agent takes part in
@@ -21,13 +21,12 @@ export const openApiRoutes = {
21
21
  '/api/chats/mentionable': ['GET'],
22
22
  '/api/chats/proactive/{eventId}': ['GET'],
23
23
  '/api/chats/resolve-launch': ['POST'],
24
- '/api/chats/{chatId}/shares': ['GET', 'POST'],
25
24
  '/api/chats/{id}': ['DELETE', 'GET', 'PATCH'],
26
25
  '/api/chats/{id}/generate-title': ['POST'],
27
26
  '/api/chats/{id}/messages': ['POST'],
28
27
  '/api/chats/{id}/messages/{messageId}': ['DELETE'],
29
28
  '/api/chats/{id}/participants': ['GET', 'POST'],
30
- '/api/chats/{id}/participants/{userId}': ['DELETE'],
29
+ '/api/chats/{id}/participants/{userId}': ['DELETE', 'PATCH'],
31
30
  '/api/chats/{id}/pin': ['DELETE', 'POST'],
32
31
  '/api/chats/{id}/start-fresh': ['POST'],
33
32
  '/api/comments': ['GET'],
@@ -186,8 +185,6 @@ export const openApiRoutes = {
186
185
  '/api/reporting/positions/{positionId}/manager': ['PUT'],
187
186
  '/api/scope/check': ['GET'],
188
187
  '/api/scope/check-batch': ['POST'],
189
- '/api/shared/{token}': ['GET'],
190
- '/api/shares/{shareId}': ['DELETE', 'PATCH'],
191
188
  '/api/source-sync/candidate-sets/current': ['GET'],
192
189
  '/api/source-sync/candidate-sets/{setId}/approve': ['POST'],
193
190
  '/api/source-sync/candidate-sets/{setId}/items': ['POST'],
@@ -26,7 +26,6 @@ This module exports **types only** — runtime helper functions live in the work
26
26
  - `CheckResult` _(type)_ — Result from a single guard check.
27
27
  - `ContractsConsumerBaseline` _(type)_ — Contracts consumer guard configuration.
28
28
  - `ContractsFreshnessBaseline` _(type)_ — Contracts freshness baseline configuration.
29
- - `CoverageBaseline` _(type)_ — Coverage baseline configuration.
30
29
  - `DEFAULT_DOMAIN_SECTIONS` — Default README sections for domain directories.
31
30
  - `DEFAULT_INFRA_SECTIONS` — Default README sections for infrastructure directories.
32
31
  - `DEFAULT_SKIP_DIRECTORIES` — Default directories to skip when walking file trees.
@@ -12,7 +12,6 @@ import type { CheckResult } from "./types";
12
12
  // The EvolutionBaselines interface below references these evolution baseline
13
13
  // types, which now live in ./evolution-config.
14
14
  import type {
15
- CoverageBaseline,
16
15
  FileClusterBaseline,
17
16
  SubdirectoryAffinityBaseline,
18
17
  } from "./evolution-config";
@@ -34,7 +33,6 @@ export type {
34
33
  export type {
35
34
  DomainAggregateBaseline,
36
35
  AggregateEvolutionConfig,
37
- CoverageBaseline,
38
36
  FileClusterBaseline,
39
37
  SubdirectoryAffinityBaseline,
40
38
  } from "./evolution-config";
@@ -197,7 +195,7 @@ export interface ScriptsDepsBaseline {
197
195
 
198
196
  /**
199
197
  * If true, violations are errors. If false, violations are warnings.
200
- * @default false
198
+ * @default true (company-semantics-ci ADR-CI-254)
201
199
  */
202
200
  strict?: boolean;
203
201
  }
@@ -326,13 +324,6 @@ export interface EvolutionBaselines {
326
324
  */
327
325
  contractsFreshness?: ContractsFreshnessBaseline;
328
326
 
329
- /**
330
- * Coverage drift check configuration.
331
- * CI injects checkCoverageDrift based on this config.
332
- * Errors when coverage drops below baseline (enforced).
333
- */
334
- coverage?: CoverageBaseline;
335
-
336
327
  /**
337
328
  * File cluster detection configuration.
338
329
  * CI injects checkFileClusters based on this config.
@@ -2,7 +2,7 @@
2
2
  * Evolution & Drift-Detection Guard Configuration Vocabulary
3
3
  *
4
4
  * Polymorphic configuration types for the evolution/drift guards: domain-level
5
- * aggregate tracking plus the coverage, file-cluster, and subdirectory-affinity
5
+ * aggregate tracking plus the file-cluster and subdirectory-affinity
6
6
  * baselines referenced by EvolutionBaselines.
7
7
  *
8
8
  * Extracted from ./config.ts as a cohesive sub-module (the evolution guard
@@ -65,23 +65,6 @@ export interface AggregateEvolutionConfig {
65
65
  };
66
66
  }
67
67
 
68
- // =============================================================================
69
- // Coverage Baseline Types
70
- // =============================================================================
71
-
72
- /**
73
- * Coverage baseline configuration.
74
- * Used by CI orchestrator to inject coverage drift guard.
75
- */
76
- export interface CoverageBaseline {
77
- /** Path to coverage-summary.json (default: 'coverage/coverage-summary.json') */
78
- coverageFile?: string;
79
- /** Baseline coverage percentage (lines) */
80
- baseline: number;
81
- /** Allowed drop threshold before error (default: 0 = any drop errors) */
82
- dropThreshold?: number;
83
- }
84
-
85
68
  /**
86
69
  * File cluster detection configuration.
87
70
  * Detects clusters of related files that could benefit from
@@ -50,7 +50,6 @@ export type {
50
50
  ContractsConsumerBaseline,
51
51
  EvolutionBaselines,
52
52
  ContractsFreshnessBaseline,
53
- CoverageBaseline,
54
53
  FileClusterBaseline,
55
54
  SubdirectoryAffinityBaseline,
56
55
  MetaBaselines,