@memberjunction/ai-bridge-server 5.43.0 → 5.45.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.
@@ -10,29 +10,150 @@ export class IdentityProvisionerNotBoundError extends Error {
10
10
  this.name = 'IdentityProvisionerNotBoundError';
11
11
  }
12
12
  }
13
+ /** Reads a string field from a request `Configuration` blob, or `undefined`. */
14
+ function readConfigString(config, key) {
15
+ const value = config?.[key];
16
+ return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;
17
+ }
13
18
  /**
14
- * **Production-binding stub** {@link IAgentIdentityProvisioner}.
15
- *
16
- * Provisioning a real tenant mailbox/calendar (or a DID) is a delegated-admin operation against the
17
- * customer's directory — Microsoft Graph (`/users` + mailbox + calendar permissions), Google
18
- * Workspace Admin SDK, or a telephony carrier's number-ordering API — gated by admin consent and
19
- * minimal scopes, with the credential stored in MJ's credential system and referenced (never inline)
20
- * by the provider/identity `Configuration`.
19
+ * **Pure** mapping of a provisioning request to the Graph create-mailbox payload. Derives the
20
+ * `MailNickname` from the local part of the requested address. Throws when no `RequestedValue` is
21
+ * supplied — a Graph mailbox must be created at a known address (Graph does not allocate one).
22
+ */
23
+ export function buildGraphMailboxPayload(request) {
24
+ const address = request.RequestedValue?.trim();
25
+ if (!address) {
26
+ throw new Error('buildGraphMailboxPayload: AgentIdentityProvisionRequest.RequestedValue (the mailbox address) ' +
27
+ 'is required for Graph mailbox provisioning — Graph creates a user at a known UPN.');
28
+ }
29
+ const tenantId = readConfigString(request.Configuration, 'TenantId');
30
+ const usageLocation = readConfigString(request.Configuration, 'UsageLocation');
31
+ return {
32
+ UserPrincipalName: address,
33
+ MailNickname: address.split('@')[0],
34
+ DisplayName: request.DisplayName ?? address,
35
+ ...(tenantId ? { TenantId: tenantId } : {}),
36
+ ...(usageLocation ? { UsageLocation: usageLocation } : {}),
37
+ };
38
+ }
39
+ /**
40
+ * **Pure** mapping of a provisioning request to the Google Workspace create-mailbox payload. Throws
41
+ * when no `RequestedValue` is supplied — a Workspace user is created at a known primary email.
42
+ */
43
+ export function buildGoogleWorkspaceMailboxPayload(request) {
44
+ const address = request.RequestedValue?.trim();
45
+ if (!address) {
46
+ throw new Error('buildGoogleWorkspaceMailboxPayload: AgentIdentityProvisionRequest.RequestedValue (the primary ' +
47
+ 'email) is required for Google Workspace mailbox provisioning.');
48
+ }
49
+ const domain = readConfigString(request.Configuration, 'Domain') ?? address.split('@')[1];
50
+ const orgUnitPath = readConfigString(request.Configuration, 'OrgUnitPath');
51
+ return {
52
+ PrimaryEmail: address,
53
+ DisplayName: request.DisplayName ?? address,
54
+ ...(domain ? { Domain: domain } : {}),
55
+ ...(orgUnitPath ? { OrgUnitPath: orgUnitPath } : {}),
56
+ };
57
+ }
58
+ /**
59
+ * **Pure** mapping of a provisioning request to the carrier number-order payload. A DID is allocatable
60
+ * by the carrier, so `RequestedValue` is optional (when omitted, the carrier picks from its pool).
61
+ */
62
+ export function buildCarrierNumberOrderPayload(request) {
63
+ const requestedNumber = request.RequestedValue?.trim();
64
+ const region = readConfigString(request.Configuration, 'Region');
65
+ return {
66
+ ...(requestedNumber ? { RequestedNumber: requestedNumber } : {}),
67
+ ...(region ? { Region: region } : {}),
68
+ Label: request.DisplayName ?? request.AgentID,
69
+ };
70
+ }
71
+ /**
72
+ * **Provisioner over injected admin surfaces.** Implements {@link IAgentIdentityProvisioner} for the
73
+ * §1e identity types — Graph mailbox/`Email`, Google Workspace `Email`, and the telephony carrier
74
+ * `PhoneNumber` path — each over an injected admin surface so the package builds + unit-tests with no
75
+ * admin-SDK install and no network. Pure request→payload mapping lives in the `build*Payload` helpers;
76
+ * this class only routes by `IdentityType`, calls the surface, and shapes the
77
+ * {@link AgentIdentityProvisionResult} the existing {@link ApplyProvisionResultToIdentity} consumes.
21
78
  *
22
- * Because that handshake is a per-deployment, governed flow (see the architecture's open sub-question
23
- * on the provisioning handshake), this stub throws {@link IdentityProvisionerNotBoundError} until a
24
- * host binds the real admin API. The seam + the schema are what's in scope now.
79
+ * When the surface required for a request's `IdentityType` is **not** bound, it preserves the original
80
+ * seam behavior — throwing {@link IdentityProvisionerNotBoundError} so a misconfigured deployment fails
81
+ * loudly rather than silently never provisioning. Constructing it with no options reproduces the prior
82
+ * "throws for every type" stub exactly.
25
83
  *
26
- * @remarks **TODO (production):** implement against Microsoft Graph / Google Workspace Admin SDK /
27
- * the telephony carrier API per the request's `IdentityType` + provider; resolve the admin credential
28
- * from the provider `Configuration` via the credential system; return the created mailbox/number.
84
+ * @remarks **TODO (production):** bind `@microsoft/microsoft-graph-client` / `googleapis` / the carrier
85
+ * SDK (all optionalDependencies), resolve the admin credential from the provider `Configuration` via
86
+ * MJ's credential system, and inject them as the {@link AgentIdentityProvisionerOptions} surfaces.
29
87
  */
