@aligndottech/connector-core 0.7.0 → 0.8.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.
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export type { ConnectorFetcher, ConnectorFetcherOptions, FetcherItem, FetcherPag
15
15
  export { FETCHERS, GitHubFetcher, GitLabFetcher, JiraFetcher, ConfluenceFetcher, SlackFetcher, TeamsFetcher, ZoomFetcher, LinearFetcher, NotionFetcher, GitFetcher, buildCommitUrl, formatCommitAsText, FetcherAuthError, providerError, providerErrorText, type RefusedResponse, type GitCommitSource, type GitCommit, } from './fetchers/index.js';
16
16
  export { getContext, tryGetContext, runWithContext, runWithContextAsync, extractBearer, getBearer, type BaseRequestContext, } from './utils/requestContext.js';
17
17
  export { UUID_REGEX, isValidUUID, assertValidUUID } from './utils/validation.js';
18
+ export { SYNTHETIC_SOURCE_PREFIXES, isSyntheticSource, navigableSourceUrl, } from './utils/syntheticSource.js';
18
19
  export { CommandParser, CommandHelpText } from './parsers/CommandParser.js';
19
20
  export { GatewayClient, type GatewayClientConfig, type JiraCredentials, } from './services/GatewayClient.js';
20
21
  export { consumeStreamWithProgressiveUpdates, type MessageUpdater, type StreamConsumerOptions, } from './services/StreamingResponseConsumer.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,GACf,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aA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AM,6BAA6B,CAAC;AACrC,OAAO,EACL,mCAAmC,EACnC,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,gBAAgB,GACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,+BAA+B,EAC/B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -19,6 +19,8 @@ export { FETCHERS, GitHubFetcher, GitLabFetcher, JiraFetcher, ConfluenceFetcher,
19
19
  // Utils
20
20
  export { getContext, tryGetContext, runWithContext, runWithContextAsync, extractBearer, getBearer, } from './utils/requestContext.js';
21
21
  export { UUID_REGEX, isValidUUID, assertValidUUID } from './utils/validation.js';
22
+ // A source Align minted a synthetic identity for is not a place anyone can open.
23
+ export { SYNTHETIC_SOURCE_PREFIXES, isSyntheticSource, navigableSourceUrl, } from './utils/syntheticSource.js';
22
24
  // Parsers
23
25
  export { CommandParser, CommandHelpText } from './parsers/CommandParser.js';
24
26
  // Services (light)
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAe;AACf,cAAc,kBAAkB,CAAC;AAEjC,+CAA+C;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAc3D,+EAA+E;AAC/E,mDAAmD;AACnD,OAAO,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GAIlB,MAAM,qBAAqB,CAAC;AAE7B,QAAQ;AACR,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,SAAS,GAEV,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEjF,UAAU;AACV,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE5E,mBAAmB;AACnB,OAAO,EACL,aAAa,GAGd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mCAAmC,GAGpC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,eAAe,EACf,qBAAqB,GAKtB,MAAM,+BAA+B,CAAC;AAEvC,QAAQ;AACR,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,yBAAyB,CAAC;AAEjC,+EAA+E;AAC/E,OAAO,EACL,+BAA+B,EAiB/B,wBAAwB,GAMzB,MAAM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AEjC,+EAA+E;AAC/E,OAAO,EACL,+BAA+B,EAiB/B,wBAAwB,GAMzB,MAAM,iBAAiB,CAAC;AAEzB,oBAAoB;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Display guard: an identity Align minted is not a place anyone can open.
3
+ *
4
+ * When a decision graph scan cannot verify where a decision was made, the item gets a
5
+ * synthetic identity instead of a real source_url - `align://claimed/<hash>` when the model
6
+ * claimed a source, `align://unsourced/<hash>` when it claimed nothing. `align://` is a
7
+ * syntactically valid URI, so anything that renders `source_url` as a link, a comment, a
8
+ * check-run URL, or an ADF/Markdown reference will silently point nowhere unless it is
9
+ * filtered first.
10
+ *
11
+ * ALI-922: promoted here from align-stack, which had grown SIX independent copies of this
12
+ * (the gateway's minting site, `services/gateway/src/discover/suggestionHelpers.ts`'s
13
+ * `claimedIdentityFor`, plus five readers: mcp-align, the UI, and three connectors -
14
+ * mcp-teams, mcp-github, mcp-jira - each pinned by its own test reading the minting site
15
+ * directly). Every connector already depends on `@aligndottech/connector-core`, and
16
+ * `RelatedDecision` (this package's decision type, in `types/index.ts`) carries the same
17
+ * `source_url` field these functions guard - so this is the shared home going forward. A
18
+ * SEVENTH consumer (align-cli, ALI-923) could not take this dependency at the time it needed
19
+ * the same logic - it is a plain npm CLI in a different repo/ecosystem, not a connector - so
20
+ * it carries its own copy in `src/lib/decision-links.ts` rather than a connector-core import.
21
+ */
22
+ export declare const SYNTHETIC_SOURCE_PREFIXES: readonly string[];
23
+ /** True when this source_url is an identity Align minted, not a place anyone can open. */
24
+ export declare function isSyntheticSource(sourceUrl: string | undefined | null): boolean;
25
+ /**
26
+ * The source url, only when it is somewhere a person can go. `undefined` otherwise, so every
27
+ * caller's `?? fallbackUrl` reaches a real page (an Align decision link, a details view)
28
+ * instead of a dead link built from a synthetic identity.
29
+ */
30
+ export declare function navigableSourceUrl(sourceUrl: string | undefined | null): string | undefined;
31
+ //# sourceMappingURL=syntheticSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntheticSource.d.ts","sourceRoot":"","sources":["../../src/utils/syntheticSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAGtD,CAAC;AAEF,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAI/E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAG3F"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Display guard: an identity Align minted is not a place anyone can open.
3
+ *
4
+ * When a decision graph scan cannot verify where a decision was made, the item gets a
5
+ * synthetic identity instead of a real source_url - `align://claimed/<hash>` when the model
6
+ * claimed a source, `align://unsourced/<hash>` when it claimed nothing. `align://` is a
7
+ * syntactically valid URI, so anything that renders `source_url` as a link, a comment, a
8
+ * check-run URL, or an ADF/Markdown reference will silently point nowhere unless it is
9
+ * filtered first.
10
+ *
11
+ * ALI-922: promoted here from align-stack, which had grown SIX independent copies of this
12
+ * (the gateway's minting site, `services/gateway/src/discover/suggestionHelpers.ts`'s
13
+ * `claimedIdentityFor`, plus five readers: mcp-align, the UI, and three connectors -
14
+ * mcp-teams, mcp-github, mcp-jira - each pinned by its own test reading the minting site
15
+ * directly). Every connector already depends on `@aligndottech/connector-core`, and
16
+ * `RelatedDecision` (this package's decision type, in `types/index.ts`) carries the same
17
+ * `source_url` field these functions guard - so this is the shared home going forward. A
18
+ * SEVENTH consumer (align-cli, ALI-923) could not take this dependency at the time it needed
19
+ * the same logic - it is a plain npm CLI in a different repo/ecosystem, not a connector - so
20
+ * it carries its own copy in `src/lib/decision-links.ts` rather than a connector-core import.
21
+ */
22
+ export const SYNTHETIC_SOURCE_PREFIXES = [
23
+ 'align://claimed/',
24
+ 'align://unsourced/',
25
+ ];
26
+ /** True when this source_url is an identity Align minted, not a place anyone can open. */
27
+ export function isSyntheticSource(sourceUrl) {
28
+ if (typeof sourceUrl !== 'string')
29
+ return false;
30
+ // startsWith, never includes: a real page may carry the text in its path.
31
+ return SYNTHETIC_SOURCE_PREFIXES.some((prefix) => sourceUrl.startsWith(prefix));
32
+ }
33
+ /**
34
+ * The source url, only when it is somewhere a person can go. `undefined` otherwise, so every
35
+ * caller's `?? fallbackUrl` reaches a real page (an Align decision link, a details view)
36
+ * instead of a dead link built from a synthetic identity.
37
+ */
38
+ export function navigableSourceUrl(sourceUrl) {
39
+ if (typeof sourceUrl !== 'string' || sourceUrl.length === 0)
40
+ return undefined;
41
+ return isSyntheticSource(sourceUrl) ? undefined : sourceUrl;
42
+ }
43
+ //# sourceMappingURL=syntheticSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntheticSource.js","sourceRoot":"","sources":["../../src/utils/syntheticSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,kBAAkB;IAClB,oBAAoB;CACrB,CAAC;AAEF,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,SAAoC;IACpE,IAAI,OAAO,SAAS,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAChD,0EAA0E;IAC1E,OAAO,yBAAyB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAoC;IACrE,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9E,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligndottech/connector-core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Align connector core: the ConnectorFetcher contract, read-only fetchers, gateway client, and tier definitions. Lightweight (no server deps) - safe for the Align CLI.",