snow-flow 4.5.22 → 4.5.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -655,11 +655,15 @@ Snow-Flow now automatically sets its Update Set as the user's current Update Set
655
655
  - `snow_import_flow_from_xml` - Import flows from XML (only programmatic creation method)
656
656
 
657
657
  **Agent Workspace Tools:**
658
- - `snow_create_workspace` - Create agent workspace configurations
659
- - `snow_create_workspace_tab` - Add custom workspace tabs
660
- - `snow_create_contextual_panel` - Add contextual side panels
658
+ - `snow_create_workspace` - Create agent workspace configurations (uses sys_aw_master_config)
659
+ - `snow_create_workspace_tab` - **DEPRECATED:** Modern workspaces use UX pages
660
+ - `snow_create_contextual_panel` - **DEPRECATED:** Modern workspaces use UX components
661
661
  - `snow_discover_workspaces` - Find all workspace configurations
662
662
 
663
+ **⚠️ IMPORTANT:** Modern ServiceNow Agent Workspaces use **UX Pages (sys_ux_*)** for configuration, not legacy sys_aw_* tables. Use UI Builder tools instead:
664
+ - **Workspace tabs** → Use `snow_add_uib_page_element` with UX page components
665
+ - **Contextual panels** → Use UI Builder component library with data brokers
666
+
663
667
  **Mobile App Tools:**
664
668
  - `snow_configure_mobile_app` - Configure mobile applications
665
669
  - `snow_send_push_notification` - Send push notifications
@@ -1281,19 +1281,34 @@ ${executionList}
1281
1281
  suggestion: 'Install Agent Workspace plugin: System Applications → All Available Applications → Search for "Agent Workspace"'
1282
1282
  };
1283
1283
  }
1284
+ // Fix from user feedback: Add ALL required fields for workspace creation
1285
+ const workspaceUrl = this.generateWorkspaceUrl(args.name);
1284
1286
  const workspaceData = {
1285
1287
  name: args.name,
1286
1288
  description: args.description || '',
1289
+ active: true,
1290
+ // CRITICAL: Add missing required fields
1291
+ workspace_url: workspaceUrl,
1292
+ navigation_type: 'tab',
1293
+ search_enabled: true,
1294
+ notifications_enabled: true,
1295
+ user_preference_controls_enabled: true,
1296
+ // Add default colors for branding
1297
+ primary_color: '#1F8476',
1298
+ brand_color: '#2FC2B0',
1299
+ // These will be updated after search config creation
1300
+ global_search: '',
1301
+ global_search_data: '',
1302
+ // Optional fields with defaults
1287
1303
  tables: args.tables ? args.tables.join(',') : '',
1288
1304
  home_page: args.home_page || '',
1289
1305
  theme: args.theme || 'default',
1290
- roles: args.roles ? args.roles.join(',') : '',
1291
- active: true
1306
+ roles: args.roles ? args.roles.join(',') : ''
1292
1307
  };
1293
1308
  this.logger.trackAPICall('CREATE', 'sys_aw_master_config', 1);
1294
1309
  const response = await this.client.createRecord('sys_aw_master_config', workspaceData);
