@hegel-dev/companion 1.0.8 → 1.0.10
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/README.md +15 -2
- package/dist/commands/cleanup.d.ts +3 -0
- package/dist/commands/cleanup.d.ts.map +1 -0
- package/dist/commands/cleanup.js +51 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +142 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/types.d.ts +22 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +23 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +90 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/config.d.ts +0 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/hook.d.ts +0 -17
- package/dist/hook.d.ts.map +1 -1
- package/dist/hook.js +3 -26
- package/dist/hook.js.map +1 -1
- package/dist/hooks-generator.d.ts +0 -4
- package/dist/hooks-generator.d.ts.map +1 -1
- package/dist/hooks-generator.js +2 -7
- package/dist/hooks-generator.js.map +1 -1
- package/dist/prompts.d.ts +2 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +4 -24
- package/dist/prompts.js.map +1 -1
- package/dist/setup.d.ts +9 -90
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +24 -548
- package/dist/setup.js.map +1 -1
- package/dist/utils/install.d.ts +13 -0
- package/dist/utils/install.d.ts.map +1 -0
- package/dist/utils/install.js +112 -0
- package/dist/utils/install.js.map +1 -0
- package/dist/utils/package-manager.d.ts +11 -0
- package/dist/utils/package-manager.d.ts.map +1 -0
- package/dist/utils/package-manager.js +44 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/path.d.ts +15 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +20 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/workspace.d.ts +13 -0
- package/dist/utils/workspace.d.ts.map +1 -0
- package/dist/utils/workspace.js +79 -0
- package/dist/utils/workspace.js.map +1 -0
- package/hegel-vscode/hegel-companion-1.0.10.vsix +0 -0
- package/hegel.config.schema.json +0 -5
- package/package.json +7 -7
- package/hegel-vscode/hegel-companion-1.0.8.vsix +0 -0
|
@@ -31,10 +31,6 @@ export declare function readExistingHash(hooksFilePath: string): Promise<string
|
|
|
31
31
|
* the sessionStart hot-reload check.
|
|
32
32
|
*/
|
|
33
33
|
export declare function generateHooksConfig(config: HegelConfig): HooksConfig;
|
|
34
|
-
/**
|
|
35
|
-
* Writes hooks.json to a target project directory.
|
|
36
|
-
* Returns true if the file was written, false if no update was needed.
|
|
37
|
-
*/
|
|
38
34
|
/**
|
|
39
35
|
* Writes hooks.json to a target project directory.
|
|
40
36
|
* Returns true if the file was written, false if no update was needed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-generator.d.ts","sourceRoot":"","sources":["../src/hooks-generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/C,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"hooks-generator.d.ts","sourceRoot":"","sources":["../src/hooks-generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/C,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAWtD;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQpF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CA0DpE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,WAAW,EACnB,KAAK,UAAQ,GACZ,OAAO,CAAC,OAAO,CAAC,CAclB"}
|
package/dist/hooks-generator.js
CHANGED
|
@@ -14,7 +14,6 @@ export function configHash(config) {
|
|
|
14
14
|
const significant = {
|
|
15
15
|
enableLlmAnalysis: config.enableLlmAnalysis,
|
|
16
16
|
strictness: config.strictness,
|
|
17
|
-
observeOnly: config.observeOnly,
|
|
18
17
|
model: config.model,
|
|
19
18
|
timeoutSeconds: config.timeoutSeconds,
|
|
20
19
|
};
|
|
@@ -73,8 +72,8 @@ export function generateHooksConfig(config) {
|
|
|
73
72
|
},
|
|
74
73
|
};
|
|
75
74
|
if (config.enableLlmAnalysis) {
|
|
76
|
-
const promptAnalysis = buildPromptAnalysisPrompt(config.strictness
|
|
77
|
-
const responseAnalysis = buildResponseAnalysisPrompt(config.strictness
|
|
75
|
+
const promptAnalysis = buildPromptAnalysisPrompt(config.strictness);
|
|
76
|
+
const responseAnalysis = buildResponseAnalysisPrompt(config.strictness);
|
|
78
77
|
const promptHook = {
|
|
79
78
|
type: "prompt",
|
|
80
79
|
prompt: promptAnalysis,
|
|
@@ -94,10 +93,6 @@ export function generateHooksConfig(config) {
|
|
|
94
93
|
}
|
|
95
94
|
return hooks;
|
|
96
95
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Writes hooks.json to a target project directory.
|
|
99
|
-
* Returns true if the file was written, false if no update was needed.
|
|
100
|
-
*/
|
|
101
96
|
/**
|
|
102
97
|
* Writes hooks.json to a target project directory.
|
|
103
98
|
* Returns true if the file was written, false if no update was needed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-generator.js","sourceRoot":"","sources":["../src/hooks-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAEtF,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC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AC;QACvC,IAAI,YAAY,KAAK,WAAW;YAAE,OAAO,KAAK,CAAC;IACjD,CAAC;IAED,MAAM,KAAK,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAM,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/prompts.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* $ARGUMENTS is auto-replaced with the hook input JSON.
|
|
7
7
|
*/
|
|
8
8
|
export type StrictnessLevel = "relaxed" | "balanced" | "strict";
|
|
9
|
-
export declare function buildPromptAnalysisPrompt(strictness: StrictnessLevel
|
|
10
|
-
export declare function buildResponseAnalysisPrompt(strictness: StrictnessLevel
|
|
9
|
+
export declare function buildPromptAnalysisPrompt(strictness: StrictnessLevel): string;
|
|
10
|
+
export declare function buildResponseAnalysisPrompt(strictness: StrictnessLevel): string;
|
|
11
11
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAWhE,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAWhE,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CA0B7E;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAwB/E"}
|
package/dist/prompts.js
CHANGED
|
@@ -10,22 +10,12 @@ const STRICTNESS_GUIDANCE = {
|
|
|
10
10
|
balanced: "Flag prompts that lack specificity, miss acceptance criteria for significant tasks, or skip verification after major changes. Allow clear, purposeful prompts even if brief.",
|
|
11
11
|
strict: "Scrutinize every prompt rigorously. Question assumptions, demand explicit acceptance criteria, flag any missing context, and challenge prompts that don't reference specific files or behaviors.",
|
|
12
12
|
};
|
|
13
|
-
export function buildPromptAnalysisPrompt(strictness
|
|
14
|
-
const bypassBlock = bypass
|
|
15
|
-
? `## OBSERVE-ONLY MODE (ACTIVE)
|
|
16
|
-
|
|
17
|
-
You are in observe-only mode. This is a hard rule that overrides everything below.
|
|
18
|
-
- **You MUST always return ok=true.** Never return ok=false. Never block the prompt.
|
|
19
|
-
- Still provide your full analysis in the reason field so it gets logged for tuning.
|
|
20
|
-
- Format the reason as: "OBSERVE: <your analysis here>"
|
|
21
|
-
|
|
22
|
-
`
|
|
23
|
-
: "";
|
|
13
|
+
export function buildPromptAnalysisPrompt(strictness) {
|
|
24
14
|
return `You are Hegel, a dialectical critical thinking companion for AI-assisted software development.
|
|
25
15
|
|
|
26
16
|
Your role: analyze the developer's prompt BEFORE it reaches the AI coding assistant. You are the antithesis — challenging the thesis (the prompt) so the developer reaches a better synthesis.
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
## Evaluation criteria
|
|
29
19
|
|
|
30
20
|
1. **Clarity**: Is the intent specific enough for an AI to act on without guessing?
|
|
31
21
|
2. **Context**: Does the prompt reference concrete files, functions, behaviors, or error messages — or does it rely on ambiguous pronouns and implicit context?
|
|
@@ -47,22 +37,12 @@ Analyze the user prompt provided in $ARGUMENTS (the "prompt" field).
|
|
|
47
37
|
- Do NOT flag follow-up directives that reference items from a previous AI response (e.g., "fix #3 and #5" referencing a numbered list the AI just provided).
|
|
48
38
|
- Focus on prompts that will lead to CODE CHANGES without sufficient guidance.`;
|
|
49
39
|
}
|
|
50
|
-
export function buildResponseAnalysisPrompt(strictness
|
|
51
|
-
const bypassBlock = bypass
|
|
52
|
-
? `## OBSERVE-ONLY MODE (ACTIVE)
|
|
53
|
-
|
|
54
|
-
You are in observe-only mode. This is a hard rule that overrides everything below.
|
|
55
|
-
- **You MUST always return ok=true.** Never return ok=false. Never block the response.
|
|
56
|
-
- Still provide your full analysis in the reason field so it gets logged for tuning.
|
|
57
|
-
- Format the reason as: "OBSERVE: <your analysis here>"
|
|
58
|
-
|
|
59
|
-
`
|
|
60
|
-
: "";
|
|
40
|
+
export function buildResponseAnalysisPrompt(strictness) {
|
|
61
41
|
return `You are Hegel, a dialectical critical thinking companion reviewing an AI coding assistant's response.
|
|
62
42
|
|
|
63
43
|
Your role: identify red flags in the AI's output that the developer should be aware of before accepting the changes.
|
|
64
44
|
|
|
65
|
-
|
|
45
|
+
## What to look for
|
|
66
46
|
|
|
67
47
|
1. **Overconfidence**: Claims like "this will definitely work" or "all issues resolved" without caveats
|
|
68
48
|
2. **Missing edge cases**: The AI solved the happy path but didn't mention error handling, boundary conditions, or failure modes
|
package/dist/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,mBAAmB,GAAoC;IAC3D,OAAO,EACL,oKAAoK;IACtK,QAAQ,EACN,8KAA8K;IAChL,MAAM,EACJ,kMAAkM;CACrM,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,UAA2B
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,mBAAmB,GAAoC;IAC3D,OAAO,EACL,oKAAoK;IACtK,QAAQ,EACN,8KAA8K;IAChL,MAAM,EACJ,kMAAkM;CACrM,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,UAA2B;IACnE,OAAO;;;;;;;;;;;;uBAYc,UAAU;EAC/B,mBAAmB,CAAC,UAAU,CAAC;;;;;;;;;;;+EAW8C,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,UAA2B;IACrE,OAAO;;;;;;;;;;;;;uBAac,UAAU;EAC/B,mBAAmB,CAAC,UAAU,CAAC;;;;;;;;uGAQsE,CAAC;AACxG,CAAC"}
|
package/dist/setup.d.ts
CHANGED
|
@@ -1,93 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
writeFile: typeof writeFile;
|
|
12
|
-
readdir: typeof readdir;
|
|
13
|
-
readFile: typeof readFile;
|
|
14
|
-
access: typeof access;
|
|
15
|
-
rm: typeof rm;
|
|
16
|
-
execFileSync: typeof execFileSync;
|
|
17
|
-
log: (message: string) => void;
|
|
18
|
-
error: (message: string) => void;
|
|
19
|
-
resolveHegelRoot: () => string;
|
|
20
|
-
platform?: NodeJS.Platform;
|
|
21
|
-
env?: NodeJS.ProcessEnv;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Walks up from `startDir` (exclusive) looking for an ancestor that already
|
|
25
|
-
* contains a Hegel install (hegel.config.json + .cursor/hooks.json).
|
|
26
|
-
* Returns the ancestor path if found, or null. Stops at the filesystem root.
|
|
27
|
-
*/
|
|
28
|
-
export declare function findAncestorHegelInstall(startDir: string, accessFn?: typeof access): Promise<string | null>;
|
|
2
|
+
export * from "./commands/types.js";
|
|
3
|
+
export * from "./utils/workspace.js";
|
|
4
|
+
export * from "./utils/install.js";
|
|
5
|
+
export * from "./utils/package-manager.js";
|
|
6
|
+
export * from "./utils/path.js";
|
|
7
|
+
import { runUpdate } from "./commands/update.js";
|
|
8
|
+
import { runCleanup } from "./commands/cleanup.js";
|
|
9
|
+
import { type SetupDeps } from "./commands/types.js";
|
|
10
|
+
export { runUpdate, runCleanup };
|
|
29
11
|
export declare function runSetup(argv?: string[], deps?: SetupDeps): Promise<number>;
|
|
30
|
-
/**
|
|
31
|
-
* Result of attempting to install the bundled VS Code extension.
|
|
32
|
-
*
|
|
33
|
-
* In 1.0.0–1.0.2 this was a silent `try { ... } catch { log("Could not ...") }`,
|
|
34
|
-
* which meant `cursor` CLI ENOENT (the common failure when running from a
|
|
35
|
-
* non-Cursor terminal) surfaced only as a one-liner mid-output that users
|
|
36
|
-
* missed. 1.0.3 makes the failure loud, actionable, and appended at the end
|
|
37
|
-
* of the init output so it is the last thing on screen. 1.0.4 auto-discovers
|
|
38
|
-
* well-known Cursor install paths when the CLI isn't on PATH so the user
|
|
39
|
-
* doesn't have to switch shells — see getCursorCliCandidates below.
|
|
40
|
-
*/
|
|
41
|
-
export type ExtensionInstallStatus = "installed" | "vsix-not-found" | "cursor-cli-missing" | "install-failed";
|
|
42
|
-
export interface ExtensionInstallResult {
|
|
43
|
-
status: ExtensionInstallStatus;
|
|
44
|
-
vsixPath?: string;
|
|
45
|
-
reason?: string;
|
|
46
|
-
/** Non-PATH absolute path used, if auto-discovery kicked in. */
|
|
47
|
-
usedCursorPath?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Well-known absolute paths where Cursor installs the `cursor` CLI shim.
|
|
51
|
-
* Returned in priority order — first existing candidate wins. We intentionally
|
|
52
|
-
* probe only well-documented install locations: user-scoped first (most
|
|
53
|
-
* common), then system-scoped.
|
|
54
|
-
*
|
|
55
|
-
* Windows candidates end in .cmd because Node's execFileSync needs the shim,
|
|
56
|
-
* not the Electron binary (Cursor.exe) which would try to launch a second IDE
|
|
57
|
-
* window rather than run the CLI.
|
|
58
|
-
*/
|
|
59
|
-
export declare function getCursorCliCandidates(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string[];
|
|
60
|
-
export declare function installVsCodeExtension(vscodeDir: string, deps: SetupDeps): Promise<ExtensionInstallResult>;
|
|
61
|
-
interface PruneResult {
|
|
62
|
-
pruned: string[];
|
|
63
|
-
skipped: {
|
|
64
|
-
path: string;
|
|
65
|
-
reason: string;
|
|
66
|
-
}[];
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Removes orphan Hegel installs left behind by past CLI mistakes
|
|
70
|
-
* (`init hegel-mcp`, `init init`). Only removes a candidate dir if it
|
|
71
|
-
* contains a Hegel marker file — never deletes user code directories that
|
|
72
|
-
* happen to share the name.
|
|
73
|
-
*/
|
|
74
|
-
export declare function pruneOrphanInstalls(projectPath: string, deps: Pick<SetupDeps, "access" | "rm" | "log">): Promise<PruneResult>;
|
|
75
|
-
/**
|
|
76
|
-
* Reads the version of @hegel-dev/companion from the consumer's
|
|
77
|
-
* node_modules/, returning null if not installed (e.g. source-repo mode).
|
|
78
|
-
*/
|
|
79
|
-
export declare function readInstalledCompanionVersion(projectPath: string, readFileFn?: typeof readFile): Promise<string | null>;
|
|
80
|
-
/**
|
|
81
|
-
* `update` subcommand. Single-step refresh path for downstream projects:
|
|
82
|
-
* 1. Refuses if no Hegel install present (hint to use `init`).
|
|
83
|
-
* 2. Detects source-repo mode and skips npm install in that case.
|
|
84
|
-
* 3. Runs `npm install @hegel-dev/companion@latest` (skippable via --skip-npm).
|
|
85
|
-
* 4. Re-runs setup with --force so hooks.json regenerates, MCP re-registers,
|
|
86
|
-
* and the bundled VSIX is reinstalled (with 1.0.4 auto-discovery).
|
|
87
|
-
* 5. Prunes orphan `hegel-mcp/` and `init/` directories left over from past
|
|
88
|
-
* CLI mistakes (only when those dirs contain a Hegel marker file).
|
|
89
|
-
* 6. Prints the new installed version + the Cursor full-quit reminder.
|
|
90
|
-
*/
|
|
91
|
-
export declare function runUpdate(argv?: string[], deps?: SetupDeps): Promise<number>;
|
|
92
|
-
export {};
|
|
93
12
|
//# sourceMappingURL=setup.d.ts.map
|
package/dist/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAKA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAIhC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAEjC,wBAAsB,QAAQ,CAC5B,IAAI,GAAE,MAAM,EAAiB,EAC7B,IAAI,GAAE,SAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAqDjB"}
|