// npm package
@antv/lite-insight
A lite js library for insights retrieval.
versions
11
maintainers
51
license
MIT
first publish
2021-11-20
publisher
neoddish
tarball
1,096,419 B
AUTO-PUBLISHED·1 version indexed·latest published 2023-03-06
// publisher campaignby neoddish
7 caught packages from this accountThis is not an isolated catch. The same publisher has shipped 6 other packages that our pipeline flagged — the shape of a coordinated campaign, not a one-off. Each link below opens that sibling's analysis.
// offending code· @2.1.1· 2 files flagged
llm: benign · 0.85→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
- @2.1.1··AUTO-PUBLISHED·publisher: neoddishheuristic 75/100static flags 1llm benign (0.85) via ollamamature-packageosv-flagged:MAL-2026-4066child-process-spawn
→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
// offending code· 2 files flaggedpatterns: 1
--- package/lib/insight-node/api.js (excerpt) --- "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDataInsightsAsync = exports.getDataInsights = void 0; var tslib_1 = require("tslib"); var threads_1 = require("threads"); var insight_1 = require("../pipeline/insight"); var getDataInsights = function (sourceData, options) { var extractResult = insight_1.extractInsights(sourceData, options); if (options === null || options === void 0 ? void 0 : options.visualization) { return insight_1.generateInsightsWithVisualizationSchemas(extractResult, options); } return extractResult; }; exports.getDataInsights = getDataInsights; /** * @deprecated This function will be removed in 3.0.0 because web workers inside a package has a low compatibility with bundlers. */ var getDataInsightsAsync = function (sourceData, options) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { var insight, extractResult; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, threads_1.spawn(new threads_1.Worker('./worker'))]; case 1: insight = _a.sent(); return [4 /*yield*/, insight.extractInsights(sourceData, options)]; case 2: extractResult = _a.sent(); if (options === null || options === void 0 ? void 0 : options.visualization) { return [2 /*return*/, insight_1.generateInsightsWithVisualizationSchemas(extr --- package/lib/algorithms/change-point/bayesian.js (excerpt) --- "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bayesian = void 0; var tslib_1 = require("tslib"); var bayesian_changepoint_1 = tslib_1.__importDefault(require("bayesian-changepoint")); var pettitt_test_1 = require("./pettitt-test"); var breakpointVerifier = function (next, prev) { if (Math.abs(next.data - prev.data) >= 1) { return true; } return false; }; /** * Bayesian Online Changepoint Detection */ var Bayesian = function (series) { var detection = new bayesian_changepoint_1.default({ breakpointVerifier: breakpointVerifier, }); detection.exec(series); var result = detection.breakPoints().map(function (breakPoint) { return ({ index: breakPoint.index, significance: 1 - pettitt_test_1.calcPValue(series, breakPoint.index), }); }); return result; }; exports.Bayesian = Bayesian; --- bundled output (OSV-MAL flagged — LLM scope expansion) --- --- lib/narrative/utils/phrases-builder.js (bundled) --- "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PhrasesBuilder = exports.getTrendDesc = exports.getInsightTypeDesc = exports.removeLastSpace = void 0; var constance_1 = require("../constance"); function removeLastSpace(value) { var lastLetter = value.substr(value.length - 1); if (lastLetter === ' ') return value.substr(0, value.length - 1); return value; } exports.removeLastSpace = removeLastSpace; function getInsightTypeDesc(insightType, lang) { var INSIGHT_TYPE_MAP = { category_outlier: '类别异常', change_point: '异常点', correlation: '相关性', low_variance: '低方差', majority: '显著性', trend: '趋势', time_series_outlier: '时间序列异常', }; if (lang === 'en-US') { return insightType.replace('_', ' '); } if (lang === 'zh-CN') { return INSIGHT_TYPE_MAP[insightType]; } return ''; } exports.getInsightTypeDesc = getInsightTypeDesc; function getTrendDesc(trendType, lang) { var TREND_DESC_MAP = { decreasing: '趋势下降', increasing: '趋势上升', 'no trend': '无趋势', }; if (lang === 'en-US') { return trendType; } if (lang === 'zh-CN') { return TREND_DESC_MAP[trendType]; } return ''; } exports.getTrendDesc = getTrendDesc; var needRightSpaceSymbol = ['punctuation_right_parentheses', 'punctuation_comma', 'punctuation_stop']; var needRemoveBeforeSpace = ['punctuation_comma', 'punctuation_stop', 'punctuation_right_parentheses']; var PhrasesBuilder = /** @class */ (function () { // TODO 语言默认英文,之后再处理中文的情况 function PhrasesBuilder(lang) { if (lang === void 0) { lang = 'en-US'; } this.lang = lang; this.schema = []; this.content = ''; } PhrasesBuilder.prototype.add = function (value, type, options) { if (options === void 0) { options = { leftSpace: false, rightSpace: true }; } var _a = options.leftSpace, leftSpace = _a === void 0 ? f --- lib/narrative/strategy/low-variance.js (bundled) --- "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.lowVarianceStrategy = void 0; var phrases_builder_1 = require("../utils/phrases-builder"); /** * @template `` * @example The life_expect data points of country are very similar to the mean, that is, the variance is low. */ function lowVarianceStrategy(variableMap, lang) { var measure = variableMap.measure, dimension = variableMap.dimension; var phrases = new phrases_builder_1.PhrasesBuilder(lang); // The ${measures} data points of ${dimension} are very similar to the mean, that is, the variance is low. if (lang === 'en-US') { phrases.add('The'); phrases.add(measure, 'metric_name'); phrases.add('data points of'); phrases.add(dimension); phrases.add('are very similar to the mean'); phrases.addSymbol('punctuation_comma'); phrases.add('that is'); phrases.addSymbol('punctuation_comma'); phrases.add('the variance is low'); } // ${dimension} 的 ${measures} 数据点与均值非常相似,即方差较低。 if (lang === 'zh-CN') { phrases.add(dimension); phrases.add('的'); phrases.add(measure, 'metric_name'); phrases.add('数据点与均值非常相似'); phrases.addSymbol('punctuation_comma'); phrases.add('即方差较低'); } phrases.addSymbol('punctuation_stop'); return phrases; } exports.lowVarianceStrategy = lowVarianceStrategy; --- esm/narrative/utils/phrases-builder.js (bundled) --- import { SYMBOL } from '../constance'; export function removeLastSpace(value) { var lastLetter = value.substr(value.length - 1); if (lastLetter === ' ') return value.substr(0, value.length - 1); return value; } export function getInsightTypeDesc(insightType, lang) { var INSIGHT_TYPE_MAP = { category_outlier: '类别异常', change_point: '异常点', correlation: '相关性', low_variance: '低方差', majority: '显著性', trend: '趋势', time_series_outlier: '时间序列异常', }; if (lang === 'en-US') { return insightType.replace('_', ' '); } if (lang === 'zh-CN') { return INSIGHT_TYPE_MAP[insightType]; } return ''; } export function getTrendDesc(trendType, lang) { var TREND_DESC_MAP = { decreasing: '趋势下降', increasing: '趋势上升', 'no trend': '无趋势', }; if (lang === 'en-US') { return trendType; } if (lang === 'zh-CN') { return TREND_DESC_MAP[trendType]; } return ''; } var needRightSpaceSymbol = ['punctuation_right_parentheses', 'punctuation_comma', 'punctuation_stop']; var needRemoveBeforeSpace = ['punctuation_comma', 'punctuation_stop', 'punctuation_right_parentheses']; var PhrasesBuilder = /** @class */ (function () { // TODO 语言默认英文,之后再处理中文的情况 function PhrasesBuilder(lang) { if (lang === void 0) { lang = 'en-US'; } this.lang = lang; this.schema = []; this.content = ''; } PhrasesBuilder.prototype.add = function (value, type, options) { if (options === void 0) { options = { leftSpace: false, rightSpace: true }; } var _a = options.leftSpace, leftSpace = _a === void 0 ? false : _a, _b = options.rightSpace, rightSpace = _b === void 0 ? false : _b; var newValue = this.lang === 'en-US' ? "" + (leftSpace ? ' ' : '') + value + (rightSpace ? ' ' : '') : value; if (type) { if (leftSpace) { this.schema.push({ t --- esm/narrative/strategy/low-variance.js (bundled) --- import { PhrasesBuilder } from '../utils/phrases-builder'; /** * @template `` * @example The life_expect data points of country are very similar to the mean, that is, the variance is low. */ export function lowVarianceStrategy(variableMap, lang) { var measure = variableMap.measure, dimension = variableMap.dimension; var phrases = new PhrasesBuilder(lang); // The ${measures} data points of ${dimension} are very similar to the mean, that is, the variance is low. if (lang === 'en-US') { phrases.add('The'); phrases.add(measure, 'metric_name'); phrases.add('data points of'); phrases.add(dimension); phrases.add('are very similar to the mean'); phrases.addSymbol('punctuation_comma'); phrases.add('that is'); phrases.addSymbol('punctuation_comma'); phrases.add('the variance is low'); } // ${dimension} 的 ${measures} 数据点与均值非常相似,即方差较低。 if (lang === 'zh-CN') { phrases.add(dimension); phrases.add('的'); phrases.add(measure, 'metric_name'); phrases.add('数据点与均值非常相似'); phrases.addSymbol('punctuation_comma'); phrases.add('即方差较低'); } phrases.addSymbol('punctuation_stop'); return phrases; }
