@framers/agentos-ext-github 0.8.0 → 0.10.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 (71) hide show
  1. package/README.md +19 -13
  2. package/dist/documents/GitHubDocumentsConnector.d.ts +123 -26
  3. package/dist/documents/GitHubDocumentsConnector.d.ts.map +1 -1
  4. package/dist/documents/GitHubDocumentsConnector.js +229 -46
  5. package/dist/documents/GitHubDocumentsConnector.js.map +1 -1
  6. package/dist/documents/index.d.ts +3 -3
  7. package/dist/documents/index.d.ts.map +1 -1
  8. package/dist/documents/index.js +2 -2
  9. package/dist/documents/index.js.map +1 -1
  10. package/dist/documents/links.d.ts +28 -14
  11. package/dist/documents/links.d.ts.map +1 -1
  12. package/dist/documents/links.js +113 -39
  13. package/dist/documents/links.js.map +1 -1
  14. package/dist/documents/tree.d.ts +47 -13
  15. package/dist/documents/tree.d.ts.map +1 -1
  16. package/dist/documents/tree.js +98 -15
  17. package/dist/documents/tree.js.map +1 -1
  18. package/manifest.json +1 -1
  19. package/package.json +5 -4
  20. package/dist/__tests__/app.test.d.ts +0 -7
  21. package/dist/__tests__/app.test.d.ts.map +0 -1
  22. package/dist/__tests__/app.test.js +0 -1219
  23. package/dist/__tests__/app.test.js.map +0 -1
  24. package/dist/__tests__/documents.test.d.ts +0 -9
  25. package/dist/__tests__/documents.test.d.ts.map +0 -1
  26. package/dist/__tests__/documents.test.js +0 -644
  27. package/dist/__tests__/documents.test.js.map +0 -1
  28. package/dist/__tests__/entry.test.d.ts +0 -7
  29. package/dist/__tests__/entry.test.d.ts.map +0 -1
  30. package/dist/__tests__/entry.test.js +0 -34
  31. package/dist/__tests__/entry.test.js.map +0 -1
  32. package/dist/__tests__/events.test.d.ts +0 -8
  33. package/dist/__tests__/events.test.d.ts.map +0 -1
  34. package/dist/__tests__/events.test.js +0 -321
  35. package/dist/__tests__/events.test.js.map +0 -1
  36. package/dist/__tests__/fileAndBranchTools.test.d.ts +0 -6
  37. package/dist/__tests__/fileAndBranchTools.test.d.ts.map +0 -1
  38. package/dist/__tests__/fileAndBranchTools.test.js +0 -310
  39. package/dist/__tests__/fileAndBranchTools.test.js.map +0 -1
  40. package/dist/__tests__/indexer.test.d.ts +0 -6
  41. package/dist/__tests__/indexer.test.d.ts.map +0 -1
  42. package/dist/__tests__/indexer.test.js +0 -253
  43. package/dist/__tests__/indexer.test.js.map +0 -1
  44. package/dist/__tests__/issueTools.test.d.ts +0 -5
  45. package/dist/__tests__/issueTools.test.d.ts.map +0 -1
  46. package/dist/__tests__/issueTools.test.js +0 -183
  47. package/dist/__tests__/issueTools.test.js.map +0 -1
  48. package/dist/__tests__/links.test.d.ts +0 -8
  49. package/dist/__tests__/links.test.d.ts.map +0 -1
  50. package/dist/__tests__/links.test.js +0 -182
  51. package/dist/__tests__/links.test.js.map +0 -1
  52. package/dist/__tests__/prTools.test.d.ts +0 -5
  53. package/dist/__tests__/prTools.test.d.ts.map +0 -1
  54. package/dist/__tests__/prTools.test.js +0 -318
  55. package/dist/__tests__/prTools.test.js.map +0 -1
  56. package/dist/__tests__/refs.test.d.ts +0 -7
  57. package/dist/__tests__/refs.test.d.ts.map +0 -1
  58. package/dist/__tests__/refs.test.js +0 -420
  59. package/dist/__tests__/refs.test.js.map +0 -1
  60. package/dist/__tests__/releaseAndActionsTools.test.d.ts +0 -6
  61. package/dist/__tests__/releaseAndActionsTools.test.d.ts.map +0 -1
  62. package/dist/__tests__/releaseAndActionsTools.test.js +0 -315
  63. package/dist/__tests__/releaseAndActionsTools.test.js.map +0 -1
  64. package/dist/__tests__/repoTools.test.d.ts +0 -6
  65. package/dist/__tests__/repoTools.test.d.ts.map +0 -1
  66. package/dist/__tests__/repoTools.test.js +0 -308
  67. package/dist/__tests__/repoTools.test.js.map +0 -1
  68. package/dist/__tests__/service.test.d.ts +0 -6
  69. package/dist/__tests__/service.test.d.ts.map +0 -1
  70. package/dist/__tests__/service.test.js +0 -173
  71. package/dist/__tests__/service.test.js.map +0 -1
