pi-firecode 1.0.0 → 1.0.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.
Files changed (93) hide show
  1. package/README.md +55 -41
  2. package/README.zh-CN.md +74 -0
  3. package/config.example.jsonc +21 -22
  4. package/dist/config.example.jsonc +90 -0
  5. package/dist/index.js +11464 -0
  6. package/dist/master/prompts/master.en.md +22 -0
  7. package/{master → dist/master}/prompts/master.zh.md +3 -3
  8. package/dist/master/prompts/worker.en.md +1 -0
  9. package/dist/watcher/prompts/watch.en.md +43 -0
  10. package/package.json +10 -27
  11. package/activity.ts +0 -92
  12. package/busy.ts +0 -188
  13. package/config.ts +0 -500
  14. package/deliver.ts +0 -119
  15. package/flame.ts +0 -149
  16. package/format.ts +0 -133
  17. package/header.ts +0 -218
  18. package/herdr-client.ts +0 -60
  19. package/index.ts +0 -68
  20. package/jsonc.ts +0 -34
  21. package/master/actions.ts +0 -293
  22. package/master/activity-list.ts +0 -281
  23. package/master/event-card.ts +0 -87
  24. package/master/event-format.ts +0 -83
  25. package/master/guard.ts +0 -46
  26. package/master/index.ts +0 -252
  27. package/master/list-view.ts +0 -129
  28. package/master/outbox.ts +0 -188
  29. package/master/prompt.ts +0 -26
  30. package/master/role.ts +0 -18
  31. package/master/run.ts +0 -315
  32. package/master/runtime.ts +0 -259
  33. package/master/spawn.ts +0 -234
  34. package/master/state.ts +0 -225
  35. package/master/worker-view.ts +0 -517
  36. package/provider/claude-sub.ts +0 -151
  37. package/provider/openai-native/index.ts +0 -8
  38. package/provider/openai-native/src/compact-client.ts +0 -350
  39. package/provider/openai-native/src/config.ts +0 -297
  40. package/provider/openai-native/src/extension.ts +0 -93
  41. package/provider/openai-native/src/native-compaction.ts +0 -151
  42. package/provider/openai-native/src/native-details.ts +0 -157
  43. package/provider/openai-native/src/native-replay.ts +0 -253
  44. package/provider/openai-native/src/native-runtime.ts +0 -144
  45. package/provider/openai-native/src/options.ts +0 -87
  46. package/provider/openai-native/src/request-pipeline.ts +0 -21
  47. package/provider/openai-native/src/responses-input.ts +0 -433
  48. package/review/advisor.ts +0 -110
  49. package/review/card.ts +0 -398
  50. package/review/checkpoint.ts +0 -378
  51. package/review/evidence.ts +0 -230
  52. package/review/index.ts +0 -992
  53. package/review/occupancy.ts +0 -25
  54. package/review/outcome.ts +0 -98
  55. package/review/prompt.ts +0 -209
  56. package/review/reviewer.ts +0 -353
  57. package/review/session.ts +0 -110
  58. package/review/state.ts +0 -877
  59. package/review/ui.ts +0 -89
  60. package/round-recorder.ts +0 -18
  61. package/session/herdr-display.ts +0 -87
  62. package/session/presets.ts +0 -300
  63. package/session/quota.ts +0 -123
  64. package/session/rename.ts +0 -46
  65. package/session/stats.ts +0 -313
  66. package/statusbar/index.ts +0 -256
  67. package/statusbar/render.ts +0 -113
  68. package/theme.ts +0 -45
  69. package/tools/actions.ts +0 -53
  70. package/tools/assistant-view.ts +0 -64
  71. package/tools/click-anchor.ts +0 -56
  72. package/tools/group-view.ts +0 -420
  73. package/tools/grouping.ts +0 -158
  74. package/tools/host.ts +0 -369
  75. package/tools/index.ts +0 -186
  76. package/tools/line.ts +0 -231
  77. package/tools/machine.ts +0 -78
  78. package/tools/parts.ts +0 -143
  79. package/tools/round.ts +0 -95
  80. package/tools/timing.ts +0 -22
  81. package/tools/turn-clock.ts +0 -41
  82. package/tools/turn-summary.ts +0 -109
  83. package/truncated-write.ts +0 -18
  84. package/watcher/card.ts +0 -91
  85. package/watcher/index.ts +0 -176
  86. package/watcher/observer.ts +0 -75
  87. package/watcher/transcript.ts +0 -56
  88. /package/{master → dist/master}/prompts/worker.zh.md +0 -0
  89. /package/{review → dist/review}/prompts/advisor.en.md +0 -0
  90. /package/{review → dist/review}/prompts/advisor.zh.md +0 -0
  91. /package/{review → dist/review}/prompts/review.en.md +0 -0
  92. /package/{review → dist/review}/prompts/review.zh.md +0 -0
  93. /package/{watcher → dist/watcher}/prompts/watch.zh.md +0 -0
