@ouro.bot/cli 0.1.0-alpha.134 → 0.1.0-alpha.135
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.json +7 -0
- package/dist/heart/core.js +63 -39
- package/dist/heart/tool-loop.js +5 -1
- package/dist/mind/context.js +62 -0
- package/dist/mind/prompt.js +9 -4
- package/dist/repertoire/ado-semantic.js +6 -0
- package/dist/repertoire/coding/tools.js +5 -0
- package/dist/repertoire/tools-base.js +24 -31
- package/dist/repertoire/tools-bluebubbles.js +1 -0
- package/dist/repertoire/tools-github.js +1 -6
- package/dist/repertoire/tools-teams.js +9 -36
- package/dist/repertoire/tools.js +15 -69
- package/package.json +1 -1
- package/dist/heart/safe-workspace.js +0 -381
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.resetSafeWorkspaceSelection = resetSafeWorkspaceSelection;
|
|
37
|
-
exports.getActiveSafeWorkspaceSelection = getActiveSafeWorkspaceSelection;
|
|
38
|
-
exports.ensureSafeRepoWorkspace = ensureSafeRepoWorkspace;
|
|
39
|
-
exports.resolveSafeRepoPath = resolveSafeRepoPath;
|
|
40
|
-
exports.resolveSafeShellExecution = resolveSafeShellExecution;
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
|
-
const path = __importStar(require("path"));
|
|
43
|
-
const child_process_1 = require("child_process");
|
|
44
|
-
const identity_1 = require("./identity");
|
|
45
|
-
const runtime_1 = require("../nerves/runtime");
|
|
46
|
-
let activeSelection = null;
|
|
47
|
-
let cleanupHookRegistered = false;
|
|
48
|
-
function workspaceSelectionStateFile(workspaceBase) {
|
|
49
|
-
return path.join(workspaceBase, ".active-safe-workspace.json");
|
|
50
|
-
}
|
|
51
|
-
function getOptionalFsFn(name) {
|
|
52
|
-
try {
|
|
53
|
-
return fs[name];
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function shouldPersistSelection(options) {
|
|
60
|
-
return options.persistSelection ?? options.workspaceRoot === undefined;
|
|
61
|
-
}
|
|
62
|
-
function isPersistedSelectionShape(value) {
|
|
63
|
-
if (!value || typeof value !== "object")
|
|
64
|
-
return false;
|
|
65
|
-
const candidate = value;
|
|
66
|
-
return (typeof candidate.runtimeKind === "string"
|
|
67
|
-
&& typeof candidate.repoRoot === "string"
|
|
68
|
-
&& typeof candidate.workspaceRoot === "string"
|
|
69
|
-
&& typeof candidate.workspaceBranch === "string"
|
|
70
|
-
&& (candidate.sourceBranch === null || typeof candidate.sourceBranch === "string")
|
|
71
|
-
&& typeof candidate.sourceCloneUrl === "string"
|
|
72
|
-
&& typeof candidate.cleanupAfterMerge === "boolean"
|
|
73
|
-
&& typeof candidate.created === "boolean"
|
|
74
|
-
&& typeof candidate.note === "string");
|
|
75
|
-
}
|
|
76
|
-
function loadPersistedSelection(workspaceBase, options) {
|
|
77
|
-
const existsSync = options.existsSync ?? fs.existsSync;
|
|
78
|
-
const readFileSync = options.readFileSync ?? getOptionalFsFn("readFileSync");
|
|
79
|
-
const unlinkSync = options.unlinkSync ?? getOptionalFsFn("unlinkSync");
|
|
80
|
-
const stateFile = workspaceSelectionStateFile(workspaceBase);
|
|
81
|
-
if (!existsSync(stateFile))
|
|
82
|
-
return null;
|
|
83
|
-
if (!readFileSync)
|
|
84
|
-
return null;
|
|
85
|
-
try {
|
|
86
|
-
const raw = readFileSync(stateFile, "utf-8");
|
|
87
|
-
const parsed = JSON.parse(raw);
|
|
88
|
-
if (!isPersistedSelectionShape(parsed) || !existsSync(parsed.workspaceRoot)) {
|
|
89
|
-
try {
|
|
90
|
-
unlinkSync?.(stateFile);
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
// best effort
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
return parsed;
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
try {
|
|
101
|
-
unlinkSync?.(stateFile);
|
|
102
|
-
}
|
|
103
|
-
catch {
|
|
104
|
-
// best effort
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function persistSelectionState(workspaceBase, selection, options) {
|
|
110
|
-
const mkdirSync = options.mkdirSync ?? fs.mkdirSync;
|
|
111
|
-
const writeFileSync = options.writeFileSync ?? getOptionalFsFn("writeFileSync");
|
|
112
|
-
if (!writeFileSync)
|
|
113
|
-
return;
|
|
114
|
-
mkdirSync(workspaceBase, { recursive: true });
|
|
115
|
-
writeFileSync(workspaceSelectionStateFile(workspaceBase), JSON.stringify(selection, null, 2), "utf-8");
|
|
116
|
-
}
|
|
117
|
-
function defaultNow() {
|
|
118
|
-
return Date.now();
|
|
119
|
-
}
|
|
120
|
-
function resolveAgentName(explicit) {
|
|
121
|
-
if (explicit && explicit.trim().length > 0)
|
|
122
|
-
return explicit.trim();
|
|
123
|
-
try {
|
|
124
|
-
return (0, identity_1.getAgentName)();
|
|
125
|
-
}
|
|
126
|
-
catch {
|
|
127
|
-
return "slugger";
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function runGit(cwd, args, spawnSync) {
|
|
131
|
-
return spawnSync("git", args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
132
|
-
}
|
|
133
|
-
function readStdout(result) {
|
|
134
|
-
return (result.stdout ?? Buffer.from("")).toString("utf-8").trim();
|
|
135
|
-
}
|
|
136
|
-
function readStderr(result) {
|
|
137
|
-
return (result.stderr ?? Buffer.from("")).toString("utf-8").trim();
|
|
138
|
-
}
|
|
139
|
-
function assertGitOk(result, action) {
|
|
140
|
-
if (result.error) {
|
|
141
|
-
throw result.error;
|
|
142
|
-
}
|
|
143
|
-
if (result.status !== 0) {
|
|
144
|
-
const detail = readStderr(result) || readStdout(result) || `exit ${result.status ?? "unknown"}`;
|
|
145
|
-
throw new Error(`${action} failed: ${detail}`);
|
|
146
|
-
}
|
|
147
|
-
return readStdout(result);
|
|
148
|
-
}
|
|
149
|
-
function isGitClone(repoRoot, spawnSync) {
|
|
150
|
-
const result = runGit(repoRoot, ["rev-parse", "--is-inside-work-tree"], spawnSync);
|
|
151
|
-
return result.status === 0 && readStdout(result) === "true";
|
|
152
|
-
}
|
|
153
|
-
function readCurrentBranch(repoRoot, spawnSync) {
|
|
154
|
-
return assertGitOk(runGit(repoRoot, ["rev-parse", "--abbrev-ref", "HEAD"], spawnSync), "git branch read");
|
|
155
|
-
}
|
|
156
|
-
function ensureFetchedOrigin(repoRoot, spawnSync) {
|
|
157
|
-
assertGitOk(runGit(repoRoot, ["fetch", "origin"], spawnSync), "git fetch origin");
|
|
158
|
-
}
|
|
159
|
-
function ensureMainFastForward(repoRoot, spawnSync) {
|
|
160
|
-
assertGitOk(runGit(repoRoot, ["pull", "--ff-only", "origin", "main"], spawnSync), "git pull --ff-only origin main");
|
|
161
|
-
}
|
|
162
|
-
function createDedicatedWorktree(repoRoot, workspaceRoot, branchSuffix, existsSync, mkdirSync, rmSync, spawnSync) {
|
|
163
|
-
mkdirSync(path.dirname(workspaceRoot), { recursive: true });
|
|
164
|
-
const branchName = `slugger/${branchSuffix}`;
|
|
165
|
-
if (existsSync(workspaceRoot)) {
|
|
166
|
-
rmSync(workspaceRoot, { recursive: true, force: true });
|
|
167
|
-
}
|
|
168
|
-
assertGitOk(runGit(repoRoot, ["worktree", "add", "-B", branchName, workspaceRoot, "origin/main"], spawnSync), "git worktree add");
|
|
169
|
-
return { workspaceRoot, created: true, branchName };
|
|
170
|
-
}
|
|
171
|
-
function createScratchClone(workspaceRoot, cloneUrl, existsSync, mkdirSync, rmSync, spawnSync) {
|
|
172
|
-
mkdirSync(path.dirname(workspaceRoot), { recursive: true });
|
|
173
|
-
if (existsSync(workspaceRoot)) {
|
|
174
|
-
rmSync(workspaceRoot, { recursive: true, force: true });
|
|
175
|
-
}
|
|
176
|
-
const result = spawnSync("git", ["clone", "--depth", "1", "--branch", "main", cloneUrl, workspaceRoot], {
|
|
177
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
178
|
-
});
|
|
179
|
-
assertGitOk(result, "git clone");
|
|
180
|
-
return { workspaceRoot, created: true, branchName: "main" };
|
|
181
|
-
}
|
|
182
|
-
const REPO_LOCAL_SHELL_COMMAND = /^(?:[A-Za-z_][A-Za-z0-9_]*=\S+\s+)*(git|npm|npx|node|pnpm|yarn|bun|rg|sed|cat|ls|find|grep|vitest|tsc|eslint)\b/;
|
|
183
|
-
function looksRepoLocalShellCommand(command) {
|
|
184
|
-
return REPO_LOCAL_SHELL_COMMAND.test(command.trim());
|
|
185
|
-
}
|
|
186
|
-
function registerCleanupHook(options) {
|
|
187
|
-
if (cleanupHookRegistered)
|
|
188
|
-
return;
|
|
189
|
-
cleanupHookRegistered = true;
|
|
190
|
-
process.on("exit", () => {
|
|
191
|
-
if (!activeSelection?.cleanupAfterMerge)
|
|
192
|
-
return;
|
|
193
|
-
try {
|
|
194
|
-
options.rmSync(activeSelection.workspaceRoot, { recursive: true, force: true });
|
|
195
|
-
}
|
|
196
|
-
catch {
|
|
197
|
-
// best effort
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
function resetSafeWorkspaceSelection(options = {}) {
|
|
202
|
-
activeSelection = null;
|
|
203
|
-
if (!options.keepCleanupHookRegistered) {
|
|
204
|
-
cleanupHookRegistered = false;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function getActiveSafeWorkspaceSelection() {
|
|
208
|
-
return activeSelection;
|
|
209
|
-
}
|
|
210
|
-
function refreshSelectionWorkspaceBranch(selection, spawnSync) {
|
|
211
|
-
try {
|
|
212
|
-
if (!isGitClone(selection.workspaceRoot, spawnSync)) {
|
|
213
|
-
return selection;
|
|
214
|
-
}
|
|
215
|
-
const liveBranch = readCurrentBranch(selection.workspaceRoot, spawnSync);
|
|
216
|
-
if (liveBranch === selection.workspaceBranch) {
|
|
217
|
-
return selection;
|
|
218
|
-
}
|
|
219
|
-
return { ...selection, workspaceBranch: liveBranch };
|
|
220
|
-
}
|
|
221
|
-
catch {
|
|
222
|
-
return selection;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function ensureSafeRepoWorkspace(options = {}) {
|
|
226
|
-
const agentName = resolveAgentName(options.agentName);
|
|
227
|
-
const workspaceBase = options.workspaceRoot ?? (0, identity_1.getAgentRepoWorkspacesRoot)(agentName);
|
|
228
|
-
const persistSelection = shouldPersistSelection(options);
|
|
229
|
-
const spawnSync = options.spawnSync ?? child_process_1.spawnSync;
|
|
230
|
-
const existsSync = options.existsSync ?? fs.existsSync;
|
|
231
|
-
const mkdirSync = options.mkdirSync ?? fs.mkdirSync;
|
|
232
|
-
const rmSync = options.rmSync ?? fs.rmSync;
|
|
233
|
-
if (activeSelection) {
|
|
234
|
-
const refreshed = refreshSelectionWorkspaceBranch(activeSelection, spawnSync);
|
|
235
|
-
activeSelection = refreshed;
|
|
236
|
-
return refreshed;
|
|
237
|
-
}
|
|
238
|
-
const repoRoot = options.repoRoot ?? (0, identity_1.getRepoRoot)();
|
|
239
|
-
const canonicalRepoUrl = options.canonicalRepoUrl ?? identity_1.HARNESS_CANONICAL_REPO_URL;
|
|
240
|
-
const now = options.now ?? defaultNow;
|
|
241
|
-
const stamp = String(now());
|
|
242
|
-
registerCleanupHook({ rmSync });
|
|
243
|
-
if (persistSelection) {
|
|
244
|
-
const restored = loadPersistedSelection(workspaceBase, options);
|
|
245
|
-
if (restored) {
|
|
246
|
-
const refreshed = refreshSelectionWorkspaceBranch(restored, spawnSync);
|
|
247
|
-
activeSelection = refreshed;
|
|
248
|
-
persistSelectionState(workspaceBase, refreshed, options);
|
|
249
|
-
(0, runtime_1.emitNervesEvent)({
|
|
250
|
-
component: "workspace",
|
|
251
|
-
event: "workspace.safe_repo_restored",
|
|
252
|
-
message: "restored safe repo workspace after runtime restart",
|
|
253
|
-
meta: {
|
|
254
|
-
runtimeKind: refreshed.runtimeKind,
|
|
255
|
-
repoRoot: refreshed.repoRoot,
|
|
256
|
-
workspaceRoot: refreshed.workspaceRoot,
|
|
257
|
-
workspaceBranch: refreshed.workspaceBranch,
|
|
258
|
-
sourceBranch: refreshed.sourceBranch,
|
|
259
|
-
cleanupAfterMerge: refreshed.cleanupAfterMerge,
|
|
260
|
-
},
|
|
261
|
-
});
|
|
262
|
-
return refreshed;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
let selection;
|
|
266
|
-
if (isGitClone(repoRoot, spawnSync)) {
|
|
267
|
-
const branch = readCurrentBranch(repoRoot, spawnSync);
|
|
268
|
-
ensureFetchedOrigin(repoRoot, spawnSync);
|
|
269
|
-
if (branch === "main") {
|
|
270
|
-
ensureMainFastForward(repoRoot, spawnSync);
|
|
271
|
-
const worktreeRoot = path.join(workspaceBase, `ouroboros-main-${stamp}`);
|
|
272
|
-
const created = createDedicatedWorktree(repoRoot, worktreeRoot, `safe-workspace-${stamp}`, existsSync, mkdirSync, rmSync, spawnSync);
|
|
273
|
-
selection = {
|
|
274
|
-
runtimeKind: "clone-main",
|
|
275
|
-
repoRoot,
|
|
276
|
-
workspaceRoot: created.workspaceRoot,
|
|
277
|
-
workspaceBranch: created.branchName,
|
|
278
|
-
sourceBranch: branch,
|
|
279
|
-
sourceCloneUrl: canonicalRepoUrl,
|
|
280
|
-
cleanupAfterMerge: false,
|
|
281
|
-
created: created.created,
|
|
282
|
-
note: `running from clone on main; fast-forwarded and created dedicated worktree ${created.workspaceRoot}`,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
const worktreeRoot = path.join(workspaceBase, `ouroboros-origin-main-${stamp}`);
|
|
287
|
-
const created = createDedicatedWorktree(repoRoot, worktreeRoot, `safe-workspace-${stamp}`, existsSync, mkdirSync, rmSync, spawnSync);
|
|
288
|
-
selection = {
|
|
289
|
-
runtimeKind: "clone-non-main",
|
|
290
|
-
repoRoot,
|
|
291
|
-
workspaceRoot: created.workspaceRoot,
|
|
292
|
-
workspaceBranch: created.branchName,
|
|
293
|
-
sourceBranch: branch,
|
|
294
|
-
sourceCloneUrl: canonicalRepoUrl,
|
|
295
|
-
cleanupAfterMerge: false,
|
|
296
|
-
created: created.created,
|
|
297
|
-
note: `running from branch ${branch}; defaulted new work from origin/main in dedicated worktree ${created.workspaceRoot}`,
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
const scratchRoot = path.join(workspaceBase, `ouroboros-scratch-${stamp}`);
|
|
303
|
-
const created = createScratchClone(scratchRoot, canonicalRepoUrl, existsSync, mkdirSync, rmSync, spawnSync);
|
|
304
|
-
selection = {
|
|
305
|
-
runtimeKind: "installed-runtime",
|
|
306
|
-
repoRoot,
|
|
307
|
-
workspaceRoot: created.workspaceRoot,
|
|
308
|
-
workspaceBranch: created.branchName,
|
|
309
|
-
sourceBranch: null,
|
|
310
|
-
sourceCloneUrl: canonicalRepoUrl,
|
|
311
|
-
cleanupAfterMerge: true,
|
|
312
|
-
created: created.created,
|
|
313
|
-
note: `running from installed runtime/wrapper; created scratch clone ${created.workspaceRoot} from ${canonicalRepoUrl}`,
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
activeSelection = selection;
|
|
317
|
-
if (persistSelection) {
|
|
318
|
-
persistSelectionState(workspaceBase, selection, options);
|
|
319
|
-
}
|
|
320
|
-
(0, runtime_1.emitNervesEvent)({
|
|
321
|
-
component: "workspace",
|
|
322
|
-
event: "workspace.safe_repo_acquired",
|
|
323
|
-
message: "acquired safe repo workspace before local edits",
|
|
324
|
-
meta: {
|
|
325
|
-
runtimeKind: selection.runtimeKind,
|
|
326
|
-
repoRoot: selection.repoRoot,
|
|
327
|
-
workspaceRoot: selection.workspaceRoot,
|
|
328
|
-
workspaceBranch: selection.workspaceBranch,
|
|
329
|
-
sourceBranch: selection.sourceBranch,
|
|
330
|
-
sourceCloneUrl: selection.sourceCloneUrl,
|
|
331
|
-
cleanupAfterMerge: selection.cleanupAfterMerge,
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
return selection;
|
|
335
|
-
}
|
|
336
|
-
function resolveSafeRepoPath(options) {
|
|
337
|
-
const rawRequestedPath = options.requestedPath;
|
|
338
|
-
const repoRoot = path.resolve(options.repoRoot ?? (0, identity_1.getRepoRoot)());
|
|
339
|
-
if (!path.isAbsolute(rawRequestedPath) && !rawRequestedPath.startsWith("~")) {
|
|
340
|
-
const selection = activeSelection ?? ensureSafeRepoWorkspace(options);
|
|
341
|
-
return {
|
|
342
|
-
selection,
|
|
343
|
-
resolvedPath: path.resolve(selection.workspaceRoot, rawRequestedPath),
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
const requestedPath = path.resolve(rawRequestedPath);
|
|
347
|
-
if (activeSelection && requestedPath.startsWith(activeSelection.workspaceRoot + path.sep)) {
|
|
348
|
-
return { selection: activeSelection, resolvedPath: requestedPath };
|
|
349
|
-
}
|
|
350
|
-
if (requestedPath !== repoRoot && !requestedPath.startsWith(repoRoot + path.sep)) {
|
|
351
|
-
return { selection: activeSelection, resolvedPath: requestedPath };
|
|
352
|
-
}
|
|
353
|
-
const selection = ensureSafeRepoWorkspace(options);
|
|
354
|
-
const relativePath = requestedPath === repoRoot ? "" : path.relative(repoRoot, requestedPath);
|
|
355
|
-
const resolvedPath = relativePath ? path.join(selection.workspaceRoot, relativePath) : selection.workspaceRoot;
|
|
356
|
-
return { selection, resolvedPath };
|
|
357
|
-
}
|
|
358
|
-
function resolveSafeShellExecution(command, options = {}) {
|
|
359
|
-
const trimmed = command.trim();
|
|
360
|
-
if (!trimmed) {
|
|
361
|
-
return { selection: activeSelection, command };
|
|
362
|
-
}
|
|
363
|
-
if (activeSelection && command.includes(activeSelection.workspaceRoot)) {
|
|
364
|
-
return { selection: activeSelection, command, cwd: activeSelection.workspaceRoot };
|
|
365
|
-
}
|
|
366
|
-
const repoRoot = path.resolve(options.repoRoot ?? (0, identity_1.getRepoRoot)());
|
|
367
|
-
const mentionsRepoRoot = command.includes(repoRoot);
|
|
368
|
-
const shouldRoute = mentionsRepoRoot || looksRepoLocalShellCommand(trimmed);
|
|
369
|
-
if (!shouldRoute) {
|
|
370
|
-
return { selection: activeSelection, command };
|
|
371
|
-
}
|
|
372
|
-
const selection = ensureSafeRepoWorkspace(options);
|
|
373
|
-
const rewrittenCommand = mentionsRepoRoot
|
|
374
|
-
? command.split(repoRoot).join(selection.workspaceRoot)
|
|
375
|
-
: command;
|
|
376
|
-
return {
|
|
377
|
-
selection,
|
|
378
|
-
command: rewrittenCommand,
|
|
379
|
-
cwd: selection.workspaceRoot,
|
|
380
|
-
};
|
|
381
|
-
}
|