@visulima/task-runner 1.0.0-alpha.7 → 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 +48 -0
- package/README.md +3 -1
- package/dist/index.d.ts +3093 -49
- package/dist/index.js +29 -19
- package/dist/packem_chunks/index.js +5593 -0
- package/dist/packem_shared/{Cache-CWaX_c8U.js → Cache-CbhoA268.js} +151 -10
- package/dist/packem_shared/{FileAccessTracker-CQ5Ot7Hd.js → FileAccessTracker-D8zIURPU.js} +1 -1
- package/dist/packem_shared/{FingerprintManager-CV7U4f4f.js → FingerprintManager-78DjwWQ4.js} +1 -1
- package/dist/packem_shared/HttpRemoteCache-BTXUBH7t.js +290 -0
- package/dist/packem_shared/INPUT_URI_SCHEMES-DRm76YI5.js +69 -0
- package/dist/packem_shared/{IncrementalFileHasher-BRS76-mb.js → IncrementalFileHasher-BBhVK491.js} +1 -1
- package/dist/packem_shared/ReapiRemoteCache-vgRxDMmu.js +1012 -0
- package/dist/packem_shared/{TaskOrchestrator-rf45vW5c.js → TaskOrchestrator-CdRaQhTO.js} +100 -11
- package/dist/packem_shared/{TrackedTaskExecutor-CFPpQfXF.js → TrackedTaskExecutor-CWSMfHAW.js} +2 -2
- package/dist/packem_shared/V2_ROOT-DKBLxKo4.js +14 -0
- package/dist/packem_shared/actionDigestForTaskHash-BRE-9MT6.js +121 -0
- package/dist/packem_shared/archive-CnggHWb-.js +152 -0
- package/dist/packem_shared/{buildForwardDependencyMap-DLPgKEto.js → buildForwardDependencyMap-0BJFMMPv.js} +1 -2
- package/dist/packem_shared/{collectFiles-ClXHnHhg.js → collectFiles-cc1gokGU.js} +2 -1
- package/dist/packem_shared/{computeTaskHash-DYqfrDGq.js → computeTaskHash-DHoBJ_-V.js} +10 -4
- package/dist/packem_shared/containsBlob-CwGB0a_q.js +125 -0
- package/dist/packem_shared/{createTaskGraph-B7nH0kY_.js → createTaskGraph-Bwl4hwAf.js} +23 -2
- package/dist/packem_shared/{defaultTaskRunner-Cp7jCmIl.js → defaultTaskRunner-BaX4ZbFv.js} +58 -15
- package/dist/packem_shared/{detectFrameworks-CeFzKE6J.js → detectFrameworks-D7nyTc-o.js} +1 -1
- package/dist/packem_shared/{detectScriptShell-CR-xXKA4.js → detectScriptShell-CzxCM9-t.js} +1 -1
- package/dist/packem_shared/digestBuffer-CPdI2E1d.js +48 -0
- package/dist/packem_shared/{expandArguments-0AwD2BIA.js → expandArguments-Ba-hHYff.js} +2 -1
- package/dist/packem_shared/expandTokensInString-Bb7nYehP.js +47 -0
- package/dist/packem_shared/{extractPackageName-BllKetnz.js → extractPackageName-CMHjqGj_.js} +2 -3
- package/dist/packem_shared/{generateRunSummary-BE1jnQ3H.js → generateRunSummary-Bah7CFay.js} +1 -1
- package/dist/packem_shared/getCurrentBranch-DVNikt0P.js +156 -0
- package/dist/packem_shared/getMainWorktreeRoot-iBqToQJ4.js +114 -0
- package/dist/packem_shared/{parseCommands-D-IgF8Zh.js → parseCommands-DDdIxaH5.js} +8 -3
- package/dist/packem_shared/resolveCacheMode-CsmHT_0o.js +21 -0
- package/dist/packem_shared/{runConcurrently-CmfC4r-f.js → runConcurrently-BCGQ9fJl.js} +1 -1
- package/dist/packem_shared/shell-quote-DWJJbt21.js +3 -0
- package/dist/packem_shared/{utils-zO0ZRgtf.js → utils-Bmnj-H2J.js} +4 -1
- package/index.js +556 -723
- package/package.json +26 -13
- package/dist/affected.d.ts +0 -82
- package/dist/archive.d.ts +0 -38
- package/dist/cache.d.ts +0 -138
- package/dist/chrome-trace.d.ts +0 -53
- package/dist/command-parser/expand-arguments.d.ts +0 -11
- package/dist/command-parser/expand-shortcut.d.ts +0 -15
- package/dist/command-parser/expand-wildcard.d.ts +0 -13
- package/dist/command-parser/index.d.ts +0 -18
- package/dist/command-parser/strip-quotes.d.ts +0 -6
- package/dist/concurrent-fallback.d.ts +0 -16
- package/dist/concurrent.d.ts +0 -23
- package/dist/default-task-runner.d.ts +0 -44
- package/dist/detect-shell.d.ts +0 -19
- package/dist/file-access-tracker.d.ts +0 -59
- package/dist/fingerprint.d.ts +0 -54
- package/dist/flow-controllers/index.d.ts +0 -7
- package/dist/flow-controllers/input-handler.d.ts +0 -44
- package/dist/flow-controllers/log-timings.d.ts +0 -18
- package/dist/flow-controllers/restart-process.d.ts +0 -21
- package/dist/flow-controllers/teardown.d.ts +0 -22
- package/dist/framework-inference.d.ts +0 -35
- package/dist/graph-visualizer.d.ts +0 -74
- package/dist/incremental-hasher.d.ts +0 -76
- package/dist/life-cycle.d.ts +0 -38
- package/dist/lockfile-hasher.d.ts +0 -73
- package/dist/log-reporter.d.ts +0 -34
- package/dist/native-binding.d.ts +0 -106
- package/dist/output-resolver.d.ts +0 -20
- package/dist/packem_shared/RemoteCache-DSU3lc87.js +0 -219
- package/dist/packem_shared/archive-UQHAnZUa.js +0 -102
- package/dist/project-constraints.d.ts +0 -9
- package/dist/remote-cache.d.ts +0 -100
- package/dist/run-summary.d.ts +0 -111
- package/dist/task-graph-utils.d.ts +0 -39
- package/dist/task-graph.d.ts +0 -22
- package/dist/task-hasher.d.ts +0 -104
- package/dist/task-orchestrator.d.ts +0 -38
- package/dist/task-scheduler.d.ts +0 -41
- package/dist/terminal-buffer.d.ts +0 -29
- package/dist/tracked-executor.d.ts +0 -46
- package/dist/types.d.ts +0 -757
- package/dist/utils.d.ts +0 -39
package/dist/task-hasher.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { IncrementalFileHasher } from "./incremental-hasher.d.ts";
|
|
2
|
-
import type { NamedInputs, ProjectConfiguration, TargetConfiguration, Task, TaskHashDetails } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Interface for task hashers.
|
|
5
|
-
*/
|
|
6
|
-
interface TaskHasher {
|
|
7
|
-
hashTask: (task: Task) => Promise<TaskHashDetails>;
|
|
8
|
-
/**
|
|
9
|
-
* Rehashes a single file bypassing any in-memory cache. Optional to keep
|
|
10
|
-
* external/custom hashers backward compatible; the orchestrator skips
|
|
11
|
-
* self-modifying-task detection when the implementation is absent.
|
|
12
|
-
*/
|
|
13
|
-
rehashFile?: (filePath: string) => Promise<string | undefined>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Options for creating an InProcessTaskHasher.
|
|
17
|
-
*/
|
|
18
|
-
interface TaskHasherOptions {
|
|
19
|
-
/**
|
|
20
|
-
* When true, scan each task's resolved command for `$VAR`/`${VAR}`
|
|
21
|
-
* references and auto-fingerprint them. Catches the common case of
|
|
22
|
-
* a script reading `$VERCEL_URL` or `${NEXT_PUBLIC_API}` without
|
|
23
|
-
* the user remembering to declare it in `envVars`/`globalEnv`.
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
autoEnvVars?: boolean;
|
|
27
|
-
/** Additional environment variables to include in hash */
|
|
28
|
-
envVars?: string[];
|
|
29
|
-
/**
|
|
30
|
-
* Enable framework environment variable inference.
|
|
31
|
-
* When true, auto-detects frameworks and includes their public
|
|
32
|
-
* env var prefixes in the task hash.
|
|
33
|
-
* @default false
|
|
34
|
-
*/
|
|
35
|
-
frameworkInference?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Global environment variables that invalidate all task hashes.
|
|
38
|
-
*/
|
|
39
|
-
globalEnv?: string[];
|
|
40
|
-
/**
|
|
41
|
-
* Global input files that invalidate all task hashes when changed.
|
|
42
|
-
* These are workspace-root-relative paths (e.g., "pnpm-lock.yaml").
|
|
43
|
-
*/
|
|
44
|
-
globalInputs?: string[];
|
|
45
|
-
/**
|
|
46
|
-
* Optional persistent mtime/size-indexed file snapshot. When set,
|
|
47
|
-
* `#hashFile` consults the snapshot first and only re-reads file
|
|
48
|
-
* contents when the file's mtime or size has changed since the
|
|
49
|
-
* previous run. Cuts cold-cache fingerprint time dramatically on
|
|
50
|
-
* large workspaces where most source files don't change run-to-run.
|
|
51
|
-
*
|
|
52
|
-
* The caller is responsible for `load()`ing the snapshot before
|
|
53
|
-
* using the hasher and `save()`ing it after the run completes.
|
|
54
|
-
*/
|
|
55
|
-
incrementalHasher?: IncrementalFileHasher;
|
|
56
|
-
/** Named input definitions */
|
|
57
|
-
namedInputs?: NamedInputs;
|
|
58
|
-
/** Project configurations keyed by project name */
|
|
59
|
-
projects: Record<string, ProjectConfiguration>;
|
|
60
|
-
/**
|
|
61
|
-
* Enable smart lockfile hashing.
|
|
62
|
-
* When true, instead of hashing the entire lockfile, only the resolved
|
|
63
|
-
* versions of a package's actual dependencies are hashed.
|
|
64
|
-
* This means changing the lockfile only busts cache for affected packages.
|
|
65
|
-
*
|
|
66
|
-
* Matches Turborepo's smart lockfile hashing behavior.
|
|
67
|
-
* @default false
|
|
68
|
-
*/
|
|
69
|
-
smartLockfileHashing?: boolean;
|
|
70
|
-
/** Target default configurations */
|
|
71
|
-
targetDefaults?: Record<string, Partial<TargetConfiguration>>;
|
|
72
|
-
/** The workspace root directory */
|
|
73
|
-
workspaceRoot: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Computes hashes for tasks based on their inputs.
|
|
77
|
-
* Used to determine if a cached result can be reused.
|
|
78
|
-
*/
|
|
79
|
-
declare class InProcessTaskHasher implements TaskHasher {
|
|
80
|
-
#private;
|
|
81
|
-
constructor(options: TaskHasherOptions);
|
|
82
|
-
hashTask(task: Task): Promise<TaskHashDetails>;
|
|
83
|
-
clearCache(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Reads `filePath` fresh and returns its content hash, bypassing the
|
|
86
|
-
* in-memory cache used during the initial `hashTask` pass.
|
|
87
|
-
*
|
|
88
|
-
* Used to detect tasks that modify their own tracked inputs: compare
|
|
89
|
-
* a pre-execution hash (from `task.hashDetails.nodes`) against the
|
|
90
|
-
* post-execution result of this method.
|
|
91
|
-
* @param filePath Absolute path to the file.
|
|
92
|
-
* @returns The fresh xxh3 hash, or `undefined` if the file cannot be read.
|
|
93
|
-
*/
|
|
94
|
-
rehashFile(filePath: string): Promise<string | undefined>;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Computes the final hash for a task from its hash details.
|
|
98
|
-
* Uses native Rust xxh3-128 when available, otherwise pure TS xxh3-ts.
|
|
99
|
-
* Both produce identical xxh3-128 hashes, ensuring cache compatibility
|
|
100
|
-
* regardless of whether the native addon is loaded.
|
|
101
|
-
*/
|
|
102
|
-
declare const computeTaskHash: (hashDetails: TaskHashDetails) => string;
|
|
103
|
-
export { computeTaskHash, InProcessTaskHasher };
|
|
104
|
-
export type { TaskHasher, TaskHasherOptions };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Cache } from "./cache.d.ts";
|
|
2
|
-
import type { RemoteCache } from "./remote-cache.d.ts";
|
|
3
|
-
import type { TaskHasher } from "./task-hasher.d.ts";
|
|
4
|
-
import type { TaskScheduler } from "./task-scheduler.d.ts";
|
|
5
|
-
import type { LifeCycleInterface, Task, TaskExecutor, TaskGraph, TaskResults } from "./types.d.ts";
|
|
6
|
-
/**
|
|
7
|
-
* Options for the TaskOrchestrator.
|
|
8
|
-
*/
|
|
9
|
-
interface TaskOrchestratorOptions {
|
|
10
|
-
autoFingerprint?: boolean;
|
|
11
|
-
cache: Cache;
|
|
12
|
-
cacheDiagnostics?: boolean;
|
|
13
|
-
captureOutput?: boolean;
|
|
14
|
-
dryRun?: boolean;
|
|
15
|
-
fingerprintEnvPatterns?: string[];
|
|
16
|
-
lifeCycle: LifeCycleInterface;
|
|
17
|
-
remoteCache?: RemoteCache;
|
|
18
|
-
resolveCommand?: (task: Task) => string | undefined;
|
|
19
|
-
scheduler: TaskScheduler;
|
|
20
|
-
skipCache?: boolean;
|
|
21
|
-
summarize?: boolean;
|
|
22
|
-
taskExecutor: TaskExecutor;
|
|
23
|
-
taskGraph?: TaskGraph;
|
|
24
|
-
taskHasher: TaskHasher;
|
|
25
|
-
untrackedEnvVars?: string[];
|
|
26
|
-
workspaceRoot: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Orchestrates the execution of tasks, handling caching,
|
|
30
|
-
* scheduling, and lifecycle events.
|
|
31
|
-
*/
|
|
32
|
-
declare class TaskOrchestrator {
|
|
33
|
-
#private;
|
|
34
|
-
constructor(options: TaskOrchestratorOptions);
|
|
35
|
-
run(): Promise<TaskResults>;
|
|
36
|
-
}
|
|
37
|
-
export { TaskOrchestrator };
|
|
38
|
-
export type { TaskOrchestratorOptions };
|
package/dist/task-scheduler.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ProjectGraph, Task, TaskGraph } from "./types.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Options for partitioning tasks across CI runners.
|
|
4
|
-
*/
|
|
5
|
-
export interface PartitionOptions {
|
|
6
|
-
/** 1-based partition index (e.g., 1 for the first partition) */
|
|
7
|
-
index: number;
|
|
8
|
-
/** Total number of partitions */
|
|
9
|
-
total: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Parses a partition string like "1/4" into PartitionOptions.
|
|
13
|
-
* Also supports the VIS_PARTITION environment variable as fallback.
|
|
14
|
-
*/
|
|
15
|
-
export declare const parsePartition: (value?: string) => PartitionOptions | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Manages the scheduling order of tasks based on dependencies,
|
|
18
|
-
* parallelism constraints, and estimated execution times.
|
|
19
|
-
*/
|
|
20
|
-
export declare class TaskScheduler {
|
|
21
|
-
#private;
|
|
22
|
-
/**
|
|
23
|
-
* Partitions a list of tasks for distributed CI execution.
|
|
24
|
-
* Tasks are sorted by ID for deterministic distribution, then split
|
|
25
|
-
* using ceiling division so partitions differ by at most one task.
|
|
26
|
-
* @param tasks The full list of tasks to partition
|
|
27
|
-
* @param partition The partition configuration (1-based index and total)
|
|
28
|
-
* @returns The subset of tasks assigned to this partition
|
|
29
|
-
*/
|
|
30
|
-
static partitionTasks(tasks: Task[], partition: PartitionOptions): Task[];
|
|
31
|
-
constructor(taskGraph: TaskGraph, projectGraph: ProjectGraph, maxParallel?: number);
|
|
32
|
-
/**
|
|
33
|
-
* Returns the next batch of tasks that are ready to execute.
|
|
34
|
-
*/
|
|
35
|
-
getNextBatch(): Task[];
|
|
36
|
-
startTask(taskId: string): void;
|
|
37
|
-
completeTask(taskId: string): void;
|
|
38
|
-
isComplete(): boolean;
|
|
39
|
-
get remainingCount(): number;
|
|
40
|
-
get runningCount(): number;
|
|
41
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal virtual terminal buffer that processes ANSI escape sequences
|
|
3
|
-
* for cursor movement and line erasure. This allows PTY output from
|
|
4
|
-
* interactive tools (inquirer, etc.) to render correctly by updating
|
|
5
|
-
* lines in place rather than always appending.
|
|
6
|
-
*
|
|
7
|
-
* Supported sequences:
|
|
8
|
-
* - \r carriage return (cursor to column 0)
|
|
9
|
-
* - \n line feed (new line)
|
|
10
|
-
* - \x1b[nA cursor up n lines
|
|
11
|
-
* - \x1b[nB cursor down n lines
|
|
12
|
-
* - \x1b[nC cursor forward n columns
|
|
13
|
-
* - \x1b[nD cursor back n columns
|
|
14
|
-
* - \x1b[nG cursor to column n
|
|
15
|
-
* - \x1b[r;cH cursor position
|
|
16
|
-
* - \x1b[K erase from cursor to end of line (0K, 1K, 2K)
|
|
17
|
-
* - \x1b[J erase from cursor to end of display (0J, 1J, 2J)
|
|
18
|
-
* - \x1b[...m SGR (colors/styles) — passed through into output
|
|
19
|
-
*/
|
|
20
|
-
export declare class TerminalBuffer {
|
|
21
|
-
#private;
|
|
22
|
-
constructor(maxBytes?: number);
|
|
23
|
-
/**
|
|
24
|
-
* Process raw PTY output data.
|
|
25
|
-
*/
|
|
26
|
-
write(data: string): void;
|
|
27
|
-
/** Get the current buffer content as a string. */
|
|
28
|
-
toString(): string;
|
|
29
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { FileAccess } from "./file-access-tracker.d.ts";
|
|
2
|
-
import type { Task, TaskExecutionOptions } from "./types.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Result of a tracked task execution.
|
|
5
|
-
*/
|
|
6
|
-
export interface TrackedExecutionResult {
|
|
7
|
-
/** File accesses recorded during execution */
|
|
8
|
-
accesses: FileAccess[];
|
|
9
|
-
/** The command exit code */
|
|
10
|
-
code: number;
|
|
11
|
-
/** The command stdout + stderr output */
|
|
12
|
-
terminalOutput: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A task executor that tracks file accesses during command execution.
|
|
16
|
-
*
|
|
17
|
-
* Tracking strategies (in priority order):
|
|
18
|
-
* 1. **Linux**: strace-based syscall interception (most complete)
|
|
19
|
-
* 2. **macOS/Windows**: Node.js preload script that patches `fs` module
|
|
20
|
-
* (works for Node.js processes, not native binaries)
|
|
21
|
-
* 3. **Fallback**: No tracking (accesses array will be empty)
|
|
22
|
-
*/
|
|
23
|
-
export declare class TrackedTaskExecutor {
|
|
24
|
-
#private;
|
|
25
|
-
constructor(workspaceRoot: string);
|
|
26
|
-
/**
|
|
27
|
-
* Returns true if file access tracking is supported on the current platform.
|
|
28
|
-
* strace tracking (Linux) or preload script (any Node.js process).
|
|
29
|
-
*/
|
|
30
|
-
get isTrackingSupported(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Returns true if the platform supports full syscall-level tracking (strace).
|
|
33
|
-
*/
|
|
34
|
-
get isStraceSupported(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Executes a task command and tracks all file system accesses.
|
|
37
|
-
*
|
|
38
|
-
* On Linux, uses strace for comprehensive tracking.
|
|
39
|
-
* On other platforms, uses a Node.js preload script (for Node processes).
|
|
40
|
-
*/
|
|
41
|
-
execute(task: Task, options: TaskExecutionOptions, command: string): Promise<TrackedExecutionResult>;
|
|
42
|
-
/**
|
|
43
|
-
* Kills all active child processes. Called on abort/signal to prevent orphans.
|
|
44
|
-
*/
|
|
45
|
-
killAll(): void;
|
|
46
|
-
}
|