@@ -1,56 +0,0 @@
1
- /**
2
- * 主会话回合的增量渲染:喂给观察会话的唯一素材,纯函数。
3
- * minimal 省略 reasoning 与 diff 展开正文——观察员要的是「在做什么」,正文可以自己去读。
4
- */
5
- import type { TurnEndEvent } from "@earendil-works/pi-coding-agent";
6
- import type { WatcherContext } from "../config.js";
7
- import { textOf } from "../format.js";
8
-
9
- const RESULT_BUDGET = 400;
10
-
11
- export function renderTurn(turn: TurnEndEvent, context: WatcherContext): string {
12
- const lines: string[] = [];
13
- const content = "content" in turn.message ? turn.message.content : undefined;
14
- for (const part of blocks(content)) {
15
- if (part.type === "text" && typeof part.text === "string" && part.text.trim())
16
- lines.push(part.text.trim());
17
- if (part.type === "thinking" && context === "full" && typeof part.thinking === "string")
18
- lines.push(`(思考)${part.thinking.trim()}`);
19
- if (part.type === "toolCall") lines.push(toolCallLine(part, context));
20
- }
21
- for (const result of turn.toolResults) {
22
- const text = clipText(textOf(result.content), RESULT_BUDGET);
23
- lines.push(`${result.isError ? "✗" : "→"} ${result.toolName}:${text || "(无输出)"}`);
24
- }
25
- return `<turn index="${turn.turnIndex}">\n${lines.join("\n")}\n</turn>`;
26
- }
27
-
28
- function toolCallLine(part: Record<string, any>, context: WatcherContext): string {
29
- const args = part.arguments && typeof part.arguments === "object" ? part.arguments : {};
30
- const summary = Object.entries(args as Record<string, unknown>)
31
- .map(([key, value]) => `${key}=${clipText(argumentText(key, value, context), 200)}`)
32
- .join(" ");
33
- return `· ${part.name ?? "工具"} ${summary}`.trimEnd();
34
- }
35
-
36
- /** minimal 下 edit/write 的正文(新旧内容)只留长度:观察员判断的是动作,不是逐字 diff。 */
37
- function argumentText(key: string, value: unknown, context: WatcherContext): string {
38
- const text = typeof value === "string" ? value : JSON.stringify(value) ?? "";
39
- if (context === "full") return oneLine(text);
40
- return BODY_KEYS.has(key) ? `<${text.length} 字符>` : oneLine(text);
41
- }
42
-
43
- const BODY_KEYS = new Set(["content", "oldText", "newText", "old_text", "new_text", "edits"]);
44
-
45
- function blocks(content: unknown): Array<Record<string, any>> {
46
- return Array.isArray(content) ? content.filter((part) => !!part && typeof part === "object") : [];
47
- }
48
-
49
- function oneLine(text: string): string {
50
- return text.replace(/\s+/gu, " ").trim();
51
- }
52
-
53
- function clipText(text: string, budget: number): string {
54
- const single = oneLine(text);
55
- return single.length > budget ? `${single.slice(0, budget)}…` : single;
56
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes