effect-ci 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +52 -2
- package/dist/chunks/chunk-MZ5FQEN6.js +80 -0
- package/dist/chunks/chunk-U3DVQKHN.js +21 -0
- package/dist/chunks/chunk-WGBTI7DS.js +61 -0
- package/dist/chunks/chunk-WOG7K3QJ.js +84 -0
- package/dist/chunks/chunk-X4HGOXPL.js +2207 -0
- package/dist/chunks/local-bridge.js +1296 -0
- package/dist/chunks/src-FUJGARUK.js +1978 -0
- package/dist/command-diagnostics.js +12 -0
- package/dist/directory-deployment.js +167 -0
- package/dist/effect-ci.js +43 -0
- package/dist/index.js +103 -0
- package/dist/paths.js +8 -0
- package/dist/source-changes.js +11 -0
- package/dist/task-cache.js +64 -0
- package/dist/types/command-diagnostics.d.ts +24 -0
- package/dist/types/directory-deployment.d.ts +25 -0
- package/dist/types/index.d.ts +787 -0
- package/dist/types/observers.d.ts +35 -0
- package/dist/types/paths.d.ts +4 -0
- package/dist/types/source-changes.d.ts +34 -0
- package/dist/types/task-cache.d.ts +6 -0
- package/dist/types/turbo-bridge.d.ts +33 -0
- package/dist/types/turbo.d.ts +6 -0
- package/dist/types/vite-plus.d.ts +15 -0
- package/dist/vite-plus.js +8 -0
- package/package.json +88 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RuntimeEvent, PlanNode } from "./index.js";
|
|
2
|
+
/** Presentation metadata only: no output, plan, payload, actor or review capability. */
|
|
3
|
+
export interface RuntimeObservation {
|
|
4
|
+
readonly type: RuntimeEvent["type"];
|
|
5
|
+
readonly workflowId: string;
|
|
6
|
+
readonly timestamp: string;
|
|
7
|
+
readonly stepId?: string;
|
|
8
|
+
readonly status?: PlanNode["status"];
|
|
9
|
+
readonly conclusion?: "success" | "failure";
|
|
10
|
+
}
|
|
11
|
+
export interface RuntimeObserver {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** Trusted host callback. Honor abort; this is not a sandbox for arbitrary code. */
|
|
14
|
+
readonly deliver: (event: RuntimeObservation, signal: AbortSignal) => void | Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface ObservationReceipt {
|
|
17
|
+
readonly sequence: number;
|
|
18
|
+
readonly observer: string;
|
|
19
|
+
readonly event: RuntimeEvent["type"];
|
|
20
|
+
readonly status: "delivered" | "failed" | "timeout" | "blocked";
|
|
21
|
+
}
|
|
22
|
+
export interface RuntimeObservers {
|
|
23
|
+
readonly publish: (event: RuntimeEvent) => Promise<void>;
|
|
24
|
+
readonly snapshot: () => {
|
|
25
|
+
readonly receipts: ReadonlyArray<ObservationReceipt>;
|
|
26
|
+
readonly omittedReceipts: number;
|
|
27
|
+
readonly droppedEvents: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One in-memory delivery session, not durable reconciliation. Failed/uncertain
|
|
32
|
+
* destinations are quarantined for the rest of this session: no blind POST retry.
|
|
33
|
+
* Persist snapshot() separately when required; persistence must fail closed.
|
|
34
|
+
*/
|
|
35
|
+
export declare function makeRuntimeObservers(input: ReadonlyArray<RuntimeObserver>, timeoutMs?: number): RuntimeObservers;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Repository-relative Effect globs, including dotfiles. */
|
|
2
|
+
export declare function pathPatterns(patterns: string | ReadonlyArray<string>): ReadonlyArray<string>;
|
|
3
|
+
/** Literal traversal roots; Effect owns all matching syntax. */
|
|
4
|
+
export declare function pathPrefixes(patterns: ReadonlyArray<string>): ReadonlyArray<string>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { CommandExecutor, SourceService, WorkflowEventShape } from "./index.js";
|
|
3
|
+
/** Explicit committed comparison. Use mergeBase for a PR's branch-point diff. */
|
|
4
|
+
export interface SourceComparison {
|
|
5
|
+
readonly base: string;
|
|
6
|
+
readonly head?: string;
|
|
7
|
+
readonly mergeBase?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type SourceChanges = {
|
|
10
|
+
readonly status: "known";
|
|
11
|
+
readonly paths: ReadonlyArray<string>;
|
|
12
|
+
readonly base: string;
|
|
13
|
+
readonly head: string;
|
|
14
|
+
} | {
|
|
15
|
+
readonly status: "unknown";
|
|
16
|
+
readonly reason: "unavailable" | "no-baseline" | "plan";
|
|
17
|
+
};
|
|
18
|
+
export interface SourceQueries extends SourceService {
|
|
19
|
+
readonly changes: (comparison?: SourceComparison) => Effect.Effect<SourceChanges, unknown>;
|
|
20
|
+
/** Unknown comparisons conservatively match. Paths are repository-relative. */
|
|
21
|
+
readonly changed: (patterns: string | ReadonlyArray<string>, comparison?: SourceComparison) => Effect.Effect<boolean, unknown>;
|
|
22
|
+
}
|
|
23
|
+
/** Fixed, read-only Git query shared by local and native source providers. */
|
|
24
|
+
export declare function gitSourceChangesCommand(selected: SourceComparison, revision?: string): string | undefined;
|
|
25
|
+
export declare function parseGitSourceChanges(result: {
|
|
26
|
+
readonly stdout: string;
|
|
27
|
+
readonly exitCode: number;
|
|
28
|
+
}): SourceChanges;
|
|
29
|
+
export declare function makeSourceQueries(source: SourceService, options: {
|
|
30
|
+
readonly executor: CommandExecutor;
|
|
31
|
+
readonly workflowId: string;
|
|
32
|
+
readonly event: WorkflowEventShape;
|
|
33
|
+
readonly mode: "plan" | "execute";
|
|
34
|
+
}): SourceQueries;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Fixed read-only Node program shared by local Actions and container runners.
|
|
2
|
+
* Keep this as source text: bundlers can add closure references to functions,
|
|
3
|
+
* making Function.toString() unsafe for transporting executable code.
|
|
4
|
+
*/
|
|
5
|
+
export declare const taskCacheProgram: string;
|
|
6
|
+
export declare function taskCachePaths(repository: string, projectRoot?: string): string[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface TurboFile {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly data: string;
|
|
4
|
+
readonly mode: number;
|
|
5
|
+
readonly owner: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TurboTask {
|
|
8
|
+
readonly taskId: string;
|
|
9
|
+
readonly hash: string;
|
|
10
|
+
readonly dependencies: ReadonlyArray<string>;
|
|
11
|
+
readonly command: string;
|
|
12
|
+
readonly directory: string;
|
|
13
|
+
readonly resolvedTaskDefinition: {
|
|
14
|
+
readonly cache: boolean;
|
|
15
|
+
readonly persistent: boolean;
|
|
16
|
+
readonly interactive: boolean;
|
|
17
|
+
};
|
|
18
|
+
readonly with: ReadonlyArray<string>;
|
|
19
|
+
}
|
|
20
|
+
export interface TurboPlan {
|
|
21
|
+
readonly version: string;
|
|
22
|
+
readonly turboVersion: string;
|
|
23
|
+
readonly tasks: ReadonlyArray<TurboTask>;
|
|
24
|
+
}
|
|
25
|
+
export interface TurboBridgeRequest {
|
|
26
|
+
readonly operation: "plan" | "run" | "restore";
|
|
27
|
+
readonly file: string;
|
|
28
|
+
readonly tags?: ReadonlyArray<string>;
|
|
29
|
+
readonly task?: TurboTask;
|
|
30
|
+
readonly hashes?: Readonly<Record<string, string>>;
|
|
31
|
+
readonly files?: ReadonlyArray<TurboFile>;
|
|
32
|
+
}
|
|
33
|
+
export declare const turboBridge: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as CI from "./index.js";
|
|
3
|
+
export declare const makeTurboToolchain: <Environment>(workspace: CI.Workspace, namespace: string, prerequisites: Effect.Effect<void, unknown, Environment>) => {
|
|
4
|
+
workspace: CI.Workspace;
|
|
5
|
+
tags: (...tags: ReadonlyArray<string>) => Effect.Effect<CI.Workspace, any, any>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface CacheLogLine {
|
|
2
|
+
readonly level: "Info" | "Debug";
|
|
3
|
+
readonly message: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Turns a Vite+ run plan into log lines: each step's cache status and every change at Info,
|
|
7
|
+
* and, from a `-vv` plan, the inputs and outputs of the cached run at Debug.
|
|
8
|
+
*/
|
|
9
|
+
export declare const cacheLog: (body: string) => CacheLogLine[];
|
|
10
|
+
/**
|
|
11
|
+
* Cache hits whose run read no project file. fspy can miss every read of some native tools,
|
|
12
|
+
* such as TypeScript 7's `tsc` on macOS (voidzero-dev/vite-task#587). Such a hit would replay
|
|
13
|
+
* a stale result forever, so it must not be trusted. Needs a `-vv` plan.
|
|
14
|
+
*/
|
|
15
|
+
export declare const untracedHits: (body: string) => string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,91 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-ci",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Effect CI: typed CI workflows you run locally, in agents, or on your own Cloudflare host",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ericclemmons/effect-ci.git",
|
|
10
|
+
"directory": "packages/effect-ci"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"effect-ci": "./dist/effect-ci.js"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./command-diagnostics": {
|
|
21
|
+
"types": "./dist/types/command-diagnostics.d.ts",
|
|
22
|
+
"default": "./dist/command-diagnostics.js"
|
|
23
|
+
},
|
|
24
|
+
"./directory-deployment": {
|
|
25
|
+
"types": "./dist/types/directory-deployment.d.ts",
|
|
26
|
+
"default": "./dist/directory-deployment.js"
|
|
27
|
+
},
|
|
28
|
+
"./source-changes": {
|
|
29
|
+
"types": "./dist/types/source-changes.d.ts",
|
|
30
|
+
"default": "./dist/source-changes.js"
|
|
31
|
+
},
|
|
32
|
+
"./task-cache": {
|
|
33
|
+
"types": "./dist/types/task-cache.d.ts",
|
|
34
|
+
"default": "./dist/task-cache.js"
|
|
35
|
+
},
|
|
36
|
+
"./paths": {
|
|
37
|
+
"types": "./dist/types/paths.d.ts",
|
|
38
|
+
"default": "./dist/paths.js"
|
|
39
|
+
},
|
|
40
|
+
"./vite-plus": {
|
|
41
|
+
"types": "./dist/types/vite-plus.d.ts",
|
|
42
|
+
"default": "./dist/vite-plus.js"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md"
|
|
49
|
+
],
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"provenance": true
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=24"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@vercel/detect-agent": "^1.2.5",
|
|
59
|
+
"effect": "^4.1.2",
|
|
60
|
+
"picomatch": "^4.0.7",
|
|
61
|
+
"yaml": "^2.9.1"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"esbuild": ">=0.28",
|
|
65
|
+
"miniflare": ">=5.20260930.0-alpha",
|
|
66
|
+
"vite-plus": ">=1.8.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"esbuild": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"miniflare": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"vite-plus": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@effect-ci-testbed/ci": "0.0.0",
|
|
81
|
+
"@effect-ci-testbed/cli": "0.0.0",
|
|
82
|
+
"@effect-ci-testbed/cloudflare-dynamic-worker": "0.0.0",
|
|
83
|
+
"@types/node": "^26.6.3",
|
|
84
|
+
"esbuild": "0.28.2",
|
|
85
|
+
"typescript": "7.1.0-beta"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"build": "node build.ts",
|
|
89
|
+
"check": "tsc --noEmit && node build.ts && node --test package.test.ts"
|
|
90
|
+
}
|
|
6
91
|
}
|