mintree 0.2.4 → 0.3.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,12 +1,12 @@
1
1
  /**
2
2
  * Shared types and the IssueProvider interface implemented by the
3
- * github/plane providers. Keeping these in one file lets the dashboard and
3
+ * github/linear providers. Keeping these in one file lets the dashboard and
4
4
  * worktree commands talk to issues abstractly while each provider owns its
5
5
  * own transport details.
6
6
  *
7
7
  * `IssueId` is a string in both providers — for GitHub it's the issue number
8
- * stringified ("100"); for Plane it'll be the project-prefixed identifier
9
- * ("BACK-100"). The branch convention encodes this same string verbatim, so
8
+ * stringified ("100"); for Linear it's the team-prefixed identifier
9
+ * ("FE-123"). The branch convention encodes this same string verbatim, so
10
10
  * worktree dir names round-trip through the IssueId without re-parsing.
11
11
  */
12
12
  export type IssueId = string;
@@ -28,13 +28,13 @@ export type ProviderIssue = {
28
28
  updatedAt: string;
29
29
  };
30
30
  /**
31
- * The issue's membership on a project board (GitHub Projects v2 / Plane
32
- * project), used to group the dashboard list. `status` is the workflow
31
+ * The issue's membership on a project board (GitHub Projects v2 / Linear
32
+ * team), used to group the dashboard list. `status` is the workflow
33
33
  * state's display name (null when the issue is on the board but no state is
34
34
  * set). `statusOrder` gives the column index so the dashboard can order
35
35
  * sub-groups the same way the board does. `statusColor` is an Ink-renderable
36
36
  * colour string — a 16-colour name for GitHub's enum, or a #rrggbb hex for
37
- * Plane states.
37
+ * Linear states.
38
38
  */
