thinkwork-cli 0.5.4 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,10 +13,22 @@ locals {
13
13
  bucket_name = var.bucket_name != "" ? var.bucket_name : "thinkwork-${var.stage}-storage"
14
14
 
15
15
  # Hindsight is an optional add-on. Preferred toggle: var.enable_hindsight.
16
- # For one release we also honor the deprecated var.memory_engine == "hindsight"
17
- # so existing tfvars keep working. The CLI config command also auto-translates
18
- # between the two. Remove the legacy branch in a future release.
16
+ # For one release we also honor the legacy var.memory_engine == "hindsight"
17
+ # so existing tfvars keep working.
19
18
  hindsight_enabled = var.enable_hindsight || var.memory_engine == "hindsight"
19
+
20
+ # Canonical long-term memory engine for this deployment. Exactly one engine
21
+ # is active per deployment for recall/inspect/export. Auto-selects from
22
+ # enable_hindsight when var.memory_engine is left empty so existing deploys
23
+ # keep working without config changes. Legacy value "managed" maps to
24
+ # "agentcore".
25
+ resolved_memory_engine = (
26
+ var.memory_engine == "hindsight" || var.memory_engine == "agentcore"
27
+ ? var.memory_engine
28
+ : var.memory_engine == "managed"
29
+ ? "agentcore"
30
+ : local.hindsight_enabled ? "hindsight" : "agentcore"
31
+ )
20
32
  }
21
33
 
22
34
  ################################################################################
