mini-trellis 0.1.0
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/COPYRIGHT +20 -0
- package/LICENSE +235 -0
- package/README.md +66 -0
- package/bin/mini-trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +153 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/init.d.ts +19 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +401 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mem.d.ts +30 -0
- package/dist/commands/mem.d.ts.map +1 -0
- package/dist/commands/mem.js +412 -0
- package/dist/commands/mem.js.map +1 -0
- package/dist/commands/migrate.d.ts +40 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +272 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/uninstall.d.ts +11 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +135 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/upgrade.d.ts +28 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +84 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/configurators/claude.d.ts +3 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +62 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codex.d.ts +3 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +21 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/index.d.ts +24 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +80 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/opencode.d.ts +2 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +62 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/pi.d.ts +2 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +18 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/shared.d.ts +147 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +377 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/workflow.d.ts +15 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +46 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +74 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +83 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/claude/index.d.ts +11 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +17 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +40 -0
- package/dist/templates/codex/config.toml +39 -0
- package/dist/templates/codex/hooks.json +15 -0
- package/dist/templates/codex/index.d.ts +11 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +22 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/common/bundled-skills/mini-trellis-session-insight/SKILL.md +37 -0
- package/dist/templates/common/bundled-skills/mini-trellis-session-insight/references/cli-quick-reference.md +36 -0
- package/dist/templates/common/bundled-skills/mini-trellis-session-insight/references/triggering-patterns.md +93 -0
- package/dist/templates/common/commands/remember.md +22 -0
- package/dist/templates/common/index.d.ts +48 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +104 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/skills/update-spec.md +16 -0
- package/dist/templates/extract.d.ts +40 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +106 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/markdown/agents.md +15 -0
- package/dist/templates/markdown/index.d.ts +10 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +18 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/research-readme.md +9 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +5 -0
- package/dist/templates/markdown/spec/guides/mini-memory.md.txt +30 -0
- package/dist/templates/markdown/workspace-index.md +23 -0
- package/dist/templates/opencode/lib/context-visibility.js +148 -0
- package/dist/templates/opencode/lib/session-utils.js +394 -0
- package/dist/templates/opencode/lib/trellis-context.js +627 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugins/session-start.js +65 -0
- package/dist/templates/pi/extensions/mini-trellis/index.ts.txt +170 -0
- package/dist/templates/pi/index.d.ts +4 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +9 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +9 -0
- package/dist/templates/shared-hooks/index.d.ts +13 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +26 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/session-start.py +676 -0
- package/dist/templates/template-utils.d.ts +26 -0
- package/dist/templates/template-utils.d.ts.map +1 -0
- package/dist/templates/template-utils.js +64 -0
- package/dist/templates/template-utils.js.map +1 -0
- package/dist/templates/trellis/config.yaml +34 -0
- package/dist/templates/trellis/gitattributes.txt +9 -0
- package/dist/templates/trellis/gitignore.txt +32 -0
- package/dist/templates/trellis/index.d.ts +8 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +16 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +1545 -0
- package/dist/templates/trellis/scripts/common/__init__.py +94 -0
- package/dist/templates/trellis/scripts/common/active_task.py +855 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +950 -0
- package/dist/templates/trellis/scripts/common/config.py +482 -0
- package/dist/templates/trellis/scripts/common/developer.py +192 -0
- package/dist/templates/trellis/scripts/common/git.py +203 -0
- package/dist/templates/trellis/scripts/common/git_context.py +106 -0
- package/dist/templates/trellis/scripts/common/io.py +160 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
- package/dist/templates/trellis/scripts/common/paths.py +543 -0
- package/dist/templates/trellis/scripts/common/safe_commit.py +322 -0
- package/dist/templates/trellis/scripts/common/session_context.py +708 -0
- package/dist/templates/trellis/scripts/common/task_context.py +470 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
- package/dist/templates/trellis/scripts/common/task_store.py +1930 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +498 -0
- package/dist/templates/trellis/scripts/common/tasks.py +122 -0
- package/dist/templates/trellis/scripts/common/trellis_config.py +239 -0
- package/dist/templates/trellis/scripts/common/types.py +110 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +242 -0
- package/dist/templates/trellis/scripts/get_context.py +16 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/types/ai-tools.d.ts +30 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +89 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/atomic-write.js +30 -0
- package/dist/utils/atomic-write.js.map +1 -0
- package/dist/utils/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +36 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +204 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/managed-paths.d.ts +5 -0
- package/dist/utils/managed-paths.d.ts.map +1 -0
- package/dist/utils/managed-paths.js +51 -0
- package/dist/utils/managed-paths.js.map +1 -0
- package/dist/utils/managed-removal.d.ts +42 -0
- package/dist/utils/managed-removal.d.ts.map +1 -0
- package/dist/utils/managed-removal.js +223 -0
- package/dist/utils/managed-removal.js.map +1 -0
- package/dist/utils/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +66 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +417 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ownership-aware removal planning for `uninstall`.
|
|
3
|
+
* Paths come from the current platform template maps, not a hash manifest.
|
|
4
|
+
*/
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { DIR_NAMES, FILE_NAMES } from "../constants/paths.js";
|
|
8
|
+
import { ALL_MANAGED_DIRS } from "../configurators/index.js";
|
|
9
|
+
import { scrubCodexConfigToml, scrubHooksJson, scrubManagedMarkdownBlock, scrubOpencodePackageJson, scrubPiSettings, } from "./uninstall-scrubbers.js";
|
|
10
|
+
import { cleanupEmptyDirs, TRELLIS_BLOCK_END, TRELLIS_BLOCK_START, } from "./managed-paths.js";
|
|
11
|
+
export function lstatIfPresent(absPath) {
|
|
12
|
+
try {
|
|
13
|
+
return fs.lstatSync(absPath);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (isMissingPathError(error))
|
|
17
|
+
return null;
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function isMissingPathError(error) {
|
|
22
|
+
return (error instanceof Error &&
|
|
23
|
+
"code" in error &&
|
|
24
|
+
error.code === "ENOENT");
|
|
25
|
+
}
|
|
26
|
+
function assertWithinProject(projectRoot, absPath) {
|
|
27
|
+
let root = path.resolve(projectRoot);
|
|
28
|
+
let resolved = path.resolve(absPath);
|
|
29
|
+
if (process.platform === "win32") {
|
|
30
|
+
root = root.toLowerCase();
|
|
31
|
+
resolved = resolved.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
if (resolved !== root && !resolved.startsWith(`${root}${path.sep}`)) {
|
|
34
|
+
throw new Error(`Managed path escapes project root: ${absPath}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function validateManagedRelativePath(posixPath) {
|
|
38
|
+
if (posixPath.length === 0 ||
|
|
39
|
+
posixPath.includes("\0") ||
|
|
40
|
+
posixPath.includes("\\") ||
|
|
41
|
+
path.posix.isAbsolute(posixPath) ||
|
|
42
|
+
path.win32.isAbsolute(posixPath) ||
|
|
43
|
+
/^[A-Za-z]:/.test(posixPath)) {
|
|
44
|
+
throw new Error(`Invalid managed manifest path: ${JSON.stringify(posixPath)}`);
|
|
45
|
+
}
|
|
46
|
+
const segments = posixPath.split("/");
|
|
47
|
+
if (segments.some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
|
|
48
|
+
throw new Error(`Invalid managed manifest path: ${JSON.stringify(posixPath)}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function assertSafeManagedPath(projectRoot, posixPath) {
|
|
52
|
+
validateManagedRelativePath(posixPath);
|
|
53
|
+
const root = path.resolve(projectRoot);
|
|
54
|
+
const segments = posixPath.split("/");
|
|
55
|
+
let current = root;
|
|
56
|
+
for (let index = 0; index < segments.length; index += 1) {
|
|
57
|
+
current = path.join(current, segments[index] ?? "");
|
|
58
|
+
assertWithinProject(root, current);
|
|
59
|
+
const stat = lstatIfPresent(current);
|
|
60
|
+
if (!stat || index === segments.length - 1)
|
|
61
|
+
continue;
|
|
62
|
+
if (stat.isSymbolicLink()) {
|
|
63
|
+
const realParent = fs.realpathSync(current);
|
|
64
|
+
assertWithinProject(root, realParent);
|
|
65
|
+
}
|
|
66
|
+
if (!stat.isDirectory() && !stat.isSymbolicLink()) {
|
|
67
|
+
throw new Error(`Managed path parent is not a directory: ${posixPath}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return current;
|
|
71
|
+
}
|
|
72
|
+
export function buildStructuredFileSpecs() {
|
|
73
|
+
const specs = [
|
|
74
|
+
...[".claude/settings.json", ".codex/hooks.json"].map((posixPath) => ({
|
|
75
|
+
posixPath,
|
|
76
|
+
reason: "Strip mini-trellis hooks; preserve user fields",
|
|
77
|
+
scrub: (content, deletedPaths) => scrubHooksJson(content, deletedPaths, "nested"),
|
|
78
|
+
})),
|
|
79
|
+
{
|
|
80
|
+
posixPath: ".opencode/package.json",
|
|
81
|
+
reason: "Remove @opencode-ai/plugin dep; preserve other deps",
|
|
82
|
+
scrub: (content) => scrubOpencodePackageJson(content),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
posixPath: ".pi/settings.json",
|
|
86
|
+
reason: "Strip mini-trellis extension/prompts entries; preserve user fields",
|
|
87
|
+
scrub: (content) => scrubPiSettings(content),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
posixPath: ".codex/config.toml",
|
|
91
|
+
reason: "Remove mini-trellis project_doc_fallback_filenames and notes",
|
|
92
|
+
scrub: (content) => scrubCodexConfigToml(content),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
posixPath: FILE_NAMES.AGENTS,
|
|
96
|
+
reason: "Strip mini-trellis managed block; preserve user instructions",
|
|
97
|
+
scrub: (content) => scrubManagedMarkdownBlock(content, TRELLIS_BLOCK_START, TRELLIS_BLOCK_END),
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
return new Map(specs.map((spec) => [spec.posixPath, spec]));
|
|
101
|
+
}
|
|
102
|
+
export function buildManagedRemovalPlan(cwd, hashes, options = {}) {
|
|
103
|
+
const structured = buildStructuredFileSpecs();
|
|
104
|
+
const allPosixPaths = Object.keys(hashes);
|
|
105
|
+
const deletions = [];
|
|
106
|
+
const modifications = [];
|
|
107
|
+
for (const posixPath of allPosixPaths) {
|
|
108
|
+
const absPath = options.strictPaths
|
|
109
|
+
? assertSafeManagedPath(cwd, posixPath)
|
|
110
|
+
: path.join(cwd, ...posixPath.split("/"));
|
|
111
|
+
const stat = options.strictPaths ? lstatIfPresent(absPath) : null;
|
|
112
|
+
const spec = structured.get(posixPath);
|
|
113
|
+
if (!spec) {
|
|
114
|
+
deletions.push({
|
|
115
|
+
posixPath,
|
|
116
|
+
absPath,
|
|
117
|
+
missing: options.strictPaths ? stat === null : !fs.existsSync(absPath),
|
|
118
|
+
});
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (options.strictPaths) {
|
|
122
|
+
if (!stat || stat.isSymbolicLink() || !stat.isFile()) {
|
|
123
|
+
deletions.push({ posixPath, absPath, missing: stat === null });
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (!fs.existsSync(absPath)) {
|
|
128
|
+
deletions.push({ posixPath, absPath, missing: true });
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const content = fs.readFileSync(absPath, "utf-8");
|
|
132
|
+
const result = spec.scrub(content, allPosixPaths);
|
|
133
|
+
if (options.strictPaths &&
|
|
134
|
+
!result.fullyEmpty &&
|
|
135
|
+
result.content === content) {
|
|
136
|
+
throw new Error(`Cannot prove Trellis content was removed from structured file: ${posixPath}`);
|
|
137
|
+
}
|
|
138
|
+
if (result.fullyEmpty) {
|
|
139
|
+
deletions.push({ posixPath, absPath, missing: false });
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
modifications.push({
|
|
143
|
+
posixPath,
|
|
144
|
+
absPath,
|
|
145
|
+
reason: spec.reason,
|
|
146
|
+
result,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
deletions,
|
|
152
|
+
modifications,
|
|
153
|
+
removeTrellisDir: true,
|
|
154
|
+
allPosixPaths,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export function executeManagedRemovalPlan(cwd, plan) {
|
|
158
|
+
let deletedFiles = 0;
|
|
159
|
+
let modifiedFiles = 0;
|
|
160
|
+
for (const modification of plan.modifications) {
|
|
161
|
+
fs.writeFileSync(modification.absPath, modification.result.content);
|
|
162
|
+
modifiedFiles += 1;
|
|
163
|
+
}
|
|
164
|
+
const deletedDirCandidates = new Set();
|
|
165
|
+
for (const deletion of plan.deletions) {
|
|
166
|
+
if (deletion.missing)
|
|
167
|
+
continue;
|
|
168
|
+
try {
|
|
169
|
+
fs.unlinkSync(deletion.absPath);
|
|
170
|
+
deletedFiles += 1;
|
|
171
|
+
deletedDirCandidates.add(path.posix.dirname(deletion.posixPath));
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// best-effort unlink
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
let deletedDirs = 0;
|
|
178
|
+
if (plan.removeTrellisDir) {
|
|
179
|
+
const trellisDir = path.join(cwd, DIR_NAMES.WORKFLOW);
|
|
180
|
+
if (lstatIfPresent(trellisDir)) {
|
|
181
|
+
fs.rmSync(trellisDir, { recursive: true, force: true });
|
|
182
|
+
deletedDirs += 1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const dirPosix of deletedDirCandidates) {
|
|
186
|
+
if (dirPosix === "." || dirPosix === "")
|
|
187
|
+
continue;
|
|
188
|
+
cleanupEmptyDirs(cwd, dirPosix);
|
|
189
|
+
}
|
|
190
|
+
const sortedManagedDirs = [...ALL_MANAGED_DIRS]
|
|
191
|
+
.filter((dir) => dir !== DIR_NAMES.WORKFLOW)
|
|
192
|
+
.sort((left, right) => right.split("/").length - left.split("/").length);
|
|
193
|
+
for (const managedDir of sortedManagedDirs) {
|
|
194
|
+
const abs = path.join(cwd, ...managedDir.split("/"));
|
|
195
|
+
if (!fs.existsSync(abs))
|
|
196
|
+
continue;
|
|
197
|
+
try {
|
|
198
|
+
const stat = fs.statSync(abs);
|
|
199
|
+
if (!stat.isDirectory())
|
|
200
|
+
continue;
|
|
201
|
+
if (fs.readdirSync(abs).length !== 0)
|
|
202
|
+
continue;
|
|
203
|
+
fs.rmdirSync(abs);
|
|
204
|
+
deletedDirs += 1;
|
|
205
|
+
let parentPosix = path.posix.dirname(managedDir);
|
|
206
|
+
while (parentPosix !== "." && parentPosix.length > 0) {
|
|
207
|
+
const parentAbs = path.join(cwd, ...parentPosix.split("/"));
|
|
208
|
+
if (!fs.existsSync(parentAbs))
|
|
209
|
+
break;
|
|
210
|
+
if (fs.readdirSync(parentAbs).length !== 0)
|
|
211
|
+
break;
|
|
212
|
+
fs.rmdirSync(parentAbs);
|
|
213
|
+
deletedDirs += 1;
|
|
214
|
+
parentPosix = path.posix.dirname(parentPosix);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
// best-effort directory cleanup
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return { deletedFiles, modifiedFiles, deletedDirs };
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=managed-removal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-removal.js","sourceRoot":"","sources":["../../src/utils/managed-removal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA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AC,GAAG,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC5D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;oBAAE,MAAM;gBACrC,IAAI,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC;oBAAE,MAAM;gBAClD,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;gBACxB,WAAW,IAAI,CAAC,CAAC;gBACjB,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gCAAgC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POSIX path normalization utility
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for converting OS-native path separators to POSIX `/`.
|
|
5
|
+
* Use ONLY for logical path strings used as cross-platform persistence keys
|
|
6
|
+
* (e.g. hash dictionary keys, JSON-stored paths). Do NOT use for paths passed
|
|
7
|
+
* to filesystem APIs — those must remain OS-native via `path.join`.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Convert any path string's `\` separators to POSIX `/`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function toPosix(p: string): string;
|
|
13
|
+
//# sourceMappingURL=posix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posix.d.ts","sourceRoot":"","sources":["../../src/utils/posix.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POSIX path normalization utility
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for converting OS-native path separators to POSIX `/`.
|
|
5
|
+
* Use ONLY for logical path strings used as cross-platform persistence keys
|
|
6
|
+
* (e.g. hash dictionary keys, JSON-stored paths). Do NOT use for paths passed
|
|
7
|
+
* to filesystem APIs — those must remain OS-native via `path.join`.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Convert any path string's `\` separators to POSIX `/`.
|
|
11
|
+
*/
|
|
12
|
+
export function toPosix(p) {
|
|
13
|
+
return p.replace(/\\/g, "/");
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=posix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posix.js","sourceRoot":"","sources":["../../src/utils/posix.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scrubbers for structured config files during `trellis uninstall`.
|
|
3
|
+
*
|
|
4
|
+
* Each scrubber takes the file content (and any context it needs) and returns
|
|
5
|
+
* `{ content, fullyEmpty }`:
|
|
6
|
+
* - `content` is the post-scrub text to write back if the file should remain.
|
|
7
|
+
* - `fullyEmpty` is true when, after stripping every trellis-managed value,
|
|
8
|
+
* nothing meaningful is left. The caller deletes the file in that case.
|
|
9
|
+
*
|
|
10
|
+
* Manifest path matching (for hooks.json scrubbers) uses substring containment
|
|
11
|
+
* on the resolved `command` string. The leading `python3 ` / `python ` prefix
|
|
12
|
+
* does not matter — we just look for the manifest-relative file path.
|
|
13
|
+
*/
|
|
14
|
+
export interface ScrubResult {
|
|
15
|
+
content: string;
|
|
16
|
+
fullyEmpty: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Scrub a hooks-shaped settings JSON file.
|
|
20
|
+
*
|
|
21
|
+
* `mode = "nested"` → `hooks.{Event}.[ {matcher?, hooks: [ {command,...} ]} ]`
|
|
22
|
+
* `mode = "flat"` → `hooks.{Event}.[ {command,...} ]`
|
|
23
|
+
*
|
|
24
|
+
* Strips every entry whose command references a path in `deletedPaths`,
|
|
25
|
+
* then bottom-up cleans empty containers (matcher block, event array, hooks
|
|
26
|
+
* object). The exact opt-in Trellis Claude statusLine command is also removed;
|
|
27
|
+
* other keys outside `hooks` (e.g. `env`, `model`, `permissions`, `version`)
|
|
28
|
+
* are preserved.
|
|
29
|
+
*/
|
|
30
|
+
export declare function scrubHooksJson(content: string, deletedPaths: readonly string[], mode: "nested" | "flat"): ScrubResult;
|
|
31
|
+
/**
|
|
32
|
+
* Scrub `.opencode/package.json`:
|
|
33
|
+
* - remove `dependencies["@opencode-ai/plugin"]`
|
|
34
|
+
* - if `dependencies` ends up empty → drop the field
|
|
35
|
+
* - fully empty when nothing is left in the object
|
|
36
|
+
*/
|
|
37
|
+
export declare function scrubOpencodePackageJson(content: string): ScrubResult;
|
|
38
|
+
/**
|
|
39
|
+
* Scrub `.pi/settings.json`:
|
|
40
|
+
* - drop `enableSkillCommands` (trellis-flagged)
|
|
41
|
+
* - remove trellis entries from `extensions`/`skills`/`prompts` arrays
|
|
42
|
+
* - remove trellis-managed `packages["npm:pi-subagents"]` isolation override
|
|
43
|
+
* - drop arrays that become empty
|
|
44
|
+
*/
|
|
45
|
+
export declare function scrubPiSettings(content: string): ScrubResult;
|
|
46
|
+
/**
|
|
47
|
+
* Scrub `.codex/config.toml`.
|
|
48
|
+
*
|
|
49
|
+
* The current Trellis-emitted file has three owned chunks:
|
|
50
|
+
* 1. The line `project_doc_fallback_filenames = ["AGENTS.md"]`.
|
|
51
|
+
* 2. Comment lines derived from the current shipped Codex config template,
|
|
52
|
+
* plus an allowlist of legacy template comments.
|
|
53
|
+
* 3. The exact `[agents].max_depth = 1` setting.
|
|
54
|
+
*
|
|
55
|
+
* Strategy: line-based removal. We strip:
|
|
56
|
+
* - the `project_doc_fallback_filenames = ...` line
|
|
57
|
+
* - any line that is *only* a known Trellis template comment
|
|
58
|
+
* - Trellis's exact `max_depth = 1`, retaining `[agents]` when user keys remain
|
|
59
|
+
* - blank lines that surrounded those removals
|
|
60
|
+
*
|
|
61
|
+
* If the user added their own non-trellis lines, they are preserved as-is.
|
|
62
|
+
* "Fully empty" = post-scrub content has no non-whitespace characters.
|
|
63
|
+
*/
|
|
64
|
+
export declare function scrubCodexConfigToml(content: string): ScrubResult;
|
|
65
|
+
export declare function scrubManagedMarkdownBlock(content: string, startMarker: string, endMarker: string): ScrubResult;
|
|
66
|
+
//# sourceMappingURL=uninstall-scrubbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall-scrubbers.d.ts","sourceRoot":"","sources":["../../src/utils/uninstall-scrubbers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;CACrB;AAoED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,IAAI,EAAE,QAAQ,GAAG,MAAM,GACtB,WAAW,CAmGb;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CA+BrE;AAiBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CA4D5D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAuGjE;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,WAAW,CAqBb"}
|