@visulima/vis 1.0.0-alpha.14 → 1.0.0-alpha.16

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 (104) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/LICENSE.md +1023 -277
  3. package/dist/bin.js +1 -1
  4. package/dist/config/index.d.ts +121 -94
  5. package/dist/config/index.js +1 -1
  6. package/dist/packem_chunks/bin.js +305 -302
  7. package/dist/packem_chunks/config.js +18 -0
  8. package/dist/packem_chunks/fix.js +1 -1
  9. package/dist/packem_chunks/handler.js +1 -1
  10. package/dist/packem_chunks/handler10.js +1 -1
  11. package/dist/packem_chunks/handler11.js +1 -1
  12. package/dist/packem_chunks/handler12.js +5 -5
  13. package/dist/packem_chunks/handler13.js +1 -1
  14. package/dist/packem_chunks/handler14.js +4 -4
  15. package/dist/packem_chunks/handler15.js +1 -1
  16. package/dist/packem_chunks/handler16.js +1 -1
  17. package/dist/packem_chunks/handler17.js +1 -1
  18. package/dist/packem_chunks/handler18.js +1 -1
  19. package/dist/packem_chunks/handler19.js +5 -5
  20. package/dist/packem_chunks/handler2.js +1 -1
  21. package/dist/packem_chunks/handler20.js +2 -1
  22. package/dist/packem_chunks/handler21.js +18 -1
  23. package/dist/packem_chunks/handler22.js +1 -5
  24. package/dist/packem_chunks/handler23.js +1 -1
  25. package/dist/packem_chunks/handler24.js +5 -3
  26. package/dist/packem_chunks/handler25.js +1 -1
  27. package/dist/packem_chunks/handler26.js +3 -1
  28. package/dist/packem_chunks/handler27.js +1 -7
  29. package/dist/packem_chunks/handler28.js +1 -23
  30. package/dist/packem_chunks/handler29.js +7 -3
  31. package/dist/packem_chunks/handler3.js +1 -1
  32. package/dist/packem_chunks/handler30.js +23 -18
  33. package/dist/packem_chunks/handler31.js +3 -1
  34. package/dist/packem_chunks/handler32.js +1 -2
  35. package/dist/packem_chunks/handler33.js +2 -25
  36. package/dist/packem_chunks/handler34.js +25 -2
  37. package/dist/packem_chunks/handler35.js +3 -3
  38. package/dist/packem_chunks/handler36.js +20 -20
  39. package/dist/packem_chunks/handler37.js +3 -3
  40. package/dist/packem_chunks/handler38.js +4 -4
  41. package/dist/packem_chunks/handler39.js +11 -11
  42. package/dist/packem_chunks/handler40.js +5 -5
  43. package/dist/packem_chunks/handler41.js +10 -24
  44. package/dist/packem_chunks/handler42.js +24 -10
  45. package/dist/packem_chunks/handler43.js +5 -5
  46. package/dist/packem_chunks/handler44.js +6 -6
  47. package/dist/packem_chunks/handler45.js +3 -3
  48. package/dist/packem_chunks/handler46.js +11 -11
  49. package/dist/packem_chunks/handler47.js +161 -36
  50. package/dist/packem_chunks/handler48.js +6 -6
  51. package/dist/packem_chunks/handler5.js +5 -5
  52. package/dist/packem_chunks/handler6.js +1 -1
  53. package/dist/packem_chunks/handler7.js +1 -1
  54. package/dist/packem_chunks/handler8.js +1 -1
  55. package/dist/packem_chunks/handler9.js +1 -1
  56. package/dist/packem_chunks/heal-accept.js +2 -2
  57. package/dist/packem_chunks/heal.js +1 -1
  58. package/dist/packem_chunks/help-command.js +16 -16
  59. package/dist/packem_chunks/index.js +2 -2
  60. package/dist/packem_chunks/loader.js +1 -1
  61. package/dist/packem_chunks/tar.js +1 -1
  62. package/dist/packem_shared/{ai-analysis-Dzs_nUwM.js → ai-analysis-C_GpXikx.js} +3 -3
  63. package/dist/packem_shared/ai-cache-DrCLD4gc.js +1 -0
  64. package/dist/packem_shared/ai-fix-CWOz12Om.js +43 -0
  65. package/dist/packem_shared/applyDefaults-DLY94gWA.js +1 -0
  66. package/dist/packem_shared/cache-directory-C_U1qsIw.js +1 -0
  67. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  68. package/dist/packem_shared/dependency-scan-YdgNVvoz.js +2 -0
  69. package/dist/packem_shared/docker-Dl0AoVTZ.js +60 -0
  70. package/dist/packem_shared/failure-log-CSC6KfcO.js +2 -0
  71. package/dist/packem_shared/flakiness-Dzz-I3dB.js +1 -0
  72. package/dist/packem_shared/{giget-BX2ixMoa.js → giget-CcEy_Elm.js} +2 -2
  73. package/dist/packem_shared/lifecycle-BC6Nst6i.js +2 -0
  74. package/dist/packem_shared/lockfile-i-qvq_k8.js +1 -0
  75. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  76. package/dist/packem_shared/readTomlSync-1fKo0R52-DtxWULlF.js +109 -0
  77. package/dist/packem_shared/run-summary-utils-CJv75pla.js +1 -0
  78. package/dist/packem_shared/runtime-check-CBU6W8qG.js +1 -0
  79. package/dist/packem_shared/{selectors-BvtUXWGY.js → selectors-B2ISH581.js} +1 -1
  80. package/dist/packem_shared/toolchain-B7dckBQ1.js +5 -0
  81. package/dist/packem_shared/typosquats-B3A38-qx.js +1 -0
  82. package/dist/packem_shared/verify-WDStBFvK.js +1 -0
  83. package/dist/packem_shared/vis-update-app-D0uL3eO5.js +1 -0
  84. package/package.json +13 -15
  85. package/schemas/project.schema.json +12 -2
  86. package/schemas/vis-config.schema.json +248 -3
  87. package/dist/packem_chunks/applyDefaults.js +0 -2
  88. package/dist/packem_shared/ai-cache-Dtvmbsru.js +0 -1
  89. package/dist/packem_shared/ai-fix-BmLM72GS.js +0 -43
  90. package/dist/packem_shared/cache-directory-xASJia6M.js +0 -1
  91. package/dist/packem_shared/dependency-scan-DmwPKwLy.js +0 -2
  92. package/dist/packem_shared/docker-CA-scYu0.js +0 -2
  93. package/dist/packem_shared/failure-log-fD4DiFb1.js +0 -2
  94. package/dist/packem_shared/flakiness-BIg1rwvp.js +0 -1
  95. package/dist/packem_shared/index-OlP7U_t5.js +0 -6
  96. package/dist/packem_shared/lockfile-BXylopgH.js +0 -1
  97. package/dist/packem_shared/otelPlugin-y5hoCw4b.js +0 -1
  98. package/dist/packem_shared/registry-BHqKXiLb.js +0 -2
  99. package/dist/packem_shared/run-summary-utils-D39XBHWW.js +0 -1
  100. package/dist/packem_shared/runtime-check-BaKni2y1.js +0 -1
  101. package/dist/packem_shared/toolchain-B7sIiJxK.js +0 -5
  102. package/dist/packem_shared/typosquats-XkC1CnOa.js +0 -1
  103. package/dist/packem_shared/verify-BVTcVfoW.js +0 -1
  104. package/dist/packem_shared/vis-update-app-DR8c4OfG.js +0 -1
