@reticlehq/core 3.7.0 → 3.8.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.
Files changed (108) hide show
  1. package/dist/activation-entry.d.ts +9 -0
  2. package/dist/activation-entry.js +9 -0
  3. package/dist/artifacts/drive-script.d.ts +64 -64
  4. package/dist/artifacts/flow-constants.d.ts +15 -0
  5. package/dist/artifacts/flow-constants.js +15 -0
  6. package/dist/artifacts/flow-expect-flat.d.ts +8 -8
  7. package/dist/artifacts/flow-results.d.ts +11 -0
  8. package/dist/artifacts/flow-types.d.ts +164 -118
  9. package/dist/artifacts/flow-types.js +12 -0
  10. package/dist/artifacts/harness-credits.d.ts +6 -3
  11. package/dist/artifacts/harness-credits.js +9 -6
  12. package/dist/artifacts/harness-map.d.ts +6 -6
  13. package/dist/artifacts/impact.d.ts +77 -80
  14. package/dist/artifacts/impact.js +34 -17
  15. package/dist/artifacts/journal.d.ts +25 -6
  16. package/dist/artifacts/journal.js +13 -0
  17. package/dist/artifacts/prompt-context.d.ts +12 -0
  18. package/dist/artifacts/prompt-context.js +14 -3
  19. package/dist/graph/app-graph.d.ts +137 -0
  20. package/dist/graph/app-graph.js +498 -0
  21. package/dist/hooks/hook-events.d.ts +22 -22
  22. package/dist/hud-entry.js +1 -1
  23. package/dist/identity/checkout.d.ts +41 -0
  24. package/dist/identity/checkout.js +118 -0
  25. package/dist/identity/state-dir.d.ts +23 -0
  26. package/dist/identity/state-dir.js +43 -0
  27. package/dist/index.d.ts +10 -0
  28. package/dist/index.js +10 -0
  29. package/dist/onboarding.d.ts +22 -1
  30. package/dist/onboarding.js +19 -0
  31. package/dist/registry/dev-server-registry.d.ts +2 -2
  32. package/dist/schema/event-message.json +3 -1
  33. package/dist/schema/event-payloads.json +116 -1
  34. package/dist/schema/event-type.json +3 -1
  35. package/dist/schema/hello-message.json +21 -0
  36. package/dist/schema/reticle-event.json +3 -1
  37. package/dist/schema/reticle-message.json +24 -1
  38. package/dist/telemetry-bug.d.ts +6 -6
  39. package/dist/telemetry-entry.d.ts +1 -1
  40. package/dist/telemetry-entry.js +1 -1
  41. package/dist/telemetry-feedback.d.ts +14 -0
  42. package/dist/telemetry-feedback.js +19 -0
  43. package/dist/telemetry-refusal.d.ts +2 -2
  44. package/dist/telemetry-session.d.ts +23 -8
  45. package/dist/telemetry-session.js +15 -4
  46. package/dist/telemetry-signals.d.ts +227 -9
  47. package/dist/telemetry-signals.js +88 -1
  48. package/dist/telemetry.d.ts +379 -72
  49. package/dist/telemetry.js +71 -5
  50. package/dist/verdict/check-sentence.d.ts +34 -0
  51. package/dist/verdict/check-sentence.js +228 -0
  52. package/dist/verdict/consequence.d.ts +15 -0
  53. package/dist/verdict/consequence.js +11 -0
  54. package/dist/verdict/findings.d.ts +10 -0
  55. package/dist/verdict/findings.js +13 -0
  56. package/dist/verdict/instrumentation-coverage.d.ts +3 -34
  57. package/dist/verdict/instrumentation-coverage.js +14 -58
  58. package/dist/verdict/instrumentation-gap.d.ts +79 -0
  59. package/dist/verdict/instrumentation-gap.js +64 -0
  60. package/dist/verdict/predicate-tree.d.ts +2 -0
  61. package/dist/verdict/predicate-tree.js +16 -0
  62. package/dist/verdict/predicate.d.ts +2 -1
  63. package/dist/verdict/predicate.js +103 -12
  64. package/dist/verdict/property-assertion.d.ts +2 -2
  65. package/dist/verdict/run-report.d.ts +166 -0
  66. package/dist/verdict/run-report.js +53 -0
  67. package/dist/verdict/security.d.ts +36 -2
  68. package/dist/verdict/security.js +94 -14
  69. package/dist/verdict/verification-run.d.ts +95 -38
  70. package/dist/verdict/verification-run.js +33 -2
  71. package/dist/verdict/verify-progress.d.ts +6 -6
  72. package/dist/wire/constants/constants.d.ts +56 -141
  73. package/dist/wire/constants/constants.js +64 -144
  74. package/dist/wire/constants/discovery.d.ts +4 -4
  75. package/dist/wire/constants/discovery.js +4 -4
  76. package/dist/wire/constants/event-types.d.ts +35 -1
  77. package/dist/wire/constants/event-types.js +33 -1
  78. package/dist/wire/constants/hud-controls.js +0 -2
  79. package/dist/wire/constants/hud-use.d.ts +4 -0
  80. package/dist/wire/constants/hud-use.js +4 -0
  81. package/dist/wire/constants/mcp-wire.d.ts +16 -0
  82. package/dist/wire/constants/mcp-wire.js +16 -0
  83. package/dist/wire/constants/response-body-reason.d.ts +19 -0
  84. package/dist/wire/constants/response-body-reason.js +18 -0
  85. package/dist/wire/constants/reticle-env.d.ts +138 -0
  86. package/dist/wire/constants/reticle-env.js +138 -0
  87. package/dist/wire/constants/session-constants.d.ts +11 -0
  88. package/dist/wire/constants/session-constants.js +11 -0
  89. package/dist/wire/event-payloads.d.ts +150 -36
  90. package/dist/wire/event-payloads.js +83 -16
  91. package/dist/wire/messages.d.ts +102 -36
  92. package/dist/wire/messages.js +16 -0
  93. package/dist/wire/narrow.d.ts +6 -0
  94. package/dist/wire/narrow.js +26 -0
  95. package/dist/wire/next-step.d.ts +90 -0
  96. package/dist/wire/next-step.js +37 -0
  97. package/dist/wire/platform-link.d.ts +7 -0
  98. package/dist/wire/platform-link.js +12 -6
  99. package/dist/wire/production/activation-ticket.d.ts +64 -0
  100. package/dist/wire/production/activation-ticket.js +148 -0
  101. package/dist/wire/production/hello-mode.d.ts +35 -0
  102. package/dist/wire/production/hello-mode.js +32 -0
  103. package/dist/wire/production/production-policy.d.ts +138 -0
  104. package/dist/wire/production/production-policy.js +133 -0
  105. package/dist/wire/tool-names.d.ts +2 -0
  106. package/dist/wire/tool-names.js +2 -0
  107. package/dist/wire/types.d.ts +73 -48
  108. package/package.json +5 -1
