@illusoryai/pi-agents 0.1.3 → 0.1.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/agents/td-worker.md +4 -10
- package/install.mjs +61 -0
- package/package.json +4 -1
package/agents/td-worker.md
CHANGED
|
@@ -16,22 +16,16 @@ Your mission is to:
|
|
|
16
16
|
3. **Execute implementation** - Write code, make changes, run tests
|
|
17
17
|
4. **Log progress** - Use `td log` to document each major step
|
|
18
18
|
5. **Communicate** - Use `td comment` for messages to other agents/sessions
|
|
19
|
-
6. **Complete properly** - Use `td
|
|
19
|
+
6. **Complete properly** - Use `td done` when finished successfully
|
|
20
20
|
|
|
21
21
|
You have full access to read, write, edit files and execute commands. You also have the td tool for task management.
|
|
22
22
|
|
|
23
23
|
**TD Workflow (MANDATORY):**
|
|
24
24
|
- Start work with `td start <id>` (if not already started)
|
|
25
|
-
- Log major progress with `td log "message"`
|
|
26
|
-
- Log decisions with `td log --decision "chose X because Y"`
|
|
27
|
-
- Log blockers with `td log --blocker "stuck on X"`
|
|
28
|
-
- Track files with `td link <id> <files...>`
|
|
25
|
+
- Log major progress with `td log <id> "message"`
|
|
29
26
|
- Add comments for other agents with `td comment <id> "message"`
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- Submit for review with `td review <id>` when work is complete
|
|
33
|
-
- Use `td dep add <id> <depends-on>` if you discover dependencies
|
|
34
|
-
- Use `td block <id>` if blocked by an unresolved dependency
|
|
27
|
+
- Mark complete with `td done <id>` when finished
|
|
28
|
+
- Use `td block <id> --on <blocker-id>` if blocked
|
|
35
29
|
|
|
36
30
|
**Implementation Guidelines:**
|
|
37
31
|
- Follow the plan from plan.md step-by-step
|
package/install.mjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @illusoryai/pi-agents postinstall
|
|
4
|
+
* Auto-installs peer dependencies and registers them in pi settings.
|
|
5
|
+
*/
|
|
6
|
+
import { execSync } from "node:child_process";
|
|
7
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { join, dirname } from "node:path";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
|
|
12
|
+
const PEERS = ["pi-subagents"];
|
|
13
|
+
|
|
14
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const globalModules = join(__dirname, "..", "..");
|
|
16
|
+
|
|
17
|
+
// 1. Install missing peer deps globally
|
|
18
|
+
for (const peer of PEERS) {
|
|
19
|
+
const peerPath = join(globalModules, peer);
|
|
20
|
+
if (!existsSync(peerPath)) {
|
|
21
|
+
console.log(`[pi-agents] Installing peer: ${peer}`);
|
|
22
|
+
try {
|
|
23
|
+
execSync(`npm install -g ${peer}`, { stdio: "pipe" });
|
|
24
|
+
console.log(`[pi-agents] Installed ${peer}`);
|
|
25
|
+
} catch {
|
|
26
|
+
console.warn(
|
|
27
|
+
`[pi-agents] Could not auto-install ${peer}. Run: pi install npm:${peer}`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 2. Ensure peer deps are registered in pi settings
|
|
34
|
+
const home = process.env.SUDO_USER
|
|
35
|
+
? join("/home", process.env.SUDO_USER)
|
|
36
|
+
: homedir();
|
|
37
|
+
const settingsPath = join(home, ".pi", "agent", "settings.json");
|
|
38
|
+
|
|
39
|
+
if (existsSync(settingsPath)) {
|
|
40
|
+
try {
|
|
41
|
+
const settings = JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
42
|
+
const packages = settings.packages || [];
|
|
43
|
+
let changed = false;
|
|
44
|
+
|
|
45
|
+
for (const peer of PEERS) {
|
|
46
|
+
const entry = `npm:${peer}`;
|
|
47
|
+
if (!packages.includes(entry)) {
|
|
48
|
+
packages.push(entry);
|
|
49
|
+
changed = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (changed) {
|
|
54
|
+
settings.packages = packages;
|
|
55
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
56
|
+
console.log("[pi-agents] Updated pi settings with peer deps");
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
// Don't fail install on settings update error
|
|
60
|
+
}
|
|
61
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illusoryai/pi-agents",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"pi-package"
|
|
8
8
|
],
|
|
9
9
|
"description": "Agent orchestration and governance definitions for pi",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"postinstall": "node install.mjs"
|
|
12
|
+
},
|
|
10
13
|
"pi": {
|
|
11
14
|
"agents": [
|
|
12
15
|
"./agents"
|