cmx-core 0.2.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/README.md +66 -0
- package/dist/checksum.d.ts +14 -0
- package/dist/checksum.js +53 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +45 -0
- package/dist/frontmatter.d.ts +3 -0
- package/dist/frontmatter.js +105 -0
- package/dist/gateway.d.ts +34 -0
- package/dist/gateway.js +53 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/json-file.d.ts +4 -0
- package/dist/json-file.js +33 -0
- package/dist/lockfile.d.ts +8 -0
- package/dist/lockfile.js +33 -0
- package/dist/paths.d.ts +26 -0
- package/dist/paths.js +84 -0
- package/dist/platform.d.ts +10 -0
- package/dist/platform.js +137 -0
- package/dist/skill-fs.d.ts +9 -0
- package/dist/skill-fs.js +23 -0
- package/dist/skill-installer.d.ts +113 -0
- package/dist/skill-installer.js +348 -0
- package/dist/targets.d.ts +9 -0
- package/dist/targets.js +23 -0
- package/dist/types.d.ts +54 -0
- package/dist/types.js +30 -0
- package/package.json +51 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const INSTALL_SCOPES: readonly ["global", "local"];
|
|
2
|
+
export type InstallScope = (typeof INSTALL_SCOPES)[number];
|
|
3
|
+
export declare const ARTIFACT_KINDS: readonly ["agent", "skill"];
|
|
4
|
+
export type ArtifactKind = (typeof ARTIFACT_KINDS)[number];
|
|
5
|
+
export declare const SOURCE_TYPES: readonly ["local", "git"];
|
|
6
|
+
export type SourceType = (typeof SOURCE_TYPES)[number];
|
|
7
|
+
export interface LockSource {
|
|
8
|
+
repo: string;
|
|
9
|
+
path: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LockEntry {
|
|
12
|
+
type: ArtifactKind;
|
|
13
|
+
version?: string;
|
|
14
|
+
installed_at: string;
|
|
15
|
+
source: LockSource;
|
|
16
|
+
source_checksum: string;
|
|
17
|
+
installed_checksum: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LockFile {
|
|
20
|
+
version: number;
|
|
21
|
+
packages: Record<string, LockEntry>;
|
|
22
|
+
}
|
|
23
|
+
export interface SourceEntry {
|
|
24
|
+
type: SourceType;
|
|
25
|
+
path?: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
local_clone?: string;
|
|
28
|
+
branch?: string;
|
|
29
|
+
last_updated?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SourcesFile {
|
|
32
|
+
version: number;
|
|
33
|
+
sources: Record<string, SourceEntry>;
|
|
34
|
+
}
|
|
35
|
+
export declare const LLM_GATEWAY_TYPES: readonly ["openai", "ollama"];
|
|
36
|
+
export type LlmGatewayType = (typeof LLM_GATEWAY_TYPES)[number];
|
|
37
|
+
export interface LlmConfig {
|
|
38
|
+
gateway: LlmGatewayType;
|
|
39
|
+
model: string;
|
|
40
|
+
}
|
|
41
|
+
export interface CmxConfig {
|
|
42
|
+
version: number;
|
|
43
|
+
llm: LlmConfig;
|
|
44
|
+
home?: string;
|
|
45
|
+
external: string[];
|
|
46
|
+
platforms: string[];
|
|
47
|
+
}
|
|
48
|
+
export declare const defaultLlmConfig: () => LlmConfig;
|
|
49
|
+
export declare const defaultCmxConfig: () => CmxConfig;
|
|
50
|
+
export declare const defaultSourcesFile: () => SourcesFile;
|
|
51
|
+
export declare const defaultLockFile: () => LockFile;
|
|
52
|
+
export declare const scopeLabel: (scope: InstallScope) => InstallScope;
|
|
53
|
+
export declare const isLocalScope: (scope: InstallScope) => boolean;
|
|
54
|
+
export declare const installedArtifactPath: (kind: ArtifactKind, name: string, dir: string, agentExtension: string) => string;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const INSTALL_SCOPES = ["global", "local"];
|
|
2
|
+
export const ARTIFACT_KINDS = ["agent", "skill"];
|
|
3
|
+
export const SOURCE_TYPES = ["local", "git"];
|
|
4
|
+
export const LLM_GATEWAY_TYPES = ["openai", "ollama"];
|
|
5
|
+
export const defaultLlmConfig = () => ({
|
|
6
|
+
gateway: "openai",
|
|
7
|
+
model: "gpt-5.4",
|
|
8
|
+
});
|
|
9
|
+
export const defaultCmxConfig = () => ({
|
|
10
|
+
version: 1,
|
|
11
|
+
llm: defaultLlmConfig(),
|
|
12
|
+
external: [],
|
|
13
|
+
platforms: [],
|
|
14
|
+
});
|
|
15
|
+
export const defaultSourcesFile = () => ({
|
|
16
|
+
version: 1,
|
|
17
|
+
sources: {},
|
|
18
|
+
});
|
|
19
|
+
export const defaultLockFile = () => ({
|
|
20
|
+
version: 1,
|
|
21
|
+
packages: {},
|
|
22
|
+
});
|
|
23
|
+
export const scopeLabel = (scope) => scope;
|
|
24
|
+
export const isLocalScope = (scope) => scope === "local";
|
|
25
|
+
export const installedArtifactPath = (kind, name, dir, agentExtension) => {
|
|
26
|
+
if (kind === "skill") {
|
|
27
|
+
return `${dir}/${name}`;
|
|
28
|
+
}
|
|
29
|
+
return `${dir}/${name}.${agentExtension}`;
|
|
30
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cmx-core",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Embeddable core for installing agent skills across platforms — the TypeScript port of cmx-core.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/svetzal/context-mixer2.git",
|
|
10
|
+
"directory": "cmx-core-ts"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"agent",
|
|
14
|
+
"skills",
|
|
15
|
+
"cli",
|
|
16
|
+
"install",
|
|
17
|
+
"claude",
|
|
18
|
+
"cmx"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p tsconfig.build.json && bun run scripts/fix-dist-dts.ts",
|
|
35
|
+
"test": "bun test",
|
|
36
|
+
"typecheck": "bunx tsc --noEmit",
|
|
37
|
+
"lint": "bunx biome check .",
|
|
38
|
+
"format": "bunx biome check --write .",
|
|
39
|
+
"prepack": "bun run build"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@biomejs/biome": "^2.5.2",
|
|
43
|
+
"@types/bun": "^1.3.14",
|
|
44
|
+
"@types/node": "^26.1.0",
|
|
45
|
+
"@types/semver": "^7.7.1",
|
|
46
|
+
"typescript": "^6.0.3"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"semver": "^7.7.3"
|
|
50
|
+
}
|
|
51
|
+
}
|