@opengeni/db 5.0.1 → 6.0.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/automations.d.ts +0 -2
- package/dist/canonical-human-identities.d.ts +4 -0
- package/dist/canonical-human-identities.js +3 -3
- package/dist/capability-components.d.ts +5 -13
- package/dist/capability-integrations.d.ts +23 -8
- package/dist/capability-reconciliation.d.ts +5 -0
- package/dist/capability-reconciliation.js +21 -0
- package/dist/capability-reconciliation.js.map +1 -0
- package/dist/{chunk-6T2GGYWE.js → chunk-4UJCXBR2.js} +4 -5800
- package/dist/chunk-4UJCXBR2.js.map +1 -0
- package/dist/{chunk-MWMXWHJD.js → chunk-7JCDSMX2.js} +2 -2
- package/dist/chunk-AJA2ZIUW.js +219 -0
- package/dist/chunk-AJA2ZIUW.js.map +1 -0
- package/dist/chunk-CDAT6EKW.js +247 -0
- package/dist/chunk-CDAT6EKW.js.map +1 -0
- package/dist/{chunk-DPONPYJD.js → chunk-CJI6G254.js} +70 -18
- package/dist/chunk-CJI6G254.js.map +1 -0
- package/dist/chunk-G32NVMRJ.js +276 -0
- package/dist/chunk-G32NVMRJ.js.map +1 -0
- package/dist/chunk-GABXCG3N.js +5811 -0
- package/dist/chunk-GABXCG3N.js.map +1 -0
- package/dist/{chunk-ERKVSPDX.js → chunk-LVY33EWL.js} +3 -3
- package/dist/{chunk-45CP2YKY.js → chunk-MAMBI2HR.js} +9 -3
- package/dist/{chunk-45CP2YKY.js.map → chunk-MAMBI2HR.js.map} +1 -1
- package/dist/{chunk-F73UKJY6.js → chunk-MN5PZMEK.js} +91 -108
- package/dist/chunk-MN5PZMEK.js.map +1 -0
- package/dist/chunk-PJI4MUZ7.js +131 -0
- package/dist/chunk-PJI4MUZ7.js.map +1 -0
- package/dist/{chunk-T6BWIGWJ.js → chunk-RIYHP2WU.js} +2 -2
- package/dist/{chunk-7HMK3B45.js → chunk-RL2MUXM3.js} +16 -7
- package/dist/chunk-RL2MUXM3.js.map +1 -0
- package/dist/{chunk-HQDVI2DB.js → chunk-SYKHLPTK.js} +4 -3
- package/dist/{chunk-HQDVI2DB.js.map → chunk-SYKHLPTK.js.map} +1 -1
- package/dist/{chunk-T6YLHJLS.js → chunk-XIXVVBW2.js} +198 -51
- package/dist/chunk-XIXVVBW2.js.map +1 -0
- package/dist/chunk-ZPJ6V2VG.js +156 -0
- package/dist/chunk-ZPJ6V2VG.js.map +1 -0
- package/dist/codex-capacity-recovery.d.ts +12 -0
- package/dist/codex-failure-eligibility.d.ts +9 -0
- package/dist/company-profile-schema.d.ts +4 -2
- package/dist/connect-attempts.d.ts +15 -0
- package/dist/connect-attempts.js +25 -0
- package/dist/connect-attempts.js.map +1 -0
- package/dist/connection-authority.d.ts +7 -63
- package/dist/connection-refresh-lock.d.ts +4 -0
- package/dist/connection-token-resolver.d.ts +8 -43
- package/dist/database-timing.d.ts +10 -0
- package/dist/database.d.ts +4 -0
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.d.ts +9 -0
- package/dist/editable-artifacts.js +7 -5
- package/dist/index.d.ts +447 -78
- package/dist/index.js +12705 -12872
- package/dist/index.js.map +1 -1
- package/dist/insights-usage-bundle.d.ts +3 -0
- package/dist/integration-bindings.d.ts +1 -1
- package/dist/integration-facets.d.ts +18 -1
- package/dist/knowledge-entries-schema.d.ts +2 -0
- package/dist/knowledge-entries.d.ts +1 -0
- package/dist/knowledge-indexing.d.ts +1 -0
- package/dist/live-session-attempt.d.ts +35 -137
- package/dist/managed-auth-session-sets.js +3 -3
- package/dist/mcp-account-bindings.d.ts +4 -0
- package/dist/mcp-oauth.d.ts +11 -0
- package/dist/mcp-operations.js +2 -2
- package/dist/migrate.js +1 -1
- package/dist/organization-integration-policy.d.ts +51 -0
- package/dist/organization-integration-policy.js +18 -0
- package/dist/organization-integration-policy.js.map +1 -0
- package/dist/organization-usage.d.ts +20 -0
- package/dist/plugin-packages.d.ts +9 -12
- package/dist/pr-review.d.ts +0 -11
- package/dist/preference-registry-schema.d.ts +17 -0
- package/dist/provision-roles.js +1 -1
- package/dist/retained-provider-commands.d.ts +124 -6
- package/dist/retained-provider-commands.js +29 -97
- package/dist/retained-provider-commands.js.map +1 -1
- package/dist/retired-session-create-metadata.d.ts +4 -0
- package/dist/runtime-posture.d.ts +7 -5
- package/dist/schema.d.ts +876 -656
- package/dist/schema.js +5 -7
- package/dist/session-admission-block.d.ts +32 -0
- package/dist/session-attempt-writers.d.ts +4 -0
- package/dist/session-background-commands.js +5 -4
- package/dist/session-command-output.js +8 -126
- package/dist/session-command-output.js.map +1 -1
- package/dist/session-control.d.ts +5 -1
- package/dist/session-event-slices.d.ts +10 -0
- package/dist/session-event-slices.js +8 -222
- package/dist/session-event-slices.js.map +1 -1
- package/dist/session-file-attachments.d.ts +28 -0
- package/dist/session-goal-reports.d.ts +43 -0
- package/dist/session-mcp-approval.d.ts +4 -0
- package/dist/session-mcp-credential-rotation.js +5 -4
- package/dist/session-mcp-credential-rotation.js.map +1 -1
- package/dist/session-message-search.d.ts +22 -0
- package/dist/session-queue-commands.d.ts +2 -6
- package/dist/session-retry.d.ts +36 -0
- package/dist/session-tenancy.js +3 -3
- package/dist/skill-source-release-impact.d.ts +18 -0
- package/dist/skill-source-release.d.ts +9 -0
- package/dist/skills.d.ts +7 -1
- package/dist/user-resource-authority.d.ts +0 -8
- package/dist/video-generation.js +3 -3
- package/dist/workspace-tool-defaults.js +5 -4
- package/dist/workspace-tool-defaults.js.map +1 -1
- package/drizzle/0468_knowledge_relationship_projection.sql +30 -0
- package/drizzle/0469_knowledge_source_discovery.sql +85 -0
- package/drizzle/0470_organization_integration_policy.sql +151 -0
- package/drizzle/0471_usage_events_account_recent_index.sql +4 -0
- package/drizzle/0472_usage_events_workspace_recent_index.sql +4 -0
- package/drizzle/0473_organization_usage_analytical_capability.sql +237 -0
- package/drizzle/0474_goal_report_requirements.sql +156 -0
- package/drizzle/0475_session_event_history_statistics.sql +15 -0
- package/drizzle/0476_session_event_history_policy_planning.sql +29 -0
- package/drizzle/0477_managed_sign_in_methods.sql +303 -0
- package/drizzle/0478_sender_owned_connections.sql +2772 -0
- package/drizzle/0479_connection_create_idempotency.sql +16 -0
- package/drizzle/0480_private_session_organization_key_administration.sql +154 -0
- package/drizzle/0481_personal_connection_visibility_cleanup.sql +45 -0
- package/drizzle/0482_remove_packs.sql +417 -0
- package/drizzle/0483_preclaim_admission_block.sql +85 -0
- package/drizzle/0484_insights_usage_projection.sql +211 -0
- package/drizzle/0485_inherited_mcp_approval_policies.sql +6 -0
- package/drizzle/0486_reasoning_configuration_message_forks.sql +35 -0
- package/drizzle/0487_skill_catalog_message_forks.sql +26 -0
- package/drizzle/0488_permanent_skill_removal.sql +207 -0
- package/drizzle/0489_modal_command_byte_offsets.sql +17 -0
- package/drizzle/0490_periodic_capture_attempt_cadence.sql +6 -0
- package/drizzle/0491_warm_capture_holder_reclamation.sql +57 -0
- package/drizzle/0492_codex_accepted_source_authority.sql +249 -0
- package/drizzle/0493_stopping_command_error_containment.sql +58 -0
- package/drizzle/0494_mcp_account_bindings.sql +334 -0
- package/drizzle/0495_consented_sandbox_recovery.sql +220 -0
- package/drizzle/0496_supervised_command_settlement.sql +386 -0
- package/drizzle/0497_modal_inventory_owner_read_capability.sql +112 -0
- package/drizzle/0498_enrollment_membership_fence.sql +87 -0
- package/drizzle/0499_session_attachment_access.sql +224 -0
- package/drizzle/0500_session_execution_epoch.sql +37 -0
- package/drizzle/0501_session_sharing_execution.sql +591 -0
- package/drizzle/0502_active_message_boundary_forks.sql +30 -0
- package/package.json +17 -5
- package/src/automations.ts +17 -73
- package/src/canonical-human-identities.ts +17 -5
- package/src/capability-components.ts +7 -24
- package/src/capability-integrations.ts +301 -21
- package/src/capability-reconciliation.ts +19 -0
- package/src/codex-capacity-recovery.ts +47 -0
- package/src/codex-failure-eligibility.ts +93 -0
- package/src/connect-attempts.ts +49 -18
- package/src/connection-authority.ts +12 -158
- package/src/connection-refresh-lock.ts +22 -0
- package/src/connection-token-resolver.ts +58 -530
- package/src/database-timing.ts +43 -0
- package/src/database.ts +61 -26
- package/src/editable-artifacts.ts +1 -1
- package/src/index.ts +3578 -1273
- package/src/insights-model-bundle.ts +19 -7
- package/src/insights-usage-bundle.ts +16 -19
- package/src/integration-bindings.ts +2 -7
- package/src/integration-facets.ts +73 -6
- package/src/knowledge-entries.ts +8 -1
- package/src/live-session-attempt.ts +0 -22
- package/src/mcp-account-bindings.ts +12 -0
- package/src/mcp-oauth.ts +26 -0
- package/src/organization-integration-policy.ts +235 -0
- package/src/organization-usage.ts +83 -0
- package/src/plugin-packages.ts +226 -42
- package/src/pr-review.ts +7 -69
- package/src/preference-registry-schema.ts +1 -0
- package/src/provision-roles.ts +50 -37
- package/src/retained-provider-commands.ts +286 -9
- package/src/retired-session-create-metadata.ts +16 -0
- package/src/runtime-posture.ts +217 -13
- package/src/schema.ts +104 -120
- package/src/session-admission-block.ts +29 -0
- package/src/session-attempt-writers.ts +48 -0
- package/src/session-control.ts +21 -5
- package/src/session-event-slices.ts +76 -26
- package/src/session-file-attachments.ts +66 -0
- package/src/session-goal-reports.ts +255 -0
- package/src/session-mcp-approval.ts +30 -0
- package/src/session-message-search.ts +348 -0
- package/src/session-queue-commands.ts +60 -36
- package/src/session-retry.ts +319 -0
- package/src/skill-config-migration.ts +11 -2
- package/src/skill-source-release-impact.ts +33 -0
- package/src/skill-source-release.ts +67 -26
- package/src/skills.ts +44 -6
- package/src/user-resource-authority.ts +0 -56
- package/dist/chunk-6T2GGYWE.js.map +0 -1
- package/dist/chunk-7HMK3B45.js.map +0 -1
- package/dist/chunk-DPONPYJD.js.map +0 -1
- package/dist/chunk-F73UKJY6.js.map +0 -1
- package/dist/chunk-T6YLHJLS.js.map +0 -1
- package/dist/host-mcp-binding-match.d.ts +0 -5
- package/dist/host-mcp-bindings.d.ts +0 -79
- package/dist/host-mcp-resolvers.d.ts +0 -47
- package/dist/host-mcp-task-authority.d.ts +0 -43
- package/dist/host-selection-identity.d.ts +0 -6
- package/dist/pack-components.d.ts +0 -83
- package/dist/pack-installations.d.ts +0 -86
- package/src/host-mcp-binding-match.ts +0 -34
- package/src/host-mcp-bindings.ts +0 -777
- package/src/host-mcp-resolvers.ts +0 -266
- package/src/host-mcp-task-authority.ts +0 -384
- package/src/host-selection-identity.ts +0 -29
- package/src/pack-components.ts +0 -980
- package/src/pack-installations.ts +0 -950
- /package/dist/{chunk-MWMXWHJD.js.map → chunk-7JCDSMX2.js.map} +0 -0
- /package/dist/{chunk-ERKVSPDX.js.map → chunk-LVY33EWL.js.map} +0 -0
- /package/dist/{chunk-T6BWIGWJ.js.map → chunk-RIYHP2WU.js.map} +0 -0
|
@@ -28,5 +28,8 @@ export type WorkspaceInsightsUsageBundle = {
|
|
|
28
28
|
* One read for the three existing usage windows. The event-type arrays are
|
|
29
29
|
* deliberately closed so the authority function can keep selective predicates
|
|
30
30
|
* inside its scan while all rollup math remains outside the billing path.
|
|
31
|
+
* Only the reused current window needs a second materialization: aggregate the
|
|
32
|
+
* single-use prior/month SRFs directly, since their volatile calls prevent CTE
|
|
33
|
+
* inlining even without an explicit MATERIALIZED keyword.
|
|
31
34
|
*/
|
|
32
35
|
export declare function readWorkspaceInsightsUsageBundle(db: Database, input: WorkspaceInsightsUsageBundleInput): Promise<WorkspaceInsightsUsageBundle>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Database } from "./database.js";
|
|
2
2
|
import * as schema from "./schema.js";
|
|
3
3
|
export type IntegrationFacetBindingOwner = {
|
|
4
|
-
kind: "direct" | "plugin" | "
|
|
4
|
+
kind: "direct" | "plugin" | "migration";
|
|
5
5
|
id: string;
|
|
6
6
|
removable: boolean;
|
|
7
7
|
};
|
|
@@ -49,7 +49,7 @@ export type IntegrationFacetRemovalResult = {
|
|
|
49
49
|
status: "not_configured" | "removed" | "retained_by_other_owners";
|
|
50
50
|
binding: IntegrationFacetBindingSummary | null;
|
|
51
51
|
remainingOwners: {
|
|
52
|
-
kind: "direct" | "plugin" | "
|
|
52
|
+
kind: "direct" | "plugin" | "migration";
|
|
53
53
|
id: string;
|
|
54
54
|
removable: boolean;
|
|
55
55
|
}[];
|
|
@@ -92,6 +92,21 @@ export declare function replayCompletedIntegrationFacetOperation<T extends Recor
|
|
|
92
92
|
kind: IntegrationFacetOperationKind;
|
|
93
93
|
expectedRequestDigest: string | ((result: T) => string);
|
|
94
94
|
}): Promise<T | null>;
|
|
95
|
+
type IntegrationInstanceContext = {
|
|
96
|
+
accountId: string;
|
|
97
|
+
integrationFacetInstallationId: string;
|
|
98
|
+
integrationFacetId: string;
|
|
99
|
+
providerDomain: string;
|
|
100
|
+
connectionId: string | null;
|
|
101
|
+
apiProtocol: string | null;
|
|
102
|
+
definitionId: string | null;
|
|
103
|
+
definitionProvenance: string | null;
|
|
104
|
+
};
|
|
105
|
+
/** Trusted server callback, never part of a serialized mutation request. The
|
|
106
|
+
* caller must acquire its policy fence before invoking the facet operation.
|
|
107
|
+
* IDs/domains in this context identify installed records, not curated provenance.
|
|
108
|
+
*/
|
|
109
|
+
export type IntegrationFacetAcquisitionAuthorizer = (tx: Database, context: Readonly<IntegrationInstanceContext>) => Promise<void>;
|
|
95
110
|
export declare function listIntegrationInstanceFacets(db: Database, workspaceId: string, subjectId: string, capabilityId: string, instanceKey: string): Promise<IntegrationInstanceFacets>;
|
|
96
111
|
export declare function configureIntegrationFacet(db: Database, input: {
|
|
97
112
|
accountId: string;
|
|
@@ -104,6 +119,7 @@ export declare function configureIntegrationFacet(db: Database, input: {
|
|
|
104
119
|
config: Record<string, unknown>;
|
|
105
120
|
expectedVersion?: number;
|
|
106
121
|
idempotencyKey: string;
|
|
122
|
+
beforeAcquire?: IntegrationFacetAcquisitionAuthorizer;
|
|
107
123
|
}): Promise<IntegrationFacetMutationResult>;
|
|
108
124
|
export declare function setIntegrationFacetLifecycle(db: Database, input: {
|
|
109
125
|
accountId: string;
|
|
@@ -115,6 +131,7 @@ export declare function setIntegrationFacetLifecycle(db: Database, input: {
|
|
|
115
131
|
action: "pause" | "resume";
|
|
116
132
|
expectedVersion: number;
|
|
117
133
|
idempotencyKey: string;
|
|
134
|
+
beforeAcquire?: IntegrationFacetAcquisitionAuthorizer;
|
|
118
135
|
}): Promise<IntegrationFacetMutationResult>;
|
|
119
136
|
export declare function removeIntegrationFacet(db: Database, input: {
|
|
120
137
|
accountId: string;
|
|
@@ -1031,6 +1031,7 @@ export declare const knowledgeEntryRevisions: import("drizzle-orm/pg-core").PgTa
|
|
|
1031
1031
|
version?: string | undefined;
|
|
1032
1032
|
capturedAt?: string | undefined;
|
|
1033
1033
|
retention?: "full_text" | "passages" | "reference" | undefined;
|
|
1034
|
+
purpose?: "evidence" | "reference" | undefined;
|
|
1034
1035
|
} | undefined;
|
|
1035
1036
|
evidence: {
|
|
1036
1037
|
entryId: string;
|
|
@@ -1079,6 +1080,7 @@ export declare const knowledgeEntryRevisions: import("drizzle-orm/pg-core").PgTa
|
|
|
1079
1080
|
version?: string | undefined;
|
|
1080
1081
|
capturedAt?: string | undefined;
|
|
1081
1082
|
retention?: "full_text" | "passages" | "reference" | undefined;
|
|
1083
|
+
purpose?: "evidence" | "reference" | undefined;
|
|
1082
1084
|
} | undefined;
|
|
1083
1085
|
evidence: {
|
|
1084
1086
|
entryId: string;
|
|
@@ -43,6 +43,7 @@ export declare function readKnowledgeIndexSource(db: Database, claim: KnowledgeI
|
|
|
43
43
|
version?: string | undefined;
|
|
44
44
|
capturedAt?: string | undefined;
|
|
45
45
|
retention?: "full_text" | "passages" | "reference" | undefined;
|
|
46
|
+
purpose?: "evidence" | "reference" | undefined;
|
|
46
47
|
} | undefined;
|
|
47
48
|
evidence: {
|
|
48
49
|
entryId: string;
|
|
@@ -59,11 +59,16 @@ export declare function getLiveSessionAttemptTurn(db: Database, workspaceId: str
|
|
|
59
59
|
text: string;
|
|
60
60
|
successCriteria: string | null;
|
|
61
61
|
rootConstraints: string[];
|
|
62
|
+
reportRequirements?: {
|
|
63
|
+
id: string;
|
|
64
|
+
title: string;
|
|
65
|
+
}[] | undefined;
|
|
62
66
|
mutationPolicy: "autonomous_adaptation" | "preserve_intent" | "review_changes";
|
|
63
67
|
capturedAt: string;
|
|
64
68
|
} | null;
|
|
65
69
|
personalConnectionDelegations: {
|
|
66
70
|
serverId: string;
|
|
71
|
+
canonicalServerId?: string | undefined;
|
|
67
72
|
connectionId: string;
|
|
68
73
|
originWorkspaceId?: string | undefined;
|
|
69
74
|
ownerSubjectId: string;
|
|
@@ -105,140 +110,39 @@ export declare function getLiveSessionAttemptTurn(db: Database, workspaceId: str
|
|
|
105
110
|
selectedAt: string;
|
|
106
111
|
} | undefined;
|
|
107
112
|
}[];
|
|
108
|
-
|
|
109
|
-
mode: "always" | "once" | "session";
|
|
110
|
-
context: "user_private" | "workspace_shared";
|
|
111
|
-
resourceCount: number;
|
|
112
|
-
resourceKinds: ("connected_machine" | "rig" | "variable_set")[];
|
|
113
|
-
sharedOutputWarningVersion: 1;
|
|
114
|
-
} | null;
|
|
115
|
-
personalResourceProtocolVersion: number;
|
|
116
|
-
scheduledTaskRunId: string | null;
|
|
117
|
-
xaiProviderAccountAuthoritySnapshot: {
|
|
118
|
-
version: 1;
|
|
119
|
-
scope: "organization";
|
|
120
|
-
} | {
|
|
121
|
-
version: 1;
|
|
122
|
-
scope: "workspace";
|
|
123
|
-
} | {
|
|
124
|
-
version: 1;
|
|
125
|
-
scope: "user";
|
|
126
|
-
authorityGeneration: number;
|
|
127
|
-
};
|
|
128
|
-
cancelledBy: string | null;
|
|
129
|
-
cancelReason: string | null;
|
|
130
|
-
codemodeCallCount: number;
|
|
131
|
-
startedAt: Date | null;
|
|
132
|
-
finishedAt: Date | null;
|
|
133
|
-
createdAt: Date;
|
|
134
|
-
updatedAt: Date;
|
|
135
|
-
} | null>;
|
|
136
|
-
/** Host credential reads need provenance and live authority, not a runnable
|
|
137
|
-
* execution projection or a write to the turn's frozen goal snapshot. */
|
|
138
|
-
export declare function getHostMcpLiveAttempt(db: Database, workspaceId: string, sessionId: string, attemptId: string): Promise<{
|
|
139
|
-
id: string;
|
|
140
|
-
accountId: string;
|
|
141
|
-
workspaceId: string;
|
|
142
|
-
sessionId: string;
|
|
143
|
-
triggerEventId: string;
|
|
144
|
-
temporalWorkflowId: string;
|
|
145
|
-
status: string;
|
|
146
|
-
source: string;
|
|
147
|
-
promptRouting: string | null;
|
|
148
|
-
position: number;
|
|
149
|
-
prompt: string;
|
|
150
|
-
promptCodecVersion: number | null;
|
|
151
|
-
annotations: {
|
|
152
|
-
id: string;
|
|
153
|
-
source: {
|
|
154
|
-
kind: "assistant_message" | "tool_output" | "user_message";
|
|
155
|
-
eventId: string;
|
|
156
|
-
eventType: "agent.message.completed" | "agent.toolCall.output" | "user.message";
|
|
157
|
-
sequence: number;
|
|
158
|
-
turnId: string | null;
|
|
159
|
-
startOffset: number;
|
|
160
|
-
endOffset: number;
|
|
161
|
-
contextBefore: string;
|
|
162
|
-
contextAfter: string;
|
|
163
|
-
label?: string | undefined;
|
|
164
|
-
};
|
|
165
|
-
quote: string;
|
|
166
|
-
note: string;
|
|
167
|
-
ordinal: number;
|
|
168
|
-
}[];
|
|
169
|
-
modelContext: string | null;
|
|
170
|
-
resources: unknown[];
|
|
171
|
-
tools: unknown[];
|
|
172
|
-
toolsProvided: boolean;
|
|
173
|
-
model: string;
|
|
174
|
-
reasoningEffort: string;
|
|
175
|
-
latencyMode: string;
|
|
176
|
-
sandboxBackend: string;
|
|
177
|
-
sandboxOs: string | null;
|
|
178
|
-
metadata: Record<string, unknown>;
|
|
179
|
-
version: number;
|
|
180
|
-
executionGeneration: number;
|
|
181
|
-
activeAttemptId: string | null;
|
|
182
|
-
lineage: Record<string, unknown>;
|
|
183
|
-
initiatorKind: string;
|
|
184
|
-
initiatorSubjectId: string;
|
|
185
|
-
initiatingHumanSubjectId: string | null;
|
|
186
|
-
goalSnapshot: {
|
|
187
|
-
state: "none";
|
|
188
|
-
capturedAt: string;
|
|
189
|
-
} | {
|
|
190
|
-
state: "active" | "completed" | "paused";
|
|
191
|
-
goalId: string;
|
|
192
|
-
objectiveRevision: number;
|
|
193
|
-
text: string;
|
|
194
|
-
successCriteria: string | null;
|
|
195
|
-
rootConstraints: string[];
|
|
196
|
-
mutationPolicy: "autonomous_adaptation" | "preserve_intent" | "review_changes";
|
|
197
|
-
capturedAt: string;
|
|
198
|
-
} | null;
|
|
199
|
-
personalConnectionDelegations: {
|
|
113
|
+
mcpAccountBindings: {
|
|
200
114
|
serverId: string;
|
|
115
|
+
canonicalServerId: string;
|
|
201
116
|
connectionId: string;
|
|
202
|
-
originWorkspaceId
|
|
203
|
-
|
|
117
|
+
originWorkspaceId: string;
|
|
118
|
+
subjectScope: "subject" | "workspace";
|
|
119
|
+
ownerSubjectId: string | null;
|
|
120
|
+
accountLabel: string;
|
|
204
121
|
providerDomain: string;
|
|
205
|
-
kind
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
ref: string;
|
|
230
|
-
access: "read" | "write";
|
|
231
|
-
selectionGeneration: number;
|
|
232
|
-
}[];
|
|
233
|
-
} | undefined;
|
|
234
|
-
outputDestination?: {
|
|
235
|
-
folderId: string;
|
|
236
|
-
folderName: string;
|
|
237
|
-
driveId: string | null;
|
|
238
|
-
location: "my_drive" | "shared_drive";
|
|
239
|
-
selectedAt: string;
|
|
240
|
-
} | undefined;
|
|
241
|
-
}[];
|
|
122
|
+
kind: "api_key" | "app_install" | "delegated" | "oauth2";
|
|
123
|
+
connectionRef: {
|
|
124
|
+
connectionId?: string | undefined;
|
|
125
|
+
accountSelection?: "all_eligible" | undefined;
|
|
126
|
+
authoritySource?: "host" | undefined;
|
|
127
|
+
hostBinding?: {
|
|
128
|
+
bindingId: string;
|
|
129
|
+
generation: number;
|
|
130
|
+
} | {
|
|
131
|
+
selection: "accepted_turn";
|
|
132
|
+
} | undefined;
|
|
133
|
+
provider?: string | undefined;
|
|
134
|
+
providerDomain: string;
|
|
135
|
+
kind?: "api_key" | "app_install" | "delegated" | "oauth2" | undefined;
|
|
136
|
+
scopes?: string[] | undefined;
|
|
137
|
+
resource?: string | undefined;
|
|
138
|
+
selectedResources?: {
|
|
139
|
+
id: string;
|
|
140
|
+
kind: "repository";
|
|
141
|
+
}[] | undefined;
|
|
142
|
+
subjectScope?: "subject" | "workspace" | undefined;
|
|
143
|
+
};
|
|
144
|
+
connectionAuthorityGeneration?: number | undefined;
|
|
145
|
+
}[] | null;
|
|
242
146
|
personalResourceAttachmentSummary: {
|
|
243
147
|
mode: "always" | "once" | "session";
|
|
244
148
|
context: "user_private" | "workspace_shared";
|
|
@@ -266,10 +170,4 @@ export declare function getHostMcpLiveAttempt(db: Database, workspaceId: string,
|
|
|
266
170
|
finishedAt: Date | null;
|
|
267
171
|
createdAt: Date;
|
|
268
172
|
updatedAt: Date;
|
|
269
|
-
initiator: {
|
|
270
|
-
subjectId: string;
|
|
271
|
-
label?: string | undefined;
|
|
272
|
-
kind: "service" | "subject";
|
|
273
|
-
};
|
|
274
|
-
initiatorContext: Record<string, unknown>;
|
|
275
173
|
} | null>;
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
reapManagedAuthIsolatedSessions,
|
|
21
21
|
releaseManagedAuthActorMutationLease,
|
|
22
22
|
validateManagedAuthActorMutationLease
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-7JCDSMX2.js";
|
|
24
|
+
import "./chunk-CJI6G254.js";
|
|
25
|
+
import "./chunk-MN5PZMEK.js";
|
|
26
26
|
import "./chunk-S2TZ3F4L.js";
|
|
27
27
|
import "./chunk-PZ5AY32C.js";
|
|
28
28
|
export {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type McpConnectionAccountBinding } from "@opengeni/contracts";
|
|
2
|
+
/** NULL is a pre-account-routing receipt, not an empty accepted selection.
|
|
3
|
+
* Never default it to [] (or default [] to NULL) during replay/inheritance. */
|
|
4
|
+
export declare function parseAcceptedMcpAccountBindings(value: unknown): McpConnectionAccountBinding[] | null;
|
package/dist/mcp-oauth.d.ts
CHANGED
|
@@ -50,6 +50,17 @@ export declare function getMcpOAuthClient(db: Database, clientId: string): Promi
|
|
|
50
50
|
export declare function createMcpOAuthAuthorizationRequest(db: Database, input: McpOAuthAuthorizationRequest): Promise<void>;
|
|
51
51
|
export declare function getMcpOAuthAuthorizationRequest(db: Database, requestHash: string): Promise<McpOAuthAuthorizationRequest | null>;
|
|
52
52
|
export declare function deleteMcpOAuthAuthorizationRequest(db: Database, requestHash: string): Promise<void>;
|
|
53
|
+
export declare function rebindMcpOAuthAuthorizationRequest(db: Database, input: {
|
|
54
|
+
requestHash: string;
|
|
55
|
+
subjectId: string;
|
|
56
|
+
accountId: string;
|
|
57
|
+
workspaceId: string;
|
|
58
|
+
permissions: AccessGrant["permissions"];
|
|
59
|
+
toolIdentities: Array<{
|
|
60
|
+
serverId: string;
|
|
61
|
+
toolName: string;
|
|
62
|
+
}>;
|
|
63
|
+
}): Promise<boolean>;
|
|
53
64
|
export declare function consumeMcpOAuthAuthorizationRequest(db: Database, input: {
|
|
54
65
|
requestHash: string;
|
|
55
66
|
subjectId: string;
|
package/dist/mcp-operations.js
CHANGED
package/dist/migrate.js
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OrganizationIntegrationPolicy, UpdateOrganizationIntegrationPolicyRequest } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "./database.js";
|
|
3
|
+
export type OrganizationIntegrationPolicyScope = {
|
|
4
|
+
accountId: string;
|
|
5
|
+
};
|
|
6
|
+
export type OrganizationIntegrationAcquisitionScope = {
|
|
7
|
+
accountId: string;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
};
|
|
10
|
+
/** Trusted application adapter MUST verify canonical human/local organization-admin
|
|
11
|
+
* provenance or accountScopedApiKeyWorkspaceAuthority (exact account + workspace:admin).
|
|
12
|
+
* This callback is a server dependency, never deserialized request data. The returned
|
|
13
|
+
* subject alone is NOT authentication. DB checks below are live authority fences only.
|
|
14
|
+
*/
|
|
15
|
+
export type AuthorizeOrganizationIntegrationPolicyAdministration = () => Promise<{
|
|
16
|
+
accountId: string;
|
|
17
|
+
subjectId: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function getOrganizationIntegrationPolicy(db: Database, inputScope: OrganizationIntegrationPolicyScope, authorize: AuthorizeOrganizationIntegrationPolicyAdministration): Promise<OrganizationIntegrationPolicy>;
|
|
20
|
+
/** Call before acquiring membership/workspace/credential locks in any enclosing
|
|
21
|
+
* transaction. The SQL operation owns policy-exclusive -> membership -> admin
|
|
22
|
+
* row order; it never locks a workspace and rejects acquisition-lock upgrades.
|
|
23
|
+
*/
|
|
24
|
+
export declare function updateOrganizationIntegrationPolicy(db: Database, inputScope: OrganizationIntegrationPolicyScope, input: UpdateOrganizationIntegrationPolicyRequest, authorize: AuthorizeOrganizationIntegrationPolicyAdministration): Promise<OrganizationIntegrationPolicy>;
|
|
25
|
+
/** Internal serialization primitive, NOT acquisition authorization. Authenticate
|
|
26
|
+
* the caller normally. A callback may first return an exact completed receipt;
|
|
27
|
+
* before any new claim, uncommitted progress, or commit it MUST assert the trusted
|
|
28
|
+
* integration classification against the supplied runtime-frozen policy snapshot.
|
|
29
|
+
* Do not put network operations or retries inside this transaction.
|
|
30
|
+
*
|
|
31
|
+
* Requires read committed isolation. The shared policy fence precedes EVERY
|
|
32
|
+
* organization-membership, workspace/tenancy, and credential lock. In particular,
|
|
33
|
+
* persistProviderOAuthConnection may take the membership fence inside acquire.
|
|
34
|
+
* Policy writers take exclusive policy -> membership -> live administrator rows,
|
|
35
|
+
* and never workspace rows. Ordinary connection lifecycle writers do not take
|
|
36
|
+
* the policy fence. A caller passing an existing transaction must honor this
|
|
37
|
+
* prefix. Never administer policy inside or after an acquisition in that transaction:
|
|
38
|
+
* the SQL writer rejects shared-to-exclusive upgrades rather than risking deadlock.
|
|
39
|
+
* All final persistence must use tx, never a separate connection. No automatic
|
|
40
|
+
* retries: external effects cannot be rolled back. For slow external preparation,
|
|
41
|
+
* preflight separately and use this guard for final persistence. Existing execution,
|
|
42
|
+
* refresh, credential lifecycle, and cleanup do not belong behind this guard.
|
|
43
|
+
*/
|
|
44
|
+
export declare function withOrganizationIntegrationPolicyFence<T>(db: Database, inputScope: OrganizationIntegrationAcquisitionScope, run: (tx: Database, policy: OrganizationIntegrationPolicy) => Promise<T>): Promise<T>;
|
|
45
|
+
/** New acquisitions always assert before effects and before returning to commit.
|
|
46
|
+
* The immutable snapshot stays authoritative through commit: the shared fence
|
|
47
|
+
* excludes policy writers and the SQL writer rejects same-transaction upgrades.
|
|
48
|
+
* Receipt-aware callers instead use withOrganizationIntegrationPolicyFence and
|
|
49
|
+
* assert only after distinguishing completed replay from new workflow progress.
|
|
50
|
+
*/
|
|
51
|
+
export declare function withOrganizationIntegrationAcquisition<T>(db: Database, inputScope: OrganizationIntegrationAcquisitionScope, integrationKeys: readonly (string | null)[], acquire: (tx: Database) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getOrganizationIntegrationPolicy,
|
|
3
|
+
updateOrganizationIntegrationPolicy,
|
|
4
|
+
withOrganizationIntegrationAcquisition,
|
|
5
|
+
withOrganizationIntegrationPolicyFence
|
|
6
|
+
} from "./chunk-ZPJ6V2VG.js";
|
|
7
|
+
import "./chunk-4UJCXBR2.js";
|
|
8
|
+
import "./chunk-CJI6G254.js";
|
|
9
|
+
import "./chunk-MN5PZMEK.js";
|
|
10
|
+
import "./chunk-S2TZ3F4L.js";
|
|
11
|
+
import "./chunk-PZ5AY32C.js";
|
|
12
|
+
export {
|
|
13
|
+
getOrganizationIntegrationPolicy,
|
|
14
|
+
updateOrganizationIntegrationPolicy,
|
|
15
|
+
withOrganizationIntegrationAcquisition,
|
|
16
|
+
withOrganizationIntegrationPolicyFence
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=organization-integration-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OrganizationUsageSummary, OrganizationUsageWorkspacePage, type OrganizationUsagePeriod } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "./database.js";
|
|
3
|
+
/** Same UTC semantics as Insights: week is today and the previous six days. */
|
|
4
|
+
export declare function organizationUsageWindow(period: OrganizationUsagePeriod, now?: Date): {
|
|
5
|
+
since: string;
|
|
6
|
+
until: string;
|
|
7
|
+
granularity: "day" | "hour";
|
|
8
|
+
};
|
|
9
|
+
type UsageInput = {
|
|
10
|
+
accountId: string;
|
|
11
|
+
period?: OrganizationUsagePeriod | undefined;
|
|
12
|
+
};
|
|
13
|
+
/** One set-based, actor-visible aggregate. Must use the writable primary. */
|
|
14
|
+
export declare function getOrganizationUsageSummary(db: Database, input: UsageInput, now?: Date): Promise<OrganizationUsageSummary>;
|
|
15
|
+
/** Bounded page-only scan; never recomputes organization-wide totals/buckets. */
|
|
16
|
+
export declare function getOrganizationUsageWorkspacePage(db: Database, input: UsageInput & {
|
|
17
|
+
until: string;
|
|
18
|
+
afterWorkspaceId?: string | undefined;
|
|
19
|
+
}): Promise<OrganizationUsageWorkspacePage>;
|
|
20
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type CapabilityCatalogAuthKind, type SkillActor } from "@opengeni/contracts";
|
|
1
|
+
import { type CapabilityCatalogAuthKind, type SkillActor, type PluginUninstallPreview } from "@opengeni/contracts";
|
|
2
2
|
import { type Database } from "./database.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type SkillSourceReleaseReceipt } from "./skill-source-release.js";
|
|
4
4
|
import type { SkillPublicationReceipt } from "@opengeni/contracts";
|
|
5
5
|
export type PluginBomComponent = {
|
|
6
6
|
key: string;
|
|
@@ -44,6 +44,11 @@ export declare class PluginOperationIdempotencyError extends Error {
|
|
|
44
44
|
export declare class PluginInstallationVersionConflictError extends Error {
|
|
45
45
|
readonly name = "PluginInstallationVersionConflictError";
|
|
46
46
|
}
|
|
47
|
+
export declare class PluginUninstallPreviewChangedError extends Error {
|
|
48
|
+
readonly preview?: PluginUninstallPreview | undefined;
|
|
49
|
+
readonly code = "plugin_uninstall_preview_changed";
|
|
50
|
+
constructor(preview?: PluginUninstallPreview | undefined);
|
|
51
|
+
}
|
|
47
52
|
export declare class PluginInstallationVersionRequiredError extends Error {
|
|
48
53
|
readonly name = "PluginInstallationVersionRequiredError";
|
|
49
54
|
}
|
|
@@ -110,22 +115,14 @@ export declare function installPluginMcpReference(db: Database, input: {
|
|
|
110
115
|
capabilityId: string;
|
|
111
116
|
facetInstallationId: string;
|
|
112
117
|
}>;
|
|
113
|
-
export declare function getPluginPackageUninstallPreview(db: Database, workspaceId: string, pluginKey: string): Promise<
|
|
114
|
-
installed: boolean;
|
|
115
|
-
version: string | null;
|
|
116
|
-
installationVersion: number | null;
|
|
117
|
-
components: Array<{
|
|
118
|
-
capabilityId: string;
|
|
119
|
-
kind: "skill" | "integration" | "mcp";
|
|
120
|
-
retainedByOtherOwners: boolean;
|
|
121
|
-
}>;
|
|
122
|
-
}>;
|
|
118
|
+
export declare function getPluginPackageUninstallPreview(db: Database, workspaceId: string, pluginKey: string, subjectId?: string): Promise<Omit<PluginUninstallPreview, "pluginKey">>;
|
|
123
119
|
export declare function uninstallPluginPackage(db: Database, input: {
|
|
124
120
|
accountId: string;
|
|
125
121
|
workspaceId: string;
|
|
126
122
|
subjectId: string;
|
|
127
123
|
pluginKey: string;
|
|
128
124
|
expectedInstallationVersion: number;
|
|
125
|
+
expectedPreviewToken?: string;
|
|
129
126
|
idempotencyKey: string;
|
|
130
127
|
skillActor?: SkillActor;
|
|
131
128
|
}): Promise<{
|
package/dist/pr-review.d.ts
CHANGED
|
@@ -23,8 +23,6 @@ export declare function createPrReviewAppRegistration(db: Database, input: {
|
|
|
23
23
|
webhookSecretEncrypted: string;
|
|
24
24
|
webhookUsername: string | null;
|
|
25
25
|
createdBySubjectId: string;
|
|
26
|
-
packInstallationId: string;
|
|
27
|
-
packConnectorId: string;
|
|
28
26
|
}): Promise<PrReviewAppRegistration>;
|
|
29
27
|
export declare function listPrReviewAppRegistrations(db: Database, accountId: string, workspaceId: string): Promise<PrReviewAppRegistration[]>;
|
|
30
28
|
export declare function getPrReviewAppRegistrationSecret(db: Database, input: {
|
|
@@ -62,8 +60,6 @@ export declare function createPrReviewRepositoryBinding(db: Database, input: {
|
|
|
62
60
|
additionalInstructions: string | null;
|
|
63
61
|
status: "active" | "disabled";
|
|
64
62
|
createdBySubjectId: string;
|
|
65
|
-
packInstallationId: string;
|
|
66
|
-
packTemplateId: string;
|
|
67
63
|
adapterId: string;
|
|
68
64
|
eventTypes: string[];
|
|
69
65
|
configuration: Record<string, unknown>;
|
|
@@ -71,10 +67,6 @@ export declare function createPrReviewRepositoryBinding(db: Database, input: {
|
|
|
71
67
|
/** Trusted database-only admission seam. Throwing rolls the binding and trigger back. */
|
|
72
68
|
beforeCreateCommit?: (tx: Database) => Promise<void>;
|
|
73
69
|
}): Promise<PrReviewRepositoryBinding>;
|
|
74
|
-
/** Atomically converge one owner-authorized installation of the deployment
|
|
75
|
-
* review App onto the Pack's ordinary source/trigger/binding model. Re-running
|
|
76
|
-
* the browser flow repairs disabled rows, follows GitHub repository selection,
|
|
77
|
-
* and removes shared-webhook routes for repositories no longer selected. */
|
|
78
70
|
export declare function syncManagedGitHubPrReviewInstallation(db: Database, input: {
|
|
79
71
|
accountId: string;
|
|
80
72
|
workspaceId: string;
|
|
@@ -90,9 +82,6 @@ export declare function syncManagedGitHubPrReviewInstallation(db: Database, inpu
|
|
|
90
82
|
webhookSecretEncrypted: string;
|
|
91
83
|
repositories: GitHubRepository[];
|
|
92
84
|
createdBySubjectId: string;
|
|
93
|
-
packInstallationId: string;
|
|
94
|
-
packConnectorId: string;
|
|
95
|
-
packTemplateId: string;
|
|
96
85
|
adapterId: string;
|
|
97
86
|
eventTypes: string[];
|
|
98
87
|
configuration: Record<string, unknown>;
|
|
@@ -459,6 +459,23 @@ export declare const preferenceRegistryRevisions: import("drizzle-orm/pg-core").
|
|
|
459
459
|
identity: undefined;
|
|
460
460
|
generated: undefined;
|
|
461
461
|
}, {}, {}>;
|
|
462
|
+
skillRemovalOperationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
463
|
+
name: "skill_removal_operation_id";
|
|
464
|
+
tableName: "preference_registry_revisions";
|
|
465
|
+
dataType: "string";
|
|
466
|
+
columnType: "PgUUID";
|
|
467
|
+
data: string;
|
|
468
|
+
driverParam: string;
|
|
469
|
+
notNull: false;
|
|
470
|
+
hasDefault: false;
|
|
471
|
+
isPrimaryKey: false;
|
|
472
|
+
isAutoincrement: false;
|
|
473
|
+
hasRuntimeDefault: false;
|
|
474
|
+
enumValues: undefined;
|
|
475
|
+
baseColumn: never;
|
|
476
|
+
identity: undefined;
|
|
477
|
+
generated: undefined;
|
|
478
|
+
}, {}, {}>;
|
|
462
479
|
precedenceRank: import("drizzle-orm/pg-core").PgColumn<{
|
|
463
480
|
name: "precedence_rank";
|
|
464
481
|
tableName: "preference_registry_revisions";
|