@open-agent-toolkit/cli 0.0.58 → 0.0.60

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.
@@ -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`. 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.
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`) inherits `AWS_PROFILE` / `AWS_REGION` from `archive.awsProfile` / `archive.awsRegion` when the parent shell does not already set them
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 parent shell's existing `AWS_PROFILE` / `AWS_REGION` env vars
125
- 3. The repo's shared `archive.awsProfile` / `archive.awsRegion` config
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
@@ -25,6 +25,7 @@ description: 'Provider-specific path mappings for Claude, Cursor, Copilot, Gemin
25
25
  - Project: `.agents/skills` -> `.github/skills`, `.agents/agents` -> `.github/agents`, `.agents/rules` -> `.github/instructions`
26
26
  - User: `~/.agents/skills` -> `~/.copilot/skills`, `~/.agents/agents` -> `~/.copilot/agents`
27
27
  - Rule files render as `.github/instructions/*.instructions.md`
28
+ - Canonical always-on rules render with `applyTo: "**"` so Copilot activates them repo-wide; provider rules with exactly `applyTo: "**"` adopt back to `activation: always`
28
29
  - Comma-containing globs are not supported for Copilot rule sync because Copilot uses a comma-separated `applyTo` field
29
30
 
30
31
  === "Gemini"
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.0.58",
3
- "docs-config": "0.0.58",
4
- "docs-theme": "0.0.58",
5
- "docs-transforms": "0.0.58"
2
+ "cli": "0.0.60",
3
+ "docs-config": "0.0.60",
4
+ "docs-theme": "0.0.60",
5
+ "docs-transforms": "0.0.60"
6
6
  }
@@ -12,20 +12,17 @@ export interface EnsureS3ArchiveAccessOptions {
12
12
  s3Uri?: string | null;
13
13
  syncOnComplete: boolean;
14
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.
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
- * 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.
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; 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.
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 non-clobbering semantics
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
- * Non-clobbering merge: a non-empty value in `opts` is applied only when
98
- * `parentEnv` does not already provide that key (treating empty/whitespace
99
- * parent values as unset). If parent env has a non-empty value, it is left
100
- * untouched even when `opts` supplies a non-empty value. Callers that need
101
- * flag-style overrides must set the env entry themselves before calling this
102
- * helper. This matches discovery decision #3 config does not clobber an
103
- * explicit shell env.
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 layer flag/env/config precedence and produce the same
111
- * env shape without duplicating this logic. This symbol is **not** part of the
112
- * public package surface — keep usage limited to files inside
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;;;;;;;;;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,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YA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A2B,CAAC,CA+CtC"}
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,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,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACt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
  * Build the env passed to every `aws` spawn in this module.
19
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.
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 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/`.
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 && !parentHas('AWS_PROFILE')) {
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 && !parentHas('AWS_REGION')) {
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;AAsEzB,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CACnB,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,KAC/C,cAAc,CAAC;IACpB,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,mBAAmB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;IAC1D,8BAA8B,EAAE,OAAO,8BAA8B,CAAC;IACtE,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IACtD,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe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,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAoMD,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,OAAO,CAAC,iCAAiC,CAAM,GACzD,OAAO,CA4LT"}
@@ -12,14 +12,19 @@ import { Command } from 'commander';
12
12
  import { ARCHIVE_SNAPSHOT_METADATA_FILENAME, S3_ARCHIVE_SYNC_EXCLUDES, buildAwsEnv, 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, honoring
16
- * the discovery decision #3 precedence: flag > parent shell env > config.
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 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).
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
- // 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`.
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(effectiveParent, {
44
+ const env = buildAwsEnv(processEnv, {
52
45
  awsProfile,
53
46
  awsRegion,
54
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"rule-transform.d.ts","sourceRoot":"","sources":["../../../src/providers/copilot/rule-transform.ts"],"names":[],"mappings":"AAkDA,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CAqBR;AAED,wBAAgB,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAa3E"}
1
+ {"version":3,"file":"rule-transform.d.ts","sourceRoot":"","sources":["../../../src/providers/copilot/rule-transform.ts"],"names":[],"mappings":"AAsDA,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CA4BR;AAED,wBAAgB,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAa3E"}
@@ -29,6 +29,9 @@ function parseApplyTo(value) {
29
29
  .filter(Boolean);
30
30
  return globs.length > 0 ? globs : undefined;
31
31
  }
32
+ function isRepoWideApplyTo(globs) {
33
+ return globs?.length === 1 && globs[0] === '**';
34
+ }
32
35
  export function transformCanonicalToCopilotRule(canonicalContent, canonicalPath) {
33
36
  const rule = parseCanonicalRuleMarkdown(canonicalContent);
34
37
  if (rule.activation === 'glob' && rule.globs) {
@@ -41,9 +44,16 @@ export function transformCanonicalToCopilotRule(canonicalContent, canonicalPath)
41
44
  : {}),
42
45
  applyTo: rule.globs.join(','),
43
46
  }
44
- : rule.description !== undefined
45
- ? { description: rule.description }
46
- : null;
47
+ : rule.activation === 'always'
48
+ ? {
49
+ ...(rule.description !== undefined
50
+ ? { description: rule.description }
51
+ : {}),
52
+ applyTo: '**',
53
+ }
54
+ : rule.description !== undefined
55
+ ? { description: rule.description }
56
+ : null;
47
57
  return appendGeneratedMarker(renderMarkdownWithFrontmatter(frontmatter, rule.body), canonicalPath);
48
58
  }
49
59
  export function parseCopilotRuleToCanonical(providerContent) {
@@ -52,7 +62,7 @@ export function parseCopilotRuleToCanonical(providerContent) {
52
62
  const globs = parseApplyTo(frontmatter?.applyTo);
53
63
  return renderCanonicalRuleMarkdown({
54
64
  ...(description !== undefined ? { description } : {}),
55
- ...(globs !== undefined ? { globs } : {}),
56
- activation: globs ? 'glob' : 'always',
65
+ ...(globs !== undefined && !isRepoWideApplyTo(globs) ? { globs } : {}),
66
+ activation: globs && !isRepoWideApplyTo(globs) ? 'glob' : 'always',
57
67
  }, body);
58
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
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.58"
36
+ "@open-agent-toolkit/control-plane": "0.0.60"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^22.10.0",