@xemahq/kernel-contracts 0.35.0 → 0.37.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-workspace-sharing.d.ts +2 -1
- package/dist/agent-composition/lib/agent-workspace-sharing.d.ts.map +1 -1
- package/dist/agent-composition/lib/agent-workspace-sharing.js +1 -0
- package/dist/agent-composition/lib/agent-workspace-sharing.js.map +1 -1
- package/dist/agent-composition/lib/agent.d.ts +11 -0
- package/dist/agent-composition/lib/agent.d.ts.map +1 -1
- 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 +2 -0
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +2 -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/connector/lib/oauth-endpoints.d.ts +7 -0
- package/dist/connector/lib/oauth-endpoints.d.ts.map +1 -0
- package/dist/connector/lib/oauth-endpoints.js +12 -0
- package/dist/connector/lib/oauth-endpoints.js.map +1 -0
- 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-workspace-sharing.ts +13 -0
- package/src/agent-composition/lib/agent.ts +88 -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 +2 -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/connector/lib/oauth-endpoints.ts +50 -0
- package/src/contribution/lib/contribution-kind.ts +20 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare enum WorkspaceSharingPolicy {
|
|
2
2
|
Isolated = "isolated",
|
|
3
|
-
Shareable = "shareable"
|
|
3
|
+
Shareable = "shareable",
|
|
4
|
+
Shared = "shared"
|
|
4
5
|
}
|
|
5
6
|
export declare const WORKSPACE_SHARING_DEFAULT: WorkspaceSharingPolicy;
|
|
6
7
|
//# sourceMappingURL=agent-workspace-sharing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-workspace-sharing.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/agent-workspace-sharing.ts"],"names":[],"mappings":"AAoBA,oBAAY,sBAAsB;IAMhC,QAAQ,aAAa;IAOrB,SAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"agent-workspace-sharing.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/agent-workspace-sharing.ts"],"names":[],"mappings":"AAoBA,oBAAY,sBAAsB;IAMhC,QAAQ,aAAa;IAOrB,SAAS,cAAc;IAavB,MAAM,WAAW;CAClB;AAOD,eAAO,MAAM,yBAAyB,EAAE,sBACP,CAAC"}
|
|
@@ -5,6 +5,7 @@ var WorkspaceSharingPolicy;
|
|
|
5
5
|
(function (WorkspaceSharingPolicy) {
|
|
6
6
|
WorkspaceSharingPolicy["Isolated"] = "isolated";
|
|
7
7
|
WorkspaceSharingPolicy["Shareable"] = "shareable";
|
|
8
|
+
WorkspaceSharingPolicy["Shared"] = "shared";
|
|
8
9
|
})(WorkspaceSharingPolicy || (exports.WorkspaceSharingPolicy = WorkspaceSharingPolicy = {}));
|
|
9
10
|
exports.WORKSPACE_SHARING_DEFAULT = WorkspaceSharingPolicy.Isolated;
|
|
10
11
|
//# sourceMappingURL=agent-workspace-sharing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-workspace-sharing.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/agent-workspace-sharing.ts"],"names":[],"mappings":";;;AAoBA,IAAY,
|
|
1
|
+
{"version":3,"file":"agent-workspace-sharing.js","sourceRoot":"","sources":["../../../src/agent-composition/lib/agent-workspace-sharing.ts"],"names":[],"mappings":";;;AAoBA,IAAY,sBA2BX;AA3BD,WAAY,sBAAsB;IAMhC,+CAAqB,CAAA;IAOrB,iDAAuB,CAAA;IAavB,2CAAiB,CAAA;AACnB,CAAC,EA3BW,sBAAsB,sCAAtB,sBAAsB,QA2BjC;AAOY,QAAA,yBAAyB,GACpC,sBAAsB,CAAC,QAAQ,CAAC"}
|
|
@@ -36,6 +36,13 @@ 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
|
+
}
|
|
42
|
+
export type WorkspaceRef = string;
|
|
43
|
+
export interface DurableWorkspaceRef {
|
|
44
|
+
readonly workspaceRef: WorkspaceRef;
|
|
45
|
+
}
|
|
39
46
|
export interface Agent {
|
|
40
47
|
readonly slug: string;
|
|
41
48
|
readonly version: string;
|
|
@@ -48,6 +55,8 @@ export interface Agent {
|
|
|
48
55
|
readonly capability?: CapabilityLayer;
|
|
49
56
|
readonly workspace?: AgentWorkspaceConfig;
|
|
50
57
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
58
|
+
readonly standingSession?: StandingSessionRef;
|
|
59
|
+
readonly durableWorkspace?: DurableWorkspaceRef;
|
|
51
60
|
}
|
|
52
61
|
export interface ResolvedAgentNode extends NodeOverlayFragment, BiomeAvailabilityScoped {
|
|
53
62
|
readonly kernel: Required<AgentKernelRef>;
|
|
@@ -66,5 +75,7 @@ export interface ResolvedAgent {
|
|
|
66
75
|
readonly capability: CapabilityLayer;
|
|
67
76
|
readonly workspace?: AgentWorkspaceConfig;
|
|
68
77
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
78
|
+
readonly standingSession?: StandingSessionRef;
|
|
79
|
+
readonly durableWorkspace?: DurableWorkspaceRef;
|
|
69
80
|
}
|
|
70
81
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agent-composition/lib/agent.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAKxE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAOD,oBAAY,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,iBACf,SAAQ,mBAAmB,EACzB,uBAAuB;IAEzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;IAErC,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAM9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAQhD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAMD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAE3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAEjC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IAOrC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IAO1C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAMnD,QAAQ,CAAC,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAO9C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACjD"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,8 +3,10 @@ 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';
|
|
9
|
+
export * from './lib/oauth-endpoints';
|
|
8
10
|
export * from './lib/connector-descriptor';
|
|
9
11
|
export * from './lib/envelope-schema';
|
|
10
12
|
export * from './lib/filter-expr';
|
|
@@ -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,uBAAuB,CAAC;AACtC,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,8 +19,10 @@ __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);
|
|
25
|
+
__exportStar(require("./lib/oauth-endpoints"), exports);
|
|
24
26
|
__exportStar(require("./lib/connector-descriptor"), exports);
|
|
25
27
|
__exportStar(require("./lib/envelope-schema"), exports);
|
|
26
28
|
__exportStar(require("./lib/filter-expr"), 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,wDAAsC;AACtC,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;A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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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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,4CAA4C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ntegrationProviderContributionManifestSchema: 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>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface OAuthAuthorityEndpoints {
|
|
2
|
+
readonly authorizationUrl: string;
|
|
3
|
+
readonly tokenUrl: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const GOOGLE_OAUTH_ENDPOINTS: OAuthAuthorityEndpoints;
|
|
6
|
+
export declare const MICROSOFT_OAUTH_ENDPOINTS: OAuthAuthorityEndpoints;
|
|
7
|
+
//# sourceMappingURL=oauth-endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-endpoints.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/oauth-endpoints.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,uBAAuB;IAEtC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAMD,eAAO,MAAM,sBAAsB,EAAE,uBAG3B,CAAC;AAOX,eAAO,MAAM,yBAAyB,EAAE,uBAI9B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MICROSOFT_OAUTH_ENDPOINTS = exports.GOOGLE_OAUTH_ENDPOINTS = void 0;
|
|
4
|
+
exports.GOOGLE_OAUTH_ENDPOINTS = {
|
|
5
|
+
authorizationUrl: 'https://accounts.google.com/o/oauth2/v2/auth',
|
|
6
|
+
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
7
|
+
};
|
|
8
|
+
exports.MICROSOFT_OAUTH_ENDPOINTS = {
|
|
9
|
+
authorizationUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
|
|
10
|
+
tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=oauth-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-endpoints.js","sourceRoot":"","sources":["../../../src/connector/lib/oauth-endpoints.ts"],"names":[],"mappings":";;;AAmCa,QAAA,sBAAsB,GAA4B;IAC7D,gBAAgB,EAAE,8CAA8C;IAChE,QAAQ,EAAE,qCAAqC;CACvC,CAAC;AAOE,QAAA,yBAAyB,GAA4B;IAChE,gBAAgB,EACd,gEAAgE;IAClE,QAAQ,EAAE,4DAA4D;CAC9D,CAAC"}
|
|
@@ -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;IA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AElC,eAAe,qBAAqB;IAEpC,iBAAiB,uBAAuB;IAMxC,yBAAyB,gCAAgC;IAEzD,WAAW,iBAAiB;IAI5B,UAAU,gBAAgB;IAO1B,YAAY,kBAAkB;IAM9B,cAAc,oBAAoB;IAgBlC,UAAU,eAAe;IAezB,iBAAiB,uBAAuB;IAcxC,YAAY,kBAAkB;IAkB9B,UAAU,gBAAgB;IAoB1B,kBAAkB,wBAAwB;CAC3C;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.37.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)",
|
|
@@ -32,6 +32,19 @@ export enum WorkspaceSharingPolicy {
|
|
|
32
32
|
* / chat-style agents.
|
|
33
33
|
*/
|
|
34
34
|
Shareable = 'shareable',
|
|
35
|
+
/**
|
|
36
|
+
* N INDEPENDENT sessions/pods operate on ONE durable, named workspace whose
|
|
37
|
+
* files are the source of truth (a session is a disposable cache; a lost
|
|
38
|
+
* session re-reads the files). Unlike {@link Shareable} — which pools
|
|
39
|
+
* multiple threads onto ONE pod's `/workspace` — `shared` binds SEPARATE
|
|
40
|
+
* pods to the same durable storage identified by a
|
|
41
|
+
* {@link DurableWorkspaceRef}, coordinated by an advisory single-writer
|
|
42
|
+
* cross-session write-lease (readers free; one in-flight mutating turn at a
|
|
43
|
+
* time across the sharing sessions). This is the multi-pod tier; it engages
|
|
44
|
+
* only for an agent that also binds a `durableWorkspace`. OPTIONAL +
|
|
45
|
+
* additive: absent ⇒ today's behaviour.
|
|
46
|
+
*/
|
|
47
|
+
Shared = 'shared',
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
/**
|
|
@@ -130,6 +130,65 @@ 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
|
+
|
|
156
|
+
/**
|
|
157
|
+
* A stable, opaque identifier for a DURABLE, NAMED workspace whose files are
|
|
158
|
+
* the source of truth and which MANY independent sessions/pods may attach to
|
|
159
|
+
* (the multi-pod {@link WorkspaceSharingPolicy.Shared} tier). Unlike the
|
|
160
|
+
* default sessionId-derived, per-session workspace path, a durable workspace
|
|
161
|
+
* lives at a `workspaceRef`-keyed storage sub-path shared across every session
|
|
162
|
+
* that binds the same ref, and cross-session writes are serialized by an
|
|
163
|
+
* advisory single-writer write-lease keyed on the ref.
|
|
164
|
+
*
|
|
165
|
+
* OPTIONAL + additive: when an agent declares none, each session gets its own
|
|
166
|
+
* private, sessionId-derived workspace exactly as today.
|
|
167
|
+
*/
|
|
168
|
+
export type WorkspaceRef = string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Declares that an agent/composition binds to a DURABLE, NAMED workspace shared
|
|
172
|
+
* across N independent sessions (separate pods), instead of a private
|
|
173
|
+
* per-session workspace. When present, the session layer stores the
|
|
174
|
+
* {@link workspaceRef} on the session and the storage layer resolves a
|
|
175
|
+
* `workspaceRef`-keyed shared sub-path (not the sessionId-derived one); a
|
|
176
|
+
* cross-session write-lease keyed on the ref serializes mutating turns across
|
|
177
|
+
* the sharing sessions (readers free).
|
|
178
|
+
*
|
|
179
|
+
* OPTIONAL + additive: absent ⇒ today's private per-session workspace. Pairs
|
|
180
|
+
* with {@link WorkspaceSharingPolicy.Shared}.
|
|
181
|
+
*/
|
|
182
|
+
export interface DurableWorkspaceRef {
|
|
183
|
+
/**
|
|
184
|
+
* Stable, opaque durable-workspace identity. Two sessions that carry the same
|
|
185
|
+
* `workspaceRef` (within the same `(orgId, projectId)`) attach to the SAME
|
|
186
|
+
* durable storage sub-path and coordinate through ONE cross-session
|
|
187
|
+
* write-lease.
|
|
188
|
+
*/
|
|
189
|
+
readonly workspaceRef: WorkspaceRef;
|
|
190
|
+
}
|
|
191
|
+
|
|
133
192
|
/**
|
|
134
193
|
* A named, versioned, reusable Agent.
|
|
135
194
|
*/
|
|
@@ -173,6 +232,22 @@ export interface Agent {
|
|
|
173
232
|
* chat-style agents; see {@link WorkspaceSharingPolicy}.
|
|
174
233
|
*/
|
|
175
234
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
235
|
+
/**
|
|
236
|
+
* When set, this agent ALWAYS runs inside its standing (pinned) session
|
|
237
|
+
* keyed by `pinKey` — the session layer adopts a non-terminal existing
|
|
238
|
+
* session for `(orgId, projectId, pinKey)` instead of minting a new one.
|
|
239
|
+
* OPTIONAL + additive: absent ⇒ a fresh session per launch. See
|
|
240
|
+
* {@link StandingSessionRef}.
|
|
241
|
+
*/
|
|
242
|
+
readonly standingSession?: StandingSessionRef;
|
|
243
|
+
/**
|
|
244
|
+
* When set, sessions running this agent attach to a DURABLE, NAMED workspace
|
|
245
|
+
* shared across independent pods (the multi-pod
|
|
246
|
+
* {@link WorkspaceSharingPolicy.Shared} tier) instead of a private
|
|
247
|
+
* per-session workspace. OPTIONAL + additive: absent ⇒ today's private
|
|
248
|
+
* per-session workspace. See {@link DurableWorkspaceRef}.
|
|
249
|
+
*/
|
|
250
|
+
readonly durableWorkspace?: DurableWorkspaceRef;
|
|
176
251
|
}
|
|
177
252
|
|
|
178
253
|
/**
|
|
@@ -237,4 +312,17 @@ export interface ResolvedAgent {
|
|
|
237
312
|
* (`isolated`), applied explicitly at the read site.
|
|
238
313
|
*/
|
|
239
314
|
readonly workspaceSharing?: WorkspaceSharingPolicy;
|
|
315
|
+
/**
|
|
316
|
+
* Resolved standing-session pin — carried from the source `Agent` so the
|
|
317
|
+
* session layer can do its `(orgId, projectId, pinKey)` get-or-create
|
|
318
|
+
* without re-fetching the definition. Absent ⇒ a fresh session per launch.
|
|
319
|
+
*/
|
|
320
|
+
readonly standingSession?: StandingSessionRef;
|
|
321
|
+
/**
|
|
322
|
+
* Resolved durable-workspace binding — carried from the source `Agent` so the
|
|
323
|
+
* session layer can store the `workspaceRef` and the storage layer can
|
|
324
|
+
* resolve the shared, `workspaceRef`-keyed sub-path. Absent ⇒ today's private
|
|
325
|
+
* per-session workspace. See {@link DurableWorkspaceRef}.
|
|
326
|
+
*/
|
|
327
|
+
readonly durableWorkspace?: DurableWorkspaceRef;
|
|
240
328
|
}
|
|
@@ -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,8 +3,10 @@ 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';
|
|
9
|
+
export * from './lib/oauth-endpoints';
|
|
8
10
|
export * from './lib/connector-descriptor';
|
|
9
11
|
export * from './lib/envelope-schema';
|
|
10
12
|
export * from './lib/filter-expr';
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
3
|
+
* Stable OAuth authority endpoints — single source of truth
|
|
4
|
+
*
|
|
5
|
+
* The authorization-code + token-exchange endpoints for the well-known OAuth
|
|
6
|
+
* authorities (Google, Microsoft Entra "common" tenant) are STABLE — they do
|
|
7
|
+
* not change per consumer and are not secrets. Before this module they were
|
|
8
|
+
* hardcoded independently in every OAuth consumer (gmail-connector,
|
|
9
|
+
* ms365-connector, mailops), inviting drift. They are now declared ONCE here.
|
|
10
|
+
*
|
|
11
|
+
* SCOPE — authority endpoints ONLY. `scopes`, `extraAuthorizeParams`
|
|
12
|
+
* (e.g. Google's `access_type=offline` / `prompt=consent`, Microsoft's
|
|
13
|
+
* `prompt`), redirect URIs, client credentials, and connector slugs
|
|
14
|
+
* legitimately DIFFER per consumer and MUST stay local to each consumer. Do
|
|
15
|
+
* NOT add any of those here — this file carries the two URLs and nothing else.
|
|
16
|
+
*
|
|
17
|
+
* The shape is value-compatible with the required fields of
|
|
18
|
+
* {@link ProviderOAuthEndpoints} (`authorizationUrl` + `tokenUrl`), so a
|
|
19
|
+
* consumer can spread these into a full `ProviderOAuthEndpoints` and add its
|
|
20
|
+
* own scopes/params.
|
|
21
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** The stable authority endpoints of one OAuth provider — no scopes, no params. */
|
|
25
|
+
export interface OAuthAuthorityEndpoints {
|
|
26
|
+
/** Authorization-code consent endpoint (where the user is redirected). */
|
|
27
|
+
readonly authorizationUrl: string;
|
|
28
|
+
/** Token-exchange endpoint (code→token, refresh-token rotation). */
|
|
29
|
+
readonly tokenUrl: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Google OAuth 2.0 authority endpoints (v2 auth + token). Stable across all
|
|
34
|
+
* Google APIs; consumers supply their own scopes and authorize params.
|
|
35
|
+
*/
|
|
36
|
+
export const GOOGLE_OAUTH_ENDPOINTS: OAuthAuthorityEndpoints = {
|
|
37
|
+
authorizationUrl: 'https://accounts.google.com/o/oauth2/v2/auth',
|
|
38
|
+
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Microsoft Entra ID (Azure AD) OAuth 2.0 authority endpoints on the multi-
|
|
43
|
+
* tenant `common` authority. Consumers that must pin a single tenant build
|
|
44
|
+
* their own URLs; this constant is the shared multi-tenant default.
|
|
45
|
+
*/
|
|
46
|
+
export const MICROSOFT_OAUTH_ENDPOINTS: OAuthAuthorityEndpoints = {
|
|
47
|
+
authorizationUrl:
|
|
48
|
+
'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
|
|
49
|
+
tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
|
|
50
|
+
} as const;
|
|
@@ -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
|
/**
|