thinkwork-cli 0.13.2 → 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.
- package/README.md +3 -14
- package/dist/{api-client-JYZXYQJR.js → api-client-4P4JZOBX.js} +1 -1
- package/dist/{chunk-Z2F6RJFR.js → chunk-4OMDWYZQ.js} +4 -5
- package/dist/{chunk-ILZKG5WV.js → chunk-AD2NIWB5.js} +434 -69
- package/dist/chunk-MWQ7RO76.js +137 -0
- package/dist/{chunk-DVPBI5HM.js → chunk-OLUQ4U2Z.js} +26 -26
- package/dist/{chunk-QOERT44A.js → chunk-YQCYD6NE.js} +57 -44
- package/dist/cli.js +4400 -16431
- package/dist/commands/enterprise/templates/deploy-repo/scripts/apply-release.mjs +0 -1
- package/dist/commands/enterprise/templates/deploy-repo/scripts/smoke.mjs +0 -1
- package/dist/commands/enterprise/templates/deploy-repo/terraform/main.tf +0 -14
- package/dist/{dist-es-CRV46D5B.js → dist-es-2OTNTL4N.js} +4 -4
- package/dist/{dist-es-ENBUC3JP.js → dist-es-2XVAH4BQ.js} +2 -2
- package/dist/{dist-es-DCY4IC3Y.js → dist-es-3DPDUJAH.js} +2 -2
- package/dist/{dist-es-G7PTG75M.js → dist-es-BNZTBBVC.js} +1 -1
- package/dist/{dist-es-GKDBE7E6.js → dist-es-CD2RBDAC.js} +1 -1
- package/dist/{dist-es-R7FGL2IB.js → dist-es-I4FW57PS.js} +1 -1
- package/dist/{dist-es-USORBXZ5.js → dist-es-KVFWJNDY.js} +4 -4
- package/dist/{dist-es-HY3535OI.js → dist-es-PS73DWNL.js} +2 -2
- package/dist/{dist-es-LDE437AM.js → dist-es-S3NZQFGT.js} +1 -1
- package/dist/{dist-es-G54LBMRN.js → dist-es-SGCA4P32.js} +1 -1
- package/dist/{dist-es-Q57SZXZ7.js → dist-es-WBM6J4RA.js} +2 -2
- package/dist/{dist-es-P26FWFLT.js → dist-es-ZGVADYIF.js} +8 -8
- package/dist/drizzle/0227_analyst_reader_role.sql +17 -26
- package/dist/drizzle/0230_analyst_rls.sql +28 -45
- package/dist/drizzle/0261_native_auth_control_plane.sql +7 -3
- package/dist/drizzle/0270_tool_execution_ledger.sql +115 -0
- package/dist/drizzle/0271_ontology_twin_declarations.sql +47 -0
- package/dist/drizzle/0272_identity_graph_projection_cursor.sql +23 -0
- package/dist/drizzle/0273_twin_materialization_suggestions.sql +29 -0
- package/dist/drizzle/0274_tenant_mcp_twin_keys.sql +59 -0
- package/dist/drizzle/0275_identity_bulk_rebuild_fence.sql +30 -0
- package/dist/drizzle/0276_tool_execution_ledger_allow_cascade_delete.sql +18 -0
- package/dist/drizzle/0277_knowledge_base_sources.sql +107 -0
- package/dist/drizzle/0278_kb_page_transcription.sql +55 -0
- package/dist/drizzle/0279_mcp_servers_off_plugin_provenance.sql +93 -0
- package/dist/drizzle/0280_work_item_external_refs_drop_plane_provider.sql +46 -0
- package/dist/drizzle/0281_tenant_mcp_twin_keys_expiry_suffix.sql +9 -0
- package/dist/drizzle/0282_tenant_mcp_twin_keys_grants.sql +24 -0
- package/dist/drizzle/0283_agents_agentcore_runtime_dispatch.sql +13 -0
- package/dist/drizzle/0284_user_brain_claims.sql +69 -0
- package/dist/drizzle/0285_tenant_mcp_twin_keys_trusted_subsystem.sql +30 -0
- package/dist/drizzle/0286_brain_analytics_key.sql +26 -0
- package/dist/drizzle/0287_brain_subject.sql +25 -0
- package/dist/drizzle/0288_multi_lane_identities.sql +25 -0
- package/dist/{loadSso-DJVB7BXE.js → loadSso-ETCXTR4I.js} +2 -2
- package/dist/{loadSso-JAMNA3WY.js → loadSso-UBD7KUHE.js} +2 -2
- package/dist/plugins/README.md +2 -2
- package/dist/plugins/catalog/package.json +0 -3
- package/dist/plugins/catalog/src/__tests__/build-catalog.test.ts +6 -3
- package/dist/plugins/catalog/src/__tests__/catalog.test.ts +21 -21
- package/dist/plugins/catalog/src/__tests__/contracts.test.ts +102 -25
- package/dist/plugins/catalog/src/__tests__/plugin-package.test.ts +7 -6
- package/dist/plugins/catalog/src/__tests__/plugin-registry.test.ts +0 -15
- package/dist/plugins/catalog/src/contracts.ts +15 -0
- package/dist/plugins/catalog/src/registry/generated-first-party.ts +0 -18
- package/dist/plugins/n8n/test/integrated-app-contract.test.ts +1 -1
- package/dist/plugins/twenty/package.json +2 -1
- package/dist/plugins/twenty/scripts/LAMBDA_DEPLOY.md +114 -0
- package/dist/plugins/twenty/scripts/build-lambda.sh +29 -0
- package/dist/plugins/twenty/scripts/configure-product-views.ts +195 -0
- package/dist/plugins/twenty/scripts/lambda-handler.ts +49 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/load-attachments.test.ts +38 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/load-records.test.ts +145 -2
- package/dist/plugins/twenty/scripts/lib/__tests__/mappers.test.ts +397 -151
- package/dist/plugins/twenty/scripts/lib/__tests__/members-ensure.test.ts +28 -129
- package/dist/plugins/twenty/scripts/lib/__tests__/provision-members-db.test.ts +10 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/schema-ensure.test.ts +13 -8
- package/dist/plugins/twenty/scripts/lib/lastmile-reader.ts +222 -2
- package/dist/plugins/twenty/scripts/lib/load-attachments.ts +29 -0
- package/dist/plugins/twenty/scripts/lib/load-records.ts +160 -43
- package/dist/plugins/twenty/scripts/lib/mappers.ts +368 -152
- package/dist/plugins/twenty/scripts/lib/members-ensure.ts +43 -268
- package/dist/plugins/twenty/scripts/lib/provision-members-db.ts +57 -0
- package/dist/plugins/twenty/scripts/lib/schema-ensure.ts +136 -31
- package/dist/plugins/twenty/scripts/migrate-lastmile.ts +254 -152
- package/dist/plugins/twenty/scripts/provision-twenty-members.ts +44 -1
- package/dist/plugins/twenty/scripts/purge-lastmile-import.ts +178 -0
- package/dist/plugins/twenty/scripts/restructure-products.ts +312 -0
- package/dist/plugins/twenty/scripts/retag-stage-values.ts +362 -0
- package/dist/plugins/twenty/test/manifest.test.ts +2 -4
- package/dist/scripts/post-deploy.sh +79 -1
- package/dist/{signin-UGDWTGS4.js → signin-5QZNRSOO.js} +2 -2
- package/dist/{sso-oidc-Q4VXANXY.js → sso-oidc-XK673P54.js} +2 -2
- package/dist/{sts-CWLSE3GH.js → sts-OXI2UALF.js} +6 -134
- package/dist/{sts-DNZLNVOV.js → sts-SQW4NBK3.js} +6 -134
- package/dist/terraform/examples/greenfield/main.tf +233 -175
- package/dist/terraform/examples/greenfield/terraform.tfvars.example +12 -8
- package/dist/terraform/modules/app/agentcore-admin/main.tf +47 -0
- package/dist/terraform/modules/app/agentcore-code-interpreter/README.md +39 -47
- package/dist/terraform/modules/app/agentcore-code-interpreter/main.tf +13 -66
- package/dist/terraform/modules/app/agentcore-identity/main.tf +106 -26
- package/dist/terraform/modules/app/agentcore-identity/outputs.tf +6 -6
- package/dist/terraform/modules/app/agentcore-identity/scripts/bootstrap_twenty_oauth_client.sh +216 -99
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_identity.sh +6 -9
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_workload_identity.sh +19 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/ensure_workload_identity.sh +29 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/read_identity.sh +22 -7
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_identity.sh +17 -46
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_provider.mjs +65 -3
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/after.tf +15 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/before.tf +7 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-after.tf +8 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-before.tf +9 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-after.tf +3 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-before.tf +3 -0
- package/dist/terraform/modules/app/agentcore-identity/variables.tf +6 -0
- package/dist/terraform/modules/app/agentcore-memory/README.md +46 -9
- package/dist/terraform/modules/app/agentcore-memory/main.tf +27 -10
- package/dist/terraform/modules/app/agentcore-memory/scripts/create_or_find_memory.sh +156 -24
- package/dist/terraform/modules/app/agentcore-pi/README.md +1 -3
- package/dist/terraform/modules/app/agentcore-pi/main.tf +42 -52
- package/dist/terraform/modules/app/agentcore-pi/outputs.tf +3 -3
- package/dist/terraform/modules/app/agentcore-pi/scripts/reconcile_pi_runtime.mjs +175 -0
- package/dist/terraform/modules/app/agentcore-pi/variables.tf +35 -28
- package/dist/terraform/modules/app/agentcore-platform/main.tf +68 -0
- package/dist/terraform/modules/app/agentcore-runtime/main.tf +4 -20
- package/dist/terraform/modules/app/capability-broker/main.tf +2 -2
- package/dist/terraform/modules/app/capability-broker/variables.tf +11 -0
- package/dist/terraform/modules/app/deployment-control-plane/README.md +264 -0
- package/dist/terraform/modules/app/deployment-control-plane/buildspec.yml +4 -1
- package/dist/terraform/modules/app/deployment-control-plane/main.tf +94 -0
- package/dist/terraform/modules/app/deployment-control-plane/outputs.tf +5 -0
- package/dist/terraform/modules/app/deployment-control-plane/runner.py +2641 -124
- package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +2034 -154
- package/dist/terraform/modules/app/deployment-control-plane/variables.tf +33 -0
- package/dist/terraform/modules/app/lambda-api/auth-state.tf +72 -0
- package/dist/terraform/modules/app/lambda-api/chat-latency-observability.tf +466 -0
- package/dist/terraform/modules/app/lambda-api/dispatch-dlq.tf +55 -0
- package/dist/terraform/modules/app/lambda-api/handlers.tf +411 -723
- package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +262 -198
- package/dist/terraform/modules/app/lambda-api/main.tf +51 -13
- package/dist/terraform/modules/app/lambda-api/mcp-oauth.tf +4 -181
- package/dist/terraform/modules/app/lambda-api/memory-alarms.tf +3 -28
- package/dist/terraform/modules/app/lambda-api/oauth-secrets.tf +1 -2
- package/dist/terraform/modules/app/lambda-api/outputs.tf +17 -45
- package/dist/terraform/modules/app/lambda-api/turn-assertion.tf +45 -0
- package/dist/terraform/modules/app/lambda-api/variables.tf +219 -126
- package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/README.md +1 -1
- package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/main.tf +18 -18
- package/dist/terraform/modules/app/sandbox-log-scrubber/README.md +11 -10
- package/dist/terraform/modules/app/sandbox-log-scrubber/main.tf +5 -5
- package/dist/terraform/modules/app/static-site/main.tf +1 -1
- package/dist/terraform/modules/app/www-dns/main.tf +9 -27
- package/dist/terraform/modules/app/www-dns/variables.tf +4 -10
- package/dist/terraform/modules/data/aurora-postgres/README.md +34 -0
- package/dist/terraform/modules/data/aurora-postgres/alarms.tf +82 -0
- package/dist/terraform/modules/data/aurora-postgres/main.tf +27 -57
- package/dist/terraform/modules/data/aurora-postgres/outputs.tf +0 -9
- package/dist/terraform/modules/data/aurora-postgres/variables.tf +41 -0
- package/dist/terraform/modules/data/s3-buckets/main.tf +5 -6
- package/dist/terraform/modules/foundation/cognito/main.tf +81 -8
- package/dist/terraform/modules/foundation/cognito/outputs.tf +5 -0
- package/dist/terraform/modules/foundation/cognito/variables.tf +24 -12
- package/dist/terraform/modules/thinkwork/README.md +5 -1
- package/dist/terraform/modules/thinkwork/main.tf +376 -374
- package/dist/terraform/modules/thinkwork/outputs.tf +12 -158
- package/dist/terraform/modules/thinkwork/variables.tf +246 -89
- package/dist/workspace-defaults/files/INSTRUCTIONS.md +9 -11
- package/dist/workspace-defaults/files/MEMORY_GUIDE.md +38 -35
- package/dist/workspace-defaults/files/ROUTER.md +1 -1
- package/dist/workspace-defaults/files/TOOLS.md +9 -39
- package/dist/workspace-defaults/files/agents/analyst/INSTRUCTIONS.md +6 -3
- package/dist/workspace-defaults/files/catalog-skills/brain-brief-builder/SKILL.md +165 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/SKILL.md +75 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/mcp-tooling.md +40 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/validation-and-handoff.md +40 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/workflow-authoring.md +46 -0
- package/dist/workspace-defaults/files/skills/artifact-builder/references/crm-dashboard.md +1 -1
- package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +22 -3
- package/package.json +1 -1
- package/dist/drizzle/0261_managed_harness_multiplayer.sql +0 -313
- package/dist/drizzle/0262_parallel_harness_threads.sql +0 -9
- package/dist/drizzle/0264_harness_tool_execution_ledger.sql +0 -113
- package/dist/plugins/company-data/README.md +0 -49
- package/dist/plugins/company-data/package.json +0 -21
- package/dist/plugins/company-data/src/index.ts +0 -30
- package/dist/plugins/company-data/src/manifest.ts +0 -26
- package/dist/plugins/company-data/test/manifest.test.ts +0 -116
- package/dist/plugins/company-data/tsconfig.json +0 -8
- package/dist/plugins/company-etl/README.md +0 -46
- package/dist/plugins/company-etl/package.json +0 -21
- package/dist/plugins/company-etl/src/index.ts +0 -29
- package/dist/plugins/company-etl/src/manifest.ts +0 -26
- package/dist/plugins/company-etl/test/manifest.test.ts +0 -108
- package/dist/plugins/company-etl/tsconfig.json +0 -8
- package/dist/plugins/lastmile/README.md +0 -50
- package/dist/plugins/lastmile/package.json +0 -23
- package/dist/plugins/lastmile/smoke/lastmile-plugin-smoke.mjs +0 -661
- package/dist/plugins/lastmile/src/api/tasks-adapter.ts +0 -572
- package/dist/plugins/lastmile/src/discovery.fixture.ts +0 -64
- package/dist/plugins/lastmile/src/index.ts +0 -46
- package/dist/plugins/lastmile/src/manifest.ts +0 -139
- package/dist/plugins/lastmile/test/api/tasks-adapter.test.ts +0 -266
- package/dist/plugins/lastmile/test/discovery.test.ts +0 -88
- package/dist/plugins/lastmile/tsconfig.json +0 -8
- package/dist/plugins/n8n/smoke/n8n-managed-app-smoke.mjs +0 -409
- package/dist/plugins/twenty/smoke/twenty-managed-app-smoke.mjs +0 -359
- package/dist/terraform/modules/app/agentcore-code-interpreter/Dockerfile.sandbox-base +0 -61
- package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/sitecustomize.py +0 -227
- package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/test_sitecustomize.py +0 -277
- package/dist/terraform/modules/app/agentcore-code-interpreter/scripts/build_and_push_sandbox_base.sh +0 -70
- package/dist/terraform/modules/app/agentcore-gateway/main.tf +0 -305
- package/dist/terraform/modules/app/agentcore-gateway/outputs.tf +0 -44
- package/dist/terraform/modules/app/agentcore-gateway/scripts/delete_gateway.sh +0 -93
- package/dist/terraform/modules/app/agentcore-gateway/scripts/read_gateway.sh +0 -33
- package/dist/terraform/modules/app/agentcore-gateway/scripts/reconcile_gateway.sh +0 -543
- package/dist/terraform/modules/app/agentcore-gateway/variables.tf +0 -70
- package/dist/terraform/modules/app/agentcore-harness/main.tf +0 -330
- package/dist/terraform/modules/app/agentcore-harness/outputs.tf +0 -72
- package/dist/terraform/modules/app/agentcore-harness/scripts/delete_harness.sh +0 -5
- package/dist/terraform/modules/app/agentcore-harness/scripts/harness-lifecycle.mjs +0 -430
- package/dist/terraform/modules/app/agentcore-harness/scripts/harness-readback.mjs +0 -180
- package/dist/terraform/modules/app/agentcore-harness/scripts/harness-tool-contract.mjs +0 -193
- package/dist/terraform/modules/app/agentcore-harness/scripts/prune_harness.sh +0 -5
- package/dist/terraform/modules/app/agentcore-harness/scripts/read_harness.sh +0 -5
- package/dist/terraform/modules/app/agentcore-harness/scripts/reconcile_harness.sh +0 -5
- package/dist/terraform/modules/app/agentcore-harness/variables.tf +0 -96
- package/dist/terraform/modules/app/hindsight-memory/README.md +0 -89
- package/dist/terraform/modules/app/hindsight-memory/main.tf +0 -411
- package/dist/terraform/modules/app/lambda-api/agentcore-harness-alarms.tf +0 -88
- package/dist/terraform/modules/app/lambda-api/agentcore-identity-alarms.tf +0 -91
- package/dist/terraform/modules/data/bedrock-knowledge-base/main.tf +0 -102
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/outputs.tf +0 -0
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/sync-database.py +0 -0
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/test_sync_database.py +0 -0
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/variables.tf +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/README.md +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/main.tf +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/outputs.tf +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/variables.tf +0 -0
|
@@ -64,18 +64,6 @@ variable "database_engine" {
|
|
|
64
64
|
default = "aurora-serverless"
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
variable "enable_hindsight" {
|
|
68
|
-
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."
|
|
69
|
-
type = bool
|
|
70
|
-
default = true
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
variable "memory_engine" {
|
|
74
|
-
description = "Active long-term memory engine. Empty selects Hindsight when enable_hindsight = true. Use 'agentcore' only for explicit low-cost/development managed-memory deployments."
|
|
75
|
-
type = string
|
|
76
|
-
default = ""
|
|
77
|
-
}
|
|
78
|
-
|
|
79
67
|
variable "twenty_provisioned" {
|
|
80
68
|
description = "Provision the retained Twenty CRM managed-app substrate. Runtime can be parked independently with twenty_runtime_enabled."
|
|
81
69
|
type = bool
|
|
@@ -164,8 +152,6 @@ module "thinkwork" {
|
|
|
164
152
|
db_password = var.db_password
|
|
165
153
|
api_auth_secret = var.api_auth_secret
|
|
166
154
|
|
|
167
|
-
enable_hindsight = var.enable_hindsight
|
|
168
|
-
memory_engine = var.memory_engine
|
|
169
155
|
twenty_provisioned = var.twenty_provisioned
|
|
170
156
|
twenty_runtime_enabled = var.twenty_runtime_enabled
|
|
171
157
|
twenty_image_uri = var.twenty_image_uri
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
TokenProviderError,
|
|
@@ -23,7 +23,7 @@ var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the
|
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.1064.0/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
|
|
25
25
|
var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
26
|
-
const { SSOOIDCClient } = await import("./sso-oidc-
|
|
26
|
+
const { SSOOIDCClient } = await import("./sso-oidc-XK673P54.js");
|
|
27
27
|
const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
|
|
28
28
|
const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
|
|
29
29
|
region: ssoRegion ?? init.clientConfig?.region,
|
|
@@ -35,7 +35,7 @@ var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
|
35
35
|
|
|
36
36
|
// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.1064.0/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
|
|
37
37
|
var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
|
|
38
|
-
const { CreateTokenCommand } = await import("./sso-oidc-
|
|
38
|
+
const { CreateTokenCommand } = await import("./sso-oidc-XK673P54.js");
|
|
39
39
|
const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
|
|
40
40
|
return ssoOidcClient.send(new CreateTokenCommand({
|
|
41
41
|
clientId: ssoToken.clientId,
|
|
@@ -180,7 +180,7 @@ var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoR
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
const { accessToken } = token;
|
|
183
|
-
const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-
|
|
183
|
+
const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-ETCXTR4I.js");
|
|
184
184
|
const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, {
|
|
185
185
|
logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,
|
|
186
186
|
region: clientConfig?.region ?? ssoRegion,
|
|
@@ -63,9 +63,9 @@ import {
|
|
|
63
63
|
streamCollector,
|
|
64
64
|
toBase64,
|
|
65
65
|
toUtf8
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-AD2NIWB5.js";
|
|
67
67
|
import "./chunk-EI5ZX7CN.js";
|
|
68
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-YQCYD6NE.js";
|
|
69
69
|
import "./chunk-XYM7PE2A.js";
|
|
70
70
|
import "./chunk-OCPHU34C.js";
|
|
71
71
|
import "./chunk-DV3MRBR5.js";
|
|
@@ -63,9 +63,9 @@ import {
|
|
|
63
63
|
streamCollector,
|
|
64
64
|
toBase64,
|
|
65
65
|
toUtf8
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-AD2NIWB5.js";
|
|
67
67
|
import "./chunk-EI5ZX7CN.js";
|
|
68
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-YQCYD6NE.js";
|
|
69
69
|
import "./chunk-XYM7PE2A.js";
|
|
70
70
|
import "./chunk-OCPHU34C.js";
|
|
71
71
|
import "./chunk-DV3MRBR5.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
externalDataInterceptor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
externalDataInterceptor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
TokenProviderError,
|
|
@@ -23,7 +23,7 @@ var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the
|
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.1088.0/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
|
|
25
25
|
var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
26
|
-
const { SSOOIDCClient } = await import("./sso-oidc-
|
|
26
|
+
const { SSOOIDCClient } = await import("./sso-oidc-XK673P54.js");
|
|
27
27
|
const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
|
|
28
28
|
const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
|
|
29
29
|
region: ssoRegion ?? init.clientConfig?.region,
|
|
@@ -35,7 +35,7 @@ var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
|
|
|
35
35
|
|
|
36
36
|
// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.1088.0/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
|
|
37
37
|
var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
|
|
38
|
-
const { CreateTokenCommand } = await import("./sso-oidc-
|
|
38
|
+
const { CreateTokenCommand } = await import("./sso-oidc-XK673P54.js");
|
|
39
39
|
const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
|
|
40
40
|
return ssoOidcClient.send(new CreateTokenCommand({
|
|
41
41
|
clientId: ssoToken.clientId,
|
|
@@ -183,7 +183,7 @@ var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoR
|
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
const { accessToken } = token;
|
|
186
|
-
const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-
|
|
186
|
+
const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-UBD7KUHE.js");
|
|
187
187
|
const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, {
|
|
188
188
|
logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger,
|
|
189
189
|
region: clientConfig?.region ?? ssoRegion,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
externalDataInterceptor
|
|
@@ -18,7 +18,7 @@ var fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
|
18
18
|
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
19
19
|
let { roleAssumerWithWebIdentity } = init;
|
|
20
20
|
if (!roleAssumerWithWebIdentity) {
|
|
21
|
-
const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-
|
|
21
|
+
const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-OXI2UALF.js");
|
|
22
22
|
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
23
23
|
...init.clientConfig,
|
|
24
24
|
credentialProviderLogger: init.logger,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError
|
|
7
7
|
} from "./chunk-XYM7PE2A.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
externalDataInterceptor
|
|
@@ -18,7 +18,7 @@ var fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
|
18
18
|
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
19
19
|
let { roleAssumerWithWebIdentity } = init;
|
|
20
20
|
if (!roleAssumerWithWebIdentity) {
|
|
21
|
-
const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-
|
|
21
|
+
const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-SQW4NBK3.js");
|
|
22
22
|
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
23
23
|
...init.clientConfig,
|
|
24
24
|
credentialProviderLogger: init.logger,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setCredentialFeature
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQCYD6NE.js";
|
|
5
5
|
import {
|
|
6
6
|
CredentialsProviderError,
|
|
7
7
|
HttpRequest,
|
|
@@ -17,7 +17,7 @@ import "./chunk-DV3MRBR5.js";
|
|
|
17
17
|
var resolveCredentialSource = (credentialSource, profileName, logger) => {
|
|
18
18
|
const sourceProvidersMap = {
|
|
19
19
|
EcsContainer: async (options) => {
|
|
20
|
-
const { fromHttp } = await import("./dist-es-
|
|
20
|
+
const { fromHttp } = await import("./dist-es-BNZTBBVC.js");
|
|
21
21
|
const { fromContainerMetadata } = await import("./dist-es-KL7Y5NB2.js");
|
|
22
22
|
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
|
|
23
23
|
return async () => chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
|
|
@@ -29,7 +29,7 @@ var resolveCredentialSource = (credentialSource, profileName, logger) => {
|
|
|
29
29
|
},
|
|
30
30
|
Environment: async (options) => {
|
|
31
31
|
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
|
32
|
-
const { fromEnv } = await import("./dist-es-
|
|
32
|
+
const { fromEnv } = await import("./dist-es-SGCA4P32.js");
|
|
33
33
|
return async () => fromEnv(options)().then(setNamedProvider);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
@@ -64,7 +64,7 @@ var resolveAssumeRoleCredentials = async (profileName, profiles, options, caller
|
|
|
64
64
|
const profileData = profiles[profileName];
|
|
65
65
|
const { source_profile, region } = profileData;
|
|
66
66
|
if (!options.roleAssumer) {
|
|
67
|
-
const { getDefaultRoleAssumer } = await import("./sts-
|
|
67
|
+
const { getDefaultRoleAssumer } = await import("./sts-OXI2UALF.js");
|
|
68
68
|
options.roleAssumer = getDefaultRoleAssumer({
|
|
69
69
|
...options.clientConfig,
|
|
70
70
|
credentialProviderLogger: options.logger,
|
|
@@ -150,7 +150,7 @@ var LoginCredentialsFetcher = class _LoginCredentialsFetcher {
|
|
|
150
150
|
return this.profileData.login_session;
|
|
151
151
|
}
|
|
152
152
|
async refresh(token) {
|
|
153
|
-
const { SigninClient, CreateOAuth2TokenCommand } = await import("./signin-
|
|
153
|
+
const { SigninClient, CreateOAuth2TokenCommand } = await import("./signin-5QZNRSOO.js");
|
|
154
154
|
const { logger, userAgentAppId } = this.callerClientConfig ?? {};
|
|
155
155
|
const isH2 = (requestHandler2) => {
|
|
156
156
|
return requestHandler2?.metadata?.handlerProtocol === "h2";
|
|
@@ -393,14 +393,14 @@ var resolveLoginCredentials = async (profileName, options, callerClientConfig) =
|
|
|
393
393
|
|
|
394
394
|
// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.51/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js
|
|
395
395
|
var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string";
|
|
396
|
-
var resolveProcessCredentials = async (options, profile) => import("./dist-es-
|
|
396
|
+
var resolveProcessCredentials = async (options, profile) => import("./dist-es-CD2RBDAC.js").then(({ fromProcess }) => fromProcess({
|
|
397
397
|
...options,
|
|
398
398
|
profile
|
|
399
399
|
})().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v")));
|
|
400
400
|
|
|
401
401
|
// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.51/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js
|
|
402
402
|
var resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {
|
|
403
|
-
const { fromSSO } = await import("./dist-es-
|
|
403
|
+
const { fromSSO } = await import("./dist-es-KVFWJNDY.js");
|
|
404
404
|
return fromSSO({
|
|
405
405
|
profile,
|
|
406
406
|
logger: options.logger,
|
|
@@ -434,7 +434,7 @@ var resolveStaticCredentials = async (profile, options) => {
|
|
|
434
434
|
|
|
435
435
|
// ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.51/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js
|
|
436
436
|
var isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
|
|
437
|
-
var resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => import("./dist-es-
|
|
437
|
+
var resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => import("./dist-es-WBM6J4RA.js").then(({ fromTokenFile }) => fromTokenFile({
|
|
438
438
|
webIdentityTokenFile: profile.web_identity_token_file,
|
|
439
439
|
roleArn: profile.role_arn,
|
|
440
440
|
roleSessionName: profile.role_session_name,
|
|
@@ -215,11 +215,6 @@ BEGIN
|
|
|
215
215
|
ELSE
|
|
216
216
|
missing := missing || 'agent_capabilities'::text;
|
|
217
217
|
END IF;
|
|
218
|
-
IF to_regclass('public.agent_knowledge_bases') IS NOT NULL THEN
|
|
219
|
-
GRANT SELECT ON public.agent_knowledge_bases TO analyst_reader;
|
|
220
|
-
ELSE
|
|
221
|
-
missing := missing || 'agent_knowledge_bases'::text;
|
|
222
|
-
END IF;
|
|
223
218
|
IF to_regclass('public.agent_loop_iterations') IS NOT NULL THEN
|
|
224
219
|
GRANT SELECT ON public.agent_loop_iterations TO analyst_reader;
|
|
225
220
|
ELSE
|
|
@@ -510,12 +505,6 @@ BEGIN
|
|
|
510
505
|
ELSE
|
|
511
506
|
missing := missing || 'guardrails'::text;
|
|
512
507
|
END IF;
|
|
513
|
-
IF to_regclass('public.harness_tool_execution_events') IS NOT NULL THEN
|
|
514
|
-
REVOKE ALL PRIVILEGES ON public.harness_tool_execution_events FROM analyst_reader;
|
|
515
|
-
GRANT SELECT (created_at, duration_ms, error_preview, event_type, id, idempotency_key, input_preview, operation, output_preview, policy_decision_id, policy_revision, principal_id, principal_type, provider_cost_usd, provider_request_id, tenant_id, thread_id, tool_use_id, turn_id) ON public.harness_tool_execution_events TO analyst_reader;
|
|
516
|
-
ELSE
|
|
517
|
-
missing := missing || 'harness_tool_execution_events'::text;
|
|
518
|
-
END IF;
|
|
519
508
|
IF to_regclass('public.inbox_item_comments') IS NOT NULL THEN
|
|
520
509
|
GRANT SELECT ON public.inbox_item_comments TO analyst_reader;
|
|
521
510
|
ELSE
|
|
@@ -531,16 +520,6 @@ BEGIN
|
|
|
531
520
|
ELSE
|
|
532
521
|
missing := missing || 'inbox_items'::text;
|
|
533
522
|
END IF;
|
|
534
|
-
IF to_regclass('public.knowledge_base_documents') IS NOT NULL THEN
|
|
535
|
-
GRANT SELECT ON public.knowledge_base_documents TO analyst_reader;
|
|
536
|
-
ELSE
|
|
537
|
-
missing := missing || 'knowledge_base_documents'::text;
|
|
538
|
-
END IF;
|
|
539
|
-
IF to_regclass('public.knowledge_bases') IS NOT NULL THEN
|
|
540
|
-
GRANT SELECT ON public.knowledge_bases TO analyst_reader;
|
|
541
|
-
ELSE
|
|
542
|
-
missing := missing || 'knowledge_bases'::text;
|
|
543
|
-
END IF;
|
|
544
523
|
IF to_regclass('public.linked_task_events') IS NOT NULL THEN
|
|
545
524
|
GRANT SELECT ON public.linked_task_events TO analyst_reader;
|
|
546
525
|
ELSE
|
|
@@ -831,11 +810,6 @@ BEGIN
|
|
|
831
810
|
ELSE
|
|
832
811
|
missing := missing || 'space_integrations'::text;
|
|
833
812
|
END IF;
|
|
834
|
-
IF to_regclass('public.space_knowledge_bases') IS NOT NULL THEN
|
|
835
|
-
GRANT SELECT ON public.space_knowledge_bases TO analyst_reader;
|
|
836
|
-
ELSE
|
|
837
|
-
missing := missing || 'space_knowledge_bases'::text;
|
|
838
|
-
END IF;
|
|
839
813
|
IF to_regclass('public.space_mcp_servers') IS NOT NULL THEN
|
|
840
814
|
GRANT SELECT ON public.space_mcp_servers TO analyst_reader;
|
|
841
815
|
ELSE
|
|
@@ -973,6 +947,12 @@ BEGIN
|
|
|
973
947
|
ELSE
|
|
974
948
|
missing := missing || 'threads'::text;
|
|
975
949
|
END IF;
|
|
950
|
+
IF to_regclass('public.tool_execution_events') IS NOT NULL THEN
|
|
951
|
+
REVOKE ALL PRIVILEGES ON public.tool_execution_events FROM analyst_reader;
|
|
952
|
+
GRANT SELECT (created_at, duration_ms, error_preview, event_type, id, idempotency_key, input_preview, operation, output_preview, policy_decision_id, policy_revision, principal_id, principal_type, provider_cost_usd, provider_request_id, tenant_id, thread_id, tool_use_id, turn_id) ON public.tool_execution_events TO analyst_reader;
|
|
953
|
+
ELSE
|
|
954
|
+
missing := missing || 'tool_execution_events'::text;
|
|
955
|
+
END IF;
|
|
976
956
|
IF to_regclass('public.trace_cost_reconciliation_facts') IS NOT NULL THEN
|
|
977
957
|
GRANT SELECT ON public.trace_cost_reconciliation_facts TO analyst_reader;
|
|
978
958
|
ELSE
|
|
@@ -993,6 +973,16 @@ BEGIN
|
|
|
993
973
|
ELSE
|
|
994
974
|
missing := missing || 'trace_source_evidence'::text;
|
|
995
975
|
END IF;
|
|
976
|
+
IF to_regclass('public.twin_materialization_suggestions') IS NOT NULL THEN
|
|
977
|
+
GRANT SELECT ON public.twin_materialization_suggestions TO analyst_reader;
|
|
978
|
+
ELSE
|
|
979
|
+
missing := missing || 'twin_materialization_suggestions'::text;
|
|
980
|
+
END IF;
|
|
981
|
+
IF to_regclass('public.user_brain_claims') IS NOT NULL THEN
|
|
982
|
+
GRANT SELECT ON public.user_brain_claims TO analyst_reader;
|
|
983
|
+
ELSE
|
|
984
|
+
missing := missing || 'user_brain_claims'::text;
|
|
985
|
+
END IF;
|
|
996
986
|
IF to_regclass('public.user_model_approvals') IS NOT NULL THEN
|
|
997
987
|
GRANT SELECT ON public.user_model_approvals TO analyst_reader;
|
|
998
988
|
ELSE
|
|
@@ -1118,6 +1108,7 @@ BEGIN
|
|
|
1118
1108
|
RAISE WARNING 'analyst grants skipped for tables missing on this database: %', missing;
|
|
1119
1109
|
END IF;
|
|
1120
1110
|
END $$;
|
|
1111
|
+
|
|
1121
1112
|
-- END GENERATED ANALYST GRANTS
|
|
1122
1113
|
|
|
1123
1114
|
COMMIT;
|
|
@@ -146,15 +146,6 @@ BEGIN
|
|
|
146
146
|
ELSE
|
|
147
147
|
missing := missing || 'agent_capabilities'::text;
|
|
148
148
|
END IF;
|
|
149
|
-
IF to_regclass('public.agent_knowledge_bases') IS NOT NULL THEN
|
|
150
|
-
ALTER TABLE public.agent_knowledge_bases ENABLE ROW LEVEL SECURITY;
|
|
151
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.agent_knowledge_bases;
|
|
152
|
-
CREATE POLICY analyst_tenant_isolation ON public.agent_knowledge_bases
|
|
153
|
-
FOR SELECT TO analyst_reader
|
|
154
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
155
|
-
ELSE
|
|
156
|
-
missing := missing || 'agent_knowledge_bases'::text;
|
|
157
|
-
END IF;
|
|
158
149
|
IF to_regclass('public.agent_loop_iterations') IS NOT NULL THEN
|
|
159
150
|
ALTER TABLE public.agent_loop_iterations ENABLE ROW LEVEL SECURITY;
|
|
160
151
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.agent_loop_iterations;
|
|
@@ -668,15 +659,6 @@ BEGIN
|
|
|
668
659
|
ELSE
|
|
669
660
|
missing := missing || 'guardrails'::text;
|
|
670
661
|
END IF;
|
|
671
|
-
IF to_regclass('public.harness_tool_execution_events') IS NOT NULL THEN
|
|
672
|
-
ALTER TABLE public.harness_tool_execution_events ENABLE ROW LEVEL SECURITY;
|
|
673
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.harness_tool_execution_events;
|
|
674
|
-
CREATE POLICY analyst_tenant_isolation ON public.harness_tool_execution_events
|
|
675
|
-
FOR SELECT TO analyst_reader
|
|
676
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
677
|
-
ELSE
|
|
678
|
-
missing := missing || 'harness_tool_execution_events'::text;
|
|
679
|
-
END IF;
|
|
680
662
|
IF to_regclass('public.inbox_item_comments') IS NOT NULL THEN
|
|
681
663
|
ALTER TABLE public.inbox_item_comments ENABLE ROW LEVEL SECURITY;
|
|
682
664
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.inbox_item_comments;
|
|
@@ -704,24 +686,6 @@ BEGIN
|
|
|
704
686
|
ELSE
|
|
705
687
|
missing := missing || 'inbox_items'::text;
|
|
706
688
|
END IF;
|
|
707
|
-
IF to_regclass('public.knowledge_base_documents') IS NOT NULL THEN
|
|
708
|
-
ALTER TABLE public.knowledge_base_documents ENABLE ROW LEVEL SECURITY;
|
|
709
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_base_documents;
|
|
710
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_base_documents
|
|
711
|
-
FOR SELECT TO analyst_reader
|
|
712
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
713
|
-
ELSE
|
|
714
|
-
missing := missing || 'knowledge_base_documents'::text;
|
|
715
|
-
END IF;
|
|
716
|
-
IF to_regclass('public.knowledge_bases') IS NOT NULL THEN
|
|
717
|
-
ALTER TABLE public.knowledge_bases ENABLE ROW LEVEL SECURITY;
|
|
718
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.knowledge_bases;
|
|
719
|
-
CREATE POLICY analyst_tenant_isolation ON public.knowledge_bases
|
|
720
|
-
FOR SELECT TO analyst_reader
|
|
721
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
722
|
-
ELSE
|
|
723
|
-
missing := missing || 'knowledge_bases'::text;
|
|
724
|
-
END IF;
|
|
725
689
|
IF to_regclass('public.linked_task_events') IS NOT NULL THEN
|
|
726
690
|
ALTER TABLE public.linked_task_events ENABLE ROW LEVEL SECURITY;
|
|
727
691
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.linked_task_events;
|
|
@@ -1226,15 +1190,6 @@ BEGIN
|
|
|
1226
1190
|
ELSE
|
|
1227
1191
|
missing := missing || 'space_integrations'::text;
|
|
1228
1192
|
END IF;
|
|
1229
|
-
IF to_regclass('public.space_knowledge_bases') IS NOT NULL THEN
|
|
1230
|
-
ALTER TABLE public.space_knowledge_bases ENABLE ROW LEVEL SECURITY;
|
|
1231
|
-
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.space_knowledge_bases;
|
|
1232
|
-
CREATE POLICY analyst_tenant_isolation ON public.space_knowledge_bases
|
|
1233
|
-
FOR SELECT TO analyst_reader
|
|
1234
|
-
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
1235
|
-
ELSE
|
|
1236
|
-
missing := missing || 'space_knowledge_bases'::text;
|
|
1237
|
-
END IF;
|
|
1238
1193
|
IF to_regclass('public.space_mcp_servers') IS NOT NULL THEN
|
|
1239
1194
|
ALTER TABLE public.space_mcp_servers ENABLE ROW LEVEL SECURITY;
|
|
1240
1195
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.space_mcp_servers;
|
|
@@ -1478,6 +1433,15 @@ BEGIN
|
|
|
1478
1433
|
ELSE
|
|
1479
1434
|
missing := missing || 'threads'::text;
|
|
1480
1435
|
END IF;
|
|
1436
|
+
IF to_regclass('public.tool_execution_events') IS NOT NULL THEN
|
|
1437
|
+
ALTER TABLE public.tool_execution_events ENABLE ROW LEVEL SECURITY;
|
|
1438
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.tool_execution_events;
|
|
1439
|
+
CREATE POLICY analyst_tenant_isolation ON public.tool_execution_events
|
|
1440
|
+
FOR SELECT TO analyst_reader
|
|
1441
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
1442
|
+
ELSE
|
|
1443
|
+
missing := missing || 'tool_execution_events'::text;
|
|
1444
|
+
END IF;
|
|
1481
1445
|
IF to_regclass('public.trace_cost_reconciliation_facts') IS NOT NULL THEN
|
|
1482
1446
|
ALTER TABLE public.trace_cost_reconciliation_facts ENABLE ROW LEVEL SECURITY;
|
|
1483
1447
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.trace_cost_reconciliation_facts;
|
|
@@ -1514,6 +1478,24 @@ BEGIN
|
|
|
1514
1478
|
ELSE
|
|
1515
1479
|
missing := missing || 'trace_source_evidence'::text;
|
|
1516
1480
|
END IF;
|
|
1481
|
+
IF to_regclass('public.twin_materialization_suggestions') IS NOT NULL THEN
|
|
1482
|
+
ALTER TABLE public.twin_materialization_suggestions ENABLE ROW LEVEL SECURITY;
|
|
1483
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.twin_materialization_suggestions;
|
|
1484
|
+
CREATE POLICY analyst_tenant_isolation ON public.twin_materialization_suggestions
|
|
1485
|
+
FOR SELECT TO analyst_reader
|
|
1486
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
1487
|
+
ELSE
|
|
1488
|
+
missing := missing || 'twin_materialization_suggestions'::text;
|
|
1489
|
+
END IF;
|
|
1490
|
+
IF to_regclass('public.user_brain_claims') IS NOT NULL THEN
|
|
1491
|
+
ALTER TABLE public.user_brain_claims ENABLE ROW LEVEL SECURITY;
|
|
1492
|
+
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.user_brain_claims;
|
|
1493
|
+
CREATE POLICY analyst_tenant_isolation ON public.user_brain_claims
|
|
1494
|
+
FOR SELECT TO analyst_reader
|
|
1495
|
+
USING (tenant_id = current_setting('thinkwork.analyst_tenant', true)::uuid);
|
|
1496
|
+
ELSE
|
|
1497
|
+
missing := missing || 'user_brain_claims'::text;
|
|
1498
|
+
END IF;
|
|
1517
1499
|
IF to_regclass('public.user_model_approvals') IS NOT NULL THEN
|
|
1518
1500
|
ALTER TABLE public.user_model_approvals ENABLE ROW LEVEL SECURITY;
|
|
1519
1501
|
DROP POLICY IF EXISTS analyst_tenant_isolation ON public.user_model_approvals;
|
|
@@ -1734,6 +1716,7 @@ BEGIN
|
|
|
1734
1716
|
RAISE WARNING 'analyst RLS skipped for tables missing on this database: %', missing;
|
|
1735
1717
|
END IF;
|
|
1736
1718
|
END $$;
|
|
1719
|
+
|
|
1737
1720
|
-- END GENERATED ANALYST RLS
|
|
1738
1721
|
|
|
1739
1722
|
COMMIT;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
-- creates: public.uq_auth_route_clients_app_client
|
|
22
22
|
-- creates: public.idx_auth_route_clients_lifecycle_status
|
|
23
23
|
-- creates: public.user_auth_identities
|
|
24
|
-
-- creates: public.
|
|
24
|
+
-- creates: public.uq_user_auth_identities_sub_connection
|
|
25
25
|
-- creates: public.uq_user_auth_identities_provider_subject
|
|
26
26
|
-- creates: public.idx_user_auth_identities_user_status
|
|
27
27
|
-- creates: public.idx_user_auth_identities_tenant_status
|
|
@@ -233,8 +233,12 @@ CREATE TABLE IF NOT EXISTS public.user_auth_identities (
|
|
|
233
233
|
CHECK (status = 'quarantined' OR auth_provider_resource_id IS NOT NULL)
|
|
234
234
|
);
|
|
235
235
|
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
-- 0288 SUPERSEDED the one-per-subject index: enrollment is one lane per
|
|
237
|
+
-- (subject, connection) now. This file is replayed as desired state on
|
|
238
|
+
-- every deploy (deploy.yml native-auth loop), so it must describe the
|
|
239
|
+
-- CURRENT index — recreating the old one fails on any multi-lane DB.
|
|
240
|
+
CREATE UNIQUE INDEX IF NOT EXISTS uq_user_auth_identities_sub_connection
|
|
241
|
+
ON public.user_auth_identities (cognito_issuer, cognito_sub, auth_provider_resource_id);
|
|
238
242
|
CREATE UNIQUE INDEX IF NOT EXISTS uq_user_auth_identities_provider_subject
|
|
239
243
|
ON public.user_auth_identities (auth_provider_resource_id, provider_issuer, provider_subject);
|
|
240
244
|
CREATE INDEX IF NOT EXISTS idx_user_auth_identities_user_status
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
-- creates: public.tool_execution_events
|
|
2
|
+
-- creates: public.idx_tool_execution_turn
|
|
3
|
+
-- creates: public.uq_tool_execution_started
|
|
4
|
+
-- creates: public.uq_tool_execution_terminal
|
|
5
|
+
-- creates-function: public.reject_tool_execution_event_mutation
|
|
6
|
+
-- creates-function: public.validate_tool_execution_event_insert
|
|
7
|
+
-- creates-trigger: public.tool_execution_events.trg_reject_tool_execution_event_mutation
|
|
8
|
+
-- creates-trigger: public.tool_execution_events.trg_validate_tool_execution_event_insert
|
|
9
|
+
-- Pi runtime tool-execution ledger (THINK-324 Wave-3 C17). Sanitized
|
|
10
|
+
-- append-only event stream: one `started` row per tool call and at most one
|
|
11
|
+
-- terminal row, emitted by the runtime via POST /api/runtime/tool-executions.
|
|
12
|
+
-- Succeeds the retired harness_tool_execution_events contract (0264);
|
|
13
|
+
-- policy columns are nullable until per-call re-authorization (C19) lands.
|
|
14
|
+
|
|
15
|
+
CREATE TABLE IF NOT EXISTS public.tool_execution_events (
|
|
16
|
+
id bigserial PRIMARY KEY,
|
|
17
|
+
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
18
|
+
thread_id uuid NOT NULL REFERENCES public.threads(id) ON DELETE CASCADE,
|
|
19
|
+
turn_id uuid NOT NULL REFERENCES public.thread_turns(id) ON DELETE CASCADE,
|
|
20
|
+
principal_type text NOT NULL CHECK (principal_type IN ('user', 'service')),
|
|
21
|
+
principal_id text NOT NULL,
|
|
22
|
+
tool_use_id text NOT NULL,
|
|
23
|
+
operation text NOT NULL,
|
|
24
|
+
policy_revision text,
|
|
25
|
+
policy_decision_id text,
|
|
26
|
+
idempotency_key text NOT NULL,
|
|
27
|
+
credential_owner_alias text,
|
|
28
|
+
event_type text NOT NULL
|
|
29
|
+
CHECK (event_type IN ('started','completed','failed','uncertain')),
|
|
30
|
+
input_preview jsonb,
|
|
31
|
+
output_preview jsonb,
|
|
32
|
+
error_preview jsonb,
|
|
33
|
+
provider_request_id text,
|
|
34
|
+
duration_ms integer CHECK (duration_ms IS NULL OR duration_ms >= 0),
|
|
35
|
+
provider_cost_usd numeric(18,8)
|
|
36
|
+
CHECK (provider_cost_usd IS NULL OR provider_cost_usd >= 0),
|
|
37
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
38
|
+
CHECK (
|
|
39
|
+
(
|
|
40
|
+
event_type = 'started'
|
|
41
|
+
AND input_preview IS NOT NULL
|
|
42
|
+
AND output_preview IS NULL
|
|
43
|
+
AND error_preview IS NULL
|
|
44
|
+
AND provider_request_id IS NULL
|
|
45
|
+
AND duration_ms IS NULL
|
|
46
|
+
AND provider_cost_usd IS NULL
|
|
47
|
+
)
|
|
48
|
+
OR (
|
|
49
|
+
event_type IN ('completed','failed','uncertain')
|
|
50
|
+
AND input_preview IS NULL
|
|
51
|
+
)
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
CREATE UNIQUE INDEX IF NOT EXISTS uq_tool_execution_started
|
|
56
|
+
ON public.tool_execution_events (tenant_id, idempotency_key)
|
|
57
|
+
WHERE event_type = 'started';
|
|
58
|
+
|
|
59
|
+
CREATE UNIQUE INDEX IF NOT EXISTS uq_tool_execution_terminal
|
|
60
|
+
ON public.tool_execution_events (tenant_id, idempotency_key)
|
|
61
|
+
WHERE event_type IN ('completed','failed','uncertain');
|
|
62
|
+
|
|
63
|
+
CREATE INDEX IF NOT EXISTS idx_tool_execution_turn
|
|
64
|
+
ON public.tool_execution_events (tenant_id, thread_id, turn_id, id);
|
|
65
|
+
|
|
66
|
+
CREATE OR REPLACE FUNCTION public.validate_tool_execution_event_insert()
|
|
67
|
+
RETURNS trigger
|
|
68
|
+
LANGUAGE plpgsql
|
|
69
|
+
AS $$
|
|
70
|
+
BEGIN
|
|
71
|
+
IF NEW.event_type = 'started' THEN
|
|
72
|
+
RETURN NEW;
|
|
73
|
+
END IF;
|
|
74
|
+
|
|
75
|
+
IF NOT EXISTS (
|
|
76
|
+
SELECT 1
|
|
77
|
+
FROM public.tool_execution_events started
|
|
78
|
+
WHERE started.tenant_id = NEW.tenant_id
|
|
79
|
+
AND started.idempotency_key = NEW.idempotency_key
|
|
80
|
+
AND started.event_type = 'started'
|
|
81
|
+
AND started.thread_id = NEW.thread_id
|
|
82
|
+
AND started.turn_id = NEW.turn_id
|
|
83
|
+
AND started.principal_type = NEW.principal_type
|
|
84
|
+
AND started.principal_id = NEW.principal_id
|
|
85
|
+
AND started.tool_use_id = NEW.tool_use_id
|
|
86
|
+
AND started.operation = NEW.operation
|
|
87
|
+
AND started.policy_revision IS NOT DISTINCT FROM NEW.policy_revision
|
|
88
|
+
) THEN
|
|
89
|
+
RAISE EXCEPTION 'tool_execution_terminal_without_matching_start';
|
|
90
|
+
END IF;
|
|
91
|
+
|
|
92
|
+
RETURN NEW;
|
|
93
|
+
END;
|
|
94
|
+
$$;
|
|
95
|
+
|
|
96
|
+
DROP TRIGGER IF EXISTS trg_validate_tool_execution_event_insert
|
|
97
|
+
ON public.tool_execution_events;
|
|
98
|
+
CREATE TRIGGER trg_validate_tool_execution_event_insert
|
|
99
|
+
BEFORE INSERT ON public.tool_execution_events
|
|
100
|
+
FOR EACH ROW EXECUTE FUNCTION public.validate_tool_execution_event_insert();
|
|
101
|
+
|
|
102
|
+
CREATE OR REPLACE FUNCTION public.reject_tool_execution_event_mutation()
|
|
103
|
+
RETURNS trigger
|
|
104
|
+
LANGUAGE plpgsql
|
|
105
|
+
AS $$
|
|
106
|
+
BEGIN
|
|
107
|
+
RAISE EXCEPTION 'tool_execution_events_are_append_only';
|
|
108
|
+
END;
|
|
109
|
+
$$;
|
|
110
|
+
|
|
111
|
+
DROP TRIGGER IF EXISTS trg_reject_tool_execution_event_mutation
|
|
112
|
+
ON public.tool_execution_events;
|
|
113
|
+
CREATE TRIGGER trg_reject_tool_execution_event_mutation
|
|
114
|
+
BEFORE UPDATE OR DELETE ON public.tool_execution_events
|
|
115
|
+
FOR EACH ROW EXECUTE FUNCTION public.reject_tool_execution_event_mutation();
|