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
@@ -13,6 +13,30 @@ variable "region" {
13
13
  type = string
14
14
  }
15
15
 
16
+ variable "auth_retirement_phase" {
17
+ description = "Native-auth migration phase. Fresh deployments default to retired; WorkOS callback/bridge routes exist only for explicitly configured upgrade rollback windows."
18
+ type = string
19
+ default = "retired"
20
+
21
+ validation {
22
+ condition = contains(["coexistence", "cutover", "retired"], var.auth_retirement_phase)
23
+ error_message = "auth_retirement_phase must be coexistence, cutover, or retired."
24
+ }
25
+ }
26
+
27
+ variable "auth_migration_recovery_deadline" {
28
+ description = "RFC3339 deadline for completing legacy-session identity migration. Required while auth_retirement_phase is coexistence."
29
+ type = string
30
+ default = ""
31
+
32
+ validation {
33
+ condition = trimspace(var.auth_migration_recovery_deadline) == "" || (
34
+ can(timecmp(var.auth_migration_recovery_deadline, var.auth_migration_recovery_deadline))
35
+ )
36
+ error_message = "auth_migration_recovery_deadline must be empty or an RFC3339 timestamp."
37
+ }
38
+ }
39
+
16
40
  variable "lambda_artifact_bucket" {
17
41
  description = "S3 bucket containing Lambda deployment artifacts"
18
42
  type = string
@@ -92,6 +116,24 @@ variable "plugin_catalog_github_token_secret_arn" {
92
116
  default = ""
93
117
  }
94
118
 
119
+ variable "brain_m2m_platform_agent_secret_arn" {
120
+ 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."
121
+ type = string
122
+ default = ""
123
+ }
124
+
125
+ variable "brain_ops_api_url" {
126
+ description = "Optional Company Brain ops-api base URL (the API Gateway endpoint the Brain console uses, e.g. https://xxxx.execute-api.us-east-1.amazonaws.com). When set alongside brain_ops_m2m_secret_arn, the flagThreadToBrain mutation can POST /flags (THINK-781). Empty disables the Send-to-the-Brain action."
127
+ type = string
128
+ default = ""
129
+ }
130
+
131
+ variable "brain_ops_m2m_secret_arn" {
132
+ description = "Optional Secrets Manager ARN of the Brain agent-identity m2m secret (Cognito client-credentials blob for the ops-api operator pool, scope etl-agent/tasks — e.g. etl-platform/agent/cognito-m2m-brain). When set, the shared API Lambda role may read it so flagThreadToBrain can mint bearers for POST /flags (THINK-781)."
133
+ type = string
134
+ default = ""
135
+ }
136
+
95
137
  variable "brain_artifacts_kms_key_arn" {
96
138
  description = "Optional KMS key ARN used to encrypt canonical ThinkWork Brain artifacts. AES256 encryption is used when unset."
97
139
  type = string
@@ -124,6 +166,12 @@ variable "mobile_client_id" {
124
166
  type = string
125
167
  }
126
168
 
169
+ variable "console_client_id" {
170
+ description = "Optional Company Brain console client ID (U13). Empty when the console client is disabled — kept out of COGNITO_APP_CLIENT_IDS via compact()."
171
+ type = string
172
+ default = ""
173
+ }
174
+
127
175
  variable "cognito_auth_domain" {
128
176
  description = "Cognito hosted UI domain prefix, e.g. thinkwork-dev. Empty disables MCP OAuth login."
129
177
  type = string
@@ -135,19 +183,76 @@ variable "appsync_api_url" {
135
183
  type = string
136
184
  }
137
185
 
138
- variable "appsync_api_key" {
139
- description = "AppSync API key"
186
+ variable "appsync_api_id" {
187
+ description = "AppSync subscriptions API ID used as the subscription-ticket audience"
140
188
  type = string
141
- sensitive = true
142
189
  }
143
190
 
144
- variable "kb_service_role_arn" {
145
- description = "Bedrock Knowledge Base service role ARN"
191
+ variable "agentcore_harness_execution_role_arn" {
192
+ description = "Legacy Harness execution-role input retained for module compatibility. Request-path PassRole/control-plane grants were removed by THINK-316 U2."
146
193
  type = string
194
+ default = ""
147
195
  }
148
196
 
149
- variable "agentcore_harness_execution_role_arn" {
150
- description = "AgentCore Harness execution role ARN (THINK-311 U4). Empty string (harness module disabled) omits the Harness invoker grants from the grouped ai policy."
197
+ variable "enable_agentcore_harness_invocation" {
198
+ description = "Grant only the Harness data-plane invocation actions to the request path. Harness control-plane permissions remain outside Lambda."
199
+ type = bool
200
+ default = false
201
+ }
202
+
203
+ variable "enable_agentcore_multiplayer_proof" {
204
+ description = "Enable the non-production THINK-316 AgentCore Identity/Gateway/Harness proof surfaces. Defaults off and never changes ordinary Pi routing."
205
+ type = bool
206
+ default = false
207
+ }
208
+
209
+ variable "agentcore_turn_assertion_key_versions" {
210
+ description = "One or two published AgentCore assertion KMS key versions. Use two only during the bounded rotation overlap."
211
+ type = list(string)
212
+ default = ["v1"]
213
+
214
+ validation {
215
+ condition = (
216
+ length(var.agentcore_turn_assertion_key_versions) >= 1 &&
217
+ length(var.agentcore_turn_assertion_key_versions) <= 2 &&
218
+ length(distinct(var.agentcore_turn_assertion_key_versions)) == length(var.agentcore_turn_assertion_key_versions) &&
219
+ alltrue([for version in var.agentcore_turn_assertion_key_versions : can(regex("^[a-z0-9][a-z0-9-]{0,15}$", version))])
220
+ )
221
+ error_message = "agentcore_turn_assertion_key_versions must contain one or two unique lowercase version labels."
222
+ }
223
+ }
224
+
225
+ variable "agentcore_turn_assertion_active_key_version" {
226
+ description = "Published AgentCore assertion key version used for new signatures."
227
+ type = string
228
+ default = "v1"
229
+
230
+ # Membership in agentcore_turn_assertion_key_versions is enforced by a
231
+ # precondition on aws_kms_key.agentcore_turn_assertion — variable validations
232
+ # cannot reference other variables until Terraform 1.9, and this module
233
+ # supports the repo floor of Terraform 1.5 (the customer deployment runner
234
+ # pins 1.8.5).
235
+ validation {
236
+ condition = can(regex("^[a-z0-9][a-z0-9-]{0,15}$", var.agentcore_turn_assertion_active_key_version))
237
+ error_message = "agentcore_turn_assertion_active_key_version must be a lowercase version label."
238
+ }
239
+ }
240
+
241
+ variable "agentcore_proof_oauth_client_id" {
242
+ description = "Synthetic OAuth client id used only by the THINK-316 proof provider."
243
+ type = string
244
+ default = ""
245
+ }
246
+
247
+ variable "agentcore_proof_oauth_client_secret" {
248
+ description = "Synthetic OAuth client secret used only by the THINK-316 proof provider and boundary target."
249
+ type = string
250
+ sensitive = true
251
+ default = ""
252
+ }
253
+
254
+ variable "agentcore_proof_owner_allowlist" {
255
+ description = "Comma-separated synthetic subjects used by the THINK-316 manual authorization-code and mixed-disclosure fixtures. Signed OBO turn participants do not require registration here."
151
256
  type = string
152
257
  default = ""
153
258
  }
@@ -244,18 +349,6 @@ variable "brain_dream_state_schedule_expression" {
244
349
  default = "cron(0 5 * * ? *)"
245
350
  }
246
351
 
247
- variable "retry_dispatcher_enabled" {
248
- 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."
249
- type = bool
250
- default = false
251
- }
252
-
253
- variable "stall_threshold_minutes" {
254
- 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)."
255
- type = number
256
- default = 5
257
- }
258
-
259
352
  variable "extension_proxy_signing_secret" {
260
353
  description = "Shared HMAC secret used by the generic Admin extension proxy to sign actor context for extension backends."
261
354
  type = string
@@ -263,78 +356,44 @@ variable "extension_proxy_signing_secret" {
263
356
  default = ""
264
357
  }
265
358
 
266
- variable "hindsight_endpoint" {
267
- description = "Hindsight API endpoint (empty when enable_hindsight = false)"
268
- type = string
269
- default = ""
270
- }
271
-
272
- variable "hindsight_database_name" {
273
- description = "Dedicated Hindsight database name (THINK-220 cutover flag). Empty = Hindsight tables live in the `hindsight` schema of the primary database; set = the api reads them from this database's `public` schema. Rides the SSM runtime-config document (getConfig), not Lambda env."
274
- type = string
275
- default = ""
276
- }
277
-
278
359
  variable "agentcore_memory_id" {
279
360
  description = "Bedrock AgentCore Memory resource ID — used by the GraphQL memory resolvers to list records across tenant agents."
280
361
  type = string
281
362
  default = ""
282
363
  }
283
364
 
284
- variable "memory_engine" {
285
- description = "Active long-term memory engine for this deployment. Exactly one engine is canonical for recall/inspect/export."
286
- type = string
287
- default = "hindsight"
288
- validation {
289
- condition = contains(["hindsight", "agentcore"], var.memory_engine)
290
- error_message = "memory_engine must be 'hindsight' or 'agentcore'."
291
- }
292
- }
293
-
294
- variable "analyst_egress_subnet_ids" {
295
- description = "Private (NAT-routed) subnet IDs for VPC-attaching the analyst data-path handlers (graphql-http, analyst-query-broker, analyst-connection-reconciler) so external Postgres sources can allowlist the stack's stable NAT egress IP. Leave empty to keep the handlers outside any VPC."
296
- type = list(string)
297
- default = []
298
- }
299
-
300
- variable "analyst_egress_security_group_ids" {
301
- description = "Security group IDs for the VPC-attached analyst data-path handlers. Leave empty to keep the handlers outside any VPC."
302
- type = list(string)
303
- default = []
304
- }
305
-
306
365
  variable "okf_efs_subnet_ids" {
307
- description = "Subnet IDs for the OKF EFS hydrator Lambda VPC attachment. Leave empty to deploy the hydrator without an EFS mount."
366
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
308
367
  type = list(string)
309
368
  default = []
310
369
  }
311
370
 
312
371
  variable "okf_efs_security_group_ids" {
313
- description = "Security group IDs for the OKF EFS hydrator Lambda VPC attachment. Leave empty to deploy the hydrator without an EFS mount."
372
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
314
373
  type = list(string)
315
374
  default = []
316
375
  }
317
376
 
318
377
  variable "okf_efs_mount_target_ids" {
319
- description = "EFS mount target IDs that must exist before creating the OKF EFS hydrator Lambda."
378
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
320
379
  type = list(string)
321
380
  default = []
322
381
  }
323
382
 
324
383
  variable "okf_efs_file_system_arn" {
325
- description = "EFS file system ARN for the OKF wiki current view. Empty disables EFS IAM grants."
384
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
326
385
  type = string
327
386
  default = ""
328
387
  }
329
388
 
330
389
  variable "okf_efs_refresh_access_point_arn" {
331
- description = "EFS access point ARN mounted by the okf-efs-refresh Lambda. Empty disables the mount."
390
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
332
391
  type = string
333
392
  default = ""
334
393
  }
335
394
 
336
395
  variable "okf_efs_mount_path" {
337
- description = "Local Lambda mount path for the OKF wiki EFS view. Must be under /mnt."
396
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
338
397
  type = string
339
398
  default = "/mnt/thinkwork-okf"
340
399
  }
@@ -429,12 +488,6 @@ variable "admin_url" {
429
488
  default = ""
430
489
  }
431
490
 
432
- variable "docs_url" {
433
- description = "Docs site URL (e.g. https://d2grg1uavrp7lx.cloudfront.net)"
434
- type = string
435
- default = ""
436
- }
437
-
438
491
  variable "www_url" {
439
492
  description = "Marketing site URL (e.g. https://thinkwork.ai). Used for Stripe Checkout cancel_url and CORS origin."
440
493
  type = string
@@ -507,24 +560,12 @@ variable "job_scheduler_role_arn" {
507
560
  default = ""
508
561
  }
509
562
 
510
- variable "wiki_compile_model_id" {
511
- description = "Bedrock model id the wiki-compile Lambda uses for the leaf planner, aggregation planner, and section writer. Any Converse-compatible model works. Override per-env if you want to spike a different model without re-deploying code."
512
- type = string
513
- default = "openai.gpt-oss-120b-1:0"
514
- }
515
-
516
563
  variable "brain_source_agent_model_id" {
517
564
  description = "Bedrock model id the GraphQL context-engine Brain source-agent runtime uses for JSON tool/action turns. Kept separate from the high-throughput wiki compiler model so source agents can use a model tuned for reliable action JSON."
518
565
  type = string
519
566
  default = "us.anthropic.claude-haiku-4-5-20251001-v1:0"
520
567
  }
521
568
 
522
- variable "kg_obs_max_candidates_per_run" {
523
- description = "Per-run candidate cap for the observations → Knowledge Graph ingest worker (KG_OBS_MAX_CANDIDATES_PER_RUN). Bounds the layered-gate classifier cost and lets truncated runs self-invoke to drain the remaining backlog. Stored as a string because the Lambda reads it verbatim from env."
524
- type = string
525
- default = "10"
526
- }
527
-
528
569
  variable "wiki_aggregation_pass_enabled" {
529
570
  description = "Feature flag for the wiki aggregation pass (parent section rollups + section promotion). Pipeline stops after leaf compile when this is off and never populates hub rollups. Stored as a string because the Lambda reads it verbatim from env; must be 'true' / '1' / 'yes' to enable."
530
571
  type = string
@@ -537,20 +578,14 @@ variable "wiki_deterministic_linking_enabled" {
537
578
  default = "true"
538
579
  }
539
580
 
540
- variable "kg_extraction_model_id" {
541
- description = "Bedrock model id for knowledge-graph entity/relationship extraction from observations (plan 2026-07-03-005). Defaults to a gpt-oss high-quota model; overridable per stage."
542
- type = string
543
- default = "openai.gpt-oss-120b-1:0"
544
- }
545
-
546
- variable "knowledge_graph_observations_ingest_enabled" {
547
- description = "Enable the recurring Brain distillation schedule (Hindsight observations -> knowledge graph). Ships disabled; dev flips on after a golden-set-validated manual run (plan 2026-07-03-005 U4)."
581
+ variable "identity_drift_match_enabled" {
582
+ 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."
548
583
  type = bool
549
584
  default = false
550
585
  }
551
586
 
552
587
  variable "wiki_source" {
553
- description = "Wiki pipeline source dispatch (plan 2026-06-09-004 U10). 'planner' (default) runs the original LLM compile path; 'graph' runs the deterministic graph→wiki materializer over the knowledge-graph mirror and makes successful observation-ingest runs the compile trigger. Variable-ized (not hardcoded) per the wiki-compile env precedent so unrelated deploys don't reset the flag; the Lambda reads it verbatim from env and treats any value other than 'graph' as 'planner'."
588
+ description = "Wiki pipeline source dispatch (plan 2026-06-09-004 U10). 'planner' (default) runs the original LLM compile path; 'graph' runs the deterministic graph→wiki materializer. Variable-ized (not hardcoded) per the wiki-compile env precedent so unrelated deploys don't reset the flag; the Lambda reads it verbatim from env and treats any value other than 'graph' as 'planner'."
554
589
  type = string
555
590
  default = "planner"
556
591
 
@@ -560,12 +595,6 @@ variable "wiki_source" {
560
595
  }
561
596
  }
562
597
 
563
- variable "google_places_api_key" {
564
- description = "Google Places API (New) key used by wiki-compile for POI → city/state/country hierarchy enrichment. Stored as a SecureString SSM parameter at /thinkwork/<stage>/google-places/api-key. Empty default creates the parameter with a placeholder value; operator populates via `aws ssm put-parameter --overwrite`. The parameter's value has lifecycle.ignore_changes set so CLI rotation sticks across terraform applies. Compile gracefully degrades when the key is absent (metadata-only place rows) — never fails compile."
565
- type = string
566
- default = ""
567
- sensitive = true
568
- }
569
598
 
570
599
  # ---------------------------------------------------------------------------
571
600
  # Per-user OAuth client credentials
@@ -776,8 +805,19 @@ variable "compliance_exports_runner_role_name" {
776
805
  default = ""
777
806
  }
778
807
 
779
- variable "knowledge_graph_tool_enabled" {
780
- description = "Stage gate for the Pi knowledge_graph_search tool (plan 2026-06-09-004 U8). Per-agent tool policy gates on top."
808
+ variable "agentcore_session_scope" {
809
+ description = "THINK-909/THINK-946 AgentCore runtime session scope for agentcore-runtime-dispatch. \"thread\" (default) keys the session per thread; \"user\" keys it per (tenant, agent, user) so a new thread reuses the user's warm microVM — and, per THINK-946, its retained MCP connections and toolset — falling back to the per-thread session on a 409. Set \"user\" only after the stage's Pi runtime image dual-accepts both session ids. mcpherson runs \"user\"; every other stage keeps the default."
810
+ type = string
811
+ default = "thread"
812
+
813
+ validation {
814
+ condition = contains(["thread", "user"], var.agentcore_session_scope)
815
+ error_message = "agentcore_session_scope must be \"thread\" or \"user\"."
816
+ }
817
+ }
818
+
819
+ variable "identity_resolution_tool_enabled" {
820
+ description = "Stage gate for the Pi identity-resolution tools (resolve_entities / propose_mapping_candidates / confirm_mapping, THINK-321 U5). Per-agent tool policy gates on top."
781
821
  type = bool
782
822
  default = true
783
823
  }
@@ -800,40 +840,20 @@ variable "capability_signing_private_key_secret" {
800
840
  default = ""
801
841
  }
802
842
 
803
- # ---------------------------------------------------------------------------
804
- # THINK-228 U3 analyst query broker runtime config
805
- # ---------------------------------------------------------------------------
806
-
807
- variable "analyst_reader_secret_arn" {
808
- description = "ARN of the Secrets Manager secret holding the `analyst_reader` Aurora role credentials (THINK-228 U2). Wired from `module.database.analyst_reader_secret_arn`. The analyst-query-broker Lambda executes model-authored SQL exclusively under this role."
809
- type = string
810
- default = ""
811
- }
812
-
813
- variable "analyst_broker_secret_arn" {
814
- description = "ARN of the Secrets Manager secret holding the analyst query-broker caller credential (JSON {token, tenantId}; THINK-228 U3). Wired from `module.database.analyst_broker_secret_arn`. The broker validates incoming Bearer tokens against it; the seeded connector row references it as auth_config.secretRef."
843
+ variable "subscription_ticket_signing_key_id" {
844
+ description = "Active Ed25519 subscription-ticket signing key ID."
815
845
  type = string
816
846
  default = ""
817
847
  }
818
848
 
819
- variable "analyst_policy_source" {
820
- description = "THINK-229 KTD5 enforcement flip: 'row' (default sidecar policy is shadow-only) or 'sidecar' (the signed sidecar policy block is authoritative: budgets + retain_sql flow into dispatch and the broker). Flip only after clean analyst-policy-shadow parity on live traffic AND a provision refresh so every connection sidecar carries a policy block."
821
- type = string
822
- default = "row"
823
- validation {
824
- condition = contains(["row", "sidecar"], var.analyst_policy_source)
825
- error_message = "analyst_policy_source must be 'row' or 'sidecar'."
826
- }
827
- }
828
-
829
- variable "capability_self_extension_tenants" {
830
- 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. Read via getConfig() in capability-control-service."
849
+ variable "subscription_ticket_public_keys" {
850
+ description = "JSON verifier keyring for AppSync subscription tickets; contains public material only."
831
851
  type = string
832
- default = ""
852
+ default = "[]"
833
853
  }
834
854
 
835
- variable "analyst_db_cluster_resource_id" {
836
- description = "Immutable RDS cluster resource ID (cluster-XXXX / db-XXXX) for the stage database (THINK-229 U1). Wired from `module.database.cluster_resource_id`. Keys the broker's `rds-db:connect` IAM grant — the rds-db ARN format requires the resource ID, not the cluster ARN — and gates the IAM connect env on the broker Lambda: when empty, the broker stays on the password path."
855
+ variable "subscription_ticket_private_key_secret" {
856
+ description = "Secrets Manager name holding the isolated subscription-ticket Ed25519 private key."
837
857
  type = string
838
858
  default = ""
839
859
  }
@@ -893,3 +913,169 @@ variable "capability_broker_vpce_dns" {
893
913
  type = string
894
914
  default = ""
895
915
  }
916
+
917
+ # ---------------------------------------------------------------------------
918
+ # Company Brain twin (plan 2026-07-21-001 U5): Neptune wiring for the
919
+ # identity-graph-projector. All default-empty — the projector deploys inert
920
+ # (no VPC, no endpoint) until the stage's neptune outputs are supplied.
921
+ # ---------------------------------------------------------------------------
922
+
923
+ variable "neptune_endpoint" {
924
+ type = string
925
+ default = ""
926
+ description = "Neptune twin cluster writer endpoint (from the etl-platform neptune stack; empty = twin disabled)"
927
+ }
928
+
929
+ variable "brain_mcp_url" {
930
+ type = string
931
+ default = ""
932
+ description = "Platform-served Brain MCP endpoint (e.g. https://mcp.brain.thinkwork.ai/mcp). When set, twin-connector provisioning registers agents against it instead of the product /mcp/twin route (consolidation U14). Empty = legacy product-served default."
933
+ }
934
+
935
+ variable "neptune_cluster_resource_id" {
936
+ type = string
937
+ default = ""
938
+ description = "Neptune cluster resource id for neptune-db IAM ARNs (empty = no data-access grant)"
939
+ }
940
+
941
+ variable "neptune_subnet_ids" {
942
+ type = list(string)
943
+ default = []
944
+ description = "Private subnets for the identity-graph-projector's vpc_config (Neptune is VPC-only)"
945
+ }
946
+
947
+ variable "neptune_security_group_ids" {
948
+ type = list(string)
949
+ default = []
950
+ description = "SGs for the projector (the etl neptune stack's neptune-client SG)"
951
+ }
952
+
953
+ # ---------------------------------------------------------------------------
954
+ # THINK-1082: every handler inside the VPC. Each handler carries DATABASE_URL
955
+ # (common_env) and, with no vpc_config, reaches Aurora only over the cluster's
956
+ # PUBLIC endpoint through the world-open 0.0.0.0/0 -> 5432 rule the
957
+ # aurora-postgres module seeds. Revoking that rule took the whole app down
958
+ # (auth-me -> DB timeout -> 401 "No tenant assigned"). With lambdas_in_vpc the
959
+ # functions attach to the VPC's private subnets behind a security group the
960
+ # database security group admits, so the public rule can be closed. All
961
+ # default-off — the module deploys byte-identical until the caller opts in.
962
+ # ---------------------------------------------------------------------------
963
+
964
+ variable "lambdas_in_vpc" {
965
+ type = bool
966
+ default = false
967
+ description = "Attach every DB-connected Lambda in this module (all api handlers, compliance-anchor, compliance-export-runner) to the VPC via vpc_subnet_ids + vpc_security_group_ids so Aurora is reached by security group instead of the public endpoint. The subnets must be NAT-routed (handlers call AWS APIs, Bedrock, Slack, GitHub, ...). Requires non-empty vpc_subnet_ids and vpc_security_group_ids."
968
+ }
969
+
970
+ variable "vpc_subnet_ids" {
971
+ type = list(string)
972
+ default = []
973
+ description = "Private (NAT-routed) subnet IDs the handlers attach to when lambdas_in_vpc is true."
974
+ }
975
+
976
+ variable "vpc_security_group_ids" {
977
+ type = list(string)
978
+ default = []
979
+ description = "Security groups for the handlers when lambdas_in_vpc is true (the thinkwork module passes its api-lambda SG, which the database SG admits on tcp/5432). Merged with neptune_security_group_ids on the identity-graph-projector."
980
+ }
981
+
982
+ # Bulk-rebuild lane (THINK-331 U4): Neptune bulk-loader staging. Both
983
+ # default-empty — bulk-rebuild returns a structured "not configured" error
984
+ # until the etl-platform neptune stack's load bucket + loader role are
985
+ # supplied.
986
+
987
+ variable "neptune_load_bucket" {
988
+ type = string
989
+ default = ""
990
+ description = "Neptune bulk-load staging bucket name (etl-platform neptune stack; empty = bulk-rebuild disabled)"
991
+ }
992
+
993
+ variable "neptune_loader_role_arn" {
994
+ type = string
995
+ default = ""
996
+ description = "IAM role ARN the Neptune cluster assumes to read the load bucket (etl-platform neptune stack; empty = bulk-rebuild disabled)"
997
+ }
998
+
999
+ variable "lambda_max_memory_mb" {
1000
+ type = number
1001
+ default = 10240
1002
+ description = "Account-level Lambda memory ceiling. Legacy AWS accounts cap function memory at 3008 MB (raised only via support case); handlers that request more are clamped to this value so deploys on capped accounts don't fail mid-apply."
1003
+ }
1004
+
1005
+ # THINK-583 U3 — provisioned concurrency for the two chat-critical zip
1006
+ # Lambdas (chat-agent-invoke, workspace-renderer) ONLY (KTD5: never the Pi
1007
+ # Lambda). 0 (the default) disables the provisioned-concurrency config but
1008
+ # STILL creates the published version + `live` alias, so alias-qualified
1009
+ # invokers keep working on every stage; customer stages opt in on their own
1010
+ # release cadence. Dev is enabled via scripts/deploy/terraform-vars.sh
1011
+ # (deploy.yml is dev-only — same pattern as enable_capability_broker).
1012
+
1013
+ variable "chat_agent_invoke_provisioned_concurrency" {
1014
+ type = number
1015
+ default = 0
1016
+ description = "Provisioned concurrency on chat-agent-invoke's `live` alias. 0 = disabled (alias still exists)."
1017
+ }
1018
+
1019
+ variable "workspace_renderer_provisioned_concurrency" {
1020
+ type = number
1021
+ default = 0
1022
+ description = "Provisioned concurrency on workspace-renderer's `live` alias. 0 = disabled (alias still exists)."
1023
+ }
1024
+
1025
+ variable "agentcore_runtime_dispatch_enabled" {
1026
+ description = "THINK-585 U6 (KTD3): stage kill-switch for chat dispatch through the Bedrock AgentCore Runtime (per-thread sessions). The per-agent agents.agentcore_runtime_dispatch flag gates on top. Default off; dev opts in via the deploy workflow, customer stages via runner-secrets on their own cadence."
1027
+ type = bool
1028
+ default = false
1029
+ }
1030
+
1031
+ variable "auth_state_store" {
1032
+ description = "THINK-643: backing store for short-lived auth-flow state (AppSync subscription tickets + the per-principal connect rate-limit counter). \"postgres\" (default) keeps the Aurora `auth_subscription_tickets` path. \"dynamo\" provisions thinkwork-<stage>-auth-state and points the auth handlers at it; the authorizer still falls back to a Postgres read for tickets minted just before the flip."
1033
+ type = string
1034
+ default = "postgres"
1035
+
1036
+ validation {
1037
+ condition = contains(["postgres", "dynamo"], var.auth_state_store)
1038
+ error_message = "auth_state_store must be \"postgres\" or \"dynamo\"."
1039
+ }
1040
+ }
1041
+
1042
+ ################################################################################
1043
+ # THINK-915 — chat turn-latency observability
1044
+ # (see chat-latency-observability.tf for the constraints behind each of these)
1045
+ ################################################################################
1046
+
1047
+ variable "enable_chat_turn_latency_observability" {
1048
+ description = "THINK-915: create the per-stage chat turn-latency dashboard, the saved thinkwork-<stage>-turn-timeline Logs Insights query, and the Lambda-native dispatch p95 alarm. On by default — none of these depend on a log group already existing."
1049
+ type = bool
1050
+ default = true
1051
+ }
1052
+
1053
+ variable "enable_chat_turn_latency_metric_filters" {
1054
+ description = "THINK-915: create the agentcore_phase log metric filters (TurnRuntimeInvokeMs, AgentLoopMs) and the metric-filter-backed p95 alarm. OFF by default: the Lambda log groups are created implicitly on first invocation and are not Terraform-managed, so PutMetricFilter fails with ResourceNotFoundException on a greenfield stage (see memory-alarms.tf). Turn on for a stage that has already served chat traffic."
1055
+ type = bool
1056
+ default = false
1057
+ }
1058
+
1059
+ variable "chat_turn_latency_metric_namespace" {
1060
+ description = "THINK-915: CloudWatch namespace prefix for the chat phase metrics. The stage is appended (Thinkwork/Chat/<stage>) because metric-filter dimensions may only reference JSON fields of the matched log event, and the agentcore_phase record carries no stage field."
1061
+ type = string
1062
+ default = "Thinkwork/Chat"
1063
+ }
1064
+
1065
+ variable "chat_turn_runtime_log_group_name" {
1066
+ description = "THINK-915: explicit AgentCore Pi runtime log group (/aws/bedrock-agentcore/runtimes/thinkwork_<stage>_pi-<runtimeId>-DEFAULT). Empty (default) skips the runtime-sourced metric, widgets, and query leg — plan-time prefix discovery was removed because it defers to apply in customer deployment-runner plans and breaks them."
1067
+ type = string
1068
+ default = ""
1069
+ }
1070
+
1071
+ variable "chat_turn_p95_alarm_threshold_ms" {
1072
+ description = "THINK-915: p95 threshold (ms) for the whole AgentCore runtime call, breaching on 2 of 3 five-minute periods."
1073
+ type = number
1074
+ default = 30000
1075
+ }
1076
+
1077
+ variable "chat_turn_latency_alarm_actions" {
1078
+ description = "THINK-915: SNS topic ARNs notified by the chat turn-latency alarms (also used as OK actions). Empty by default — the only topic in this module is the cost-alert channel, and latency pages do not belong there."
1079
+ type = list(string)
1080
+ default = []
1081
+ }
@@ -89,7 +89,7 @@ packages.
89
89
 
90
90
  ```hcl
91
91
  module "n8n" {
92
- source = "../../../plugins/n8n/terraform/n8n"
92
+ source = "../app/n8n"
93
93
 
94
94
  stage = var.stage
95
95
  vpc_id = module.vpc.vpc_id
@@ -292,24 +292,24 @@ resource "terraform_data" "database_lifecycle" {
292
292
 
293
293
  resource "terraform_data" "configuration_guardrails" {
294
294
  input = {
295
- runtime_enabled = var.runtime_enabled
296
- main_desired_count = var.main_desired_count
297
- worker_desired_count = var.worker_desired_count
298
- image_uri = var.image_uri
299
- public_url = var.public_url
300
- certificate_arn = var.certificate_arn
301
- database_host = var.database_host
302
- database_name = var.database_name
303
- database_username = var.database_username
304
- database_url_secret_arn = local.effective_database_url_secret_arn
305
- encryption_key_secret_arn = local.effective_encryption_key_secret_arn
306
- operator_secret_arn = local.effective_operator_secret_arn
307
- service_credential_secret_arn = local.effective_service_credential_secret_arn
308
- storage_bucket_name = var.storage_bucket_name
309
- storage_prefix = local.storage_prefix
310
- queue_mode = var.queue_mode
311
- cache_engine = var.cache_engine
312
- cache_subnet_ids = local.effective_cache_subnet_ids
295
+ runtime_enabled = var.runtime_enabled
296
+ main_desired_count = var.main_desired_count
297
+ worker_desired_count = var.worker_desired_count
298
+ image_uri = var.image_uri
299
+ public_url = var.public_url
300
+ certificate_arn = var.certificate_arn
301
+ database_host = var.database_host
302
+ database_name = var.database_name
303
+ database_username = var.database_username
304
+ database_url_secret_arn = local.effective_database_url_secret_arn
305
+ encryption_key_secret_arn = local.effective_encryption_key_secret_arn
306
+ operator_secret_arn = local.effective_operator_secret_arn
307
+ service_credential_secret_arn = local.effective_service_credential_secret_arn
308
+ storage_bucket_name = var.storage_bucket_name
309
+ storage_prefix = local.storage_prefix
310
+ queue_mode = var.queue_mode
311
+ cache_engine = var.cache_engine
312
+ cache_subnet_ids = local.effective_cache_subnet_ids
313
313
  }
314
314
 
315
315
  lifecycle {