@opengeni/db 0.12.1 → 0.12.6
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/{chunk-VUKRIBO5.js → chunk-CYA6BHV6.js} +150 -7
- package/dist/chunk-CYA6BHV6.js.map +1 -0
- package/dist/chunk-XRVNI2GB.js +896 -0
- package/dist/chunk-XRVNI2GB.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1166 -265
- package/dist/index.js.map +1 -1
- package/dist/provision-roles.d.ts +324 -38
- package/dist/provision-roles.js +1 -1
- package/dist/{schema-BejThLcd.d.ts → schema-CeXWlYcG.d.ts} +431 -2
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/drizzle/0122_codex_capacity_same_turn.sql +59 -0
- package/drizzle/0123_session_tool_policy_version.sql +14 -0
- package/drizzle/0124_session_event_duplicate_lookup.sql +4 -0
- package/drizzle/0125_document_drops_visibility.sql +29 -0
- package/drizzle/0126_document_access_constraints.sql +138 -0
- package/drizzle/0127_document_default_base_index.sql +5 -0
- package/drizzle/0128_github_installation_authority.sql +69 -0
- package/drizzle/0129_retained_process_reconciliation.sql +356 -0
- package/package.json +4 -3
- package/src/event-payload-sanitizer.ts +167 -55
- package/src/index.ts +1494 -258
- package/src/new-session-drafts.ts +127 -6
- package/src/provision-roles.ts +184 -2
- package/src/runtime-posture-cli.ts +57 -0
- package/src/runtime-posture.ts +760 -0
- package/src/schema.ts +156 -3
- package/src/session-control.ts +1 -0
- package/dist/chunk-BMFDXFPA.js +0 -155
- package/dist/chunk-BMFDXFPA.js.map +0 -1
- package/dist/chunk-VUKRIBO5.js.map +0 -1
package/dist/provision-roles.js
CHANGED
|
@@ -3838,6 +3838,23 @@ declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3838
3838
|
inheritedFromSessionId: string | null;
|
|
3839
3839
|
};
|
|
3840
3840
|
}>;
|
|
3841
|
+
toolPolicyVersion: drizzle_orm_pg_core.PgColumn<{
|
|
3842
|
+
name: "tool_policy_version";
|
|
3843
|
+
tableName: "sessions";
|
|
3844
|
+
dataType: "number";
|
|
3845
|
+
columnType: "PgInteger";
|
|
3846
|
+
data: number;
|
|
3847
|
+
driverParam: string | number;
|
|
3848
|
+
notNull: true;
|
|
3849
|
+
hasDefault: true;
|
|
3850
|
+
isPrimaryKey: false;
|
|
3851
|
+
isAutoincrement: false;
|
|
3852
|
+
hasRuntimeDefault: false;
|
|
3853
|
+
enumValues: undefined;
|
|
3854
|
+
baseColumn: never;
|
|
3855
|
+
identity: undefined;
|
|
3856
|
+
generated: undefined;
|
|
3857
|
+
}, {}, {}>;
|
|
3841
3858
|
parentSessionId: drizzle_orm_pg_core.PgColumn<{
|
|
3842
3859
|
name: "parent_session_id";
|
|
3843
3860
|
tableName: "sessions";
|
|
@@ -6079,6 +6096,129 @@ declare const documents: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
6079
6096
|
}, {}, {
|
|
6080
6097
|
$type: string[];
|
|
6081
6098
|
}>;
|
|
6099
|
+
visibility: drizzle_orm_pg_core.PgColumn<{
|
|
6100
|
+
name: "visibility";
|
|
6101
|
+
tableName: "documents";
|
|
6102
|
+
dataType: "string";
|
|
6103
|
+
columnType: "PgText";
|
|
6104
|
+
data: string;
|
|
6105
|
+
driverParam: string;
|
|
6106
|
+
notNull: true;
|
|
6107
|
+
hasDefault: true;
|
|
6108
|
+
isPrimaryKey: false;
|
|
6109
|
+
isAutoincrement: false;
|
|
6110
|
+
hasRuntimeDefault: false;
|
|
6111
|
+
enumValues: [string, ...string[]];
|
|
6112
|
+
baseColumn: never;
|
|
6113
|
+
identity: undefined;
|
|
6114
|
+
generated: undefined;
|
|
6115
|
+
}, {}, {}>;
|
|
6116
|
+
createdBy: drizzle_orm_pg_core.PgColumn<{
|
|
6117
|
+
name: "created_by";
|
|
6118
|
+
tableName: "documents";
|
|
6119
|
+
dataType: "string";
|
|
6120
|
+
columnType: "PgText";
|
|
6121
|
+
data: string;
|
|
6122
|
+
driverParam: string;
|
|
6123
|
+
notNull: false;
|
|
6124
|
+
hasDefault: false;
|
|
6125
|
+
isPrimaryKey: false;
|
|
6126
|
+
isAutoincrement: false;
|
|
6127
|
+
hasRuntimeDefault: false;
|
|
6128
|
+
enumValues: [string, ...string[]];
|
|
6129
|
+
baseColumn: never;
|
|
6130
|
+
identity: undefined;
|
|
6131
|
+
generated: undefined;
|
|
6132
|
+
}, {}, {}>;
|
|
6133
|
+
agentAccess: drizzle_orm_pg_core.PgColumn<{
|
|
6134
|
+
name: "agent_access";
|
|
6135
|
+
tableName: "documents";
|
|
6136
|
+
dataType: "boolean";
|
|
6137
|
+
columnType: "PgBoolean";
|
|
6138
|
+
data: boolean;
|
|
6139
|
+
driverParam: boolean;
|
|
6140
|
+
notNull: true;
|
|
6141
|
+
hasDefault: true;
|
|
6142
|
+
isPrimaryKey: false;
|
|
6143
|
+
isAutoincrement: false;
|
|
6144
|
+
hasRuntimeDefault: false;
|
|
6145
|
+
enumValues: undefined;
|
|
6146
|
+
baseColumn: never;
|
|
6147
|
+
identity: undefined;
|
|
6148
|
+
generated: undefined;
|
|
6149
|
+
}, {}, {}>;
|
|
6150
|
+
summary: drizzle_orm_pg_core.PgColumn<{
|
|
6151
|
+
name: "summary";
|
|
6152
|
+
tableName: "documents";
|
|
6153
|
+
dataType: "string";
|
|
6154
|
+
columnType: "PgText";
|
|
6155
|
+
data: string;
|
|
6156
|
+
driverParam: string;
|
|
6157
|
+
notNull: false;
|
|
6158
|
+
hasDefault: false;
|
|
6159
|
+
isPrimaryKey: false;
|
|
6160
|
+
isAutoincrement: false;
|
|
6161
|
+
hasRuntimeDefault: false;
|
|
6162
|
+
enumValues: [string, ...string[]];
|
|
6163
|
+
baseColumn: never;
|
|
6164
|
+
identity: undefined;
|
|
6165
|
+
generated: undefined;
|
|
6166
|
+
}, {}, {}>;
|
|
6167
|
+
topics: drizzle_orm_pg_core.PgColumn<{
|
|
6168
|
+
name: "topics";
|
|
6169
|
+
tableName: "documents";
|
|
6170
|
+
dataType: "json";
|
|
6171
|
+
columnType: "PgJsonb";
|
|
6172
|
+
data: string[];
|
|
6173
|
+
driverParam: unknown;
|
|
6174
|
+
notNull: true;
|
|
6175
|
+
hasDefault: true;
|
|
6176
|
+
isPrimaryKey: false;
|
|
6177
|
+
isAutoincrement: false;
|
|
6178
|
+
hasRuntimeDefault: false;
|
|
6179
|
+
enumValues: undefined;
|
|
6180
|
+
baseColumn: never;
|
|
6181
|
+
identity: undefined;
|
|
6182
|
+
generated: undefined;
|
|
6183
|
+
}, {}, {
|
|
6184
|
+
$type: string[];
|
|
6185
|
+
}>;
|
|
6186
|
+
curationStatus: drizzle_orm_pg_core.PgColumn<{
|
|
6187
|
+
name: "curation_status";
|
|
6188
|
+
tableName: "documents";
|
|
6189
|
+
dataType: "string";
|
|
6190
|
+
columnType: "PgText";
|
|
6191
|
+
data: string;
|
|
6192
|
+
driverParam: string;
|
|
6193
|
+
notNull: true;
|
|
6194
|
+
hasDefault: true;
|
|
6195
|
+
isPrimaryKey: false;
|
|
6196
|
+
isAutoincrement: false;
|
|
6197
|
+
hasRuntimeDefault: false;
|
|
6198
|
+
enumValues: [string, ...string[]];
|
|
6199
|
+
baseColumn: never;
|
|
6200
|
+
identity: undefined;
|
|
6201
|
+
generated: undefined;
|
|
6202
|
+
}, {}, {}>;
|
|
6203
|
+
curation: drizzle_orm_pg_core.PgColumn<{
|
|
6204
|
+
name: "curation";
|
|
6205
|
+
tableName: "documents";
|
|
6206
|
+
dataType: "json";
|
|
6207
|
+
columnType: "PgJsonb";
|
|
6208
|
+
data: Record<string, unknown>;
|
|
6209
|
+
driverParam: unknown;
|
|
6210
|
+
notNull: false;
|
|
6211
|
+
hasDefault: false;
|
|
6212
|
+
isPrimaryKey: false;
|
|
6213
|
+
isAutoincrement: false;
|
|
6214
|
+
hasRuntimeDefault: false;
|
|
6215
|
+
enumValues: undefined;
|
|
6216
|
+
baseColumn: never;
|
|
6217
|
+
identity: undefined;
|
|
6218
|
+
generated: undefined;
|
|
6219
|
+
}, {}, {
|
|
6220
|
+
$type: Record<string, unknown>;
|
|
6221
|
+
}>;
|
|
6082
6222
|
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
6083
6223
|
name: "created_at";
|
|
6084
6224
|
tableName: "documents";
|
|
@@ -10269,7 +10409,7 @@ declare const codexCapacityWaiters: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
10269
10409
|
columnType: "PgUUID";
|
|
10270
10410
|
data: string;
|
|
10271
10411
|
driverParam: string;
|
|
10272
|
-
notNull:
|
|
10412
|
+
notNull: false;
|
|
10273
10413
|
hasDefault: false;
|
|
10274
10414
|
isPrimaryKey: false;
|
|
10275
10415
|
isAutoincrement: false;
|
|
@@ -10296,6 +10436,23 @@ declare const codexCapacityWaiters: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
10296
10436
|
identity: undefined;
|
|
10297
10437
|
generated: undefined;
|
|
10298
10438
|
}, {}, {}>;
|
|
10439
|
+
blockedTurnGeneration: drizzle_orm_pg_core.PgColumn<{
|
|
10440
|
+
name: "blocked_turn_generation";
|
|
10441
|
+
tableName: "codex_capacity_waiters";
|
|
10442
|
+
dataType: "number";
|
|
10443
|
+
columnType: "PgInteger";
|
|
10444
|
+
data: number;
|
|
10445
|
+
driverParam: string | number;
|
|
10446
|
+
notNull: true;
|
|
10447
|
+
hasDefault: false;
|
|
10448
|
+
isPrimaryKey: false;
|
|
10449
|
+
isAutoincrement: false;
|
|
10450
|
+
hasRuntimeDefault: false;
|
|
10451
|
+
enumValues: undefined;
|
|
10452
|
+
baseColumn: never;
|
|
10453
|
+
identity: undefined;
|
|
10454
|
+
generated: undefined;
|
|
10455
|
+
}, {}, {}>;
|
|
10299
10456
|
workflowId: drizzle_orm_pg_core.PgColumn<{
|
|
10300
10457
|
name: "workflow_id";
|
|
10301
10458
|
tableName: "codex_capacity_waiters";
|
|
@@ -10354,7 +10511,7 @@ declare const codexCapacityWaiters: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
10354
10511
|
columnType: "PgInteger";
|
|
10355
10512
|
data: number;
|
|
10356
10513
|
driverParam: string | number;
|
|
10357
|
-
notNull:
|
|
10514
|
+
notNull: false;
|
|
10358
10515
|
hasDefault: false;
|
|
10359
10516
|
isPrimaryKey: false;
|
|
10360
10517
|
isAutoincrement: false;
|
|
@@ -13410,6 +13567,159 @@ declare const sandboxRetainedProcesses: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
13410
13567
|
identity: undefined;
|
|
13411
13568
|
generated: undefined;
|
|
13412
13569
|
}, {}, {}>;
|
|
13570
|
+
reconcileAfter: drizzle_orm_pg_core.PgColumn<{
|
|
13571
|
+
name: "reconcile_after";
|
|
13572
|
+
tableName: "sandbox_retained_processes";
|
|
13573
|
+
dataType: "date";
|
|
13574
|
+
columnType: "PgTimestamp";
|
|
13575
|
+
data: Date;
|
|
13576
|
+
driverParam: string;
|
|
13577
|
+
notNull: true;
|
|
13578
|
+
hasDefault: true;
|
|
13579
|
+
isPrimaryKey: false;
|
|
13580
|
+
isAutoincrement: false;
|
|
13581
|
+
hasRuntimeDefault: false;
|
|
13582
|
+
enumValues: undefined;
|
|
13583
|
+
baseColumn: never;
|
|
13584
|
+
identity: undefined;
|
|
13585
|
+
generated: undefined;
|
|
13586
|
+
}, {}, {}>;
|
|
13587
|
+
reconcileClaimId: drizzle_orm_pg_core.PgColumn<{
|
|
13588
|
+
name: "reconcile_claim_id";
|
|
13589
|
+
tableName: "sandbox_retained_processes";
|
|
13590
|
+
dataType: "string";
|
|
13591
|
+
columnType: "PgUUID";
|
|
13592
|
+
data: string;
|
|
13593
|
+
driverParam: string;
|
|
13594
|
+
notNull: false;
|
|
13595
|
+
hasDefault: false;
|
|
13596
|
+
isPrimaryKey: false;
|
|
13597
|
+
isAutoincrement: false;
|
|
13598
|
+
hasRuntimeDefault: false;
|
|
13599
|
+
enumValues: undefined;
|
|
13600
|
+
baseColumn: never;
|
|
13601
|
+
identity: undefined;
|
|
13602
|
+
generated: undefined;
|
|
13603
|
+
}, {}, {}>;
|
|
13604
|
+
reconcileClaimedAt: drizzle_orm_pg_core.PgColumn<{
|
|
13605
|
+
name: "reconcile_claimed_at";
|
|
13606
|
+
tableName: "sandbox_retained_processes";
|
|
13607
|
+
dataType: "date";
|
|
13608
|
+
columnType: "PgTimestamp";
|
|
13609
|
+
data: Date;
|
|
13610
|
+
driverParam: string;
|
|
13611
|
+
notNull: false;
|
|
13612
|
+
hasDefault: false;
|
|
13613
|
+
isPrimaryKey: false;
|
|
13614
|
+
isAutoincrement: false;
|
|
13615
|
+
hasRuntimeDefault: false;
|
|
13616
|
+
enumValues: undefined;
|
|
13617
|
+
baseColumn: never;
|
|
13618
|
+
identity: undefined;
|
|
13619
|
+
generated: undefined;
|
|
13620
|
+
}, {}, {}>;
|
|
13621
|
+
reconcileAttempts: drizzle_orm_pg_core.PgColumn<{
|
|
13622
|
+
name: "reconcile_attempts";
|
|
13623
|
+
tableName: "sandbox_retained_processes";
|
|
13624
|
+
dataType: "number";
|
|
13625
|
+
columnType: "PgInteger";
|
|
13626
|
+
data: number;
|
|
13627
|
+
driverParam: string | number;
|
|
13628
|
+
notNull: true;
|
|
13629
|
+
hasDefault: true;
|
|
13630
|
+
isPrimaryKey: false;
|
|
13631
|
+
isAutoincrement: false;
|
|
13632
|
+
hasRuntimeDefault: false;
|
|
13633
|
+
enumValues: undefined;
|
|
13634
|
+
baseColumn: never;
|
|
13635
|
+
identity: undefined;
|
|
13636
|
+
generated: undefined;
|
|
13637
|
+
}, {}, {}>;
|
|
13638
|
+
lastReconcileOutcome: drizzle_orm_pg_core.PgColumn<{
|
|
13639
|
+
name: "last_reconcile_outcome";
|
|
13640
|
+
tableName: "sandbox_retained_processes";
|
|
13641
|
+
dataType: "string";
|
|
13642
|
+
columnType: "PgText";
|
|
13643
|
+
data: string;
|
|
13644
|
+
driverParam: string;
|
|
13645
|
+
notNull: false;
|
|
13646
|
+
hasDefault: false;
|
|
13647
|
+
isPrimaryKey: false;
|
|
13648
|
+
isAutoincrement: false;
|
|
13649
|
+
hasRuntimeDefault: false;
|
|
13650
|
+
enumValues: [string, ...string[]];
|
|
13651
|
+
baseColumn: never;
|
|
13652
|
+
identity: undefined;
|
|
13653
|
+
generated: undefined;
|
|
13654
|
+
}, {}, {}>;
|
|
13655
|
+
reconcileProofOutcome: drizzle_orm_pg_core.PgColumn<{
|
|
13656
|
+
name: "reconcile_proof_outcome";
|
|
13657
|
+
tableName: "sandbox_retained_processes";
|
|
13658
|
+
dataType: "string";
|
|
13659
|
+
columnType: "PgText";
|
|
13660
|
+
data: "exited" | "lost";
|
|
13661
|
+
driverParam: string;
|
|
13662
|
+
notNull: false;
|
|
13663
|
+
hasDefault: false;
|
|
13664
|
+
isPrimaryKey: false;
|
|
13665
|
+
isAutoincrement: false;
|
|
13666
|
+
hasRuntimeDefault: false;
|
|
13667
|
+
enumValues: ["exited", "lost"];
|
|
13668
|
+
baseColumn: never;
|
|
13669
|
+
identity: undefined;
|
|
13670
|
+
generated: undefined;
|
|
13671
|
+
}, {}, {}>;
|
|
13672
|
+
reconcileProofExitCode: drizzle_orm_pg_core.PgColumn<{
|
|
13673
|
+
name: "reconcile_proof_exit_code";
|
|
13674
|
+
tableName: "sandbox_retained_processes";
|
|
13675
|
+
dataType: "number";
|
|
13676
|
+
columnType: "PgInteger";
|
|
13677
|
+
data: number;
|
|
13678
|
+
driverParam: string | number;
|
|
13679
|
+
notNull: false;
|
|
13680
|
+
hasDefault: false;
|
|
13681
|
+
isPrimaryKey: false;
|
|
13682
|
+
isAutoincrement: false;
|
|
13683
|
+
hasRuntimeDefault: false;
|
|
13684
|
+
enumValues: undefined;
|
|
13685
|
+
baseColumn: never;
|
|
13686
|
+
identity: undefined;
|
|
13687
|
+
generated: undefined;
|
|
13688
|
+
}, {}, {}>;
|
|
13689
|
+
reconcileProofReason: drizzle_orm_pg_core.PgColumn<{
|
|
13690
|
+
name: "reconcile_proof_reason";
|
|
13691
|
+
tableName: "sandbox_retained_processes";
|
|
13692
|
+
dataType: "string";
|
|
13693
|
+
columnType: "PgText";
|
|
13694
|
+
data: string;
|
|
13695
|
+
driverParam: string;
|
|
13696
|
+
notNull: false;
|
|
13697
|
+
hasDefault: false;
|
|
13698
|
+
isPrimaryKey: false;
|
|
13699
|
+
isAutoincrement: false;
|
|
13700
|
+
hasRuntimeDefault: false;
|
|
13701
|
+
enumValues: [string, ...string[]];
|
|
13702
|
+
baseColumn: never;
|
|
13703
|
+
identity: undefined;
|
|
13704
|
+
generated: undefined;
|
|
13705
|
+
}, {}, {}>;
|
|
13706
|
+
reconcileProofObservedAt: drizzle_orm_pg_core.PgColumn<{
|
|
13707
|
+
name: "reconcile_proof_observed_at";
|
|
13708
|
+
tableName: "sandbox_retained_processes";
|
|
13709
|
+
dataType: "date";
|
|
13710
|
+
columnType: "PgTimestamp";
|
|
13711
|
+
data: Date;
|
|
13712
|
+
driverParam: string;
|
|
13713
|
+
notNull: false;
|
|
13714
|
+
hasDefault: false;
|
|
13715
|
+
isPrimaryKey: false;
|
|
13716
|
+
isAutoincrement: false;
|
|
13717
|
+
hasRuntimeDefault: false;
|
|
13718
|
+
enumValues: undefined;
|
|
13719
|
+
baseColumn: never;
|
|
13720
|
+
identity: undefined;
|
|
13721
|
+
generated: undefined;
|
|
13722
|
+
}, {}, {}>;
|
|
13413
13723
|
};
|
|
13414
13724
|
dialect: "pg";
|
|
13415
13725
|
}>;
|
|
@@ -16438,6 +16748,23 @@ declare const githubInstallations: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
16438
16748
|
identity: undefined;
|
|
16439
16749
|
generated: undefined;
|
|
16440
16750
|
}, {}, {}>;
|
|
16751
|
+
githubAccountId: drizzle_orm_pg_core.PgColumn<{
|
|
16752
|
+
name: "github_account_id";
|
|
16753
|
+
tableName: "github_installations";
|
|
16754
|
+
dataType: "number";
|
|
16755
|
+
columnType: "PgBigInt53";
|
|
16756
|
+
data: number;
|
|
16757
|
+
driverParam: string | number;
|
|
16758
|
+
notNull: false;
|
|
16759
|
+
hasDefault: false;
|
|
16760
|
+
isPrimaryKey: false;
|
|
16761
|
+
isAutoincrement: false;
|
|
16762
|
+
hasRuntimeDefault: false;
|
|
16763
|
+
enumValues: undefined;
|
|
16764
|
+
baseColumn: never;
|
|
16765
|
+
identity: undefined;
|
|
16766
|
+
generated: undefined;
|
|
16767
|
+
}, {}, {}>;
|
|
16441
16768
|
accountLogin: drizzle_orm_pg_core.PgColumn<{
|
|
16442
16769
|
name: "account_login";
|
|
16443
16770
|
tableName: "github_installations";
|
|
@@ -16506,6 +16833,108 @@ declare const githubInstallations: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
16506
16833
|
identity: undefined;
|
|
16507
16834
|
generated: undefined;
|
|
16508
16835
|
}, {}, {}>;
|
|
16836
|
+
githubActorId: drizzle_orm_pg_core.PgColumn<{
|
|
16837
|
+
name: "github_actor_id";
|
|
16838
|
+
tableName: "github_installations";
|
|
16839
|
+
dataType: "number";
|
|
16840
|
+
columnType: "PgBigInt53";
|
|
16841
|
+
data: number;
|
|
16842
|
+
driverParam: string | number;
|
|
16843
|
+
notNull: false;
|
|
16844
|
+
hasDefault: false;
|
|
16845
|
+
isPrimaryKey: false;
|
|
16846
|
+
isAutoincrement: false;
|
|
16847
|
+
hasRuntimeDefault: false;
|
|
16848
|
+
enumValues: undefined;
|
|
16849
|
+
baseColumn: never;
|
|
16850
|
+
identity: undefined;
|
|
16851
|
+
generated: undefined;
|
|
16852
|
+
}, {}, {}>;
|
|
16853
|
+
githubActorLogin: drizzle_orm_pg_core.PgColumn<{
|
|
16854
|
+
name: "github_actor_login";
|
|
16855
|
+
tableName: "github_installations";
|
|
16856
|
+
dataType: "string";
|
|
16857
|
+
columnType: "PgText";
|
|
16858
|
+
data: string;
|
|
16859
|
+
driverParam: string;
|
|
16860
|
+
notNull: false;
|
|
16861
|
+
hasDefault: false;
|
|
16862
|
+
isPrimaryKey: false;
|
|
16863
|
+
isAutoincrement: false;
|
|
16864
|
+
hasRuntimeDefault: false;
|
|
16865
|
+
enumValues: [string, ...string[]];
|
|
16866
|
+
baseColumn: never;
|
|
16867
|
+
identity: undefined;
|
|
16868
|
+
generated: undefined;
|
|
16869
|
+
}, {}, {}>;
|
|
16870
|
+
authorityKind: drizzle_orm_pg_core.PgColumn<{
|
|
16871
|
+
name: "authority_kind";
|
|
16872
|
+
tableName: "github_installations";
|
|
16873
|
+
dataType: "string";
|
|
16874
|
+
columnType: "PgText";
|
|
16875
|
+
data: string;
|
|
16876
|
+
driverParam: string;
|
|
16877
|
+
notNull: false;
|
|
16878
|
+
hasDefault: false;
|
|
16879
|
+
isPrimaryKey: false;
|
|
16880
|
+
isAutoincrement: false;
|
|
16881
|
+
hasRuntimeDefault: false;
|
|
16882
|
+
enumValues: [string, ...string[]];
|
|
16883
|
+
baseColumn: never;
|
|
16884
|
+
identity: undefined;
|
|
16885
|
+
generated: undefined;
|
|
16886
|
+
}, {}, {}>;
|
|
16887
|
+
authorityCheckedAt: drizzle_orm_pg_core.PgColumn<{
|
|
16888
|
+
name: "authority_checked_at";
|
|
16889
|
+
tableName: "github_installations";
|
|
16890
|
+
dataType: "date";
|
|
16891
|
+
columnType: "PgTimestamp";
|
|
16892
|
+
data: Date;
|
|
16893
|
+
driverParam: string;
|
|
16894
|
+
notNull: false;
|
|
16895
|
+
hasDefault: false;
|
|
16896
|
+
isPrimaryKey: false;
|
|
16897
|
+
isAutoincrement: false;
|
|
16898
|
+
hasRuntimeDefault: false;
|
|
16899
|
+
enumValues: undefined;
|
|
16900
|
+
baseColumn: never;
|
|
16901
|
+
identity: undefined;
|
|
16902
|
+
generated: undefined;
|
|
16903
|
+
}, {}, {}>;
|
|
16904
|
+
authorityExpiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
16905
|
+
name: "authority_expires_at";
|
|
16906
|
+
tableName: "github_installations";
|
|
16907
|
+
dataType: "date";
|
|
16908
|
+
columnType: "PgTimestamp";
|
|
16909
|
+
data: Date;
|
|
16910
|
+
driverParam: string;
|
|
16911
|
+
notNull: false;
|
|
16912
|
+
hasDefault: false;
|
|
16913
|
+
isPrimaryKey: false;
|
|
16914
|
+
isAutoincrement: false;
|
|
16915
|
+
hasRuntimeDefault: false;
|
|
16916
|
+
enumValues: undefined;
|
|
16917
|
+
baseColumn: never;
|
|
16918
|
+
identity: undefined;
|
|
16919
|
+
generated: undefined;
|
|
16920
|
+
}, {}, {}>;
|
|
16921
|
+
authorityNonce: drizzle_orm_pg_core.PgColumn<{
|
|
16922
|
+
name: "authority_nonce";
|
|
16923
|
+
tableName: "github_installations";
|
|
16924
|
+
dataType: "string";
|
|
16925
|
+
columnType: "PgText";
|
|
16926
|
+
data: string;
|
|
16927
|
+
driverParam: string;
|
|
16928
|
+
notNull: false;
|
|
16929
|
+
hasDefault: false;
|
|
16930
|
+
isPrimaryKey: false;
|
|
16931
|
+
isAutoincrement: false;
|
|
16932
|
+
hasRuntimeDefault: false;
|
|
16933
|
+
enumValues: [string, ...string[]];
|
|
16934
|
+
baseColumn: never;
|
|
16935
|
+
identity: undefined;
|
|
16936
|
+
generated: undefined;
|
|
16937
|
+
}, {}, {}>;
|
|
16509
16938
|
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
16510
16939
|
name: "created_at";
|
|
16511
16940
|
tableName: "github_installations";
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/pg-core';
|
|
3
|
-
export { o as agentRunStates, p as apiKeys, q as auditEvents, r as billingCustomers, t as capabilityCatalogItems, u as capabilityInstallations, v as codexCapacityWaiters, x as codexCredentialLeases, y as codexResetRedemptionAttempts, z as codexRotationSettings, A as codexSubscriptionCredentials, d as composerDrafts, B as connections, C as creditLedgerEntries, D as deviceEnrollmentRequests, h as deviceEnrollmentStatusValues, E as documentBases, F as documentChunks, G as documents, g as enrollmentExposureValues, f as enrollmentOsValues, i as enrollmentStatusValues, H as enrollments, I as fileUploads, J as files, K as githubInstallationRepositories, L as githubInstallations, M as hostExportConfig, N as hostExportConsumers, O as hostExportCursorState, P as hostExportDeadLetters, Q as hostExportOutbox, R as importBatches, S as integrationOauthClients, T as integrationOauthStateNonces, U as knowledgeMemories, V as machineMetricsLatest, W as machineMetricsSeries, X as managedAccounts, Y as nestedAgentDepthConfiguration, n as newSessionDrafts, Z as packInstallations, _ as rigChanges, $ as rigVersions, a0 as rigs, j as sandboxKindValues, a1 as sandboxLeaseHolders, a2 as sandboxLeaseLivenessValues, a3 as sandboxLeases, a4 as sandboxPtySessions, a5 as sandboxRetainedProcessStateValues, a6 as sandboxRetainedProcesses, a7 as sandboxSessionEnvelopes, a8 as sandboxWorkspaceMutationActorKindValues, a9 as sandboxWorkspaceMutationAdmissions, aa as sandboxWorkspaceMutationHolderKindValues, ab as sandboxes, ac as scheduledTaskRuns, ad as scheduledTasks, ae as sessionAttemptInterruptions, s as sessionCommandReceipts, af as sessionEvents, ag as sessionGoals, ah as sessionHistoryItems, ai as sessionHumanInputRequests, aj as sessionListSnapshots, ak as sessionMcpServers, al as sessionPendingToolCalls, am as sessionPins, k as sessionRecordingCodecValues, l as sessionRecordingModeValues, m as sessionRecordingStateValues, an as sessionRecordings, ao as sessionSpawnDenials, ap as sessionSystemUpdateOutbox, aq as sessionSystemUpdates, c as sessionTurnAttempts, b as sessionTurns, ar as sessionWorkflowWakeOutbox, a as sessions, as as socialConnections, at as socialPosts, au as stripeWebhookEvents, av as usageEvents, aw as workspaceCaptures, ax as workspaceControlEvents, ay as workspaceInferenceControls, az as workspaceMemberships, aA as workspaceModelPolicies, aB as workspacePacks, aC as workspaceSessionActivityRevisions, aD as workspaceVariableSetVariables, aE as workspaceVariableSets, w as workspaces } from './schema-
|
|
3
|
+
export { o as agentRunStates, p as apiKeys, q as auditEvents, r as billingCustomers, t as capabilityCatalogItems, u as capabilityInstallations, v as codexCapacityWaiters, x as codexCredentialLeases, y as codexResetRedemptionAttempts, z as codexRotationSettings, A as codexSubscriptionCredentials, d as composerDrafts, B as connections, C as creditLedgerEntries, D as deviceEnrollmentRequests, h as deviceEnrollmentStatusValues, E as documentBases, F as documentChunks, G as documents, g as enrollmentExposureValues, f as enrollmentOsValues, i as enrollmentStatusValues, H as enrollments, I as fileUploads, J as files, K as githubInstallationRepositories, L as githubInstallations, M as hostExportConfig, N as hostExportConsumers, O as hostExportCursorState, P as hostExportDeadLetters, Q as hostExportOutbox, R as importBatches, S as integrationOauthClients, T as integrationOauthStateNonces, U as knowledgeMemories, V as machineMetricsLatest, W as machineMetricsSeries, X as managedAccounts, Y as nestedAgentDepthConfiguration, n as newSessionDrafts, Z as packInstallations, _ as rigChanges, $ as rigVersions, a0 as rigs, j as sandboxKindValues, a1 as sandboxLeaseHolders, a2 as sandboxLeaseLivenessValues, a3 as sandboxLeases, a4 as sandboxPtySessions, a5 as sandboxRetainedProcessStateValues, a6 as sandboxRetainedProcesses, a7 as sandboxSessionEnvelopes, a8 as sandboxWorkspaceMutationActorKindValues, a9 as sandboxWorkspaceMutationAdmissions, aa as sandboxWorkspaceMutationHolderKindValues, ab as sandboxes, ac as scheduledTaskRuns, ad as scheduledTasks, ae as sessionAttemptInterruptions, s as sessionCommandReceipts, af as sessionEvents, ag as sessionGoals, ah as sessionHistoryItems, ai as sessionHumanInputRequests, aj as sessionListSnapshots, ak as sessionMcpServers, al as sessionPendingToolCalls, am as sessionPins, k as sessionRecordingCodecValues, l as sessionRecordingModeValues, m as sessionRecordingStateValues, an as sessionRecordings, ao as sessionSpawnDenials, ap as sessionSystemUpdateOutbox, aq as sessionSystemUpdates, c as sessionTurnAttempts, b as sessionTurns, ar as sessionWorkflowWakeOutbox, a as sessions, as as socialConnections, at as socialPosts, au as stripeWebhookEvents, av as usageEvents, aw as workspaceCaptures, ax as workspaceControlEvents, ay as workspaceInferenceControls, az as workspaceMemberships, aA as workspaceModelPolicies, aB as workspacePacks, aC as workspaceSessionActivityRevisions, aD as workspaceVariableSetVariables, aE as workspaceVariableSets, w as workspaces } from './schema-CeXWlYcG.js';
|
package/dist/schema.js
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
-- deployment-mode: maintenance
|
|
2
|
+
-- This changes the waiter/worker contract in one no-overlap cutover: old
|
|
3
|
+
-- workers terminally settled capacity waits, while new workers preserve the
|
|
4
|
+
-- same logical turn. Do not run old and new workers concurrently.
|
|
5
|
+
|
|
6
|
+
ALTER TABLE "session_turn_attempts"
|
|
7
|
+
DROP CONSTRAINT "session_turn_attempts_outcome_check";
|
|
8
|
+
ALTER TABLE "session_turn_attempts"
|
|
9
|
+
ADD CONSTRAINT "session_turn_attempts_outcome_check"
|
|
10
|
+
CHECK (
|
|
11
|
+
"outcome" IS NULL OR "outcome" IN (
|
|
12
|
+
'completed', 'failed', 'cancelled', 'superseded', 'requires_action',
|
|
13
|
+
'waiting_capacity', 'interrupted_recoverable',
|
|
14
|
+
'lease_lost_recoverable', 'pre_cutover_closed'
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
-- A waiter is turn-owned. Goal identity is only an optional generation fence,
|
|
19
|
+
-- so goal-less prompts can wait and goal deletion cannot cascade away the
|
|
20
|
+
-- durable ledger before reconciliation supersedes the blocked turn.
|
|
21
|
+
ALTER TABLE "codex_capacity_waiters"
|
|
22
|
+
DROP CONSTRAINT "codex_capacity_waiters_workspace_goal_fk";
|
|
23
|
+
ALTER TABLE "codex_capacity_waiters"
|
|
24
|
+
ALTER COLUMN "goal_id" DROP NOT NULL,
|
|
25
|
+
ALTER COLUMN "goal_version" DROP NOT NULL,
|
|
26
|
+
ADD COLUMN "blocked_turn_generation" integer;
|
|
27
|
+
|
|
28
|
+
UPDATE "codex_capacity_waiters" waiter
|
|
29
|
+
SET "blocked_turn_generation" = turn."execution_generation"
|
|
30
|
+
FROM "session_turns" turn
|
|
31
|
+
WHERE turn."workspace_id" = waiter."workspace_id"
|
|
32
|
+
AND turn."id" = waiter."blocked_turn_id";
|
|
33
|
+
|
|
34
|
+
DO $audit$
|
|
35
|
+
BEGIN
|
|
36
|
+
IF EXISTS (
|
|
37
|
+
SELECT 1
|
|
38
|
+
FROM "codex_capacity_waiters"
|
|
39
|
+
WHERE "blocked_turn_generation" IS NULL
|
|
40
|
+
OR "blocked_turn_generation" < 1
|
|
41
|
+
OR (("goal_id" IS NULL) <> ("goal_version" IS NULL))
|
|
42
|
+
OR ("goal_version" IS NOT NULL AND "goal_version" < 1)
|
|
43
|
+
) THEN
|
|
44
|
+
RAISE EXCEPTION 'codex capacity same-turn backfill found an invalid waiter';
|
|
45
|
+
END IF;
|
|
46
|
+
END $audit$;
|
|
47
|
+
|
|
48
|
+
ALTER TABLE "codex_capacity_waiters"
|
|
49
|
+
ALTER COLUMN "blocked_turn_generation" SET NOT NULL,
|
|
50
|
+
DROP CONSTRAINT IF EXISTS "codex_capacity_waiters_generation_check",
|
|
51
|
+
ADD CONSTRAINT "codex_capacity_waiters_generation_check"
|
|
52
|
+
CHECK (
|
|
53
|
+
"generation" > 0
|
|
54
|
+
AND "blocked_turn_generation" > 0
|
|
55
|
+
AND (
|
|
56
|
+
("goal_id" IS NULL AND "goal_version" IS NULL)
|
|
57
|
+
OR ("goal_id" IS NOT NULL AND "goal_version" > 0)
|
|
58
|
+
)
|
|
59
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- deployment-mode: rolling
|
|
2
|
+
|
|
3
|
+
-- A durable policy mutation is fenced independently from the global event
|
|
4
|
+
-- sequence. The default keeps old writers safe during the rolling upgrade;
|
|
5
|
+
-- the policy update command advances this value with a locked SQL CAS.
|
|
6
|
+
ALTER TABLE "sessions"
|
|
7
|
+
ADD COLUMN IF NOT EXISTS "tool_policy_version" integer NOT NULL DEFAULT 1;
|
|
8
|
+
|
|
9
|
+
ALTER TABLE "sessions"
|
|
10
|
+
DROP CONSTRAINT IF EXISTS "sessions_tool_policy_version_check";
|
|
11
|
+
|
|
12
|
+
ALTER TABLE "sessions"
|
|
13
|
+
ADD CONSTRAINT "sessions_tool_policy_version_check"
|
|
14
|
+
CHECK ("tool_policy_version" >= 1) NOT VALID;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-- deployment-mode: rolling
|
|
2
|
+
-- Knowledge drops: auto-curation + per-document visibility.
|
|
3
|
+
-- Follows 0041_knowledge_layer.sql conventions: IF NOT EXISTS column adds only.
|
|
4
|
+
-- NO policy changes (documents already has FORCE RLS + workspace_isolation from 0041).
|
|
5
|
+
--
|
|
6
|
+
-- visibility: 'workspace' (anyone in the workspace) | 'private' (creator only).
|
|
7
|
+
-- created_by: the access-grant subject id that created the document (text — subject
|
|
8
|
+
-- ids are labels like 'dev' or 'api_key:<uuid>', not uuids). NULL for pre-existing
|
|
9
|
+
-- rows, which stay workspace-visible.
|
|
10
|
+
-- agent_access: whether agent retrieval surfaces (docs MCP tools) may return the
|
|
11
|
+
-- document. Humans keep REST access regardless.
|
|
12
|
+
-- curation_status: 'none' (ordinary add, caller supplied metadata) | 'pending'
|
|
13
|
+
-- (dropped, awaiting auto-curation) | 'suggested' (curated; base move NOT applied)
|
|
14
|
+
-- | 'auto_filed' (curated and moved to the suggested base) | 'failed' (curation
|
|
15
|
+
-- errored; document still indexes).
|
|
16
|
+
-- curation: the curator output audit blob {suggestedBaseId, suggestedBaseName,
|
|
17
|
+
-- confidence, reason, originalTitle, model}.
|
|
18
|
+
|
|
19
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "visibility" text NOT NULL DEFAULT 'workspace';
|
|
20
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "created_by" text;
|
|
21
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "agent_access" boolean NOT NULL DEFAULT true;
|
|
22
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "summary" text;
|
|
23
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "topics" jsonb NOT NULL DEFAULT '[]'::jsonb;
|
|
24
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "curation_status" text NOT NULL DEFAULT 'none';
|
|
25
|
+
ALTER TABLE "documents" ADD COLUMN IF NOT EXISTS "curation" jsonb;
|
|
26
|
+
|
|
27
|
+
-- Drop review surface: list pending/suggested drops per workspace cheaply.
|
|
28
|
+
CREATE INDEX IF NOT EXISTS "documents_workspace_curation_status_idx"
|
|
29
|
+
ON "documents" ("workspace_id", "curation_status");
|