snow-flow 8.39.14 → 8.40.1

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.
Files changed (33) hide show
  1. package/CLAUDE.md +190 -0
  2. package/dist/mcp/servicenow-mcp-unified/tools/applications/index.d.ts +1 -0
  3. package/dist/mcp/servicenow-mcp-unified/tools/applications/index.d.ts.map +1 -1
  4. package/dist/mcp/servicenow-mcp-unified/tools/applications/index.js +4 -1
  5. package/dist/mcp/servicenow-mcp-unified/tools/applications/index.js.map +1 -1
  6. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.d.ts +9 -3
  7. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.d.ts.map +1 -1
  8. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.js +239 -13
  9. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.js.map +1 -1
  10. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.d.ts +18 -0
  11. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.d.ts.map +1 -0
  12. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.js +297 -0
  13. package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.js.map +1 -0
  14. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.d.ts.map +1 -1
  15. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.js +31 -29
  16. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.js.map +1 -1
  17. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.d.ts.map +1 -1
  18. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.js +33 -23
  19. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.js.map +1 -1
  20. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.d.ts.map +1 -1
  21. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.js +32 -38
  22. package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.js.map +1 -1
  23. package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_ensure_active_update_set.d.ts.map +1 -1
  24. package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_ensure_active_update_set.js +48 -4
  25. package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_ensure_active_update_set.js.map +1 -1
  26. package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_update_set_manage.d.ts.map +1 -1
  27. package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_update_set_manage.js +74 -4
  28. package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_update_set_manage.js.map +1 -1
  29. package/dist/utils/servicenow-client.d.ts +2 -2
  30. package/dist/utils/servicenow-client.d.ts.map +1 -1
  31. package/dist/utils/servicenow-client.js +33 -19
  32. package/dist/utils/servicenow-client.js.map +1 -1
  33. package/package.json +1 -1
