@harperfast/agent 0.13.0 → 0.13.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/agent.js +27 -28
- package/package.json +13 -13
- package/dist/BrowserWebSocketTransport-YCNS4FS4.js +0 -7
- package/dist/LaunchOptions-Y7D2IMM3.js +0 -9
- package/dist/NodeWebSocketTransport-TOVQQIXD.js +0 -8
- package/dist/bidi-UGABXYIW.js +0 -18794
- package/dist/chunk-23SGXNI6.js +0 -244
- package/dist/chunk-2ESYSVXG.js +0 -48
- package/dist/chunk-435G4BZK.js +0 -210767
- package/dist/chunk-FCLITLWE.js +0 -775
- package/dist/chunk-MGX7MDP2.js +0 -15
- package/dist/chunk-PG3SGAEX.js +0 -40
- package/dist/chunk-SACY2WFT.js +0 -12205
- package/dist/chunk-SLTU5TTQ.js +0 -31483
- package/dist/chunk-VD4EVG4H.js +0 -3692
- package/dist/chunk-YLJAHQTP.js +0 -30
- package/dist/chunk-ZDS7NDTW.js +0 -1661
- package/dist/extract-zip-N66P73SM.js +0 -1499
- package/dist/helpers-4S4VJSDS.js +0 -17
- package/dist/main-J53CTMGG.js +0 -60
- package/dist/puppeteer-KULXOV7T.js +0 -15064
- package/dist/src-GTRPEVYZ.js +0 -5
- package/dist/tar-fs-ETYYVPLS.js +0 -2562
- package/dist/typescript-XXE3DJ5D.js +0 -5
- package/dist/yargs-CJ75NAFN.js +0 -3230
package/dist/agent.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-2ESYSVXG.js";
|
|
3
2
|
|
|
4
3
|
// agent.ts
|
|
5
4
|
import "dotenv/config";
|
|
@@ -715,7 +714,7 @@ async function getBrowser() {
|
|
|
715
714
|
if (!browser) {
|
|
716
715
|
let puppeteer;
|
|
717
716
|
try {
|
|
718
|
-
puppeteer = await import("
|
|
717
|
+
puppeteer = await import("puppeteer");
|
|
719
718
|
} catch {
|
|
720
719
|
throw new Error(
|
|
721
720
|
"Puppeteer is not installed. Browser tools require puppeteer. Please install it with `npm install puppeteer`."
|
|
@@ -1035,7 +1034,7 @@ var ToolParameters10 = z10.object({
|
|
|
1035
1034
|
)
|
|
1036
1035
|
});
|
|
1037
1036
|
var getHarperSkillTool = tool10({
|
|
1038
|
-
name: "
|
|
1037
|
+
name: "get_harper_skill",
|
|
1039
1038
|
description: getSkillsDescription(),
|
|
1040
1039
|
parameters: ToolParameters10,
|
|
1041
1040
|
execute: execute10
|
|
@@ -1348,7 +1347,7 @@ I strongly suggest you use these newfound skills!`;
|
|
|
1348
1347
|
}
|
|
1349
1348
|
}
|
|
1350
1349
|
var changeCwdTool = tool12({
|
|
1351
|
-
name: "
|
|
1350
|
+
name: "change_cwd",
|
|
1352
1351
|
description: "Changes the current working directory for subsequent tools. Accepts absolute or relative paths.",
|
|
1353
1352
|
parameters: ToolParameters11,
|
|
1354
1353
|
execute: execute11
|
|
@@ -1428,7 +1427,7 @@ var ToolParameters14 = z15.object({
|
|
|
1428
1427
|
directoryName: z15.string().describe("The name of the directory to read.")
|
|
1429
1428
|
});
|
|
1430
1429
|
var readDirTool = tool15({
|
|
1431
|
-
name: "
|
|
1430
|
+
name: "read_dir",
|
|
1432
1431
|
description: "Lists the files in a directory.",
|
|
1433
1432
|
parameters: ToolParameters14,
|
|
1434
1433
|
async execute({ directoryName }) {
|
|
@@ -1481,7 +1480,7 @@ async function execute12({ fileName }) {
|
|
|
1481
1480
|
}
|
|
1482
1481
|
}
|
|
1483
1482
|
var readFileTool = tool16({
|
|
1484
|
-
name: "
|
|
1483
|
+
name: "read_file",
|
|
1485
1484
|
description: "Reads the contents of a specified file. If the file is an image, it returns a structured image object.",
|
|
1486
1485
|
parameters: ToolParameters15,
|
|
1487
1486
|
execute: execute12
|
|
@@ -1582,7 +1581,7 @@ var SetInterpreterAutoApproveParameters = z18.object({
|
|
|
1582
1581
|
autoApprove: z18.boolean()
|
|
1583
1582
|
});
|
|
1584
1583
|
var setInterpreterAutoApproveTool = tool18({
|
|
1585
|
-
name: "
|
|
1584
|
+
name: "set_interpreter_auto_approve",
|
|
1586
1585
|
description: "Enable or disable automatic approval for code interpreter by setting HARPER_AGENT_AUTO_APPROVE_CODE_INTERPRETER=1 or 0 in .env and current process.",
|
|
1587
1586
|
parameters: SetInterpreterAutoApproveParameters,
|
|
1588
1587
|
needsApproval: async (_runContext, { autoApprove }) => {
|
|
@@ -1610,7 +1609,7 @@ var SetPatchAutoApproveParameters = z19.object({
|
|
|
1610
1609
|
autoApprove: z19.boolean()
|
|
1611
1610
|
});
|
|
1612
1611
|
var setPatchAutoApproveTool = tool19({
|
|
1613
|
-
name: "
|
|
1612
|
+
name: "set_patch_auto_approve",
|
|
1614
1613
|
description: "Enable or disable automatic approval for patch commands by setting HARPER_AGENT_AUTO_APPROVE_PATCHES=1 or 0 in .env and current process.",
|
|
1615
1614
|
parameters: SetPatchAutoApproveParameters,
|
|
1616
1615
|
needsApproval: async (_runContext, { autoApprove }) => {
|
|
@@ -1638,7 +1637,7 @@ var SetShellAutoApproveParameters = z20.object({
|
|
|
1638
1637
|
autoApprove: z20.boolean()
|
|
1639
1638
|
});
|
|
1640
1639
|
var setShellAutoApproveTool = tool20({
|
|
1641
|
-
name: "
|
|
1640
|
+
name: "set_shell_auto_approve",
|
|
1642
1641
|
description: "Enable or disable automatic approval for shell commands by setting HARPER_AGENT_AUTO_APPROVE_SHELL=1 or 0 in .env and current process.",
|
|
1643
1642
|
parameters: SetShellAutoApproveParameters,
|
|
1644
1643
|
needsApproval: async (_runContext, { autoApprove }) => {
|
|
@@ -1779,8 +1778,8 @@ var ShellParameters = z21.object({
|
|
|
1779
1778
|
});
|
|
1780
1779
|
var shell = new LocalShell();
|
|
1781
1780
|
var shellTool = tool21({
|
|
1782
|
-
name: "
|
|
1783
|
-
description: "Executes shell commands.",
|
|
1781
|
+
name: "shell",
|
|
1782
|
+
description: "Executes shell commands. Only use when we do not have a better tool.",
|
|
1784
1783
|
parameters: ShellParameters,
|
|
1785
1784
|
execute: async ({ commands }) => {
|
|
1786
1785
|
const result = await shell.run({ commands });
|
|
@@ -1844,7 +1843,7 @@ var GitAddParameters = z22.object({
|
|
|
1844
1843
|
files: z22.array(z22.string()).describe("The files to add. If not provided, all changes will be added.")
|
|
1845
1844
|
});
|
|
1846
1845
|
var gitAddTool = tool22({
|
|
1847
|
-
name: "
|
|
1846
|
+
name: "git_add",
|
|
1848
1847
|
description: "Add file contents to the index.",
|
|
1849
1848
|
parameters: GitAddParameters,
|
|
1850
1849
|
async execute({ files }) {
|
|
@@ -1874,7 +1873,7 @@ var GitBranchParameters = z23.object({
|
|
|
1874
1873
|
create: z23.boolean().optional().default(false).describe("Whether to create a new branch.")
|
|
1875
1874
|
});
|
|
1876
1875
|
var gitBranchTool = tool23({
|
|
1877
|
-
name: "
|
|
1876
|
+
name: "git_branch",
|
|
1878
1877
|
description: "Create or switch to a git branch.",
|
|
1879
1878
|
parameters: GitBranchParameters,
|
|
1880
1879
|
needsApproval: true,
|
|
@@ -1902,7 +1901,7 @@ var GitCommitParameters = z24.object({
|
|
|
1902
1901
|
)
|
|
1903
1902
|
});
|
|
1904
1903
|
var gitCommitTool = tool24({
|
|
1905
|
-
name: "
|
|
1904
|
+
name: "git_commit",
|
|
1906
1905
|
description: "Commit changes to the repository.",
|
|
1907
1906
|
parameters: GitCommitParameters,
|
|
1908
1907
|
async execute({ message, addAll }) {
|
|
@@ -1927,7 +1926,7 @@ var GitLogParameters = z25.object({
|
|
|
1927
1926
|
oneline: z25.boolean().optional().default(true).describe("Whether to show log in oneline format.")
|
|
1928
1927
|
});
|
|
1929
1928
|
var gitLogTool = tool25({
|
|
1930
|
-
name: "
|
|
1929
|
+
name: "git_log",
|
|
1931
1930
|
description: "Show commit logs.",
|
|
1932
1931
|
parameters: GitLogParameters,
|
|
1933
1932
|
async execute({ count, oneline }) {
|
|
@@ -1956,7 +1955,7 @@ var GitStashParameters = z26.object({
|
|
|
1956
1955
|
message: z26.string().describe("A message for the stash change.")
|
|
1957
1956
|
});
|
|
1958
1957
|
var gitStashTool = tool26({
|
|
1959
|
-
name: "
|
|
1958
|
+
name: "git_stash",
|
|
1960
1959
|
description: "Stash changes or apply a stash.",
|
|
1961
1960
|
parameters: GitStashParameters,
|
|
1962
1961
|
async execute({ action, message }) {
|
|
@@ -1986,7 +1985,7 @@ var GitStatusParameters = z27.object({
|
|
|
1986
1985
|
short: z27.boolean().optional().default(false).describe("Whether to show the status in short format.")
|
|
1987
1986
|
});
|
|
1988
1987
|
var gitStatusTool = tool27({
|
|
1989
|
-
name: "
|
|
1988
|
+
name: "git_status",
|
|
1990
1989
|
description: "Show the working tree status.",
|
|
1991
1990
|
parameters: GitStatusParameters,
|
|
1992
1991
|
async execute({ short }) {
|
|
@@ -2015,7 +2014,7 @@ var GitWorkspaceParameters = z28.object({
|
|
|
2015
2014
|
createBranch: z28.boolean().optional().default(false).describe("Whether to create a new branch for this workspace.")
|
|
2016
2015
|
});
|
|
2017
2016
|
var gitWorkspaceTool = tool28({
|
|
2018
|
-
name: "
|
|
2017
|
+
name: "git_workspace",
|
|
2019
2018
|
description: "Create a new workspace (git worktree) for parallel work.",
|
|
2020
2019
|
parameters: GitWorkspaceParameters,
|
|
2021
2020
|
async execute({ path: workspacePath, branchName, createBranch }) {
|
|
@@ -2035,7 +2034,7 @@ import { tool as tool29 } from "@openai/agents";
|
|
|
2035
2034
|
import { z as z29 } from "zod";
|
|
2036
2035
|
var ToolParameters16 = z29.object({});
|
|
2037
2036
|
var checkHarperStatusTool = tool29({
|
|
2038
|
-
name: "
|
|
2037
|
+
name: "check_harper_status",
|
|
2039
2038
|
description: "Checks if a Harper application is currently running.",
|
|
2040
2039
|
parameters: ToolParameters16,
|
|
2041
2040
|
async execute() {
|
|
@@ -2136,7 +2135,7 @@ ${error.stdout}`;
|
|
|
2136
2135
|
}
|
|
2137
2136
|
}
|
|
2138
2137
|
var createNewHarperApplicationTool = tool30({
|
|
2139
|
-
name: "
|
|
2138
|
+
name: "create_new_harper_application",
|
|
2140
2139
|
description: "Creates a new Harper application using the best available package manager (yarn/pnpm/bun/deno, falling back to npm).",
|
|
2141
2140
|
parameters: ToolParameters17,
|
|
2142
2141
|
execute: execute14
|
|
@@ -2154,7 +2153,7 @@ var ToolParameters18 = z31.object({
|
|
|
2154
2153
|
)
|
|
2155
2154
|
});
|
|
2156
2155
|
var getHarperConfigSchemaTool = tool31({
|
|
2157
|
-
name: "
|
|
2156
|
+
name: "get_harper_config_schema",
|
|
2158
2157
|
description: "Returns the JSON schema for HarperDB configuration files (either app or root), which describes the config.yaml or harperdb-config.yaml files.",
|
|
2159
2158
|
parameters: ToolParameters18,
|
|
2160
2159
|
async execute({ schemaType }) {
|
|
@@ -2190,7 +2189,7 @@ var ToolParameters19 = z32.object({
|
|
|
2190
2189
|
).default("ResourceInterfaceV2")
|
|
2191
2190
|
});
|
|
2192
2191
|
var getHarperResourceInterfaceTool = tool32({
|
|
2193
|
-
name: "
|
|
2192
|
+
name: "get_harper_resource_interface",
|
|
2194
2193
|
description: "Reads HarperDB resource interface and class definitions (like ResourceInterfaceV2.d.ts) to understand how resources and tables are structured.",
|
|
2195
2194
|
parameters: ToolParameters19,
|
|
2196
2195
|
async execute({ resourceFile }) {
|
|
@@ -2217,7 +2216,7 @@ import { dirname as dirname4, join as join10 } from "path";
|
|
|
2217
2216
|
import { z as z33 } from "zod";
|
|
2218
2217
|
var ToolParameters20 = z33.object({});
|
|
2219
2218
|
var getHarperSchemaGraphQLTool = tool33({
|
|
2220
|
-
name: "
|
|
2219
|
+
name: "get_harper_schema_graphql",
|
|
2221
2220
|
description: "Returns the GraphQL schema for HarperDB schema files, which define the structure of HarperDB database tables.",
|
|
2222
2221
|
parameters: ToolParameters20,
|
|
2223
2222
|
async execute() {
|
|
@@ -2249,11 +2248,11 @@ var ToolParameters21 = z34.object({
|
|
|
2249
2248
|
body: z34.string().optional().default("").describe("An optional JSON string body to send along with the request.")
|
|
2250
2249
|
});
|
|
2251
2250
|
var hitHarperAPITool = tool34({
|
|
2252
|
-
name: "
|
|
2251
|
+
name: "hit_harper_api",
|
|
2253
2252
|
description: "Performs a request against the running Harper API. Use /openapi to look up Harper APIs.",
|
|
2254
2253
|
parameters: ToolParameters21,
|
|
2255
2254
|
needsApproval: async (runContext, input, callId) => {
|
|
2256
|
-
if (callId && runContext.isToolApproved({ toolName: "
|
|
2255
|
+
if (callId && runContext.isToolApproved({ toolName: "hit_harper_api", callId })) {
|
|
2257
2256
|
return false;
|
|
2258
2257
|
}
|
|
2259
2258
|
if (input.method === "DELETE") {
|
|
@@ -2293,7 +2292,7 @@ import { tool as tool35 } from "@openai/agents";
|
|
|
2293
2292
|
import { z as z35 } from "zod";
|
|
2294
2293
|
var ToolParameters22 = z35.object({});
|
|
2295
2294
|
var readHarperLogsTool = tool35({
|
|
2296
|
-
name: "
|
|
2295
|
+
name: "read_harper_logs",
|
|
2297
2296
|
description: "Reads the most recent console logs of a started Harper app and clears them so that subsequent reads will only show new logs.",
|
|
2298
2297
|
parameters: ToolParameters22,
|
|
2299
2298
|
async execute() {
|
|
@@ -2325,7 +2324,7 @@ var ToolParameters23 = z36.object({
|
|
|
2325
2324
|
directoryName: z36.string().describe("The name of the directory that the Harper app is in.")
|
|
2326
2325
|
});
|
|
2327
2326
|
var startHarperTool = tool36({
|
|
2328
|
-
name: "
|
|
2327
|
+
name: "start_harper",
|
|
2329
2328
|
description: "Starts a Harper app background process, allowing you to observe the app in action (by readHarperLogsTool, hitHarperAPITool, etc).",
|
|
2330
2329
|
parameters: ToolParameters23,
|
|
2331
2330
|
async execute({ directoryName }) {
|
|
@@ -2360,7 +2359,7 @@ import { tool as tool37 } from "@openai/agents";
|
|
|
2360
2359
|
import { z as z37 } from "zod";
|
|
2361
2360
|
var ToolParameters24 = z37.object({});
|
|
2362
2361
|
var stopHarperTool = tool37({
|
|
2363
|
-
name: "
|
|
2362
|
+
name: "stop_harper",
|
|
2364
2363
|
description: "Stops all previously started Harper app background process.",
|
|
2365
2364
|
parameters: ToolParameters24,
|
|
2366
2365
|
async execute() {
|
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.13.
|
|
4
|
+
"version": "0.13.1",
|
|
5
5
|
"main": "dist/agent.js",
|
|
6
6
|
"repository": "github:HarperFast/harper-agent",
|
|
7
7
|
"bugs": {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://github.com/harperfast",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"dev": "tsup agent.ts --format esm --clean --dts --watch",
|
|
12
|
+
"dev": "tsup agent.ts --format esm --clean --dts --watch --external puppeteer",
|
|
13
13
|
"link": "npm run build && npm link",
|
|
14
|
-
"build": "tsup agent.ts --format esm --clean --dts",
|
|
14
|
+
"build": "tsup agent.ts --format esm --clean --dts --external puppeteer",
|
|
15
15
|
"commitlint": "commitlint --edit",
|
|
16
16
|
"start": "node ./dist/agent.js",
|
|
17
17
|
"lint": "oxlint --format stylish .",
|
|
@@ -42,17 +42,17 @@
|
|
|
42
42
|
"license": "None",
|
|
43
43
|
"type": "module",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ai-sdk/anthropic": "^3.0.
|
|
46
|
-
"@ai-sdk/google": "^3.0.
|
|
47
|
-
"@ai-sdk/openai": "^3.0.
|
|
48
|
-
"@openai/agents": "^0.4.
|
|
49
|
-
"@openai/agents-extensions": "^0.4.
|
|
50
|
-
"ai": "^6.0.
|
|
45
|
+
"@ai-sdk/anthropic": "^3.0.41",
|
|
46
|
+
"@ai-sdk/google": "^3.0.24",
|
|
47
|
+
"@ai-sdk/openai": "^3.0.26",
|
|
48
|
+
"@openai/agents": "^0.4.6",
|
|
49
|
+
"@openai/agents-extensions": "^0.4.6",
|
|
50
|
+
"ai": "^6.0.79",
|
|
51
51
|
"chalk": "^5.6.2",
|
|
52
|
-
"create-harper": "^0.12.
|
|
52
|
+
"create-harper": "^0.12.4",
|
|
53
53
|
"cross-spawn": "^7.0.6",
|
|
54
|
-
"dotenv": "^17.2.
|
|
55
|
-
"ollama-ai-provider-v2": "^3.0
|
|
54
|
+
"dotenv": "^17.2.4",
|
|
55
|
+
"ollama-ai-provider-v2": "^3.3.0",
|
|
56
56
|
"zod": "^4.3.6"
|
|
57
57
|
},
|
|
58
58
|
"optionalDependencies": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
73
73
|
"dprint": "^0.51.1",
|
|
74
74
|
"express": "^5.2.1",
|
|
75
|
-
"harperdb": "^4.7.
|
|
75
|
+
"harperdb": "^4.7.19",
|
|
76
76
|
"hono": "^4.11.9",
|
|
77
77
|
"husky": "^9.1.7",
|
|
78
78
|
"oxlint": "^1.43.0",
|