@mduan/paseo-cli 0.11.0-fork.5 → 0.11.0-fork.6

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 (22) hide show
  1. package/node_modules/@getpaseo/client/package.json +3 -3
  2. package/node_modules/@getpaseo/highlight/package.json +1 -1
  3. package/node_modules/@getpaseo/plugin/package.json +3 -3
  4. package/node_modules/@getpaseo/protocol/dist/generated/validation/ws-outbound.aot.js +5 -0
  5. package/node_modules/@getpaseo/protocol/dist/messages.d.ts +4 -0
  6. package/node_modules/@getpaseo/protocol/dist/messages.js +1 -0
  7. package/node_modules/@getpaseo/protocol/dist/validation/ws-outbound-schema-metadata.d.ts +1 -0
  8. package/node_modules/@getpaseo/protocol/package.json +1 -1
  9. package/node_modules/@getpaseo/relay/package.json +1 -1
  10. package/node_modules/@getpaseo/server/dist/server/builtin-plugins/package.json +1 -1
  11. package/node_modules/@getpaseo/server/dist/server/server/session/checkout/checkout-session.js +2 -1
  12. package/node_modules/@getpaseo/server/dist/server/utils/checkout-git.d.ts +8 -1
  13. package/node_modules/@getpaseo/server/dist/server/utils/checkout-git.js +30 -18
  14. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-dcbfa9f4d3298e0528a0fe45fc8d33ab.js → index-39387227f55ac3348edf743607665554.js} +4 -4
  15. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-39387227f55ac3348edf743607665554.js.br +0 -0
  16. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-dcbfa9f4d3298e0528a0fe45fc8d33ab.js.gz → index-39387227f55ac3348edf743607665554.js.gz} +0 -0
  17. package/node_modules/@getpaseo/server/dist/server/web-ui/index.html +1 -1
  18. package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.br +0 -0
  19. package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.gz +0 -0
  20. package/node_modules/@getpaseo/server/package.json +6 -6
  21. package/package.json +7 -7
  22. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/index-dcbfa9f4d3298e0528a0fe45fc8d33ab.js.br +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/client",
3
- "version": "0.11.0-fork.5",
3
+ "version": "0.11.0-fork.6",
4
4
  "description": "Paseo client SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -44,7 +44,7 @@
44
44
  "vitest": "^4.1.6"
45
45
  },
46
46
  "dependencies": {
47
- "@getpaseo/protocol": "0.11.0-fork.5",
48
- "@getpaseo/relay": "0.11.0-fork.5"
47
+ "@getpaseo/protocol": "0.11.0-fork.6",
48
+ "@getpaseo/relay": "0.11.0-fork.6"
49
49
  }
50
50
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/highlight",
3
- "version": "0.11.0-fork.5",
3
+ "version": "0.11.0-fork.6",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.map",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/plugin",
3
- "version": "0.11.0-fork.5",
3
+ "version": "0.11.0-fork.6",
4
4
  "description": "Paseo plugin SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -66,8 +66,8 @@
66
66
  "test": "vitest run"
67
67
  },
