thinkwork-cli 0.13.0 → 0.13.2
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-JYZXYQJR.js} +3 -1
- package/dist/bowser-6Z6JFAIR.js +2822 -0
- package/dist/chunk-DV3MRBR5.js +43 -0
- package/dist/chunk-DVPBI5HM.js +1728 -0
- package/dist/chunk-EI5ZX7CN.js +522 -0
- package/dist/chunk-EUJ7X6YD.js +126 -0
- package/dist/chunk-GG5WKBOX.js +436 -0
- package/dist/chunk-I64EZSU5.js +358 -0
- package/dist/chunk-ILZKG5WV.js +6151 -0
- package/dist/chunk-KMIJ5KGT.js +128 -0
- package/dist/chunk-OCPHU34C.js +996 -0
- package/dist/chunk-QOERT44A.js +3286 -0
- package/dist/chunk-XYM7PE2A.js +2264 -0
- package/dist/{chunk-STY44FQO.js → chunk-Z2F6RJFR.js} +12 -18
- package/dist/cli.js +72564 -18884
- package/dist/dist-es-CRV46D5B.js +315 -0
- package/dist/dist-es-DCY4IC3Y.js +2000 -0
- package/dist/dist-es-ENBUC3JP.js +14726 -0
- package/dist/dist-es-G54LBMRN.js +48 -0
- package/dist/dist-es-G7PTG75M.js +176 -0
- package/dist/dist-es-GKDBE7E6.js +88 -0
- package/dist/dist-es-HY3535OI.js +70 -0
- package/dist/dist-es-KL7Y5NB2.js +377 -0
- package/dist/dist-es-LDE437AM.js +170 -0
- package/dist/dist-es-P26FWFLT.js +485 -0
- package/dist/dist-es-Q57SZXZ7.js +70 -0
- package/dist/dist-es-R7FGL2IB.js +88 -0
- package/dist/dist-es-USORBXZ5.js +318 -0
- package/dist/dist-es-ZKC2QKD2.js +377 -0
- package/dist/drizzle/0076_scheduled_jobs_marco_backfill.sql +2 -1
- package/dist/drizzle/0079_seed_tenant_customize_catalog.sql +1 -0
- package/dist/drizzle/0090_brain_schema_extraction.sql +10 -0
- package/dist/drizzle/0132_drop_computer_tables.sql +3 -0
- package/dist/drizzle/0160_compliance_event_types_plugins.sql +2 -0
- package/dist/drizzle/0214_think137_drop_judge_evidence_roi.sql +1 -0
- package/dist/drizzle/0216_drop_agent_loop_versions_goal_worker_policy.sql +1 -0
- package/dist/drizzle/0227_analyst_reader_role.sql +106 -38
- package/dist/drizzle/0230_analyst_rls.sql +192 -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 +576 -0
- package/dist/drizzle/0251_agents_json_render_ui.sql +25 -0
- package/dist/drizzle/0251_brain_stragglers.sql +263 -0
- package/dist/drizzle/0252_drop_kg_and_straggler_compat_views.sql +100 -0
- package/dist/drizzle/0253_drop_brain_substrate.sql +93 -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_agents_runtime_allow_harness.sql +24 -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_managed_harness_multiplayer.sql +313 -0
- package/dist/drizzle/0261_native_auth_control_plane.sql +328 -0
- package/dist/drizzle/0262_auth_subscription_tickets.sql +59 -0
- package/dist/drizzle/0262_parallel_harness_threads.sql +9 -0
- package/dist/drizzle/0263_agentcore_runtime_identifier.sql +69 -0
- package/dist/drizzle/0263_drop_workos_auth_runtime.sql +236 -0
- package/dist/drizzle/0264_auth_enrollment_attempt_limits.sql +15 -0
- package/dist/drizzle/0264_harness_tool_execution_ledger.sql +113 -0
- package/dist/drizzle/0265_eval_runs_requester_identity.sql +28 -0
- package/dist/drizzle/0265_require_fully_valid_auth_publication.sql +27 -0
- package/dist/drizzle/0266_auth_identity_recovery_grants.sql +9 -0
- package/dist/drizzle/0266_eval_profiles_runtime_type.sql +12 -0
- package/dist/drizzle/0267_ontology_candidate_rejections.sql +53 -0
- package/dist/drizzle/0268_identity_crosswalk_routing.sql +182 -0
- package/dist/drizzle/0269_ontology_system_map.sql +31 -0
- package/dist/event-streams-7JNLJEEL.js +894 -0
- package/dist/event-streams-KDF5RWR6.js +1515 -0
- package/dist/loadSso-DJVB7BXE.js +576 -0
- package/dist/loadSso-JAMNA3WY.js +583 -0
- package/dist/plugins/catalog/package.json +1 -2
- package/dist/plugins/catalog/src/__tests__/build-catalog.test.ts +0 -1
- package/dist/plugins/catalog/src/__tests__/contracts.test.ts +0 -69
- package/dist/plugins/catalog/src/__tests__/plugin-package.test.ts +0 -2
- package/dist/plugins/catalog/src/__tests__/plugin-registry.test.ts +0 -5
- package/dist/plugins/catalog/src/contracts.ts +2 -179
- package/dist/plugins/catalog/src/registry/generated-first-party.ts +0 -6
- package/dist/signin-UGDWTGS4.js +821 -0
- package/dist/sso-oidc-Q4VXANXY.js +837 -0
- package/dist/sts-CWLSE3GH.js +1241 -0
- package/dist/sts-DNZLNVOV.js +1245 -0
- package/dist/terraform/examples/greenfield/main.tf +247 -50
- package/dist/terraform/examples/greenfield/terraform.tfvars.example +15 -1
- 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-gateway/main.tf +305 -0
- package/dist/terraform/modules/app/agentcore-gateway/outputs.tf +44 -0
- package/dist/terraform/modules/app/agentcore-gateway/scripts/delete_gateway.sh +93 -0
- package/dist/terraform/modules/app/agentcore-gateway/scripts/read_gateway.sh +33 -0
- package/dist/terraform/modules/app/agentcore-gateway/scripts/reconcile_gateway.sh +543 -0
- package/dist/terraform/modules/app/agentcore-gateway/variables.tf +70 -0
- package/dist/terraform/modules/app/agentcore-harness/main.tf +330 -0
- package/dist/terraform/modules/app/agentcore-harness/outputs.tf +72 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/delete_harness.sh +5 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/harness-lifecycle.mjs +430 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/harness-readback.mjs +180 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/harness-tool-contract.mjs +193 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/prune_harness.sh +5 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/read_harness.sh +5 -0
- package/dist/terraform/modules/app/agentcore-harness/scripts/reconcile_harness.sh +5 -0
- package/dist/terraform/modules/app/agentcore-harness/variables.tf +96 -0
- package/dist/terraform/modules/app/agentcore-identity/main.tf +173 -0
- package/dist/terraform/modules/app/agentcore-identity/outputs.tf +51 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/bootstrap_twenty_oauth_client.sh +122 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_identity.sh +25 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_twenty_identity.sh +16 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/read_identity.sh +40 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_identity.sh +73 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_identity.sh +74 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_provider.mjs +61 -0
- package/dist/terraform/modules/app/agentcore-identity/variables.tf +54 -0
- package/dist/terraform/modules/app/agentcore-pi/main.tf +7 -0
- package/dist/terraform/modules/app/appsync-subscriptions/main.tf +127 -21
- package/dist/terraform/modules/app/appsync-subscriptions/outputs.tf +0 -6
- package/dist/terraform/modules/app/appsync-subscriptions/variables.tf +5 -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 +1011 -31
- package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +655 -2
- package/dist/terraform/modules/app/lambda-api/agentcore-harness-alarms.tf +88 -0
- package/dist/terraform/modules/app/lambda-api/agentcore-identity-alarms.tf +91 -0
- package/dist/terraform/modules/app/lambda-api/capability-search-alarms.tf +60 -0
- package/dist/terraform/modules/app/lambda-api/handlers.tf +606 -37
- package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +192 -21
- package/dist/terraform/modules/app/lambda-api/main.tf +35 -0
- package/dist/terraform/modules/app/lambda-api/mcp-oauth.tf +181 -4
- 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/outputs.tf +35 -0
- package/dist/terraform/modules/app/lambda-api/runtime-config.tf +3 -21
- package/dist/terraform/modules/app/lambda-api/variables.tf +188 -3
- 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 +319 -73
- package/dist/terraform/modules/foundation/cognito/outputs.tf +42 -0
- package/dist/terraform/modules/foundation/cognito/variables.tf +124 -2
- package/dist/terraform/modules/foundation/vpc/outputs.tf +5 -0
- package/dist/terraform/modules/thinkwork/main.tf +396 -26
- package/dist/terraform/modules/thinkwork/outputs.tf +188 -5
- package/dist/terraform/modules/thinkwork/variables.tf +154 -5
- package/dist/terraform/schema.graphql +69 -36
- package/dist/workspace-defaults/files/TOOLS.md +39 -0
- package/dist/workspace-defaults/files/USER.md +1 -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 +6 -3
- package/dist/plugins/workos-auth/package.json +0 -22
- package/dist/plugins/workos-auth/src/index.ts +0 -30
- package/dist/plugins/workos-auth/src/manifest.ts +0 -40
- package/dist/plugins/workos-auth/src/provider-contract.ts +0 -39
- package/dist/plugins/workos-auth/test/manifest.test.ts +0 -94
- package/dist/plugins/workos-auth/tsconfig.json +0 -8
- /package/dist/workspace-defaults/files/{AGENTS.md → INSTRUCTIONS.md} +0 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CredentialsProviderError,
|
|
4
|
+
ProviderError,
|
|
5
|
+
loadConfig,
|
|
6
|
+
parseUrl
|
|
7
|
+
} from "./chunk-XYM7PE2A.js";
|
|
8
|
+
import "./chunk-OCPHU34C.js";
|
|
9
|
+
import "./chunk-DV3MRBR5.js";
|
|
10
|
+
|
|
11
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js
|
|
12
|
+
var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string";
|
|
13
|
+
var fromImdsCredentials = (creds) => ({
|
|
14
|
+
accessKeyId: creds.AccessKeyId,
|
|
15
|
+
secretAccessKey: creds.SecretAccessKey,
|
|
16
|
+
sessionToken: creds.Token,
|
|
17
|
+
expiration: new Date(creds.Expiration),
|
|
18
|
+
...creds.AccountId && { accountId: creds.AccountId }
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js
|
|
22
|
+
var DEFAULT_TIMEOUT = 1e3;
|
|
23
|
+
var DEFAULT_MAX_RETRIES = 0;
|
|
24
|
+
var providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout });
|
|
25
|
+
|
|
26
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js
|
|
27
|
+
import node_http from "http";
|
|
28
|
+
|
|
29
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
|
|
30
|
+
function httpRequest(options) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const req = node_http.request({
|
|
33
|
+
method: "GET",
|
|
34
|
+
...options,
|
|
35
|
+
hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1")
|
|
36
|
+
});
|
|
37
|
+
req.on("error", (err) => {
|
|
38
|
+
reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
|
|
39
|
+
req.destroy();
|
|
40
|
+
});
|
|
41
|
+
req.on("timeout", () => {
|
|
42
|
+
reject(new ProviderError("TimeoutError from instance metadata service"));
|
|
43
|
+
req.destroy();
|
|
44
|
+
});
|
|
45
|
+
req.on("response", (res) => {
|
|
46
|
+
const { statusCode = 400 } = res;
|
|
47
|
+
if (statusCode < 200 || 300 <= statusCode) {
|
|
48
|
+
reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode }));
|
|
49
|
+
req.destroy();
|
|
50
|
+
}
|
|
51
|
+
const chunks = [];
|
|
52
|
+
res.on("data", (chunk) => {
|
|
53
|
+
chunks.push(chunk);
|
|
54
|
+
});
|
|
55
|
+
res.on("end", () => {
|
|
56
|
+
resolve(Buffer.concat(chunks));
|
|
57
|
+
req.destroy();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
req.end();
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js
|
|
65
|
+
var retry = (toRetry, maxRetries) => {
|
|
66
|
+
let promise = toRetry();
|
|
67
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
68
|
+
promise = promise.catch(toRetry);
|
|
69
|
+
}
|
|
70
|
+
return promise;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js
|
|
74
|
+
var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
|
|
75
|
+
var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
|
|
76
|
+
var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
|
|
77
|
+
var fromContainerMetadata = (init = {}) => {
|
|
78
|
+
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
79
|
+
return () => retry(async () => {
|
|
80
|
+
const requestOptions = await getCmdsUri({ logger: init.logger });
|
|
81
|
+
const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
|
|
82
|
+
if (!isImdsCredentials(credsResponse)) {
|
|
83
|
+
throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
|
|
84
|
+
logger: init.logger
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return fromImdsCredentials(credsResponse);
|
|
88
|
+
}, maxRetries);
|
|
89
|
+
};
|
|
90
|
+
var requestFromEcsImds = async (timeout, options) => {
|
|
91
|
+
if (process.env[ENV_CMDS_AUTH_TOKEN]) {
|
|
92
|
+
options.headers = {
|
|
93
|
+
...options.headers,
|
|
94
|
+
Authorization: process.env[ENV_CMDS_AUTH_TOKEN]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const buffer = await httpRequest({
|
|
98
|
+
...options,
|
|
99
|
+
timeout
|
|
100
|
+
});
|
|
101
|
+
return buffer.toString();
|
|
102
|
+
};
|
|
103
|
+
var CMDS_IP = "169.254.170.2";
|
|
104
|
+
var GREENGRASS_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]);
|
|
105
|
+
var GREENGRASS_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
106
|
+
var getCmdsUri = async ({ logger }) => {
|
|
107
|
+
if (process.env[ENV_CMDS_RELATIVE_URI]) {
|
|
108
|
+
return {
|
|
109
|
+
hostname: CMDS_IP,
|
|
110
|
+
path: process.env[ENV_CMDS_RELATIVE_URI]
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (process.env[ENV_CMDS_FULL_URI]) {
|
|
114
|
+
let parsed;
|
|
115
|
+
try {
|
|
116
|
+
parsed = new URL(process.env[ENV_CMDS_FULL_URI]);
|
|
117
|
+
} catch {
|
|
118
|
+
throw new CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger });
|
|
119
|
+
}
|
|
120
|
+
if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) {
|
|
121
|
+
throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
122
|
+
tryNextLink: false,
|
|
123
|
+
logger
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) {
|
|
127
|
+
throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
|
|
128
|
+
tryNextLink: false,
|
|
129
|
+
logger
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
protocol: parsed.protocol,
|
|
134
|
+
hostname: parsed.hostname,
|
|
135
|
+
path: parsed.pathname + parsed.search,
|
|
136
|
+
port: parsed.port ? parseInt(parsed.port, 10) : void 0
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
throw new CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, {
|
|
140
|
+
tryNextLink: false,
|
|
141
|
+
logger
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js
|
|
146
|
+
var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends CredentialsProviderError {
|
|
147
|
+
tryNextLink;
|
|
148
|
+
name = "InstanceMetadataV1FallbackError";
|
|
149
|
+
constructor(message, tryNextLink = true) {
|
|
150
|
+
super(message, tryNextLink);
|
|
151
|
+
this.tryNextLink = tryNextLink;
|
|
152
|
+
Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js
|
|
157
|
+
var Endpoint;
|
|
158
|
+
(function(Endpoint2) {
|
|
159
|
+
Endpoint2["IPv4"] = "http://169.254.169.254";
|
|
160
|
+
Endpoint2["IPv6"] = "http://[fd00:ec2::254]";
|
|
161
|
+
})(Endpoint || (Endpoint = {}));
|
|
162
|
+
|
|
163
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js
|
|
164
|
+
var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
|
|
165
|
+
var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
|
|
166
|
+
var ENDPOINT_CONFIG_OPTIONS = {
|
|
167
|
+
environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],
|
|
168
|
+
configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],
|
|
169
|
+
default: void 0
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js
|
|
173
|
+
var EndpointMode;
|
|
174
|
+
(function(EndpointMode2) {
|
|
175
|
+
EndpointMode2["IPv4"] = "IPv4";
|
|
176
|
+
EndpointMode2["IPv6"] = "IPv6";
|
|
177
|
+
})(EndpointMode || (EndpointMode = {}));
|
|
178
|
+
|
|
179
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js
|
|
180
|
+
var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
|
|
181
|
+
var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
|
|
182
|
+
var ENDPOINT_MODE_CONFIG_OPTIONS = {
|
|
183
|
+
environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],
|
|
184
|
+
configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],
|
|
185
|
+
default: EndpointMode.IPv4
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js
|
|
189
|
+
var getInstanceMetadataEndpoint = async () => parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig());
|
|
190
|
+
var getFromEndpointConfig = async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)();
|
|
191
|
+
var getFromEndpointModeConfig = async () => {
|
|
192
|
+
const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
|
|
193
|
+
switch (endpointMode) {
|
|
194
|
+
case EndpointMode.IPv4:
|
|
195
|
+
return Endpoint.IPv4;
|
|
196
|
+
case EndpointMode.IPv6:
|
|
197
|
+
return Endpoint.IPv6;
|
|
198
|
+
default:
|
|
199
|
+
throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js
|
|
204
|
+
var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
|
|
205
|
+
var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
|
|
206
|
+
var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
|
|
207
|
+
var getExtendedInstanceMetadataCredentials = (credentials, logger) => {
|
|
208
|
+
const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
|
|
209
|
+
const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
|
|
210
|
+
logger.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
|
|
211
|
+
For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
212
|
+
const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
|
|
213
|
+
return {
|
|
214
|
+
...credentials,
|
|
215
|
+
...originalExpiration ? { originalExpiration } : {},
|
|
216
|
+
expiration: newExpiration
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js
|
|
221
|
+
var staticStabilityProvider = (provider, options = {}) => {
|
|
222
|
+
const logger = options?.logger || console;
|
|
223
|
+
let pastCredentials;
|
|
224
|
+
return async () => {
|
|
225
|
+
let credentials;
|
|
226
|
+
try {
|
|
227
|
+
credentials = await provider();
|
|
228
|
+
if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
|
|
229
|
+
credentials = getExtendedInstanceMetadataCredentials(credentials, logger);
|
|
230
|
+
}
|
|
231
|
+
} catch (e) {
|
|
232
|
+
if (pastCredentials) {
|
|
233
|
+
logger.warn("Credential renew failed: ", e);
|
|
234
|
+
credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);
|
|
235
|
+
} else {
|
|
236
|
+
throw e;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
pastCredentials = credentials;
|
|
240
|
+
return credentials;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js
|
|
245
|
+
var IMDS_PATH = "/latest/meta-data/iam/security-credentials/";
|
|
246
|
+
var IMDS_TOKEN_PATH = "/latest/api/token";
|
|
247
|
+
var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED";
|
|
248
|
+
var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled";
|
|
249
|
+
var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
|
|
250
|
+
var fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });
|
|
251
|
+
var getInstanceMetadataProvider = (init = {}) => {
|
|
252
|
+
let disableFetchToken = false;
|
|
253
|
+
const { logger, profile } = init;
|
|
254
|
+
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
255
|
+
const getCredentials = async (maxRetries2, options) => {
|
|
256
|
+
const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
|
|
257
|
+
if (isImdsV1Fallback) {
|
|
258
|
+
let fallbackBlockedFromProfile = false;
|
|
259
|
+
let fallbackBlockedFromProcessEnv = false;
|
|
260
|
+
const configValue = await loadConfig({
|
|
261
|
+
environmentVariableSelector: (env) => {
|
|
262
|
+
const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
|
|
263
|
+
fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
|
|
264
|
+
if (envValue === void 0) {
|
|
265
|
+
throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });
|
|
266
|
+
}
|
|
267
|
+
return fallbackBlockedFromProcessEnv;
|
|
268
|
+
},
|
|
269
|
+
configFileSelector: (profile2) => {
|
|
270
|
+
const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
|
|
271
|
+
fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
|
|
272
|
+
return fallbackBlockedFromProfile;
|
|
273
|
+
},
|
|
274
|
+
default: false
|
|
275
|
+
}, {
|
|
276
|
+
profile
|
|
277
|
+
})();
|
|
278
|
+
if (init.ec2MetadataV1Disabled || configValue) {
|
|
279
|
+
const causes = [];
|
|
280
|
+
if (init.ec2MetadataV1Disabled)
|
|
281
|
+
causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
|
|
282
|
+
if (fallbackBlockedFromProfile)
|
|
283
|
+
causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
|
|
284
|
+
if (fallbackBlockedFromProcessEnv)
|
|
285
|
+
causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
|
|
286
|
+
throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const imdsProfile = (await retry(async () => {
|
|
290
|
+
let profile2;
|
|
291
|
+
try {
|
|
292
|
+
profile2 = await getProfile(options);
|
|
293
|
+
} catch (err) {
|
|
294
|
+
if (err.statusCode === 401) {
|
|
295
|
+
disableFetchToken = false;
|
|
296
|
+
}
|
|
297
|
+
throw err;
|
|
298
|
+
}
|
|
299
|
+
return profile2;
|
|
300
|
+
}, maxRetries2)).trim();
|
|
301
|
+
return retry(async () => {
|
|
302
|
+
let creds;
|
|
303
|
+
try {
|
|
304
|
+
creds = await getCredentialsFromProfile(imdsProfile, options, init);
|
|
305
|
+
} catch (err) {
|
|
306
|
+
if (err.statusCode === 401) {
|
|
307
|
+
disableFetchToken = false;
|
|
308
|
+
}
|
|
309
|
+
throw err;
|
|
310
|
+
}
|
|
311
|
+
return creds;
|
|
312
|
+
}, maxRetries2);
|
|
313
|
+
};
|
|
314
|
+
return async () => {
|
|
315
|
+
const endpoint = await getInstanceMetadataEndpoint();
|
|
316
|
+
if (disableFetchToken) {
|
|
317
|
+
logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
|
|
318
|
+
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
319
|
+
} else {
|
|
320
|
+
let token;
|
|
321
|
+
try {
|
|
322
|
+
token = (await getMetadataToken({ ...endpoint, timeout })).toString();
|
|
323
|
+
} catch (error) {
|
|
324
|
+
if (error?.statusCode === 400) {
|
|
325
|
+
throw Object.assign(error, {
|
|
326
|
+
message: "EC2 Metadata token request returned error"
|
|
327
|
+
});
|
|
328
|
+
} else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) {
|
|
329
|
+
disableFetchToken = true;
|
|
330
|
+
}
|
|
331
|
+
logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
|
|
332
|
+
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
333
|
+
}
|
|
334
|
+
return getCredentials(maxRetries, {
|
|
335
|
+
...endpoint,
|
|
336
|
+
headers: {
|
|
337
|
+
[X_AWS_EC2_METADATA_TOKEN]: token
|
|
338
|
+
},
|
|
339
|
+
timeout
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
var getMetadataToken = async (options) => httpRequest({
|
|
345
|
+
...options,
|
|
346
|
+
path: IMDS_TOKEN_PATH,
|
|
347
|
+
method: "PUT",
|
|
348
|
+
headers: {
|
|
349
|
+
"x-aws-ec2-metadata-token-ttl-seconds": "21600"
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
var getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();
|
|
353
|
+
var getCredentialsFromProfile = async (profile, options, init) => {
|
|
354
|
+
const credentialsResponse = JSON.parse((await httpRequest({
|
|
355
|
+
...options,
|
|
356
|
+
path: IMDS_PATH + profile
|
|
357
|
+
})).toString());
|
|
358
|
+
if (!isImdsCredentials(credentialsResponse)) {
|
|
359
|
+
throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
|
|
360
|
+
logger: init.logger
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
return fromImdsCredentials(credentialsResponse);
|
|
364
|
+
};
|
|
365
|
+
export {
|
|
366
|
+
DEFAULT_MAX_RETRIES,
|
|
367
|
+
DEFAULT_TIMEOUT,
|
|
368
|
+
ENV_CMDS_AUTH_TOKEN,
|
|
369
|
+
ENV_CMDS_FULL_URI,
|
|
370
|
+
ENV_CMDS_RELATIVE_URI,
|
|
371
|
+
Endpoint,
|
|
372
|
+
fromContainerMetadata,
|
|
373
|
+
fromInstanceMetadata,
|
|
374
|
+
getInstanceMetadataEndpoint,
|
|
375
|
+
httpRequest,
|
|
376
|
+
providerConfigFromInit
|
|
377
|
+
};
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
--
|
|
19
19
|
-- Idempotent: re-running with the same :computer_id is a no-op.
|
|
20
20
|
--
|
|
21
|
-
--
|
|
21
|
+
-- data-only-migration
|
|
22
|
+
-- This is a data backfill, not a schema change.
|
|
22
23
|
|
|
23
24
|
\set ON_ERROR_STOP on
|
|
24
25
|
|
|
@@ -60,6 +60,16 @@
|
|
|
60
60
|
--
|
|
61
61
|
-- Markers (consumed by scripts/db-migrate-manual.sh):
|
|
62
62
|
--
|
|
63
|
+
-- moves-owner: public.tenant_entity_pages -> brain.pages
|
|
64
|
+
-- moves-owner: public.tenant_entity_page_sections -> brain.page_sections
|
|
65
|
+
-- moves-owner: public.tenant_entity_page_links -> brain.page_links
|
|
66
|
+
-- moves-owner: public.tenant_entity_page_aliases -> brain.page_aliases
|
|
67
|
+
-- moves-owner: public.tenant_entity_section_sources -> brain.section_sources
|
|
68
|
+
-- moves-owner: public.tenant_entity_external_refs -> brain.external_refs
|
|
69
|
+
-- drops: public.uq_tenant_entity_pages_tenant_type_subtype_slug
|
|
70
|
+
-- drops: public.idx_tenant_entity_pages_search_tsv
|
|
71
|
+
-- drops: public.uq_tenant_entity_section_sources_section_kind_ref
|
|
72
|
+
-- creates-trigger: brain.section_sources.trg_tenant_entity_section_sources_tenant
|
|
63
73
|
-- creates: brain.pages
|
|
64
74
|
-- creates: brain.page_sections
|
|
65
75
|
-- creates: brain.page_links
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
-- drops: public.computer_assignments
|
|
5
5
|
-- drops: public.computer_snapshots
|
|
6
6
|
-- drops: public.computers
|
|
7
|
+
-- drops-constraint: public.eval_runs.eval_runs_computer_id_computers_id_fk
|
|
8
|
+
-- drops-constraint: public.thread_idle_learning_state.thread_idle_learning_state_computer_id_computers_id_fk
|
|
9
|
+
-- drops-constraint: public.thread_idle_learning_runs.thread_idle_learning_runs_computer_id_computers_id_fk
|
|
7
10
|
--
|
|
8
11
|
-- Kill the legacy Computer feature. All product surfaces (admin, Spaces,
|
|
9
12
|
-- mobile, CLI), Lambda handlers (computer-runtime, computer-manager,
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
--
|
|
16
16
|
-- creates-constraint: compliance.audit_outbox.audit_outbox_event_type_prefix_v3
|
|
17
17
|
-- creates-constraint: compliance.audit_events.audit_events_event_type_prefix_v3
|
|
18
|
+
-- drops-constraint: compliance.audit_outbox.audit_outbox_event_type_prefix_v2
|
|
19
|
+
-- drops-constraint: compliance.audit_events.audit_events_event_type_prefix_v2
|
|
18
20
|
|
|
19
21
|
BEGIN;
|
|
20
22
|
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
-- drops-column: public.agent_loops.cost_per_accepted_run_usd_cents
|
|
49
49
|
-- drops-column: public.agent_loop_versions.judge_spec
|
|
50
50
|
-- drops-column: public.agent_loop_versions.evidence_policy
|
|
51
|
+
-- drops: public.view_agent_loop_versions_judge_evidence_nullable
|
|
51
52
|
|
|
52
53
|
\set ON_ERROR_STOP on
|
|
53
54
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
-- drops-column: public.agent_loop_versions.worker_spec
|
|
28
28
|
-- drops-column: public.agent_loop_versions.loop_policy
|
|
29
29
|
-- creates: public.view_agent_loop_versions_target_spec_required
|
|
30
|
+
-- drops: public.view_agent_loop_versions_goal_worker_policy_nullable
|
|
30
31
|
|
|
31
32
|
\set ON_ERROR_STOP on
|
|
32
33
|
|
|
@@ -325,26 +325,41 @@ BEGIN
|
|
|
325
325
|
ELSE
|
|
326
326
|
missing := missing || 'billing_export_line_items'::text;
|
|
327
327
|
END IF;
|
|
328
|
-
IF to_regclass('public.
|
|
329
|
-
GRANT SELECT ON public.
|
|
328
|
+
IF to_regclass('public.budget_policies') IS NOT NULL THEN
|
|
329
|
+
GRANT SELECT ON public.budget_policies TO analyst_reader;
|
|
330
330
|
ELSE
|
|
331
|
-
missing := missing || '
|
|
331
|
+
missing := missing || 'budget_policies'::text;
|
|
332
332
|
END IF;
|
|
333
|
-
IF to_regclass('public.
|
|
334
|
-
GRANT SELECT ON public.
|
|
333
|
+
IF to_regclass('public.capability_broker_calls') IS NOT NULL THEN
|
|
334
|
+
GRANT SELECT ON public.capability_broker_calls TO analyst_reader;
|
|
335
335
|
ELSE
|
|
336
|
-
missing := missing || '
|
|
336
|
+
missing := missing || 'capability_broker_calls'::text;
|
|
337
337
|
END IF;
|
|
338
|
-
IF to_regclass('public.
|
|
339
|
-
GRANT SELECT ON public.
|
|
338
|
+
IF to_regclass('public.capability_broker_sessions') IS NOT NULL THEN
|
|
339
|
+
GRANT SELECT ON public.capability_broker_sessions TO analyst_reader;
|
|
340
340
|
ELSE
|
|
341
|
-
missing := missing || '
|
|
341
|
+
missing := missing || 'capability_broker_sessions'::text;
|
|
342
342
|
END IF;
|
|
343
343
|
IF to_regclass('public.capability_catalog') IS NOT NULL THEN
|
|
344
344
|
GRANT SELECT ON public.capability_catalog TO analyst_reader;
|
|
345
345
|
ELSE
|
|
346
346
|
missing := missing || 'capability_catalog'::text;
|
|
347
347
|
END IF;
|
|
348
|
+
IF to_regclass('public.capability_connection_proposals') IS NOT NULL THEN
|
|
349
|
+
GRANT SELECT ON public.capability_connection_proposals TO analyst_reader;
|
|
350
|
+
ELSE
|
|
351
|
+
missing := missing || 'capability_connection_proposals'::text;
|
|
352
|
+
END IF;
|
|
353
|
+
IF to_regclass('public.capability_definitions') IS NOT NULL THEN
|
|
354
|
+
GRANT SELECT ON public.capability_definitions TO analyst_reader;
|
|
355
|
+
ELSE
|
|
356
|
+
missing := missing || 'capability_definitions'::text;
|
|
357
|
+
END IF;
|
|
358
|
+
IF to_regclass('public.capability_routine_proposals') IS NOT NULL THEN
|
|
359
|
+
GRANT SELECT ON public.capability_routine_proposals TO analyst_reader;
|
|
360
|
+
ELSE
|
|
361
|
+
missing := missing || 'capability_routine_proposals'::text;
|
|
362
|
+
END IF;
|
|
348
363
|
IF to_regclass('public.connections') IS NOT NULL THEN
|
|
349
364
|
GRANT SELECT ON public.connections TO analyst_reader;
|
|
350
365
|
ELSE
|
|
@@ -495,6 +510,12 @@ BEGIN
|
|
|
495
510
|
ELSE
|
|
496
511
|
missing := missing || 'guardrails'::text;
|
|
497
512
|
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;
|
|
498
519
|
IF to_regclass('public.inbox_item_comments') IS NOT NULL THEN
|
|
499
520
|
GRANT SELECT ON public.inbox_item_comments TO analyst_reader;
|
|
500
521
|
ELSE
|
|
@@ -510,36 +531,16 @@ BEGIN
|
|
|
510
531
|
ELSE
|
|
511
532
|
missing := missing || 'inbox_items'::text;
|
|
512
533
|
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;
|
|
513
539
|
IF to_regclass('public.knowledge_bases') IS NOT NULL THEN
|
|
514
540
|
GRANT SELECT ON public.knowledge_bases TO analyst_reader;
|
|
515
541
|
ELSE
|
|
516
542
|
missing := missing || 'knowledge_bases'::text;
|
|
517
543
|
END IF;
|
|
518
|
-
IF to_regclass('public.knowledge_graph_entities') IS NOT NULL THEN
|
|
519
|
-
GRANT SELECT ON public.knowledge_graph_entities TO analyst_reader;
|
|
520
|
-
ELSE
|
|
521
|
-
missing := missing || 'knowledge_graph_entities'::text;
|
|
522
|
-
END IF;
|
|
523
|
-
IF to_regclass('public.knowledge_graph_evidence') IS NOT NULL THEN
|
|
524
|
-
GRANT SELECT ON public.knowledge_graph_evidence TO analyst_reader;
|
|
525
|
-
ELSE
|
|
526
|
-
missing := missing || 'knowledge_graph_evidence'::text;
|
|
527
|
-
END IF;
|
|
528
|
-
IF to_regclass('public.knowledge_graph_ingest_runs') IS NOT NULL THEN
|
|
529
|
-
GRANT SELECT ON public.knowledge_graph_ingest_runs TO analyst_reader;
|
|
530
|
-
ELSE
|
|
531
|
-
missing := missing || 'knowledge_graph_ingest_runs'::text;
|
|
532
|
-
END IF;
|
|
533
|
-
IF to_regclass('public.knowledge_graph_observation_cursors') IS NOT NULL THEN
|
|
534
|
-
GRANT SELECT ON public.knowledge_graph_observation_cursors TO analyst_reader;
|
|
535
|
-
ELSE
|
|
536
|
-
missing := missing || 'knowledge_graph_observation_cursors'::text;
|
|
537
|
-
END IF;
|
|
538
|
-
IF to_regclass('public.knowledge_graph_relationships') IS NOT NULL THEN
|
|
539
|
-
GRANT SELECT ON public.knowledge_graph_relationships TO analyst_reader;
|
|
540
|
-
ELSE
|
|
541
|
-
missing := missing || 'knowledge_graph_relationships'::text;
|
|
542
|
-
END IF;
|
|
543
544
|
IF to_regclass('public.linked_task_events') IS NOT NULL THEN
|
|
544
545
|
GRANT SELECT ON public.linked_task_events TO analyst_reader;
|
|
545
546
|
ELSE
|
|
@@ -565,10 +566,57 @@ BEGIN
|
|
|
565
566
|
ELSE
|
|
566
567
|
missing := missing || 'managed_applications'::text;
|
|
567
568
|
END IF;
|
|
568
|
-
IF to_regclass('public.
|
|
569
|
-
GRANT SELECT ON public.
|
|
569
|
+
IF to_regclass('public.memory_claim_evidence') IS NOT NULL THEN
|
|
570
|
+
GRANT SELECT ON public.memory_claim_evidence TO analyst_reader;
|
|
570
571
|
ELSE
|
|
571
|
-
missing := missing || '
|
|
572
|
+
missing := missing || 'memory_claim_evidence'::text;
|
|
573
|
+
END IF;
|
|
574
|
+
IF to_regclass('public.memory_claims') IS NOT NULL THEN
|
|
575
|
+
REVOKE ALL PRIVILEGES ON public.memory_claims FROM analyst_reader;
|
|
576
|
+
GRANT SELECT (canonical_subject_id, conflict_state, created_at, effective_from, effective_to, extraction_version, id, ontology_predicate, status, subject_entity_type, subject_key, target_id, target_scope, tenant_id, updated_at, value_hash) ON public.memory_claims TO analyst_reader;
|
|
577
|
+
ELSE
|
|
578
|
+
missing := missing || 'memory_claims'::text;
|
|
579
|
+
END IF;
|
|
580
|
+
IF to_regclass('public.memory_derivations') IS NOT NULL THEN
|
|
581
|
+
GRANT SELECT ON public.memory_derivations TO analyst_reader;
|
|
582
|
+
ELSE
|
|
583
|
+
missing := missing || 'memory_derivations'::text;
|
|
584
|
+
END IF;
|
|
585
|
+
IF to_regclass('public.memory_evidence_items') IS NOT NULL THEN
|
|
586
|
+
REVOKE ALL PRIVILEGES ON public.memory_evidence_items FROM analyst_reader;
|
|
587
|
+
GRANT SELECT (acquisition_run_id, content_hash, created_at, extraction_recipe, id, last_error, lifecycle, sensitivity, snapshot_expires_at, snapshot_ref, source_config_id, source_item_id, source_timestamp, source_version, target_id, target_scope, tenant_id, updated_at) ON public.memory_evidence_items TO analyst_reader;
|
|
588
|
+
ELSE
|
|
589
|
+
missing := missing || 'memory_evidence_items'::text;
|
|
590
|
+
END IF;
|
|
591
|
+
IF to_regclass('public.memory_processor_configs') IS NOT NULL THEN
|
|
592
|
+
GRANT SELECT ON public.memory_processor_configs TO analyst_reader;
|
|
593
|
+
ELSE
|
|
594
|
+
missing := missing || 'memory_processor_configs'::text;
|
|
595
|
+
END IF;
|
|
596
|
+
IF to_regclass('public.memory_retraction_attempts') IS NOT NULL THEN
|
|
597
|
+
GRANT SELECT ON public.memory_retraction_attempts TO analyst_reader;
|
|
598
|
+
ELSE
|
|
599
|
+
missing := missing || 'memory_retraction_attempts'::text;
|
|
600
|
+
END IF;
|
|
601
|
+
IF to_regclass('public.memory_run_items') IS NOT NULL THEN
|
|
602
|
+
GRANT SELECT ON public.memory_run_items TO analyst_reader;
|
|
603
|
+
ELSE
|
|
604
|
+
missing := missing || 'memory_run_items'::text;
|
|
605
|
+
END IF;
|
|
606
|
+
IF to_regclass('public.memory_source_authorizations') IS NOT NULL THEN
|
|
607
|
+
GRANT SELECT ON public.memory_source_authorizations TO analyst_reader;
|
|
608
|
+
ELSE
|
|
609
|
+
missing := missing || 'memory_source_authorizations'::text;
|
|
610
|
+
END IF;
|
|
611
|
+
IF to_regclass('public.memory_source_checkpoints') IS NOT NULL THEN
|
|
612
|
+
GRANT SELECT ON public.memory_source_checkpoints TO analyst_reader;
|
|
613
|
+
ELSE
|
|
614
|
+
missing := missing || 'memory_source_checkpoints'::text;
|
|
615
|
+
END IF;
|
|
616
|
+
IF to_regclass('public.memory_source_configs') IS NOT NULL THEN
|
|
617
|
+
GRANT SELECT ON public.memory_source_configs TO analyst_reader;
|
|
618
|
+
ELSE
|
|
619
|
+
missing := missing || 'memory_source_configs'::text;
|
|
572
620
|
END IF;
|
|
573
621
|
IF to_regclass('public.message_artifacts') IS NOT NULL THEN
|
|
574
622
|
GRANT SELECT ON public.message_artifacts TO analyst_reader;
|
|
@@ -590,6 +638,21 @@ BEGIN
|
|
|
590
638
|
ELSE
|
|
591
639
|
missing := missing || 'model_catalog'::text;
|
|
592
640
|
END IF;
|
|
641
|
+
IF to_regclass('public.msteams_tenant_installs') IS NOT NULL THEN
|
|
642
|
+
GRANT SELECT ON public.msteams_tenant_installs TO analyst_reader;
|
|
643
|
+
ELSE
|
|
644
|
+
missing := missing || 'msteams_tenant_installs'::text;
|
|
645
|
+
END IF;
|
|
646
|
+
IF to_regclass('public.msteams_threads') IS NOT NULL THEN
|
|
647
|
+
GRANT SELECT ON public.msteams_threads TO analyst_reader;
|
|
648
|
+
ELSE
|
|
649
|
+
missing := missing || 'msteams_threads'::text;
|
|
650
|
+
END IF;
|
|
651
|
+
IF to_regclass('public.msteams_user_links') IS NOT NULL THEN
|
|
652
|
+
GRANT SELECT ON public.msteams_user_links TO analyst_reader;
|
|
653
|
+
ELSE
|
|
654
|
+
missing := missing || 'msteams_user_links'::text;
|
|
655
|
+
END IF;
|
|
593
656
|
IF to_regclass('public.mutation_idempotency') IS NOT NULL THEN
|
|
594
657
|
GRANT SELECT ON public.mutation_idempotency TO analyst_reader;
|
|
595
658
|
ELSE
|
|
@@ -697,7 +760,7 @@ BEGIN
|
|
|
697
760
|
END IF;
|
|
698
761
|
IF to_regclass('public.routines') IS NOT NULL THEN
|
|
699
762
|
REVOKE ALL PRIVILEGES ON public.routines FROM analyst_reader;
|
|
700
|
-
GRANT SELECT (agent_id, catalog_slug, config, created_at, current_version, description, disabled_reason, documentation_md, engine, fixture_paths, id, last_run_at, module_path, name, next_run_at, owning_agent_id, schedule, state_machine_alias_arn, state_machine_arn, status, tenant_id, type, updated_at, validated_sha, visibility) ON public.routines TO analyst_reader;
|
|
763
|
+
GRANT SELECT (agent_id, capability_dependencies, catalog_slug, config, created_at, current_version, description, disabled_reason, documentation_md, engine, execution_principal, fixture_paths, id, last_run_at, module_path, name, next_run_at, owning_agent_id, schedule, state_machine_alias_arn, state_machine_arn, status, tenant_id, type, updated_at, validated_sha, visibility) ON public.routines TO analyst_reader;
|
|
701
764
|
ELSE
|
|
702
765
|
missing := missing || 'routines'::text;
|
|
703
766
|
END IF;
|
|
@@ -835,6 +898,11 @@ BEGIN
|
|
|
835
898
|
ELSE
|
|
836
899
|
missing := missing || 'tenant_policy_events'::text;
|
|
837
900
|
END IF;
|
|
901
|
+
IF to_regclass('public.tenant_service_principals') IS NOT NULL THEN
|
|
902
|
+
GRANT SELECT ON public.tenant_service_principals TO analyst_reader;
|
|
903
|
+
ELSE
|
|
904
|
+
missing := missing || 'tenant_service_principals'::text;
|
|
905
|
+
END IF;
|
|
838
906
|
IF to_regclass('public.tenant_settings') IS NOT NULL THEN
|
|
839
907
|
GRANT SELECT ON public.tenant_settings TO analyst_reader;
|
|
840
908
|
ELSE
|