@g3nomaly/core 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +95 -0
- package/dist/config/config.d.ts +7 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +21 -1
- package/dist/config/config.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/paths/index.d.ts +1 -1
- package/dist/paths/index.d.ts.map +1 -1
- package/dist/paths/index.js +1 -1
- package/dist/paths/index.js.map +1 -1
- package/dist/paths/paths.d.ts +7 -0
- package/dist/paths/paths.d.ts.map +1 -1
- package/dist/paths/paths.js +19 -0
- package/dist/paths/paths.js.map +1 -1
- package/dist/security/securityParser.d.ts.map +1 -1
- package/dist/security/securityParser.js +3 -2
- package/dist/security/securityParser.js.map +1 -1
- package/package.json +9 -20
package/LICENSE
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Copyright (c) 2026 G3NTs - G3nomaly
|
|
2
|
+
|
|
3
|
+
Elastic License 2.0
|
|
4
|
+
|
|
5
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
14
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
15
|
+
available, and prepare derivative works of the software, in each case subject to
|
|
16
|
+
the limitations and conditions below.
|
|
17
|
+
|
|
18
|
+
## Limitations
|
|
19
|
+
|
|
20
|
+
You may not provide the software to third parties as a hosted or managed
|
|
21
|
+
service, where the service provides users with access to any substantial set of
|
|
22
|
+
the features or functionality of the software.
|
|
23
|
+
|
|
24
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
25
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
26
|
+
software that is protected by the license key.
|
|
27
|
+
|
|
28
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
29
|
+
of the licensor in the software. Any use of the licensor’s trademarks is subject
|
|
30
|
+
to applicable law.
|
|
31
|
+
|
|
32
|
+
## Patents
|
|
33
|
+
|
|
34
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
35
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
36
|
+
sale, import and have imported the software, in each case subject to the
|
|
37
|
+
limitations and conditions in this license. This license does not cover any
|
|
38
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
39
|
+
the software. If you or your company make any written claim that the software
|
|
40
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
41
|
+
the software granted under these terms ends immediately. If your company makes
|
|
42
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
43
|
+
company.
|
|
44
|
+
|
|
45
|
+
## Notices
|
|
46
|
+
|
|
47
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
48
|
+
also gets a copy of these terms.
|
|
49
|
+
|
|
50
|
+
If you modify the software, you must include in any modified copies of the
|
|
51
|
+
software prominent notices stating that you have modified the software.
|
|
52
|
+
|
|
53
|
+
## No Other Rights
|
|
54
|
+
|
|
55
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
56
|
+
these terms.
|
|
57
|
+
|
|
58
|
+
## Termination
|
|
59
|
+
|
|
60
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
61
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
62
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
63
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
64
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
65
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
66
|
+
to terminate automatically and permanently.
|
|
67
|
+
|
|
68
|
+
## No Liability
|
|
69
|
+
|
|
70
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
71
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
72
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
73
|
+
legal claim.*
|
|
74
|
+
|
|
75
|
+
## Definitions
|
|
76
|
+
|
|
77
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
78
|
+
software the licensor makes available under these terms, including any portion
|
|
79
|
+
of it.
|
|
80
|
+
|
|
81
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
82
|
+
|
|
83
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
84
|
+
organization that you work for, plus all organizations that have control over,
|
|
85
|
+
are under the control of, or are under common control with that
|
|
86
|
+
organization. **control** means ownership of substantially all the assets of an
|
|
87
|
+
entity, or the power to direct its management and policies by vote, contract, or
|
|
88
|
+
otherwise. Control can be direct or indirect.
|
|
89
|
+
|
|
90
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
91
|
+
these terms.
|
|
92
|
+
|
|
93
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
94
|
+
|
|
95
|
+
**trademark** means trademarks, service marks, and similar rights.
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { type G3nConfig, type CoreConfig, type G3nuiConfig, type G3nerateConfig, type SkillsConfig } from "./types";
|
|
2
2
|
export declare function getConfigPath(projectRoot: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Directory that owns the project's `.g3n.config.json`: the nearest ancestor
|
|
5
|
+
* of `fromDir` holding the config file, else the root of the git repository
|
|
6
|
+
* containing `fromDir`. Returns null outside a git repository when no config
|
|
7
|
+
* exists on the way up — g3n projects are always anchored to a git repo.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveProjectRoot(fromDir?: string): string | null;
|
|
3
10
|
/**
|
|
4
11
|
* Loads `.g3n.config.json` from the project root.
|
|
5
12
|
* Returns a fully-defaulted config if the file doesn't exist yet.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAYjB,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CASjF;AAMD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAWxE;AAMD,iFAAiF;AACjF,KAAK,WAAW,CAAC,CAAC,IAChB,CAAC,SAAS,SAAS,OAAO,EAAE,GAAG,CAAC,GAC9B,CAAC,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACzD,CAAC,CAAC;AAEN;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,GAC9B,OAAO,CAAC,SAAS,CAAC,CAapB;AAMD,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAE/E;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAErF;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEjF;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExE"}
|
package/dist/config/config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// packages/core/src/config/config.ts
|
|
2
|
-
import {
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
3
4
|
import { G3nConfigSchema, } from "./types";
|
|
4
5
|
if ("window" in globalThis) {
|
|
5
6
|
throw new Error("@g3nomaly/core config utilities are CLI-only");
|
|
@@ -11,6 +12,25 @@ const CONFIG_FILE = ".g3n.config.json";
|
|
|
11
12
|
export function getConfigPath(projectRoot) {
|
|
12
13
|
return join(projectRoot, CONFIG_FILE);
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Directory that owns the project's `.g3n.config.json`: the nearest ancestor
|
|
17
|
+
* of `fromDir` holding the config file, else the root of the git repository
|
|
18
|
+
* containing `fromDir`. Returns null outside a git repository when no config
|
|
19
|
+
* exists on the way up — g3n projects are always anchored to a git repo.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveProjectRoot(fromDir = process.cwd()) {
|
|
22
|
+
let dir = fromDir;
|
|
23
|
+
while (true) {
|
|
24
|
+
if (existsSync(join(dir, CONFIG_FILE)))
|
|
25
|
+
return dir;
|
|
26
|
+
if (existsSync(join(dir, ".git")))
|
|
27
|
+
return dir;
|
|
28
|
+
const parent = dirname(dir);
|
|
29
|
+
if (parent === dir)
|
|
30
|
+
return null;
|
|
31
|
+
dir = parent;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
14
34
|
// ---------------------------------------------------------------------------
|
|
15
35
|
// Read
|
|
16
36
|
// ---------------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file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AAW,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,WAAmB;IACtD,OAAO,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,WAAmB;IACvD,OAAO,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,WAAmB;IAC1D,OAAO,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,WAAmB;IACxD,OAAO,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;AAChD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,WAAmB;IACpD,OAAO,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AACvD,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { CoreConfig, PackageMeta, G3nuiSettings, G3nuiConfig, G3nerateSettings, G3nerateConfig, SkillTarget, SkillsInstallDirs, SkillsSettings, SkillsConfig, G3nConfig, } from "./types";
|
|
2
2
|
export { CoreConfigSchema, PackageMetaSchema, G3nuiSettingsSchema, G3nuiConfigSchema, G3nerateSettingsSchema, G3nerateConfigSchema, SkillTargetSchema, SkillsInstallDirsSchema, SkillsSettingsSchema, SkillsConfigSchema, G3nConfigSchema, } from "./types";
|
|
3
|
-
export { getConfigPath, loadConfig, saveConfig, loadCoreConfig, loadG3nuiConfig, loadG3nerateConfig, loadSkillsConfig, configExists, } from "./config";
|
|
3
|
+
export { getConfigPath, resolveProjectRoot, loadConfig, saveConfig, loadCoreConfig, loadG3nuiConfig, loadG3nerateConfig, loadSkillsConfig, configExists, } from "./config";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { CoreConfigSchema, PackageMetaSchema, G3nuiSettingsSchema, G3nuiConfigSchema, G3nerateSettingsSchema, G3nerateConfigSchema, SkillTargetSchema, SkillsInstallDirsSchema, SkillsSettingsSchema, SkillsConfigSchema, G3nConfigSchema, } from "./types";
|
|
2
|
-
export { getConfigPath, loadConfig, saveConfig, loadCoreConfig, loadG3nuiConfig, loadG3nerateConfig, loadSkillsConfig, configExists, } from "./config";
|
|
2
|
+
export { getConfigPath, resolveProjectRoot, loadConfig, saveConfig, loadCoreConfig, loadG3nuiConfig, loadG3nerateConfig, loadSkillsConfig, configExists, } from "./config";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
package/dist/paths/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { findPackageRoot } from "./paths";
|
|
1
|
+
export { findPackageRoot, findUp, findGitRoot } from "./paths";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/paths/index.js
CHANGED
package/dist/paths/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/paths/paths.d.ts
CHANGED
|
@@ -6,4 +6,11 @@
|
|
|
6
6
|
* @throws when no package.json exists on the way up to the filesystem root
|
|
7
7
|
*/
|
|
8
8
|
export declare function findPackageRoot(fromDir: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Nearest directory at or above `fromDir` containing `marker` as a direct
|
|
11
|
+
* entry (file or directory). Returns null when no ancestor holds it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function findUp(fromDir: string, marker: string): string | null;
|
|
14
|
+
/** Root of the git repository containing `fromDir`, or null outside a repo. */
|
|
15
|
+
export declare function findGitRoot(fromDir: string): string | null;
|
|
9
16
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQvD"}
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQvD;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQrE;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1D"}
|
package/dist/paths/paths.js
CHANGED
|
@@ -18,4 +18,23 @@ export function findPackageRoot(fromDir) {
|
|
|
18
18
|
}
|
|
19
19
|
return dir;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Nearest directory at or above `fromDir` containing `marker` as a direct
|
|
23
|
+
* entry (file or directory). Returns null when no ancestor holds it.
|
|
24
|
+
*/
|
|
25
|
+
export function findUp(fromDir, marker) {
|
|
26
|
+
let dir = fromDir;
|
|
27
|
+
while (true) {
|
|
28
|
+
if (existsSync(join(dir, marker)))
|
|
29
|
+
return dir;
|
|
30
|
+
const parent = dirname(dir);
|
|
31
|
+
if (parent === dir)
|
|
32
|
+
return null;
|
|
33
|
+
dir = parent;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Root of the git repository containing `fromDir`, or null outside a repo. */
|
|
37
|
+
export function findGitRoot(fromDir) {
|
|
38
|
+
return findUp(fromDir, ".git");
|
|
39
|
+
}
|
|
21
40
|
//# sourceMappingURL=paths.js.map
|
package/dist/paths/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,GAAG,GAAG,OAAO,CAAC;IAClB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;QAC9E,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,GAAG,GAAG,OAAO,CAAC;IAClB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;QAC9E,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,OAAe,EAAE,MAAc;IACpD,IAAI,GAAG,GAAG,OAAO,CAAC;IAClB,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAChC,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securityParser.d.ts","sourceRoot":"","sources":["../../src/security/securityParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,OAAO,SAAS,OAAO,EACzD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,SAAO,GACf,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"securityParser.d.ts","sourceRoot":"","sources":["../../src/security/securityParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,OAAO,SAAS,OAAO,EACzD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,SAAO,GACf,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAkG3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/core/src/security/securityParser.ts
|
|
2
2
|
import { Transpiler } from "bun";
|
|
3
3
|
/**
|
|
4
4
|
* Safely parses a TypeScript file that has a default export object literal.
|
|
@@ -54,7 +54,8 @@ export async function getSafeObject(filePath, schema, timeoutMs = 1000) {
|
|
|
54
54
|
throw new Error(`No valid object literal found in: ${filePath}`);
|
|
55
55
|
}
|
|
56
56
|
const objectString = match[1];
|
|
57
|
-
|
|
57
|
+
// securityWorker sits beside this module and shares its extension (.ts in src, .js in dist)
|
|
58
|
+
const workerPath = import.meta.url.replace(/securityParser\.(\w+)$/, "securityWorker.$1");
|
|
58
59
|
const worker = new Worker(workerPath);
|
|
59
60
|
const result = await new Promise((res, rej) => {
|
|
60
61
|
const timeout = setTimeout(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securityParser.js","sourceRoot":"","sources":["../../src/security/securityParser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"securityParser.js","sourceRoot":"","sources":["../../src/security/securityParser.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,MAAe,EACf,SAAS,GAAG,IAAI;IAEhB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IA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AEH,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,gCAAgC,QAAQ,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CACrE,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAwB,CAAC;AACzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g3nomaly/core",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Shared runtime for @g3n packages — hashing, registry,
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Shared runtime for @g3n packages — hashing, registry, security, config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"types": "./
|
|
10
|
-
"bun": "./src/index.ts",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
11
10
|
"default": "./dist/index.js"
|
|
12
11
|
},
|
|
13
12
|
"./hash": {
|
|
14
|
-
"types": "./
|
|
15
|
-
"bun": "./src/hash/index.ts",
|
|
13
|
+
"types": "./dist/hash/index.d.ts",
|
|
16
14
|
"default": "./dist/hash/index.js"
|
|
17
15
|
},
|
|
18
16
|
"./registry": {
|
|
19
|
-
"types": "./
|
|
20
|
-
"bun": "./src/registry/index.ts",
|
|
17
|
+
"types": "./dist/registry/index.d.ts",
|
|
21
18
|
"default": "./dist/registry/index.js"
|
|
22
19
|
},
|
|
23
|
-
"./manifest": {
|
|
24
|
-
"types": "./src/manifest/index.ts",
|
|
25
|
-
"bun": "./src/manifest/index.ts",
|
|
26
|
-
"default": "./dist/manifest/index.js"
|
|
27
|
-
},
|
|
28
20
|
"./security": {
|
|
29
|
-
"types": "./
|
|
30
|
-
"bun": "./src/security/index.ts",
|
|
21
|
+
"types": "./dist/security/index.d.ts",
|
|
31
22
|
"default": "./dist/security/index.js"
|
|
32
23
|
},
|
|
33
24
|
"./config": {
|
|
34
|
-
"types": "./
|
|
35
|
-
"bun": "./src/config/index.ts",
|
|
25
|
+
"types": "./dist/config/index.d.ts",
|
|
36
26
|
"default": "./dist/config/index.js"
|
|
37
27
|
},
|
|
38
28
|
"./paths": {
|
|
39
|
-
"types": "./
|
|
40
|
-
"bun": "./src/paths/index.ts",
|
|
29
|
+
"types": "./dist/paths/index.d.ts",
|
|
41
30
|
"default": "./dist/paths/index.js"
|
|
42
31
|
},
|
|
43
32
|
"./package.json": "./package.json"
|
|
@@ -57,7 +46,7 @@
|
|
|
57
46
|
"@types/bun": "latest",
|
|
58
47
|
"typescript": "~5.9.3"
|
|
59
48
|
},
|
|
60
|
-
"license": "
|
|
49
|
+
"license": "Elastic-2.0",
|
|
61
50
|
"publishConfig": {
|
|
62
51
|
"access": "public"
|
|
63
52
|
}
|