@dahrk/linear 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -12
- package/dist/comments.d.ts +36 -0
- package/dist/comments.d.ts.map +1 -0
- package/dist/comments.js +104 -0
- package/dist/comments.js.map +1 -0
- package/dist/documents.d.ts +1 -15
- package/dist/documents.d.ts.map +1 -1
- package/dist/documents.js +37 -27
- package/dist/documents.js.map +1 -1
- package/dist/format-action.d.ts +25 -0
- package/dist/format-action.d.ts.map +1 -0
- package/dist/format-action.js +250 -0
- package/dist/format-action.js.map +1 -0
- package/dist/index.d.ts +113 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +182 -58
- package/dist/index.js.map +1 -1
- package/dist/issue-graph.d.ts +37 -0
- package/dist/issue-graph.d.ts.map +1 -0
- package/dist/issue-graph.js +125 -0
- package/dist/issue-graph.js.map +1 -0
- package/dist/issues.d.ts +3 -2
- package/dist/issues.d.ts.map +1 -1
- package/dist/issues.js +5 -10
- package/dist/issues.js.map +1 -1
- package/dist/labels.d.ts +47 -0
- package/dist/labels.d.ts.map +1 -1
- package/dist/labels.js +71 -23
- package/dist/labels.js.map +1 -1
- package/dist/linear-client.d.ts +51 -0
- package/dist/linear-client.d.ts.map +1 -1
- package/dist/linear-client.js +234 -34
- package/dist/linear-client.js.map +1 -1
- package/dist/oauth.d.ts +11 -10
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +35 -32
- package/dist/oauth.js.map +1 -1
- package/dist/recording-client.d.ts +20 -2
- package/dist/recording-client.d.ts.map +1 -1
- package/dist/recording-client.js +39 -1
- package/dist/recording-client.js.map +1 -1
- package/dist/responding-client.d.ts +49 -0
- package/dist/responding-client.d.ts.map +1 -0
- package/dist/responding-client.js +47 -0
- package/dist/responding-client.js.map +1 -0
- package/dist/teams.d.ts +20 -0
- package/dist/teams.d.ts.map +1 -0
- package/dist/teams.js +32 -0
- package/dist/teams.js.map +1 -0
- package/package.json +8 -10
- package/src/comments.ts +126 -0
- package/src/documents.ts +162 -0
- package/src/format-action.ts +279 -0
- package/src/index.ts +556 -0
- package/src/issue-graph.ts +169 -0
- package/src/issues.ts +93 -0
- package/src/labels.ts +254 -0
- package/src/linear-client.ts +449 -0
- package/src/oauth.ts +194 -0
- package/src/recording-client.ts +141 -0
- package/src/responding-client.ts +106 -0
- package/src/teams.ts +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-action.js","sourceRoot":"","sources":["../src/format-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,4FAA4F;AAC5F,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,mGAAmG;AACnG,SAAS,IAAI,CAAC,CAAS,EAAE,GAAG,GAAG,SAAS;IACtC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,OAAO,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC;AACnE,CAAC;AAED,+FAA+F;AAC/F,SAAS,QAAQ,CAAC,CAAS;IACzB,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACjD,CAAC;AAED;0EAC0E;AAC1E,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,CACL,IAAI;SACD,OAAO,CAAC,QAAQ,EAAE,GAAG,C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AAO,OAAO,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAwB,EAAE,MAA0B;IACnF,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IACtC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAElC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChC,KAAK,MAAM;YACT,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChC,KAAK,MAAM;YACT,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChC,KAAK,MAAM,CAAC;QACZ,KAAK,WAAW,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChC;YACE,uEAAuE;YACvE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @dahrk/linear - the Linear-native control surface (build spec section 14).
|
|
3
|
+
*
|
|
4
|
+
* Two responsibilities:
|
|
5
|
+
* 1. Intake-side (used by the hub): verify the webhook signature, and normalise a
|
|
6
|
+
* raw Linear webhook into the internal LinearEvent. tenantId/workspaceId are
|
|
7
|
+
* resolved from the authenticated connection, never from the payload.
|
|
8
|
+
* 2. Session-side (used by hub + edge): drive the Agent Session API natively -
|
|
9
|
+
* post activities (thought/action/response), render the stage graph as the
|
|
10
|
+
* agent-plan checklist, raise elicitation gates, take prompted-drive turns,
|
|
11
|
+
* handle the stop signal, set externalUrls.
|
|
12
|
+
*
|
|
13
|
+
* Re-implemented directly against the Agent Session API; cyrus's posting code is a
|
|
14
|
+
* reference, not a dependency. Intended runtime dep: the Linear TypeScript SDK
|
|
15
|
+
* (added at M2/M5).
|
|
16
|
+
*/
|
|
1
17
|
import type { LinearEvent } from "@dahrk/contracts";
|
|
18
|
+
import type { LinearWebhookPayload } from "@linear/sdk/webhooks";
|
|
2
19
|
/**
|
|
3
|
-
* Verify a Linear webhook signature and return the parsed
|
|
4
|
-
*
|
|
5
|
-
*
|
|
20
|
+
* Verify a Linear webhook signature and timestamp freshness, then return the parsed
|
|
21
|
+
* payload, or throw. Delegates to LinearWebhookClient.parseData which uses
|
|
22
|
+
* HMAC-SHA256 + timingSafeEqual. The webhookTimestamp field is extracted from the
|
|
23
|
+
* raw body so the SDK's built-in ±60 s replay window applies; a missing or
|
|
24
|
+
* non-numeric timestamp skips the freshness check. Throws "Invalid webhook
|
|
25
|
+
* signature" on bad HMAC and "Invalid webhook timestamp" on a stale delivery.
|
|
6
26
|
*/
|
|
7
27
|
export declare function verifyWebhook(rawBody: Buffer, signature: string, secret: string): unknown;
|
|
8
28
|
/**
|
|
@@ -11,16 +31,49 @@ export declare function verifyWebhook(rawBody: Buffer, signature: string, secret
|
|
|
11
31
|
* connection's registered set. `tenantId` is supplied by the caller from the owning
|
|
12
32
|
* Connection (the single source of truth for a workspace's tenant), never inferred here.
|
|
13
33
|
*/
|
|
14
|
-
export declare function normalise(payload:
|
|
34
|
+
export declare function normalise(payload: LinearWebhookPayload, connectionId: string, tenantId: string): LinearEvent;
|
|
15
35
|
/** A Linear agent-session state, mirrored from the engine's run-state (build spec section 14). */
|
|
16
36
|
export type SessionState = "active" | "awaitingInput" | "complete" | "error";
|
|
17
37
|
/** An activity kind posted to the session. `error` rides the same surface as a thought. */
|
|
18
38
|
export type ActivityType = "thought" | "action" | "response" | "error";
|
|
39
|
+
/** The result of `startIssue`, so a caller can SEE a no-op/failed state move rather than have it
|
|
40
|
+
* silently swallowed (a silent no-op is why the ticket sat in Backlog for a whole run). `moved`
|
|
41
|
+
* is true only when the issue was actually transitioned into a working state; otherwise `reason`
|
|
42
|
+
* says why not (a benign skip like `already-active` vs a real failure like `no-started-state`). */
|
|
43
|
+
export type StartIssueOutcome = {
|
|
44
|
+
moved: true;
|
|
45
|
+
stateName: string;
|
|
46
|
+
} | {
|
|
47
|
+
moved: false;
|
|
48
|
+
reason: StartIssueSkip;
|
|
49
|
+
};
|
|
50
|
+
/** Why `startIssue` did not move the issue. The first two are benign (nothing to do); the rest are
|
|
51
|
+
* failures a caller should surface. */
|
|
52
|
+
export type StartIssueSkip = "no-issue" | "already-active" | "no-team" | "no-started-state" | "update-failed";
|
|
53
|
+
/** The result of `moveIssueToReview` (DHK-283), so a caller can SEE a no-op instead of the ticket
|
|
54
|
+
* silently sitting In Progress. `moved` is true only when the issue was actually transitioned into a
|
|
55
|
+
* review state; otherwise `reason` says why not - benign (`already-there`, e.g. a closed issue or one
|
|
56
|
+
* already in the review state) vs a real gap (`no-review-state`: this team has no state named
|
|
57
|
+
* review/in review/qa and `SKAKEL_REVIEW_STATE_NAME` is unset/unmatched). */
|
|
58
|
+
export type MoveToReviewOutcome = {
|
|
59
|
+
moved: true;
|
|
60
|
+
stateName: string;
|
|
61
|
+
} | {
|
|
62
|
+
moved: false;
|
|
63
|
+
reason: MoveToReviewSkip;
|
|
64
|
+
};
|
|
65
|
+
/** Why `moveIssueToReview` did not move the issue. `no-issue`/`already-there` are benign; the rest are
|
|
66
|
+
* gaps a caller should surface as a visible thought. */
|
|
67
|
+
export type MoveToReviewSkip = "no-issue" | "already-there" | "no-team" | "no-review-state" | "update-failed";
|
|
19
68
|
export interface Activity {
|
|
20
69
|
type: ActivityType;
|
|
21
70
|
text: string;
|
|
22
71
|
/** For `action` activities, the tool name. */
|
|
23
72
|
tool?: string;
|
|
73
|
+
/** For `action` activities, the tool's outcome folded under the call (markdown, DHK-385). Set once
|
|
74
|
+
* the call completes so the step reads as one self-contained activity: verb + parameter on top,
|
|
75
|
+
* result underneath. Ignored for non-action types. */
|
|
76
|
+
result?: string;
|
|
24
77
|
/** thought/action only: a transient state, replaced in the UI by the next activity. */
|
|
25
78
|
ephemeral?: boolean;
|
|
26
79
|
}
|
|
@@ -55,6 +108,26 @@ export interface AuthRequest {
|
|
|
55
108
|
userId?: string;
|
|
56
109
|
providerName?: string;
|
|
57
110
|
}
|
|
111
|
+
/** A Linear workflow-state category. Mirrors the `type` field on a `WorkflowState`. */
|
|
112
|
+
export type IssueStateType = "triage" | "backlog" | "unstarted" | "started" | "completed" | "canceled";
|
|
113
|
+
/** The disengagement ground truth for one Linear issue, read live off the API (DHK-*: stuck
|
|
114
|
+
* awaitingInput backstop). Only the fields the disengagement predicate needs are carried; an issue
|
|
115
|
+
* ABSENT from a `readIssueEngagement` result (hard-deleted) is represented by the map having no
|
|
116
|
+
* entry, not by a value here, so `present` is always true when an `IssueEngagement` exists. */
|
|
117
|
+
export interface IssueEngagement {
|
|
118
|
+
/** Always true for a returned issue; the "not present" (deleted) case is a missing map entry. */
|
|
119
|
+
present: boolean;
|
|
120
|
+
/** The issue has been archived (soft-deleted). Read from `archivedAt`; archived issues are still
|
|
121
|
+
* returned because the read requests `includeArchived`. */
|
|
122
|
+
archived: boolean;
|
|
123
|
+
/** The issue's current workflow-state category (`state.type`), when known. */
|
|
124
|
+
stateType?: IssueStateType;
|
|
125
|
+
/** The current assignee's user id, when set. */
|
|
126
|
+
assigneeId?: string;
|
|
127
|
+
/** The current delegated agent-user id (`delegateId`), when set. For an agent, engagement is
|
|
128
|
+
* delegation, not assignment, so this is the primary identity to test against the app user. */
|
|
129
|
+
delegateId?: string;
|
|
130
|
+
}
|
|
58
131
|
/** A pull request to attach to the session's issue (idempotent by `url`). */
|
|
59
132
|
export interface PrAttachment {
|
|
60
133
|
url: string;
|
|
@@ -105,12 +178,16 @@ export interface AgentSessionClient {
|
|
|
105
178
|
addIssueLabel(issueId: string, name: string): Promise<void>;
|
|
106
179
|
/** Raise an account-linking elicitation carrying the `auth` signal (credential-plane seam). */
|
|
107
180
|
requestAuth(sessionId: string, prompt: string, auth: AuthRequest): Promise<void>;
|
|
108
|
-
/** Move the session's issue
|
|
109
|
-
|
|
181
|
+
/** Move the session's issue into its team's working (`started`, non-review) state and self-delegate
|
|
182
|
+
* (best practice on delegation). Returns an outcome so a caller can surface a no-op/failed move
|
|
183
|
+
* instead of it vanishing (see `StartIssueOutcome`). */
|
|
184
|
+
startIssue(sessionId: string): Promise<StartIssueOutcome>;
|
|
110
185
|
/** Move the session's issue to a review-named state on run completion (configurable via
|
|
111
186
|
* `SKAKEL_REVIEW_STATE_NAME`). Leaves it unchanged when no such state exists - never
|
|
112
|
-
* auto-completes, so a human keeps iterating and can re-summon @
|
|
113
|
-
|
|
187
|
+
* auto-completes, so a human keeps iterating and can re-summon @Dahrk on the same PR. Returns an
|
|
188
|
+
* outcome so a caller can surface a no-op (no matching state) rather than have the ticket silently
|
|
189
|
+
* stay In Progress (see `MoveToReviewOutcome`). */
|
|
190
|
+
moveIssueToReview(sessionId: string): Promise<MoveToReviewOutcome>;
|
|
114
191
|
/** Post a normal top-level comment on the session's issue (not an agent activity), so a run
|
|
115
192
|
* summary lands in the issue's comment thread rather than only in the agent session panel. */
|
|
116
193
|
commentOnIssue(sessionId: string, body: string): Promise<void>;
|
|
@@ -125,16 +202,41 @@ export interface AgentSessionClient {
|
|
|
125
202
|
setExternalUrls(sessionId: string, urls: ExternalUrl[]): Promise<void>;
|
|
126
203
|
/** Mirror the run-state to the Linear session state. */
|
|
127
204
|
setState(sessionId: string, state: SessionState): Promise<void>;
|
|
205
|
+
/** Read disengagement ground truth for a batch of issues in one query (rate-limit friendly; the
|
|
206
|
+
* read includes archived issues). The result maps issue id -> `IssueEngagement`; an issue id that
|
|
207
|
+
* is absent from the result was not returned by Linear (hard-deleted). Used by the disengagement
|
|
208
|
+
* sweep and webhook path to decide whether @Dahrk is still engaged on an issue. */
|
|
209
|
+
readIssueEngagement(issueIds: string[]): Promise<Map<string, IssueEngagement>>;
|
|
210
|
+
/** The app user's own id (`viewer.id`) - the id @Dahrk self-delegates to on `startIssue`. Cached.
|
|
211
|
+
* This is the identity a run's issue must still delegate/assign to for the agent to be "engaged". */
|
|
212
|
+
appUserId(): Promise<string>;
|
|
213
|
+
/** Proactively create an agent session ON an issue (DHK-63): the hub was neither delegated nor
|
|
214
|
+
* @mentioned but has useful work to do (a triage/SLA pre-brief). Returns the new session id so the
|
|
215
|
+
* caller can bind a run to it. Wraps Linear's `agentSessionCreateOnIssue`. */
|
|
216
|
+
createSessionOnIssue(issueId: string): Promise<string>;
|
|
217
|
+
/** Proactively create an agent session ON a comment (DHK-63): the comment analogue of
|
|
218
|
+
* `createSessionOnIssue`. Returns the new session id. Wraps `agentSessionCreateOnComment`. */
|
|
219
|
+
createSessionOnComment(commentId: string): Promise<string>;
|
|
128
220
|
}
|
|
221
|
+
export type { LinearWebhookPayload } from "@linear/sdk/webhooks";
|
|
129
222
|
export { createRecordingClient } from "./recording-client.js";
|
|
130
|
-
export type { RecordingClient, RecordedCall } from "./recording-client.js";
|
|
223
|
+
export type { RecordingClient, RecordedCall, RecordingClientOptions } from "./recording-client.js";
|
|
224
|
+
export { createRespondingLinearClient } from "./responding-client.js";
|
|
225
|
+
export type { RespondingClient, RespondingClientOptions, SessionProjection, GateDecision, } from "./responding-client.js";
|
|
131
226
|
export { createLinearClient } from "./linear-client.js";
|
|
227
|
+
export { formatToolAction, formatToolResult, type ToolAction } from "./format-action.js";
|
|
132
228
|
export { authorizeUrl, exchangeCode, refreshTokens, mintAppToken, fetchOrganizationId, probeToken, DEFAULT_AGENT_SCOPES } from "./oauth.js";
|
|
133
229
|
export type { LinearTokens, LinearProbe } from "./oauth.js";
|
|
134
|
-
export { provisionLabels, provisionWorkflowLabels, provisionRepoLabels, linearLabelApi, projectLabelApi, fetchIssueProjectRepoLabels, REPO_LABEL_GROUP, } from "./labels.js";
|
|
135
|
-
export type { LabelApi, ProvisionOptions } from "./labels.js";
|
|
230
|
+
export { provisionLabels, provisionWorkflowLabels, provisionRepoLabels, linearLabelApi, projectLabelApi, fetchIssueProjectRepoLabels, fetchIssueChildCount, fetchOpenBlockers, isBlockerSettled, REPO_LABEL_GROUP, } from "./labels.js";
|
|
231
|
+
export type { LabelApi, ProvisionOptions, OpenBlocker } from "./labels.js";
|
|
232
|
+
export { linearTeamsApi, listWorkspaceTeams } from "./teams.js";
|
|
233
|
+
export type { Team, TeamsApi } from "./teams.js";
|
|
136
234
|
export { linearTriageApi, linearClientAuth } from "./issues.js";
|
|
137
235
|
export type { TriageApi } from "./issues.js";
|
|
138
236
|
export { fetchAttachedDocuments, collectAttachedDocuments, linearDocumentSource, documentSlugFromUrl, documentSlug, } from "./documents.js";
|
|
139
237
|
export type { DocumentSource, RawDocument } from "./documents.js";
|
|
238
|
+
export { fetchIssueComments, collectIssueComments, linearCommentSource } from "./comments.js";
|
|
239
|
+
export type { CommentSource, RawComment } from "./comments.js";
|
|
240
|
+
export { fetchRelatedIssues, collectRelatedIssues, linearIssueGraphSource, MAX_RELATED_ISSUES, } from "./issue-graph.js";
|
|
241
|
+
export type { IssueGraphSource, RawEdge, RawRelatedIssue } from "./issue-graph.js";
|
|
140
242
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAgBzF;AA6CD;;;;;GAKG;A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E,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC9F,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,66 @@
|
|
|
1
|
+
import { LinearWebhookClient } from "@linear/sdk/webhooks";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 2. Session-side (used by hub + edge): drive the Agent Session API natively -
|
|
9
|
-
* post activities (thought/action/response), render the stage graph as the
|
|
10
|
-
* agent-plan checklist, raise elicitation gates, take prompted-drive turns,
|
|
11
|
-
* handle the stop signal, set externalUrls.
|
|
12
|
-
*
|
|
13
|
-
* Re-implemented directly against the Agent Session API; cyrus's posting code is a
|
|
14
|
-
* reference, not a dependency. Intended runtime dep: the Linear TypeScript SDK
|
|
15
|
-
* (added at M2/M5).
|
|
16
|
-
*/
|
|
17
|
-
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
18
|
-
/**
|
|
19
|
-
* Verify a Linear webhook signature and return the parsed payload, or throw.
|
|
20
|
-
* Linear signs the raw request body with HMAC-SHA256 (hex) under the connection's
|
|
21
|
-
* webhook secret; we recompute and compare in constant time over the raw bytes.
|
|
3
|
+
* Verify a Linear webhook signature and timestamp freshness, then return the parsed
|
|
4
|
+
* payload, or throw. Delegates to LinearWebhookClient.parseData which uses
|
|
5
|
+
* HMAC-SHA256 + timingSafeEqual. The webhookTimestamp field is extracted from the
|
|
6
|
+
* raw body so the SDK's built-in ±60 s replay window applies; a missing or
|
|
7
|
+
* non-numeric timestamp skips the freshness check. Throws "Invalid webhook
|
|
8
|
+
* signature" on bad HMAC and "Invalid webhook timestamp" on a stale delivery.
|
|
22
9
|
*/
|
|
23
10
|
export function verifyWebhook(rawBody, signature, secret) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
// Extract webhookTimestamp so parseData can enforce the ±60 s replay window.
|
|
12
|
+
// If the body is not valid JSON or the field is absent, we omit the argument and
|
|
13
|
+
// parseData skips the check (same as a missing timestamp in the old hand-rolled path).
|
|
14
|
+
let ts;
|
|
15
|
+
try {
|
|
16
|
+
const raw = JSON.parse(rawBody.toString("utf8")).webhookTimestamp;
|
|
17
|
+
if (typeof raw === "number")
|
|
18
|
+
ts = raw;
|
|
19
|
+
else if (typeof raw === "string") {
|
|
20
|
+
const n = Number(raw);
|
|
21
|
+
if (Number.isFinite(n))
|
|
22
|
+
ts = n;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
/* non-JSON body – parseData will re-parse and also throw */
|
|
28
27
|
}
|
|
29
|
-
return
|
|
28
|
+
return new LinearWebhookClient(secret).parseData(rawBody, signature, ts);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Strip a leading @mention token from a triggering comment body (DHK-322), returning the bare
|
|
32
|
+
* instruction (trimmed). Two spellings are handled: a plain-text `@name` prefix (the structured
|
|
33
|
+
* `agentSession.comment.body` form) and a leading Linear `<user id="...">name</user>` element (the
|
|
34
|
+
* `promptContext` primary-directive-thread form). A body that is only the mention yields "". Pure, so
|
|
35
|
+
* the instruction parsing is unit-testable and free of an LLM.
|
|
36
|
+
*/
|
|
37
|
+
function stripLeadingMention(body) {
|
|
38
|
+
let text = body.replace(/^\s+/, "");
|
|
39
|
+
const userMatch = /^<user\b[^>]*>[\s\S]*?<\/user>/.exec(text);
|
|
40
|
+
if (userMatch)
|
|
41
|
+
text = text.slice(userMatch[0].length);
|
|
42
|
+
else
|
|
43
|
+
text = text.replace(/^@\S+/, "");
|
|
44
|
+
return text.trim();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse the triggering comment out of a `promptContext` primary-directive-thread (DHK-322): the
|
|
48
|
+
* `comment-id` attribute plus the last `<comment>` body (the triggering message), with its leading
|
|
49
|
+
* mention stripped. The fallback path when the webhook carries no structured `agentSession.comment`.
|
|
50
|
+
* Pure.
|
|
51
|
+
*/
|
|
52
|
+
function directiveFromPromptContext(promptContext) {
|
|
53
|
+
const block = /<primary-directive-thread\b([^>]*)>([\s\S]*?)<\/primary-directive-thread>/.exec(promptContext);
|
|
54
|
+
if (!block)
|
|
55
|
+
return {};
|
|
56
|
+
const commentId = /\bcomment-id="([^"]*)"/.exec(block[1] ?? "")?.[1]?.trim();
|
|
57
|
+
const comments = [...(block[2] ?? "").matchAll(/<comment\b[^>]*>([\s\S]*?)<\/comment>/g)];
|
|
58
|
+
const lastBody = comments.at(-1)?.[1];
|
|
59
|
+
const instruction = lastBody !== undefined ? stripLeadingMention(lastBody) : undefined;
|
|
60
|
+
return {
|
|
61
|
+
...(commentId ? { commentId } : {}),
|
|
62
|
+
...(instruction ? { instruction } : {}),
|
|
63
|
+
};
|
|
30
64
|
}
|
|
31
65
|
/** Fixed 👍/👎 -> sentiment lookup. A reaction's sentiment comes from this table, never an LLM, so the
|
|
32
66
|
* determinism boundary holds. Returns undefined for any emoji we do not treat as feedback. */
|
|
@@ -46,24 +80,48 @@ function reactionSentiment(emoji) {
|
|
|
46
80
|
* Connection (the single source of truth for a workspace's tenant), never inferred here.
|
|
47
81
|
*/
|
|
48
82
|
export function normalise(payload, connectionId, tenantId) {
|
|
49
|
-
const
|
|
50
|
-
const ts = typeof p.webhookTimestamp === "string" ? p.webhookTimestamp : "1970-01-01T00:00:00Z";
|
|
83
|
+
const ts = new Date(payload.webhookTimestamp).toISOString();
|
|
51
84
|
const base = {
|
|
52
85
|
tenantId,
|
|
53
86
|
connectionId,
|
|
54
|
-
workspaceId:
|
|
87
|
+
workspaceId: payload.organizationId,
|
|
55
88
|
linearPayload: payload,
|
|
56
89
|
ts,
|
|
57
90
|
};
|
|
58
|
-
if (
|
|
59
|
-
|
|
91
|
+
if (payload.type === "AgentSessionEvent" || payload.type === "AgentSession") {
|
|
92
|
+
// Narrow to the AgentSessionEvent shape; "AgentSession" is a legacy alias Linear still emits.
|
|
93
|
+
const p = payload;
|
|
94
|
+
// Linear's webhook body nests the issue under `agentSession.issue.id`; the SDK type models it
|
|
95
|
+
// flattened as `agentSession.issueId`. Tolerate both so the issue id survives for routing.
|
|
96
|
+
const agentSession = p.agentSession;
|
|
97
|
+
const agentSessionId = agentSession.id;
|
|
98
|
+
const issueId = agentSession.issueId ?? agentSession.issue?.id ?? undefined;
|
|
60
99
|
if (p.action === "created") {
|
|
100
|
+
// DHK-322: classify the trigger modality deterministically from the payload alone. An @mention
|
|
101
|
+
// leaves the issue delegated to someone other than the app; a delegate/assign delegates it to the
|
|
102
|
+
// app itself (mirrors `shouldSetDelegate`). When the app user id cannot be resolved, default to
|
|
103
|
+
// `delegate` - the safe default is today's labelled pipeline, never mis-routing a real assignment
|
|
104
|
+
// to converse. No LLM: this is a pure id comparison.
|
|
105
|
+
const appUserId = agentSession.appUser?.id ?? undefined;
|
|
106
|
+
const issueDelegateId = agentSession.issue?.delegateId ?? agentSession.issue?.delegate?.id ?? undefined;
|
|
107
|
+
const trigger = appUserId !== undefined && issueDelegateId !== appUserId ? "mention" : "delegate";
|
|
108
|
+
// The instruction rides the triggering comment: prefer the structured `agentSession.comment`,
|
|
109
|
+
// else parse it out of the promptContext primary-directive-thread. The leading @mention is
|
|
110
|
+
// stripped so a bare mention yields no instruction.
|
|
111
|
+
const structured = agentSession.comment;
|
|
112
|
+
const promptContext = payload.promptContext;
|
|
113
|
+
const directive = typeof promptContext === "string" ? directiveFromPromptContext(promptContext) : {};
|
|
114
|
+
const structuredInstruction = structured?.body !== undefined ? stripLeadingMention(structured.body) : undefined;
|
|
115
|
+
const instruction = (structuredInstruction && structuredInstruction.length > 0 ? structuredInstruction : undefined) ??
|
|
116
|
+
directive.instruction;
|
|
117
|
+
const commentId = structured?.id ?? directive.commentId;
|
|
61
118
|
// Carry the issue id so the hub can map issue -> run (for later Inbox-notification routing).
|
|
62
|
-
const issueId = p.agentSession?.issue?.id;
|
|
63
119
|
return {
|
|
64
120
|
...base,
|
|
65
121
|
type: "agent-session-created",
|
|
66
|
-
|
|
122
|
+
trigger,
|
|
123
|
+
subject: { agentSessionId, ...(issueId ? { issueId } : {}), ...(commentId ? { commentId } : {}) },
|
|
124
|
+
...(instruction ? { instruction } : {}),
|
|
67
125
|
};
|
|
68
126
|
}
|
|
69
127
|
if (p.action === "prompted") {
|
|
@@ -72,40 +130,101 @@ export function normalise(payload, connectionId, tenantId) {
|
|
|
72
130
|
if (p.action === "stopped" || p.action === "stop") {
|
|
73
131
|
return { ...base, type: "signal-stop", subject: { agentSessionId } };
|
|
74
132
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (stateType === "canceled") {
|
|
86
|
-
const issueId = p.notification?.issueId ?? p.notification?.issue?.id ?? "";
|
|
87
|
-
return { ...base, type: "issue-canceled", subject: { issueId } };
|
|
133
|
+
// The session was archived or deleted (the human tore the agent off the issue). Linear does not
|
|
134
|
+
// guarantee an Inbox notification for this, but when it sends the raw AgentSession action we can
|
|
135
|
+
// stop the run it drives directly. Carry the issue id when present so the run can also be found by
|
|
136
|
+
// issue if the session map is stale.
|
|
137
|
+
if (p.action === "archived" || p.action === "deleted") {
|
|
138
|
+
return {
|
|
139
|
+
...base,
|
|
140
|
+
type: "session-archived",
|
|
141
|
+
subject: { agentSessionId, ...(issueId ? { issueId } : {}) },
|
|
142
|
+
};
|
|
88
143
|
}
|
|
89
144
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
145
|
+
if (payload.type === "AppUserNotification") {
|
|
146
|
+
const p = payload;
|
|
147
|
+
// The notification-kind discriminator is carried at the top-level `action` on the real webhook
|
|
148
|
+
// body (the SDK only models it as `notification.type`, which the live payload omits). Read from
|
|
149
|
+
// `action`, and tolerate the alternate field spellings the live body uses for issue id, reaction
|
|
150
|
+
// emoji, and status type.
|
|
151
|
+
const action = p.action;
|
|
152
|
+
const n = p.notification;
|
|
153
|
+
const issueId = n.issueId ?? n.issue?.id ?? "";
|
|
154
|
+
// Inbox notification: the agent was unassigned from an issue -> disengage (stop its run).
|
|
155
|
+
if (action === "issueUnassignedFromYou") {
|
|
156
|
+
return { ...base, type: "issue-unassigned", subject: { issueId } };
|
|
157
|
+
}
|
|
158
|
+
// Inbox notification: the issue's status changed. Only a move to a *canceled* workflow-state type is
|
|
159
|
+
// a disengagement signal (stop its run); any other status change falls through to ignored.
|
|
160
|
+
if (action === "issueStatusChanged") {
|
|
161
|
+
const stateType = n.issue?.state?.type ?? n.issueStatusType;
|
|
162
|
+
if (stateType === "canceled") {
|
|
163
|
+
return { ...base, type: "issue-canceled", subject: { issueId } };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// Inbox notification: a 👍/👎 reaction on a Dahrk response -> a feedback signal. A non-thumb emoji
|
|
167
|
+
// falls through to ignored (never mis-dispatched).
|
|
168
|
+
if (action === "issueEmojiReaction" || action === "issueCommentReaction") {
|
|
169
|
+
const reaction = reactionSentiment(n.reactionEmoji ?? n.reaction?.emoji ?? n.emoji);
|
|
170
|
+
if (reaction) {
|
|
171
|
+
return { ...base, type: "issue-reaction", subject: { issueId }, reaction };
|
|
172
|
+
}
|
|
98
173
|
}
|
|
99
174
|
}
|
|
100
175
|
// The OAuth app install was revoked: the connection is dead, deactivate it. No subject needed.
|
|
101
|
-
if (
|
|
176
|
+
if (payload.type === "OAuthApp" && payload.action === "revoked") {
|
|
102
177
|
return { ...base, type: "oauth-revoked", subject: {} };
|
|
103
178
|
}
|
|
104
|
-
|
|
105
|
-
|
|
179
|
+
// Permission Changes webhook: the Connection's set of accessible teams changed. Like `oauth-revoked`
|
|
180
|
+
// it is about the Connection, not an issue/session, so the subject is empty; the added/removed team
|
|
181
|
+
// deltas ride on `teamAccess` for the hub to merge into the Connection's tracked set. The SDK's
|
|
182
|
+
// webhook union does not model `PermissionChange`, so cast the payload (same pattern as the
|
|
183
|
+
// AppUserNotification branch above). Defensive: default missing deltas to [] and the flag to false.
|
|
184
|
+
if (payload.type === "PermissionChange" && payload.action === "teamAccessChanged") {
|
|
185
|
+
const p = payload;
|
|
186
|
+
return {
|
|
187
|
+
...base,
|
|
188
|
+
type: "team-access-changed",
|
|
189
|
+
subject: {},
|
|
190
|
+
teamAccess: {
|
|
191
|
+
addedTeamIds: p.addedTeamIds ?? [],
|
|
192
|
+
removedTeamIds: p.removedTeamIds ?? [],
|
|
193
|
+
canAccessAllPublicTeams: p.canAccessAllPublicTeams ?? false,
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
// Issue SLA webhook (DHK-63): a proactive trigger. Only `breached` is actionable (a pre-brief
|
|
198
|
+
// enrichment worth running); `set`/`highRisk` are lifecycle noise and fall through to the throw so
|
|
199
|
+
// they never spawn a session. The SDK's webhook union does not model `IssueSLA`, so cast to read the
|
|
200
|
+
// serialised issue (`issueData`), tolerating the field spellings the live body may use for the id.
|
|
201
|
+
if (payload.type === "IssueSLA" || payload.type === "Issue SLA") {
|
|
202
|
+
const p = payload;
|
|
203
|
+
if (p.action === "breached") {
|
|
204
|
+
const issueId = p.issueData?.id ?? p.issueId ?? p.issue?.id ?? p.data?.id ?? "";
|
|
205
|
+
return { ...base, type: "sla-breach", subject: { issueId } };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (payload.type === "Issue") {
|
|
209
|
+
const p = payload;
|
|
210
|
+
// Live "Issue" entity webhooks carry the issue under `data`; tolerate a top-level `issue` too.
|
|
211
|
+
const issueId = p.data?.id ?? p.issue?.id ?? "";
|
|
212
|
+
// An archive is a soft-delete (`archivedAt` set, or an explicit `archived`/`remove` action): treat
|
|
213
|
+
// it as disengagement so any run parked on the issue is stopped. Any other Issue action is a
|
|
214
|
+
// create/update we currently only route as `issue-created`.
|
|
215
|
+
if (p.action === "archived" || p.action === "remove" || p.data?.archivedAt) {
|
|
216
|
+
return { ...base, type: "issue-archived", subject: { issueId } };
|
|
217
|
+
}
|
|
218
|
+
// Triage entry (DHK-63): the issue just MOVED into a triage-typed state - a proactive trigger for
|
|
219
|
+
// pre-brief enrichment. Conservative on purpose: emit only on positive evidence of an entry (the
|
|
220
|
+
// current state is `triage` AND `updatedFrom` shows the state changed, i.e. carries `stateId`), so
|
|
221
|
+
// an ordinary edit on a ticket already in triage still normalises to `issue-created`.
|
|
222
|
+
if (p.data?.state?.type === "triage" && p.updatedFrom && "stateId" in p.updatedFrom) {
|
|
223
|
+
return { ...base, type: "triage-entry", subject: { issueId } };
|
|
224
|
+
}
|
|
106
225
|
return { ...base, type: "issue-created", subject: { issueId } };
|
|
107
226
|
}
|
|
108
|
-
throw new Error(`unsupported Linear webhook: type=${
|
|
227
|
+
throw new Error(`unsupported Linear webhook: type=${payload.type} action=${payload.action}`);
|
|
109
228
|
}
|
|
110
229
|
/** Keep only the externalUrls Linear accepts: http(s) URLs (internal `skakel://` refs are dropped),
|
|
111
230
|
* with empty/blank URLs removed and duplicates collapsed by `url` (first wins, since Linear requires
|
|
@@ -123,9 +242,14 @@ export function filterExternalUrls(urls) {
|
|
|
123
242
|
return kept;
|
|
124
243
|
}
|
|
125
244
|
export { createRecordingClient } from "./recording-client.js";
|
|
245
|
+
export { createRespondingLinearClient } from "./responding-client.js";
|
|
126
246
|
export { createLinearClient } from "./linear-client.js";
|
|
247
|
+
export { formatToolAction, formatToolResult } from "./format-action.js";
|
|
127
248
|
export { authorizeUrl, exchangeCode, refreshTokens, mintAppToken, fetchOrganizationId, probeToken, DEFAULT_AGENT_SCOPES } from "./oauth.js";
|
|
128
|
-
export { provisionLabels, provisionWorkflowLabels, provisionRepoLabels, linearLabelApi, projectLabelApi, fetchIssueProjectRepoLabels, REPO_LABEL_GROUP, } from "./labels.js";
|
|
249
|
+
export { provisionLabels, provisionWorkflowLabels, provisionRepoLabels, linearLabelApi, projectLabelApi, fetchIssueProjectRepoLabels, fetchIssueChildCount, fetchOpenBlockers, isBlockerSettled, REPO_LABEL_GROUP, } from "./labels.js";
|
|
250
|
+
export { linearTeamsApi, listWorkspaceTeams } from "./teams.js";
|
|
129
251
|
export { linearTriageApi, linearClientAuth } from "./issues.js";
|
|
130
252
|
export { fetchAttachedDocuments, collectAttachedDocuments, linearDocumentSource, documentSlugFromUrl, documentSlug, } from "./documents.js";
|
|
253
|
+
export { fetchIssueComments, collectIssueComments, linearCommentSource } from "./comments.js";
|
|
254
|
+
export { fetchRelatedIssues, collectRelatedIssues, linearIssueGraphSource, MAX_RELATED_ISSUES, } from "./issue-graph.js";
|
|
131
255
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAQ3D;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,SAAiB,EAAE,MAAc;IAC9E,6EAA6E;IAC7E,iFAAiF;IACjF,uFAAuF;IACvF,IAAI,EAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,GAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAoC,CAAC,gBAAgB,CAAC;QACtG,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,EAAE,GAAG,GAAG,CAAC;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mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE9F,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IssueRelation, RelatedIssue } from "@dahrk/contracts";
|
|
2
|
+
/** An issue as returned by Linear before normalisation, with its state already resolved. */
|
|
3
|
+
export interface RawRelatedIssue {
|
|
4
|
+
identifier?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
stateName?: string;
|
|
8
|
+
stateType?: string;
|
|
9
|
+
}
|
|
10
|
+
/** One edge: the neighbouring issue plus how it sits relative to the subject issue. */
|
|
11
|
+
export interface RawEdge {
|
|
12
|
+
relation: IssueRelation;
|
|
13
|
+
issue: RawRelatedIssue | null;
|
|
14
|
+
}
|
|
15
|
+
/** The read seam the assembly depends on; the live impl wraps GraphQL, tests inject a fake. */
|
|
16
|
+
export interface IssueGraphSource {
|
|
17
|
+
/** Every one-hop edge from the issue, in any order. */
|
|
18
|
+
issueEdges(issueId: string): Promise<RawEdge[]>;
|
|
19
|
+
}
|
|
20
|
+
/** How many neighbours ride the manifest. Beyond this the prompt stops being a summary. */
|
|
21
|
+
export declare const MAX_RELATED_ISSUES = 50;
|
|
22
|
+
/**
|
|
23
|
+
* Collect the issue's one-hop neighbourhood from a source: drop edges whose issue did not resolve or
|
|
24
|
+
* carries no identifier, de-dupe by identifier (an issue can be reachable by more than one edge -
|
|
25
|
+
* keep the structurally strongest, which is the lowest `RELATION_ORDER`), sort, and cap. Pure of any
|
|
26
|
+
* network.
|
|
27
|
+
*/
|
|
28
|
+
export declare function collectRelatedIssues(source: IssueGraphSource, issueId: string): Promise<RelatedIssue[]>;
|
|
29
|
+
/** The live `IssueGraphSource`, backed by a Linear bearer token. Uses the typed SDK. */
|
|
30
|
+
export declare function linearIssueGraphSource(token: string): IssueGraphSource;
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the issue's one-hop neighbourhood as contract `RelatedIssue`s, ready to snapshot into a run.
|
|
33
|
+
* The single entry point the hub calls. A hard failure (auth, network) propagates so the caller can
|
|
34
|
+
* log and proceed with none.
|
|
35
|
+
*/
|
|
36
|
+
export declare function fetchRelatedIssues(token: string, issueId: string): Promise<RelatedIssue[]>;
|
|
37
|
+
//# sourceMappingURL=issue-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-graph.d.ts","sourceRoot":"","sources":["../src/issue-graph.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEpE,4FAA4F;AAC5F,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uFAAuF;AACvF,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CAC/B;AAED,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CACjD;AAED,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAarC;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,EAAE,CAAC,CAwBzB;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAoEtE;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAEhG"}
|