@framers/agentos-ext-github 0.1.5 → 0.2.2

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 (61) hide show
  1. package/README.md +89 -1
  2. package/dist/GitHubRepoIndexer.d.ts +20 -8
  3. package/dist/GitHubRepoIndexer.d.ts.map +1 -1
  4. package/dist/GitHubRepoIndexer.js +11 -6
  5. package/dist/GitHubRepoIndexer.js.map +1 -1
  6. package/dist/__tests__/app.test.d.ts +7 -0
  7. package/dist/__tests__/app.test.d.ts.map +1 -0
  8. package/dist/__tests__/app.test.js +398 -0
  9. package/dist/__tests__/app.test.js.map +1 -0
  10. package/dist/__tests__/documents.test.d.ts +7 -0
  11. package/dist/__tests__/documents.test.d.ts.map +1 -0
  12. package/dist/__tests__/documents.test.js +235 -0
  13. package/dist/__tests__/documents.test.js.map +1 -0
  14. package/dist/__tests__/entry.test.d.ts +6 -0
  15. package/dist/__tests__/entry.test.d.ts.map +1 -0
  16. package/dist/__tests__/entry.test.js +17 -0
  17. package/dist/__tests__/entry.test.js.map +1 -0
  18. package/dist/__tests__/indexer.test.js +14 -0
  19. package/dist/__tests__/indexer.test.js.map +1 -1
  20. package/dist/app/credential.d.ts +44 -0
  21. package/dist/app/credential.d.ts.map +1 -0
  22. package/dist/app/credential.js +78 -0
  23. package/dist/app/credential.js.map +1 -0
  24. package/dist/app/http.d.ts +61 -0
  25. package/dist/app/http.d.ts.map +1 -0
  26. package/dist/app/http.js +128 -0
  27. package/dist/app/http.js.map +1 -0
  28. package/dist/app/installations.d.ts +48 -0
  29. package/dist/app/installations.d.ts.map +1 -0
  30. package/dist/app/installations.js +61 -0
  31. package/dist/app/installations.js.map +1 -0
  32. package/dist/app/reconcile.d.ts +85 -0
  33. package/dist/app/reconcile.d.ts.map +1 -0
  34. package/dist/app/reconcile.js +125 -0
  35. package/dist/app/reconcile.js.map +1 -0
  36. package/dist/app/userFlow.d.ts +43 -0
  37. package/dist/app/userFlow.d.ts.map +1 -0
  38. package/dist/app/userFlow.js +54 -0
  39. package/dist/app/userFlow.js.map +1 -0
  40. package/dist/app/webhook.d.ts +18 -0
  41. package/dist/app/webhook.d.ts.map +1 -0
  42. package/dist/app/webhook.js +28 -0
  43. package/dist/app/webhook.js.map +1 -0
  44. package/dist/documents/GitHubDocumentsConnector.d.ts +80 -0
  45. package/dist/documents/GitHubDocumentsConnector.d.ts.map +1 -0
  46. package/dist/documents/GitHubDocumentsConnector.js +158 -0
  47. package/dist/documents/GitHubDocumentsConnector.js.map +1 -0
  48. package/dist/documents/index.d.ts +24 -0
  49. package/dist/documents/index.d.ts.map +1 -0
  50. package/dist/documents/index.js +24 -0
  51. package/dist/documents/index.js.map +1 -0
  52. package/dist/documents/tree.d.ts +71 -0
  53. package/dist/documents/tree.d.ts.map +1 -0
  54. package/dist/documents/tree.js +115 -0
  55. package/dist/documents/tree.js.map +1 -0
  56. package/dist/index.d.ts +2 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +2 -1
  59. package/dist/index.js.map +1 -1
  60. package/manifest.json +5 -3
  61. package/package.json +16 -3
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview A webhook delivery's signature: `X-Hub-Signature-256` is `sha256=` and the hex HMAC SHA-256 of the raw
3
+ * body under the webhook's secret.
4
+ * @module agentos-ext-github/app/webhook
5
+ */
6
+ import { createHmac, timingSafeEqual } from 'node:crypto';
7
+ /**
8
+ * True when `header` is `sha256=` and 64 hex digits that equal the HMAC SHA-256 of the raw body under the secret,
9
+ * compared in constant time. A missing header, another algorithm or another length is false.
10
+ *
11
+ * @param body The delivery's body exactly as received, before any parsing.
12
+ * @param header The `X-Hub-Signature-256` header, or null when the delivery had none.
13
+ * @param secret The webhook's secret, never empty.
14
+ * @throws TypeError when the secret is empty or missing, whatever the delivery: anyone can sign a body under an empty
15
+ * key, so the fault is the host's configuration (such as a secret read from a setting that is not set), never the
16
+ * delivery's.
17
+ */
18
+ export function verifyWebhookSignature(body, header, secret) {
19
+ if (!secret)
20
+ throw new TypeError('A webhook signature needs the webhook secret: anyone can sign a delivery under an empty one');
21
+ const match = header === null ? null : /^sha256=([0-9a-f]{64})$/i.exec(header);
22
+ if (match === null)
23
+ return false;
24
+ const given = Buffer.from(match[1], 'hex');
25
+ const expected = createHmac('sha256', secret).update(body).digest();
26
+ return given.length === expected.length && timingSafeEqual(given, expected);
27
+ }
28
+ //# sourceMappingURL=webhook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/app/webhook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAgB,EAAE,MAAqB,EAAE,MAAc;IAC5F,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,SAAS,CAAC,6FAA6F,CAAC,CAAC;IAChI,MAAM,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/E,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACpE,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,IAAI,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @fileoverview A repository's documentation as account sources, read through a GitHub App's installation: each
3
+ * repository's tree read once a commit within a request budget, the documentation kept by a filter, each file read as
4
+ * raw bytes under a cap, and a push compared by the tree at its `after` commit.
5
+ * @module agentos-ext-github/documents/GitHubDocumentsConnector
6
+ */
7
+ import { type AccountSourceConnector, type SourceChanges, type SourceGone, type SourceItem, type SourceRead, type SourceSelection } from '@framers/agentos-ext-account-sources';
8
+ import type { GitHubAppCredential } from '../app/credential.js';
9
+ import { type TreeBlob, type TreeFilter } from './tree.js';
10
+ /** One repository of a link. */
11
+ export interface LinkedRepository {
12
+ id: number;
13
+ fullName: string;
14
+ defaultBranch: string;
15
+ }
16
+ /**
17
+ * What `changesSince` compares: the repository (its id, first of `ids`), and from a push its `after` commit and its
18
+ * `ref`, with the listing at `after` when the caller holds it.
19
+ */
20
+ export interface GitHubChangesSelection extends SourceSelection {
21
+ /** The commit to compare at; the default branch's head when absent. */
22
+ after?: string;
23
+ /** The push's ref, such as `refs/heads/main`; a push to another branch than the default changes nothing. */
24
+ ref?: string;
25
+ /** The documentation's listing at `after`, which spares the tree's read. */
26
+ listing?: readonly TreeBlob[];
27
+ }
28
+ /**
29
+ * A repository's documentation as account sources: an item's id is `<repositoryId>:<path>`, its version
30
+ * `<blob>@<commit>`, and the cursor of `changesSince` the JSON of each documentation path's blob at the commit last
31
+ * read. An installation is removed by the app's own call (`uninstallInstallation`), never by a link's connector.
32
+ */
33
+ export declare class GitHubDocumentsConnector implements AccountSourceConnector {
34
+ private readonly credential;
35
+ private readonly installationId;
36
+ private readonly repositories;
37
+ private readonly filter;
38
+ private readonly fetchImpl;
39
+ private readonly apiBase;
40
+ readonly kind = "github";
41
+ /**
42
+ * @param credential The app's credential; each repository is read with an installation token narrowed to it.
43
+ * @param installationId The installation the repositories are read through.
44
+ * @param repositories The repositories of the link.
45
+ * @param filter What is kept as documentation, and the bounds on reading it.
46
+ * @param fetchImpl The fetch the repositories are read with.
47
+ * @param apiBase GitHub's REST API, or a stand-in's address in tests.
48
+ */
49
+ constructor(credential: GitHubAppCredential, installationId: number, repositories: readonly LinkedRepository[], filter?: TreeFilter, fetchImpl?: typeof fetch, apiBase?: string);
50
+ private repository;
51
+ private token;
52
+ /** The head commit of a repository's default branch. */
53
+ head(repositoryId: number, signal?: AbortSignal): Promise<string>;
54
+ /**
55
+ * The documentation files of a repository at a commit: its tree read once within the request budget, never walking
56
+ * a skipped folder, then filtered. A caller keeps it for that commit and hands it to `changesSince`.
57
+ */
58
+ listing(repositoryId: number, commit: string, signal?: AbortSignal): Promise<TreeBlob[]>;
59
+ /** The documentation of each selected repository (its id in `ids`) at its default branch's head. */
60
+ list(selection: SourceSelection, signal?: AbortSignal): Promise<{
61
+ items: SourceItem[];
62
+ gone: SourceGone[];
63
+ }>;
64
+ /**
65
+ * A file's raw bytes at the commit of its version, read as a stream and cut at `maxFileBytes`: PDF, Word and HTML
66
+ * as bytes with their media type, the rest as UTF-8 text, each with a `github` attribution linking the file at that
67
+ * commit. A file GitHub no longer has, or one past the cap, is answered gone with reason `removed`.
68
+ */
69
+ read(item: SourceItem, signal?: AbortSignal): Promise<SourceRead | SourceGone>;
70
+ /**
71
+ * What a push to `after` changed, from the listing at `after` (read here when the caller holds none) against the
72
+ * blobs read before (`cursor`: the JSON of each path's blob). A push's own commit lists are never read, so a force
73
+ * push, or a push of more commits than its event lists, is read like any other. A push to another branch than the
74
+ * default answers no change and the cursor it was given.
75
+ */
76
+ changesSince(cursor: string | null, selection: GitHubChangesSelection, signal?: AbortSignal): Promise<SourceChanges>;
77
+ /** Nothing to end here: an installation is removed by the app's own call (`uninstallInstallation`). */
78
+ revoke(): Promise<void>;
79
+ }
80
+ //# sourceMappingURL=GitHubDocumentsConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitHubDocumentsConnector.d.ts","sourceRoot":"","sources":["../../src/documents/GitHubDocumentsConnector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UA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OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAS9F,oGAAoG;IAC9F,IAAI,CAAC,SAAS,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,UAAU,EAAE,CAAC;QAAC,IAAI,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAWlH;;;;OAIG;IACG,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;IAoCpF;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAiB1H,uGAAuG;IACjG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * @fileoverview A repository's documentation as account sources, read through a GitHub App's installation: each
3
+ * repository's tree read once a commit within a request budget, the documentation kept by a filter, each file read as
4
+ * raw bytes under a cap, and a push compared by the tree at its `after` commit.
5
+ * @module agentos-ext-github/documents/GitHubDocumentsConnector
6
+ */
7
+ import { readCapped, ReadCapExceeded, } from '@framers/agentos-ext-account-sources';
8
+ import { discardBody, GITHUB_API_BASE, GitHubApiError, githubFetch, githubHeaders, objectOf, stringIn } from '../app/http.js';
9
+ import { DEFAULT_MAX_FILE_BYTES, extensionOf, pathFilter, readTree, SKIPPED_FOLDERS } from './tree.js';
10
+ /** The files answered as bytes with their media type; every other kept file is answered as text. */
11
+ const MEDIA_TYPES = {
12
+ '.pdf': 'application/pdf',
13
+ '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
14
+ '.html': 'text/html',
15
+ '.htm': 'text/html',
16
+ };
17
+ /** A path with each of its segments encoded for an address. */
18
+ function encodedPath(path) {
19
+ return path.split('/').map(encodeURIComponent).join('/');
20
+ }
21
+ /**
22
+ * A repository's documentation as account sources: an item's id is `<repositoryId>:<path>`, its version
23
+ * `<blob>@<commit>`, and the cursor of `changesSince` the JSON of each documentation path's blob at the commit last
24
+ * read. An installation is removed by the app's own call (`uninstallInstallation`), never by a link's connector.
25
+ */
26
+ export class GitHubDocumentsConnector {
27
+ credential;
28
+ installationId;
29
+ repositories;
30
+ filter;
31
+ fetchImpl;
32
+ apiBase;
33
+ kind = 'github';
34
+ /**
35
+ * @param credential The app's credential; each repository is read with an installation token narrowed to it.
36
+ * @param installationId The installation the repositories are read through.
37
+ * @param repositories The repositories of the link.
38
+ * @param filter What is kept as documentation, and the bounds on reading it.
39
+ * @param fetchImpl The fetch the repositories are read with.
40
+ * @param apiBase GitHub's REST API, or a stand-in's address in tests.
41
+ */
42
+ constructor(credential, installationId, repositories, filter = {}, fetchImpl = fetch, apiBase = GITHUB_API_BASE) {
43
+ this.credential = credential;
44
+ this.installationId = installationId;
45
+ this.repositories = repositories;
46
+ this.filter = filter;
47
+ this.fetchImpl = fetchImpl;
48
+ this.apiBase = apiBase;
49
+ }
50
+ repository(id) {
51
+ const found = this.repositories.find((repository) => repository.id === id);
52
+ if (found === undefined)
53
+ throw new Error(`repository ${id} is not part of this link`);
54
+ return found;
55
+ }
56
+ token(id) {
57
+ return this.credential.installationToken(this.installationId, [id]);
58
+ }
59
+ /** The head commit of a repository's default branch. */
60
+ async head(repositoryId, signal) {
61
+ const repository = this.repository(repositoryId);
62
+ const url = `${this.apiBase}/repos/${repository.fullName}/branches/${encodeURIComponent(repository.defaultBranch)}`;
63
+ const branch = objectOf(await githubFetch(this.fetchImpl, url, { token: await this.token(repositoryId), signal }), 'a branch');
64
+ return stringIn(objectOf(branch.commit, "a branch's commit"), 'sha', "a branch's commit");
65
+ }
66
+ /**
67
+ * The documentation files of a repository at a commit: its tree read once within the request budget, never walking
68
+ * a skipped folder, then filtered. A caller keeps it for that commit and hands it to `changesSince`.
69
+ */
70
+ async listing(repositoryId, commit, signal) {
71
+ const tree = await readTree(this.fetchImpl, await this.token(repositoryId), this.repository(repositoryId).fullName, commit, this.apiBase, {
72
+ maxRequests: this.filter.maxTreeRequests,
73
+ skipFolders: this.filter.skipFolders ?? SKIPPED_FOLDERS,
74
+ signal,
75
+ });
76
+ return pathFilter(this.filter)(tree);
77
+ }
78
+ /** The documentation of each selected repository (its id in `ids`) at its default branch's head. */
79
+ async list(selection, signal) {
80
+ const items = [];
81
+ for (const id of selection.ids.map(Number)) {
82
+ const commit = await this.head(id, signal);
83
+ for (const blob of await this.listing(id, commit, signal)) {
84
+ items.push({ id: `${id}:${blob.path}`, title: blob.path, size: blob.size, version: `${blob.sha}@${commit}` });
85
+ }
86
+ }
87
+ return { items, gone: [] };
88
+ }
89
+ /**
90
+ * A file's raw bytes at the commit of its version, read as a stream and cut at `maxFileBytes`: PDF, Word and HTML
91
+ * as bytes with their media type, the rest as UTF-8 text, each with a `github` attribution linking the file at that
92
+ * commit. A file GitHub no longer has, or one past the cap, is answered gone with reason `removed`.
93
+ */
94
+ async read(item, signal) {
95
+ const [repositoryId, ...rest] = item.id.split(':');
96
+ const path = rest.join(':');
97
+ const repository = this.repository(Number(repositoryId));
98
+ const commit = (item.version ?? '').split('@')[1] ?? repository.defaultBranch;
99
+ const response = await this.fetchImpl(`${this.apiBase}/repos/${repository.fullName}/contents/${encodedPath(path)}?ref=${encodeURIComponent(commit)}`, {
100
+ headers: githubHeaders(await this.token(repository.id), 'application/vnd.github.raw+json'),
101
+ signal,
102
+ });
103
+ if (response.status === 404) {
104
+ await discardBody(response);
105
+ return { id: item.id, reason: 'removed' };
106
+ }
107
+ if (!response.ok) {
108
+ await discardBody(response);
109
+ throw new GitHubApiError(response.status);
110
+ }
111
+ let bytes;
112
+ try {
113
+ bytes = await readCapped(response, this.filter.maxFileBytes ?? DEFAULT_MAX_FILE_BYTES);
114
+ }
115
+ catch (error) {
116
+ if (error instanceof ReadCapExceeded)
117
+ return { id: item.id, reason: 'removed' };
118
+ throw error;
119
+ }
120
+ const ref = {
121
+ kind: 'github',
122
+ title: path,
123
+ path,
124
+ url: `https://github.com/${repository.fullName}/blob/${commit}/${encodedPath(path)}`,
125
+ version: commit,
126
+ readAt: new Date().toISOString(),
127
+ };
128
+ const mediaType = MEDIA_TYPES[extensionOf(path)];
129
+ return { item, content: mediaType === undefined ? { text: new TextDecoder().decode(bytes) } : { bytes, mediaType }, ref };
130
+ }
131
+ /**
132
+ * What a push to `after` changed, from the listing at `after` (read here when the caller holds none) against the
133
+ * blobs read before (`cursor`: the JSON of each path's blob). A push's own commit lists are never read, so a force
134
+ * push, or a push of more commits than its event lists, is read like any other. A push to another branch than the
135
+ * default answers no change and the cursor it was given.
136
+ */
137
+ async changesSince(cursor, selection, signal) {
138
+ const id = Number(selection.ids[0]);
139
+ const repository = this.repository(id);
140
+ if (selection.ref !== undefined && selection.ref !== `refs/heads/${repository.defaultBranch}`) {
141
+ return { changed: [], gone: [], cursor: cursor ?? '{}' };
142
+ }
143
+ const before = new Map(Object.entries(cursor === null ? {} : JSON.parse(cursor)));
144
+ const after = selection.after ?? (await this.head(id, signal));
145
+ const blobs = selection.listing ?? (await this.listing(id, after, signal));
146
+ const now = new Map(blobs.map((blob) => [blob.path, blob.sha]));
147
+ const changed = blobs
148
+ .filter((blob) => before.get(blob.path) !== blob.sha)
149
+ .map((blob) => ({ id: `${id}:${blob.path}`, title: blob.path, size: blob.size, version: `${blob.sha}@${after}` }));
150
+ const gone = [...before.keys()].filter((path) => !now.has(path)).map((path) => ({ id: `${id}:${path}`, reason: 'removed' }));
151
+ return { changed, gone, cursor: JSON.stringify(Object.fromEntries(now)) };
152
+ }
153
+ /** Nothing to end here: an installation is removed by the app's own call (`uninstallInstallation`). */
154
+ async revoke() {
155
+ // A link's connector holds no grant of its own; the app's installation outlives any one link.
156
+ }
157
+ }
158
+ //# sourceMappingURL=GitHubDocumentsConnector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitHubDocumentsConnector.js","sourceRoot":"","sources":["../../src/documents/GitHubDocumentsConnector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,UAAU,EACV,eAAe,GAQhB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9H,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAkC,MAAM,WAAW,CAAC;AAsBvI,oGAAoG;AACpG,MAAM,WAAW,GAAqC;IACpD,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,yEAAyE;IAClF,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,WAAW;CACpB,CAAC;AAEF,+DAA+D;AAC/D,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IAYhB;IACA;IACA;IACA;IACA;IACA;IAhBV,IAAI,GAAG,QAAQ,CAAC;IAEzB;;;;;;;OAOG;IACH,YACmB,UAA+B,EAC/B,cAAsB,EACtB,YAAyC,EACzC,SAAqB,EAAE,EACvB,YAA0B,KAAK,EAC/B,UAAU,eAAe;QALzB,eAAU,GAAV,UAAU,CAAqB;QAC/B,mBAAc,GAAd,cAAc,CAAQ;QACtB,iBAAY,GAAZ,YAAY,CAA6B;QACzC,WAAM,GAAN,MAAM,CAAiB;QACvB,cAAS,GAAT,SAAS,CAAsB;QAC/B,YAAO,GAAP,OAAO,CAAkB;IACzC,CAAC;IAEI,UAAU,CAAC,EAAU;QAC3B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,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IAC5E,CAAC;IAED,uGAAuG;IACvG,KAAK,CAAC,MAAM;QACV,8FAA8F;IAChG,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @fileoverview The `./documents` entry: a GitHub App's installation mode (its JWT and installation tokens, the user's
3
+ * web flow, what a user token reaches, the webhook signature, the daily reconcile, the uninstall) and
4
+ * `GitHubDocumentsConnector`, a repository's documentation as an account source. Every call goes to GitHub's REST API
5
+ * over an injected `fetch`.
6
+ * @module agentos-ext-github/documents
7
+ */
8
+ /** The documentation connector and the shape of a push it compares. */
9
+ export { GitHubDocumentsConnector, type GitHubChangesSelection, type LinkedRepository } from './GitHubDocumentsConnector.js';
10
+ /** A repository's tree within a request budget, and the filter that keeps its documentation. */
11
+ export { readTree, pathFilter, extensionOf, TreeTooLarge, DOCUMENT_EXTENSIONS, SKIPPED_FOLDERS, DEFAULT_MAX_FILES, DEFAULT_MAX_FILE_BYTES, DEFAULT_MAX_TREE_REQUESTS, type ReadTreeOptions, type TreeBlob, type TreeFilter, } from './tree.js';
12
+ /** The app's JWT and installation tokens. */
13
+ export { appJwt, GitHubAppCredential, type GitHubAppIdentity } from '../app/credential.js';
14
+ /** The user's web flow on the auth module's redirect flow. */
15
+ export { GitHubAppUserFlow, GITHUB_OAUTH_ENDPOINTS, type GitHubAppClient, type GitHubOAuthEndpoints } from '../app/userFlow.js';
16
+ /** What a user token reaches, and the app's own installations. */
17
+ export { userOfToken, installationsOfUser, repositoriesOfUser, listInstallations, uninstallInstallation, type GitHubAccount, type GitHubInstallation, type GitHubUser, type UserRepository, } from '../app/installations.js';
18
+ /** A webhook delivery's signature. */
19
+ export { verifyWebhookSignature } from '../app/webhook.js';
20
+ /** The daily reconcile. */
21
+ export { reconcileInstallations, type DeliveriesOutcome, type MovedRepository, type ReconcileLink, type ReconcileOptions, type ReconcileOutcome, type ReconcileRepository, type RefusedRedelivery, type UnreadableRepository, } from '../app/reconcile.js';
22
+ /** The API version every call pins, GitHub's address, and the error of an answer outside 2xx. */
23
+ export { GITHUB_API_BASE, GITHUB_API_VERSION, GitHubApiError, type GitHubApiOptions } from '../app/http.js';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,uEAAuE;AACvE,OAAO,EAAE,wBAAwB,EAAE,KAAK,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC7H,gGAAgG;AAChG,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AACnB,6CAA6C;AAC7C,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,8DAA8D;AAC9D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAChI,kEAAkE;AAClE,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,yBAAyB,CAAC;AACjC,sCAAsC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,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,iGAAiG;AACjG,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @fileoverview The `./documents` entry: a GitHub App's installation mode (its JWT and installation tokens, the user's
3
+ * web flow, what a user token reaches, the webhook signature, the daily reconcile, the uninstall) and
4
+ * `GitHubDocumentsConnector`, a repository's documentation as an account source. Every call goes to GitHub's REST API
5
+ * over an injected `fetch`.
6
+ * @module agentos-ext-github/documents
7
+ */
8
+ /** The documentation connector and the shape of a push it compares. */
9
+ export { GitHubDocumentsConnector } from './GitHubDocumentsConnector.js';
10
+ /** A repository's tree within a request budget, and the filter that keeps its documentation. */
11
+ export { readTree, pathFilter, extensionOf, TreeTooLarge, DOCUMENT_EXTENSIONS, SKIPPED_FOLDERS, DEFAULT_MAX_FILES, DEFAULT_MAX_FILE_BYTES, DEFAULT_MAX_TREE_REQUESTS, } from './tree.js';
12
+ /** The app's JWT and installation tokens. */
13
+ export { appJwt, GitHubAppCredential } from '../app/credential.js';
14
+ /** The user's web flow on the auth module's redirect flow. */
15
+ export { GitHubAppUserFlow, GITHUB_OAUTH_ENDPOINTS } from '../app/userFlow.js';
16
+ /** What a user token reaches, and the app's own installations. */
17
+ export { userOfToken, installationsOfUser, repositoriesOfUser, listInstallations, uninstallInstallation, } from '../app/installations.js';
18
+ /** A webhook delivery's signature. */
19
+ export { verifyWebhookSignature } from '../app/webhook.js';
20
+ /** The daily reconcile. */
21
+ export { reconcileInstallations, } from '../app/reconcile.js';
22
+ /** The API version every call pins, GitHub's address, and the error of an answer outside 2xx. */
23
+ export { GITHUB_API_BASE, GITHUB_API_VERSION, GitHubApiError } from '../app/http.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/documents/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,uEAAuE;AACvE,OAAO,EAAE,wBAAwB,EAAsD,MAAM,+BAA+B,CAAC;AAC7H,gGAAgG;AAChG,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,GAI1B,MAAM,WAAW,CAAC;AACnB,6CAA6C;AAC7C,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAA0B,MAAM,sBAAsB,CAAC;AAC3F,8DAA8D;AAC9D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAmD,MAAM,oBAAoB,CAAC;AAChI,kEAAkE;AAClE,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GAKtB,MAAM,yBAAyB,CAAC;AACjC,sCAAsC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,2BAA2B;AAC3B,OAAO,EACL,sBAAsB,GASvB,MAAM,qBAAqB,CAAC;AAC7B,iGAAiG;AACjG,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAyB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @fileoverview A repository's tree at a commit, read within a request budget, and the filter that keeps its
3
+ * documentation. GitHub cuts a recursive tree past 100,000 entries or 7 MB and marks it `truncated`; such a tree is
4
+ * read again one subtree at a time.
5
+ * @module agentos-ext-github/documents/tree
6
+ */
7
+ /** One file of a tree: its path from the repository's root, its blob and its size in bytes. */
8
+ export interface TreeBlob {
9
+ path: string;
10
+ sha: string;
11
+ size: number;
12
+ }
13
+ /** What a repository's documentation is: the files kept and the bounds on reading them. Each has a default. */
14
+ export interface TreeFilter {
15
+ /** The file extensions kept, with their dot ({@link DOCUMENT_EXTENSIONS} when absent). */
16
+ extensions?: readonly string[];
17
+ /** The folders skipped at any depth, by name ({@link SKIPPED_FOLDERS} when absent). */
18
+ skipFolders?: readonly string[];
19
+ /** At most this many files, in path order ({@link DEFAULT_MAX_FILES} when absent). */
20
+ maxFiles?: number;
21
+ /** A file larger than this is left out of a listing, and a read past it is answered gone ({@link DEFAULT_MAX_FILE_BYTES} when absent). */
22
+ maxFileBytes?: number;
23
+ /** At most this many tree requests to list one commit ({@link DEFAULT_MAX_TREE_REQUESTS} when absent). */
24
+ maxTreeRequests?: number;
25
+ }
26
+ /** The documentation kept by default: Markdown, text, reStructuredText, HTML, PDF and Word files. */
27
+ export declare const DOCUMENT_EXTENSIONS: readonly string[];
28
+ /** The folders skipped by default: dependencies, build output and vendored code. */
29
+ export declare const SKIPPED_FOLDERS: readonly string[];
30
+ /** The files kept by default. */
31
+ export declare const DEFAULT_MAX_FILES = 2000;
32
+ /** The largest file kept by default: 10 MiB. */
33
+ export declare const DEFAULT_MAX_FILE_BYTES = 10485760;
34
+ /** The tree requests one listing makes by default. */
35
+ export declare const DEFAULT_MAX_TREE_REQUESTS = 50;
36
+ /** A tree that cannot be read within its request budget. */
37
+ export declare class TreeTooLarge extends Error {
38
+ readonly maxRequests: number;
39
+ /** @param maxRequests The budget the tree needed more than. */
40
+ constructor(maxRequests: number);
41
+ }
42
+ /** The budget of a tree read, the folders it never walks into, and its abort signal. */
43
+ export interface ReadTreeOptions {
44
+ /** At most this many requests ({@link DEFAULT_MAX_TREE_REQUESTS} when absent). */
45
+ maxRequests?: number;
46
+ /** Folders, by name, whose files are left out and which a read by subtree never requests. */
47
+ skipFolders?: readonly string[];
48
+ signal?: AbortSignal;
49
+ }
50
+ /** A file's extension with its dot, in lower case, or `''` when its name has none. */
51
+ export declare function extensionOf(path: string): string;
52
+ /**
53
+ * Every file of a repository's tree at a commit (symbolic links aside). The tree is asked for recursively; when GitHub
54
+ * answers it truncated, its top level is read and each subtree is asked for the same way, so only the parts too large
55
+ * for one answer cost a request per folder. Each request counts against `maxRequests`, and the read throws
56
+ * {@link TreeTooLarge} rather than make one more.
57
+ *
58
+ * @param fetchImpl The fetch the tree is read with.
59
+ * @param token An installation token that reads the repository.
60
+ * @param repo The repository's full name, `owner/name`.
61
+ * @param commit The commit whose tree is read.
62
+ * @param apiBase GitHub's REST API, or a stand-in's address in tests.
63
+ * @param options The request budget, the folders skipped and an abort signal.
64
+ */
65
+ export declare function readTree(fetchImpl: typeof fetch, token: string, repo: string, commit: string, apiBase?: string, options?: ReadTreeOptions): Promise<TreeBlob[]>;
66
+ /**
67
+ * The filter that keeps a tree's documentation: the extensions kept, nothing under a skipped folder, nothing past the
68
+ * size cap, in path order, at most `maxFiles`.
69
+ */
70
+ export declare function pathFilter(filter?: TreeFilter): (blobs: readonly TreeBlob[]) => TreeBlob[];
71
+ //# sourceMappingURL=tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/documents/tree.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,+FAA+F;AAC/F,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+GAA+G;AAC/G,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,uFAAuF;IACvF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0IAA0I;IAC1I,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0GAA0G;IAC1G,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAA2E,CAAC;AAE7H,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAuE,CAAC;AAErH,iCAAiC;AACjC,eAAO,MAAM,iBAAiB,OAAQ,CAAC;AAEvC,gDAAgD;AAChD,eAAO,MAAM,sBAAsB,WAAa,CAAC;AAEjD,sDAAsD;AACtD,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAK5C,4DAA4D;AAC5D,qBAAa,YAAa,SAAQ,KAAK;IAEzB,QAAQ,CAAC,WAAW,EAAE,MAAM;IADxC,+DAA+D;gBAC1C,WAAW,EAAE,MAAM;CAIzC;AAED,wFAAwF;AACxF,MAAM,WAAW,eAAe;IAC9B,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAsBD,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIhD;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,OAAO,KAAK,EACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,MAAwB,EACjC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsCrB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,GAAE,UAAe,GAAG,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAU9F"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @fileoverview A repository's tree at a commit, read within a request budget, and the filter that keeps its
3
+ * documentation. GitHub cuts a recursive tree past 100,000 entries or 7 MB and marks it `truncated`; such a tree is
4
+ * read again one subtree at a time.
5
+ * @module agentos-ext-github/documents/tree
6
+ */
7
+ import { arrayOf, GITHUB_API_BASE, githubFetch, objectOf, stringIn } from '../app/http.js';
8
+ /** The documentation kept by default: Markdown, text, reStructuredText, HTML, PDF and Word files. */
9
+ export const DOCUMENT_EXTENSIONS = ['.md', '.markdown', '.txt', '.rst', '.html', '.htm', '.pdf', '.docx'];
10
+ /** The folders skipped by default: dependencies, build output and vendored code. */
11
+ export const SKIPPED_FOLDERS = ['node_modules', 'vendor', 'dist', 'build', '.git', 'third_party'];
12
+ /** The files kept by default. */
13
+ export const DEFAULT_MAX_FILES = 2_000;
14
+ /** The largest file kept by default: 10 MiB. */
15
+ export const DEFAULT_MAX_FILE_BYTES = 10_485_760;
16
+ /** The tree requests one listing makes by default. */
17
+ export const DEFAULT_MAX_TREE_REQUESTS = 50;
18
+ /** A symbolic link's mode in a tree; its blob holds the link's target, not a document. */
19
+ const SYMLINK_MODE = '120000';
20
+ /** A tree that cannot be read within its request budget. */
21
+ export class TreeTooLarge extends Error {
22
+ maxRequests;
23
+ /** @param maxRequests The budget the tree needed more than. */
24
+ constructor(maxRequests) {
25
+ super(`the tree needs more than ${maxRequests} requests to read`);
26
+ this.maxRequests = maxRequests;
27
+ this.name = 'TreeTooLarge';
28
+ }
29
+ }
30
+ function entryOf(value) {
31
+ const fields = objectOf(value, 'a tree entry');
32
+ return {
33
+ path: stringIn(fields, 'path', 'a tree entry'),
34
+ type: stringIn(fields, 'type', 'a tree entry'),
35
+ sha: stringIn(fields, 'sha', 'a tree entry'),
36
+ mode: typeof fields.mode === 'string' ? fields.mode : '',
37
+ size: typeof fields.size === 'number' ? fields.size : null,
38
+ };
39
+ }
40
+ /** A file's extension with its dot, in lower case, or `''` when its name has none. */
41
+ export function extensionOf(path) {
42
+ const name = path.slice(path.lastIndexOf('/') + 1);
43
+ const dot = name.lastIndexOf('.');
44
+ return dot <= 0 ? '' : name.slice(dot).toLowerCase();
45
+ }
46
+ function inSkippedFolder(path, skip) {
47
+ return path.split('/').slice(0, -1).some((folder) => skip.has(folder));
48
+ }
49
+ /**
50
+ * Every file of a repository's tree at a commit (symbolic links aside). The tree is asked for recursively; when GitHub
51
+ * answers it truncated, its top level is read and each subtree is asked for the same way, so only the parts too large
52
+ * for one answer cost a request per folder. Each request counts against `maxRequests`, and the read throws
53
+ * {@link TreeTooLarge} rather than make one more.
54
+ *
55
+ * @param fetchImpl The fetch the tree is read with.
56
+ * @param token An installation token that reads the repository.
57
+ * @param repo The repository's full name, `owner/name`.
58
+ * @param commit The commit whose tree is read.
59
+ * @param apiBase GitHub's REST API, or a stand-in's address in tests.
60
+ * @param options The request budget, the folders skipped and an abort signal.
61
+ */
62
+ export async function readTree(fetchImpl, token, repo, commit, apiBase = GITHUB_API_BASE, options = {}) {
63
+ const maxRequests = options.maxRequests ?? DEFAULT_MAX_TREE_REQUESTS;
64
+ const skip = new Set(options.skipFolders ?? []);
65
+ const blobs = [];
66
+ let requests = 0;
67
+ const read = async (sha, recursive) => {
68
+ if (requests >= maxRequests)
69
+ throw new TreeTooLarge(maxRequests);
70
+ requests += 1;
71
+ const url = `${apiBase}/repos/${repo}/git/trees/${encodeURIComponent(sha)}${recursive ? '?recursive=1' : ''}`;
72
+ const answer = objectOf(await githubFetch(fetchImpl, url, { token, signal: options.signal }), 'a tree');
73
+ return { truncated: answer.truncated === true, entries: arrayOf(answer.tree, 'a tree').map(entryOf) };
74
+ };
75
+ const keep = (entry, path) => {
76
+ if (entry.type === 'blob' && entry.mode !== SYMLINK_MODE && !inSkippedFolder(path, skip)) {
77
+ blobs.push({ path, sha: entry.sha, size: entry.size ?? 0 });
78
+ }
79
+ };
80
+ const walk = async (sha, prefix) => {
81
+ const whole = await read(sha, true);
82
+ if (!whole.truncated) {
83
+ for (const entry of whole.entries)
84
+ keep(entry, `${prefix}${entry.path}`);
85
+ return;
86
+ }
87
+ const top = await read(sha, false);
88
+ for (const entry of top.entries) {
89
+ if (entry.type === 'tree') {
90
+ if (!skip.has(entry.path))
91
+ await walk(entry.sha, `${prefix}${entry.path}/`);
92
+ }
93
+ else {
94
+ keep(entry, `${prefix}${entry.path}`);
95
+ }
96
+ }
97
+ };
98
+ await walk(commit, '');
99
+ return blobs;
100
+ }
101
+ /**
102
+ * The filter that keeps a tree's documentation: the extensions kept, nothing under a skipped folder, nothing past the
103
+ * size cap, in path order, at most `maxFiles`.
104
+ */
105
+ export function pathFilter(filter = {}) {
106
+ const extensions = new Set((filter.extensions ?? DOCUMENT_EXTENSIONS).map((extension) => extension.toLowerCase()));
107
+ const skip = new Set(filter.skipFolders ?? SKIPPED_FOLDERS);
108
+ const maxFiles = filter.maxFiles ?? DEFAULT_MAX_FILES;
109
+ const maxFileBytes = filter.maxFileBytes ?? DEFAULT_MAX_FILE_BYTES;
110
+ return (blobs) => blobs
111
+ .filter((blob) => extensions.has(extensionOf(blob.path)) && blob.size <= maxFileBytes && !inSkippedFolder(blob.path, skip))
112
+ .sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0))
113
+ .slice(0, maxFiles);
114
+ }
115
+ //# sourceMappingURL=tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/documents/tree.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAuB3F,qGAAqG;AACrG,MAAM,CAAC,MAAM,mBAAmB,GAAsB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7H,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;AAErH,iCAAiC;AACjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC,gDAAgD;AAChD,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAEjD,sDAAsD;AACtD,MAAM,CAAC,M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dist/index.d.ts CHANGED
@@ -82,6 +82,7 @@ export { GitHubFileWriteTool } from './tools/fileWrite.js';
82
82
  export { GitHubBranchListTool } from './tools/branchList.js';
