@cobol-ts/cobolts 0.0.19 → 0.0.21

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.
Files changed (50) hide show
  1. package/README.md +72 -11
  2. package/build/gui/assets/index-AxtZbbsk.js +71 -0
  3. package/build/gui/assets/index-DUqGF627.css +1 -0
  4. package/build/gui/index.html +13 -0
  5. package/dist/src/cli.integration.spec.js +3 -3
  6. package/dist/src/cli.integration.spec.js.map +1 -1
  7. package/dist/src/cli.js +1 -0
  8. package/dist/src/cli.js.map +1 -1
  9. package/dist/src/commands/ai.demo.spec.js +8 -4
  10. package/dist/src/commands/ai.demo.spec.js.map +1 -1
  11. package/dist/src/commands/ai.spec.js +15 -4
  12. package/dist/src/commands/ai.spec.js.map +1 -1
  13. package/dist/src/commands/characteristics.d.ts +1 -0
  14. package/dist/src/commands/characteristics.js +77 -25
  15. package/dist/src/commands/characteristics.js.map +1 -1
  16. package/dist/src/commands/characteristics.spec.js +88 -15
  17. package/dist/src/commands/characteristics.spec.js.map +1 -1
  18. package/dist/src/commands/extract.d.ts +4 -1
  19. package/dist/src/commands/extract.js +23 -6
  20. package/dist/src/commands/extract.js.map +1 -1
  21. package/dist/src/commands/extract.spec.js +87 -0
  22. package/dist/src/commands/extract.spec.js.map +1 -1
  23. package/dist/src/commands/graph.spec.js +1 -1
  24. package/dist/src/commands/graph.spec.js.map +1 -1
  25. package/dist/src/composition.data.d.ts +10 -0
  26. package/dist/src/composition.data.js +133 -0
  27. package/dist/src/composition.data.js.map +1 -0
  28. package/dist/src/composition.data.spec.d.ts +1 -0
  29. package/dist/src/composition.data.spec.js +80 -0
  30. package/dist/src/composition.data.spec.js.map +1 -0
  31. package/dist/src/composition.run.d.ts +5 -0
  32. package/dist/src/composition.run.integration.spec.d.ts +1 -0
  33. package/dist/src/composition.run.integration.spec.js +32 -0
  34. package/dist/src/composition.run.integration.spec.js.map +1 -0
  35. package/dist/src/composition.run.js +32 -0
  36. package/dist/src/composition.run.js.map +1 -0
  37. package/dist/src/composition.run.spec.d.ts +1 -0
  38. package/dist/src/composition.run.spec.js +71 -0
  39. package/dist/src/composition.run.spec.js.map +1 -0
  40. package/dist/src/context.d.ts +13 -1
  41. package/dist/src/context.js +67 -3
  42. package/dist/src/context.js.map +1 -1
  43. package/dist/src/gui.assets.d.ts +11 -0
  44. package/dist/src/gui.assets.js +68 -0
  45. package/dist/src/gui.assets.js.map +1 -0
  46. package/dist/src/gui.assets.spec.d.ts +1 -0
  47. package/dist/src/gui.assets.spec.js +94 -0
  48. package/dist/src/gui.assets.spec.js.map +1 -0
  49. package/index.ts +2 -0
  50. package/package.json +34 -28
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @cobol-ts/cobolts
2
2
 
3
- Commander-based CLI for inspecting configured files and input/output characteristic metadata, extracting Excel characteristics, serving read-only characteristic APIs, generating TypeScript contracts, displaying physical data, and compiling or executing CEL dependency graphs, and generating AI-assisted graph experiments. Code generation uses `@cobol-ts/codegen`; neither `display` nor `cel execute` requires or executes generated TypeScript.
3
+ Commander-based CLI for inspecting configured files and input/output characteristic metadata, extracting Excel and input characteristics, serving read-only characteristic APIs, generating TypeScript contracts, displaying physical data, and compiling or executing CEL dependency graphs, and generating AI-assisted graph experiments. Code generation uses `@cobol-ts/codegen`; neither `display` nor `cel execute` requires or executes generated TypeScript.
4
4
 
5
5
  ## Local cryptographic packaging
6
6
 
@@ -60,7 +60,7 @@ extractions:
60
60
 
61
61
  The checked-in
62
62
  [`characteristics.yaml`](../../examples/example/definitions/.cobolts/characteristics.yaml)
63
- then configures **where extracted output and hand-authored input metadata are
63
+ then configures **where extracted output and input metadata are
64
64
  loaded from**:
65
65
 
66
66
  ```yaml
@@ -89,12 +89,13 @@ columns and mapping path before continuing.
89
89
 
90
90
  ```powershell
91
91
  yarn cobolts -d modules/examples/example/definitions extract demo-characteristics --raw --noSources --output modules/examples/example/definitions/.cobolts/demo-characteristics.yaml
