@visulima/vis 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +90 -57
- package/LICENSE.md +44 -1
- package/README.md +56 -0
- package/dist/bin.js +1 -1003
- package/dist/config.d.ts +1073 -68
- package/dist/config.js +1 -1
- package/dist/generate/index.d.ts +155 -30
- package/dist/packem_chunks/handler.js +1 -0
- package/dist/packem_chunks/handler10.js +1 -0
- package/dist/packem_chunks/handler11.js +1 -0
- package/dist/packem_chunks/handler12.js +153 -0
- package/dist/packem_chunks/handler13.js +1 -0
- package/dist/packem_chunks/handler14.js +3 -0
- package/dist/packem_chunks/handler15.js +1 -0
- package/dist/packem_chunks/handler16.js +2 -0
- package/dist/packem_chunks/handler17.js +7 -0
- package/dist/packem_chunks/handler18.js +1 -0
- package/dist/packem_chunks/handler19.js +19 -0
- package/dist/packem_chunks/handler2.js +1 -0
- package/dist/packem_chunks/handler20.js +428 -0
- package/dist/packem_chunks/handler21.js +22 -0
- package/dist/packem_chunks/handler22.js +3 -0
- package/dist/packem_chunks/handler23.js +5 -0
- package/dist/packem_chunks/handler24.js +1 -0
- package/dist/packem_chunks/handler25.js +20 -0
- package/dist/packem_chunks/handler26.js +1 -0
- package/dist/packem_chunks/handler27.js +1 -0
- package/dist/packem_chunks/handler28.js +1 -0
- package/dist/packem_chunks/handler29.js +2 -0
- package/dist/packem_chunks/handler3.js +2 -0
- package/dist/packem_chunks/handler30.js +22 -0
- package/dist/packem_chunks/handler31.js +1 -0
- package/dist/packem_chunks/handler32.js +1 -0
- package/dist/packem_chunks/handler33.js +37 -0
- package/dist/packem_chunks/handler34.js +3 -0
- package/dist/packem_chunks/handler35.js +23 -0
- package/dist/packem_chunks/handler36.js +5 -0
- package/dist/packem_chunks/handler37.js +27 -0
- package/dist/packem_chunks/handler38.js +1 -0
- package/dist/packem_chunks/handler39.js +2 -0
- package/dist/packem_chunks/handler4.js +5 -0
- package/dist/packem_chunks/handler40.js +1 -0
- package/dist/packem_chunks/handler41.js +5 -0
- package/dist/packem_chunks/handler42.js +1 -0
- package/dist/packem_chunks/handler43.js +24 -0
- package/dist/packem_chunks/handler44.js +3 -0
- package/dist/packem_chunks/handler45.js +1 -0
- package/dist/packem_chunks/handler5.js +4 -0
- package/dist/packem_chunks/handler6.js +2 -0
- package/dist/packem_chunks/handler7.js +24 -0
- package/dist/packem_chunks/handler8.js +6 -0
- package/dist/packem_chunks/handler9.js +8 -0
- package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +1 -0
- package/dist/packem_shared/ai-analysis-DDqXRFxY.js +67 -0
- package/dist/packem_shared/bin-BaZZ32BK.js +93 -0
- package/dist/packem_shared/cache-directory-DL8hfXeG.js +1 -0
- package/dist/packem_shared/catalog-CuSpuB_R.js +12 -0
- package/dist/packem_shared/dependency-scan-BoLG2Fez.js +1 -0
- package/dist/packem_shared/docker-BcfqH4Av.js +2 -0
- package/dist/packem_shared/flakiness-DSIHZGBT.js +1 -0
- package/dist/packem_shared/otelPlugin-DxyvBcXO.js +1 -0
- package/dist/packem_shared/runtime-check-CGHal8SO.js +1 -0
- package/dist/packem_shared/selectors-CfH9ZY08.js +3 -0
- package/dist/packem_shared/symbols-CIMw60-G.js +1 -0
- package/dist/packem_shared/toolchain-C3ZG0o_X.js +5 -0
- package/dist/packem_shared/typosquats-Bpq4zcWL.js +1 -0
- package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
- package/index.js +555 -727
- package/package.json +27 -19
- package/schemas/project.schema.json +1 -1
- package/schemas/vis-config.schema.json +47 -1
- package/dist/ai-analysis.d.ts +0 -26
- package/dist/ai-cache.d.ts +0 -21
- package/dist/ai-types.d.ts +0 -16
- package/dist/audit-config.d.ts +0 -24
- package/dist/bin.d.ts +0 -1
- package/dist/cache-directory.d.ts +0 -73
- package/dist/catalog.d.ts +0 -136
- package/dist/codeowners.d.ts +0 -30
- package/dist/commands/action-graph.d.ts +0 -8
- package/dist/commands/add.d.ts +0 -3
- package/dist/commands/affected.d.ts +0 -3
- package/dist/commands/ai.d.ts +0 -3
- package/dist/commands/analyze.d.ts +0 -3
- package/dist/commands/approve-builds.d.ts +0 -3
- package/dist/commands/audit.d.ts +0 -23
- package/dist/commands/cache.d.ts +0 -86
- package/dist/commands/check.d.ts +0 -3
- package/dist/commands/ci.d.ts +0 -19
- package/dist/commands/clean.d.ts +0 -3
- package/dist/commands/create/discovery.d.ts +0 -42
- package/dist/commands/create/index.d.ts +0 -13
- package/dist/commands/create/prompts.d.ts +0 -31
- package/dist/commands/create/random-name.d.ts +0 -15
- package/dist/commands/create/templates/builtin.d.ts +0 -15
- package/dist/commands/create/templates/generator.d.ts +0 -14
- package/dist/commands/create/templates/index.d.ts +0 -13
- package/dist/commands/create/templates/monorepo.d.ts +0 -16
- package/dist/commands/create/templates/remote.d.ts +0 -41
- package/dist/commands/create/templates/types.d.ts +0 -46
- package/dist/commands/create/utils.d.ts +0 -42
- package/dist/commands/dedupe.d.ts +0 -3
- package/dist/commands/devcontainer.d.ts +0 -3
- package/dist/commands/dlx.d.ts +0 -3
- package/dist/commands/docker.d.ts +0 -22
- package/dist/commands/doctor.d.ts +0 -15
- package/dist/commands/exec.d.ts +0 -3
- package/dist/commands/generate.d.ts +0 -10
- package/dist/commands/graph.d.ts +0 -3
- package/dist/commands/hook/constants.d.ts +0 -13
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/list.d.ts +0 -28
- package/dist/commands/hook/migrate.d.ts +0 -30
- package/dist/commands/hook/prek-builtins.d.ts +0 -8
- package/dist/commands/hook/prek.d.ts +0 -129
- package/dist/commands/hook/run.d.ts +0 -21
- package/dist/commands/hook/uninstall.d.ts +0 -3
- package/dist/commands/hook/validate.d.ts +0 -17
- package/dist/commands/ignore-helpers.d.ts +0 -157
- package/dist/commands/ignore.d.ts +0 -17
- package/dist/commands/implode.d.ts +0 -3
- package/dist/commands/info.d.ts +0 -3
- package/dist/commands/init.d.ts +0 -14
- package/dist/commands/install.d.ts +0 -3
- package/dist/commands/link.d.ts +0 -3
- package/dist/commands/list.d.ts +0 -3
- package/dist/commands/migrate/backup.d.ts +0 -8
- package/dist/commands/migrate/constants.d.ts +0 -16
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/gitleaks.d.ts +0 -29
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -22
- package/dist/commands/migrate/kingfisher.d.ts +0 -14
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/moon.d.ts +0 -5
- package/dist/commands/migrate/nano-staged.d.ts +0 -30
- package/dist/commands/migrate/nx.d.ts +0 -12
- package/dist/commands/migrate/prompt.d.ts +0 -2
- package/dist/commands/migrate/secretlint.d.ts +0 -14
- package/dist/commands/migrate/shared.d.ts +0 -29
- package/dist/commands/migrate/turborepo.d.ts +0 -11
- package/dist/commands/migrate/types.d.ts +0 -27
- package/dist/commands/migrate/verify.d.ts +0 -12
- package/dist/commands/optimize.d.ts +0 -38
- package/dist/commands/pm.d.ts +0 -3
- package/dist/commands/remove.d.ts +0 -3
- package/dist/commands/run.d.ts +0 -16
- package/dist/commands/sbom.d.ts +0 -10
- package/dist/commands/secrets.d.ts +0 -3
- package/dist/commands/sort-package-json.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -10
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/sync.d.ts +0 -16
- package/dist/commands/task-why.d.ts +0 -3
- package/dist/commands/unlink.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/upgrade.d.ts +0 -3
- package/dist/commands/why.d.ts +0 -3
- package/dist/docker.d.ts +0 -73
- package/dist/flakiness.d.ts +0 -40
- package/dist/generate/discover.d.ts +0 -29
- package/dist/generate/loader.d.ts +0 -15
- package/dist/generate/moon-adapter/filename-interp.d.ts +0 -42
- package/dist/generate/moon-adapter/filters.d.ts +0 -22
- package/dist/generate/moon-adapter/frontmatter.d.ts +0 -39
- package/dist/generate/moon-adapter/index.d.ts +0 -19
- package/dist/generate/moon-adapter/tera-subset.d.ts +0 -85
- package/dist/generate/moon-adapter/util.d.ts +0 -14
- package/dist/generate/prompts.d.ts +0 -25
- package/dist/generate/remote.d.ts +0 -43
- package/dist/generate/runner.d.ts +0 -37
- package/dist/generate/types.d.ts +0 -152
- package/dist/hooks.d.ts +0 -118
- package/dist/native-binding.d.ts +0 -158
- package/dist/output.d.ts +0 -40
- package/dist/overrides.d.ts +0 -82
- package/dist/package-manager.d.ts +0 -23
- package/dist/packem_shared/otelPlugin-CJLkguJ8.js +0 -1
- package/dist/plugins/config-loader.d.ts +0 -3
- package/dist/plugins/otel.d.ts +0 -63
- package/dist/plugins/post-command.d.ts +0 -3
- package/dist/plugins/security-enforcement.d.ts +0 -3
- package/dist/pm-runner.d.ts +0 -44
- package/dist/run-report.d.ts +0 -40
- package/dist/runtime-check.d.ts +0 -27
- package/dist/sbom/cyclonedx.d.ts +0 -39
- package/dist/sbom/installed-package.d.ts +0 -49
- package/dist/sbom/license.d.ts +0 -31
- package/dist/sbom/lockfile.d.ts +0 -34
- package/dist/sbom/purl.d.ts +0 -25
- package/dist/sbom/resolve-specifier.d.ts +0 -24
- package/dist/sbom/types.d.ts +0 -196
- package/dist/secrets/baseline.d.ts +0 -20
- package/dist/secrets/format.d.ts +0 -14
- package/dist/secrets/git.d.ts +0 -6
- package/dist/secrets/spinner.d.ts +0 -9
- package/dist/security.d.ts +0 -64
- package/dist/selectors.d.ts +0 -81
- package/dist/shell-history.d.ts +0 -16
- package/dist/socket-security.d.ts +0 -129
- package/dist/staged/cli-parse.d.ts +0 -18
- package/dist/staged/config.d.ts +0 -14
- package/dist/staged/errors/apply-empty-commit-error.d.ts +0 -4
- package/dist/staged/errors/config-error.d.ts +0 -4
- package/dist/staged/errors/get-backup-stash-error.d.ts +0 -4
- package/dist/staged/errors/git-error.d.ts +0 -6
- package/dist/staged/errors/index.d.ts +0 -12
- package/dist/staged/errors/restore-original-state-error.d.ts +0 -4
- package/dist/staged/errors/staged-error.d.ts +0 -8
- package/dist/staged/errors/task-error.d.ts +0 -6
- package/dist/staged/git/diff.d.ts +0 -76
- package/dist/staged/git/exec.d.ts +0 -43
- package/dist/staged/git/index.d.ts +0 -77
- package/dist/staged/git/stash.d.ts +0 -37
- package/dist/staged/index.d.ts +0 -13
- package/dist/staged/match.d.ts +0 -12
- package/dist/staged/renderer/index.d.ts +0 -9
- package/dist/staged/renderer/ink/index.d.ts +0 -4
- package/dist/staged/renderer/plain.d.ts +0 -12
- package/dist/staged/tasks/build.d.ts +0 -13
- package/dist/staged/tasks/exec.d.ts +0 -56
- package/dist/staged/tasks/run.d.ts +0 -26
- package/dist/staged/types.d.ts +0 -173
- package/dist/target-discovery.d.ts +0 -59
- package/dist/target-options.d.ts +0 -261
- package/dist/tips.d.ts +0 -41
- package/dist/tui/components/CheckProgressApp.d.ts +0 -6
- package/dist/tui/components/CommandSummary.d.ts +0 -17
- package/dist/tui/components/Header.d.ts +0 -13
- package/dist/tui/components/OutputPanel.d.ts +0 -17
- package/dist/tui/components/QuitDialog.d.ts +0 -15
- package/dist/tui/components/TaskListPanel.d.ts +0 -19
- package/dist/tui/components/TaskRow.d.ts +0 -12
- package/dist/tui/components/TaskStore.d.ts +0 -80
- package/dist/tui/components/VisTaskRunnerApp.d.ts +0 -17
- package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +0 -66
- package/dist/tui/components/devcontainer/VisDevcontainerApp.d.ts +0 -9
- package/dist/tui/components/devcontainer/catalogs/extensions.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/features.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/filters.d.ts +0 -4
- package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +0 -19
- package/dist/tui/components/devcontainer/catalogs/templates.d.ts +0 -8
- package/dist/tui/components/devcontainer/devcontainer-io.d.ts +0 -14
- package/dist/tui/components/devcontainer/sections/DockerComposeSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/EnvironmentSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/ExtensionsSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/FeaturesSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +0 -12
- package/dist/tui/components/devcontainer/sections/LifecycleSection.d.ts +0 -13
- package/dist/tui/components/devcontainer/sections/MountsSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/PortsSection.d.ts +0 -10
- package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +0 -11
- package/dist/tui/components/devcontainer/types.d.ts +0 -53
- package/dist/tui/components/devcontainer/validate.d.ts +0 -16
- package/dist/tui/components/graph/GraphStore.d.ts +0 -42
- package/dist/tui/components/graph/ProjectDetailPanel.d.ts +0 -10
- package/dist/tui/components/graph/ProjectListPanel.d.ts +0 -20
- package/dist/tui/components/graph/VisGraphApp.d.ts +0 -8
- package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +0 -9
- package/dist/tui/components/optimize/OptimizeListPanel.d.ts +0 -16
- package/dist/tui/components/optimize/OptimizeStore.d.ts +0 -50
- package/dist/tui/components/optimize/VisOptimizeApp.d.ts +0 -8
- package/dist/tui/components/optimize/constants.d.ts +0 -7
- package/dist/tui/components/update/PackageDetailPanel.d.ts +0 -12
- package/dist/tui/components/update/PackageListPanel.d.ts +0 -21
- package/dist/tui/components/update/UpdateStore.d.ts +0 -62
- package/dist/tui/components/update/VisUpdateApp.d.ts +0 -18
- package/dist/tui/dynamic-life-cycle.d.ts +0 -22
- package/dist/tui/formatting-utils.d.ts +0 -17
- package/dist/tui/pretty-time.d.ts +0 -8
- package/dist/tui/static-life-cycle.d.ts +0 -28
- package/dist/tui/status-utils.d.ts +0 -20
- package/dist/tui/symbols.d.ts +0 -7
- package/dist/tui/types.d.ts +0 -11
- package/dist/typosquats.d.ts +0 -70
- package/dist/upgrade-check.d.ts +0 -30
- package/dist/utils.d.ts +0 -22
- package/dist/watch.d.ts +0 -65
- package/dist/workspace.d.ts +0 -675
package/dist/plugins/otel.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { Task } from "@visulima/task-runner";
|
|
2
|
-
import type { VisPlugin } from "../hooks.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Minimal OTel-shaped span. Deliberately structural so users can pass
|
|
5
|
-
* an `@opentelemetry/api` Tracer, an `@opentelemetry/sdk-node` one, or
|
|
6
|
-
* a custom implementation without the plugin depending on any
|
|
7
|
-
* particular OTel package.
|
|
8
|
-
*/
|
|
9
|
-
export interface OtelSpan {
|
|
10
|
-
end: () => void;
|
|
11
|
-
recordException?: (error: unknown) => void;
|
|
12
|
-
setAttribute?: (key: string, value: boolean | number | string) => void;
|
|
13
|
-
setStatus?: (status: {
|
|
14
|
-
code: number;
|
|
15
|
-
message?: string;
|
|
16
|
-
}) => void;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Minimal Tracer contract. Accepts the real
|
|
20
|
-
* `@opentelemetry/api`'s `Tracer.startSpan(name, options?)` shape —
|
|
21
|
-
* the plugin only calls the two methods it strictly needs.
|
|
22
|
-
*/
|
|
23
|
-
export interface OtelTracer {
|
|
24
|
-
startSpan: (name: string, options?: {
|
|
25
|
-
attributes?: Record<string, string | number | boolean>;
|
|
26
|
-
}) => OtelSpan;
|
|
27
|
-
}
|
|
28
|
-
export interface OtelPluginOptions {
|
|
29
|
-
/**
|
|
30
|
-
* Rename incoming `project:target` IDs before they become OTel
|
|
31
|
-
* span names. Defaults to passing the id through unchanged.
|
|
32
|
-
*/
|
|
33
|
-
renameSpan?: (task: Task) => string;
|
|
34
|
-
/** Tracer used to emit spans. Required — pass the one from `@opentelemetry/api`'s `trace.getTracer("vis")`. */
|
|
35
|
-
tracer: OtelTracer;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Reference plugin that maps vis hook lifecycle events to OTel spans.
|
|
39
|
-
*
|
|
40
|
-
* Emits:
|
|
41
|
-
* - one **root span** named `vis.run` spanning `run:before` → `run:after`
|
|
42
|
-
* - one **child span** per task spanning `task:before` → `task:after`
|
|
43
|
-
* with attributes `vis.task.id`, `vis.task.project`, `vis.task.target`,
|
|
44
|
-
* `vis.task.cache_status`, `vis.task.exit_code`
|
|
45
|
-
* - `task:failure` sets span status to ERROR and records the exit code
|
|
46
|
-
*
|
|
47
|
-
* Streaming stdout/stderr events are intentionally **not** emitted as
|
|
48
|
-
* span events — high-frequency chunks would blow up OTel backends. Use
|
|
49
|
-
* a log exporter if you need stream-level visibility.
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* import { trace } from "@opentelemetry/api";
|
|
53
|
-
* import { defineConfig } from "@visulima/vis/config";
|
|
54
|
-
* import { otelPlugin } from "@visulima/vis/plugins/otel";
|
|
55
|
-
*
|
|
56
|
-
* const tracer = trace.getTracer("vis", "1.0.0");
|
|
57
|
-
*
|
|
58
|
-
* export default defineConfig({
|
|
59
|
-
* plugins: [otelPlugin({ tracer })],
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export declare const otelPlugin: (options: OtelPluginOptions) => VisPlugin;
|
package/dist/pm-runner.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helper for executing package manager commands via native Rust bindings.
|
|
3
|
-
* Falls back to JS-based detection when native bindings are unavailable.
|
|
4
|
-
*/
|
|
5
|
-
import type { AddOptions, DlxOptions, ExecOptions, InstallOptions, OutdatedOptions, RemoveOptions, ResolvedCommand, WhyOptions } from "./native-binding.d.ts";
|
|
6
|
-
interface PmInfo {
|
|
7
|
-
name: "bun" | "npm" | "pnpm" | "yarn";
|
|
8
|
-
version: string;
|
|
9
|
-
}
|
|
10
|
-
declare const detectPm: (cwd: string) => PmInfo;
|
|
11
|
-
declare const runInstall: (pm: PmInfo, options: InstallOptions, cwd: string, logger: Console) => number;
|
|
12
|
-
declare const runAdd: (pm: PmInfo, options: AddOptions, cwd: string, logger: Console) => number;
|
|
13
|
-
declare const runRemove: (pm: PmInfo, options: RemoveOptions, cwd: string, logger: Console) => number;
|
|
14
|
-
declare const runDedupe: (pm: PmInfo, check: boolean, cwd: string, logger: Console) => number;
|
|
15
|
-
declare const runWhy: (pm: PmInfo, options: WhyOptions, cwd: string, logger: Console) => number;
|
|
16
|
-
declare const runOutdated: (pm: PmInfo, options: OutdatedOptions, cwd: string, logger: Console) => number;
|
|
17
|
-
interface InfoOptions {
|
|
18
|
-
fields: string[];
|
|
19
|
-
json: boolean;
|
|
20
|
-
package: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Resolves a registry metadata lookup to a runnable command. Built in TS
|
|
24
|
-
* rather than the Rust resolver because bun needs `pm view` (two-word
|
|
25
|
-
* subcommand) and yarn berry needs `yarn npm info` — both shapes the existing
|
|
26
|
-
* `resolve_pm_command` view branch gets wrong.
|
|
27
|
-
*
|
|
28
|
-
* Pure function — exported for unit testing.
|
|
29
|
-
*/
|
|
30
|
-
declare const resolveInfo: (pm: PmInfo, options: InfoOptions) => ResolvedCommand;
|
|
31
|
-
declare const runInfo: (pm: PmInfo, options: InfoOptions, cwd: string, logger: Console) => number;
|
|
32
|
-
/**
|
|
33
|
-
* Resolves and runs a PM `link` operation. Passes `pm.version` to the native
|
|
34
|
-
* resolver so it can warn about pnpm v11 restrictions (arg-less link and
|
|
35
|
-
* global-store name resolution were removed). `target` is `null` for arg-less
|
|
36
|
-
* link, or a package name / path string.
|
|
37
|
-
*/
|
|
38
|
-
declare const runLink: (pm: PmInfo, target: string | null, cwd: string, logger: Console) => number;
|
|
39
|
-
declare const runUnlink: (pm: PmInfo, packages: string[], recursive: boolean, cwd: string, logger: Console) => number;
|
|
40
|
-
declare const runDlx: (pm: PmInfo, options: DlxOptions, cwd: string, logger: Console) => number;
|
|
41
|
-
declare const runExec: (pm: PmInfo, options: ExecOptions, cwd: string, logger: Console) => number;
|
|
42
|
-
declare const runPmSubcommand: (pm: PmInfo, subcommand: string, args: string[], cwd: string, logger: Console) => number;
|
|
43
|
-
export type { InfoOptions, PmInfo };
|
|
44
|
-
export { detectPm, resolveInfo, runAdd, runDedupe, runDlx, runExec, runInfo, runInstall, runLink, runOutdated, runPmSubcommand, runRemove, runUnlink, runWhy };
|
package/dist/run-report.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { TaskResults } from "@visulima/task-runner";
|
|
2
|
-
/**
|
|
3
|
-
* Formats a compact one-line timing summary for display after a run.
|
|
4
|
-
* @param results Task execution results.
|
|
5
|
-
* @param durationMs Total wall-clock duration in milliseconds.
|
|
6
|
-
* @returns A formatted summary string, e.g. "3 succeeded · 1 cached · 0 failed · 2.4s"
|
|
7
|
-
*/
|
|
8
|
-
export declare const formatTimingSummary: (results: TaskResults, durationMs: number) => string;
|
|
9
|
-
/**
|
|
10
|
-
* Shape of a persisted run summary — only the fields this module + the
|
|
11
|
-
* flakiness analyzer consume. Kept narrow so both consumers can share
|
|
12
|
-
* one loader without pulling in the full `RunSummary` type from
|
|
13
|
-
* task-runner.
|
|
14
|
-
*/
|
|
15
|
-
export interface LoadedRunSummary {
|
|
16
|
-
[key: string]: unknown;
|
|
17
|
-
duration?: number;
|
|
18
|
-
startTime?: string;
|
|
19
|
-
tasks?: unknown[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Reads every `.task-runner/runs/*.json` once and returns the parsed
|
|
23
|
-
* array. Callers that need to iterate historical runs (timing average,
|
|
24
|
-
* flakiness analysis) should call this once per command and feed the
|
|
25
|
-
* result into the downstream helpers rather than re-reading the
|
|
26
|
-
* directory multiple times.
|
|
27
|
-
*
|
|
28
|
-
* Corrupt or unreadable files are skipped silently — a single bad
|
|
29
|
-
* summary shouldn't take down the whole analysis.
|
|
30
|
-
*/
|
|
31
|
-
export declare const loadRunSummaries: (workspaceRoot: string) => LoadedRunSummary[];
|
|
32
|
-
/**
|
|
33
|
-
* Loads durations from historical run summaries and computes the
|
|
34
|
-
* average. Returns the comparison string or `undefined` if no history.
|
|
35
|
-
*
|
|
36
|
-
* Pass `summaries` (from {@link loadRunSummaries}) when the caller
|
|
37
|
-
* has already loaded the history for another purpose (e.g. flakiness
|
|
38
|
-
* analysis on a failing run) to avoid re-reading the same files.
|
|
39
|
-
*/
|
|
40
|
-
export declare const compareDuration: (workspaceRoot: string, currentDurationMs: number, summaries?: LoadedRunSummary[]) => string | undefined;
|
package/dist/runtime-check.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime-version mismatch finding. vis doesn't manage runtimes directly,
|
|
3
|
-
* but it can warn when the currently running Node/Bun/Deno doesn't match
|
|
4
|
-
* whatever the repo has declared — usually a sign the user forgot to
|
|
5
|
-
* switch runtimes for this workspace.
|
|
6
|
-
*/
|
|
7
|
-
export interface RuntimeFinding {
|
|
8
|
-
actual: string;
|
|
9
|
-
expected: string;
|
|
10
|
-
kind: "node" | "packageManager";
|
|
11
|
-
message: string;
|
|
12
|
-
severity: "error" | "warning";
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Evaluates a minimal subset of semver ranges: `>=X`, `X.Y`, `X.Y.Z`,
|
|
16
|
-
* and compound `>=X <Y`. Returns true if `actual` satisfies the range.
|
|
17
|
-
* Falls back to "true" for unrecognised syntax rather than false so we
|
|
18
|
-
* don't spam warnings on exotic ranges.
|
|
19
|
-
*/
|
|
20
|
-
export declare const satisfiesRange: (actual: string, range: string) => boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Checks `engines.node`, `.nvmrc`, `.node-version`, and `packageManager`
|
|
23
|
-
* against the running process.
|
|
24
|
-
* @param workspaceRoot Absolute path to the workspace root.
|
|
25
|
-
* @returns Findings; an empty array means everything matches.
|
|
26
|
-
*/
|
|
27
|
-
export declare const checkRuntimeVersions: (workspaceRoot: string) => RuntimeFinding[];
|
package/dist/sbom/cyclonedx.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ProjectGraph, WorkspaceConfiguration } from "@visulima/task-runner";
|
|
2
|
-
import type { CycloneDxBom } from "./types.d.ts";
|
|
3
|
-
export interface BuildSbomOptions {
|
|
4
|
-
/** If set, limit the emitted BOM to these projects + their transitive closure. */
|
|
5
|
-
focus?: string[];
|
|
6
|
-
/** Optional package.json version of vis itself — stamped into `metadata.tools`. */
|
|
7
|
-
generatorVersion?: string;
|
|
8
|
-
/** Include devDependencies in the emitted BOM (default: false — production only). */
|
|
9
|
-
includeDev?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Override the `serialNumber`. Useful for deterministic tests; in
|
|
12
|
-
* production the builder generates one per call.
|
|
13
|
-
*/
|
|
14
|
-
now?: Date;
|
|
15
|
-
/** Project graph used for resolving focus closure and dependency edges. */
|
|
16
|
-
projectGraph: ProjectGraph;
|
|
17
|
-
/** Override the `serialNumber` (defaults to a fresh UUID). */
|
|
18
|
-
serialNumber?: string;
|
|
19
|
-
/** Workspace configuration with resolved project roots. */
|
|
20
|
-
workspace: WorkspaceConfiguration;
|
|
21
|
-
/** Workspace root on disk. */
|
|
22
|
-
workspaceRoot: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Builds the BOM from workspace + lockfile data. Pure function — all
|
|
26
|
-
* I/O is relative to `workspaceRoot` so tests point it at a temp dir.
|
|
27
|
-
*/
|
|
28
|
-
export declare const buildCycloneDxBom: (options: BuildSbomOptions) => CycloneDxBom;
|
|
29
|
-
/**
|
|
30
|
-
* Serialises a {@link CycloneDxBom} document to CycloneDX 1.6 XML.
|
|
31
|
-
*
|
|
32
|
-
* Delegates all escaping, indentation, and attribute serialisation to
|
|
33
|
-
* the project-standard `jstoxml` library (already used elsewhere in
|
|
34
|
-
* the monorepo — see `packages/api/api-platform` and
|
|
35
|
-
* `packages/error-debugging/error-handler`). We only translate our
|
|
36
|
-
* typed JSON-shaped BOM into jstoxml's `{ _name, _attrs, _content }`
|
|
37
|
-
* tree.
|
|
38
|
-
*/
|
|
39
|
-
export declare const serializeBomToXml: (bom: CycloneDxBom) => string;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-version metadata lookup for installed packages.
|
|
3
|
-
*
|
|
4
|
-
* An SBOM needs each `name@version` component to declare its own
|
|
5
|
-
* licence, description, and author — not the top-level project's.
|
|
6
|
-
* Different versions of the same package can ship different licence
|
|
7
|
-
* texts (common during a licence migration, e.g. `foo@4` is MIT but
|
|
8
|
-
* `foo@5` is Apache-2.0), so we resolve the metadata against the
|
|
9
|
-
* specific on-disk install tree rather than the lockfile or a single
|
|
10
|
-
* hoisted copy.
|
|
11
|
-
*
|
|
12
|
-
* The helper is best-effort: we try common install-tree layouts in
|
|
13
|
-
* order and return `undefined` the moment we fail to find a match. A
|
|
14
|
-
* missing metadata doesn't block SBOM generation — the component is
|
|
15
|
-
* just emitted without licence/author/description decoration.
|
|
16
|
-
*/
|
|
17
|
-
import type { RawLicenseInput } from "./license.d.ts";
|
|
18
|
-
/** Subset of `package.json` surfaced onto installed-package components. */
|
|
19
|
-
export interface InstalledPackageMetadata extends RawLicenseInput {
|
|
20
|
-
author?: string | {
|
|
21
|
-
email?: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
url?: string;
|
|
24
|
-
};
|
|
25
|
-
bugs?: string | {
|
|
26
|
-
url?: string;
|
|
27
|
-
};
|
|
28
|
-
description?: string;
|
|
29
|
-
homepage?: string;
|
|
30
|
-
name?: string;
|
|
31
|
-
repository?: string | {
|
|
32
|
-
type?: string;
|
|
33
|
-
url?: string;
|
|
34
|
-
};
|
|
35
|
-
version?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Looks up the installed `package.json` for a specific `name@version`.
|
|
39
|
-
* Tries pnpm's virtual store first (exact match by construction), then
|
|
40
|
-
* falls back to the hoisted `node_modules/<name>/package.json` if its
|
|
41
|
-
* version matches.
|
|
42
|
-
*
|
|
43
|
-
* Returns `undefined` if nothing on disk matches the requested version,
|
|
44
|
-
* **or if `name`/`version` contains characters that could be used for
|
|
45
|
-
* path traversal**. A malicious lockfile carrying e.g.
|
|
46
|
-
* `version: "../../../etc"` would otherwise escape `workspaceRoot`
|
|
47
|
-
* because `join` collapses `..` segments.
|
|
48
|
-
*/
|
|
49
|
-
export declare const readInstalledPackageMetadata: (workspaceRoot: string, name: string, version: string) => InstalledPackageMetadata | undefined;
|
package/dist/sbom/license.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { LicenseChoice } from "./types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Case-insensitively resolves a raw licence string to its canonical
|
|
4
|
-
* SPDX ID, or `undefined` if the input doesn't match anything we know
|
|
5
|
-
* about.
|
|
6
|
-
*/
|
|
7
|
-
export declare const normalizeSpdxId: (raw: string) => string | undefined;
|
|
8
|
-
/** Shape we accept from raw `package.json` metadata. */
|
|
9
|
-
export interface RawLicenseInput {
|
|
10
|
-
/** Legacy `license: { type: "MIT" }` form. */
|
|
11
|
-
license?: {
|
|
12
|
-
type?: string;
|
|
13
|
-
} | string;
|
|
14
|
-
/** Legacy `licenses: [{ type: "MIT" }]` array form. */
|
|
15
|
-
licenses?: {
|
|
16
|
-
type?: string;
|
|
17
|
-
}[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Extracts a single licence declaration from a `package.json` (or
|
|
21
|
-
* similar), converting it to the CycloneDX {@link LicenseChoice}
|
|
22
|
-
* shape. Supports the three encodings npm has historically blessed:
|
|
23
|
-
*
|
|
24
|
-
* - `license: "MIT"` (string)
|
|
25
|
-
* - `license: "(MIT OR Apache-2.0)"` (SPDX expression)
|
|
26
|
-
* - `license: { type: "MIT" }` (object, deprecated but common)
|
|
27
|
-
* - `licenses: [{ type: "MIT" }, …]` (array, deprecated)
|
|
28
|
-
*
|
|
29
|
-
* Returns `undefined` if no licence was declared.
|
|
30
|
-
*/
|
|
31
|
-
export declare const extractLicenseChoice: (input: RawLicenseInput) => LicenseChoice | undefined;
|
package/dist/sbom/lockfile.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Thin CycloneDX-shaped adapter over the shared lockfile parser in
|
|
3
|
-
* `@visulima/package`. The cross-package parser returns a
|
|
4
|
-
* package-manager-agnostic `{ name, version, integrity: { algorithm, hex } }`
|
|
5
|
-
* shape; CycloneDX 1.6 expects hashes as `{ alg: "SHA-256" | …, content }`,
|
|
6
|
-
* so we translate the algorithm casing here.
|
|
7
|
-
*/
|
|
8
|
-
import type { LockFileType } from "@visulima/package";
|
|
9
|
-
import type { Hash } from "./types.d.ts";
|
|
10
|
-
/** Exposed so downstream callers (and tests) can stay decoupled from `@visulima/package`. */
|
|
11
|
-
/** Resolved package in the shape the SBOM builder consumes. */
|
|
12
|
-
export interface ResolvedPackage {
|
|
13
|
-
/**
|
|
14
|
-
* Declared runtime deps — `name → specifier[]` from the lockfile.
|
|
15
|
-
* Arrays preserve pnpm v9+ peer-context variants that resolve the
|
|
16
|
-
* same dep name to different versions.
|
|
17
|
-
*/
|
|
18
|
-
dependencies?: Record<string, string[]>;
|
|
19
|
-
hash?: Hash;
|
|
20
|
-
name: string;
|
|
21
|
-
optionalDependencies?: Record<string, string[]>;
|
|
22
|
-
peerDependencies?: Record<string, string[]>;
|
|
23
|
-
version: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Reads the lockfile at `workspaceRoot` (not ancestors — workspaces
|
|
27
|
-
* own their lockfile) and returns entries keyed by `name@version`.
|
|
28
|
-
* Returns `undefined` if no supported lockfile is present.
|
|
29
|
-
*/
|
|
30
|
-
export declare const readLockfilePackages: (workspaceRoot: string) => {
|
|
31
|
-
packages: Map<string, ResolvedPackage>;
|
|
32
|
-
type: LockFileType;
|
|
33
|
-
} | undefined;
|
|
34
|
-
export { type LockFileType } from "@visulima/package";
|
package/dist/sbom/purl.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zero-dependency implementation of the Package URL (PURL) spec, scoped
|
|
3
|
-
* to the `pkg:npm/…` type — the only scheme CycloneDX 1.6 needs for
|
|
4
|
-
* npm-ecosystem SBOMs.
|
|
5
|
-
*
|
|
6
|
-
* Reference: https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#npm
|
|
7
|
-
*
|
|
8
|
-
* Rules we implement:
|
|
9
|
-
*
|
|
10
|
-
* 1. The `name` segment is **lowercased** for `pkg:npm` (npm package
|
|
11
|
-
* names are already case-insensitive in the registry).
|
|
12
|
-
* 2. Scope is carried as a PURL **namespace** (`pkg:npm/@scope/name`)
|
|
13
|
-
* with the `@` percent-encoded per RFC 3986 (→ `%40`).
|
|
14
|
-
* 3. `name`, `namespace`, and `version` segments are percent-encoded
|
|
15
|
-
* using the "unreserved characters + colon/slash inside version"
|
|
16
|
-
* ruleset — we keep this small and conservative (encode anything
|
|
17
|
-
* outside `[A-Za-z0-9._~-]`).
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Builds a `pkg:npm/…` Package URL from an npm package name + version.
|
|
21
|
-
* @param packageName The npm package name, scoped or unscoped.
|
|
22
|
-
* @param version The resolved exact version.
|
|
23
|
-
* @returns A well-formed PURL string.
|
|
24
|
-
*/
|
|
25
|
-
export declare const toNpmPurl: (packageName: string, version: string) => string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves `name + specifier` to a concrete `name@version` install from
|
|
3
|
-
* a lockfile-derived index.
|
|
4
|
-
*
|
|
5
|
-
* Lockfiles don't encode every edge uniformly:
|
|
6
|
-
*
|
|
7
|
-
* - pnpm stores **resolved** versions in each entry's `dependencies`
|
|
8
|
-
* sub-map, so the specifier is already the install's exact version.
|
|
9
|
-
* - npm / yarn / bun store **semver ranges** (or dist-tags); we have
|
|
10
|
-
* to match the range against the set of versions we know exist for
|
|
11
|
-
* the given `name`.
|
|
12
|
-
*
|
|
13
|
-
* We try exact match first (cheap, handles pnpm), then fall back to
|
|
14
|
-
* `semver.maxSatisfying` over every known version of `name`, and
|
|
15
|
-
* finally to "pick one version" so a partial-lockfile input still
|
|
16
|
-
* produces a best-effort edge.
|
|
17
|
-
*/
|
|
18
|
-
/** `name → Set<version>` index built from every lockfile entry. */
|
|
19
|
-
export type VersionIndex = Map<string, Set<string>>;
|
|
20
|
-
/**
|
|
21
|
-
* Resolves a single `name + specifier` pair to a concrete version, or
|
|
22
|
-
* `undefined` if the name isn't in the lockfile at all.
|
|
23
|
-
*/
|
|
24
|
-
export declare const resolveSpecifier: (name: string, specifier: string, index: VersionIndex) => string | undefined;
|
package/dist/sbom/types.d.ts
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript types for the subset of CycloneDX 1.6 that `vis sbom` emits.
|
|
3
|
-
*
|
|
4
|
-
* These types are hand-maintained against the vendored schema at
|
|
5
|
-
* `__tests__/sbom/schemas/bom-1.6.schema.json` (upstream tag 1.6.1). They
|
|
6
|
-
* intentionally cover only the shapes the SBOM generator produces —
|
|
7
|
-
* `services`, `vulnerabilities`, `compositions`, `annotations`,
|
|
8
|
-
* `formulation`, `declarations`, `signature`, `pedigree`, `evidence`,
|
|
9
|
-
* `modelCard`, and crypto-asset fields are omitted.
|
|
10
|
-
*
|
|
11
|
-
* The schema is still the source of truth: see
|
|
12
|
-
* `__tests__/sbom/schema-conformance.test.ts` for the ajv-backed validator
|
|
13
|
-
* that runs on every emitted BOM.
|
|
14
|
-
*/
|
|
15
|
-
/** Hash algorithms permitted by CycloneDX 1.6. */
|
|
16
|
-
export type HashAlgorithm = "BLAKE2b-256" | "BLAKE2b-384" | "BLAKE2b-512" | "BLAKE3" | "MD5" | "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512" | "SHA3-256" | "SHA3-384" | "SHA3-512";
|
|
17
|
-
/** A single hash entry on a component. */
|
|
18
|
-
export interface Hash {
|
|
19
|
-
alg: HashAlgorithm;
|
|
20
|
-
/** Hex-encoded digest (no `sha512-` prefix; integrity strings from npm lockfiles must be stripped + base64-decoded first). */
|
|
21
|
-
content: string;
|
|
22
|
-
}
|
|
23
|
-
/** Component type enumeration. */
|
|
24
|
-
export type ComponentType = "application" | "container" | "cryptographic-asset" | "data" | "device" | "device-driver" | "file" | "firmware" | "framework" | "library" | "machine-learning-model" | "operating-system" | "platform";
|
|
25
|
-
/** Dependency scope on a component. */
|
|
26
|
-
export type ComponentScope = "excluded" | "optional" | "required";
|
|
27
|
-
/** License acknowledgement status. */
|
|
28
|
-
export type LicenseAcknowledgement = "concluded" | "declared";
|
|
29
|
-
/** Fields shared by every licence variant. */
|
|
30
|
-
export interface LicenseBase {
|
|
31
|
-
acknowledgement?: LicenseAcknowledgement;
|
|
32
|
-
"bom-ref"?: string;
|
|
33
|
-
text?: Attachment;
|
|
34
|
-
url?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* A named or SPDX-identified licence.
|
|
38
|
-
*
|
|
39
|
-
* The schema requires exactly one of `id` or `name` to be present; this is
|
|
40
|
-
* modelled as a discriminated union so the constraint is enforced at the
|
|
41
|
-
* type level rather than just at ajv-validation time.
|
|
42
|
-
*/
|
|
43
|
-
export type License = NamedLicense | SpdxLicense;
|
|
44
|
-
/** SPDX-identified licence (`id` is a valid SPDX licence identifier). */
|
|
45
|
-
export interface SpdxLicense extends LicenseBase {
|
|
46
|
-
/** SPDX licence identifier (e.g. `"MIT"`). */
|
|
47
|
-
id: string;
|
|
48
|
-
name?: never;
|
|
49
|
-
}
|
|
50
|
-
/** Free-form licence where no SPDX identifier matches. */
|
|
51
|
-
export interface NamedLicense extends LicenseBase {
|
|
52
|
-
id?: never;
|
|
53
|
-
/** Free-form licence name. */
|
|
54
|
-
name: string;
|
|
55
|
-
}
|
|
56
|
-
/** A single licence entry in the `licenses` array. */
|
|
57
|
-
export interface LicenseEntry {
|
|
58
|
-
license: License;
|
|
59
|
-
}
|
|
60
|
-
/** A single-element tuple carrying an SPDX expression. */
|
|
61
|
-
export interface LicenseExpressionEntry {
|
|
62
|
-
acknowledgement?: LicenseAcknowledgement;
|
|
63
|
-
"bom-ref"?: string;
|
|
64
|
-
expression: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Per the spec, `licenses` is EITHER a list of `{ license }` entries OR a
|
|
68
|
-
* one-element tuple carrying an SPDX expression — never mixed.
|
|
69
|
-
*/
|
|
70
|
-
export type LicenseChoice = LicenseEntry[] | [LicenseExpressionEntry];
|
|
71
|
-
/** Attachment (inline blob) used for licence texts, etc. */
|
|
72
|
-
export interface Attachment {
|
|
73
|
-
content: string;
|
|
74
|
-
contentType?: string;
|
|
75
|
-
encoding?: "base64";
|
|
76
|
-
}
|
|
77
|
-
/** Individual contact within an organisation. */
|
|
78
|
-
export interface OrganizationalContact {
|
|
79
|
-
"bom-ref"?: string;
|
|
80
|
-
email?: string;
|
|
81
|
-
name?: string;
|
|
82
|
-
phone?: string;
|
|
83
|
-
}
|
|
84
|
-
/** Postal address attached to an organisation. */
|
|
85
|
-
export interface PostalAddress {
|
|
86
|
-
"bom-ref"?: string;
|
|
87
|
-
country?: string;
|
|
88
|
-
locality?: string;
|
|
89
|
-
postalCode?: string;
|
|
90
|
-
region?: string;
|
|
91
|
-
streetAddress?: string;
|
|
92
|
-
}
|
|
93
|
-
/** Company / organisation metadata. */
|
|
94
|
-
export interface OrganizationalEntity {
|
|
95
|
-
address?: PostalAddress;
|
|
96
|
-
"bom-ref"?: string;
|
|
97
|
-
contact?: OrganizationalContact[];
|
|
98
|
-
name?: string;
|
|
99
|
-
url?: string[];
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* All 43 values from the CycloneDX 1.6 `externalReferenceType` enum. Kept
|
|
103
|
-
* exhaustive so any spec-legal reference type type-checks.
|
|
104
|
-
*/
|
|
105
|
-
export type ExternalReferenceType = "adversary-model" | "advisories" | "attestation" | "bom" | "build-meta" | "build-system" | "certification-report" | "chat" | "codified-infrastructure" | "component-analysis-report" | "configuration" | "digital-signature" | "distribution" | "distribution-intake" | "documentation" | "dynamic-analysis-report" | "electronic-signature" | "evidence" | "exploitability-statement" | "formulation" | "issue-tracker" | "license" | "log" | "mailing-list" | "maturity-report" | "model-card" | "other" | "pentest-report" | "poam" | "quality-metrics" | "release-notes" | "rfc-9116" | "risk-assessment" | "runtime-analysis-report" | "security-contact" | "social" | "source-distribution" | "static-analysis-report" | "support" | "threat-model" | "vcs" | "vulnerability-assertion" | "website";
|
|
106
|
-
/** External reference (website, VCS, distribution, etc.). */
|
|
107
|
-
export interface ExternalReference {
|
|
108
|
-
comment?: string;
|
|
109
|
-
hashes?: Hash[];
|
|
110
|
-
type: ExternalReferenceType;
|
|
111
|
-
url: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* A software component in the BOM. This is the shape `vis sbom` emits —
|
|
115
|
-
* it's a strict subset of the CycloneDX definition.
|
|
116
|
-
*/
|
|
117
|
-
export interface Component {
|
|
118
|
-
author?: string;
|
|
119
|
-
"bom-ref"?: string;
|
|
120
|
-
components?: Component[];
|
|
121
|
-
copyright?: string;
|
|
122
|
-
cpe?: string;
|
|
123
|
-
description?: string;
|
|
124
|
-
externalReferences?: ExternalReference[];
|
|
125
|
-
group?: string;
|
|
126
|
-
hashes?: Hash[];
|
|
127
|
-
licenses?: LicenseChoice;
|
|
128
|
-
manufacturer?: OrganizationalEntity;
|
|
129
|
-
"mime-type"?: string;
|
|
130
|
-
name: string;
|
|
131
|
-
properties?: Property[];
|
|
132
|
-
publisher?: string;
|
|
133
|
-
/** Package URL, e.g. `pkg:npm/@scope/name@1.2.3`. */
|
|
134
|
-
purl?: string;
|
|
135
|
-
scope?: ComponentScope;
|
|
136
|
-
supplier?: OrganizationalEntity;
|
|
137
|
-
tags?: string[];
|
|
138
|
-
type: ComponentType;
|
|
139
|
-
version?: string;
|
|
140
|
-
}
|
|
141
|
-
/** Arbitrary key-value metadata attachable to components and BOMs. */
|
|
142
|
-
export interface Property {
|
|
143
|
-
name: string;
|
|
144
|
-
value?: string;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* CycloneDX 1.5+ form of `metadata.tools`: a bag of tool components and
|
|
148
|
-
* (optionally) services. The legacy array form is intentionally not
|
|
149
|
-
* supported — new BOMs should use this shape.
|
|
150
|
-
*/
|
|
151
|
-
export interface ToolsAggregate {
|
|
152
|
-
components?: Component[];
|
|
153
|
-
}
|
|
154
|
-
/** BOM lifecycle phase (pre-defined names in the spec). */
|
|
155
|
-
export type LifecyclePhase = "build" | "decommission" | "design" | "discovery" | "operations" | "post-build" | "pre-build";
|
|
156
|
-
export interface Lifecycle {
|
|
157
|
-
description?: string;
|
|
158
|
-
name?: string;
|
|
159
|
-
phase?: LifecyclePhase;
|
|
160
|
-
}
|
|
161
|
-
export interface Metadata {
|
|
162
|
-
authors?: OrganizationalContact[];
|
|
163
|
-
component?: Component;
|
|
164
|
-
licenses?: LicenseChoice;
|
|
165
|
-
lifecycles?: Lifecycle[];
|
|
166
|
-
manufacturer?: OrganizationalEntity;
|
|
167
|
-
properties?: Property[];
|
|
168
|
-
supplier?: OrganizationalEntity;
|
|
169
|
-
/** ISO 8601 timestamp describing when the BOM was created. */
|
|
170
|
-
timestamp?: string;
|
|
171
|
-
tools?: ToolsAggregate;
|
|
172
|
-
}
|
|
173
|
-
/** A single edge in the dependency graph. */
|
|
174
|
-
export interface Dependency {
|
|
175
|
-
/** `bom-ref`s of components this component directly depends on. */
|
|
176
|
-
dependsOn?: string[];
|
|
177
|
-
/** `bom-ref`s of components this component provides (conformance claims). */
|
|
178
|
-
provides?: string[];
|
|
179
|
-
/** `bom-ref` of the subject component. */
|
|
180
|
-
ref: string;
|
|
181
|
-
}
|
|
182
|
-
/** The root CycloneDX 1.6 BOM document. */
|
|
183
|
-
export interface CycloneDxBom {
|
|
184
|
-
$schema?: string;
|
|
185
|
-
bomFormat: "CycloneDX";
|
|
186
|
-
components?: Component[];
|
|
187
|
-
dependencies?: Dependency[];
|
|
188
|
-
externalReferences?: ExternalReference[];
|
|
189
|
-
metadata?: Metadata;
|
|
190
|
-
properties?: Property[];
|
|
191
|
-
/** `urn:uuid:<rfc-4122>` — unique identifier for this specific BOM revision. */
|
|
192
|
-
serialNumber?: string;
|
|
193
|
-
specVersion: "1.6";
|
|
194
|
-
/** Monotonically increasing integer for BOM revisions (starts at 1). */
|
|
195
|
-
version?: number;
|
|
196
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Finding } from "@visulima/secret-scanner";
|
|
2
|
-
/** Convert a finding to the shape we persist in baselines (with paths relative to root). */
|
|
3
|
-
export declare const toRelativeFinding: (f: Finding, root: string) => Finding;
|
|
4
|
-
export interface BaselineDiff {
|
|
5
|
-
fresh: Finding[];
|
|
6
|
-
resolved: Finding[];
|
|
7
|
-
surviving: Finding[];
|
|
8
|
-
}
|
|
9
|
-
/** Compare current findings against an existing baseline. */
|
|
10
|
-
export declare const diffBaseline: (findings: Finding[], baselinePath: string, root: string) => BaselineDiff;
|
|
11
|
-
export interface WriteBaselineOptions {
|
|
12
|
-
/** If true, replace the file instead of merging with existing entries. */
|
|
13
|
-
replace?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Write `findings` to `baselinePath` with paths relative to `root`. By default
|
|
17
|
-
* merges with any existing baseline (so prior triage decisions for files not
|
|
18
|
-
* rescanned this run are preserved). Pass `replace: true` to overwrite.
|
|
19
|
-
*/
|
|
20
|
-
export declare const writeBaseline: (findings: Finding[], baselinePath: string, root: string, options?: WriteBaselineOptions) => number;
|
package/dist/secrets/format.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Finding, RuleInfo } from "@visulima/secret-scanner";
|
|
2
|
-
/** Pretty grouped text output with file headers, context lines, and carets. */
|
|
3
|
-
export declare const formatText: (findings: Finding[], root: string, useColor: boolean) => string;
|
|
4
|
-
/**
|
|
5
|
-
* Structured SARIF v2.1.0 output for GitHub / GitLab code-scanning.
|
|
6
|
-
*
|
|
7
|
-
* Polished for spec compliance:
|
|
8
|
-
* - `artifactLocation.uri` emits `file://` URIs for absolute paths (SARIF §3.4.2).
|
|
9
|
-
* - `tool.driver.rules` lists every rule that triggered, with `shortDescription` +
|
|
10
|
-
* `fullDescription` + `helpUri` so consumer UIs can render rule detail pages.
|
|
11
|
-
* - `result.level` stays `"error"` (everything we surface is an actionable leak).
|
|
12
|
-
* - `result.ruleIndex` cross-references into `tool.driver.rules` per SARIF §3.27.6.
|
|
13
|
-
*/
|
|
14
|
-
export declare const formatSarif: (findings: Finding[], toolVersion: string, root?: string, ruleMetadata?: RuleInfo[]) => string;
|
package/dist/secrets/git.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Absolute paths of files currently staged for commit (A/C/M/R only). */
|
|
2
|
-
export declare const stagedFiles: (root: string) => string[];
|
|
3
|
-
/** Absolute paths of files changed since `ref` (defaults to upstream/HEAD~1). */
|
|
4
|
-
export declare const filesSince: (root: string, ref: string) => string[];
|
|
5
|
-
/** True if `git` is on PATH and `root` is a working tree. */
|
|
6
|
-
export declare const hasGit: (root: string) => boolean;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface Spinner {
|
|
2
|
-
stop: (finalMessage?: string) => void;
|
|
3
|
-
update: (message: string) => void;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Minimal stderr spinner for TTY sessions. No-op when stderr isn't a TTY
|
|
7
|
-
* (CI, piped output). No dependencies beyond node stdlib.
|
|
8
|
-
*/
|
|
9
|
-
export declare const startSpinner: (message: string) => Spinner;
|