harness-engineering-agent 0.3.27 → 0.3.29

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 (121) hide show
  1. package/README.md +3 -0
  2. package/dist/controller/agent-output-contracts.d.ts +16 -0
  3. package/dist/controller/agent-output-contracts.d.ts.map +1 -1
  4. package/dist/controller/agent-output.d.ts.map +1 -1
  5. package/dist/controller/agent-output.js +48 -1
  6. package/dist/controller/agent-output.js.map +1 -1
  7. package/dist/controller/agent-session.d.ts +2 -0
  8. package/dist/controller/agent-session.d.ts.map +1 -1
  9. package/dist/controller/agent-session.js +1 -0
  10. package/dist/controller/agent-session.js.map +1 -1
  11. package/dist/controller/contracts.d.ts +7 -0
  12. package/dist/controller/contracts.d.ts.map +1 -1
  13. package/dist/controller/contracts.js.map +1 -1
  14. package/dist/controller/failure-classification.d.ts +5 -0
  15. package/dist/controller/failure-classification.d.ts.map +1 -0
  16. package/dist/controller/failure-classification.js +6 -0
  17. package/dist/controller/failure-classification.js.map +1 -0
  18. package/dist/controller/index.d.ts +5 -0
  19. package/dist/controller/index.d.ts.map +1 -1
  20. package/dist/controller/index.js +5 -0
  21. package/dist/controller/index.js.map +1 -1
  22. package/dist/controller/planner-context-contract.d.ts +12 -0
  23. package/dist/controller/planner-context-contract.d.ts.map +1 -1
  24. package/dist/controller/route-resolver.d.ts.map +1 -1
  25. package/dist/controller/route-resolver.js +19 -8
  26. package/dist/controller/route-resolver.js.map +1 -1
  27. package/dist/controller/run-controller.d.ts.map +1 -1
  28. package/dist/controller/run-controller.js +110 -9
  29. package/dist/controller/run-controller.js.map +1 -1
  30. package/dist/controller/run-error-finalizer.d.ts +15 -0
  31. package/dist/controller/run-error-finalizer.d.ts.map +1 -1
  32. package/dist/controller/run-error-finalizer.js +103 -4
  33. package/dist/controller/run-error-finalizer.js.map +1 -1
  34. package/dist/controller/run-lease.d.ts +26 -0
  35. package/dist/controller/run-lease.d.ts.map +1 -0
  36. package/dist/controller/run-lease.js +63 -0
  37. package/dist/controller/run-lease.js.map +1 -0
  38. package/dist/controller/run-persistence.d.ts +1 -1
  39. package/dist/controller/run-persistence.d.ts.map +1 -1
  40. package/dist/controller/run-persistence.js +14 -12
  41. package/dist/controller/run-persistence.js.map +1 -1
  42. package/dist/controller/run-stage-projection.d.ts +64 -0
  43. package/dist/controller/run-stage-projection.d.ts.map +1 -0
  44. package/dist/controller/run-stage-projection.js +184 -0
  45. package/dist/controller/run-stage-projection.js.map +1 -0
  46. package/dist/controller/run-watchdog.d.ts +36 -0
  47. package/dist/controller/run-watchdog.d.ts.map +1 -0
  48. package/dist/controller/run-watchdog.js +124 -0
  49. package/dist/controller/run-watchdog.js.map +1 -0
  50. package/dist/controller/task-agent-schemas.d.ts +20 -0
  51. package/dist/controller/task-agent-schemas.d.ts.map +1 -1
  52. package/dist/controller/task-executor.d.ts.map +1 -1
  53. package/dist/controller/task-executor.js +22 -0
  54. package/dist/controller/task-executor.js.map +1 -1
  55. package/dist/controller/task-graph-contract.d.ts +1 -0
  56. package/dist/controller/task-graph-contract.d.ts.map +1 -1
  57. package/dist/controller/task-graph-contract.js +1 -0
  58. package/dist/controller/task-graph-contract.js.map +1 -1
  59. package/dist/domain/context-package.d.ts +4 -0
  60. package/dist/domain/context-package.d.ts.map +1 -1
  61. package/dist/domain/context-package.js +8 -0
  62. package/dist/domain/context-package.js.map +1 -1
  63. package/dist/domain/failure.d.ts +100 -0
  64. package/dist/domain/failure.d.ts.map +1 -1
  65. package/dist/domain/failure.js +9 -0
  66. package/dist/domain/failure.js.map +1 -1
  67. package/dist/domain/index.d.ts +1 -1
  68. package/dist/domain/index.d.ts.map +1 -1
  69. package/dist/domain/index.js +1 -1
  70. package/dist/domain/index.js.map +1 -1
  71. package/dist/domain/plan-artifacts.d.ts +8 -0
  72. package/dist/domain/plan-artifacts.d.ts.map +1 -1
  73. package/dist/domain/report.d.ts +232 -0
  74. package/dist/domain/report.d.ts.map +1 -1
  75. package/dist/domain/requirement.d.ts +17 -0
  76. package/dist/domain/requirement.d.ts.map +1 -1
  77. package/dist/domain/requirement.js +10 -0
  78. package/dist/domain/requirement.js.map +1 -1
  79. package/dist/domain/run.d.ts +232 -0
  80. package/dist/domain/run.d.ts.map +1 -1
  81. package/dist/plugin/create-harness-plugin.d.ts.map +1 -1
  82. package/dist/plugin/create-harness-plugin.js +35 -6
  83. package/dist/plugin/create-harness-plugin.js.map +1 -1
  84. package/dist/plugin/harness-chat-hook.d.ts +2 -1
  85. package/dist/plugin/harness-chat-hook.d.ts.map +1 -1
  86. package/dist/plugin/harness-chat-hook.js +15 -16
  87. package/dist/plugin/harness-chat-hook.js.map +1 -1
  88. package/dist/plugin/harness-delivery-envelope.d.ts +19 -0
  89. package/dist/plugin/harness-delivery-envelope.d.ts.map +1 -0
  90. package/dist/plugin/harness-delivery-envelope.js +105 -0
  91. package/dist/plugin/harness-delivery-envelope.js.map +1 -0
  92. package/dist/plugin/harness-escalate-tool.d.ts +2 -1
  93. package/dist/plugin/harness-escalate-tool.d.ts.map +1 -1
  94. package/dist/plugin/harness-escalate-tool.js +11 -2
  95. package/dist/plugin/harness-escalate-tool.js.map +1 -1
  96. package/dist/plugin/harness-intent.d.ts +12 -0
  97. package/dist/plugin/harness-intent.d.ts.map +1 -1
  98. package/dist/plugin/harness-intent.js +2 -1
  99. package/dist/plugin/harness-intent.js.map +1 -1
  100. package/dist/plugin/harness-plugin-runtime.d.ts +2 -0
  101. package/dist/plugin/harness-plugin-runtime.d.ts.map +1 -1
  102. package/dist/plugin/harness-plugin-runtime.js +40 -7
  103. package/dist/plugin/harness-plugin-runtime.js.map +1 -1
  104. package/dist/plugin/harness-plugin-scheduler.d.ts +7 -2
  105. package/dist/plugin/harness-plugin-scheduler.d.ts.map +1 -1
  106. package/dist/plugin/harness-plugin-scheduler.js +16 -14
  107. package/dist/plugin/harness-plugin-scheduler.js.map +1 -1
  108. package/dist/plugin/harness-requirement.d.ts.map +1 -1
  109. package/dist/plugin/harness-requirement.js +4 -0
  110. package/dist/plugin/harness-requirement.js.map +1 -1
  111. package/dist/plugin/harness-run-status-tool.d.ts +7 -0
  112. package/dist/plugin/harness-run-status-tool.d.ts.map +1 -0
  113. package/dist/plugin/harness-run-status-tool.js +33 -0
  114. package/dist/plugin/harness-run-status-tool.js.map +1 -0
  115. package/dist/store/filesystem-run-store.js +5 -0
  116. package/dist/store/filesystem-run-store.js.map +1 -1
  117. package/dist/store/pending-start.d.ts +4 -0
  118. package/dist/store/pending-start.d.ts.map +1 -1
  119. package/dist/store/run-event.d.ts +232 -0
  120. package/dist/store/run-event.d.ts.map +1 -1
  121. package/package.json +1 -1
