@lazyingart/agintiflow 0.20.177 → 0.20.178

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.177",
3
+ "version": "0.20.178",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
6
6
  "license": "Apache-2.0",
@@ -125,10 +125,25 @@ function forbiddenTails(text = "") {
125
125
  function inferExactOutputPaths(goal = "") {
126
126
  const paths = [];
127
127
  const lines = String(goal || "").split(/\n+/);
128
- const pathPattern = /(?:^|[\s"'`::])((?:~|\.{1,2}|[A-Za-z0-9_\-\u4e00-\u9fff])[\w./~\-\u4e00-\u9fff ]{0,220}\.(?:md|txt|json|ya?ml|html|css|js|ts|tsx|jsx|py|sh|csv|tex|svg|png|jpe?g|webp|mp4|mov|pdf|docx))(?:$|[\s"'`,,。;;])/gi;
128
+ const extensionPattern = "md|txt|json|ya?ml|html|css|js|ts|tsx|jsx|py|sh|csv|tex|svg|png|jpe?g|webp|mp4|mov|pdf|docx";
129
+ const quotedPathPattern = new RegExp("[\"'`]([^\"'`\\n]{1,220}\\.(?:" + extensionPattern + "))[\"'`]", "gi");
130
+ const pathPattern = new RegExp(
131
+ '(?:^|[\\s::])((?:~|\\.{1,2}|/|[A-Za-z0-9_\\-\\u4e00-\\u9fff])[\\w./~\\-\\u4e00-\\u9fff]{0,220}\\.(?:' +
132
+ extensionPattern +
133
+ '))(?:$|[\\s"\'`,,。;;.!?!?])',
134
+ "gi"
135
+ );
129
136
  for (const line of lines) {
130
- if (!/\b(save|saved|write|written|output|create|store|update|modify|edit)\b|保存|写入|寫入|输出|輸出|创建|建立|更新|修改|编辑|編輯/.test(line)) continue;
131
- for (const match of line.matchAll(pathPattern)) {
137
+ if (!/\b(save|saved|write|written|output|create|store|update|modify|edit)\b|保存|写入|寫入|输出|輸出|创建|建立|更新|修改|编辑|編輯/i.test(line)) continue;
138
+ quotedPathPattern.lastIndex = 0;
139
+ for (const match of line.matchAll(quotedPathPattern)) {
140
+ const raw = String(match[1] || "").trim();
141
+ if (!raw) continue;
142
+ paths.push(raw);
143
+ }
144
+ const unquotedLine = line.replace(quotedPathPattern, (match) => " ".repeat(match.length));
145
+ pathPattern.lastIndex = 0;
146
+ for (const match of unquotedLine.matchAll(pathPattern)) {
132
147
  const raw = String(match[1] || "").trim();
133
148
  if (!raw) continue;
134
149
  paths.push(raw);
@@ -153,8 +168,8 @@ function inferRequiredTextTerms(goal = "") {
153
168
  )[0];
154
169
  const requiredSegment = stripForbiddenTextClauses(positiveSegment);
155
170
  if (
156
- /\b(must|require|required|include|contain|contains|check|verify|grep|keyword|keywords)\b/i.test(line) ||
157
- /必须|必須|要求|包含|检查|檢查|验证|驗證|关键词|關鍵詞|自检|自檢/.test(line)
171
+ /\b(must|require|required|include|contain|contains|check|verify|grep|keyword|keywords|preserve|keep|retain|appear)\b/i.test(line) ||
172
+ /必须|必須|要求|包含|保留|出现|出現|精确字符串|精確字符串|明确出现|明確出現|检查|檢查|验证|驗證|关键词|關鍵詞|自检|自檢/.test(line)
158
173
  ) {
159
174
  terms.push(...quotedTerms(requiredSegment));
160
175
  }
@@ -369,6 +384,8 @@ function resolveContractPath(commandCwd = process.cwd(), rawPath = "") {
369
384
  const text = String(rawPath || "").trim();
370
385
  if (!text) return "";
371
386
  if (text.startsWith("~/")) return path.join(process.env.HOME || commandCwd, text.slice(2));
387
+ if (text === "/workspace") return path.resolve(commandCwd || process.cwd());
388
+ if (text.startsWith("/workspace/")) return path.resolve(commandCwd || process.cwd(), text.slice("/workspace/".length));
372
389
  if (path.isAbsolute(text)) return text;
373
390
  return path.resolve(commandCwd || process.cwd(), text);
374
391
  }