39
39
  export type IssueProjectInfo = {
40
40
  projectTitle: string;
@@ -47,7 +47,7 @@ export type IssueProjectInfo = {
47
47
  /**
48
48
  * Result of transitionIssueToInProgress. Discriminated so the caller can
49
49
  * render a precise status message without inventing one. Provider-agnostic:
50
- * the github and plane implementations both yield these shapes.
50
+ * the github and linear implementations both yield these shapes.
51
51
  */
52
52
  export type TransitionResult = {
53
53
  kind: "transitioned";
@@ -82,11 +82,11 @@ export type TransitionResult = {
82
82
  hint?: string;
83
83
  };
84
84
  export interface IssueProvider {
85
- readonly kind: "github" | "plane";
85
+ readonly kind: "github" | "linear";
86
86
  /**
87
87
  * Lists open issues assigned to the current user, scoped to whatever the
88
88
  * provider considers the active context (GH: the current repo on origin;
89
- * Plane: the configured workspace/projects). Returns null on transient
89
+ * Linear: the configured workspace/teams). Returns null on transient
90
90
  * failure (auth, network) — the dashboard renders an error hint.
91
91
  */
92
92
  listAssignedIssues(): Promise<ProviderIssue[] | null>;
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Shared types and the IssueProvider interface implemented by the
3
- * github/plane providers. Keeping these in one file lets the dashboard and
3
+ * github/linear providers. Keeping these in one file lets the dashboard and
4
4
  * worktree commands talk to issues abstractly while each provider owns its
5
5
  * own transport details.
6
6
  *
7
7
  * `IssueId` is a string in both providers — for GitHub it's the issue number
8
- * stringified ("100"); for Plane it'll be the project-prefixed identifier
9
- * ("BACK-100"). The branch convention encodes this same string verbatim, so
8
+ * stringified ("100"); for Linear it's the team-prefixed identifier
9
+ * ("FE-123"). The branch convention encodes this same string verbatim, so
10
10
  * worktree dir names round-trip through the IssueId without re-parsing.
11
11
  */
12
12
  export {};
@@ -19,7 +19,7 @@ export declare function extractRepoAndDir(cwd: string): {
19
19
  * Pulls the issue id out of a `<issue>-<desc>` worktree directory name.
20
20
  * Returns null when the directory name doesn't follow the convention (e.g.
21
21
  * a manually-created worktree dropped under .mintree/worktrees/). The id
22
- * is either bare digits (GitHub) or a `<PROJ>-\d+` Plane identifier.
22
+ * is either bare digits (GitHub) or a `<TEAM>-\d+` Linear identifier.
23
23
  */
24
24
  export declare function issueIdFromWorktreeDir(worktreeDir: string): string | null;
25
25
  export type StatePayload = {
@@ -35,7 +35,7 @@ export function extractRepoAndDir(cwd) {
35
35
  * Pulls the issue id out of a `<issue>-<desc>` worktree directory name.
36
36
  * Returns null when the directory name doesn't follow the convention (e.g.
37
37
  * a manually-created worktree dropped under .mintree/worktrees/). The id
38
- * is either bare digits (GitHub) or a `<PROJ>-\d+` Plane identifier.
38
+ * is either bare digits (GitHub) or a `<TEAM>-\d+` Linear identifier.
39
39
  */
40
40
  export function issueIdFromWorktreeDir(worktreeDir) {
41
41
  const m = worktreeDir.match(/^((?:[A-Z][A-Z0-9_]*-)?\d+)-/);
@@ -225,8 +225,8 @@ export function runCreateDetached(opts) {
225
225
  };
226
226
  }
227
227
  // Same shape as BRANCH_REGEX's issueId capture: bare digits (GitHub) or
228
- // `<PROJ>-\d+` (Plane). Otherwise the detached-worktree flow rejects
229
- // valid Plane ids like "AUTH-6" when they reach this entry point.
228
+ // `<TEAM>-\d+` (Linear). Otherwise the detached-worktree flow rejects
229
+ // valid Linear ids like "FE-123" when they reach this entry point.
230
230
  if (!/^(?:[A-Z][A-Z0-9_]*-)?\d+$/.test(opts.issueId)) {
231
231
  return { ok: false, message: `Invalid issueId: ${opts.issueId}` };
232
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mintree",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "Issue-driven git worktrees + Claude Code sessions for repos with an opinionated SDD+TDD flow.",
5
5
  "license": "MIT",
6
6
  "author": "Martin Mineo <mmineo@canarytechnologies.com>",
@@ -1,61 +0,0 @@
1
- /**
2
- * PlaneProvider — implements IssueProvider against Plane's REST API
3
- * (https://api.plane.so by default, overridable for self-hosted).
4
- *
5
- * Talks raw HTTP rather than going through Plane's MCP server because
6
- * mintree runs as a Node CLI, not inside an MCP host. The shape of the
7
- * calls mirrors the MCP tools (list_work_items, list_states, get_me,
8
- * update_work_item) so the eventual error surface looks familiar.
9
- *
10
- * Auth resolution order: `PLANE_API_KEY` env var → `~/.mintree/
11
- * credentials.json` (`{ plane: { apiKey: "..." } }`). Never reads or
12
- * writes credentials to the repo's `.mintree/` directory — workspace API
13
- * keys are user-scoped, not repo-scoped.
14
- *
15
- * Filtering by assignee is done client-side: Plane's documented list
16
- * endpoint doesn't expose an assignee filter, so the provider fetches
17
- * the project's work items (paginated, per_page=100) and drops ones not
18
- * assigned to the current user. Acceptable for typical project sizes;
19
- * if a workspace ever grows past a few hundred items per project we can
20
- * revisit (probably by switching to the `/work-items/search/` endpoint
21
- * when it stabilises).
22
- */
23
- import type { IssueId, IssueProjectInfo, IssueProvider, ProviderIssue, TransitionResult } from "./types.js";
24
- export declare class PlaneProvider implements IssueProvider {
25
- private readonly repoRoot;
26
- readonly kind: "plane";
27
- private cachedUserId;
28
- private workItemsByProject;
29
- private statesByProject;
30
- constructor(repoRoot: string);
31
- private getConfig;
32
- private getUserId;
33
- private fetchAssignedWorkItems;
34
- private fetchStates;
35
- listAssignedIssues(): Promise<ProviderIssue[] | null>;
36
- fetchProjectAssignments(): Promise<Map<IssueId, IssueProjectInfo> | null>;
37
- transitionIssueToInProgress(issueId: IssueId): Promise<TransitionResult>;
38
- }
39
- /**
40
- * Doctor-side snapshot of the Plane integration's health. Bundles the API-
41
- * key resolution, `/users/me/` ping, and a per-configured-project
42
- * existence check into one async call so the doctor row can render
43
- * everything in one pass. Returns a structured result (not a boolean) so
44
- * the UI can surface specific hints instead of generic failures.
45
- */
46
- export type PlaneSetupCheck = {
47
- configured: boolean;
48
- hasApiKey: boolean;
49
- authOk: boolean;
50
- user?: string;
51
- workspaceSlug?: string;
52
- apiUrl?: string;
53
- projects: Array<{
54
- identifier: string;
55
- id: string;
56
- ok: boolean;
57
- error?: string;
58
- }>;
59
- hint?: string;
60
- };
61
- export declare function checkPlaneSetup(repoRoot: string): Promise<PlaneSetupCheck>;