@staff0rd/assist 0.1117.1 → 0.1118.1
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/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.1118.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -5566,6 +5566,9 @@ function spawnClaude2(prompt, options2 = {}) {
|
|
|
5566
5566
|
if (permissionMode) {
|
|
5567
5567
|
args.push("--permission-mode", permissionMode);
|
|
5568
5568
|
}
|
|
5569
|
+
if (options2.model && !options2.resumeSessionId) {
|
|
5570
|
+
args.push("--model", options2.model);
|
|
5571
|
+
}
|
|
5569
5572
|
return spawnInherit("claude", args);
|
|
5570
5573
|
}
|
|
5571
5574
|
function buildArgs2(prompt, options2) {
|
|
@@ -7055,13 +7058,15 @@ var claudeAdapter = {
|
|
|
7055
7058
|
reader: claudeConversationReader
|
|
7056
7059
|
},
|
|
7057
7060
|
toolOperations: claudeToolOperations,
|
|
7058
|
-
launchSkill: (skill, args, { conversationId, allowEdits }) => spawnClaude2(buildSlashCommand(skill, args), {
|
|
7061
|
+
launchSkill: (skill, args, { conversationId, allowEdits, model }) => spawnClaude2(buildSlashCommand(skill, args), {
|
|
7059
7062
|
allowEdits: allowEdits ?? true,
|
|
7060
|
-
sessionId: conversationId
|
|
7063
|
+
sessionId: conversationId,
|
|
7064
|
+
model
|
|
7061
7065
|
}),
|
|
7062
|
-
launchPrompt: (prompt, { conversationId, allowEdits }) => spawnClaude2(prompt, {
|
|
7066
|
+
launchPrompt: (prompt, { conversationId, allowEdits, model }) => spawnClaude2(prompt, {
|
|
7063
7067
|
allowEdits: allowEdits ?? true,
|
|
7064
|
-
sessionId: conversationId
|
|
7068
|
+
sessionId: conversationId,
|
|
7069
|
+
model
|
|
7065
7070
|
}),
|
|
7066
7071
|
resume: (conversationId, nudge, { allowEdits }) => spawnClaude2(nudge, {
|
|
7067
7072
|
allowEdits: allowEdits ?? true,
|
|
@@ -7912,7 +7917,7 @@ function spawnCodex2(prompt, options2 = {}) {
|
|
|
7912
7917
|
options2.skill && `$${options2.skill}`,
|
|
7913
7918
|
prompt && neutralizeCodexSkillMentions(prompt)
|
|
7914
7919
|
].filter(Boolean).join(" ");
|
|
7915
|
-
const override = buildHarnessCodexArgs();
|
|
7920
|
+
const override = options2.model && !options2.resumeSessionId ? { args: ["-m", options2.model], env: {} } : buildHarnessCodexArgs();
|
|
7916
7921
|
return spawnInherit(
|
|
7917
7922
|
harnesses.codex.command,
|
|
7918
7923
|
[
|
|
@@ -8197,8 +8202,13 @@ var codexAdapter = {
|
|
|
8197
8202
|
},
|
|
8198
8203
|
toolOperations: codexToolOperations,
|
|
8199
8204
|
permissionRules: readCodexRulePerms,
|
|
8200
|
-
launchSkill: (skill, args, { cwd, allowEdits }) => spawnCodex2(args ?? "", {
|
|
8201
|
-
|
|
8205
|
+
launchSkill: (skill, args, { cwd, allowEdits, model }) => spawnCodex2(args ?? "", {
|
|
8206
|
+
cwd,
|
|
8207
|
+
sandbox: sandbox(allowEdits),
|
|
8208
|
+
skill,
|
|
8209
|
+
model
|
|
8210
|
+
}),
|
|
8211
|
+
launchPrompt: (prompt, { cwd, allowEdits, model }) => spawnCodex2(prompt, { cwd, sandbox: sandbox(allowEdits), model }),
|
|
8202
8212
|
resume: (conversationId, nudge, { cwd, allowEdits }) => spawnCodex2(nudge, {
|
|
8203
8213
|
cwd,
|
|
8204
8214
|
sandbox: sandbox(allowEdits),
|
|
@@ -8240,10 +8250,15 @@ function spawnPi(opts = {}) {
|
|
|
8240
8250
|
// src/shared/spawnPi.ts
|
|
8241
8251
|
function spawnPi2(prompt, options2 = {}) {
|
|
8242
8252
|
const cwd = options2.cwd ?? process.cwd();
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8253
|
+
const model = options2.model ? ["--model", options2.model] : [];
|
|
8254
|
+
return spawnInherit(
|
|
8255
|
+
harnesses.pi.command,
|
|
8256
|
+
[...piTerminalArgs, ...model, prompt],
|
|
8257
|
+
{
|
|
8258
|
+
cwd,
|
|
8259
|
+
env: { ASSIST_HARNESS: "pi" }
|
|
8260
|
+
}
|
|
8261
|
+
);
|
|
8247
8262
|
}
|
|
8248
8263
|
|
|
8249
8264
|
// src/shared/harnessAdapters/piToolOperations.ts
|
|
@@ -8310,8 +8325,8 @@ var piAdapter = {
|
|
|
8310
8325
|
relocate: cannotResume
|
|
8311
8326
|
},
|
|
8312
8327
|
toolOperations: piToolOperations,
|
|
8313
|
-
launchSkill: (skill, args, { cwd }) => spawnPi2(buildSlashCommand(skill, args), { cwd }),
|
|
8314
|
-
launchPrompt: (prompt, { cwd }) => spawnPi2(prompt, { cwd }),
|
|
8328
|
+
launchSkill: (skill, args, { cwd, model }) => spawnPi2(buildSlashCommand(skill, args), { cwd, model }),
|
|
8329
|
+
launchPrompt: (prompt, { cwd, model }) => spawnPi2(prompt, { cwd, model }),
|
|
8315
8330
|
resume: cannotResume,
|
|
8316
8331
|
interactive: ({ sessionId: sessionId2, resumeId, prompt, cwd, model }) => resumeId ? cannotResume() : spawnPi({ prompt, cwd, sessionId: sessionId2, model }),
|
|
8317
8332
|
oneShot: noOneShot,
|
|
@@ -8790,15 +8805,54 @@ async function docsFeedback(req, res) {
|
|
|
8790
8805
|
// src/commands/sessions/web/fileContent.ts
|
|
8791
8806
|
import { readFile, stat } from "fs/promises";
|
|
8792
8807
|
|
|
8808
|
+
// src/commands/sessions/web/fileContent/respondCommitFile.ts
|
|
8809
|
+
import { relative, sep } from "path";
|
|
8810
|
+
var MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
8811
|
+
async function commitBlob(cwd, sha, path118) {
|
|
8812
|
+
const line = await execGit(cwd, ["ls-tree", "-l", sha, "--", path118]);
|
|
8813
|
+
const match = /^\d+ blob ([0-9a-f]+)\s+(\d+)\t/.exec(line);
|
|
8814
|
+
if (!match) return void 0;
|
|
8815
|
+
return { hash: match[1], size: Number(match[2]) };
|
|
8816
|
+
}
|
|
8817
|
+
async function respondCommitFile(req, res, { cwd, target }, commit2) {
|
|
8818
|
+
try {
|
|
8819
|
+
const scope = await resolveDiffScope(
|
|
8820
|
+
cwd,
|
|
8821
|
+
getConversationParam(req),
|
|
8822
|
+
commit2
|
|
8823
|
+
);
|
|
8824
|
+
if (scope?.kind !== "commit") {
|
|
8825
|
+
respondJson(res, 400, { error: "Invalid commit" });
|
|
8826
|
+
return;
|
|
8827
|
+
}
|
|
8828
|
+
const path118 = relative(cwd, target).split(sep).join("/");
|
|
8829
|
+
const blob = await commitBlob(cwd, scope.sha, path118);
|
|
8830
|
+
if (!blob) {
|
|
8831
|
+
respondJson(res, 404, { error: "File not found" });
|
|
8832
|
+
return;
|
|
8833
|
+
}
|
|
8834
|
+
if (blob.size > MAX_FILE_BYTES) {
|
|
8835
|
+
respondJson(res, 413, { error: "File too large" });
|
|
8836
|
+
return;
|
|
8837
|
+
}
|
|
8838
|
+
const content = await execGit(cwd, ["cat-file", "blob", blob.hash], {
|
|
8839
|
+
maxBuffer: MAX_FILE_BYTES + 1
|
|
8840
|
+
});
|
|
8841
|
+
respondJson(res, 200, { content, mtimeMs: 0 });
|
|
8842
|
+
} catch {
|
|
8843
|
+
respondJson(res, 404, { error: "File not found" });
|
|
8844
|
+
}
|
|
8845
|
+
}
|
|
8846
|
+
|
|
8793
8847
|
// src/commands/sessions/web/resolveWithinCwd.ts
|
|
8794
|
-
import { isAbsolute as isAbsolute2, relative, resolve as resolve4 } from "path";
|
|
8848
|
+
import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve4 } from "path";
|
|
8795
8849
|
function repoRoot2(cwd) {
|
|
8796
8850
|
return resolve4(cwd);
|
|
8797
8851
|
}
|
|
8798
8852
|
function resolveWithinCwd(cwd, path118) {
|
|
8799
8853
|
const root2 = repoRoot2(cwd);
|
|
8800
8854
|
const target = resolve4(root2, path118);
|
|
8801
|
-
const rel =
|
|
8855
|
+
const rel = relative2(root2, target);
|
|
8802
8856
|
if (rel === "" || rel.startsWith("..") || isAbsolute2(rel)) return null;
|
|
8803
8857
|
return target;
|
|
8804
8858
|
}
|
|
@@ -8823,10 +8877,16 @@ function getFileTarget(req, res) {
|
|
|
8823
8877
|
}
|
|
8824
8878
|
|
|
8825
8879
|
// src/commands/sessions/web/fileContent.ts
|
|
8826
|
-
var MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
8827
8880
|
async function fileContent(req, res) {
|
|
8828
8881
|
const resolved = getFileTarget(req, res);
|
|
8829
8882
|
if (!resolved) return;
|
|
8883
|
+
const commit2 = new URL(req.url ?? "/", "http://localhost").searchParams.get(
|
|
8884
|
+
"commit"
|
|
8885
|
+
);
|
|
8886
|
+
if (commit2) {
|
|
8887
|
+
await respondCommitFile(req, res, resolved, commit2);
|
|
8888
|
+
return;
|
|
8889
|
+
}
|
|
8830
8890
|
try {
|
|
8831
8891
|
const info = await stat(resolved.target);
|
|
8832
8892
|
if (!info.isFile()) {
|
|
@@ -10886,7 +10946,7 @@ function getHtml() {
|
|
|
10886
10946
|
}
|
|
10887
10947
|
|
|
10888
10948
|
// src/shared/resolveRunConfigs.ts
|
|
10889
|
-
import { dirname as dirname10, relative as
|
|
10949
|
+
import { dirname as dirname10, relative as relative3, resolve as resolve7 } from "path";
|
|
10890
10950
|
|
|
10891
10951
|
// src/shared/assertNoDuplicateRunNames.ts
|
|
10892
10952
|
function findDuplicateNames(configs) {
|
|
@@ -10945,7 +11005,7 @@ function setDefaultCwd(configs, defaultCwd) {
|
|
|
10945
11005
|
return configs.map((c) => c.cwd ? c : { ...c, cwd: defaultCwd });
|
|
10946
11006
|
}
|
|
10947
11007
|
function relativeToRoot(ctx, absolute2) {
|
|
10948
|
-
return
|
|
11008
|
+
return relative3(ctx.rootConfigDir, absolute2);
|
|
10949
11009
|
}
|
|
10950
11010
|
function loadAndResolveLink(linkPath, configDir, ctx) {
|
|
10951
11011
|
const configPath = findLinkedConfigPath(linkPath, configDir);
|
|
@@ -12378,6 +12438,7 @@ function harnessCapabilities(req, res) {
|
|
|
12378
12438
|
exposeCodexActions: detected.codex,
|
|
12379
12439
|
exposePiActions: detected.pi,
|
|
12380
12440
|
engine: config.engine,
|
|
12441
|
+
runHarness: config.defaults?.run?.harness ?? config.engine,
|
|
12381
12442
|
features
|
|
12382
12443
|
});
|
|
12383
12444
|
}
|
|
@@ -14192,10 +14253,10 @@ import { createReadStream as createReadStream2 } from "fs";
|
|
|
14192
14253
|
import { stat as stat2 } from "fs/promises";
|
|
14193
14254
|
|
|
14194
14255
|
// src/shared/isStagedAttachmentPath.ts
|
|
14195
|
-
import { isAbsolute as isAbsolute3, relative as
|
|
14256
|
+
import { isAbsolute as isAbsolute3, relative as relative4, resolve as resolve9, sep as sep2 } from "path";
|
|
14196
14257
|
function isStagedAttachmentPath(path118) {
|
|
14197
|
-
const rel =
|
|
14198
|
-
return rel !== "" && rel !== ".." && !rel.startsWith(`..${
|
|
14258
|
+
const rel = relative4(stagedAttachmentsDir, resolve9(path118));
|
|
14259
|
+
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep2}`) && !isAbsolute3(rel);
|
|
14199
14260
|
}
|
|
14200
14261
|
|
|
14201
14262
|
// src/commands/sessions/web/attachmentContentType.ts
|
|
@@ -14965,7 +15026,7 @@ async function performRestart(target, deps2 = {}) {
|
|
|
14965
15026
|
}
|
|
14966
15027
|
|
|
14967
15028
|
// src/commands/sessions/web/revertDiffFile.ts
|
|
14968
|
-
import { relative as
|
|
15029
|
+
import { relative as relative5 } from "path";
|
|
14969
15030
|
|
|
14970
15031
|
// src/commands/sessions/web/revertPathChanges.ts
|
|
14971
15032
|
function git(cwd, args) {
|
|
@@ -15032,7 +15093,7 @@ async function revertPathChanges(cwd, path118) {
|
|
|
15032
15093
|
async function revertDiffFile(req, res) {
|
|
15033
15094
|
const resolved = getFileTarget(req, res);
|
|
15034
15095
|
if (!resolved) return;
|
|
15035
|
-
const path118 =
|
|
15096
|
+
const path118 = relative5(repoRoot2(resolved.cwd), resolved.target);
|
|
15036
15097
|
try {
|
|
15037
15098
|
await revertPathChanges(resolved.cwd, path118);
|
|
15038
15099
|
respondJson(res, 200, { reverted: path118 });
|
|
@@ -15143,7 +15204,7 @@ async function selfUpdate(req, res, deps2 = {}) {
|
|
|
15143
15204
|
}
|
|
15144
15205
|
|
|
15145
15206
|
// src/commands/sessions/web/revertDiffPaths.ts
|
|
15146
|
-
import { relative as
|
|
15207
|
+
import { relative as relative6 } from "path";
|
|
15147
15208
|
function requestedPaths(body) {
|
|
15148
15209
|
const paths = body.paths;
|
|
15149
15210
|
if (!Array.isArray(paths)) return null;
|
|
@@ -15173,7 +15234,7 @@ async function revertDiffPaths(req, res) {
|
|
|
15173
15234
|
failed3.push({ path: path118, error: "Path outside cwd" });
|
|
15174
15235
|
continue;
|
|
15175
15236
|
}
|
|
15176
|
-
const relativePath =
|
|
15237
|
+
const relativePath = relative6(root2, target);
|
|
15177
15238
|
try {
|
|
15178
15239
|
await revertPathChanges(cwd, relativePath);
|
|
15179
15240
|
reverted.push(relativePath);
|
|
@@ -23993,11 +24054,12 @@ function stopWatching() {
|
|
|
23993
24054
|
async function launchPhaseClaude(prompt, spawnOptions, context, harness) {
|
|
23994
24055
|
const adapter = harnessAdapter(harness);
|
|
23995
24056
|
const cwd = process.cwd();
|
|
23996
|
-
const { allowEdits, resumeSessionId, sessionId: sessionId2 } = spawnOptions;
|
|
24057
|
+
const { allowEdits, resumeSessionId, sessionId: sessionId2, model } = spawnOptions;
|
|
23997
24058
|
const { child: child2, done: done2 } = resumeSessionId ? adapter.resume(resumeSessionId, prompt, { cwd, allowEdits }) : adapter.launchPrompt(prompt, {
|
|
23998
24059
|
cwd,
|
|
23999
24060
|
allowEdits,
|
|
24000
|
-
conversationId: sessionId2
|
|
24061
|
+
conversationId: sessionId2,
|
|
24062
|
+
model
|
|
24001
24063
|
});
|
|
24002
24064
|
watchForMarker(child2);
|
|
24003
24065
|
const exitCode = await awaitHarness(done2, context, adapter.label);
|
|
@@ -24758,7 +24820,8 @@ function spawnLaunch(adapter, slashCommand, request) {
|
|
|
24758
24820
|
const args = [...inline, request.description?.trim()].filter(Boolean).join(" ");
|
|
24759
24821
|
return adapter.launchSkill(skill, args || void 0, {
|
|
24760
24822
|
conversationId,
|
|
24761
|
-
cwd
|
|
24823
|
+
cwd,
|
|
24824
|
+
model: request.model
|
|
24762
24825
|
});
|
|
24763
24826
|
}
|
|
24764
24827
|
|
|
@@ -24904,20 +24967,33 @@ function registerRewindCommand(cmd) {
|
|
|
24904
24967
|
cmd.command("rewind <id> <phase>").description("Rewind a backlog item to an earlier phase").requiredOption("--reason <reason>", "Reason for rewinding").action(rewindPhase);
|
|
24905
24968
|
}
|
|
24906
24969
|
|
|
24970
|
+
// src/commands/backlog/resolveModel.ts
|
|
24971
|
+
function resolveModel(value, type, harness) {
|
|
24972
|
+
if (value === false) return void 0;
|
|
24973
|
+
if (value) return value;
|
|
24974
|
+
if (resolveHarness2(void 0, type) !== harness) return void 0;
|
|
24975
|
+
return loadConfig().harness.defaults?.[type]?.model;
|
|
24976
|
+
}
|
|
24977
|
+
|
|
24907
24978
|
// src/commands/backlog/registerRunCommand.ts
|
|
24908
24979
|
function registerRunCommand(cmd) {
|
|
24909
24980
|
const command = cmd.command("run <id>").description("Run a backlog item's plan phase-by-phase").option("-w, --write", "Run the harness with write access (default)").option("--no-write", "Run the harness without write access").option(
|
|
24910
24981
|
"--harness <harness>",
|
|
24911
24982
|
"Coding harness to launch (claude|codex|pi); defaults to the configured harness.defaults.run.harness, then harness.engine"
|
|
24912
24983
|
).option(
|
|
24984
|
+
"--model <model>",
|
|
24985
|
+
"Model to launch the harness with; defaults to harness.defaults.run.model while the run type's harness is used"
|
|
24986
|
+
).option("--no-model", "Launch with the harness's own default model").option(
|
|
24913
24987
|
"--resume-session <id>",
|
|
24914
24988
|
"Resume an interrupted Claude session for the current phase (used by the sessions daemon on restart)"
|
|
24915
24989
|
).action(
|
|
24916
24990
|
async (id, opts) => {
|
|
24917
24991
|
if (!opts.resumeSession) await pullIfConfigured();
|
|
24992
|
+
const harness = resolveHarness2(opts.harness, "run");
|
|
24918
24993
|
await run3(id, {
|
|
24919
24994
|
allowEdits: opts.write !== false,
|
|
24920
|
-
harness
|
|
24995
|
+
harness,
|
|
24996
|
+
model: resolveModel(opts.model, "run", harness),
|
|
24921
24997
|
resumeSessionId: opts.resumeSession
|
|
24922
24998
|
});
|
|
24923
24999
|
}
|
|
@@ -26812,7 +26888,7 @@ function findTruncatedReadDenyRaw(rawCommand) {
|
|
|
26812
26888
|
}
|
|
26813
26889
|
|
|
26814
26890
|
// src/shared/isApprovedRead.ts
|
|
26815
|
-
import { resolve as resolve19, sep as
|
|
26891
|
+
import { resolve as resolve19, sep as sep3 } from "path";
|
|
26816
26892
|
|
|
26817
26893
|
// src/shared/appliesFixStructure.ts
|
|
26818
26894
|
var APPLY_RE = /^assist\s+github\s+issue\s+fix-structure\b.*\s--apply\b/;
|
|
@@ -27093,7 +27169,7 @@ function isCdToReadAllowedDir(command) {
|
|
|
27093
27169
|
const base = globBaseDir(m[1]);
|
|
27094
27170
|
if (!base) continue;
|
|
27095
27171
|
const resolved = resolve19(normalizeMsysPath(base));
|
|
27096
|
-
if (target === resolved || target.startsWith(resolved +
|
|
27172
|
+
if (target === resolved || target.startsWith(resolved + sep3)) {
|
|
27097
27173
|
return `cd to Read-allowed directory: ${entry}`;
|
|
27098
27174
|
}
|
|
27099
27175
|
}
|
|
@@ -27216,7 +27292,7 @@ ${questionsJson}`
|
|
|
27216
27292
|
}
|
|
27217
27293
|
|
|
27218
27294
|
// src/commands/backlog/isDocsPath.ts
|
|
27219
|
-
import { relative as
|
|
27295
|
+
import { relative as relative7, resolve as resolve20 } from "path";
|
|
27220
27296
|
var LOCKED_DOCS_DIRS = ["docs/src/content/docs/", "docs/public/screenshots/"];
|
|
27221
27297
|
var DOCS_LOCK_REASON = `Docs pages and screenshots (${LOCKED_DOCS_DIRS.join(", ")}) are locked during development: they are updated by the Refresh docs backlog item after stories ship, not during development. Leave them untouched and carry on with the phase. If this phase genuinely needs to change docs (e.g. the item is about the docs site itself), first confirm that with the user, then run \`assist docs unlock\` and wait for the user to confirm the PIN with \`assist docs confirm <pin>\` before retrying. The unlock applies to the current phase only.`;
|
|
27222
27298
|
var SEP = String.raw`[/\\]`;
|
|
@@ -27232,7 +27308,7 @@ function isLockedDocsRelativePath(rel) {
|
|
|
27232
27308
|
return LOCKED_DOCS_DIRS.some((dir) => normalized.startsWith(dir));
|
|
27233
27309
|
}
|
|
27234
27310
|
function isDocsPath(filePath, root2 = getProjectRoot()) {
|
|
27235
|
-
return isLockedDocsRelativePath(
|
|
27311
|
+
return isLockedDocsRelativePath(relative7(root2, resolve20(root2, filePath)));
|
|
27236
27312
|
}
|
|
27237
27313
|
function mentionsDocsPath(command, root2 = getProjectRoot()) {
|
|
27238
27314
|
if (RELATIVE_DOCS.test(command)) return true;
|
|
@@ -27256,7 +27332,7 @@ function findDocsPathDeny(toolName, rawCommand, root2) {
|
|
|
27256
27332
|
|
|
27257
27333
|
// src/commands/schema/isSchemaPath.ts
|
|
27258
27334
|
import { readFileSync as readFileSync39 } from "fs";
|
|
27259
|
-
import { relative as
|
|
27335
|
+
import { relative as relative8, resolve as resolve21 } from "path";
|
|
27260
27336
|
var SCHEMA_LOCK_REASON = "Database schema files (src/shared/db/migrations/migrationNNNN*.ts, src/shared/db/migrations.ts, src/shared/db/schema.ts and any src/shared/db/*.ts that defines a pgTable) are locked: a schema change needs the user's sign-off (see src/shared/db/CLAUDE.md). Confirm the schema change with the user first, then run `assist schema unlock` to request a PIN and wait for the user to confirm it with `assist schema confirm <pin>` before retrying. In a backlog item session the unlock lasts for the current phase on this harness; otherwise it lasts for this conversation only.";
|
|
27261
27337
|
var FIXED_SCHEMA_PATH = /^src\/shared\/db\/(?:migrations\/migration\d{4}[^/]*\.ts|migrations\.ts|schema\.ts)$/;
|
|
27262
27338
|
var DB_MODULE = /^src\/shared\/db\/[^/]+\.ts$/;
|
|
@@ -27277,7 +27353,7 @@ function isSchemaRelativePath(rel, root2, incomingContents3 = []) {
|
|
|
27277
27353
|
}
|
|
27278
27354
|
function isSchemaPath(filePath, incomingContents3 = [], root2 = getProjectRoot()) {
|
|
27279
27355
|
return isSchemaRelativePath(
|
|
27280
|
-
|
|
27356
|
+
relative8(root2, resolve21(root2, filePath)),
|
|
27281
27357
|
root2,
|
|
27282
27358
|
incomingContents3
|
|
27283
27359
|
);
|
|
@@ -36994,9 +37070,9 @@ import { dirname as dirname40, join as join89 } from "path";
|
|
|
36994
37070
|
import { resolve as resolve22 } from "path";
|
|
36995
37071
|
|
|
36996
37072
|
// src/commands/sessions/daemon/worktree/enclosingPaths.ts
|
|
36997
|
-
import { isAbsolute as isAbsolute4, relative as
|
|
37073
|
+
import { isAbsolute as isAbsolute4, relative as relative9 } from "path";
|
|
36998
37074
|
function isWithin(dir, parent) {
|
|
36999
|
-
const rel =
|
|
37075
|
+
const rel = relative9(parent, dir);
|
|
37000
37076
|
return rel === "" || !rel.startsWith("..") && !isAbsolute4(rel);
|
|
37001
37077
|
}
|
|
37002
37078
|
function enclosingPaths(dirs) {
|
|
@@ -37601,15 +37677,20 @@ function registerDescriptionLaunch(program, name2, slashCommand, description, fe
|
|
|
37601
37677
|
const command = program.command(name2).argument(
|
|
37602
37678
|
"[description]",
|
|
37603
37679
|
`Text to forward to the /${slashCommand} slash command`
|
|
37604
|
-
).description(description).option("--once", "Exit when the initial task completes").option("--resume-session <id>", resumeFlag).option("--harness <kind>", harnessFlag(feature)).
|
|
37605
|
-
|
|
37680
|
+
).description(description).option("--once", "Exit when the initial task completes").option("--resume-session <id>", resumeFlag).option("--harness <kind>", harnessFlag(feature)).option(
|
|
37681
|
+
"--model <model>",
|
|
37682
|
+
`Model to launch the harness with; defaults to harness.defaults.${name2}.model while the ${name2} type's harness is used`
|
|
37683
|
+
).option("--no-model", "Launch with the harness's own default model").action((text19, opts) => {
|
|
37684
|
+
const harness = resolveHarness2(opts.harness, name2);
|
|
37685
|
+
return launchMode(slashCommand, {
|
|
37606
37686
|
once: opts.once,
|
|
37607
37687
|
description: text19,
|
|
37608
37688
|
resumeSessionId: opts.resumeSession,
|
|
37609
|
-
harness
|
|
37689
|
+
harness,
|
|
37690
|
+
model: resolveModel(opts.model, name2, harness),
|
|
37610
37691
|
feature
|
|
37611
|
-
})
|
|
37612
|
-
);
|
|
37692
|
+
});
|
|
37693
|
+
});
|
|
37613
37694
|
configHelp(command, [...harnessConfigHelp, ...harnessDefaultsConfigHelp]);
|
|
37614
37695
|
if (alias) command.alias(alias);
|
|
37615
37696
|
}
|
|
@@ -37914,7 +37995,7 @@ function emitExtract(out, header, texts) {
|
|
|
37914
37995
|
}
|
|
37915
37996
|
|
|
37916
37997
|
// src/commands/miro/resolveExtractPath.ts
|
|
37917
|
-
import { isAbsolute as isAbsolute5, relative as
|
|
37998
|
+
import { isAbsolute as isAbsolute5, relative as relative10, resolve as resolve25 } from "path";
|
|
37918
37999
|
function extractRoot(cwd) {
|
|
37919
38000
|
return findConfigUp(cwd)?.rootDir ?? cwd;
|
|
37920
38001
|
}
|
|
@@ -37925,7 +38006,7 @@ function resolveExtractPath(value, cwd) {
|
|
|
37925
38006
|
function storedExtractPath(value, cwd) {
|
|
37926
38007
|
if (value === void 0) return void 0;
|
|
37927
38008
|
const absolute2 = resolve25(cwd, value);
|
|
37928
|
-
const within2 =
|
|
38009
|
+
const within2 = relative10(extractRoot(cwd), absolute2);
|
|
37929
38010
|
return within2.startsWith("..") ? absolute2 : within2;
|
|
37930
38011
|
}
|
|
37931
38012
|
|
|
@@ -49812,10 +49893,10 @@ function referencePatterns(path118, { home, cwd }) {
|
|
|
49812
49893
|
const underHome = within(file, normalise(home));
|
|
49813
49894
|
if (underHome) forms.push(`~/${escapeRegExp2(underHome)}`);
|
|
49814
49895
|
const patterns = forms.map((form) => new RegExp(`${form}${NOT_AFTER}`));
|
|
49815
|
-
const
|
|
49816
|
-
if (
|
|
49896
|
+
const relative12 = within(file, normalise(cwd));
|
|
49897
|
+
if (relative12)
|
|
49817
49898
|
patterns.push(
|
|
49818
|
-
new RegExp(`${NOT_BEFORE_RELATIVE}${escapeRegExp2(
|
|
49899
|
+
new RegExp(`${NOT_BEFORE_RELATIVE}${escapeRegExp2(relative12)}${NOT_AFTER}`)
|
|
49819
49900
|
);
|
|
49820
49901
|
return patterns;
|
|
49821
49902
|
}
|
|
@@ -50374,11 +50455,11 @@ function markdownNames(dir) {
|
|
|
50374
50455
|
import * as os5 from "os";
|
|
50375
50456
|
import * as path103 from "path";
|
|
50376
50457
|
function homePath(harness, dest) {
|
|
50377
|
-
const
|
|
50458
|
+
const relative12 = path103.relative(
|
|
50378
50459
|
os5.homedir(),
|
|
50379
50460
|
path103.join(harness.homeDir, dest)
|
|
50380
50461
|
);
|
|
50381
|
-
return `~/${
|
|
50462
|
+
return `~/${relative12.split(path103.sep).join("/")}`;
|
|
50382
50463
|
}
|
|
50383
50464
|
function renderHarnessPaths(content, harness) {
|
|
50384
50465
|
const { sync: sync2 } = harness;
|
|
@@ -56142,7 +56223,7 @@ function closeGateApplies(sessions, session) {
|
|
|
56142
56223
|
|
|
56143
56224
|
// src/commands/sessions/daemon/worktree/liveProcessesInTree.ts
|
|
56144
56225
|
import { readdirSync as readdirSync30, readlinkSync } from "fs";
|
|
56145
|
-
import { sep as
|
|
56226
|
+
import { sep as sep6 } from "path";
|
|
56146
56227
|
|
|
56147
56228
|
// src/commands/sessions/daemon/worktree/readProc.ts
|
|
56148
56229
|
import { readFileSync as readFileSync85 } from "fs";
|
|
@@ -56173,7 +56254,7 @@ function liveProcessesInTree(treePath, procRoot = "/proc") {
|
|
|
56173
56254
|
const pid = Number(entry);
|
|
56174
56255
|
if (!Number.isInteger(pid) || pid === process.pid) continue;
|
|
56175
56256
|
const cwd = processCwd(`${procRoot}/${entry}/cwd`);
|
|
56176
|
-
if (cwd && (cwd === treePath || cwd.startsWith(treePath +
|
|
56257
|
+
if (cwd && (cwd === treePath || cwd.startsWith(treePath + sep6)) && !isCodexAppServer(pid, procRoot))
|
|
56177
56258
|
pids.push(pid);
|
|
56178
56259
|
}
|
|
56179
56260
|
return pids;
|
|
@@ -58742,7 +58823,7 @@ function deferralNotice(persisted, cap2) {
|
|
|
58742
58823
|
// src/commands/sessions/daemon/worktree/underTempRoot.ts
|
|
58743
58824
|
import { realpathSync as realpathSync4 } from "fs";
|
|
58744
58825
|
import { tmpdir as tmpdir9 } from "os";
|
|
58745
|
-
import { sep as
|
|
58826
|
+
import { sep as sep7 } from "path";
|
|
58746
58827
|
function tempRoots() {
|
|
58747
58828
|
const raw = tmpdir9();
|
|
58748
58829
|
const roots = /* @__PURE__ */ new Set([raw]);
|
|
@@ -58755,7 +58836,7 @@ function tempRoots() {
|
|
|
58755
58836
|
}
|
|
58756
58837
|
function underTempRoot(path118) {
|
|
58757
58838
|
return tempRoots().some(
|
|
58758
|
-
(root2) => path118.startsWith(root2.endsWith(
|
|
58839
|
+
(root2) => path118.startsWith(root2.endsWith(sep7) ? root2 : root2 + sep7)
|
|
58759
58840
|
);
|
|
58760
58841
|
}
|
|
58761
58842
|
|