@@ -1,16 +1,30 @@
1
1
  /**
2
2
  * @fileoverview A repository's documentation as account sources, read through a GitHub App's installation: each
3
- * repository read by its id at its default branch or at a named branch or commit, its tree read once a commit within a
4
- * request budget, the documentation kept by a filter, each file read as raw bytes under a cap, a push compared by the
5
- * tree at its `after` commit, and a link's ref settled where a branch name holds a slash. A selection, an item or a
6
- * call it cannot answer whole is refused before any request.
3
+ * repository read by its id at its default branch or at a named branch or commit, whole or within a folder, its tree
4
+ * read once a commit within a request budget, the documentation kept by a filter, each file read as raw bytes under a
5
+ * cap, a push compared by the tree at its `after` commit, and a link's ref settled as a branch (where its name holds a
6
+ * slash), a tag or a commit, a full name (`refs/heads/<branch>`, `refs/tags/<tag>`) among its own namespace alone. A
7
+ * selection, an item or a call it cannot answer whole is refused before any request.
7
8
  * @module agentos-ext-github/documents/GitHubDocumentsConnector
8
9
  */
9
10
  import { ReadCapExceeded, } from '@framers/agentos-ext-account-sources';
10
11
  import { arrayOf, GITHUB_API_BASE, GitHubApiError, githubFetch, GitHubNoAnswer, githubSend, objectOf, repositoryPath, stringIn } from '../app/http.js';
11
- import { DEFAULT_MAX_FILE_BYTES, extensionOf, pathFilter, readTree, SKIPPED_FOLDERS } from './tree.js';
12
+ import { DEFAULT_MAX_FILE_BYTES, DEFAULT_MAX_FILES, extensionOf, pathFilter, pathOf, readTree, SKIPPED_FOLDERS, withinPath, } from './tree.js';
12
13
  /** A commit as a link or a caller names it: 40 hexadecimal characters, in either case. */
13
14
  const COMMIT = /^[0-9a-f]{40}$/i;
15
+ /** A commit named by its first characters, as git shortens it: 4 to 39 hexadecimal characters, in either case. */
16
+ const SHORT_COMMIT = /^[0-9a-f]{4,39}$/i;
17
+ /** GitHub's media type for a commit's sha alone (https://docs.github.com/en/rest/commits/commits#get-a-commit). */
18
+ const COMMIT_SHA_MEDIA_TYPE = 'application/vnd.github.sha';
19
+ /** The most bytes read of a commit's sha alone: 40 characters, and room to spare. */
20
+ const COMMIT_SHA_BYTES = 1_024;
21
+ /** The most annotated tags followed from a tag to the commit it names: a tag of a tag is rare. */
22
+ const MAX_TAG_DEPTH = 8;
23
+ /** The namespaces of a branch's and a tag's full name, which `parseGitHubLink` keeps whole in `refAndPath`. */
24
+ const NAMESPACES = [
25
+ { prefix: 'refs/heads/', space: 'heads' },
26
+ { prefix: 'refs/tags/', space: 'tags' },
27
+ ];
14
28
  /** The characters no branch name holds, beside the control characters and the space (`git check-ref-format`). */
15
29
  const NOT_IN_BRANCH = '~^:?*[\\';
