@harness-engineering/cli 2.4.5 → 2.6.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/dist/agents-md-2JUQ4FE2.js +13 -0
- package/dist/analyzer-VY6DJVOU-4AHIJLNS.js +26 -0
- package/dist/{architecture-NX7FWQD3.js → architecture-CXAVNB5X.js} +7 -4
- package/dist/{assess-project-PLY6ZWMW.js → assess-project-M626SSPN.js} +1 -1
- package/dist/bin/harness-mcp.js +20 -17
- package/dist/bin/harness.js +38 -35
- package/dist/{check-phase-gate-WFIEJKMN.js → check-phase-gate-XMU6LLUQ.js} +8 -5
- package/dist/{chunk-OPDIMKUZ.js → chunk-24KCOJJG.js} +2 -2
- package/dist/{chunk-72TZ2GZR.js → chunk-43M3RLFQ.js} +7 -7
- package/dist/{chunk-7TRTU7JL.js → chunk-5JNSFYZU.js} +2 -2
- package/dist/{chunk-PGY57ABC.js → chunk-6AX6R3LM.js} +7 -7
- package/dist/{chunk-TC4GQBIK.js → chunk-GWE5LL3R.js} +6 -6
- package/dist/{chunk-LJTQVJEP.js → chunk-GWF2OILZ.js} +2 -2
- package/dist/{chunk-FPUNXFJG.js → chunk-HFOB2MPQ.js} +2 -2
- package/dist/{chunk-Z6PF2YXB.js → chunk-HMW3VKUF.js} +3 -3
- package/dist/{chunk-NSLFLGUB.js → chunk-HYTRDAHV.js} +2 -2
- package/dist/{chunk-3XFFGAX4.js → chunk-I6K43QQS.js} +3 -3
- package/dist/{chunk-YL2N4OZQ.js → chunk-JFZOWO7D.js} +2 -2
- package/dist/{chunk-4H2KIQ3I.js → chunk-K246XQ2L.js} +2 -2
- package/dist/{chunk-ZEKY6PQQ.js → chunk-L5BCZ5XS.js} +2 -2
- package/dist/{chunk-4PO2QAXO.js → chunk-NX6A24DS.js} +2153 -985
- package/dist/{chunk-A5GXGRW6.js → chunk-OA6SWTU4.js} +6 -6
- package/dist/chunk-OH3NXXUY.js +383 -0
- package/dist/{chunk-DUK6C7I7.js → chunk-ORNMAYHB.js} +611 -300
- package/dist/{chunk-73ACYXIS.js → chunk-PFZEADQM.js} +1 -1
- package/dist/{chunk-M5TJOV3A.js → chunk-Q6ZR2L6Q.js} +2 -2
- package/dist/chunk-QCLOIUMX.js +395 -0
- package/dist/{chunk-DUCVDDZO.js → chunk-QOKMDDBJ.js} +4 -4
- package/dist/chunk-SZEFU6XC.js +3337 -0
- package/dist/{chunk-KEF624FQ.js → chunk-VTTNIZJL.js} +27 -6
- package/dist/chunk-XARGEOJV.js +21 -0
- package/dist/{chunk-HCTXLKAH.js → chunk-YP7I25SL.js} +2 -2
- package/dist/{chunk-65M5R3X6.js → chunk-YYRQCQPZ.js} +4204 -7347
- package/dist/ci-workflow-3JNDZQYD.js +13 -0
- package/dist/dist-E3SAAHCM.js +93 -0
- package/dist/{dist-SVZHSOLP.js → dist-OHDQBTSO.js} +119 -48
- package/dist/{docs-7LXCR62T.js → docs-5RYMDHN3.js} +8 -5
- package/dist/engine-KZ3PPUYE.js +13 -0
- package/dist/{entropy-LMOXWMR4.js → entropy-DQTAPSSE.js} +6 -3
- package/dist/{feedback-CLBC3IMP.js → feedback-WH6XPQJS.js} +1 -1
- package/dist/{generate-agent-definitions-5FDIGEVZ.js → generate-agent-definitions-SZA4QIHN.js} +8 -5
- package/dist/index.d.ts +47 -0
- package/dist/index.js +49 -46
- package/dist/loader-BNKGM23C.js +15 -0
- package/dist/{mcp-4W45E6OH.js → mcp-GZH4EYGD.js} +20 -17
- package/dist/{performance-WZQIUHLR.js → performance-54TMJOEU.js} +8 -5
- package/dist/{review-pipeline-YPRUHKM7.js → review-pipeline-OTDDVPNY.js} +6 -3
- package/dist/runtime-W5THSNAL.js +14 -0
- package/dist/{security-AZNLX3N6.js → security-27HW7CYT.js} +1 -1
- package/dist/timeline-manager-FPYKJRHR-VVX7CSGW.js +24 -0
- package/dist/{tool-tiers-QVWKAZX4.js → tool-tiers-B7JC2XC3.js} +9 -2
- package/dist/{validate-S7G6H7F4.js → validate-QRVCD4GP.js} +7 -4
- package/dist/validate-cross-check-BUAGBAPO.js +13 -0
- package/package.json +6 -6
- package/dist/agents-md-KJVGWF2S.js +0 -10
- package/dist/chunk-O63AAPIZ.js +0 -190
- package/dist/ci-workflow-XDIKOFSN.js +0 -10
- package/dist/dist-O733ZU6I.js +0 -49
- package/dist/engine-MMQF2ZW5.js +0 -10
- package/dist/loader-WTWR2CWT.js +0 -12
- package/dist/runtime-WC2IWI2X.js +0 -11
- package/dist/validate-cross-check-Z73SCHXZ.js +0 -10
|
@@ -72,7 +72,7 @@ async function handleAssessProject(input) {
|
|
|
72
72
|
let validateResult = null;
|
|
73
73
|
if (checksToRun.has("validate")) {
|
|
74
74
|
try {
|
|
75
|
-
const { handleValidateProject } = await import("./validate-
|
|
75
|
+
const { handleValidateProject } = await import("./validate-QRVCD4GP.js");
|
|
76
76
|
const result = await handleValidateProject({ path: projectPath });
|
|
77
77
|
const out = parseToolResponse(result, "validate");
|
|
78
78
|
if ("error" in out) {
|
|
@@ -101,7 +101,7 @@ async function handleAssessProject(input) {
|
|
|
101
101
|
parallelChecks.push(
|
|
102
102
|
(async () => {
|
|
103
103
|
try {
|
|
104
|
-
const { handleCheckDependencies } = await import("./architecture-
|
|
104
|
+
const { handleCheckDependencies } = await import("./architecture-CXAVNB5X.js");
|
|
105
105
|
const result = await handleCheckDependencies({ path: projectPath });
|
|
106
106
|
const out = parseToolResponse(result, "deps");
|
|
107
107
|
if ("error" in out) return out.error;
|
|
@@ -129,7 +129,7 @@ async function handleAssessProject(input) {
|
|
|
129
129
|
parallelChecks.push(
|
|
130
130
|
(async () => {
|
|
131
131
|
try {
|
|
132
|
-
const { handleCheckDocs } = await import("./docs-
|
|
132
|
+
const { handleCheckDocs } = await import("./docs-5RYMDHN3.js");
|
|
133
133
|
const result = await handleCheckDocs({ path: projectPath, scope: "coverage" });
|
|
134
134
|
const out = parseToolResponse(result, "docs");
|
|
135
135
|
if ("error" in out) return out.error;
|
|
@@ -157,7 +157,7 @@ async function handleAssessProject(input) {
|
|
|
157
157
|
parallelChecks.push(
|
|
158
158
|
(async () => {
|
|
159
159
|
try {
|
|
160
|
-
const { handleDetectEntropy } = await import("./entropy-
|
|
160
|
+
const { handleDetectEntropy } = await import("./entropy-DQTAPSSE.js");
|
|
161
161
|
const result = await handleDetectEntropy({ path: projectPath, type: "all" });
|
|
162
162
|
const out = parseToolResponse(result, "entropy");
|
|
163
163
|
if ("error" in out) return out.error;
|
|
@@ -188,7 +188,7 @@ async function handleAssessProject(input) {
|
|
|
188
188
|
parallelChecks.push(
|
|
189
189
|
(async () => {
|
|
190
190
|
try {
|
|
191
|
-
const { handleRunSecurityScan } = await import("./security-
|
|
191
|
+
const { handleRunSecurityScan } = await import("./security-27HW7CYT.js");
|
|
192
192
|
const result = await handleRunSecurityScan({ path: projectPath });
|
|
193
193
|
const out = parseToolResponse(result, "security");
|
|
194
194
|
if ("error" in out) return out.error;
|
|
@@ -221,7 +221,7 @@ async function handleAssessProject(input) {
|
|
|
221
221
|
parallelChecks.push(
|
|
222
222
|
(async () => {
|
|
223
223
|
try {
|
|
224
|
-
const { handleCheckPerformance } = await import("./performance-
|
|
224
|
+
const { handleCheckPerformance } = await import("./performance-54TMJOEU.js");
|
|
225
225
|
const result = await handleCheckPerformance({ path: projectPath });
|
|
226
226
|
if ("isError" in result && result.isError) {
|
|
227
227
|
const msg = result.content[0]?.text ?? "Performance check failed";
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm
|
|
3
|
+
} from "./chunk-KFQGP6VL.js";
|
|
4
|
+
|
|
5
|
+
// ../types/dist/index.mjs
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { z as z2 } from "zod";
|
|
8
|
+
import { z as z3 } from "zod";
|
|
9
|
+
import { z as z4 } from "zod";
|
|
10
|
+
import { z as z5 } from "zod";
|
|
11
|
+
import { z as z6 } from "zod";
|
|
12
|
+
function Ok(value) {
|
|
13
|
+
return { ok: true, value };
|
|
14
|
+
}
|
|
15
|
+
function Err(error) {
|
|
16
|
+
return { ok: false, error };
|
|
17
|
+
}
|
|
18
|
+
function isOk(result) {
|
|
19
|
+
return result.ok === true;
|
|
20
|
+
}
|
|
21
|
+
function isErr(result) {
|
|
22
|
+
return result.ok === false;
|
|
23
|
+
}
|
|
24
|
+
var STANDARD_COGNITIVE_MODES, DEFAULT_SKILL_CONTEXT_BUDGET, SESSION_SECTION_NAMES, TrajectoryMetadataSchema, PromptCacheStatsSchema, OTLPKeyValueSchema, OTLPSpanSchema, TokenScopeSchema, BridgeKindSchema, AuthTokenSchema, AuthTokenPublicSchema, AuthAuditEntrySchema, WebhookSubscriptionSchema, WebhookSubscriptionPublicSchema, GatewayEventSchema, WebhookDeliveryStatusSchema, WebhookDeliverySchema, INDEXED_FILE_KINDS, SessionSummarySchema, INSIGHTS_KEYS, SESSIONS_DEFAULTS, NotificationSinkKindSchema, NotificationSeveritySchema, NotificationActionSchema, NotificationEnvelopeSchema, NotificationSinkConfigSchema, NotificationsConfigSchema, NotificationDeliveryResultSchema, SkillProvenanceSchema, ProposalKindSchema, ProposalStatusSchema, ProposalGateFindingSchema, ProposalGateSchema, ProposalDecisionSchema, ProposalContentSchema, ProposalSourceSchema, SkillProposalSchema, EmitSkillProposalInputSchema, EditProposalInputSchema;
|
|
25
|
+
var init_dist = __esm({
|
|
26
|
+
"../types/dist/index.mjs"() {
|
|
27
|
+
STANDARD_COGNITIVE_MODES = [
|
|
28
|
+
"adversarial-reviewer",
|
|
29
|
+
"constructive-architect",
|
|
30
|
+
"meticulous-implementer",
|
|
31
|
+
"diagnostic-investigator",
|
|
32
|
+
"advisory-guide",
|
|
33
|
+
"meticulous-verifier"
|
|
34
|
+
];
|
|
35
|
+
DEFAULT_SKILL_CONTEXT_BUDGET = {
|
|
36
|
+
max_tokens: 4e3,
|
|
37
|
+
priority: 3
|
|
38
|
+
};
|
|
39
|
+
SESSION_SECTION_NAMES = [
|
|
40
|
+
"terminology",
|
|
41
|
+
"decisions",
|
|
42
|
+
"constraints",
|
|
43
|
+
"risks",
|
|
44
|
+
"openQuestions",
|
|
45
|
+
"evidence"
|
|
46
|
+
];
|
|
47
|
+
TrajectoryMetadataSchema = z.object({
|
|
48
|
+
turnsCount: z.number().int().nonnegative(),
|
|
49
|
+
toolCallCount: z.number().int().nonnegative(),
|
|
50
|
+
modelTokenSpend: z.object({
|
|
51
|
+
input: z.number().int().nonnegative(),
|
|
52
|
+
output: z.number().int().nonnegative(),
|
|
53
|
+
cacheRead: z.number().int().nonnegative(),
|
|
54
|
+
cacheCreation: z.number().int().nonnegative()
|
|
55
|
+
}),
|
|
56
|
+
promptCacheHit: z.number().int().nonnegative(),
|
|
57
|
+
promptCacheMiss: z.number().int().nonnegative(),
|
|
58
|
+
totalDurationMs: z.number().int().nonnegative(),
|
|
59
|
+
phasesReached: z.array(z.string())
|
|
60
|
+
});
|
|
61
|
+
PromptCacheStatsSchema = z.object({
|
|
62
|
+
totalRequests: z.number().int().nonnegative(),
|
|
63
|
+
hits: z.number().int().nonnegative(),
|
|
64
|
+
misses: z.number().int().nonnegative(),
|
|
65
|
+
hitRate: z.number().min(0).max(1),
|
|
66
|
+
byBackend: z.record(
|
|
67
|
+
z.string(),
|
|
68
|
+
z.object({
|
|
69
|
+
hits: z.number().int().nonnegative(),
|
|
70
|
+
misses: z.number().int().nonnegative()
|
|
71
|
+
})
|
|
72
|
+
),
|
|
73
|
+
windowStartedAt: z.number().int()
|
|
74
|
+
});
|
|
75
|
+
OTLPKeyValueSchema = z.object({
|
|
76
|
+
key: z.string(),
|
|
77
|
+
value: z.object({
|
|
78
|
+
stringValue: z.string().optional(),
|
|
79
|
+
intValue: z.string().optional(),
|
|
80
|
+
doubleValue: z.number().optional(),
|
|
81
|
+
boolValue: z.boolean().optional()
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
OTLPSpanSchema = z.object({
|
|
85
|
+
traceId: z.string().length(32),
|
|
86
|
+
// 16-byte hex
|
|
87
|
+
spanId: z.string().length(16),
|
|
88
|
+
// 8-byte hex
|
|
89
|
+
parentSpanId: z.string().length(16).optional(),
|
|
90
|
+
name: z.string(),
|
|
91
|
+
kind: z.number().int(),
|
|
92
|
+
// SpanKind enum (1=INTERNAL, 2=SERVER, 3=CLIENT, 4=PRODUCER, 5=CONSUMER)
|
|
93
|
+
startTimeUnixNano: z.string(),
|
|
94
|
+
// decimal nanoseconds as string (int64 unsafe in JSON)
|
|
95
|
+
endTimeUnixNano: z.string(),
|
|
96
|
+
attributes: z.array(OTLPKeyValueSchema),
|
|
97
|
+
status: z.object({ code: z.number().int() }).optional()
|
|
98
|
+
});
|
|
99
|
+
TokenScopeSchema = z2.enum([
|
|
100
|
+
"admin",
|
|
101
|
+
"trigger-job",
|
|
102
|
+
"read-status",
|
|
103
|
+
"resolve-interaction",
|
|
104
|
+
"subscribe-webhook",
|
|
105
|
+
"modify-roadmap",
|
|
106
|
+
"read-telemetry",
|
|
107
|
+
"manage-proposals"
|
|
108
|
+
]);
|
|
109
|
+
BridgeKindSchema = z2.enum(["slack", "discord", "github-app", "custom"]);
|
|
110
|
+
AuthTokenSchema = z2.object({
|
|
111
|
+
id: z2.string().regex(/^tok_[a-f0-9]{16}$/),
|
|
112
|
+
name: z2.string().min(1).max(100),
|
|
113
|
+
scopes: z2.array(TokenScopeSchema).min(1),
|
|
114
|
+
bridgeKind: BridgeKindSchema.optional(),
|
|
115
|
+
tenantId: z2.string().optional(),
|
|
116
|
+
hashedSecret: z2.string().min(1),
|
|
117
|
+
createdAt: z2.string().datetime(),
|
|
118
|
+
lastUsedAt: z2.string().datetime().optional(),
|
|
119
|
+
expiresAt: z2.string().datetime().optional()
|
|
120
|
+
});
|
|
121
|
+
AuthTokenPublicSchema = AuthTokenSchema.omit({ hashedSecret: true });
|
|
122
|
+
AuthAuditEntrySchema = z2.object({
|
|
123
|
+
timestamp: z2.string().datetime(),
|
|
124
|
+
tokenId: z2.string(),
|
|
125
|
+
tenantId: z2.string().optional(),
|
|
126
|
+
route: z2.string(),
|
|
127
|
+
method: z2.string(),
|
|
128
|
+
status: z2.number().int()
|
|
129
|
+
});
|
|
130
|
+
WebhookSubscriptionSchema = z3.object({
|
|
131
|
+
id: z3.string().regex(/^whk_[a-f0-9]{16}$/),
|
|
132
|
+
tokenId: z3.string(),
|
|
133
|
+
// owning auth token (audit / revocation chain)
|
|
134
|
+
url: z3.string().url().startsWith("https://"),
|
|
135
|
+
// https-only at registration
|
|
136
|
+
events: z3.array(z3.string().min(1)).min(1),
|
|
137
|
+
// glob patterns: "maintenance.completed", "interaction.*"
|
|
138
|
+
secret: z3.string().min(32),
|
|
139
|
+
// 32-byte base64url (44 chars)
|
|
140
|
+
createdAt: z3.string().datetime()
|
|
141
|
+
});
|
|
142
|
+
WebhookSubscriptionPublicSchema = WebhookSubscriptionSchema.omit({ secret: true });
|
|
143
|
+
GatewayEventSchema = z3.object({
|
|
144
|
+
id: z3.string().regex(/^evt_[a-f0-9]+$/),
|
|
145
|
+
type: z3.string().min(1),
|
|
146
|
+
timestamp: z3.string().datetime(),
|
|
147
|
+
data: z3.unknown(),
|
|
148
|
+
correlationId: z3.string().optional()
|
|
149
|
+
});
|
|
150
|
+
WebhookDeliveryStatusSchema = z3.enum([
|
|
151
|
+
"pending",
|
|
152
|
+
"in_flight",
|
|
153
|
+
"failed",
|
|
154
|
+
"delivered",
|
|
155
|
+
"dead"
|
|
156
|
+
]);
|
|
157
|
+
WebhookDeliverySchema = z3.object({
|
|
158
|
+
id: z3.string().regex(/^dlv_[a-f0-9]{16}$/),
|
|
159
|
+
subscriptionId: z3.string(),
|
|
160
|
+
eventType: z3.string(),
|
|
161
|
+
payload: z3.string(),
|
|
162
|
+
attempt: z3.number().int().min(0).max(5),
|
|
163
|
+
status: WebhookDeliveryStatusSchema,
|
|
164
|
+
nextAttemptAt: z3.number().int().nullable(),
|
|
165
|
+
lastError: z3.string().nullable().optional(),
|
|
166
|
+
deliveredAt: z3.number().int().nullable().optional()
|
|
167
|
+
});
|
|
168
|
+
INDEXED_FILE_KINDS = [
|
|
169
|
+
"summary",
|
|
170
|
+
"learnings",
|
|
171
|
+
"failures",
|
|
172
|
+
"sections",
|
|
173
|
+
"llm_summary"
|
|
174
|
+
];
|
|
175
|
+
SessionSummarySchema = z4.object({
|
|
176
|
+
headline: z4.string().min(1).max(120),
|
|
177
|
+
keyOutcomes: z4.array(z4.string()).max(20),
|
|
178
|
+
openQuestions: z4.array(z4.string()).max(20),
|
|
179
|
+
relatedSessions: z4.array(z4.string()).default([])
|
|
180
|
+
});
|
|
181
|
+
INSIGHTS_KEYS = ["health", "entropy", "decay", "attention", "impact"];
|
|
182
|
+
SESSIONS_DEFAULTS = {
|
|
183
|
+
enabled: true,
|
|
184
|
+
summary: {
|
|
185
|
+
enabled: void 0,
|
|
186
|
+
inputBudgetTokens: 16e3,
|
|
187
|
+
timeoutMs: 6e4
|
|
188
|
+
},
|
|
189
|
+
search: {
|
|
190
|
+
indexedFileKinds: [...INDEXED_FILE_KINDS],
|
|
191
|
+
maxIndexBytesPerFile: 256 * 1024
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
NotificationSinkKindSchema = z5.enum(["slack"]);
|
|
195
|
+
NotificationSeveritySchema = z5.enum(["info", "success", "warning", "error"]);
|
|
196
|
+
NotificationActionSchema = z5.object({
|
|
197
|
+
label: z5.string().min(1).max(40),
|
|
198
|
+
url: z5.string().url()
|
|
199
|
+
});
|
|
200
|
+
NotificationEnvelopeSchema = z5.object({
|
|
201
|
+
title: z5.string().min(1).max(280),
|
|
202
|
+
summary: z5.string(),
|
|
203
|
+
severity: NotificationSeveritySchema,
|
|
204
|
+
actions: z5.array(NotificationActionSchema).max(5).optional(),
|
|
205
|
+
permalink: z5.string().url().optional(),
|
|
206
|
+
correlationId: z5.string().optional()
|
|
207
|
+
});
|
|
208
|
+
NotificationSinkConfigSchema = z5.object({
|
|
209
|
+
id: z5.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*$/, "must be lowercase kebab-case"),
|
|
210
|
+
kind: NotificationSinkKindSchema,
|
|
211
|
+
events: z5.array(z5.string().min(1)).min(1),
|
|
212
|
+
wrap_response: z5.boolean().default(false),
|
|
213
|
+
config: z5.record(z5.string(), z5.unknown()).default({})
|
|
214
|
+
});
|
|
215
|
+
NotificationsConfigSchema = z5.object({
|
|
216
|
+
sinks: z5.array(NotificationSinkConfigSchema).default([])
|
|
217
|
+
});
|
|
218
|
+
NotificationDeliveryResultSchema = z5.discriminatedUnion("ok", [
|
|
219
|
+
z5.object({
|
|
220
|
+
ok: z5.literal(true),
|
|
221
|
+
deliveredAt: z5.number().int()
|
|
222
|
+
}),
|
|
223
|
+
z5.object({
|
|
224
|
+
ok: z5.literal(false),
|
|
225
|
+
error: z5.string(),
|
|
226
|
+
httpStatus: z5.number().int().optional()
|
|
227
|
+
})
|
|
228
|
+
]);
|
|
229
|
+
SkillProvenanceSchema = z6.enum(["community", "agent-proposed", "user-authored"]);
|
|
230
|
+
ProposalKindSchema = z6.enum(["new-skill", "refinement"]);
|
|
231
|
+
ProposalStatusSchema = z6.enum([
|
|
232
|
+
"open",
|
|
233
|
+
"gate-running",
|
|
234
|
+
"gate-failed",
|
|
235
|
+
"approved",
|
|
236
|
+
"rejected"
|
|
237
|
+
]);
|
|
238
|
+
ProposalGateFindingSchema = z6.object({
|
|
239
|
+
severity: z6.enum(["error", "warning"]),
|
|
240
|
+
title: z6.string(),
|
|
241
|
+
detail: z6.string()
|
|
242
|
+
});
|
|
243
|
+
ProposalGateSchema = z6.object({
|
|
244
|
+
lastRunAt: z6.string().datetime().optional(),
|
|
245
|
+
findings: z6.array(ProposalGateFindingSchema).optional()
|
|
246
|
+
});
|
|
247
|
+
ProposalDecisionSchema = z6.object({
|
|
248
|
+
decidedAt: z6.string().datetime(),
|
|
249
|
+
decidedBy: z6.string(),
|
|
250
|
+
action: z6.enum(["approved", "rejected"]),
|
|
251
|
+
reason: z6.string().optional()
|
|
252
|
+
});
|
|
253
|
+
ProposalContentSchema = z6.object({
|
|
254
|
+
name: z6.string().regex(/^[a-z][a-z0-9-]*$/).max(64),
|
|
255
|
+
description: z6.string().min(20).max(280),
|
|
256
|
+
skillYaml: z6.string().optional(),
|
|
257
|
+
skillMd: z6.string().optional(),
|
|
258
|
+
diff: z6.string().optional()
|
|
259
|
+
}).strict();
|
|
260
|
+
ProposalSourceSchema = z6.object({
|
|
261
|
+
sessionId: z6.string().optional(),
|
|
262
|
+
taskId: z6.string().optional(),
|
|
263
|
+
justification: z6.string().min(20).max(2e3)
|
|
264
|
+
});
|
|
265
|
+
SkillProposalSchema = z6.object({
|
|
266
|
+
id: z6.string().min(1),
|
|
267
|
+
createdAt: z6.string().datetime(),
|
|
268
|
+
kind: ProposalKindSchema,
|
|
269
|
+
targetSkill: z6.string().optional(),
|
|
270
|
+
proposedBy: z6.string().min(1),
|
|
271
|
+
source: ProposalSourceSchema,
|
|
272
|
+
content: ProposalContentSchema,
|
|
273
|
+
status: ProposalStatusSchema,
|
|
274
|
+
gate: ProposalGateSchema.optional(),
|
|
275
|
+
decision: ProposalDecisionSchema.optional()
|
|
276
|
+
}).superRefine((val, ctx) => {
|
|
277
|
+
if (val.kind === "new-skill") {
|
|
278
|
+
if (!val.content.skillYaml || !val.content.skillMd) {
|
|
279
|
+
ctx.addIssue({
|
|
280
|
+
code: z6.ZodIssueCode.custom,
|
|
281
|
+
path: ["content"],
|
|
282
|
+
message: "new-skill proposals require skillYaml and skillMd"
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
if (val.targetSkill) {
|
|
286
|
+
ctx.addIssue({
|
|
287
|
+
code: z6.ZodIssueCode.custom,
|
|
288
|
+
path: ["targetSkill"],
|
|
289
|
+
message: "targetSkill is forbidden on new-skill proposals"
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
if (val.content.diff) {
|
|
293
|
+
ctx.addIssue({
|
|
294
|
+
code: z6.ZodIssueCode.custom,
|
|
295
|
+
path: ["content", "diff"],
|
|
296
|
+
message: "diff is forbidden on new-skill proposals"
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
} else if (val.kind === "refinement") {
|
|
300
|
+
if (!val.targetSkill) {
|
|
301
|
+
ctx.addIssue({
|
|
302
|
+
code: z6.ZodIssueCode.custom,
|
|
303
|
+
path: ["targetSkill"],
|
|
304
|
+
message: "refinement proposals require targetSkill"
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (!val.content.diff) {
|
|
308
|
+
ctx.addIssue({
|
|
309
|
+
code: z6.ZodIssueCode.custom,
|
|
310
|
+
path: ["content", "diff"],
|
|
311
|
+
message: "refinement proposals require a unified diff"
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
if (val.content.skillYaml || val.content.skillMd) {
|
|
315
|
+
ctx.addIssue({
|
|
316
|
+
code: z6.ZodIssueCode.custom,
|
|
317
|
+
path: ["content"],
|
|
318
|
+
message: "skillYaml/skillMd are forbidden on refinement proposals (use diff)"
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
EmitSkillProposalInputSchema = z6.object({
|
|
324
|
+
kind: ProposalKindSchema,
|
|
325
|
+
targetSkill: z6.string().optional(),
|
|
326
|
+
proposedBy: z6.string().min(1).max(120),
|
|
327
|
+
justification: z6.string().min(20).max(2e3),
|
|
328
|
+
sessionId: z6.string().optional(),
|
|
329
|
+
taskId: z6.string().optional(),
|
|
330
|
+
content: ProposalContentSchema
|
|
331
|
+
});
|
|
332
|
+
EditProposalInputSchema = z6.object({
|
|
333
|
+
content: ProposalContentSchema.partial()
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
export {
|
|
339
|
+
Ok,
|
|
340
|
+
Err,
|
|
341
|
+
isOk,
|
|
342
|
+
isErr,
|
|
343
|
+
STANDARD_COGNITIVE_MODES,
|
|
344
|
+
DEFAULT_SKILL_CONTEXT_BUDGET,
|
|
345
|
+
SESSION_SECTION_NAMES,
|
|
346
|
+
TrajectoryMetadataSchema,
|
|
347
|
+
PromptCacheStatsSchema,
|
|
348
|
+
OTLPKeyValueSchema,
|
|
349
|
+
OTLPSpanSchema,
|
|
350
|
+
TokenScopeSchema,
|
|
351
|
+
BridgeKindSchema,
|
|
352
|
+
AuthTokenSchema,
|
|
353
|
+
AuthTokenPublicSchema,
|
|
354
|
+
AuthAuditEntrySchema,
|
|
355
|
+
WebhookSubscriptionSchema,
|
|
356
|
+
WebhookSubscriptionPublicSchema,
|
|
357
|
+
GatewayEventSchema,
|
|
358
|
+
WebhookDeliveryStatusSchema,
|
|
359
|
+
WebhookDeliverySchema,
|
|
360
|
+
INDEXED_FILE_KINDS,
|
|
361
|
+
SessionSummarySchema,
|
|
362
|
+
INSIGHTS_KEYS,
|
|
363
|
+
SESSIONS_DEFAULTS,
|
|
364
|
+
NotificationSinkKindSchema,
|
|
365
|
+
NotificationSeveritySchema,
|
|
366
|
+
NotificationActionSchema,
|
|
367
|
+
NotificationEnvelopeSchema,
|
|
368
|
+
NotificationSinkConfigSchema,
|
|
369
|
+
NotificationsConfigSchema,
|
|
370
|
+
NotificationDeliveryResultSchema,
|
|
371
|
+
SkillProvenanceSchema,
|
|
372
|
+
ProposalKindSchema,
|
|
373
|
+
ProposalStatusSchema,
|
|
374
|
+
ProposalGateFindingSchema,
|
|
375
|
+
ProposalGateSchema,
|
|
376
|
+
ProposalDecisionSchema,
|
|
377
|
+
ProposalContentSchema,
|
|
378
|
+
ProposalSourceSchema,
|
|
379
|
+
SkillProposalSchema,
|
|
380
|
+
EmitSkillProposalInputSchema,
|
|
381
|
+
EditProposalInputSchema,
|
|
382
|
+
init_dist
|
|
383
|
+
};
|