@skaile/workspaces 0.44.0 → 0.46.0
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 +141 -0
- package/dist/{asset-feeds-EGSG4FUB.js → asset-feeds-DLRQWELS.js} +7 -7
- package/dist/{asset-feeds-EGSG4FUB.js.map → asset-feeds-DLRQWELS.js.map} +1 -1
- package/dist/asset-manager/index.js +7 -7
- package/dist/asset-manager/installer.js +6 -6
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/src/index.d.ts +47 -0
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/{chunk-VPXV2Z5E.js → chunk-3VBQJZYL.js} +6 -6
- package/dist/chunk-3VBQJZYL.js.map +1 -0
- package/dist/{chunk-LMRO2QNF.js → chunk-3VT2I7IA.js} +72 -5
- package/dist/chunk-3VT2I7IA.js.map +1 -0
- package/dist/{chunk-CVWA4RIK.js → chunk-4VPRAG35.js} +5 -5
- package/dist/{chunk-CVWA4RIK.js.map → chunk-4VPRAG35.js.map} +1 -1
- package/dist/{chunk-JUZLVRI4.js → chunk-CNP2FHRM.js} +84 -19
- package/dist/chunk-CNP2FHRM.js.map +1 -0
- package/dist/{chunk-RGPBEGP2.js → chunk-CU5Z7GH3.js} +6 -2
- package/dist/chunk-CU5Z7GH3.js.map +1 -0
- package/dist/{chunk-CBZEIFU4.js → chunk-DDR4OSSM.js} +3 -3
- package/dist/{chunk-CBZEIFU4.js.map → chunk-DDR4OSSM.js.map} +1 -1
- package/dist/{chunk-PCXU2CVW.js → chunk-FAALG3QN.js} +4 -4
- package/dist/{chunk-PCXU2CVW.js.map → chunk-FAALG3QN.js.map} +1 -1
- package/dist/{chunk-5LHPKVGR.js → chunk-FX4BDEUN.js} +126 -9
- package/dist/chunk-FX4BDEUN.js.map +1 -0
- package/dist/{chunk-BLGHFVXE.js → chunk-G3GODNHM.js} +66 -4
- package/dist/chunk-G3GODNHM.js.map +1 -0
- package/dist/{chunk-ETDXTGDF.js → chunk-HOEP5CJQ.js} +3 -3
- package/dist/{chunk-ETDXTGDF.js.map → chunk-HOEP5CJQ.js.map} +1 -1
- package/dist/{chunk-5FVJXQDP.js → chunk-JXHULIOA.js} +3 -3
- package/dist/{chunk-5FVJXQDP.js.map → chunk-JXHULIOA.js.map} +1 -1
- package/dist/{chunk-ZAEJ33Y6.js → chunk-LLOXWWB6.js} +5 -5
- package/dist/{chunk-ZAEJ33Y6.js.map → chunk-LLOXWWB6.js.map} +1 -1
- package/dist/{chunk-GM3BV6JK.js → chunk-P6HRQPXC.js} +2 -2
- package/dist/{chunk-GM3BV6JK.js.map → chunk-P6HRQPXC.js.map} +1 -1
- package/dist/{chunk-NHLXS2CH.js → chunk-PPSRBFYE.js} +2 -2
- package/dist/{chunk-NHLXS2CH.js.map → chunk-PPSRBFYE.js.map} +1 -1
- package/dist/{chunk-7NQXVBCQ.js → chunk-TKTXIAG5.js} +5 -5
- package/dist/{chunk-7NQXVBCQ.js.map → chunk-TKTXIAG5.js.map} +1 -1
- package/dist/{chunk-XUXVH3JK.js → chunk-WRBF34YE.js} +3 -3
- package/dist/{chunk-XUXVH3JK.js.map → chunk-WRBF34YE.js.map} +1 -1
- package/dist/{chunk-COSTF7QW.js → chunk-WTFJFW7F.js} +50 -12
- package/dist/chunk-WTFJFW7F.js.map +1 -0
- package/dist/{chunk-XF2BBX6P.js → chunk-Z3ZRI2AE.js} +3 -3
- package/dist/{chunk-XF2BBX6P.js.map → chunk-Z3ZRI2AE.js.map} +1 -1
- package/dist/cli/index.js +1039 -704
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +11 -4
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/npx.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/skailify-lib.d.ts +108 -0
- package/dist/cli/src/commands/skailify-lib.d.ts.map +1 -0
- package/dist/cli/src/commands/source.d.ts +17 -4
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/ensure-sources.d.ts.map +1 -1
- package/dist/connectors/config.js +4 -4
- package/dist/connectors/index.js +5 -5
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/conformance.d.ts +33 -0
- package/dist/core/src/conformance.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +3 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +24 -0
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/runtime-assets.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-NSDMTAWN.js → ensure-sources-KLCGXVE6.js} +12 -13
- package/dist/ensure-sources-KLCGXVE6.js.map +1 -0
- package/dist/factory-assets/connectors/deploy.js +5 -5
- package/dist/factory-assets/connectors/devserver.js +5 -5
- package/dist/factory-assets/connectors/flow/adapter.js +5 -5
- package/dist/factory-assets/connectors/flow/engine.js +3 -3
- package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
- package/dist/factory-assets/connectors/flow.js +5 -5
- package/dist/factory-assets/connectors/git/CONNECTOR.md +8 -0
- package/dist/factory-assets/connectors/git/driver.d.ts +33 -1
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +5 -5
- package/dist/factory-assets/connectors/gmail.js +5 -5
- package/dist/factory-assets/connectors/googledrive.js +5 -5
- package/dist/factory-assets/connectors/local.js +5 -5
- package/dist/factory-assets/connectors/mattermost.js +5 -5
- package/dist/factory-assets/connectors/memory.js +5 -5
- package/dist/factory-assets/connectors/minio.js +5 -5
- package/dist/factory-assets/connectors/postgres.js +5 -5
- package/dist/factory-assets/connectors/s3.js +5 -5
- package/dist/factory-assets/connectors/sharepoint.js +5 -5
- package/dist/factory-assets/connectors/sqlite.js +5 -5
- package/dist/factory-assets/connectors/static-server.js +5 -5
- package/dist/factory-assets/connectors/tunnel.js +5 -5
- package/dist/factory-assets/connectors/webdav.js +5 -5
- package/dist/factory-assets/connectors/xstate-store.js +5 -5
- package/dist/factory-assets/connectors/xstate.js +5 -5
- package/dist/factory-assets/skaile.manifest.yaml +3 -0
- package/dist/factory-assets/skills/skailify/SKILL.md +84 -0
- package/dist/{flows-WELXQ7IG.js → flows-PNDUCOJR.js} +3 -3
- package/dist/{flows-WELXQ7IG.js.map → flows-PNDUCOJR.js.map} +1 -1
- package/dist/library/index.js +6 -6
- package/dist/library/install.js +3 -3
- package/dist/{open-library-362BZ6OW.js → open-library-COHFCT4N.js} +9 -9
- package/dist/{open-library-362BZ6OW.js.map → open-library-COHFCT4N.js.map} +1 -1
- package/dist/{paths-4SSFMX5Z.js → paths-2SYXGTZJ.js} +6 -6
- package/dist/{paths-4SSFMX5Z.js.map → paths-2SYXGTZJ.js.map} +1 -1
- package/dist/{plugin-store-RBCDBO7K.js → plugin-store-UNENLB56.js} +5 -5
- package/dist/{plugin-store-RBCDBO7K.js.map → plugin-store-UNENLB56.js.map} +1 -1
- package/dist/runner/index.js +7 -7
- package/dist/runner/src/file-changed-coalescer.d.ts +48 -0
- package/dist/runner/src/file-changed-coalescer.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +7 -7
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +3 -3
- package/dist/sdk/index.js +7 -7
- package/dist/sdk/runner.js +7 -7
- package/dist/{setup-VGZTFQ32.js → setup-AYH6SR4U.js} +5 -5
- package/dist/{setup-VGZTFQ32.js.map → setup-AYH6SR4U.js.map} +1 -1
- package/dist/{store-client-XFZFKY3W.js → store-client-U4FMAIWX.js} +6 -6
- package/dist/{store-client-XFZFKY3W.js.map → store-client-U4FMAIWX.js.map} +1 -1
- package/dist/tui/index.js +7 -7
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/manifests/skill.d.ts +1 -0
- package/dist/types/src/manifests/skill.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5LHPKVGR.js.map +0 -1
- package/dist/chunk-BLGHFVXE.js.map +0 -1
- package/dist/chunk-COSTF7QW.js.map +0 -1
- package/dist/chunk-JUZLVRI4.js.map +0 -1
- package/dist/chunk-LMRO2QNF.js.map +0 -1
- package/dist/chunk-RGPBEGP2.js.map +0 -1
- package/dist/chunk-VPXV2Z5E.js.map +0 -1
- package/dist/ensure-sources-NSDMTAWN.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { decodeSkaileManifest, SKAILE_MANIFEST_FILENAME } from './chunk-DZCK7GRW.js';
|
|
2
2
|
import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMdContent } from './chunk-6IDBWPK2.js';
|
|
3
3
|
import { isValidAssetName, slugifyAssetName, parseAssetRef, assetRefToStr } from './chunk-GEEW6SY2.js';
|
|
4
|
-
import { existsSync, mkdirSync, renameSync, readdirSync, rmdirSync, readFileSync, writeFileSync, lstatSync, symlinkSync,
|
|
4
|
+
import { existsSync, mkdirSync, renameSync, readdirSync, rmdirSync, readFileSync, writeFileSync, rmSync, lstatSync, symlinkSync, cpSync } from 'fs';
|
|
5
5
|
import { homedir } from 'os';
|
|
6
6
|
import { join, dirname, resolve, relative, parse as parse$1, basename } from 'path';
|
|
7
7
|
import { parse, stringify } from 'yaml';
|
|
@@ -66,6 +66,22 @@ function getGlobalCacheDir() {
|
|
|
66
66
|
mergeLegacyEntriesInto(dir, join(home, "sources"), hasOwnGit);
|
|
67
67
|
return dir;
|
|
68
68
|
}
|
|
69
|
+
function sourceCacheKey(url) {
|
|
70
|
+
const trimmed = url.trim();
|
|
71
|
+
const normalized = trimmed.replace(/^git@([^:]+):/, "$1/").replace(/^[a-z][a-z0-9+.-]*:\/\//i, "").replace(/\.git$/i, "").replace(/\/+$/, "");
|
|
72
|
+
const m = /^([^/]+)\/([^/]+)\/([^/]+)$/.exec(normalized);
|
|
73
|
+
if (m) {
|
|
74
|
+
const [, host, owner, repo] = m;
|
|
75
|
+
return `${host.toLowerCase()}/${owner}/${repo}`;
|
|
76
|
+
}
|
|
77
|
+
return lastSegment(trimmed);
|
|
78
|
+
}
|
|
79
|
+
function lastSegment(url) {
|
|
80
|
+
return url.replace(/\.git$/i, "").replace(/\/+$/, "").split(/[/:]/).pop() || "source";
|
|
81
|
+
}
|
|
82
|
+
function sourceShortName(cacheKeyOrUrl) {
|
|
83
|
+
return sourceCacheKey(cacheKeyOrUrl).replace(/\/+$/, "").split("/").pop() || "source";
|
|
84
|
+
}
|
|
69
85
|
var GIT_ENV = { ...process.env, GIT_TERMINAL_PROMPT: "0" };
|
|
70
86
|
function cloneRepo(url, branch, dest) {
|
|
71
87
|
mkdirSync(dest, { recursive: true });
|
|
@@ -125,6 +141,20 @@ function checkoutPin(repoDir, pin) {
|
|
|
125
141
|
const r2 = spawnSync("git", ["-C", repoDir, "checkout", pin], { stdio: "pipe", env: GIT_ENV });
|
|
126
142
|
return r2.status === 0;
|
|
127
143
|
}
|
|
144
|
+
function getRepoRemoteUrl(repoDir) {
|
|
145
|
+
const r = spawnSync("git", ["-C", repoDir, "remote", "get-url", "origin"], {
|
|
146
|
+
encoding: "utf8",
|
|
147
|
+
stdio: "pipe",
|
|
148
|
+
env: GIT_ENV
|
|
149
|
+
});
|
|
150
|
+
return r.status === 0 ? r.stdout.trim() : null;
|
|
151
|
+
}
|
|
152
|
+
function remoteUrlMatches(repoDir, expectedUrl) {
|
|
153
|
+
if (!hasOwnGit(repoDir)) return true;
|
|
154
|
+
const actual = getRepoRemoteUrl(repoDir);
|
|
155
|
+
if (!actual) return true;
|
|
156
|
+
return sourceCacheKey(actual) === sourceCacheKey(expectedUrl);
|
|
157
|
+
}
|
|
128
158
|
function linksFile(projectDir) {
|
|
129
159
|
return join(projectDir, ".skaile", "links.yaml");
|
|
130
160
|
}
|
|
@@ -184,10 +214,14 @@ function resolveLinkedOverride(name, projectDir) {
|
|
|
184
214
|
function ensureLocalPathRepo(decl, reposDir, opts) {
|
|
185
215
|
const projectDir = opts?.projectDir ?? resolve(reposDir, "..");
|
|
186
216
|
const resolved = resolve(projectDir, decl.path);
|
|
187
|
-
if (existsSync(resolved))
|
|
217
|
+
if (existsSync(resolved)) {
|
|
218
|
+
if (!decl.url || remoteUrlMatches(resolved, decl.url)) return resolved;
|
|
219
|
+
rmSync(resolved, { recursive: true, force: true });
|
|
220
|
+
}
|
|
188
221
|
if (!decl.url) {
|
|
189
222
|
throw new Error(`Local repository path not found: ${decl.path} (resolved: ${resolved})`);
|
|
190
223
|
}
|
|
224
|
+
mkdirSync(dirname(resolved), { recursive: true });
|
|
191
225
|
if (!cloneRepo(decl.url, decl.branch ?? "main", resolved)) {
|
|
192
226
|
throw new Error(`Failed to clone ${decl.url} into ${resolved}`);
|
|
193
227
|
}
|
|
@@ -198,9 +232,12 @@ function ensureRemoteRepo(decl, name, reposDir, opts) {
|
|
|
198
232
|
const branch = decl.branch ?? "main";
|
|
199
233
|
const globalCache = getGlobalCacheDir();
|
|
200
234
|
const cacheDest = join(globalCache, name);
|
|
201
|
-
|
|
235
|
+
const cached = existsSync(join(cacheDest, ".git"));
|
|
236
|
+
if (cached && remoteUrlMatches(cacheDest, decl.url)) {
|
|
202
237
|
if (!opts?.pin) pullRepo(cacheDest, branch);
|
|
203
238
|
} else {
|
|
239
|
+
if (cached) rmSync(cacheDest, { recursive: true, force: true });
|
|
240
|
+
mkdirSync(dirname(cacheDest), { recursive: true });
|
|
204
241
|
if (!cloneRepo(decl.url, branch, cacheDest)) {
|
|
205
242
|
throw new Error(`Failed to clone ${decl.url} (branch: ${branch})`);
|
|
206
243
|
}
|
|
@@ -296,7 +333,10 @@ function resolveRepoDir(decl, name, reposDir, projectDir) {
|
|
|
296
333
|
const projectDest = join(reposDir, name);
|
|
297
334
|
if (existsSync(projectDest)) return projectDest;
|
|
298
335
|
const globalDest = join(getGlobalCacheDir(), name);
|
|
299
|
-
if (existsSync(join(globalDest, ".git")))
|
|
336
|
+
if (existsSync(join(globalDest, ".git"))) {
|
|
337
|
+
if (decl.url && !remoteUrlMatches(globalDest, decl.url)) return null;
|
|
338
|
+
return globalDest;
|
|
339
|
+
}
|
|
300
340
|
return null;
|
|
301
341
|
}
|
|
302
342
|
var CanonicalRefConflictError = class extends Error {
|
|
@@ -512,7 +552,8 @@ function checkRepoStatus(decl, name, reposDir, projectDir) {
|
|
|
512
552
|
};
|
|
513
553
|
if (decl.path) return base;
|
|
514
554
|
let dest = join(getGlobalCacheDir(), name);
|
|
515
|
-
|
|
555
|
+
const globalOk = existsSync(join(dest, ".git")) && (!decl.url || remoteUrlMatches(dest, decl.url));
|
|
556
|
+
if (!globalOk) {
|
|
516
557
|
dest = join(reposDir, name);
|
|
517
558
|
}
|
|
518
559
|
if (!existsSync(join(dest, ".git"))) {
|
|
@@ -1564,14 +1605,11 @@ function stageMaterializedSkills(projectDir, skillsDir, opts) {
|
|
|
1564
1605
|
}
|
|
1565
1606
|
return staged;
|
|
1566
1607
|
}
|
|
1567
|
-
function sourceSlug(url) {
|
|
1568
|
-
return url.replace(/\.git$/, "").split(/[/:]/).pop() ?? "source";
|
|
1569
|
-
}
|
|
1570
1608
|
function buildSourceClones(sources) {
|
|
1571
1609
|
const sourcesDir = getGlobalCacheDir();
|
|
1572
1610
|
const clones = [];
|
|
1573
1611
|
for (const s of sources) {
|
|
1574
|
-
const localPath = join(sourcesDir,
|
|
1612
|
+
const localPath = join(sourcesDir, sourceCacheKey(s.url));
|
|
1575
1613
|
if (!existsSync(localPath)) continue;
|
|
1576
1614
|
const commit = getRepoCommit(localPath) ?? "0".repeat(40);
|
|
1577
1615
|
clones.push({ localPath, sourceUrl: s.url, commit, tag: s.pin });
|
|
@@ -1714,6 +1752,6 @@ function resolveAgentDir(projectDir) {
|
|
|
1714
1752
|
return resolve(projectDir, definition);
|
|
1715
1753
|
}
|
|
1716
1754
|
|
|
1717
|
-
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
|
|
1718
|
-
//# sourceMappingURL=chunk-
|
|
1719
|
-
//# sourceMappingURL=chunk-
|
|
1755
|
+
export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, sourceCacheKey, sourceShortName, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
|
|
1756
|
+
//# sourceMappingURL=chunk-WTFJFW7F.js.map
|
|
1757
|
+
//# sourceMappingURL=chunk-WTFJFW7F.js.map
|