@company-semantics/contracts 41.0.0 → 42.1.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/package.json +5 -5
- package/src/chat/README.md +1 -1
- package/src/chat/schemas.ts +18 -2
- package/src/security/token-policy.ts +2 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@company-semantics/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "42.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -129,17 +129,17 @@
|
|
|
129
129
|
"zod": "^4.4.3"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@types/node": "^
|
|
132
|
+
"@types/node": "^26.1.2",
|
|
133
133
|
"amphtml-validator": "^1.0.38",
|
|
134
134
|
"culori": "^4.0.2",
|
|
135
135
|
"husky": "^9.1.7",
|
|
136
|
-
"lint-staged": "^17.
|
|
137
|
-
"markdownlint-cli2": "^0.23.
|
|
136
|
+
"lint-staged": "^17.2.0",
|
|
137
|
+
"markdownlint-cli2": "^0.23.2",
|
|
138
138
|
"openapi-typescript": "^7.13.0",
|
|
139
139
|
"prettier": "^3.9.6",
|
|
140
140
|
"tsx": "^4.23.1",
|
|
141
141
|
"typescript": "^5.8.3",
|
|
142
|
-
"vite": "^
|
|
142
|
+
"vite": "^8.2.0",
|
|
143
143
|
"vitest": "^4.1.10",
|
|
144
144
|
"yaml": "^2.9.0"
|
|
145
145
|
},
|
package/src/chat/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Shared types for chat persistence, sharing, real-time events, and runtime profil
|
|
|
42
42
|
- `ChatRuntimeProfile` _(type)_ — Chat runtime profile — user-selectable orchestration strategy.
|
|
43
43
|
- `ChatRuntimeProfileInfo` _(type)_ — Runtime profile metadata for UI rendering.
|
|
44
44
|
- `ChatShareInfo` _(type)_ — Chat share record with snapshot metadata.
|
|
45
|
-
- `ChatShareInfoSchema`
|
|
45
|
+
- `ChatShareInfoSchema` — A chat share, as returned by the share APIs.
|
|
46
46
|
- `ChatSseEvent` _(type)_ — SSE event types for chat updates.
|
|
47
47
|
- `ChatSseEventSchema`
|
|
48
48
|
- `ChatSuccessResponse` _(type)_ — Generic mutation success confirmation.
|
package/src/chat/schemas.ts
CHANGED
|
@@ -58,12 +58,28 @@ export const SharedChatMessageSchema = z.object({
|
|
|
58
58
|
parts: z.array(z.unknown()).optional(),
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* A chat share, as returned by the share APIs.
|
|
63
|
+
*
|
|
64
|
+
* SHOW-ONCE (ADR-BE-460). `token` and `shareUrl` are present ONLY on the
|
|
65
|
+
* response that creates the share. Share tokens are stored as a digest, so the
|
|
66
|
+
* server cannot redisplay one afterwards — listing or updating a share returns
|
|
67
|
+
* the record without them, and re-obtaining a link means revoke-and-reshare.
|
|
68
|
+
*
|
|
69
|
+
* This is the industry norm for capability links, and it is what removes the
|
|
70
|
+
* last reason to keep a recoverable copy of the token: a share list that can
|
|
71
|
+
* still show you the URL is a share list that can leak every live link at once.
|
|
72
|
+
* Consumers must treat both fields as optional and drive their copy-link
|
|
73
|
+
* affordance off creation, not off a fetched share.
|
|
74
|
+
*/
|
|
61
75
|
export const ChatShareInfoSchema = z.object({
|
|
62
76
|
id: z.string(),
|
|
63
77
|
chatId: z.string(),
|
|
64
|
-
|
|
78
|
+
/** Create-time only — never returned by list or update (show-once). */
|
|
79
|
+
token: z.string().optional(),
|
|
65
80
|
visibility: ChatVisibilitySchema,
|
|
66
|
-
|
|
81
|
+
/** Create-time only — never returned by list or update (show-once). */
|
|
82
|
+
shareUrl: z.string().optional(),
|
|
67
83
|
messageCountAtShare: z.number().int(),
|
|
68
84
|
titleAtShare: z.string(),
|
|
69
85
|
createdAt: IsoDateString,
|
|
@@ -61,24 +61,14 @@ export const AUTH_TOKEN_POLICY_REQUIREMENTS = {
|
|
|
61
61
|
hashAlgorithm: "SHA-256",
|
|
62
62
|
storageFormat: "hashed",
|
|
63
63
|
contextPatterns: ["session"],
|
|
64
|
-
conformance: {
|
|
65
|
-
status: "unmet",
|
|
66
|
-
gap:
|
|
67
|
-
"Minted with randomUUID() (122 bits) and persisted verbatim: sessions.token " +
|
|
68
|
-
"holds the cookie value itself, and lookup is raw equality against it.",
|
|
69
|
-
},
|
|
64
|
+
conformance: { status: "enforced" },
|
|
70
65
|
},
|
|
71
66
|
ChatShareToken: {
|
|
72
67
|
minEntropyBits: 256,
|
|
73
68
|
hashAlgorithm: "SHA-256",
|
|
74
69
|
storageFormat: "hashed",
|
|
75
70
|
contextPatterns: ["share"],
|
|
76
|
-
conformance: {
|
|
77
|
-
status: "unmet",
|
|
78
|
-
gap:
|
|
79
|
-
"Minted with randomBytes(32) and persisted verbatim: chat_shares.token holds " +
|
|
80
|
-
"the share-URL value itself, and lookup is raw equality against it.",
|
|
81
|
-
},
|
|
71
|
+
conformance: { status: "enforced" },
|
|
82
72
|
},
|
|
83
73
|
InviteToken: {
|
|
84
74
|
minEntropyBits: 256,
|