shield-llm 0.1.0

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.
@@ -0,0 +1,68 @@
1
+ import { createRequire as __cjs_createRequire } from "module"; import { fileURLToPath as __cjs_fileURLToPath } from "url"; import { dirname as __cjs_dirname } from "path"; const __filename = __cjs_fileURLToPath(import.meta.url); const __dirname = __cjs_dirname(__filename); const require = __cjs_createRequire(import.meta.url);
2
+ import {
3
+ __commonJS,
4
+ require_token_error,
5
+ require_token_util
6
+ } from "./chunk-7D5WVZW5.js";
7
+
8
+ // ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
9
+ var require_token = __commonJS({
10
+ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var token_exports = {};
29
+ __export(token_exports, {
30
+ refreshToken: () => refreshToken
31
+ });
32
+ module.exports = __toCommonJS(token_exports);
33
+ var import_token_error = require_token_error();
34
+ var import_token_util = require_token_util();
35
+ async function refreshToken(options) {
36
+ let projectId = options?.project;
37
+ let teamId = options?.team;
38
+ if (!projectId && !teamId) {
39
+ const projectInfo = (0, import_token_util.findProjectInfo)();
40
+ projectId = projectInfo.projectId;
41
+ teamId = projectInfo.teamId;
42
+ } else if (!projectId || !teamId) {
43
+ const projectInfo = (0, import_token_util.findProjectInfo)();
44
+ projectId = projectId ?? projectInfo.projectId;
45
+ teamId = teamId ?? projectInfo.teamId;
46
+ }
47
+ if (!projectId) {
48
+ throw new import_token_error.VercelOidcTokenError(
49
+ "Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"
50
+ );
51
+ }
52
+ let maybeToken = (0, import_token_util.loadToken)(projectId);
53
+ if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {
54
+ const authToken = await (0, import_token_util.getVercelToken)({
55
+ expirationBufferMs: options?.expirationBufferMs
56
+ });
57
+ maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
58
+ if (!maybeToken) {
59
+ throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
60
+ }
61
+ (0, import_token_util.saveToken)(maybeToken, projectId);
62
+ }
63
+ process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
64
+ return;
65
+ }
66
+ }
67
+ });
68
+ export default require_token();
@@ -0,0 +1,5 @@
1
+ import { createRequire as __cjs_createRequire } from "module"; import { fileURLToPath as __cjs_fileURLToPath } from "url"; import { dirname as __cjs_dirname } from "path"; const __filename = __cjs_fileURLToPath(import.meta.url); const __dirname = __cjs_dirname(__filename); const require = __cjs_createRequire(import.meta.url);
2
+ import {
3
+ require_token_util
4
+ } from "./chunk-7D5WVZW5.js";
5
+ export default require_token_util();
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "shield-llm",
3
+ "version": "0.1.0",
4
+ "description": "AI chatbot security scanner — automated red teaming for LLMs",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "bin": {
10
+ "shield-llm": "bin/shield-llm.js"
11
+ },
12
+ "main": "./dist/index.js",
13
+ "exports": {
14
+ ".": "./dist/index.js"
15
+ },
16
+ "files": [
17
+ "bin/",
18
+ "dist/"
19
+ ],
20
+ "engines": {
21
+ "node": ">=22"
22
+ },
23
+ "keywords": [
24
+ "ai",
25
+ "security",
26
+ "scanner",
27
+ "llm",
28
+ "red-team",
29
+ "owasp",
30
+ "chatbot",
31
+ "cli"
32
+ ],
33
+ "license": "MIT",
34
+ "scripts": {
35
+ "build": "tsup && cp src/reporters/report-template.hbs dist/",
36
+ "dev": "tsx src/cli.ts",
37
+ "test": "vitest run --exclude src/integration.test.ts",
38
+ "test:integration": "vitest run src/integration.test.ts",
39
+ "mock-server": "tsx test-server/server.ts",
40
+ "typecheck": "tsc --noEmit",
41
+ "prepublishOnly": "pnpm build"
42
+ },
43
+ "dependencies": {
44
+ "@inquirer/prompts": "^8.2.1",
45
+ "chalk": "^5.3.0",
46
+ "commander": "^12.0.0",
47
+ "dotenv": "^17.2.3",
48
+ "handlebars": "^4.7.9",
49
+ "ora": "^8.0.0",
50
+ "zod": "^3.23.0"
51
+ },
52
+ "optionalDependencies": {
53
+ "puppeteer": "^24.2.0"
54
+ },
55
+ "devDependencies": {
56
+ "@shield-llm/scanner-core": "workspace:*",
57
+ "@shield-llm/shared": "workspace:*",
58
+ "@types/express": "^5.0.6",
59
+ "@types/node": "^20.19.30",
60
+ "express": "^5.2.1",
61
+ "tsup": "^8.0.0",
62
+ "tsx": "^4.0.0",
63
+ "typescript": "^5.0.0",
64
+ "vitest": "^3.2.4"
65
+ }
66
+ }