@alivault/pico 0.2.0 → 0.2.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.
@@ -2,7 +2,7 @@ import { i as __toESM } from "../_runtime.mjs";
2
2
  import { X as require_react, Y as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { a as createRouter, c as createRootRoute, n as Scripts, r as HeadContent, s as createFileRoute } from "../_libs/@tanstack/react-router+[...].mjs";
4
4
  import { h as OctagonX, i as TriangleAlert, k as CircleCheck, v as Info } from "../_libs/lucide-react.mjs";
5
- import { C as TooltipProvider, D as buildItemsFromSync, E as assistantBlocksFromMessage, L as mergeAssistantBlocksForStreaming, M as extractMessageImages, N as extractMessageText$1, P as extractToolText, k as createCompactionSummaryItem, m as Route$46, st as toolCategoryFromTool, v as Spinner, y as THEME_STORAGE_KEY } from "./routes-C7FEKcrl.mjs";
5
+ import { C as TooltipProvider, D as buildItemsFromSync, E as assistantBlocksFromMessage, L as mergeAssistantBlocksForStreaming, M as extractMessageImages, N as extractMessageText$1, P as extractToolText, k as createCompactionSummaryItem, m as Route$46, st as toolCategoryFromTool, v as Spinner, y as THEME_STORAGE_KEY } from "./routes-C8zGEsem.mjs";
6
6
  import { t as QueryClient } from "../_libs/tanstack__query-core.mjs";
7
7
  import { t as setupRouterSsrQueryIntegration } from "../_libs/@tanstack/react-router-ssr-query+[...].mjs";
8
8
  import { n as HotkeysProvider } from "../_libs/tanstack__react-hotkeys.mjs";
@@ -20,7 +20,7 @@ import os, { homedir } from "node:os";
20
20
  import { performance } from "node:perf_hooks";
21
21
  import { isMainThread } from "node:worker_threads";
22
22
  import { execSync, spawn } from "node:child_process";
23
- //#region node_modules/.nitro/vite/services/ssr/assets/router-BDJ6CDfq.js
23
+ //#region node_modules/.nitro/vite/services/ssr/assets/router-L-w2zu97.js
24
24
  var import_react = /* @__PURE__ */ __toESM(require_react());
25
25
  var import_jsx_runtime = require_jsx_runtime();
26
26
  var Toaster$1 = ({ ...props }) => {
@@ -6630,18 +6630,44 @@ var Route$29 = createFileRoute("/api/git-checkout")({ server: { handlers: { POST
6630
6630
  return routeErrorResponse(error, "Failed to switch branch");
6631
6631
  }
6632
6632
  } } } });
6633
+ var GIT_CHANGES_SCOPES = new Set([
6634
+ "all",
6635
+ "files",
6636
+ "branches",
6637
+ "commits"
6638
+ ]);
6639
+ function isGitChangesScope(value) {
6640
+ return Boolean(value && GIT_CHANGES_SCOPES.has(value));
6641
+ }
6642
+ function getGitChangesScope(url) {
6643
+ const gitScope = url.searchParams.get("gitScope");
6644
+ if (isGitChangesScope(gitScope)) return gitScope;
6645
+ const legacyScope = url.searchParams.get("scope");
6646
+ return isGitChangesScope(legacyScope) ? legacyScope : "all";
6647
+ }
6648
+ function getRuntimeRequestForGitChanges(request, url) {
6649
+ const legacyScope = url.searchParams.get("scope");
6650
+ if (url.searchParams.has("gitScope") || !isGitChangesScope(legacyScope)) return request;
6651
+ const runtimeUrl = new URL(url);
6652
+ runtimeUrl.searchParams.delete("scope");
6653
+ return new Request(runtimeUrl.toString(), {
6654
+ headers: request.headers,
6655
+ method: request.method
6656
+ });
6657
+ }
6633
6658
  var Route$28 = createFileRoute("/api/git-changes")({ server: { handlers: { GET: async ({ request }) => {
6634
6659
  const url = new URL(request.url);
6635
6660
  const requestedCwd = url.searchParams.get("cwd") || "";
6636
- const scope = url.searchParams.get("scope") || "all";
6661
+ const gitScope = getGitChangesScope(url);
6637
6662
  const commitsLimitValue = url.searchParams.get("commitsLimit");
6638
6663
  const commitsLimitParam = Number(commitsLimitValue);
6639
6664
  const commitsLimit = commitsLimitValue !== null && Number.isFinite(commitsLimitParam) ? commitsLimitParam : void 0;
6640
6665
  if (!requestedCwd.trim()) return errorResponse("cwd is required");
6641
6666
  try {
6642
- const { context, activeEntry } = await getPicoRuntime().resolveRequest(request);
6667
+ const runtimeRequest = getRuntimeRequestForGitChanges(request, url);
6668
+ const { context, activeEntry } = await getPicoRuntime().resolveRequest(runtimeRequest);
6643
6669
  const cwd = await resolveDirectoryPath(requestedCwd, getPicoRuntime().getBaseCwd(activeEntry, context));
6644
- if (scope === "files") {
6670
+ if (gitScope === "files") {
6645
6671
  const files = await readDirectoryGitFiles(cwd);
6646
6672
  return jsonResponse({
6647
6673
  ok: true,
@@ -6655,7 +6681,7 @@ var Route$28 = createFileRoute("/api/git-changes")({ server: { handlers: { GET:
6655
6681
  unpushedCommitShortHashes: []
6656
6682
  });
6657
6683
  }
6658
- if (scope === "branches") {
6684
+ if (gitScope === "branches") {
6659
6685
  const branches = await readDirectoryGitBranches(cwd);
6660
6686
  return jsonResponse({
6661
6687
  ok: true,
@@ -6669,7 +6695,7 @@ var Route$28 = createFileRoute("/api/git-changes")({ server: { handlers: { GET:
6669
6695
  unpushedCommitShortHashes: []
6670
6696
  });
6671
6697
  }
6672
- if (scope === "commits") {
6698
+ if (gitScope === "commits") {
6673
6699
  const commits = await readDirectoryGitCommits(cwd, { limit: commitsLimit });
6674
6700
  return jsonResponse({
6675
6701
  ok: true,
@@ -5,7 +5,7 @@ import { n as clsx } from "../_libs/class-variance-authority+clsx.mjs";
5
5
  import { t as twMerge } from "../_libs/tailwind-merge.mjs";
6
6
  import { B as ArrowDown, I as ArrowUp, M as ChevronUp, O as Command, R as ArrowRight, V as ArrowBigUp, m as Option, z as ArrowLeft } from "../_libs/lucide-react.mjs";
7
7
  import { n as string, t as object } from "../_libs/zod.mjs";
8
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-C7FEKcrl.js
8
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-C8zGEsem.js
9
9
  var import_react = /* @__PURE__ */ __toESM(require_react());
10
10
  var import_jsx_runtime = require_jsx_runtime();
11
11
  function cn(...inputs) {
@@ -1269,7 +1269,7 @@ function getSessionTitle(summary) {
1269
1269
  if (summary?.name?.trim()) return summary.name.trim();
1270
1270
  return "New session";
1271
1271
  }
1272
- var $$splitComponentImporter = () => import("./routes-D0o-mw7d.mjs");
1272
+ var $$splitComponentImporter = () => import("./routes-u4ntFNaT.mjs");
1273
1273
  var indexSearchSchema = object({ session: string().optional() });
1274
1274
  var Route = createFileRoute("/")({
1275
1275
  validateSearch: indexSearchSchema,