snow-flow 4.5.29 → 4.5.31

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
@@ -659,14 +659,16 @@ Snow-Flow now automatically sets its Update Set as the user's current Update Set
659
659
  - `snow_get_flow_details` - Get detailed flow configuration
660
660
  - `snow_import_flow_from_xml` - Import flows from XML (only programmatic creation method)
661
661
 
662
- **Agent Workspace Tools:**
663
- - `snow_create_workspace` - Create agent workspace configurations (uses sys_aw_master_config with all required fields)
664
- - `snow_discover_workspaces` - Find all workspace configurations
665
-
666
- **⚠️ MODERN APPROACH:** For workspace tabs and panels, use **UI Builder tools** with correct table structure:
667
- - **Workspace pages** `snow_create_uib_page` (creates sys_ux_page + sys_ux_page_registry)
668
- - **Workspace components** → `snow_add_uib_page_element` (adds to sys_ux_page via sys_ux_page_element)
669
- - **Data connections** → `snow_create_uib_data_broker` (connects via sys_ux_data_broker)
662
+ **Configurable Agent Workspace Tools (UX App Architecture):**
663
+ - `snow_create_workspace` - Create Configurable Agent Workspaces using UX App architecture (sys_ux_app_route, sys_ux_screen_type, sys_ux_screen, sys_ux_macroponent)
664
+ - `snow_discover_workspaces` - Find all Configurable Workspaces
665
+
666
+ **🏗️ CONFIGURABLE WORKSPACE ARCHITECTURE:**
667
+ Based on ServiceNow's official Configurable Agent Workspace structure:
668
+ - **App Route** → `sys_ux_app_route` (top-level workspace routing)
669
+ - **Screen Collection** → `sys_ux_screen_type` (groups of related screens)
670
+ - **Individual Screens** → `sys_ux_screen` (specific workspace screens)
671
+ - **Screen Components** → `sys_ux_macroponent` (components within screens)
670
672
 
671
673
  **Mobile App Tools:**
672
674
  - `snow_configure_mobile_app` - Configure mobile applications
