@orbit-intelligence/orbit-agent 0.3.12 → 0.3.13

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.
@@ -56,6 +56,11 @@ ${skillsBlock}
56
56
  4. Verify. Run the project's checks yourself before claiming success: \`npm test\`, \`node --test dist/tests/*.test.js\`, \`npm run typecheck\`, \`npm run build\` — as applicable. NEVER assume test commands; find them in package.json.
57
57
  5. Reflect. After a tool returns, read the result, note in one line what it tells you and what you're doing next, then decide: more work, or final answer. Keep working and iterating until the task is verifiably done — you decide when it is done, not a fixed number of steps. If a step yields unexpected results, adapt and continue.
58
58
 
59
+ # Narration order (output protocol)
60
+ - Every message that calls a tool MUST begin with a short narration BEFORE the first tool call, in the same message — one sentence stating what the imminent call will do and why. Never lead a message with a tool call, and never narrate an action in a way that implies you are about to do something you already did.
61
+ - Say the intent, then act. For example: "I'll list the directory to see the layout." then call list_dir. Do not list the directory first and explain afterwards.
62
+ - Batch: when several calls are truly independent, put them in one message instead of one call per round trip. Fewer round trips = faster for the user.
63
+
59
64
  # Tool discipline
60
65
  - Explore with glob/grep before reading whole files. Use absolute paths with file tools.
61
66
  - run_shell: one focused command per call. Before commands that modify files or system state, give a brief explanation of purpose and impact. Avoid interactive commands that can hang; use non-interactive flags instead.
@@ -65,7 +70,7 @@ ${skillsBlock}
65
70
 
66
71
  # Output style
67
72
  - Be concise and direct. Keep responses short unless the user asks for detail.
68
- - Show your working across steps: a one-line intent before a tool call and a one-line finding/next step after each tool result. Do not recap the whole session at the end — just give the final answer.
73
+ - Show your working across steps: after a tool result, give a one-line finding/next step. Do not recap the whole session at the end — just give the final answer.
69
74
  - Use Markdown for structure. Quote exact paths (path:line) when referring to code.
70
75
  - No emojis unless asked. Do not add code explanations unless asked.
71
76
 
@@ -149,6 +149,11 @@ export class AgentLoop {
149
149
  return { turns: this.turnCount, error: err?.message ?? String(err) };
150
150
  }
151
151
  }
152
+ // The narration is fully streamed and tools haven't executed yet. Let the
153
+ // TUI reveal the whole message (snap the typewriter to the end) so the
154
+ // text sits above the tool rows BEFORE the tools start running — the
155
+ // user should see "intent first, then action".
156
+ bus.emit('onAssistantGenerationDone', asstMsg);
152
157
  asstMsg.streaming = false;
153
158
  asstMsg.reasoningOpen = (asstMsg.reasoning?.length ?? 0) > 0;
154
159
  asstMsg.toolCalls = toolCalls;
@@ -10,6 +10,7 @@ const FORWARDED_EVENTS = [
10
10
  'onToolStart',
11
11
  'onToolUpdate',
12
12
  'onToolEnd',
13
+ 'onAssistantGenerationDone',
13
14
  'onAssistantEnd',
14
15
  'onError',
15
16
  'onRoute',
@@ -126,6 +126,13 @@ export class TuiApp {
126
126
  });
127
127
  this.bus.on('onToolUpdate', (call) => this.applyToolState(call));
128
128
  this.bus.on('onToolEnd', (call) => this.applyToolState(call));
129
+ // Narration for this message is fully streamed and tools have not run yet.
130
+ // Flush the reveal so the text is fully visible above the tool rows before
131
+ // the tools start — users see the intent, then the action.
132
+ this.bus.on('onAssistantGenerationDone', () => {
133
+ this.store.revealAll();
134
+ this.store.refresh();
135
+ });
129
136
  this.bus.on('onAssistantEnd', (msg) => {
130
137
  this.store.streaming = false;
131
138
  this.store.cancelArmed = false;
@@ -22,8 +22,8 @@ const SLASH_COMMANDS = [
22
22
  // Word-to-word reveal pacing. Servers stream sentence-sized chunks; the reveal
23
23
  // cursor films their contents out at a steady character rate, word-aligned, so
24
24
  // output reads "word by word" instead of "sentence by sentence".
25
- const REVEAL_CPS = 30; // chars/sec baseline (~6-8 words/sec) — brisk typing feel
26
- const REVEAL_LAG_CAP = 400; // caught-up threshold -> above it, drain 3x faster
25
+ const REVEAL_CPS = 60; // chars/sec baseline (~12 words/sec) — brisk typing feel
26
+ const REVEAL_LAG_CAP = 200; // caught-up threshold -> above it, drain 3x faster
27
27
  export class AppStore {
28
28
  messages = [];
29
29
  streaming = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbit-intelligence/orbit-agent",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "orbit — a premium pure-TypeScript coding agent for Termux and desktop terminals, powered by Orbit X.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",