@@ -281,6 +281,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
281
281
  routingRationale: z.ZodString;
282
282
  rejudgementTriggers: z.ZodReadonly<z.ZodArray<z.ZodString>>;
283
283
  }, z.core.$strict>>>;
284
+ hypotheses: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
285
+ claim: z.ZodString;
286
+ evidence: z.ZodOptional<z.ZodString>;
287
+ }, z.core.$strict>>>>;
284
288
  repositoryId: z.ZodOptional<z.ZodString>;
285
289
  targetRepository: z.ZodOptional<z.ZodString>;
286
290
  workspaceMutation: z.ZodOptional<z.ZodEnum<{
@@ -369,6 +373,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
369
373
  confidence: z.ZodNumber;
370
374
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
371
375
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
376
+ errorCode: z.ZodOptional<z.ZodString>;
377
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
378
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
379
+ resumable: z.ZodBoolean;
380
+ action: z.ZodEnum<{
381
+ resume: "resume";
382
+ manual: "manual";
383
+ }>;
384
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
385
+ }, z.core.$strip>>;
372
386
  category: z.ZodLiteral<"planner-contract">;
373
387
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
374
388
  schemaVersion: z.ZodLiteral<"1.0.0">;
@@ -381,6 +395,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
381
395
  confidence: z.ZodNumber;
