thinkwork-cli 0.13.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +3 -14
  2. package/dist/{api-client-4DZ266J5.js → api-client-4P4JZOBX.js} +3 -1
  3. package/dist/bowser-6Z6JFAIR.js +2822 -0
  4. package/dist/{chunk-Y2WHJECR.js → chunk-4OMDWYZQ.js} +5 -44
  5. package/dist/chunk-AD2NIWB5.js +6516 -0
  6. package/dist/chunk-DV3MRBR5.js +43 -0
  7. package/dist/chunk-EI5ZX7CN.js +522 -0
  8. package/dist/chunk-EUJ7X6YD.js +126 -0
  9. package/dist/chunk-GG5WKBOX.js +436 -0
  10. package/dist/chunk-I64EZSU5.js +358 -0
  11. package/dist/chunk-KMIJ5KGT.js +128 -0
  12. package/dist/chunk-MWQ7RO76.js +137 -0
  13. package/dist/chunk-OCPHU34C.js +996 -0
  14. package/dist/chunk-OLUQ4U2Z.js +1728 -0
  15. package/dist/chunk-XYM7PE2A.js +2264 -0
  16. package/dist/chunk-YQCYD6NE.js +3299 -0
  17. package/dist/cli.js +49156 -31257
  18. package/dist/commands/enterprise/templates/deploy-repo/scripts/apply-release.mjs +0 -1
  19. package/dist/commands/enterprise/templates/deploy-repo/scripts/smoke.mjs +0 -1
  20. package/dist/commands/enterprise/templates/deploy-repo/terraform/main.tf +0 -14
  21. package/dist/dist-es-2OTNTL4N.js +315 -0
  22. package/dist/dist-es-2XVAH4BQ.js +14726 -0
  23. package/dist/dist-es-3DPDUJAH.js +2000 -0
  24. package/dist/dist-es-BNZTBBVC.js +176 -0
  25. package/dist/dist-es-CD2RBDAC.js +88 -0
  26. package/dist/dist-es-I4FW57PS.js +88 -0
  27. package/dist/dist-es-KL7Y5NB2.js +377 -0
  28. package/dist/dist-es-KVFWJNDY.js +318 -0
  29. package/dist/dist-es-PS73DWNL.js +70 -0
  30. package/dist/dist-es-S3NZQFGT.js +170 -0
  31. package/dist/dist-es-SGCA4P32.js +48 -0
  32. package/dist/dist-es-WBM6J4RA.js +70 -0
  33. package/dist/dist-es-ZGVADYIF.js +485 -0
  34. package/dist/dist-es-ZKC2QKD2.js +377 -0
  35. package/dist/drizzle/0076_scheduled_jobs_marco_backfill.sql +2 -1
  36. package/dist/drizzle/0079_seed_tenant_customize_catalog.sql +1 -0
  37. package/dist/drizzle/0090_brain_schema_extraction.sql +10 -0
  38. package/dist/drizzle/0132_drop_computer_tables.sql +3 -0
  39. package/dist/drizzle/0160_compliance_event_types_plugins.sql +2 -0
  40. package/dist/drizzle/0214_think137_drop_judge_evidence_roi.sql +1 -0
  41. package/dist/drizzle/0216_drop_agent_loop_versions_goal_worker_policy.sql +1 -0
  42. package/dist/drizzle/0227_analyst_reader_role.sql +17 -20
  43. package/dist/drizzle/0230_analyst_rls.sql +28 -36
  44. package/dist/drizzle/0250_kg_schema_extraction.sql +27 -0
  45. package/dist/drizzle/0251_brain_stragglers.sql +21 -0
  46. package/dist/drizzle/0253_drop_brain_substrate.sql +2 -0
  47. package/dist/drizzle/0257_agents_runtime_allow_harness.sql +24 -0
  48. package/dist/drizzle/0261_native_auth_control_plane.sql +332 -0
  49. package/dist/drizzle/0262_auth_subscription_tickets.sql +59 -0
  50. package/dist/drizzle/0263_agentcore_runtime_identifier.sql +69 -0
  51. package/dist/drizzle/0263_drop_workos_auth_runtime.sql +236 -0
  52. package/dist/drizzle/0264_auth_enrollment_attempt_limits.sql +15 -0
  53. package/dist/drizzle/0265_eval_runs_requester_identity.sql +28 -0
  54. package/dist/drizzle/0265_require_fully_valid_auth_publication.sql +27 -0
  55. package/dist/drizzle/0266_auth_identity_recovery_grants.sql +9 -0
  56. package/dist/drizzle/0266_eval_profiles_runtime_type.sql +12 -0
  57. package/dist/drizzle/0267_ontology_candidate_rejections.sql +53 -0
  58. package/dist/drizzle/0268_identity_crosswalk_routing.sql +182 -0
  59. package/dist/drizzle/0269_ontology_system_map.sql +31 -0
  60. package/dist/drizzle/0270_tool_execution_ledger.sql +115 -0
  61. package/dist/drizzle/0271_ontology_twin_declarations.sql +47 -0
  62. package/dist/drizzle/0272_identity_graph_projection_cursor.sql +23 -0
  63. package/dist/drizzle/0273_twin_materialization_suggestions.sql +29 -0
  64. package/dist/drizzle/0274_tenant_mcp_twin_keys.sql +59 -0
  65. package/dist/drizzle/0275_identity_bulk_rebuild_fence.sql +30 -0
  66. package/dist/drizzle/0276_tool_execution_ledger_allow_cascade_delete.sql +18 -0
  67. package/dist/drizzle/0277_knowledge_base_sources.sql +107 -0
  68. package/dist/drizzle/0278_kb_page_transcription.sql +55 -0
  69. package/dist/drizzle/0279_mcp_servers_off_plugin_provenance.sql +93 -0
  70. package/dist/drizzle/0280_work_item_external_refs_drop_plane_provider.sql +46 -0
  71. package/dist/drizzle/0281_tenant_mcp_twin_keys_expiry_suffix.sql +9 -0
  72. package/dist/drizzle/0282_tenant_mcp_twin_keys_grants.sql +24 -0
  73. package/dist/drizzle/0283_agents_agentcore_runtime_dispatch.sql +13 -0
  74. package/dist/drizzle/0284_user_brain_claims.sql +69 -0
  75. package/dist/drizzle/0285_tenant_mcp_twin_keys_trusted_subsystem.sql +30 -0
  76. package/dist/drizzle/0286_brain_analytics_key.sql +26 -0
  77. package/dist/drizzle/0287_brain_subject.sql +25 -0
  78. package/dist/drizzle/0288_multi_lane_identities.sql +25 -0
  79. package/dist/event-streams-7JNLJEEL.js +894 -0
  80. package/dist/event-streams-KDF5RWR6.js +1515 -0
  81. package/dist/loadSso-ETCXTR4I.js +576 -0
  82. package/dist/loadSso-UBD7KUHE.js +583 -0
  83. package/dist/plugins/README.md +2 -2
  84. package/dist/plugins/catalog/package.json +1 -5
  85. package/dist/plugins/catalog/src/__tests__/build-catalog.test.ts +6 -4
  86. package/dist/plugins/catalog/src/__tests__/catalog.test.ts +21 -21
  87. package/dist/plugins/catalog/src/__tests__/contracts.test.ts +102 -94
  88. package/dist/plugins/catalog/src/__tests__/plugin-package.test.ts +7 -8
  89. package/dist/plugins/catalog/src/__tests__/plugin-registry.test.ts +0 -20
  90. package/dist/plugins/catalog/src/contracts.ts +17 -179
  91. package/dist/plugins/catalog/src/registry/generated-first-party.ts +0 -24
  92. package/dist/plugins/n8n/test/integrated-app-contract.test.ts +1 -1
  93. package/dist/plugins/twenty/package.json +2 -1
  94. package/dist/plugins/twenty/scripts/LAMBDA_DEPLOY.md +114 -0
  95. package/dist/plugins/twenty/scripts/build-lambda.sh +29 -0
  96. package/dist/plugins/twenty/scripts/configure-product-views.ts +195 -0
  97. package/dist/plugins/twenty/scripts/lambda-handler.ts +49 -0
  98. package/dist/plugins/twenty/scripts/lib/__tests__/load-attachments.test.ts +38 -0
  99. package/dist/plugins/twenty/scripts/lib/__tests__/load-records.test.ts +145 -2
  100. package/dist/plugins/twenty/scripts/lib/__tests__/mappers.test.ts +397 -151
  101. package/dist/plugins/twenty/scripts/lib/__tests__/members-ensure.test.ts +28 -129
  102. package/dist/plugins/twenty/scripts/lib/__tests__/provision-members-db.test.ts +10 -0
  103. package/dist/plugins/twenty/scripts/lib/__tests__/schema-ensure.test.ts +13 -8
  104. package/dist/plugins/twenty/scripts/lib/lastmile-reader.ts +222 -2
  105. package/dist/plugins/twenty/scripts/lib/load-attachments.ts +29 -0
  106. package/dist/plugins/twenty/scripts/lib/load-records.ts +160 -43
  107. package/dist/plugins/twenty/scripts/lib/mappers.ts +368 -152
  108. package/dist/plugins/twenty/scripts/lib/members-ensure.ts +43 -268
  109. package/dist/plugins/twenty/scripts/lib/provision-members-db.ts +57 -0
  110. package/dist/plugins/twenty/scripts/lib/schema-ensure.ts +136 -31
  111. package/dist/plugins/twenty/scripts/migrate-lastmile.ts +254 -152
  112. package/dist/plugins/twenty/scripts/provision-twenty-members.ts +44 -1
  113. package/dist/plugins/twenty/scripts/purge-lastmile-import.ts +178 -0
  114. package/dist/plugins/twenty/scripts/restructure-products.ts +312 -0
  115. package/dist/plugins/twenty/scripts/retag-stage-values.ts +362 -0
  116. package/dist/plugins/twenty/test/manifest.test.ts +2 -4
  117. package/dist/scripts/post-deploy.sh +79 -1
  118. package/dist/signin-5QZNRSOO.js +821 -0
  119. package/dist/sso-oidc-XK673P54.js +837 -0
  120. package/dist/sts-OXI2UALF.js +1113 -0
  121. package/dist/sts-SQW4NBK3.js +1117 -0
  122. package/dist/terraform/examples/greenfield/main.tf +391 -176
  123. package/dist/terraform/examples/greenfield/terraform.tfvars.example +26 -8
  124. package/dist/terraform/modules/app/agentcore-admin/main.tf +47 -0
  125. package/dist/terraform/modules/app/agentcore-code-interpreter/README.md +39 -47
  126. package/dist/terraform/modules/app/agentcore-code-interpreter/main.tf +13 -66
  127. package/dist/terraform/modules/app/agentcore-identity/main.tf +253 -0
  128. package/dist/terraform/modules/app/agentcore-identity/outputs.tf +51 -0
  129. package/dist/terraform/modules/app/agentcore-identity/scripts/bootstrap_twenty_oauth_client.sh +239 -0
  130. package/dist/terraform/modules/app/agentcore-identity/scripts/delete_identity.sh +22 -0
  131. package/dist/terraform/modules/app/agentcore-identity/scripts/delete_twenty_identity.sh +16 -0
  132. package/dist/terraform/modules/app/agentcore-identity/scripts/delete_workload_identity.sh +19 -0
  133. package/dist/terraform/modules/app/agentcore-identity/scripts/ensure_workload_identity.sh +29 -0
  134. package/dist/terraform/modules/app/agentcore-identity/scripts/read_identity.sh +55 -0
  135. package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_identity.sh +73 -0
  136. package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_identity.sh +45 -0
  137. package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_provider.mjs +123 -0
  138. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/after.tf +15 -0
  139. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/before.tf +7 -0
  140. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-after.tf +8 -0
  141. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-before.tf +9 -0
  142. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-after.tf +3 -0
  143. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-before.tf +3 -0
  144. package/dist/terraform/modules/app/agentcore-identity/variables.tf +60 -0
  145. package/dist/terraform/modules/app/agentcore-memory/README.md +46 -9
  146. package/dist/terraform/modules/app/agentcore-memory/main.tf +27 -10
  147. package/dist/terraform/modules/app/agentcore-memory/scripts/create_or_find_memory.sh +156 -24
  148. package/dist/terraform/modules/app/agentcore-pi/README.md +1 -3
  149. package/dist/terraform/modules/app/agentcore-pi/main.tf +42 -52
  150. package/dist/terraform/modules/app/agentcore-pi/outputs.tf +3 -3
  151. package/dist/terraform/modules/app/agentcore-pi/scripts/reconcile_pi_runtime.mjs +175 -0
  152. package/dist/terraform/modules/app/agentcore-pi/variables.tf +35 -28
  153. package/dist/terraform/modules/app/agentcore-platform/main.tf +68 -0
  154. package/dist/terraform/modules/app/agentcore-runtime/main.tf +4 -20
  155. package/dist/terraform/modules/app/appsync-subscriptions/main.tf +127 -21
  156. package/dist/terraform/modules/app/appsync-subscriptions/outputs.tf +0 -6
  157. package/dist/terraform/modules/app/appsync-subscriptions/variables.tf +5 -0
  158. package/dist/terraform/modules/app/capability-broker/main.tf +2 -2
  159. package/dist/terraform/modules/app/capability-broker/variables.tf +11 -0
  160. package/dist/terraform/modules/app/deployment-control-plane/README.md +264 -0
  161. package/dist/terraform/modules/app/deployment-control-plane/buildspec.yml +4 -1
  162. package/dist/terraform/modules/app/deployment-control-plane/main.tf +94 -0
  163. package/dist/terraform/modules/app/deployment-control-plane/outputs.tf +5 -0
  164. package/dist/terraform/modules/app/deployment-control-plane/runner.py +3689 -233
  165. package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +2579 -140
  166. package/dist/terraform/modules/app/deployment-control-plane/variables.tf +33 -0
  167. package/dist/terraform/modules/app/lambda-api/auth-state.tf +72 -0
  168. package/dist/terraform/modules/app/lambda-api/chat-latency-observability.tf +466 -0
  169. package/dist/terraform/modules/app/lambda-api/dispatch-dlq.tf +55 -0
  170. package/dist/terraform/modules/app/lambda-api/handlers.tf +531 -619
  171. package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +350 -241
  172. package/dist/terraform/modules/app/lambda-api/main.tf +75 -13
  173. package/dist/terraform/modules/app/lambda-api/memory-alarms.tf +3 -28
  174. package/dist/terraform/modules/app/lambda-api/oauth-secrets.tf +1 -2
  175. package/dist/terraform/modules/app/lambda-api/outputs.tf +17 -10
  176. package/dist/terraform/modules/app/lambda-api/runtime-config.tf +3 -21
  177. package/dist/terraform/modules/app/lambda-api/turn-assertion.tf +45 -0
  178. package/dist/terraform/modules/app/lambda-api/variables.tf +307 -121
  179. package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/README.md +1 -1
  180. package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/main.tf +18 -18
  181. package/dist/terraform/modules/app/sandbox-log-scrubber/README.md +11 -10
  182. package/dist/terraform/modules/app/sandbox-log-scrubber/main.tf +5 -5
  183. package/dist/terraform/modules/app/static-site/main.tf +1 -1
  184. package/dist/terraform/modules/app/www-dns/main.tf +9 -27
  185. package/dist/terraform/modules/app/www-dns/variables.tf +4 -10
  186. package/dist/terraform/modules/data/aurora-postgres/README.md +34 -0
  187. package/dist/terraform/modules/data/aurora-postgres/alarms.tf +82 -0
  188. package/dist/terraform/modules/data/aurora-postgres/main.tf +27 -57
  189. package/dist/terraform/modules/data/aurora-postgres/outputs.tf +0 -9
  190. package/dist/terraform/modules/data/aurora-postgres/variables.tf +41 -0
  191. package/dist/terraform/modules/data/s3-buckets/main.tf +5 -6
  192. package/dist/terraform/modules/foundation/cognito/main.tf +367 -72
  193. package/dist/terraform/modules/foundation/cognito/outputs.tf +47 -0
  194. package/dist/terraform/modules/foundation/cognito/variables.tf +131 -9
  195. package/dist/terraform/modules/thinkwork/README.md +5 -1
  196. package/dist/terraform/modules/thinkwork/main.tf +459 -234
  197. package/dist/terraform/modules/thinkwork/outputs.tf +44 -62
  198. package/dist/terraform/modules/thinkwork/variables.tf +353 -89
  199. package/dist/terraform/schema.graphql +69 -36
  200. package/dist/workspace-defaults/files/INSTRUCTIONS.md +9 -11
  201. package/dist/workspace-defaults/files/MEMORY_GUIDE.md +38 -35
  202. package/dist/workspace-defaults/files/ROUTER.md +1 -1
  203. package/dist/workspace-defaults/files/TOOLS.md +9 -39
  204. package/dist/workspace-defaults/files/USER.md +1 -0
  205. package/dist/workspace-defaults/files/agents/analyst/INSTRUCTIONS.md +6 -3
  206. package/dist/workspace-defaults/files/catalog-skills/brain-brief-builder/SKILL.md +165 -0
  207. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/SKILL.md +75 -0
  208. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/mcp-tooling.md +40 -0
  209. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/validation-and-handoff.md +40 -0
  210. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/workflow-authoring.md +46 -0
  211. package/dist/workspace-defaults/files/skills/artifact-builder/references/crm-dashboard.md +1 -1
  212. package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +22 -3
  213. package/package.json +3 -2
  214. package/dist/drizzle/0261_thread_turns_origin_turn_index.sql +0 -11
  215. package/dist/plugins/company-data/README.md +0 -49
  216. package/dist/plugins/company-data/package.json +0 -21
  217. package/dist/plugins/company-data/src/index.ts +0 -30
  218. package/dist/plugins/company-data/src/manifest.ts +0 -26
  219. package/dist/plugins/company-data/test/manifest.test.ts +0 -116
  220. package/dist/plugins/company-data/tsconfig.json +0 -8
  221. package/dist/plugins/company-etl/README.md +0 -46
  222. package/dist/plugins/company-etl/package.json +0 -21
  223. package/dist/plugins/company-etl/src/index.ts +0 -29
  224. package/dist/plugins/company-etl/src/manifest.ts +0 -26
  225. package/dist/plugins/company-etl/test/manifest.test.ts +0 -108
  226. package/dist/plugins/company-etl/tsconfig.json +0 -8
  227. package/dist/plugins/lastmile/README.md +0 -50
  228. package/dist/plugins/lastmile/package.json +0 -23
  229. package/dist/plugins/lastmile/smoke/lastmile-plugin-smoke.mjs +0 -661
  230. package/dist/plugins/lastmile/src/api/tasks-adapter.ts +0 -572
  231. package/dist/plugins/lastmile/src/discovery.fixture.ts +0 -64
  232. package/dist/plugins/lastmile/src/index.ts +0 -46
  233. package/dist/plugins/lastmile/src/manifest.ts +0 -139
  234. package/dist/plugins/lastmile/test/api/tasks-adapter.test.ts +0 -266
  235. package/dist/plugins/lastmile/test/discovery.test.ts +0 -88
  236. package/dist/plugins/lastmile/tsconfig.json +0 -8
  237. package/dist/plugins/n8n/smoke/n8n-managed-app-smoke.mjs +0 -409
  238. package/dist/plugins/twenty/smoke/twenty-managed-app-smoke.mjs +0 -359
  239. package/dist/plugins/workos-auth/package.json +0 -22
  240. package/dist/plugins/workos-auth/src/index.ts +0 -30
  241. package/dist/plugins/workos-auth/src/manifest.ts +0 -40
  242. package/dist/plugins/workos-auth/src/provider-contract.ts +0 -39
  243. package/dist/plugins/workos-auth/test/manifest.test.ts +0 -94
  244. package/dist/plugins/workos-auth/tsconfig.json +0 -8
  245. package/dist/terraform/modules/app/agentcore-code-interpreter/Dockerfile.sandbox-base +0 -61
  246. package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/sitecustomize.py +0 -227
  247. package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/test_sitecustomize.py +0 -277
  248. package/dist/terraform/modules/app/agentcore-code-interpreter/scripts/build_and_push_sandbox_base.sh +0 -70
  249. package/dist/terraform/modules/app/agentcore-harness/main.tf +0 -101
  250. package/dist/terraform/modules/app/agentcore-harness/outputs.tf +0 -9
  251. package/dist/terraform/modules/app/agentcore-harness/variables.tf +0 -25
  252. package/dist/terraform/modules/app/hindsight-memory/README.md +0 -89
  253. package/dist/terraform/modules/app/hindsight-memory/main.tf +0 -411
  254. package/dist/terraform/modules/data/bedrock-knowledge-base/main.tf +0 -102
  255. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/outputs.tf +0 -0
  256. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/sync-database.py +0 -0
  257. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/test_sync_database.py +0 -0
  258. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/variables.tf +0 -0
  259. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/README.md +0 -0
  260. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/main.tf +0 -0
  261. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/outputs.tf +0 -0
  262. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/variables.tf +0 -0