16
30
  /**
@@ -30,6 +44,22 @@ function isBranchName(name) {
30
44
  }
31
45
  return name.split('/').every((part) => part !== '' && !part.startsWith('.') && !part.endsWith('.lock'));
32
46
  }
47
+ /**
48
+ * True for a text that may begin a ref's name by git's rules (https://git-scm.com/docs/git-check-ref-format): no
49
+ * control character, space, `~`, `^`, `:`, `?`, `*`, `[` or `\`, no `..` or `@{`, not starting with a dot and not
50
+ * ending in `.lock`. A part of a longer name may end with a dot, and a tag's may start with a dash, which a branch's
51
+ * whole name may not: `isBranchName` reads those.
52
+ */
53
+ function mayBeginRef(segment) {
54
+ if (segment.includes('..') || segment.includes('@{') || segment.startsWith('.') || segment.endsWith('.lock'))
55
+ return false;
56
+ for (let index = 0; index < segment.length; index += 1) {
57
+ const code = segment.charCodeAt(index);
58
+ if (code <= 0x20 || code === 0x7f || NOT_IN_BRANCH.includes(segment[index]))
59
+ return false;
60
+ }
61
+ return true;
62
+ }
33
63
  /**
34
64
  * The branch or the commit a caller's `at` names, a commit in lower case. Anything else throws a `TypeError` that
35
65
  * quotes none of it, before any request.
@@ -97,6 +127,10 @@ function itemPathOf(id) {
97
127
  }
98
128
  return { repositoryId: repositoryIdOf(id.slice(0, colon)), path };
99
129
  }
130
+ /** True for an abort signal, as `listing` tells it from its options: a signal carries `aborted`, an options object does not. */
131
+ function isSignal(value) {
132
+ return typeof value.aborted === 'boolean';
133
+ }
100
134
  /**
101
135
  * Throws `GitHubNoAnswer` (`cancelled`) for a call whose signal is already aborted. Each call runs it first, before it
102
136
  * checks its inputs or makes any request, so an aborted call answers alike whatever its inputs, as the DOM standard
@@ -113,12 +147,14 @@ function notCancelled(signal) {
113
147
  * `GitHubNoAnswer` (`cancelled`) before it checks anything else. What a call cannot answer whole then throws before any
114
148
  * request: a `TypeError` for an id that is not a repository id, a repository named twice, an item id that names no
115
149
  * file, a change set of other than one repository, an `at` that is neither a branch name nor a commit or that names
116
- * other than one repository, and a link's text with an empty, `.` or `..` segment, and an `Error` for a repository
117
- * outside the link. An installation is removed by the app's own call (`uninstallInstallation`), never by a link's
118
- * connector.
150
+ * other than one repository, a `path` with an empty, `.` or `..` segment or beside other than one repository, a link's
151
+ * text with an empty, `.` or `..` segment, and a link's ref that no ref name can begin with, and an `Error` for a
152
+ * repository outside the link. An installation is removed by the app's own call (`uninstallInstallation`), never by a
153
+ * link's connector.
119
154
  *
120
155
  * A listing and a comparison follow the default branch, or the branch or commit a selection's `at` names: a branch's
121
- * head is read when the call is made, a commit is read as it is and never changes.
156
+ * head is read when the call is made, a commit is read as it is and never changes. A selection's `path` narrows them to
157
+ * a folder, or a file, before `maxFiles` counts the files.
122
158
  *
123
159
  * Every read addresses a linked repository by its id (`/repositories/<id>/...`, where GitHub's own redirects for a
124
160
  * renamed or moved repository lead), never by its name. A name can come to mean another repository (a renamed
@@ -182,28 +218,29 @@ export class GitHubDocumentsConnector {
182
218
  return followed.commit;
183
219
  return this.branchHead(repository, followed?.branch ?? repository.defaultBranch, signal);
184
220
  }
185
- /**
186
- * The documentation files of a repository at a commit: its tree read once within the request budget, never walking
187
- * a skipped folder, then filtered. A caller keeps it for that commit and hands it to `changesSince` with that commit
188
- * as `after`.
189
- */
190
- async listing(repositoryId, commit, signal) {
221
+ async listing(repositoryId, commit, signalOrOptions) {
222
+ const options = signalOrOptions === undefined || signalOrOptions === null || isSignal(signalOrOptions) ? { signal: signalOrOptions ?? undefined } : signalOrOptions;
223
+ const { signal } = options;
191
224
  notCancelled(signal);
225
+ const path = pathOf(options.path);
192
226
  const repository = this.repository(repositoryId);
193
227
  const tree = await readTree(this.fetchImpl, await this.token(repositoryId, signal), repository.id, commit, this.apiBase, {
194
228
  maxRequests: this.filter.maxTreeRequests,
195
229
  skipFolders: this.filter.skipFolders ?? SKIPPED_FOLDERS,
230
+ path,
196
231
  signal,
197
232
  });
198
233
  return pathFilter(this.filter)(tree);
199
234
  }
200
235
  /**
201
236
  * The documentation of each selected repository (its id in `ids`) at its default branch's head, or of one repository
202
- * at the branch or commit `at` names: the branch's head, or the commit itself with no branch read. Every id and `at`
203
- * are checked before any repository is read, so a selection is listed whole or not at all: an id that is not a
204
- * repository id, a repository named twice, an `at` that is neither a branch name nor a commit, and an `at` beside
205
- * other than one repository throw a `TypeError`, and a repository outside the link an `Error`. A selection's other
206
- * fields are `changesSince`'s, and a listing reads none of them.
237
+ * at the branch or commit `at` names: the branch's head, or the commit itself with no branch read. With a `path`, the
238
+ * files of one repository at that folder or under it, or the one file it names, kept before `maxFiles` counts them.
239
+ * Every id, `at` and `path` are checked before any repository is read, so a selection is listed whole or not at all:
240
+ * an id that is not a repository id, a repository named twice, an `at` that is neither a branch name nor a commit, a
241
+ * `path` with an empty, `.` or `..` segment or that is not text, and an `at` or a `path` beside other than one
242
+ * repository throw a `TypeError`, and a repository outside the link an `Error`. A selection's other fields are
243
+ * `changesSince`'s, and a listing reads none of them.
207
244
  */
208
245
  async list(selection, signal) {
209
246
  notCancelled(signal);
@@ -213,12 +250,15 @@ export class GitHubDocumentsConnector {
213
250
  const followed = selection.at === undefined ? undefined : followedOf(selection.at);
214
251
  if (followed !== undefined && ids.length !== 1)
215
252
  throw new TypeError('a listing at a named branch or commit is of one repository');
253
+ const path = pathOf(selection.path);
254
+ if (path !== '' && ids.length !== 1)
255
+ throw new TypeError('a listing of a folder or a file is of one repository');
216
256
  for (const id of ids)
217
257
  this.repository(id);
218
258
  const items = [];
219
259
  for (const id of ids) {
220
260
  const commit = followed === undefined ? await this.head(id, signal) : 'commit' in followed ? followed.commit : await this.head(id, followed.branch, signal);
221
- for (const blob of await this.listing(id, commit, signal)) {
261
+ for (const blob of await this.listing(id, commit, { path, signal })) {
222
262
  items.push({ id: `${id}:${blob.path}`, title: blob.path, size: blob.size, version: `${blob.sha}@${commit}` });
223
263
  }
224
264
  }
@@ -286,6 +326,13 @@ export class GitHubDocumentsConnector {
286
326
  * followed branch's head, or at the commit. A push to another branch than the one followed answers no change and the
287
327
  * cursor it was given, and so does any push when `at` is a commit, which never changes; without a push, an `after`
288
328
  * naming another commit than `at`'s throws a `TypeError` before any request.
329
+ *
330
+ * With a `path` the comparison is made within that folder, or of the one file it names: the listing at `after` keeps
331
+ * the files there before `maxFiles` counts them, so the folder's files are never answered gone for the files sorting
332
+ * before it, and a `listing` handed in is narrowed to the path (read it with `listing(repositoryId, after, { path })`
333
+ * so the count is the folder's). A listing handed in that holds `maxFiles` files may have been cut before the folder's
334
+ * files, so with a path the folder is read afresh instead of it. A cursor is compared under the path it was answered under: a path in it outside the
335
+ * one given is answered gone.
289
336
  */
290
337
  async changesSince(cursor, selection, signal) {
291
338
  notCancelled(signal);
@@ -299,6 +346,7 @@ export class GitHubDocumentsConnector {
299
346
  throw new TypeError('a listing is compared only with the after commit it was read at');
300
347
  }
301
348
  const named = selection.at === undefined ? undefined : followedOf(selection.at);
349
+ const folder = pathOf(selection.path);
302
350
  const repository = this.repository(id);
303
351
  const followed = named ?? { branch: repository.defaultBranch };
304
352
  if (selection.ref !== undefined && ('commit' in followed || selection.ref !== `refs/heads/${followed.branch}`)) {
@@ -308,7 +356,10 @@ export class GitHubDocumentsConnector {
308
356
  throw new TypeError('after names another commit than at');
309
357
  }
310
358
  const after = 'commit' in followed ? followed.commit : (selection.after ?? (await this.branchHead(repository, followed.branch, signal)));
311
- const blobs = selection.listing ?? (await this.listing(id, after, signal));
359
+ // a listing at the file count may have been cut before the folder's files: narrowed, it would answer them gone
360
+ const handed = selection.listing;
361
+ const cut = handed !== undefined && folder !== '' && handed.length >= (this.filter.maxFiles ?? DEFAULT_MAX_FILES);
362
+ const blobs = handed === undefined || cut ? await this.listing(id, after, { path: folder, signal }) : withinPath(handed, folder);
312
363
  const now = new Map(blobs.map((blob) => [blob.path, blob.sha]));
313
364
  const changed = blobs
314
365
  .filter((blob) => before.get(blob.path) !== blob.sha)
@@ -318,15 +369,44 @@ export class GitHubDocumentsConnector {
318
369
  }
319
370
  /**
320
371
  * The ref and the path of a folder's or a file's `<ref>/<path>` text (`parseGitHubLink`'s `refAndPath`), whose
321
- * branch name may hold a slash. A first segment of 40 hexadecimal characters is a commit, in lower case, and `HEAD`
322
- * the default branch (git names no branch `HEAD`), each settled with no request. Otherwise one request to GitHub's
323
- * matching references (`/repositories/<id>/git/matching-refs/heads/<first segment>`, under an installation token
324
- * narrowed to the repository), which answers every branch whose name starts with that segment
325
- * (https://docs.github.com/en/rest/git/refs#list-matching-references): the longest branch name that is the text, or
326
- * starts it at a slash, is the ref and the rest the path, and the first segment alone when none is longer. A first
327
- * segment no branch has is answered as the ref all the same, and a listing at it then answers GitHub's 404. A text
328
- * with an empty, `.` or `..` segment throws a `TypeError` that quotes none of it, before any request; GitHub's
329
- * refusal of the read, such as 409 for a repository with no commit, throws `GitHubApiError`.
372
+ * branch or tag name may hold a slash, answered with what the ref is (`kind`) and the name the text writes it by
373
+ * (`name`). A first segment of 40 hexadecimal characters is a commit, in lower case, and `HEAD` the default branch
374
+ * (git names no branch `HEAD`), each settled with no request, but for a default branch whose name is 40 hexadecimal
375
+ * characters, settled at its head as below. Otherwise, under an installation token narrowed to the
376
+ * repository, GitHub's matching references (https://docs.github.com/en/rest/git/refs#list-matching-references), which
377
+ * answer every reference whose name starts with the first segment, are read in turn until one settles it:
378
+ *
379
+ * 1. The branches (`/repositories/<id>/git/matching-refs/heads/<first segment>`) and the tags
380
+ * (`.../matching-refs/tags/<first segment>`): the longest name of either that is the text, or starts it at a slash,
381
+ * is the ref and the rest the path, a branch and a tag of one name settling as the branch. Git keeps a tag under a
382
+ * branch's name beside the branch (`release/2.0` beside `release`), and the longer name is the more of the link it
383
+ * names. The tags are not read when a branch's name is the whole text, since no name is longer. A tag is answered
384
+ * at the commit it names (`commit: true`), as GitHub serves a `/tree/<tag>/` address: a lightweight tag names it,
385
+ * and an annotated tag's object is read for it (https://docs.github.com/en/rest/git/tags#get-a-tag). A tag that
386
+ * names no commit is read as no tag, and the branch, if one matched, settles it.
387
+ * 2. A first segment of 4 to 39 hexadecimal characters, a short commit, through GitHub's commits under its sha media
388
+ * type (https://docs.github.com/en/rest/commits/commits#get-a-commit), which answers the whole commit, or 422 for
389
+ * a prefix no commit has or several have.
390
+ *
391
+ * A first segment neither settles is answered as a branch all the same, and a listing at it then throws GitHub's
392
+ * 404 as `GitHubApiError`; one that is no branch name by git's rules (such as `-x`, `@` or `end.`) throws a
393
+ * `TypeError` instead.
394
+ *
395
+ * A full name, `refs/heads/<branch>/<path>` or `refs/tags/<tag>/<path>`, the form GitHub's own Raw links write, is
396
+ * read among its own namespace alone, the name after it as the first segment: the longest branch, or the longest tag
397
+ * at the commit it names, that is the name and the path or starts them at a slash. It is the one form that tells a tag
398
+ * from a branch of the same name, and a branch from a longer tag beside it, so no commit, `HEAD` or other namespace is
399
+ * read for it. A branch it names that the repository does not have is answered as a branch all the same, as above; a
400
+ * tag the repository does not have, or one that names no commit, throws `GitHubApiError` with status 404, as GitHub
401
+ * answers an address naming it, since no commit is there to read at. A branch whose name is 40 hexadecimal characters,
402
+ * which a full name or `HEAD` alone reaches, is settled at its head (`commit: true`), read through GitHub's branches,
403
+ * since `at` reads such a name as the commit it spells; one the repository does not have throws GitHub's 404 there as
404
+ * `GitHubApiError`.
405
+ *
406
+ * A text with an empty, `.` or `..` segment, and one whose first segment (after a full name's namespace) no ref
407
+ * name can begin (a control character, a space, `~`, `^`, `:`, `?`, `*`, `[`, `\`, `..` or `@{`, a leading dot or a
408
+ * trailing `.lock`), throw a `TypeError` that quotes none of it, before any request; GitHub's refusal of a read, such
409
+ * as 409 for a repository with no commit, throws `GitHubApiError`.
330
410
  */
331
411
  async resolveRef(repositoryId, refAndPath, signal) {
332
412
  notCancelled(signal);
@@ -334,24 +414,127 @@ export class GitHubDocumentsConnector {
334
414
  throw new TypeError('a ref and a path have no empty, . or .. segment');
335
415
  }
336
416
  const repository = this.repository(repositoryId);
337
- const first = refAndPath.split('/')[0];
338
- const pathAfter = (ref) => refAndPath.slice(ref.length + 1);
339
- if (COMMIT.test(first))
340
- return { ref: first.toLowerCase(), path: pathAfter(first), commit: true };
341
- if (first === 'HEAD')
342
- return { ref: repository.defaultBranch, path: pathAfter(first), commit: false };
343
- const url = `${this.address(repository)}/git/matching-refs/heads/${encodeURIComponent(first)}`;
344
- const references = arrayOf(await githubFetch(this.fetchImpl, url, { token: await this.token(repository.id, signal), signal }), 'a list of references');
345
- let ref = first;
417
+ const full = NAMESPACES.find((namespace) => refAndPath.startsWith(namespace.prefix));
418
+ // The name and the path after a full name's namespace, or the whole text.
419
+ const text = full === undefined ? refAndPath : refAndPath.slice(full.prefix.length);
420
+ const first = text.split('/')[0];
421
+ const settled = (name, ref, kind) => ({
422
+ ref,
423
+ path: text.slice(name.length + 1),
424
+ commit: kind !== 'branch',
425
+ kind,
426
+ name,
427
+ });
428
+ // A branch (`name` as the text writes it) by its name, or at its head when `at` would read its name as the commit it
429
+ // spells: a full name, or `HEAD` for the default branch, alone reaches such a branch, since a bare 40 hexadecimal
430
+ // characters settle as the commit below.
431
+ const settledBranch = async (name, branch) => {
432
+ if (!COMMIT.test(branch))
433
+ return settled(name, branch, 'branch');
434
+ const head = (await this.branchHead(repository, branch, signal)).toLowerCase();
435
+ if (!COMMIT.test(head))
436
+ throw new Error("GitHub answered a branch's head that is not a commit");
437
+ return { ...settled(name, head, 'branch'), commit: true };
438
+ };
439
+ if (full === undefined && COMMIT.test(first))
440
+ return settled(first, first.toLowerCase(), 'commit');
441
+ if (full === undefined && first === 'HEAD')
442
+ return settledBranch(first, repository.defaultBranch);
443
+ if (!mayBeginRef(first))
444
+ throw new TypeError('the ref of a link holds what no branch, tag or commit holds');
445
+ const token = await this.token(repository.id, signal);
446
+ if (full?.space === 'tags') {
447
+ const tag = await this.longestRef(repository, 'tags', first, text, token, signal);
448
+ const tagged = tag === null ? null : await this.tagCommit(repository, tag.fields, token, signal);
449
+ // No commit to read at: GitHub answers an address naming such a tag 404.
450
+ if (tag === null || tagged === null)
451
+ throw new GitHubApiError(404);
452
+ return settled(tag.name, tagged, 'tag');
453
+ }
454
+ const branch = await this.longestRef(repository, 'heads', first, text, token, signal);
455
+ if (full === undefined) {
456
+ // a tag names more of the text than the branch when its name is longer; a branch named by the whole text has no longer
457
+ const tag = branch !== null && branch.name === text ? null : await this.longestRef(repository, 'tags', first, text, token, signal);
458
+ const longer = tag !== null && (branch === null || tag.name.length > branch.name.length) ? tag : null;
459
+ const tagged = longer === null ? null : await this.tagCommit(repository, longer.fields, token, signal);
460
+ if (longer !== null && tagged !== null)
461
+ return settled(longer.name, tagged, 'tag');
462
+ }
463
+ if (branch !== null)
464
+ return settledBranch(branch.name, branch.name);
465
+ const commit = full === undefined && SHORT_COMMIT.test(first) ? await this.commitOf(repository, first, token, signal) : null;
466
+ if (commit !== null)
467
+ return settled(first, commit, 'commit');
468
+ if (!isBranchName(first))
469
+ throw new TypeError('the ref of a link names no branch, tag or commit of the repository');
470
+ return settledBranch(first, first);
471
+ }
472
+ /**
473
+ * The longest branch or tag (`space`) whose name is `text` or starts it at a slash, from GitHub's matching references
474
+ * for `first`, the text's first segment, with the reference's fields; null for none.
475
+ */
476
+ async longestRef(repository, space, first, text, token, signal) {
477
+ const url = `${this.address(repository)}/git/matching-refs/${space}/${encodeURIComponent(first)}`;
478
+ const references = arrayOf(await githubFetch(this.fetchImpl, url, { token, signal }), 'a list of references');
479
+ const prefix = `refs/${space}/`;
480
+ let found = null;
346
481
  for (const reference of references) {
347
- const name = stringIn(objectOf(reference, 'a reference'), 'ref', 'a reference');
348
- if (!name.startsWith('refs/heads/'))
482
+ const fields = objectOf(reference, 'a reference');
483
+ const full = stringIn(fields, 'ref', 'a reference');
484
+ if (!full.startsWith(prefix))
349
485
  continue;
350
- const branch = name.slice('refs/heads/'.length);
351
- if (branch.length > ref.length && (refAndPath === branch || refAndPath.startsWith(`${branch}/`)))
352
- ref = branch;
486
+ const name = full.slice(prefix.length);
487
+ if ((found === null || name.length > found.name.length) && (text === name || text.startsWith(`${name}/`)))
488
+ found = { name, fields };
489
+ }
490
+ return found;
491
+ }
492
+ /**
493
+ * The commit a tag's reference names: a lightweight tag's own object, or the object an annotated tag names, read
494
+ * through GitHub's tags and followed through a tag of a tag up to {@link MAX_TAG_DEPTH}, in lower case. Null for a
495
+ * tag that names a tree or a blob, or a longer chain of tags.
496
+ */
497
+ async tagCommit(repository, reference, token, signal) {
498
+ let object = objectOf(reference.object, "a reference's object");
499
+ for (let depth = 0; stringIn(object, 'type', "a reference's object") === 'tag'; depth += 1) {
500
+ if (depth === MAX_TAG_DEPTH)
501
+ return null;
502
+ const url = `${this.address(repository)}/git/tags/${encodeURIComponent(stringIn(object, 'sha', "a reference's object"))}`;
503
+ object = objectOf(objectOf(await githubFetch(this.fetchImpl, url, { token, signal }), 'a tag').object, "a tag's object");
504
+ }
505
+ const sha = stringIn(object, 'sha', "a reference's object");
506
+ return stringIn(object, 'type', "a reference's object") === 'commit' && COMMIT.test(sha) ? sha.toLowerCase() : null;
507
+ }
508
+ /**
509
+ * The whole commit a short commit names, in lower case, through GitHub's commits under the sha media type, which
510
+ * answers the commit's sha alone; null when GitHub answers 422 or 404, as it does for a prefix no commit has or
511
+ * several have. An answer that is not a commit starting with the prefix throws.
512
+ */
513
+ async commitOf(repository, prefix, token, signal) {
514
+ const short = prefix.toLowerCase();
515
+ const url = `${this.address(repository)}/commits/${encodeURIComponent(short)}`;
516
+ let answer;
517
+ try {
518
+ answer = await githubSend(this.fetchImpl, url, { token, accept: COMMIT_SHA_MEDIA_TYPE, signal });
519
+ }
520
+ catch (error) {
521
+ if (error instanceof GitHubApiError && (error.status === 404 || error.status === 422))
522
+ return null;
523
+ throw error;
524
+ }
525
+ let bytes;
526
+ try {
527
+ bytes = await answer.bytes(COMMIT_SHA_BYTES);
528
+ }
529
+ catch (error) {
530
+ if (error instanceof ReadCapExceeded)
531
+ throw new Error('GitHub answered a commit that is not one');
532
+ throw error;
353
533
  }
354
- return { ref, path: pathAfter(ref), commit: false };
534
+ const commit = new TextDecoder().decode(bytes).trim().toLowerCase();
535
+ if (!COMMIT.test(commit) || !commit.startsWith(short))
536
+ throw new Error('GitHub answered a commit that is not one');
537
+ return commit;
355
538
  }
356
539
  /** Nothing to end here: an installation is removed by the app's own call (`uninstallInstallation`). */
357
540
  async revoke() {
@@ -1 +1 @@
1
- {"version":3,"file":"GitHubDocumentsConnector.js","sourceRoot":"","sources":["../../src/documents/GitHubDocumentsConnector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,eAAe,GAQhB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AAC1K,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAkC,MAAM,WAAW,CAAC;AAiDvI,0FAA0F;AAC1F,MAAM,MAAM,GAAG,iBAAiB,CAAC;AAEjC,iHAAiH;AACjH,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC;;;;GAIG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/G,IAAI,IAAI,CAAC,QA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,CAAC;QACd,CAAC;QACD,IAAI,KAAiB,CAAC;QACtB,IAAI,CAAC;YACH,KAAK,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,eAAe;gBAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAClG,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACnH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,uGAAuG;IACvG,KAAK,CAAC,MAAM;QACV,8FAA8F;IAChG,CAAC;CACF"}
@@ -8,10 +8,10 @@
8
8
  * @module agentos-ext-github/documents
9
9
  */
10
10
  /**
11
- * The documentation connector, the selections it lists and compares at a branch or a commit, and the ref a link's text
12
- * names, settled.
11
+ * The documentation connector, the selections it lists and compares at a branch or a commit and within a folder, the
12
+ * options of a folder's listing, and the ref a link's text names, settled as a branch, a tag or a commit.
13
13
  */
14
- export { GitHubDocumentsConnector, type GitHubChangesSelection, type GitHubListSelection, type LinkedRepository, type ResolvedRef, } from './GitHubDocumentsConnector.js';
14
+ export { GitHubDocumentsConnector, type GitHubChangesSelection, type GitHubListingOptions, type GitHubListSelection, type LinkedRepository, type ResolvedRef, } from './GitHubDocumentsConnector.js';
15
15
  /**
16
16
  * A repository's tree within a request budget, the filter that keeps its documentation, and its code when asked, and
17
17
  * the plan of every file with what becomes of it.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documents/index.ts"],"names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C;AAC3D,yEAAyE;AACzE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,2BAA2B;AAC3B,OAAO,EACL,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,OAAO,EACL,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,WAAW,GACjB,MAAM,+BAA+B,CAAC;AACvC;;;GAGG;AACH,OAAO,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,WAAW,EACX,eAAe,EACf,YAAY,EACZ,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf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BAAkB,CAAC;AAC1B,2BAA2B;AAC3B,OAAO,EACL,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC"}
@@ -8,8 +8,8 @@
8
8
  * @module agentos-ext-github/documents
9
9
  */
10
10
  /**
11
- * The documentation connector, the selections it lists and compares at a branch or a commit, and the ref a link's text
12
- * names, settled.
11
+ * The documentation connector, the selections it lists and compares at a branch or a commit and within a folder, the
12
+ * options of a folder's listing, and the ref a link's text names, settled as a branch, a tag or a commit.
13
13
  */
14
14
  export { GitHubDocumentsConnector, } from './GitHubDocumentsConnector.js';
15
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,OAAO,EACL,wBAAwB,GAKzB,MAAM,+BAA+B,CAAC;AACvC;;;GAGG;AACH,OAAO,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,WAAW,EACX,eAAe,EACf,YAAY,EAEZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,GAO1B,MAAM,WAAW,CAAC;AACnB,oEAAoE;AACpE,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAC9D,6CAA6C;AAC7C,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAyD,MAAM,sBAAsB,CAAC;AAC1H,8DAA8D;AAC9D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAC5B;;;GAGG;AACH,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GAOrB,MAAM,yBAAyB,CAAC;AACjC,sCAAsC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,yEAAyE;AACzE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,GAc3B,MAAM,kBAAkB,CAAC;AAC1B,2BAA2B;AAC3B,OAAO,EACL,sBAAsB,GASvB,MAAM,qBAAqB,CAAC;AAC7B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,cAAc,GAIf,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,OAAO,EACL,wBAAwB,GAMzB,MAAM,+BAA+B,CAAC;AACvC;;;GAGG;AACH,OAAO,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,WAAW,EACX,eAAe,EACf,YAAY,EAEZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,GAO1B,MAAM,WAAW,CAAC;AACnB,oEAAoE;AACpE,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAC9D,6CAA6C;AAC7C,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAyD,MAAM,sBAAsB,CAAC;AAC1H,8DAA8D;AAC9D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAC5B;;;GAGG;AACH,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GAOrB,MAAM,yBAAyB,CAAC;AACjC,sCAAsC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,yEAAyE;AACzE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,GAc3B,MAAM,kBAAkB,CAAC;AAC1B,2BAA2B;AAC3B,OAAO,EACL,sBAAsB,GASvB,MAAM,qBAAqB,CAAC;AAC7B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,cAAc,GAIf,MAAM,gBAAgB,CAAC"}
@@ -1,15 +1,18 @@
1
1
  /**
2
2
  * @fileoverview The GitHub addresses a person pastes, read without a request: a repository, a folder or a file on
3
3
  * github.com, and a file on raw.githubusercontent.com. Any other address on GitHub's hosts is refused, so no form of a
4
- * GitHub address is read as another site's page; an address on any other host is not GitHub's.
4
+ * GitHub address is read as another site's page; an address on any other host is not GitHub's. A text is read as the
5
+ * URL standard reads an address, so every form a browser opens as a GitHub address is answered as one.
5
6
  * @module agentos-ext-github/documents/links
6
7
  */
7
8
  /**
8
9
  * What a GitHub address names. A folder's and a file's ref and path are one text, `refAndPath`, since a branch name may
9
- * hold a slash: `GitHubDocumentsConnector.resolveRef` settles where the ref ends. `raw` marks a file address that serves
10
- * the file's bytes alone (`/raw/` on github.com, or raw.githubusercontent.com). A file's text can be a branch alone
11
- * (`/blob/release/1.0` names the file `1.0` of `release`, or the branch `release/1.0` and no file); when `resolveRef`
12
- * settles it with an empty path, the address names a ref and no file, which GitHub answers 404.
10
+ * hold a slash: `GitHubDocumentsConnector.resolveRef` settles where the ref ends. A branch's or a tag's full name stays
11
+ * whole in it (`refs/heads/<branch>/<path>`, `refs/tags/<tag>/<path>`), and `resolveRef` reads that name among the
12
+ * branches or the tags alone. `raw` marks a file address that serves the file's bytes alone (`/raw/` on github.com, or
13
+ * raw.githubusercontent.com). A file's text can be a branch alone (`/blob/release/1.0` names the file `1.0` of
14
+ * `release`, or the branch `release/1.0` and no file); when `resolveRef` settles it with an empty path, the address
15
+ * names a ref and no file, which GitHub answers 404.
13
16
  */
14
17
  export type GitHubLink = {
15
18
  kind: 'github_repository';
@@ -32,18 +35,29 @@ export type GitHubLink = {
32
35
  /**
33
36
  * What a GitHub address names, read without a request. Null for an address whose host is not GitHub's, and for text
34
37
  * that is no address; `refused` for an address on GitHub's hosts that names no repository, folder or file read here: an
35
- * account, an issue, a pull request, a wiki, a release, a commit, a tag, a gist, the API, an archive, GitHub's own
36
- * pages, an address that carries credentials (with a scheme or without one: `<user>:<password>@github.com/...`), and
37
- * a host other than github.com, www.github.com and raw.githubusercontent.com. The scheme (or its absence), a port, the
38
- * dots that end a host, `.git`, a trailing slash, a query and a fragment are ignored, and so is the `git` user of an
39
- * SSH address (`git@github.com:<owner>/<repo>.git`).
38
+ * account, an issue, a pull request, a wiki, a release, a commit, a reference that is neither a branch nor a tag
39
+ * (`refs/pull/<n>/head`), a gist, the API, an archive, GitHub's own pages, an address that carries credentials (with a
40
+ * scheme or without one: `<user>:<password>@github.com/...`), a host of GitHub Enterprise Cloud with data residency
41
+ * (`<subdomain>.ghe.com`), and a host other than github.com, www.github.com and raw.githubusercontent.com. The scheme
42
+ * (or its absence), a port, the dots that end a host, `.git`, a trailing slash, a query and a fragment are ignored, and
43
+ * so is the `git` user of an SSH address (`git@github.com:<owner>/<repo>.git`).
44
+ *
45
+ * The text is read as the URL standard reads an address: the C0 controls and spaces around it, and any other white
46
+ * space there, are dropped, and every tab and newline in it; after `http`, `https`, `ws`, `wss` and `ftp` any run of
47
+ * `/` and `\` stands before the host, none included (`https:github.com/<owner>/<repo>`,
48
+ * `https:\\github.com\<owner>\<repo>`), as a browser opens such an address; after `file`, two of them; after any
49
+ * other scheme, `//`. A backslash in the path is a slash.
40
50
  *
41
51
  * A folder's and a file's ref and path are answered as one text, each segment decoded, since a branch name may hold a
42
- * slash; GitHub's form of a branch by its full name, `refs/heads/<branch>`, is read as the branch. A `/blob/` address
43
- * whose text has no slash names a ref alone and is a folder, as GitHub shows it (its `/blob/<ref>` redirects to
44
- * `/tree/<ref>`); one whose text has a slash is a file, which `resolveRef` may settle as a ref alone (an empty path).
52
+ * slash. A branch's or a tag's full name, `refs/heads/<branch>` or `refs/tags/<tag>`, the form GitHub's own Raw links
53
+ * write, stays whole in it, so `resolveRef` reads the name among the branches or the tags alone: the full name is the
54
+ * one form that tells a tag from a branch of the same name, or a branch from a longer tag beside it (the branch
55
+ * `release` and the tag `release/2.0`). A `/blob/` address whose text has no slash names a ref alone and is a folder,
56
+ * as GitHub shows it (its `/blob/<ref>` redirects to `/tree/<ref>`); one whose text has a slash is a file, which
57
+ * `resolveRef` may settle as a ref alone (an empty path). A full name with nothing after it under `/blob/` or `/raw/`
58
+ * names no file, as GitHub answers it 404, and is refused.
45
59
  *
46
- * @param text The address as pasted; spaces around it are dropped.
60
+ * @param text The address as pasted; the controls and spaces around it are dropped.
47
61
  * @throws TypeError when `text` is not a string.
48
62
  */
49
63
  export declare function parseGitHubLink(text: string): GitHubLink | null;
@@ -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/documents/links.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAA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