@microsoft/app-manifest 1.0.4-alpha.3344620f2.0 → 1.0.4-alpha.37866e130.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 (36) hide show
  1. package/build/ManifestCommonProperties.d.ts +4 -0
  2. package/build/declarativeCopilotManifest.d.ts +43 -0
  3. package/build/declarativeCopilotManifest.js +3 -0
  4. package/build/declarativeCopilotManifest.js.map +1 -1
  5. package/build/generated-types/index.js +10 -3
  6. package/build/generated-types/index.js.map +1 -1
  7. package/build/generated-types/teams/TeamsManifestV1D23.js +518 -393
  8. package/build/generated-types/teams/TeamsManifestV1D23.js.map +1 -1
  9. package/build/generated-types/teams/TeamsManifestV1D24.js +545 -414
  10. package/build/generated-types/teams/TeamsManifestV1D24.js.map +1 -1
  11. package/build/index.d.ts +1 -0
  12. package/build/index.js +1 -0
  13. package/build/index.js.map +1 -1
  14. package/build/manifest.d.ts +78 -2
  15. package/build/manifest.js +2 -2
  16. package/build/manifest.js.map +1 -1
  17. package/build/pluginManifest.d.ts +56 -0
  18. package/build/pluginManifest.js +2 -0
  19. package/build/pluginManifest.js.map +1 -1
  20. package/build/tsconfig.tsbuildinfo +1 -1
  21. package/build/wrappers/APIPluginManifestWrapper.d.ts +185 -0
  22. package/build/wrappers/APIPluginManifestWrapper.js +309 -0
  23. package/build/wrappers/APIPluginManifestWrapper.js.map +1 -0
  24. package/build/wrappers/BaseManifest.d.ts +57 -0
  25. package/build/wrappers/BaseManifest.js +84 -0
  26. package/build/wrappers/BaseManifest.js.map +1 -0
  27. package/build/wrappers/DeclarativeAgentManifestWrapper.d.ts +245 -0
  28. package/build/wrappers/DeclarativeAgentManifestWrapper.js +403 -0
  29. package/build/wrappers/DeclarativeAgentManifestWrapper.js.map +1 -0
  30. package/build/wrappers/TeamsManifestWrapper.d.ts +436 -0
  31. package/build/wrappers/TeamsManifestWrapper.js +709 -0
  32. package/build/wrappers/TeamsManifestWrapper.js.map +1 -0
  33. package/build/wrappers/index.d.ts +15 -0
  34. package/build/wrappers/index.js +28 -0
  35. package/build/wrappers/index.js.map +1 -0
  36. package/package.json +5 -3
