@abhinav2203/codeflow-core 0.1.0

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.
@@ -0,0 +1,10 @@
1
+ export declare const getStoreRoot: () => string;
2
+ export declare const sessionDirForProject: (projectName: string) => string;
3
+ export declare const latestSessionPath: (projectName: string) => string;
4
+ export declare const sessionHistoryPath: (projectName: string, sessionId: string) => string;
5
+ export declare const approvalPath: (approvalId: string) => string;
6
+ export declare const runPath: (runId: string) => string;
7
+ export declare const checkpointPath: (checkpointId: string) => string;
8
+ export declare const observabilityPath: (projectName: string) => string;
9
+ export declare const branchDirForProject: (projectName: string) => string;
10
+ export declare const branchPath: (projectName: string, branchId: string) => string;
@@ -0,0 +1,27 @@
1
+ import os from "node:os";
2
+ import path from "node:path";
3
+ import { slugify } from "../internal/utils";
4
+ const resolveDefaultStoreRoot = () => {
5
+ if (process.env.VITEST || process.env.NODE_ENV === "test") {
6
+ return path.join(process.cwd(), ".codeflow-store-test", `worker-${process.env.VITEST_WORKER_ID ?? "0"}`);
7
+ }
8
+ return path.join(os.homedir(), ".codeflow-store");
9
+ };
10
+ export const getStoreRoot = () => process.env.CODEFLOW_STORE_ROOT
11
+ ? path.resolve(/* turbopackIgnore: true */ process.env.CODEFLOW_STORE_ROOT)
12
+ : resolveDefaultStoreRoot();
13
+ export const sessionDirForProject = (projectName) => path.join(getStoreRoot(), "sessions", slugify(projectName));
14
+ export const latestSessionPath = (projectName) => path.join(sessionDirForProject(projectName), "latest.json");
15
+ export const sessionHistoryPath = (projectName, sessionId) => path.join(sessionDirForProject(projectName), "history", `${sessionId}.json`);
16
+ export const approvalPath = (approvalId) => path.join(getStoreRoot(), "approvals", `${approvalId}.json`);
17
+ export const runPath = (runId) => path.join(getStoreRoot(), "runs", `${runId}.json`);
18
+ export const checkpointPath = (checkpointId) => path.join(getStoreRoot(), "checkpoints", checkpointId);
19
+ export const observabilityPath = (projectName) => path.join(getStoreRoot(), "observability", `${slugify(projectName)}.json`);
20
+ export const branchDirForProject = (projectName) => path.join(getStoreRoot(), "branches", slugify(projectName));
21
+ export const branchPath = (projectName, branchId) => {
22
+ const safeBranchId = path.basename(branchId);
23
+ if (safeBranchId !== branchId) {
24
+ throw new Error("Invalid branch ID");
25
+ }
26
+ return path.join(branchDirForProject(projectName), `${safeBranchId}.json`);
27
+ };
@@ -0,0 +1 @@
1
+ export { approvalPath, branchDirForProject, branchPath, checkpointPath, getStoreRoot, latestSessionPath, observabilityPath, runPath, sessionDirForProject, sessionHistoryPath } from "./storage/store-paths";
@@ -0,0 +1 @@
1
+ export { approvalPath, branchDirForProject, branchPath, checkpointPath, getStoreRoot, latestSessionPath, observabilityPath, runPath, sessionDirForProject, sessionHistoryPath } from "./storage/store-paths";
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@abhinav2203/codeflow-core",
3
+ "description": "Framework-agnostic CodeFlow analysis core for blueprint generation, repository analysis, exports, and conflict detection.",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./analyzer": {
17
+ "types": "./dist/analyzer/index.d.ts",
18
+ "default": "./dist/analyzer/index.js"
19
+ },
20
+ "./schema": {
21
+ "types": "./dist/schema/index.d.ts",
22
+ "default": "./dist/schema/index.js"
23
+ },
24
+ "./export": {
25
+ "types": "./dist/export/index.d.ts",
26
+ "default": "./dist/export/index.js"
27
+ },
28
+ "./conflicts": {
29
+ "types": "./dist/conflicts/index.d.ts",
30
+ "default": "./dist/conflicts/index.js"
31
+ },
32
+ "./store-paths": {
33
+ "types": "./dist/store-paths.d.ts",
34
+ "default": "./dist/store-paths.js"
35
+ }
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "scripts": {
41
+ "build": "tsc -p tsconfig.json",
42
+ "prepare": "npm run build"
43
+ },
44
+ "dependencies": {
45
+ "ts-morph": "^27.0.2",
46
+ "zod": "^4.3.6"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^25.5.0",
50
+ "typescript": "^5.9.3"
51
+ }
52
+ }