@@ -38,6 +38,9 @@ export const FlowAnchorSchema = z.discriminatedUnion('kind', [
38
38
  z.object({
39
39
  kind: z.literal(AnchorKind.TESTID),
40
40
  value: z.string().min(1),
41
+ // How many elements carried this test id when the step was recorded, when more than one did.
42
+ // A replay takes the first, so a shared test id is named at save instead of found as a drift.
43
+ of: z.number().int().min(2).optional(),
41
44
  source: z
42
45
  .object({ file: z.string(), line: z.number(), column: z.number().optional() })
43
46
  .optional(),
@@ -142,6 +145,8 @@ const baseFlowStep = z.object({
142
145
  effect: z.nativeEnum(StepEffect).optional(),
143
146
  /** Rebound by `heal` rather than recorded — see FlowStep.healed. */
144
147
  healed: z.object({ from: z.string(), at: z.number() }).optional(),
148
+ /** See FlowStep.writes. */
149
+ writes: z.boolean().optional(),
145
150
  action: z.nativeEnum(ActionType).optional(),
146
151
  args: z.record(z.unknown()).optional(),
147
152
  expect: ExpectSchema.optional(),
@@ -178,6 +183,13 @@ export const FlowFileSchema = z.object({
178
183
  * cannot actually check — flow-classify flags that gap.
179
184
  */
180
185
  intent: z.string().optional(),
186
+ /**
187
+ * True when `intent` was built from the steps' expects, not declared by anybody. An auto-saved
188
+ * drive with no declared intent was named by its request path and read as nothing. A built
189
+ * sentence names it, and this flag keeps it out of the intent ledger: it describes the steps, so
190
+ * it can never be a goal the steps then prove.
191
+ */
192
+ intentDerived: z.boolean().optional(),
181
193
  /**
182
194
  * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
183
195
  *
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Harness credits, as the platform grants them and as every surface says them.
2
+ * Credits, as the platform grants them and as every surface says them. They pay for the whole
3
+ * platform, not only the Harness, so every surface calls them credits.
3
4
  *
4
5
  * One file because the HUD's row and the daemon's refusal must say the same sentence: when the two
5
6
  * were written apart, the HUD offered "a free monthly allowance" the platform no longer grants.
@@ -10,8 +11,10 @@
10
11
  import { CreditKind } from './impact.js';
11
12
  /** The trial a card starts. Not on the wire; the platform's own sentence names it the same. */
12
13
  export declare const TRIAL_DAYS = 14;
13
- /** What a new account is granted, and what a card's trial grants. The platform's numbers, said. */
14
- export declare const FREE_CREDITS = 10;
14
+ /**
15
+ * What a card's trial grants. No sign-up number: free credit is granted once per person, so the
16
+ * engine cannot know whether the reader still has any. Only the platform's `limit` says a count.
17
+ */
15
18
  export declare const TRIAL_CREDITS = 500;
16
19
  /** What a signed-out HUD says the Harness costs to try. */
17
20
  export declare const SIGN_UP_PITCH: string;
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Harness credits, as the platform grants them and as every surface says them.
2
+ * Credits, as the platform grants them and as every surface says them. They pay for the whole
3
+ * platform, not only the Harness, so every surface calls them credits.
3
4
  *
4
5
  * One file because the HUD's row and the daemon's refusal must say the same sentence: when the two
5
6
  * were written apart, the HUD offered "a free monthly allowance" the platform no longer grants.
@@ -10,15 +11,17 @@
10
11
  import { CreditKind } from './impact.js';
11
12
  /** The trial a card starts. Not on the wire; the platform's own sentence names it the same. */
12
13
  export const TRIAL_DAYS = 14;
13
- /** What a new account is granted, and what a card's trial grants. The platform's numbers, said. */
14
- export const FREE_CREDITS = 10;
14
+ /**
15
+ * What a card's trial grants. No sign-up number: free credit is granted once per person, so the
16
+ * engine cannot know whether the reader still has any. Only the platform's `limit` says a count.
17
+ */
15
18
  export const TRIAL_CREDITS = 500;
16
19
  /** What a signed-out HUD says the Harness costs to try. */
17
- export const SIGN_UP_PITCH = `Sign up: ${String(FREE_CREDITS)} free credits to try Reticle Harness · ` +
20
+ export const SIGN_UP_PITCH = 'Sign up: free credits to try Reticle · ' +
18
21
  `add a card for a ${String(TRIAL_CREDITS)}-credit, ${String(TRIAL_DAYS)}-day trial`;
19
22
  /** The platform's offer, worded once: what a card starts, and what an account gets without one. */
20
- export const TRIAL_OFFER = `a card starts a ${String(TRIAL_DAYS)}-day trial with ${String(TRIAL_CREDITS)} Harness credits; ` +
21
- `without one, ${String(FREE_CREDITS)} sign-up credits`;
23
+ export const TRIAL_OFFER = `a card starts a ${String(TRIAL_DAYS)}-day trial with ${String(TRIAL_CREDITS)} credits; ` +
24
+ 'without one, free sign-up credits';
22
25
  /** A credit count: each model call is charged its exact share, so up to two decimals, never floored. */
23
26
  const count = (n) => n.toLocaleString('en-US', { maximumFractionDigits: 2 });
24
27
  /** Nothing left. An unbounded plan (no credits reported) never is. */
@@ -28,15 +28,15 @@ export declare const HarnessMapPageSchema: z.ZodObject<{
28
28
  /** When this page was last read (epoch ms, injected). */
29
29
  at: z.ZodNumber;
30
30
  }, "strip", z.ZodTypeAny, {
31
- route: string;
32
31
  at: number;
32
+ route: string;
33
33
  texts: string[];
34
34
  controls: string[];
35
35
  heading?: string | undefined;
36
36
  reachedBy?: string | undefined;
37
37
  }, {
38
- route: string;
39
38
  at: number;
39
+ route: string;
40
40
  texts: string[];
41
41
  controls: string[];
42
42
  heading?: string | undefined;
@@ -60,15 +60,15 @@ export declare const HarnessMapSchema: z.ZodObject<{
60
60
  /** When this page was last read (epoch ms, injected). */
61
61
  at: z.ZodNumber;
62
62
  }, "strip", z.ZodTypeAny, {
63
- route: string;
64
63
  at: number;
64
+ route: string;
65
65
  texts: string[];
66
66
  controls: string[];
67
67
  heading?: string | undefined;
68
68
  reachedBy?: string | undefined;
69
69
  }, {
70
- route: string;
71
70
  at: number;
71
+ route: string;
72
72
  texts: string[];
73
73
  controls: string[];
74
74
  heading?: string | undefined;
@@ -77,8 +77,8 @@ export declare const HarnessMapSchema: z.ZodObject<{
77
77
  }, "strip", z.ZodTypeAny, {
78
78
  surveyedAt: number;
79
79
  pages: {
80
- route: string;
81
80
  at: number;
81
+ route: string;
82
82
  texts: string[];
83
83
  controls: string[];
84
84
  heading?: string | undefined;
@@ -87,8 +87,8 @@ export declare const HarnessMapSchema: z.ZodObject<{
87
87
  }, {
88
88
  surveyedAt: number;
89
89
  pages: {
90
- route: string;
91
90
  at: number;
91
+ route: string;
92
92
  texts: string[];
93
93
  controls: string[];
94
94
  heading?: string | undefined;
@@ -620,7 +620,7 @@ export declare const AccountStateSchema: z.ZodObject<{
620
620
  host?: string | undefined;
621
621
  }>;
622
622
  export type AccountState = z.infer<typeof AccountStateSchema>;
623
- /** The grant Harness credits came from: sign-up, the card-started trial, or a paid plan. */
623
+ /** The grant credits came from: sign-up, the card-started trial, or a paid plan. */
624
624
  export declare const CreditKind: {
625
625
  readonly FREE: "free";
626
626
  readonly TRIAL: "trial";
@@ -641,7 +641,7 @@ export declare const HarnessConfigSchema: z.ZodObject<{
641
641
  harnessEntitled: z.ZodBoolean;
642
642
  /** Whether the selected provider has a usable platform key. Older daemons may omit it. */
643
643
  providerReady: z.ZodOptional<z.ZodBoolean>;
644
- /** Harness credits used and held this 30 days; one is one Harness decision. Absent: unbounded or unknown. */
644
+ /** Credits used and held this 30 days; a Harness decision is one. Absent: unbounded or unknown. */
645
645
  credits: z.ZodOptional<z.ZodObject<{
646
646
  used: z.ZodNumber;
647
647
  limit: z.ZodNumber;
@@ -663,26 +663,10 @@ export declare const HarnessConfigSchema: z.ZodObject<{
663
663
  /** The platform this answer came from, so the HUD's links go there and not to the hosted one. */
664
664
  platformUrl: z.ZodOptional<z.ZodString>;
665
665
  /**
666
- * The platform's own Harness coverage gate, which it enforces. The HUD prefers it to the daemon's
667
- * local score; absent from an older platform, which leaves the local score to decide.
666
+ * The console's page for credits and the trial. The API and the console are two origins, so a
667
+ * link built from `platformUrl` opened a 404. The HUD links here, and to this origin for set-up.
668
668
  */
669
- gate: z.ZodOptional<z.ZodObject<{
670
- unlocked: z.ZodBoolean;
671
- /** floor(score × 100); absent before any app reported. */
672
- percent: z.ZodOptional<z.ZodNumber>;
673
- reason: z.ZodOptional<z.ZodString>;
674
- prompt: z.ZodOptional<z.ZodString>;
675
- }, "strip", z.ZodTypeAny, {
676
- unlocked: boolean;
677
- reason?: string | undefined;
678
- percent?: number | undefined;
679
- prompt?: string | undefined;
680
- }, {
681
- unlocked: boolean;
682
- reason?: string | undefined;
683
- percent?: number | undefined;
684
- prompt?: string | undefined;
685
- }>>;
669
+ planUrl: z.ZodOptional<z.ZodString>;
686
670
  /** The plan in force: which grant, trial days left, seats. Absent from a platform that sent none. */
687
671
  plan: z.ZodOptional<z.ZodObject<{
688
672
  kind: z.ZodEnum<["free", "trial", "paid"]>;
@@ -718,12 +702,7 @@ export declare const HarnessConfigSchema: z.ZodObject<{
718
702
  daysLeft?: number | undefined;
719
703
  } | undefined;
720
704
  platformUrl?: string | undefined;
721
- gate?: {
722
- unlocked: boolean;
723
- reason?: string | undefined;
724
- percent?: number | undefined;
725
- prompt?: string | undefined;
726
- } | undefined;
705
+ planUrl?: string | undefined;
727
706
  harnessRuns?: number | undefined;
728
707
  memoryEntries?: number | undefined;
729
708
  }, {
@@ -743,28 +722,52 @@ export declare const HarnessConfigSchema: z.ZodObject<{
743
722
  daysLeft?: number | undefined;
744
723
  } | undefined;
745
724
  platformUrl?: string | undefined;
746
- gate?: {
747
- unlocked: boolean;
748
- reason?: string | undefined;
749
- percent?: number | undefined;
750
- prompt?: string | undefined;
751
- } | undefined;
725
+ planUrl?: string | undefined;
752
726
  harnessRuns?: number | undefined;
753
727
  memoryEntries?: number | undefined;
754
728
  }>;
755
729
  export type HarnessConfig = z.infer<typeof HarnessConfigSchema>;
756
- /** The Harness drive running in this tab's project, so the panel can show progress and Stop. */
730
+ /** How many of a running drive's latest lines the snapshot carries for the Harness page's log. */
731
+ export declare const HARNESS_LINES_MAX = 60;
732
+ /**
733
+ * The Harness drive running in this tab's project, so the panel can show progress and Stop.
734
+ *
735
+ * `lines` is the drive's step log, held by the daemon: kept in the HUD's view alone, it was empty
736
+ * after the Harness page was closed and reopened, or the page reloaded, mid-run.
737
+ */
757
738
  export declare const HarnessDriveSchema: z.ZodObject<{
758
739
  runId: z.ZodString;
759
740
  steps: z.ZodNumber;
741
+ lines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
760
742
  }, "strip", z.ZodTypeAny, {
761
743
  steps: number;
762
744
  runId: string;
745
+ lines?: string[] | undefined;
763
746
  }, {
764
747
  steps: number;
765
748
  runId: string;
749
+ lines?: string[] | undefined;
766
750
  }>;
767
751
  export type HarnessDrive = z.infer<typeof HarnessDriveSchema>;
752
+ /**
753
+ * This tab's last word from the Harness once nothing is driving: the finished run's result page,
754
+ * and, when it did not run to its end, why (stopped by a reload, refused, the cloud unreachable).
755
+ */
756
+ export declare const LastDriveSchema: z.ZodObject<{
757
+ runUrl: z.ZodOptional<z.ZodString>;
758
+ said: z.ZodOptional<z.ZodString>;
759
+ /** Which word this is, rising: the page tells the answer to its press from an earlier word. */
760
+ seq: z.ZodOptional<z.ZodNumber>;
761
+ }, "strip", z.ZodTypeAny, {
762
+ seq?: number | undefined;
763
+ runUrl?: string | undefined;
764
+ said?: string | undefined;
765
+ }, {
766
+ seq?: number | undefined;
767
+ runUrl?: string | undefined;
768
+ said?: string | undefined;
769
+ }>;
770
+ export type LastDrive = z.infer<typeof LastDriveSchema>;
768
771
  /** The longest note a person can send their coding agent from the HUD. */
769
772
  export declare const AGENT_NOTE_MAX = 500;
770
773
  /** How many of a tab's latest notes the HUD shows. */
@@ -1505,7 +1508,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1505
1508
  harnessEntitled: z.ZodBoolean;
1506
1509
  /** Whether the selected provider has a usable platform key. Older daemons may omit it. */
1507
1510
  providerReady: z.ZodOptional<z.ZodBoolean>;
1508
- /** Harness credits used and held this 30 days; one is one Harness decision. Absent: unbounded or unknown. */
1511
+ /** Credits used and held this 30 days; a Harness decision is one. Absent: unbounded or unknown. */
1509
1512
  credits: z.ZodOptional<z.ZodObject<{
1510
1513
  used: z.ZodNumber;
1511
1514
  limit: z.ZodNumber;
@@ -1527,26 +1530,10 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1527
1530
  /** The platform this answer came from, so the HUD's links go there and not to the hosted one. */
1528
1531
  platformUrl: z.ZodOptional<z.ZodString>;
1529
1532
  /**
1530
- * The platform's own Harness coverage gate, which it enforces. The HUD prefers it to the daemon's
1531
- * local score; absent from an older platform, which leaves the local score to decide.
1533
+ * The console's page for credits and the trial. The API and the console are two origins, so a
1534
+ * link built from `platformUrl` opened a 404. The HUD links here, and to this origin for set-up.
1532
1535
  */
1533
- gate: z.ZodOptional<z.ZodObject<{
1534
- unlocked: z.ZodBoolean;
1535
- /** floor(score × 100); absent before any app reported. */
1536
- percent: z.ZodOptional<z.ZodNumber>;
1537
- reason: z.ZodOptional<z.ZodString>;
1538
- prompt: z.ZodOptional<z.ZodString>;
1539
- }, "strip", z.ZodTypeAny, {
1540
- unlocked: boolean;
1541
- reason?: string | undefined;
1542
- percent?: number | undefined;
1543
- prompt?: string | undefined;
1544
- }, {
1545
- unlocked: boolean;
1546
- reason?: string | undefined;
1547
- percent?: number | undefined;
1548
- prompt?: string | undefined;
1549
- }>>;
1536
+ planUrl: z.ZodOptional<z.ZodString>;
1550
1537
  /** The plan in force: which grant, trial days left, seats. Absent from a platform that sent none. */
1551
1538
  plan: z.ZodOptional<z.ZodObject<{
1552
1539
  kind: z.ZodEnum<["free", "trial", "paid"]>;
@@ -1582,12 +1569,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1582
1569
  daysLeft?: number | undefined;
1583
1570
  } | undefined;
1584
1571
  platformUrl?: string | undefined;
1585
- gate?: {
1586
- unlocked: boolean;
1587
- reason?: string | undefined;
1588
- percent?: number | undefined;
1589
- prompt?: string | undefined;
1590
- } | undefined;
1572
+ planUrl?: string | undefined;
1591
1573
  harnessRuns?: number | undefined;
1592
1574
  memoryEntries?: number | undefined;
1593
1575
  }, {
@@ -1607,12 +1589,7 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1607
1589
  daysLeft?: number | undefined;
1608
1590
  } | undefined;
1609
1591
  platformUrl?: string | undefined;
1610
- gate?: {
1611
- unlocked: boolean;
1612
- reason?: string | undefined;
1613
- percent?: number | undefined;
1614
- prompt?: string | undefined;
1615
- } | undefined;
1592
+ planUrl?: string | undefined;
1616
1593
  harnessRuns?: number | undefined;
1617
1594
  memoryEntries?: number | undefined;
1618
1595
  }>>;
@@ -1620,12 +1597,30 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1620
1597
  harnessDrive: z.ZodOptional<z.ZodObject<{
1621
1598
  runId: z.ZodString;
1622
1599
  steps: z.ZodNumber;
1600
+ lines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1623
1601
  }, "strip", z.ZodTypeAny, {
1624
1602
  steps: number;
1625
1603
  runId: string;
1604
+ lines?: string[] | undefined;
1626
1605
  }, {
1627
1606
  steps: number;
1628
1607
  runId: string;
1608
+ lines?: string[] | undefined;
1609
+ }>>;
1610
+ /** How the last drive on this tab ended, or why none started. Absent while one drives. */
1611
+ lastDrive: z.ZodOptional<z.ZodObject<{
1612
+ runUrl: z.ZodOptional<z.ZodString>;
1613
+ said: z.ZodOptional<z.ZodString>;
1614
+ /** Which word this is, rising: the page tells the answer to its press from an earlier word. */
1615
+ seq: z.ZodOptional<z.ZodNumber>;
1616
+ }, "strip", z.ZodTypeAny, {
1617
+ seq?: number | undefined;
1618
+ runUrl?: string | undefined;
1619
+ said?: string | undefined;
1620
+ }, {
1621
+ seq?: number | undefined;
1622
+ runUrl?: string | undefined;
1623
+ said?: string | undefined;
1629
1624
  }>>;
1630
1625
  /** Who is coding against this daemon, and what this tab said to them. Absent: an older daemon. */
1631
1626
  agent: z.ZodOptional<z.ZodObject<{
@@ -1799,13 +1794,13 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1799
1794
  }[];
1800
1795
  agents: string[];
1801
1796
  } | undefined;
1802
- sync?: Record<string, unknown> | undefined;
1803
1797
  account?: {
1804
1798
  signedIn: boolean;
1805
1799
  email?: string | undefined;
1806
1800
  org?: string | undefined;
1807
1801
  host?: string | undefined;
1808
1802
  } | undefined;
1803
+ sync?: Record<string, unknown> | undefined;
1809
1804
  instrumentation?: Record<string, unknown> | undefined;
1810
1805
  projectName?: string | undefined;
1811
1806
  dashboardUrl?: string | undefined;
@@ -1826,18 +1821,19 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1826
1821
  daysLeft?: number | undefined;
1827
1822
  } | undefined;
1828
1823
  platformUrl?: string | undefined;
1829
- gate?: {
1830
- unlocked: boolean;
1831
- reason?: string | undefined;
1832
- percent?: number | undefined;
1833
- prompt?: string | undefined;
1834
- } | undefined;
1824
+ planUrl?: string | undefined;
1835
1825
  harnessRuns?: number | undefined;
1836
1826
  memoryEntries?: number | undefined;
1837
1827
  } | undefined;
1838
1828
  harnessDrive?: {
1839
1829
  steps: number;
1840
1830
  runId: string;
1831
+ lines?: string[] | undefined;
1832
+ } | undefined;
1833
+ lastDrive?: {
1834
+ seq?: number | undefined;
1835
+ runUrl?: string | undefined;
1836
+ said?: string | undefined;
1841
1837
  } | undefined;
1842
1838
  notices?: unknown[] | undefined;
1843
1839
  coverage?: Record<string, number> | undefined;
@@ -1957,13 +1953,13 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1957
1953
  }[];
1958
1954
  agents: string[];
1959
1955
  } | undefined;
1960
- sync?: Record<string, unknown> | undefined;
1961
1956
  account?: {
1962
1957
  signedIn: boolean;
1963
1958
  email?: string | undefined;
1964
1959
  org?: string | undefined;
1965
1960
  host?: string | undefined;
1966
1961
  } | undefined;
1962
+ sync?: Record<string, unknown> | undefined;
1967
1963
  instrumentation?: Record<string, unknown> | undefined;
1968
1964
  projectName?: string | undefined;
1969
1965
  dashboardUrl?: string | undefined;
@@ -1984,18 +1980,19 @@ export declare const ImpactSnapshotSchema: z.ZodObject<{
1984
1980
  daysLeft?: number | undefined;
1985
1981
  } | undefined;
1986
1982
  platformUrl?: string | undefined;
1987
- gate?: {
1988
- unlocked: boolean;
1989
- reason?: string | undefined;
1990
- percent?: number | undefined;
1991
- prompt?: string | undefined;
1992
- } | undefined;
1983
+ planUrl?: string | undefined;
1993
1984
  harnessRuns?: number | undefined;
1994
1985
  memoryEntries?: number | undefined;
1995
1986
  } | undefined;
1996
1987
  harnessDrive?: {
1997
1988
  steps: number;
1998
1989
  runId: string;
1990
+ lines?: string[] | undefined;
1991
+ } | undefined;
1992
+ lastDrive?: {
1993
+ seq?: number | undefined;
1994
+ runUrl?: string | undefined;
1995
+ said?: string | undefined;
1999
1996
  } | undefined;
2000
1997
  notices?: unknown[] | undefined;
2001
1998
  coverage?: Record<string, number> | undefined;
@@ -140,7 +140,7 @@ export const AccountStateSchema = z.object({
140
140
  email: z.string().optional(),
141
141
  host: z.string().optional(),
142
142
  });
143
- /** The grant Harness credits came from: sign-up, the card-started trial, or a paid plan. */
143
+ /** The grant credits came from: sign-up, the card-started trial, or a paid plan. */
144
144
  export const CreditKind = { FREE: 'free', TRIAL: 'trial', PAID: 'paid' };
145
145
  /**
146
146
  * What the platform says about autonomous driving for this project.
@@ -156,11 +156,13 @@ export const HarnessConfigSchema = z.object({
156
156
  harnessEntitled: z.boolean(),
157
157
  /** Whether the selected provider has a usable platform key. Older daemons may omit it. */
158
158
  providerReady: z.boolean().optional(),
159
- /** Harness credits used and held this 30 days; one is one Harness decision. Absent: unbounded or unknown. */
159
+ /** Credits used and held this 30 days; a Harness decision is one. Absent: unbounded or unknown. */
160
160
  credits: z
161
161
  .object({
162
- used: z.number().int().min(0),
163
- limit: z.number().int().min(0),
162
+ // Not `.int()`: the platform charges part credits (a check can cost 0.25). One float here
163
+ // failed the whole impact snapshot, and the HUD then showed no account and no Harness at all.
164
+ used: z.number().min(0),
165
+ limit: z.number().min(0),
164
166
  /** The grant they came from. Optional on the wire: an older platform omits it. */
165
167
  kind: z.enum([CreditKind.FREE, CreditKind.TRIAL, CreditKind.PAID]).optional(),
166
168
  /** Whole days the grant has left, counted by the daemon from the platform's end date. */
@@ -170,18 +172,10 @@ export const HarnessConfigSchema = z.object({
170
172
  /** The platform this answer came from, so the HUD's links go there and not to the hosted one. */
171
173
  platformUrl: z.string().optional(),
172
174
  /**
173
- * The platform's own Harness coverage gate, which it enforces. The HUD prefers it to the daemon's
174
- * local score; absent from an older platform, which leaves the local score to decide.
175
+ * The console's page for credits and the trial. The API and the console are two origins, so a
176
+ * link built from `platformUrl` opened a 404. The HUD links here, and to this origin for set-up.
175
177
  */
176
- gate: z
177
- .object({
178
- unlocked: z.boolean(),
179
- /** floor(score × 100); absent before any app reported. */
180
- percent: z.number().int().min(0).max(100).optional(),
181
- reason: z.string().max(400).optional(),
182
- prompt: z.string().max(4000).optional(),
183
- })
184
- .optional(),
178
+ planUrl: z.string().optional(),
185
179
  /** The plan in force: which grant, trial days left, seats. Absent from a platform that sent none. */
186
180
  plan: z
187
181
  .object({
@@ -195,8 +189,29 @@ export const HarnessConfigSchema = z.object({
195
189
  /** Memory entries the platform holds for this project. Absent: the platform did not say. */
196
190
  memoryEntries: z.number().int().min(0).optional(),
197
191
  });
198
- /** The Harness drive running in this tab's project, so the panel can show progress and Stop. */
199
- export const HarnessDriveSchema = z.object({ runId: z.string(), steps: z.number().int().min(0) });
192
+ /** How many of a running drive's latest lines the snapshot carries for the Harness page's log. */
193
+ export const HARNESS_LINES_MAX = 60;
194
+ /**
195
+ * The Harness drive running in this tab's project, so the panel can show progress and Stop.
196
+ *
197
+ * `lines` is the drive's step log, held by the daemon: kept in the HUD's view alone, it was empty
198
+ * after the Harness page was closed and reopened, or the page reloaded, mid-run.
199
+ */
200
+ export const HarnessDriveSchema = z.object({
201
+ runId: z.string(),
202
+ steps: z.number().int().min(0),
203
+ lines: z.array(z.string()).max(HARNESS_LINES_MAX).optional(),
204
+ });
205
+ /**
206
+ * This tab's last word from the Harness once nothing is driving: the finished run's result page,
207
+ * and, when it did not run to its end, why (stopped by a reload, refused, the cloud unreachable).
208
+ */
209
+ export const LastDriveSchema = z.object({
210
+ runUrl: z.string().optional(),
211
+ said: z.string().optional(),
212
+ /** Which word this is, rising: the page tells the answer to its press from an earlier word. */
213
+ seq: z.number().int().min(0).optional(),
214
+ });
200
215
  /** The longest note a person can send their coding agent from the HUD. */
201
216
  export const AGENT_NOTE_MAX = 500;
202
217
  /** How many of a tab's latest notes the HUD shows. */
@@ -247,6 +262,8 @@ export const ImpactSnapshotSchema = z.object({
247
262
  harnessConfig: HarnessConfigSchema.optional(),
248
263
  /** The drive running now, when there is one. Absent: nothing is driving. */
249
264
  harnessDrive: HarnessDriveSchema.optional(),
265
+ /** How the last drive on this tab ended, or why none started. Absent while one drives. */
266
+ lastDrive: LastDriveSchema.optional(),
250
267
  /** Who is coding against this daemon, and what this tab said to them. Absent: an older daemon. */
251
268
  agent: AgentLinkSchema.optional(),
252
269
  /**
@@ -97,11 +97,11 @@ export declare const JournalActionSchema: z.ZodObject<{
97
97
  */
98
98
  agent: z.ZodOptional<z.ZodString>;
99
99
  }, "strip", z.ZodTypeAny, {
100
+ v: 1;
100
101
  at: number;
101
102
  tool: string;
102
103
  actionId: string;
103
104
  args: Record<string, unknown>;
104
- v: 1;
105
105
  tRange: {
106
106
  from: number;
107
107
  to: number;
@@ -120,10 +120,10 @@ export declare const JournalActionSchema: z.ZodObject<{
120
120
  persona?: string | undefined;
121
121
  } | undefined;
122
122
  }, {
123
+ v: 1;
123
124
  at: number;
124
125
  tool: string;
125
126
  actionId: string;
126
- v: 1;
127
127
  tRange: {
128
128
  from: number;
129
129
  to: number;
@@ -181,15 +181,15 @@ export declare const JournalWriteLossSchema: z.ZodObject<{
181
181
  /** Elapsed-ms stamp of the last record in the first refused batch; not a loss-window boundary. */
182
182
  at: z.ZodOptional<z.ZodNumber>;
183
183
  }, "strip", z.ZodTypeAny, {
184
- channel: "journal";
185
184
  v: 1;
185
+ channel: "journal";
186
186
  at?: number | undefined;
187
187
  capBytes?: number | undefined;
188
188
  bytesOnDisk?: number | undefined;
189
189
  droppedInBatch?: number | undefined;
190
190
  }, {
191
- channel: "journal";
192
191
  v: 1;
192
+ channel: "journal";
193
193
  at?: number | undefined;
194
194
  capBytes?: number | undefined;
195
195
  bytesOnDisk?: number | undefined;
@@ -308,9 +308,23 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
308
308
  * be read as though it did.
309
309
  */
310
310
  reason: z.ZodOptional<z.ZodString>;
311
+ /**
312
+ * What the check is for, as a person's sentence: the agent's `intent`, else one built from the
313
+ * predicate in the failure voice ("No PATCH request to /assignee was made"). Without it a check
314
+ * the agent gave no words for reached the platform as engine wording. Absent on older records.
315
+ */
316
+ intent: z.ZodOptional<z.ZodString>;
317
+ /** True when `intent` was built from the predicate, not given by the agent. */
318
+ intentDerived: z.ZodOptional<z.ZodBoolean>;
319
+ /**
320
+ * The index of the part of an `allOf` that failed, so a title can name the one thing that did
321
+ * not happen rather than "not all of these happened". Absent on a pass, a leaf, and older records.
322
+ */
323
+ failedPart: z.ZodOptional<z.ZodNumber>;
311
324
  }, "strip", z.ZodTypeAny, {
312
325
  verified: "yes" | "no" | "unknown" | "no-fault";
313
326
  claim: string;
327
+ reason?: string | undefined;
314
328
  net?: {
315
329
  method: string;
316
330
  url: string;
@@ -318,16 +332,19 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
318
332
  body?: string | undefined;
319
333
  }[] | undefined;
320
334
  kind?: "signal" | "net" | "state" | "element" | "text" | "route" | "console" | "animation" | "settled" | "compare" | "allOf" | "anyOf" | "not" | undefined;
335
+ intent?: string | undefined;
321
336
  expected?: string | undefined;
322
337
  source?: string | undefined;
323
338
  declaredBeforeActing?: boolean | undefined;
324
339
  observed?: string | undefined;
325
340
  grade?: string | undefined;
326
341
  couldNotSee?: string[] | undefined;
327
- reason?: string | undefined;
342
+ intentDerived?: boolean | undefined;
343
+ failedPart?: number | undefined;
328
344
  }, {
329
345
  verified: "yes" | "no" | "unknown" | "no-fault";
330
346
  claim: string;
347
+ reason?: string | undefined;
331
348
  net?: {
332
349
  method: string;
333
350
  url: string;
@@ -335,12 +352,14 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
335
352
  body?: string | undefined;
336
353
  }[] | undefined;
337
354
  kind?: "signal" | "net" | "state" | "element" | "text" | "route" | "console" | "animation" | "settled" | "compare" | "allOf" | "anyOf" | "not" | undefined;
355
+ intent?: string | undefined;
338
356
  expected?: string | undefined;
339
357
  source?: string | undefined;
340
358
  declaredBeforeActing?: boolean | undefined;
341
359
  observed?: string | undefined;
342
360
  grade?: string | undefined;
343
361
  couldNotSee?: string[] | undefined;
344
- reason?: string | undefined;
362
+ intentDerived?: boolean | undefined;
363
+ failedPart?: number | undefined;
345
364
  }>;
346
365
  export type JournalVerdictEffect = z.infer<typeof JournalVerdictEffectSchema>;
@@ -181,4 +181,17 @@ export const JournalVerdictEffectSchema = z.object({
181
181
  * be read as though it did.
182
182
  */
183
183
  reason: z.string().max(TRANSPORT_LIMITS.MAX_STRING_LENGTH).optional(),
184
+ /**
185
+ * What the check is for, as a person's sentence: the agent's `intent`, else one built from the
186
+ * predicate in the failure voice ("No PATCH request to /assignee was made"). Without it a check
187
+ * the agent gave no words for reached the platform as engine wording. Absent on older records.
188
+ */
189
+ intent: z.string().max(TRANSPORT_LIMITS.MAX_STRING_LENGTH).optional(),
190
+ /** True when `intent` was built from the predicate, not given by the agent. */
191
+ intentDerived: z.boolean().optional(),
192
+ /**
193
+ * The index of the part of an `allOf` that failed, so a title can name the one thing that did
194
+ * not happen rather than "not all of these happened". Absent on a pass, a leaf, and older records.
195
+ */
196
+ failedPart: z.number().int().min(0).optional(),
184
197
  });