legacymaxxing 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,170 @@
1
+ import { z } from "zod";
2
+ /** Every persisted record carries `schemaVersion` so reads stay forward-compatible. */
3
+ export declare const artifactKindSchema: z.ZodEnum<{
4
+ json: "json";
5
+ md: "md";
6
+ mermaid: "mermaid";
7
+ html: "html";
8
+ dir: "dir";
9
+ patch: "patch";
10
+ }>;
11
+ export declare const phaseStatusSchema: z.ZodEnum<{
12
+ pending: "pending";
13
+ running: "running";
14
+ produced: "produced";
15
+ validated: "validated";
16
+ failed: "failed";
17
+ "gate-approved": "gate-approved";
18
+ "gate-rejected": "gate-rejected";
19
+ }>;
20
+ export type PhaseStatus = z.infer<typeof phaseStatusSchema>;
21
+ export declare const configRecordSchema: z.ZodObject<{
22
+ schemaVersion: z.ZodLiteral<1>;
23
+ provider: z.ZodString;
24
+ model: z.ZodNullable<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type ConfigRecord = z.infer<typeof configRecordSchema>;
27
+ export declare const systemEntrySchema: z.ZodObject<{
28
+ name: z.ZodString;
29
+ legacyPath: z.ZodString;
30
+ baseSha: z.ZodNullable<z.ZodString>;
31
+ createdAt: z.ZodString;
32
+ }, z.core.$strip>;
33
+ export type SystemEntry = z.infer<typeof systemEntrySchema>;
34
+ export declare const projectRecordSchema: z.ZodObject<{
35
+ schemaVersion: z.ZodLiteral<1>;
36
+ systems: z.ZodArray<z.ZodObject<{
37
+ name: z.ZodString;
38
+ legacyPath: z.ZodString;
39
+ baseSha: z.ZodNullable<z.ZodString>;
40
+ createdAt: z.ZodString;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$strip>;
43
+ export type ProjectRecord = z.infer<typeof projectRecordSchema>;
44
+ export declare const phaseArtifactSchema: z.ZodObject<{
45
+ path: z.ZodString;
46
+ kind: z.ZodEnum<{
47
+ json: "json";
48
+ md: "md";
49
+ mermaid: "mermaid";
50
+ html: "html";
51
+ dir: "dir";
52
+ patch: "patch";
53
+ }>;
54
+ present: z.ZodBoolean;
55
+ valid: z.ZodBoolean;
56
+ }, z.core.$strip>;
57
+ export type PhaseArtifact = z.infer<typeof phaseArtifactSchema>;
58
+ export declare const gateSchema: z.ZodObject<{
59
+ decision: z.ZodEnum<{
60
+ approve: "approve";
61
+ reject: "reject";
62
+ }>;
63
+ note: z.ZodNullable<z.ZodString>;
64
+ decidedAt: z.ZodString;
65
+ }, z.core.$strip>;
66
+ export type Gate = z.infer<typeof gateSchema>;
67
+ export declare const phaseRecordSchema: z.ZodObject<{
68
+ schemaVersion: z.ZodLiteral<1>;
69
+ system: z.ZodString;
70
+ phase: z.ZodEnum<{
71
+ assess: "assess";
72
+ map: "map";
73
+ extract: "extract";
74
+ brief: "brief";
75
+ transform: "transform";
76
+ reimagine: "reimagine";
77
+ harden: "harden";
78
+ }>;
79
+ status: z.ZodEnum<{
80
+ pending: "pending";
81
+ running: "running";
82
+ produced: "produced";
83
+ validated: "validated";
84
+ failed: "failed";
85
+ "gate-approved": "gate-approved";
86
+ "gate-rejected": "gate-rejected";
87
+ }>;
88
+ artifacts: z.ZodArray<z.ZodObject<{
89
+ path: z.ZodString;
90
+ kind: z.ZodEnum<{
91
+ json: "json";
92
+ md: "md";
93
+ mermaid: "mermaid";
94
+ html: "html";
95
+ dir: "dir";
96
+ patch: "patch";
97
+ }>;
98
+ present: z.ZodBoolean;
99
+ valid: z.ZodBoolean;
100
+ }, z.core.$strip>>;
101
+ runId: z.ZodNullable<z.ZodString>;
102
+ baseSha: z.ZodNullable<z.ZodString>;
103
+ gate: z.ZodNullable<z.ZodObject<{
104
+ decision: z.ZodEnum<{
105
+ approve: "approve";
106
+ reject: "reject";
107
+ }>;
108
+ note: z.ZodNullable<z.ZodString>;
109
+ decidedAt: z.ZodString;
110
+ }, z.core.$strip>>;
111
+ createdAt: z.ZodString;
112
+ updatedAt: z.ZodString;
113
+ }, z.core.$strip>;
114
+ export type PhaseRecord = z.infer<typeof phaseRecordSchema>;
115
+ export declare const runRecordSchema: z.ZodObject<{
116
+ schemaVersion: z.ZodLiteral<1>;
117
+ runId: z.ZodString;
118
+ system: z.ZodString;
119
+ phase: z.ZodEnum<{
120
+ assess: "assess";
121
+ map: "map";
122
+ extract: "extract";
123
+ brief: "brief";
124
+ transform: "transform";
125
+ reimagine: "reimagine";
126
+ harden: "harden";
127
+ }>;
128
+ provider: z.ZodString;
129
+ model: z.ZodNullable<z.ZodString>;
130
+ mutating: z.ZodBoolean;
131
+ startedAt: z.ZodString;
132
+ finishedAt: z.ZodNullable<z.ZodString>;
133
+ status: z.ZodEnum<{
134
+ running: "running";
135
+ failed: "failed";
136
+ ok: "ok";
137
+ }>;
138
+ droppedArtifacts: z.ZodNumber;
139
+ summary: z.ZodNullable<z.ZodString>;
140
+ }, z.core.$strip>;
141
+ export type RunRecord = z.infer<typeof runRecordSchema>;
142
+ /** The single shape the model is asked to emit at the end of each phase. */
143
+ export declare const phaseOutputArtifactSchema: z.ZodObject<{
144
+ path: z.ZodString;
145
+ kind: z.ZodEnum<{
146
+ json: "json";
147
+ md: "md";
148
+ mermaid: "mermaid";
149
+ html: "html";
150
+ dir: "dir";
151
+ patch: "patch";
152
+ }>;
153
+ }, z.core.$strip>;
154
+ export type PhaseOutputArtifact = z.infer<typeof phaseOutputArtifactSchema>;
155
+ export declare const phaseOutputSchema: z.ZodObject<{
156
+ summary: z.ZodString;
157
+ artifacts: z.ZodArray<z.ZodObject<{
158
+ path: z.ZodString;
159
+ kind: z.ZodEnum<{
160
+ json: "json";
161
+ md: "md";
162
+ mermaid: "mermaid";
163
+ html: "html";
164
+ dir: "dir";
165
+ patch: "patch";
166
+ }>;
167
+ }, z.core.$strip>>;
168
+ notes: z.ZodNullable<z.ZodString>;
169
+ }, z.core.$strip>;
170
+ export type PhaseOutput = z.infer<typeof phaseOutputSchema>;
package/dist/types.js ADDED
@@ -0,0 +1,75 @@
1
+ import { z } from "zod";
2
+ import { PHASE_NAMES } from "./phases.js";
3
+ /** Every persisted record carries `schemaVersion` so reads stay forward-compatible. */
4
+ export const artifactKindSchema = z.enum(["md", "mermaid", "json", "html", "dir", "patch"]);
5
+ export const phaseStatusSchema = z.enum([
6
+ "pending",
7
+ "running",
8
+ "produced",
9
+ "validated",
10
+ "failed",
11
+ "gate-approved",
12
+ "gate-rejected",
13
+ ]);
14
+ export const configRecordSchema = z.object({
15
+ schemaVersion: z.literal(1),
16
+ provider: z.string(),
17
+ model: z.string().nullable(),
18
+ });
19
+ export const systemEntrySchema = z.object({
20
+ name: z.string(),
21
+ legacyPath: z.string(),
22
+ baseSha: z.string().nullable(),
23
+ createdAt: z.string(),
24
+ });
25
+ export const projectRecordSchema = z.object({
26
+ schemaVersion: z.literal(1),
27
+ systems: z.array(systemEntrySchema),
28
+ });
29
+ export const phaseArtifactSchema = z.object({
30
+ path: z.string(),
31
+ kind: artifactKindSchema,
32
+ present: z.boolean(),
33
+ valid: z.boolean(),
34
+ });
35
+ export const gateSchema = z.object({
36
+ decision: z.enum(["approve", "reject"]),
37
+ note: z.string().nullable(),
38
+ decidedAt: z.string(),
39
+ });
40
+ export const phaseRecordSchema = z.object({
41
+ schemaVersion: z.literal(1),
42
+ system: z.string(),
43
+ phase: z.enum(PHASE_NAMES),
44
+ status: phaseStatusSchema,
45
+ artifacts: z.array(phaseArtifactSchema),
46
+ runId: z.string().nullable(),
47
+ baseSha: z.string().nullable(),
48
+ gate: gateSchema.nullable(),
49
+ createdAt: z.string(),
50
+ updatedAt: z.string(),
51
+ });
52
+ export const runRecordSchema = z.object({
53
+ schemaVersion: z.literal(1),
54
+ runId: z.string(),
55
+ system: z.string(),
56
+ phase: z.enum(PHASE_NAMES),
57
+ provider: z.string(),
58
+ model: z.string().nullable(),
59
+ mutating: z.boolean(),
60
+ startedAt: z.string(),
61
+ finishedAt: z.string().nullable(),
62
+ status: z.enum(["running", "ok", "failed"]),
63
+ droppedArtifacts: z.number(),
64
+ summary: z.string().nullable(),
65
+ });
66
+ /** The single shape the model is asked to emit at the end of each phase. */
67
+ export const phaseOutputArtifactSchema = z.object({
68
+ path: z.string(),
69
+ kind: artifactKindSchema,
70
+ });
71
+ export const phaseOutputSchema = z.object({
72
+ summary: z.string(),
73
+ artifacts: z.array(phaseOutputArtifactSchema),
74
+ notes: z.string().nullable(),
75
+ });
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "legacymaxxing",
3
+ "version": "0.1.0",
4
+ "description": "A loop CLI that guides an AI agent (Codex first) through the code-modernization lifecycle: assess → map → extract → brief → transform/reimagine → harden, with gated mutation and persisted, resumable state.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "legacymaxxing": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "type": "module",
15
+ "dependencies": {
16
+ "zod": "^4.4.3"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^22",
20
+ "oxfmt": "^0.50.0",
21
+ "oxlint": "^1.64.0",
22
+ "typescript": "^6.0.3",
23
+ "vitest": "^4.1.6"
24
+ },
25
+ "engines": {
26
+ "node": ">=22"
27
+ },
28
+ "scripts": {
29
+ "build": "tsc -p tsconfig.build.json && node scripts/postbuild.mjs",
30
+ "typecheck": "tsc -p tsconfig.json --noEmit",
31
+ "lint": "oxlint . --config oxlint.json",
32
+ "format": "oxfmt --write .",
33
+ "format:check": "oxfmt --check .",
34
+ "test": "vitest run",
35
+ "pack:smoke": "node scripts/package-smoke.mjs"
36
+ }
37
+ }