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/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.2.
|
|
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 = `
|
|
@@ -78882,12 +78882,17 @@ async function getSkillContent(skill) {
|
|
|
78882
78882
|
return "";
|
|
78883
78883
|
}
|
|
78884
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
|
+
}
|
|
78885
78889
|
function extractDescription(content) {
|
|
78886
|
-
const
|
|
78890
|
+
const body = stripFrontmatter(content);
|
|
78891
|
+
const lines = body.split("\n").filter((l) => l.trim() && !l.startsWith("#"));
|
|
78887
78892
|
return lines[0]?.trim().slice(0, 200) ?? "";
|
|
78888
78893
|
}
|
|
78889
78894
|
function extractPreview(content) {
|
|
78890
|
-
return content.slice(0, 300);
|
|
78895
|
+
return stripFrontmatter(content).slice(0, 300);
|
|
78891
78896
|
}
|
|
78892
78897
|
async function buildSkillSummaries(skills) {
|
|
78893
78898
|
return Promise.all(
|
|
@@ -80020,18 +80025,12 @@ var import_pino_pretty = __toESM(require_pino_pretty(), 1);
|
|
|
80020
80025
|
import { join as join5 } from "node:path";
|
|
80021
80026
|
var LOG_FILE_PATH = join5(LOGS_DIR, "io.log");
|
|
80022
80027
|
var rootLogger = null;
|
|
80023
|
-
function
|
|
80024
|
-
return process.env.NODE_ENV !== "production" || process.env.LOG_LEVEL === "debug" || logLevel === "debug" || logLevel === "trace";
|
|
80025
|
-
}
|
|
80026
|
-
function createConsoleStream(logLevel) {
|
|
80027
|
-
if (!shouldPrettyPrint(logLevel)) {
|
|
80028
|
-
return import_pino.default.destination({ dest: 1, sync: false });
|
|
80029
|
-
}
|
|
80028
|
+
function createConsoleStream() {
|
|
80030
80029
|
return (0, import_pino_pretty.default)({
|
|
80031
|
-
colorize:
|
|
80030
|
+
colorize: process.stdout.isTTY ?? false,
|
|
80032
80031
|
translateTime: "SYS:standard",
|
|
80033
80032
|
ignore: "pid,hostname",
|
|
80034
|
-
singleLine:
|
|
80033
|
+
singleLine: true
|
|
80035
80034
|
});
|
|
80036
80035
|
}
|
|
80037
80036
|
function getRootLogger() {
|
|
@@ -80044,7 +80043,7 @@ function getRootLogger() {
|
|
|
80044
80043
|
return rootLogger;
|
|
80045
80044
|
}
|
|
80046
80045
|
function initLogger(config2) {
|
|
80047
|
-
const consoleStream = createConsoleStream(
|
|
80046
|
+
const consoleStream = createConsoleStream();
|
|
80048
80047
|
const fileStream = import_pino.default.destination({ dest: LOG_FILE_PATH, sync: false });
|
|
80049
80048
|
rootLogger = (0, import_pino.default)(
|
|
80050
80049
|
{
|
|
@@ -80766,10 +80765,8 @@ init_config();
|
|
|
80766
80765
|
// packages/daemon/src/data-dir.ts
|
|
80767
80766
|
init_paths();
|
|
80768
80767
|
import { mkdirSync } from "node:fs";
|
|
80769
|
-
import { join as join8 } from "node:path";
|
|
80770
|
-
var WIKI_PAGES_DIR = join8(WIKI_DIR, "pages");
|
|
80771
80768
|
function ensureDataDirectories() {
|
|
80772
|
-
for (const directory of [DATA_DIR, WIKI_DIR,
|
|
80769
|
+
for (const directory of [DATA_DIR, WIKI_DIR, SKILLS_DIR, LOGS_DIR]) {
|
|
80773
80770
|
mkdirSync(directory, { recursive: true });
|
|
80774
80771
|
}
|
|
80775
80772
|
}
|
|
@@ -81320,10 +81317,10 @@ import {
|
|
|
81320
81317
|
init_paths();
|
|
81321
81318
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
81322
81319
|
import { mkdirSync as mkdirSync2 } from "node:fs";
|
|
81323
|
-
import { join as
|
|
81320
|
+
import { join as join8 } from "node:path";
|
|
81324
81321
|
import { CopilotClient } from "@github/copilot-sdk";
|
|
81325
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.";
|
|
81326
|
-
var COPILOT_BASE_DIRECTORY =
|
|
81323
|
+
var COPILOT_BASE_DIRECTORY = join8(DATA_DIR, "copilot-sdk");
|
|
81327
81324
|
var copilotClientSingleton = null;
|
|
81328
81325
|
var copilotClientInitPromise = null;
|
|
81329
81326
|
function readTokenFromEnvironment() {
|
|
@@ -81551,7 +81548,7 @@ async function sendMessage(session, message2, onChunk) {
|
|
|
81551
81548
|
var import_gray_matter2 = __toESM(require_gray_matter(), 1);
|
|
81552
81549
|
init_paths();
|
|
81553
81550
|
import { readFile as readFile4, readdir as readdir3 } from "node:fs/promises";
|
|
81554
|
-
import { basename as basename3, dirname as dirname5, join as
|
|
81551
|
+
import { basename as basename3, dirname as dirname5, join as join9 } from "node:path";
|
|
81555
81552
|
async function scanSkills() {
|
|
81556
81553
|
const skillFilePaths = await collectSkillFiles(SKILLS_DIR);
|
|
81557
81554
|
const skills = await Promise.all(skillFilePaths.map((filePath) => readSkillFromFile(filePath)));
|
|
@@ -81562,7 +81559,7 @@ async function collectSkillFiles(directory) {
|
|
|
81562
81559
|
const entries = await readdir3(directory, { withFileTypes: true });
|
|
81563
81560
|
const skillFiles = [];
|
|
81564
81561
|
for (const entry of entries) {
|
|
81565
|
-
const entryPath =
|
|
81562
|
+
const entryPath = join9(directory, entry.name);
|
|
81566
81563
|
if (entry.isDirectory()) {
|
|
81567
81564
|
skillFiles.push(...await collectSkillFiles(entryPath));
|
|
81568
81565
|
continue;
|
|
@@ -81600,7 +81597,7 @@ function isMissingFileError4(error51) {
|
|
|
81600
81597
|
var import_gray_matter3 = __toESM(require_gray_matter(), 1);
|
|
81601
81598
|
init_paths();
|
|
81602
81599
|
import { mkdir as mkdir7, readFile as readFile5, rm as rm5, writeFile as writeFile4 } from "node:fs/promises";
|
|
81603
|
-
import { basename as basename4, dirname as dirname6, join as
|
|
81600
|
+
import { basename as basename4, dirname as dirname6, join as join10 } from "node:path";
|
|
81604
81601
|
async function installSkill2(url2) {
|
|
81605
81602
|
const response = await fetch(url2);
|
|
81606
81603
|
if (!response.ok) {
|
|
@@ -81610,8 +81607,8 @@ async function installSkill2(url2) {
|
|
|
81610
81607
|
}
|
|
81611
81608
|
const skillMarkdown = await response.text();
|
|
81612
81609
|
const skillId = getSkillIdFromUrl(url2);
|
|
81613
|
-
const skillDirectory =
|
|
81614
|
-
const skillPath =
|
|
81610
|
+
const skillDirectory = join10(SKILLS_DIR, skillId);
|
|
81611
|
+
const skillPath = join10(skillDirectory, "SKILL.md");
|
|
81615
81612
|
const parsed = (0, import_gray_matter3.default)(skillMarkdown);
|
|
81616
81613
|
const installedSkill = {
|
|
81617
81614
|
id: skillId,
|
|
@@ -81625,7 +81622,7 @@ async function installSkill2(url2) {
|
|
|
81625
81622
|
return installedSkill;
|
|
81626
81623
|
}
|
|
81627
81624
|
async function removeSkill2(id) {
|
|
81628
|
-
await rm5(
|
|
81625
|
+
await rm5(join10(SKILLS_DIR, id), { recursive: true, force: true });
|
|
81629
81626
|
const lockFile = await readSkillsLock();
|
|
81630
81627
|
lockFile.skills = lockFile.skills.filter((skill) => skill.id !== id);
|
|
81631
81628
|
await writeSkillsLock2(lockFile);
|
|
@@ -82130,7 +82127,7 @@ init_paths();
|
|
|
82130
82127
|
init_zod();
|
|
82131
82128
|
import { exec as exec8 } from "node:child_process";
|
|
82132
82129
|
import { mkdir as mkdir10, readFile as readFile9, readdir as readdir6, stat as stat4 } from "node:fs/promises";
|
|
82133
|
-
import { join as
|
|
82130
|
+
import { join as join15 } from "node:path";
|
|
82134
82131
|
import { promisify as promisify8 } from "node:util";
|
|
82135
82132
|
|
|
82136
82133
|
// packages/daemon/src/execution/runner.ts
|
|
@@ -82138,7 +82135,7 @@ init_dist();
|
|
|
82138
82135
|
init_paths();
|
|
82139
82136
|
import { exec as exec7 } from "node:child_process";
|
|
82140
82137
|
import { access as access2 } from "node:fs/promises";
|
|
82141
|
-
import { basename as basename5, join as
|
|
82138
|
+
import { basename as basename5, join as join14 } from "node:path";
|
|
82142
82139
|
import { promisify as promisify7 } from "node:util";
|
|
82143
82140
|
|
|
82144
82141
|
// packages/daemon/src/squad/manager.ts
|
|
@@ -82172,7 +82169,7 @@ async function isSquadAvailable(squadId) {
|
|
|
82172
82169
|
init_dist();
|
|
82173
82170
|
import { exec as exec3 } from "node:child_process";
|
|
82174
82171
|
import { mkdir as mkdir9, readFile as readFile7, readdir as readdir5, stat as stat3, writeFile as writeFile6 } from "node:fs/promises";
|
|
82175
|
-
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";
|
|
82176
82173
|
import { promisify as promisify3 } from "node:util";
|
|
82177
82174
|
import {
|
|
82178
82175
|
CopilotClient as CopilotClient2,
|
|
@@ -82271,7 +82268,7 @@ async function collectFiles(directory, recursive, output) {
|
|
|
82271
82268
|
if (output.length >= MAX_LIST_RESULTS) {
|
|
82272
82269
|
return;
|
|
82273
82270
|
}
|
|
82274
|
-
const fullPath =
|
|
82271
|
+
const fullPath = join11(directory, entry.name);
|
|
82275
82272
|
output.push(fullPath);
|
|
82276
82273
|
if (recursive && entry.isDirectory()) {
|
|
82277
82274
|
await collectFiles(fullPath, recursive, output);
|
|
@@ -82555,7 +82552,7 @@ async function buildInstanceSystemPromptSuffix(squadId, instanceId) {
|
|
|
82555
82552
|
init_dist();
|
|
82556
82553
|
import { exec as exec4 } from "node:child_process";
|
|
82557
82554
|
import { access, readFile as readFile8 } from "node:fs/promises";
|
|
82558
|
-
import { join as
|
|
82555
|
+
import { join as join12 } from "node:path";
|
|
82559
82556
|
import { promisify as promisify4 } from "node:util";
|
|
82560
82557
|
import { CopilotClient as CopilotClient3, approveAll as approveAll3 } from "@github/copilot-sdk";
|
|
82561
82558
|
|
|
@@ -82654,7 +82651,7 @@ async function fileExists(path) {
|
|
|
82654
82651
|
}
|
|
82655
82652
|
async function buildRepoContext(repoPath) {
|
|
82656
82653
|
for (const candidate of README_CANDIDATES) {
|
|
82657
|
-
const readmePath =
|
|
82654
|
+
const readmePath = join12(repoPath, candidate);
|
|
82658
82655
|
if (await fileExists(readmePath)) {
|
|
82659
82656
|
const content = await readFile8(readmePath, "utf8");
|
|
82660
82657
|
return content.slice(0, MAX_REPO_CONTEXT_LENGTH);
|
|
@@ -82777,7 +82774,7 @@ ${repoContext}`
|
|
|
82777
82774
|
// packages/daemon/src/execution/pr.ts
|
|
82778
82775
|
import { exec as exec5 } from "node:child_process";
|
|
82779
82776
|
import { rm as rm6, writeFile as writeFile7 } from "node:fs/promises";
|
|
82780
|
-
import { join as
|
|
82777
|
+
import { join as join13 } from "node:path";
|
|
82781
82778
|
import { promisify as promisify5 } from "node:util";
|
|
82782
82779
|
var execAsync5 = promisify5(exec5);
|
|
82783
82780
|
var URL_PATTERN = /https?:\/\/\S+/i;
|
|
@@ -82793,7 +82790,7 @@ function extractUrl(output) {
|
|
|
82793
82790
|
}
|
|
82794
82791
|
function buildBodyFilePath(repoPath, branchName) {
|
|
82795
82792
|
const safeBranchName = branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
82796
|
-
return
|
|
82793
|
+
return join13(repoPath, `.io-pr-body-${safeBranchName}.md`);
|
|
82797
82794
|
}
|
|
82798
82795
|
function buildPrBody(objective, plan, taskSummaries, qaOutcome) {
|
|
82799
82796
|
const tasks = taskSummaries.map((summary) => `- ${summary}`).join("\n") || "- No task summaries recorded.";
|
|
@@ -83113,16 +83110,16 @@ async function runGit2(command, cwd) {
|
|
|
83113
83110
|
async function resolveRepoPath(repoUrl, repoName) {
|
|
83114
83111
|
const urlSegments = repoUrl.replace(/\.git$/i, "").split("/").filter(Boolean);
|
|
83115
83112
|
const owner = urlSegments.at(-2) ?? "";
|
|
83116
|
-
const managedDir = owner && repoName ?
|
|
83113
|
+
const managedDir = owner && repoName ? join14(DATA_DIR, "repos", `${owner}--${repoName}`) : null;
|
|
83117
83114
|
const candidates = [
|
|
83118
83115
|
...managedDir ? [managedDir] : [],
|
|
83119
83116
|
process.cwd(),
|
|
83120
|
-
|
|
83121
|
-
|
|
83122
|
-
|
|
83117
|
+
join14(process.cwd(), repoName),
|
|
83118
|
+
join14(process.cwd(), "repos", repoName),
|
|
83119
|
+
join14(process.cwd(), "..", repoName)
|
|
83123
83120
|
];
|
|
83124
83121
|
for (const candidate of candidates) {
|
|
83125
|
-
if (!await pathExists(
|
|
83122
|
+
if (!await pathExists(join14(candidate, ".git"))) {
|
|
83126
83123
|
continue;
|
|
83127
83124
|
}
|
|
83128
83125
|
const remoteUrl = await runGit2("git remote get-url origin", candidate).catch(() => "");
|
|
@@ -83675,10 +83672,10 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
83675
83672
|
);
|
|
83676
83673
|
return lines.join("\n");
|
|
83677
83674
|
}
|
|
83678
|
-
const repoDir =
|
|
83675
|
+
const repoDir = join15(DATA_DIR, "repos", `${owner}--${name}`);
|
|
83679
83676
|
try {
|
|
83680
|
-
await mkdir10(
|
|
83681
|
-
if (await pathExists2(
|
|
83677
|
+
await mkdir10(join15(DATA_DIR, "repos"), { recursive: true });
|
|
83678
|
+
if (await pathExists2(join15(repoDir, ".git"))) {
|
|
83682
83679
|
await execAsync8("git pull --ff-only", { cwd: repoDir, timeout: 3e4 }).catch(
|
|
83683
83680
|
() => void 0
|
|
83684
83681
|
);
|
|
@@ -83715,7 +83712,7 @@ async function buildRepoAnalysis(repoUrl) {
|
|
|
83715
83712
|
".github/workflows"
|
|
83716
83713
|
];
|
|
83717
83714
|
for (const manifest of manifestFiles) {
|
|
83718
|
-
const fullPath =
|
|
83715
|
+
const fullPath = join15(repoDir, manifest);
|
|
83719
83716
|
try {
|
|
83720
83717
|
const fileStat = await stat4(fullPath);
|
|
83721
83718
|
if (fileStat.isFile()) {
|
|
@@ -83737,7 +83734,7 @@ ${children.join(", ")}`);
|
|
|
83737
83734
|
);
|
|
83738
83735
|
for (const srcDir of srcDirs) {
|
|
83739
83736
|
try {
|
|
83740
|
-
const srcEntries = await readdir6(
|
|
83737
|
+
const srcEntries = await readdir6(join15(repoDir, srcDir), { withFileTypes: true });
|
|
83741
83738
|
const srcFiles = srcEntries.filter((e) => e.isFile()).map((e) => e.name);
|
|
83742
83739
|
const srcSubDirs = srcEntries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
83743
83740
|
lines.push(`
|
|
@@ -83750,7 +83747,7 @@ ${children.join(", ")}`);
|
|
|
83750
83747
|
const readmeCandidates = ["README.md", "README.rst", "README.txt", "README"];
|
|
83751
83748
|
for (const readme of readmeCandidates) {
|
|
83752
83749
|
try {
|
|
83753
|
-
const content = await readFile9(
|
|
83750
|
+
const content = await readFile9(join15(repoDir, readme), "utf8");
|
|
83754
83751
|
lines.push(`
|
|
83755
83752
|
--- ${readme} (excerpt) ---
|
|
83756
83753
|
${content.slice(0, 1500)}`);
|