@mnemonik/scanner 5.151.0 → 5.151.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/client.d.ts +99 -0
- package/dist/client.js +140 -0
- package/dist/client.js.map +1 -0
- package/dist/daemon.d.ts +51 -0
- package/dist/daemon.js +550 -0
- package/dist/daemon.js.map +1 -0
- package/dist/discovery.d.ts +21 -0
- package/dist/discovery.js +107 -0
- package/dist/discovery.js.map +1 -0
- package/dist/doctor.d.ts +1 -0
- package/dist/doctor.js +233 -0
- package/dist/doctor.js.map +1 -0
- package/dist/fileLog.d.ts +17 -0
- package/dist/fileLog.js +70 -0
- package/dist/fileLog.js.map +1 -0
- package/dist/git.d.ts +31 -0
- package/dist/git.js +111 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +399 -0
- package/dist/index.js.map +1 -0
- package/dist/pid.d.ts +1 -0
- package/dist/pid.js +37 -0
- package/dist/pid.js.map +1 -0
- package/dist/watcher.d.ts +30 -0
- package/dist/watcher.js +214 -0
- package/dist/watcher.js.map +1 -0
- package/package.json +7 -3
- package/src/client.ts +0 -216
- package/src/daemon.ts +0 -679
- package/src/discovery.ts +0 -124
- package/src/doctor.ts +0 -239
- package/src/fileLog.ts +0 -67
- package/src/git.ts +0 -122
- package/src/index.ts +0 -446
- package/src/pid.ts +0 -37
- package/src/watcher.ts +0 -219
- package/tests/validateServerUrl.test.ts +0 -41
- package/tsconfig.json +0 -18
- package/vitest.config.ts +0 -13
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* O8b (codebase-indexing-audit-2026-07-02.md §5): the scanner CLI silently
|
|
3
|
-
* accepted plain http:// --server URLs, which would send scanned file
|
|
4
|
-
* content and the API key in plaintext. validateServerUrl() is the pure
|
|
5
|
-
* guard extracted from index.ts's main() so it can be unit-tested without
|
|
6
|
-
* spinning up the daemon/CLI process.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { describe, it, expect } from 'vitest';
|
|
10
|
-
import { validateServerUrl } from '../src/index.js';
|
|
11
|
-
|
|
12
|
-
describe('validateServerUrl', () => {
|
|
13
|
-
it('accepts https:// URLs', () => {
|
|
14
|
-
expect(validateServerUrl('https://api.mnemonik.dev').valid).toBe(true);
|
|
15
|
-
expect(validateServerUrl('https://example.com:8443/path').valid).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('accepts plain http:// for localhost/127.0.0.1/[::1]', () => {
|
|
19
|
-
expect(validateServerUrl('http://localhost:3000').valid).toBe(true);
|
|
20
|
-
expect(validateServerUrl('http://127.0.0.1:3000').valid).toBe(true);
|
|
21
|
-
expect(validateServerUrl('http://[::1]:3000').valid).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('rejects http:// for any non-local host', () => {
|
|
25
|
-
const result = validateServerUrl('http://api.mnemonik.dev');
|
|
26
|
-
expect(result.valid).toBe(false);
|
|
27
|
-
expect(result.error).toContain('Refusing insecure server URL');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('rejects http:// for a local-sounding but non-loopback IP', () => {
|
|
31
|
-
// 127.0.0.2 is loopback-range but not in our explicit allowlist — reject,
|
|
32
|
-
// since we only special-case the exact strings a scanner config would use.
|
|
33
|
-
expect(validateServerUrl('http://127.0.0.2:3000').valid).toBe(false);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('rejects an unparseable URL with a clear error', () => {
|
|
37
|
-
const result = validateServerUrl('not-a-url');
|
|
38
|
-
expect(result.valid).toBe(false);
|
|
39
|
-
expect(result.error).toContain('Invalid --server URL');
|
|
40
|
-
});
|
|
41
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"rootDir": "./src",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"sourceMap": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*"],
|
|
17
|
-
"exclude": ["node_modules", "dist"]
|
|
18
|
-
}
|
package/vitest.config.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: false,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
include: ['tests/**/*.test.ts'],
|
|
8
|
-
testTimeout: 10000,
|
|
9
|
-
hookTimeout: 10000,
|
|
10
|
-
isolate: true,
|
|
11
|
-
pool: 'forks',
|
|
12
|
-
},
|
|
13
|
-
});
|