@installagent/sdk 0.1.0 → 0.2.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/dist/agent-templates.d.ts +36 -2
- package/dist/agent-templates.js +173 -3
- package/dist/client-linear-create.d.ts +26 -0
- package/dist/client-linear-create.js +46 -0
- package/dist/client-linear.d.ts +28 -9
- package/dist/client-linear.js +36 -14
- package/dist/docs-search.d.ts +19 -6
- package/dist/docs-search.js +32 -11
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.js +126 -23
- package/dist/env-fill.d.ts +13 -0
- package/dist/env-fill.js +34 -9
- package/dist/env-push.d.ts +3 -0
- package/dist/env-push.js +11 -6
- package/dist/env-registry.d.ts +25 -0
- package/dist/env-registry.js +69 -7
- package/dist/exec.js +15 -2
- package/dist/index.d.ts +14 -6
- package/dist/index.js +14 -6
- package/dist/linear-project.d.ts +2 -2
- package/dist/linear-project.js +2 -2
- package/dist/log.d.ts +28 -0
- package/dist/log.js +73 -0
- package/dist/n8n-executions.d.ts +85 -0
- package/dist/n8n-executions.js +259 -0
- package/dist/op-cli.d.ts +29 -0
- package/dist/op-cli.js +52 -0
- package/dist/platform.d.ts +35 -0
- package/dist/platform.js +39 -0
- package/dist/portal-admin.d.ts +40 -0
- package/dist/portal-admin.js +30 -0
- package/dist/standup.d.ts +88 -0
- package/dist/standup.js +235 -0
- package/dist/sync-repos.d.ts +47 -0
- package/dist/sync-repos.js +80 -0
- package/dist/template-sync.d.ts +10 -0
- package/dist/template-sync.js +11 -0
- package/dist/wizard.d.ts +15 -0
- package/dist/wizard.js +35 -56
- package/dist/workspace-docs.d.ts +44 -0
- package/dist/workspace-docs.js +73 -0
- package/package.json +2 -2
- package/templates/env.example +33 -23
- package/templates/workspace-root/AGENT.md +7 -5
- package/templates/workspace-root/ONBOARDING.md +65 -8
- package/templates/workspace-root/skills/.github/workflows/pr-to-slack.yml +102 -0
- package/templates/workspace-root/skills/CLAUDE.md +24 -6
- package/templates/workspace-root/skills/README.md +156 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/SKILL.md +293 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/backtest-acceptance-gates-guide.pdf +0 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/references/evidence-record-template.md +128 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/references/harness-checklist.md +90 -0
- package/templates/workspace-root/skills/client-latest/SKILL.md +301 -0
- package/templates/workspace-root/skills/client-latest/catchup.command.md +17 -0
- package/templates/workspace-root/skills/cloud-devops/SKILL.md +235 -0
- package/templates/workspace-root/skills/email-triage-rollout/SKILL.md +181 -0
- package/templates/workspace-root/skills/gcloud-cli-setup/SKILL.md +100 -0
- package/templates/workspace-root/skills/google-chat-app-setup/SKILL.md +136 -0
- package/templates/workspace-root/skills/google-chat-app-setup/google-chat-app-setup-guide.pdf +0 -0
- package/templates/workspace-root/skills/house-voice/SKILL.md +80 -4
- package/templates/workspace-root/skills/ia-cli/SKILL.md +19 -6
- package/templates/workspace-root/skills/installagent-brand-kit/SKILL.md +59 -10
- package/templates/workspace-root/skills/installagent-brand-kit/assets/installagent-deck-template.pptx +0 -0
- package/templates/workspace-root/skills/installagent-brand-kit/references/deck-guide.md +181 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/deck.py +652 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/deck_lint.py +201 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/logo_raster.py +102 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/make_deck_template.py +290 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/SKILL.md +379 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/references/schema-discovery-soql.md +153 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/references/snapshot-storage.md +122 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/salesforce-api-snapshot-guide.pdf +0 -0
- package/templates/workspace-root/skills/slack-voice/SKILL.md +158 -0
- package/templates/workspace-root/skills/sso-gated-client-app/SKILL.md +337 -0
- package/templates/workspace-root/skills/sso-gated-client-app/sso-gated-client-app-guide.pdf +0 -0
- package/templates/workspace-root/skills/tech-call-prep/SKILL.md +146 -47
- package/templates/workspace-root/skills/vendor-feed-ingestion/SKILL.md +323 -0
- package/templates/workspace-root/skills/vendor-feed-ingestion/references/delivery-contract-template.md +110 -0
- package/templates/workspace-root/skills/vendor-feed-ingestion/references/feed-guards.md +134 -0
- package/templates/workspace-root/skills/vendor-feed-ingestion/vendor-feed-ingestion-guide.pdf +0 -0
package/dist/doctor.js
CHANGED
|
@@ -2,12 +2,14 @@ import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
import { N8N_API_KEY_ENV, N8N_API_URL_ENV } from "./agent-templates.js";
|
|
4
4
|
import { AIRTABLE_API_TOKEN_ENV, GOOGLE_SERVICE_ACCOUNT_KEY_ENV } from "./client-drive.js";
|
|
5
|
-
import { DOCS_SESSION_ENV, TEAM_DOCS_BASE_URL } from "./docs-search.js";
|
|
5
|
+
import { DOCS_SEARCH_TOKEN_ENV, DOCS_SESSION_ENV, TEAM_DOCS_BASE_URL } from "./docs-search.js";
|
|
6
6
|
import { parseEnvFile } from "./env-file.js";
|
|
7
|
-
import { DEFAULT_TECH_VAULT,
|
|
7
|
+
import { DEFAULT_TECH_VAULT, opSecretReference, TECH_ENV_VARS, } from "./env-registry.js";
|
|
8
8
|
import { execFailureDetail, execFileAsync } from "./exec.js";
|
|
9
9
|
import { GITHUB_API_TOKEN_ENV, GITHUB_TOKEN_FIX } from "./github-token.js";
|
|
10
10
|
import { LINEAR_API_TOKEN_ENV } from "./linear-project.js";
|
|
11
|
+
import { opInstallFix, opIntegrationFix } from "./op-cli.js";
|
|
12
|
+
import { detectPlatformInfo } from "./platform.js";
|
|
11
13
|
const WORKSPACE_CHECKS = [
|
|
12
14
|
{
|
|
13
15
|
name: "team-clients",
|
|
@@ -72,6 +74,7 @@ export async function doctor(options = {}) {
|
|
|
72
74
|
const execFileImpl = options.execFileImpl ?? execFileAsync;
|
|
73
75
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
74
76
|
const offline = options.offline ?? false;
|
|
77
|
+
const platform = options.platform ?? detectPlatformInfo();
|
|
75
78
|
const checks = [];
|
|
76
79
|
for (const spec of WORKSPACE_CHECKS) {
|
|
77
80
|
const present = existsSync(join(workspaceDir, spec.relPath));
|
|
@@ -90,22 +93,26 @@ export async function doctor(options = {}) {
|
|
|
90
93
|
const envFreshness = envFreshnessCheck(workspaceDir);
|
|
91
94
|
if (envFreshness)
|
|
92
95
|
checks.push(envFreshness);
|
|
93
|
-
checks.push(await ghCheck(execFileImpl, env));
|
|
94
|
-
checks.push(await opCheck(execFileImpl));
|
|
96
|
+
checks.push(await ghCheck(execFileImpl, env, platform));
|
|
97
|
+
checks.push(await opCheck(execFileImpl, platform));
|
|
95
98
|
checks.push(await gcloudCheck(execFileImpl));
|
|
96
|
-
|
|
99
|
+
// Technician vars only. Admin vars are all doctor:false today, so this
|
|
100
|
+
// changes nothing now — it is here so that adding a doctor:true infra var
|
|
101
|
+
// later cannot start naming it in every technician's checkup.
|
|
102
|
+
for (const spec of TECH_ENV_VARS) {
|
|
97
103
|
if (!spec.doctor)
|
|
98
104
|
continue;
|
|
99
105
|
const value = env[spec.name];
|
|
100
106
|
const present = typeof value === "string" && value.length > 0;
|
|
101
107
|
if (!present) {
|
|
108
|
+
const covered = spec.coveredBy && env[spec.coveredBy];
|
|
102
109
|
checks.push({
|
|
103
110
|
id: `env/${spec.name}`,
|
|
104
111
|
group: "env",
|
|
105
|
-
status: spec.tier === "required" ? "missing" : "warn",
|
|
112
|
+
status: covered ? "ok" : spec.tier === "required" ? "missing" : "warn",
|
|
106
113
|
label: `$${spec.name}`,
|
|
107
|
-
detail: "not set",
|
|
108
|
-
fixIt: envFixIt(spec),
|
|
114
|
+
detail: covered ? `not set — $${spec.coveredBy} covers ${spec.neededBy}` : "not set",
|
|
115
|
+
...(covered ? {} : { fixIt: envFixIt(spec) }),
|
|
109
116
|
});
|
|
110
117
|
continue;
|
|
111
118
|
}
|
|
@@ -163,7 +170,9 @@ function lefthookCheck(workspaceDir) {
|
|
|
163
170
|
...base,
|
|
164
171
|
status: "warn",
|
|
165
172
|
detail: `${unhooked.length} of ${gitRepos.length} client repo(s) missing the lefthook pre-commit hook: ${unhooked.join(", ")}`,
|
|
166
|
-
fixIt: "hooks are per-clone — run `lefthook install` inside each listed repo (
|
|
173
|
+
fixIt: "hooks are per-clone — run `npx lefthook install` inside each listed repo (client repos carry no " +
|
|
174
|
+
"package.json, so there is no local lefthook to call; npx fetches it. `npx` ships with Node, so the " +
|
|
175
|
+
"same command works in PowerShell, cmd and any POSIX shell). repo-lint never runs without it",
|
|
167
176
|
};
|
|
168
177
|
}
|
|
169
178
|
/**
|
|
@@ -177,7 +186,11 @@ function envFreshnessCheck(workspaceDir) {
|
|
|
177
186
|
if (!existsSync(envPath))
|
|
178
187
|
return null; // the root-env workspace check already covers absence
|
|
179
188
|
const presentNames = new Set(Object.keys(parseEnvFile(readFileSync(envPath, "utf8"))));
|
|
180
|
-
|
|
189
|
+
// Technician vars only. The admin block ships commented out in
|
|
190
|
+
// env.example, so parseEnvFile never sees it — comparing against the whole
|
|
191
|
+
// registry would report 21 permanent "missing" lines and name every
|
|
192
|
+
// payments and database secret while doing it.
|
|
193
|
+
const missing = TECH_ENV_VARS.map((spec) => spec.name).filter((name) => !presentNames.has(name));
|
|
181
194
|
const base = {
|
|
182
195
|
id: "workspace/env-freshness",
|
|
183
196
|
group: "workspace",
|
|
@@ -190,7 +203,7 @@ function envFreshnessCheck(workspaceDir) {
|
|
|
190
203
|
...base,
|
|
191
204
|
status: "warn",
|
|
192
205
|
detail: `missing ${missing.length} var line(s) added since it was created: ${missing.join(", ")}`,
|
|
193
|
-
fixIt: "add the missing lines from .env.example (`ia
|
|
206
|
+
fixIt: "add the missing lines from .env.example (`ia sync --docs` refreshes it), then `ia env fill`",
|
|
194
207
|
};
|
|
195
208
|
}
|
|
196
209
|
const LIVE_CHECK_TIMEOUT_MS = 5000;
|
|
@@ -225,6 +238,20 @@ const LIVE_VALIDATORS = {
|
|
|
225
238
|
return { outcome: "invalid", detail: `Airtable rejected it (HTTP ${res.status})` };
|
|
226
239
|
return { outcome: "valid", detail: "Airtable accepts it" };
|
|
227
240
|
},
|
|
241
|
+
[DOCS_SEARCH_TOKEN_ENV]: async (value, _env, fetchImpl) => {
|
|
242
|
+
const res = await fetchImpl(`${TEAM_DOCS_BASE_URL}/api/search?query=doctor`, {
|
|
243
|
+
headers: { authorization: `Bearer ${value}` },
|
|
244
|
+
redirect: "manual",
|
|
245
|
+
signal: AbortSignal.timeout(LIVE_CHECK_TIMEOUT_MS),
|
|
246
|
+
});
|
|
247
|
+
if (!res.ok) {
|
|
248
|
+
return {
|
|
249
|
+
outcome: "invalid",
|
|
250
|
+
detail: `the docs search API rejected it (HTTP ${res.status})`,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return { outcome: "valid", detail: "the docs search API accepts it" };
|
|
254
|
+
},
|
|
228
255
|
[DOCS_SESSION_ENV]: async (value, _env, fetchImpl) => {
|
|
229
256
|
const res = await fetchImpl(`${TEAM_DOCS_BASE_URL}/docs`, {
|
|
230
257
|
headers: { cookie: `__Secure-authjs.session-token=${value}` },
|
|
@@ -313,13 +340,21 @@ function isServiceAccountKey(value) {
|
|
|
313
340
|
}
|
|
314
341
|
}
|
|
315
342
|
const GH_NEEDED_BY = "ia client-build, client-linear, client-intake";
|
|
343
|
+
/** The package-manager one-liner that puts `gh` on PATH for this platform. */
|
|
344
|
+
function ghInstallCommand(platform) {
|
|
345
|
+
if (platform.platform === "win32")
|
|
346
|
+
return "`winget install GitHub.cli` from PowerShell";
|
|
347
|
+
if (platform.platform === "linux")
|
|
348
|
+
return "see cli.github.com";
|
|
349
|
+
return "`brew install gh`";
|
|
350
|
+
}
|
|
316
351
|
/**
|
|
317
352
|
* GitHub auth: `gh auth status` is the day-one path (OAuth, no PAT, no
|
|
318
353
|
* org-approval wait); a set $GITHUB_API_TOKEN passes too, as an override.
|
|
319
354
|
* This check carries the required-ness — there is no env check for the
|
|
320
355
|
* override var.
|
|
321
356
|
*/
|
|
322
|
-
async function ghCheck(execFileImpl, env) {
|
|
357
|
+
async function ghCheck(execFileImpl, env, platform) {
|
|
323
358
|
const base = { id: "tools/gh", group: "tools", label: "GitHub auth (gh CLI)" };
|
|
324
359
|
const override = env[GITHUB_API_TOKEN_ENV];
|
|
325
360
|
try {
|
|
@@ -341,7 +376,7 @@ async function ghCheck(execFileImpl, env) {
|
|
|
341
376
|
...base,
|
|
342
377
|
status: "missing",
|
|
343
378
|
detail: ghState,
|
|
344
|
-
fixIt: `needed by ${GH_NEEDED_BY} — install the GitHub CLI (
|
|
379
|
+
fixIt: `needed by ${GH_NEEDED_BY} — install the GitHub CLI (${ghInstallCommand(platform)}), then ${GITHUB_TOKEN_FIX}`,
|
|
345
380
|
};
|
|
346
381
|
}
|
|
347
382
|
return {
|
|
@@ -356,7 +391,7 @@ async function ghCheck(execFileImpl, env) {
|
|
|
356
391
|
* 1Password CLI: powers `ia env fill` (shared secrets come from the team
|
|
357
392
|
* vaults). Warn-only — a technician can still fill .env by hand.
|
|
358
393
|
*/
|
|
359
|
-
async function opCheck(execFileImpl) {
|
|
394
|
+
async function opCheck(execFileImpl, platform) {
|
|
360
395
|
const base = { id: "tools/op", group: "tools", label: "1Password CLI (op)" };
|
|
361
396
|
try {
|
|
362
397
|
const { stdout } = await execFileImpl("op", ["whoami"]);
|
|
@@ -374,28 +409,56 @@ async function opCheck(execFileImpl) {
|
|
|
374
409
|
...base,
|
|
375
410
|
status: "warn",
|
|
376
411
|
detail: "op CLI not found on PATH",
|
|
377
|
-
fixIt:
|
|
412
|
+
fixIt: `needed by \`ia env fill\` — ${opInstallFix(platform)}`,
|
|
378
413
|
};
|
|
379
414
|
}
|
|
380
415
|
return {
|
|
381
416
|
...base,
|
|
382
417
|
status: "warn",
|
|
383
|
-
detail: "op is installed but not
|
|
384
|
-
fixIt: `
|
|
418
|
+
detail: "op is installed but not authenticated",
|
|
419
|
+
fixIt: `needed by \`ia env fill\` (it reads the ${DEFAULT_TECH_VAULT} vault) — ${opIntegrationFix(platform)}`,
|
|
385
420
|
};
|
|
386
421
|
}
|
|
387
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* gcloud is needed by `ia secrets mint gcp-service-account-key` and nothing
|
|
425
|
+
* else, so it is `verboseOnly` — it warned in every technician's daily
|
|
426
|
+
* checkup and told them to install a 400 MB SDK for a command most of them
|
|
427
|
+
* will never run. `ia doctor --all` still shows it, and the mint command
|
|
428
|
+
* fails with its own message if gcloud really is absent.
|
|
429
|
+
*
|
|
430
|
+
* Also flags the multi-tenant risk the `gcloud-cli-setup` skill exists for:
|
|
431
|
+
* once more than one account is credentialed on the machine (two clients'
|
|
432
|
+
* GCP projects), running off the unnamed `default` configuration means a
|
|
433
|
+
* stray command can land on the wrong client's project with no warning.
|
|
434
|
+
* `gcloud config configurations list` is a second, best-effort call — its
|
|
435
|
+
* failure (e.g. an ancient gcloud without the `configurations` group)
|
|
436
|
+
* degrades to the plain authenticated-account result, never to a false
|
|
437
|
+
* failure of this check.
|
|
438
|
+
*/
|
|
388
439
|
async function gcloudCheck(execFileImpl) {
|
|
389
|
-
const base = {
|
|
440
|
+
const base = {
|
|
441
|
+
id: "tools/gcloud",
|
|
442
|
+
group: "tools",
|
|
443
|
+
label: "gcloud CLI",
|
|
444
|
+
verboseOnly: true,
|
|
445
|
+
};
|
|
390
446
|
try {
|
|
391
447
|
const { stdout } = await execFileImpl("gcloud", [
|
|
392
448
|
"auth",
|
|
393
449
|
"list",
|
|
394
|
-
"--
|
|
395
|
-
"--format=value(account)",
|
|
450
|
+
"--format=value(account,status)",
|
|
396
451
|
]);
|
|
397
|
-
const
|
|
398
|
-
|
|
452
|
+
const accounts = stdout
|
|
453
|
+
.trim()
|
|
454
|
+
.split("\n")
|
|
455
|
+
.filter((line) => line.length > 0)
|
|
456
|
+
.map((line) => {
|
|
457
|
+
const [account = "", status = ""] = line.split("\t");
|
|
458
|
+
return { account, active: status.trim().toUpperCase() === "ACTIVE" };
|
|
459
|
+
});
|
|
460
|
+
const active = accounts.find((a) => a.active);
|
|
461
|
+
if (!active) {
|
|
399
462
|
return {
|
|
400
463
|
...base,
|
|
401
464
|
status: "warn",
|
|
@@ -403,7 +466,47 @@ async function gcloudCheck(execFileImpl) {
|
|
|
403
466
|
fixIt: "only needed for `ia secrets mint gcp-*` — run `gcloud auth login`",
|
|
404
467
|
};
|
|
405
468
|
}
|
|
406
|
-
|
|
469
|
+
let activeConfigName;
|
|
470
|
+
try {
|
|
471
|
+
const { stdout: configStdout } = await execFileImpl("gcloud", [
|
|
472
|
+
"config",
|
|
473
|
+
"configurations",
|
|
474
|
+
"list",
|
|
475
|
+
"--format=value(name,is_active)",
|
|
476
|
+
]);
|
|
477
|
+
const configs = configStdout
|
|
478
|
+
.trim()
|
|
479
|
+
.split("\n")
|
|
480
|
+
.filter((line) => line.length > 0)
|
|
481
|
+
.map((line) => {
|
|
482
|
+
const [name = "", isActive = ""] = line.split("\t");
|
|
483
|
+
return { name, active: isActive.trim().toLowerCase() === "true" };
|
|
484
|
+
});
|
|
485
|
+
activeConfigName = configs.find((c) => c.active)?.name;
|
|
486
|
+
}
|
|
487
|
+
catch {
|
|
488
|
+
// Best-effort — an older gcloud without `configurations` still gets a
|
|
489
|
+
// plain "authenticated as" result below, not a failure.
|
|
490
|
+
}
|
|
491
|
+
if (accounts.length > 1 && (activeConfigName ?? "default") === "default") {
|
|
492
|
+
return {
|
|
493
|
+
...base,
|
|
494
|
+
status: "warn",
|
|
495
|
+
detail: `authenticated as ${active.account}, but running off the unnamed "default" gcloud ` +
|
|
496
|
+
`configuration with ${accounts.length} accounts on this machine — a stray command can ` +
|
|
497
|
+
"hit the wrong client's project",
|
|
498
|
+
fixIt: "one named gcloud configuration per client (see the gcloud-cli-setup skill): " +
|
|
499
|
+
"`gcloud config configurations create <name> && gcloud config configurations activate <name> " +
|
|
500
|
+
"&& gcloud config set account <email>`",
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
...base,
|
|
505
|
+
status: "ok",
|
|
506
|
+
detail: activeConfigName
|
|
507
|
+
? `authenticated as ${active.account} (configuration "${activeConfigName}")`
|
|
508
|
+
: `authenticated as ${active.account}`,
|
|
509
|
+
};
|
|
407
510
|
}
|
|
408
511
|
catch (error) {
|
|
409
512
|
const { code, detail } = execFailureDetail(error);
|
package/dist/env-fill.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ExecFileFn } from "./exec.js";
|
|
2
|
+
import { type PlatformInfo } from "./platform.js";
|
|
2
3
|
export interface EnvFillOptions {
|
|
3
4
|
/** installagent/ workspace root holding the .env. Defaults to the current dir. */
|
|
4
5
|
workspaceDir?: string;
|
|
@@ -6,6 +7,13 @@ export interface EnvFillOptions {
|
|
|
6
7
|
dryRun?: boolean;
|
|
7
8
|
/** Read every vault var from this vault instead of its registry vault. */
|
|
8
9
|
vaultOverride?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Also attempt the admin vars (infra, portal, payments). Default false:
|
|
12
|
+
* a technician's run never names a secret they hold no grant to.
|
|
13
|
+
*/
|
|
14
|
+
includeAdmin?: boolean;
|
|
15
|
+
/** Injectable for tests; defaults to the running machine. Picks the op fix-it text. */
|
|
16
|
+
platform?: PlatformInfo;
|
|
9
17
|
/** Injectable for tests; defaults to real `op` via execFile. */
|
|
10
18
|
execFileImpl?: ExecFileFn;
|
|
11
19
|
}
|
|
@@ -29,6 +37,11 @@ export interface EnvFillResult {
|
|
|
29
37
|
name: string;
|
|
30
38
|
howToGet: string;
|
|
31
39
|
}>;
|
|
40
|
+
/**
|
|
41
|
+
* How many admin vars this run deliberately did not attempt. Reported as a
|
|
42
|
+
* single count, never as a list of names — see EnvVarRole.
|
|
43
|
+
*/
|
|
44
|
+
adminSkipped: number;
|
|
32
45
|
nextSteps: string[];
|
|
33
46
|
}
|
|
34
47
|
/**
|
package/dist/env-fill.js
CHANGED
|
@@ -2,8 +2,10 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { copyFile, readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { parseEnvFile } from "./env-file.js";
|
|
5
|
-
import { DEFAULT_TECH_VAULT,
|
|
5
|
+
import { ADMIN_ENV_VARS, DEFAULT_TECH_VAULT, envVarsForRole, TECH_ENV_VARS, } from "./env-registry.js";
|
|
6
6
|
import { execFailureDetail, execFileAsync } from "./exec.js";
|
|
7
|
+
import { opInstallFix, opIntegrationFix } from "./op-cli.js";
|
|
8
|
+
import { detectPlatformInfo } from "./platform.js";
|
|
7
9
|
import { envExampleTemplatePath } from "./templates.js";
|
|
8
10
|
/** Values op read fields are tried in when the registry doesn't pin one. */
|
|
9
11
|
const OP_FIELD_FALLBACKS = ["value", "credential", "password"];
|
|
@@ -22,8 +24,11 @@ export async function envFill(options = {}) {
|
|
|
22
24
|
const workspaceDir = resolve(options.workspaceDir ?? ".");
|
|
23
25
|
const dryRun = options.dryRun ?? false;
|
|
24
26
|
const execFileImpl = options.execFileImpl ?? execFileAsync;
|
|
27
|
+
const includeAdmin = options.includeAdmin ?? false;
|
|
28
|
+
const platform = options.platform ?? detectPlatformInfo();
|
|
25
29
|
const envPath = join(workspaceDir, ".env");
|
|
26
|
-
const
|
|
30
|
+
const adminSkipped = includeAdmin ? 0 : ADMIN_ENV_VARS.length;
|
|
31
|
+
const opReady = await opPreflight(execFileImpl, platform);
|
|
27
32
|
if (opReady !== true) {
|
|
28
33
|
return {
|
|
29
34
|
ok: false,
|
|
@@ -32,6 +37,7 @@ export async function envFill(options = {}) {
|
|
|
32
37
|
created: false,
|
|
33
38
|
vars: [],
|
|
34
39
|
personalRemaining: personalHomework({}),
|
|
40
|
+
adminSkipped,
|
|
35
41
|
nextSteps: [opReady, "then re-run `ia env fill`"],
|
|
36
42
|
};
|
|
37
43
|
}
|
|
@@ -47,7 +53,7 @@ export async function envFill(options = {}) {
|
|
|
47
53
|
const existing = parseEnvFile(original);
|
|
48
54
|
const vars = [];
|
|
49
55
|
const fills = new Map();
|
|
50
|
-
for (const spec of
|
|
56
|
+
for (const spec of envVarsForRole(includeAdmin)) {
|
|
51
57
|
const current = existing[spec.name];
|
|
52
58
|
if (typeof current === "string" && current.length > 0) {
|
|
53
59
|
vars.push({ name: spec.name, status: "kept", detail: "already set — left untouched" });
|
|
@@ -98,21 +104,40 @@ export async function envFill(options = {}) {
|
|
|
98
104
|
created,
|
|
99
105
|
vars,
|
|
100
106
|
personalRemaining,
|
|
107
|
+
adminSkipped,
|
|
101
108
|
nextSteps,
|
|
102
109
|
};
|
|
103
110
|
}
|
|
104
|
-
/**
|
|
105
|
-
|
|
111
|
+
/**
|
|
112
|
+
* True when op is installed and can reach the vaults; otherwise the fix-it step.
|
|
113
|
+
*
|
|
114
|
+
* `op whoami` is the obvious probe but NOT a sufficient one: with the desktop
|
|
115
|
+
* app integration on, op 2.35 answers "account is not signed in" to `whoami`
|
|
116
|
+
* while `op read` and `op vault list` both work — the CLI has no session of its
|
|
117
|
+
* own, and the app authorizes each call. Failing preflight there told a
|
|
118
|
+
* technician to enable an integration that was already enabled, and blocked a
|
|
119
|
+
* fill that would have succeeded. So a `whoami` failure falls through to a
|
|
120
|
+
* vault-listing probe, which is what this command actually needs to do.
|
|
121
|
+
*/
|
|
122
|
+
async function opPreflight(execFileImpl, platform) {
|
|
106
123
|
try {
|
|
107
124
|
await execFileImpl("op", ["whoami"]);
|
|
108
125
|
return true;
|
|
109
126
|
}
|
|
110
127
|
catch (error) {
|
|
111
128
|
const { code } = execFailureDetail(error);
|
|
112
|
-
if (code === "ENOENT")
|
|
113
|
-
return
|
|
129
|
+
if (code === "ENOENT")
|
|
130
|
+
return opInstallFix(platform);
|
|
131
|
+
try {
|
|
132
|
+
await execFileImpl("op", ["vault", "list", "--format=json"]);
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
catch (fallbackError) {
|
|
136
|
+
const detail = execFailureDetail(fallbackError);
|
|
137
|
+
if (detail.code === "ENOENT")
|
|
138
|
+
return opInstallFix(platform);
|
|
139
|
+
return `authenticate the 1Password CLI: ${opIntegrationFix(platform)}`;
|
|
114
140
|
}
|
|
115
|
-
return "sign in to 1Password: run `op signin`";
|
|
116
141
|
}
|
|
117
142
|
}
|
|
118
143
|
async function opRead(execFileImpl, vault, spec) {
|
|
@@ -155,7 +180,7 @@ function applyFills(content, fills) {
|
|
|
155
180
|
.join("\n");
|
|
156
181
|
}
|
|
157
182
|
function personalHomework(existing) {
|
|
158
|
-
return
|
|
183
|
+
return TECH_ENV_VARS.filter((spec) => spec.source === "personal" &&
|
|
159
184
|
spec.tier === "required" &&
|
|
160
185
|
!(typeof existing[spec.name] === "string" && existing[spec.name].length > 0)).map((spec) => ({ name: spec.name, howToGet: spec.howToGet }));
|
|
161
186
|
}
|
package/dist/env-push.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ExecFileFn } from "./exec.js";
|
|
2
|
+
import { type PlatformInfo } from "./platform.js";
|
|
2
3
|
export interface EnvPushOptions {
|
|
3
4
|
/** installagent/ workspace root holding the .env. Defaults to the current dir. */
|
|
4
5
|
workspaceDir?: string;
|
|
@@ -6,6 +7,8 @@ export interface EnvPushOptions {
|
|
|
6
7
|
dryRun?: boolean;
|
|
7
8
|
/** Write every vault var to this vault instead of its registry vault. */
|
|
8
9
|
vaultOverride?: string;
|
|
10
|
+
/** Injectable for tests; defaults to the running machine. Picks the op fix-it text. */
|
|
11
|
+
platform?: PlatformInfo;
|
|
9
12
|
/** Injectable for tests; defaults to real `op` via execFile. */
|
|
10
13
|
execFileImpl?: ExecFileFn;
|
|
11
14
|
}
|
package/dist/env-push.js
CHANGED
|
@@ -3,6 +3,8 @@ import { join, resolve } from "node:path";
|
|
|
3
3
|
import { parseEnvFile } from "./env-file.js";
|
|
4
4
|
import { DEFAULT_TECH_VAULT, ENV_VARS } from "./env-registry.js";
|
|
5
5
|
import { execFailureDetail, execFileAsync } from "./exec.js";
|
|
6
|
+
import { opInstallFix, opIntegrationFix } from "./op-cli.js";
|
|
7
|
+
import { detectPlatformInfo } from "./platform.js";
|
|
6
8
|
/**
|
|
7
9
|
* Push the workspace root .env up into the team 1Password vaults via the
|
|
8
10
|
* `op` CLI: every vault-backed registry var that has a value in .env is
|
|
@@ -17,8 +19,12 @@ export async function envPush(options = {}) {
|
|
|
17
19
|
const workspaceDir = resolve(options.workspaceDir ?? ".");
|
|
18
20
|
const dryRun = options.dryRun ?? false;
|
|
19
21
|
const execFileImpl = options.execFileImpl ?? execFileAsync;
|
|
22
|
+
// Founder-side command: it pushes the whole registry, admin vars included.
|
|
23
|
+
// Role scoping guards what a TECHNICIAN's tools name; whoever runs push
|
|
24
|
+
// already holds the grants.
|
|
25
|
+
const platform = options.platform ?? detectPlatformInfo();
|
|
20
26
|
const envPath = join(workspaceDir, ".env");
|
|
21
|
-
const opReady = await opPreflight(execFileImpl);
|
|
27
|
+
const opReady = await opPreflight(execFileImpl, platform);
|
|
22
28
|
if (opReady !== true) {
|
|
23
29
|
return {
|
|
24
30
|
ok: false,
|
|
@@ -93,17 +99,16 @@ export async function envPush(options = {}) {
|
|
|
93
99
|
};
|
|
94
100
|
}
|
|
95
101
|
/** True when op is installed and signed in; otherwise the fix-it next step. */
|
|
96
|
-
async function opPreflight(execFileImpl) {
|
|
102
|
+
async function opPreflight(execFileImpl, platform) {
|
|
97
103
|
try {
|
|
98
104
|
await execFileImpl("op", ["whoami"]);
|
|
99
105
|
return true;
|
|
100
106
|
}
|
|
101
107
|
catch (error) {
|
|
102
108
|
const { code } = execFailureDetail(error);
|
|
103
|
-
if (code === "ENOENT")
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
return "sign in to 1Password: run `op signin`";
|
|
109
|
+
if (code === "ENOENT")
|
|
110
|
+
return opInstallFix(platform);
|
|
111
|
+
return `authenticate the 1Password CLI: ${opIntegrationFix(platform)}`;
|
|
107
112
|
}
|
|
108
113
|
}
|
|
109
114
|
/** Update the vault item if it exists; create it if it doesn't. Never throws. */
|
package/dist/env-registry.d.ts
CHANGED
|
@@ -6,6 +6,19 @@ export type EnvVarTier = "required" | "optional";
|
|
|
6
6
|
* vaulted, always filled by hand.
|
|
7
7
|
*/
|
|
8
8
|
export type EnvVarSource = "vault" | "personal";
|
|
9
|
+
/**
|
|
10
|
+
* Who a var is for. `tech` — the day-one set every technician gets on their
|
|
11
|
+
* first afternoon. `admin` — infra, portal and payments secrets granted
|
|
12
|
+
* case-by-case.
|
|
13
|
+
*
|
|
14
|
+
* This governs what a technician's tools are even allowed to MENTION. Before
|
|
15
|
+
* it existed, `ia env fill` attempted every var and printed a red
|
|
16
|
+
* `not-in-vault` line naming every database and payments secret in the
|
|
17
|
+
* company to someone holding no grant to any of them. One key name is not a
|
|
18
|
+
* secret; a complete inventory of them is a map for whoever gets that laptop
|
|
19
|
+
* next.
|
|
20
|
+
*/
|
|
21
|
+
export type EnvVarRole = "tech" | "admin";
|
|
9
22
|
export interface EnvVarSpec {
|
|
10
23
|
name: string;
|
|
11
24
|
tier: EnvVarTier;
|
|
@@ -21,6 +34,9 @@ export interface EnvVarSpec {
|
|
|
21
34
|
field?: string;
|
|
22
35
|
/** Which command family reads it — shown by doctor and env fill. */
|
|
23
36
|
neededBy: string;
|
|
37
|
+
/** Another var that satisfies the same need: when THAT var is set, this
|
|
38
|
+
* one's absence is fine (doctor reports ok instead of missing/warn). */
|
|
39
|
+
coveredBy?: string;
|
|
24
40
|
/** Concrete manual steps (personal vars) or vault pointer (vault vars). */
|
|
25
41
|
howToGet: string;
|
|
26
42
|
/** env.example section heading this var renders under. */
|
|
@@ -32,6 +48,8 @@ export interface EnvVarSpec {
|
|
|
32
48
|
export declare const DEFAULT_TECH_VAULT = "team-techs";
|
|
33
49
|
/** Payments / DB / deploy secrets — granted case-by-case. */
|
|
34
50
|
export declare const INFRA_VAULT = "team-admin";
|
|
51
|
+
/** Only `ia secrets mint gemini-api-key` reads it, so it has no owning module. */
|
|
52
|
+
export declare const GEMINI_API_KEY_ENV = "GEMINI_API_KEY";
|
|
35
53
|
/**
|
|
36
54
|
* Single source of truth for every workspace-root .env var: doctor derives
|
|
37
55
|
* its env checks from it, `ia env fill` knows which vars 1Password can
|
|
@@ -39,6 +57,13 @@ export declare const INFRA_VAULT = "team-admin";
|
|
|
39
57
|
* (`pnpm generate:env-example` — a drift test keeps the two in sync).
|
|
40
58
|
*/
|
|
41
59
|
export declare const ENV_VARS: EnvVarSpec[];
|
|
60
|
+
export declare function envVarRole(spec: EnvVarSpec): EnvVarRole;
|
|
61
|
+
/** Every var a technician's own tooling may read, fill, or name. */
|
|
62
|
+
export declare const TECH_ENV_VARS: EnvVarSpec[];
|
|
63
|
+
/** The rest — infra, portal, payments. Only ever surfaced behind --admin. */
|
|
64
|
+
export declare const ADMIN_ENV_VARS: EnvVarSpec[];
|
|
65
|
+
/** The var set a command should act on. `includeAdmin` opts in to all of them. */
|
|
66
|
+
export declare function envVarsForRole(includeAdmin: boolean): EnvVarSpec[];
|
|
42
67
|
/** `op://<vault>/<item>/<field>` for a vault-sourced var. */
|
|
43
68
|
export declare function opSecretReference(spec: EnvVarSpec): string;
|
|
44
69
|
/**
|
package/dist/env-registry.js
CHANGED
|
@@ -2,7 +2,7 @@ import { N8N_API_KEY_ENV, N8N_API_URL_ENV } from "./agent-templates.js";
|
|
|
2
2
|
import { GITHUB_API_TOKEN_ENV } from "./client-build.js";
|
|
3
3
|
import { AIRTABLE_API_TOKEN_ENV, GOOGLE_SERVICE_ACCOUNT_KEY_ENV } from "./client-drive.js";
|
|
4
4
|
import { LINEAR_CLIENT_TEAM_ID_ENV } from "./client-intake.js";
|
|
5
|
-
import { DOCS_SESSION_ENV } from "./docs-search.js";
|
|
5
|
+
import { DOCS_SEARCH_TOKEN_ENV, DOCS_SESSION_ENV } from "./docs-search.js";
|
|
6
6
|
import { FATHOM_API_KEY_ENV } from "./fathom-webhook.js";
|
|
7
7
|
import { LINEAR_API_TOKEN_ENV } from "./linear-project.js";
|
|
8
8
|
import { PORTAL_ADMIN_SECRET_ENV } from "./portal-admin.js";
|
|
@@ -11,6 +11,8 @@ export const DEFAULT_TECH_VAULT = "team-techs";
|
|
|
11
11
|
/** Payments / DB / deploy secrets — granted case-by-case. */
|
|
12
12
|
export const INFRA_VAULT = "team-admin";
|
|
13
13
|
const OP_DEFAULT_FIELD = "value";
|
|
14
|
+
/** Only `ia secrets mint gemini-api-key` reads it, so it has no owning module. */
|
|
15
|
+
export const GEMINI_API_KEY_ENV = "GEMINI_API_KEY";
|
|
14
16
|
const SECTION_DRIVERS = "ia CLI: technician daily drivers";
|
|
15
17
|
const SECTION_INFRA = "shared infra (n8n workflows, team-infra scripts)";
|
|
16
18
|
const SECTION_PORTAL = "portal / team-web local dev (prod values live in Vercel, never here)";
|
|
@@ -73,15 +75,28 @@ export const ENV_VARS = [
|
|
|
73
75
|
section: SECTION_DRIVERS,
|
|
74
76
|
comment: "the fixed Linear client team's ID — filled by `ia env fill`",
|
|
75
77
|
},
|
|
78
|
+
{
|
|
79
|
+
name: DOCS_SEARCH_TOKEN_ENV,
|
|
80
|
+
tier: "optional",
|
|
81
|
+
source: "vault",
|
|
82
|
+
doctor: true,
|
|
83
|
+
vault: DEFAULT_TECH_VAULT,
|
|
84
|
+
coveredBy: DOCS_SESSION_ENV,
|
|
85
|
+
neededBy: "ia docs search",
|
|
86
|
+
howToGet: `the shared docs-search API bearer (matches the docs app's IA_DOCS_SEARCH_TOKEN deploy env) — ${inTechVault}`,
|
|
87
|
+
section: SECTION_DRIVERS,
|
|
88
|
+
comment: "shared docs-search API bearer (never expires; preferred over the cookie below) — `ia env fill`",
|
|
89
|
+
},
|
|
76
90
|
{
|
|
77
91
|
name: DOCS_SESSION_ENV,
|
|
78
92
|
tier: "required",
|
|
79
93
|
source: "personal",
|
|
80
94
|
doctor: true,
|
|
95
|
+
coveredBy: DOCS_SEARCH_TOKEN_ENV,
|
|
81
96
|
neededBy: "ia docs search",
|
|
82
97
|
howToGet: "copy the __Secure-authjs.session-token cookie from a logged-in team.installagent.com tab (expires periodically)",
|
|
83
98
|
section: SECTION_DRIVERS,
|
|
84
|
-
comment: "team.installagent.com __Secure-authjs.session-token cookie (expires periodically)",
|
|
99
|
+
comment: "team.installagent.com __Secure-authjs.session-token cookie (expires periodically);\nonly needed when IA_DOCS_SEARCH_TOKEN is unset",
|
|
85
100
|
},
|
|
86
101
|
{
|
|
87
102
|
name: PORTAL_ADMIN_SECRET_ENV,
|
|
@@ -150,7 +165,7 @@ export const ENV_VARS = [
|
|
|
150
165
|
comment: "n8n → Settings → API — filled by `ia env fill`",
|
|
151
166
|
},
|
|
152
167
|
{
|
|
153
|
-
name:
|
|
168
|
+
name: GEMINI_API_KEY_ENV,
|
|
154
169
|
tier: "optional",
|
|
155
170
|
source: "vault",
|
|
156
171
|
doctor: false,
|
|
@@ -181,6 +196,42 @@ export const ENV_VARS = [
|
|
|
181
196
|
paymentsVar("PLAID_ACCESS_TOKEN"),
|
|
182
197
|
paymentsVar("PLAID_BASE_URL"),
|
|
183
198
|
];
|
|
199
|
+
/**
|
|
200
|
+
* The day-one technician set, by name. An ALLOWLIST on purpose, and
|
|
201
|
+
* deliberately not derived from `vault === DEFAULT_TECH_VAULT`: renaming a
|
|
202
|
+
* vault, or moving an item between vaults, must never silently widen what a
|
|
203
|
+
* technician's terminal prints. Anything absent here is `admin` — a new var
|
|
204
|
+
* added to the registry is invisible to technicians until someone adds it
|
|
205
|
+
* here on purpose. Fail closed.
|
|
206
|
+
*
|
|
207
|
+
* env-registry.test.ts pins this against the vault fields, so a name listed
|
|
208
|
+
* here that is neither personal nor in the technician vault fails the build.
|
|
209
|
+
*/
|
|
210
|
+
const TECH_ROLE_VAR_NAMES = new Set([
|
|
211
|
+
GITHUB_API_TOKEN_ENV,
|
|
212
|
+
LINEAR_API_TOKEN_ENV,
|
|
213
|
+
LINEAR_CLIENT_TEAM_ID_ENV,
|
|
214
|
+
DOCS_SEARCH_TOKEN_ENV,
|
|
215
|
+
DOCS_SESSION_ENV,
|
|
216
|
+
PORTAL_ADMIN_SECRET_ENV,
|
|
217
|
+
AIRTABLE_API_TOKEN_ENV,
|
|
218
|
+
GOOGLE_SERVICE_ACCOUNT_KEY_ENV,
|
|
219
|
+
FATHOM_API_KEY_ENV,
|
|
220
|
+
N8N_API_URL_ENV,
|
|
221
|
+
N8N_API_KEY_ENV,
|
|
222
|
+
GEMINI_API_KEY_ENV,
|
|
223
|
+
]);
|
|
224
|
+
export function envVarRole(spec) {
|
|
225
|
+
return TECH_ROLE_VAR_NAMES.has(spec.name) ? "tech" : "admin";
|
|
226
|
+
}
|
|
227
|
+
/** Every var a technician's own tooling may read, fill, or name. */
|
|
228
|
+
export const TECH_ENV_VARS = ENV_VARS.filter((spec) => envVarRole(spec) === "tech");
|
|
229
|
+
/** The rest — infra, portal, payments. Only ever surfaced behind --admin. */
|
|
230
|
+
export const ADMIN_ENV_VARS = ENV_VARS.filter((spec) => envVarRole(spec) === "admin");
|
|
231
|
+
/** The var set a command should act on. `includeAdmin` opts in to all of them. */
|
|
232
|
+
export function envVarsForRole(includeAdmin) {
|
|
233
|
+
return includeAdmin ? ENV_VARS : TECH_ENV_VARS;
|
|
234
|
+
}
|
|
184
235
|
/** `op://<vault>/<item>/<field>` for a vault-sourced var. */
|
|
185
236
|
export function opSecretReference(spec) {
|
|
186
237
|
if (spec.source !== "vault" || !spec.vault) {
|
|
@@ -192,13 +243,17 @@ const ENV_EXAMPLE_HEADER = `# installagent/ workspace root .env — ONE env file
|
|
|
192
243
|
#
|
|
193
244
|
# - \`ia\` commands load this automatically (vars already set in your shell win).
|
|
194
245
|
# - Shell scripts in any repo can use it too: set -a; source ../.env; set +a
|
|
195
|
-
# - Shared values come from 1Password: run \`ia env fill\` (needs
|
|
246
|
+
# - Shared values come from 1Password: run \`ia env fill\` (needs the op CLI
|
|
247
|
+
# authenticated via the 1Password app's CLI integration — \`ia doctor\` checks it).
|
|
196
248
|
# Personal values (marked below) you fill by hand. NEVER commit this file
|
|
197
249
|
# anywhere — the root is not a git repo, and no repo may ever contain it.
|
|
198
250
|
# Only env.example (this placeholder layout, no values) is shareable.
|
|
199
251
|
# - \`ia doctor -w <workspace>\` tells you which vars are still missing and why.
|
|
200
252
|
`;
|
|
201
253
|
const SECTION_RULE_WIDTH = 79;
|
|
254
|
+
/** Rendered under every admin section heading in env.example. */
|
|
255
|
+
const ADMIN_SECTION_NOTE = `# Commented out — granted case-by-case from the ${INFRA_VAULT} vault. If you
|
|
256
|
+
# have the grant, uncomment the line you need, then run \`ia env fill --admin\`.`;
|
|
202
257
|
function sectionHeading(title) {
|
|
203
258
|
const prefix = `# ── ${title} `;
|
|
204
259
|
return prefix + "─".repeat(Math.max(0, SECTION_RULE_WIDTH - prefix.length));
|
|
@@ -211,18 +266,25 @@ function sectionHeading(title) {
|
|
|
211
266
|
export function renderEnvExample() {
|
|
212
267
|
const lines = [ENV_EXAMPLE_HEADER];
|
|
213
268
|
let currentSection = null;
|
|
214
|
-
for (const spec of ENV_VARS) {
|
|
269
|
+
for (const [index, spec] of ENV_VARS.entries()) {
|
|
270
|
+
const admin = envVarRole(spec) === "admin";
|
|
215
271
|
if (spec.section !== currentSection) {
|
|
216
272
|
currentSection = spec.section;
|
|
217
273
|
lines.push(sectionHeading(currentSection));
|
|
274
|
+
if (admin)
|
|
275
|
+
lines.push(ADMIN_SECTION_NOTE);
|
|
218
276
|
}
|
|
219
|
-
lines
|
|
277
|
+
// Admin vars ship commented out. parseEnvFile ignores comment lines, so
|
|
278
|
+
// `ia env fill` never tries to fill one and `ia doctor` never reports it
|
|
279
|
+
// missing — a technician's .env stays a list of their own vars. Uncomment
|
|
280
|
+
// a line only once you have been granted that vault.
|
|
281
|
+
lines.push(admin ? `# ${spec.name}=` : `${spec.name}=`);
|
|
220
282
|
if (spec.comment) {
|
|
221
283
|
for (const commentLine of spec.comment.split("\n")) {
|
|
222
284
|
lines.push(`# ${commentLine}`);
|
|
223
285
|
}
|
|
224
286
|
}
|
|
225
|
-
const next = ENV_VARS[
|
|
287
|
+
const next = ENV_VARS[index + 1];
|
|
226
288
|
if (!next || next.section !== spec.section)
|
|
227
289
|
lines.push("");
|
|
228
290
|
}
|