@wrongstack/tui 0.6.0 → 0.6.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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _wrongstack_core from '@wrongstack/core';
2
2
  import { Agent, SlashCommandRegistry, AttachmentStore, EventBus, TokenCounter, QueueStore, Director } from '@wrongstack/core';
3
+ export { buildGoalPreamble } from '@wrongstack/core';
3
4
  import { VisionAdapters } from '@wrongstack/runtime/vision';
4
5
  import React from 'react';
5
6
 
@@ -160,32 +161,4 @@ interface RunTuiOptions {
160
161
  }
161
162
  declare function runTui(opts: RunTuiOptions): Promise<number>;
162
163
 
163
- /**
164
- * `/goal <description>` preamble — the "no force can stop this" mode.
165
- *
166
- * Unlike STEERING (which redirects mid-flight), GOAL is a contract:
167
- * the user hands over a problem, the agent commits to verifiably
168
- * finishing it, and every iteration re-reads this preamble from the
169
- * conversation history. The hardening is entirely prompt-level —
170
- * the system has already removed implicit budget caps, so this
171
- * preamble's job is to remove the MODEL's tendency to hedge, ask
172
- * permission, or declare premature success.
173
- *
174
- * The four sections are intentional:
175
- * 1. AUTHORITY — explicit grant of unbounded fan-out + model
176
- * switching. Without this the model self-throttles ("I shouldn't
177
- * spawn too many…") even when budgets are unlimited.
178
- * 2. DONE — concrete bar for completion. Forces a verifiable
179
- * artifact (test passing, file written, bug re-run clean).
180
- * Without this the model returns "I believe it's fixed" and
181
- * counts that as done.
182
- * 3. NOT DONE — explicit anti-patterns. Each item is something we
183
- * saw real agents do as a "completion" that wasn't.
184
- * 4. PERSISTENCE — three-angle rule for blockers. Stops the model
185
- * from giving up on the first tool failure.
186
- *
187
- * Exported for the test that pins the structural guarantees.
188
- */
189
- declare function buildGoalPreamble(goal: string): string;
190
-
191
- export { type RunTuiOptions, buildGoalPreamble, runTui };
164
+ export { type RunTuiOptions, runTui };
package/dist/index.js CHANGED
@@ -2,7 +2,8 @@ import { render, useApp, Box, useStdout, Static, Text, useInput, useStdin } from
2
2
  import React2, { useState, useEffect, useReducer, useRef, useMemo } from 'react';
3
3
  import * as fs2 from 'fs/promises';
4
4
  import * as path2 from 'path';
5
- import { InputBuilder, DefaultSessionRewinder, formatTodosList, buildChildEnv } from '@wrongstack/core';
5
+ import { InputBuilder, DefaultSessionRewinder, formatTodosList, buildGoalPreamble, buildChildEnv } from '@wrongstack/core';
6
+ export { buildGoalPreamble } from '@wrongstack/core';
6
7
  import { routeImagesForModel } from '@wrongstack/runtime/vision';
7
8
  import { getProcessRegistry } from '@wrongstack/tools';
8
9
  import { readClipboardImage } from '@wrongstack/runtime/clipboard';
@@ -2702,75 +2703,6 @@ function buildSteeringPreamble(snapshot, newDirection) {
2702
2703
  lines.push("]");
2703
2704
  return lines.join("\n");
2704
2705
  }
2705
- function buildGoalPreamble(goal) {
2706
- return [
2707
- "[GOAL \u2014 LOCKED IN. You will work on this until it is verifiably done.",
2708
- "The user granted you full autonomy. Read these constraints once, then act.",
2709
- "",
2710
- "YOUR GOAL:",
2711
- "---",
2712
- goal,
2713
- "---",
2714
- "",
2715
- "AUTHORITY YOU HAVE:",
2716
- "- Spawn as many subagents as the work needs (delegate / spawn_subagent).",
2717
- " Parallel + recursive fan-out are both fine. There is no spawn budget.",
2718
- "- Use any provider/model per subagent \u2014 pick the right tool for each",
2719
- " piece of work. Heavy reasoning model for planning, fast model for",
2720
- " batch work, specialist model for domain code.",
2721
- "- Run unlimited tool calls and iterations. There is NO hidden budget.",
2722
- " The Agent loop auto-extends every 100 iterations forever.",
2723
- "- Retry failed tools with different inputs, alternative paths, fresh",
2724
- " subagents. Switch providers mid-run if one is rate-limited.",
2725
- "- Re-plan freely when an approach hits a dead end. You are not obliged",
2726
- " to stick with the first plan you proposed.",
2727
- "",
2728
- 'WHAT "DONE" MEANS \u2014 non-negotiable:',
2729
- "- You can name a concrete artifact (a passing test, a written file at",
2730
- " a specific path, a fixed bug verified by re-running the failing case,",
2731
- " a clean grep that previously had matches).",
2732
- "- You can tell the user HOW to verify it themselves in 10 seconds.",
2733
- '- You have NOT hedged. None of: "looks like it should work", "I',
2734
- ' believe this fixes it", "the changes appear correct".',
2735
- "",
2736
- "WHAT IS NOT DONE \u2014 never report any of these as completion:",
2737
- "- An error message you didn't recover from.",
2738
- '- An empty result, a 0-line file, a "no matches found" you accepted',
2739
- " without questioning the search.",
2740
- '- "Should I continue?" / "Want me to also...?" / "Let me know if you',
2741
- ' want X." Those are hedges. The user already told you to finish the',
2742
- " goal \u2014 just do it.",
2743
- "- Partial progress dressed up as success. Fixed 3 of 5 bugs = 60%",
2744
- " done, not done.",
2745
- "- A subagent's failed/timeout/stopped TaskResult that you didn't",
2746
- " respond to with a fresh attempt (different role, different model,",
2747
- " tighter prompt).",
2748
- "",
2749
- "PERSISTENCE PROTOCOL:",
2750
- "- If blocked, try at least 3 different angles before reporting the",
2751
- " problem to the user. Different tool inputs, different subagent",
2752
- " roles, different providers, different decomposition of the task.",
2753
- "- If a tool fails, read its error, alter the input, try again. Do",
2754
- " not just report the failure back.",
2755
- "- If a subagent returns useless output, respawn with a tighter prompt",
2756
- ' or a different role. Do not accept "I could not determine\u2026" as the',
2757
- " final answer.",
2758
- "- Use `ask_subagent` for one-shot questions when you don't need a",
2759
- " full delegated task.",
2760
- "",
2761
- "REPORTING:",
2762
- "- Stream short progress notes between major actions so the user can",
2763
- " monitor. Do not go silent for 50 tool calls then dump a wall of",
2764
- " text \u2014 but also do not narrate every tool call.",
2765
- "- Use the shared scratchpad (if available) to leave breadcrumbs",
2766
- " subagents can read.",
2767
- "- Final response must include: (a) what was accomplished, (b) how",
2768
- " to verify, (c) any caveats (residual TODOs, things the user",
2769
- " should know about).",
2770
- "",
2771
- "BEGIN.]"
2772
- ].join("\n");
2773
- }
2774
2706
  function App({
2775
2707
  agent,
2776
2708
  slashRegistry,
@@ -4662,6 +4594,6 @@ async function runTui(opts) {
4662
4594
  });
4663
4595
  }
4664
4596
 
4665
- export { buildGoalPreamble, runTui };
4597
+ export { runTui };
4666
4598
  //# sourceMappingURL=index.js.map
4667
4599
  //# sourceMappingURL=index.js.map