@@ -51,22 +51,38 @@ variable "google_oauth_client_secret" {
51
51
  }
52
52
 
53
53
  variable "microsoft_oauth_client_id" {
54
- description = "Microsoft OAuth client ID reserved for future Cognito/OAuth wiring. Accepted here so deployment-control-plane generated wrappers stay forward-compatible."
54
+ description = "Microsoft Entra application client ID for the deployment's default tenant-specific Cognito OIDC route."
55
55
  type = string
56
56
  default = ""
57
57
  }
58
58
 
59
59
  variable "microsoft_oauth_client_secret" {
60
- description = "Microsoft OAuth client secret reserved for future Cognito/OAuth wiring."
60
+ description = "Microsoft Entra application client secret for the deployment's default tenant-specific Cognito OIDC route."
61
61
  type = string
62
62
  sensitive = true
63
63
  default = ""
64
64
  }
65
65
 
66
66
  variable "microsoft_oauth_tenant" {
67
- description = "Microsoft OAuth tenant reserved for future Cognito/OAuth wiring."
67
+ description = "Microsoft Entra tenant for the deployment's default Microsoft login route: a directory GUID or one of the Cognito-supported multi-tenant aliases (common, organizations, consumers)."
68
68
  type = string
69
- default = "organizations"
69
+ default = ""
70
+
71
+ validation {
72
+ condition = var.microsoft_oauth_tenant == "" || contains(["common", "organizations", "consumers"], var.microsoft_oauth_tenant) || can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", var.microsoft_oauth_tenant))
73
+ error_message = "microsoft_oauth_tenant must be an Entra directory GUID or one of the Cognito-supported aliases: common, organizations, consumers."
74
+ }
75
+ }
76
+
77
+ variable "tenant_entra_connections" {
78
+ description = "Safe tenant-specific Entra provider metadata. Secrets are reconciled outside Terraform and are never accepted here."
79
+ type = list(object({
80
+ connection_key = string
81
+ tenant_id = string
82
+ provider_name = string
83
+ display_name = string
84
+ }))
85
+ default = []
70
86
  }