package/dist/bin.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"./packem_chunks/bin.js";import"@visulima/fs";import"./packem_shared/index-OlP7U_t5.js";
2
+ import"./packem_chunks/bin.js";import"./packem_chunks/config.js";
@@ -1,88 +1,6 @@
1
- import { TaskResult, Task, TargetConfiguration, ConstraintsConfig, NamedInputs, TaskRunnerOptions } from '@visulima/task-runner';
1
+ import { TargetConfiguration, TaskResult, Task, ConstraintsConfig, NamedInputs, TaskRunnerOptions } from '@visulima/task-runner';
2
2
  import { Hookable } from 'hookable';
3
3
  /**
4
- * Typed hook surface exposed to vis plugins.
5
- *
6
- * Plugins subscribe via `hooks.hook(name, handler)` — handlers are
7
- * awaited sequentially in registration order. Returning a promise
8
- * delays the next hook firing until it resolves, so plugins can
9
- * safely perform async setup/teardown.
10
- *
11
- * Naming deliberately mirrors vite-task / webpack-style verbs:
12
- * before/after for boundaries, on<Event> for passive observation.
13
- */
14
- interface VisHooks {
15
- /**
16
- * Fired after the entire task graph completes (including any
17
- * failures). `results` maps task ID → {@link TaskResult}.
18
- */
19
- "run:after": (results: Map<string, TaskResult>) => Promise<void> | void;
20
- /**
21
- * Fired once before any task in the graph starts, after workspace
22
- * discovery and graph construction. Throwing aborts the run.
23
- */
24
- "run:before": (context: {
25
- tasks: Task[];
26
- workspaceRoot: string;
27
- }) => Promise<void> | void;
28
- /**
29
- * Fired after a task completes (success, failure, or cache hit).
30
- * Receives the final {@link TaskResult}.
31
- */
32
- "task:after": (task: Task, result: TaskResult) => Promise<void> | void;
33
- /**
34
- * Fired before each task begins execution — after scheduling, before
35
- * the executor runs the command. Throwing aborts that single task.
36
- */
37
- "task:before": (task: Task) => Promise<void> | void;
38
- /** Fired when a task hit the local or remote cache. */
39
- "task:cacheHit": (task: Task, result: TaskResult) => Promise<void> | void;
40
- /**
41
- * Fired when auto-fingerprint cache diagnostics reports a miss,
42
- * carrying the human-readable reason string.
43
- */
44
- "task:cacheMiss": (task: Task, reasons: string) => Promise<void> | void;
45
- /** Fired when a task exits non-zero. */
46
- "task:failure": (task: Task, result: TaskResult) => Promise<void> | void;
47
- /**
48
- * Fired with a stderr chunk as a running task emits it. Plugins
49
- * that ship logs live (Slack, Datadog) should prefer this over
50
- * `task:after` so they don't wait for the full buffer.
51
- */
52
- "task:stderr": (task: Task, chunk: string) => Promise<void> | void;
53
- /**
54
- * Fired with a stdout chunk as a running task emits it. See
55
- * `task:stderr` for semantics.
56
- */
57
- "task:stdout": (task: Task, chunk: string) => Promise<void> | void;
58
- }
59
- /**
60
- * Public plugin contract. Implementations register handlers by
61
- * returning a partial {@link VisHooks} map from `hooks`, or by
62
- * mutating the Hookable instance directly via `setup(hooks)` for
63
- * advanced cases (dynamic registration, removeHook, etc.).
64
- *
65
- * Plugins are loaded in the order they appear in `visConfig.plugins`.
66
- * Handler execution order within a hook follows registration order,
67
- * so earlier plugins see events first.
68
- */
69
- interface VisPlugin {
70
- /**
71
- * Declarative handlers — the common shape. One entry per hook
72
- * name; pass a function or an array of functions (all run serially
73
- * in order).
74
- */
75
- hooks?: Partial<{ [K in keyof VisHooks]: VisHooks[K] | VisHooks[K][] }>;
76
- /** Plugin name — surfaced in debug logs. */
77
- name: string;
78
- /**
79
- * Imperative setup — receives the shared Hookable instance so the
80
- * plugin can register hooks conditionally, unregister later, or
81
- * use advanced APIs like `hookOnce`/`beforeEach`/`afterEach`.
82
- */
83
- setup?: (hooks: Hookable<VisHooks>) => Promise<void> | void;
84
- }
85
- /**
86
4
  * One family of upstream-coupled packages.
87
5
  *
88
6
  * `members` is an exact-match list. `prefixes` accept any dep whose
@@ -437,6 +355,88 @@ interface VisTargetConfiguration extends Omit<TargetConfiguration, "options"> {
437
355
  */
