nowaikit 2.6.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +89 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/direct/executor.d.ts +28 -0
- package/dist/direct/executor.d.ts.map +1 -0
- package/dist/direct/executor.js +228 -0
- package/dist/direct/executor.js.map +1 -0
- package/dist/direct/llm-client.d.ts +32 -0
- package/dist/direct/llm-client.d.ts.map +1 -0
- package/dist/direct/llm-client.js +122 -0
- package/dist/direct/llm-client.js.map +1 -0
- package/dist/prompts/capabilities/build-app.d.ts +4 -0
- package/dist/prompts/capabilities/build-app.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-app.js +238 -0
- package/dist/prompts/capabilities/build-app.js.map +1 -0
- package/dist/prompts/capabilities/build-business-rule.d.ts +4 -0
- package/dist/prompts/capabilities/build-business-rule.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-business-rule.js +93 -0
- package/dist/prompts/capabilities/build-business-rule.js.map +1 -0
- package/dist/prompts/capabilities/build-catalog.d.ts +4 -0
- package/dist/prompts/capabilities/build-catalog.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-catalog.js +350 -0
- package/dist/prompts/capabilities/build-catalog.js.map +1 -0
- package/dist/prompts/capabilities/build-client-script.d.ts +4 -0
- package/dist/prompts/capabilities/build-client-script.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-client-script.js +157 -0
- package/dist/prompts/capabilities/build-client-script.js.map +1 -0
- package/dist/prompts/capabilities/build-flow.d.ts +4 -0
- package/dist/prompts/capabilities/build-flow.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-flow.js +243 -0
- package/dist/prompts/capabilities/build-flow.js.map +1 -0
- package/dist/prompts/capabilities/build-portal.d.ts +4 -0
- package/dist/prompts/capabilities/build-portal.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-portal.js +250 -0
- package/dist/prompts/capabilities/build-portal.js.map +1 -0
- package/dist/prompts/capabilities/build-rest-api.d.ts +4 -0
- package/dist/prompts/capabilities/build-rest-api.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-rest-api.js +293 -0
- package/dist/prompts/capabilities/build-rest-api.js.map +1 -0
- package/dist/prompts/capabilities/build-test-plan.d.ts +4 -0
- package/dist/prompts/capabilities/build-test-plan.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-test-plan.js +162 -0
- package/dist/prompts/capabilities/build-test-plan.js.map +1 -0
- package/dist/prompts/capabilities/build-uib.d.ts +4 -0
- package/dist/prompts/capabilities/build-uib.d.ts.map +1 -0
- package/dist/prompts/capabilities/build-uib.js +309 -0
- package/dist/prompts/capabilities/build-uib.js.map +1 -0
- package/dist/prompts/capabilities/docs-app.d.ts +4 -0
- package/dist/prompts/capabilities/docs-app.d.ts.map +1 -0
- package/dist/prompts/capabilities/docs-app.js +234 -0
- package/dist/prompts/capabilities/docs-app.js.map +1 -0
- package/dist/prompts/capabilities/docs-release.d.ts +4 -0
- package/dist/prompts/capabilities/docs-release.d.ts.map +1 -0
- package/dist/prompts/capabilities/docs-release.js +197 -0
- package/dist/prompts/capabilities/docs-release.js.map +1 -0
- package/dist/prompts/capabilities/docs-runbook.d.ts +4 -0
- package/dist/prompts/capabilities/docs-runbook.d.ts.map +1 -0
- package/dist/prompts/capabilities/docs-runbook.js +223 -0
- package/dist/prompts/capabilities/docs-runbook.js.map +1 -0
- package/dist/prompts/capabilities/docs-script.d.ts +4 -0
- package/dist/prompts/capabilities/docs-script.d.ts.map +1 -0
- package/dist/prompts/capabilities/docs-script.js +242 -0
- package/dist/prompts/capabilities/docs-script.js.map +1 -0
- package/dist/prompts/capabilities/ops-deploy.d.ts +4 -0
- package/dist/prompts/capabilities/ops-deploy.d.ts.map +1 -0
- package/dist/prompts/capabilities/ops-deploy.js +193 -0
- package/dist/prompts/capabilities/ops-deploy.js.map +1 -0
- package/dist/prompts/capabilities/ops-risk.d.ts +4 -0
- package/dist/prompts/capabilities/ops-risk.d.ts.map +1 -0
- package/dist/prompts/capabilities/ops-risk.js +227 -0
- package/dist/prompts/capabilities/ops-risk.js.map +1 -0
- package/dist/prompts/capabilities/ops-triage.d.ts +4 -0
- package/dist/prompts/capabilities/ops-triage.d.ts.map +1 -0
- package/dist/prompts/capabilities/ops-triage.js +183 -0
- package/dist/prompts/capabilities/ops-triage.js.map +1 -0
- package/dist/prompts/capabilities/review-acls.d.ts +4 -0
- package/dist/prompts/capabilities/review-acls.d.ts.map +1 -0
- package/dist/prompts/capabilities/review-acls.js +142 -0
- package/dist/prompts/capabilities/review-acls.js.map +1 -0
- package/dist/prompts/capabilities/review-code.d.ts +4 -0
- package/dist/prompts/capabilities/review-code.d.ts.map +1 -0
- package/dist/prompts/capabilities/review-code.js +155 -0
- package/dist/prompts/capabilities/review-code.js.map +1 -0
- package/dist/prompts/capabilities/review-flows.d.ts +4 -0
- package/dist/prompts/capabilities/review-flows.d.ts.map +1 -0
- package/dist/prompts/capabilities/review-flows.js +413 -0
- package/dist/prompts/capabilities/review-flows.js.map +1 -0
- package/dist/prompts/capabilities/review-scripts.d.ts +4 -0
- package/dist/prompts/capabilities/review-scripts.d.ts.map +1 -0
- package/dist/prompts/capabilities/review-scripts.js +160 -0
- package/dist/prompts/capabilities/review-scripts.js.map +1 -0
- package/dist/prompts/capabilities/scan-automation.d.ts +4 -0
- package/dist/prompts/capabilities/scan-automation.d.ts.map +1 -0
- package/dist/prompts/capabilities/scan-automation.js +449 -0
- package/dist/prompts/capabilities/scan-automation.js.map +1 -0
- package/dist/prompts/capabilities/scan-cmdb.d.ts +4 -0
- package/dist/prompts/capabilities/scan-cmdb.d.ts.map +1 -0
- package/dist/prompts/capabilities/scan-cmdb.js +450 -0
- package/dist/prompts/capabilities/scan-cmdb.js.map +1 -0
- package/dist/prompts/capabilities/scan-debt.d.ts +4 -0
- package/dist/prompts/capabilities/scan-debt.d.ts.map +1 -0
- package/dist/prompts/capabilities/scan-debt.js +287 -0
- package/dist/prompts/capabilities/scan-debt.js.map +1 -0
- package/dist/prompts/capabilities/scan-health.d.ts +4 -0
- package/dist/prompts/capabilities/scan-health.d.ts.map +1 -0
- package/dist/prompts/capabilities/scan-health.js +235 -0
- package/dist/prompts/capabilities/scan-health.js.map +1 -0
- package/dist/prompts/capabilities/scan-security.d.ts +4 -0
- package/dist/prompts/capabilities/scan-security.d.ts.map +1 -0
- package/dist/prompts/capabilities/scan-security.js +370 -0
- package/dist/prompts/capabilities/scan-security.js.map +1 -0
- package/dist/prompts/capabilities/scan-upgrade.d.ts +4 -0
- package/dist/prompts/capabilities/scan-upgrade.d.ts.map +1 -0
- package/dist/prompts/capabilities/scan-upgrade.js +327 -0
- package/dist/prompts/capabilities/scan-upgrade.js.map +1 -0
- package/dist/prompts/index.d.ts +24 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +160 -14
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/knowledge.d.ts +10 -0
- package/dist/prompts/knowledge.d.ts.map +1 -0
- package/dist/prompts/knowledge.js +604 -0
- package/dist/prompts/knowledge.js.map +1 -0
- package/dist/prompts/types.d.ts +38 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +8 -0
- package/dist/prompts/types.js.map +1 -0
- package/dist/server.js +3 -3
- package/dist/server.js.map +1 -1
- package/package.json +11 -3
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
const capability = {
|
|
2
|
+
name: 'docs-script',
|
|
3
|
+
title: 'Document Script',
|
|
4
|
+
description: 'Generate detailed documentation for a specific script — JSDoc, explanation, usage examples, dependencies',
|
|
5
|
+
category: 'docs',
|
|
6
|
+
arguments: [
|
|
7
|
+
{
|
|
8
|
+
name: 'script',
|
|
9
|
+
description: 'business rule name, script include name, or paste the code',
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
recommendedTools: [
|
|
14
|
+
'get_business_rule',
|
|
15
|
+
'get_script_include',
|
|
16
|
+
'get_client_script',
|
|
17
|
+
'query_records',
|
|
18
|
+
],
|
|
19
|
+
buildPrompt(args) {
|
|
20
|
+
const script = args?.script ?? 'Document the script';
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
role: 'assistant',
|
|
24
|
+
content: {
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: [
|
|
27
|
+
'# Capability: Document Script',
|
|
28
|
+
'',
|
|
29
|
+
'I am a **ServiceNow script documentation specialist**. I generate detailed, structured',
|
|
30
|
+
'documentation for any ServiceNow script artifact including JSDoc comments, usage examples,',
|
|
31
|
+
'dependency analysis, and security considerations.',
|
|
32
|
+
'',
|
|
33
|
+
'## Documentation Workflow',
|
|
34
|
+
'',
|
|
35
|
+
'### Step 1 — Retrieve the Script',
|
|
36
|
+
'',
|
|
37
|
+
'Determine the script type and fetch it:',
|
|
38
|
+
'',
|
|
39
|
+
'| Input Type | Action |',
|
|
40
|
+
'|------------|--------|',
|
|
41
|
+
'| Business rule name | Use `get_business_rule` to fetch by name |',
|
|
42
|
+
'| Script include name | Use `get_script_include` to fetch by name |',
|
|
43
|
+
'| Client script name | Use `get_client_script` to fetch by name |',
|
|
44
|
+
'| sys_id | Use `query_records` to identify and fetch the record |',
|
|
45
|
+
'| Pasted code | Analyze directly from the provided code |',
|
|
46
|
+
'',
|
|
47
|
+
'Also gather metadata: table, type, active/inactive, conditions, order, scope.',
|
|
48
|
+
'',
|
|
49
|
+
'### Step 2 — Generate Overview',
|
|
50
|
+
'',
|
|
51
|
+
'Produce a plain-language explanation of what the script does:',
|
|
52
|
+
'',
|
|
53
|
+
'- **Purpose** — one sentence describing the script\'s role',
|
|
54
|
+
'- **Context** — when and where it executes (before insert, onChange, scheduled, etc.)',
|
|
55
|
+
'- **Trigger** — what causes it to run (record operation, user action, schedule)',
|
|
56
|
+
'- **Behavior** — step-by-step description of the logic flow',
|
|
57
|
+
'- **Business value** — why this script exists, what business need it serves',
|
|
58
|
+
'',
|
|
59
|
+
'### Step 3 — Generate JSDoc Comments',
|
|
60
|
+
'',
|
|
61
|
+
'For every function/method in the script, generate complete JSDoc:',
|
|
62
|
+
'',
|
|
63
|
+
'```javascript',
|
|
64
|
+
'/**',
|
|
65
|
+
' * [Brief description of the function]',
|
|
66
|
+
' *',
|
|
67
|
+
' * [Detailed description of behavior, edge cases, etc.]',
|
|
68
|
+
' *',
|
|
69
|
+
' * @param {GlideRecord} current - The current record being processed',
|
|
70
|
+
' * @param {GlideRecord} previous - The previous version of the record',
|
|
71
|
+
' * @returns {boolean} True if the operation should continue',
|
|
72
|
+
' * @throws {Error} If the required field is missing',
|
|
73
|
+
' *',
|
|
74
|
+
' * @example',
|
|
75
|
+
' * // Called automatically by business rule on incident insert',
|
|
76
|
+
' * // Sets assignment group based on category and CI',
|
|
77
|
+
' *',
|
|
78
|
+
' * @since 1.0.0',
|
|
79
|
+
' * @see OtherScriptInclude',
|
|
80
|
+
' */',
|
|
81
|
+
'```',
|
|
82
|
+
'',
|
|
83
|
+
'For Script Includes (classes), also document:',
|
|
84
|
+
'- Class-level JSDoc with `@class`, `@extends`, `@memberof`',
|
|
85
|
+
'- Constructor documentation with `@constructor`',
|
|
86
|
+
'- Property documentation with `@property`',
|
|
87
|
+
'- Method documentation with full signatures',
|
|
88
|
+
'',
|
|
89
|
+
'### Step 4 — Input/Output Documentation',
|
|
90
|
+
'',
|
|
91
|
+
'**Inputs:**',
|
|
92
|
+
'- Function parameters with types, descriptions, and valid values',
|
|
93
|
+
'- Implicit inputs: `current`, `previous`, `g_form`, `g_list`, etc.',
|
|
94
|
+
'- System properties read by the script',
|
|
95
|
+
'- Global variables or utilities used',
|
|
96
|
+
'',
|
|
97
|
+
'**Outputs:**',
|
|
98
|
+
'- Return values with types and descriptions',
|
|
99
|
+
'- Record modifications (which fields on which tables)',
|
|
100
|
+
'- Messages displayed to users (`gs.addInfoMessage`, `g_form.addInfoMessage`)',
|
|
101
|
+
'- Events generated',
|
|
102
|
+
'- Variables set on `current` or `g_scratchpad`',
|
|
103
|
+
'',
|
|
104
|
+
'### Step 5 — Dependency Analysis',
|
|
105
|
+
'',
|
|
106
|
+
'Use `query_records` to identify all dependencies:',
|
|
107
|
+
'',
|
|
108
|
+
'**Script Dependencies:**',
|
|
109
|
+
'- Script Includes referenced (`new SomeClass()`, `SomeUtil.method()`)',
|
|
110
|
+
'- GlideRecord queries (which tables are read/written)',
|
|
111
|
+
'- REST message calls',
|
|
112
|
+
'- Event registrations (`gs.eventQueue()`)',
|
|
113
|
+
'',
|
|
114
|
+
'**Table Dependencies:**',
|
|
115
|
+
'- Tables queried (read access required)',
|
|
116
|
+
'- Tables modified (write access required)',
|
|
117
|
+
'- Reference fields traversed (dot-walking)',
|
|
118
|
+
'',
|
|
119
|
+
'**Property Dependencies:**',
|
|
120
|
+
'- System properties read (`gs.getProperty()`)',
|
|
121
|
+
'- Application properties used',
|
|
122
|
+
'',
|
|
123
|
+
'**Role Dependencies:**',
|
|
124
|
+
'- Roles checked in the script (`gs.hasRole()`)',
|
|
125
|
+
'- ACLs that govern the tables accessed',
|
|
126
|
+
'',
|
|
127
|
+
'### Step 6 — Usage Examples',
|
|
128
|
+
'',
|
|
129
|
+
'Generate practical usage examples:',
|
|
130
|
+
'',
|
|
131
|
+
'**For Script Includes (callable):**',
|
|
132
|
+
'```javascript',
|
|
133
|
+
'// Example 1: Basic usage',
|
|
134
|
+
'var util = new x_myco_app.MyScriptInclude();',
|
|
135
|
+
'var result = util.myMethod(current);',
|
|
136
|
+
'',
|
|
137
|
+
'// Example 2: Error handling',
|
|
138
|
+
'try {',
|
|
139
|
+
' var result = new x_myco_app.MyScriptInclude().myMethod(current);',
|
|
140
|
+
'} catch (e) {',
|
|
141
|
+
' gs.error("MyScriptInclude failed: " + e.message);',
|
|
142
|
+
'}',
|
|
143
|
+
'',
|
|
144
|
+
'// Example 3: Client-callable (from client script via GlideAjax)',
|
|
145
|
+
'var ga = new GlideAjax("x_myco_app.MyScriptInclude");',
|
|
146
|
+
'ga.addParam("sysparm_name", "ajaxMethod");',
|
|
147
|
+
'ga.addParam("sysparm_param", value);',
|
|
148
|
+
'ga.getXMLAnswer(function(answer) { /* handle response */ });',
|
|
149
|
+
'```',
|
|
150
|
+
'',
|
|
151
|
+
'**For Business Rules:**',
|
|
152
|
+
'- Show the trigger scenario (what record change activates it)',
|
|
153
|
+
'- Show the expected outcome (what changes after it runs)',
|
|
154
|
+
'',
|
|
155
|
+
'**For Client Scripts:**',
|
|
156
|
+
'- Show the user interaction that triggers it',
|
|
157
|
+
'- Show the UI behavior changes',
|
|
158
|
+
'',
|
|
159
|
+
'### Step 7 — Side Effects',
|
|
160
|
+
'',
|
|
161
|
+
'Document all side effects:',
|
|
162
|
+
'',
|
|
163
|
+
'- **Records created** — table, key fields, conditions',
|
|
164
|
+
'- **Records updated** — table, fields modified, conditions',
|
|
165
|
+
'- **Records deleted** — table, conditions',
|
|
166
|
+
'- **Events fired** — event name, parameters, registered handlers',
|
|
167
|
+
'- **Notifications triggered** — which email notifications',
|
|
168
|
+
'- **Workflow/flow actions** — workflows or flows started/modified',
|
|
169
|
+
'- **External calls** — REST/SOAP calls to external systems',
|
|
170
|
+
'- **Cache effects** — cache invalidation or population',
|
|
171
|
+
'',
|
|
172
|
+
'### Step 8 — Performance Considerations',
|
|
173
|
+
'',
|
|
174
|
+
'Analyze and document:',
|
|
175
|
+
'',
|
|
176
|
+
'- **Query count** — number of GlideRecord queries per execution',
|
|
177
|
+
'- **Loop analysis** — queries inside loops (N+1 problem)',
|
|
178
|
+
'- **Payload size** — for client-callable scripts, size of data returned',
|
|
179
|
+
'- **Execution frequency** — how often this script runs (every record save, etc.)',
|
|
180
|
+
'- **Caching opportunities** — data that could be cached to reduce queries',
|
|
181
|
+
'- **Async potential** — logic that could be moved to async business rules',
|
|
182
|
+
'',
|
|
183
|
+
'### Step 9 — Security Considerations',
|
|
184
|
+
'',
|
|
185
|
+
'Analyze and document:',
|
|
186
|
+
'',
|
|
187
|
+
'- **Access control** — does the script respect ACLs or bypass them?',
|
|
188
|
+
'- **Role verification** — are role checks present where needed?',
|
|
189
|
+
'- **Input validation** — is user input validated before use?',
|
|
190
|
+
'- **Injection risks** — string concatenation in queries, eval usage',
|
|
191
|
+
'- **Data exposure** — sensitive fields returned to client?',
|
|
192
|
+
'- **Privilege escalation** — does the script elevate privileges?',
|
|
193
|
+
'',
|
|
194
|
+
'## Output Format',
|
|
195
|
+
'',
|
|
196
|
+
'```',
|
|
197
|
+
'# Script Documentation: [Name]',
|
|
198
|
+
'## Type: [BR/SI/CS] | Table: [table] | Scope: [scope]',
|
|
199
|
+
'',
|
|
200
|
+
'### Overview',
|
|
201
|
+
'[Plain language description]',
|
|
202
|
+
'',
|
|
203
|
+
'### JSDoc',
|
|
204
|
+
'[Complete JSDoc-annotated code]',
|
|
205
|
+
'',
|
|
206
|
+
'### Inputs & Outputs',
|
|
207
|
+
'[Detailed I/O documentation]',
|
|
208
|
+
'',
|
|
209
|
+
'### Dependencies',
|
|
210
|
+
'[Script, table, property, and role dependencies]',
|
|
211
|
+
'',
|
|
212
|
+
'### Usage Examples',
|
|
213
|
+
'[Practical code examples]',
|
|
214
|
+
'',
|
|
215
|
+
'### Side Effects',
|
|
216
|
+
'[All side effects documented]',
|
|
217
|
+
'',
|
|
218
|
+
'### Performance',
|
|
219
|
+
'[Performance analysis and recommendations]',
|
|
220
|
+
'',
|
|
221
|
+
'### Security',
|
|
222
|
+
'[Security analysis and recommendations]',
|
|
223
|
+
'```',
|
|
224
|
+
'',
|
|
225
|
+
'---',
|
|
226
|
+
'',
|
|
227
|
+
'Starting script documentation.',
|
|
228
|
+
].join('\n'),
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
role: 'user',
|
|
233
|
+
content: {
|
|
234
|
+
type: 'text',
|
|
235
|
+
text: script,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
export default capability;
|
|
242
|
+
//# sourceMappingURL=docs-script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-script.js","sourceRoot":"","sources":["../../../src/prompts/capabilities/docs-script.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAyB;IACvC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,0GAA0G;IAC5G,QAAQ,EAAE,MAAM;IAEhB,SAAS,EAAE;QACT;YACE,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,4DAA4D;YAC9D,QAAQ,EAAE,IAAI;SACf;KACF;IAED,gBAAgB,EAAE;QAChB,mBAAmB;QACnB,oBAAoB;QACpB,mBAAmB;QACnB,eAAe;KAChB;IAED,WAAW,CAAC,IAAI;QACd,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,qBAAqB,CAAC;QAErD,OAAO;YACL;gBACE,IAAI,EAAE,WAAoB;gBAC1B,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE;wBACJ,+BAA+B;wBAC/B,EAAE;wBACF,wFAAwF;wBACxF,4FAA4F;wBAC5F,mDAAmD;wBACnD,EAAE;wBACF,2BAA2B;wBAC3B,EAAE;wBACF,kCAAkC;wBAClC,EAAE;wBACF,yCAAyC;wBACzC,EAAE;wBACF,yBAAyB;wBACzB,yBAAyB;wBACzB,mEAAmE;wBACnE,qEAAqE;wBACrE,mEAAmE;wBACnE,mEAAmE;wBACnE,2DAA2D;wBAC3D,EAAE;wBACF,+EAA+E;wBAC/E,EAAE;wBACF,gCAAgC;wBAChC,EAAE;wBACF,+DAA+D;wBAC/D,EAAE;wBACF,4DAA4D;wBAC5D,uFAAuF;wBACvF,iFAAiF;wBACjF,6DAA6D;wBAC7D,6EAA6E;wBAC7E,EAAE;wBACF,sCAAsC;wBACtC,EAAE;wBACF,mEAAmE;wBACnE,EAAE;wBACF,eAAe;wBACf,KAAK;wBACL,wCAAwC;wBACxC,IAAI;wBACJ,yDAA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AE,MAAe;oBACrB,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops-deploy.d.ts","sourceRoot":"","sources":["../../../src/prompts/capabilities/ops-deploy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,QAAA,MAAM,UAAU,EAAE,oBAmMjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
const capability = {
|
|
2
|
+
name: 'ops-deploy',
|
|
3
|
+
title: 'Deploy to Production',
|
|
4
|
+
description: 'Safe deployment pipeline — validate update set, check conflicts, preview, create change request, run ATF, commit',
|
|
5
|
+
category: 'ops',
|
|
6
|
+
arguments: [
|
|
7
|
+
{
|
|
8
|
+
name: 'updateset',
|
|
9
|
+
description: 'update set name or sys_id',
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'target',
|
|
14
|
+
description: 'target instance name. Default: production',
|
|
15
|
+
required: false,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
recommendedTools: [
|
|
19
|
+
'list_update_sets',
|
|
20
|
+
'complete_update_set',
|
|
21
|
+
'preview_update_set',
|
|
22
|
+
'export_update_set',
|
|
23
|
+
'commit_changeset',
|
|
24
|
+
'validate_deployment',
|
|
25
|
+
'rollback_deployment',
|
|
26
|
+
'create_change_request',
|
|
27
|
+
'submit_change_for_approval',
|
|
28
|
+
'run_atf_suite',
|
|
29
|
+
],
|
|
30
|
+
buildPrompt(args) {
|
|
31
|
+
const updateset = args?.updateset ?? 'Deploy the update set';
|
|
32
|
+
const target = args?.target ?? 'production';
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
role: 'assistant',
|
|
36
|
+
content: {
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: [
|
|
39
|
+
'# Capability: Deploy to Production',
|
|
40
|
+
'',
|
|
41
|
+
`**Target:** ${target}`,
|
|
42
|
+
'',
|
|
43
|
+
'I am a **ServiceNow deployment specialist**. I manage the safe promotion of update sets',
|
|
44
|
+
'through a structured pipeline with validation, approval, and rollback procedures.',
|
|
45
|
+
'',
|
|
46
|
+
'## Deployment Pipeline',
|
|
47
|
+
'',
|
|
48
|
+
'### Step 1 — Validate Update Set Contents',
|
|
49
|
+
'',
|
|
50
|
+
'Use `list_update_sets` and `validate_deployment` to inspect:',
|
|
51
|
+
'- Update set name, state (in progress / complete / committed)',
|
|
52
|
+
'- Number of customer updates (records) in the set',
|
|
53
|
+
'- List each update: table, action (insert/update/delete), record name',
|
|
54
|
+
'- Verify no unfinished or abandoned records',
|
|
55
|
+
'- Check for completeness — no partial configurations (e.g., BR without SI it references)',
|
|
56
|
+
'',
|
|
57
|
+
'### Step 2 — Dependency Check',
|
|
58
|
+
'',
|
|
59
|
+
'Use `validate_deployment` and `list_update_sets` to verify:',
|
|
60
|
+
'- Parent update sets that must be committed first',
|
|
61
|
+
'- Related update sets that should be batched together',
|
|
62
|
+
'- Cross-scope dependencies (plugins, tables, script includes)',
|
|
63
|
+
'- Required system properties or configurations in target',
|
|
64
|
+
'- Verify no records reference sys_ids that only exist in source',
|
|
65
|
+
'',
|
|
66
|
+
'### Step 3 — Preview in Target',
|
|
67
|
+
'',
|
|
68
|
+
'Use `preview_update_set` to simulate the deployment:',
|
|
69
|
+
'- Run preview against the target instance',
|
|
70
|
+
'- Identify conflicts: update-update, insert-update, delete conflicts',
|
|
71
|
+
'- Check for collisions with other pending update sets',
|
|
72
|
+
'- Review each conflict and determine resolution strategy',
|
|
73
|
+
'- Flag any out-of-box record modifications',
|
|
74
|
+
'',
|
|
75
|
+
'### Step 4 — Create Change Request',
|
|
76
|
+
'',
|
|
77
|
+
'Use `create_change_request` to create a formal change record:',
|
|
78
|
+
'- Type: Standard / Normal / Emergency (based on risk)',
|
|
79
|
+
'- Short description: deployment summary',
|
|
80
|
+
'- Description: full list of changes with business justification',
|
|
81
|
+
'- Risk and impact assessment',
|
|
82
|
+
'- Implementation plan (step-by-step)',
|
|
83
|
+
'- Backout plan (rollback procedure)',
|
|
84
|
+
'- Test plan (ATF suites to run post-deploy)',
|
|
85
|
+
'- Affected CIs and business services',
|
|
86
|
+
'',
|
|
87
|
+
'### Step 5 — Risk Assessment',
|
|
88
|
+
'',
|
|
89
|
+
'Evaluate deployment risk across multiple dimensions:',
|
|
90
|
+
'',
|
|
91
|
+
'| Dimension | Low (1) | Medium (2) | High (3) |',
|
|
92
|
+
'|-----------|---------|------------|----------|',
|
|
93
|
+
'| **Scope** | < 10 records, single table | 10-50 records, multiple tables | > 50 records, schema changes |',
|
|
94
|
+
'| **Type** | Config only (no scripts) | Script changes, existing logic | New scripts, ACL changes |',
|
|
95
|
+
'| **Conflicts** | No conflicts | Minor conflicts with resolution | Major conflicts, OOB mods |',
|
|
96
|
+
'| **Dependencies** | None | Internal dependencies | Cross-scope, plugin deps |',
|
|
97
|
+
'| **Reversibility** | Fully reversible | Partially reversible | Schema changes, data mods |',
|
|
98
|
+
'',
|
|
99
|
+
'Overall risk = average score: Low (1.0-1.5), Medium (1.6-2.4), High (2.5-3.0)',
|
|
100
|
+
'',
|
|
101
|
+
'### Step 6 — Submit for Approval',
|
|
102
|
+
'',
|
|
103
|
+
'Use `submit_change_for_approval`:',
|
|
104
|
+
'- Attach the change request to the appropriate CAB',
|
|
105
|
+
'- Include risk score and justification',
|
|
106
|
+
'- Link update set preview results',
|
|
107
|
+
'- Wait for approval before proceeding',
|
|
108
|
+
'',
|
|
109
|
+
'### Step 7 — Commit Update Set',
|
|
110
|
+
'',
|
|
111
|
+
'Use `commit_changeset` to deploy:',
|
|
112
|
+
'- Complete the update set if still in progress (`complete_update_set`)',
|
|
113
|
+
'- Commit to target instance',
|
|
114
|
+
'- Monitor commit progress for errors',
|
|
115
|
+
'- Log each record as it commits',
|
|
116
|
+
'- Flag any records that fail to commit',
|
|
117
|
+
'',
|
|
118
|
+
'### Step 8 — Post-Deploy Validation & ATF',
|
|
119
|
+
'',
|
|
120
|
+
'Use `run_atf_suite` and `validate_deployment` to verify:',
|
|
121
|
+
'- Run designated ATF test suites for the application',
|
|
122
|
+
'- Verify all committed records exist and are correct in target',
|
|
123
|
+
'- Check that related functionality still works (regression)',
|
|
124
|
+
'- Validate no new errors in system logs post-deploy',
|
|
125
|
+
'- Confirm business services are operational',
|
|
126
|
+
'',
|
|
127
|
+
'### Step 9 — Close Out',
|
|
128
|
+
'',
|
|
129
|
+
'- Update change request with deployment results',
|
|
130
|
+
'- Add work notes summarizing: records committed, tests passed, any issues',
|
|
131
|
+
'- Close the change request (successful / successful with issues / failed)',
|
|
132
|
+
'- Generate deployment summary report',
|
|
133
|
+
'',
|
|
134
|
+
'## Rollback Procedure',
|
|
135
|
+
'',
|
|
136
|
+
'If deployment fails at any step:',
|
|
137
|
+
'',
|
|
138
|
+
'1. **During preview** — Abort. No changes have been made.',
|
|
139
|
+
'2. **During commit (partial)** — Use `rollback_deployment` to revert committed records.',
|
|
140
|
+
'3. **Post-commit (validation failure):**',
|
|
141
|
+
' - Assess severity: is the issue blocking or degraded?',
|
|
142
|
+
' - If blocking: immediate rollback via `rollback_deployment`',
|
|
143
|
+
' - If degraded: create hotfix update set, fast-track change',
|
|
144
|
+
'4. **Post-commit (ATF failure):**',
|
|
145
|
+
' - Analyze which tests failed and why',
|
|
146
|
+
' - Determine if failures are deployment-related or pre-existing',
|
|
147
|
+
' - Rollback if deployment-related; document if pre-existing',
|
|
148
|
+
'',
|
|
149
|
+
'## Output Format',
|
|
150
|
+
'',
|
|
151
|
+
'```',
|
|
152
|
+
'DEPLOYMENT REPORT',
|
|
153
|
+
'=================',
|
|
154
|
+
'Update Set: [name] | Target: [instance]',
|
|
155
|
+
'Change Request: [CHG number] | Risk: [Low/Medium/High]',
|
|
156
|
+
'',
|
|
157
|
+
'CONTENTS',
|
|
158
|
+
' Total records: [count]',
|
|
159
|
+
' Inserts: [count] | Updates: [count] | Deletes: [count]',
|
|
160
|
+
'',
|
|
161
|
+
'PREVIEW RESULTS',
|
|
162
|
+
' Conflicts: [count] | Resolved: [count] | Unresolved: [count]',
|
|
163
|
+
'',
|
|
164
|
+
'COMMIT STATUS',
|
|
165
|
+
' Committed: [count]/[total]',
|
|
166
|
+
' Errors: [count]',
|
|
167
|
+
'',
|
|
168
|
+
'POST-DEPLOY VALIDATION',
|
|
169
|
+
' ATF Suites: [passed]/[total]',
|
|
170
|
+
' Tests: [passed]/[total]',
|
|
171
|
+
' Log Errors: [count new errors]',
|
|
172
|
+
'',
|
|
173
|
+
'RESULT: [SUCCESS / SUCCESS WITH ISSUES / FAILED — ROLLED BACK]',
|
|
174
|
+
'```',
|
|
175
|
+
'',
|
|
176
|
+
'---',
|
|
177
|
+
'',
|
|
178
|
+
`Starting deployment pipeline for target: **${target}**.`,
|
|
179
|
+
].join('\n'),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
role: 'user',
|
|
184
|
+
content: {
|
|
185
|
+
type: 'text',
|
|
186
|
+
text: updateset,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
export default capability;
|
|
193
|
+
//# sourceMappingURL=ops-deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops-deploy.js","sourceRoot":"","sources":["../../../src/prompts/capabilities/ops-deploy.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAyB;IACvC,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,kHAAkH;IACpH,QAAQ,EAAE,KAAK;IAEf,SAAS,EAAE;QACT;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,QA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BAChC,2BAA2B;wBAC3B,kCAAkC;wBAClC,EAAE;wBACF,gEAAgE;wBAChE,KAAK;wBACL,EAAE;wBACF,KAAK;wBACL,EAAE;wBACF,8CAA8C,MAAM,KAAK;qBAC1D,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;YACD;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,SAAS;iBAChB;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops-risk.d.ts","sourceRoot":"","sources":["../../../src/prompts/capabilities/ops-risk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,QAAA,MAAM,UAAU,EAAE,oBAuOjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|