@markusylisiurunen/tau 0.2.128 → 0.2.129

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.
Files changed (49) hide show
  1. package/README.md +23 -20
  2. package/dist/core/auth/auth_manager.js +0 -92
  3. package/dist/core/auth/auth_manager.js.map +1 -1
  4. package/dist/core/auth/credential_store.js +247 -0
  5. package/dist/core/auth/credential_store.js.map +1 -0
  6. package/dist/core/auth/index.js +0 -1
  7. package/dist/core/auth/index.js.map +1 -1
  8. package/dist/core/commands/registry.js +2 -0
  9. package/dist/core/commands/registry.js.map +1 -1
  10. package/dist/core/index.js +1 -1
  11. package/dist/core/index.js.map +1 -1
  12. package/dist/core/models/catalog.js +3 -3
  13. package/dist/core/models/catalog.js.map +1 -1
  14. package/dist/core/modes/rpc_server.js +2 -6
  15. package/dist/core/modes/rpc_server.js.map +1 -1
  16. package/dist/core/runtime/steering.js +6 -0
  17. package/dist/core/runtime/steering.js.map +1 -0
  18. package/dist/core/session/compaction.js +223 -22
  19. package/dist/core/session/compaction.js.map +1 -1
  20. package/dist/core/session/runner.js +2 -3
  21. package/dist/core/session/runner.js.map +1 -1
  22. package/dist/core/session/session_engine.js +44 -45
  23. package/dist/core/session/session_engine.js.map +1 -1
  24. package/dist/core/subagents/subagent_engine.js +18 -26
  25. package/dist/core/subagents/subagent_engine.js.map +1 -1
  26. package/dist/core/utils/compact.js +3 -1
  27. package/dist/core/utils/compact.js.map +1 -1
  28. package/dist/core/utils/model_stream.js +105 -14
  29. package/dist/core/utils/model_stream.js.map +1 -1
  30. package/dist/core/utils/user_metadata.js +35 -2
  31. package/dist/core/utils/user_metadata.js.map +1 -1
  32. package/dist/core/version.js +1 -1
  33. package/dist/diff_tool/app/dist/assets/{index-jn1I_CPZ.js → index-ivRn2dP2.js} +34 -34
  34. package/dist/diff_tool/app/dist/index.html +1 -1
  35. package/dist/tui/chat_controller/queued_user_messages.js +18 -1
  36. package/dist/tui/chat_controller/queued_user_messages.js.map +1 -1
  37. package/dist/tui/chat_controller.js +75 -28
  38. package/dist/tui/chat_controller.js.map +1 -1
  39. package/dist/tui/chat_view.js +3 -0
  40. package/dist/tui/chat_view.js.map +1 -1
  41. package/dist/tui/ui/components/editor.js +17 -13
  42. package/dist/tui/ui/components/editor.js.map +1 -1
  43. package/dist/tui/ui/custom_editor.js +25 -0
  44. package/dist/tui/ui/custom_editor.js.map +1 -1
  45. package/dist/tui/ui/queued_messages.js +1 -1
  46. package/dist/tui/ui/queued_messages.js.map +1 -1
  47. package/package.json +9 -9
  48. package/dist/core/auth/credential_resolver.js +0 -36
  49. package/dist/core/auth/credential_resolver.js.map +0 -1
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Tau diff tool</title>
7
- <script type="module" crossorigin src="/assets/index-jn1I_CPZ.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-ivRn2dP2.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-2iDVL7Tb.css">
9
9
  </head>
10
10
  <body>
