@emiliosp/pi-maestro 0.18.1 → 0.18.3

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
@@ -3,6 +3,11 @@
3
3
  This file summarizes meaningful changes to the codebase, including behavior, data formats, architecture, and development tools. Git tags identify version boundaries;
4
4
  GitHub Releases are not required.
5
5
 
6
+ ## 0.18.2
7
+
8
+ 1. The `run` progress for `builder`, `verifier`, and `simplifier` now shows only elapsed time and the latest assistant text. The role name and the active tool no longer
9
+ appear.
10
+
6
11
  ## 0.18.1
7
12
 
8
13
  1. Running `builder`, `verifier`, and `simplifier` tools now show elapsed time, active tools, and streaming normal assistant text. Elapsed time keeps updating during
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emiliosp/pi-maestro",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "A spec-driven multiagent development workflow for Pi.",
5
5
  "keywords": [
6
6
  "orchestration",
@@ -9,13 +9,13 @@ export const DEFAULT_CONFIG_VERSION = SUPPORTED_CONFIG_VERSION;
9
9
 
10
10
  export const DEFAULT_SPEC_DIRECTORY = '.specs';
11
11
 
12
- export const DEFAULT_BUILDER_MODEL = 'openai-codex/gpt-5.6-luna';
12
+ export const DEFAULT_BUILDER_MODEL = 'openai-codex/gpt-6.1-sol';
13
13
 
14
- export const DEFAULT_BUILDER_THINKING = THINKING_LEVELS.MAX;
14
+ export const DEFAULT_BUILDER_THINKING = THINKING_LEVELS.HIGH;
15
15
 
16
- export const DEFAULT_VERIFIER_MODEL = 'openai-codex/gpt-6.1-sol';
16
+ export const DEFAULT_VERIFIER_MODEL = 'openai-codex/gpt-6-astra';
17
17
 
18
- export const DEFAULT_VERIFIER_THINKING = THINKING_LEVELS.HIGH;
18
+ export const DEFAULT_VERIFIER_THINKING = THINKING_LEVELS.MEDIUM;
19
19
 
20
20
  export const DEFAULT_SIMPLIFIER_MODEL = 'openai-codex/gpt-6.1-sol';
21
21
 
@@ -1,52 +1,44 @@
1
1
  /**
2
- * Objective: Publish agent activity and elapsed time through Pi's standard progress UI.
3
- * Used: During a delegated run, on relevant events and once per second during silence.
2
+ * Objective: Publish elapsed run time and the latest normal assistant text through Pi's progress UI.
3
+ * Used: During a delegated run, on assistant text events and once per second during silence.
4
4
  */
5
5
 
6
6
  import type { AgentToolUpdateCallback } from '@earendil-works/pi-coding-agent';
7
7
 
8
- import type { AgentActivitySnapshot } from '#src/delegation/trackAgentActivity.ts';
9
- import type { WorkflowRole } from '#workflow/roles.ts';
10
-
11
8
  type FormatProgressInput = {
12
- role: WorkflowRole;
13
9
  elapsedSeconds: number;
14
- activity: AgentActivitySnapshot;
10
+ assistantText: string;
15
11
  };
16
12
 
17
- const formatProgress = ({ role, elapsedSeconds, activity }: FormatProgressInput): string => {
18
- const label = role[0].toUpperCase() + role.slice(1);
13
+ const formatProgress = ({ elapsedSeconds, assistantText }: FormatProgressInput): string => {
19
14
  const elapsed = `${Math.floor(elapsedSeconds / 60)}m ${elapsedSeconds % 60}s`;
20
- const tools = [...activity.activeTools.values()].join(', ') || 'none';
21
- const recentText = activity.assistantText ? `\n\n${activity.assistantText}` : '';
15
+ const recentText = assistantText ? `\n\n${assistantText}` : '';
22
16
 
23
- return `${label} | Elapsed: ${elapsed} | Active tool: ${tools}${recentText}`;
17
+ return `Elapsed: ${elapsed}${recentText}`;
24
18
  };
25
19
 
26
20
  type CreateAgentProgressInput = {
27
- role: WorkflowRole;
28
21
  onUpdate?: AgentToolUpdateCallback;
29
22
  };
30
23
 
31
- export const createAgentProgress = ({ role, onUpdate }: CreateAgentProgressInput) => {
24
+ export const createAgentProgress = ({ onUpdate }: CreateAgentProgressInput) => {
32
25
  const startedAt = performance.now();
33
26
  let timer: ReturnType<typeof setInterval> | undefined;
34
27
  let stopped = false;
35
- let latestActivity: AgentActivitySnapshot = { activeTools: new Map(), assistantText: '' };
28
+ let latestText = '';
36
29
 
37
- const show = (activity: AgentActivitySnapshot = latestActivity): void => {
30
+ const show = (assistantText: string = latestText): void => {
38
31
  if (stopped) return;
39
32
 
40
- latestActivity = activity;
33
+ latestText = assistantText;
41
34
 
42
35
  onUpdate?.({
43
36
  content: [
44
37
  {
45
38
  type: 'text',
46
39
  text: formatProgress({
47
- role,
48
40
  elapsedSeconds: Math.floor((performance.now() - startedAt) / 1000),
49
- activity,
41
+ assistantText,
50
42
  }),
51
43
  },
52
44
  ],
@@ -5,15 +5,15 @@
5
5
 
6
6
  import { readFile } from 'node:fs/promises';
7
7
 
8
- import type { AgentToolUpdateCallback, ExtensionContext } from '@earendil-works/pi-coding-agent';
8
+ import type {
9
+ AgentSessionEvent,
10
+ AgentToolUpdateCallback,
11
+ ExtensionContext,
12
+ } from '@earendil-works/pi-coding-agent';
9
13
 
10
14
  import { createAgentProgress } from '#src/delegation/createAgentProgress.ts';
11
15
  import { executeTask, type ExecuteTaskInput } from '#src/delegation/executeTask.ts';
12
16
  import { TaskExecutionError } from '#src/delegation/TaskExecutionError.ts';
13
- import {
14
- trackAgentActivity,
15
- type AgentActivitySnapshot,
16
- } from '#src/delegation/trackAgentActivity.ts';
17
17
  import { recordBuilderHandoffTool } from '#tools/child/record-builder-handoff.ts';
18
18
  import { recordSimplifierHandoffTool } from '#tools/child/record-simplifier-handoff.ts';
19
19
  import { recordVerifierHandoffTool } from '#tools/child/record-verifier-handoff.ts';
@@ -25,6 +25,17 @@ const HANDOFF_TOOL_BY_ROLE = {
25
25
  [WORKFLOW_ROLES.SIMPLIFIER]: recordSimplifierHandoffTool,
26
26
  } as const;
27
27
 
28
+ const readAssistantText = (event: AgentSessionEvent): string => {
29
+ if (event.type !== 'message_update' && event.type !== 'message_end') return '';
30
+
31
+ if (event.message.role !== 'assistant') return '';
32
+
33
+ return event.message.content
34
+ .filter((block) => block.type === 'text')
35
+ .map((block) => block.text)
36
+ .join('\n');
37
+ };
38
+
28
39
  type ExecuteRoleTaskInput = Pick<
29
40
  ExecuteTaskInput,
30
41
  'prompt' | 'cwd' | 'model' | 'thinkingLevel' | 'signal'
@@ -46,8 +57,7 @@ export const executeRoleTask = async ({
46
57
  }: ExecuteRoleTaskInput): Promise<void> => {
47
58
  const roleGuidance = await readFile(new URL(`../../agents/${role}.md`, import.meta.url), 'utf8');
48
59
 
49
- let snapshot: AgentActivitySnapshot | undefined;
50
- const agentProgress = createAgentProgress({ role, onUpdate });
60
+ const agentProgress = createAgentProgress({ onUpdate });
51
61
 
52
62
  try {
53
63
  agentProgress.startShow();
@@ -64,13 +74,9 @@ export const executeRoleTask = async ({
64
74
  roleGuidance,
65
75
  additionalTools: [HANDOFF_TOOL_BY_ROLE[role]],
66
76
  onEvent: (event) => {
67
- const nextSnapshot = trackAgentActivity({ event, snapshot });
68
-
69
- if (!nextSnapshot) return;
70
-
71
- agentProgress.show(nextSnapshot);
77
+ const assistantText = readAssistantText(event);
72
78
 
73
- snapshot = nextSnapshot;
79
+ if (assistantText) agentProgress.show(assistantText);
74
80
  },
75
81
  });
76
82
 
@@ -1,48 +0,0 @@
1
- /**
2
- * Objective: Derive agent activity from a session event and the previous snapshot.
3
- * Used: During a delegated run, without mutating state or publishing progress.
4
- */
5
-
6
- import type { AgentSessionEvent } from '@earendil-works/pi-coding-agent';
7
-
8
- export type AgentActivitySnapshot = {
9
- activeTools: ReadonlyMap<string, string>;
10
- assistantText: string;
11
- };
12
-
13
- type TrackAgentActivityInput = {
14
- event: AgentSessionEvent;
15
- snapshot?: AgentActivitySnapshot;
16
- };
17
-
18
- export const trackAgentActivity = ({
19
- event,
20
- snapshot = { activeTools: new Map(), assistantText: '' },
21
- }: TrackAgentActivityInput): AgentActivitySnapshot | undefined => {
22
- if (event.type === 'tool_execution_start') {
23
- const activeTools = new Map(snapshot.activeTools);
24
- activeTools.set(event.toolCallId, event.toolName);
25
-
26
- return { ...snapshot, activeTools };
27
- }
28
-
29
- if (event.type === 'tool_execution_end') {
30
- const activeTools = new Map(snapshot.activeTools);
31
- activeTools.delete(event.toolCallId);
32
-
33
- return { ...snapshot, activeTools };
34
- }
35
-
36
- if (event.type !== 'message_update' && event.type !== 'message_end') return;
37
-
38
- if (event.message.role !== 'assistant') return;
39
-
40
- const assistantText = event.message.content
41
- .filter((block) => block.type === 'text')
42
- .map((block) => block.text)
43
- .join('\n');
44
-
45
- if (!assistantText) return;
46
-
47
- return { ...snapshot, assistantText };
48
- };