snow-flow 4.5.30 → 4.5.32

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
@@ -118,16 +118,15 @@ class ServiceNowFlowWorkspaceMobileMCP {
118
118
  // Agent Workspace Tools
119
119
  {
120
120
  name: 'snow_create_workspace',
121
- description: 'Creates an Agent Workspace configuration for customized agent experiences.',
121
+ description: 'Creates a Configurable Agent Workspace using modern UX App architecture (sys_ux_app_route, sys_ux_screen_type, sys_ux_screen, sys_ux_macroponent). Creates complete workspace with routing, screen collections, and components.',
122
122
  inputSchema: {
123
123
  type: 'object',
124
124
  properties: {
125
- name: { type: 'string', description: 'Workspace name' },
125
+ name: { type: 'string', description: 'Configurable Workspace name' },
126
126
  description: { type: 'string', description: 'Workspace description' },
127
- tables: { type: 'array', items: { type: 'string' }, description: 'Tables available in workspace' },
128
- home_page: { type: 'string', description: 'Default home page' },
129
- theme: { type: 'string', description: 'Workspace theme' },
130
- roles: { type: 'array', items: { type: 'string' }, description: 'Roles with access' }
127
+ tables: { type: 'array', items: { type: 'string' }, description: 'Tables to create screens for (incident, task, etc.)' },
128
+ application: { type: 'string', description: 'Application scope', default: 'global' },
129
+ roles: { type: 'array', items: { type: 'string' }, description: 'Roles with workspace access' }
131
130
  },
132
131
  required: ['name', 'tables']
133
132
  }
@@ -1229,79 +1228,87 @@ ${executionList}
1229
1228
  async createWorkspace(args) {
1230
1229
  try {
1231
1230
  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);
1231
+ // Validate Configurable Workspace (UX App) table access
1232
+ const tableCheck = await this.client.searchRecords('sys_ux_app_route', '', 1);
1234
1233
  if (!tableCheck.success) {
1235
1234
  return {
1236
1235
  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"'
1236
+ error: 'Configurable Agent Workspace (UX App) tables not accessible. This feature requires Now Experience Framework and Configurable Workspace licensing.',
1237
+ suggestion: 'Verify Now Experience Framework is licensed and Configurable Workspace is enabled in your ServiceNow instance.'
1239
1238
  };
1240
1239
  }
1241
- // Fix from user feedback: Add ALL required fields for workspace creation
1242
- const workspaceUrl = this.generateWorkspaceUrl(args.name);
1243
- const workspaceData = {
1240
+ // CORRECTED: Use UX App architecture for Configurable Agent Workspaces
1241
+ const appRoute = this.generateWorkspaceUrl(args.name);
1242
+ // Step 1: Create UX App Route (top level)
1243
+ const appRouteData = {
1244
+ route: `/${appRoute}`,
1244
1245
  name: args.name,
1246
+ title: args.name,
1245
1247
  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(',') : ''
1248
+ application: 'global',
1249
+ active: true
1264
1250
  };
1265
- 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'
1282
- };
1283
- }
1284
- throw new Error(`Failed to create workspace: ${response.error}`);
1251
+ const routeResponse = await this.client.createRecord('sys_ux_app_route', appRouteData);
1252
+ if (!routeResponse.success) {
1253
+ return {
1254
+ success: false,
1255
+ error: `Failed to create UX App Route: ${routeResponse.error}`,
1256
+ suggestion: 'Check Now Experience Framework permissions and UX App licensing.'
1257
+ };
1285
1258
  }
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
- });
1259
+ // Step 2: Create Screen Type (collection)
1260
+ const screenTypeData = {
1261
+ name: `${args.name}_screens`,
1262
+ title: `${args.name} Screens`,
1263
+ description: `Screen collection for ${args.name} workspace`,
1264
+ app_route: routeResponse.data.sys_id,
1265
+ active: true
1266
+ };
1267
+ const screenTypeResponse = await this.client.createRecord('sys_ux_screen_type', screenTypeData);
1268
+ if (!screenTypeResponse.success) {
1269
+ return {
1270
+ success: false,
1271
+ error: `Failed to create Screen Type: ${screenTypeResponse.error}`,
1272
+ suggestion: 'Check UX Screen Type permissions.'
1273
+ };
1274
+ }
1275
+ this.logger.trackAPICall('CREATE', 'sys_ux_app_route', 1);
1276
+ // Step 3: Create default screens for each table
1277
+ const createdScreens = [];
1278
+ if (args.tables && args.tables.length > 0) {
1279
+ for (let i = 0; i < args.tables.length; i++) {
1280
+ const table = args.tables[i];
1281
+ const screenData = {
1282
+ name: `${args.name}_${table}_screen`,
1283
+ title: `${table.charAt(0).toUpperCase() + table.slice(1)} Management`,
1284
+ description: `${table} management screen for ${args.name}`,
1285
+ screen_type: screenTypeResponse.data.sys_id,
1286
+ table: table,
1287
+ order: i * 100,
1288
+ active: true
1289
+ };
1290
+ const screenResponse = await this.client.createRecord('sys_ux_screen', screenData);
1291
+ if (screenResponse.success) {
1292
+ createdScreens.push(screenResponse.data);
1293
+ // Create macroponent for each screen
1294
+ const macroponentData = {
1295
+ name: `${args.name}_${table}_macroponent`,
1296
+ title: `${table} Component`,
1297
+ description: `Macroponent for ${table} in ${args.name}`,
1298
+ screen: screenResponse.data.sys_id,
1299
+ component_type: 'table',
1300
+ table: table,
1301
+ active: true
1302
+ };
1303
+ await this.client.createRecord('sys_ux_macroponent', macroponentData);
1304
+ }
1300
1305
  }
1301
1306
  }
1302
- catch (searchError) {
1303
- this.logger.warn('Could not create search config, workspace created without search:', searchError);
1307
+ if (!routeResponse.success) {
1308
+ throw new Error(`Failed to create configurable workspace: ${routeResponse.error}`);
1304
1309
  }
1310
+ const workspaceId = routeResponse.data.sys_id;
1311
+ // Note: Search config handled by UX framework automatically for Configurable Workspaces
1305
1312
  // UPDATED: Modern workspace tab creation guidance
1306
1313
  let tabsCreated = 0;
1307
1314
  let modernWorkspaceNote = '';
@@ -1346,7 +1353,7 @@ ${args.roles ? `👥 Roles: ${args.roles.join(', ')}` : ''}
1346
1353
  const response = await this.client.createRecord('sys_aw_notification_config', notificationData);
1347
1354
  if (!response.success) {
1348
1355
  // Fallback to updating workspace
1349
- await this.client.updateRecord('sys_aw_master_config', args.workspace, {
1356
+ await this.client.updateRecord('sys_ux_app_route', args.workspace, {
1350
1357
  notifications_enabled: args.enable_desktop || args.enable_sound
1351
1358
  });
1352
1359
  }
@@ -1374,7 +1381,7 @@ ${args.roles ? `👥 Roles: ${args.roles.join(', ')}` : ''}
1374
1381
  try {
1375
1382
  this.logger.info('Discovering Agent Workspaces...');
1376
1383
  // Validate table access first
1377
- const response = await this.client.searchRecords('sys_aw_master_config', '', 50);
1384
+ const response = await this.client.searchRecords('sys_ux_app_route', '', 50);
1378
1385
  if (!response.success) {
1379
1386
  return {
1380
1387
  success: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.30",
3
+ "version": "4.5.32",
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",