@opengeni/api-router 3.0.1 → 4.0.0-canary.35585322809001
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/admission-trace.d.ts +8 -0
- package/dist/app.js +1 -1
- package/dist/auth/managed-auth-attempt-context.d.ts +2 -0
- package/dist/auth/managed-auth-session-adapter.d.ts +2 -0
- package/dist/auth/managed-auth.d.ts +1 -0
- package/dist/auth/managed-sign-in-notifications.d.ts +4 -0
- package/dist/{chunk-AJ62T5QN.js → chunk-E7TZFJ65.js} +22300 -21113
- package/dist/{chunk-AJ62T5QN.js.map → chunk-E7TZFJ65.js.map} +1 -1
- package/dist/connection-ownership.d.ts +1 -2
- package/dist/fatal-process-boundary.d.ts +1 -1
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/dist/integrations/atlassian.d.ts +8 -3
- package/dist/integrations/fiken.d.ts +3 -1
- package/dist/integrations/github-lens-connect.d.ts +5 -65
- package/dist/integrations/google-drive.d.ts +2 -0
- package/dist/integrations/integration-commit-authority.d.ts +13 -0
- package/dist/integrations/oauth-client.d.ts +119 -11
- package/dist/integrations/oauth-profiles.d.ts +8 -13
- package/dist/integrations/slack-interactions.d.ts +1 -1
- package/dist/mcp/capability-account-readiness.d.ts +7 -0
- package/dist/mcp/first-party-tool-permissions.d.ts +4 -0
- package/dist/mcp-oauth.d.ts +22 -1
- package/dist/routes/api-integrations.d.ts +1 -0
- package/dist/routes/codex.d.ts +28 -0
- package/dist/routes/managed-sign-in-methods.d.ts +6 -0
- package/dist/routes/organization-integration-policy.d.ts +3 -0
- package/dist/routes/sessions.d.ts +24 -2
- package/dist/scheduled-task-deletion.d.ts +3 -4
- package/dist/workspace-tool-gateway.d.ts +3 -1
- package/package.json +19 -19
- package/src/admission-trace.ts +14 -0
- package/src/app.ts +141 -94
- package/src/auth/managed-auth-attempt-context.ts +9 -0
- package/src/auth/managed-auth-session-adapter.ts +11 -0
- package/src/auth/managed-auth.ts +39 -2
- package/src/auth/managed-sign-in-notifications.ts +81 -0
- package/src/connection-ownership.ts +2 -9
- package/src/editable-artifact-production.ts +6 -0
- package/src/fatal-process-boundary.ts +17 -2
- package/src/index.ts +3 -4
- package/src/integrations/atlassian.ts +184 -76
- package/src/integrations/fiken.ts +57 -35
- package/src/integrations/github-app-connect.ts +51 -15
- package/src/integrations/github-lens-connect.ts +7 -28
- package/src/integrations/google-drive.ts +296 -125
- package/src/integrations/integration-commit-authority.ts +69 -0
- package/src/integrations/oauth-client.ts +231 -132
- package/src/integrations/oauth-profiles.ts +10 -45
- package/src/integrations/personal-github.ts +55 -31
- package/src/integrations/provider-oauth.ts +57 -82
- package/src/integrations/social-oauth.ts +83 -56
- package/src/mcp/capability-account-readiness.ts +17 -0
- package/src/mcp/editable-artifacts.ts +7 -2
- package/src/mcp/first-party-tool-permissions.ts +1 -0
- package/src/mcp/knowledge-entries.ts +25 -8
- package/src/mcp/server.ts +135 -43
- package/src/mcp-oauth.ts +336 -34
- package/src/routes/api-integrations.ts +116 -4
- package/src/routes/automations.ts +5 -13
- package/src/routes/billing.ts +52 -0
- package/src/routes/canonical-human-identities.ts +61 -0
- package/src/routes/capabilities.ts +51 -1
- package/src/routes/codex.ts +4 -2
- package/src/routes/connect.ts +90 -31
- package/src/routes/connections.ts +487 -307
- package/src/routes/files.ts +21 -12
- package/src/routes/github.ts +48 -19
- package/src/routes/insights.ts +17 -7
- package/src/routes/integration-facets.ts +66 -25
- package/src/routes/knowledge.ts +48 -1
- package/src/routes/managed-sign-in-methods.ts +433 -0
- package/src/routes/organization-integration-policy.ts +113 -0
- package/src/routes/organization-memberships.ts +22 -2
- package/src/routes/plugins.ts +42 -4
- package/src/routes/pr-review-github.ts +67 -57
- package/src/routes/pr-review.ts +74 -71
- package/src/routes/rigs.ts +32 -13
- package/src/routes/scheduled-tasks.ts +6 -6
- package/src/routes/sessions.ts +233 -11
- package/src/routes/skill-content.ts +19 -3
- package/src/routes/social.ts +24 -13
- package/src/sandbox/channel-a.ts +7 -1
- package/src/sandbox/rematerialize.ts +2 -1
- package/src/scheduled-task-deletion.ts +13 -3
- package/src/workspace-tool-gateway.ts +31 -31
- package/dist/connection-authority-owner.d.ts +0 -59
- package/dist/routes/connection-authorities.d.ts +0 -3
- package/dist/routes/host-mcp-bindings.d.ts +0 -5
- package/dist/routes/host-mcp-resolvers.d.ts +0 -3
- package/dist/routes/packs.d.ts +0 -3
- package/src/connection-authority-owner.ts +0 -61
- package/src/routes/connection-authorities.ts +0 -139
- package/src/routes/host-mcp-bindings.ts +0 -122
- package/src/routes/host-mcp-resolvers.ts +0 -41
- package/src/routes/packs.ts +0 -784
|
@@ -20,8 +20,7 @@ export declare function personalOnlyConnectionPrincipalMessage(label: string): s
|
|
|
20
20
|
* rejects every reserved machine-subject namespace as defence-in-depth. The
|
|
21
21
|
* sibling guards a self-service authority surface where the caller claims to
|
|
22
22
|
* *be* the owner (403 "not you"), while this one rejects an ownership *value*
|
|
23
|
-
* that is unavailable to the caller
|
|
24
|
-
* existing 422 convention.
|
|
23
|
+
* that is unavailable to the caller (422).
|
|
25
24
|
*/
|
|
26
25
|
export declare function assertPersonalConnectionOwnerPrincipal(access: AccessGrantAuthorization, label?: string): void;
|
|
27
26
|
/** The same fence expressed for a flow that resolves ownership after admission. */
|
|
@@ -2,7 +2,7 @@ import type { Observability } from "@opengeni/observability";
|
|
|
2
2
|
export type ApiFatalEvent = "startup_failure" | "unhandled_rejection" | "uncaught_exception";
|
|
3
3
|
export type ApiFatalPhase = "startup" | "running";
|
|
4
4
|
export type ApiFatalReasonKind = "bigint" | "boolean" | "error" | "function" | "null" | "number" | "object" | "string" | "symbol" | "undefined";
|
|
5
|
-
type ApiFatalObservability = Pick<Observability, "error" | "flush" | "startSpan"
|
|
5
|
+
type ApiFatalObservability = Pick<Observability, "error" | "flush" | "startSpan"> & Partial<Pick<Observability, "recordFailureDiagnostic">>;
|
|
6
6
|
type ApiFatalProcess = {
|
|
7
7
|
on: (event: "unhandledRejection" | "uncaughtException", listener: (reason: unknown) => void) => void;
|
|
8
8
|
off: (event: "unhandledRejection" | "uncaughtException", listener: (reason: unknown) => void) => void;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createOpenGeniSlackBotInteractionClient,
|
|
8
8
|
startSlackInteractionPump,
|
|
9
9
|
startTemporalScheduleCleanupPump
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-E7TZFJ65.js";
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
import { scheduledTaskKnowledgeSource } from "@opengeni/contracts";
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "@opengeni/config";
|
|
24
24
|
import {
|
|
25
25
|
assertRuntimeDatabasePosture,
|
|
26
|
+
isRetryableRuntimeDatabaseStartupError,
|
|
26
27
|
createDb,
|
|
27
28
|
markSessionWorkflowWakeDelivered,
|
|
28
29
|
runtimeDatabaseReadyCheck
|
|
@@ -33,7 +34,6 @@ import {
|
|
|
33
34
|
logStartupDependencyRetry
|
|
34
35
|
} from "@opengeni/observability";
|
|
35
36
|
import { createObjectStorage } from "@opengeni/storage";
|
|
36
|
-
import { createNativeRemoteMcpCredentialsPort } from "@opengeni/core/remote-mcp-credentials";
|
|
37
37
|
import { isArtifactRuntimeConfigured } from "@opengeni/artifact-tool/runtime/development";
|
|
38
38
|
import {
|
|
39
39
|
resolveCatalogSettings,
|
|
@@ -1286,6 +1286,7 @@ import {
|
|
|
1286
1286
|
PostgresEditableArtifactStore,
|
|
1287
1287
|
listEditableArtifactIdsForSession,
|
|
1288
1288
|
touchEditableArtifactSessionLink,
|
|
1289
|
+
recordNativeDocumentInspection,
|
|
1289
1290
|
dbSql,
|
|
1290
1291
|
withRlsContext
|
|
1291
1292
|
} from "@opengeni/db";
|
|
@@ -2297,6 +2298,11 @@ async function createStandaloneEditableArtifactApplication(input) {
|
|
|
2297
2298
|
touch: async ({ scope, sessionId, artifactId }) => await touchEditableArtifactSessionLink(input.db, scope, sessionId, artifactId)
|
|
2298
2299
|
}),
|
|
2299
2300
|
inspector: kernel,
|
|
2301
|
+
recordInspection: async (inspection) => {
|
|
2302
|
+
if (inspection.actor.kind !== "agent")
|
|
2303
|
+
throw new Error("Inspection proof requires an agent attempt");
|
|
2304
|
+
return recordNativeDocumentInspection(input.db, { ...inspection, actor: inspection.actor });
|
|
2305
|
+
},
|
|
2300
2306
|
officeImports,
|
|
2301
2307
|
workspaceFiles: new EditableArtifactWorkspaceFileAdapter({
|
|
2302
2308
|
db: input.db,
|
|
@@ -2529,10 +2535,23 @@ function installApiFatalProcessBoundary(options = {}) {
|
|
|
2529
2535
|
if (reporting) return;
|
|
2530
2536
|
reporting = true;
|
|
2531
2537
|
const diagnostic = apiFatalDiagnostic(event, phase, reason, correlationId);
|
|
2532
|
-
|
|
2538
|
+
let message = apiFatalMessage(diagnostic);
|
|
2533
2539
|
const activeObservability = observability;
|
|
2534
2540
|
try {
|
|
2535
2541
|
if (activeObservability) {
|
|
2542
|
+
try {
|
|
2543
|
+
const diagnosticId = activeObservability.recordFailureDiagnostic?.({
|
|
2544
|
+
code: FATAL_ERROR_CODES[event],
|
|
2545
|
+
stage: phase,
|
|
2546
|
+
retryDecision: "not_retryable",
|
|
2547
|
+
error: reason
|
|
2548
|
+
});
|
|
2549
|
+
if (diagnosticId) {
|
|
2550
|
+
diagnostic.correlationId = diagnosticId;
|
|
2551
|
+
message = apiFatalMessage(diagnostic);
|
|
2552
|
+
}
|
|
2553
|
+
} catch {
|
|
2554
|
+
}
|
|
2536
2555
|
let logged = false;
|
|
2537
2556
|
try {
|
|
2538
2557
|
activeObservability.error(message, diagnostic);
|
|
@@ -2839,7 +2858,7 @@ async function createTemporalWorkflowClient(settings, db) {
|
|
|
2839
2858
|
startRigVerification: async ({ workspaceId, changeId, versionId, workflowId }) => {
|
|
2840
2859
|
const targetId = changeId ?? versionId;
|
|
2841
2860
|
if (!targetId) {
|
|
2842
|
-
throw new Error("
|
|
2861
|
+
throw new Error("sandbox environment verification requires changeId or versionId");
|
|
2843
2862
|
}
|
|
2844
2863
|
try {
|
|
2845
2864
|
await temporal.workflow.start("rigVerificationWorkflow", {
|
|
@@ -2912,7 +2931,7 @@ async function startApi(options = {}) {
|
|
|
2912
2931
|
await retryStartupDependency(
|
|
2913
2932
|
"PostgreSQL runtime posture",
|
|
2914
2933
|
() => assertRuntimeDatabasePosture(dbClient.db, databasePosture),
|
|
2915
|
-
{ ...retryOptions, onRetry }
|
|
2934
|
+
{ ...retryOptions, onRetry, shouldRetry: isRetryableRuntimeDatabaseStartupError }
|
|
2916
2935
|
);
|
|
2917
2936
|
const resolvedCatalog = await retryStartupDependency(
|
|
2918
2937
|
"model catalog",
|
|
@@ -2967,7 +2986,6 @@ async function startApi(options = {}) {
|
|
|
2967
2986
|
}
|
|
2968
2987
|
const { app, routeDeps } = createAppComposition({
|
|
2969
2988
|
settings,
|
|
2970
|
-
connectionCredentials: createNativeRemoteMcpCredentialsPort(settings, dbClient.db),
|
|
2971
2989
|
db: dbClient.db,
|
|
2972
2990
|
bus,
|
|
2973
2991
|
workflowClient: workflowClient.client,
|