@harness-engineering/cli 4.2.0 → 4.3.2

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.
Files changed (51) hide show
  1. package/dist/{agents-md-BK2UPKUC.js → agents-md-N4ULMUAK.js} +4 -4
  2. package/dist/{analyzer-XRCV63KC-6T2Z32XC.js → analyzer-XRCV63KC-WGRHW2ZM.js} +2 -2
  3. package/dist/{architecture-7PNQZOWV.js → architecture-OIMIBDJC.js} +5 -5
  4. package/dist/{assess-project-2QPCNN7N.js → assess-project-ITSB6W4L.js} +1 -1
  5. package/dist/bin/harness-mcp.js +15 -15
  6. package/dist/bin/harness.js +25 -25
  7. package/dist/{check-phase-gate-RZUSDB3O.js → check-phase-gate-GN4X7HT6.js} +5 -5
  8. package/dist/{chunk-ZIJABBGZ.js → chunk-574JCBYH.js} +2 -2
  9. package/dist/{chunk-E5KJOUHI.js → chunk-5BUHPOCP.js} +7 -7
  10. package/dist/{chunk-YTJIRQON.js → chunk-6NEJPS7W.js} +2 -2
  11. package/dist/{chunk-MHHISNS2.js → chunk-73QZ43DF.js} +2 -2
  12. package/dist/{chunk-RZTLXZHJ.js → chunk-7RH2NTLA.js} +1 -1
  13. package/dist/{chunk-DVG6DDX6.js → chunk-CMU4DNLY.js} +1 -1
  14. package/dist/{chunk-33OU3LYX.js → chunk-CRHQYBDA.js} +48 -12
  15. package/dist/{chunk-J7H5I4FO.js → chunk-D7A5JR7M.js} +2 -2
  16. package/dist/{chunk-K5R2I37T.js → chunk-F3GNBRGL.js} +87 -85
  17. package/dist/{chunk-SI4O2W4H.js → chunk-GTHL3TRZ.js} +2 -2
  18. package/dist/{chunk-J5MFNKE7.js → chunk-H5GN7R43.js} +2 -2
  19. package/dist/{chunk-D5YCPIK6.js → chunk-HJYAXAYQ.js} +2 -2
  20. package/dist/{chunk-DBCC7KIW.js → chunk-JZL2O3RC.js} +5 -5
  21. package/dist/{chunk-V2GJE5J5.js → chunk-LP764MGR.js} +3 -3
  22. package/dist/{chunk-6STDKKAM.js → chunk-LTYVAKWK.js} +2 -2
  23. package/dist/{chunk-KYFXXEK3.js → chunk-MEDRUIRO.js} +3 -3
  24. package/dist/{chunk-DW6HE5DH.js → chunk-MIZQY35D.js} +2 -2
  25. package/dist/{chunk-KHL6WFRL.js → chunk-NEMB36N4.js} +2 -2
  26. package/dist/{chunk-BJDT3VGQ.js → chunk-PT65VY4S.js} +6 -6
  27. package/dist/{chunk-HUC73DZC.js → chunk-T46G6YNI.js} +3 -3
  28. package/dist/{chunk-VC2B275U.js → chunk-TKPAOB2T.js} +2 -2
  29. package/dist/{chunk-HU7NS7JA.js → chunk-U2NOOATF.js} +6 -6
  30. package/dist/{chunk-UEXQMI6K.js → chunk-VJDSB7CI.js} +112 -50
  31. package/dist/{chunk-XACP5P2J.js → chunk-XKILFNRK.js} +2 -2
  32. package/dist/{chunk-RRCS27GT.js → chunk-YVI7ZV73.js} +284 -115
  33. package/dist/{ci-workflow-LGN7LHHO.js → ci-workflow-PA3WL6WK.js} +4 -4
  34. package/dist/{dist-LE5AU7FR.js → dist-BWFFVKEW.js} +20 -4
  35. package/dist/{dist-FBBADRYS.js → dist-ISDDHDOR.js} +17 -3
  36. package/dist/{docs-3BTPSHKE.js → docs-HOTWQJQF.js} +5 -5
  37. package/dist/{engine-GWGU4AMH.js → engine-MVG2SPGD.js} +4 -4
  38. package/dist/{entropy-35XURODP.js → entropy-3B4U2BTF.js} +5 -5
  39. package/dist/{feedback-NDGZZ37W.js → feedback-WIWWDVUC.js} +1 -1
  40. package/dist/{generate-agent-definitions-PYZ3E7SP.js → generate-agent-definitions-KPRHY6X3.js} +5 -5
  41. package/dist/index.js +25 -25
  42. package/dist/{loader-QK2OJXKB.js → loader-SPJ2ZGYW.js} +4 -4
  43. package/dist/{mcp-Z5YMV7TA.js → mcp-VSSIWTII.js} +15 -15
  44. package/dist/{performance-VAYOYPVK.js → performance-JYFS27B3.js} +5 -5
  45. package/dist/{review-pipeline-UETEOWSS.js → review-pipeline-BDT6Y6QV.js} +4 -4
  46. package/dist/{runtime-J7KFACTK.js → runtime-ZEPHPPQJ.js} +4 -4
  47. package/dist/{security-6AIUZXF5.js → security-FWSDTTEW.js} +1 -1
  48. package/dist/{state-events-XQPHGLG5.js → state-events-PBDNQPXT.js} +4 -4
  49. package/dist/{validate-ON7YMVLY.js → validate-XIMNCIKR.js} +5 -5
  50. package/dist/{validate-cross-check-HKKQA7K5.js → validate-cross-check-H2OUHTID.js} +4 -4
  51. package/package.json +8 -8
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  init_dist,
6
6
  paginate
