agent-generator 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.vscodeignore ADDED
@@ -0,0 +1,6 @@
1
+ .git
2
+ .gitignore
3
+ node_modules
4
+ .vscode-test
5
+ *.vsix
6
+ .npm-global
@@ -0,0 +1,84 @@
1
+ # CONDITIONAL Generator — Rule-Based Data Selection
2
+
3
+ ---
4
+
5
+ ## Overview
6
+
7
+ A **Conditional Generator** selects a data generator based on predefined conditions. It enables dynamic test data generation by evaluating input values or context and branching to different generator logic accordingly.
8
+
9
+ ---
10
+
11
+ ## When to Use
12
+
13
+ - When the value of a parameter depends on other input values or request context.
14
+ - To implement business rules, feature flags, or scenario-specific data.
15
+ - For fallback/default logic when no condition matches.
16
+
17
+ ---
18
+
19
+ ## Structure
20
+
21
+ A conditional generator contains:
22
+ - `type`: Must be `"conditional"`
23
+ - `conditions`: List of condition objects, each with:
24
+ - `when`: The condition to evaluate (key, operator, value)
25
+ - `then`: The generator or value to use if the condition matches
26
+ - `else`: (optional) The generator or value to use if no conditions match
27
+
28
+ ---
29
+
30
+ ## Example
31
+
32
+ ```json
33
+ {
34
+ "generators": {
35
+ "snippet_id": [
36
+ {
37
+ "type": "conditional",
38
+ "conditions": [
39
+ {
40
+ "when": {
41
+ "key": "$.input.query:modules",
42
+ "equals": "tickets"
43
+ },
44
+ "then": {
45
+ "use": "$generators:#/generators/ticket_id"
46
+ }
47
+ },
48
+ {
49
+ "when": {
50
+ "key": "$.input.query:modules",
51
+ "equals": "contacts"
52
+ },
53
+ "then": {
54
+ "use": "$generators:#/generators/contact_id"
55
+ }
56
+ }
57
+ ],
58
+ "else": "$generators:#/generators/activity_id"
59
+ }
60
+ ]
61
+ }
62
+ }
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Best Practices
68
+
69
+ - Use input-based branching: reference request path, query, or body fields in `when`.
70
+ - Reference other generators in `then` using correct relative paths or `$generators:` syntax.
71
+ - Always provide an `else` clause if possible to avoid unexpected nulls.
72
+ - Keep conditions mutually exclusive and clear.
73
+ - Avoid deeply nested or overly complex chains for readability.
74
+
75
+ ---
76
+
77
+ ## Validation Checklist
78
+
79
+ - Ensure all referenced generators exist.
80
+ - Test each condition path for expected output.
81
+
82
+ ---
83
+
84
+ *Last Updated: 17 February 2026*
@@ -0,0 +1,129 @@
1
+
2
+ # Rule: Referencing Single-Entity Dynamic Generator Dependencies
3
+
4
+ When a dynamic generator is used as a dependency for another generator (e.g., createTicket), always reference the dependency in params as $<generatorname>.value, regardless of the dataPath used in the dependency generator. This ensures the correct value is passed even if the dataPath returns an array or a single value.
5
+
6
+ **Example:**
7
+
8
+ Dependency generator:
9
+ ```json
10
+ {
11
+ "type": "dynamic",
12
+ "name": "departments",
13
+ "generatorOperationId": "support.Department.getDepartments",
14
+ "dataPath": "$.response.body:$.data[*].id"
15
+ }
16
+ ```
17
+
18
+ Dependent generator:
19
+ ```json
20
+ {
21
+ "type": "dynamic",
22
+ "name": "ticket",
23
+ "generatorOperationId": "support.Ticket.createTicket",
24
+ "params": {
25
+ "departmentId": "$departments.value"
26
+ }
27
+ }
28
+ ```
29
+
30
+ ## What It Does
31
+ A DYNAMIC Generator fetches data from real API responses.
32
+
33
+ ---
34
+
35
+ ## When to Use DYNAMIC
36
+ - When you need real system data that changes frequently (e.g., active agent IDs, current ticket IDs).
37
+ - When there is an API available to fetch the required data.
38
+
39
+ ---
40
+
41
+ ## Required Properties
42
+
43
+ | Property | Type | Purpose |
44
+ |----------|------|---------|
45
+ | `type` | string | Must be `"dynamic"` |
46
+ | `generatorOperationId` | string | Which API operation to call |
47
+ | `dataPath` | string | Where to extract data from response |
48
+
49
+ ## Optional Properties
50
+
51
+ | Property | Type | Purpose |
52
+ |----------|------|---------|
53
+ | `params` | object | Filter parameters: `{"status": "ACTIVE"}` |
54
+ | `name` | string | Generator identifier (unique label for referencing in params) |
55
+
56
+ ---
57
+
58
+ ## DataPath Format
59
+
60
+ **Pattern:** `$.response.body:$.path.to.data`
61
+
62
+ **Examples:**
63
+ - `$.response.body:$.data[0].id` - First item ID
64
+ - `$.response.body:$.data[*].id` - All item IDs
65
+ - `$.response.body:$.items[0].manager.id` - Nested field
66
+
67
+ ---
68
+
69
+ ## Examples
70
+
71
+ ### Single Result
72
+ Fetch the first matching record:
73
+ ```json
74
+ {
75
+ "type": "dynamic",
76
+ "generatorOperationId": "support.Agent.getAgents",
77
+ "dataPath": "$.response.body:$.data[0].id"
78
+ }
79
+ ```
80
+ ### With Filter Parameters
81
+ Find specific records:
82
+ ```json
83
+ {
84
+ "type": "dynamic",
85
+ "generatorOperationId": "support.Agent.getAgents",
86
+ "dataPath": "$.response.body:$.data[*].id",
87
+ "params": {"status": "ACTIVE"}
88
+ }
89
+ ```
90
+ ### Nested Field
91
+ Extract from object hierarchy:
92
+ ```json
93
+ {
94
+ "type": "dynamic",
95
+ "generatorOperationId": "support.Department.getDepartment",
96
+ "dataPath": "$.response.body:$.manager.id"
97
+ }
98
+ ```
99
+ ---
100
+
101
+ ## Best Practices
102
+
103
+ **Do:**
104
+ - Use params to filter for specific scenarios
105
+ - Give descriptive names showing the filter/status
106
+ - Verify operationId exists in OpenAPI specification
107
+
108
+ **Avoid:**
109
+ - Assuming first result is always valid
110
+ - Generic names like "id"
111
+ - Forgetting `[*]` on array parameters
112
+ - Hardcoding fallback without DYNAMIC
113
+
114
+ ---
115
+
116
+ ## Check
117
+ - operationId is spelled correctly
118
+ - dataPath matches actual response structure
119
+ - params filter isn't too strict
120
+
121
+ ## Reference
122
+ - **Fetch Method:** API operations
123
+ - **Data Type:** Real system data
124
+ - **Scope:** Cross-entity references possible
125
+ - **Updates:** Auto-syncs with system data
126
+
127
+ ---
128
+
129
+ *Last Updated: 17 February 2026*
@@ -0,0 +1,4 @@
1
+
2
+ # Path configurations for generator framework (using source folder)
3
+ GENERATOR_CONFIG_PATH=../source/api-data-generators/support/
4
+ OAS_FILE_PATH=../source/openapi-specifications/v1.0/support/
@@ -0,0 +1,118 @@
1
+ # Data Generation Framework
2
+
3
+ ## What is this?
4
+
5
+ This framework helps you generate test data for APIs defined in OpenAPI (OAS) files.
6
+
7
+ In simple words:
8
+ - You define generators in JSON.
9
+ - Generators call APIs, reuse values, and build input data.
10
+ - You can chain generators when one value depends on another.
11
+
12
+ ## What is a generator?
13
+
14
+ A generator is a small JSON step that produces data.
15
+
16
+ Examples:
17
+ - Fetch `departmentId` from an API response
18
+ - Reuse a value from request input
19
+ - Set a fixed value like `priority = "high"`
20
+
21
+ All generators must be inside the `generators` object.
22
+
23
+ Basic format:
24
+
25
+ ```json
26
+ {
27
+ "generators": {
28
+ "generator_name": [
29
+ {
30
+ "type": "..."
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ ```
36
+
37
+ ## About the Generator Agent
38
+
39
+ The Generator Agent helps developers create generator files faster and correctly.
40
+
41
+ The agent does the following:
42
+ - Reads the target operation from OAS
43
+ - Finds required dependencies from related operations
44
+ - Creates generator steps in the correct dependency order
45
+ - Uses only fields that exist in OAS (no invented params)
46
+ - Produces output in the required `generators` JSON structure
47
+
48
+ ## Where to find paths
49
+
50
+ Use `PathConfig.properties` as the source of truth:
51
+ - `GENERATOR_CONFIG_PATH` for generator file locations
52
+ - `OAS_FILE_PATH` for OpenAPI specification locations
53
+
54
+ Always use these configured paths instead of hardcoding paths.
55
+
56
+ ## Generator types
57
+
58
+ Use the right type based on your need:
59
+
60
+ | Type | Purpose | Documentation |
61
+ | --- | --- | --- |
62
+ | Dynamic | Get values from API operations | [Dynamic](./Dynamic.md) |
63
+ | Remote | Get values from system/remote helpers | [Remote](./Remote.md) |
64
+ | Static | Use fixed constant values | [Static](./Static.md) |
65
+ | Reference | Reuse existing values from input/other generators | [Reference](./Reference.md) |
66
+ | Conditional | Choose values based on conditions | [Conditional](./Conditional.md) |
67
+
68
+ ## JSONPath quick guide
69
+
70
+ Common response mapping format:
71
+
72
+ `$.location:$.path`
73
+
74
+ Examples:
75
+ - `$.data[*].id` → all ids in an array
76
+ - `$.data[0].id` → first id
77
+ - `$.manager.id` → nested value
78
+ - `$.users[?(@.active == true)].id` → filtered values
79
+
80
+ ## Developer workflow (quick)
81
+
82
+ 1. Identify the target API operation.
83
+ 2. Read the target operation in OAS.
84
+ 3. Identify dependency operations and required values.
85
+ 4. Choose proper generator types.
86
+ 5. Create a new generator file in the correct folder.
87
+ 6. Keep dependencies in order inside the same generator array.
88
+ 7. Validate all params and paths against OAS.
89
+
90
+ ## Important rules
91
+
92
+ - Use snake_case generator names.
93
+ - Keep names meaningful and short.
94
+ - Use singular for single value, plural for list values.
95
+ - Do not add fields that are not present in OAS.
96
+ - Do not modify existing generators unless explicitly requested.
97
+
98
+ ## Reference Syntax
99
+
100
+ ```
101
+ $<generatorname>.value // Generator reference
102
+ $.input.body:$.fieldName // Request body
103
+ $.input.query:$.paramName // Query parameter
104
+ $.input.path:$.pathParam // URL path
105
+ $.input.header:$.HeaderName // HTTP header
106
+ ```
107
+
108
+ ## DataPath Format
109
+
110
+ ```
111
+ $.response.body:$.data[0].id // First item ID
112
+ $.response.body:$.data[*].id // All item IDs
113
+ $.response.body:$.id // Direct ID field
114
+ $.response.body:$.manager.id // Nested field
115
+ $.response.body:$.items[?(@.status == 'active')].id // Filtered values
116
+ ```
117
+
118
+ Last updated: 23 February 2026
@@ -0,0 +1,98 @@
1
+ # REFERENCE Generator - Use Request Input Data
2
+
3
+ ## What It Does
4
+
5
+ Passes data directly from incoming request to response without modification. Extracts values from request body, query parameters, path parameters, or headers.
6
+
7
+ ---
8
+
9
+ ## When to Use REFERENCE
10
+
11
+ Use REFERENCE when:
12
+ A Reference Generator extracts data from previous API responses.- Using data from request body
13
+ - Getting values from query parameters
14
+ - Using path parameters
15
+ - Using header values
16
+ - Data comes directly from request
17
+
18
+ **Common Scenarios:**
19
+ - Pass ticket ID from request to response
20
+ - Use query parameters in operations
21
+ - Extract URL path parameters
22
+ - Forward authorization headers
23
+ - Use nested request objects
24
+
25
+ ---
26
+
27
+ ## Required Properties
28
+
29
+ | Property | Type | Purpose |
30
+ |----------|------|---------|
31
+ | `type` | string | Must be `"reference"` |
32
+ | `ref` | string | Path to request data |
33
+
34
+ ## Reference Path Format
35
+
36
+ **Pattern:** `$.input.{location}:$.{jsonPath}`
37
+
38
+ ### Location Types
39
+
40
+ | Location | Source | Example |
41
+ |----------|--------|---------|
42
+ | `$.input.body` | Request body JSON | `$.input.body:$.ticketId` |
43
+ | `$.input.query` | Query parameters | `$.input.query:$.departmentId` |
44
+ | `$.input.path` | URL path parameters | `$.input.path:$.ticketId` |
45
+ | `$.input.header` | HTTP headers | `$.input.header:$.Authorization` |
46
+
47
+ ### Path Selector Examples
48
+
49
+ | Reference | Extracts |
50
+ |-----------|----------|
51
+ | `$.input.body:$.fieldName` | Simple field from body |
52
+ | `$.input.body:$.parent.child.fieldName` | Nested field |
53
+ | `$.input.body:$.items[*].id` | All array IDs |
54
+ | `$.input.body:$.items[0].id` | First array ID |
55
+ | `$.input.query:$.parameterName` | Query parameter |
56
+ | `$.input.path:$.pathParamName` | Path parameter |
57
+ | `$.input.header:$.HeaderName` | Header value |
58
+
59
+ ---
60
+
61
+ ## Best Practices
62
+
63
+ **Do:**
64
+ - Verify request contains the fields you reference
65
+ - Use exact field names (case-sensitive)
66
+ - Use clear generator names matching source
67
+
68
+ **Avoid:**
69
+ - Referencing fields that don't exist
70
+ - Assuming request structure without docs
71
+ - Using REFERENCE for static values
72
+ - Ignoring case sensitivity
73
+
74
+ ---
75
+
76
+ ## When to Use REFERENCE
77
+
78
+ | Scenario | Use REFERENCE |
79
+ |----------|---|
80
+ | Pass-through from request | Yes |
81
+ | Get data from request | Yes |
82
+ | Fetch from database | No |
83
+ | Fixed constant | No |
84
+ | System timestamp | No |
85
+ | Logic-based value | No |
86
+
87
+ ---
88
+
89
+ ## Reference
90
+
91
+ - **Fetch Method:** Request fields
92
+ - **Data Type:** Request data (pass-through)
93
+ - **Scope:** Single request scope
94
+ - **Updates:** From request content
95
+
96
+ ---
97
+
98
+ *Last Updated: 17 February 2026*
@@ -0,0 +1,259 @@
1
+ # REMOTE Generator - Call System Functions
2
+
3
+ ## What It Does
4
+
5
+ Calls built-in system functions for timestamps, enumerations, and configuration data. Generates system-level values instead of fetching from APIs.
6
+
7
+ ---
8
+
9
+ ## When to Use REMOTE
10
+
11
+ Use REMOTE when you need:
12
+ - Current, future, or past timestamps
13
+ - Enumeration values from system
14
+ - System configuration data
15
+ - Dynamic field schemas
16
+ - Generated vs. real data
17
+
18
+ **Common Scenarios:**
19
+ - Generate timestamps (created, modified, due dates)
20
+ - Get enumeration values from system
21
+ - Retrieve custom field schemas
22
+ - Access system configurations
23
+
24
+ ---
25
+
26
+ ## Required Properties
27
+
28
+ | Property | Type | Purpose |
29
+ |----------|------|---------|
30
+ | `type` | string | Must be `"remote"` |
31
+ | `generatorMethod` | string | System function to call |
32
+ | `inputs` | object | Function parameters |
33
+
34
+
35
+ ---
36
+
37
+ ## System Methods Reference
38
+
39
+ | Method | Purpose | Use Case |
40
+ |--------|---------|----------|
41
+ | `getDateTime` | Generate timestamps | Created, modified, due dates |
42
+ | `getDynamicEnumValues` | Get enumeration values | Status, priority, type fields |
43
+ | `getCustomFieldSchema` | Get field structure | Custom field metadata |
44
+
45
+ ### Full Method Paths
46
+
47
+ Complete method paths use:
48
+ ```
49
+ applicationDriver.rpc.desk.DynamicDataProvider.methodName
50
+ ```
51
+
52
+ Examples:
53
+ - `applicationDriver.rpc.desk.DynamicDataProvider.getDateTime`
54
+ - `applicationDriver.rpc.desk.DynamicDataProvider.getDynamicEnumValues`
55
+ - `applicationDriver.rpc.desk.DynamicDataProvider.getCustomFieldSchema`
56
+
57
+ ---
58
+
59
+ ## Examples
60
+
61
+ ### Current Timestamp
62
+ For "now" timestamps:
63
+ ```json
64
+ {
65
+ "type": "remote",
66
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDateTime",
67
+ "inputs": {
68
+ "timeLine": "current",
69
+ "format": "yyyy-MM-dd'T'HH:mm:ss'Z'"
70
+ }
71
+ }
72
+ ```pport.Department.getDepartments",
73
+ "dataPath": "$.response.body:$.data[*].id"
74
+
75
+ ### Future Date
76
+ For deadlines and expiry dates:
77
+ ```json
78
+ {
79
+ "type": "remote",
80
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDateTime",
81
+ "inputs": {
82
+ "timeLine": "future",
83
+ "format": "yyyy-MM-dd'T'HH:mm:ss'Z'"
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### Enumeration Values
89
+ Get system enums:
90
+ ```json
91
+ {
92
+ "type": "remote",
93
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDynamicEnumValues",
94
+ "inputs": {
95
+ "fieldName": "priority",
96
+ "moduleName": "Ticket",
97
+ "orgId": "123"
98
+ }
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Timestamp Formats
105
+
106
+ ### Format Strings (Java SimpleDateFormat)
107
+
108
+ | Format | Example | Use Case |
109
+ |--------|---------|----------|
110
+ | `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'` | 2026-02-11T14:30:45.123Z | APIs with milliseconds |
111
+ | `yyyy-MM-dd'T'HH:mm:ss'Z'` | 2026-02-11T14:30:45Z | ISO 8601 (recommended) |
112
+ | `yyyy-MM-dd HH:mm:ss` | 2026-02-11 14:30:45 | Database format |
113
+ | `yyyy-MM-dd` | 2026-02-11 | Date only |
114
+
115
+ ### Format Components
116
+
117
+ | Symbol | Meaning | Example |
118
+ |--------|---------|---------|
119
+ | `yyyy` | 4-digit year | 2026 |
120
+ | `MM` | 2-digit month | 02 (01-12) |
121
+ | `dd` | 2-digit day | 11 (01-31) |
122
+ | `HH` | 2-digit hour | 14 (00-23) |
123
+ | `mm` | 2-digit minute | 30 (00-59) |
124
+ | `ss` | 2-digit second | 45 (00-59) |
125
+ | `SSS` | 3-digit milliseconds | 123 (000-999) |
126
+ | `'Z'` | UTC timezone (quoted) | Z |
127
+
128
+ ---
129
+
130
+ ## Timeline Values
131
+
132
+ | Value | Generates | Use Case | Example |
133
+ |-------|-----------|----------|---------|
134
+ | `current` | Now (today) | Creation timestamps | `createdAt: "2026-02-11T14:30:45Z"` |
135
+ | `future` | Later date | Deadlines, expiry | `dueDate: "2026-03-15T23:59:59Z"` |
136
+ | `past` | Earlier date | Historical data | `modifiedAt: "2026-01-10T08:00:00Z"` |
137
+
138
+ ---
139
+
140
+ ## Common Patterns
141
+
142
+ ### Multiple Timestamps
143
+ Different generators for different timestamp meanings:
144
+ ```json
145
+ "generators": {
146
+ "created_timestamp": [{
147
+ "type": "remote",
148
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDateTime",
149
+ "inputs": {
150
+ "timeLine": "past",
151
+ "format": "yyyy-MM-dd'T'HH:mm:ss'Z'"
152
+ }
153
+ }],
154
+ "modified_timestamp": [{
155
+ "type": "remote",
156
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDateTime",
157
+ "inputs": {
158
+ "timeLine": "current",
159
+ "format": "yyyy-MM-dd'T'HH:mm:ss'Z'"
160
+ }
161
+ }],
162
+ "due_date": [{
163
+ "type": "remote",
164
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDateTime",
165
+ "inputs": {
166
+ "timeLine": "future",
167
+ "format": "yyyy-MM-dd'T'HH:mm:ss'Z'"
168
+ }
169
+ }]
170
+ }
171
+ ```
172
+
173
+ ### Status Enumerations
174
+ Different enums per field:
175
+ ```json
176
+ "generators": {
177
+ "status": [{
178
+ "type": "remote",
179
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDynamicEnumValues",
180
+ "inputs": {
181
+ "fieldName": "status",
182
+ "moduleName": "Ticket"
183
+ }
184
+ }],
185
+ "priority": [{
186
+ "type": "remote",
187
+ "generatorMethod": "applicationDriver.rpc.desk.DynamicDataProvider.getDynamicEnumValues",
188
+ "inputs": {
189
+ "fieldName": "priority",
190
+ "moduleName": "Ticket"
191
+ }
192
+ }]
193
+ }
194
+ ```
195
+
196
+ ### Mixed Timestamps & Enums
197
+ Combine both in one configuration:
198
+ ```json
199
+ "generators": {
200
+ "status": [{...enum generator...}],
201
+ "priority": [{...enum generator...}],
202
+ "created_at": [{...current timestamp...}],
203
+ "due_at": [{...future timestamp...}]
204
+ }
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Best Practices
210
+
211
+ **Do:**
212
+ - Always include format for timestamps
213
+ - Use consistent format across similar fields
214
+ - Select appropriate timeline (current, future, past)
215
+ - Verify enum field names against OpenAPI spec
216
+ - Use UTC timezone (Z suffix)
217
+
218
+ **Avoid:**
219
+ - Mixing different timestamp formats per entity
220
+ - Assuming enum values without verifying
221
+ - Using hardcoded timestamps when REMOTE available
222
+ - Forgetting to quote timezone literals like `'Z'`
223
+
224
+ ---
225
+
226
+ ## Troubleshooting
227
+
228
+ ### Timestamps in Wrong Format
229
+ **Check:**
230
+ - Format string is case-sensitive
231
+ - Single quotes around literals: `'Z'` not `Z`
232
+ - No extra characters in format
233
+ - Example: `yyyy-MM-dd'T'HH:mm:ss'Z'`
234
+
235
+ ### Empty Enumeration Values
236
+ **Verify:**
237
+ - Field name is correct
238
+ - Module name is correct
239
+ - orgId matches your system
240
+ - Field exists in that module
241
+
242
+ ### System Doesn't Recognize Method
243
+ **Check:**
244
+ - Full path: `applicationDriver.rpc.desk.DynamicDataProvider.methodName`
245
+ - Method name spelled correctly
246
+ - No typos in inputs
247
+
248
+ ---
249
+
250
+ ## Reference
251
+
252
+ - **Fetch Method:** System functions
253
+ - **Data Type:** Generated values
254
+ - **Scope:** System-wide functions
255
+ - **Updates:** Generated fresh each time
256
+
257
+ ---
258
+
259
+ *Last Updated: 11 February 2026*
@@ -0,0 +1,99 @@
1
+ # STATIC Generator - Fixed Hardcoded Values
2
+
3
+ ## What It Does
4
+
5
+ Uses a fixed, predetermined value that remains constant. Simplest generator type - directly assigns a hardcoded value.
6
+
7
+ ---
8
+
9
+ ## When to Use STATIC
10
+
11
+ Use STATIC when:
12
+ - Value never changes
13
+ - Fixed enum values
14
+ - Boolean flags
15
+ - Default values
16
+ - Testing invalid values
17
+ - Tags and categories
18
+ - Version numbers
19
+
20
+ ---
21
+
22
+ ## Required Properties
23
+
24
+ | Property | Type | Purpose |
25
+ | -------- | ------ | ------------------ |
26
+ | `type` | string | Must be `"static"` |
27
+ | `value` | List[Any] | A list of predefined values |
28
+
29
+ ---
30
+
31
+ ## Supported Value Types
32
+
33
+ STATIC supports all JSON types:
34
+ `value` accepts any valid JSON type (string, number, boolean, object, array, list, or null).
35
+
36
+ ---
37
+
38
+ ## Meta Schema
39
+ ``` json
40
+ {
41
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
42
+ "type": "object",
43
+ "required": ["type", "value"],
44
+ "additionalProperties": false,
45
+ "properties": {
46
+ "type": {
47
+ "const": "static"
48
+ },
49
+ "value": true
50
+ }
51
+ }
52
+ ```
53
+ ---
54
+
55
+ ## Common Patterns
56
+
57
+
58
+ ### Common Patterns (Simplified)
59
+
60
+ - **Status Values:** Use static generators for status like "OPEN", "CLOSED", "PENDING".
61
+ - **Priority Levels:** Use static generators for priority like "CRITICAL", "HIGH", "LOW".
62
+ - **Boolean Flags:** Use static generators for true/false, e.g., `is_active: true`, `is_deleted: false`.
63
+ - **Tags/Arrays:** Use static arrays, e.g., `["urgent", "escalated"]`, `["read", "write"]`.
64
+ - **Error Testing:** Provide both valid and invalid static values for testing, e.g., `"OPEN"`, `"INVALID_STATUS"`.
65
+ - **Custom Fields:** Use static objects for custom fields, e.g., `{ "field_100": "Support", "field_101": "North America" }`.
66
+
67
+ ---
68
+
69
+ ## Type Mapping
70
+
71
+ ### Type Mapping (Simplified)
72
+
73
+ - **string:** "OPEN"
74
+ - **integer:** 42
75
+ - **number:** 99.99
76
+ - **boolean:** true / false
77
+ - **array:** ["a", "b"]
78
+ - **object:** {"key": "value"}
79
+ - **null:** null
80
+
81
+ ---
82
+
83
+ ## Best Practices
84
+
85
+ **Do:**
86
+ - Use descriptive names
87
+ - Match value type to OpenAPI spec
88
+ - Create valid AND invalid variants for testing
89
+ - Comment complex object structures
90
+
91
+ **Avoid:**
92
+ - Using STATIC for changing values
93
+ - Using STATIC for timestamps
94
+ - Using STATIC for request data
95
+ - Generic names like "value"
96
+
97
+ ---
98
+
99
+ *Last Updated: 16 February 2026*
Binary file
Binary file
@@ -1,104 +1,47 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ const { execSync } = require('child_process');
3
4
  const fs = require('fs');
4
5
  const path = require('path');
5
- const os = require('os');
6
6
 
7
7
  try {
8
- // Determine VS Code extensions directory based on OS
9
- const homeDir = os.homedir();
10
- let extensionsDir;
11
-
12
- if (process.platform === 'win32') {
13
- extensionsDir = path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'extensions');
14
- } else if (process.platform === 'darwin') {
15
- extensionsDir = path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'extensions');
16
- } else {
17
- // Linux
18
- extensionsDir = path.join(homeDir, '.vscode', 'extensions');
19
- }
20
-
21
- // Read version from package.json dynamically
8
+ // Find the VSIX file in the package directory
22
9
  const packageJson = require(path.join(__dirname, 'package.json'));
23
- const extensionName = `${packageJson.name}-${packageJson.version}`;
24
- const targetDir = path.join(extensionsDir, extensionName);
25
-
26
- // Check if extensions directory exists, create if not
27
- if (!fs.existsSync(extensionsDir)) {
28
- console.log(`Creating VS Code extensions directory at ${extensionsDir}`);
29
- fs.mkdirSync(extensionsDir, { recursive: true });
30
- }
10
+ const vsixFile = path.join(__dirname, `${packageJson.name}-${packageJson.version}.vsix`);
31
11
 
32
- // Create extension directory if it doesn't exist
33
- if (!fs.existsSync(targetDir)) {
34
- fs.mkdirSync(targetDir, { recursive: true });
12
+ if (!fs.existsSync(vsixFile)) {
13
+ console.error('❌ VSIX file not found:', vsixFile);
14
+ console.log('Please ensure the extension is packaged correctly.');
15
+ process.exit(1);
35
16
  }
36
17
 
37
- // Copy extension files
38
- const filesToCopy = ['main.js', 'package.json', '.agents', '.github'];
39
- const currentDir = __dirname;
18
+ console.log('📦 Installing Generator Agent extension...');
19
+ console.log('');
40
20
 
41
- filesToCopy.forEach(file => {
42
- const src = path.join(currentDir, file);
43
- const dest = path.join(targetDir, file);
21
+ // Install the VSIX file using VS Code CLI
22
+ try {
23
+ execSync(`code --install-extension "${vsixFile}"`, { stdio: 'inherit' });
44
24
 
45
- if (fs.existsSync(src)) {
46
- if (fs.statSync(src).isDirectory()) {
47
- copyDir(src, dest);
48
- } else {
49
- fs.copyFileSync(src, dest);
50
- }
51
- }
52
- });
53
-
54
- // Also create package.json metadata file
55
- const packageMetadata = {
56
- name: packageJson.name,
57
- version: packageJson.version,
58
- engines: packageJson.engines,
59
- activationEvents: packageJson.activationEvents,
60
- contributes: packageJson.contributes,
61
- main: packageJson.main,
62
- displayName: packageJson.displayName,
63
- description: packageJson.description,
64
- publisher: packageJson.publisher
65
- };
66
-
67
- fs.writeFileSync(
68
- path.join(targetDir, 'package.json'),
69
- JSON.stringify(packageMetadata, null, 2)
70
- );
71
-
72
- console.log('');
73
- console.log('✅ Generator Agent installed successfully!');
74
- console.log(`📁 Location: ${targetDir}`);
75
- console.log('');
76
- console.log('🔄 Next steps:');
77
- console.log('1. Restart VS Code (Ctrl+Shift+P → "Reload Window")');
78
- console.log('2. Open GitHub Copilot Chat (Ctrl+Shift+/)');
79
- console.log('3. Look for @generators agent in the agent list');
80
- console.log('');
25
+ console.log('');
26
+ console.log('✅ Generator Agent installed successfully!');
27
+ console.log('');
28
+ console.log('🔄 Next steps:');
29
+ console.log('1. Completely close and restart VS Code (not just reload)');
30
+ console.log('2. Open GitHub Copilot Chat (Ctrl+Shift+/ or Cmd+Shift+/)');
31
+ console.log('3. Look for @generators agent in the chat interface');
32
+ console.log('');
33
+ } catch (installError) {
34
+ console.log('');
35
+ console.log('⚠️ Automatic installation failed. Please install manually:');
36
+ console.log('');
37
+ console.log('Run this command:');
38
+ console.log(` code --install-extension "${vsixFile}"`);
39
+ console.log('');
40
+ console.log('Then restart VS Code completely.');
41
+ console.log('');
42
+ }
81
43
 
82
44
  } catch (error) {
83
45
  console.error('❌ Error installing Generator Agent:', error.message);
84
46
  process.exit(1);
85
47
  }
86
-
87
- // Helper function to recursively copy directories
88
- function copyDir(src, dest) {
89
- if (!fs.existsSync(dest)) {
90
- fs.mkdirSync(dest, { recursive: true });
91
- }
92
-
93
- const files = fs.readdirSync(src);
94
- files.forEach(file => {
95
- const srcFile = path.join(src, file);
96
- const destFile = path.join(dest, file);
97
-
98
- if (fs.statSync(srcFile).isDirectory()) {
99
- copyDir(srcFile, destFile);
100
- } else {
101
- fs.copyFileSync(srcFile, destFile);
102
- }
103
- });
104
- }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "agent-generator",
3
3
  "displayName": "Generator Agent",
4
4
  "description": "A Copilot Agent for conditional rule-based data generation",
5
- "version": "1.0.6",
5
+ "version": "1.0.7",
6
6
  "publisher": "IshwaryaRamesh",
7
7
  "engines": {
8
8
  "vscode": "^1.80.0"
@@ -44,12 +44,6 @@
44
44
  "bin": {
45
45
  "agent-generator": "install-extension.js"
46
46
  },
47
- "files": [
48
- "main.js",
49
- "install-extension.js",
50
- ".agents",
51
- ".github"
52
- ],
53
47
  "devDependencies": {
54
48
  "@types/vscode": "^1.80.0",
55
49
  "@vscode/vsce": "^2.32.0"
File without changes
File without changes
File without changes