@microsoft/app-manifest 1.0.0-alpha.06e5f8c8f.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.
Files changed (106) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +115 -0
  3. package/build/ManifestCommonProperties.d.ts +30 -0
  4. package/build/ManifestCommonProperties.js +5 -0
  5. package/build/ManifestCommonProperties.js.map +1 -0
  6. package/build/constants.d.ts +1 -0
  7. package/build/constants.js +7 -0
  8. package/build/constants.js.map +1 -0
  9. package/build/declarativeCopilotManifest.d.ts +67 -0
  10. package/build/declarativeCopilotManifest.js +15 -0
  11. package/build/declarativeCopilotManifest.js.map +1 -0
  12. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D0.d.ts +163 -0
  13. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D0.js +214 -0
  14. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D0.js.map +1 -0
  15. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D2.d.ts +185 -0
  16. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D2.js +220 -0
  17. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D2.js.map +1 -0
  18. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D3.d.ts +285 -0
  19. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D3.js +248 -0
  20. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D3.js.map +1 -0
  21. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D4.d.ts +292 -0
  22. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D4.js +259 -0
  23. package/build/generated-types/copilot/declarative-agent/DeclarativeAgentManifestV1D4.js.map +1 -0
  24. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D1.d.ts +429 -0
  25. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D1.js +289 -0
  26. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D1.js.map +1 -0
  27. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D2.d.ts +439 -0
  28. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D2.js +298 -0
  29. package/build/generated-types/copilot/plugin/ApiPluginManifestV2D2.js.map +1 -0
  30. package/build/generated-types/index.d.ts +174 -0
  31. package/build/generated-types/index.js +444 -0
  32. package/build/generated-types/index.js.map +1 -0
  33. package/build/generated-types/teams/TeamsManifestV1D0.d.ts +268 -0
  34. package/build/generated-types/teams/TeamsManifestV1D0.js +265 -0
  35. package/build/generated-types/teams/TeamsManifestV1D0.js.map +1 -0
  36. package/build/generated-types/teams/TeamsManifestV1D1.d.ts +268 -0
  37. package/build/generated-types/teams/TeamsManifestV1D1.js +266 -0
  38. package/build/generated-types/teams/TeamsManifestV1D1.js.map +1 -0
  39. package/build/generated-types/teams/TeamsManifestV1D10.d.ts +589 -0
  40. package/build/generated-types/teams/TeamsManifestV1D10.js +448 -0
  41. package/build/generated-types/teams/TeamsManifestV1D10.js.map +1 -0
  42. package/build/generated-types/teams/TeamsManifestV1D11.d.ts +603 -0
  43. package/build/generated-types/teams/TeamsManifestV1D11.js +447 -0
  44. package/build/generated-types/teams/TeamsManifestV1D11.js.map +1 -0
  45. package/build/generated-types/teams/TeamsManifestV1D12.d.ts +638 -0
  46. package/build/generated-types/teams/TeamsManifestV1D12.js +461 -0
  47. package/build/generated-types/teams/TeamsManifestV1D12.js.map +1 -0
  48. package/build/generated-types/teams/TeamsManifestV1D13.d.ts +640 -0
  49. package/build/generated-types/teams/TeamsManifestV1D13.js +461 -0
  50. package/build/generated-types/teams/TeamsManifestV1D13.js.map +1 -0
  51. package/build/generated-types/teams/TeamsManifestV1D14.d.ts +651 -0
  52. package/build/generated-types/teams/TeamsManifestV1D14.js +467 -0
  53. package/build/generated-types/teams/TeamsManifestV1D14.js.map +1 -0
  54. package/build/generated-types/teams/TeamsManifestV1D15.d.ts +656 -0
  55. package/build/generated-types/teams/TeamsManifestV1D15.js +468 -0
  56. package/build/generated-types/teams/TeamsManifestV1D15.js.map +1 -0
  57. package/build/generated-types/teams/TeamsManifestV1D16.d.ts +659 -0
  58. package/build/generated-types/teams/TeamsManifestV1D16.js +471 -0
  59. package/build/generated-types/teams/TeamsManifestV1D16.js.map +1 -0
  60. package/build/generated-types/teams/TeamsManifestV1D17.d.ts +1212 -0
  61. package/build/generated-types/teams/TeamsManifestV1D17.js +733 -0
  62. package/build/generated-types/teams/TeamsManifestV1D17.js.map +1 -0
  63. package/build/generated-types/teams/TeamsManifestV1D19.d.ts +1238 -0
  64. package/build/generated-types/teams/TeamsManifestV1D19.js +742 -0
  65. package/build/generated-types/teams/TeamsManifestV1D19.js.map +1 -0
  66. package/build/generated-types/teams/TeamsManifestV1D2.d.ts +268 -0
  67. package/build/generated-types/teams/TeamsManifestV1D2.js +266 -0
  68. package/build/generated-types/teams/TeamsManifestV1D2.js.map +1 -0
  69. package/build/generated-types/teams/TeamsManifestV1D20.d.ts +1420 -0
  70. package/build/generated-types/teams/TeamsManifestV1D20.js +818 -0
  71. package/build/generated-types/teams/TeamsManifestV1D20.js.map +1 -0
  72. package/build/generated-types/teams/TeamsManifestV1D3.d.ts +280 -0
  73. package/build/generated-types/teams/TeamsManifestV1D3.js +279 -0
  74. package/build/generated-types/teams/TeamsManifestV1D3.js.map +1 -0
  75. package/build/generated-types/teams/TeamsManifestV1D4.d.ts +333 -0
  76. package/build/generated-types/teams/TeamsManifestV1D4.js +316 -0
  77. package/build/generated-types/teams/TeamsManifestV1D4.js.map +1 -0
  78. package/build/generated-types/teams/TeamsManifestV1D5.d.ts +423 -0
  79. package/build/generated-types/teams/TeamsManifestV1D5.js +357 -0
  80. package/build/generated-types/teams/TeamsManifestV1D5.js.map +1 -0
  81. package/build/generated-types/teams/TeamsManifestV1D6.d.ts +428 -0
  82. package/build/generated-types/teams/TeamsManifestV1D6.js +359 -0
  83. package/build/generated-types/teams/TeamsManifestV1D6.js.map +1 -0
  84. package/build/generated-types/teams/TeamsManifestV1D7.d.ts +444 -0
  85. package/build/generated-types/teams/TeamsManifestV1D7.js +369 -0
  86. package/build/generated-types/teams/TeamsManifestV1D7.js.map +1 -0
  87. package/build/generated-types/teams/TeamsManifestV1D8.d.ts +466 -0
  88. package/build/generated-types/teams/TeamsManifestV1D8.js +386 -0
  89. package/build/generated-types/teams/TeamsManifestV1D8.js.map +1 -0
  90. package/build/generated-types/teams/TeamsManifestV1D9.d.ts +532 -0
  91. package/build/generated-types/teams/TeamsManifestV1D9.js +420 -0
  92. package/build/generated-types/teams/TeamsManifestV1D9.js.map +1 -0
  93. package/build/generated-types/teams/TeamsManifestVDevPreview.d.ts +2219 -0
  94. package/build/generated-types/teams/TeamsManifestVDevPreview.js +1090 -0
  95. package/build/generated-types/teams/TeamsManifestVDevPreview.js.map +1 -0
  96. package/build/index.d.ts +87 -0
  97. package/build/index.js +243 -0
  98. package/build/index.js.map +1 -0
  99. package/build/manifest.d.ts +521 -0
  100. package/build/manifest.js +61 -0
  101. package/build/manifest.js.map +1 -0
  102. package/build/pluginManifest.d.ts +143 -0
  103. package/build/pluginManifest.js +3 -0
  104. package/build/pluginManifest.js.map +1 -0
  105. package/build/tsconfig.tsbuildinfo +1 -0
  106. package/package.json +68 -0
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Microsoft Teams Toolkit for Visual Studio Code and Teams Toolkit CLI
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ MIT License
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ ## 📦 Package Name
2
+
3
+ `@microsoft/app-manifest`
4
+
5
+ ---
6
+
7
+ ## 🚀 Summary
8
+
9
+ A collection of TypeScript definitions and converters for Microsoft 365 App manifests, including:
10
+
11
+ - **Strongly‑typed interfaces** for three manifest types with all versions:
12
+ - Teams Manifest: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.19, 1.20, devPreview
13
+ - Declarative Agent Manifest: v1.0, v1.2, v1.3
14
+ - API Plugin Manifest: v2.1, v2.2
15
+ - **Conversion utilities** between JSON strings and typed manifest objects.
16
+ - **Utility tools** for:
17
+ - Validating manifests against manifest schemas
18
+ - Reading/writing manifest files from disk with type checking
19
+
20
+ ---
21
+
22
+ ## ✨ Features
23
+
24
+ - **Type‑safe definitions** of all versions generated from Microsoft’s official [JSON schemas](https://developer.microsoft.com/json-schemas/), guaranteeing compile‑time type correctness.
25
+
26
+ - **Bi‑directional conversion functions** (`jsonToManifest` and `manifestToJson`) for all types and all versions of manifest with runtime type validation.
27
+
28
+ - **Schema validation utilities** to generate validation errors.
29
+
30
+ - **File I/O helpers** to conveniently load and dump manifest files in JSON format.
31
+
32
+ - **Modular versioning**: manifests organized per version file, avoiding type collisions.
33
+
34
+ ## 📥 Installation
35
+
36
+ ```bash
37
+ npm install @microsoft/app-manifest
38
+ ```
39
+
40
+ ## 📖 Usage
41
+
42
+ ### Manipulate manifest
43
+
44
+ **Automatic version inference**
45
+
46
+ You can assign a manifest object directly to the discriminated union types (`TeamsManifest`, `DeclarativeAgentManifest` or `APIPluginManifest`) without specifying a concrete version type. TypeScript will infer the specific version based on the `manifestVersion` field:
47
+
48
+ ![not_specify_version](https://github.com/user-attachments/assets/2f10873b-974a-4998-a80c-6bdd6609bdfc)
49
+
50
+ **Manually specified version**
51
+
52
+ You can specify a concrete version type:
53
+
54
+ ![specify_version](https://github.com/user-attachments/assets/d6a566af-8b68-41cf-b1a2-a1083e16e6c7)
55
+
56
+ ### Manifest to/from JSON converters
57
+
58
+ Convert JSON string to manifest type and check the version at run time:
59
+
60
+ ```typescript
61
+ const json = "{ \"manifestVersion\": \"1.20\", \"id\": \"app-id\", ...}";
62
+ const manifest = TeamsManifestConverter.jsonToManifest(json);
63
+ if (manifest.manifestVersion === "1.20") {
64
+ // TypeScript will infer the type as TeamsManifestV1D20
65
+ const manifestV1D20 = manifest as TeamsManifestV1D20;
66
+ // You can now access properties specific to TeamsManifestV1D20
67
+ }
68
+ ```
69
+
70
+ Convert JSON string to manifest type by specifying the version at compile time:
71
+
72
+ ```typescript
73
+ const json = "{ \"manifestVersion\": \"1.20\", \"id\": \"app-id\", ...}";
74
+ const manifest = TeamsManifestConverter.jsonToManifest(json) as TeamsManifestV1D20;
75
+ // You can now access properties specific to TeamsManifestV1D20
76
+ ```
77
+
78
+ Convert manifest object to JSON string:
79
+
80
+ ```typescript
81
+ const jsonString = TeamsManifestConverter.manifestToJson(manifest);
82
+ ```
83
+
84
+ Note that the converts to/from JSON will throw runtime type check failures.
85
+
86
+ ### Manifest utilities
87
+
88
+ Validate manifest against schema:
89
+
90
+ ```typescript
91
+ const failures = await AppManifestUtils.validateAgainstSchema(manifest);
92
+ ```
93
+
94
+ Read and write manifest:
95
+
96
+ ```typescript
97
+ const teamsManifestPath = "path/to/your/teams_manifest.json";
98
+ // read Teams manifest with type check
99
+ const teamsManifest1 = await AppManifestUtils.readTeamsManifest(teamsManifestPath);
100
+ // read Teams manifest and validate against schema
101
+ const [teamsManifest2, failedValidations1] = await AppManifestUtils.readAndValidateTeamsManifest(teamsManifestPath);
102
+
103
+ const daManifestPath = "path/to/your/da_manifest.json";
104
+ // read declarative agent manifest with type check
105
+ const daManifest1 = await AppManifestUtils.readDeclarativeAgentManifest(daManifestPath);
106
+ // read declarative agent manifest and validate against schema
107
+ const [daManifest2, failedValidations2] = await AppManifestUtils.readAndValidateDeclarativeAgentManifest(daManifestPath);
108
+
109
+
110
+ const pluginManifestPath = "path/to/your/plugin_manifest.json";
111
+ // read API plugin manifest with type check
112
+ const pluginManifest1 = await AppManifestUtils.readApiPluginManifest(pluginManifestPath);
113
+ // read API plugin manifest and validate against schema
114
+ const [pluginManifest2, failedValidations3] = await AppManifestUtils.readAndValidateApiPluginManifest(pluginManifestPath);
115
+ ```
@@ -0,0 +1,30 @@
1
+ export interface ManifestCommonProperties {
2
+ /**
3
+ * Capabilities, e.g. "staticTab" | "configurableTab" | "MessageExtension" | "WebApplicationInfo" | "plugin" | "copilotGpt"
4
+ */
5
+ capabilities: string[];
6
+ /**
7
+ * Teams app id
8
+ */
9
+ id: string;
10
+ /**
11
+ * Teams app version, e.g.1.0.0
12
+ */
13
+ version: string;
14
+ /**
15
+ * manifest version, e.g. 1.16
16
+ */
17
+ manifestVersion: string;
18
+ /**
19
+ * Whether it's an API ME
20
+ */
21
+ isApiME: boolean;
22
+ /**
23
+ * Whether it's SPFx Teams app
24
+ */
25
+ isSPFx: boolean;
26
+ /**
27
+ * Whether it's an API ME with AAD auth
28
+ */
29
+ isApiMeAAD: boolean;
30
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=ManifestCommonProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManifestCommonProperties.js","sourceRoot":"","sources":["../src/ManifestCommonProperties.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
@@ -0,0 +1 @@
1
+ export declare const SharePointAppId = "00000003-0000-0ff1-ce00-000000000000";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.SharePointAppId = void 0;
6
+ exports.SharePointAppId = "00000003-0000-0ff1-ce00-000000000000";
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,eAAe,GAAG,sCAAsC,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { ConversationStarter } from "./pluginManifest";
2
+ export declare enum DeclarativeCopilotCapabilityName {
3
+ WebSearch = "WebSearch",
4
+ GraphicArt = "GraphicArt",
5
+ CodeInterpreter = "CodeInterpreter",
6
+ OneDriveAndSharePoint = "OneDriveAndSharePoint",
7
+ GraphConnectors = "GraphConnectors",
8
+ EmbeddedKnowledge = "EmbeddedKnowledge"
9
+ }
10
+ export interface WebSearchCapability {
11
+ name: DeclarativeCopilotCapabilityName.WebSearch;
12
+ sites?: Site[];
13
+ }
14
+ export interface GraphicArtCapability {
15
+ name: DeclarativeCopilotCapabilityName.GraphicArt;
16
+ [k: string]: unknown;
17
+ }
18
+ export interface CodeInterpreterCapability {
19
+ name: DeclarativeCopilotCapabilityName.CodeInterpreter;
20
+ [k: string]: unknown;
21
+ }
22
+ export interface OneDriveAndSharePointCapability {
23
+ name: DeclarativeCopilotCapabilityName.OneDriveAndSharePoint;
24
+ items_by_sharepoint_ids?: SharePointIDs[];
25
+ items_by_url?: Site[];
26
+ }
27
+ export interface GraphConnectorsCapability {
28
+ name: DeclarativeCopilotCapabilityName.GraphConnectors;
29
+ connections: Connection[];
30
+ [k: string]: unknown;
31
+ }
32
+ export interface EmbeddedKnowledgeCapability {
33
+ name: DeclarativeCopilotCapabilityName.EmbeddedKnowledge;
34
+ files: File[];
35
+ }
36
+ export interface DeclarativeCopilotManifestSchema {
37
+ id?: string;
38
+ name: string;
39
+ description: string;
40
+ instructions?: string;
41
+ capabilities?: (WebSearchCapability | GraphicArtCapability | CodeInterpreterCapability | OneDriveAndSharePointCapability | GraphConnectorsCapability | EmbeddedKnowledgeCapability)[];
42
+ conversation_starters?: ConversationStarter[];
43
+ actions?: ActionObject[];
44
+ [k: string]: unknown;
45
+ }
46
+ export interface SharePointIDs {
47
+ site_id?: string;
48
+ web_id?: string;
49
+ list_id?: string;
50
+ unique_id?: string;
51
+ }
52
+ export interface File {
53
+ file_name?: string;
54
+ file?: string;
55
+ }
56
+ export interface Site {
57
+ url: string;
58
+ }
59
+ export interface Connection {
60
+ connection_id: string;
61
+ [k: string]: unknown;
62
+ }
63
+ export interface ActionObject {
64
+ id: string;
65
+ file: string;
66
+ [k: string]: unknown;
67
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DeclarativeCopilotCapabilityName = void 0;
6
+ var DeclarativeCopilotCapabilityName;
7
+ (function (DeclarativeCopilotCapabilityName) {
8
+ DeclarativeCopilotCapabilityName["WebSearch"] = "WebSearch";
9
+ DeclarativeCopilotCapabilityName["GraphicArt"] = "GraphicArt";
10
+ DeclarativeCopilotCapabilityName["CodeInterpreter"] = "CodeInterpreter";
11
+ DeclarativeCopilotCapabilityName["OneDriveAndSharePoint"] = "OneDriveAndSharePoint";
12
+ DeclarativeCopilotCapabilityName["GraphConnectors"] = "GraphConnectors";
13
+ DeclarativeCopilotCapabilityName["EmbeddedKnowledge"] = "EmbeddedKnowledge";
14
+ })(DeclarativeCopilotCapabilityName = exports.DeclarativeCopilotCapabilityName || (exports.DeclarativeCopilotCapabilityName = {}));
15
+ //# sourceMappingURL=declarativeCopilotManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarativeCopilotManifest.js","sourceRoot":"","sources":["../src/declarativeCopilotManifest.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,IAAY,gCAOX;AAPD,WAAY,gCAAgC;IAC1C,2DAAuB,CAAA;IACvB,6DAAyB,CAAA;IACzB,uEAAmC,CAAA;IACnC,mFAA+C,CAAA;IAC/C,uEAAmC,CAAA;IACnC,2EAAuC,CAAA;AACzC,CAAC,EAPW,gCAAgC,GAAhC,wCAAgC,KAAhC,wCAAgC,QAO3C"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * The root of the declarative agent manifest document is a JSON object that contains
3
+ * members that describe the declarative agent.
4
+ */
5
+ export interface DeclarativeAgentManifestV1D0 {
6
+ /**
7
+ * Required. Not localizable. The version of the schema this manifest is using.
8
+ */
9
+ version: "v1.0";
10
+ /**
11
+ * Optional. Not localizable.
12
+ */
13
+ id?: string;
14
+ /**
15
+ * Required. Localizable. The name of the declarative agent. It MUST contain at least one
16
+ * nonwhitespace character and MUST be 100 characters or less.
17
+ */
18
+ name: string;
19
+ /**
20
+ * Required. Localizable. The description of the declarative agent. It MUST contain at least
21
+ * one nonwhitespace character and MUST be 1,000 characters or less.
22
+ */
23
+ description: string;
24
+ /**
25
+ * Optional. Not localizable. The detailed instructions or guidelines on how the declarative
26
+ * agent should behave, its functions, and any behaviors to avoid. It MUST contain at least
27
+ * one nonwhitespace character and MUST be 8,000 characters or less.
28
+ */
29
+ instructions?: string;
30
+ /**
31
+ * Optional. Contains an array of objects that define capabilities of the declarative agent.
32
+ * There MUST NOT be more than three objects in the array.
33
+ */
34
+ capabilities?: CapabilityElement[];
35
+ /**
36
+ * Optional. A list of examples of questions that the declarative agent can answer. There
37
+ * MUST NOT be more than six objects in the array.
38
+ */
39
+ conversation_starters?: ConversationStarterElement[];
40
+ /**
41
+ * Optional. A list of objects that identify API plugins that provide actions accessible to
42
+ * the declarative agent.
43
+ */
44
+ actions?: ActionElement[];
45
+ [property: string]: any;
46
+ }
47
+ /**
48
+ * Identifies an API plugin manifest for a plugin used as an action by the declarative agent.
49
+ */
50
+ export interface ActionElement {
51
+ /**
52
+ * Required. Not localizable. A unique identifier for the action. It MAY be represented by a
53
+ * GUID.
54
+ */
55
+ id: string;
56
+ /**
57
+ * Required. Not localizable. A path to the API plugin manifest for this action.
58
+ */
59
+ file: string;
60
+ [property: string]: any;
61
+ }
62
+ /**
63
+ * Represents a base capability object.
64
+ *
65
+ * Indicates that the declarative agent can search the web for grounding information.
66
+ *
67
+ * Indicates that the declarative agent can search a user's SharePoint and OneDrive for
68
+ * grounding information.
69
+ *
70
+ * Indicates that the declarative agent can search selected Microsoft Graph connectors for
71
+ * grounding information.
72
+ */
73
+ export interface CapabilityElement {
74
+ /**
75
+ * Required. Must be WebSearch, OneDriveAndSharePoint or GraphConnectors
76
+ *
77
+ * Required. Must be set to WebSearch.
78
+ *
79
+ * Required. Must be set to OneDriveAndSharePoint.
80
+ *
81
+ * Required. Must be set to GraphConnectors.
82
+ */
83
+ name: Name;
84
+ /**
85
+ * Optional. An array of objects that identify SharePoint or OneDrive sources using IDs.
86
+ */
87
+ items_by_sharepoint_ids?: ItemsBySharepointIDElement[];
88
+ /**
89
+ * Optional. An array of objects that identify SharePoint or OneDrive sources by URL.
90
+ */
91
+ items_by_url?: ItemsByURLElement[];
92
+ /**
93
+ * Optional. An array of objects that identify the Microsoft Graph connectors available to
94
+ * the declarative agent
95
+ */
96
+ connections?: ConnectionElement[];
97
+ [property: string]: any;
98
+ }
99
+ /**
100
+ * Identifies a Microsoft Graph connector.
101
+ */
102
+ export interface ConnectionElement {
103
+ /**
104
+ * Required. Not localizable The unique identifier of the Microsoft Graph connector.
105
+ */
106
+ connection_id: string;
107
+ [property: string]: any;
108
+ }
109
+ /**
110
+ * Contains one or more object identifiers that identify a SharePoint or OneDrive resource.
111
+ */
112
+ export interface ItemsBySharepointIDElement {
113
+ /**
114
+ * Optional. Not localizable. The GUID identifier of a SharePoint or OneDrive site.
115
+ */
116
+ site_id?: string;
117
+ /**
118
+ * Optional. Not localizable. The GUID identifier of a SharePoint or OneDrive web.
119
+ */
120
+ web_id?: string;
121
+ /**
122
+ * Optional. Not localizable. The GUID identifier of a SharePoint or OneDrive list.
123
+ */
124
+ list_id?: string;
125
+ /**
126
+ * Optional. Not localizable. The GUID identifier of a SharePoint or OneDrive item.
127
+ */
128
+ unique_id?: string;
129
+ }
130
+ /**
131
+ * Represents the URL of a SharePoint or OneDrive resource.
132
+ */
133
+ export interface ItemsByURLElement {
134
+ /**
135
+ * Optional. Not localizable. An absolute URL to a SharePoint or OneDrive resource.
136
+ */
137
+ url?: string;
138
+ }
139
+ /**
140
+ * Required. Must be WebSearch, OneDriveAndSharePoint or GraphConnectors
141
+ */
142
+ export type Name = "WebSearch" | "OneDriveAndSharePoint" | "GraphConnectors";
143
+ /**
144
+ * Contains hints that are displayed to the user to demonstrate how they can get started
145
+ * using the declarative agent.
146
+ */
147
+ export interface ConversationStarterElement {
148
+ /**
149
+ * Required. Localizable. A suggestion that the user can use to obtain the desired result
150
+ * from the DC. It MUST contain at least one nonwhitespace character.
151
+ */
152
+ text: string;
153
+ /**
154
+ * Optional. Localizable. A unique title for the conversation starter. It MUST contain at
155
+ * least one nonwhitespace character.
156
+ */
157
+ title?: string;
158
+ [property: string]: any;
159
+ }
160
+ export declare class Convert {
161
+ static toDeclarativeAgentManifestV1D0(json: string): DeclarativeAgentManifestV1D0;
162
+ static declarativeAgentManifestV1D0ToJson(value: DeclarativeAgentManifestV1D0): string;
163
+ }
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ // To parse this data:
3
+ //
4
+ // import { Convert, DeclarativeAgentManifestV1D0 } from "./file";
5
+ //
6
+ // const declarativeAgentManifestV1D0 = Convert.toDeclarativeAgentManifestV1D0(json);
7
+ //
8
+ // These functions will throw an error if the JSON doesn't
9
+ // match the expected interface, even if the JSON is valid.
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.Convert = void 0;
12
+ // Converts JSON strings to/from your types
13
+ // and asserts the results of JSON.parse at runtime
14
+ class Convert {
15
+ static toDeclarativeAgentManifestV1D0(json) {
16
+ return cast(JSON.parse(json), r("DeclarativeAgentManifestV1D0"));
17
+ }
18
+ static declarativeAgentManifestV1D0ToJson(value) {
19
+ return JSON.stringify(uncast(value, r("DeclarativeAgentManifestV1D0")), null, 4);
20
+ }
21
+ }
22
+ exports.Convert = Convert;
23
+ function invalidValue(typ, val, key, parent = '') {
24
+ const prettyTyp = prettyTypeName(typ);
25
+ const parentText = parent ? ` on ${parent}` : '';
26
+ const keyText = key ? ` for key "${key}"` : '';
27
+ throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
28
+ }
29
+ function prettyTypeName(typ) {
30
+ if (Array.isArray(typ)) {
31
+ if (typ.length === 2 && typ[0] === undefined) {
32
+ return `an optional ${prettyTypeName(typ[1])}`;
33
+ }
34
+ else {
35
+ return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
36
+ }
37
+ }
38
+ else if (typeof typ === "object" && typ.literal !== undefined) {
39
+ return typ.literal;
40
+ }
41
+ else {
42
+ return typeof typ;
43
+ }
44
+ }
45
+ function jsonToJSProps(typ) {
46
+ if (typ.jsonToJS === undefined) {
47
+ const map = {};
48
+ typ.props.forEach((p) => map[p.json] = { key: p.js, typ: p.typ });
49
+ typ.jsonToJS = map;
50
+ }
51
+ return typ.jsonToJS;
52
+ }
53
+ function jsToJSONProps(typ) {
54
+ if (typ.jsToJSON === undefined) {
55
+ const map = {};
56
+ typ.props.forEach((p) => map[p.js] = { key: p.json, typ: p.typ });
57
+ typ.jsToJSON = map;
58
+ }
59
+ return typ.jsToJSON;
60
+ }
61
+ function transform(val, typ, getProps, key = '', parent = '') {
62
+ function transformPrimitive(typ, val) {
63
+ if (typeof typ === typeof val)
64
+ return val;
65
+ return invalidValue(typ, val, key, parent);
66
+ }
67
+ function transformUnion(typs, val) {
68
+ // val must validate against one typ in typs
69
+ const l = typs.length;
70
+ for (let i = 0; i < l; i++) {
71
+ const typ = typs[i];
72
+ try {
73
+ return transform(val, typ, getProps);
74
+ }
75
+ catch (_) { }
76
+ }
77
+ return invalidValue(typs, val, key, parent);
78
+ }
79
+ function transformEnum(cases, val) {
80
+ if (cases.indexOf(val) !== -1)
81
+ return val;
82
+ return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
83
+ }
84
+ function transformArray(typ, val) {
85
+ // val must be an array with no invalid elements
86
+ if (!Array.isArray(val))
87
+ return invalidValue(l("array"), val, key, parent);
88
+ return val.map(el => transform(el, typ, getProps));
89
+ }
90
+ function transformDate(val) {
91
+ if (val === null) {
92
+ return null;
93
+ }
94
+ const d = new Date(val);
95
+ if (isNaN(d.valueOf())) {
96
+ return invalidValue(l("Date"), val, key, parent);
97
+ }
98
+ return d;
99
+ }
100
+ function transformObject(props, additional, val) {
101
+ if (val === null || typeof val !== "object" || Array.isArray(val)) {
102
+ return invalidValue(l(ref || "object"), val, key, parent);
103
+ }
104
+ const result = {};
105
+ Object.getOwnPropertyNames(props).forEach(key => {
106
+ const prop = props[key];
107
+ const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
108
+ result[prop.key] = transform(v, prop.typ, getProps, key, ref);
109
+ });
110
+ Object.getOwnPropertyNames(val).forEach(key => {
111
+ if (!Object.prototype.hasOwnProperty.call(props, key)) {
112
+ result[key] = transform(val[key], additional, getProps, key, ref);
113
+ }
114
+ });
115
+ return result;
116
+ }
117
+ if (typ === "any")
118
+ return val;
119
+ if (typ === null) {
120
+ if (val === null)
121
+ return val;
122
+ return invalidValue(typ, val, key, parent);
123
+ }
124
+ if (typ === false)
125
+ return invalidValue(typ, val, key, parent);
126
+ let ref = undefined;
127
+ while (typeof typ === "object" && typ.ref !== undefined) {
128
+ ref = typ.ref;
129
+ typ = typeMap[typ.ref];
130
+ }
131
+ if (Array.isArray(typ))
132
+ return transformEnum(typ, val);
133
+ if (typeof typ === "object") {
134
+ return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
135
+ : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
136
+ : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
137
+ : invalidValue(typ, val, key, parent);
138
+ }
139
+ // Numbers can be parsed by Date but shouldn't be.
140
+ if (typ === Date && typeof val !== "number")
141
+ return transformDate(val);
142
+ return transformPrimitive(typ, val);
143
+ }
144
+ function cast(val, typ) {
145
+ return transform(val, typ, jsonToJSProps);
146
+ }
147
+ function uncast(val, typ) {
148
+ return transform(val, typ, jsToJSONProps);
149
+ }
150
+ function l(typ) {
151
+ return { literal: typ };
152
+ }
153
+ function a(typ) {
154
+ return { arrayItems: typ };
155
+ }
156
+ function u(...typs) {
157
+ return { unionMembers: typs };
158
+ }
159
+ function o(props, additional) {
160
+ return { props, additional };
161
+ }
162
+ function m(additional) {
163
+ return { props: [], additional };
164
+ }
165
+ function r(name) {
166
+ return { ref: name };
167
+ }
168
+ const typeMap = {
169
+ "DeclarativeAgentManifestV1D0": o([
170
+ { json: "version", js: "version", typ: r("Version") },
171
+ { json: "id", js: "id", typ: u(undefined, "") },
172
+ { json: "name", js: "name", typ: "" },
173
+ { json: "description", js: "description", typ: "" },
174
+ { json: "instructions", js: "instructions", typ: u(undefined, "") },
175
+ { json: "capabilities", js: "capabilities", typ: u(undefined, a(r("CapabilityElement"))) },
176
+ { json: "conversation_starters", js: "conversation_starters", typ: u(undefined, a(r("ConversationStarterElement"))) },
177
+ { json: "actions", js: "actions", typ: u(undefined, a(r("ActionElement"))) },
178
+ ], "any"),
179
+ "ActionElement": o([
180
+ { json: "id", js: "id", typ: "" },
181
+ { json: "file", js: "file", typ: "" },
182
+ ], "any"),
183
+ "CapabilityElement": o([
184
+ { json: "name", js: "name", typ: r("Name") },
185
+ { json: "items_by_sharepoint_ids", js: "items_by_sharepoint_ids", typ: u(undefined, a(r("ItemsBySharepointIDElement"))) },
186
+ { json: "items_by_url", js: "items_by_url", typ: u(undefined, a(r("ItemsByURLElement"))) },
187
+ { json: "connections", js: "connections", typ: u(undefined, a(r("ConnectionElement"))) },
188
+ ], "any"),
189
+ "ConnectionElement": o([
190
+ { json: "connection_id", js: "connection_id", typ: "" },
191
+ ], "any"),
192
+ "ItemsBySharepointIDElement": o([
193
+ { json: "site_id", js: "site_id", typ: u(undefined, "") },
194
+ { json: "web_id", js: "web_id", typ: u(undefined, "") },
195
+ { json: "list_id", js: "list_id", typ: u(undefined, "") },
196
+ { json: "unique_id", js: "unique_id", typ: u(undefined, "") },
197
+ ], false),
198
+ "ItemsByURLElement": o([
199
+ { json: "url", js: "url", typ: u(undefined, "") },
200
+ ], false),
201
+ "ConversationStarterElement": o([
202
+ { json: "text", js: "text", typ: "" },
203
+ { json: "title", js: "title", typ: u(undefined, "") },
204
+ ], "any"),
205
+ "Name": [
206
+ "GraphConnectors",
207
+ "OneDriveAndSharePoint",
208
+ "WebSearch",
209
+ ],
210
+ "Version": [
211
+ "v1.0",
212
+ ],
213
+ };
214
+ //# sourceMappingURL=DeclarativeAgentManifestV1D0.js.map