@open-everywhere/provider-github 0.0.0-stage → 0.1.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 (111) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +21 -0
  3. package/README.md +50 -2
  4. package/agent/channels/github-catch-up.ts +134 -0
  5. package/agent/channels/github-engagement.ts +381 -0
  6. package/agent/channels/github-identity.ts +376 -0
  7. package/agent/channels/github-installations.ts +152 -0
  8. package/agent/channels/github-message-ops.ts +62 -0
  9. package/agent/channels/github-origin-codec.ts +42 -0
  10. package/agent/channels/github-post-arm.ts +422 -0
  11. package/agent/channels/github-reaction-feedback.ts +489 -0
  12. package/agent/channels/github-reaction-scope.ts +312 -0
  13. package/agent/channels/github-read.ts +471 -0
  14. package/agent/channels/github-stop.ts +175 -0
  15. package/agent/channels/github-supervisor.ts +645 -0
  16. package/agent/channels/github-webhook-verifier.ts +56 -0
  17. package/agent/channels/github.ts +1458 -0
  18. package/agent/contributions.ts +31 -0
  19. package/agent/docs-generated.ts +15 -0
  20. package/agent/memory/memory.ts +265 -0
  21. package/agent/ops.ts +17 -0
  22. package/agent/provider-events.ts +114 -0
  23. package/agent/register.ts +130 -0
  24. package/agent/surface-parity.ts +116 -0
  25. package/dist/agent/channels/github-catch-up.d.ts +29 -0
  26. package/dist/agent/channels/github-catch-up.d.ts.map +1 -0
  27. package/dist/agent/channels/github-catch-up.js +105 -0
  28. package/dist/agent/channels/github-catch-up.js.map +1 -0
  29. package/dist/agent/channels/github-engagement.d.ts +223 -0
  30. package/dist/agent/channels/github-engagement.d.ts.map +1 -0
  31. package/dist/agent/channels/github-engagement.js +317 -0
  32. package/dist/agent/channels/github-engagement.js.map +1 -0
  33. package/dist/agent/channels/github-identity.d.ts +164 -0
  34. package/dist/agent/channels/github-identity.d.ts.map +1 -0
  35. package/dist/agent/channels/github-identity.js +295 -0
  36. package/dist/agent/channels/github-identity.js.map +1 -0
  37. package/dist/agent/channels/github-installations.d.ts +49 -0
  38. package/dist/agent/channels/github-installations.d.ts.map +1 -0
  39. package/dist/agent/channels/github-installations.js +114 -0
  40. package/dist/agent/channels/github-installations.js.map +1 -0
  41. package/dist/agent/channels/github-message-ops.d.ts +3 -0
  42. package/dist/agent/channels/github-message-ops.d.ts.map +1 -0
  43. package/dist/agent/channels/github-message-ops.js +58 -0
  44. package/dist/agent/channels/github-message-ops.js.map +1 -0
  45. package/dist/agent/channels/github-origin-codec.d.ts +7 -0
  46. package/dist/agent/channels/github-origin-codec.d.ts.map +1 -0
  47. package/dist/agent/channels/github-origin-codec.js +36 -0
  48. package/dist/agent/channels/github-origin-codec.js.map +1 -0
  49. package/dist/agent/channels/github-post-arm.d.ts +54 -0
  50. package/dist/agent/channels/github-post-arm.d.ts.map +1 -0
  51. package/dist/agent/channels/github-post-arm.js +339 -0
  52. package/dist/agent/channels/github-post-arm.js.map +1 -0
  53. package/dist/agent/channels/github-reaction-feedback.d.ts +97 -0
  54. package/dist/agent/channels/github-reaction-feedback.d.ts.map +1 -0
  55. package/dist/agent/channels/github-reaction-feedback.js +380 -0
  56. package/dist/agent/channels/github-reaction-feedback.js.map +1 -0
  57. package/dist/agent/channels/github-reaction-scope.d.ts +102 -0
  58. package/dist/agent/channels/github-reaction-scope.d.ts.map +1 -0
  59. package/dist/agent/channels/github-reaction-scope.js +296 -0
  60. package/dist/agent/channels/github-reaction-scope.js.map +1 -0
  61. package/dist/agent/channels/github-read.d.ts +135 -0
  62. package/dist/agent/channels/github-read.d.ts.map +1 -0
  63. package/dist/agent/channels/github-read.js +371 -0
  64. package/dist/agent/channels/github-read.js.map +1 -0
  65. package/dist/agent/channels/github-stop.d.ts +52 -0
  66. package/dist/agent/channels/github-stop.d.ts.map +1 -0
  67. package/dist/agent/channels/github-stop.js +145 -0
  68. package/dist/agent/channels/github-stop.js.map +1 -0
  69. package/dist/agent/channels/github-supervisor.d.ts +308 -0
  70. package/dist/agent/channels/github-supervisor.d.ts.map +1 -0
  71. package/dist/agent/channels/github-supervisor.js +339 -0
  72. package/dist/agent/channels/github-supervisor.js.map +1 -0
  73. package/dist/agent/channels/github-webhook-verifier.d.ts +5 -0
  74. package/dist/agent/channels/github-webhook-verifier.d.ts.map +1 -0
  75. package/dist/agent/channels/github-webhook-verifier.js +55 -0
  76. package/dist/agent/channels/github-webhook-verifier.js.map +1 -0
  77. package/dist/agent/channels/github.d.ts +139 -0
  78. package/dist/agent/channels/github.d.ts.map +1 -0
  79. package/dist/agent/channels/github.js +1232 -0
  80. package/dist/agent/channels/github.js.map +1 -0
  81. package/dist/agent/contributions.d.ts +12 -0
  82. package/dist/agent/contributions.d.ts.map +1 -0
  83. package/dist/agent/contributions.js +31 -0
  84. package/dist/agent/contributions.js.map +1 -0
  85. package/dist/agent/docs-generated.d.ts +3 -0
  86. package/dist/agent/docs-generated.d.ts.map +1 -0
  87. package/dist/agent/docs-generated.js +13 -0
  88. package/dist/agent/docs-generated.js.map +1 -0
  89. package/dist/agent/memory/memory.d.ts +54 -0
  90. package/dist/agent/memory/memory.d.ts.map +1 -0
  91. package/dist/agent/memory/memory.js +224 -0
  92. package/dist/agent/memory/memory.js.map +1 -0
  93. package/dist/agent/ops.d.ts +3 -0
  94. package/dist/agent/ops.d.ts.map +1 -0
  95. package/dist/agent/ops.js +16 -0
  96. package/dist/agent/ops.js.map +1 -0
  97. package/dist/agent/provider-events.d.ts +3 -0
  98. package/dist/agent/provider-events.d.ts.map +1 -0
  99. package/dist/agent/provider-events.js +112 -0
  100. package/dist/agent/provider-events.js.map +1 -0
  101. package/dist/agent/register.d.ts +4 -0
  102. package/dist/agent/register.d.ts.map +1 -0
  103. package/dist/agent/register.js +116 -0
  104. package/dist/agent/register.js.map +1 -0
  105. package/dist/agent/surface-parity.d.ts +3 -0
  106. package/dist/agent/surface-parity.d.ts.map +1 -0
  107. package/dist/agent/surface-parity.js +110 -0
  108. package/dist/agent/surface-parity.js.map +1 -0
  109. package/package.json +156 -4
  110. package/tsconfig.build.json +22 -0
  111. package/tsconfig.json +15 -0
