@cat-factory/integrations 0.86.4 → 0.86.5
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,3 +1,4 @@
|
|
|
1
|
+
import type { TaskRef } from '@cat-factory/kernel';
|
|
1
2
|
export interface ExtractedReferences {
|
|
2
3
|
/** Jira-style issue keys, e.g. `PROJ-123` (uppercased project + number). */
|
|
3
4
|
jiraKeys: string[];
|
|
@@ -5,6 +6,14 @@ export interface ExtractedReferences {
|
|
|
5
6
|
githubRefs: string[];
|
|
6
7
|
/** Absolute http(s) URLs, for matching against an imported item's canonical URL. */
|
|
7
8
|
urls: string[];
|
|
9
|
+
/**
|
|
10
|
+
* The keyed (non-URL) references tagged with the task source each resolves against — Jira
|
|
11
|
+
* keys under `jira`, GitHub refs under `github`. This is the single place a reference SHAPE
|
|
12
|
+
* is bound to a task source, so the engine batch-resolves them (`TaskRepository.listByRefs`)
|
|
13
|
+
* without re-hardcoding those source literals at the call site. Ordered jira-then-github,
|
|
14
|
+
* preserving `jiraKeys`/`githubRefs` order, so downstream dedupe stays deterministic.
|
|
15
|
+
*/
|
|
16
|
+
taskRefs: TaskRef[];
|
|
8
17
|
}
|
|
9
18
|
/**
|
|
10
19
|
* Pull every explicitly-named reference out of a block of prose. Returns deduped
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/corpus/references.logic.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,oFAAoF;IACpF,IAAI,EAAE,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"references.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/corpus/references.logic.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,oFAAoF;IACpF,IAAI,EAAE,MAAM,EAAE,CAAA;IACd;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB;AAoBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAUnE"}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// fully-qualified `owner/repo#12` id, and a workspace can hold many repos, so a bare
|
|
12
12
|
// number is inherently ambiguous — it cannot be resolved high-confidence and would
|
|
13
13
|
// either silently never match or pull in the wrong repo's issue. A same-repo issue
|
|
14
|
-
// should be named as `owner/repo#12` (or by its URL) to be picked up. Pure
|
|
15
|
-
//
|
|
14
|
+
// should be named as `owner/repo#12` (or by its URL) to be picked up. Pure (no LLM, no
|
|
15
|
+
// network) so it stays trivially testable.
|
|
16
16
|
// A Jira key is an uppercase project key (letter then letters/digits) + `-` + digits.
|
|
17
17
|
// Word-bounded so it doesn't catch mid-identifier substrings.
|
|
18
18
|
const JIRA_KEY = /\b[A-Z][A-Z0-9]+-\d+\b/g;
|
|
@@ -35,10 +35,14 @@ function trimUrl(url) {
|
|
|
35
35
|
*/
|
|
36
36
|
export function extractReferences(text) {
|
|
37
37
|
if (!text)
|
|
38
|
-
return { jiraKeys: [], githubRefs: [], urls: [] };
|
|
38
|
+
return { jiraKeys: [], githubRefs: [], urls: [], taskRefs: [] };
|
|
39
39
|
const jiraKeys = unique(text.match(JIRA_KEY) ?? []);
|
|
40
40
|
const githubRefs = unique(text.match(GITHUB_REF) ?? []);
|
|
41
41
|
const urls = unique((text.match(URL) ?? []).map(trimUrl));
|
|
42
|
-
|
|
42
|
+
const taskRefs = [
|
|
43
|
+
...jiraKeys.map((externalId) => ({ source: 'jira', externalId })),
|
|
44
|
+
...githubRefs.map((externalId) => ({ source: 'github', externalId })),
|
|
45
|
+
];
|
|
46
|
+
return { jiraKeys, githubRefs, urls, taskRefs };
|
|
43
47
|
}
|
|
44
48
|
//# sourceMappingURL=references.logic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.logic.js","sourceRoot":"","sources":["../../../src/modules/corpus/references.logic.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,iFAAiF;AACjF,mFAAmF;AACnF,iFAAiF;AACjF,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,8EAA8E;AAC9E,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,mFAAmF;AACnF,mFAAmF;AACnF,
|
|
1
|
+
{"version":3,"file":"references.logic.js","sourceRoot":"","sources":["../../../src/modules/corpus/references.logic.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,iFAAiF;AACjF,mFAAmF;AACnF,iFAAiF;AACjF,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,8EAA8E;AAC9E,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,mFAAmF;AACnF,mFAAmF;AACnF,uFAAuF;AACvF,2CAA2C;AAqB3C,sFAAsF;AACtF,8DAA8D;AAC9D,MAAM,QAAQ,GAAG,yBAAyB,CAAA;AAC1C,wFAAwF;AACxF,6FAA6F;AAC7F,MAAM,UAAU,GAAG,2BAA2B,CAAA;AAC9C,MAAM,GAAG,GAAG,yBAAyB,CAAA;AAErC,0CAA0C;AAC1C,SAAS,MAAM,CAAC,MAAgB;IAC9B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAC7B,CAAC;AAED,0EAA0E;AAC1E,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;IAC1E,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAA;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IACzD,MAAM,QAAQ,GAAc;QAC1B,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,UAAU,EAAW,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QAC1E,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAW,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;KAC/E,CAAA;IACD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/integrations",
|
|
3
|
-
"version": "0.86.
|
|
3
|
+
"version": "0.86.5",
|
|
4
4
|
"description": "External-system integration domain logic for the Agent Architecture Board (GitHub, documents, tasks, environments, runners).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"p-map": "^7.0.5",
|
|
29
29
|
"yaml": "^2.9.0",
|
|
30
30
|
"@cat-factory/contracts": "0.148.1",
|
|
31
|
-
"@cat-factory/kernel": "0.140.
|
|
31
|
+
"@cat-factory/kernel": "0.140.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "7.0.2",
|
|
35
35
|
"undici": "^8.7.0",
|
|
36
36
|
"valibot": "^1.4.2",
|
|
37
37
|
"vitest": "^4.1.10",
|
|
38
|
-
"@cat-factory/caching": "0.10.
|
|
38
|
+
"@cat-factory/caching": "0.10.10"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b tsconfig.build.json",
|