heyio 4.1.4 → 4.2.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/daemon/cli.js +145 -100
- package/dist/daemon/index.js +122 -76
- package/dist/web/assets/index-Bap6rK4v.css +9 -0
- package/dist/web/assets/{index-CZ5uBH6R.js → index-C-ghqdil.js} +125 -125
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-DxpOSxN9.css +0 -9
package/dist/daemon/cli.js
CHANGED
|
@@ -80,7 +80,7 @@ var init_constants = __esm({
|
|
|
80
80
|
"packages/shared/dist/constants.js"() {
|
|
81
81
|
"use strict";
|
|
82
82
|
APP_NAME = "io";
|
|
83
|
-
APP_VERSION = "4.1
|
|
83
|
+
APP_VERSION = "4.2.1";
|
|
84
84
|
API_PORT = 7777;
|
|
85
85
|
API_HOST = "0.0.0.0";
|
|
86
86
|
DEFAULT_MODEL = "gpt-4o";
|
|
@@ -155,18 +155,15 @@ var init_paths = __esm({
|
|
|
155
155
|
|
|
156
156
|
// packages/daemon/src/data-dir.ts
|
|
157
157
|
import { mkdirSync } from "node:fs";
|
|
158
|
-
import { join as join2 } from "node:path";
|
|
159
158
|
function ensureDataDirectories() {
|
|
160
|
-
for (const directory of [DATA_DIR, WIKI_DIR,
|
|
159
|
+
for (const directory of [DATA_DIR, WIKI_DIR, SKILLS_DIR, LOGS_DIR]) {
|
|
161
160
|
mkdirSync(directory, { recursive: true });
|
|
162
161
|
}
|
|
163
162
|
}
|
|
164
|
-
var WIKI_PAGES_DIR;
|
|
165
163
|
var init_data_dir = __esm({
|
|
166
164
|
"packages/daemon/src/data-dir.ts"() {
|
|
167
165
|
"use strict";
|
|
168
166
|
init_paths();
|
|
169
|
-
WIKI_PAGES_DIR = join2(WIKI_DIR, "pages");
|
|
170
167
|
}
|
|
171
168
|
});
|
|
172
169
|
|
|
@@ -2300,6 +2297,35 @@ async function getMembers(squadId, db) {
|
|
|
2300
2297
|
});
|
|
2301
2298
|
return result.rows.map((row) => mapMember(row));
|
|
2302
2299
|
}
|
|
2300
|
+
async function getMember(memberId, db) {
|
|
2301
|
+
const database = db ?? await getDatabase();
|
|
2302
|
+
const result = await database.execute({
|
|
2303
|
+
sql: "SELECT * FROM squad_members WHERE id = ? LIMIT 1",
|
|
2304
|
+
args: [memberId]
|
|
2305
|
+
});
|
|
2306
|
+
const row = result.rows[0];
|
|
2307
|
+
return row ? mapMember(row) : null;
|
|
2308
|
+
}
|
|
2309
|
+
async function updateMember(memberId, data, db) {
|
|
2310
|
+
const database = db ?? await getDatabase();
|
|
2311
|
+
const sets = [];
|
|
2312
|
+
const args = [];
|
|
2313
|
+
if (data.systemPrompt !== void 0) {
|
|
2314
|
+
sets.push("system_prompt = ?");
|
|
2315
|
+
args.push(data.systemPrompt);
|
|
2316
|
+
}
|
|
2317
|
+
if (data.model !== void 0) {
|
|
2318
|
+
sets.push("model = ?");
|
|
2319
|
+
args.push(data.model || null);
|
|
2320
|
+
}
|
|
2321
|
+
if (sets.length === 0) return getMember(memberId, database);
|
|
2322
|
+
args.push(memberId);
|
|
2323
|
+
await database.execute({
|
|
2324
|
+
sql: `UPDATE squad_members SET ${sets.join(", ")} WHERE id = ?`,
|
|
2325
|
+
args
|
|
2326
|
+
});
|
|
2327
|
+
return getMember(memberId, database);
|
|
2328
|
+
}
|
|
2303
2329
|
async function getSquadRow(id, db) {
|
|
2304
2330
|
const result = await db.execute({
|
|
2305
2331
|
sql: "SELECT * FROM squads WHERE id = ? LIMIT 1",
|
|
@@ -31329,7 +31355,7 @@ var require_view = __commonJS({
|
|
|
31329
31355
|
var dirname9 = path.dirname;
|
|
31330
31356
|
var basename6 = path.basename;
|
|
31331
31357
|
var extname4 = path.extname;
|
|
31332
|
-
var
|
|
31358
|
+
var join16 = path.join;
|
|
31333
31359
|
var resolve5 = path.resolve;
|
|
31334
31360
|
module2.exports = View;
|
|
31335
31361
|
function View(name, options2) {
|
|
@@ -31391,12 +31417,12 @@ var require_view = __commonJS({
|
|
|
31391
31417
|
};
|
|
31392
31418
|
View.prototype.resolve = function resolve6(dir, file2) {
|
|
31393
31419
|
var ext = this.ext;
|
|
31394
|
-
var path2 =
|
|
31420
|
+
var path2 = join16(dir, file2);
|
|
31395
31421
|
var stat5 = tryStat(path2);
|
|
31396
31422
|
if (stat5 && stat5.isFile()) {
|
|
31397
31423
|
return path2;
|
|
31398
31424
|
}
|
|
31399
|
-
path2 =
|
|
31425
|
+
path2 = join16(dir, basename6(file2, ext), "index" + ext);
|
|
31400
31426
|
stat5 = tryStat(path2);
|
|
31401
31427
|
if (stat5 && stat5.isFile()) {
|
|
31402
31428
|
return path2;
|
|
@@ -35101,7 +35127,7 @@ var require_send = __commonJS({
|
|
|
35101
35127
|
var Stream = __require("stream");
|
|
35102
35128
|
var util = __require("util");
|
|
35103
35129
|
var extname4 = path.extname;
|
|
35104
|
-
var
|
|
35130
|
+
var join16 = path.join;
|
|
35105
35131
|
var normalize = path.normalize;
|
|
35106
35132
|
var resolve5 = path.resolve;
|
|
35107
35133
|
var sep = path.sep;
|
|
@@ -35273,7 +35299,7 @@ var require_send = __commonJS({
|
|
|
35273
35299
|
return res;
|
|
35274
35300
|
}
|
|
35275
35301
|
parts = path2.split(sep);
|
|
35276
|
-
path2 = normalize(
|
|
35302
|
+
path2 = normalize(join16(root, path2));
|
|
35277
35303
|
} else {
|
|
35278
35304
|
if (UP_PATH_REGEXP.test(path2)) {
|
|
35279
35305
|
debug('malicious path "%s"', path2);
|
|
@@ -35406,7 +35432,7 @@ var require_send = __commonJS({
|
|
|
35406
35432
|
if (err) return self.onStatError(err);
|
|
35407
35433
|
return self.error(404);
|
|
35408
35434
|
}
|
|
35409
|
-
var p =
|
|
35435
|
+
var p = join16(path2, self._index[i]);
|
|
35410
35436
|
debug('stat "%s"', p);
|
|
35411
35437
|
fs.stat(p, function(err2, stat5) {
|
|
35412
35438
|
if (err2) return next(err2);
|
|
@@ -51876,22 +51902,27 @@ var init_settings = __esm({
|
|
|
51876
51902
|
|
|
51877
51903
|
// packages/daemon/src/api/routes/skills.ts
|
|
51878
51904
|
import { mkdir as mkdir3, readFile as readFile2, rm, writeFile as writeFile2 } from "node:fs/promises";
|
|
51879
|
-
import { basename, extname, join as
|
|
51905
|
+
import { basename, extname, join as join2 } from "node:path";
|
|
51880
51906
|
async function getSkillContent(skill) {
|
|
51881
51907
|
if (!skill.entryFile) return "";
|
|
51882
|
-
const filePath =
|
|
51908
|
+
const filePath = join2(skill.directory, skill.entryFile);
|
|
51883
51909
|
try {
|
|
51884
51910
|
return await readFile2(filePath, "utf8");
|
|
51885
51911
|
} catch {
|
|
51886
51912
|
return "";
|
|
51887
51913
|
}
|
|
51888
51914
|
}
|
|
51915
|
+
function stripFrontmatter(content) {
|
|
51916
|
+
const match = content.match(/^---\s*\n[\s\S]*?\n---\s*\n([\s\S]*)$/);
|
|
51917
|
+
return match ? match[1] : content;
|
|
51918
|
+
}
|
|
51889
51919
|
function extractDescription(content) {
|
|
51890
|
-
const
|
|
51920
|
+
const body = stripFrontmatter(content);
|
|
51921
|
+
const lines = body.split("\n").filter((l) => l.trim() && !l.startsWith("#"));
|
|
51891
51922
|
return lines[0]?.trim().slice(0, 200) ?? "";
|
|
51892
51923
|
}
|
|
51893
51924
|
function extractPreview(content) {
|
|
51894
|
-
return content.slice(0, 300);
|
|
51925
|
+
return stripFrontmatter(content).slice(0, 300);
|
|
51895
51926
|
}
|
|
51896
51927
|
async function buildSkillSummaries(skills) {
|
|
51897
51928
|
return Promise.all(
|
|
@@ -51902,7 +51933,7 @@ async function buildSkillSummaries(skills) {
|
|
|
51902
51933
|
activatedForOrchestrator: true,
|
|
51903
51934
|
preview: extractPreview(content),
|
|
51904
51935
|
description: extractDescription(content),
|
|
51905
|
-
filePath: skill.entryFile ?
|
|
51936
|
+
filePath: skill.entryFile ? join2(skill.directory, skill.entryFile) : skill.directory
|
|
51906
51937
|
};
|
|
51907
51938
|
})
|
|
51908
51939
|
);
|
|
@@ -51914,7 +51945,7 @@ async function installSkill(request) {
|
|
|
51914
51945
|
const slug = normalizeSlug(request.slug?.trim() || deriveSlugFromRequest(request));
|
|
51915
51946
|
const id = `${source}:${slug}`;
|
|
51916
51947
|
const directoryName = `${source.replace(/[^a-z0-9-]/gi, "-")}-${slug}`;
|
|
51917
|
-
const directory =
|
|
51948
|
+
const directory = join2(SKILLS_DIR, directoryName);
|
|
51918
51949
|
const existing = installedSkills.find((skill2) => skill2.id === id);
|
|
51919
51950
|
let entryFile = existing?.entryFile ?? null;
|
|
51920
51951
|
let resolvedUrl = request.url;
|
|
@@ -51932,7 +51963,7 @@ async function installSkill(request) {
|
|
|
51932
51963
|
const body = await response.text();
|
|
51933
51964
|
entryFile = chooseEntryFileName(resolvedUrl, response.headers.get("content-type"));
|
|
51934
51965
|
await mkdir3(directory, { recursive: true });
|
|
51935
|
-
await writeFile2(
|
|
51966
|
+
await writeFile2(join2(directory, entryFile), body, "utf8");
|
|
51936
51967
|
} else {
|
|
51937
51968
|
await mkdir3(directory, { recursive: true });
|
|
51938
51969
|
}
|
|
@@ -51946,7 +51977,7 @@ async function installSkill(request) {
|
|
|
51946
51977
|
directory,
|
|
51947
51978
|
entryFile
|
|
51948
51979
|
};
|
|
51949
|
-
await writeFile2(
|
|
51980
|
+
await writeFile2(join2(directory, "manifest.json"), `${JSON.stringify(skill, null, 2)}
|
|
51950
51981
|
`, "utf8");
|
|
51951
51982
|
const nextSkills = [...installedSkills.filter((entry) => entry.id !== id), skill].sort(
|
|
51952
51983
|
(left, right) => left.id.localeCompare(right.id)
|
|
@@ -52182,7 +52213,7 @@ var init_skills = __esm({
|
|
|
52182
52213
|
return;
|
|
52183
52214
|
}
|
|
52184
52215
|
const content = await getSkillContent(skill);
|
|
52185
|
-
const filePath = skill.entryFile ?
|
|
52216
|
+
const filePath = skill.entryFile ? join2(skill.directory, skill.entryFile) : skill.directory;
|
|
52186
52217
|
res.status(200).json({ name: skill.slug, content, filePath });
|
|
52187
52218
|
} catch (error51) {
|
|
52188
52219
|
res.status(500).json({
|
|
@@ -52208,7 +52239,7 @@ var init_skills = __esm({
|
|
|
52208
52239
|
res.status(400).json({ error: "content is required" });
|
|
52209
52240
|
return;
|
|
52210
52241
|
}
|
|
52211
|
-
const filePath =
|
|
52242
|
+
const filePath = join2(skill.directory, skill.entryFile);
|
|
52212
52243
|
await writeFile2(filePath, content, "utf8");
|
|
52213
52244
|
res.status(200).json({ name: skill.slug, content, filePath });
|
|
52214
52245
|
} catch (error51) {
|
|
@@ -52267,7 +52298,7 @@ var init_skills = __esm({
|
|
|
52267
52298
|
// packages/daemon/src/execution/worktree.ts
|
|
52268
52299
|
import { exec } from "node:child_process";
|
|
52269
52300
|
import { mkdir as mkdir4, rm as rm2 } from "node:fs/promises";
|
|
52270
|
-
import { join as
|
|
52301
|
+
import { join as join3 } from "node:path";
|
|
52271
52302
|
import { promisify } from "node:util";
|
|
52272
52303
|
function sanitizeBranchName(branchName) {
|
|
52273
52304
|
return branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
@@ -52284,7 +52315,7 @@ async function branchExists(repoPath, branchName) {
|
|
|
52284
52315
|
return output2.length > 0;
|
|
52285
52316
|
}
|
|
52286
52317
|
function getWorktreePath(repoPath, branchName) {
|
|
52287
|
-
return
|
|
52318
|
+
return join3(repoPath, ".worktrees", sanitizeBranchName(branchName));
|
|
52288
52319
|
}
|
|
52289
52320
|
async function listWorktrees(repoPath) {
|
|
52290
52321
|
const output2 = await runGit("git worktree list --porcelain", repoPath);
|
|
@@ -52334,7 +52365,7 @@ async function listWorktrees(repoPath) {
|
|
|
52334
52365
|
}
|
|
52335
52366
|
async function createWorktree(repoPath, branchName, baseBranch) {
|
|
52336
52367
|
const worktreePath = getWorktreePath(repoPath, branchName);
|
|
52337
|
-
await mkdir4(
|
|
52368
|
+
await mkdir4(join3(repoPath, ".worktrees"), { recursive: true });
|
|
52338
52369
|
const existing = (await listWorktrees(repoPath)).find(
|
|
52339
52370
|
(worktree) => worktree.path === worktreePath
|
|
52340
52371
|
);
|
|
@@ -52356,7 +52387,7 @@ async function createWorktree(repoPath, branchName, baseBranch) {
|
|
|
52356
52387
|
}
|
|
52357
52388
|
}
|
|
52358
52389
|
async function cleanupWorktree(worktreePath) {
|
|
52359
|
-
const parentRepoPath =
|
|
52390
|
+
const parentRepoPath = join3(worktreePath, "..", "..");
|
|
52360
52391
|
try {
|
|
52361
52392
|
await runGit(`git worktree remove ${JSON.stringify(worktreePath)}`, parentRepoPath);
|
|
52362
52393
|
} catch (error51) {
|
|
@@ -52394,7 +52425,7 @@ var init_worktree = __esm({
|
|
|
52394
52425
|
|
|
52395
52426
|
// packages/daemon/src/execution/instances.ts
|
|
52396
52427
|
import { mkdir as mkdir5, readdir, rename, rm as rm3 } from "node:fs/promises";
|
|
52397
|
-
import { join as
|
|
52428
|
+
import { join as join4 } from "node:path";
|
|
52398
52429
|
async function spawnInstance(input2) {
|
|
52399
52430
|
const config2 = loadConfig();
|
|
52400
52431
|
const instance = await createInstance(input2);
|
|
@@ -52511,7 +52542,7 @@ async function cleanStaleInstances() {
|
|
|
52511
52542
|
}
|
|
52512
52543
|
}
|
|
52513
52544
|
function getWikiPendingDir(instance) {
|
|
52514
|
-
return
|
|
52545
|
+
return join4(WIKI_DIR, ".pending", instance.id);
|
|
52515
52546
|
}
|
|
52516
52547
|
async function mergeWikiPages(instance) {
|
|
52517
52548
|
const pendingDir = getWikiPendingDir(instance);
|
|
@@ -52523,8 +52554,8 @@ async function mergeWikiPages(instance) {
|
|
|
52523
52554
|
}
|
|
52524
52555
|
await mkdir5(WIKI_DIR, { recursive: true });
|
|
52525
52556
|
for (const entry of entries) {
|
|
52526
|
-
const source =
|
|
52527
|
-
const dest =
|
|
52557
|
+
const source = join4(pendingDir, entry.name);
|
|
52558
|
+
const dest = join4(WIKI_DIR, entry.name);
|
|
52528
52559
|
await rename(source, dest).catch(async () => {
|
|
52529
52560
|
const { cp } = await import("node:fs/promises");
|
|
52530
52561
|
await cp(source, dest, { recursive: true });
|
|
@@ -52832,6 +52863,26 @@ var init_squads2 = __esm({
|
|
|
52832
52863
|
});
|
|
52833
52864
|
}
|
|
52834
52865
|
});
|
|
52866
|
+
router7.put("/api/squads/:id/members/:memberId", async (req, res) => {
|
|
52867
|
+
try {
|
|
52868
|
+
const member = await getMember(req.params.memberId);
|
|
52869
|
+
if (!member) {
|
|
52870
|
+
res.status(404).json({ error: "Member not found" });
|
|
52871
|
+
return;
|
|
52872
|
+
}
|
|
52873
|
+
const { systemPrompt, model } = req.body;
|
|
52874
|
+
const updated = await updateMember(member.id, {
|
|
52875
|
+
systemPrompt,
|
|
52876
|
+
model: model === "" ? null : model
|
|
52877
|
+
});
|
|
52878
|
+
res.status(200).json(updated);
|
|
52879
|
+
} catch (error51) {
|
|
52880
|
+
res.status(500).json({
|
|
52881
|
+
error: "Failed to update member",
|
|
52882
|
+
details: error51 instanceof Error ? error51.message : "Unknown error"
|
|
52883
|
+
});
|
|
52884
|
+
}
|
|
52885
|
+
});
|
|
52835
52886
|
router7.post("/api/squads/:id/objectives", async (req, res) => {
|
|
52836
52887
|
try {
|
|
52837
52888
|
const squad = await resolveSquad(req.params.id);
|
|
@@ -55023,7 +55074,7 @@ var require_thread_stream = __commonJS({
|
|
|
55023
55074
|
var { version: version2 } = require_package();
|
|
55024
55075
|
var { EventEmitter: EventEmitter2 } = __require("events");
|
|
55025
55076
|
var { Worker } = __require("worker_threads");
|
|
55026
|
-
var { join:
|
|
55077
|
+
var { join: join16 } = __require("path");
|
|
55027
55078
|
var { pathToFileURL: pathToFileURL2 } = __require("url");
|
|
55028
55079
|
var { wait } = require_wait();
|
|
55029
55080
|
var {
|
|
@@ -55066,7 +55117,7 @@ var require_thread_stream = __commonJS({
|
|
|
55066
55117
|
function createWorker(stream, opts) {
|
|
55067
55118
|
const { filename, workerData } = opts;
|
|
55068
55119
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
55069
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
55120
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join16(__dirname, "lib", "worker.js");
|
|
55070
55121
|
const worker = new Worker(toExecute, {
|
|
55071
55122
|
...opts.workerOpts,
|
|
55072
55123
|
trackUnmanagedFds: false,
|
|
@@ -55469,7 +55520,7 @@ var require_transport = __commonJS({
|
|
|
55469
55520
|
"use strict";
|
|
55470
55521
|
var { createRequire } = __require("module");
|
|
55471
55522
|
var getCallers = require_caller();
|
|
55472
|
-
var { join:
|
|
55523
|
+
var { join: join16, isAbsolute: isAbsolute2, sep } = __require("node:path");
|
|
55473
55524
|
var sleep = require_atomic_sleep();
|
|
55474
55525
|
var onExit = require_on_exit_leak_free();
|
|
55475
55526
|
var ThreadStream = require_thread_stream();
|
|
@@ -55532,7 +55583,7 @@ var require_transport = __commonJS({
|
|
|
55532
55583
|
throw new Error("only one of target or targets can be specified");
|
|
55533
55584
|
}
|
|
55534
55585
|
if (targets) {
|
|
55535
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
55586
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
55536
55587
|
options2.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
55537
55588
|
return {
|
|
55538
55589
|
...dest,
|
|
@@ -55550,7 +55601,7 @@ var require_transport = __commonJS({
|
|
|
55550
55601
|
});
|
|
55551
55602
|
});
|
|
55552
55603
|
} else if (pipeline) {
|
|
55553
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
55604
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
55554
55605
|
options2.pipelines = [pipeline.map((dest) => {
|
|
55555
55606
|
return {
|
|
55556
55607
|
...dest,
|
|
@@ -55572,7 +55623,7 @@ var require_transport = __commonJS({
|
|
|
55572
55623
|
return origin;
|
|
55573
55624
|
}
|
|
55574
55625
|
if (origin === "pino/file") {
|
|
55575
|
-
return
|
|
55626
|
+
return join16(__dirname, "..", "file.js");
|
|
55576
55627
|
}
|
|
55577
55628
|
let fixTarget2;
|
|
55578
55629
|
for (const filePath of callers) {
|
|
@@ -56561,7 +56612,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
56561
56612
|
return circularValue;
|
|
56562
56613
|
}
|
|
56563
56614
|
let res = "";
|
|
56564
|
-
let
|
|
56615
|
+
let join16 = ",";
|
|
56565
56616
|
const originalIndentation = indentation;
|
|
56566
56617
|
if (Array.isArray(value)) {
|
|
56567
56618
|
if (value.length === 0) {
|
|
@@ -56575,7 +56626,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
56575
56626
|
indentation += spacer;
|
|
56576
56627
|
res += `
|
|
56577
56628
|
${indentation}`;
|
|
56578
|
-
|
|
56629
|
+
join16 = `,
|
|
56579
56630
|
${indentation}`;
|
|
56580
56631
|
}
|
|
56581
56632
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -56583,13 +56634,13 @@ ${indentation}`;
|
|
|
56583
56634
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
56584
56635
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
56585
56636
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
56586
|
-
res +=
|
|
56637
|
+
res += join16;
|
|
56587
56638
|
}
|
|
56588
56639
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
56589
56640
|
res += tmp !== void 0 ? tmp : "null";
|
|
56590
56641
|
if (value.length - 1 > maximumBreadth) {
|
|
56591
56642
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
56592
|
-
res += `${
|
|
56643
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
56593
56644
|
}
|
|
56594
56645
|
if (spacer !== "") {
|
|
56595
56646
|
res += `
|
|
@@ -56610,7 +56661,7 @@ ${originalIndentation}`;
|
|
|
56610
56661
|
let separator = "";
|
|
56611
56662
|
if (spacer !== "") {
|
|
56612
56663
|
indentation += spacer;
|
|
56613
|
-
|
|
56664
|
+
join16 = `,
|
|
56614
56665
|
${indentation}`;
|
|
56615
56666
|
whitespace = " ";
|
|
56616
56667
|
}
|
|
@@ -56624,13 +56675,13 @@ ${indentation}`;
|
|
|
56624
56675
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
56625
56676
|
if (tmp !== void 0) {
|
|
56626
56677
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
56627
|
-
separator =
|
|
56678
|
+
separator = join16;
|
|
56628
56679
|
}
|
|
56629
56680
|
}
|
|
56630
56681
|
if (keyLength > maximumBreadth) {
|
|
56631
56682
|
const removedKeys = keyLength - maximumBreadth;
|
|
56632
56683
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
56633
|
-
separator =
|
|
56684
|
+
separator = join16;
|
|
56634
56685
|
}
|
|
56635
56686
|
if (spacer !== "" && separator.length > 1) {
|
|
56636
56687
|
res = `
|
|
@@ -56671,7 +56722,7 @@ ${originalIndentation}`;
|
|
|
56671
56722
|
}
|
|
56672
56723
|
const originalIndentation = indentation;
|
|
56673
56724
|
let res = "";
|
|
56674
|
-
let
|
|
56725
|
+
let join16 = ",";
|
|
56675
56726
|
if (Array.isArray(value)) {
|
|
56676
56727
|
if (value.length === 0) {
|
|
56677
56728
|
return "[]";
|
|
@@ -56684,7 +56735,7 @@ ${originalIndentation}`;
|
|
|
56684
56735
|
indentation += spacer;
|
|
56685
56736
|
res += `
|
|
56686
56737
|
${indentation}`;
|
|
56687
|
-
|
|
56738
|
+
join16 = `,
|
|
56688
56739
|
${indentation}`;
|
|
56689
56740
|
}
|
|
56690
56741
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -56692,13 +56743,13 @@ ${indentation}`;
|
|
|
56692
56743
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
56693
56744
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
56694
56745
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
56695
|
-
res +=
|
|
56746
|
+
res += join16;
|
|
56696
56747
|
}
|
|
56697
56748
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
56698
56749
|
res += tmp !== void 0 ? tmp : "null";
|
|
56699
56750
|
if (value.length - 1 > maximumBreadth) {
|
|
56700
56751
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
56701
|
-
res += `${
|
|
56752
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
56702
56753
|
}
|
|
56703
56754
|
if (spacer !== "") {
|
|
56704
56755
|
res += `
|
|
@@ -56711,7 +56762,7 @@ ${originalIndentation}`;
|
|
|
56711
56762
|
let whitespace = "";
|
|
56712
56763
|
if (spacer !== "") {
|
|
56713
56764
|
indentation += spacer;
|
|
56714
|
-
|
|
56765
|
+
join16 = `,
|
|
56715
56766
|
${indentation}`;
|
|
56716
56767
|
whitespace = " ";
|
|
56717
56768
|
}
|
|
@@ -56720,7 +56771,7 @@ ${indentation}`;
|
|
|
56720
56771
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
56721
56772
|
if (tmp !== void 0) {
|
|
56722
56773
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
56723
|
-
separator =
|
|
56774
|
+
separator = join16;
|
|
56724
56775
|
}
|
|
56725
56776
|
}
|
|
56726
56777
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -56778,20 +56829,20 @@ ${originalIndentation}`;
|
|
|
56778
56829
|
indentation += spacer;
|
|
56779
56830
|
let res2 = `
|
|
56780
56831
|
${indentation}`;
|
|
56781
|
-
const
|
|
56832
|
+
const join17 = `,
|
|
56782
56833
|
${indentation}`;
|
|
56783
56834
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
56784
56835
|
let i = 0;
|
|
56785
56836
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
56786
56837
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
56787
56838
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
56788
|
-
res2 +=
|
|
56839
|
+
res2 += join17;
|
|
56789
56840
|
}
|
|
56790
56841
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
56791
56842
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
56792
56843
|
if (value.length - 1 > maximumBreadth) {
|
|
56793
56844
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
56794
|
-
res2 += `${
|
|
56845
|
+
res2 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
56795
56846
|
}
|
|
56796
56847
|
res2 += `
|
|
56797
56848
|
${originalIndentation}`;
|
|
@@ -56807,16 +56858,16 @@ ${originalIndentation}`;
|
|
|
56807
56858
|
return '"[Object]"';
|
|
56808
56859
|
}
|
|
56809
56860
|
indentation += spacer;
|
|
56810
|
-
const
|
|
56861
|
+
const join16 = `,
|
|
56811
56862
|
${indentation}`;
|
|
56812
56863
|
let res = "";
|
|
56813
56864
|
let separator = "";
|
|
56814
56865
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
56815
56866
|
if (isTypedArrayWithEntries(value)) {
|
|
56816
|
-
res += stringifyTypedArray(value,
|
|
56867
|
+
res += stringifyTypedArray(value, join16, maximumBreadth);
|
|
56817
56868
|
keys = keys.slice(value.length);
|
|
56818
56869
|
maximumPropertiesToStringify -= value.length;
|
|
56819
|
-
separator =
|
|
56870
|
+
separator = join16;
|
|
56820
56871
|
}
|
|
56821
56872
|
if (deterministic) {
|
|
56822
56873
|
keys = sort(keys, comparator);
|
|
@@ -56827,13 +56878,13 @@ ${indentation}`;
|
|
|
56827
56878
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
56828
56879
|
if (tmp !== void 0) {
|
|
56829
56880
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
56830
|
-
separator =
|
|
56881
|
+
separator = join16;
|
|
56831
56882
|
}
|
|
56832
56883
|
}
|
|
56833
56884
|
if (keyLength > maximumBreadth) {
|
|
56834
56885
|
const removedKeys = keyLength - maximumBreadth;
|
|
56835
56886
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
56836
|
-
separator =
|
|
56887
|
+
separator = join16;
|
|
56837
56888
|
}
|
|
56838
56889
|
if (separator !== "") {
|
|
56839
56890
|
res = `
|
|
@@ -59863,19 +59914,13 @@ var require_pino_pretty = __commonJS({
|
|
|
59863
59914
|
});
|
|
59864
59915
|
|
|
59865
59916
|
// packages/daemon/src/logging/logger.ts
|
|
59866
|
-
import { join as
|
|
59867
|
-
function
|
|
59868
|
-
return process.env.NODE_ENV !== "production" || process.env.LOG_LEVEL === "debug" || logLevel === "debug" || logLevel === "trace";
|
|
59869
|
-
}
|
|
59870
|
-
function createConsoleStream(logLevel) {
|
|
59871
|
-
if (!shouldPrettyPrint(logLevel)) {
|
|
59872
|
-
return import_pino.default.destination({ dest: 1, sync: false });
|
|
59873
|
-
}
|
|
59917
|
+
import { join as join5 } from "node:path";
|
|
59918
|
+
function createConsoleStream() {
|
|
59874
59919
|
return (0, import_pino_pretty.default)({
|
|
59875
|
-
colorize:
|
|
59920
|
+
colorize: process.stdout.isTTY ?? false,
|
|
59876
59921
|
translateTime: "SYS:standard",
|
|
59877
59922
|
ignore: "pid,hostname",
|
|
59878
|
-
singleLine:
|
|
59923
|
+
singleLine: true
|
|
59879
59924
|
});
|
|
59880
59925
|
}
|
|
59881
59926
|
function getRootLogger() {
|
|
@@ -59888,7 +59933,7 @@ function getRootLogger() {
|
|
|
59888
59933
|
return rootLogger;
|
|
59889
59934
|
}
|
|
59890
59935
|
function initLogger(config2) {
|
|
59891
|
-
const consoleStream = createConsoleStream(
|
|
59936
|
+
const consoleStream = createConsoleStream();
|
|
59892
59937
|
const fileStream = import_pino.default.destination({ dest: LOG_FILE_PATH, sync: false });
|
|
59893
59938
|
rootLogger = (0, import_pino.default)(
|
|
59894
59939
|
{
|
|
@@ -59910,7 +59955,7 @@ var init_logger = __esm({
|
|
|
59910
59955
|
init_paths();
|
|
59911
59956
|
import_pino = __toESM(require_pino(), 1);
|
|
59912
59957
|
import_pino_pretty = __toESM(require_pino_pretty(), 1);
|
|
59913
|
-
LOG_FILE_PATH =
|
|
59958
|
+
LOG_FILE_PATH = join5(LOGS_DIR, "io.log");
|
|
59914
59959
|
rootLogger = null;
|
|
59915
59960
|
}
|
|
59916
59961
|
});
|
|
@@ -63400,7 +63445,7 @@ var require_gray_matter = __commonJS({
|
|
|
63400
63445
|
|
|
63401
63446
|
// packages/daemon/src/wiki/wiki.ts
|
|
63402
63447
|
import { mkdir as mkdir6, readFile as readFile3, readdir as readdir2, rm as rm4, stat, writeFile as writeFile3 } from "node:fs/promises";
|
|
63403
|
-
import { basename as basename2, dirname as dirname3, extname as extname2, join as
|
|
63448
|
+
import { basename as basename2, dirname as dirname3, extname as extname2, join as join6, relative, resolve } from "node:path";
|
|
63404
63449
|
function getWikiPagesDir() {
|
|
63405
63450
|
return wikiDirectoryOverride ?? process.env.WIKI_DIR ?? WIKI_DIR;
|
|
63406
63451
|
}
|
|
@@ -63419,7 +63464,7 @@ async function collectDirectories(directory) {
|
|
|
63419
63464
|
const dirs = [];
|
|
63420
63465
|
for (const entry of entries) {
|
|
63421
63466
|
if (entry.isDirectory()) {
|
|
63422
|
-
const entryPath =
|
|
63467
|
+
const entryPath = join6(directory, entry.name);
|
|
63423
63468
|
dirs.push(entryPath);
|
|
63424
63469
|
dirs.push(...await collectDirectories(entryPath));
|
|
63425
63470
|
}
|
|
@@ -63500,7 +63545,7 @@ async function collectMarkdownFiles(directory) {
|
|
|
63500
63545
|
const entries = await readdir2(directory, { withFileTypes: true });
|
|
63501
63546
|
const files = [];
|
|
63502
63547
|
for (const entry of entries) {
|
|
63503
|
-
const entryPath =
|
|
63548
|
+
const entryPath = join6(directory, entry.name);
|
|
63504
63549
|
if (entry.isDirectory()) {
|
|
63505
63550
|
files.push(...await collectMarkdownFiles(entryPath));
|
|
63506
63551
|
continue;
|
|
@@ -67741,7 +67786,7 @@ var init_websocket = __esm({
|
|
|
67741
67786
|
// packages/daemon/src/api/server.ts
|
|
67742
67787
|
import { existsSync as existsSync2 } from "node:fs";
|
|
67743
67788
|
import { createServer } from "node:http";
|
|
67744
|
-
import { dirname as dirname4, join as
|
|
67789
|
+
import { dirname as dirname4, join as join7, resolve as resolve2 } from "node:path";
|
|
67745
67790
|
import { fileURLToPath } from "node:url";
|
|
67746
67791
|
function createApiServer(config2) {
|
|
67747
67792
|
const app = (0, import_express10.default)();
|
|
@@ -67786,7 +67831,7 @@ function createApiServer(config2) {
|
|
|
67786
67831
|
if (existsSync2(webDirectory)) {
|
|
67787
67832
|
app.use(import_express10.default.static(webDirectory));
|
|
67788
67833
|
app.use((_req, res) => {
|
|
67789
|
-
res.sendFile(
|
|
67834
|
+
res.sendFile(join7(webDirectory, "index.html"));
|
|
67790
67835
|
});
|
|
67791
67836
|
}
|
|
67792
67837
|
app.use((error51, _req, res, next) => {
|
|
@@ -68468,7 +68513,7 @@ var init_reset = __esm({
|
|
|
68468
68513
|
// packages/daemon/src/copilot/client.ts
|
|
68469
68514
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
68470
68515
|
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
68471
|
-
import { join as
|
|
68516
|
+
import { join as join8 } from "node:path";
|
|
68472
68517
|
import { CopilotClient } from "@github/copilot-sdk";
|
|
68473
68518
|
function readTokenFromEnvironment() {
|
|
68474
68519
|
const token = process.env.GITHUB_TOKEN?.trim();
|
|
@@ -68554,7 +68599,7 @@ var init_client = __esm({
|
|
|
68554
68599
|
"use strict";
|
|
68555
68600
|
init_paths();
|
|
68556
68601
|
COPILOT_AUTH_ERROR_HINT = "Set GITHUB_TOKEN or authenticate with the GitHub CLI (`gh auth login`) so `gh auth token` returns a valid token.";
|
|
68557
|
-
COPILOT_BASE_DIRECTORY =
|
|
68602
|
+
COPILOT_BASE_DIRECTORY = join8(DATA_DIR, "copilot-sdk");
|
|
68558
68603
|
copilotClientSingleton = null;
|
|
68559
68604
|
copilotClientInitPromise = null;
|
|
68560
68605
|
}
|
|
@@ -68714,7 +68759,7 @@ var init_session = __esm({
|
|
|
68714
68759
|
|
|
68715
68760
|
// packages/daemon/src/skills/loader.ts
|
|
68716
68761
|
import { readFile as readFile4, readdir as readdir3 } from "node:fs/promises";
|
|
68717
|
-
import { basename as basename3, dirname as dirname5, join as
|
|
68762
|
+
import { basename as basename3, dirname as dirname5, join as join9 } from "node:path";
|
|
68718
68763
|
async function scanSkills() {
|
|
68719
68764
|
const skillFilePaths = await collectSkillFiles(SKILLS_DIR);
|
|
68720
68765
|
const skills = await Promise.all(skillFilePaths.map((filePath) => readSkillFromFile(filePath)));
|
|
@@ -68725,7 +68770,7 @@ async function collectSkillFiles(directory) {
|
|
|
68725
68770
|
const entries = await readdir3(directory, { withFileTypes: true });
|
|
68726
68771
|
const skillFiles = [];
|
|
68727
68772
|
for (const entry of entries) {
|
|
68728
|
-
const entryPath =
|
|
68773
|
+
const entryPath = join9(directory, entry.name);
|
|
68729
68774
|
if (entry.isDirectory()) {
|
|
68730
68775
|
skillFiles.push(...await collectSkillFiles(entryPath));
|
|
68731
68776
|
continue;
|
|
@@ -68769,7 +68814,7 @@ var init_loader = __esm({
|
|
|
68769
68814
|
|
|
68770
68815
|
// packages/daemon/src/skills/manager.ts
|
|
68771
68816
|
import { mkdir as mkdir7, readFile as readFile5, rm as rm5, writeFile as writeFile4 } from "node:fs/promises";
|
|
68772
|
-
import { basename as basename4, dirname as dirname6, join as
|
|
68817
|
+
import { basename as basename4, dirname as dirname6, join as join10 } from "node:path";
|
|
68773
68818
|
async function installSkill2(url2) {
|
|
68774
68819
|
const response = await fetch(url2);
|
|
68775
68820
|
if (!response.ok) {
|
|
@@ -68779,8 +68824,8 @@ async function installSkill2(url2) {
|
|
|
68779
68824
|
}
|
|
68780
68825
|
const skillMarkdown = await response.text();
|
|
68781
68826
|
const skillId = getSkillIdFromUrl(url2);
|
|
68782
|
-
const skillDirectory =
|
|
68783
|
-
const skillPath =
|
|
68827
|
+
const skillDirectory = join10(SKILLS_DIR, skillId);
|
|
68828
|
+
const skillPath = join10(skillDirectory, "SKILL.md");
|
|
68784
68829
|
const parsed = (0, import_gray_matter3.default)(skillMarkdown);
|
|
68785
68830
|
const installedSkill = {
|
|
68786
68831
|
id: skillId,
|
|
@@ -68794,7 +68839,7 @@ async function installSkill2(url2) {
|
|
|
68794
68839
|
return installedSkill;
|
|
68795
68840
|
}
|
|
68796
68841
|
async function removeSkill2(id) {
|
|
68797
|
-
await rm5(
|
|
68842
|
+
await rm5(join10(SKILLS_DIR, id), { recursive: true, force: true });
|
|
68798
68843
|
const lockFile = await readSkillsLock();
|
|
68799
68844
|
lockFile.skills = lockFile.skills.filter((skill) => skill.id !== id);
|
|
68800
68845
|
await writeSkillsLock2(lockFile);
|
|
@@ -69414,7 +69459,7 @@ var init_history = __esm({
|
|
|
69414
69459
|
// packages/daemon/src/execution/agent.ts
|
|
69415
69460
|
import { exec as exec3 } from "node:child_process";
|
|
69416
69461
|
import { mkdir as mkdir9, readFile as readFile7, readdir as readdir5, stat as stat3, writeFile as writeFile6 } from "node:fs/promises";
|
|
69417
|
-
import { dirname as dirname8, extname as extname3, isAbsolute, join as
|
|
69462
|
+
import { dirname as dirname8, extname as extname3, isAbsolute, join as join11, relative as relative3, resolve as resolve4 } from "node:path";
|
|
69418
69463
|
import { promisify as promisify3 } from "node:util";
|
|
69419
69464
|
import {
|
|
69420
69465
|
CopilotClient as CopilotClient2,
|
|
@@ -69483,7 +69528,7 @@ async function collectFiles(directory, recursive, output2) {
|
|
|
69483
69528
|
if (output2.length >= MAX_LIST_RESULTS) {
|
|
69484
69529
|
return;
|
|
69485
69530
|
}
|
|
69486
|
-
const fullPath =
|
|
69531
|
+
const fullPath = join11(directory, entry.name);
|
|
69487
69532
|
output2.push(fullPath);
|
|
69488
69533
|
if (recursive && entry.isDirectory()) {
|
|
69489
69534
|
await collectFiles(fullPath, recursive, output2);
|
|
@@ -69873,7 +69918,7 @@ Return strict JSON in this shape:
|
|
|
69873
69918
|
// packages/daemon/src/execution/planning.ts
|
|
69874
69919
|
import { exec as exec4 } from "node:child_process";
|
|
69875
69920
|
import { access, readFile as readFile8 } from "node:fs/promises";
|
|
69876
|
-
import { join as
|
|
69921
|
+
import { join as join12 } from "node:path";
|
|
69877
69922
|
import { promisify as promisify4 } from "node:util";
|
|
69878
69923
|
import { CopilotClient as CopilotClient3, approveAll as approveAll3 } from "@github/copilot-sdk";
|
|
69879
69924
|
async function fileExists(path) {
|
|
@@ -69886,7 +69931,7 @@ async function fileExists(path) {
|
|
|
69886
69931
|
}
|
|
69887
69932
|
async function buildRepoContext(repoPath) {
|
|
69888
69933
|
for (const candidate of README_CANDIDATES) {
|
|
69889
|
-
const readmePath =
|
|
69934
|
+
const readmePath = join12(repoPath, candidate);
|
|
69890
69935
|
if (await fileExists(readmePath)) {
|
|
69891
69936
|
const content = await readFile8(readmePath, "utf8");
|
|
69892
69937
|
return content.slice(0, MAX_REPO_CONTEXT_LENGTH);
|
|
@@ -70020,7 +70065,7 @@ var init_planning = __esm({
|
|
|
70020
70065
|
// packages/daemon/src/execution/pr.ts
|
|
70021
70066
|
import { exec as exec5 } from "node:child_process";
|
|
70022
70067
|
import { rm as rm6, writeFile as writeFile7 } from "node:fs/promises";
|
|
70023
|
-
import { join as
|
|
70068
|
+
import { join as join13 } from "node:path";
|
|
70024
70069
|
import { promisify as promisify5 } from "node:util";
|
|
70025
70070
|
async function runCommand(command, cwd) {
|
|
70026
70071
|
const { stdout } = await execAsync5(command, {
|
|
@@ -70034,7 +70079,7 @@ function extractUrl(output2) {
|
|
|
70034
70079
|
}
|
|
70035
70080
|
function buildBodyFilePath(repoPath, branchName) {
|
|
70036
70081
|
const safeBranchName = branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
70037
|
-
return
|
|
70082
|
+
return join13(repoPath, `.io-pr-body-${safeBranchName}.md`);
|
|
70038
70083
|
}
|
|
70039
70084
|
function buildPrBody(objective, plan, taskSummaries, qaOutcome) {
|
|
70040
70085
|
const tasks = taskSummaries.map((summary) => `- ${summary}`).join("\n") || "- No task summaries recorded.";
|
|
@@ -70367,7 +70412,7 @@ var init_tasks = __esm({
|
|
|
70367
70412
|
// packages/daemon/src/execution/runner.ts
|
|
70368
70413
|
import { exec as exec7 } from "node:child_process";
|
|
70369
70414
|
import { access as access2 } from "node:fs/promises";
|
|
70370
|
-
import { basename as basename5, join as
|
|
70415
|
+
import { basename as basename5, join as join14 } from "node:path";
|
|
70371
70416
|
import { promisify as promisify7 } from "node:util";
|
|
70372
70417
|
async function pathExists(path) {
|
|
70373
70418
|
try {
|
|
@@ -70387,16 +70432,16 @@ async function runGit2(command, cwd) {
|
|
|
70387
70432
|
async function resolveRepoPath(repoUrl, repoName) {
|
|
70388
70433
|
const urlSegments = repoUrl.replace(/\.git$/i, "").split("/").filter(Boolean);
|
|
70389
70434
|
const owner = urlSegments.at(-2) ?? "";
|
|
70390
|
-
const managedDir = owner && repoName ?
|
|
70435
|
+
const managedDir = owner && repoName ? join14(DATA_DIR, "repos", `${owner}--${repoName}`) : null;
|
|
70391
70436
|
const candidates = [
|
|
70392
70437
|
...managedDir ? [managedDir] : [],
|
|
70393
70438
|
process.cwd(),
|
|
70394
|
-
|
|
70395
|
-
|
|
70396
|
-
|
|
70439
|
+
join14(process.cwd(), repoName),
|
|
70440
|
+
join14(process.cwd(), "repos", repoName),
|
|
70441
|
+
join14(process.cwd(), "..", repoName)
|
|
70397
70442
|
];
|
|
70398
70443
|
for (const candidate of candidates) {
|
|
70399
|
-
if (!await pathExists(
|
|
70444
|
+
if (!await pathExists(join14(candidate, ".git"))) {
|
|
70400
70445
|
continue;
|
|
70401
70446
|
}
|
|
70402
70447
|
const remoteUrl = await runGit2("git remote get-url origin", candidate).catch(() => "");
|
|
@@ -70910,7 +70955,7 @@ var init_hiring = __esm({
|
|
|
70910
70955
|
// packages/daemon/src/orchestrator/tools/squad.ts
|
|
70911
70956
|
import { exec as exec8 } from "node:child_process";
|
|
70912
70957
|
import { mkdir as mkdir10, readFile as readFile9, readdir as readdir6, stat as stat4 } from "node:fs/promises";
|
|
70913
|
-
import { join as
|
|
70958
|
+
import { join as join15 } from "node:path";
|
|
70914
70959
|
import { promisify as promisify8 } from "node:util";
|
|
70915
70960
|
async function pathExists2(path) {
|
|
70916
70961
|
try {
|
|
@@ -70939,10 +70984,10 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
70939
70984
|
);
|
|
70940
70985
|
return lines.join("\n");
|
|
70941
70986
|
}
|
|
70942
|
-
const repoDir =
|
|
70987
|
+
const repoDir = join15(DATA_DIR, "repos", `${owner}--${name}`);
|
|
70943
70988
|
try {
|
|
70944
|
-
await mkdir10(
|
|
70945
|
-
if (await pathExists2(
|
|
70989
|
+
await mkdir10(join15(DATA_DIR, "repos"), { recursive: true });
|
|
70990
|
+
if (await pathExists2(join15(repoDir, ".git"))) {
|
|
70946
70991
|
await execAsync8("git pull --ff-only", { cwd: repoDir, timeout: 3e4 }).catch(
|
|
70947
70992
|
() => void 0
|
|
70948
70993
|
);
|
|
@@ -70979,7 +71024,7 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
70979
71024
|
".github/workflows"
|
|
70980
71025
|
];
|
|
70981
71026
|
for (const manifest of manifestFiles) {
|
|
70982
|
-
const fullPath =
|
|
71027
|
+
const fullPath = join15(repoDir, manifest);
|
|
70983
71028
|
try {
|
|
70984
71029
|
const fileStat = await stat4(fullPath);
|
|
70985
71030
|
if (fileStat.isFile()) {
|
|
@@ -71001,7 +71046,7 @@ ${children.join(", ")}`);
|
|
|
71001
71046
|
);
|
|
71002
71047
|
for (const srcDir of srcDirs) {
|
|
71003
71048
|
try {
|
|
71004
|
-
const srcEntries = await readdir6(
|
|
71049
|
+
const srcEntries = await readdir6(join15(repoDir, srcDir), { withFileTypes: true });
|
|
71005
71050
|
const srcFiles = srcEntries.filter((e) => e.isFile()).map((e) => e.name);
|
|
71006
71051
|
const srcSubDirs = srcEntries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
71007
71052
|
lines.push(`
|
|
@@ -71014,7 +71059,7 @@ ${children.join(", ")}`);
|
|
|
71014
71059
|
const readmeCandidates = ["README.md", "README.rst", "README.txt", "README"];
|
|
71015
71060
|
for (const readme of readmeCandidates) {
|
|
71016
71061
|
try {
|
|
71017
|
-
const content = await readFile9(
|
|
71062
|
+
const content = await readFile9(join15(repoDir, readme), "utf8");
|
|
71018
71063
|
lines.push(`
|
|
71019
71064
|
--- ${readme} (excerpt) ---
|
|
71020
71065
|
${content.slice(0, 1500)}`);
|