@harperfast/agent 0.11.1 → 0.11.3

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/README.svg CHANGED
@@ -1,8 +1,8 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <svg
3
3
  xmlns="http://www.w3.org/2000/svg"
4
- viewBox="0 0 1280 200"
5
- width="640"
4
+ viewBox="0 0 1320 200"
5
+ width="660"
6
6
  height="200"
7
7
  role="img"
8
8
  aria-label="npm install -g @harperfast/agent, harper-agent"
@@ -37,7 +37,7 @@
37
37
  font-weight="800"
38
38
  letter-spacing="-1.5"
39
39
  fill="url(#harperGrad)"
40
- >harper agent</text>
40
+ >harper-agent</text>
41
41
 
42
42
  <!-- little “terminal” capsule -->
43
43
  <g transform="translate(0 120)">
@@ -71,7 +71,7 @@
71
71
  font-size="22"
72
72
  fill="#e6f7ff"
73
73
  opacity="0.96"
74
- >$ harper agent</text>
74
+ >$ harper-agent</text>
75
75
 
76
76
  <!-- blinking cursor -->
77
77
  <rect x="284" y="55" width="12" height="24" fill="#e6f7ff" opacity="0.55">
package/dist/agent.js CHANGED
@@ -955,8 +955,10 @@ async function execute({ path: path7 }) {
955
955
  if (trackedState.agent) {
956
956
  trackedState.agent.instructions = agentsMDContents;
957
957
  }
958
+ console.log("Detected AGENTS.md, reading its contents for the AI.");
958
959
  return `Switched current working directory to ${trackedState.cwd}, with a AGENTS.md file containing:
959
- ${agentsMDContents}`;
960
+ ${agentsMDContents}
961
+ I strongly suggest you use these newfound skills!`;
960
962
  }
961
963
  return `Switched current working directory to ${trackedState.cwd}`;
962
964
  } catch (err) {
@@ -1643,7 +1645,6 @@ var checkHarperStatusTool = tool19({
1643
1645
  // tools/harper/createNewHarperApplicationTool.ts
1644
1646
  import { tool as tool20 } from "@openai/agents";
1645
1647
  import { execSync as execSync3 } from "child_process";
1646
- import { existsSync as existsSync7 } from "fs";
1647
1648
  import path6 from "path";
1648
1649
  import { z as z20 } from "zod";
1649
1650
 
@@ -1717,13 +1718,7 @@ async function execute3({ directoryName, template }) {
1717
1718
  console.log(`Initializing new Git repository in ${resolvedPath}...`);
1718
1719
  execSync3("git init", { cwd: resolvedPath, stdio: "ignore" });
1719
1720
  const switchedDir = await execute({ path: resolvedPath });
1720
- const agentsMdExists = existsSync7(path6.join(resolvedPath, "AGENTS.md"));
1721
- let returnMsg = `Successfully created a new Harper application in '${resolvedPath}' using template '${template}' with a matching Git repository initialized. ${switchedDir}.`;
1722
- if (agentsMdExists) {
1723
- returnMsg += ` I found an AGENTS.md file in the new application \u2013 I strongly suggest you read it next to understand how to use your new skills!`;
1724
- }
1725
- returnMsg += ` Use the readDir and readFile tools to inspect the contents of the application.`;
1726
- return returnMsg;
1721
+ return `Successfully created a new Harper application in '${resolvedPath}' using template '${template}' with a matching Git repository initialized. Use the readDir and readFile tools to inspect the contents of the application. ${switchedDir}.`;
1727
1722
  } catch (error) {
1728
1723
  let errorMsg = `Error creating new Harper application: ${error.message}`;
1729
1724
  if (error.stdout) {
@@ -2002,7 +1997,7 @@ var readHarperLogsTool = tool27({
2002
1997
 
2003
1998
  // tools/harper/startHarperTool.ts
2004
1999
  import { tool as tool28 } from "@openai/agents";
2005
- import { existsSync as existsSync8 } from "fs";
2000
+ import { existsSync as existsSync7 } from "fs";
2006
2001
  import { basename, resolve } from "path";
2007
2002
  import { z as z28 } from "zod";
2008
2003
 
@@ -2029,7 +2024,7 @@ var startHarperTool = tool28({
2029
2024
  try {
2030
2025
  let effectiveDirectory = directoryName;
2031
2026
  const candidatePath = resolve(process.cwd(), directoryName);
2032
- if (!existsSync8(candidatePath)) {
2027
+ if (!existsSync7(candidatePath)) {
2033
2028
  const cwd = process.cwd();
2034
2029
  if (basename(cwd) === directoryName) {
2035
2030
  effectiveDirectory = cwd;
@@ -2162,6 +2157,26 @@ A new version of ${chalk10.bold(packageName)} is available! (${chalk10.dim(packa
2162
2157
  );
2163
2158
  console.log(`Automatically updating to the latest version...
2164
2159
  `);
2160
+ let isGlobal = false;
2161
+ try {
2162
+ const globalRootResult = spawn3.sync("npm", ["root", "-g"], {
2163
+ encoding: "utf8"
2164
+ });
2165
+ const globalRoot = globalRootResult.stdout?.trim();
2166
+ if (globalRoot && process.argv[1] && process.argv[1].startsWith(globalRoot)) {
2167
+ isGlobal = true;
2168
+ }
2169
+ } catch {
2170
+ }
2171
+ if (isGlobal) {
2172
+ spawn3.sync("npm", ["install", "-g", `${packageName}@latest`], {
2173
+ stdio: "inherit"
2174
+ });
2175
+ const result2 = spawn3.sync("harper-agent", process.argv.slice(2), {
2176
+ stdio: "inherit"
2177
+ });
2178
+ process.exit(result2.status ?? 0);
2179
+ }
2165
2180
  const lsResult = spawn3.sync("npm", ["cache", "npx", "ls", packageName], {
2166
2181
  encoding: "utf8"
2167
2182
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harperfast/agent",
3
3
  "description": "AI to help you with Harper app management",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
5
5
  "main": "dist/agent.js",
6
6
  "repository": "github:HarperFast/harper-agent",
7
7
  "bugs": {