382
396
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
383
397
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
398
+ errorCode: z.ZodOptional<z.ZodString>;
399
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
400
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
401
+ resumable: z.ZodBoolean;
402
+ action: z.ZodEnum<{
403
+ resume: "resume";
404
+ manual: "manual";
405
+ }>;
406
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
407
+ }, z.core.$strip>>;
384
408
  category: z.ZodLiteral<"context-gap">;
385
409
  missingContext: z.ZodReadonly<z.ZodArray<z.ZodString>>;
386
410
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -394,6 +418,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
394
418
  confidence: z.ZodNumber;
395
419
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
396
420
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
421
+ errorCode: z.ZodOptional<z.ZodString>;
422
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
423
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
424
+ resumable: z.ZodBoolean;
425
+ action: z.ZodEnum<{
426
+ resume: "resume";
427
+ manual: "manual";
428
+ }>;
429
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
430
+ }, z.core.$strip>>;
397
431
  category: z.ZodLiteral<"requirement-ambiguity">;
398
432
  blockingQuestionId: z.ZodString;
399
433
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -407,6 +441,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
407
441
  confidence: z.ZodNumber;
408
442
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
409
443
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
444
+ errorCode: z.ZodOptional<z.ZodString>;
445
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
446
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
447
+ resumable: z.ZodBoolean;
448
+ action: z.ZodEnum<{
449
+ resume: "resume";
450
+ manual: "manual";
451
+ }>;
452
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
453
+ }, z.core.$strip>>;
410
454
  category: z.ZodLiteral<"dependency-blocked">;
411
455
  blockedDependency: z.ZodString;
412
456
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -420,6 +464,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
420
464
  confidence: z.ZodNumber;
421
465
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
422
466
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
467
+ errorCode: z.ZodOptional<z.ZodString>;
468
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
469
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
470
+ resumable: z.ZodBoolean;
471
+ action: z.ZodEnum<{
472
+ resume: "resume";
473
+ manual: "manual";
474
+ }>;
475
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
476
+ }, z.core.$strip>>;
423
477
  category: z.ZodLiteral<"implementation-defect">;
424
478
  failingEvidenceId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "EvidenceId">>;
425
479
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -433,6 +487,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
433
487
  confidence: z.ZodNumber;
434
488
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
435
489
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
490
+ errorCode: z.ZodOptional<z.ZodString>;
491
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
492
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
493
+ resumable: z.ZodBoolean;
494
+ action: z.ZodEnum<{
495
+ resume: "resume";
496
+ manual: "manual";
497
+ }>;
498
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
499
+ }, z.core.$strip>>;
436
500
  category: z.ZodLiteral<"verification-environment">;
437
501
  verificationCommandName: z.ZodString;
438
502
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -446,6 +510,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
446
510
  confidence: z.ZodNumber;
447
511
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
448
512
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
513
+ errorCode: z.ZodOptional<z.ZodString>;
514
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
515
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
516
+ resumable: z.ZodBoolean;
517
+ action: z.ZodEnum<{
518
+ resume: "resume";
519
+ manual: "manual";
520
+ }>;
521
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
522
+ }, z.core.$strip>>;
449
523
  category: z.ZodLiteral<"scope-drift">;
450
524
  driftedPaths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
451
525
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -459,6 +533,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
459
533
  confidence: z.ZodNumber;
460
534
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
461
535
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
536
+ errorCode: z.ZodOptional<z.ZodString>;
537
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
538
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
539
+ resumable: z.ZodBoolean;
540
+ action: z.ZodEnum<{
541
+ resume: "resume";
542
+ manual: "manual";
543
+ }>;
544
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
545
+ }, z.core.$strip>>;
462
546
  category: z.ZodLiteral<"merge-conflict">;
463
547
  conflictingPaths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
464
548
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -472,6 +556,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
472
556
  confidence: z.ZodNumber;
473
557
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
474
558
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
559
+ errorCode: z.ZodOptional<z.ZodString>;
560
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
561
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
562
+ resumable: z.ZodBoolean;
563
+ action: z.ZodEnum<{
564
+ resume: "resume";
565
+ manual: "manual";
566
+ }>;
567
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
568
+ }, z.core.$strip>>;
475
569
  category: z.ZodLiteral<"model-failure">;
