@lannguyensi/harness 0.6.0 → 0.7.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.
- package/CHANGELOG.md +77 -0
- package/README.md +156 -154
- package/dist/cli/describe.d.ts +1 -1
- package/dist/cli/describe.js +2 -0
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/doctor/format.js +18 -1
- package/dist/cli/doctor/format.js.map +1 -1
- package/dist/cli/doctor/index.js +30 -1
- package/dist/cli/doctor/index.js.map +1 -1
- package/dist/cli/doctor/types.d.ts +14 -0
- package/dist/cli/explain.d.ts +10 -1
- package/dist/cli/explain.js +44 -18
- package/dist/cli/explain.js.map +1 -1
- package/dist/cli/index.js +58 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/list.d.ts +1 -1
- package/dist/cli/list.js +17 -0
- package/dist/cli/list.js.map +1 -1
- package/dist/cli/session-export/index.d.ts +46 -0
- package/dist/cli/session-export/index.js +169 -0
- package/dist/cli/session-export/index.js.map +1 -0
- package/dist/cli/session-export/redact.d.ts +22 -0
- package/dist/cli/session-export/redact.js +47 -0
- package/dist/cli/session-export/redact.js.map +1 -0
- package/dist/cli/session-export/transcript.d.ts +24 -0
- package/dist/cli/session-export/transcript.js +162 -0
- package/dist/cli/session-export/transcript.js.map +1 -0
- package/dist/policies/ledger-client.js +2 -1
- package/dist/policies/ledger-client.js.map +1 -1
- package/dist/probes/mcp.js +2 -1
- package/dist/probes/mcp.js.map +1 -1
- package/dist/runtime/ledger-record.js +2 -1
- package/dist/runtime/ledger-record.js.map +1 -1
- package/dist/schema/audit.d.ts +71 -0
- package/dist/schema/audit.js +32 -0
- package/dist/schema/audit.js.map +1 -0
- package/dist/schema/index.d.ts +408 -0
- package/dist/schema/index.js +21 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/workflows.d.ts +519 -0
- package/dist/schema/workflows.js +81 -0
- package/dist/schema/workflows.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RedactRuleSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
3
|
+
regex: z.ZodString;
|
|
4
|
+
replacement: z.ZodDefault<z.ZodString>;
|
|
5
|
+
}, "strict", z.ZodTypeAny, {
|
|
6
|
+
regex: string;
|
|
7
|
+
replacement: string;
|
|
8
|
+
}, {
|
|
9
|
+
regex: string;
|
|
10
|
+
replacement?: string | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
regex: string;
|
|
13
|
+
replacement: string;
|
|
14
|
+
}, {
|
|
15
|
+
regex: string;
|
|
16
|
+
replacement?: string | undefined;
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
env_var: z.ZodString;
|
|
19
|
+
replacement: z.ZodDefault<z.ZodString>;
|
|
20
|
+
}, "strict", z.ZodTypeAny, {
|
|
21
|
+
replacement: string;
|
|
22
|
+
env_var: string;
|
|
23
|
+
}, {
|
|
24
|
+
env_var: string;
|
|
25
|
+
replacement?: string | undefined;
|
|
26
|
+
}>]>;
|
|
27
|
+
export declare const AuditSchema: z.ZodObject<{
|
|
28
|
+
redact: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
29
|
+
regex: z.ZodString;
|
|
30
|
+
replacement: z.ZodDefault<z.ZodString>;
|
|
31
|
+
}, "strict", z.ZodTypeAny, {
|
|
32
|
+
regex: string;
|
|
33
|
+
replacement: string;
|
|
34
|
+
}, {
|
|
35
|
+
regex: string;
|
|
36
|
+
replacement?: string | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
regex: string;
|
|
39
|
+
replacement: string;
|
|
40
|
+
}, {
|
|
41
|
+
regex: string;
|
|
42
|
+
replacement?: string | undefined;
|
|
43
|
+
}>, z.ZodObject<{
|
|
44
|
+
env_var: z.ZodString;
|
|
45
|
+
replacement: z.ZodDefault<z.ZodString>;
|
|
46
|
+
}, "strict", z.ZodTypeAny, {
|
|
47
|
+
replacement: string;
|
|
48
|
+
env_var: string;
|
|
49
|
+
}, {
|
|
50
|
+
env_var: string;
|
|
51
|
+
replacement?: string | undefined;
|
|
52
|
+
}>]>, "many">>;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
redact: ({
|
|
55
|
+
regex: string;
|
|
56
|
+
replacement: string;
|
|
57
|
+
} | {
|
|
58
|
+
replacement: string;
|
|
59
|
+
env_var: string;
|
|
60
|
+
})[];
|
|
61
|
+
}, {
|
|
62
|
+
redact?: ({
|
|
63
|
+
regex: string;
|
|
64
|
+
replacement?: string | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
env_var: string;
|
|
67
|
+
replacement?: string | undefined;
|
|
68
|
+
})[] | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export type RedactRule = z.infer<typeof RedactRuleSchema>;
|
|
71
|
+
export type AuditConfig = z.infer<typeof AuditSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const RegexRedactRuleSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
regex: z.string().min(1),
|
|
5
|
+
replacement: z.string().default("<REDACTED>"),
|
|
6
|
+
})
|
|
7
|
+
.strict()
|
|
8
|
+
.superRefine((rule, ctx) => {
|
|
9
|
+
try {
|
|
10
|
+
new RegExp(rule.regex);
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
ctx.addIssue({
|
|
14
|
+
code: z.ZodIssueCode.custom,
|
|
15
|
+
path: ["regex"],
|
|
16
|
+
message: `invalid regex: ${err.message}`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const EnvVarRedactRuleSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
env_var: z.string().min(1),
|
|
23
|
+
replacement: z.string().default("<REDACTED>"),
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
export const RedactRuleSchema = z.union([RegexRedactRuleSchema, EnvVarRedactRuleSchema]);
|
|
27
|
+
export const AuditSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
redact: z.array(RedactRuleSchema).default([]),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/schema/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;CAC9C,CAAC;KACD,MAAM,EAAE;KACR,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACzB,IAAI,CAAC;QACH,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,OAAO,CAAC;YACf,OAAO,EAAE,kBAAmB,GAAa,CAAC,OAAO,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,MAAM,sBAAsB,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;CAC9C,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAEzF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC9C,CAAC;KACD,MAAM,EAAE,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -581,6 +581,268 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
581
581
|
hook: string;
|
|
582
582
|
enforcement: "warn" | "block";
|
|
583
583
|
}[]>>;
|
|
584
|
+
workflows: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
585
|
+
name: z.ZodString;
|
|
586
|
+
when: z.ZodDefault<z.ZodObject<{
|
|
587
|
+
task_label: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
588
|
+
project: z.ZodOptional<z.ZodString>;
|
|
589
|
+
}, "strict", z.ZodTypeAny, {
|
|
590
|
+
project?: string | undefined;
|
|
591
|
+
task_label?: string[] | undefined;
|
|
592
|
+
}, {
|
|
593
|
+
project?: string | undefined;
|
|
594
|
+
task_label?: string[] | undefined;
|
|
595
|
+
}>>;
|
|
596
|
+
steps: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
597
|
+
kind: z.ZodLiteral<"branch">;
|
|
598
|
+
from: z.ZodDefault<z.ZodString>;
|
|
599
|
+
per_task: z.ZodDefault<z.ZodBoolean>;
|
|
600
|
+
}, "strict", z.ZodTypeAny, {
|
|
601
|
+
kind: "branch";
|
|
602
|
+
from: string;
|
|
603
|
+
per_task: boolean;
|
|
604
|
+
}, {
|
|
605
|
+
kind: "branch";
|
|
606
|
+
from?: string | undefined;
|
|
607
|
+
per_task?: boolean | undefined;
|
|
608
|
+
}>, z.ZodObject<{
|
|
609
|
+
kind: z.ZodLiteral<"review_subagent">;
|
|
610
|
+
spawn: z.ZodDefault<z.ZodEnum<["required", "optional", "skip"]>>;
|
|
611
|
+
agent_type: z.ZodDefault<z.ZodString>;
|
|
612
|
+
rigor: z.ZodDefault<z.ZodEnum<["rigorous", "quick", "docs-only"]>>;
|
|
613
|
+
template: z.ZodOptional<z.ZodString>;
|
|
614
|
+
on_findings: z.ZodDefault<z.ZodEnum<["fix_then_remerge", "comment_only"]>>;
|
|
615
|
+
}, "strict", z.ZodTypeAny, {
|
|
616
|
+
kind: "review_subagent";
|
|
617
|
+
spawn: "required" | "optional" | "skip";
|
|
618
|
+
agent_type: string;
|
|
619
|
+
rigor: "rigorous" | "quick" | "docs-only";
|
|
620
|
+
on_findings: "fix_then_remerge" | "comment_only";
|
|
621
|
+
template?: string | undefined;
|
|
622
|
+
}, {
|
|
623
|
+
kind: "review_subagent";
|
|
624
|
+
spawn?: "required" | "optional" | "skip" | undefined;
|
|
625
|
+
agent_type?: string | undefined;
|
|
626
|
+
rigor?: "rigorous" | "quick" | "docs-only" | undefined;
|
|
627
|
+
template?: string | undefined;
|
|
628
|
+
on_findings?: "fix_then_remerge" | "comment_only" | undefined;
|
|
629
|
+
}>, z.ZodObject<{
|
|
630
|
+
kind: z.ZodLiteral<"ci_gate">;
|
|
631
|
+
wait_for: z.ZodDefault<z.ZodString>;
|
|
632
|
+
}, "strict", z.ZodTypeAny, {
|
|
633
|
+
kind: "ci_gate";
|
|
634
|
+
wait_for: string;
|
|
635
|
+
}, {
|
|
636
|
+
kind: "ci_gate";
|
|
637
|
+
wait_for?: string | undefined;
|
|
638
|
+
}>, z.ZodObject<{
|
|
639
|
+
kind: z.ZodLiteral<"merge">;
|
|
640
|
+
method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
|
|
641
|
+
gate: z.ZodDefault<z.ZodEnum<["solo", "agent_tasks_label", "none"]>>;
|
|
642
|
+
}, "strict", z.ZodTypeAny, {
|
|
643
|
+
kind: "merge";
|
|
644
|
+
method: "merge" | "squash" | "rebase";
|
|
645
|
+
gate: "solo" | "agent_tasks_label" | "none";
|
|
646
|
+
}, {
|
|
647
|
+
kind: "merge";
|
|
648
|
+
method?: "merge" | "squash" | "rebase" | undefined;
|
|
649
|
+
gate?: "solo" | "agent_tasks_label" | "none" | undefined;
|
|
650
|
+
}>]>, "many">;
|
|
651
|
+
}, "strict", z.ZodTypeAny, {
|
|
652
|
+
name: string;
|
|
653
|
+
when: {
|
|
654
|
+
project?: string | undefined;
|
|
655
|
+
task_label?: string[] | undefined;
|
|
656
|
+
};
|
|
657
|
+
steps: ({
|
|
658
|
+
kind: "branch";
|
|
659
|
+
from: string;
|
|
660
|
+
per_task: boolean;
|
|
661
|
+
} | {
|
|
662
|
+
kind: "review_subagent";
|
|
663
|
+
spawn: "required" | "optional" | "skip";
|
|
664
|
+
agent_type: string;
|
|
665
|
+
rigor: "rigorous" | "quick" | "docs-only";
|
|
666
|
+
on_findings: "fix_then_remerge" | "comment_only";
|
|
667
|
+
template?: string | undefined;
|
|
668
|
+
} | {
|
|
669
|
+
kind: "ci_gate";
|
|
670
|
+
wait_for: string;
|
|
671
|
+
} | {
|
|
672
|
+
kind: "merge";
|
|
673
|
+
method: "merge" | "squash" | "rebase";
|
|
674
|
+
gate: "solo" | "agent_tasks_label" | "none";
|
|
675
|
+
})[];
|
|
676
|
+
}, {
|
|
677
|
+
name: string;
|
|
678
|
+
steps: ({
|
|
679
|
+
kind: "branch";
|
|
680
|
+
from?: string | undefined;
|
|
681
|
+
per_task?: boolean | undefined;
|
|
682
|
+
} | {
|
|
683
|
+
kind: "review_subagent";
|
|
684
|
+
spawn?: "required" | "optional" | "skip" | undefined;
|
|
685
|
+
agent_type?: string | undefined;
|
|
686
|
+
rigor?: "rigorous" | "quick" | "docs-only" | undefined;
|
|
687
|
+
template?: string | undefined;
|
|
688
|
+
on_findings?: "fix_then_remerge" | "comment_only" | undefined;
|
|
689
|
+
} | {
|
|
690
|
+
kind: "ci_gate";
|
|
691
|
+
wait_for?: string | undefined;
|
|
692
|
+
} | {
|
|
693
|
+
kind: "merge";
|
|
694
|
+
method?: "merge" | "squash" | "rebase" | undefined;
|
|
695
|
+
gate?: "solo" | "agent_tasks_label" | "none" | undefined;
|
|
696
|
+
})[];
|
|
697
|
+
when?: {
|
|
698
|
+
project?: string | undefined;
|
|
699
|
+
task_label?: string[] | undefined;
|
|
700
|
+
} | undefined;
|
|
701
|
+
}>, {
|
|
702
|
+
name: string;
|
|
703
|
+
when: {
|
|
704
|
+
project?: string | undefined;
|
|
705
|
+
task_label?: string[] | undefined;
|
|
706
|
+
};
|
|
707
|
+
steps: ({
|
|
708
|
+
kind: "branch";
|
|
709
|
+
from: string;
|
|
710
|
+
per_task: boolean;
|
|
711
|
+
} | {
|
|
712
|
+
kind: "review_subagent";
|
|
713
|
+
spawn: "required" | "optional" | "skip";
|
|
714
|
+
agent_type: string;
|
|
715
|
+
rigor: "rigorous" | "quick" | "docs-only";
|
|
716
|
+
on_findings: "fix_then_remerge" | "comment_only";
|
|
717
|
+
template?: string | undefined;
|
|
718
|
+
} | {
|
|
719
|
+
kind: "ci_gate";
|
|
720
|
+
wait_for: string;
|
|
721
|
+
} | {
|
|
722
|
+
kind: "merge";
|
|
723
|
+
method: "merge" | "squash" | "rebase";
|
|
724
|
+
gate: "solo" | "agent_tasks_label" | "none";
|
|
725
|
+
})[];
|
|
726
|
+
}, {
|
|
727
|
+
name: string;
|
|
728
|
+
steps: ({
|
|
729
|
+
kind: "branch";
|
|
730
|
+
from?: string | undefined;
|
|
731
|
+
per_task?: boolean | undefined;
|
|
732
|
+
} | {
|
|
733
|
+
kind: "review_subagent";
|
|
734
|
+
spawn?: "required" | "optional" | "skip" | undefined;
|
|
735
|
+
agent_type?: string | undefined;
|
|
736
|
+
rigor?: "rigorous" | "quick" | "docs-only" | undefined;
|
|
737
|
+
template?: string | undefined;
|
|
738
|
+
on_findings?: "fix_then_remerge" | "comment_only" | undefined;
|
|
739
|
+
} | {
|
|
740
|
+
kind: "ci_gate";
|
|
741
|
+
wait_for?: string | undefined;
|
|
742
|
+
} | {
|
|
743
|
+
kind: "merge";
|
|
744
|
+
method?: "merge" | "squash" | "rebase" | undefined;
|
|
745
|
+
gate?: "solo" | "agent_tasks_label" | "none" | undefined;
|
|
746
|
+
})[];
|
|
747
|
+
when?: {
|
|
748
|
+
project?: string | undefined;
|
|
749
|
+
task_label?: string[] | undefined;
|
|
750
|
+
} | undefined;
|
|
751
|
+
}>, "many">, {
|
|
752
|
+
name: string;
|
|
753
|
+
when: {
|
|
754
|
+
project?: string | undefined;
|
|
755
|
+
task_label?: string[] | undefined;
|
|
756
|
+
};
|
|
757
|
+
steps: ({
|
|
758
|
+
kind: "branch";
|
|
759
|
+
from: string;
|
|
760
|
+
per_task: boolean;
|
|
761
|
+
} | {
|
|
762
|
+
kind: "review_subagent";
|
|
763
|
+
spawn: "required" | "optional" | "skip";
|
|
764
|
+
agent_type: string;
|
|
765
|
+
rigor: "rigorous" | "quick" | "docs-only";
|
|
766
|
+
on_findings: "fix_then_remerge" | "comment_only";
|
|
767
|
+
template?: string | undefined;
|
|
768
|
+
} | {
|
|
769
|
+
kind: "ci_gate";
|
|
770
|
+
wait_for: string;
|
|
771
|
+
} | {
|
|
772
|
+
kind: "merge";
|
|
773
|
+
method: "merge" | "squash" | "rebase";
|
|
774
|
+
gate: "solo" | "agent_tasks_label" | "none";
|
|
775
|
+
})[];
|
|
776
|
+
}[], {
|
|
777
|
+
name: string;
|
|
778
|
+
steps: ({
|
|
779
|
+
kind: "branch";
|
|
780
|
+
from?: string | undefined;
|
|
781
|
+
per_task?: boolean | undefined;
|
|
782
|
+
} | {
|
|
783
|
+
kind: "review_subagent";
|
|
784
|
+
spawn?: "required" | "optional" | "skip" | undefined;
|
|
785
|
+
agent_type?: string | undefined;
|
|
786
|
+
rigor?: "rigorous" | "quick" | "docs-only" | undefined;
|
|
787
|
+
template?: string | undefined;
|
|
788
|
+
on_findings?: "fix_then_remerge" | "comment_only" | undefined;
|
|
789
|
+
} | {
|
|
790
|
+
kind: "ci_gate";
|
|
791
|
+
wait_for?: string | undefined;
|
|
792
|
+
} | {
|
|
793
|
+
kind: "merge";
|
|
794
|
+
method?: "merge" | "squash" | "rebase" | undefined;
|
|
795
|
+
gate?: "solo" | "agent_tasks_label" | "none" | undefined;
|
|
796
|
+
})[];
|
|
797
|
+
when?: {
|
|
798
|
+
project?: string | undefined;
|
|
799
|
+
task_label?: string[] | undefined;
|
|
800
|
+
} | undefined;
|
|
801
|
+
}[]>>;
|
|
802
|
+
review_templates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
803
|
+
audit: z.ZodDefault<z.ZodObject<{
|
|
804
|
+
redact: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
805
|
+
regex: z.ZodString;
|
|
806
|
+
replacement: z.ZodDefault<z.ZodString>;
|
|
807
|
+
}, "strict", z.ZodTypeAny, {
|
|
808
|
+
regex: string;
|
|
809
|
+
replacement: string;
|
|
810
|
+
}, {
|
|
811
|
+
regex: string;
|
|
812
|
+
replacement?: string | undefined;
|
|
813
|
+
}>, {
|
|
814
|
+
regex: string;
|
|
815
|
+
replacement: string;
|
|
816
|
+
}, {
|
|
817
|
+
regex: string;
|
|
818
|
+
replacement?: string | undefined;
|
|
819
|
+
}>, z.ZodObject<{
|
|
820
|
+
env_var: z.ZodString;
|
|
821
|
+
replacement: z.ZodDefault<z.ZodString>;
|
|
822
|
+
}, "strict", z.ZodTypeAny, {
|
|
823
|
+
replacement: string;
|
|
824
|
+
env_var: string;
|
|
825
|
+
}, {
|
|
826
|
+
env_var: string;
|
|
827
|
+
replacement?: string | undefined;
|
|
828
|
+
}>]>, "many">>;
|
|
829
|
+
}, "strict", z.ZodTypeAny, {
|
|
830
|
+
redact: ({
|
|
831
|
+
regex: string;
|
|
832
|
+
replacement: string;
|
|
833
|
+
} | {
|
|
834
|
+
replacement: string;
|
|
835
|
+
env_var: string;
|
|
836
|
+
})[];
|
|
837
|
+
}, {
|
|
838
|
+
redact?: ({
|
|
839
|
+
regex: string;
|
|
840
|
+
replacement?: string | undefined;
|
|
841
|
+
} | {
|
|
842
|
+
env_var: string;
|
|
843
|
+
replacement?: string | undefined;
|
|
844
|
+
})[] | undefined;
|
|
845
|
+
}>>;
|
|
584
846
|
}, "strict", z.ZodTypeAny, {
|
|
585
847
|
version: 1;
|
|
586
848
|
grounding: {
|
|
@@ -672,6 +934,42 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
672
934
|
hook: string;
|
|
673
935
|
enforcement: "warn" | "block";
|
|
674
936
|
}[];
|
|
937
|
+
workflows: {
|
|
938
|
+
name: string;
|
|
939
|
+
when: {
|
|
940
|
+
project?: string | undefined;
|
|
941
|
+
task_label?: string[] | undefined;
|
|
942
|
+
};
|
|
943
|
+
steps: ({
|
|
944
|
+
kind: "branch";
|
|
945
|
+
from: string;
|
|
946
|
+
per_task: boolean;
|
|
947
|
+
} | {
|
|
948
|
+
kind: "review_subagent";
|
|
949
|
+
spawn: "required" | "optional" | "skip";
|
|
950
|
+
agent_type: string;
|
|
951
|
+
rigor: "rigorous" | "quick" | "docs-only";
|
|
952
|
+
on_findings: "fix_then_remerge" | "comment_only";
|
|
953
|
+
template?: string | undefined;
|
|
954
|
+
} | {
|
|
955
|
+
kind: "ci_gate";
|
|
956
|
+
wait_for: string;
|
|
957
|
+
} | {
|
|
958
|
+
kind: "merge";
|
|
959
|
+
method: "merge" | "squash" | "rebase";
|
|
960
|
+
gate: "solo" | "agent_tasks_label" | "none";
|
|
961
|
+
})[];
|
|
962
|
+
}[];
|
|
963
|
+
review_templates: Record<string, string>;
|
|
964
|
+
audit: {
|
|
965
|
+
redact: ({
|
|
966
|
+
regex: string;
|
|
967
|
+
replacement: string;
|
|
968
|
+
} | {
|
|
969
|
+
replacement: string;
|
|
970
|
+
env_var: string;
|
|
971
|
+
})[];
|
|
972
|
+
};
|
|
675
973
|
}, {
|
|
676
974
|
version: 1;
|
|
677
975
|
grounding?: {
|
|
@@ -763,6 +1061,42 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
763
1061
|
hook: string;
|
|
764
1062
|
enforcement: "warn" | "block";
|
|
765
1063
|
}[] | undefined;
|
|
1064
|
+
workflows?: {
|
|
1065
|
+
name: string;
|
|
1066
|
+
steps: ({
|
|
1067
|
+
kind: "branch";
|
|
1068
|
+
from?: string | undefined;
|
|
1069
|
+
per_task?: boolean | undefined;
|
|
1070
|
+
} | {
|
|
1071
|
+
kind: "review_subagent";
|
|
1072
|
+
spawn?: "required" | "optional" | "skip" | undefined;
|
|
1073
|
+
agent_type?: string | undefined;
|
|
1074
|
+
rigor?: "rigorous" | "quick" | "docs-only" | undefined;
|
|
1075
|
+
template?: string | undefined;
|
|
1076
|
+
on_findings?: "fix_then_remerge" | "comment_only" | undefined;
|
|
1077
|
+
} | {
|
|
1078
|
+
kind: "ci_gate";
|
|
1079
|
+
wait_for?: string | undefined;
|
|
1080
|
+
} | {
|
|
1081
|
+
kind: "merge";
|
|
1082
|
+
method?: "merge" | "squash" | "rebase" | undefined;
|
|
1083
|
+
gate?: "solo" | "agent_tasks_label" | "none" | undefined;
|
|
1084
|
+
})[];
|
|
1085
|
+
when?: {
|
|
1086
|
+
project?: string | undefined;
|
|
1087
|
+
task_label?: string[] | undefined;
|
|
1088
|
+
} | undefined;
|
|
1089
|
+
}[] | undefined;
|
|
1090
|
+
review_templates?: Record<string, string> | undefined;
|
|
1091
|
+
audit?: {
|
|
1092
|
+
redact?: ({
|
|
1093
|
+
regex: string;
|
|
1094
|
+
replacement?: string | undefined;
|
|
1095
|
+
} | {
|
|
1096
|
+
env_var: string;
|
|
1097
|
+
replacement?: string | undefined;
|
|
1098
|
+
})[] | undefined;
|
|
1099
|
+
} | undefined;
|
|
766
1100
|
}>, {
|
|
767
1101
|
version: 1;
|
|
768
1102
|
grounding: {
|
|
@@ -854,6 +1188,42 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
854
1188
|
hook: string;
|
|
855
1189
|
enforcement: "warn" | "block";
|
|
856
1190
|
}[];
|
|
1191
|
+
workflows: {
|
|
1192
|
+
name: string;
|
|
1193
|
+
when: {
|
|
1194
|
+
project?: string | undefined;
|
|
1195
|
+
task_label?: string[] | undefined;
|
|
1196
|
+
};
|
|
1197
|
+
steps: ({
|
|
1198
|
+
kind: "branch";
|
|
1199
|
+
from: string;
|
|
1200
|
+
per_task: boolean;
|
|
1201
|
+
} | {
|
|
1202
|
+
kind: "review_subagent";
|
|
1203
|
+
spawn: "required" | "optional" | "skip";
|
|
1204
|
+
agent_type: string;
|
|
1205
|
+
rigor: "rigorous" | "quick" | "docs-only";
|
|
1206
|
+
on_findings: "fix_then_remerge" | "comment_only";
|
|
1207
|
+
template?: string | undefined;
|
|
1208
|
+
} | {
|
|
1209
|
+
kind: "ci_gate";
|
|
1210
|
+
wait_for: string;
|
|
1211
|
+
} | {
|
|
1212
|
+
kind: "merge";
|
|
1213
|
+
method: "merge" | "squash" | "rebase";
|
|
1214
|
+
gate: "solo" | "agent_tasks_label" | "none";
|
|
1215
|
+
})[];
|
|
1216
|
+
}[];
|
|
1217
|
+
review_templates: Record<string, string>;
|
|
1218
|
+
audit: {
|
|
1219
|
+
redact: ({
|
|
1220
|
+
regex: string;
|
|
1221
|
+
replacement: string;
|
|
1222
|
+
} | {
|
|
1223
|
+
replacement: string;
|
|
1224
|
+
env_var: string;
|
|
1225
|
+
})[];
|
|
1226
|
+
};
|
|
857
1227
|
}, {
|
|
858
1228
|
version: 1;
|
|
859
1229
|
grounding?: {
|
|
@@ -945,6 +1315,42 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
945
1315
|
hook: string;
|
|
946
1316
|
enforcement: "warn" | "block";
|
|
947
1317
|
}[] | undefined;
|
|
1318
|
+
workflows?: {
|
|
1319
|
+
name: string;
|
|
1320
|
+
steps: ({
|
|
1321
|
+
kind: "branch";
|
|
1322
|
+
from?: string | undefined;
|
|
1323
|
+
per_task?: boolean | undefined;
|
|
1324
|
+
} | {
|
|
1325
|
+
kind: "review_subagent";
|
|
1326
|
+
spawn?: "required" | "optional" | "skip" | undefined;
|
|
1327
|
+
agent_type?: string | undefined;
|
|
1328
|
+
rigor?: "rigorous" | "quick" | "docs-only" | undefined;
|
|
1329
|
+
template?: string | undefined;
|
|
1330
|
+
on_findings?: "fix_then_remerge" | "comment_only" | undefined;
|
|
1331
|
+
} | {
|
|
1332
|
+
kind: "ci_gate";
|
|
1333
|
+
wait_for?: string | undefined;
|
|
1334
|
+
} | {
|
|
1335
|
+
kind: "merge";
|
|
1336
|
+
method?: "merge" | "squash" | "rebase" | undefined;
|
|
1337
|
+
gate?: "solo" | "agent_tasks_label" | "none" | undefined;
|
|
1338
|
+
})[];
|
|
1339
|
+
when?: {
|
|
1340
|
+
project?: string | undefined;
|
|
1341
|
+
task_label?: string[] | undefined;
|
|
1342
|
+
} | undefined;
|
|
1343
|
+
}[] | undefined;
|
|
1344
|
+
review_templates?: Record<string, string> | undefined;
|
|
1345
|
+
audit?: {
|
|
1346
|
+
redact?: ({
|
|
1347
|
+
regex: string;
|
|
1348
|
+
replacement?: string | undefined;
|
|
1349
|
+
} | {
|
|
1350
|
+
env_var: string;
|
|
1351
|
+
replacement?: string | undefined;
|
|
1352
|
+
})[] | undefined;
|
|
1353
|
+
} | undefined;
|
|
948
1354
|
}>;
|
|
949
1355
|
export type Manifest = z.infer<typeof ManifestSchema>;
|
|
950
1356
|
export declare class ManifestParseError extends Error {
|
|
@@ -957,5 +1363,7 @@ export * from "./tools.js";
|
|
|
957
1363
|
export * from "./memory.js";
|
|
958
1364
|
export * from "./hooks.js";
|
|
959
1365
|
export * from "./policies.js";
|
|
1366
|
+
export * from "./workflows.js";
|
|
1367
|
+
export * from "./audit.js";
|
|
960
1368
|
export * from "./extract.js";
|
|
961
1369
|
export * from "./requires.js";
|
package/dist/schema/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import { HooksSchema } from "./hooks.js";
|
|
|
4
4
|
import { MemorySchema } from "./memory.js";
|
|
5
5
|
import { PoliciesSchema } from "./policies.js";
|
|
6
6
|
import { ToolsSchema } from "./tools.js";
|
|
7
|
+
import { AuditSchema } from "./audit.js";
|
|
8
|
+
import { ReviewTemplatesSchema, WorkflowsSchema } from "./workflows.js";
|
|
7
9
|
export const SUPPORTED_MANIFEST_VERSION = 1;
|
|
8
10
|
export const ManifestSchema = z
|
|
9
11
|
.object({
|
|
@@ -13,6 +15,9 @@ export const ManifestSchema = z
|
|
|
13
15
|
memory: MemorySchema.default({}),
|
|
14
16
|
hooks: HooksSchema.default([]),
|
|
15
17
|
policies: PoliciesSchema.default([]),
|
|
18
|
+
workflows: WorkflowsSchema.default([]),
|
|
19
|
+
review_templates: ReviewTemplatesSchema.default({}),
|
|
20
|
+
audit: AuditSchema.default({}),
|
|
16
21
|
})
|
|
17
22
|
.strict()
|
|
18
23
|
.superRefine((manifest, ctx) => {
|
|
@@ -26,6 +31,20 @@ export const ManifestSchema = z
|
|
|
26
31
|
});
|
|
27
32
|
}
|
|
28
33
|
});
|
|
34
|
+
const templateNames = new Set(Object.keys(manifest.review_templates));
|
|
35
|
+
manifest.workflows.forEach((wf, wi) => {
|
|
36
|
+
wf.steps.forEach((step, si) => {
|
|
37
|
+
if (step.kind === "review_subagent" && step.template !== undefined) {
|
|
38
|
+
if (!templateNames.has(step.template)) {
|
|
39
|
+
ctx.addIssue({
|
|
40
|
+
code: z.ZodIssueCode.custom,
|
|
41
|
+
path: ["workflows", wi, "steps", si, "template"],
|
|
42
|
+
message: `review_subagent.template "${step.template}" is not defined in review_templates`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
29
48
|
});
|
|
30
49
|
export class ManifestParseError extends Error {
|
|
31
50
|
issues;
|
|
@@ -50,6 +69,8 @@ export * from "./tools.js";
|
|
|
50
69
|
export * from "./memory.js";
|
|
51
70
|
export * from "./hooks.js";
|
|
52
71
|
export * from "./policies.js";
|
|
72
|
+
export * from "./workflows.js";
|
|
73
|
+
export * from "./audit.js";
|
|
53
74
|
export * from "./extract.js";
|
|
54
75
|
export * from "./requires.js";
|
|
55
76
|
//# sourceMappingURL=index.js.map
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,OAAO,EAAE,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