@cosyte/cli 0.1.0 → 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 +6 -4
- package/README.md +11 -12
- package/dist/bin/cosyte-mcp.cjs +1 -1
- package/dist/bin/cosyte-mcp.cjs.map +1 -1
- package/dist/bin/cosyte-mcp.mjs +1 -1
- package/dist/bin/cosyte-mcp.mjs.map +1 -1
- package/dist/bin/cosyte.cjs +1 -1
- package/dist/bin/cosyte.cjs.map +1 -1
- package/dist/bin/cosyte.mjs +1 -1
- package/dist/bin/cosyte.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.cjs +1 -1
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.mjs +1 -1
- package/dist/mcp.mjs.map +1 -1
- package/package.json +30 -39
package/CHANGELOG.md
CHANGED
|
@@ -18,7 +18,7 @@ still do. Each entry was assigned to the release whose tag first contains it, re
|
|
|
18
18
|
**What 0.1 means for you.** This is the first release whose commands, output and exit codes we treat
|
|
19
19
|
as settled: command names, flags, the JSON output shapes, the exit-code contract (`0`, `1`, `2`,
|
|
20
20
|
`65`, `66`, `69`, `70`, `74`) and the diagnostic codes are the surface we keep stable. It covers the
|
|
21
|
-
`cosyte` command over all eight
|
|
21
|
+
`cosyte` command over all eight Cosyte formats (`parse`, `validate`, `inspect`, `fmt`, `convert`,
|
|
22
22
|
`map-codes`, `redact` / `deid`, `completion`), value-free diagnostics with `--unsafe-show-values` as
|
|
23
23
|
the one opt-in, the `cosyte-mcp` stdio server and the programmatic `core` API. While the package is
|
|
24
24
|
below 1.0, a breaking change bumps the minor version and is called out here; a fix that changes no
|
|
@@ -85,7 +85,7 @@ it out.
|
|
|
85
85
|
- No dependency was added, no manifest field moved, and nothing a consumer receives changed.
|
|
86
86
|
|
|
87
87
|
- **Every MCP tool now publishes an `outputSchema`, and every tool result conforms to it.** An agent
|
|
88
|
-
calling a
|
|
88
|
+
calling a Cosyte tool used to receive `structuredContent: { exit, ok }` with no schema to check it
|
|
89
89
|
against, so deciding whether a result held data or a diagnostic meant pattern-matching a text blob.
|
|
90
90
|
Each of the four tools now advertises an output schema and a `title` on `tools/list`, and every
|
|
91
91
|
dispatch path (success, negative verdict, hard failure, usage error, internal error) returns
|
|
@@ -217,6 +217,8 @@ it out.
|
|
|
217
217
|
|
|
218
218
|
### Changed
|
|
219
219
|
|
|
220
|
+
- **Published through npm trusted publishing, with provenance.** The code is unchanged from 0.1.0:
|
|
221
|
+
the commands, flags, output, exit codes and diagnostic codes are the same. Only the README differs.
|
|
220
222
|
- **The CLI now runs on the 0.1 releases of every `@cosyte` library it uses except `@cosyte/deid`.**
|
|
221
223
|
The two required dependencies, `@cosyte/hl7` and `@cosyte/terminology`, and the optional
|
|
222
224
|
`@cosyte/astm`, `@cosyte/ccda`, `@cosyte/dicom`, `@cosyte/mllp`, `@cosyte/ncpdp`,
|
|
@@ -795,7 +797,7 @@ node_modules/@cosyte/cli/vendor/cosyte-fhir-0.0.0.tgz`. The siblings are now rea
|
|
|
795
797
|
provenance/OIDC, the vendored-`file:`→npm dep swap, and the two standing founder stops).
|
|
796
798
|
|
|
797
799
|
- **Phase 6: six more formats + streaming + shell completion (ADR 0025).** The `cosyte` CLI now wraps
|
|
798
|
-
**all eight
|
|
800
|
+
**all eight Cosyte formats**, routed through a single lazy **per-format adapter registry**
|
|
799
801
|
(`src/core/parsers.ts`) that replaces the old per-command `hl7 ? : fhir` branches and makes support
|
|
800
802
|
**per (format, operation)**. An unsupported (format, op) is a value-free `CLI_FORMAT_UNSUPPORTED`,
|
|
801
803
|
never a fake (ADR 0018).
|
|
@@ -978,7 +980,7 @@ parse` invocation never loads it; the core works with the SDK absent (`--omit=op
|
|
|
978
980
|
repo for this character, find the places it is a value rather than punctuation and convert those by
|
|
979
981
|
hand, to a word, first.
|
|
980
982
|
|
|
981
|
-
- **No
|
|
983
|
+
- **No Cosyte surface in this repo uses an em dash any more, and a CI gate keeps it that way.** The
|
|
982
984
|
brand rule (`knowledgebase/06-brand/voice-and-tone.md`, "No em dashes. Ever.") bans `U+2014`
|
|
983
985
|
outright and names commit messages explicitly. Measured byte-level over **all 124 tracked files**,
|
|
984
986
|
not over markdown alone: **659 occurrences across 87 files**, all as the literal character and none
|
package/README.md
CHANGED
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
# @cosyte/cli
|
|
9
9
|
|
|
10
|
-
> The **
|
|
10
|
+
> The **Cosyte CLI**: a PHI-safe developer front door over the `@cosyte/*` healthcare parsers.
|
|
11
11
|
|
|
12
12
|
`@cosyte/cli` is a **`bin` package**: its primary artifact is the `cosyte` command on your `PATH`. Pipe
|
|
13
13
|
a raw message from a hospital feed into the terminal and get typed, structured JSON back in one line,
|
|
14
|
-
without writing code
|
|
15
|
-
or a silent success on a malformed message**.
|
|
14
|
+
without writing code and without reading the spec.
|
|
16
15
|
|
|
17
16
|
```bash
|
|
18
17
|
cat adt.hl7 | cosyte parse -
|
|
@@ -51,15 +50,16 @@ outside this repository and exercised, which is the check a `npm publish --dry-r
|
|
|
51
50
|
**FHIR support arrives through a peer, not a declared dependency.** `@cosyte/fhir` is not in this
|
|
52
51
|
package's manifest. `npm install` brings it in as the peer dependency of `@cosyte/transform`, one of
|
|
53
52
|
this package's optional dependencies, and the FHIR `parse` / `inspect` / `fmt` / `validate` commands
|
|
54
|
-
and `convert` use that copy.
|
|
55
|
-
|
|
56
|
-
`69`: it never guesses, and it
|
|
57
|
-
dependencies, `@cosyte/hl7` and
|
|
53
|
+
and `convert` use that copy. Install with optional dependencies, as `npm install` does by default. If
|
|
54
|
+
a library a command needs is still missing, for example a peer your package manager did not install,
|
|
55
|
+
the command reports a value-free `CLI_PARSER_UNAVAILABLE` and exits `69`: it never guesses, and it
|
|
56
|
+
never blames your input. HL7 v2 and `map-codes` run on the two hard dependencies, `@cosyte/hl7` and
|
|
57
|
+
`@cosyte/terminology`.
|
|
58
58
|
|
|
59
59
|
> **Status:** `0.1`. While the package is below 1.0, a breaking change ships in a minor version and is
|
|
60
60
|
> called out in the changelog. `0.0.1` and `0.0.2` are on npm and **cannot be installed** (see above);
|
|
61
61
|
> every later version installs. The `cosyte` command wraps **all eight
|
|
62
|
-
>
|
|
62
|
+
> Cosyte formats** (**HL7 v2**, **FHIR R4**, **X12**, **ASTM**, **NCPDP SCRIPT**, **C-CDA**, **DICOM**,
|
|
63
63
|
> and **MLLP**) plus the `@cosyte/transform` and `@cosyte/terminology` higher-layer libraries, with
|
|
64
64
|
> conservative content-format autodetection and a documented exit-code contract:
|
|
65
65
|
>
|
|
@@ -365,8 +365,7 @@ subprocess**, not a hosted endpoint. Register it in an MCP client's config:
|
|
|
365
365
|
> **`--package` is required, and the shorter `["-y", "@cosyte/cli", "mcp"]` does not work**: it fails
|
|
366
366
|
> with `could not determine executable to run`, for the `npx` executable-selection reason described
|
|
367
367
|
> under [Run it](#run-it) above. This also needs a version that can be installed at all, so not
|
|
368
|
-
> `0.0.1` or `0.0.2`.
|
|
369
|
-
> the FHIR library is not on the registry.
|
|
368
|
+
> `0.0.1` or `0.0.2`.
|
|
370
369
|
|
|
371
370
|
`cosyte mcp` and the standalone `cosyte-mcp` bin both start the stdio server. It exposes four tools
|
|
372
371
|
(`parse`, `validate`, `inspect`, `convert`), each calling the same command the terminal runs, so the CLI
|
|
@@ -382,8 +381,8 @@ text content block carries the serialized JSON of that same structured result. S
|
|
|
382
381
|
per-tool payload shapes.
|
|
383
382
|
|
|
384
383
|
The MCP SDK (`@modelcontextprotocol/sdk`) is the CLI's only third-party runtime dependency; it is
|
|
385
|
-
declared **optional
|
|
386
|
-
|
|
384
|
+
declared **optional**, and the programmatic core (the `.` subpath) loads with the SDK absent. The server
|
|
385
|
+
surface is importable via the `@cosyte/cli/mcp` subpath
|
|
387
386
|
(`createMcpServer`, `startStdioServer`, `dispatchTool`, `TOOL_DEFS`).
|
|
388
387
|
|
|
389
388
|
## Programmatic API
|