heyio 4.2.0 → 4.2.2

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.
@@ -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.0";
82
+ APP_VERSION = "4.2.2";
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 join17 = path.join;
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 = join17(dir, file2);
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 = join17(dir, basename6(file2, ext), "index" + ext);
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 join17 = path.join;
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(join17(root, path2));
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 = join17(path2, self._index[i]);
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: join17 } = __require("path");
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"] || join17(__dirname, "lib", "worker.js");
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: join17, isAbsolute: isAbsolute2, sep } = __require("node:path");
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"] || join17(__dirname, "worker.js");
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"] || join17(__dirname, "worker.js");
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 join17(__dirname, "..", "file.js");
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 join17 = ",";
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
- join17 = `,
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 += join17;
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 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
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
- join17 = `,
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 = join17;
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 = join17;
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 join17 = ",";
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
- join17 = `,
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 += join17;
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 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
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
- join17 = `,
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 = join17;
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 join18 = `,
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 += join18;
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 += `${join18}"... ${getItemCount(removedKeys)} not stringified"`;
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 join17 = `,
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, join17, maximumBreadth);
51998
+ res += stringifyTypedArray(value, join16, maximumBreadth);
51999
51999
  keys = keys.slice(value.length);
52000
52000
  maximumPropertiesToStringify -= value.length;
52001
- separator = join17;
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 = join17;
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 = join17;
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 lines = content.split("\n").filter((l) => l.trim() && !l.startsWith("#"));
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,11 @@ 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 shouldPrettyPrint(logLevel) {
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: true,
80032
- translateTime: "SYS:standard",
80033
- ignore: "pid,hostname",
80034
- singleLine: false
80030
+ colorize: process.stdout.isTTY ?? false,
80031
+ ignore: "pid,hostname,name,time",
80032
+ singleLine: true
80035
80033
  });
80036
80034
  }
