@skaile/workspaces 0.19.0 → 0.21.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 +46 -0
- package/dist/{asset-feeds-OFMOTPTX.js → asset-feeds-CI76R7FI.js} +5 -5
- package/dist/{asset-feeds-OFMOTPTX.js.map → asset-feeds-CI76R7FI.js.map} +1 -1
- package/dist/asset-manager/index.js +5 -5
- package/dist/asset-manager/installer.js +4 -4
- package/dist/base-assets/connectors/deploy.js +5 -5
- package/dist/base-assets/connectors/devserver.js +5 -5
- package/dist/base-assets/connectors/flow/adapter.js +5 -5
- package/dist/base-assets/connectors/flow/run-flow.js +6 -6
- package/dist/base-assets/connectors/flow.js +5 -5
- package/dist/base-assets/connectors/git.js +5 -5
- package/dist/base-assets/connectors/gmail.js +5 -5
- package/dist/base-assets/connectors/googledrive.js +5 -5
- package/dist/base-assets/connectors/local.js +5 -5
- package/dist/base-assets/connectors/mattermost.js +5 -5
- package/dist/base-assets/connectors/memory.js +5 -5
- package/dist/base-assets/connectors/minio.js +5 -5
- package/dist/base-assets/connectors/postgres.js +5 -5
- package/dist/base-assets/connectors/redis.js +5 -5
- package/dist/base-assets/connectors/s3.js +5 -5
- package/dist/base-assets/connectors/sharepoint.js +5 -5
- package/dist/base-assets/connectors/sqlite.js +5 -5
- package/dist/base-assets/connectors/static-server.js +5 -5
- package/dist/base-assets/connectors/tunnel.js +5 -5
- package/dist/base-assets/connectors/webdav.js +5 -5
- package/dist/base-assets/connectors/xstate-store.js +5 -5
- package/dist/base-assets/connectors/xstate.js +5 -5
- package/dist/base-assets/connectors/yjs.js +5 -5
- package/dist/{chunk-HS2FNSCF.js → chunk-2WVQMRIE.js} +5 -5
- package/dist/{chunk-HS2FNSCF.js.map → chunk-2WVQMRIE.js.map} +1 -1
- package/dist/{chunk-N2C3A5PS.js → chunk-5QNQLSBW.js} +276 -30
- package/dist/chunk-5QNQLSBW.js.map +1 -0
- package/dist/{chunk-YVX66WNQ.js → chunk-DEQ3OOTU.js} +6 -6
- package/dist/{chunk-YVX66WNQ.js.map → chunk-DEQ3OOTU.js.map} +1 -1
- package/dist/{chunk-WGPT6FV6.js → chunk-DFUXWNTS.js} +3 -3
- package/dist/{chunk-WGPT6FV6.js.map → chunk-DFUXWNTS.js.map} +1 -1
- package/dist/{chunk-GVBPAIGF.js → chunk-G4BR355S.js} +51 -8
- package/dist/chunk-G4BR355S.js.map +1 -0
- package/dist/{chunk-VMUQAISH.js → chunk-H45ANMIU.js} +3 -3
- package/dist/{chunk-VMUQAISH.js.map → chunk-H45ANMIU.js.map} +1 -1
- package/dist/{chunk-FVWBLAXL.js → chunk-KFDTS7RX.js} +3 -3
- package/dist/{chunk-FVWBLAXL.js.map → chunk-KFDTS7RX.js.map} +1 -1
- package/dist/{chunk-63Y7YN33.js → chunk-RDH4SSMH.js} +2 -2
- package/dist/{chunk-63Y7YN33.js.map → chunk-RDH4SSMH.js.map} +1 -1
- package/dist/{chunk-ATTIX7H2.js → chunk-W5DFC35Z.js} +3 -3
- package/dist/{chunk-ATTIX7H2.js.map → chunk-W5DFC35Z.js.map} +1 -1
- package/dist/{chunk-I7HGX4ZE.js → chunk-XAVM2BAJ.js} +4 -4
- package/dist/{chunk-I7HGX4ZE.js.map → chunk-XAVM2BAJ.js.map} +1 -1
- package/dist/{chunk-KIGZYGCM.js → chunk-XGWGLIHZ.js} +4 -4
- package/dist/{chunk-KIGZYGCM.js.map → chunk-XGWGLIHZ.js.map} +1 -1
- package/dist/cli/index.js +16 -16
- 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/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +69 -10
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/{ensure-sources-EU45HFKA.js → ensure-sources-IDVQ77NJ.js} +5 -5
- package/dist/{ensure-sources-EU45HFKA.js.map → ensure-sources-IDVQ77NJ.js.map} +1 -1
- package/dist/runner/index.js +7 -7
- package/dist/runner/src/recipe-resolver.d.ts +2 -0
- package/dist/runner/src/recipe-resolver.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +5 -5
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/index.js +7 -7
- package/dist/sdk/runner.js +7 -7
- package/dist/{setup-DT4VSWSM.js → setup-AIOLUTKV.js} +5 -5
- package/dist/{setup-DT4VSWSM.js.map → setup-AIOLUTKV.js.map} +1 -1
- package/dist/{store-client-TZ4L73TH.js → store-client-CYEH2GKC.js} +6 -6
- package/dist/{store-client-TZ4L73TH.js.map → store-client-CYEH2GKC.js.map} +1 -1
- package/dist/tui/index.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GVBPAIGF.js.map +0 -1
- package/dist/chunk-N2C3A5PS.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { scanDirectory } from './chunk-FRPKLIEZ.js';
|
|
1
|
+
import { scanDirectory, fromMcpServerMd } from './chunk-FRPKLIEZ.js';
|
|
2
2
|
import { parseAssetRef } from './chunk-37JKX6D7.js';
|
|
3
3
|
import { mkdirSync, existsSync, readFileSync, writeFileSync, lstatSync, symlinkSync, rmSync, readdirSync } from 'fs';
|
|
4
4
|
import { homedir } from 'os';
|
|
@@ -379,7 +379,7 @@ function saveSkWorkspaceConfig(dir, config, name) {
|
|
|
379
379
|
if (!existsSync(resolvedDir)) {
|
|
380
380
|
mkdirSync(resolvedDir, { recursive: true });
|
|
381
381
|
}
|
|
382
|
-
writeFileSync(filePath,
|
|
382
|
+
writeFileSync(filePath, encodeSkaileYaml(config));
|
|
383
383
|
return filePath;
|
|
384
384
|
}
|
|
385
385
|
function listSkWorkspaceConfigs(dir) {
|
|
@@ -521,21 +521,107 @@ function mergeSkWorkspaceConfigs(base, overlay) {
|
|
|
521
521
|
sources: dedupeByKey([...base.sources ?? [], ...overlay.sources ?? []], "name")
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
|
+
var KNOWN_DRIVERS = ["omp", "claude-sdk", "codex"];
|
|
525
|
+
var KNOWN_PROVIDERS = [
|
|
526
|
+
"anthropic",
|
|
527
|
+
"openai",
|
|
528
|
+
"google",
|
|
529
|
+
"mistral",
|
|
530
|
+
"groq",
|
|
531
|
+
"openrouter",
|
|
532
|
+
"deepseek",
|
|
533
|
+
"xai",
|
|
534
|
+
"together",
|
|
535
|
+
"fireworks",
|
|
536
|
+
"deepgram",
|
|
537
|
+
"elevenlabs"
|
|
538
|
+
];
|
|
539
|
+
var KNOWN_ACCESS = ["read-only", "read-write"];
|
|
540
|
+
var AGENT_PROFILE_FIELDS = [
|
|
541
|
+
"driver",
|
|
542
|
+
"provider",
|
|
543
|
+
"model",
|
|
544
|
+
"thinking",
|
|
545
|
+
"effort",
|
|
546
|
+
"skills_dir",
|
|
547
|
+
"agents_dir",
|
|
548
|
+
"prompts_dir"
|
|
549
|
+
];
|
|
550
|
+
function normalizeAgentConfig(raw) {
|
|
551
|
+
const looksFlat = AGENT_PROFILE_FIELDS.some((f) => typeof raw[f] === "string");
|
|
552
|
+
return looksFlat ? { profiles: { default: raw }, wrappedFlat: true } : { profiles: raw, wrappedFlat: false };
|
|
553
|
+
}
|
|
524
554
|
function normalizeConfig(raw) {
|
|
555
|
+
return normalizeConfigInternal(raw).config;
|
|
556
|
+
}
|
|
557
|
+
function normalizeConfigInternal(raw) {
|
|
525
558
|
const config = {};
|
|
559
|
+
const diagnostics = [];
|
|
526
560
|
if (raw.name) config.name = String(raw.name);
|
|
527
561
|
if (raw.description) config.description = String(raw.description);
|
|
528
|
-
|
|
562
|
+
let agentConfigRaw;
|
|
563
|
+
let agentConfigKey;
|
|
564
|
+
if (raw["agent-config"] !== void 0) {
|
|
565
|
+
agentConfigRaw = raw["agent-config"];
|
|
566
|
+
agentConfigKey = "agent-config";
|
|
567
|
+
} else if (raw.agent_config !== void 0) {
|
|
568
|
+
agentConfigRaw = raw.agent_config;
|
|
569
|
+
agentConfigKey = "agent_config";
|
|
570
|
+
} else if (raw.agentConfig !== void 0) {
|
|
571
|
+
agentConfigRaw = raw.agentConfig;
|
|
572
|
+
agentConfigKey = "agentConfig";
|
|
573
|
+
}
|
|
529
574
|
if (agentConfigRaw && typeof agentConfigRaw === "object" && !Array.isArray(agentConfigRaw)) {
|
|
530
|
-
|
|
575
|
+
if (agentConfigKey === "agentConfig") {
|
|
576
|
+
diagnostics.push({
|
|
577
|
+
code: "legacy_key_camelcase",
|
|
578
|
+
severity: "warning",
|
|
579
|
+
message: 'Non-canonical key "agentConfig" \u2014 use "agent-config".',
|
|
580
|
+
path: "agentConfig"
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
const { profiles, wrappedFlat } = normalizeAgentConfig(
|
|
584
|
+
agentConfigRaw
|
|
585
|
+
);
|
|
586
|
+
if (wrappedFlat) {
|
|
587
|
+
diagnostics.push({
|
|
588
|
+
code: "legacy_agent_config_flat",
|
|
589
|
+
severity: "warning",
|
|
590
|
+
message: 'Flat agent-config block wrapped as the "default" profile \u2014 nest fields under "default:".',
|
|
591
|
+
path: agentConfigKey
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
config.agent_config = profiles;
|
|
531
595
|
}
|
|
532
596
|
if (Array.isArray(raw.startup)) {
|
|
533
597
|
config.startup = raw.startup;
|
|
534
598
|
}
|
|
535
|
-
|
|
599
|
+
let aiResRaw;
|
|
600
|
+
let aiResKey;
|
|
601
|
+
if (raw.ai_resources !== void 0) {
|
|
602
|
+
aiResRaw = raw.ai_resources;
|
|
603
|
+
aiResKey = "ai_resources";
|
|
604
|
+
} else if (raw.aiResources !== void 0) {
|
|
605
|
+
aiResRaw = raw.aiResources;
|
|
606
|
+
aiResKey = "aiResources";
|
|
607
|
+
}
|
|
608
|
+
if (aiResKey === "aiResources") {
|
|
609
|
+
diagnostics.push({
|
|
610
|
+
code: "legacy_key_camelcase",
|
|
611
|
+
severity: "warning",
|
|
612
|
+
message: 'Non-canonical key "aiResources" \u2014 use "ai_resources".',
|
|
613
|
+
path: "aiResources"
|
|
614
|
+
});
|
|
615
|
+
}
|
|
536
616
|
if (Array.isArray(aiResRaw)) {
|
|
537
617
|
config.ai_resources = aiResRaw;
|
|
538
618
|
} else if (aiResRaw && typeof aiResRaw === "object") {
|
|
619
|
+
diagnostics.push({
|
|
620
|
+
code: "legacy_ai_resources_object",
|
|
621
|
+
severity: "warning",
|
|
622
|
+
message: "Legacy ai_resources object form ({sources, requires}) \u2014 use an array of {name, path, dependencies}.",
|
|
623
|
+
path: aiResKey
|
|
624
|
+
});
|
|
539
625
|
const old = aiResRaw;
|
|
540
626
|
const sources = Array.isArray(old.sources) ? old.sources : [];
|
|
541
627
|
const requires = Array.isArray(old.requires) ? old.requires.filter(Boolean) : [];
|
|
@@ -565,6 +651,12 @@ function normalizeConfig(raw) {
|
|
|
565
651
|
if (raw.secrets && typeof raw.secrets === "object") {
|
|
566
652
|
config.secrets = raw.secrets;
|
|
567
653
|
}
|
|
654
|
+
if (raw.compaction && typeof raw.compaction === "object" && !Array.isArray(raw.compaction)) {
|
|
655
|
+
config.compaction = raw.compaction;
|
|
656
|
+
}
|
|
657
|
+
if (raw.patches && typeof raw.patches === "object" && !Array.isArray(raw.patches)) {
|
|
658
|
+
config.patches = raw.patches;
|
|
659
|
+
}
|
|
568
660
|
if (Array.isArray(raw.dependencies)) {
|
|
569
661
|
config.dependencies = raw.dependencies.filter((d) => typeof d === "string");
|
|
570
662
|
}
|
|
@@ -585,7 +677,110 @@ function normalizeConfig(raw) {
|
|
|
585
677
|
if (raw.telemetry && typeof raw.telemetry === "object" && !Array.isArray(raw.telemetry)) {
|
|
586
678
|
config.telemetry = raw.telemetry;
|
|
587
679
|
}
|
|
588
|
-
return config;
|
|
680
|
+
return { config, diagnostics };
|
|
681
|
+
}
|
|
682
|
+
function decodeSkaileYaml(text) {
|
|
683
|
+
let parsed;
|
|
684
|
+
try {
|
|
685
|
+
parsed = parse(text) ?? {};
|
|
686
|
+
} catch (err) {
|
|
687
|
+
return {
|
|
688
|
+
config: {},
|
|
689
|
+
diagnostics: [
|
|
690
|
+
{
|
|
691
|
+
code: "yaml_syntax",
|
|
692
|
+
severity: "error",
|
|
693
|
+
message: `Invalid YAML: ${err instanceof Error ? err.message : String(err)}`
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
699
|
+
return {
|
|
700
|
+
config: {},
|
|
701
|
+
diagnostics: [
|
|
702
|
+
{
|
|
703
|
+
code: "non_object_root",
|
|
704
|
+
severity: "error",
|
|
705
|
+
message: "skaile.yaml must be a mapping at the top level."
|
|
706
|
+
}
|
|
707
|
+
]
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
const result = normalizeConfigInternal(parsed);
|
|
711
|
+
validateConfigValues(result.config, result.diagnostics);
|
|
712
|
+
return result;
|
|
713
|
+
}
|
|
714
|
+
function encodeSkaileYaml(config) {
|
|
715
|
+
return stringify(toCanonicalObject(config), { lineWidth: 120 });
|
|
716
|
+
}
|
|
717
|
+
function validateConfigValues(config, diagnostics) {
|
|
718
|
+
for (const [profile, p] of Object.entries(config.agent_config ?? {})) {
|
|
719
|
+
if (p?.driver && !KNOWN_DRIVERS.includes(p.driver)) {
|
|
720
|
+
diagnostics.push({
|
|
721
|
+
code: "unknown_driver",
|
|
722
|
+
severity: "warning",
|
|
723
|
+
message: `Unknown driver "${p.driver}" \u2014 expected one of: ${KNOWN_DRIVERS.join(", ")}.`,
|
|
724
|
+
path: `agent-config.${profile}.driver`
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
if (p?.provider && !KNOWN_PROVIDERS.includes(p.provider)) {
|
|
728
|
+
diagnostics.push({
|
|
729
|
+
code: "unknown_provider",
|
|
730
|
+
severity: "warning",
|
|
731
|
+
message: `Unknown provider "${p.provider}" \u2014 expected one of: ${KNOWN_PROVIDERS.join(", ")}.`,
|
|
732
|
+
path: `agent-config.${profile}.provider`
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
const checkAccess = (access, path) => {
|
|
737
|
+
if (access && !KNOWN_ACCESS.includes(access)) {
|
|
738
|
+
diagnostics.push({
|
|
739
|
+
code: "unknown_access",
|
|
740
|
+
severity: "warning",
|
|
741
|
+
message: `Unknown access "${access}" \u2014 expected "read-only" or "read-write".`,
|
|
742
|
+
path
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
for (const c of config.connectors ?? []) checkAccess(c.access, `connectors.${c.id}.access`);
|
|
747
|
+
for (const m of config.mounts ?? []) checkAccess(m.access, `mounts.${m.id}.access`);
|
|
748
|
+
}
|
|
749
|
+
var CANONICAL_KEY_ORDER = [
|
|
750
|
+
"name",
|
|
751
|
+
"description",
|
|
752
|
+
"agent_config",
|
|
753
|
+
"dependencies",
|
|
754
|
+
"sources",
|
|
755
|
+
"startup",
|
|
756
|
+
"ai_resources",
|
|
757
|
+
"connectors",
|
|
758
|
+
"mcp_servers",
|
|
759
|
+
"mounts",
|
|
760
|
+
"agent",
|
|
761
|
+
"workspace",
|
|
762
|
+
"secrets",
|
|
763
|
+
"telemetry",
|
|
764
|
+
"compaction",
|
|
765
|
+
"patches",
|
|
766
|
+
"repositories"
|
|
767
|
+
];
|
|
768
|
+
var CONFIG_KEY_TO_YAML = {
|
|
769
|
+
agent_config: "agent-config"
|
|
770
|
+
};
|
|
771
|
+
function toCanonicalObject(config) {
|
|
772
|
+
const out = {};
|
|
773
|
+
const emit = (key) => {
|
|
774
|
+
const value = config[key];
|
|
775
|
+
if (value === void 0) return;
|
|
776
|
+
out[CONFIG_KEY_TO_YAML[key] ?? key] = value;
|
|
777
|
+
};
|
|
778
|
+
for (const key of CANONICAL_KEY_ORDER) emit(key);
|
|
779
|
+
for (const key of Object.keys(config)) {
|
|
780
|
+
if (CANONICAL_KEY_ORDER.includes(key)) continue;
|
|
781
|
+
emit(key);
|
|
782
|
+
}
|
|
783
|
+
return out;
|
|
589
784
|
}
|
|
590
785
|
function parseConfigFile(filePath, name) {
|
|
591
786
|
let raw;
|
|
@@ -594,14 +789,9 @@ function parseConfigFile(filePath, name) {
|
|
|
594
789
|
} catch {
|
|
595
790
|
return null;
|
|
596
791
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
} catch {
|
|
601
|
-
return null;
|
|
602
|
-
}
|
|
603
|
-
const config = normalizeConfig(parsed);
|
|
604
|
-
return { path: filePath, name, config };
|
|
792
|
+
const { config, diagnostics } = decodeSkaileYaml(raw);
|
|
793
|
+
if (diagnostics.some((d) => d.code === "yaml_syntax")) return null;
|
|
794
|
+
return { path: filePath, name, config, diagnostics };
|
|
605
795
|
}
|
|
606
796
|
function dedupe(arr) {
|
|
607
797
|
return [...new Set(arr)];
|
|
@@ -675,9 +865,60 @@ function mergeMcpDeclarations(base, overlay) {
|
|
|
675
865
|
recipe: overlay.recipe ?? base.recipe
|
|
676
866
|
};
|
|
677
867
|
}
|
|
868
|
+
function loadMaterializedMcpDeclarations(projectDir) {
|
|
869
|
+
const dir = join(projectDir, ".skaile/assets/mcp-server");
|
|
870
|
+
if (!existsSync(dir)) return [];
|
|
871
|
+
const result = [];
|
|
872
|
+
let subdirs;
|
|
873
|
+
try {
|
|
874
|
+
subdirs = readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
875
|
+
} catch {
|
|
876
|
+
return [];
|
|
877
|
+
}
|
|
878
|
+
for (const name of subdirs) {
|
|
879
|
+
const subDir = join(dir, name);
|
|
880
|
+
const mdPath = join(subDir, "MCP.md");
|
|
881
|
+
if (!existsSync(mdPath)) continue;
|
|
882
|
+
try {
|
|
883
|
+
const entry = fromMcpServerMd(mdPath, name);
|
|
884
|
+
const decl = mcpDeclFromCatalogEntry(entry);
|
|
885
|
+
if (!decl) continue;
|
|
886
|
+
decl.id = entry.name || name;
|
|
887
|
+
const instancePath = join(subDir, ".instance.json");
|
|
888
|
+
if (existsSync(instancePath)) {
|
|
889
|
+
try {
|
|
890
|
+
const instance = JSON.parse(readFileSync(instancePath, "utf8"));
|
|
891
|
+
const env = { ...decl.env ?? {} };
|
|
892
|
+
if (instance.config && typeof instance.config === "object") {
|
|
893
|
+
for (const [k, v] of Object.entries(instance.config)) {
|
|
894
|
+
if (typeof v === "string") env[k] = v;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
if (instance.resolvedSecrets && typeof instance.resolvedSecrets === "object") {
|
|
898
|
+
for (const [k, v] of Object.entries(instance.resolvedSecrets)) {
|
|
899
|
+
if (typeof v === "string") env[k] = v;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
if (Object.keys(env).length > 0) decl.env = env;
|
|
903
|
+
} catch (err) {
|
|
904
|
+
console.warn(
|
|
905
|
+
`[workspace-config] loadMaterializedMcpDeclarations: ignoring malformed ".instance.json" for "${name}": ${err instanceof Error ? err.message : String(err)}`
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
result.push(decl);
|
|
910
|
+
} catch (err) {
|
|
911
|
+
console.warn(
|
|
912
|
+
`[workspace-config] loadMaterializedMcpDeclarations: failed to load "${mdPath}": ${err instanceof Error ? err.message : String(err)}`
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
return result;
|
|
917
|
+
}
|
|
678
918
|
function loadMcpServerDeclarations(projectDir) {
|
|
679
919
|
const config = resolveSkWorkspaceConfig(projectDir);
|
|
680
920
|
const explicit = config.mcp_servers ?? [];
|
|
921
|
+
const materialized = loadMaterializedMcpDeclarations(projectDir);
|
|
681
922
|
const mcpRefStrings = [];
|
|
682
923
|
for (const dep of config.dependencies ?? []) {
|
|
683
924
|
const ref = parseAssetRef(dep);
|
|
@@ -689,7 +930,6 @@ function loadMcpServerDeclarations(projectDir) {
|
|
|
689
930
|
if (ref.kind === "mcp-server") mcpRefStrings.push(dep);
|
|
690
931
|
}
|
|
691
932
|
}
|
|
692
|
-
if (mcpRefStrings.length === 0) return explicit;
|
|
693
933
|
const repositories = config.repositories ?? {};
|
|
694
934
|
const allRepos = { ...repositories };
|
|
695
935
|
for (const res of config.ai_resources ?? []) {
|
|
@@ -702,8 +942,17 @@ function loadMcpServerDeclarations(projectDir) {
|
|
|
702
942
|
}
|
|
703
943
|
}
|
|
704
944
|
const reposDir = getGlobalCacheDir();
|
|
705
|
-
const
|
|
706
|
-
const
|
|
945
|
+
const byId = /* @__PURE__ */ new Map();
|
|
946
|
+
const order = [];
|
|
947
|
+
const upsert = (decl) => {
|
|
948
|
+
const existing = byId.get(decl.id);
|
|
949
|
+
if (existing) {
|
|
950
|
+
byId.set(decl.id, mergeMcpDeclarations(existing, decl));
|
|
951
|
+
} else {
|
|
952
|
+
byId.set(decl.id, decl);
|
|
953
|
+
order.push(decl.id);
|
|
954
|
+
}
|
|
955
|
+
};
|
|
707
956
|
const seen = /* @__PURE__ */ new Set();
|
|
708
957
|
for (const refStr of mcpRefStrings) {
|
|
709
958
|
const ref = parseAssetRef(refStr);
|
|
@@ -713,18 +962,15 @@ function loadMcpServerDeclarations(projectDir) {
|
|
|
713
962
|
if (!entry) continue;
|
|
714
963
|
const catalogDecl = mcpDeclFromCatalogEntry(entry);
|
|
715
964
|
if (!catalogDecl) continue;
|
|
716
|
-
|
|
717
|
-
if (override) {
|
|
718
|
-
explicitById.delete(entry.name);
|
|
719
|
-
result.push(mergeMcpDeclarations(catalogDecl, override));
|
|
720
|
-
} else {
|
|
721
|
-
result.push(catalogDecl);
|
|
722
|
-
}
|
|
965
|
+
upsert(catalogDecl);
|
|
723
966
|
}
|
|
724
|
-
for (const decl of
|
|
725
|
-
|
|
967
|
+
for (const decl of materialized) {
|
|
968
|
+
upsert(decl);
|
|
726
969
|
}
|
|
727
|
-
|
|
970
|
+
for (const decl of explicit) {
|
|
971
|
+
upsert(decl);
|
|
972
|
+
}
|
|
973
|
+
return order.map((id) => byId.get(id));
|
|
728
974
|
}
|
|
729
975
|
function findAiAssetsDir(from) {
|
|
730
976
|
let dir = resolve(from);
|
|
@@ -758,6 +1004,6 @@ function resolveAgentDir(projectDir) {
|
|
|
758
1004
|
return resolve(projectDir, definition);
|
|
759
1005
|
}
|
|
760
1006
|
|
|
761
|
-
export { COMPACTION_DEFAULTS, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, checkRepoStatus, checkoutPin, cloneRepo, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeSkWorkspaceConfigs, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, unlinkRepo, validateAssetRecipeAttr, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
|
|
762
|
-
//# sourceMappingURL=chunk-
|
|
763
|
-
//# sourceMappingURL=chunk-
|
|
1007
|
+
export { COMPACTION_DEFAULTS, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeSkWorkspaceConfigs, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, unlinkRepo, validateAssetRecipeAttr, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
|
|
1008
|
+
//# sourceMappingURL=chunk-5QNQLSBW.js.map
|
|
1009
|
+
//# sourceMappingURL=chunk-5QNQLSBW.js.map
|