476
570
  provider: z.ZodString;
477
571
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -485,6 +579,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
485
579
  confidence: z.ZodNumber;
486
580
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
487
581
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
582
+ errorCode: z.ZodOptional<z.ZodString>;
583
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
584
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
585
+ resumable: z.ZodBoolean;
586
+ action: z.ZodEnum<{
587
+ resume: "resume";
588
+ manual: "manual";
589
+ }>;
590
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
591
+ }, z.core.$strip>>;
488
592
  category: z.ZodLiteral<"acceptance-failure">;
489
593
  failingEvidenceId: z.core.$ZodBranded<z.ZodString, "EvidenceId">;
490
594
  }, z.core.$strip>>]>>>>;
@@ -686,6 +790,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
686
790
  question: z.ZodString;
687
791
  impact: z.ZodString;
688
792
  }, z.core.$strip>>>>;
793
+ refutations: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
794
+ claim: z.ZodString;
795
+ evidenceSummary: z.ZodString;
796
+ }, z.core.$strip>>>>;
689
797
  constraints: z.ZodReadonly<z.ZodArray<z.ZodString>>;
690
798
  }, z.core.$strip>>>;
691
799
  contextSnapshot: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
@@ -806,6 +914,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
806
914
  routingRationale: z.ZodString;
807
915
  rejudgementTriggers: z.ZodReadonly<z.ZodArray<z.ZodString>>;
808
916
  }, z.core.$strict>>>;
917
+ hypotheses: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
918
+ claim: z.ZodString;
919
+ evidence: z.ZodOptional<z.ZodString>;
920
+ }, z.core.$strict>>>>;
809
921
  repositoryId: z.ZodOptional<z.ZodString>;
810
922
  targetRepository: z.ZodOptional<z.ZodString>;
811
923
  workspaceMutation: z.ZodOptional<z.ZodEnum<{
@@ -946,6 +1058,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
946
1058
  question: z.ZodString;
947
1059
  impact: z.ZodString;
948
1060
  }, z.core.$strip>>>>;
1061
+ refutations: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1062
+ claim: z.ZodString;
1063
+ evidenceSummary: z.ZodString;
1064
+ }, z.core.$strip>>>>;
949
1065
  constraints: z.ZodReadonly<z.ZodArray<z.ZodString>>;
950
1066
  }, z.core.$strip>>;
951
1067
  coverage: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -1214,6 +1330,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1214
1330
  routingRationale: z.ZodString;
1215
1331
  rejudgementTriggers: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1216
1332
  }, z.core.$strict>>>;
1333
+ hypotheses: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1334
+ claim: z.ZodString;
1335
+ evidence: z.ZodOptional<z.ZodString>;
1336
+ }, z.core.$strict>>>>;
1217
1337
  repositoryId: z.ZodOptional<z.ZodString>;
1218
1338
  targetRepository: z.ZodOptional<z.ZodString>;
1219
1339
  workspaceMutation: z.ZodOptional<z.ZodEnum<{
@@ -1302,6 +1422,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1302
1422
  confidence: z.ZodNumber;
1303
1423
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1304
1424
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1425
+ errorCode: z.ZodOptional<z.ZodString>;
1426
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1427
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1428
+ resumable: z.ZodBoolean;
1429
+ action: z.ZodEnum<{
1430
+ resume: "resume";
1431
+ manual: "manual";
1432
+ }>;
1433
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1434
+ }, z.core.$strip>>;
1305
1435
  category: z.ZodLiteral<"planner-contract">;
1306
1436
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
1307
1437
  schemaVersion: z.ZodLiteral<"1.0.0">;
@@ -1314,6 +1444,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1314
1444
  confidence: z.ZodNumber;
1315
1445
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1316
1446
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1447
+ errorCode: z.ZodOptional<z.ZodString>;
1448
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1449
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1450
+ resumable: z.ZodBoolean;
1451
+ action: z.ZodEnum<{
1452
+ resume: "resume";
1453
+ manual: "manual";
1454
+ }>;
1455
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1456
+ }, z.core.$strip>>;
1317
1457
  category: z.ZodLiteral<"context-gap">;
1318
1458
  missingContext: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1319
1459
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1327,6 +1467,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1327
1467
  confidence: z.ZodNumber;
1328
1468
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1329
1469
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1470
+ errorCode: z.ZodOptional<z.ZodString>;
1471
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1472
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1473
+ resumable: z.ZodBoolean;
1474
+ action: z.ZodEnum<{
1475
+ resume: "resume";
1476
+ manual: "manual";
1477
+ }>;
1478
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1479
+ }, z.core.$strip>>;
1330
1480
  category: z.ZodLiteral<"requirement-ambiguity">;
