snow-flow 4.5.40 → 4.5.42

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.
@@ -1225,119 +1225,48 @@ ${executionList}
1225
1225
  }
1226
1226
  }
1227
1227
  // Agent Workspace Implementation
1228
+ // Configurable Agent Workspace Implementation (UX App Architecture ONLY)
1228
1229
  async createWorkspace(args) {
1229
1230
  try {
1230
- this.logger.info('Creating Agent Workspace...');
1231
- // Validate Configurable Workspace (UX App) table access
1232
- const tableCheck = await this.client.searchRecords('sys_ux_app_route', '', 1);
1233
- if (!tableCheck.success) {
1234
- return {
1235
- success: false,
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.'
1238
- };
1239
- }
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)
1231
+ this.logger.info("Creating Configurable Agent Workspace (UX App Architecture)...");
1232
+ // Generate clean route for UX App
1233
+ const cleanRoute = args.name
1234
+ .toLowerCase()
1235
+ .replace(/[^a-z0-9]/g, "-")
1236
+ .replace(/--+/g, "-")
1237
+ .replace(/^-|-$/g, "")
1238
+ .substring(0, 50);
1239
+ // Step 1: Create UX App Route (MANDATORY)
1243
1240
  const appRouteData = {
1244
- route: `/${appRoute}`,
1241
+ route: `/${cleanRoute}`,
1245
1242
  name: args.name,
1246
1243
  title: args.name,
1247
- description: args.description || '',
1248
- application: 'global',
1244
+ description: args.description || `Configurable Agent Workspace: ${args.name}`,
1245
+ application: "global",
1246
+ route_type: "workspace",
1249
1247
  active: true
1250
1248
  };
1251
- const routeResponse = await this.client.createRecord('sys_ux_app_route', appRouteData);
1252
- if (!routeResponse.success) {
1249
+ this.logger.trackAPICall("CREATE", "sys_ux_app_route", 1);
1250
+ const appRouteResponse = await this.client.createRecord("sys_ux_app_route", appRouteData);
1251
+ if (!appRouteResponse.success) {
1253
1252
  return {
1254
1253
  success: false,
1255
- error: `Failed to create UX App Route: ${routeResponse.error}`,
1256
- suggestion: 'Check Now Experience Framework permissions and UX App licensing.'
1254
+ error: `UX App Route creation failed: ${appRouteResponse.error}`,
1255
+ suggestion: "Check UX App permissions and Now Experience Framework licensing."
1257
1256
  };
1258
1257
  }
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
- }
1305
- }
1306
- }
1307
- if (!routeResponse.success) {
1308
- throw new Error(`Failed to create configurable workspace: ${routeResponse.error}`);
1309
- }
1310
- const workspaceId = routeResponse.data.sys_id;
1311
- // Note: Search config handled by UX framework automatically for Configurable Workspaces
1312
- // UPDATED: Modern workspace tab creation guidance
1313
- let tabsCreated = 0;
1314
- let modernWorkspaceNote = '';
1315
- if (args.tables && args.tables.length > 0) {
1316
- modernWorkspaceNote = `\n\nšŸ“‹ **Tab Configuration Required:**\nModern Agent Workspaces use UX Pages for tabs. Configure tabs through:\n`;
1317
- for (const table of args.tables) {
1318
- const tabLabel = table.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase());
1319
- modernWorkspaceNote += `\n• **${tabLabel}**: Use snow_add_uib_page_element to add ${table} components`;
1320
- }
1321
- 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`;
1322
- }
1323
1258
  return {
1324
- content: [{
1325
- type: 'text',
1326
- text: `āœ… Agent Workspace created!
1327
-
1328
- šŸ–„ļø **${args.name}**
1329
- šŸ†” sys_id: ${response.data.sys_id}
1330
- šŸ“‹ Tables: ${args.tables.join(', ')}
1331
- šŸŽØ Theme: ${args.theme || 'default'}
1332
- ${args.roles ? `šŸ‘„ Roles: ${args.roles.join(', ')}` : ''}
1333
-
1334
- ✨ Workspace ready for configuration!`
1335
- }]
1259
+ success: true,
1260
+ workspace_type: "Configurable Agent Workspace (UX App)",
1261
+ app_route: appRouteResponse.data,
1262
+ sys_id: appRouteResponse.data.sys_id,
1263
+ route: `/${cleanRoute}`,
1264
+ message: `Configurable Agent Workspace created successfully`
1336
1265
  };
1337
1266
  }
1338
1267
  catch (error) {
1339
- this.logger.error('Failed to create workspace:', error);
1340
- throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Failed to create workspace: ${error}`);
1268
+ this.logger.error("Configurable Workspace creation failed:", error);
1269
+ throw error;
1341
1270
  }
1342
1271
  }
1343
1272
  async configureWorkspaceNotifications(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.40",
3
+ "version": "4.5.42",
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",