thinkwork-cli 0.12.8 → 0.12.10
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 +21 -16
- package/dist/{api-client-MC4NOZ4L.js → api-client-ASJWIG3Z.js} +1 -1
- package/dist/{chunk-34NMB5AK.js → chunk-JEHV35EU.js} +31 -0
- package/dist/cli.js +14041 -12816
- package/dist/commands/enterprise/templates/deploy-repo/.github/workflows/deploy.yml +38 -12
- package/dist/commands/enterprise/templates/deploy-repo/docs/runbook.md +85 -78
- package/dist/commands/enterprise/templates/deploy-repo/scripts/apply-release.mjs +1 -0
- package/dist/terraform/examples/greenfield/main.tf +37 -16
- package/dist/terraform/modules/app/static-site/main.tf +34 -3
- package/dist/terraform/modules/app/www-dns/main.tf +34 -7
- package/dist/terraform/modules/app/www-dns/variables.tf +14 -2
- package/dist/terraform/modules/thinkwork/main.tf +66 -15
- package/dist/terraform/modules/thinkwork/outputs.tf +32 -6
- package/dist/terraform/modules/thinkwork/variables.tf +14 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,26 +137,31 @@ The CLI has two modes for every API-backed command:
|
|
|
137
137
|
Any flag accepted by a command is also inferrable from env vars:
|
|
138
138
|
`THINKWORK_STAGE`, `THINKWORK_TENANT`, `THINKWORK_API_KEY` (for CI).
|
|
139
139
|
|
|
140
|
-
##
|
|
140
|
+
## Command surface
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
phase-by-phase. Running a scaffolded command prints a "not yet implemented"
|
|
145
|
-
message and exits with code 2.
|
|
142
|
+
All 25 originally-scaffolded commands across Phases 1–5 are now live.
|
|
143
|
+
`thinkwork <cmd> --help` is authoritative for flags + examples.
|
|
146
144
|
|
|
147
145
|
| Phase | Domain | Commands |
|
|
148
146
|
|-------|--------|----------|
|
|
149
|
-
|
|
|
150
|
-
| 1 | Work & approvals |
|
|
151
|
-
| 2 | Agents & workspace |
|
|
152
|
-
| 3 | Automation & integrations |
|
|
153
|
-
| 4 | Memory & artifacts |
|
|
154
|
-
| 5 | Observability & spend |
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
147
|
+
| 0 | Foundation | `login` (chains AWS profile + Cognito API session), `logout`, `me`, `--json`, GraphQL client, codegen, shared helpers |
|
|
148
|
+
| 1 | Work & approvals | `thread`, `message`, `label`, `inbox` |
|
|
149
|
+
| 2 | Agents & workspace | `member`, `team`, `kb`, `template`, `tenant`, `agent` |
|
|
150
|
+
| 3 | Automation & integrations | `routine`, `scheduled-job`, `turn`, `wakeup`, `webhook`, `skill` (`connector` retired) |
|
|
151
|
+
| 4 | Memory & artifacts | `memory`, `recipe`, `artifact` |
|
|
152
|
+
| 5 | Observability & spend | `cost`, `budget`, `performance`, `trace`, `dashboard` |
|
|
153
|
+
|
|
154
|
+
`skill create` and `skill update` were retired in favor of
|
|
155
|
+
`thinkwork skill push <folder>` — that's the real custom-skill authoring
|
|
156
|
+
surface. Invoking them prints "retired — use `skill push`" and exits 2.
|
|
157
|
+
|
|
158
|
+
Auth model: the CLI's auto-fallback to the deploy-stage's
|
|
159
|
+
`api_auth_secret` admits most admin-tier paths via the server's
|
|
160
|
+
`requireAdminOrServiceCaller` gate. Paths that stamp a specific user
|
|
161
|
+
identity onto the row (`createThread`, `sendMessage`, `core/*` member
|
|
162
|
+
mutations) stay Cognito-required so service callers can't ghost-write
|
|
163
|
+
as a user — sign in via `thinkwork login --stage <s>` (or the chained
|
|
164
|
+
prompt from `thinkwork login`) for those.
|
|
160
165
|
|
|
161
166
|
## Interactive Init
|
|
162
167
|
|
|
@@ -43,6 +43,11 @@ function saveEnterpriseDeployment(config) {
|
|
|
43
43
|
JSON.stringify(config, null, 2) + "\n"
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
+
function loadEnterpriseDeployment(customerSlug) {
|
|
47
|
+
const configPath = join(ENTERPRISE_DEPLOYMENTS_DIR, `${customerSlug}.json`);
|
|
48
|
+
if (!existsSync(configPath)) return null;
|
|
49
|
+
return JSON.parse(readFileSync(configPath, "utf-8"));
|
|
50
|
+
}
|
|
46
51
|
function loadEnvironment(stage) {
|
|
47
52
|
const configPath = join(ENVIRONMENTS_DIR, stage, "config.json");
|
|
48
53
|
if (!existsSync(configPath)) return null;
|
|
@@ -176,6 +181,30 @@ function getApiEndpoint(stage, region) {
|
|
|
176
181
|
);
|
|
177
182
|
return raw && raw !== "None" ? raw : null;
|
|
178
183
|
}
|
|
184
|
+
function discoverThinkworkStageUrls(stage, region) {
|
|
185
|
+
const urls = {};
|
|
186
|
+
const apiEndpoint = getApiEndpoint(stage, region);
|
|
187
|
+
if (apiEndpoint) urls.apiEndpoint = apiEndpoint;
|
|
188
|
+
const appSyncUrl = runAws(
|
|
189
|
+
`appsync list-graphql-apis --region ${region} --query "graphqlApis[?name=='thinkwork-${stage}-subscriptions'].uris.GRAPHQL|[0]" --output text`
|
|
190
|
+
);
|
|
191
|
+
if (appSyncUrl && appSyncUrl !== "None") urls.appSyncUrl = appSyncUrl;
|
|
192
|
+
const distributions = runAws(
|
|
193
|
+
`cloudfront list-distributions --query "DistributionList.Items[?contains(Origins.Items[0].DomainName, 'thinkwork-${stage}-')].{Origin:Origins.Items[0].DomainName,Domain:DomainName}" --output json`
|
|
194
|
+
);
|
|
195
|
+
if (distributions) {
|
|
196
|
+
const parsed = JSON.parse(distributions);
|
|
197
|
+
for (const distribution of parsed) {
|
|
198
|
+
if (distribution.Origin.includes(`thinkwork-${stage}-admin`)) {
|
|
199
|
+
urls.adminUrl = `https://${distribution.Domain}`;
|
|
200
|
+
}
|
|
201
|
+
if (distribution.Origin.includes(`thinkwork-${stage}-docs`)) {
|
|
202
|
+
urls.docsUrl = `https://${distribution.Domain}`;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return urls;
|
|
207
|
+
}
|
|
179
208
|
function getApiAuthSecretFromLambda(stage, region) {
|
|
180
209
|
const raw = runAws(
|
|
181
210
|
`lambda get-function-configuration --function-name thinkwork-${stage}-api-tenants --region ${region} --query "Environment.Variables.API_AUTH_SECRET" --output text`
|
|
@@ -345,8 +374,10 @@ export {
|
|
|
345
374
|
printSummary,
|
|
346
375
|
listDeployedStages,
|
|
347
376
|
getApiEndpoint,
|
|
377
|
+
discoverThinkworkStageUrls,
|
|
348
378
|
saveEnvironment,
|
|
349
379
|
saveEnterpriseDeployment,
|
|
380
|
+
loadEnterpriseDeployment,
|
|
350
381
|
loadEnvironment,
|
|
351
382
|
listEnvironments,
|
|
352
383
|
resolveTerraformDir,
|