1331
1481
  blockingQuestionId: z.ZodString;
1332
1482
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1340,6 +1490,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1340
1490
  confidence: z.ZodNumber;
1341
1491
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1342
1492
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1493
+ errorCode: z.ZodOptional<z.ZodString>;
1494
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1495
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1496
+ resumable: z.ZodBoolean;
1497
+ action: z.ZodEnum<{
1498
+ resume: "resume";
1499
+ manual: "manual";
1500
+ }>;
1501
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1502
+ }, z.core.$strip>>;
1343
1503
  category: z.ZodLiteral<"dependency-blocked">;
1344
1504
  blockedDependency: z.ZodString;
1345
1505
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1353,6 +1513,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1353
1513
  confidence: z.ZodNumber;
1354
1514
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1355
1515
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1516
+ errorCode: z.ZodOptional<z.ZodString>;
1517
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1518
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1519
+ resumable: z.ZodBoolean;
1520
+ action: z.ZodEnum<{
1521
+ resume: "resume";
1522
+ manual: "manual";
1523
+ }>;
1524
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1525
+ }, z.core.$strip>>;
1356
1526
  category: z.ZodLiteral<"implementation-defect">;
1357
1527
  failingEvidenceId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "EvidenceId">>;
1358
1528
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1366,6 +1536,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1366
1536
  confidence: z.ZodNumber;
1367
1537
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1368
1538
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1539
+ errorCode: z.ZodOptional<z.ZodString>;
1540
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1541
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1542
+ resumable: z.ZodBoolean;
1543
+ action: z.ZodEnum<{
1544
+ resume: "resume";
1545
+ manual: "manual";
1546
+ }>;
1547
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1548
+ }, z.core.$strip>>;
1369
1549
  category: z.ZodLiteral<"verification-environment">;
1370
1550
  verificationCommandName: z.ZodString;
1371
1551
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1379,6 +1559,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1379
1559
  confidence: z.ZodNumber;
1380
1560
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1381
1561
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1562
+ errorCode: z.ZodOptional<z.ZodString>;
1563
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1564
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1565
+ resumable: z.ZodBoolean;
1566
+ action: z.ZodEnum<{
1567
+ resume: "resume";
1568
+ manual: "manual";
1569
+ }>;
1570
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1571
+ }, z.core.$strip>>;
1382
1572
  category: z.ZodLiteral<"scope-drift">;
1383
1573
  driftedPaths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1384
1574
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1392,6 +1582,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1392
1582
  confidence: z.ZodNumber;
1393
1583
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1394
1584
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1585
+ errorCode: z.ZodOptional<z.ZodString>;
1586
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1587
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1588
+ resumable: z.ZodBoolean;
1589
+ action: z.ZodEnum<{
1590
+ resume: "resume";
1591
+ manual: "manual";
1592
+ }>;
1593
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1594
+ }, z.core.$strip>>;
1395
1595
  category: z.ZodLiteral<"merge-conflict">;
1396
1596
  conflictingPaths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1397
1597
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1405,6 +1605,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1405
1605
  confidence: z.ZodNumber;
1406
1606
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1407
1607
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1608
+ errorCode: z.ZodOptional<z.ZodString>;
1609
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1610
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1611
+ resumable: z.ZodBoolean;
1612
+ action: z.ZodEnum<{
1613
+ resume: "resume";
1614
+ manual: "manual";
1615
+ }>;
1616
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1617
+ }, z.core.$strip>>;
1408
1618
  category: z.ZodLiteral<"model-failure">;
1409
1619
  provider: z.ZodString;
1410
1620
  }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
@@ -1418,6 +1628,16 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1418
1628
  confidence: z.ZodNumber;
1419
1629
  relatedEvidenceIds: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "EvidenceId">>>;
1420
1630
  rootCauseFingerprint: z.ZodOptional<z.ZodString>;
1631
+ errorCode: z.ZodOptional<z.ZodString>;
1632
+ lastPersistedStage: z.ZodOptional<z.ZodString>;
1633
+ recoveryGuidance: z.ZodOptional<z.ZodObject<{
1634
+ resumable: z.ZodBoolean;
1635
+ action: z.ZodEnum<{
1636
+ resume: "resume";
1637
+ manual: "manual";
1638
+ }>;
1639
+ preconditions: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1640
+ }, z.core.$strip>>;
1421
1641
  category: z.ZodLiteral<"acceptance-failure">;
1422
1642
  failingEvidenceId: z.core.$ZodBranded<z.ZodString, "EvidenceId">;
