@pencil-agent/nano-pencil 1.9.1 → 1.9.2
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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { getAgentDir } from "../config.js";
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
9
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
10
10
|
import { dirname } from "node:path";
|
|
11
11
|
import { createRequire } from "node:module";
|
|
12
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -64,16 +64,23 @@ export function getSoulConfig() {
|
|
|
64
64
|
* Returns null if nanosoul is not installed
|
|
65
65
|
*/
|
|
66
66
|
export async function createSoulManager() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
// Try bundled package first
|
|
68
|
+
const bundledEntry = resolveBundledSoulEntry();
|
|
69
|
+
if (bundledEntry) {
|
|
70
|
+
try {
|
|
71
|
+
// Windows ESM requires file:// URL for absolute paths
|
|
72
|
+
const bundledUrl = pathToFileURL(bundledEntry).href;
|
|
73
|
+
const { SoulManager: SM } = await import(bundledUrl);
|
|
72
74
|
return new SM({
|
|
73
75
|
config: getSoulConfig(),
|
|
74
76
|
});
|
|
75
77
|
}
|
|
76
|
-
|
|
78
|
+
catch {
|
|
79
|
+
// Continue to node_modules fallback
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Fall back to node_modules
|
|
83
|
+
try {
|
|
77
84
|
const { SoulManager: SM } = await import("nanosoul");
|
|
78
85
|
return new SM({
|
|
79
86
|
config: getSoulConfig(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pencil-agent/nano-pencil",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "CLI writing agent with read, bash, edit, write tools and session management. Based on pi; supports DashScope Coding Plan. Soul enabled by default for AI personality evolution.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|