@intx/db 0.2.2 → 0.4.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/README.md +13 -2
- package/dist/approval-store.d.ts +59 -0
- package/dist/approval-store.js +92 -0
- package/dist/asset-resolution.d.ts +2 -2
- package/dist/backfill-principal-keys.d.ts +9 -0
- package/dist/backfill-principal-keys.js +51 -0
- package/dist/client.d.ts +37 -2
- package/dist/client.js +6 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -0
- package/dist/connection.js +12 -8
- package/dist/credential-resolution.d.ts +181 -20
- package/dist/credential-resolution.js +251 -3
- package/dist/grant-store.js +35 -13
- package/dist/index.d.ts +20 -5
- package/dist/index.js +19 -5
- package/dist/model-source-resolution.d.ts +54 -7
- package/dist/model-source-resolution.js +177 -22
- package/dist/parse-row.d.ts +245 -34
- package/dist/parse-row.js +117 -18
- package/dist/principal-key-store.d.ts +51 -0
- package/dist/principal-key-store.js +82 -0
- package/dist/principal-store.d.ts +44 -0
- package/dist/principal-store.js +67 -0
- package/dist/rekey-credential-secrets.d.ts +13 -0
- package/dist/rekey-credential-secrets.js +61 -0
- package/dist/schema/approvals.d.ts +245 -0
- package/dist/schema/approvals.js +57 -0
- package/dist/schema/catalog.d.ts +17 -0
- package/dist/schema/catalog.js +7 -1
- package/dist/schema/credentials.d.ts +1 -1
- package/dist/schema/git-tokens.js +1 -1
- package/dist/schema/grants.js +8 -2
- package/dist/schema/index.d.ts +10 -4
- package/dist/schema/index.js +10 -4
- package/dist/schema/messages.d.ts +5 -5
- package/dist/schema/messages.js +20 -9
- package/dist/schema/offerings.js +8 -2
- package/dist/schema/{workflow-deployments.d.ts → principal-keys.d.ts} +29 -32
- package/dist/schema/principal-keys.js +28 -0
- package/dist/schema/principals.d.ts +2 -2
- package/dist/schema/principals.js +7 -5
- package/dist/schema/providers.d.ts +17 -0
- package/dist/schema/providers.js +5 -0
- package/dist/schema/roles.js +6 -2
- package/dist/schema/session-assets.d.ts +1 -38
- package/dist/schema/session-assets.js +36 -19
- package/dist/schema/sessions.js +7 -2
- package/dist/schema/sidecar-allocation.d.ts +385 -0
- package/dist/schema/sidecar-allocation.js +53 -0
- package/dist/schema/sidecar.d.ts +2 -2
- package/dist/schema/sidecar.js +3 -1
- package/dist/schema/signal-correlations.d.ts +177 -0
- package/dist/schema/signal-correlations.js +31 -0
- package/dist/schema/tenants.js +13 -3
- package/dist/schema/wallets.d.ts +3 -3
- package/dist/schema/wallets.js +4 -2
- package/dist/schema/{agents.d.ts → workflow-definitions.d.ts} +79 -113
- package/dist/schema/workflow-definitions.js +97 -0
- package/dist/schema/workflow-probe.d.ts +358 -0
- package/dist/schema/workflow-probe.js +51 -0
- package/dist/schema/workflow-run-dispatch.d.ts +345 -0
- package/dist/schema/workflow-run-dispatch.js +63 -0
- package/dist/schema/{agent-assets.d.ts → workflow-run-execution.d.ts} +44 -27
- package/dist/schema/workflow-run-execution.js +48 -0
- package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
- package/dist/schema/workflow-run-launch-spec.js +26 -0
- package/dist/schema/{instances.d.ts → workflow-run.d.ts} +61 -66
- package/dist/schema/workflow-run.js +110 -0
- package/dist/sender-key-resolver.d.ts +91 -0
- package/dist/sender-key-resolver.js +184 -0
- package/dist/sidecar-allocation-store.d.ts +206 -0
- package/dist/sidecar-allocation-store.js +714 -0
- package/dist/signal-correlation-store.d.ts +36 -0
- package/dist/signal-correlation-store.js +63 -0
- package/dist/signer-identity.d.ts +12 -0
- package/dist/signer-identity.js +15 -0
- package/dist/tenant-hierarchy.d.ts +4 -1
- package/dist/tenant-hierarchy.js +37 -5
- package/dist/workflow-definition-store.d.ts +55 -0
- package/dist/workflow-definition-store.js +93 -0
- package/dist/workflow-probe-store.d.ts +47 -0
- package/dist/workflow-probe-store.js +124 -0
- package/dist/workflow-run-dispatch-store.d.ts +83 -0
- package/dist/workflow-run-dispatch-store.js +308 -0
- package/dist/workflow-run-launch-spec-store.d.ts +13 -0
- package/dist/workflow-run-launch-spec-store.js +30 -0
- package/dist/workflow-run-store.d.ts +54 -0
- package/dist/workflow-run-store.js +85 -0
- package/migrations/0037_credential_use_backfill.sql +39 -0
- package/migrations/0038_chilly_blacklash.sql +37 -0
- package/migrations/0039_quick_carnage.sql +2 -0
- package/migrations/0040_reshape_approval_origin.sql +24 -0
- package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
- package/migrations/0042_youthful_mantis.sql +2 -0
- package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
- package/migrations/0044_model_offering_quirks.sql +1 -0
- package/migrations/0045_create_workflow_run.sql +13 -0
- package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
- package/migrations/0047_create_workflow_definition.sql +30 -0
- package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
- package/migrations/0049_curly_omega_flight.sql +2 -0
- package/migrations/0050_late_crystal.sql +10 -0
- package/migrations/0051_funny_madelyne_pryor.sql +1 -0
- package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
- package/migrations/0053_session_mail_session_id_index.sql +1 -0
- package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
- package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
- package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
- package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
- package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
- package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
- package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
- package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
- package/migrations/0062_drop_agent_asset_table.sql +11 -0
- package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
- package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
- package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
- package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
- package/migrations/0067_add_workflow_definition_kind.sql +10 -0
- package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
- package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
- package/migrations/0070_flashy_proteus.sql +13 -0
- package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
- package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
- package/migrations/0074_add_provider_api_base_url.sql +1 -0
- package/migrations/0075_workflow_run_launch_spec.sql +17 -0
- package/migrations/0076_sidecar_allocation.sql +40 -0
- package/migrations/0077_workflow_run_dispatch.sql +29 -0
- package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
- package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
- package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
- package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
- package/migrations/0082_blue_black_queen.sql +1 -0
- package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
- package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
- package/migrations/0085_add_approval_run_idx.sql +1 -0
- package/migrations/0086_cool_human_cannonball.sql +1 -0
- package/migrations/0087_drop_sidecar_placement.sql +3 -0
- package/migrations/0088_thick_sprite.sql +32 -0
- package/migrations/0089_tense_selene.sql +13 -0
- package/migrations/0090_tenant_domain_lower_unique.sql +2 -0
- package/migrations/0091_workflow_run_dispatch_sender_address.sql +21 -0
- package/migrations/0092_sidecar_destroy_failed.sql +4 -0
- package/migrations/0093_sidecar_initialization.sql +2 -0
- package/migrations/meta/0037_snapshot.json +3237 -0
- package/migrations/meta/0038_snapshot.json +3470 -0
- package/migrations/meta/0039_snapshot.json +3470 -0
- package/migrations/meta/0040_snapshot.json +3489 -0
- package/migrations/meta/0041_snapshot.json +3489 -0
- package/migrations/meta/0042_snapshot.json +3489 -0
- package/migrations/meta/0043_snapshot.json +3498 -0
- package/migrations/meta/0044_snapshot.json +3504 -0
- package/migrations/meta/0045_snapshot.json +3589 -0
- package/migrations/meta/0046_snapshot.json +3607 -0
- package/migrations/meta/0047_snapshot.json +3832 -0
- package/migrations/meta/0048_snapshot.json +3853 -0
- package/migrations/meta/0049_snapshot.json +3854 -0
- package/migrations/meta/0050_snapshot.json +3924 -0
- package/migrations/meta/0051_snapshot.json +3940 -0
- package/migrations/meta/0052_snapshot.json +3931 -0
- package/migrations/meta/0053_snapshot.json +3952 -0
- package/migrations/meta/0054_snapshot.json +3952 -0
- package/migrations/meta/0055_snapshot.json +3952 -0
- package/migrations/meta/0056_snapshot.json +3952 -0
- package/migrations/meta/0057_snapshot.json +3839 -0
- package/migrations/meta/0058_snapshot.json +3839 -0
- package/migrations/meta/0059_snapshot.json +3839 -0
- package/migrations/meta/0060_snapshot.json +3830 -0
- package/migrations/meta/0061_snapshot.json +3821 -0
- package/migrations/meta/0062_snapshot.json +3723 -0
- package/migrations/meta/0063_snapshot.json +3723 -0
- package/migrations/meta/0064_snapshot.json +3723 -0
- package/migrations/meta/0065_snapshot.json +3729 -0
- package/migrations/meta/0066_snapshot.json +3729 -0
- package/migrations/meta/0067_snapshot.json +3736 -0
- package/migrations/meta/0068_snapshot.json +3347 -0
- package/migrations/meta/0069_snapshot.json +3340 -0
- package/migrations/meta/0070_snapshot.json +3444 -0
- package/migrations/meta/0072_snapshot.json +3450 -0
- package/migrations/meta/0073_snapshot.json +3455 -0
- package/migrations/meta/0074_snapshot.json +3461 -0
- package/migrations/meta/0075_snapshot.json +3567 -0
- package/migrations/meta/0076_snapshot.json +3851 -0
- package/migrations/meta/0077_snapshot.json +4067 -0
- package/migrations/meta/0078_snapshot.json +4078 -0
- package/migrations/meta/0079_snapshot.json +4078 -0
- package/migrations/meta/0080_snapshot.json +4078 -0
- package/migrations/meta/0081_snapshot.json +4096 -0
- package/migrations/meta/0082_snapshot.json +4102 -0
- package/migrations/meta/0083_snapshot.json +4096 -0
- package/migrations/meta/0084_snapshot.json +4096 -0
- package/migrations/meta/0085_snapshot.json +4111 -0
- package/migrations/meta/0086_snapshot.json +4117 -0
- package/migrations/meta/0087_snapshot.json +4100 -0
- package/migrations/meta/0088_snapshot.json +4286 -0
- package/migrations/meta/0089_snapshot.json +4376 -0
- package/migrations/meta/0090_snapshot.json +4387 -0
- package/migrations/meta/0091_snapshot.json +4397 -0
- package/migrations/meta/0092_snapshot.json +4397 -0
- package/migrations/meta/0093_snapshot.json +4407 -0
- package/migrations/meta/_journal.json +392 -0
- package/package.json +7 -3
- package/dist/schema/agent-assets.js +0 -15
- package/dist/schema/agents.js +0 -57
- package/dist/schema/instances.js +0 -39
- package/dist/schema/workflow-deployments.js +0 -37
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
export declare const approval: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "approval";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: "id";
|
|
7
|
+
tableName: "approval";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "PgText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
tenantId: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "tenant_id";
|
|
24
|
+
tableName: "approval";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgText";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: true;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
anchorRunId: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "anchor_run_id";
|
|
41
|
+
tableName: "approval";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: true;
|
|
47
|
+
hasDefault: false;
|
|
48
|
+
isPrimaryKey: false;
|
|
49
|
+
isAutoincrement: false;
|
|
50
|
+
hasRuntimeDefault: false;
|
|
51
|
+
enumValues: [string, ...string[]];
|
|
52
|
+
baseColumn: never;
|
|
53
|
+
identity: undefined;
|
|
54
|
+
generated: undefined;
|
|
55
|
+
}, {}, {}>;
|
|
56
|
+
runId: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
+
name: "run_id";
|
|
58
|
+
tableName: "approval";
|
|
59
|
+
dataType: "string";
|
|
60
|
+
columnType: "PgText";
|
|
61
|
+
data: string;
|
|
62
|
+
driverParam: string;
|
|
63
|
+
notNull: true;
|
|
64
|
+
hasDefault: false;
|
|
65
|
+
isPrimaryKey: false;
|
|
66
|
+
isAutoincrement: false;
|
|
67
|
+
hasRuntimeDefault: false;
|
|
68
|
+
enumValues: [string, ...string[]];
|
|
69
|
+
baseColumn: never;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}, {}, {}>;
|
|
73
|
+
agentAddress: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "agent_address";
|
|
75
|
+
tableName: "approval";
|
|
76
|
+
dataType: "string";
|
|
77
|
+
columnType: "PgText";
|
|
78
|
+
data: string;
|
|
79
|
+
driverParam: string;
|
|
80
|
+
notNull: true;
|
|
81
|
+
hasDefault: false;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: [string, ...string[]];
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
90
|
+
correlationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
+
name: "correlation_id";
|
|
92
|
+
tableName: "approval";
|
|
93
|
+
dataType: "string";
|
|
94
|
+
columnType: "PgText";
|
|
95
|
+
data: string;
|
|
96
|
+
driverParam: string;
|
|
97
|
+
notNull: true;
|
|
98
|
+
hasDefault: false;
|
|
99
|
+
isPrimaryKey: false;
|
|
100
|
+
isAutoincrement: false;
|
|
101
|
+
hasRuntimeDefault: false;
|
|
102
|
+
enumValues: [string, ...string[]];
|
|
103
|
+
baseColumn: never;
|
|
104
|
+
identity: undefined;
|
|
105
|
+
generated: undefined;
|
|
106
|
+
}, {}, {}>;
|
|
107
|
+
toolDefinition: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
+
name: "tool_definition";
|
|
109
|
+
tableName: "approval";
|
|
110
|
+
dataType: "json";
|
|
111
|
+
columnType: "PgJsonb";
|
|
112
|
+
data: unknown;
|
|
113
|
+
driverParam: unknown;
|
|
114
|
+
notNull: true;
|
|
115
|
+
hasDefault: false;
|
|
116
|
+
isPrimaryKey: false;
|
|
117
|
+
isAutoincrement: false;
|
|
118
|
+
hasRuntimeDefault: false;
|
|
119
|
+
enumValues: undefined;
|
|
120
|
+
baseColumn: never;
|
|
121
|
+
identity: undefined;
|
|
122
|
+
generated: undefined;
|
|
123
|
+
}, {}, {}>;
|
|
124
|
+
toolArguments: import("drizzle-orm/pg-core").PgColumn<{
|
|
125
|
+
name: "tool_arguments";
|
|
126
|
+
tableName: "approval";
|
|
127
|
+
dataType: "json";
|
|
128
|
+
columnType: "PgJsonb";
|
|
129
|
+
data: unknown;
|
|
130
|
+
driverParam: unknown;
|
|
131
|
+
notNull: true;
|
|
132
|
+
hasDefault: false;
|
|
133
|
+
isPrimaryKey: false;
|
|
134
|
+
isAutoincrement: false;
|
|
135
|
+
hasRuntimeDefault: false;
|
|
136
|
+
enumValues: undefined;
|
|
137
|
+
baseColumn: never;
|
|
138
|
+
identity: undefined;
|
|
139
|
+
generated: undefined;
|
|
140
|
+
}, {}, {}>;
|
|
141
|
+
scope: import("drizzle-orm/pg-core").PgColumn<{
|
|
142
|
+
name: "scope";
|
|
143
|
+
tableName: "approval";
|
|
144
|
+
dataType: "string";
|
|
145
|
+
columnType: "PgText";
|
|
146
|
+
data: "always" | "once";
|
|
147
|
+
driverParam: string;
|
|
148
|
+
notNull: false;
|
|
149
|
+
hasDefault: false;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: ["once", "always"];
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {}>;
|
|
158
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
159
|
+
name: "status";
|
|
160
|
+
tableName: "approval";
|
|
161
|
+
dataType: "string";
|
|
162
|
+
columnType: "PgText";
|
|
163
|
+
data: "pending" | "approved" | "rejected" | "timeout" | "expired";
|
|
164
|
+
driverParam: string;
|
|
165
|
+
notNull: true;
|
|
166
|
+
hasDefault: true;
|
|
167
|
+
isPrimaryKey: false;
|
|
168
|
+
isAutoincrement: false;
|
|
169
|
+
hasRuntimeDefault: false;
|
|
170
|
+
enumValues: ["pending", "approved", "rejected", "timeout", "expired"];
|
|
171
|
+
baseColumn: never;
|
|
172
|
+
identity: undefined;
|
|
173
|
+
generated: undefined;
|
|
174
|
+
}, {}, {}>;
|
|
175
|
+
timeoutAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
176
|
+
name: "timeout_at";
|
|
177
|
+
tableName: "approval";
|
|
178
|
+
dataType: "date";
|
|
179
|
+
columnType: "PgTimestamp";
|
|
180
|
+
data: Date;
|
|
181
|
+
driverParam: string;
|
|
182
|
+
notNull: false;
|
|
183
|
+
hasDefault: false;
|
|
184
|
+
isPrimaryKey: false;
|
|
185
|
+
isAutoincrement: false;
|
|
186
|
+
hasRuntimeDefault: false;
|
|
187
|
+
enumValues: undefined;
|
|
188
|
+
baseColumn: never;
|
|
189
|
+
identity: undefined;
|
|
190
|
+
generated: undefined;
|
|
191
|
+
}, {}, {}>;
|
|
192
|
+
resolvedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
193
|
+
name: "resolved_at";
|
|
194
|
+
tableName: "approval";
|
|
195
|
+
dataType: "date";
|
|
196
|
+
columnType: "PgTimestamp";
|
|
197
|
+
data: Date;
|
|
198
|
+
driverParam: string;
|
|
199
|
+
notNull: false;
|
|
200
|
+
hasDefault: false;
|
|
201
|
+
isPrimaryKey: false;
|
|
202
|
+
isAutoincrement: false;
|
|
203
|
+
hasRuntimeDefault: false;
|
|
204
|
+
enumValues: undefined;
|
|
205
|
+
baseColumn: never;
|
|
206
|
+
identity: undefined;
|
|
207
|
+
generated: undefined;
|
|
208
|
+
}, {}, {}>;
|
|
209
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
210
|
+
name: "created_at";
|
|
211
|
+
tableName: "approval";
|
|
212
|
+
dataType: "date";
|
|
213
|
+
columnType: "PgTimestamp";
|
|
214
|
+
data: Date;
|
|
215
|
+
driverParam: string;
|
|
216
|
+
notNull: true;
|
|
217
|
+
hasDefault: true;
|
|
218
|
+
isPrimaryKey: false;
|
|
219
|
+
isAutoincrement: false;
|
|
220
|
+
hasRuntimeDefault: false;
|
|
221
|
+
enumValues: undefined;
|
|
222
|
+
baseColumn: never;
|
|
223
|
+
identity: undefined;
|
|
224
|
+
generated: undefined;
|
|
225
|
+
}, {}, {}>;
|
|
226
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
227
|
+
name: "updated_at";
|
|
228
|
+
tableName: "approval";
|
|
229
|
+
dataType: "date";
|
|
230
|
+
columnType: "PgTimestamp";
|
|
231
|
+
data: Date;
|
|
232
|
+
driverParam: string;
|
|
233
|
+
notNull: true;
|
|
234
|
+
hasDefault: true;
|
|
235
|
+
isPrimaryKey: false;
|
|
236
|
+
isAutoincrement: false;
|
|
237
|
+
hasRuntimeDefault: false;
|
|
238
|
+
enumValues: undefined;
|
|
239
|
+
baseColumn: never;
|
|
240
|
+
identity: undefined;
|
|
241
|
+
generated: undefined;
|
|
242
|
+
}, {}, {}>;
|
|
243
|
+
};
|
|
244
|
+
dialect: "pg";
|
|
245
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { index, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
2
|
+
import { tenant } from "./tenants.js";
|
|
3
|
+
import { workflowRun } from "./workflow-run.js";
|
|
4
|
+
// Every approval originates from a workflow deployment, so the origin is
|
|
5
|
+
// modeled as the deployment's anchor run -- the workflow_run whose id equals
|
|
6
|
+
// the deployment id -- rather than a launched single agent. A workflow
|
|
7
|
+
// deployment has no `agent_instance` or `agent` row, and the principal its run
|
|
8
|
+
// executes under is a substrate principal, not a `principal`-table row -- so
|
|
9
|
+
// none of those tables can hold a valid referent for an approval's origin.
|
|
10
|
+
export const approval = pgTable("approval", {
|
|
11
|
+
id: text("id").primaryKey(),
|
|
12
|
+
tenantId: text("tenant_id")
|
|
13
|
+
.notNull()
|
|
14
|
+
.references(() => tenant.id, { onDelete: "cascade" }),
|
|
15
|
+
anchorRunId: text("anchor_run_id")
|
|
16
|
+
.notNull()
|
|
17
|
+
.references(() => workflowRun.id, { onDelete: "cascade" }),
|
|
18
|
+
// References the run this approval belongs to, making "this approval is for
|
|
19
|
+
// a real run of this deployment" a database invariant. Cascades on the
|
|
20
|
+
// run's delete; the `anchor_run_id` FK above stays as the lock and cascade
|
|
21
|
+
// anchor the co-write orders against.
|
|
22
|
+
runId: text("run_id")
|
|
23
|
+
.notNull()
|
|
24
|
+
.references(() => workflowRun.id, { onDelete: "cascade" }),
|
|
25
|
+
agentAddress: text("agent_address").notNull(),
|
|
26
|
+
correlationId: text("correlation_id").notNull().unique(),
|
|
27
|
+
// Always populated: the ask rail is the sole co-writer and the register
|
|
28
|
+
// frame's required snapshot guarantees both fields at insert time.
|
|
29
|
+
toolDefinition: jsonb("tool_definition").notNull(),
|
|
30
|
+
toolArguments: jsonb("tool_arguments").notNull(),
|
|
31
|
+
scope: text("scope", { enum: ["once", "always"] }),
|
|
32
|
+
status: text("status", {
|
|
33
|
+
enum: ["pending", "approved", "rejected", "timeout", "expired"],
|
|
34
|
+
})
|
|
35
|
+
.notNull()
|
|
36
|
+
.default("pending"),
|
|
37
|
+
// Nullable so an approval that holds indefinitely can be recorded with no
|
|
38
|
+
// deadline. An agent-step suspend parks on its correlation's signal with no
|
|
39
|
+
// timeout (`parkOnSignal` is called without a `timeout`), so no `timeoutAt`
|
|
40
|
+
// reaches the sidecar frame that co-writes this row -- the deadline lives in
|
|
41
|
+
// the reactor's gate, which the hold-indefinitely suspend path never sets.
|
|
42
|
+
// A null `timeoutAt` is the hold-indefinitely case; a resolver that adds
|
|
43
|
+
// per-workflow expiry populates it when a deadline is configured. Parallels
|
|
44
|
+
// the tool-snapshot columns above, which are likewise deferred.
|
|
45
|
+
timeoutAt: timestamp("timeout_at"),
|
|
46
|
+
resolvedAt: timestamp("resolved_at"),
|
|
47
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
48
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
49
|
+
}, (t) => [
|
|
50
|
+
index("approval_tenant_status_idx").on(t.tenantId, t.status, t.createdAt),
|
|
51
|
+
index("approval_anchor_run_idx").on(t.anchorRunId),
|
|
52
|
+
// Reads that list a single run's approvals (the run-scoped approval and
|
|
53
|
+
// authorization views) filter on runId; the anchor_run index above does
|
|
54
|
+
// not serve them because a child run's approvals carry a runId distinct
|
|
55
|
+
// from the deployment's anchor.
|
|
56
|
+
index("approval_run_idx").on(t.runId),
|
|
57
|
+
]);
|
package/dist/schema/catalog.d.ts
CHANGED
|
@@ -493,6 +493,23 @@ export declare const modelOffering: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
493
493
|
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
494
494
|
size: undefined;
|
|
495
495
|
}>;
|
|
496
|
+
quirks: import("drizzle-orm/pg-core").PgColumn<{
|
|
497
|
+
name: "quirks";
|
|
498
|
+
tableName: "model_offering";
|
|
499
|
+
dataType: "json";
|
|
500
|
+
columnType: "PgJsonb";
|
|
501
|
+
data: unknown;
|
|
502
|
+
driverParam: unknown;
|
|
503
|
+
notNull: false;
|
|
504
|
+
hasDefault: false;
|
|
505
|
+
isPrimaryKey: false;
|
|
506
|
+
isAutoincrement: false;
|
|
507
|
+
hasRuntimeDefault: false;
|
|
508
|
+
enumValues: undefined;
|
|
509
|
+
baseColumn: never;
|
|
510
|
+
identity: undefined;
|
|
511
|
+
generated: undefined;
|
|
512
|
+
}, {}, {}>;
|
|
496
513
|
disabled: import("drizzle-orm/pg-core").PgColumn<{
|
|
497
514
|
name: "disabled";
|
|
498
515
|
tableName: "model_offering";
|
package/dist/schema/catalog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sql } from "drizzle-orm";
|
|
2
|
-
import { boolean, check, integer, pgTable, text, timestamp, unique, } from "drizzle-orm/pg-core";
|
|
2
|
+
import { boolean, check, integer, jsonb, pgTable, text, timestamp, unique, } from "drizzle-orm/pg-core";
|
|
3
3
|
import { credential } from "./credentials.js";
|
|
4
4
|
import { tenant } from "./tenants.js";
|
|
5
5
|
import { wallet } from "./wallets.js";
|
|
@@ -63,6 +63,12 @@ export const modelOffering = pgTable("model_offering", {
|
|
|
63
63
|
// Curated-capability tags. This issue creates the column; the values are
|
|
64
64
|
// populated by the discovery-support-matrix seeding work.
|
|
65
65
|
capabilities: text("capabilities").array().notNull().default([]),
|
|
66
|
+
// Opaque per-deployment bag of provider-specific adapter accommodations
|
|
67
|
+
// (e.g. OpenAI's forceAssistantReasoningContent). Interpreted and
|
|
68
|
+
// validated only at the adapter factory, which alone knows the provider
|
|
69
|
+
// shape. NULL means the factory receives no bag and applies its default
|
|
70
|
+
// behavior.
|
|
71
|
+
quirks: jsonb("quirks"),
|
|
66
72
|
// Own-row disable. Inherited-row suppression is resolved separately.
|
|
67
73
|
disabled: boolean("disabled").notNull().default(false),
|
|
68
74
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
@@ -237,7 +237,7 @@ export declare const credential: import("drizzle-orm/pg-core").PgTableWithColumn
|
|
|
237
237
|
tableName: "credential";
|
|
238
238
|
dataType: "string";
|
|
239
239
|
columnType: "PgText";
|
|
240
|
-
data: "active" | "
|
|
240
|
+
data: "active" | "error" | "expired" | "revoked";
|
|
241
241
|
driverParam: string;
|
|
242
242
|
notNull: true;
|
|
243
243
|
hasDefault: true;
|
|
@@ -24,7 +24,7 @@ import { tenant } from "./tenants.js";
|
|
|
24
24
|
// (`receivePack`, `createPack`, `resolveRef`, ...). The mint API
|
|
25
25
|
// translates user-facing aliases to canonical names before insert.
|
|
26
26
|
// `resource` is the single substrate authz resource string
|
|
27
|
-
// (e.g. `agent-state:
|
|
27
|
+
// (e.g. `agent-state:run_xxx`, `asset:ast_yyy`) that the token grants
|
|
28
28
|
// access to. `refPattern` is a glob restricting which refs within the
|
|
29
29
|
// resource the token may read or write.
|
|
30
30
|
//
|
package/dist/schema/grants.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
1
|
+
import { check, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
2
|
+
import { sql } from "drizzle-orm";
|
|
2
3
|
import { principal } from "./principals.js";
|
|
3
4
|
import { role } from "./roles.js";
|
|
4
5
|
import { tenant } from "./tenants.js";
|
|
@@ -21,4 +22,9 @@ export const grant = pgTable("grant", {
|
|
|
21
22
|
expiresAt: timestamp("expires_at"),
|
|
22
23
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
23
24
|
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
24
|
-
})
|
|
25
|
+
}, (t) => [
|
|
26
|
+
// Exactly one target: a grant hangs off a role OR a principal, never both
|
|
27
|
+
// and never neither. Documented in AUTH.md; enforced in the DB so a
|
|
28
|
+
// malformed row is rejected at write rather than silently mis-targeted.
|
|
29
|
+
check("grant_target_exactly_one", sql `num_nonnulls(${t.principalId}, ${t.roleId}) = 1`),
|
|
30
|
+
]);
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
export * from "./auth.js";
|
|
2
2
|
export * from "./tenants.js";
|
|
3
3
|
export * from "./principals.js";
|
|
4
|
+
export * from "./principal-keys.js";
|
|
4
5
|
export * from "./roles.js";
|
|
5
6
|
export * from "./grants.js";
|
|
6
|
-
export * from "./
|
|
7
|
+
export * from "./approvals.js";
|
|
8
|
+
export * from "./signal-correlations.js";
|
|
7
9
|
export * from "./providers.js";
|
|
8
10
|
export * from "./oauth-clients.js";
|
|
9
11
|
export * from "./credentials.js";
|
|
10
12
|
export * from "./assets.js";
|
|
11
|
-
export * from "./agent-assets.js";
|
|
12
13
|
export * from "./wallets.js";
|
|
13
14
|
export * from "./offerings.js";
|
|
14
15
|
export * from "./catalog.js";
|
|
15
16
|
export * from "./sidecar.js";
|
|
17
|
+
export * from "./sidecar-allocation.js";
|
|
16
18
|
export * from "./sessions.js";
|
|
17
|
-
export * from "./instances.js";
|
|
18
19
|
export * from "./session-assets.js";
|
|
19
20
|
export * from "./messages.js";
|
|
20
21
|
export * from "./git-tokens.js";
|
|
21
|
-
export * from "./workflow-
|
|
22
|
+
export * from "./workflow-definitions.js";
|
|
23
|
+
export * from "./workflow-run.js";
|
|
24
|
+
export * from "./workflow-run-dispatch.js";
|
|
25
|
+
export * from "./workflow-run-launch-spec.js";
|
|
26
|
+
export * from "./workflow-run-execution.js";
|
|
27
|
+
export * from "./workflow-probe.js";
|
package/dist/schema/index.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
export * from "./auth.js";
|
|
2
2
|
export * from "./tenants.js";
|
|
3
3
|
export * from "./principals.js";
|
|
4
|
+
export * from "./principal-keys.js";
|
|
4
5
|
export * from "./roles.js";
|
|
5
6
|
export * from "./grants.js";
|
|
6
|
-
export * from "./
|
|
7
|
+
export * from "./approvals.js";
|
|
8
|
+
export * from "./signal-correlations.js";
|
|
7
9
|
export * from "./providers.js";
|
|
8
10
|
export * from "./oauth-clients.js";
|
|
9
11
|
export * from "./credentials.js";
|
|
10
12
|
export * from "./assets.js";
|
|
11
|
-
export * from "./agent-assets.js";
|
|
12
13
|
export * from "./wallets.js";
|
|
13
14
|
export * from "./offerings.js";
|
|
14
15
|
export * from "./catalog.js";
|
|
15
16
|
export * from "./sidecar.js";
|
|
17
|
+
export * from "./sidecar-allocation.js";
|
|
16
18
|
export * from "./sessions.js";
|
|
17
|
-
export * from "./instances.js";
|
|
18
19
|
export * from "./session-assets.js";
|
|
19
20
|
export * from "./messages.js";
|
|
20
21
|
export * from "./git-tokens.js";
|
|
21
|
-
export * from "./workflow-
|
|
22
|
+
export * from "./workflow-definitions.js";
|
|
23
|
+
export * from "./workflow-run.js";
|
|
24
|
+
export * from "./workflow-run-dispatch.js";
|
|
25
|
+
export * from "./workflow-run-launch-spec.js";
|
|
26
|
+
export * from "./workflow-run-execution.js";
|
|
27
|
+
export * from "./workflow-probe.js";
|
|
@@ -36,7 +36,7 @@ export declare const inferenceTurn: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
36
36
|
identity: undefined;
|
|
37
37
|
generated: undefined;
|
|
38
38
|
}, {}, {}>;
|
|
39
|
-
|
|
39
|
+
runId: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
40
|
name: "instance_id";
|
|
41
41
|
tableName: "inference_turn";
|
|
42
42
|
dataType: "string";
|
|
@@ -92,7 +92,7 @@ export declare const inferenceTurn: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
92
92
|
tableName: "inference_turn";
|
|
93
93
|
dataType: "string";
|
|
94
94
|
columnType: "PgText";
|
|
95
|
-
data: "failed" | "
|
|
95
|
+
data: "failed" | "running" | "completed";
|
|
96
96
|
driverParam: string;
|
|
97
97
|
notNull: true;
|
|
98
98
|
hasDefault: true;
|
|
@@ -201,14 +201,14 @@ export declare const turnPart: import("drizzle-orm/pg-core").PgTableWithColumns<
|
|
|
201
201
|
tableName: "turn_part";
|
|
202
202
|
dataType: "string";
|
|
203
203
|
columnType: "PgText";
|
|
204
|
-
data: "error" | "text" | "
|
|
204
|
+
data: "error" | "tool" | "text" | "file" | "refusal" | "safety_rating" | "reasoning" | "step-start" | "step-finish" | "snapshot" | "patch";
|
|
205
205
|
driverParam: string;
|
|
206
206
|
notNull: true;
|
|
207
207
|
hasDefault: false;
|
|
208
208
|
isPrimaryKey: false;
|
|
209
209
|
isAutoincrement: false;
|
|
210
210
|
hasRuntimeDefault: false;
|
|
211
|
-
enumValues: ["text", "reasoning", "tool", "file", "error", "refusal", "step-start", "step-finish", "snapshot", "patch"];
|
|
211
|
+
enumValues: ["text", "reasoning", "tool", "file", "error", "refusal", "safety_rating", "step-start", "step-finish", "snapshot", "patch"];
|
|
212
212
|
baseColumn: never;
|
|
213
213
|
identity: undefined;
|
|
214
214
|
generated: undefined;
|
|
@@ -305,7 +305,7 @@ export declare const sessionMail: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
305
305
|
identity: undefined;
|
|
306
306
|
generated: undefined;
|
|
307
307
|
}, {}, {}>;
|
|
308
|
-
|
|
308
|
+
runId: import("drizzle-orm/pg-core").PgColumn<{
|
|
309
309
|
name: "instance_id";
|
|
310
310
|
tableName: "session_mail";
|
|
311
311
|
dataType: "string";
|
package/dist/schema/messages.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { index, integer, jsonb, pgTable, text, timestamp, } from "drizzle-orm/pg-core";
|
|
2
2
|
import { bytea } from "./column-types.js";
|
|
3
|
-
import { agentInstance } from "./instances.js";
|
|
4
3
|
import { agentSession } from "./sessions.js";
|
|
5
4
|
import { tenant } from "./tenants.js";
|
|
6
5
|
export const inferenceTurn = pgTable("inference_turn", {
|
|
@@ -8,9 +7,13 @@ export const inferenceTurn = pgTable("inference_turn", {
|
|
|
8
7
|
sessionId: text("session_id")
|
|
9
8
|
.notNull()
|
|
10
9
|
.references(() => agentSession.id, { onDelete: "cascade" }),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// The endpoint that produced this turn: a workflow_run id (older rows may
|
|
11
|
+
// carry an abandoned agent_instance id from before the fold, since the two
|
|
12
|
+
// shared one id space). This is a polymorphic reference that carries no
|
|
13
|
+
// foreign key; the collector-creation layer owns the invariant that the id
|
|
14
|
+
// names a live endpoint. It stays NOT NULL -- a turn always names its
|
|
15
|
+
// producer.
|
|
16
|
+
runId: text("instance_id").notNull(),
|
|
14
17
|
tenantId: text("tenant_id")
|
|
15
18
|
.notNull()
|
|
16
19
|
.references(() => tenant.id, { onDelete: "cascade" }),
|
|
@@ -21,7 +24,7 @@ export const inferenceTurn = pgTable("inference_turn", {
|
|
|
21
24
|
startedAt: timestamp("started_at").notNull(),
|
|
22
25
|
endedAt: timestamp("ended_at"),
|
|
23
26
|
}, (t) => [
|
|
24
|
-
index("inference_turn_instance_id_started_at_idx").on(t.
|
|
27
|
+
index("inference_turn_instance_id_started_at_idx").on(t.runId, t.startedAt),
|
|
25
28
|
]);
|
|
26
29
|
export const turnPart = pgTable("turn_part", {
|
|
27
30
|
id: text("id").primaryKey(),
|
|
@@ -39,6 +42,7 @@ export const turnPart = pgTable("turn_part", {
|
|
|
39
42
|
"file",
|
|
40
43
|
"error",
|
|
41
44
|
"refusal",
|
|
45
|
+
"safety_rating",
|
|
42
46
|
"step-start",
|
|
43
47
|
"step-finish",
|
|
44
48
|
"snapshot",
|
|
@@ -54,9 +58,12 @@ export const sessionMail = pgTable("session_mail", {
|
|
|
54
58
|
sessionId: text("session_id")
|
|
55
59
|
.notNull()
|
|
56
60
|
.references(() => agentSession.id, { onDelete: "cascade" }),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
// The endpoint whose mail this is: null for a folded run (which keys its
|
|
62
|
+
// mail on the session instead), or -- on older rows from before the fold --
|
|
63
|
+
// an abandoned agent_instance id. A polymorphic reference that carries no
|
|
64
|
+
// foreign key (mirroring inference_turn.runId); the mail-write layer
|
|
65
|
+
// owns the invariant. Nullable -- absent for folded runs.
|
|
66
|
+
runId: text("instance_id"),
|
|
60
67
|
tenantId: text("tenant_id")
|
|
61
68
|
.notNull()
|
|
62
69
|
.references(() => tenant.id, { onDelete: "cascade" }),
|
|
@@ -67,5 +74,9 @@ export const sessionMail = pgTable("session_mail", {
|
|
|
67
74
|
raw: bytea("raw").notNull(),
|
|
68
75
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
69
76
|
}, (t) => [
|
|
70
|
-
index("session_mail_instance_id_created_at_idx").on(t.
|
|
77
|
+
index("session_mail_instance_id_created_at_idx").on(t.runId, t.createdAt),
|
|
78
|
+
// A folded run's mail carries a null runId, so its history and prior-
|
|
79
|
+
// mail queries key on the session instead. This index supports that scan
|
|
80
|
+
// the way the runId index supports a legacy instance's.
|
|
81
|
+
index("session_mail_session_id_created_at_idx").on(t.sessionId, t.createdAt),
|
|
71
82
|
]);
|
package/dist/schema/offerings.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
2
|
-
import { agent } from "./agents.js";
|
|
3
2
|
import { tenant } from "./tenants.js";
|
|
3
|
+
import { workflowDefinition } from "./workflow-definitions.js";
|
|
4
4
|
export const offering = pgTable("offering", {
|
|
5
5
|
id: text("id").primaryKey(),
|
|
6
|
+
// The workflow definition this offering prices. The column keeps its
|
|
7
|
+
// `agent_id` name for contract stability -- the offering API exposes
|
|
8
|
+
// `agentId`/`agentName` -- but it now holds a workflow_definition id (a folded
|
|
9
|
+
// agent's definition). `restrict`, not cascade: an offering is a commercial
|
|
10
|
+
// pricing record, so deleting its definition must consciously deal with the
|
|
11
|
+
// offering rather than silently vaporize it.
|
|
6
12
|
agentId: text("agent_id")
|
|
7
13
|
.notNull()
|
|
8
|
-
.references(() =>
|
|
14
|
+
.references(() => workflowDefinition.id, { onDelete: "restrict" }),
|
|
9
15
|
tenantId: text("tenant_id")
|
|
10
16
|
.notNull()
|
|
11
17
|
.references(() => tenant.id, { onDelete: "cascade" }),
|