pi-baton 0.8.5 → 0.8.6

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 CHANGED
@@ -24,6 +24,12 @@ All notable changes to this project will be documented in this file.
24
24
 
25
25
  This project follows semantic versioning.
26
26
 
27
+ ## [0.8.6] - 2026-09-30
28
+
29
+ ### Changed
30
+
31
+ - Update `@earendil-works/pi-*` dependencies to `0.99.1`.
32
+
27
33
  ## [Unreleased]
28
34
 
29
35
  ### Added
package/README.md CHANGED
@@ -39,7 +39,7 @@ pi install npm:pi-baton
39
39
  Pin a specific version when you want reproducible installs:
40
40
 
41
41
  ```bash
42
- pi install npm:pi-baton@0.8.5
42
+ pi install npm:pi-baton@0.8.6
43
43
  ```
44
44
 
45
45
  Install into the current project instead of your user Pi settings:
@@ -52,6 +52,14 @@ function isMissingFileError(error: unknown): boolean {
52
52
  );
53
53
  }
54
54
 
55
+ async function loadWorkflowFile(
56
+ filePath: string,
57
+ options: { id: string; source: "user" | "builtin" },
58
+ ): Promise<WorkflowDefinition> {
59
+ const yamlText = await readFile(filePath, "utf8");
60
+ return parseWorkflowDocument(yamlText, { ...options, path: filePath });
61
+ }
62
+
55
63
  const UNSAFE_WORKFLOW_ID_PATTERN = /[\\/\0]/;
56
64
 
57
65
  function isSafeWorkflowId(workflowId: string): boolean {
@@ -70,23 +78,18 @@ export async function loadWorkflowById(cwd: string, workflowId: string): Promise
70
78
  throw new Error(`Unknown workflow: ${workflowId}`);
71
79
  }
72
80
 
73
- const userPath = join(getWorkflowsDir(cwd), `${workflowId}.yaml`);
74
- try {
75
- const yamlText = await readFile(userPath, "utf8");
76
- return parseWorkflowDocument(yamlText, { id: workflowId, source: "user", path: userPath });
77
- } catch (error) {
78
- if (!isMissingFileError(error)) {
79
- throw error;
80
- }
81
- }
81
+ const candidates = [
82
+ { path: join(getWorkflowsDir(cwd), `${workflowId}.yaml`), source: "user" as const },
83
+ { path: join(getPackageWorkflowsDir(), `${workflowId}.yaml`), source: "builtin" as const },
84
+ ];
82
85
 
83
- const builtinPath = join(getPackageWorkflowsDir(), `${workflowId}.yaml`);
84
- try {
85
- const yamlText = await readFile(builtinPath, "utf8");
86
- return parseWorkflowDocument(yamlText, { id: workflowId, source: "builtin", path: builtinPath });
87
- } catch (error) {
88
- if (!isMissingFileError(error)) {
89
- throw error;
86
+ for (const candidate of candidates) {
87
+ try {
88
+ return await loadWorkflowFile(candidate.path, { id: workflowId, source: candidate.source });
89
+ } catch (error) {
90
+ if (!isMissingFileError(error)) {
91
+ throw error;
92
+ }
90
93
  }
91
94
  }
92
95
 
@@ -97,6 +100,5 @@ export async function loadWorkflowFromPath(
97
100
  filePath: string,
98
101
  options: { id: string; source: "user" | "builtin" },
99
102
  ): Promise<WorkflowDefinition> {
100
- const yamlText = await readFile(filePath, "utf8");
101
- return parseWorkflowDocument(yamlText, { ...options, path: filePath });
103
+ return loadWorkflowFile(filePath, options);
102
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-baton",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Pi-native workflow baton runner with per-step model switching and isolated step context.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -58,8 +58,8 @@
58
58
  "typebox": "*"
59
59
  },
60
60
  "devDependencies": {
61
- "@earendil-works/pi-ai": "^0.84.1",
62
- "@earendil-works/pi-coding-agent": "^0.84.1",
61
+ "@earendil-works/pi-ai": "^0.99.1",
62
+ "@earendil-works/pi-coding-agent": "^0.99.1",
63
63
  "typebox": "latest",
64
64
  "@types/node": "^26.0.1",
65
65
  "typescript": "^7.0.2"