@atlaskit/ads-mcp 0.19.4 → 0.20.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 (59) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/helpers/analytics.js +17 -16
  3. package/dist/cjs/helpers/compute-multi-term-fuse-allocation.js +21 -0
  4. package/dist/cjs/helpers/config-path.js +13 -0
  5. package/dist/cjs/helpers/fuse-multi-term.js +8 -23
  6. package/dist/cjs/helpers/staff-id.js +9 -0
  7. package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
  8. package/dist/cjs/tools/migration-guides/index.js +2 -1
  9. package/dist/cjs/tools/migration-guides/migration-registry.js +10 -0
  10. package/dist/cjs/tools/migration-guides/registry.js +10 -8
  11. package/dist/es2019/helpers/analytics.js +7 -13
  12. package/dist/es2019/helpers/compute-multi-term-fuse-allocation.js +15 -0
  13. package/dist/es2019/helpers/config-path.js +7 -0
  14. package/dist/es2019/helpers/fuse-multi-term.js +3 -22
  15. package/dist/es2019/helpers/staff-id.js +4 -0
  16. package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
  17. package/dist/es2019/tools/migration-guides/index.js +2 -1
  18. package/dist/es2019/tools/migration-guides/migration-registry.js +7 -0
  19. package/dist/es2019/tools/migration-guides/registry.js +3 -9
  20. package/dist/esm/helpers/analytics.js +7 -13
  21. package/dist/esm/helpers/compute-multi-term-fuse-allocation.js +15 -0
  22. package/dist/esm/helpers/config-path.js +7 -0
  23. package/dist/esm/helpers/fuse-multi-term.js +3 -22
  24. package/dist/esm/helpers/staff-id.js +4 -0
  25. package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
  26. package/dist/esm/tools/migration-guides/index.js +2 -1
  27. package/dist/esm/tools/migration-guides/migration-registry.js +3 -0
  28. package/dist/esm/tools/migration-guides/registry.js +3 -5
  29. package/dist/types/helpers/analytics.d.ts +2 -9
  30. package/dist/types/helpers/compute-multi-term-fuse-allocation.d.ts +14 -0
  31. package/dist/types/helpers/config-path.d.ts +7 -0
  32. package/dist/types/helpers/fuse-multi-term.d.ts +1 -20
  33. package/dist/types/helpers/staff-id.d.ts +1 -0
  34. package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
  35. package/dist/types/tools/migration-guides/migration-registry.d.ts +2 -0
  36. package/dist/types/tools/migration-guides/registry.d.ts +1 -2
  37. package/dist/types-ts4.5/helpers/analytics.d.ts +2 -9
  38. package/dist/types-ts4.5/helpers/compute-multi-term-fuse-allocation.d.ts +14 -0
  39. package/dist/types-ts4.5/helpers/config-path.d.ts +7 -0
  40. package/dist/types-ts4.5/helpers/fuse-multi-term.d.ts +1 -20
  41. package/dist/types-ts4.5/helpers/staff-id.d.ts +1 -0
  42. package/dist/types-ts4.5/tools/get-all-components/components.codegen.d.ts +1 -1
  43. package/dist/types-ts4.5/tools/migration-guides/migration-registry.d.ts +2 -0
  44. package/dist/types-ts4.5/tools/migration-guides/registry.d.ts +1 -2
  45. package/package.json +4 -4
  46. package/tools/analyze-a11y/package.json +14 -0
  47. package/tools/get-a11y-guidelines/package.json +14 -0
  48. package/tools/get-all-components/package.json +14 -0
  49. package/tools/get-all-icons/package.json +14 -0
  50. package/tools/get-all-tokens/package.json +14 -0
  51. package/tools/get-guidelines/package.json +14 -0
  52. package/tools/get-lint-rules/package.json +14 -0
  53. package/tools/i18n-conversion/package.json +14 -0
  54. package/tools/migration-guides/package.json +14 -0
  55. package/tools/plan/package.json +14 -0
  56. package/tools/search-components/package.json +14 -0
  57. package/tools/search-icons/package.json +14 -0
  58. package/tools/search-tokens/package.json +14 -0
  59. package/tools/suggest-a11y-fixes/package.json +14 -0
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
  import { zodToJsonSchema } from '../../helpers';
5
- import { getAvailableMigrationIds, getAvailableMigrationsDescription, migrationRegistry } from './registry';
5
+ import { migrationRegistry } from './migration-registry';
6
+ import { getAvailableMigrationIds, getAvailableMigrationsDescription } from './registry';
6
7
 
7
8
  // Build the enum dynamically from the registry
8
9
  const migrationIds = getAvailableMigrationIds();
@@ -0,0 +1,7 @@
1
+ import { onboardingJiraSpotlight, onboardingMultiStep, onboardingSingleStep, onboardingWithMotion } from './migrations/onboarding-to-spotlight';
2
+ export const migrationRegistry = {
3
+ [onboardingJiraSpotlight.id]: onboardingJiraSpotlight,
4
+ [onboardingSingleStep.id]: onboardingSingleStep,
5
+ [onboardingMultiStep.id]: onboardingMultiStep,
6
+ [onboardingWithMotion.id]: onboardingWithMotion
7
+ };
@@ -7,14 +7,7 @@
7
7
  * 3. The tool will automatically include it in the available options
8
8
  */
9
9
 
10
- import { onboardingJiraSpotlight, onboardingMultiStep, onboardingSingleStep, onboardingWithMotion } from './migrations/onboarding-to-spotlight';
11
- export const migrationRegistry = {
12
- [onboardingJiraSpotlight.id]: onboardingJiraSpotlight,
13
- [onboardingSingleStep.id]: onboardingSingleStep,
14
- [onboardingMultiStep.id]: onboardingMultiStep,
15
- [onboardingWithMotion.id]: onboardingWithMotion
16
- };
17
-
10
+ import { migrationRegistry } from './migration-registry';
18
11
  /**
19
12
  * Get all available migration IDs for use in the tool schema
20
13
  */
