@open-agent-toolkit/cli 0.0.58 → 0.0.59
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 +1 -1
- package/assets/docs/cli-utilities/configuration.md +5 -3
- package/assets/public-package-versions.json +4 -4
- package/dist/commands/project/archive/archive-utils.d.ts +24 -30
- package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
- package/dist/commands/project/archive/archive-utils.js +13 -21
- package/dist/commands/project/archive/index.d.ts.map +1 -1
- package/dist/commands/project/archive/index.js +16 -23
- package/package.json +2 -2
|
@@ -60,7 +60,7 @@ Archive lifecycle settings live here as shared repo config:
|
|
|
60
60
|
- `archive.awsProfile`
|
|
61
61
|
- `archive.awsRegion`
|
|
62
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
|
|
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`, and they override any values already set in the parent shell — the repo's archive-scoped declaration wins so users don't have to remember to unset `AWS_PROFILE` per shell. The per-invocation `oat project archive sync --profile <profile>` and `--region <region>` flags then override the config for a single run, giving precedence `flag > config > shell env`. When neither flag nor config is set, the parent shell's `AWS_PROFILE` / `AWS_REGION` pass through unchanged. Raw access keys (`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`) remain a shell-environment concern — there is no config plumbing for them.
|
|
64
64
|
|
|
65
65
|
Tool-pack installation state also lives here as shared repo config:
|
|
66
66
|
|
|
@@ -114,18 +114,20 @@ With those values configured:
|
|
|
114
114
|
- completion also copies `summary.md` into `<archive.summaryExportPath>/20260401-my-project.md`
|
|
115
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>/`
|
|
116
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`)
|
|
117
|
+
- every `aws` spawn (preflight `aws sts get-caller-identity`, `aws s3 ls`, `aws s3 sync`) runs with `AWS_PROFILE` / `AWS_REGION` set from `archive.awsProfile` / `archive.awsRegion` when configured, overriding any value already in the parent shell
|
|
118
118
|
|
|
119
119
|
### Credential resolution
|
|
120
120
|
|
|
121
121
|
Profile and region resolve with the following precedence per `aws` invocation, highest first:
|
|
122
122
|
|
|
123
123
|
1. CLI flag passed to `oat project archive sync` (`--profile <profile>`, `--region <region>`)
|
|
124
|
-
2. The
|
|
125
|
-
3. The
|
|
124
|
+
2. The repo's shared `archive.awsProfile` / `archive.awsRegion` config
|
|
125
|
+
3. The parent shell's existing `AWS_PROFILE` / `AWS_REGION` env vars
|
|
126
126
|
|
|
127
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
128
|
|
|
129
|
+
`archive.awsProfile` is treated as deliberate, OAT-archive-scoped intent: if the repo declares the identity it wants to archive under, that value wins over whatever profile happens to be in the calling shell. Use `--profile` for one-off overrides; clear `archive.awsProfile` (set it to an empty string) to fall back to shell `AWS_PROFILE`.
|
|
130
|
+
|
|
129
131
|
The `oat project archive sync` flags only override for that single invocation:
|
|
130
132
|
|
|
131
133
|
```bash
|
|
@@ -12,20 +12,17 @@ export interface EnsureS3ArchiveAccessOptions {
|
|
|
12
12
|
s3Uri?: string | null;
|
|
13
13
|
syncOnComplete: boolean;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `AWS_PROFILE
|
|
18
|
-
* explicit
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* present in the parent env. Passing a flag value through this option alone
|
|
22
|
-
* is not sufficient.
|
|
15
|
+
* AWS profile to apply for this archive op (typically resolved from
|
|
16
|
+
* `archive.awsProfile` config or a `--profile` flag). When non-empty, this
|
|
17
|
+
* value clobbers any `AWS_PROFILE` already present in the parent env: an
|
|
18
|
+
* explicit OAT-archive-scoped profile is treated as deliberate intent and
|
|
19
|
+
* wins over ambient shell state. An empty/unset value leaves the parent env
|
|
20
|
+
* untouched.
|
|
23
21
|
*/
|
|
24
22
|
awsProfile?: string | null;
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
27
|
-
* `awsProfile
|
|
28
|
-
* `dependencies.env`, not passed through this option.
|
|
24
|
+
* AWS region to apply for this archive op. Same clobber-on-explicit-value
|
|
25
|
+
* semantics as `awsProfile`.
|
|
29
26
|
*/
|
|
30
27
|
awsRegion?: string | null;
|
|
31
28
|
}
|
|
@@ -47,13 +44,14 @@ export interface ArchiveProjectOnCompletionOptions {
|
|
|
47
44
|
summaryExportPath?: string | null;
|
|
48
45
|
/**
|
|
49
46
|
* Config-only AWS profile (`archive.awsProfile`). The completion path has no
|
|
50
|
-
* flag override
|
|
51
|
-
*
|
|
47
|
+
* flag override. When non-empty, this value clobbers any parent-env
|
|
48
|
+
* `AWS_PROFILE` — repo-scoped archive config is treated as deliberate intent
|
|
49
|
+
* and wins over ambient shell state.
|
|
52
50
|
*/
|
|
53
51
|
awsProfile?: string | null;
|
|
54
52
|
/**
|
|
55
|
-
* Config-only AWS region (`archive.awsRegion`). Same
|
|
56
|
-
* as `awsProfile`.
|
|
53
|
+
* Config-only AWS region (`archive.awsRegion`). Same clobber-on-explicit-value
|
|
54
|
+
* semantics as `awsProfile`.
|
|
57
55
|
*/
|
|
58
56
|
awsRegion?: string | null;
|
|
59
57
|
}
|
|
@@ -94,23 +92,19 @@ export interface ArchiveSnapshotMetadata {
|
|
|
94
92
|
/**
|
|
95
93
|
* Build the env passed to every `aws` spawn in this module.
|
|
96
94
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* An empty/whitespace value in `opts` is also treated as unset, and we never
|
|
106
|
-
* inject a key when neither source supplies one — so the spawned process sees
|
|
107
|
-
* the same "unset" signal it would have seen without this plumbing.
|
|
95
|
+
* Clobber-on-explicit-value merge: a non-empty value in `opts` overwrites the
|
|
96
|
+
* parent env entry. The merge treats an explicitly supplied profile/region as
|
|
97
|
+
* deliberate OAT-archive-scoped intent that wins over ambient shell state —
|
|
98
|
+
* setting `archive.awsProfile` (or passing `--profile`) means "use this for
|
|
99
|
+
* archive ops, regardless of what AWS_PROFILE is in the shell." Empty or
|
|
100
|
+
* whitespace-only values in `opts` are treated as unset and leave the parent
|
|
101
|
+
* env entry alone, so the AWS CLI's own resolution chain (incl. shell
|
|
102
|
+
* AWS_PROFILE) takes over when neither config nor flag has spoken.
|
|
108
103
|
*
|
|
109
104
|
* Exported as a package-internal helper so the archive sync command (which
|
|
110
|
-
* also spawns `aws`) can
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* `commands/project/archive/`.
|
|
105
|
+
* also spawns `aws`) can produce the same env shape without duplicating this
|
|
106
|
+
* logic. This symbol is **not** part of the public package surface — keep
|
|
107
|
+
* usage limited to files inside `commands/project/archive/`.
|
|
114
108
|
*/
|
|
115
109
|
export declare function buildAwsEnv(parentEnv: NodeJS.ProcessEnv, opts: {
|
|
116
110
|
awsProfile?: string | null;
|
|
@@ -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;IACxB
|
|
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;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,iCAAi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sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,kCAAuC,GACpD,OAAO,CAAC,MAAM,CAAC,CAgCjB;AAmED,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,iCAAiC,EAC1C,YAAY,GAAE,sCAA2C,GACxD,OAAO,CAAC,gCAAgC,CAAC,CAgH3C;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,EACrC,YAAY,GAAE,iCAAsC,GACnD,OAAO,CAAC,2BAA2B,CAAC,CA+CtC"}
|
|
@@ -17,36 +17,28 @@ function normalizeS3Uri(s3Uri) {
|
|
|
17
17
|
/**
|
|
18
18
|
* Build the env passed to every `aws` spawn in this module.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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.
|
|
20
|
+
* Clobber-on-explicit-value merge: a non-empty value in `opts` overwrites the
|
|
21
|
+
* parent env entry. The merge treats an explicitly supplied profile/region as
|
|
22
|
+
* deliberate OAT-archive-scoped intent that wins over ambient shell state —
|
|
23
|
+
* setting `archive.awsProfile` (or passing `--profile`) means "use this for
|
|
24
|
+
* archive ops, regardless of what AWS_PROFILE is in the shell." Empty or
|
|
25
|
+
* whitespace-only values in `opts` are treated as unset and leave the parent
|
|
26
|
+
* env entry alone, so the AWS CLI's own resolution chain (incl. shell
|
|
27
|
+
* AWS_PROFILE) takes over when neither config nor flag has spoken.
|
|
31
28
|
*
|
|
32
29
|
* Exported as a package-internal helper so the archive sync command (which
|
|
33
|
-
* also spawns `aws`) can
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* `commands/project/archive/`.
|
|
30
|
+
* also spawns `aws`) can produce the same env shape without duplicating this
|
|
31
|
+
* logic. This symbol is **not** part of the public package surface — keep
|
|
32
|
+
* usage limited to files inside `commands/project/archive/`.
|
|
37
33
|
*/
|
|
38
34
|
export function buildAwsEnv(parentEnv, opts) {
|
|
39
35
|
const env = { ...parentEnv };
|
|
40
|
-
const parentHas = (key) => {
|
|
41
|
-
const value = parentEnv[key];
|
|
42
|
-
return typeof value === 'string' && value.trim().length > 0;
|
|
43
|
-
};
|
|
44
36
|
const profile = typeof opts.awsProfile === 'string' ? opts.awsProfile.trim() : '';
|
|
45
|
-
if (profile.length > 0
|
|
37
|
+
if (profile.length > 0) {
|
|
46
38
|
env.AWS_PROFILE = profile;
|
|
47
39
|
}
|
|
48
40
|
const region = typeof opts.awsRegion === 'string' ? opts.awsRegion.trim() : '';
|
|
49
|
-
if (region.length > 0
|
|
41
|
+
if (region.length > 0) {
|
|
50
42
|
env.AWS_REGION = region;
|
|
51
43
|
}
|
|
52
44
|
return env;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGhF,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,oBAAoB,CAAC;AAGnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAIL,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,YAAY,EAEjB,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,mBAAmB,EAAE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sEnv, buildProjectArchiveS3Uri, buildRepoArchiveS3Uri, ensureS3ArchiveAccess, parseArchiveSnapshotName, resolveLocalArchiveProjectPath, resolvePrimaryRepoRoot, } from './archive-utils.js';
|
|
13
13
|
const execFileAsync = promisify(execFileCallback);
|
|
14
14
|
/**
|
|
15
|
-
* Resolve effective AWS profile/region for an archive sync invocation
|
|
16
|
-
*
|
|
15
|
+
* Resolve effective AWS profile/region for an archive sync invocation.
|
|
16
|
+
*
|
|
17
|
+
* Precedence (highest first): `--profile`/`--region` flag > `archive.awsProfile`/`archive.awsRegion`
|
|
18
|
+
* config > parent shell `AWS_PROFILE`/`AWS_REGION` env. Repo config is treated
|
|
19
|
+
* as deliberate, OAT-archive-scoped intent and wins over ambient shell state —
|
|
20
|
+
* users who explicitly set `archive.awsProfile` for the repo don't have to
|
|
21
|
+
* remember to unset `AWS_PROFILE` in every shell. Flag still beats config for
|
|
22
|
+
* one-off overrides.
|
|
17
23
|
*
|
|
18
24
|
* 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
|
|
21
|
-
*
|
|
22
|
-
* the env up-front is what makes "flag > parent env" hold end-to-end).
|
|
25
|
+
* command. The returned `awsProfile`/`awsRegion` are also forwarded to
|
|
26
|
+
* `ensureS3ArchiveAccess` so its preflight `aws sts get-caller-identity` runs
|
|
27
|
+
* against the same identity.
|
|
23
28
|
*/
|
|
24
29
|
function resolveSyncAwsEnv(processEnv, options, config) {
|
|
25
30
|
const flagProfile = typeof options.profile === 'string' && options.profile.trim().length > 0
|
|
@@ -28,27 +33,15 @@ function resolveSyncAwsEnv(processEnv, options, config) {
|
|
|
28
33
|
const flagRegion = typeof options.region === 'string' && options.region.trim().length > 0
|
|
29
34
|
? options.region.trim()
|
|
30
35
|
: 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
36
|
const configProfile = config.archive?.awsProfile;
|
|
42
37
|
const configRegion = config.archive?.awsRegion;
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// helper, so `buildAwsEnv`'s non-clobbering rule preserves "flag > parent
|
|
48
|
-
// env > config" against `effectiveParent` rather than the raw `process.env`.
|
|
38
|
+
// Flag beats config; either is forwarded to buildAwsEnv, which clobbers the
|
|
39
|
+
// parent env entry with the resolved value. When neither flag nor config is
|
|
40
|
+
// set, awsProfile/awsRegion stay undefined and the parent env passes through
|
|
41
|
+
// untouched — letting the AWS CLI's own resolution chain take over.
|
|
49
42
|
const awsProfile = flagProfile ?? configProfile ?? undefined;
|
|
50
43
|
const awsRegion = flagRegion ?? configRegion ?? undefined;
|
|
51
|
-
const env = buildAwsEnv(
|
|
44
|
+
const env = buildAwsEnv(processEnv, {
|
|
52
45
|
awsProfile,
|
|
53
46
|
awsRegion,
|
|
54
47
|
});
|
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.59",
|
|
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.59"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.0",
|