thinkwork-cli 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -1882,8 +1882,7 @@ function registerLoginCommand(program2) {
|
|
|
1882
1882
|
"Sign in. Without --stage: configure AWS credentials (for deploy / destroy). With --stage <s>: sign in to that stack's Cognito / API and cache a session for API-backed commands."
|
|
1883
1883
|
).option(
|
|
1884
1884
|
"--profile <name>",
|
|
1885
|
-
|
|
1886
|
-
"thinkwork"
|
|
1885
|
+
'AWS profile name to configure (used when entering new keys or SSO). Defaults to "thinkwork" only on the AWS-credentials branch; the Cognito branch leaves AWS_PROFILE alone.'
|
|
1887
1886
|
).option("--sso", "Skip the picker and go straight to SSO login").option("--keys", "Skip the picker and go straight to access-key entry").option(
|
|
1888
1887
|
"-s, --stage <name>",
|
|
1889
1888
|
"Sign in to a deployed stack instead of configuring AWS credentials"
|
|
@@ -1964,19 +1963,20 @@ Registered callback URL:
|
|
|
1964
1963
|
});
|
|
1965
1964
|
return;
|
|
1966
1965
|
}
|
|
1967
|
-
|
|
1966
|
+
const targetProfile = opts.profile ?? "thinkwork";
|
|
1967
|
+
printHeader("login", targetProfile);
|
|
1968
1968
|
const awsOk = await ensureAwsCli();
|
|
1969
1969
|
if (!awsOk) process.exit(1);
|
|
1970
1970
|
if (opts.sso) {
|
|
1971
|
-
if (!runSsoLogin(
|
|
1972
|
-
process.env.AWS_PROFILE =
|
|
1973
|
-
finalizeAws(
|
|
1971
|
+
if (!runSsoLogin(targetProfile)) process.exit(1);
|
|
1972
|
+
process.env.AWS_PROFILE = targetProfile;
|
|
1973
|
+
finalizeAws(targetProfile, "SSO");
|
|
1974
1974
|
return;
|
|
1975
1975
|
}
|
|
1976
1976
|
if (opts.keys) {
|
|
1977
|
-
if (!await runKeyEntry(
|
|
1978
|
-
process.env.AWS_PROFILE =
|
|
1979
|
-
finalizeAws(
|
|
1977
|
+
if (!await runKeyEntry(targetProfile)) process.exit(1);
|
|
1978
|
+
process.env.AWS_PROFILE = targetProfile;
|
|
1979
|
+
finalizeAws(targetProfile, "access keys");
|
|
1980
1980
|
return;
|
|
1981
1981
|
}
|
|
1982
1982
|
const profiles = listAwsProfiles();
|
|
@@ -1986,9 +1986,9 @@ Registered callback URL:
|
|
|
1986
1986
|
console.log(
|
|
1987
1987
|
chalk7.dim(" Falling through to access-key entry for a new profile.")
|
|
1988
1988
|
);
|
|
1989
|
-
if (!await runKeyEntry(
|
|
1990
|
-
process.env.AWS_PROFILE =
|
|
1991
|
-
finalizeAws(
|
|
1989
|
+
if (!await runKeyEntry(targetProfile)) process.exit(1);
|
|
1990
|
+
process.env.AWS_PROFILE = targetProfile;
|
|
1991
|
+
finalizeAws(targetProfile, "access keys");
|
|
1992
1992
|
return;
|
|
1993
1993
|
}
|
|
1994
1994
|
const choice = await pickProfile(profiles);
|
|
@@ -1998,15 +1998,15 @@ Registered callback URL:
|
|
|
1998
1998
|
return;
|
|
1999
1999
|
}
|
|
2000
2000
|
if (choice.kind === "keys") {
|
|
2001
|
-
if (!await runKeyEntry(
|
|
2002
|
-
process.env.AWS_PROFILE =
|
|
2003
|
-
finalizeAws(
|
|
2001
|
+
if (!await runKeyEntry(targetProfile)) process.exit(1);
|
|
2002
|
+
process.env.AWS_PROFILE = targetProfile;
|
|
2003
|
+
finalizeAws(targetProfile, "access keys");
|
|
2004
2004
|
return;
|
|
2005
2005
|
}
|
|
2006
2006
|
if (choice.kind === "sso") {
|
|
2007
|
-
if (!runSsoLogin(
|
|
2008
|
-
process.env.AWS_PROFILE =
|
|
2009
|
-
finalizeAws(
|
|
2007
|
+
if (!runSsoLogin(targetProfile)) process.exit(1);
|
|
2008
|
+
process.env.AWS_PROFILE = targetProfile;
|
|
2009
|
+
finalizeAws(targetProfile, "SSO");
|
|
2010
2010
|
return;
|
|
2011
2011
|
}
|
|
2012
2012
|
const picked = choice.name;
|
|
@@ -8243,7 +8243,7 @@ async function runTenantSettingsSet(tenantArg, opts) {
|
|
|
8243
8243
|
input20.autoCloseThreadMinutes = Math.round(Number.parseFloat(opts.autoCloseAfterDays) * 60 * 24);
|
|
8244
8244
|
}
|
|
8245
8245
|
const features = parseFeatureFlags(opts.feature);
|
|
8246
|
-
if (features !== void 0) input20.features = features;
|
|
8246
|
+
if (features !== void 0) input20.features = JSON.stringify(features);
|
|
8247
8247
|
if (Object.keys(input20).length === 0) {
|
|
8248
8248
|
printError(
|
|
8249
8249
|
"Nothing to set. Pass at least one of --default-model, --monthly-budget-usd, --max-agents, --auto-close-after-days, --feature."
|
|
@@ -253,12 +253,13 @@ locals {
|
|
|
253
253
|
# the routine-approval-callback function name in the SFN execution
|
|
254
254
|
# input so the inbox_approval recipe can fanout to it on .waitForTaskToken.
|
|
255
255
|
"job-trigger" = {
|
|
256
|
-
AWS_ACCOUNT_ID
|
|
257
|
-
ROUTINE_APPROVAL_CALLBACK_FUNCTION_NAME
|
|
258
|
-
EMAIL_SEND_FUNCTION_NAME
|
|
259
|
-
ROUTINE_TASK_PYTHON_FUNCTION_NAME
|
|
260
|
-
ADMIN_OPS_MCP_FUNCTION_NAME
|
|
261
|
-
SLACK_SEND_FUNCTION_NAME
|
|
256
|
+
AWS_ACCOUNT_ID = var.account_id
|
|
257
|
+
ROUTINE_APPROVAL_CALLBACK_FUNCTION_NAME = "thinkwork-${var.stage}-api-routine-approval-callback"
|
|
258
|
+
EMAIL_SEND_FUNCTION_NAME = "thinkwork-${var.stage}-api-email-send"
|
|
259
|
+
ROUTINE_TASK_PYTHON_FUNCTION_NAME = "thinkwork-${var.stage}-api-routine-task-python"
|
|
260
|
+
ADMIN_OPS_MCP_FUNCTION_NAME = "thinkwork-${var.stage}-api-admin-ops-mcp"
|
|
261
|
+
SLACK_SEND_FUNCTION_NAME = "thinkwork-${var.stage}-api-slack-send"
|
|
262
|
+
THREAD_IDLE_MEMORY_LEARNING_FUNCTION_NAME = "thinkwork-${var.stage}-api-thread-idle-memory-learning"
|
|
262
263
|
}
|
|
263
264
|
# Phase 3 U4 Compliance outbox drainer.
|
|
264
265
|
# Connects to Aurora as the compliance_drainer role (provisioned in
|
|
@@ -307,6 +308,7 @@ resource "aws_lambda_function" "handler" {
|
|
|
307
308
|
"budgets",
|
|
308
309
|
"guardrails",
|
|
309
310
|
"scheduled-jobs",
|
|
311
|
+
"thread-idle-memory-learning",
|
|
310
312
|
"job-schedule-manager",
|
|
311
313
|
"job-trigger",
|
|
312
314
|
"routine-task-weather-email",
|
|
@@ -535,6 +535,10 @@ resource "aws_iam_role_policy" "lambda_api_cross_invoke" {
|
|
|
535
535
|
# decision. Calls SendTaskSuccess/SendTaskFailure on the SFN
|
|
536
536
|
# task token; idempotent on already-consumed tokens.
|
|
537
537
|
"arn:aws:lambda:${var.region}:${var.account_id}:function:thinkwork-${var.stage}-api-routine-resume",
|
|
538
|
+
# thread-idle-memory-learning: job-trigger invokes this
|
|
539
|
+
# RequestResponse after a 15-minute requester-thread idle timer
|
|
540
|
+
# passes its stale guard.
|
|
541
|
+
"arn:aws:lambda:${var.region}:${var.account_id}:function:thinkwork-${var.stage}-api-thread-idle-memory-learning",
|
|
538
542
|
# workspace-files-efs: workspace-files invokes this (RequestResponse)
|
|
539
543
|
# for Computer-target list/get to bypass the computer_tasks queue
|
|
540
544
|
# and read EFS directly. Standalone resource below.
|