thinkwork-cli 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-client-JUBCQQDF.js → api-client-4DZ266J5.js} +1 -1
- package/dist/{chunk-STY44FQO.js → chunk-Y2WHJECR.js} +44 -12
- package/dist/cli.js +36715 -12965
- package/dist/drizzle/0227_analyst_reader_role.sql +100 -38
- package/dist/drizzle/0230_analyst_rls.sql +183 -66
- package/dist/drizzle/0232_memory_source_thin_ledger.sql +176 -0
- package/dist/drizzle/0232_message_source_event_id.sql +9 -0
- package/dist/drizzle/0233_msteams_install_and_links.sql +151 -0
- package/dist/drizzle/0233_workflow_memory_stage_tokens.sql +20 -0
- package/dist/drizzle/0234_memory_claim_lifecycle.sql +160 -0
- package/dist/drizzle/0235_workflow_token_execution_claim.sql +34 -0
- package/dist/drizzle/0236_memory_retraction_fencing.sql +50 -0
- package/dist/drizzle/0237_memory_claims_active_value_uidx.sql +172 -0
- package/dist/drizzle/0238_memory_erase_generation_fence.sql +97 -0
- package/dist/drizzle/0239_canonical_entity_identity.sql +257 -0
- package/dist/drizzle/0240_memory_personal_scope.sql +45 -0
- package/dist/drizzle/0241_knowledge_base_document_manifest.sql +67 -0
- package/dist/drizzle/0242_search_queries.sql +28 -0
- package/dist/drizzle/0243_section_sources_thread_refs.sql +12 -0
- package/dist/drizzle/0244_system_automations_and_memory_stage_overrides.sql +45 -0
- package/dist/drizzle/0245_wiki_page_render.sql +21 -0
- package/dist/drizzle/0246_automation_workflow_ownership.sql +30 -0
- package/dist/drizzle/0247_capability_runtime.sql +402 -0
- package/dist/drizzle/0248_capability_private_interpreter.sql +13 -0
- package/dist/drizzle/0249_capability_headless_execution_evidence.sql +40 -0
- package/dist/drizzle/0250_kg_schema_extraction.sql +549 -0
- package/dist/drizzle/0251_agents_json_render_ui.sql +25 -0
- package/dist/drizzle/0251_brain_stragglers.sql +242 -0
- package/dist/drizzle/0252_drop_kg_and_straggler_compat_views.sql +100 -0
- package/dist/drizzle/0253_drop_brain_substrate.sql +91 -0
- package/dist/drizzle/0254_capability_autonomous_admission.sql +29 -0
- package/dist/drizzle/0255_capability_autonomous_approval_mode.sql +16 -0
- package/dist/drizzle/0256_agent_profile_manifest_authority.sql +18 -0
- package/dist/drizzle/0257_capability_approvals.sql +53 -0
- package/dist/drizzle/0258_pending_tool_approvals.sql +84 -0
- package/dist/drizzle/0259_tenant_capability_registry_trust.sql +19 -0
- package/dist/drizzle/0260_scheduled_jobs_run_as_user.sql +20 -0
- package/dist/drizzle/0261_thread_turns_origin_turn_index.sql +11 -0
- package/dist/terraform/examples/greenfield/main.tf +40 -0
- package/dist/terraform/modules/app/agentcore-admin/main.tf +341 -0
- package/dist/terraform/modules/app/agentcore-admin/outputs.tf +20 -0
- package/dist/terraform/modules/app/agentcore-code-interpreter/main.tf +61 -0
- package/dist/terraform/modules/app/agentcore-harness/main.tf +101 -0
- package/dist/terraform/modules/app/agentcore-harness/outputs.tf +9 -0
- package/dist/terraform/modules/app/agentcore-harness/variables.tf +25 -0
- package/dist/terraform/modules/app/agentcore-pi/main.tf +7 -0
- package/dist/terraform/modules/app/capability-broker/main.tf +393 -0
- package/dist/terraform/modules/app/capability-broker/outputs.tf +54 -0
- package/dist/terraform/modules/app/capability-broker/variables.tf +98 -0
- package/dist/terraform/modules/app/deployment-control-plane/runner.py +46 -5
- package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +94 -0
- package/dist/terraform/modules/app/lambda-api/capability-search-alarms.tf +60 -0
- package/dist/terraform/modules/app/lambda-api/handlers.tf +361 -16
- package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +131 -5
- package/dist/terraform/modules/app/lambda-api/main.tf +11 -0
- package/dist/terraform/modules/app/lambda-api/memory-alarms.tf +92 -0
- package/dist/terraform/modules/app/lambda-api/msteams-app-secrets.tf +46 -0
- package/dist/terraform/modules/app/lambda-api/variables.tf +92 -0
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/alarms.tf +47 -0
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/main.tf +43 -2
- package/dist/terraform/modules/foundation/cognito/main.tf +32 -8
- package/dist/terraform/modules/foundation/cognito/variables.tf +12 -0
- package/dist/terraform/modules/foundation/vpc/outputs.tf +5 -0
- package/dist/terraform/modules/thinkwork/main.tf +152 -5
- package/dist/terraform/modules/thinkwork/outputs.tf +55 -0
- package/dist/terraform/modules/thinkwork/variables.tf +42 -0
- package/dist/workspace-defaults/files/TOOLS.md +39 -0
- package/dist/workspace-defaults/files/agents/analyst/INSTRUCTIONS.md +18 -0
- package/dist/workspace-defaults/files/agents/coding/INSTRUCTIONS.md +11 -0
- package/dist/workspace-defaults/files/agents/research/INSTRUCTIONS.md +12 -0
- package/dist/workspace-defaults/files/agents/reviewer/INSTRUCTIONS.md +15 -0
- package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +6 -2
- package/package.json +4 -2
- /package/dist/workspace-defaults/files/{AGENTS.md → INSTRUCTIONS.md} +0 -0
|
@@ -94,6 +94,68 @@ def write_drizzle_files(source_dir: Path, names: list[str]) -> None:
|
|
|
94
94
|
(migrations / name).write_text(f"-- {name}\n", encoding="utf-8")
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
def test_customer_update_requires_explicit_agentcore_pi_source_image() -> None:
|
|
98
|
+
runner = load_runner()
|
|
99
|
+
|
|
100
|
+
with pytest.raises(RuntimeError, match="agentcorePiSourceImageUri"):
|
|
101
|
+
runner.resolve_agentcore_pi_source_image_uri(
|
|
102
|
+
{
|
|
103
|
+
"action": "update",
|
|
104
|
+
"operation": {"kind": "foundation", "action": "update"},
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_customer_update_rejects_non_customer_agentcore_pi_source_image() -> None:
|
|
110
|
+
runner = load_runner()
|
|
111
|
+
|
|
112
|
+
with pytest.raises(RuntimeError, match="customer-owned ECR"):
|
|
113
|
+
runner.resolve_agentcore_pi_source_image_uri(
|
|
114
|
+
{
|
|
115
|
+
"action": "update",
|
|
116
|
+
"awsAccountId": "637423202447",
|
|
117
|
+
"awsRegion": "us-east-1",
|
|
118
|
+
"agentcorePiSourceImageUri": (
|
|
119
|
+
"ghcr.io/thinkwork-ai/thinkwork-agentcore@sha256:abc"
|
|
120
|
+
),
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def test_customer_update_accepts_customer_ecr_agentcore_pi_source_image() -> None:
|
|
126
|
+
runner = load_runner()
|
|
127
|
+
image = (
|
|
128
|
+
"637423202447.dkr.ecr.us-east-1.amazonaws.com/"
|
|
129
|
+
"thinkwork-tei-e2e-agentcore:pinned@sha256:abc"
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
assert runner.resolve_agentcore_pi_source_image_uri(
|
|
133
|
+
{
|
|
134
|
+
"action": "update",
|
|
135
|
+
"awsAccountId": "637423202447",
|
|
136
|
+
"awsRegion": "us-east-1",
|
|
137
|
+
"agentcorePiSourceImageUri": image,
|
|
138
|
+
}
|
|
139
|
+
) == image
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def test_bootstrap_can_fall_back_to_release_agentcore_pi_image(
|
|
143
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
144
|
+
) -> None:
|
|
145
|
+
runner = load_runner()
|
|
146
|
+
monkeypatch.setattr(
|
|
147
|
+
runner,
|
|
148
|
+
"release_runtime_image",
|
|
149
|
+
lambda name: "ghcr.io/thinkwork-ai/thinkwork-agentcore@sha256:abc"
|
|
150
|
+
if name == "agentcore-pi-amd64"
|
|
151
|
+
else "",
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
assert runner.resolve_agentcore_pi_source_image_uri({"action": "deploy"}) == (
|
|
155
|
+
"ghcr.io/thinkwork-ai/thinkwork-agentcore@sha256:abc"
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
|
|
97
159
|
def test_sync_release_artifacts_stages_artifacts_from_platform_bundle(
|
|
98
160
|
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
99
161
|
) -> None:
|
|
@@ -1122,6 +1184,38 @@ def test_write_runner_files_cognito_email_vars_prefer_runner_secrets_and_default
|
|
|
1122
1184
|
assert vars_json_default["app_certificate_arn"] == ""
|
|
1123
1185
|
|
|
1124
1186
|
|
|
1187
|
+
def test_write_runner_files_wires_analyst_lambda_vpc_egress(
|
|
1188
|
+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
1189
|
+
) -> None:
|
|
1190
|
+
"""analyst_lambda_vpc_egress needs all three wiring points (vars_json,
|
|
1191
|
+
root variable, module argument) and reads runner-secrets first — the
|
|
1192
|
+
durable per-environment home for the flag — with a payload fallback.
|
|
1193
|
+
Secrets Manager JSON strings ("true") must land as real booleans."""
|
|
1194
|
+
runner = load_runner()
|
|
1195
|
+
tf_dir = _cognito_email_runner_env(runner, tmp_path, monkeypatch)
|
|
1196
|
+
base_payload = {
|
|
1197
|
+
"stage": "tei-e2e",
|
|
1198
|
+
"awsRegion": "us-east-1",
|
|
1199
|
+
"awsAccountId": "637423202447",
|
|
1200
|
+
"dbPassword": "db-secret",
|
|
1201
|
+
"apiAuthSecret": "api-secret",
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
assert runner.write_runner_files(base_payload, {})[
|
|
1205
|
+
"analyst_lambda_vpc_egress"
|
|
1206
|
+
] is False
|
|
1207
|
+
assert runner.write_runner_files(
|
|
1208
|
+
base_payload, {"analystLambdaVpcEgress": "true"}
|
|
1209
|
+
)["analyst_lambda_vpc_egress"] is True
|
|
1210
|
+
assert runner.write_runner_files(
|
|
1211
|
+
{**base_payload, "analystLambdaVpcEgress": True}, {}
|
|
1212
|
+
)["analyst_lambda_vpc_egress"] is True
|
|
1213
|
+
|
|
1214
|
+
main_tf = (tf_dir / "main.tf").read_text(encoding="utf-8")
|
|
1215
|
+
assert 'variable "analyst_lambda_vpc_egress"' in main_tf
|
|
1216
|
+
assert "= var.analyst_lambda_vpc_egress" in main_tf
|
|
1217
|
+
|
|
1218
|
+
|
|
1125
1219
|
def test_write_runner_files_threads_customer_domain_vars_from_payload(
|
|
1126
1220
|
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
1127
1221
|
) -> None:
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# THINK-280 U8 — governed capability runtime external-search observability.
|
|
2
|
+
#
|
|
3
|
+
# The external MCP search facade (/mcp/capabilities) and the confidential
|
|
4
|
+
# client_credentials token leg are the LAST rollout stage. These alarms fire
|
|
5
|
+
# from AWS/Lambda Errors metrics that EXIST without any log-group management
|
|
6
|
+
# (handler crashes, including ones that never reach a log line) — the same
|
|
7
|
+
# constraint memory-alarms.tf documents. Log-metric filters over the broker's
|
|
8
|
+
# structured replay/policy/readiness/adapter/provider failure codes require the
|
|
9
|
+
# /aws/lambda/<function> groups (created only after first invocation) and are a
|
|
10
|
+
# coordinated follow-up; until then those failure classes are observable through
|
|
11
|
+
# the structured logs + the capability_broker_calls evidence table.
|
|
12
|
+
#
|
|
13
|
+
# DISABLE PATH: flip `enable_capability_broker = false` (or the tenant/env gate
|
|
14
|
+
# CAPABILITY_EXTERNAL_SEARCH_ENABLED). The handler + route stay deployed but
|
|
15
|
+
# return an empty, no-data projection, so no new external access is granted —
|
|
16
|
+
# while all historical capability_broker_calls / compliance evidence remains
|
|
17
|
+
# queryable. These alarms only exist while the broker is enabled.
|
|
18
|
+
#
|
|
19
|
+
# alarm_actions are intentionally empty (see memory-alarms.tf): operators wire
|
|
20
|
+
# an SNS topic when the rollout needs paging.
|
|
21
|
+
|
|
22
|
+
resource "aws_cloudwatch_metric_alarm" "capability_search_lambda_errors" {
|
|
23
|
+
count = local.deploy_lambda_handlers && var.enable_capability_broker ? 1 : 0
|
|
24
|
+
|
|
25
|
+
alarm_name = "thinkwork-${var.stage}-mcp-capability-search-lambda-errors"
|
|
26
|
+
alarm_description = "mcp-capability-search (external capability search facade) crashed. External hosts see a failed search; no capability data is exposed on error (fail closed). Investigate before continuing the external-search rollout."
|
|
27
|
+
namespace = "AWS/Lambda"
|
|
28
|
+
metric_name = "Errors"
|
|
29
|
+
statistic = "Sum"
|
|
30
|
+
period = 300
|
|
31
|
+
evaluation_periods = 1
|
|
32
|
+
threshold = 1
|
|
33
|
+
comparison_operator = "GreaterThanOrEqualToThreshold"
|
|
34
|
+
treat_missing_data = "notBreaching"
|
|
35
|
+
alarm_actions = []
|
|
36
|
+
|
|
37
|
+
dimensions = {
|
|
38
|
+
FunctionName = aws_lambda_function.handler["mcp-capability-search"].function_name
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
resource "aws_cloudwatch_metric_alarm" "capability_oauth_token_errors" {
|
|
43
|
+
count = local.deploy_lambda_handlers && var.enable_capability_broker ? 1 : 0
|
|
44
|
+
|
|
45
|
+
alarm_name = "thinkwork-${var.stage}-mcp-oauth-lambda-errors"
|
|
46
|
+
alarm_description = "mcp-oauth crashed — includes the confidential client_credentials token leg for external capability clients. Token minting failing hard (never issuing on a bad secret is expected + returns 401, not an Error). Investigate credential/DB reachability."
|
|
47
|
+
namespace = "AWS/Lambda"
|
|
48
|
+
metric_name = "Errors"
|
|
49
|
+
statistic = "Sum"
|
|
50
|
+
period = 300
|
|
51
|
+
evaluation_periods = 1
|
|
52
|
+
threshold = 3
|
|
53
|
+
comparison_operator = "GreaterThanOrEqualToThreshold"
|
|
54
|
+
treat_missing_data = "notBreaching"
|
|
55
|
+
alarm_actions = []
|
|
56
|
+
|
|
57
|
+
dimensions = {
|
|
58
|
+
FunctionName = aws_lambda_function.handler["mcp-oauth"].function_name
|
|
59
|
+
}
|
|
60
|
+
}
|