heyio 4.2.0 → 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
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.2.
|
|
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
|
|
|
@@ -31358,7 +31355,7 @@ var require_view = __commonJS({
|
|
|
31358
31355
|
var dirname9 = path.dirname;
|
|
31359
31356
|
var basename6 = path.basename;
|
|
31360
31357
|
var extname4 = path.extname;
|
|
31361
|
-
var
|
|
31358
|
+
var join16 = path.join;
|
|
31362
31359
|
var resolve5 = path.resolve;
|
|
31363
31360
|
module2.exports = View;
|
|
31364
31361
|
function View(name, options2) {
|
|
@@ -31420,12 +31417,12 @@ var require_view = __commonJS({
|
|
|
31420
31417
|
};
|
|
31421
31418
|
View.prototype.resolve = function resolve6(dir, file2) {
|
|
31422
31419
|
var ext = this.ext;
|
|
31423
|
-
var path2 =
|
|
31420
|
+
var path2 = join16(dir, file2);
|
|
31424
31421
|
var stat5 = tryStat(path2);
|
|
31425
31422
|
if (stat5 && stat5.isFile()) {
|
|
31426
31423
|
return path2;
|
|
31427
31424
|
}
|
|
31428
|
-
path2 =
|
|
31425
|
+
path2 = join16(dir, basename6(file2, ext), "index" + ext);
|
|
31429
31426
|
stat5 = tryStat(path2);
|
|
31430
31427
|
if (stat5 && stat5.isFile()) {
|
|
31431
31428
|
return path2;
|
|
@@ -35130,7 +35127,7 @@ var require_send = __commonJS({
|
|
|
35130
35127
|
var Stream = __require("stream");
|
|
35131
35128
|
var util = __require("util");
|
|
35132
35129
|
var extname4 = path.extname;
|
|
35133
|
-
var
|
|
35130
|
+
var join16 = path.join;
|
|
35134
35131
|
var normalize = path.normalize;
|
|
35135
35132
|
var resolve5 = path.resolve;
|
|
35136
35133
|
var sep = path.sep;
|
|
@@ -35302,7 +35299,7 @@ var require_send = __commonJS({
|
|
|
35302
35299
|
return res;
|
|
35303
35300
|
}
|
|
35304
35301
|
parts = path2.split(sep);
|
|
35305
|
-
path2 = normalize(
|
|
35302
|
+
path2 = normalize(join16(root, path2));
|
|
35306
35303
|
} else {
|
|
35307
35304
|
if (UP_PATH_REGEXP.test(path2)) {
|
|
35308
35305
|
debug('malicious path "%s"', path2);
|
|
@@ -35435,7 +35432,7 @@ var require_send = __commonJS({
|
|
|
35435
35432
|
if (err) return self.onStatError(err);
|
|
35436
35433
|
return self.error(404);
|
|
35437
35434
|
}
|
|
35438
|
-
var p =
|
|
35435
|
+
var p = join16(path2, self._index[i]);
|
|
35439
35436
|
debug('stat "%s"', p);
|
|
35440
35437
|
fs.stat(p, function(err2, stat5) {
|
|
35441
35438
|
if (err2) return next(err2);
|
|
@@ -51905,22 +51902,27 @@ var init_settings = __esm({
|
|
|
51905
51902
|
|
|
51906
51903
|
// packages/daemon/src/api/routes/skills.ts
|
|
51907
51904
|
import { mkdir as mkdir3, readFile as readFile2, rm, writeFile as writeFile2 } from "node:fs/promises";
|
|
51908
|
-
import { basename, extname, join as
|
|
51905
|
+
import { basename, extname, join as join2 } from "node:path";
|
|
51909
51906
|
async function getSkillContent(skill) {
|
|
51910
51907
|
if (!skill.entryFile) return "";
|
|
51911
|
-
const filePath =
|
|
51908
|
+
const filePath = join2(skill.directory, skill.entryFile);
|
|
51912
51909
|
try {
|
|
51913
51910
|
return await readFile2(filePath, "utf8");
|
|
51914
51911
|
} catch {
|
|
51915
51912
|
return "";
|
|
51916
51913
|
}
|
|
51917
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
|
+
}
|
|
51918
51919
|
function extractDescription(content) {
|
|
51919
|
-
const
|
|
51920
|
+
const body = stripFrontmatter(content);
|
|
51921
|
+
const lines = body.split("\n").filter((l) => l.trim() && !l.startsWith("#"));
|
|
51920
51922
|
return lines[0]?.trim().slice(0, 200) ?? "";
|
|
51921
51923
|
}
|
|
51922
51924
|
function extractPreview(content) {
|
|
51923
|
-
return content.slice(0, 300);
|
|
51925
|
+
return stripFrontmatter(content).slice(0, 300);
|
|
51924
51926
|
}
|
|
51925
51927
|
async function buildSkillSummaries(skills) {
|
|
51926
51928
|
return Promise.all(
|
|
@@ -51931,7 +51933,7 @@ async function buildSkillSummaries(skills) {
|
|
|
51931
51933
|
activatedForOrchestrator: true,
|
|
51932
51934
|
preview: extractPreview(content),
|
|
51933
51935
|
description: extractDescription(content),
|
|
51934
|
-
filePath: skill.entryFile ?
|
|
51936
|
+
filePath: skill.entryFile ? join2(skill.directory, skill.entryFile) : skill.directory
|
|
51935
51937
|
};
|
|
51936
51938
|
})
|
|
51937
51939
|
);
|
|
@@ -51943,7 +51945,7 @@ async function installSkill(request) {
|
|
|
51943
51945
|
const slug = normalizeSlug(request.slug?.trim() || deriveSlugFromRequest(request));
|
|
51944
51946
|
const id = `${source}:${slug}`;
|
|
51945
51947
|
const directoryName = `${source.replace(/[^a-z0-9-]/gi, "-")}-${slug}`;
|
|
51946
|
-
const directory =
|
|
51948
|
+
const directory = join2(SKILLS_DIR, directoryName);
|
|
51947
51949
|
const existing = installedSkills.find((skill2) => skill2.id === id);
|
|
51948
51950
|
let entryFile = existing?.entryFile ?? null;
|
|
51949
51951
|
let resolvedUrl = request.url;
|
|
@@ -51961,7 +51963,7 @@ async function installSkill(request) {
|
|
|
51961
51963
|
const body = await response.text();
|
|
51962
51964
|
entryFile = chooseEntryFileName(resolvedUrl, response.headers.get("content-type"));
|
|
51963
51965
|
await mkdir3(directory, { recursive: true });
|
|
51964
|
-
await writeFile2(
|
|
51966
|
+
await writeFile2(join2(directory, entryFile), body, "utf8");
|
|
51965
51967
|
} else {
|
|
51966
51968
|
await mkdir3(directory, { recursive: true });
|
|
51967
51969
|
}
|
|
@@ -51975,7 +51977,7 @@ async function installSkill(request) {
|
|
|
51975
51977
|
directory,
|
|
51976
51978
|
entryFile
|
|
51977
51979
|
};
|
|
51978
|
-
await writeFile2(
|
|
51980
|
+
await writeFile2(join2(directory, "manifest.json"), `${JSON.stringify(skill, null, 2)}
|
|
51979
51981
|
`, "utf8");
|
|
51980
51982
|
const nextSkills = [...installedSkills.filter((entry) => entry.id !== id), skill].sort(
|
|
51981
51983
|
(left, right) => left.id.localeCompare(right.id)
|
|
@@ -52211,7 +52213,7 @@ var init_skills = __esm({
|
|
|
52211
52213
|
return;
|
|
52212
52214
|
}
|
|
52213
52215
|
const content = await getSkillContent(skill);
|
|
52214
|
-
const filePath = skill.entryFile ?
|
|
52216
|
+
const filePath = skill.entryFile ? join2(skill.directory, skill.entryFile) : skill.directory;
|
|
52215
52217
|
res.status(200).json({ name: skill.slug, content, filePath });
|
|
52216
52218
|
} catch (error51) {
|
|
52217
52219
|
res.status(500).json({
|
|
@@ -52237,7 +52239,7 @@ var init_skills = __esm({
|
|
|
52237
52239
|
res.status(400).json({ error: "content is required" });
|
|
52238
52240
|
return;
|
|
52239
52241
|
}
|
|
52240
|
-
const filePath =
|
|
52242
|
+
const filePath = join2(skill.directory, skill.entryFile);
|
|
52241
52243
|
await writeFile2(filePath, content, "utf8");
|
|
52242
52244
|
res.status(200).json({ name: skill.slug, content, filePath });
|
|
52243
52245
|
} catch (error51) {
|
|
@@ -52296,7 +52298,7 @@ var init_skills = __esm({
|
|
|
52296
52298
|
// packages/daemon/src/execution/worktree.ts
|
|
52297
52299
|
import { exec } from "node:child_process";
|
|
52298
52300
|
import { mkdir as mkdir4, rm as rm2 } from "node:fs/promises";
|
|
52299
|
-
import { join as
|
|
52301
|
+
import { join as join3 } from "node:path";
|
|
52300
52302
|
import { promisify } from "node:util";
|
|
52301
52303
|
function sanitizeBranchName(branchName) {
|
|
52302
52304
|
return branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
@@ -52313,7 +52315,7 @@ async function branchExists(repoPath, branchName) {
|
|
|
52313
52315
|
return output2.length > 0;
|
|
52314
52316
|
}
|
|
52315
52317
|
function getWorktreePath(repoPath, branchName) {
|
|
52316
|
-
return
|
|
52318
|
+
return join3(repoPath, ".worktrees", sanitizeBranchName(branchName));
|
|
52317
52319
|
}
|
|
52318
52320
|
async function listWorktrees(repoPath) {
|
|
52319
52321
|
const output2 = await runGit("git worktree list --porcelain", repoPath);
|
|
@@ -52363,7 +52365,7 @@ async function listWorktrees(repoPath) {
|
|
|
52363
52365
|
}
|
|
52364
52366
|
async function createWorktree(repoPath, branchName, baseBranch) {
|
|
52365
52367
|
const worktreePath = getWorktreePath(repoPath, branchName);
|
|
52366
|
-
await mkdir4(
|
|
52368
|
+
await mkdir4(join3(repoPath, ".worktrees"), { recursive: true });
|
|
52367
52369
|
const existing = (await listWorktrees(repoPath)).find(
|
|
52368
52370
|
(worktree) => worktree.path === worktreePath
|
|
52369
52371
|
);
|
|
@@ -52385,7 +52387,7 @@ async function createWorktree(repoPath, branchName, baseBranch) {
|
|
|
52385
52387
|
}
|
|
52386
52388
|
}
|
|
52387
52389
|
async function cleanupWorktree(worktreePath) {
|
|
52388
|
-
const parentRepoPath =
|
|
52390
|
+
const parentRepoPath = join3(worktreePath, "..", "..");
|
|
52389
52391
|
try {
|
|
52390
52392
|
await runGit(`git worktree remove ${JSON.stringify(worktreePath)}`, parentRepoPath);
|
|
52391
52393
|
} catch (error51) {
|
|
@@ -52423,7 +52425,7 @@ var init_worktree = __esm({
|
|
|
52423
52425
|
|
|
52424
52426
|
// packages/daemon/src/execution/instances.ts
|
|
52425
52427
|
import { mkdir as mkdir5, readdir, rename, rm as rm3 } from "node:fs/promises";
|
|
52426
|
-
import { join as
|
|
52428
|
+
import { join as join4 } from "node:path";
|
|
52427
52429
|
async function spawnInstance(input2) {
|
|
52428
52430
|
const config2 = loadConfig();
|
|
52429
52431
|
const instance = await createInstance(input2);
|
|
@@ -52540,7 +52542,7 @@ async function cleanStaleInstances() {
|
|
|
52540
52542
|
}
|
|
52541
52543
|
}
|
|
52542
52544
|
function getWikiPendingDir(instance) {
|
|
52543
|
-
return
|
|
52545
|
+
return join4(WIKI_DIR, ".pending", instance.id);
|
|
52544
52546
|
}
|
|
52545
52547
|
async function mergeWikiPages(instance) {
|
|
52546
52548
|
const pendingDir = getWikiPendingDir(instance);
|
|
@@ -52552,8 +52554,8 @@ async function mergeWikiPages(instance) {
|
|
|
52552
52554
|
}
|
|
52553
52555
|
await mkdir5(WIKI_DIR, { recursive: true });
|
|
52554
52556
|
for (const entry of entries) {
|
|
52555
|
-
const source =
|
|
52556
|
-
const dest =
|
|
52557
|
+
const source = join4(pendingDir, entry.name);
|
|
52558
|
+
const dest = join4(WIKI_DIR, entry.name);
|
|
52557
52559
|
await rename(source, dest).catch(async () => {
|
|
52558
52560
|
const { cp } = await import("node:fs/promises");
|
|
52559
52561
|
await cp(source, dest, { recursive: true });
|
|
@@ -55072,7 +55074,7 @@ var require_thread_stream = __commonJS({
|
|
|
55072
55074
|
var { version: version2 } = require_package();
|
|
55073
55075
|
var { EventEmitter: EventEmitter2 } = __require("events");
|
|
55074
55076
|
var { Worker } = __require("worker_threads");
|
|
55075
|
-
var { join:
|
|
55077
|
+
var { join: join16 } = __require("path");
|
|
55076
55078
|
var { pathToFileURL: pathToFileURL2 } = __require("url");
|
|
55077
55079
|
var { wait } = require_wait();
|
|
55078
55080
|
var {
|
|
@@ -55115,7 +55117,7 @@ var require_thread_stream = __commonJS({
|
|
|
55115
55117
|
function createWorker(stream, opts) {
|
|
55116
55118
|
const { filename, workerData } = opts;
|
|
55117
55119
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
55118
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
55120
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join16(__dirname, "lib", "worker.js");
|
|
55119
55121
|
const worker = new Worker(toExecute, {
|
|
55120
55122
|
...opts.workerOpts,
|
|
55121
55123
|
trackUnmanagedFds: false,
|
|
@@ -55518,7 +55520,7 @@ var require_transport = __commonJS({
|
|
|
55518
55520
|
"use strict";
|
|
55519
55521
|
var { createRequire } = __require("module");
|
|
55520
55522
|
var getCallers = require_caller();
|
|
55521
|
-
var { join:
|
|
55523
|
+
var { join: join16, isAbsolute: isAbsolute2, sep } = __require("node:path");
|
|
55522
55524
|
var sleep = require_atomic_sleep();
|
|
55523
55525
|
var onExit = require_on_exit_leak_free();
|
|
55524
55526
|
var ThreadStream = require_thread_stream();
|
|
@@ -55581,7 +55583,7 @@ var require_transport = __commonJS({
|
|
|
55581
55583
|
throw new Error("only one of target or targets can be specified");
|
|
55582
55584
|
}
|
|
55583
55585
|
if (targets) {
|
|
55584
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
55586
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
55585
55587
|
options2.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
55586
55588
|
return {
|
|
55587
55589
|
...dest,
|
|
@@ -55599,7 +55601,7 @@ var require_transport = __commonJS({
|
|
|
55599
55601
|
});
|
|
55600
55602
|
});
|
|
55601
55603
|
} else if (pipeline) {
|
|
55602
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
55604
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
55603
55605
|
options2.pipelines = [pipeline.map((dest) => {
|
|
55604
55606
|
return {
|
|
55605
55607
|
...dest,
|
|
@@ -55621,7 +55623,7 @@ var require_transport = __commonJS({
|
|
|
55621
55623
|
return origin;
|
|
55622
55624
|
}
|
|
55623
55625
|
if (origin === "pino/file") {
|
|
55624
|
-
return
|
|
55626
|
+
return join16(__dirname, "..", "file.js");
|
|
55625
55627
|
}
|
|
55626
55628
|
let fixTarget2;
|
|
55627
55629
|
for (const filePath of callers) {
|
|
@@ -56610,7 +56612,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
56610
56612
|
return circularValue;
|
|
56611
56613
|
}
|
|
56612
56614
|
let res = "";
|
|
56613
|
-
let
|
|
56615
|
+
let join16 = ",";
|
|
56614
56616
|
const originalIndentation = indentation;
|
|
56615
56617
|
if (Array.isArray(value)) {
|
|
56616
56618
|
if (value.length === 0) {
|
|
@@ -56624,7 +56626,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
56624
56626
|
indentation += spacer;
|
|
56625
56627
|
res += `
|
|
56626
56628
|
${indentation}`;
|
|
56627
|
-
|
|
56629
|
+
join16 = `,
|
|
56628
56630
|
${indentation}`;
|
|
56629
56631
|
}
|
|
56630
56632
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -56632,13 +56634,13 @@ ${indentation}`;
|
|
|
56632
56634
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
56633
56635
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
56634
56636
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
56635
|
-
res +=
|
|
56637
|
+
res += join16;
|
|
56636
56638
|
}
|
|
56637
56639
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
56638
56640
|
res += tmp !== void 0 ? tmp : "null";
|
|
56639
56641
|
if (value.length - 1 > maximumBreadth) {
|
|
56640
56642
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
56641
|
-
res += `${
|
|
56643
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
56642
56644
|
}
|
|
56643
56645
|
if (spacer !== "") {
|
|
56644
56646
|
res += `
|
|
@@ -56659,7 +56661,7 @@ ${originalIndentation}`;
|
|
|
56659
56661
|
let separator = "";
|
|
56660
56662
|
if (spacer !== "") {
|
|
56661
56663
|
indentation += spacer;
|
|
56662
|
-
|
|
56664
|
+
join16 = `,
|
|
56663
56665
|
${indentation}`;
|
|
56664
56666
|
whitespace = " ";
|
|
56665
56667
|
}
|
|
@@ -56673,13 +56675,13 @@ ${indentation}`;
|
|
|
56673
56675
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
56674
56676
|
if (tmp !== void 0) {
|
|
56675
56677
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
56676
|
-
separator =
|
|
56678
|
+
separator = join16;
|
|
56677
56679
|
}
|
|
56678
56680
|
}
|
|
56679
56681
|
if (keyLength > maximumBreadth) {
|
|
56680
56682
|
const removedKeys = keyLength - maximumBreadth;
|
|
56681
56683
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
56682
|
-
separator =
|
|
56684
|
+
separator = join16;
|
|
56683
56685
|
}
|
|
56684
56686
|
if (spacer !== "" && separator.length > 1) {
|
|
56685
56687
|
res = `
|
|
@@ -56720,7 +56722,7 @@ ${originalIndentation}`;
|
|
|
56720
56722
|
}
|
|
56721
56723
|
const originalIndentation = indentation;
|
|
56722
56724
|
let res = "";
|
|
56723
|
-
let
|
|
56725
|
+
let join16 = ",";
|
|
56724
56726
|
if (Array.isArray(value)) {
|
|
56725
56727
|
if (value.length === 0) {
|
|
56726
56728
|
return "[]";
|
|
@@ -56733,7 +56735,7 @@ ${originalIndentation}`;
|
|
|
56733
56735
|
indentation += spacer;
|
|
56734
56736
|
res += `
|
|
56735
56737
|
${indentation}`;
|
|
56736
|
-
|
|
56738
|
+
join16 = `,
|
|
56737
56739
|
${indentation}`;
|
|
56738
56740
|
}
|
|
56739
56741
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -56741,13 +56743,13 @@ ${indentation}`;
|
|
|
56741
56743
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
56742
56744
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
56743
56745
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
56744
|
-
res +=
|
|
56746
|
+
res += join16;
|
|
56745
56747
|
}
|
|
56746
56748
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
56747
56749
|
res += tmp !== void 0 ? tmp : "null";
|
|
56748
56750
|
if (value.length - 1 > maximumBreadth) {
|
|
56749
56751
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
56750
|
-
res += `${
|
|
56752
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
56751
56753
|
}
|
|
56752
56754
|
if (spacer !== "") {
|
|
56753
56755
|
res += `
|
|
@@ -56760,7 +56762,7 @@ ${originalIndentation}`;
|
|
|
56760
56762
|
let whitespace = "";
|
|
56761
56763
|
if (spacer !== "") {
|
|
56762
56764
|
indentation += spacer;
|
|
56763
|
-
|
|
56765
|
+
join16 = `,
|
|
56764
56766
|
${indentation}`;
|
|
56765
56767
|
whitespace = " ";
|
|
56766
56768
|
}
|
|
@@ -56769,7 +56771,7 @@ ${indentation}`;
|
|
|
56769
56771
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
56770
56772
|
if (tmp !== void 0) {
|
|
56771
56773
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
56772
|
-
separator =
|
|
56774
|
+
separator = join16;
|
|
56773
56775
|
}
|
|
56774
56776
|
}
|
|
56775
56777
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -56827,20 +56829,20 @@ ${originalIndentation}`;
|
|
|
56827
56829
|
indentation += spacer;
|
|
56828
56830
|
let res2 = `
|
|
56829
56831
|
${indentation}`;
|
|
56830
|
-
const
|
|
56832
|
+
const join17 = `,
|
|
56831
56833
|
${indentation}`;
|
|
56832
56834
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
56833
56835
|
let i = 0;
|
|
56834
56836
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
56835
56837
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
56836
56838
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
56837
|
-
res2 +=
|
|
56839
|
+
res2 += join17;
|
|
56838
56840
|
}
|
|
56839
56841
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
56840
56842
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
56841
56843
|
if (value.length - 1 > maximumBreadth) {
|
|
56842
56844
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
56843
|
-
res2 += `${
|
|
56845
|
+
res2 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
56844
56846
|
}
|
|
56845
56847
|
res2 += `
|
|
56846
56848
|
${originalIndentation}`;
|
|
@@ -56856,16 +56858,16 @@ ${originalIndentation}`;
|
|
|
56856
56858
|
return '"[Object]"';
|
|
56857
56859
|
}
|
|
56858
56860
|
indentation += spacer;
|
|
56859
|
-
const
|
|
56861
|
+
const join16 = `,
|
|
56860
56862
|
${indentation}`;
|
|
56861
56863
|
let res = "";
|
|
56862
56864
|
let separator = "";
|
|
56863
56865
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
56864
56866
|
if (isTypedArrayWithEntries(value)) {
|
|
56865
|
-
res += stringifyTypedArray(value,
|
|
56867
|
+
res += stringifyTypedArray(value, join16, maximumBreadth);
|
|
56866
56868
|
keys = keys.slice(value.length);
|
|
56867
56869
|
maximumPropertiesToStringify -= value.length;
|
|
56868
|
-
separator =
|
|
56870
|
+
separator = join16;
|
|
56869
56871
|
}
|
|
56870
56872
|
if (deterministic) {
|
|
56871
56873
|
keys = sort(keys, comparator);
|
|
@@ -56876,13 +56878,13 @@ ${indentation}`;
|
|
|
56876
56878
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
56877
56879
|
if (tmp !== void 0) {
|
|
56878
56880
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
56879
|
-
separator =
|
|
56881
|
+
separator = join16;
|
|
56880
56882
|
}
|
|
56881
56883
|
}
|
|
56882
56884
|
if (keyLength > maximumBreadth) {
|
|
56883
56885
|
const removedKeys = keyLength - maximumBreadth;
|
|
56884
56886
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
56885
|
-
separator =
|
|
56887
|
+
separator = join16;
|
|
56886
56888
|
}
|
|
56887
56889
|
if (separator !== "") {
|
|
56888
56890
|
res = `
|
|
@@ -59912,19 +59914,13 @@ var require_pino_pretty = __commonJS({
|
|
|
59912
59914
|
});
|
|
59913
59915
|
|
|
59914
59916
|
// packages/daemon/src/logging/logger.ts
|
|
59915
|
-
import { join as
|
|
59916
|
-
function
|
|
59917
|
-
return process.env.NODE_ENV !== "production" || process.env.LOG_LEVEL === "debug" || logLevel === "debug" || logLevel === "trace";
|
|
59918
|
-
}
|
|
59919
|
-
function createConsoleStream(logLevel) {
|
|
59920
|
-
if (!shouldPrettyPrint(logLevel)) {
|
|
59921
|
-
return import_pino.default.destination({ dest: 1, sync: false });
|
|
59922
|
-
}
|
|
59917
|
+
import { join as join5 } from "node:path";
|
|
59918
|
+
function createConsoleStream() {
|
|
59923
59919
|
return (0, import_pino_pretty.default)({
|
|
59924
|
-
colorize:
|
|
59920
|
+
colorize: process.stdout.isTTY ?? false,
|
|
59925
59921
|
translateTime: "SYS:standard",
|
|
59926
59922
|
ignore: "pid,hostname",
|
|
59927
|
-
singleLine:
|
|
59923
|
+
singleLine: true
|
|
59928
59924
|
});
|
|
59929
59925
|
}
|
|
59930
59926
|
function getRootLogger() {
|
|
@@ -59937,7 +59933,7 @@ function getRootLogger() {
|
|
|
59937
59933
|
return rootLogger;
|
|
59938
59934
|
}
|
|
59939
59935
|
function initLogger(config2) {
|
|
59940
|
-
const consoleStream = createConsoleStream(
|
|
59936
|
+
const consoleStream = createConsoleStream();
|
|
59941
59937
|
const fileStream = import_pino.default.destination({ dest: LOG_FILE_PATH, sync: false });
|
|
59942
59938
|
rootLogger = (0, import_pino.default)(
|
|
59943
59939
|
{
|
|
@@ -59959,7 +59955,7 @@ var init_logger = __esm({
|
|
|
59959
59955
|
init_paths();
|
|
59960
59956
|
import_pino = __toESM(require_pino(), 1);
|
|
59961
59957
|
import_pino_pretty = __toESM(require_pino_pretty(), 1);
|
|
59962
|
-
LOG_FILE_PATH =
|
|
59958
|
+
LOG_FILE_PATH = join5(LOGS_DIR, "io.log");
|
|
59963
59959
|
rootLogger = null;
|
|
59964
59960
|
}
|
|
59965
59961
|
});
|
|
@@ -63449,7 +63445,7 @@ var require_gray_matter = __commonJS({
|
|
|
63449
63445
|
|
|
63450
63446
|
// packages/daemon/src/wiki/wiki.ts
|
|
63451
63447
|
import { mkdir as mkdir6, readFile as readFile3, readdir as readdir2, rm as rm4, stat, writeFile as writeFile3 } from "node:fs/promises";
|
|
63452
|
-
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";
|
|
63453
63449
|
function getWikiPagesDir() {
|
|
63454
63450
|
return wikiDirectoryOverride ?? process.env.WIKI_DIR ?? WIKI_DIR;
|
|
63455
63451
|
}
|
|
@@ -63468,7 +63464,7 @@ async function collectDirectories(directory) {
|
|
|
63468
63464
|
const dirs = [];
|
|
63469
63465
|
for (const entry of entries) {
|
|
63470
63466
|
if (entry.isDirectory()) {
|
|
63471
|
-
const entryPath =
|
|
63467
|
+
const entryPath = join6(directory, entry.name);
|
|
63472
63468
|
dirs.push(entryPath);
|
|
63473
63469
|
dirs.push(...await collectDirectories(entryPath));
|
|
63474
63470
|
}
|
|
@@ -63549,7 +63545,7 @@ async function collectMarkdownFiles(directory) {
|
|
|
63549
63545
|
const entries = await readdir2(directory, { withFileTypes: true });
|
|
63550
63546
|
const files = [];
|
|
63551
63547
|
for (const entry of entries) {
|
|
63552
|
-
const entryPath =
|
|
63548
|
+
const entryPath = join6(directory, entry.name);
|
|
63553
63549
|
if (entry.isDirectory()) {
|
|
63554
63550
|
files.push(...await collectMarkdownFiles(entryPath));
|
|
63555
63551
|
continue;
|
|
@@ -67790,7 +67786,7 @@ var init_websocket = __esm({
|
|
|
67790
67786
|
// packages/daemon/src/api/server.ts
|
|
67791
67787
|
import { existsSync as existsSync2 } from "node:fs";
|
|
67792
67788
|
import { createServer } from "node:http";
|
|
67793
|
-
import { dirname as dirname4, join as
|
|
67789
|
+
import { dirname as dirname4, join as join7, resolve as resolve2 } from "node:path";
|
|
67794
67790
|
import { fileURLToPath } from "node:url";
|
|
67795
67791
|
function createApiServer(config2) {
|
|
67796
67792
|
const app = (0, import_express10.default)();
|
|
@@ -67835,7 +67831,7 @@ function createApiServer(config2) {
|
|
|
67835
67831
|
if (existsSync2(webDirectory)) {
|
|
67836
67832
|
app.use(import_express10.default.static(webDirectory));
|
|
67837
67833
|
app.use((_req, res) => {
|
|
67838
|
-
res.sendFile(
|
|
67834
|
+
res.sendFile(join7(webDirectory, "index.html"));
|
|
67839
67835
|
});
|
|
67840
67836
|
}
|
|
67841
67837
|
app.use((error51, _req, res, next) => {
|
|
@@ -68517,7 +68513,7 @@ var init_reset = __esm({
|
|
|
68517
68513
|
// packages/daemon/src/copilot/client.ts
|
|
68518
68514
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
68519
68515
|
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
68520
|
-
import { join as
|
|
68516
|
+
import { join as join8 } from "node:path";
|
|
68521
68517
|
import { CopilotClient } from "@github/copilot-sdk";
|
|
68522
68518
|
function readTokenFromEnvironment() {
|
|
68523
68519
|
const token = process.env.GITHUB_TOKEN?.trim();
|
|
@@ -68603,7 +68599,7 @@ var init_client = __esm({
|
|
|
68603
68599
|
"use strict";
|
|
68604
68600
|
init_paths();
|
|
68605
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.";
|
|
68606
|
-
COPILOT_BASE_DIRECTORY =
|
|
68602
|
+
COPILOT_BASE_DIRECTORY = join8(DATA_DIR, "copilot-sdk");
|
|
68607
68603
|
copilotClientSingleton = null;
|
|
68608
68604
|
copilotClientInitPromise = null;
|
|
68609
68605
|
}
|
|
@@ -68763,7 +68759,7 @@ var init_session = __esm({
|
|
|
68763
68759
|
|
|
68764
68760
|
// packages/daemon/src/skills/loader.ts
|
|
68765
68761
|
import { readFile as readFile4, readdir as readdir3 } from "node:fs/promises";
|
|
68766
|
-
import { basename as basename3, dirname as dirname5, join as
|
|
68762
|
+
import { basename as basename3, dirname as dirname5, join as join9 } from "node:path";
|
|
68767
68763
|
async function scanSkills() {
|
|
68768
68764
|
const skillFilePaths = await collectSkillFiles(SKILLS_DIR);
|
|
68769
68765
|
const skills = await Promise.all(skillFilePaths.map((filePath) => readSkillFromFile(filePath)));
|
|
@@ -68774,7 +68770,7 @@ async function collectSkillFiles(directory) {
|
|
|
68774
68770
|
const entries = await readdir3(directory, { withFileTypes: true });
|
|
68775
68771
|
const skillFiles = [];
|
|
68776
68772
|
for (const entry of entries) {
|
|
68777
|
-
const entryPath =
|
|
68773
|
+
const entryPath = join9(directory, entry.name);
|
|
68778
68774
|
if (entry.isDirectory()) {
|
|
68779
68775
|
skillFiles.push(...await collectSkillFiles(entryPath));
|
|
68780
68776
|
continue;
|
|
@@ -68818,7 +68814,7 @@ var init_loader = __esm({
|
|
|
68818
68814
|
|
|
68819
68815
|
// packages/daemon/src/skills/manager.ts
|
|
68820
68816
|
import { mkdir as mkdir7, readFile as readFile5, rm as rm5, writeFile as writeFile4 } from "node:fs/promises";
|
|
68821
|
-
import { basename as basename4, dirname as dirname6, join as
|
|
68817
|
+
import { basename as basename4, dirname as dirname6, join as join10 } from "node:path";
|
|
68822
68818
|
async function installSkill2(url2) {
|
|
68823
68819
|
const response = await fetch(url2);
|
|
68824
68820
|
if (!response.ok) {
|
|
@@ -68828,8 +68824,8 @@ async function installSkill2(url2) {
|
|
|
68828
68824
|
}
|
|
68829
68825
|
const skillMarkdown = await response.text();
|
|
68830
68826
|
const skillId = getSkillIdFromUrl(url2);
|
|
68831
|
-
const skillDirectory =
|
|
68832
|
-
const skillPath =
|
|
68827
|
+
const skillDirectory = join10(SKILLS_DIR, skillId);
|
|
68828
|
+
const skillPath = join10(skillDirectory, "SKILL.md");
|
|
68833
68829
|
const parsed = (0, import_gray_matter3.default)(skillMarkdown);
|
|
68834
68830
|
const installedSkill = {
|
|
68835
68831
|
id: skillId,
|
|
@@ -68843,7 +68839,7 @@ async function installSkill2(url2) {
|
|
|
68843
68839
|
return installedSkill;
|
|
68844
68840
|
}
|
|
68845
68841
|
async function removeSkill2(id) {
|
|
68846
|
-
await rm5(
|
|
68842
|
+
await rm5(join10(SKILLS_DIR, id), { recursive: true, force: true });
|
|
68847
68843
|
const lockFile = await readSkillsLock();
|
|
68848
68844
|
lockFile.skills = lockFile.skills.filter((skill) => skill.id !== id);
|
|
68849
68845
|
await writeSkillsLock2(lockFile);
|
|
@@ -69463,7 +69459,7 @@ var init_history = __esm({
|
|
|
69463
69459
|
// packages/daemon/src/execution/agent.ts
|
|
69464
69460
|
import { exec as exec3 } from "node:child_process";
|
|
69465
69461
|
import { mkdir as mkdir9, readFile as readFile7, readdir as readdir5, stat as stat3, writeFile as writeFile6 } from "node:fs/promises";
|
|
69466
|
-
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";
|
|
69467
69463
|
import { promisify as promisify3 } from "node:util";
|
|
69468
69464
|
import {
|
|
69469
69465
|
CopilotClient as CopilotClient2,
|
|
@@ -69532,7 +69528,7 @@ async function collectFiles(directory, recursive, output2) {
|
|
|
69532
69528
|
if (output2.length >= MAX_LIST_RESULTS) {
|
|
69533
69529
|
return;
|
|
69534
69530
|
}
|
|
69535
|
-
const fullPath =
|
|
69531
|
+
const fullPath = join11(directory, entry.name);
|
|
69536
69532
|
output2.push(fullPath);
|
|
69537
69533
|
if (recursive && entry.isDirectory()) {
|
|
69538
69534
|
await collectFiles(fullPath, recursive, output2);
|
|
@@ -69922,7 +69918,7 @@ Return strict JSON in this shape:
|
|
|
69922
69918
|
// packages/daemon/src/execution/planning.ts
|
|
69923
69919
|
import { exec as exec4 } from "node:child_process";
|
|
69924
69920
|
import { access, readFile as readFile8 } from "node:fs/promises";
|
|
69925
|
-
import { join as
|
|
69921
|
+
import { join as join12 } from "node:path";
|
|
69926
69922
|
import { promisify as promisify4 } from "node:util";
|
|
69927
69923
|
import { CopilotClient as CopilotClient3, approveAll as approveAll3 } from "@github/copilot-sdk";
|
|
69928
69924
|
async function fileExists(path) {
|
|
@@ -69935,7 +69931,7 @@ async function fileExists(path) {
|
|
|
69935
69931
|
}
|
|
69936
69932
|
async function buildRepoContext(repoPath) {
|
|
69937
69933
|
for (const candidate of README_CANDIDATES) {
|
|
69938
|
-
const readmePath =
|
|
69934
|
+
const readmePath = join12(repoPath, candidate);
|
|
69939
69935
|
if (await fileExists(readmePath)) {
|
|
69940
69936
|
const content = await readFile8(readmePath, "utf8");
|
|
69941
69937
|
return content.slice(0, MAX_REPO_CONTEXT_LENGTH);
|
|
@@ -70069,7 +70065,7 @@ var init_planning = __esm({
|
|
|
70069
70065
|
// packages/daemon/src/execution/pr.ts
|
|
70070
70066
|
import { exec as exec5 } from "node:child_process";
|
|
70071
70067
|
import { rm as rm6, writeFile as writeFile7 } from "node:fs/promises";
|
|
70072
|
-
import { join as
|
|
70068
|
+
import { join as join13 } from "node:path";
|
|
70073
70069
|
import { promisify as promisify5 } from "node:util";
|
|
70074
70070
|
async function runCommand(command, cwd) {
|
|
70075
70071
|
const { stdout } = await execAsync5(command, {
|
|
@@ -70083,7 +70079,7 @@ function extractUrl(output2) {
|
|
|
70083
70079
|
}
|
|
70084
70080
|
function buildBodyFilePath(repoPath, branchName) {
|
|
70085
70081
|
const safeBranchName = branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
70086
|
-
return
|
|
70082
|
+
return join13(repoPath, `.io-pr-body-${safeBranchName}.md`);
|
|
70087
70083
|
}
|
|
70088
70084
|
function buildPrBody(objective, plan, taskSummaries, qaOutcome) {
|
|
70089
70085
|
const tasks = taskSummaries.map((summary) => `- ${summary}`).join("\n") || "- No task summaries recorded.";
|
|
@@ -70416,7 +70412,7 @@ var init_tasks = __esm({
|
|
|
70416
70412
|
// packages/daemon/src/execution/runner.ts
|
|
70417
70413
|
import { exec as exec7 } from "node:child_process";
|
|
70418
70414
|
import { access as access2 } from "node:fs/promises";
|
|
70419
|
-
import { basename as basename5, join as
|
|
70415
|
+
import { basename as basename5, join as join14 } from "node:path";
|
|
70420
70416
|
import { promisify as promisify7 } from "node:util";
|
|
70421
70417
|
async function pathExists(path) {
|
|
70422
70418
|
try {
|
|
@@ -70436,16 +70432,16 @@ async function runGit2(command, cwd) {
|
|
|
70436
70432
|
async function resolveRepoPath(repoUrl, repoName) {
|
|
70437
70433
|
const urlSegments = repoUrl.replace(/\.git$/i, "").split("/").filter(Boolean);
|
|
70438
70434
|
const owner = urlSegments.at(-2) ?? "";
|
|
70439
|
-
const managedDir = owner && repoName ?
|
|
70435
|
+
const managedDir = owner && repoName ? join14(DATA_DIR, "repos", `${owner}--${repoName}`) : null;
|
|
70440
70436
|
const candidates = [
|
|
70441
70437
|
...managedDir ? [managedDir] : [],
|
|
70442
70438
|
process.cwd(),
|
|
70443
|
-
|
|
70444
|
-
|
|
70445
|
-
|
|
70439
|
+
join14(process.cwd(), repoName),
|
|
70440
|
+
join14(process.cwd(), "repos", repoName),
|
|
70441
|
+
join14(process.cwd(), "..", repoName)
|
|
70446
70442
|
];
|
|
70447
70443
|
for (const candidate of candidates) {
|
|
70448
|
-
if (!await pathExists(
|
|
70444
|
+
if (!await pathExists(join14(candidate, ".git"))) {
|
|
70449
70445
|
continue;
|
|
70450
70446
|
}
|
|
70451
70447
|
const remoteUrl = await runGit2("git remote get-url origin", candidate).catch(() => "");
|
|
@@ -70959,7 +70955,7 @@ var init_hiring = __esm({
|
|
|
70959
70955
|
// packages/daemon/src/orchestrator/tools/squad.ts
|
|
70960
70956
|
import { exec as exec8 } from "node:child_process";
|
|
70961
70957
|
import { mkdir as mkdir10, readFile as readFile9, readdir as readdir6, stat as stat4 } from "node:fs/promises";
|
|
70962
|
-
import { join as
|
|
70958
|
+
import { join as join15 } from "node:path";
|
|
70963
70959
|
import { promisify as promisify8 } from "node:util";
|
|
70964
70960
|
async function pathExists2(path) {
|
|
70965
70961
|
try {
|
|
@@ -70988,10 +70984,10 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
70988
70984
|
);
|
|
70989
70985
|
return lines.join("\n");
|
|
70990
70986
|
}
|
|
70991
|
-
const repoDir =
|
|
70987
|
+
const repoDir = join15(DATA_DIR, "repos", `${owner}--${name}`);
|
|
70992
70988
|
try {
|
|
70993
|
-
await mkdir10(
|
|
70994
|
-
if (await pathExists2(
|
|
70989
|
+
await mkdir10(join15(DATA_DIR, "repos"), { recursive: true });
|
|
70990
|
+
if (await pathExists2(join15(repoDir, ".git"))) {
|
|
70995
70991
|
await execAsync8("git pull --ff-only", { cwd: repoDir, timeout: 3e4 }).catch(
|
|
70996
70992
|
() => void 0
|
|
70997
70993
|
);
|
|
@@ -71028,7 +71024,7 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
71028
71024
|
".github/workflows"
|
|
71029
71025
|
];
|
|
71030
71026
|
for (const manifest of manifestFiles) {
|
|
71031
|
-
const fullPath =
|
|
71027
|
+
const fullPath = join15(repoDir, manifest);
|
|
71032
71028
|
try {
|
|
71033
71029
|
const fileStat = await stat4(fullPath);
|
|
71034
71030
|
if (fileStat.isFile()) {
|
|
@@ -71050,7 +71046,7 @@ ${children.join(", ")}`);
|
|
|
71050
71046
|
);
|
|
71051
71047
|
for (const srcDir of srcDirs) {
|
|
71052
71048
|
try {
|
|
71053
|
-
const srcEntries = await readdir6(
|
|
71049
|
+
const srcEntries = await readdir6(join15(repoDir, srcDir), { withFileTypes: true });
|
|
71054
71050
|
const srcFiles = srcEntries.filter((e) => e.isFile()).map((e) => e.name);
|
|
71055
71051
|
const srcSubDirs = srcEntries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
71056
71052
|
lines.push(`
|
|
@@ -71063,7 +71059,7 @@ ${children.join(", ")}`);
|
|
|
71063
71059
|
const readmeCandidates = ["README.md", "README.rst", "README.txt", "README"];
|
|
71064
71060
|
for (const readme of readmeCandidates) {
|
|
71065
71061
|
try {
|
|
71066
|
-
const content = await readFile9(
|
|
71062
|
+
const content = await readFile9(join15(repoDir, readme), "utf8");
|
|
71067
71063
|
lines.push(`
|
|
71068
71064
|
--- ${readme} (excerpt) ---
|
|
71069
71065
|
${content.slice(0, 1500)}`);
|