@zivis/cli 0.1.0-alpha.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.
- package/dist/commands/app/index.d.ts +10 -0
- package/dist/commands/app/index.js +245 -0
- package/dist/commands/app/index.js.map +1 -0
- package/dist/commands/auth/index.d.ts +2 -0
- package/dist/commands/auth/index.js +41 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.d.ts +8 -0
- package/dist/commands/auth/login.js +65 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +5 -0
- package/dist/commands/auth/logout.js +14 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/sessions.d.ts +4 -0
- package/dist/commands/auth/sessions.js +30 -0
- package/dist/commands/auth/sessions.js.map +1 -0
- package/dist/commands/auth/status.d.ts +4 -0
- package/dist/commands/auth/status.js +53 -0
- package/dist/commands/auth/status.js.map +1 -0
- package/dist/commands/credits/index.d.ts +2 -0
- package/dist/commands/credits/index.js +51 -0
- package/dist/commands/credits/index.js.map +1 -0
- package/dist/commands/mcp/index.d.ts +2 -0
- package/dist/commands/mcp/index.js +70 -0
- package/dist/commands/mcp/index.js.map +1 -0
- package/dist/commands/open/index.d.ts +10 -0
- package/dist/commands/open/index.js +57 -0
- package/dist/commands/open/index.js.map +1 -0
- package/dist/commands/scan/index.d.ts +2 -0
- package/dist/commands/scan/index.js +140 -0
- package/dist/commands/scan/index.js.map +1 -0
- package/dist/commands/target/index.d.ts +2 -0
- package/dist/commands/target/index.js +146 -0
- package/dist/commands/target/index.js.map +1 -0
- package/dist/commands/tm/index.d.ts +2 -0
- package/dist/commands/tm/index.js +266 -0
- package/dist/commands/tm/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/extractor/adapters/go/index.d.ts +7 -0
- package/dist/internal/extractor/adapters/go/index.js +71 -0
- package/dist/internal/extractor/adapters/go/index.js.map +1 -0
- package/dist/internal/extractor/adapters/go/manifest.d.ts +37 -0
- package/dist/internal/extractor/adapters/go/manifest.js +199 -0
- package/dist/internal/extractor/adapters/go/manifest.js.map +1 -0
- package/dist/internal/extractor/adapters/go/parser.d.ts +6 -0
- package/dist/internal/extractor/adapters/go/parser.js +23 -0
- package/dist/internal/extractor/adapters/go/parser.js.map +1 -0
- package/dist/internal/extractor/adapters/go/scanner.d.ts +39 -0
- package/dist/internal/extractor/adapters/go/scanner.js +216 -0
- package/dist/internal/extractor/adapters/go/scanner.js.map +1 -0
- package/dist/internal/extractor/adapters/python/index.d.ts +5 -0
- package/dist/internal/extractor/adapters/python/index.js +68 -0
- package/dist/internal/extractor/adapters/python/index.js.map +1 -0
- package/dist/internal/extractor/adapters/python/manifest.d.ts +25 -0
- package/dist/internal/extractor/adapters/python/manifest.js +236 -0
- package/dist/internal/extractor/adapters/python/manifest.js.map +1 -0
- package/dist/internal/extractor/adapters/python/parser.d.ts +5 -0
- package/dist/internal/extractor/adapters/python/parser.js +22 -0
- package/dist/internal/extractor/adapters/python/parser.js.map +1 -0
- package/dist/internal/extractor/adapters/python/scanner.d.ts +37 -0
- package/dist/internal/extractor/adapters/python/scanner.js +284 -0
- package/dist/internal/extractor/adapters/python/scanner.js.map +1 -0
- package/dist/internal/extractor/adapters/typescript/index.d.ts +9 -0
- package/dist/internal/extractor/adapters/typescript/index.js +84 -0
- package/dist/internal/extractor/adapters/typescript/index.js.map +1 -0
- package/dist/internal/extractor/adapters/typescript/manifest.d.ts +41 -0
- package/dist/internal/extractor/adapters/typescript/manifest.js +156 -0
- package/dist/internal/extractor/adapters/typescript/manifest.js.map +1 -0
- package/dist/internal/extractor/adapters/typescript/parser.d.ts +14 -0
- package/dist/internal/extractor/adapters/typescript/parser.js +33 -0
- package/dist/internal/extractor/adapters/typescript/parser.js.map +1 -0
- package/dist/internal/extractor/adapters/typescript/scanner.d.ts +43 -0
- package/dist/internal/extractor/adapters/typescript/scanner.js +188 -0
- package/dist/internal/extractor/adapters/typescript/scanner.js.map +1 -0
- package/dist/internal/extractor/index.d.ts +22 -0
- package/dist/internal/extractor/index.js +107 -0
- package/dist/internal/extractor/index.js.map +1 -0
- package/dist/internal/extractor/types.d.ts +124 -0
- package/dist/internal/extractor/types.js +28 -0
- package/dist/internal/extractor/types.js.map +1 -0
- package/dist/internal/extractor/walker.d.ts +32 -0
- package/dist/internal/extractor/walker.js +110 -0
- package/dist/internal/extractor/walker.js.map +1 -0
- package/dist/internal/ide-setup.d.ts +7 -0
- package/dist/internal/ide-setup.js +131 -0
- package/dist/internal/ide-setup.js.map +1 -0
- package/dist/internal/orgs.d.ts +8 -0
- package/dist/internal/orgs.js +31 -0
- package/dist/internal/orgs.js.map +1 -0
- package/dist/internal/project-binding.d.ts +11 -0
- package/dist/internal/project-binding.js +96 -0
- package/dist/internal/project-binding.js.map +1 -0
- package/dist/internal/target-auth/api-config.d.ts +37 -0
- package/dist/internal/target-auth/api-config.js +40 -0
- package/dist/internal/target-auth/api-config.js.map +1 -0
- package/dist/internal/target-auth/config.d.ts +20 -0
- package/dist/internal/target-auth/config.js +58 -0
- package/dist/internal/target-auth/config.js.map +1 -0
- package/dist/internal/target-auth/index.d.ts +30 -0
- package/dist/internal/target-auth/index.js +101 -0
- package/dist/internal/target-auth/index.js.map +1 -0
- package/dist/internal/target-auth/keychain.d.ts +23 -0
- package/dist/internal/target-auth/keychain.js +150 -0
- package/dist/internal/target-auth/keychain.js.map +1 -0
- package/dist/internal/target-auth/types.d.ts +51 -0
- package/dist/internal/target-auth/types.js +11 -0
- package/dist/internal/target-auth/types.js.map +1 -0
- package/dist/internal/target-auth/workos.d.ts +20 -0
- package/dist/internal/target-auth/workos.js +196 -0
- package/dist/internal/target-auth/workos.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extractor orchestrator.
|
|
3
|
+
*
|
|
4
|
+
* Walks the customer's repo, dispatches matched files to per-language
|
|
5
|
+
* adapters, merges their findings into a single ExtractionResult.
|
|
6
|
+
*
|
|
7
|
+
* Adapters register their own file extensions + manifest filenames; the
|
|
8
|
+
* walker only reads files those filters claim. So adding a Go or Python
|
|
9
|
+
* adapter doesn't change anything here — register the adapter and the
|
|
10
|
+
* orchestrator picks up its files.
|
|
11
|
+
*/
|
|
12
|
+
import * as path from "node:path";
|
|
13
|
+
import { walk } from "./walker.js";
|
|
14
|
+
import { typescriptAdapter } from "./adapters/typescript/index.js";
|
|
15
|
+
import { goAdapter } from "./adapters/go/index.js";
|
|
16
|
+
import { pythonAdapter } from "./adapters/python/index.js";
|
|
17
|
+
const ADAPTERS = [
|
|
18
|
+
typescriptAdapter,
|
|
19
|
+
goAdapter,
|
|
20
|
+
pythonAdapter,
|
|
21
|
+
];
|
|
22
|
+
export async function runExtractor(opts) {
|
|
23
|
+
const startedAt = Date.now();
|
|
24
|
+
const rootDir = path.resolve(opts.rootDir);
|
|
25
|
+
const adapters = opts.languages
|
|
26
|
+
? ADAPTERS.filter((a) => opts.languages.includes(a.language))
|
|
27
|
+
: ADAPTERS;
|
|
28
|
+
// Aggregate the file filters from each adapter so we walk the tree once.
|
|
29
|
+
const extensions = new Set();
|
|
30
|
+
const manifests = new Set();
|
|
31
|
+
for (const a of adapters) {
|
|
32
|
+
for (const e of a.extensions)
|
|
33
|
+
extensions.add(e);
|
|
34
|
+
for (const m of a.manifests)
|
|
35
|
+
manifests.add(m);
|
|
36
|
+
}
|
|
37
|
+
const walked = await walk({
|
|
38
|
+
rootDir,
|
|
39
|
+
extensions: [...extensions],
|
|
40
|
+
manifests: [...manifests],
|
|
41
|
+
extraIgnores: opts.extraIgnores,
|
|
42
|
+
});
|
|
43
|
+
const components = [];
|
|
44
|
+
const externalServices = [];
|
|
45
|
+
const dataStores = [];
|
|
46
|
+
const manifestSummaries = [];
|
|
47
|
+
for (const adapter of adapters) {
|
|
48
|
+
const myExts = new Set(adapter.extensions);
|
|
49
|
+
const myManifests = new Set(adapter.manifests);
|
|
50
|
+
const sourceFiles = walked.sourceFiles.filter((f) => myExts.has(path.extname(f).toLowerCase()));
|
|
51
|
+
const manifestFiles = walked.manifestFiles.filter((f) => myManifests.has(path.basename(f)));
|
|
52
|
+
if (sourceFiles.length === 0 && manifestFiles.length === 0)
|
|
53
|
+
continue;
|
|
54
|
+
const out = await adapter.extract({ rootDir, sourceFiles, manifestFiles });
|
|
55
|
+
components.push(...out.components);
|
|
56
|
+
externalServices.push(...out.externalServices);
|
|
57
|
+
dataStores.push(...out.dataStores);
|
|
58
|
+
manifestSummaries.push(...out.manifests);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
version: "1.0",
|
|
62
|
+
extractedAt: new Date().toISOString(),
|
|
63
|
+
extractor: `@zivis-ai/cli@${opts.extractorVersion}`,
|
|
64
|
+
scope: {
|
|
65
|
+
rootDir,
|
|
66
|
+
filesScanned: walked.filesScanned,
|
|
67
|
+
filesSkipped: walked.filesSkipped,
|
|
68
|
+
durationMs: Date.now() - startedAt,
|
|
69
|
+
},
|
|
70
|
+
components: dedupeComponents(components),
|
|
71
|
+
externalServices: dedupeExternalServices(externalServices),
|
|
72
|
+
dataStores,
|
|
73
|
+
manifests: manifestSummaries,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function dedupeComponents(items) {
|
|
77
|
+
const out = new Map();
|
|
78
|
+
for (const c of items) {
|
|
79
|
+
const key = `${c.language}::${c.name}`;
|
|
80
|
+
const existing = out.get(key);
|
|
81
|
+
if (!existing) {
|
|
82
|
+
out.set(key, { ...c, sourceFiles: [...c.sourceFiles], evidence: [...c.evidence] });
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
for (const f of c.sourceFiles)
|
|
86
|
+
if (!existing.sourceFiles.includes(f))
|
|
87
|
+
existing.sourceFiles.push(f);
|
|
88
|
+
existing.evidence.push(...c.evidence);
|
|
89
|
+
}
|
|
90
|
+
return [...out.values()];
|
|
91
|
+
}
|
|
92
|
+
function dedupeExternalServices(items) {
|
|
93
|
+
const out = new Map();
|
|
94
|
+
for (const s of items) {
|
|
95
|
+
const key = `${s.kind}::${s.package}`;
|
|
96
|
+
const existing = out.get(key);
|
|
97
|
+
if (!existing) {
|
|
98
|
+
out.set(key, { ...s, callSites: [...s.callSites] });
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (!existing.version && s.version)
|
|
102
|
+
existing.version = s.version;
|
|
103
|
+
existing.callSites.push(...s.callSites);
|
|
104
|
+
}
|
|
105
|
+
return [...out.values()];
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/extractor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAoB3D,MAAM,QAAQ,GAAsB;IAClC,iBAAiB;IACjB,SAAS;IACT,aAAa;CACd,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAgB;IACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS;QAC7B,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAe,CAAC,CAAC;QACrE,CAAC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;QACjE,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extractor output schema.
|
|
3
|
+
*
|
|
4
|
+
* Matches `THREAT-MODEL-PHASE-J.md`'s J.2 output shape, with additions
|
|
5
|
+
* for privacy-audit metadata. The shape is the contract between the CLI
|
|
6
|
+
* and the eventual `--apply` endpoint that maps into ThreatModelComponent
|
|
7
|
+
* / OrgComponent records (RECON.3-gated).
|
|
8
|
+
*
|
|
9
|
+
* Privacy invariant — what's IN the JSON:
|
|
10
|
+
* component names ("auth-service")
|
|
11
|
+
* file paths ("src/auth/login.ts")
|
|
12
|
+
* line numbers (42)
|
|
13
|
+
* framework + SDK identifiers ("express", "@anthropic-ai/sdk")
|
|
14
|
+
* detected protocols / methods (POST /login)
|
|
15
|
+
* dependency versions (from package.json / go.mod / pyproject.toml)
|
|
16
|
+
*
|
|
17
|
+
* What's NOT:
|
|
18
|
+
* function bodies, file contents, code snippets
|
|
19
|
+
* variable names from inside functions
|
|
20
|
+
* comments
|
|
21
|
+
* raw AST nodes
|
|
22
|
+
*
|
|
23
|
+
* `zivis tm extract --privacy-audit` prints this whole object to stdout
|
|
24
|
+
* before any network call, so the customer can see exactly what would
|
|
25
|
+
* be sent.
|
|
26
|
+
*/
|
|
27
|
+
export type Language = "typescript" | "javascript" | "go" | "python";
|
|
28
|
+
export interface EvidenceLocation {
|
|
29
|
+
file: string;
|
|
30
|
+
line: number;
|
|
31
|
+
}
|
|
32
|
+
export interface HttpRouteEvidence extends EvidenceLocation {
|
|
33
|
+
kind: "http_route";
|
|
34
|
+
method: string;
|
|
35
|
+
path: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ImportEvidence extends EvidenceLocation {
|
|
38
|
+
kind: "import";
|
|
39
|
+
package: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ConfigEvidence extends EvidenceLocation {
|
|
42
|
+
kind: "config";
|
|
43
|
+
}
|
|
44
|
+
export type Evidence = HttpRouteEvidence | ImportEvidence | ConfigEvidence;
|
|
45
|
+
export type ComponentKind = "process" | "data_store" | "external_service" | "frontend";
|
|
46
|
+
export interface ExtractedComponent {
|
|
47
|
+
/** Stable name derived from path / module — never a value from inside a function. */
|
|
48
|
+
name: string;
|
|
49
|
+
kind: ComponentKind;
|
|
50
|
+
language: Language;
|
|
51
|
+
/** Detected web framework, if any (express | fastify | nextjs | trpc | hono | gin | echo | …). */
|
|
52
|
+
framework?: string;
|
|
53
|
+
sourceFiles: string[];
|
|
54
|
+
evidence: Evidence[];
|
|
55
|
+
}
|
|
56
|
+
export interface ExtractedExternalService {
|
|
57
|
+
/** Vendor / SDK name — "Anthropic", "OpenAI", "WorkOS". */
|
|
58
|
+
name: string;
|
|
59
|
+
/** What kind of integration: ai_sdk, payments, auth, observability, etc. */
|
|
60
|
+
kind: string;
|
|
61
|
+
/** npm/PyPI/Go module identifier ("@anthropic-ai/sdk"). */
|
|
62
|
+
package: string;
|
|
63
|
+
version?: string;
|
|
64
|
+
callSites: EvidenceLocation[];
|
|
65
|
+
}
|
|
66
|
+
export interface ExtractedDataStore {
|
|
67
|
+
name: string;
|
|
68
|
+
kind: "postgres" | "mysql" | "mongo" | "redis" | "sqlite" | "unknown";
|
|
69
|
+
client?: string;
|
|
70
|
+
version?: string;
|
|
71
|
+
evidence: Evidence[];
|
|
72
|
+
}
|
|
73
|
+
export interface ExtractionScope {
|
|
74
|
+
rootDir: string;
|
|
75
|
+
filesScanned: number;
|
|
76
|
+
filesSkipped: number;
|
|
77
|
+
durationMs: number;
|
|
78
|
+
}
|
|
79
|
+
export interface ExtractionResult {
|
|
80
|
+
version: "1.0";
|
|
81
|
+
extractedAt: string;
|
|
82
|
+
extractor: string;
|
|
83
|
+
scope: ExtractionScope;
|
|
84
|
+
components: ExtractedComponent[];
|
|
85
|
+
externalServices: ExtractedExternalService[];
|
|
86
|
+
dataStores: ExtractedDataStore[];
|
|
87
|
+
/**
|
|
88
|
+
* Per-language manifests detected in the scope. Surfaces dependency-only
|
|
89
|
+
* findings (e.g., "this repo uses @anthropic-ai/sdk@^0.30") even when
|
|
90
|
+
* we can't yet match call sites.
|
|
91
|
+
*/
|
|
92
|
+
manifests: ManifestSummary[];
|
|
93
|
+
}
|
|
94
|
+
export interface ManifestSummary {
|
|
95
|
+
language: Language;
|
|
96
|
+
file: string;
|
|
97
|
+
/** Direct dependency names → version (verbatim from manifest). */
|
|
98
|
+
dependencies: Record<string, string>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Adapter contract — one per language. Each adapter is fed the list of
|
|
102
|
+
* source files matched for it (already filtered by .gitignore + .zivisignore)
|
|
103
|
+
* plus any manifest files (package.json, go.mod, pyproject.toml). Returns
|
|
104
|
+
* structured findings the framework merges into the final ExtractionResult.
|
|
105
|
+
*/
|
|
106
|
+
export interface LanguageAdapter {
|
|
107
|
+
language: Language;
|
|
108
|
+
/** File extensions this adapter handles. */
|
|
109
|
+
extensions: string[];
|
|
110
|
+
/** Manifest filenames this adapter cares about. */
|
|
111
|
+
manifests: string[];
|
|
112
|
+
extract(input: AdapterInput): Promise<AdapterOutput>;
|
|
113
|
+
}
|
|
114
|
+
export interface AdapterInput {
|
|
115
|
+
rootDir: string;
|
|
116
|
+
sourceFiles: string[];
|
|
117
|
+
manifestFiles: string[];
|
|
118
|
+
}
|
|
119
|
+
export interface AdapterOutput {
|
|
120
|
+
components: ExtractedComponent[];
|
|
121
|
+
externalServices: ExtractedExternalService[];
|
|
122
|
+
dataStores: ExtractedDataStore[];
|
|
123
|
+
manifests: ManifestSummary[];
|
|
124
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extractor output schema.
|
|
3
|
+
*
|
|
4
|
+
* Matches `THREAT-MODEL-PHASE-J.md`'s J.2 output shape, with additions
|
|
5
|
+
* for privacy-audit metadata. The shape is the contract between the CLI
|
|
6
|
+
* and the eventual `--apply` endpoint that maps into ThreatModelComponent
|
|
7
|
+
* / OrgComponent records (RECON.3-gated).
|
|
8
|
+
*
|
|
9
|
+
* Privacy invariant — what's IN the JSON:
|
|
10
|
+
* component names ("auth-service")
|
|
11
|
+
* file paths ("src/auth/login.ts")
|
|
12
|
+
* line numbers (42)
|
|
13
|
+
* framework + SDK identifiers ("express", "@anthropic-ai/sdk")
|
|
14
|
+
* detected protocols / methods (POST /login)
|
|
15
|
+
* dependency versions (from package.json / go.mod / pyproject.toml)
|
|
16
|
+
*
|
|
17
|
+
* What's NOT:
|
|
18
|
+
* function bodies, file contents, code snippets
|
|
19
|
+
* variable names from inside functions
|
|
20
|
+
* comments
|
|
21
|
+
* raw AST nodes
|
|
22
|
+
*
|
|
23
|
+
* `zivis tm extract --privacy-audit` prints this whole object to stdout
|
|
24
|
+
* before any network call, so the customer can see exactly what would
|
|
25
|
+
* be sent.
|
|
26
|
+
*/
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/internal/extractor/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem walker — yields source files relative to the scan root,
|
|
3
|
+
* filtered by .gitignore + .zivisignore + per-extractor extension filters.
|
|
4
|
+
*
|
|
5
|
+
* Uses the `ignore` npm package (the same engine git ships with) so the
|
|
6
|
+
* matching semantics mirror what developers expect from .gitignore.
|
|
7
|
+
*
|
|
8
|
+
* Hard limits:
|
|
9
|
+
* - Skips node_modules, dist, build, .next, .git, .yarn, vendor — even
|
|
10
|
+
* if not in .gitignore. These exist by convention and contain
|
|
11
|
+
* third-party code that pollutes the inventory.
|
|
12
|
+
* - Caps total files at 50_000 to refuse to scan a generated monorepo
|
|
13
|
+
* by accident (extractor would take forever; user should narrow scope).
|
|
14
|
+
*/
|
|
15
|
+
export interface WalkOptions {
|
|
16
|
+
rootDir: string;
|
|
17
|
+
/** Extensions to include (with the leading dot, e.g. [".ts", ".tsx"]). */
|
|
18
|
+
extensions: string[];
|
|
19
|
+
/** Manifest basenames to capture regardless of extension (e.g. ["package.json"]). */
|
|
20
|
+
manifests: string[];
|
|
21
|
+
/** Extra ignore patterns from --ignore CLI flags. */
|
|
22
|
+
extraIgnores?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface WalkResult {
|
|
25
|
+
sourceFiles: string[];
|
|
26
|
+
manifestFiles: string[];
|
|
27
|
+
filesScanned: number;
|
|
28
|
+
filesSkipped: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function walk(opts: WalkOptions): Promise<WalkResult>;
|
|
31
|
+
/** Convert an absolute path to a posix-style repo-relative path. */
|
|
32
|
+
export declare function repoRelative(rootDir: string, absPath: string): string;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem walker — yields source files relative to the scan root,
|
|
3
|
+
* filtered by .gitignore + .zivisignore + per-extractor extension filters.
|
|
4
|
+
*
|
|
5
|
+
* Uses the `ignore` npm package (the same engine git ships with) so the
|
|
6
|
+
* matching semantics mirror what developers expect from .gitignore.
|
|
7
|
+
*
|
|
8
|
+
* Hard limits:
|
|
9
|
+
* - Skips node_modules, dist, build, .next, .git, .yarn, vendor — even
|
|
10
|
+
* if not in .gitignore. These exist by convention and contain
|
|
11
|
+
* third-party code that pollutes the inventory.
|
|
12
|
+
* - Caps total files at 50_000 to refuse to scan a generated monorepo
|
|
13
|
+
* by accident (extractor would take forever; user should narrow scope).
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from "node:fs/promises";
|
|
16
|
+
import * as path from "node:path";
|
|
17
|
+
import ignore from "ignore";
|
|
18
|
+
const HARD_SKIP_DIRS = new Set([
|
|
19
|
+
"node_modules",
|
|
20
|
+
".git",
|
|
21
|
+
".yarn",
|
|
22
|
+
".pnpm",
|
|
23
|
+
"dist",
|
|
24
|
+
"build",
|
|
25
|
+
"out",
|
|
26
|
+
".next",
|
|
27
|
+
".nuxt",
|
|
28
|
+
".turbo",
|
|
29
|
+
".cache",
|
|
30
|
+
"coverage",
|
|
31
|
+
"vendor",
|
|
32
|
+
"__pycache__",
|
|
33
|
+
".venv",
|
|
34
|
+
"target",
|
|
35
|
+
]);
|
|
36
|
+
const MAX_FILES = 50_000;
|
|
37
|
+
export async function walk(opts) {
|
|
38
|
+
const ig = ignore();
|
|
39
|
+
await loadIgnoreFile(ig, path.join(opts.rootDir, ".gitignore"));
|
|
40
|
+
await loadIgnoreFile(ig, path.join(opts.rootDir, ".zivisignore"));
|
|
41
|
+
if (opts.extraIgnores?.length)
|
|
42
|
+
ig.add(opts.extraIgnores);
|
|
43
|
+
const extSet = new Set(opts.extensions.map((e) => e.toLowerCase()));
|
|
44
|
+
const manifestSet = new Set(opts.manifests);
|
|
45
|
+
const sourceFiles = [];
|
|
46
|
+
const manifestFiles = [];
|
|
47
|
+
let filesScanned = 0;
|
|
48
|
+
let filesSkipped = 0;
|
|
49
|
+
async function visit(dirAbs, dirRel) {
|
|
50
|
+
if (sourceFiles.length + manifestFiles.length >= MAX_FILES)
|
|
51
|
+
return;
|
|
52
|
+
let entries;
|
|
53
|
+
try {
|
|
54
|
+
entries = await fs.readdir(dirAbs, { withFileTypes: true });
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
const name = entry.name;
|
|
61
|
+
const childRel = dirRel ? path.posix.join(dirRel, name) : name;
|
|
62
|
+
if (entry.isDirectory()) {
|
|
63
|
+
if (HARD_SKIP_DIRS.has(name)) {
|
|
64
|
+
filesSkipped++;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
// ignore() expects gitignore-style paths with trailing /
|
|
68
|
+
if (ig.ignores(childRel + "/")) {
|
|
69
|
+
filesSkipped++;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
await visit(path.join(dirAbs, name), childRel);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (!entry.isFile() && !entry.isSymbolicLink())
|
|
76
|
+
continue;
|
|
77
|
+
if (ig.ignores(childRel)) {
|
|
78
|
+
filesSkipped++;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
filesScanned++;
|
|
82
|
+
const abs = path.join(dirAbs, name);
|
|
83
|
+
if (manifestSet.has(name)) {
|
|
84
|
+
manifestFiles.push(abs);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const ext = path.extname(name).toLowerCase();
|
|
88
|
+
if (extSet.has(ext)) {
|
|
89
|
+
sourceFiles.push(abs);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
await visit(opts.rootDir, "");
|
|
94
|
+
return { sourceFiles, manifestFiles, filesScanned, filesSkipped };
|
|
95
|
+
}
|
|
96
|
+
async function loadIgnoreFile(ig, filePath) {
|
|
97
|
+
try {
|
|
98
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
99
|
+
ig.add(content);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
// No ignore file — fine.
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Convert an absolute path to a posix-style repo-relative path. */
|
|
106
|
+
export function repoRelative(rootDir, absPath) {
|
|
107
|
+
const rel = path.relative(rootDir, absPath);
|
|
108
|
+
return rel.split(path.sep).join("/");
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=walker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../../src/internal/extractor/walker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA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;YAEpC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACxB,SAAS;YACX,CAAC;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAC7C,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAE9B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AACpE,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,EAAU,EAAE,QAAgB;IACxD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,yBAAyB;IAC3B,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,OAAe;IAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function setupCursor(session?: string): Promise<void>;
|
|
2
|
+
export declare function setupVsCodeCopilot(session?: string): Promise<void>;
|
|
3
|
+
export declare function setupVsCodeClaude(session?: string): Promise<void>;
|
|
4
|
+
export declare function setupClaudeCodeCli(session?: string): Promise<void>;
|
|
5
|
+
export declare function setupCline(session?: string): Promise<void>;
|
|
6
|
+
export declare function setupWindsurf(session?: string): Promise<void>;
|
|
7
|
+
export declare function printClaudeCodeManual(session?: string): void;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
const SERVER_NAME = "zivis";
|
|
4
|
+
function buildServerConfig(session, extra) {
|
|
5
|
+
const config = {
|
|
6
|
+
...extra,
|
|
7
|
+
command: "zivis",
|
|
8
|
+
args: ["mcp", "serve"],
|
|
9
|
+
};
|
|
10
|
+
if (session) {
|
|
11
|
+
config.env = { ZIVIS_SESSION: session };
|
|
12
|
+
}
|
|
13
|
+
return config;
|
|
14
|
+
}
|
|
15
|
+
async function updateMcpConfig(configPath, serverName, serverConfig, rootKey) {
|
|
16
|
+
const configDir = path.dirname(configPath);
|
|
17
|
+
if (!fs.existsSync(configDir)) {
|
|
18
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
19
|
+
}
|
|
20
|
+
let config = {};
|
|
21
|
+
if (fs.existsSync(configPath)) {
|
|
22
|
+
try {
|
|
23
|
+
config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
console.warn(`Warning: Could not parse existing ${configPath}, will overwrite`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!config[rootKey]) {
|
|
30
|
+
config[rootKey] = {};
|
|
31
|
+
}
|
|
32
|
+
const servers = config[rootKey];
|
|
33
|
+
servers[serverName] = serverConfig;
|
|
34
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
35
|
+
}
|
|
36
|
+
export async function setupCursor(session) {
|
|
37
|
+
const homeDir = process.env.HOME || "";
|
|
38
|
+
const configPath = path.join(homeDir, ".cursor", "mcp.json");
|
|
39
|
+
await updateMcpConfig(configPath, SERVER_NAME, buildServerConfig(session), "mcpServers");
|
|
40
|
+
console.log(`✓ Cursor MCP config updated: ${configPath}`);
|
|
41
|
+
if (session)
|
|
42
|
+
console.log(` Session: ${session}`);
|
|
43
|
+
console.log(" Restart Cursor for changes to take effect");
|
|
44
|
+
}
|
|
45
|
+
export async function setupVsCodeCopilot(session) {
|
|
46
|
+
const localConfigPath = path.join(process.cwd(), ".vscode", "mcp.json");
|
|
47
|
+
const globalConfigPath = path.join(process.env.HOME || "", ".vscode", "mcp.json");
|
|
48
|
+
let configPath = localConfigPath;
|
|
49
|
+
const exists = fs.existsSync(localConfigPath);
|
|
50
|
+
if (!exists && fs.existsSync(globalConfigPath)) {
|
|
51
|
+
configPath = globalConfigPath;
|
|
52
|
+
}
|
|
53
|
+
await updateMcpConfig(configPath, SERVER_NAME, buildServerConfig(session, { type: "stdio" }), "servers");
|
|
54
|
+
console.log(`✓ VS Code (GitHub Copilot) MCP config updated: ${configPath}`);
|
|
55
|
+
if (session)
|
|
56
|
+
console.log(` Session: ${session}`);
|
|
57
|
+
console.log(" Restart VS Code for changes to take effect");
|
|
58
|
+
}
|
|
59
|
+
export async function setupVsCodeClaude(session) {
|
|
60
|
+
const configPath = path.join(process.cwd(), ".vscode", "mcp.json");
|
|
61
|
+
await updateMcpConfig(configPath, SERVER_NAME, buildServerConfig(session), "mcpServers");
|
|
62
|
+
console.log(`✓ VS Code (Claude Code) MCP config updated: ${configPath}`);
|
|
63
|
+
if (session)
|
|
64
|
+
console.log(` Session: ${session}`);
|
|
65
|
+
console.log(" Restart VS Code for changes to take effect");
|
|
66
|
+
}
|
|
67
|
+
export async function setupClaudeCodeCli(session) {
|
|
68
|
+
const homeDir = process.env.HOME || "";
|
|
69
|
+
const configPath = path.join(homeDir, ".claude.json");
|
|
70
|
+
const projectPath = process.cwd();
|
|
71
|
+
if (!fs.existsSync(configPath)) {
|
|
72
|
+
console.log(" Skipping Claude Code CLI (no ~/.claude.json found)");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
77
|
+
config.projects ??= {};
|
|
78
|
+
config.projects[projectPath] ??= {};
|
|
79
|
+
config.projects[projectPath].mcpServers ??= {};
|
|
80
|
+
config.projects[projectPath].mcpServers[SERVER_NAME] = {
|
|
81
|
+
type: "stdio",
|
|
82
|
+
command: "zivis",
|
|
83
|
+
args: ["mcp", "serve"],
|
|
84
|
+
env: session ? { ZIVIS_SESSION: session } : {},
|
|
85
|
+
};
|
|
86
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
87
|
+
console.log("✓ Claude Code CLI MCP config updated: ~/.claude.json");
|
|
88
|
+
if (session)
|
|
89
|
+
console.log(` Session: ${session}`);
|
|
90
|
+
console.log(" Restart Claude Code for changes to take effect");
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
console.log(` WARNING: Failed to update ~/.claude.json: ${err instanceof Error ? err.message : err}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export async function setupCline(session) {
|
|
97
|
+
const homeDir = process.env.HOME || "";
|
|
98
|
+
const configPath = process.platform === "darwin"
|
|
99
|
+
? path.join(homeDir, "Library", "Application Support", "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json")
|
|
100
|
+
: path.join(homeDir, ".config", "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json");
|
|
101
|
+
await updateMcpConfig(configPath, SERVER_NAME, buildServerConfig(session), "mcpServers");
|
|
102
|
+
console.log(`✓ Cline MCP config updated: ${configPath}`);
|
|
103
|
+
if (session)
|
|
104
|
+
console.log(` Session: ${session}`);
|
|
105
|
+
console.log(" Restart VS Code for changes to take effect");
|
|
106
|
+
}
|
|
107
|
+
export async function setupWindsurf(session) {
|
|
108
|
+
const homeDir = process.env.HOME || "";
|
|
109
|
+
const configPath = path.join(homeDir, ".codeium", "windsurf", "mcp_config.json");
|
|
110
|
+
await updateMcpConfig(configPath, SERVER_NAME, buildServerConfig(session), "mcpServers");
|
|
111
|
+
console.log(`✓ Windsurf MCP config updated: ${configPath}`);
|
|
112
|
+
if (session)
|
|
113
|
+
console.log(` Session: ${session}`);
|
|
114
|
+
console.log(" Restart Windsurf for changes to take effect");
|
|
115
|
+
}
|
|
116
|
+
export function printClaudeCodeManual(session) {
|
|
117
|
+
const serverConfig = {
|
|
118
|
+
mcpServers: {
|
|
119
|
+
[SERVER_NAME]: buildServerConfig(session),
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
console.log("");
|
|
123
|
+
console.log("✓ Claude Code MCP configuration:");
|
|
124
|
+
console.log("");
|
|
125
|
+
console.log("Add the following to your Claude Code MCP settings:");
|
|
126
|
+
console.log("");
|
|
127
|
+
console.log(JSON.stringify(serverConfig, null, 2));
|
|
128
|
+
console.log("");
|
|
129
|
+
console.log("Then restart Claude Code for changes to take effect");
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=ide-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide-setup.js","sourceRoot":"","sources":["../../src/internal/ide-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,SAAS,iBAAiB,CACxB,OAAgB,EAChB,KAA+B;IAE/B,MAAM,MAAM,GAA4B;QACtC,GAAG,KAAK;QACR,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,CAAC,GAAG,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,UAAkB,EAClB,UAAkB,EAClB,YAAqC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AAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ZivisConfig } from "@zivis-ai/mcp-security/types";
|
|
2
|
+
export interface OrgInfo {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
workosOrgId: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function fetchUserOrgs(config: ZivisConfig, accessToken: string): Promise<OrgInfo[]>;
|
|
8
|
+
export declare function extractEmail(idToken?: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export async function fetchUserOrgs(config, accessToken) {
|
|
2
|
+
const url = `${config.apiBaseUrl}/api/user/organizations`;
|
|
3
|
+
const response = await fetch(url, {
|
|
4
|
+
method: "GET",
|
|
5
|
+
headers: {
|
|
6
|
+
Authorization: `Bearer ${accessToken}`,
|
|
7
|
+
"Content-Type": "application/json",
|
|
8
|
+
"User-Agent": "@zivis-ai/cli",
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
if (!response.ok) {
|
|
12
|
+
const body = await response.json().catch(() => ({}));
|
|
13
|
+
throw new Error(body.message ||
|
|
14
|
+
body.error ||
|
|
15
|
+
`Failed to fetch organizations (HTTP ${response.status})`);
|
|
16
|
+
}
|
|
17
|
+
const data = (await response.json());
|
|
18
|
+
return data.organizations;
|
|
19
|
+
}
|
|
20
|
+
export function extractEmail(idToken) {
|
|
21
|
+
if (!idToken)
|
|
22
|
+
return "unknown";
|
|
23
|
+
try {
|
|
24
|
+
const payload = JSON.parse(Buffer.from(idToken.split(".")[1], "base64url").toString());
|
|
25
|
+
return payload.email || "unknown";
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return "unknown";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=orgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orgs.js","sourceRoot":"","sources":["../../src/internal/orgs.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,aA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sureBindingOpts {
|
|
3
|
+
config: ZivisConfig;
|
|
4
|
+
session: string;
|
|
5
|
+
accessToken: string;
|
|
6
|
+
organizationId?: string;
|
|
7
|
+
cwd: string;
|
|
8
|
+
autoBind: boolean;
|
|
9
|
+
skipBind: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function ensureProjectBinding(opts: EnsureBindingOpts): Promise<void>;
|