1423
1643
  }, z.core.$strip>>]>>>>;
@@ -1619,6 +1839,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1619
1839
  question: z.ZodString;
1620
1840
  impact: z.ZodString;
1621
1841
  }, z.core.$strip>>>>;
1842
+ refutations: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1843
+ claim: z.ZodString;
1844
+ evidenceSummary: z.ZodString;
1845
+ }, z.core.$strip>>>>;
1622
1846
  constraints: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1623
1847
  }, z.core.$strip>>>;
1624
1848
  contextSnapshot: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
@@ -1739,6 +1963,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1739
1963
  routingRationale: z.ZodString;
1740
1964
  rejudgementTriggers: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1741
1965
  }, z.core.$strict>>>;
1966
+ hypotheses: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1967
+ claim: z.ZodString;
1968
+ evidence: z.ZodOptional<z.ZodString>;
1969
+ }, z.core.$strict>>>>;
1742
1970
  repositoryId: z.ZodOptional<z.ZodString>;
1743
1971
  targetRepository: z.ZodOptional<z.ZodString>;
1744
1972
  workspaceMutation: z.ZodOptional<z.ZodEnum<{
@@ -1879,6 +2107,10 @@ export declare const RunSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.Zo
1879
2107
  question: z.ZodString;
1880
2108
  impact: z.ZodString;
1881
2109
  }, z.core.$strip>>>>;
2110
+ refutations: z.ZodOptional<z.ZodArray<z.ZodReadonly<z.ZodObject<{
2111
+ claim: z.ZodString;
2112
+ evidenceSummary: z.ZodString;
2113
+ }, z.core.$strip>>>>;
1882
2114
  constraints: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1883
2115
  }, z.core.$strip>>;
1884
2116
  coverage: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/domain/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAwBvB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;mBAWvB,CAAA;AA2Ib,QAAA,MAAM,oBAAoB;;;;;;;;;qBASb,CAAA;AAEb,QAAA,MAAM,cAAc;;;kBAKP,CAAA;AAEb,QAAA,MAAM,qBAAqB;;;;;;;;;kBAQd,CAAA;AAEb,QAAA,MAAM,qBAAqB;;;;;;;;;;kBASd,CAAA;AAEb,QAAA,MAAM,oBAAoB;;;;;;;;kBAOb,CAAA;AAEb,QAAA,MAAM,iBAAiB;;;;;;qBAeV,CA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AAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-harness-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/create-harness-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAOjD,OAAO,EAEL,KAAK,yBAAyB,EAE/B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,eAAO,MAAM,mBAAmB,GAAI,eAAc,yBAA8B,KAAG,MA8FlF,CAAA;AAED,eAAO,MAAM,aAAa,QAAwB,CAAA"}
1
+ {"version":3,"file":"create-harness-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/create-harness-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAQjD,OAAO,EAEL,KAAK,yBAAyB,EAE/B,MAAM,6BAA6B,CAAA;AAMpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,eAAO,MAAM,mBAAmB,GAAI,eAAc,yBAA8B,KAAG,MAiIlF,CAAA;AAED,eAAO,MAAM,aAAa,QAAwB,CAAA"}
@@ -4,6 +4,7 @@ import { applyHarnessAgentConfig } from "./harness-agent-config.js";
4
4
  import { handleHarnessChatMessage } from "./harness-chat-hook.js";
5
5
  import { createHarnessEscalateTool, HARNESS_ESCALATE_TOOL_NAME } from "./harness-escalate-tool.js";
6
6
  import { createRuntime, resolveHarnessResearchRole, } from "./harness-plugin-runtime.js";
7
+ import { createHarnessRunStatusTool, HARNESS_RUN_STATUS_TOOL_NAME, } from "./harness-run-status-tool.js";
7
8
  export { resolveHarnessProjectRoot } from "./harness-plugin-identifiers.js";
