snow-flow 4.5.16 → 4.5.18

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.
@@ -1333,32 +1333,58 @@ ${args.roles ? `👥 Roles: ${args.roles.join(', ')}` : ''}
1333
1333
  async createWorkspaceTab(args) {
1334
1334
  try {
1335
1335
  this.logger.info('Creating workspace tab...');
1336
+ // Fix from user feedback: Validate workspace exists first to prevent 400 errors
1337
+ const workspaceCheck = await this.client.getRecord('sys_aw_master_config', args.workspace);
1338
+ if (!workspaceCheck.success) {
1339
+ return {
1340
+ success: false,
1341
+ error: `Workspace ${args.workspace} not found. Create workspace first using snow_create_workspace.`,
1342
+ suggestion: 'Use snow_discover_workspaces to find available workspaces.',
1343
+ http_status: 404,
1344
+ remediation: 'Verify workspace sys_id is correct or create new workspace first'
1345
+ };
1346
+ }
1336
1347
  const tabData = {
1337
1348
  workspace: args.workspace,
1338
1349
  name: args.name,
1339
1350
  label: args.label || args.name,
1340
1351
  table: args.table,
1341
- view: args.view || 'default',
1352
+ view: args.view || 'list', // Fix: use 'list' instead of 'default'
1342
1353
  order: args.order || 100,
1343
- condition: args.condition || ''
1354
+ condition: args.condition || '', // Make condition optional to prevent 400 errors
1355
+ active: true
1344
1356
  };
1345
1357
  const response = await this.client.createRecord('sys_aw_tab', tabData);
1346
1358
  if (!response.success) {
1347
- throw new Error(`Failed to create workspace tab: ${response.error}`);
1359
+ // Enhanced error handling based on user feedback
1360
+ if (response.error?.includes('400') || response.error?.includes('Bad Request')) {
1361
+ return {
1362
+ success: false,
1363
+ error: 'Invalid workspace tab configuration. Complex conditions may not be supported.',
1364
+ suggestion: 'Try with simpler parameters: remove complex conditions and use basic table references.',
1365
+ http_status: 400,
1366
+ remediation: 'Check ServiceNow workspace tab documentation for supported field types'
1367
+ };
1368
+ }
1369
+ return {
1370
+ success: false,
1371
+ error: response.error,
1372
+ suggestion: 'Check workspace tab parameters and permissions'
1373
+ };
1348
1374
  }
1375
+ // Fix from user feedback: Return proper success object instead of content array
1349
1376
  return {
1350
- content: [{
1351
- type: 'text',
1352
- text: `✅ Workspace Tab created!
1353
-
1354
- 📑 **${args.label || args.name}**
1355
- 🆔 sys_id: ${response.data.sys_id}
1356
- 📋 Table: ${args.table}
1357
- 👁️ View: ${args.view || 'default'}
1358
- 🔢 Order: ${args.order || 100}
1359
-
1360
- ✨ Tab added to workspace!`
1361
- }]
1377
+ success: true,
1378
+ tab: response.data,
1379
+ message: `Workspace tab '${args.name}' created successfully for table ${args.table}`,
1380
+ sys_id: response.data.sys_id,
1381
+ configuration: {
1382
+ workspace: args.workspace,
1383
+ table: args.table,
1384
+ view: args.view || 'list',
1385
+ order: args.order || 100,
1386
+ condition: args.condition || 'none'
1387
+ }
1362
1388
  };
1363
1389
  }
1364
1390
  catch (error) {
@@ -1406,18 +1432,43 @@ ${args.filter ? `🔍 Filter: ${args.filter}` : ''}
1406
1432
  async createContextualPanel(args) {
1407
1433
  try {
1408
1434
  this.logger.info('Creating contextual panel...');
1435
+ // Fix from user feedback: Validate table exists to prevent 400 errors
1436
+ const tableCheck = await this.client.searchRecords('sys_db_object', `name=${args.table}`, 1);
1437
+ if (!tableCheck.success || tableCheck.data.result.length === 0) {
1438
+ return {
1439
+ success: false,
1440
+ error: `Table '${args.table}' not found or not accessible.`,
1441
+ suggestion: 'Verify table name is correct and you have read permissions.',
1442
+ remediation: 'Use standard ServiceNow tables like: incident, task, sys_user, change_request'
1443
+ };
1444
+ }
1409
1445
  const panelData = {
1410
1446
  name: args.name,
1411
1447
  table: args.table,
1412
- type: args.type,
1448
+ type: args.type || 'related_records', // Set default type
1413
1449
  position: args.position || 'right',
1414
1450
  width: args.width || 300,
1415
1451
  content: args.content || '',
1416
- condition: args.condition || ''
1452
+ condition: args.condition || '',
1453
+ active: true
1417
1454
  };
1418
1455
  const response = await this.client.createRecord('sys_aw_context_panel', panelData);
1419
1456
  if (!response.success) {
1420
- throw new Error(`Failed to create contextual panel: ${response.error}`);
1457
+ // Enhanced error handling based on user feedback
1458
+ if (response.error?.includes('400') || response.error?.includes('Bad Request')) {
1459
+ return {
1460
+ success: false,
1461
+ error: 'Invalid contextual panel configuration. Check panel type and table compatibility.',
1462
+ suggestion: 'Try with type: "related_records" and standard ServiceNow tables.',
1463
+ http_status: 400,
1464
+ remediation: 'Verify panel type is supported and table has proper relationships'
1465
+ };
1466
+ }
1467
+ return {
1468
+ success: false,
1469
+ error: response.error,
1470
+ suggestion: 'Check contextual panel parameters and workspace permissions'
1471
+ };
1421
1472
  }
1422
1473
  return {
1423
1474
  content: [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.16",
3
+ "version": "4.5.18",
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",