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.
Files changed (129) hide show
  1. package/dist/cli/index.js +89 -1
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/direct/executor.d.ts +28 -0
  4. package/dist/direct/executor.d.ts.map +1 -0
  5. package/dist/direct/executor.js +228 -0
  6. package/dist/direct/executor.js.map +1 -0
  7. package/dist/direct/llm-client.d.ts +32 -0
  8. package/dist/direct/llm-client.d.ts.map +1 -0
  9. package/dist/direct/llm-client.js +122 -0
  10. package/dist/direct/llm-client.js.map +1 -0
  11. package/dist/prompts/capabilities/build-app.d.ts +4 -0
  12. package/dist/prompts/capabilities/build-app.d.ts.map +1 -0
  13. package/dist/prompts/capabilities/build-app.js +238 -0
  14. package/dist/prompts/capabilities/build-app.js.map +1 -0
  15. package/dist/prompts/capabilities/build-business-rule.d.ts +4 -0
  16. package/dist/prompts/capabilities/build-business-rule.d.ts.map +1 -0
  17. package/dist/prompts/capabilities/build-business-rule.js +93 -0
  18. package/dist/prompts/capabilities/build-business-rule.js.map +1 -0
  19. package/dist/prompts/capabilities/build-catalog.d.ts +4 -0
  20. package/dist/prompts/capabilities/build-catalog.d.ts.map +1 -0
  21. package/dist/prompts/capabilities/build-catalog.js +350 -0
  22. package/dist/prompts/capabilities/build-catalog.js.map +1 -0
  23. package/dist/prompts/capabilities/build-client-script.d.ts +4 -0
  24. package/dist/prompts/capabilities/build-client-script.d.ts.map +1 -0
  25. package/dist/prompts/capabilities/build-client-script.js +157 -0
  26. package/dist/prompts/capabilities/build-client-script.js.map +1 -0
  27. package/dist/prompts/capabilities/build-flow.d.ts +4 -0
  28. package/dist/prompts/capabilities/build-flow.d.ts.map +1 -0
  29. package/dist/prompts/capabilities/build-flow.js +243 -0
  30. package/dist/prompts/capabilities/build-flow.js.map +1 -0
  31. package/dist/prompts/capabilities/build-portal.d.ts +4 -0
  32. package/dist/prompts/capabilities/build-portal.d.ts.map +1 -0
  33. package/dist/prompts/capabilities/build-portal.js +250 -0
  34. package/dist/prompts/capabilities/build-portal.js.map +1 -0
  35. package/dist/prompts/capabilities/build-rest-api.d.ts +4 -0
  36. package/dist/prompts/capabilities/build-rest-api.d.ts.map +1 -0
  37. package/dist/prompts/capabilities/build-rest-api.js +293 -0
  38. package/dist/prompts/capabilities/build-rest-api.js.map +1 -0
  39. package/dist/prompts/capabilities/build-test-plan.d.ts +4 -0
  40. package/dist/prompts/capabilities/build-test-plan.d.ts.map +1 -0
  41. package/dist/prompts/capabilities/build-test-plan.js +162 -0
  42. package/dist/prompts/capabilities/build-test-plan.js.map +1 -0
  43. package/dist/prompts/capabilities/build-uib.d.ts +4 -0
  44. package/dist/prompts/capabilities/build-uib.d.ts.map +1 -0
  45. package/dist/prompts/capabilities/build-uib.js +309 -0
  46. package/dist/prompts/capabilities/build-uib.js.map +1 -0
  47. package/dist/prompts/capabilities/docs-app.d.ts +4 -0
  48. package/dist/prompts/capabilities/docs-app.d.ts.map +1 -0
  49. package/dist/prompts/capabilities/docs-app.js +234 -0
  50. package/dist/prompts/capabilities/docs-app.js.map +1 -0
  51. package/dist/prompts/capabilities/docs-release.d.ts +4 -0
  52. package/dist/prompts/capabilities/docs-release.d.ts.map +1 -0
  53. package/dist/prompts/capabilities/docs-release.js +197 -0
  54. package/dist/prompts/capabilities/docs-release.js.map +1 -0
  55. package/dist/prompts/capabilities/docs-runbook.d.ts +4 -0
  56. package/dist/prompts/capabilities/docs-runbook.d.ts.map +1 -0
  57. package/dist/prompts/capabilities/docs-runbook.js +223 -0
  58. package/dist/prompts/capabilities/docs-runbook.js.map +1 -0
  59. package/dist/prompts/capabilities/docs-script.d.ts +4 -0
  60. package/dist/prompts/capabilities/docs-script.d.ts.map +1 -0
  61. package/dist/prompts/capabilities/docs-script.js +242 -0
  62. package/dist/prompts/capabilities/docs-script.js.map +1 -0
  63. package/dist/prompts/capabilities/ops-deploy.d.ts +4 -0
  64. package/dist/prompts/capabilities/ops-deploy.d.ts.map +1 -0
  65. package/dist/prompts/capabilities/ops-deploy.js +193 -0
  66. package/dist/prompts/capabilities/ops-deploy.js.map +1 -0
  67. package/dist/prompts/capabilities/ops-risk.d.ts +4 -0
  68. package/dist/prompts/capabilities/ops-risk.d.ts.map +1 -0
  69. package/dist/prompts/capabilities/ops-risk.js +227 -0
  70. package/dist/prompts/capabilities/ops-risk.js.map +1 -0
  71. package/dist/prompts/capabilities/ops-triage.d.ts +4 -0
  72. package/dist/prompts/capabilities/ops-triage.d.ts.map +1 -0
  73. package/dist/prompts/capabilities/ops-triage.js +183 -0
  74. package/dist/prompts/capabilities/ops-triage.js.map +1 -0
  75. package/dist/prompts/capabilities/review-acls.d.ts +4 -0
  76. package/dist/prompts/capabilities/review-acls.d.ts.map +1 -0
  77. package/dist/prompts/capabilities/review-acls.js +142 -0
  78. package/dist/prompts/capabilities/review-acls.js.map +1 -0
  79. package/dist/prompts/capabilities/review-code.d.ts +4 -0
  80. package/dist/prompts/capabilities/review-code.d.ts.map +1 -0
  81. package/dist/prompts/capabilities/review-code.js +155 -0
  82. package/dist/prompts/capabilities/review-code.js.map +1 -0
  83. package/dist/prompts/capabilities/review-flows.d.ts +4 -0
  84. package/dist/prompts/capabilities/review-flows.d.ts.map +1 -0
  85. package/dist/prompts/capabilities/review-flows.js +413 -0
  86. package/dist/prompts/capabilities/review-flows.js.map +1 -0
  87. package/dist/prompts/capabilities/review-scripts.d.ts +4 -0
  88. package/dist/prompts/capabilities/review-scripts.d.ts.map +1 -0
  89. package/dist/prompts/capabilities/review-scripts.js +160 -0
  90. package/dist/prompts/capabilities/review-scripts.js.map +1 -0
  91. package/dist/prompts/capabilities/scan-automation.d.ts +4 -0
  92. package/dist/prompts/capabilities/scan-automation.d.ts.map +1 -0
  93. package/dist/prompts/capabilities/scan-automation.js +449 -0
  94. package/dist/prompts/capabilities/scan-automation.js.map +1 -0
  95. package/dist/prompts/capabilities/scan-cmdb.d.ts +4 -0
  96. package/dist/prompts/capabilities/scan-cmdb.d.ts.map +1 -0
  97. package/dist/prompts/capabilities/scan-cmdb.js +450 -0
  98. package/dist/prompts/capabilities/scan-cmdb.js.map +1 -0
  99. package/dist/prompts/capabilities/scan-debt.d.ts +4 -0
  100. package/dist/prompts/capabilities/scan-debt.d.ts.map +1 -0
  101. package/dist/prompts/capabilities/scan-debt.js +287 -0
  102. package/dist/prompts/capabilities/scan-debt.js.map +1 -0
  103. package/dist/prompts/capabilities/scan-health.d.ts +4 -0
  104. package/dist/prompts/capabilities/scan-health.d.ts.map +1 -0
  105. package/dist/prompts/capabilities/scan-health.js +235 -0
  106. package/dist/prompts/capabilities/scan-health.js.map +1 -0
  107. package/dist/prompts/capabilities/scan-security.d.ts +4 -0
  108. package/dist/prompts/capabilities/scan-security.d.ts.map +1 -0
  109. package/dist/prompts/capabilities/scan-security.js +370 -0
  110. package/dist/prompts/capabilities/scan-security.js.map +1 -0
  111. package/dist/prompts/capabilities/scan-upgrade.d.ts +4 -0
  112. package/dist/prompts/capabilities/scan-upgrade.d.ts.map +1 -0
  113. package/dist/prompts/capabilities/scan-upgrade.js +327 -0
  114. package/dist/prompts/capabilities/scan-upgrade.js.map +1 -0
  115. package/dist/prompts/index.d.ts +24 -2
  116. package/dist/prompts/index.d.ts.map +1 -1
  117. package/dist/prompts/index.js +160 -14
  118. package/dist/prompts/index.js.map +1 -1
  119. package/dist/prompts/knowledge.d.ts +10 -0
  120. package/dist/prompts/knowledge.d.ts.map +1 -0
  121. package/dist/prompts/knowledge.js +604 -0
  122. package/dist/prompts/knowledge.js.map +1 -0
  123. package/dist/prompts/types.d.ts +38 -0
  124. package/dist/prompts/types.d.ts.map +1 -0
  125. package/dist/prompts/types.js +8 -0
  126. package/dist/prompts/types.js.map +1 -0
  127. package/dist/server.js +3 -3
  128. package/dist/server.js.map +1 -1
  129. package/package.json +11 -3
