@xemahq/kernel-contracts 0.34.0 → 0.36.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/agent-composition/lib/agent.d.ts +5 -0
- package/dist/agent-composition/lib/agent.d.ts.map +1 -1
- package/dist/app-runtime/index.d.ts +1 -0
- package/dist/app-runtime/index.d.ts.map +1 -1
- package/dist/app-runtime/index.js +1 -0
- package/dist/app-runtime/index.js.map +1 -1
- package/dist/app-runtime/lib/app-shell-binding.d.ts +38 -0
- package/dist/app-runtime/lib/app-shell-binding.d.ts.map +1 -0
- package/dist/app-runtime/lib/app-shell-binding.js +58 -0
- package/dist/app-runtime/lib/app-shell-binding.js.map +1 -0
- package/dist/app-runtime/lib/branding-config.d.ts.map +1 -1
- package/dist/app-runtime/lib/branding-config.js.map +1 -1
- package/dist/connector/index.d.ts +1 -0
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +1 -0
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/lib/connector-descriptor.d.ts +3 -3
- package/dist/connector/lib/connector-descriptor.d.ts.map +1 -1
- package/dist/connector/lib/connector-descriptor.js +1 -1
- package/dist/connector/lib/connector-descriptor.js.map +1 -1
- package/dist/connector/lib/credential-kind.d.ts +5 -0
- package/dist/connector/lib/credential-kind.d.ts.map +1 -1
- package/dist/connector/lib/credential-kind.js +13 -1
- package/dist/connector/lib/credential-kind.js.map +1 -1
- package/dist/connector/lib/credential-strategy-contribution.d.ts +23 -0
- package/dist/connector/lib/credential-strategy-contribution.d.ts.map +1 -0
- package/dist/connector/lib/credential-strategy-contribution.js +97 -0
- package/dist/connector/lib/credential-strategy-contribution.js.map +1 -0
- package/dist/connector/lib/integration-provider-contribution.d.ts +1 -1
- package/dist/contribution/lib/contribution-kind.d.ts +2 -1
- package/dist/contribution/lib/contribution-kind.d.ts.map +1 -1
- package/dist/contribution/lib/contribution-kind.js +1 -0
- package/dist/contribution/lib/contribution-kind.js.map +1 -1
- package/package.json +1 -1
- package/src/agent-composition/lib/agent.ts +37 -0
- package/src/app-runtime/index.ts +1 -0
- package/src/app-runtime/lib/app-shell-binding.ts +159 -0
- package/src/app-runtime/lib/branding-config.ts +9 -7
- package/src/app-runtime/lib/delegated-session.ts +1 -1
- package/src/connector/index.ts +1 -0
- package/src/connector/lib/connector-descriptor.ts +12 -3
- package/src/connector/lib/credential-kind.ts +62 -5
- package/src/connector/lib/credential-strategy-contribution.ts +215 -0
- package/src/contribution/lib/contribution-kind.ts +20 -0
|
@@ -36,6 +36,9 @@ export interface AgentNode extends NodeOverlayFragment, BiomeAvailabilityScoped
|
|
|
36
36
|
readonly children: readonly AgentNode[];
|
|
37
37
|
readonly limits?: AgentLimits;
|
|
38
38
|
}
|
|
39
|
+
export interface StandingSessionRef {
|
|
40
|
+
readonly pinKey: string;
|
|
41
|
+
}
|
|
39
42
|
export interface Agent {
|
|
40
43
|
readonly slug: string;
|
|
41
44
|
readonly version: string;
|
|
@@ -48,6 +51,7 @@ export interface Agent {
|
|
|
48
51
|
readonly capability?: CapabilityLayer;
|
|
49
52
|
readonly workspace?: AgentWorkspaceConfig;
|
|
50
53
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
54
|
+
readonly standingSession?: StandingSessionRef;
|
|
51
55
|
}
|
|
52
56
|
export interface ResolvedAgentNode extends NodeOverlayFragment, BiomeAvailabilityScoped {
|
|
53
57
|
readonly kernel: Required<AgentKernelRef>;
|
|
@@ -66,5 +70,6 @@ export interface ResolvedAgent {
|
|
|
66
70
|
readonly capability: CapabilityLayer;
|
|
67
71
|
readonly workspace?: AgentWorkspaceConfig;
|
|
68
72
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
73
|
+
readonly standingSession?: StandingSessionRef;
|
|
69
74
|
}
|
|
70
75
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agent-compos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BAAsB,CAAC;IAMnD,QAAQ,CAAC,eAAe,CAAC,EAAE,kBAAkB,CAAC;CAC/C"}
|
|
@@ -6,6 +6,7 @@ export * from './lib/app-client';
|
|
|
6
6
|
export * from './lib/app-lockfile';
|
|
7
7
|
export * from './lib/branding-config';
|
|
8
8
|
export * from './lib/surface-kind';
|
|
9
|
+
export * from './lib/app-shell-binding';
|
|
9
10
|
export * from './lib/app-channel';
|
|
10
11
|
export * from './lib/app-release';
|
|
11
12
|
export * from './lib/app';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app-runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app-runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
|
@@ -22,6 +22,7 @@ __exportStar(require("./lib/app-client"), exports);
|
|
|
22
22
|
__exportStar(require("./lib/app-lockfile"), exports);
|
|
23
23
|
__exportStar(require("./lib/branding-config"), exports);
|
|
24
24
|
__exportStar(require("./lib/surface-kind"), exports);
|
|
25
|
+
__exportStar(require("./lib/app-shell-binding"), exports);
|
|
25
26
|
__exportStar(require("./lib/app-channel"), exports);
|
|
26
27
|
__exportStar(require("./lib/app-release"), exports);
|
|
27
28
|
__exportStar(require("./lib/app"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app-runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,wDAAsC;AACtC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,qDAAmC;AACnC,wDAAsC;AACtC,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAClC,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app-runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,wDAAsC;AACtC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,qDAAmC;AACnC,wDAAsC;AACtC,qDAAmC;AACnC,0DAAwC;AACxC,oDAAkC;AAClC,oDAAkC;AAClC,4CAA0B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AudienceKind } from './audience-policy';
|
|
3
|
+
export declare enum AppShellKind {
|
|
4
|
+
Hosted = "hosted",
|
|
5
|
+
Standalone = "standalone",
|
|
6
|
+
Embedded = "embedded",
|
|
7
|
+
Headless = "headless"
|
|
8
|
+
}
|
|
9
|
+
export declare const AppShellKindSchema: z.ZodEnum<typeof AppShellKind>;
|
|
10
|
+
export declare enum AppHostBinding {
|
|
11
|
+
Xema = "xema",
|
|
12
|
+
CustomDomain = "custom-domain",
|
|
13
|
+
PathBased = "path-based"
|
|
14
|
+
}
|
|
15
|
+
export declare const AppHostBindingSchema: z.ZodEnum<typeof AppHostBinding>;
|
|
16
|
+
export interface AppSurfaceDimensions {
|
|
17
|
+
readonly shell: AppShellKind;
|
|
18
|
+
readonly audience: AudienceKind;
|
|
19
|
+
readonly host: AppHostBinding;
|
|
20
|
+
}
|
|
21
|
+
export declare const AppSurfaceDimensionsSchema: z.ZodType<AppSurfaceDimensions>;
|
|
22
|
+
export declare enum AppSurfaceConflictCode {
|
|
23
|
+
HeadlessWithChrome = "headless-with-chrome",
|
|
24
|
+
EmbeddedIsChrome = "embedded-is-chrome",
|
|
25
|
+
StandaloneNeedsOwnHost = "standalone-needs-own-host",
|
|
26
|
+
EmbeddedNeedsXemaHost = "embedded-needs-xema-host"
|
|
27
|
+
}
|
|
28
|
+
export interface AppSurfaceConflict {
|
|
29
|
+
readonly code: AppSurfaceConflictCode;
|
|
30
|
+
readonly message: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AppSurfaceValidation {
|
|
33
|
+
readonly ok: boolean;
|
|
34
|
+
readonly conflicts: readonly AppSurfaceConflict[];
|
|
35
|
+
}
|
|
36
|
+
export declare function validateAppSurfaceCombination(dims: AppSurfaceDimensions): AppSurfaceValidation;
|
|
37
|
+
export declare function isHeadlessEmbeddedContradiction(shell: AppShellKind, alsoEmbedded: boolean): boolean;
|
|
38
|
+
//# sourceMappingURL=app-shell-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell-binding.d.ts","sourceRoot":"","sources":["../../../src/app-runtime/lib/app-shell-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAyBjD,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,kBAAkB,gCAA6B,CAAC;AAY7D,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,YAAY,kBAAkB;IAC9B,SAAS,eAAe;CACzB;AAED,eAAO,MAAM,oBAAoB,kCAA+B,CAAC;AAGjE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B;AAED,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAMzB,CAAC;AAM/C,oBAAY,sBAAsB;IAChC,kBAAkB,yBAAyB;IAC3C,gBAAgB,uBAAuB;IACvC,sBAAsB,8BAA8B;IACpD,qBAAqB,6BAA6B;CACnD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACnD;AAsBD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,oBAAoB,GACzB,oBAAoB,CAgCtB;AASD,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,YAAY,EACnB,YAAY,EAAE,OAAO,GACpB,OAAO,CAET"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppSurfaceConflictCode = exports.AppSurfaceDimensionsSchema = exports.AppHostBindingSchema = exports.AppHostBinding = exports.AppShellKindSchema = exports.AppShellKind = void 0;
|
|
4
|
+
exports.validateAppSurfaceCombination = validateAppSurfaceCombination;
|
|
5
|
+
exports.isHeadlessEmbeddedContradiction = isHeadlessEmbeddedContradiction;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const audience_policy_1 = require("./audience-policy");
|
|
8
|
+
var AppShellKind;
|
|
9
|
+
(function (AppShellKind) {
|
|
10
|
+
AppShellKind["Hosted"] = "hosted";
|
|
11
|
+
AppShellKind["Standalone"] = "standalone";
|
|
12
|
+
AppShellKind["Embedded"] = "embedded";
|
|
13
|
+
AppShellKind["Headless"] = "headless";
|
|
14
|
+
})(AppShellKind || (exports.AppShellKind = AppShellKind = {}));
|
|
15
|
+
exports.AppShellKindSchema = zod_1.z.nativeEnum(AppShellKind);
|
|
16
|
+
var AppHostBinding;
|
|
17
|
+
(function (AppHostBinding) {
|
|
18
|
+
AppHostBinding["Xema"] = "xema";
|
|
19
|
+
AppHostBinding["CustomDomain"] = "custom-domain";
|
|
20
|
+
AppHostBinding["PathBased"] = "path-based";
|
|
21
|
+
})(AppHostBinding || (exports.AppHostBinding = AppHostBinding = {}));
|
|
22
|
+
exports.AppHostBindingSchema = zod_1.z.nativeEnum(AppHostBinding);
|
|
23
|
+
exports.AppSurfaceDimensionsSchema = zod_1.z
|
|
24
|
+
.object({
|
|
25
|
+
shell: exports.AppShellKindSchema,
|
|
26
|
+
audience: zod_1.z.nativeEnum(audience_policy_1.AudienceKind),
|
|
27
|
+
host: exports.AppHostBindingSchema,
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
var AppSurfaceConflictCode;
|
|
31
|
+
(function (AppSurfaceConflictCode) {
|
|
32
|
+
AppSurfaceConflictCode["HeadlessWithChrome"] = "headless-with-chrome";
|
|
33
|
+
AppSurfaceConflictCode["EmbeddedIsChrome"] = "embedded-is-chrome";
|
|
34
|
+
AppSurfaceConflictCode["StandaloneNeedsOwnHost"] = "standalone-needs-own-host";
|
|
35
|
+
AppSurfaceConflictCode["EmbeddedNeedsXemaHost"] = "embedded-needs-xema-host";
|
|
36
|
+
})(AppSurfaceConflictCode || (exports.AppSurfaceConflictCode = AppSurfaceConflictCode = {}));
|
|
37
|
+
function validateAppSurfaceCombination(dims) {
|
|
38
|
+
const conflicts = [];
|
|
39
|
+
if (dims.shell === AppShellKind.Standalone &&
|
|
40
|
+
dims.host === AppHostBinding.PathBased) {
|
|
41
|
+
conflicts.push({
|
|
42
|
+
code: AppSurfaceConflictCode.StandaloneNeedsOwnHost,
|
|
43
|
+
message: 'A standalone app has its own full-page surface and cannot be path-based on a shared host; use xema or custom-domain.',
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (dims.shell === AppShellKind.Embedded &&
|
|
47
|
+
dims.host !== AppHostBinding.Xema) {
|
|
48
|
+
conflicts.push({
|
|
49
|
+
code: AppSurfaceConflictCode.EmbeddedNeedsXemaHost,
|
|
50
|
+
message: "An embedded app is served into a third-party page and relies on the Xema origin's CSP/cookies; it must be xema-hosted.",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return { ok: conflicts.length === 0, conflicts };
|
|
54
|
+
}
|
|
55
|
+
function isHeadlessEmbeddedContradiction(shell, alsoEmbedded) {
|
|
56
|
+
return shell === AppShellKind.Headless && alsoEmbedded;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=app-shell-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell-binding.js","sourceRoot":"","sources":["../../../src/app-runtime/lib/app-shell-binding.ts"],"names":[],"mappings":";;;AA8GA,sEAkCC;AASD,0EAKC;AA9JD,6BAAwB;AAExB,uDAAiD;AAyBjD,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAEY,QAAA,kBAAkB,GAAG,OAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAY7D,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,gDAA8B,CAAA;IAC9B,0CAAwB,CAAA;AAC1B,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAEY,QAAA,oBAAoB,GAAG,OAAC,CAAC,UAAU,CAAC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../../../src/app-runtime/lib/branding-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"branding-config.d.ts","sourceRoot":"","sources":["../../../src/app-runtime/lib/branding-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,oBAAoB,EAkB3B,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branding-config.js","sourceRoot":"","sources":["../../../src/app-runtime/lib/branding-config.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAaxB,MAAM,mBAAmB,GACvB,uIAAuI,CAAC;
|
|
1
|
+
{"version":3,"file":"branding-config.js","sourceRoot":"","sources":["../../../src/app-runtime/lib/branding-config.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAaxB,MAAM,mBAAmB,GACvB,uIAAuI,CAAC;AA6B7H,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;QAC7B,OAAO,EAAE,wDAAwD;KAClE,CAAC;IACF,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC;QACH,OAAO,EAAE,6CAA6C;KACvD,CAAC;SACD,QAAQ,EAAE;IACb,YAAY,EAAE,OAAC;SACZ,MAAM,EAAE;SACR,KAAK,CAAC,mBAAmB,EAAE;QAC1B,OAAO,EACL,6IAA6I;KAChJ,CAAC;SACD,QAAQ,EAAE;IACb,SAAS,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACrE,CAA8B,CAAC"}
|
|
@@ -3,6 +3,7 @@ export * from './lib/connector-adapter-kind';
|
|
|
3
3
|
export * from './lib/connector-http-request';
|
|
4
4
|
export * from './lib/capability';
|
|
5
5
|
export * from './lib/credential-kind';
|
|
6
|
+
export * from './lib/credential-strategy-contribution';
|
|
6
7
|
export * from './lib/onboarding-manifest';
|
|
7
8
|
export * from './lib/provider-descriptor';
|
|
8
9
|
export * from './lib/connector-descriptor';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC"}
|
package/dist/connector/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./lib/connector-adapter-kind"), exports);
|
|
|
19
19
|
__exportStar(require("./lib/connector-http-request"), exports);
|
|
20
20
|
__exportStar(require("./lib/capability"), exports);
|
|
21
21
|
__exportStar(require("./lib/credential-kind"), exports);
|
|
22
|
+
__exportStar(require("./lib/credential-strategy-contribution"), exports);
|
|
22
23
|
__exportStar(require("./lib/onboarding-manifest"), exports);
|
|
23
24
|
__exportStar(require("./lib/provider-descriptor"), exports);
|
|
24
25
|
__exportStar(require("./lib/connector-descriptor"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,+DAA6C;AAC7C,+DAA6C;AAC7C,mDAAiC;AACjC,wDAAsC;AACtC,4DAA0C;AAC1C,4DAA0C;AAC1C,6DAA2C;AAC3C,wDAAsC;AACtC,oDAAkC;AAClC,2DAAyC;AACzC,6DAA2C;AAC3C,0EAAwD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,+DAA6C;AAC7C,+DAA6C;AAC7C,mDAAiC;AACjC,wDAAsC;AACtC,yEAAuD;AACvD,4DAA0C;AAC1C,4DAA0C;AAC1C,6DAA2C;AAC3C,wDAAsC;AACtC,oDAAkC;AAClC,2DAAyC;AACzC,6DAA2C;AAC3C,0EAAwD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type CapabilityRef } from '../../capability';
|
|
3
|
-
import {
|
|
3
|
+
import { type CredentialKindRef } from './credential-kind';
|
|
4
4
|
import { ConnectorAdapterKind } from './connector-adapter-kind';
|
|
5
5
|
import { type ConnectorHttpRequestTemplate } from './connector-http-request';
|
|
6
6
|
import type { AdapterKindRef } from './adapter-kind';
|
|
@@ -37,7 +37,7 @@ export interface ConnectorDescriptor {
|
|
|
37
37
|
readonly iconName: string;
|
|
38
38
|
readonly providerKey: string;
|
|
39
39
|
readonly scopes: readonly string[];
|
|
40
|
-
readonly connectionCredentialKind:
|
|
40
|
+
readonly connectionCredentialKind: CredentialKindRef;
|
|
41
41
|
readonly adapterKind: AdapterKindRef;
|
|
42
42
|
readonly operations?: readonly ConnectorOperationDescriptor[];
|
|
43
43
|
}
|
|
@@ -48,7 +48,7 @@ export declare const ConnectorDescriptorSchema: z.ZodObject<{
|
|
|
48
48
|
iconName: z.ZodString;
|
|
49
49
|
providerKey: z.ZodString;
|
|
50
50
|
scopes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
51
|
-
connectionCredentialKind: z.
|
|
51
|
+
connectionCredentialKind: z.ZodString;
|
|
52
52
|
adapterKind: z.ZodString;
|
|
53
53
|
operations: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
54
54
|
capabilityRef: z.ZodType<CapabilityRef, unknown, z.core.$ZodTypeInternals<CapabilityRef, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-descriptor.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,
|
|
1
|
+
{"version":3,"file":"connector-descriptor.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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I,CAAC,CAAC;AACvC,KAAK,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC5D,SAAS,uBAAuB,CAAC,CAAC,CAAC,EAAE,GACrC,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,GAC7D,CAAC,CAAC;AACR,MAAM,MAAM,+CAA+C,GAAG;IAC5D,aAAa,CACX,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,EAClD,uBAAuB,CAAC,4BAA4B,CAAC,CACtD;IACD,aAAa,CACX,4BAA4B,EAC5B,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CACnD;CACF,CAAC;AACF,MAAM,MAAM,sCAAsC,GAAG;IACnD,aAAa,CACX,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EACzC,uBAAuB,CAAC,mBAAmB,CAAC,CAC7C;IACD,aAAa,CAAC,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;CAC9E,CAAC"}
|
|
@@ -39,7 +39,7 @@ exports.ConnectorDescriptorSchema = zod_1.z.strictObject({
|
|
|
39
39
|
iconName: zod_1.z.string().min(1),
|
|
40
40
|
providerKey: zod_1.z.string().min(1),
|
|
41
41
|
scopes: zod_1.z.array(zod_1.z.string()).readonly(),
|
|
42
|
-
connectionCredentialKind:
|
|
42
|
+
connectionCredentialKind: credential_kind_1.CredentialKindRefSchema,
|
|
43
43
|
adapterKind: zod_1.z.string().min(1),
|
|
44
44
|
operations: zod_1.z.array(exports.ConnectorOperationDescriptorSchema).readonly().optional(),
|
|
45
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-descriptor.js","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":";;;AAoBA,6BAAwB;AAExB,iDAA2E;AAE3E,
|
|
1
|
+
{"version":3,"file":"connector-descriptor.js","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":";;;AAoBA,6BAAwB;AAExB,iDAA2E;AAE3E,uDAG2B;AAC3B,qEAGkC;AAClC,qEAGkC;AAiErB,QAAA,kCAAkC,GAAG,OAAC;KAChD,YAAY,CAAC;IACZ,aAAa,EAAE,gCAAmB;IAClC,WAAW,EAAE,mDAA0B;IACvC,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,kBAAkB,EAAE,OAAC,CAAC,OAAO,EAAE;IAC/B,WAAW,EAAE,2DAAkC,CAAC,QAAQ,EAAE;CAC3D,CAAC;KACD,WAAW,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE;IACvB,MAAM,aAAa,GACjB,EAAE,CAAC,WAAW,KAAK,6CAAoB,CAAC,eAAe,CAAC;IAC1D,IAAI,aAAa,IAAI,EAAE,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAClD,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,OAAO,EACL,qEAAqE;gBACrE,6CAA6C;SAChD,CAAC,CAAC;IACL,CAAC;IACD,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACnD,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,OAAO,EAAE,sEAAsE,EAAE,CAAC,WAAW,KAAK;SACnG,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAoEQ,QAAA,yBAAyB,GAAG,OAAC,CAAC,YAAY,CAAC;IACtD,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,wBAAwB,EAAE,yCAAuB;IACjD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,0CAAkC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC9E,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare enum CredentialKind {
|
|
2
3
|
AppInstall = "app_install",
|
|
3
4
|
OAuthUser = "oauth_user",
|
|
@@ -12,6 +13,10 @@ export declare enum CredentialKind {
|
|
|
12
13
|
SmtpAuth = "smtp_auth",
|
|
13
14
|
ImapAuth = "imap_auth"
|
|
14
15
|
}
|
|
16
|
+
export declare const CURATED_CREDENTIAL_KINDS: readonly CredentialKind[];
|
|
17
|
+
export type CredentialKindRef = string;
|
|
18
|
+
export declare const CredentialKindRefSchema: z.ZodString;
|
|
19
|
+
export declare function isCuratedCredentialKind(value: string): value is CredentialKind;
|
|
15
20
|
export declare enum EmailTlsMode {
|
|
16
21
|
Auto = "auto",
|
|
17
22
|
Tls = "tls",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-kind.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/credential-kind.ts"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Y,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAOD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmailTlsMode = exports.CredentialKind = void 0;
|
|
3
|
+
exports.EmailTlsMode = exports.CredentialKindRefSchema = exports.CURATED_CREDENTIAL_KINDS = exports.CredentialKind = void 0;
|
|
4
|
+
exports.isCuratedCredentialKind = isCuratedCredentialKind;
|
|
5
|
+
const zod_1 = require("zod");
|
|
4
6
|
var CredentialKind;
|
|
5
7
|
(function (CredentialKind) {
|
|
6
8
|
CredentialKind["AppInstall"] = "app_install";
|
|
@@ -16,6 +18,16 @@ var CredentialKind;
|
|
|
16
18
|
CredentialKind["SmtpAuth"] = "smtp_auth";
|
|
17
19
|
CredentialKind["ImapAuth"] = "imap_auth";
|
|
18
20
|
})(CredentialKind || (exports.CredentialKind = CredentialKind = {}));
|
|
21
|
+
exports.CURATED_CREDENTIAL_KINDS = Object.freeze(Object.values(CredentialKind));
|
|
22
|
+
const CURATED_CREDENTIAL_KIND_VALUES = new Set(exports.CURATED_CREDENTIAL_KINDS);
|
|
23
|
+
exports.CredentialKindRefSchema = zod_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.min(1)
|
|
26
|
+
.max(64)
|
|
27
|
+
.regex(/^[A-Za-z][A-Za-z0-9_-]*$/, 'credential-kind ref must be a slug: an initial letter then letters/digits/_/-');
|
|
28
|
+
function isCuratedCredentialKind(value) {
|
|
29
|
+
return CURATED_CREDENTIAL_KIND_VALUES.has(value);
|
|
30
|
+
}
|
|
19
31
|
var EmailTlsMode;
|
|
20
32
|
(function (EmailTlsMode) {
|
|
21
33
|
EmailTlsMode["Auto"] = "auto";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-kind.js","sourceRoot":"","sources":["../../../src/connector/lib/credential-kind.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"credential-kind.js","sourceRoot":"","sources":["../../../src/connector/lib/credential-kind.ts"],"names":[],"mappings":";;;AAmGA,0DAIC;AAvGD,6BAAwB;AAmBxB,IAAY,cAsCX;AAtCD,WAAY,cAAc;IAExB,4CAA0B,CAAA;IAE1B,0CAAwB,CAAA;IAExB,8CAA4B,CAAA;IAE5B,6BAAW,CAAA;IAEX,oCAAkB,CAAA;IAElB,wCAAsB,CAAA;IAEtB,iCAAe,CAAA;IAEf,kDAAgC,CAAA;IAEhC,sCAAoB,CAAA;IAKpB,kDAAgC,CAAA;IAQhC,wCAAsB,CAAA;IAMtB,wCAAsB,CAAA;AACxB,CAAC,EAtCW,cAAc,8BAAd,cAAc,QAsCzB;AAOY,QAAA,wBAAwB,GACnC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/C,MAAM,8BAA8B,GAAwB,IAAI,GAAG,CACjE,gCAA6C,CAC9C,CAAC;AAoBW,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CACJ,0BAA0B,EAC1B,+EAA+E,CAChF,CAAC;AAGJ,SAAgB,uBAAuB,CACrC,KAAa;IAEb,OAAO,8BAA8B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAUD,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,2BAAW,CAAA;IACX,qCAAqB,CAAA;IACrB,+BAAe,CAAA;AACjB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type CredentialKindRef } from './credential-kind';
|
|
3
|
+
export declare enum CredentialProjectionScheme {
|
|
4
|
+
Bearer = "bearer",
|
|
5
|
+
Basic = "basic",
|
|
6
|
+
Header = "header"
|
|
7
|
+
}
|
|
8
|
+
export declare const CredentialProjectionSchemeSchema: z.ZodEnum<typeof CredentialProjectionScheme>;
|
|
9
|
+
export interface CredentialStrategyContributionManifest {
|
|
10
|
+
readonly key: CredentialKindRef;
|
|
11
|
+
readonly displayName: string;
|
|
12
|
+
readonly scheme: CredentialProjectionScheme;
|
|
13
|
+
readonly tokenField?: string;
|
|
14
|
+
readonly usernameField?: string;
|
|
15
|
+
readonly passwordField?: string;
|
|
16
|
+
readonly headerName?: string;
|
|
17
|
+
readonly valuePrefix?: string;
|
|
18
|
+
readonly valueTemplate?: string;
|
|
19
|
+
readonly staticParams?: Readonly<Record<string, string>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const CredentialStrategyContributionManifestSchema: z.ZodType<CredentialStrategyContributionManifest>;
|
|
22
|
+
export declare function templateFieldNames(valueTemplate: string): readonly string[];
|
|
23
|
+
//# sourceMappingURL=credential-strategy-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-strategy-contribution.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/credential-strategy-contribution.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAiB3B,oBAAY,0BAA0B;IACpC,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,gCAAgC,8CAE5C,CAAC;AA6BF,MAAM,WAAW,sCAAsC;IAMrD,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAEhC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAE5C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAMhC,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,4CAA4C,EAAE,CAAC,CAAC,OAAO,CAAC,sCAAsC,CAiFrC,CAAC;AAOvE,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAU3E"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CredentialStrategyContributionManifestSchema = exports.CredentialProjectionSchemeSchema = exports.CredentialProjectionScheme = void 0;
|
|
4
|
+
exports.templateFieldNames = templateFieldNames;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const credential_kind_1 = require("./credential-kind");
|
|
7
|
+
const CREDENTIAL_STRATEGY_STRING_MAX = 200;
|
|
8
|
+
const CREDENTIAL_STRATEGY_STATIC_PARAMS_MAX = 20;
|
|
9
|
+
var CredentialProjectionScheme;
|
|
10
|
+
(function (CredentialProjectionScheme) {
|
|
11
|
+
CredentialProjectionScheme["Bearer"] = "bearer";
|
|
12
|
+
CredentialProjectionScheme["Basic"] = "basic";
|
|
13
|
+
CredentialProjectionScheme["Header"] = "header";
|
|
14
|
+
})(CredentialProjectionScheme || (exports.CredentialProjectionScheme = CredentialProjectionScheme = {}));
|
|
15
|
+
exports.CredentialProjectionSchemeSchema = zod_1.z.nativeEnum(CredentialProjectionScheme);
|
|
16
|
+
const VALUE_TEMPLATE_MAX = 500;
|
|
17
|
+
const FieldNameSchema = zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(CREDENTIAL_STRATEGY_STRING_MAX)
|
|
21
|
+
.regex(/^[A-Za-z][A-Za-z0-9_]*$/, 'field name must be an identifier-like key of the resolved credential');
|
|
22
|
+
exports.CredentialStrategyContributionManifestSchema = zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
key: credential_kind_1.CredentialKindRefSchema.regex(/^[A-Z][A-Z0-9_]*$/, 'a contributed credential-strategy key must be UPPER_SNAKE (e.g. ACME_HMAC)').refine((k) => !(0, credential_kind_1.isCuratedCredentialKind)(k), {
|
|
25
|
+
message: 'a contributed credential-strategy key must not collide with a curated CredentialKind (curated always wins)',
|
|
26
|
+
}),
|
|
27
|
+
displayName: zod_1.z.string().min(1).max(CREDENTIAL_STRATEGY_STRING_MAX),
|
|
28
|
+
scheme: exports.CredentialProjectionSchemeSchema,
|
|
29
|
+
tokenField: FieldNameSchema.optional(),
|
|
30
|
+
usernameField: FieldNameSchema.optional(),
|
|
31
|
+
passwordField: FieldNameSchema.optional(),
|
|
32
|
+
headerName: zod_1.z
|
|
33
|
+
.string()
|
|
34
|
+
.min(1)
|
|
35
|
+
.max(CREDENTIAL_STRATEGY_STRING_MAX)
|
|
36
|
+
.regex(/^[A-Za-z][A-Za-z0-9-]*$/, 'headerName must be a valid HTTP header name')
|
|
37
|
+
.optional(),
|
|
38
|
+
valuePrefix: zod_1.z.string().max(CREDENTIAL_STRATEGY_STRING_MAX).optional(),
|
|
39
|
+
valueTemplate: zod_1.z.string().min(1).max(VALUE_TEMPLATE_MAX).optional(),
|
|
40
|
+
staticParams: zod_1.z
|
|
41
|
+
.record(zod_1.z.string().min(1).max(CREDENTIAL_STRATEGY_STRING_MAX), zod_1.z.string().max(CREDENTIAL_STRATEGY_STRING_MAX))
|
|
42
|
+
.refine((r) => Object.keys(r).length <= CREDENTIAL_STRATEGY_STATIC_PARAMS_MAX, `at most ${CREDENTIAL_STRATEGY_STATIC_PARAMS_MAX} static params`)
|
|
43
|
+
.optional(),
|
|
44
|
+
})
|
|
45
|
+
.superRefine((m, ctx) => {
|
|
46
|
+
const requireField = (present, field, why) => {
|
|
47
|
+
if (present === undefined) {
|
|
48
|
+
ctx.addIssue({ code: 'custom', path: [field], message: why });
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const forbidField = (present, field) => {
|
|
52
|
+
if (present !== undefined) {
|
|
53
|
+
ctx.addIssue({
|
|
54
|
+
code: 'custom',
|
|
55
|
+
path: [field],
|
|
56
|
+
message: `"${String(field)}" is not valid for scheme "${m.scheme}"`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
switch (m.scheme) {
|
|
61
|
+
case CredentialProjectionScheme.Bearer:
|
|
62
|
+
requireField(m.tokenField, 'tokenField', 'bearer scheme requires tokenField');
|
|
63
|
+
forbidField(m.usernameField, 'usernameField');
|
|
64
|
+
forbidField(m.passwordField, 'passwordField');
|
|
65
|
+
forbidField(m.headerName, 'headerName');
|
|
66
|
+
forbidField(m.valuePrefix, 'valuePrefix');
|
|
67
|
+
forbidField(m.valueTemplate, 'valueTemplate');
|
|
68
|
+
break;
|
|
69
|
+
case CredentialProjectionScheme.Basic:
|
|
70
|
+
requireField(m.usernameField, 'usernameField', 'basic scheme requires usernameField');
|
|
71
|
+
requireField(m.passwordField, 'passwordField', 'basic scheme requires passwordField');
|
|
72
|
+
forbidField(m.tokenField, 'tokenField');
|
|
73
|
+
forbidField(m.headerName, 'headerName');
|
|
74
|
+
forbidField(m.valuePrefix, 'valuePrefix');
|
|
75
|
+
forbidField(m.valueTemplate, 'valueTemplate');
|
|
76
|
+
break;
|
|
77
|
+
case CredentialProjectionScheme.Header:
|
|
78
|
+
requireField(m.headerName, 'headerName', 'header scheme requires headerName');
|
|
79
|
+
requireField(m.valueTemplate, 'valueTemplate', 'header scheme requires valueTemplate');
|
|
80
|
+
forbidField(m.tokenField, 'tokenField');
|
|
81
|
+
forbidField(m.usernameField, 'usernameField');
|
|
82
|
+
forbidField(m.passwordField, 'passwordField');
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function templateFieldNames(valueTemplate) {
|
|
87
|
+
const out = [];
|
|
88
|
+
const re = /\{([A-Za-z][A-Za-z0-9_]*)\}/g;
|
|
89
|
+
let match;
|
|
90
|
+
while ((match = re.exec(valueTemplate)) !== null) {
|
|
91
|
+
if (!out.includes(match[1])) {
|
|
92
|
+
out.push(match[1]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=credential-strategy-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-strategy-contribution.js","sourceRoot":"","sources":["../../../src/connector/lib/credential-strategy-contribution.ts"],"names":[],"mappings":";;;AA4MA,gDAUC;AA7LD,6BAAwB;AAExB,uDAI2B;AAG3B,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAG3C,MAAM,qCAAqC,GAAG,EAAE,CAAC;AAWjD,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,+CAAiB,CAAA;IACjB,6CAAe,CAAA;IACf,+CAAiB,CAAA;AACnB,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC;AAEY,QAAA,gCAAgC,GAAG,OAAC,CAAC,UAAU,CAC1D,0BAA0B,CAC3B,CAAC;AAOF,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAG/B,MAAM,eAAe,GAAG,OAAC;KACtB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,8BAA8B,CAAC;KACnC,KAAK,CACJ,yBAAyB,EACzB,sEAAsE,CACvE,CAAC;AA2CS,QAAA,4CAA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const IntegrationProviderContributionManifestSchema: z.ZodObject<
|
|
|
61
61
|
iconName: z.ZodString;
|
|
62
62
|
providerKey: z.ZodString;
|
|
63
63
|
scopes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
64
|
-
connectionCredentialKind: z.
|
|
64
|
+
connectionCredentialKind: z.ZodString;
|
|
65
65
|
adapterKind: z.ZodString;
|
|
66
66
|
operations: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
67
67
|
capabilityRef: z.ZodType<import("../../capability").CapabilityRef, unknown, z.core.$ZodTypeInternals<import("../../capability").CapabilityRef, unknown>>;
|
|
@@ -30,7 +30,8 @@ export declare enum ContributionKind {
|
|
|
30
30
|
Capability = "capability",
|
|
31
31
|
ResourceOwnership = "resource-ownership",
|
|
32
32
|
StageMachine = "stage-machine",
|
|
33
|
-
SearchType = "search-type"
|
|
33
|
+
SearchType = "search-type",
|
|
34
|
+
CredentialStrategy = "credential-strategy"
|
|
34
35
|
}
|
|
35
36
|
export declare const ContributionKindSchema: z.ZodEnum<typeof ContributionKind>;
|
|
36
37
|
export type ContributionKindValue = `${ContributionKind}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution-kind.d.ts","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkDxB,oBAAY,gBAAgB;IAS1B,WAAW,iBAAiB;IAO5B,OAAO,aAAa;IACpB,YAAY,kBAAkB;IAQ9B,UAAU,gBAAgB;IAK1B,YAAY,kBAAkB;IAC9B,UAAU,gBAAgB;IAC1B,WAAW,iBAAiB;IAS5B,wBAAwB,+BAA+B;IACvD,UAAU,gBAAgB;IAQ1B,YAAY,kBAAkB;IAM9B,WAAW,iBAAiB;IAW5B,cAAc,oBAAoB;IAMlC,kBAAkB,yBAAyB;IAK3C,IAAI,SAAS;IAEb,UAAU,gBAAgB;IAM1B,oBAA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C;AAMD,eAAO,MAAM,sBAAsB,oCAAiC,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,GAAG,gBAAgB,EAAE,CAAC"}
|
|
@@ -35,6 +35,7 @@ var ContributionKind;
|
|
|
35
35
|
ContributionKind["ResourceOwnership"] = "resource-ownership";
|
|
36
36
|
ContributionKind["StageMachine"] = "stage-machine";
|
|
37
37
|
ContributionKind["SearchType"] = "search-type";
|
|
38
|
+
ContributionKind["CredentialStrategy"] = "credential-strategy";
|
|
38
39
|
})(ContributionKind || (exports.ContributionKind = ContributionKind = {}));
|
|
39
40
|
exports.ContributionKindSchema = zod_1.z.nativeEnum(ContributionKind);
|
|
40
41
|
//# sourceMappingURL=contribution-kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution-kind.js","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAkDxB,IAAY,
|
|
1
|
+
{"version":3,"file":"contribution-kind.js","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAkDxB,IAAY,gBAwNX;AAxND,WAAY,gBAAgB;IAS1B,gDAA4B,CAAA;IAO5B,wCAAoB,CAAA;IACpB,kDAA8B,CAAA;IAQ9B,8CAA0B,CAAA;IAK1B,kDAA8B,CAAA;IAC9B,8CAA0B,CAAA;IAC1B,gDAA4B,CAAA;IAS5B,2EAAuD,CAAA;IACvD,8CAA0B,CAAA;IAQ1B,kDAA8B,CAAA;IAM9B,gDAA4B,CAAA;IAW5B,sDAAkC,CAAA;IAMlC,+DAA2C,CAAA;IAK3C,iCAAa,CAAA;IAEb,8CAA0B,CAAA;IAM1B,kEAA8C,CAAA;IAK9C,mEAA+C,CAAA;IAK/C,6EAAyD,CAAA;IAGzD,gEAA4C,CAAA;IAI5C,sDAAkC,CAAA;IAElC,wDAAoC,CAAA;IAEpC,4DAAwC,CAAA;IAMxC,6EAAyD,CAAA;IAEzD,gDAA4B,CAAA;IAI5B,8CAA0B,CAAA;IAO1B,kDAA8B,CAAA;IAM9B,sDAAkC,CAAA;IAgBlC,6CAAyB,CAAA;IAezB,4DAAwC,CAAA;IAcxC,kDAA8B,CAAA;IAkB9B,8CAA0B,CAAA;IAoB1B,8DAA0C,CAAA;AAC5C,CAAC,EAxNW,gBAAgB,gCAAhB,gBAAgB,QAwN3B;AAMY,QAAA,sBAAsB,GAAG,OAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
|
|
@@ -130,6 +130,29 @@ export interface AgentNode
|
|
|
130
130
|
readonly limits?: AgentLimits;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Declares that an agent/composition ALWAYS runs inside a single, reusable
|
|
135
|
+
* "standing" session keyed by {@link pinKey}, instead of minting a fresh
|
|
136
|
+
* session per launch. When present, the session layer (agent-session-api)
|
|
137
|
+
* does a get-or-create keyed by `(orgId, projectId, pinKey)` at
|
|
138
|
+
* `POST /sessions` — a non-terminal existing session for the same key is
|
|
139
|
+
* ADOPTED; otherwise a new one is minted and pinned.
|
|
140
|
+
*
|
|
141
|
+
* OPTIONAL + additive: absent ⇒ today's behaviour (a fresh session per
|
|
142
|
+
* launch). A standing session is paired with a `persistent` lifecycle so it
|
|
143
|
+
* is not idle-reaped, but it STILL participates in the resume-tier idle
|
|
144
|
+
* scale-to-zero (`soft_pause` → `warm_pod` → `cold`) — standing ≠
|
|
145
|
+
* always-warm; it rehydrates from the durable workspace on the next message.
|
|
146
|
+
*/
|
|
147
|
+
export interface StandingSessionRef {
|
|
148
|
+
/**
|
|
149
|
+
* Stable key identifying the standing session for a purpose/biome, e.g.
|
|
150
|
+
* `{biomeId}:{purpose}`. Two launches of the same agent within the same
|
|
151
|
+
* `(orgId, projectId)` that carry the same `pinKey` reuse ONE session row.
|
|
152
|
+
*/
|
|
153
|
+
readonly pinKey: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
133
156
|
/**
|
|
134
157
|
* A named, versioned, reusable Agent.
|
|
135
158
|
*/
|
|
@@ -173,6 +196,14 @@ export interface Agent {
|
|
|
173
196
|
* chat-style agents; see {@link WorkspaceSharingPolicy}.
|
|
174
197
|
*/
|
|
175
198
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
199
|
+
/**
|
|
200
|
+
* When set, this agent ALWAYS runs inside its standing (pinned) session
|
|
201
|
+
* keyed by `pinKey` — the session layer adopts a non-terminal existing
|
|
202
|
+
* session for `(orgId, projectId, pinKey)` instead of minting a new one.
|
|
203
|
+
* OPTIONAL + additive: absent ⇒ a fresh session per launch. See
|
|
204
|
+
* {@link StandingSessionRef}.
|
|
205
|
+
*/
|
|
206
|
+
readonly standingSession?: StandingSessionRef;
|
|
176
207
|
}
|
|
177
208
|
|
|
178
209
|
/**
|
|
@@ -237,4 +268,10 @@ export interface ResolvedAgent {
|
|
|
237
268
|
* (`isolated`), applied explicitly at the read site.
|
|
238
269
|
*/
|
|
239
270
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
271
|
+
/**
|
|
272
|
+
* Resolved standing-session pin — carried from the source `Agent` so the
|
|
273
|
+
* session layer can do its `(orgId, projectId, pinKey)` get-or-create
|
|
274
|
+
* without re-fetching the definition. Absent ⇒ a fresh session per launch.
|
|
275
|
+
*/
|
|
276
|
+
readonly standingSession?: StandingSessionRef;
|
|
240
277
|
}
|
package/src/app-runtime/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './lib/app-client';
|
|
|
6
6
|
export * from './lib/app-lockfile';
|
|
7
7
|
export * from './lib/branding-config';
|
|
8
8
|
export * from './lib/surface-kind';
|
|
9
|
+
export * from './lib/app-shell-binding';
|
|
9
10
|
export * from './lib/app-channel';
|
|
10
11
|
export * from './lib/app-release';
|
|
11
12
|
export * from './lib/app';
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { AudienceKind } from './audience-policy';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* D14 — Shell, audience and host are THREE ORTHOGONAL dimensions of an App.
|
|
7
|
+
* A public page is not necessarily embedded; a standalone app may be anonymous
|
|
8
|
+
* or internally authenticated. This file owns two of the three closed dimensions
|
|
9
|
+
* (the third, audience, is the existing {@link AudienceKind} — D14 forbids
|
|
10
|
+
* minting a second audience enum) and the rules for which COMBINATIONS are legal.
|
|
11
|
+
*
|
|
12
|
+
* The legality rules live here, in the kernel, next to the dimensions they
|
|
13
|
+
* constrain — not scattered across each consumer. app-forge's publish path calls
|
|
14
|
+
* {@link validateAppSurfaceCombination}; it does not re-encode the rules.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `AppShellKind` — how much host chrome / navigation / layout an App surface
|
|
19
|
+
* carries. Owns: chrome, nav, layout.
|
|
20
|
+
*
|
|
21
|
+
* - `Hosted` — rendered inside the Xema host shell (rail, topbar, org switch).
|
|
22
|
+
* - `Standalone` — its own full-page surface, no host shell (e.g. a custom domain).
|
|
23
|
+
* - `Embedded` — rendered inside a third-party page via an iframe/snippet.
|
|
24
|
+
* - `Headless` — no UI at all; an API/automation surface.
|
|
25
|
+
*
|
|
26
|
+
* Values are stable wire strings — never compare against a free-form string.
|
|
27
|
+
*/
|
|
28
|
+
export enum AppShellKind {
|
|
29
|
+
Hosted = 'hosted',
|
|
30
|
+
Standalone = 'standalone',
|
|
31
|
+
Embedded = 'embedded',
|
|
32
|
+
Headless = 'headless',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const AppShellKindSchema = z.nativeEnum(AppShellKind);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* `AppHostBinding` — where an App is served from. Owns: origin, CSP, cookies,
|
|
39
|
+
* SEO, certificates.
|
|
40
|
+
*
|
|
41
|
+
* - `Xema` — under a Xema-owned origin/path.
|
|
42
|
+
* - `CustomDomain` — the customer's own domain (needs ACME cert issuance).
|
|
43
|
+
* - `PathBased` — a path on a shared host, not its own origin.
|
|
44
|
+
*
|
|
45
|
+
* Values are stable wire strings.
|
|
46
|
+
*/
|
|
47
|
+
export enum AppHostBinding {
|
|
48
|
+
Xema = 'xema',
|
|
49
|
+
CustomDomain = 'custom-domain',
|
|
50
|
+
PathBased = 'path-based',
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const AppHostBindingSchema = z.nativeEnum(AppHostBinding);
|
|
54
|
+
|
|
55
|
+
/** The three-dimension surface descriptor an App declares. */
|
|
56
|
+
export interface AppSurfaceDimensions {
|
|
57
|
+
readonly shell: AppShellKind;
|
|
58
|
+
readonly audience: AudienceKind;
|
|
59
|
+
readonly host: AppHostBinding;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const AppSurfaceDimensionsSchema: z.ZodType<AppSurfaceDimensions> = z
|
|
63
|
+
.object({
|
|
64
|
+
shell: AppShellKindSchema,
|
|
65
|
+
audience: z.nativeEnum(AudienceKind),
|
|
66
|
+
host: AppHostBindingSchema,
|
|
67
|
+
})
|
|
68
|
+
.strict() as z.ZodType<AppSurfaceDimensions>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A single reason a `(shell, audience, host)` combination is illegal. `code` is a
|
|
72
|
+
* closed set so consumers can branch on it; `message` is human-facing.
|
|
73
|
+
*/
|
|
74
|
+
export enum AppSurfaceConflictCode {
|
|
75
|
+
HeadlessWithChrome = 'headless-with-chrome',
|
|
76
|
+
EmbeddedIsChrome = 'embedded-is-chrome',
|
|
77
|
+
StandaloneNeedsOwnHost = 'standalone-needs-own-host',
|
|
78
|
+
EmbeddedNeedsXemaHost = 'embedded-needs-xema-host',
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface AppSurfaceConflict {
|
|
82
|
+
readonly code: AppSurfaceConflictCode;
|
|
83
|
+
readonly message: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface AppSurfaceValidation {
|
|
87
|
+
readonly ok: boolean;
|
|
88
|
+
readonly conflicts: readonly AppSurfaceConflict[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Validate a `(shell, audience, host)` combination against D14's legality rules.
|
|
93
|
+
* PURE and total — returns every conflict, never throws. The empty-conflict case
|
|
94
|
+
* is `ok: true`.
|
|
95
|
+
*
|
|
96
|
+
* Rules (each with a reason, so the publish screen can explain it):
|
|
97
|
+
* - `Headless` is a NO-UI surface, so it cannot also be `Embedded` (which is a UI
|
|
98
|
+
* shell). `headless` + `embedded` is the canonical contradiction the plan names.
|
|
99
|
+
* - `Embedded` IS a chrome mode; it is meaningful only for a UI shell, so an
|
|
100
|
+
* `Embedded` + `Headless` pairing is caught by the same rule from the other side.
|
|
101
|
+
* - `Standalone` (its own full-page surface) implies its own origin — it cannot be
|
|
102
|
+
* `PathBased` (a path on a shared host). `custom-domain` or `xema` are fine.
|
|
103
|
+
* - `Embedded` is served to a third-party page and relies on the Xema origin's
|
|
104
|
+
* CSP/cookies, so it must be `Xema`-hosted, not a `CustomDomain`/`PathBased`.
|
|
105
|
+
*
|
|
106
|
+
* `public-anon` + `custom-domain` is explicitly LEGAL (a public citizen portal on
|
|
107
|
+
* the customer's own domain) — there is no rule against it, so it returns `ok`.
|
|
108
|
+
* Audience does not currently gate shell/host on its own; the dimension is passed
|
|
109
|
+
* so the rules can grow without a signature change.
|
|
110
|
+
*/
|
|
111
|
+
export function validateAppSurfaceCombination(
|
|
112
|
+
dims: AppSurfaceDimensions,
|
|
113
|
+
): AppSurfaceValidation {
|
|
114
|
+
const conflicts: AppSurfaceConflict[] = [];
|
|
115
|
+
|
|
116
|
+
// The headless+embedded contradiction cannot be expressed as a SINGLE
|
|
117
|
+
// AppShellKind value (they are distinct enum members), so a surface with one
|
|
118
|
+
// declared shell is internally consistent on that axis. A consumer that models
|
|
119
|
+
// "embedded" as a separate flag alongside the shell must use
|
|
120
|
+
// isHeadlessEmbeddedContradiction() to reject the pair — documented there.
|
|
121
|
+
|
|
122
|
+
if (
|
|
123
|
+
dims.shell === AppShellKind.Standalone &&
|
|
124
|
+
dims.host === AppHostBinding.PathBased
|
|
125
|
+
) {
|
|
126
|
+
conflicts.push({
|
|
127
|
+
code: AppSurfaceConflictCode.StandaloneNeedsOwnHost,
|
|
128
|
+
message:
|
|
129
|
+
'A standalone app has its own full-page surface and cannot be path-based on a shared host; use xema or custom-domain.',
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (
|
|
134
|
+
dims.shell === AppShellKind.Embedded &&
|
|
135
|
+
dims.host !== AppHostBinding.Xema
|
|
136
|
+
) {
|
|
137
|
+
conflicts.push({
|
|
138
|
+
code: AppSurfaceConflictCode.EmbeddedNeedsXemaHost,
|
|
139
|
+
message:
|
|
140
|
+
"An embedded app is served into a third-party page and relies on the Xema origin's CSP/cookies; it must be xema-hosted.",
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return { ok: conflicts.length === 0, conflicts };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The `headless` + `embedded` contradiction the plan names explicitly. Because
|
|
149
|
+
* `AppShellKind` is a single value, a surface cannot BE both at once — but a
|
|
150
|
+
* consumer that models shell as a SET, or that derives "embedded" from a separate
|
|
151
|
+
* `embed` flag alongside a `headless` shell, must reject the pair. This helper
|
|
152
|
+
* makes that cross-field rule reusable and named, so no consumer re-encodes it.
|
|
153
|
+
*/
|
|
154
|
+
export function isHeadlessEmbeddedContradiction(
|
|
155
|
+
shell: AppShellKind,
|
|
156
|
+
alsoEmbedded: boolean,
|
|
157
|
+
): boolean {
|
|
158
|
+
return shell === AppShellKind.Headless && alsoEmbedded;
|
|
159
|
+
}
|
|
@@ -24,13 +24,15 @@ const PRIMARY_COLOR_REGEX =
|
|
|
24
24
|
* - `cssTokens` is the escape hatch for richer theming — keys are intended to
|
|
25
25
|
* map to CSS custom-property names (without the leading `--`).
|
|
26
26
|
*
|
|
27
|
-
* STATUS (2026-07-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
27
|
+
* STATUS (2026-07-13): the runtime applier SHIPPED (Wave 8.4). `@xemahq/ui-kernel`'s
|
|
28
|
+
* `AppBrandingProvider` writes `primaryColor` → `--app-primary-color` and each
|
|
29
|
+
* `cssTokens` entry → a `--<key>` CSS custom property on its OWN subtree wrapper
|
|
30
|
+
* (never `documentElement` — no leak into host chrome), sanitising unsafe CSS /
|
|
31
|
+
* non-http(s) logo URLs; it is wired into the app-forge `ExternalAppPage` /
|
|
32
|
+
* `AppRuntimePage`. The remaining gap is upstream of this contract: the external/
|
|
33
|
+
* public app-definition response DTO surfaces only `displayName`, so `logoUrl` /
|
|
34
|
+
* `primaryColor` / `cssTokens` (and the per-`AppRoleBinding.tenantId` override)
|
|
35
|
+
* must still be threaded onto that wire before the applier can render them.
|
|
34
36
|
*/
|
|
35
37
|
export interface BrandingConfig {
|
|
36
38
|
displayName: string;
|
package/src/connector/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './lib/connector-adapter-kind';
|
|
|
3
3
|
export * from './lib/connector-http-request';
|
|
4
4
|
export * from './lib/capability';
|
|
5
5
|
export * from './lib/credential-kind';
|
|
6
|
+
export * from './lib/credential-strategy-contribution';
|
|
6
7
|
export * from './lib/onboarding-manifest';
|
|
7
8
|
export * from './lib/provider-descriptor';
|
|
8
9
|
export * from './lib/connector-descriptor';
|
|
@@ -22,7 +22,10 @@ import { z } from 'zod';
|
|
|
22
22
|
|
|
23
23
|
import { CapabilityRefSchema, type CapabilityRef } from '../../capability';
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
CredentialKindRefSchema,
|
|
27
|
+
type CredentialKindRef,
|
|
28
|
+
} from './credential-kind';
|
|
26
29
|
import {
|
|
27
30
|
ConnectorAdapterKind,
|
|
28
31
|
ConnectorAdapterKindSchema,
|
|
@@ -158,8 +161,14 @@ export interface ConnectorDescriptor {
|
|
|
158
161
|
* How an individual connection to THIS connector authenticates at runtime
|
|
159
162
|
* (the per-connection wallet/token). `oauth_user` for OAuth connectors,
|
|
160
163
|
* `imap_auth` / `smtp_auth` for the mail wallets, `pat` / `api_key`, …
|
|
164
|
+
*
|
|
165
|
+
* OPEN registry-backed key ({@link CredentialKindRef}): a curated
|
|
166
|
+
* {@link CredentialKind} value OR a biome-contributed strategy key. The
|
|
167
|
+
* kernel constrains the shape only; the connector-gateway credential-strategy
|
|
168
|
+
* registry decides validity (curated OR registered contributed), fail-fast on
|
|
169
|
+
* an unknown key — mirroring how `OrgIntegration.provider` was opened.
|
|
161
170
|
*/
|
|
162
|
-
readonly connectionCredentialKind:
|
|
171
|
+
readonly connectionCredentialKind: CredentialKindRef;
|
|
163
172
|
|
|
164
173
|
/**
|
|
165
174
|
* The adapter category this connector plugs into (`mail`, `scm`, …). Drives
|
|
@@ -191,7 +200,7 @@ export const ConnectorDescriptorSchema = z.strictObject({
|
|
|
191
200
|
iconName: z.string().min(1),
|
|
192
201
|
providerKey: z.string().min(1),
|
|
193
202
|
scopes: z.array(z.string()).readonly(),
|
|
194
|
-
connectionCredentialKind:
|
|
203
|
+
connectionCredentialKind: CredentialKindRefSchema,
|
|
195
204
|
adapterKind: z.string().min(1),
|
|
196
205
|
operations: z.array(ConnectorOperationDescriptorSchema).readonly().optional(),
|
|
197
206
|
});
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
4
|
+
* The CURATED credential strategies the platform ships built-in. This enum is
|
|
5
|
+
* the closed vocabulary of first-party mint strategies (pure field-projection
|
|
6
|
+
* plus the two delegated kinds `app_install` / `iam_role`).
|
|
7
|
+
*
|
|
8
|
+
* It is NO LONGER the whole universe of credential kinds. As of the
|
|
9
|
+
* credential-strategy contribution seam, a biome may CONTRIBUTE an additional
|
|
10
|
+
* DECLARATIVE strategy under its own open key ({@link CredentialKindRef}),
|
|
11
|
+
* registered at runtime — exactly the way `OrgIntegration.provider` was opened
|
|
12
|
+
* from the closed `ConnectorKind` enum to an open registry-backed key. The
|
|
13
|
+
* curated values below always WIN a key collision; a contributed strategy that
|
|
14
|
+
* names a curated value is rejected at the registry seam.
|
|
5
15
|
*
|
|
6
|
-
* Adding a kind here is a one-line schema change plus a matching
|
|
7
|
-
* strategy implementation
|
|
16
|
+
* Adding a CURATED kind here is a one-line schema change plus a matching
|
|
17
|
+
* built-in strategy implementation. Adding a THIRD-PARTY kind needs no kernel
|
|
18
|
+
* change — it flows through `ContributionKind.CredentialStrategy`.
|
|
8
19
|
*/
|
|
9
20
|
export enum CredentialKind {
|
|
10
21
|
/** GitHub App / GitLab App style installation token (per-installation, 1h). */
|
|
@@ -46,6 +57,52 @@ export enum CredentialKind {
|
|
|
46
57
|
ImapAuth = 'imap_auth',
|
|
47
58
|
}
|
|
48
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Every curated `CredentialKind` wire value, frozen. The single source of truth
|
|
62
|
+
* for "is this a first-party built-in kind?" used by {@link isCuratedCredentialKind}
|
|
63
|
+
* and by the connector-gateway registry seam (curated always wins a collision).
|
|
64
|
+
*/
|
|
65
|
+
export const CURATED_CREDENTIAL_KINDS: readonly CredentialKind[] =
|
|
66
|
+
Object.freeze(Object.values(CredentialKind));
|
|
67
|
+
|
|
68
|
+
const CURATED_CREDENTIAL_KIND_VALUES: ReadonlySet<string> = new Set(
|
|
69
|
+
CURATED_CREDENTIAL_KINDS as readonly string[],
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* An OPEN credential-kind key carried on `ConnectorDescriptor
|
|
74
|
+
* .connectionCredentialKind` and on the credential resolve wire. It is EITHER a
|
|
75
|
+
* curated {@link CredentialKind} wire value (`oauth_user`, `api_key`, …) OR a
|
|
76
|
+
* biome-contributed strategy key (UPPER_SNAKE, e.g. `ACME_HMAC`). The kernel
|
|
77
|
+
* intentionally does NOT close this set — validity is enforced at the runtime
|
|
78
|
+
* seam by the connector-gateway credential-strategy registry (curated OR
|
|
79
|
+
* registered contributed), exactly like `OrgIntegration.provider`. The kernel
|
|
80
|
+
* only constrains the SHAPE (a non-empty slug), never the membership.
|
|
81
|
+
*/
|
|
82
|
+
export type CredentialKindRef = string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Shape validator for a {@link CredentialKindRef}. Permissive enough for BOTH
|
|
86
|
+
* the curated lowercase_snake values AND contributed UPPER_SNAKE / kebab keys;
|
|
87
|
+
* membership (known vs unknown) is a runtime-registry decision, never a kernel
|
|
88
|
+
* one. Bounded so persisted rows and envelopes stay small.
|
|
89
|
+
*/
|
|
90
|
+
export const CredentialKindRefSchema = z
|
|
91
|
+
.string()
|
|
92
|
+
.min(1)
|
|
93
|
+
.max(64)
|
|
94
|
+
.regex(
|
|
95
|
+
/^[A-Za-z][A-Za-z0-9_-]*$/,
|
|
96
|
+
'credential-kind ref must be a slug: an initial letter then letters/digits/_/-',
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
/** Whether `value` is one of the CURATED (first-party built-in) credential kinds. */
|
|
100
|
+
export function isCuratedCredentialKind(
|
|
101
|
+
value: string,
|
|
102
|
+
): value is CredentialKind {
|
|
103
|
+
return CURATED_CREDENTIAL_KIND_VALUES.has(value);
|
|
104
|
+
}
|
|
105
|
+
|
|
49
106
|
/**
|
|
50
107
|
* Closed TLS-mode enum shared by SMTP + IMAP wallets. `auto` lets the
|
|
51
108
|
* client library pick the right mode for the configured port:
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
3
|
+
* Credential-strategy contribution — the DECLARATIVE tier
|
|
4
|
+
*
|
|
5
|
+
* A biome that ships a connector needing an auth scheme the platform does not
|
|
6
|
+
* have built-in (a custom API-key header, an unusual basic-auth field naming, a
|
|
7
|
+
* templated bearer value) contributes a `ContributionKind.CredentialStrategy`
|
|
8
|
+
* envelope carrying THIS manifest. It is pure DATA: a projection of the fields
|
|
9
|
+
* already resolved from custody into an outbound token — NO executable code.
|
|
10
|
+
*
|
|
11
|
+
* This is the answer to "the credential plane must fit ANY connector" WITHOUT
|
|
12
|
+
* closing `CredentialKind` to 12 values. The contributed strategy registers
|
|
13
|
+
* under its own open key ({@link CredentialKindRef}); the connector-gateway
|
|
14
|
+
* credential resolver builds a runtime `CredentialStrategy` from the projection
|
|
15
|
+
* and mints exactly as a built-in would. Novel MINT LOGIC that cannot be
|
|
16
|
+
* expressed as a projection (custom signing, multi-step token exchange) is the
|
|
17
|
+
* SEPARATE code-bearing tier and is NOT expressible here — by design.
|
|
18
|
+
*
|
|
19
|
+
* Provenance (`biome.id`, `biome.version`) is NOT a field here — the parser and
|
|
20
|
+
* the receiving service stamp it from the discovering biome's manifest.
|
|
21
|
+
* Validation is fail-fast: a contribution that violates any constraint is
|
|
22
|
+
* rejected at boot. No silent coercion.
|
|
23
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { z } from 'zod';
|
|
27
|
+
|
|
28
|
+
import {
|
|
29
|
+
CredentialKindRefSchema,
|
|
30
|
+
isCuratedCredentialKind,
|
|
31
|
+
type CredentialKindRef,
|
|
32
|
+
} from './credential-kind';
|
|
33
|
+
|
|
34
|
+
/** Bound on the display name + template + header strings, keeping envelopes small. */
|
|
35
|
+
const CREDENTIAL_STRATEGY_STRING_MAX = 200;
|
|
36
|
+
|
|
37
|
+
/** Hard cap on the number of static providerHints a strategy may declare. */
|
|
38
|
+
const CREDENTIAL_STRATEGY_STATIC_PARAMS_MAX = 20;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The declarative projection SCHEME a contributed strategy uses — a closed set,
|
|
42
|
+
* each mapping 1:1 onto an existing `MintedTokenType`. A biome that needs a
|
|
43
|
+
* scheme NOT in this set needs the code-bearing tier, not a wider enum.
|
|
44
|
+
*
|
|
45
|
+
* - `bearer` → `Authorization: Bearer <field>` (MintedTokenType `bearer`)
|
|
46
|
+
* - `basic` → `Authorization: Basic base64(user:pass)` (MintedTokenType `basic`)
|
|
47
|
+
* - `header` → `<headerName>: <valuePrefix><templated>` (MintedTokenType `header`)
|
|
48
|
+
*/
|
|
49
|
+
export enum CredentialProjectionScheme {
|
|
50
|
+
Bearer = 'bearer',
|
|
51
|
+
Basic = 'basic',
|
|
52
|
+
Header = 'header',
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const CredentialProjectionSchemeSchema = z.nativeEnum(
|
|
56
|
+
CredentialProjectionScheme,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A `{placeholder}` template referencing decrypted credential fields, e.g.
|
|
61
|
+
* `"{apiKey}"` or `"v1:{keyId}:{secret}"`. Every `{name}` MUST resolve to a
|
|
62
|
+
* present string field on the resolved credential at mint time (fail-fast).
|
|
63
|
+
*/
|
|
64
|
+
const VALUE_TEMPLATE_MAX = 500;
|
|
65
|
+
|
|
66
|
+
/** Field-name shape shared by every `*Field` selector (a decrypted-blob key). */
|
|
67
|
+
const FieldNameSchema = z
|
|
68
|
+
.string()
|
|
69
|
+
.min(1)
|
|
70
|
+
.max(CREDENTIAL_STRATEGY_STRING_MAX)
|
|
71
|
+
.regex(
|
|
72
|
+
/^[A-Za-z][A-Za-z0-9_]*$/,
|
|
73
|
+
'field name must be an identifier-like key of the resolved credential',
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Manifest shape carried by every `ContributionKind.CredentialStrategy`
|
|
78
|
+
* envelope. One contribution = one declarative credential strategy.
|
|
79
|
+
*
|
|
80
|
+
* Mirrors `CapabilityContributionManifest` / `SearchTypeContributionManifest`:
|
|
81
|
+
* a value-identical subset of the wire body the owning service
|
|
82
|
+
* (`connector-gateway-api`) accepts, validated fail-fast at biome-discovery
|
|
83
|
+
* time. Cross-field validation binds the scheme-specific selectors so a
|
|
84
|
+
* malformed projection can never reach the registry.
|
|
85
|
+
*/
|
|
86
|
+
export interface CredentialStrategyContributionManifest {
|
|
87
|
+
/**
|
|
88
|
+
* The OPEN credential-kind key this strategy mints under (UPPER_SNAKE, e.g.
|
|
89
|
+
* `ACME_HMAC`). MUST NOT be a curated {@link CredentialKind} value — curated
|
|
90
|
+
* always wins, so a contributed strategy may never shadow one.
|
|
91
|
+
*/
|
|
92
|
+
readonly key: CredentialKindRef;
|
|
93
|
+
/** Human-readable strategy name for catalog/admin surfaces. */
|
|
94
|
+
readonly displayName: string;
|
|
95
|
+
/** Which projection scheme mints the outbound token. */
|
|
96
|
+
readonly scheme: CredentialProjectionScheme;
|
|
97
|
+
/** `bearer` — the decrypted field carrying the raw bearer token. */
|
|
98
|
+
readonly tokenField?: string;
|
|
99
|
+
/** `basic` — the decrypted field carrying the username. */
|
|
100
|
+
readonly usernameField?: string;
|
|
101
|
+
/** `basic` — the decrypted field carrying the password/secret. */
|
|
102
|
+
readonly passwordField?: string;
|
|
103
|
+
/** `header` — the outbound header name (e.g. `X-Api-Key`). */
|
|
104
|
+
readonly headerName?: string;
|
|
105
|
+
/** `header` — optional static prefix prepended to the templated value (e.g. `"Token "`). */
|
|
106
|
+
readonly valuePrefix?: string;
|
|
107
|
+
/** `header` — `{field}` template producing the header value from decrypted fields. */
|
|
108
|
+
readonly valueTemplate?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Optional static, NON-SECRET routing hints merged verbatim into the minted
|
|
111
|
+
* token's `providerHints` (regional endpoint, app id, …). Never a secret —
|
|
112
|
+
* secrets flow only through the projected fields.
|
|
113
|
+
*/
|
|
114
|
+
readonly staticParams?: Readonly<Record<string, string>>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const CredentialStrategyContributionManifestSchema: z.ZodType<CredentialStrategyContributionManifest> =
|
|
118
|
+
z
|
|
119
|
+
.object({
|
|
120
|
+
key: CredentialKindRefSchema.regex(
|
|
121
|
+
/^[A-Z][A-Z0-9_]*$/,
|
|
122
|
+
'a contributed credential-strategy key must be UPPER_SNAKE (e.g. ACME_HMAC)',
|
|
123
|
+
).refine((k) => !isCuratedCredentialKind(k), {
|
|
124
|
+
message:
|
|
125
|
+
'a contributed credential-strategy key must not collide with a curated CredentialKind (curated always wins)',
|
|
126
|
+
}),
|
|
127
|
+
displayName: z.string().min(1).max(CREDENTIAL_STRATEGY_STRING_MAX),
|
|
128
|
+
scheme: CredentialProjectionSchemeSchema,
|
|
129
|
+
tokenField: FieldNameSchema.optional(),
|
|
130
|
+
usernameField: FieldNameSchema.optional(),
|
|
131
|
+
passwordField: FieldNameSchema.optional(),
|
|
132
|
+
headerName: z
|
|
133
|
+
.string()
|
|
134
|
+
.min(1)
|
|
135
|
+
.max(CREDENTIAL_STRATEGY_STRING_MAX)
|
|
136
|
+
.regex(/^[A-Za-z][A-Za-z0-9-]*$/, 'headerName must be a valid HTTP header name')
|
|
137
|
+
.optional(),
|
|
138
|
+
valuePrefix: z.string().max(CREDENTIAL_STRATEGY_STRING_MAX).optional(),
|
|
139
|
+
valueTemplate: z.string().min(1).max(VALUE_TEMPLATE_MAX).optional(),
|
|
140
|
+
staticParams: z
|
|
141
|
+
.record(
|
|
142
|
+
z.string().min(1).max(CREDENTIAL_STRATEGY_STRING_MAX),
|
|
143
|
+
z.string().max(CREDENTIAL_STRATEGY_STRING_MAX),
|
|
144
|
+
)
|
|
145
|
+
.refine(
|
|
146
|
+
(r) => Object.keys(r).length <= CREDENTIAL_STRATEGY_STATIC_PARAMS_MAX,
|
|
147
|
+
`at most ${CREDENTIAL_STRATEGY_STATIC_PARAMS_MAX} static params`,
|
|
148
|
+
)
|
|
149
|
+
.optional(),
|
|
150
|
+
})
|
|
151
|
+
.superRefine((m, ctx) => {
|
|
152
|
+
const requireField = (
|
|
153
|
+
present: unknown,
|
|
154
|
+
field: keyof CredentialStrategyContributionManifest,
|
|
155
|
+
why: string,
|
|
156
|
+
): void => {
|
|
157
|
+
if (present === undefined) {
|
|
158
|
+
ctx.addIssue({ code: 'custom', path: [field], message: why });
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const forbidField = (
|
|
162
|
+
present: unknown,
|
|
163
|
+
field: keyof CredentialStrategyContributionManifest,
|
|
164
|
+
): void => {
|
|
165
|
+
if (present !== undefined) {
|
|
166
|
+
ctx.addIssue({
|
|
167
|
+
code: 'custom',
|
|
168
|
+
path: [field],
|
|
169
|
+
message: `"${String(field)}" is not valid for scheme "${m.scheme}"`,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
switch (m.scheme) {
|
|
174
|
+
case CredentialProjectionScheme.Bearer:
|
|
175
|
+
requireField(m.tokenField, 'tokenField', 'bearer scheme requires tokenField');
|
|
176
|
+
forbidField(m.usernameField, 'usernameField');
|
|
177
|
+
forbidField(m.passwordField, 'passwordField');
|
|
178
|
+
forbidField(m.headerName, 'headerName');
|
|
179
|
+
forbidField(m.valuePrefix, 'valuePrefix');
|
|
180
|
+
forbidField(m.valueTemplate, 'valueTemplate');
|
|
181
|
+
break;
|
|
182
|
+
case CredentialProjectionScheme.Basic:
|
|
183
|
+
requireField(m.usernameField, 'usernameField', 'basic scheme requires usernameField');
|
|
184
|
+
requireField(m.passwordField, 'passwordField', 'basic scheme requires passwordField');
|
|
185
|
+
forbidField(m.tokenField, 'tokenField');
|
|
186
|
+
forbidField(m.headerName, 'headerName');
|
|
187
|
+
forbidField(m.valuePrefix, 'valuePrefix');
|
|
188
|
+
forbidField(m.valueTemplate, 'valueTemplate');
|
|
189
|
+
break;
|
|
190
|
+
case CredentialProjectionScheme.Header:
|
|
191
|
+
requireField(m.headerName, 'headerName', 'header scheme requires headerName');
|
|
192
|
+
requireField(m.valueTemplate, 'valueTemplate', 'header scheme requires valueTemplate');
|
|
193
|
+
forbidField(m.tokenField, 'tokenField');
|
|
194
|
+
forbidField(m.usernameField, 'usernameField');
|
|
195
|
+
forbidField(m.passwordField, 'passwordField');
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
}) as unknown as z.ZodType<CredentialStrategyContributionManifest>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Extract the ordered set of `{field}` placeholders a header `valueTemplate`
|
|
202
|
+
* references. Centralized so the manifest, the runtime builder, and any
|
|
203
|
+
* validator agree on the exact tokens that must resolve.
|
|
204
|
+
*/
|
|
205
|
+
export function templateFieldNames(valueTemplate: string): readonly string[] {
|
|
206
|
+
const out: string[] = [];
|
|
207
|
+
const re = /\{([A-Za-z][A-Za-z0-9_]*)\}/g;
|
|
208
|
+
let match: RegExpExecArray | null;
|
|
209
|
+
while ((match = re.exec(valueTemplate)) !== null) {
|
|
210
|
+
if (!out.includes(match[1]!)) {
|
|
211
|
+
out.push(match[1]!);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return out;
|
|
215
|
+
}
|
|
@@ -244,6 +244,26 @@ export enum ContributionKind {
|
|
|
244
244
|
* document INSTANCES are event-fed (runtime, via `IndexableDocument`).
|
|
245
245
|
*/
|
|
246
246
|
SearchType = 'search-type',
|
|
247
|
+
|
|
248
|
+
// -- Credential-strategy self-registration ---------------------------------
|
|
249
|
+
/**
|
|
250
|
+
* A DECLARATIVE credential-mint strategy contributed by a connector biome —
|
|
251
|
+
* the open credential-kind key it registers, the projection SCHEME
|
|
252
|
+
* (`bearer` / `basic` / `header`), and the field/template selectors that map
|
|
253
|
+
* a custody-resolved credential into an outbound token. The kernel owns this
|
|
254
|
+
* enum member AND the manifest schema
|
|
255
|
+
* (`CredentialStrategyContributionManifestSchema`, exported from
|
|
256
|
+
* `@xemahq/kernel-contracts/connector`), mirroring the `Capability` /
|
|
257
|
+
* `SearchType` kinds: a single value-identical wire shape both the
|
|
258
|
+
* contribution-file parser (`credential-strategy.parser.ts` in
|
|
259
|
+
* `biome-host-api`) and the owning service (`connector-gateway-api`) validate
|
|
260
|
+
* fail-fast. Provenance (`biome.id/version`) is stamped by the parser — never
|
|
261
|
+
* declared inline. This OPENS `CredentialKind` from a closed 12-value enum to
|
|
262
|
+
* a registry-backed key (curated always wins a collision), the same way
|
|
263
|
+
* `OrgIntegration.provider` was opened. NOVEL mint code (custom signing,
|
|
264
|
+
* token exchange) is the separate code-bearing tier — NOT expressible here.
|
|
265
|
+
*/
|
|
266
|
+
CredentialStrategy = 'credential-strategy',
|
|
247
267
|
}
|
|
248
268
|
|
|
249
269
|
/**
|