@visulima/vis 1.0.0-alpha.20 → 1.0.0-alpha.22

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 (112) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/LICENSE.md +206 -141
  3. package/README.md +21 -4
  4. package/dist/config/index.d.ts +199 -6
  5. package/dist/packem_chunks/bin.js +318 -318
  6. package/dist/packem_chunks/bloom-status.js +2 -0
  7. package/dist/packem_chunks/bloom-sync.js +2 -0
  8. package/dist/packem_chunks/cache-attestation.js +1 -0
  9. package/dist/packem_chunks/config.js +15 -15
  10. package/dist/packem_chunks/fix.js +1 -1
  11. package/dist/packem_chunks/handler.js +1 -1
  12. package/dist/packem_chunks/handler10.js +2 -1
  13. package/dist/packem_chunks/handler11.js +1 -5
  14. package/dist/packem_chunks/handler12.js +5 -1
  15. package/dist/packem_chunks/handler13.js +1 -27
  16. package/dist/packem_chunks/handler14.js +28 -5
  17. package/dist/packem_chunks/handler15.js +5 -1
  18. package/dist/packem_chunks/handler16.js +1 -1
  19. package/dist/packem_chunks/handler17.js +1 -1
  20. package/dist/packem_chunks/handler18.js +1 -1
  21. package/dist/packem_chunks/handler19.js +1 -1
  22. package/dist/packem_chunks/handler2.js +4 -2
  23. package/dist/packem_chunks/handler20.js +1 -5
  24. package/dist/packem_chunks/handler21.js +5 -2
  25. package/dist/packem_chunks/handler22.js +2 -2
  26. package/dist/packem_chunks/handler23.js +2 -18
  27. package/dist/packem_chunks/handler24.js +18 -1
  28. package/dist/packem_chunks/handler25.js +1 -1
  29. package/dist/packem_chunks/handler26.js +1 -5
  30. package/dist/packem_chunks/handler27.js +5 -1
  31. package/dist/packem_chunks/handler28.js +1 -3
  32. package/dist/packem_chunks/handler29.js +3 -1
  33. package/dist/packem_chunks/handler3.js +4 -4
  34. package/dist/packem_chunks/handler30.js +1 -7
  35. package/dist/packem_chunks/handler31.js +6 -32
  36. package/dist/packem_chunks/handler32.js +33 -3
  37. package/dist/packem_chunks/handler33.js +3 -1
  38. package/dist/packem_chunks/handler34.js +1 -26
  39. package/dist/packem_chunks/handler35.js +26 -3
  40. package/dist/packem_chunks/handler36.js +5 -7
  41. package/dist/packem_chunks/handler37.js +6 -6
  42. package/dist/packem_chunks/handler38.js +1 -1
  43. package/dist/packem_chunks/handler39.js +61 -6
  44. package/dist/packem_chunks/handler4.js +6 -8
  45. package/dist/packem_chunks/handler40.js +6 -24
  46. package/dist/packem_chunks/handler41.js +215 -10
  47. package/dist/packem_chunks/handler42.js +24 -153
  48. package/dist/packem_chunks/handler43.js +153 -25
  49. package/dist/packem_chunks/handler44.js +10 -24
  50. package/dist/packem_chunks/handler45.js +25 -213
  51. package/dist/packem_chunks/handler46.js +24 -3
  52. package/dist/packem_chunks/handler47.js +3 -27
  53. package/dist/packem_chunks/handler48.js +21 -161
  54. package/dist/packem_chunks/handler49.js +173 -33
  55. package/dist/packem_chunks/handler5.js +8 -1
  56. package/dist/packem_chunks/handler50.js +34 -0
  57. package/dist/packem_chunks/handler6.js +1 -1
  58. package/dist/packem_chunks/handler7.js +1 -1
  59. package/dist/packem_chunks/handler8.js +1 -1
  60. package/dist/packem_chunks/handler9.js +1 -2
  61. package/dist/packem_chunks/heal-accept.js +1 -1
  62. package/dist/packem_chunks/heal.js +1 -1
  63. package/dist/packem_chunks/help-command.js +16 -16
  64. package/dist/packem_chunks/index.js +2 -2
  65. package/dist/packem_chunks/keys-refresh.js +1 -1
  66. package/dist/packem_chunks/list.js +1 -1
  67. package/dist/packem_chunks/loader.js +4 -1
  68. package/dist/packem_chunks/loader2.js +1 -0
  69. package/dist/packem_chunks/prune.js +1 -1
  70. package/dist/packem_chunks/run.js +1 -1
  71. package/dist/packem_chunks/status.js +1 -1
  72. package/dist/packem_chunks/sync.js +1 -1
  73. package/dist/packem_chunks/sync2.js +1 -1
  74. package/dist/packem_chunks/verify-lockfile.js +2 -0
  75. package/dist/packem_shared/{advisories-DsynpacV.js → advisories-DS8JEB_g.js} +1 -1
  76. package/dist/packem_shared/{ai-analysis-uYuTIIXi.js → ai-analysis-DGBZYlxF.js} +1 -1
  77. package/dist/packem_shared/{ai-cache-DuwHYx2O.js → ai-cache-BjlXWJtl.js} +1 -1
  78. package/dist/packem_shared/{ai-fix-DzrA-dVz.js → ai-fix-BhcTrkuW.js} +6 -6
  79. package/dist/packem_shared/cyclonedx-CO7-Y1B1.js +4 -0
  80. package/dist/packem_shared/dependency-scan-DPHTzA5r.js +1 -0
  81. package/dist/packem_shared/docker-lk0-5Z-i.js +60 -0
  82. package/dist/packem_shared/{failure-log-C3LEMmkq.js → failure-log-DF7nrFIs.js} +1 -1
  83. package/dist/packem_shared/{flakiness-Dq6K4ymq.js → flakiness-DKCOYwN7.js} +1 -1
  84. package/dist/packem_shared/index-B4gpNmrG.js +1 -0
  85. package/dist/packem_shared/license-zZU7aavK.js +1 -0
  86. package/dist/packem_shared/{lifecycle-Dv3nAtoD.js → lifecycle-boYwVQSE.js} +2 -2
  87. package/dist/packem_shared/{min-release-age-BFozFonQ.js → min-release-age-D462DvYM.js} +1 -1
  88. package/dist/packem_shared/{native-config-sync-Dvi1g2nQ.js → native-config-sync-B0_ef78M.js} +9 -9
  89. package/dist/packem_shared/osv-bloom-QSAn2Dcw.js +2 -0
  90. package/dist/packem_shared/provenance-smHa8efI.js +1 -0
  91. package/dist/packem_shared/{registry-keys-CewRFW0e.js → registry-keys-3qaVog76.js} +1 -1
  92. package/dist/packem_shared/resolve-explicit-BgFQHUEP.js +5 -0
  93. package/dist/packem_shared/{run-summary-utils-BaBGP3bo.js → run-summary-utils-DIJV_dUD.js} +1 -1
  94. package/dist/packem_shared/runtime-check-DrMx4Q9L.js +1 -0
  95. package/dist/packem_shared/s1ngularity-CwSBPB3I.js +1 -0
  96. package/dist/packem_shared/signatures-b-jJYoZd.js +2 -0
  97. package/dist/packem_shared/toolchain-OH1PXwbZ.js +5 -0
  98. package/dist/packem_shared/{typosquats-BCeR-sLf.js → typosquats-CJ4o1l7U.js} +1 -1
  99. package/dist/packem_shared/{verify-07kUNTuP.js → verify-CQbzknur.js} +1 -1
  100. package/dist/packem_shared/{vis-update-app-CFrlJ3mW.js → vis-update-app-Bnu1EIgE.js} +1 -1
  101. package/index.d.ts +78 -0
  102. package/index.js +57 -53
  103. package/package.json +22 -12
  104. package/schemas/project.schema.json +37 -7
  105. package/schemas/vis-config.schema.json +2376 -2026
  106. package/dist/packem_shared/cyclonedx-CiHXuG8M.js +0 -4
  107. package/dist/packem_shared/dependency-scan-DC3nAFHS.js +0 -1
  108. package/dist/packem_shared/docker-B-CIN_nj.js +0 -60
  109. package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +0 -5
  110. package/dist/packem_shared/runtime-check-BusAwPb2.js +0 -1
  111. package/dist/packem_shared/signatures-5ZdjJ2Pu.js +0 -2
  112. package/dist/packem_shared/toolchain-Cc3cwyLP.js +0 -5
