@botbotgo/agent-harness 0.0.362 → 0.0.363

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.
@@ -1,2 +1,2 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.362";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.363";
2
2
  export declare const AGENT_HARNESS_RELEASE_DATE = "2026-04-27";
@@ -1,2 +1,2 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.362";
1
+ export const AGENT_HARNESS_VERSION = "0.0.363";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-04-27";
@@ -3,14 +3,14 @@ import path from "node:path";
3
3
  const DIRECT_LISTING_PATTERNS = [
4
4
  /^ls$/iu,
5
5
  /^list files$/iu,
6
+ /^list all files$/iu,
6
7
  /^list the files$/iu,
8
+ /^list all the files$/iu,
7
9
  /^list files in (?:the )?(?:current )?directory$/iu,
10
+ /^list all files in (?:the )?(?:current )?directory$/iu,
8
11
  /^show files$/iu,
9
12
  /^show me the files$/iu,
10
13
  /^show the files$/iu,
11
- /^列出文件$/u,
12
- /^列出当前目录(?:下)?文件$/u,
13
- /^查看文件列表$/u,
14
14
  ];
15
15
  const GENERIC_ASSISTANT_SUMMARY_MAX_CHARS = 180;
16
16
  const GENERIC_ASSISTANT_SUMMARY_MAX_LINES = 6;
@@ -119,12 +119,38 @@ function extractPlainTextInput(input) {
119
119
  .trim();
120
120
  return text.length > 0 ? text : undefined;
121
121
  }
122
- export function shouldDirectlyListWorkspaceFiles(input) {
123
- const normalized = extractPlainTextInput(input);
122
+ function normalizeDirectListingInput(text) {
123
+ return text
124
+ .trim()
125
+ .toLowerCase()
126
+ .replace(/[。!?!?,,;;::]/gu, " ")
127
+ .replace(/\s+/gu, " ")
128
+ .replace(/^(?:please|pls|can you|could you|would you|help me)\s+/u, "")
129
+ .replace(/\s+(?:please)$/u, "")
130
+ .trim();
131
+ }
132
+ function isChineseDirectListingPrompt(text) {
133
+ const normalized = text
134
+ .trim()
135
+ .replace(/[。!?!?,,;;::\s]/gu, "");
124
136
  if (!normalized) {
125
137
  return false;
126
138
  }
127
- return DIRECT_LISTING_PATTERNS.some((pattern) => pattern.test(normalized));
139
+ if (!/(?:列出|查看)/u.test(normalized)) {
140
+ return false;
141
+ }
142
+ if (!/(?:文件|文件列表)/u.test(normalized)) {
143
+ return false;
144
+ }
145
+ return /^(?:请|麻烦|帮我|请帮我)?(?:列出|查看)(?:当前目录下?)?(?:所有)?(?:的)?文件(?:列表)?(?:一下)?$/u.test(normalized);
146
+ }
147
+ export function shouldDirectlyListWorkspaceFiles(input) {
148
+ const plainText = extractPlainTextInput(input);
149
+ if (!plainText) {
150
+ return false;
151
+ }
152
+ const normalized = normalizeDirectListingInput(plainText);
153
+ return DIRECT_LISTING_PATTERNS.some((pattern) => pattern.test(normalized)) || isChineseDirectListingPrompt(plainText);
128
154
  }
129
155
  export function renderDirectWorkspaceListing(workspaceRoot, targetPath = ".") {
130
156
  const resolvedTarget = path.resolve(workspaceRoot, targetPath);
@@ -342,6 +342,9 @@ export class AgentRuntimeAdapter {
342
342
  };
343
343
  }
344
344
  async tryHandleDirectWorkspaceListing(binding, input, options = {}) {
345
+ if (binding.agent.executionMode !== "deepagent") {
346
+ return undefined;
347
+ }
345
348
  if (!shouldDirectlyListWorkspaceFiles(input)) {
346
349
  return undefined;
347
350
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.362",
3
+ "version": "0.0.363",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",