@gonzih/cc-wire 0.1.3 → 0.1.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-wire",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Single source of truth for Redis channel names, key patterns, and message shapes across the cc-suite (cc-tg, cc-agent, cc-agent-ui)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "dist/"
25
25
  ],
26
26
  "scripts": {
27
- "build": "npm run build:esm && npm run build:cjs",
27
+ "build": "rm -rf dist && npm run build:esm && npm run build:cjs",
28
28
  "build:esm": "tsc -p tsconfig.json",
29
29
  "build:cjs": "tsc -p tsconfig.cjs.json && node scripts/fix-cjs.mjs",
30
30
  "test": "node --import tsx/esm --test src/channels.test.ts"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=channels.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channels.test.d.ts","sourceRoot":"","sources":["../../src/channels.test.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- import { strict as assert } from "node:assert";
2
- import { describe, it } from "node:test";
3
- import { wikiKey, wikiUpdatedKey, notifyChannel, notifyListKey, notifyLogKey, jobKey, jobIndexKey, chatLogKey, chatIncomingChannel, chatOutgoingChannel, metaKey, cronsKey, swarmKey, planKey, profileKey, learningsKey, TTL, CAP, } from "./channels.js";
4
- describe("wiki keys", () => {
5
- it("wikiKey builds correct hash key", () => {
6
- assert.equal(wikiKey("gonzih/cc-agent"), "cca:wiki:gonzih/cc-agent");
7
- });
8
- it("wikiUpdatedKey builds correct timestamp key", () => {
9
- assert.equal(wikiUpdatedKey("gonzih/cc-agent"), "cca:wiki:gonzih/cc-agent:updated");
10
- });
11
- it("wikiKey and wikiUpdatedKey keys are distinct", () => {
12
- const slug = "org/repo";
13
- assert.notEqual(wikiKey(slug), wikiUpdatedKey(slug));
14
- });
15
- });
16
- describe("notify keys", () => {
17
- it("notifyChannel", () => assert.equal(notifyChannel("myns"), "cca:notify:myns"));
18
- it("notifyListKey matches notifyChannel (dual-purpose key)", () => assert.equal(notifyListKey("myns"), notifyChannel("myns")));
19
- it("notifyLogKey", () => assert.equal(notifyLogKey("myns"), "cca:notify-log:myns"));
20
- });
21
- describe("job keys", () => {
22
- it("jobKey", () => assert.equal(jobKey("abc"), "cca:job:abc"));
23
- it("jobIndexKey", () => assert.equal(jobIndexKey("ns"), "cca:jobs:ns"));
24
- });
25
- describe("chat keys", () => {
26
- it("chatLogKey", () => assert.equal(chatLogKey("ns"), "cca:chat:log:ns"));
27
- it("chatIncomingChannel", () => assert.equal(chatIncomingChannel("ns"), "cca:chat:incoming:ns"));
28
- it("chatOutgoingChannel", () => assert.equal(chatOutgoingChannel("ns"), "cca:chat:outgoing:ns"));
29
- });
30
- describe("misc keys", () => {
31
- it("metaKey", () => assert.equal(metaKey("ns"), "cca:meta:ns"));
32
- it("cronsKey", () => assert.equal(cronsKey("ns"), "cca:crons:ns"));
33
- it("swarmKey", () => assert.equal(swarmKey("id"), "cca:swarm:id"));
34
- it("planKey", () => assert.equal(planKey("id"), "cca:plan:id"));
35
- it("profileKey", () => assert.equal(profileKey("default"), "cca:profile:default"));
36
- it("learningsKey", () => assert.equal(learningsKey("ns"), "cca:learnings:ns"));
37
- });
38
- describe("TTL and CAP constants are positive integers", () => {
39
- for (const [k, v] of Object.entries(TTL)) {
40
- it(`TTL.${k} > 0`, () => assert.ok(v > 0, `${k} should be positive`));
41
- }
42
- for (const [k, v] of Object.entries(CAP)) {
43
- it(`CAP.${k} > 0`, () => assert.ok(v > 0, `${k} should be positive`));
44
- }
45
- });
46
- //# sourceMappingURL=channels.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channels.test.js","sourceRoot":"","sources":["../../src/channels.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,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