snow-flow 4.5.49 → 4.5.50

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.
@@ -1412,20 +1412,40 @@ ${executionList}
1412
1412
  }
1413
1413
  throw new Error(`Failed to configure mobile app: ${response.error}`);
1414
1414
  }
1415
+ // VERIFICATION: Confirm mobile app was configured
1416
+ const sys_id = response.data.result.sys_id;
1417
+ const verification = await this.client.getRecord('sys_mobile_application_config', sys_id);
1418
+ if (!verification.success) {
1419
+ return {
1420
+ success: false,
1421
+ error: 'Mobile app configuration reported success but record not found in sys_mobile_application_config table',
1422
+ suggestion: 'Mobile app configuration may have been rolled back due to validation errors',
1423
+ verification_failed: true
1424
+ };
1425
+ }
1426
+ this.logger.info(`✅ Mobile app configured and verified: ${sys_id}`);
1415
1427
  return {
1416
- content: [{
1417
- type: 'text',
1418
- text: `✅ Mobile App configured!
1419
-
1420
- 📱 **${args.app_name}**
1421
- 🆔 sys_id: ${response.data.sys_id}
1422
- 🔐 Authentication: ${args.authentication || 'oauth'}
1423
- 📦 Modules: ${args.enabled_modules ? args.enabled_modules.length : 0}
1424
- 💾 Offline Tables: ${args.offline_tables ? args.offline_tables.length : 0}
1425
- 🔔 Push Notifications: ${args.push_enabled !== false ? 'Enabled' : 'Disabled'}
1426
-
1427
- Mobile app configuration saved!`
1428
- }]
1428
+ success: true,
1429
+ verified: true,
1430
+ mobile_app_sys_id: sys_id,
1431
+ app_name: args.app_name,
1432
+ authentication: args.authentication || 'oauth',
1433
+ modules_count: args.enabled_modules ? args.enabled_modules.length : 0,
1434
+ offline_tables_count: args.offline_tables ? args.offline_tables.length : 0,
1435
+ push_enabled: args.push_enabled !== false,
1436
+ created_at: new Date().toISOString(),
1437
+ message: `✅ Mobile app '${args.app_name}' configured and verified successfully`,
1438
+ detailed_confirmation: {
1439
+ operation: 'CONFIGURE Mobile App',
1440
+ sys_id: sys_id,
1441
+ app_name: args.app_name,
1442
+ authentication_method: args.authentication || 'oauth',
1443
+ enabled_modules: args.enabled_modules || [],
1444
+ offline_tables: args.offline_tables || [],
1445
+ push_notifications: args.push_enabled !== false,
1446
+ verified_in_table: 'sys_mobile_application_config',
1447
+ verification_timestamp: new Date().toISOString()
1448
+ }
1429
1449
  };
1430
1450
  }
1431
1451
  catch (error) {
@@ -1458,20 +1478,39 @@ ${executionList}
1458
1478
  if (!response.success) {
1459
1479
  throw new Error(`Failed to create mobile layout: ${response.error}`);
1460
1480
  }
1481
+ // VERIFICATION: Confirm mobile layout was created
1482
+ const sys_id = response.data.result.sys_id;
1483
+ const verification = await this.client.getRecord('sys_mobile_layout', sys_id);
1484
+ if (!verification.success) {
1485
+ return {
1486
+ success: false,
1487
+ error: 'Mobile layout creation reported success but record not found in sys_mobile_layout table',
1488
+ suggestion: 'Mobile layout creation may have been rolled back due to validation errors',
1489
+ verification_failed: true
1490
+ };
1491
+ }
1492
+ this.logger.info(`✅ Mobile layout created and verified: ${sys_id}`);
1461
1493
  return {
1462
- content: [{
1463
- type: 'text',
1464
- text: `✅ Mobile Layout created!
1465
-
1466
- 📱 **${args.name}**
1467
- 🆔 sys_id: ${response.data.sys_id}
1468
- 📋 Table: ${args.table}
1469
- 📊 Type: ${args.type}
1470
- 📝 Fields: ${args.fields ? args.fields.length : 'Default'}
1471
- 🔗 Related Lists: ${args.related_lists ? args.related_lists.length : 0}
1472
-
1473
- Mobile layout configured!`
1474
- }]
1494
+ success: true,
1495
+ verified: true,
1496
+ mobile_layout_sys_id: sys_id,
1497
+ layout_name: args.name,
1498
+ layout_table: args.table,
1499
+ layout_type: args.type,
1500
+ fields_count: args.fields ? args.fields.length : 0,
1501
+ related_lists_count: args.related_lists ? args.related_lists.length : 0,
1502
+ created_at: new Date().toISOString(),
1503
+ message: `✅ Mobile layout '${args.name}' created and verified successfully`,
1504
+ detailed_confirmation: {
1505
+ operation: 'CREATE Mobile Layout',
1506
+ sys_id: sys_id,
1507
+ name: args.name,
1508
+ table: args.table,
1509
+ type: args.type,
1510
+ fields: args.fields || [],
1511
+ verified_in_table: 'sys_mobile_layout',
1512
+ verification_timestamp: new Date().toISOString()
1513
+ }
1475
1514
  };
1476
1515
  }
