@agimon-ai/po-git 0.0.0-alpha.26 → 0.0.0-alpha.28
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/README.md +12 -0
- package/dist/extensions/server.cjs +3 -3
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.mjs +2 -2
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +75 -81
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{worktreeOperations-Cd8Q12L4.mjs → worktreeOperations-BqLLypS5.mjs} +49 -4
- package/dist/worktreeOperations-BqLLypS5.mjs.map +1 -0
- package/dist/{worktreeOperations-Dxs3txKL.cjs → worktreeOperations-CU0iV2h-.cjs} +79 -4
- package/dist/worktreeOperations-CU0iV2h-.cjs.map +1 -0
- package/package.json +9 -8
- package/dist/worktreeOperations-Cd8Q12L4.mjs.map +0 -1
- package/dist/worktreeOperations-Dxs3txKL.cjs.map +0 -1
package/dist/extensions/web.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineGlobalStore, defineLeaderBinding, defineRepositorySettingsPanel, defineSessionStore, defineToolRenderer, defineWebLifecycle, defineWebPlugin, sessionApiAddress } from "@agimon-ai/po-core/web";
|
|
2
|
-
import { BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronUpIcon, Dialog, DialogContent, DialogTitle, DiffView, Dot, DropdownMenuItem, EmptyState, Input, MessageIcon, MessageItem, MessageItemBody, ReviewCommentDraft, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, SettingsActions, SettingsCard, SettingsNote, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, ShieldIcon, Spinner, StatusBadge, Tabs, TabsContent, TabsList, TabsTrigger, buildReviewPrompt } from "@agimon-ai/po-web-components";
|
|
2
|
+
import { ArrowRightIcon, BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronUpIcon, Dialog, DialogContent, DialogTitle, DiffView, Dot, DropdownMenuItem, EmptyState, Input, MessageIcon, MessageItem, MessageItemBody, ReviewCommentDraft, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, SettingsActions, SettingsCard, SettingsNote, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, ShieldIcon, Spinner, StatusBadge, Tabs, TabsContent, TabsList, TabsTrigger, buildReviewPrompt } from "@agimon-ai/po-web-components";
|
|
3
3
|
import { createElement, useCallback, useEffect, useId, useRef, useState } from "react";
|
|
4
4
|
import { sealedTransport } from "@agimon-ai/po-web-security/browser";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -2478,8 +2478,10 @@ function GitReviewPanel({ sessionId, sendSessionFrame }) {
|
|
|
2478
2478
|
* The '# git' group's branch row: this session's code change against its base.
|
|
2479
2479
|
*
|
|
2480
2480
|
* DESIGN PATTERNS:
|
|
2481
|
-
* - One lane, branch and `+A -R
|
|
2482
|
-
*
|
|
2481
|
+
* - One lane, branch and `+A -R`, straight on the group body like every other
|
|
2482
|
+
* activity group: the dock already draws the card, so no inner card or heading.
|
|
2483
|
+
* Files, base, upstream and a paused rebase live in the review tab's header,
|
|
2484
|
+
* which this lane opens.
|
|
2483
2485
|
* - Stays clickable at zero, because the review tab is also where pull, push
|
|
2484
2486
|
* and rebase live.
|
|
2485
2487
|
* - Reads the focused session's checkout, whether it is a worktree or not.
|
|
@@ -2501,42 +2503,41 @@ function DiffActivityView({ changes, pending, onReview, branch }) {
|
|
|
2501
2503
|
const zero = changes?.added === 0 && changes?.removed === 0;
|
|
2502
2504
|
const against = changes?.base === void 0 ? "uncommitted" : `vs ${changes.base}`;
|
|
2503
2505
|
return /* @__PURE__ */ jsxs("div", {
|
|
2504
|
-
className: "
|
|
2505
|
-
children: [
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
className: "
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
children:
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
className: "text-sm font-normal text-po-dim",
|
|
2523
|
-
children: zero ? "No changes yet" : "Not reported yet"
|
|
2524
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
2506
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
2507
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
2508
|
+
variant: "ghost",
|
|
2509
|
+
size: "card",
|
|
2510
|
+
"data-testid": "activity-diff-changes",
|
|
2511
|
+
className: "min-w-0 flex-row items-center gap-2 rounded-md px-1 py-1 font-normal hover:bg-po-panel",
|
|
2512
|
+
"aria-label": changes ? `review ${changes.branch ?? "detached HEAD"} changes: ${changes.added} added, ${changes.removed} removed ${against}` : "Changes not reported yet",
|
|
2513
|
+
title: changes ? `${changes.files} ${changes.files === 1 ? "file" : "files"} ${against}` : void 0,
|
|
2514
|
+
onClick: onReview,
|
|
2515
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2516
|
+
className: "min-w-0 flex-1 truncate text-left font-mono text-sm text-po-hi",
|
|
2517
|
+
children: changes?.branch ?? branch ?? "detached HEAD"
|
|
2518
|
+
}), !changes || zero ? /* @__PURE__ */ jsx("span", {
|
|
2519
|
+
className: "shrink-0 text-sm text-po-dim",
|
|
2520
|
+
children: zero ? "No changes yet" : "Not reported yet"
|
|
2521
|
+
}) : /* @__PURE__ */ jsxs("span", {
|
|
2522
|
+
className: "flex shrink-0 gap-2 text-sm",
|
|
2523
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
2525
2524
|
className: "text-po-green",
|
|
2526
2525
|
children: ["+", changes.added]
|
|
2527
2526
|
}), /* @__PURE__ */ jsxs("span", {
|
|
2528
2527
|
className: "text-po-red",
|
|
2529
2528
|
children: ["-", changes.removed]
|
|
2530
|
-
})]
|
|
2531
|
-
})
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2529
|
+
})]
|
|
2530
|
+
})]
|
|
2531
|
+
}), pending && /* @__PURE__ */ jsxs("p", {
|
|
2532
|
+
className: "flex items-center gap-2 px-1 text-sm text-po-dim",
|
|
2533
|
+
children: [/* @__PURE__ */ jsx(Spinner, {
|
|
2534
|
+
className: "size-3",
|
|
2535
|
+
label: pending
|
|
2536
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2537
|
+
className: "inline-block first-letter:uppercase",
|
|
2538
|
+
children: pending
|
|
2539
|
+
})]
|
|
2540
|
+
})]
|
|
2540
2541
|
});
|
|
2541
2542
|
}
|
|
2542
2543
|
//#endregion
|
|
@@ -2544,7 +2545,7 @@ function DiffActivityView({ changes, pending, onReview, branch }) {
|
|
|
2544
2545
|
function WorktreesActivitySection(props) {
|
|
2545
2546
|
const session = useStore(worktreeActivity.store, (state) => worktreeActivity.select(state, props.sessionId));
|
|
2546
2547
|
return /* @__PURE__ */ jsxs("div", {
|
|
2547
|
-
className: "flex min-w-0 flex-col gap-
|
|
2548
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
2548
2549
|
children: [/* @__PURE__ */ jsx(DiffActivitySection, { ...props }), /* @__PURE__ */ jsx(WorktreesActivityView, {
|
|
2549
2550
|
worktrees: session.worktrees.filter((w) => w.sessionId !== props.sessionId),
|
|
2550
2551
|
pending: session.pending,
|
|
@@ -2558,52 +2559,45 @@ function WorktreesActivitySection(props) {
|
|
|
2558
2559
|
}
|
|
2559
2560
|
function WorktreesActivityView({ worktrees, pending, onOpen, onCreate, startingIds = [] }) {
|
|
2560
2561
|
return /* @__PURE__ */ jsxs("div", {
|
|
2561
|
-
className: "
|
|
2562
|
-
children: [
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
className: "
|
|
2569
|
-
children:
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
children:
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
compact: true,
|
|
2601
|
-
worktree: w,
|
|
2602
|
-
starting: startingIds.includes(w.id) || !!pending?.includes("starting") && w.sessionId === null && !w.orphaned && !w.unowned
|
|
2603
|
-
})
|
|
2604
|
-
}, w.id))
|
|
2605
|
-
})
|
|
2606
|
-
]
|
|
2562
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
2563
|
+
children: [pending && /* @__PURE__ */ jsxs("p", {
|
|
2564
|
+
className: "flex items-center gap-2 px-1 text-sm text-po-dim",
|
|
2565
|
+
children: [/* @__PURE__ */ jsx(Spinner, {
|
|
2566
|
+
className: "size-3",
|
|
2567
|
+
label: pending
|
|
2568
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2569
|
+
className: "inline-block first-letter:uppercase",
|
|
2570
|
+
children: pending
|
|
2571
|
+
})]
|
|
2572
|
+
}), worktrees.length === 0 ? onCreate ? /* @__PURE__ */ jsxs(Button, {
|
|
2573
|
+
variant: "link",
|
|
2574
|
+
size: "sm",
|
|
2575
|
+
"data-testid": "activity-git-create",
|
|
2576
|
+
className: "h-auto self-start gap-1 px-1 text-po-green",
|
|
2577
|
+
onClick: onCreate,
|
|
2578
|
+
children: ["Create a worktree", /* @__PURE__ */ jsx(ArrowRightIcon, {
|
|
2579
|
+
"aria-hidden": true,
|
|
2580
|
+
className: "size-3.5"
|
|
2581
|
+
})]
|
|
2582
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
2583
|
+
"data-testid": "activity-summary-git",
|
|
2584
|
+
className: "px-1 text-sm text-po-dim",
|
|
2585
|
+
children: "Idle"
|
|
2586
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
2587
|
+
"data-testid": "activity-git-worktrees",
|
|
2588
|
+
children: worktrees.map((w) => /* @__PURE__ */ jsx(Button, {
|
|
2589
|
+
variant: "ghost",
|
|
2590
|
+
size: "card",
|
|
2591
|
+
className: "block w-full min-w-0 p-0 text-left font-normal",
|
|
2592
|
+
"data-testid": `activity-git-worktree-${w.id}`,
|
|
2593
|
+
onClick: onOpen,
|
|
2594
|
+
children: /* @__PURE__ */ jsx(WorktreeRow, {
|
|
2595
|
+
compact: true,
|
|
2596
|
+
worktree: w,
|
|
2597
|
+
starting: startingIds.includes(w.id) || !!pending?.includes("starting") && w.sessionId === null && !w.orphaned && !w.unowned
|
|
2598
|
+
})
|
|
2599
|
+
}, w.id))
|
|
2600
|
+
})]
|
|
2607
2601
|
});
|
|
2608
2602
|
}
|
|
2609
2603
|
//#endregion
|