@@ -0,0 +1,243 @@
1
+ const capability = {
2
+ name: 'build-flow',
3
+ title: 'Build Flow',
4
+ description: 'Guided Flow Designer creation — triggers, actions, subflows, error handling, testing',
5
+ category: 'build',
6
+ arguments: [
7
+ {
8
+ name: 'description',
9
+ description: 'what the flow should do in plain language',
10
+ required: true,
11
+ },
12
+ {
13
+ name: 'trigger_type',
14
+ description: 'record, scheduled, application, inbound_email. Default: record',
15
+ required: false,
16
+ },
17
+ {
18
+ name: 'table',
19
+ description: 'target table for record-triggered flows',
20
+ required: false,
21
+ },
22
+ ],
23
+ recommendedTools: [
24
+ 'query_records',
25
+ 'list_flows',
26
+ 'get_flow',
27
+ 'trigger_flow',
28
+ 'create_flow',
29
+ 'create_subflow',
30
+ 'list_business_rules',
31
+ 'get_table_schema',
32
+ ],
33
+ buildPrompt(args = {}) {
34
+ const desc = args.description ?? '<not provided>';
35
+ const triggerType = args.trigger_type ?? 'record';
36
+ const table = args.table ?? '<not specified>';
37
+ return [
38
+ {
39
+ role: 'assistant',
40
+ content: {
41
+ type: 'text',
42
+ text: [
43
+ '# Capability: Build Flow (Flow Designer)',
44
+ '',
45
+ '## ServiceNow Flow Designer — Platform Knowledge',
46
+ '',
47
+ '### Trigger Types',
48
+ '- **Record:** fires on insert, update, or delete of a record on a specific table. Supports conditions (e.g., state changes to "Resolved"). Most common trigger type.',
49
+ '- **Scheduled:** fires on a cron schedule (daily, weekly, custom). Used for batch processing, cleanup, periodic sync. Runs as the flow owner unless impersonation is configured.',
50
+ '- **Application:** fires from a Script Action, Business Rule, or another flow via `sn_fd.FlowAPI.startFlow()`. Best for event-driven or decoupled architectures.',
51
+ '- **Inbound Email:** fires when an email is received matching criteria (sender, subject regex, body contains). Used for email-to-ticket, approval via email.',
52
+ '- **REST:** fires from an inbound REST API call. Useful for external system integrations, webhooks.',
53
+ '',
54
+ '### Action Types',
55
+ '- **Create Record / Update Record / Delete Record:** CRUD operations on any table. Use dot-walking for reference field data.',
56
+ '- **Look Up Records / Look Up Record:** query one or many records with conditions. Returns data pills for downstream use.',
57
+ '- **Run Script:** inline server-side JavaScript. Has access to `fd_data` (flow data pills). Use sparingly — prefer built-in actions for maintainability.',
58
+ '- **Call Subflow:** invoke a reusable subflow with input parameters. Outputs from the subflow are available as data pills.',
59
+ '- **Send Notification:** fire a notification with dynamic recipients, subject, and body.',
60
+ '- **Log:** write to sys_log for debugging and audit trail. Include flow context in log messages.',
61
+ '- **If / Else If / Else:** conditional branching based on data pill values, record conditions, or script results.',
62
+ '- **For Each:** iterate over a list of records returned from Look Up Records.',
63
+ '- **Wait For:** pause flow execution until a condition is met (record update, duration elapsed, specific date/time). Creates a `wf_context` record.',
64
+ '- **Ask for Approval:** request approval from users/groups with configurable approval rules (anyone, everyone, percentage).',
65
+ '- **Make REST Call:** outbound HTTP request with dynamic URL, headers, body. Supports OAuth, Basic Auth, mutual TLS.',
66
+ '- **Transform:** data transformation and mapping between data pills.',
67
+ '',
68
+ '### Error Handling Patterns',
69
+ '- **Try / Catch:** wrap risky actions in a try block. The catch block receives error details (message, action that failed). Always include a catch for external calls (REST, Script).',
70
+ '- **Rollback Actions:** in the catch block, undo partially completed work (delete created records, revert field changes).',
71
+ '- **Error Output:** flows can define error outputs so callers (parent flows, subflows) can handle failures gracefully.',
72
+ '- **Logging in Catch:** always log the error with full context (flow name, trigger record, action name, error message) for troubleshooting.',
73
+ '- **Retry Pattern:** for transient failures (REST timeout, lock contention), implement retry with a Wait action followed by re-execution of the failed action.',
74
+ '',
75
+ '### Flow Variables & Data Pills',
76
+ '- **Trigger data pills:** `Trigger Record` and its fields are available as data pills throughout the flow.',
77
+ '- **Action outputs:** each action produces output data pills (created record sys_id, lookup results, script return values).',
78
+ '- **Flow variables:** define typed inputs/outputs on the flow for parameterization. Inputs can be set by callers (Application trigger, parent flow).',
79
+ '- **Inline scripts** access data pills via the `fd_data` object.',
80
+ '- **Dot-walking:** reference field data pills support dot-walking (e.g., `Trigger Record.assigned_to.manager.email`).',
81
+ '',
82
+ '### Subflow Design Principles',
83
+ '- Extract reusable logic into subflows: notification patterns, approval chains, record creation templates.',
84
+ '- Subflows have typed inputs and outputs — define them clearly for reuse.',
85
+ '- Subflows can be called from any flow, reducing duplication.',
86
+ '- Keep subflows focused on a single responsibility.',
87
+ '- Version subflows carefully — changes affect all calling flows.',
88
+ '',
89
+ '### Performance Considerations',
90
+ '- Avoid Look Up Records inside For Each loops (N+1 pattern). Instead, look up all needed records before the loop.',
91
+ '- Use conditions on the trigger to minimize unnecessary flow executions.',
92
+ '- Prefer built-in actions over Run Script for better platform optimization.',
93
+ '- Long-running flows (with Wait actions) consume `wf_context` records — monitor and clean up stale contexts.',
94
+ '- Scheduled flows that process large datasets should use pagination (limit + offset) or batch subflows.',
95
+ '',
96
+ '### Testing Best Practices',
97
+ '- Test with records that match AND do not match trigger conditions.',
98
+ '- Test each conditional branch (If / Else If / Else).',
99
+ '- Test error paths by simulating action failures (invalid record, REST endpoint down).',
100
+ '- Test subflow inputs at boundary values (null, empty string, max length).',
101
+ '- Use Flow Designer\'s built-in test feature for individual action verification.',
102
+ '- For scheduled flows, test with the expected data volume to identify performance issues.',
103
+ '',
104
+ '---',
105
+ '',
106
+ `Starting flow build for: **${desc}**`,
107
+ `Trigger type: **${triggerType}**`,
108
+ table !== '<not specified>'
109
+ ? `Table: **${table}**`
110
+ : 'Table: to be determined from requirement analysis',
111
+ ].join('\n'),
112
+ },
113
+ },
114
+ {
115
+ role: 'user',
116
+ content: {
117
+ type: 'text',
118
+ text: [
119
+ `Build a Flow Designer flow for the following requirement:`,
120
+ `**Requirement:** ${desc}`,
121
+ `**Trigger type:** ${triggerType}`,
122
+ `**Table:** ${table}`,
123
+ '',
124
+ 'Follow these steps exactly:',
125
+ '',
126
+ '### Step 1 — Understand the Requirement',
127
+ 'Parse the requirement and identify:',
128
+ '- **Trigger event:** what causes this flow to start (record insert/update/delete, schedule, application event, inbound email).',
129
+ `- **Trigger type:** ${triggerType}. Validate this is appropriate for the requirement; if not, recommend the correct trigger type and explain why.`,
130
+ '- **Trigger conditions:** what conditions must be met on the trigger record (e.g., state changes from X to Y, priority = 1, category = "Hardware").',
131
+ table !== '<not specified>'
132
+ ? `- **Table:** ${table}. Use **get_table_schema** to verify the table exists and understand its fields, types, and relationships.`
133
+ : '- **Table:** determine the correct table from the requirement. Use **get_table_schema** to verify it.',
134
+ '- **Expected outcome:** what should happen when the flow completes successfully.',
135
+ '- **Error scenarios:** what could go wrong and how should errors be handled.',
136
+ '',
137
+ '### Step 2 — Check Existing Flows for Conflicts',
138
+ `Use **list_flows** to find all active flows${table !== '<not specified>' ? ` on the "${table}" table` : ''}. For each existing flow, note:`,
139
+ '- Flow name, trigger type, trigger conditions.',
140
+ '- Whether it overlaps with the new requirement (same trigger event + condition).',
141
+ '- Whether it could conflict (competing updates to the same fields, contradictory actions).',
142
+ '- Whether the new requirement could be met by modifying an existing flow instead of creating a new one.',
143
+ '',
144
+ 'Also check **list_business_rules** on the same table — business rules on the same trigger event may conflict with or duplicate flow logic.',
145
+ '',
146
+ 'If conflicts are found, recommend a resolution strategy before proceeding.',
147
+ '',
148
+ '### Step 3 — Design the Flow Structure',
149
+ 'Design the complete flow architecture before building:',
150
+ '',
151
+ '```',
152
+ 'FLOW: [Flow Name]',
153
+ ' TRIGGER: [type] on [table] when [conditions]',
154
+ ' ',
155
+ ' TRY:',
156
+ ' 1. [Action Type] — [description]',
157
+ ' Input: [data pills / values]',
158
+ ' Output: [data pill name]',
159
+ ' ',
160
+ ' 2. IF [condition]:',
161
+ ' 2a. [Action] — [description]',
162
+ ' ELSE:',
163
+ ' 2b. [Action] — [description]',
164
+ ' ',
165
+ ' 3. [Action] — [description]',
166
+ ' ...',
167
+ ' ',
168
+ ' CATCH:',
169
+ ' C1. Log Error — [error message with context]',
170
+ ' C2. [Rollback Action] — [undo partial work]',
171
+ ' C3. [Notification] — alert admin/support',
172
+ ' ',
173
+ ' OUTPUTS:',
174
+ ' - [output_name]: [type] — [description]',
175
+ '```',
176
+ '',
177
+ 'For each action, specify:',
178
+ '- The exact action type (Create Record, Update Record, Look Up Records, Run Script, etc.).',
179
+ '- Input data pills and static values.',
180
+ '- Output data pill names for downstream use.',
181
+ '- Conditions for branching actions.',
182
+ '',
183
+ '### Step 4 — Identify Subflow Opportunities',
184
+ 'Determine if any logic should be extracted into subflows:',
185
+ '- **Reusable patterns:** notification sequences, approval chains, record creation templates used in multiple flows.',
186
+ '- **Complex sub-processes:** approval with escalation, multi-step provisioning, data validation suites.',
187
+ '- **Testability:** isolated subflows are easier to test independently.',
188
+ '',
189
+ 'For each subflow, define:',
190
+ '- Name and description.',
191
+ '- Typed inputs (name, type, mandatory flag).',
192
+ '- Typed outputs (name, type).',
193
+ '- Internal action sequence.',
194
+ '',
195
+ 'Use **create_subflow** for each identified subflow before creating the main flow.',
196
+ '',
197
+ '### Step 5 — Generate Flow with Error Handling',
198
+ 'Build the flow using **create_flow** with:',
199
+ '- Descriptive name following naming convention: `[Scope] - [Table] - [Purpose]` (e.g., "ITIL - Incident - Auto-Assign Critical").',
200
+ '- Clear description explaining trigger, purpose, and expected outcomes.',
201
+ '- Proper trigger configuration with conditions.',
202
+ '- All actions in sequence with data pill bindings.',
203
+ '- **Try/Catch wrapping** for all external calls, script actions, and record operations that could fail.',
204
+ '- Rollback actions in the catch block to undo partial work.',
205
+ '- Error logging with full context (flow name, trigger record sys_id, failed action, error message).',
206
+ '- Error notification to administrators for critical failures.',
207
+ '',
208
+ 'Validate:',
209
+ '- No hardcoded sys_ids — use Look Up Record actions or flow inputs.',
210
+ '- No N+1 patterns (Look Up Records inside For Each without prior aggregation).',
211
+ '- All reference field data pills use dot-walking correctly.',
212
+ '- Wait actions (if any) have appropriate timeout configuration.',
213
+ '- Approval actions (if any) have correct rejection handling.',
214
+ '',
215
+ '### Step 6 — Create the Flow',
216
+ 'Use **create_flow** (and **create_subflow** for any subflows) to create the artifacts in ServiceNow. Report:',
217
+ '- Flow sys_id and name.',
218
+ '- Subflow sys_id(s) and name(s), if any.',
219
+ '- Total action count and structure summary.',
220
+ '',
221
+ '### Step 7 — Suggest Test Scenarios',
222
+ 'Provide a comprehensive test matrix:',
223
+ '',
224
+ '| # | Scenario | Trigger Setup | Expected Flow Behavior | Expected Outcome |',
225
+ '|---|----------|---------------|------------------------|------------------|',
226
+ '',
227
+ 'Include at minimum:',
228
+ '- **Happy path:** trigger fires, all conditions met, flow completes successfully end-to-end.',
229
+ '- **Condition mismatch:** trigger fires but conditions are NOT met — flow should not execute.',
230
+ '- **Branching:** test each conditional branch (If/Else) with appropriate trigger data.',
231
+ '- **Error path:** simulate a failure in a critical action — verify catch block executes, rollback happens, notification is sent.',
232
+ '- **Subflow isolation:** test each subflow independently with boundary inputs.',
233
+ '- **Concurrency:** if applicable, test what happens when multiple flow instances run simultaneously on related records.',
234
+ '- **Performance:** test with realistic data volume to verify the flow completes within acceptable time.',
235
+ '- **Idempotency:** verify the flow produces correct results if triggered multiple times for the same record.',
236
+ ].join('\n'),
237
+ },
238
+ },
239
+ ];
240
+ },
241
+ };
242
+ export default capability;
243
+ //# sourceMappingURL=build-flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-flow.js","sourceRoot":"","sources":["../../../src/prompts/capabilities/build-flow.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAyB;IACvC,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;IACnB,WAAW,EACT,sFAAsF;IACxF,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,gBAAgB,EAAE;QAChB,eAAe;QACf,YAAY;QACZ,UAAU;QACV,cAAc;QACd,aAAa;QACb,gBAAgB;QAChB,qBAAqB;QACrB,kBAAkB;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{ CapabilityDefinition } from '../types.js';
2
+ declare const capability: CapabilityDefinition;
3
+ export default capability;
4
+ //# sourceMappingURL=build-portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-portal.d.ts","sourceRoot":"","sources":["../../../src/prompts/capabilities/build-portal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,QAAA,MAAM,UAAU,EAAE,oBAyPjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,250 @@
1
+ const capability = {
2
+ name: 'build-portal',
3
+ title: 'Build Service Portal Widget',
4
+ description: 'Guided Service Portal widget creation — server script, client controller, HTML template, CSS, data brokers',
5
+ category: 'build',
6
+ arguments: [
7
+ {
8
+ name: 'description',
9
+ description: 'what the widget should do in plain language',
10
+ required: true,
11
+ },
12
+ {
13
+ name: 'widget_name',
14
+ description: 'widget name / ID (e.g., my-custom-widget)',
15
+ required: false,
16
+ },
17
+ {
18
+ name: 'table',
19
+ description: 'primary table the widget interacts with',
20
+ required: false,
21
+ },
22
+ ],
23
+ recommendedTools: [
24
+ 'query_records',
25
+ 'get_table_schema',
26
+ 'list_portal_widgets',
27
+ 'get_portal_widget',
28
+ 'create_portal_widget',
29
+ 'update_portal_widget',
30
+ ],
31
+ buildPrompt(args = {}) {
32
+ const desc = args.description ?? '<not provided>';
33
+ const widgetName = args.widget_name ?? '<auto-generate from description>';
34
+ const table = args.table ?? '<not specified>';
35
+ return [
36
+ {
37
+ role: 'assistant',
38
+ content: {
39
+ type: 'text',
40
+ text: [
41
+ '# Capability: Build Service Portal Widget',
42
+ '',
43
+ '## Service Portal Widget Architecture — Platform Knowledge',
44
+ '',
45
+ '### Widget Lifecycle',
46
+ '1. **Server script executes first** (runs on the server as a Rhino script). Sets `data` object properties that are sent to the client.',
47
+ '2. **Client controller executes** (AngularJS 1.x). Receives `data` via `$scope.data` (aliased as `c.data` in the template via `controllerAs: \'c\'`).',
48
+ '3. **HTML template renders** using Angular directives and `c.data` / `c.server` bindings.',
49
+ '4. **CSS/SCSS** styles the widget, scoped to the widget instance.',
50
+ '5. **Client interactions** can call back to the server via `c.server.update()` which re-executes the server script with `input` object containing client-sent data.',
51
+ '',
52
+ '### Server Script Patterns',
53
+ '- **`data` object:** the bridge between server and client. Set `data.myProperty = value` and access it as `c.data.myProperty` in the template.',
54
+ '- **`input` object:** populated when the client calls `c.server.update()`. Check `if (input)` to differentiate initial load from client callbacks.',
55
+ '- **`options` object:** widget instance options configured in the Page Editor.',
56
+ '- **`$sp` API:**',
57
+ ' - `$sp.getParameter(name)` — read URL parameters.',
58
+ ' - `$sp.getPortalRecord()` — get the current portal\'s GlideRecord.',
59
+ ' - `$sp.getUser()` — get current user info (sys_id, name, roles).',
60
+ ' - `$sp.getStream(table, sys_id)` — get activity stream for a record.',
61
+ ' - `$sp.getRecordDisplayValues(data, gr, fields)` — bulk-extract display values.',
62
+ ' - `$sp.getWidget(widgetId, options)` — get embedded widget instance.',
63
+ ' - `$sp.getValues(data, gr, fields)` — bulk-extract raw values.',
64
+ '- **GlideRecord queries:** use standard GlideRecord in server script. Apply `addEncodedQuery()` for complex filters. Always check `canRead()` before exposing data.',
65
+ '- **GlideQuery:** modern alternative — `new GlideQuery(table).where(field, value).select(fields).toArray(limit)`. Cleaner, chainable, but check instance version support.',
66
+ '',
67
+ '### Client Controller Patterns',
68
+ '- **`$scope.data`** (or `c.data`): read-only mirror of server data. Modify `c.data` and call `c.server.update()` to sync back.',
69
+ '- **`c.server.update()`:** sends `c.data` to the server script as `input`. Returns a promise. Use `.then(function(response) { c.data = response.data; })` to handle the response.',
70
+ '- **`c.server.get(params)`:** sends arbitrary params object to the server without merging with `c.data`.',
71
+ '- **`spUtil` service:**',
72
+ ' - `spUtil.update($scope)` — alternative to `c.server.update()` with automatic `$scope.data` binding.',
73
+ ' - `spUtil.get(widgetId, options)` — dynamically load a widget.',
74
+ ' - `spUtil.addInfoMessage(msg)` / `spUtil.addErrorMessage(msg)` — toast notifications.',
75
+ ' - `spUtil.addTrivialMessage(msg)` — subtle notification.',
76
+ ' - `spUtil.recordWatch($scope, table, filter, callback)` — real-time record updates via Ambient Message.',
77
+ '- **`$rootScope.$broadcast` / `$on`:** inter-widget communication. Use custom events (e.g., `$rootScope.$broadcast(\'my-widget.data-changed\', payload)`).',
78
+ '- **`$location` service:** read/manipulate URL for routing within the portal.',
79
+ '- **`$timeout` service:** use instead of `setTimeout` for Angular digest-safe delays.',
80
+ '',
81
+ '### HTML Template Patterns',
82
+ '- **Binding:** use `{{c.data.field}}` for interpolation, `ng-bind="c.data.field"` for safer XSS-free rendering.',
83
+ '- **Lists:** `ng-repeat="item in c.data.items track by item.sys_id"` — always use `track by` for performance.',
84
+ '- **Conditionals:** `ng-if="c.data.showSection"` (removes DOM) vs `ng-show` (hides with CSS).',
85
+ '- **Forms:** `ng-model="c.data.formField"` for two-way binding. Use `ng-submit="c.submitForm()"` on `<form>`.',
86
+ '- **Events:** `ng-click="c.doAction(item)"`, `ng-change="c.onFieldChange()"`, `ng-keypress`.',
87
+ '- **Embedded widgets:** `<sp-widget widget="c.data.embeddedWidget"></sp-widget>`.',
88
+ '- **Accessibility:** always include `aria-label`, `role`, `tabindex` on interactive elements. Use semantic HTML (`<button>`, `<a>`, `<nav>`).',
89
+ '- **Localization:** use `${gs.getMessage("key")}` in server script or `{{::c.data.translatedLabel}}` — never hardcode user-facing strings.',
90
+ '',
91
+ '### CSS/SCSS Patterns',
92
+ '- Widgets get **scoped CSS** — styles apply only within the widget\'s DOM boundary.',
93
+ '- Use **BEM naming:** `.widget-name__element--modifier`.',
94
+ '- Use **ServiceNow SCSS variables:** `$brand-primary`, `$brand-success`, `$brand-danger`, `$text-color`, `$panel-bg`, etc.',
95
+ '- **Responsive breakpoints:** use `@media (max-width: 768px)` for mobile. Portal uses Bootstrap 3 grid (`col-xs-`, `col-sm-`, `col-md-`, `col-lg-`).',
96
+ '- Avoid `!important` — use specificity instead.',
97
+ '- Avoid absolute positioning unless necessary — prefer flexbox.',
98
+ '',
99
+ '### Security Considerations',
100
+ '- **XSS prevention:** ALWAYS use `ng-bind` instead of `{{}}` for user-generated content. Never use `ng-bind-html` with unsanitized data. If HTML rendering is required, sanitize with `$sce.trustAsHtml()` only after server-side sanitization.',
101
+ '- **ACL enforcement:** server script runs with the current user\'s session. GlideRecord queries respect ACLs by default. Do NOT use `GlideRecordSecure` (it is for background scripts, not portal widgets).',
102
+ '- **Input validation:** validate all `input` fields in the server script before processing. Never trust client data.',
103
+ '- **Role checks:** use `gs.hasRole()` in server script, NOT in the client controller (client-side role checks can be bypassed).',
104
+ '- **SQL injection:** always use GlideRecord API methods — never concatenate strings into `addEncodedQuery()`.',
105
+ '',
106
+ '### Widget Options',
107
+ '- Define configurable options (title, table, filter, show/hide sections) so the widget is reusable across pages.',
108
+ '- Access via `options.my_option` in server script.',
109
+ '- Option types: String, Integer, Boolean, Reference, Choice, Field List.',
110
+ '',
111
+ '### Data Brokers',
112
+ '- Alternative to server scripts for data retrieval in newer portal pages.',
113
+ '- Types: Table, REST, Script.',
114
+ '- Advantages: cacheable, shareable between widgets, GraphQL-like field selection.',
115
+ '',
116
+ '---',
117
+ '',
118
+ `Starting widget build for: **${desc}**`,
119
+ widgetName !== '<auto-generate from description>'
120
+ ? `Widget name: **${widgetName}**`
121
+ : 'Widget name: will be generated from requirement',
122
+ table !== '<not specified>'
123
+ ? `Primary table: **${table}**`
124
+ : 'Primary table: to be determined from requirement analysis',
125
+ ].join('\n'),
126
+ },
127
+ },
128
+ {
129
+ role: 'user',
130
+ content: {
131
+ type: 'text',
132
+ text: [
133
+ `Build a Service Portal widget for the following requirement:`,
134
+ `**Requirement:** ${desc}`,
135
+ `**Widget name:** ${widgetName}`,
136
+ `**Table:** ${table}`,
137
+ '',
138
+ 'Follow these steps exactly:',
139
+ '',
140
+ '### Step 1 — Understand the Requirement',
141
+ 'Analyze the requirement and determine:',
142
+ '- **Data needs:** what data the widget displays or manipulates. Which table(s) and fields are involved.',
143
+ '- **User interaction:** what actions can the user perform (view, filter, create, edit, submit, approve).',
144
+ '- **Target users:** who uses this widget (end users, fulfillers, managers). This affects data scoping and ACL considerations.',
145
+ table !== '<not specified>'
146
+ ? `- **Table:** ${table}. Use **get_table_schema** to understand its fields, types, and reference relationships.`
147
+ : '- **Table:** determine the correct table(s). Use **get_table_schema** to verify.',
148
+ '- **Widget context:** where will this widget live (main content, sidebar, modal, embedded in another widget).',
149
+ '',
150
+ '### Step 2 — Check Existing Widgets for Reuse',
151
+ 'Use **list_portal_widgets** to find widgets with similar functionality. For each candidate:',
152
+ '- Review its server script, client controller, and template.',
153
+ '- Assess whether it can be reused directly, extended via options, or used as a starting template.',
154
+ '- If a suitable widget exists, recommend using or cloning it instead of building from scratch.',
155
+ '',
156
+ '### Step 3 — Design Widget Architecture',
157
+ 'Plan the widget structure before coding:',
158
+ '',
159
+ '```',
160
+ `WIDGET: ${widgetName !== '<auto-generate from description>' ? widgetName : '[generated-name]'}`,
161
+ ' SERVER SCRIPT:',
162
+ ' - data.xxx = [description of each data property]',
163
+ ' - input handling: [what client callbacks are supported]',
164
+ ' CLIENT CONTROLLER:',
165
+ ' - c.methodName() — [description of each method]',
166
+ ' - $scope.$on events — [inter-widget communication]',
167
+ ' HTML TEMPLATE:',
168
+ ' - [layout description: header, body, footer]',
169
+ ' - [list of Angular directives used]',
170
+ ' CSS:',
171
+ ' - [responsive behavior]',
172
+ ' - [key style patterns]',
173
+ ' OPTIONS:',
174
+ ' - [configurable options for reusability]',
175
+ '```',
176
+ '',
177
+ '### Step 4 — Generate Server Script',
178
+ 'Write the server script following these requirements:',
179
+ '- Set all `data` properties needed by the template.',
180
+ '- Handle `input` callbacks from the client (check `if (input && input.action === "xxx")`).',
181
+ '- Use `$sp` API for portal-specific operations.',
182
+ '- Apply GlideRecord queries with proper encoded queries and field limits (`.setLimit()`, `.chooseWindow()` for pagination).',
183
+ '- Check `gs.hasRole()` for any role-gated data.',
184
+ '- Call `canRead()` on GlideRecords before exposing sensitive data.',
185
+ '- Include JSDoc-style comments explaining each data property and input handler.',
186
+ '- For embedded widgets, use `data.embeddedWidget = $sp.getWidget("widget-id", options)`.',
187
+ '',
188
+ '### Step 5 — Generate Client Controller',
189
+ 'Write the AngularJS client controller:',
190
+ '- Inject only needed services: `$scope`, `spUtil`, `$location`, `$timeout`, `$rootScope`.',
191
+ '- Define `c.server.update()` calls for each client-to-server action.',
192
+ '- Use `.then()` promises on all async operations.',
193
+ '- Implement `spUtil.recordWatch()` if real-time updates are needed.',
194
+ '- Broadcast/listen for inter-widget events with `$rootScope.$broadcast` / `$scope.$on`.',
195
+ '- Handle loading states: set `c.data.loading = true` before server calls, `false` in `.then()`.',
196
+ '- Avoid direct DOM manipulation — use Angular directives and `c.data` bindings.',
197
+ '',
198
+ '### Step 6 — Generate HTML Template',
199
+ 'Write the Angular HTML template:',
200
+ '- Use `ng-bind` instead of `{{}}` for user-generated content (XSS prevention).',
201
+ '- Include `track by` on all `ng-repeat` directives.',
202
+ '- Use semantic HTML elements (`<section>`, `<article>`, `<nav>`, `<button>`).',
203
+ '- Add ARIA attributes on interactive elements: `aria-label`, `aria-expanded`, `aria-live` for dynamic regions.',
204
+ '- Support keyboard navigation: `tabindex`, `ng-keypress` for keyboard-accessible actions.',
205
+ '- Use Bootstrap 3 grid classes for responsive layout: `col-xs-12 col-sm-6 col-md-4`.',
206
+ '- Show loading spinner during async operations: `<div ng-if="c.data.loading"><i class="fa fa-spinner fa-spin"></i></div>`.',
207
+ '- Include empty-state messaging when no data is returned.',
208
+ '',
209
+ '### Step 7 — Generate SCSS',
210
+ 'Write the SCSS styles:',
211
+ '- Follow BEM naming: `.widget-name__element--modifier`.',
212
+ '- Use ServiceNow SCSS variables (`$brand-primary`, `$text-color`, `$panel-bg`) for theme consistency.',
213
+ '- Implement responsive design with media queries.',
214
+ '- Use flexbox for layout alignment.',
215
+ '- Avoid inline styles in the template — use CSS classes.',
216
+ '- Add hover/focus states for interactive elements.',
217
+ '- Keep specificity low — avoid `!important` and deep nesting.',
218
+ '',
219
+ '### Step 8 — Security Review',
220
+ 'Audit the generated widget for security issues:',
221
+ '- **XSS:** verify no unsanitized user input is rendered via `ng-bind-html` or `{{}}`. All user-generated content uses `ng-bind`.',
222
+ '- **ACL bypass:** verify server script does not use `setWorkflow(false)` or bypass ACLs. All GlideRecord queries run with the user\'s session.',
223
+ '- **Input validation:** verify all `input` fields from client callbacks are validated in the server script (type, length, allowed values).',
224
+ '- **CSRF:** `c.server.update()` includes CSRF token automatically via the platform. No manual CSRF handling needed.',
225
+ '- **Data exposure:** verify the server script does not send more data than the template needs (don\'t send entire GlideRecord objects).',
226
+ '- **Role gates:** verify sensitive actions check `gs.hasRole()` in the server script, not just in the client.',
227
+ '',
228
+ '### Step 9 — Create the Widget',
229
+ 'Use **create_portal_widget** with:',
230
+ '- Widget ID (kebab-case, descriptive).',
231
+ '- Display name.',
232
+ '- Server script, client controller, HTML template, and CSS.',
233
+ '- Widget options schema if applicable.',
234
+ '',
235
+ 'Report the sys_id of the created widget.',
236
+ '',
237
+ 'Provide a summary of how to add the widget to a portal page:',
238
+ '1. Navigate to Service Portal > Pages.',
239
+ '2. Open the target page in Page Editor.',
240
+ '3. Add a container/row/column if needed.',
241
+ '4. Drag the widget into the column.',
242
+ '5. Configure widget options in the instance editor.',
243
+ ].join('\n'),
244
+ },
245
+ },
246
+ ];
247
+ },
248
+ };
249
+ export default capability;
250
+ //# sourceMappingURL=build-portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-portal.js","sourceRoot":"","sources":["../../../src/prompts/capabilities/build-portal.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAyB;IACvC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,4GAA4G;IAC9G,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,6CAA6C;YAC1D,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8B;wBAC9B,iDAAiD;wBACjD,kIAAkI;wBAClI,gJAAgJ;wBAChJ,4IAA4I;wBAC5I,qHAAqH;wBACrH,yIAAyI;wBACzI,+GAA+G;wBAC/G,EAAE;wBACF,gCAAgC;wBAChC,oCAAoC;wBACpC,wCAAwC;wBACxC,iBAAiB;wBACjB,6DAA6D;wBAC7D,wCAAwC;wBACxC,EAAE;wBACF,0CAA0C;wBAC1C,EAAE;wBACF,8DAA8D;wBAC9D,wCAAwC;wBACxC,yCAAyC;wBACzC,0CAA0C;wBAC1C,qCAAqC;wBACrC,qDAAqD;qBACtD,CAAC,IAAI,CAAC,IAAI,CAAC;iBACb;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { CapabilityDefinition } from '../types.js';
2
+ declare const capability: CapabilityDefinition;
3
+ export default capability;
4
+ //# sourceMappingURL=build-rest-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-rest-api.d.ts","sourceRoot":"","sources":["../../../src/prompts/capabilities/build-rest-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,QAAA,MAAM,UAAU,EAAE,oBAsSjB,CAAC;AAEF,eAAe,UAAU,CAAC"}