@cosyte/cli 0.0.6 → 0.1.1
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 +326 -2
- package/README.md +118 -53
- package/dist/bin/cosyte-mcp.cjs +461 -106
- package/dist/bin/cosyte-mcp.cjs.map +1 -1
- package/dist/bin/cosyte-mcp.mjs +461 -106
- package/dist/bin/cosyte-mcp.mjs.map +1 -1
- package/dist/bin/cosyte.cjs +824 -140
- package/dist/bin/cosyte.cjs.map +1 -1
- package/dist/bin/cosyte.mjs +825 -141
- package/dist/bin/cosyte.mjs.map +1 -1
- package/dist/index.cjs +592 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +515 -281
- package/dist/index.d.ts +515 -281
- package/dist/index.mjs +574 -104
- package/dist/index.mjs.map +1 -1
- package/dist/io-C9bSG2zF.d.cts +381 -0
- package/dist/io-C9bSG2zF.d.ts +381 -0
- package/dist/mcp.cjs +435 -103
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.cts +70 -9
- package/dist/mcp.d.ts +70 -9
- package/dist/mcp.mjs +435 -103
- package/dist/mcp.mjs.map +1 -1
- package/package.json +30 -15
- package/dist/io-B2EobRzC.d.cts +0 -57
- package/dist/io-B2EobRzC.d.ts +0 -57
package/package.json
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosyte/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The cosyte CLI: a PHI-safe developer front door over the @cosyte/* healthcare parsers. Parse HL7 v2 / FHIR from a file or stdin to typed JSON, with a documented exit-code contract.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
7
|
+
"command-line",
|
|
7
8
|
"healthcare",
|
|
8
9
|
"hl7",
|
|
10
|
+
"hl7v2",
|
|
9
11
|
"fhir",
|
|
12
|
+
"x12",
|
|
13
|
+
"ncpdp",
|
|
14
|
+
"astm",
|
|
15
|
+
"c-cda",
|
|
16
|
+
"dicom",
|
|
17
|
+
"mllp",
|
|
18
|
+
"mcp",
|
|
10
19
|
"interoperability",
|
|
11
20
|
"typescript"
|
|
12
21
|
],
|
|
@@ -14,7 +23,7 @@
|
|
|
14
23
|
"cosyte": "./dist/bin/cosyte.mjs",
|
|
15
24
|
"cosyte-mcp": "./dist/bin/cosyte-mcp.mjs"
|
|
16
25
|
},
|
|
17
|
-
"homepage": "https://
|
|
26
|
+
"homepage": "https://docs.cosyte.com/cli",
|
|
18
27
|
"bugs": {
|
|
19
28
|
"url": "https://github.com/cosyte/cli/issues"
|
|
20
29
|
},
|
|
@@ -26,7 +35,7 @@
|
|
|
26
35
|
"author": "Cosyte <hello@cosyte.com> (https://cosyte.com)",
|
|
27
36
|
"type": "module",
|
|
28
37
|
"engines": {
|
|
29
|
-
"node": ">=22.0.0"
|
|
38
|
+
"node": ">=22.0.0 <26.0.0"
|
|
30
39
|
},
|
|
31
40
|
"main": "./dist/index.cjs",
|
|
32
41
|
"module": "./dist/index.mjs",
|
|
@@ -73,7 +82,7 @@
|
|
|
73
82
|
"@arethetypeswrong/cli": "0.18.4",
|
|
74
83
|
"@changesets/cli": "2.31.0",
|
|
75
84
|
"@cosyte/eslint-config": "^0.0.4",
|
|
76
|
-
"@cosyte/fhir": "
|
|
85
|
+
"@cosyte/fhir": "^0.1.0",
|
|
77
86
|
"@cosyte/prettier-config": "^0.0.2",
|
|
78
87
|
"@cosyte/test-utils": "^0.0.1",
|
|
79
88
|
"@cosyte/tsconfig": "^0.0.2",
|
|
@@ -92,17 +101,18 @@
|
|
|
92
101
|
"vitest": "4.1.4"
|
|
93
102
|
},
|
|
94
103
|
"dependencies": {
|
|
95
|
-
"@cosyte/hl7": "^0.0
|
|
96
|
-
"@cosyte/terminology": "^0.0
|
|
104
|
+
"@cosyte/hl7": "^0.1.0",
|
|
105
|
+
"@cosyte/terminology": "^0.1.0"
|
|
97
106
|
},
|
|
98
107
|
"optionalDependencies": {
|
|
99
|
-
"@cosyte/astm": "^0.0
|
|
100
|
-
"@cosyte/ccda": "^0.0
|
|
101
|
-
"@cosyte/
|
|
102
|
-
"@cosyte/
|
|
103
|
-
"@cosyte/
|
|
104
|
-
"@cosyte/
|
|
105
|
-
"@cosyte/
|
|
108
|
+
"@cosyte/astm": "^0.1.0",
|
|
109
|
+
"@cosyte/ccda": "^0.1.0",
|
|
110
|
+
"@cosyte/deid": "^0.1.0",
|
|
111
|
+
"@cosyte/dicom": "^0.1.0",
|
|
112
|
+
"@cosyte/mllp": "^0.1.0",
|
|
113
|
+
"@cosyte/ncpdp": "^0.1.0",
|
|
114
|
+
"@cosyte/transform": "^0.1.0",
|
|
115
|
+
"@cosyte/x12": "^0.1.0",
|
|
106
116
|
"@modelcontextprotocol/sdk": "1.29.0"
|
|
107
117
|
},
|
|
108
118
|
"scripts": {
|
|
@@ -110,17 +120,22 @@
|
|
|
110
120
|
"changeset": "changeset",
|
|
111
121
|
"typecheck": "tsc --noEmit",
|
|
112
122
|
"phi-scan": "tsx scripts/phi-scan.ts",
|
|
123
|
+
"check:agent-notes": "tsx scripts/check-agent-notes.ts",
|
|
113
124
|
"check:no-emdash": "bash scripts/check-no-emdash.sh",
|
|
114
125
|
"check:no-internal-refs": "bash scripts/check-no-internal-refs.sh",
|
|
115
126
|
"lint": "eslint \"src/**/*.ts\" \"scripts/**/*.ts\" \"test/**/*.ts\" --max-warnings=0 --no-error-on-unmatched-pattern",
|
|
116
127
|
"lint:fix": "eslint \"src/**/*.ts\" \"scripts/**/*.ts\" \"test/**/*.ts\" --fix --no-error-on-unmatched-pattern",
|
|
117
|
-
"format": "prettier --write \"src/**/*.{ts,md}\" \"test/**/*.ts\" \"scripts/**/*.{ts,mjs}\" \"*.{json,md,yml}\"",
|
|
118
|
-
"format:check": "prettier --check \"src/**/*.{ts,md}\" \"test/**/*.ts\" \"scripts/**/*.{ts,mjs}\" \"*.{json,md,yml}\"",
|
|
128
|
+
"format": "prettier --write \"src/**/*.{ts,md}\" \"test/**/*.ts\" \"scripts/**/*.{ts,mjs}\" \"examples/**/*.{ts,js,json,md}\" \"*.{json,md,yml}\"",
|
|
129
|
+
"format:check": "prettier --check \"src/**/*.{ts,md}\" \"test/**/*.ts\" \"scripts/**/*.{ts,mjs}\" \"examples/**/*.{ts,js,json,md}\" \"*.{json,md,yml}\"",
|
|
119
130
|
"test": "vitest run",
|
|
120
131
|
"test:watch": "vitest",
|
|
121
132
|
"test:coverage": "vitest run --coverage",
|
|
122
133
|
"test:fuzz": "vitest run test/fuzz.property.test.ts",
|
|
123
134
|
"smoke": "node scripts/smoke.mjs",
|
|
135
|
+
"examples": "tsx scripts/run-examples.ts",
|
|
136
|
+
"typecheck:examples": "tsc -p examples/tsconfig.json",
|
|
137
|
+
"lint:examples": "eslint examples --max-warnings=0",
|
|
138
|
+
"phi-scan:examples": "tsx scripts/phi-scan.ts examples/*.ts",
|
|
124
139
|
"clean": "rm -rf dist coverage",
|
|
125
140
|
"vendor:refresh": "bash scripts/vendor-refresh.sh",
|
|
126
141
|
"pack:docs": "bash scripts/build-docs-artifacts.sh",
|
package/dist/io-B2EobRzC.d.cts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Readable } from 'node:stream';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Input I/O for the CLI: read the bytes to operate on from a **file argument** or from **stdin**
|
|
5
|
-
* (`-`), with a value-free failure mode. The CLI never writes a temp file and never logs to a file;
|
|
6
|
-
* this module only *reads*.
|
|
7
|
-
*
|
|
8
|
-
* The reader functions are injected into the command layer as {@link RunDeps} so the whole dispatch
|
|
9
|
-
* path is testable without touching `process`: the real `process.stdin` wiring lives in the thin
|
|
10
|
-
* `bin` entry.
|
|
11
|
-
*
|
|
12
|
-
* @packageDocumentation
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The injectable input side-effects the dispatcher needs. Kept tiny and pure-ish so tests drive the
|
|
17
|
-
* CLI end to end with in-memory fakes and no real filesystem or stdin.
|
|
18
|
-
*/
|
|
19
|
-
interface RunDeps {
|
|
20
|
-
/** Read a file's bytes, or raise a `CLI_NO_INPUT` {@link CliError} if it cannot be read. */
|
|
21
|
-
readonly readFile: (path: string) => Promise<Uint8Array>;
|
|
22
|
-
/** Read all of stdin's bytes. */
|
|
23
|
-
readonly readStdin: () => Promise<Uint8Array>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Read a file into bytes, mapping any read failure to a **value-free** `CLI_NO_INPUT` /
|
|
27
|
-
* {@link EXIT.NOINPUT} error. The path is structural context (the user supplied it), so it may appear
|
|
28
|
-
* in the message; the file *contents* never do.
|
|
29
|
-
*
|
|
30
|
-
* @param path - The file path to read.
|
|
31
|
-
* @returns The file bytes.
|
|
32
|
-
* @throws {CliError} `CLI_NO_INPUT` (exit `66`) when the file is missing, a directory, or unreadable.
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts throws
|
|
35
|
-
* import { readFileBytes } from "@cosyte/cli";
|
|
36
|
-
*
|
|
37
|
-
* await readFileBytes("/no/such/file"); // throws CliError CLI_NO_INPUT
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
declare function readFileBytes(path: string): Promise<Uint8Array>;
|
|
41
|
-
/**
|
|
42
|
-
* Drain a readable stream (e.g. `process.stdin`) into a single byte buffer.
|
|
43
|
-
*
|
|
44
|
-
* @param stream - The readable stream to drain.
|
|
45
|
-
* @returns The concatenated bytes.
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* import { Readable } from "node:stream";
|
|
49
|
-
* import { readStreamBytes } from "@cosyte/cli";
|
|
50
|
-
*
|
|
51
|
-
* const bytes = await readStreamBytes(Readable.from([Buffer.from("MSH|")]));
|
|
52
|
-
* bytes.length; // => 4
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare function readStreamBytes(stream: Readable): Promise<Uint8Array>;
|
|
56
|
-
|
|
57
|
-
export { type RunDeps as R, readStreamBytes as a, readFileBytes as r };
|
package/dist/io-B2EobRzC.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Readable } from 'node:stream';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Input I/O for the CLI: read the bytes to operate on from a **file argument** or from **stdin**
|
|
5
|
-
* (`-`), with a value-free failure mode. The CLI never writes a temp file and never logs to a file;
|
|
6
|
-
* this module only *reads*.
|
|
7
|
-
*
|
|
8
|
-
* The reader functions are injected into the command layer as {@link RunDeps} so the whole dispatch
|
|
9
|
-
* path is testable without touching `process`: the real `process.stdin` wiring lives in the thin
|
|
10
|
-
* `bin` entry.
|
|
11
|
-
*
|
|
12
|
-
* @packageDocumentation
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The injectable input side-effects the dispatcher needs. Kept tiny and pure-ish so tests drive the
|
|
17
|
-
* CLI end to end with in-memory fakes and no real filesystem or stdin.
|
|
18
|
-
*/
|
|
19
|
-
interface RunDeps {
|
|
20
|
-
/** Read a file's bytes, or raise a `CLI_NO_INPUT` {@link CliError} if it cannot be read. */
|
|
21
|
-
readonly readFile: (path: string) => Promise<Uint8Array>;
|
|
22
|
-
/** Read all of stdin's bytes. */
|
|
23
|
-
readonly readStdin: () => Promise<Uint8Array>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Read a file into bytes, mapping any read failure to a **value-free** `CLI_NO_INPUT` /
|
|
27
|
-
* {@link EXIT.NOINPUT} error. The path is structural context (the user supplied it), so it may appear
|
|
28
|
-
* in the message; the file *contents* never do.
|
|
29
|
-
*
|
|
30
|
-
* @param path - The file path to read.
|
|
31
|
-
* @returns The file bytes.
|
|
32
|
-
* @throws {CliError} `CLI_NO_INPUT` (exit `66`) when the file is missing, a directory, or unreadable.
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts throws
|
|
35
|
-
* import { readFileBytes } from "@cosyte/cli";
|
|
36
|
-
*
|
|
37
|
-
* await readFileBytes("/no/such/file"); // throws CliError CLI_NO_INPUT
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
declare function readFileBytes(path: string): Promise<Uint8Array>;
|
|
41
|
-
/**
|
|
42
|
-
* Drain a readable stream (e.g. `process.stdin`) into a single byte buffer.
|
|
43
|
-
*
|
|
44
|
-
* @param stream - The readable stream to drain.
|
|
45
|
-
* @returns The concatenated bytes.
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* import { Readable } from "node:stream";
|
|
49
|
-
* import { readStreamBytes } from "@cosyte/cli";
|
|
50
|
-
*
|
|
51
|
-
* const bytes = await readStreamBytes(Readable.from([Buffer.from("MSH|")]));
|
|
52
|
-
* bytes.length; // => 4
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare function readStreamBytes(stream: Readable): Promise<Uint8Array>;
|
|
56
|
-
|
|
57
|
-
export { type RunDeps as R, readStreamBytes as a, readFileBytes as r };
|