92
+ yarn cobolts -d modules/examples/example/definitions extract input-characteristics --output modules/examples/example/definitions/.cobolts/input-characteristics.yaml
92
93
  yarn cobolts -d modules/examples/example/definitions characteristics list
93
94
  yarn cobolts -d modules/examples/example/definitions characteristics show C7200
94
95
  ```
95
96
 
96
- `extract` **overwrites** the output metadata YAML, not the Excel workbook or
97
- input metadata. It reads `.cobolts/extractions.yaml`; `characteristics list/show`
97
+ `extract` **overwrites** the named metadata YAML, not the workbook or the physical
98
+ input files. It reads `.cobolts/extractions.yaml`; `characteristics list/show`
98
99
  read `.cobolts/characteristics.yaml` and the two configured sources. The
99
100
  `--noSources` flag omits worksheet provenance in the generated file; omit it
100
101
  if you want to retain Excel source rows in the characteristic metadata.
@@ -371,9 +372,9 @@ unprofiled runs for performance comparisons because sampling affects timings.
371
372
 
372
373
  ## Named characteristic extraction
373
374
 
374
- `cobolts extract <name>` reads one extraction from `.cobolts/extractions.yaml`. Source worksheet provenance is included by default; `--noSources` suppresses that field in either YAML or JSON output without affecting the join.
375
+ `cobolts extract <name>` reads one extraction from `.cobolts/extractions.yaml`. Source provenance is included by default; `--noSources` suppresses that field in either YAML or JSON output without affecting the join.
375
376
  The `extractions` mapping can contain several named, type-tagged definitions. Currently
376
- `type: excel` is implemented; other types (including Word) can be added later.
377
+ `type: excel` and `type: input` are implemented; other types (including Word) can be added later.
377
378
 
378
379
  For the `Demo characteristics` spreadsheet, save the exported `.xlsx` in
379
380
  `source/demo-characteristics.xlsx`, and configure:
@@ -420,6 +421,31 @@ working directory. Diagnostics go to stderr unless `--raw` suppresses the traili
420
421
  The output includes the source file,
421
422
  sheet and row for each matched record. Extraction does not mutate experiment dossiers.
422
423
 
424
+ ## Input characteristic extraction
425
+
426
+ `type: input` extracts all scalar fields and terminal arrays from each configured logical
427
+ projection. It does not require a physical data file. Configure entity keys independently
428
+ of the cursor composition key, and optionally map projected fields to legacy IDs:
429
+
430
+ ```yaml
431
+ extractions:
432
+ input-characteristics:
433
+ type: input
434
+ files:
435
+ accounts:
436
+ keys:
437
+ customer: customerId
438
+ account: accountId
439
+ fields:
440
+ balance:
441
+ id: I0010
442
+ ```
443
+
444
+ The API and AI consume `metadata.path` (e.g. `input.accounts.balance`) and `metadata.keys`
445
+ (e.g. `customer: input.accounts.customerId`). The input catalogue validates these fields
446
+ when it loads; the output catalogue remains unconstrained. The graph executor and
447
+ benchmarks do not require extraction or characteristic metadata configuration.
448
+
423
449
  ## Characteristic metadata repository
424
450
 
425
451
  `.cobolts/characteristics.yaml` declares a global `files` directory prefix and independent `input` and `output` sets of named `type: yaml` metadata sources. Each source selects a dotted `path` to a map of characteristic IDs or the list emitted by `cobolts extract`. Sources within each kind join by characteristic ID. An ID may appear in both kinds with different metadata.
@@ -461,18 +487,48 @@ cobolts -d modules/examples/example/definitions extract demo-characteristics \
461
487
 
462
488
  Use `--format json` for JSON. Without `--kind`, `list` produces separate `input` and `output` arrays; `show` produces both records with an explicit `null` for a kind where the ID is absent. `list --ids` prefixes each ID with its kind (`input:C0010`, `output:C0010`) so repeated identifiers remain unambiguous. `--kind input` or `--kind output` limits output to that catalogue and preserves the single-catalogue response shape. Both inspection commands accept `--config`. The internal metadata query port remains `list()`/`get(id)` for each kind.
463
489
 
490
+ ## Serve Graph Explorer
491
+
492
+ After compiling the workspace packages, launch directly (the GUI builds automatically when needed):
493
+
494
+ ```powershell
495
+ yarn cobolts -d modules/examples/example/definitions serve
496
+ ```
497
+
498
+ Open http://127.0.0.1:3000/. `serve` and `serve all` host the API and built
499
+ GUI on the same Express server. `serve api` needs no GUI assets. `serve gui`
500
+ needs no project configuration and proxies `/api` to a separately hosted API:
501
+
502
+ ```powershell
503
+ yarn cobolts -d modules/examples/example/definitions serve api --port 3000
504
+ yarn cobolts serve gui --port 5173 --api-url http://127.0.0.1:3000
505
+ ```
506
+
507
+ Run those two commands in separate terminals if you want separate servers.
508
+ The default GUI-only port is 5173; the default API/all port is 3000.
509
+ `characteristics serve` accepts the same modes. `--host` defaults to localhost
510
+ (127.0.0.1). These servers have no authentication; keep them on trusted hosts.
511
+ The Vite build writes to the CLI package's `build/gui` directory, included in
512
+ its package files. No Vite dev server, hot reload or CORS configuration is
513
+ needed at runtime. When running the TypeScript CLI from a source checkout,
514
+ the CLI builds the GUI on every launch using linked TypeScript package entry
515
+ points; no dist directories are needed.
516
+ API-only mode never builds the GUI. Installed CLI packages use their prebuilt
517
+ assets without Vite. The optional `build:gui` command and `prepack` remain
518
+ available for explicit builds and distribution.
519
+
464
520
  ## Characteristic metadata HTTP API
465
521
 
466
522
  Read-only metadata is available over localhost without an MCP server:
467
523
 
468
524
  ```powershell