30
88
  export class StubAgentIdentityProvisioner {
89
+ /**
90
+ * @param options The injected admin surfaces. Omit any (or all) to preserve the not-bound seam
91
+ * behavior for that identity type.
92
+ */
93
+ constructor(options = {}) {
94
+ this.graph = options.Graph;
95
+ this.googleWorkspace = options.GoogleWorkspace;
96
+ this.carrier = options.Carrier;
97
+ this.emailDirectory = options.EmailDirectory ?? 'Graph';
98
+ }
31
99
  /** @inheritdoc */
32
100
  async Provision(request) {
33
- // TODO(production): bind the directory/carrier admin API for request.IdentityType + provider,
34
- // resolve the admin credential from provider Configuration, and allocate the identity.
35
- throw new IdentityProvisionerNotBoundError(this.targetLabel(request.IdentityType));
101
+ switch (request.IdentityType) {
102
+ case 'Email':
103
+ return this.provisionMailbox(request);
104
+ case 'PhoneNumber':
105
+ return this.provisionPhoneNumber(request);
106
+ case 'AccountID':
107
+ default:
108
+ // Platform account handles are not auto-provisioned (no admin API in scope); stays a seam.
109
+ throw new IdentityProvisionerNotBoundError(this.targetLabel(request.IdentityType));
110
+ }
111
+ }
112
+ /** Routes `Email` provisioning to whichever mailbox directory is configured/bound. */
113
+ async provisionMailbox(request) {
114
+ if (this.emailDirectory === 'GoogleWorkspace' || (!this.graph && this.googleWorkspace)) {
115
+ return this.provisionGoogleWorkspaceMailbox(request);
116
+ }
117
+ return this.provisionGraphMailbox(request);
118
+ }
119
+ /** Provisions a Graph mailbox over the injected Graph admin surface. */
120
+ async provisionGraphMailbox(request) {
121
+ if (!this.graph) {
122
+ throw new IdentityProvisionerNotBoundError(this.targetLabel('Email'));
123
+ }
124
+ const payload = buildGraphMailboxPayload(request);
125
+ const result = await this.graph.CreateMailbox(payload);
126
+ return {
127
+ IdentityValue: result.UserPrincipalName,
128
+ DisplayName: payload.DisplayName,
129
+ Configuration: { Directory: 'Graph', ObjectId: result.ObjectId },
130
+ };
131
+ }
132
+ /** Provisions a Google Workspace mailbox over the injected Workspace admin surface. */
133
+ async provisionGoogleWorkspaceMailbox(request) {
134
+ if (!this.googleWorkspace) {
135
+ throw new IdentityProvisionerNotBoundError(this.targetLabel('Email'));
136
+ }
137
+ const payload = buildGoogleWorkspaceMailboxPayload(request);
138
+ const result = await this.googleWorkspace.CreateMailbox(payload);
139
+ return {
140
+ IdentityValue: result.PrimaryEmail,
141
+ DisplayName: payload.DisplayName,
142
+ Configuration: { Directory: 'GoogleWorkspace', UserId: result.UserId },
143
+ };
144
+ }
145
+ /** Provisions a DID over the injected telephony-carrier surface. */
146
+ async provisionPhoneNumber(request) {
147
+ if (!this.carrier) {
148
+ throw new IdentityProvisionerNotBoundError(this.targetLabel('PhoneNumber'));
149
+ }
150
+ const payload = buildCarrierNumberOrderPayload(request);
151
+ const result = await this.carrier.OrderNumber(payload);
152
+ return {
153
+ IdentityValue: result.PhoneNumber,
154
+ ...(request.DisplayName ? { DisplayName: request.DisplayName } : {}),
155
+ Configuration: { Carrier: true, OrderId: result.OrderId },
156
+ };
36
157
  }
37
158
  /** Maps an identity type to the admin surface label used in the not-bound error. */
38
159
  targetLabel(identityType) {
@@ -1 +1 @@
1
- {"version":3,"file":"identity-provisioner.js","sourceRoot":"","sources":["../src/identity-provisioner.ts"],"names":[],"mappings":"AA8EA;;;GAGG;AAC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GAAG,IAAI,CAAC;IACzB,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACvB,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAClE,CAAC;AACL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './multi-agent-room-coordinator.js';
3
3
  export * from './loopback-bridge.js';
4
4
  export * from './join-url-resolver.js';
5
5
  export * from './calendar-source.js';
6
+ export * from './calendar-clients.js';
6
7
  export * from './calendar-watcher.js';
7
8
  export * from './scheduled-bridge-runner.js';
8
9
  export * from './identity-provisioner.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export * from './multi-agent-room-coordinator.js';
3
3
  export * from './loopback-bridge.js';
4
4
  export * from './join-url-resolver.js';
5
5
  export * from './calendar-source.js';
6
+ export * from './calendar-clients.js';
6
7
  export * from './calendar-watcher.js';
7
8
  export * from './scheduled-bridge-runner.js';
8
9
  export * from './identity-provisioner.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/ai-bridge-server",
3
3
  "type": "module",
4
- "version": "5.43.0",
4
+ "version": "5.45.0",
5
5
  "description": "MemberJunction: Server-tier coordination + execution for Realtime Bridges — completes the unified media-transport seam (the bridge ↔ IRealtimeSession pipe), bot-session lifecycle, host affinity + janitor, participant tracking, and turn-taking integration. Mirrors the AIEngineBase/AIEngine pair.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -17,13 +17,18 @@
17
17
  "author": "MemberJunction.com",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@memberjunction/core": "5.43.0",
21
- "@memberjunction/global": "5.43.0",
22
- "@memberjunction/core-entities": "5.43.0",
23
- "@memberjunction/ai": "5.43.0",
24
- "@memberjunction/ai-bridge-base": "5.43.0",
20
+ "@memberjunction/core": "5.45.0",
21
+ "@memberjunction/global": "5.45.0",
22
+ "@memberjunction/core-entities": "5.45.0",
23
+ "@memberjunction/ai": "5.45.0",
24
+ "@memberjunction/ai-bridge-base": "5.45.0",
25
25
  "rxjs": "^7.8.2"
26
26
  },
27
+ "//optionalDependencies": "@microsoft/microsoft-graph-client and googleapis are OPTIONAL PEER SDKs (CLAUDE rule 8, category 2): this package never statically imports either. They back the calendar + identity-provisioner seams only. GraphCalendarSource/GraphAdmin provisioning wire IGraphCalendarLike/IGraphAdminLike over @microsoft/microsoft-graph-client (calendarView delta + POST /users); GoogleCalendarSource/Google Workspace provisioning wire IGoogleCalendarLike/IGoogleWorkspaceAdminLike over googleapis (calendar.events.list syncToken + admin.users.insert). The telephony-carrier number-order path is injected via ITelephonyCarrierLike (the carrier SDK is declared by each telephony provider package, not here). All surfaces are injected behind structural interfaces so the package builds + unit-tests with no install and no network, and are loaded only when a Graph/Google-backed identity is configured at deployment.",
28
+ "optionalDependencies": {
29
+ "@microsoft/microsoft-graph-client": "^3.0.7",
30
+ "googleapis": "^144.0.0"
31
+ },
27
32
  "devDependencies": {
28
33
  "@types/node": "24.10.11",
29
34
  "ts-node-dev": "^2.0.0",