mcp-rubber-duck 1.20.13 → 1.20.15

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.
@@ -7,18 +7,18 @@
7
7
  # `undici` is ignored because its resolution is fully governed by the `overrides`
8
8
  # block in package.json (`undici@6.x` and `undici@7.x`), which Dependabot does not
9
9
  # edit. There are three copies in the tree:
10
- # node_modules/undici 6.29.0 <- @actions/http-client ^6.23.0
11
- # node_modules/semantic-release/node_modules/undici 7.30.0 <- @semantic-release/github ^7.0.0
12
- # node_modules/npm/node_modules/undici 6.28.0 <- bundled in the npm CLI tarball
10
+ # node_modules/undici 6.29.1 <- @actions/http-client ^6.23.0
11
+ # node_modules/semantic-release/node_modules/undici 7.30.1 <- @semantic-release/github ^7.0.0
12
+ # node_modules/npm/node_modules/undici 6.29.1 <- bundled in the npm CLI tarball
13
13
  # The first two are already at the head of their major lines and are raised by
14
14
  # bumping the override floor, not by a Dependabot PR. The third is bundled inside
15
15
  # npm's own tarball and cannot be lifted by overrides at all. So every Dependabot
16
16
  # security-update attempt here is either a no-op or fails by construction — which
17
17
  # is what it did historically (see the closed PRs #84 and #85).
18
18
  #
19
- # audit-ci is the real gate and tracks these independently: as of 2026-10-05
20
- # audit-ci.json allowlists the bundled-npm undici advisories (npm 11.21.0 and
21
- # 12.2.0 still vendor 6.28.0) with re-check triggers.
19
+ # audit-ci is the real gate and tracks these independently: as of 2026-11-23
20
+ # every copy is patched (npm 11.21.3 vendors 6.29.1) and audit-ci.json carries
21
+ # no undici entries.
22
22
  # Remove this ignore if undici ever becomes a direct dependency, or if the
23
23
  # overrides are dropped.
