teamshare-bridge 0.26.21 → 0.26.23
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/dist/bridge/daemon.js +32 -0
- package/dist/bridge/daemon.js.map +1 -1
- package/dist/bridge/local-server.d.ts +29 -0
- package/dist/bridge/local-server.js +202 -12
- package/dist/bridge/local-server.js.map +1 -1
- package/dist/cli/commands/blog.js +31 -16
- package/dist/cli/commands/blog.js.map +1 -1
- package/dist/cli/commands/build.js +2 -2
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/chat.js +2 -3
- package/dist/cli/commands/chat.js.map +1 -1
- package/dist/cli/commands/cleanup.js +98 -27
- package/dist/cli/commands/cleanup.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +4 -0
- package/dist/cli/commands/plan.js +33 -10
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/planner.js +15 -5
- package/dist/cli/commands/planner.js.map +1 -1
- package/dist/cli/commands/research.js +26 -20
- package/dist/cli/commands/research.js.map +1 -1
- package/dist/cli/commands/run.js +2 -5
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/worker.js +2 -3
- package/dist/cli/commands/worker.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/cache-cleaner.js +226 -205
- package/dist/lib/cache-cleaner.js.map +1 -1
- package/dist/lib/git/git-auto.js +46 -4
- package/dist/lib/git/git-auto.js.map +1 -1
- package/dist/lib/git/git-core.d.ts +11 -0
- package/dist/lib/git/git-core.js +14 -0
- package/dist/lib/git/git-core.js.map +1 -1
- package/dist/lib/git/git-finalize.d.ts +4 -0
- package/dist/lib/git/git-finalize.js +46 -10
- package/dist/lib/git/git-finalize.js.map +1 -1
- package/dist/lib/git/git-runner.js +2 -5
- package/dist/lib/git/git-runner.js.map +1 -1
- package/dist/lib/git/index.d.ts +2 -1
- package/dist/lib/git/index.js +5 -4
- package/dist/lib/git/index.js.map +1 -1
- package/dist/lib/git/pr-token.d.ts +29 -0
- package/dist/lib/git/pr-token.js +102 -0
- package/dist/lib/git/pr-token.js.map +1 -0
- package/dist/lib/harness/activity.d.ts +95 -0
- package/dist/lib/harness/activity.js +110 -0
- package/dist/lib/harness/activity.js.map +1 -0
- package/dist/lib/harness/opencode-control.d.ts +22 -0
- package/dist/lib/harness/opencode-control.js +47 -2
- package/dist/lib/harness/opencode-control.js.map +1 -1
- package/dist/lib/harness/run-scope.d.ts +23 -4
- package/dist/lib/harness/run-scope.js +237 -48
- package/dist/lib/harness/run-scope.js.map +1 -1
- package/dist/lib/harness/spawn.js +237 -12
- package/dist/lib/harness/spawn.js.map +1 -1
- package/dist/lib/llm/usage-reader.js +2 -1
- package/dist/lib/llm/usage-reader.js.map +1 -1
- package/dist/lib/orchestrator/worktree.d.ts +7 -1
- package/dist/lib/orchestrator/worktree.js +18 -1
- package/dist/lib/orchestrator/worktree.js.map +1 -1
- package/dist/lib/workspace/bus.d.ts +9 -0
- package/dist/lib/workspace/bus.js +25 -0
- package/dist/lib/workspace/bus.js.map +1 -1
- package/dist/lib/workspace/mirror.js +51 -5
- package/dist/lib/workspace/mirror.js.map +1 -1
- package/dist/lib/workspace/state-root.d.ts +44 -0
- package/dist/lib/workspace/state-root.js +266 -0
- package/dist/lib/workspace/state-root.js.map +1 -0
- package/dist/lib/workspace/workspace-audit.d.ts +20 -0
- package/dist/lib/workspace/workspace-audit.js +339 -0
- package/dist/lib/workspace/workspace-audit.js.map +1 -0
- package/package.json +1 -1
|
@@ -6,8 +6,10 @@ exports.createRunScope = createRunScope;
|
|
|
6
6
|
exports.removeRunScope = removeRunScope;
|
|
7
7
|
exports.scopeWorkingDirectoryNotice = scopeWorkingDirectoryNotice;
|
|
8
8
|
exports.excludeRunScopeFromGit = excludeRunScopeFromGit;
|
|
9
|
+
exports.unexcludeRunScopeFromGit = unexcludeRunScopeFromGit;
|
|
10
|
+
exports.sweepStaleScopes = sweepStaleScopes;
|
|
9
11
|
/**
|
|
10
|
-
* RUN SCOPE (2026-10): a run gets its OWN opencode project.
|
|
12
|
+
* RUN SCOPE (2026-10, revised 2026-10-27): a run gets its OWN opencode project.
|
|
11
13
|
*
|
|
12
14
|
* WHY THIS EXISTS
|
|
13
15
|
* ---------------
|
|
@@ -28,27 +30,19 @@ exports.excludeRunScopeFromGit = excludeRunScopeFromGit;
|
|
|
28
30
|
* session silently acted as the AGENT (and, after the run, kept the stale
|
|
29
31
|
* client until the service re-resolved it).
|
|
30
32
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* - top-level FILES are copied (small ones) - a file symlink needs
|
|
45
|
-
* elevated privileges on Windows, and a copy is the honest fallback;
|
|
46
|
-
* - the scope is EXCLUDED from git (`.git/info/exclude`), so the human's
|
|
47
|
-
* working tree never shows it;
|
|
48
|
-
* - the scope is removed when the run ends, and the opencode project
|
|
49
|
-
* registration for it is forgotten (the service would otherwise keep the
|
|
50
|
-
* directory - and its cached MCP client - alive forever).
|
|
51
|
-
*
|
|
33
|
+
* WORKSPACE-STATE RULE (2026-10-27)
|
|
34
|
+
* --------------------------------
|
|
35
|
+
* The bridge creates ZERO permanent entries inside a linked folder. The scope
|
|
36
|
+
* is the ONE allowed TRANSIENT exception - it must live inside the project
|
|
37
|
+
* root (that is what makes `git` resolve to the real repo and keeps opencode
|
|
38
|
+
* from filing the scope as a worktree of the human's project), but:
|
|
39
|
+
* - it is removed on EVERY exit path (clean, failure, forced stop);
|
|
40
|
+
* - it is NEVER committed (`git-pipeline.ts` filters `.teamshare-runs/`
|
|
41
|
+
* out of every `git add`, belt-and-braces beside the exclude);
|
|
42
|
+
* - the `.git/info/exclude` entry is a MARKED block added at creation and
|
|
43
|
+
* stripped again at cleanup, so the repo returns to its original state;
|
|
44
|
+
* - a crash leftover (no live harness record) is reaped by
|
|
45
|
+
* `sweepStaleScopes()` on daemon boot + periodically.
|
|
52
46
|
* A run in an ISOLATED tree (the isolation mirror) needs none of this: the
|
|
53
47
|
* mirror is already a directory of its own, so the human's project is never
|
|
54
48
|
* touched. `needsRunScope()` is the single decision point.
|
|
@@ -63,6 +57,10 @@ exports.RUN_SCOPE_DIR_NAME = '.teamshare-runs';
|
|
|
63
57
|
* mirror module is far too heavy to import from a harness helper.
|
|
64
58
|
*/
|
|
65
59
|
const MIRROR_MARKER_FILE = '.teamshare-mirror.json';
|
|
60
|
+
/** Marked exclude block - the ONLY lines the bridge may add/remove. */
|
|
61
|
+
const EXCLUDE_BEGIN = '# >>> TeamShare run scope (auto, transient) - do not edit';
|
|
62
|
+
const EXCLUDE_END = '# <<< TeamShare run scope (auto, transient)';
|
|
63
|
+
const EXCLUDE_BODY = '.teamshare-runs/';
|
|
66
64
|
/** Top-level files above this size are not copied into the scope. */
|
|
67
65
|
const MAX_COPY_BYTES = 1024 * 1024;
|
|
68
66
|
/**
|
|
@@ -135,37 +133,104 @@ function createRunScope(projectRoot, runId) {
|
|
|
135
133
|
return null;
|
|
136
134
|
}
|
|
137
135
|
}
|
|
136
|
+
function sleepSync(ms) {
|
|
137
|
+
try {
|
|
138
|
+
const { execFileSync } = require('node:child_process');
|
|
139
|
+
execFileSync(process.execPath, ['-e', `setTimeout(()=>{},${ms})`], {
|
|
140
|
+
stdio: 'ignore',
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
/* best-effort */
|
|
145
|
+
}
|
|
146
|
+
}
|
|
138
147
|
/**
|
|
139
148
|
* Remove a scope directory. The links are unlinked EXPLICITLY first: a
|
|
140
149
|
* recursive delete of a directory holding junctions must never follow them
|
|
141
|
-
* into the user's project.
|
|
142
|
-
|
|
150
|
+
* into the user's project. Hardened (2026-10-27): `.opencode` first (it holds
|
|
151
|
+
* the identity config), then links, then copies; EBUSY on Windows is retried,
|
|
152
|
+
* and a survivor is left for `sweepStaleScopes` rather than half-deleted.
|
|
153
|
+
*/
|
|
154
|
+
function removeRunScope(dir) {
|
|
143
155
|
try {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
156
|
+
if (!(0, node_fs_1.existsSync)(dir))
|
|
157
|
+
return;
|
|
158
|
+
// Pass 1: the identity config - the one file that must never survive.
|
|
159
|
+
try {
|
|
160
|
+
const cfg = (0, node_path_1.join)(dir, '.opencode');
|
|
161
|
+
if ((0, node_fs_1.existsSync)(cfg)) {
|
|
162
|
+
try {
|
|
163
|
+
const { rmSync } = require('node:fs');
|
|
164
|
+
rmSync(cfg, { recursive: true, force: true });
|
|
150
165
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
(0, node_fs_1.rmdirSync)(path, { recursive: true });
|
|
166
|
+
catch {
|
|
167
|
+
/* fall through to the per-entry pass */
|
|
154
168
|
}
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
/* best-effort */
|
|
173
|
+
}
|
|
174
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
175
|
+
try {
|
|
176
|
+
for (const entry of (0, node_fs_1.readdirSync)(dir)) {
|
|
177
|
+
const path = (0, node_path_1.join)(dir, entry);
|
|
178
|
+
try {
|
|
179
|
+
const stat = (0, node_fs_1.lstatSync)(path);
|
|
180
|
+
if (stat.isSymbolicLink()) {
|
|
181
|
+
(0, node_fs_1.unlinkSync)(path);
|
|
182
|
+
}
|
|
183
|
+
else if (stat.isDirectory()) {
|
|
184
|
+
// A copied directory (rare) - remove its contents, never a link.
|
|
185
|
+
(0, node_fs_1.rmdirSync)(path, { recursive: true });
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
(0, node_fs_1.unlinkSync)(path);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
/* best-effort per entry */
|
|
193
|
+
}
|
|
157
194
|
}
|
|
195
|
+
(0, node_fs_1.rmdirSync)(dir, { recursive: true });
|
|
196
|
+
break;
|
|
158
197
|
}
|
|
159
|
-
catch {
|
|
160
|
-
|
|
198
|
+
catch (err) {
|
|
199
|
+
// Windows: the opencode service can hold the dir briefly after the
|
|
200
|
+
// project registration is forgotten. Retry; the sweeper reaps a
|
|
201
|
+
// true survivor.
|
|
202
|
+
if (attempt < 2)
|
|
203
|
+
sleepSync(500 * (attempt + 1));
|
|
204
|
+
else {
|
|
205
|
+
try {
|
|
206
|
+
const { reportDiagnosticSafe } = require('../diagnostics');
|
|
207
|
+
reportDiagnosticSafe({
|
|
208
|
+
kind: 'scope_cleanup_failed',
|
|
209
|
+
severity: 'warning',
|
|
210
|
+
message: `run scope survived removal: ${dir} (${err instanceof Error ? err.message : String(err)})`,
|
|
211
|
+
context: { dir },
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
/* diagnostics must never fail cleanup */
|
|
216
|
+
}
|
|
217
|
+
}
|
|
161
218
|
}
|
|
162
219
|
}
|
|
163
|
-
|
|
164
|
-
//
|
|
220
|
+
// Remove the parent when it is empty (no other run is using it) - and
|
|
221
|
+
// only then strip the marked exclude block, so a still-running sibling
|
|
222
|
+
// scope keeps its cover.
|
|
165
223
|
try {
|
|
166
224
|
const parent = (0, node_path_1.join)(dir, '..');
|
|
167
|
-
if ((0, node_fs_1.readdirSync)(parent).length === 0)
|
|
225
|
+
if ((0, node_fs_1.existsSync)(parent) && (0, node_fs_1.readdirSync)(parent).length === 0) {
|
|
168
226
|
(0, node_fs_1.rmdirSync)(parent);
|
|
227
|
+
try {
|
|
228
|
+
unexcludeRunScopeFromGit((0, node_path_1.join)(parent, '..'));
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
/* best-effort */
|
|
232
|
+
}
|
|
233
|
+
}
|
|
169
234
|
}
|
|
170
235
|
catch {
|
|
171
236
|
/* not empty / already gone */
|
|
@@ -184,20 +249,24 @@ function scopeWorkingDirectoryNotice(scope) {
|
|
|
184
249
|
return [
|
|
185
250
|
'## Working directory',
|
|
186
251
|
'',
|
|
187
|
-
`This session runs in \`${scope.dir}\` - a per-run directory that mirrors the project root \`${scope.projectRoot}
|
|
252
|
+
`This session runs in \`${scope.dir}\` - a TRANSIENT per-run directory that mirrors the project root \`${scope.projectRoot}\`. It is removed when this run ends: never store anything here you need afterwards; deliverables belong in TeamShare documents.`,
|
|
188
253
|
'- every top-level DIRECTORY is linked to the real one, so relative paths (e.g. `frontend/src/app.ts`) resolve to the real project and your edits land there;',
|
|
189
254
|
'- top-level FILES are copies - if you must change one, write it to its real path under the project root;',
|
|
190
255
|
`- the project root is \`${scope.projectRoot}\` - prefer absolute paths under it;`,
|
|
191
|
-
'- `git` still sees the real repository (the scope has no `.git` of its own).',
|
|
256
|
+
'- `git` still sees the real repository (the scope has no `.git` of its own). Prefer `git -C <projectRoot>` for read-only git commands.',
|
|
192
257
|
].join('\n');
|
|
193
258
|
}
|
|
194
259
|
/**
|
|
195
|
-
* Keep the scope out of the human's git status. LOCAL only
|
|
196
|
-
* exclude`) - the user's own `.gitignore` is never touched.
|
|
260
|
+
* Keep the scope out of the human's git status while it exists. LOCAL only
|
|
261
|
+
* (`.git/info/exclude`) - the user's own `.gitignore` is never touched.
|
|
262
|
+
* The entry is a MARKED block so cleanup can strip exactly what it added and
|
|
263
|
+
* leave every other line (including older unmarked bridge lines) alone.
|
|
197
264
|
*/
|
|
198
265
|
function excludeRunScopeFromGit(gitRoot) {
|
|
199
266
|
try {
|
|
200
|
-
const file = (
|
|
267
|
+
const file = gitExcludePath(gitRoot);
|
|
268
|
+
if (!file)
|
|
269
|
+
return;
|
|
201
270
|
let current = '';
|
|
202
271
|
try {
|
|
203
272
|
current = (0, node_fs_1.readFileSync)(file, 'utf8');
|
|
@@ -205,14 +274,134 @@ function excludeRunScopeFromGit(gitRoot) {
|
|
|
205
274
|
catch {
|
|
206
275
|
/* the file may not exist yet - append creates it */
|
|
207
276
|
}
|
|
208
|
-
|
|
209
|
-
if (existing.has(`${exports.RUN_SCOPE_DIR_NAME}/`))
|
|
277
|
+
if (current.includes(EXCLUDE_BEGIN))
|
|
210
278
|
return;
|
|
211
279
|
const prefix = current.length > 0 && !current.endsWith('\n') ? '\n' : '';
|
|
212
|
-
(0, node_fs_1.appendFileSync)(file, `${prefix}
|
|
280
|
+
(0, node_fs_1.appendFileSync)(file, `${prefix}${EXCLUDE_BEGIN}\n${EXCLUDE_BODY}\n${EXCLUDE_END}\n`);
|
|
213
281
|
}
|
|
214
282
|
catch {
|
|
215
283
|
/* best-effort: an exclude problem must never fail a run */
|
|
216
284
|
}
|
|
217
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Strip the marked scope block added by `excludeRunScopeFromGit`. Removes the
|
|
288
|
+
* block ONLY - every other line is preserved byte-for-byte. Safe to call when
|
|
289
|
+
* no scopes remain; also restores the file to zero-length difference when the
|
|
290
|
+
* block was the only addition.
|
|
291
|
+
*/
|
|
292
|
+
function unexcludeRunScopeFromGit(gitRoot) {
|
|
293
|
+
try {
|
|
294
|
+
const file = gitExcludePath(gitRoot);
|
|
295
|
+
if (!file || !(0, node_fs_1.existsSync)(file))
|
|
296
|
+
return;
|
|
297
|
+
const current = (0, node_fs_1.readFileSync)(file, 'utf8');
|
|
298
|
+
if (!current.includes(EXCLUDE_BEGIN))
|
|
299
|
+
return;
|
|
300
|
+
const lines = current.split('\n');
|
|
301
|
+
const start = lines.findIndex((l) => l.includes(EXCLUDE_BEGIN));
|
|
302
|
+
const end = lines.findIndex((l) => l.includes(EXCLUDE_END));
|
|
303
|
+
if (start === -1 || end === -1 || end < start)
|
|
304
|
+
return;
|
|
305
|
+
lines.splice(start, end - start + 1);
|
|
306
|
+
// Collapse the blank line the append may have introduced, but never touch
|
|
307
|
+
// anything else.
|
|
308
|
+
const next = lines.join('\n').replace(/\n{3,}/g, '\n\n');
|
|
309
|
+
(0, node_fs_1.writeFileSync)(file, next, 'utf8');
|
|
310
|
+
}
|
|
311
|
+
catch {
|
|
312
|
+
/* best-effort */
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function gitExcludePath(gitRoot) {
|
|
316
|
+
try {
|
|
317
|
+
// `--git-path` resolves correctly when `.git` is a FILE
|
|
318
|
+
// (`--separate-git-dir` containers) as well as a directory.
|
|
319
|
+
const { execFileSync } = require('node:child_process');
|
|
320
|
+
const { envWithoutShims } = require('../workspace/shims');
|
|
321
|
+
const out = execFileSync('git', ['rev-parse', '--git-path', 'info/exclude'], {
|
|
322
|
+
cwd: gitRoot,
|
|
323
|
+
encoding: 'utf-8',
|
|
324
|
+
timeout: 5_000,
|
|
325
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
326
|
+
env: envWithoutShims(),
|
|
327
|
+
})
|
|
328
|
+
.toString()
|
|
329
|
+
.trim();
|
|
330
|
+
if (!out)
|
|
331
|
+
return null;
|
|
332
|
+
const path = require('node:path');
|
|
333
|
+
return path.isAbsolute(out) ? out : path.resolve(gitRoot, out);
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
// Not a repo (or git missing) - fall back to the conventional path so a
|
|
337
|
+
// future `git init` still finds the file; never fail the run.
|
|
338
|
+
try {
|
|
339
|
+
return (0, node_path_1.join)(gitRoot, '.git', 'info', 'exclude');
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Reap crash-leftover scopes: `<projectRoot>/.teamshare-runs/*` with no live
|
|
348
|
+
* harness record. A scope whose `scopeDir` is still claimed by
|
|
349
|
+
* `~/.teamshare/sessions/harness-*.json` is SKIPPED - a question pause, an
|
|
350
|
+
* idle kill or a stop-in-flight resume reuses the same tree.
|
|
351
|
+
*/
|
|
352
|
+
function sweepStaleScopes(projectRoots) {
|
|
353
|
+
const removed = [];
|
|
354
|
+
const live = new Set();
|
|
355
|
+
try {
|
|
356
|
+
const { readdirSync: rs, readFileSync: rf, existsSync: ex, } = require('node:fs');
|
|
357
|
+
const { homedir } = require('node:os');
|
|
358
|
+
const path = require('node:path');
|
|
359
|
+
const sessionsDir = path.join(homedir(), '.teamshare', 'sessions');
|
|
360
|
+
if (ex(sessionsDir)) {
|
|
361
|
+
for (const name of rs(sessionsDir)) {
|
|
362
|
+
if (!name.startsWith('harness-') || !name.endsWith('.json'))
|
|
363
|
+
continue;
|
|
364
|
+
try {
|
|
365
|
+
const rec = JSON.parse(rf(path.join(sessionsDir, name), 'utf8'));
|
|
366
|
+
if (rec?.scopeDir)
|
|
367
|
+
live.add(rec.scopeDir.replace(/\\/g, '/').toLowerCase());
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
/* corrupt record - ignore */
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
/* best-effort: an unreadable live set reaps nothing extra */
|
|
377
|
+
}
|
|
378
|
+
for (const root of projectRoots) {
|
|
379
|
+
let names = [];
|
|
380
|
+
try {
|
|
381
|
+
const base = (0, node_path_1.join)(root, exports.RUN_SCOPE_DIR_NAME);
|
|
382
|
+
if (!(0, node_fs_1.existsSync)(base))
|
|
383
|
+
continue;
|
|
384
|
+
names = (0, node_fs_1.readdirSync)(base);
|
|
385
|
+
}
|
|
386
|
+
catch {
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
for (const name of names) {
|
|
390
|
+
const dir = (0, node_path_1.join)(root, exports.RUN_SCOPE_DIR_NAME, name);
|
|
391
|
+
try {
|
|
392
|
+
if ((0, node_fs_1.lstatSync)(dir).isSymbolicLink())
|
|
393
|
+
continue;
|
|
394
|
+
if (live.has(dir.replace(/\\/g, '/').toLowerCase()))
|
|
395
|
+
continue;
|
|
396
|
+
removeRunScope(dir);
|
|
397
|
+
if (!(0, node_fs_1.existsSync)(dir))
|
|
398
|
+
removed.push(dir);
|
|
399
|
+
}
|
|
400
|
+
catch {
|
|
401
|
+
/* best-effort per scope */
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return removed;
|
|
406
|
+
}
|
|
218
407
|
//# sourceMappingURL=run-scope.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-scope.js","sourceRoot":"","sources":["../../../src/lib/harness/run-scope.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"run-scope.js","sourceRoot":"","sources":["../../../src/lib/harness/run-scope.ts"],"names":[],"mappings":";;;AA2FA,sCAQC;AAcD,wCAyCC;AAqBD,wCA6EC;AAOD,kEAUC;AAQD,wDAmBC;AAQD,4DAkBC;AA2CD,4CAmDC;AAhaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qCAaiB;AACjB,yCAAiC;AAEjC,gDAAgD;AACnC,QAAA,kBAAkB,GAAG,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAEpD,uEAAuE;AACvE,MAAM,aAAa,GACjB,2DAA2D,CAAC;AAC9D,MAAM,WAAW,GAAG,6CAA6C,CAAC;AAClE,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAExC,qEAAqE;AACrE,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAWnC;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,GAAY;IACxC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,yDAAyD;IAC3D,CAAC;IACD,OAAO,IAAI,CAAC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