pi-subagents 0.8.0 → 0.8.1
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/CHANGELOG.md +5 -0
- package/README.md +1 -0
- package/chain-execution.ts +3 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/schemas.ts +1 -0
- package/settings.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.8.1] - 2026-02-10
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`chainDir` param** for persistent chain artifacts — specify a directory to keep artifacts beyond the default 24-hour `/tmp/` cleanup. Relative paths are resolved to absolute via `path.resolve()` for safe use in `{chain_dir}` template substitutions.
|
|
9
|
+
|
|
5
10
|
## [0.8.0] - 2026-02-09
|
|
6
11
|
|
|
7
12
|
### Added
|
package/README.md
CHANGED
|
@@ -474,6 +474,7 @@ Notes:
|
|
|
474
474
|
| `model` | string | agent default | Override model for single agent |
|
|
475
475
|
| `tasks` | `{agent, task, cwd?, skill?}[]` | - | Parallel tasks (sync only) |
|
|
476
476
|
| `chain` | ChainItem[] | - | Sequential steps with behavior overrides (see below) |
|
|
477
|
+
| `chainDir` | string | `/tmp/pi-chain-runs/` | Persistent directory for chain artifacts (default auto-cleaned after 24h) |
|
|
477
478
|
| `clarify` | boolean | true (chains) | Show TUI to preview/edit chain; implies sync mode |
|
|
478
479
|
| `agentScope` | `"user" \| "project" \| "both"` | `user` | Agent discovery scope |
|
|
479
480
|
| `async` | boolean | false | Background execution (requires `clarify: false` for chains) |
|
package/chain-execution.ts
CHANGED
|
@@ -76,6 +76,7 @@ export interface ChainExecutionParams {
|
|
|
76
76
|
clarify?: boolean;
|
|
77
77
|
onUpdate?: (r: AgentToolResult<Details>) => void;
|
|
78
78
|
chainSkills?: string[];
|
|
79
|
+
chainDir?: string;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
export interface ChainExecutionResult {
|
|
@@ -103,6 +104,7 @@ export async function executeChain(params: ChainExecutionParams): Promise<ChainE
|
|
|
103
104
|
clarify,
|
|
104
105
|
onUpdate,
|
|
105
106
|
chainSkills: chainSkillsParam,
|
|
107
|
+
chainDir: chainDirBase,
|
|
106
108
|
} = params;
|
|
107
109
|
const chainSkills = chainSkillsParam ?? [];
|
|
108
110
|
|
|
@@ -123,7 +125,7 @@ export async function executeChain(params: ChainExecutionParams): Promise<ChainE
|
|
|
123
125
|
?? (isParallelStep(firstStep) ? firstStep.parallel[0]!.task! : (firstStep as SequentialStep).task!);
|
|
124
126
|
|
|
125
127
|
// Create chain directory
|
|
126
|
-
const chainDir = createChainDir(runId);
|
|
128
|
+
const chainDir = createChainDir(runId, chainDirBase);
|
|
127
129
|
|
|
128
130
|
// Check if chain has any parallel steps
|
|
129
131
|
const hasParallelSteps = chainSteps.some(isParallelStep);
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/schemas.ts
CHANGED
|
@@ -75,6 +75,7 @@ export const SubagentParams = Type.Object({
|
|
|
75
75
|
})),
|
|
76
76
|
tasks: Type.Optional(Type.Array(TaskItem, { description: "PARALLEL mode: [{agent, task}, ...]" })),
|
|
77
77
|
chain: Type.Optional(Type.Array(ChainItem, { description: "CHAIN mode: sequential pipeline where each step's response becomes {previous} for the next. Use {task}, {previous}, {chain_dir} in task templates." })),
|
|
78
|
+
chainDir: Type.Optional(Type.String({ description: "Persistent directory for chain artifacts. Default: /tmp/pi-chain-runs/ (auto-cleaned after 24h)" })),
|
|
78
79
|
async: Type.Optional(Type.Boolean({ description: "Run in background (default: false, or per config)" })),
|
|
79
80
|
agentScope: Type.Optional(Type.String({ description: "Agent discovery scope: 'user', 'project', or 'both' (default: 'user')" })),
|
|
80
81
|
cwd: Type.Optional(Type.String()),
|
package/settings.ts
CHANGED
|
@@ -88,8 +88,8 @@ export function getStepAgents(step: ChainStep): string[] {
|
|
|
88
88
|
// Chain Directory Management
|
|
89
89
|
// =============================================================================
|
|
90
90
|
|
|
91
|
-
export function createChainDir(runId: string): string {
|
|
92
|
-
const chainDir = path.join(CHAIN_RUNS_DIR, runId);
|
|
91
|
+
export function createChainDir(runId: string, baseDir?: string): string {
|
|
92
|
+
const chainDir = path.join(baseDir ? path.resolve(baseDir) : CHAIN_RUNS_DIR, runId);
|
|
93
93
|
fs.mkdirSync(chainDir, { recursive: true });
|
|
94
94
|
return chainDir;
|
|
95
95
|
}
|