@open-agent-toolkit/cli 0.0.54 → 0.0.55
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/assets/docs/cli-utilities/config-and-local-state.md +4 -0
- package/assets/docs/cli-utilities/configuration.md +25 -0
- package/assets/public-package-versions.json +4 -4
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +34 -0
- package/dist/commands/project/archive/archive-utils.d.ts +53 -0
- package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
- package/dist/commands/project/archive/archive-utils.js +49 -2
- package/dist/commands/project/archive/index.d.ts.map +1 -1
- package/dist/commands/project/archive/index.js +58 -10
- package/dist/config/oat-config.d.ts +2 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +15 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +2 -0
- package/package.json +2 -2
|
@@ -57,6 +57,10 @@ Archive lifecycle settings live here as shared repo config:
|
|
|
57
57
|
- `archive.s3SyncOnComplete`
|
|
58
58
|
- `archive.summaryExportPath`
|
|
59
59
|
- `archive.wrapUpExportPath`
|
|
60
|
+
- `archive.awsProfile`
|
|
61
|
+
- `archive.awsRegion`
|
|
62
|
+
|
|
63
|
+
`archive.awsProfile` and `archive.awsRegion` are forwarded as `AWS_PROFILE` / `AWS_REGION` env vars into every `aws` spawn that runs during `oat-project-complete` and `oat project archive sync`. The per-invocation `oat project archive sync --profile <profile>` and `--region <region>` flags override the config for a single run; an `AWS_PROFILE` / `AWS_REGION` already set in the parent shell sits between the flag and the config in precedence (flag > shell env > config). Raw access keys (`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`) remain a shell-environment concern — there is no config plumbing for them.
|
|
60
64
|
|
|
61
65
|
Tool-pack installation state also lives here as shared repo config:
|
|
62
66
|
|
|
@@ -83,6 +83,8 @@ Common keys in `.oat/config.json`:
|
|
|
83
83
|
- `archive.s3SyncOnComplete` — upload archived projects to S3 during completion
|
|
84
84
|
- `archive.summaryExportPath` — export `summary.md` into a durable tracked directory during completion
|
|
85
85
|
- `archive.wrapUpExportPath` — optional tracked destination for `oat-wrap-up` reports; when unset, the skill falls back to `.oat/repo/reference/wrap-ups`
|
|
86
|
+
- `archive.awsProfile` — optional AWS named profile forwarded as `AWS_PROFILE` to every `aws` invocation in archive flows
|
|
87
|
+
- `archive.awsRegion` — optional AWS region forwarded as `AWS_REGION` to every `aws` invocation in archive flows
|
|
86
88
|
- `tools.<pack>` — whether a bundled tool pack is currently installed in the repo or user scopes after lifecycle reconciliation
|
|
87
89
|
|
|
88
90
|
Tool-pack state example:
|
|
@@ -101,6 +103,8 @@ oat config set archive.s3Uri s3://example-bucket/oat-archive
|
|
|
101
103
|
oat config set archive.s3SyncOnComplete true
|
|
102
104
|
oat config set archive.summaryExportPath .oat/repo/reference/project-summaries
|
|
103
105
|
oat config set archive.wrapUpExportPath .oat/repo/reference/wrap-ups
|
|
106
|
+
oat config set archive.awsProfile work-sso
|
|
107
|
+
oat config set archive.awsRegion us-east-1
|
|
104
108
|
```
|
|
105
109
|
|
|
106
110
|
With those values configured:
|
|
@@ -110,6 +114,27 @@ With those values configured:
|
|
|
110
114
|
- completion also copies `summary.md` into `<archive.summaryExportPath>/20260401-my-project.md`
|
|
111
115
|
- `oat project archive sync` can later pull archive data back down from S3 and materialize the latest snapshot into the local bare archive path `.oat/projects/archived/<project>/`
|
|
112
116
|
- `oat-wrap-up` can write tracked reports into `<archive.wrapUpExportPath>/YYYY-MM-DD-wrap-up-<label>.md`; if the key is unset, the skill uses `.oat/repo/reference/wrap-ups/`
|
|
117
|
+
- every `aws` spawn (preflight `aws sts get-caller-identity`, `aws s3 ls`, `aws s3 sync`) inherits `AWS_PROFILE` / `AWS_REGION` from `archive.awsProfile` / `archive.awsRegion` when the parent shell does not already set them
|
|
118
|
+
|
|
119
|
+
### Credential resolution
|
|
120
|
+
|
|
121
|
+
Profile and region resolve with the following precedence per `aws` invocation, highest first:
|
|
122
|
+
|
|
123
|
+
1. CLI flag passed to `oat project archive sync` (`--profile <profile>`, `--region <region>`)
|
|
124
|
+
2. The parent shell's existing `AWS_PROFILE` / `AWS_REGION` env vars
|
|
125
|
+
3. The repo's shared `archive.awsProfile` / `archive.awsRegion` config
|
|
126
|
+
|
|
127
|
+
If none of the three are present for a given var, OAT does not inject it — the AWS CLI's own resolution chain takes over.
|
|
128
|
+
|
|
129
|
+
The `oat project archive sync` flags only override for that single invocation:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
oat project archive sync --profile work-sso --region us-east-1
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`oat-project-complete` does not accept per-invocation flags. Set the shared config (or your shell env) ahead of time if completion needs a specific profile.
|
|
136
|
+
|
|
137
|
+
Raw access keys (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and friends) remain a shell-environment concern. OAT does not expose config keys for them — set them in your shell before running `oat-project-complete` or `oat project archive sync` and they are inherited by the spawned `aws` process unchanged.
|
|
113
138
|
|
|
114
139
|
## Repo-local and user state
|
|
115
140
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGhF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EAGnB,KAAK,UAAU,EAOhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG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AAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAwmCD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CA0GT"}
|
|
@@ -14,6 +14,8 @@ const KEY_ORDER = [
|
|
|
14
14
|
'archive.s3SyncOnComplete',
|
|
15
15
|
'archive.summaryExportPath',
|
|
16
16
|
'archive.wrapUpExportPath',
|
|
17
|
+
'archive.awsProfile',
|
|
18
|
+
'archive.awsRegion',
|
|
17
19
|
'autoReviewAtCheckpoints',
|
|
18
20
|
'lastPausedProject',
|
|
19
21
|
'documentation.root',
|
|
@@ -172,6 +174,28 @@ const CONFIG_CATALOG = [
|
|
|
172
174
|
owningCommand: 'oat config set archive.wrapUpExportPath <value>',
|
|
173
175
|
description: 'Repository-relative directory where the oat-wrap-up skill writes date-ranged shipping digests. When unset, the skill falls back to `.oat/repo/reference/wrap-ups`.',
|
|
174
176
|
},
|
|
177
|
+
{
|
|
178
|
+
key: 'archive.awsProfile',
|
|
179
|
+
group: 'Shared Repo (.oat/config.json)',
|
|
180
|
+
file: '.oat/config.json',
|
|
181
|
+
scope: 'shared repo',
|
|
182
|
+
type: 'string',
|
|
183
|
+
defaultValue: 'unset',
|
|
184
|
+
mutability: 'read/write',
|
|
185
|
+
owningCommand: 'oat config set archive.awsProfile <value>',
|
|
186
|
+
description: 'AWS named profile forwarded as AWS_PROFILE to every `aws` invocation made by the archive S3 sync (completion + `oat project archive sync`). Precedence: per-invocation flag > existing shell env > this config value.',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: 'archive.awsRegion',
|
|
190
|
+
group: 'Shared Repo (.oat/config.json)',
|
|
191
|
+
file: '.oat/config.json',
|
|
192
|
+
scope: 'shared repo',
|
|
193
|
+
type: 'string',
|
|
194
|
+
defaultValue: 'unset',
|
|
195
|
+
mutability: 'read/write',
|
|
196
|
+
owningCommand: 'oat config set archive.awsRegion <value>',
|
|
197
|
+
description: 'AWS region forwarded as AWS_REGION to every `aws` invocation made by the archive S3 sync (completion + `oat project archive sync`). Precedence: per-invocation flag > existing shell env > this config value.',
|
|
198
|
+
},
|
|
175
199
|
{
|
|
176
200
|
key: 'tools.core',
|
|
177
201
|
group: 'Shared Repo (.oat/config.json)',
|
|
@@ -655,6 +679,16 @@ async function setConfigValue(repoRoot, userConfigDir, key, rawValue, surface, d
|
|
|
655
679
|
else if (key === 'archive.wrapUpExportPath') {
|
|
656
680
|
archive.wrapUpExportPath = normalizeSharedRoot(rawValue);
|
|
657
681
|
}
|
|
682
|
+
else if (key === 'archive.awsProfile' || key === 'archive.awsRegion') {
|
|
683
|
+
const subKey = key.slice('archive.'.length);
|
|
684
|
+
const trimmed = rawValue.trim();
|
|
685
|
+
if (trimmed === '') {
|
|
686
|
+
delete archive[subKey];
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
archive[subKey] = trimmed;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
658
692
|
await dependencies.writeOatConfig(repoRoot, {
|
|
659
693
|
...config,
|
|
660
694
|
archive,
|
|
@@ -11,6 +11,23 @@ export interface EnsureS3ArchiveAccessOptions {
|
|
|
11
11
|
mode: 'completion' | 'sync';
|
|
12
12
|
s3Uri?: string | null;
|
|
13
13
|
syncOnComplete: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Config-only fallback AWS profile (e.g., `archive.awsProfile`). This helper
|
|
16
|
+
* applies the value only when the parent env does not already provide
|
|
17
|
+
* `AWS_PROFILE`, matching discovery decision #3 ("config does not clobber an
|
|
18
|
+
* explicit shell env"). Callers that override via flags must layer the
|
|
19
|
+
* override into `dependencies.env` (the helper's second argument) —
|
|
20
|
+
* `buildAwsEnv` is non-clobbering and will not overwrite a value already
|
|
21
|
+
* present in the parent env. Passing a flag value through this option alone
|
|
22
|
+
* is not sufficient.
|
|
23
|
+
*/
|
|
24
|
+
awsProfile?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Config-only fallback AWS region. Same non-clobbering semantics as
|
|
27
|
+
* `awsProfile`: flag-style overrides must be layered into
|
|
28
|
+
* `dependencies.env`, not passed through this option.
|
|
29
|
+
*/
|
|
30
|
+
awsRegion?: string | null;
|
|
14
31
|
}
|
|
15
32
|
interface EnsureS3ArchiveAccessDependencies {
|
|
16
33
|
execFile?: ExecFileLike;
|
|
@@ -28,6 +45,17 @@ export interface ArchiveProjectOnCompletionOptions {
|
|
|
28
45
|
s3Uri?: string | null;
|
|
29
46
|
s3SyncOnComplete: boolean;
|
|
30
47
|
summaryExportPath?: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Config-only AWS profile (`archive.awsProfile`). The completion path has no
|
|
50
|
+
* flag override; this value is forwarded as-is into the env merge, where the
|
|
51
|
+
* parent env wins if it already supplies `AWS_PROFILE`. Discovery decision #3.
|
|
52
|
+
*/
|
|
53
|
+
awsProfile?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Config-only AWS region (`archive.awsRegion`). Same non-clobbering semantics
|
|
56
|
+
* as `awsProfile`.
|
|
57
|
+
*/
|
|
58
|
+
awsRegion?: string | null;
|
|
31
59
|
}
|
|
32
60
|
interface ArchiveProjectOnCompletionDependencies extends EnsureS3ArchiveAccessDependencies {
|
|
33
61
|
ensureS3ArchiveAccess?: typeof ensureS3ArchiveAccess;
|
|
@@ -60,6 +88,31 @@ export interface ArchiveSnapshotMetadata {
|
|
|
60
88
|
projectName: string;
|
|
61
89
|
snapshotName: string;
|
|
62
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Build the env passed to every `aws` spawn in this module.
|
|
93
|
+
*
|
|
94
|
+
* Non-clobbering merge: a non-empty value in `opts` is applied only when
|
|
95
|
+
* `parentEnv` does not already provide that key (treating empty/whitespace
|
|
96
|
+
* parent values as unset). If parent env has a non-empty value, it is left
|
|
97
|
+
* untouched even when `opts` supplies a non-empty value. Callers that need
|
|
98
|
+
* flag-style overrides must set the env entry themselves before calling this
|
|
99
|
+
* helper. This matches discovery decision #3 — config does not clobber an
|
|
100
|
+
* explicit shell env.
|
|
101
|
+
*
|
|
102
|
+
* An empty/whitespace value in `opts` is also treated as unset, and we never
|
|
103
|
+
* inject a key when neither source supplies one — so the spawned process sees
|
|
104
|
+
* the same "unset" signal it would have seen without this plumbing.
|
|
105
|
+
*
|
|
106
|
+
* Exported as a package-internal helper so the archive sync command (which
|
|
107
|
+
* also spawns `aws`) can layer flag/env/config precedence and produce the same
|
|
108
|
+
* env shape without duplicating this logic. This symbol is **not** part of the
|
|
109
|
+
* public package surface — keep usage limited to files inside
|
|
110
|
+
* `commands/project/archive/`.
|
|
111
|
+
*/
|
|
112
|
+
export declare function buildAwsEnv(parentEnv: NodeJS.ProcessEnv, opts: {
|
|
113
|
+
awsProfile?: string | null;
|
|
114
|
+
awsRegion?: string | null;
|
|
115
|
+
}): NodeJS.ProcessEnv;
|
|
63
116
|
export declare function buildRepoArchiveS3Uri(s3Uri: string, repoRoot: string): string;
|
|
64
117
|
export declare function buildProjectArchiveS3Uri(s3Uri: string, repoRoot: string, projectKey: string): string;
|
|
65
118
|
export declare function buildArchiveSnapshotName(projectName: string, timestamp: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/archive-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,UAAU,EACX,MAAM,QAAQ,CAAC;AAIhB,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAChD,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"archive-utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/archive-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,UAAU,EACX,MAAM,QAAQ,CAAC;AAIhB,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAChD,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,MAAM,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uri) {
|
|
15
15
|
return s3Uri.trim().replace(/\/+$/, '');
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Build the env passed to every `aws` spawn in this module.
|
|
19
|
+
*
|
|
20
|
+
* Non-clobbering merge: a non-empty value in `opts` is applied only when
|
|
21
|
+
* `parentEnv` does not already provide that key (treating empty/whitespace
|
|
22
|
+
* parent values as unset). If parent env has a non-empty value, it is left
|
|
23
|
+
* untouched even when `opts` supplies a non-empty value. Callers that need
|
|
24
|
+
* flag-style overrides must set the env entry themselves before calling this
|
|
25
|
+
* helper. This matches discovery decision #3 — config does not clobber an
|
|
26
|
+
* explicit shell env.
|
|
27
|
+
*
|
|
28
|
+
* An empty/whitespace value in `opts` is also treated as unset, and we never
|
|
29
|
+
* inject a key when neither source supplies one — so the spawned process sees
|
|
30
|
+
* the same "unset" signal it would have seen without this plumbing.
|
|
31
|
+
*
|
|
32
|
+
* Exported as a package-internal helper so the archive sync command (which
|
|
33
|
+
* also spawns `aws`) can layer flag/env/config precedence and produce the same
|
|
34
|
+
* env shape without duplicating this logic. This symbol is **not** part of the
|
|
35
|
+
* public package surface — keep usage limited to files inside
|
|
36
|
+
* `commands/project/archive/`.
|
|
37
|
+
*/
|
|
38
|
+
export function buildAwsEnv(parentEnv, opts) {
|
|
39
|
+
const env = { ...parentEnv };
|
|
40
|
+
const parentHas = (key) => {
|
|
41
|
+
const value = parentEnv[key];
|
|
42
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
43
|
+
};
|
|
44
|
+
const profile = typeof opts.awsProfile === 'string' ? opts.awsProfile.trim() : '';
|
|
45
|
+
if (profile.length > 0 && !parentHas('AWS_PROFILE')) {
|
|
46
|
+
env.AWS_PROFILE = profile;
|
|
47
|
+
}
|
|
48
|
+
const region = typeof opts.awsRegion === 'string' ? opts.awsRegion.trim() : '';
|
|
49
|
+
if (region.length > 0 && !parentHas('AWS_REGION')) {
|
|
50
|
+
env.AWS_REGION = region;
|
|
51
|
+
}
|
|
52
|
+
return env;
|
|
53
|
+
}
|
|
17
54
|
function resolveRepoSlug(repoRoot) {
|
|
18
55
|
return basename(repoRoot).trim().replace(/\s+/g, '-');
|
|
19
56
|
}
|
|
@@ -219,6 +256,8 @@ export async function archiveProjectOnCompletion(options, dependencies = {}) {
|
|
|
219
256
|
mode: 'completion',
|
|
220
257
|
s3Uri: options.s3Uri,
|
|
221
258
|
syncOnComplete: options.s3SyncOnComplete,
|
|
259
|
+
awsProfile: options.awsProfile,
|
|
260
|
+
awsRegion: options.awsRegion,
|
|
222
261
|
}, {
|
|
223
262
|
execFile,
|
|
224
263
|
env: dependencies.env,
|
|
@@ -233,7 +272,10 @@ export async function archiveProjectOnCompletion(options, dependencies = {}) {
|
|
|
233
272
|
}
|
|
234
273
|
await execFile('aws', syncArgs, {
|
|
235
274
|
cwd: options.repoRoot,
|
|
236
|
-
env: dependencies.env ?? process.env,
|
|
275
|
+
env: buildAwsEnv(dependencies.env ?? process.env, {
|
|
276
|
+
awsProfile: options.awsProfile,
|
|
277
|
+
awsRegion: options.awsRegion,
|
|
278
|
+
}),
|
|
237
279
|
});
|
|
238
280
|
}
|
|
239
281
|
catch (error) {
|
|
@@ -255,7 +297,12 @@ export async function ensureS3ArchiveAccess(options, dependencies = {}) {
|
|
|
255
297
|
return { ok: true, warnings: [] };
|
|
256
298
|
}
|
|
257
299
|
const execFile = dependencies.execFile ?? execFileAsync;
|
|
258
|
-
const execOptions = {
|
|
300
|
+
const execOptions = {
|
|
301
|
+
env: buildAwsEnv(dependencies.env ?? process.env, {
|
|
302
|
+
awsProfile: options.awsProfile,
|
|
303
|
+
awsRegion: options.awsRegion,
|
|
304
|
+
}),
|
|
305
|
+
};
|
|
259
306
|
try {
|
|
260
307
|
await execFile('aws', ['--version'], execOptions);
|
|
261
308
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA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A8B,CAAC;IACtE,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AA4LD,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,OAAO,CAAC,iCAAiC,CAAM,GACzD,OAAO,CAsLT"}
|
|
@@ -9,8 +9,51 @@ import { readOatConfig } from '../../../config/oat-config.js';
|
|
|
9
9
|
import { CliError } from '../../../errors/cli-error.js';
|
|
10
10
|
import { resolveProjectRoot } from '../../../fs/paths.js';
|
|
11
11
|
import { Command } from 'commander';
|
|
12
|
-
import { ARCHIVE_SNAPSHOT_METADATA_FILENAME, S3_ARCHIVE_SYNC_EXCLUDES, buildProjectArchiveS3Uri, buildRepoArchiveS3Uri, ensureS3ArchiveAccess, parseArchiveSnapshotName, resolveLocalArchiveProjectPath, } from './archive-utils.js';
|
|
12
|
+
import { ARCHIVE_SNAPSHOT_METADATA_FILENAME, S3_ARCHIVE_SYNC_EXCLUDES, buildAwsEnv, buildProjectArchiveS3Uri, buildRepoArchiveS3Uri, ensureS3ArchiveAccess, parseArchiveSnapshotName, resolveLocalArchiveProjectPath, } from './archive-utils.js';
|
|
13
13
|
const execFileAsync = promisify(execFileCallback);
|
|
14
|
+
/**
|
|
15
|
+
* Resolve effective AWS profile/region for an archive sync invocation, honoring
|
|
16
|
+
* the discovery decision #3 precedence: flag > parent shell env > config.
|
|
17
|
+
*
|
|
18
|
+
* The returned `env` is suitable for passing into every `aws` spawn in this
|
|
19
|
+
* command. The returned `awsProfile`/`awsRegion` are forwarded to
|
|
20
|
+
* `ensureS3ArchiveAccess` so its non-clobbering merge sees the same source of
|
|
21
|
+
* truth (parent env wins inside the helper, so injecting the flag value into
|
|
22
|
+
* the env up-front is what makes "flag > parent env" hold end-to-end).
|
|
23
|
+
*/
|
|
24
|
+
function resolveSyncAwsEnv(processEnv, options, config) {
|
|
25
|
+
const flagProfile = typeof options.profile === 'string' && options.profile.trim().length > 0
|
|
26
|
+
? options.profile.trim()
|
|
27
|
+
: undefined;
|
|
28
|
+
const flagRegion = typeof options.region === 'string' && options.region.trim().length > 0
|
|
29
|
+
? options.region.trim()
|
|
30
|
+
: undefined;
|
|
31
|
+
// Layer the flag onto the parent env BEFORE delegating to buildAwsEnv. The
|
|
32
|
+
// helper's non-clobbering rule treats parent env as authoritative, so this
|
|
33
|
+
// is how the flag wins over both parent env and config.
|
|
34
|
+
const effectiveParent = { ...processEnv };
|
|
35
|
+
if (flagProfile !== undefined) {
|
|
36
|
+
effectiveParent.AWS_PROFILE = flagProfile;
|
|
37
|
+
}
|
|
38
|
+
if (flagRegion !== undefined) {
|
|
39
|
+
effectiveParent.AWS_REGION = flagRegion;
|
|
40
|
+
}
|
|
41
|
+
const configProfile = config.archive?.awsProfile;
|
|
42
|
+
const configRegion = config.archive?.awsRegion;
|
|
43
|
+
// Forward the same precedence into `awsProfile`/`awsRegion` for downstream
|
|
44
|
+
// helpers: prefer flag, fall back to config. Parent env is *not* substituted
|
|
45
|
+
// here because callers will pass the returned `env` (which already has the
|
|
46
|
+
// flag layered onto a clone of the parent env) as `dependencies.env` to the
|
|
47
|
+
// helper, so `buildAwsEnv`'s non-clobbering rule preserves "flag > parent
|
|
48
|
+
// env > config" against `effectiveParent` rather than the raw `process.env`.
|
|
49
|
+
const awsProfile = flagProfile ?? configProfile ?? undefined;
|
|
50
|
+
const awsRegion = flagRegion ?? configRegion ?? undefined;
|
|
51
|
+
const env = buildAwsEnv(effectiveParent, {
|
|
52
|
+
awsProfile,
|
|
53
|
+
awsRegion,
|
|
54
|
+
});
|
|
55
|
+
return { env, awsProfile, awsRegion };
|
|
56
|
+
}
|
|
14
57
|
function defaultDependencies() {
|
|
15
58
|
return {
|
|
16
59
|
buildCommandContext,
|
|
@@ -39,17 +82,17 @@ function buildArchiveSyncArgs(source, target, options) {
|
|
|
39
82
|
}
|
|
40
83
|
return args;
|
|
41
84
|
}
|
|
42
|
-
async function runArchiveSync(repoRoot, source, target, options, dependencies) {
|
|
85
|
+
async function runArchiveSync(repoRoot, source, target, options, awsEnv, dependencies) {
|
|
43
86
|
await dependencies.execFile('aws', buildArchiveSyncArgs(source, target, options), {
|
|
44
87
|
cwd: repoRoot,
|
|
45
|
-
env:
|
|
88
|
+
env: awsEnv,
|
|
46
89
|
});
|
|
47
90
|
}
|
|
48
|
-
async function listArchiveSnapshots(repoRoot, projectsRoot, s3Uri, dependencies) {
|
|
91
|
+
async function listArchiveSnapshots(repoRoot, projectsRoot, s3Uri, awsEnv, dependencies) {
|
|
49
92
|
const repoPrefix = `${dependencies.buildRepoArchiveS3Uri(s3Uri, repoRoot)}/`;
|
|
50
93
|
const { stdout } = await dependencies.execFile('aws', ['s3', 'ls', repoPrefix], {
|
|
51
94
|
cwd: repoRoot,
|
|
52
|
-
env:
|
|
95
|
+
env: awsEnv,
|
|
53
96
|
});
|
|
54
97
|
return stdout
|
|
55
98
|
.split('\n')
|
|
@@ -96,7 +139,7 @@ async function readLocalSnapshotName(repoRoot, target) {
|
|
|
96
139
|
return null;
|
|
97
140
|
}
|
|
98
141
|
}
|
|
99
|
-
async function syncArchiveSnapshot(repoRoot, snapshot, options, dependencies) {
|
|
142
|
+
async function syncArchiveSnapshot(repoRoot, snapshot, options, awsEnv, dependencies) {
|
|
100
143
|
const currentSnapshotName = await readLocalSnapshotName(repoRoot, snapshot.target);
|
|
101
144
|
if (!options.force && currentSnapshotName === snapshot.snapshotName) {
|
|
102
145
|
return false;
|
|
@@ -107,7 +150,7 @@ async function syncArchiveSnapshot(repoRoot, snapshot, options, dependencies) {
|
|
|
107
150
|
force: true,
|
|
108
151
|
});
|
|
109
152
|
}
|
|
110
|
-
await runArchiveSync(repoRoot, snapshot.source, snapshot.target, options, dependencies);
|
|
153
|
+
await runArchiveSync(repoRoot, snapshot.source, snapshot.target, options, awsEnv, dependencies);
|
|
111
154
|
return true;
|
|
112
155
|
}
|
|
113
156
|
export function createProjectArchiveCommand(overrides = {}) {
|
|
@@ -122,6 +165,8 @@ export function createProjectArchiveCommand(overrides = {}) {
|
|
|
122
165
|
.argument('[project-name]', 'Archived project name to sync')
|
|
123
166
|
.option('--dry-run', 'Preview archive sync without downloading')
|
|
124
167
|
.option('--force', 'Replace the named local archive before syncing it from S3')
|
|
168
|
+
.option('--profile <profile>', 'AWS profile override for this sync')
|
|
169
|
+
.option('--region <region>', 'AWS region override for this sync')
|
|
125
170
|
.action(async (projectName, options, command) => {
|
|
126
171
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
127
172
|
try {
|
|
@@ -134,13 +179,16 @@ export function createProjectArchiveCommand(overrides = {}) {
|
|
|
134
179
|
if (!s3Uri) {
|
|
135
180
|
throw new CliError('Archive sync requires `archive.s3Uri` to be configured. Set it with `oat config set archive.s3Uri <s3://...>` and retry.');
|
|
136
181
|
}
|
|
182
|
+
const { env: awsEnv, awsProfile, awsRegion, } = resolveSyncAwsEnv(dependencies.processEnv, options, config);
|
|
137
183
|
await dependencies.ensureS3ArchiveAccess({
|
|
138
184
|
mode: 'sync',
|
|
139
185
|
s3Uri,
|
|
140
186
|
syncOnComplete: config.archive?.s3SyncOnComplete ?? false,
|
|
141
|
-
|
|
187
|
+
awsProfile,
|
|
188
|
+
awsRegion,
|
|
189
|
+
}, { env: awsEnv });
|
|
142
190
|
const projectsRoot = await dependencies.resolveProjectsRoot(repoRoot, dependencies.processEnv);
|
|
143
|
-
const snapshots = await listArchiveSnapshots(repoRoot, projectsRoot, s3Uri, dependencies);
|
|
191
|
+
const snapshots = await listArchiveSnapshots(repoRoot, projectsRoot, s3Uri, awsEnv, dependencies);
|
|
144
192
|
const targets = projectName
|
|
145
193
|
? snapshots.filter((snapshot) => snapshot.projectName === projectName ||
|
|
146
194
|
snapshot.snapshotName === projectName)
|
|
@@ -169,7 +217,7 @@ export function createProjectArchiveCommand(overrides = {}) {
|
|
|
169
217
|
if (!snapshot) {
|
|
170
218
|
continue;
|
|
171
219
|
}
|
|
172
|
-
const synced = await syncArchiveSnapshot(repoRoot, snapshot, options, dependencies);
|
|
220
|
+
const synced = await syncArchiveSnapshot(repoRoot, snapshot, options, awsEnv, dependencies);
|
|
173
221
|
if (synced) {
|
|
174
222
|
appliedTargets.push(snapshot.target);
|
|
175
223
|
appliedSources.push(snapshot.source);
|
|
@@ -13,6 +13,8 @@ export interface OatArchiveConfig {
|
|
|
13
13
|
s3SyncOnComplete?: boolean;
|
|
14
14
|
summaryExportPath?: string;
|
|
15
15
|
wrapUpExportPath?: string;
|
|
16
|
+
awsProfile?: string;
|
|
17
|
+
awsRegion?: string;
|
|
16
18
|
}
|
|
17
19
|
export type WorkflowHillCheckpointDefault = 'every' | 'final';
|
|
18
20
|
export type WorkflowPostImplementSequence = 'wait' | 'summary' | 'pr' | 'docs-pr';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oat-config.d.ts","sourceRoot":"","sources":["../../src/config/oat-config.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"oat-config.d.ts","sourceRoot":"","sources":["../../src/config/oat-config.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,C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|
return value.replace(/\/+$/, '').replace(/^\.\//, '').trim();
|
|
76
76
|
}
|
|
77
|
+
function trimNonEmptyString(value) {
|
|
78
|
+
if (typeof value !== 'string') {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const trimmed = value.trim();
|
|
82
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
83
|
+
}
|
|
77
84
|
function normalizeProjectPath(repoRoot, pathValue) {
|
|
78
85
|
if (pathValue == null) {
|
|
79
86
|
return null;
|
|
@@ -143,6 +150,14 @@ function normalizeOatConfig(parsed) {
|
|
|
143
150
|
parsed.archive.wrapUpExportPath.trim()) {
|
|
144
151
|
archive.wrapUpExportPath = normalizeToPosixPath(parsed.archive.wrapUpExportPath.trim().replace(/\/+$/, ''));
|
|
145
152
|
}
|
|
153
|
+
const awsProfile = trimNonEmptyString(parsed.archive.awsProfile);
|
|
154
|
+
if (awsProfile !== undefined) {
|
|
155
|
+
archive.awsProfile = awsProfile;
|
|
156
|
+
}
|
|
157
|
+
const awsRegion = trimNonEmptyString(parsed.archive.awsRegion);
|
|
158
|
+
if (awsRegion !== undefined) {
|
|
159
|
+
archive.awsRegion = awsRegion;
|
|
160
|
+
}
|
|
146
161
|
if (Object.keys(archive).length > 0) {
|
|
147
162
|
next.archive = archive;
|
|
148
163
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EA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AAmED,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,SAAS,GAAE,OAAO,CAAC,kCAAkC,CAAM,GAC1D,OAAO,CAAC,cAAc,CAAC,CAgFzB"}
|
package/dist/config/resolve.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Open Agent Toolkit CLI",
|
|
6
6
|
"homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ora": "^9.0.0",
|
|
34
34
|
"yaml": "2.8.2",
|
|
35
35
|
"zod": "^3.25.76",
|
|
36
|
-
"@open-agent-toolkit/control-plane": "0.0.
|
|
36
|
+
"@open-agent-toolkit/control-plane": "0.0.55"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.0",
|