@@ -0,0 +1,245 @@
1
+ import { DeclarativeAgentManifest, DeclarativeAgentManifestLatest } from "../generated-types";
2
+ import { BaseManifest } from "./BaseManifest";
3
+ type LatestManifestType = DeclarativeAgentManifestLatest;
4
+ type ActionElementType = NonNullable<LatestManifestType["actions"]>[number];
5
+ type CapabilityElementType = NonNullable<LatestManifestType["capabilities"]>[number];
6
+ type ConversationStarterElementType = NonNullable<LatestManifestType["conversation_starters"]>[number];
7
+ type WorkerAgentElementType = NonNullable<LatestManifestType["worker_agents"]>[number];
8
+ export type ActionElement = ActionElementType;
9
+ export type ConversationStarterElement = ConversationStarterElementType;
10
+ export type WorkerAgentElement = WorkerAgentElementType;
11
+ export type SensitivityLabel = LatestManifestType["sensitivity_label"];
12
+ export type BehaviorOverrides = LatestManifestType["behavior_overrides"];
13
+ /**
14
+ * Capability name type derived from the latest manifest schema.
15
+ * This type is auto-generated from the JSON schema and represents all valid capability names.
16
+ */
17
+ export type CapabilityNameValue = CapabilityElementType["name"];
18
+ /**
19
+ * Capability names supported by Declarative Agents.
20
+ * These values match the auto-generated Name type from the schema.
21
+ * @see CapabilityNameValue for the type definition
22
+ */
23
+ export declare const CapabilityName: {
24
+ readonly [K in CapabilityNameValue]: K;
25
+ };
26
+ /**
27
+ * OOP wrapper for Declarative Agent Manifest.
28
+ *
29
+ * Provides a fluent API for manipulating declarative agent manifests with
30
+ * type safety, state tracking, and convenient operations.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * // Read existing manifest
35
+ * const agent = await DeclarativeAgentManifestWrapper.read("agent.json");
36
+ *
37
+ * // Modify with fluent API
38
+ * agent
39
+ * .setInstructions("You are a helpful assistant...")
40
+ * .addAction("action1", "plugin.json")
41
+ * .addWebSearchCapability([{ url: "https://docs.microsoft.com" }])
42
+ * .addConversationStarter("How can I help you today?");
43
+ *
44
+ * // Save changes
45
+ * await agent.save();
46
+ * ```
47
+ */
48
+ export declare class DeclarativeAgentManifestWrapper extends BaseManifest<DeclarativeAgentManifest> {
49
+ private constructor();
50
+ /**
51
+ * Reads a declarative agent manifest from a file.
52
+ * @param filePath - Path to the manifest JSON file.
53
+ * @returns A new DeclarativeAgentManifestWrapper instance.
54
+ */
55
+ static read(filePath: string): Promise<DeclarativeAgentManifestWrapper>;
56
+ /**
57
+ * Reads a declarative agent manifest from a file synchronously.
58
+ * @param filePath - Path to the manifest JSON file.
59
+ * @returns A new DeclarativeAgentManifestWrapper instance.
60
+ */
61
+ static readSync(filePath: string): DeclarativeAgentManifestWrapper;
62
+ /**
63
+ * Creates a DeclarativeAgentManifestWrapper from a JSON string.
64
+ * @param json - JSON string representing the manifest.
65
+ * @returns A new DeclarativeAgentManifestWrapper instance.
66
+ */
67
+ static fromJSON(json: string): DeclarativeAgentManifestWrapper;
68
+ /**
69
+ * Creates a new declarative agent manifest with required fields.
70
+ * @param init - Initial manifest data with required fields.
71
+ * @returns A new DeclarativeAgentManifestWrapper instance.
72
+ */
73
+ static create(init: {
74
+ version: DeclarativeAgentManifest["version"];
75
+ name: string;
76
+ description: string;
77
+ instructions?: string;
78
+ }): DeclarativeAgentManifestWrapper;
79
+ /**
80
+ * Returns the version of the manifest.
81
+ */
82
+ get version(): string;
83
+ /**
84
+ * Returns the name of the agent.
85
+ */
86
+ get name(): string;
87
+ /**
88
+ * Returns the description of the agent.
89
+ */
90
+ get description(): string;
91
+ /**
92
+ * Returns the instructions for the agent.
93
+ */
94
+ get instructions(): string | undefined;
95
+ /**
96
+ * Returns a readonly array of actions.
97
+ */
98
+ get actions(): readonly ActionElementType[];
99
+ /**
100
+ * Returns a readonly array of capabilities.
101
+ */
102
+ get capabilities(): readonly CapabilityElementType[];
103
+ /**
104
+ * Returns a readonly array of conversation starters.
105
+ */
106
+ get conversationStarters(): readonly ConversationStarterElementType[];
107
+ /**
108
+ * Returns a readonly array of worker agents.
109
+ */
110
+ get workerAgents(): readonly WorkerAgentElementType[];
111
+ /**
112
+ * Sets the name of the agent.
113
+ */
114
+ setName(name: string): this;
115
+ /**
116
+ * Sets the description of the agent.
117
+ */
118
+ setDescription(description: string): this;
119
+ /**
120
+ * Sets the instructions for the agent.
121
+ */
122
+ setInstructions(instructions: string): this;
123
+ /**
124
+ * Adds an action (API plugin) to the agent.
125
+ * @param id - Unique identifier for the action.
126
+ * @param file - Relative path to the plugin manifest file.
127
+ */
128
+ addAction(id: string, file: string): this;
129
+ /**
130
+ * Removes an action by ID.
131
+ * @param id - The ID of the action to remove.
132
+ */
133
+ removeAction(id: string): this;
134
+ /**
135
+ * Checks if an action exists by ID.
136
+ */
137
+ hasAction(id: string): boolean;
138
+ /**
139
+ * Gets an action by ID.
140
+ */
141
+ getAction(id: string): ActionElementType | undefined;
142
+ /**
143
+ * Returns all action plugin file paths.
144
+ */
145
+ getActionPluginPaths(): string[];
146
+ /**
147
+ * Adds or updates a capability.
148
+ * If a capability with the same name exists, it will be replaced.
149
+ * @param capability - The capability to add or update.
150
+ */
151
+ addCapability(capability: CapabilityElementType): this;
152
+ /**
153
+ * Removes a capability by name.
154
+ * @param name - The name of the capability to remove.
155
+ */
156
+ removeCapability(name: CapabilityNameValue | string): this;
157
+ /**
158
+ * Checks if a capability exists by name.
159
+ */
160
+ hasCapability(name: CapabilityNameValue | string): boolean;
161
+ /**
162
+ * Gets a capability by name.
163
+ */
164
+ getCapability<T extends CapabilityElementType = CapabilityElementType>(name: CapabilityNameValue | string): T | undefined;
165
+ /**
166
+ * Adds or updates the WebSearch capability.
167
+ * @param sites - Optional array of site URLs to constrain search.
168
+ */
169
+ addWebSearchCapability(sites?: Array<{
170
+ url: string;
171
+ }>): this;
172
+ /**
173
+ * Adds or updates the OneDriveAndSharePoint capability.
174
+ * @param options - Configuration for SharePoint/OneDrive sources.
175
+ */
176
+ addOneDriveSharePointCapability(options?: {
177
+ items_by_url?: Array<{
178
+ url: string;
179
+ }>;
180
+ items_by_sharepoint_ids?: Array<{
181
+ site_id?: string;
182
+ web_id?: string;
183
+ list_id?: string;
184
+ unique_id?: string;
185
+ }>;
186
+ }): this;
187
+ /**
188
+ * Adds or updates the GraphConnectors capability.
189
+ * @param connectionIds - Array of Graph connector connection IDs.
190
+ */
191
+ addGraphConnectorsCapability(connectionIds: string[]): this;
192
+ /**
193
+ * Adds or updates the EmbeddedKnowledge capability.
194
+ * @param files - Array of embedded knowledge files.
195
+ */
196
+ addEmbeddedKnowledgeCapability(files: Array<{
197
+ file: string;
198
+ }>): this;
199
+ /**
200
+ * Adds or updates the CodeInterpreter capability.
201
+ */
202
+ addCodeInterpreterCapability(): this;
203
+ /**
204
+ * Adds or updates the GraphicArt capability.
205
+ */
206
+ addGraphicArtCapability(): this;
207
+ /**
208
+ * Adds a conversation starter.
209
+ * Maximum 12 starters are allowed.
210
+ * @param text - The text of the conversation starter.
211
+ * @param title - Optional title for the starter.
212
+ */
213
+ addConversationStarter(text: string, title?: string): this;
214
+ /**
215
+ * Removes a conversation starter by text.
216
+ */
217
+ removeConversationStarter(text: string): this;
218
+ /**
219
+ * Clears all conversation starters.
220
+ */
221
+ clearConversationStarters(): this;
222
+ /**
223
+ * Adds a worker agent.
224
+ * @param id - The ID of the worker agent.
225
+ */
226
+ addWorkerAgent(id: string): this;
227
+ /**
228
+ * Removes a worker agent by ID.
229
+ */
230
+ removeWorkerAgent(id: string): this;
231
+ /**
232
+ * Validates the manifest against its JSON schema.
233
+ * @returns Array of validation error messages, empty if valid.
234
+ */
235
+ validate(): Promise<string[]>;
236
+ /**
237
+ * Converts the manifest to a formatted JSON string.
238
+ */
239
+ toJSON(): string;
240
+ /**
241
+ * Creates a deep clone of this manifest.
242
+ */
243
+ clone(): DeclarativeAgentManifestWrapper;
244
+ }
245
+ export {};
@@ -0,0 +1,403 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT license.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DeclarativeAgentManifestWrapper = exports.CapabilityName = void 0;
6
+ const generated_types_1 = require("../generated-types");
7
+ const BaseManifest_1 = require("./BaseManifest");
8
+ /**
9
+ * Capability names supported by Declarative Agents.
10
+ * These values match the auto-generated Name type from the schema.
11
+ * @see CapabilityNameValue for the type definition
12
+ */
13
+ exports.CapabilityName = {
14
+ WebSearch: "WebSearch",
15
+ GraphicArt: "GraphicArt",
16
+ CodeInterpreter: "CodeInterpreter",
17
+ OneDriveAndSharePoint: "OneDriveAndSharePoint",
18
+ GraphConnectors: "GraphConnectors",
19
+ EmbeddedKnowledge: "EmbeddedKnowledge",
20
+ TeamsMessages: "TeamsMessages",
21
+ Dataverse: "Dataverse",
22
+ Email: "Email",
23
+ People: "People",
24
+ Meetings: "Meetings",
25
+ ScenarioModels: "ScenarioModels",
26
+ };
27
+ /**
28
+ * OOP wrapper for Declarative Agent Manifest.
29
+ *
30
+ * Provides a fluent API for manipulating declarative agent manifests with
31
+ * type safety, state tracking, and convenient operations.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * // Read existing manifest
36
+ * const agent = await DeclarativeAgentManifestWrapper.read("agent.json");
37
+ *
38
+ * // Modify with fluent API
39
+ * agent
40
+ * .setInstructions("You are a helpful assistant...")
41
+ * .addAction("action1", "plugin.json")
42
+ * .addWebSearchCapability([{ url: "https://docs.microsoft.com" }])
43
+ * .addConversationStarter("How can I help you today?");
44
+ *
45
+ * // Save changes
46
+ * await agent.save();
47
+ * ```
48
+ */
49
+ class DeclarativeAgentManifestWrapper extends BaseManifest_1.BaseManifest {
50
+ constructor(data, filePath) {
51
+ super(data, filePath);
52
+ }
53
+ // ============= Static Factory Methods =============
54
+ /**
55
+ * Reads a declarative agent manifest from a file.
56
+ * @param filePath - Path to the manifest JSON file.
57
+ * @returns A new DeclarativeAgentManifestWrapper instance.
58
+ */
59
+ static async read(filePath) {
60
+ const data = await generated_types_1.AppManifestUtils.readDeclarativeAgentManifest(filePath);
61
+ return new DeclarativeAgentManifestWrapper(data, filePath);
62
+ }
63
+ /**
64
+ * Reads a declarative agent manifest from a file synchronously.
65
+ * @param filePath - Path to the manifest JSON file.
66
+ * @returns A new DeclarativeAgentManifestWrapper instance.
67
+ */
68
+ static readSync(filePath) {
69
+ const json = BaseManifest_1.BaseManifest.readJsonFileSync(filePath);
70
+ const data = generated_types_1.DeclarativeAgentManifestConverter.jsonToManifest(JSON.stringify(json));
71
+ return new DeclarativeAgentManifestWrapper(data, filePath);
72
+ }
73
+ /**
74
+ * Creates a DeclarativeAgentManifestWrapper from a JSON string.
75
+ * @param json - JSON string representing the manifest.
76
+ * @returns A new DeclarativeAgentManifestWrapper instance.
77
+ */
78
+ static fromJSON(json) {
79
+ const data = generated_types_1.DeclarativeAgentManifestConverter.jsonToManifest(json);
80
+ return new DeclarativeAgentManifestWrapper(data);
81
+ }
82
+ /**
83
+ * Creates a new declarative agent manifest with required fields.
84
+ * @param init - Initial manifest data with required fields.
85
+ * @returns A new DeclarativeAgentManifestWrapper instance.
86
+ */
87
+ static create(init) {
88
+ const data = Object.assign({ $schema: `https://developer.microsoft.com/json-schemas/copilot/declarative-agent/${init.version}/schema.json` }, init);
89
+ return new DeclarativeAgentManifestWrapper(data);
90
+ }
91
+ // ============= Getters =============
92
+ /**
93
+ * Returns the version of the manifest.
94
+ */
95
+ get version() {
96
+ return this._data.version;
97
+ }
98
+ /**
99
+ * Returns the name of the agent.
100
+ */
101
+ get name() {
102
+ return this._data.name;
103
+ }
104
+ /**
105
+ * Returns the description of the agent.
106
+ */
107
+ get description() {
108
+ return this._data.description;
109
+ }
110
+ /**
111
+ * Returns the instructions for the agent.
112
+ */
113
+ get instructions() {
114
+ return this._data.instructions;
115
+ }
116
+ /**
117
+ * Returns a readonly array of actions.
118
+ */
119
+ get actions() {
120
+ var _a;
121
+ return (_a = this._data.actions) !== null && _a !== void 0 ? _a : [];
122
+ }
123
+ /**
124
+ * Returns a readonly array of capabilities.
125
+ */
126
+ get capabilities() {
127
+ var _a;
128
+ return (_a = this._data.capabilities) !== null && _a !== void 0 ? _a : [];
129
+ }
130
+ /**
131
+ * Returns a readonly array of conversation starters.
132
+ */
133
+ get conversationStarters() {
134
+ var _a;
135
+ return (_a = this._data.conversation_starters) !== null && _a !== void 0 ? _a : [];
136
+ }
137
+ /**
138
+ * Returns a readonly array of worker agents.
139
+ */
140
+ get workerAgents() {
141
+ var _a;
142
+ return (_a = this._data.worker_agents) !== null && _a !== void 0 ? _a : [];
143
+ }
144
+ // ============= Setters (Fluent API) =============
145
+ /**
146
+ * Sets the name of the agent.
147
+ */
148
+ setName(name) {
149
+ this._data.name = name;
150
+ this.markDirty();
151
+ return this;
152
+ }
153
+ /**
154
+ * Sets the description of the agent.
155
+ */
156
+ setDescription(description) {
157
+ this._data.description = description;
158
+ this.markDirty();
159
+ return this;
160
+ }
161
+ /**
162
+ * Sets the instructions for the agent.
163
+ */
164
+ setInstructions(instructions) {
165
+ this._data.instructions = instructions;
166
+ this.markDirty();
167
+ return this;
168
+ }
169
+ // ============= Action Operations =============
170
+ /**
171
+ * Adds an action (API plugin) to the agent.
172
+ * @param id - Unique identifier for the action.
173
+ * @param file - Relative path to the plugin manifest file.
174
+ */
175
+ addAction(id, file) {
176
+ if (!this._data.actions) {
177
+ this._data.actions = [];
178
+ }
179
+ this._data.actions.push({ id, file });
180
+ this.markDirty();
181
+ return this;
182
+ }
183
+ /**
184
+ * Removes an action by ID.
185
+ * @param id - The ID of the action to remove.
186
+ */
187
+ removeAction(id) {
188
+ if (this._data.actions) {
189
+ this._data.actions = this._data.actions.filter((a) => a.id !== id);
190
+ this.markDirty();
191
+ }
192
+ return this;
193
+ }
194
+ /**
195
+ * Checks if an action exists by ID.
196
+ */
197
+ hasAction(id) {
198
+ return this.actions.some((a) => a.id === id);
199
+ }
200
+ /**
201
+ * Gets an action by ID.
202
+ */
203
+ getAction(id) {
204
+ return this.actions.find((a) => a.id === id);
205
+ }
206
+ /**
207
+ * Returns all action plugin file paths.
208
+ */
209
+ getActionPluginPaths() {
210
+ return this.actions.map((a) => a.file);
211
+ }
212
+ // ============= Capability Operations =============
213
+ /**
214
+ * Adds or updates a capability.
215
+ * If a capability with the same name exists, it will be replaced.
216
+ * @param capability - The capability to add or update.
217
+ */
218
+ addCapability(capability) {
219
+ if (!this._data.capabilities) {
220
+ this._data.capabilities = [];
221
+ }
222
+ const capabilities = this._data.capabilities;
223
+ const existingIndex = capabilities.findIndex((c) => c.name === capability.name);
224
+ if (existingIndex >= 0) {
225
+ capabilities[existingIndex] = capability;
226
+ }
227
+ else {
228
+ capabilities.push(capability);
229
+ }
230
+ this.markDirty();
231
+ return this;
232
+ }
233
+ /**
234
+ * Removes a capability by name.
235
+ * @param name - The name of the capability to remove.
236
+ */
237
+ removeCapability(name) {
238
+ if (this._data.capabilities) {
239
+ this._data.capabilities = this._data.capabilities.filter((c) => c.name !== name);
240
+ this.markDirty();
241
+ }
242
+ return this;
243
+ }
244
+ /**
245
+ * Checks if a capability exists by name.
246
+ */
247
+ hasCapability(name) {
248
+ return this.capabilities.some((c) => c.name === name);
249
+ }
250
+ /**
251
+ * Gets a capability by name.
252
+ */
253
+ getCapability(name) {
254
+ return this.capabilities.find((c) => c.name === name);
255
+ }
256
+ // ============= Convenience Capability Methods =============
257
+ /**
258
+ * Adds or updates the WebSearch capability.
259
+ * @param sites - Optional array of site URLs to constrain search.
260
+ */
261
+ addWebSearchCapability(sites) {
262
+ return this.addCapability({
263
+ name: exports.CapabilityName.WebSearch,
264
+ sites,
265
+ });
266
+ }
267
+ /**
268
+ * Adds or updates the OneDriveAndSharePoint capability.
269
+ * @param options - Configuration for SharePoint/OneDrive sources.
270
+ */
271
+ addOneDriveSharePointCapability(options) {
272
+ return this.addCapability(Object.assign({ name: exports.CapabilityName.OneDriveAndSharePoint }, options));
273
+ }
274
+ /**
275
+ * Adds or updates the GraphConnectors capability.
276
+ * @param connectionIds - Array of Graph connector connection IDs.
277
+ */
278
+ addGraphConnectorsCapability(connectionIds) {
279
+ const connections = connectionIds.map((id) => ({ connection_id: id }));
280
+ return this.addCapability({
281
+ name: exports.CapabilityName.GraphConnectors,
282
+ connections,
283
+ });
284
+ }
285
+ /**
286
+ * Adds or updates the EmbeddedKnowledge capability.
287
+ * @param files - Array of embedded knowledge files.
288
+ */
289
+ addEmbeddedKnowledgeCapability(files) {
290
+ return this.addCapability({
291
+ name: exports.CapabilityName.EmbeddedKnowledge,
292
+ files,
293
+ });
294
+ }
295
+ /**
296
+ * Adds or updates the CodeInterpreter capability.
297
+ */
298
+ addCodeInterpreterCapability() {
299
+ return this.addCapability({
300
+ name: exports.CapabilityName.CodeInterpreter,
301
+ });
302
+ }
303
+ /**
304
+ * Adds or updates the GraphicArt capability.
305
+ */
306
+ addGraphicArtCapability() {
307
+ return this.addCapability({
308
+ name: exports.CapabilityName.GraphicArt,
309
+ });
310
+ }
311
+ // ============= Conversation Starter Operations =============
312
+ /**
313
+ * Adds a conversation starter.
314
+ * Maximum 12 starters are allowed.
315
+ * @param text - The text of the conversation starter.
316
+ * @param title - Optional title for the starter.
317
+ */
318
+ addConversationStarter(text, title) {
319
+ if (!this._data.conversation_starters) {
320
+ this._data.conversation_starters = [];
321
+ }
322
+ const starters = this._data.conversation_starters;
323
+ if (starters.length >= 12) {
324
+ console.warn("Maximum 12 conversation starters allowed. Ignoring addition.");
325
+ return this;
326
+ }
327
+ // Avoid duplicates
328
+ if (!starters.some((s) => s.text === text)) {
329
+ starters.push({ text, title });
330
+ this.markDirty();
331
+ }
332
+ return this;
333
+ }
334
+ /**
335
+ * Removes a conversation starter by text.
336
+ */
337
+ removeConversationStarter(text) {
338
+ if (this._data.conversation_starters) {
339
+ this._data.conversation_starters = this._data.conversation_starters.filter((s) => s.text !== text);
340
+ this.markDirty();
341
+ }
342
+ return this;
343
+ }
344
+ /**
345
+ * Clears all conversation starters.
346
+ */
347
+ clearConversationStarters() {
348
+ this._data.conversation_starters = [];
349
+ this.markDirty();
350
+ return this;
351
+ }
352
+ // ============= Worker Agent Operations =============
353
+ /**
354
+ * Adds a worker agent.
355
+ * @param id - The ID of the worker agent.
356
+ */
357
+ addWorkerAgent(id) {
358
+ const data = this._data;
359
+ if (!data.worker_agents) {
360
+ data.worker_agents = [];
361
+ }
362
+ if (!data.worker_agents.some((w) => w.id === id)) {
363
+ data.worker_agents.push({ id });
364
+ this.markDirty();
365
+ }
366
+ return this;
367
+ }
368
+ /**
369
+ * Removes a worker agent by ID.
370
+ */
371
+ removeWorkerAgent(id) {
372
+ const data = this._data;
373
+ if (data.worker_agents) {
374
+ data.worker_agents = data.worker_agents.filter((w) => w.id !== id);
375
+ this.markDirty();
376
+ }
377
+ return this;
378
+ }
379
+ // ============= Validation =============
380
+ /**
381
+ * Validates the manifest against its JSON schema.
382
+ * @returns Array of validation error messages, empty if valid.
383
+ */
384
+ async validate() {
385
+ return generated_types_1.AppManifestUtils.validateAgainstSchema(this._data);
386
+ }
387
+ // ============= Serialization =============
388
+ /**
389
+ * Converts the manifest to a formatted JSON string.
390
+ */
391
+ toJSON() {
392
+ return generated_types_1.DeclarativeAgentManifestConverter.manifestToJson(this._data);
393
+ }
394
+ /**
395
+ * Creates a deep clone of this manifest.
396
+ */
397
+ clone() {
398
+ const clonedData = JSON.parse(this.toJSON());
399
+ return new DeclarativeAgentManifestWrapper(clonedData);
400
+ }
401
+ }
402
+ exports.DeclarativeAgentManifestWrapper = DeclarativeAgentManifestWrapper;
403
+ //# sourceMappingURL=DeclarativeAgentManifestWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclarativeAgentManifestWrapper.js","sourceRoot":"","sources":["../../src/wrappers/DeclarativeAgentManifestWrapper.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAK4B;AAC5B,iDAA8C;AAyB9C;;;;GAIG;AACU,QAAA,cAAc,GAA+C;IACxE,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAClC,qBAAqB,EAAE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