@@ -28,4 +21,5 @@ export const getAvailableMigrationIds = () => {
28
21
  */
29
22
  export const getAvailableMigrationsDescription = () => {
30
23
  return Object.values(migrationRegistry).map(m => `- "${m.id}": ${m.description}`);
31
- };
24
+ };
25
+ export { migrationRegistry } from './migration-registry';
@@ -2,14 +2,14 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  /* eslint-disable no-console */
5
- import { userInfo } from 'node:os';
5
+
6
+ import { configPath } from './config-path';
7
+ import { staffId } from './staff-id';
8
+
6
9
  // eslint-disable-next-line import/no-extraneous-dependencies -- this uses require because not all node versions this package supports use the same import assertions/attributes
7
10
  var pkgJson = require('@atlaskit/ads-mcp/package.json');
8
11
  var version = pkgJson.version || '0.0.0-unknown';
9
12
 
10
- // Get staff ID using the same logic as @repo-feature-flags-statsig
11
- export var staffId = process.env.STAFF_ID || process.env.USER || process.env.ATLAS_USER || userInfo().username;
12
-
13
13
  /**
14
14
  * This is a user-passed value via environment to define what agent we may be running in.
15
15
  * This could be anything, do not rely on it!
@@ -18,14 +18,6 @@ export var staffId = process.env.STAFF_ID || process.env.USER || process.env.ATL
18
18
 
19
19
  export var agent = process.env.ADSMCP_AGENT || 'unknown';
20
20
 
21
- /**
22
- * The path to the MCP config file that is being used to run the MCP server
23
- * e.g. 'mcp.json', 'jira/.cursor/mcp.json', 'platform/.vscode/mcp.json' or 'unknown'
24
- * This could be anything, do not rely on it!
25
- * @default `'unknown'`
26
- */
27
- export var configPath = process.env.ADSMCP_CONFIG_PATH || 'unknown';
28
-
29
21
  // Check if user has opted out of analytics
30
22
  var isAnalyticsOptedOut = String(process.env.ADSMCP_ANALYTICS_OPT_OUT) === 'true' || String(process.env.ADSMCP_ANALYTICS_OPT_OUT) === '1';
31
23
 
@@ -87,4 +79,6 @@ export function sendOperationalEvent(_ref) {
87
79
  // Silently fail to avoid disrupting the main functionality
88
80
  console.error('Error sending operational event to analytics');
89
81
  }
90
- }
82
+ }
83
+ export { staffId } from './staff-id';
84
+ export { configPath } from './config-path';
@@ -0,0 +1,15 @@
1
+ export function computeMultiTermFuseAllocation(limit, termCount) {
2
+ if (termCount <= 1) return {
3
+ perTermTake: 1,
4
+ combinedTake: 0,
5
+ totalTake: 1
6
+ };
7
+ var perTermTake = Math.max(Math.round(limit / termCount), 1);
8
+ var combinedTake = Math.max(limit * termCount - termCount * perTermTake, 1);
9
+ var totalTake = Math.max(perTermTake * termCount + combinedTake, 1);
10
+ return {
11
+ perTermTake: perTermTake,
12
+ combinedTake: combinedTake,
13
+ totalTake: totalTake
14
+ };
15
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The path to the MCP config file that is being used to run the MCP server
3
+ * e.g. 'mcp.json', 'jira/.cursor/mcp.json', 'platform/.vscode/mcp.json' or 'unknown'
4
+ * This could be anything, do not rely on it!
5
+ * @default `'unknown'`
6
+ */
7
+ export var configPath = process.env.ADSMCP_CONFIG_PATH || 'unknown';
@@ -2,27 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
3
3
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
4
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
- /**
6
- * Allocation for multi-query Fuse search: each term alone, plus one spaced combined query.
7
- *
8
- * `poolMax = limit * termCount`. From each term we take up to `perTermTake` hits; the rest of the
9
- * pool is filled from the spaced combined query.
10
- */
11
- export function computeMultiTermFuseAllocation(limit, termCount) {
12
- if (termCount <= 1) return {
13
- perTermTake: 1,
14
- combinedTake: 0,
15
- totalTake: 1
16
- };
17
- var perTermTake = Math.max(Math.round(limit / termCount), 1);
18
- var combinedTake = Math.max(limit * termCount - termCount * perTermTake, 1);
19
- var totalTake = Math.max(perTermTake * termCount + combinedTake, 1);
20
- return {
21
- perTermTake: perTermTake,
22
- combinedTake: combinedTake,
23
- totalTake: totalTake
24
- };
25
- }
5
+ import { computeMultiTermFuseAllocation } from './compute-multi-term-fuse-allocation';
26
6
  /**
27
7
  * Runs `search` for each term (top `perTermTake`) and for `terms.join(' ')` (top `combinedTake`),
28
8
  * merges pools, sorts globally by Fuse score, then returns the first `limit` **distinct** keys
@@ -119,4 +99,5 @@ function takeFirstUniqueKeys(sortedHits, limit) {
119
99
  _iterator2.f();
120
100
  }
121
101
  return out;
122
- }
102
+ }
103
+ export { computeMultiTermFuseAllocation } from './compute-multi-term-fuse-allocation';
@@ -0,0 +1,4 @@
1
+ import { userInfo } from 'node:os';
2
+
3
+ // Get staff ID using the same logic as @repo-feature-flags-statsig
4
+ export var staffId = process.env.STAFF_ID || process.env.USER || process.env.ATLAS_USER || userInfo().username;