snow-flow 4.5.41 ā 4.5.43
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,156 +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(
|
|
1231
|
-
//
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
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: `/${
|
|
1241
|
+
route: `/${cleanRoute}`,
|
|
1245
1242
|
name: args.name,
|
|
1246
1243
|
title: args.name,
|
|
1247
|
-
description: args.description ||
|
|
1248
|
-
application:
|
|
1249
|
-
|
|
1250
|
-
};
|
|
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
|
-
};
|
|
1258
|
-
}
|
|
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,
|
|
1244
|
+
description: args.description || `Configurable Agent Workspace: ${args.name}`,
|
|
1245
|
+
application: "global",
|
|
1246
|
+
route_type: "workspace",
|
|
1265
1247
|
active: true
|
|
1266
1248
|
};
|
|
1267
|
-
|
|
1268
|
-
|
|
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) {
|
|
1269
1252
|
return {
|
|
1270
1253
|
success: false,
|
|
1271
|
-
error: `
|
|
1272
|
-
suggestion:
|
|
1254
|
+
error: `UX App Route creation failed: ${appRouteResponse.error}`,
|
|
1255
|
+
suggestion: "Check UX App permissions and Now Experience Framework licensing."
|
|
1273
1256
|
};
|
|
1274
1257
|
}
|
|
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
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
š Tables: ${args.tables.join(', ')}
|
|
1331
|
-
šØ Theme: ${args.theme || 'default'}
|
|
1332
|
-
${args.roles ? `š„ Roles: ${args.roles.join(', ')}` : ''}
|
|
1333
|
-
|
|
1334
|
-
⨠Workspace ready for configuration!`
|
|
1335
|
-
}]
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
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}`);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
async configureWorkspaceNotifications(args) {
|
|
1344
|
-
try {
|
|
1345
|
-
this.logger.info('Configuring workspace notifications...');
|
|
1346
|
-
const notificationData = {
|
|
1347
|
-
workspace: args.workspace,
|
|
1348
|
-
enable_desktop: args.enable_desktop || false,
|
|
1349
|
-
enable_sound: args.enable_sound || false,
|
|
1350
|
-
notification_types: args.notification_types ? args.notification_types.join(',') : '',
|
|
1351
|
-
priority_threshold: args.priority_threshold || 3
|
|
1352
|
-
};
|
|
1353
|
-
const response = await this.client.createRecord('sys_aw_notification_config', notificationData);
|
|
1354
|
-
if (!response.success) {
|
|
1355
|
-
// Fallback to updating workspace
|
|
1356
|
-
await this.client.updateRecord('sys_ux_app_route', args.workspace, {
|
|
1357
|
-
notifications_enabled: args.enable_desktop || args.enable_sound
|
|
1358
|
-
});
|
|
1359
|
-
}
|
|
1360
|
-
return {
|
|
1361
|
-
content: [{
|
|
1362
|
-
type: 'text',
|
|
1363
|
-
text: `ā
Workspace Notifications configured!
|
|
1364
|
-
|
|
1365
|
-
š **Notification Settings**
|
|
1366
|
-
š„ļø Desktop: ${args.enable_desktop ? 'Enabled' : 'Disabled'}
|
|
1367
|
-
š Sound: ${args.enable_sound ? 'Enabled' : 'Disabled'}
|
|
1368
|
-
š Types: ${args.notification_types ? args.notification_types.join(', ') : 'All'}
|
|
1369
|
-
ā ļø Priority Threshold: ${args.priority_threshold || 3}
|
|
1370
|
-
|
|
1371
|
-
⨠Notification preferences saved!`
|
|
1372
|
-
}]
|
|
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`
|
|
1373
1265
|
};
|
|
1374
1266
|
}
|
|
1375
1267
|
catch (error) {
|
|
1376
|
-
this.logger.error(
|
|
1377
|
-
throw
|
|
1268
|
+
this.logger.error("Configurable Workspace creation failed:", error);
|
|
1269
|
+
throw error;
|
|
1378
1270
|
}
|
|
1379
1271
|
}
|
|
1380
1272
|
async discoverWorkspaces(args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.43",
|
|
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",
|