@agentrq/acp-gateway 0.2.32 → 0.2.34

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.
@@ -1,6 +1,25 @@
1
1
  /**
2
2
  * Task identity from MCP channel `meta` for ACP session switching (agentrq `chat_id`).
3
3
  */
4
+ /**
5
+ * Patterns used to extract taskId from text content.
6
+ *
7
+ * Ordered from most specific agentrq channel notification envelope
8
+ * ([Task ...], [Reply to task ...], [Response to task ...], [Task reassigned to agent] ...)
9
+ * to generic task/ID patterns.
10
+ */
11
+ const TASK_ID_PATTERNS = [
12
+ /\[Task\s+([a-zA-Z0-9_-]+)\]/i,
13
+ /\[Reply to task\s+([a-zA-Z0-9_-]+)\]/i,
14
+ /\[Response to task\s+([a-zA-Z0-9_-]+)\]/i,
15
+ /\[Task reassigned to agent\]\s+([a-zA-Z0-9_-]+)/i,
16
+ /Task ID[: \t]+([a-zA-Z0-9_-]+)/i,
17
+ /Response to task[: \t]+([a-zA-Z0-9_-]+)/i,
18
+ /working on task\s+([a-zA-Z0-9_-]+)/i,
19
+ /\bID[: \t]+([a-zA-Z0-9_-]+)/,
20
+ /\bchat_id[":=\s]+([a-zA-Z0-9_-]+)/i,
21
+ /task[: \t]+([a-zA-Z0-9_-]+)/i,
22
+ ];
4
23
  /** Task identity from `notifications/claude/channel` `meta` (agentrq uses `chat_id`). */
5
24
  export function extractTaskIdFromMeta(meta) {
6
25
  if (!meta || typeof meta !== "object")
@@ -12,15 +31,7 @@ export function extractTaskIdFromMeta(meta) {
12
31
  }
13
32
  /** Try to extract taskId from text content as a fallback. */
14
33
  export function extractTaskIdFromText(text) {
15
- // Try to match "Task ID: <id>" or "Response to task <id>" or just "task <id>"
16
- const patterns = [
17
- /Task ID[: \t]+([a-zA-Z0-9_-]+)/i,
18
- /Response to task[: \t]+([a-zA-Z0-9_-]+)/i,
19
- /task[: \t]+([a-zA-Z0-9_-]+)/i,
20
- /\bID[: \t]+([a-zA-Z0-9_-]+)/,
21
- /\bchat_id[":=\s]+([a-zA-Z0-9_-]+)/i,
22
- ];
23
- for (const pattern of patterns) {
34
+ for (const pattern of TASK_ID_PATTERNS) {
24
35
  const match = text.match(pattern);
25
36
  if (match && match[1])
26
37
  return match[1];
@@ -1 +1 @@
1
- {"version":3,"file":"taskIdentity.js","sourceRoot":"","sources":["../src/taskIdentity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,yFAAyF;AACzF,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxD,MAAM,CAAC,GAAG,IAA+B,CAAC;IAC1C,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,OAAO,CAAC;IAC5E,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,8EAA8E;IAC9E,MAAM,QAAQ,GAAG;QACf,iCAAiC;QACjC,0CAA0C;QAC1C,8BAA8B;QAC9B,6BAA6B;QAC7B,oCAAoC;KACrC,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"taskIdentity.js","sourceRoot":"","sources":["../src/taskIdentity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAsB;IAC1C,8BAA8B;IAC9B,uCAAuC;IACvC,0CAA0C;IAC1C,kDAAkD;IAClD,iCAAiC;IACjC,0CAA0C;IAC1C,qCAAqC;IACrC,6BAA6B;IAC7B,oCAAoC;IACpC,8BAA8B;CAC/B,CAAC;AAEF,yFAAyF;AACzF,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxD,MAAM,CAAC,GAAG,IAA+B,CAAC;IAC1C,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,OAAO,CAAC;IAC5E,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentrq/acp-gateway",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "ACP+MCP bridge CLI for agentrq workspaces",
5
5
  "type": "module",
6
6
  "publishConfig": {