seance-cli 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +40 -2
- package/dist/commands/init.d.ts +29 -0
- package/dist/commands/init.js +310 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +19 -0
- package/dist/commands/mcp.js +38 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/quiz.d.ts +23 -0
- package/dist/commands/quiz.js +187 -0
- package/dist/commands/quiz.js.map +1 -0
- package/dist/commands/review.d.ts +4 -0
- package/dist/commands/review.js +115 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/sync.d.ts +17 -0
- package/dist/commands/sync.js +367 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/git.d.ts +33 -0
- package/dist/git.js +103 -0
- package/dist/git.js.map +1 -0
- package/dist/hosted-api.d.ts +24 -0
- package/dist/hosted-api.js +85 -0
- package/dist/hosted-api.js.map +1 -0
- package/dist/hosted-consent.d.ts +8 -0
- package/dist/hosted-consent.js +37 -0
- package/dist/hosted-consent.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +108 -0
- package/dist/index.js.map +1 -0
- package/dist/init-fs.d.ts +51 -0
- package/dist/init-fs.js +220 -0
- package/dist/init-fs.js.map +1 -0
- package/dist/init-questions.d.ts +21 -0
- package/dist/init-questions.js +161 -0
- package/dist/init-questions.js.map +1 -0
- package/dist/mcp-handlers.d.ts +22 -0
- package/dist/mcp-handlers.js +185 -0
- package/dist/mcp-handlers.js.map +1 -0
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.js +39 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/prompter.d.ts +29 -0
- package/dist/prompter.js +42 -0
- package/dist/prompter.js.map +1 -0
- package/dist/quiz-backend.d.ts +40 -0
- package/dist/quiz-backend.js +116 -0
- package/dist/quiz-backend.js.map +1 -0
- package/dist/quiz-input.d.ts +12 -0
- package/dist/quiz-input.js +52 -0
- package/dist/quiz-input.js.map +1 -0
- package/dist/quiz-io.d.ts +30 -0
- package/dist/quiz-io.js +83 -0
- package/dist/quiz-io.js.map +1 -0
- package/dist/quiz-ui.d.ts +18 -0
- package/dist/quiz-ui.js +51 -0
- package/dist/quiz-ui.js.map +1 -0
- package/node_modules/@seance/ai/LICENSE +21 -0
- package/node_modules/@seance/ai/dist/chain.d.ts +31 -0
- package/node_modules/@seance/ai/dist/chain.js +114 -0
- package/node_modules/@seance/ai/dist/chain.js.map +1 -0
- package/node_modules/@seance/ai/dist/grade.d.ts +14 -0
- package/node_modules/@seance/ai/dist/grade.js +44 -0
- package/node_modules/@seance/ai/dist/grade.js.map +1 -0
- package/node_modules/@seance/ai/dist/hosted-config.d.ts +9 -0
- package/node_modules/@seance/ai/dist/hosted-config.js +27 -0
- package/node_modules/@seance/ai/dist/hosted-config.js.map +1 -0
- package/node_modules/@seance/ai/dist/index.d.ts +9 -0
- package/node_modules/@seance/ai/dist/index.js +9 -0
- package/node_modules/@seance/ai/dist/index.js.map +1 -0
- package/node_modules/@seance/ai/dist/providers.d.ts +54 -0
- package/node_modules/@seance/ai/dist/providers.js +149 -0
- package/node_modules/@seance/ai/dist/providers.js.map +1 -0
- package/node_modules/@seance/ai/dist/quiz.d.ts +26 -0
- package/node_modules/@seance/ai/dist/quiz.js +41 -0
- package/node_modules/@seance/ai/dist/quiz.js.map +1 -0
- package/node_modules/@seance/ai/package.json +25 -0
- package/node_modules/@seance/core/LICENSE +21 -0
- package/node_modules/@seance/core/dist/ai-check.d.ts +58 -0
- package/node_modules/@seance/core/dist/ai-check.js +460 -0
- package/node_modules/@seance/core/dist/ai-check.js.map +1 -0
- package/node_modules/@seance/core/dist/ai-prompts.d.ts +29 -0
- package/node_modules/@seance/core/dist/ai-prompts.js +221 -0
- package/node_modules/@seance/core/dist/ai-prompts.js.map +1 -0
- package/node_modules/@seance/core/dist/ai-schemas.d.ts +155 -0
- package/node_modules/@seance/core/dist/ai-schemas.js +92 -0
- package/node_modules/@seance/core/dist/ai-schemas.js.map +1 -0
- package/node_modules/@seance/core/dist/api-client.d.ts +26 -0
- package/node_modules/@seance/core/dist/api-client.js +71 -0
- package/node_modules/@seance/core/dist/api-client.js.map +1 -0
- package/node_modules/@seance/core/dist/api-errors.d.ts +37 -0
- package/node_modules/@seance/core/dist/api-errors.js +66 -0
- package/node_modules/@seance/core/dist/api-errors.js.map +1 -0
- package/node_modules/@seance/core/dist/api-schemas.d.ts +284 -0
- package/node_modules/@seance/core/dist/api-schemas.js +67 -0
- package/node_modules/@seance/core/dist/api-schemas.js.map +1 -0
- package/node_modules/@seance/core/dist/decision-log.d.ts +73 -0
- package/node_modules/@seance/core/dist/decision-log.js +239 -0
- package/node_modules/@seance/core/dist/decision-log.js.map +1 -0
- package/node_modules/@seance/core/dist/dependency-guard.d.ts +20 -0
- package/node_modules/@seance/core/dist/dependency-guard.js +732 -0
- package/node_modules/@seance/core/dist/dependency-guard.js.map +1 -0
- package/node_modules/@seance/core/dist/gate.d.ts +11 -0
- package/node_modules/@seance/core/dist/gate.js +26 -0
- package/node_modules/@seance/core/dist/gate.js.map +1 -0
- package/node_modules/@seance/core/dist/git-parse.d.ts +11 -0
- package/node_modules/@seance/core/dist/git-parse.js +23 -0
- package/node_modules/@seance/core/dist/git-parse.js.map +1 -0
- package/node_modules/@seance/core/dist/index.d.ts +65 -0
- package/node_modules/@seance/core/dist/index.js +47 -0
- package/node_modules/@seance/core/dist/index.js.map +1 -0
- package/node_modules/@seance/core/dist/init-checklist.d.ts +153 -0
- package/node_modules/@seance/core/dist/init-checklist.js +200 -0
- package/node_modules/@seance/core/dist/init-checklist.js.map +1 -0
- package/node_modules/@seance/core/dist/init-detect.d.ts +9 -0
- package/node_modules/@seance/core/dist/init-detect.js +84 -0
- package/node_modules/@seance/core/dist/init-detect.js.map +1 -0
- package/node_modules/@seance/core/dist/init-templates.d.ts +36 -0
- package/node_modules/@seance/core/dist/init-templates.js +257 -0
- package/node_modules/@seance/core/dist/init-templates.js.map +1 -0
- package/node_modules/@seance/core/dist/map-basics.d.ts +13 -0
- package/node_modules/@seance/core/dist/map-basics.js +19 -0
- package/node_modules/@seance/core/dist/map-basics.js.map +1 -0
- package/node_modules/@seance/core/dist/map-summary.d.ts +5 -0
- package/node_modules/@seance/core/dist/map-summary.js +50 -0
- package/node_modules/@seance/core/dist/map-summary.js.map +1 -0
- package/node_modules/@seance/core/dist/markers.d.ts +51 -0
- package/node_modules/@seance/core/dist/markers.js +84 -0
- package/node_modules/@seance/core/dist/markers.js.map +1 -0
- package/node_modules/@seance/core/dist/mcp-quiz.d.ts +94 -0
- package/node_modules/@seance/core/dist/mcp-quiz.js +130 -0
- package/node_modules/@seance/core/dist/mcp-quiz.js.map +1 -0
- package/node_modules/@seance/core/dist/mcp-tools.d.ts +82 -0
- package/node_modules/@seance/core/dist/mcp-tools.js +136 -0
- package/node_modules/@seance/core/dist/mcp-tools.js.map +1 -0
- package/node_modules/@seance/core/dist/mcp-views.d.ts +21 -0
- package/node_modules/@seance/core/dist/mcp-views.js +83 -0
- package/node_modules/@seance/core/dist/mcp-views.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-assembly.d.ts +21 -0
- package/node_modules/@seance/core/dist/quiz-assembly.js +43 -0
- package/node_modules/@seance/core/dist/quiz-assembly.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-cards.d.ts +183 -0
- package/node_modules/@seance/core/dist/quiz-cards.js +215 -0
- package/node_modules/@seance/core/dist/quiz-cards.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-session.d.ts +67 -0
- package/node_modules/@seance/core/dist/quiz-session.js +141 -0
- package/node_modules/@seance/core/dist/quiz-session.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-subjects.d.ts +13 -0
- package/node_modules/@seance/core/dist/quiz-subjects.js +63 -0
- package/node_modules/@seance/core/dist/quiz-subjects.js.map +1 -0
- package/node_modules/@seance/core/dist/rate-limit.d.ts +33 -0
- package/node_modules/@seance/core/dist/rate-limit.js +114 -0
- package/node_modules/@seance/core/dist/rate-limit.js.map +1 -0
- package/node_modules/@seance/core/dist/scoring.d.ts +48 -0
- package/node_modules/@seance/core/dist/scoring.js +95 -0
- package/node_modules/@seance/core/dist/scoring.js.map +1 -0
- package/node_modules/@seance/core/dist/seance-config.d.ts +177 -0
- package/node_modules/@seance/core/dist/seance-config.js +43 -0
- package/node_modules/@seance/core/dist/seance-config.js.map +1 -0
- package/node_modules/@seance/core/dist/seance-state.d.ts +125 -0
- package/node_modules/@seance/core/dist/seance-state.js +61 -0
- package/node_modules/@seance/core/dist/seance-state.js.map +1 -0
- package/node_modules/@seance/core/dist/sm2.d.ts +18 -0
- package/node_modules/@seance/core/dist/sm2.js +87 -0
- package/node_modules/@seance/core/dist/sm2.js.map +1 -0
- package/node_modules/@seance/core/dist/stored-schemas.d.ts +29 -0
- package/node_modules/@seance/core/dist/stored-schemas.js +29 -0
- package/node_modules/@seance/core/dist/stored-schemas.js.map +1 -0
- package/node_modules/@seance/core/dist/structural-questions.d.ts +31 -0
- package/node_modules/@seance/core/dist/structural-questions.js +575 -0
- package/node_modules/@seance/core/dist/structural-questions.js.map +1 -0
- package/node_modules/@seance/core/dist/structure-map-schema.d.ts +84 -0
- package/node_modules/@seance/core/dist/structure-map-schema.js +73 -0
- package/node_modules/@seance/core/dist/structure-map-schema.js.map +1 -0
- package/node_modules/@seance/core/dist/structure-map.d.ts +78 -0
- package/node_modules/@seance/core/dist/structure-map.js +750 -0
- package/node_modules/@seance/core/dist/structure-map.js.map +1 -0
- package/node_modules/@seance/core/dist/sync-changes.d.ts +38 -0
- package/node_modules/@seance/core/dist/sync-changes.js +89 -0
- package/node_modules/@seance/core/dist/sync-changes.js.map +1 -0
- package/node_modules/@seance/core/dist/sync-render.d.ts +28 -0
- package/node_modules/@seance/core/dist/sync-render.js +113 -0
- package/node_modules/@seance/core/dist/sync-render.js.map +1 -0
- package/node_modules/@seance/core/dist/terminal-text.d.ts +8 -0
- package/node_modules/@seance/core/dist/terminal-text.js +33 -0
- package/node_modules/@seance/core/dist/terminal-text.js.map +1 -0
- package/node_modules/@seance/core/dist/write-plan.d.ts +51 -0
- package/node_modules/@seance/core/dist/write-plan.js +173 -0
- package/node_modules/@seance/core/dist/write-plan.js.map +1 -0
- package/node_modules/@seance/core/package.json +26 -0
- package/package.json +42 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The caps of a map that is checked with `StructureMapSchema`. */
|
|
3
|
+
export declare const MAP_SCHEMA_LIMITS: {
|
|
4
|
+
readonly maxFiles: 50;
|
|
5
|
+
readonly maxListEntries: 2000;
|
|
6
|
+
readonly maxNameChars: 500;
|
|
7
|
+
readonly maxMessageChars: 1000;
|
|
8
|
+
readonly maxLine: 10000000;
|
|
9
|
+
};
|
|
10
|
+
export declare const StructureMapSchema: z.ZodObject<{
|
|
11
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
12
|
+
files: z.ZodArray<z.ZodObject<{
|
|
13
|
+
path: z.ZodString;
|
|
14
|
+
language: z.ZodEnum<{
|
|
15
|
+
css: "css";
|
|
16
|
+
html: "html";
|
|
17
|
+
javascript: "javascript";
|
|
18
|
+
json: "json";
|
|
19
|
+
markdown: "markdown";
|
|
20
|
+
other: "other";
|
|
21
|
+
python: "python";
|
|
22
|
+
typescript: "typescript";
|
|
23
|
+
}>;
|
|
24
|
+
lines: z.ZodInt;
|
|
25
|
+
parsed: z.ZodBoolean;
|
|
26
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
27
|
+
message: z.ZodString;
|
|
28
|
+
line: z.ZodInt;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
imports: z.ZodArray<z.ZodObject<{
|
|
31
|
+
source: z.ZodString;
|
|
32
|
+
kind: z.ZodEnum<{
|
|
33
|
+
import: "import";
|
|
34
|
+
require: "require";
|
|
35
|
+
}>;
|
|
36
|
+
defaultName: z.ZodOptional<z.ZodString>;
|
|
37
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
38
|
+
names: z.ZodArray<z.ZodString>;
|
|
39
|
+
typeOnly: z.ZodBoolean;
|
|
40
|
+
line: z.ZodInt;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
exports: z.ZodArray<z.ZodObject<{
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
kind: z.ZodEnum<{
|
|
45
|
+
default: "default";
|
|
46
|
+
named: "named";
|
|
47
|
+
reexport: "reexport";
|
|
48
|
+
}>;
|
|
49
|
+
from: z.ZodOptional<z.ZodString>;
|
|
50
|
+
line: z.ZodInt;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
functions: z.ZodArray<z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
params: z.ZodInt;
|
|
55
|
+
plainParams: z.ZodBoolean;
|
|
56
|
+
async: z.ZodBoolean;
|
|
57
|
+
line: z.ZodInt;
|
|
58
|
+
calls: z.ZodArray<z.ZodString>;
|
|
59
|
+
calledNames: z.ZodArray<z.ZodString>;
|
|
60
|
+
mentionedNames: z.ZodArray<z.ZodString>;
|
|
61
|
+
exported: z.ZodBoolean;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
classes: z.ZodArray<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
exported: z.ZodBoolean;
|
|
66
|
+
line: z.ZodInt;
|
|
67
|
+
superClass: z.ZodOptional<z.ZodString>;
|
|
68
|
+
accessors: z.ZodArray<z.ZodString>;
|
|
69
|
+
methods: z.ZodArray<z.ZodObject<{
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
params: z.ZodInt;
|
|
72
|
+
plainParams: z.ZodBoolean;
|
|
73
|
+
async: z.ZodBoolean;
|
|
74
|
+
line: z.ZodInt;
|
|
75
|
+
calls: z.ZodArray<z.ZodString>;
|
|
76
|
+
calledNames: z.ZodArray<z.ZodString>;
|
|
77
|
+
mentionedNames: z.ZodArray<z.ZodString>;
|
|
78
|
+
static: z.ZodBoolean;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
commonjsExports: z.ZodArray<z.ZodString>;
|
|
82
|
+
hasUnknownExports: z.ZodBoolean;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// A zod schema with size caps for the StructureMap (Task 8). The hosted API checks the map it built with it,
|
|
2
|
+
// and the web app (Task 9) checks maps it reads back from responses or localStorage. Pure: no I/O.
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
/** The caps of a map that is checked with `StructureMapSchema`. */
|
|
5
|
+
export const MAP_SCHEMA_LIMITS = {
|
|
6
|
+
maxFiles: 50,
|
|
7
|
+
maxListEntries: 2_000,
|
|
8
|
+
maxNameChars: 500,
|
|
9
|
+
maxMessageChars: 1_000,
|
|
10
|
+
maxLine: 10_000_000,
|
|
11
|
+
};
|
|
12
|
+
const text = z.string().min(1).max(MAP_SCHEMA_LIMITS.maxNameChars);
|
|
13
|
+
const line = z.int().min(0).max(MAP_SCHEMA_LIMITS.maxLine);
|
|
14
|
+
const params = z.int().min(0).max(10_000);
|
|
15
|
+
const list = (item) => z.array(item).max(MAP_SCHEMA_LIMITS.maxListEntries);
|
|
16
|
+
const languageSchema = z.enum(["javascript", "typescript", "python", "json", "markdown", "css", "html", "other"]);
|
|
17
|
+
const importSchema = z.object({
|
|
18
|
+
source: text,
|
|
19
|
+
kind: z.enum(["import", "require"]),
|
|
20
|
+
defaultName: text.optional(),
|
|
21
|
+
namespace: text.optional(),
|
|
22
|
+
names: list(text),
|
|
23
|
+
typeOnly: z.boolean(),
|
|
24
|
+
line,
|
|
25
|
+
});
|
|
26
|
+
const exportSchema = z.object({
|
|
27
|
+
name: text, // `export *` is recorded with the name "*"
|
|
28
|
+
kind: z.enum(["named", "default", "reexport"]),
|
|
29
|
+
from: text.optional(),
|
|
30
|
+
line,
|
|
31
|
+
});
|
|
32
|
+
const callable = {
|
|
33
|
+
name: text,
|
|
34
|
+
params,
|
|
35
|
+
plainParams: z.boolean(),
|
|
36
|
+
async: z.boolean(),
|
|
37
|
+
line,
|
|
38
|
+
calls: list(text),
|
|
39
|
+
calledNames: list(text),
|
|
40
|
+
mentionedNames: list(text),
|
|
41
|
+
};
|
|
42
|
+
const functionSchema = z.object({ ...callable, exported: z.boolean() });
|
|
43
|
+
const methodSchema = z.object({ ...callable, static: z.boolean() });
|
|
44
|
+
const classSchema = z.object({
|
|
45
|
+
name: text,
|
|
46
|
+
exported: z.boolean(),
|
|
47
|
+
line,
|
|
48
|
+
superClass: text.optional(),
|
|
49
|
+
accessors: list(text),
|
|
50
|
+
methods: list(methodSchema),
|
|
51
|
+
});
|
|
52
|
+
const issueSchema = z.object({ message: z.string().max(MAP_SCHEMA_LIMITS.maxMessageChars), line });
|
|
53
|
+
const fileSchema = z.object({
|
|
54
|
+
path: text,
|
|
55
|
+
language: languageSchema,
|
|
56
|
+
lines: line,
|
|
57
|
+
parsed: z.boolean(),
|
|
58
|
+
errors: list(issueSchema),
|
|
59
|
+
imports: list(importSchema),
|
|
60
|
+
exports: list(exportSchema),
|
|
61
|
+
functions: list(functionSchema),
|
|
62
|
+
classes: list(classSchema),
|
|
63
|
+
commonjsExports: list(text),
|
|
64
|
+
hasUnknownExports: z.boolean(),
|
|
65
|
+
});
|
|
66
|
+
export const StructureMapSchema = z.object({
|
|
67
|
+
schemaVersion: z.literal(1),
|
|
68
|
+
files: z.array(fileSchema).max(MAP_SCHEMA_LIMITS.maxFiles),
|
|
69
|
+
});
|
|
70
|
+
// Type test: a map that passes the schema is a StructureMap (this line fails to compile if the two drift apart).
|
|
71
|
+
const _typeTest = (map) => map;
|
|
72
|
+
void _typeTest;
|
|
73
|
+
//# sourceMappingURL=structure-map-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-map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,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAEnG,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC;IACzB,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC;IAC3B,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC;IAC/B,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC;IAC1B,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC;IAC3B,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC;CAC3D,CAAC,CAAC;AAEH,iHAAiH;AACjH,MAAM,SAAS,GAA8D,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;AAC1F,KAAK,SAAS,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { MAP_LIMITS, MAX_MENTIONED_NAMES, UNKNOWN_SUPERCLASS, normalisePath } from "./map-basics.js";
|
|
2
|
+
export { MAP_LIMITS, MAX_MENTIONED_NAMES, UNKNOWN_SUPERCLASS, normalisePath };
|
|
3
|
+
export type Language = "javascript" | "typescript" | "python" | "json" | "markdown" | "css" | "html" | "other";
|
|
4
|
+
export interface ImportEntry {
|
|
5
|
+
source: string;
|
|
6
|
+
kind: "import" | "require";
|
|
7
|
+
defaultName?: string;
|
|
8
|
+
namespace?: string;
|
|
9
|
+
names: string[];
|
|
10
|
+
typeOnly: boolean;
|
|
11
|
+
line: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ExportEntry {
|
|
14
|
+
name: string;
|
|
15
|
+
kind: "named" | "default" | "reexport";
|
|
16
|
+
from?: string;
|
|
17
|
+
line: number;
|
|
18
|
+
}
|
|
19
|
+
export interface FunctionEntry {
|
|
20
|
+
name: string;
|
|
21
|
+
params: number;
|
|
22
|
+
plainParams: boolean;
|
|
23
|
+
async: boolean;
|
|
24
|
+
exported: boolean;
|
|
25
|
+
line: number;
|
|
26
|
+
calls: string[];
|
|
27
|
+
calledNames: string[];
|
|
28
|
+
mentionedNames: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface MethodEntry {
|
|
31
|
+
name: string;
|
|
32
|
+
params: number;
|
|
33
|
+
plainParams: boolean;
|
|
34
|
+
async: boolean;
|
|
35
|
+
static: boolean;
|
|
36
|
+
line: number;
|
|
37
|
+
calls: string[];
|
|
38
|
+
calledNames: string[];
|
|
39
|
+
mentionedNames: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface ClassEntry {
|
|
42
|
+
name: string;
|
|
43
|
+
exported: boolean;
|
|
44
|
+
line: number;
|
|
45
|
+
superClass?: string;
|
|
46
|
+
accessors: string[];
|
|
47
|
+
methods: MethodEntry[];
|
|
48
|
+
}
|
|
49
|
+
/** One parse problem. `line` is 0 when Babel gives no position. */
|
|
50
|
+
export interface ParseIssue {
|
|
51
|
+
message: string;
|
|
52
|
+
line: number;
|
|
53
|
+
}
|
|
54
|
+
export interface FileEntry {
|
|
55
|
+
path: string;
|
|
56
|
+
language: Language;
|
|
57
|
+
lines: number;
|
|
58
|
+
parsed: boolean;
|
|
59
|
+
errors: ParseIssue[];
|
|
60
|
+
imports: ImportEntry[];
|
|
61
|
+
exports: ExportEntry[];
|
|
62
|
+
functions: FunctionEntry[];
|
|
63
|
+
classes: ClassEntry[];
|
|
64
|
+
/** Names from top-level `exports.x =`, `module.exports.x =` and `module.exports = { a, b }`; `default` for `module.exports = value`. */
|
|
65
|
+
commonjsExports: string[];
|
|
66
|
+
/** True when `module.exports` is given something whose names cannot be read (`module.exports = make()`, a spread). */
|
|
67
|
+
hasUnknownExports: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface StructureMap {
|
|
70
|
+
schemaVersion: 1;
|
|
71
|
+
files: FileEntry[];
|
|
72
|
+
}
|
|
73
|
+
export interface SourceFile {
|
|
74
|
+
path: string;
|
|
75
|
+
content: string;
|
|
76
|
+
}
|
|
77
|
+
/** Builds the structure map of up to 50 files (100 KB in total). Throws RangeError for bad input only. */
|
|
78
|
+
export declare function buildStructureMap(files: SourceFile[]): StructureMap;
|