@adobe/exc-app 1.5.10 → 1.5.12-beta
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/CHANGELOG.md +16 -0
- package/JSONValue.d.ts +19 -0
- package/JSONValue.js +13 -0
- package/JSONValue.js.map +1 -0
- package/ai.d.ts +16 -9
- package/ai.js.map +1 -1
- package/appapi.d.ts +1 -0
- package/appapi.js +1 -0
- package/appapi.js.map +1 -1
- package/docs/docs_html/assets/hierarchy.js +1 -0
- package/docs/docs_html/assets/icons.js +18 -0
- package/docs/docs_html/assets/main.js +60 -0
- package/docs/docs_html/assets/navigation.js +1 -0
- package/docs/docs_html/assets/search.js +1 -0
- package/network.d.ts +4 -0
- package/network.js.map +1 -1
- package/package.json +1 -1
- package/sidenav.d.ts +57 -3
- package/sidenav.js.map +1 -1
- package/src/Global.d.ts +2 -0
- package/src/Global.js.map +1 -1
- package/tests/ai.test.js +6 -0
- package/tests/ai.test.js.map +1 -1
- package/tests/sidenav.test.js +23 -0
- package/tests/sidenav.test.js.map +1 -1
- package/tests/webmcp.test.d.ts +1 -0
- package/tests/webmcp.test.js +113 -0
- package/tests/webmcp.test.js.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/webmcp.d.ts +176 -0
- package/webmcp.js +82 -0
- package/webmcp.js.map +1 -0
package/webmcp.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*************************************************************************
|
|
3
|
+
* Copyright 2026 Adobe
|
|
4
|
+
* All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this file in
|
|
7
|
+
* accordance with the terms of the Adobe license agreement accompanying
|
|
8
|
+
* it. If you have received this file from a source other than Adobe,
|
|
9
|
+
* then your use, modification, or distribution of it requires the prior
|
|
10
|
+
* written permission of Adobe.
|
|
11
|
+
**************************************************************************/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TOOLS_CHANGE_EVENT = void 0;
|
|
14
|
+
/**
|
|
15
|
+
* Solution-facing API for WebMCP tool registration.
|
|
16
|
+
*
|
|
17
|
+
* Solutions import this module to register browser-side tools that AO2
|
|
18
|
+
* can invoke. The tool handler functions execute locally in the APP iframe;
|
|
19
|
+
* only the serializable definition crosses postMessage to Core.
|
|
20
|
+
*
|
|
21
|
+
* ***Import:***
|
|
22
|
+
*
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import webmcp from '@adobe/exc-app/webmcp';
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* ***Default export:***
|
|
28
|
+
*
|
|
29
|
+
* [webmcpApi](../interfaces/webmcp.webmcpapi.md#interface-webmcpapi)
|
|
30
|
+
*
|
|
31
|
+
* ***Usage:***
|
|
32
|
+
*
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Register a custom tool
|
|
35
|
+
* webmcp.registerTool({
|
|
36
|
+
* name: 'getSelectedAssets',
|
|
37
|
+
* description: 'Returns the currently selected assets in the DAM',
|
|
38
|
+
* inputSchema: {
|
|
39
|
+
* type: 'object',
|
|
40
|
+
* properties: {
|
|
41
|
+
* includeMetadata: {
|
|
42
|
+
* type: 'boolean',
|
|
43
|
+
* description: 'Whether to include full metadata'
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
* },
|
|
47
|
+
* execute: async (parameters) => {
|
|
48
|
+
* const assets = await myApp.getSelectedAssets(parameters.includeMetadata);
|
|
49
|
+
* return { assets };
|
|
50
|
+
* }
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // Unregister a tool
|
|
54
|
+
* webmcp.unregisterTool('getSelectedAssets');
|
|
55
|
+
* ```
|
|
56
|
+
* @packageDocumentation
|
|
57
|
+
* @module webmcp
|
|
58
|
+
*/
|
|
59
|
+
const Global_1 = require("./src/Global");
|
|
60
|
+
exports.TOOLS_CHANGE_EVENT = 'change:tools';
|
|
61
|
+
const webmcp = {
|
|
62
|
+
executeTool: (name, parameters) => {
|
|
63
|
+
return (0, Global_1.getImpl)('webmcp')().executeTool(name, parameters);
|
|
64
|
+
},
|
|
65
|
+
getTools: () => {
|
|
66
|
+
return (0, Global_1.getImpl)('webmcp')().getTools();
|
|
67
|
+
},
|
|
68
|
+
off: (event, handler) => {
|
|
69
|
+
return (0, Global_1.getImpl)('webmcp')().off(event, handler);
|
|
70
|
+
},
|
|
71
|
+
on: (event, handler) => {
|
|
72
|
+
return (0, Global_1.getImpl)('webmcp')().on(event, handler);
|
|
73
|
+
},
|
|
74
|
+
registerTool: (definition) => {
|
|
75
|
+
return (0, Global_1.getImpl)('webmcp')().registerTool(definition);
|
|
76
|
+
},
|
|
77
|
+
unregisterTool: (name, component) => {
|
|
78
|
+
return (0, Global_1.getImpl)('webmcp')().unregisterTool(name, component);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
exports.default = webmcp;
|
|
82
|
+
//# sourceMappingURL=webmcp.js.map
|
package/webmcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webmcp.js","sourceRoot":"","sources":["webmcp.ts"],"names":[],"mappings":";AAAA;;;;;;;;;4EAS4E;;;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,yCAAqC;AAmBxB,QAAA,kBAAkB,GAAG,cAAc,CAAC;AAgKjD,MAAM,MAAM,GAAG;IACb,WAAW,EAAE,CAAC,IAAY,EAAE,UAAgC,EAAE,EAAE;QAC9D,OAAO,IAAA,gBAAO,EAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC;IACD,QAAQ,EAAE,GAAG,EAAE;QACb,OAAO,IAAA,gBAAO,EAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAA2C,CAAC;IACjF,CAAC;IACD,GAAG,EAAE,CAAC,K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