teapot-coding-agent 0.37.59 → 0.37.60

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 (42) hide show
  1. package/dist/acp/adapter.js +4 -72
  2. package/dist/agent/agent.js +52 -2246
  3. package/dist/agent/compact-rules.js +0 -53
  4. package/dist/agent/editorconfig.js +4 -56
  5. package/dist/agent/goal-audit.js +0 -34
  6. package/dist/agent/key-pool.js +0 -52
  7. package/dist/agent/kill.js +1 -13
  8. package/dist/agent/llm.js +8 -309
  9. package/dist/agent/mcp-oauth-manager.js +2 -255
  10. package/dist/agent/mcp-registry.js +1 -188
  11. package/dist/agent/mcp.js +1 -85
  12. package/dist/agent/meta-tools.js +0 -26
  13. package/dist/agent/plugins.js +1 -81
  14. package/dist/agent/provider-headers.js +1 -28
  15. package/dist/agent/skills.js +8 -94
  16. package/dist/agent/tools.js +16 -809
  17. package/dist/bus.js +1 -2
  18. package/dist/config-schema.js +0 -40
  19. package/dist/home.js +1 -19
  20. package/dist/index.js +0 -136
  21. package/dist/log/events.js +3 -195
  22. package/dist/master.js +31 -1176
  23. package/dist/migrations/index.js +0 -55
  24. package/dist/migrations/providers.js +0 -13
  25. package/dist/migrations/registry.js +0 -9
  26. package/dist/migrations/session-titles.js +3 -43
  27. package/dist/migrations/sessions.js +2 -20
  28. package/dist/model-meta.js +2 -74
  29. package/dist/scheduler/cron.js +2 -17
  30. package/dist/server/api.js +12 -778
  31. package/dist/server/image-resize.js +1 -64
  32. package/dist/server/term-size.js +1 -120
  33. package/dist/server/terminals.js +0 -159
  34. package/dist/session-title.js +2 -35
  35. package/package.json +1 -1
  36. package/public/assets/{index-KzHw4Sqo.js → index-DhJx7VDq.js} +4 -4
  37. package/public/assets/index-DhJx7VDq.js.map +1 -0
  38. package/public/assets/{shiki-BwDjoZdu.js → shiki-LBMkaWYb.js} +2 -2
  39. package/public/assets/shiki-LBMkaWYb.js.map +1 -0
  40. package/public/index.html +1 -1
  41. package/public/assets/index-KzHw4Sqo.js.map +0 -1
  42. package/public/assets/shiki-BwDjoZdu.js.map +0 -1
@@ -1,33 +1,7 @@
1
- /**
2
- * Session titles (#155) — "いろんなチャットアプリが実装してる、CodexやDSHとかも実装してそう /
3
- * 自動生成とかサブエージェント名とかだとわかりにくい".
4
- *
5
- * The sidebar renders the raw session id, so `teapot-10-16854917` and
6
- * `teapot-10-sub-trim-…` read as machinery: an operator with several sessions
7
- * cannot tell which is which, and the timeline in front of them is the only clue.
8
- *
9
- * ## Why the FIRST USER PROMPT, and not a model call
10
- *
11
- * Every harness that does this derives the title from the opening request — it is
12
- * already written by the human, it costs nothing, and it is stable (the first
13
- * message of a session never changes, so the title never churns under the reader).
14
- * A generated title would need an LLM call at exactly the moment the session starts,
15
- * and would then drift as the session's real subject emerges.
16
- *
17
- * ## This is a DISPLAY rule, so it is deliberately lossy
18
- *
19
- * The input is arbitrary operator text: markdown, fenced code, URLs, a pasted
20
- * 200-line log. A sidebar row is ~40 characters wide. So the rule takes the first
21
- * MEANINGFUL line and trims it, rather than trying to summarise — a title that
22
- * silently reorders what the operator wrote would be worse than a truncated one.
23
- */
24
1
  export function sessionTitleFrom(firstUserPrompt) {
25
2
  if (typeof firstUserPrompt !== "string")
26
3
  return null;
27
4
  const lines = firstUserPrompt.split("\n");
28
- // A fenced block is CONTENT, not a subject: the operator pasted a log or a diff
29
- // and the prose follows it. Taking the first line inside the fence titled a
30
- // session "log" (measured). So skip from an opening fence to its closing one.
31
5
  let inFence = false;
32
6
  let fence = "";
33
7
  for (const raw of lines) {
@@ -40,14 +14,12 @@ export function sessionTitleFrom(firstUserPrompt) {
40
14
  continue;
41
15
  }
42
16
  if (marker[0] === fence) {
43
- inFence = false; // closing fence
17
+ inFence = false;
44
18
  continue;
45
19
  }
46
20
  }
47
21
  if (inFence)
48
- continue; // inside a block: its body is not a title
49
- // strip the markdown that would otherwise eat the visible width: ATX headings,
50
- // bullets/ordered markers, blockquotes, and emphasis characters
22
+ continue;
51
23
  const line = raw
52
24
  .replace(/^\s{0,3}#{1,6}\s*/, "")
53
25
  .replace(/^\s{0,3}>\s?/, "")
@@ -56,8 +28,6 @@ export function sessionTitleFrom(firstUserPrompt) {
56
28
  .trim();
57
29
  if (!line)
58
30
  continue;
59
- // a bare URL or a lone issue/PR reference carries no subject — the NEXT line
60
- // usually does (a prompt may OPEN with "https://…" or a lone "2.")
61
31
  if (/^https?:\/\/\S+$/.test(line))
62
32
  continue;
63
33
  if (/^#?\d+[.)]?$/.test(line))
@@ -66,13 +36,10 @@ export function sessionTitleFrom(firstUserPrompt) {
66
36
  }
67
37
  return null;
68
38
  }
69
- /** Trim to `max` characters on a word boundary, with an ellipsis when cut. */
70
39
  function clip(text, max) {
71
40
  if (text.length <= max)
72
41
  return text;
73
42
  const cut = text.slice(0, max);
74
- // prefer the last space so a word is not sliced in half; fall back to a hard cut
75
- // when the line has no space at all (a single long token / CJK run)
76
43
  const at = cut.lastIndexOf(" ");
77
44
  const body = at > max * 0.6 ? cut.slice(0, at) : cut;
78
45
  return `${body.trimEnd()}…`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.37.59",
3
+ "version": "0.37.60",
4
4
  "description": "A lightweight, always-on multi-agent harness for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",