@rexvane/piweb 0.3.15 → 0.3.17
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +4 -4
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +3 -3
- package/.next/required-server-files.js +1 -3
- package/.next/required-server-files.json +1 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/tree/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
- package/.next/server/app/api/growth/route.js +1 -1
- package/.next/server/app/api/growth/route.js.nft.json +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models/route.js.nft.json +1 -1
- package/.next/server/app/api/pi-settings/route.js +1 -1
- package/.next/server/app/api/plugins/route.js.nft.json +1 -1
- package/.next/server/app/api/prompts/route.js.nft.json +1 -1
- package/.next/server/app/api/security/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/import/route.js +3 -3
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/update/route.js +1 -1
- package/.next/server/app/api/update/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +4 -4
- package/.next/server/chunks/496.js +1 -1
- package/.next/server/chunks/686.js +4 -4
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/2716.93be8ad5c970c516.js +1 -0
- package/.next/static/chunks/4632.112d2e893d48d188.js +1 -0
- package/.next/static/chunks/4673.c1fb1580efc6ace7.js +1 -0
- package/.next/static/chunks/4686-f4a037d609cea3f2.js +1 -0
- package/.next/static/chunks/app/page-b51087831582ee37.js +1 -0
- package/.next/static/chunks/{webpack-42c5aae79b0e5d8c.js → webpack-c31263fd83d75ce6.js} +1 -1
- package/.next/static/css/850c2fd130ffa2fc.css +1 -0
- package/README.md +17 -19
- package/assets/archive.jpg +0 -0
- package/assets/growth-1.jpg +0 -0
- package/assets/growth-2.jpg +0 -0
- package/assets/import.jpg +0 -0
- package/assets/main.jpg +0 -0
- package/assets/outline.jpg +0 -0
- package/assets/prompts-1.jpg +0 -0
- package/assets/prompts-2.jpg +0 -0
- package/assets/providers-1.jpg +0 -0
- package/assets/providers-2.jpg +0 -0
- package/assets/providers-3.jpg +0 -0
- package/assets/trace-1.jpg +0 -0
- package/assets/trace-2.png +0 -0
- package/assets/trace-3.png +0 -0
- package/assets/trace-4.png +0 -0
- package/assets/viewer-1.jpg +0 -0
- package/assets/viewer-2.jpg +0 -0
- package/bin/pi.js +50 -0
- package/next.config.ts +32 -7
- package/package.json +2 -6
- package/scripts/launcher.mjs +1 -1
- package/scripts/verify-package.mjs +0 -53
- package/src/app/api/growth/route.ts +14 -14
- package/src/app/api/models/route.ts +2 -1
- package/src/app/globals.css +90 -0
- package/src/components/AppShell.tsx +30 -16
- package/src/components/ChatWindow.tsx +192 -6
- package/src/components/FileViewer.tsx +10 -9
- package/src/components/ProjectPanel.tsx +111 -94
- package/src/components/SessionImportSection.tsx +20 -36
- package/src/hooks/useGrowth.ts +123 -156
- package/src/hooks/usePiWeb.ts +7 -10
- package/src/i18n.tsx +39 -39
- package/src/lib/agent-manager.ts +10 -8
- package/src/lib/growth-service.ts +390 -166
- package/src/lib/growth-tracker.ts +64 -264
- package/src/lib/growth-turns.ts +31 -1
- package/src/lib/models/model-scope.ts +15 -0
- package/src/lib/models-service.ts +16 -0
- package/src/lib/pi-settings.ts +7 -0
- package/src/lib/session-import/claude.ts +2 -13
- package/src/lib/session-import/codex.ts +8 -44
- package/src/lib/session-import/files.ts +0 -14
- package/src/lib/session-import/grok.ts +24 -54
- package/src/lib/session-import/types.ts +0 -12
- package/src/lib/types.ts +27 -22
- package/tsconfig.json +2 -1
- package/.next/static/chunks/2716.a9e808190a4e2424.js +0 -1
- package/.next/static/chunks/4632.0ed92ae42905ce40.js +0 -1
- package/.next/static/chunks/4673.d3d0a7f2599080fb.js +0 -1
- package/.next/static/chunks/4686-7d694def920ff093.js +0 -1
- package/.next/static/chunks/app/page-9a5440047c5a415c.js +0 -1
- package/.next/static/css/b2d35abc828d4713.css +0 -1
- package/assets/archive.png +0 -0
- package/assets/growth-1.png +0 -0
- package/assets/growth-2.png +0 -0
- package/assets/import.png +0 -0
- package/assets/main.png +0 -0
- package/assets/outline.png +0 -0
- package/assets/prompts-1.png +0 -0
- package/assets/prompts-2.png +0 -0
- package/assets/providers-1.png +0 -0
- package/assets/providers-2.png +0 -0
- package/assets/providers-3.png +0 -0
- package/assets/trace-1.png +0 -0
- package/assets/viewer-1.png +0 -0
- package/assets/viewer-2.png +0 -0
- package/scripts/managed-niubash-assets.mjs +0 -146
- package/scripts/prepare-niubash-packages.mjs +0 -182
- package/scripts/smoke-managed-niubash.mjs +0 -62
- package/src/lib/growth-rounds.ts +0 -84
- package/src/lib/managed-niubash.ts +0 -227
- /package/.next/static/{DdBwPYoHBKtaJ97QIr6Co → zsynuO_9Kx6nrXgkTUJ04}/_buildManifest.js +0 -0
- /package/.next/static/{DdBwPYoHBKtaJ97QIr6Co → zsynuO_9Kx6nrXgkTUJ04}/_ssgManifest.js +0 -0
package/src/i18n.tsx
CHANGED
|
@@ -19,6 +19,7 @@ const zh = {
|
|
|
19
19
|
error: "出错",
|
|
20
20
|
copy: "复制",
|
|
21
21
|
copyFailed: "复制失败",
|
|
22
|
+
chatWidthHandle: "拖动调整对话宽度",
|
|
22
23
|
editMessage: "编辑这条消息",
|
|
23
24
|
sendEdit: "重新发送",
|
|
24
25
|
editMessageFailed: "编辑重发失败",
|
|
@@ -553,37 +554,36 @@ const zh = {
|
|
|
553
554
|
running: "运行中",
|
|
554
555
|
// 项目生长(项目栏 / 文件查看器)
|
|
555
556
|
projectPanel: "项目",
|
|
556
|
-
|
|
557
|
-
growthScopeSession: "
|
|
558
|
-
growthOnlyChanges: "
|
|
557
|
+
growthScopeRound: "本轮",
|
|
558
|
+
growthScopeSession: "本会话累计",
|
|
559
|
+
growthOnlyChanges: "只看改动",
|
|
559
560
|
growthFollow: "跟随",
|
|
560
561
|
growthFollowing: "跟随中",
|
|
561
562
|
growthPrev: "上一轮",
|
|
562
563
|
growthNext: "下一轮",
|
|
563
564
|
growthRoundPosition: "第 {current}/{total} 轮",
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
growthLoading: "
|
|
568
|
-
growthUnrecorded: "此轮发生在生长快照启用前,改动未记录",
|
|
565
|
+
growthRecordNow: "立即记录:把当前改动记为「你的修改」",
|
|
566
|
+
growthRecordNone: "没有新的改动",
|
|
567
|
+
growthNoRounds: "还没有记录。发一条消息让 pi 开始工作,每一轮的改动会出现在这里。",
|
|
568
|
+
growthLoading: "正在读取记录…",
|
|
569
569
|
growthNoChangesRound: "本轮无文件改动",
|
|
570
570
|
growthNoSession: "打开或新建一个会话后,这里会显示项目的生长过程。",
|
|
571
571
|
growthUnavailable: "机器上找不到 git,项目生长功能不可用",
|
|
572
|
-
growthUnavailableFallback: "
|
|
573
|
-
growthStepLabel: "第 {n} 步",
|
|
572
|
+
growthUnavailableFallback: "生长记录不可用(找不到可用的 git),已显示当前目录结构",
|
|
574
573
|
growthRoundLabel: "第 {n} 轮",
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
growthStatM: "修改",
|
|
574
|
+
growthKindUser: "你的修改",
|
|
575
|
+
growthRoundFiles: "{n} 个文件",
|
|
576
|
+
growthJumpToChat: "在对话里看",
|
|
577
|
+
growthRunning: "本轮进行中…",
|
|
578
|
+
growthStatusAborted: "已中止",
|
|
579
|
+
growthStatusError: "出错",
|
|
582
580
|
growthStatD: "删除",
|
|
583
|
-
growthStatR: "重命名",
|
|
584
581
|
growthPending: "生成中",
|
|
585
|
-
growthLazyDir: "
|
|
586
|
-
growthTruncated: "
|
|
582
|
+
growthLazyDir: "当前磁盘条目,不在所选这一轮的记录中",
|
|
583
|
+
growthTruncated: "这一轮变更过多,只显示前 2000 条",
|
|
584
|
+
chatRoundChanged: "本轮改了 {n} 个文件",
|
|
585
|
+
chatRoundNoChanges: "本轮没有改动文件",
|
|
586
|
+
chatRoundShow: "在项目栏里查看这一轮",
|
|
587
587
|
growthExpandAll: "展开全部",
|
|
588
588
|
growthCollapseAll: "收起全部",
|
|
589
589
|
growthFilter: "筛选…",
|
|
@@ -625,6 +625,7 @@ const en: Dict = {
|
|
|
625
625
|
error: "Error",
|
|
626
626
|
copy: "Copy",
|
|
627
627
|
copyFailed: "Copy failed",
|
|
628
|
+
chatWidthHandle: "Drag to resize the conversation",
|
|
628
629
|
editMessage: "Edit this message",
|
|
629
630
|
sendEdit: "Send again",
|
|
630
631
|
editMessageFailed: "Edit and resend failed",
|
|
@@ -1151,37 +1152,36 @@ const en: Dict = {
|
|
|
1151
1152
|
toastError: "Operation failed",
|
|
1152
1153
|
running: "Running",
|
|
1153
1154
|
projectPanel: "Project",
|
|
1154
|
-
|
|
1155
|
-
growthScopeSession: "
|
|
1155
|
+
growthScopeRound: "This round",
|
|
1156
|
+
growthScopeSession: "Session total",
|
|
1156
1157
|
growthOnlyChanges: "Changes only",
|
|
1157
1158
|
growthFollow: "Follow",
|
|
1158
1159
|
growthFollowing: "Following",
|
|
1159
1160
|
growthPrev: "Previous round",
|
|
1160
1161
|
growthNext: "Next round",
|
|
1161
1162
|
growthRoundPosition: "Round {current}/{total}",
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
growthLoading: "Loading
|
|
1166
|
-
growthUnrecorded: "This round predates growth snapshots; its changes were not recorded",
|
|
1163
|
+
growthRecordNow: "Record now: save the current changes as \"Your changes\"",
|
|
1164
|
+
growthRecordNone: "No new changes",
|
|
1165
|
+
growthNoRounds: "Nothing recorded yet. Send pi a message and each round's changes will show up here.",
|
|
1166
|
+
growthLoading: "Loading history…",
|
|
1167
1167
|
growthNoChangesRound: "No file changes in this round",
|
|
1168
1168
|
growthNoSession: "Open or start a session to watch the project grow here.",
|
|
1169
1169
|
growthUnavailable: "git was not found on this machine; project growth is unavailable",
|
|
1170
|
-
growthUnavailableFallback: "Growth
|
|
1171
|
-
growthStepLabel: "Step {n}",
|
|
1170
|
+
growthUnavailableFallback: "Growth history is unavailable (no usable git); showing the current directory structure",
|
|
1172
1171
|
growthRoundLabel: "Round {n}",
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
growthStatM: "Modified",
|
|
1172
|
+
growthKindUser: "Your changes",
|
|
1173
|
+
growthRoundFiles: "{n} files",
|
|
1174
|
+
growthJumpToChat: "Show in chat",
|
|
1175
|
+
growthRunning: "Round in progress…",
|
|
1176
|
+
growthStatusAborted: "Aborted",
|
|
1177
|
+
growthStatusError: "Error",
|
|
1180
1178
|
growthStatD: "Deleted",
|
|
1181
|
-
growthStatR: "Renamed",
|
|
1182
1179
|
growthPending: "Writing…",
|
|
1183
|
-
growthLazyDir: "Current disk entry, not in the selected
|
|
1184
|
-
growthTruncated: "Too many changes in this
|
|
1180
|
+
growthLazyDir: "Current disk entry, not recorded in the selected round",
|
|
1181
|
+
growthTruncated: "Too many changes in this round; showing the first 2000",
|
|
1182
|
+
chatRoundChanged: "This round changed {n} files",
|
|
1183
|
+
chatRoundNoChanges: "No file changes this round",
|
|
1184
|
+
chatRoundShow: "Show this round in the project panel",
|
|
1185
1185
|
growthExpandAll: "Expand all",
|
|
1186
1186
|
growthCollapseAll: "Collapse all",
|
|
1187
1187
|
growthFilter: "Filter…",
|
package/src/lib/agent-manager.ts
CHANGED
|
@@ -35,13 +35,12 @@ import { sanitizeToolOutput } from "./text-sanitize";
|
|
|
35
35
|
import { BoundaryError } from "./path-security";
|
|
36
36
|
import { estimateTokensOf } from "./process-format";
|
|
37
37
|
import { getPiSettings } from "./pi-settings";
|
|
38
|
-
import { createManagedNiubashTools } from "./managed-niubash";
|
|
39
38
|
import { clampThinkingLevel, getSupportedThinkingLevels } from "@earendil-works/pi-ai";
|
|
40
39
|
import type {
|
|
41
40
|
AgentCommand,
|
|
42
41
|
ContextBreakdown,
|
|
43
42
|
ContextResource,
|
|
44
|
-
|
|
43
|
+
GrowthRound,
|
|
45
44
|
TrajEntry,
|
|
46
45
|
ToolPreset,
|
|
47
46
|
WebEvent,
|
|
@@ -588,13 +587,18 @@ function growthOf(m: Managed): GrowthTracker {
|
|
|
588
587
|
m.growth.dispose();
|
|
589
588
|
m.growth = null;
|
|
590
589
|
}
|
|
591
|
-
return (m.growth ??= createGrowthTracker({
|
|
590
|
+
return (m.growth ??= createGrowthTracker({
|
|
591
|
+
cwd: m.cwd,
|
|
592
|
+
sessionPath: m.sessionPath,
|
|
593
|
+
publish: (evt) => publish(m, evt),
|
|
594
|
+
entries: () => m.sm.getEntries() as never,
|
|
595
|
+
}));
|
|
592
596
|
}
|
|
593
597
|
|
|
594
|
-
/**
|
|
595
|
-
export async function
|
|
598
|
+
/** 立即记录(项目栏按钮):把当前改动提交为「你的修改」,同时广播给本会话的订阅者 */
|
|
599
|
+
export async function growthRecord(m: Managed): Promise<GrowthRound | null> {
|
|
596
600
|
touch(m);
|
|
597
|
-
return growthOf(m).
|
|
601
|
+
return growthOf(m).recordNow();
|
|
598
602
|
}
|
|
599
603
|
|
|
600
604
|
// ---------- 会话生命周期 ----------
|
|
@@ -800,8 +804,6 @@ export async function ensureSession(m: Managed): Promise<AgentSession> {
|
|
|
800
804
|
modelRuntime: await getModelRuntime(),
|
|
801
805
|
resourceLoader: loader,
|
|
802
806
|
settingsManager: getSettingsManager(m.cwd),
|
|
803
|
-
// Windows: 同名 bash 覆盖 SDK 内置工具,指向托管 niubash;其它平台返回 [],走 Pi 默认。
|
|
804
|
-
customTools: createManagedNiubashTools(m.cwd),
|
|
805
807
|
});
|
|
806
808
|
created = session;
|
|
807
809
|
if (m.disposed) throw new Error("session is disposed");
|