@agents-inc/cli 0.74.10 → 0.74.12
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/CHANGELOG.md +25 -0
- package/README.md +11 -5
- package/dist/{chunk-FW5C245M.js → chunk-2DKJM7RO.js} +6 -24
- package/dist/chunk-2DKJM7RO.js.map +1 -0
- package/dist/{chunk-NA6I5P5P.js → chunk-2PZ7LBFT.js} +1 -3
- package/dist/chunk-2PZ7LBFT.js.map +1 -0
- package/dist/{chunk-VILTRTBT.js → chunk-2YFC7IJ6.js} +4 -4
- package/dist/chunk-2YFC7IJ6.js.map +1 -0
- package/dist/{chunk-OV5UJWS5.js → chunk-62FBXUNR.js} +2 -2
- package/dist/{chunk-VYHRCFMD.js → chunk-6RGNXTTG.js} +5 -5
- package/dist/{chunk-2EXAK22V.js → chunk-6W4H2K3Z.js} +86 -55
- package/dist/chunk-6W4H2K3Z.js.map +1 -0
- package/dist/chunk-7M4INWUR.js +31 -0
- package/dist/chunk-7M4INWUR.js.map +1 -0
- package/dist/{chunk-EWKUUWYY.js → chunk-AKW425U6.js} +2 -2
- package/dist/{chunk-54AECXSH.js → chunk-ARGCINJC.js} +2 -2
- package/dist/{chunk-YZUAXX7F.js → chunk-DG2T7KYG.js} +3 -6
- package/dist/chunk-DG2T7KYG.js.map +1 -0
- package/dist/{chunk-M5IAGR5Z.js → chunk-DZUZVT5X.js} +3 -3
- package/dist/{chunk-PUZLP4SL.js → chunk-EWGFIBBU.js} +2 -2
- package/dist/{chunk-C6YLN4AW.js → chunk-GJWHA6P4.js} +18 -58
- package/dist/chunk-GJWHA6P4.js.map +1 -0
- package/dist/{chunk-PN65K3LH.js → chunk-I7WXUAWA.js} +2 -2
- package/dist/{chunk-YDBVG6RF.js → chunk-JBQRRJRY.js} +11 -21
- package/dist/chunk-JBQRRJRY.js.map +1 -0
- package/dist/{chunk-NDKIFVR4.js → chunk-MZQKSK3J.js} +3 -3
- package/dist/{chunk-IYA5PSXU.js → chunk-NO2XIAJC.js} +3 -3
- package/dist/{chunk-OINQ6OWM.js → chunk-NPMGVQM4.js} +2 -2
- package/dist/{chunk-GG4BSB6S.js → chunk-P2FHS5IS.js} +2 -3
- package/dist/{chunk-GG4BSB6S.js.map → chunk-P2FHS5IS.js.map} +1 -1
- package/dist/{chunk-X6LXHVA6.js → chunk-PJUC2WCA.js} +26 -21
- package/dist/chunk-PJUC2WCA.js.map +1 -0
- package/dist/{chunk-TPXDHJDB.js → chunk-TDHEAHXD.js} +2 -2
- package/dist/{chunk-XPRDNALD.js → chunk-W6NWOYMS.js} +2 -2
- package/dist/{chunk-VIVOJASC.js → chunk-YUSLPHXO.js} +5 -5
- package/dist/commands/build/plugins.js +2 -2
- package/dist/commands/build/stack.js +2 -2
- package/dist/commands/compile.js +2 -2
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/path.js +1 -1
- package/dist/commands/config/show.js +2 -2
- package/dist/commands/diff.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/edit.js +23 -28
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +1 -1
- package/dist/commands/import/skill.js +1 -1
- package/dist/commands/info.js +1 -1
- package/dist/commands/init.js +19 -19
- package/dist/commands/list.js +1 -1
- package/dist/commands/new/agent.js +2 -2
- package/dist/commands/new/marketplace.js +2 -2
- package/dist/commands/new/skill.js +2 -2
- package/dist/commands/outdated.js +1 -1
- package/dist/commands/search.js +1 -1
- package/dist/commands/uninstall.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/commands/validate.js +1 -1
- package/dist/components/wizard/category-grid.js +2 -2
- package/dist/components/wizard/category-grid.test.js +78 -77
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/checkbox-grid.js +2 -2
- package/dist/components/wizard/checkbox-grid.test.js +2 -2
- package/dist/components/wizard/domain-selection.js +5 -5
- package/dist/components/wizard/help-modal.js +1 -1
- package/dist/components/wizard/source-grid.js +2 -2
- package/dist/components/wizard/source-grid.test.js +5 -5
- package/dist/components/wizard/source-grid.test.js.map +1 -1
- package/dist/components/wizard/stack-selection.js +3 -3
- package/dist/components/wizard/step-agents.js +4 -4
- package/dist/components/wizard/step-agents.test.js +4 -4
- package/dist/components/wizard/step-build.js +6 -6
- package/dist/components/wizard/step-build.test.js +16 -18
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +2 -2
- package/dist/components/wizard/step-confirm.test.js +4 -4
- package/dist/components/wizard/step-refine.js +2 -2
- package/dist/components/wizard/step-refine.test.js +2 -2
- package/dist/components/wizard/step-settings.js +3 -3
- package/dist/components/wizard/step-settings.test.js +6 -6
- package/dist/components/wizard/step-sources.js +6 -6
- package/dist/components/wizard/step-sources.test.js +6 -6
- package/dist/components/wizard/step-stack.js +7 -7
- package/dist/components/wizard/step-stack.test.js +12 -12
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/view-title.js +1 -1
- package/dist/components/wizard/wizard-layout.js +4 -4
- package/dist/components/wizard/wizard.js +18 -18
- package/dist/hooks/init.js +19 -19
- package/dist/{source-loader-WBDPZJEW.js → source-loader-42GVUFZA.js} +2 -4
- package/dist/{source-manager-RRGK4SBP.js → source-manager-WRZBOTEH.js} +2 -2
- package/dist/stores/wizard-store.js +2 -2
- package/dist/stores/wizard-store.test.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2EXAK22V.js.map +0 -1
- package/dist/chunk-AQYAVLZK.js +0 -20
- package/dist/chunk-AQYAVLZK.js.map +0 -1
- package/dist/chunk-C6YLN4AW.js.map +0 -1
- package/dist/chunk-FW5C245M.js.map +0 -1
- package/dist/chunk-NA6I5P5P.js.map +0 -1
- package/dist/chunk-VILTRTBT.js.map +0 -1
- package/dist/chunk-X6LXHVA6.js.map +0 -1
- package/dist/chunk-YDBVG6RF.js.map +0 -1
- package/dist/chunk-YZUAXX7F.js.map +0 -1
- package/dist/plugins/dummy-skill/.claude-plugin/.content-hash +0 -1
- package/dist/plugins/dummy-skill/.claude-plugin/plugin.json +0 -13
- /package/dist/{chunk-OV5UJWS5.js.map → chunk-62FBXUNR.js.map} +0 -0
- /package/dist/{chunk-VYHRCFMD.js.map → chunk-6RGNXTTG.js.map} +0 -0
- /package/dist/{chunk-EWKUUWYY.js.map → chunk-AKW425U6.js.map} +0 -0
- /package/dist/{chunk-54AECXSH.js.map → chunk-ARGCINJC.js.map} +0 -0
- /package/dist/{chunk-M5IAGR5Z.js.map → chunk-DZUZVT5X.js.map} +0 -0
- /package/dist/{chunk-PUZLP4SL.js.map → chunk-EWGFIBBU.js.map} +0 -0
- /package/dist/{chunk-PN65K3LH.js.map → chunk-I7WXUAWA.js.map} +0 -0
- /package/dist/{chunk-NDKIFVR4.js.map → chunk-MZQKSK3J.js.map} +0 -0
- /package/dist/{chunk-IYA5PSXU.js.map → chunk-NO2XIAJC.js.map} +0 -0
- /package/dist/{chunk-OINQ6OWM.js.map → chunk-NPMGVQM4.js.map} +0 -0
- /package/dist/{chunk-TPXDHJDB.js.map → chunk-TDHEAHXD.js.map} +0 -0
- /package/dist/{chunk-XPRDNALD.js.map → chunk-W6NWOYMS.js.map} +0 -0
- /package/dist/{chunk-VIVOJASC.js.map → chunk-YUSLPHXO.js.map} +0 -0
- /package/dist/{source-loader-WBDPZJEW.js.map → source-loader-42GVUFZA.js.map} +0 -0
- /package/dist/{source-manager-RRGK4SBP.js.map → source-manager-WRZBOTEH.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/hooks/use-focused-list-item.ts"],"sourcesContent":["import { useState, useCallback, useRef } from \"react\";\n\ntype Direction = \"up\" | \"down\" | \"left\" | \"right\";\n\ntype UseFocusedListItemOptions = {\n /** Wrap around when reaching boundaries (default: true) */\n wrap?: boolean;\n /** Returns true if a row should be skipped during vertical navigation */\n isRowLocked?: (row: number) => boolean;\n /** Custom column finder for skipping disabled items on horizontal nav.\n * Receives the row, current column, and direction (+1 right, -1 left).\n * Should return the next valid column index. */\n findValidCol?: (row: number, currentCol: number, direction: 1 | -1) => number;\n /** Called after vertical navigation to adjust the clamped column\n * (e.g. to skip disabled items). Returns the adjusted column index. */\n adjustCol?: (row: number, clampedCol: number) => number;\n /** Called whenever focused position changes */\n onChange?: (row: number, col: number) => void;\n /** Initial row index (default: 0) */\n initialRow?: number;\n /** Initial col index (default: 0) */\n initialCol?: number;\n};\n\ntype UseFocusedListItemResult = {\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: Direction) => void;\n};\n\n/**\n * 2D grid focus management: tracks (row, col) position and handles\n * directional movement with wrapping, column clamping, row locking,\n * and optional disabled-column skipping.\n */\nexport function useFocusedListItem(\n rowCount: number,\n getColCount: (row: number) => number,\n options: UseFocusedListItemOptions = {},\n): UseFocusedListItemResult {\n const {\n wrap = true,\n isRowLocked,\n findValidCol,\n adjustCol,\n onChange,\n initialRow = 0,\n initialCol = 0,\n } = options;\n\n const [focusedRow, setFocusedRow] = useState(initialRow);\n const [focusedCol, setFocusedCol] = useState(initialCol);\n\n // Refs for stable callback access without stale closures.\n // Synced during render (not via useEffect) to prevent a timing gap where\n // the ref holds stale values when an input event arrives between render\n // and effect execution (e.g. after a domain-switch remount).\n const focusedRowRef = useRef(focusedRow);\n focusedRowRef.current = focusedRow;\n\n const focusedColRef = useRef(focusedCol);\n focusedColRef.current = focusedCol;\n\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const applyFocus = useCallback((row: number, col: number) => {\n setFocusedRow(row);\n setFocusedCol(col);\n onChangeRef.current?.(row, col);\n }, []);\n\n const setFocused = applyFocus;\n\n const findNextUnlockedRow = useCallback(\n (fromRow: number, direction: 1 | -1): number => {\n if (!isRowLocked || rowCount === 0) {\n if (wrap) {\n return (fromRow + direction + rowCount) % rowCount;\n }\n const next = fromRow + direction;\n return Math.max(0, Math.min(rowCount - 1, next));\n }\n\n let index = fromRow;\n let attempts = 0;\n\n while (attempts < rowCount) {\n index += direction;\n\n if (wrap) {\n if (index < 0) index = rowCount - 1;\n if (index >= rowCount) index = 0;\n } else {\n if (index < 0) index = 0;\n if (index >= rowCount) index = rowCount - 1;\n }\n\n if (!isRowLocked(index)) {\n return index;\n }\n\n attempts++;\n }\n\n return fromRow;\n },\n [rowCount, wrap, isRowLocked],\n );\n\n const moveFocus = useCallback(\n (direction: Direction) => {\n const currentRow = focusedRowRef.current;\n const currentCol = focusedColRef.current;\n\n if (direction === \"left\" || direction === \"right\") {\n const colCount = getColCount(currentRow);\n if (colCount === 0) return;\n\n const step = direction === \"right\" ? 1 : -1;\n\n if (findValidCol) {\n const newCol = findValidCol(currentRow, currentCol, step);\n applyFocus(currentRow, newCol);\n } else if (wrap) {\n const newCol = (currentCol + step + colCount) % colCount;\n applyFocus(currentRow, newCol);\n } else {\n const newCol = Math.max(0, Math.min(colCount - 1, currentCol + step));\n applyFocus(currentRow, newCol);\n }\n } else {\n const step = direction === \"down\" ? 1 : -1;\n const newRow = findNextUnlockedRow(currentRow, step);\n
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/hooks/use-focused-list-item.ts"],"sourcesContent":["import { useState, useCallback, useRef } from \"react\";\n\ntype Direction = \"up\" | \"down\" | \"left\" | \"right\";\n\ntype UseFocusedListItemOptions = {\n /** Wrap around when reaching boundaries (default: true) */\n wrap?: boolean;\n /** Returns true if a row should be skipped during vertical navigation */\n isRowLocked?: (row: number) => boolean;\n /** Custom column finder for skipping disabled items on horizontal nav.\n * Receives the row, current column, and direction (+1 right, -1 left).\n * Should return the next valid column index. */\n findValidCol?: (row: number, currentCol: number, direction: 1 | -1) => number;\n /** Called after vertical navigation to adjust the clamped column\n * (e.g. to skip disabled items). Returns the adjusted column index. */\n adjustCol?: (row: number, clampedCol: number) => number;\n /** Called whenever focused position changes */\n onChange?: (row: number, col: number) => void;\n /** Initial row index (default: 0) */\n initialRow?: number;\n /** Initial col index (default: 0) */\n initialCol?: number;\n};\n\ntype UseFocusedListItemResult = {\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: Direction) => void;\n};\n\n/**\n * 2D grid focus management: tracks (row, col) position and handles\n * directional movement with wrapping, column clamping, row locking,\n * and optional disabled-column skipping.\n */\nexport function useFocusedListItem(\n rowCount: number,\n getColCount: (row: number) => number,\n options: UseFocusedListItemOptions = {},\n): UseFocusedListItemResult {\n const {\n wrap = true,\n isRowLocked,\n findValidCol,\n adjustCol,\n onChange,\n initialRow = 0,\n initialCol = 0,\n } = options;\n\n const [focusedRow, setFocusedRow] = useState(initialRow);\n const [focusedCol, setFocusedCol] = useState(initialCol);\n\n // Refs for stable callback access without stale closures.\n // Synced during render (not via useEffect) to prevent a timing gap where\n // the ref holds stale values when an input event arrives between render\n // and effect execution (e.g. after a domain-switch remount).\n const focusedRowRef = useRef(focusedRow);\n focusedRowRef.current = focusedRow;\n\n const focusedColRef = useRef(focusedCol);\n focusedColRef.current = focusedCol;\n\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const applyFocus = useCallback((row: number, col: number) => {\n setFocusedRow(row);\n setFocusedCol(col);\n onChangeRef.current?.(row, col);\n }, []);\n\n const setFocused = applyFocus;\n\n const findNextUnlockedRow = useCallback(\n (fromRow: number, direction: 1 | -1): number => {\n if (!isRowLocked || rowCount === 0) {\n if (wrap) {\n return (fromRow + direction + rowCount) % rowCount;\n }\n const next = fromRow + direction;\n return Math.max(0, Math.min(rowCount - 1, next));\n }\n\n let index = fromRow;\n let attempts = 0;\n\n while (attempts < rowCount) {\n index += direction;\n\n if (wrap) {\n if (index < 0) index = rowCount - 1;\n if (index >= rowCount) index = 0;\n } else {\n if (index < 0) index = 0;\n if (index >= rowCount) index = rowCount - 1;\n }\n\n if (!isRowLocked(index)) {\n return index;\n }\n\n attempts++;\n }\n\n return fromRow;\n },\n [rowCount, wrap, isRowLocked],\n );\n\n const moveFocus = useCallback(\n (direction: Direction) => {\n const currentRow = focusedRowRef.current;\n const currentCol = focusedColRef.current;\n\n if (direction === \"left\" || direction === \"right\") {\n const colCount = getColCount(currentRow);\n if (colCount === 0) return;\n\n const step = direction === \"right\" ? 1 : -1;\n\n if (findValidCol) {\n const newCol = findValidCol(currentRow, currentCol, step);\n applyFocus(currentRow, newCol);\n } else if (wrap) {\n const newCol = (currentCol + step + colCount) % colCount;\n applyFocus(currentRow, newCol);\n } else {\n const newCol = Math.max(0, Math.min(colCount - 1, currentCol + step));\n applyFocus(currentRow, newCol);\n }\n } else {\n const step = direction === \"down\" ? 1 : -1;\n const newRow = findNextUnlockedRow(currentRow, step);\n let finalCol = 0;\n\n if (adjustCol) {\n finalCol = adjustCol(newRow, finalCol);\n }\n\n applyFocus(newRow, finalCol);\n }\n },\n [getColCount, wrap, findValidCol, adjustCol, findNextUnlockedRow, applyFocus],\n );\n\n return { focusedRow, focusedCol, setFocused, moveFocus };\n}\n"],"mappings":";;;;;;AAAA;AAAA,SAAS,UAAU,aAAa,cAAc;AAoCvC,SAAS,mBACd,UACA,aACA,UAAqC,CAAC,GACZ;AAC1B,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,EACf,IAAI;AAEJ,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,UAAU;AACvD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,UAAU;AAMvD,QAAM,gBAAgB,OAAO,UAAU;AACvC,gBAAc,UAAU;AAExB,QAAM,gBAAgB,OAAO,UAAU;AACvC,gBAAc,UAAU;AAExB,QAAM,cAAc,OAAO,QAAQ;AACnC,cAAY,UAAU;AAEtB,QAAM,aAAa,YAAY,CAAC,KAAa,QAAgB;AAC3D,kBAAc,GAAG;AACjB,kBAAc,GAAG;AACjB,gBAAY,UAAU,KAAK,GAAG;AAAA,EAChC,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa;AAEnB,QAAM,sBAAsB;AAAA,I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AAS,oBAAoB,YAAY,IAAI;AACnD,YAAI,WAAW;AAEf,YAAI,WAAW;AACb,qBAAW,UAAU,QAAQ,QAAQ;AAAA,QACvC;AAEA,mBAAW,QAAQ,QAAQ;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,CAAC,aAAa,MAAM,cAAc,WAAW,qBAAqB,UAAU;AAAA,EAC9E;AAEA,SAAO,EAAE,YAAY,YAAY,YAAY,UAAU;AACzD;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
useFocusedListItem
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-P2FHS5IS.js";
|
|
5
5
|
import {
|
|
6
6
|
useSectionScroll
|
|
7
7
|
} from "./chunk-AUNBGZS4.js";
|
|
@@ -152,30 +152,34 @@ var findNextValidOption = (options, currentIndex, direction, wrap = true) => {
|
|
|
152
152
|
}
|
|
153
153
|
return index;
|
|
154
154
|
};
|
|
155
|
-
var getCompatibilityLabel = (option
|
|
156
|
-
if (option.selected
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (option.
|
|
155
|
+
var getCompatibilityLabel = (option) => {
|
|
156
|
+
if (option.selected && option.hasUnmetRequirements && option.unmetRequirementsReason) {
|
|
157
|
+
return `(${option.unmetRequirementsReason})`;
|
|
158
|
+
}
|
|
159
|
+
if (option.selected) return null;
|
|
160
|
+
if (option.state.status === "incompatible") return "(incompatible)";
|
|
161
|
+
if (option.state.status === "recommended") return "(recommended)";
|
|
162
|
+
if (option.state.status === "discouraged") return "(discouraged)";
|
|
160
163
|
return null;
|
|
161
164
|
};
|
|
162
165
|
var SkillTag = ({ option, isFocused, isLocked, showLabels }) => {
|
|
163
166
|
const getTextColor = () => {
|
|
164
|
-
if (isLocked) return CLI_COLORS.NEUTRAL;
|
|
165
167
|
if (option.selected) return CLI_COLORS.PRIMARY;
|
|
166
|
-
if (option.state === "
|
|
167
|
-
if (option.state === "
|
|
168
|
+
if (option.state.status === "incompatible") return CLI_COLORS.ERROR;
|
|
169
|
+
if (option.state.status === "recommended") return CLI_COLORS.UNFOCUSED;
|
|
170
|
+
if (option.state.status === "discouraged") return CLI_COLORS.WARNING;
|
|
168
171
|
return CLI_COLORS.NEUTRAL;
|
|
169
172
|
};
|
|
170
173
|
const getStateBorderColor = () => {
|
|
171
|
-
if (isLocked) return CLI_COLORS.NEUTRAL;
|
|
172
174
|
if (option.selected) return CLI_COLORS.PRIMARY;
|
|
173
|
-
if (option.state === "
|
|
174
|
-
if (option.state === "
|
|
175
|
+
if (option.state.status === "incompatible") return CLI_COLORS.ERROR;
|
|
176
|
+
if (option.state.status === "recommended") return CLI_COLORS.UNFOCUSED;
|
|
177
|
+
if (option.state.status === "discouraged") return CLI_COLORS.WARNING;
|
|
175
178
|
return CLI_COLORS.UNFOCUSED;
|
|
176
179
|
};
|
|
177
180
|
const textColor = getTextColor();
|
|
178
|
-
const
|
|
181
|
+
const hasUnmetDeps = option.selected && !!option.hasUnmetRequirements;
|
|
182
|
+
const compatibilityLabel = hasUnmetDeps ? getCompatibilityLabel(option) : showLabels && isFocused ? getCompatibilityLabel(option) : null;
|
|
179
183
|
return /* @__PURE__ */ jsx(
|
|
180
184
|
Box,
|
|
181
185
|
{
|
|
@@ -184,7 +188,7 @@ var SkillTag = ({ option, isFocused, isLocked, showLabels }) => {
|
|
|
184
188
|
borderStyle: "single",
|
|
185
189
|
flexShrink: 0,
|
|
186
190
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
187
|
-
/* @__PURE__ */ jsxs(Text, { color: textColor, bold: true, children: [
|
|
191
|
+
/* @__PURE__ */ jsxs(Text, { color: textColor, bold: true, dimColor: option.selected && !!option.hasUnmetRequirements, children: [
|
|
188
192
|
" ",
|
|
189
193
|
getSkillById(option.id).displayName,
|
|
190
194
|
" "
|
|
@@ -208,11 +212,11 @@ var CategorySection = ({
|
|
|
208
212
|
showLabels
|
|
209
213
|
}) => {
|
|
210
214
|
const selectedCount = options.filter((o) => o.selected).length;
|
|
211
|
-
const selectionCounter = category.exclusive ? `(${selectedCount} of 1)` :
|
|
215
|
+
const selectionCounter = category.exclusive ? `(${selectedCount} of 1)` : null;
|
|
212
216
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: isFirst ? 0 : 1, children: [
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */ jsx(Text, {
|
|
215
|
-
category.required && /* @__PURE__ */ jsxs(Text, { color:
|
|
217
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "row", children: isFocused ? /* @__PURE__ */ jsx(Text, { color: "#000", backgroundColor: CLI_COLORS.WHITE, children: ` ${category.displayName}${category.required ? ` ${SYMBOL_REQUIRED}` : ""}${selectionCounter ? ` ${selectionCounter}` : ""} ` }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
218
|
+
/* @__PURE__ */ jsx(Text, { color: "gray", children: category.displayName }),
|
|
219
|
+
category.required && /* @__PURE__ */ jsxs(Text, { color: CLI_COLORS.ERROR, children: [
|
|
216
220
|
" ",
|
|
217
221
|
SYMBOL_REQUIRED
|
|
218
222
|
] }),
|
|
@@ -220,7 +224,7 @@ var CategorySection = ({
|
|
|
220
224
|
" ",
|
|
221
225
|
selectionCounter
|
|
222
226
|
] })
|
|
223
|
-
] }),
|
|
227
|
+
] }) }),
|
|
224
228
|
/* @__PURE__ */ jsx(Box, { flexDirection: "row", flexWrap: "wrap", marginTop: 0, children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
225
229
|
SkillTag,
|
|
226
230
|
{
|
|
@@ -270,11 +274,12 @@ var CategoryGrid = ({
|
|
|
270
274
|
);
|
|
271
275
|
const handleFocusChange = useCallback2(
|
|
272
276
|
(row, col) => {
|
|
277
|
+
if (showLabels) onToggleLabels();
|
|
273
278
|
onFocusChange?.(row, col);
|
|
274
279
|
const skill = processedCategories[row]?.sortedOptions[col];
|
|
275
280
|
onFocusedSkillChange?.(skill?.id ?? null);
|
|
276
281
|
},
|
|
277
|
-
[onFocusChange, processedCategories, onFocusedSkillChange]
|
|
282
|
+
[showLabels, onToggleLabels, onFocusChange, processedCategories, onFocusedSkillChange]
|
|
278
283
|
);
|
|
279
284
|
const { focusedRow, focusedCol, setFocused, moveFocus } = useFocusedListItem(
|
|
280
285
|
processedCategories.length,
|
|
@@ -341,4 +346,4 @@ var CategoryGrid = ({
|
|
|
341
346
|
export {
|
|
342
347
|
CategoryGrid
|
|
343
348
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
349
|
+
//# sourceMappingURL=chunk-PJUC2WCA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/category-grid.tsx","../src/cli/components/hooks/use-category-grid-input.ts"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\n\nimport { Box, Text } from \"ink\";\n\nimport { CLI_COLORS } from \"../../consts.js\";\nimport { getSkillById } from \"../../lib/matrix/matrix-provider.js\";\nimport type { Category, OptionState, SkillId } from \"../../types/index.js\";\nimport { isSectionLocked, useCategoryGridInput } from \"../hooks/use-category-grid-input.js\";\nimport { useFocusedListItem } from \"../hooks/use-focused-list-item.js\";\nimport { useSectionScroll } from \"../hooks/use-section-scroll.js\";\n\nexport type CategoryOption = {\n id: SkillId;\n state: OptionState;\n selected: boolean;\n local?: boolean;\n installed?: boolean;\n scope?: \"project\" | \"global\";\n /** True when selected but has unmet dependency requirements (shown dimmed) */\n hasUnmetRequirements?: boolean;\n /** Explains unmet requirements (shown in label when D pressed) */\n unmetRequirementsReason?: string;\n};\n\nexport type CategoryRow = {\n id: Category;\n displayName: string;\n required: boolean;\n exclusive: boolean;\n options: CategoryOption[];\n};\n\nexport type CategoryGridProps = {\n categories: CategoryRow[];\n /** Available height in terminal lines for the scrollable viewport. 0 = no constraint. */\n availableHeight?: number;\n showLabels: boolean;\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n /** Optional initial focus row (default: 0). Use with React `key` to reset. */\n defaultFocusedRow?: number;\n /** Optional initial focus col (default: 0). Use with React `key` to reset. */\n defaultFocusedCol?: number;\n /** Optional callback fired whenever the focused position changes */\n onFocusChange?: (row: number, col: number) => void;\n /** Optional callback fired with the resolved SkillId of the focused cell */\n onFocusedSkillChange?: (skillId: SkillId | null) => void;\n};\n\nconst SYMBOL_REQUIRED = \"*\";\n\nconst findNextValidOption = (\n options: CategoryOption[],\n currentIndex: number,\n direction: 1 | -1,\n wrap = true,\n): number => {\n const length = options.length;\n if (length === 0) return currentIndex;\n\n let index = currentIndex + direction;\n\n if (wrap) {\n if (index < 0) index = length - 1;\n if (index >= length) index = 0;\n } else {\n if (index < 0) index = 0;\n if (index >= length) index = length - 1;\n }\n\n return index;\n};\n\ntype SkillTagProps = {\n option: CategoryOption;\n isFocused: boolean;\n isLocked: boolean;\n showLabels: boolean;\n};\n\nconst getCompatibilityLabel = (option: CategoryOption): string | null => {\n if (option.selected && option.hasUnmetRequirements && option.unmetRequirementsReason) {\n return `(${option.unmetRequirementsReason})`;\n }\n if (option.selected) return null;\n if (option.state.status === \"incompatible\") return \"(incompatible)\";\n if (option.state.status === \"recommended\") return \"(recommended)\";\n if (option.state.status === \"discouraged\") return \"(discouraged)\";\n return null;\n};\n\nconst SkillTag: React.FC<SkillTagProps> = ({ option, isFocused, isLocked, showLabels }) => {\n const getTextColor = (): string => {\n if (option.selected) return CLI_COLORS.PRIMARY;\n if (option.state.status === \"incompatible\") return CLI_COLORS.ERROR;\n if (option.state.status === \"recommended\") return CLI_COLORS.UNFOCUSED;\n if (option.state.status === \"discouraged\") return CLI_COLORS.WARNING;\n\n return CLI_COLORS.NEUTRAL;\n };\n\n const getStateBorderColor = (): string => {\n if (option.selected) return CLI_COLORS.PRIMARY;\n if (option.state.status === \"incompatible\") return CLI_COLORS.ERROR;\n if (option.state.status === \"recommended\") return CLI_COLORS.UNFOCUSED;\n if (option.state.status === \"discouraged\") return CLI_COLORS.WARNING;\n return CLI_COLORS.UNFOCUSED;\n };\n\n const textColor = getTextColor();\n const hasUnmetDeps = option.selected && !!option.hasUnmetRequirements;\n const compatibilityLabel = hasUnmetDeps\n ? getCompatibilityLabel(option)\n : showLabels && isFocused\n ? getCompatibilityLabel(option)\n : null;\n\n return (\n <Box\n marginRight={1}\n borderColor={isFocused ? getStateBorderColor() : CLI_COLORS.NEUTRAL}\n borderStyle=\"single\"\n flexShrink={0}\n >\n <>\n <Text color={textColor} bold dimColor={option.selected && !!option.hasUnmetRequirements}>\n {\" \"}\n {getSkillById(option.id).displayName}{\" \"}\n </Text>\n {option.scope && <Text dimColor>{option.scope === \"global\" ? \"G \" : \"P \"}</Text>}\n {compatibilityLabel && <Text dimColor>{compatibilityLabel} </Text>}\n </>\n </Box>\n );\n};\n\ntype CategorySectionProps = {\n isFirst: boolean;\n category: CategoryRow;\n options: CategoryOption[];\n isLocked: boolean;\n isFocused: boolean;\n focusedOptionIndex: number;\n showLabels: boolean;\n};\n\nconst CategorySection: React.FC<CategorySectionProps> = ({\n isFirst,\n category,\n options,\n isLocked,\n isFocused,\n focusedOptionIndex,\n showLabels,\n}) => {\n const selectedCount = options.filter((o) => o.selected).length;\n\n const selectionCounter = category.exclusive ? `(${selectedCount} of 1)` : null;\n\n return (\n <Box flexDirection=\"column\" marginTop={isFirst ? 0 : 1}>\n <Box flexDirection=\"row\">\n {isFocused ? (\n <Text color=\"#000\" backgroundColor={CLI_COLORS.WHITE}>\n {` ${category.displayName}${category.required ? ` ${SYMBOL_REQUIRED}` : \"\"}${selectionCounter ? ` ${selectionCounter}` : \"\"} `}\n </Text>\n ) : (\n <>\n <Text color=\"gray\">{category.displayName}</Text>\n {category.required && <Text color={CLI_COLORS.ERROR}> {SYMBOL_REQUIRED}</Text>}\n {selectionCounter && <Text dimColor> {selectionCounter}</Text>}\n </>\n )}\n </Box>\n\n <Box flexDirection=\"row\" flexWrap=\"wrap\" marginTop={0}>\n {options.map((option, index) => (\n <SkillTag\n key={option.id}\n option={option}\n isFocused={isFocused && index === focusedOptionIndex && !isLocked}\n isLocked={isLocked}\n showLabels={showLabels}\n />\n ))}\n </Box>\n </Box>\n );\n};\n\ntype ProcessedCategory = CategoryRow & { sortedOptions: CategoryOption[] };\n\nexport const CategoryGrid: React.FC<CategoryGridProps> = ({\n categories,\n availableHeight = 0,\n showLabels,\n onToggle,\n onToggleLabels,\n defaultFocusedRow = 0,\n defaultFocusedCol = 0,\n onFocusChange,\n onFocusedSkillChange,\n}) => {\n const processedCategories = useMemo(\n () => categories.map((category) => ({ ...category, sortedOptions: category.options })),\n [categories],\n );\n\n const getColCount = useCallback(\n (row: number): number => processedCategories[row]?.sortedOptions.length ?? 0,\n [processedCategories],\n );\n\n const isRowLocked = useCallback(\n (row: number): boolean => {\n const cat = processedCategories[row];\n return cat ? isSectionLocked(cat.id, categories) : false;\n },\n [processedCategories, categories],\n );\n\n const findValidCol = useCallback(\n (row: number, currentCol: number, direction: 1 | -1): number => {\n const options = processedCategories[row]?.sortedOptions || [];\n const catId = processedCategories[row]?.id;\n if (catId && isSectionLocked(catId, categories)) return currentCol;\n return findNextValidOption(options, currentCol, direction, true);\n },\n [processedCategories, categories],\n );\n\n const handleFocusChange = useCallback(\n (row: number, col: number) => {\n if (showLabels) onToggleLabels();\n onFocusChange?.(row, col);\n const skill = processedCategories[row]?.sortedOptions[col];\n onFocusedSkillChange?.(skill?.id ?? null);\n },\n [showLabels, onToggleLabels, onFocusChange, processedCategories, onFocusedSkillChange],\n );\n\n const { focusedRow, focusedCol, setFocused, moveFocus } = useFocusedListItem(\n processedCategories.length,\n getColCount,\n {\n wrap: true,\n isRowLocked,\n findValidCol,\n onChange: handleFocusChange,\n initialRow: defaultFocusedRow,\n initialCol: defaultFocusedCol,\n },\n );\n\n const mountedRef = useRef(false);\n if (!mountedRef.current) {\n mountedRef.current = true;\n const skill = processedCategories[defaultFocusedRow]?.sortedOptions[defaultFocusedCol];\n onFocusedSkillChange?.(skill?.id ?? null);\n }\n\n useCategoryGridInput({\n processedCategories,\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n });\n\n const { setSectionRef, scrollEnabled, scrollTopPx } = useSectionScroll({\n sectionCount: processedCategories.length,\n focusedIndex: focusedRow,\n availableHeight,\n });\n\n if (categories.length === 0) {\n return (\n <Box flexDirection=\"column\">\n <Text dimColor>No categories to display.</Text>\n </Box>\n );\n }\n\n const noShrink = scrollEnabled ? { flexShrink: 0 } : {};\n\n const sectionElements = processedCategories.map((category, index) => {\n const isLocked = isSectionLocked(category.id, categories);\n\n return (\n <Box key={category.id} ref={(el) => setSectionRef(index, el)} {...noShrink}>\n <CategorySection\n category={category}\n options={category.sortedOptions}\n isLocked={isLocked}\n isFocused={index === focusedRow}\n focusedOptionIndex={focusedCol}\n showLabels={showLabels}\n isFirst={index === 0}\n />\n </Box>\n );\n });\n\n return (\n <Box\n flexDirection=\"column\"\n {...(scrollEnabled\n ? { height: availableHeight, overflow: \"hidden\" as const }\n : { flexGrow: 1 })}\n >\n <Box flexDirection=\"column\" marginTop={scrollTopPx > 0 ? -scrollTopPx : 0} {...noShrink}>\n {sectionElements}\n </Box>\n </Box>\n );\n};\n","import { useCallback, useEffect, useRef } from \"react\";\nimport { useInput } from \"ink\";\n\nimport type { Category, SkillId } from \"../../types/index.js\";\nimport type { CategoryOption, CategoryRow } from \"../wizard/category-grid.js\";\nimport { HOTKEY_TOGGLE_LABELS, isHotkey } from \"../wizard/hotkeys.js\";\n\nconst FRAMEWORK_CATEGORY_ID = \"web-framework\";\n\n// Locked = non-framework section when no framework is selected\nexport const isSectionLocked = (categoryId: Category, categories: CategoryRow[]): boolean => {\n if (categoryId === FRAMEWORK_CATEGORY_ID) {\n return false;\n }\n\n const frameworkCategory = categories.find((cat) => cat.id === FRAMEWORK_CATEGORY_ID);\n if (!frameworkCategory) return false;\n\n return !frameworkCategory.options.some((opt) => opt.selected);\n};\n\nexport const findValidStartColumn = (_options: CategoryOption[]): number => {\n return 0;\n};\n\n/** Find next unlocked section index (wrapping, direction: forward) */\nexport const findNextUnlockedIndex = (\n processed: { id: Category; sortedOptions: CategoryOption[] }[],\n currentIndex: number,\n allCategories: CategoryRow[],\n): number => {\n const length = processed.length;\n if (length === 0) return currentIndex;\n\n let index = currentIndex;\n let attempts = 0;\n\n while (attempts < length) {\n index += 1;\n if (index >= length) index = 0;\n\n const category = processed[index];\n if (category && !isSectionLocked(category.id, allCategories)) {\n return index;\n }\n\n attempts++;\n }\n\n return currentIndex;\n};\n\ntype ProcessedCategory = CategoryRow & { sortedOptions: CategoryOption[] };\n\ntype UseCategoryGridInputOptions = {\n processedCategories: ProcessedCategory[];\n categories: CategoryRow[];\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: \"up\" | \"down\" | \"left\" | \"right\") => void;\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n};\n\nexport function useCategoryGridInput({\n processedCategories,\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n}: UseCategoryGridInputOptions): void {\n const currentRow = processedCategories[focusedRow];\n const currentOptions = currentRow?.sortedOptions || [];\n const currentLocked = currentRow ? isSectionLocked(currentRow.id, categories) : false;\n\n // Adjust column when current row's options change externally (e.g. option becomes disabled)\n useEffect(() => {\n if (!currentRow) return;\n\n const maxCol = currentOptions.length - 1;\n if (focusedCol > maxCol) {\n const newCol = Math.max(0, maxCol);\n setFocused(focusedRow, newCol);\n }\n }, [focusedRow, currentOptions, focusedCol, setFocused, currentRow]);\n\n // Bounce off locked sections when a section becomes locked (e.g. framework deselected)\n useEffect(() => {\n if (currentRow && currentLocked) {\n const nextUnlocked = findNextUnlockedIndex(processedCategories, focusedRow, categories);\n if (nextUnlocked !== focusedRow) {\n const newRowOptions = processedCategories[nextUnlocked]?.sortedOptions || [];\n const newCol = findValidStartColumn(newRowOptions);\n setFocused(nextUnlocked, newCol);\n }\n }\n }, [currentRow, currentLocked, focusedRow, processedCategories, categories, setFocused]);\n\n // Store the latest handler in a ref so that the useInput effect never needs to\n // re-register on the event emitter. This avoids a stale-closure race condition\n // where, after a domain switch (CategoryGrid remount via key={activeDomain}),\n // the useInput effect may not yet have re-registered the updated handler when\n // the first keypress arrives — causing the first space press to be silently lost.\n type InputKey = {\n leftArrow: boolean;\n rightArrow: boolean;\n upArrow: boolean;\n downArrow: boolean;\n tab: boolean;\n shift: boolean;\n };\n\n const handlerRef = useRef<((input: string, key: InputKey) => void) | null>(null);\n handlerRef.current = (input: string, key: InputKey) => {\n if (key.tab && key.shift) {\n onToggleLabels();\n return;\n }\n\n if (key.tab && !key.shift) {\n const nextSection = findNextUnlockedIndex(processedCategories, focusedRow, categories);\n if (nextSection !== focusedRow) {\n const newRowOptions = processedCategories[nextSection]?.sortedOptions || [];\n const newCol = findValidStartColumn(newRowOptions);\n setFocused(nextSection, newCol);\n }\n return;\n }\n\n if (isHotkey(input, HOTKEY_TOGGLE_LABELS)) {\n onToggleLabels();\n return;\n }\n\n if (input === \" \") {\n if (currentLocked) return;\n const currentOption = currentOptions[focusedCol];\n if (currentOption) {\n onToggle(currentRow.id, currentOption.id);\n }\n return;\n }\n\n const isLeft = key.leftArrow || input === \"h\";\n const isRight = key.rightArrow || input === \"l\";\n const isUp = key.upArrow || input === \"k\";\n const isDown = key.downArrow || input === \"j\";\n\n if (isLeft) {\n if (currentLocked) return;\n moveFocus(\"left\");\n } else if (isRight) {\n if (currentLocked) return;\n moveFocus(\"right\");\n } else if (isUp) {\n moveFocus(\"up\");\n } else if (isDown) {\n moveFocus(\"down\");\n }\n };\n\n // Stable handler reference — never changes, so useInput's effect registers once\n const stableHandler = useCallback((input: string, key: InputKey) => {\n handlerRef.current?.(input, key);\n }, []);\n\n useInput(stableHandler);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAgB,eAAAA,cAAa,SAAS,UAAAC,eAAc;AAEpD,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AAI,WAAW,WAAW,GAAG;AAC3B,WACE,oBAAC,OAAI,eAAc,UACjB,8BAAC,QAAK,UAAQ,MAAC,uCAAyB,GAC1C;AAAA,EAEJ;AAEA,QAAM,WAAW,gBAAgB,EAAE,YAAY,EAAE,IAAI,CAAC;AAEtD,QAAM,kBAAkB,oBAAoB,IAAI,CAAC,UAAU,UAAU;AACnE,UAAM,WAAW,gBAAgB,SAAS,IAAI,UAAU;AAExD,WACE,oBAAC,OAAsB,KAAK,CAAC,OAAO,cAAc,OAAO,EAAE,GAAI,GAAG,UAChE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,SAAS,SAAS;AAAA,QAClB;AAAA,QACA,WAAW,UAAU;AAAA,QACrB,oBAAoB;AAAA,QACpB;AAAA,QACA,SAAS,UAAU;AAAA;AAAA,IACrB,KATQ,SAAS,EAUnB;AAAA,EAEJ,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACb,GAAI,gBACD,EAAE,QAAQ,iBAAiB,UAAU,SAAkB,IACvD,EAAE,UAAU,EAAE;AAAA,MAElB,8BAAC,OAAI,eAAc,UAAS,WAAW,cAAc,IAAI,CAAC,cAAc,GAAI,GAAG,UAC5E,2BACH;AAAA;AAAA,EACF;AAEJ;","names":["useCallback","useRef","useCallback","useRef"]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-UFKDY45I.js";
|
|
8
8
|
import {
|
|
9
9
|
useFocusedListItem
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-P2FHS5IS.js";
|
|
11
11
|
import {
|
|
12
12
|
useSectionScroll
|
|
13
13
|
} from "./chunk-AUNBGZS4.js";
|
|
@@ -260,4 +260,4 @@ var SourceGrid = ({
|
|
|
260
260
|
export {
|
|
261
261
|
SourceGrid
|
|
262
262
|
};
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
263
|
+
//# sourceMappingURL=chunk-TDHEAHXD.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadProjectSourceConfig,
|
|
8
8
|
resolveAgentsSource,
|
|
9
9
|
resolveSource
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6W4H2K3Z.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseCommand
|
|
13
13
|
} from "./chunk-IJLAVOKZ.js";
|
|
@@ -90,4 +90,4 @@ ${DEFAULT_BRANDING.NAME} Configuration
|
|
|
90
90
|
export {
|
|
91
91
|
ConfigShow
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-W6NWOYMS.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
StackSelection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2YFC7IJ6.js";
|
|
5
5
|
import {
|
|
6
6
|
useMeasuredHeight
|
|
7
7
|
} from "./chunk-K77I4XGL.js";
|
|
8
8
|
import {
|
|
9
9
|
DomainSelection
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NO2XIAJC.js";
|
|
11
11
|
import {
|
|
12
12
|
ViewTitle
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7M4INWUR.js";
|
|
14
14
|
import {
|
|
15
15
|
useWizardStore
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EWGFIBBU.js";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
19
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -37,4 +37,4 @@ var StepStack = ({ onCancel }) => {
|
|
|
37
37
|
export {
|
|
38
38
|
StepStack
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-YUSLPHXO.js.map
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
compileAllAgentPlugins,
|
|
4
4
|
printAgentCompilationSummary
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-NPMGVQM4.js";
|
|
6
6
|
import {
|
|
7
7
|
compileAllSkillPlugins,
|
|
8
8
|
compileSkillPlugin,
|
|
9
9
|
printCompilationSummary
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-6W4H2K3Z.js";
|
|
11
11
|
import "../../chunk-RRBWNEG3.js";
|
|
12
12
|
import "../../chunk-NG2GGK6P.js";
|
|
13
13
|
import {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-NPMGVQM4.js";
|
|
5
5
|
import {
|
|
6
6
|
compileStackPlugin,
|
|
7
7
|
loadStacks,
|
|
8
8
|
printStackCompilationSummary
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-6W4H2K3Z.js";
|
|
10
10
|
import "../../chunk-RRBWNEG3.js";
|
|
11
11
|
import "../../chunk-NG2GGK6P.js";
|
|
12
12
|
import {
|
package/dist/commands/compile.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions,
|
|
4
4
|
recompileAgents
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-NPMGVQM4.js";
|
|
6
6
|
import {
|
|
7
7
|
ERROR_MESSAGES,
|
|
8
8
|
INFO_MESSAGES,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
detectProjectInstallation,
|
|
14
14
|
discoverAllPluginSkills,
|
|
15
15
|
resolveSource
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-6W4H2K3Z.js";
|
|
17
17
|
import {
|
|
18
18
|
parseFrontmatter
|
|
19
19
|
} from "../chunk-RRBWNEG3.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigShow
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-W6NWOYMS.js";
|
|
5
|
+
import "../../chunk-6W4H2K3Z.js";
|
|
6
6
|
import "../../chunk-RRBWNEG3.js";
|
|
7
7
|
import "../../chunk-NG2GGK6P.js";
|
|
8
8
|
import "../../chunk-IJLAVOKZ.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigShow
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-W6NWOYMS.js";
|
|
5
|
+
import "../../chunk-6W4H2K3Z.js";
|
|
6
6
|
import "../../chunk-RRBWNEG3.js";
|
|
7
7
|
import "../../chunk-NG2GGK6P.js";
|
|
8
8
|
import "../../chunk-IJLAVOKZ.js";
|
package/dist/commands/diff.js
CHANGED
package/dist/commands/doctor.js
CHANGED
package/dist/commands/edit.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
Wizard
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-JBQRRJRY.js";
|
|
5
|
+
import "../chunk-2DKJM7RO.js";
|
|
6
6
|
import "../chunk-SXGBPQY6.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-DZUZVT5X.js";
|
|
8
|
+
import "../chunk-6RGNXTTG.js";
|
|
9
9
|
import "../chunk-HGTC76BX.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-YUSLPHXO.js";
|
|
11
|
+
import "../chunk-2YFC7IJ6.js";
|
|
12
|
+
import "../chunk-MZQKSK3J.js";
|
|
13
|
+
import "../chunk-GJWHA6P4.js";
|
|
14
14
|
import "../chunk-K77I4XGL.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-I7WXUAWA.js";
|
|
16
16
|
import "../chunk-MWGDG4QN.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-TDHEAHXD.js";
|
|
18
18
|
import "../chunk-7SOPVGDV.js";
|
|
19
19
|
import "../chunk-UFKDY45I.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-PJUC2WCA.js";
|
|
21
|
+
import "../chunk-P2FHS5IS.js";
|
|
22
|
+
import "../chunk-NO2XIAJC.js";
|
|
23
23
|
import "../chunk-LVNNP7T4.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-62FBXUNR.js";
|
|
25
25
|
import "../chunk-XMLCXRTS.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-7M4INWUR.js";
|
|
27
27
|
import "../chunk-AUNBGZS4.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-2PZ7LBFT.js";
|
|
29
29
|
import "../chunk-WF5PMBIR.js";
|
|
30
30
|
import "../chunk-KUV24B5M.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-EWGFIBBU.js";
|
|
32
32
|
import "../chunk-T5DJCIUP.js";
|
|
33
33
|
import "../chunk-U3IGFMCY.js";
|
|
34
34
|
import "../chunk-CBYRFAUN.js";
|
|
35
35
|
import {
|
|
36
36
|
getAgentDefinitions,
|
|
37
37
|
recompileAgents
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-NPMGVQM4.js";
|
|
39
39
|
import {
|
|
40
40
|
ERROR_MESSAGES,
|
|
41
41
|
INFO_MESSAGES,
|
|
@@ -54,12 +54,11 @@ import {
|
|
|
54
54
|
discoverAllPluginSkills,
|
|
55
55
|
ensureBlankGlobalConfig,
|
|
56
56
|
executeMigration,
|
|
57
|
-
getMarketplaceLabel,
|
|
58
57
|
loadProjectConfig,
|
|
59
58
|
loadSkillsMatrixFromSource,
|
|
60
59
|
migrateLocalSkillScope,
|
|
61
60
|
writeScopedConfigs
|
|
62
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-6W4H2K3Z.js";
|
|
63
62
|
import {
|
|
64
63
|
loadAllAgents
|
|
65
64
|
} from "../chunk-RRBWNEG3.js";
|
|
@@ -176,7 +175,6 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
176
175
|
startupMessages = drainBuffer();
|
|
177
176
|
disableBuffering();
|
|
178
177
|
let wizardResult = null;
|
|
179
|
-
const marketplaceLabel = getMarketplaceLabel(sourceResult);
|
|
180
178
|
const isGlobalDir = cwd === GLOBAL_INSTALL_ROOT;
|
|
181
179
|
const lockedSkillIds = isGlobalDir ? void 0 : projectConfig?.config?.skills?.filter((s) => s.scope === "global").map((s) => s.id);
|
|
182
180
|
const lockedAgentNames = isGlobalDir ? void 0 : projectConfig?.config?.agents?.filter((a) => a.scope === "global").map((a) => a.name);
|
|
@@ -185,7 +183,6 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
185
183
|
Wizard,
|
|
186
184
|
{
|
|
187
185
|
version: this.config.version,
|
|
188
|
-
marketplaceLabel,
|
|
189
186
|
initialStep: "build",
|
|
190
187
|
initialDomains: projectConfig?.config?.domains,
|
|
191
188
|
initialAgents: projectConfig?.config?.selectedAgents,
|
|
@@ -210,12 +207,10 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
210
207
|
if (!result || result.cancelled) {
|
|
211
208
|
this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
|
|
212
209
|
}
|
|
213
|
-
if (
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
exit: EXIT_CODES.ERROR
|
|
218
|
-
});
|
|
210
|
+
if (result.validation.errors.length > 0) {
|
|
211
|
+
for (const err of result.validation.errors) {
|
|
212
|
+
this.warn(err.message);
|
|
213
|
+
}
|
|
219
214
|
}
|
|
220
215
|
const newSkillIds = result.skills.map((s) => s.id);
|
|
221
216
|
const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n CLAUDE_DIR,\n CLAUDE_SRC_DIR,\n CLI_BIN_NAME,\n GLOBAL_INSTALL_ROOT,\n PROJECT_ROOT,\n SOURCE_DISPLAY_NAMES,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { ensureBlankGlobalConfig } from \"../lib/configuration/config-writer.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport {\n detectInstallation,\n buildAndMergeConfig,\n writeScopedConfigs,\n detectMigrations,\n executeMigration,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport {\n getMarketplaceLabel,\n loadAllAgents,\n loadSkillsMatrixFromSource,\n} from \"../lib/loading/index.js\";\nimport { matrix, getSkillById } from \"../lib/matrix/matrix-provider\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { deleteLocalSkill, migrateLocalSkillScope } from \"../lib/skills/index.js\";\nimport type { AgentDefinition, AgentName, SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport {\n claudePluginInstall,\n claudePluginUninstall,\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n} from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n const cwd = process.cwd();\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n // Use installation.projectDir for reads (loading config, discovering installed skills).\n // Use cwd for writes (config saves, plugin installs, scope migrations, recompilation output)\n // and for the locked-items check (determining whether global items are read-only).\n const projectDir = installation.projectDir;\n\n enableBuffering();\n\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills.map((s) => s.id);\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // D9: In project context, existing global items are read-only (locked).\n // When editing from ~/ (global context), nothing is locked.\n // Uses cwd (not projectDir) so that global items are correctly locked\n // even when detectInstallation() fell back to the global installation.\n const isGlobalDir = cwd === GLOBAL_INSTALL_ROOT;\n const lockedSkillIds = isGlobalDir\n ? undefined\n : projectConfig?.config?.skills?.filter((s) => s.scope === \"global\").map((s) => s.id);\n const lockedAgentNames = isGlobalDir\n ? undefined\n : projectConfig?.config?.agents?.filter((a) => a.scope === \"global\").map((a) => a.name);\n\n const { waitUntilExit } = render(\n <Wizard\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n initialStep=\"build\"\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n installedSkillConfigs={projectConfig?.config?.skills}\n lockedSkillIds={lockedSkillIds}\n installedAgentConfigs={projectConfig?.config?.agents}\n lockedAgentNames={lockedAgentNames}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n // TypeScript can't track that onComplete callback mutates wizardResult before waitUntilExit resolves\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const newSkillIds = result.skills.map((s) => s.id);\n const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n const scopeChanges = new Map<\n SkillId,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.skills) {\n for (const newSkill of result.skills) {\n const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);\n if (oldSkill && oldSkill.source !== newSkill.source) {\n sourceChanges.set(newSkill.id, {\n from: oldSkill.source,\n to: newSkill.source,\n });\n }\n if (oldSkill && oldSkill.scope !== newSkill.scope) {\n scopeChanges.set(newSkill.id, {\n from: oldSkill.scope,\n to: newSkill.scope,\n });\n }\n }\n }\n\n const agentScopeChanges = new Map<\n AgentName,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.agents) {\n for (const newAgent of result.agentConfigs) {\n const oldAgent = projectConfig.config.agents.find((a) => a.name === newAgent.name);\n if (oldAgent && oldAgent.scope !== newAgent.scope) {\n agentScopeChanges.set(newAgent.name, {\n from: oldAgent.scope,\n to: newAgent.scope,\n });\n }\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasScopeChanges = scopeChanges.size > 0;\n const hasAgentScopeChanges = agentScopeChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges && !hasAgentScopeChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n this.log(` + ${getSkillById(skillId).displayName}`);\n }\n for (const skillId of removedSkills) {\n const skill = matrix.skills[skillId];\n this.log(` - ${skill?.displayName ?? skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [skillId, change] of scopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [agentName, change] of agentScopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${agentName} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n // Handle per-skill mode migrations (local <-> plugin)\n const oldSkills = projectConfig?.config?.skills ?? [];\n const migrationPlan = detectMigrations(oldSkills, result.skills);\n const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;\n\n if (hasMigrations) {\n if (migrationPlan.toLocal.length > 0) {\n this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);\n for (const migration of migrationPlan.toLocal) {\n this.log(` - ${migration.id}`);\n }\n }\n if (migrationPlan.toPlugin.length > 0) {\n this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);\n for (const migration of migrationPlan.toPlugin) {\n this.log(` - ${migration.id}`);\n }\n }\n\n const migrationResult = await executeMigration(migrationPlan, cwd, sourceResult);\n\n for (const warning of migrationResult.warnings) {\n this.warn(warning);\n }\n }\n\n const migratedSkillIds = new Set([\n ...migrationPlan.toLocal.map((m) => m.id),\n ...migrationPlan.toPlugin.map((m) => m.id),\n ]);\n\n // Handle scope migrations (P→G or G→P) for local-mode skills\n for (const [skillId, change] of scopeChanges) {\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (skillConfig?.source === \"local\") {\n await migrateLocalSkillScope(skillId, change.from, cwd);\n } else if (sourceResult.marketplace && skillConfig) {\n // Plugin-mode scope change: uninstall from old scope, install to new scope\n const oldPluginScope = change.from === \"global\" ? \"user\" : \"project\";\n const newPluginScope = change.to === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginUninstall(skillId, oldPluginScope, cwd);\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n await claudePluginInstall(pluginRef, newPluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Handle remaining non-migration source changes (e.g., marketplace A -> marketplace B)\n for (const [skillId, change] of sourceChanges) {\n // Skip skills already handled by mode migration\n if (migratedSkillIds.has(skillId)) {\n continue;\n }\n if (change.from === \"local\") {\n await deleteLocalSkill(cwd, skillId);\n }\n }\n\n if (sourceResult.marketplace) {\n const marketplaceExists = await claudePluginMarketplaceExists(sourceResult.marketplace);\n if (!marketplaceExists) {\n this.log(`Registering marketplace \"${sourceResult.marketplace}\"...`);\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n this.log(`Registered marketplace: ${sourceResult.marketplace}`);\n }\n\n for (const skillId of addedSkills) {\n // Find the skill config to get its scope\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (!skillConfig || skillConfig.source === \"local\") continue;\n\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n const pluginScope = skillConfig.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n // For removed skills, use old config to determine scope\n const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);\n const pluginScope = oldSkill?.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Load agent definitions first — needed for both config-types.ts and recompilation\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n // Persist wizard result to config.ts and config-types.ts (split by scope when in project context)\n try {\n const mergeResult = await buildAndMergeConfig(result, sourceResult, cwd, flags.source);\n\n // Load full agent definitions for config-types.ts generation\n const cliAgents = await loadAllAgents(PROJECT_ROOT);\n const sourceAgents = await loadAllAgents(sourcePath);\n const agents: Record<AgentName, AgentDefinition> = { ...cliAgents, ...sourceAgents };\n\n // Ensure global config exists before writing project config (so the\n // `import globalConfig from \"~/.claude-src/config\"` doesn't throw)\n if (cwd !== os.homedir()) {\n await ensureBlankGlobalConfig();\n }\n\n // Recompute configPath from cwd — when detectInstallation() fell back to\n // global, installation.configPath points to ~/.claude-src/config.ts, but\n // writeScopedConfigs uses it as the project config path.\n const configPath = path.join(cwd, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);\n\n // Determine whether a project installation already exists:\n // If detectInstallation() found a project config, projectDir differs from homedir.\n // If it fell back to global, projectDir === homedir (no project installation).\n const projectInstallationExists =\n path.resolve(installation.projectDir) !== path.resolve(os.homedir());\n\n await writeScopedConfigs(\n mergeResult.config,\n sourceResult.matrix,\n agents,\n cwd,\n configPath,\n projectInstallationExists,\n );\n } catch (error) {\n this.warn(`Could not update config: ${getErrorMessage(error)}`);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(cwd);\n\n // Build scope map so recompileAgents routes agents to the correct directory:\n // global agents -> ~/.claude/agents/, project agents -> <cwd>/.claude/agents/\n const agentScopeMap = new Map(result.agentConfigs.map((a) => [a.name, a.scope] as const));\n const outputDir = path.join(cwd, CLAUDE_DIR, \"agents\");\n\n const recompileResult = await recompileAgents({\n pluginDir: cwd,\n sourcePath,\n skills: recompileSkills,\n projectDir: cwd,\n outputDir,\n installMode: deriveInstallMode(result.skills),\n agentScopeMap,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n if (hasScopeChanges || hasAgentScopeChanges) {\n const totalScopeChanges = scopeChanges.size + agentScopeChanges.size;\n summaryParts.push(`${totalScopeChanges} scope${totalScopeChanges > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAkB;AACpB,mBAAa,KAAK,GAAG,cAAc,IAAI,UAAU,cAAc,OAAO,IAAI,MAAM,EAAE,UAAU;AAAA,IAC9F;AACA,QAAI,mBAAmB,sBAAsB;AAC3C,YAAM,oBAAoB,aAAa,OAAO,kBAAkB;AAChE,mBAAa,KAAK,GAAG,iBAAiB,SAAS,oBAAoB,IAAI,MAAM,EAAE,UAAU;AAAA,IAC3F;AACA,SAAK,IAAI;AAAA,0BAA6B,aAAa,KAAK,IAAI,CAAC;AAAA,CAAK;AAAA,EACpE;AACF;","names":["result"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n CLAUDE_DIR,\n CLAUDE_SRC_DIR,\n CLI_BIN_NAME,\n GLOBAL_INSTALL_ROOT,\n PROJECT_ROOT,\n SOURCE_DISPLAY_NAMES,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { ensureBlankGlobalConfig } from \"../lib/configuration/config-writer.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport {\n detectInstallation,\n buildAndMergeConfig,\n writeScopedConfigs,\n detectMigrations,\n executeMigration,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport { loadAllAgents, loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { matrix, getSkillById } from \"../lib/matrix/matrix-provider\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { deleteLocalSkill, migrateLocalSkillScope } from \"../lib/skills/index.js\";\nimport type { AgentDefinition, AgentName, SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport {\n claudePluginInstall,\n claudePluginUninstall,\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n} from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n const cwd = process.cwd();\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n // Use installation.projectDir for reads (loading config, discovering installed skills).\n // Use cwd for writes (config saves, plugin installs, scope migrations, recompilation output)\n // and for the locked-items check (determining whether global items are read-only).\n const projectDir = installation.projectDir;\n\n enableBuffering();\n\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills.map((s) => s.id);\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n\n // D9: In project context, existing global items are read-only (locked).\n // When editing from ~/ (global context), nothing is locked.\n // Uses cwd (not projectDir) so that global items are correctly locked\n // even when detectInstallation() fell back to the global installation.\n const isGlobalDir = cwd === GLOBAL_INSTALL_ROOT;\n const lockedSkillIds = isGlobalDir\n ? undefined\n : projectConfig?.config?.skills?.filter((s) => s.scope === \"global\").map((s) => s.id);\n const lockedAgentNames = isGlobalDir\n ? undefined\n : projectConfig?.config?.agents?.filter((a) => a.scope === \"global\").map((a) => a.name);\n\n const { waitUntilExit } = render(\n <Wizard\n version={this.config.version}\n initialStep=\"build\"\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n installedSkillConfigs={projectConfig?.config?.skills}\n lockedSkillIds={lockedSkillIds}\n installedAgentConfigs={projectConfig?.config?.agents}\n lockedAgentNames={lockedAgentNames}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n // TypeScript can't track that onComplete callback mutates wizardResult before waitUntilExit resolves\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (result.validation.errors.length > 0) {\n for (const err of result.validation.errors) {\n this.warn(err.message);\n }\n }\n\n const newSkillIds = result.skills.map((s) => s.id);\n const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n const scopeChanges = new Map<\n SkillId,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.skills) {\n for (const newSkill of result.skills) {\n const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);\n if (oldSkill && oldSkill.source !== newSkill.source) {\n sourceChanges.set(newSkill.id, {\n from: oldSkill.source,\n to: newSkill.source,\n });\n }\n if (oldSkill && oldSkill.scope !== newSkill.scope) {\n scopeChanges.set(newSkill.id, {\n from: oldSkill.scope,\n to: newSkill.scope,\n });\n }\n }\n }\n\n const agentScopeChanges = new Map<\n AgentName,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.agents) {\n for (const newAgent of result.agentConfigs) {\n const oldAgent = projectConfig.config.agents.find((a) => a.name === newAgent.name);\n if (oldAgent && oldAgent.scope !== newAgent.scope) {\n agentScopeChanges.set(newAgent.name, {\n from: oldAgent.scope,\n to: newAgent.scope,\n });\n }\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasScopeChanges = scopeChanges.size > 0;\n const hasAgentScopeChanges = agentScopeChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges && !hasAgentScopeChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n this.log(` + ${getSkillById(skillId).displayName}`);\n }\n for (const skillId of removedSkills) {\n const skill = matrix.skills[skillId];\n this.log(` - ${skill?.displayName ?? skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [skillId, change] of scopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [agentName, change] of agentScopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${agentName} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n // Handle per-skill mode migrations (local <-> plugin)\n const oldSkills = projectConfig?.config?.skills ?? [];\n const migrationPlan = detectMigrations(oldSkills, result.skills);\n const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;\n\n if (hasMigrations) {\n if (migrationPlan.toLocal.length > 0) {\n this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);\n for (const migration of migrationPlan.toLocal) {\n this.log(` - ${migration.id}`);\n }\n }\n if (migrationPlan.toPlugin.length > 0) {\n this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);\n for (const migration of migrationPlan.toPlugin) {\n this.log(` - ${migration.id}`);\n }\n }\n\n const migrationResult = await executeMigration(migrationPlan, cwd, sourceResult);\n\n for (const warning of migrationResult.warnings) {\n this.warn(warning);\n }\n }\n\n const migratedSkillIds = new Set([\n ...migrationPlan.toLocal.map((m) => m.id),\n ...migrationPlan.toPlugin.map((m) => m.id),\n ]);\n\n // Handle scope migrations (P→G or G→P) for local-mode skills\n for (const [skillId, change] of scopeChanges) {\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (skillConfig?.source === \"local\") {\n await migrateLocalSkillScope(skillId, change.from, cwd);\n } else if (sourceResult.marketplace && skillConfig) {\n // Plugin-mode scope change: uninstall from old scope, install to new scope\n const oldPluginScope = change.from === \"global\" ? \"user\" : \"project\";\n const newPluginScope = change.to === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginUninstall(skillId, oldPluginScope, cwd);\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n await claudePluginInstall(pluginRef, newPluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Handle remaining non-migration source changes (e.g., marketplace A -> marketplace B)\n for (const [skillId, change] of sourceChanges) {\n // Skip skills already handled by mode migration\n if (migratedSkillIds.has(skillId)) {\n continue;\n }\n if (change.from === \"local\") {\n await deleteLocalSkill(cwd, skillId);\n }\n }\n\n if (sourceResult.marketplace) {\n const marketplaceExists = await claudePluginMarketplaceExists(sourceResult.marketplace);\n if (!marketplaceExists) {\n this.log(`Registering marketplace \"${sourceResult.marketplace}\"...`);\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n this.log(`Registered marketplace: ${sourceResult.marketplace}`);\n }\n\n for (const skillId of addedSkills) {\n // Find the skill config to get its scope\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (!skillConfig || skillConfig.source === \"local\") continue;\n\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n const pluginScope = skillConfig.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n // For removed skills, use old config to determine scope\n const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);\n const pluginScope = oldSkill?.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, cwd);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Load agent definitions first — needed for both config-types.ts and recompilation\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n // Persist wizard result to config.ts and config-types.ts (split by scope when in project context)\n try {\n const mergeResult = await buildAndMergeConfig(result, sourceResult, cwd, flags.source);\n\n // Load full agent definitions for config-types.ts generation\n const cliAgents = await loadAllAgents(PROJECT_ROOT);\n const sourceAgents = await loadAllAgents(sourcePath);\n const agents: Record<AgentName, AgentDefinition> = { ...cliAgents, ...sourceAgents };\n\n // Ensure global config exists before writing project config (so the\n // `import globalConfig from \"~/.claude-src/config\"` doesn't throw)\n if (cwd !== os.homedir()) {\n await ensureBlankGlobalConfig();\n }\n\n // Recompute configPath from cwd — when detectInstallation() fell back to\n // global, installation.configPath points to ~/.claude-src/config.ts, but\n // writeScopedConfigs uses it as the project config path.\n const configPath = path.join(cwd, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);\n\n // Determine whether a project installation already exists:\n // If detectInstallation() found a project config, projectDir differs from homedir.\n // If it fell back to global, projectDir === homedir (no project installation).\n const projectInstallationExists =\n path.resolve(installation.projectDir) !== path.resolve(os.homedir());\n\n await writeScopedConfigs(\n mergeResult.config,\n sourceResult.matrix,\n agents,\n cwd,\n configPath,\n projectInstallationExists,\n );\n } catch (error) {\n this.warn(`Could not update config: ${getErrorMessage(error)}`);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(cwd);\n\n // Build scope map so recompileAgents routes agents to the correct directory:\n // global agents -> ~/.claude/agents/, project agents -> <cwd>/.claude/agents/\n const agentScopeMap = new Map(result.agentConfigs.map((a) => [a.name, a.scope] as const));\n const outputDir = path.join(cwd, CLAUDE_DIR, \"agents\");\n\n const recompileResult = await recompileAgents({\n pluginDir: cwd,\n sourcePath,\n skills: recompileSkills,\n projectDir: cwd,\n outputDir,\n installMode: deriveInstallMode(result.skills),\n agentScopeMap,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n if (hasScopeChanges || hasAgentScopeChanges) {\n const totalScopeChanges = scopeChanges.size + agentScopeChanges.size;\n summaryParts.push(`${totalScopeChanges} scope${totalScopeChanges > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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