@wichayutdew/pi-workflows 2.7.1 → 3.1.0

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
@@ -33,8 +33,7 @@ dictating your language, framework, or delivery process.
33
33
  - Keep worktree-bound iterations safe, including follow-up enhancements.
34
34
  - Enforce declared resources and stop unsafe loops before they run away.
35
35
  - Assign a workflow-owned role prompt with `agent: planner`, `worker`,
36
- `reviewer`, or `scout`; customize profiles under your user workflow
37
- directory's `agents/` folder.
36
+ `reviewer`, or `scout`; customize profiles under `~/.agents/agents`.
38
37
 
39
38
  ## Herdr workflow status
40
39
 
package/dist/index.js CHANGED
@@ -3724,9 +3724,7 @@ class WorkflowStatusView {
3724
3724
  }
3725
3725
  invalidate() {}
3726
3726
  handleInput(data) {
3727
- const isDetailHalfPageDown = this.state.mode === "detail" && matchesKey(data, Key.ctrl("d"));
3728
- const isDetailHalfPageUp = this.state.mode === "detail" && matchesKey(data, Key.ctrl("u"));
3729
- if (data === "q" || data === "Q" || matchesKey(data, "ctrl+c") || this.state.mode !== "detail" && matchesKey(data, "ctrl+d") || matchesKey(data, this.statusShortcut)) {
3727
+ if (data === "q" || data === "Q" || matchesKey(data, "ctrl+c") || this.state.mode === "board" && matchesKey(data, "ctrl+d") || matchesKey(data, this.statusShortcut)) {
3730
3728
  this.close();
3731
3729
  return;
3732
3730
  }
@@ -3772,9 +3770,9 @@ class WorkflowStatusView {
3772
3770
  this.setScrollOffset(this.state.scrollOffset + 1);
3773
3771
  } else if (matchesKey(data, Key.up) || data === "k") {
3774
3772
  this.setScrollOffset(this.state.scrollOffset - 1);
3775
- } else if (isDetailHalfPageDown) {
3773
+ } else if (matchesKey(data, Key.ctrl("d"))) {
3776
3774
  this.setScrollOffset(this.state.scrollOffset + halfPageSize);
3777
- } else if (isDetailHalfPageUp) {
3775
+ } else if (matchesKey(data, Key.ctrl("u"))) {
3778
3776
  this.setScrollOffset(this.state.scrollOffset - halfPageSize);
3779
3777
  } else if (matchesKey(data, Key.pageDown)) {
3780
3778
  this.setScrollOffset(this.state.scrollOffset + pageSize);
@@ -5511,6 +5509,7 @@ function buildMainWorkflowNotice(workflow, run, statusShortcutLabel = "Ctrl+Alt+
5511
5509
  }
5512
5510
  // src/agents/profile.ts
5513
5511
  import { existsSync as existsSync2, readFileSync } from "node:fs";
5512
+ import { homedir as homedir3 } from "node:os";
5514
5513
  import { join as join5 } from "node:path";
5515
5514
  import { fileURLToPath } from "node:url";
5516
5515
  import { parse } from "yaml";
@@ -5559,8 +5558,9 @@ function parseAgentProfile(source, name) {
5559
5558
  ...typeof thinking === "string" ? { thinking } : {}
5560
5559
  };
5561
5560
  }
5562
- function loadAgentProfile(name, userDirectory = defaultUserWorkflowDirectory2()) {
5563
- const userPath = join5(userDirectory, "agents", `${name}.md`);
5561
+ var DEFAULT_AGENT_PROFILE_DIRECTORY = join5(homedir3(), ".agents", "agents");
5562
+ function loadAgentProfile(name, agentProfileDirectory = DEFAULT_AGENT_PROFILE_DIRECTORY) {
5563
+ const userPath = join5(agentProfileDirectory, `${name}.md`);
5564
5564
  const bundledUrl = new URL(`../../examples/starter-kit/agents/${name}.md`, import.meta.url);
5565
5565
  const path = existsSync2(userPath) ? userPath : fileURLToPath(bundledUrl);
5566
5566
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wichayutdew/pi-workflows",
3
- "version": "2.7.1",
3
+ "version": "3.1.0",
4
4
  "description": "A declarative, pauseable workflow harness for Pi",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,8 +1,8 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
2
3
  import { join } from 'node:path';
3
4
  import { fileURLToPath } from 'node:url';
4
5
  import { parse } from 'yaml';
5
- import { defaultUserWorkflowDirectory } from '../config/load.ts';
6
6
 
7
7
  export const THINKING_LEVELS = [
8
8
  'off',
@@ -74,12 +74,14 @@ export function parseAgentProfile(source: string, name: string): AgentProfile {
74
74
  };
75
75
  }
76
76
 
77
+ const DEFAULT_AGENT_PROFILE_DIRECTORY = join(homedir(), '.agents', 'agents');
78
+
77
79
  /** Loads a user-owned agent profile, with a bundled prompt-only fallback. */
78
80
  export function loadAgentProfile(
79
81
  name: string,
80
- userDirectory = defaultUserWorkflowDirectory(),
82
+ agentProfileDirectory = DEFAULT_AGENT_PROFILE_DIRECTORY,
81
83
  ): AgentProfile {
82
- const userPath = join(userDirectory, 'agents', `${name}.md`);
84
+ const userPath = join(agentProfileDirectory, `${name}.md`);
83
85
  const bundledUrl = new URL(
84
86
  `../../examples/starter-kit/agents/${name}.md`,
85
87
  import.meta.url,
@@ -182,15 +182,11 @@ export class WorkflowStatusView implements Component {
182
182
 
183
183
  /** Handle close and scrolling key input. */
184
184
  handleInput(data: string): void {
185
- const isDetailHalfPageDown =
186
- this.state.mode === 'detail' && matchesKey(data, Key.ctrl('d'));
187
- const isDetailHalfPageUp =
188
- this.state.mode === 'detail' && matchesKey(data, Key.ctrl('u'));
189
185
  if (
190
186
  data === 'q' ||
191
187
  data === 'Q' ||
192
188
  matchesKey(data, 'ctrl+c') ||
193
- (this.state.mode !== 'detail' && matchesKey(data, 'ctrl+d')) ||
189
+ (this.state.mode === 'board' && matchesKey(data, 'ctrl+d')) ||
194
190
  matchesKey(data, this.statusShortcut)
195
191
  ) {
196
192
  this.close();
@@ -234,9 +230,9 @@ export class WorkflowStatusView implements Component {
234
230
  this.setScrollOffset(this.state.scrollOffset + 1);
235
231
  } else if (matchesKey(data, Key.up) || data === 'k') {
236
232
  this.setScrollOffset(this.state.scrollOffset - 1);
237
- } else if (isDetailHalfPageDown) {
233
+ } else if (matchesKey(data, Key.ctrl('d'))) {
238
234
  this.setScrollOffset(this.state.scrollOffset + halfPageSize);
239
- } else if (isDetailHalfPageUp) {
235
+ } else if (matchesKey(data, Key.ctrl('u'))) {
240
236
  this.setScrollOffset(this.state.scrollOffset - halfPageSize);
241
237
  } else if (matchesKey(data, Key.pageDown)) {
242
238
  this.setScrollOffset(this.state.scrollOffset + pageSize);