heyatlas 1.9.2 → 1.9.4
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/cli.js +27 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -52144,6 +52144,7 @@ _a153 = symbol153;
|
|
|
52144
52144
|
|
|
52145
52145
|
// agents/acp-provider.ts
|
|
52146
52146
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
52147
|
+
import { homedir as homedir2 } from "node:os";
|
|
52147
52148
|
import { join as join2 } from "node:path";
|
|
52148
52149
|
var ACP_COMMANDS = {
|
|
52149
52150
|
opencode: { command: "opencode", args: ["acp"] },
|
|
@@ -52453,7 +52454,7 @@ var SMITH_OPENCODE_JSONC = `{
|
|
|
52453
52454
|
"python-docx",
|
|
52454
52455
|
"python",
|
|
52455
52456
|
"-c",
|
|
52456
|
-
"from camel.toolkits import
|
|
52457
|
+
"from camel.toolkits import FileWriteToolkit; FileWriteToolkit(working_directory=\\"\${WORKING_DIRECTORY}\\").run_mcp_server(mode=\\"stdio\\")",
|
|
52457
52458
|
],
|
|
52458
52459
|
},
|
|
52459
52460
|
"smith-excel": {
|
|
@@ -52525,17 +52526,37 @@ var SMITH_UPLOAD_PLUGIN = [
|
|
|
52525
52526
|
].join(`
|
|
52526
52527
|
`);
|
|
52527
52528
|
async function setupSmithWorkspace(cwd) {
|
|
52528
|
-
const
|
|
52529
|
-
const
|
|
52529
|
+
const resolvedCwd = resolveSmithWorkspaceCwd(cwd);
|
|
52530
|
+
const targetAgentsDir = join2(resolvedCwd, ".opencode", "agents");
|
|
52531
|
+
const targetPluginsDir = join2(resolvedCwd, ".opencode", "plugins");
|
|
52530
52532
|
mkdirSync2(targetAgentsDir, { recursive: true });
|
|
52531
52533
|
mkdirSync2(targetPluginsDir, { recursive: true });
|
|
52532
52534
|
for (const [filename, content] of Object.entries(SMITH_AGENTS)) {
|
|
52533
52535
|
writeFileSync2(join2(targetAgentsDir, filename), content);
|
|
52534
52536
|
}
|
|
52535
52537
|
writeFileSync2(join2(targetPluginsDir, "upload.js"), SMITH_UPLOAD_PLUGIN);
|
|
52536
|
-
const config3 = SMITH_OPENCODE_JSONC.replace(/\$\{WORKING_DIRECTORY\}/g,
|
|
52537
|
-
writeFileSync2(join2(
|
|
52538
|
-
console.log(
|
|
52538
|
+
const config3 = SMITH_OPENCODE_JSONC.replace(/\$\{WORKING_DIRECTORY\}/g, resolvedCwd);
|
|
52539
|
+
writeFileSync2(join2(resolvedCwd, "opencode.jsonc"), config3);
|
|
52540
|
+
console.log(`[smith] Workspace configured at ${resolvedCwd}`);
|
|
52541
|
+
}
|
|
52542
|
+
function resolveSmithWorkspaceCwd(inputCwd) {
|
|
52543
|
+
const trimmed = (inputCwd || "").trim();
|
|
52544
|
+
if (trimmed && trimmed !== "/") {
|
|
52545
|
+
return trimmed;
|
|
52546
|
+
}
|
|
52547
|
+
const envCwd = (process.env.HEYATLAS_AGENT_CWD || "").trim();
|
|
52548
|
+
if (envCwd && envCwd !== "/") {
|
|
52549
|
+
return envCwd;
|
|
52550
|
+
}
|
|
52551
|
+
const envHome = (process.env.HOME || "").trim();
|
|
52552
|
+
if (envHome && envHome !== "/") {
|
|
52553
|
+
return envHome;
|
|
52554
|
+
}
|
|
52555
|
+
const userHome = homedir2().trim();
|
|
52556
|
+
if (userHome && userHome !== "/") {
|
|
52557
|
+
return userHome;
|
|
52558
|
+
}
|
|
52559
|
+
return process.cwd();
|
|
52539
52560
|
}
|
|
52540
52561
|
|
|
52541
52562
|
class ACPProviderAgent {
|