@pellux/goodvibes-tui 0.19.85 → 0.19.87

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.
@@ -19,19 +19,6 @@ type AgentTaskArgs = {
19
19
  readonly [key: string]: unknown;
20
20
  };
21
21
 
22
- const OWNER_BLOCKED_TEMPLATES = new Set(['reviewer', 'review', 'verifier', 'tester', 'test']);
23
- const OWNER_BLOCKED_TASK_PREFIXES = [
24
- 'review ',
25
- 'review:',
26
- 'review the ',
27
- 'verify ',
28
- 'verify:',
29
- 'verify the ',
30
- 'test ',
31
- 'test:',
32
- 'test the ',
33
- ];
34
-
35
22
  export function installWrfcAgentToolGuard(registry: ToolRegistry): void {
36
23
  const agentTool = registry.list().find((tool) => tool.definition.name === 'agent');
37
24
  if (!agentTool) throw new Error('WRFC agent guard could not find the agent tool.');
@@ -48,17 +35,9 @@ export function wrapWrfcAgentTool(tool: Tool): void {
48
35
  }
49
36
 
50
37
  export function validateWrfcAgentToolInvocation(args: AgentToolArgs): string | null {
51
- if (args.mode === 'spawn') {
52
- if (isExplicitWrfcTask(args, args) && isBlockedRootTask(args, args)) {
53
- return [
54
- 'WRFC spawn blocked: a WRFC root task must be an owner/engineer task, not a reviewer/verifier/tester task.',
55
- 'Spawn one engineer/general owner with reviewMode:"wrfc"; WRFC creates reviewer and fixer agents only after owner output exists.',
56
- ].join(' ');
57
- }
58
- return null;
59
- }
60
-
61
- if (args.mode !== 'batch-spawn') return null;
38
+ if (args.mode !== 'spawn' && args.mode !== 'batch-spawn') return null;
39
+ // SDK owns WRFC topology enforcement. TUI must not block reviewer/tester/
40
+ // verifier root requests because the SDK normalizes those into owner chains.
62
41
  return null;
63
42
  }
64
43
 
@@ -81,23 +60,17 @@ export function normalizeWrfcAgentToolInvocation(args: AgentToolArgs): AgentTool
81
60
  : { ...task, reviewMode: 'none', dangerously_disable_wrfc: true }),
82
61
  };
83
62
  }
84
- if (tasks.length === 1 && wrfcTasks.length === 1 && !isBlockedRootTask(tasks[0], args)) {
63
+ if (wrfcTasks.length > 0) {
85
64
  return {
86
65
  ...args,
87
66
  reviewMode: 'wrfc',
88
67
  dangerously_disable_wrfc: false,
89
- tasks: [{ ...tasks[0], reviewMode: 'wrfc', dangerously_disable_wrfc: false }],
68
+ tasks: tasks.map((task) => isExplicitWrfcTask(task, args)
69
+ ? { ...task, reviewMode: 'wrfc', dangerously_disable_wrfc: false }
70
+ : task),
90
71
  };
91
72
  }
92
-
93
- const ownerTask = buildCollapsedWrfcOwnerTask(args, tasks);
94
- return {
95
- ...args,
96
- template: normalizeOwnerTemplate(args.template),
97
- reviewMode: 'wrfc',
98
- dangerously_disable_wrfc: false,
99
- tasks: [ownerTask],
100
- };
73
+ return args;
101
74
  }
102
75
 
103
76
  function isRecord(value: unknown): value is AgentTaskArgs {
@@ -113,53 +86,6 @@ function isExplicitWrfcTask(task: AgentTaskArgs, root: AgentToolArgs): boolean {
113
86
  || containsWrfcSignal(root.task);
114
87
  }
115
88
 
116
- function isBlockedOwnerTemplate(value: unknown): boolean {
117
- if (typeof value !== 'string') return false;
118
- return OWNER_BLOCKED_TEMPLATES.has(value.trim().toLowerCase());
119
- }
120
-
121
- function isBlockedRootTask(task: AgentTaskArgs, root: AgentToolArgs): boolean {
122
- if (isBlockedOwnerTemplate(task.template ?? root.template)) return true;
123
- if (typeof task.task !== 'string') return false;
124
- const normalized = task.task.trim().toLowerCase();
125
- return OWNER_BLOCKED_TASK_PREFIXES.some((prefix) => normalized.startsWith(prefix));
126
- }
127
-
128
- function normalizeOwnerTemplate(value: unknown): string {
129
- if (isBlockedOwnerTemplate(value)) return 'engineer';
130
- return typeof value === 'string' && value.trim().length > 0 ? value : 'engineer';
131
- }
132
-
133
- function buildCollapsedWrfcOwnerTask(root: AgentToolArgs, taskList: AgentTaskArgs[]): AgentTaskArgs {
134
- const firstOwner = taskList.find((task) => isExplicitWrfcTask(task, root) && !isBlockedRootTask(task, root))
135
- ?? taskList.find((task) => !isBlockedRootTask(task, root))
136
- ?? taskList[0]
137
- ?? {};
138
- const taskLines = taskList.map((task, index) => {
139
- const body = typeof task.task === 'string' && task.task.trim().length > 0 ? task.task.trim() : '(missing task text)';
140
- const template = typeof task.template === 'string' && task.template.trim().length > 0 ? task.template.trim() : 'default';
141
- return `${index + 1}. [${template}] ${body}`;
142
- });
143
- const rootTask = typeof root.task === 'string' && root.task.trim().length > 0
144
- ? `\n\nRoot task:\n${root.task.trim()}`
145
- : '';
146
- return {
147
- ...firstOwner,
148
- task: [
149
- 'Complete the requested work as a single WRFC owner chain.',
150
- 'Do not spawn reviewer, verifier, tester, or parallel root WRFC agents yourself.',
151
- 'Use the attempted batch items below as context for one coherent owner deliverable; the WRFC controller will create review/fix agents after owner output exists.',
152
- rootTask,
153
- '',
154
- 'Attempted batch items:',
155
- ...taskLines,
156
- ].join('\n'),
157
- template: normalizeOwnerTemplate(firstOwner.template ?? root.template),
158
- reviewMode: 'wrfc',
159
- dangerously_disable_wrfc: false,
160
- };
161
- }
162
-
163
89
  function containsWrfcSignal(value: unknown): boolean {
164
90
  if (typeof value !== 'string') return false;
165
91
  return /\bwrfc\b|work[-\s]*review[-\s]*fix/i.test(value);
package/src/version.ts CHANGED
@@ -6,7 +6,7 @@ import { join } from 'node:path';
6
6
  // The prebuild script updates the fallback value before compilation.
7
7
  // Uses import.meta.dir (Bun) to locate package.json relative to this file,
8
8
  // which is correct regardless of the process working directory.
9
- let _version = '0.19.85';
9
+ let _version = '0.19.87';
10
10
  try {
11
11
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8'));
12
12
  _version = pkg.version ?? _version;