24
24
  version: 2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.20.15](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.20.14...v1.20.15) (2026-11-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** bump @hono/node-server to 2.1.11 and evict 46 stale allowlist ghosts ([5d8229a](https://github.com/nesquikm/mcp-rubber-duck/commit/5d8229ace50667e075187bba86936b8c5d3d2342))
7
+
8
+ ## [1.20.14](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.20.13...v1.20.14) (2026-11-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **chat:** count each message once ([fb2cfaa](https://github.com/nesquikm/mcp-rubber-duck/commit/fb2cfaabceb519336c4c7167a709ffada49a6b57))
14
+
1
15
  ## [1.20.13](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.20.12...v1.20.13) (2026-11-02)
2
16
 
3
17
 
package/audit-ci.json CHANGED
@@ -5,20 +5,17 @@
5
5
  "critical": true,
6
6
  "report-type": "summary",
7
7
  "$allowlist-rationale": {
8
- "$status": "ACTIVE as of 2026-11-02 — 98 path-anchored entries, all dev/release-only (`npm ls --omit=dev` shows no vulnerable copy; the only prod ip-address is 10.7.5, patched). All 21 entries of 2026-10-12 went stale (npm 11.21.1 rebundled undici/ip-address/brace-expansion/http-cache-semantics/postcss-selector-parser; braces GHSA-vfj7 no longer reported) and were removed. See $added-2026-11-02.",
8
+ "$status": "ACTIVE as of 2026-11-23 — 52 path-anchored entries, ALL inside the npm CLI bundle (glob GHSA-3g3m-2fjr-6pw4 + minimatch GHSA-g3hv-75wg-m249; dev/release-only via @semantic-release/npm>npm). 46 entries of 2026-11-02 went stale and were removed. See $pruned-2026-11-23.",
9
9
  "$added-2026-10-12": "Scheduled run 38264336610 went red on seven paths. `npm audit fix` (non-forced) plus raising @modelcontextprotocol/sdk to ^1.31.0 cleared six (GHSA-6qxp-vccf-f47h sdk, GHSA-xw65-4hp5-5hc7/GHSA-8r5x-fm3f-whwj/GHSA-p8wg-vrv2-v86f handlebars, GHSA-jqcg-44mw-7w3h proxy-addr, GHSA-68fv-2mgg-jv7q source-map-js). The seventh, GHSA-rj75-hqrm-r3gf, is postcss-selector-parser 7.1.4 BUNDLED in the npm CLI (npm>@npmcli/arborist>@npmcli/query>postcss-selector-parser; fixed 7.1.6). Verified by UNPACKING the tarballs: npm 11.21.0 (latest 11.x) and 12.2.0 (latest) both vendor 7.1.4. Dev/release-only (`npm ls postcss-selector-parser --omit=dev` is empty). audit-ci renders it bare (`postcss-selector-parser`), so like undici/brace-expansion the entry is effectively advisory-wide for bare-rendered copies — acceptable only while no reachable copy exists. Re-check trigger: any npm 11.x/12.x release bundling postcss-selector-parser >=7.1.6 — then raise `overrides.npm` and delete this entry.",
10
10
  "$root-cause": "Entries land here when an advisory resolves to a dependency BUNDLED INSIDE THE npm CLI TARBALL (node_modules/npm/node_modules/*). npm ships those via bundleDependencies, so `overrides` in package.json cannot reach them — raising the `npm` override itself is the only lever. The npm CLI is dev/release-only (devDependencies -> @semantic-release/npm -> npm) and is stripped from the runtime Docker image, which is why suppressing was acceptable while no patched npm existed. Note @semantic-release/npm@13.1.5 declares `npm: ^11.6.2`, so a fix landing only in npm 12.x would need that constraint revisited.",
11
11
  "$added-2026-10-05": "Scheduled run 37319795785 went red. Overrides raised (fast-uri ^3.1.8, ip-address ^10.7.3, undici@6.x ^6.29.0, undici@7.x ^7.30.0, brace-expansion@1.x ^1.1.21, brace-expansion@2.x ^2.1.7) cleared every reachable copy. Two classes remain, both dev/release-only (`npm ls <pkg> --omit=dev` is empty for all of them): (1) braces 3.0.3, GHSA-vfj7-8cjw-p6xm, affected range `<=3.0.3` and 3.0.3 is the latest published braces — there is NO fixed version anywhere, so neither overrides nor `npm audit fix` can help (npm's suggested \"fix\" is a jest 30 / semantic-release major, which still resolves micromatch>braces 3.0.3). Reached only via micromatch from jest, semantic-release/@semantic-release/*, and vite-plugin-singlefile (build-time). (2) Copies BUNDLED in the npm CLI: undici 6.28.0 (GHSA-3wwx-pv8p-q78v, GHSA-r53p-7pc4-xj5r, GHSA-rfgv-xxqx-mfg5; fixed 6.28.1), ip-address 10.5.0 (GHSA-rpw4-54j3-4h4q, GHSA-2vr4-cq9g-pvrc, GHSA-j6r3-76f7-8jcv, GHSA-h3mg-xc3c-68pw; fixed 10.7.1+), brace-expansion 5.0.9 (GHSA-6j4f-fj2g-mc7p, GHSA-qhr7-859c-m2p7, GHSA-q2hr-2g5m-vwhr; fixed 5.0.12), http-cache-semantics 4.2.0 (GHSA-ch52-4w7c-c8xp). Verified by UNPACKING the tarballs: npm 11.21.0 (latest 11.x) and 12.2.0 (latest) both still vendor exactly these versions, so raising `overrides.npm` gains nothing. Re-check triggers: (a) a braces release >3.0.3 or micromatch dropping braces — then delete the GHSA-vfj7 entries; (b) any new npm 11.x/12.x release — unpack it and check node_modules/{undici,ip-address,brace-expansion,http-cache-semantics}; once patched, raise `overrides.npm` and delete those entries (12.x additionally needs @semantic-release/npm to accept npm 12).",
12
12
  "$braces-wildcards-2026-10-05": "braces renders as 33 distinct effects-chain paths (one per jest/semantic-release package in the chain), so it is allowlisted with wildcards ANCHORED on the dev-only root families instead of 33 literals that every jest bump would churn. Each record still requires the path to START with a known dev root (jest*, @jest/*, expect>, create-jest>, @types/jest>, semantic-release>, @semantic-release/*, vite-plugin-singlefile>) or be the bare `micromatch>braces` chain, so braces arriving via a new production root still fails CI. Do NOT collapse this to `GHSA-vfj7-8cjw-p6xm|*` or a bare ID. The bundled-npm entries are literal; note `undici` and `brace-expansion` render bare for reachable copies too (see $scoping), so those two are effectively advisory-wide — acceptable only while every reachable copy is pinned past the fix by overrides.",
13
13
  "$cleared-2026-09-07": "npm 11.19.1 rebundled the entire stale set at patched versions in one release — tar 7.5.22 (needed >=7.5.21), undici 6.28.0, ip-address 10.5.0, brace-expansion 5.0.9 — clearing GHSA-r292-9mhp-454m, GHSA-8xcm-r25x-g524, GHSA-m8rv-5g2x-5cg5, GHSA-v3r7-h72x-cjcm, GHSA-mwp4-54f8-5fhr, GHSA-4xrf-jv44-h6hh, GHSA-22jq-vg5j-6vgg, GHSA-mh99-v99m-4gvg and GHSA-rgw5-rvv9-x895 together. `overrides.npm` is now pinned at `^11.19.1` (raised from `^11.16.0`), so this repo DECLARES 11.19.1 as its minimum rather than merely happening to install it. $root-cause names that key as the only lever over the bundled set, and the pin is what makes the lever declarative instead of incidental. Two things to keep in proportion: resolution takes the highest match, so the installed npm would be >=11.19.1 anyway and `npm ci` reads the lockfile regardless — the pin buys intent, not a behaviour change; and with the allowlist empty, any regression fails the gate loudly rather than being silently suppressed. Going forward, re-derive this floor rather than trusting it. A floor that was correct when written goes stale the moment npm rebundles again, and a stale floor mistaken for a vetted one is precisely how `^11.16.0` outlived its own rationale. Always check whether a newer npm rebundles the package before adding an entry back.",
14
14
  "$scoping": "If an entry is ever needed again, path-scope it (`GHSA-ID|path`) rather than using a bare advisory ID, so a REACHABLE reintroduction of the same advisory still fails CI. Render the path the way audit-ci does — from npm audit's `effects` chain, NOT the full path to the root: npm's bundled tar renders as `npm>tar`, and a package nothing depends on renders as its bare name. This bit CI on 2026-09-07: the entry read `semantic-release>@semantic-release/npm>npm>tar` and silently stopped matching once the graph shifted. audit-ci only prints `Consider not allowlisting path: ...` for a stale entry and still exits 0, so that warning is a real signal — an advisory you believe is suppressed no longer is.",
15
- "$added-2026-11-02": "PR #165 Dependency Check went red. Fixed: `npm audit fix` (lockfile), zod ^3.23 -> ^4.6.7 (GHSA-mrhx-c7xc-m3w5 HIGH, direct prod dep; 3.x has no fix), scoped overrides minimatch@10.x -> ^11.0.4 and glob@13.x -> ^14.0.3 (reachable typescript-estree copy). Allowlisted, no fix reachable: (1) minimatch GHSA-g3hv-75wg-m249 (<11.0.1) on the minimatch@3 line used by jest/eslint/babel-plugin-istanbul — no 3.x backport, and v11 changes the CJS export so a blanket override would break minimatch@3 callers (the brace-expansion v5 trap). (2) glob GHSA-3g3m-2fjr-6pw4 (9.0.0-14.0.1) and minimatch GHSA-g3hv, undici GHSA-2m5v-pch6-74hx/GHSA-qrxm-fqhp-jwvm/GHSA-xjj6-f33q-929c/GHSA-4qv8-2p9j-2685/GHSA-9fm3-97px-rjf6 (<6.29.1), ip-address GHSA-rxp7-6hxx-x8q5 (<=10.7.3) BUNDLED in the npm CLI — verified by unpacking: npm 11.21.1 and 12.2.1 (latest) both vendor undici 6.29.0, ip-address 10.7.2, glob 13.0.6, minimatch 10.2.5. (3) deepmerge GHSA-gcqx-w48m-w2h4 (<=4.3.1) via jest-config — 4.3.1 is the latest deepmerge, no fix exists. Entries are anchored on the effects-chain root (`<root>>*`), so a NEW route from any other root (e.g. a prod dependency) still fails. Re-check triggers: npm release bundling undici>=6.29.1, ip-address>=10.7.4, glob>=14.0.2, minimatch>=11.0.1 (unpack to check); deepmerge>4.3.1; jest 30 / eslint dropping minimatch@3."
15
+ "$added-2026-11-02": "PR #165 Dependency Check went red. Fixed: `npm audit fix` (lockfile), zod ^3.23 -> ^4.6.7 (GHSA-mrhx-c7xc-m3w5 HIGH, direct prod dep; 3.x has no fix), scoped overrides minimatch@10.x -> ^11.0.4 and glob@13.x -> ^14.0.3 (reachable typescript-estree copy). Allowlisted, no fix reachable: (1) minimatch GHSA-g3hv-75wg-m249 (<11.0.1) on the minimatch@3 line used by jest/eslint/babel-plugin-istanbul — no 3.x backport, and v11 changes the CJS export so a blanket override would break minimatch@3 callers (the brace-expansion v5 trap). (2) glob GHSA-3g3m-2fjr-6pw4 (9.0.0-14.0.1) and minimatch GHSA-g3hv, undici GHSA-2m5v-pch6-74hx/GHSA-qrxm-fqhp-jwvm/GHSA-xjj6-f33q-929c/GHSA-4qv8-2p9j-2685/GHSA-9fm3-97px-rjf6 (<6.29.1), ip-address GHSA-rxp7-6hxx-x8q5 (<=10.7.3) BUNDLED in the npm CLI — verified by unpacking: npm 11.21.1 and 12.2.1 (latest) both vendor undici 6.29.0, ip-address 10.7.2, glob 13.0.6, minimatch 10.2.5. (3) deepmerge GHSA-gcqx-w48m-w2h4 (<=4.3.1) via jest-config — 4.3.1 is the latest deepmerge, no fix exists. Entries are anchored on the effects-chain root (`<root>>*`), so a NEW route from any other root (e.g. a prod dependency) still fails. Re-check triggers: npm release bundling undici>=6.29.1, ip-address>=10.7.4, glob>=14.0.2, minimatch>=11.0.1 (unpack to check); deepmerge>4.3.1; jest 30 / eslint dropping minimatch@3.",
16
+ "$pruned-2026-11-23": "Scheduled runs 43891810396/45228833581 went red on @hono/node-server GHSA-qv5m-9pm6-hqp3 + GHSA-jpvv-r467-5p4w (>=2.0.0 <2.1.6, prod transitive via @modelcontextprotocol/sdk). Fixed: overrides `@hono/node-server` ^2.0.5 -> ^2.1.6 (the override is the only lever, the SDK declares ^1), lockfile resolves 2.1.11; `npm audit fix` also moved npm 11.21.1 -> 11.21.3, which rebundles undici 6.29.1 and ip-address 10.7.5. Removed as stale (audit-ci `Consider not allowlisting`): all undici (GHSA-2m5v/qrxm/xjj6/4qv8/9fm3) and ip-address GHSA-rxp7 entries; every jest/eslint/typescript-eslint/babel root for glob GHSA-3g3m and minimatch GHSA-g3hv (no longer reported on the minimatch@3 / jest line); all deepmerge GHSA-gcqx entries. Remaining 52 = the live failing paths regenerated mechanically from a blanked allowlist as `GHSA|<effects-root>>*`. Verified by unpacking: npm 11.21.3 (latest 11.x) and 12.2.3 (latest) both vendor glob 13.0.6 and minimatch 10.2.5. Re-check trigger: an npm release bundling glob>=14.0.2 and minimatch>=11.0.1."
16
17
  },
17
18
  "allowlist": [
18
- "GHSA-2m5v-pch6-74hx|undici",
19
- "GHSA-3g3m-2fjr-6pw4|@jest/expect>*",
20
- "GHSA-3g3m-2fjr-6pw4|@jest/globals>*",
21
- "GHSA-3g3m-2fjr-6pw4|@jest/transform>*",
22
19
  "GHSA-3g3m-2fjr-6pw4|@npmcli/arborist>*",
23
20
  "GHSA-3g3m-2fjr-6pw4|@npmcli/config>*",
24
21
  "GHSA-3g3m-2fjr-6pw4|@npmcli/map-workspaces>*",
@@ -27,19 +24,9 @@
27
24
  "GHSA-3g3m-2fjr-6pw4|@npmcli/run-script>*",
28
25
  "GHSA-3g3m-2fjr-6pw4|@semantic-release/github>*",
29
26
  "GHSA-3g3m-2fjr-6pw4|@sigstore/tuf>*",
30
- "GHSA-3g3m-2fjr-6pw4|babel-jest>*",
31
- "GHSA-3g3m-2fjr-6pw4|babel-plugin-istanbul>*",
32
27
  "GHSA-3g3m-2fjr-6pw4|cacache>*",
33
- "GHSA-3g3m-2fjr-6pw4|create-jest>*",
34
28
  "GHSA-3g3m-2fjr-6pw4|glob>*",
35
29
  "GHSA-3g3m-2fjr-6pw4|init-package-json>*",
36
- "GHSA-3g3m-2fjr-6pw4|jest-circus>*",
37
- "GHSA-3g3m-2fjr-6pw4|jest-cli>*",
38
- "GHSA-3g3m-2fjr-6pw4|jest-config>*",
39
- "GHSA-3g3m-2fjr-6pw4|jest-resolve-dependencies>*",
40
- "GHSA-3g3m-2fjr-6pw4|jest-runner>*",
41
- "GHSA-3g3m-2fjr-6pw4|jest-runtime>*",
42
- "GHSA-3g3m-2fjr-6pw4|jest-snapshot>*",
43
30
  "GHSA-3g3m-2fjr-6pw4|libnpmaccess>*",
44
31
  "GHSA-3g3m-2fjr-6pw4|libnpmexec>*",
45
32
  "GHSA-3g3m-2fjr-6pw4|libnpmfund>*",
@@ -54,15 +41,6 @@
54
41
  "GHSA-3g3m-2fjr-6pw4|npm-registry-fetch>*",
55
42
  "GHSA-3g3m-2fjr-6pw4|pacote>*",
56
43
  "GHSA-3g3m-2fjr-6pw4|sigstore>*",
57
- "GHSA-3g3m-2fjr-6pw4|ts-jest>*",
58
- "GHSA-4qv8-2p9j-2685|undici",
59
- "GHSA-9fm3-97px-rjf6|undici",
60
- "GHSA-g3hv-75wg-m249|@eslint-community/eslint-utils>*",
61
- "GHSA-g3hv-75wg-m249|@eslint/eslintrc>*",
62
- "GHSA-g3hv-75wg-m249|@jest/expect>*",
63
- "GHSA-g3hv-75wg-m249|@jest/globals>*",
64
- "GHSA-g3hv-75wg-m249|@jest/reporters>*",
65
- "GHSA-g3hv-75wg-m249|@jest/transform>*",
66
44
  "GHSA-g3hv-75wg-m249|@npmcli/arborist>*",
67
45
  "GHSA-g3hv-75wg-m249|@npmcli/config>*",
68
46
  "GHSA-g3hv-75wg-m249|@npmcli/map-workspaces>*",
@@ -71,23 +49,9 @@
71
49
  "GHSA-g3hv-75wg-m249|@npmcli/run-script>*",
72
50
  "GHSA-g3hv-75wg-m249|@semantic-release/github>*",
73
51
  "GHSA-g3hv-75wg-m249|@sigstore/tuf>*",
74
- "GHSA-g3hv-75wg-m249|@typescript-eslint/parser>*",
75
- "GHSA-g3hv-75wg-m249|@typescript-eslint/type-utils>*",
76
- "GHSA-g3hv-75wg-m249|@typescript-eslint/utils>*",
77
- "GHSA-g3hv-75wg-m249|babel-jest>*",
78
- "GHSA-g3hv-75wg-m249|babel-plugin-istanbul>*",
79
52
  "GHSA-g3hv-75wg-m249|cacache>*",
80
- "GHSA-g3hv-75wg-m249|create-jest>*",
81
- "GHSA-g3hv-75wg-m249|eslint>*",
82
53
  "GHSA-g3hv-75wg-m249|glob>*",
83
54
  "GHSA-g3hv-75wg-m249|init-package-json>*",
84
- "GHSA-g3hv-75wg-m249|jest-circus>*",
85
- "GHSA-g3hv-75wg-m249|jest-cli>*",
86
- "GHSA-g3hv-75wg-m249|jest-config>*",
87
- "GHSA-g3hv-75wg-m249|jest-resolve-dependencies>*",
88
- "GHSA-g3hv-75wg-m249|jest-runner>*",
89
- "GHSA-g3hv-75wg-m249|jest-runtime>*",
90
- "GHSA-g3hv-75wg-m249|jest-snapshot>*",
91
55
  "GHSA-g3hv-75wg-m249|libnpmaccess>*",
92
56
  "GHSA-g3hv-75wg-m249|libnpmexec>*",
93
57
  "GHSA-g3hv-75wg-m249|libnpmfund>*",
@@ -103,15 +67,6 @@
103
67
  "GHSA-g3hv-75wg-m249|npm-profile>*",
104
68
  "GHSA-g3hv-75wg-m249|npm-registry-fetch>*",
105
69
  "GHSA-g3hv-75wg-m249|pacote>*",
106
- "GHSA-g3hv-75wg-m249|sigstore>*",
107
- "GHSA-g3hv-75wg-m249|ts-jest>*",
108
- "GHSA-g3hv-75wg-m249|typescript-eslint>*",
109
- "GHSA-gcqx-w48m-w2h4|create-jest>*",
110
- "GHSA-gcqx-w48m-w2h4|jest-cli>*",
111
- "GHSA-gcqx-w48m-w2h4|jest-config>*",
112
- "GHSA-gcqx-w48m-w2h4|ts-jest>*",
113
- "GHSA-qrxm-fqhp-jwvm|undici",
114
- "GHSA-rxp7-6hxx-x8q5|ip-address",
115
- "GHSA-xjj6-f33q-929c|undici"
70
+ "GHSA-g3hv-75wg-m249|sigstore>*"
116
71
  ]
117
72
  }
@@ -35,14 +35,14 @@ export async function chatDuckTool(providerManager, conversationManager, args) {
35
35
  model,
36
36
  });
37
37
  // Add assistant response to conversation
38
- conversationManager.addMessage(conversation_id, {
38
+ const updated = conversationManager.addMessage(conversation_id, {
39
39
  role: 'assistant',
40
40
  content: response.content,
41
41
  timestamp: new Date(),
42
42
  provider: providerToUse,
43
43
  });
44
44
  const text = `${formatDuckReply(response)}\n\n` +
45
- `💬 Conversation: ${conversation_id} | Messages: ${messages.length + 1}\n` +
45
+ `💬 Conversation: ${conversation_id} | Messages: ${updated.messages.length}\n` +
46
46
  formatDuckFooter(response);
47
47
  logger.info(`Duck ${response.nickname} responded in conversation ${conversation_id}`);
48
48
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-duck.js","sourceRoot":"","sources":["../../src/tools/chat-duck.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,eAAgC,EAChC,mBAAwC,EACxC,IAA6B;IAE7B,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAM7D,CAAC;IAEF,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC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AC,QAAQ,CAAC,MAAM,IAAI;QAC9E,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAE7B,MAAM,CAAC,IAAI,CAAC,QAAQ,QAAQ,CAAC,QAAQ,8BAA8B,eAAe,EAAE,CAAC,CAAC;IAEtF,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI;aACL;SACF;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-rubber-duck",
3
- "version": "1.20.13",
3
+ "version": "1.20.15",
4
4
  "description": "An MCP server that bridges to multiple OpenAI-compatible LLMs - your AI rubber duck debugging panel",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -71,14 +71,14 @@
71
71
  "vite-plugin-singlefile": "^2.3.0"
72
72
  },
73
73
  "$overrides-rationale": {
74
- "@hono/node-server": "Major-version override (2.x) against the MCP SDK's declared ^1.19.9 — GHSA-frvp-7c67-39w9 is patched only in 2.0.5 and the 1.x line has no fix. Safe here: the SDK pulls @hono/node-server in for its server-side streamableHttp transport, which this project never imports (we use StreamableHTTPClientTransport, the client side, in src/services/mcp-client-manager.ts). v2 keeps the same serve/getRequestListener API. Revisit if this project ever serves MCP over HTTP, or drop the override once the SDK moves to ^2."
74
+ "@hono/node-server": "Major-version override (2.x) against the MCP SDK's declared ^1.19.9 — GHSA-frvp-7c67-39w9 is patched only in 2.0.5 and the 1.x line has no fix; floor raised to 2.1.6 on 2026-11-23 for GHSA-qv5m-9pm6-hqp3 and GHSA-jpvv-r467-5p4w. Safe here: the SDK pulls @hono/node-server in for its server-side streamableHttp transport, which this project never imports (we use StreamableHTTPClientTransport, the client side, in src/services/mcp-client-manager.ts). v2 keeps the same serve/getRequestListener API. Revisit if this project ever serves MCP over HTTP, or drop the override once the SDK moves to ^2."
75
75
  },
76
76
  "overrides": {
77
77
  "js-yaml": "^4.3.1",
78
78
  "lodash": "^4.17.23",
79
79
  "lodash-es": "^4.17.23",
80
80
  "hono": "^4.13.1",
81
- "@hono/node-server": "^2.0.5",
81
+ "@hono/node-server": "^2.1.6",
82
82
  "fast-uri": "^3.1.8",
83
83
  "postcss": "^8.5.18",
84
84
  "ip-address": "^10.7.3",
@@ -54,7 +54,7 @@ export async function chatDuckTool(
54
54
  });
55
55
 
56
56
  // Add assistant response to conversation
57
- conversationManager.addMessage(conversation_id, {
57
+ const updated = conversationManager.addMessage(conversation_id, {
58
58
  role: 'assistant',
59
59
  content: response.content,
60
60
  timestamp: new Date(),
@@ -63,7 +63,7 @@ export async function chatDuckTool(
63
63
 
64
64
  const text =
65
65
  `${formatDuckReply(response)}\n\n` +
66
- `💬 Conversation: ${conversation_id} | Messages: ${messages.length + 1}\n` +
66
+ `💬 Conversation: ${conversation_id} | Messages: ${updated.messages.length}\n` +
67
67
  formatDuckFooter(response);
68
68
 
69
69
  logger.info(`Duck ${response.nickname} responded in conversation ${conversation_id}`);
@@ -178,6 +178,13 @@ describe('chatDuckTool', () => {
178
178
  mockConversationManager.getConversationContext.mockReturnValue([
179
179
  { role: 'user' as const, content: 'Hello', timestamp: new Date() },
180
180
  ]);
181
+ mockConversationManager.addMessage.mockReturnValue({
182
+ ...mockConversation,
183
+ messages: [
184
+ { role: 'user' as const, content: 'Hello', timestamp: new Date() },
185
+ { role: 'assistant' as const, content: 'Hi', timestamp: new Date() },
186
+ ],
187
+ });
181
188
 
182
189
  const result = await chatDuckTool(mockProviderManager, mockConversationManager, {
183
190
  conversation_id: 'test-conv',
@@ -186,7 +193,7 @@ describe('chatDuckTool', () => {
186
193
 
187
194
  expect(result.content[0].text).toContain('OpenAI Duck');
188
195
  expect(result.content[0].text).toContain('test-conv');
189
- expect(result.content[0].text).toContain('Messages: 2'); // context (1) + 1 new
196
+ expect(result.content[0].text).toContain('Messages: 2'); // user + assistant
190
197
  expect(result.content[0].text).toContain('150ms');
191
198
  });
192
199
 
@@ -201,4 +208,20 @@ describe('chatDuckTool', () => {
201
208
 
202
209
  expect(mockConversationManager.createConversation).toHaveBeenCalledWith('new-conv', 'groq');
203
210
  });
211
+
212
+ it('counts each message once with a real ConversationManager (regression: live array + 1)', async () => {
213
+ const realManager = new ConversationManager();
214
+
215
+ const first = await chatDuckTool(mockProviderManager, realManager, {
216
+ conversation_id: 'count-conv',
217
+ message: 'Remember teal',
218
+ });
219
+ expect(first.content[0].text).toContain('Messages: 2');
220
+
221
+ const second = await chatDuckTool(mockProviderManager, realManager, {
222
+ conversation_id: 'count-conv',
223
+ message: 'What word?',
224
+ });
225
+ expect(second.content[0].text).toContain('Messages: 4');
226
+ });
204
227
  });