@@ -21,7 +21,7 @@ interface SimilarDepFamily {
21
21
  prefixes?: string[];
22
22
  }
23
23
  type VersionManagerName = "asdf" | "corepack" | "fnm" | "mise" | "none" | "nvm" | "proto" | "self-activate" | "volta";
24
- type RuntimeTool = "bun" | "deno" | "go" | "node" | "npm" | "pnpm" | "python" | "ruby" | "rust" | "yarn";
24
+ type RuntimeTool = "aube" | "bun" | "deno" | "go" | "node" | "npm" | "pnpm" | "python" | "ruby" | "rust" | "yarn";
25
25
  interface ToolchainConfig {
26
26
  /**
27
27
  * When a tool pin doesn't match the running version, try to fix it
@@ -651,6 +651,12 @@ interface ProjectJson {
651
651
  * - `tool` — CLI or developer tooling shipped as an executable.
652
652
  */
653
653
  projectType?: "application" | "library" | "service" | "tool";
654
+ /**
655
+ * Marks the project as write-restricted. Consumed by
656
+ * `vis sync codeowners --write-guard` to scope the generated
657
+ * Write Guard workflow to this project's paths.
658
+ */
659
+ restricted?: boolean;
654
660
  /** Source root, used for display and language inference. */
655
661
  sourceRoot?: string;
656
662
  /** Tech stack. */
@@ -856,9 +862,18 @@ interface VisConfig {
856
862
  };
857
863
  /**
858
864
  * Auto-create targets from detected config files (Project Crystal-style).
859
- * Inferred targets sit *below* explicit ones anything in
865
+ * On by default; set `false` to disable entirely, or use the object
866
+ * form to disable individual detectors.
867
+ *
868
+ * Inferred targets sit *below* explicit ones — the command from
860
869
  * `package.json#scripts`, `project.json#targets`, or `vis.task.ts`
861
- * wins per-key, so opting in never overrides existing setups.
870
+ * always wins per-key, so opting in never changes what runs. As a
871
+ * caching aid, when a `package.json` script's command *is* a
872
+ * detector's command (optionally with extra flags, no shell
873
+ * chaining) and the script declares no `inputs`/`outputs`, the
874
+ * detector's `inputs`/`outputs` are adopted so the script target can
875
+ * cache precisely and restore its artifacts. Customised/compound
876
+ * scripts are left untouched.
862
877
  *
863
878
  * Built-in detectors and the targets they synthesize:
864
879
  *
@@ -912,7 +927,7 @@ interface VisConfig {
912
927
  * opt individual detectors in or out by name. Detectors omitted from
913
928
  * the object run at their default (enabled). Useful when one
914
929
  * detector misfires for a given workspace without disabling the rest.
915
- * @default false
930
+ * @default true
916
931
  */
917
932
  inferTargets?: Record<string, boolean> | boolean;
918
933
  /**
@@ -1503,6 +1518,53 @@ interface VisConfig {
1503
1518
  */
1504
1519
  allowedHosts?: string[];
1505
1520
  /**
1521
+ * Bloom-filter prefilter for OSV `MAL-*` (malicious-package)
1522
+ * advisories. Probes a ~380 KB filter fetched from
1523
+ * `endevco/osv-bloom` and escalates hits to the existing
1524
+ * advisory query path for `(name, version)` confirmation.
1525
+ *
1526
+ * Cost: ~380 KB on the wire, refreshed every 10 minutes
1527
+ * upstream. False-positive rate is ~0.1%, so a typical
1528
+ * 1000-package lockfile triggers zero or one extra
1529
+ * round trip per audit.
1530
+ *
1531
+ * Independent of `audit.advisories.source` / `verify` —
1532
+ * those control the full OSV ingest. The bloom is
1533
+ * MAL-* only and aimed at cold-start preflight and
1534
+ * ephemeral CI runners that haven't synced the full DB.
1535
+ */
1536
+ bloom?: {
1537
+ /**
1538
+ * Extra hosts permitted as `bloom.source`. The
1539
+ * built-in allowlist (`endevco.github.io`) is enforced
1540
+ * even if this field is omitted; entries here add to it.
1541
+ */
1542
+ allowedHosts?: string[];
1543
+ /**
1544
+ * Prefilter mode:
1545
+ * - `off`: never run the bloom check.
1546
+ * - `on`: run when a local filter is cached; on
1547
+ * fetch failure, fall back to the cached filter or
1548
+ * skip the prefilter (audit continues against the
1549
+ * non-bloom path).
1550
+ * - `required`: hard-fail the audit when the bloom
1551
+ * refresh fails or the local cache is missing.
1552
+ * Use in hardened CI together with
1553
+ * `audit.advisories.source`.
1554
+ * @default "off"
1555
+ */
1556
+ mode?: "off" | "on" | "required";
1557
+ /**
1558
+ * Bloom mirror base URL (no trailing slash). Defaults
1559
+ * to the public `endevco/osv-bloom` GH Pages site.
1560
+ * Override only if you mirror the bloom artifacts
1561
+ * internally; the hostname must appear in
1562
+ * `allowedHosts`.
1563
+ * @default "https://endevco.github.io/osv-bloom"
1564
+ */
1565
+ source?: string;
1566
+ };
1567
+ /**
1506
1568
  * Number of hours after `lastSyncIso` before `vis audit`
1507
1569
  * prints a "your advisory cache may be stale" notice.
1508
1570
  * `vis audit` never auto-syncs — the user runs
@@ -1564,6 +1626,25 @@ interface VisConfig {
1564
1626
  };
1565
1627
  };
1566
1628
  /**
1629
+ * Vulnerability scanner backend.
1630
+ *
1631
+ * - `auto` (default): delegate to `aube audit` when aube is the
1632
+ * active installer (its scanner reads the same lockfile and
1633
+ * produces equivalent severity ratings); otherwise run vis's
1634
+ * own OSV/Socket scanner.
1635
+ * - `aube`: always delegate to `aube audit`. Errors if `aube` is
1636
+ * not on PATH.
1637
+ * - `vis`: always use vis's built-in scanner — never delegate.
1638
+ *
1639
+ * Delegation avoids redundant work (aube already has a
1640
+ * full-fidelity audit pass that respects its own exclusions
1641
+ * via `aube-workspace.yaml::auditConfig`) and lets users get
1642
+ * a single, consistent result regardless of which entry point
1643
+ * they invoke.
1644
+ * @default "auto"
1645
+ */
1646
+ backend?: "aube" | "auto" | "vis";
1647
+ /**
1567
1648
  * When true, `vis audit` skips network calls and queries the
1568
1649
  * offline cache. Equivalent to the CLI `--offline` flag.
1569
1650
  * @default false
@@ -1578,9 +1659,50 @@ interface VisConfig {
1578
1659
  */
1579
1660
  blockExoticSubdeps?: boolean;
1580
1661
  /**
1662
+ * Package names exempted from the `blockExoticSubdeps` check.
1663
+ * Bare names and a trailing `*` glob (`@scope/*`) are supported.
1664
+ * Use for an internal package legitimately published as a git or
1665
+ * tarball dependency.
1666
+ * @example ["@myorg/legacy", "internal-*"]
1667
+ */
1668
+ exoticSubdepsAllow?: string[];
1669
+ /**
1670
+ * deps.dev (Google Open Source Insights) data-source configuration.
1671
+ * Public, unauthenticated; pulls Scorecard data + advisories from
1672
+ * `api.deps.dev`. Complements or replaces Socket.dev. Heavily cached.
1673
+ * @see https://docs.deps.dev/api/v3/
1674
+ */
1675
+ depsDev?: {
1676
+ /**
1677
+ * Cache TTL for advisory entries (immutable once published).
1678
+ * @default 604_800_000 (7 days)
1679
+ */
1680
+ advisoryCacheTtlMs?: number;
1681
+ /**
1682
+ * Enable deps.dev scanning on install/update/check/audit commands.
1683
+ * @default false
1684
+ */
1685
+ enabled?: boolean;
1686
+ /**
1687
+ * Cache TTL for OpenSSF Scorecard project data (refreshes weekly).
1688
+ * @default 86_400_000 (24 hours)
1689
+ */
1690
+ projectCacheTtlMs?: number;
1691
+ /**
1692
+ * Request timeout in milliseconds.
1693
+ * @default 15_000
1694
+ */
1695
+ timeoutMs?: number;
1696
+ /**
1697
+ * Cache TTL for npm version metadata (immutable).
1698
+ * @default 604_800_000 (7 days)
1699
+ */
1700
+ versionCacheTtlMs?: number;
1701
+ };
1702
+ /**
1581
1703
  * Pre-install marshall pipeline — packument-derived supply-chain
1582
- * gates (author, provenance, new-bin, metadata, downloads,
1583
- * expired-domains, signatures, archived-repo) that run before
1704
+ * gates (author, provenance, s1ngularity, new-bin, metadata,
1705
+ * downloads, expired-domains, signatures, archived-repo) that run before
1584
1706
  * `vis add` / `vis install &lt;pkg>` / `vis update &lt;pkg>` hand off to
1585
1707
  * the underlying package manager. Every entry is optional; omit a
1586
1708
  * key and the marshall runs with defaults. Set `enabled: false`
@@ -1609,6 +1731,11 @@ interface VisConfig {
1609
1731
  /** Days since the resolved version was published — warning threshold. */
1610
1732
  recentVersionWarnDays?: number;
1611
1733
  };
