@open-agent-toolkit/cli 0.1.8 → 0.1.9
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.
|
@@ -14,6 +14,8 @@ The hook distinguishes two states so unmanaged files are not reported the same a
|
|
|
14
14
|
- **Warning (managed drift or missing):** a manifest-tracked provider entry has drifted or is missing. Emits `oat: managed provider views are out of sync - run 'oat sync --scope project'` to stderr.
|
|
15
15
|
- **Info (unmanaged strays only):** provider files exist inside a managed directory but are not in the manifest. Emits `oat: unmanaged provider files detected - run 'oat status --scope project' to review` to stderr. Not treated as drift.
|
|
16
16
|
|
|
17
|
+
Gitignored provider files are intentionally skipped by status and hook checks, including entries ignored through `.gitignore`, `.git/info/exclude`, or standard Git exclude configuration.
|
|
18
|
+
|
|
17
19
|
The hook is non-blocking: it never fails the commit, even when managed drift is detected.
|
|
18
20
|
|
|
19
21
|
OAT installs the hook into Git's currently active hook directory. When a consumer repo keeps hooks in a repo-managed folder such as `.githooks/`, Git must be configured to use that path before install, or OAT must configure it during the hook prompt flow.
|
|
@@ -51,6 +51,8 @@ Rendered rule files participate in the same drift states as other managed copies
|
|
|
51
51
|
|
|
52
52
|
`oat init` and `oat status` can offer adoption of unmanaged provider entries into canonical `.agents`.
|
|
53
53
|
|
|
54
|
+
Provider files ignored by Git are treated as intentionally local runtime files and are not reported as strays. This includes files covered by tracked `.gitignore`, repo-local `.git/info/exclude`, or other standard Git exclude mechanisms.
|
|
55
|
+
|
|
54
56
|
For rules, adoption maps provider-native files back into `.agents/rules/*.md`:
|
|
55
57
|
|
|
56
58
|
- Claude: `.claude/rules/*.md`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strays.d.ts","sourceRoot":"","sources":["../../src/drift/strays.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"strays.d.ts","sourceRoot":"","sources":["../../src/drift/strays.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkBjD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAoB1D;AAkJD,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,cAAc,EAAE,EAClC,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,mBAAmB,CAAC,GAC/D,OAAO,CAAC,WAAW,EAAE,CAAC,CA0DxB"}
|
package/dist/drift/strays.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { execFile as execFileCallback } from 'node:child_process';
|
|
1
2
|
import { readdir, readFile } from 'node:fs/promises';
|
|
2
3
|
import { basename, join, relative, resolve } from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
3
5
|
import { OAT_MARKER_PREFIX } from '../engine/markers.js';
|
|
4
6
|
import { CliError } from '../errors/index.js';
|
|
5
7
|
import { toPosixPath } from '../fs/paths.js';
|
|
6
8
|
import { canonicalRuleNameForProviderEntry } from '../rules/canonical/index.js';
|
|
9
|
+
const execFile = promisify(execFileCallback);
|
|
7
10
|
function inferContentType(providerDir) {
|
|
8
11
|
const dirName = basename(toPosixPath(providerDir));
|
|
9
12
|
if (dirName === 'skills') {
|
|
@@ -110,6 +113,26 @@ async function readProviderEntries(resolvedProviderDir) {
|
|
|
110
113
|
throw error;
|
|
111
114
|
}
|
|
112
115
|
}
|
|
116
|
+
function isGitExitCode(error, code) {
|
|
117
|
+
return (typeof error === 'object' &&
|
|
118
|
+
error !== null &&
|
|
119
|
+
'code' in error &&
|
|
120
|
+
Number(error.code) === code);
|
|
121
|
+
}
|
|
122
|
+
async function isGitIgnored(pathRelative, scopeRoot) {
|
|
123
|
+
try {
|
|
124
|
+
await execFile('git', ['check-ignore', '--quiet', '--no-index', '--', pathRelative], { cwd: scopeRoot });
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
// Outside a Git repository, preserve the pre-existing behavior: files that
|
|
129
|
+
// are not manifest, canonical, or generated entries are still strays.
|
|
130
|
+
if (isGitExitCode(error, 1) || isGitExitCode(error, 128)) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
113
136
|
export async function detectStrays(provider, providerDir, manifest, canonicalEntries, mapping) {
|
|
114
137
|
const contentType = mapping?.contentType ?? inferContentType(providerDir);
|
|
115
138
|
const scopeRoot = inferScopeRoot(providerDir);
|
|
@@ -131,6 +154,9 @@ export async function detectStrays(provider, providerDir, manifest, canonicalEnt
|
|
|
131
154
|
if (isManifestTracked(providerPathRelative, manifest)) {
|
|
132
155
|
continue;
|
|
133
156
|
}
|
|
157
|
+
if (await isGitIgnored(providerPathRelative, scopeRoot)) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
134
160
|
if (entry.isFile() &&
|
|
135
161
|
(await isGeneratedAdaptedRule(providerPath, mapping))) {
|
|
136
162
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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.1.
|
|
36
|
+
"@open-agent-toolkit/control-plane": "0.1.9"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.0",
|