@@ -1229,79 +1229,87 @@ ${executionList}
1229
1229
  async createWorkspace(args) {
1230
1230
  try {
1231
1231
  this.logger.info('Creating Agent Workspace...');
1232
- // First validate Agent Workspace table access
1233
- const tableCheck = await this.client.searchRecords('sys_aw_master_config', '', 1);
1232
+ // Validate Configurable Workspace (UX App) table access
1233
+ const tableCheck = await this.client.searchRecords('sys_ux_app_route', '', 1);
1234
1234
  if (!tableCheck.success) {
1235
1235
  return {
1236
1236
  success: false,
1237
- error: 'Agent Workspace tables not accessible. This feature requires ServiceNow Agent Workspace plugin to be installed and activated.',
1238
- suggestion: 'Install Agent Workspace plugin: System Applications All Available Applications Search for "Agent Workspace"'
1237
+ error: 'Configurable Agent Workspace (UX App) tables not accessible. This feature requires Now Experience Framework and Configurable Workspace licensing.',
1238
+ suggestion: 'Verify Now Experience Framework is licensed and Configurable Workspace is enabled in your ServiceNow instance.'
1239
1239
  };
1240
1240
  }
1241
- // Fix from user feedback: Add ALL required fields for workspace creation
1242
- const workspaceUrl = this.generateWorkspaceUrl(args.name);
1243
- const workspaceData = {
1241
+ // CORRECTED: Use UX App architecture for Configurable Agent Workspaces
1242
+ const appRoute = this.generateWorkspaceUrl(args.name);
1243
+ // Step 1: Create UX App Route (top level)
1244
+ const appRouteData = {
1245
+ route: `/${appRoute}`,
1244
1246
  name: args.name,
1247
+ title: args.name,
1245
1248
  description: args.description || '',
1246
- active: true,
1247
- // CRITICAL: Add missing required fields
1248
- workspace_url: workspaceUrl,
1249
- navigation_type: 'tab',
1250
- search_enabled: true,
1251
- notifications_enabled: true,
1252
- user_preference_controls_enabled: true,
1253
- // Add default colors for branding
1254
- primary_color: '#1F8476',
1255
- brand_color: '#2FC2B0',
1256
- // These will be updated after search config creation
1257
- global_search: '',
1258
- global_search_data: '',
1259
- // Optional fields with defaults
1260
- tables: args.tables ? args.tables.join(',') : '',
1261
- home_page: args.home_page || '',
1262
- theme: args.theme || 'default',
1263
- roles: args.roles ? args.roles.join(',') : ''
1249
+ application: 'global',
1250
+ active: true
1251
+ };
1252
+ const routeResponse = await this.client.createRecord('sys_ux_app_route', appRouteData);
1253
+ if (!routeResponse.success) {
1254
+ return {
1255
+ success: false,
1256
+ error: `Failed to create UX App Route: ${routeResponse.error}`,
1257
+ suggestion: 'Check Now Experience Framework permissions and UX App licensing.'
1258
+ };
1259
+ }
1260
+ // Step 2: Create Screen Type (collection)
1261
+ const screenTypeData = {
1262
+ name: `${args.name}_screens`,
1263
+ title: `${args.name} Screens`,
1264
+ description: `Screen collection for ${args.name} workspace`,
1265
+ app_route: routeResponse.data.sys_id,
1266
+ active: true
1264
1267
  };
1268
+ const screenTypeResponse = await this.client.createRecord('sys_ux_screen_type', screenTypeData);
1269
+ if (!screenTypeResponse.success) {
1270
+ return {
1271
+ success: false,
1272
+ error: `Failed to create Screen Type: ${screenTypeResponse.error}`,
1273
+ suggestion: 'Check UX Screen Type permissions.'
1274
+ };
1275
+ }
1265
1276
  this.logger.trackAPICall('CREATE', 'sys_aw_master_config', 1);
1266
- const response = await this.client.createRecord('sys_aw_master_config', workspaceData);
1267
- if (!response.success) {
1268
- // Enhanced error handling with required fields info
1269
- if (response.error?.includes('403') || response.error?.includes('Forbidden')) {
1270
- return {
1271
- success: false,
1272
- error: 'Insufficient permissions to create Agent Workspace. Requires workspace_admin role or elevated permissions.',
1273
- suggestion: 'Contact your ServiceNow administrator to grant Agent Workspace permissions.'
1274
- };
1275
- }
1276
- if (response.error?.includes('400') || response.error?.includes('Bad Request')) {
1277
- return {
1278
- success: false,
1279
- error: 'Invalid workspace configuration. Missing required fields detected.',
1280
- suggestion: 'Verify all required fields: workspace_url, navigation_type, search settings.',
1281
- remediation: 'Check ServiceNow Agent Workspace documentation for required field specifications'
1277
+ // Step 3: Create default screens for each table
1278
+ const createdScreens = [];
1279
+ if (args.tables && args.tables.length > 0) {
1280
+ for (let i = 0; i < args.tables.length; i++) {
1281
+ const table = args.tables[i];
1282
+ const screenData = {
1283
+ name: `${args.name}_${table}_screen`,
1284
+ title: `${table.charAt(0).toUpperCase() + table.slice(1)} Management`,
1285
+ description: `${table} management screen for ${args.name}`,
1286
+ screen_type: screenTypeResponse.data.sys_id,
1287
+ table: table,
1288
+ order: i * 100,
1289
+ active: true
1282
1290
  };
1283
- }
1284
- throw new Error(`Failed to create workspace: ${response.error}`);
1285
- }
1286
- const workspaceId = response.data.sys_id;
1287
- // Fix from user feedback: Create global search config and update workspace
1288
- try {
1289
- const searchConfig = await this.client.createRecord('sys_aw_global_search_config', {
1290
- name: `${args.name} Search`,
1291
- workspace: workspaceId,
1292
- active: true
1293
- });
1294
- if (searchConfig.success && searchConfig.data.sys_id) {
1295
- // Update workspace with search config references
1296
- await this.client.updateRecord('sys_aw_master_config', workspaceId, {
1297
- global_search: searchConfig.data.sys_id,
1298
- global_search_data: searchConfig.data.sys_id
1299
- });
1291
+ const screenResponse = await this.client.createRecord('sys_ux_screen', screenData);
1292
+ if (screenResponse.success) {
1293
+ createdScreens.push(screenResponse.data);
1294
+ // Create macroponent for each screen
1295
+ const macroponentData = {
1296
+ name: `${args.name}_${table}_macroponent`,
1297
+ title: `${table} Component`,
1298
+ description: `Macroponent for ${table} in ${args.name}`,
1299
+ screen: screenResponse.data.sys_id,
1300
+ component_type: 'table',
1301
+ table: table,
1302
+ active: true
1303
+ };
1304
+ await this.client.createRecord('sys_ux_macroponent', macroponentData);
1305
+ }
1300
1306
  }
1301
1307
  }
1302
- catch (searchError) {
1303
- this.logger.warn('Could not create search config, workspace created without search:', searchError);
1308
+ if (!routeResponse.success) {
1309
+ throw new Error(`Failed to create configurable workspace: ${routeResponse.error}`);
1304
1310
  }
1311
+ const workspaceId = routeResponse.data.sys_id;
1312
+ // Note: Search config handled by UX framework automatically for Configurable Workspaces
1305
1313
  // UPDATED: Modern workspace tab creation guidance
1306
1314
  let tabsCreated = 0;
1307
1315
  let modernWorkspaceNote = '';
@@ -490,6 +490,8 @@ class SnowFlowMCPServer {
490
490
  task.assignedAgent = availableAgent.id;
491
491
  availableAgent.status = 'busy';
492
492
  }
493
+ // Fix: Handle dependencies parameter safely
494
+ const dependencies = args.dependencies || [];
493
495
  return {
494
496
  content: [
495
497
  {
@@ -499,9 +501,11 @@ class SnowFlowMCPServer {
499
501
  task: task.description,
500
502
  strategy: args.strategy || 'adaptive',
501
503
  priority: args.priority || 'medium',
504
+ dependencies: dependencies,
505
+ dependency_count: dependencies.length,
502
506
  status: 'orchestrating',
503
507
  assignedAgent: task.assignedAgent,
504
- message: 'Task orchestration initiated',
508
+ message: 'Task orchestration initiated with safe dependency handling',
505
509
  }),
506
510
  },
507
511
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.29",
3
+ "version": "4.5.31",
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",