@superdoc-dev/cli 0.2.0-next.97 → 0.2.0-next.99
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/dist/index.js +136 -82
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -33280,7 +33280,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
|
|
|
33280
33280
|
emptyOptions2 = {};
|
|
33281
33281
|
});
|
|
33282
33282
|
|
|
33283
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
33283
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-DSgQEo7o.es.js
|
|
33284
33284
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
33285
33285
|
const fieldValue = extension$1.config[field];
|
|
33286
33286
|
if (typeof fieldValue === "function")
|
|
@@ -65108,7 +65108,7 @@ var isRegExp = (value) => {
|
|
|
65108
65108
|
state.kern = kernNode.attributes["w:val"];
|
|
65109
65109
|
}
|
|
65110
65110
|
}, SuperConverter;
|
|
65111
|
-
var
|
|
65111
|
+
var init_SuperConverter_DSgQEo7o_es = __esm(() => {
|
|
65112
65112
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
65113
65113
|
init_jszip_ChlR43oI_es();
|
|
65114
65114
|
init_xml_js_DLE8mr0n_es();
|
|
@@ -94979,7 +94979,7 @@ var init_SuperConverter_6i_hCnOE_es = __esm(() => {
|
|
|
94979
94979
|
static getStoredSuperdocVersion(docx) {
|
|
94980
94980
|
return SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
94981
94981
|
}
|
|
94982
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.
|
|
94982
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.18.0") {
|
|
94983
94983
|
return SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
94984
94984
|
}
|
|
94985
94985
|
static generateWordTimestamp() {
|
|
@@ -121914,9 +121914,9 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
|
|
|
121914
121914
|
init_remark_gfm_z_sDF4ss_es();
|
|
121915
121915
|
});
|
|
121916
121916
|
|
|
121917
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
121918
|
-
var
|
|
121919
|
-
__export(
|
|
121917
|
+
// ../../packages/superdoc/dist/chunks/src-CPyKzDwB.es.js
|
|
121918
|
+
var exports_src_CPyKzDwB_es = {};
|
|
121919
|
+
__export(exports_src_CPyKzDwB_es, {
|
|
121920
121920
|
zt: () => defineMark,
|
|
121921
121921
|
z: () => cM,
|
|
121922
121922
|
yt: () => removeAwarenessStates,
|
|
@@ -122146,7 +122146,7 @@ function hasV8CaptureStackTrace(error) {
|
|
|
122146
122146
|
}
|
|
122147
122147
|
function getSuperdocVersion() {
|
|
122148
122148
|
try {
|
|
122149
|
-
return "1.
|
|
122149
|
+
return "1.18.0";
|
|
122150
122150
|
} catch {
|
|
122151
122151
|
return "unknown";
|
|
122152
122152
|
}
|
|
@@ -145010,21 +145010,32 @@ function imagesSetHyperlinkWrapper(editor, input2, options) {
|
|
|
145010
145010
|
return buildNoOpResult("Set hyperlink produced no change.");
|
|
145011
145011
|
return buildSuccessResult(findImageById(editor, input2.imageId));
|
|
145012
145012
|
}
|
|
145013
|
-
function
|
|
145013
|
+
function findContainingParagraph(editor, imagePos) {
|
|
145014
145014
|
const $pos = editor.state.doc.resolve(imagePos);
|
|
145015
|
-
|
|
145016
|
-
|
|
145017
|
-
|
|
145018
|
-
|
|
145019
|
-
|
|
145015
|
+
for (let depth = $pos.depth;depth >= 1; depth -= 1) {
|
|
145016
|
+
const node3 = $pos.node(depth);
|
|
145017
|
+
if (node3.type.name !== "paragraph")
|
|
145018
|
+
continue;
|
|
145019
|
+
return {
|
|
145020
|
+
depth,
|
|
145021
|
+
pos: $pos.before(depth),
|
|
145022
|
+
node: node3
|
|
145023
|
+
};
|
|
145024
|
+
}
|
|
145025
|
+
throw new DocumentApiAdapterError("INVALID_TARGET", "Caption operations require the image to be inside a paragraph.");
|
|
145026
|
+
}
|
|
145027
|
+
function findCaptionParagraph(editor, imagePos) {
|
|
145028
|
+
const paragraph2 = findContainingParagraph(editor, imagePos);
|
|
145029
|
+
const afterParagraphPos = paragraph2.pos + paragraph2.node.nodeSize;
|
|
145030
|
+
if (afterParagraphPos >= editor.state.doc.content.size)
|
|
145020
145031
|
return null;
|
|
145021
|
-
const nextNode = editor.state.doc.nodeAt(
|
|
145032
|
+
const nextNode = editor.state.doc.nodeAt(afterParagraphPos);
|
|
145022
145033
|
if (!nextNode || nextNode.type.name !== "paragraph")
|
|
145023
145034
|
return null;
|
|
145024
|
-
if (nextNode.attrs?.paragraphProperties?.styleId !== "Caption")
|
|
145035
|
+
if ((nextNode.attrs?.paragraphProperties?.styleId ?? nextNode.attrs?.styleId) !== "Caption")
|
|
145025
145036
|
return null;
|
|
145026
145037
|
return {
|
|
145027
|
-
pos:
|
|
145038
|
+
pos: afterParagraphPos,
|
|
145028
145039
|
node: nextNode
|
|
145029
145040
|
};
|
|
145030
145041
|
}
|
|
@@ -145051,12 +145062,11 @@ function imagesInsertCaptionWrapper(editor, input2, options) {
|
|
|
145051
145062
|
if (options?.dryRun)
|
|
145052
145063
|
return buildSuccessResult(image2);
|
|
145053
145064
|
if (executeDomainCommand(editor, () => {
|
|
145054
|
-
const
|
|
145055
|
-
const
|
|
145056
|
-
const afterParentPos = $pos.before(parentDepth + 1) + $pos.node(parentDepth + 1).nodeSize;
|
|
145065
|
+
const paragraph2 = findContainingParagraph(editor, findImageById(editor, input2.imageId).pos);
|
|
145066
|
+
const afterParagraphPos = paragraph2.pos + paragraph2.node.nodeSize;
|
|
145057
145067
|
const tr = editor.state.tr;
|
|
145058
145068
|
const captionPara = editor.state.schema.nodes.paragraph.create({ paragraphProperties: { styleId: "Caption" } }, editor.state.schema.text(input2.text));
|
|
145059
|
-
tr.insert(
|
|
145069
|
+
tr.insert(afterParagraphPos, captionPara);
|
|
145060
145070
|
if (!tr.docChanged)
|
|
145061
145071
|
return false;
|
|
145062
145072
|
editor.dispatch(tr);
|
|
@@ -180189,7 +180199,7 @@ var Node$13 = class Node$14 {
|
|
|
180189
180199
|
domAvailabilityCache = false;
|
|
180190
180200
|
return false;
|
|
180191
180201
|
}
|
|
180192
|
-
}, summaryVersion = "1.
|
|
180202
|
+
}, summaryVersion = "1.18.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
|
|
180193
180203
|
const container = document.createElement("div");
|
|
180194
180204
|
container.innerHTML = html3;
|
|
180195
180205
|
const result = [];
|
|
@@ -180757,6 +180767,8 @@ var Node$13 = class Node$14 {
|
|
|
180757
180767
|
existingFileNames.add(uniqueFileName);
|
|
180758
180768
|
const mediaPath = buildMediaPath(uniqueFileName);
|
|
180759
180769
|
mediaStore[mediaPath] = src;
|
|
180770
|
+
if (editor.options.ydoc)
|
|
180771
|
+
editor.options.ydoc.getMap("media").set(mediaPath, src);
|
|
180760
180772
|
const rId = addImageRelationship({
|
|
180761
180773
|
editor,
|
|
180762
180774
|
path: mediaPath.startsWith("word/") ? mediaPath.slice(5) : mediaPath
|
|
@@ -199184,9 +199196,9 @@ var Node$13 = class Node$14 {
|
|
|
199184
199196
|
trackedChanges: context.trackedChanges ?? []
|
|
199185
199197
|
});
|
|
199186
199198
|
}, _hoisted_1$6, _hoisted_2$2, _hoisted_3, _hoisted_4, ContextMenu_default, _hoisted_1$5, BasicUpload_default, _hoisted_1$4, MIN_WIDTH = 200, PPI = 96, alignment = "flex-end", Ruler_default, GenericPopover_default, _hoisted_1$3, _hoisted_2$1, RESIZE_HANDLE_WIDTH_PX = 9, RESIZE_HANDLE_HEIGHT_PX = 9, RESIZE_HANDLE_OFFSET_PX = 4, DRAG_OVERLAY_EXTENSION_PX = 1000, MIN_DRAG_OVERLAY_WIDTH_PX = 2000, THROTTLE_INTERVAL_MS = 16, MIN_RESIZE_DELTA_PX = 1, TableResizeOverlay_default, _hoisted_1$2, OVERLAY_EXPANSION_PX = 2000, RESIZE_HANDLE_SIZE_PX = 12, MOUSE_MOVE_THROTTLE_MS = 16, DIMENSION_CHANGE_THRESHOLD_PX = 1, Z_INDEX_OVERLAY = 10, Z_INDEX_HANDLE = 15, Z_INDEX_GUIDELINE = 20, ImageResizeOverlay_default, LINK_CLICK_DEBOUNCE_MS = 300, CURSOR_UPDATE_TIMEOUT_MS = 10, POPOVER_VERTICAL_OFFSET_PX = 15, LinkClickHandler_default, _hoisted_1$1, _hoisted_2, DOCX2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", TABLE_RESIZE_HOVER_THRESHOLD = 8, TABLE_RESIZE_THROTTLE_MS = 16, SuperEditor_default, _hoisted_1, SuperInput_default, SlashMenu, Extensions;
|
|
199187
|
-
var
|
|
199199
|
+
var init_src_CPyKzDwB_es = __esm(() => {
|
|
199188
199200
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
199189
|
-
|
|
199201
|
+
init_SuperConverter_DSgQEo7o_es();
|
|
199190
199202
|
init_jszip_ChlR43oI_es();
|
|
199191
199203
|
init_uuid_qzgm05fK_es();
|
|
199192
199204
|
init_constants_CMPtQbp7_es();
|
|
@@ -209547,7 +209559,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
209547
209559
|
return migrations.length > 0;
|
|
209548
209560
|
}
|
|
209549
209561
|
processCollaborationMigrations() {
|
|
209550
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.
|
|
209562
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.18.0");
|
|
209551
209563
|
if (!this.options.ydoc)
|
|
209552
209564
|
return;
|
|
209553
209565
|
let docVersion = this.options.ydoc.getMap("meta").get("version");
|
|
@@ -230935,8 +230947,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
230935
230947
|
return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
230936
230948
|
};
|
|
230937
230949
|
stubFalse_default = stubFalse;
|
|
230938
|
-
freeExports$2 = typeof
|
|
230939
|
-
freeModule$2 = freeExports$2 && typeof
|
|
230950
|
+
freeExports$2 = typeof exports_src_CPyKzDwB_es == "object" && exports_src_CPyKzDwB_es && !exports_src_CPyKzDwB_es.nodeType && exports_src_CPyKzDwB_es;
|
|
230951
|
+
freeModule$2 = freeExports$2 && typeof module_src_CPyKzDwB_es == "object" && module_src_CPyKzDwB_es && !module_src_CPyKzDwB_es.nodeType && module_src_CPyKzDwB_es;
|
|
230940
230952
|
Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
|
|
230941
230953
|
isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
|
|
230942
230954
|
typedArrayTags = {};
|
|
@@ -230944,8 +230956,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
230944
230956
|
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
|
|
230945
230957
|
_baseIsTypedArray_default = baseIsTypedArray;
|
|
230946
230958
|
_baseUnary_default = baseUnary;
|
|
230947
|
-
freeExports$1 = typeof
|
|
230948
|
-
freeModule$1 = freeExports$1 && typeof
|
|
230959
|
+
freeExports$1 = typeof exports_src_CPyKzDwB_es == "object" && exports_src_CPyKzDwB_es && !exports_src_CPyKzDwB_es.nodeType && exports_src_CPyKzDwB_es;
|
|
230960
|
+
freeModule$1 = freeExports$1 && typeof module_src_CPyKzDwB_es == "object" && module_src_CPyKzDwB_es && !module_src_CPyKzDwB_es.nodeType && module_src_CPyKzDwB_es;
|
|
230949
230961
|
freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
|
|
230950
230962
|
_nodeUtil_default = function() {
|
|
230951
230963
|
try {
|
|
@@ -231050,8 +231062,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
231050
231062
|
Stack.prototype.has = _stackHas_default;
|
|
231051
231063
|
Stack.prototype.set = _stackSet_default;
|
|
231052
231064
|
_Stack_default = Stack;
|
|
231053
|
-
freeExports = typeof
|
|
231054
|
-
freeModule = freeExports && typeof
|
|
231065
|
+
freeExports = typeof exports_src_CPyKzDwB_es == "object" && exports_src_CPyKzDwB_es && !exports_src_CPyKzDwB_es.nodeType && exports_src_CPyKzDwB_es;
|
|
231066
|
+
freeModule = freeExports && typeof module_src_CPyKzDwB_es == "object" && module_src_CPyKzDwB_es && !module_src_CPyKzDwB_es.nodeType && module_src_CPyKzDwB_es;
|
|
231055
231067
|
Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
|
|
231056
231068
|
allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
|
|
231057
231069
|
_cloneBuffer_default = cloneBuffer;
|
|
@@ -238020,7 +238032,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
238020
238032
|
});
|
|
238021
238033
|
container.addEventListener("pointerdown", (e) => e.stopPropagation());
|
|
238022
238034
|
container.addEventListener("click", (e) => e.stopPropagation());
|
|
238023
|
-
const mountTarget = surface.closest(".super-editor") ?? surface.parentElement;
|
|
238035
|
+
const mountTarget = surface.closest(".super-editor-container") ?? surface.parentElement;
|
|
238024
238036
|
if (!mountTarget)
|
|
238025
238037
|
return;
|
|
238026
238038
|
mountTarget.appendChild(container);
|
|
@@ -239131,8 +239143,8 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
|
|
|
239131
239143
|
|
|
239132
239144
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
239133
239145
|
var init_super_editor_es = __esm(() => {
|
|
239134
|
-
|
|
239135
|
-
|
|
239146
|
+
init_src_CPyKzDwB_es();
|
|
239147
|
+
init_SuperConverter_DSgQEo7o_es();
|
|
239136
239148
|
init_jszip_ChlR43oI_es();
|
|
239137
239149
|
init_xml_js_DLE8mr0n_es();
|
|
239138
239150
|
init_constants_CMPtQbp7_es();
|
|
@@ -317228,22 +317240,32 @@ function imagesSetHyperlinkWrapper2(editor, input2, options) {
|
|
|
317228
317240
|
return buildNoOpResult2("Set hyperlink produced no change.");
|
|
317229
317241
|
return buildSuccessResult2(findImageById2(editor, input2.imageId));
|
|
317230
317242
|
}
|
|
317231
|
-
function
|
|
317243
|
+
function findContainingParagraph2(editor, imagePos) {
|
|
317232
317244
|
const $pos = editor.state.doc.resolve(imagePos);
|
|
317233
|
-
|
|
317234
|
-
|
|
317235
|
-
|
|
317236
|
-
|
|
317237
|
-
|
|
317238
|
-
|
|
317239
|
-
|
|
317245
|
+
for (let depth = $pos.depth;depth >= 1; depth -= 1) {
|
|
317246
|
+
const node4 = $pos.node(depth);
|
|
317247
|
+
if (node4.type.name !== "paragraph")
|
|
317248
|
+
continue;
|
|
317249
|
+
return {
|
|
317250
|
+
depth,
|
|
317251
|
+
pos: $pos.before(depth),
|
|
317252
|
+
node: node4
|
|
317253
|
+
};
|
|
317254
|
+
}
|
|
317255
|
+
throw new DocumentApiAdapterError3("INVALID_TARGET", "Caption operations require the image to be inside a paragraph.");
|
|
317256
|
+
}
|
|
317257
|
+
function findCaptionParagraph2(editor, imagePos) {
|
|
317258
|
+
const paragraph3 = findContainingParagraph2(editor, imagePos);
|
|
317259
|
+
const afterParagraphPos = paragraph3.pos + paragraph3.node.nodeSize;
|
|
317260
|
+
if (afterParagraphPos >= editor.state.doc.content.size)
|
|
317240
317261
|
return null;
|
|
317241
|
-
const nextNode = editor.state.doc.nodeAt(
|
|
317262
|
+
const nextNode = editor.state.doc.nodeAt(afterParagraphPos);
|
|
317242
317263
|
if (!nextNode || nextNode.type.name !== "paragraph")
|
|
317243
317264
|
return null;
|
|
317244
|
-
|
|
317265
|
+
const styleId = nextNode.attrs?.paragraphProperties?.styleId ?? nextNode.attrs?.styleId;
|
|
317266
|
+
if (styleId !== "Caption")
|
|
317245
317267
|
return null;
|
|
317246
|
-
return { pos:
|
|
317268
|
+
return { pos: afterParagraphPos, node: nextNode };
|
|
317247
317269
|
}
|
|
317248
317270
|
function requireSoleImageInParagraph2(editor, imagePos) {
|
|
317249
317271
|
const $pos = editor.state.doc.resolve(imagePos);
|
|
@@ -317272,14 +317294,12 @@ function imagesInsertCaptionWrapper2(editor, input2, options) {
|
|
|
317272
317294
|
if (options?.dryRun)
|
|
317273
317295
|
return buildSuccessResult2(image3);
|
|
317274
317296
|
const receipt2 = executeDomainCommand2(editor, () => {
|
|
317275
|
-
const
|
|
317276
|
-
const
|
|
317277
|
-
const
|
|
317278
|
-
const parentNode2 = $pos.node(parentDepth + 1);
|
|
317279
|
-
const afterParentPos = parentPos + parentNode2.nodeSize;
|
|
317297
|
+
const currentImage = findImageById2(editor, input2.imageId);
|
|
317298
|
+
const paragraph3 = findContainingParagraph2(editor, currentImage.pos);
|
|
317299
|
+
const afterParagraphPos = paragraph3.pos + paragraph3.node.nodeSize;
|
|
317280
317300
|
const tr = editor.state.tr;
|
|
317281
317301
|
const captionPara = editor.state.schema.nodes.paragraph.create({ paragraphProperties: { styleId: "Caption" } }, editor.state.schema.text(input2.text));
|
|
317282
|
-
tr.insert(
|
|
317302
|
+
tr.insert(afterParagraphPos, captionPara);
|
|
317283
317303
|
if (!tr.docChanged)
|
|
317284
317304
|
return false;
|
|
317285
317305
|
editor.dispatch(tr);
|
|
@@ -382127,16 +382147,61 @@ var init_wrapper_dispatch = __esm(() => {
|
|
|
382127
382147
|
COMMAND_SPEC_BY_KEY = new Map(CLI_COMMAND_SPECS.map((spec) => [spec.key, spec]));
|
|
382128
382148
|
});
|
|
382129
382149
|
|
|
382150
|
+
// src/commands/skill-targets.ts
|
|
382151
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
382152
|
+
import { homedir as homedir2 } from "node:os";
|
|
382153
|
+
import { join as join7 } from "node:path";
|
|
382154
|
+
function realPathOrSelf(path3) {
|
|
382155
|
+
try {
|
|
382156
|
+
return realpathSync(path3);
|
|
382157
|
+
} catch {
|
|
382158
|
+
return path3;
|
|
382159
|
+
}
|
|
382160
|
+
}
|
|
382161
|
+
function resolveTargetRoots(cwd2) {
|
|
382162
|
+
const roots = [{ baseDir: cwd2, displayPrefix: "" }];
|
|
382163
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || homedir2();
|
|
382164
|
+
if (homeDir && homeDir !== cwd2) {
|
|
382165
|
+
roots.push({ baseDir: homeDir, displayPrefix: "~/" });
|
|
382166
|
+
}
|
|
382167
|
+
return roots;
|
|
382168
|
+
}
|
|
382169
|
+
function resolveSkillTargets(cwd2) {
|
|
382170
|
+
const targets = [];
|
|
382171
|
+
const seen = new Set;
|
|
382172
|
+
for (const root5 of resolveTargetRoots(cwd2)) {
|
|
382173
|
+
for (const agentDirName of AGENT_DIRS) {
|
|
382174
|
+
const agentDir = join7(root5.baseDir, agentDirName);
|
|
382175
|
+
if (!existsSync(agentDir))
|
|
382176
|
+
continue;
|
|
382177
|
+
const dedupeKey = realPathOrSelf(agentDir);
|
|
382178
|
+
if (seen.has(dedupeKey))
|
|
382179
|
+
continue;
|
|
382180
|
+
seen.add(dedupeKey);
|
|
382181
|
+
const displaySkillDir = `${root5.displayPrefix}${agentDirName}/skills/superdoc/`;
|
|
382182
|
+
targets.push({
|
|
382183
|
+
skillDir: join7(agentDir, "skills", "superdoc"),
|
|
382184
|
+
displaySkillDir
|
|
382185
|
+
});
|
|
382186
|
+
}
|
|
382187
|
+
}
|
|
382188
|
+
return targets;
|
|
382189
|
+
}
|
|
382190
|
+
var AGENT_DIRS;
|
|
382191
|
+
var init_skill_targets = __esm(() => {
|
|
382192
|
+
AGENT_DIRS = [".claude", ".agents"];
|
|
382193
|
+
});
|
|
382194
|
+
|
|
382130
382195
|
// src/commands/install.ts
|
|
382131
|
-
import { existsSync, cpSync, mkdirSync } from "node:fs";
|
|
382132
|
-
import { join as
|
|
382196
|
+
import { existsSync as existsSync2, cpSync, mkdirSync } from "node:fs";
|
|
382197
|
+
import { join as join8, dirname as dirname2 } from "node:path";
|
|
382133
382198
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
382134
382199
|
function resolveSkillSource() {
|
|
382135
|
-
const fromDist =
|
|
382136
|
-
if (
|
|
382200
|
+
const fromDist = join8(__dirname2, "..", "skill");
|
|
382201
|
+
if (existsSync2(fromDist))
|
|
382137
382202
|
return fromDist;
|
|
382138
|
-
const fromSrc =
|
|
382139
|
-
if (
|
|
382203
|
+
const fromSrc = join8(__dirname2, "..", "..", "skill");
|
|
382204
|
+
if (existsSync2(fromSrc))
|
|
382140
382205
|
return fromSrc;
|
|
382141
382206
|
throw new Error("Could not locate bundled skill directory. Is the package installed correctly?");
|
|
382142
382207
|
}
|
|
@@ -382148,38 +382213,31 @@ async function runInstall(tokens, io) {
|
|
|
382148
382213
|
}
|
|
382149
382214
|
const cwd2 = process.cwd();
|
|
382150
382215
|
const skillSource = resolveSkillSource();
|
|
382216
|
+
const targets = resolveSkillTargets(cwd2);
|
|
382151
382217
|
let installed = 0;
|
|
382152
|
-
for (const target2 of
|
|
382153
|
-
|
|
382154
|
-
|
|
382155
|
-
|
|
382156
|
-
const dest = join7(agentDir, "skills", "superdoc");
|
|
382157
|
-
mkdirSync(dest, { recursive: true });
|
|
382158
|
-
cpSync(skillSource, dest, { recursive: true });
|
|
382159
|
-
io.stdout(`Installed skill to ${target2.dir}/skills/superdoc/
|
|
382218
|
+
for (const target2 of targets) {
|
|
382219
|
+
mkdirSync(target2.skillDir, { recursive: true });
|
|
382220
|
+
cpSync(skillSource, target2.skillDir, { recursive: true });
|
|
382221
|
+
io.stdout(`Installed skill to ${target2.displaySkillDir}
|
|
382160
382222
|
`);
|
|
382161
382223
|
installed += 1;
|
|
382162
382224
|
}
|
|
382163
382225
|
if (installed === 0) {
|
|
382164
|
-
io.stderr(`No agent directories found. Create .claude/ (Claude Code) or .agents/ (Codex) first, then re-run.
|
|
382226
|
+
io.stderr(`No agent directories found in current or home directory. Create .claude/ (Claude Code) or .agents/ (Codex) first, then re-run.
|
|
382165
382227
|
`);
|
|
382166
382228
|
return 1;
|
|
382167
382229
|
}
|
|
382168
382230
|
return 0;
|
|
382169
382231
|
}
|
|
382170
|
-
var __filename2, __dirname2
|
|
382232
|
+
var __filename2, __dirname2;
|
|
382171
382233
|
var init_install = __esm(() => {
|
|
382234
|
+
init_skill_targets();
|
|
382172
382235
|
__filename2 = fileURLToPath2(import.meta.url);
|
|
382173
382236
|
__dirname2 = dirname2(__filename2);
|
|
382174
|
-
AGENT_TARGETS = [
|
|
382175
|
-
{ name: "Claude Code", dir: ".claude" },
|
|
382176
|
-
{ name: "Codex", dir: ".agents" }
|
|
382177
|
-
];
|
|
382178
382237
|
});
|
|
382179
382238
|
|
|
382180
382239
|
// src/commands/uninstall.ts
|
|
382181
|
-
import { existsSync as
|
|
382182
|
-
import { join as join8 } from "node:path";
|
|
382240
|
+
import { existsSync as existsSync3, rmSync } from "node:fs";
|
|
382183
382241
|
async function runUninstall(tokens, io) {
|
|
382184
382242
|
if (!tokens.includes("--skills")) {
|
|
382185
382243
|
io.stderr(`Usage: superdoc uninstall --skills
|
|
@@ -382187,13 +382245,13 @@ async function runUninstall(tokens, io) {
|
|
|
382187
382245
|
return 1;
|
|
382188
382246
|
}
|
|
382189
382247
|
const cwd2 = process.cwd();
|
|
382248
|
+
const targets = resolveSkillTargets(cwd2);
|
|
382190
382249
|
let removed = 0;
|
|
382191
|
-
for (const target2 of
|
|
382192
|
-
|
|
382193
|
-
if (!existsSync2(fullPath))
|
|
382250
|
+
for (const target2 of targets) {
|
|
382251
|
+
if (!existsSync3(target2.skillDir))
|
|
382194
382252
|
continue;
|
|
382195
|
-
rmSync(
|
|
382196
|
-
io.stdout(`Removed ${target2.
|
|
382253
|
+
rmSync(target2.skillDir, { recursive: true });
|
|
382254
|
+
io.stdout(`Removed ${target2.displaySkillDir}
|
|
382197
382255
|
`);
|
|
382198
382256
|
removed += 1;
|
|
382199
382257
|
}
|
|
@@ -382203,12 +382261,8 @@ async function runUninstall(tokens, io) {
|
|
|
382203
382261
|
}
|
|
382204
382262
|
return 0;
|
|
382205
382263
|
}
|
|
382206
|
-
var SKILL_PATHS;
|
|
382207
382264
|
var init_uninstall = __esm(() => {
|
|
382208
|
-
|
|
382209
|
-
{ name: "Claude Code", path: ".claude/skills/superdoc" },
|
|
382210
|
-
{ name: "Codex", path: ".agents/skills/superdoc" }
|
|
382211
|
-
];
|
|
382265
|
+
init_skill_targets();
|
|
382212
382266
|
});
|
|
382213
382267
|
|
|
382214
382268
|
// src/host/session-pool.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.99",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
"@types/bun": "^1.3.8",
|
|
21
21
|
"@types/node": "22.19.2",
|
|
22
22
|
"typescript": "^5.9.2",
|
|
23
|
-
"@superdoc/document-api": "0.0.1",
|
|
24
23
|
"@superdoc/pm-adapter": "0.0.0",
|
|
25
|
-
"superdoc": "1.
|
|
26
|
-
"@superdoc/super-editor": "0.0.1"
|
|
24
|
+
"superdoc": "1.18.0",
|
|
25
|
+
"@superdoc/super-editor": "0.0.1",
|
|
26
|
+
"@superdoc/document-api": "0.0.1"
|
|
27
27
|
},
|
|
28
28
|
"module": "src/index.ts",
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.
|
|
34
|
-
"@superdoc-dev/cli-darwin-x64": "0.2.0-next.
|
|
35
|
-
"@superdoc-dev/cli-linux-x64": "0.2.0-next.
|
|
36
|
-
"@superdoc-dev/cli-
|
|
37
|
-
"@superdoc-dev/cli-
|
|
33
|
+
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.99",
|
|
34
|
+
"@superdoc-dev/cli-darwin-x64": "0.2.0-next.99",
|
|
35
|
+
"@superdoc-dev/cli-linux-x64": "0.2.0-next.99",
|
|
36
|
+
"@superdoc-dev/cli-linux-arm64": "0.2.0-next.99",
|
|
37
|
+
"@superdoc-dev/cli-windows-x64": "0.2.0-next.99"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"dev": "bun run src/index.ts",
|