68
68
  "devDependencies": {
69
- "@getpaseo/client": "0.11.0-fork.5",
70
- "@getpaseo/protocol": "0.11.0-fork.5",
69
+ "@getpaseo/client": "0.11.0-fork.6",
70
+ "@getpaseo/protocol": "0.11.0-fork.6",
71
71
  "@types/node": "^20.9.0",
72
72
  "@types/react": "~19.2.0",
73
73
  "react": "19.1.0",
@@ -80530,6 +80530,11 @@ export const WSOutboundMessageSchema = /* @__PURE__ */ (() => {
80530
80530
  else if (!Number.isFinite(__o_5518["committerDate"])) {
80531
80531
  _e.push({ code: "invalid_type", expected: "number", received: "Infinity", input: __o_5518["committerDate"], path: ["message"].concat("payload").concat("branchDetails").concat(__i_5517).concat("committerDate") });
80532
80532
  }
80533
+ if (__o_5518["isDefault"] !== undefined) {
80534
+ if (typeof __o_5518["isDefault"] !== "boolean") {
80535
+ _e.push({ code: "invalid_type", expected: "boolean", input: __o_5518["isDefault"], path: ["message"].concat("payload").concat("branchDetails").concat(__i_5517).concat("isDefault") });
80536
+ }
80537
+ }
80533
80538
  if (__o_5518["hasLocal"] !== undefined) {
80534
80539
  if (typeof __o_5518["hasLocal"] !== "boolean") {
80535
80540
  _e.push({ code: "invalid_type", expected: "boolean", input: __o_5518["hasLocal"], path: ["message"].concat("payload").concat("branchDetails").concat(__i_5517).concat("hasLocal") });
@@ -18895,6 +18895,7 @@ export declare const BranchSuggestionsResponseSchema: z.ZodObject<{
18895
18895
  branchDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
18896
18896
  name: z.ZodString;
18897
18897
  committerDate: z.ZodNumber;
18898
+ isDefault: z.ZodOptional<z.ZodBoolean>;
18898
18899
  hasLocal: z.ZodOptional<z.ZodBoolean>;
18899
18900
  hasRemote: z.ZodOptional<z.ZodBoolean>;
18900
18901
  localAhead: z.ZodOptional<z.ZodNumber>;
@@ -31848,6 +31849,7 @@ export declare const SessionOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
31848
31849
  branchDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
31849
31850
  name: z.ZodString;
31850
31851
  committerDate: z.ZodNumber;
31852
+ isDefault: z.ZodOptional<z.ZodBoolean>;
31851
31853
  hasLocal: z.ZodOptional<z.ZodBoolean>;
31852
31854
  hasRemote: z.ZodOptional<z.ZodBoolean>;
31853
31855
  localAhead: z.ZodOptional<z.ZodNumber>;
@@ -47213,6 +47215,7 @@ export declare const WSSessionOutboundSchema: z.ZodObject<{
47213
47215
  branchDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
47214
47216
  name: z.ZodString;
47215
47217
  committerDate: z.ZodNumber;
47218
+ isDefault: z.ZodOptional<z.ZodBoolean>;
47216
47219
  hasLocal: z.ZodOptional<z.ZodBoolean>;
47217
47220
  hasRemote: z.ZodOptional<z.ZodBoolean>;
47218
47221
  localAhead: z.ZodOptional<z.ZodNumber>;
@@ -62223,6 +62226,7 @@ export declare const WSOutboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
62223
62226
  branchDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
62224
62227
  name: z.ZodString;
62225
62228
  committerDate: z.ZodNumber;
62229
+ isDefault: z.ZodOptional<z.ZodBoolean>;
62226
62230
  hasLocal: z.ZodOptional<z.ZodBoolean>;
62227
62231
  hasRemote: z.ZodOptional<z.ZodBoolean>;
62228
62232
  localAhead: z.ZodOptional<z.ZodNumber>;
@@ -5282,6 +5282,7 @@ export const BranchSuggestionsResponseSchema = z.object({
5282
5282
  .array(z.object({
5283
5283
  name: z.string(),
5284
5284
  committerDate: z.number(),
5285
+ isDefault: z.boolean().optional(),
5285
5286
  hasLocal: z.boolean().optional(),
5286
5287
  hasRemote: z.boolean().optional(),
5287
5288
  localAhead: z.number().int().nonnegative().optional(),
@@ -9787,6 +9787,7 @@ export declare const WSOutboundMessageSchema: {
9787
9787
  branchDetails: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
9788
9788
  name: import("zod").ZodString;
9789
9789
  committerDate: import("zod").ZodNumber;
9790
+ isDefault: import("zod").ZodOptional<import("zod").ZodBoolean>;
9790
9791
  hasLocal: import("zod").ZodOptional<import("zod").ZodBoolean>;
9791
9792
  hasRemote: import("zod").ZodOptional<import("zod").ZodBoolean>;
9792
9793
  localAhead: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/protocol",
3
- "version": "0.11.0-fork.5",
3
+ "version": "0.11.0-fork.6",
4
4
  "description": "Paseo shared protocol schemas and wire types",
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/relay",
3
- "version": "0.11.0-fork.5",
3
+ "version": "0.11.0-fork.6",
4
4
  "description": "Paseo relay for bridging daemon and client connections",
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/builtin-plugins",
3
- "version": "0.11.0-fork.5",
3
+ "version": "0.11.0-fork.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -5,7 +5,7 @@ import { validateBranchSlug } from "@getpaseo/protocol/branch-slug";
5
5
  import { toCheckoutError } from "../../checkout-git-utils.js";
6
6
  import { buildCheckoutPrStatusPayloadFromSnapshot, buildCheckoutStatusPayloadFromSnapshot, } from "../../checkout/status-projection.js";
7
7
  import { assertSafeGitRef } from "../../worktree-session.js";
8
- import { commitChanges, createPullRequest, discardChanges, forgeAuthStateFromError, isForgeAuthError, mergeFromBase, mergeToBase, pullCurrentBranch, pushCurrentBranch, listCheckoutCommits, getCommitFileDiff, readDiffContextLines, setCurrentBranchBaseRef, } from "../../../utils/checkout-git.js";
8
+ import { BranchCheckoutKind, commitChanges, createPullRequest, discardChanges, forgeAuthStateFromError, isForgeAuthError, mergeFromBase, mergeToBase, pullCurrentBranch, pushCurrentBranch, listCheckoutCommits, getCommitFileDiff, readDiffContextLines, setCurrentBranchBaseRef, } from "../../../utils/checkout-git.js";
9
9
  import { runGitCommand } from "../../../utils/run-git-command.js";
10
10
  import { expandTilde } from "../../../utils/path.js";
11
11
  function assertSafeRelativePath(path) {
@@ -223,6 +223,7 @@ export class CheckoutSession {
223
223
  });
224
224
  return;
225
225
  case "remote-only":
226
+ case BranchCheckoutKind.Remote:
226
227
  this.host.emit({
227
228
  type: "validate_branch_response",
228
229
  payload: {
@@ -24,6 +24,7 @@ export declare function __setPullRequestStatusCacheTtlForTests(ttlMs: number): v
24
24
  export declare function __resetCheckoutShortstatCacheForTests(): void;
25
25
  export declare function __setCheckoutShortstatCacheTtlForTests(ttlMs: number): void;
26
26
  export interface BranchSuggestion {
27
+ isDefault?: boolean;
27
28
  name: string;
28
29
  committerDate: number;
29
30
  hasLocal: boolean;
@@ -47,7 +48,13 @@ export interface RemoteOnlyBranchCheckoutResolution {
47
48
  export interface NotFoundBranchCheckoutResolution {
48
49
  kind: "not-found";
49
50
  }
50
- export type BranchCheckoutResolution = LocalBranchCheckoutResolution | RemoteOnlyBranchCheckoutResolution | NotFoundBranchCheckoutResolution;
51
+ export declare enum BranchCheckoutKind {
52
+ Remote = "remote"
53
+ }
54
+ export type BranchCheckoutResolution = LocalBranchCheckoutResolution | RemoteOnlyBranchCheckoutResolution | {
55
+ kind: BranchCheckoutKind.Remote;
56
+ remoteRef: string;
57
+ } | NotFoundBranchCheckoutResolution;
51
58
  export declare function resolveBranchCheckout(cwd: string, name: string): Promise<BranchCheckoutResolution>;
52
59
  export type BranchCheckoutSource = "local" | "remote";
53
60
  export interface CheckoutExistingBranchResult {
@@ -169,9 +169,10 @@ export async function listBranchSuggestions(cwd, options) {
169
169
  const limit = Math.max(1, Math.min(200, requestedLimit));
170
170
  const rawQuery = options?.query?.trim().toLowerCase() ?? "";
171
171
  const query = normalizeBranchSuggestionName(rawQuery) ?? rawQuery;
172
- const [localRefs, remoteRefs] = await Promise.all([
172
+ const [localRefs, remoteRefs, defaultBranch] = await Promise.all([
173
173
  listGitRefs(cwd, "refs/heads"),
174
174
  listGitRefs(cwd, "refs/remotes/origin"),
175
+ resolveRepositoryDefaultBranch(cwd),
175
176
  ]);
176
177
  const branchMeta = new Map();
177
178
  for (const ref of localRefs) {
@@ -218,6 +219,7 @@ export async function listBranchSuggestions(cwd, options) {
218
219
  const meta = branchMeta.get(name);
219
220
  const suggestion = {
220
221
  name,
222
+ isDefault: name === normalizeBranchSuggestionName(defaultBranch ?? ""),
221
223
  committerDate: meta?.committerDate ?? 0,
222
224
  hasLocal: meta?.hasLocal ?? false,
223
225
  hasRemote: meta?.hasRemote ?? false,
@@ -250,31 +252,38 @@ export async function listBranchSuggestions(cwd, options) {
250
252
  return suggestion;
251
253
  }));
252
254
  }
255
+ export var BranchCheckoutKind;
256
+ (function (BranchCheckoutKind) {
257
+ BranchCheckoutKind["Remote"] = "remote";
258
+ })(BranchCheckoutKind || (BranchCheckoutKind = {}));
253
259
  export async function resolveBranchCheckout(cwd, name) {
254
260
  await requireGitRepo(cwd);
255
- const normalized = normalizeBranchSuggestionName(name);
261
+ const requestedRef = name.trim();
262
+ const isExplicitRemote = requestedRef.startsWith("refs/remotes/") || requestedRef.startsWith("origin/");
263
+ if (isExplicitRemote) {
264
+ const remoteRef = requestedRef.startsWith("refs/remotes/")
265
+ ? requestedRef
266
+ : `refs/remotes/${requestedRef}`;
267
+ if (await doesGitRefExist(cwd, remoteRef)) {
268
+ return { kind: BranchCheckoutKind.Remote, remoteRef };
269
+ }
270
+ return { kind: "not-found" };
271
+ }
272
+ const isExplicitLocal = requestedRef.startsWith("refs/heads/");
273
+ const normalized = isExplicitLocal
274
+ ? requestedRef.slice("refs/heads/".length)
275
+ : normalizeBranchSuggestionName(requestedRef);
256
276
  if (!normalized) {
257
277
  return { kind: "not-found" };
258
278
  }
259
- const localRef = `refs/heads/${normalized}`;
260
- const localResult = await runGitCommand(["rev-parse", "--verify", "--quiet", localRef], {
261
- cwd,
262
- envOverlay: READ_ONLY_GIT_ENV,
263
- acceptExitCodes: [0, 1],
264
- });
265
- const hasLocal = localResult.exitCode === 0;
266
- if (hasLocal) {
279
+ if (await doesGitRefExist(cwd, `refs/heads/${normalized}`)) {
267
280
  return { kind: "local", name: normalized };
268
281
  }
282
+ if (isExplicitLocal) {
283
+ return { kind: "not-found" };
284
+ }
269
285
  const remoteRef = `origin/${normalized}`;
270
- const remoteRefPath = `refs/remotes/${remoteRef}`;
271
- const remoteResult = await runGitCommand(["rev-parse", "--verify", "--quiet", remoteRefPath], {
272
- cwd,
273
- envOverlay: READ_ONLY_GIT_ENV,
274
- acceptExitCodes: [0, 1],
275
- });
276
- const hasRemote = remoteResult.exitCode === 0;
277
- if (hasRemote) {
286
+ if (await doesGitRefExist(cwd, `refs/remotes/${remoteRef}`)) {
278
287
  return { kind: "remote-only", name: normalized, remoteRef };
279
288
  }
280
289
  return { kind: "not-found" };
@@ -282,6 +291,9 @@ export async function resolveBranchCheckout(cwd, name) {
282
291
  export async function checkoutResolvedBranch(input) {
283
292
  const { cwd, resolution } = input;
284
293
  switch (resolution.kind) {
294
+ case BranchCheckoutKind.Remote:
295
+ await runGitCommand(["checkout", "--detach", resolution.remoteRef], { cwd });
296
+ return { source: "remote" };
285
297
  case "local": {
286
298
  const { stdout } = await runGitCommand(["rev-parse", "--abbrev-ref", "HEAD"], { cwd });
287
299
  const current = stdout.trim();