1734
+ /** npm `deprecated`-flag check on the resolved version. */
1735
+ deprecation?: {
1736
+ allowlist?: string[];
1737
+ enabled?: boolean;
1738
+ };
1612
1739
  /** Monthly download-count floor. */
1613
1740
  downloads?: {
1614
1741
  allowlist?: string[];
@@ -1637,12 +1764,30 @@ interface VisConfig {
1637
1764
  allowlist?: string[];
1638
1765
  enabled?: boolean;
1639
1766
  };
1767
+ /** Whole-package age heuristics (newly created / unmaintained). */
1768
+ packageAge?: {
1769
+ allowlist?: string[];
1770
+ enabled?: boolean; /** Package created fewer than this many days ago → error. Default 22. */
1771
+ newPackageDays?: number;
1772
+ /** No publish within this many days → warning. Default 365. */
1773
+ unmaintainedDays?: number;
1774
+ };
1640
1775
  /** Provenance regression check. */
1641
1776
  provenance?: {
1642
1777
  allowlist?: string[];
1643
1778
  enabled?: boolean;
1644
1779
  };
1645
1780
  /**
1781
+ * Composite "compromised-publish shape" detector — flags a single
1782
+ * version that simultaneously introduced/changed an install hook
1783
+ * AND dropped the provenance attestation a prior stable version
1784
+ * carried (the August 2025 s1ngularity / Nx fingerprint).
1785
+ */
1786
+ s1ngularity?: {
1787
+ allowlist?: string[];
1788
+ enabled?: boolean;
1789
+ };
1790
+ /**
1646
1791
  * ECDSA P-256 verification against npm's signing keys. Disabled
1647
1792
  * by default because npm coverage still has gaps that produce
1648
1793
  * noisy warnings on legitimate packages.
@@ -1867,6 +2012,54 @@ interface VisConfig {
1867
2012
  };
1868
2013
  };
1869
2014
  /**
2015
+ * Which provider wins merge conflicts when multiple are enabled (e.g.
2016
+ * both Socket.dev and deps.dev return data for the same package). The
2017
+ * primary provider's `score` is kept; alerts from secondaries are
2018
+ * appended and deduped by `key`. Defaults to whichever provider is
2019
+ * enabled first in this order: socket → deps-dev → snyk.
2020
+ */
2021
+ primaryProvider?: "deps-dev" | "snyk" | "socket";
2022
+ /**
2023
+ * Snyk data-source configuration. Snyk only contributes vulnerability
2024
+ * data (no maintenance / quality / supply-chain / license signal);
2025
+ * those axes stay neutral. Requires both an org id and an API token —
2026
+ * if either is missing the provider is skipped.
2027
+ * @see https://docs.snyk.io/snyk-api/using-specific-snyk-apis/issues-list-issues-for-a-package
2028
+ */
2029
+ snyk?: {
2030
+ /**
2031
+ * Snyk API token. Set via VIS_SNYK_TOKEN environment variable or
2032
+ * here.
2033
+ */
2034
+ apiToken?: string;
2035
+ /**
2036
+ * Snyk REST API version date sent as the `version` query param.
2037
+ * @default "2024-10-15"
2038
+ */
2039
+ apiVersion?: string;
2040
+ /**
2041
+ * Cache TTL in milliseconds for Snyk issue lookups.
2042
+ * @default 21_600_000 (6 hours)
2043
+ */
2044
+ cacheTtlMs?: number;
2045
+ /**
2046
+ * Enable Snyk security scanning on install/update/check/audit
2047
+ * commands.
2048
+ * @default false
2049
+ */
2050
+ enabled?: boolean;
2051
+ /**
2052
+ * Snyk organization id (the REST endpoint is org-scoped). Set via
2053
+ * VIS_SNYK_ORG environment variable or here.
2054
+ */
2055
+ orgId?: string;
2056
+ /**
2057
+ * Request timeout in milliseconds for the Snyk API.
2058
+ * @default 15_000 (15 seconds)
2059
+ */
2060
+ timeoutMs?: number;
2061
+ };
2062
+ /**
1870
2063
  * Socket.dev data-source configuration. Connection knobs only — score
1871
2064
  * thresholds and accepted-risk overrides moved to `policies.score` and
1872
2065
  * `security.acceptedRisks` respectively.