@@ -66,11 +78,13 @@ module "cognito" {
66
78
 
67
79
  admin_callback_urls = concat(
68
80
  var.admin_callback_urls,
69
- ["https://${module.admin_site.distribution_domain}", "https://${module.admin_site.distribution_domain}/auth/callback"]
81
+ ["https://${module.admin_site.distribution_domain}", "https://${module.admin_site.distribution_domain}/auth/callback"],
82
+ var.admin_domain != "" ? ["https://${var.admin_domain}", "https://${var.admin_domain}/auth/callback"] : []
70
83
  )
71
84
  admin_logout_urls = concat(
72
85
  var.admin_logout_urls,
73
- ["https://${module.admin_site.distribution_domain}"]
86
+ ["https://${module.admin_site.distribution_domain}"],
87
+ var.admin_domain != "" ? ["https://${var.admin_domain}"] : []
74
88
  )
75
89
  mobile_callback_urls = var.mobile_callback_urls
76
90
  mobile_logout_urls = var.mobile_logout_urls
@@ -174,10 +188,13 @@ module "api" {
174
188
  agentcore_function_arn = module.agentcore.agentcore_function_arn
175
189
  hindsight_endpoint = local.hindsight_enabled ? module.hindsight[0].hindsight_endpoint : ""
176
190
  agentcore_memory_id = module.agentcore_memory.memory_id
191
+ memory_engine = local.resolved_memory_engine
177
192
  admin_url = "https://${module.admin_site.distribution_domain}"
178
193
  docs_url = "https://${module.docs_site.distribution_domain}"
179
194
  appsync_realtime_url = module.appsync.graphql_realtime_url
180
195
  ecr_repository_url = module.agentcore.ecr_repository_url
196
+ job_scheduler_role_arn = module.job_triggers.job_scheduler_role_arn
197
+ lastmile_tasks_api_url = var.lastmile_tasks_api_url
181
198
  }
182
199
 
183
200
  ################################################################################
@@ -206,6 +223,7 @@ module "agentcore" {
206
223
 
207
224
  hindsight_endpoint = local.hindsight_enabled ? module.hindsight[0].hindsight_endpoint : ""
208
225
  agentcore_memory_id = module.agentcore_memory.memory_id
226
+ memory_engine = local.resolved_memory_engine
209
227
  }
210
228
 
211
229
  module "crons" {
@@ -239,8 +257,16 @@ module "hindsight" {
239
257
  module "ses" {
240
258
  source = "../app/ses-email"
241
259
 
242
- stage = var.stage
243
- account_id = var.account_id
260
+ stage = var.stage
261
+ account_id = var.account_id
262
+ region = var.region
263
+ email_domain = var.ses_inbound_domain
264
+
265
+ inbound_bucket_name = module.s3.bucket_name
266
+ email_inbound_fn_arn = module.api.email_inbound_fn_arn
267
+ email_inbound_fn_name = module.api.email_inbound_fn_name
268
+
269
+ manage_active_rule_set = var.ses_manage_active_rule_set
244
270
  }
245
271
 
246
272
  ################################################################################
@@ -250,8 +276,11 @@ module "ses" {
250
276
  module "admin_site" {
251
277
  source = "../app/static-site"
252
278
 
253
- stage = var.stage
254
- site_name = "admin"
279
+ stage = var.stage
280
+ site_name = "admin"
281
+ is_spa = true
282
+ custom_domain = var.admin_domain
283
+ certificate_arn = var.admin_certificate_arn
255
284
  }
256
285
 
257
286
  ################################################################################
@@ -266,3 +295,17 @@ module "docs_site" {
266
295
  custom_domain = var.docs_domain
267
296
  certificate_arn = var.docs_certificate_arn
268
297
  }
298
+
299
+ ################################################################################
300
+ # Public Website (www)
301
+ ################################################################################
302
+
303
+ module "www_site" {
304
+ source = "../app/static-site"
305
+
306
+ stage = var.stage
307
+ site_name = "www"
308
+ custom_domain = var.www_domain
309
+ certificate_arn = var.www_certificate_arn
310
+ # is_spa defaults to false — SSG output, directory URIs get rewritten to index.html
311
+ }
@@ -127,3 +127,35 @@ output "docs_bucket_name" {
127
127
  description = "S3 bucket for docs site assets"
128
128
  value = module.docs_site.bucket_name
129
129
  }
130
+
131
+ # Public website (www)
132
+ output "www_distribution_id" {
133
+ description = "CloudFront distribution ID for the public website"
134
+ value = module.www_site.distribution_id
135
+ }
136
+
137
+ output "www_distribution_domain" {
138
+ description = "CloudFront domain for the public website"
139
+ value = module.www_site.distribution_domain
140
+ }
141
+
142
+ output "www_bucket_name" {
143
+ description = "S3 bucket for the public website assets"
144
+ value = module.www_site.bucket_name
145
+ }
146
+
147
+ # SES inbound email
148
+ output "ses_inbound_zone_id" {
149
+ description = "Route53 hosted zone ID for the email subdomain (null when ses_inbound_domain is not set)"
150
+ value = module.ses.zone_id
151
+ }
152
+
153
+ output "ses_inbound_name_servers" {
154
+ description = "Name servers for the delegated email subzone. Paste these as NS records at the registrar that hosts the parent domain (e.g. Google Domains) before SES can verify."
155
+ value = module.ses.name_servers
156
+ }
157
+
158
+ output "ses_inbound_mx_target" {
159
+ description = "MX target host for the email subdomain. Terraform already writes this into the subzone — this output is informational."
160
+ value = module.ses.mx_target
161
+ }
@@ -145,13 +145,13 @@ variable "enable_hindsight" {
145
145
  }
146
146
 
147
147
  variable "memory_engine" {
148
- description = "DEPRECATED. Use `enable_hindsight` instead. For backwards compatibility, setting this to 'hindsight' is equivalent to `enable_hindsight = true`. AgentCore managed memory is always on and cannot be disabled."
148
+ description = "Active long-term memory engine for canonical recall/inspect/export. Exactly one engine is authoritative per deployment. Accepted values: 'hindsight' (requires enable_hindsight = true), 'agentcore' (uses the always-on AgentCore managed memory). Legacy value 'managed' maps to 'agentcore'. Empty = auto-select: 'hindsight' when enable_hindsight = true, otherwise 'agentcore'."
149
149
  type = string
150
150
  default = ""
151
151
 
152
152
  validation {
153
- condition = var.memory_engine == "" || contains(["managed", "hindsight"], var.memory_engine)
154
- error_message = "memory_engine (deprecated) must be empty, 'managed', or 'hindsight'. Prefer enable_hindsight instead."
153
+ condition = var.memory_engine == "" || contains(["managed", "hindsight", "agentcore"], var.memory_engine)
154
+ error_message = "memory_engine must be empty, 'hindsight', 'agentcore', or legacy 'managed'."
155
155
  }
156
156
  }
157
157
 
@@ -261,3 +261,57 @@ variable "docs_certificate_arn" {
261
261
  type = string
262
262
  default = ""
263
263
  }
264
+
265
+ # ---------------------------------------------------------------------------
266
+ # Public website (custom domain — optional)
267
+ # ---------------------------------------------------------------------------
268
+
269
+ variable "www_domain" {
270
+ description = "Custom domain for the public website (e.g. thinkwork.ai). Leave empty for CloudFront default."
271
+ type = string
272
+ default = ""
273
+ }
274
+
275
+ variable "www_certificate_arn" {
276
+ description = "ACM certificate ARN for the www domain (us-east-1, required for CloudFront custom domains). Covers both the apex and www subdomain."
277
+ type = string
278
+ default = ""
279
+ }
280
+
281
+ # ---------------------------------------------------------------------------
282
+ # Admin site (custom domain — optional)
283
+ # ---------------------------------------------------------------------------
284
+
285
+ variable "admin_domain" {
286
+ description = "Custom domain for the admin SPA (e.g. admin.thinkwork.ai). Leave empty for CloudFront default."
287
+ type = string
288
+ default = ""
289
+ }
290
+
291
+ variable "admin_certificate_arn" {
292
+ description = "ACM certificate ARN for the admin domain (us-east-1, required for CloudFront custom domains)."
293
+ type = string
294
+ default = ""
295
+ }
296
+
297
+ # ---------------------------------------------------------------------------
298
+ # SES inbound email (delegated subzone — Option A)
299
+ # ---------------------------------------------------------------------------
300
+
301
+ variable "ses_inbound_domain" {
302
+ description = "Subdomain used for agent email (e.g. agents.thinkwork.ai). Terraform creates a delegated Route53 hosted zone for this name, manages the SES domain identity + DKIM CNAMEs + MX in that zone, and wires an SES receipt rule that stores inbound mail in S3 and invokes the email-inbound Lambda. Leave empty to skip all SES inbound resources. After first apply, paste the `ses_inbound_name_servers` output as NS records at whatever hosts the parent domain."
303
+ type = string
304
+ default = ""
305
+ }
306
+
307
+ variable "ses_manage_active_rule_set" {
308
+ description = "Activate the SES receipt rule set. Only ONE rule set can be active per region per AWS account; set false on secondary stages that share an account so they don't fight over activation."
309
+ type = bool
310
+ default = true
311
+ }
312
+
313
+ variable "lastmile_tasks_api_url" {
314
+ description = "Base URL of the LastMile Tasks REST API (e.g. https://api-dev.lastmile-tei.com for develop). Feature-flags the outbound task sync — leave blank to keep mobile-created tasks in sync_status='local'."
315
+ type = string
316
+ default = ""
317
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkwork-cli",
3
- "version": "0.5.4",
3
+ "version": "0.6.1",
4
4
  "description": "Thinkwork CLI — deploy, manage, and interact with your Thinkwork stack",
5
5
  "license": "MIT",
6
6
  "type": "module",