@inizioevoke/veeva-astroclm-core 1.0.6 → 1.0.8
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.
|
@@ -6,6 +6,7 @@ description: >
|
|
|
6
6
|
presentation, or run the veeva-config-manager. Also trigger when the user says things like
|
|
7
7
|
"set up the config", "create the config file", "initialize the presentation config",
|
|
8
8
|
"sync the config", "check the config", or "update the slides in the config".
|
|
9
|
+
allowed-tools: AskUserQuestion
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
# Veeva Config Manager
|
|
@@ -4,13 +4,30 @@ Interactively collect presentation metadata from the user and write a
|
|
|
4
4
|
`veeva-config.ts` file to the project root, replicating the flow in
|
|
5
5
|
`src/apps/veeva-config-manager/create.ts`.
|
|
6
6
|
|
|
7
|
+
## Before you start
|
|
8
|
+
|
|
9
|
+
Check whether `veeva-config.ts` already exists in the project root. If it does, ask the user how to proceed:
|
|
10
|
+
- **Overwrite** — discard the existing file and continue with this skill
|
|
11
|
+
- **Update instead** — stop this skill and run the manage skill (`manage.md`) to sync slides with `src/pages/`
|
|
12
|
+
- **Abort** — stop without making changes
|
|
13
|
+
|
|
14
|
+
Do not proceed with collecting input until the user confirms overwrite.
|
|
15
|
+
|
|
16
|
+
## Clean input rule
|
|
17
|
+
|
|
18
|
+
Before using any free-text value (product name, presentation name, presentation ID) in the output: `.trim()` and replace runs of two or more spaces with a single space. Do not otherwise transform user input. This rule is referenced from the input-collection and ID-generation steps below.
|
|
19
|
+
|
|
7
20
|
## What you need from the user
|
|
8
21
|
|
|
9
|
-
Tell the user that some information is required to generate the config file. Gather **all** of the following before writing any files.
|
|
22
|
+
Tell the user that some information is required to generate the config file. Gather **all** of the following before writing any files.
|
|
23
|
+
|
|
24
|
+
Ask the free-text questions one at a time (steps 1–2). The predefined-option questions in step 3 are batched into a single `AskUserQuestion` call — that's intentional, since `AskUserQuestion` natively supports multiple questions per call.
|
|
25
|
+
|
|
26
|
+
Apply the [Clean input rule](#clean-input-rule) to every free-text value as you receive it.
|
|
10
27
|
|
|
11
|
-
1. Ask for the `Product name` and `Presentation name`
|
|
12
|
-
2. Ask for the `
|
|
13
|
-
3. Call `AskUserQuestion` with
|
|
28
|
+
1. Ask for the `Product name` and `Presentation name` (one at a time).
|
|
29
|
+
2. Ask for the `Presentation ID`. Suggest a value derived from the cleaned `Presentation name`: lowercased, with any non-alphanumeric character replaced by `_`. Ask the user to confirm or enter a new value.
|
|
30
|
+
3. Call `AskUserQuestion` with one call containing the following questions in order. Set `multiSelect: true` only on **Disable**; the other three are single-select.
|
|
14
31
|
- **Dimensions**
|
|
15
32
|
- Question: Select the IVA dimensions
|
|
16
33
|
- Options: `1024 × 768`, `1366 × 1024` *(default)*, `1376 × 1032`
|
|
@@ -18,31 +35,34 @@ Tell the user that some information is required to generate the config file. Gat
|
|
|
18
35
|
- Question: Select the iOS resolution
|
|
19
36
|
- Options: `Default For Device` *(default)*, `Scale To Fit`, `Scale To 1024x768`
|
|
20
37
|
- **Disable**
|
|
21
|
-
- Question: Select any Veeva features to disable
|
|
22
|
-
- Options:
|
|
38
|
+
- Question: Select any Veeva features to disable globally (multi-select)
|
|
39
|
+
- Options: `History Buttons`, `Navigation Bar`, `Reactions`, `Swipe`
|
|
23
40
|
- **Platform**
|
|
24
41
|
- Question: Select the target Veeva platform
|
|
25
42
|
- Options: `Salesforce` *(default)*, `Vault`
|
|
26
43
|
|
|
44
|
+
For the **Dimensions** answer, split the selected option on `×` and trim each side to get the numeric width and height (e.g. `1366 × 1024` → width `1366`, height `1024`).
|
|
45
|
+
|
|
27
46
|
### Preferred collection strategy
|
|
28
47
|
|
|
29
48
|
1. **Try `AskUserQuestion` first** for all fields with predefined options.
|
|
30
49
|
|
|
31
50
|
2. **Fall back to conversational** for any field if `AskUserQuestion` is
|
|
32
|
-
unavailable or the call fails. List the options in
|
|
51
|
+
unavailable or the call fails. List the options in a numbered list so the user can reply with a number rather than the full option text.
|
|
33
52
|
|
|
34
53
|
### Exceptions
|
|
35
54
|
|
|
36
|
-
If `Other` is selected for `
|
|
55
|
+
If `Other` is selected for `Dimensions`, `Resolution`, or `Platform`, reject the response and re-prompt the user asking them to choose only from the defined values.
|
|
37
56
|
|
|
38
|
-
If `Other` is selected for `
|
|
57
|
+
If `Other` is selected for `Disable`, ask the user which additional actions they want to disable. The only accepted values beyond the listed four are: `Pinch to Exit`, `Rotation Lock`, `Zoom`. Accept any combination of these. If the user enters anything else, reject and re-prompt with this list.
|
|
39
58
|
|
|
40
59
|
## Generating IDs
|
|
41
60
|
|
|
42
61
|
You will need two kinds of random IDs. Implement them inline with JavaScript/TypeScript logic or generate them yourself:
|
|
43
62
|
|
|
44
|
-
- **External ID prefix**: First 3 chars of `product` (uppercased) + `_` + an 8-char alphanumeric random string (uppercase A–Z, 0–9).
|
|
63
|
+
- **External ID prefix**: First 3 chars of `product` (uppercased) + `_` + an 8-char alphanumeric random string (uppercase A–Z, 0–9). If the cleaned product name is shorter than 3 chars, right-pad with `_` to reach 3 chars before uppercasing.
|
|
45
64
|
Example: product `Velorixin` → `VEL_3K9BW12X`
|
|
65
|
+
Example: product `Ox` → `OX__3K9BW12X`
|
|
46
66
|
- **Per-slide ID**: An independent 8-char alphanumeric random string for each slide, unique within the set.
|
|
47
67
|
|
|
48
68
|
To generate an 8-char random-ish ID in a bash snippet you can run:
|
|
@@ -53,11 +73,7 @@ Or generate them yourself — just make them look like `3K9BW12X` (8 uppercase a
|
|
|
53
73
|
|
|
54
74
|
## Discovering slides
|
|
55
75
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
ls src/pages/*.astro 2>/dev/null
|
|
60
|
-
```
|
|
76
|
+
Use the Glob tool with the pattern `src/pages/*.astro` to list all slide pages. (Glob is platform-agnostic — prefer it over `ls`, which is unreliable on Windows.)
|
|
61
77
|
|
|
62
78
|
For each file `some-page-name.astro`:
|
|
63
79
|
- `path` = filename without `.astro` extension (e.g. `some-page-name`)
|
|
@@ -66,8 +82,7 @@ For each file `some-page-name.astro`:
|
|
|
66
82
|
|
|
67
83
|
## Output format
|
|
68
84
|
|
|
69
|
-
Write `veeva-config.ts` to the **project root** using exactly this template
|
|
70
|
-
(replace all `##...##` tokens with the collected/generated values):
|
|
85
|
+
Write `veeva-config.ts` to the **project root** using exactly this template. Replace every `##...##` token with the collected/generated value, but **leave all `${...}` template-literal expressions exactly as written** — those are TypeScript that runs at runtime, not placeholders for you to substitute. Do not modify the imports, the function signature, or the `binderFields` block.
|
|
71
86
|
|
|
72
87
|
```ts
|
|
73
88
|
import type { IVeevaClmBinderFields, IVeevaConfig, VeevaEnv } from "@inizioevoke/veeva-astroclm-core/types";
|
|
@@ -160,11 +175,6 @@ export default function ({ veevaEnv = 'client', isTraining = false }: IVeevaConf
|
|
|
160
175
|
}]
|
|
161
176
|
```
|
|
162
177
|
|
|
163
|
-
## "Clean input" rule
|
|
164
|
-
|
|
165
|
-
Before using any free-text value in the output: `.trim()` and replace runs of
|
|
166
|
-
two or more spaces with a single space. Do not otherwise transform user input.
|
|
167
|
-
|
|
168
178
|
## After writing the file
|
|
169
179
|
|
|
170
180
|
Tell the user where the file was written (`veeva-config.ts` in the project
|