@codetreker/daynight 0.0.0-stage → 0.2.3

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 (47) hide show
  1. package/dist/cli.d.ts +17 -0
  2. package/dist/cli.js +164 -0
  3. package/dist/cli.js.map +1 -0
  4. package/dist/config.d.ts +32 -0
  5. package/dist/config.js +263 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/coordinator.d.ts +39 -0
  8. package/dist/coordinator.js +390 -0
  9. package/dist/coordinator.js.map +1 -0
  10. package/dist/copilot.d.ts +44 -0
  11. package/dist/copilot.js +263 -0
  12. package/dist/copilot.js.map +1 -0
  13. package/dist/diagnostics.d.ts +1 -0
  14. package/dist/diagnostics.js +16 -0
  15. package/dist/diagnostics.js.map +1 -0
  16. package/dist/git.d.ts +41 -0
  17. package/dist/git.js +539 -0
  18. package/dist/git.js.map +1 -0
  19. package/dist/github.d.ts +70 -0
  20. package/dist/github.js +675 -0
  21. package/dist/github.js.map +1 -0
  22. package/dist/instance-lock.d.ts +5 -0
  23. package/dist/instance-lock.js +115 -0
  24. package/dist/instance-lock.js.map +1 -0
  25. package/dist/main.d.ts +2 -0
  26. package/dist/main.js +12 -0
  27. package/dist/main.js.map +1 -0
  28. package/dist/paths.d.ts +33 -0
  29. package/dist/paths.js +155 -0
  30. package/dist/paths.js.map +1 -0
  31. package/dist/processes.d.ts +23 -0
  32. package/dist/processes.js +182 -0
  33. package/dist/processes.js.map +1 -0
  34. package/dist/repositories.d.ts +15 -0
  35. package/dist/repositories.js +159 -0
  36. package/dist/repositories.js.map +1 -0
  37. package/dist/review-list.d.ts +5 -0
  38. package/dist/review-list.js +122 -0
  39. package/dist/review-list.js.map +1 -0
  40. package/dist/runtime.d.ts +24 -0
  41. package/dist/runtime.js +77 -0
  42. package/dist/runtime.js.map +1 -0
  43. package/dist/store.d.ts +136 -0
  44. package/dist/store.js +579 -0
  45. package/dist/store.js.map +1 -0
  46. package/package.json +40 -4
  47. package/README.md +0 -3
@@ -0,0 +1,70 @@
1
+ import type { RepositoryConfiguration } from "./config.js";
2
+ import type { PullRequestObservation, RepositoryIdentity, RepositoryState, Store } from "./store.js";
3
+ export type CommandOptions = {
4
+ timeoutMs: number;
5
+ maxBufferBytes: number;
6
+ signal?: AbortSignal;
7
+ environment?: Record<string, string | undefined>;
8
+ };
9
+ export type CommandResult = {
10
+ stdout: string;
11
+ stderr: string;
12
+ error: Error | null;
13
+ };
14
+ export type CommandExecutor = (file: string, args: readonly string[], options: CommandOptions) => Promise<CommandResult>;
15
+ export type GitHubRepository = RepositoryIdentity & {
16
+ owner: string;
17
+ name: string;
18
+ };
19
+ export type PullRequestChecks = {
20
+ headSha: string;
21
+ baseRef: string;
22
+ ready: boolean;
23
+ };
24
+ export type GitHubClient = {
25
+ resolveRepository: (configuration: RepositoryConfiguration, signal?: AbortSignal) => Promise<GitHubRepository>;
26
+ listPullRequestNumbers: (repository: GitHubRepository, signal?: AbortSignal) => Promise<number[]>;
27
+ listOpenPullRequests: (repository: GitHubRepository, cutoff: number, signal?: AbortSignal) => Promise<PullRequestObservation[]>;
28
+ getPullRequest: (repository: GitHubRepository, number: number, signal?: AbortSignal) => Promise<PullRequestObservation>;
29
+ getPullRequestChecks: (repository: GitHubRepository, number: number, signal?: AbortSignal) => Promise<PullRequestChecks>;
30
+ };
31
+ export declare class GitHubApiError extends Error {
32
+ readonly status: number | null;
33
+ readonly retryAt: number | null;
34
+ constructor(message: string, options?: {
35
+ status?: number;
36
+ retryAt?: number | null;
37
+ cause?: unknown;
38
+ });
39
+ }
40
+ export declare const executeCommand: CommandExecutor;
41
+ export declare const sanitizedProcessError: (error: unknown) => Error;
42
+ export type GitHubAuthentication = {
43
+ hostname: string;
44
+ environment: Record<string, string | undefined> | undefined;
45
+ sensitive: boolean;
46
+ };
47
+ export declare const prepareGitHubAuthentication: (host: string, execute: CommandExecutor, options: Pick<CommandOptions, "timeoutMs" | "maxBufferBytes" | "signal">) => Promise<GitHubAuthentication>;
48
+ export declare const createGitHubClient: (options?: {
49
+ execute?: CommandExecutor;
50
+ now?: () => number;
51
+ timeoutMs?: number;
52
+ maxBufferBytes?: number;
53
+ }) => GitHubClient;
54
+ export declare const pollRepository: (store: Store, configuration: RepositoryConfiguration, client: GitHubClient, options: {
55
+ now: () => number;
56
+ signal?: AbortSignal;
57
+ }) => Promise<RepositoryState>;
58
+ export type RepositoryPollResult = {
59
+ configuration: RepositoryConfiguration;
60
+ ok: true;
61
+ repository: RepositoryState;
62
+ } | {
63
+ configuration: RepositoryConfiguration;
64
+ ok: false;
65
+ error: unknown;
66
+ };
67
+ export declare const pollRepositories: (store: Store, configurations: readonly RepositoryConfiguration[], client: GitHubClient, options: {
68
+ now: () => number;
69
+ signal?: AbortSignal;
70
+ }) => Promise<RepositoryPollResult[]>;