@@ -0,0 +1,308 @@
1
+ import { shouldRotate, type SeatAdmissionFn, type SeatCatchUpRequest, type SeatCatchUpResult, type NormalizedWake, type WakeEngagementTier, type UnifiedWindowWake, type WakeTrust, type IngestedChatMessage, type WakeMessageInput, type SessionTailWakeRow } from "@open-everywhere/core/agent/adapter-api.js";
2
+ import { type OpenEverywhereGitHubAuth } from "./github-identity.js";
3
+ /** The reserved pseudo-thread sentinel for a supervisor generation (mirrors Slack's/Notion's). */
4
+ export declare function githubSupervisorSentinel(generation: number): string;
5
+ /** The reserved continuation token for a repo's supervisor session at a given generation:
6
+ * `github:<owner>/<repo>:oe-sup:g<generation>`. A custom continuation token eve never
7
+ * re-anchors, carrying the `:oe-sup:g` infix hooks/spend.ts + model/routing.ts key on. */
8
+ export declare function githubSupervisorToken(owner: string, repo: string, generation: number): string;
9
+ /** How the ambient leg treats one comment. By default a bot @mention is owned by eve's NATIVE
10
+ * githubChannel path (github.ts onComment), so the ambient leg `drop`s it and everything it keeps
11
+ * is `channel-watch` (judged by the repo supervisor). The `direct` value exists ONLY for the
12
+ * SINGLE-WINDOW path (github.ts passes `treatMentionAsDirect` for the GRAIN alone — the repo's
13
+ * domain has crossSurfaceWindow on — and passes the operator VOUCH beside it as the privacy floor,
14
+ * never the repo-private flag; see step 4 below): there the native mention session is suppressed,
15
+ * so the ambient leg keeps the @mention and routes it to the unified window as an ADDRESSED wake
16
+ * the shared-context supervisor answers. */
17
+ export type GitHubAmbientAddressing = "direct" | "channel-watch" | "drop";
18
+ export interface GitHubAmbientClassification {
19
+ readonly addressing: GitHubAmbientAddressing;
20
+ readonly reason: string;
21
+ }
22
+ /** The comment facts the classifier consumes — a narrow projection of the issue_comment
23
+ * webhook payload (the route leg extracts it; tests build it directly). */
24
+ export interface GitHubAmbientComment {
25
+ readonly body?: string;
26
+ readonly authorLogin?: string;
27
+ /** "User" | "Bot" | "Organization" — GitHub's `comment.user.type`. */
28
+ readonly authorType?: string;
29
+ /** Repo privacy, positively known (payload `repository.private`); absent → unknown. DEMOTED to
30
+ * a logged defense-in-depth SIGNAL: it no longer gates the cross-surface window (the operator
31
+ * vouch does) but still enables the per-repo ambient path (a private repo is invite-only). */
32
+ readonly repoPrivate?: boolean;
33
+ }
34
+ /**
35
+ * Decide how the ambient leg should treat one issue/PR-timeline comment, in cost order:
36
+ * 1. NO bot slug configured ⇒ DROP (fail closed) — self-identity is a precondition for the
37
+ * loop guard (the same hardening as Notion's unresolved-botUserId drop).
38
+ * 2. BOT-authored (`user.type === "Bot"`) ⇒ DROP — covers our own `<slug>[bot]` replies AND
39
+ * every other bot (prevents bot-to-bot loops).
40
+ * 3. Our own login (`<slug>[bot]`, belt-and-braces under a mislabelled type) ⇒ DROP.
41
+ * 4. @mentions the bot (githubBotMentioned — the native path's EXACT gate):
42
+ * • DEFAULT (per-repo) ⇒ DROP: the native githubChannel session owns mentions; the two legs
43
+ * partition, never overlap.
44
+ * • SINGLE-WINDOW (`treatMentionAsDirect`) on a VOUCHED repo ⇒ `direct`: github.ts
45
+ * suppresses the native session for exactly this case, so the ambient leg keeps the mention
46
+ * and the unified window answers it as an addressed wake. Still DROP on an un-vouched repo —
47
+ * the native path is NOT suppressed there (the gate on both sides is
48
+ * `singleWindow && vouched`, the OPERATOR VOUCH — NOT the repo-private flag), so letting
49
+ * ambient keep it would double-handle.
50
+ * 5. Repo neither positively private NOR operator-vouched ⇒ DROP (fail closed) — drive-by public
51
+ * repos never ambient-wake (strangers must not buy judged turns; see the header).
52
+ * 6. otherwise ⇒ channel-watch (judged by the standing repo supervisor).
53
+ *
54
+ * `opts.vouched` is the OPERATOR-VOUCH fact the caller resolves (github.ts: isVouchedInternal on
55
+ * `github/<owner>` OR `github/<owner>/<repo>`, or OE_TRUST=internal). It is the SOLE floor for the
56
+ * cross-surface WINDOW (step 4's `direct` divert) — the repo's own `repoPrivate` flag is a logged
57
+ * defense-in-depth SIGNAL, never a window gate. `repoPrivate` still enables the per-repo ambient
58
+ * path (step 5): a private repo is invite-only, so it ambient-wakes even un-vouched; the vouch
59
+ * WIDENS ambient to a vouched public repo, and never narrows an already-private one.
60
+ */
61
+ export declare function classifyGitHubAmbientComment(c: GitHubAmbientComment, botSlug: string | undefined, opts?: {
62
+ treatMentionAsDirect?: boolean;
63
+ vouched?: boolean;
64
+ }): GitHubAmbientClassification;
65
+ export interface GitHubSupervisorWakeInput {
66
+ readonly owner: string;
67
+ readonly repo: string;
68
+ /** The issue (or PR timeline) number the comment landed on — the reply anchor. */
69
+ readonly issueNumber: number;
70
+ /** The issue/PR title (untrusted, payload-supplied) — rendered as a wrapped context line so
71
+ * the judge knows WHAT conversation the comment belongs to. Absent ⇒ no context block. */
72
+ readonly issueTitle?: string;
73
+ /**
74
+ * THE DOMAIN'S ADMISSION POLICY over this wake's CONTEXT-LINE slot (OPE-1800), resolved by NAME by
75
+ * the caller (`seatAdmissionFor`, channels/seat-catch-up.ts) so this core stays config-free —
76
+ * exactly as `engagementTier` is. It judges the ONE line the slot holds: the issue/PR title.
77
+ * 🔴 THE SAME POLICY THE CATCH-UP READ ALREADY APPLIES, over the seat's OTHER read, off the SAME
78
+ * channel key. Since OPE-1857 the catch-up half does not pass a policy at all — `seatCatchUp`
79
+ * resolves the domain's own from `req.channelKey`, which is the key this caller spells here — so
80
+ * the two reads take one rule per domain from one resolver. The docs row promises that, and until
81
+ * OPE-1800 only the catch-up half delivered it.
82
+ * 🔴 THE TITLE LINE IS UNGRADED AND FLOORS AT `unauth`, by construction: this surface has no
83
+ * synchronous roster probe for the person who OPENED the issue, and the wake input carries no
84
+ * identity for them — the same reason `deps.catchUp` is wired with no `trustFor`. So a
85
+ * `members-only` domain reads the comment without the title, which is the fail-closed answer the
86
+ * seam's own header states; `wide` (the default) and `wide-with-bots` admit it unchanged.
87
+ * Absent ⇒ NO admission runs and the slot is byte-identical to the pre-OPE-1800 wake, which is
88
+ * what keeps an older test double compiling (the posture `catchUp` and `recordWake` take).
89
+ */
90
+ readonly admit?: SeatAdmissionFn;
91
+ readonly trigger: {
92
+ readonly id: string;
93
+ readonly authorLogin?: string;
94
+ readonly sentAt: string;
95
+ readonly text: string;
96
+ /**
97
+ * Resolved per-wake trust tier (identity/wake-trust.ts — the audit-wedge F3 assignment). The
98
+ * live dispatch (github.ts ambientDelivery) resolves it off the binding gate + admin rosters.
99
+ *
100
+ * 🔴 REQUIRED, NOT OPTIONAL (OPE-596) — see LinearSupervisorWakeInput.trigger.trust for the
101
+ * whole reason. An upward default is fail-OPEN, and since OPE-577 the tier decides the
102
+ * `<untrusted_external_data>` fence. A caller that cannot resolve a tier states the fail-closed
103
+ * one itself: `relay` for a machine author, `unauth` for an unvouchable human.
104
+ */
105
+ readonly trust: WakeTrust;
106
+ };
107
+ /** Engagement calibration (memory/domain.ts engagementTierFor — GitHub platform-defaults to
108
+ * `reserved`). Resolved by the caller; this core stays config-free. */
109
+ readonly engagementTier?: WakeEngagementTier;
110
+ /** The OUTGOING generation's recorded TAIL (OPE-794), rendered as this first wake's backscroll.
111
+ * Only a FRESH generation's first wake carries one; empty or omitted otherwise. */
112
+ readonly tail?: readonly WakeMessageInput[];
113
+ /** This surface could not read its own conversation since the seat's last wake (core
114
+ * channels/seat-catch-up.ts). Rendered as a trusted `<system-note>`; unset ⇒ no note. */
115
+ readonly catchUpUnavailable?: string;
116
+ /** Host-minted wake id (rendered `<wake wake-id=…>`) — SINGLE-WINDOW path only (channels/
117
+ * unified-window.ts): the id the model echoes to `reply` so the host resolves this wake's
118
+ * origin from the map. Unset ⇒ byte-identical (no attribute) — mirrors SlackWakeOpts.wakeId. */
119
+ readonly wakeId?: string;
120
+ /** SINGLE-WINDOW addressed @mention: render
121
+ * the wake as `direct-mention` — the full judged envelope (so the `wake-id` survives for the reply
122
+ * tool, which is the ONLY reply route on the unified channel) but with the ADDRESSED preamble that
123
+ * tells the supervisor it was @mentioned and owes a reply, instead of the silence-biased
124
+ * channel-watch preamble. Unset/false ⇒ the channel-watch ambient wake, byte-identical to today.
125
+ * Only github.ts's single-window direct path sets it (the classifier returned `direct`). */
126
+ readonly directMention?: boolean;
127
+ /**
128
+ * This issue/PR carries an ENGAGED registry row that reaches the seat — the seam's `deliver`
129
+ * verdict floored on `githubEngagedFollowUpReach` (github.ts `engagedFollowUp`). A JUDGED
130
+ * wake then states `follow-up="thread-engaged"`, the envelope's own words for "you are already in
131
+ * this conversation and `stand_down` is how you leave". Slack, Linear and Notion state the same
132
+ * fact through the same shared helper (channels/engaged-wake.ts).
133
+ *
134
+ * 🔴 THE AUDIT ROW ALREADY SAID IT AND THE ENVELOPE DID NOT (OPE-2093). `github.dispatched` reads
135
+ * `addressing=thread-follow` off this verdict (OPE-1752) while the seat read bare ambient
136
+ * activity, so it declined an engaged follow-up with `no_reply` (ship #237, J-ENGAGED-github).
137
+ * It does NOT touch `addressing`: an @mention stays `direct-mention` and carries no follow-up
138
+ * attribute, because it is owed an answer whatever the enrolment says. Unset/false ⇒ no attribute.
139
+ */
140
+ readonly threadEngaged?: boolean;
141
+ }
142
+ /**
143
+ * Build the NormalizedWake for one repo-supervisor turn: platform "github", containerNoun
144
+ * "repo", locus.channel = `owner/repo`, locus.thread = `#<issueNumber>` (the conversation the
145
+ * comment belongs to), the issue title as an untrusted-wrapped context line, and the comment as
146
+ * the trigger. `channel-watch` (judged) by default; `direct-mention` (addressed, enveloped) when
147
+ * `directMention` is set — the SINGLE-WINDOW @mention path, which keeps the wake-id envelope but
148
+ * swaps the silence-biased watch preamble for the addressed one (see the field doc). renderWake
149
+ * then emits the exact `{message, context}` every OE dispatch sends — the SAME renderer
150
+ * Slack/Notion use, with NO platform branch.
151
+ */
152
+ export declare function buildGitHubSupervisorWake(input: GitHubSupervisorWakeInput): NormalizedWake;
153
+ /** The narrow projection of an `issue_comment` webhook payload the ambient leg consumes —
154
+ * classifier facts + wake parts + identity facts, extracted defensively (GitHub payloads are
155
+ * external input; anything missing/odd → the fact stays undefined and the consumers fail
156
+ * closed). Review-thread inline comments (`pull_request_review_comment`) are deliberately NOT
157
+ * ambient v1 — a different reply endpoint/threading model; the extractor returns null. */
158
+ export interface GitHubAmbientEvent {
159
+ readonly owner: string;
160
+ readonly repo: string;
161
+ readonly repositoryFullName?: string;
162
+ readonly repositoryId?: number;
163
+ readonly repoPrivate?: boolean;
164
+ readonly installationId?: number;
165
+ readonly issueNumber: number;
166
+ readonly issueTitle?: string;
167
+ /** True when the timeline comment is on a PR (issue_comment fires for both). */
168
+ readonly isPullRequest: boolean;
169
+ readonly comment: GitHubAmbientComment & {
170
+ readonly id?: string;
171
+ readonly createdAt?: string;
172
+ readonly authorId?: number;
173
+ readonly authorAssociation?: string;
174
+ };
175
+ }
176
+ /** The taint-clean identity fields on one admitted ambient dispatch audit row. */
177
+ export declare function githubDispatchAuditDetail(input: {
178
+ readonly addressing: string;
179
+ readonly issueNumber: number;
180
+ readonly commentId?: string;
181
+ readonly wakeId?: string;
182
+ readonly repoPrivate: boolean;
183
+ readonly vouched: boolean;
184
+ }): Readonly<Record<string, unknown>>;
185
+ /**
186
+ * Extract the ambient-leg facts from one webhook delivery, or null when the delivery is not an
187
+ * ambient candidate at all: only `issue_comment` + `action: "created"` qualifies (edits/deletes
188
+ * are not conversational triggers v1; review-thread comments are out of scope v1 — see
189
+ * {@link GitHubAmbientEvent}). Null is "not for this leg", NOT an error — the native mention
190
+ * path and the routine fan-out see every delivery regardless.
191
+ */
192
+ export declare function extractGitHubAmbientEvent(eventType: string, payload: Record<string, unknown>): GitHubAmbientEvent | null;
193
+ /** The live supervisor session pointer for a repo, as the deps report it (mirrors
194
+ * NotionSupervisorSession). `freshGeneration` = brand-new OR just-rotated. */
195
+ export interface GitHubSupervisorSession {
196
+ readonly token: string;
197
+ readonly generation: number;
198
+ readonly freshGeneration: boolean;
199
+ /** ISO-8601 of the most recent wake this generation delivered (the registry row's `lastWakeAt`),
200
+ * or null on a freshly minted/rotated generation. The lower bound of the since-last-wake catch-up
201
+ * read (OPE-1695 (b), brought to this surface by OPE-1726); absent ⇒ no catch-up. */
202
+ readonly lastWakeAt?: string | null;
203
+ /** The OUTGOING generation's recorded tail, oldest-first — empty unless this is a fresh
204
+ * generation's first wake (OPE-794). */
205
+ readonly tail: readonly WakeMessageInput[];
206
+ }
207
+ /** Deps for {@link handleGitHubSupervisorDispatch} — mirror NotionSupervisorDeps, injected so
208
+ * the core is unit-testable over a mock store + a capture `wake`. The eve-typed session STATE
209
+ * is built by the wiring (github.ts), not here — this core stays eve-free. */
210
+ export interface GitHubSupervisorDeps {
211
+ /** Create-or-fetch the live supervisor session for this repo's surfaceKey: mint generation 1
212
+ * on first sighting, rotate to generation+1 when {@link shouldRotate} says it aged out, else
213
+ * return the current generation. */
214
+ readonly getOrCreateSession: (surfaceKey: string, owner: string, repo: string, atIso: string) => Promise<GitHubSupervisorSession>;
215
+ /** Record one wake on the current generation (lastWakeAt/turnCount). Best-effort. */
216
+ readonly touchSession?: (surfaceKey: string, atIso: string) => Promise<void>;
217
+ /**
218
+ * Record this delivered wake onto the LIVE generation's TAIL ring (OPE-794). Injected because the
219
+ * entry has to be filed under an ORG and a registry key, and this core deliberately holds neither
220
+ * — the live wiring does. Absent (a unit test) ⇒ nothing is recorded and the dispatch is
221
+ * unchanged, which is the same posture `touchSession` takes.
222
+ */
223
+ readonly recordWake?: (entry: SessionTailWakeRow, token: string, surfaceKey: string) => Promise<void>;
224
+ /** Start/continue the supervisor session under its reserved token, posting the rendered wake.
225
+ * The wiring closes over the channel `send` and builds the eve-typed supervisor state.
226
+ * `window` is present ONLY on the SINGLE-WINDOW path (dispatch input carried it): the wiring
227
+ * then DIVERTS the wake through eve's cross-channel `receive` into the synthetic `unified`
228
+ * channel (github.ts). Absent ⇒ this channel's own send, byte-identical. */
229
+ readonly wake: (input: {
230
+ token: string;
231
+ auth: OpenEverywhereGitHubAuth;
232
+ message: string;
233
+ context: readonly string[];
234
+ window?: UnifiedWindowWake;
235
+ }) => Promise<void>;
236
+ /**
237
+ * THE SINCE-LAST-WAKE CATCH-UP, through the ONE shared path every surface takes
238
+ * (channels/seat-catch-up.ts `seatCatchUp`). Optional so older test doubles keep compiling
239
+ * (absent ⇒ no catch-up, the pre-OPE-1726 behaviour); fail-soft by construction.
240
+ */
241
+ readonly catchUp?: (req: SeatCatchUpRequest) => Promise<SeatCatchUpResult>;
242
+ /** Clock seam (defaults to the real clock). */
243
+ readonly now?: () => string;
244
+ }
245
+ /** Everything github.ts hands the supervisor dispatch: the wake parts + identity/session facts.
246
+ * Built by the route leg AFTER the ambient gate + classifier kept the comment. */
247
+ export interface GitHubSupervisorDispatch {
248
+ readonly surfaceKey: string;
249
+ readonly owner: string;
250
+ readonly repo: string;
251
+ readonly issueNumber: number;
252
+ readonly issueTitle?: string;
253
+ readonly auth: OpenEverywhereGitHubAuth;
254
+ /**
255
+ * THE CHAT NON-MEMBER TAINT CARRIAGE input (OPE-494 / OPE-466): the author facts for every
256
+ * message whose bytes enter this wake's context. GitHub sends one comment per wake, so the route
257
+ * leg passes exactly one entry — `githubAuthorFacts` over the free `author_association`.
258
+ *
259
+ * 🔴 REQUIRED, NOT OPTIONAL, and for the reason `stampNonMemberChatAuth` makes its own `room`
260
+ * argument required: an optional field lets a new leg silently lose the author question, and a
261
+ * carriage that is absent looks identical to a carriage that answered "member". A leg with
262
+ * genuinely nothing to say passes `[]` and says so on purpose.
263
+ */
264
+ readonly ingested: readonly IngestedChatMessage[];
265
+ readonly trigger: GitHubSupervisorWakeInput["trigger"];
266
+ /**
267
+ * The domain's admission policy for this surface's context-line slot, resolved by the route leg
268
+ * off the SAME channel key `deps.catchUp` resolves its own from. See
269
+ * {@link GitHubSupervisorWakeInput.admit}.
270
+ * 🔴 REQUIRED, NOT OPTIONAL, and for the reason `ingested` above is: an optional field lets a
271
+ * SECOND route leg compile with the slot unpoliced, and an absent policy looks identical to a
272
+ * policy that admitted. The builder's own `admit` stays optional — that keeps this core
273
+ * config-free for a pure caller — so `required here, optional there` is the whole guard.
274
+ */
275
+ readonly admit: SeatAdmissionFn;
276
+ /** Engagement calibration tier (resolved by the route leg; fail-soft neutral). */
277
+ readonly engagementTier?: WakeEngagementTier;
278
+ /** UNIFIED cross-surface grain resolved by the route leg (supervisorGrainFor, fail-soft false) —
279
+ * stamps the wake's platform address + P5 disclosure. Unset ⇒ byte-identical per-repo wake. */
280
+ readonly unified?: boolean;
281
+ /** SINGLE-WINDOW wake plumbing, minted by the route leg when the grain says `singleWindow`
282
+ * (channels/unified-window.ts): the wakeId is rendered into the envelope by this core; the
283
+ * whole object is passed through to deps.wake, whose wiring registers the map entry and
284
+ * diverts into the unified channel. Unset ⇒ byte-identical. */
285
+ readonly window?: UnifiedWindowWake;
286
+ /** SINGLE-WINDOW addressed @mention (the classifier returned `direct`): render the wake as the
287
+ * addressed `direct-mention` variant (envelope kept, watch-preamble swapped for the addressed
288
+ * one) so the shared-context supervisor answers it. Unset ⇒ the channel-watch ambient wake,
289
+ * byte-identical. See {@link GitHubSupervisorWakeInput.directMention}. */
290
+ readonly directMention?: boolean;
291
+ /** The seam's enrolment verdict for this issue/PR (github.ts `admission.engagedFollowUp`) — the
292
+ * SAME value the `github.dispatched` row promotes to `thread-follow`. Rendered as
293
+ * `follow-up="thread-engaged"` on a judged wake. See {@link GitHubSupervisorWakeInput.threadEngaged}. */
294
+ readonly threadEngaged?: boolean;
295
+ }
296
+ /**
297
+ * Route one kept comment to the repo supervisor: get-or-create the session, build + render the
298
+ * wake for that generation, and deliver it.
299
+ *
300
+ * A DELIVERY failure (the send itself) propagates to the caller's catch. A session that dies at
301
+ * TURN time does not: nothing here observes it, so the trigger is lost SILENTLY, and no reactive
302
+ * arm can exist (OPE-174 removed the inert one; channels/session-resume.ts holds the measurement).
303
+ * The working remedy is PRE-DISPATCH — the live `getOrCreateSession` claims the OPE-599
304
+ * runtime-change rotation before this call and hands back a session the running eve build can read.
305
+ */
306
+ export declare function handleGitHubSupervisorDispatch(d: GitHubSupervisorDispatch, deps: GitHubSupervisorDeps): Promise<void>;
307
+ export { shouldRotate };
308
+ //# sourceMappingURL=github-supervisor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-supervisor.d.ts","sourceRoot":"","sources":["../../../agent/channels/github-supervisor.ts"],"names":[],"mappings":"AAqCA,OAAO,EAGL,YAAY,EAMZ,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAsB,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAgBzF,kGAAkG;AAClG,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;2FAE2F;AAC3F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7F;AAgBD;;;;;;;6CAO6C;AAC7C,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,CAAC;AAE1E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;4EAC4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,sEAAsE;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;mGAE+F;IAC/F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,4BAA4B,CAC1C,CAAC,EAA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