@futdevpro/nts-dynamo 1.15.141 → 1.15.144
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/__documentations/2026-08-18-artifact-compiler.md +44 -0
- package/__documentations/2026-08-18-standalone-account-security-and-privacy-bedrock.md +1 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.d.ts +6 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.d.ts.map +1 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.js +10 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.js.map +1 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.d.ts +9 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.d.ts.map +1 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.js +13 -0
- package/build/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.js.map +1 -0
- package/build/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.d.ts +7 -0
- package/build/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.d.ts.map +1 -0
- package/build/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.js +11 -0
- package/build/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.js.map +1 -0
- package/build/_modules/artifact-compiler/_models/artifact-compile.interface.d.ts +33 -0
- package/build/_modules/artifact-compiler/_models/artifact-compile.interface.d.ts.map +1 -0
- package/build/_modules/artifact-compiler/_models/artifact-compile.interface.js +3 -0
- package/build/_modules/artifact-compiler/_models/artifact-compile.interface.js.map +1 -0
- package/build/_modules/artifact-compiler/artifact-compiler.control-service.d.ts +37 -0
- package/build/_modules/artifact-compiler/artifact-compiler.control-service.d.ts.map +1 -0
- package/build/_modules/artifact-compiler/artifact-compiler.control-service.js +274 -0
- package/build/_modules/artifact-compiler/artifact-compiler.control-service.js.map +1 -0
- package/build/_modules/artifact-compiler/index.d.ts +6 -0
- package/build/_modules/artifact-compiler/index.d.ts.map +1 -0
- package/build/_modules/artifact-compiler/index.js +12 -0
- package/build/_modules/artifact-compiler/index.js.map +1 -0
- package/package.json +15 -2
- package/pnpm-workspace.yaml +4 -3
- package/src/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.ts +5 -0
- package/src/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.ts +8 -0
- package/src/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.ts +6 -0
- package/src/_modules/artifact-compiler/_models/artifact-compile.interface.ts +35 -0
- package/src/_modules/artifact-compiler/artifact-compiler.control-service.spec.ts +151 -0
- package/src/_modules/artifact-compiler/artifact-compiler.control-service.ts +356 -0
- package/src/_modules/artifact-compiler/index.ts +9 -0
- package/SKILLS.md +0 -75
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Dynamo NTS in-memory artifact compiler
|
|
2
|
+
|
|
3
|
+
**Contract:** `dynts-artifact-compiler/1`
|
|
4
|
+
|
|
5
|
+
**Release candidate:** `@futdevpro/nts-dynamo@1.15.144`
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
The artifact compiler turns one already policy-validated TypeScript program into a self-contained JavaScript bundle
|
|
10
|
+
for a classic browser Worker. It is a shared build capability, not a sandbox, an authorization layer or a source
|
|
11
|
+
policy validator. Consumers must validate source before compilation and execute the output inside an independently
|
|
12
|
+
enforced runtime boundary.
|
|
13
|
+
|
|
14
|
+
## Guarantees
|
|
15
|
+
|
|
16
|
+
- source is supplied through an in-memory virtual entry;
|
|
17
|
+
- output uses the asynchronous esbuild API with `bundle:true`, `platform:'browser'`, `format:'iife'` and
|
|
18
|
+
`write:false`;
|
|
19
|
+
- no sourcemap, embedded source content, legal comment file, plugin supplied by the caller or filesystem output;
|
|
20
|
+
- the TypeScript AST is traversed before bundling, so unused imports cannot disappear through tree-shaking before
|
|
21
|
+
policy evaluation;
|
|
22
|
+
- only caller-allowlisted static package roots resolve from the supplied absolute dependency directory;
|
|
23
|
+
- relative, absolute, re-export, import-equals, `require()` and dynamic `import()` module loads fail closed;
|
|
24
|
+
- transitive modules resolve only through the installed dependency graph;
|
|
25
|
+
- source and output byte limits, allowlist cardinality, package names and path fields have absolute Bedrock
|
|
26
|
+
ceilings;
|
|
27
|
+
- success returns exactly one JavaScript output with SHA-256 metadata;
|
|
28
|
+
- errors return stable codes and optional line/column only, never esbuild message text, source excerpt or path.
|
|
29
|
+
|
|
30
|
+
The output is deterministic for the same source, settings, installed lock graph, platform and compiler version. The
|
|
31
|
+
consumer must therefore version and checksum the compiler version and dependency lock together with the bundle.
|
|
32
|
+
|
|
33
|
+
## Security boundary
|
|
34
|
+
|
|
35
|
+
esbuild's own documentation explicitly states that esbuild is not a sandbox. This module never executes generated
|
|
36
|
+
code, and successful compilation must not be interpreted as permission to run it. Direct relative/absolute, Node,
|
|
37
|
+
HTTP or non-allowlisted imports fail because only package roots in `allowedPackages` can resolve from the virtual
|
|
38
|
+
entry. Trusted allowed packages may resolve their own installed transitive graph.
|
|
39
|
+
|
|
40
|
+
## Verification
|
|
41
|
+
|
|
42
|
+
The eight focused Bedrock specs cover deterministic output, a real bundled dependency, non-allowlisted imports,
|
|
43
|
+
all supported static and dynamic module-load syntax, content-free syntax diagnostics, invalid request contracts and
|
|
44
|
+
source/output budgets. Company Toolmaker is the first direct consumer under `BFR-CTM-007`.
|
|
@@ -124,6 +124,7 @@ Measured on 2026-08-18:
|
|
|
124
124
|
- complete package suite: 1,687 specs, 0 failures, 146 explicitly pending specs;
|
|
125
125
|
- TypeScript build: passed;
|
|
126
126
|
- changed-module ESLint: passed with zero warnings;
|
|
127
|
+
- release tarball: local untracked `SKILLS.md` explicitly excluded by `.npmignore`;
|
|
127
128
|
- package import validator: existing baseline, 82 findings in 76 files;
|
|
128
129
|
- package naming validator: existing baseline, 101 findings in 68 files.
|
|
129
130
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compile-outcome.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,oBAAY,iCAAiC;IAC3C,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ArtifactCompileOutcome_Type = void 0;
|
|
4
|
+
/** Terminal result of one deterministic in-memory artifact compilation. */
|
|
5
|
+
var DyNTS_ArtifactCompileOutcome_Type;
|
|
6
|
+
(function (DyNTS_ArtifactCompileOutcome_Type) {
|
|
7
|
+
DyNTS_ArtifactCompileOutcome_Type["compiled"] = "compiled";
|
|
8
|
+
DyNTS_ArtifactCompileOutcome_Type["rejected"] = "rejected";
|
|
9
|
+
})(DyNTS_ArtifactCompileOutcome_Type || (exports.DyNTS_ArtifactCompileOutcome_Type = DyNTS_ArtifactCompileOutcome_Type = {}));
|
|
10
|
+
//# sourceMappingURL=artifact-compile-outcome.type-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compile-outcome.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.ts"],"names":[],"mappings":";;;AAAA,2EAA2E;AAC3E,IAAY,iCAGX;AAHD,WAAY,iCAAiC;IAC3C,0DAAqB,CAAA;IACrB,0DAAqB,CAAA;AACvB,CAAC,EAHW,iCAAiC,iDAAjC,iCAAiC,QAG5C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Content-free stage identifiers for artifact compiler findings. */
|
|
2
|
+
export declare enum DyNTS_ArtifactCompileStage_Type {
|
|
3
|
+
request = "request",
|
|
4
|
+
sourcePolicy = "source-policy",
|
|
5
|
+
resolve = "resolve",
|
|
6
|
+
compile = "compile",
|
|
7
|
+
output = "output"
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=artifact-compile-stage.type-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compile-stage.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,oBAAY,+BAA+B;IACzC,OAAO,YAAY;IACnB,YAAY,kBAAkB;IAC9B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ArtifactCompileStage_Type = void 0;
|
|
4
|
+
/** Content-free stage identifiers for artifact compiler findings. */
|
|
5
|
+
var DyNTS_ArtifactCompileStage_Type;
|
|
6
|
+
(function (DyNTS_ArtifactCompileStage_Type) {
|
|
7
|
+
DyNTS_ArtifactCompileStage_Type["request"] = "request";
|
|
8
|
+
DyNTS_ArtifactCompileStage_Type["sourcePolicy"] = "source-policy";
|
|
9
|
+
DyNTS_ArtifactCompileStage_Type["resolve"] = "resolve";
|
|
10
|
+
DyNTS_ArtifactCompileStage_Type["compile"] = "compile";
|
|
11
|
+
DyNTS_ArtifactCompileStage_Type["output"] = "output";
|
|
12
|
+
})(DyNTS_ArtifactCompileStage_Type || (exports.DyNTS_ArtifactCompileStage_Type = DyNTS_ArtifactCompileStage_Type = {}));
|
|
13
|
+
//# sourceMappingURL=artifact-compile-stage.type-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compile-stage.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,IAAY,+BAMX;AAND,WAAY,+BAA+B;IACzC,sDAAmB,CAAA;IACnB,iEAA8B,CAAA;IAC9B,sDAAmB,CAAA;IACnB,sDAAmB,CAAA;IACnB,oDAAiB,CAAA;AACnB,CAAC,EANW,+BAA+B,+CAA/B,+BAA+B,QAM1C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Stable remediation classification for artifact compiler findings. */
|
|
2
|
+
export declare enum DyNTS_ArtifactRetryClass_Type {
|
|
3
|
+
agentFixable = "agent-fixable",
|
|
4
|
+
deterministicToolFixable = "deterministic-tool-fixable",
|
|
5
|
+
terminal = "terminal"
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=artifact-retry-class.type-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-retry-class.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,oBAAY,6BAA6B;IACvC,YAAY,kBAAkB;IAC9B,wBAAwB,+BAA+B;IACvD,QAAQ,aAAa;CACtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ArtifactRetryClass_Type = void 0;
|
|
4
|
+
/** Stable remediation classification for artifact compiler findings. */
|
|
5
|
+
var DyNTS_ArtifactRetryClass_Type;
|
|
6
|
+
(function (DyNTS_ArtifactRetryClass_Type) {
|
|
7
|
+
DyNTS_ArtifactRetryClass_Type["agentFixable"] = "agent-fixable";
|
|
8
|
+
DyNTS_ArtifactRetryClass_Type["deterministicToolFixable"] = "deterministic-tool-fixable";
|
|
9
|
+
DyNTS_ArtifactRetryClass_Type["terminal"] = "terminal";
|
|
10
|
+
})(DyNTS_ArtifactRetryClass_Type || (exports.DyNTS_ArtifactRetryClass_Type = DyNTS_ArtifactRetryClass_Type = {}));
|
|
11
|
+
//# sourceMappingURL=artifact-retry-class.type-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-retry-class.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AACxE,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,+DAA8B,CAAA;IAC9B,wFAAuD,CAAA;IACvD,sDAAqB,CAAA;AACvB,CAAC,EAJW,6BAA6B,6CAA7B,6BAA6B,QAIxC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DyNTS_ArtifactCompileOutcome_Type } from '../_enums/artifact-compile-outcome.type-enum';
|
|
2
|
+
import { DyNTS_ArtifactCompileStage_Type } from '../_enums/artifact-compile-stage.type-enum';
|
|
3
|
+
import { DyNTS_ArtifactRetryClass_Type } from '../_enums/artifact-retry-class.type-enum';
|
|
4
|
+
/** Versioned input for the deterministic TypeScript-to-browser bundle compiler. */
|
|
5
|
+
export interface DyNTS_ArtifactCompileRequest_Interface {
|
|
6
|
+
contractVersion: 'dynts-artifact-compiler/1';
|
|
7
|
+
source: string;
|
|
8
|
+
sourceFileName: string;
|
|
9
|
+
resolveDirectory: string;
|
|
10
|
+
allowedPackages: string[];
|
|
11
|
+
maxSourceBytes: number;
|
|
12
|
+
maxOutputBytes: number;
|
|
13
|
+
}
|
|
14
|
+
/** Content-free compiler finding. Source text and dependency paths are deliberately excluded. */
|
|
15
|
+
export interface DyNTS_ArtifactCompileFinding_Interface {
|
|
16
|
+
code: string;
|
|
17
|
+
stage: DyNTS_ArtifactCompileStage_Type;
|
|
18
|
+
line: number | null;
|
|
19
|
+
column: number | null;
|
|
20
|
+
retryClass: DyNTS_ArtifactRetryClass_Type;
|
|
21
|
+
}
|
|
22
|
+
/** One self-contained JavaScript output or a fail-closed, content-free rejection. */
|
|
23
|
+
export interface DyNTS_ArtifactCompileResult_Interface {
|
|
24
|
+
contractVersion: 'dynts-artifact-compiler/1';
|
|
25
|
+
outcome: DyNTS_ArtifactCompileOutcome_Type;
|
|
26
|
+
code: string;
|
|
27
|
+
sourceChecksum: string;
|
|
28
|
+
bundleChecksum: string;
|
|
29
|
+
outputBytes: number;
|
|
30
|
+
bundleSource: string | null;
|
|
31
|
+
findings: DyNTS_ArtifactCompileFinding_Interface[];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=artifact-compile.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compile.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_models/artifact-compile.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,8CAA8C,CAAC;AACjG,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AAEzF,mFAAmF;AACnF,MAAM,WAAW,sCAAsC;IACrD,eAAe,EAAE,2BAA2B,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,iGAAiG;AACjG,MAAM,WAAW,sCAAsC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,+BAA+B,CAAC;IACvC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,6BAA6B,CAAC;CAC3C;AAED,qFAAqF;AACrF,MAAM,WAAW,qCAAqC;IACpD,eAAe,EAAE,2BAA2B,CAAC;IAC7C,OAAO,EAAE,iCAAiC,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,sCAAsC,EAAE,CAAC;CACpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compile.interface.js","sourceRoot":"","sources":["../../../../src/_modules/artifact-compiler/_models/artifact-compile.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DyNTS_ArtifactCompileRequest_Interface, DyNTS_ArtifactCompileResult_Interface } from './_models/artifact-compile.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Deterministically bundles one in-memory TypeScript program for a classic browser Worker.
|
|
4
|
+
* This compiler is not a sandbox: consumers must validate source policy before compilation and execute the result
|
|
5
|
+
* inside a separately enforced runtime boundary.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DyNTS_ArtifactCompiler_ControlService {
|
|
8
|
+
static readonly contractVersion: 'dynts-artifact-compiler/1';
|
|
9
|
+
private readonly absoluteMaxSourceBytes;
|
|
10
|
+
private readonly absoluteMaxOutputBytes;
|
|
11
|
+
private readonly absoluteMaxAllowedPackages;
|
|
12
|
+
private readonly absoluteMaxPackageNameLength;
|
|
13
|
+
private readonly absoluteMaxSourceFileNameLength;
|
|
14
|
+
private readonly absoluteMaxResolveDirectoryLength;
|
|
15
|
+
private readonly packageNamePattern;
|
|
16
|
+
private readonly sourceFileNamePattern;
|
|
17
|
+
/** Compiles without writing source, sourcemaps, metadata or output files to disk. */
|
|
18
|
+
compile(request: DyNTS_ArtifactCompileRequest_Interface): Promise<DyNTS_ArtifactCompileResult_Interface>;
|
|
19
|
+
private validateRequest;
|
|
20
|
+
private buildOptions;
|
|
21
|
+
/**
|
|
22
|
+
* Validates every syntactic import before esbuild can tree-shake it. The plugin below is a second resolution gate,
|
|
23
|
+
* but it cannot be the only policy boundary because unused imports need not reach package resolution.
|
|
24
|
+
*/
|
|
25
|
+
private validateDirectImports;
|
|
26
|
+
private moduleName;
|
|
27
|
+
private isDynamicModuleLoad;
|
|
28
|
+
private importFinding;
|
|
29
|
+
private allowlistedEntryPlugin;
|
|
30
|
+
private buildFindings;
|
|
31
|
+
private isBuildFailure;
|
|
32
|
+
private genericBuildFinding;
|
|
33
|
+
private rejected;
|
|
34
|
+
private packageRoot;
|
|
35
|
+
private checksum;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=artifact-compiler.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compiler.control-service.d.ts","sourceRoot":"","sources":["../../../src/_modules/artifact-compiler/artifact-compiler.control-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAEL,sCAAsC,EACtC,qCAAqC,EACtC,MAAM,sCAAsC,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,qCAAqC;IAChD,gBAAuB,eAAe,EAAE,2BAA2B,CAA+B;IAClG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAqB;IAC5D,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAsB;IAC7D,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAc;IACzD,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAe;IAC5D,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAe;IAC/D,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAiB;IACnE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CACwC;IAC3E,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAwC;IAE9E,qFAAqF;IACxE,OAAO,CAClB,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,qCAAqC,CAAC;IAwDjD,OAAO,CAAC,eAAe;IA2CvB,OAAO,CAAC,YAAY;IAuBpB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAyC7B,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,sBAAsB;IAmC9B,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,QAAQ;IAiBhB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,QAAQ;CAGjB"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ArtifactCompiler_ControlService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
7
|
+
const esbuild_1 = require("esbuild");
|
|
8
|
+
const typescript_1 = tslib_1.__importDefault(require("typescript"));
|
|
9
|
+
const artifact_compile_outcome_type_enum_1 = require("./_enums/artifact-compile-outcome.type-enum");
|
|
10
|
+
const artifact_compile_stage_type_enum_1 = require("./_enums/artifact-compile-stage.type-enum");
|
|
11
|
+
const artifact_retry_class_type_enum_1 = require("./_enums/artifact-retry-class.type-enum");
|
|
12
|
+
/**
|
|
13
|
+
* Deterministically bundles one in-memory TypeScript program for a classic browser Worker.
|
|
14
|
+
* This compiler is not a sandbox: consumers must validate source policy before compilation and execute the result
|
|
15
|
+
* inside a separately enforced runtime boundary.
|
|
16
|
+
*/
|
|
17
|
+
class DyNTS_ArtifactCompiler_ControlService {
|
|
18
|
+
static contractVersion = 'dynts-artifact-compiler/1';
|
|
19
|
+
absoluteMaxSourceBytes = 1_048_576;
|
|
20
|
+
absoluteMaxOutputBytes = 16_777_216;
|
|
21
|
+
absoluteMaxAllowedPackages = 64;
|
|
22
|
+
absoluteMaxPackageNameLength = 128;
|
|
23
|
+
absoluteMaxSourceFileNameLength = 128;
|
|
24
|
+
absoluteMaxResolveDirectoryLength = 1_024;
|
|
25
|
+
packageNamePattern = /^(?:@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*|[a-z0-9][a-z0-9._-]*)$/;
|
|
26
|
+
sourceFileNamePattern = /^[a-z0-9][a-z0-9._-]*\.ts$/;
|
|
27
|
+
/** Compiles without writing source, sourcemaps, metadata or output files to disk. */
|
|
28
|
+
async compile(request) {
|
|
29
|
+
const sourceChecksum = this.checksum(typeof request?.source === 'string' ? request.source : '');
|
|
30
|
+
const requestFinding = this.validateRequest(request);
|
|
31
|
+
if (requestFinding) {
|
|
32
|
+
return this.rejected(sourceChecksum, 'DYNTS|ARTIFACT_COMPILER|REQUEST_INVALID', [requestFinding]);
|
|
33
|
+
}
|
|
34
|
+
const importFinding = this.validateDirectImports(request);
|
|
35
|
+
if (importFinding) {
|
|
36
|
+
return this.rejected(sourceChecksum, 'DYNTS|ARTIFACT_COMPILER|IMPORT_REJECTED', [importFinding]);
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const result = await (0, esbuild_1.build)(this.buildOptions(request));
|
|
40
|
+
const outputFiles = result.outputFiles ?? [];
|
|
41
|
+
if (outputFiles.length !== 1 || !outputFiles[0].path.endsWith('.js')) {
|
|
42
|
+
return this.rejected(sourceChecksum, 'DYNTS|ARTIFACT_COMPILER|OUTPUT_INVALID', [{
|
|
43
|
+
code: 'DYNTS|ARTIFACT_COMPILER|OUTPUT_COUNT',
|
|
44
|
+
stage: artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.output,
|
|
45
|
+
line: null,
|
|
46
|
+
column: null,
|
|
47
|
+
retryClass: artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.deterministicToolFixable,
|
|
48
|
+
}]);
|
|
49
|
+
}
|
|
50
|
+
const bundleSource = outputFiles[0].text;
|
|
51
|
+
const outputBytes = Buffer.byteLength(bundleSource, 'utf8');
|
|
52
|
+
if (!outputBytes || outputBytes > request.maxOutputBytes) {
|
|
53
|
+
return this.rejected(sourceChecksum, 'DYNTS|ARTIFACT_COMPILER|OUTPUT_LIMIT', [{
|
|
54
|
+
code: 'DYNTS|ARTIFACT_COMPILER|OUTPUT_SIZE',
|
|
55
|
+
stage: artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.output,
|
|
56
|
+
line: null,
|
|
57
|
+
column: null,
|
|
58
|
+
retryClass: artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.agentFixable,
|
|
59
|
+
}]);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
contractVersion: DyNTS_ArtifactCompiler_ControlService.contractVersion,
|
|
63
|
+
outcome: artifact_compile_outcome_type_enum_1.DyNTS_ArtifactCompileOutcome_Type.compiled,
|
|
64
|
+
code: 'DYNTS|ARTIFACT_COMPILER|COMPILED',
|
|
65
|
+
sourceChecksum: sourceChecksum,
|
|
66
|
+
bundleChecksum: this.checksum(bundleSource),
|
|
67
|
+
outputBytes: outputBytes,
|
|
68
|
+
bundleSource: bundleSource,
|
|
69
|
+
findings: [],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return this.rejected(sourceChecksum, 'DYNTS|ARTIFACT_COMPILER|BUILD_FAILED', this.buildFindings(error));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
validateRequest(request) {
|
|
77
|
+
const sourceBytes = typeof request?.source === 'string'
|
|
78
|
+
? Buffer.byteLength(request.source, 'utf8')
|
|
79
|
+
: 0;
|
|
80
|
+
const allowedPackages = Array.isArray(request?.allowedPackages) ? request.allowedPackages : [];
|
|
81
|
+
const uniquePackages = new Set(allowedPackages);
|
|
82
|
+
const isPackageSetValid = allowedPackages.length <= this.absoluteMaxAllowedPackages
|
|
83
|
+
&& uniquePackages.size === allowedPackages.length
|
|
84
|
+
&& allowedPackages.every((packageName) => packageName.length <= this.absoluteMaxPackageNameLength
|
|
85
|
+
&& this.packageNamePattern.test(packageName));
|
|
86
|
+
if (request?.contractVersion !== DyNTS_ArtifactCompiler_ControlService.contractVersion
|
|
87
|
+
|| !sourceBytes
|
|
88
|
+
|| !Number.isInteger(request.maxSourceBytes)
|
|
89
|
+
|| request.maxSourceBytes < 1
|
|
90
|
+
|| request.maxSourceBytes > this.absoluteMaxSourceBytes
|
|
91
|
+
|| sourceBytes > request.maxSourceBytes
|
|
92
|
+
|| !Number.isInteger(request.maxOutputBytes)
|
|
93
|
+
|| request.maxOutputBytes < 1
|
|
94
|
+
|| request.maxOutputBytes > this.absoluteMaxOutputBytes
|
|
95
|
+
|| typeof request.sourceFileName !== 'string'
|
|
96
|
+
|| request.sourceFileName.length > this.absoluteMaxSourceFileNameLength
|
|
97
|
+
|| !this.sourceFileNamePattern.test(request.sourceFileName)
|
|
98
|
+
|| typeof request.resolveDirectory !== 'string'
|
|
99
|
+
|| request.resolveDirectory.length > this.absoluteMaxResolveDirectoryLength
|
|
100
|
+
|| !node_path_1.default.isAbsolute(request.resolveDirectory)
|
|
101
|
+
|| !isPackageSetValid) {
|
|
102
|
+
return {
|
|
103
|
+
code: 'DYNTS|ARTIFACT_COMPILER|REQUEST_CONTRACT',
|
|
104
|
+
stage: artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.request,
|
|
105
|
+
line: null,
|
|
106
|
+
column: null,
|
|
107
|
+
retryClass: artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.deterministicToolFixable,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
buildOptions(request) {
|
|
113
|
+
return {
|
|
114
|
+
absWorkingDir: request.resolveDirectory,
|
|
115
|
+
bundle: true,
|
|
116
|
+
charset: 'utf8',
|
|
117
|
+
conditions: ['browser', 'default'],
|
|
118
|
+
entryPoints: ['dynts-entry:candidate'],
|
|
119
|
+
format: 'iife',
|
|
120
|
+
legalComments: 'none',
|
|
121
|
+
logLevel: 'silent',
|
|
122
|
+
mainFields: ['browser', 'module', 'main'],
|
|
123
|
+
metafile: false,
|
|
124
|
+
minify: true,
|
|
125
|
+
outdir: 'dynts-in-memory-output',
|
|
126
|
+
platform: 'browser',
|
|
127
|
+
plugins: [this.allowlistedEntryPlugin(request)],
|
|
128
|
+
sourcemap: false,
|
|
129
|
+
target: ['es2022'],
|
|
130
|
+
treeShaking: true,
|
|
131
|
+
write: false,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Validates every syntactic import before esbuild can tree-shake it. The plugin below is a second resolution gate,
|
|
136
|
+
* but it cannot be the only policy boundary because unused imports need not reach package resolution.
|
|
137
|
+
*/
|
|
138
|
+
validateDirectImports(request) {
|
|
139
|
+
const sourceFile = typescript_1.default.createSourceFile(request.sourceFileName, request.source, typescript_1.default.ScriptTarget.ES2022, true, typescript_1.default.ScriptKind.TS);
|
|
140
|
+
const allowedPackages = new Set(request.allowedPackages);
|
|
141
|
+
let finding = null;
|
|
142
|
+
/** Traverses the parsed source once and stops at the first forbidden module load. */
|
|
143
|
+
const inspectNode = (node) => {
|
|
144
|
+
if (finding) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const moduleName = this.moduleName(node);
|
|
148
|
+
if (moduleName !== null && !allowedPackages.has(this.packageRoot(moduleName))) {
|
|
149
|
+
finding = this.importFinding(sourceFile, node);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (this.isDynamicModuleLoad(node)) {
|
|
153
|
+
finding = this.importFinding(sourceFile, node);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
typescript_1.default.forEachChild(node, inspectNode);
|
|
157
|
+
};
|
|
158
|
+
inspectNode(sourceFile);
|
|
159
|
+
return finding;
|
|
160
|
+
}
|
|
161
|
+
moduleName(node) {
|
|
162
|
+
if ((typescript_1.default.isImportDeclaration(node) || typescript_1.default.isExportDeclaration(node)) && node.moduleSpecifier) {
|
|
163
|
+
return typescript_1.default.isStringLiteral(node.moduleSpecifier) ? node.moduleSpecifier.text : '';
|
|
164
|
+
}
|
|
165
|
+
if (typescript_1.default.isImportEqualsDeclaration(node)
|
|
166
|
+
&& typescript_1.default.isExternalModuleReference(node.moduleReference)
|
|
167
|
+
&& node.moduleReference.expression) {
|
|
168
|
+
return typescript_1.default.isStringLiteral(node.moduleReference.expression) ? node.moduleReference.expression.text : '';
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
isDynamicModuleLoad(node) {
|
|
173
|
+
return typescript_1.default.isCallExpression(node)
|
|
174
|
+
&& (node.expression.kind === typescript_1.default.SyntaxKind.ImportKeyword
|
|
175
|
+
|| (typescript_1.default.isIdentifier(node.expression) && node.expression.text === 'require'));
|
|
176
|
+
}
|
|
177
|
+
importFinding(sourceFile, node) {
|
|
178
|
+
const location = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));
|
|
179
|
+
return {
|
|
180
|
+
code: 'DYNTS|ARTIFACT_COMPILER|IMPORT_NOT_ALLOWED',
|
|
181
|
+
stage: artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.sourcePolicy,
|
|
182
|
+
line: location.line + 1,
|
|
183
|
+
column: location.character + 1,
|
|
184
|
+
retryClass: artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.terminal,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
allowlistedEntryPlugin(request) {
|
|
188
|
+
const allowedPackages = new Set(request.allowedPackages);
|
|
189
|
+
return {
|
|
190
|
+
name: 'dynts-allowlisted-in-memory-entry',
|
|
191
|
+
setup: (pluginBuild) => {
|
|
192
|
+
pluginBuild.onResolve({ filter: /^dynts-entry:candidate$/ }, () => ({
|
|
193
|
+
path: 'candidate',
|
|
194
|
+
namespace: 'dynts-entry',
|
|
195
|
+
}));
|
|
196
|
+
pluginBuild.onLoad({ filter: /^candidate$/, namespace: 'dynts-entry' }, () => ({
|
|
197
|
+
contents: request.source,
|
|
198
|
+
loader: 'ts',
|
|
199
|
+
resolveDir: request.resolveDirectory,
|
|
200
|
+
}));
|
|
201
|
+
pluginBuild.onResolve({ filter: /.*/, namespace: 'dynts-entry' }, async (args) => {
|
|
202
|
+
if (!allowedPackages.has(this.packageRoot(args.path))) {
|
|
203
|
+
return {
|
|
204
|
+
errors: [{ text: 'DYNTS|ARTIFACT_COMPILER|IMPORT_NOT_ALLOWED' }],
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
return pluginBuild.resolve(args.path, {
|
|
208
|
+
importer: args.importer,
|
|
209
|
+
kind: args.kind,
|
|
210
|
+
namespace: 'file',
|
|
211
|
+
resolveDir: request.resolveDirectory,
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
buildFindings(error) {
|
|
218
|
+
if (!this.isBuildFailure(error)) {
|
|
219
|
+
return [this.genericBuildFinding()];
|
|
220
|
+
}
|
|
221
|
+
const findings = error.errors.map((message) => ({
|
|
222
|
+
code: message.text === 'DYNTS|ARTIFACT_COMPILER|IMPORT_NOT_ALLOWED'
|
|
223
|
+
? message.text
|
|
224
|
+
: 'DYNTS|ARTIFACT_COMPILER|COMPILE_ERROR',
|
|
225
|
+
stage: message.text === 'DYNTS|ARTIFACT_COMPILER|IMPORT_NOT_ALLOWED'
|
|
226
|
+
? artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.resolve
|
|
227
|
+
: artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.compile,
|
|
228
|
+
line: message.location?.line ?? null,
|
|
229
|
+
column: message.location ? message.location.column + 1 : null,
|
|
230
|
+
retryClass: message.text === 'DYNTS|ARTIFACT_COMPILER|IMPORT_NOT_ALLOWED'
|
|
231
|
+
? artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.terminal
|
|
232
|
+
: artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.agentFixable,
|
|
233
|
+
}));
|
|
234
|
+
return findings.length ? findings : [this.genericBuildFinding()];
|
|
235
|
+
}
|
|
236
|
+
isBuildFailure(error) {
|
|
237
|
+
if (!error || typeof error !== 'object') {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
return 'errors' in error && Array.isArray(error.errors);
|
|
241
|
+
}
|
|
242
|
+
genericBuildFinding() {
|
|
243
|
+
return {
|
|
244
|
+
code: 'DYNTS|ARTIFACT_COMPILER|COMPILE_ERROR',
|
|
245
|
+
stage: artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type.compile,
|
|
246
|
+
line: null,
|
|
247
|
+
column: null,
|
|
248
|
+
retryClass: artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type.agentFixable,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
rejected(sourceChecksum, code, findings) {
|
|
252
|
+
return {
|
|
253
|
+
contractVersion: DyNTS_ArtifactCompiler_ControlService.contractVersion,
|
|
254
|
+
outcome: artifact_compile_outcome_type_enum_1.DyNTS_ArtifactCompileOutcome_Type.rejected,
|
|
255
|
+
code: code,
|
|
256
|
+
sourceChecksum: sourceChecksum,
|
|
257
|
+
bundleChecksum: '',
|
|
258
|
+
outputBytes: 0,
|
|
259
|
+
bundleSource: null,
|
|
260
|
+
findings: findings,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
packageRoot(moduleName) {
|
|
264
|
+
if (moduleName.startsWith('@')) {
|
|
265
|
+
return moduleName.split('/').slice(0, 2).join('/');
|
|
266
|
+
}
|
|
267
|
+
return moduleName.split('/')[0];
|
|
268
|
+
}
|
|
269
|
+
checksum(value) {
|
|
270
|
+
return (0, node_crypto_1.createHash)('sha256').update(value, 'utf8').digest('hex');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
exports.DyNTS_ArtifactCompiler_ControlService = DyNTS_ArtifactCompiler_ControlService;
|
|
274
|
+
//# sourceMappingURL=artifact-compiler.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-compiler.control-service.js","sourceRoot":"","sources":["../../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M,CAAC,CAAC;IAC1D,CAAC;IAEO,mBAAmB;QACzB,OAAO;YACL,IAAI,EAAE,uCAAuC;YAC7C,KAAK,EAAE,kEAA+B,CAAC,OAAO;YAC9C,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,8DAA6B,CAAC,YAAY;SACvD,CAAC;IACJ,CAAC;IAEO,QAAQ,CACd,cAAsB,EACtB,IAAY,EACZ,QAAkD;QAElD,OAAO;YACL,eAAe,EAAE,qCAAqC,CAAC,eAAe;YACtE,OAAO,EAAE,sEAAiC,CAAC,QAAQ;YACnD,IAAI,EAAE,IAAI;YACV,cAAc,EAAE,cAAc;YAC9B,cAAc,EAAE,EAAE;YAClB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,QAAQ;SACnB,CAAC;IACJ,CAAC;IAEO,WAAW,CAAC,UAAkB;QACpC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/B,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IAEO,QAAQ,CAAC,KAAa;QAC5B,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC;;AAlUH,sFAmUC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DyNTS_ArtifactCompiler_ControlService } from './artifact-compiler.control-service';
|
|
2
|
+
export { DyNTS_ArtifactCompileOutcome_Type } from './_enums/artifact-compile-outcome.type-enum';
|
|
3
|
+
export { DyNTS_ArtifactCompileStage_Type } from './_enums/artifact-compile-stage.type-enum';
|
|
4
|
+
export { DyNTS_ArtifactRetryClass_Type } from './_enums/artifact-retry-class.type-enum';
|
|
5
|
+
export { DyNTS_ArtifactCompileFinding_Interface, DyNTS_ArtifactCompileRequest_Interface, DyNTS_ArtifactCompileResult_Interface } from './_models/artifact-compile.interface';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/artifact-compiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EACL,sCAAsC,EACtC,sCAAsC,EACtC,qCAAqC,EACtC,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ArtifactRetryClass_Type = exports.DyNTS_ArtifactCompileStage_Type = exports.DyNTS_ArtifactCompileOutcome_Type = exports.DyNTS_ArtifactCompiler_ControlService = void 0;
|
|
4
|
+
var artifact_compiler_control_service_1 = require("./artifact-compiler.control-service");
|
|
5
|
+
Object.defineProperty(exports, "DyNTS_ArtifactCompiler_ControlService", { enumerable: true, get: function () { return artifact_compiler_control_service_1.DyNTS_ArtifactCompiler_ControlService; } });
|
|
6
|
+
var artifact_compile_outcome_type_enum_1 = require("./_enums/artifact-compile-outcome.type-enum");
|
|
7
|
+
Object.defineProperty(exports, "DyNTS_ArtifactCompileOutcome_Type", { enumerable: true, get: function () { return artifact_compile_outcome_type_enum_1.DyNTS_ArtifactCompileOutcome_Type; } });
|
|
8
|
+
var artifact_compile_stage_type_enum_1 = require("./_enums/artifact-compile-stage.type-enum");
|
|
9
|
+
Object.defineProperty(exports, "DyNTS_ArtifactCompileStage_Type", { enumerable: true, get: function () { return artifact_compile_stage_type_enum_1.DyNTS_ArtifactCompileStage_Type; } });
|
|
10
|
+
var artifact_retry_class_type_enum_1 = require("./_enums/artifact-retry-class.type-enum");
|
|
11
|
+
Object.defineProperty(exports, "DyNTS_ArtifactRetryClass_Type", { enumerable: true, get: function () { return artifact_retry_class_type_enum_1.DyNTS_ArtifactRetryClass_Type; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/artifact-compiler/index.ts"],"names":[],"mappings":";;;AAAA,yFAA4F;AAAnF,0JAAA,qCAAqC,OAAA;AAC9C,kGAAgG;AAAvF,uJAAA,iCAAiC,OAAA;AAC1C,8FAA4F;AAAnF,mJAAA,+BAA+B,OAAA;AACxC,0FAAwF;AAA/E,+IAAA,6BAA6B,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.144",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Program Ltd.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "server-package",
|
|
@@ -224,6 +224,12 @@
|
|
|
224
224
|
"types": "./build/_modules/privacy-lifecycle/index.d.ts",
|
|
225
225
|
"typings": "./build/_modules/privacy-lifecycle/index.d.ts"
|
|
226
226
|
},
|
|
227
|
+
"./artifact-compiler": {
|
|
228
|
+
"default": "./build/_modules/artifact-compiler/index.js",
|
|
229
|
+
"module": "./build/_modules/artifact-compiler/index.js",
|
|
230
|
+
"types": "./build/_modules/artifact-compiler/index.d.ts",
|
|
231
|
+
"typings": "./build/_modules/artifact-compiler/index.d.ts"
|
|
232
|
+
},
|
|
227
233
|
"./oauth2": {
|
|
228
234
|
"default": "./build/_modules/oauth2/index.js",
|
|
229
235
|
"module": "./build/_modules/oauth2/index.js",
|
|
@@ -356,6 +362,9 @@
|
|
|
356
362
|
"privacy-lifecycle": [
|
|
357
363
|
"build/_modules/privacy-lifecycle/index.d.ts"
|
|
358
364
|
],
|
|
365
|
+
"artifact-compiler": [
|
|
366
|
+
"build/_modules/artifact-compiler/index.d.ts"
|
|
367
|
+
],
|
|
359
368
|
"oauth2": [
|
|
360
369
|
"build/_modules/oauth2/index.d.ts"
|
|
361
370
|
],
|
|
@@ -392,6 +401,10 @@
|
|
|
392
401
|
"@futdevpro/fsm-dynamo": "file:../tgz-collection/dynamo-fsm/futdevpro-fsm-dynamo-01.15.8.tgz",
|
|
393
402
|
"empty": ""
|
|
394
403
|
},
|
|
404
|
+
"dependencies": {
|
|
405
|
+
"esbuild": "0.28.2",
|
|
406
|
+
"typescript": "5.5.4"
|
|
407
|
+
},
|
|
395
408
|
"peerDependencies": {
|
|
396
409
|
"@anthropic-ai/sdk": "~0.39.0",
|
|
397
410
|
"@modelcontextprotocol/sdk": "~1.29.0",
|
|
@@ -441,6 +454,7 @@
|
|
|
441
454
|
"@types/better-sqlite3": "~7.6.13",
|
|
442
455
|
"better-sqlite3": "~12.4.1",
|
|
443
456
|
"crypto-js": "~4.2.0",
|
|
457
|
+
"decimal.js": "10.6.0",
|
|
444
458
|
"discord.js": "~14.24.2",
|
|
445
459
|
"eslint": "^9.34.0",
|
|
446
460
|
"eslint-plugin-import": "^2.29.0",
|
|
@@ -456,7 +470,6 @@
|
|
|
456
470
|
"socket.io": "~4.8.1",
|
|
457
471
|
"socket.io-client": "~4.8.1",
|
|
458
472
|
"tslib": "~2.6.2",
|
|
459
|
-
"typescript": "~5.5.4",
|
|
460
473
|
"husky": "^9.1.7"
|
|
461
474
|
}
|
|
462
475
|
}
|
package/pnpm-workspace.yaml
CHANGED