@narumitw/pi-files 0.0.0-stage → 0.1.0

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 (64) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +21 -0
  3. package/README.md +102 -2
  4. package/dist/chunks/chunk-3GQ7VS22.ts +273 -0
  5. package/dist/chunks/chunk-3GQ7VS22.ts.map +7 -0
  6. package/dist/chunks/chunk-AXW73HDJ.ts +31 -0
  7. package/dist/chunks/chunk-AXW73HDJ.ts.map +7 -0
  8. package/dist/chunks/chunk-F5QFC255.ts +101 -0
  9. package/dist/chunks/chunk-F5QFC255.ts.map +7 -0
  10. package/dist/chunks/chunk-NFNGJETD.ts +77 -0
  11. package/dist/chunks/chunk-NFNGJETD.ts.map +7 -0
  12. package/dist/chunks/chunk-OPGTWNJI.ts +258 -0
  13. package/dist/chunks/chunk-OPGTWNJI.ts.map +7 -0
  14. package/dist/chunks/chunk-WOTDNRTG.ts +242 -0
  15. package/dist/chunks/chunk-WOTDNRTG.ts.map +7 -0
  16. package/dist/chunks/file-context-explorer-WR6GQZHF.ts +1793 -0
  17. package/dist/chunks/file-context-explorer-WR6GQZHF.ts.map +7 -0
  18. package/dist/chunks/file-context-menu-VPLHUUQ6.ts +302 -0
  19. package/dist/chunks/file-context-menu-VPLHUUQ6.ts.map +7 -0
  20. package/dist/chunks/files-menu-MES4MQ4F.ts +119 -0
  21. package/dist/chunks/files-menu-MES4MQ4F.ts.map +7 -0
  22. package/dist/chunks/files-settings-NYXQU2HV.ts +295 -0
  23. package/dist/chunks/files-settings-NYXQU2HV.ts.map +7 -0
  24. package/dist/chunks/menu-P6IBMROH.ts +876 -0
  25. package/dist/chunks/menu-P6IBMROH.ts.map +7 -0
  26. package/dist/index.ts +1789 -0
  27. package/dist/index.ts.map +7 -0
  28. package/docs/edit-scope-reference.md +142 -0
  29. package/docs/file-context-reference.md +91 -0
  30. package/docs/migration.md +105 -0
  31. package/docs/verification.md +99 -0
  32. package/package.json +58 -4
  33. package/src/content-search-session.ts +204 -0
  34. package/src/content-search-ui.ts +159 -0
  35. package/src/content-search.ts +170 -0
  36. package/src/context-service.ts +515 -0
  37. package/src/external-editor.ts +143 -0
  38. package/src/file-browser-ui.ts +128 -0
  39. package/src/file-browser.ts +76 -0
  40. package/src/file-context-explorer.ts +992 -0
  41. package/src/file-context-menu.ts +360 -0
  42. package/src/file-context-preview-ui.ts +354 -0
  43. package/src/file-context-settings.ts +301 -0
  44. package/src/file-context.ts +321 -0
  45. package/src/file-search.ts +246 -0
  46. package/src/files-menu.ts +125 -0
  47. package/src/files-settings.ts +314 -0
  48. package/src/files-widget.ts +65 -0
  49. package/src/files.ts +148 -0
  50. package/src/git-context.ts +485 -0
  51. package/src/index.ts +1 -0
  52. package/src/scope/contracts.ts +243 -0
  53. package/src/scope/display.ts +27 -0
  54. package/src/scope/edit-scope.ts +435 -0
  55. package/src/scope/files.ts +118 -0
  56. package/src/scope/input.ts +207 -0
  57. package/src/scope/menu.ts +277 -0
  58. package/src/scope/paths.ts +142 -0
  59. package/src/scope/picker-keys.ts +154 -0
  60. package/src/scope/picker.ts +484 -0
  61. package/src/scope/policy.ts +55 -0
  62. package/src/scope/settings.ts +138 -0
  63. package/src/scope/state.ts +91 -0
  64. package/src/scope/ui.ts +106 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/file-context.ts"],
