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/index.js
CHANGED
|
@@ -79,7 +79,7 @@ var init_constants = __esm({
|
|
|
79
79
|
"packages/shared/dist/constants.js"() {
|
|
80
80
|
"use strict";
|
|
81
81
|
APP_NAME = "io";
|
|
82
|
-
APP_VERSION = "4.1
|
|
82
|
+
APP_VERSION = "4.2.1";
|
|
83
83
|
API_PORT = 7777;
|
|
84
84
|
API_HOST = "0.0.0.0";
|
|
85
85
|
DEFAULT_MODEL = "gpt-4o";
|
|
@@ -28106,7 +28106,7 @@ var require_view = __commonJS({
|
|
|
28106
28106
|
var dirname9 = path.dirname;
|
|
28107
28107
|
var basename6 = path.basename;
|
|
28108
28108
|
var extname4 = path.extname;
|
|
28109
|
-
var
|
|
28109
|
+
var join16 = path.join;
|
|
28110
28110
|
var resolve5 = path.resolve;
|
|
28111
28111
|
module2.exports = View;
|
|
28112
28112
|
function View(name, options2) {
|
|
@@ -28168,12 +28168,12 @@ var require_view = __commonJS({
|
|
|
28168
28168
|
};
|
|
28169
28169
|
View.prototype.resolve = function resolve6(dir, file2) {
|
|
28170
28170
|
var ext = this.ext;
|
|
28171
|
-
var path2 =
|
|
28171
|
+
var path2 = join16(dir, file2);
|
|
28172
28172
|
var stat5 = tryStat(path2);
|
|
28173
28173
|
if (stat5 && stat5.isFile()) {
|
|
28174
28174
|
return path2;
|
|
28175
28175
|
}
|
|
28176
|
-
path2 =
|
|
28176
|
+
path2 = join16(dir, basename6(file2, ext), "index" + ext);
|
|
28177
28177
|
stat5 = tryStat(path2);
|
|
28178
28178
|
if (stat5 && stat5.isFile()) {
|
|
28179
28179
|
return path2;
|
|
@@ -31878,7 +31878,7 @@ var require_send = __commonJS({
|
|
|
31878
31878
|
var Stream = __require("stream");
|
|
31879
31879
|
var util = __require("util");
|
|
31880
31880
|
var extname4 = path.extname;
|
|
31881
|
-
var
|
|
31881
|
+
var join16 = path.join;
|
|
31882
31882
|
var normalize = path.normalize;
|
|
31883
31883
|
var resolve5 = path.resolve;
|
|
31884
31884
|
var sep = path.sep;
|
|
@@ -32050,7 +32050,7 @@ var require_send = __commonJS({
|
|
|
32050
32050
|
return res;
|
|
32051
32051
|
}
|
|
32052
32052
|
parts = path2.split(sep);
|
|
32053
|
-
path2 = normalize(
|
|
32053
|
+
path2 = normalize(join16(root, path2));
|
|
32054
32054
|
} else {
|
|
32055
32055
|
if (UP_PATH_REGEXP.test(path2)) {
|
|
32056
32056
|
debug('malicious path "%s"', path2);
|
|
@@ -32183,7 +32183,7 @@ var require_send = __commonJS({
|
|
|
32183
32183
|
if (err) return self.onStatError(err);
|
|
32184
32184
|
return self.error(404);
|
|
32185
32185
|
}
|
|
32186
|
-
var p =
|
|
32186
|
+
var p = join16(path2, self._index[i]);
|
|
32187
32187
|
debug('stat "%s"', p);
|
|
32188
32188
|
fs.stat(p, function(err2, stat5) {
|
|
32189
32189
|
if (err2) return next(err2);
|
|
@@ -50205,7 +50205,7 @@ var require_thread_stream = __commonJS({
|
|
|
50205
50205
|
var { version: version2 } = require_package();
|
|
50206
50206
|
var { EventEmitter: EventEmitter2 } = __require("events");
|
|
50207
50207
|
var { Worker } = __require("worker_threads");
|
|
50208
|
-
var { join:
|
|
50208
|
+
var { join: join16 } = __require("path");
|
|
50209
50209
|
var { pathToFileURL: pathToFileURL2 } = __require("url");
|
|
50210
50210
|
var { wait } = require_wait();
|
|
50211
50211
|
var {
|
|
@@ -50248,7 +50248,7 @@ var require_thread_stream = __commonJS({
|
|
|
50248
50248
|
function createWorker(stream, opts) {
|
|
50249
50249
|
const { filename, workerData } = opts;
|
|
50250
50250
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
50251
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
50251
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join16(__dirname, "lib", "worker.js");
|
|
50252
50252
|
const worker = new Worker(toExecute, {
|
|
50253
50253
|
...opts.workerOpts,
|
|
50254
50254
|
trackUnmanagedFds: false,
|
|
@@ -50651,7 +50651,7 @@ var require_transport = __commonJS({
|
|
|
50651
50651
|
"use strict";
|
|
50652
50652
|
var { createRequire } = __require("module");
|
|
50653
50653
|
var getCallers = require_caller();
|
|
50654
|
-
var { join:
|
|
50654
|
+
var { join: join16, isAbsolute: isAbsolute2, sep } = __require("node:path");
|
|
50655
50655
|
var sleep = require_atomic_sleep();
|
|
50656
50656
|
var onExit = require_on_exit_leak_free();
|
|
50657
50657
|
var ThreadStream = require_thread_stream();
|
|
@@ -50714,7 +50714,7 @@ var require_transport = __commonJS({
|
|
|
50714
50714
|
throw new Error("only one of target or targets can be specified");
|
|
50715
50715
|
}
|
|
50716
50716
|
if (targets) {
|
|
50717
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
50717
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
50718
50718
|
options2.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
50719
50719
|
return {
|
|
50720
50720
|
...dest,
|
|
@@ -50732,7 +50732,7 @@ var require_transport = __commonJS({
|
|
|
50732
50732
|
});
|
|
50733
50733
|
});
|
|
50734
50734
|
} else if (pipeline) {
|
|
50735
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
50735
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
50736
50736
|
options2.pipelines = [pipeline.map((dest) => {
|
|
50737
50737
|
return {
|
|
50738
50738
|
...dest,
|
|
@@ -50754,7 +50754,7 @@ var require_transport = __commonJS({
|
|
|
50754
50754
|
return origin;
|
|
50755
50755
|
}
|
|
50756
50756
|
if (origin === "pino/file") {
|
|
50757
|
-
return
|
|
50757
|
+
return join16(__dirname, "..", "file.js");
|
|
50758
50758
|
}
|
|
50759
50759
|
let fixTarget2;
|
|
50760
50760
|
for (const filePath of callers) {
|
|
@@ -51743,7 +51743,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
51743
51743
|
return circularValue;
|
|
51744
51744
|
}
|
|
51745
51745
|
let res = "";
|
|
51746
|
-
let
|
|
51746
|
+
let join16 = ",";
|
|
51747
51747
|
const originalIndentation = indentation;
|
|
51748
51748
|
if (Array.isArray(value)) {
|
|
51749
51749
|
if (value.length === 0) {
|
|
@@ -51757,7 +51757,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
51757
51757
|
indentation += spacer;
|
|
51758
51758
|
res += `
|
|
51759
51759
|
${indentation}`;
|
|
51760
|
-
|
|
51760
|
+
join16 = `,
|
|
51761
51761
|
${indentation}`;
|
|
51762
51762
|
}
|
|
51763
51763
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -51765,13 +51765,13 @@ ${indentation}`;
|
|
|
51765
51765
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
51766
51766
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
51767
51767
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
51768
|
-
res +=
|
|
51768
|
+
res += join16;
|
|
51769
51769
|
}
|
|
51770
51770
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
51771
51771
|
res += tmp !== void 0 ? tmp : "null";
|
|
51772
51772
|
if (value.length - 1 > maximumBreadth) {
|
|
51773
51773
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
51774
|
-
res += `${
|
|
51774
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
51775
51775
|
}
|
|
51776
51776
|
if (spacer !== "") {
|
|
51777
51777
|
res += `
|
|
@@ -51792,7 +51792,7 @@ ${originalIndentation}`;
|
|
|
51792
51792
|
let separator = "";
|
|
51793
51793
|
if (spacer !== "") {
|
|
51794
51794
|
indentation += spacer;
|
|
51795
|
-
|
|
51795
|
+
join16 = `,
|
|
51796
51796
|
${indentation}`;
|
|
51797
51797
|
whitespace = " ";
|
|
51798
51798
|
}
|
|
@@ -51806,13 +51806,13 @@ ${indentation}`;
|
|
|
51806
51806
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
51807
51807
|
if (tmp !== void 0) {
|
|
51808
51808
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
51809
|
-
separator =
|
|
51809
|
+
separator = join16;
|
|
51810
51810
|
}
|
|
51811
51811
|
}
|
|
51812
51812
|
if (keyLength > maximumBreadth) {
|
|
51813
51813
|
const removedKeys = keyLength - maximumBreadth;
|
|
51814
51814
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
51815
|
-
separator =
|
|
51815
|
+
separator = join16;
|
|
51816
51816
|
}
|
|
51817
51817
|
if (spacer !== "" && separator.length > 1) {
|
|
51818
51818
|
res = `
|
|
@@ -51853,7 +51853,7 @@ ${originalIndentation}`;
|
|
|
51853
51853
|
}
|
|
51854
51854
|
const originalIndentation = indentation;
|
|
51855
51855
|
let res = "";
|
|
51856
|
-
let
|
|
51856
|
+
let join16 = ",";
|
|
51857
51857
|
if (Array.isArray(value)) {
|
|
51858
51858
|
if (value.length === 0) {
|
|
51859
51859
|
return "[]";
|
|
@@ -51866,7 +51866,7 @@ ${originalIndentation}`;
|
|
|
51866
51866
|
indentation += spacer;
|
|
51867
51867
|
res += `
|
|
51868
51868
|
${indentation}`;
|
|
51869
|
-
|
|
51869
|
+
join16 = `,
|
|
51870
51870
|
${indentation}`;
|
|
51871
51871
|
}
|
|
51872
51872
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -51874,13 +51874,13 @@ ${indentation}`;
|
|
|
51874
51874
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
51875
51875
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
51876
51876
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
51877
|
-
res +=
|
|
51877
|
+
res += join16;
|
|
51878
51878
|
}
|
|
51879
51879
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
51880
51880
|
res += tmp !== void 0 ? tmp : "null";
|
|
51881
51881
|
if (value.length - 1 > maximumBreadth) {
|
|
51882
51882
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
51883
|
-
res += `${
|
|
51883
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
51884
51884
|
}
|
|
51885
51885
|
if (spacer !== "") {
|
|
51886
51886
|
res += `
|
|
@@ -51893,7 +51893,7 @@ ${originalIndentation}`;
|
|
|
51893
51893
|
let whitespace = "";
|
|
51894
51894
|
if (spacer !== "") {
|
|
51895
51895
|
indentation += spacer;
|
|
51896
|
-
|
|
51896
|
+
join16 = `,
|
|
51897
51897
|
${indentation}`;
|
|
51898
51898
|
whitespace = " ";
|
|
51899
51899
|
}
|
|
@@ -51902,7 +51902,7 @@ ${indentation}`;
|
|
|
51902
51902
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
51903
51903
|
if (tmp !== void 0) {
|
|
51904
51904
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
51905
|
-
separator =
|
|
51905
|
+
separator = join16;
|
|
51906
51906
|
}
|
|
51907
51907
|
}
|
|
51908
51908
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -51960,20 +51960,20 @@ ${originalIndentation}`;
|
|
|
51960
51960
|
indentation += spacer;
|
|
51961
51961
|
let res2 = `
|
|
51962
51962
|
${indentation}`;
|
|
51963
|
-
const
|
|
51963
|
+
const join17 = `,
|
|
51964
51964
|
${indentation}`;
|
|
51965
51965
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
51966
51966
|
let i = 0;
|
|
51967
51967
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
51968
51968
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
51969
51969
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
51970
|
-
res2 +=
|
|
51970
|
+
res2 += join17;
|
|
51971
51971
|
}
|
|
51972
51972
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
51973
51973
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
51974
51974
|
if (value.length - 1 > maximumBreadth) {
|
|
51975
51975
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
51976
|
-
res2 += `${
|
|
51976
|
+
res2 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
51977
51977
|
}
|
|
51978
51978
|
res2 += `
|
|
51979
51979
|
${originalIndentation}`;
|
|
@@ -51989,16 +51989,16 @@ ${originalIndentation}`;
|
|
|
51989
51989
|
return '"[Object]"';
|
|
51990
51990
|
}
|
|
51991
51991
|
indentation += spacer;
|
|
51992
|
-
const
|
|
51992
|
+
const join16 = `,
|
|
51993
51993
|
${indentation}`;
|
|
51994
51994
|
let res = "";
|
|
51995
51995
|
let separator = "";
|
|
51996
51996
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
51997
51997
|
if (isTypedArrayWithEntries(value)) {
|
|
51998
|
-
res += stringifyTypedArray(value,
|
|
51998
|
+
res += stringifyTypedArray(value, join16, maximumBreadth);
|
|
51999
51999
|
keys = keys.slice(value.length);
|
|
52000
52000
|
maximumPropertiesToStringify -= value.length;
|
|
52001
|
-
separator =
|
|
52001
|
+
separator = join16;
|
|
52002
52002
|
}
|
|
52003
52003
|
if (deterministic) {
|
|
52004
52004
|
keys = sort(keys, comparator);
|
|
@@ -52009,13 +52009,13 @@ ${indentation}`;
|
|
|
52009
52009
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
52010
52010
|
if (tmp !== void 0) {
|
|
52011
52011
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
52012
|
-
separator =
|
|
52012
|
+
separator = join16;
|
|
52013
52013
|
}
|
|
52014
52014
|
}
|
|
52015
52015
|
if (keyLength > maximumBreadth) {
|
|
52016
52016
|
const removedKeys = keyLength - maximumBreadth;
|
|
52017
52017
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
52018
|
-
separator =
|
|
52018
|
+
separator = join16;
|
|
52019
52019
|
}
|
|
52020
52020
|
if (separator !== "") {
|
|
52021
52021
|
res = `
|
|
@@ -77430,6 +77430,35 @@ async function getMembers(squadId, db) {
|
|
|
77430
77430
|
});
|
|
77431
77431
|
return result.rows.map((row) => mapMember(row));
|
|
77432
77432
|
}
|
|
77433
|
+
async function getMember(memberId, db) {
|
|
77434
|
+
const database = db ?? await getDatabase();
|
|
77435
|
+
const result = await database.execute({
|
|
77436
|
+
sql: "SELECT * FROM squad_members WHERE id = ? LIMIT 1",
|
|
77437
|
+
args: [memberId]
|
|
77438
|
+
});
|
|
77439
|
+
const row = result.rows[0];
|
|
77440
|
+
return row ? mapMember(row) : null;
|
|
77441
|
+
}
|
|
77442
|
+
async function updateMember(memberId, data, db) {
|
|
77443
|
+
const database = db ?? await getDatabase();
|
|
77444
|
+
const sets = [];
|
|
77445
|
+
const args = [];
|
|
77446
|
+
if (data.systemPrompt !== void 0) {
|
|
77447
|
+
sets.push("system_prompt = ?");
|
|
77448
|
+
args.push(data.systemPrompt);
|
|
77449
|
+
}
|
|
77450
|
+
if (data.model !== void 0) {
|
|
77451
|
+
sets.push("model = ?");
|
|
77452
|
+
args.push(data.model || null);
|
|
77453
|
+
}
|
|
77454
|
+
if (sets.length === 0) return getMember(memberId, database);
|
|
77455
|
+
args.push(memberId);
|
|
77456
|
+
await database.execute({
|
|
77457
|
+
sql: `UPDATE squad_members SET ${sets.join(", ")} WHERE id = ?`,
|
|
77458
|
+
args
|
|
77459
|
+
});
|
|
77460
|
+
return getMember(memberId, database);
|
|
77461
|
+
}
|
|
77433
77462
|
async function getSquadRow(id, db) {
|
|
77434
77463
|
const result = await db.execute({
|
|
77435
77464
|
sql: "SELECT * FROM squads WHERE id = ? LIMIT 1",
|
|
@@ -78853,12 +78882,17 @@ async function getSkillContent(skill) {
|
|
|
78853
78882
|
return "";
|
|
78854
78883
|
}
|
|
78855
78884
|
}
|
|
78885
|
+
function stripFrontmatter(content) {
|
|
78886
|
+
const match = content.match(/^---\s*\n[\s\S]*?\n---\s*\n([\s\S]*)$/);
|
|
78887
|
+
return match ? match[1] : content;
|
|
78888
|
+
}
|
|
78856
78889
|
function extractDescription(content) {
|
|
78857
|
-
const
|
|
78890
|
+
const body = stripFrontmatter(content);
|
|
78891
|
+
const lines = body.split("\n").filter((l) => l.trim() && !l.startsWith("#"));
|
|
78858
78892
|
return lines[0]?.trim().slice(0, 200) ?? "";
|
|
78859
78893
|
}
|
|
78860
78894
|
function extractPreview(content) {
|
|
78861
|
-
return content.slice(0, 300);
|
|
78895
|
+
return stripFrontmatter(content).slice(0, 300);
|
|
78862
78896
|
}
|
|
78863
78897
|
async function buildSkillSummaries(skills) {
|
|
78864
78898
|
return Promise.all(
|
|
@@ -79703,6 +79737,26 @@ router7.get("/api/squads/:id/members", async (req, res) => {
|
|
|
79703
79737
|
});
|
|
79704
79738
|
}
|
|
79705
79739
|
});
|
|
79740
|
+
router7.put("/api/squads/:id/members/:memberId", async (req, res) => {
|
|
79741
|
+
try {
|
|
79742
|
+
const member = await getMember(req.params.memberId);
|
|
79743
|
+
if (!member) {
|
|
79744
|
+
res.status(404).json({ error: "Member not found" });
|
|
79745
|
+
return;
|
|
79746
|
+
}
|
|
79747
|
+
const { systemPrompt, model } = req.body;
|
|
79748
|
+
const updated = await updateMember(member.id, {
|
|
79749
|
+
systemPrompt,
|
|
79750
|
+
model: model === "" ? null : model
|
|
79751
|
+
});
|
|
79752
|
+
res.status(200).json(updated);
|
|
79753
|
+
} catch (error51) {
|
|
79754
|
+
res.status(500).json({
|
|
79755
|
+
error: "Failed to update member",
|
|
79756
|
+
details: error51 instanceof Error ? error51.message : "Unknown error"
|
|
79757
|
+
});
|
|
79758
|
+
}
|
|
79759
|
+
});
|
|
79706
79760
|
router7.post("/api/squads/:id/objectives", async (req, res) => {
|
|
79707
79761
|
try {
|
|
79708
79762
|
const squad = await resolveSquad(req.params.id);
|
|
@@ -79971,18 +80025,12 @@ var import_pino_pretty = __toESM(require_pino_pretty(), 1);
|
|
|
79971
80025
|
import { join as join5 } from "node:path";
|
|
79972
80026
|
var LOG_FILE_PATH = join5(LOGS_DIR, "io.log");
|
|
79973
80027
|
var rootLogger = null;
|
|
79974
|
-
function
|
|
79975
|
-
return process.env.NODE_ENV !== "production" || process.env.LOG_LEVEL === "debug" || logLevel === "debug" || logLevel === "trace";
|
|
79976
|
-
}
|
|
79977
|
-
function createConsoleStream(logLevel) {
|
|
79978
|
-
if (!shouldPrettyPrint(logLevel)) {
|
|
79979
|
-
return import_pino.default.destination({ dest: 1, sync: false });
|
|
79980
|
-
}
|
|
80028
|
+
function createConsoleStream() {
|
|
79981
80029
|
return (0, import_pino_pretty.default)({
|
|
79982
|
-
colorize:
|
|
80030
|
+
colorize: process.stdout.isTTY ?? false,
|
|
79983
80031
|
translateTime: "SYS:standard",
|
|
79984
80032
|
ignore: "pid,hostname",
|
|
79985
|
-
singleLine:
|
|
80033
|
+
singleLine: true
|
|
79986
80034
|
});
|
|
79987
80035
|
}
|
|
79988
80036
|
function getRootLogger() {
|
|
@@ -79995,7 +80043,7 @@ function getRootLogger() {
|
|
|
79995
80043
|
return rootLogger;
|
|
79996
80044
|
}
|
|
79997
80045
|
function initLogger(config2) {
|
|
79998
|
-
const consoleStream = createConsoleStream(
|
|
80046
|
+
const consoleStream = createConsoleStream();
|
|
79999
80047
|
const fileStream = import_pino.default.destination({ dest: LOG_FILE_PATH, sync: false });
|
|
80000
80048
|
rootLogger = (0, import_pino.default)(
|
|
80001
80049
|
{
|
|
@@ -80717,10 +80765,8 @@ init_config();
|
|
|
80717
80765
|
// packages/daemon/src/data-dir.ts
|
|
80718
80766
|
init_paths();
|
|
80719
80767
|
import { mkdirSync } from "node:fs";
|
|
80720
|
-
import { join as join8 } from "node:path";
|
|
80721
|
-
var WIKI_PAGES_DIR = join8(WIKI_DIR, "pages");
|
|
80722
80768
|
function ensureDataDirectories() {
|
|
80723
|
-
for (const directory of [DATA_DIR, WIKI_DIR,
|
|
80769
|
+
for (const directory of [DATA_DIR, WIKI_DIR, SKILLS_DIR, LOGS_DIR]) {
|
|
80724
80770
|
mkdirSync(directory, { recursive: true });
|
|
80725
80771
|
}
|
|
80726
80772
|
}
|
|
@@ -81271,10 +81317,10 @@ import {
|
|
|
81271
81317
|
init_paths();
|
|
81272
81318
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
81273
81319
|
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
81274
|
-
import { join as
|
|
81320
|
+
import { join as join8 } from "node:path";
|
|
81275
81321
|
import { CopilotClient } from "@github/copilot-sdk";
|
|
81276
81322
|
var COPILOT_AUTH_ERROR_HINT = "Set GITHUB_TOKEN or authenticate with the GitHub CLI (`gh auth login`) so `gh auth token` returns a valid token.";
|
|
81277
|
-
var COPILOT_BASE_DIRECTORY =
|
|
81323
|
+
var COPILOT_BASE_DIRECTORY = join8(DATA_DIR, "copilot-sdk");
|
|
81278
81324
|
var copilotClientSingleton = null;
|
|
81279
81325
|
var copilotClientInitPromise = null;
|
|
81280
81326
|
function readTokenFromEnvironment() {
|
|
@@ -81502,7 +81548,7 @@ async function sendMessage(session, message2, onChunk) {
|
|
|
81502
81548
|
var import_gray_matter2 = __toESM(require_gray_matter(), 1);
|
|
81503
81549
|
init_paths();
|
|
81504
81550
|
import { readFile as readFile4, readdir as readdir3 } from "node:fs/promises";
|
|
81505
|
-
import { basename as basename3, dirname as dirname5, join as
|
|
81551
|
+
import { basename as basename3, dirname as dirname5, join as join9 } from "node:path";
|
|
81506
81552
|
async function scanSkills() {
|
|
81507
81553
|
const skillFilePaths = await collectSkillFiles(SKILLS_DIR);
|
|
81508
81554
|
const skills = await Promise.all(skillFilePaths.map((filePath) => readSkillFromFile(filePath)));
|
|
@@ -81513,7 +81559,7 @@ async function collectSkillFiles(directory) {
|
|
|
81513
81559
|
const entries = await readdir3(directory, { withFileTypes: true });
|
|
81514
81560
|
const skillFiles = [];
|
|
81515
81561
|
for (const entry of entries) {
|
|
81516
|
-
const entryPath =
|
|
81562
|
+
const entryPath = join9(directory, entry.name);
|
|
81517
81563
|
if (entry.isDirectory()) {
|
|
81518
81564
|
skillFiles.push(...await collectSkillFiles(entryPath));
|
|
81519
81565
|
continue;
|
|
@@ -81551,7 +81597,7 @@ function isMissingFileError4(error51) {
|
|
|
81551
81597
|
var import_gray_matter3 = __toESM(require_gray_matter(), 1);
|
|
81552
81598
|
init_paths();
|
|
81553
81599
|
import { mkdir as mkdir7, readFile as readFile5, rm as rm5, writeFile as writeFile4 } from "node:fs/promises";
|
|
81554
|
-
import { basename as basename4, dirname as dirname6, join as
|
|
81600
|
+
import { basename as basename4, dirname as dirname6, join as join10 } from "node:path";
|
|
81555
81601
|
async function installSkill2(url2) {
|
|
81556
81602
|
const response = await fetch(url2);
|
|
81557
81603
|
if (!response.ok) {
|
|
@@ -81561,8 +81607,8 @@ async function installSkill2(url2) {
|
|
|
81561
81607
|
}
|
|
81562
81608
|
const skillMarkdown = await response.text();
|
|
81563
81609
|
const skillId = getSkillIdFromUrl(url2);
|
|
81564
|
-
const skillDirectory =
|
|
81565
|
-
const skillPath =
|
|
81610
|
+
const skillDirectory = join10(SKILLS_DIR, skillId);
|
|
81611
|
+
const skillPath = join10(skillDirectory, "SKILL.md");
|
|
81566
81612
|
const parsed = (0, import_gray_matter3.default)(skillMarkdown);
|
|
81567
81613
|
const installedSkill = {
|
|
81568
81614
|
id: skillId,
|
|
@@ -81576,7 +81622,7 @@ async function installSkill2(url2) {
|
|
|
81576
81622
|
return installedSkill;
|
|
81577
81623
|
}
|
|
81578
81624
|
async function removeSkill2(id) {
|
|
81579
|
-
await rm5(
|
|
81625
|
+
await rm5(join10(SKILLS_DIR, id), { recursive: true, force: true });
|
|
81580
81626
|
const lockFile = await readSkillsLock();
|
|
81581
81627
|
lockFile.skills = lockFile.skills.filter((skill) => skill.id !== id);
|
|
81582
81628
|
await writeSkillsLock2(lockFile);
|
|
@@ -82081,7 +82127,7 @@ init_paths();
|
|
|
82081
82127
|
init_zod();
|
|
82082
82128
|
import { exec as exec8 } from "node:child_process";
|
|
82083
82129
|
import { mkdir as mkdir10, readFile as readFile9, readdir as readdir6, stat as stat4 } from "node:fs/promises";
|
|
82084
|
-
import { join as
|
|
82130
|
+
import { join as join15 } from "node:path";
|
|
82085
82131
|
import { promisify as promisify8 } from "node:util";
|
|
82086
82132
|
|
|
82087
82133
|
// packages/daemon/src/execution/runner.ts
|
|
@@ -82089,7 +82135,7 @@ init_dist();
|
|
|
82089
82135
|
init_paths();
|
|
82090
82136
|
import { exec as exec7 } from "node:child_process";
|
|
82091
82137
|
import { access as access2 } from "node:fs/promises";
|
|
82092
|
-
import { basename as basename5, join as
|
|
82138
|
+
import { basename as basename5, join as join14 } from "node:path";
|
|
82093
82139
|
import { promisify as promisify7 } from "node:util";
|
|
82094
82140
|
|
|
82095
82141
|
// packages/daemon/src/squad/manager.ts
|
|
@@ -82123,7 +82169,7 @@ async function isSquadAvailable(squadId) {
|
|
|
82123
82169
|
init_dist();
|
|
82124
82170
|
import { exec as exec3 } from "node:child_process";
|
|
82125
82171
|
import { mkdir as mkdir9, readFile as readFile7, readdir as readdir5, stat as stat3, writeFile as writeFile6 } from "node:fs/promises";
|
|
82126
|
-
import { dirname as dirname8, extname as extname3, isAbsolute, join as
|
|
82172
|
+
import { dirname as dirname8, extname as extname3, isAbsolute, join as join11, relative as relative3, resolve as resolve4 } from "node:path";
|
|
82127
82173
|
import { promisify as promisify3 } from "node:util";
|
|
82128
82174
|
import {
|
|
82129
82175
|
CopilotClient as CopilotClient2,
|
|
@@ -82222,7 +82268,7 @@ async function collectFiles(directory, recursive, output) {
|
|
|
82222
82268
|
if (output.length >= MAX_LIST_RESULTS) {
|
|
82223
82269
|
return;
|
|
82224
82270
|
}
|
|
82225
|
-
const fullPath =
|
|
82271
|
+
const fullPath = join11(directory, entry.name);
|
|
82226
82272
|
output.push(fullPath);
|
|
82227
82273
|
if (recursive && entry.isDirectory()) {
|
|
82228
82274
|
await collectFiles(fullPath, recursive, output);
|
|
@@ -82506,7 +82552,7 @@ async function buildInstanceSystemPromptSuffix(squadId, instanceId) {
|
|
|
82506
82552
|
init_dist();
|
|
82507
82553
|
import { exec as exec4 } from "node:child_process";
|
|
82508
82554
|
import { access, readFile as readFile8 } from "node:fs/promises";
|
|
82509
|
-
import { join as
|
|
82555
|
+
import { join as join12 } from "node:path";
|
|
82510
82556
|
import { promisify as promisify4 } from "node:util";
|
|
82511
82557
|
import { CopilotClient as CopilotClient3, approveAll as approveAll3 } from "@github/copilot-sdk";
|
|
82512
82558
|
|
|
@@ -82605,7 +82651,7 @@ async function fileExists(path) {
|
|
|
82605
82651
|
}
|
|
82606
82652
|
async function buildRepoContext(repoPath) {
|
|
82607
82653
|
for (const candidate of README_CANDIDATES) {
|
|
82608
|
-
const readmePath =
|
|
82654
|
+
const readmePath = join12(repoPath, candidate);
|
|
82609
82655
|
if (await fileExists(readmePath)) {
|
|
82610
82656
|
const content = await readFile8(readmePath, "utf8");
|
|
82611
82657
|
return content.slice(0, MAX_REPO_CONTEXT_LENGTH);
|
|
@@ -82728,7 +82774,7 @@ ${repoContext}`
|
|
|
82728
82774
|
// packages/daemon/src/execution/pr.ts
|
|
82729
82775
|
import { exec as exec5 } from "node:child_process";
|
|
82730
82776
|
import { rm as rm6, writeFile as writeFile7 } from "node:fs/promises";
|
|
82731
|
-
import { join as
|
|
82777
|
+
import { join as join13 } from "node:path";
|
|
82732
82778
|
import { promisify as promisify5 } from "node:util";
|
|
82733
82779
|
var execAsync5 = promisify5(exec5);
|
|
82734
82780
|
var URL_PATTERN = /https?:\/\/\S+/i;
|
|
@@ -82744,7 +82790,7 @@ function extractUrl(output) {
|
|
|
82744
82790
|
}
|
|
82745
82791
|
function buildBodyFilePath(repoPath, branchName) {
|
|
82746
82792
|
const safeBranchName = branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
82747
|
-
return
|
|
82793
|
+
return join13(repoPath, `.io-pr-body-${safeBranchName}.md`);
|
|
82748
82794
|
}
|
|
82749
82795
|
function buildPrBody(objective, plan, taskSummaries, qaOutcome) {
|
|
82750
82796
|
const tasks = taskSummaries.map((summary) => `- ${summary}`).join("\n") || "- No task summaries recorded.";
|
|
@@ -83064,16 +83110,16 @@ async function runGit2(command, cwd) {
|
|
|
83064
83110
|
async function resolveRepoPath(repoUrl, repoName) {
|
|
83065
83111
|
const urlSegments = repoUrl.replace(/\.git$/i, "").split("/").filter(Boolean);
|
|
83066
83112
|
const owner = urlSegments.at(-2) ?? "";
|
|
83067
|
-
const managedDir = owner && repoName ?
|
|
83113
|
+
const managedDir = owner && repoName ? join14(DATA_DIR, "repos", `${owner}--${repoName}`) : null;
|
|
83068
83114
|
const candidates = [
|
|
83069
83115
|
...managedDir ? [managedDir] : [],
|
|
83070
83116
|
process.cwd(),
|
|
83071
|
-
|
|
83072
|
-
|
|
83073
|
-
|
|
83117
|
+
join14(process.cwd(), repoName),
|
|
83118
|
+
join14(process.cwd(), "repos", repoName),
|
|
83119
|
+
join14(process.cwd(), "..", repoName)
|
|
83074
83120
|
];
|
|
83075
83121
|
for (const candidate of candidates) {
|
|
83076
|
-
if (!await pathExists(
|
|
83122
|
+
if (!await pathExists(join14(candidate, ".git"))) {
|
|
83077
83123
|
continue;
|
|
83078
83124
|
}
|
|
83079
83125
|
const remoteUrl = await runGit2("git remote get-url origin", candidate).catch(() => "");
|
|
@@ -83626,10 +83672,10 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
83626
83672
|
);
|
|
83627
83673
|
return lines.join("\n");
|
|
83628
83674
|
}
|
|
83629
|
-
const repoDir =
|
|
83675
|
+
const repoDir = join15(DATA_DIR, "repos", `${owner}--${name}`);
|
|
83630
83676
|
try {
|
|
83631
|
-
await mkdir10(
|
|
83632
|
-
if (await pathExists2(
|
|
83677
|
+
await mkdir10(join15(DATA_DIR, "repos"), { recursive: true });
|
|
83678
|
+
if (await pathExists2(join15(repoDir, ".git"))) {
|
|
83633
83679
|
await execAsync8("git pull --ff-only", { cwd: repoDir, timeout: 3e4 }).catch(
|
|
83634
83680
|
() => void 0
|
|
83635
83681
|
);
|
|
@@ -83666,7 +83712,7 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
83666
83712
|
".github/workflows"
|
|
83667
83713
|
];
|
|
83668
83714
|
for (const manifest of manifestFiles) {
|
|
83669
|
-
const fullPath =
|
|
83715
|
+
const fullPath = join15(repoDir, manifest);
|
|
83670
83716
|
try {
|
|
83671
83717
|
const fileStat = await stat4(fullPath);
|
|
83672
83718
|
if (fileStat.isFile()) {
|
|
@@ -83688,7 +83734,7 @@ ${children.join(", ")}`);
|
|
|
83688
83734
|
);
|
|
83689
83735
|
for (const srcDir of srcDirs) {
|
|
83690
83736
|
try {
|
|
83691
|
-
const srcEntries = await readdir6(
|
|
83737
|
+
const srcEntries = await readdir6(join15(repoDir, srcDir), { withFileTypes: true });
|
|
83692
83738
|
const srcFiles = srcEntries.filter((e) => e.isFile()).map((e) => e.name);
|
|
83693
83739
|
const srcSubDirs = srcEntries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
83694
83740
|
lines.push(`
|
|
@@ -83701,7 +83747,7 @@ ${children.join(", ")}`);
|
|
|
83701
83747
|
const readmeCandidates = ["README.md", "README.rst", "README.txt", "README"];
|
|
83702
83748
|
for (const readme of readmeCandidates) {
|
|
83703
83749
|
try {
|
|
83704
|
-
const content = await readFile9(
|
|
83750
|
+
const content = await readFile9(join15(repoDir, readme), "utf8");
|
|
83705
83751
|
lines.push(`
|
|
83706
83752
|
--- ${readme} (excerpt) ---
|
|
83707
83753
|
${content.slice(0, 1500)}`);
|