469
- cobolts -d modules/examples/example/definitions characteristics serve --port 3000
470
- cobolts -d modules/examples/example/definitions characteristics serve --port 3000 --quiet
525
+ cobolts -d modules/examples/example/definitions serve api --port 3000
526
+ cobolts -d modules/examples/example/definitions serve api --port 3000 --quiet
471
527
  ```
472
528
 
473
529
  By default the server prints its base URL and the API endpoints to stderr. `--quiet` suppresses only this startup information; errors remain visible.
474
530
 
475
- `GET /api` links to `/api/characteristics`, whose sitemap links to the input and output collections. Those collections each provide self-links for every characteristic, with detail endpoints under `/api/characteristics/input/:id` and `/api/characteristics/output/:id`. All links are root-relative and characteristic IDs are URL-encoded. There is no authentication: do not expose the server outside the trusted developer machine. Restart it to load edits to the source YAML files.
531
+ `GET /api` links to `/api/characteristics` and, when serving, `/api/graph`, `/api/canonical`, `/api/sorted`, and `/api/planned`. The characteristics sitemap links to the input and output collections. Those collections each provide self-links for every characteristic, with detail endpoints under `/api/characteristics/input/:id` and `/api/characteristics/output/:id`. All links are root-relative and characteristic IDs are URL-encoded. There is no authentication: do not expose the server outside the trusted developer machine. Restart it to load edits to the characteristic source YAML files. The four graph endpoints invoke the existing `celInspect` pipeline and return precisely the JSON from `cobolts cel graph|canonical|sorted|planned`. Use `--graph <filename>` to select another graph at server startup.
476
532
 
477
533
  ## AI characteristic experiment loop (mock provider)
478
534
 
@@ -518,14 +574,19 @@ Read-only metadata is available over localhost without introducing an MCP server
518
574
 
519
575
  ```powershell
520
576
  # Load .cobolts/characteristics.yaml once and serve a snapshot
521
- cobolts -d modules/examples/example/definitions characteristics serve --port 3000
577
+ cobolts -d modules/examples/example/definitions serve api --port 3000
522
578
  ```
523
579
 
524
580
  `GET http://127.0.0.1:3000/api/characteristics` returns `{ "characteristics": [...] }`.
525
581
  `GET http://127.0.0.1:3000/api/characteristics/C0010` returns one characteristic, or a JSON 404 when absent.
526
582
 
527
- The CLI `characteristics list` and `characteristics show` use the same internal `CharacteristicQueries` port. The server deliberately binds only to `127.0.0.1` and has no authentication; do not expose it to other machines. Restart it to load edited source YAML files.
583
+ The CLI `characteristics list` and `characteristics show` use the same internal `CharacteristicQueries` port. The server defaults to `127.0.0.1` and has no authentication; do not expose it to other machines. Restart it to load edited source YAML files.
528
584
 
529
585
  ## Encrypted production oracle repository
530
586
 
531
587
  Use `cobolts oracle import --composition productionDaily --date YYYY-MM-DD --source <file-or-directory-or-zip>` to validate and archive an observed production execution, then `oracle list`, `verify`, `inspect`, `view`, `key` or `unpack` to recover it. Configuration is in `.cobolts/oracle.yaml`, which refers to `crypto.yaml`. See [README.oracle.md](README.oracle.md) for a **working smoke test using checked-in COBOL files**, required filename mapping, and exact commands.
588
+
589
+ The `serve api` API also exposes `/api/graph/display`,
590
+ `/api/canonical/display`, `/api/sorted/display` and `/api/planned/display`.
591
+ These are display-only views enriched with input-field nodes using
592
+ `@cobol-ts/graph_utils`; raw graph endpoints and production execution are unchanged.