7
- } from "./chunk-33OU3LYX.js";
7
+ } from "./chunk-CRHQYBDA.js";
8
8
 
9
9
  // src/mcp/tools/review-pipeline.ts
10
10
  init_dist();
@@ -84,7 +84,7 @@ var runCodeReviewDefinition = {
84
84
  };
85
85
  async function handleRunCodeReview(input) {
86
86
  try {
87
- const { parseDiff, runReviewPipeline } = await import("./dist-LE5AU7FR.js");
87
+ const { parseDiff, runReviewPipeline } = await import("./dist-BWFFVKEW.js");
88
88
  const parseResult = parseDiff(input.diff);
89
89
  if (!parseResult.ok) {
90
90
  return {
@@ -27,7 +27,7 @@ var runSecurityScanDefinition = {
27
27
  };
28
28
  async function handleRunSecurityScan(input) {
29
29
  try {
30
- const core = await import("./dist-LE5AU7FR.js");
30
+ const core = await import("./dist-BWFFVKEW.js");
31
31
  const projectRoot = sanitizePath(input.path);
32
32
  let configData = {};
33
33
  try {
@@ -114,7 +114,7 @@ var getSecurityTrendsDefinition = {
114
114
  };
115
115
  async function handleGetSecurityTrends(input) {
116
116
  try {
117
- const core = await import("./dist-LE5AU7FR.js");
117
+ const core = await import("./dist-BWFFVKEW.js");
118
118
  const projectRoot = sanitizePath(input.path);
119
119
  const manager = new core.SecurityTimelineManager(projectRoot);
120
120
  const trendOptions = {};
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  findConfigFile,
9
9
  loadConfig
10
- } from "./chunk-6STDKKAM.js";
10
+ } from "./chunk-LTYVAKWK.js";
11
11
  import {
12
12
  init_dist
13
- } from "./chunk-33OU3LYX.js";
13
+ } from "./chunk-CRHQYBDA.js";
14
14
  import {
15
15
  Ok
16
- } from "./chunk-UEXQMI6K.js";
16
+ } from "./chunk-VJDSB7CI.js";
17
17
 
18
18
  // src/mcp/tools/entropy.ts
19
19
  init_dist();
@@ -138,7 +138,7 @@ function buildSummaryResponse(report) {
138
138
  }
139
139
  async function handleDetectEntropy(input) {
140
140
  try {
141
- const { EntropyAnalyzer } = await import("./dist-LE5AU7FR.js");
141
+ const { EntropyAnalyzer } = await import("./dist-BWFFVKEW.js");
142
142
  const typeFilter = input.type ?? "all";
143
143
  const projectPath = sanitizePath(input.path);
144
144
  const entropy = loadEntropyConfig(projectPath);
@@ -164,7 +164,7 @@ async function handleDetectEntropy(input) {
164
164
  return resultToMcpResponse(result);
165
165
  }
166
166
  if (!result.ok) return resultToMcpResponse(result);
167
- const { createFixes, applyFixes, generateSuggestions } = await import("./dist-LE5AU7FR.js");
167
+ const { createFixes, applyFixes, generateSuggestions } = await import("./dist-BWFFVKEW.js");
168
168
  const report = result.value;
169
169
  const deadCode = report.deadCode;
170
170
  const fixTypesConfig = input.fixTypes ? { fixTypes: input.fixTypes } : void 0;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-Y6SUQC32.js";
4
4
  import {
5
5
  resolveConfig
6
- } from "./chunk-6STDKKAM.js";
6
+ } from "./chunk-LTYVAKWK.js";
7
7
  import {
8
8
  logger
9
9
  } from "./chunk-EBJQ6N4M.js";
@@ -12,10 +12,10 @@ import {
12
12
  } from "./chunk-3WGJMBKH.js";
13
13
  import {
14
14
  init_dist
15
- } from "./chunk-33OU3LYX.js";
15
+ } from "./chunk-CRHQYBDA.js";
16
16
  import {
17
17
  Ok
18
- } from "./chunk-UEXQMI6K.js";
18
+ } from "./chunk-VJDSB7CI.js";
19
19
 
20
20
  // src/commands/check-phase-gate.ts
21
21
  init_dist();
@@ -7,11 +7,11 @@ import {
7
7
  } from "./chunk-3WGJMBKH.js";
8
8
  import {
9
9
  init_dist as init_dist2
10
- } from "./chunk-33OU3LYX.js";
10
+ } from "./chunk-CRHQYBDA.js";
11
11
  import {
12
12
  Err,
13
13
  Ok
14
- } from "./chunk-UEXQMI6K.js";
14
+ } from "./chunk-VJDSB7CI.js";
15
15
  import {
16
16
  init_dist,
17
17
  skipDirGlobs
@@ -33,7 +33,7 @@ var createSelfReviewDefinition = {
33
33
  };
34
34
  async function handleCreateSelfReview(input) {
35
35
  try {
36
- const { parseDiff, createSelfReview } = await import("./dist-LE5AU7FR.js");
36
+ const { parseDiff, createSelfReview } = await import("./dist-BWFFVKEW.js");
37
37
  const parseResult = parseDiff(input.diff);
38
38
  if (!parseResult.ok) {
39
39
  return resultToMcpResponse(parseResult);
@@ -119,7 +119,7 @@ var analyzeDiffDefinition = {
119
119
  };
120
120
  async function handleAnalyzeDiff(input) {
121
121
  try {
122
- const { parseDiff, analyzeDiff } = await import("./dist-LE5AU7FR.js");
122
+ const { parseDiff, analyzeDiff } = await import("./dist-BWFFVKEW.js");
123
123
  const parseResult = parseDiff(input.diff);
124
124
  if (!parseResult.ok) {
125
125
  return resultToMcpResponse(parseResult);
@@ -195,7 +195,7 @@ var requestPeerReviewDefinition = {
195
195
  };
196
196
  async function handleRequestPeerReview(input) {
197
197
  try {
198
- const { parseDiff, requestPeerReview } = await import("./dist-LE5AU7FR.js");
198
+ const { parseDiff, requestPeerReview } = await import("./dist-BWFFVKEW.js");
199
199
  const parseResult = parseDiff(input.diff);
200
200
  if (!parseResult.ok) {
201
201
  return resultToMcpResponse(parseResult);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  init_dist
3
- } from "./chunk-33OU3LYX.js";
3
+ } from "./chunk-CRHQYBDA.js";
4
4
  import {
5
5
  Ok
6
- } from "./chunk-UEXQMI6K.js";
6
+ } from "./chunk-VJDSB7CI.js";
7
7
 
8
8
  // src/commands/validate-cross-check.ts
9
9
  init_dist();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  event_sourcing_exports,
3
3
  init_dist
4
- } from "./chunk-33OU3LYX.js";
4
+ } from "./chunk-CRHQYBDA.js";
5
5
  import {
6
6
  Ok
7
- } from "./chunk-UEXQMI6K.js";
7
+ } from "./chunk-VJDSB7CI.js";
8
8
 
9
9
  // src/shared/state-events.ts
10
10
  init_dist();
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  findConfigFile,
9
9
  loadConfig
10
- } from "./chunk-6STDKKAM.js";
10
+ } from "./chunk-LTYVAKWK.js";
11
11
  import {
12
12
  init_dist
13
- } from "./chunk-33OU3LYX.js";
13
+ } from "./chunk-CRHQYBDA.js";
14
14
  import {
15
15
  Ok
16
- } from "./chunk-UEXQMI6K.js";
16
+ } from "./chunk-VJDSB7CI.js";
17
17
 
18
18
  // src/mcp/tools/docs.ts
19
19
  init_dist();
@@ -50,12 +50,12 @@ async function handleCheckDocs(input) {
50
50
  const projectPath = sanitizePath(input.path);
51
51
  const scope = input.scope ?? "coverage";
52
52
  if (scope === "integrity") {
53
- const { validateKnowledgeMap } = await import("./dist-LE5AU7FR.js");
53
+ const { validateKnowledgeMap } = await import("./dist-BWFFVKEW.js");
54
54
  const result2 = await validateKnowledgeMap(projectPath);
55
55
  return resultToMcpResponse(result2);
56
56
  }
57
57
  if (scope === "all") {
58
- const { checkDocCoverage: checkDocCoverage2, validateKnowledgeMap } = await import("./dist-LE5AU7FR.js");
58
+ const { checkDocCoverage: checkDocCoverage2, validateKnowledgeMap } = await import("./dist-BWFFVKEW.js");
59
59
  const domain2 = input.domain ?? "src";
60
60
  const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-STFGYKZH.js");
61
61
  const store2 = await loadGraphStore2(projectPath);
@@ -94,7 +94,7 @@ async function handleCheckDocs(input) {
94
94
  }
95
95
  return resultToMcpResponse(Ok({ coverage, integrity }));
96
96
  }
97
- const { checkDocCoverage } = await import("./dist-LE5AU7FR.js");
97
+ const { checkDocCoverage } = await import("./dist-BWFFVKEW.js");
98
98
  const domain = input.domain ?? "src";
99
99
  const { loadGraphStore } = await import("./graph-loader-STFGYKZH.js");
100
100
  const store = await loadGraphStore(projectPath);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveProjectConfig
3
- } from "./chunk-XACP5P2J.js";
3
+ } from "./chunk-XKILFNRK.js";
4
4
  import {
5
5
  sanitizePath
6
6
  } from "./chunk-W6Y7ZW3Y.js";
@@ -49,7 +49,7 @@ async function handleValidateProject(input) {
49
49
  checks.config = "pass";
50
50
  const config = configResult.value;
51
51
  try {
52
- const core = await import("./dist-LE5AU7FR.js");
52
+ const core = await import("./dist-BWFFVKEW.js");
53
53
  if (typeof core.validateFileStructure === "function" && Array.isArray(config.conventions)) {
54
54
  const conventions = config.conventions;
55
55
  const structureResult = await core.validateFileStructure(projectPath, conventions);
@@ -68,7 +68,7 @@ async function handleValidateProject(input) {
68
68
  } catch {
69
69
  }
70
70
  try {
71
- const core = await import("./dist-LE5AU7FR.js");
71
+ const core = await import("./dist-BWFFVKEW.js");
72
72
  if (typeof core.validateAgentsMap === "function") {
73
73
  const agentsMapPath = path.join(projectPath, "AGENTS.md");
74
74
  const agentsResult = await core.validateAgentsMap(agentsMapPath);
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  init_dist
3
- } from "./chunk-33OU3LYX.js";
3
+ } from "./chunk-CRHQYBDA.js";
4
4
  import {
5
5
  Err,
6
6
  Ok
7
- } from "./chunk-UEXQMI6K.js";
7
+ } from "./chunk-VJDSB7CI.js";
8
8
 
9
9
  // src/persona/generators/agents-md.ts
10
10
  init_dist();
@@ -98,7 +98,7 @@ async function handleAssessProject(input) {
98
98
  let validateResult = null;
99
99
  if (checksToRun.has("validate")) {
100
100
  try {
101
- const { handleValidateProject } = await import("./validate-ON7YMVLY.js");
101
+ const { handleValidateProject } = await import("./validate-XIMNCIKR.js");
102
102
  const result = await handleValidateProject({ path: projectPath });
103
103
  const out = parseToolResponse(result, "validate");
104
104
  if ("error" in out) {
@@ -127,7 +127,7 @@ async function handleAssessProject(input) {
127
127
  parallelChecks.push(
128
128
  (async () => {
129
129
  try {
130
- const { handleCheckDependencies } = await import("./architecture-7PNQZOWV.js");
130
+ const { handleCheckDependencies } = await import("./architecture-OIMIBDJC.js");
131
131
  const result = await handleCheckDependencies({ path: projectPath });
132
132
  const out = parseToolResponse(result, "deps");
133
133
  if ("error" in out) return out.error;
@@ -155,7 +155,7 @@ async function handleAssessProject(input) {
155
155
  parallelChecks.push(
156
156
  (async () => {
157
157
  try {
158
- const { handleCheckDocs } = await import("./docs-3BTPSHKE.js");
158
+ const { handleCheckDocs } = await import("./docs-HOTWQJQF.js");
159
159
  const result = await handleCheckDocs({ path: projectPath, scope: "coverage" });
160
160
  const out = parseToolResponse(result, "docs");
161
161
  if ("error" in out) return out.error;
@@ -183,7 +183,7 @@ async function handleAssessProject(input) {
183
183
  parallelChecks.push(
184
184
  (async () => {
185
185
  try {
186
- const { handleDetectEntropy } = await import("./entropy-35XURODP.js");
186
+ const { handleDetectEntropy } = await import("./entropy-3B4U2BTF.js");
187
187
  const result = await handleDetectEntropy({ path: projectPath, type: "all" });
188
188
  const out = parseToolResponse(result, "entropy");
189
189
  if ("error" in out) return out.error;
@@ -214,7 +214,7 @@ async function handleAssessProject(input) {
214
214
  parallelChecks.push(
215
215
  (async () => {
216
216
  try {
217
- const { handleRunSecurityScan } = await import("./security-6AIUZXF5.js");
217
+ const { handleRunSecurityScan } = await import("./security-FWSDTTEW.js");
218
218
  const result = await handleRunSecurityScan({ path: projectPath });
219
219
  const out = parseToolResponse(result, "security");
220
220
  if ("error" in out) return out.error;
@@ -247,7 +247,7 @@ async function handleAssessProject(input) {
247
247
  parallelChecks.push(
248
248
  (async () => {
249
249
  try {
250
- const { handleCheckPerformance } = await import("./performance-VAYOYPVK.js");
250
+ const { handleCheckPerformance } = await import("./performance-JYFS27B3.js");
251
251
  const result = await handleCheckPerformance({ path: projectPath });
252
252
  if ("isError" in result && result.isError) {
253
253
  const msg = result.content[0]?.text ?? "Performance check failed";
@@ -22,7 +22,58 @@ function isOk(result) {
22
22
  function isErr(result) {
23
23
  return result.ok === false;
24
24
  }
25
- var STANDARD_COGNITIVE_MODES, DEFAULT_SKILL_CONTEXT_BUDGET, SESSION_SECTION_NAMES, TrajectoryMetadataSchema, PromptCacheStatsSchema, OTLPKeyValueSchema, OTLPSpanSchema, REQUIRED_STRATEGY_SECTIONS, OPTIONAL_STRATEGY_SECTIONS, 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, PlanTaskSchema, SkillProvenanceSchema, ProposalKindSchema, ProposalStatusSchema, ProposalGateFindingSchema, ProposalGateSchema, ProposalDecisionSchema, ProposalContentSchema, ProposalSourceSchema, SkillProposalSchema, EmitSkillProposalInputSchema, EditProposalInputSchema;
25
+ function skillProposalRefine(val, ctx) {
26
+ if (val.skillKind === "new-skill") {
27
+ if (!val.content.skillYaml || !val.content.skillMd)
28
+ ctx.addIssue({
29
+ code: z7.ZodIssueCode.custom,
30
+ path: ["content"],
31
+ message: "new-skill proposals require skillYaml and skillMd"
32
+ });
33
+ if (val.targetSkill)
34
+ ctx.addIssue({
35
+ code: z7.ZodIssueCode.custom,
36
+ path: ["targetSkill"],
37
+ message: "targetSkill is forbidden on new-skill proposals"
38
+ });
39
+ if (val.content.diff)
40
+ ctx.addIssue({
41
+ code: z7.ZodIssueCode.custom,
42
+ path: ["content", "diff"],
43
+ message: "diff is forbidden on new-skill proposals"
44
+ });
45
+ } else {
46
+ if (!val.targetSkill)
47
+ ctx.addIssue({
48
+ code: z7.ZodIssueCode.custom,
49
+ path: ["targetSkill"],
50
+ message: "refinement proposals require targetSkill"
51
+ });
52
+ if (!val.content.diff)
53
+ ctx.addIssue({
54
+ code: z7.ZodIssueCode.custom,
55
+ path: ["content", "diff"],
56
+ message: "refinement proposals require a unified diff"
57
+ });
58
+ if (val.content.skillYaml || val.content.skillMd)
59
+ ctx.addIssue({
60
+ code: z7.ZodIssueCode.custom,
61
+ path: ["content"],
62
+ message: "skillYaml/skillMd are forbidden on refinement proposals (use diff)"
63
+ });
64
+ }
65
+ }
66
+ function migrateProposalRecord(raw) {
67
+ if (raw && typeof raw === "object" && !Array.isArray(raw)) {
68
+ const r = raw;
69
+ if (r["kind"] === "new-skill" || r["kind"] === "refinement") {
70
+ const { kind, ...rest } = r;
71
+ return { ...rest, kind: "skill", skillKind: kind };
72
+ }
73
+ }
74
+ return raw;
75
+ }
76
+ var STANDARD_COGNITIVE_MODES, DEFAULT_SKILL_CONTEXT_BUDGET, SESSION_SECTION_NAMES, TrajectoryMetadataSchema, PromptCacheStatsSchema, OTLPKeyValueSchema, OTLPSpanSchema, REQUIRED_STRATEGY_SECTIONS, OPTIONAL_STRATEGY_SECTIONS, 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, PlanTaskSchema, SkillProvenanceSchema, SkillKindSchema, ProposalKindSchema, ProposalTypeSchema, ProposalStatusSchema, ProposalGateFindingSchema, ProposalGateSchema, ProposalDecisionSchema, ProposalContentSchema, ProposalSourceSchema, SkillProposalObject, ModelProposalActionSchema, ModelProposalStatusSchema, ModelProposalContentSchema, ModelProposalObject, ProposalObjectUnion, ProposalSchema, SkillProposalSchema, EmitSkillProposalInputSchema, EditProposalInputSchema;
26
77
  var init_dist = __esm({
27
78
  "../types/dist/index.mjs"() {
28
79
  STANDARD_COGNITIVE_MODES = [
@@ -246,7 +297,9 @@ var init_dist = __esm({
246
297
  owns: z6.array(z6.string()).optional()
247
298
  }).strict();
248
299
  SkillProvenanceSchema = z7.enum(["community", "agent-proposed", "user-authored"]);
249
- ProposalKindSchema = z7.enum(["new-skill", "refinement"]);
300
+ SkillKindSchema = z7.enum(["new-skill", "refinement"]);
301
+ ProposalKindSchema = SkillKindSchema;
302
+ ProposalTypeSchema = z7.enum(["skill", "model"]);
250
303
  ProposalStatusSchema = z7.enum([
251
304
  "open",
252
305
  "gate-running",
@@ -281,10 +334,11 @@ var init_dist = __esm({
281
334
  taskId: z7.string().optional(),
282
335
  justification: z7.string().min(20).max(2e3)
283
336
  });
284
- SkillProposalSchema = z7.object({
337
+ SkillProposalObject = z7.object({
338
+ kind: z7.literal("skill"),
339
+ skillKind: SkillKindSchema,
285
340
  id: z7.string().min(1),
286
341
  createdAt: z7.string().datetime(),
287
- kind: ProposalKindSchema,
288
342
  targetSkill: z7.string().optional(),
289
343
  proposedBy: z7.string().min(1),
290
344
  source: ProposalSourceSchema,
@@ -292,53 +346,54 @@ var init_dist = __esm({
292
346
  status: ProposalStatusSchema,
293
347
  gate: ProposalGateSchema.optional(),
294
348
  decision: ProposalDecisionSchema.optional()
295
- }).superRefine((val, ctx) => {
296
- if (val.kind === "new-skill") {
297
- if (!val.content.skillYaml || !val.content.skillMd) {
298
- ctx.addIssue({
299
- code: z7.ZodIssueCode.custom,
300
- path: ["content"],
301
- message: "new-skill proposals require skillYaml and skillMd"
302
- });
303
- }
304
- if (val.targetSkill) {
305
- ctx.addIssue({
306
- code: z7.ZodIssueCode.custom,
307
- path: ["targetSkill"],
308
- message: "targetSkill is forbidden on new-skill proposals"
309
- });
310
- }
311
- if (val.content.diff) {
312
- ctx.addIssue({
313
- code: z7.ZodIssueCode.custom,
314
- path: ["content", "diff"],
315
- message: "diff is forbidden on new-skill proposals"
316
- });
317
- }
318
- } else if (val.kind === "refinement") {
319
- if (!val.targetSkill) {
320
- ctx.addIssue({
321
- code: z7.ZodIssueCode.custom,
322
- path: ["targetSkill"],
323
- message: "refinement proposals require targetSkill"
324
- });
325
- }
326
- if (!val.content.diff) {
327
- ctx.addIssue({
328
- code: z7.ZodIssueCode.custom,
329
- path: ["content", "diff"],
330
- message: "refinement proposals require a unified diff"
331
- });
332
- }
333
- if (val.content.skillYaml || val.content.skillMd) {
334
- ctx.addIssue({
335
- code: z7.ZodIssueCode.custom,
336
- path: ["content"],
337
- message: "skillYaml/skillMd are forbidden on refinement proposals (use diff)"
338
- });
339
- }
340
- }
341
349
  });
350
+ ModelProposalActionSchema = z7.enum(["add", "swap", "evict"]);
351
+ ModelProposalStatusSchema = z7.enum([
352
+ "open",
353
+ "gate-running",
354
+ "gate-failed",
355
+ "approved",
356
+ "rejected",
357
+ "failed_target_missing"
358
+ ]);
359
+ ModelProposalContentSchema = z7.object({
360
+ action: ModelProposalActionSchema,
361
+ target: z7.object({ hfRepoId: z7.string().min(1), ollamaName: z7.string().min(1) }),
362
+ replaces: z7.object({ ollamaName: z7.string().min(1) }).optional(),
363
+ scoreDelta: z7.number(),
364
+ justification: z7.object({
365
+ summary: z7.string(),
366
+ benchmarkBasis: z7.array(z7.string()),
367
+ hardwareFit: z7.string(),
368
+ evidence: z7.string(),
369
+ freshness: z7.string()
370
+ }),
371
+ diskImpactGb: z7.number()
372
+ }).strict();
373
+ ModelProposalObject = z7.object({
374
+ kind: z7.literal("model"),
375
+ id: z7.string().min(1),
376
+ createdAt: z7.string().datetime(),
377
+ proposedBy: z7.string().min(1),
378
+ source: ProposalSourceSchema,
379
+ model: ModelProposalContentSchema,
380
+ status: ModelProposalStatusSchema,
381
+ decision: ProposalDecisionSchema.optional()
382
+ });
383
+ ProposalObjectUnion = z7.discriminatedUnion("kind", [
384
+ SkillProposalObject,
385
+ ModelProposalObject
386
+ ]);
387
+ ProposalSchema = z7.preprocess(
388
+ migrateProposalRecord,
389
+ ProposalObjectUnion.superRefine((val, ctx) => {
390
+ if (val.kind === "skill") skillProposalRefine(val, ctx);
391
+ })
392
+ );
393
+ SkillProposalSchema = z7.preprocess(
394
+ migrateProposalRecord,
395
+ SkillProposalObject.superRefine(skillProposalRefine)
396
+ );
342
397
  EmitSkillProposalInputSchema = z7.object({
343
398
  kind: ProposalKindSchema,
344
399
  targetSkill: z7.string().optional(),
@@ -391,13 +446,20 @@ export {
391
446
  NotificationDeliveryResultSchema,
392
447
  PlanTaskSchema,
393
448
  SkillProvenanceSchema,
449
+ SkillKindSchema,
394
450
  ProposalKindSchema,
451
+ ProposalTypeSchema,
395
452
  ProposalStatusSchema,
396
453
  ProposalGateFindingSchema,
397
454
  ProposalGateSchema,
398
455
  ProposalDecisionSchema,
399
456
  ProposalContentSchema,
400
457
  ProposalSourceSchema,
458
+ ModelProposalActionSchema,
459
+ ModelProposalStatusSchema,
460
+ ModelProposalContentSchema,
461
+ migrateProposalRecord,
462
+ ProposalSchema,
401
463
  SkillProposalSchema,
402
464
  EmitSkillProposalInputSchema,
403
465
  EditProposalInputSchema,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  init_dist
3
- } from "./chunk-33OU3LYX.js";
3
+ } from "./chunk-CRHQYBDA.js";
4
4
  import {
5
5
  Err,
6
6
  Ok
7
- } from "./chunk-UEXQMI6K.js";
7
+ } from "./chunk-VJDSB7CI.js";
8
8
 
9
9
  // src/mcp/utils/config-resolver.ts
10
10
  init_dist();