vibecop 0.1.0 → 0.1.2

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.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
@@ -9026,405 +9044,6 @@ var require_dist = __commonJS((exports) => {
9026
9044
  exports.visitAsync = visit.visitAsync;
9027
9045
  });
9028
9046
 
9029
- // node_modules/@ast-grep/napi-darwin-arm64/ast-grep-napi.darwin-arm64.node
9030
- var require_ast_grep_napi_darwin_arm64 = __commonJS((exports, module) => {
9031
- module.exports = __require("./ast-grep-napi.darwin-arm64-q04mnpgp.node");
9032
- });
9033
-
9034
- // node_modules/@ast-grep/napi/index.js
9035
- var require_napi = __commonJS((exports, module) => {
9036
- var __filename = "/Users/bhavyabhushan/work/personal/aiqt/node_modules/@ast-grep/napi/index.js";
9037
- var { createRequire: createRequire2 } = __require("node:module");
9038
- __require = createRequire2(__filename);
9039
- var { readFileSync: readFileSync3 } = __require("node:fs");
9040
- var nativeBinding = null;
9041
- var loadErrors = [];
9042
- var isMusl = () => {
9043
- let musl = false;
9044
- if (process.platform === "linux") {
9045
- musl = isMuslFromFilesystem();
9046
- if (musl === null) {
9047
- musl = isMuslFromReport();
9048
- }
9049
- if (musl === null) {
9050
- musl = isMuslFromChildProcess();
9051
- }
9052
- }
9053
- return musl;
9054
- };
9055
- var isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
9056
- var isMuslFromFilesystem = () => {
9057
- try {
9058
- return readFileSync3("/usr/bin/ldd", "utf-8").includes("musl");
9059
- } catch {
9060
- return null;
9061
- }
9062
- };
9063
- var isMuslFromReport = () => {
9064
- let report = null;
9065
- if (typeof process.report?.getReport === "function") {
9066
- process.report.excludeNetwork = true;
9067
- report = process.report.getReport();
9068
- }
9069
- if (!report) {
9070
- return null;
9071
- }
9072
- if (report.header && report.header.glibcVersionRuntime) {
9073
- return false;
9074
- }
9075
- if (Array.isArray(report.sharedObjects)) {
9076
- if (report.sharedObjects.some(isFileMusl)) {
9077
- return true;
9078
- }
9079
- }
9080
- return false;
9081
- };
9082
- var isMuslFromChildProcess = () => {
9083
- try {
9084
- return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
9085
- } catch (e) {
9086
- return false;
9087
- }
9088
- };
9089
- function requireNative() {
9090
- if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
9091
- try {
9092
- nativeBinding = __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
9093
- } catch (err) {
9094
- loadErrors.push(err);
9095
- }
9096
- } else if (process.platform === "android") {
9097
- if (process.arch === "arm64") {
9098
- try {
9099
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.android-arm64.node");})();
9100
- } catch (e) {
9101
- loadErrors.push(e);
9102
- }
9103
- try {
9104
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-android-arm64");})();
9105
- } catch (e) {
9106
- loadErrors.push(e);
9107
- }
9108
- } else if (process.arch === "arm") {
9109
- try {
9110
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.android-arm-eabi.node");})();
9111
- } catch (e) {
9112
- loadErrors.push(e);
9113
- }
9114
- try {
9115
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-android-arm-eabi");})();
9116
- } catch (e) {
9117
- loadErrors.push(e);
9118
- }
9119
- } else {
9120
- loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
9121
- }
9122
- } else if (process.platform === "win32") {
9123
- if (process.arch === "x64") {
9124
- try {
9125
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.win32-x64-msvc.node");})();
9126
- } catch (e) {
9127
- loadErrors.push(e);
9128
- }
9129
- try {
9130
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-win32-x64-msvc");})();
9131
- } catch (e) {
9132
- loadErrors.push(e);
9133
- }
9134
- } else if (process.arch === "ia32") {
9135
- try {
9136
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.win32-ia32-msvc.node");})();
9137
- } catch (e) {
9138
- loadErrors.push(e);
9139
- }
9140
- try {
9141
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-win32-ia32-msvc");})();
9142
- } catch (e) {
9143
- loadErrors.push(e);
9144
- }
9145
- } else if (process.arch === "arm64") {
9146
- try {
9147
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.win32-arm64-msvc.node");})();
9148
- } catch (e) {
9149
- loadErrors.push(e);
9150
- }
9151
- try {
9152
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-win32-arm64-msvc");})();
9153
- } catch (e) {
9154
- loadErrors.push(e);
9155
- }
9156
- } else {
9157
- loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
9158
- }
9159
- } else if (process.platform === "darwin") {
9160
- try {
9161
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.darwin-universal.node");})();
9162
- } catch (e) {
9163
- loadErrors.push(e);
9164
- }
9165
- try {
9166
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-darwin-universal");})();
9167
- } catch (e) {
9168
- loadErrors.push(e);
9169
- }
9170
- if (process.arch === "x64") {
9171
- try {
9172
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.darwin-x64.node");})();
9173
- } catch (e) {
9174
- loadErrors.push(e);
9175
- }
9176
- try {
9177
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-darwin-x64");})();
9178
- } catch (e) {
9179
- loadErrors.push(e);
9180
- }
9181
- } else if (process.arch === "arm64") {
9182
- try {
9183
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.darwin-arm64.node");})();
9184
- } catch (e) {
9185
- loadErrors.push(e);
9186
- }
9187
- try {
9188
- return require_ast_grep_napi_darwin_arm64();
9189
- } catch (e) {
9190
- loadErrors.push(e);
9191
- }
9192
- } else {
9193
- loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
9194
- }
9195
- } else if (process.platform === "freebsd") {
9196
- if (process.arch === "x64") {
9197
- try {
9198
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.freebsd-x64.node");})();
9199
- } catch (e) {
9200
- loadErrors.push(e);
9201
- }
9202
- try {
9203
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-freebsd-x64");})();
9204
- } catch (e) {
9205
- loadErrors.push(e);
9206
- }
9207
- } else if (process.arch === "arm64") {
9208
- try {
9209
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.freebsd-arm64.node");})();
9210
- } catch (e) {
9211
- loadErrors.push(e);
9212
- }
9213
- try {
9214
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-freebsd-arm64");})();
9215
- } catch (e) {
9216
- loadErrors.push(e);
9217
- }
9218
- } else {
9219
- loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
9220
- }
9221
- } else if (process.platform === "linux") {
9222
- if (process.arch === "x64") {
9223
- if (isMusl()) {
9224
- try {
9225
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-x64-musl.node");})();
9226
- } catch (e) {
9227
- loadErrors.push(e);
9228
- }
9229
- try {
9230
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-x64-musl");})();
9231
- } catch (e) {
9232
- loadErrors.push(e);
9233
- }
9234
- } else {
9235
- try {
9236
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-x64-gnu.node");})();
9237
- } catch (e) {
9238
- loadErrors.push(e);
9239
- }
9240
- try {
9241
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-x64-gnu");})();
9242
- } catch (e) {
9243
- loadErrors.push(e);
9244
- }
9245
- }
9246
- } else if (process.arch === "arm64") {
9247
- if (isMusl()) {
9248
- try {
9249
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-arm64-musl.node");})();
9250
- } catch (e) {
9251
- loadErrors.push(e);
9252
- }
9253
- try {
9254
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-arm64-musl");})();
9255
- } catch (e) {
9256
- loadErrors.push(e);
9257
- }
9258
- } else {
9259
- try {
9260
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-arm64-gnu.node");})();
9261
- } catch (e) {
9262
- loadErrors.push(e);
9263
- }
9264
- try {
9265
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-arm64-gnu");})();
9266
- } catch (e) {
9267
- loadErrors.push(e);
9268
- }
9269
- }
9270
- } else if (process.arch === "arm") {
9271
- if (isMusl()) {
9272
- try {
9273
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-arm-musleabihf.node");})();
9274
- } catch (e) {
9275
- loadErrors.push(e);
9276
- }
9277
- try {
9278
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-arm-musleabihf");})();
9279
- } catch (e) {
9280
- loadErrors.push(e);
9281
- }
9282
- } else {
9283
- try {
9284
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-arm-gnueabihf.node");})();
9285
- } catch (e) {
9286
- loadErrors.push(e);
9287
- }
9288
- try {
9289
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-arm-gnueabihf");})();
9290
- } catch (e) {
9291
- loadErrors.push(e);
9292
- }
9293
- }
9294
- } else if (process.arch === "riscv64") {
9295
- if (isMusl()) {
9296
- try {
9297
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-riscv64-musl.node");})();
9298
- } catch (e) {
9299
- loadErrors.push(e);
9300
- }
9301
- try {
9302
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-riscv64-musl");})();
9303
- } catch (e) {
9304
- loadErrors.push(e);
9305
- }
9306
- } else {
9307
- try {
9308
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-riscv64-gnu.node");})();
9309
- } catch (e) {
9310
- loadErrors.push(e);
9311
- }
9312
- try {
9313
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-riscv64-gnu");})();
9314
- } catch (e) {
9315
- loadErrors.push(e);
9316
- }
9317
- }
9318
- } else if (process.arch === "ppc64") {
9319
- try {
9320
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-ppc64-gnu.node");})();
9321
- } catch (e) {
9322
- loadErrors.push(e);
9323
- }
9324
- try {
9325
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-ppc64-gnu");})();
9326
- } catch (e) {
9327
- loadErrors.push(e);
9328
- }
9329
- } else if (process.arch === "s390x") {
9330
- try {
9331
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-s390x-gnu.node");})();
9332
- } catch (e) {
9333
- loadErrors.push(e);
9334
- }
9335
- try {
9336
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-s390x-gnu");})();
9337
- } catch (e) {
9338
- loadErrors.push(e);
9339
- }
9340
- } else {
9341
- loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
9342
- }
9343
- } else if (process.platform === "openharmony") {
9344
- if (process.arch === "arm64") {
9345
- try {
9346
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-arm64-ohos.node");})();
9347
- } catch (e) {
9348
- loadErrors.push(e);
9349
- }
9350
- try {
9351
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-arm64-ohos");})();
9352
- } catch (e) {
9353
- loadErrors.push(e);
9354
- }
9355
- } else if (process.arch === "x64") {
9356
- try {
9357
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-x64-ohos.node");})();
9358
- } catch (e) {
9359
- loadErrors.push(e);
9360
- }
9361
- try {
9362
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-x64-ohos");})();
9363
- } catch (e) {
9364
- loadErrors.push(e);
9365
- }
9366
- } else if (process.arch === "arm") {
9367
- try {
9368
- return (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.linux-arm-ohos.node");})();
9369
- } catch (e) {
9370
- loadErrors.push(e);
9371
- }
9372
- try {
9373
- return (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-linux-arm-ohos");})();
9374
- } catch (e) {
9375
- loadErrors.push(e);
9376
- }
9377
- } else {
9378
- loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
9379
- }
9380
- } else {
9381
- loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
9382
- }
9383
- }
9384
- nativeBinding = requireNative();
9385
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
9386
- try {
9387
- nativeBinding = (()=>{throw new Error("Cannot require module "+"./ast-grep-napi.wasi.cjs");})();
9388
- } catch (err) {
9389
- if (process.env.NAPI_RS_FORCE_WASI) {
9390
- loadErrors.push(err);
9391
- }
9392
- }
9393
- if (!nativeBinding) {
9394
- try {
9395
- nativeBinding = (()=>{throw new Error("Cannot require module "+"@ast-grep/napi-wasm32-wasi");})();
9396
- } catch (err) {
9397
- if (process.env.NAPI_RS_FORCE_WASI) {
9398
- loadErrors.push(err);
9399
- }
9400
- }
9401
- }
9402
- }
9403
- if (!nativeBinding) {
9404
- if (loadErrors.length > 0) {
9405
- throw new Error(`Cannot find native binding. ` + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + "Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors });
9406
- }
9407
- throw new Error(`Failed to load native binding`);
9408
- }
9409
- module.exports = nativeBinding;
9410
- module.exports.SgNode = nativeBinding.SgNode;
9411
- module.exports.SgRoot = nativeBinding.SgRoot;
9412
- module.exports.findInFiles = nativeBinding.findInFiles;
9413
- module.exports.kind = nativeBinding.kind;
9414
- module.exports.Lang = nativeBinding.Lang;
9415
- module.exports.parse = nativeBinding.parse;
9416
- module.exports.parseAsync = nativeBinding.parseAsync;
9417
- module.exports.parseFiles = nativeBinding.parseFiles;
9418
- module.exports.pattern = nativeBinding.pattern;
9419
- module.exports.registerDynamicLanguage = nativeBinding.registerDynamicLanguage;
9420
- module.exports.css = nativeBinding.css;
9421
- module.exports.html = nativeBinding.html;
9422
- module.exports.js = nativeBinding.js;
9423
- module.exports.jsx = nativeBinding.jsx;
9424
- module.exports.ts = nativeBinding.ts;
9425
- module.exports.tsx = nativeBinding.tsx;
9426
- });
9427
-
9428
9047
  // src/cli.ts
9429
9048
  import { execSync } from "node:child_process";
9430
9049
  import { existsSync as existsSync4, readFileSync as readFileSync5 } from "node:fs";
@@ -16833,10 +16452,10 @@ var builtinDetectors = [
16833
16452
  ];
16834
16453
 
16835
16454
  // src/engine.ts
16836
- var import_napi = __toESM(require_napi(), 1);
16837
16455
  import { existsSync as existsSync2, readdirSync as readdirSync2, readFileSync as readFileSync3, statSync } from "node:fs";
16838
16456
  import { createRequire as createRequire2 } from "node:module";
16839
16457
  import { extname, join as join2, relative, resolve as resolve2 } from "node:path";
16458
+ import { parse, Lang as SgLang, registerDynamicLanguage } from "@ast-grep/napi";
16840
16459
  var EXTENSION_MAP = {
16841
16460
  ".js": "javascript",
16842
16461
  ".jsx": "javascript",
@@ -16847,9 +16466,9 @@ var EXTENSION_MAP = {
16847
16466
  ".py": "python"
16848
16467
  };
16849
16468
  var LANG_MAP = {
16850
- javascript: import_napi.Lang.JavaScript,
16851
- typescript: import_napi.Lang.TypeScript,
16852
- tsx: import_napi.Lang.Tsx,
16469
+ javascript: SgLang.JavaScript,
16470
+ typescript: SgLang.TypeScript,
16471
+ tsx: SgLang.Tsx,
16853
16472
  python: "python"
16854
16473
  };
16855
16474
  var pythonRegistered = false;
@@ -16859,7 +16478,7 @@ function ensurePythonRegistered() {
16859
16478
  try {
16860
16479
  const req = createRequire2(import.meta.url);
16861
16480
  const pythonLang = req("@ast-grep/lang-python");
16862
- import_napi.registerDynamicLanguage({ python: pythonLang });
16481
+ registerDynamicLanguage({ python: pythonLang });
16863
16482
  pythonRegistered = true;
16864
16483
  } catch {}
16865
16484
  }
@@ -16946,7 +16565,7 @@ function runDetectors(files, detectors, project, config, options = {}) {
16946
16565
  let root;
16947
16566
  try {
16948
16567
  const sgLang = LANG_MAP[file.language];
16949
- root = import_napi.parse(sgLang, source);
16568
+ root = parse(sgLang, source);
16950
16569
  } catch (err) {
16951
16570
  errors2.push({
16952
16571
  file: file.path,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "vibecop",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "AI code quality toolkit — deterministic linter for the AI coding era",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "vibecop": "./dist/cli.js"
8
8
  },
9
9
  "scripts": {
10
- "build": "bun build src/cli.ts --outdir dist --target node",
10
+ "build": "bun build src/cli.ts --outdir dist --target node --external @ast-grep/napi --external @ast-grep/lang-python",
11
11
  "build:action": "npx ncc build src/action/main.ts -o dist/action --source-map --license licenses.txt",
12
12
  "test": "bun test",
13
13
  "lint": "bunx biome check",
@@ -15,7 +15,7 @@
15
15
  "prepublishOnly": "bun run lint && bun run typecheck && bun test && bun run build"
16
16
  },
17
17
  "files": [
18
- "dist",
18
+ "dist/cli.js",
19
19
  "README.md",
20
20
  "LICENSE"
21
21
  ],
@@ -50,8 +50,6 @@
50
50
  "node": ">=20"
51
51
  },
52
52
  "dependencies": {
53
- "@actions/core": "^3.0.0",
54
- "@actions/github": "^9.0.0",
55
53
  "@ast-grep/lang-python": "^0.0.6",
56
54
  "@ast-grep/napi": "^0.42.0",
57
55
  "commander": "^13.1.0",
@@ -59,6 +57,8 @@
59
57
  "zod": "^3.24.4"
60
58
  },
61
59
  "devDependencies": {
60
+ "@actions/core": "^3.0.0",
61
+ "@actions/github": "^9.0.0",
62
62
  "@types/node": "^22.14.0",
63
63
  "@types/sarif": "^2.1.7",
64
64
  "@vercel/ncc": "^0.38.4",