sdd-forge 0.1.0-alpha.12 → 0.1.0-alpha.13
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 +1 -1
- package/src/docs/commands/text.js +8 -9
- package/src/lib/agent.js +11 -3
package/package.json
CHANGED
|
@@ -402,9 +402,8 @@ async function processTemplateFileBatch(text, analysis, fileName, agent, timeout
|
|
|
402
402
|
// バッチはファイル全体を返すので preamble パターンは使わない
|
|
403
403
|
result = await callAgentAsync(agent, prompt, timeoutMs, cwd, [], systemPrompt);
|
|
404
404
|
} catch (err) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
else logger.log(`ERROR batch ${fileName}: ${detail}`);
|
|
405
|
+
logger.log(`ERROR batch ${fileName}:`);
|
|
406
|
+
logger.log(err.message);
|
|
408
407
|
return { text, filled: 0, skipped: textFills.length };
|
|
409
408
|
}
|
|
410
409
|
|
|
@@ -569,8 +568,8 @@ async function processTemplate(text, analysis, fileName, agent, timeoutMs, cwd,
|
|
|
569
568
|
const { generated: rawGenerated, error } = results[i];
|
|
570
569
|
|
|
571
570
|
if (error) {
|
|
572
|
-
|
|
573
|
-
logger.log(
|
|
571
|
+
logger.log(`ERROR calling agent for ${fileName}:${d.line + 1}:`);
|
|
572
|
+
logger.log(error.message);
|
|
574
573
|
skipped++;
|
|
575
574
|
continue;
|
|
576
575
|
}
|
|
@@ -673,8 +672,8 @@ export async function textFillFromAnalysis(root, analysis, agentName) {
|
|
|
673
672
|
fileResults[fileIdx] = { file, filePath, result };
|
|
674
673
|
})
|
|
675
674
|
.catch((err) => {
|
|
676
|
-
|
|
677
|
-
logger.log(
|
|
675
|
+
logger.log(`ERROR processing ${file}:`);
|
|
676
|
+
logger.log(err.message);
|
|
678
677
|
fileResults[fileIdx] = { file, filePath, result: { text: original, filled: 0, skipped: 0 } };
|
|
679
678
|
})
|
|
680
679
|
.finally(() => {
|
|
@@ -815,8 +814,8 @@ async function main() {
|
|
|
815
814
|
logger.verbose(`done: ${file}`);
|
|
816
815
|
})
|
|
817
816
|
.catch((err) => {
|
|
818
|
-
|
|
819
|
-
logger.log(
|
|
817
|
+
logger.log(`ERROR processing ${file}:`);
|
|
818
|
+
logger.log(err.message);
|
|
820
819
|
fileResults[fileIdx] = { text: original, filled: 0, skipped: 0 };
|
|
821
820
|
})
|
|
822
821
|
.finally(() => {
|
package/src/lib/agent.js
CHANGED
|
@@ -158,9 +158,17 @@ export function callAgentAsync(agent, prompt, timeoutMs, cwd, options) {
|
|
|
158
158
|
(err, stdout, stderr) => {
|
|
159
159
|
cleanup();
|
|
160
160
|
if (err) {
|
|
161
|
-
|
|
162
|
-
err.
|
|
163
|
-
|
|
161
|
+
const parts = [];
|
|
162
|
+
if (err.killed) parts.push("timeout");
|
|
163
|
+
if (err.signal) parts.push(`signal=${err.signal}`);
|
|
164
|
+
if (err.code != null) parts.push(`exit=${err.code}`);
|
|
165
|
+
if (stderr) parts.push(String(stderr).trim());
|
|
166
|
+
if (!stderr && stdout) parts.push(String(stdout).trim());
|
|
167
|
+
const error = new Error(parts.join(" | ") || "unknown error");
|
|
168
|
+
error.code = err.code;
|
|
169
|
+
error.signal = err.signal;
|
|
170
|
+
error.killed = err.killed;
|
|
171
|
+
reject(error);
|
|
164
172
|
return;
|
|
165
173
|
}
|
|
166
174
|
resolve(String(stdout).trim());
|