agent-contracts 0.19.2 → 0.19.4
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/README.md +1 -0
- package/cli-contract.yaml +56 -19
- package/dist/cli.js +58 -33
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -580,6 +580,7 @@ declare const DslSchema: z.ZodObject<{
|
|
|
580
580
|
task: z.ZodString;
|
|
581
581
|
from_agent: z.ZodString;
|
|
582
582
|
group: z.ZodOptional<z.ZodString>;
|
|
583
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
583
584
|
max_retries: z.ZodOptional<z.ZodNumber>;
|
|
584
585
|
max_follow_ups: z.ZodOptional<z.ZodNumber>;
|
|
585
586
|
retry: z.ZodOptional<z.ZodObject<{
|
|
@@ -592,6 +593,7 @@ declare const DslSchema: z.ZodObject<{
|
|
|
592
593
|
description: z.ZodOptional<z.ZodString>;
|
|
593
594
|
gate_kind: z.ZodString;
|
|
594
595
|
group: z.ZodOptional<z.ZodString>;
|
|
596
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
595
597
|
}, z.core.$loose>, z.ZodObject<{
|
|
596
598
|
type: z.ZodLiteral<"handoff">;
|
|
597
599
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -599,6 +601,7 @@ declare const DslSchema: z.ZodObject<{
|
|
|
599
601
|
task: z.ZodOptional<z.ZodString>;
|
|
600
602
|
from_agent: z.ZodOptional<z.ZodString>;
|
|
601
603
|
group: z.ZodOptional<z.ZodString>;
|
|
604
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
602
605
|
retry: z.ZodOptional<z.ZodObject<{
|
|
603
606
|
condition: z.ZodString;
|
|
604
607
|
fix_task: z.ZodString;
|
|
@@ -609,6 +612,7 @@ declare const DslSchema: z.ZodObject<{
|
|
|
609
612
|
description: z.ZodOptional<z.ZodString>;
|
|
610
613
|
validation: z.ZodString;
|
|
611
614
|
group: z.ZodOptional<z.ZodString>;
|
|
615
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
612
616
|
}, z.core.$loose>, z.ZodObject<{
|
|
613
617
|
type: z.ZodLiteral<"decision">;
|
|
614
618
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -616,6 +620,7 @@ declare const DslSchema: z.ZodObject<{
|
|
|
616
620
|
routing_key: z.ZodOptional<z.ZodString>;
|
|
617
621
|
branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
618
622
|
group: z.ZodOptional<z.ZodString>;
|
|
623
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
619
624
|
}, z.core.$loose>, z.ZodObject<{
|
|
620
625
|
type: z.ZodLiteral<"team_task">;
|
|
621
626
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -624,6 +629,7 @@ declare const DslSchema: z.ZodObject<{
|
|
|
624
629
|
handoff: z.ZodString;
|
|
625
630
|
expects: z.ZodString;
|
|
626
631
|
group: z.ZodOptional<z.ZodString>;
|
|
632
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
627
633
|
}, z.core.$loose>], "type">>;
|
|
628
634
|
sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
629
635
|
title: z.ZodString;
|
|
@@ -1075,6 +1081,7 @@ declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1075
1081
|
task: z.ZodString;
|
|
1076
1082
|
from_agent: z.ZodString;
|
|
1077
1083
|
group: z.ZodOptional<z.ZodString>;
|
|
1084
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1078
1085
|
max_retries: z.ZodOptional<z.ZodNumber>;
|
|
1079
1086
|
max_follow_ups: z.ZodOptional<z.ZodNumber>;
|
|
1080
1087
|
retry: z.ZodOptional<z.ZodObject<{
|
|
@@ -1087,6 +1094,7 @@ declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1087
1094
|
description: z.ZodOptional<z.ZodString>;
|
|
1088
1095
|
gate_kind: z.ZodString;
|
|
1089
1096
|
group: z.ZodOptional<z.ZodString>;
|
|
1097
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1090
1098
|
}, z.core.$loose>, z.ZodObject<{
|
|
1091
1099
|
type: z.ZodLiteral<"handoff">;
|
|
1092
1100
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1094,6 +1102,7 @@ declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1094
1102
|
task: z.ZodOptional<z.ZodString>;
|
|
1095
1103
|
from_agent: z.ZodOptional<z.ZodString>;
|
|
1096
1104
|
group: z.ZodOptional<z.ZodString>;
|
|
1105
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1097
1106
|
retry: z.ZodOptional<z.ZodObject<{
|
|
1098
1107
|
condition: z.ZodString;
|
|
1099
1108
|
fix_task: z.ZodString;
|
|
@@ -1104,6 +1113,7 @@ declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1104
1113
|
description: z.ZodOptional<z.ZodString>;
|
|
1105
1114
|
validation: z.ZodString;
|
|
1106
1115
|
group: z.ZodOptional<z.ZodString>;
|
|
1116
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1107
1117
|
}, z.core.$loose>, z.ZodObject<{
|
|
1108
1118
|
type: z.ZodLiteral<"decision">;
|
|
1109
1119
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1111,6 +1121,7 @@ declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1111
1121
|
routing_key: z.ZodOptional<z.ZodString>;
|
|
1112
1122
|
branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
1113
1123
|
group: z.ZodOptional<z.ZodString>;
|
|
1124
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1114
1125
|
}, z.core.$loose>, z.ZodObject<{
|
|
1115
1126
|
type: z.ZodLiteral<"team_task">;
|
|
1116
1127
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1119,6 +1130,7 @@ declare const WorkflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1119
1130
|
handoff: z.ZodString;
|
|
1120
1131
|
expects: z.ZodString;
|
|
1121
1132
|
group: z.ZodOptional<z.ZodString>;
|
|
1133
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1122
1134
|
}, z.core.$loose>], "type">;
|
|
1123
1135
|
type WorkflowStep = z.infer<typeof WorkflowStepSchema>;
|
|
1124
1136
|
declare const WorkflowSchema: z.ZodObject<{
|
|
@@ -1131,6 +1143,7 @@ declare const WorkflowSchema: z.ZodObject<{
|
|
|
1131
1143
|
task: z.ZodString;
|
|
1132
1144
|
from_agent: z.ZodString;
|
|
1133
1145
|
group: z.ZodOptional<z.ZodString>;
|
|
1146
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1134
1147
|
max_retries: z.ZodOptional<z.ZodNumber>;
|
|
1135
1148
|
max_follow_ups: z.ZodOptional<z.ZodNumber>;
|
|
1136
1149
|
retry: z.ZodOptional<z.ZodObject<{
|
|
@@ -1143,6 +1156,7 @@ declare const WorkflowSchema: z.ZodObject<{
|
|
|
1143
1156
|
description: z.ZodOptional<z.ZodString>;
|
|
1144
1157
|
gate_kind: z.ZodString;
|
|
1145
1158
|
group: z.ZodOptional<z.ZodString>;
|
|
1159
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1146
1160
|
}, z.core.$loose>, z.ZodObject<{
|
|
1147
1161
|
type: z.ZodLiteral<"handoff">;
|
|
1148
1162
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1150,6 +1164,7 @@ declare const WorkflowSchema: z.ZodObject<{
|
|
|
1150
1164
|
task: z.ZodOptional<z.ZodString>;
|
|
1151
1165
|
from_agent: z.ZodOptional<z.ZodString>;
|
|
1152
1166
|
group: z.ZodOptional<z.ZodString>;
|
|
1167
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1153
1168
|
retry: z.ZodOptional<z.ZodObject<{
|
|
1154
1169
|
condition: z.ZodString;
|
|
1155
1170
|
fix_task: z.ZodString;
|
|
@@ -1160,6 +1175,7 @@ declare const WorkflowSchema: z.ZodObject<{
|
|
|
1160
1175
|
description: z.ZodOptional<z.ZodString>;
|
|
1161
1176
|
validation: z.ZodString;
|
|
1162
1177
|
group: z.ZodOptional<z.ZodString>;
|
|
1178
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1163
1179
|
}, z.core.$loose>, z.ZodObject<{
|
|
1164
1180
|
type: z.ZodLiteral<"decision">;
|
|
1165
1181
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1167,6 +1183,7 @@ declare const WorkflowSchema: z.ZodObject<{
|
|
|
1167
1183
|
routing_key: z.ZodOptional<z.ZodString>;
|
|
1168
1184
|
branches: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
1169
1185
|
group: z.ZodOptional<z.ZodString>;
|
|
1186
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1170
1187
|
}, z.core.$loose>, z.ZodObject<{
|
|
1171
1188
|
type: z.ZodLiteral<"team_task">;
|
|
1172
1189
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1175,6 +1192,7 @@ declare const WorkflowSchema: z.ZodObject<{
|
|
|
1175
1192
|
handoff: z.ZodString;
|
|
1176
1193
|
expects: z.ZodString;
|
|
1177
1194
|
group: z.ZodOptional<z.ZodString>;
|
|
1195
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1178
1196
|
}, z.core.$loose>], "type">>;
|
|
1179
1197
|
sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1180
1198
|
title: z.ZodString;
|
|
@@ -1739,7 +1757,7 @@ declare function buildAuditContext(auditType: AuditType, dsl: Dsl, config: Resol
|
|
|
1739
1757
|
|
|
1740
1758
|
declare function formatAuditResult(r: AuditRunResult, format: OutputFormat): string;
|
|
1741
1759
|
declare function formatAuditResults(results: AuditRunResult[], format: OutputFormat): string;
|
|
1742
|
-
declare function computeExitCode(results: AuditRunResult[]): number;
|
|
1760
|
+
declare function computeExitCode(results: AuditRunResult[], failOn?: string): number;
|
|
1743
1761
|
|
|
1744
1762
|
interface ResolvedCheck {
|
|
1745
1763
|
guardrail_id: string;
|
package/dist/index.js
CHANGED
|
@@ -48967,6 +48967,7 @@ var WorkflowDelegateStepSchema = z14.object({
|
|
|
48967
48967
|
task: z14.string(),
|
|
48968
48968
|
from_agent: z14.string(),
|
|
48969
48969
|
group: z14.string().optional(),
|
|
48970
|
+
depends_on: z14.array(z14.string()).optional(),
|
|
48970
48971
|
max_retries: z14.number().int().min(0).optional(),
|
|
48971
48972
|
max_follow_ups: z14.number().int().min(0).optional(),
|
|
48972
48973
|
retry: RetrySchema.optional()
|
|
@@ -48975,7 +48976,8 @@ var WorkflowGateStepSchema = z14.object({
|
|
|
48975
48976
|
type: z14.literal("gate"),
|
|
48976
48977
|
description: z14.string().optional(),
|
|
48977
48978
|
gate_kind: z14.string(),
|
|
48978
|
-
group: z14.string().optional()
|
|
48979
|
+
group: z14.string().optional(),
|
|
48980
|
+
depends_on: z14.array(z14.string()).optional()
|
|
48979
48981
|
}).passthrough();
|
|
48980
48982
|
var WorkflowHandoffStepSchema = z14.object({
|
|
48981
48983
|
type: z14.literal("handoff"),
|
|
@@ -48984,13 +48986,15 @@ var WorkflowHandoffStepSchema = z14.object({
|
|
|
48984
48986
|
task: z14.string().optional(),
|
|
48985
48987
|
from_agent: z14.string().optional(),
|
|
48986
48988
|
group: z14.string().optional(),
|
|
48989
|
+
depends_on: z14.array(z14.string()).optional(),
|
|
48987
48990
|
retry: RetrySchema.optional()
|
|
48988
48991
|
}).passthrough();
|
|
48989
48992
|
var WorkflowValidationStepSchema = z14.object({
|
|
48990
48993
|
type: z14.literal("validation"),
|
|
48991
48994
|
description: z14.string().optional(),
|
|
48992
48995
|
validation: z14.string(),
|
|
48993
|
-
group: z14.string().optional()
|
|
48996
|
+
group: z14.string().optional(),
|
|
48997
|
+
depends_on: z14.array(z14.string()).optional()
|
|
48994
48998
|
}).passthrough();
|
|
48995
48999
|
var WorkflowDecisionStepSchema = z14.object({
|
|
48996
49000
|
type: z14.literal("decision"),
|
|
@@ -48999,7 +49003,8 @@ var WorkflowDecisionStepSchema = z14.object({
|
|
|
48999
49003
|
on: z14.string().optional(),
|
|
49000
49004
|
routing_key: z14.string().optional(),
|
|
49001
49005
|
branches: z14.record(z14.string(), z14.array(z14.string())),
|
|
49002
|
-
group: z14.string().optional()
|
|
49006
|
+
group: z14.string().optional(),
|
|
49007
|
+
depends_on: z14.array(z14.string()).optional()
|
|
49003
49008
|
}).passthrough();
|
|
49004
49009
|
var WorkflowTeamTaskStepSchema = z14.object({
|
|
49005
49010
|
type: z14.literal("team_task"),
|
|
@@ -49008,7 +49013,8 @@ var WorkflowTeamTaskStepSchema = z14.object({
|
|
|
49008
49013
|
workflow: z14.string(),
|
|
49009
49014
|
handoff: z14.string(),
|
|
49010
49015
|
expects: z14.string(),
|
|
49011
|
-
group: z14.string().optional()
|
|
49016
|
+
group: z14.string().optional(),
|
|
49017
|
+
depends_on: z14.array(z14.string()).optional()
|
|
49012
49018
|
}).passthrough();
|
|
49013
49019
|
var WorkflowStepSchema = z14.discriminatedUnion("type", [
|
|
49014
49020
|
WorkflowDelegateStepSchema,
|
|
@@ -55074,16 +55080,22 @@ function formatAuditResults(results, format2) {
|
|
|
55074
55080
|
}
|
|
55075
55081
|
return results.map((r3) => formatAuditResult(r3, format2)).join("\n\n");
|
|
55076
55082
|
}
|
|
55077
|
-
function computeExitCode(results) {
|
|
55083
|
+
function computeExitCode(results, failOn) {
|
|
55078
55084
|
for (const r3 of results) {
|
|
55079
55085
|
if (r3.status === "error") {
|
|
55080
|
-
if (r3.errorMessage?.includes("not installed")
|
|
55081
|
-
return
|
|
55086
|
+
if (r3.errorMessage?.includes("not installed")) return 11;
|
|
55087
|
+
if (r3.errorMessage?.includes("adapter") || r3.errorMessage?.includes("API")) return 12;
|
|
55088
|
+
return 1;
|
|
55082
55089
|
}
|
|
55083
55090
|
}
|
|
55091
|
+
const severityRank = { info: 0, warning: 1, error: 2, critical: 3 };
|
|
55092
|
+
const threshold = severityRank[failOn ?? "critical"] ?? 3;
|
|
55084
55093
|
for (const r3 of results) {
|
|
55085
|
-
if (r3.data?.critical_gaps
|
|
55086
|
-
|
|
55094
|
+
if (r3.data?.critical_gaps) {
|
|
55095
|
+
for (const gap of r3.data.critical_gaps) {
|
|
55096
|
+
const rank = severityRank[gap.severity ?? ""] ?? 0;
|
|
55097
|
+
if (rank >= threshold) return 10;
|
|
55098
|
+
}
|
|
55087
55099
|
}
|
|
55088
55100
|
}
|
|
55089
55101
|
return 0;
|