pi-open-agents 0.1.20 → 0.1.22

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/README.md CHANGED
@@ -271,7 +271,13 @@ Agents are loaded from multiple locations (project overrides global by name):
271
271
  | `~/.opencode/{agent,agents,mode}/*.md` | Global | OpenCode |
272
272
  | `.pi/agents/*.md` | Project | pi |
273
273
  | `.opencode/{agent,agents,mode}/*.md` | Project | OpenCode |
274
- | `.agents/*.md` | Project | Shared |
274
+ | `.agents/agents/*.md` | Project | Shared |
275
+
276
+ > **⚠️ Migration note (v0.1.22):** discovery in the shared `.agents/` directory is now
277
+ > scoped to `​.agents/agents/*.md` — previously *every* markdown file under `.agents/`
278
+ > (including `skills/` and `commands/`) was parsed as an agent and showed up in `/agents`
279
+ > and the `subagent` tool. If you relied on the loose loading, move your agent files into
280
+ > `.agents/agents/`. Skills and commands are picked up natively by pi as before. (#14)
275
281
 
276
282
  ---
277
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-open-agents",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Unified agent and subagent management for pi coding agent, with OpenCode-compatible agent definitions.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -63,6 +63,9 @@
63
63
  }
64
64
  },
65
65
  "devDependencies": {
66
+ "@earendil-works/pi-ai": "0.84.4",
67
+ "@earendil-works/pi-coding-agent": "0.84.4",
68
+ "@earendil-works/pi-tui": "0.84.4",
66
69
  "@types/node": "^24.0.0",
67
70
  "tsx": "^4.19.0",
68
71
  "typebox": "^1.3.10",
@@ -88,7 +88,7 @@ export function getDiscoveryPaths(cwd: string, agentDir: string): DiscoveryPath[
88
88
  dir: path.join(cwd, ".agents"),
89
89
  source: "project",
90
90
  family: "shared",
91
- subdirs: [""],
91
+ subdirs: ["agents"],
92
92
  });
93
93
 
94
94
  return paths;
@@ -99,6 +99,7 @@ export function getDiscoveryPaths(cwd: string, agentDir: string): DiscoveryPath[
99
99
  *
100
100
  * For pi/shared: uses the filename without extension
101
101
  * .pi/agents/my-agent.md → "my-agent"
102
+ * .agents/agents/my-agent.md → "my-agent"
102
103
  *
103
104
  * For OpenCode: strips the subdir prefix
104
105
  * .opencode/agent/triage.md → "triage"
@@ -9,11 +9,11 @@
9
9
  */
10
10
 
11
11
  import {
12
- AuthStorage,
13
12
  ModelRegistry,
14
13
  SessionManager,
15
14
  withFileMutationQueue,
16
15
  } from "@earendil-works/pi-coding-agent";
16
+ import * as piCodingAgent from "@earendil-works/pi-coding-agent";
17
17
  import { spawn } from "node:child_process";
18
18
  import { realpathSync } from "node:fs";
19
19
  import * as fs from "node:fs/promises";
@@ -416,7 +416,11 @@ export function buildModelRegistry(
416
416
  agentDir: string | undefined,
417
417
  factories: { auth?: AuthFactory; model?: RegistryFactory } = {},
418
418
  ): ContextWindowLookup | undefined {
419
- const auth = ("auth" in factories ? factories.auth : AuthStorage) as AuthFactory | undefined;
419
+ // AuthStorage was removed from newer pi-coding-agent hosts. A static named
420
+ // import of it would fail module linking on hosts that no longer export it,
421
+ // so look it up on the namespace object instead (absent → undefined).
422
+ const hostAuth = (piCodingAgent as Record<string, unknown>).AuthStorage;
423
+ const auth = ("auth" in factories ? factories.auth : hostAuth) as AuthFactory | undefined;
420
424
  const model = ("model" in factories ? factories.model : ModelRegistry) as RegistryFactory | undefined;
421
425
  try {
422
426
  if (!auth || typeof auth.create !== "function") return undefined;