@cat-factory/kernel 0.141.0 → 0.142.0

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.
@@ -37,18 +37,37 @@ export interface DocumentSourceProvider {
37
37
  * display label. Throws a ValidationError on anything missing/unsafe.
38
38
  */
39
39
  normalizeConnection(input: DocumentCredentials): NormalizedConnection;
40
+ /**
41
+ * For a source that rides an OUT-OF-BAND credential (e.g. the workspace's installed
42
+ * GitHub App) rather than a per-workspace stored connection, resolve whether the
43
+ * workspace is implicitly connected right now — and the marker to present — WITHOUT
44
+ * a stored connection row. Returns null when the source isn't implicitly connected
45
+ * for this workspace (so an explicit connect is still required). Optional: a source
46
+ * that authenticates with its own per-workspace credentials omits it. Today only the
47
+ * GitHub-docs provider implements it (it rides the workspace's App installation),
48
+ * mirroring how the GitHub-issues task source is available as soon as the App is
49
+ * installed with no separate "connect" step.
50
+ */
51
+ resolveImplicitConnection?(workspaceId: string): Promise<NormalizedConnection | null>;
40
52
  /** Resolve a stable page id from raw user input (a bare id or a page URL); null if unparseable. */
41
53
  parseRef(input: string): string | null;
42
- /** Fetch a single page by its id using the connection credentials. */
43
- fetchDocument(credentials: DocumentCredentials, externalId: string): Promise<DocumentContent>;
54
+ /**
55
+ * Fetch a single page by its id using the connection credentials. `workspaceId` is
56
+ * the workspace on whose behalf the read happens: a provider that authenticates
57
+ * per-workspace out-of-band (e.g. the GitHub App/PAT, which ignores `credentials`)
58
+ * MUST scope the read to that workspace's own installation so a crafted `externalId`
59
+ * can't reach another tenant's repo — the same tenant-scoping `search` performs.
60
+ */
61
+ fetchDocument(credentials: DocumentCredentials, externalId: string, workspaceId: string): Promise<DocumentContent>;
44
62
  /**
45
63
  * Cheaply read the page's current version token — the {@link DocumentContent.version}
46
64
  * value {@link fetchDocument} would return, fetched with metadata only (no body
47
65
  * download or Markdown conversion). MUST be strictly cheaper than `fetchDocument`,
48
66
  * so the caching seam can bump a cached body's TTL when the token is unchanged
49
- * instead of re-fetching. Returns `''` when the source exposes no version.
67
+ * instead of re-fetching. Returns `''` when the source exposes no version. Scoped to
68
+ * `workspaceId` for the same tenant-isolation reason as {@link fetchDocument}.
50
69
  */
51
- probeVersion(credentials: DocumentCredentials, externalId: string): Promise<string>;
70
+ probeVersion(credentials: DocumentCredentials, externalId: string, workspaceId: string): Promise<string>;
52
71
  /**
53
72
  * Search the source's catalogue by free text and return lean hits (no body).
54
73
  * Optional: a provider that only supports paste-a-URL import omits it (and its
@@ -1 +1 @@
1
- {"version":3,"file":"document-source.d.ts","sourceRoot":"","sources":["../../src/ports/document-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAa3B,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAExD,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,WAAW,EAAE,mBAAmB,CAAA;IAChC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAA;IAC7C;;;OAGG;IACH,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CAAA;IACrE,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE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;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,+FAA+F;IAC/F,KAAK,CACH,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC,CAAA;IAC3B;;;;;OAKG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CACnG;AAED,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,GAAG,CAAC,IAAI,EAAE,kBAAkB,GAAG,sBAAsB,GAAG,SAAS,CAAA;IACjE,4EAA4E;IAC5E,IAAI,IAAI,sBAAsB,EAAE,CAAA;CACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/kernel",
3
- "version": "0.141.0",
3
+ "version": "0.142.0",
4
4
  "description": "Shared vocabulary, pure logic, and port interfaces for the Agent Architecture Board.",
5
5
  "repository": {
6
6
  "type": "git",