1477
1516
  catch (error) {
@@ -1837,9 +1876,30 @@ ${configList}${layoutsText}${offlineText}
1837
1876
  const query = conditions.join('^');
1838
1877
  const pagesResponse = await this.client.searchRecords('sys_ux_page', query, args.limit || 50);
1839
1878
  if (!pagesResponse.success) {
1840
- throw new Error(`Failed to discover UI Builder pages: ${pagesResponse.error}`);
1879
+ return {
1880
+ success: false,
1881
+ error: `Failed to discover UI Builder pages: ${pagesResponse.error}`,
1882
+ suggestion: 'UI Builder plugin may not be installed. Check ServiceNow Store for UI Builder plugin.',
1883
+ plugin_required: 'UI Builder',
1884
+ table_tested: 'sys_ux_page'
1885
+ };
1886
+ }
1887
+ const pages = pagesResponse.data.result || [];
1888
+ // Handle no results case
1889
+ if (pages.length === 0) {
1890
+ return {
1891
+ success: true,
1892
+ pages: [],
1893
+ count: 0,
1894
+ message: '📝 No UI Builder pages found',
1895
+ explanation: 'This could mean: 1) No pages exist yet, 2) UI Builder plugin not installed, 3) Insufficient permissions to view pages',
1896
+ suggestions: [
1897
+ 'Create your first UI Builder page using snow_create_uib_page',
1898
+ 'Check if UI Builder plugin is installed and activated',
1899
+ 'Verify you have ui_builder_user or ui_builder_admin roles'
1900
+ ]
1901
+ };
1841
1902
  }
1842
- const pages = pagesResponse.data.result;
1843
1903
  // Enrich with additional data if requested
1844
1904
  for (const page of pages) {
1845
1905
  if (args.include_routing) {
@@ -1858,8 +1918,18 @@ ${configList}${layoutsText}${offlineText}
1858
1918
  this.logger.info(`✅ Found ${pages.length} UI Builder pages`);
1859
1919
  return {
1860
1920
  success: true,
1921
+ verified: true,
1861
1922
  pages: pages,
1862
- count: pages.length
1923
+ count: pages.length,
1924
+ query_used: query || 'No filter',
1925
+ message: `✅ Successfully discovered ${pages.length} UI Builder pages`,
1926
+ detailed_confirmation: {
1927
+ operation: 'DISCOVER UI Builder Pages',
1928
+ table_searched: 'sys_ux_page',
1929
+ results_count: pages.length,
1930
+ query_conditions: conditions.join(', ') || 'No conditions',
1931
+ search_timestamp: new Date().toISOString()
1932
+ }
1863
1933
  };
1864
1934
  }
1865
1935
  catch (error) {
@@ -2011,9 +2081,31 @@ ${configList}${layoutsText}${offlineText}
2011
2081
  const query = conditions.join('^');
2012
2082
  const componentsResponse = await this.client.searchRecords('sys_ux_lib_component', query, args.limit || 100);
2013
2083
  if (!componentsResponse.success) {
2014
- throw new Error(`Failed to discover components: ${componentsResponse.error}`);
2084
+ return {
2085
+ success: false,
2086
+ error: `Failed to discover UI Builder components: ${componentsResponse.error}`,
2087
+ suggestion: 'UI Builder plugin may not be installed. Check ServiceNow Store for UI Builder plugin.',
2088
+ plugin_required: 'UI Builder',
2089
+ table_tested: 'sys_ux_lib_component'
2090
+ };
2091
+ }
2092
+ const components = componentsResponse.data.result || [];
2093
+ // Handle no results case
2094
+ if (components.length === 0) {
2095
+ return {
2096
+ success: true,
2097
+ components: [],
2098
+ count: 0,
2099
+ message: '📝 No UI Builder components found',
2100
+ explanation: 'This could mean: 1) No custom components exist, 2) UI Builder plugin not installed, 3) Insufficient permissions',
2101
+ query_used: query || 'No filter',
2102
+ suggestions: [
2103
+ 'Create your first custom component using snow_create_uib_component',
2104
+ 'Check built-in components by removing custom_only filter',
2105
+ 'Verify UI Builder plugin is installed and you have proper permissions'
2106
+ ]
2107
+ };
2015
2108
  }
2016
- const components = componentsResponse.data.result;
2017
2109
  // Enrich with additional data if requested
2018
2110
  for (const component of components) {
2019
2111
  if (args.include_source && component.source_script) {
@@ -2031,8 +2123,24 @@ ${configList}${layoutsText}${offlineText}
2031
2123
  this.logger.info(`✅ Found ${components.length} UI Builder components`);
2032
2124
  return {
2033
2125
  success: true,
2126
+ verified: true,
2034
2127
  components: components,
2035
- count: components.length
2128
+ count: components.length,
2129
+ query_used: query || 'No filter',
2130
+ categories_found: [...new Set(components.map(c => c.category))],
2131
+ message: `✅ Successfully discovered ${components.length} UI Builder components`,
2132
+ detailed_confirmation: {
2133
+ operation: 'DISCOVER UI Builder Components',
2134
+ table_searched: 'sys_ux_lib_component',
2135
+ results_count: components.length,
2136
+ query_conditions: conditions.join(', ') || 'No conditions',
2137
+ enrichment_options: {
2138
+ source_included: !!args.include_source,
2139
+ usage_stats_included: !!args.include_usage_stats,
2140
+ dependencies_included: !!args.include_dependencies
2141
+ },
2142
+ search_timestamp: new Date().toISOString()
2143
+ }
2036
2144
  };
2037
2145
  }
2038
2146
  catch (error) {
@@ -2118,11 +2226,35 @@ ${configList}${layoutsText}${offlineText}
2118
2226
  if (!response.success) {
2119
2227
  throw new Error(`Failed to create data broker: ${response.error}`);
2120
2228
  }
2121
- this.logger.info('✅ UI Builder data broker created successfully');
2229
+ // VERIFICATION: Confirm data broker was created
2230
+ const sys_id = response.data.result.sys_id;
2231
+ const verification = await this.client.getRecord('sys_ux_data_broker', sys_id);
2232
+ if (!verification.success) {
2233
+ return {
2234
+ success: false,
2235
+ error: 'Data broker creation reported success but record not found in sys_ux_data_broker table',
2236
+ suggestion: 'Data broker creation may have been rolled back due to validation errors',
2237
+ verification_failed: true
2238
+ };
2239
+ }
2240
+ this.logger.info(`✅ UI Builder data broker created and verified: ${sys_id}`);
2122
2241
  return {
2123
2242
  success: true,
2124
- data_broker: response.data,
2125
- message: `Data broker '${args.name}' created for ${args.type} type`
2243
+ verified: true,
2244
+ data_broker_sys_id: sys_id,
2245
+ broker_name: args.name,
2246
+ broker_type: args.type || 'table',
2247
+ target_table: args.table || 'N/A',
2248
+ created_at: new Date().toISOString(),
2249
+ message: `✅ Data broker '${args.name}' created and verified successfully`,
2250
+ detailed_confirmation: {
2251
+ operation: 'CREATE UI Builder Data Broker',
2252
+ sys_id: sys_id,
2253
+ name: args.name,
2254
+ type: args.type || 'table',
2255
+ verified_in_table: 'sys_ux_data_broker',
2256
+ verification_timestamp: new Date().toISOString()
2257
+ }
2126
2258
  };
2127
2259
  }
2128
2260
  catch (error) {
@@ -2155,11 +2287,32 @@ ${configList}${layoutsText}${offlineText}
2155
2287
  if (!response.success) {
2156
2288
  throw new Error(`Failed to configure data broker: ${response.error}`);
2157
2289
  }
2158
- this.logger.info('✅ UI Builder data broker configured successfully');
2290
+ // VERIFICATION: Confirm data broker configuration was updated
2291
+ const verification = await this.client.getRecord('sys_ux_data_broker', args.broker_id);
2292
+ if (!verification.success) {
2293
+ return {
2294
+ success: false,
2295
+ error: 'Data broker configuration reported success but record not found in sys_ux_data_broker table',
2296
+ suggestion: 'Data broker may not exist or you may lack permissions to access it',
2297
+ broker_id: args.broker_id,
2298
+ verification_failed: true
2299
+ };
2300
+ }
2301
+ this.logger.info(`✅ UI Builder data broker configured and verified: ${args.broker_id}`);
2159
2302
  return {
2160
2303
  success: true,
2161
- data_broker: response.data,
2162
- message: 'Data broker configuration updated successfully'
2304
+ verified: true,
2305
+ data_broker_sys_id: args.broker_id,
2306
+ updates_applied: Object.keys(updates),
2307
+ configured_at: new Date().toISOString(),
2308
+ message: `✅ Data broker configuration updated and verified successfully`,
2309
+ detailed_confirmation: {
2310
+ operation: 'CONFIGURE UI Builder Data Broker',
2311
+ sys_id: args.broker_id,
2312
+ updates_applied: updates,
2313
+ verified_in_table: 'sys_ux_data_broker',
2314
+ verification_timestamp: new Date().toISOString()
2315
+ }
2163
2316
  };
2164
2317
  }
2165
2318
  catch (error) {
@@ -2380,11 +2533,36 @@ ${configList}${layoutsText}${offlineText}
2380
2533
  if (!response.success) {
2381
2534
  throw new Error(`Failed to create client script: ${response.error}`);
2382
2535
  }
2383
- this.logger.info('✅ UI Builder client script created successfully');
2536
+ // VERIFICATION: Confirm client script was created
2537
+ const sys_id = response.data.result.sys_id;
2538
+ const verification = await this.client.getRecord('sys_ux_client_script', sys_id);
2539
+ if (!verification.success) {
2540
+ return {
2541
+ success: false,
2542
+ error: 'Client script creation reported success but record not found in sys_ux_client_script table',
2543
+ suggestion: 'Client script creation may have been rolled back due to script validation errors',
2544
+ verification_failed: true
2545
+ };
2546
+ }
2547
+ this.logger.info(`✅ UI Builder client script created and verified: ${sys_id}`);
2384
2548
  return {
2385
2549
  success: true,
2386
- script: response.data,
2387
- message: `Client script '${args.name}' created for ${args.type} trigger`
2550
+ verified: true,
2551
+ client_script_sys_id: sys_id,
2552
+ script_name: args.name,
2553
+ script_type: args.type,
2554
+ page_id: args.page_id,
2555
+ created_at: new Date().toISOString(),
2556
+ message: `✅ Client script '${args.name}' created and verified successfully`,
2557
+ detailed_confirmation: {
2558
+ operation: 'CREATE UI Builder Client Script',
2559
+ sys_id: sys_id,
2560
+ name: args.name,
2561
+ type: args.type,
2562
+ page_reference: args.page_id,
2563
+ verified_in_table: 'sys_ux_client_script',
2564
+ verification_timestamp: new Date().toISOString()
2565
+ }
2388
2566
  };
2389
2567
  }
2390
2568
  catch (error) {
@@ -2446,11 +2624,37 @@ ${configList}${layoutsText}${offlineText}
2446
2624
  if (!response.success) {
2447
2625
  throw new Error(`Failed to create event: ${response.error}`);
2448
2626
  }
2449
- this.logger.info('✅ UI Builder event created successfully');
2627
+ // VERIFICATION: Confirm event was created
2628
+ const sys_id = response.data.result.sys_id;
2629
+ const verification = await this.client.getRecord('sys_ux_event', sys_id);
2630
+ if (!verification.success) {
2631
+ return {
2632
+ success: false,
2633
+ error: 'Event creation reported success but record not found in sys_ux_event table',
2634
+ suggestion: 'Event creation may have been rolled back due to validation errors',
2635
+ verification_failed: true
2636
+ };
2637
+ }
2638
+ this.logger.info(`✅ UI Builder event created and verified: ${sys_id}`);
2450
2639
  return {
2451
2640
  success: true,
2452
- event: response.data,
2453
- message: `Custom event '${args.name}' created ${args.global_event ? '(global)' : '(scoped)'}`
2641
+ verified: true,
2642
+ event_sys_id: sys_id,
2643
+ event_name: args.name,
2644
+ event_scope: args.global_event ? 'Global' : 'Component Scoped',
2645
+ component_scope: args.component_scope || 'Not specified',
2646
+ created_at: new Date().toISOString(),
2647
+ message: `✅ Custom event '${args.name}' created and verified successfully`,
2648
+ detailed_confirmation: {
2649
+ operation: 'CREATE UI Builder Event',
2650
+ sys_id: sys_id,
2651
+ name: args.name,
2652
+ global_event: args.global_event || false,
2653
+ bubbles: args.bubbles !== false,
2654
+ cancelable: args.cancelable !== false,
2655
+ verified_in_table: 'sys_ux_event',
2656
+ verification_timestamp: new Date().toISOString()
2657
+ }
2454
2658
  };
2455
2659
  }
2456
2660
  catch (error) {
@@ -2820,17 +3024,43 @@ ${configList}${layoutsText}${offlineText}
2820
3024
  };
2821
3025
  const result = await this.client.createRecord('sys_ux_app_config', configData);
2822
3026
  if (result.success && result.data && result.data.result && result.data.result.sys_id) {
2823
- this.logger.info(`✅ UX App Config created with sys_id: ${result.data.result.sys_id}`);
3027
+ const sys_id = result.data.result.sys_id;
3028
+ // VERIFICATION: Confirm app config was created
3029
+ const verification = await this.client.getRecord('sys_ux_app_config', sys_id);
3030
+ if (!verification.success) {
3031
+ return {
3032
+ success: false,
3033
+ error: 'App config creation reported success but record not found in sys_ux_app_config table',
3034
+ verification_failed: true
3035
+ };
3036
+ }
3037
+ this.logger.info(`✅ UX App Config created and verified: ${sys_id}`);
2824
3038
  return {
2825
3039
  success: true,
2826
- app_config_sys_id: result.data.result.sys_id,
2827
- message: `App Configuration '${args.name}' created successfully`,
2828
- next_step: "Create Page Macroponent using this app_config_sys_id"
3040
+ verified: true,
3041
+ app_config_sys_id: sys_id,
3042
+ config_name: args.name,
3043
+ linked_experience: args.experience_sys_id,
3044
+ created_at: new Date().toISOString(),
3045
+ message: `✅ App Configuration '${args.name}' created and verified successfully`,
3046
+ detailed_confirmation: {
3047
+ operation: 'CREATE UX App Config',
3048
+ sys_id: sys_id,
3049
+ name: args.name,
3050
+ experience_assoc: args.experience_sys_id,
3051
+ verified_in_table: 'sys_ux_app_config',
3052
+ verification_timestamp: new Date().toISOString()
3053
+ },
3054
+ next_step: `Create Page Macroponent using app_config_sys_id: ${sys_id}`
2829
3055
  };
2830
3056
  }
2831
3057
  else {
2832
3058
  const error = (result.data && result.data.error) || (result.error) || 'Unknown error creating app config';
2833
- throw new Error(`Failed to create app config: ${error}`);
3059
+ return {
3060
+ success: false,
3061
+ error: `Failed to create app config: ${error}`,
3062
+ suggestion: this.getErrorSuggestion(error)
3063
+ };
2834
3064
  }
2835
3065
  }
2836
3066
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.49",
3
+ "version": "4.5.50",
4
4
  "description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 245+ ServiceNow tools including complete UX + Agent Workspace creation with official APIs.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",