@codeforbreakfast/commy-mcp 0.19.0 → 0.19.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +57 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeforbreakfast/commy-mcp",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "commy MCP server — the inter-agent communication substrate, runnable on node via npx.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/server.js CHANGED
@@ -3048,13 +3048,14 @@ var require_data = __commonJS((exports, module) => {
3048
3048
  };
3049
3049
  });
3050
3050
 
3051
- // node_modules/.bun/fast-uri@4.0.0/node_modules/fast-uri/lib/utils.js
3051
+ // node_modules/.bun/fast-uri@4.1.0/node_modules/fast-uri/lib/utils.js
3052
3052
  var require_utils = __commonJS((exports, module) => {
3053
3053
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
3054
3054
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
3055
3055
  var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
3056
3056
  var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
3057
3057
  var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
3058
+ var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/?]$/iu);
3058
3059
  function stringArrayToHexStripped(input) {
3059
3060
  let acc = "";
3060
3061
  let code = 0;
@@ -3198,7 +3199,7 @@ var require_utils = __commonJS((exports, module) => {
3198
3199
  continue;
3199
3200
  }
3200
3201
  } else if (input[0] === "/") {
3201
- if (input[1] === "." || input[1] === "/") {
3202
+ if (input[1] === ".") {
3202
3203
  output.push("/");
3203
3204
  break;
3204
3205
  }
@@ -3340,6 +3341,47 @@ var require_utils = __commonJS((exports, module) => {
3340
3341
  }
3341
3342
  return output;
3342
3343
  }
3344
+ function normalizeQueryFragmentEncoding(input) {
3345
+ let output = "";
3346
+ for (let i = 0;i < input.length; i++) {
3347
+ const ch = input[i];
3348
+ if (ch === "%" && i + 2 < input.length) {
3349
+ const hex = input.slice(i + 1, i + 3);
3350
+ if (isHexPair(hex)) {
3351
+ const normalizedHex = hex.toUpperCase();
3352
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
3353
+ if (isUnreserved(decoded)) {
3354
+ output += decoded;
3355
+ } else {
3356
+ output += "%" + normalizedHex;
3357
+ }
3358
+ i += 2;
3359
+ continue;
3360
+ }
3361
+ }
3362
+ if (isQueryFragmentCharacter(ch)) {
3363
+ output += ch;
3364
+ } else {
3365
+ const code = input.charCodeAt(i);
3366
+ if (code < 128) {
3367
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
3368
+ } else if (code < 55296 || code > 57343) {
3369
+ output += percentEncodeNonAscii(code);
3370
+ } else if (code <= 56319 && i + 1 < input.length) {
3371
+ const low = input.charCodeAt(i + 1);
3372
+ if (low >= 56320 && low <= 57343) {
3373
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
3374
+ i++;
3375
+ } else {
3376
+ output += percentEncodeNonAscii(65533);
3377
+ }
3378
+ } else {
3379
+ output += percentEncodeNonAscii(65533);
3380
+ }
3381
+ }
3382
+ }
3383
+ return output;
3384
+ }
3343
3385
  function escapePreservingEscapes(input) {
3344
3386
  let output = "";
3345
3387
  for (let i = 0;i < input.length; i++) {
@@ -3401,6 +3443,7 @@ var require_utils = __commonJS((exports, module) => {
3401
3443
  reescapeHostDelimiters,
3402
3444
  normalizePercentEncoding,
3403
3445
  normalizePathEncoding,
3446
+ normalizeQueryFragmentEncoding,
3404
3447
  escapePreservingEscapes,
3405
3448
  removeDotSegments,
3406
3449
  isIPv4,
@@ -3410,7 +3453,7 @@ var require_utils = __commonJS((exports, module) => {
3410
3453
  };
3411
3454
  });
3412
3455
 
3413
- // node_modules/.bun/fast-uri@4.0.0/node_modules/fast-uri/lib/schemes.js
3456
+ // node_modules/.bun/fast-uri@4.1.0/node_modules/fast-uri/lib/schemes.js
3414
3457
  var require_schemes = __commonJS((exports, module) => {
3415
3458
  var { isUUID } = require_utils();
3416
3459
  var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
@@ -3584,9 +3627,9 @@ var require_schemes = __commonJS((exports, module) => {
3584
3627
  };
3585
3628
  });
3586
3629
 
3587
- // node_modules/.bun/fast-uri@4.0.0/node_modules/fast-uri/index.js
3630
+ // node_modules/.bun/fast-uri@4.1.0/node_modules/fast-uri/index.js
3588
3631
  var require_fast_uri = __commonJS((exports, module) => {
3589
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3632
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, normalizeQueryFragmentEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3590
3633
  var { SCHEMES, getSchemeHandler } = require_schemes();
3591
3634
  function normalize3(uri, options5) {
3592
3635
  if (typeof uri === "string") {
@@ -3755,7 +3798,7 @@ var require_fast_uri = __commonJS((exports, module) => {
3755
3798
  }
3756
3799
  const matches = uri.match(URI_PARSE);
3757
3800
  if (matches) {
3758
- parsed.scheme = matches[1];
3801
+ parsed.scheme = matches[1] === undefined ? undefined : matches[1].toLowerCase();
3759
3802
  parsed.userinfo = matches[3];
3760
3803
  parsed.host = matches[4];
3761
3804
  parsed.port = parseInt(matches[5], 10);
@@ -3796,7 +3839,7 @@ var require_fast_uri = __commonJS((exports, module) => {
3796
3839
  if (!options5.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
3797
3840
  if (parsed.host && (options5.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
3798
3841
  try {
3799
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
3842
+ parsed.host = new URL("http://" + parsed.host).hostname;
3800
3843
  } catch (e) {
3801
3844
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
3802
3845
  }
@@ -3814,12 +3857,11 @@ var require_fast_uri = __commonJS((exports, module) => {
3814
3857
  if (parsed.path) {
3815
3858
  parsed.path = normalizePathEncoding(parsed.path);
3816
3859
  }
3860
+ if (parsed.query) {
3861
+ parsed.query = normalizeQueryFragmentEncoding(parsed.query);
3862
+ }
3817
3863
  if (parsed.fragment) {
3818
- try {
3819
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
3820
- } catch {
3821
- parsed.error = parsed.error || "URI malformed";
3822
- }
3864
+ parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
3823
3865
  }
3824
3866
  }
3825
3867
  if (schemeHandler && schemeHandler.parse) {
@@ -47954,6 +47996,7 @@ var sanitiseShortName = (name) => {
47954
47996
  const collapsed = name.toLowerCase().replace(SHORT_NAME_PATTERN, "-");
47955
47997
  return collapsed.replace(/^-+|-+$/g, "") || "bot";
47956
47998
  };
47999
+ var ACQUIRE_MINT_TIMEOUT = exports_Duration.seconds(30);
47957
48000
  var userSchema = exports_Schema.Struct({
47958
48001
  user_id: exports_Schema.Int,
47959
48002
  email: exports_Schema.String,
@@ -48226,7 +48269,7 @@ var zulipAdapter = (config2) => exports_Effect.gen(function* () {
48226
48269
  }
48227
48270
  return exports_Effect.die(new Error(`zulipAdapter: already bound to ${existing.acquiredName} — release() before acquiring ${name}`));
48228
48271
  },
48229
- onNone: () => provideMintedFor(name).pipe(exports_Effect.flatMap((minted) => exports_Effect.gen(function* () {
48272
+ onNone: () => provideMintedFor(name).pipe(exports_Effect.timeout(ACQUIRE_MINT_TIMEOUT), exports_Effect.flatMap((minted) => exports_Effect.gen(function* () {
48230
48273
  const innerHttp = yield* makeZulipHttp(buildHttpConfig(config2.realmUrl, minted.email, minted.apiKey, config2.hostHeader)).pipe(exports_Effect.provideService(exports_HttpClient.HttpClient, httpClient));
48231
48274
  const http = wrapBotHttp(innerHttp, recipientDirectory, minted.userId);
48232
48275
  const ident = {
@@ -58849,7 +58892,7 @@ class Server extends Protocol {
58849
58892
  }
58850
58893
 
58851
58894
  // packages/mcp/mcp-server.ts
58852
- var PLUGIN_VERSION = "0.19.0";
58895
+ var PLUGIN_VERSION = "0.19.1";
58853
58896
  var COMMY_INSTRUCTIONS = `**Substrate.** commy is the inter-agent channel: agents and humans coordinate here. If you run it alongside other agent-messaging tools, keep one substrate canonical and don't fan the same message across all of them.
58854
58897
 
58855
58898
  **Channels.** Each project has one channel: \`#<project-slug>\` where the slug is resolved per session as \`COMMY_PROJECT\` env > git remote \`origin\` basename > git root basename. Sessions launched outside a git repo (e.g. \`/tmp\`, \`$HOME\`) have no project channel and should post to \`#general\` instead. Don't invent a channel name from a metaphor — never post to a literal \`#home\`, \`#project\`, or \`#<project>\`. Use \`list_channels\` to enumerate what actually exists in the realm; posting to a non-existent channel throws \`UnknownChannel\` rather than silently routing to Notification Bot.