@vtstech/pi-soul 1.2.1 → 1.2.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.
- package/package.json +3 -3
- package/soul.js +17 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtstech/pi-soul",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "SoulSpec extension for Pi Coding Agent - Load and manage AI agent personas",
|
|
5
5
|
"main": "dist/soul.js",
|
|
6
6
|
"keywords": [
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"url": "https://github.com/VTSTech/pi-coding-agent"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@vtstech/pi-shared": "1.2.
|
|
25
|
+
"@vtstech/pi-shared": "1.2.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@mariozechner/pi-coding-agent": ">=0.66"
|
|
29
29
|
},
|
|
30
30
|
"pi": {
|
|
31
|
-
"extensions": ["./soul.js"]
|
|
31
|
+
"extensions": ["./dist/soul.js"]
|
|
32
32
|
}
|
|
33
33
|
}
|
package/soul.js
CHANGED
|
@@ -4222,6 +4222,7 @@ __export(typebox_exports, {
|
|
|
4222
4222
|
// .build-npm/soul/soul.temp.ts
|
|
4223
4223
|
import { debugLog } from "@vtstech/pi-shared/debug";
|
|
4224
4224
|
import { EXTENSION_VERSION } from "@vtstech/pi-shared/ollama";
|
|
4225
|
+
import path from "path";
|
|
4225
4226
|
var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
4226
4227
|
Environment2["VIRTUAL"] = "virtual";
|
|
4227
4228
|
Environment2["EMBODIED"] = "embodied";
|
|
@@ -4260,11 +4261,11 @@ var SoulSpecLoader = class {
|
|
|
4260
4261
|
// Current directory souls
|
|
4261
4262
|
];
|
|
4262
4263
|
}
|
|
4263
|
-
resolveSoulPath(
|
|
4264
|
+
resolveSoulPath(path2) {
|
|
4264
4265
|
const locations = [
|
|
4265
|
-
|
|
4266
|
+
path2,
|
|
4266
4267
|
// Absolute or relative path
|
|
4267
|
-
...this.soulsDirs.map((dir) => `${dir}/${
|
|
4268
|
+
...this.soulsDirs.map((dir) => `${dir}/${path2}`)
|
|
4268
4269
|
// All configured souls directories
|
|
4269
4270
|
];
|
|
4270
4271
|
for (const location of locations) {
|
|
@@ -4287,8 +4288,8 @@ var SoulSpecLoader = class {
|
|
|
4287
4288
|
if (this.cache.has(cacheKey)) {
|
|
4288
4289
|
return this.cache.get(cacheKey);
|
|
4289
4290
|
}
|
|
4290
|
-
const soulDir = __require("fs").statSync(resolvedPath).isFile() ?
|
|
4291
|
-
const manifestPath =
|
|
4291
|
+
const soulDir = __require("fs").statSync(resolvedPath).isFile() ? path.dirname(resolvedPath) : resolvedPath;
|
|
4292
|
+
const manifestPath = path.join(soulDir, "soul.json");
|
|
4292
4293
|
if (!__require("fs").existsSync(manifestPath)) {
|
|
4293
4294
|
throw new Error(`No soul.json found at: ${manifestPath}`);
|
|
4294
4295
|
}
|
|
@@ -4414,12 +4415,12 @@ var SoulSpecLoader = class {
|
|
|
4414
4415
|
};
|
|
4415
4416
|
}
|
|
4416
4417
|
async loadLevel2(manifest, soulDir) {
|
|
4417
|
-
const soulPath =
|
|
4418
|
+
const soulPath = path.join(soulDir, manifest.files.soul);
|
|
4418
4419
|
if (__require("fs").existsSync(soulPath)) {
|
|
4419
4420
|
manifest.soul_content = __require("fs").readFileSync(soulPath, "utf-8");
|
|
4420
4421
|
}
|
|
4421
4422
|
if (manifest.files.identity) {
|
|
4422
|
-
const identityPath =
|
|
4423
|
+
const identityPath = path.join(soulDir, manifest.files.identity);
|
|
4423
4424
|
if (__require("fs").existsSync(identityPath)) {
|
|
4424
4425
|
manifest.identity_content = __require("fs").readFileSync(identityPath, "utf-8");
|
|
4425
4426
|
}
|
|
@@ -4427,45 +4428,45 @@ var SoulSpecLoader = class {
|
|
|
4427
4428
|
}
|
|
4428
4429
|
async loadLevel3(manifest, soulDir) {
|
|
4429
4430
|
if (manifest.files.agents) {
|
|
4430
|
-
const agentsPath =
|
|
4431
|
+
const agentsPath = path.join(soulDir, manifest.files.agents);
|
|
4431
4432
|
if (__require("fs").existsSync(agentsPath)) {
|
|
4432
4433
|
manifest.agents_content = __require("fs").readFileSync(agentsPath, "utf-8");
|
|
4433
4434
|
}
|
|
4434
4435
|
}
|
|
4435
4436
|
if (manifest.files.style) {
|
|
4436
|
-
const stylePath =
|
|
4437
|
+
const stylePath = path.join(soulDir, manifest.files.style);
|
|
4437
4438
|
if (__require("fs").existsSync(stylePath)) {
|
|
4438
4439
|
manifest.style_content = __require("fs").readFileSync(stylePath, "utf-8");
|
|
4439
4440
|
}
|
|
4440
4441
|
}
|
|
4441
4442
|
if (manifest.files.heartbeat) {
|
|
4442
|
-
const heartbeatPath =
|
|
4443
|
+
const heartbeatPath = path.join(soulDir, manifest.files.heartbeat);
|
|
4443
4444
|
if (__require("fs").existsSync(heartbeatPath)) {
|
|
4444
4445
|
manifest.heartbeat_content = __require("fs").readFileSync(heartbeatPath, "utf-8");
|
|
4445
4446
|
}
|
|
4446
4447
|
}
|
|
4447
4448
|
if (manifest.files.user_template) {
|
|
4448
|
-
const templatePath =
|
|
4449
|
+
const templatePath = path.join(soulDir, manifest.files.user_template);
|
|
4449
4450
|
if (__require("fs").existsSync(templatePath)) {
|
|
4450
4451
|
manifest.user_template_content = __require("fs").readFileSync(templatePath, "utf-8");
|
|
4451
4452
|
}
|
|
4452
4453
|
}
|
|
4453
4454
|
if (manifest.examples) {
|
|
4454
4455
|
if (manifest.examples.good) {
|
|
4455
|
-
const goodPath =
|
|
4456
|
+
const goodPath = path.join(soulDir, manifest.examples.good);
|
|
4456
4457
|
if (__require("fs").existsSync(goodPath)) {
|
|
4457
4458
|
manifest.examples_good_content = __require("fs").readFileSync(goodPath, "utf-8");
|
|
4458
4459
|
}
|
|
4459
4460
|
}
|
|
4460
4461
|
if (manifest.examples.bad) {
|
|
4461
|
-
const badPath =
|
|
4462
|
+
const badPath = path.join(soulDir, manifest.examples.bad);
|
|
4462
4463
|
if (__require("fs").existsSync(badPath)) {
|
|
4463
4464
|
manifest.examples_bad_content = __require("fs").readFileSync(badPath, "utf-8");
|
|
4464
4465
|
}
|
|
4465
4466
|
}
|
|
4466
4467
|
}
|
|
4467
4468
|
if (manifest.files.avatar) {
|
|
4468
|
-
const avatarPath =
|
|
4469
|
+
const avatarPath = path.join(soulDir, manifest.files.avatar);
|
|
4469
4470
|
if (__require("fs").existsSync(avatarPath)) {
|
|
4470
4471
|
manifest.avatar_path = avatarPath;
|
|
4471
4472
|
}
|
|
@@ -4577,13 +4578,13 @@ Safety: ${ps.contact_policy} contact policy`);
|
|
|
4577
4578
|
const souls = [];
|
|
4578
4579
|
const seenSouls = /* @__PURE__ */ new Set();
|
|
4579
4580
|
for (const soulsDir of this.soulsDirs) {
|
|
4580
|
-
const resolvedDir =
|
|
4581
|
+
const resolvedDir = path.resolve(soulsDir);
|
|
4581
4582
|
try {
|
|
4582
4583
|
if (__require("fs").existsSync(resolvedDir)) {
|
|
4583
4584
|
const entries = __require("fs").readdirSync(resolvedDir, { withFileTypes: true });
|
|
4584
4585
|
for (const entry of entries) {
|
|
4585
4586
|
if (entry.isDirectory() && !seenSouls.has(entry.name)) {
|
|
4586
|
-
const soulJsonPath =
|
|
4587
|
+
const soulJsonPath = path.join(resolvedDir, entry.name, "soul.json");
|
|
4587
4588
|
if (__require("fs").existsSync(soulJsonPath)) {
|
|
4588
4589
|
souls.push(entry.name);
|
|
4589
4590
|
seenSouls.add(entry.name);
|