4
+ "sourcesContent": ["import { createHash } from \"node:crypto\";\nimport { constants } from \"node:fs\";\nimport { lstat, open, readdir, realpath } from \"node:fs/promises\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport type { GitFileContext, GitProjectInfo, GitRevisionFile } from \"./git-context.js\";\n\nconst DEFAULT_MAX_FILES = 5_000;\nconst DEFAULT_MAX_BYTES = 1_000_000;\nexport const MAX_QUOTE_BYTES = 50_000;\nexport const MAX_QUOTE_LINES = 500;\nexport const MAX_PENDING_QUOTES = 8;\nexport const MAX_PENDING_QUOTE_BYTES = 100_000;\nconst IGNORED_DIRECTORIES = new Set([\n \".git\",\n \".hg\",\n \".svn\",\n \".next\",\n \"build\",\n \"coverage\",\n \"dist\",\n \"node_modules\",\n \"target\",\n]);\n\nexport interface FileQuoteGitProvenance {\n head: string;\n branch?: string;\n status?: string;\n revision?: string;\n blob?: string;\n contentSha256: string;\n source?: \"worktree\" | \"revision\" | \"git_diff\";\n base?: string;\n}\n\nexport type FileQuoteGitProvenanceInput = Omit<FileQuoteGitProvenance, \"contentSha256\">;\n\nexport interface FileQuote {\n path: string;\n startLine: number;\n endLine: number;\n text: string;\n git?: FileQuoteGitProvenance;\n}\n\nexport interface LoadedProjectTextFile {\n path: string;\n lines: string[];\n}\n\ninterface DiscoveryOptions {\n maxFiles?: number;\n signal?: AbortSignal;\n}\n\ninterface LoadOptions {\n maxBytes?: number;\n beforeOpen?: () => Promise<void>;\n signal?: AbortSignal;\n}\n\nexport async function discoverProjectFiles(root: string, options: DiscoveryOptions = {}): Promise<string[]> {\n const maxFiles = Math.max(1, options.maxFiles ?? DEFAULT_MAX_FILES);\n const files: string[] = [];\n options.signal?.throwIfAborted();\n\n const canonicalRoot = await realpath(root);\n const directories: Array<{ directory: string; prefix: string }> = [{ directory: canonicalRoot, prefix: \"\" }];\n options.signal?.throwIfAborted();\n\n for (let index = 0; index < directories.length && files.length < maxFiles; index += 1) {\n options.signal?.throwIfAborted();\n const current = directories[index];\n if (!current) break;\n const { directory, prefix } = current;\n const entries = (await readdir(directory, { withFileTypes: true })).sort((left, right) =>\n compareStrings(left.name, right.name),\n );\n options.signal?.throwIfAborted();\n for (const entry of entries) {\n options.signal?.throwIfAborted();\n if (IGNORED_DIRECTORIES.has(entry.name) || entry.isSymbolicLink()) continue;\n const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;\n const absolutePath = resolve(directory, entry.name);\n if (entry.isDirectory()) {\n directories.push({ directory: absolutePath, prefix: relativePath });\n } else if (entry.isFile()) {\n files.push(relativePath);\n if (files.length >= maxFiles) break;\n }\n }\n }\n options.signal?.throwIfAborted();\n return files.sort(compareStrings);\n}\n\nexport async function loadProjectTextFile(\n root: string,\n projectPath: string,\n options: LoadOptions = {},\n): Promise<LoadedProjectTextFile> {\n options.signal?.throwIfAborted();\n if (!projectPath || isAbsolute(projectPath)) throw new Error(\"File path is outside the project\");\n const canonicalRoot = await realpath(root);\n options.signal?.throwIfAborted();\n const candidate = resolve(canonicalRoot, projectPath);\n if (!isInside(canonicalRoot, candidate)) throw new Error(\"File path is outside the project\");\n\n let canonicalFile: string;\n try {\n canonicalFile = await realpath(candidate);\n } catch (error: unknown) {\n throw new Error(`Cannot open ${projectPath}: ${formatError(error)}`);\n }\n options.signal?.throwIfAborted();\n if (!isInside(canonicalRoot, canonicalFile)) throw new Error(\"File path is outside the project\");\n const info = await lstat(canonicalFile);\n options.signal?.throwIfAborted();\n if (!info.isFile()) throw new Error(`${projectPath} is not a regular file`);\n\n const maxBytes = Math.max(1, options.maxBytes ?? DEFAULT_MAX_BYTES);\n if (info.size > maxBytes) throw new Error(`${projectPath} exceeds ${maxBytes} bytes`);\n await options.beforeOpen?.();\n options.signal?.throwIfAborted();\n let file: Awaited<ReturnType<typeof open>>;\n try {\n file = await open(canonicalFile, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));\n } catch (error: unknown) {\n throw new Error(`Cannot safely open ${projectPath}: ${formatError(error)}`);\n }\n try {\n options.signal?.throwIfAborted();\n const openedInfo = await file.stat();\n options.signal?.throwIfAborted();\n if (!openedInfo.isFile()) throw new Error(`${projectPath} is not a regular file`);\n if (openedInfo.dev !== info.dev || openedInfo.ino !== info.ino) {\n throw new Error(`${projectPath} changed while it was being opened safely`);\n }\n if (openedInfo.size > maxBytes) throw new Error(`${projectPath} exceeds ${maxBytes} bytes`);\n const buffer = Buffer.alloc(maxBytes + 1);\n let offset = 0;\n while (offset < buffer.length) {\n options.signal?.throwIfAborted();\n const { bytesRead } = await file.read(buffer, offset, buffer.length - offset, offset);\n options.signal?.throwIfAborted();\n if (bytesRead === 0) break;\n offset += bytesRead;\n }\n if (offset > maxBytes) throw new Error(`${projectPath} exceeds ${maxBytes} bytes`);\n const contents = buffer.subarray(0, offset);\n if (contents.includes(0)) throw new Error(`${projectPath} appears to be binary`);\n return {\n path: projectPath.replaceAll(\"\\\\\", \"/\"),\n lines: normalizeTextLines(contents.toString(\"utf8\")),\n };\n } finally {\n await file.close();\n }\n}\n\nexport function createFileQuote(\n path: string,\n lines: readonly string[],\n anchorIndex: number,\n cursorIndex: number,\n git?: FileQuoteGitProvenanceInput,\n): FileQuote {\n if (lines.length === 0) throw new Error(\"Cannot quote an empty file\");\n const startIndex = Math.max(0, Math.min(anchorIndex, cursorIndex, lines.length - 1));\n const endIndex = Math.max(0, Math.min(Math.max(anchorIndex, cursorIndex), lines.length - 1));\n const text = lines.slice(startIndex, endIndex + 1).join(\"\\n\");\n return createFileQuoteSnapshot(path, startIndex + 1, endIndex + 1, text, git);\n}\n\nexport function createFileQuoteSnapshot(\n path: string,\n startLine: number,\n endLine: number,\n text: string,\n git?: FileQuoteGitProvenanceInput,\n): FileQuote {\n if (!Number.isSafeInteger(startLine) || !Number.isSafeInteger(endLine) || startLine < 1) {\n throw new Error(\"Quote lines must be positive integers\");\n }\n if (endLine < startLine) throw new Error(\"Quote end line precedes its start line\");\n if (text.split(\"\\n\").length > MAX_QUOTE_LINES) {\n throw new Error(`Quote exceeds ${MAX_QUOTE_LINES} lines`);\n }\n if (Buffer.byteLength(text, \"utf8\") > MAX_QUOTE_BYTES) {\n throw new Error(`Quote exceeds ${MAX_QUOTE_BYTES} bytes`);\n }\n return {\n path,\n startLine,\n endLine,\n text,\n ...(git\n ? {\n git: {\n head: git.head,\n ...(git.branch !== undefined ? { branch: git.branch } : {}),\n ...(git.status !== undefined ? { status: git.status } : {}),\n ...(git.revision !== undefined ? { revision: git.revision } : {}),\n ...(git.blob !== undefined ? { blob: git.blob } : {}),\n contentSha256: createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\"),\n ...(git.source !== undefined ? { source: git.source } : {}),\n ...(git.base !== undefined ? { base: git.base } : {}),\n },\n }\n : {}),\n };\n}\n\n/** Capture the exact worktree or historical preview with selection-time provenance. */\nexport function createPreviewQuote(\n file: LoadedProjectTextFile,\n anchor: number,\n cursor: number,\n project?: GitProjectInfo,\n git?: GitFileContext,\n revision?: GitRevisionFile,\n): FileQuote {\n return createFileQuote(\n file.path,\n file.lines,\n anchor,\n cursor,\n project\n ? {\n head: project.head,\n branch: project.branch,\n status: revision ? \"historical\" : (git?.status?.label ?? \"clean\"),\n revision: revision?.revision,\n blob: revision?.blob ?? git?.blob,\n source: revision ? \"revision\" : \"worktree\",\n base: revision ? undefined : \"HEAD\",\n }\n : undefined,\n );\n}\n\nexport function appendPendingQuote(current: readonly FileQuote[], quote: FileQuote): FileQuote[] {\n if (current.length >= MAX_PENDING_QUOTES) {\n throw new Error(`File Context supports at most ${MAX_PENDING_QUOTES} pending quotes`);\n }\n const totalBytes = [...current, quote].reduce((total, item) => total + Buffer.byteLength(item.text, \"utf8\"), 0);\n if (totalBytes > MAX_PENDING_QUOTE_BYTES) {\n throw new Error(`Pending quotes exceed ${MAX_PENDING_QUOTE_BYTES} bytes`);\n }\n return [...current, quote];\n}\n\nexport function formatPromptWithQuote(prompt: string, quote: FileQuote): string {\n return formatPromptWithQuotes(prompt, [quote]);\n}\n\nexport function formatPromptWithQuotes(prompt: string, quotes: readonly FileQuote[]): string {\n if (quotes.length === 0) return prompt;\n return `${formatQuoteContext(quotes)}\\n\\n${prompt}`;\n}\n\nexport function formatQuoteContext(quotes: readonly FileQuote[]): string {\n const blocks = quotes.map((quote) => {\n const path = escapeXml(quote.path);\n const text = escapeXml(quote.text);\n const attributes = [\n `path=\"${path}\"`,\n `lines=\"${quote.startLine}-${quote.endLine}\"`,\n ...formatGitAttributes(quote.git),\n ].join(\" \");\n return `<user_file_quote ${attributes}>\\n${text}\\n</user_file_quote>`;\n });\n const description =\n quotes.length === 1\n ? \"The user intentionally selected the file excerpt above.\"\n : \"The user intentionally selected the file excerpts above.\";\n return `${blocks.join(\"\\n\\n\")}\\n\\n${description}`;\n}\n\nfunction normalizeTextLines(contents: string): string[] {\n if (contents === \"\") return [];\n const lines = contents.replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\"\\r\", \"\\n\").split(\"\\n\");\n if (lines.at(-1) === \"\") lines.pop();\n return lines;\n}\n\nfunction compareStrings(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\nfunction isInside(root: string, candidate: string): boolean {\n const result = relative(root, candidate);\n return result === \"\" || (!result.startsWith(`..${sep}`) && result !== \"..\" && !isAbsolute(result));\n}\n\nfunction formatGitAttributes(git: FileQuoteGitProvenance | undefined): string[] {\n if (!git) return [];\n return [\n [\"git_head\", git.head],\n [\"git_branch\", git.branch],\n [\"git_status\", git.status],\n [\"git_revision\", git.revision],\n [\"git_blob\", git.blob],\n [\"content_sha256\", git.contentSha256],\n [\"source\", git.source],\n [\"git_base\", git.base],\n ].flatMap(([name, value]) => (value ? [`${name}=\"${escapeXml(value)}\"`] : []));\n}\n\nfunction escapeXml(value: string): string {\n return value\n .replaceAll(\"&\", \"&amp;\")\n .replaceAll(\"<\", \"&lt;\")\n .replaceAll(\">\", \"&gt;\")\n .replaceAll('\"', \"&quot;\")\n .replaceAll(\"'\", \"&apos;\");\n}\n\nfunction formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"],
5
+ "mappings": ";;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,OAAO,MAAM,SAAS,gBAAgB;AAC/C,SAAS,YAAY,UAAU,SAAS,WAAW;AAGnD,IAAM,oBAAoB;AAC1B,IAAM,oBAAoB;AACnB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AACxB,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AACvC,IAAM,sBAAsB,oBAA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