snow-flow 2.0.2 → 2.0.3

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 (173) hide show
  1. package/{.claude/mcp-config.json → .mcp.json} +13 -12
  2. package/.releaserc.json +47 -0
  3. package/README.md +6 -0
  4. package/package.json +1 -1
  5. package/.claude/claude-settings.json +0 -15
  6. package/.claude/commands/analysis/README.md +0 -9
  7. package/.claude/commands/automation/README.md +0 -9
  8. package/.claude/commands/github/README.md +0 -11
  9. package/.claude/commands/helpers/standard-checkpoint-hooks.sh +0 -179
  10. package/.claude/commands/hooks/README.md +0 -11
  11. package/.claude/commands/monitoring/README.md +0 -9
  12. package/.claude/commands/optimization/README.md +0 -9
  13. package/.claude/commands/training/README.md +0 -9
  14. package/.claude/commands/workflows/README.md +0 -9
  15. package/.claude/config.json +0 -36
  16. package/.claude/helpers/github-setup.sh +0 -28
  17. package/.claude/helpers/quick-start.sh +0 -19
  18. package/.claude/helpers/setup-mcp.sh +0 -18
  19. package/.claude/settings.json +0 -114
  20. package/.claude/settings.local.json +0 -33
  21. package/.claude-flow/metrics/agent-metrics.json +0 -1
  22. package/.claude-flow/metrics/performance.json +0 -9
  23. package/.claude-flow/metrics/system-metrics.json +0 -15986
  24. package/.claude-flow/metrics/task-metrics.json +0 -10
  25. package/.roo/README.md +0 -402
  26. package/.roo/mcp-list.txt +0 -257
  27. package/.roo/mcp.json +0 -32
  28. package/.roo/workflows/basic-tdd.json +0 -32
  29. package/.roomodes +0 -201
  30. package/CLAUDE.md +0 -393
  31. package/bin/snow-flow.js +0 -3
  32. package/dist/cli.js.bak +0 -2052
  33. package/dist/config/snow-flow-config.d.ts +0 -1492
  34. package/dist/config/snow-flow-config.js +0 -938
  35. package/scripts/create-env.js +0 -91
  36. package/scripts/postinstall.js +0 -30
  37. package/scripts/register-mcp-servers.js +0 -210
  38. package/scripts/reset-mcp-servers.js +0 -246
  39. package/scripts/setup-mcp.js +0 -106
  40. package/scripts/update-version.js +0 -31
  41. package/src/agents/README.md +0 -192
  42. package/src/agents/base-agent.ts +0 -251
  43. package/src/agents/coordinator.ts +0 -971
  44. package/src/agents/index.ts +0 -18
  45. package/src/agents/queen-403-handler.ts +0 -230
  46. package/src/agents/queen-agent.ts +0 -1399
  47. package/src/agents/script-writer-agent.ts +0 -769
  48. package/src/agents/security-agent.ts +0 -726
  49. package/src/agents/widget-creator-agent.ts +0 -568
  50. package/src/api/error-handling.ts +0 -1758
  51. package/src/api/natural-language-mapper.ts +0 -630
  52. package/src/api/performance-optimizer.ts +0 -891
  53. package/src/api/transaction-manager.ts +0 -754
  54. package/src/cli/deploy-artifact.ts +0 -304
  55. package/src/cli/snow-flow-cli-integration.ts +0 -434
  56. package/src/cli.ts +0 -4455
  57. package/src/cli.ts.bak +0 -5616
  58. package/src/compliance/advanced-compliance-system.ts +0 -1268
  59. package/src/compliance/index.ts +0 -19
  60. package/src/config/snow-flow-config.ts +0 -1019
  61. package/src/documentation/index.ts +0 -16
  62. package/src/documentation/self-documenting-system.ts +0 -1421
  63. package/src/dynamic-version.ts +0 -44
  64. package/src/healing/index.ts +0 -20
  65. package/src/healing/self-healing-system.ts +0 -1435
  66. package/src/health/README.md +0 -161
  67. package/src/health/system-health.ts +0 -995
  68. package/src/index.ts +0 -60
  69. package/src/intelligence/acl-analyzer.ts +0 -377
  70. package/src/intelligence/auto-resolution-engine.ts +0 -643
  71. package/src/intelligence/gap-analysis-engine.ts +0 -488
  72. package/src/intelligence/manual-instructions-generator.ts +0 -744
  73. package/src/intelligence/mcp-coverage-analyzer.ts +0 -708
  74. package/src/intelligence/multi-pass-requirements-analyzer.ts +0 -603
  75. package/src/intelligence/performance-recommendations-engine.ts +0 -1223
  76. package/src/intelligence/requirements-analyzer.ts +0 -1148
  77. package/src/intelligence/task-analyzer.ts +0 -628
  78. package/src/managers/scope-manager.ts +0 -555
  79. package/src/mcp/advanced/servicenow-advanced-features-mcp.ts +0 -16110
  80. package/src/mcp/base-mcp-server.ts +0 -660
  81. package/src/mcp/http-transport-wrapper.ts +0 -426
  82. package/src/mcp/service-discovery-client.ts +0 -312
  83. package/src/mcp/servicenow-automation-mcp-refactored.ts +0 -678
  84. package/src/mcp/servicenow-automation-mcp.ts +0 -838
  85. package/src/mcp/servicenow-deployment-mcp-refactored.ts +0 -1292
  86. package/src/mcp/servicenow-deployment-mcp.ts +0 -7244
  87. package/src/mcp/servicenow-graph-memory-mcp-refactored.ts +0 -721
  88. package/src/mcp/servicenow-graph-memory-mcp.ts +0 -832
  89. package/src/mcp/servicenow-integration-mcp-refactored.ts +0 -655
  90. package/src/mcp/servicenow-integration-mcp.ts +0 -819
  91. package/src/mcp/servicenow-intelligent-mcp-refactored.ts +0 -977
  92. package/src/mcp/servicenow-intelligent-mcp.ts +0 -4638
  93. package/src/mcp/servicenow-mcp-server.ts +0 -728
  94. package/src/mcp/servicenow-memory-mcp.ts +0 -474
  95. package/src/mcp/servicenow-operations-mcp-refactored.ts +0 -1995
  96. package/src/mcp/servicenow-operations-mcp.ts +0 -3384
  97. package/src/mcp/servicenow-platform-development-mcp-refactored.ts +0 -611
  98. package/src/mcp/servicenow-platform-development-mcp.ts +0 -970
  99. package/src/mcp/servicenow-progressive-indexer.ts +0 -370
  100. package/src/mcp/servicenow-reporting-analytics-mcp-refactored.ts +0 -695
  101. package/src/mcp/servicenow-reporting-analytics-mcp.ts +0 -1123
  102. package/src/mcp/servicenow-security-compliance-mcp-refactored.ts +0 -642
  103. package/src/mcp/servicenow-security-compliance-mcp.ts +0 -1157
  104. package/src/mcp/servicenow-update-set-mcp-refactored.ts +0 -751
  105. package/src/mcp/servicenow-update-set-mcp.ts +0 -811
  106. package/src/mcp/shared/agent-context-provider.ts +0 -365
  107. package/src/mcp/shared/base-mcp-server.ts +0 -2463
  108. package/src/mcp/shared/mcp-memory-manager.ts +0 -540
  109. package/src/mcp/shared/mcp-resource-manager.ts +0 -367
  110. package/src/mcp/snow-flow-mcp.ts +0 -911
  111. package/src/mcp/start-all-mcp-servers.ts +0 -102
  112. package/src/mcp/start-servicenow-mcp.ts +0 -67
  113. package/src/monitoring/enhanced-monitoring-system.ts +0 -1345
  114. package/src/monitoring/performance-tracker.ts +0 -777
  115. package/src/optimization/cost-optimization-engine.ts +0 -1125
  116. package/src/optimization/index.ts +0 -10
  117. package/src/queen/README.md +0 -403
  118. package/src/queen/agent-factory.ts +0 -574
  119. package/src/queen/index.ts +0 -94
  120. package/src/queen/mcp-execution-bridge.ts +0 -681
  121. package/src/queen/neural-learning.ts +0 -319
  122. package/src/queen/parallel-agent-engine.ts +0 -848
  123. package/src/queen/queen-memory-system.ts +0 -490
  124. package/src/queen/queen-memory.ts +0 -456
  125. package/src/queen/servicenow-queen.ts +0 -1029
  126. package/src/queen/types.ts +0 -87
  127. package/src/rollback/smart-rollback-system.ts +0 -866
  128. package/src/schemas/deployment.schema.json +0 -58
  129. package/src/schemas/flow.schema.json +0 -79
  130. package/src/schemas/widget.schema.json +0 -72
  131. package/src/snow-flow-system.ts +0 -541
  132. package/src/sparc/sparc-help.ts +0 -49
  133. package/src/sparc/team-sparc.ts +0 -88
  134. package/src/strategies/global-scope-strategy.ts +0 -736
  135. package/src/templates/base/application.template.json +0 -45
  136. package/src/templates/base/business_rule.template.json +0 -33
  137. package/src/templates/base/script_include.template.json +0 -18
  138. package/src/templates/base/table.template.json +0 -64
  139. package/src/templates/base/widget.template.json +0 -25
  140. package/src/templates/patterns/composite.incident-management.template.json +0 -140
  141. package/src/templates/patterns/widget.dashboard.template.json +0 -238
  142. package/src/templates/patterns/widget.datatable.template.json +0 -292
  143. package/src/testing/integration-test-suite.ts +0 -1276
  144. package/src/types/index.ts +0 -183
  145. package/src/types/neo4j-driver.d.ts +0 -23
  146. package/src/types/servicenow.types.ts +0 -307
  147. package/src/types/snow-flow.types.ts +0 -186
  148. package/src/types/todo.types.ts +0 -70
  149. package/src/utils/action-type-cache.ts +0 -286
  150. package/src/utils/agent-detector.ts +0 -573
  151. package/src/utils/artifact-tracker.ts +0 -379
  152. package/src/utils/dependency-detector.ts +0 -233
  153. package/src/utils/deployment-metadata-handler.ts +0 -518
  154. package/src/utils/error-recovery.ts +0 -680
  155. package/src/utils/logger.ts +0 -60
  156. package/src/utils/mcp-auth-middleware.ts +0 -262
  157. package/src/utils/mcp-config-manager.ts +0 -270
  158. package/src/utils/mcp-server-manager.ts +0 -446
  159. package/src/utils/mcp-tool-registry.ts +0 -298
  160. package/src/utils/migrate-snow-flow.ts +0 -98
  161. package/src/utils/oauth-html-templates.ts +0 -188
  162. package/src/utils/scope-utils.ts +0 -443
  163. package/src/utils/servicenow-client.ts +0 -3321
  164. package/src/utils/servicenow-id-generator.ts +0 -181
  165. package/src/utils/snow-memory-manager.ts +0 -605
  166. package/src/utils/snow-oauth.ts +0 -797
  167. package/src/utils/template-engine.ts +0 -463
  168. package/src/utils/theme-manager.ts +0 -295
  169. package/src/utils/unified-auth-store.ts +0 -222
  170. package/src/utils/update-set-importer.ts +0 -422
  171. package/src/utils/update-set-xml-packager.ts +0 -371
  172. package/src/utils/widget-template-generator.ts +0 -1744
  173. package/src/version.ts +0 -1950
