thinkwork-cli 0.13.0 → 0.13.1
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/{api-client-JUBCQQDF.js → api-client-4DZ266J5.js} +1 -1
- package/dist/{chunk-STY44FQO.js → chunk-Y2WHJECR.js} +44 -12
- package/dist/cli.js +36715 -12965
- package/dist/drizzle/0227_analyst_reader_role.sql +100 -38
- package/dist/drizzle/0230_analyst_rls.sql +183 -66
- package/dist/drizzle/0232_memory_source_thin_ledger.sql +176 -0
- package/dist/drizzle/0232_message_source_event_id.sql +9 -0
- package/dist/drizzle/0233_msteams_install_and_links.sql +151 -0
- package/dist/drizzle/0233_workflow_memory_stage_tokens.sql +20 -0
- package/dist/drizzle/0234_memory_claim_lifecycle.sql +160 -0
- package/dist/drizzle/0235_workflow_token_execution_claim.sql +34 -0
- package/dist/drizzle/0236_memory_retraction_fencing.sql +50 -0
- package/dist/drizzle/0237_memory_claims_active_value_uidx.sql +172 -0
- package/dist/drizzle/0238_memory_erase_generation_fence.sql +97 -0
- package/dist/drizzle/0239_canonical_entity_identity.sql +257 -0
- package/dist/drizzle/0240_memory_personal_scope.sql +45 -0
- package/dist/drizzle/0241_knowledge_base_document_manifest.sql +67 -0
- package/dist/drizzle/0242_search_queries.sql +28 -0
- package/dist/drizzle/0243_section_sources_thread_refs.sql +12 -0
- package/dist/drizzle/0244_system_automations_and_memory_stage_overrides.sql +45 -0
- package/dist/drizzle/0245_wiki_page_render.sql +21 -0
- package/dist/drizzle/0246_automation_workflow_ownership.sql +30 -0
- package/dist/drizzle/0247_capability_runtime.sql +402 -0
- package/dist/drizzle/0248_capability_private_interpreter.sql +13 -0
- package/dist/drizzle/0249_capability_headless_execution_evidence.sql +40 -0
- package/dist/drizzle/0250_kg_schema_extraction.sql +549 -0
- package/dist/drizzle/0251_agents_json_render_ui.sql +25 -0
- package/dist/drizzle/0251_brain_stragglers.sql +242 -0
- package/dist/drizzle/0252_drop_kg_and_straggler_compat_views.sql +100 -0
- package/dist/drizzle/0253_drop_brain_substrate.sql +91 -0
- package/dist/drizzle/0254_capability_autonomous_admission.sql +29 -0
- package/dist/drizzle/0255_capability_autonomous_approval_mode.sql +16 -0
- package/dist/drizzle/0256_agent_profile_manifest_authority.sql +18 -0
- package/dist/drizzle/0257_capability_approvals.sql +53 -0
- package/dist/drizzle/0258_pending_tool_approvals.sql +84 -0
- package/dist/drizzle/0259_tenant_capability_registry_trust.sql +19 -0
- package/dist/drizzle/0260_scheduled_jobs_run_as_user.sql +20 -0
- package/dist/drizzle/0261_thread_turns_origin_turn_index.sql +11 -0
- package/dist/terraform/examples/greenfield/main.tf +40 -0
- package/dist/terraform/modules/app/agentcore-admin/main.tf +341 -0
- package/dist/terraform/modules/app/agentcore-admin/outputs.tf +20 -0
- package/dist/terraform/modules/app/agentcore-code-interpreter/main.tf +61 -0
- package/dist/terraform/modules/app/agentcore-harness/main.tf +101 -0
- package/dist/terraform/modules/app/agentcore-harness/outputs.tf +9 -0
- package/dist/terraform/modules/app/agentcore-harness/variables.tf +25 -0
- package/dist/terraform/modules/app/agentcore-pi/main.tf +7 -0
- package/dist/terraform/modules/app/capability-broker/main.tf +393 -0
- package/dist/terraform/modules/app/capability-broker/outputs.tf +54 -0
- package/dist/terraform/modules/app/capability-broker/variables.tf +98 -0
- package/dist/terraform/modules/app/deployment-control-plane/runner.py +46 -5
- package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +94 -0
- package/dist/terraform/modules/app/lambda-api/capability-search-alarms.tf +60 -0
- package/dist/terraform/modules/app/lambda-api/handlers.tf +361 -16
- package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +131 -5
- package/dist/terraform/modules/app/lambda-api/main.tf +11 -0
- package/dist/terraform/modules/app/lambda-api/memory-alarms.tf +92 -0
- package/dist/terraform/modules/app/lambda-api/msteams-app-secrets.tf +46 -0
- package/dist/terraform/modules/app/lambda-api/variables.tf +92 -0
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/alarms.tf +47 -0
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/main.tf +43 -2
- package/dist/terraform/modules/foundation/cognito/main.tf +32 -8
- package/dist/terraform/modules/foundation/cognito/variables.tf +12 -0
- package/dist/terraform/modules/foundation/vpc/outputs.tf +5 -0
- package/dist/terraform/modules/thinkwork/main.tf +152 -5
- package/dist/terraform/modules/thinkwork/outputs.tf +55 -0
- package/dist/terraform/modules/thinkwork/variables.tf +42 -0
- package/dist/workspace-defaults/files/TOOLS.md +39 -0
- package/dist/workspace-defaults/files/agents/analyst/INSTRUCTIONS.md +18 -0
- package/dist/workspace-defaults/files/agents/coding/INSTRUCTIONS.md +11 -0
- package/dist/workspace-defaults/files/agents/research/INSTRUCTIONS.md +12 -0
- package/dist/workspace-defaults/files/agents/reviewer/INSTRUCTIONS.md +15 -0
- package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +6 -2
- package/package.json +4 -2
- /package/dist/workspace-defaults/files/{AGENTS.md → INSTRUCTIONS.md} +0 -0
|
@@ -325,26 +325,41 @@ BEGIN
|
|
|
325
325
|
ELSE
|
|
326
326
|
missing := missing || 'billing_export_line_items'::text;
|
|
327
327
|
END IF;
|
|
328
|
-
IF to_regclass('public.
|
|
329
|
-
GRANT SELECT ON public.
|
|
328
|
+
IF to_regclass('public.budget_policies') IS NOT NULL THEN
|
|
329
|
+
GRANT SELECT ON public.budget_policies TO analyst_reader;
|
|
330
330
|
ELSE
|
|
331
|
-
missing := missing || '
|
|
331
|
+
missing := missing || 'budget_policies'::text;
|
|
332
332
|
END IF;
|
|
333
|
-
IF to_regclass('public.
|
|
334
|
-
GRANT SELECT ON public.
|
|
333
|
+
IF to_regclass('public.capability_broker_calls') IS NOT NULL THEN
|
|
334
|
+
GRANT SELECT ON public.capability_broker_calls TO analyst_reader;
|
|
335
335
|
ELSE
|
|
336
|
-
missing := missing || '
|
|
336
|
+
missing := missing || 'capability_broker_calls'::text;
|
|
337
337
|
END IF;
|
|
338
|
-
IF to_regclass('public.
|
|
339
|
-
GRANT SELECT ON public.
|
|
338
|
+
IF to_regclass('public.capability_broker_sessions') IS NOT NULL THEN
|
|
339
|
+
GRANT SELECT ON public.capability_broker_sessions TO analyst_reader;
|
|
340
340
|
ELSE
|
|
341
|
-
missing := missing || '
|
|
341
|
+
missing := missing || 'capability_broker_sessions'::text;
|
|
342
342
|
END IF;
|
|
343
343
|
IF to_regclass('public.capability_catalog') IS NOT NULL THEN
|
|
344
344
|
GRANT SELECT ON public.capability_catalog TO analyst_reader;
|
|
345
345
|
ELSE
|
|
346
346
|
missing := missing || 'capability_catalog'::text;
|
|
347
347
|
END IF;
|
|
348
|
+
IF to_regclass('public.capability_connection_proposals') IS NOT NULL THEN
|
|
349
|
+
GRANT SELECT ON public.capability_connection_proposals TO analyst_reader;
|
|
350
|
+
ELSE
|
|
351
|
+
missing := missing || 'capability_connection_proposals'::text;
|
|
352
|
+
END IF;
|
|
353
|
+
IF to_regclass('public.capability_definitions') IS NOT NULL THEN
|
|
354
|
+
GRANT SELECT ON public.capability_definitions TO analyst_reader;
|
|
355
|
+
ELSE
|
|
356
|
+
missing := missing || 'capability_definitions'::text;
|
|
357
|
+
END IF;
|
|
358
|
+
IF to_regclass('public.capability_routine_proposals') IS NOT NULL THEN
|
|
359
|
+
GRANT SELECT ON public.capability_routine_proposals TO analyst_reader;
|
|
360
|
+
ELSE
|
|
361
|
+
missing := missing || 'capability_routine_proposals'::text;
|
|
362
|
+
END IF;
|
|
348
363
|
IF to_regclass('public.connections') IS NOT NULL THEN
|
|
349
364
|
GRANT SELECT ON public.connections TO analyst_reader;
|
|
350
365
|
ELSE
|
|
@@ -510,36 +525,16 @@ BEGIN
|
|
|
510
525
|
ELSE
|
|
511
526
|
missing := missing || 'inbox_items'::text;
|
|
512
527
|
END IF;
|
|
528
|
+
IF to_regclass('public.knowledge_base_documents') IS NOT NULL THEN
|
|
529
|
+
GRANT SELECT ON public.knowledge_base_documents TO analyst_reader;
|
|
530
|
+
ELSE
|
|
531
|
+
missing := missing || 'knowledge_base_documents'::text;
|
|
532
|
+
END IF;
|
|
513
533
|
IF to_regclass('public.knowledge_bases') IS NOT NULL THEN
|
|
514
534
|
GRANT SELECT ON public.knowledge_bases TO analyst_reader;
|
|
515
535
|
ELSE
|
|
516
536
|
missing := missing || 'knowledge_bases'::text;
|
|
517
537
|
END IF;
|
|
518
|
-
IF to_regclass('public.knowledge_graph_entities') IS NOT NULL THEN
|
|
519
|
-
GRANT SELECT ON public.knowledge_graph_entities TO analyst_reader;
|
|
520
|
-
ELSE
|
|
521
|
-
missing := missing || 'knowledge_graph_entities'::text;
|
|
522
|
-
END IF;
|
|
523
|
-
IF to_regclass('public.knowledge_graph_evidence') IS NOT NULL THEN
|
|
524
|
-
GRANT SELECT ON public.knowledge_graph_evidence TO analyst_reader;
|
|
525
|
-
ELSE
|
|
526
|
-
missing := missing || 'knowledge_graph_evidence'::text;
|
|
527
|
-
END IF;
|
|
528
|
-
IF to_regclass('public.knowledge_graph_ingest_runs') IS NOT NULL THEN
|
|
529
|
-
GRANT SELECT ON public.knowledge_graph_ingest_runs TO analyst_reader;
|
|
530
|
-
ELSE
|
|
531
|
-
missing := missing || 'knowledge_graph_ingest_runs'::text;
|
|
532
|
-
END IF;
|
|
533
|
-
IF to_regclass('public.knowledge_graph_observation_cursors') IS NOT NULL THEN
|
|
534
|
-
GRANT SELECT ON public.knowledge_graph_observation_cursors TO analyst_reader;
|
|
535
|
-
ELSE
|
|
536
|
-
missing := missing || 'knowledge_graph_observation_cursors'::text;
|
|
537
|
-
END IF;
|
|
538
|
-
IF to_regclass('public.knowledge_graph_relationships') IS NOT NULL THEN
|
|
539
|
-
GRANT SELECT ON public.knowledge_graph_relationships TO analyst_reader;
|
|
540
|
-
ELSE
|
|
541
|
-
missing := missing || 'knowledge_graph_relationships'::text;
|
|
542
|
-
END IF;
|
|
543
538
|
IF to_regclass('public.linked_task_events') IS NOT NULL THEN
|
|
544
539
|
GRANT SELECT ON public.linked_task_events TO analyst_reader;
|
|
545
540
|
ELSE
|
|
@@ -565,10 +560,57 @@ BEGIN
|
|
|
565
560
|
ELSE
|
|
566
561
|
missing := missing || 'managed_applications'::text;
|
|
567
562
|
END IF;
|
|
568
|
-
IF to_regclass('public.
|
|
569
|
-
GRANT SELECT ON public.
|
|
563
|
+
IF to_regclass('public.memory_claim_evidence') IS NOT NULL THEN
|
|
564
|
+
GRANT SELECT ON public.memory_claim_evidence TO analyst_reader;
|
|
565
|
+
ELSE
|
|
566
|
+
missing := missing || 'memory_claim_evidence'::text;
|
|
567
|
+
END IF;
|
|
568
|
+
IF to_regclass('public.memory_claims') IS NOT NULL THEN
|
|
569
|
+
REVOKE ALL PRIVILEGES ON public.memory_claims FROM analyst_reader;
|
|
570
|
+
GRANT SELECT (canonical_subject_id, conflict_state, created_at, effective_from, effective_to, extraction_version, id, ontology_predicate, status, subject_entity_type, subject_key, target_id, target_scope, tenant_id, updated_at, value_hash) ON public.memory_claims TO analyst_reader;
|
|
571
|
+
ELSE
|
|
572
|
+
missing := missing || 'memory_claims'::text;
|
|
573
|
+
END IF;
|
|
574
|
+
IF to_regclass('public.memory_derivations') IS NOT NULL THEN
|
|
575
|
+
GRANT SELECT ON public.memory_derivations TO analyst_reader;
|
|
576
|
+
ELSE
|
|
577
|
+
missing := missing || 'memory_derivations'::text;
|
|
578
|
+
END IF;
|
|
579
|
+
IF to_regclass('public.memory_evidence_items') IS NOT NULL THEN
|
|
580
|
+
REVOKE ALL PRIVILEGES ON public.memory_evidence_items FROM analyst_reader;
|
|
581
|
+
GRANT SELECT (acquisition_run_id, content_hash, created_at, extraction_recipe, id, last_error, lifecycle, sensitivity, snapshot_expires_at, snapshot_ref, source_config_id, source_item_id, source_timestamp, source_version, target_id, target_scope, tenant_id, updated_at) ON public.memory_evidence_items TO analyst_reader;
|
|
582
|
+
ELSE
|
|
583
|
+
missing := missing || 'memory_evidence_items'::text;
|
|
584
|
+
END IF;
|
|
585
|
+
IF to_regclass('public.memory_processor_configs') IS NOT NULL THEN
|
|
586
|
+
GRANT SELECT ON public.memory_processor_configs TO analyst_reader;
|
|
587
|
+
ELSE
|
|
588
|
+
missing := missing || 'memory_processor_configs'::text;
|
|
589
|
+
END IF;
|
|
590
|
+
IF to_regclass('public.memory_retraction_attempts') IS NOT NULL THEN
|
|
591
|
+
GRANT SELECT ON public.memory_retraction_attempts TO analyst_reader;
|
|
592
|
+
ELSE
|
|
593
|
+
missing := missing || 'memory_retraction_attempts'::text;
|
|
594
|
+
END IF;
|
|
595
|
+
IF to_regclass('public.memory_run_items') IS NOT NULL THEN
|
|
596
|
+
GRANT SELECT ON public.memory_run_items TO analyst_reader;
|
|
597
|
+
ELSE
|
|
598
|
+
missing := missing || 'memory_run_items'::text;
|
|
599
|
+
END IF;
|
|
600
|
+
IF to_regclass('public.memory_source_authorizations') IS NOT NULL THEN
|
|
601
|
+
GRANT SELECT ON public.memory_source_authorizations TO analyst_reader;
|
|
570
602
|
ELSE
|
|
571
|
-
missing := missing || '
|
|
603
|
+
missing := missing || 'memory_source_authorizations'::text;
|
|
604
|
+
END IF;
|
|
605
|
+
IF to_regclass('public.memory_source_checkpoints') IS NOT NULL THEN
|
|
606
|
+
GRANT SELECT ON public.memory_source_checkpoints TO analyst_reader;
|
|
607
|
+
ELSE
|
|
608
|
+
missing := missing || 'memory_source_checkpoints'::text;
|
|
609
|
+
END IF;
|
|
610
|
+
IF to_regclass('public.memory_source_configs') IS NOT NULL THEN
|
|
611
|
+
GRANT SELECT ON public.memory_source_configs TO analyst_reader;
|
|
612
|
+
ELSE
|
|
613
|
+
missing := missing || 'memory_source_configs'::text;
|
|
572
614
|
END IF;
|
|
573
615
|
IF to_regclass('public.message_artifacts') IS NOT NULL THEN
|
|
574
616
|
GRANT SELECT ON public.message_artifacts TO analyst_reader;
|
|
@@ -590,6 +632,21 @@ BEGIN
|
|
|
590
632
|
ELSE
|
|
591
633
|
missing := missing || 'model_catalog'::text;
|
|
592
634
|
END IF;
|
|
635
|
+
IF to_regclass('public.msteams_tenant_installs') IS NOT NULL THEN
|
|
636
|
+
GRANT SELECT ON public.msteams_tenant_installs TO analyst_reader;
|
|
637
|
+
ELSE
|
|
638
|
+
missing := missing || 'msteams_tenant_installs'::text;
|
|
639
|
+
END IF;
|
|
640
|
+
IF to_regclass('public.msteams_threads') IS NOT NULL THEN
|
|
641
|
+
GRANT SELECT ON public.msteams_threads TO analyst_reader;
|
|
642
|
+
ELSE
|
|
643
|
+
missing := missing || 'msteams_threads'::text;
|
|
644
|
+
END IF;
|
|
645
|
+
IF to_regclass('public.msteams_user_links') IS NOT NULL THEN
|
|
646
|
+
GRANT SELECT ON public.msteams_user_links TO analyst_reader;
|
|
647
|
+
ELSE
|
|
648
|
+
missing := missing || 'msteams_user_links'::text;
|
|
649
|
+
END IF;
|
|
593
650
|
IF to_regclass('public.mutation_idempotency') IS NOT NULL THEN
|
|
594
651
|
GRANT SELECT ON public.mutation_idempotency TO analyst_reader;
|
|
595
652
|
ELSE
|
|
@@ -697,7 +754,7 @@ BEGIN
|
|
|
697
754
|
END IF;
|
|
698
755
|
IF to_regclass('public.routines') IS NOT NULL THEN
|
|
699
756
|
REVOKE ALL PRIVILEGES ON public.routines FROM analyst_reader;
|
|
700
|
-
GRANT SELECT (agent_id, catalog_slug, config, created_at, current_version, description, disabled_reason, documentation_md, engine, fixture_paths, id, last_run_at, module_path, name, next_run_at, owning_agent_id, schedule, state_machine_alias_arn, state_machine_arn, status, tenant_id, type, updated_at, validated_sha, visibility) ON public.routines TO analyst_reader;
|
|
757
|
+
GRANT SELECT (agent_id, capability_dependencies, catalog_slug, config, created_at, current_version, description, disabled_reason, documentation_md, engine, execution_principal, fixture_paths, id, last_run_at, module_path, name, next_run_at, owning_agent_id, schedule, state_machine_alias_arn, state_machine_arn, status, tenant_id, type, updated_at, validated_sha, visibility) ON public.routines TO analyst_reader;
|
|
701
758
|
ELSE
|
|
702
759
|
missing := missing || 'routines'::text;
|
|
703
760
|
END IF;
|
|
@@ -835,6 +892,11 @@ BEGIN
|
|
|
835
892
|
ELSE
|
|
836
893
|
missing := missing || 'tenant_policy_events'::text;
|
|
837
894
|
END IF;
|
|
895
|
+
IF to_regclass('public.tenant_service_principals') IS NOT NULL THEN
|
|
896
|
+
GRANT SELECT ON public.tenant_service_principals TO analyst_reader;
|
|
897
|
+
ELSE
|
|
898
|
+
missing := missing || 'tenant_service_principals'::text;
|
|
899
|
+
END IF;
|
|
838
900
|
IF to_regclass('public.tenant_settings') IS NOT NULL THEN
|
|
839
901
|
GRANT SELECT ON public.tenant_settings TO analyst_reader;
|
|
840
902
|
ELSE
|
|
@@ -62,6 +62,15 @@
|
|
|
62
62
|
-- creates-policy: public.agent_operation_leases.analyst_tenant_isolation
|
|
63
63
|
-- creates-policy: public.eval_results.analyst_tenant_isolation
|
|
64
64
|
-- creates-policy: public.plugin_components.analyst_tenant_isolation
|
|
65
|
+
--
|
|
66
|
+
-- THINK-84 U6: the msteams tables landed after this file was first applied,
|
|
67
|
+
-- so their policies are declared explicitly — the drift gate must force a
|
|
68
|
+
-- re-apply on databases that ran 0230 before the msteams tables existed.
|
|
69
|
+
-- (0227's grants for the same tables are not marker-checkable; re-apply
|
|
70
|
+
-- 0227 alongside 0233 and this file — see the 0233 header.)
|
|
71
|
+
-- creates-policy: public.msteams_tenant_installs.analyst_tenant_isolation
|
|
72
|
+
-- creates-policy: public.msteams_user_links.analyst_tenant_isolation
|
|
73
|
+
-- creates-policy: public.msteams_threads.analyst_tenant_isolation
|
|
65
74
|
|
|
66
75
|
\set ON_ERROR_STOP on
|
|
67
76
|
|
|
@@ -335,32 +344,59 @@ BEGIN
|
|
|
335
344
|
ELSE
|
|
336
345
|
missing := missing || 'billing_export_line_items'::text;
|
|
337
346
|
END IF;
|
|
338
|
-
IF to_regclass('public.
|
|
339
|
-
ALTER TABLE public.
|
|
340
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.
|
|
341
|
-
CREATE POLICY analyst_tenant_isolation ON public.
|
|
347
|
+
IF to_regclass('public.budget_policies') IS NOT NULL THEN
|
|
348
|
+
ALTER TABLE public.budget_policies ENABLE ROW LEVEL SECURITY;
|
|
349
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.budget_policies;
|
|
350
|
+
CREATE POLICY analyst_tenant_isolation ON public.budget_policies
|
|
342
351
|
FOR SELECT TO analyst_reader
|
|
343
|
-
USING (
|
|
352
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
344
353
|
ELSE
|
|
345
|
-
missing := missing || '
|
|
354
|
+
missing := missing || 'budget_policies'::text;
|
|
346
355
|
END IF;
|
|
347
|
-
IF to_regclass('public.
|
|
348
|
-
ALTER TABLE public.
|
|
349
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.
|
|
350
|
-
CREATE POLICY analyst_tenant_isolation ON public.
|
|
356
|
+
IF to_regclass('public.capability_broker_calls') IS NOT NULL THEN
|
|
357
|
+
ALTER TABLE public.capability_broker_calls ENABLE ROW LEVEL SECURITY;
|
|
358
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.capability_broker_calls;
|
|
359
|
+
CREATE POLICY analyst_tenant_isolation ON public.capability_broker_calls
|
|
351
360
|
FOR SELECT TO analyst_reader
|
|
352
361
|
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
353
362
|
ELSE
|
|
354
|
-
missing := missing || '
|
|
363
|
+
missing := missing || 'capability_broker_calls'::text;
|
|
355
364
|
END IF;
|
|
356
|
-
IF to_regclass('public.
|
|
357
|
-
ALTER TABLE public.
|
|
358
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.
|
|
359
|
-
CREATE POLICY analyst_tenant_isolation ON public.
|
|
365
|
+
IF to_regclass('public.capability_broker_sessions') IS NOT NULL THEN
|
|
366
|
+
ALTER TABLE public.capability_broker_sessions ENABLE ROW LEVEL SECURITY;
|
|
367
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.capability_broker_sessions;
|
|
368
|
+
CREATE POLICY analyst_tenant_isolation ON public.capability_broker_sessions
|
|
360
369
|
FOR SELECT TO analyst_reader
|
|
361
370
|
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
362
371
|
ELSE
|
|
363
|
-
missing := missing || '
|
|
372
|
+
missing := missing || 'capability_broker_sessions'::text;
|
|
373
|
+
END IF;
|
|
374
|
+
IF to_regclass('public.capability_connection_proposals') IS NOT NULL THEN
|
|
375
|
+
ALTER TABLE public.capability_connection_proposals ENABLE ROW LEVEL SECURITY;
|
|
376
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.capability_connection_proposals;
|
|
377
|
+
CREATE POLICY analyst_tenant_isolation ON public.capability_connection_proposals
|
|
378
|
+
FOR SELECT TO analyst_reader
|
|
379
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
380
|
+
ELSE
|
|
381
|
+
missing := missing || 'capability_connection_proposals'::text;
|
|
382
|
+
END IF;
|
|
383
|
+
IF to_regclass('public.capability_definitions') IS NOT NULL THEN
|
|
384
|
+
ALTER TABLE public.capability_definitions ENABLE ROW LEVEL SECURITY;
|
|
385
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.capability_definitions;
|
|
386
|
+
CREATE POLICY analyst_tenant_isolation ON public.capability_definitions
|
|
387
|
+
FOR SELECT TO analyst_reader
|
|
388
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
389
|
+
ELSE
|
|
390
|
+
missing := missing || 'capability_definitions'::text;
|
|
391
|
+
END IF;
|
|
392
|
+
IF to_regclass('public.capability_routine_proposals') IS NOT NULL THEN
|
|
393
|
+
ALTER TABLE public.capability_routine_proposals ENABLE ROW LEVEL SECURITY;
|
|
394
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.capability_routine_proposals;
|
|
395
|
+
CREATE POLICY analyst_tenant_isolation ON public.capability_routine_proposals
|
|
396
|
+
FOR SELECT TO analyst_reader
|
|
397
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
398
|
+
ELSE
|
|
399
|
+
missing := missing || 'capability_routine_proposals'::text;
|
|
364
400
|
END IF;
|
|
365
401
|
IF to_regclass('public.connections') IS NOT NULL THEN
|
|
366
402
|
ALTER TABLE public.connections ENABLE ROW LEVEL SECURITY;
|
|
@@ -659,6 +695,15 @@ BEGIN
|
|
|
659
695
|
ELSE
|
|
660
696
|
missing := missing || 'inbox_items'::text;
|
|
661
697
|
END IF;
|
|
698
|
+
IF to_regclass('public.knowledge_base_documents') IS NOT NULL THEN
|
|
699
|
+
ALTER TABLE public.knowledge_base_documents ENABLE ROW LEVEL SECURITY;
|
|
700
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_base_documents;
|
|
701
|
+
CREATE POLICY analyst_tenant_isolation ON public.knowledge_base_documents
|
|
702
|
+
FOR SELECT TO analyst_reader
|
|
703
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
704
|
+
ELSE
|
|
705
|
+
missing := missing || 'knowledge_base_documents'::text;
|
|
706
|
+
END IF;
|
|
662
707
|
IF to_regclass('public.knowledge_bases') IS NOT NULL THEN
|
|
663
708
|
ALTER TABLE public.knowledge_bases ENABLE ROW LEVEL SECURITY;
|
|
664
709
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_bases;
|
|
@@ -668,51 +713,6 @@ BEGIN
|
|
|
668
713
|
ELSE
|
|
669
714
|
missing := missing || 'knowledge_bases'::text;
|
|
670
715
|
END IF;
|
|
671
|
-
IF to_regclass('public.knowledge_graph_entities') IS NOT NULL THEN
|
|
672
|
-
ALTER TABLE public.knowledge_graph_entities ENABLE ROW LEVEL SECURITY;
|
|
673
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_graph_entities;
|
|
674
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_graph_entities
|
|
675
|
-
FOR SELECT TO analyst_reader
|
|
676
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
677
|
-
ELSE
|
|
678
|
-
missing := missing || 'knowledge_graph_entities'::text;
|
|
679
|
-
END IF;
|
|
680
|
-
IF to_regclass('public.knowledge_graph_evidence') IS NOT NULL THEN
|
|
681
|
-
ALTER TABLE public.knowledge_graph_evidence ENABLE ROW LEVEL SECURITY;
|
|
682
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_graph_evidence;
|
|
683
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_graph_evidence
|
|
684
|
-
FOR SELECT TO analyst_reader
|
|
685
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
686
|
-
ELSE
|
|
687
|
-
missing := missing || 'knowledge_graph_evidence'::text;
|
|
688
|
-
END IF;
|
|
689
|
-
IF to_regclass('public.knowledge_graph_ingest_runs') IS NOT NULL THEN
|
|
690
|
-
ALTER TABLE public.knowledge_graph_ingest_runs ENABLE ROW LEVEL SECURITY;
|
|
691
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_graph_ingest_runs;
|
|
692
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_graph_ingest_runs
|
|
693
|
-
FOR SELECT TO analyst_reader
|
|
694
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
695
|
-
ELSE
|
|
696
|
-
missing := missing || 'knowledge_graph_ingest_runs'::text;
|
|
697
|
-
END IF;
|
|
698
|
-
IF to_regclass('public.knowledge_graph_observation_cursors') IS NOT NULL THEN
|
|
699
|
-
ALTER TABLE public.knowledge_graph_observation_cursors ENABLE ROW LEVEL SECURITY;
|
|
700
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_graph_observation_cursors;
|
|
701
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_graph_observation_cursors
|
|
702
|
-
FOR SELECT TO analyst_reader
|
|
703
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
704
|
-
ELSE
|
|
705
|
-
missing := missing || 'knowledge_graph_observation_cursors'::text;
|
|
706
|
-
END IF;
|
|
707
|
-
IF to_regclass('public.knowledge_graph_relationships') IS NOT NULL THEN
|
|
708
|
-
ALTER TABLE public.knowledge_graph_relationships ENABLE ROW LEVEL SECURITY;
|
|
709
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_graph_relationships;
|
|
710
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_graph_relationships
|
|
711
|
-
FOR SELECT TO analyst_reader
|
|
712
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
713
|
-
ELSE
|
|
714
|
-
missing := missing || 'knowledge_graph_relationships'::text;
|
|
715
|
-
END IF;
|
|
716
716
|
IF to_regclass('public.linked_task_events') IS NOT NULL THEN
|
|
717
717
|
ALTER TABLE public.linked_task_events ENABLE ROW LEVEL SECURITY;
|
|
718
718
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.linked_task_events;
|
|
@@ -758,14 +758,95 @@ BEGIN
|
|
|
758
758
|
ELSE
|
|
759
759
|
missing := missing || 'managed_applications'::text;
|
|
760
760
|
END IF;
|
|
761
|
-
IF to_regclass('public.
|
|
762
|
-
ALTER TABLE public.
|
|
763
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.
|
|
764
|
-
CREATE POLICY analyst_tenant_isolation ON public.
|
|
761
|
+
IF to_regclass('public.memory_claim_evidence') IS NOT NULL THEN
|
|
762
|
+
ALTER TABLE public.memory_claim_evidence ENABLE ROW LEVEL SECURITY;
|
|
763
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_claim_evidence;
|
|
764
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_claim_evidence
|
|
765
|
+
FOR SELECT TO analyst_reader
|
|
766
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
767
|
+
ELSE
|
|
768
|
+
missing := missing || 'memory_claim_evidence'::text;
|
|
769
|
+
END IF;
|
|
770
|
+
IF to_regclass('public.memory_claims') IS NOT NULL THEN
|
|
771
|
+
ALTER TABLE public.memory_claims ENABLE ROW LEVEL SECURITY;
|
|
772
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_claims;
|
|
773
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_claims
|
|
774
|
+
FOR SELECT TO analyst_reader
|
|
775
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
776
|
+
ELSE
|
|
777
|
+
missing := missing || 'memory_claims'::text;
|
|
778
|
+
END IF;
|
|
779
|
+
IF to_regclass('public.memory_derivations') IS NOT NULL THEN
|
|
780
|
+
ALTER TABLE public.memory_derivations ENABLE ROW LEVEL SECURITY;
|
|
781
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_derivations;
|
|
782
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_derivations
|
|
783
|
+
FOR SELECT TO analyst_reader
|
|
784
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
785
|
+
ELSE
|
|
786
|
+
missing := missing || 'memory_derivations'::text;
|
|
787
|
+
END IF;
|
|
788
|
+
IF to_regclass('public.memory_evidence_items') IS NOT NULL THEN
|
|
789
|
+
ALTER TABLE public.memory_evidence_items ENABLE ROW LEVEL SECURITY;
|
|
790
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_evidence_items;
|
|
791
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_evidence_items
|
|
792
|
+
FOR SELECT TO analyst_reader
|
|
793
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
794
|
+
ELSE
|
|
795
|
+
missing := missing || 'memory_evidence_items'::text;
|
|
796
|
+
END IF;
|
|
797
|
+
IF to_regclass('public.memory_processor_configs') IS NOT NULL THEN
|
|
798
|
+
ALTER TABLE public.memory_processor_configs ENABLE ROW LEVEL SECURITY;
|
|
799
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_processor_configs;
|
|
800
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_processor_configs
|
|
801
|
+
FOR SELECT TO analyst_reader
|
|
802
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
803
|
+
ELSE
|
|
804
|
+
missing := missing || 'memory_processor_configs'::text;
|
|
805
|
+
END IF;
|
|
806
|
+
IF to_regclass('public.memory_retraction_attempts') IS NOT NULL THEN
|
|
807
|
+
ALTER TABLE public.memory_retraction_attempts ENABLE ROW LEVEL SECURITY;
|
|
808
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_retraction_attempts;
|
|
809
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_retraction_attempts
|
|
810
|
+
FOR SELECT TO analyst_reader
|
|
811
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
812
|
+
ELSE
|
|
813
|
+
missing := missing || 'memory_retraction_attempts'::text;
|
|
814
|
+
END IF;
|
|
815
|
+
IF to_regclass('public.memory_run_items') IS NOT NULL THEN
|
|
816
|
+
ALTER TABLE public.memory_run_items ENABLE ROW LEVEL SECURITY;
|
|
817
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_run_items;
|
|
818
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_run_items
|
|
819
|
+
FOR SELECT TO analyst_reader
|
|
820
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
821
|
+
ELSE
|
|
822
|
+
missing := missing || 'memory_run_items'::text;
|
|
823
|
+
END IF;
|
|
824
|
+
IF to_regclass('public.memory_source_authorizations') IS NOT NULL THEN
|
|
825
|
+
ALTER TABLE public.memory_source_authorizations ENABLE ROW LEVEL SECURITY;
|
|
826
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_source_authorizations;
|
|
827
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_source_authorizations
|
|
765
828
|
FOR SELECT TO analyst_reader
|
|
766
829
|
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
767
830
|
ELSE
|
|
768
|
-
missing := missing || '
|
|
831
|
+
missing := missing || 'memory_source_authorizations'::text;
|
|
832
|
+
END IF;
|
|
833
|
+
IF to_regclass('public.memory_source_checkpoints') IS NOT NULL THEN
|
|
834
|
+
ALTER TABLE public.memory_source_checkpoints ENABLE ROW LEVEL SECURITY;
|
|
835
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_source_checkpoints;
|
|
836
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_source_checkpoints
|
|
837
|
+
FOR SELECT TO analyst_reader
|
|
838
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
839
|
+
ELSE
|
|
840
|
+
missing := missing || 'memory_source_checkpoints'::text;
|
|
841
|
+
END IF;
|
|
842
|
+
IF to_regclass('public.memory_source_configs') IS NOT NULL THEN
|
|
843
|
+
ALTER TABLE public.memory_source_configs ENABLE ROW LEVEL SECURITY;
|
|
844
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.memory_source_configs;
|
|
845
|
+
CREATE POLICY analyst_tenant_isolation ON public.memory_source_configs
|
|
846
|
+
FOR SELECT TO analyst_reader
|
|
847
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
848
|
+
ELSE
|
|
849
|
+
missing := missing || 'memory_source_configs'::text;
|
|
769
850
|
END IF;
|
|
770
851
|
IF to_regclass('public.message_artifacts') IS NOT NULL THEN
|
|
771
852
|
ALTER TABLE public.message_artifacts ENABLE ROW LEVEL SECURITY;
|
|
@@ -794,6 +875,33 @@ BEGIN
|
|
|
794
875
|
ELSE
|
|
795
876
|
missing := missing || 'messages'::text;
|
|
796
877
|
END IF;
|
|
878
|
+
IF to_regclass('public.msteams_tenant_installs') IS NOT NULL THEN
|
|
879
|
+
ALTER TABLE public.msteams_tenant_installs ENABLE ROW LEVEL SECURITY;
|
|
880
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.msteams_tenant_installs;
|
|
881
|
+
CREATE POLICY analyst_tenant_isolation ON public.msteams_tenant_installs
|
|
882
|
+
FOR SELECT TO analyst_reader
|
|
883
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
884
|
+
ELSE
|
|
885
|
+
missing := missing || 'msteams_tenant_installs'::text;
|
|
886
|
+
END IF;
|
|
887
|
+
IF to_regclass('public.msteams_threads') IS NOT NULL THEN
|
|
888
|
+
ALTER TABLE public.msteams_threads ENABLE ROW LEVEL SECURITY;
|
|
889
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.msteams_threads;
|
|
890
|
+
CREATE POLICY analyst_tenant_isolation ON public.msteams_threads
|
|
891
|
+
FOR SELECT TO analyst_reader
|
|
892
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
893
|
+
ELSE
|
|
894
|
+
missing := missing || 'msteams_threads'::text;
|
|
895
|
+
END IF;
|
|
896
|
+
IF to_regclass('public.msteams_user_links') IS NOT NULL THEN
|
|
897
|
+
ALTER TABLE public.msteams_user_links ENABLE ROW LEVEL SECURITY;
|
|
898
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.msteams_user_links;
|
|
899
|
+
CREATE POLICY analyst_tenant_isolation ON public.msteams_user_links
|
|
900
|
+
FOR SELECT TO analyst_reader
|
|
901
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
902
|
+
ELSE
|
|
903
|
+
missing := missing || 'msteams_user_links'::text;
|
|
904
|
+
END IF;
|
|
797
905
|
IF to_regclass('public.mutation_idempotency') IS NOT NULL THEN
|
|
798
906
|
ALTER TABLE public.mutation_idempotency ENABLE ROW LEVEL SECURITY;
|
|
799
907
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.mutation_idempotency;
|
|
@@ -1226,6 +1334,15 @@ BEGIN
|
|
|
1226
1334
|
ELSE
|
|
1227
1335
|
missing := missing || 'tenant_policy_events'::text;
|
|
1228
1336
|
END IF;
|
|
1337
|
+
IF to_regclass('public.tenant_service_principals') IS NOT NULL THEN
|
|
1338
|
+
ALTER TABLE public.tenant_service_principals ENABLE ROW LEVEL SECURITY;
|
|
1339
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.tenant_service_principals;
|
|
1340
|
+
CREATE POLICY analyst_tenant_isolation ON public.tenant_service_principals
|
|
1341
|
+
FOR SELECT TO analyst_reader
|
|
1342
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
1343
|
+
ELSE
|
|
1344
|
+
missing := missing || 'tenant_service_principals'::text;
|
|
1345
|
+
END IF;
|
|
1229
1346
|
IF to_regclass('public.tenant_settings') IS NOT NULL THEN
|
|
1230
1347
|
ALTER TABLE public.tenant_settings ENABLE ROW LEVEL SECURITY;
|
|
1231
1348
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.tenant_settings;
|