@opengeni/core 5.1.1 → 5.2.0-canary.37090756480001
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/default-session-model.d.ts +4 -3
- package/dist/dependencies.d.ts +2 -0
- package/dist/domain/connector-tool-permissions.d.ts +5 -1
- package/dist/domain/direct-model-provider.d.ts +3 -0
- package/dist/domain/insights.d.ts +11 -2
- package/dist/domain/knowledge-messages.d.ts +2 -2
- package/dist/domain/pr-review.d.ts +4 -4
- package/dist/domain/session-tool-policy.d.ts +7 -2
- package/dist/domain/sessions.d.ts +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +662 -486
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
- package/src/access/index.ts +10 -3
- package/src/default-session-model.ts +19 -4
- package/src/dependencies.ts +2 -0
- package/src/domain/connector-tool-permissions.ts +40 -10
- package/src/domain/direct-model-provider.ts +62 -0
- package/src/domain/insights.ts +91 -8
- package/src/domain/scheduled-tasks.ts +2 -3
- package/src/domain/session-tool-policy.ts +27 -1
- package/src/domain/sessions.ts +23 -18
- package/src/index.ts +1 -0
- package/src/model-catalog.ts +29 -16
package/src/model-catalog.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { modelAllowedByConnections, type ConnectionModelRestrictions } from "@opengeni/db";
|
|
2
2
|
import {
|
|
3
|
+
withDirectModelProviders,
|
|
3
4
|
applyModelCatalogDocument,
|
|
4
5
|
CLAUDE_CONNECTION_KINDS,
|
|
5
6
|
claudeProviderId,
|
|
@@ -36,6 +37,7 @@ import {
|
|
|
36
37
|
type WorkspaceModelPolicyContract,
|
|
37
38
|
} from "@opengeni/contracts";
|
|
38
39
|
import {
|
|
40
|
+
listConnectionsMetadata,
|
|
39
41
|
getDeploymentModelCatalog,
|
|
40
42
|
listWorkspaceProviderCustomModels,
|
|
41
43
|
getWorkspaceProviderCustomModelForExecution,
|
|
@@ -254,6 +256,7 @@ export async function resolveWorkspaceCatalogSettings(
|
|
|
254
256
|
organizationOpenRouterCustomModels,
|
|
255
257
|
retainedOrganizationGatewayCustomModels,
|
|
256
258
|
retainedOrganizationOpenRouterCustomModels,
|
|
259
|
+
directConnections,
|
|
257
260
|
] = await Promise.all([
|
|
258
261
|
resolveCatalogSettings(db, envSettings),
|
|
259
262
|
listWorkspaceGatewayCustomModels(db, {
|
|
@@ -324,6 +327,9 @@ export async function resolveWorkspaceCatalogSettings(
|
|
|
324
327
|
),
|
|
325
328
|
)
|
|
326
329
|
: Promise.resolve([]),
|
|
330
|
+
supportsOrganizationProviderReads
|
|
331
|
+
? listConnectionsMetadata(db, input.workspaceId, null)
|
|
332
|
+
: Promise.resolve([]),
|
|
327
333
|
]);
|
|
328
334
|
const includeRetainedModels = <T extends { upstreamModelId: string }>(
|
|
329
335
|
activeModels: readonly T[],
|
|
@@ -403,22 +409,25 @@ export async function resolveWorkspaceCatalogSettings(
|
|
|
403
409
|
}
|
|
404
410
|
return {
|
|
405
411
|
...resolved,
|
|
406
|
-
settings:
|
|
412
|
+
settings: withDirectModelProviders(
|
|
407
413
|
withClaudeConnectionCatalog(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
414
|
+
withClaudeConnectionCatalog(
|
|
415
|
+
withOrganizationOpenRouterCatalogProvider(
|
|
416
|
+
withOrganizationGatewayCatalogProvider(
|
|
417
|
+
withWorkspaceOpenRouterCatalogProvider(
|
|
418
|
+
withWorkspaceGatewayCatalogProvider(resolved.settings, gatewayCustomModels),
|
|
419
|
+
openRouterCustomModels,
|
|
420
|
+
),
|
|
421
|
+
organizationGatewayModels,
|
|
413
422
|
),
|
|
414
|
-
|
|
423
|
+
organizationOpenRouterModels,
|
|
415
424
|
),
|
|
416
|
-
|
|
425
|
+
claudeConnections,
|
|
417
426
|
),
|
|
418
|
-
|
|
427
|
+
workspaceClaudeConnections,
|
|
428
|
+
"workspace",
|
|
419
429
|
),
|
|
420
|
-
|
|
421
|
-
"workspace",
|
|
430
|
+
directConnections,
|
|
422
431
|
),
|
|
423
432
|
};
|
|
424
433
|
}
|
|
@@ -592,11 +601,15 @@ function credentialReadinessFor(input: {
|
|
|
592
601
|
const claudeKind = CLAUDE_CONNECTION_KINDS.find(
|
|
593
602
|
(kind) => claudeProviderId(kind, "workspace") === input.model.providerId,
|
|
594
603
|
);
|
|
595
|
-
const connectionActive =
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
?
|
|
599
|
-
:
|
|
604
|
+
const connectionActive =
|
|
605
|
+
input.provider?.kind === "direct-openai-workspace" ||
|
|
606
|
+
input.provider?.kind === "direct-azure-workspace"
|
|
607
|
+
? true
|
|
608
|
+
: claudeKind
|
|
609
|
+
? input.workspaceClaudeConnections?.[claudeKind]?.active === true
|
|
610
|
+
: input.model.providerId === WORKSPACE_OPENROUTER_PROVIDER_ID
|
|
611
|
+
? input.workspaceOpenRouterConnectionActive
|
|
612
|
+
: input.workspaceGatewayConnectionActive;
|
|
600
613
|
return connectionActive
|
|
601
614
|
? { status: "ready", reason: null, basis: "connection", checkedAt: null }
|
|
602
615
|
: {
|