@lanework/contracts 0.5.0 → 0.5.1

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.
package/dist/sync.d.ts ADDED
@@ -0,0 +1,147 @@
1
+ import type { ProjectAvatar } from "./avatar";
2
+ import type { IsoDate } from "./common";
3
+ export interface SyncProfile {
4
+ name: string | null;
5
+ birthYear: number | null;
6
+ gender: string | null;
7
+ language: string | null;
8
+ }
9
+ /** A project as `GET /v1/sync/state` states it. */
10
+ export interface SyncWorkspace {
11
+ /** The board id. Every `/v1/boards/:workspaceId/…` takes it, not the slug. */
12
+ id: string;
13
+ slug: string;
14
+ name: string;
15
+ color: string | null;
16
+ /** The R2 key of the project's icon, or null. */
17
+ iconKey: string | null;
18
+ /**
19
+ * The avatar picked for the project, or null for the default mark (the
20
+ * owner's GitHub icon, or the letter tile). Absent from a server older
21
+ * than 0.5.0.
22
+ */
23
+ avatar?: ProjectAvatar | null;
24
+ laneworkStyle: boolean;
25
+ baseBranch: string | null;
26
+ addedAt: IsoDate;
27
+ /** This machine's checkout, or null when it has none. */
28
+ path: string | null;
29
+ exposed: boolean;
30
+ }
31
+ export interface SyncRoleBinding {
32
+ role: string;
33
+ agent: string;
34
+ provider: string;
35
+ model: string;
36
+ }
37
+ /**
38
+ * `GET /v1/sync/state`.
39
+ *
40
+ * Projects come ordered by position; archived ones are left out.
41
+ */
42
+ export interface SyncStateResponse {
43
+ profile: SyncProfile | null;
44
+ workspaces: SyncWorkspace[];
45
+ roles: SyncRoleBinding[];
46
+ /** Null when the projects disagree (then `conflicts` names `autoRoute`). */
47
+ autoRoute: boolean | null;
48
+ /** `role:<name>` or `autoRoute` for values the projects disagree on. */
49
+ conflicts: string[];
50
+ }
51
+ /** One project as `POST /v1/sync/state` pushes it. */
52
+ export interface SyncPushWorkspace {
53
+ slug: string;
54
+ name: string;
55
+ color?: string | null;
56
+ laneworkStyle?: boolean;
57
+ baseBranch?: string | null;
58
+ addedAt: IsoDate;
59
+ /** This machine's checkout. Required. */
60
+ path: string;
61
+ exposed?: boolean;
62
+ }
63
+ /**
64
+ * `POST /v1/sync/state`.
65
+ *
66
+ * Upserts up to 500 projects, the profile and the role bindings.
67
+ */
68
+ export interface SyncStatePushRequest {
69
+ profile?: Partial<SyncProfile>;
70
+ workspaces?: SyncPushWorkspace[];
71
+ roles?: {
72
+ role: string;
73
+ agent: string;
74
+ provider?: string;
75
+ model?: string;
76
+ }[];
77
+ autoRoute?: boolean;
78
+ }
79
+ export interface SyncStatePushResponse {
80
+ stored: number;
81
+ }
82
+ /**
83
+ * `POST /v1/sync/state/workspace`: create a project.
84
+ *
85
+ * 409 with {@link SyncWorkspaceSlugTakenError} on a taken slug.
86
+ */
87
+ export interface SyncWorkspaceCreateRequest {
88
+ /** Lower-case, hyphenated, at most 64 characters. */
89
+ slug: string;
90
+ name: string;
91
+ color?: string | null;
92
+ baseBranch?: string | null;
93
+ laneworkStyle?: boolean;
94
+ autoRoute?: boolean;
95
+ /** This machine's checkout, recorded when sent. */
96
+ path?: string | null;
97
+ }
98
+ export interface SyncWorkspaceCreateResponse {
99
+ workspace: {
100
+ id: string;
101
+ slug: string;
102
+ name: string;
103
+ color: string | null;
104
+ baseBranch: string | null;
105
+ path: string | null;
106
+ };
107
+ }
108
+ /** 409 from `POST /v1/sync/state/workspace`: the project holding that slug. */
109
+ export interface SyncWorkspaceSlugTakenError {
110
+ error: string;
111
+ id: string;
112
+ }
113
+ /** `PATCH /v1/sync/state/workspace/:id`; the id is a UUID, not a slug. */
114
+ export interface SyncWorkspacePatchRequest {
115
+ name?: string;
116
+ color?: string | null;
117
+ /**
118
+ * Set the avatar; `null` clears it back to the default mark. The server
119
+ * refuses with 400 what `parseProjectAvatar` refuses.
120
+ */
121
+ avatar?: ProjectAvatar | null;
122
+ baseBranch?: string | null;
123
+ laneworkStyle?: boolean;
124
+ autoRoute?: boolean;
125
+ }
126
+ export interface SyncWorkspacePatchResponse {
127
+ workspace: {
128
+ id: string;
129
+ slug: string;
130
+ name: string;
131
+ color: string | null;
132
+ avatar?: ProjectAvatar | null;
133
+ baseBranch: string | null;
134
+ };
135
+ }
136
+ /** `PUT /v1/sync/state/workspace-order`: distinct ids, all the caller's. */
137
+ export interface SyncWorkspaceOrderRequest {
138
+ ids: string[];
139
+ }
140
+ export interface SyncWorkspaceOrderResponse {
141
+ ids: string[];
142
+ }
143
+ /** `DELETE /v1/sync/state/workspace/:id`. `deleted` is the slug, or null. */
144
+ export interface SyncWorkspaceDeleteResponse {
145
+ deleted: string | null;
146
+ id: string;
147
+ }
@@ -0,0 +1,159 @@
1
+ import type { BoardSummary, Card, CardDetail, ChecklistItem, ColumnRole, Dispatch, TagPolicy } from "../boards";
2
+ import type { Checkpoint, LatestCheckpoint } from "../checkpoints";
3
+ import type { ToolContract } from "./schema";
4
+ export type BoardToolName = "list_boards" | "create_board" | "link_repo" | "board_summary" | "list_reviews" | "get_review" | "create_review" | "update_review" | "toggle_item" | "review_card" | "set_status" | "delete_review" | "checkpoint" | "lifecycle_status";
5
+ /** The board tools, in the order `tools/list` advertises them. */
6
+ export declare const BOARD_TOOLS: readonly ToolContract<BoardToolName>[];
7
+ /** A lane with its live card count, as `board_summary` states it. */
8
+ export interface ToolLaneCount {
9
+ key: string;
10
+ label: string;
11
+ role: ColumnRole | null;
12
+ count: number;
13
+ }
14
+ /** A lane as `list_reviews` names it. */
15
+ export interface ToolLane {
16
+ key: string;
17
+ name: string;
18
+ role: ColumnRole | null;
19
+ }
20
+ /** A card in one line, as `lifecycle_status` lists it. */
21
+ export interface CardRef {
22
+ id: string;
23
+ taskId: string | null;
24
+ title: string;
25
+ }
26
+ /** Something a reviewer may want to turn into a lesson (PD-01). */
27
+ export type RetroSignal = {
28
+ kind: "changes_requested";
29
+ reason: string;
30
+ /** The lane the card was sent back from, and the one it went to. */
31
+ from: string;
32
+ to: string;
33
+ at: string;
34
+ } | {
35
+ kind: "user_note";
36
+ item: string;
37
+ note: string;
38
+ at: string;
39
+ } | {
40
+ kind: "verify_failed_then_fixed";
41
+ item: string;
42
+ /** The command whose evidence finally passed. */
43
+ command: string;
44
+ at: string;
45
+ };
46
+ /** What each board tool answers, inside its text content, as JSON. */
47
+ export interface BoardToolOutputs {
48
+ list_boards: {
49
+ /** The normalized remote, when `repo` was passed. */
50
+ repo?: string;
51
+ boards: BoardSummary[];
52
+ /** What to do next, when `repo` was passed. */
53
+ next?: string;
54
+ };
55
+ create_board: {
56
+ board_id: string;
57
+ name: string;
58
+ slug: string;
59
+ repo: string;
60
+ };
61
+ link_repo: {
62
+ repo: string;
63
+ /** The repo the board was linked to before, or null. */
64
+ previous: string | null;
65
+ /** The boards now linked to `repo`. */
66
+ boards: BoardSummary[];
67
+ };
68
+ board_summary: {
69
+ workspaceId: string;
70
+ role: string;
71
+ /** The board's change sequence. */
72
+ head: number;
73
+ lanes: ToolLaneCount[];
74
+ /** In-progress cards no agent has touched for over 2 hours. */
75
+ stale: number;
76
+ categories: {
77
+ key: string;
78
+ name: string;
79
+ }[];
80
+ tags: TagPolicy;
81
+ labels: {
82
+ tag: string;
83
+ name: string;
84
+ tone: string;
85
+ }[];
86
+ };
87
+ list_reviews: {
88
+ items: Card[];
89
+ head: number;
90
+ columns: ToolLane[];
91
+ };
92
+ get_review: {
93
+ /** The card; its run plan is `dispatch`, beside it. */
94
+ item: Omit<CardDetail, "dispatch">;
95
+ checkpoint: LatestCheckpoint | null;
96
+ dispatch: Dispatch | null;
97
+ };
98
+ create_review: {
99
+ item: CardDetail;
100
+ };
101
+ update_review: {
102
+ item: CardDetail;
103
+ };
104
+ /**
105
+ * The box that changed and the card in one line, not the whole card: a
106
+ * card's detail is 2–3k tokens, and an agent ticks one box after another.
107
+ * `get_review` has the rest. `ready` / `open` as `review_card` says them.
108
+ */
109
+ toggle_item: {
110
+ checklistItem: ChecklistItem;
111
+ card: CardRef & {
112
+ columnKey: string;
113
+ revision: number;
114
+ /** Checked boxes, and all of them. */
115
+ done: number;
116
+ total: number;
117
+ };
118
+ ready: boolean;
119
+ /** When not `ready`: box keys, or `group (D1/D2)` for an unsettled group. */
120
+ open?: string[];
121
+ };
122
+ review_card: {
123
+ ready: boolean;
124
+ /** When `ready`. */
125
+ next?: string;
126
+ /** When not `ready`: box keys, or `group (D1/D2)` for an unsettled group. */
127
+ open?: string[];
128
+ item: CardDetail;
129
+ };
130
+ set_status: {
131
+ item: CardDetail;
132
+ /** Only on a move into a review lane, and only with signals. */
133
+ retro?: {
134
+ signals: RetroSignal[];
135
+ ask: string;
136
+ };
137
+ };
138
+ delete_review: {
139
+ archived: string;
140
+ /** The change it was recorded as; null when it was already archived. */
141
+ seq: number | null;
142
+ };
143
+ checkpoint: {
144
+ checkpoint: Checkpoint;
145
+ };
146
+ lifecycle_status: {
147
+ waiting: (CardRef & {
148
+ done: number;
149
+ total: number;
150
+ })[];
151
+ ready: CardRef[];
152
+ inFlight: (CardRef & {
153
+ columnKey: string;
154
+ })[];
155
+ review: (CardRef & {
156
+ columnKey: string;
157
+ })[];
158
+ };
159
+ }
@@ -0,0 +1,52 @@
1
+ import type { ToolContract } from "./schema";
2
+ /**
3
+ * Who may call a tool.
4
+ *
5
+ * - `conductor`: only a conductor's own conversation (sessions, memory).
6
+ * - `lead`: only the lead of an orchestration run.
7
+ * - `any`: any conversation the app started.
8
+ */
9
+ export type ControlToolRole = "conductor" | "lead" | "any";
10
+ export type ControlToolName = "sessions_start" | "sessions_list" | "sessions_read" | "sessions_send" | "memory_read" | "memory_append" | "memory_write" | "conductors_create" | "models_list" | "run_list" | "run_delegate" | "run_get" | "run_wait" | "run_respond" | "run_answer" | "run_steer" | "run_message" | "run_retry" | "run_cancel" | "run_review" | "run_finish";
11
+ /** The wire action each tool sends, as the CLI's first argument names it. */
12
+ export type ControlToolAction = "sessions.start" | "sessions.list" | "sessions.read" | "sessions.send" | "memory.read" | "memory.append" | "memory.write" | "conductors.create" | "models.list" | "list" | "delegate" | "get" | "wait" | "respond" | "answer" | "steer" | "message" | "retry" | "cancel" | "review" | "finish";
13
+ /** One lanework-control tool: the MCP contract plus where it goes. */
14
+ export interface ControlToolContract extends ToolContract<ControlToolName> {
15
+ /** The action the control server receives. */
16
+ action: ControlToolAction;
17
+ role: ControlToolRole;
18
+ }
19
+ /**
20
+ * The app's limits, as the parsers enforce them. Copies: the names are the
21
+ * app's constants (`shared/orchestration.ts`, `shared/conductor-sessions.ts`,
22
+ * `shared/terminal.ts`).
23
+ */
24
+ export declare const CONTROL_TOOL_LIMITS: {
25
+ readonly TITLE_MAX: 160;
26
+ readonly PROMPT_MAX: 30000;
27
+ readonly FILES_MAX: 64;
28
+ readonly WAIT_MAX_SECONDS: 25;
29
+ readonly AGENT_NAME_MAX: 120;
30
+ readonly READ_LIMIT_MAX: 5;
31
+ readonly READ_LIMIT_DEFAULT: 2;
32
+ readonly READ_CHARS_MIN: 200;
33
+ readonly READ_CHARS_MAX: 6000;
34
+ readonly READ_CHARS_DEFAULT: 1500;
35
+ readonly MEMORY_NOTES_MAX: 8000;
36
+ readonly LEAD_NAME_MAX: 60;
37
+ readonly LEAD_INSTRUCTIONS_MAX: 20000;
38
+ readonly LEAD_CONTEXT_FILES_MAX: 20;
39
+ };
40
+ /** Every lanework-control tool: a conversation's own first, then a run's. */
41
+ export declare const CONTROL_TOOLS: readonly ControlToolContract[];
42
+ /**
43
+ * The tools a conversation may call: `any` tools always, `conductor` tools
44
+ * for a conductor's own conversation, `lead` tools for a run's lead. In
45
+ * {@link CONTROL_TOOLS}'s order.
46
+ */
47
+ export declare function controlToolsFor(roles: {
48
+ conductor: boolean;
49
+ lead: boolean;
50
+ }): ControlToolContract[];
51
+ /** One control tool by its MCP name; undefined when there is none. */
52
+ export declare function controlTool(name: string): ControlToolContract | undefined;
@@ -0,0 +1,15 @@
1
+ import { type BoardToolName, type BoardToolOutputs } from "./board";
2
+ import { type KitToolInputs, type KitToolName, type KitToolOutputs } from "./kit";
3
+ import type { ToolContract } from "./schema";
4
+ export * from "./board";
5
+ export * from "./instructions";
6
+ export * from "./kit";
7
+ export * from "./outputs";
8
+ export * from "./schema";
9
+ export type ToolName = BoardToolName | KitToolName;
10
+ /** What any tool answers, by name. */
11
+ export type ToolOutputs = BoardToolOutputs & KitToolOutputs;
12
+ export type ToolOutput<Name extends ToolName> = ToolOutputs[Name];
13
+ export type KitToolInput<Name extends KitToolName> = KitToolInputs[Name];
14
+ /** One tool's contract by name, board or kit; undefined when there is none. */
15
+ export declare function toolContract(name: string): ToolContract<ToolName> | undefined;
@@ -0,0 +1,12 @@
1
+ /** Leading a card's streams (BE-19); also the `work` prompt's text. */
2
+ export declare const STREAMS_FLOW: string;
3
+ /** Reviewing a card with the user (BE-14); also the `review` prompt's text. */
4
+ export declare const REVIEW_FLOW: string;
5
+ /** Every board tool's rules: the full toolset's `initialize` instructions. */
6
+ export declare const BOARD_INSTRUCTIONS: string;
7
+ /**
8
+ * The worker toolset's instructions (BE-24): only what a session working
9
+ * ONE existing card needs. Sentences about tools it does not have would
10
+ * cost tokens every turn and invite calls to tools that are not there.
11
+ */
12
+ export declare const BOARD_WORKER_INSTRUCTIONS: string;
@@ -0,0 +1,123 @@
1
+ import type { ToolContract } from "./schema";
2
+ export type KitToolName = "find_files" | "search_text" | "search_structural" | "list_files" | "search_sessions";
3
+ /** Each kit tool's `limit`: what it is when omitted, and the most it may be. */
4
+ export declare const KIT_TOOL_LIMITS: {
5
+ readonly find_files: {
6
+ readonly default: 50;
7
+ readonly max: 200;
8
+ };
9
+ readonly search_text: {
10
+ readonly default: 50;
11
+ readonly max: 200;
12
+ };
13
+ readonly search_structural: {
14
+ readonly default: 50;
15
+ readonly max: 200;
16
+ };
17
+ readonly list_files: {
18
+ readonly default: 1000;
19
+ readonly max: 50000;
20
+ };
21
+ readonly search_sessions: {
22
+ readonly default: 20;
23
+ readonly max: 50;
24
+ };
25
+ };
26
+ /** Languages a structural pattern can be written in. */
27
+ export declare const STRUCTURAL_LANGS: readonly ["ts", "tsx", "js", "jsx", "json", "css", "html", "python", "rust", "go"];
28
+ export type StructuralLang = (typeof STRUCTURAL_LANGS)[number];
29
+ /** The agent harnesses whose transcripts `search_sessions` reads. */
30
+ export type SessionHarness = "claude" | "codex" | "opencode";
31
+ /** The kit tools, in the order `tools/list` advertises them. */
32
+ export declare const KIT_TOOLS: readonly ToolContract<KitToolName>[];
33
+ /** A file whose path matches a fuzzy query. */
34
+ export interface FileHit {
35
+ /** Relative to the searched folder, `/`-separated. */
36
+ path: string;
37
+ /** Higher is a better match. Only comparable within one answer. */
38
+ score: number;
39
+ /** The matched characters as `[start, end)` UTF-16 offsets into `path`. */
40
+ ranges?: [number, number][];
41
+ }
42
+ /** One matching line. */
43
+ export interface MatchLine {
44
+ /** 1-based line number. */
45
+ line: number;
46
+ /** The line, without its newline. A very long line is cut to a window around its first match. */
47
+ text: string;
48
+ /** Each match as `[start, end)` UTF-16 offsets into `text`. */
49
+ ranges: [number, number][];
50
+ }
51
+ /** A file with matches. */
52
+ export interface FileMatch {
53
+ /** Relative to the searched folder, `/`-separated. */
54
+ path: string;
55
+ lines: MatchLine[];
56
+ /**
57
+ * The search stopped in or right after this file (a match or file limit, or
58
+ * the timeout), so there may be more matches here or after it.
59
+ */
60
+ truncated: boolean;
61
+ }
62
+ /** A session transcript with matches. */
63
+ export interface SessionMatch {
64
+ harness: SessionHarness;
65
+ sessionId: string;
66
+ /** The session's title, or its first prompt. */
67
+ title: string;
68
+ /** When the session was last written, ISO 8601. */
69
+ at: string;
70
+ /** The transcript, relative to the harness's own folder. */
71
+ file: string;
72
+ lines: MatchLine[];
73
+ }
74
+ /** What each kit tool takes, as the MCP server and `lwk` both read it. */
75
+ export interface KitToolInputs {
76
+ find_files: {
77
+ query: string;
78
+ folder?: string;
79
+ limit?: number;
80
+ };
81
+ search_text: {
82
+ query: string;
83
+ folder?: string;
84
+ regex?: boolean;
85
+ case_sensitive?: boolean;
86
+ globs?: string[];
87
+ limit?: number;
88
+ };
89
+ search_structural: {
90
+ pattern: string;
91
+ folder?: string;
92
+ lang?: StructuralLang;
93
+ limit?: number;
94
+ };
95
+ list_files: {
96
+ folder?: string;
97
+ limit?: number;
98
+ };
99
+ search_sessions: {
100
+ query: string;
101
+ folder?: string;
102
+ limit?: number;
103
+ };
104
+ }
105
+ /** What each kit tool answers, inside its text content, as JSON. */
106
+ export interface KitToolOutputs {
107
+ find_files: {
108
+ files: FileHit[];
109
+ };
110
+ search_text: {
111
+ matches: FileMatch[];
112
+ };
113
+ search_structural: {
114
+ matches: FileMatch[];
115
+ };
116
+ list_files: {
117
+ files: string[];
118
+ truncated: boolean;
119
+ };
120
+ search_sessions: {
121
+ sessions: SessionMatch[];
122
+ };
123
+ }
@@ -0,0 +1,21 @@
1
+ import type { BoardToolName } from "./board";
2
+ /** A run-time description of a JSON value. */
3
+ export type Shape = {
4
+ kind: "string" | "number" | "boolean" | "any";
5
+ } | {
6
+ kind: "nullable" | "optional" | "list" | "record";
7
+ inner: Shape;
8
+ } | {
9
+ kind: "object";
10
+ fields: Record<string, Shape>;
11
+ } | {
12
+ kind: "enum";
13
+ values: readonly unknown[];
14
+ };
15
+ /** `BoardToolOutputs`, tool by tool. */
16
+ export declare const BOARD_TOOL_OUTPUT_SHAPES: Record<BoardToolName, Shape>;
17
+ /**
18
+ * Every way a board tool's answer differs from its contract, as
19
+ * `path: what` lines; empty when it matches.
20
+ */
21
+ export declare function boardToolOutputProblems(name: BoardToolName, value: unknown): string[];
@@ -0,0 +1,78 @@
1
+ /** One tool parameter: its type and the limits a validator enforces. */
2
+ export type ToolParam = {
3
+ type: "string";
4
+ description?: string;
5
+ enum?: readonly string[];
6
+ maxLength?: number;
7
+ /** A regular expression, as JSON Schema spells it. */
8
+ pattern?: string;
9
+ } | {
10
+ type: "boolean";
11
+ description?: string;
12
+ } | {
13
+ type: "integer";
14
+ description?: string;
15
+ minimum?: number;
16
+ maximum?: number;
17
+ } | {
18
+ type: "string[]";
19
+ description?: string;
20
+ } | {
21
+ type: "nullable-string";
22
+ description?: string;
23
+ } | {
24
+ type: "string-map";
25
+ description?: string;
26
+ } | {
27
+ type: "object";
28
+ description?: string;
29
+ properties: Readonly<Record<string, ToolParam>>;
30
+ required?: readonly string[];
31
+ } | {
32
+ type: "object[]";
33
+ description?: string;
34
+ properties: Readonly<Record<string, ToolParam>>;
35
+ required?: readonly string[];
36
+ minItems?: number;
37
+ };
38
+ /** A tool's parameters: each one by name, and which are required. */
39
+ export interface ToolShape {
40
+ properties: Readonly<Record<string, ToolParam>>;
41
+ required?: readonly string[];
42
+ }
43
+ /** One tool as every server and client of it states it. */
44
+ export interface ToolContract<Name extends string = string> extends ToolShape {
45
+ name: Name;
46
+ /** A short label for people (MCP's `title`); models read `description`. */
47
+ title?: string;
48
+ /** Sent to the model verbatim. A literal: it sits in a cached prompt prefix. */
49
+ description: string;
50
+ /** True when the tool changes nothing (MCP's `readOnlyHint`). */
51
+ readOnly: boolean;
52
+ }
53
+ /** A JSON Schema object, as `tools/list` carries it. */
54
+ export type JsonSchema = Record<string, unknown>;
55
+ /**
56
+ * The JSON Schema `tools/list` advertises for a {@link ToolShape}.
57
+ *
58
+ * NOTE: `additionalProperties: false` is what the schema says; servers still
59
+ * drop unknown arguments rather than refuse them, as the cloud's zod schemas
60
+ * do.
61
+ */
62
+ export declare function toolInputSchema(shape: ToolShape): JsonSchema;
63
+ /**
64
+ * One tool as `tools/list` advertises it (BE-27). Both board servers build
65
+ * their list with this, so the cloud and the offline one cannot drift on the
66
+ * fields around the schema either.
67
+ */
68
+ export declare function toolListEntry(tool: ToolContract): {
69
+ name: string;
70
+ title?: string;
71
+ description: string;
72
+ inputSchema: JsonSchema;
73
+ annotations: {
74
+ readOnlyHint: boolean;
75
+ destructiveHint: boolean;
76
+ openWorldHint: false;
77
+ };
78
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanework/contracts",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "The contract between the Lanework desktop app, its checkpoint hook, the Lanework API and their MCP servers: HTTP request and response shapes, the board, kit and control tool contracts (types, JSON Schema builders and run-time output shapes).",
6
6
  "license": "MIT",
@@ -9,10 +9,16 @@
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/lanework-dev/contracts.git"
11
11
  },
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
12
14
  "exports": {
13
- ".": "./src/index.ts"
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
14
19
  },
15
20
  "files": [
21
+ "dist",
16
22
  "src",
17
23
  "LICENSE",
18
24
  "README.md"
@@ -22,6 +28,8 @@
22
28
  },
23
29
  "//": "Types, JSON Schema builders and output shapes only, no runtime dependencies. The desktop app (open source) and the API and MCP (private) both build on it; neither half may be imported here.",
24
30
  "scripts": {
31
+ "build": "rm -rf dist && bun build src/index.ts --outdir dist --target node --format esm && tsc -p tsconfig.build.json",
32
+ "prepack": "bun run build",
25
33
  "typecheck": "tsc --noEmit",
26
34
  "test": "bun test",
27
35
  "check:size": "bun scripts/check-size.ts"