@wrongstack/tools 0.1.7 → 0.1.8
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/builtin.js +4 -13
- package/dist/builtin.js.map +1 -1
- package/dist/index.js +4 -13
- package/dist/index.js.map +1 -1
- package/dist/scaffold.js +5 -5
- package/dist/scaffold.js.map +1 -1
- package/dist/tool-use.js +0 -8
- package/dist/tool-use.js.map +1 -1
- package/package.json +2 -2
package/dist/builtin.js
CHANGED
|
@@ -6,7 +6,6 @@ import { spawn } from 'child_process';
|
|
|
6
6
|
import * as os from 'os';
|
|
7
7
|
import * as dns from 'dns/promises';
|
|
8
8
|
import * as net from 'net';
|
|
9
|
-
import * as fsSync from 'fs';
|
|
10
9
|
import { statSync } from 'fs';
|
|
11
10
|
|
|
12
11
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
@@ -3588,7 +3587,7 @@ var scaffoldTool = {
|
|
|
3588
3587
|
const vars = { name, ...input.vars };
|
|
3589
3588
|
const builtIn = BUILT_IN_TEMPLATES[input.template];
|
|
3590
3589
|
if (builtIn) {
|
|
3591
|
-
return handleBuiltIn(name, builtIn.files, cwd, input.dry_run ?? false, vars);
|
|
3590
|
+
return await handleBuiltIn(name, builtIn.files, cwd, input.dry_run ?? false, vars);
|
|
3592
3591
|
}
|
|
3593
3592
|
return {
|
|
3594
3593
|
template: input.template,
|
|
@@ -3600,15 +3599,15 @@ var scaffoldTool = {
|
|
|
3600
3599
|
};
|
|
3601
3600
|
}
|
|
3602
3601
|
};
|
|
3603
|
-
function handleBuiltIn(name, templateFiles, cwd, dryRun, vars) {
|
|
3602
|
+
async function handleBuiltIn(name, templateFiles, cwd, dryRun, vars) {
|
|
3604
3603
|
const files = [];
|
|
3605
3604
|
let filesCreated = 0;
|
|
3606
3605
|
for (const [filePath, content] of Object.entries(templateFiles)) {
|
|
3607
3606
|
const resolvedPath = substituteVars(filePath, name, vars);
|
|
3608
3607
|
const fullPath = path.join(cwd, resolvedPath);
|
|
3609
3608
|
if (!dryRun) {
|
|
3610
|
-
|
|
3611
|
-
|
|
3609
|
+
await fs4.mkdir(path.dirname(fullPath), { recursive: true });
|
|
3610
|
+
await fs4.writeFile(fullPath, substituteVars(content, name, vars), "utf8");
|
|
3612
3611
|
}
|
|
3613
3612
|
files.push(resolvedPath);
|
|
3614
3613
|
filesCreated++;
|
|
@@ -3748,14 +3747,6 @@ var toolUseTool = {
|
|
|
3748
3747
|
executionMs: Date.now() - start
|
|
3749
3748
|
};
|
|
3750
3749
|
}
|
|
3751
|
-
if (tool.permission === "confirm" && input.input) {
|
|
3752
|
-
return {
|
|
3753
|
-
tool: input.tool,
|
|
3754
|
-
success: false,
|
|
3755
|
-
error: `tool_use: tool "${input.tool}" requires confirmation`,
|
|
3756
|
-
executionMs: Date.now() - start
|
|
3757
|
-
};
|
|
3758
|
-
}
|
|
3759
3750
|
try {
|
|
3760
3751
|
const result = await tool.execute(input.input, ctx, opts);
|
|
3761
3752
|
return {
|