claude-in-mobile 3.11.3 → 3.11.4
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/node_modules/@claude-in-mobile/plugin-api/dist/index.d.ts +100 -0
- package/node_modules/@claude-in-mobile/plugin-api/dist/index.d.ts.map +1 -0
- package/node_modules/@claude-in-mobile/plugin-api/dist/index.js +49 -0
- package/node_modules/@claude-in-mobile/plugin-api/dist/index.js.map +1 -0
- package/node_modules/@claude-in-mobile/plugin-api/package.json +37 -0
- package/package.json +5 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @claude-in-mobile/plugin-api
|
|
3
|
+
*
|
|
4
|
+
* Public plugin contract for the claude-in-mobile microkernel.
|
|
5
|
+
*
|
|
6
|
+
* Versioned independently of the product. See docs/adr/0002-plugin-api-v1.md
|
|
7
|
+
* for the formal contract, lifecycle FSM, and event bus topics.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PLUGIN_API_VERSION: "1";
|
|
10
|
+
export type PluginApiVersion = typeof PLUGIN_API_VERSION;
|
|
11
|
+
export type Capability = "screen" | "input" | "ui" | "shell" | "appLifecycle" | "permissions" | "logs" | "terminal" | "fileTransfer" | "deviceMgmt";
|
|
12
|
+
export declare const ALL_CAPABILITIES: readonly Capability[];
|
|
13
|
+
export interface PluginManifest {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly version: string;
|
|
17
|
+
readonly apiVersion: PluginApiVersion;
|
|
18
|
+
readonly capabilities: readonly Capability[];
|
|
19
|
+
readonly tools?: readonly string[];
|
|
20
|
+
readonly description?: string;
|
|
21
|
+
readonly homepage?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Logger {
|
|
24
|
+
debug(msg: string, meta?: Record<string, unknown>): void;
|
|
25
|
+
info(msg: string, meta?: Record<string, unknown>): void;
|
|
26
|
+
warn(msg: string, meta?: Record<string, unknown>): void;
|
|
27
|
+
error(msg: string, meta?: Record<string, unknown>): void;
|
|
28
|
+
}
|
|
29
|
+
export interface EventBus {
|
|
30
|
+
emit<T extends keyof CoreTopics>(topic: T, payload: CoreTopics[T]): void;
|
|
31
|
+
on<T extends keyof CoreTopics>(topic: T, handler: (payload: CoreTopics[T]) => void): Unsubscribe;
|
|
32
|
+
}
|
|
33
|
+
export type Unsubscribe = () => void;
|
|
34
|
+
export interface CoreTopics {
|
|
35
|
+
"plugin.registered": {
|
|
36
|
+
pluginId: string;
|
|
37
|
+
};
|
|
38
|
+
"plugin.initialized": {
|
|
39
|
+
pluginId: string;
|
|
40
|
+
};
|
|
41
|
+
"plugin.failed": {
|
|
42
|
+
pluginId: string;
|
|
43
|
+
error: string;
|
|
44
|
+
};
|
|
45
|
+
"plugin.disposed": {
|
|
46
|
+
pluginId: string;
|
|
47
|
+
};
|
|
48
|
+
"session.spawned": {
|
|
49
|
+
pluginId: string;
|
|
50
|
+
sessionId: string;
|
|
51
|
+
};
|
|
52
|
+
"session.died": {
|
|
53
|
+
pluginId: string;
|
|
54
|
+
sessionId: string;
|
|
55
|
+
exitCode?: number;
|
|
56
|
+
};
|
|
57
|
+
"device.connected": {
|
|
58
|
+
pluginId: string;
|
|
59
|
+
deviceId: string;
|
|
60
|
+
};
|
|
61
|
+
"device.disconnected": {
|
|
62
|
+
pluginId: string;
|
|
63
|
+
deviceId: string;
|
|
64
|
+
};
|
|
65
|
+
"tool.invoked": {
|
|
66
|
+
tool: string;
|
|
67
|
+
args: unknown;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface ToolDefinition {
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly description: string;
|
|
73
|
+
readonly inputSchema: Record<string, unknown>;
|
|
74
|
+
handler(args: unknown): Promise<unknown>;
|
|
75
|
+
}
|
|
76
|
+
export interface PluginContext {
|
|
77
|
+
readonly logger: Logger;
|
|
78
|
+
readonly config: Readonly<Record<string, unknown>>;
|
|
79
|
+
readonly eventBus: EventBus;
|
|
80
|
+
registerTool(def: ToolDefinition): void;
|
|
81
|
+
}
|
|
82
|
+
export type PluginState = "unregistered" | "registered" | "initializing" | "active" | "disposing" | "disposed" | "failed";
|
|
83
|
+
export interface SourcePlugin {
|
|
84
|
+
readonly manifest: PluginManifest;
|
|
85
|
+
init(ctx: PluginContext): Promise<void> | void;
|
|
86
|
+
dispose?(): Promise<void> | void;
|
|
87
|
+
}
|
|
88
|
+
export declare class PluginContractError extends Error {
|
|
89
|
+
readonly pluginId: string;
|
|
90
|
+
constructor(message: string, pluginId: string);
|
|
91
|
+
}
|
|
92
|
+
export declare class CapabilityMissingError extends PluginContractError {
|
|
93
|
+
constructor(pluginId: string, capability: Capability);
|
|
94
|
+
}
|
|
95
|
+
export declare class ApiVersionMismatchError extends PluginContractError {
|
|
96
|
+
constructor(pluginId: string, requested: string, supported: PluginApiVersion);
|
|
97
|
+
}
|
|
98
|
+
export declare function isCapability(value: unknown): value is Capability;
|
|
99
|
+
export declare function hasCapability(manifest: PluginManifest, cap: Capability): boolean;
|
|
100
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,kBAAkB,EAAG,GAAY,CAAC;AAC/C,MAAM,MAAM,gBAAgB,GAAG,OAAO,kBAAkB,CAAC;AAEzD,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,OAAO,GACP,IAAI,GACJ,OAAO,GACP,cAAc,GACd,aAAa,GACb,MAAM,GACN,UAAU,GACV,cAAc,GACd,YAAY,CAAC;AAEjB,eAAO,MAAM,gBAAgB,EAAE,SAAS,UAAU,EAWxC,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAA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Ac,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/C,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClC;AAED,qBAAa,mBAAoB,SAAQ,KAAK;aAG1B,QAAQ,EAAE,MAAM;gBADhC,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM;CAKnC;AAED,qBAAa,sBAAuB,SAAQ,mBAAmB;gBACjD,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;CAIrD;AAED,qBAAa,uBAAwB,SAAQ,mBAAmB;gBAClD,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB;CAO7E;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAKhE;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,UAAU,GACd,OAAO,CAET"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @claude-in-mobile/plugin-api
|
|
3
|
+
*
|
|
4
|
+
* Public plugin contract for the claude-in-mobile microkernel.
|
|
5
|
+
*
|
|
6
|
+
* Versioned independently of the product. See docs/adr/0002-plugin-api-v1.md
|
|
7
|
+
* for the formal contract, lifecycle FSM, and event bus topics.
|
|
8
|
+
*/
|
|
9
|
+
export const PLUGIN_API_VERSION = "1";
|
|
10
|
+
export const ALL_CAPABILITIES = [
|
|
11
|
+
"screen",
|
|
12
|
+
"input",
|
|
13
|
+
"ui",
|
|
14
|
+
"shell",
|
|
15
|
+
"appLifecycle",
|
|
16
|
+
"permissions",
|
|
17
|
+
"logs",
|
|
18
|
+
"terminal",
|
|
19
|
+
"fileTransfer",
|
|
20
|
+
"deviceMgmt",
|
|
21
|
+
];
|
|
22
|
+
export class PluginContractError extends Error {
|
|
23
|
+
pluginId;
|
|
24
|
+
constructor(message, pluginId) {
|
|
25
|
+
super(`[plugin:${pluginId}] ${message}`);
|
|
26
|
+
this.pluginId = pluginId;
|
|
27
|
+
this.name = "PluginContractError";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class CapabilityMissingError extends PluginContractError {
|
|
31
|
+
constructor(pluginId, capability) {
|
|
32
|
+
super(`missing required capability: ${capability}`, pluginId);
|
|
33
|
+
this.name = "CapabilityMissingError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class ApiVersionMismatchError extends PluginContractError {
|
|
37
|
+
constructor(pluginId, requested, supported) {
|
|
38
|
+
super(`plugin requests apiVersion="${requested}" but kernel supports "${supported}"`, pluginId);
|
|
39
|
+
this.name = "ApiVersionMismatchError";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function isCapability(value) {
|
|
43
|
+
return (typeof value === "string" &&
|
|
44
|
+
ALL_CAPABILITIES.includes(value));
|
|
45
|
+
}
|
|
46
|
+
export function hasCapability(manifest, cap) {
|
|
47
|
+
return manifest.capabilities.includes(cap);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAY,CAAC;AAe/C,MAAM,CAAC,MAAM,gBAAgB,GAA0B;IACrD,QAAQ;IACR,OAAO;IACP,IAAI;IACJ,OAAO;IACP,cAAc;IACd,aAAa;IACb,MAAM;IACN,UAAU;IACV,cAAc;IACd,YAAY;CACJ,CAAC;AA2EX,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAG1B;IAFlB,YACE,OAAe,EACC,QAAgB;QAEhC,KAAK,CAAC,WAAW,QAAQ,KAAK,OAAO,EAAE,CAAC,CAAC;QAFzB,aAAQ,GAAR,QAAQ,CAAQ;QAGhC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IAC7D,YAAY,QAAgB,EAAE,UAAsB;QAClD,KAAK,CAAC,gCAAgC,UAAU,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,mBAAmB;IAC9D,YAAY,QAAgB,EAAE,SAAiB,EAAE,SAA2B;QAC1E,KAAK,CACH,+BAA+B,SAAS,0BAA0B,SAAS,GAAG,EAC9E,QAAQ,CACT,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACxD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,QAAwB,EACxB,GAAe;IAEf,OAAO,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@claude-in-mobile/plugin-api",
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
|
+
"description": "Public plugin contract for claude-in-mobile microkernel. Provides Capability enum, SourcePlugin/PluginManifest/PluginContext types, EventBus topics. Versioned independently of the product.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"test": "vitest run"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"plugin-api",
|
|
21
|
+
"microkernel",
|
|
22
|
+
"claude-in-mobile"
|
|
23
|
+
],
|
|
24
|
+
"author": "Alex Gladkov",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18.0.0"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^22.10.0",
|
|
34
|
+
"typescript": "^5.7.0",
|
|
35
|
+
"vitest": "^4.0.18"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-in-mobile",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.4",
|
|
4
4
|
"description": "MCP server for mobile, desktop and browser automation - Android (ADB), iOS Simulator (simctl), Desktop (Compose), Browser (CDP)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"README.md"
|
|
104
104
|
],
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@claude-in-mobile/plugin-api": "
|
|
106
|
+
"@claude-in-mobile/plugin-api": "1.0.0-alpha.0",
|
|
107
107
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
108
108
|
"chrome-launcher": "^1.1.0",
|
|
109
109
|
"chrome-remote-interface": "^0.33.0",
|
|
@@ -113,6 +113,9 @@
|
|
|
113
113
|
"optionalDependencies": {
|
|
114
114
|
"sharp": "^0.33.0"
|
|
115
115
|
},
|
|
116
|
+
"bundledDependencies": [
|
|
117
|
+
"@claude-in-mobile/plugin-api"
|
|
118
|
+
],
|
|
116
119
|
"devDependencies": {
|
|
117
120
|
"@types/node": "^22.10.0",
|
|
118
121
|
"typescript": "^5.7.0",
|