83
83
  export { GitHubBranchCreateTool } from './tools/branchCreate.js';
84
84
  export { GitHubCommitListTool } from './tools/commitList.js';
85
- export { GitHubRepoIndexer } from './GitHubRepoIndexer.js';
85
+ /** The repository indexer, the repositories it indexes by default, and the types of its options. */
86
+ export { GitHubRepoIndexer, ECOSYSTEM_REPOS, type GitHubRepoIndexerOptions, type IndexedRepository } from './GitHubRepoIndexer.js';
86
87
  export default createExtensionPack;
87
88
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,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,CAAC"}
package/dist/index.js CHANGED
@@ -138,6 +138,7 @@ export { GitHubFileWriteTool } from './tools/fileWrite.js';
138
138
  export { GitHubBranchListTool } from './tools/branchList.js';
139
139
  export { GitHubBranchCreateTool } from './tools/branchCreate.js';
140
140
  export { GitHubCommitListTool } from './tools/commitList.js';
141
- export { GitHubRepoIndexer } from './GitHubRepoIndexer.js';
141
+ /** The repository indexer, the repositories it indexes by default, and the types of its options. */
142
+ export { GitHubRepoIndexer, ECOSYSTEM_REPOS } from './GitHubRepoIndexer.js';
142
143
  export default createExtensionPack;
143
144
  //# 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":"AAAA,cAAc;AACd;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,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