dingtalk-workspace-cli 1.0.32 → 1.0.33
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/assets/dws-darwin-amd64.tar.gz +0 -0
- package/assets/dws-darwin-arm64.tar.gz +0 -0
- package/assets/dws-linux-amd64.tar.gz +0 -0
- package/assets/dws-linux-arm64.tar.gz +0 -0
- package/assets/dws-skills.zip +0 -0
- package/assets/dws-windows-amd64.zip +0 -0
- package/assets/dws-windows-arm64.zip +0 -0
- package/install.js +36 -3
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/dws-skills.zip
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/install.js
CHANGED
|
@@ -136,11 +136,36 @@ function installSkillsToHomes(skillRoot) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
// cacheUserSkills copies the mono and multi trees out of the freshly extracted
|
|
140
|
+
// dws-skills.zip into ~/.dws/skills/{mono,multi}/ so that `dws skill setup`
|
|
141
|
+
// can fall back to a user-local cache when --source is not provided. mono is
|
|
142
|
+
// already installed into agent homes by installSkillsToHomes; the cache is
|
|
143
|
+
// purely a source-of-truth for the setup command.
|
|
144
|
+
function cacheUserSkills(extractedSkillsRoot) {
|
|
145
|
+
const cacheBase = path.join(os.homedir(), ".dws", "skills");
|
|
146
|
+
|
|
147
|
+
const monoSource = fs.existsSync(path.join(extractedSkillsRoot, "mono", "SKILL.md"))
|
|
148
|
+
? path.join(extractedSkillsRoot, "mono")
|
|
149
|
+
: extractedSkillsRoot;
|
|
150
|
+
const monoCache = path.join(cacheBase, "mono");
|
|
151
|
+
fs.rmSync(monoCache, { recursive: true, force: true });
|
|
152
|
+
copyChildren(monoSource, monoCache);
|
|
153
|
+
|
|
154
|
+
const multiSource = path.join(extractedSkillsRoot, "multi");
|
|
155
|
+
if (fs.existsSync(multiSource) && fs.statSync(multiSource).isDirectory()) {
|
|
156
|
+
const multiCache = path.join(cacheBase, "multi");
|
|
157
|
+
fs.rmSync(multiCache, { recursive: true, force: true });
|
|
158
|
+
copyChildren(multiSource, multiCache);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
139
162
|
function main() {
|
|
140
163
|
const packageRoot = __dirname;
|
|
141
164
|
const assetsDir = path.join(packageRoot, "assets");
|
|
142
165
|
const vendorDir = path.join(packageRoot, "vendor");
|
|
143
|
-
|
|
166
|
+
// Extract dws-skills.zip into a staging directory so we can split mono/
|
|
167
|
+
// (installed to agent homes) from multi/ (cached for later setup use).
|
|
168
|
+
const skillsStaging = path.join(packageRoot, "share", "skills");
|
|
144
169
|
const assetName = PLATFORM_MAP[`${process.platform}-${process.arch}`];
|
|
145
170
|
if (!assetName) {
|
|
146
171
|
throw new Error(`unsupported platform: ${process.platform}/${process.arch}`);
|
|
@@ -156,8 +181,16 @@ function main() {
|
|
|
156
181
|
}
|
|
157
182
|
|
|
158
183
|
extractArchive(archivePath, vendorDir);
|
|
159
|
-
extractSkills(skillsPath,
|
|
160
|
-
|
|
184
|
+
extractSkills(skillsPath, skillsStaging);
|
|
185
|
+
|
|
186
|
+
// For backward compatibility, the zip root carries a copy of mono content
|
|
187
|
+
// (SKILL.md + references/ + scripts/). Prefer the explicit mono/ subdir
|
|
188
|
+
// when present; fall back to the staging root otherwise.
|
|
189
|
+
const monoRoot = fs.existsSync(path.join(skillsStaging, "mono", "SKILL.md"))
|
|
190
|
+
? path.join(skillsStaging, "mono")
|
|
191
|
+
: skillsStaging;
|
|
192
|
+
installSkillsToHomes(monoRoot);
|
|
193
|
+
cacheUserSkills(skillsStaging);
|
|
161
194
|
}
|
|
162
195
|
|
|
163
196
|
main();
|