8
9
  export const createHarnessPlugin = (dependencies = {}) => {
9
10
  return async (input) => {
@@ -14,17 +15,31 @@ export const createHarnessPlugin = (dependencies = {}) => {
14
15
  runtime.projectRoot === undefined ||
15
16
  runtime.sessionGuards === undefined ||
16
17
  runtime.researchClients === undefined ||
17
- runtime.sessionAdapter === undefined) {
18
+ runtime.sessionAdapter === undefined ||
19
+ runtime.store === undefined) {
18
20
  return {};
19
21
  }
20
- const { config, coordinator, projectRoot, researchClients, sessionGuards, sessionAdapter } = runtime;
21
- const deliverInternalResult = async ({ sessionID, text, }) => {
22
+ const { config, coordinator, projectRoot, researchClients, sessionGuards, sessionAdapter, store, } = runtime;
23
+ const deliverInternalResult = async ({ sessionID, envelope, }) => {
22
24
  await input.client.session.promptAsync({
23
25
  path: { id: sessionID },
24
26
  query: { directory: projectRoot },
25
27
  body: {
26
28
  agent: "harness",
27
- parts: [{ type: "text", text, synthetic: true, metadata: { source: "harness" } }],
29
+ parts: [
30
+ {
31
+ type: "text",
32
+ text: envelope.userChannel,
33
+ synthetic: true,
34
+ metadata: { source: "harness", channel: "user" },
35
+ },
36
+ {
37
+ type: "text",
38
+ text: envelope.agentChannel,
39
+ synthetic: true,
40
+ metadata: { source: "harness", channel: "agent" },
41
+ },
42
+ ],
28
43
  },
29
44
  throwOnError: true,
30
45
  });
@@ -47,6 +62,7 @@ export const createHarnessPlugin = (dependencies = {}) => {
47
62
  guards: sessionGuards,
48
63
  deliverInternalResult,
49
64
  }),
65
+ [HARNESS_RUN_STATUS_TOOL_NAME]: createHarnessRunStatusTool({ store }),
50
66
  },
51
67
  "tool.execute.before": async (toolInput, output) => {
52
68
  const snapshot = sessionAdapterSnapshot(sessionAdapter, toolInput.sessionID);
@@ -71,14 +87,27 @@ export const createHarnessPlugin = (dependencies = {}) => {
71
87
  guards: sessionGuards,
72
88
  messageInput,
73
89
  output,
74
- deliverInternalResult: async ({ sessionID, text }) => {
90
+ deliverInternalResult: async ({ sessionID, envelope }) => {
75
91
  await input.client.session.promptAsync({
76
92
  path: { id: sessionID },
77
93
  query: { directory: projectRoot },
78
94
  body: {
79
95
  agent: "harness",
80
96
  ...(replyModel === undefined ? {} : { model: replyModel }),
81
- parts: [{ type: "text", text, synthetic: true, metadata: { source: "harness" } }],
97
+ parts: [
98
+ {
99
+ type: "text",
100
+ text: envelope.userChannel,
101
+ synthetic: true,
102
+ metadata: { source: "harness", channel: "user" },
103
+ },
104
+ {
105
+ type: "text",
106
+ text: envelope.agentChannel,
107
+ synthetic: true,
108
+ metadata: { source: "harness", channel: "agent" },
109
+ },
110
+ ],
82
111
  },
83
112
  throwOnError: true,
84
113
  });
@@ -1 +1 @@
1
- {"version":3,"file":"create-harness-plugin.js","sourceRoot":"","sources":["../../src/plugin/create-harness-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAClG,OAAO,EACL,aAAa,EAEb,0BAA0B,GAC3B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAG3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,eAA0C,EAAE,EAAU,EAAE;IAC1F,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAA;QAClF,IACE,OAAO,CAAC,MAAM,KAAK,SAAS;YAC5B,OAAO,CAAC,UAAU,KAAK,SAAS;YAChC,OAAO,CAAC,WA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,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import type { Part } from "@opencode-ai/sdk";
2
2
  import type { HarnessConfig } from "../config/index.js";
3
3
  import type { HarnessCoordinator } from "./harness-coordinator.js";
4
+ import { type HarnessDeliveryEnvelope } from "./harness-delivery-envelope.js";
4
5
  import { type HarnessRequestClassification } from "./harness-request-router.js";
5
6
  export type SessionGuards = {
6
7
  readonly inFlightAdvancements: Map<string, Promise<void>>;
@@ -12,7 +13,7 @@ export type SessionGuards = {
12
13
  };
13
14
  type InternalResultDelivery = (input: {
14
15
  readonly sessionID: string;
15
- readonly text: string;
16
+ readonly envelope: HarnessDeliveryEnvelope;
16
17
  }) => Promise<void>;
17
18
  export type HarnessAdmissionResult = "accepted" | "duplicate" | "busy";
18
19
  export declare const admitHarnessRequest: (input: {
@@ -1 +1 @@
1
- {"version":3,"file":"harness-chat-hook.d.ts","sourceRoot":"","sources":["../../src/plugin/harness-chat-hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAgBvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6BAA6B,CAAA;AAGpC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IACzD,QAAQ,CAAC,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAChE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IACvD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAA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+1,24 @@
1
1
  import { HARNESS_PRIMARY_AGENT_NAME } from "../session/index.js";
2
2
  import { appendSyntheticTextPart, extractChatText, hasHarnessInternalResultPart, } from "./harness-chat-parts.js";
3
- import { createBackgroundAcknowledgement, createBackgroundBusyInstruction, createBackgroundDuplicateInstruction, createEnhancedPassthroughInstruction, createInternalCompletionMessage, createInternalFailureMessage, createPassthroughInstruction, } from "./harness-chat-protocol.js";
3
+ import { createBackgroundAcknowledgement, createEnhancedPassthroughInstruction, createPassthroughInstruction, } from "./harness-chat-protocol.js";
4
+ import { containsHarnessProtocolPayload, createBusyDuplicateEnvelope, createFailureDeliveryEnvelope, createSuccessDeliveryEnvelope, stripProtocolPayload, } from "./harness-delivery-envelope.js";
4
5
  import { classifyHarnessRequest, } from "./harness-request-router.js";
5
6
  import { sanitizeHarnessUserFacingError } from "./harness-user-facing-errors.js";
6
7
  export const admitHarnessRequest = (input) => {
7
8
  const admissionKey = createAdmissionKey(input.sessionID, input.messageID);
9
+ const deliverBusy = (envelope) => {
10
+ void input.deliverInternalResult({ sessionID: input.sessionID, envelope });
11
+ };
8
12
  if (input.guards.completedAdmissionKeys.has(admissionKey)) {
9
- void input.deliverInternalResult({
10
- sessionID: input.sessionID,
11
- text: createBackgroundDuplicateInstruction(input.guards.activeRunIdsBySession.get(input.sessionID)),
12
- });
13
+ deliverBusy(createBusyDuplicateEnvelope("duplicate", input.guards.activeRunIdsBySession.get(input.sessionID)));
13
14
  return "duplicate";
14
15
  }
15
16
  if (input.guards.inFlightAdmissions.has(admissionKey)) {
16
- void input.deliverInternalResult({
17
- sessionID: input.sessionID,
18
- text: createBackgroundDuplicateInstruction(input.guards.activeRunIdsBySession.get(input.sessionID)),
19
- });
17
+ deliverBusy(createBusyDuplicateEnvelope("duplicate", input.guards.activeRunIdsBySession.get(input.sessionID)));
20
18
  return "duplicate";
21
19
  }
22
20
  if (input.guards.inFlightAdmissionsBySession.has(input.sessionID)) {
23
- void input.deliverInternalResult({
24
- sessionID: input.sessionID,
25
- text: createBackgroundBusyInstruction(input.guards.activeRunIdsBySession.get(input.sessionID)),
26
- });
21
+ deliverBusy(createBusyDuplicateEnvelope("busy", input.guards.activeRunIdsBySession.get(input.sessionID)));
27
22
  return "busy";
28
23
  }
29
24
  const coordinationTask = input.coordinator.handle({
@@ -34,7 +29,7 @@ export const admitHarnessRequest = (input) => {
34
29
  const backgroundTask = coordinationTask.then(async (response) => {
35
30
  await input.deliverInternalResult({
36
31
  sessionID: input.sessionID,
37
- text: createInternalCompletionMessage(response),
32
+ envelope: createSuccessDeliveryEnvelope(response),
38
33
  });
39
34
  if (response.kind === "run") {
40
35
  input.guards.activeRunIdsBySession.set(input.sessionID, response.run.runId);
@@ -43,7 +38,7 @@ export const admitHarnessRequest = (input) => {
43
38
  }, async (error) => {
44
39
  await input.deliverInternalResult({
45
40
  sessionID: input.sessionID,
46
- text: createInternalFailureMessage(sanitizeHarnessUserFacingError(error)),
41
+ envelope: createFailureDeliveryEnvelope(sanitizeHarnessUserFacingError(error)),
47
42
  });
48
43
  });
49
44
  void backgroundTask.catch(() => undefined);
@@ -65,7 +60,11 @@ export const handleHarnessChatMessage = async (input) => {
65
60
  if (hasHarnessInternalResultPart(input.output.parts)) {
66
61
  return;
67
62
  }
68
- const inputText = extractChatText(input.output.parts);
63
+ const rawInputText = extractChatText(input.output.parts);
64
+ // 用户误粘贴的 HARNESS_* 协议标记与协议 JSON 静默降级为普通上下文,不回显解析错误
65
+ const inputText = containsHarnessProtocolPayload(rawInputText)
66
+ ? stripProtocolPayload(rawInputText)
67
+ : rawInputText;
69
68
  const requestClassification = classifyHarnessRequest(inputText);
70
69
  if (!requestClassification.shouldCoordinate) {
71
70
  const sessionID = input.messageInput.sessionID;