@@ -1,3 +1,6 @@
1
+ export function joinQueuedUserMessages(messages) {
2
+ return messages.join("\n\n---\n\n");
3
+ }
1
4
  export class QueuedUserMessages {
2
5
  messages;
3
6
  isDraining = false;
@@ -5,10 +8,16 @@ export class QueuedUserMessages {
5
8
  constructor(messages) {
6
9
  this.messages = messages;
7
10
  }
11
+ get length() {
12
+ return this.messages.length;
13
+ }
8
14
  enqueue(text, requestRender) {
9
15
  this.messages.push(text);
10
16
  requestRender();
11
17
  }
18
+ flush() {
19
+ return this.messages.splice(0);
20
+ }
12
21
  popIntoEditor(editor) {
13
22
  if (editor.getEditorText() !== "")
14
23
  return;
@@ -17,6 +26,14 @@ export class QueuedUserMessages {
17
26
  return;
18
27
  editor.setEditorText(last);
19
28
  }
29
+ collapse() {
30
+ if (this.messages.length < 2)
31
+ return false;
32
+ const collapsed = joinQueuedUserMessages(this.messages);
33
+ this.messages.length = 0;
34
+ this.messages.push(collapsed);
35
+ return true;
36
+ }
20
37
  dequeueIntoEditor(editor) {
21
38
  if (this.messages.length === 0)
22
39
  return;
@@ -27,7 +44,7 @@ export class QueuedUserMessages {
27
44
  }
28
45
  parts.push(...this.messages);
29
46
  this.messages.length = 0;
30
- editor.setEditorText(parts.join("\n\n---\n\n"));
47
+ editor.setEditorText(joinQueuedUserMessages(parts));
31
48
  }
32
49
  markPendingIdleNotification() {
33
50
  this.pendingIdleNotification = true;
@@ -1 +1 @@
1
- {"version":3,"file":"queued_user_messages.js","sourceRoot":"","sources":["../../../src/tui/chat_controller/queued_user_messages.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,kBAAkB;IACZ,QAAQ,CAAW;IAC5B,UAAU,GAAG,KAAK,CAAC;IACnB,uBAAuB,GAAG,KAAK,CAAC;IAExC,YAAY,QAAkB;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,aAAyB;QAC7C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,aAAa,EAAE,CAAC;IAClB,CAAC;IAED,aAAa,CAAC,MAAqB;QACjC,IAAI,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE;YAAE,OAAO;QAE1C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,iBAAiB,CAAC,MAAqB;QACrC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAEvC,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzB,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACzB,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,2BAA2B;QACzB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAA0B;QACpC,IAAI,IAAI,CAAC,UAAU;YAAE,OAAO;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC;YACH,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACnC,IAAI,CAAC,IAAI;oBAAE,OAAO;gBAElB,OAAO,CAAC,aAAa,EAAE,CAAC;gBACxB,MAAM,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YAExB,IAAI,IAAI,CAAC,uBAAuB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzF,IAAI,CAAC,uBAAuB,GAAG,KAAK,CAAC;gBACrC,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"queued_user_messages.js","sourceRoot":"","sources":["../../../src/tui/chat_controller/queued_user_messages.ts"],"names":[],"mappings":"AA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BAA0B,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -4,16 +4,15 @@ import { mkdtemp, readFile, unlink, writeFile } from "node:fs/promises";
4
4
  import { tmpdir } from "node:os";
5
5
  import { dirname, join, resolve } from "node:path";
6
6
  import { z } from "zod";
7
- import { formatCodexAuthError } from "../core/auth/auth_messages.js";
8
7
  import { getAuthPath } from "../core/auth/auth_paths.js";
9
8
  import { AuthStorage } from "../core/auth/auth_storage.js";
10
- import { createCredentialResolver, } from "../core/auth/credential_resolver.js";
11
9
  import { createCommandRegistry, getRiskLevelDescription, } from "../core/commands/index.js";
12
10
  import { createDefaultConfigDeps, getGoogleApiKey, getMistralApiKey, loadRuntimeConfig, } from "../core/config/index.js";
13
11
  import { startDiffReviewSession as startCoreDiffReviewSession } from "../core/diff_review/index.js";
14
12
  import { ChatRuntime } from "../core/runtime/chat_runtime.js";
15
13
  import { createDefaultCoreDeps } from "../core/runtime/deps.js";
16
14
  import { resolvePersonaSkillsForPromptContext, resolveProjectContextForPromptContext, resolveRuntimePromptBootstrap, } from "../core/runtime/runtime_bootstrap.js";
15
+ import { formatSteeringUserMessage } from "../core/runtime/steering.js";
17
16
  import { createCheckpoint } from "../core/session/checkpoint.js";
18
17
  import { buildBashUiText, formatBashUserMessageText, getBashOutputPolicy, prepareBashOutput, } from "../core/tools/bash.js";
19
18
  import { ToolCatalog } from "../core/tools/catalog.js";
@@ -24,14 +23,14 @@ import { formatCwdChangeNotice, formatProjectContextChangeNotice, formatRiskLeve
24
23
  import { formatAdaptiveNumber, formatCwd, formatPathForDisplay, formatTokenWindow, } from "../core/utils/format.js";
25
24
  import { streamGeminiSpeechAudio } from "../core/utils/gemini_speech.js";
26
25
  import { extractAllFencedCodeBlocks, extractAssistantText } from "../core/utils/messages.js";
27
- import { streamModel } from "../core/utils/model_stream.js";
26
+ import { ModelRuntime } from "../core/utils/model_stream.js";
28
27
  import { listProjectFilesAsync } from "../core/utils/project_files.js";
29
28
  import { transcribeAudio } from "../core/utils/speech_to_text.js";
30
29
  import { getAutoCompactionMetadataFromMessage, hasAutoCompactionContinuationMetadata, stripTauUserMetadata, } from "../core/utils/user_metadata.js";
31
30
  import { APP_VERSION } from "../core/version.js";
32
31
  import { DiffReviewService, } from "./chat_controller/diff_review_service.js";
33
32
  import { InterruptLifecycle } from "./chat_controller/interrupt_lifecycle.js";
34
- import { QueuedUserMessages } from "./chat_controller/queued_user_messages.js";
33
+ import { joinQueuedUserMessages, QueuedUserMessages, } from "./chat_controller/queued_user_messages.js";
35
34
  import { SessionMaintenanceService, } from "./chat_controller/session_maintenance_service.js";
36
35
  import { copyTextToClipboard } from "./clipboard.js";
37
36
  import { DOUBLE_PRESS_WINDOW_MS } from "./constants.js";
@@ -76,8 +75,8 @@ export class ChatController {
76
75
  config;
77
76
  defaultDiffTool;
78
77
  activeThemeId;
79
- credentialResolver;
80
78
  authPath;
79
+ modelRuntime;
81
80
  caffeinated;
82
81
  agentCwd;
83
82
  includeAgentContext;
@@ -90,6 +89,7 @@ export class ChatController {
90
89
  eventUnsubscribe;
91
90
  isStreaming = false;
92
91
  queuedMessageBuffer;
92
+ pendingSteeringMessages = [];
93
93
  interruptLifecycle;
94
94
  diffReviewService;
95
95
  maintenanceService;
@@ -145,9 +145,11 @@ export class ChatController {
145
145
  this.activeThemeId = this.config.defaultTheme;
146
146
  this.authPath = getAuthPath(this.deps.env.home());
147
147
  const authStorage = new AuthStorage(this.authPath);
148
- this.credentialResolver = createCredentialResolver({
148
+ this.modelRuntime = new ModelRuntime({
149
149
  authStorage,
150
150
  getConfig: () => this.config,
151
+ authPath: this.authPath,
152
+ env: this.deps.env.env(),
151
153
  });
152
154
  this.compactToolUi = true;
153
155
  const queuedUserMessages = options.queuedUserMessages ?? [];
@@ -303,10 +305,13 @@ export class ChatController {
303
305
  },
304
306
  onAltUp: () => this.popQueuedUserMessageIntoEditor(),
305
307
  onAltDown: () => this.cycleSubagentSelection(),
308
+ onAltC: () => this.collapseQueuedUserMessages(),
306
309
  onCtrlG: () => this.terminateSelectedSubagent(),
307
310
  beforeSubmit: (text) => this.beforeSubmit(text),
308
311
  onChange: (text) => this.handleEditorChange(text),
309
312
  onSubmit: (text) => void this.onUserInput(text),
313
+ onSteerSubmit: (text) => void this.submitSteeringMessage(text),
314
+ onFlushQueueAsSteer: () => void this.flushQueuedUserMessagesAsSteering(),
310
315
  };
311
316
  }
312
317
  async start() {
@@ -1025,18 +1030,76 @@ export class ChatController {
1025
1030
  queueUserMessage(text) {
1026
1031
  this.queuedMessageBuffer.enqueue(text, () => this.view.requestRender());
1027
1032
  }
1033
+ async submitSteeringMessage(text) {
1034
+ const trimmed = text.trim();
1035
+ if (!trimmed)
1036
+ return;
1037
+ if (!this.isStreaming) {
1038
+ await this.handleSubmit(trimmed);
1039
+ return;
1040
+ }
1041
+ if (!this.runtime.isTurnRunning) {
1042
+ this.queueUserMessage(trimmed);
1043
+ this.view.addSystemMessage("current task cannot be steered; message queued", "warn");
1044
+ return;
1045
+ }
1046
+ this.pendingSteeringMessages.push(trimmed);
1047
+ this.runtime.requestTurnBoundaryStop();
1048
+ this.view.addSystemMessage("steering queued for next turn boundary", "success");
1049
+ this.view.requestRender();
1050
+ }
1051
+ flushQueuedUserMessagesAsSteering() {
1052
+ if (this.queuedMessageBuffer.length === 0) {
1053
+ this.view.addSystemMessage("no queued messages to steer", "warn");
1054
+ return;
1055
+ }
1056
+ if (!this.isStreaming || !this.runtime.isTurnRunning) {
1057
+ this.view.addSystemMessage("current task cannot be steered; queued messages unchanged", "warn");
1058
+ return;
1059
+ }
1060
+ const messages = this.queuedMessageBuffer.flush();
1061
+ this.pendingSteeringMessages.push(...messages);
1062
+ this.runtime.requestTurnBoundaryStop();
1063
+ this.view.addSystemMessage("queued messages will steer at the next turn boundary", "success");
1064
+ this.view.requestRender();
1065
+ }
1028
1066
  popQueuedUserMessageIntoEditor() {
1029
1067
  this.queuedMessageBuffer.popIntoEditor({
1030
1068
  getEditorText: () => this.view.getEditorText(),
1031
1069
  setEditorText: (text) => this.view.setEditorText(text),
1032
1070
  });
1033
1071
  }
1072
+ collapseQueuedUserMessages() {
1073
+ if (this.queuedMessageBuffer.collapse()) {
1074
+ this.view.requestRender();
1075
+ }
1076
+ }
1034
1077
  dequeueQueuedUserMessagesIntoEditor() {
1035
1078
  this.queuedMessageBuffer.dequeueIntoEditor({
1036
1079
  getEditorText: () => this.view.getEditorText(),
1037
1080
  setEditorText: (text) => this.view.setEditorText(text),
1038
1081
  });
1039
1082
  }
1083
+ dequeuePendingSteeringMessagesIntoEditor() {
1084
+ if (this.pendingSteeringMessages.length === 0)
1085
+ return;
1086
+ const editorText = this.view.getEditorText();
1087
+ const parts = [];
1088
+ if (editorText !== "") {
1089
+ parts.push(editorText);
1090
+ }
1091
+ parts.push(...this.pendingSteeringMessages.splice(0));
1092
+ this.view.setEditorText(joinQueuedUserMessages(parts));
1093
+ }
1094
+ async drainPendingSteeringMessages() {
1095
+ const messages = this.pendingSteeringMessages.splice(0);
1096
+ if (messages.length === 0)
1097
+ return;
1098
+ const text = messages.join("\n\n");
1099
+ await this.sendUserMessage(text, {
1100
+ textForModel: formatSteeringUserMessage(messages),
1101
+ });
1102
+ }
1040
1103
  cycleSubagentSelection() {
1041
1104
  this.view.cycleSubagentSelection(1);
1042
1105
  this.view.requestRender();
@@ -1494,7 +1557,7 @@ export class ChatController {
1494
1557
  this.view.addSystemMessage("last assistant message was empty.", "warn");
1495
1558
  return;
1496
1559
  }
1497
- const apiKey = await this.credentialResolver.getApiKey("google");
1560
+ const apiKey = getGoogleApiKey(this.config, this.deps.env.env());
1498
1561
  if (!apiKey) {
1499
1562
  this.view.addSystemMessage("set GEMINI_API_KEY or apiKeys.google to use /speak", "error");
1500
1563
  return;
@@ -1829,24 +1892,6 @@ export class ChatController {
1829
1892
  deps: this.deps,
1830
1893
  });
1831
1894
  }
1832
- async resolveCurrentPersonaApiKey() {
1833
- let apiKey;
1834
- try {
1835
- apiKey = await this.credentialResolver.getApiKey(this.currentPersona.model.provider, {
1836
- sessionId: this.engine.sessionId,
1837
- });
1838
- }
1839
- catch (error) {
1840
- if (this.currentPersona.model.provider === "openai-codex") {
1841
- throw new Error(formatCodexAuthError(this.authPath, error?.message));
1842
- }
1843
- throw error;
1844
- }
1845
- if (!apiKey && this.currentPersona.model.provider === "openai-codex") {
1846
- throw new Error(formatCodexAuthError(this.authPath));
1847
- }
1848
- return apiKey;
1849
- }
1850
1895
  async cancelDiffReview() {
1851
1896
  await this.diffReviewService.cancel();
1852
1897
  }
@@ -1983,9 +2028,8 @@ export class ChatController {
1983
2028
  await this.maintenanceService.pruneToolResultsSmart(extra);
1984
2029
  }
1985
2030
  async requestSmartPruneSelection(prompt, signal) {
1986
- const apiKey = await this.resolveCurrentPersonaApiKey();
1987
2031
  const reasoning = this.clampPruneReasoning(this.currentPersona.settings.reasoning);
1988
- const stream = streamModel(this.currentPersona.model, {
2032
+ const stream = this.modelRuntime.streamModel(this.currentPersona.model, {
1989
2033
  systemPrompt: [
1990
2034
  "You are a context pruning assistant.",
1991
2035
  "Your task is to select which bash tool outputs should be pruned from the conversation history.",
@@ -2005,7 +2049,6 @@ export class ChatController {
2005
2049
  ...(reasoning ? { reasoning } : {}),
2006
2050
  sessionId: `tau-prune-${randomUUID()}`,
2007
2051
  ...(signal ? { signal } : {}),
2008
- ...(apiKey && { apiKey }),
2009
2052
  });
2010
2053
  const final = await stream.result();
2011
2054
  const raw = extractAssistantText(final).trim();
@@ -2354,8 +2397,12 @@ export class ChatController {
2354
2397
  this.queuedMessageBuffer.markPendingIdleNotification();
2355
2398
  this.view.requestRender();
2356
2399
  if (runResult.aborted || runResult.blocked) {
2400
+ this.dequeuePendingSteeringMessagesIntoEditor();
2357
2401
  this.dequeueQueuedUserMessagesIntoEditor();
2358
2402
  }
2403
+ else if (this.pendingSteeringMessages.length > 0) {
2404
+ void this.drainPendingSteeringMessages();
2405
+ }
2359
2406
  else {
2360
2407
  void this.drainQueuedUserMessages();
2361
2408
  }