438
356
  type?: TargetType;
439
357
  }
358
+ /**
359
+ * Typed hook surface exposed to vis plugins.
360
+ *
361
+ * Plugins subscribe via `hooks.hook(name, handler)` — handlers are
362
+ * awaited sequentially in registration order. Returning a promise
363
+ * delays the next hook firing until it resolves, so plugins can
364
+ * safely perform async setup/teardown.
365
+ *
366
+ * Naming deliberately mirrors vite-task / webpack-style verbs:
367
+ * before/after for boundaries, on&lt;Event> for passive observation.
368
+ */
369
+ interface VisHooks {
370
+ /**
371
+ * Fired after the entire task graph completes (including any
372
+ * failures). `results` maps task ID → {@link TaskResult}.
373
+ */
374
+ "run:after": (results: Map<string, TaskResult>) => Promise<void> | void;
375
+ /**
376
+ * Fired once before any task in the graph starts, after workspace
377
+ * discovery and graph construction. Throwing aborts the run.
378
+ */
379
+ "run:before": (context: {
380
+ tasks: Task[];
381
+ workspaceRoot: string;
382
+ }) => Promise<void> | void;
383
+ /**
384
+ * Fired after a task completes (success, failure, or cache hit).
385
+ * Receives the final {@link TaskResult}.
386
+ */
387
+ "task:after": (task: Task, result: TaskResult) => Promise<void> | void;
388
+ /**
389
+ * Fired before each task begins execution — after scheduling, before
390
+ * the executor runs the command. Throwing aborts that single task.
391
+ */
392
+ "task:before": (task: Task) => Promise<void> | void;
393
+ /** Fired when a task hit the local or remote cache. */
394
+ "task:cacheHit": (task: Task, result: TaskResult) => Promise<void> | void;
395
+ /**
396
+ * Fired when auto-fingerprint cache diagnostics reports a miss,
397
+ * carrying the human-readable reason string.
398
+ */
399
+ "task:cacheMiss": (task: Task, reasons: string) => Promise<void> | void;
400
+ /** Fired when a task exits non-zero. */
401
+ "task:failure": (task: Task, result: TaskResult) => Promise<void> | void;
402
+ /**
403
+ * Fired with a stderr chunk as a running task emits it. Plugins
404
+ * that ship logs live (Slack, Datadog) should prefer this over
405
+ * `task:after` so they don't wait for the full buffer.
406
+ */
407
+ "task:stderr": (task: Task, chunk: string) => Promise<void> | void;
408
+ /**
409
+ * Fired with a stdout chunk as a running task emits it. See
410
+ * `task:stderr` for semantics.
411
+ */
412
+ "task:stdout": (task: Task, chunk: string) => Promise<void> | void;
413
+ }
414
+ /**
415
+ * Public plugin contract. Implementations register handlers by
416
+ * returning a partial {@link VisHooks} map from `hooks`, or by
417
+ * mutating the Hookable instance directly via `setup(hooks)` for
418
+ * advanced cases (dynamic registration, removeHook, etc.).
419
+ *
420
+ * Plugins are loaded in the order they appear in `visConfig.plugins`.
421
+ * Handler execution order within a hook follows registration order,
422
+ * so earlier plugins see events first.
423
+ */
424
+ interface VisPlugin {
425
+ /**
426
+ * Declarative handlers — the common shape. One entry per hook
427
+ * name; pass a function or an array of functions (all run serially
428
+ * in order).
429
+ */
430
+ hooks?: Partial<{ [K in keyof VisHooks]: VisHooks[K] | VisHooks[K][] }>;
431
+ /** Plugin name — surfaced in debug logs. */
432
+ name: string;
433
+ /**
434
+ * Imperative setup — receives the shared Hookable instance so the
435
+ * plugin can register hooks conditionally, unregister later, or
436
+ * use advanced APIs like `hookOnce`/`beforeEach`/`afterEach`.
437
+ */
438
+ setup?: (hooks: Hookable<VisHooks>) => Promise<void> | void;
439
+ }
440
440
  interface CodeownersConfig {
441
441
  /** Workspace-level paths that apply outside any project (e.g., `.github/**`). */
442
442
  globalPaths?: Record<string, string[]>;
@@ -521,8 +521,15 @@ interface ProjectJson {
521
521
  owner?: string;
522
522
  title?: string;
523
523
  };
524
- /** Project type — library or application. */
525
- projectType?: "application" | "library";
524
+ /**
525
+ * Project type — `library`, `application`, `service`, or `tool`.
526
+ *
527
+ * - `library` — reusable code consumed by other workspace projects.
528
+ * - `application` — end-user-facing build target (web app, mobile app).
529
+ * - `service` — long-running HTTP / worker process deployed independently.
530
+ * - `tool` — CLI or developer tooling shipped as an executable.
531
+ */
532
+ projectType?: "application" | "library" | "service" | "tool";
526
533
  /** Source root, used for display and language inference. */
527
534
  sourceRoot?: string;
528
535
  /** Tech stack. */
@@ -542,7 +549,7 @@ interface TaskDefaultsScope {
542
549
  /** Match on project layer. */
543
550
  layer?: ProjectJson["layer"] | ProjectJson["layer"][];
544
551
  /** Match on project type. */
545
- projectType?: "application" | "library";
552
+ projectType?: "application" | "library" | "service" | "tool";
546
553
  /** Match on project stack. */
547
554
  stack?: ProjectJson["stack"] | ProjectJson["stack"][];
548
555
  /** Match projects tagged with any of these tags. */
@@ -1147,6 +1154,22 @@ interface VisConfig {
1147
1154
  lockfile?: boolean;
1148
1155
  };
1149
1156
  /**
1157
+ * Behavior of `vis run` when invoked tasks declare service dependencies
1158
+ * that aren't running in the workspace registry. CLI `--services=<mode>`
1159
+ * overrides this block.
1160
+ */
1161
+ run?: {
1162
+ /**
1163
+ * One knob controlling auto-start of missing service deps.
1164
+ * - `auto` (default in TTY): pick by task — `dev` → ephemeral,
1165
+ * others → persistent.
1166
+ * - `ephemeral`: services die with the run (no registry entry).
1167
+ * - `persistent`: services persist across runs in the registry.
1168
+ * - `off` (default in CI / non-TTY): print diagnostics and abort.
1169
+ */
1170
+ services?: "auto" | "ephemeral" | "off" | "persistent";
1171
+ };
1172
+ /**
1150
1173
  * Default options for `vis secrets`. CLI flags always take precedence;
1151
1174
  * this block provides workspace-wide defaults so teams can commit config
1152
1175
  * once and every invocation picks it up.
@@ -1349,8 +1372,8 @@ interface VisConfig {
1349
1372
  /**
1350
1373
  * Share the cache between sibling git worktrees. When the workspace is a
1351
1374
  * linked worktree (created with `git worktree add`), the cache root is
1352
- * relocated from `&lt;linkedRoot>/.task-runner-cache` to the *main*
1353
- * worktree's `.task-runner-cache`. Multiple parallel agents working in
1375
+ * relocated from `&lt;linkedRoot>/.vis/cache` to the *main*
1376
+ * worktree's `.vis/cache`. Multiple parallel agents working in
1354
1377
  * sibling worktrees then share a single cache instead of rebuilding the
1355
1378
  * same hash N times.
1356
1379
  *
@@ -2098,6 +2121,16 @@ interface OtelPluginOptions {
2098
2121
  * ```
2099
2122
  */
2100
2123
  declare const otelPlugin: (options: OtelPluginOptions) => VisPlugin;
2124
+ /**
2125
+ * Type-safe helper for defining a vis plugin. Pure identity — exists
2126
+ * only so plugin authors get inference from the `VisPlugin` contract
2127
+ * without needing a `satisfies` annotation.
2128
+ *
2129
+ * Lives in its own module so plugins can import it without going
2130
+ * through `config.ts`, which re-exports plugins like `otelPlugin` and
2131
+ * would otherwise form an import cycle.
2132
+ */
2133
+ declare const definePlugin: (plugin: VisPlugin) => VisPlugin;
2101
2134
  /** Supported config file names, checked in priority order. */
2102
2135
  declare const CONFIG_FILES: string[];
2103
2136
  /** Per-package overlay file names, checked in priority order. */
@@ -2222,10 +2255,4 @@ declare const defineTaskConfig: (config: VisTaskConfig) => VisTaskConfig;
2222
2255
  * ```
2223
2256
  */
2224
2257
  declare const defineConfig: (config: VisConfig) => VisConfig;
2225
- /**
2226
- * Type-safe helper for defining a vis plugin. Pure identity — exists
2227
- * only so plugin authors get inference from the `VisPlugin` contract
2228
- * without needing a `satisfies` annotation.
2229
- */
2230
- declare const definePlugin: (plugin: VisPlugin) => VisPlugin;
2231
2258
  export { CONFIG_FILES, type OtelPluginOptions, SECURITY_DEFAULTS, TASK_CONFIG_FILES, type VisConfig, type VisHooks, type VisPlugin, type VisTaskConfig, applyDefaults, defineConfig, definePlugin, defineTaskConfig, findVisConfigFile, findVisTaskConfigFile, loadVisConfig, loadVisTaskConfig, otelPlugin };
@@ -1 +1 @@
1
- import{CONFIG_FILES as o,SECURITY_DEFAULTS as n,TASK_CONFIG_FILES as e,applyDefaults as l,defineConfig as s,definePlugin as C,defineTaskConfig as a,findVisConfigFile as g,findVisTaskConfigFile as d,loadVisConfig as F,loadVisTaskConfig as T}from"../packem_chunks/applyDefaults.js";import{o as S}from"../packem_shared/index-OlP7U_t5.js";export{o as CONFIG_FILES,n as SECURITY_DEFAULTS,e as TASK_CONFIG_FILES,l as applyDefaults,s as defineConfig,C as definePlugin,a as defineTaskConfig,g as findVisConfigFile,d as findVisTaskConfigFile,F as loadVisConfig,T as loadVisTaskConfig,S as otelPlugin};
1
+ import{p as a,O as f,k as o,l as e,r as n,i as l,j as C,I as g,X as d,e as r}from"../packem_chunks/config.js";import{definePlugin as p}from"../packem_shared/definePlugin-CWm4Dv_t.js";import{otelPlugin as T}from"../packem_shared/otelPlugin-CJR2T_lk.js";export{a as CONFIG_FILES,f as SECURITY_DEFAULTS,o as TASK_CONFIG_FILES,e as applyDefaults,n as defineConfig,p as definePlugin,l as defineTaskConfig,C as findVisConfigFile,g as findVisTaskConfigFile,d as loadVisConfig,r as loadVisTaskConfig,T as otelPlugin};