snow-flow 8.4.42 → 8.4.44
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/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +56 -60
- package/dist/cli/auth.js.map +1 -1
- package/dist/utils/snow-oauth.d.ts +10 -5
- package/dist/utils/snow-oauth.d.ts.map +1 -1
- package/dist/utils/snow-oauth.js +223 -86
- package/dist/utils/snow-oauth.js.map +1 -1
- package/package.json +1 -1
- package/THEMES.md +0 -223
- package/dist/mcp/servicenow-mcp-unified/config/tool-definitions.json +0 -3935
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_automation_discover.js +0 -164
- package/dist/mcp/servicenow-mcp-unified/tools/deployment/snow_artifact_transfer.js +0 -282
- package/dist/mcp/servicenow-mcp-unified/tools/filters/snow_build_filter.js +0 -171
- package/dist/mcp/servicenow-mcp-unified/tools/formatters/snow_format_value.js +0 -164
- package/dist/mcp/servicenow-mcp-unified/tools/knowledge/index.js.bak +0 -45
- package/dist/mcp/servicenow-mcp-unified/tools/local-sync/snow_artifact_sync.js +0 -172
- package/dist/mcp/servicenow-mcp-unified/tools/system-properties/index.js +0 -36
- package/dist/mcp/servicenow-mcp-unified/tools/ui-builder/snow_discover_uib.js +0 -296
- package/dist/mcp/servicenow-mcp-unified/tools/workspace/snow_create_ux_component.js +0 -292
- package/dist/memory/session-memory.d.ts +0 -80
- package/dist/memory/session-memory.d.ts.map +0 -1
- package/dist/memory/session-memory.js +0 -468
- package/dist/memory/session-memory.js.map +0 -1
- package/dist/templates/opencode-agents-template.d.ts +0 -2
- package/dist/templates/opencode-agents-template.d.ts.map +0 -1
- package/dist/templates/opencode-agents-template.js +0 -469
- package/dist/templates/opencode-agents-template.js.map +0 -1
- package/dist/utils/opencode-output-interceptor.d.ts +0 -40
- package/dist/utils/opencode-output-interceptor.d.ts.map +0 -1
- package/dist/utils/opencode-output-interceptor.js +0 -258
- package/dist/utils/opencode-output-interceptor.js.map +0 -1
- package/scripts/bulk-optimize-tools.js +0 -486
- package/scripts/optimize-mcp-tools.ts +0 -410
- package/themes/README.md +0 -83
- package/themes/servicenow.json +0 -117
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_discover_uib - Discover UI Builder resources
|
|
4
|
-
*
|
|
5
|
-
* Unified tool for discovering UI Builder components, pages, routes, and usage analytics.
|
|
6
|
-
* Replaces: snow_discover_uib_components, snow_discover_uib_pages, snow_discover_uib_routes, snow_discover_uib_page_usage
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
10
|
-
exports.execute = execute;
|
|
11
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
12
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
13
|
-
exports.toolDefinition = {
|
|
14
|
-
name: 'snow_discover_uib',
|
|
15
|
-
description: 'Discover UIB resources: components, pages, routes, usage',
|
|
16
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
17
|
-
category: 'ui-frameworks',
|
|
18
|
-
subcategory: 'ui-builder',
|
|
19
|
-
use_cases: ["ui_builder", "discovery", "inventory"],
|
|
20
|
-
complexity: 'intermediate',
|
|
21
|
-
frequency: 'high',
|
|
22
|
-
inputSchema: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
resource_type: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
enum: ['components', 'pages', 'routes', 'usage'],
|
|
28
|
-
description: 'Resource type: components, pages, routes, or usage'
|
|
29
|
-
},
|
|
30
|
-
search: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Search filter (name, title, route, etc.)'
|
|
33
|
-
},
|
|
34
|
-
limit: {
|
|
35
|
-
type: 'number',
|
|
36
|
-
description: 'Max results',
|
|
37
|
-
default: 100
|
|
38
|
-
},
|
|
39
|
-
// Components-specific
|
|
40
|
-
category: {
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'Component category (components only)'
|
|
43
|
-
},
|
|
44
|
-
include_custom: {
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
description: 'Include custom components',
|
|
47
|
-
default: true
|
|
48
|
-
},
|
|
49
|
-
include_builtin: {
|
|
50
|
-
type: 'boolean',
|
|
51
|
-
description: 'Include built-in components',
|
|
52
|
-
default: true
|
|
53
|
-
},
|
|
54
|
-
// Pages-specific
|
|
55
|
-
experience_id: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Experience sys_id filter (pages/routes)'
|
|
58
|
-
},
|
|
59
|
-
include_routes: {
|
|
60
|
-
type: 'boolean',
|
|
61
|
-
description: 'Include route info (pages only)',
|
|
62
|
-
default: true
|
|
63
|
-
},
|
|
64
|
-
// Routes-specific
|
|
65
|
-
page_id: {
|
|
66
|
-
type: 'string',
|
|
67
|
-
description: 'Page sys_id filter (routes/usage)'
|
|
68
|
-
},
|
|
69
|
-
public_only: {
|
|
70
|
-
type: 'boolean',
|
|
71
|
-
description: 'Public routes only (routes only)',
|
|
72
|
-
default: false
|
|
73
|
-
},
|
|
74
|
-
// Common filters
|
|
75
|
-
active_only: {
|
|
76
|
-
type: 'boolean',
|
|
77
|
-
description: 'Active items only (pages/routes)',
|
|
78
|
-
default: true
|
|
79
|
-
},
|
|
80
|
-
// Usage-specific
|
|
81
|
-
include_traffic: {
|
|
82
|
-
type: 'boolean',
|
|
83
|
-
description: 'Include traffic metrics (usage only)',
|
|
84
|
-
default: false
|
|
85
|
-
},
|
|
86
|
-
include_complexity: {
|
|
87
|
-
type: 'boolean',
|
|
88
|
-
description: 'Include complexity analysis (usage only)',
|
|
89
|
-
default: true
|
|
90
|
-
},
|
|
91
|
-
time_period_days: {
|
|
92
|
-
type: 'number',
|
|
93
|
-
description: 'Analysis period (usage only)',
|
|
94
|
-
default: 30
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
required: ['resource_type']
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
async function execute(args, context) {
|
|
101
|
-
const { resource_type } = args;
|
|
102
|
-
try {
|
|
103
|
-
switch (resource_type) {
|
|
104
|
-
case 'components':
|
|
105
|
-
return await discoverComponents(args, context);
|
|
106
|
-
case 'pages':
|
|
107
|
-
return await discoverPages(args, context);
|
|
108
|
-
case 'routes':
|
|
109
|
-
return await discoverRoutes(args, context);
|
|
110
|
-
case 'usage':
|
|
111
|
-
return await discoverUsage(args, context);
|
|
112
|
-
default:
|
|
113
|
-
return (0, error_handler_js_1.createErrorResult)(`Invalid resource_type: ${resource_type}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
return (0, error_handler_js_1.createErrorResult)(error.message);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async function discoverComponents(args, context) {
|
|
121
|
-
const { category, search, include_custom = true, include_builtin = true, limit = 100 } = args;
|
|
122
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
123
|
-
// Build query
|
|
124
|
-
const queryParts = [];
|
|
125
|
-
if (category)
|
|
126
|
-
queryParts.push(`category=${category}`);
|
|
127
|
-
if (search)
|
|
128
|
-
queryParts.push(`nameLIKE${search}^ORlabelLIKE${search}`);
|
|
129
|
-
const query = queryParts.length > 0 ? queryParts.join('^') : '';
|
|
130
|
-
const response = await client.get('/api/now/table/sys_ux_lib_component', {
|
|
131
|
-
params: {
|
|
132
|
-
sysparm_query: query,
|
|
133
|
-
sysparm_limit: limit
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
const components = response.data.result.map((comp) => ({
|
|
137
|
-
sys_id: comp.sys_id,
|
|
138
|
-
name: comp.name,
|
|
139
|
-
label: comp.label,
|
|
140
|
-
category: comp.category,
|
|
141
|
-
description: comp.description,
|
|
142
|
-
version: comp.version,
|
|
143
|
-
is_custom: comp.category === 'custom'
|
|
144
|
-
}));
|
|
145
|
-
// Filter by type
|
|
146
|
-
const filteredComponents = components.filter((comp) => {
|
|
147
|
-
if (!include_custom && comp.is_custom)
|
|
148
|
-
return false;
|
|
149
|
-
if (!include_builtin && !comp.is_custom)
|
|
150
|
-
return false;
|
|
151
|
-
return true;
|
|
152
|
-
});
|
|
153
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
154
|
-
components: filteredComponents,
|
|
155
|
-
total: filteredComponents.length
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
async function discoverPages(args, context) {
|
|
159
|
-
const { search, experience_id, active_only = true, include_routes = true, limit = 100 } = args;
|
|
160
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
161
|
-
// Build query
|
|
162
|
-
const queryParts = [];
|
|
163
|
-
if (search)
|
|
164
|
-
queryParts.push(`nameLIKE${search}^ORtitleLIKE${search}`);
|
|
165
|
-
if (experience_id)
|
|
166
|
-
queryParts.push(`experience=${experience_id}`);
|
|
167
|
-
if (active_only)
|
|
168
|
-
queryParts.push('active=true');
|
|
169
|
-
const query = queryParts.length > 0 ? queryParts.join('^') : '';
|
|
170
|
-
const response = await client.get('/api/now/table/sys_ux_page', {
|
|
171
|
-
params: {
|
|
172
|
-
sysparm_query: query,
|
|
173
|
-
sysparm_limit: limit
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
const pages = [];
|
|
177
|
-
for (const page of response.data.result) {
|
|
178
|
-
const pageData = {
|
|
179
|
-
sys_id: page.sys_id,
|
|
180
|
-
name: page.name,
|
|
181
|
-
title: page.title,
|
|
182
|
-
description: page.description,
|
|
183
|
-
active: page.active
|
|
184
|
-
};
|
|
185
|
-
if (include_routes) {
|
|
186
|
-
// Get routes for this page
|
|
187
|
-
const routesResponse = await client.get('/api/now/table/sys_ux_app_route', {
|
|
188
|
-
params: { sysparm_query: `page=${page.sys_id}` }
|
|
189
|
-
});
|
|
190
|
-
pageData.routes = routesResponse.data.result.map((route) => ({
|
|
191
|
-
sys_id: route.sys_id,
|
|
192
|
-
route: route.route,
|
|
193
|
-
url: `${context.instanceUrl}${route.route}`
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
pages.push(pageData);
|
|
197
|
-
}
|
|
198
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
199
|
-
pages,
|
|
200
|
-
total: pages.length
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
async function discoverRoutes(args, context) {
|
|
204
|
-
const { search, page_id, experience_id, public_only = false, active_only = true, limit = 100 } = args;
|
|
205
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
206
|
-
// Build query
|
|
207
|
-
const queryParts = [];
|
|
208
|
-
if (search)
|
|
209
|
-
queryParts.push(`routeLIKE${search}`);
|
|
210
|
-
if (page_id)
|
|
211
|
-
queryParts.push(`page=${page_id}`);
|
|
212
|
-
if (experience_id)
|
|
213
|
-
queryParts.push(`experience=${experience_id}`);
|
|
214
|
-
if (public_only)
|
|
215
|
-
queryParts.push('public=true');
|
|
216
|
-
if (active_only)
|
|
217
|
-
queryParts.push('active=true');
|
|
218
|
-
const query = queryParts.length > 0 ? queryParts.join('^') : '';
|
|
219
|
-
const response = await client.get('/api/now/table/sys_ux_app_route', {
|
|
220
|
-
params: {
|
|
221
|
-
sysparm_query: query,
|
|
222
|
-
sysparm_limit: limit
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
const routes = response.data.result.map((route) => ({
|
|
226
|
-
sys_id: route.sys_id,
|
|
227
|
-
route: route.route,
|
|
228
|
-
page_id: route.page,
|
|
229
|
-
experience_id: route.experience,
|
|
230
|
-
roles: route.roles ? route.roles.split(',') : [],
|
|
231
|
-
public: route.public === 'true' || route.public === true,
|
|
232
|
-
active: route.active === 'true' || route.active === true,
|
|
233
|
-
url: `${context.instanceUrl}${route.route}`
|
|
234
|
-
}));
|
|
235
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
236
|
-
routes,
|
|
237
|
-
total: routes.length
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
async function discoverUsage(args, context) {
|
|
241
|
-
const { page_id, include_traffic = false, include_complexity = true, time_period_days = 30 } = args;
|
|
242
|
-
if (!page_id) {
|
|
243
|
-
return (0, error_handler_js_1.createErrorResult)('page_id is required for usage analysis');
|
|
244
|
-
}
|
|
245
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
246
|
-
// Get page details
|
|
247
|
-
const pageResponse = await client.get(`/api/now/table/sys_ux_page/${page_id}`);
|
|
248
|
-
const page = pageResponse.data.result;
|
|
249
|
-
const usage = {
|
|
250
|
-
page: {
|
|
251
|
-
sys_id: page.sys_id,
|
|
252
|
-
name: page.name,
|
|
253
|
-
title: page.title
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
if (include_complexity) {
|
|
257
|
-
// Get page elements
|
|
258
|
-
const elementsResponse = await client.get('/api/now/table/sys_ux_page_element', {
|
|
259
|
-
params: { sysparm_query: `page=${page_id}` }
|
|
260
|
-
});
|
|
261
|
-
const elements = elementsResponse.data.result;
|
|
262
|
-
// Get data brokers
|
|
263
|
-
const brokersResponse = await client.get('/api/now/table/sys_ux_data_broker', {
|
|
264
|
-
params: { sysparm_query: `page=${page_id}` }
|
|
265
|
-
});
|
|
266
|
-
const brokers = brokersResponse.data.result;
|
|
267
|
-
// Get client scripts
|
|
268
|
-
const scriptsResponse = await client.get('/api/now/table/sys_ux_client_script', {
|
|
269
|
-
params: { sysparm_query: `page=${page_id}` }
|
|
270
|
-
});
|
|
271
|
-
const scripts = scriptsResponse.data.result;
|
|
272
|
-
// Calculate complexity score
|
|
273
|
-
const complexity = {
|
|
274
|
-
total_elements: elements.length,
|
|
275
|
-
total_data_brokers: brokers.length,
|
|
276
|
-
total_client_scripts: scripts.length,
|
|
277
|
-
complexity_score: (elements.length * 1) + (brokers.length * 2) + (scripts.length * 3),
|
|
278
|
-
rating: 'low'
|
|
279
|
-
};
|
|
280
|
-
if (complexity.complexity_score > 50)
|
|
281
|
-
complexity.rating = 'high';
|
|
282
|
-
else if (complexity.complexity_score > 20)
|
|
283
|
-
complexity.rating = 'medium';
|
|
284
|
-
usage.complexity = complexity;
|
|
285
|
-
}
|
|
286
|
-
if (include_traffic) {
|
|
287
|
-
usage.traffic = {
|
|
288
|
-
note: 'Traffic metrics require integration with ServiceNow Performance Analytics',
|
|
289
|
-
time_period_days
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
return (0, error_handler_js_1.createSuccessResult)(usage);
|
|
293
|
-
}
|
|
294
|
-
exports.version = '1.0.0';
|
|
295
|
-
exports.author = 'Snow-Flow v8.2.0';
|
|
296
|
-
//# sourceMappingURL=snow_discover_uib.js.map
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* snow_create_ux_component - Create UX workspace components
|
|
4
|
-
*
|
|
5
|
-
* Unified tool for creating UX framework records: experience, app config, page macroponent, page registry, and app route.
|
|
6
|
-
* Replaces: snow_create_ux_experience, snow_create_ux_app_config, snow_create_ux_page_macroponent, snow_create_ux_page_registry, snow_create_ux_app_route
|
|
7
|
-
*
|
|
8
|
-
* Sequential workflow:
|
|
9
|
-
* STEP 1: experience (sys_ux_experience) - Top-level container
|
|
10
|
-
* STEP 2: app_config (sys_ux_app_config) - Workspace settings
|
|
11
|
-
* STEP 3: page_macroponent (sys_ux_macroponent) - Page content definition
|
|
12
|
-
* STEP 4: page_registry (sys_ux_page_registry) - Register page for use
|
|
13
|
-
* STEP 5: app_route (sys_ux_app_route) - URL routing
|
|
14
|
-
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.author = exports.version = exports.toolDefinition = void 0;
|
|
17
|
-
exports.execute = execute;
|
|
18
|
-
const auth_js_1 = require("../../shared/auth.js");
|
|
19
|
-
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
20
|
-
exports.toolDefinition = {
|
|
21
|
-
name: 'snow_create_ux_component',
|
|
22
|
-
description: 'Create UX workspace components: experience, app config, macroponent, registry, route',
|
|
23
|
-
// Metadata for tool discovery (not sent to LLM)
|
|
24
|
-
category: 'ui-frameworks',
|
|
25
|
-
subcategory: 'workspace',
|
|
26
|
-
use_cases: ["workspace", "ux-framework", "agent-workspace"],
|
|
27
|
-
complexity: 'intermediate',
|
|
28
|
-
frequency: 'high',
|
|
29
|
-
inputSchema: {
|
|
30
|
-
type: 'object',
|
|
31
|
-
properties: {
|
|
32
|
-
component_type: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
enum: ['experience', 'app_config', 'page_macroponent', 'page_registry', 'app_route'],
|
|
35
|
-
description: 'Component type: experience (STEP 1), app_config (STEP 2), page_macroponent (STEP 3), page_registry (STEP 4), app_route (STEP 5)'
|
|
36
|
-
},
|
|
37
|
-
name: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: 'Component name'
|
|
40
|
-
},
|
|
41
|
-
description: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
description: 'Component description'
|
|
44
|
-
},
|
|
45
|
-
// Experience-specific
|
|
46
|
-
root_macroponent: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Root macroponent sys_id (experience only)'
|
|
49
|
-
},
|
|
50
|
-
// App Config-specific
|
|
51
|
-
experience_sys_id: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'Experience sys_id (required for app_config, app_route)'
|
|
54
|
-
},
|
|
55
|
-
list_config_id: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'List menu configuration sys_id (app_config only)'
|
|
58
|
-
},
|
|
59
|
-
// Page Macroponent-specific
|
|
60
|
-
root_component: {
|
|
61
|
-
type: 'string',
|
|
62
|
-
default: 'sn-canvas-panel',
|
|
63
|
-
description: 'Root component to render (page_macroponent only)'
|
|
64
|
-
},
|
|
65
|
-
composition: {
|
|
66
|
-
type: 'object',
|
|
67
|
-
description: 'JSON layout configuration (page_macroponent only)'
|
|
68
|
-
},
|
|
69
|
-
// Page Registry-specific
|
|
70
|
-
sys_name: {
|
|
71
|
-
type: 'string',
|
|
72
|
-
description: 'Unique technical name (required for page_registry)'
|
|
73
|
-
},
|
|
74
|
-
app_config_sys_id: {
|
|
75
|
-
type: 'string',
|
|
76
|
-
description: 'App config sys_id (required for page_registry, app_route)'
|
|
77
|
-
},
|
|
78
|
-
macroponent_sys_id: {
|
|
79
|
-
type: 'string',
|
|
80
|
-
description: 'Macroponent sys_id (required for page_registry)'
|
|
81
|
-
},
|
|
82
|
-
// App Route-specific
|
|
83
|
-
page_sys_name: {
|
|
84
|
-
type: 'string',
|
|
85
|
-
description: 'Page sys_name from registry (app_route only)'
|
|
86
|
-
},
|
|
87
|
-
route: {
|
|
88
|
-
type: 'string',
|
|
89
|
-
description: 'URL route path (app_route only)'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
required: ['component_type', 'name']
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
async function execute(args, context) {
|
|
96
|
-
const { component_type } = args;
|
|
97
|
-
try {
|
|
98
|
-
switch (component_type) {
|
|
99
|
-
case 'experience':
|
|
100
|
-
return await createExperience(args, context);
|
|
101
|
-
case 'app_config':
|
|
102
|
-
return await createAppConfig(args, context);
|
|
103
|
-
case 'page_macroponent':
|
|
104
|
-
return await createPageMacroponent(args, context);
|
|
105
|
-
case 'page_registry':
|
|
106
|
-
return await createPageRegistry(args, context);
|
|
107
|
-
case 'app_route':
|
|
108
|
-
return await createAppRoute(args, context);
|
|
109
|
-
default:
|
|
110
|
-
return (0, error_handler_js_1.createErrorResult)(`Invalid component_type: ${component_type}`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
return (0, error_handler_js_1.createErrorResult)(error instanceof error_handler_js_1.SnowFlowError ? error : error.message);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async function createExperience(args, context) {
|
|
118
|
-
const { name, root_macroponent, description } = args;
|
|
119
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
120
|
-
try {
|
|
121
|
-
// Create experience
|
|
122
|
-
const experienceData = {
|
|
123
|
-
name,
|
|
124
|
-
description: description || `UX Experience: ${name}`,
|
|
125
|
-
active: true
|
|
126
|
-
};
|
|
127
|
-
if (root_macroponent) {
|
|
128
|
-
experienceData.root_macroponent = root_macroponent;
|
|
129
|
-
}
|
|
130
|
-
const response = await client.post('/api/now/table/sys_ux_experience', experienceData);
|
|
131
|
-
const experience = response.data.result;
|
|
132
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
133
|
-
created: true,
|
|
134
|
-
experience_sys_id: experience.sys_id,
|
|
135
|
-
name: experience.name,
|
|
136
|
-
root_macroponent: experience.root_macroponent || null,
|
|
137
|
-
message: `UX Experience '${name}' created successfully`,
|
|
138
|
-
next_step: 'Create App Configuration (STEP 2) with component_type: app_config',
|
|
139
|
-
note: 'Requires Now Experience Framework (UXF) enabled'
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
// Check if error is due to missing UXF plugin
|
|
144
|
-
if (error.message && error.message.includes('sys_ux_experience')) {
|
|
145
|
-
return (0, error_handler_js_1.createErrorResult)(new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.PLUGIN_MISSING, 'Now Experience Framework (UXF) plugin not installed or enabled', {
|
|
146
|
-
details: {
|
|
147
|
-
plugin: 'com.snc.now_experience',
|
|
148
|
-
suggestion: 'Install Now Experience Framework from ServiceNow Store or use traditional form/list configurations',
|
|
149
|
-
alternative: 'Use Service Portal pages or traditional UI pages instead'
|
|
150
|
-
}
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
throw error;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
async function createAppConfig(args, context) {
|
|
157
|
-
const { name, experience_sys_id, description, list_config_id } = args;
|
|
158
|
-
if (!experience_sys_id) {
|
|
159
|
-
return (0, error_handler_js_1.createErrorResult)('experience_sys_id is required for app_config');
|
|
160
|
-
}
|
|
161
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
162
|
-
// Validate experience exists
|
|
163
|
-
const experienceCheck = await client.get(`/api/now/table/sys_ux_experience/${experience_sys_id}`);
|
|
164
|
-
if (!experienceCheck.data.result) {
|
|
165
|
-
throw new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.VALIDATION_ERROR, `Experience '${experience_sys_id}' not found`, { details: { experience_sys_id } });
|
|
166
|
-
}
|
|
167
|
-
// Create app config
|
|
168
|
-
const appConfigData = {
|
|
169
|
-
name,
|
|
170
|
-
experience_assoc: experience_sys_id,
|
|
171
|
-
description: description || `App configuration for ${name}`,
|
|
172
|
-
active: true
|
|
173
|
-
};
|
|
174
|
-
if (list_config_id) {
|
|
175
|
-
appConfigData.list_config_id = list_config_id;
|
|
176
|
-
}
|
|
177
|
-
const response = await client.post('/api/now/table/sys_ux_app_config', appConfigData);
|
|
178
|
-
const appConfig = response.data.result;
|
|
179
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
180
|
-
created: true,
|
|
181
|
-
app_config_sys_id: appConfig.sys_id,
|
|
182
|
-
name: appConfig.name,
|
|
183
|
-
experience_sys_id,
|
|
184
|
-
list_config_id: appConfig.list_config_id || null,
|
|
185
|
-
message: `UX App Configuration '${name}' created successfully`,
|
|
186
|
-
next_step: 'Create Page Macroponent (STEP 3) with component_type: page_macroponent'
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
async function createPageMacroponent(args, context) {
|
|
190
|
-
const { name, root_component = 'sn-canvas-panel', composition, description } = args;
|
|
191
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
192
|
-
// Default simple composition if not provided
|
|
193
|
-
const defaultComposition = {
|
|
194
|
-
layout: 'single-column',
|
|
195
|
-
components: []
|
|
196
|
-
};
|
|
197
|
-
// Create macroponent
|
|
198
|
-
const macroponentData = {
|
|
199
|
-
name,
|
|
200
|
-
root_component,
|
|
201
|
-
composition: JSON.stringify(composition || defaultComposition),
|
|
202
|
-
description: description || `Page macroponent: ${name}`,
|
|
203
|
-
active: true
|
|
204
|
-
};
|
|
205
|
-
const response = await client.post('/api/now/table/sys_ux_macroponent', macroponentData);
|
|
206
|
-
const macroponent = response.data.result;
|
|
207
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
208
|
-
created: true,
|
|
209
|
-
macroponent_sys_id: macroponent.sys_id,
|
|
210
|
-
name: macroponent.name,
|
|
211
|
-
root_component: macroponent.root_component,
|
|
212
|
-
message: `Page Macroponent '${name}' created successfully`,
|
|
213
|
-
next_step: 'Create Page Registry (STEP 4) with component_type: page_registry'
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
async function createPageRegistry(args, context) {
|
|
217
|
-
const { sys_name, app_config_sys_id, macroponent_sys_id, description } = args;
|
|
218
|
-
if (!sys_name) {
|
|
219
|
-
return (0, error_handler_js_1.createErrorResult)('sys_name is required for page_registry');
|
|
220
|
-
}
|
|
221
|
-
if (!app_config_sys_id) {
|
|
222
|
-
return (0, error_handler_js_1.createErrorResult)('app_config_sys_id is required for page_registry');
|
|
223
|
-
}
|
|
224
|
-
if (!macroponent_sys_id) {
|
|
225
|
-
return (0, error_handler_js_1.createErrorResult)('macroponent_sys_id is required for page_registry');
|
|
226
|
-
}
|
|
227
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
228
|
-
// Validate app config exists
|
|
229
|
-
const appConfigCheck = await client.get(`/api/now/table/sys_ux_app_config/${app_config_sys_id}`);
|
|
230
|
-
if (!appConfigCheck.data.result) {
|
|
231
|
-
throw new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.VALIDATION_ERROR, `App Config '${app_config_sys_id}' not found`, { details: { app_config_sys_id } });
|
|
232
|
-
}
|
|
233
|
-
// Validate macroponent exists
|
|
234
|
-
const macroponentCheck = await client.get(`/api/now/table/sys_ux_macroponent/${macroponent_sys_id}`);
|
|
235
|
-
if (!macroponentCheck.data.result) {
|
|
236
|
-
throw new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.VALIDATION_ERROR, `Macroponent '${macroponent_sys_id}' not found`, { details: { macroponent_sys_id } });
|
|
237
|
-
}
|
|
238
|
-
// Create page registry
|
|
239
|
-
const registryData = {
|
|
240
|
-
sys_name,
|
|
241
|
-
app_config: app_config_sys_id,
|
|
242
|
-
macroponent: macroponent_sys_id,
|
|
243
|
-
description: description || `Page registry for ${sys_name}`,
|
|
244
|
-
active: true
|
|
245
|
-
};
|
|
246
|
-
const response = await client.post('/api/now/table/sys_ux_page_registry', registryData);
|
|
247
|
-
const registry = response.data.result;
|
|
248
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
249
|
-
created: true,
|
|
250
|
-
registry_sys_id: registry.sys_id,
|
|
251
|
-
sys_name: registry.sys_name,
|
|
252
|
-
app_config_sys_id,
|
|
253
|
-
macroponent_sys_id,
|
|
254
|
-
message: `Page Registry '${sys_name}' created successfully`,
|
|
255
|
-
next_step: 'Create Route (STEP 5) with component_type: app_route'
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
async function createAppRoute(args, context) {
|
|
259
|
-
const { name, app_config_sys_id, experience_sys_id, page_sys_name, route, description } = args;
|
|
260
|
-
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
261
|
-
// Create route
|
|
262
|
-
const routeData = {
|
|
263
|
-
name,
|
|
264
|
-
route: route || `/${name.toLowerCase().replace(/\s+/g, '-')}`,
|
|
265
|
-
description: description || `Route for ${name}`,
|
|
266
|
-
active: true
|
|
267
|
-
};
|
|
268
|
-
if (app_config_sys_id) {
|
|
269
|
-
routeData.app_config = app_config_sys_id;
|
|
270
|
-
}
|
|
271
|
-
if (experience_sys_id) {
|
|
272
|
-
routeData.experience = experience_sys_id;
|
|
273
|
-
}
|
|
274
|
-
if (page_sys_name) {
|
|
275
|
-
routeData.page_sys_name = page_sys_name;
|
|
276
|
-
}
|
|
277
|
-
const response = await client.post('/api/now/table/sys_ux_app_route', routeData);
|
|
278
|
-
const appRoute = response.data.result;
|
|
279
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
280
|
-
created: true,
|
|
281
|
-
route_sys_id: appRoute.sys_id,
|
|
282
|
-
name: appRoute.name,
|
|
283
|
-
route: appRoute.route,
|
|
284
|
-
page_sys_name: appRoute.page_sys_name || null,
|
|
285
|
-
full_url: `/now/experience${appRoute.route}`,
|
|
286
|
-
message: `UX App Route '${name}' created successfully`,
|
|
287
|
-
next_step: 'Workspace creation complete! Update App Config landing page if needed using snow_update_ux_app_config_landing_page'
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
exports.version = '1.0.0';
|
|
291
|
-
exports.author = 'Snow-Flow v8.2.0';
|
|
292
|
-
//# sourceMappingURL=snow_create_ux_component.js.map
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Memory System - JSON-based implementation
|
|
3
|
-
* Simple JSON file storage for swarm orchestration sessions
|
|
4
|
-
*/
|
|
5
|
-
interface DeploymentPattern {
|
|
6
|
-
taskType: string;
|
|
7
|
-
agentSequence: string[];
|
|
8
|
-
mcpSequence: string[];
|
|
9
|
-
successRate: number;
|
|
10
|
-
avgDuration: number;
|
|
11
|
-
lastUsed: Date;
|
|
12
|
-
useCount?: number;
|
|
13
|
-
}
|
|
14
|
-
interface ServiceNowArtifact {
|
|
15
|
-
type: string;
|
|
16
|
-
name: string;
|
|
17
|
-
sys_id?: string;
|
|
18
|
-
metadata?: any;
|
|
19
|
-
}
|
|
20
|
-
export declare class SessionMemorySystem {
|
|
21
|
-
private memoryDir;
|
|
22
|
-
private memory;
|
|
23
|
-
private storage;
|
|
24
|
-
private saveDebounceTimer?;
|
|
25
|
-
private readonly SAVE_DELAY;
|
|
26
|
-
constructor(dbPath?: string);
|
|
27
|
-
private getFilePath;
|
|
28
|
-
private loadStorage;
|
|
29
|
-
private convertStorageToMemory;
|
|
30
|
-
private scheduleSave;
|
|
31
|
-
private saveAll;
|
|
32
|
-
private saveJSON;
|
|
33
|
-
storePattern(pattern: DeploymentPattern): void;
|
|
34
|
-
getBestPattern(taskType: string): DeploymentPattern | null;
|
|
35
|
-
storeArtifact(artifact: ServiceNowArtifact): void;
|
|
36
|
-
findSimilarArtifacts(type: string, namePattern: string): ServiceNowArtifact[];
|
|
37
|
-
storeLearning(key: string, value: any, confidence?: number): void;
|
|
38
|
-
getLearning(key: string): any | null;
|
|
39
|
-
recordTaskCompletion(taskId: string, objective: string, type: string, agentsUsed: string[], success: boolean, duration: number): void;
|
|
40
|
-
getSuccessRate(taskType: string): number;
|
|
41
|
-
exportMemory(): string;
|
|
42
|
-
importMemory(memoryData: string): void;
|
|
43
|
-
clearMemory(): void;
|
|
44
|
-
storeInContext(key: string, value: any): void;
|
|
45
|
-
getFromContext(key: string): any;
|
|
46
|
-
store(key: string, value: any): void;
|
|
47
|
-
get(key: string): any;
|
|
48
|
-
getDbPath(): string;
|
|
49
|
-
close(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Find similar patterns for a given task type
|
|
52
|
-
*/
|
|
53
|
-
findSimilarPatterns(taskType: string): DeploymentPattern[];
|
|
54
|
-
/**
|
|
55
|
-
* Store a decision made by the orchestrator
|
|
56
|
-
*/
|
|
57
|
-
storeDecision(taskId: string, decision: any): void;
|
|
58
|
-
/**
|
|
59
|
-
* Find the best pattern for a task type
|
|
60
|
-
*/
|
|
61
|
-
findBestPattern(taskType: string): DeploymentPattern | null;
|
|
62
|
-
/**
|
|
63
|
-
* Get memory statistics
|
|
64
|
-
*/
|
|
65
|
-
getStats(): any;
|
|
66
|
-
/**
|
|
67
|
-
* Store progress information
|
|
68
|
-
*/
|
|
69
|
-
storeProgress(agentId: string, progress: any): void;
|
|
70
|
-
/**
|
|
71
|
-
* Get progress information
|
|
72
|
-
*/
|
|
73
|
-
getProgress(agentId: string): any;
|
|
74
|
-
/**
|
|
75
|
-
* Store failure pattern for learning
|
|
76
|
-
*/
|
|
77
|
-
storeFailurePattern(pattern: any): void;
|
|
78
|
-
}
|
|
79
|
-
export { SessionMemorySystem as QueenMemorySystem };
|
|
80
|
-
//# sourceMappingURL=session-memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-memory.d.ts","sourceRoot":"","sources":["../../src/memory/session-memory.ts"],"names":[],"mappings":"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"}
|