@@ -1,744 +0,0 @@
1
- /**
2
- * Manual Instructions Generator - Creates detailed manual setup guides
3
- *
4
- * This module generates comprehensive, step-by-step instructions for ServiceNow
5
- * configurations that cannot be automated through MCP tools or direct API calls.
6
- *
7
- * Features:
8
- * - Role-specific instructions (admin, developer, end-user)
9
- * - Environment-aware guidance (dev, test, prod)
10
- * - Risk assessment and warnings
11
- * - Prerequisites and dependencies
12
- * - Verification steps and testing guidance
13
- */
14
-
15
- import { ServiceNowRequirement, RequirementType } from './requirements-analyzer';
16
- import { ResolutionResult } from './auto-resolution-engine';
17
-
18
- export interface ManualInstruction {
19
- step: number;
20
- title: string;
21
- description: string;
22
- navigation: string[];
23
- actions: string[];
24
- screenshots?: string[];
25
- warnings?: string[];
26
- verificationSteps?: string[];
27
- estimatedTime?: string;
28
- }
29
-
30
- export interface ManualGuide {
31
- requirement: ServiceNowRequirement;
32
- title: string;
33
- overview: string;
34
- prerequisites: string[];
35
- totalEstimatedTime: string;
36
- riskLevel: 'low' | 'medium' | 'high';
37
- requiredRoles: string[];
38
- environment: 'development' | 'testing' | 'production' | 'any';
39
- instructions: ManualInstruction[];
40
- verificationGuide: string[];
41
- troubleshooting: Array<{
42
- issue: string;
43
- solution: string;
44
- }>;
45
- relatedDocuments: string[];
46
- }
47
-
48
- export interface BulkManualGuide {
49
- title: string;
50
- overview: string;
51
- executionOrder: Array<{
52
- phase: string;
53
- requirements: ServiceNowRequirement[];
54
- parallelExecution: boolean;
55
- estimatedTime: string;
56
- }>;
57
- guides: ManualGuide[];
58
- overallRisks: string[];
59
- coordinationNotes: string[];
60
- }
61
-
62
- /**
63
- * Manual instruction templates for ServiceNow configurations
64
- */
65
- export const MANUAL_INSTRUCTION_TEMPLATES: Partial<Record<RequirementType, Partial<ManualGuide>>> = {
66
- // System Configuration
67
- system_property: {
68
- title: 'Create System Property',
69
- overview: 'System properties control global ServiceNow behavior and should be configured carefully.',
70
- prerequisites: ['admin role', 'understanding of property impact'],
71
- riskLevel: 'medium',
72
- requiredRoles: ['admin'],
73
- instructions: [
74
- {
75
- step: 1,
76
- title: 'Navigate to System Properties',
77
- description: 'Access the system properties configuration',
78
- navigation: ['System Definition', 'System Properties'],
79
- actions: [
80
- 'Click on System Definition in the left navigation',
81
- 'Select System Properties from the submenu',
82
- 'Review existing properties to avoid duplicates'
83
- ],
84
- estimatedTime: '1 minute'
85
- },
86
- {
87
- step: 2,
88
- title: 'Create New Property',
89
- description: 'Add the new system property with correct settings',
90
- navigation: [],
91
- actions: [
92
- 'Click the "New" button',
93
- 'Enter the property name (use descriptive naming)',
94
- 'Set the property value',
95
- 'Add a clear description explaining the purpose',
96
- 'Select appropriate type (string, boolean, integer, etc.)'
97
- ],
98
- warnings: [
99
- 'Test property changes in development first',
100
- 'Document the business reason for the property',
101
- 'Some properties require instance restart'
102
- ],
103
- estimatedTime: '3 minutes'
104
- }
105
- ],
106
- verificationGuide: [
107
- 'Verify property appears in system properties list',
108
- 'Test that property value is correctly applied',
109
- 'Monitor system logs for any warnings or errors'
110
- ]
111
- },
112
-
113
- // Database Management
114
- database_index: {
115
- title: 'Create Database Index',
116
- overview: 'Database indexes improve query performance but should be created carefully to avoid negative impact.',
117
- prerequisites: ['admin role', 'database performance knowledge', 'development environment testing'],
118
- riskLevel: 'high',
119
- requiredRoles: ['admin'],
120
- instructions: [
121
- {
122
- step: 1,
123
- title: 'Navigate to Table Configuration',
124
- description: 'Access the target table for index creation',
125
- navigation: ['System Definition', 'Tables'],
126
- actions: [
127
- 'Search for the target table',
128
- 'Open the table definition',
129
- 'Go to the "Database Indexes" related list'
130
- ],
131
- warnings: [
132
- 'NEVER create indexes on production without development testing',
133
- 'Monitor database performance during index creation'
134
- ],
135
- estimatedTime: '2 minutes'
136
- },
137
- {
138
- step: 2,
139
- title: 'Create Index',
140
- description: 'Configure the database index with optimal settings',
141
- navigation: [],
142
- actions: [
143
- 'Click "New" in the Database Indexes related list',
144
- 'Set a descriptive index name',
145
- 'Select index type (index, unique, etc.)',
146
- 'Add fields to index in optimal order',
147
- 'Consider composite indexes for multi-field queries'
148
- ],
149
- warnings: [
150
- 'Index creation can impact database performance',
151
- 'Test query performance before and after',
152
- 'Consider maintenance windows for large tables'
153
- ],
154
- verificationSteps: [
155
- 'Verify index appears in database',
156
- 'Test query performance improvement',
157
- 'Monitor for any locking issues'
158
- ],
159
- estimatedTime: '10 minutes'
160
- }
161
- ],
162
- troubleshooting: [
163
- {
164
- issue: 'Index creation fails',
165
- solution: 'Check for duplicate index names, verify field names exist, ensure sufficient database permissions'
166
- },
167
- {
168
- issue: 'Performance degradation',
169
- solution: 'Review index strategy, consider dropping unused indexes, analyze query execution plans'
170
- }
171
- ]
172
- },
173
-
174
- // Navigation and UI
175
- application_menu: {
176
- title: 'Create Application Menu',
177
- overview: 'Application menus organize functionality and provide user navigation within ServiceNow applications.',
178
- prerequisites: ['admin role', 'understanding of application structure'],
179
- riskLevel: 'low',
180
- requiredRoles: ['admin'],
181
- instructions: [
182
- {
183
- step: 1,
184
- title: 'Navigate to Application Menus',
185
- description: 'Access the application menu configuration',
186
- navigation: ['System Definition', 'Application Menus'],
187
- actions: [
188
- 'Find the target application',
189
- 'Note the existing menu structure',
190
- 'Plan the new menu placement'
191
- ],
192
- estimatedTime: '1 minute'
193
- },
194
- {
195
- step: 2,
196
- title: 'Create Menu Module',
197
- description: 'Add a new module to the application menu',
198
- navigation: [],
199
- actions: [
200
- 'Right-click on the application or existing module',
201
- 'Select "New Module"',
202
- 'Set the module title and order',
203
- 'Configure the link type (LIST, DETAIL, etc.)',
204
- 'Set appropriate roles and conditions'
205
- ],
206
- verificationSteps: [
207
- 'Verify menu appears in application navigator',
208
- 'Test menu link functionality',
209
- 'Confirm proper role-based access'
210
- ],
211
- estimatedTime: '3 minutes'
212
- }
213
- ]
214
- },
215
-
216
- // Authentication and Security
217
- ldap_config: {
218
- title: 'Configure LDAP Authentication',
219
- overview: 'LDAP integration enables Single Sign-On and centralized user management.',
220
- prerequisites: ['security_admin role', 'LDAP server details', 'network connectivity'],
221
- riskLevel: 'high',
222
- requiredRoles: ['security_admin', 'admin'],
223
- instructions: [
224
- {
225
- step: 1,
226
- title: 'Navigate to LDAP Servers',
227
- description: 'Access LDAP configuration interface',
228
- navigation: ['System LDAP', 'LDAP Servers'],
229
- actions: [
230
- 'Review existing LDAP configurations',
231
- 'Gather LDAP server connection details',
232
- 'Prepare test user accounts'
233
- ],
234
- warnings: [
235
- 'LDAP configuration affects user authentication',
236
- 'Test thoroughly before enabling in production',
237
- 'Have fallback admin account ready'
238
- ],
239
- estimatedTime: '2 minutes'
240
- },
241
- {
242
- step: 2,
243
- title: 'Create LDAP Server Configuration',
244
- description: 'Configure connection to LDAP server',
245
- navigation: [],
246
- actions: [
247
- 'Click "New" to create LDAP server',
248
- 'Enter server hostname and port',
249
- 'Configure SSL settings if required',
250
- 'Set bind DN and password',
251
- 'Configure user and group search bases'
252
- ],
253
- warnings: [
254
- 'Use secure connection (LDAPS) when possible',
255
- 'Store service account credentials securely',
256
- 'Test connection before saving'
257
- ],
258
- estimatedTime: '15 minutes'
259
- },
260
- {
261
- step: 3,
262
- title: 'Configure User Mapping',
263
- description: 'Map LDAP attributes to ServiceNow user fields',
264
- navigation: [],
265
- actions: [
266
- 'Set up attribute mapping for user fields',
267
- 'Configure group membership mapping',
268
- 'Set default roles for LDAP users',
269
- 'Enable user provisioning if needed'
270
- ],
271
- verificationSteps: [
272
- 'Test LDAP connection',
273
- 'Verify user authentication',
274
- 'Confirm group membership sync',
275
- 'Test with multiple user accounts'
276
- ],
277
- estimatedTime: '10 minutes'
278
- }
279
- ],
280
- troubleshooting: [
281
- {
282
- issue: 'Connection fails',
283
- solution: 'Verify server details, check network connectivity, confirm firewall rules, validate credentials'
284
- },
285
- {
286
- issue: 'Users cannot authenticate',
287
- solution: 'Check user DN format, verify search base configuration, confirm attribute mapping'
288
- }
289
- ]
290
- },
291
-
292
- // Performance and Monitoring
293
- performance_analytics: {
294
- title: 'Configure Performance Analytics',
295
- overview: 'Performance Analytics provides data-driven insights through cubes and dashboards.',
296
- prerequisites: ['pa_admin role', 'data source understanding', 'dashboard requirements'],
297
- riskLevel: 'medium',
298
- requiredRoles: ['pa_admin'],
299
- instructions: [
300
- {
301
- step: 1,
302
- title: 'Navigate to Performance Analytics',
303
- description: 'Access PA configuration',
304
- navigation: ['Performance Analytics', 'Data Collector', 'Cubes'],
305
- actions: [
306
- 'Review existing cubes',
307
- 'Identify data sources',
308
- 'Plan cube structure'
309
- ],
310
- estimatedTime: '3 minutes'
311
- },
312
- {
313
- step: 2,
314
- title: 'Create Data Cube',
315
- description: 'Set up data collection cube',
316
- navigation: [],
317
- actions: [
318
- 'Click "New" to create cube',
319
- 'Set cube name and description',
320
- 'Select source table',
321
- 'Configure collection schedule',
322
- 'Define dimensions and measures'
323
- ],
324
- estimatedTime: '15 minutes'
325
- }
326
- ]
327
- },
328
-
329
- // Placeholder entries for other requirement types
330
- module_navigation: { title: 'Configure Module Navigation' },
331
- form_layout: { title: 'Design Form Layout' },
332
- form_section: { title: 'Create Form Section' },
333
- list_layout: { title: 'Configure List Layout' },
334
- dictionary_entry: { title: 'Create Dictionary Entry' },
335
- choice_list: { title: 'Configure Choice List' },
336
- reference_qualifier: { title: 'Set Reference Qualifier' },
337
- workflow_activity: { title: 'Create Workflow Activity' },
338
- workflow_transition: { title: 'Configure Workflow Transition' },
339
- sla_definition: { title: 'Define SLA' },
340
- escalation_rule: { title: 'Create Escalation Rule' },
341
- approval_definition: { title: 'Configure Approval Process' },
342
- oauth_provider: { title: 'Set up OAuth Provider' },
343
- saml_config: { title: 'Configure SAML Authentication' },
344
- sso_config: { title: 'Configure Single Sign-On' },
345
- mfa_config: { title: 'Set up Multi-Factor Authentication' },
346
- web_service: { title: 'Create Web Service' },
347
- soap_message: { title: 'Configure SOAP Message' },
348
- import_set_transformer: { title: 'Create Import Set Transformer' },
349
- data_source: { title: 'Configure Data Source' },
350
- ldap_server: { title: 'Configure LDAP Server' },
351
- email_template: { title: 'Create Email Template' },
352
- inbound_email_action: { title: 'Configure Inbound Email Action' },
353
- processor: { title: 'Create Processor' },
354
- pdf_generator: { title: 'Configure PDF Generator' },
355
- sys_script_validator: { title: 'Create Script Validator' },
356
- scheduled_task: { title: 'Create Scheduled Task' },
357
- metric_definition: { title: 'Define Metric' },
358
- job_queue: { title: 'Configure Job Queue' },
359
- transaction_quota: { title: 'Set Transaction Quota' },
360
- database_view: { title: 'Create Database View' },
361
- table_rotation: { title: 'Configure Table Rotation' },
362
- partitioning_config: { title: 'Set up Table Partitioning' },
363
- cache_configuration: { title: 'Configure Cache Settings' },
364
- system_definition: { title: 'Update System Definition' },
365
- theme_configuration: { title: 'Configure Theme' },
366
- branding_config: { title: 'Set up Branding' },
367
- formatter: { title: 'Create Formatter' },
368
- related_list: { title: 'Configure Related List' },
369
- coremeta_data: { title: 'Configure Core Metadata' },
370
-
371
- // Core artifacts (should be handled by MCP tools, but fallback instructions)
372
- widget: { title: 'Create Service Portal Widget' },
373
- flow: { title: 'Create Flow Designer Flow' },
374
- business_rule: { title: 'Create Business Rule' },
375
- script_include: { title: 'Create Script Include' },
376
- table: { title: 'Create Table' },
377
- application: { title: 'Create Application' },
378
- user_role: { title: 'Create User Role' },
379
- user_group: { title: 'Create User Group' },
380
- user_account: { title: 'Create User Account' },
381
- group_membership: { title: 'Assign Group Membership' },
382
- acl_rule: { title: 'Create Access Control Rule' },
383
- data_policy: { title: 'Create Data Policy' },
384
- ui_page: { title: 'Create UI Page' },
385
- ui_action: { title: 'Create UI Action' },
386
- ui_policy: { title: 'Create UI Policy' },
387
- client_script: { title: 'Create Client Script' },
388
- catalog_item: { title: 'Create Catalog Item' },
389
- catalog_variable: { title: 'Create Catalog Variable' },
390
- catalog_category: { title: 'Create Catalog Category' },
391
- notification_rule: { title: 'Create Notification Rule' },
392
- scheduled_job: { title: 'Create Scheduled Job' },
393
- event_rule: { title: 'Create Event Rule' },
394
- event_registration: { title: 'Register Event' },
395
- rest_message: { title: 'Create REST Message' },
396
- transform_map: { title: 'Create Transform Map' },
397
- import_set: { title: 'Create Import Set' },
398
- report: { title: 'Create Report' },
399
- dashboard: { title: 'Create Dashboard' },
400
- dashboard_tab: { title: 'Create Dashboard Tab' },
401
- homepage: { title: 'Configure Homepage' },
402
- update_set: { title: 'Create Update Set' },
403
- workflow_integration: { title: 'Configure Workflow Integration' },
404
- approval_workflow: { title: 'Create Approval Workflow' },
405
- integration_endpoint: { title: 'Create Integration Endpoint' },
406
- query_rule: { title: 'Create Query Rule' },
407
- incident_table: { title: 'Configure Incident Table' },
408
- incident__analysis: { title: 'Set up Incident Analysis' },
409
- knowledge_article: { title: 'Create Knowledge Article' }
410
- };
411
-
412
- export class ManualInstructionsGenerator {
413
-
414
- /**
415
- * Generate detailed manual instructions for a single requirement
416
- */
417
- static generateInstructions(requirement: ServiceNowRequirement): ManualGuide {
418
- const template = MANUAL_INSTRUCTION_TEMPLATES[requirement.type];
419
-
420
- if (!template) {
421
- return this.generateGenericInstructions(requirement);
422
- }
423
-
424
- // Merge template with requirement-specific data
425
- const guide: ManualGuide = {
426
- requirement,
427
- title: template.title || `Configure ${requirement.type}`,
428
- overview: template.overview || `Manual setup required for ${requirement.name}`,
429
- prerequisites: template.prerequisites || ['admin role', 'system understanding'],
430
- totalEstimatedTime: this.calculateTotalTime(template.instructions || []),
431
- riskLevel: template.riskLevel || 'medium',
432
- requiredRoles: template.requiredRoles || ['admin'],
433
- environment: 'development',
434
- instructions: template.instructions || [],
435
- verificationGuide: template.verificationGuide || this.generateGenericVerification(requirement),
436
- troubleshooting: template.troubleshooting || [],
437
- relatedDocuments: this.generateRelatedDocuments(requirement.type)
438
- };
439
-
440
- // Customize instructions with requirement-specific data
441
- guide.instructions = this.customizeInstructions(guide.instructions, requirement);
442
-
443
- return guide;
444
- }
445
-
446
- /**
447
- * Generate bulk manual guide for multiple requirements
448
- */
449
- static generateBulkInstructions(requirements: ServiceNowRequirement[]): BulkManualGuide {
450
- const guides = requirements.map(req => this.generateInstructions(req));
451
- const executionOrder = this.planExecutionOrder(requirements);
452
-
453
- return {
454
- title: `Manual Configuration Guide for ${requirements.length} Requirements`,
455
- overview: this.generateBulkOverview(requirements),
456
- executionOrder,
457
- guides,
458
- overallRisks: this.identifyOverallRisks(guides),
459
- coordinationNotes: this.generateCoordinationNotes(requirements)
460
- };
461
- }
462
-
463
- /**
464
- * Generate instructions from failed automation results
465
- */
466
- static generateFromFailedResults(results: ResolutionResult[]): ManualGuide[] {
467
- return results
468
- .filter(result => result.status === 'failed' || result.status === 'manual_required')
469
- .map(result => {
470
- const guide = this.generateInstructions(result.requirement);
471
-
472
- // Add failure-specific information
473
- if (result.errorMessage) {
474
- guide.overview += ` Note: Automation failed with error: ${result.errorMessage}`;
475
- }
476
-
477
- if (result.manualSteps && result.manualSteps.length > 0) {
478
- const failureStep: ManualInstruction = {
479
- step: 0,
480
- title: 'Automation Failure Recovery',
481
- description: 'Steps to recover from failed automation attempt',
482
- navigation: [],
483
- actions: result.manualSteps,
484
- warnings: ['Verify automation did not create partial configuration'],
485
- estimatedTime: '2 minutes'
486
- };
487
-
488
- guide.instructions.unshift(failureStep);
489
- }
490
-
491
- return guide;
492
- });
493
- }
494
-
495
- /**
496
- * Generate environment-specific instructions
497
- */
498
- static generateForEnvironment(
499
- requirement: ServiceNowRequirement,
500
- environment: 'development' | 'testing' | 'production'
501
- ): ManualGuide {
502
- const guide = this.generateInstructions(requirement);
503
- guide.environment = environment;
504
-
505
- // Add environment-specific warnings and procedures
506
- switch (environment) {
507
- case 'production':
508
- guide.riskLevel = guide.riskLevel === 'low' ? 'medium' : 'high';
509
- guide.prerequisites.push('change management approval', 'maintenance window', 'rollback plan');
510
- guide.instructions.forEach(instruction => {
511
- instruction.warnings = instruction.warnings || [];
512
- instruction.warnings.push('PRODUCTION ENVIRONMENT - Exercise extreme caution');
513
- });
514
- break;
515
-
516
- case 'testing':
517
- guide.prerequisites.push('test data available', 'test scenarios defined');
518
- break;
519
-
520
- case 'development':
521
- guide.prerequisites.push('development instance access');
522
- break;
523
- }
524
-
525
- return guide;
526
- }
527
-
528
- // Private helper methods
529
-
530
- private static generateGenericInstructions(requirement: ServiceNowRequirement): ManualGuide {
531
- return {
532
- requirement,
533
- title: `Configure ${requirement.type}: ${requirement.name}`,
534
- overview: `Manual configuration required for ${requirement.type}. This is a generic guide as specific instructions are not available.`,
535
- prerequisites: ['admin role', 'ServiceNow platform knowledge'],
536
- totalEstimatedTime: '15-30 minutes',
537
- riskLevel: 'medium',
538
- requiredRoles: ['admin'],
539
- environment: 'development',
540
- instructions: [
541
- {
542
- step: 1,
543
- title: 'Research Configuration',
544
- description: 'Find the appropriate ServiceNow configuration area',
545
- navigation: ['Research in ServiceNow documentation'],
546
- actions: [
547
- 'Search ServiceNow documentation for configuration steps',
548
- 'Identify the correct navigation path',
549
- 'Review similar existing configurations'
550
- ],
551
- estimatedTime: '10 minutes'
552
- },
553
- {
554
- step: 2,
555
- title: 'Create Configuration',
556
- description: 'Implement the required configuration',
557
- navigation: ['Navigate to appropriate section'],
558
- actions: [
559
- 'Create new configuration item',
560
- 'Set name and description appropriately',
561
- 'Configure settings according to requirements',
562
- 'Test configuration thoroughly'
563
- ],
564
- warnings: ['Test in development environment first'],
565
- estimatedTime: '15 minutes'
566
- }
567
- ],
568
- verificationGuide: this.generateGenericVerification(requirement),
569
- troubleshooting: [
570
- {
571
- issue: 'Configuration not found',
572
- solution: 'Check ServiceNow documentation or contact system administrator'
573
- }
574
- ],
575
- relatedDocuments: ['ServiceNow Product Documentation', 'Internal Configuration Standards']
576
- };
577
- }
578
-
579
- private static generateGenericVerification(requirement: ServiceNowRequirement): string[] {
580
- return [
581
- `Verify ${requirement.name} appears in the appropriate list`,
582
- 'Test functionality according to requirements',
583
- 'Confirm proper access controls are in place',
584
- 'Document configuration for future reference'
585
- ];
586
- }
587
-
588
- private static calculateTotalTime(instructions: ManualInstruction[]): string {
589
- if (instructions.length === 0) return '15 minutes';
590
-
591
- const totalMinutes = instructions.reduce((total, instruction) => {
592
- const time = instruction.estimatedTime || '5 minutes';
593
- const minutes = parseInt(time.match(/\d+/)?.[0] || '5');
594
- return total + minutes;
595
- }, 0);
596
-
597
- return `${totalMinutes} minutes`;
598
- }
599
-
600
- private static customizeInstructions(
601
- instructions: ManualInstruction[],
602
- requirement: ServiceNowRequirement
603
- ): ManualInstruction[] {
604
- return instructions.map(instruction => ({
605
- ...instruction,
606
- actions: instruction.actions.map(action =>
607
- action
608
- .replace('${name}', requirement.name)
609
- .replace('${description}', requirement.description || requirement.name)
610
- )
611
- }));
612
- }
613
-
614
- private static generateBulkOverview(requirements: ServiceNowRequirement[]): string {
615
- const typeCount = requirements.reduce((acc, req) => {
616
- acc[req.type] = (acc[req.type] || 0) + 1;
617
- return acc;
618
- }, {} as Record<string, number>);
619
-
620
- const typeSummary = Object.entries(typeCount)
621
- .map(([type, count]) => `${count} ${type}`)
622
- .join(', ');
623
-
624
- return `This guide covers manual configuration of ${requirements.length} ServiceNow requirements: ${typeSummary}. Follow the execution order to ensure proper sequencing and dependencies.`;
625
- }
626
-
627
- private static planExecutionOrder(requirements: ServiceNowRequirement[]): BulkManualGuide['executionOrder'] {
628
- // Group requirements by logical execution phases
629
- const phases = [
630
- {
631
- phase: 'Foundation Setup',
632
- types: ['table', 'application', 'system_property', 'database_index'],
633
- parallelExecution: false
634
- },
635
- {
636
- phase: 'Security Configuration',
637
- types: ['user_role', 'user_group', 'acl_rule', 'data_policy', 'ldap_config', 'oauth_provider'],
638
- parallelExecution: true
639
- },
640
- {
641
- phase: 'Core Development',
642
- types: ['business_rule', 'script_include', 'client_script', 'ui_policy', 'ui_action'],
643
- parallelExecution: true
644
- },
645
- {
646
- phase: 'User Interface',
647
- types: ['widget', 'ui_page', 'form_layout', 'form_section', 'application_menu'],
648
- parallelExecution: true
649
- },
650
- {
651
- phase: 'Workflows and Automation',
652
- types: ['flow', 'workflow_activity', 'scheduled_job', 'notification_rule', 'event_rule'],
653
- parallelExecution: true
654
- },
655
- {
656
- phase: 'Integration and Analytics',
657
- types: ['rest_message', 'web_service', 'performance_analytics', 'report', 'dashboard'],
658
- parallelExecution: true
659
- }
660
- ];
661
-
662
- return phases
663
- .map(phase => {
664
- const phaseRequirements = requirements.filter(req => phase.types.includes(req.type));
665
- if (phaseRequirements.length === 0) return null;
666
-
667
- const totalTime = phaseRequirements.length * 10; // Estimate 10 min per requirement
668
- const estimatedTime = phase.parallelExecution
669
- ? `${Math.max(10, totalTime / 3)} minutes (parallel)`
670
- : `${totalTime} minutes (sequential)`;
671
-
672
- return {
673
- phase: phase.phase,
674
- requirements: phaseRequirements,
675
- parallelExecution: phase.parallelExecution,
676
- estimatedTime
677
- };
678
- })
679
- .filter(Boolean) as BulkManualGuide['executionOrder'];
680
- }
681
-
682
- private static identifyOverallRisks(guides: ManualGuide[]): string[] {
683
- const risks: string[] = [];
684
-
685
- const highRiskCount = guides.filter(g => g.riskLevel === 'high').length;
686
- if (highRiskCount > 0) {
687
- risks.push(`${highRiskCount} high-risk configurations require extra caution`);
688
- }
689
-
690
- const securityConfigs = guides.filter(g =>
691
- ['ldap_config', 'oauth_provider', 'saml_config', 'acl_rule'].includes(g.requirement.type)
692
- ).length;
693
- if (securityConfigs > 0) {
694
- risks.push(`${securityConfigs} security configurations may affect user access`);
695
- }
696
-
697
- const databaseConfigs = guides.filter(g =>
698
- ['database_index', 'table', 'database_view'].includes(g.requirement.type)
699
- ).length;
700
- if (databaseConfigs > 0) {
701
- risks.push(`${databaseConfigs} database configurations may impact performance`);
702
- }
703
-
704
- return risks;
705
- }
706
-
707
- private static generateCoordinationNotes(requirements: ServiceNowRequirement[]): string[] {
708
- const notes: string[] = [];
709
-
710
- // Check for common coordination scenarios
711
- const hasTableAndBR = requirements.some(r => r.type === 'table') &&
712
- requirements.some(r => r.type === 'business_rule');
713
- if (hasTableAndBR) {
714
- notes.push('Create tables before business rules to ensure proper field references');
715
- }
716
-
717
- const hasUserAndGroup = requirements.some(r => r.type === 'user_account') &&
718
- requirements.some(r => r.type === 'user_group');
719
- if (hasUserAndGroup) {
720
- notes.push('Create user groups before individual user accounts for proper role assignment');
721
- }
722
-
723
- const hasFlowAndCatalog = requirements.some(r => r.type === 'flow') &&
724
- requirements.some(r => r.type === 'catalog_item');
725
- if (hasFlowAndCatalog) {
726
- notes.push('Test flows independently before linking to catalog items');
727
- }
728
-
729
- return notes;
730
- }
731
-
732
- private static generateRelatedDocuments(requirementType: RequirementType): string[] {
733
- const docMap: Record<string, string[]> = {
734
- 'system_property': ['System Properties Documentation', 'Configuration Management Guide'],
735
- 'database_index': ['Database Administration Guide', 'Performance Tuning Documentation'],
736
- 'ldap_config': ['LDAP Integration Guide', 'Authentication Configuration'],
737
- 'oauth_provider': ['OAuth Configuration Guide', 'Security Best Practices'],
738
- 'performance_analytics': ['PA Implementation Guide', 'Dashboard Design Standards'],
739
- 'workflow_activity': ['Workflow Development Guide', 'Process Design Documentation']
740
- };
741
-
742
- return docMap[requirementType] || ['ServiceNow Product Documentation', 'Implementation Best Practices'];
743
- }
744
- }