@mcpc-tech/cli 0.1.1-beta.1 → 0.1.2
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 +38 -6
- package/app.mjs +4269 -0
- package/{src/bin.mjs → bin.mjs} +1753 -678
- package/index.mjs +4483 -0
- package/package.json +28 -23
- package/server.mjs +4470 -0
- package/types/src/app.d.ts.map +1 -1
- package/types/src/config/loader.d.ts +69 -0
- package/types/src/config/loader.d.ts.map +1 -0
package/types/src/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW,4BAAwC;AAG5D,cAAc,mBAAmB,0BAA0D;AAC3F,cAAc,UAAU,6BAA6B;AAErD,OAAO,cAAM,eACX,SAAS,eACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW,4BAAwC;AAG5D,cAAc,mBAAmB,0BAA0D;AAC3F,cAAc,UAAU,6BAA6B;AAErD,OAAO,cAAM,eACX,SAAS,eACR,QAAQ,qBA8BT;AAEF,OAAO,cAAM,iBAAgB,YAO3B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** Configuration Loader for MCPC CLI
|
|
2
|
+
*
|
|
3
|
+
* This module provides utilities to load MCPC configuration from command-line arguments,
|
|
4
|
+
* environment variables, or files.
|
|
5
|
+
*
|
|
6
|
+
* Command-line arguments:
|
|
7
|
+
* - `--config <json>` - Inline JSON configuration string
|
|
8
|
+
* - `--config-url <url>` - Fetch configuration from URL (e.g., GitHub raw)
|
|
9
|
+
* - `--config-file <path>` - Path to configuration file
|
|
10
|
+
* - No arguments - Uses ./mcpc.config.json if available
|
|
11
|
+
*
|
|
12
|
+
* Environment variables:
|
|
13
|
+
* - `MCPC_CONFIG` - Inline JSON configuration string (same as --config)
|
|
14
|
+
* - `MCPC_CONFIG_URL` - URL to fetch configuration from (same as --config-url)
|
|
15
|
+
* - `MCPC_CONFIG_FILE` - Path to configuration file (same as --config-file)
|
|
16
|
+
*
|
|
17
|
+
* Priority order:
|
|
18
|
+
* 1. --config (inline JSON)
|
|
19
|
+
* 2. MCPC_CONFIG environment variable
|
|
20
|
+
* 3. --config-url or MCPC_CONFIG_URL
|
|
21
|
+
* 4. --config-file or MCPC_CONFIG_FILE
|
|
22
|
+
* 5. ./mcpc.config.json (default)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```bash
|
|
26
|
+
* # Inline JSON config
|
|
27
|
+
* deno run --allow-all src/bin.ts --config '[{"name":"my-agent","description":"..."}]'
|
|
28
|
+
*
|
|
29
|
+
* # Using environment variable
|
|
30
|
+
* export MCPC_CONFIG='[{"name":"my-agent","description":"..."}]'
|
|
31
|
+
* deno run --allow-all src/bin.ts
|
|
32
|
+
*
|
|
33
|
+
* # From URL
|
|
34
|
+
* deno run --allow-all src/bin.ts --config-url https://example.com/config.json
|
|
35
|
+
*
|
|
36
|
+
* # From file
|
|
37
|
+
* deno run --allow-all src/bin.ts --config-file ./my-config.json
|
|
38
|
+
*
|
|
39
|
+
* # Default (uses ./mcpc.config.json)
|
|
40
|
+
* deno run --allow-all src/bin.ts
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @module
|
|
44
|
+
*/ import type { ComposeDefinition } from "@jsr/mcpc__core";
|
|
45
|
+
export interface MCPCConfig {
|
|
46
|
+
/**
|
|
47
|
+
* Server name
|
|
48
|
+
*/ name?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Server version
|
|
51
|
+
*/ version?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Server capabilities
|
|
54
|
+
*/ capabilities?: {
|
|
55
|
+
tools?: Record<string, unknown>;
|
|
56
|
+
sampling?: Record<string, unknown>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Agent composition definitions
|
|
60
|
+
*/ agents: ComposeDefinition[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Load configuration from command-line arguments, environment variables, or default file
|
|
64
|
+
* @returns Configuration object or null if no configuration found
|
|
65
|
+
*/ export declare function loadConfig(): Promise<MCPCConfig | null>;
|
|
66
|
+
/**
|
|
67
|
+
* Validate configuration structure
|
|
68
|
+
*/ export declare function validateConfig(config: MCPCConfig): void;
|
|
69
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sources":["../../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GAED,cAAc,iBAAiB,0BAAuC;AAKtE,iBAAiB;EACf;;GAEC,GACD,OAAO,MAAM;EACb;;GAEC,GACD,UAAU,MAAM;EAChB;;GAEC,GACD;IACE,QAAQ,OAAO,MAAM,EAAE,OAAO;IAC9B,WAAW,OAAO,MAAM,EAAE,OAAO;;EAEnC;;GAEC,GACD,QAAQ;;AAwHV;;;CAGC,GACD,OAAO,iBAAe,cAAc,QAAQ,aAAa,IAAI;AAoK7D;;CAEC,GACD,OAAO,iBAAS,eAAe,QAAQ,UAAU,GAAG,IAAI"}
|