@opengeni/db 0.23.0 → 0.26.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/{chunk-3UCHDMKG.js → chunk-7WTDI7Y3.js} +109 -2
- package/dist/chunk-7WTDI7Y3.js.map +1 -0
- package/dist/{chunk-L6ADMZHE.js → chunk-KW6U54V2.js} +3 -1
- package/dist/chunk-KW6U54V2.js.map +1 -0
- package/dist/connection-token-resolver.d.ts +24 -2
- package/dist/index.d.ts +68 -2
- package/dist/index.js +1168 -336
- package/dist/index.js.map +1 -1
- package/dist/preference-registry.d.ts +14 -0
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +2 -2
- package/dist/schema.d.ts +262 -4
- package/dist/schema.js +3 -1
- package/dist/session-realtime-mirror.d.ts +22 -1
- package/dist/workspace-instruction-policies-schema.d.ts +68 -0
- package/dist/workspace-instruction-policies.d.ts +53 -7
- package/drizzle/0165_document_authority_foundation.sql +259 -0
- package/drizzle/0166_connection_disconnect_idempotency.sql +49 -0
- package/drizzle/0167_document_index_replay_authority.sql +61 -0
- package/drizzle/0168_workspace_instruction_policy_operation_receipts.sql +44 -0
- package/package.json +3 -3
- package/src/connection-token-resolver.ts +79 -16
- package/src/index.ts +419 -23
- package/src/preference-registry.ts +103 -0
- package/src/runtime-posture.ts +2 -0
- package/src/schema.ts +86 -0
- package/src/session-control.ts +48 -1
- package/src/session-queue-commands.ts +45 -11
- package/src/session-realtime-mirror.ts +117 -1
- package/src/session-realtime.ts +49 -1
- package/src/workspace-instruction-policies-schema.ts +30 -0
- package/src/workspace-instruction-policies.ts +438 -24
- package/dist/chunk-3UCHDMKG.js.map +0 -1
- package/dist/chunk-L6ADMZHE.js.map +0 -1
|
@@ -126,6 +126,20 @@ export declare function listPreferenceRegistry(db: Database, input: {
|
|
|
126
126
|
updatedAt: string;
|
|
127
127
|
}[];
|
|
128
128
|
}>;
|
|
129
|
+
export type PreferenceRegistryGovernanceIdentity = Pick<PreferenceRegistryDescriptor, "id" | "revisionId" | "contentHash" | "activeVersion" | "scope">;
|
|
130
|
+
export type CurrentPreferenceRegistryGovernanceMetadata = {
|
|
131
|
+
descriptors: PreferenceRegistryGovernanceIdentity[];
|
|
132
|
+
truncated: boolean;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Read the current active descriptor identities for one exact authenticated
|
|
136
|
+
* subject. Full preference values and even descriptor display text stay inside
|
|
137
|
+
* this DB boundary; Workspace State receives only stable revision metadata.
|
|
138
|
+
*/
|
|
139
|
+
export declare function getCurrentPreferenceRegistryGovernanceMetadata(db: Database, input: {
|
|
140
|
+
workspaceId: string;
|
|
141
|
+
subjectId: string;
|
|
142
|
+
}): Promise<CurrentPreferenceRegistryGovernanceMetadata>;
|
|
129
143
|
export declare function listPreferenceRegistryForAttempt(db: Database, input: PreferenceRegistryAttemptClaims & PreferenceRegistryListInput): Promise<{
|
|
130
144
|
preferences: {
|
|
131
145
|
id: string;
|
package/dist/provision-roles.js
CHANGED
|
@@ -4,7 +4,7 @@ import type { Database, RlsStrategy } from "./index";
|
|
|
4
4
|
* FORCE-RLS table is an architectural change: update this list in the same
|
|
5
5
|
* commit as the migration so startup cannot silently accept an unreviewed gap.
|
|
6
6
|
*/
|
|
7
|
-
export declare const FORCE_RLS_TABLES: readonly ["agent_run_states", "api_keys", "audit_events", "billing_customers", "capability_catalog_items", "capability_installations", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "enrollments", "file_uploads", "files", "github_installation_repositories", "github_installations", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "import_batches", "integration_oauth_state_nonces", "knowledge_change_proposals", "knowledge_claim_evidence", "knowledge_claim_relations", "knowledge_claim_reviews", "knowledge_claims", "knowledge_document_versions", "knowledge_entities", "knowledge_entity_aliases", "knowledge_facts", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "knowledge_operation_receipts", "knowledge_providers", "knowledge_source_acl_versions", "knowledge_source_objects", "knowledge_sources", "knowledge_sync_runs", "machine_metrics_latest", "machine_metrics_series", "model_call_facts", "new_session_drafts", "pack_installations", "preference_registry_events", "preference_registry_preferences", "preference_registry_revisions", "preference_registry_snapshots", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_runs", "scheduled_tasks", "session_attempt_interruptions", "session_command_receipts", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_spawn_denials", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_user_links", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "social_connections", "social_posts", "usage_events", "workspace_artifact_events", "workspace_artifact_versions", "workspace_artifacts", "workspace_captures", "workspace_control_events", "workspace_inference_controls", "workspace_instruction_policy_activation_events", "workspace_instruction_policy_heads", "workspace_instruction_policy_revisions", "workspace_instruction_policy_snapshots", "workspace_model_policies", "workspace_packs", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets"];
|
|
7
|
+
export declare const FORCE_RLS_TABLES: readonly ["agent_run_states", "api_keys", "audit_events", "billing_customers", "capability_catalog_items", "capability_installations", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "connection_disconnect_operations", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "enrollments", "file_uploads", "files", "github_installation_repositories", "github_installations", "host_export_config", "host_export_consumers", "host_export_cursor_state", "host_export_dead_letters", "host_export_outbox", "import_batches", "integration_oauth_state_nonces", "knowledge_change_proposals", "knowledge_claim_evidence", "knowledge_claim_relations", "knowledge_claim_reviews", "knowledge_claims", "knowledge_document_versions", "knowledge_entities", "knowledge_entity_aliases", "knowledge_facts", "knowledge_lifecycle_events", "knowledge_memories", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "knowledge_operation_receipts", "knowledge_providers", "knowledge_source_acl_versions", "knowledge_source_objects", "knowledge_sources", "knowledge_sync_runs", "machine_metrics_latest", "machine_metrics_series", "model_call_facts", "new_session_drafts", "pack_installations", "preference_registry_events", "preference_registry_preferences", "preference_registry_revisions", "preference_registry_snapshots", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_runs", "scheduled_tasks", "session_attempt_interruptions", "session_command_receipts", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_spawn_denials", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_user_links", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "social_connections", "social_posts", "usage_events", "workspace_artifact_events", "workspace_artifact_versions", "workspace_artifacts", "workspace_captures", "workspace_control_events", "workspace_inference_controls", "workspace_instruction_policy_activation_events", "workspace_instruction_policy_heads", "workspace_instruction_policy_revisions", "workspace_instruction_policy_snapshots", "workspace_model_policies", "workspace_packs", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets"];
|
|
8
8
|
/**
|
|
9
9
|
* Deployment-global and authentication tables used by ordinary API/worker
|
|
10
10
|
* traffic. They intentionally do not carry workspace RLS: their access model
|
|
@@ -16,7 +16,7 @@ export declare const NON_RLS_RUNTIME_TABLES: readonly ["auth_identities", "auth_
|
|
|
16
16
|
* explicit instead of being derived from FORCE_RLS_TABLES: adding a protected
|
|
17
17
|
* table must not silently grant it broader DML than its migration intended.
|
|
18
18
|
*/
|
|
19
|
-
export declare const RUNTIME_FULL_DML_TABLES: readonly ["agent_run_states", "api_keys", "audit_events", "auth_identities", "auth_rate_limits", "auth_sessions", "auth_users", "auth_verifications", "billing_customers", "capability_catalog_items", "capability_installations", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "enrollments", "file_uploads", "files", "github_installation_repositories", "github_installations", "import_batches", "integration_oauth_clients", "integration_oauth_state_nonces", "knowledge_memories", "machine_metrics_latest", "machine_metrics_series", "managed_accounts", "model_call_facts", "new_session_drafts", "pack_installations", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_runs", "scheduled_tasks", "session_attempt_interruptions", "session_command_receipts", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_user_links", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "social_connections", "social_posts", "stripe_webhook_events", "usage_events", "workspace_artifacts", "workspace_captures", "workspace_control_events", "workspace_inference_controls", "workspace_instruction_policy_heads", "workspace_memberships", "workspace_model_policies", "workspace_packs", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets", "workspaces"];
|
|
19
|
+
export declare const RUNTIME_FULL_DML_TABLES: readonly ["agent_run_states", "api_keys", "audit_events", "auth_identities", "auth_rate_limits", "auth_sessions", "auth_users", "auth_verifications", "billing_customers", "capability_catalog_items", "capability_installations", "codex_capacity_waiters", "codex_credential_leases", "codex_reset_redemption_attempts", "codex_rotation_settings", "codex_subscription_credentials", "composer_drafts", "connection_disconnect_operations", "connections", "connector_action_policies", "connector_action_requests", "credit_ledger_entries", "device_enrollment_requests", "document_bases", "document_chunks", "documents", "enrollments", "file_uploads", "files", "github_installation_repositories", "github_installations", "import_batches", "integration_oauth_clients", "integration_oauth_state_nonces", "knowledge_memories", "machine_metrics_latest", "machine_metrics_series", "managed_accounts", "model_call_facts", "new_session_drafts", "pack_installations", "rig_changes", "rig_versions", "rigs", "sandbox_checkpoint_artifacts", "sandbox_lease_holders", "sandbox_leases", "sandbox_pty_sessions", "sandbox_retained_processes", "sandbox_session_envelopes", "sandbox_workspace_mutation_admissions", "sandboxes", "scheduled_task_runs", "scheduled_tasks", "session_attempt_interruptions", "session_command_receipts", "session_events", "session_goals", "session_history_items", "session_human_input_requests", "session_list_snapshots", "session_mcp_servers", "session_pending_tool_calls", "session_pins", "session_realtime_connections", "session_realtime_context_projections", "session_realtime_entries", "session_realtime_modes", "session_recordings", "session_stream_acknowledgments", "session_system_update_outbox", "session_system_updates", "session_turn_attempts", "session_turns", "session_workflow_wake_outbox", "sessions", "slack_bot_delete_operations", "slack_bot_post_operations", "slack_bot_user_links", "slack_interaction_inbox", "slack_interaction_progress_deliveries", "slack_interactions", "social_connections", "social_posts", "stripe_webhook_events", "usage_events", "workspace_artifacts", "workspace_captures", "workspace_control_events", "workspace_inference_controls", "workspace_instruction_policy_heads", "workspace_memberships", "workspace_model_policies", "workspace_packs", "workspace_session_activity_revisions", "workspace_variable_set_variables", "workspace_variable_sets", "workspaces"];
|
|
20
20
|
/** Configuration and lifecycle-owned audit rows are read-only at runtime. */
|
|
21
21
|
export declare const RUNTIME_READ_ONLY_TABLES: readonly ["knowledge_lifecycle_events", "knowledge_memory_lifecycle_events", "knowledge_memory_relationships", "nested_agent_depth_configuration", "preference_registry_events", "preference_registry_snapshots", "workspace_instruction_policy_snapshots"];
|
|
22
22
|
/** Append-only evidence/revision tables are insertable and queryable, never mutable. */
|
package/dist/schema.d.ts
CHANGED
|
@@ -3370,6 +3370,166 @@ export declare const connections: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
3370
3370
|
};
|
|
3371
3371
|
dialect: 'pg';
|
|
3372
3372
|
}>;
|
|
3373
|
+
export declare const connectionDisconnectOperations: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3374
|
+
name: "connection_disconnect_operations";
|
|
3375
|
+
schema: undefined;
|
|
3376
|
+
columns: {
|
|
3377
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
3378
|
+
name: "id";
|
|
3379
|
+
tableName: "connection_disconnect_operations";
|
|
3380
|
+
dataType: "string";
|
|
3381
|
+
columnType: "PgUUID";
|
|
3382
|
+
data: string;
|
|
3383
|
+
driverParam: string;
|
|
3384
|
+
notNull: true;
|
|
3385
|
+
hasDefault: true;
|
|
3386
|
+
isPrimaryKey: true;
|
|
3387
|
+
isAutoincrement: false;
|
|
3388
|
+
hasRuntimeDefault: false;
|
|
3389
|
+
enumValues: undefined;
|
|
3390
|
+
baseColumn: never;
|
|
3391
|
+
identity: undefined;
|
|
3392
|
+
generated: undefined;
|
|
3393
|
+
}, {}, {}>;
|
|
3394
|
+
accountId: import("drizzle-orm/pg-core").PgColumn<{
|
|
3395
|
+
name: "account_id";
|
|
3396
|
+
tableName: "connection_disconnect_operations";
|
|
3397
|
+
dataType: "string";
|
|
3398
|
+
columnType: "PgUUID";
|
|
3399
|
+
data: string;
|
|
3400
|
+
driverParam: string;
|
|
3401
|
+
notNull: true;
|
|
3402
|
+
hasDefault: false;
|
|
3403
|
+
isPrimaryKey: false;
|
|
3404
|
+
isAutoincrement: false;
|
|
3405
|
+
hasRuntimeDefault: false;
|
|
3406
|
+
enumValues: undefined;
|
|
3407
|
+
baseColumn: never;
|
|
3408
|
+
identity: undefined;
|
|
3409
|
+
generated: undefined;
|
|
3410
|
+
}, {}, {}>;
|
|
3411
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
3412
|
+
name: "workspace_id";
|
|
3413
|
+
tableName: "connection_disconnect_operations";
|
|
3414
|
+
dataType: "string";
|
|
3415
|
+
columnType: "PgUUID";
|
|
3416
|
+
data: string;
|
|
3417
|
+
driverParam: string;
|
|
3418
|
+
notNull: true;
|
|
3419
|
+
hasDefault: false;
|
|
3420
|
+
isPrimaryKey: false;
|
|
3421
|
+
isAutoincrement: false;
|
|
3422
|
+
hasRuntimeDefault: false;
|
|
3423
|
+
enumValues: undefined;
|
|
3424
|
+
baseColumn: never;
|
|
3425
|
+
identity: undefined;
|
|
3426
|
+
generated: undefined;
|
|
3427
|
+
}, {}, {}>;
|
|
3428
|
+
connectionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
3429
|
+
name: "connection_id";
|
|
3430
|
+
tableName: "connection_disconnect_operations";
|
|
3431
|
+
dataType: "string";
|
|
3432
|
+
columnType: "PgUUID";
|
|
3433
|
+
data: string;
|
|
3434
|
+
driverParam: string;
|
|
3435
|
+
notNull: true;
|
|
3436
|
+
hasDefault: false;
|
|
3437
|
+
isPrimaryKey: false;
|
|
3438
|
+
isAutoincrement: false;
|
|
3439
|
+
hasRuntimeDefault: false;
|
|
3440
|
+
enumValues: undefined;
|
|
3441
|
+
baseColumn: never;
|
|
3442
|
+
identity: undefined;
|
|
3443
|
+
generated: undefined;
|
|
3444
|
+
}, {}, {}>;
|
|
3445
|
+
subjectId: import("drizzle-orm/pg-core").PgColumn<{
|
|
3446
|
+
name: "subject_id";
|
|
3447
|
+
tableName: "connection_disconnect_operations";
|
|
3448
|
+
dataType: "string";
|
|
3449
|
+
columnType: "PgText";
|
|
3450
|
+
data: string;
|
|
3451
|
+
driverParam: string;
|
|
3452
|
+
notNull: true;
|
|
3453
|
+
hasDefault: false;
|
|
3454
|
+
isPrimaryKey: false;
|
|
3455
|
+
isAutoincrement: false;
|
|
3456
|
+
hasRuntimeDefault: false;
|
|
3457
|
+
enumValues: [string, ...string[]];
|
|
3458
|
+
baseColumn: never;
|
|
3459
|
+
identity: undefined;
|
|
3460
|
+
generated: undefined;
|
|
3461
|
+
}, {}, {}>;
|
|
3462
|
+
idempotencyKey: import("drizzle-orm/pg-core").PgColumn<{
|
|
3463
|
+
name: "idempotency_key";
|
|
3464
|
+
tableName: "connection_disconnect_operations";
|
|
3465
|
+
dataType: "string";
|
|
3466
|
+
columnType: "PgText";
|
|
3467
|
+
data: string;
|
|
3468
|
+
driverParam: string;
|
|
3469
|
+
notNull: true;
|
|
3470
|
+
hasDefault: false;
|
|
3471
|
+
isPrimaryKey: false;
|
|
3472
|
+
isAutoincrement: false;
|
|
3473
|
+
hasRuntimeDefault: false;
|
|
3474
|
+
enumValues: [string, ...string[]];
|
|
3475
|
+
baseColumn: never;
|
|
3476
|
+
identity: undefined;
|
|
3477
|
+
generated: undefined;
|
|
3478
|
+
}, {}, {}>;
|
|
3479
|
+
expectedVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
3480
|
+
name: "expected_version";
|
|
3481
|
+
tableName: "connection_disconnect_operations";
|
|
3482
|
+
dataType: "number";
|
|
3483
|
+
columnType: "PgInteger";
|
|
3484
|
+
data: number;
|
|
3485
|
+
driverParam: string | number;
|
|
3486
|
+
notNull: true;
|
|
3487
|
+
hasDefault: false;
|
|
3488
|
+
isPrimaryKey: false;
|
|
3489
|
+
isAutoincrement: false;
|
|
3490
|
+
hasRuntimeDefault: false;
|
|
3491
|
+
enumValues: undefined;
|
|
3492
|
+
baseColumn: never;
|
|
3493
|
+
identity: undefined;
|
|
3494
|
+
generated: undefined;
|
|
3495
|
+
}, {}, {}>;
|
|
3496
|
+
resultVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
3497
|
+
name: "result_version";
|
|
3498
|
+
tableName: "connection_disconnect_operations";
|
|
3499
|
+
dataType: "number";
|
|
3500
|
+
columnType: "PgInteger";
|
|
3501
|
+
data: number;
|
|
3502
|
+
driverParam: string | number;
|
|
3503
|
+
notNull: true;
|
|
3504
|
+
hasDefault: false;
|
|
3505
|
+
isPrimaryKey: false;
|
|
3506
|
+
isAutoincrement: false;
|
|
3507
|
+
hasRuntimeDefault: false;
|
|
3508
|
+
enumValues: undefined;
|
|
3509
|
+
baseColumn: never;
|
|
3510
|
+
identity: undefined;
|
|
3511
|
+
generated: undefined;
|
|
3512
|
+
}, {}, {}>;
|
|
3513
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
3514
|
+
name: "created_at";
|
|
3515
|
+
tableName: "connection_disconnect_operations";
|
|
3516
|
+
dataType: "date";
|
|
3517
|
+
columnType: "PgTimestamp";
|
|
3518
|
+
data: Date;
|
|
3519
|
+
driverParam: string;
|
|
3520
|
+
notNull: true;
|
|
3521
|
+
hasDefault: true;
|
|
3522
|
+
isPrimaryKey: false;
|
|
3523
|
+
isAutoincrement: false;
|
|
3524
|
+
hasRuntimeDefault: false;
|
|
3525
|
+
enumValues: undefined;
|
|
3526
|
+
baseColumn: never;
|
|
3527
|
+
identity: undefined;
|
|
3528
|
+
generated: undefined;
|
|
3529
|
+
}, {}, {}>;
|
|
3530
|
+
};
|
|
3531
|
+
dialect: 'pg';
|
|
3532
|
+
}>;
|
|
3373
3533
|
export declare const connectorActionPolicies: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3374
3534
|
name: "connector_action_policies";
|
|
3375
3535
|
schema: undefined;
|
|
@@ -10184,6 +10344,57 @@ export declare const documents: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
10184
10344
|
}, {}, {
|
|
10185
10345
|
$type: string[];
|
|
10186
10346
|
}>;
|
|
10347
|
+
authorityKind: import("drizzle-orm/pg-core").PgColumn<{
|
|
10348
|
+
name: "authority_kind";
|
|
10349
|
+
tableName: "documents";
|
|
10350
|
+
dataType: "string";
|
|
10351
|
+
columnType: "PgText";
|
|
10352
|
+
data: string;
|
|
10353
|
+
driverParam: string;
|
|
10354
|
+
notNull: true;
|
|
10355
|
+
hasDefault: true;
|
|
10356
|
+
isPrimaryKey: false;
|
|
10357
|
+
isAutoincrement: false;
|
|
10358
|
+
hasRuntimeDefault: false;
|
|
10359
|
+
enumValues: [string, ...string[]];
|
|
10360
|
+
baseColumn: never;
|
|
10361
|
+
identity: undefined;
|
|
10362
|
+
generated: undefined;
|
|
10363
|
+
}, {}, {}>;
|
|
10364
|
+
authorityWorkspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
10365
|
+
name: "authority_workspace_id";
|
|
10366
|
+
tableName: "documents";
|
|
10367
|
+
dataType: "string";
|
|
10368
|
+
columnType: "PgUUID";
|
|
10369
|
+
data: string;
|
|
10370
|
+
driverParam: string;
|
|
10371
|
+
notNull: false;
|
|
10372
|
+
hasDefault: false;
|
|
10373
|
+
isPrimaryKey: false;
|
|
10374
|
+
isAutoincrement: false;
|
|
10375
|
+
hasRuntimeDefault: false;
|
|
10376
|
+
enumValues: undefined;
|
|
10377
|
+
baseColumn: never;
|
|
10378
|
+
identity: undefined;
|
|
10379
|
+
generated: undefined;
|
|
10380
|
+
}, {}, {}>;
|
|
10381
|
+
authoritySubjectId: import("drizzle-orm/pg-core").PgColumn<{
|
|
10382
|
+
name: "authority_subject_id";
|
|
10383
|
+
tableName: "documents";
|
|
10384
|
+
dataType: "string";
|
|
10385
|
+
columnType: "PgText";
|
|
10386
|
+
data: string;
|
|
10387
|
+
driverParam: string;
|
|
10388
|
+
notNull: false;
|
|
10389
|
+
hasDefault: false;
|
|
10390
|
+
isPrimaryKey: false;
|
|
10391
|
+
isAutoincrement: false;
|
|
10392
|
+
hasRuntimeDefault: false;
|
|
10393
|
+
enumValues: [string, ...string[]];
|
|
10394
|
+
baseColumn: never;
|
|
10395
|
+
identity: undefined;
|
|
10396
|
+
generated: undefined;
|
|
10397
|
+
}, {}, {}>;
|
|
10187
10398
|
visibility: import("drizzle-orm/pg-core").PgColumn<{
|
|
10188
10399
|
name: "visibility";
|
|
10189
10400
|
tableName: "documents";
|
|
@@ -10503,6 +10714,57 @@ export declare const documentChunks: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
10503
10714
|
}, {}, {
|
|
10504
10715
|
$type: Record<string, unknown>;
|
|
10505
10716
|
}>;
|
|
10717
|
+
authorityKind: import("drizzle-orm/pg-core").PgColumn<{
|
|
10718
|
+
name: "authority_kind";
|
|
10719
|
+
tableName: "document_chunks";
|
|
10720
|
+
dataType: "string";
|
|
10721
|
+
columnType: "PgText";
|
|
10722
|
+
data: string;
|
|
10723
|
+
driverParam: string;
|
|
10724
|
+
notNull: true;
|
|
10725
|
+
hasDefault: true;
|
|
10726
|
+
isPrimaryKey: false;
|
|
10727
|
+
isAutoincrement: false;
|
|
10728
|
+
hasRuntimeDefault: false;
|
|
10729
|
+
enumValues: [string, ...string[]];
|
|
10730
|
+
baseColumn: never;
|
|
10731
|
+
identity: undefined;
|
|
10732
|
+
generated: undefined;
|
|
10733
|
+
}, {}, {}>;
|
|
10734
|
+
authorityWorkspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
10735
|
+
name: "authority_workspace_id";
|
|
10736
|
+
tableName: "document_chunks";
|
|
10737
|
+
dataType: "string";
|
|
10738
|
+
columnType: "PgUUID";
|
|
10739
|
+
data: string;
|
|
10740
|
+
driverParam: string;
|
|
10741
|
+
notNull: false;
|
|
10742
|
+
hasDefault: false;
|
|
10743
|
+
isPrimaryKey: false;
|
|
10744
|
+
isAutoincrement: false;
|
|
10745
|
+
hasRuntimeDefault: false;
|
|
10746
|
+
enumValues: undefined;
|
|
10747
|
+
baseColumn: never;
|
|
10748
|
+
identity: undefined;
|
|
10749
|
+
generated: undefined;
|
|
10750
|
+
}, {}, {}>;
|
|
10751
|
+
authoritySubjectId: import("drizzle-orm/pg-core").PgColumn<{
|
|
10752
|
+
name: "authority_subject_id";
|
|
10753
|
+
tableName: "document_chunks";
|
|
10754
|
+
dataType: "string";
|
|
10755
|
+
columnType: "PgText";
|
|
10756
|
+
data: string;
|
|
10757
|
+
driverParam: string;
|
|
10758
|
+
notNull: false;
|
|
10759
|
+
hasDefault: false;
|
|
10760
|
+
isPrimaryKey: false;
|
|
10761
|
+
isAutoincrement: false;
|
|
10762
|
+
hasRuntimeDefault: false;
|
|
10763
|
+
enumValues: [string, ...string[]];
|
|
10764
|
+
baseColumn: never;
|
|
10765
|
+
identity: undefined;
|
|
10766
|
+
generated: undefined;
|
|
10767
|
+
}, {}, {}>;
|
|
10506
10768
|
embedding: import("drizzle-orm/pg-core").PgColumn<{
|
|
10507
10769
|
name: "embedding";
|
|
10508
10770
|
tableName: "document_chunks";
|
|
@@ -16670,8 +16932,6 @@ export declare const sessionHumanInputRequests: import("drizzle-orm/pg-core").Pg
|
|
|
16670
16932
|
required: boolean;
|
|
16671
16933
|
allowOther: boolean;
|
|
16672
16934
|
validation?: {
|
|
16673
|
-
minLength?: number | null | undefined;
|
|
16674
|
-
maxLength?: number | null | undefined;
|
|
16675
16935
|
minSelections?: number | null | undefined;
|
|
16676
16936
|
maxSelections?: number | null | undefined;
|
|
16677
16937
|
} | null | undefined;
|
|
@@ -16701,8 +16961,6 @@ export declare const sessionHumanInputRequests: import("drizzle-orm/pg-core").Pg
|
|
|
16701
16961
|
required: boolean;
|
|
16702
16962
|
allowOther: boolean;
|
|
16703
16963
|
validation?: {
|
|
16704
|
-
minLength?: number | null | undefined;
|
|
16705
|
-
maxLength?: number | null | undefined;
|
|
16706
16964
|
minSelections?: number | null | undefined;
|
|
16707
16965
|
maxSelections?: number | null | undefined;
|
|
16708
16966
|
} | null | undefined;
|
package/dist/schema.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
codexRotationSettings,
|
|
12
12
|
codexSubscriptionCredentials,
|
|
13
13
|
composerDrafts,
|
|
14
|
+
connectionDisconnectOperations,
|
|
14
15
|
connections,
|
|
15
16
|
connectorActionPolicies,
|
|
16
17
|
connectorActionRequests,
|
|
@@ -137,7 +138,7 @@ import {
|
|
|
137
138
|
workspaceVariableSetVariables,
|
|
138
139
|
workspaceVariableSets,
|
|
139
140
|
workspaces
|
|
140
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-7WTDI7Y3.js";
|
|
141
142
|
import "./chunk-PZ5AY32C.js";
|
|
142
143
|
export {
|
|
143
144
|
agentRunStates,
|
|
@@ -152,6 +153,7 @@ export {
|
|
|
152
153
|
codexRotationSettings,
|
|
153
154
|
codexSubscriptionCredentials,
|
|
154
155
|
composerDrafts,
|
|
156
|
+
connectionDisconnectOperations,
|
|
155
157
|
connections,
|
|
156
158
|
connectorActionPolicies,
|
|
157
159
|
connectorActionRequests,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HumanInputQuestion, HumanInputResponse } from "@opengeni/contracts";
|
|
1
2
|
import type { Database } from "./index";
|
|
2
3
|
import * as schema from "./schema";
|
|
3
4
|
export type SessionRealtimeMirrorChannel = "speakable" | "commentary" | null;
|
|
@@ -5,7 +6,7 @@ export type MirrorSessionRealtimeContextInput = {
|
|
|
5
6
|
accountId: string;
|
|
6
7
|
workspaceId: string;
|
|
7
8
|
sessionId: string;
|
|
8
|
-
sourceKind: "human_input" | "assistant_progress" | "assistant_terminal";
|
|
9
|
+
sourceKind: "human_input" | "human_input_request" | "human_input_response" | "assistant_progress" | "assistant_terminal";
|
|
9
10
|
sourceId: string;
|
|
10
11
|
text: string;
|
|
11
12
|
channel: SessionRealtimeMirrorChannel;
|
|
@@ -28,3 +29,23 @@ export declare function renderRealtimeHumanInputContext(input: {
|
|
|
28
29
|
routing: "accepted_for_execution" | "queued_for_execution" | "accepted_for_steering";
|
|
29
30
|
text: string;
|
|
30
31
|
}): string;
|
|
32
|
+
export type RealtimeHumanInputRequestContext = {
|
|
33
|
+
id: string;
|
|
34
|
+
questions: HumanInputQuestion[];
|
|
35
|
+
allowSkip: boolean;
|
|
36
|
+
expiresAt?: Date | string | null;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Render the exact durable question contract for the conversational surface.
|
|
40
|
+
* The structured form remains authoritative, while a conversational answer is
|
|
41
|
+
* ordinary new user input that the realtime model delegates once with enough
|
|
42
|
+
* question context for the next underlying turn.
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderRealtimeHumanInputRequestContext(input: {
|
|
45
|
+
requests: RealtimeHumanInputRequestContext[];
|
|
46
|
+
}): string;
|
|
47
|
+
export declare function renderRealtimeHumanInputResponseContext(input: {
|
|
48
|
+
requestId: string;
|
|
49
|
+
questions: HumanInputQuestion[];
|
|
50
|
+
response: HumanInputResponse;
|
|
51
|
+
}): string;
|
|
@@ -19,6 +19,40 @@ export declare const workspaceInstructionPolicyRevisions: import("drizzle-orm/pg
|
|
|
19
19
|
identity: undefined;
|
|
20
20
|
generated: undefined;
|
|
21
21
|
}, {}, {}>;
|
|
22
|
+
operationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "operation_id";
|
|
24
|
+
tableName: "workspace_instruction_policy_revisions";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgUUID";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: false;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: undefined;
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
requestFingerprint: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "request_fingerprint";
|
|
41
|
+
tableName: "workspace_instruction_policy_revisions";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: false;
|
|
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
|
+
}, {}, {}>;
|
|
22
56
|
accountId: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
57
|
name: "account_id";
|
|
24
58
|
tableName: "workspace_instruction_policy_revisions";
|
|
@@ -458,6 +492,40 @@ export declare const workspaceInstructionPolicyActivationEvents: import("drizzle
|
|
|
458
492
|
identity: undefined;
|
|
459
493
|
generated: undefined;
|
|
460
494
|
}, {}, {}>;
|
|
495
|
+
operationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
496
|
+
name: "operation_id";
|
|
497
|
+
tableName: "workspace_instruction_policy_activation_events";
|
|
498
|
+
dataType: "string";
|
|
499
|
+
columnType: "PgUUID";
|
|
500
|
+
data: string;
|
|
501
|
+
driverParam: string;
|
|
502
|
+
notNull: false;
|
|
503
|
+
hasDefault: false;
|
|
504
|
+
isPrimaryKey: false;
|
|
505
|
+
isAutoincrement: false;
|
|
506
|
+
hasRuntimeDefault: false;
|
|
507
|
+
enumValues: undefined;
|
|
508
|
+
baseColumn: never;
|
|
509
|
+
identity: undefined;
|
|
510
|
+
generated: undefined;
|
|
511
|
+
}, {}, {}>;
|
|
512
|
+
requestFingerprint: import("drizzle-orm/pg-core").PgColumn<{
|
|
513
|
+
name: "request_fingerprint";
|
|
514
|
+
tableName: "workspace_instruction_policy_activation_events";
|
|
515
|
+
dataType: "string";
|
|
516
|
+
columnType: "PgText";
|
|
517
|
+
data: string;
|
|
518
|
+
driverParam: string;
|
|
519
|
+
notNull: false;
|
|
520
|
+
hasDefault: false;
|
|
521
|
+
isPrimaryKey: false;
|
|
522
|
+
isAutoincrement: false;
|
|
523
|
+
hasRuntimeDefault: false;
|
|
524
|
+
enumValues: [string, ...string[]];
|
|
525
|
+
baseColumn: never;
|
|
526
|
+
identity: undefined;
|
|
527
|
+
generated: undefined;
|
|
528
|
+
}, {}, {}>;
|
|
461
529
|
accountId: import("drizzle-orm/pg-core").PgColumn<{
|
|
462
530
|
name: "account_id";
|
|
463
531
|
tableName: "workspace_instruction_policy_activation_events";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { WorkspaceInstructionPolicySnapshot } from "@opengeni/contracts";
|
|
1
2
|
import type { WorkspaceInstructionPolicyActivationResponse, WorkspaceInstructionPolicyDiffResponse, WorkspaceInstructionPolicyDraftProvenanceSource, WorkspaceInstructionPolicyHead, WorkspaceInstructionPolicyListQuery, WorkspaceInstructionPolicyListResponse, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyRevision, WorkspaceInstructionPolicyTarget } from "@opengeni/contracts";
|
|
2
3
|
import type { Database } from "./index";
|
|
3
|
-
type
|
|
4
|
+
type DraftRequestInput = WorkspaceInstructionPolicyTarget & {
|
|
5
|
+
operationId: string;
|
|
4
6
|
accountId: string;
|
|
5
7
|
workspaceId: string;
|
|
6
8
|
content: string;
|
|
@@ -9,15 +11,28 @@ type DraftInput = WorkspaceInstructionPolicyTarget & {
|
|
|
9
11
|
supersedesRevisionId: string | null;
|
|
10
12
|
createdBySubjectId: string;
|
|
11
13
|
};
|
|
12
|
-
type CallerDraftInput = Omit<
|
|
14
|
+
type CallerDraftInput = Omit<DraftRequestInput, "operationId" | "provenanceSource"> & {
|
|
15
|
+
operationId?: string;
|
|
13
16
|
provenanceSource: WorkspaceInstructionPolicyDraftProvenanceSource;
|
|
14
17
|
};
|
|
18
|
+
type ImportLegacyRequestInput = {
|
|
19
|
+
operationId: string;
|
|
20
|
+
accountId: string;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
createdBySubjectId: string;
|
|
23
|
+
supersedesRevisionId: string | null;
|
|
24
|
+
};
|
|
15
25
|
export declare class WorkspaceInstructionPolicyConflictError extends Error {
|
|
16
26
|
readonly currentHead: WorkspaceInstructionPolicyHead | null;
|
|
17
27
|
readonly name = "WorkspaceInstructionPolicyConflictError";
|
|
18
28
|
readonly code = "WORKSPACE_INSTRUCTION_POLICY_CONFLICT";
|
|
19
29
|
constructor(currentHead: WorkspaceInstructionPolicyHead | null);
|
|
20
30
|
}
|
|
31
|
+
export declare class WorkspaceInstructionPolicyOperationReuseError extends Error {
|
|
32
|
+
readonly name = "WorkspaceInstructionPolicyOperationReuseError";
|
|
33
|
+
readonly code = "WORKSPACE_INSTRUCTION_POLICY_OPERATION_REUSED";
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
21
36
|
export declare class WorkspaceInstructionPolicyNotFoundError extends Error {
|
|
22
37
|
readonly name = "WorkspaceInstructionPolicyNotFoundError";
|
|
23
38
|
constructor(message?: string);
|
|
@@ -40,13 +55,40 @@ export type WorkspaceInstructionPolicyAttemptClaims = {
|
|
|
40
55
|
attemptId: string;
|
|
41
56
|
executionGeneration: number;
|
|
42
57
|
};
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
export type WorkspaceStateAcceptedAttemptGovernance = {
|
|
59
|
+
attemptId: string;
|
|
60
|
+
executionGeneration: number;
|
|
61
|
+
acceptedAt: string;
|
|
62
|
+
policySnapshot: WorkspaceInstructionPolicySnapshot | null;
|
|
63
|
+
preferenceSnapshot: {
|
|
64
|
+
id: string;
|
|
65
|
+
descriptorHash: string;
|
|
66
|
+
descriptors: Array<{
|
|
67
|
+
id: string;
|
|
68
|
+
revisionId: string;
|
|
69
|
+
contentHash: string;
|
|
70
|
+
activeVersion: number;
|
|
71
|
+
scope: "organization" | "workspace" | "user";
|
|
72
|
+
}>;
|
|
73
|
+
truncated: boolean;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
} | null;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Inspect one immutable accepted attempt only when the authenticated caller is
|
|
79
|
+
* exactly its frozen initiating human. The null result deliberately conflates
|
|
80
|
+
* absence, cross-account/workspace lookup, and another subject's attempt.
|
|
81
|
+
*/
|
|
82
|
+
export declare function getWorkspaceStateAcceptedAttemptGovernance(db: Database, input: {
|
|
46
83
|
accountId: string;
|
|
47
84
|
workspaceId: string;
|
|
48
|
-
|
|
49
|
-
|
|
85
|
+
subjectId: string;
|
|
86
|
+
attemptId: string;
|
|
87
|
+
}): Promise<WorkspaceStateAcceptedAttemptGovernance | null>;
|
|
88
|
+
export declare function createWorkspaceInstructionPolicyDraft(db: Database, input: CallerDraftInput): Promise<WorkspaceInstructionPolicyRevision>;
|
|
89
|
+
/** Import only the stored legacy override; never materialize a deployment default or activate it. */
|
|
90
|
+
export declare function importLegacyWorkspaceInstructionPolicyDraft(db: Database, input: Omit<ImportLegacyRequestInput, "operationId"> & {
|
|
91
|
+
operationId?: string;
|
|
50
92
|
}): Promise<WorkspaceInstructionPolicyRevision>;
|
|
51
93
|
export declare function listWorkspaceInstructionPolicyRevisions(db: Database, workspaceId: string, query: WorkspaceInstructionPolicyListQuery): Promise<WorkspaceInstructionPolicyListResponse>;
|
|
52
94
|
export declare function getWorkspaceInstructionPolicyRevision(db: Database, workspaceId: string, revisionId: string): Promise<WorkspaceInstructionPolicyRevision>;
|
|
@@ -57,18 +99,22 @@ export declare function diffWorkspaceInstructionPolicyRevisions(db: Database, wo
|
|
|
57
99
|
toRevisionId: string;
|
|
58
100
|
}): Promise<WorkspaceInstructionPolicyDiffResponse>;
|
|
59
101
|
export declare function activateWorkspaceInstructionPolicyRevision(db: Database, input: {
|
|
102
|
+
operationId?: string;
|
|
60
103
|
accountId: string;
|
|
61
104
|
workspaceId: string;
|
|
62
105
|
revisionId: string;
|
|
63
106
|
expectedCurrentRevisionId: string | null;
|
|
107
|
+
expectedActivationVersion?: number;
|
|
64
108
|
actorSubjectId: string;
|
|
65
109
|
reason: string;
|
|
66
110
|
}): Promise<WorkspaceInstructionPolicyActivationResponse>;
|
|
67
111
|
export declare function rollbackWorkspaceInstructionPolicyRevision(db: Database, input: {
|
|
112
|
+
operationId?: string;
|
|
68
113
|
accountId: string;
|
|
69
114
|
workspaceId: string;
|
|
70
115
|
targetRevisionId: string;
|
|
71
116
|
expectedCurrentRevisionId: string;
|
|
117
|
+
expectedActivationVersion?: number;
|
|
72
118
|
actorSubjectId: string;
|
|
73
119
|
reason: string;
|
|
74
120
|
}): Promise<WorkspaceInstructionPolicyActivationResponse>;
|