0agent 1.0.81 → 1.0.82

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.
Files changed (2) hide show
  1. package/dist/daemon.mjs +13 -5
  2. package/package.json +1 -1
package/dist/daemon.mjs CHANGED
@@ -2827,7 +2827,7 @@ var init_ShellCapability = __esm({
2827
2827
  });
2828
2828
 
2829
2829
  // packages/daemon/src/tools/FileCapability.ts
2830
- import { readFileSync as readFileSync2, writeFileSync, readdirSync, mkdirSync, existsSync as existsSync2 } from "node:fs";
2830
+ import { readFileSync as readFileSync2, writeFileSync, readdirSync, mkdirSync, existsSync as existsSync2, statSync } from "node:fs";
2831
2831
  import { resolve as resolve2, dirname } from "node:path";
2832
2832
  var FileCapability;
2833
2833
  var init_FileCapability = __esm({
@@ -2862,6 +2862,11 @@ var init_FileCapability = __esm({
2862
2862
  try {
2863
2863
  if (op === "read") {
2864
2864
  if (!existsSync2(safe)) return { success: false, output: `Not found: ${rel}`, duration_ms: Date.now() - start };
2865
+ if (statSync(safe).isDirectory()) {
2866
+ const entries = readdirSync(safe, { withFileTypes: true }).filter((e) => !e.name.startsWith(".") && e.name !== "node_modules").map((e) => `${e.isDirectory() ? "d" : "f"} ${e.name}`).join("\n");
2867
+ return { success: true, output: `(directory listing for ${rel}):
2868
+ ${entries || "(empty)"}`, duration_ms: Date.now() - start };
2869
+ }
2865
2870
  const content = readFileSync2(safe, "utf8");
2866
2871
  return {
2867
2872
  success: true,
@@ -4232,7 +4237,7 @@ Run manually: pip3 install open-interpreter`,
4232
4237
 
4233
4238
  // packages/daemon/src/tools/SurgeCapability.ts
4234
4239
  import { execSync as execSync3 } from "node:child_process";
4235
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, copyFileSync, statSync } from "node:fs";
4240
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, copyFileSync, statSync as statSync2 } from "node:fs";
4236
4241
  import { join } from "node:path";
4237
4242
  var SurgeCapability;
4238
4243
  var init_SurgeCapability = __esm({
@@ -4268,7 +4273,7 @@ var init_SurgeCapability = __esm({
4268
4273
  return { success: false, output: `Path does not exist: ${target}`, duration_ms: 0 };
4269
4274
  }
4270
4275
  let publishDir = target;
4271
- if (statSync(target).isFile()) {
4276
+ if (statSync2(target).isFile()) {
4272
4277
  publishDir = join("/tmp", `surge-${Date.now()}`);
4273
4278
  mkdirSync2(publishDir, { recursive: true });
4274
4279
  copyFileSync(target, join(publishDir, "index.html"));
@@ -6597,6 +6602,9 @@ content = element.text if element else page.get_all_text()` : `content = page.ge
6597
6602
  async _executeSingleTool(tc, signal, filesWritten, commandsRun) {
6598
6603
  let result;
6599
6604
  try {
6605
+ if (!tc.input || Object.keys(tc.input).length === 0) {
6606
+ return `Error: empty tool input for ${tc.name}. Provide required parameters.`;
6607
+ }
6600
6608
  const capResult = await this.registry.execute(tc.name, tc.input, this.cwd, signal);
6601
6609
  result = capResult.output;
6602
6610
  const MAX_TOOL_OUTPUT = 4e3;
@@ -7085,7 +7093,7 @@ __export(ProactiveSurface_exports, {
7085
7093
  ProactiveSurface: () => ProactiveSurface
7086
7094
  });
7087
7095
  import { execSync as execSync10 } from "node:child_process";
7088
- import { existsSync as existsSync20, readFileSync as readFileSync16, statSync as statSync2, readdirSync as readdirSync5 } from "node:fs";
7096
+ import { existsSync as existsSync20, readFileSync as readFileSync16, statSync as statSync3, readdirSync as readdirSync5 } from "node:fs";
7089
7097
  import { resolve as resolve16, join as join7 } from "node:path";
7090
7098
  function readdirSafe(dir) {
7091
7099
  try {
@@ -7183,7 +7191,7 @@ var init_ProactiveSurface = __esm({
7183
7191
  const xmlFiles = readdirSafe(dir).filter((f) => f.endsWith(".xml"));
7184
7192
  for (const xml of xmlFiles) {
7185
7193
  const path = join7(dir, xml);
7186
- const stat = statSync2(path);
7194
+ const stat = statSync3(path);
7187
7195
  if (stat.mtimeMs < this.lastPollAt) continue;
7188
7196
  const content = readFileSync16(path, "utf8");
7189
7197
  const failures = [...content.matchAll(/<failure[^>]*message="([^"]+)"/g)].length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0agent",
3
- "version": "1.0.81",
3
+ "version": "1.0.82",
4
4
  "description": "A persistent, learning AI agent that runs on your machine. An agent that learns.",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",