dawmcp 0.0.1 → 0.0.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 (47) hide show
  1. package/README.md +46 -91
  2. package/THIRD-PARTY-NOTICES.md +997 -2
  3. package/bridge/index.mjs +62 -0
  4. package/bridge/types/browser-bridge-client.d.ts +134 -0
  5. package/bridge/types/browser-bridge-protocol.d.ts +150 -0
  6. package/bridge/types/catalog.d.ts +106 -0
  7. package/bridge/types/contracts.d.ts +3330 -0
  8. package/bridge/types/cubase-contracts.d.ts +87 -0
  9. package/bridge/types/fl-contracts.d.ts +297 -0
  10. package/bridge/types/http-daw-contracts.d.ts +141 -0
  11. package/bridge/types/logic-contracts.d.ts +527 -0
  12. package/bridge/types/plugin-contracts.d.ts +581 -0
  13. package/bridge/types/pro-tools-contracts.d.ts +103 -0
  14. package/bridge/types/provider-declaration.d.ts +122 -0
  15. package/bridge/types/provider-manifest.d.ts +463 -0
  16. package/bridge/types/provider-operations.d.ts +597 -0
  17. package/bridge/types/reaper-contracts.d.ts +217 -0
  18. package/bridge/types/studio-one-contracts.d.ts +125 -0
  19. package/bridge/types/waveform-contracts.d.ts +131 -0
  20. package/cli.mjs +253 -148
  21. package/logic/LogicProMCP +2 -2
  22. package/logic/runtime.json +2 -2
  23. package/package.json +18 -2
  24. package/plugin/.claude-plugin/marketplace.json +1 -0
  25. package/plugin/.claude-plugin/plugin.json +3 -2
  26. package/plugin/.mcp.json +1 -1
  27. package/plugin/README.md +46 -91
  28. package/plugin/THIRD-PARTY-NOTICES.md +997 -2
  29. package/plugin/plugin.json +1 -1
  30. package/plugin/skills/daw/SKILL.md +8 -2
  31. package/plugin/skills/daw/references/ardour.md +7 -2
  32. package/plugin/skills/daw/references/arrangement.md +17 -0
  33. package/plugin/skills/daw/references/connection.md +21 -0
  34. package/plugin/skills/daw/references/drums.md +23 -0
  35. package/plugin/skills/daw/references/editing.md +9 -0
  36. package/plugin/skills/daw/references/mix-check.md +17 -0
  37. package/plugin/skills/daw/references/session-hygiene.md +15 -0
  38. package/plugin/skills/daw/references/theory.md +26 -0
  39. package/skill/SKILL.md +8 -2
  40. package/skill/references/ardour.md +7 -2
  41. package/skill/references/arrangement.md +17 -0
  42. package/skill/references/connection.md +21 -0
  43. package/skill/references/drums.md +23 -0
  44. package/skill/references/editing.md +9 -0
  45. package/skill/references/mix-check.md +17 -0
  46. package/skill/references/session-hygiene.md +15 -0
  47. package/skill/references/theory.md +26 -0
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Browser-bridge client for web DAWs. A web app calls `connectDawmcp` when the
3
+ * user chooses Connect agent, with handlers for the portable operations it
4
+ * implements. A web DAW DAWMCP lists connects at once. A web DAW the user
5
+ * added from a manifest gets a code the first time a browser connects: the
6
+ * library calls `onCode` with a line such as "Connect Web DAW with code
7
+ * 482913", which the app shows with a button to copy it, and the user pastes
8
+ * it into their agent. Either way DAWMCP gives the browser a key, which the
9
+ * library keeps in `localStorage`, and later connections need no code: after
10
+ * a reload, a project change or an agent restart, call `connectDawmcp` again.
11
+ *
12
+ * Inputs reach a handler parsed with DAWMCP's own schemas, and each result is
13
+ * checked against DAWMCP's output schema before it is sent, so a bad result
14
+ * fails in the page instead of in the agent.
15
+ *
16
+ * The library owns the connection: the address, the protocol and the keys. A
17
+ * web DAW passes its `provider` id, its `app` version and its handlers; the
18
+ * library reports what the handlers answer, with the guarantees in
19
+ * `declaration`, when the tab connects. Its manifest holds only who it is and
20
+ * the origins DAWMCP admits.
21
+ *
22
+ * Browser-safe; the companion side is `browser-bridge.ts`.
23
+ */
24
+ import { z } from "zod";
25
+ import { BRIDGE_CLOSE, DAWMCP_BRIDGE_URL } from "./browser-bridge-protocol.js";
26
+ import { type DawCategory } from "./contracts.js";
27
+ import { type FrameField, type SessionGuarantees } from "./provider-declaration.js";
28
+ import { PROVIDER_OPERATION_CONTRACTS, type ProviderOperation } from "./provider-operations.js";
29
+ export { BRIDGE_CLOSE, DAWMCP_BRIDGE_URL, PROVIDER_OPERATION_CONTRACTS, type DawCategory, type FrameField, type ProviderOperation, type SessionGuarantees, };
30
+ type Contract<K extends ProviderOperation> = (typeof PROVIDER_OPERATION_CONTRACTS)[K];
31
+ /** What a handler receives: DAWMCP's parsed input, without the `daw` routing field. */
32
+ export type OperationInput<K extends ProviderOperation> = Omit<z.output<Contract<K>["input"]>, "daw">;
33
+ /** What a handler returns: DAWMCP's output, without `daw`, which the library sets. */
34
+ export type OperationResult<K extends ProviderOperation> = Omit<z.input<Contract<K>["output"]>, "daw"> & {
35
+ daw?: string;
36
+ };
37
+ export type OperationHandlers = {
38
+ [K in ProviderOperation]?: (input: OperationInput<K>) => OperationResult<K> | Promise<OperationResult<K>>;
39
+ };
40
+ /** A typed extra beyond the portable operations; the agent needs a grant for its category. */
41
+ export interface NativeTool {
42
+ name: string;
43
+ /** `context` for a read; any other category changes the session. */
44
+ category: DawCategory;
45
+ description: string;
46
+ /** JSON Schema for an object; DAWMCP pins it by digest on first listing. */
47
+ inputSchema: Record<string, unknown>;
48
+ outputSchema?: Record<string, unknown>;
49
+ handler: (args: Record<string, unknown>) => unknown | Promise<unknown>;
50
+ }
51
+ /** Where the browser's key is kept; `localStorage` by default. */
52
+ export type KeyStorage = Pick<Storage, "getItem" | "setItem" | "removeItem">;
53
+ export type ConnectStatus = "connecting"
54
+ /** DAWMCP is not reachable yet; with `waitForAgent` the library keeps trying. */
55
+ | "waiting-for-agent"
56
+ /** The app shows the line from `onCode` until the user's agent connects the tab. */
57
+ | "code-needed" | "connected";
58
+ /**
59
+ * What the handlers cannot show. Writes stay withheld until `stableId`,
60
+ * `revision` and `writePreconditions` are true; each guarantee is described
61
+ * in DAWMCP's integration guide. Everything defaults to false or empty.
62
+ */
63
+ export interface Declaration {
64
+ session?: Partial<SessionGuarantees>;
65
+ /** Optional session-read fields the snapshot fills. */
66
+ frame?: readonly FrameField[];
67
+ /** Whether tracks report their kind. */
68
+ trackKinds?: boolean;
69
+ }
70
+ export interface ConnectOptions {
71
+ /** The manifest `id`. */
72
+ provider: string;
73
+ /** The project open in this tab. Every snapshot and receipt must name it. */
74
+ sessionId: string;
75
+ /** The web app's version and the version of its DAWMCP surface. */
76
+ app: {
77
+ version: string;
78
+ surface: string;
79
+ };
80
+ /** One handler per portable operation; `read_daw_session` is required. */
81
+ operations: OperationHandlers;
82
+ native?: readonly NativeTool[];
83
+ declaration?: Declaration;
84
+ /**
85
+ * A web DAW the user added needs its first connection confirmed through
86
+ * the agent. Show `prompt` (for example "Connect Web DAW with code 482913")
87
+ * with a button to copy it, for the user to paste into their agent chat.
88
+ * Called again with a new code when DAWMCP replaces it. A listed web DAW,
89
+ * or a browser that connected before, never gets this call.
90
+ */
91
+ onCode?: (offer: {
92
+ code: string;
93
+ prompt: string;
94
+ expiresAt: string;
95
+ }) => void;
96
+ /** Keep trying until DAWMCP is reachable, for an agent that starts later. */
97
+ waitForAgent?: boolean;
98
+ /** Cancels connecting, waiting included. */
99
+ signal?: AbortSignal;
100
+ onStatus?: (status: ConnectStatus) => void;
101
+ storage?: KeyStorage;
102
+ /** For tests and non-browser runtimes; it is opened with `DAWMCP_BRIDGE_URL`. */
103
+ WebSocket?: typeof WebSocket;
104
+ /** After connecting: `code` is `BRIDGE_CLOSE.replaced` when another tab took over. */
105
+ onClose?: (event: {
106
+ code: number;
107
+ reason: string;
108
+ }) => void;
109
+ }
110
+ export interface DawmcpConnection {
111
+ readonly daw: string;
112
+ /** Disconnects this tab. The browser stays remembered. */
113
+ close(): void;
114
+ readonly closed: Promise<{
115
+ code: number;
116
+ reason: string;
117
+ }>;
118
+ }
119
+ export declare class DawmcpConnectError extends Error {
120
+ /** `unreachable`: DAWMCP could not be reached, or the browser blocked local network access. */
121
+ readonly reason: "unreachable" | "refused" | "cancelled";
122
+ constructor(message: string,
123
+ /** `unreachable`: DAWMCP could not be reached, or the browser blocked local network access. */
124
+ reason: "unreachable" | "refused" | "cancelled");
125
+ }
126
+ /** Whether this browser has connected before, so the app can reconnect on load without asking. */
127
+ export declare function isRemembered(provider: string, storage?: KeyStorage | undefined): boolean;
128
+ /** Forget this browser's key; the next connection asks for a code. */
129
+ export declare function forgetDawmcp(provider: string, storage?: KeyStorage | undefined): void;
130
+ /**
131
+ * Connect this tab to DAWMCP and answer its requests until the tab, another
132
+ * tab or DAWMCP ends the connection.
133
+ */
134
+ export declare function connectDawmcp(options: ConnectOptions): Promise<DawmcpConnection>;
@@ -0,0 +1,150 @@
1
+ /**
2
+ * The browser bridge's wire protocol, shared by the companion (`browser-bridge.ts`)
3
+ * and the web-app client (`browser-bridge-client.ts`). Browser-safe: no Node
4
+ * imports.
5
+ *
6
+ * A web DAW cannot accept a connection from a local process, so the page
7
+ * connects out to the DAWMCP companion on loopback:
8
+ *
9
+ * 1. The page opens `DAWMCP_BRIDGE_URL` with the subprotocol
10
+ * `BROWSER_BRIDGE_SUBPROTOCOL`. The companion refuses the upgrade unless the
11
+ * `Origin` header is an origin of an added web DAW and `Host` names the
12
+ * loopback listener. Every web DAW shares the one listener; the origin
13
+ * selects the provider.
14
+ * 2. The page sends `hello`: its app version, its declaration (the
15
+ * operations and native tools it answers, built from its handlers, and
16
+ * the session guarantees it keeps) and the key DAWMCP gave this browser
17
+ * before. DAWMCP checks the declaration as it checks a manifest's. A
18
+ * known key connects at once (`connected`). A web DAW DAWMCP lists
19
+ * connects without a key too, and gets one.
20
+ * 3. A web DAW the user added from a manifest, offering no known key, gets
21
+ * `code-needed` with a 6-digit code for that tab and a line for the user
22
+ * to paste into their agent. The agent passes the code to DAWMCP's
23
+ * `connect_web_daw` tool, and the tab gets `connected` with its key.
24
+ * 4. Once connected, the companion sends MCP `tools/list` and `tools/call`
25
+ * requests as JSON-RPC, and the page answers each with an MCP result.
26
+ *
27
+ * One tab is connected per web DAW: a tab that connects replaces the one
28
+ * before it. The connection is bound to the session the page named in
29
+ * `hello`; a page that opens another project reconnects with its key.
30
+ */
31
+ import { z } from "zod";
32
+ export declare const BROWSER_BRIDGE_PROTOCOL = 1;
33
+ export declare const BROWSER_BRIDGE_SUBPROTOCOL = "dawmcp-bridge.v1";
34
+ export declare const BROWSER_BRIDGE_PATH = "/dawmcp";
35
+ /**
36
+ * The one loopback port the companion listens on and every page connects
37
+ * to. Web DAWs never choose it: `dawmcp/bridge` connects to `DAWMCP_BRIDGE_URL`.
38
+ * 30303 is unassigned by IANA, below every common ephemeral range and clear
39
+ * of the 3000s dev servers; its one known user, Ethereum's peer-to-peer
40
+ * default, is rare on a musician's computer.
41
+ */
42
+ export declare const BROWSER_BRIDGE_PORT = 30303;
43
+ export declare const DAWMCP_BRIDGE_URL = "ws://127.0.0.1:30303/dawmcp";
44
+ /** Largest message either side accepts. */
45
+ export declare const BROWSER_BRIDGE_MAX_MESSAGE_BYTES: number;
46
+ export declare const PAIRING_CODE_DIGITS = 6;
47
+ /** Digits only: spaces, dashes and other separators are dropped. */
48
+ export declare function normalizePairingCode(value: string): string;
49
+ export declare const BridgeHelloSchema: z.ZodObject<{
50
+ type: z.ZodLiteral<"hello">;
51
+ protocol: z.ZodLiteral<1>;
52
+ provider: z.ZodString;
53
+ sessionId: z.ZodString;
54
+ app: z.ZodObject<{
55
+ version: z.ZodString;
56
+ surface: z.ZodString;
57
+ }, z.core.$strict>;
58
+ declaration: z.ZodObject<{
59
+ operations: z.ZodArray<z.ZodEnum<{
60
+ [x: string]: string;
61
+ }>>;
62
+ session: z.ZodObject<{
63
+ stableId: z.ZodBoolean;
64
+ revision: z.ZodBoolean;
65
+ writePreconditions: z.ZodBoolean;
66
+ idempotentRequests: z.ZodBoolean;
67
+ undoPerWrite: z.ZodBoolean;
68
+ changeEvents: z.ZodBoolean;
69
+ }, z.core.$strict>;
70
+ frame: z.ZodArray<z.ZodEnum<{
71
+ tempos: "tempos";
72
+ meters: "meters";
73
+ markers: "markers";
74
+ loop: "loop";
75
+ timeSelection: "timeSelection";
76
+ editCursor: "editCursor";
77
+ playhead: "playhead";
78
+ }>>;
79
+ trackKinds: z.ZodBoolean;
80
+ native: z.ZodArray<z.ZodObject<{
81
+ tool: z.ZodString;
82
+ category: z.ZodEnum<{
83
+ context: "context";
84
+ mixing: "mixing";
85
+ composition: "composition";
86
+ transport: "transport";
87
+ media: "media";
88
+ project: "project";
89
+ }>;
90
+ description: z.ZodString;
91
+ }, z.core.$strict>>;
92
+ }, z.core.$strict>;
93
+ key: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strict>;
95
+ export type BridgeHello = z.infer<typeof BridgeHelloSchema>;
96
+ export declare const BridgeCodeNeededSchema: z.ZodObject<{
97
+ type: z.ZodLiteral<"code-needed">;
98
+ code: z.ZodString;
99
+ prompt: z.ZodString;
100
+ expiresAt: z.ZodString;
101
+ forgotten: z.ZodOptional<z.ZodBoolean>;
102
+ }, z.core.$strict>;
103
+ export declare const BridgeConnectedSchema: z.ZodObject<{
104
+ type: z.ZodLiteral<"connected">;
105
+ provider: z.ZodString;
106
+ daw: z.ZodString;
107
+ key: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strict>;
109
+ /** A request the companion sends to a connected page. */
110
+ export declare const BridgeRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
111
+ jsonrpc: z.ZodLiteral<"2.0">;
112
+ id: z.ZodNumber;
113
+ method: z.ZodLiteral<"tools/list">;
114
+ params: z.ZodOptional<z.ZodObject<{
115
+ cursor: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strict>>;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ jsonrpc: z.ZodLiteral<"2.0">;
119
+ id: z.ZodNumber;
120
+ method: z.ZodLiteral<"tools/call">;
121
+ params: z.ZodObject<{
122
+ name: z.ZodString;
123
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
124
+ }, z.core.$strict>;
125
+ }, z.core.$strict>], "method">;
126
+ export type BridgeRequest = z.infer<typeof BridgeRequestSchema>;
127
+ /** A connected page's answer to one request. */
128
+ export declare const BridgeResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
129
+ jsonrpc: z.ZodLiteral<"2.0">;
130
+ id: z.ZodNumber;
131
+ result: z.ZodUnknown;
132
+ }, z.core.$strict>, z.ZodObject<{
133
+ jsonrpc: z.ZodLiteral<"2.0">;
134
+ id: z.ZodNumber;
135
+ error: z.ZodObject<{
136
+ code: z.ZodNumber;
137
+ message: z.ZodString;
138
+ }, z.core.$strict>;
139
+ }, z.core.$strict>]>;
140
+ export type BridgeResponse = z.infer<typeof BridgeResponseSchema>;
141
+ /** WebSocket close codes the bridge uses, in the application range. */
142
+ export declare const BRIDGE_CLOSE: {
143
+ readonly protocol: 4400;
144
+ readonly refused: 4401;
145
+ readonly timeout: 4408;
146
+ /** Another tab of the same web DAW connected. */
147
+ readonly replaced: 4409;
148
+ readonly stopped: 4410;
149
+ readonly sessionChanged: 4412;
150
+ };
@@ -0,0 +1,106 @@
1
+ import type { DawId, DawCategory } from "./contracts.js";
2
+ import type { WebProviderManifest } from "./provider-manifest.js";
3
+ /** Product evidence, shared by desktop and website. Never promote from a mock test. */
4
+ export type DawSupport = "validated" | "experimental" | "coming-soon" | "unsupported" | "unknown";
5
+ export declare const DAW_SUPPORT_LABELS: Record<DawSupport, string>;
6
+ export declare const DAW_FEATURES: readonly [{
7
+ readonly id: "context";
8
+ readonly label: "Read session";
9
+ }, {
10
+ readonly id: "transport";
11
+ readonly label: "Transport";
12
+ }, {
13
+ readonly id: "tempo";
14
+ readonly label: "Set tempo";
15
+ }, {
16
+ readonly id: "tracks";
17
+ readonly label: "Create tracks";
18
+ }, {
19
+ readonly id: "midi";
20
+ readonly label: "Write MIDI clips";
21
+ }, {
22
+ readonly id: "audio";
23
+ readonly label: "Place WAV files";
24
+ }, {
25
+ readonly id: "mixing";
26
+ readonly label: "Mixer and devices";
27
+ }, {
28
+ readonly id: "plugins";
29
+ readonly label: "Insert plug-ins";
30
+ }, {
31
+ readonly id: "parameters";
32
+ readonly label: "Plug-in parameters";
33
+ }, {
34
+ readonly id: "save";
35
+ readonly label: "Save project";
36
+ }, {
37
+ readonly id: "render";
38
+ readonly label: "Render audio";
39
+ }];
40
+ type Feature = (typeof DAW_FEATURES)[number]["id"];
41
+ export interface DawCatalogEntry {
42
+ id: DawId;
43
+ name: string;
44
+ version: string;
45
+ bridge: string;
46
+ setup: string[];
47
+ source: string;
48
+ support: Record<Feature, DawSupport>;
49
+ note: string;
50
+ }
51
+ export declare const DAW_PLUGIN_OPERATIONS: readonly ["list", "chain", "insert", "read", "set"];
52
+ export type DawPluginOperation = (typeof DAW_PLUGIN_OPERATIONS)[number];
53
+ export interface DawPluginPath {
54
+ /** The portable plug-in operation is implemented by this adapter. */
55
+ portable: boolean;
56
+ /** Typed native commands that cover part of this operation. */
57
+ native: readonly string[];
58
+ }
59
+ /**
60
+ * Source evidence for plug-in work in the DAW's own chain. The portable
61
+ * operations, unsupported answers and the catalog's `plugins` and
62
+ * `parameters` cells all derive from this table. Native names are checked
63
+ * against each adapter's command vocabulary in tests.
64
+ */
65
+ export declare const DAW_PLUGIN_COVERAGE: Record<DawId, Record<DawPluginOperation, DawPluginPath>>;
66
+ export declare const DAW_CATALOG: readonly DawCatalogEntry[];
67
+ /**
68
+ * Web DAWs DAWMCP connects without `dawmcp provider add`: their makers ship
69
+ * the `dawmcp/bridge` client, connect only after the user chooses Connect
70
+ * agent (or has connected before), and pass the browser-bridge check. Each is
71
+ * an ordinary web DAW manifest, which names only who it is and its origins;
72
+ * a provider the user adds with the same `id` replaces it, and is listed only
73
+ * when its origins match. A listed web DAW's browsers connect without a code.
74
+ */
75
+ export declare const LISTED_WEB_DAWS: readonly WebProviderManifest[];
76
+ /** Implemented adapter surfaces, distinct from roadmap/native upstream features. */
77
+ export declare const DAW_RUNTIME_CAPABILITIES: Partial<Record<DawId, readonly string[]>>;
78
+ export declare const DAW_RUNTIME_CATEGORIES: Partial<Record<DawId, readonly DawCategory[]>>;
79
+ /** Standalone profiles; OS, SDK and native prerequisites remain profile-specific. */
80
+ export declare const DAW_STANDALONE_IDS: readonly DawId[];
81
+ /** Portable task mapping. Native-only variants retain their own command schemas. */
82
+ export declare const DAW_TASKS: readonly [{
83
+ readonly id: "context";
84
+ readonly capability: "read";
85
+ readonly category: "context";
86
+ }, {
87
+ readonly id: "midi";
88
+ readonly capability: "writeMidi";
89
+ readonly category: "composition";
90
+ }, {
91
+ readonly id: "audio";
92
+ readonly capability: "importAudio";
93
+ readonly category: "media";
94
+ }, {
95
+ readonly id: "mixing";
96
+ readonly capability: "native";
97
+ readonly category: "mixing";
98
+ }];
99
+ /** Upstream choices, not additional bundled capabilities. Preserve a suitable existing connection. */
100
+ export declare const DAW_UPSTREAM_OPTIONS: Partial<Record<DawId, readonly {
101
+ id: string;
102
+ name: string;
103
+ url: string;
104
+ description: string;
105
+ }[]>>;
106
+ export {};