71
87
 
72
88
  variable "oidc_identity_providers" {
@@ -117,26 +133,51 @@ variable "platform_operator_emails" {
117
133
  default = ""
118
134
  }
119
135
 
120
- variable "analyst_lambda_vpc_egress" {
121
- description = "VPC-attach the analyst data-path Lambdas (graphql-http, analyst-query-broker, analyst-connection-reconciler) to the stack's private subnets so their egress rides the NAT gateway's stable EIP. Enables external analyst data sources that sit behind an IP allowlist: the DBA admits the one NAT IP (see the analyst_egress_ip output) instead of opening the database to the world. Requires private (NAT-routed) subnets."
122
- type = bool
123
- default = false
136
+ # THINK-583 U3 — provisioned concurrency for the two chat-critical zip
137
+ # Lambdas ONLY (KTD5: never the Pi Lambda). Safe default 0 = disabled;
138
+ # the `live` alias is still created so alias-qualified invokers work on
139
+ # every stage and customer stages opt in on their own release cadence.
140
+ # Dev enables 1/1 via scripts/deploy/terraform-vars.sh (deploy.yml is
141
+ # dev-only — same pattern as enable_capability_broker).
142
+
143
+ variable "chat_agent_invoke_provisioned_concurrency" {
144
+ description = "Provisioned concurrency on chat-agent-invoke's `live` alias. 0 = disabled (alias still exists)."
145
+ type = number
146
+ default = 0
147
+ }
148
+
149
+ variable "workspace_renderer_provisioned_concurrency" {
150
+ description = "Provisioned concurrency on workspace-renderer's `live` alias. 0 = disabled (alias still exists)."
151
+ type = number
152
+ default = 0
124
153
  }
125
154
 
126
155
  variable "okf_wiki_efs_enabled" {
127
- description = "Provision the OKF Wiki Navigator EFS current-view substrate and mount it into the okf-efs-refresh Lambda plus Pi."
156
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature is dead — no mount, access point, mount target, or client security group is created regardless of this value. It currently only retains the already-provisioned EFS filesystem (PR 2 deletes it behind the destructive-step gates) and, with okf_wiki_create_nat_gateway, the shared NAT egress that non-OKF VPC workloads still ride. Declaration retained so customer-stage passthroughs and tfvars keep working."
128
157
  type = bool
129
158
  default = true
130
159
  }
131
160
 
132
161
  variable "okf_wiki_create_vpc_endpoints" {
133
- description = "Create private AWS service VPC endpoints required by VPC-attached OKF hydrator and Pi Lambdas. Disable only when equivalent NAT or endpoints already exist."
162
+ description = "DEPRECATED (THINK-589): no-op for OKF, removal pending. The OKF hydrator and Pi are no longer VPC-attached. The private VPC endpoints this gates are retained unchanged in PR 1 because their private DNS serves the whole VPC (Neptune twin Lambdas, Twenty); PR 2 re-homes or deletes them."
134
163
  type = bool
135
164
  default = true
136
165
  }
137
166
 
167
+ variable "vpc_interface_endpoint_services" {
168
+ description = "AWS services that get a private interface endpoint in the VPC (service suffixes: secretsmanager, rds-data, bedrock-runtime, logs, ...). null = the legacy full set the stage was built with; [] = none. The private subnets are NAT-routed and the Lambda SGs allow 443 out, so an endpoint only keeps a call on AWS's network — it is a posture choice billed at ~$7.30/mo per ENI, not a reachability requirement. Cost review 2026-08-28."
169
+ type = list(string)
170
+ default = null
171
+ }
172
+
173
+ variable "vpc_interface_endpoint_single_az" {
174
+ description = "Place each interface endpoint in one private subnet instead of every one. Halves the hourly bill; the other AZ's callers cross AZs at $0.01/GB. Cost review 2026-08-28."
175
+ type = bool
176
+ default = false
177
+ }
178
+
138
179
  variable "okf_wiki_create_nat_gateway" {
139
- description = "Create NAT egress for private subnets when OKF EFS attaches Pi to the VPC. Disable only when equivalent public egress already exists."
180
+ description = "DEPRECATED (THINK-589): removal pending. Pi no longer attaches to the VPC for OKF EFS. NAT egress is retained unchanged in PR 1 because Neptune twin Lambdas and other VPC-attached workloads route through it; PR 2 re-homes the gate onto the surviving VPC consumers."
140
181
  type = bool
141
182
  default = true
142
183
  }
@@ -147,6 +188,30 @@ variable "enable_deployment_control_plane" {
147
188
  default = true
148
189
  }
149
190
 
191
+ variable "deployment_runner_in_vpc" {
192
+ description = "Run the deployment runner CodeBuild inside this VPC (private subnets, dedicated runner security group) and grant that group tcp/5432 on the database security group. Rationale (THINK-1082): the runner's psql schema step otherwise reaches Aurora over its public endpoint and depends on the world-open 0.0.0.0/0 -> 5432 rule the aurora-postgres module seeds; a customer that revokes that rule (deliberate lockdown) breaks every deploy at the psql step. Turning this on also turns on the VPC NAT gateway, which a VPC-attached CodeBuild needs to reach GitHub, apt/pip, STS, S3, and Secrets Manager. Ship-inert: default false leaves networking untouched. Applies to the control plane this module embeds (enable_deployment_control_plane); an externally bootstrapped control plane (thinkwork enterprise bootstrap) takes the same inputs through its own root."
193
+ type = bool
194
+ default = false
195
+ }
196
+
197
+ variable "api_lambdas_in_vpc" {
198
+ description = "Attach every database-connected Lambda of the agent (all lambda-api handlers incl. compliance-anchor / compliance-export-runner, the agentcore-admin Lambda, the agentcore-pi runtime, and the already-VPC-attached capability broker) to this VPC's private subnets behind a dedicated api-lambda security group, and grant that group tcp/5432 on the database security group. Rationale (THINK-1082): those functions carry a database connection and, with no vpc_config, reach Aurora only over its public endpoint through the world-open 0.0.0.0/0 -> 5432 rule the aurora-postgres module seeds. When a human revoked that rule on a live customer stage the whole app was down for two hours (auth-me -> DB timeout -> 401 'No tenant assigned'). With this on, the Lambdas reach the database privately and the public rule can be closed (db_public_ingress_cidrs / db_publicly_accessible). Turns on the VPC NAT gateway — VPC-attached Lambdas have no public IP and still need AWS APIs, Bedrock, Slack, GitHub, model providers; NAT data-processing charges apply to that egress. Ship-inert: default false leaves every function byte-identical."
199
+ type = bool
200
+ default = false
201
+ }
202
+
203
+ variable "db_publicly_accessible" {
204
+ description = "aurora-postgres publicly_accessible passthrough (THINK-1082). Default true = today's public endpoint. Set false only after api_lambdas_in_vpc and deployment_runner_in_vpc are live and verified."
205
+ type = bool
206
+ default = true
207
+ }
208
+
209
+ variable "db_public_ingress_cidrs" {
210
+ description = "aurora-postgres public_ingress_cidrs passthrough (THINK-1082): CIDRs seeded as tcp/5432 ingress on a NEW database security group. Default [\"0.0.0.0/0\"] = today's world-open rule; [] = none. The group ignores ingress drift, so shrinking this does not revoke a live rule — the operator revokes it by hand once the clients are in the VPC (see modules/app/deployment-control-plane/README.md, 'Closing the database port')."
211
+ type = list(string)
212
+ default = ["0.0.0.0/0"]
213
+ }
214
+
150
215
  variable "deployment_state_machine_arn" {
151
216
  description = "Existing deployment orchestration Step Functions ARN for environments whose controller is bootstrapped outside this app stack."
152
217
  type = string
@@ -321,6 +386,21 @@ variable "existing_identity_pool_id" {
321
386
  default = null
322
387
  }
323
388
 
389
+ variable "existing_auth_route_clients" {
390
+ description = "Safe route-client manifest for BYO Cognito pools."
391
+ type = map(object({
392
+ client_id = string
393
+ route_key = string
394
+ client_family = string
395
+ provider_names = list(string)
396
+ explicit_auth_flows = list(string)
397
+ callback_urls = list(string)
398
+ logout_urls = list(string)
399
+ lifecycle_state = string
400
+ }))
401
+ default = {}
402
+ }
403
+
324
404
  variable "create_database" {
325
405
  description = "Create a new Aurora cluster (false = BYO)"
326
406
  type = bool
@@ -353,10 +433,16 @@ variable "database_engine" {
353
433
  default = "aurora-serverless"
354
434
  }
355
435
 
436
+ variable "external_kb_source_arns" {
437
+ description = "DEPRECATED (THINK-402): Knowledge Bases were removed from the product; this input is inert and ignored. Declaration retained so existing customer-stage -var passthroughs keep working."
438
+ type = list(string)
439
+ default = []
440
+ }
441
+
356
442
  variable "enable_hindsight" {
357
- description = "Enable Hindsight long-term memory. Full ThinkWork installs default this on because Hindsight is the canonical user and Space memory provider; set false only for explicit low-cost/development AgentCore-only deployments."
443
+ description = "DEPRECATED (THINK-407): the Hindsight memory engine and its infrastructure were removed; this input is inert and ignored. Declaration retained so existing customer-stage -var passthroughs and tfvars keep working."
358
444
  type = bool
359
- default = true
445
+ default = false
360
446
  }
361
447
 
362
448
  variable "enable_agentcore_harness" {
@@ -365,52 +451,65 @@ variable "enable_agentcore_harness" {
365
451
  default = true
366
452
  }
367
453
 
368
- variable "enable_capability_broker" {
369
- description = "Enable the THINK-280 governed capability broker (private REST API + dedicated execute-api VPCE with private DNS disabled, DynamoDB session store, broker Lambda). Ship-inert: defaults OFF; U4 flips it on after the live negative-egress proof. The broker Lambda code also fails closed independent of this flag."
454
+ variable "enable_agentcore_multiplayer_proof" {
455
+ description = "Provision the non-production THINK-316 Identity/Gateway proof substrate. Defaults off; requires the Harness IAM surface and never changes the tenant runtime selector by itself."
370
456
  type = bool
371
457
  default = false
372
458
  }
373
459
 
374
- variable "memory_engine" {
375
- description = "Active long-term memory engine for canonical recall/inspect/export. Exactly one engine is authoritative per deployment. Empty auto-selects Hindsight for full installs. Accepted values: 'hindsight' (requires enable_hindsight = true) or 'agentcore' (explicit low-cost/development managed-memory mode). Legacy value 'managed' maps to 'agentcore'."
460
+ variable "agentcore_multiplayer_proof_tenant_slug" {
461
+ description = "Explicit non-production pilot tenant slug for the one-Harness multiplayer proof. Required when the proof is enabled."
376
462
  type = string
377
463
  default = ""
378
-
379
- validation {
380
- condition = var.memory_engine == "" || contains(["managed", "hindsight", "agentcore"], var.memory_engine)
381
- error_message = "memory_engine must be empty, 'hindsight', 'agentcore', or legacy 'managed'."
382
- }
383
464
  }
384
465
 
385
- variable "hindsight_image_tag" {
386
- description = "Hindsight Docker image tag (used when enable_hindsight = true). 0.8.4 upgrade validated 2026-07-06 (THINK-201): migration rehearsal over a dev-data copy passed (orphan-observation backsweep deletes ~650 broken-provenance rows — expected); retain/recall/consolidation verified; 0.8.4 fixes the Bedrock-Anthropic extraction tool schema AND fails retain loudly (500) instead of silently storing zero units. Known upstream gap: maintenance discovery routines (reconcile sweep, mental-model cron, llm_requests retention) expect functions in the public schema and no-op with warnings when HINDSIGHT_API_DATABASE_SCHEMA != public."
466
+ variable "agentcore_multiplayer_proof_owner_allowlist" {
467
+ description = "Comma-separated non-production subjects for the manual authorization-code and mixed-disclosure fixtures. Signed OBO turn participants are admitted from canonical tenant membership, not this list."
387
468
  type = string
388
- default = "0.8.4"
469
+ default = ""
470
+ }
471
+
472
+ variable "agentcore_turn_assertion_key_versions" {
473
+ description = "One or two published assertion key versions for the managed Harness proof."
474
+ type = list(string)
475
+ default = ["v1"]
389
476
  }
390
477
 
391
- variable "hindsight_database_name" {
392
- description = "Dedicated Hindsight database name on the primary Aurora cluster (THINK-220 cutover flag). Empty (default) = legacy layout: Hindsight lives in the `hindsight` schema of the primary database and its upstream maintenance discovery no-ops (see hindsight_image_tag note). Set to e.g. \"thinkwork_hindsight\" AFTER the database exists and its data is migrated (plan 2026-07-07-004): flips the Hindsight service, the api Lambdas, and the Pi runtime to that database's `public` schema in one apply."
478
+ variable "agentcore_turn_assertion_active_key_version" {
479
+ description = "Assertion key version used for new Harness and Gateway tokens."
393
480
  type = string
394
- default = ""
481
+ default = "v1"
395
482
  }
396
483
 
397
- variable "hindsight_enable_auto_consolidation" {
398
- description = "Run Hindsight's observation consolidation engine automatically after retain (used when enable_hindsight = true)."
484
+ variable "enable_capability_broker" {
485
+ description = "Enable the THINK-280 governed capability broker (private REST API + dedicated execute-api VPCE with private DNS disabled, DynamoDB session store, broker Lambda). Ship-inert: defaults OFF; U4 flips it on after the live negative-egress proof. The broker Lambda code also fails closed independent of this flag."
399
486
  type = bool
400
- default = true
487
+ default = false
401
488
  }
402
489
 
403
- variable "hindsight_consolidation_dedup_threshold" {
404
- description = "Cosine-similarity threshold for Hindsight near-duplicate observation reconciliation (0.0-1.0; 1.0 disables)."
490
+ variable "auth_state_store" {
491
+ description = "THINK-643: backing store for short-lived auth-flow state (AppSync subscription tickets + connect rate-limit counters). \"postgres\" (default) keeps the Aurora auth_subscription_tickets path; \"dynamo\" provisions thinkwork-<stage>-auth-state and points the auth handlers at it. Ship-inert: dev opts in via the deploy workflow, customer stages on their own cadence."
405
492
  type = string
406
- default = "0.97"
493
+ default = "postgres"
494
+
495
+ validation {
496
+ condition = contains(["postgres", "dynamo"], var.auth_state_store)
497
+ error_message = "auth_state_store must be \"postgres\" or \"dynamo\"."
498
+ }
407
499
  }
408
500
 
409
- variable "hindsight_observations_mission" {
410
- description = "Service-level default observations mission for Hindsight consolidation. Empty string falls back to the image default. Per-bank config overrides apply on top."
501
+
502
+ variable "memory_engine" {
503
+ description = "DEPRECATED (THINK-407): AgentCore managed memory is the only engine; this input is inert and ignored. Declaration retained so existing customer-stage -var passthroughs and tfvars keep working. Legacy values ('hindsight', 'managed') are accepted and discarded."
411
504
  type = string
412
- default = "Synthesize durable, institutional facts about the business: customers, projects, decisions, processes, tools, relationships, and recurring patterns. Filter out ephemeral state, secrets, and personal small talk."
505
+ default = ""
506
+
507
+ validation {
508
+ condition = var.memory_engine == "" || contains(["managed", "hindsight", "agentcore"], var.memory_engine)
509
+ error_message = "memory_engine must be empty, 'agentcore', or a legacy value ('hindsight', 'managed'). The input is ignored either way."
510
+ }
413
511
  }
512
+
414
513
  variable "twenty_provisioned" {
415
514
  description = "Provision the retained Twenty CRM managed-app substrate. Runtime can be parked independently with twenty_runtime_enabled."
416
515
  type = bool
@@ -829,6 +928,17 @@ variable "enable_workspace_orchestration" {
829
928
  default = false
830
929
  }
831
930
 
931
+ variable "agentcore_session_scope" {
932
+ description = "THINK-909/THINK-946 AgentCore runtime session scope. \"thread\" (default) keys the session per thread; \"user\" keys it per (tenant, agent, user) so a new thread lands on the user's warm microVM and reuses its retained MCP connections and toolset (THINK-946). Set \"user\" only after the stage's Pi runtime image dual-accepts both session ids. mcpherson runs \"user\"; every other stage keeps the default."
933
+ type = string
934
+ default = "thread"
935
+
936
+ validation {
937
+ condition = contains(["thread", "user"], var.agentcore_session_scope)
938
+ error_message = "agentcore_session_scope must be \"thread\" or \"user\"."
939
+ }
940
+ }
941
+
832
942
  variable "requester_idle_memory_learning_enabled" {
833
943
  description = "Enable requester-scoped 15-minute idle memory learning."
834
944
  type = bool
@@ -865,18 +975,6 @@ variable "brain_dream_state_schedule_expression" {
865
975
  default = "cron(0 5 * * ? *)"
866
976
  }
867
977
 
868
- variable "retry_dispatcher_enabled" {
869
- description = "Enable the recurring retry-dispatcher schedule (THINK-307). Never enable on a stage before THINK-305, THINK-308, and THINK-309 are live there (parent plan deploy ordering); manual invokes work regardless."
870
- type = bool
871
- default = false
872
- }
873
-
874
- variable "stall_threshold_minutes" {
875
- description = "Minutes of turn inactivity before the stall monitor marks a running turn timed_out; the retry dispatcher reads the same knob as its origin-freshness guard (THINK-306/THINK-307 — one knob, two consumers)."
876
- type = number
877
- default = 5
878
- }
879
-
880
978
  # ---------------------------------------------------------------------------
881
979
  # Naming / Buckets
882
980
  # ---------------------------------------------------------------------------
@@ -918,6 +1016,24 @@ variable "plugin_catalog_github_token_secret_arn" {
918
1016
  default = ""
919
1017
  }
920
1018
 
1019
+ variable "brain_m2m_platform_agent_secret_arn" {
1020
+ description = "Optional Secrets Manager ARN of the Company Brain platform-agent machine-lane secret (Cognito client-credentials blob, THINK-628). When set, the shared API Lambda role may read it so MCP config build can mint short-lived bearers for the Brain connector. Empty leaves the tkt_ lane untouched."
1021
+ type = string
1022
+ default = ""
1023
+ }
1024
+
1025
+ variable "brain_ops_api_url" {
1026
+ description = "Optional Company Brain ops-api base URL for the Send-to-the-Brain flag path (THINK-781). Empty disables the action."
1027
+ type = string
1028
+ default = ""
1029
+ }
1030
+
1031
+ variable "brain_ops_m2m_secret_arn" {
1032
+ description = "Optional Secrets Manager ARN of the Brain agent-identity m2m secret (ops-api operator pool, scope etl-agent/tasks) used by flagThreadToBrain to POST /flags (THINK-781)."
1033
+ type = string
1034
+ default = ""
1035
+ }
1036
+
921
1037
  variable "database_name" {
922
1038
  description = "Aurora database name"
923
1039
  type = string
@@ -952,6 +1068,12 @@ variable "skill_trust_runner_enabled" {
952
1068
  default = true
953
1069
  }
954
1070
 
1071
+ variable "release_image_mirror_principal_arns" {
1072
+ description = "IAM principals allowed to push release runtime images (`<releaseVersion>-pi-arm64`) into this stage's AgentCore ECR repository, so the vendor's release pipeline can mirror the arm64 AgentCore Runtime image into this account (THINK-616). Empty by default: cross-account push is opt-in per stage, never implied by deploying this module. ThinkWork-operated customer stages set this to the ThinkWork release account (arn:aws:iam::487219502366:root)."
1073
+ type = list(string)
1074
+ default = []
1075
+ }
1076
+
955
1077
  variable "manage_bedrock_invocation_logging" {
956
1078
  description = "Own the account/region-level Bedrock model-invocation logging (log group /thinkwork/bedrock/model-invocations, IAM role, and the account logging configuration). Exactly ONE stage per account+region may manage it — a second stack collides on the log group and would clobber/destroy the account-level config (harness cycle-5 ledger entry)."
957
1079
  type = bool
@@ -986,8 +1108,12 @@ variable "admin_callback_urls" {
986
1108
  default = [
987
1109
  "http://localhost:5174",
988
1110
  "http://localhost:5174/auth/callback",
1111
+ "http://127.0.0.1:5174",
1112
+ "http://127.0.0.1:5174/auth/callback",
989
1113
  "http://localhost:5175",
990
1114
  "http://localhost:5175/auth/callback",
1115
+ "http://127.0.0.1:5175",
1116
+ "http://127.0.0.1:5175/auth/callback",
991
1117
  "http://127.0.0.1:42010/callback",
992
1118
  "http://localhost:42010/callback",
993
1119
  ]
@@ -997,19 +1123,58 @@ variable "admin_logout_urls" {
997
1123
  type = list(string)
998
1124
  default = [
999
1125
  "http://localhost:5174",
1126
+ "http://127.0.0.1:5174",
1000
1127
  "http://localhost:5175",
1128
+ "http://127.0.0.1:5175",
1129
+ ]
1130
+ }
1131
+
1132
+ variable "additional_admin_callback_urls" {
1133
+ type = list(string)
1134
+ default = []
1135
+ description = "Extra OAuth callback URLs appended to the web-family Cognito clients, beyond the computed defaults (localhost, customer/app domains, dev console). Customer stacks host the Company Brain console in their own account, so those origins can't be derived here and arrive from the deployment runner (runner-secrets `adminCallbackUrls`). Supply both the bare origin and its /auth/callback variant. Purely additive — empty leaves behavior unchanged."
1136
+ }
1137
+
1138
+ variable "additional_admin_logout_urls" {
1139
+ type = list(string)
1140
+ default = []
1141
+ description = "Extra OAuth logout URLs appended to the web-family Cognito clients (companion to additional_admin_callback_urls; runner-secrets `adminLogoutUrls`)."
1142
+ }
1143
+
1144
+ variable "cli_callback_urls" {
1145
+ type = list(string)
1146
+ default = [
1147
+ "http://127.0.0.1:42010/callback",
1148
+ "http://localhost:42010/callback",
1001
1149
  ]
1002
1150
  }
1003
1151
 
1004
- variable "desktop_callback_urls" {
1152
+ variable "cli_logout_urls" {
1005
1153
  type = list(string)
1006
1154
  default = [
1007
- "thinkwork://oauth/callback",
1008
- "thinkwork-dev://oauth/callback",
1009
- "thinkwork-canary://oauth/callback",
1155
+ "http://127.0.0.1:42010/callback",
1156
+ "http://localhost:42010/callback",
1010
1157
  ]
1011
1158
  }
1012
1159
 
1160
+ variable "console_client_enabled" {
1161
+ description = "Create the optional Company Brain console Cognito app client (U13). Default false = ship-inert; nothing is created and console_client_id is null."
1162
+ type = bool
1163
+ default = false
1164
+ }
1165
+
1166
+ variable "console_callback_urls" {
1167
+ description = "OAuth callback URLs for the console client — must include the console hosting URL BEFORE first login (redirect_mismatch otherwise). Required non-empty when console_client_enabled."
1168
+ type = list(string)
1169
+ default = []
1170
+ }
1171
+
1172
+ variable "console_logout_urls" {
1173
+ description = "OAuth logout URLs for the console client"
1174
+ type = list(string)
1175
+ default = []
1176
+ }
1177
+
1013
1178
  variable "mobile_callback_urls" {
1014
1179
  type = list(string)
1015
1180
  default = ["exp://localhost:8081", "thinkwork://", "thinkwork://auth/callback"]
@@ -1030,28 +1195,42 @@ variable "pre_signup_lambda_zip" {
1030
1195
  default = ""
1031
1196
  }
1032
1197
 
1033
- variable "cognito_custom_auth_lambda_zip" {
1034
- description = "Path to the Cognito custom-auth challenge Lambda zip"
1198
+ variable "auth_retirement_phase" {
1199
+ description = "Native-auth migration phase. Fresh deployments default to retired (no WorkOS runtime); existing deployments must explicitly select coexistence/cutover until their evidence-gated retirement is complete."
1035
1200
  type = string
1036
- default = ""
1037
- }
1201
+ default = "retired"
1038
1202
 
1039
- # ---------------------------------------------------------------------------
1040
- # Docs site (custom domain optional)
1041
- # ---------------------------------------------------------------------------
1203
+ validation {
1204
+ condition = contains(["coexistence", "cutover", "retired"], var.auth_retirement_phase)
1205
+ error_message = "auth_retirement_phase must be coexistence, cutover, or retired."
1206
+ }
1207
+ }
1042
1208
 
1043
- variable "docs_domain" {
1044
- description = "Custom domain for the docs site (e.g. docs.thinkwork.ai). Leave empty for CloudFront default."
1209
+ variable "auth_migration_recovery_deadline" {
1210
+ description = "RFC3339 deadline for legacy-session identity migration. Must be supplied explicitly for coexistence deployments."
1045
1211
  type = string
1046
1212
  default = ""
1213
+
1214
+ validation {
1215
+ condition = trimspace(var.auth_migration_recovery_deadline) == "" || (
1216
+ can(timecmp(var.auth_migration_recovery_deadline, var.auth_migration_recovery_deadline))
1217
+ )
1218
+ error_message = "auth_migration_recovery_deadline must be empty or an RFC3339 timestamp."
1219
+ }
1047
1220
  }
1048
1221
 
1049
- variable "docs_certificate_arn" {
1050
- description = "ACM certificate ARN for the docs domain (us-east-1, required for CloudFront custom domains)"
1222
+ variable "cognito_custom_auth_lambda_zip" {
1223
+ description = "Local WorkOS bridge custom-auth artifact retained only as a rollback runtime before auth retirement."
1051
1224
  type = string
1052
1225
  default = ""
1053
1226
  }
1054
1227
 
1228
+ variable "cognito_denied_app_client_ids" {
1229
+ description = "Cognito app clients denied new and refresh token issuance during native-auth cutover"
1230
+ type = list(string)
1231
+ default = []
1232
+ }
1233
+
1055
1234
  # ---------------------------------------------------------------------------
1056
1235
  # Public website (custom domain — optional)
1057
1236
  # ---------------------------------------------------------------------------
@@ -1142,7 +1321,7 @@ variable "computer_sandbox_certificate_arn" {
1142
1321
  }
1143
1322
 
1144
1323
  variable "computer_sandbox_allowed_parent_origins" {
1145
- description = "Comma-separated list of trusted web parent origins that may frame the sandbox iframe (e.g. 'https://thinkwork.ai,https://dev.thinkwork.ai'). Desktop custom-protocol origins are appended automatically. Wired into the sandbox CSP frame-ancestors directive AND mirrored at iframe-shell build time as __ALLOWED_PARENT_ORIGINS__. The two trust sets MUST stay in sync. Leave empty to allow only desktop custom-protocol parents."
1324
+ description = "Comma-separated list of trusted web parent origins that may frame the sandbox iframe (e.g. 'https://thinkwork.ai,https://dev.thinkwork.ai'). Wired into the sandbox CSP frame-ancestors directive AND mirrored at iframe-shell build time as __ALLOWED_PARENT_ORIGINS__. The two trust sets MUST stay in sync. Leave empty to disallow framing entirely."
1146
1325
  type = string
1147
1326
  default = ""
1148
1327
  }
@@ -1265,8 +1444,8 @@ variable "cognito_invite_sms_message" {
1265
1444
  }
1266
1445
  }
1267
1446
 
1268
- variable "wiki_compile_model_id" {
1269
- description = "Bedrock model id used by the wiki-compile Lambda (leaf planner + aggregation planner + section writer). Any Converse-compatible model works; change without a code deploy."
1447
+ variable "ontology_scan_model_id" {
1448
+ description = "DEPRECATED (THINK-408): the ontology / knowledge-graph subsystem was removed; this variable is accepted for compatibility and has no effect."
1270
1449
  type = string
1271
1450
  default = "openai.gpt-oss-120b-1:0"
1272
1451
  }
@@ -1278,7 +1457,19 @@ variable "brain_source_agent_model_id" {
1278
1457
  }
1279
1458
 
1280
1459
  variable "knowledge_graph_observations_ingest_enabled" {
1281
- description = "Enable the Brain distillation schedule (Hindsight observations -> knowledge graph). Ships disabled (plan 2026-07-03-005 U4)."
1460
+ description = "DEPRECATED (THINK-408): the ontology / knowledge-graph subsystem was removed; this variable is accepted for compatibility and has no effect."
1461
+ type = bool
1462
+ default = false
1463
+ }
1464
+
1465
+ variable "ontology_scan_sweep_enabled" {
1466
+ description = "DEPRECATED (THINK-408): the ontology / knowledge-graph subsystem was removed; this variable is accepted for compatibility and has no effect."
1467
+ type = bool
1468
+ default = false
1469
+ }
1470
+
1471
+ variable "identity_drift_match_enabled" {
1472
+ description = "Enable the recurring per-tenant identity drift match sweep (THINK-321 U7/KTD-7). Ships disabled."
1282
1473
  type = bool
1283
1474
  default = false
1284
1475
  }
@@ -1306,12 +1497,6 @@ variable "wiki_deterministic_linking_enabled" {
1306
1497
  default = "true"
1307
1498
  }
1308
1499
 
1309
- variable "google_places_api_key" {
1310
- description = "Google Places API (New) key used by wiki-compile for POI → city/state/country hierarchy enrichment. Stored as SSM SecureString at /thinkwork/<stage>/google-places/api-key. Empty string = parameter created with a placeholder; operator populates via `aws ssm put-parameter --overwrite`. Compile gracefully degrades to metadata-only rows when the key is absent — never fails compile."
1311
- type = string
1312
- default = ""
1313
- sensitive = true
1314
- }
1315
1500
 
1316
1501
  variable "mapbox_public_token" {
1317
1502
  description = "Mapbox public pk.* token consumed by the apps/web MapView primitive (in @thinkwork/computer-stdlib) for inline map tile rendering inside generated applets. Flows from this variable → terraform output → scripts/build-web.sh → apps/web/.env.production as VITE_MAPBOX_PUBLIC_TOKEN. URL-restrict on the Mapbox dashboard to the deployed `computer.<apex>` host (and any dev hosts) — the token ships in the public Vite bundle, so URL allowlist is the security boundary. Empty string is acceptable: MapView falls back to OpenStreetMap tiles when the env var is unset, so dev environments without an operator-provisioned token still render maps."
@@ -1353,30 +1538,109 @@ variable "compliance_anchor_object_lock_mode" {
1353
1538
  }
1354
1539
  }
1355
1540
 
1356
- variable "analyst_policy_source" {
1357
- description = "THINK-229 KTD5 enforcement flip for the analyst connection policy source: 'row' (default signed sidecar policy is shadow-only) or 'sidecar' (the sidecar block is authoritative). Flip only after clean shadow parity on live traffic."
1358
- type = string
1359
- default = "row"
1541
+ variable "compliance_anchor_retention_days" {
1542
+ description = "Default Object Lock retention in days for the compliance audit-anchor bucket. SOC2 Type 1 baseline is 12 months (365)."
1543
+ type = number
1544
+ default = 365
1360
1545
 
1361
1546
  validation {
1362
- condition = contains(["row", "sidecar"], var.analyst_policy_source)
1363
- error_message = "analyst_policy_source must be 'row' or 'sidecar'."
1547
+ condition = var.compliance_anchor_retention_days > 0
1548
+ error_message = "compliance_anchor_retention_days must be greater than 0."
1364
1549
  }
1365
1550
  }
1366
1551
 
1367
- variable "capability_self_extension_tenants" {
1368
- description = "Governed autonomy opt-in: comma/space-separated tenant ids allowed to autonomously self-extend capabilities. Empty (default) = NO tenant enabled; self-extension ships inert and fail-closed."
1552
+ # ---------------------------------------------------------------------------
1553
+ # Company Brain twin (plan 2026-07-21-001): Neptune wiring for the
1554
+ # identity-graph-projector. Values come from the etl-platform neptune stack's
1555
+ # outputs; all default-empty so stages without the twin deploy unchanged.
1556
+ # ---------------------------------------------------------------------------
1557
+
1558
+ variable "neptune_endpoint" {
1559
+ type = string
1560
+ default = ""
1561
+ description = "Neptune twin cluster writer endpoint (etl-platform neptune stack output; empty = twin disabled)"
1562
+ }
1563
+
1564
+ variable "brain_mcp_url" {
1369
1565
  type = string
1370
1566
  default = ""
1567
+ description = "Platform-served Brain MCP endpoint (consolidation U14). When set, twin-connector provisioning registers agents against it instead of the product /mcp/twin route. Empty = legacy product-served default."
1371
1568
  }
1372
1569
 
1373
- variable "compliance_anchor_retention_days" {
1374
- description = "Default Object Lock retention in days for the compliance audit-anchor bucket. SOC2 Type 1 baseline is 12 months (365)."
1570
+ variable "neptune_cluster_resource_id" {
1571
+ type = string
1572
+ default = ""
1573
+ description = "Neptune cluster resource id (etl-platform neptune stack output) for neptune-db IAM ARNs"
1574
+ }
1575
+
1576
+ variable "neptune_client_security_group_id" {
1577
+ type = string
1578
+ default = ""
1579
+ description = "neptune-client SG id (etl-platform neptune stack output) attached to the identity-graph-projector"
1580
+ }
1581
+
1582
+ variable "neptune_load_bucket" {
1583
+ type = string
1584
+ default = ""
1585
+ description = "Neptune bulk-load staging bucket name (etl-platform neptune stack; empty = bulk-rebuild disabled)"
1586
+ }
1587
+
1588
+ variable "neptune_loader_role_arn" {
1589
+ type = string
1590
+ default = ""
1591
+ description = "IAM role ARN the Neptune cluster assumes to read the load bucket (etl-platform neptune stack; empty = bulk-rebuild disabled)"
1592
+ }
1593
+
1594
+
1595
+ variable "lambda_max_memory_mb" {
1375
1596
  type = number
1376
- default = 365
1597
+ default = 10240
1598
+ description = "Account-level Lambda memory ceiling in MB. Legacy AWS accounts cap function memory at 3008 (raised only via AWS support case); handlers requesting more are clamped so a capped account's deploy doesn't fail mid-apply. Set via the runner-secrets key lambdaMaxMemoryMb on managed deployments."
1599
+ }
1377
1600
 
1378
- validation {
1379
- condition = var.compliance_anchor_retention_days > 0
1380
- error_message = "compliance_anchor_retention_days must be greater than 0."
1381
- }
1601
+ variable "agentcore_runtime_dispatch_enabled" {
1602
+ description = "THINK-585 U6: stage kill-switch for AgentCore Runtime chat dispatch (see lambda-api module)."
1603
+ type = bool
1604
+ default = false
1605
+ }
1606
+
1607
+ ################################################################################
1608
+ # THINK-915 — chat turn-latency observability (passthrough to the lambda-api
1609
+ # module; see terraform/modules/app/lambda-api/chat-latency-observability.tf).
1610
+ ################################################################################
1611
+
1612
+ variable "enable_chat_turn_latency_observability" {
1613
+ description = "THINK-915: create the per-stage chat turn-latency dashboard, the saved turn-timeline Logs Insights query, and the Lambda-native dispatch p95 alarm."
1614
+ type = bool
1615
+ default = true
1616
+ }
1617
+
1618
+ variable "enable_chat_turn_latency_metric_filters" {
1619
+ description = "THINK-915: create the agentcore_phase log metric filters (TurnRuntimeInvokeMs, AgentLoopMs) and the metric-filter-backed p95 alarm. OFF by default because the Lambda log groups are implicit and PutMetricFilter fails on a stage that has never served a chat turn."
1620
+ type = bool
1621
+ default = false
1622
+ }
1623
+
1624
+ variable "chat_turn_latency_metric_namespace" {
1625
+ description = "THINK-915: CloudWatch namespace prefix for the chat phase metrics; the stage is appended (Thinkwork/Chat/<stage>)."
1626
+ type = string
1627
+ default = "Thinkwork/Chat"
1628
+ }
1629
+
1630
+ variable "chat_turn_runtime_log_group_name" {
1631
+ description = "THINK-915: explicit AgentCore Pi runtime log group name. Empty discovers it by prefix at plan time."
1632
+ type = string
1633
+ default = ""
1634
+ }
1635
+
1636
+ variable "chat_turn_p95_alarm_threshold_ms" {
1637
+ description = "THINK-915: p95 threshold (ms) for the whole AgentCore runtime call, breaching on 2 of 3 five-minute periods."
1638
+ type = number
1639
+ default = 30000
1640
+ }
1641
+
1642
+ variable "chat_turn_latency_alarm_actions" {
1643
+ description = "THINK-915: SNS topic ARNs notified by the chat turn-latency alarms. Empty by default (no general alarm topic exists in the stack)."
1644
+ type = list(string)
1645
+ default = []
1382
1646
  }