@company-semantics/contracts 86.1.0 → 87.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.
@@ -150,39 +150,39 @@ add("security.alert", "Unusual login location", {
150
150
 
151
151
  const CHAT_BASE = {
152
152
  sharedByName: "Alex Rivera",
153
- visibility: "private",
153
+ access: "read",
154
154
  } as const;
155
155
  add("chat.shared", "Default", {
156
156
  ...CHAT_BASE,
157
157
  chatTitle: "API design discussion",
158
- shareUrl: `${APP}/share/abc123`,
158
+ chatUrl: `${APP}/chat/abc123`,
159
159
  previewText:
160
160
  "Here are my thoughts on the REST API design for the new authentication endpoints.",
161
161
  });
162
162
  add("chat.shared", "No preview", {
163
163
  ...CHAT_BASE,
164
164
  chatTitle: "Quick sync notes",
165
- shareUrl: `${APP}/share/xyz789`,
165
+ chatUrl: `${APP}/chat/xyz789`,
166
166
  });
167
167
  add("chat.shared", "Long title", {
168
168
  ...CHAT_BASE,
169
- visibility: "public",
169
+ access: "collaborate",
170
170
  chatTitle:
171
171
  "This is a very long chat title that should be truncated to fit the layout properly",
172
- shareUrl: `${APP}/share/long456`,
172
+ chatUrl: `${APP}/chat/long456`,
173
173
  previewText: "The assistant response preview text.",
174
174
  });
175
175
  add("chat.shared", "Long preview", {
176
176
  ...CHAT_BASE,
177
177
  chatTitle: "Code review feedback",
178
- shareUrl: `${APP}/share/preview789`,
178
+ chatUrl: `${APP}/chat/preview789`,
179
179
  previewText:
180
180
  "I reviewed the pull request and found several areas that need improvement. The authentication logic needs better error handling, and the database queries could be optimized.",
181
181
  });
182
182
  add("chat.shared", "Short", {
183
183
  ...CHAT_BASE,
184
184
  chatTitle: "Hi",
185
- shareUrl: `${APP}/share/short123`,
185
+ chatUrl: `${APP}/chat/short123`,
186
186
  previewText: "Hello!",
187
187
  });
188
188
 
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * The only kind that reproduces a real conversation: the chat's title is shown
5
5
  * as the user's turn and the preview as the assistant's reply, elided into the
6
- * call to action. `visibility` is carried by the payload but says nothing here —
7
- * it is a fact about the share, not about what this notification tells you.
6
+ * call to action. `access` says whether the recipient can take part or only
7
+ * read (ADR-CONTRACTS-206); the link is the chat itself, never a token.
8
8
  */
9
9
 
10
10
  import type { ChatUnitItem } from "../content";
@@ -15,7 +15,7 @@ import { NOTICE } from "../text";
15
15
  export const chatSharedDefinition: NotificationDefinition<"chat.shared"> = {
16
16
  kind: "chat.shared",
17
17
  compose: (payload, context) => {
18
- const { chatTitle, shareUrl, previewText, sharedByName } = payload;
18
+ const { chatTitle, chatUrl, access, previewText, sharedByName } = payload;
19
19
 
20
20
  const items: ChatUnitItem[] = [
21
21
  { type: "message", role: "user", text: chatTitle, from: sharedByName },
@@ -29,7 +29,7 @@ export const chatSharedDefinition: NotificationDefinition<"chat.shared"> = {
29
29
  ]
30
30
  : []),
31
31
  { type: "continuation" },
32
- { type: "callToAction", label: "SEE MORE", href: shareUrl },
32
+ { type: "callToAction", label: "OPEN CHAT", href: chatUrl },
33
33
  ];
34
34
 
35
35
  return {
@@ -41,7 +41,13 @@ export const chatSharedDefinition: NotificationDefinition<"chat.shared"> = {
41
41
  {
42
42
  elements: [
43
43
  { type: "greeting" },
44
- { type: "body", text: "A chat was shared with you." },
44
+ {
45
+ type: "body",
46
+ text:
47
+ access === "collaborate"
48
+ ? "A chat was shared with you. You can take part in it."
49
+ : "A chat was shared with you to read.",
50
+ },
45
51
  { type: "chatUnit", items },
46
52
  {
47
53
  type: "notice",
@@ -108,11 +108,11 @@ export interface NotificationPayloads {
108
108
  sharedByName: string;
109
109
  /** Title of the chat being shared */
110
110
  chatTitle: string;
111
- /** Full URL to view the shared chat */
112
- shareUrl: string;
113
- /** Share visibility mode */
114
- visibility: "private" | "public";
115
- /** First ~200 chars of chat content for preview. Generated server-side from snapshot. */
111
+ /** Full URL of the chat itself — the link that opens it in the recipient's app */
112
+ chatUrl: string;
113
+ /** What the share granted: Read only or Collaborate */
114
+ access: "read" | "collaborate";
115
+ /** First ~200 chars of chat content for preview. Generated server-side. */
116
116
  previewText?: string;
117
117
  };
118
118
  "share.granted": {
@@ -12,7 +12,6 @@ describe("VIEW_SCOPE_MAP golden snapshot", () => {
12
12
  "internal-admin": "internal.view_admin",
13
13
  "execution-detail": "org.view_timeline",
14
14
  teams: null,
15
- chat: null,
16
15
  settings: null,
17
16
  "my-work": null,
18
17
  "user-md": null,
@@ -34,7 +33,6 @@ describe("getViewScope", () => {
34
33
  });
35
34
 
36
35
  it("returns null for public views", () => {
37
- expect(getViewScope("chat")).toBeNull();
38
36
  expect(getViewScope("settings")).toBeNull();
39
37
  expect(getViewScope("upgrade")).toBeNull();
40
38
  // teams is membership-derived, not scope-gated (ADR-CONTRACTS-062).
@@ -33,7 +33,6 @@ export const VIEW_SCOPE_MAP = {
33
33
  // not a scope. Repointed from the never-enforced `org.view_teams` to null when
34
34
  // that scope was retired from the backend catalog (ADR-CONTRACTS-062 / ADR-BE-256).
35
35
  teams: null,
36
- chat: null,
37
36
  settings: null,
38
37
  "my-work": null,
39
38
  "user-md": null,