@essentialai/cogent
Advanced tools
+13
| # Changelog | ||
| ## [2.0.0] - 2026-02-25 | ||
| ### Added | ||
| - Cloud-capable type definitions (SessionInfo, API contracts, WebSocket frame types) | ||
| - Complete Zod schema library for all API request/response validation | ||
| - 31 unified error codes across file, HTTP, WebSocket, and auth domains | ||
| - Route contract object mapping all 9 API endpoints | ||
| - ID generation and validation helpers (session, peer, message, label) | ||
| ### Changed | ||
| - License changed from ISC to Apache 2.0 |
+190
| Apache License | ||
| Version 2.0, January 2004 | ||
| http://www.apache.org/licenses/ | ||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
| 1. Definitions. | ||
| "License" shall mean the terms and conditions for use, reproduction, | ||
| and distribution as defined by Sections 1 through 9 of this document. | ||
| "Licensor" shall mean the copyright owner or entity authorized by | ||
| the copyright owner that is granting the License. | ||
| "Legal Entity" shall mean the union of the acting entity and all | ||
| other entities that control, are controlled by, or are under common | ||
| control with that entity. For the purposes of this definition, | ||
| "control" means (i) the power, direct or indirect, to cause the | ||
| direction or management of such entity, whether by contract or | ||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||
| outstanding shares, or (iii) beneficial ownership of such entity. | ||
| "You" (or "Your") shall mean an individual or Legal Entity | ||
| exercising permissions granted by this License. | ||
| "Source" form shall mean the preferred form for making modifications, | ||
| including but not limited to software source code, documentation | ||
| source, and configuration files. | ||
| "Object" form shall mean any form resulting from mechanical | ||
| transformation or translation of a Source form, including but | ||
| not limited to compiled object code, generated documentation, | ||
| and conversions to other media types. | ||
| "Work" shall mean the work of authorship, whether in Source or | ||
| Object form, made available under the License, as indicated by a | ||
| copyright notice that is included in or attached to the work | ||
| (an example is provided in the Appendix below). | ||
| "Derivative Works" shall mean any work, whether in Source or Object | ||
| form, that is based on (or derived from) the Work and for which the | ||
| editorial revisions, annotations, elaborations, or other modifications | ||
| represent, as a whole, an original work of authorship. For the purposes | ||
| of this License, Derivative Works shall not include works that remain | ||
| separable from, or merely link (or bind by name) to the interfaces of, | ||
| the Work and Derivative Works thereof. | ||
| "Contribution" shall mean any work of authorship, including | ||
| the original version of the Work and any modifications or additions | ||
| to that Work or Derivative Works thereof, that is intentionally | ||
| submitted to the Licensor for inclusion in the Work by the copyright owner | ||
| or by an individual or Legal Entity authorized to submit on behalf of | ||
| the copyright owner. For the purposes of this definition, "submitted" | ||
| means any form of electronic, verbal, or written communication sent | ||
| to the Licensor or its representatives, including but not limited to | ||
| communication on electronic mailing lists, source code control systems, | ||
| and issue tracking systems that are managed by, or on behalf of, the | ||
| Licensor for the purpose of discussing and improving the Work, but | ||
| excluding communication that is conspicuously marked or otherwise | ||
| designated in writing by the copyright owner as "Not a Contribution." | ||
| "Contributor" shall mean Licensor and any individual or Legal Entity | ||
| on behalf of whom a Contribution has been received by the Licensor and | ||
| subsequently incorporated within the Work. | ||
| 2. Grant of Copyright License. Subject to the terms and conditions of | ||
| this License, each Contributor hereby grants to You a perpetual, | ||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
| copyright license to reproduce, prepare Derivative Works of, | ||
| publicly display, publicly perform, sublicense, and distribute the | ||
| Work and such Derivative Works in Source or Object form. | ||
| 3. Grant of Patent License. Subject to the terms and conditions of | ||
| this License, each Contributor hereby grants to You a perpetual, | ||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
| (except as stated in this section) patent license to make, have made, | ||
| use, offer to sell, sell, import, and otherwise transfer the Work, | ||
| where such license applies only to those patent claims licensable | ||
| by such Contributor that are necessarily infringed by their | ||
| Contribution(s) alone or by combination of their Contribution(s) | ||
| with the Work to which such Contribution(s) was submitted. If You | ||
| institute patent litigation against any entity (including a | ||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | ||
| or a Contribution incorporated within the Work constitutes direct | ||
| or contributory patent infringement, then any patent licenses | ||
| granted to You under this License for that Work shall terminate | ||
| as of the date such litigation is filed. | ||
| 4. Redistribution. You may reproduce and distribute copies of the | ||
| Work or Derivative Works thereof in any medium, with or without | ||
| modifications, and in Source or Object form, provided that You | ||
| meet the following conditions: | ||
| (a) You must give any other recipients of the Work or | ||
| Derivative Works a copy of this License; and | ||
| (b) You must cause any modified files to carry prominent notices | ||
| stating that You changed the files; and | ||
| (c) You must retain, in the Source form of any Derivative Works | ||
| that You distribute, all copyright, patent, trademark, and | ||
| attribution notices from the Source form of the Work, | ||
| excluding those notices that do not pertain to any part of | ||
| the Derivative Works; and | ||
| (d) If the Work includes a "NOTICE" text file as part of its | ||
| distribution, then any Derivative Works that You distribute must | ||
| include a readable copy of the attribution notices contained | ||
| within such NOTICE file, excluding any notices that do not | ||
| pertain to any part of the Derivative Works, in at least one | ||
| of the following places: within a NOTICE text file distributed | ||
| as part of the Derivative Works; within the Source form or | ||
| documentation, if provided along with the Derivative Works; or, | ||
| within a display generated by the Derivative Works, if and | ||
| wherever such third-party notices normally appear. The contents | ||
| of the NOTICE file are for informational purposes only and | ||
| do not modify the License. You may add Your own attribution | ||
| notices within Derivative Works that You distribute, alongside | ||
| or as an addendum to the NOTICE text from the Work, provided | ||
| that such additional attribution notices cannot be construed | ||
| as modifying the License. | ||
| You may add Your own copyright statement to Your modifications and | ||
| may provide additional or different license terms and conditions | ||
| for use, reproduction, or distribution of Your modifications, or | ||
| for any such Derivative Works as a whole, provided Your use, | ||
| reproduction, and distribution of the Work otherwise complies with | ||
| the conditions stated in this License. | ||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | ||
| any Contribution intentionally submitted for inclusion in the Work | ||
| by You to the Licensor shall be under the terms and conditions of | ||
| this License, without any additional terms or conditions. | ||
| Notwithstanding the above, nothing herein shall supersede or modify | ||
| the terms of any separate license agreement you may have executed | ||
| with Licensor regarding such Contributions. | ||
| 6. Trademarks. This License does not grant permission to use the trade | ||
| names, trademarks, service marks, or product names of the Licensor, | ||
| except as required for reasonable and customary use in describing the | ||
| origin of the Work and reproducing the content of the NOTICE file. | ||
| 7. Disclaimer of Warranty. Unless required by applicable law or | ||
| agreed to in writing, Licensor provides the Work (and each | ||
| Contributor provides its Contributions) on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
| implied, including, without limitation, any warranties or conditions | ||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||
| PARTICULAR PURPOSE. You are solely responsible for determining the | ||
| appropriateness of using or redistributing the Work and assume any | ||
| risks associated with Your exercise of permissions under this License. | ||
| 8. Limitation of Liability. In no event and under no legal theory, | ||
| whether in tort (including negligence), contract, or otherwise, | ||
| unless required by applicable law (such as deliberate and grossly | ||
| negligent acts) or agreed to in writing, shall any Contributor be | ||
| liable to You for damages, including any direct, indirect, special, | ||
| incidental, or consequential damages of any character arising as a | ||
| result of this License or out of the use or inability to use the | ||
| Work (including but not limited to damages for loss of goodwill, | ||
| work stoppage, computer failure or malfunction, or any and all | ||
| other commercial damages or losses), even if such Contributor | ||
| has been advised of the possibility of such damages. | ||
| 9. Accepting Warranty or Additional Liability. While redistributing | ||
| the Work or Derivative Works thereof, You may choose to offer, | ||
| and charge a fee for, acceptance of support, warranty, indemnity, | ||
| or other liability obligations and/or rights consistent with this | ||
| License. However, in accepting such obligations, You may act only | ||
| on Your own behalf and on Your sole responsibility, not on behalf | ||
| of any other Contributor, and only if You agree to indemnify, | ||
| defend, and hold each Contributor harmless for any liability | ||
| incurred by, or claims asserted against, such Contributor by reason | ||
| of your accepting any such warranty or additional liability. | ||
| END OF TERMS AND CONDITIONS | ||
| Copyright 2025-2026 Essential AI Solutions Ltd. | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. |
+90
| # @essentialai/cogent | ||
| [](https://www.npmjs.com/package/@essentialai/cogent) | ||
| [](https://www.npmjs.com/package/@essentialai/cogent) | ||
| [](https://www.npmjs.com/package/@essentialai/cogent) | ||
| Shared types, Zod schemas, and error codes for the [Cogent bridge](https://cogent.tools) ecosystem. | ||
| This package provides the contract layer used by both [`@essentialai/cogent-bridge`](https://www.npmjs.com/package/@essentialai/cogent-bridge) (MCP client) and [`@essentialai/cogent-server`](https://www.npmjs.com/package/@essentialai/cogent-server) (cloud relay server). | ||
| ## Install | ||
| ```bash | ||
| npm install @essentialai/cogent | ||
| ``` | ||
| **Peer dependency:** `zod` (^3.25.0 || ^4.0.0) | ||
| ## What's Included | ||
| ### Type Definitions | ||
| - **Session types** -- `SessionInfo`, `CreateSessionRequest/Response`, `JoinSessionRequest/Response` | ||
| - **Peer types** -- `PeerInfo`, `RegisterPeerRequest/Response`, `ListPeersResponse` | ||
| - **Message types** -- `SendMessageRequest/Response`, `MessageRecord`, `GetHistoryResponse` | ||
| - **WebSocket frame types** -- `WsFrame`, `PeerConnectedFrame`, `MessagePushFrame`, `HeartbeatFrame` | ||
| - **API contracts** -- `RouteContract` mapping all 9 REST endpoints | ||
| ### Zod Schemas | ||
| Every type has a corresponding Zod schema for runtime validation: | ||
| ```typescript | ||
| import { CreateSessionRequestSchema, JoinSessionResponseSchema } from "@essentialai/cogent"; | ||
| // Validate incoming request | ||
| const parsed = CreateSessionRequestSchema.parse(requestBody); | ||
| // Validate API response | ||
| const response = JoinSessionResponseSchema.parse(apiResponse); | ||
| ``` | ||
| ### Error Codes | ||
| 31 unified error codes across file, HTTP, WebSocket, and auth domains: | ||
| ```typescript | ||
| import { ErrorCode, BridgeError } from "@essentialai/cogent"; | ||
| throw new BridgeError( | ||
| ErrorCode.SESSION_NOT_FOUND, | ||
| "Session abc-123 not found", | ||
| "Check the session ID or create a new session" | ||
| ); | ||
| ``` | ||
| ### Route Contracts | ||
| Type-safe API endpoint definitions: | ||
| ```typescript | ||
| import { API_ROUTES } from "@essentialai/cogent"; | ||
| // API_ROUTES.createSession -> { method, path, request schema, response schema } | ||
| // API_ROUTES.joinSession -> ... | ||
| // API_ROUTES.registerPeer -> ... | ||
| ``` | ||
| ### Helpers | ||
| - `generateSessionId()` / `generatePeerId()` / `generateMessageId()` -- UUID v4 generators | ||
| - `generateSessionLabel()` -- human-readable adjective-noun-hex labels | ||
| - `isValidSessionId()` / `isValidSessionLabel()` -- format validators | ||
| ### File Transport Types (subpath) | ||
| ```typescript | ||
| import { BridgeState, PeerInfo } from "@essentialai/cogent/file"; | ||
| ``` | ||
| Types for the local file-based transport (used in local-only mode). | ||
| ## Links | ||
| - [cogent.tools](https://cogent.tools) -- Cloud relay server | ||
| - [GitHub](https://github.com/eaisdevelopment/cogent) | ||
| ## License | ||
| Apache-2.0 |
@@ -19,2 +19,11 @@ /** | ||
| export declare function generateMessageId(): string; | ||
| /** | ||
| * Generate a human-readable session label. | ||
| * | ||
| * Pattern: `adjective-noun-hex4` (e.g., "swift-fox-a3f1"). | ||
| * Uses `crypto.randomInt()` for unbiased selection and `crypto.randomBytes()` | ||
| * for the hex suffix, giving ~16 million unique combinations per adjective-noun | ||
| * pair and ~67 billion total. | ||
| */ | ||
| export declare function generateSessionLabel(): string; | ||
| //# sourceMappingURL=ids.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/helpers/ids.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"} | ||
| {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/helpers/ids.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AA8BD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAK7C"} |
+39
-0
@@ -26,2 +26,41 @@ import crypto from "node:crypto"; | ||
| } | ||
| // --------------------------------------------------------------------------- | ||
| // Session label generation | ||
| // --------------------------------------------------------------------------- | ||
| /** Adjectives for human-readable session labels (~64 entries). */ | ||
| const ADJECTIVES = [ | ||
| "swift", "bold", "calm", "dark", "keen", "warm", "wise", "neat", | ||
| "fast", "cool", "slim", "tall", "deep", "wide", "pale", "soft", | ||
| "wild", "fair", "pure", "rich", "rare", "true", "safe", "free", | ||
| "glad", "firm", "kind", "good", "fine", "real", "vast", "even", | ||
| "blue", "gold", "gray", "teal", "jade", "ruby", "mint", "pine", | ||
| "dusk", "dawn", "iron", "silk", "wren", "fern", "moss", "sage", | ||
| "opal", "onyx", "aqua", "plum", "rose", "lime", "snow", "star", | ||
| "haze", "glow", "dune", "cove", "peak", "reef", "vale", "glen", | ||
| ]; | ||
| /** Nouns for human-readable session labels (~64 entries). */ | ||
| const NOUNS = [ | ||
| "fox", "owl", "oak", "elm", "bay", "sky", "gem", "orb", | ||
| "jay", "doe", "ram", "bee", "cod", "eel", "yak", "ant", | ||
| "ash", "fir", "ivy", "yew", "rue", "rye", "hay", "oat", | ||
| "arc", "axe", "bow", "cup", "key", "pen", "rod", "net", | ||
| "sun", "fin", "dew", "fog", "ice", "mud", "sea", "web", | ||
| "dam", "den", "hut", "inn", "lab", "rig", "van", "pit", | ||
| "ace", "bit", "cog", "dot", "hex", "ion", "jet", "kit", | ||
| "log", "map", "nod", "ore", "pip", "rig", "tap", "vim", | ||
| ]; | ||
| /** | ||
| * Generate a human-readable session label. | ||
| * | ||
| * Pattern: `adjective-noun-hex4` (e.g., "swift-fox-a3f1"). | ||
| * Uses `crypto.randomInt()` for unbiased selection and `crypto.randomBytes()` | ||
| * for the hex suffix, giving ~16 million unique combinations per adjective-noun | ||
| * pair and ~67 billion total. | ||
| */ | ||
| export function generateSessionLabel() { | ||
| const adjective = ADJECTIVES[crypto.randomInt(ADJECTIVES.length)]; | ||
| const noun = NOUNS[crypto.randomInt(NOUNS.length)]; | ||
| const hex = crypto.randomBytes(2).toString("hex"); | ||
| return `${adjective}-${noun}-${hex}`; | ||
| } | ||
| //# sourceMappingURL=ids.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/helpers/ids.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC"} | ||
| {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/helpers/ids.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E,kEAAkE;AAClE,MAAM,UAAU,GAAsB;IACpC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC/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KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACtD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACtD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CACvD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,OAAO,GAAG,SAAS,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;AACvC,CAAC"} |
@@ -1,3 +0,3 @@ | ||
| export { generateSessionId, generatePeerId, generateMessageId } from "./ids.js"; | ||
| export { isValidUUID, isValidPeerId, isValidSessionId, isValidMessageId } from "./validation.js"; | ||
| export { generateSessionId, generatePeerId, generateMessageId, generateSessionLabel } from "./ids.js"; | ||
| export { isValidUUID, isValidPeerId, isValidSessionId, isValidMessageId, isValidSessionLabel } from "./validation.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"} |
@@ -1,3 +0,3 @@ | ||
| export { generateSessionId, generatePeerId, generateMessageId } from "./ids.js"; | ||
| export { isValidUUID, isValidPeerId, isValidSessionId, isValidMessageId } from "./validation.js"; | ||
| export { generateSessionId, generatePeerId, generateMessageId, generateSessionLabel } from "./ids.js"; | ||
| export { isValidUUID, isValidPeerId, isValidSessionId, isValidMessageId, isValidSessionLabel } from "./validation.js"; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"} |
@@ -21,2 +21,7 @@ /** | ||
| export declare function isValidMessageId(value: string): boolean; | ||
| /** | ||
| * Check whether a string is a valid session label. | ||
| * Labels are 3-32 chars: lowercase letters, digits, and internal hyphens. | ||
| */ | ||
| export declare function isValidSessionLabel(value: string): boolean; | ||
| //# sourceMappingURL=validation.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/helpers/validation.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD"} | ||
| {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/helpers/validation.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAQD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1D"} |
@@ -34,2 +34,14 @@ /** | ||
| } | ||
| /** | ||
| * Session label format: 3-32 lowercase alphanumeric chars with internal hyphens. | ||
| * Must start and end with alphanumeric. Examples: "swift-fox-a3f1", "myroom". | ||
| */ | ||
| const SESSION_LABEL_REGEX = /^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/; | ||
| /** | ||
| * Check whether a string is a valid session label. | ||
| * Labels are 3-32 chars: lowercase letters, digits, and internal hyphens. | ||
| */ | ||
| export function isValidSessionLabel(value) { | ||
| return SESSION_LABEL_REGEX.test(value); | ||
| } | ||
| //# sourceMappingURL=validation.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/helpers/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,aAAa,GAAW,wEAAwE,CAAC;AAEvG;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"} | ||
| {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/helpers/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,aAAa,GAAW,wEAAwE,CAAC;AAEvG;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,mBAAmB,GAAW,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC"} |
@@ -9,3 +9,3 @@ import { z } from "zod"; | ||
| .object({ | ||
| label: z.string().optional().describe("Optional human-readable session label"), | ||
| label: z.string().regex(/^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/).optional().describe("Optional human-readable session label (3-32 lowercase alphanumeric + hyphens)"), | ||
| secret: z.string().min(8).describe("Shared secret for joining the session (min 8 chars)"), | ||
@@ -12,0 +12,0 @@ }) |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"api-requests.js","sourceRoot":"","sources":["../../src/schemas/api-requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6CxB,wCAAwC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAoC,CAAC;KACzE,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAC9E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC;CAC1F,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkC,CAAC;KACrE,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;CACpE,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAmC,CAAC;KACvE,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC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G,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CACpG,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAyB,CAAC;KACnD,MAAM,CAAC;IACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CACxD,CAAC;KACD,MAAM,EAAE,CAAC"} |
@@ -9,2 +9,3 @@ import { z } from "zod"; | ||
| token: string; | ||
| label: string; | ||
| createdAt: string; | ||
@@ -16,2 +17,3 @@ } | ||
| token: string; | ||
| label: string; | ||
| peerCount: number; | ||
@@ -18,0 +20,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"api-responses.d.ts","sourceRoot":"","sources":["../../src/schemas/api-responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAI7D,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EA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GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAGjE,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAMzD,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAI/C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAGrD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAqB,CAAC"} |
@@ -13,2 +13,3 @@ import { z } from "zod"; | ||
| token: z.string().describe("Bearer token for subsequent requests"), | ||
| label: z.string().describe("Human-readable session label"), | ||
| createdAt: z.string().datetime().describe("ISO 8601 creation timestamp"), | ||
@@ -23,2 +24,3 @@ }); | ||
| token: z.string().describe("Bearer token for subsequent requests"), | ||
| label: z.string().describe("Human-readable session label"), | ||
| peerCount: z.number().int().min(0).describe("Current number of peers in session"), | ||
@@ -25,0 +27,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"api-responses.js","sourceRoot":"","sources":["../../src/schemas/api-responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA2DvD,wCAAwC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAqC,CAAC,CAAC,MAAM,CAAC;IACpF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC3D,KAAK,EAAE,CAAC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AC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CACnF,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkC,iBAAiB,CAAC"} |
+4
-3
| { | ||
| "name": "@essentialai/cogent", | ||
| "version": "1.0.0", | ||
| "version": "2.0.0", | ||
| "description": "Shared types, schemas, and contracts for Cogent Bridge", | ||
@@ -19,3 +19,4 @@ "type": "module", | ||
| "README.md", | ||
| "LICENSE" | ||
| "LICENSE", | ||
| "CHANGELOG.md" | ||
| ], | ||
@@ -43,3 +44,3 @@ "scripts": { | ||
| "author": "Pavlo Sidelov <pavlo@essentialai.uk>", | ||
| "license": "ISC", | ||
| "license": "Apache-2.0", | ||
| "repository": { | ||
@@ -46,0 +47,0 @@ "type": "git", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
94084
26.57%88
3.53%1090
6.76%1
-50%91
Infinity%