80037
80035
  function getRootLogger() {
@@ -80044,7 +80042,7 @@ function getRootLogger() {
80044
80042
  return rootLogger;
80045
80043
  }
80046
80044
  function initLogger(config2) {
80047
- const consoleStream = createConsoleStream(config2.logLevel);
80045
+ const consoleStream = createConsoleStream();
80048
80046
  const fileStream = import_pino.default.destination({ dest: LOG_FILE_PATH, sync: false });
80049
80047
  rootLogger = (0, import_pino.default)(
80050
80048
  {
@@ -80766,10 +80764,8 @@ init_config();
80766
80764
  // packages/daemon/src/data-dir.ts
80767
80765
  init_paths();
80768
80766
  import { mkdirSync } from "node:fs";
80769
- import { join as join8 } from "node:path";
80770
- var WIKI_PAGES_DIR = join8(WIKI_DIR, "pages");
80771
80767
  function ensureDataDirectories() {
80772
- for (const directory of [DATA_DIR, WIKI_DIR, WIKI_PAGES_DIR, SKILLS_DIR, LOGS_DIR]) {
80768
+ for (const directory of [DATA_DIR, WIKI_DIR, SKILLS_DIR, LOGS_DIR]) {
80773
80769
  mkdirSync(directory, { recursive: true });
80774
80770
  }
80775
80771
  }
@@ -81320,10 +81316,10 @@ import {
81320
81316
  init_paths();
81321
81317
  import { execFileSync as execFileSync2 } from "node:child_process";
81322
81318
  import { mkdirSync as mkdirSync2 } from "node:fs";
81323
- import { join as join9 } from "node:path";
81319
+ import { join as join8 } from "node:path";
81324
81320
  import { CopilotClient } from "@github/copilot-sdk";
81325
81321
  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 = join9(DATA_DIR, "copilot-sdk");
81322
+ var COPILOT_BASE_DIRECTORY = join8(DATA_DIR, "copilot-sdk");
81327
81323
  var copilotClientSingleton = null;
81328
81324
  var copilotClientInitPromise = null;
81329
81325
  function readTokenFromEnvironment() {
@@ -81551,7 +81547,7 @@ async function sendMessage(session, message2, onChunk) {
81551
81547
  var import_gray_matter2 = __toESM(require_gray_matter(), 1);
81552
81548
  init_paths();
81553
81549
  import { readFile as readFile4, readdir as readdir3 } from "node:fs/promises";
81554
- import { basename as basename3, dirname as dirname5, join as join10 } from "node:path";
81550
+ import { basename as basename3, dirname as dirname5, join as join9 } from "node:path";
81555
81551
  async function scanSkills() {
81556
81552
  const skillFilePaths = await collectSkillFiles(SKILLS_DIR);
81557
81553
  const skills = await Promise.all(skillFilePaths.map((filePath) => readSkillFromFile(filePath)));
@@ -81562,7 +81558,7 @@ async function collectSkillFiles(directory) {
81562
81558
  const entries = await readdir3(directory, { withFileTypes: true });
81563
81559
  const skillFiles = [];
81564
81560
  for (const entry of entries) {
81565
- const entryPath = join10(directory, entry.name);
81561
+ const entryPath = join9(directory, entry.name);
81566
81562
  if (entry.isDirectory()) {
81567
81563
  skillFiles.push(...await collectSkillFiles(entryPath));
81568
81564
  continue;
@@ -81600,7 +81596,7 @@ function isMissingFileError4(error51) {
81600
81596
  var import_gray_matter3 = __toESM(require_gray_matter(), 1);
81601
81597
  init_paths();
81602
81598
  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 join11 } from "node:path";
81599
+ import { basename as basename4, dirname as dirname6, join as join10 } from "node:path";
81604
81600
  async function installSkill2(url2) {
81605
81601
  const response = await fetch(url2);
81606
81602
  if (!response.ok) {
@@ -81610,8 +81606,8 @@ async function installSkill2(url2) {
81610
81606
  }
81611
81607
  const skillMarkdown = await response.text();
81612
81608
  const skillId = getSkillIdFromUrl(url2);
81613
- const skillDirectory = join11(SKILLS_DIR, skillId);
81614
- const skillPath = join11(skillDirectory, "SKILL.md");
81609
+ const skillDirectory = join10(SKILLS_DIR, skillId);
81610
+ const skillPath = join10(skillDirectory, "SKILL.md");
81615
81611
  const parsed = (0, import_gray_matter3.default)(skillMarkdown);
81616
81612
  const installedSkill = {
81617
81613
  id: skillId,
@@ -81625,7 +81621,7 @@ async function installSkill2(url2) {
81625
81621
  return installedSkill;
81626
81622
  }
81627
81623
  async function removeSkill2(id) {
81628
- await rm5(join11(SKILLS_DIR, id), { recursive: true, force: true });
81624
+ await rm5(join10(SKILLS_DIR, id), { recursive: true, force: true });
81629
81625
  const lockFile = await readSkillsLock();
81630
81626
  lockFile.skills = lockFile.skills.filter((skill) => skill.id !== id);
81631
81627
  await writeSkillsLock2(lockFile);
@@ -82130,7 +82126,7 @@ init_paths();
82130
82126
  init_zod();
82131
82127
  import { exec as exec8 } from "node:child_process";
82132
82128
  import { mkdir as mkdir10, readFile as readFile9, readdir as readdir6, stat as stat4 } from "node:fs/promises";
82133
- import { join as join16 } from "node:path";
82129
+ import { join as join15 } from "node:path";
82134
82130
  import { promisify as promisify8 } from "node:util";
82135
82131
 
82136
82132
  // packages/daemon/src/execution/runner.ts
@@ -82138,7 +82134,7 @@ init_dist();
82138
82134
  init_paths();
82139
82135
  import { exec as exec7 } from "node:child_process";
82140
82136
  import { access as access2 } from "node:fs/promises";
82141
- import { basename as basename5, join as join15 } from "node:path";
82137
+ import { basename as basename5, join as join14 } from "node:path";
82142
82138
  import { promisify as promisify7 } from "node:util";
82143
82139
 
82144
82140
  // packages/daemon/src/squad/manager.ts
@@ -82172,7 +82168,7 @@ async function isSquadAvailable(squadId) {
82172
82168
  init_dist();
82173
82169
  import { exec as exec3 } from "node:child_process";
82174
82170
  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 join12, relative as relative3, resolve as resolve4 } from "node:path";
82171
+ import { dirname as dirname8, extname as extname3, isAbsolute, join as join11, relative as relative3, resolve as resolve4 } from "node:path";
82176
82172
  import { promisify as promisify3 } from "node:util";
82177
82173
  import {
82178
82174
  CopilotClient as CopilotClient2,
@@ -82251,7 +82247,7 @@ async function persistUsage(member, usageEvents, squadName) {
82251
82247
  model,
82252
82248
  inputTokens: usage.inputTokens ?? 0,
82253
82249
  outputTokens: usage.outputTokens ?? 0,
82254
- cost: 0,
82250
+ cost: tokenUnitCost,
82255
82251
  premiumRequestCost,
82256
82252
  tokenUnitCost
82257
82253
  });
@@ -82271,7 +82267,7 @@ async function collectFiles(directory, recursive, output) {
82271
82267
  if (output.length >= MAX_LIST_RESULTS) {
82272
82268
  return;
82273
82269
  }
82274
- const fullPath = join12(directory, entry.name);
82270
+ const fullPath = join11(directory, entry.name);
82275
82271
  output.push(fullPath);
82276
82272
  if (recursive && entry.isDirectory()) {
82277
82273
  await collectFiles(fullPath, recursive, output);
@@ -82555,7 +82551,7 @@ async function buildInstanceSystemPromptSuffix(squadId, instanceId) {
82555
82551
  init_dist();
82556
82552
  import { exec as exec4 } from "node:child_process";
82557
82553
  import { access, readFile as readFile8 } from "node:fs/promises";
82558
- import { join as join13 } from "node:path";
82554
+ import { join as join12 } from "node:path";
82559
82555
  import { promisify as promisify4 } from "node:util";
82560
82556
  import { CopilotClient as CopilotClient3, approveAll as approveAll3 } from "@github/copilot-sdk";
82561
82557
 
@@ -82654,7 +82650,7 @@ async function fileExists(path) {
82654
82650
  }
82655
82651
  async function buildRepoContext(repoPath) {
82656
82652
  for (const candidate of README_CANDIDATES) {
82657
- const readmePath = join13(repoPath, candidate);
82653
+ const readmePath = join12(repoPath, candidate);
82658
82654
  if (await fileExists(readmePath)) {
82659
82655
  const content = await readFile8(readmePath, "utf8");
82660
82656
  return content.slice(0, MAX_REPO_CONTEXT_LENGTH);
@@ -82777,7 +82773,7 @@ ${repoContext}`
82777
82773
  // packages/daemon/src/execution/pr.ts
82778
82774
  import { exec as exec5 } from "node:child_process";
82779
82775
  import { rm as rm6, writeFile as writeFile7 } from "node:fs/promises";
82780
- import { join as join14 } from "node:path";
82776
+ import { join as join13 } from "node:path";
82781
82777
  import { promisify as promisify5 } from "node:util";
82782
82778
  var execAsync5 = promisify5(exec5);
82783
82779
  var URL_PATTERN = /https?:\/\/\S+/i;
@@ -82793,7 +82789,7 @@ function extractUrl(output) {
82793
82789
  }
82794
82790
  function buildBodyFilePath(repoPath, branchName) {
82795
82791
  const safeBranchName = branchName.replace(/[^a-zA-Z0-9._-]+/g, "-");
82796
- return join14(repoPath, `.io-pr-body-${safeBranchName}.md`);
82792
+ return join13(repoPath, `.io-pr-body-${safeBranchName}.md`);
82797
82793
  }
82798
82794
  function buildPrBody(objective, plan, taskSummaries, qaOutcome) {
82799
82795
  const tasks = taskSummaries.map((summary) => `- ${summary}`).join("\n") || "- No task summaries recorded.";
@@ -83113,16 +83109,16 @@ async function runGit2(command, cwd) {
83113
83109
  async function resolveRepoPath(repoUrl, repoName) {
83114
83110
  const urlSegments = repoUrl.replace(/\.git$/i, "").split("/").filter(Boolean);
83115
83111
  const owner = urlSegments.at(-2) ?? "";
83116
- const managedDir = owner && repoName ? join15(DATA_DIR, "repos", `${owner}--${repoName}`) : null;
83112
+ const managedDir = owner && repoName ? join14(DATA_DIR, "repos", `${owner}--${repoName}`) : null;
83117
83113
  const candidates = [
83118
83114
  ...managedDir ? [managedDir] : [],
83119
83115
  process.cwd(),
83120
- join15(process.cwd(), repoName),
83121
- join15(process.cwd(), "repos", repoName),
83122
- join15(process.cwd(), "..", repoName)
83116
+ join14(process.cwd(), repoName),
83117
+ join14(process.cwd(), "repos", repoName),
83118
+ join14(process.cwd(), "..", repoName)
83123
83119
  ];
83124
83120
  for (const candidate of candidates) {
83125
- if (!await pathExists(join15(candidate, ".git"))) {
83121
+ if (!await pathExists(join14(candidate, ".git"))) {
83126
83122
  continue;
83127
83123
  }
83128
83124
  const remoteUrl = await runGit2("git remote get-url origin", candidate).catch(() => "");
@@ -83675,10 +83671,10 @@ async function buildRepoAnalysis(repoUrl) {
83675
83671
  );
83676
83672
  return lines.join("\n");
83677
83673
  }
83678
- const repoDir = join16(DATA_DIR, "repos", `${owner}--${name}`);
83674
+ const repoDir = join15(DATA_DIR, "repos", `${owner}--${name}`);
83679
83675
  try {
83680
- await mkdir10(join16(DATA_DIR, "repos"), { recursive: true });
83681
- if (await pathExists2(join16(repoDir, ".git"))) {
83676
+ await mkdir10(join15(DATA_DIR, "repos"), { recursive: true });
83677
+ if (await pathExists2(join15(repoDir, ".git"))) {
83682
83678
  await execAsync8("git pull --ff-only", { cwd: repoDir, timeout: 3e4 }).catch(
83683
83679
  () => void 0
83684
83680
  );
@@ -83715,7 +83711,7 @@ async function buildRepoAnalysis(repoUrl) {
83715
83711
  ".github/workflows"
83716
83712
  ];
83717
83713
  for (const manifest of manifestFiles) {
83718
- const fullPath = join16(repoDir, manifest);
83714
+ const fullPath = join15(repoDir, manifest);
83719
83715
  try {
83720
83716
  const fileStat = await stat4(fullPath);
83721
83717
  if (fileStat.isFile()) {
@@ -83737,7 +83733,7 @@ ${children.join(", ")}`);
83737
83733
  );
83738
83734
  for (const srcDir of srcDirs) {
83739
83735
  try {
83740
- const srcEntries = await readdir6(join16(repoDir, srcDir), { withFileTypes: true });
83736
+ const srcEntries = await readdir6(join15(repoDir, srcDir), { withFileTypes: true });
83741
83737
  const srcFiles = srcEntries.filter((e) => e.isFile()).map((e) => e.name);
83742
83738
  const srcSubDirs = srcEntries.filter((e) => e.isDirectory()).map((e) => e.name);
83743
83739
  lines.push(`
@@ -83750,7 +83746,7 @@ ${children.join(", ")}`);
83750
83746
  const readmeCandidates = ["README.md", "README.rst", "README.txt", "README"];
83751
83747
  for (const readme of readmeCandidates) {
83752
83748
  try {
83753
- const content = await readFile9(join16(repoDir, readme), "utf8");
83749
+ const content = await readFile9(join15(repoDir, readme), "utf8");
83754
83750
  lines.push(`
83755
83751
  --- ${readme} (excerpt) ---
83756
83752
  ${content.slice(0, 1500)}`);
@@ -84288,7 +84284,7 @@ var Orchestrator = class {
84288
84284
  model,
84289
84285
  inputTokens: usage.inputTokens,
84290
84286
  outputTokens: usage.outputTokens,
84291
- cost: 0,
84287
+ cost: tokenUnitCost,
84292
84288
  premiumRequestCost,
84293
84289
  tokenUnitCost
84294
84290
  });