@happyvertical/smrt-dev-mcp 0.51.27 → 0.51.33
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/AGENTS.md +40 -3
- package/README.md +35 -3
- package/dist/dev-plane.d.ts.map +1 -1
- package/dist/dev-plane.js +6 -4
- package/dist/dev-plane.js.map +1 -1
- package/dist/{http-TeoaK9Xr.js → http-C302xXnO.js} +5 -4
- package/dist/{http-TeoaK9Xr.js.map → http-C302xXnO.js.map} +1 -1
- package/dist/http.d.ts +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -454
- package/dist/index.js.map +1 -1
- package/dist/introspect-project-Peu2LC2T.js +490 -0
- package/dist/introspect-project-Peu2LC2T.js.map +1 -0
- package/dist/knowledge/index.d.ts +3 -1
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/mcp-docs.d.ts +1 -1
- package/dist/{knowledge-DYe5lCfq.js → knowledge-CvNlDTLz.js} +9 -6
- package/dist/knowledge-CvNlDTLz.js.map +1 -0
- package/dist/knowledge.js +2 -2
- package/dist/observation-CqE0tBgS.js +386 -0
- package/dist/observation-CqE0tBgS.js.map +1 -0
- package/dist/runtime-test-fixture.d.ts +3 -0
- package/dist/runtime-test-fixture.d.ts.map +1 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -1
- package/dist/runtime.js.map +1 -1
- package/dist/{tool-catalog-Zl-bcimC.js → tool-catalog-RHq7nyCm.js} +26 -2
- package/dist/tool-catalog-RHq7nyCm.js.map +1 -0
- package/dist/tool-catalog.d.ts +1 -1
- package/dist/tool-catalog.d.ts.map +1 -1
- package/dist/tools/introspect-project.d.ts.map +1 -1
- package/dist/tools/runtime/boot.d.ts.map +1 -1
- package/dist/tools/runtime/connection.d.ts +23 -3
- package/dist/tools/runtime/connection.d.ts.map +1 -1
- package/dist/tools/runtime/observation.d.ts +17 -12
- package/dist/tools/runtime/observation.d.ts.map +1 -1
- package/dist/tools/runtime/project-runtime.d.ts +16 -0
- package/dist/tools/runtime/project-runtime.d.ts.map +1 -0
- package/dist/tools/runtime/tools.d.ts +23 -3
- package/dist/tools/runtime/tools.d.ts.map +1 -1
- package/dist/tools-ma2JFPVY.js +568 -0
- package/dist/tools-ma2JFPVY.js.map +1 -0
- package/package.json +11 -9
- package/dist/knowledge-DYe5lCfq.js.map +0 -1
- package/dist/observation-VJgHaPps.js +0 -802
- package/dist/observation-VJgHaPps.js.map +0 -1
- package/dist/tool-catalog-Zl-bcimC.js.map +0 -1
package/dist/tool-catalog.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-catalog.d.ts","sourceRoot":"","sources":["../src/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-catalog.d.ts","sourceRoot":"","sources":["../src/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAkoBpD,eAAO,MAAM,KAAK,EAAE,IAAI,EAO0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspect-project.d.ts","sourceRoot":"","sources":["../../src/tools/introspect-project.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"introspect-project.d.ts","sourceRoot":"","sources":["../../src/tools/introspect-project.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAC;AAKlD,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuHD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAuHjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAQzD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,IAAI,EAAE,SAAS,GAAG,YAAY,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,OAAO,mBAAmB,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AAgED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAwBA;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAEpD;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,IAAI,IAAI,CAO/C;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,WAAW,CAAC,CAoBtB"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Optional read-only dev-database connection resolution for runtime
|
|
3
|
+
* diagnostics tools (#1824).
|
|
4
|
+
*
|
|
5
|
+
* Resolution order per call:
|
|
6
|
+
* 1. explicit `dbUrl`/`dbType` tool arguments
|
|
7
|
+
* 2. `SMRT_DEV_DB_URL` environment variable
|
|
8
|
+
* 3. the project's cosmiconfig CLI section (`getPackageConfig('cli', ...)`
|
|
9
|
+
* from `@happyvertical/smrt-config`) → `database.{type,url}`
|
|
10
|
+
*
|
|
11
|
+
* No configured connection → `db: null` with `source: 'none'`; callers return
|
|
12
|
+
* a successful static-only envelope. A connection is always opened lazily per
|
|
13
|
+
* call and closed in the caller's `finally` — nothing is cached across calls
|
|
14
|
+
* and the server never holds a database handle.
|
|
15
|
+
*
|
|
16
|
+
* Sensitive handling: connection strings are never logged or echoed. Every
|
|
17
|
+
* surfaced URL passes through {@link redactConnectionString}; driver errors
|
|
18
|
+
* are surfaced only through {@link safeErrorMessage}, which strips anything
|
|
19
|
+
* that looks like a credential-bearing URL.
|
|
20
|
+
*/
|
|
2
21
|
/** Engine labels `@happyvertical/sql`'s `getDatabase` accepts. */
|
|
3
22
|
export type RuntimeDatabaseType = 'sqlite' | 'postgres' | 'duckdb';
|
|
4
23
|
/** Tool arguments every runtime-diagnostics tool accepts. */
|
|
5
24
|
export interface RuntimeDatabaseArgs {
|
|
25
|
+
projectPath?: string;
|
|
6
26
|
/** Optional database URL/connection string (overrides env and config). */
|
|
7
27
|
dbUrl?: string;
|
|
8
28
|
/**
|
|
@@ -17,7 +37,7 @@ export interface RuntimeDatabaseArgs {
|
|
|
17
37
|
export type ConnectionSource = 'argument' | 'environment' | 'config' | 'none';
|
|
18
38
|
export interface ResolvedRuntimeConnection {
|
|
19
39
|
/** Open connection, or `null` when no connection is configured. */
|
|
20
|
-
db:
|
|
40
|
+
db: unknown | null;
|
|
21
41
|
source: ConnectionSource;
|
|
22
42
|
/** Redacted connection string for display; '' when no connection. */
|
|
23
43
|
displayUrl: string;
|
|
@@ -71,7 +91,7 @@ export declare function inferDatabaseType(url: string, hint?: string): string;
|
|
|
71
91
|
* `:memory:` as well as the `sqlite::memory:` / `sqlite://:memory:` spellings.
|
|
72
92
|
*/
|
|
73
93
|
export declare function isMemoryDatabaseUrl(url: string): boolean;
|
|
74
|
-
export declare function normalizeDatabaseUrl(url: string): string;
|
|
94
|
+
export declare function normalizeDatabaseUrl(url: string, projectPath?: string): string;
|
|
75
95
|
/**
|
|
76
96
|
* Resolve the dev-database connection for one tool call.
|
|
77
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/connection.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,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,yBAAyB,CAAC,CAsDpC;AAsED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAWvE"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Level 2 read-only observation tools over the booted runtime (#1831).
|
|
3
|
+
*
|
|
4
|
+
* Three facts planes, labelled separately in every envelope:
|
|
5
|
+
* - `declared (manifest)`: what the confined boot registered ({@link bootRuntime});
|
|
6
|
+
* - `booted (registry)`: the in-process `ObjectRegistry` projected through the
|
|
7
|
+
* sanitized {@link snapshotRegistry} DTO;
|
|
8
|
+
* - `runtime (live DB)`: the optional read-only connection, reused from Level 1.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here mutates: no writes, no `do()`, no generated CRUD, no project
|
|
11
|
+
* code execution. `runtime-schema-diff` only *introspects* the live schema.
|
|
12
|
+
*/
|
|
13
|
+
import type { RuntimeDatabaseArgs } from './connection.js';
|
|
14
|
+
import { type RuntimeToolEnvelope } from './tools.js';
|
|
3
15
|
export interface RuntimeProjectArgs {
|
|
4
16
|
/** Project root to boot from (defaults to the server's cwd). */
|
|
5
17
|
projectPath?: string;
|
|
@@ -22,22 +34,15 @@ export interface RuntimeRegistryArgs extends RuntimeProjectArgs {
|
|
|
22
34
|
}
|
|
23
35
|
/** Default objects per `runtime-registry` page. */
|
|
24
36
|
export declare const REGISTRY_PAGE_LIMIT = 50;
|
|
25
|
-
/** `runtime-registry`: sanitized snapshot of the booted registry. */
|
|
26
|
-
export declare function runtimeRegistry(args?: RuntimeRegistryArgs): Promise<RuntimeToolEnvelope>;
|
|
27
37
|
export interface RuntimeObjectArgs extends RuntimeProjectArgs {
|
|
28
38
|
/** Simple or qualified object name. */
|
|
29
39
|
name: string;
|
|
30
40
|
/** Engine for the generated DDL preview (default: the registry's default). */
|
|
31
41
|
engine?: 'sqlite' | 'postgres' | 'duckdb';
|
|
32
42
|
}
|
|
33
|
-
/** `runtime-object`: one object's sanitized definition plus its generated DDL. */
|
|
34
|
-
export declare function runtimeObject(args: RuntimeObjectArgs): Promise<RuntimeToolEnvelope>;
|
|
35
43
|
export interface RuntimeSchemaDiffArgs extends RuntimeDatabaseArgs, RuntimeProjectArgs {
|
|
36
44
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* drop/relax options are pinned off and nothing is executed.
|
|
41
|
-
*/
|
|
42
|
-
export declare function runtimeSchemaDiff(args?: RuntimeSchemaDiffArgs): Promise<RuntimeToolEnvelope>;
|
|
45
|
+
export declare const runtimeRegistry: (args?: RuntimeRegistryArgs) => Promise<RuntimeToolEnvelope>;
|
|
46
|
+
export declare const runtimeObject: (args: RuntimeObjectArgs) => Promise<RuntimeToolEnvelope>;
|
|
47
|
+
export declare const runtimeSchemaDiff: (args?: RuntimeSchemaDiffArgs) => Promise<RuntimeToolEnvelope>;
|
|
43
48
|
//# sourceMappingURL=observation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/observation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/observation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAM3D,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAgCD,0DAA0D;AAC1D,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAcD,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AA+DtC,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC3C;AAuED,MAAM,WAAW,qBACf,SAAQ,mBAAmB,EACzB,kBAAkB;CAAG;AAwEzB,eAAO,MAAM,eAAe,GAAI,OAAM,mBAAwB,iCACJ,CAAC;AAC3D,eAAO,MAAM,aAAa,GAAI,MAAM,iBAAiB,iCACG,CAAC;AACzD,eAAO,MAAM,iBAAiB,GAAI,OAAM,qBAA0B,iCACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class ProjectRuntimeResolutionError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
constructor(specifier: string, code?: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function projectRuntimeRoot(projectPath?: string): string;
|
|
6
|
+
/** Test seam; callers must also clear the process-global runtime registry. */
|
|
7
|
+
export declare function resetProjectRuntimeForTests(): void;
|
|
8
|
+
export declare function resolveProjectRuntimeEntry(projectPath: string | undefined, specifier: string): string;
|
|
9
|
+
export declare function importProjectRuntimeModule<T = Record<string, unknown>>(projectPath: string | undefined, specifier: string): Promise<T>;
|
|
10
|
+
export declare const loadProjectCore: (projectPath?: string) => Promise<typeof import("@happyvertical/smrt-core")>;
|
|
11
|
+
export declare function loadProjectRuntime(projectPath?: string): Promise<{
|
|
12
|
+
core: typeof import("@happyvertical/smrt-core");
|
|
13
|
+
sql: typeof import("@happyvertical/sql");
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=project-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-runtime.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/project-runtime.ts"],"names":[],"mappings":"AAQA,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBACV,SAAS,EAAE,MAAM,EAAE,IAAI,SAAmC;CASvE;AAED,wBAAgB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/D;AAED,8EAA8E;AAC9E,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AA0BD,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,SAAS,EAAE,MAAM,GAChB,MAAM,CA2BR;AAED,wBAAsB,0BAA0B,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1E,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED,eAAO,MAAM,eAAe,GAAI,cAAc,MAAM,uDAIjD,CAAC;AAEJ,wBAAsB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM;;;;GAM5D"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Runtime diagnostics tools (#1824): read-only views over a project's dev
|
|
3
|
+
* database `_smrt_*` system tables, powered by the shared SELECT-only
|
|
4
|
+
* system-diagnostics reader in `@happyvertical/smrt-core`.
|
|
5
|
+
*
|
|
6
|
+
* Contract:
|
|
7
|
+
* - **Optional connection.** No configured connection returns a successful
|
|
8
|
+
* static-only envelope — the server always starts and static tools are
|
|
9
|
+
* unaffected. A live connection is opened lazily per call and closed in
|
|
10
|
+
* `finally`; nothing is cached across calls.
|
|
11
|
+
* - **Read-only.** Every underlying statement is a bounded SELECT; the reader
|
|
12
|
+
* never selects sensitive columns (job payloads/results, schedule
|
|
13
|
+
* `agentConfig`/`methodArgs`, dispatch `payload`/`metadata`).
|
|
14
|
+
* - **Provenance-labeled.** Live results carry `provenance: 'runtime (live DB)'`;
|
|
15
|
+
* static-only results carry `provenance: 'static'` — agents must never
|
|
16
|
+
* conflate runtime facts with declared/manifest facts.
|
|
17
|
+
* - **Fail-safe.** A connect/read error becomes a diagnostic envelope; it must
|
|
18
|
+
* never reach the MCP transport and never includes raw driver text or URLs.
|
|
19
|
+
*/
|
|
20
|
+
import { type RuntimeDatabaseArgs } from './connection.js';
|
|
3
21
|
/** Provenance labels separating runtime facts from static/declared facts. */
|
|
4
22
|
export declare const RUNTIME_PROVENANCE = "runtime (live DB)";
|
|
5
23
|
export declare const STATIC_PROVENANCE = "static";
|
|
@@ -18,7 +36,7 @@ type RuntimeReadParts = {
|
|
|
18
36
|
data: Record<string, unknown>;
|
|
19
37
|
diagnostics: RuntimeDiagnostic[];
|
|
20
38
|
};
|
|
21
|
-
type RuntimeRead = (db:
|
|
39
|
+
type RuntimeRead = (db: unknown) => Promise<RuntimeReadParts>;
|
|
22
40
|
/**
|
|
23
41
|
* Run one read against the optional runtime connection, mapping every outcome
|
|
24
42
|
* to a successful MCP envelope:
|
|
@@ -63,5 +81,7 @@ export interface RecentChangesArgs extends RuntimeDatabaseArgs {
|
|
|
63
81
|
}
|
|
64
82
|
export declare function runtimeRecentChanges(args?: RecentChangesArgs): Promise<RuntimeToolEnvelope>;
|
|
65
83
|
export declare function runtimeRegistryDrift(args?: RuntimeDatabaseArgs): Promise<RuntimeToolEnvelope>;
|
|
84
|
+
/** Setup failures are safe static envelopes, never empty live/booted snapshots. */
|
|
85
|
+
export declare function withRuntimeSetup(operation: () => Promise<RuntimeToolEnvelope>): Promise<RuntimeToolEnvelope>;
|
|
66
86
|
export {};
|
|
67
87
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/runtime/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAEL,KAAK,mBAAmB,EAIzB,MAAM,iBAAiB,CAAC;AAMzB,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,IAAI,CAAC;IACf,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC,CAAC;AAEF,KAAK,WAAW,GAAG,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;AA2D9D;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,mBAAmB,EACzB,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAO9B;AAyLD,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CA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