@chainingintention/pi-web-cn 1.202607.4 → 1.202607.5

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 (50) hide show
  1. package/dist/client/assets/{CodeViewer-DssF-c9D.js → CodeViewer-CfZodNYb.js} +1 -1
  2. package/dist/client/assets/{TerminalPanel-8Or6pbwb.js → TerminalPanel-eua763mA.js} +1 -1
  3. package/dist/client/assets/{UnifiedDiffViewer-D_OLq3Q4.js → UnifiedDiffViewer-C9-QeGMj.js} +1 -1
  4. package/dist/client/assets/{index-B06LjBQ0.js → index-BiFWXoRZ.js} +200 -201
  5. package/dist/client/index.html +2 -2
  6. package/dist/client/manifest.webmanifest +1 -1
  7. package/dist/pi-web-plugins/workspace-tasks/workspaceTasksClient.js +6 -1
  8. package/dist/plugin-api.d.ts +2 -0
  9. package/dist/server/app.js +16 -15
  10. package/dist/server/app.js.map +1 -1
  11. package/dist/server/gitRoutes.js +3 -16
  12. package/dist/server/gitRoutes.js.map +1 -1
  13. package/dist/server/httpSessions.js +34 -0
  14. package/dist/server/httpSessions.js.map +1 -0
  15. package/dist/server/managementEmbed.js +8 -40
  16. package/dist/server/managementEmbed.js.map +1 -1
  17. package/dist/server/normalAuth.js +90 -30
  18. package/dist/server/normalAuth.js.map +1 -1
  19. package/dist/server/piWebStatus.js +14 -2
  20. package/dist/server/piWebStatus.js.map +1 -1
  21. package/dist/server/requestLogging.js +47 -0
  22. package/dist/server/requestLogging.js.map +1 -0
  23. package/dist/server/sessiond/sessionProxyRoutes.js +1 -6
  24. package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
  25. package/dist/server/sessiond.js +2 -1
  26. package/dist/server/sessiond.js.map +1 -1
  27. package/dist/server/sessions/sessionCleanup.js +1 -13
  28. package/dist/server/sessions/sessionCleanup.js.map +1 -1
  29. package/dist/server/sessions/sessionUiEvents.js +2 -29
  30. package/dist/server/sessions/sessionUiEvents.js.map +1 -1
  31. package/dist/server/sessions/subsessionTranscript.js +1 -29
  32. package/dist/server/sessions/subsessionTranscript.js.map +1 -1
  33. package/dist/server/sessions/toolSummary.js +37 -0
  34. package/dist/server/sessions/toolSummary.js.map +1 -0
  35. package/dist/server/terminalProxyRoutes.js +3 -11
  36. package/dist/server/terminalProxyRoutes.js.map +1 -1
  37. package/dist/server/workspaceExplorerRoutes.js +8 -41
  38. package/dist/server/workspaceExplorerRoutes.js.map +1 -1
  39. package/dist/server/workspaces/workspaceContext.js +3 -0
  40. package/dist/server/workspaces/workspaceContext.js.map +1 -1
  41. package/dist/server/workspaces/workspaceDeletionRoutes.js +1 -6
  42. package/dist/server/workspaces/workspaceDeletionRoutes.js.map +1 -1
  43. package/dist/server/workspaces/workspaceRouteContext.js +13 -0
  44. package/dist/server/workspaces/workspaceRouteContext.js.map +1 -0
  45. package/dist/shared/apiTypes.d.ts +0 -16
  46. package/dist/shared/federatedRoutes.js +0 -1
  47. package/dist/shared/federatedRoutes.js.map +1 -1
  48. package/package.json +1 -2
  49. package/dist/server/workspaces/fileUploadService.js +0 -43
  50. package/dist/server/workspaces/fileUploadService.js.map +0 -1
@@ -1,43 +0,0 @@
1
- import { createWriteStream } from "node:fs";
2
- import { randomUUID } from "node:crypto";
3
- import { rename, rm, stat, writeFile } from "node:fs/promises";
4
- import { dirname, join } from "node:path";
5
- import { pipeline } from "node:stream/promises";
6
- import { resolveParentInsideWorkspace } from "./pathSafety.js";
7
- export async function uploadWorkspaceFile(rootPath, input) {
8
- if (!isWorkspaceUploadInput(input))
9
- throw new Error("Upload body must include path and contentBase64");
10
- if (!isBase64Content(input.contentBase64))
11
- throw new Error("contentBase64 must be valid base64");
12
- const { target, relativePath } = await resolveParentInsideWorkspace(rootPath, input.path);
13
- const buffer = Buffer.from(input.contentBase64, "base64");
14
- await writeFile(target, buffer);
15
- const s = await stat(target);
16
- return { path: relativePath, size: s.size, modifiedAt: s.mtime.toISOString() };
17
- }
18
- export async function uploadWorkspaceFileStream(rootPath, path, stream) {
19
- if (path === undefined || path === "")
20
- throw new Error("Upload body must include path and file");
21
- const { target, relativePath } = await resolveParentInsideWorkspace(rootPath, path);
22
- const tempTarget = join(dirname(target), `${relativePath.split("/").pop() ?? "upload"}.${randomUUID()}.uploading`);
23
- try {
24
- await pipeline(stream, createWriteStream(tempTarget));
25
- await rename(tempTarget, target);
26
- }
27
- catch (error) {
28
- await rm(tempTarget, { force: true }).catch(() => undefined);
29
- throw error;
30
- }
31
- const s = await stat(target);
32
- return { path: relativePath, size: s.size, modifiedAt: s.mtime.toISOString() };
33
- }
34
- function isWorkspaceUploadInput(input) {
35
- return typeof input === "object"
36
- && input !== null
37
- && typeof Reflect.get(input, "path") === "string"
38
- && typeof Reflect.get(input, "contentBase64") === "string";
39
- }
40
- function isBase64Content(value) {
41
- return value === "" || /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u.test(value);
42
- }
43
- //# sourceMappingURL=fileUploadService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileUploadService.js","sourceRoot":"","sources":["../../../src/server/workspaces/fileUploadService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAO/D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB,EAAE,KAA2B;IACrF,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CA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