@cvr/linear 0.3.0 → 0.5.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.
@@ -1,13 +1,10 @@
1
1
  import { Console, Effect } from "effect";
2
- import { Command, Flag } from "effect/unstable/cli";
2
+ import { Command } from "effect/unstable/cli";
3
+ import { jsonFlag } from "../lib/flags.js";
3
4
  import { encodeJson } from "../lib/json.js";
4
5
  import { LinearService } from "../services/Linear.js";
5
6
 
6
- const jsonOption = Flag.boolean("json").pipe(
7
- Flag.withDescription("Emit stable JSON for scripts and agents"),
8
- );
9
-
10
- export const projectListCommand = Command.make("list", { json: jsonOption }, ({ json }) =>
7
+ export const projectListCommand = Command.make("list", { json: jsonFlag }, ({ json }) =>
11
8
  Effect.gen(function* () {
12
9
  const linear = yield* LinearService;
13
10
  const projects = yield* linear.getProjects;
@@ -18,7 +15,7 @@ export const projectListCommand = Command.make("list", { json: jsonOption }, ({
18
15
  projects.map((project) => ({
19
16
  id: project.id,
20
17
  name: project.name,
21
- slug: project.slugId,
18
+ slug: project.slug,
22
19
  state: project.state,
23
20
  url: project.url,
24
21
  })),
@@ -38,8 +35,17 @@ export const projectListCommand = Command.make("list", { json: jsonOption }, ({
38
35
  }
39
36
  yield* Console.log("");
40
37
  }),
38
+ ).pipe(
39
+ Command.withDescription("List Linear projects"),
40
+ Command.withExamples([
41
+ { command: "linear project list", description: "List all projects" },
42
+ { command: "linear project list --json", description: "List all projects as JSON" },
43
+ ]),
41
44
  );
42
45
 
43
46
  export const project = Command.make("project", {}, () =>
44
47
  Console.log("Use 'linear project list' to list projects. See --help for more."),
45
- ).pipe(Command.withSubcommands([projectListCommand]));
48
+ ).pipe(
49
+ Command.withDescription("Manage Linear projects"),
50
+ Command.withSubcommands([projectListCommand]),
51
+ );
@@ -1,20 +1,21 @@
1
- import { Command, Flag } from "effect/unstable/cli";
1
+ import { Command } from "effect/unstable/cli";
2
2
  import { Console, Effect } from "effect";
3
+ import { jsonFlag } from "../lib/flags.js";
3
4
  import { encodeJson } from "../lib/json.js";
4
5
  import { LinearService } from "../services/Linear.js";
5
6
 
6
- const jsonOption = Flag.boolean("json").pipe(
7
- Flag.withDescription("Emit stable JSON for scripts and agents"),
8
- );
9
-
10
7
  // linear team list - List all teams
11
- export const teamListCommand = Command.make("list", { json: jsonOption }, ({ json }) =>
8
+ export const teamListCommand = Command.make("list", { json: jsonFlag }, ({ json }) =>
12
9
  Effect.gen(function* () {
13
10
  const linear = yield* LinearService;
14
11
  const teams = yield* linear.getTeams;
15
12
 
16
13
  if (teams.length === 0) {
17
- yield* Console.log(json ? "[]" : "No teams found.");
14
+ if (json) {
15
+ yield* Console.log("[]");
16
+ } else {
17
+ yield* Console.log("No teams found.");
18
+ }
18
19
  return;
19
20
  }
20
21
 
@@ -37,16 +38,27 @@ export const teamListCommand = Command.make("list", { json: jsonOption }, ({ jso
37
38
  for (const team of teams) {
38
39
  const key = team.key;
39
40
  const name = team.name;
40
- const description =
41
- team.description !== undefined && team.description !== null ? ` - ${team.description}` : "";
42
- yield* Console.log(` ${key.padEnd(8)} ${name}${description}`);
41
+ yield* Console.log(` ${key.padEnd(8)} ${name}${formatDescription(team.description)}`);
43
42
  }
44
43
 
45
44
  yield* Console.log("");
46
45
  }),
46
+ ).pipe(
47
+ Command.withDescription("List Linear teams"),
48
+ Command.withExamples([
49
+ { command: "linear team list", description: "List all teams" },
50
+ { command: "linear team list --json", description: "List all teams as JSON" },
51
+ ]),
47
52
  );
48
53
 
49
54
  // Combined team command with subcommands
50
55
  export const team = Command.make("team", {}, () =>
51
56
  Console.log("Use 'linear team list' to list teams. See --help for more."),
52
- ).pipe(Command.withSubcommands([teamListCommand]));
57
+ ).pipe(Command.withDescription("Manage Linear teams"), Command.withSubcommands([teamListCommand]));
58
+
59
+ function formatDescription(description: string | null | undefined): string {
60
+ if (description === undefined || description === null) {
61
+ return "";
62
+ }
63
+ return ` - ${description}`;
64
+ }
@@ -0,0 +1,81 @@
1
+ import { Result } from "effect";
2
+ import { IssueFile } from "./Linear.js";
3
+
4
+ // Markdown links and images whose target is a Linear upload: `[name](url)` or `![name](url)`.
5
+ const uploadLinkPattern = /!?\[([^\]]*)\]\(<?(https:\/\/uploads\.linear\.app\/[^)\s>]+)>?\)/g;
6
+
7
+ export const extractUploadLinks = (
8
+ markdown: string | undefined,
9
+ source: string,
10
+ ): ReadonlyArray<IssueFile> => {
11
+ if (markdown === undefined) {
12
+ return [];
13
+ }
14
+ return Array.from(markdown.matchAll(uploadLinkPattern), (match) =>
15
+ IssueFile.make({ name: match[1] ?? "", url: match[2] ?? "", source }),
16
+ );
17
+ };
18
+
19
+ /** Keeps the first link to each URL. */
20
+ export const uniqueByUrl = (files: ReadonlyArray<IssueFile>): ReadonlyArray<IssueFile> => {
21
+ const seenUrls = new Set<string>();
22
+ return files.filter((file) => {
23
+ if (seenUrls.has(file.url)) {
24
+ return false;
25
+ }
26
+ seenUrls.add(file.url);
27
+ return true;
28
+ });
29
+ };
30
+
31
+ const unsafeFileNameCharacters = /[^A-Za-z0-9._ ()-]/g;
32
+
33
+ /** A plain file name that cannot leave the output directory. */
34
+ export const toSafeFileName = (candidate: string): string => {
35
+ const baseName = candidate.split(/[/\\]/).pop() ?? "";
36
+ const cleaned = baseName
37
+ .replace(unsafeFileNameCharacters, "_")
38
+ .replace(/^[.\s]+/, "")
39
+ .trim();
40
+ if (cleaned.length === 0) {
41
+ return "download";
42
+ }
43
+ return cleaned;
44
+ };
45
+
46
+ const splitExtension = (
47
+ fileName: string,
48
+ ): { readonly stem: string; readonly extension: string } => {
49
+ const dotIndex = fileName.lastIndexOf(".");
50
+ if (dotIndex <= 0) {
51
+ return { stem: fileName, extension: "" };
52
+ }
53
+ return { stem: fileName.slice(0, dotIndex), extension: fileName.slice(dotIndex) };
54
+ };
55
+
56
+ /** `report.pdf`, then `report-2.pdf`, `report-3.pdf`, ... for names already taken in this run. */
57
+ export const withUniqueSuffix = (fileName: string, takenNames: ReadonlySet<string>): string => {
58
+ if (!takenNames.has(fileName)) {
59
+ return fileName;
60
+ }
61
+ const { stem, extension } = splitExtension(fileName);
62
+ let counter = 2;
63
+ while (takenNames.has(`${stem}-${counter}${extension}`)) {
64
+ counter += 1;
65
+ }
66
+ return `${stem}-${counter}${extension}`;
67
+ };
68
+
69
+ const contentDispositionFileName = /filename\*?=(?:UTF-8'')?"?([^";]+)"?/i;
70
+
71
+ export const fileNameFromContentDisposition = (header: string | null): string | undefined => {
72
+ const match = header?.match(contentDispositionFileName);
73
+ if (match?.[1] === undefined) {
74
+ return undefined;
75
+ }
76
+ const rawName = match[1];
77
+ return Result.getOrElse(
78
+ Result.try(() => decodeURIComponent(rawName)),
79
+ () => rawName,
80
+ );
81
+ };
@@ -0,0 +1,68 @@
1
+ import { Effect } from "effect";
2
+ import { IssueSelector, UploadUrl } from "./Linear.js";
3
+ import { InvalidInputError } from "../lib/errors.js";
4
+
5
+ const issueIdentifierPattern = /^[A-Za-z][A-Za-z0-9]*-\d+$/;
6
+ const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
7
+ const hasUnsupportedControlCharacter = (value: string): boolean =>
8
+ Array.from(value).some((character) => {
9
+ const code = character.codePointAt(0) ?? 0;
10
+ return code === 0x7f || (code < 0x20 && code !== 0x09 && code !== 0x0a && code !== 0x0d);
11
+ });
12
+
13
+ export const parseIssueSelector = Effect.fn("Input.parseIssueSelector")(function* (input: string) {
14
+ if (hasUnsupportedControlCharacter(input)) {
15
+ return yield* InvalidInputError.make({
16
+ message: "Issue identifiers cannot contain control characters",
17
+ });
18
+ }
19
+
20
+ const urlMatch = input.match(
21
+ /^https:\/\/linear\.app\/[^/]+\/issue\/([A-Za-z][A-Za-z0-9]*-\d+)(?:\/[^?#]*)?$/i,
22
+ );
23
+ if (urlMatch?.[1] !== undefined) {
24
+ return IssueSelector.make(urlMatch[1]);
25
+ }
26
+ if (issueIdentifierPattern.test(input) || uuidPattern.test(input)) {
27
+ return IssueSelector.make(input);
28
+ }
29
+
30
+ return yield* InvalidInputError.make({
31
+ message: `Invalid issue identifier: ${input}. Expected ENG-123, a Linear issue URL, or a UUID`,
32
+ });
33
+ });
34
+
35
+ export const validateText = Effect.fn("Input.validateText")(function* (options: {
36
+ readonly name: string;
37
+ readonly value: string;
38
+ readonly maximumLength: number;
39
+ readonly allowEmpty?: boolean;
40
+ }) {
41
+ if (hasUnsupportedControlCharacter(options.value)) {
42
+ return yield* InvalidInputError.make({
43
+ message: `${options.name} cannot contain control characters`,
44
+ });
45
+ }
46
+ if (options.allowEmpty !== true && options.value.trim().length === 0) {
47
+ return yield* InvalidInputError.make({ message: `${options.name} cannot be empty` });
48
+ }
49
+ if (options.value.length > options.maximumLength) {
50
+ return yield* InvalidInputError.make({
51
+ message: `${options.name} cannot exceed ${options.maximumLength} characters`,
52
+ });
53
+ }
54
+ return options.value;
55
+ });
56
+
57
+ const uploadHost = "uploads.linear.app";
58
+
59
+ // The stored token is sent with the download, so only Linear's own upload host is accepted.
60
+ export const parseUploadUrl = Effect.fn("Input.parseUploadUrl")(function* (input: string) {
61
+ const url = URL.parse(input);
62
+ if (url === null || url.protocol !== "https:" || url.hostname !== uploadHost) {
63
+ return yield* InvalidInputError.make({
64
+ message: `Invalid upload URL: ${input}. Expected https://${uploadHost}/...`,
65
+ });
66
+ }
67
+ return UploadUrl.make(url.href);
68
+ });
@@ -0,0 +1,158 @@
1
+ import { Schema } from "effect";
2
+
3
+ export const IssueSelector = Schema.String.pipe(Schema.brand("IssueSelector"));
4
+ export type IssueSelector = Schema.Schema.Type<typeof IssueSelector>;
5
+
6
+ export const UploadUrl = Schema.String.pipe(Schema.brand("UploadUrl"));
7
+ export type UploadUrl = Schema.Schema.Type<typeof UploadUrl>;
8
+
9
+ export class ViewerStatus extends Schema.Class<ViewerStatus>("ViewerStatus")({
10
+ emoji: Schema.optional(Schema.String),
11
+ label: Schema.optional(Schema.String),
12
+ }) {}
13
+
14
+ export class Viewer extends Schema.Class<Viewer>("Viewer")({
15
+ id: Schema.String,
16
+ name: Schema.String,
17
+ email: Schema.String,
18
+ admin: Schema.Boolean,
19
+ status: Schema.optional(ViewerStatus),
20
+ }) {}
21
+
22
+ export class Team extends Schema.Class<Team>("Team")({
23
+ id: Schema.String,
24
+ key: Schema.String,
25
+ name: Schema.String,
26
+ description: Schema.optional(Schema.String),
27
+ }) {}
28
+
29
+ export class Project extends Schema.Class<Project>("Project")({
30
+ id: Schema.String,
31
+ name: Schema.String,
32
+ slug: Schema.String,
33
+ state: Schema.String,
34
+ url: Schema.String,
35
+ }) {}
36
+
37
+ export class IssueReference extends Schema.Class<IssueReference>("IssueReference")({
38
+ id: Schema.String,
39
+ identifier: Schema.String,
40
+ title: Schema.String,
41
+ url: Schema.String,
42
+ }) {}
43
+
44
+ export class IssueState extends Schema.Class<IssueState>("IssueState")({
45
+ id: Schema.String,
46
+ name: Schema.String,
47
+ type: Schema.String,
48
+ }) {}
49
+
50
+ export class IssuePriority extends Schema.Class<IssuePriority>("IssuePriority")({
51
+ value: Schema.Finite,
52
+ label: Schema.String,
53
+ }) {}
54
+
55
+ export class IssueSummary extends IssueReference.extend<IssueSummary>("IssueSummary")({
56
+ branchName: Schema.String,
57
+ priority: IssuePriority,
58
+ state: Schema.optional(IssueState),
59
+ }) {}
60
+
61
+ export class IssueTeam extends Schema.Class<IssueTeam>("IssueTeam")({
62
+ id: Schema.String,
63
+ key: Schema.String,
64
+ name: Schema.String,
65
+ }) {}
66
+
67
+ export class IssueAssignee extends Schema.Class<IssueAssignee>("IssueAssignee")({
68
+ id: Schema.String,
69
+ name: Schema.String,
70
+ email: Schema.String,
71
+ }) {}
72
+
73
+ export class IssueProject extends Schema.Class<IssueProject>("IssueProject")({
74
+ id: Schema.String,
75
+ name: Schema.String,
76
+ url: Schema.String,
77
+ }) {}
78
+
79
+ export class IssueLabel extends Schema.Class<IssueLabel>("IssueLabel")({
80
+ id: Schema.String,
81
+ name: Schema.String,
82
+ }) {}
83
+
84
+ export class IssueCommentAuthor extends Schema.Class<IssueCommentAuthor>("IssueCommentAuthor")({
85
+ id: Schema.String,
86
+ name: Schema.String,
87
+ }) {}
88
+
89
+ export class IssueComment extends Schema.Class<IssueComment>("IssueComment")({
90
+ id: Schema.String,
91
+ body: Schema.String,
92
+ createdAt: Schema.String,
93
+ url: Schema.String,
94
+ author: Schema.optional(IssueCommentAuthor),
95
+ }) {}
96
+
97
+ export class IssueRelation extends Schema.Class<IssueRelation>("IssueRelation")({
98
+ id: Schema.String,
99
+ type: Schema.String,
100
+ direction: Schema.Literals(["outbound", "inbound"]),
101
+ issue: IssueReference,
102
+ }) {}
103
+
104
+ export class IssueDetails extends IssueSummary.extend<IssueDetails>("IssueDetails")({
105
+ description: Schema.optional(Schema.String),
106
+ team: Schema.optional(IssueTeam),
107
+ assignee: Schema.optional(IssueAssignee),
108
+ project: Schema.optional(IssueProject),
109
+ parent: Schema.optional(IssueReference),
110
+ labels: Schema.Array(IssueLabel),
111
+ children: Schema.optional(Schema.Array(IssueReference)),
112
+ comments: Schema.optional(Schema.Array(IssueComment)),
113
+ relations: Schema.optional(Schema.Array(IssueRelation)),
114
+ }) {}
115
+
116
+ export class StartedIssue extends Schema.Class<StartedIssue>("StartedIssue")({
117
+ issue: IssueReference,
118
+ state: IssueState,
119
+ branchName: Schema.String,
120
+ }) {}
121
+
122
+ export class CreatedIssue extends IssueReference.extend<CreatedIssue>("CreatedIssue")({}) {}
123
+
124
+ export interface IssueDetailsOptions {
125
+ readonly comments: boolean;
126
+ readonly children: boolean;
127
+ readonly relations: boolean;
128
+ }
129
+
130
+ export interface CreateIssueInput {
131
+ readonly title: string;
132
+ readonly teamId: string;
133
+ readonly description?: string;
134
+ readonly parent?: IssueSelector;
135
+ readonly projectId?: string;
136
+ readonly priority?: number;
137
+ }
138
+
139
+ export class IssueFile extends Schema.Class<IssueFile>("IssueFile")({
140
+ name: Schema.String,
141
+ url: Schema.String,
142
+ /** `description`, or the ID of the comment that links the file. */
143
+ source: Schema.String,
144
+ }) {}
145
+
146
+ export class SavedFile extends Schema.Class<SavedFile>("SavedFile")({
147
+ url: Schema.String,
148
+ path: Schema.String,
149
+ bytes: Schema.Finite,
150
+ contentType: Schema.optional(Schema.String),
151
+ }) {}
152
+
153
+ export interface DownloadedFile {
154
+ readonly bytes: Uint8Array;
155
+ readonly contentType?: string;
156
+ /** From the `Content-Disposition` header, when the server sends one. */
157
+ readonly fileName?: string;
158
+ }
@@ -0,0 +1,71 @@
1
+ import { Effect, FileSystem, Path } from "effect";
2
+ import { toSafeFileName, withUniqueSuffix } from "../domain/Files.js";
3
+ import { SavedFile } from "../domain/Linear.js";
4
+ import type { DownloadedFile, UploadUrl } from "../domain/Linear.js";
5
+ import { LinearService } from "../services/Linear.js";
6
+ import { FileWriteError, InvalidInputError } from "./errors.js";
7
+
8
+ export interface DownloadRequest {
9
+ readonly url: UploadUrl;
10
+ /** The name the Markdown link gave the file, when there is one. */
11
+ readonly name?: string;
12
+ }
13
+
14
+ const toFileWriteError = (error: unknown): FileWriteError =>
15
+ FileWriteError.make({ message: String(error) });
16
+
17
+ const nonEmpty = (value: string | undefined): string | undefined => {
18
+ if (value === undefined || value.trim().length === 0) {
19
+ return undefined;
20
+ }
21
+ return value;
22
+ };
23
+
24
+ const preferredFileName = (request: DownloadRequest, download: DownloadedFile): string =>
25
+ nonEmpty(request.name) ??
26
+ nonEmpty(download.fileName) ??
27
+ new URL(request.url).pathname.split("/").pop() ??
28
+ "download";
29
+
30
+ export const saveDownloads = Effect.fn("saveDownloads")(function* (options: {
31
+ readonly requests: ReadonlyArray<DownloadRequest>;
32
+ readonly outputDir: string;
33
+ readonly overwrite: boolean;
34
+ }) {
35
+ const fileSystem = yield* FileSystem.FileSystem;
36
+ const path = yield* Path.Path;
37
+ const linear = yield* LinearService;
38
+
39
+ yield* fileSystem
40
+ .makeDirectory(options.outputDir, { recursive: true })
41
+ .pipe(Effect.mapError(toFileWriteError));
42
+
43
+ const takenNames = new Set<string>();
44
+ const savedFiles: Array<SavedFile> = [];
45
+ for (const request of options.requests) {
46
+ const download = yield* linear.downloadFile(request.url);
47
+ const fileName = withUniqueSuffix(
48
+ toSafeFileName(preferredFileName(request, download)),
49
+ takenNames,
50
+ );
51
+ takenNames.add(fileName);
52
+ const target = path.join(options.outputDir, fileName);
53
+
54
+ const exists = yield* fileSystem.exists(target).pipe(Effect.mapError(toFileWriteError));
55
+ if (exists && !options.overwrite) {
56
+ return yield* InvalidInputError.make({
57
+ message: `${target} already exists. Pass --overwrite to replace it.`,
58
+ });
59
+ }
60
+ yield* fileSystem.writeFile(target, download.bytes).pipe(Effect.mapError(toFileWriteError));
61
+ savedFiles.push(
62
+ SavedFile.make({
63
+ url: request.url,
64
+ path: target,
65
+ bytes: download.bytes.byteLength,
66
+ contentType: download.contentType,
67
+ }),
68
+ );
69
+ }
70
+ return savedFiles;
71
+ });
@@ -0,0 +1,9 @@
1
+ import { Effect } from "effect";
2
+
3
+ /**
4
+ * An Effect that yields absent optional data.
5
+ *
6
+ * Typed as `undefined` rather than `void` because these values populate
7
+ * `Schema.optional` fields, whose encoded type is `T | undefined`.
8
+ */
9
+ export const succeedUndefined: Effect.Effect<undefined> = Effect.as(Effect.void, undefined);
package/src/lib/errors.ts CHANGED
@@ -9,10 +9,6 @@ export class LinearApiError extends Schema.TaggedErrorClass<LinearApiError>()("L
9
9
  code: Schema.optional(Schema.String),
10
10
  }) {}
11
11
 
12
- export class BrowserError extends Schema.TaggedErrorClass<BrowserError>()("BrowserError", {
13
- message: Schema.String,
14
- }) {}
15
-
16
12
  export class TokenNotFoundError extends Schema.TaggedErrorClass<TokenNotFoundError>()(
17
13
  "TokenNotFoundError",
18
14
  {
@@ -44,13 +40,6 @@ export class InvalidInputError extends Schema.TaggedErrorClass<InvalidInputError
44
40
  },
45
41
  ) {}
46
42
 
47
- export const AppError = Schema.Union([
48
- ConfigError,
49
- LinearApiError,
50
- BrowserError,
51
- TokenNotFoundError,
52
- InvalidTokenError,
53
- NoIssuesError,
54
- InvalidInputError,
55
- ]);
56
- export type AppError = typeof AppError.Type;
43
+ export class FileWriteError extends Schema.TaggedErrorClass<FileWriteError>()("FileWriteError", {
44
+ message: Schema.String,
45
+ }) {}
@@ -0,0 +1,15 @@
1
+ import { Flag } from "effect/unstable/cli";
2
+
3
+ export const jsonFlag = Flag.boolean("json").pipe(
4
+ Flag.withDescription("Emit stable JSON for scripts and agents"),
5
+ );
6
+
7
+ export const outputDirFlag = Flag.string("output-dir").pipe(
8
+ Flag.withAlias("o"),
9
+ Flag.withDefault("."),
10
+ Flag.withDescription("Directory to save files in; created when missing"),
11
+ );
12
+
13
+ export const overwriteFlag = Flag.boolean("overwrite").pipe(
14
+ Flag.withDescription("Replace files that already exist in the output directory"),
15
+ );
package/src/main.ts CHANGED
@@ -1,22 +1,10 @@
1
- // @effect-diagnostics strictEffectProvide:off
2
1
  import { Command } from "effect/unstable/cli";
3
2
  import { BunRuntime, BunServices } from "@effect/platform-bun";
4
3
  import { Console, Effect, Layer } from "effect";
5
4
  import packageJson from "../package.json" with { type: "json" };
6
- import { auth } from "./commands/auth.js";
7
- import { api } from "./commands/api.js";
8
- import { team } from "./commands/team.js";
9
- import { issue } from "./commands/issue.js";
10
- import { project } from "./commands/project.js";
5
+ import { linear } from "./cli.js";
11
6
  import { ConfigService } from "./services/Config.js";
12
7
  import { LinearService } from "./services/Linear.js";
13
- import { BrowserService } from "./services/Browser.js";
14
- import { StdinService } from "./services/Stdin.js";
15
-
16
- // Root command
17
- const linear = Command.make("linear", {}, () =>
18
- Console.log("Linear CLI - Use --help to see available commands"),
19
- ).pipe(Command.withSubcommands([auth, team, project, issue, api]));
20
8
 
21
9
  // Build the CLI runner
22
10
  const cli = Command.run(linear, { version: packageJson.version });
@@ -25,12 +13,8 @@ const cli = Command.run(linear, { version: packageJson.version });
25
13
  // - BunServices provides FileSystem, Path, Terminal, Stdio, and child processes
26
14
  // - ConfigService depends on FileSystem, Path
27
15
  // - LinearService depends on ConfigService
28
- // - BrowserService is standalone
29
-
30
16
  // Build layers with dependencies
31
- const MainLayer = StdinService.layer.pipe(
32
- Layer.provideMerge(BrowserService.layer),
33
- Layer.provideMerge(LinearService.layer),
17
+ const MainLayer = LinearService.layer.pipe(
34
18
  Layer.provideMerge(ConfigService.layer),
35
19
  Layer.provideMerge(BunServices.layer),
36
20
  );
@@ -45,6 +29,7 @@ cli.pipe(
45
29
  ),
46
30
  Effect.tapErrorTag("NoIssuesError", (e) => Console.error(e.message)),
47
31
  Effect.tapErrorTag("InvalidInputError", (e) => Console.error(`Invalid input: ${e.message}`)),
32
+ Effect.tapErrorTag("FileWriteError", (e) => Console.error(`File Error: ${e.message}`)),
48
33
  Effect.provide(MainLayer),
49
34
  BunRuntime.runMain({ disableErrorReporting: true }),
50
35
  );