@groundnuty/macf 0.2.17 → 0.2.19
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/.build-info.json +2 -2
- package/dist/cli/claude-sh.d.ts +82 -0
- package/dist/cli/claude-sh.d.ts.map +1 -1
- package/dist/cli/claude-sh.js +100 -53
- package/dist/cli/claude-sh.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +8 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/update.d.ts +15 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +67 -8
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/env-files-update.d.ts +139 -0
- package/dist/cli/env-files-update.d.ts.map +1 -0
- package/dist/cli/env-files-update.js +281 -0
- package/dist/cli/env-files-update.js.map +1 -0
- package/dist/cli/env-files.d.ts +168 -0
- package/dist/cli/env-files.d.ts.map +1 -0
- package/dist/cli/env-files.js +585 -0
- package/dist/cli/env-files.js.map +1 -0
- package/dist/cli/index.js +20 -0
- package/dist/cli/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,kBAA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E,WAAW,CAAC,MAAM,CAAC,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,0CAA0C,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { MacfAgentConfig } from './config.js';
|
|
2
|
+
/**
|
|
3
|
+
* Result of `refreshEnvFiles` — counts that the caller turns into a
|
|
4
|
+
* single-line summary log. Lists kept as readonly arrays of basenames
|
|
5
|
+
* (not absolute paths) so the summary message stays compact and
|
|
6
|
+
* stable across operator filesystems.
|
|
7
|
+
*/
|
|
8
|
+
export interface RefreshEnvFilesResult {
|
|
9
|
+
readonly refreshed: readonly string[];
|
|
10
|
+
readonly preserved: readonly string[];
|
|
11
|
+
readonly bootstrapped: readonly string[];
|
|
12
|
+
readonly warnedHandEdits: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Refresh per-concern env files in `<projectDir>/.claude/.macf/`.
|
|
16
|
+
*
|
|
17
|
+
* Macf-managed files (env._helpers, env.identity, env.github,
|
|
18
|
+
* env.certs, env.registry):
|
|
19
|
+
* - Absent → write fresh from `generate()`.
|
|
20
|
+
* - Present + matches fresh output → silent no-op.
|
|
21
|
+
* - Present + drift → emit one-time warning to stderr (cites
|
|
22
|
+
* macf#342 + suggests env.local.* / settings.local.json for
|
|
23
|
+
* overrides) + overwrite with fresh output.
|
|
24
|
+
*
|
|
25
|
+
* Operator-managed files (env.telemetry, env.tmux):
|
|
26
|
+
* - Absent → bootstrap-write (one-time fresh write so the workspace
|
|
27
|
+
* starts with a sensible default — operator can edit thereafter).
|
|
28
|
+
* - Present → SILENT NO-OP. Operator's edits preserved unconditionally.
|
|
29
|
+
*
|
|
30
|
+
* **Why "drift = overwrite + warn" not "preserve + warn"**: the
|
|
31
|
+
* macf-managed files have a managed-file header reserving the right to
|
|
32
|
+
* regenerate them. If an operator hand-edits env.identity to change
|
|
33
|
+
* MACF_AGENT_NAME, the canonical place for that override is
|
|
34
|
+
* settings.local.json `env.MACF_AGENT_NAME` (read at runtime by
|
|
35
|
+
* `macf_settings_get`) — not the generated file. PR-C honors the
|
|
36
|
+
* managed-file contract; the warning gives operators time to move
|
|
37
|
+
* their edit.
|
|
38
|
+
*
|
|
39
|
+
* **Stderr write directly** (not via console.warn) so multiple warnings
|
|
40
|
+
* from one update run aren't intermingled with stdout summary logs.
|
|
41
|
+
* Uses `process.stderr.write` consistent with init.ts's existing
|
|
42
|
+
* stderr-diagnostic style.
|
|
43
|
+
*
|
|
44
|
+
* Creates `.claude/.macf/` if absent (mkdir -p). Returns the result
|
|
45
|
+
* record so the caller logs a summary; does not log itself (separation
|
|
46
|
+
* of concerns: this function decides + writes, caller decides how
|
|
47
|
+
* loudly to report).
|
|
48
|
+
*/
|
|
49
|
+
export declare function refreshEnvFiles(projectDir: string, config: MacfAgentConfig): RefreshEnvFilesResult;
|
|
50
|
+
/**
|
|
51
|
+
* Result of `migrateMonolithicClaudeSh`. `migrated: true` means a
|
|
52
|
+
* monolithic claude.sh was detected and replaced with the thin
|
|
53
|
+
* source-loop template + per-concern env files were written.
|
|
54
|
+
* `migrated: false` carries a `reason` discriminator so the caller can
|
|
55
|
+
* log appropriately or short-circuit downstream work.
|
|
56
|
+
*/
|
|
57
|
+
export type MigrationResult = {
|
|
58
|
+
readonly migrated: true;
|
|
59
|
+
} | {
|
|
60
|
+
readonly migrated: false;
|
|
61
|
+
readonly reason: 'already-migrated' | 'no-claude-sh' | string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Detect whether `<projectDir>/claude.sh` is the pre-#342 monolithic
|
|
65
|
+
* template, and if so, migrate it in-place to the thin template +
|
|
66
|
+
* generate the per-concern env files.
|
|
67
|
+
*
|
|
68
|
+
* Detection rules:
|
|
69
|
+
* - No `claude.sh` at all → `{ migrated: false, reason: 'no-claude-sh' }`.
|
|
70
|
+
* (init hasn't run; nothing to migrate.)
|
|
71
|
+
* - `claude.sh` exists + has the source-loop marker (post-#342 thin)
|
|
72
|
+
* → `{ migrated: false, reason: 'already-migrated' }`.
|
|
73
|
+
* Silent no-op; downstream `refreshEnvFiles` still runs.
|
|
74
|
+
* - `claude.sh` exists + has the inline-MACF_AGENT_NAME marker (pre-#342
|
|
75
|
+
* monolithic) → migrate.
|
|
76
|
+
* - Anything else (operator-rewritten launcher, third-party edit) →
|
|
77
|
+
* `{ migrated: false, reason: 'unrecognized-template' }`. Conservative:
|
|
78
|
+
* don't auto-overwrite something we didn't author. Operator can
|
|
79
|
+
* run `macf init --force` to opt into the migration explicitly.
|
|
80
|
+
*
|
|
81
|
+
* Migration steps (when migrated=true):
|
|
82
|
+
* 1. `writeEnvFiles(projectDir, config)` — fresh per-concern env files
|
|
83
|
+
* from the config in `.macf/macf-agent.json`. The JSON is the
|
|
84
|
+
* source of truth post-migration; we do NOT extract values from
|
|
85
|
+
* the monolithic claude.sh (the JSON has them already, and parsing
|
|
86
|
+
* shell to recover values is fragile + unnecessary).
|
|
87
|
+
* 2. `writeClaudeSh(projectDir, config)` — overwrite with the thin
|
|
88
|
+
* template per PR-B. Thin template depends on env files written
|
|
89
|
+
* in step 1.
|
|
90
|
+
*
|
|
91
|
+
* **Migration is auto-detected, not opt-in.** Operators upgrading from
|
|
92
|
+
* a CLI carrying the monolithic template to one carrying this code
|
|
93
|
+
* get migrated transparently on first `macf update`. Opt-out is
|
|
94
|
+
* `--no-migrate-env-files` at the CLI layer (handled in update.ts).
|
|
95
|
+
*
|
|
96
|
+
* **Idempotent**: re-running on an already-migrated workspace returns
|
|
97
|
+
* `{ migrated: false, reason: 'already-migrated' }` without writing
|
|
98
|
+
* anything. Safe for repeated `macf update` calls.
|
|
99
|
+
*/
|
|
100
|
+
export declare function migrateMonolithicClaudeSh(projectDir: string, config: MacfAgentConfig): MigrationResult;
|
|
101
|
+
/**
|
|
102
|
+
* Read `.claude/settings.local.json` and return the list of `env.*`
|
|
103
|
+
* keys whose names start with `MACF_` or `OTEL_`. These are the
|
|
104
|
+
* subset that the multi-file env layout (#342) is replacing —
|
|
105
|
+
* historically operators set them in the JSON env block as a
|
|
106
|
+
* settings-driven override; post-#342 the canonical location is per-
|
|
107
|
+
* concern env files (env.identity for MACF_AGENT_NAME, env.telemetry
|
|
108
|
+
* for OTEL_*, etc.) or the `env.local.*` operator override pattern.
|
|
109
|
+
*
|
|
110
|
+
* **Backward-compat preserved structurally**: `macf_settings_get` in
|
|
111
|
+
* env._helpers (PR-A / PR-B) still reads `env.MACF_*` and `env.OTEL_*`
|
|
112
|
+
* from settings.local.json at runtime. So existing operator overrides
|
|
113
|
+
* keep working — the deprecation warning is the SOFT signal giving
|
|
114
|
+
* operators a window to migrate. Hard removal would be a future PR
|
|
115
|
+
* (Option α §"clean break with deprecation shim" per #342 thread).
|
|
116
|
+
*
|
|
117
|
+
* **No automatic migration of JSON env keys** in this PR. The risk
|
|
118
|
+
* surface is too broad: operators may have intentional layered
|
|
119
|
+
* configurations where the JSON value differs from the file default
|
|
120
|
+
* (e.g., dev endpoint in JSON, prod default baked into file). Auto-
|
|
121
|
+
* moving the value loses that distinction. Manual migration after
|
|
122
|
+
* seeing the warning is the conservative choice; auto-migration can
|
|
123
|
+
* be a future enhancement once the patterns are well-understood.
|
|
124
|
+
*
|
|
125
|
+
* Returns a sorted, deduplicated list of keys (without the `env.`
|
|
126
|
+
* prefix — caller formats them). Empty when settings.local.json is
|
|
127
|
+
* absent / has no `env` block / has no matching keys / is malformed
|
|
128
|
+
* (silent on malformed: settings-writer.ts surfaces parse errors via
|
|
129
|
+
* its other code paths; we don't double-report).
|
|
130
|
+
*/
|
|
131
|
+
export declare function detectSettingsLocalEnvKeys(projectDir: string): readonly string[];
|
|
132
|
+
/**
|
|
133
|
+
* Format the per-key deprecation warning lines for stderr. Returned as
|
|
134
|
+
* a single multi-line string the caller can emit in one
|
|
135
|
+
* `process.stderr.write`. Empty string when `keys` is empty (caller
|
|
136
|
+
* doesn't have to special-case).
|
|
137
|
+
*/
|
|
138
|
+
export declare function formatDeprecationWarning(keys: readonly string[]): string;
|
|
139
|
+
//# sourceMappingURL=env-files-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-files-update.d.ts","sourceRoot":"","sources":["../../src/cli/env-files-update.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA4CnD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,eAAe,GACtB,qBAAqB,CAkDvB;AAMD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,cAAc,GAAG,MAAM,CAAA;CAAE,CAAC;AAchG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,eAAe,GACtB,eAAe,CA0BjB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,GACjB,SAAS,MAAM,EAAE,CAqBnB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAexE"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update + migration semantics for the per-concern env-file layout
|
|
3
|
+
* (groundnuty/macf#342). PR-C of the 4-PR sequence:
|
|
4
|
+
*
|
|
5
|
+
* PR-A — pure generators (env-files.ts) [merged ee4604d]
|
|
6
|
+
* PR-B — thin claude.sh + writeEnvFiles + init wiring [merged b75c7ff]
|
|
7
|
+
* PR-C (this PR) — `macf update` wiring + monolithic→multi-file
|
|
8
|
+
* migration tool + settings.local.json env block compat
|
|
9
|
+
* PR-D — operator docs
|
|
10
|
+
*
|
|
11
|
+
* Three concerns live here, kept in one module so the refresh pipeline
|
|
12
|
+
* is easy to read end-to-end:
|
|
13
|
+
*
|
|
14
|
+
* 1. `refreshEnvFiles()` — refresh-and-preserve semantics for
|
|
15
|
+
* macf-managed (overwrite + warn-on-handedit) and operator-managed
|
|
16
|
+
* (silent no-op when present) env files.
|
|
17
|
+
*
|
|
18
|
+
* 2. `migrateMonolithicClaudeSh()` — auto-migration from the
|
|
19
|
+
* pre-#342 monolithic claude.sh to the thin source-loop template
|
|
20
|
+
* + per-concern env files. Detection-gated; runs transparently on
|
|
21
|
+
* first `macf update` after upgrading to a CLI carrying this code.
|
|
22
|
+
*
|
|
23
|
+
* 3. `detectSettingsLocalEnvKeys()` — surfaces deprecated
|
|
24
|
+
* `env.MACF_*` / `env.OTEL_*` keys still living in
|
|
25
|
+
* `.claude/settings.local.json` per Option α (clean break with
|
|
26
|
+
* deprecation shim). The shim itself is structural — `macf_settings_get`
|
|
27
|
+
* in env._helpers continues to read these keys at runtime — so
|
|
28
|
+
* operators have a window to migrate; PR-C only emits the
|
|
29
|
+
* one-time warning.
|
|
30
|
+
*
|
|
31
|
+
* **Invariant**: this module never deletes operator state. Macf-managed
|
|
32
|
+
* files are overwritten only with the (single source of truth)
|
|
33
|
+
* generator output; operator-managed files (env.telemetry, env.tmux)
|
|
34
|
+
* are preserved unconditionally once they exist; settings.local.json
|
|
35
|
+
* is read-only here (the deprecation warning surfaces them, but no
|
|
36
|
+
* automatic JSON-key migration in this PR — the risk surface is too
|
|
37
|
+
* broad for one change. Operators see the warning and migrate by hand).
|
|
38
|
+
*/
|
|
39
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
40
|
+
import { join, resolve } from 'node:path';
|
|
41
|
+
import { generateEnvCerts, generateEnvGitHub, generateEnvHelpers, generateEnvIdentity, generateEnvRegistry, generateEnvTelemetry, generateEnvTmux, writeEnvFiles, } from './env-files.js';
|
|
42
|
+
import { writeClaudeSh } from './claude-sh.js';
|
|
43
|
+
const MANAGED_ENV_FILES = [
|
|
44
|
+
{ name: 'env._helpers', generate: () => generateEnvHelpers() },
|
|
45
|
+
{ name: 'env.identity', generate: generateEnvIdentity },
|
|
46
|
+
{ name: 'env.github', generate: generateEnvGitHub },
|
|
47
|
+
{ name: 'env.certs', generate: generateEnvCerts },
|
|
48
|
+
{ name: 'env.registry', generate: generateEnvRegistry },
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* The set of operator-managed env files. Bootstrap-write on first
|
|
52
|
+
* `macf update` if absent, then preserved unconditionally on subsequent
|
|
53
|
+
* runs — operator's edits are theirs to own. The `generate` function
|
|
54
|
+
* is only called when the file doesn't exist yet.
|
|
55
|
+
*/
|
|
56
|
+
const OPERATOR_ENV_FILES = [
|
|
57
|
+
{ name: 'env.telemetry', generate: generateEnvTelemetry },
|
|
58
|
+
{ name: 'env.tmux', generate: generateEnvTmux },
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* Refresh per-concern env files in `<projectDir>/.claude/.macf/`.
|
|
62
|
+
*
|
|
63
|
+
* Macf-managed files (env._helpers, env.identity, env.github,
|
|
64
|
+
* env.certs, env.registry):
|
|
65
|
+
* - Absent → write fresh from `generate()`.
|
|
66
|
+
* - Present + matches fresh output → silent no-op.
|
|
67
|
+
* - Present + drift → emit one-time warning to stderr (cites
|
|
68
|
+
* macf#342 + suggests env.local.* / settings.local.json for
|
|
69
|
+
* overrides) + overwrite with fresh output.
|
|
70
|
+
*
|
|
71
|
+
* Operator-managed files (env.telemetry, env.tmux):
|
|
72
|
+
* - Absent → bootstrap-write (one-time fresh write so the workspace
|
|
73
|
+
* starts with a sensible default — operator can edit thereafter).
|
|
74
|
+
* - Present → SILENT NO-OP. Operator's edits preserved unconditionally.
|
|
75
|
+
*
|
|
76
|
+
* **Why "drift = overwrite + warn" not "preserve + warn"**: the
|
|
77
|
+
* macf-managed files have a managed-file header reserving the right to
|
|
78
|
+
* regenerate them. If an operator hand-edits env.identity to change
|
|
79
|
+
* MACF_AGENT_NAME, the canonical place for that override is
|
|
80
|
+
* settings.local.json `env.MACF_AGENT_NAME` (read at runtime by
|
|
81
|
+
* `macf_settings_get`) — not the generated file. PR-C honors the
|
|
82
|
+
* managed-file contract; the warning gives operators time to move
|
|
83
|
+
* their edit.
|
|
84
|
+
*
|
|
85
|
+
* **Stderr write directly** (not via console.warn) so multiple warnings
|
|
86
|
+
* from one update run aren't intermingled with stdout summary logs.
|
|
87
|
+
* Uses `process.stderr.write` consistent with init.ts's existing
|
|
88
|
+
* stderr-diagnostic style.
|
|
89
|
+
*
|
|
90
|
+
* Creates `.claude/.macf/` if absent (mkdir -p). Returns the result
|
|
91
|
+
* record so the caller logs a summary; does not log itself (separation
|
|
92
|
+
* of concerns: this function decides + writes, caller decides how
|
|
93
|
+
* loudly to report).
|
|
94
|
+
*/
|
|
95
|
+
export function refreshEnvFiles(projectDir, config) {
|
|
96
|
+
const absDir = resolve(projectDir);
|
|
97
|
+
const envDir = join(absDir, '.claude', '.macf');
|
|
98
|
+
mkdirSync(envDir, { recursive: true });
|
|
99
|
+
const refreshed = [];
|
|
100
|
+
const preserved = [];
|
|
101
|
+
const bootstrapped = [];
|
|
102
|
+
const warnedHandEdits = [];
|
|
103
|
+
// Macf-managed files: overwrite + warn on hand-edit.
|
|
104
|
+
for (const { name, generate } of MANAGED_ENV_FILES) {
|
|
105
|
+
const path = join(envDir, name);
|
|
106
|
+
const fresh = generate(config);
|
|
107
|
+
if (!existsSync(path)) {
|
|
108
|
+
writeFileSync(path, fresh, { mode: 0o644 });
|
|
109
|
+
refreshed.push(name);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const current = readFileSync(path, 'utf-8');
|
|
113
|
+
if (current === fresh) {
|
|
114
|
+
// Silent no-op — no on-disk change, no log.
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
// Drift detected. Warn once, then overwrite to honor the
|
|
118
|
+
// managed-file contract.
|
|
119
|
+
process.stderr.write(`Warning: hand-edited macf-managed env file detected: .claude/.macf/${name}\n` +
|
|
120
|
+
` Overwriting with the canonical generator output (macf#342).\n` +
|
|
121
|
+
` To customize identity / endpoints, prefer:\n` +
|
|
122
|
+
` - .claude/settings.local.json \`env\` block (read by macf_settings_get)\n` +
|
|
123
|
+
` - .claude/.macf/env.local.<name> (sources after canonical files)\n`);
|
|
124
|
+
writeFileSync(path, fresh, { mode: 0o644 });
|
|
125
|
+
refreshed.push(name);
|
|
126
|
+
warnedHandEdits.push(name);
|
|
127
|
+
}
|
|
128
|
+
// Operator-managed files: bootstrap-write if absent; preserve otherwise.
|
|
129
|
+
for (const { name, generate } of OPERATOR_ENV_FILES) {
|
|
130
|
+
const path = join(envDir, name);
|
|
131
|
+
if (existsSync(path)) {
|
|
132
|
+
preserved.push(name);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
writeFileSync(path, generate(config), { mode: 0o644 });
|
|
136
|
+
bootstrapped.push(name);
|
|
137
|
+
}
|
|
138
|
+
return { refreshed, preserved, bootstrapped, warnedHandEdits };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Marker for the pre-#342 monolithic claude.sh template: it inlines
|
|
142
|
+
* `export MACF_AGENT_NAME=` directly. The post-#342 thin template
|
|
143
|
+
* sources env files instead — MACF_AGENT_NAME is exported from
|
|
144
|
+
* `.claude/.macf/env.identity`, NOT inline in claude.sh. The
|
|
145
|
+
* source-loop sentinel below is the post-#342 marker for the
|
|
146
|
+
* inverse check (defensive — if both are present the file is in
|
|
147
|
+
* an inconsistent state we shouldn't auto-migrate).
|
|
148
|
+
*/
|
|
149
|
+
const MONOLITHIC_CLAUDE_SH_MARKER = 'export MACF_AGENT_NAME=';
|
|
150
|
+
const THIN_CLAUDE_SH_MARKER = 'for f in "$SCRIPT_DIR/.claude/.macf"/env.*';
|
|
151
|
+
/**
|
|
152
|
+
* Detect whether `<projectDir>/claude.sh` is the pre-#342 monolithic
|
|
153
|
+
* template, and if so, migrate it in-place to the thin template +
|
|
154
|
+
* generate the per-concern env files.
|
|
155
|
+
*
|
|
156
|
+
* Detection rules:
|
|
157
|
+
* - No `claude.sh` at all → `{ migrated: false, reason: 'no-claude-sh' }`.
|
|
158
|
+
* (init hasn't run; nothing to migrate.)
|
|
159
|
+
* - `claude.sh` exists + has the source-loop marker (post-#342 thin)
|
|
160
|
+
* → `{ migrated: false, reason: 'already-migrated' }`.
|
|
161
|
+
* Silent no-op; downstream `refreshEnvFiles` still runs.
|
|
162
|
+
* - `claude.sh` exists + has the inline-MACF_AGENT_NAME marker (pre-#342
|
|
163
|
+
* monolithic) → migrate.
|
|
164
|
+
* - Anything else (operator-rewritten launcher, third-party edit) →
|
|
165
|
+
* `{ migrated: false, reason: 'unrecognized-template' }`. Conservative:
|
|
166
|
+
* don't auto-overwrite something we didn't author. Operator can
|
|
167
|
+
* run `macf init --force` to opt into the migration explicitly.
|
|
168
|
+
*
|
|
169
|
+
* Migration steps (when migrated=true):
|
|
170
|
+
* 1. `writeEnvFiles(projectDir, config)` — fresh per-concern env files
|
|
171
|
+
* from the config in `.macf/macf-agent.json`. The JSON is the
|
|
172
|
+
* source of truth post-migration; we do NOT extract values from
|
|
173
|
+
* the monolithic claude.sh (the JSON has them already, and parsing
|
|
174
|
+
* shell to recover values is fragile + unnecessary).
|
|
175
|
+
* 2. `writeClaudeSh(projectDir, config)` — overwrite with the thin
|
|
176
|
+
* template per PR-B. Thin template depends on env files written
|
|
177
|
+
* in step 1.
|
|
178
|
+
*
|
|
179
|
+
* **Migration is auto-detected, not opt-in.** Operators upgrading from
|
|
180
|
+
* a CLI carrying the monolithic template to one carrying this code
|
|
181
|
+
* get migrated transparently on first `macf update`. Opt-out is
|
|
182
|
+
* `--no-migrate-env-files` at the CLI layer (handled in update.ts).
|
|
183
|
+
*
|
|
184
|
+
* **Idempotent**: re-running on an already-migrated workspace returns
|
|
185
|
+
* `{ migrated: false, reason: 'already-migrated' }` without writing
|
|
186
|
+
* anything. Safe for repeated `macf update` calls.
|
|
187
|
+
*/
|
|
188
|
+
export function migrateMonolithicClaudeSh(projectDir, config) {
|
|
189
|
+
const absDir = resolve(projectDir);
|
|
190
|
+
const claudeShPath = join(absDir, 'claude.sh');
|
|
191
|
+
if (!existsSync(claudeShPath)) {
|
|
192
|
+
return { migrated: false, reason: 'no-claude-sh' };
|
|
193
|
+
}
|
|
194
|
+
const content = readFileSync(claudeShPath, 'utf-8');
|
|
195
|
+
// Post-#342 thin template marker present → already migrated.
|
|
196
|
+
if (content.includes(THIN_CLAUDE_SH_MARKER)) {
|
|
197
|
+
return { migrated: false, reason: 'already-migrated' };
|
|
198
|
+
}
|
|
199
|
+
// Pre-#342 monolithic marker absent → unrecognized template (operator
|
|
200
|
+
// hand-edit, third-party launcher). Don't auto-overwrite something we
|
|
201
|
+
// didn't author. Operator can run `macf init --force` to opt into it.
|
|
202
|
+
if (!content.includes(MONOLITHIC_CLAUDE_SH_MARKER)) {
|
|
203
|
+
return { migrated: false, reason: 'unrecognized-template' };
|
|
204
|
+
}
|
|
205
|
+
// Monolithic detected. Migrate.
|
|
206
|
+
writeEnvFiles(absDir, config);
|
|
207
|
+
writeClaudeSh(absDir, config);
|
|
208
|
+
return { migrated: true };
|
|
209
|
+
}
|
|
210
|
+
// ---------------------------------------------------------------------------
|
|
211
|
+
// detectSettingsLocalEnvKeys — Option α deprecation surface
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
/**
|
|
214
|
+
* Read `.claude/settings.local.json` and return the list of `env.*`
|
|
215
|
+
* keys whose names start with `MACF_` or `OTEL_`. These are the
|
|
216
|
+
* subset that the multi-file env layout (#342) is replacing —
|
|
217
|
+
* historically operators set them in the JSON env block as a
|
|
218
|
+
* settings-driven override; post-#342 the canonical location is per-
|
|
219
|
+
* concern env files (env.identity for MACF_AGENT_NAME, env.telemetry
|
|
220
|
+
* for OTEL_*, etc.) or the `env.local.*` operator override pattern.
|
|
221
|
+
*
|
|
222
|
+
* **Backward-compat preserved structurally**: `macf_settings_get` in
|
|
223
|
+
* env._helpers (PR-A / PR-B) still reads `env.MACF_*` and `env.OTEL_*`
|
|
224
|
+
* from settings.local.json at runtime. So existing operator overrides
|
|
225
|
+
* keep working — the deprecation warning is the SOFT signal giving
|
|
226
|
+
* operators a window to migrate. Hard removal would be a future PR
|
|
227
|
+
* (Option α §"clean break with deprecation shim" per #342 thread).
|
|
228
|
+
*
|
|
229
|
+
* **No automatic migration of JSON env keys** in this PR. The risk
|
|
230
|
+
* surface is too broad: operators may have intentional layered
|
|
231
|
+
* configurations where the JSON value differs from the file default
|
|
232
|
+
* (e.g., dev endpoint in JSON, prod default baked into file). Auto-
|
|
233
|
+
* moving the value loses that distinction. Manual migration after
|
|
234
|
+
* seeing the warning is the conservative choice; auto-migration can
|
|
235
|
+
* be a future enhancement once the patterns are well-understood.
|
|
236
|
+
*
|
|
237
|
+
* Returns a sorted, deduplicated list of keys (without the `env.`
|
|
238
|
+
* prefix — caller formats them). Empty when settings.local.json is
|
|
239
|
+
* absent / has no `env` block / has no matching keys / is malformed
|
|
240
|
+
* (silent on malformed: settings-writer.ts surfaces parse errors via
|
|
241
|
+
* its other code paths; we don't double-report).
|
|
242
|
+
*/
|
|
243
|
+
export function detectSettingsLocalEnvKeys(projectDir) {
|
|
244
|
+
const absDir = resolve(projectDir);
|
|
245
|
+
const path = join(absDir, '.claude', 'settings.local.json');
|
|
246
|
+
if (!existsSync(path))
|
|
247
|
+
return [];
|
|
248
|
+
let parsed;
|
|
249
|
+
try {
|
|
250
|
+
parsed = JSON.parse(readFileSync(path, 'utf-8'));
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
// Don't double-report parse errors here; settings-writer.ts
|
|
254
|
+
// surfaces them via its own paths when it touches the file.
|
|
255
|
+
return [];
|
|
256
|
+
}
|
|
257
|
+
const envBlock = parsed['env'];
|
|
258
|
+
if (envBlock === null || typeof envBlock !== 'object')
|
|
259
|
+
return [];
|
|
260
|
+
const keys = Object.keys(envBlock).filter((k) => k.startsWith('MACF_') || k.startsWith('OTEL_'));
|
|
261
|
+
return Array.from(new Set(keys)).sort();
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Format the per-key deprecation warning lines for stderr. Returned as
|
|
265
|
+
* a single multi-line string the caller can emit in one
|
|
266
|
+
* `process.stderr.write`. Empty string when `keys` is empty (caller
|
|
267
|
+
* doesn't have to special-case).
|
|
268
|
+
*/
|
|
269
|
+
export function formatDeprecationWarning(keys) {
|
|
270
|
+
if (keys.length === 0)
|
|
271
|
+
return '';
|
|
272
|
+
const lines = [
|
|
273
|
+
`Warning: deprecated env key(s) in .claude/settings.local.json (macf#342):`,
|
|
274
|
+
];
|
|
275
|
+
for (const k of keys) {
|
|
276
|
+
lines.push(` env.${k}`);
|
|
277
|
+
}
|
|
278
|
+
lines.push(` These are still read at runtime by macf_settings_get (backward-compat),`, ` but the canonical location is now .claude/.macf/env.* (or env.local.*`, ` for operator overrides). See macf#342.`, '');
|
|
279
|
+
return lines.join('\n');
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=env-files-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-files-update.js","sourceRoot":"","sources":["../../src/cli/env-files-update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAsB/C,MAAM,iBAAiB,GAA8B;IACnD,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,EAAE;IAC9D,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,mBAAmB,EAAE;IACvD,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE;IACnD,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE;IACjD,EAAE,IAAI,E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;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;QAC5D,4DAA4D;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEjE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAmC,CAAC,CAAC,MAAM,CAClE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CACtD,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAuB;IAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG;QACZ,2EAA2E;KAC5E,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,IAAI,CACR,2EAA2E,EAC3E,yEAAyE,EACzE,0CAA0C,EAC1C,EAAE,CACH,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { MacfAgentConfig } from './config.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate `.claude/.macf/env._helpers` content.
|
|
4
|
+
*
|
|
5
|
+
* Defines shell helper FUNCTIONS used by sibling env.* files. The
|
|
6
|
+
* underscore prefix sorts this file BEFORE alphabetical-letter siblings
|
|
7
|
+
* (`env.certs`, `env.github`, `env.identity`, etc.), so when claude.sh
|
|
8
|
+
* sources `env.*` in alphabetical order via shell glob, this file's
|
|
9
|
+
* functions are defined before any caller is sourced.
|
|
10
|
+
*
|
|
11
|
+
* Currently exports one helper:
|
|
12
|
+
*
|
|
13
|
+
* macf_settings_get(var_name)
|
|
14
|
+
* Reads `.env.<var_name>` from `<workspace>/.claude/settings.local.json`
|
|
15
|
+
* via jq. Returns empty string if the file/key is missing or jq isn't
|
|
16
|
+
* installed. Used by:
|
|
17
|
+
* - env.identity — 3-layer settings priority for MACF_AGENT_NAME / ROLE
|
|
18
|
+
* - env.telemetry — 4-layer endpoint chain for MACF_OTEL_ENDPOINT
|
|
19
|
+
*
|
|
20
|
+
* **No exports** — this is a function-definition file. Sourcing it has
|
|
21
|
+
* no observable effect beyond making functions callable in the sourcing
|
|
22
|
+
* shell. macf#313 introduced the helper inline in claude.sh; macf#342
|
|
23
|
+
* extracted it here so multiple env.* files can share it without each
|
|
24
|
+
* file having to redeclare it (PR-A had `macf_settings_get` duplicated
|
|
25
|
+
* inside generateEnvIdentity to make env.identity self-contained;
|
|
26
|
+
* macf#342 PR-B moves the single source-of-truth into env._helpers).
|
|
27
|
+
*
|
|
28
|
+
* Pure function — no I/O. Doesn't take a config arg because the helper
|
|
29
|
+
* body is config-independent (it reads from settings.local.json at
|
|
30
|
+
* runtime, not from baked values).
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateEnvHelpers(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Generate `.claude/.macf/env.identity` content.
|
|
35
|
+
*
|
|
36
|
+
* The 5 identity vars currently set BEFORE the tmux self-wrap in
|
|
37
|
+
* `claude-sh.ts`:
|
|
38
|
+
*
|
|
39
|
+
* MACF_WORKSPACE_DIR — absolute path to the workspace (cross-repo cwd
|
|
40
|
+
* safety, see #161 + coordination.md)
|
|
41
|
+
* MACF_PROJECT — project name
|
|
42
|
+
* MACF_AGENT_NAME — agent identifier (with 3-layer settings priority)
|
|
43
|
+
* MACF_AGENT_ROLE — agent role (with 3-layer settings priority)
|
|
44
|
+
* MACF_AGENT_TYPE — `permanent` | `worker`
|
|
45
|
+
*
|
|
46
|
+
* MACF_AGENT_NAME and MACF_AGENT_ROLE preserve the post-#313 settings-driven
|
|
47
|
+
* 3-layer priority (env > settings.local.json > baked default). Reading
|
|
48
|
+
* settings.local.json requires the `macf_settings_get` helper, which is
|
|
49
|
+
* defined in `env._helpers` (sourced before this file alphabetically by
|
|
50
|
+
* claude.sh's `for f in env.*` glob — underscore prefix sorts first).
|
|
51
|
+
*
|
|
52
|
+
* **Note on SCRIPT_DIR**: `MACF_WORKSPACE_DIR=$SCRIPT_DIR` requires that
|
|
53
|
+
* the sourcing script (claude.sh) sets SCRIPT_DIR before sourcing. That
|
|
54
|
+
* contract is documented in claude.sh; this file trusts it.
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateEnvIdentity(config: MacfAgentConfig): string;
|
|
57
|
+
/**
|
|
58
|
+
* Generate `.claude/.macf/env.github` content.
|
|
59
|
+
*
|
|
60
|
+
* Emits APP_ID / INSTALL_ID / KEY_PATH App-cred exports + the relative-
|
|
61
|
+
* path resolver + the fail-loud `macf-gh-token.sh` invocation + git
|
|
62
|
+
* author/committer name exports.
|
|
63
|
+
*
|
|
64
|
+
* **Empty placeholder in local-mode** (cfg.registry.type === 'local',
|
|
65
|
+
* DR-024). The body is just the header + schema_version + a comment
|
|
66
|
+
* explaining why — no GitHub App tokens are minted in local-registry
|
|
67
|
+
* mode (commits land as the local user, not as `app/<bot>[bot]`). The
|
|
68
|
+
* absence of GH_TOKEN-mint logic is what makes local-mode work without
|
|
69
|
+
* GitHub credentials.
|
|
70
|
+
*/
|
|
71
|
+
export declare function generateEnvGitHub(config: MacfAgentConfig): string;
|
|
72
|
+
/**
|
|
73
|
+
* Generate `.claude/.macf/env.certs` content.
|
|
74
|
+
*
|
|
75
|
+
* CA + agent cert paths + log path. Local-mode CAs live next to the
|
|
76
|
+
* registry file (`~/.macf/registry/<project>.ca.{crt,key}`), GitHub-mode
|
|
77
|
+
* CAs live under `~/.macf/certs/<project>/`. Both modes need
|
|
78
|
+
* MACF_CA_CERT/MACF_CA_KEY exported for channel-server mTLS.
|
|
79
|
+
*/
|
|
80
|
+
export declare function generateEnvCerts(config: MacfAgentConfig): string;
|
|
81
|
+
/**
|
|
82
|
+
* Generate `.claude/.macf/env.registry` content.
|
|
83
|
+
*
|
|
84
|
+
* MACF_REGISTRY_TYPE + per-type vars. Mirrors `claude-sh.ts`'s
|
|
85
|
+
* `registryEnvLines` exhaustive switch (so a new RegistryConfig variant
|
|
86
|
+
* fails the build here too, forcing a paired update).
|
|
87
|
+
*/
|
|
88
|
+
export declare function generateEnvRegistry(config: MacfAgentConfig): string;
|
|
89
|
+
/**
|
|
90
|
+
* Generate `.claude/.macf/env.telemetry` content.
|
|
91
|
+
*
|
|
92
|
+
* The 3 OTel mandatory gates + per-signal exporters + endpoint resolution.
|
|
93
|
+
* Mirrors `claude-sh.ts`'s `otelTelemetryLines` (including the same
|
|
94
|
+
* shell-unsafe-char rejection on MACF_OTEL_ENDPOINT and the same default
|
|
95
|
+
* endpoint `http://localhost:14318` per macf-devops-toolkit canonical k3d
|
|
96
|
+
* topology).
|
|
97
|
+
*
|
|
98
|
+
* **Minimal placeholder when `MACF_OTEL_DISABLED=1`** (operator opt-out at
|
|
99
|
+
* template-time per macf#197). Body shrinks to header + schema_version +
|
|
100
|
+
* a comment explaining the opt-out — no OTel exports emitted, so sourcing
|
|
101
|
+
* the file is a no-op.
|
|
102
|
+
*
|
|
103
|
+
* @param env — defaults to `process.env`; tests inject a fake.
|
|
104
|
+
*/
|
|
105
|
+
export declare function generateEnvTelemetry(config: MacfAgentConfig, env?: NodeJS.ProcessEnv): string;
|
|
106
|
+
/**
|
|
107
|
+
* Generate `.claude/.macf/env.tmux` content.
|
|
108
|
+
*
|
|
109
|
+
* MACF_TMUX_SESSION + MACF_TMUX_WINDOW for the on-notify wake path
|
|
110
|
+
* (macf#185). When the channel server's onNotify handler fires, it shells
|
|
111
|
+
* out to `tmux-send-to-claude.sh <session>:<window> <prompt>` to inject
|
|
112
|
+
* the notification as the TUI's next input turn.
|
|
113
|
+
*
|
|
114
|
+
* **Minimal placeholder when neither field is set in config.** The wake
|
|
115
|
+
* path falls back to auto-detect from $TMUX in that case (existing
|
|
116
|
+
* behavior — no env var needed). Avoids generating an empty-export file.
|
|
117
|
+
*/
|
|
118
|
+
export declare function generateEnvTmux(config: MacfAgentConfig): string;
|
|
119
|
+
/**
|
|
120
|
+
* Result of `writeEnvFiles` — lists of file paths that were written and
|
|
121
|
+
* (currently empty; reserved for PR-C migration logic that may skip
|
|
122
|
+
* operator-managed files when they already exist) skipped.
|
|
123
|
+
*
|
|
124
|
+
* Returned so callers (init.ts, update.ts in PR-C) can log a summary
|
|
125
|
+
* line ("Wrote 7 env files to .claude/.macf/") without re-deriving the
|
|
126
|
+
* file list from an external mapping.
|
|
127
|
+
*/
|
|
128
|
+
export interface WriteEnvFilesResult {
|
|
129
|
+
readonly written: readonly string[];
|
|
130
|
+
readonly skipped: readonly string[];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Write all 7 per-concern env files into `<projectDir>/.claude/.macf/`.
|
|
134
|
+
*
|
|
135
|
+
* env._helpers — library file (sourced first per alphabetical order)
|
|
136
|
+
* env.certs — cert + log paths
|
|
137
|
+
* env.github — App creds + GH_TOKEN mint (empty-comment in local-mode)
|
|
138
|
+
* env.identity — MACF_PROJECT / MACF_AGENT_NAME / ROLE / TYPE / WORKSPACE_DIR
|
|
139
|
+
* env.registry — MACF_REGISTRY_TYPE + per-type vars
|
|
140
|
+
* env.telemetry — OTel gates + endpoint (operator-managed)
|
|
141
|
+
* env.tmux — MACF_TMUX_SESSION / MACF_TMUX_WINDOW (operator-managed)
|
|
142
|
+
*
|
|
143
|
+
* **Always emits all 7 files** — even when the concern is empty (e.g.,
|
|
144
|
+
* env.tmux with no tmux_session set, env.github in local-mode). The
|
|
145
|
+
* generators emit a header + comment explaining the empty case. This
|
|
146
|
+
* keeps the on-disk layout uniform across configs, so claude.sh's
|
|
147
|
+
* source-loop pattern (`for f in env.*; do source "$f"; done`) is
|
|
148
|
+
* deterministic — no "did the file get skipped" branching for the
|
|
149
|
+
* sourcing script to consider.
|
|
150
|
+
*
|
|
151
|
+
* **Mode 0644** — these are sourced, not executed; no execute bit needed.
|
|
152
|
+
*
|
|
153
|
+
* **Overwrites unconditionally** — macf-managed files have a managed
|
|
154
|
+
* header warning operators not to edit. Operator-managed files
|
|
155
|
+
* (env.telemetry, env.tmux) get overwritten too in PR-B because PR-C
|
|
156
|
+
* hasn't added the preserve-existing logic yet. Init's contract is
|
|
157
|
+
* "fresh write"; update's preserve-existing contract lands in PR-C.
|
|
158
|
+
*
|
|
159
|
+
* **Creates `.claude/.macf/`** with mkdir -p semantics. The directory
|
|
160
|
+
* may not exist on a fresh init (the `.claude/` parent often does
|
|
161
|
+
* because of `settings.json` / `rules/`, but `.macf/` under it is new
|
|
162
|
+
* to PR-B).
|
|
163
|
+
*
|
|
164
|
+
* @returns Lists of absolute file paths for caller logging. `skipped`
|
|
165
|
+
* is reserved for PR-C and currently always empty.
|
|
166
|
+
*/
|
|
167
|
+
export declare function writeEnvFiles(projectDir: string, config: MacfAgentConfig): WriteEnvFilesResult;
|
|
168
|
+
//# sourceMappingURL=env-files.d.ts.map
|