package/CLAUDE.md CHANGED
@@ -350,6 +350,113 @@ await snow_update_set_manage({
350
350
 
351
351
  ---
352
352
 
353
+ ## 📦 APPLICATION SCOPE MANAGEMENT
354
+
355
+ ### When to Create a New Application
356
+
357
+ ServiceNow applications (scoped apps) provide isolation, clear ownership, and easy deployment across instances.
358
+
359
+ **✅ CREATE APPLICATION when:**
360
+ - Building a complete feature set (e.g., HR Portal, Customer Onboarding)
361
+ - Creating functionality that needs to be deployed as a single unit
362
+ - Building integrations with external systems
363
+ - Developing for multiple ServiceNow instances
364
+ - Need clear ownership, versioning, and dependency management
365
+
366
+ **❌ USE GLOBAL SCOPE when:**
367
+ - Making small fixes or patches
368
+ - Creating shared utilities used across applications
369
+ - Quick prototypes or POCs
370
+ - Cross-application functionality
371
+
372
+ ### Application + Update Set Workflow
373
+
374
+ ```javascript
375
+ // 1. CREATE APPLICATION (with auto Update Set and scope switch!)
376
+ const app = await snow_create_application({
377
+ name: "HR Self-Service Portal",
378
+ scope: "x_myco_hr_portal", // Must start with x_
379
+ version: "1.0.0",
380
+ short_description: "Employee self-service HR portal",
381
+ vendor: "My Company",
382
+ vendor_prefix: "myco"
383
+ // auto_create_update_set: true (default) → Creates Update Set automatically
384
+ // auto_switch_scope: true (default) → Switches to new scope automatically
385
+ });
386
+
387
+ // 2. DEVELOP (all artifacts are tracked in the application scope!)
388
+ await snow_create_artifact({
389
+ type: 'sp_widget',
390
+ name: 'hr_dashboard',
391
+ // ... widget config
392
+ });
393
+
394
+ // 3. COMPLETE UPDATE SET when done
395
+ await snow_update_set_manage({
396
+ action: 'complete',
397
+ update_set_id: app.update_set.sys_id
398
+ });
399
+ ```
400
+
401
+ ### Update Sets with Application Scope
402
+
403
+ ```javascript
404
+ // Create Update Set in a SPECIFIC application scope
405
+ const updateSet = await snow_update_set_manage({
406
+ action: 'create',
407
+ name: "Feature: New HR Dashboard",
408
+ description: "Adding dashboard functionality",
409
+ application_scope: "x_myco_hr_portal" // ← Specify the application!
410
+ });
411
+
412
+ // Or use application sys_id
413
+ const updateSet = await snow_update_set_manage({
414
+ action: 'create',
415
+ name: "Feature: New HR Dashboard",
416
+ description: "Adding dashboard functionality",
417
+ application_scope: "abc123def456" // sys_id of the application
418
+ });
419
+ ```
420
+
421
+ ### Switching Between Scopes
422
+
423
+ ```javascript
424
+ // Switch to a scoped application
425
+ await snow_switch_application_scope({
426
+ scope: "x_myco_hr_portal",
427
+ create_update_set: true // Also create Update Set in this scope
428
+ });
429
+
430
+ // Switch back to global
431
+ await snow_switch_application_scope({
432
+ scope: "global"
433
+ });
434
+ ```
435
+
436
+ ### Application Scope Decision Matrix
437
+
438
+ | Scenario | Recommended Scope | Rationale |
439
+ |------------------------------------|-------------------|----------------------------------------------|
440
+ | Complete feature set (HR Portal) | ✅ Scoped App | Isolated, versioned, deployable as unit |
441
+ | Customer-specific integration | ✅ Scoped App | Easy to deploy/remove per customer |
442
+ | Third-party connector | ✅ Scoped App | Clear ownership and dependency tracking |
443
+ | Multi-instance deployment | ✅ Scoped App | Export/import as single package |
444
+ | Shared utility script | 🌐 Global | Needs to be used across all applications |
445
+ | Quick bug fix or patch | 🌐 Global | Not worth creating dedicated application |
446
+ | System-wide business rule | 🌐 Global | Affects multiple tables/applications |
447
+ | Cross-application functionality | 🌐 Global | Shared between multiple scoped apps |
448
+ | Prototype or POC | 🌐 Global | Temporary, may be discarded |
449
+
450
+ ### Application Scope Best Practices
451
+
452
+ - **Scope naming**: Always use `x_<vendor>_<app>` format (e.g., `x_myco_hr_portal`)
453
+ - **One app per feature set**: Don't mix unrelated functionality
454
+ - **Update Sets match scope**: Always create Update Sets in the same scope as your development
455
+ - **Document dependencies**: Track which other apps/scopes your app depends on
456
+ - **Version properly**: Use semantic versioning (1.0.0, 1.1.0, 2.0.0)
457
+
458
+ ---
459
+
353
460
  ## 🎨 WIDGET COHERENCE
354
461
 
355
462
  Widgets require **perfect synchronization** between Server, Client, and HTML scripts.
@@ -416,6 +523,8 @@ function($scope) {
416
523
  |---------------------------|---------------------------------------------------|
417
524
  | Create Update Set | `snow_update_set_manage({ action: 'create' })` |
418
525
  | Complete Update Set | `snow_update_set_manage({ action: 'complete' })` |
526
+ | Create Application | `snow_create_application()` |
527
+ | Switch Application Scope | `snow_switch_application_scope()` |
419
528
  | Create Widget | `snow_create_artifact({ type: 'sp_widget' })` |
420
529
  | Create Business Rule | `snow_create_business_rule()` |
421
530
  | Create Script Include | `snow_create_script_include()` |
@@ -660,6 +769,87 @@ const incidents = await snow_query_incidents({
660
769
  console.log(`Found ${incidents.length} high-priority active incidents`);
661
770
  ```
662
771
 
772
+ ### Pattern 5: Scoped Application Development
773
+
774
+ ```javascript
775
+ // 1. Pre-flight: Activity Tracking
776
+ const activity = await activity_start({
777
+ source: "request",
778
+ storyTitle: "Build HR Self-Service Portal"
779
+ });
780
+
781
+ // 2. Create Application (auto-creates Update Set and switches scope!)
782
+ const app = await snow_create_application({
783
+ name: "HR Self-Service Portal",
784
+ scope: "x_myco_hr_portal",
785
+ version: "1.0.0",
786
+ short_description: "Employee self-service for HR requests",
787
+ vendor: "My Company",
788
+ vendor_prefix: "myco"
789
+ // auto_create_update_set: true (default)
790
+ // auto_switch_scope: true (default)
791
+ });
792
+
793
+ // 3. Log the application
794
+ await activity_add_artifact({
795
+ activityId: activity.activityId,
796
+ artifactType: 'application',
797
+ artifactName: 'HR Self-Service Portal',
798
+ artifactSysId: app.application.sys_id
799
+ });
800
+
801
+ // 4. Create widgets (automatically in the scoped application!)
802
+ const widget = await snow_create_artifact({
803
+ type: 'sp_widget',
804
+ name: 'hr_request_form',
805
+ title: 'HR Request Form',
806
+ template: '...',
807
+ server_script: '...',
808
+ client_script: '...'
809
+ });
810
+
811
+ await activity_add_artifact({
812
+ activityId: activity.activityId,
813
+ artifactType: 'widget',
814
+ artifactName: 'hr_request_form',
815
+ artifactSysId: widget.sys_id
816
+ });
817
+
818
+ // 5. Complete
819
+ await activity_complete({
820
+ activityId: activity.activityId,
821
+ summary: "Created HR Self-Service Portal with request form widget"
822
+ });
823
+ await snow_update_set_manage({
824
+ action: 'complete',
825
+ update_set_id: app.update_set.sys_id
826
+ });
827
+ ```
828
+
829
+ ### Pattern 6: Working with Existing Scoped Application
830
+
831
+ ```javascript
832
+ // 1. Switch to the existing application scope
833
+ await snow_switch_application_scope({
834
+ scope: "x_myco_hr_portal", // or use sys_id
835
+ create_update_set: true, // Create new Update Set for this work
836
+ update_set_name: "Feature: Add Leave Request"
837
+ });
838
+
839
+ // 2. Develop new features (tracked in application scope)
840
+ await snow_create_business_rule({
841
+ name: "Auto-approve short leave",
842
+ table: "x_myco_hr_portal_leave_request",
843
+ // ... config
844
+ });
845
+
846
+ // 3. Complete Update Set
847
+ await snow_update_set_manage({ action: 'complete' });
848
+
849
+ // 4. Switch back to global if needed
850
+ await snow_switch_application_scope({ scope: "global" });
851
+ ```
852
+
663
853
  ---
664
854
 
665
855
  ## ✅ SUCCESS CRITERIA
@@ -1,3 +1,4 @@
1
1
  export { toolDefinition as snow_create_application_def, execute as snow_create_application_exec } from './snow_create_application.js';
2
2
  export { toolDefinition as snow_install_application_def, execute as snow_install_application_exec } from './snow_install_application.js';
3
+ export { toolDefinition as snow_switch_application_scope_def, execute as snow_switch_application_scope_exec } from './snow_switch_application_scope.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,2BAA2B,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACtI,OAAO,EAAE,cAAc,IAAI,4BAA4B,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,2BAA2B,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACtI,OAAO,EAAE,cAAc,IAAI,4BAA4B,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AACzI,OAAO,EAAE,cAAc,IAAI,iCAAiC,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,oCAAoC,CAAC"}
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.snow_install_application_exec = exports.snow_install_application_def = exports.snow_create_application_exec = exports.snow_create_application_def = void 0;
3
+ exports.snow_switch_application_scope_exec = exports.snow_switch_application_scope_def = exports.snow_install_application_exec = exports.snow_install_application_def = exports.snow_create_application_exec = exports.snow_create_application_def = void 0;
4
4
  var snow_create_application_js_1 = require("./snow_create_application.js");
5
5
  Object.defineProperty(exports, "snow_create_application_def", { enumerable: true, get: function () { return snow_create_application_js_1.toolDefinition; } });
6
6
  Object.defineProperty(exports, "snow_create_application_exec", { enumerable: true, get: function () { return snow_create_application_js_1.execute; } });
7
7
  var snow_install_application_js_1 = require("./snow_install_application.js");
8
8
  Object.defineProperty(exports, "snow_install_application_def", { enumerable: true, get: function () { return snow_install_application_js_1.toolDefinition; } });
9
9
  Object.defineProperty(exports, "snow_install_application_exec", { enumerable: true, get: function () { return snow_install_application_js_1.execute; } });
10
+ var snow_switch_application_scope_js_1 = require("./snow_switch_application_scope.js");
11
+ Object.defineProperty(exports, "snow_switch_application_scope_def", { enumerable: true, get: function () { return snow_switch_application_scope_js_1.toolDefinition; } });
12
+ Object.defineProperty(exports, "snow_switch_application_scope_exec", { enumerable: true, get: function () { return snow_switch_application_scope_js_1.execute; } });
10
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/index.ts"],"names":[],"mappings":";;;AAAA,2EAAsI;AAA7H,yIAAA,cAAc,OAA+B;AAAE,0IAAA,OAAO,OAAgC;AAC/F,6EAAyI;AAAhI,2IAAA,cAAc,OAAgC;AAAE,4IAAA,OAAO,OAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/index.ts"],"names":[],"mappings":";;;AAAA,2EAAsI;AAA7H,yIAAA,cAAc,OAA+B;AAAE,0IAAA,OAAO,OAAgC;AAC/F,6EAAyI;AAAhI,2IAAA,cAAc,OAAgC;AAAE,4IAAA,OAAO,OAAiC;AACjG,uFAAwJ;AAA/I,qJAAA,cAAc,OAAqC;AAAE,sJAAA,OAAO,OAAsC"}
@@ -1,9 +1,15 @@
1
1
  /**
2
- * snow_create_application
2
+ * snow_create_application - Create Scoped Application
3
+ *
4
+ * Creates a new scoped application in ServiceNow with optional automatic
5
+ * Update Set creation and scope switching for seamless development workflow.
6
+ *
7
+ * Applications (scoped apps) provide isolation, clear ownership, and
8
+ * easy deployment across instances.
3
9
  */
4
10
  import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
5
11
  export declare const toolDefinition: MCPToolDefinition;
6
12
  export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
7
- export declare const version = "1.0.0";
8
- export declare const author = "Snow-Flow SDK Migration";
13
+ export declare const version = "2.0.0";
14
+ export declare const author = "Snow-Flow Application Scope Enhancement";
9
15
  //# sourceMappingURL=snow_create_application.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snow_create_application.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAwB5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAWxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"snow_create_application.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBA0F5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAkMxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4CAA4C,CAAC"}
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  /**
3
- * snow_create_application
3
+ * snow_create_application - Create Scoped Application
4
+ *
5
+ * Creates a new scoped application in ServiceNow with optional automatic
6
+ * Update Set creation and scope switching for seamless development workflow.
7
+ *
8
+ * Applications (scoped apps) provide isolation, clear ownership, and
9
+ * easy deployment across instances.
4
10
  */
5
11
  Object.defineProperty(exports, "__esModule", { value: true });
6
12
  exports.author = exports.version = exports.toolDefinition = void 0;
@@ -9,13 +15,33 @@ const auth_js_1 = require("../../shared/auth.js");
9
15
  const error_handler_js_1 = require("../../shared/error-handler.js");
10
16
  exports.toolDefinition = {
11
17
  name: 'snow_create_application',
12
- description: 'Create scoped application',
18
+ description: `Create a scoped application in ServiceNow with optional automatic Update Set and scope switching.
19
+
20
+ 📦 WHEN TO CREATE AN APPLICATION:
21
+
22
+ ✅ CREATE APPLICATION when:
23
+ - Building a complete feature set (e.g., HR Portal, Customer Onboarding)
24
+ - Creating functionality that needs to be deployed as a single unit
25
+ - Building integrations with external systems
26
+ - Developing for multiple ServiceNow instances
27
+ - Need clear ownership, versioning, and dependency management
28
+
29
+ ❌ USE GLOBAL SCOPE when:
30
+ - Making small fixes or patches
31
+ - Creating shared utilities used across applications
32
+ - Quick prototypes or POCs
33
+ - Cross-application functionality
34
+
35
+ 🔄 WORKFLOW INTEGRATION:
36
+ - auto_create_update_set=true (default): Creates Update Set in new app scope
37
+ - auto_switch_scope=true (default): Switches to new app scope for development
38
+ - All subsequent artifacts will be tracked in the new application scope`,
13
39
  // Metadata for tool discovery (not sent to LLM)
14
40
  category: 'development',
15
41
  subcategory: 'applications',
16
- use_cases: ['app-development', 'scoped-apps', 'development'],
42
+ use_cases: ['app-development', 'scoped-apps', 'development', 'deployment'],
17
43
  complexity: 'advanced',
18
- frequency: 'low',
44
+ frequency: 'medium',
19
45
  // Permission enforcement
20
46
  // Classification: WRITE - Create operation - modifies data
21
47
  permission: 'write',
@@ -23,28 +49,228 @@ exports.toolDefinition = {
23
49
  inputSchema: {
24
50
  type: 'object',
25
51
  properties: {
26
- name: { type: 'string', description: 'Application name' },
27
- scope: { type: 'string', description: 'Application scope' },
28
- version: { type: 'string', description: 'Version', default: '1.0.0' },
29
- short_description: { type: 'string', description: 'Description' }
52
+ name: {
53
+ type: 'string',
54
+ description: 'Application name (e.g., "HR Self-Service Portal")'
55
+ },
56
+ scope: {
57
+ type: 'string',
58
+ description: 'Application scope prefix (e.g., "x_myco_hr_portal"). Must start with "x_" followed by vendor prefix and app name. Use lowercase with underscores.'
59
+ },
60
+ version: {
61
+ type: 'string',
62
+ description: 'Application version (default: "1.0.0")',
63
+ default: '1.0.0'
64
+ },
65
+ short_description: {
66
+ type: 'string',
67
+ description: 'Brief description of the application purpose'
68
+ },
69
+ vendor: {
70
+ type: 'string',
71
+ description: 'Vendor/company name (e.g., "My Company")'
72
+ },
73
+ vendor_prefix: {
74
+ type: 'string',
75
+ description: 'Vendor prefix for scope (e.g., "myco"). Used in scope: x_<vendor_prefix>_<app>'
76
+ },
77
+ auto_create_update_set: {
78
+ type: 'boolean',
79
+ description: 'Automatically create an Update Set for this application (default: true). The Update Set will be scoped to this application for proper change tracking.',
80
+ default: true
81
+ },
82
+ auto_switch_scope: {
83
+ type: 'boolean',
84
+ description: 'Automatically switch to this application scope after creation (default: true). Enables immediate development within the new application.',
85
+ default: true
86
+ },
87
+ update_set_name: {
88
+ type: 'string',
89
+ description: 'Custom name for the auto-created Update Set. If not provided, defaults to "Initial Setup: <app_name>"'
90
+ },
91
+ runtime_access_tracking: {
92
+ type: 'string',
93
+ description: 'Runtime access tracking level',
94
+ enum: ['none', 'tracking', 'enforcing'],
95
+ default: 'tracking'
96
+ },
97
+ licensable: {
98
+ type: 'boolean',
99
+ description: 'Whether the application is licensable',
100
+ default: false
101
+ }
30
102
  },
31
103
  required: ['name', 'scope']
32
104
  }
33
105
  };
34
106
  async function execute(args, context) {
35
- const { name, scope, version = '1.0.0', short_description } = args;
107
+ const { name, scope, version = '1.0.0', short_description, vendor, vendor_prefix, auto_create_update_set = true, auto_switch_scope = true, update_set_name, runtime_access_tracking = 'tracking', licensable = false } = args;
36
108
  try {
37
109
  const client = await (0, auth_js_1.getAuthenticatedClient)(context);
38
- const appData = { name, scope, version };
110
+ // Validate scope format
111
+ if (!scope.startsWith('x_')) {
112
+ return (0, error_handler_js_1.createErrorResult)(`Invalid scope format: "${scope}". Scope must start with "x_" (e.g., "x_myco_hr_portal"). The format is: x_<vendor_prefix>_<app_name>`);
113
+ }
114
+ // Check if application already exists
115
+ const existingApp = await client.get('/api/now/table/sys_app', {
116
+ params: {
117
+ sysparm_query: `scope=${scope}`,
118
+ sysparm_fields: 'sys_id,name,scope',
119
+ sysparm_limit: 1
120
+ }
121
+ });
122
+ if (existingApp.data.result && existingApp.data.result.length > 0) {
123
+ return (0, error_handler_js_1.createErrorResult)(`Application with scope "${scope}" already exists: "${existingApp.data.result[0].name}" (sys_id: ${existingApp.data.result[0].sys_id})`);
124
+ }
125
+ // Build application data
126
+ const appData = {
127
+ name,
128
+ scope,
129
+ version,
130
+ active: true,
131
+ runtime_access_tracking,
132
+ licensable
133
+ };
39
134
  if (short_description)
40
135
  appData.short_description = short_description;
136
+ if (vendor)
137
+ appData.vendor = vendor;
138
+ if (vendor_prefix)
139
+ appData.vendor_prefix = vendor_prefix;
140
+ // Create the application
41
141
  const response = await client.post('/api/now/table/sys_app', appData);
42
- return (0, error_handler_js_1.createSuccessResult)({ created: true, application: response.data.result });
142
+ const application = response.data.result;
143
+ // Result object to build up
144
+ const result = {
145
+ created: true,
146
+ application: {
147
+ sys_id: application.sys_id,
148
+ name: application.name,
149
+ scope: application.scope,
150
+ version: application.version,
151
+ short_description: application.short_description || null,
152
+ vendor: application.vendor || null,
153
+ vendor_prefix: application.vendor_prefix || null
154
+ },
155
+ update_set: null,
156
+ scope_switched: false,
157
+ next_steps: []
158
+ };
159
+ // Auto-create Update Set if requested
160
+ if (auto_create_update_set) {
161
+ try {
162
+ const usName = update_set_name || `Initial Setup: ${name}`;
163
+ const usDescription = `Development Update Set for ${name} (${scope})`;
164
+ const updateSetResponse = await client.post('/api/now/table/sys_update_set', {
165
+ name: usName,
166
+ description: usDescription,
167
+ state: 'in progress',
168
+ application: application.sys_id
169
+ });
170
+ const updateSet = updateSetResponse.data.result;
171
+ result.update_set = {
172
+ sys_id: updateSet.sys_id,
173
+ name: updateSet.name,
174
+ description: updateSet.description,
175
+ state: 'in progress',
176
+ application_scope: scope
177
+ };
178
+ // Set as current Update Set for the service account
179
+ if (auto_switch_scope) {
180
+ try {
181
+ // Check if preference exists
182
+ const existingPref = await client.get('/api/now/table/sys_user_preference', {
183
+ params: {
184
+ sysparm_query: 'name=sys_update_set^user=javascript:gs.getUserID()',
185
+ sysparm_limit: 1
186
+ }
187
+ });
188
+ if (existingPref.data.result && existingPref.data.result.length > 0) {
189
+ await client.patch(`/api/now/table/sys_user_preference/${existingPref.data.result[0].sys_id}`, { value: updateSet.sys_id });
190
+ }
191
+ else {
192
+ await client.post('/api/now/table/sys_user_preference', {
193
+ name: 'sys_update_set',
194
+ value: updateSet.sys_id,
195
+ user: 'javascript:gs.getUserID()'
196
+ });
197
+ }
198
+ result.update_set.is_current = true;
199
+ }
200
+ catch (switchError) {
201
+ result.update_set.is_current = false;
202
+ result.update_set.switch_error = switchError.message;
203
+ }
204
+ }
205
+ }
206
+ catch (usError) {
207
+ result.update_set = {
208
+ created: false,
209
+ error: usError.message
210
+ };
211
+ result.next_steps.push(`Manually create Update Set for scope "${scope}"`);
212
+ }
213
+ }
214
+ else {
215
+ result.next_steps.push(`Create Update Set for scope "${scope}" before making changes`);
216
+ }
217
+ // Auto-switch scope if requested (set application scope preference)
218
+ if (auto_switch_scope) {
219
+ try {
220
+ // Set the sys_scope user preference to the new application
221
+ const scopePrefResponse = await client.get('/api/now/table/sys_user_preference', {
222
+ params: {
223
+ sysparm_query: 'name=sys_scope^user=javascript:gs.getUserID()',
224
+ sysparm_limit: 1
225
+ }
226
+ });
227
+ if (scopePrefResponse.data.result && scopePrefResponse.data.result.length > 0) {
228
+ await client.patch(`/api/now/table/sys_user_preference/${scopePrefResponse.data.result[0].sys_id}`, { value: application.sys_id });
229
+ }
230
+ else {
231
+ await client.post('/api/now/table/sys_user_preference', {
232
+ name: 'sys_scope',
233
+ value: application.sys_id,
234
+ user: 'javascript:gs.getUserID()'
235
+ });
236
+ }
237
+ result.scope_switched = true;
238
+ result.current_scope = {
239
+ sys_id: application.sys_id,
240
+ name: application.name,
241
+ scope: application.scope
242
+ };
243
+ }
244
+ catch (scopeError) {
245
+ result.scope_switched = false;
246
+ result.scope_switch_error = scopeError.message;
247
+ result.next_steps.push(`Manually switch to scope "${scope}" using snow_switch_application_scope`);
248
+ }
249
+ }
250
+ else {
251
+ result.next_steps.push(`Switch to scope "${scope}" using snow_switch_application_scope before developing`);
252
+ }
253
+ // Add helpful next steps
254
+ if (result.scope_switched && result.update_set?.is_current) {
255
+ result.next_steps.push(`Ready to develop! All changes will be tracked in scope "${scope}"`);
256
+ }
257
+ result.next_steps.push(`Create widgets, business rules, and other artifacts for your application`);
258
+ result.next_steps.push(`When done, complete the Update Set and export for deployment`);
259
+ // Build success message
260
+ let message = `Application "${name}" created successfully with scope "${scope}"`;
261
+ if (result.update_set?.sys_id) {
262
+ message += `. Update Set "${result.update_set.name}" created and activated.`;
263
+ }
264
+ if (result.scope_switched) {
265
+ message += ` Scope switched to ${scope}.`;
266
+ }
267
+ result.message = message;
268
+ return (0, error_handler_js_1.createSuccessResult)(result);
43
269
  }
44
270
  catch (error) {
45
271
  return (0, error_handler_js_1.createErrorResult)(error.message);
46
272
  }
47
273
  }
48
- exports.version = '1.0.0';
49
- exports.author = 'Snow-Flow SDK Migration';
274
+ exports.version = '2.0.0';
275
+ exports.author = 'Snow-Flow Application Scope Enhancement';
50
276
  //# sourceMappingURL=snow_create_application.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snow_create_application.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.ts"],"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CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QACrE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;QACtE,OAAO,IAAA,sCAAmB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACnF,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,IAAA,oCAAiB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAEY,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,MAAM,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"snow_create_application.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAkGH,0BAkMC;AAjSD,kDAA8D;AAC9D,oEAAuF;AAE1E,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;wEAoByD;IACtE,gDAAgD;IAChD,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,CAAC,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,CAAC;IAC1E,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,QAAQ;IAEnB,yBAAyB;IACzB,2DAA2D;IAC3D,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mJAAmJ;aAC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YACpG,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,oBAAoB,KAAK,yDAAyD,CAAC,CAAC;QAC7G,CAAC;QAED,yBAAyB;QACzB,IAAI,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;YAC3D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,2DAA2D,KAAK,GAAG,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;QACnG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAEvF,wBAAwB;QACxB,IAAI,OAAO,GAAG,gBAAgB,IAAI,sCAAsC,KAAK,GAAG,CAAC;QACjF,IAAI,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;YAC9B,OAAO,IAAI,iBAAiB,MAAM,CAAC,UAAU,CAAC,IAAI,0BAA0B,CAAC;QAC/E,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,OAAO,IAAI,sBAAsB,KAAK,GAAG,CAAC;QAC5C,CAAC;QACD,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;QAEzB,OAAO,IAAA,sCAAmB,EAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,IAAA,oCAAiB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAEY,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,MAAM,GAAG,yCAAyC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * snow_switch_application_scope - Switch Application Scope
3
+ *
4
+ * Switches the current application scope for development. This determines
5
+ * which application context artifacts will be created in.
6
+ *
7
+ * In ServiceNow, application scope controls:
8
+ * - Which application artifacts belong to
9
+ * - Access control and permissions
10
+ * - Update Set tracking
11
+ * - Cross-scope access rules
12
+ */
13
+ import { MCPToolDefinition, ServiceNowContext, ToolResult } from '../../shared/types.js';
14
+ export declare const toolDefinition: MCPToolDefinition;
15
+ export declare function execute(args: any, context: ServiceNowContext): Promise<ToolResult>;
16
+ export declare const version = "1.0.0";
17
+ export declare const author = "Snow-Flow Application Scope Enhancement";
18
+ //# sourceMappingURL=snow_switch_application_scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snow_switch_application_scope.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBA8D5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAyPxF;AAED,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4CAA4C,CAAC"}