1295
1310
  if (!response.success) {
1296
- // Provide specific error guidance
1311
+ // Enhanced error handling with required fields info
1297
1312
  if (response.error?.includes('403') || response.error?.includes('Forbidden')) {
1298
1313
  return {
1299
1314
  success: false,
@@ -1304,12 +1319,43 @@ ${executionList}
1304
1319
  if (response.error?.includes('400') || response.error?.includes('Bad Request')) {
1305
1320
  return {
1306
1321
  success: false,
1307
- error: 'Invalid workspace configuration. Agent Workspace may not be properly configured in this instance.',
1308
- suggestion: 'Verify Agent Workspace is enabled and configured. Check System Properties > Agent Workspace settings.'
1322
+ error: 'Invalid workspace configuration. Missing required fields detected.',
1323
+ suggestion: 'Verify all required fields: workspace_url, navigation_type, search settings.',
1324
+ remediation: 'Check ServiceNow Agent Workspace documentation for required field specifications'
1309
1325
  };
1310
1326
  }
1311
1327
  throw new Error(`Failed to create workspace: ${response.error}`);
1312
1328
  }
1329
+ const workspaceId = response.data.sys_id;
1330
+ // Fix from user feedback: Create global search config and update workspace
1331
+ try {
1332
+ const searchConfig = await this.client.createRecord('sys_aw_global_search_config', {
1333
+ name: `${args.name} Search`,
1334
+ workspace: workspaceId,
1335
+ active: true
1336
+ });
1337
+ if (searchConfig.success && searchConfig.data.sys_id) {
1338
+ // Update workspace with search config references
1339
+ await this.client.updateRecord('sys_aw_master_config', workspaceId, {
1340
+ global_search: searchConfig.data.sys_id,
1341
+ global_search_data: searchConfig.data.sys_id
1342
+ });
1343
+ }
1344
+ }
1345
+ catch (searchError) {
1346
+ this.logger.warn('Could not create search config, workspace created without search:', searchError);
1347
+ }
1348
+ // UPDATED: Modern workspace tab creation guidance
1349
+ let tabsCreated = 0;
1350
+ let modernWorkspaceNote = '';
1351
+ if (args.tables && args.tables.length > 0) {
1352
+ modernWorkspaceNote = `\n\n📋 **Tab Configuration Required:**\nModern Agent Workspaces use UX Pages for tabs. Configure tabs through:\n`;
1353
+ for (const table of args.tables) {
1354
+ const tabLabel = table.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
1355
+ modernWorkspaceNote += `\n• **${tabLabel}**: Use snow_add_uib_page_element to add ${table} components`;
1356
+ }
1357
+ modernWorkspaceNote += `\n\n💡 **Modern Approach:**\n1. Use snow_create_uib_page for custom workspace pages\n2. Use snow_add_uib_page_element to add table components\n3. Use snow_create_uib_data_broker for data connections`;
1358
+ }
1313
1359
  return {
1314
1360
  content: [{
1315
1361
  type: 'text',
@@ -2871,6 +2917,37 @@ ${configList}${layoutsText}${offlineText}
2871
2917
  throw error;
2872
2918
  }
2873
2919
  }
2920
+ /**
2921
+ * Generate valid workspace URL from name (fix from user feedback)
2922
+ */
2923
+ generateWorkspaceUrl(name) {
2924
+ return name
2925
+ .toLowerCase()
2926
+ .trim()
2927
+ .replace(/\s+/g, '-') // Spaces -> hyphens
2928
+ .replace(/[^a-z0-9-]/g, '') // Remove special characters
2929
+ .replace(/--+/g, '-') // Multiple hyphens -> single
2930
+ .replace(/^-|-$/g, '') // Trim leading/trailing hyphens
2931
+ .substring(0, 80); // Max 80 chars (ServiceNow field limit)
2932
+ }
2933
+ /**
2934
+ * Validate workspace configuration (fix from user feedback)
2935
+ */
2936
+ validateWorkspaceConfig(config) {
2937
+ const errors = [];
2938
+ // Check required fields
2939
+ if (!config.name)
2940
+ errors.push('name is required');
2941
+ if (!config.workspace_url)
2942
+ errors.push('workspace_url is required');
2943
+ if (!config.navigation_type)
2944
+ errors.push('navigation_type is required');
2945
+ // Validate workspace_url format
2946
+ if (config.workspace_url && !/^[a-z0-9-]+$/.test(config.workspace_url)) {
2947
+ errors.push('workspace_url must contain only lowercase letters, numbers and hyphens');
2948
+ }
2949
+ return errors;
2950
+ }
2874
2951
  async run() {
2875
2952
  const transport = new stdio_js_1.StdioServerTransport();
2876
2953
  await this.server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.22",
3
+ "version": "4.5.24",
4
4
  "description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 200+ ServiceNow tools for comprehensive platform development.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",