@detergent-software/atk 8.6.2-dev.1 → 8.7.0-dev.10
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/CHANGELOG.md +109 -0
- package/build/commands/audit.d.ts.map +1 -1
- package/build/commands/audit.js +34 -11
- package/build/commands/audit.js.map +1 -1
- package/build/commands/browse.d.ts.map +1 -1
- package/build/commands/browse.js +23 -15
- package/build/commands/browse.js.map +1 -1
- package/build/commands/freeze.d.ts.map +1 -1
- package/build/commands/freeze.js +11 -6
- package/build/commands/freeze.js.map +1 -1
- package/build/commands/index.d.ts.map +1 -1
- package/build/commands/index.js +1 -0
- package/build/commands/index.js.map +1 -1
- package/build/commands/install.d.ts.map +1 -1
- package/build/commands/install.js +91 -26
- package/build/commands/install.js.map +1 -1
- package/build/commands/list.d.ts +2 -1
- package/build/commands/list.d.ts.map +1 -1
- package/build/commands/list.js +82 -66
- package/build/commands/list.js.map +1 -1
- package/build/commands/move.d.ts +28 -0
- package/build/commands/move.d.ts.map +1 -0
- package/build/commands/move.js +180 -0
- package/build/commands/move.js.map +1 -0
- package/build/commands/outdated.d.ts +2 -1
- package/build/commands/outdated.d.ts.map +1 -1
- package/build/commands/outdated.js +67 -24
- package/build/commands/outdated.js.map +1 -1
- package/build/commands/pin.d.ts.map +1 -1
- package/build/commands/pin.js +12 -7
- package/build/commands/pin.js.map +1 -1
- package/build/commands/prune.d.ts.map +1 -1
- package/build/commands/prune.js +17 -10
- package/build/commands/prune.js.map +1 -1
- package/build/commands/schema.d.ts +1 -1
- package/build/commands/sync.d.ts.map +1 -1
- package/build/commands/sync.js +22 -13
- package/build/commands/sync.js.map +1 -1
- package/build/commands/thaw.d.ts.map +1 -1
- package/build/commands/thaw.js +11 -6
- package/build/commands/thaw.js.map +1 -1
- package/build/commands/uninstall.d.ts.map +1 -1
- package/build/commands/uninstall.js +20 -15
- package/build/commands/uninstall.js.map +1 -1
- package/build/commands/unpin.d.ts.map +1 -1
- package/build/commands/unpin.js +11 -6
- package/build/commands/unpin.js.map +1 -1
- package/build/commands/update.d.ts.map +1 -1
- package/build/commands/update.js +11 -11
- package/build/commands/update.js.map +1 -1
- package/build/components/CrossScopeWarning.d.ts +12 -0
- package/build/components/CrossScopeWarning.d.ts.map +1 -0
- package/build/components/CrossScopeWarning.js +13 -0
- package/build/components/CrossScopeWarning.js.map +1 -0
- package/build/components/DryRunBanner.d.ts +3 -1
- package/build/components/DryRunBanner.d.ts.map +1 -1
- package/build/components/DryRunBanner.js +2 -2
- package/build/components/DryRunBanner.js.map +1 -1
- package/build/components/InstallConfirmBar.d.ts.map +1 -1
- package/build/components/InstallConfirmBar.js +1 -3
- package/build/components/InstallConfirmBar.js.map +1 -1
- package/build/components/InstallSummary.d.ts +3 -1
- package/build/components/InstallSummary.d.ts.map +1 -1
- package/build/components/InstallSummary.js +2 -2
- package/build/components/InstallSummary.js.map +1 -1
- package/build/components/ListActionBar.d.ts +4 -2
- package/build/components/ListActionBar.d.ts.map +1 -1
- package/build/components/ListActionBar.js +5 -4
- package/build/components/ListActionBar.js.map +1 -1
- package/build/components/ListBrowseList.d.ts +7 -6
- package/build/components/ListBrowseList.d.ts.map +1 -1
- package/build/components/ListBrowseList.js +10 -6
- package/build/components/ListBrowseList.js.map +1 -1
- package/build/components/StatusBadge.d.ts +1 -1
- package/build/components/StatusBadge.d.ts.map +1 -1
- package/build/components/StatusBadge.js +1 -0
- package/build/components/StatusBadge.js.map +1 -1
- package/build/components/SyncAllInSync.d.ts +3 -1
- package/build/components/SyncAllInSync.d.ts.map +1 -1
- package/build/components/SyncAllInSync.js +2 -2
- package/build/components/SyncAllInSync.js.map +1 -1
- package/build/components/SyncDriftedList.d.ts +3 -1
- package/build/components/SyncDriftedList.d.ts.map +1 -1
- package/build/components/SyncDriftedList.js +3 -3
- package/build/components/SyncDriftedList.js.map +1 -1
- package/build/components/SyncNoAssets.d.ts +3 -1
- package/build/components/SyncNoAssets.d.ts.map +1 -1
- package/build/components/SyncNoAssets.js +2 -2
- package/build/components/SyncNoAssets.js.map +1 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/hooks/useInitState.d.ts.map +1 -1
- package/build/hooks/useInitState.js +4 -2
- package/build/hooks/useInitState.js.map +1 -1
- package/build/hooks/useListActions.d.ts +19 -6
- package/build/hooks/useListActions.d.ts.map +1 -1
- package/build/hooks/useListActions.js +36 -30
- package/build/hooks/useListActions.js.map +1 -1
- package/build/hooks/useListState.d.ts +29 -12
- package/build/hooks/useListState.d.ts.map +1 -1
- package/build/hooks/useListState.js +22 -6
- package/build/hooks/useListState.js.map +1 -1
- package/build/hooks/usePruneState.d.ts +6 -0
- package/build/hooks/usePruneState.d.ts.map +1 -1
- package/build/hooks/usePruneState.js +6 -1
- package/build/hooks/usePruneState.js.map +1 -1
- package/build/hooks/useResolvedScope.d.ts +21 -0
- package/build/hooks/useResolvedScope.d.ts.map +1 -0
- package/build/hooks/useResolvedScope.js +15 -0
- package/build/hooks/useResolvedScope.js.map +1 -0
- package/build/hooks/useUninstallState.d.ts +6 -0
- package/build/hooks/useUninstallState.d.ts.map +1 -1
- package/build/hooks/useUninstallState.js +6 -1
- package/build/hooks/useUninstallState.js.map +1 -1
- package/build/lib/adapter.d.ts +47 -1
- package/build/lib/adapter.d.ts.map +1 -1
- package/build/lib/adapter.js +153 -10
- package/build/lib/adapter.js.map +1 -1
- package/build/lib/checksum.d.ts.map +1 -1
- package/build/lib/checksum.js +2 -1
- package/build/lib/checksum.js.map +1 -1
- package/build/lib/config-entries.d.ts +5 -3
- package/build/lib/config-entries.d.ts.map +1 -1
- package/build/lib/config-entries.js +7 -4
- package/build/lib/config-entries.js.map +1 -1
- package/build/lib/config-file.d.ts +15 -4
- package/build/lib/config-file.d.ts.map +1 -1
- package/build/lib/config-file.js +35 -10
- package/build/lib/config-file.js.map +1 -1
- package/build/lib/config-lock.d.ts +22 -0
- package/build/lib/config-lock.d.ts.map +1 -0
- package/build/lib/config-lock.js +67 -0
- package/build/lib/config-lock.js.map +1 -0
- package/build/lib/cross-scope.d.ts +50 -0
- package/build/lib/cross-scope.d.ts.map +1 -0
- package/build/lib/cross-scope.js +132 -0
- package/build/lib/cross-scope.js.map +1 -0
- package/build/lib/diagnostics.d.ts +15 -2
- package/build/lib/diagnostics.d.ts.map +1 -1
- package/build/lib/diagnostics.js +152 -10
- package/build/lib/diagnostics.js.map +1 -1
- package/build/lib/diff-command.d.ts.map +1 -1
- package/build/lib/diff-command.js +7 -7
- package/build/lib/diff-command.js.map +1 -1
- package/build/lib/hook-config.d.ts +7 -0
- package/build/lib/hook-config.d.ts.map +1 -1
- package/build/lib/hook-config.js +11 -0
- package/build/lib/hook-config.js.map +1 -1
- package/build/lib/init.d.ts.map +1 -1
- package/build/lib/init.js +2 -1
- package/build/lib/init.js.map +1 -1
- package/build/lib/installed-for-tool.d.ts +2 -1
- package/build/lib/installed-for-tool.d.ts.map +1 -1
- package/build/lib/installed-for-tool.js +7 -4
- package/build/lib/installed-for-tool.js.map +1 -1
- package/build/lib/installer.d.ts +8 -4
- package/build/lib/installer.d.ts.map +1 -1
- package/build/lib/installer.js +153 -57
- package/build/lib/installer.js.map +1 -1
- package/build/lib/lockfile.d.ts +1 -1
- package/build/lib/lockfile.d.ts.map +1 -1
- package/build/lib/lockfile.js +2 -2
- package/build/lib/lockfile.js.map +1 -1
- package/build/lib/mover.d.ts +103 -0
- package/build/lib/mover.d.ts.map +1 -0
- package/build/lib/mover.js +375 -0
- package/build/lib/mover.js.map +1 -0
- package/build/lib/multi-tool-install.js +1 -1
- package/build/lib/multi-tool-install.js.map +1 -1
- package/build/lib/owned-paths.d.ts.map +1 -1
- package/build/lib/owned-paths.js +8 -8
- package/build/lib/owned-paths.js.map +1 -1
- package/build/lib/read-scopes.d.ts +32 -0
- package/build/lib/read-scopes.d.ts.map +1 -0
- package/build/lib/read-scopes.js +55 -0
- package/build/lib/read-scopes.js.map +1 -0
- package/build/lib/root-path.d.ts +7 -0
- package/build/lib/root-path.d.ts.map +1 -0
- package/build/lib/root-path.js +10 -0
- package/build/lib/root-path.js.map +1 -0
- package/build/lib/schemas/adapter.d.ts +80 -1
- package/build/lib/schemas/adapter.d.ts.map +1 -1
- package/build/lib/schemas/adapter.js +48 -0
- package/build/lib/schemas/adapter.js.map +1 -1
- package/build/lib/schemas/lockfile.d.ts +2 -0
- package/build/lib/schemas/lockfile.d.ts.map +1 -1
- package/build/lib/schemas/lockfile.js +8 -2
- package/build/lib/schemas/lockfile.js.map +1 -1
- package/build/lib/scope.d.ts +11 -0
- package/build/lib/scope.d.ts.map +1 -1
- package/build/lib/scope.js +12 -0
- package/build/lib/scope.js.map +1 -1
- package/build/lib/sync.d.ts +4 -3
- package/build/lib/sync.d.ts.map +1 -1
- package/build/lib/sync.js +12 -5
- package/build/lib/sync.js.map +1 -1
- package/build/lib/toml-edit.d.ts +10 -0
- package/build/lib/toml-edit.d.ts.map +1 -0
- package/build/lib/toml-edit.js +311 -0
- package/build/lib/toml-edit.js.map +1 -0
- package/build/lib/tool-resolver.d.ts +5 -0
- package/build/lib/tool-resolver.d.ts.map +1 -1
- package/build/lib/tool-resolver.js +16 -12
- package/build/lib/tool-resolver.js.map +1 -1
- package/build/lib/uninstaller.d.ts +14 -1
- package/build/lib/uninstaller.d.ts.map +1 -1
- package/build/lib/uninstaller.js +73 -28
- package/build/lib/uninstaller.js.map +1 -1
- package/build/lib/updater.d.ts +5 -4
- package/build/lib/updater.d.ts.map +1 -1
- package/build/lib/updater.js +18 -12
- package/build/lib/updater.js.map +1 -1
- package/build/lib/write-file.d.ts +17 -4
- package/build/lib/write-file.d.ts.map +1 -1
- package/build/lib/write-file.js +60 -10
- package/build/lib/write-file.js.map +1 -1
- package/package.json +1 -1
- package/tool-adapters/claude-code.json +44 -0
- package/tool-adapters/codex-cli.json +28 -0
- package/tool-adapters/copilot-cli.json +46 -2
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** How a file is written. */
|
|
2
|
+
export interface WriteOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Write a temp file next to it and rename it over the file, so a process that reads the file
|
|
5
|
+
* while it is written (a tool rewriting its own config) never sees it half written.
|
|
6
|
+
*/
|
|
7
|
+
atomic?: boolean;
|
|
8
|
+
}
|
|
1
9
|
/**
|
|
2
10
|
* Write a binary file verbatim, but skip the write when the content is unchanged.
|
|
3
11
|
*
|
|
@@ -26,8 +34,9 @@ export declare function writeBinaryFile(filePath: string, content: Buffer): Prom
|
|
|
26
34
|
*
|
|
27
35
|
* @param filePath - Absolute path of the file to write.
|
|
28
36
|
* @param data - Value to serialize as JSON.
|
|
37
|
+
* @param options - How to write it.
|
|
29
38
|
*/
|
|
30
|
-
export declare function writeJsonFile(filePath: string, data: unknown): Promise<void>;
|
|
39
|
+
export declare function writeJsonFile(filePath: string, data: unknown, options?: WriteOptions): Promise<void>;
|
|
31
40
|
/**
|
|
32
41
|
* Write a text file verbatim, but skip the write when the content is unchanged.
|
|
33
42
|
*
|
|
@@ -36,8 +45,9 @@ export declare function writeJsonFile(filePath: string, data: unknown): Promise<
|
|
|
36
45
|
*
|
|
37
46
|
* @param filePath - Absolute path of the file to write.
|
|
38
47
|
* @param content - Exact content to write.
|
|
48
|
+
* @param options - How to write it.
|
|
39
49
|
*/
|
|
40
|
-
export declare function writeTextFile(filePath: string, content: string): Promise<void>;
|
|
50
|
+
export declare function writeTextFile(filePath: string, content: string, options?: WriteOptions): Promise<void>;
|
|
41
51
|
/**
|
|
42
52
|
* Write a TOML file in a git-friendly, idempotent way.
|
|
43
53
|
*
|
|
@@ -45,10 +55,13 @@ export declare function writeTextFile(filePath: string, content: string): Promis
|
|
|
45
55
|
* content already matches the file, and CRLF line endings are preserved when
|
|
46
56
|
* the existing file uses them. Indentation is not applicable (tables are
|
|
47
57
|
* emitted flush-left). Comments and custom formatting in an existing file are
|
|
48
|
-
* NOT preserved — the document is re-serialized canonically.
|
|
58
|
+
* NOT preserved — the document is re-serialized canonically. `writeConfigFile`
|
|
59
|
+
* edits an existing file in place instead, and comes here only for a new file
|
|
60
|
+
* or a change it can't make that way.
|
|
49
61
|
*
|
|
50
62
|
* @param filePath - Absolute path of the file to write.
|
|
51
63
|
* @param data - Object to serialize as TOML.
|
|
64
|
+
* @param options - How to write it.
|
|
52
65
|
*/
|
|
53
|
-
export declare function writeTomlFile(filePath: string, data: Record<string, unknown
|
|
66
|
+
export declare function writeTomlFile(filePath: string, data: Record<string, unknown>, options?: WriteOptions): Promise<void>;
|
|
54
67
|
//# sourceMappingURL=write-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-file.d.ts","sourceRoot":"","sources":["../../src/lib/write-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"write-file.d.ts","sourceRoot":"","sources":["../../src/lib/write-file.ts"],"names":[],"mappings":"AAOA,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AASD;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYtF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAY9G;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhH;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
package/build/lib/write-file.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
1
2
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { chmod, mkdir, readFile, realpath, rename, stat, unlink, writeFile } from 'node:fs/promises';
|
|
3
4
|
import { dirname } from 'node:path';
|
|
5
|
+
import { setTimeout as sleep } from 'node:timers/promises';
|
|
4
6
|
import { stringify as stringifyToml } from 'smol-toml';
|
|
5
7
|
/**
|
|
6
8
|
* Default indentation for brand-new JSON files that ATK creates (no existing
|
|
@@ -47,8 +49,9 @@ export async function writeBinaryFile(filePath, content) {
|
|
|
47
49
|
*
|
|
48
50
|
* @param filePath - Absolute path of the file to write.
|
|
49
51
|
* @param data - Value to serialize as JSON.
|
|
52
|
+
* @param options - How to write it.
|
|
50
53
|
*/
|
|
51
|
-
export async function writeJsonFile(filePath, data) {
|
|
54
|
+
export async function writeJsonFile(filePath, data, options = {}) {
|
|
52
55
|
const existing = await readIfExists(filePath);
|
|
53
56
|
const indent = existing === undefined ? DEFAULT_JSON_INDENT : detectIndent(existing);
|
|
54
57
|
const eol = existing !== undefined && existing.includes('\r\n') ? '\r\n' : '\n';
|
|
@@ -56,7 +59,7 @@ export async function writeJsonFile(filePath, data) {
|
|
|
56
59
|
// escapes any newline inside string values, so a global `\n` → eol swap only
|
|
57
60
|
// touches structural newlines.
|
|
58
61
|
const content = JSON.stringify(data, null, indent).replace(/\n/g, eol) + eol;
|
|
59
|
-
await writeFileIfChanged(filePath, content, existing);
|
|
62
|
+
await writeFileIfChanged(filePath, content, existing, options);
|
|
60
63
|
}
|
|
61
64
|
/**
|
|
62
65
|
* Write a text file verbatim, but skip the write when the content is unchanged.
|
|
@@ -66,10 +69,11 @@ export async function writeJsonFile(filePath, data) {
|
|
|
66
69
|
*
|
|
67
70
|
* @param filePath - Absolute path of the file to write.
|
|
68
71
|
* @param content - Exact content to write.
|
|
72
|
+
* @param options - How to write it.
|
|
69
73
|
*/
|
|
70
|
-
export async function writeTextFile(filePath, content) {
|
|
74
|
+
export async function writeTextFile(filePath, content, options = {}) {
|
|
71
75
|
const existing = await readIfExists(filePath);
|
|
72
|
-
await writeFileIfChanged(filePath, content, existing);
|
|
76
|
+
await writeFileIfChanged(filePath, content, existing, options);
|
|
73
77
|
}
|
|
74
78
|
/**
|
|
75
79
|
* Write a TOML file in a git-friendly, idempotent way.
|
|
@@ -78,19 +82,22 @@ export async function writeTextFile(filePath, content) {
|
|
|
78
82
|
* content already matches the file, and CRLF line endings are preserved when
|
|
79
83
|
* the existing file uses them. Indentation is not applicable (tables are
|
|
80
84
|
* emitted flush-left). Comments and custom formatting in an existing file are
|
|
81
|
-
* NOT preserved — the document is re-serialized canonically.
|
|
85
|
+
* NOT preserved — the document is re-serialized canonically. `writeConfigFile`
|
|
86
|
+
* edits an existing file in place instead, and comes here only for a new file
|
|
87
|
+
* or a change it can't make that way.
|
|
82
88
|
*
|
|
83
89
|
* @param filePath - Absolute path of the file to write.
|
|
84
90
|
* @param data - Object to serialize as TOML.
|
|
91
|
+
* @param options - How to write it.
|
|
85
92
|
*/
|
|
86
|
-
export async function writeTomlFile(filePath, data) {
|
|
93
|
+
export async function writeTomlFile(filePath, data, options = {}) {
|
|
87
94
|
const existing = await readIfExists(filePath);
|
|
88
95
|
const eol = existing !== undefined && existing.includes('\r\n') ? '\r\n' : '\n';
|
|
89
96
|
// smol-toml emits `\n` as the structural line separator and escapes any
|
|
90
97
|
// newline inside string values, so a global `\n` → eol swap only touches
|
|
91
98
|
// structural newlines.
|
|
92
99
|
const content = stringifyToml(data).replace(/\n/g, eol);
|
|
93
|
-
await writeFileIfChanged(filePath, content, existing);
|
|
100
|
+
await writeFileIfChanged(filePath, content, existing, options);
|
|
94
101
|
}
|
|
95
102
|
/**
|
|
96
103
|
* Detect the per-level indentation unit of an existing JSON document.
|
|
@@ -116,17 +123,60 @@ async function readIfExists(filePath) {
|
|
|
116
123
|
return undefined;
|
|
117
124
|
return readFile(filePath, 'utf-8');
|
|
118
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Write `content` to a temp file next to `filePath` and rename it over the file. A symlink is
|
|
128
|
+
* written through to its target, and the file keeps its mode (a `.claude.json` kept at 0600
|
|
129
|
+
* because it holds MCP secrets stays 0600); a new file gets 0600. Windows refuses a rename while another process (an
|
|
130
|
+
* antivirus scan, the tool reading it) has the file open, so a refused rename is retried briefly.
|
|
131
|
+
* The temp file is removed when the write fails.
|
|
132
|
+
*/
|
|
133
|
+
async function writeFileAtomic(filePath, content) {
|
|
134
|
+
const target = existsSync(filePath) ? await realpath(filePath) : filePath;
|
|
135
|
+
// A new file is private to its owner: what a tool rewrites while it runs can hold secrets.
|
|
136
|
+
const mode = existsSync(target) ? (await stat(target)).mode & 0o777 : 0o600;
|
|
137
|
+
const tempPath = `${target}.tmp.${process.pid}.${randomBytes(4).toString('hex')}`;
|
|
138
|
+
try {
|
|
139
|
+
await writeFile(tempPath, content, { encoding: 'utf-8', mode });
|
|
140
|
+
await chmod(tempPath, mode);
|
|
141
|
+
await renameWithRetry(tempPath, target);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
await unlink(tempPath).catch(() => undefined);
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
119
148
|
/**
|
|
120
149
|
* Write `content` to `filePath` only if it differs from `existing`, creating
|
|
121
150
|
* the parent directory as needed. A no-op when the content already matches.
|
|
122
151
|
*/
|
|
123
|
-
async function writeFileIfChanged(filePath, content, existing) {
|
|
152
|
+
async function writeFileIfChanged(filePath, content, existing, { atomic = false } = {}) {
|
|
124
153
|
if (existing === content)
|
|
125
154
|
return;
|
|
126
155
|
const dir = dirname(filePath);
|
|
127
156
|
if (!existsSync(dir)) {
|
|
128
157
|
await mkdir(dir, { recursive: true });
|
|
129
158
|
}
|
|
130
|
-
|
|
159
|
+
if (!atomic) {
|
|
160
|
+
await writeFile(filePath, content, 'utf-8');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
await writeFileAtomic(filePath, content);
|
|
164
|
+
}
|
|
165
|
+
/** How often, and how far apart, a rename Windows refused is tried again. */
|
|
166
|
+
const RENAME_RETRIES = 10;
|
|
167
|
+
const RENAME_RETRY_MS = 50;
|
|
168
|
+
async function renameWithRetry(from, to) {
|
|
169
|
+
for (let attempt = 0;; attempt++) {
|
|
170
|
+
try {
|
|
171
|
+
await rename(from, to);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
const code = error.code;
|
|
176
|
+
if (attempt >= RENAME_RETRIES || (code !== 'EPERM' && code !== 'EBUSY' && code !== 'EACCES'))
|
|
177
|
+
throw error;
|
|
178
|
+
await sleep(RENAME_RETRY_MS);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
131
181
|
}
|
|
132
182
|
//# sourceMappingURL=write-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../src/lib/write-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-file.js","sourceRoot":"","sources":["../../src/lib/write-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,M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,MAAM,KAAK,CAAC;YAC1G,MAAM,KAAK,CAAC,eAAe,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -34,5 +34,49 @@
|
|
|
34
34
|
"enabledListKey": "enabledMcpjsonServers",
|
|
35
35
|
"fileless": true
|
|
36
36
|
}
|
|
37
|
+
},
|
|
38
|
+
"userConfigDir": {
|
|
39
|
+
"env": "CLAUDE_CONFIG_DIR",
|
|
40
|
+
"dir": ".claude",
|
|
41
|
+
"files": [".claude.json", ".claude.json.lock"]
|
|
42
|
+
},
|
|
43
|
+
"userPlacements": {
|
|
44
|
+
"skill": {
|
|
45
|
+
"path": ".claude/skills/{name}/",
|
|
46
|
+
"entrypointName": "SKILL.md"
|
|
47
|
+
},
|
|
48
|
+
"agent": {
|
|
49
|
+
"path": ".claude/agents/{name}.md"
|
|
50
|
+
},
|
|
51
|
+
"rule": {
|
|
52
|
+
"path": ".claude/rules/{name}.md"
|
|
53
|
+
},
|
|
54
|
+
"hook": {
|
|
55
|
+
"path": ".claude/hooks/{name}.sh",
|
|
56
|
+
"configFile": ".claude/settings.json",
|
|
57
|
+
"configKey": "hooks",
|
|
58
|
+
"configHookMerge": true,
|
|
59
|
+
"configCommand": "\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/{name}.sh\""
|
|
60
|
+
},
|
|
61
|
+
"memory-template": {
|
|
62
|
+
"path": ".claude/CLAUDE.md"
|
|
63
|
+
},
|
|
64
|
+
"mcp-config": {
|
|
65
|
+
"path": "",
|
|
66
|
+
"configFile": ".claude.json",
|
|
67
|
+
"configKey": "mcpServers",
|
|
68
|
+
"configMerge": true,
|
|
69
|
+
"configFragment": true,
|
|
70
|
+
"configLockFile": ".claude.json.lock",
|
|
71
|
+
"fileless": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"scopeClash": {
|
|
75
|
+
"skill": "user",
|
|
76
|
+
"agent": "project",
|
|
77
|
+
"rule": "both",
|
|
78
|
+
"hook": "both",
|
|
79
|
+
"memory-template": "both",
|
|
80
|
+
"mcp-config": "project"
|
|
37
81
|
}
|
|
38
82
|
}
|
|
@@ -27,5 +27,33 @@
|
|
|
27
27
|
"configMerge": true,
|
|
28
28
|
"fileless": true
|
|
29
29
|
}
|
|
30
|
+
},
|
|
31
|
+
"userConfigDir": {
|
|
32
|
+
"env": "CODEX_HOME",
|
|
33
|
+
"dir": ".codex"
|
|
34
|
+
},
|
|
35
|
+
"userPlacements": {
|
|
36
|
+
"skill": {
|
|
37
|
+
"path": ".codex/skills/{name}/",
|
|
38
|
+
"entrypointName": "SKILL.md"
|
|
39
|
+
},
|
|
40
|
+
"memory-template": {
|
|
41
|
+
"path": ".codex/AGENTS.md"
|
|
42
|
+
},
|
|
43
|
+
"mcp-config": {
|
|
44
|
+
"path": "",
|
|
45
|
+
"configFile": ".codex/config.toml",
|
|
46
|
+
"configFormat": "toml",
|
|
47
|
+
"configFragment": true,
|
|
48
|
+
"configFragmentKey": "mcpServers",
|
|
49
|
+
"configKey": "mcp_servers",
|
|
50
|
+
"configMerge": true,
|
|
51
|
+
"fileless": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"scopeClash": {
|
|
55
|
+
"skill": "both",
|
|
56
|
+
"memory-template": "both",
|
|
57
|
+
"mcp-config": "project"
|
|
30
58
|
}
|
|
31
59
|
}
|
|
@@ -21,8 +21,52 @@
|
|
|
21
21
|
"path": "",
|
|
22
22
|
"fileless": true,
|
|
23
23
|
"configMerge": true,
|
|
24
|
-
"configFile": "
|
|
25
|
-
"configKey": "servers"
|
|
24
|
+
"configFile": ".vscode/mcp.json",
|
|
25
|
+
"configKey": "servers",
|
|
26
|
+
"configFragment": true,
|
|
27
|
+
"configFragmentKey": "mcpServers"
|
|
26
28
|
}
|
|
29
|
+
},
|
|
30
|
+
"userConfigDir": {
|
|
31
|
+
"env": "XDG_CONFIG_HOME",
|
|
32
|
+
"dir": ".copilot",
|
|
33
|
+
"subdir": ".copilot",
|
|
34
|
+
"keep": [".copilot/hooks/"]
|
|
35
|
+
},
|
|
36
|
+
"userPlacements": {
|
|
37
|
+
"skill": {
|
|
38
|
+
"path": ".copilot/skills/{name}/",
|
|
39
|
+
"entrypointName": "SKILL.md"
|
|
40
|
+
},
|
|
41
|
+
"agent": {
|
|
42
|
+
"path": ".copilot/agents/{name}.agent.md"
|
|
43
|
+
},
|
|
44
|
+
"rule": {
|
|
45
|
+
"path": ".copilot/instructions/{name}.instructions.md"
|
|
46
|
+
},
|
|
47
|
+
"hook": {
|
|
48
|
+
"path": ".copilot/hooks/{name}.json"
|
|
49
|
+
},
|
|
50
|
+
"memory-template": {
|
|
51
|
+
"path": ".copilot/copilot-instructions.md"
|
|
52
|
+
},
|
|
53
|
+
"mcp-config": {
|
|
54
|
+
"path": "",
|
|
55
|
+
"fileless": true,
|
|
56
|
+
"configMerge": true,
|
|
57
|
+
"configFile": ".copilot/mcp-config.json",
|
|
58
|
+
"configKey": "mcpServers",
|
|
59
|
+
"configFragment": true,
|
|
60
|
+
"configFragmentKey": "servers",
|
|
61
|
+
"configEntryDefaults": { "tools": ["*"] },
|
|
62
|
+
"configCommandEntryDefaults": { "args": [] }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"scopeClash": {
|
|
66
|
+
"skill": "project",
|
|
67
|
+
"agent": "user",
|
|
68
|
+
"rule": "both",
|
|
69
|
+
"hook": "both",
|
|
70
|
+
"mcp-config": "project"
|
|
27
71
|
}
|
|
28
72
|
}
|