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
@@ -81,6 +81,24 @@ variable "plugin_catalog_github_token_secret_arn" {
81
81
  default = ""
82
82
  }
83
83
 
84
+ variable "brain_m2m_platform_agent_secret_arn" {
85
+ 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."
86
+ type = string
87
+ default = ""
88
+ }
89
+
90
+ variable "brain_ops_api_url" {
91
+ description = "Optional Company Brain ops-api base URL for the Send-to-the-Brain flag path (THINK-781). Empty disables the action."
92
+ type = string
93
+ default = ""
94
+ }
95
+
96
+ variable "brain_ops_m2m_secret_arn" {
97
+ 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)."
98
+ type = string
99
+ default = ""
100
+ }
101
+
84
102
  variable "db_password" {
85
103
  description = "Master password for the Aurora cluster"
86
104
  type = string
@@ -93,16 +111,16 @@ variable "database_engine" {
93
111
  default = "aurora-serverless"
94
112
  }
95
113
 
96
- variable "hindsight_database_name" {
97
- description = "Dedicated Hindsight database name (THINK-220 cutover flag). Empty keeps Hindsight in the hindsight schema of the primary database."
98
- type = string
99
- default = ""
100
- }
101
-
102
114
  variable "enable_hindsight" {
103
- description = "Enable Hindsight canonical user and Space memory. Full ThinkWork installs default this on; set false only for explicit low-cost/development AgentCore-only deployments."
115
+ description = "DEPRECATED (THINK-407): the Hindsight memory engine and its infrastructure were removed; this input is inert and ignored. Retained so existing tfvars keep working."
104
116
  type = bool
105
- default = true
117
+ default = false
118
+ }
119
+
120
+ variable "external_kb_source_arns" {
121
+ description = "DEPRECATED (THINK-402): Knowledge Bases were removed from the product; this input is inert and ignored. Retained so existing tfvars keep working."
122
+ type = list(string)
123
+ default = []
106
124
  }
107
125
 
108
126
  variable "enable_capability_broker" {
@@ -111,14 +129,86 @@ variable "enable_capability_broker" {
111
129
  default = false
112
130
  }
113
131
 
114
- variable "analyst_lambda_vpc_egress" {
115
- description = "VPC-attach the analyst data-path Lambdas so their egress rides the NAT gateway's stable EIP required when an external analyst data source sits behind an IP allowlist. See the thinkwork module's analyst_egress_ip output for the IP to allowlist."
132
+ variable "auth_state_store" {
133
+ 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."
134
+ type = string
135
+ default = "postgres"
136
+
137
+ validation {
138
+ condition = contains(["postgres", "dynamo"], var.auth_state_store)
139
+ error_message = "auth_state_store must be \"postgres\" or \"dynamo\"."
140
+ }
141
+ }
142
+
143
+
144
+ variable "enable_agentcore_multiplayer_proof" {
145
+ description = "Opt in to the non-production THINK-316 AgentCore Identity/Gateway proof substrate."
116
146
  type = bool
117
147
  default = false
118
148
  }
119
149
 
150
+ variable "agentcore_multiplayer_proof_tenant_slug" {
151
+ description = "Explicit non-production tenant slug used for the one-Harness multiplayer proof."
152
+ type = string
153
+ default = ""
154
+ }
155
+
156
+ variable "agentcore_multiplayer_proof_owner_allowlist" {
157
+ description = "Comma-separated non-production subjects for the manual authorization-code and mixed-disclosure fixtures. Signed OBO turn participants do not require registration here."
158
+ type = string
159
+ default = ""
160
+ }
161
+
162
+ variable "agentcore_turn_assertion_key_versions" {
163
+ description = "One or two published AgentCore assertion key versions during rotation."
164
+ type = list(string)
165
+ default = ["v1"]
166
+ }
167
+
168
+ variable "agentcore_turn_assertion_active_key_version" {
169
+ description = "AgentCore assertion key version used to sign new tokens."
170
+ type = string
171
+ default = "v1"
172
+ }
173
+
174
+ variable "neptune_endpoint" {
175
+ type = string
176
+ default = ""
177
+ description = "Company Brain twin: Neptune writer endpoint (etl-platform neptune stack output; empty = twin disabled)"
178
+ }
179
+
180
+ variable "brain_mcp_url" {
181
+ type = string
182
+ default = ""
183
+ description = "Platform-served Brain MCP endpoint (consolidation U14); empty = legacy product-served /mcp/twin"
184
+ }
185
+
186
+ variable "neptune_cluster_resource_id" {
187
+ type = string
188
+ default = ""
189
+ description = "Company Brain twin: Neptune cluster resource id for IAM ARNs"
190
+ }
191
+
192
+ variable "neptune_client_security_group_id" {
193
+ type = string
194
+ default = ""
195
+ description = "Company Brain twin: neptune-client SG id for the identity-graph-projector"
196
+ }
197
+
198
+ variable "neptune_load_bucket" {
199
+ type = string
200
+ default = ""
201
+ description = "Company Brain twin: Neptune bulk-load staging bucket (empty = bulk-rebuild disabled)"
202
+ }
203
+
204
+ variable "neptune_loader_role_arn" {
205
+ type = string
206
+ default = ""
207
+ description = "Company Brain twin: IAM role the Neptune cluster assumes to read the load bucket"
208
+ }
209
+
120
210
  variable "memory_engine" {
121
- description = "Active long-term memory engine. Empty selects Hindsight when enable_hindsight = true. Use 'agentcore' only for explicit low-cost/development managed-memory deployments."
211
+ description = "DEPRECATED (THINK-407): AgentCore managed memory is the only engine; this input is inert and ignored. Retained so existing tfvars keep working."
122
212
  type = string
123
213
  default = ""
124
214
  }
@@ -128,6 +218,12 @@ variable "twenty_provisioned" {
128
218
  default = false
129
219
  }
130
220
 
221
+ variable "release_image_mirror_principal_arns" {
222
+ description = "IAM principals allowed to push release runtime images into this stage's AgentCore ECR repository (THINK-616). ThinkWork-operated customer stages set [\"arn:aws:iam::487219502366:root\"] so the release workflow can mirror `<releaseVersion>-pi-arm64`; leave empty for self-hosted deployments."
223
+ type = list(string)
224
+ default = []
225
+ }
226
+
131
227
  variable "twenty_runtime_enabled" {
132
228
  description = "Run Twenty CRM server/worker tasks when the retained substrate is provisioned."
133
229
  type = bool
@@ -298,14 +394,86 @@ variable "google_oauth_client_secret" {
298
394
  default = ""
299
395
  }
300
396
 
397
+ variable "microsoft_oauth_client_id" {
398
+ description = "Microsoft Entra application client ID for direct Cognito organizations login"
399
+ type = string
400
+ default = ""
401
+ }
402
+
403
+ variable "microsoft_oauth_client_secret" {
404
+ description = "Microsoft Entra application client secret for direct Cognito organizations login"
405
+ type = string
406
+ sensitive = true
407
+ default = ""
408
+ }
409
+
410
+ variable "microsoft_oauth_tenant" {
411
+ description = "Microsoft Entra directory GUID for the deployment's default Microsoft login route"
412
+ type = string
413
+ default = ""
414
+ }
415
+
416
+ variable "tenant_entra_connections" {
417
+ description = "Safe tenant-specific Entra provider metadata. Secret values must never be placed in tfvars."
418
+ type = list(object({
419
+ connection_key = string
420
+ tenant_id = string
421
+ provider_name = string
422
+ display_name = string
423
+ }))
424
+ default = []
425
+ }
426
+
427
+ variable "console_client_enabled" {
428
+ description = "Create the optional Company Brain console Cognito app client (U13). Default false = ship-inert."
429
+ type = bool
430
+ default = false
431
+ }
432
+
433
+ variable "console_callback_urls" {
434
+ description = "OAuth callback URLs for the console client — must include the console hosting URL BEFORE first login (redirect_mismatch otherwise)"
435
+ type = list(string)
436
+ default = []
437
+ }
438
+
439
+ variable "console_logout_urls" {
440
+ description = "OAuth logout URLs for the console client"
441
+ type = list(string)
442
+ default = []
443
+ }
444
+
301
445
  variable "pre_signup_lambda_zip" {
302
446
  description = "Path to the Cognito pre-signup Lambda zip"
303
447
  type = string
304
448
  default = ""
305
449
  }
306
450
 
451
+ variable "auth_retirement_phase" {
452
+ description = "Native-auth migration phase. Greenfield installs are native-only; use coexistence/cutover only for an existing deployment migration."
453
+ type = string
454
+ default = "retired"
455
+
456
+ validation {
457
+ condition = contains(["coexistence", "cutover", "retired"], var.auth_retirement_phase)
458
+ error_message = "auth_retirement_phase must be coexistence, cutover, or retired."
459
+ }
460
+ }
461
+
462
+ variable "auth_migration_recovery_deadline" {
463
+ description = "RFC3339 deadline for legacy-session identity migration; required only when explicitly deploying coexistence."
464
+ type = string
465
+ default = ""
466
+
467
+ validation {
468
+ condition = trimspace(var.auth_migration_recovery_deadline) == "" || (
469
+ can(timecmp(var.auth_migration_recovery_deadline, var.auth_migration_recovery_deadline))
470
+ )
471
+ error_message = "auth_migration_recovery_deadline must be empty or an RFC3339 timestamp."
472
+ }
473
+ }
474
+
307
475
  variable "cognito_custom_auth_lambda_zip" {
308
- description = "Path to the Cognito custom-auth challenge Lambda zip"
476
+ description = "Path to the WorkOS rollback Cognito custom-auth Lambda zip for source-checkout deployments."
309
477
  type = string
310
478
  default = ""
311
479
  }
@@ -353,6 +521,41 @@ variable "platform_operator_emails" {
353
521
  default = ""
354
522
  }
355
523
 
524
+ # THINK-583 U3 — provisioned concurrency for chat-agent-invoke /
525
+ # workspace-renderer (KTD5: never the Pi Lambda). Default 0 = disabled;
526
+ # the `live` alias always exists so alias-qualified invokers work either
527
+ # way. Dev sets 1/1 via scripts/deploy/terraform-vars.sh; customer stages
528
+ # opt in through their runner-secrets tfvars on their release cadence.
529
+
530
+ variable "agentcore_runtime_dispatch_enabled" {
531
+ description = "THINK-585 U6: stage kill-switch for AgentCore Runtime chat dispatch."
532
+ type = bool
533
+ default = false
534
+ }
535
+
536
+ variable "agentcore_session_scope" {
537
+ description = "THINK-909/THINK-946 AgentCore runtime session scope. \"thread\" (default) keys the runtime session per thread; \"user\" keys it per (tenant, agent, user) so a user's NEW thread lands on their already-warm microVM and reuses its MCP connections and toolset. Set \"user\" only after the stage's Pi runtime image dual-accepts both session ids. mcpherson runs \"user\"; every other stage runs the default."
538
+ type = string
539
+ default = "thread"
540
+
541
+ validation {
542
+ condition = contains(["thread", "user"], var.agentcore_session_scope)
543
+ error_message = "agentcore_session_scope must be \"thread\" or \"user\"."
544
+ }
545
+ }
546
+
547
+ variable "chat_agent_invoke_provisioned_concurrency" {
548
+ description = "Provisioned concurrency on chat-agent-invoke's `live` alias. 0 = disabled (alias still exists)."
549
+ type = number
550
+ default = 0
551
+ }
552
+
553
+ variable "workspace_renderer_provisioned_concurrency" {
554
+ description = "Provisioned concurrency on workspace-renderer's `live` alias. 0 = disabled (alias still exists)."
555
+ type = number
556
+ default = 0
557
+ }
558
+
356
559
  variable "www_domain" {
357
560
  description = "Public website apex domain (e.g. thinkwork.ai). Leave empty to skip the custom domain and DNS wiring."
358
561
  type = string
@@ -389,21 +592,6 @@ variable "stripe_price_ids_json" {
389
592
  default = "{}"
390
593
  }
391
594
 
392
- variable "wiki_compile_model_id" {
393
- description = <<-EOT
394
- Bedrock model id the wiki-compile Lambda uses for the leaf planner,
395
- aggregation planner, and section writer. Any Converse-compatible
396
- model works; change without a code deploy.
397
-
398
- Default: openai.gpt-oss-120b-1:0 (strong output quality at a lower
399
- per-minute throttle risk than Claude Haiku 4.5 on shared dev
400
- accounts). Swap to us.anthropic.claude-haiku-4-5-20251001-v1:0 for
401
- Claude, or amazon.nova-micro-v1:0 for a low-cost spike.
402
- EOT
403
- type = string
404
- default = "openai.gpt-oss-120b-1:0"
405
- }
406
-
407
595
  variable "requester_idle_memory_learning_enabled" {
408
596
  description = "Enable requester-scoped 15-minute idle memory learning."
409
597
  type = bool
@@ -428,18 +616,6 @@ variable "brain_dream_state_enabled" {
428
616
  default = false
429
617
  }
430
618
 
431
- variable "retry_dispatcher_enabled" {
432
- 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; manual invokes work regardless."
433
- type = bool
434
- default = false
435
- }
436
-
437
- variable "stall_threshold_minutes" {
438
- 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)."
439
- type = number
440
- default = 5
441
- }
442
-
443
619
  variable "requester_memory_dreaming_model_id" {
444
620
  description = "Bedrock Converse model id for requester memory REM reflection."
445
621
  type = string
@@ -456,8 +632,20 @@ variable "brain_source_agent_model_id" {
456
632
  default = "us.anthropic.claude-haiku-4-5-20251001-v1:0"
457
633
  }
458
634
 
459
- variable "knowledge_graph_observations_ingest_enabled" {
460
- description = "Enable the Brain distillation schedule (observations -> knowledge graph). Ships disabled; flip on dev after a validated manual run (plan 2026-07-03-005 U4)."
635
+ variable "identity_drift_match_enabled" {
636
+ description = "Enable the recurring per-tenant identity drift match sweep (THINK-321 U7/KTD-7 R10). Ships disabled; enabled per stage once bootstrap matching has been proven there."
637
+ type = bool
638
+ default = false
639
+ }
640
+
641
+ variable "vpc_interface_endpoint_services" {
642
+ description = "AWS services that get a private interface endpoint (null = legacy full set, [] = none). See modules/thinkwork. Cost review 2026-08-28."
643
+ type = list(string)
644
+ default = null
645
+ }
646
+
647
+ variable "vpc_interface_endpoint_single_az" {
648
+ description = "One ENI per interface endpoint instead of one per AZ. Cost review 2026-08-28."
461
649
  type = bool
462
650
  default = false
463
651
  }
@@ -473,23 +661,6 @@ variable "wiki_source" {
473
661
  }
474
662
  }
475
663
 
476
- variable "analyst_policy_source" {
477
- 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."
478
- type = string
479
- default = "row"
480
-
481
- validation {
482
- condition = contains(["row", "sidecar"], var.analyst_policy_source)
483
- error_message = "analyst_policy_source must be 'row' or 'sidecar'."
484
- }
485
- }
486
-
487
- variable "capability_self_extension_tenants" {
488
- description = "Governed autonomy opt-in: comma/space-separated tenant ids allowed to autonomously self-extend capabilities (self_admit_connection / self_approve_routine). Empty (default) = NO tenant enabled; self-extension ships inert and fail-closed."
489
- type = string
490
- default = ""
491
- }
492
-
493
664
  variable "wiki_aggregation_pass_enabled" {
494
665
  description = <<-EOT
495
666
  Feature flag for the wiki aggregation pass — the second LLM call
@@ -504,23 +675,6 @@ variable "wiki_aggregation_pass_enabled" {
504
675
  default = "true"
505
676
  }
506
677
 
507
- variable "google_places_api_key" {
508
- description = <<-EOT
509
- Google Places API (New) key used by wiki-compile to enrich POI records
510
- with city/state/country hierarchy during compile. When empty, compile
511
- gracefully degrades to metadata-only place rows (no hierarchy, no
512
- backing pages), so this is opt-in. Stored as a SecureString at
513
- /thinkwork/<stage>/google-places/api-key — see
514
- terraform/modules/app/lambda-api/handlers.tf for the SSM resource.
515
-
516
- The parameter's value has lifecycle.ignore_changes set, so you can
517
- rotate via `aws ssm put-parameter --overwrite` without terraform
518
- fighting you on the next apply.
519
- EOT
520
- type = string
521
- default = ""
522
- sensitive = true
523
- }
524
678
 
525
679
  variable "mapbox_public_token" {
526
680
  description = <<-EOT
@@ -600,6 +754,30 @@ variable "customer_domain" {
600
754
  default = ""
601
755
  }
602
756
 
757
+ variable "deployment_runner_in_vpc" {
758
+ description = "Run the deployment runner CodeBuild inside the VPC and grant it tcp/5432 on the database security group instead of relying on the world-open DB ingress (THINK-1082). Also turns on the VPC NAT gateway. Default false = no networking change."
759
+ type = bool
760
+ default = false
761
+ }
762
+
763
+ variable "api_lambdas_in_vpc" {
764
+ description = "Run every database-connected Lambda (api handlers, agentcore-admin, Pi, broker) inside the VPC behind the api-lambda security group, granted tcp/5432 on the database security group (THINK-1082). Also turns on the VPC NAT gateway. Default false = no networking change."
765
+ type = bool
766
+ default = false
767
+ }
768
+
769
+ variable "db_publicly_accessible" {
770
+ description = "Aurora publicly_accessible (THINK-1082). Default true. Set false only after api_lambdas_in_vpc and deployment_runner_in_vpc are live."
771
+ type = bool
772
+ default = true
773
+ }
774
+
775
+ variable "db_public_ingress_cidrs" {
776
+ description = "tcp/5432 CIDR ingress seeded on a NEW database security group (THINK-1082). Default [\"0.0.0.0/0\"]; [] = none. Does not revoke a live rule — see modules/app/deployment-control-plane/README.md."
777
+ type = list(string)
778
+ default = ["0.0.0.0/0"]
779
+ }
780
+
603
781
  variable "customer_domain_delegated" {
604
782
  description = "Set true once the apex zone's NS records point at the customer zone (claim tool phase two). Gates the ACM certificate, the web alias records, and the customer-domain Cognito callback entries. Requires customer_domain."
605
783
  type = bool
@@ -612,9 +790,20 @@ variable "customer_domain_legacy_retired" {
612
790
  default = false
613
791
  }
614
792
 
793
+ variable "additional_admin_callback_urls" {
794
+ description = "Extra OAuth callback URLs appended to the web-family Cognito clients (e.g. a hosted Company Brain console origin). Supply both the bare origin and its /auth/callback variant. Empty leaves behavior unchanged."
795
+ type = list(string)
796
+ default = []
797
+ }
798
+
799
+ variable "additional_admin_logout_urls" {
800
+ description = "Extra OAuth logout URLs appended to the web-family Cognito clients (companion to additional_admin_callback_urls)."
801
+ type = list(string)
802
+ default = []
803
+ }
804
+
615
805
  locals {
616
806
  www_dns_enabled = var.www_domain != "" && var.cloudflare_zone_id != ""
617
- docs_domain = var.www_domain != "" ? "docs.${var.www_domain}" : ""
618
807
  app_domain = var.www_domain != "" ? "app.${var.www_domain}" : ""
619
808
  computer_domain = var.www_domain != "" ? "computer.${var.www_domain}" : ""
620
809
  sandbox_domain = var.www_domain != "" ? "sandbox.${var.www_domain}" : ""
@@ -775,63 +964,85 @@ module "thinkwork" {
775
964
  account_id = var.account_id
776
965
 
777
966
  plugin_catalog_github_token_secret_arn = var.plugin_catalog_github_token_secret_arn
778
-
779
- db_password = var.db_password
780
- database_engine = var.database_engine
781
- enable_hindsight = var.enable_hindsight
782
- enable_capability_broker = var.enable_capability_broker
783
- analyst_lambda_vpc_egress = var.analyst_lambda_vpc_egress
784
- hindsight_database_name = var.hindsight_database_name
785
- memory_engine = var.memory_engine
786
- twenty_provisioned = var.twenty_provisioned
787
- twenty_runtime_enabled = var.twenty_runtime_enabled
788
- twenty_image_uri = var.twenty_image_uri
789
- twenty_db_username = var.twenty_db_username
790
- twenty_db_name = var.twenty_db_name
791
- twenty_db_url_secret_arn = var.twenty_db_url_secret_arn
792
- twenty_encryption_key_secret_arn = var.twenty_encryption_key_secret_arn
793
- twenty_email_from_address = var.twenty_email_from_address
794
- twenty_email_from_name = var.twenty_email_from_name
795
- twenty_public_url = local.twenty_url
796
- twenty_certificate_arn = var.twenty_certificate_arn != "" ? var.twenty_certificate_arn : (local.twenty_managed_certificate_enabled ? aws_acm_certificate_validation.twenty[0].certificate_arn : "")
797
- n8n_provisioned = var.n8n_provisioned
798
- n8n_runtime_enabled = var.n8n_runtime_enabled
799
- n8n_image_uri = var.n8n_image_uri
800
- n8n_database_admin_secret_arn = var.n8n_database_admin_secret_arn
801
- n8n_database_url_secret_arn = var.n8n_database_url_secret_arn
802
- n8n_database_username = var.n8n_database_username
803
- n8n_database_name = var.n8n_database_name
804
- n8n_encryption_key_secret_arn = var.n8n_encryption_key_secret_arn
805
- n8n_operator_secret_arn = var.n8n_operator_secret_arn
806
- n8n_service_credential_secret_arn = var.n8n_service_credential_secret_arn
807
- n8n_storage_bucket_name = var.n8n_storage_bucket_name
808
- n8n_container_port = var.n8n_container_port
809
- n8n_cache_engine = var.n8n_cache_engine
810
- n8n_domain = local.n8n_domain
811
- n8n_public_url = local.n8n_url
812
- n8n_certificate_arn = var.n8n_certificate_arn != "" ? var.n8n_certificate_arn : (local.n8n_managed_certificate_enabled ? aws_acm_certificate_validation.n8n[0].certificate_arn : "")
813
- google_oauth_client_id = var.google_oauth_client_id
814
- google_oauth_client_secret = var.google_oauth_client_secret
815
- pre_signup_lambda_zip = var.pre_signup_lambda_zip
816
- cognito_custom_auth_lambda_zip = var.cognito_custom_auth_lambda_zip
817
- lambda_zips_dir = var.lambda_zips_dir
818
- lambda_artifact_bucket = var.lambda_artifact_bucket
819
- lambda_artifact_prefix = var.lambda_artifact_prefix
820
- require_lambda_artifacts = var.require_lambda_artifacts
821
- enable_workspace_orchestration = var.enable_workspace_orchestration
822
- api_auth_secret = var.api_auth_secret
823
- platform_operator_emails = var.platform_operator_emails
967
+ brain_m2m_platform_agent_secret_arn = var.brain_m2m_platform_agent_secret_arn
968
+ brain_ops_api_url = var.brain_ops_api_url
969
+ brain_ops_m2m_secret_arn = var.brain_ops_m2m_secret_arn
970
+
971
+ db_password = var.db_password
972
+ database_engine = var.database_engine
973
+ enable_hindsight = var.enable_hindsight
974
+ external_kb_source_arns = var.external_kb_source_arns
975
+ enable_capability_broker = var.enable_capability_broker
976
+ auth_state_store = var.auth_state_store
977
+ enable_agentcore_multiplayer_proof = var.enable_agentcore_multiplayer_proof
978
+ agentcore_multiplayer_proof_tenant_slug = var.agentcore_multiplayer_proof_tenant_slug
979
+ agentcore_multiplayer_proof_owner_allowlist = var.agentcore_multiplayer_proof_owner_allowlist
980
+ agentcore_turn_assertion_key_versions = var.agentcore_turn_assertion_key_versions
981
+ agentcore_turn_assertion_active_key_version = var.agentcore_turn_assertion_active_key_version
982
+ neptune_endpoint = var.neptune_endpoint
983
+ brain_mcp_url = var.brain_mcp_url
984
+ neptune_cluster_resource_id = var.neptune_cluster_resource_id
985
+ neptune_client_security_group_id = var.neptune_client_security_group_id
986
+ neptune_load_bucket = var.neptune_load_bucket
987
+ neptune_loader_role_arn = var.neptune_loader_role_arn
988
+ memory_engine = var.memory_engine
989
+ release_image_mirror_principal_arns = var.release_image_mirror_principal_arns
990
+ twenty_provisioned = var.twenty_provisioned
991
+ twenty_runtime_enabled = var.twenty_runtime_enabled
992
+ twenty_image_uri = var.twenty_image_uri
993
+ twenty_db_username = var.twenty_db_username
994
+ twenty_db_name = var.twenty_db_name
995
+ twenty_db_url_secret_arn = var.twenty_db_url_secret_arn
996
+ twenty_encryption_key_secret_arn = var.twenty_encryption_key_secret_arn
997
+ twenty_email_from_address = var.twenty_email_from_address
998
+ twenty_email_from_name = var.twenty_email_from_name
999
+ twenty_public_url = local.twenty_url
1000
+ twenty_certificate_arn = var.twenty_certificate_arn != "" ? var.twenty_certificate_arn : (local.twenty_managed_certificate_enabled ? aws_acm_certificate_validation.twenty[0].certificate_arn : "")
1001
+ n8n_provisioned = var.n8n_provisioned
1002
+ n8n_runtime_enabled = var.n8n_runtime_enabled
1003
+ n8n_image_uri = var.n8n_image_uri
1004
+ n8n_database_admin_secret_arn = var.n8n_database_admin_secret_arn
1005
+ n8n_database_url_secret_arn = var.n8n_database_url_secret_arn
1006
+ n8n_database_username = var.n8n_database_username
1007
+ n8n_database_name = var.n8n_database_name
1008
+ n8n_encryption_key_secret_arn = var.n8n_encryption_key_secret_arn
1009
+ n8n_operator_secret_arn = var.n8n_operator_secret_arn
1010
+ n8n_service_credential_secret_arn = var.n8n_service_credential_secret_arn
1011
+ n8n_storage_bucket_name = var.n8n_storage_bucket_name
1012
+ n8n_container_port = var.n8n_container_port
1013
+ n8n_cache_engine = var.n8n_cache_engine
1014
+ n8n_domain = local.n8n_domain
1015
+ n8n_public_url = local.n8n_url
1016
+ n8n_certificate_arn = var.n8n_certificate_arn != "" ? var.n8n_certificate_arn : (local.n8n_managed_certificate_enabled ? aws_acm_certificate_validation.n8n[0].certificate_arn : "")
1017
+ google_oauth_client_id = var.google_oauth_client_id
1018
+ google_oauth_client_secret = var.google_oauth_client_secret
1019
+ microsoft_oauth_client_id = var.microsoft_oauth_client_id
1020
+ microsoft_oauth_client_secret = var.microsoft_oauth_client_secret
1021
+ microsoft_oauth_tenant = var.microsoft_oauth_tenant
1022
+ tenant_entra_connections = var.tenant_entra_connections
1023
+ console_client_enabled = var.console_client_enabled
1024
+ console_callback_urls = var.console_callback_urls
1025
+ console_logout_urls = var.console_logout_urls
1026
+ pre_signup_lambda_zip = var.pre_signup_lambda_zip
1027
+ auth_retirement_phase = var.auth_retirement_phase
1028
+ auth_migration_recovery_deadline = var.auth_migration_recovery_deadline
1029
+ cognito_custom_auth_lambda_zip = var.cognito_custom_auth_lambda_zip
1030
+ lambda_zips_dir = var.lambda_zips_dir
1031
+ lambda_artifact_bucket = var.lambda_artifact_bucket
1032
+ lambda_artifact_prefix = var.lambda_artifact_prefix
1033
+ require_lambda_artifacts = var.require_lambda_artifacts
1034
+ enable_workspace_orchestration = var.enable_workspace_orchestration
1035
+ api_auth_secret = var.api_auth_secret
1036
+ platform_operator_emails = var.platform_operator_emails
1037
+ agentcore_runtime_dispatch_enabled = var.agentcore_runtime_dispatch_enabled
1038
+ agentcore_session_scope = var.agentcore_session_scope
1039
+ chat_agent_invoke_provisioned_concurrency = var.chat_agent_invoke_provisioned_concurrency
1040
+ workspace_renderer_provisioned_concurrency = var.workspace_renderer_provisioned_concurrency
824
1041
 
825
1042
  # Public website custom domain (optional — wired only when www_domain is set)
826
1043
  www_domain = var.www_domain
827
1044
  www_certificate_arn = local.www_dns_enabled ? module.www_dns[0].certificate_arn : ""
828
1045
 
829
- # Docs site custom domain (derived from www_domain — docs.<apex>). The
830
- # same ACM cert covers apex + www + docs + app/computer so every distribution
831
- # shares it.
832
- docs_domain = local.www_dns_enabled ? local.docs_domain : ""
833
- docs_certificate_arn = local.www_dns_enabled ? module.www_dns[0].certificate_arn : ""
834
-
835
1046
  # End-user app custom domain (derived from www_domain — app.<apex>).
836
1047
  # Same ACM cert covers it via the include_app SAN gate on www_dns.
837
1048
  app_domain = local.www_dns_enabled ? local.app_domain : ""
@@ -845,7 +1056,7 @@ module "thinkwork" {
845
1056
 
846
1057
  # Computer iframe sandbox (derived from www_domain — sandbox.<apex>).
847
1058
  # Uses its own ACM certificate so sandbox bootstrap/rotation cannot replace
848
- # the shared apex/www/docs/app/computer/api certificate.
1059
+ # the shared apex/www/app/computer/api certificate.
849
1060
  computer_sandbox_domain = local.www_dns_enabled ? local.sandbox_domain : ""
850
1061
  computer_sandbox_certificate_arn = local.www_dns_enabled ? aws_acm_certificate_validation.computer_sandbox[0].certificate_arn : ""
851
1062
  computer_sandbox_allowed_parent_origins = local.www_dns_enabled ? "https://${local.app_domain}" : ""
@@ -858,21 +1069,17 @@ module "thinkwork" {
858
1069
  # Wiki compile Lambda config. Pinned so unrelated terraform applies
859
1070
  # don't wipe the Bedrock model or the aggregation flag back to
860
1071
  # whatever the Lambda env defaults to.
861
- wiki_compile_model_id = var.wiki_compile_model_id
862
1072
  brain_source_agent_model_id = var.brain_source_agent_model_id
863
1073
  wiki_aggregation_pass_enabled = var.wiki_aggregation_pass_enabled
864
1074
  wiki_source = var.wiki_source
865
- analyst_policy_source = var.analyst_policy_source
866
- capability_self_extension_tenants = var.capability_self_extension_tenants
867
- knowledge_graph_observations_ingest_enabled = var.knowledge_graph_observations_ingest_enabled
1075
+ vpc_interface_endpoint_services = var.vpc_interface_endpoint_services
1076
+ vpc_interface_endpoint_single_az = var.vpc_interface_endpoint_single_az
1077
+ identity_drift_match_enabled = var.identity_drift_match_enabled
868
1078
  wiki_deterministic_linking_enabled = var.wiki_deterministic_linking_enabled
869
- google_places_api_key = var.google_places_api_key
870
1079
  requester_idle_memory_learning_enabled = var.requester_idle_memory_learning_enabled
871
1080
  requester_memory_dreaming_enabled = var.requester_memory_dreaming_enabled
872
1081
  requester_memory_dreaming_schedule_expression = var.requester_memory_dreaming_schedule_expression
873
1082
  brain_dream_state_enabled = var.brain_dream_state_enabled
874
- retry_dispatcher_enabled = var.retry_dispatcher_enabled
875
- stall_threshold_minutes = var.stall_threshold_minutes
876
1083
  requester_memory_dreaming_model_id = var.requester_memory_dreaming_model_id
877
1084
  agentcore_code_interpreter_id = var.agentcore_code_interpreter_id
878
1085
  agentcore_memory_id = var.agentcore_memory_id
@@ -897,11 +1104,21 @@ module "thinkwork" {
897
1104
  customer_domain_delegated = var.customer_domain_delegated
898
1105
  customer_domain_legacy_retired = var.customer_domain_legacy_retired
899
1106
 
1107
+ # Deployment runner / API Lambdas inside the VPC + database exposure (THINK-1082)
1108
+ # — see modules/app/deployment-control-plane/README.md, "Closing the database port".
1109
+ deployment_runner_in_vpc = var.deployment_runner_in_vpc
1110
+ api_lambdas_in_vpc = var.api_lambdas_in_vpc
1111
+ db_publicly_accessible = var.db_publicly_accessible
1112
+ db_public_ingress_cidrs = var.db_public_ingress_cidrs
1113
+
1114
+ additional_admin_callback_urls = var.additional_admin_callback_urls
1115
+ additional_admin_logout_urls = var.additional_admin_logout_urls
1116
+
900
1117
  # Greenfield: create everything (all defaults are true)
901
1118
  }
902
1119
 
903
1120
  ################################################################################
904
- # Public Website DNS (Cloudflare zone, ACM cert, www→apex redirect, docs)
1121
+ # Public Website DNS (Cloudflare zone, ACM cert, www→apex redirect)
905
1122
  ################################################################################
906
1123
 
907
1124
  module "www_dns" {
@@ -913,12 +1130,10 @@ module "www_dns" {
913
1130
  cloudflare_zone_id = var.cloudflare_zone_id
914
1131
  cloudfront_domain_name = module.thinkwork.www_distribution_domain
915
1132
 
916
- # Docs: include_docs is a plain bool (no output reference) so the
917
- # ACM cert SAN list doesn't depend on the docs distribution output,
918
- # which itself depends on the cert. docs_cloudfront_domain_name is
919
- # read only after the cert is created, for the CNAME record.
920
- include_docs = true
921
- docs_cloudfront_domain_name = module.thinkwork.docs_distribution_domain
1133
+ # This stack predates THINK-702, so the shared cert still carries the
1134
+ # retired docs.<domain> SAN. Dropping it would force a cert replacement
1135
+ # that cycles against the thinkwork module — keep the dead SAN instead.
1136
+ retain_docs_san = true
922
1137
 
923
1138
  # End-user app: canonical app.<apex> host. The compatibility output names
924
1139
  # still use computer_* while the source path is apps/web.
@@ -1025,12 +1240,6 @@ output "appsync_realtime_url" {
1025
1240
  value = module.thinkwork.appsync_realtime_url
1026
1241
  }
1027
1242
 
1028
- output "appsync_api_key" {
1029
- description = "AppSync API key"
1030
- value = module.thinkwork.appsync_api_key
1031
- sensitive = true
1032
- }
1033
-
1034
1243
  output "mapbox_public_token" {
1035
1244
  description = "Mapbox public token used by apps/web MapView. Read by scripts/build-web.sh to inline VITE_MAPBOX_PUBLIC_TOKEN at build time; empty string lets MapView fall back to OpenStreetMap tiles."
1036
1245
  value = module.thinkwork.mapbox_public_token
@@ -1052,11 +1261,31 @@ output "admin_client_id" {
1052
1261
  value = module.thinkwork.admin_client_id
1053
1262
  }
1054
1263
 
1264
+ output "auth_route_clients" {
1265
+ description = "Safe Cognito app-client manifest for local, Google, Microsoft, and tenant Entra routes."
1266
+ value = module.thinkwork.auth_route_clients
1267
+ }
1268
+
1269
+ output "auth_retirement_phase" {
1270
+ description = "Applied authentication retirement phase used for safe controller upgrades."
1271
+ value = module.thinkwork.auth_retirement_phase
1272
+ }
1273
+
1274
+ output "web_local_client_id" {
1275
+ description = "Local-password-only Cognito app client used by the web runtime."
1276
+ value = module.thinkwork.web_local_client_id
1277
+ }
1278
+
1055
1279
  output "mobile_client_id" {
1056
1280
  description = "Cognito app client ID for mobile"
1057
1281
  value = module.thinkwork.mobile_client_id
1058
1282
  }
1059
1283
 
1284
+ output "console_client_id" {
1285
+ description = "Cognito app client ID for the Company Brain console (null while console_client_enabled = false)"
1286
+ value = module.thinkwork.console_client_id
1287
+ }
1288
+
1060
1289
  output "ecr_repository_url" {
1061
1290
  description = "ECR repository URL for the AgentCore container"
1062
1291
  value = module.thinkwork.ecr_repository_url
@@ -1082,15 +1311,6 @@ output "database_name" {
1082
1311
  value = module.thinkwork.database_name
1083
1312
  }
1084
1313
 
1085
- output "hindsight_enabled" {
1086
- description = "Whether Hindsight canonical memory is enabled"
1087
- value = module.thinkwork.hindsight_enabled
1088
- }
1089
-
1090
- output "hindsight_endpoint" {
1091
- description = "Hindsight API endpoint (null when enable_hindsight = false)"
1092
- value = module.thinkwork.hindsight_endpoint
1093
- }
1094
1314
  output "twenty_provisioned" {
1095
1315
  description = "Whether the Twenty CRM retained managed-app substrate is provisioned"
1096
1316
  value = module.thinkwork.twenty_provisioned
@@ -1266,21 +1486,6 @@ output "computer_sandbox_allowed_parent_origins" {
1266
1486
  value = module.thinkwork.computer_sandbox_allowed_parent_origins
1267
1487
  }
1268
1488
 
1269
- output "docs_url" {
1270
- description = "Docs site URL"
1271
- value = local.www_dns_enabled ? "https://${local.docs_domain}" : "https://${module.thinkwork.docs_distribution_domain}"
1272
- }
1273
-
1274
- output "docs_distribution_id" {
1275
- description = "CloudFront distribution ID for docs (for cache invalidation)"
1276
- value = module.thinkwork.docs_distribution_id
1277
- }
1278
-
1279
- output "docs_bucket_name" {
1280
- description = "S3 bucket for docs site assets"
1281
- value = module.thinkwork.docs_bucket_name
1282
- }
1283
-
1284
1489
  output "www_url" {
1285
1490
  description = "Public website URL"
1286
1491
  value = var.www_domain != "" ? "https://${var.www_domain}" : "https://${module.thinkwork.www_distribution_domain}"
@@ -1352,7 +1557,17 @@ output "customer_domain_name_servers" {
1352
1557
  value = module.thinkwork.customer_domain_name_servers
1353
1558
  }
1354
1559
 
1355
- output "analyst_egress_ip" {
1356
- description = "Stable NAT egress IP of the VPC-attached analyst data-path Lambdas (null unless analyst_lambda_vpc_egress is set)"
1357
- value = module.thinkwork.analyst_egress_ip
1560
+ # The original AgentCore Twenty reconciliation marker never owned external
1561
+ # cleanup, but an interrupted local-exec may have left it tainted. Forget it
1562
+ # from state without refresh or destroy provisioners — the child module owns
1563
+ # the replacement idempotent reconciliation marker under a new address. The
1564
+ # managed customer-update root (deployment-control-plane runner) carries the
1565
+ # same block; without it here, a dev push plans a delete the destructive-apply
1566
+ # guard rightly refuses.
1567
+ removed {
1568
+ from = module.thinkwork.module.agentcore_proof_identity.terraform_data.twenty_identity_lifecycle
1569
+
1570
+ lifecycle {
1571
+ destroy = false
1572
+ }
1358
1573
  }