@acorex-platform/extension-ai-platform-management-client 0.0.46

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.
@@ -0,0 +1,329 @@
1
+ //#region ----- Reuse platform definition -----
2
+ const AXE_APP_BUILDER_SKILL_REUSE_ID = 'e0000001-0000-4000-8000-000000000020';
3
+ const AXE_APP_BUILDER_SKILL_REUSE_NAME = 'reuse-platform-definition';
4
+ const AXE_APP_BUILDER_SKILL_REUSE_MARKDOWN = [
5
+ '## Reuse platform definition',
6
+ '',
7
+ 'Follow this playbook **before** any insert, when the user wants a new module, entity, or relationship (Persian: ماژول بساز، موجودیت، ارتباط با کاربر).',
8
+ '',
9
+ '### Hard rules',
10
+ '- Your **first** action is a **tool call**. Do not invent `Module.Entity` keys or a new Owner/User entity.',
11
+ '- This assist **has** `PlatformManagement:ListRegisteredEntities` and `Entity:Query:Default`. It does **not** write TypeScript, menus, or i18n JSON files.',
12
+ '- A **module** is a row of `PlatformManagement.ModuleDefinition`. An **entity** is a row of `PlatformManagement.EntityDefinition` whose stored `name` is `Module.Entity`.',
13
+ '- A relationship to something that already exists is a **lookup property**, not a new entity.',
14
+ '- Identifiers (`name`) are PascalCase English (`RentManagement`, `Vehicle`). Titles are human text in the user language. `name` must match `^[A-Za-z][A-Za-z0-9]*$` — no spaces, hyphens, or Persian.',
15
+ '',
16
+ '### Worked prompt',
17
+ 'User: «می‌خواهم یک ماژول rent ماشین داشته باشم».',
18
+ '',
19
+ 'Decide:',
20
+ '- Module `name`: `RentManagement` (not `rent`, not `CarRental`). `i18n`: `rent-management`. `type`: `domain`. `domain`: `operations`.',
21
+ '- New entities: `Vehicle` (the car) and `Rental` (the agreement).',
22
+ '- **Do not** create `Owner`, `User`, or `Car`. The owner is `ownerId` on `Rental`, a lookup to the existing user entity.',
23
+ '- Find that user entity with `ListRegisteredEntities` `search`: `user`. Expect `SecurityManagement.User`. Read `properties` and use a real title field (`displayName`, `title`, or `name`) as `textField`. If `matchStatus` is `none`, stop and say the user entity is missing. Do not invent the key.',
24
+ '- `Rental.vehicleId` looks up `RentManagement.Vehicle` **after** Vehicle is stored.',
25
+ '- After both entities exist, Vehicle can list its rentals (`relatedEntities` → `RentManagement.Rental`, `foreignKeyField`: `vehicleId`). That is an update, not a third entity.',
26
+ '',
27
+ '### Steps',
28
+ '1. **Modules.** `Entity:Query:Default` with `entity`: `PlatformManagement.ModuleDefinition` and `quickSearch` set to the intended module name. If `items[].name` already equals that name, reuse it. Do not insert a second module.',
29
+ '2. **Entities.** `ListRegisteredEntities` with `search` for each noun (vehicle, rental, user, and any name the user used). `matchStatus` `single` or a clear `fullName` means reuse. `multiple` means pick or ask. `none` means it can be created.',
30
+ '3. **Schema of a lookup target.** Call `ListRegisteredEntities` with `entityFullName` before choosing `textField` or `expose`.',
31
+ '4. **Hand off.** Tell the next skills the module name, the entity list, and which fields are lookups. Do not insert in this skill.',
32
+ ].join('\n');
33
+ //#endregion
34
+
35
+ //#region ----- Compose AXPEntity -----
36
+ const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_ID = 'e0000001-0000-4000-8000-000000000023';
37
+ const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME = 'compose-axp-entity';
38
+ const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_MARKDOWN = [
39
+ '## Compose AXPEntity',
40
+ '',
41
+ 'Follow this playbook whenever you build an entity. You do **not** have the platform source. The object you put in `content` **is** `AXPEntity`. **write-entity-definition** only stores that object. Do not invent a second schema.',
42
+ '',
43
+ '### Stored shape',
44
+ '`content` keys:',
45
+ '- `module`, `name` (short PascalCase), `title`, `icon`',
46
+ '- `searchTags`: string keywords in any language. Not i18n keys.',
47
+ '- `formats`: `{ individual, plural, displayName?, searchResult: { title, description } }`. `searchResult.title` is usually `{{ title }}`.',
48
+ '- `groups`: `{ id, title, description?, icon? }[]`',
49
+ '- `properties`: see below. Always include hidden `id`.',
50
+ '- `columns`: list columns `{ name, title?, showAs?: { type }, options?: { width, order } }`',
51
+ '- `interfaces.master`: `list`, `create`, `update`, `single`',
52
+ '- `relatedEntities?`, `plugins?`, `category?`, `pages?`, `rules?`, `validations?`, `commands?`, `queries?`, `parentKey?`',
53
+ '',
54
+ 'Do **not** emit `AXPEntityV2`, aggregates, or TypeScript helpers (`entityMasterCrudActions`, `createAllQueryView`). Write the JSON those helpers would have produced.',
55
+ '',
56
+ '### Property',
57
+ 'Each property:',
58
+ '`{ name, title, description?, groupId, schema: { dataType, nullable?, readonly?, visible?, defaultValue?, unique?: { enabled }, interface?: { type, options?, children?, mode? } }, options?: { sort: { enabled }, filter: { inline: { enabled }, advance: { enabled } } }, validations? }`',
59
+ '',
60
+ '`validations` entries: `{ rule: "required" }`, `{ rule: "minLength", options: { minLength } }`, `{ rule: "maxLength", options: { maxLength } }`, `{ rule: "regex", options: { value } }`, `{ rule: "equal", options: { value } }`.',
61
+ '',
62
+ 'Hidden primary key on every entity:',
63
+ '`{ "name": "id", "title": "Id", "groupId": "basic-info", "schema": { "dataType": "uuid", "visible": false, "readonly": true, "unique": { "enabled": true } } }`',
64
+ '',
65
+ '### Widget `interface.type` and `dataType`',
66
+ 'Use only these registry names for fields:',
67
+ '- short text → `text-editor` / `string`',
68
+ '- notes → `large-text-editor` / `string`',
69
+ '- rich text → `rich-text-editor` / `string`',
70
+ '- money, count, measurement → `number-editor` / `number`',
71
+ '- number plus unit → `number-unit-editor` / `number`',
72
+ '- date or time → `date-time-editor` / `date`',
73
+ '- yes/no → `toggle-editor` or `checkbox-editor` / `boolean`',
74
+ '- closed list → `select-editor` / `string`. `options.dataSource` is `[{ value, text }]`, plus `valueField` and `textField`.',
75
+ '- multi closed list → `selection-list-editor` / `string`',
76
+ '- relation to another entity → `lookup-editor` / `string`',
77
+ '- phone/email composite → `contact-editor` / `string`',
78
+ '- secret → `password-editor` / `string`',
79
+ '- files → `attachments`',
80
+ '- map → `map`',
81
+ '- signature → `signature`',
82
+ '- rating → `rate-picker-editor`',
83
+ '',
84
+ 'Never use `text-editor` for a date, a number, or a relation. Never invent a widget name.',
85
+ '',
86
+ '### Lookup',
87
+ '`schema.interface` may also hold `triggers` (`[{ "event", "action", "disabled"? }]`) and `valueTransforms`. Put them on the interface inside `content`. Omit both unless the user asked. Do not send them as designer rows.',
88
+ '',
89
+ '`schema.interface`:',
90
+ '`{ "type": "lookup-editor", "options": { "entity": "Module.Entity", "multiple": false, "valueField": "id", "textField": "<property that ListRegisteredEntities returned>", "look": "select", "columns": ["<textField>"], "expose": [{ "source": "id", "target": "<alias>.id" }, { "source": "<textField>", "target": "<alias>.<textField>" }] } }`',
91
+ '',
92
+ '`options.entity` must be a `fullName` you already saw. `textField` must be one of that entity\'s `properties[].name`. Property `name` is the FK (`ownerId`, `vehicleId`).',
93
+ '',
94
+ '### List, create, update, single',
95
+ 'Section: `{ "id": "basic-info", "layout": { "positions": { "lg": { "colSpan": 12 } } } }`',
96
+ 'Field placement: `{ "name": "<property>", "layout": { "positions": { "lg": { "colSpan": 6, "order": 1 } } } }`. Wide fields (`large-text-editor`, `map`, `attachments`) use `colSpan` 12.',
97
+ '',
98
+ '`interfaces.master.list`:',
99
+ '- `views`: `[{ "name": "all", "title": "@general:terms.interface.selection.all-items", "fixed": true, "columns": [], "conditions": [], "sorts": [{ "name": "title", "dir": "asc" }] }]`',
100
+ '- `actions` — copy this array. Create uses a command **object**. Delete and view use a command **string**.',
101
+ '`[{ "title": "@general:actions.create.title", "command": { "name": "Entity:Create" }, "priority": "primary", "type": "create", "scope": "typeLevel" }, { "title": "@general:actions.delete-items.title", "command": "Entity:Remove", "priority": "primary", "type": "delete", "scope": "selected", "order": 100 }, { "title": "@general:actions.delete.title", "command": "Entity:Remove", "priority": "secondary", "type": "delete", "scope": "individual", "order": 100, "shortcuts": ["ctrl+shift+delete"] }, { "title": "@general:actions.view.title", "command": "Entity:OpenDetails", "priority": "secondary", "type": "view", "scope": "individual", "default": true }]`',
102
+ '- `interfaces.master.single.actions` is only the individual delete object from that array.',
103
+ '',
104
+ '`interfaces.master.create` and `update`: `{ sections, properties: <placements> }`.',
105
+ '`interfaces.master.single`: `{ "title": "{{ title }}", "sections", "properties": <placements>, "actions": [the individual Entity:Remove action] }`.',
106
+ '',
107
+ 'Omit `id` from create/update/single placements and from `columns`.',
108
+ '',
109
+ '### Related entities, plugins, category',
110
+ 'Child list on the parent (car shows its rentals), inside `content.relatedEntities`:',
111
+ '`{ "entity": "RentManagement.Rental", "title": "اجاره‌ها", "layout": { "type": "page-list", "position": "after" }, "persistence": { "strategy": "referenced", "foreignKeyField": "vehicleId" } }`',
112
+ 'Layout `type` is `page-list`, `tab-list`, `page-detail`, `tab-detail`, or `merge-detail`. This is not a new entity.',
113
+ '',
114
+ 'Plugins are `{ name, options? }`. Use only names you need: `history`, `archive`, `notes`, `clone`, `compare`, `disable`, `lock`, `attachments`, `category`. Default for a new business entity: `[{ "name": "history" }]`. Do not invent plugin names.',
115
+ '',
116
+ '`category` is `{ entity, textField, valueField }` when the user asked to classify rows by another entity. Otherwise omit it.',
117
+ '',
118
+ '`rules` change visibility: `{ name, expression, actions: [{ target: { type: "property"|"section"|"action", name }, values }] }`. Omit unless the user asked for show/hide.',
119
+ '`commands` and `queries` stay omitted so the platform default CRUD is used.',
120
+ '',
121
+ '### Vehicle `content` to copy',
122
+ 'Store this object with **write-entity-definition** as `data.content`. Change titles to the user language. Do not leave any placeholder.',
123
+ '',
124
+ '```json',
125
+ '{',
126
+ ' "module": "RentManagement",',
127
+ ' "name": "Vehicle",',
128
+ ' "title": "خودرو",',
129
+ ' "icon": "fa-light fa-car",',
130
+ ' "searchTags": ["vehicle", "خودرو"],',
131
+ ' "formats": { "individual": "خودرو", "plural": "خودروها", "searchResult": { "title": "{{ title }}", "description": "اجاره خودرو" } },',
132
+ ' "plugins": [{ "name": "history" }],',
133
+ ' "groups": [{ "id": "basic-info", "title": "مشخصات" }],',
134
+ ' "properties": [',
135
+ ' { "name": "id", "title": "Id", "groupId": "basic-info", "schema": { "dataType": "uuid", "visible": false, "readonly": true, "unique": { "enabled": true } } },',
136
+ ' { "name": "title", "title": "عنوان", "groupId": "basic-info", "options": { "sort": { "enabled": true }, "filter": { "advance": { "enabled": true }, "inline": { "enabled": true } } }, "schema": { "dataType": "string", "interface": { "type": "text-editor" } }, "validations": [{ "rule": "required" }] },',
137
+ ' { "name": "plateNumber", "title": "پلاک", "groupId": "basic-info", "options": { "sort": { "enabled": true }, "filter": { "advance": { "enabled": true }, "inline": { "enabled": true } } }, "schema": { "dataType": "string", "unique": { "enabled": true }, "interface": { "type": "text-editor" } }, "validations": [{ "rule": "required" }] },',
138
+ ' { "name": "dailyRate", "title": "نرخ روزانه", "groupId": "basic-info", "options": { "sort": { "enabled": true }, "filter": { "advance": { "enabled": true }, "inline": { "enabled": true } } }, "schema": { "dataType": "number", "interface": { "type": "number-editor" } }, "validations": [{ "rule": "required" }] }',
139
+ ' ],',
140
+ ' "columns": [',
141
+ ' { "name": "title", "options": { "width": "220px", "order": 1 } },',
142
+ ' { "name": "plateNumber", "options": { "width": "160px", "order": 2 } },',
143
+ ' { "name": "dailyRate", "options": { "width": "140px", "order": 3 } }',
144
+ ' ],',
145
+ ' "relatedEntities": [{ "entity": "RentManagement.Rental", "title": "اجاره‌ها", "layout": { "type": "page-list", "position": "after" }, "persistence": { "strategy": "referenced", "foreignKeyField": "vehicleId" } }],',
146
+ ' "interfaces": {',
147
+ ' "master": {',
148
+ ' "create": { "sections": [{ "id": "basic-info", "layout": { "positions": { "lg": { "colSpan": 12 } } } }], "properties": [{ "name": "title", "layout": { "positions": { "lg": { "colSpan": 6, "order": 1 } } } }, { "name": "plateNumber", "layout": { "positions": { "lg": { "colSpan": 6, "order": 2 } } } }, { "name": "dailyRate", "layout": { "positions": { "lg": { "colSpan": 6, "order": 3 } } } }] },',
149
+ ' "update": { "sections": [{ "id": "basic-info", "layout": { "positions": { "lg": { "colSpan": 12 } } } }], "properties": [{ "name": "title", "layout": { "positions": { "lg": { "colSpan": 6, "order": 1 } } } }, { "name": "plateNumber", "layout": { "positions": { "lg": { "colSpan": 6, "order": 2 } } } }, { "name": "dailyRate", "layout": { "positions": { "lg": { "colSpan": 6, "order": 3 } } } }] },',
150
+ ' "single": { "title": "{{ title }}", "sections": [{ "id": "basic-info", "layout": { "positions": { "lg": { "colSpan": 12 } } } }], "properties": [{ "name": "title", "layout": { "positions": { "lg": { "colSpan": 6, "order": 1 } } } }, { "name": "plateNumber", "layout": { "positions": { "lg": { "colSpan": 6, "order": 2 } } } }, { "name": "dailyRate", "layout": { "positions": { "lg": { "colSpan": 6, "order": 3 } } } }], "actions": [{ "title": "@general:actions.delete.title", "command": "Entity:Remove", "priority": "secondary", "type": "delete", "scope": "individual", "order": 100, "shortcuts": ["ctrl+shift+delete"] }] },',
151
+ ' "list": { "actions": [{ "title": "@general:actions.create.title", "command": { "name": "Entity:Create" }, "priority": "primary", "type": "create", "scope": "typeLevel" }, { "title": "@general:actions.delete-items.title", "command": "Entity:Remove", "priority": "primary", "type": "delete", "scope": "selected", "order": 100 }, { "title": "@general:actions.delete.title", "command": "Entity:Remove", "priority": "secondary", "type": "delete", "scope": "individual", "order": 100, "shortcuts": ["ctrl+shift+delete"] }, { "title": "@general:actions.view.title", "command": "Entity:OpenDetails", "priority": "secondary", "type": "view", "scope": "individual", "default": true }], "views": [{ "name": "all", "title": "@general:terms.interface.selection.all-items", "fixed": true, "columns": [], "conditions": [], "sorts": [{ "name": "title", "dir": "asc" }] }] }',
152
+ ' }',
153
+ ' }',
154
+ '}',
155
+ '```',
156
+ '',
157
+ '### Rental lookups',
158
+ 'Same skeleton, `name` `Rental`. Add `startDate` and `endDate` (`date-time-editor` / `date`). No `relatedEntities` unless asked.',
159
+ '',
160
+ 'Vehicle lookup property:',
161
+ '`{ "name": "vehicleId", "title": "خودرو", "groupId": "basic-info", "options": { "sort": { "enabled": true }, "filter": { "advance": { "enabled": true }, "inline": { "enabled": true } } }, "schema": { "dataType": "string", "interface": { "type": "lookup-editor", "options": { "entity": "RentManagement.Vehicle", "multiple": false, "valueField": "id", "textField": "title", "look": "select", "columns": ["title"], "expose": [{ "source": "id", "target": "vehicle.id" }, { "source": "title", "target": "vehicle.title" }] } } }, "validations": [{ "rule": "required" }] }`',
162
+ '',
163
+ 'Owner lookup is the same with `name` `ownerId`, `entity` `SecurityManagement.User`, and `textField` / expose source taken from `ListRegisteredEntities`. Do not guess `displayName` if that call did not return it.',
164
+ ].join('\n');
165
+ //#endregion
166
+
167
+ //#region ----- Write entity definition -----
168
+ const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_ID = 'e0000001-0000-4000-8000-000000000022';
169
+ const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME = 'write-entity-definition';
170
+ const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_MARKDOWN = [
171
+ '## Write entity definition',
172
+ '',
173
+ 'Follow this playbook to store one `AXPEntity` built by **compose-axp-entity**. The module row must already exist.',
174
+ '',
175
+ '### Hard rules',
176
+ '- Insert into `PlatformManagement.EntityDefinition` with `Entity:Insert:Default`. `data` is a JSON object.',
177
+ '- `data.module` is the module name (`RentManagement`). `data.name` is the short entity name (`Vehicle`), matching `^[A-Za-z][A-Za-z0-9]*$`. Also set `data.title` and `data.icon`.',
178
+ '- `data.content` is the full `AXPEntity` from **compose-axp-entity**. `content.module` and `content.name` match `data.module` and `data.name`.',
179
+ '- Do **not** also send designer keys `properties`, `groups`, `columns`, `plugins`, `relatedEntities`, `pages`, `rules`, `listActions`, or `singleActions` on the same insert. Those keys are a thin overlay and **replace** the matching part of `content`. A designer `properties` array drops `schema`, `validations`, and lookup `expose`.',
180
+ '- Do **not** call `Entity:Create` or emit a chat widget tree.',
181
+ '- On duplicate name, `Entity:Query:Default` the existing `PlatformManagement.EntityDefinition` row and `Entity:Update:Default` that `id`. An update ignores a new `content` object if the row already has one. To change one slice, send only that designer key (`relatedEntities`, `columns`, …) and accept that a `properties` update flattens every property.',
182
+ '',
183
+ '### Order',
184
+ '1. Build each `content` with **compose-axp-entity** before any insert.',
185
+ '2. Insert the parent first (`Vehicle`), including `content.relatedEntities` that point at the child key you will insert next.',
186
+ '3. Insert the child (`Rental`) with lookups to entities that already exist (`RentManagement.Vehicle`, `SecurityManagement.User`).',
187
+ '4. One entity per call. Read `success`. Stored `name` must be `RentManagement.Vehicle` or `RentManagement.Rental`. If `success` is false, fix `data` from `message` and retry. Do not claim the entity exists.',
188
+ '5. Tell the user the definition is stored. This skill does not add a menu or a code package.',
189
+ ].join('\n');
190
+ //#endregion
191
+
192
+ //#region ----- Write module definition -----
193
+ const AXE_APP_BUILDER_SKILL_WRITE_MODULE_ID = 'e0000001-0000-4000-8000-000000000021';
194
+ const AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME = 'write-module-definition';
195
+ const AXE_APP_BUILDER_SKILL_WRITE_MODULE_MARKDOWN = [
196
+ '## Write module definition',
197
+ '',
198
+ 'Follow this playbook when **reuse-platform-definition** decided a module row must be stored. This writes `PlatformManagement.ModuleDefinition` only.',
199
+ '',
200
+ '### Hard rules',
201
+ '- Persist with `Entity:Insert:Default`. `data` is a JSON **object**, never a string, and never a TypeScript manifest.',
202
+ '- Do **not** call `Entity:Create`. Do **not** send a `content` document.',
203
+ '- Required `data` fields: `name`, `title`, `version` (`1.0.0`), `type` (`domain` unless the user asked for a platform or integration module), `domain` (one of `general`, `operations`, `finance-commerce`, `customer-supplier`, `asset-maintenance`, `human-capital`).',
204
+ '- Also set `icon` (Font Awesome class), `i18n` (kebab-case of the module name), `description`, `required`: false, `dependencies`: module **names** you actually found (for the car-rental example, `SecurityManagement` because Rental looks up User).',
205
+ '- If Query already returned that `name`, skip insert. To change title or description, `Entity:Update:Default` with that row `id` and only the changed fields.',
206
+ '',
207
+ '### Example (`RentManagement`)',
208
+ '`Entity:Insert:Default`:',
209
+ '- `entity`: `PlatformManagement.ModuleDefinition`',
210
+ '- `data`: `{ "name": "RentManagement", "title": "اجاره خودرو", "version": "1.0.0", "type": "domain", "domain": "operations", "icon": "fa-light fa-car", "i18n": "rent-management", "description": "خودرو و قرارداد اجاره", "required": false, "dependencies": ["SecurityManagement"] }`',
211
+ '',
212
+ 'Use the user language for `title` and `description`. Keep `name` as decided by **reuse-platform-definition**.',
213
+ '',
214
+ '### Steps',
215
+ '1. Confirm the module name is still absent (`Entity:Query:Default` / `quickSearch`) unless reuse already did.',
216
+ '2. Insert once.',
217
+ '3. If `success` is false, read `message` and fix `data`. Do not claim the module exists.',
218
+ '4. Then write entities with **write-entity-definition**. A module row alone does not create cars or rentals.',
219
+ ].join('\n');
220
+ //#endregion
221
+
222
+ //#region ----- Imports -----
223
+ //#endregion
224
+ //#region ----- Skill rows -----
225
+ /** Playbooks attached to `app-builder-assist`. Seeded as `AiManagement.Skill` rows. */
226
+ const AXE_APP_BUILDER_SKILL_ROWS = [
227
+ {
228
+ id: AXE_APP_BUILDER_SKILL_REUSE_ID,
229
+ name: AXE_APP_BUILDER_SKILL_REUSE_NAME,
230
+ title: {
231
+ 'en-US': 'Reuse Platform Definition',
232
+ 'fa-IR': 'استفاده از تعریف موجود',
233
+ },
234
+ description: {
235
+ 'en-US': 'Use before creating a module or entity. Find existing modules, entities, and lookup targets such as User. Do not insert.',
236
+ 'fa-IR': 'قبل از ساخت ماژول یا موجودیت استفاده کن. ماژول، موجودیت و مقصد lookup مثل کاربر را پیدا کن. درج نکن.',
237
+ },
238
+ markdown: AXE_APP_BUILDER_SKILL_REUSE_MARKDOWN,
239
+ },
240
+ {
241
+ id: AXE_APP_BUILDER_SKILL_WRITE_MODULE_ID,
242
+ name: AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,
243
+ title: {
244
+ 'en-US': 'Write Module Definition',
245
+ 'fa-IR': 'نوشتن تعریف ماژول',
246
+ },
247
+ description: {
248
+ 'en-US': 'Use to store a PlatformManagement.ModuleDefinition row with Entity:Insert:Default. Do not use for entities, menus, or TypeScript.',
249
+ 'fa-IR': 'برای ذخیره ردیف PlatformManagement.ModuleDefinition با Entity:Insert:Default استفاده کن. برای موجودیت، منو یا TypeScript استفاده نکن.',
250
+ },
251
+ markdown: AXE_APP_BUILDER_SKILL_WRITE_MODULE_MARKDOWN,
252
+ },
253
+ {
254
+ id: AXE_APP_BUILDER_SKILL_WRITE_ENTITY_ID,
255
+ name: AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,
256
+ title: {
257
+ 'en-US': 'Write Entity Definition',
258
+ 'fa-IR': 'نوشتن تعریف موجودیت',
259
+ },
260
+ description: {
261
+ 'en-US': 'Use to store one AXPEntity in PlatformManagement.EntityDefinition via content. Do not send designer property rows on the same insert.',
262
+ 'fa-IR': 'برای ذخیره یک AXPEntity در PlatformManagement.EntityDefinition از راه content استفاده کن. در همان درج ردیف‌های طراح property نفرست.',
263
+ },
264
+ markdown: AXE_APP_BUILDER_SKILL_WRITE_ENTITY_MARKDOWN,
265
+ },
266
+ {
267
+ id: AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_ID,
268
+ name: AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,
269
+ title: {
270
+ 'en-US': 'Compose AXPEntity',
271
+ 'fa-IR': 'نگارش AXPEntity',
272
+ },
273
+ description: {
274
+ 'en-US': 'Use to build the AXPEntity content object: properties, widgets, lookups, columns, master interfaces, related entities, and plugins. Do not insert.',
275
+ 'fa-IR': 'برای ساختن آبجکت content از نوع AXPEntity استفاده کن: property، ویجت، lookup، ستون، اینترفیس master، موجودیت مرتبط و پلاگین. درج نکن.',
276
+ },
277
+ markdown: AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_MARKDOWN,
278
+ },
279
+ ];
280
+ //#endregion
281
+
282
+ //#region ----- Imports -----
283
+ //#endregion
284
+ //#region ----- Identity -----
285
+ /** Stable `AiManagement.Assist` id for the platform-definition author. */
286
+ const AXE_APP_BUILDER_ASSIST_ID = 'b0000001-0000-4000-8000-000000000005';
287
+ /** Programmatic assist name (`AiManagement.Assist.name`). */
288
+ const AXE_APP_BUILDER_ASSIST_NAME = 'app-builder-assist';
289
+ //#endregion
290
+ //#region ----- Metadata -----
291
+ /**
292
+ * App Builder Assist metadata for Platform Definition.
293
+ * Entity names match `PlatformManagement` `ModuleDefinition` and `EntityDefinition`.
294
+ * Playbooks: reuse-platform-definition, write-module-definition, compose-axp-entity, write-entity-definition.
295
+ */
296
+ const AXE_APP_BUILDER_ASSIST = {
297
+ id: AXE_APP_BUILDER_ASSIST_ID,
298
+ name: AXE_APP_BUILDER_ASSIST_NAME,
299
+ title: {
300
+ 'en-US': 'App Builder Assist',
301
+ 'fa-IR': 'دستیار ساخت اپ',
302
+ },
303
+ description: {
304
+ 'en-US': 'Authors module and entity definitions in Platform Definition, and reuses modules and entities that already exist.',
305
+ 'fa-IR': 'تعریف ماژول و موجودیت را در Platform Definition می‌سازد و از ماژول و موجودیت موجود استفاده می‌کند.',
306
+ },
307
+ planningMode: 'off',
308
+ skillNames: [
309
+ AXE_APP_BUILDER_SKILL_REUSE_NAME,
310
+ AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,
311
+ AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,
312
+ AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,
313
+ ],
314
+ platformDefinitionEntities: [
315
+ { module: 'PlatformManagement', name: 'ModuleDefinition' },
316
+ { module: 'PlatformManagement', name: 'EntityDefinition' },
317
+ ],
318
+ };
319
+ //#endregion
320
+
321
+ //#region ---- Contracts barrel ----
322
+ //#endregion
323
+
324
+ /**
325
+ * Generated bundle index. Do not edit.
326
+ */
327
+
328
+ export { AXE_APP_BUILDER_ASSIST, AXE_APP_BUILDER_ASSIST_ID, AXE_APP_BUILDER_ASSIST_NAME, AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME, AXE_APP_BUILDER_SKILL_REUSE_NAME, AXE_APP_BUILDER_SKILL_ROWS, AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME, AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME };
329
+ //# sourceMappingURL=acorex-platform-extension-ai-platform-management-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-ai-platform-management-client-contracts.mjs","sources":["../../../../libs/extensions/ai/platform-management/contracts/src/skills/reuse-platform-definition.skill.ts","../../../../libs/extensions/ai/platform-management/contracts/src/skills/compose-axp-entity.skill.ts","../../../../libs/extensions/ai/platform-management/contracts/src/skills/write-entity-definition.skill.ts","../../../../libs/extensions/ai/platform-management/contracts/src/skills/write-module-definition.skill.ts","../../../../libs/extensions/ai/platform-management/contracts/src/skills/index.ts","../../../../libs/extensions/ai/platform-management/contracts/src/app-builder-assist.metadata.ts","../../../../libs/extensions/ai/platform-management/contracts/src/index.ts","../../../../libs/extensions/ai/platform-management/contracts/src/acorex-platform-extension-ai-platform-management-client-contracts.ts"],"sourcesContent":["//#region ----- Reuse platform definition -----\n\nexport const AXE_APP_BUILDER_SKILL_REUSE_ID = 'e0000001-0000-4000-8000-000000000020';\n\nexport const AXE_APP_BUILDER_SKILL_REUSE_NAME = 'reuse-platform-definition';\n\nexport const AXE_APP_BUILDER_SKILL_REUSE_MARKDOWN = [\n '## Reuse platform definition',\n '',\n 'Follow this playbook **before** any insert, when the user wants a new module, entity, or relationship (Persian: ماژول بساز، موجودیت، ارتباط با کاربر).',\n '',\n '### Hard rules',\n '- Your **first** action is a **tool call**. Do not invent `Module.Entity` keys or a new Owner/User entity.',\n '- This assist **has** `PlatformManagement:ListRegisteredEntities` and `Entity:Query:Default`. It does **not** write TypeScript, menus, or i18n JSON files.',\n '- A **module** is a row of `PlatformManagement.ModuleDefinition`. An **entity** is a row of `PlatformManagement.EntityDefinition` whose stored `name` is `Module.Entity`.',\n '- A relationship to something that already exists is a **lookup property**, not a new entity.',\n '- Identifiers (`name`) are PascalCase English (`RentManagement`, `Vehicle`). Titles are human text in the user language. `name` must match `^[A-Za-z][A-Za-z0-9]*$` — no spaces, hyphens, or Persian.',\n '',\n '### Worked prompt',\n 'User: «می‌خواهم یک ماژول rent ماشین داشته باشم».',\n '',\n 'Decide:',\n '- Module `name`: `RentManagement` (not `rent`, not `CarRental`). `i18n`: `rent-management`. `type`: `domain`. `domain`: `operations`.',\n '- New entities: `Vehicle` (the car) and `Rental` (the agreement).',\n '- **Do not** create `Owner`, `User`, or `Car`. The owner is `ownerId` on `Rental`, a lookup to the existing user entity.',\n '- Find that user entity with `ListRegisteredEntities` `search`: `user`. Expect `SecurityManagement.User`. Read `properties` and use a real title field (`displayName`, `title`, or `name`) as `textField`. If `matchStatus` is `none`, stop and say the user entity is missing. Do not invent the key.',\n '- `Rental.vehicleId` looks up `RentManagement.Vehicle` **after** Vehicle is stored.',\n '- After both entities exist, Vehicle can list its rentals (`relatedEntities` → `RentManagement.Rental`, `foreignKeyField`: `vehicleId`). That is an update, not a third entity.',\n '',\n '### Steps',\n '1. **Modules.** `Entity:Query:Default` with `entity`: `PlatformManagement.ModuleDefinition` and `quickSearch` set to the intended module name. If `items[].name` already equals that name, reuse it. Do not insert a second module.',\n '2. **Entities.** `ListRegisteredEntities` with `search` for each noun (vehicle, rental, user, and any name the user used). `matchStatus` `single` or a clear `fullName` means reuse. `multiple` means pick or ask. `none` means it can be created.',\n '3. **Schema of a lookup target.** Call `ListRegisteredEntities` with `entityFullName` before choosing `textField` or `expose`.',\n '4. **Hand off.** Tell the next skills the module name, the entity list, and which fields are lookups. Do not insert in this skill.',\n].join('\\n');\n\n//#endregion\n","//#region ----- Compose AXPEntity -----\n\nexport const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_ID = 'e0000001-0000-4000-8000-000000000023';\n\nexport const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME = 'compose-axp-entity';\n\nexport const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_MARKDOWN = [\n '## Compose AXPEntity',\n '',\n 'Follow this playbook whenever you build an entity. You do **not** have the platform source. The object you put in `content` **is** `AXPEntity`. **write-entity-definition** only stores that object. Do not invent a second schema.',\n '',\n '### Stored shape',\n '`content` keys:',\n '- `module`, `name` (short PascalCase), `title`, `icon`',\n '- `searchTags`: string keywords in any language. Not i18n keys.',\n '- `formats`: `{ individual, plural, displayName?, searchResult: { title, description } }`. `searchResult.title` is usually `{{ title }}`.',\n '- `groups`: `{ id, title, description?, icon? }[]`',\n '- `properties`: see below. Always include hidden `id`.',\n '- `columns`: list columns `{ name, title?, showAs?: { type }, options?: { width, order } }`',\n '- `interfaces.master`: `list`, `create`, `update`, `single`',\n '- `relatedEntities?`, `plugins?`, `category?`, `pages?`, `rules?`, `validations?`, `commands?`, `queries?`, `parentKey?`',\n '',\n 'Do **not** emit `AXPEntityV2`, aggregates, or TypeScript helpers (`entityMasterCrudActions`, `createAllQueryView`). Write the JSON those helpers would have produced.',\n '',\n '### Property',\n 'Each property:',\n '`{ name, title, description?, groupId, schema: { dataType, nullable?, readonly?, visible?, defaultValue?, unique?: { enabled }, interface?: { type, options?, children?, mode? } }, options?: { sort: { enabled }, filter: { inline: { enabled }, advance: { enabled } } }, validations? }`',\n '',\n '`validations` entries: `{ rule: \"required\" }`, `{ rule: \"minLength\", options: { minLength } }`, `{ rule: \"maxLength\", options: { maxLength } }`, `{ rule: \"regex\", options: { value } }`, `{ rule: \"equal\", options: { value } }`.',\n '',\n 'Hidden primary key on every entity:',\n '`{ \"name\": \"id\", \"title\": \"Id\", \"groupId\": \"basic-info\", \"schema\": { \"dataType\": \"uuid\", \"visible\": false, \"readonly\": true, \"unique\": { \"enabled\": true } } }`',\n '',\n '### Widget `interface.type` and `dataType`',\n 'Use only these registry names for fields:',\n '- short text → `text-editor` / `string`',\n '- notes → `large-text-editor` / `string`',\n '- rich text → `rich-text-editor` / `string`',\n '- money, count, measurement → `number-editor` / `number`',\n '- number plus unit → `number-unit-editor` / `number`',\n '- date or time → `date-time-editor` / `date`',\n '- yes/no → `toggle-editor` or `checkbox-editor` / `boolean`',\n '- closed list → `select-editor` / `string`. `options.dataSource` is `[{ value, text }]`, plus `valueField` and `textField`.',\n '- multi closed list → `selection-list-editor` / `string`',\n '- relation to another entity → `lookup-editor` / `string`',\n '- phone/email composite → `contact-editor` / `string`',\n '- secret → `password-editor` / `string`',\n '- files → `attachments`',\n '- map → `map`',\n '- signature → `signature`',\n '- rating → `rate-picker-editor`',\n '',\n 'Never use `text-editor` for a date, a number, or a relation. Never invent a widget name.',\n '',\n '### Lookup',\n '`schema.interface` may also hold `triggers` (`[{ \"event\", \"action\", \"disabled\"? }]`) and `valueTransforms`. Put them on the interface inside `content`. Omit both unless the user asked. Do not send them as designer rows.',\n '',\n '`schema.interface`:',\n '`{ \"type\": \"lookup-editor\", \"options\": { \"entity\": \"Module.Entity\", \"multiple\": false, \"valueField\": \"id\", \"textField\": \"<property that ListRegisteredEntities returned>\", \"look\": \"select\", \"columns\": [\"<textField>\"], \"expose\": [{ \"source\": \"id\", \"target\": \"<alias>.id\" }, { \"source\": \"<textField>\", \"target\": \"<alias>.<textField>\" }] } }`',\n '',\n '`options.entity` must be a `fullName` you already saw. `textField` must be one of that entity\\'s `properties[].name`. Property `name` is the FK (`ownerId`, `vehicleId`).',\n '',\n '### List, create, update, single',\n 'Section: `{ \"id\": \"basic-info\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 12 } } } }`',\n 'Field placement: `{ \"name\": \"<property>\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 1 } } } }`. Wide fields (`large-text-editor`, `map`, `attachments`) use `colSpan` 12.',\n '',\n '`interfaces.master.list`:',\n '- `views`: `[{ \"name\": \"all\", \"title\": \"@general:terms.interface.selection.all-items\", \"fixed\": true, \"columns\": [], \"conditions\": [], \"sorts\": [{ \"name\": \"title\", \"dir\": \"asc\" }] }]`',\n '- `actions` — copy this array. Create uses a command **object**. Delete and view use a command **string**.',\n '`[{ \"title\": \"@general:actions.create.title\", \"command\": { \"name\": \"Entity:Create\" }, \"priority\": \"primary\", \"type\": \"create\", \"scope\": \"typeLevel\" }, { \"title\": \"@general:actions.delete-items.title\", \"command\": \"Entity:Remove\", \"priority\": \"primary\", \"type\": \"delete\", \"scope\": \"selected\", \"order\": 100 }, { \"title\": \"@general:actions.delete.title\", \"command\": \"Entity:Remove\", \"priority\": \"secondary\", \"type\": \"delete\", \"scope\": \"individual\", \"order\": 100, \"shortcuts\": [\"ctrl+shift+delete\"] }, { \"title\": \"@general:actions.view.title\", \"command\": \"Entity:OpenDetails\", \"priority\": \"secondary\", \"type\": \"view\", \"scope\": \"individual\", \"default\": true }]`',\n '- `interfaces.master.single.actions` is only the individual delete object from that array.',\n '',\n '`interfaces.master.create` and `update`: `{ sections, properties: <placements> }`.',\n '`interfaces.master.single`: `{ \"title\": \"{{ title }}\", \"sections\", \"properties\": <placements>, \"actions\": [the individual Entity:Remove action] }`.',\n '',\n 'Omit `id` from create/update/single placements and from `columns`.',\n '',\n '### Related entities, plugins, category',\n 'Child list on the parent (car shows its rentals), inside `content.relatedEntities`:',\n '`{ \"entity\": \"RentManagement.Rental\", \"title\": \"اجاره‌ها\", \"layout\": { \"type\": \"page-list\", \"position\": \"after\" }, \"persistence\": { \"strategy\": \"referenced\", \"foreignKeyField\": \"vehicleId\" } }`',\n 'Layout `type` is `page-list`, `tab-list`, `page-detail`, `tab-detail`, or `merge-detail`. This is not a new entity.',\n '',\n 'Plugins are `{ name, options? }`. Use only names you need: `history`, `archive`, `notes`, `clone`, `compare`, `disable`, `lock`, `attachments`, `category`. Default for a new business entity: `[{ \"name\": \"history\" }]`. Do not invent plugin names.',\n '',\n '`category` is `{ entity, textField, valueField }` when the user asked to classify rows by another entity. Otherwise omit it.',\n '',\n '`rules` change visibility: `{ name, expression, actions: [{ target: { type: \"property\"|\"section\"|\"action\", name }, values }] }`. Omit unless the user asked for show/hide.',\n '`commands` and `queries` stay omitted so the platform default CRUD is used.',\n '',\n '### Vehicle `content` to copy',\n 'Store this object with **write-entity-definition** as `data.content`. Change titles to the user language. Do not leave any placeholder.',\n '',\n '```json',\n '{',\n ' \"module\": \"RentManagement\",',\n ' \"name\": \"Vehicle\",',\n ' \"title\": \"خودرو\",',\n ' \"icon\": \"fa-light fa-car\",',\n ' \"searchTags\": [\"vehicle\", \"خودرو\"],',\n ' \"formats\": { \"individual\": \"خودرو\", \"plural\": \"خودروها\", \"searchResult\": { \"title\": \"{{ title }}\", \"description\": \"اجاره خودرو\" } },',\n ' \"plugins\": [{ \"name\": \"history\" }],',\n ' \"groups\": [{ \"id\": \"basic-info\", \"title\": \"مشخصات\" }],',\n ' \"properties\": [',\n ' { \"name\": \"id\", \"title\": \"Id\", \"groupId\": \"basic-info\", \"schema\": { \"dataType\": \"uuid\", \"visible\": false, \"readonly\": true, \"unique\": { \"enabled\": true } } },',\n ' { \"name\": \"title\", \"title\": \"عنوان\", \"groupId\": \"basic-info\", \"options\": { \"sort\": { \"enabled\": true }, \"filter\": { \"advance\": { \"enabled\": true }, \"inline\": { \"enabled\": true } } }, \"schema\": { \"dataType\": \"string\", \"interface\": { \"type\": \"text-editor\" } }, \"validations\": [{ \"rule\": \"required\" }] },',\n ' { \"name\": \"plateNumber\", \"title\": \"پلاک\", \"groupId\": \"basic-info\", \"options\": { \"sort\": { \"enabled\": true }, \"filter\": { \"advance\": { \"enabled\": true }, \"inline\": { \"enabled\": true } } }, \"schema\": { \"dataType\": \"string\", \"unique\": { \"enabled\": true }, \"interface\": { \"type\": \"text-editor\" } }, \"validations\": [{ \"rule\": \"required\" }] },',\n ' { \"name\": \"dailyRate\", \"title\": \"نرخ روزانه\", \"groupId\": \"basic-info\", \"options\": { \"sort\": { \"enabled\": true }, \"filter\": { \"advance\": { \"enabled\": true }, \"inline\": { \"enabled\": true } } }, \"schema\": { \"dataType\": \"number\", \"interface\": { \"type\": \"number-editor\" } }, \"validations\": [{ \"rule\": \"required\" }] }',\n ' ],',\n ' \"columns\": [',\n ' { \"name\": \"title\", \"options\": { \"width\": \"220px\", \"order\": 1 } },',\n ' { \"name\": \"plateNumber\", \"options\": { \"width\": \"160px\", \"order\": 2 } },',\n ' { \"name\": \"dailyRate\", \"options\": { \"width\": \"140px\", \"order\": 3 } }',\n ' ],',\n ' \"relatedEntities\": [{ \"entity\": \"RentManagement.Rental\", \"title\": \"اجاره‌ها\", \"layout\": { \"type\": \"page-list\", \"position\": \"after\" }, \"persistence\": { \"strategy\": \"referenced\", \"foreignKeyField\": \"vehicleId\" } }],',\n ' \"interfaces\": {',\n ' \"master\": {',\n ' \"create\": { \"sections\": [{ \"id\": \"basic-info\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 12 } } } }], \"properties\": [{ \"name\": \"title\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 1 } } } }, { \"name\": \"plateNumber\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 2 } } } }, { \"name\": \"dailyRate\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 3 } } } }] },',\n ' \"update\": { \"sections\": [{ \"id\": \"basic-info\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 12 } } } }], \"properties\": [{ \"name\": \"title\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 1 } } } }, { \"name\": \"plateNumber\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 2 } } } }, { \"name\": \"dailyRate\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 3 } } } }] },',\n ' \"single\": { \"title\": \"{{ title }}\", \"sections\": [{ \"id\": \"basic-info\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 12 } } } }], \"properties\": [{ \"name\": \"title\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 1 } } } }, { \"name\": \"plateNumber\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 2 } } } }, { \"name\": \"dailyRate\", \"layout\": { \"positions\": { \"lg\": { \"colSpan\": 6, \"order\": 3 } } } }], \"actions\": [{ \"title\": \"@general:actions.delete.title\", \"command\": \"Entity:Remove\", \"priority\": \"secondary\", \"type\": \"delete\", \"scope\": \"individual\", \"order\": 100, \"shortcuts\": [\"ctrl+shift+delete\"] }] },',\n ' \"list\": { \"actions\": [{ \"title\": \"@general:actions.create.title\", \"command\": { \"name\": \"Entity:Create\" }, \"priority\": \"primary\", \"type\": \"create\", \"scope\": \"typeLevel\" }, { \"title\": \"@general:actions.delete-items.title\", \"command\": \"Entity:Remove\", \"priority\": \"primary\", \"type\": \"delete\", \"scope\": \"selected\", \"order\": 100 }, { \"title\": \"@general:actions.delete.title\", \"command\": \"Entity:Remove\", \"priority\": \"secondary\", \"type\": \"delete\", \"scope\": \"individual\", \"order\": 100, \"shortcuts\": [\"ctrl+shift+delete\"] }, { \"title\": \"@general:actions.view.title\", \"command\": \"Entity:OpenDetails\", \"priority\": \"secondary\", \"type\": \"view\", \"scope\": \"individual\", \"default\": true }], \"views\": [{ \"name\": \"all\", \"title\": \"@general:terms.interface.selection.all-items\", \"fixed\": true, \"columns\": [], \"conditions\": [], \"sorts\": [{ \"name\": \"title\", \"dir\": \"asc\" }] }] }',\n ' }',\n ' }',\n '}',\n '```',\n '',\n '### Rental lookups',\n 'Same skeleton, `name` `Rental`. Add `startDate` and `endDate` (`date-time-editor` / `date`). No `relatedEntities` unless asked.',\n '',\n 'Vehicle lookup property:',\n '`{ \"name\": \"vehicleId\", \"title\": \"خودرو\", \"groupId\": \"basic-info\", \"options\": { \"sort\": { \"enabled\": true }, \"filter\": { \"advance\": { \"enabled\": true }, \"inline\": { \"enabled\": true } } }, \"schema\": { \"dataType\": \"string\", \"interface\": { \"type\": \"lookup-editor\", \"options\": { \"entity\": \"RentManagement.Vehicle\", \"multiple\": false, \"valueField\": \"id\", \"textField\": \"title\", \"look\": \"select\", \"columns\": [\"title\"], \"expose\": [{ \"source\": \"id\", \"target\": \"vehicle.id\" }, { \"source\": \"title\", \"target\": \"vehicle.title\" }] } } }, \"validations\": [{ \"rule\": \"required\" }] }`',\n '',\n 'Owner lookup is the same with `name` `ownerId`, `entity` `SecurityManagement.User`, and `textField` / expose source taken from `ListRegisteredEntities`. Do not guess `displayName` if that call did not return it.',\n].join('\\n');\n\n//#endregion\n","//#region ----- Write entity definition -----\n\nexport const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_ID = 'e0000001-0000-4000-8000-000000000022';\n\nexport const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME = 'write-entity-definition';\n\nexport const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_MARKDOWN = [\n '## Write entity definition',\n '',\n 'Follow this playbook to store one `AXPEntity` built by **compose-axp-entity**. The module row must already exist.',\n '',\n '### Hard rules',\n '- Insert into `PlatformManagement.EntityDefinition` with `Entity:Insert:Default`. `data` is a JSON object.',\n '- `data.module` is the module name (`RentManagement`). `data.name` is the short entity name (`Vehicle`), matching `^[A-Za-z][A-Za-z0-9]*$`. Also set `data.title` and `data.icon`.',\n '- `data.content` is the full `AXPEntity` from **compose-axp-entity**. `content.module` and `content.name` match `data.module` and `data.name`.',\n '- Do **not** also send designer keys `properties`, `groups`, `columns`, `plugins`, `relatedEntities`, `pages`, `rules`, `listActions`, or `singleActions` on the same insert. Those keys are a thin overlay and **replace** the matching part of `content`. A designer `properties` array drops `schema`, `validations`, and lookup `expose`.',\n '- Do **not** call `Entity:Create` or emit a chat widget tree.',\n '- On duplicate name, `Entity:Query:Default` the existing `PlatformManagement.EntityDefinition` row and `Entity:Update:Default` that `id`. An update ignores a new `content` object if the row already has one. To change one slice, send only that designer key (`relatedEntities`, `columns`, …) and accept that a `properties` update flattens every property.',\n '',\n '### Order',\n '1. Build each `content` with **compose-axp-entity** before any insert.',\n '2. Insert the parent first (`Vehicle`), including `content.relatedEntities` that point at the child key you will insert next.',\n '3. Insert the child (`Rental`) with lookups to entities that already exist (`RentManagement.Vehicle`, `SecurityManagement.User`).',\n '4. One entity per call. Read `success`. Stored `name` must be `RentManagement.Vehicle` or `RentManagement.Rental`. If `success` is false, fix `data` from `message` and retry. Do not claim the entity exists.',\n '5. Tell the user the definition is stored. This skill does not add a menu or a code package.',\n].join('\\n');\n\n//#endregion\n","//#region ----- Write module definition -----\n\nexport const AXE_APP_BUILDER_SKILL_WRITE_MODULE_ID = 'e0000001-0000-4000-8000-000000000021';\n\nexport const AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME = 'write-module-definition';\n\nexport const AXE_APP_BUILDER_SKILL_WRITE_MODULE_MARKDOWN = [\n '## Write module definition',\n '',\n 'Follow this playbook when **reuse-platform-definition** decided a module row must be stored. This writes `PlatformManagement.ModuleDefinition` only.',\n '',\n '### Hard rules',\n '- Persist with `Entity:Insert:Default`. `data` is a JSON **object**, never a string, and never a TypeScript manifest.',\n '- Do **not** call `Entity:Create`. Do **not** send a `content` document.',\n '- Required `data` fields: `name`, `title`, `version` (`1.0.0`), `type` (`domain` unless the user asked for a platform or integration module), `domain` (one of `general`, `operations`, `finance-commerce`, `customer-supplier`, `asset-maintenance`, `human-capital`).',\n '- Also set `icon` (Font Awesome class), `i18n` (kebab-case of the module name), `description`, `required`: false, `dependencies`: module **names** you actually found (for the car-rental example, `SecurityManagement` because Rental looks up User).',\n '- If Query already returned that `name`, skip insert. To change title or description, `Entity:Update:Default` with that row `id` and only the changed fields.',\n '',\n '### Example (`RentManagement`)',\n '`Entity:Insert:Default`:',\n '- `entity`: `PlatformManagement.ModuleDefinition`',\n '- `data`: `{ \"name\": \"RentManagement\", \"title\": \"اجاره خودرو\", \"version\": \"1.0.0\", \"type\": \"domain\", \"domain\": \"operations\", \"icon\": \"fa-light fa-car\", \"i18n\": \"rent-management\", \"description\": \"خودرو و قرارداد اجاره\", \"required\": false, \"dependencies\": [\"SecurityManagement\"] }`',\n '',\n 'Use the user language for `title` and `description`. Keep `name` as decided by **reuse-platform-definition**.',\n '',\n '### Steps',\n '1. Confirm the module name is still absent (`Entity:Query:Default` / `quickSearch`) unless reuse already did.',\n '2. Insert once.',\n '3. If `success` is false, read `message` and fix `data`. Do not claim the module exists.',\n '4. Then write entities with **write-entity-definition**. A module row alone does not create cars or rentals.',\n].join('\\n');\n\n//#endregion\n","//#region ----- Imports -----\n\nimport {\n AXE_APP_BUILDER_SKILL_REUSE_ID,\n AXE_APP_BUILDER_SKILL_REUSE_MARKDOWN,\n AXE_APP_BUILDER_SKILL_REUSE_NAME,\n} from './reuse-platform-definition.skill';\nimport {\n AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_ID,\n AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_MARKDOWN,\n AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,\n} from './compose-axp-entity.skill';\nimport {\n AXE_APP_BUILDER_SKILL_WRITE_ENTITY_ID,\n AXE_APP_BUILDER_SKILL_WRITE_ENTITY_MARKDOWN,\n AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,\n} from './write-entity-definition.skill';\nimport {\n AXE_APP_BUILDER_SKILL_WRITE_MODULE_ID,\n AXE_APP_BUILDER_SKILL_WRITE_MODULE_MARKDOWN,\n AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,\n} from './write-module-definition.skill';\n\n//#endregion\n\n//#region ----- Skill rows -----\n\n/** Playbooks attached to `app-builder-assist`. Seeded as `AiManagement.Skill` rows. */\nexport const AXE_APP_BUILDER_SKILL_ROWS = [\n {\n id: AXE_APP_BUILDER_SKILL_REUSE_ID,\n name: AXE_APP_BUILDER_SKILL_REUSE_NAME,\n title: {\n 'en-US': 'Reuse Platform Definition',\n 'fa-IR': 'استفاده از تعریف موجود',\n },\n description: {\n 'en-US':\n 'Use before creating a module or entity. Find existing modules, entities, and lookup targets such as User. Do not insert.',\n 'fa-IR':\n 'قبل از ساخت ماژول یا موجودیت استفاده کن. ماژول، موجودیت و مقصد lookup مثل کاربر را پیدا کن. درج نکن.',\n },\n markdown: AXE_APP_BUILDER_SKILL_REUSE_MARKDOWN,\n },\n {\n id: AXE_APP_BUILDER_SKILL_WRITE_MODULE_ID,\n name: AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,\n title: {\n 'en-US': 'Write Module Definition',\n 'fa-IR': 'نوشتن تعریف ماژول',\n },\n description: {\n 'en-US':\n 'Use to store a PlatformManagement.ModuleDefinition row with Entity:Insert:Default. Do not use for entities, menus, or TypeScript.',\n 'fa-IR':\n 'برای ذخیره ردیف PlatformManagement.ModuleDefinition با Entity:Insert:Default استفاده کن. برای موجودیت، منو یا TypeScript استفاده نکن.',\n },\n markdown: AXE_APP_BUILDER_SKILL_WRITE_MODULE_MARKDOWN,\n },\n {\n id: AXE_APP_BUILDER_SKILL_WRITE_ENTITY_ID,\n name: AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,\n title: {\n 'en-US': 'Write Entity Definition',\n 'fa-IR': 'نوشتن تعریف موجودیت',\n },\n description: {\n 'en-US':\n 'Use to store one AXPEntity in PlatformManagement.EntityDefinition via content. Do not send designer property rows on the same insert.',\n 'fa-IR':\n 'برای ذخیره یک AXPEntity در PlatformManagement.EntityDefinition از راه content استفاده کن. در همان درج ردیف‌های طراح property نفرست.',\n },\n markdown: AXE_APP_BUILDER_SKILL_WRITE_ENTITY_MARKDOWN,\n },\n {\n id: AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_ID,\n name: AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,\n title: {\n 'en-US': 'Compose AXPEntity',\n 'fa-IR': 'نگارش AXPEntity',\n },\n description: {\n 'en-US':\n 'Use to build the AXPEntity content object: properties, widgets, lookups, columns, master interfaces, related entities, and plugins. Do not insert.',\n 'fa-IR':\n 'برای ساختن آبجکت content از نوع AXPEntity استفاده کن: property، ویجت، lookup، ستون، اینترفیس master، موجودیت مرتبط و پلاگین. درج نکن.',\n },\n markdown: AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_MARKDOWN,\n },\n];\n\nexport {\n AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,\n AXE_APP_BUILDER_SKILL_REUSE_NAME,\n AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,\n AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,\n};\n\n//#endregion\n","//#region ----- Imports -----\n\nimport {\n AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,\n AXE_APP_BUILDER_SKILL_REUSE_NAME,\n AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,\n AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,\n} from './skills';\n\n//#endregion\n\n//#region ----- Identity -----\n\n/** Stable `AiManagement.Assist` id for the platform-definition author. */\nexport const AXE_APP_BUILDER_ASSIST_ID = 'b0000001-0000-4000-8000-000000000005';\n\n/** Programmatic assist name (`AiManagement.Assist.name`). */\nexport const AXE_APP_BUILDER_ASSIST_NAME = 'app-builder-assist';\n\n//#endregion\n\n//#region ----- Metadata -----\n\n/**\n * App Builder Assist metadata for Platform Definition.\n * Entity names match `PlatformManagement` `ModuleDefinition` and `EntityDefinition`.\n * Playbooks: reuse-platform-definition, write-module-definition, compose-axp-entity, write-entity-definition.\n */\nexport const AXE_APP_BUILDER_ASSIST = {\n id: AXE_APP_BUILDER_ASSIST_ID,\n name: AXE_APP_BUILDER_ASSIST_NAME,\n title: {\n 'en-US': 'App Builder Assist',\n 'fa-IR': 'دستیار ساخت اپ',\n },\n description: {\n 'en-US':\n 'Authors module and entity definitions in Platform Definition, and reuses modules and entities that already exist.',\n 'fa-IR':\n 'تعریف ماژول و موجودیت را در Platform Definition می‌سازد و از ماژول و موجودیت موجود استفاده می‌کند.',\n },\n planningMode: 'off',\n skillNames: [\n AXE_APP_BUILDER_SKILL_REUSE_NAME,\n AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME,\n AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME,\n AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME,\n ],\n platformDefinitionEntities: [\n { module: 'PlatformManagement', name: 'ModuleDefinition' },\n { module: 'PlatformManagement', name: 'EntityDefinition' },\n ],\n} as const;\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './app-builder-assist.metadata';\nexport * from './skills';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;AAEO,MAAM,8BAA8B,GAAG,sCAAsC;AAE7E,MAAM,gCAAgC,GAAG;AAEzC,MAAM,oCAAoC,GAAG;IAClD,8BAA8B;IAC9B,EAAE;IACF,wJAAwJ;IACxJ,EAAE;IACF,gBAAgB;IAChB,4GAA4G;IAC5G,4JAA4J;IAC5J,2KAA2K;IAC3K,+FAA+F;IAC/F,uMAAuM;IACvM,EAAE;IACF,mBAAmB;IACnB,kDAAkD;IAClD,EAAE;IACF,SAAS;IACT,uIAAuI;IACvI,mEAAmE;IACnE,0HAA0H;IAC1H,wSAAwS;IACxS,qFAAqF;IACrF,iLAAiL;IACjL,EAAE;IACF,WAAW;IACX,qOAAqO;IACrO,oPAAoP;IACpP,gIAAgI;IAChI,oIAAoI;AACrI,CAAA,CAAC,IAAI,CAAC,IAAI,CAAC;AAEZ;;ACpCA;AAEO,MAAM,uCAAuC,GAAG,sCAAsC;AAEtF,MAAM,yCAAyC,GAAG;AAElD,MAAM,6CAA6C,GAAG;IAC3D,sBAAsB;IACtB,EAAE;IACF,qOAAqO;IACrO,EAAE;IACF,kBAAkB;IAClB,iBAAiB;IACjB,wDAAwD;IACxD,iEAAiE;IACjE,2IAA2I;IAC3I,oDAAoD;IACpD,wDAAwD;IACxD,6FAA6F;IAC7F,6DAA6D;IAC7D,0HAA0H;IAC1H,EAAE;IACF,uKAAuK;IACvK,EAAE;IACF,cAAc;IACd,gBAAgB;IAChB,6RAA6R;IAC7R,EAAE;IACF,oOAAoO;IACpO,EAAE;IACF,qCAAqC;IACrC,iKAAiK;IACjK,EAAE;IACF,4CAA4C;IAC5C,2CAA2C;IAC3C,yCAAyC;IACzC,0CAA0C;IAC1C,6CAA6C;IAC7C,0DAA0D;IAC1D,sDAAsD;IACtD,8CAA8C;IAC9C,6DAA6D;IAC7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I,EAAE,2BAA2B;AACjC,IAAA,KAAK,EAAE;AACL,QAAA,OAAO,EAAE,oBAAoB;AAC7B,QAAA,OAAO,EAAE,gBAAgB;AAC1B,KAAA;AACD,IAAA,WAAW,EAAE;AACX,QAAA,OAAO,EACL,mHAAmH;AACrH,QAAA,OAAO,EACL,oGAAoG;AACvG,KAAA;AACD,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,UAAU,EAAE;QACV,gCAAgC;QAChC,uCAAuC;QACvC,yCAAyC;QACzC,uCAAuC;AACxC,KAAA;AACD,IAAA,0BAA0B,EAAE;AAC1B,QAAA,EAAE,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,kBAAkB,EAAE;AAC1D,QAAA,EAAE,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,kBAAkB,EAAE;AAC3D,KAAA;;AAGH;;ACtDA;AAKA;;ACLA;;AAEG;;"}
@@ -0,0 +1,82 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, NgModule } from '@angular/core';
3
+ import { AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';
4
+ import { AXMAiManagementModule } from '@acorex-platform/module-ai-management-client';
5
+ import { AXMPlatformManagementModule } from '@acorex-platform/module-platform-management-client';
6
+ import { AXE_APP_BUILDER_ASSIST } from '@acorex-platform/extension-ai-platform-management-client/contracts';
7
+
8
+ //#region ----- Imports -----
9
+ //#endregion
10
+ //#region ----- Modifier -----
11
+ const PLATFORM_DEFINITION_ENTITY_NAME = new RegExp(`^(${AXE_APP_BUILDER_ASSIST.platformDefinitionEntities.map((entity) => entity.name).join('|')})$`);
12
+ /**
13
+ * Marks Module Definition and Entity Definition with the App Builder Assist name.
14
+ * Runs after the platform catalog layout overlay (order 30).
15
+ */
16
+ const AXEAppBuilderAssistPlatformDefinitionModifier = {
17
+ entityName: PLATFORM_DEFINITION_ENTITY_NAME,
18
+ order: 40,
19
+ modifier: (ctx) => {
20
+ const covered = AXE_APP_BUILDER_ASSIST.platformDefinitionEntities.some((entity) => entity.module === ctx.module.get() && entity.name === ctx.name.get());
21
+ if (!covered) {
22
+ return;
23
+ }
24
+ const tags = ctx.entity.searchTags ?? [];
25
+ if (tags.includes(AXE_APP_BUILDER_ASSIST.name)) {
26
+ return;
27
+ }
28
+ ctx.entity.searchTags = [...tags, AXE_APP_BUILDER_ASSIST.name];
29
+ },
30
+ };
31
+ //#endregion
32
+
33
+ //#region ----- Imports -----
34
+ //#endregion
35
+ //#region ----- Token -----
36
+ /** App Builder Assist metadata for Platform Definition screens. */
37
+ const AXE_APP_BUILDER_ASSIST_METADATA = new InjectionToken('AXE_APP_BUILDER_ASSIST_METADATA');
38
+ //#endregion
39
+ //#region ----- Module -----
40
+ /**
41
+ * Optional AI author for Platform Definition (module and entity definitions).
42
+ * Register next to {@link AXMPlatformManagementModule} and {@link AXMAiManagementModule}.
43
+ */
44
+ class AXEAIPlatformManagementExtensionModule {
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEAIPlatformManagementExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
46
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXEAIPlatformManagementExtensionModule, imports: [AXMAiManagementModule, AXMPlatformManagementModule] }); }
47
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEAIPlatformManagementExtensionModule, providers: [
48
+ {
49
+ provide: AXE_APP_BUILDER_ASSIST_METADATA,
50
+ useValue: AXE_APP_BUILDER_ASSIST,
51
+ },
52
+ {
53
+ provide: AXP_ENTITY_MODIFIER,
54
+ useValue: AXEAppBuilderAssistPlatformDefinitionModifier,
55
+ multi: true,
56
+ },
57
+ ], imports: [AXMAiManagementModule, AXMPlatformManagementModule] }); }
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEAIPlatformManagementExtensionModule, decorators: [{
60
+ type: NgModule,
61
+ args: [{
62
+ imports: [AXMAiManagementModule, AXMPlatformManagementModule],
63
+ providers: [
64
+ {
65
+ provide: AXE_APP_BUILDER_ASSIST_METADATA,
66
+ useValue: AXE_APP_BUILDER_ASSIST,
67
+ },
68
+ {
69
+ provide: AXP_ENTITY_MODIFIER,
70
+ useValue: AXEAppBuilderAssistPlatformDefinitionModifier,
71
+ multi: true,
72
+ },
73
+ ],
74
+ }]
75
+ }] });
76
+
77
+ /**
78
+ * Generated bundle index. Do not edit.
79
+ */
80
+
81
+ export { AXEAIPlatformManagementExtensionModule, AXE_APP_BUILDER_ASSIST_METADATA };
82
+ //# sourceMappingURL=acorex-platform-extension-ai-platform-management-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-ai-platform-management-client.mjs","sources":["../../../../libs/extensions/ai/platform-management/client/src/lib/app-builder-assist-platform-definition.entity-modifier.ts","../../../../libs/extensions/ai/platform-management/client/src/lib/ai-platform-management-extension.module.ts","../../../../libs/extensions/ai/platform-management/client/src/acorex-platform-extension-ai-platform-management-client.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPEntityModifierProvider } from '@acorex-platform/framework-client/layout/entity';\nimport { AXE_APP_BUILDER_ASSIST } from '@acorex-platform/extension-ai-platform-management-client/contracts';\n\n//#endregion\n\n//#region ----- Modifier -----\n\nconst PLATFORM_DEFINITION_ENTITY_NAME = new RegExp(\n `^(${AXE_APP_BUILDER_ASSIST.platformDefinitionEntities.map((entity) => entity.name).join('|')})$`,\n);\n\n/**\n * Marks Module Definition and Entity Definition with the App Builder Assist name.\n * Runs after the platform catalog layout overlay (order 30).\n */\nexport const AXEAppBuilderAssistPlatformDefinitionModifier: AXPEntityModifierProvider = {\n entityName: PLATFORM_DEFINITION_ENTITY_NAME,\n order: 40,\n modifier: (ctx) => {\n const covered = AXE_APP_BUILDER_ASSIST.platformDefinitionEntities.some(\n (entity) => entity.module === ctx.module.get() && entity.name === ctx.name.get(),\n );\n if (!covered) {\n return;\n }\n\n const tags = ctx.entity.searchTags ?? [];\n if (tags.includes(AXE_APP_BUILDER_ASSIST.name)) {\n return;\n }\n ctx.entity.searchTags = [...tags, AXE_APP_BUILDER_ASSIST.name];\n },\n};\n\n//#endregion\n","//#region ----- Imports -----\n\nimport { InjectionToken, NgModule } from '@angular/core';\nimport { AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';\nimport { AXMAiManagementModule } from '@acorex-platform/module-ai-management-client';\nimport { AXMPlatformManagementModule } from '@acorex-platform/module-platform-management-client';\nimport { AXE_APP_BUILDER_ASSIST } from '@acorex-platform/extension-ai-platform-management-client/contracts';\n\nimport { AXEAppBuilderAssistPlatformDefinitionModifier } from './app-builder-assist-platform-definition.entity-modifier';\n\n//#endregion\n\n//#region ----- Token -----\n\n/** App Builder Assist metadata for Platform Definition screens. */\nexport const AXE_APP_BUILDER_ASSIST_METADATA = new InjectionToken<typeof AXE_APP_BUILDER_ASSIST>(\n 'AXE_APP_BUILDER_ASSIST_METADATA',\n);\n\n//#endregion\n\n//#region ----- Module -----\n\n/**\n * Optional AI author for Platform Definition (module and entity definitions).\n * Register next to {@link AXMPlatformManagementModule} and {@link AXMAiManagementModule}.\n */\n@NgModule({\n imports: [AXMAiManagementModule, AXMPlatformManagementModule],\n providers: [\n {\n provide: AXE_APP_BUILDER_ASSIST_METADATA,\n useValue: AXE_APP_BUILDER_ASSIST,\n },\n {\n provide: AXP_ENTITY_MODIFIER,\n useValue: AXEAppBuilderAssistPlatformDefinitionModifier,\n multi: true,\n },\n ],\n})\nexport class AXEAIPlatformManagementExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AAKA;AAEA;AAEA,MAAM,+BAA+B,GAAG,IAAI,MAAM,CAChD,CAAA,EAAA,EAAK,sB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AA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sCAAsC,EAAA,SAAA,EAZtC;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,+BAA+B;AACxC,gBAAA,QAAQ,EAAE,sBAAsB;AACjC,aAAA;AACD,YAAA;AACE,gBAAA,OAAO,EAAE,mBAAmB;AAC5B,gBAAA,QAAQ,EAAE,6CAA6C;AACvD,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;SACF,EAAA,OAAA,EAAA,CAXS,qBAAqB,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;;2FAajD,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBAdlD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,2BAA2B,CAAC;AAC7D,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,+BAA+B;AACxC,4BAAA,QAAQ,EAAE,sBAAsB;AACjC,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,mBAAmB;AAC5B,4BAAA,QAAQ,EAAE,6CAA6C;AACvD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACxCD;;AAEG;;"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@acorex-platform/extension-ai-platform-management-client",
3
+ "version": "0.0.46",
4
+ "sideEffects": false,
5
+ "peerDependencies": {
6
+ "@angular/common": "^21.0.0 || ^22.0.0",
7
+ "@angular/core": "^21.0.0 || ^22.0.0"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "^2.3.0"
11
+ },
12
+ "module": "fesm2022/acorex-platform-extension-ai-platform-management-client.mjs",
13
+ "typings": "types/acorex-platform-extension-ai-platform-management-client.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/acorex-platform-extension-ai-platform-management-client.d.ts",
20
+ "default": "./fesm2022/acorex-platform-extension-ai-platform-management-client.mjs"
21
+ },
22
+ "./contracts": {
23
+ "types": "./types/acorex-platform-extension-ai-platform-management-client-contracts.d.ts",
24
+ "default": "./fesm2022/acorex-platform-extension-ai-platform-management-client-contracts.mjs"
25
+ }
26
+ },
27
+ "type": "module"
28
+ }
@@ -0,0 +1,55 @@
1
+ /** Stable `AiManagement.Assist` id for the platform-definition author. */
2
+ declare const AXE_APP_BUILDER_ASSIST_ID = "b0000001-0000-4000-8000-000000000005";
3
+ /** Programmatic assist name (`AiManagement.Assist.name`). */
4
+ declare const AXE_APP_BUILDER_ASSIST_NAME = "app-builder-assist";
5
+ /**
6
+ * App Builder Assist metadata for Platform Definition.
7
+ * Entity names match `PlatformManagement` `ModuleDefinition` and `EntityDefinition`.
8
+ * Playbooks: reuse-platform-definition, write-module-definition, compose-axp-entity, write-entity-definition.
9
+ */
10
+ declare const AXE_APP_BUILDER_ASSIST: {
11
+ readonly id: "b0000001-0000-4000-8000-000000000005";
12
+ readonly name: "app-builder-assist";
13
+ readonly title: {
14
+ readonly 'en-US': "App Builder Assist";
15
+ readonly 'fa-IR': "دستیار ساخت اپ";
16
+ };
17
+ readonly description: {
18
+ readonly 'en-US': "Authors module and entity definitions in Platform Definition, and reuses modules and entities that already exist.";
19
+ readonly 'fa-IR': "تعریف ماژول و موجودیت را در Platform Definition می‌سازد و از ماژول و موجودیت موجود استفاده می‌کند.";
20
+ };
21
+ readonly planningMode: "off";
22
+ readonly skillNames: readonly ["reuse-platform-definition", "write-module-definition", "compose-axp-entity", "write-entity-definition"];
23
+ readonly platformDefinitionEntities: readonly [{
24
+ readonly module: "PlatformManagement";
25
+ readonly name: "ModuleDefinition";
26
+ }, {
27
+ readonly module: "PlatformManagement";
28
+ readonly name: "EntityDefinition";
29
+ }];
30
+ };
31
+
32
+ declare const AXE_APP_BUILDER_SKILL_REUSE_NAME = "reuse-platform-definition";
33
+
34
+ declare const AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME = "compose-axp-entity";
35
+
36
+ declare const AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME = "write-entity-definition";
37
+
38
+ declare const AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME = "write-module-definition";
39
+
40
+ /** Playbooks attached to `app-builder-assist`. Seeded as `AiManagement.Skill` rows. */
41
+ declare const AXE_APP_BUILDER_SKILL_ROWS: {
42
+ id: string;
43
+ name: string;
44
+ title: {
45
+ 'en-US': string;
46
+ 'fa-IR': string;
47
+ };
48
+ description: {
49
+ 'en-US': string;
50
+ 'fa-IR': string;
51
+ };
52
+ markdown: string;
53
+ }[];
54
+
55
+ export { AXE_APP_BUILDER_ASSIST, AXE_APP_BUILDER_ASSIST_ID, AXE_APP_BUILDER_ASSIST_NAME, AXE_APP_BUILDER_SKILL_COMPOSE_ENTITY_NAME, AXE_APP_BUILDER_SKILL_REUSE_NAME, AXE_APP_BUILDER_SKILL_ROWS, AXE_APP_BUILDER_SKILL_WRITE_ENTITY_NAME, AXE_APP_BUILDER_SKILL_WRITE_MODULE_NAME };
@@ -0,0 +1,38 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken } from '@angular/core';
3
+ import * as i1 from '@acorex-platform/module-ai-management-client';
4
+ import * as i2 from '@acorex-platform/module-platform-management-client';
5
+
6
+ /** App Builder Assist metadata for Platform Definition screens. */
7
+ declare const AXE_APP_BUILDER_ASSIST_METADATA: InjectionToken<{
8
+ readonly id: "b0000001-0000-4000-8000-000000000005";
9
+ readonly name: "app-builder-assist";
10
+ readonly title: {
11
+ readonly "en-US": "App Builder Assist";
12
+ readonly "fa-IR": "\u062F\u0633\u062A\u06CC\u0627\u0631 \u0633\u0627\u062E\u062A \u0627\u067E";
13
+ };
14
+ readonly description: {
15
+ readonly "en-US": "Authors module and entity definitions in Platform Definition, and reuses modules and entities that already exist.";
16
+ readonly "fa-IR": "\u062A\u0639\u0631\u06CC\u0641 \u0645\u0627\u0698\u0648\u0644 \u0648 \u0645\u0648\u062C\u0648\u062F\u06CC\u062A \u0631\u0627 \u062F\u0631 Platform Definition \u0645\u06CC\u200C\u0633\u0627\u0632\u062F \u0648 \u0627\u0632 \u0645\u0627\u0698\u0648\u0644 \u0648 \u0645\u0648\u062C\u0648\u062F\u06CC\u062A \u0645\u0648\u062C\u0648\u062F \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0645\u06CC\u200C\u06A9\u0646\u062F.";
17
+ };
18
+ readonly planningMode: "off";
19
+ readonly skillNames: readonly ["reuse-platform-definition", "write-module-definition", "compose-axp-entity", "write-entity-definition"];
20
+ readonly platformDefinitionEntities: readonly [{
21
+ readonly module: "PlatformManagement";
22
+ readonly name: "ModuleDefinition";
23
+ }, {
24
+ readonly module: "PlatformManagement";
25
+ readonly name: "EntityDefinition";
26
+ }];
27
+ }>;
28
+ /**
29
+ * Optional AI author for Platform Definition (module and entity definitions).
30
+ * Register next to {@link AXMPlatformManagementModule} and {@link AXMAiManagementModule}.
31
+ */
32
+ declare class AXEAIPlatformManagementExtensionModule {
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEAIPlatformManagementExtensionModule, never>;
34
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXEAIPlatformManagementExtensionModule, never, [typeof i1.AXMAiManagementModule, typeof i2.AXMPlatformManagementModule], never>;
35
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXEAIPlatformManagementExtensionModule>;
36
+ }
37
+
38
+ export { AXEAIPlatformManagementExtensionModule, AXE_APP_BUILDER_ASSIST_METADATA };