@aws/agentcore 1.0.0-preview.2 → 1.0.0-preview.20
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 +193 -33
- package/dist/agent-inspector/index.css +1 -1
- package/dist/agent-inspector/index.js +99 -84
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +3132 -366
- package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +6 -2
- package/dist/assets/__tests__/assets.snapshot.test.ts +10 -24
- package/dist/assets/__tests__/googleadk-session-eviction.test.ts +87 -0
- package/dist/assets/__tests__/summarization-namespace.test.ts +43 -0
- package/dist/assets/agents/AGENTS.md +87 -11
- package/dist/assets/cdk/bin/cdk.ts +87 -26
- package/dist/assets/cdk/lib/cdk-stack.ts +185 -55
- package/dist/assets/cdk/package.json +1 -1
- package/dist/assets/cdk/test/cdk.test.ts +4 -0
- package/dist/assets/container/python/Dockerfile +7 -1
- package/dist/assets/container/typescript/Dockerfile +25 -0
- package/dist/assets/container/typescript/dockerignore.template +24 -0
- package/dist/assets/datasets/predefined-v1.jsonl +3 -0
- package/dist/assets/datasets/simulated-v1.jsonl +3 -0
- package/dist/assets/python/a2a/googleadk/base/main.py +24 -16
- package/dist/assets/python/a2a/googleadk/base/pyproject.toml +3 -3
- package/dist/assets/python/a2a/langchain_langgraph/base/main.py +24 -16
- package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +3 -2
- package/dist/assets/python/a2a/strands/base/main.py +23 -17
- package/dist/assets/python/a2a/strands/base/pyproject.toml +2 -2
- package/dist/assets/python/a2a/strands/capabilities/memory/session.py +10 -2
- package/dist/assets/python/agui/googleadk/base/main.py +62 -2
- package/dist/assets/python/agui/googleadk/base/pyproject.toml +3 -3
- package/dist/assets/python/agui/langchain_langgraph/base/main.py +56 -0
- package/dist/assets/python/agui/langchain_langgraph/base/pyproject.toml +2 -1
- package/dist/assets/python/agui/strands/base/main.py +63 -1
- package/dist/assets/python/agui/strands/base/pyproject.toml +1 -1
- package/dist/assets/python/agui/strands/capabilities/memory/session.py +10 -2
- package/dist/assets/python/http/autogen/base/main.py +60 -29
- package/dist/assets/python/http/autogen/base/pyproject.toml +1 -1
- package/dist/assets/python/http/googleadk/base/main.py +69 -24
- package/dist/assets/python/http/googleadk/base/mcp_client/client.py +7 -7
- package/dist/assets/python/http/googleadk/base/pyproject.toml +2 -1
- package/dist/assets/python/http/langchain_langgraph/base/main.py +115 -24
- package/dist/assets/python/http/langchain_langgraph/base/mcp_client/client.py +10 -8
- package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +3 -2
- package/dist/assets/python/http/openaiagents/base/main.py +61 -32
- package/dist/assets/python/http/openaiagents/base/mcp_client/client.py +4 -4
- package/dist/assets/python/http/openaiagents/base/pyproject.toml +2 -2
- package/dist/assets/python/http/strands/base/main.py +571 -47
- package/dist/assets/python/http/strands/base/mcp_client/client.py +49 -6
- package/dist/assets/python/http/strands/base/model/load.py +119 -3
- package/dist/assets/python/http/strands/base/model/mantle_compat.py +21 -0
- package/dist/assets/python/http/strands/base/pyproject.toml +9 -3
- package/dist/assets/python/http/strands/base/skills/fetcher.py +279 -0
- package/dist/assets/python/http/strands/capabilities/execution-limits/hooks/execution_limits.py +54 -0
- package/dist/assets/python/http/strands/capabilities/memory/session.py +10 -2
- package/dist/assets/python/http/strands/capabilities/payments/__init__.py +4 -0
- package/dist/assets/python/http/strands/capabilities/payments/payments.py +142 -0
- package/dist/assets/python/mcp/standalone/base/main.py +58 -0
- package/dist/assets/typescript/http/strands/base/README.md +37 -0
- package/dist/assets/typescript/http/strands/base/gitignore.template +22 -0
- package/dist/assets/typescript/http/strands/base/main.ts +144 -0
- package/dist/assets/typescript/http/strands/base/mcp_client/client.ts +11 -0
- package/dist/assets/typescript/http/strands/base/model/load.ts +102 -0
- package/dist/assets/typescript/http/strands/base/package.json +38 -0
- package/dist/assets/typescript/http/strands/base/tsconfig.json +19 -0
- package/dist/assets/typescript/http/strands/capabilities/memory/memory.ts +52 -0
- package/dist/assets/typescript/http/vercelai/base/README.md +37 -0
- package/dist/assets/typescript/http/vercelai/base/gitignore.template +22 -0
- package/dist/assets/typescript/http/vercelai/base/main.ts +64 -0
- package/dist/assets/typescript/http/vercelai/base/model/load.ts +121 -0
- package/dist/assets/typescript/http/vercelai/base/package.json +35 -0
- package/dist/assets/typescript/http/vercelai/base/tsconfig.json +19 -0
- package/dist/cli/index.mjs +1416 -568
- package/dist/lib/errors/index.d.ts +1 -1
- package/dist/lib/errors/index.d.ts.map +1 -1
- package/dist/lib/errors/index.js +1 -1
- package/dist/lib/errors/index.js.map +1 -1
- package/dist/lib/errors/types.d.ts +259 -0
- package/dist/lib/errors/types.d.ts.map +1 -0
- package/dist/lib/errors/types.js +402 -0
- package/dist/lib/errors/types.js.map +1 -0
- package/dist/lib/errors/zod.d.ts +8 -0
- package/dist/lib/errors/zod.d.ts.map +1 -0
- package/dist/lib/errors/{config.js → zod.js} +8 -81
- package/dist/lib/errors/zod.js.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +4 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/packaging/build-args.js +2 -2
- package/dist/lib/packaging/build-args.js.map +1 -1
- package/dist/lib/packaging/container.js +5 -5
- package/dist/lib/packaging/container.js.map +1 -1
- package/dist/lib/packaging/helpers.d.ts +16 -0
- package/dist/lib/packaging/helpers.d.ts.map +1 -1
- package/dist/lib/packaging/helpers.js +127 -29
- package/dist/lib/packaging/helpers.js.map +1 -1
- package/dist/lib/packaging/index.d.ts +0 -1
- package/dist/lib/packaging/index.d.ts.map +1 -1
- package/dist/lib/packaging/index.js +4 -19
- package/dist/lib/packaging/index.js.map +1 -1
- package/dist/lib/packaging/node.d.ts +2 -2
- package/dist/lib/packaging/node.d.ts.map +1 -1
- package/dist/lib/packaging/node.js +83 -38
- package/dist/lib/packaging/node.js.map +1 -1
- package/dist/lib/packaging/python.js +12 -12
- package/dist/lib/packaging/python.js.map +1 -1
- package/dist/lib/result.d.ts +50 -0
- package/dist/lib/result.d.ts.map +1 -0
- package/dist/lib/result.js +49 -0
- package/dist/lib/result.js.map +1 -0
- package/dist/lib/schemas/io/config-io.d.ts +8 -0
- package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
- package/dist/lib/schemas/io/config-io.js +21 -3
- package/dist/lib/schemas/io/config-io.js.map +1 -1
- package/dist/lib/schemas/io/global-config.d.ts +40 -0
- package/dist/lib/schemas/io/global-config.d.ts.map +1 -0
- package/dist/lib/schemas/io/global-config.js +118 -0
- package/dist/lib/schemas/io/global-config.js.map +1 -0
- package/dist/lib/schemas/io/index.d.ts +1 -2
- package/dist/lib/schemas/io/index.d.ts.map +1 -1
- package/dist/lib/schemas/io/index.js +1 -4
- package/dist/lib/schemas/io/index.js.map +1 -1
- package/dist/lib/schemas/io/path-resolver.d.ts +0 -6
- package/dist/lib/schemas/io/path-resolver.d.ts.map +1 -1
- package/dist/lib/schemas/io/path-resolver.js +3 -13
- package/dist/lib/schemas/io/path-resolver.js.map +1 -1
- package/dist/lib/secrets/cipher.d.ts +12 -0
- package/dist/lib/secrets/cipher.d.ts.map +1 -0
- package/dist/lib/secrets/cipher.js +54 -0
- package/dist/lib/secrets/cipher.js.map +1 -0
- package/dist/lib/secrets/index.d.ts +4 -0
- package/dist/lib/secrets/index.d.ts.map +1 -0
- package/dist/lib/secrets/index.js +15 -0
- package/dist/lib/secrets/index.js.map +1 -0
- package/dist/lib/secrets/key-provider.d.ts +16 -0
- package/dist/lib/secrets/key-provider.d.ts.map +1 -0
- package/dist/lib/secrets/key-provider.js +191 -0
- package/dist/lib/secrets/key-provider.js.map +1 -0
- package/dist/lib/secrets/sensitive-keys.d.ts +21 -0
- package/dist/lib/secrets/sensitive-keys.d.ts.map +1 -0
- package/dist/lib/secrets/sensitive-keys.js +67 -0
- package/dist/lib/secrets/sensitive-keys.js.map +1 -0
- package/dist/lib/time-constants.d.ts +5 -0
- package/dist/lib/time-constants.d.ts.map +1 -0
- package/dist/lib/time-constants.js +8 -0
- package/dist/lib/time-constants.js.map +1 -0
- package/dist/lib/utils/env.d.ts +8 -2
- package/dist/lib/utils/env.d.ts.map +1 -1
- package/dist/lib/utils/env.js +65 -17
- package/dist/lib/utils/env.js.map +1 -1
- package/dist/lib/utils/index.d.ts +3 -2
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +6 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/polling.d.ts +31 -0
- package/dist/lib/utils/polling.d.ts.map +1 -0
- package/dist/lib/utils/polling.js +61 -0
- package/dist/lib/utils/polling.js.map +1 -0
- package/dist/lib/utils/zod.d.ts +16 -0
- package/dist/lib/utils/zod.d.ts.map +1 -1
- package/dist/lib/utils/zod.js +45 -0
- package/dist/lib/utils/zod.js.map +1 -1
- package/dist/schema/constants.d.ts +56 -2
- package/dist/schema/constants.d.ts.map +1 -1
- package/dist/schema/constants.js +82 -7
- package/dist/schema/constants.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +156 -6
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agent-env.js +186 -13
- package/dist/schema/schemas/agent-env.js.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +446 -11
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +283 -18
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/auth.d.ts +174 -0
- package/dist/schema/schemas/auth.d.ts.map +1 -1
- package/dist/schema/schemas/auth.js +127 -3
- package/dist/schema/schemas/auth.js.map +1 -1
- package/dist/schema/schemas/connections.d.ts +185 -0
- package/dist/schema/schemas/connections.d.ts.map +1 -0
- package/dist/schema/schemas/connections.js +176 -0
- package/dist/schema/schemas/connections.js.map +1 -0
- package/dist/schema/schemas/deployed-state.d.ts +361 -5
- package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
- package/dist/schema/schemas/deployed-state.js +105 -2
- package/dist/schema/schemas/deployed-state.js.map +1 -1
- package/dist/schema/schemas/index.d.ts +1 -0
- package/dist/schema/schemas/index.d.ts.map +1 -1
- package/dist/schema/schemas/index.js +1 -0
- package/dist/schema/schemas/index.js.map +1 -1
- package/dist/schema/schemas/mcp-defs.d.ts +2 -1
- package/dist/schema/schemas/mcp-defs.d.ts.map +1 -1
- package/dist/schema/schemas/mcp-defs.js +3 -2
- package/dist/schema/schemas/mcp-defs.js.map +1 -1
- package/dist/schema/schemas/mcp.d.ts +197 -0
- package/dist/schema/schemas/mcp.d.ts.map +1 -1
- package/dist/schema/schemas/mcp.js +342 -6
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/ab-test.d.ts +135 -0
- package/dist/schema/schemas/primitives/ab-test.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/ab-test.js +95 -0
- package/dist/schema/schemas/primitives/ab-test.js.map +1 -0
- package/dist/schema/schemas/primitives/config-bundle.d.ts +32 -0
- package/dist/schema/schemas/primitives/config-bundle.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/config-bundle.js +41 -0
- package/dist/schema/schemas/primitives/config-bundle.js.map +1 -0
- package/dist/schema/schemas/primitives/dataset.d.ts +48 -0
- package/dist/schema/schemas/primitives/dataset.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/dataset.js +58 -0
- package/dist/schema/schemas/primitives/dataset.js.map +1 -0
- package/dist/schema/schemas/primitives/evaluator.d.ts +8 -0
- package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/evaluator.js +17 -1
- package/dist/schema/schemas/primitives/evaluator.js.map +1 -1
- package/dist/schema/schemas/primitives/harness.d.ts +377 -19
- package/dist/schema/schemas/primitives/harness.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/harness.js +379 -24
- package/dist/schema/schemas/primitives/harness.js.map +1 -1
- package/dist/schema/schemas/primitives/index.d.ts +13 -7
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +37 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/knowledge-base.d.ts +104 -0
- package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/knowledge-base.js +99 -0
- package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
- package/dist/schema/schemas/primitives/memory.d.ts +22 -4
- package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/memory.js +57 -16
- package/dist/schema/schemas/primitives/memory.js.map +1 -1
- package/dist/schema/schemas/primitives/online-eval-config.d.ts +21 -2
- package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/online-eval-config.js +45 -5
- package/dist/schema/schemas/primitives/online-eval-config.js.map +1 -1
- package/dist/schema/schemas/primitives/payment.d.ts +54 -0
- package/dist/schema/schemas/primitives/payment.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/payment.js +79 -0
- package/dist/schema/schemas/primitives/payment.js.map +1 -0
- package/dist/schema/schemas/primitives/policy.d.ts +26 -0
- package/dist/schema/schemas/primitives/policy.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/policy.js +5 -1
- package/dist/schema/schemas/primitives/policy.js.map +1 -1
- package/npm-shrinkwrap.json +17013 -0
- package/package.json +43 -21
- package/scripts/bump-version.ts +4 -4
- package/scripts/bundle.mjs +70 -41
- package/scripts/run-e2e-dev.sh +56 -0
- package/scripts/run-e2e-local.sh +145 -0
- package/dist/lib/errors/config.d.ts +0 -49
- package/dist/lib/errors/config.d.ts.map +0 -1
- package/dist/lib/errors/config.js.map +0 -1
- package/dist/lib/packaging/errors.d.ts +0 -16
- package/dist/lib/packaging/errors.d.ts.map +0 -1
- package/dist/lib/packaging/errors.js +0 -36
- package/dist/lib/packaging/errors.js.map +0 -1
- package/dist/lib/schemas/io/cli-config.d.ts +0 -12
- package/dist/lib/schemas/io/cli-config.d.ts.map +0 -1
- package/dist/lib/schemas/io/cli-config.js +0 -35
- package/dist/lib/schemas/io/cli-config.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/errors/types.ts"],"names":[],"mappings":";;;AA2BA,0BAEC;AA7BD,qCAA2C;AAa3C,MAAsB,SAAU,SAAQ,KAAK;IAClC,WAAW,CAAc;IAElC,YAAsB,OAAe,EAAE,OAA6B;QAClE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC;IAClE,CAAC;CACF;AARD,8BAQC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,GAAY;IAClC,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,sBAAsB;AAEtB;;GAEG;AACH,MAAa,cAAe,SAAQ,SAAS;IAC3C,YAAY,OAAgB,EAAE,OAA0B;QACtD,KAAK,CAAC,OAAO,IAAI,2DAA2D,EAAE;YAC5E,aAAa,EAAE,MAAM;YACrB,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAPD,wCAOC;AAED;;GAEG;AACH,MAAa,uBAAwB,SAAQ,SAAS;IACpD,YAAY,SAAiB,EAAE,OAA0B;QACvD,KAAK,CAAC,mBAAmB,SAAS,iCAAiC,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9G,CAAC;CACF;AAJD,0DAIC;AAED;;GAEG;AACH,MAAa,iBAAkB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AAED;;;;;GAKG;AACH,MAAa,cAAe,SAAQ,SAAS;IAC3C,YAAY,OAAe,EAAE,OAA0B;QACrD,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF;AAJD,wCAIC;AAED,MAAa,gBAAiB,SAAQ,SAAS;IAC7C,YAAY,OAA0B;QACpC,KAAK,CAAC,kEAAkE,EAAE;YACxE,aAAa,EAAE,SAAS;YACxB,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAPD,4CAOC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,SAAS;IAClD,YAAY,OAA0B;QACpC,KAAK,CAAC,gBAAgB,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAJD,sDAIC;AAED,MAAa,kBAAmB,SAAQ,SAAS;IAC/C,YAAY,OAAe,EAAE,OAA0B;QACrD,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF;AAJD,gDAIC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod error formatting utilities for human-readable validation messages.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Format all issues from a ZodError into a newline-separated list.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatZodErrors(issues: unknown[]): string;
|
|
8
|
+
//# sourceMappingURL=zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/zod.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8GH;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAEzD"}
|
|
@@ -1,58 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigParseError = exports.ConfigValidationError = exports.ConfigWriteError = exports.ConfigReadError = exports.ConfigNotFoundError = exports.ConfigError = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Base class for all config-related errors
|
|
6
|
-
*/
|
|
7
|
-
class ConfigError extends Error {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = this.constructor.name;
|
|
11
|
-
Error.captureStackTrace(this, this.constructor);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.ConfigError = ConfigError;
|
|
15
2
|
/**
|
|
16
|
-
*
|
|
3
|
+
* Zod error formatting utilities for human-readable validation messages.
|
|
17
4
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
fileType;
|
|
21
|
-
constructor(filePath, fileType) {
|
|
22
|
-
super(`${fileType} config file not found at: ${filePath}`);
|
|
23
|
-
this.filePath = filePath;
|
|
24
|
-
this.fileType = fileType;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.ConfigNotFoundError = ConfigNotFoundError;
|
|
28
|
-
/**
|
|
29
|
-
* Thrown when a config file can't be read
|
|
30
|
-
*/
|
|
31
|
-
class ConfigReadError extends ConfigError {
|
|
32
|
-
filePath;
|
|
33
|
-
cause;
|
|
34
|
-
constructor(filePath, cause) {
|
|
35
|
-
const message = cause instanceof Error ? cause.message : String(cause);
|
|
36
|
-
super(`Failed to read config file at ${filePath}: ${message}`);
|
|
37
|
-
this.filePath = filePath;
|
|
38
|
-
this.cause = cause;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.ConfigReadError = ConfigReadError;
|
|
42
|
-
/**
|
|
43
|
-
* Thrown when a config file can't be written
|
|
44
|
-
*/
|
|
45
|
-
class ConfigWriteError extends ConfigError {
|
|
46
|
-
filePath;
|
|
47
|
-
cause;
|
|
48
|
-
constructor(filePath, cause) {
|
|
49
|
-
const message = cause instanceof Error ? cause.message : String(cause);
|
|
50
|
-
super(`Failed to write config file at ${filePath}: ${message}`);
|
|
51
|
-
this.filePath = filePath;
|
|
52
|
-
this.cause = cause;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.ConfigWriteError = ConfigWriteError;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatZodErrors = formatZodErrors;
|
|
56
7
|
/**
|
|
57
8
|
* Format a Zod path array to bracket notation: agents[0].name
|
|
58
9
|
*/
|
|
@@ -107,7 +58,7 @@ function formatZodIssue(issue) {
|
|
|
107
58
|
return `${path}: invalid "${issue.discriminator}" value`;
|
|
108
59
|
}
|
|
109
60
|
// Pick the most actionable error from union failures (one fix, not all branches)
|
|
110
|
-
const unionErrors = issue.unionErrors?.flatMap(e => e.issues) ?? issue.errors ?? [];
|
|
61
|
+
const unionErrors = issue.unionErrors?.flatMap(e => e.issues) ?? issue.errors?.flat() ?? [];
|
|
111
62
|
for (const err of unionErrors) {
|
|
112
63
|
if (err.code === 'invalid_enum_value' || err.code === 'invalid_value') {
|
|
113
64
|
return formatZodIssue(err);
|
|
@@ -138,33 +89,9 @@ function formatZodIssue(issue) {
|
|
|
138
89
|
return `${path}: ${message}`;
|
|
139
90
|
}
|
|
140
91
|
/**
|
|
141
|
-
*
|
|
92
|
+
* Format all issues from a ZodError into a newline-separated list.
|
|
142
93
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
fileType;
|
|
146
|
-
zodError;
|
|
147
|
-
constructor(filePath, fileType, zodError) {
|
|
148
|
-
const formattedErrors = zodError.issues.map(issue => ` - ${formatZodIssue(issue)}`).join('\n');
|
|
149
|
-
super(`${filePath}:\n${formattedErrors}`);
|
|
150
|
-
this.filePath = filePath;
|
|
151
|
-
this.fileType = fileType;
|
|
152
|
-
this.zodError = zodError;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
exports.ConfigValidationError = ConfigValidationError;
|
|
156
|
-
/**
|
|
157
|
-
* Thrown when JSON parsing fails
|
|
158
|
-
*/
|
|
159
|
-
class ConfigParseError extends ConfigError {
|
|
160
|
-
filePath;
|
|
161
|
-
cause;
|
|
162
|
-
constructor(filePath, cause) {
|
|
163
|
-
const message = cause instanceof Error ? cause.message : String(cause);
|
|
164
|
-
super(`Failed to parse JSON in config file at ${filePath}: ${message}`);
|
|
165
|
-
this.filePath = filePath;
|
|
166
|
-
this.cause = cause;
|
|
167
|
-
}
|
|
94
|
+
function formatZodErrors(issues) {
|
|
95
|
+
return issues.map(issue => ` - ${formatZodIssue(issue)}`).join('\n');
|
|
168
96
|
}
|
|
169
|
-
|
|
170
|
-
//# sourceMappingURL=config.js.map
|
|
97
|
+
//# sourceMappingURL=zod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.js","sourceRoot":"","sources":["../../../src/lib/errors/zod.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAiHH,0CAEC;AAlGD;;GAEG;AACH,SAAS,UAAU,CAAC,IAAmB;IACrC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IACrC,OAAO,IAAI;SACR,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAClB,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CACjG;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,KAAkB;IACxC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEpC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,cAAc;YACjB,I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IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;YAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,OAAO,GAAG,IAAI,cAAc,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5E,CAAC;YACD,MAAM;QACR,CAAC;IACH,CAAC;IAED,yDAAyD;IACzD,wFAAwF;IACxF,+EAA+E;IAC/E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,eAAe,CAAC;IAC/D,OAAO,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAiB;IAC/C,OAAQ,MAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3F,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ export * from './errors';
|
|
|
4
4
|
export * from './packaging';
|
|
5
5
|
export * from './utils';
|
|
6
6
|
export * from './schemas/io';
|
|
7
|
+
export * from './time-constants';
|
|
8
|
+
export { serializeResult } from './result';
|
|
9
|
+
export type { Result } from './result';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,MAAM,EACN,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AAErB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,MAAM,EACN,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AAErB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.getDockerfilePath = exports.CONTAINER_RUNTIMES = exports.CONTAINER_INTERNAL_PORT = exports.DOCKERFILE_NAME = exports.ONE_GB = exports.DEFAULT_PYTHON_PLATFORM = exports.UV_INSTALL_HINT = exports.getArtifactZipName = exports.ENV_FILE = exports.CONFIG_FILES = exports.CLI_LOGS_DIR = exports.CLI_SYSTEM_DIR = exports.MCP_APP_SUBDIR = exports.APP_DIR = exports.CONFIG_DIR = void 0;
|
|
17
|
+
exports.serializeResult = exports.getDockerfilePath = exports.CONTAINER_RUNTIMES = exports.CONTAINER_INTERNAL_PORT = exports.DOCKERFILE_NAME = exports.ONE_GB = exports.DEFAULT_PYTHON_PLATFORM = exports.UV_INSTALL_HINT = exports.getArtifactZipName = exports.ENV_FILE = exports.CONFIG_FILES = exports.CLI_LOGS_DIR = exports.CLI_SYSTEM_DIR = exports.MCP_APP_SUBDIR = exports.APP_DIR = exports.CONFIG_DIR = void 0;
|
|
18
18
|
// Re-export all public APIs
|
|
19
19
|
// Note: constants re-exports all of schema, which includes errors
|
|
20
20
|
// Use explicit named re-exports for ESM compatibility (ESM can't see CommonJS __exportStar at import time)
|
|
@@ -41,4 +41,7 @@ __exportStar(require("./packaging"), exports);
|
|
|
41
41
|
__exportStar(require("./utils"), exports);
|
|
42
42
|
// Schema I/O utilities
|
|
43
43
|
__exportStar(require("./schemas/io"), exports);
|
|
44
|
+
__exportStar(require("./time-constants"), exports);
|
|
45
|
+
var result_1 = require("./result");
|
|
46
|
+
Object.defineProperty(exports, "serializeResult", { enumerable: true, get: function () { return result_1.serializeResult; } });
|
|
44
47
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,2GAA2G;AAC3G,yCAiBqB;AAhBnB,uGAAA,UAAU,OAAA;AACV,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,yGAAA,YAAY,OAAA;AACZ,qGAAA,QAAQ,OAAA;AACR,+GAAA,kBAAkB,OAAA;AAClB,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AACvB,mGAAA,MAAM,OAAA;AACN,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AACvB,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AAGnB,wEAAwE;AACxE,4CAA0B;AAC1B,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AAExB,uBAAuB;AACvB,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,2GAA2G;AAC3G,yCAiBqB;AAhBnB,uGAAA,UAAU,OAAA;AACV,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AACZ,yGAAA,YAAY,OAAA;AACZ,qGAAA,QAAQ,OAAA;AACR,+GAAA,kBAAkB,OAAA;AAClB,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AACvB,mGAAA,MAAM,OAAA;AACN,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AACvB,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AAGnB,wEAAwE;AACxE,4CAA0B;AAC1B,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AAExB,uBAAuB;AACvB,+CAA6B;AAC7B,mDAAiC;AACjC,mCAA2C;AAAlC,yGAAA,eAAe,OAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUvBuildArgs = getUvBuildArgs;
|
|
4
|
-
const
|
|
4
|
+
const global_config_1 = require("../schemas/io/global-config");
|
|
5
5
|
/**
|
|
6
6
|
* Return Docker --build-arg flags for UV index URLs configured in ~/.agentcore/config.json.
|
|
7
7
|
* Returns an empty array when no custom indexes are configured.
|
|
8
8
|
*/
|
|
9
9
|
function getUvBuildArgs() {
|
|
10
|
-
const config = (0,
|
|
10
|
+
const config = (0, global_config_1.readGlobalConfigSync)();
|
|
11
11
|
const args = [];
|
|
12
12
|
if (config.uvDefaultIndex)
|
|
13
13
|
args.push('--build-arg', `UV_DEFAULT_INDEX=${config.uvDefaultIndex}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-args.js","sourceRoot":"","sources":["../../../src/lib/packaging/build-args.ts"],"names":[],"mappings":";;AAMA,wCAMC;AAZD
|
|
1
|
+
{"version":3,"file":"build-args.js","sourceRoot":"","sources":["../../../src/lib/packaging/build-args.ts"],"names":[],"mappings":";;AAMA,wCAMC;AAZD,+DAAmE;AAEnE;;;GAGG;AACH,SAAgB,cAAc;IAC5B,MAAM,MAAM,GAAG,IAAA,oCAAoB,GAAE,CAAC;IACtC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAM,CAAC,cAAc;QAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oBAAoB,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;IACjG,IAAI,MAAM,CAAC,OAAO;QAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContainerPackager = void 0;
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const types_1 = require("../errors/types");
|
|
5
6
|
const build_args_1 = require("./build-args");
|
|
6
|
-
const errors_1 = require("./errors");
|
|
7
7
|
const helpers_1 = require("./helpers");
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
const fs_1 = require("fs");
|
|
@@ -29,7 +29,7 @@ function detectContainerRuntimeSync() {
|
|
|
29
29
|
class ContainerPackager {
|
|
30
30
|
pack(spec, options = {}) {
|
|
31
31
|
if (spec.build !== 'Container') {
|
|
32
|
-
return Promise.reject(new
|
|
32
|
+
return Promise.reject(new types_1.PackagingError('ContainerPackager only supports Container build type.'));
|
|
33
33
|
}
|
|
34
34
|
const agentName = options.agentName ?? spec.name;
|
|
35
35
|
const configBaseDir = options.artifactDir ?? options.projectRoot ?? process.cwd();
|
|
@@ -37,7 +37,7 @@ class ContainerPackager {
|
|
|
37
37
|
const dockerfilePath = (0, constants_1.getDockerfilePath)(codeLocation, spec.dockerfile);
|
|
38
38
|
// Preflight: Dockerfile must exist
|
|
39
39
|
if (!(0, fs_1.existsSync)(dockerfilePath)) {
|
|
40
|
-
return Promise.reject(new
|
|
40
|
+
return Promise.reject(new types_1.PackagingError(`${spec.dockerfile ?? constants_1.DOCKERFILE_NAME} not found at ${dockerfilePath}. Container agents require a Dockerfile.`));
|
|
41
41
|
}
|
|
42
42
|
// Detect container runtime
|
|
43
43
|
const runtime = detectContainerRuntimeSync();
|
|
@@ -55,7 +55,7 @@ class ContainerPackager {
|
|
|
55
55
|
stdio: 'pipe',
|
|
56
56
|
});
|
|
57
57
|
if (buildResult.status !== 0) {
|
|
58
|
-
return Promise.reject(new
|
|
58
|
+
return Promise.reject(new types_1.PackagingError(`Container build failed:\n${buildResult.stderr?.toString()}`));
|
|
59
59
|
}
|
|
60
60
|
// Validate size (1GB limit)
|
|
61
61
|
const inspectResult = (0, child_process_1.spawnSync)(runtime, ['image', 'inspect', imageName, '--format', '{{.Size}}'], {
|
|
@@ -64,7 +64,7 @@ class ContainerPackager {
|
|
|
64
64
|
const sizeBytes = parseInt(inspectResult.stdout?.toString().trim() ?? '0', 10);
|
|
65
65
|
if (sizeBytes > constants_1.ONE_GB) {
|
|
66
66
|
const sizeMb = (sizeBytes / (1024 * 1024)).toFixed(2);
|
|
67
|
-
return Promise.reject(new
|
|
67
|
+
return Promise.reject(new types_1.PackagingError(`Container image exceeds 1GB limit (${sizeMb}MB). ` +
|
|
68
68
|
'Optimize your Dockerfile: use multi-stage builds, minimize dependencies, add .dockerignore.'));
|
|
69
69
|
}
|
|
70
70
|
return Promise.resolve({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../src/lib/packaging/container.ts"],"names":[],"mappings":";;;AACA,4CAA8F;AAC9F,6CAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../src/lib/packaging/container.ts"],"names":[],"mappings":";;;AACA,4CAA8F;AAC9F,2CAAiD;AACjD,6CAA8C;AAC9C,uCAAgD;AAEhD,iDAA0C;AAC1C,2BAAgC;AAEhC;;;GAGG;AACH,SAAS,0BAA0B;IACjC,KAAK,MAAM,OAAO,IAAI,8BAAkB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAChE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,aAAa,GAAG,IAAA,yBAAS,EAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC3E,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,OAAO,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAa,iBAAiB;IAC5B,IAAI,CAAC,IAAkB,EAAE,UAA0B,EAAE;QACnD,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,sBAAc,CAAC,uDAAuD,CAAC,CAAC,CAAC;QACrG,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC;QACjD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AAM,aAAa,GAAG,IAAA,yBAAS,EAAC,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE;YACjG,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/E,IAAI,SAAS,GAAG,kBAAM,EAAE,CAAC;YACvB,MAAM,MAAM,GAAG,CAAC,SAAS,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACtD,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,sBAAc,CAChB,sCAAsC,MAAM,OAAO;gBACjD,6FAA6F,CAChG,CACF,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,YAAY,EAAE,GAAG,OAAO,MAAM,SAAS,EAAE;YACzC,SAAS;YACT,WAAW,EAAE,YAAY;SAC1B,CAAC,CAAC;IACL,CAAC;CACF;AAnED,8CAmEC"}
|
|
@@ -33,6 +33,22 @@ export declare function runCommand(command: string, args: string[], cwd?: string
|
|
|
33
33
|
export declare function createZipFromDir(sourceDir: string, outputZip: string): Promise<void>;
|
|
34
34
|
export declare function enforceZipSizeLimit(zipPath: string): Promise<number>;
|
|
35
35
|
export declare function resolveProjectPathsSync(options?: PackageOptions, agentName?: string): ResolvedPaths;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve filesystem paths for a Node.js/TypeScript agent project during packaging.
|
|
38
|
+
*
|
|
39
|
+
* Locates the nearest package.json (equivalent of pyproject.toml for Python agents),
|
|
40
|
+
* then derives:
|
|
41
|
+
* - projectRoot: directory containing package.json
|
|
42
|
+
* - srcDir: source directory (defaults to projectRoot)
|
|
43
|
+
* - artifactDir: where CDK config and build outputs live (agentcore/ directory)
|
|
44
|
+
* - buildDir/stagingDir: per-agent temp directories used during CodeZip packaging
|
|
45
|
+
*
|
|
46
|
+
* Note: `pyprojectPath` in the return type is reused from the Python ResolvedPaths
|
|
47
|
+
* interface — for Node projects it points to package.json.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveNodeProjectPaths(options?: PackageOptions, agentName?: string): Promise<ResolvedPaths>;
|
|
50
|
+
/** Synchronous version of resolveNodeProjectPaths — used in contexts where async is not available. */
|
|
51
|
+
export declare function resolveNodeProjectPathsSync(options?: PackageOptions, agentName?: string): ResolvedPaths;
|
|
36
52
|
export declare function ensureDirCleanSync(dir: string): void;
|
|
37
53
|
export declare function copySourceTreeSync(srcDir: string, destination: string): void;
|
|
38
54
|
export declare function ensureBinaryAvailableSync(binary: string, installHint?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/packaging/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAwBxD;;GAEG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEvE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAErE;AAED,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/packaging/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,c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AAG,OAAO,CAAC,IAAI,CAAC,CAO1F;AAqBD,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM1E;AAsBD,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,cAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,aAAa,CA8BvG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,cAAmB,EAC5B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CA0BxB;AAED,sGAAsG;AACtG,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,cAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,aAAa,CA0B3G;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGpD;AAmBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAK5E;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAcpF;AAqBD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAO/E;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM/D;AAmED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCpF;AAgCD;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAiCzE"}
|
|
@@ -12,6 +12,8 @@ exports.runCommand = runCommand;
|
|
|
12
12
|
exports.createZipFromDir = createZipFromDir;
|
|
13
13
|
exports.enforceZipSizeLimit = enforceZipSizeLimit;
|
|
14
14
|
exports.resolveProjectPathsSync = resolveProjectPathsSync;
|
|
15
|
+
exports.resolveNodeProjectPaths = resolveNodeProjectPaths;
|
|
16
|
+
exports.resolveNodeProjectPathsSync = resolveNodeProjectPathsSync;
|
|
15
17
|
exports.ensureDirCleanSync = ensureDirCleanSync;
|
|
16
18
|
exports.copySourceTreeSync = copySourceTreeSync;
|
|
17
19
|
exports.ensureBinaryAvailableSync = ensureBinaryAvailableSync;
|
|
@@ -20,9 +22,9 @@ exports.enforceZipSizeLimitSync = enforceZipSizeLimitSync;
|
|
|
20
22
|
exports.convertWindowsScriptsToLinux = convertWindowsScriptsToLinux;
|
|
21
23
|
exports.convertWindowsScriptsToLinuxSync = convertWindowsScriptsToLinuxSync;
|
|
22
24
|
const constants_1 = require("../constants");
|
|
25
|
+
const types_1 = require("../errors/types");
|
|
23
26
|
const platform_1 = require("../utils/platform");
|
|
24
27
|
const subprocess_1 = require("../utils/subprocess");
|
|
25
|
-
const errors_1 = require("./errors");
|
|
26
28
|
const fflate_1 = require("fflate");
|
|
27
29
|
const fs_1 = require("fs");
|
|
28
30
|
const promises_1 = require("fs/promises");
|
|
@@ -44,6 +46,52 @@ function isNodeRuntime(runtimeVersion) {
|
|
|
44
46
|
return runtimeVersion.startsWith('NODE_');
|
|
45
47
|
}
|
|
46
48
|
const EXCLUDED_ENTRIES = new Set(['.git', '.venv', '__pycache__', '.pytest_cache', '.DS_Store', 'node_modules']);
|
|
49
|
+
/**
|
|
50
|
+
* True for any .env / .env.local / .env.* file — per-environment secret files
|
|
51
|
+
* customers expect to stay local. Excluded at every packaging stage and depth.
|
|
52
|
+
*/
|
|
53
|
+
function isEnvSecretEntry(entryName) {
|
|
54
|
+
// .env.* (e.g. .env.production, .env.development) is the same family.
|
|
55
|
+
return entryName === '.env' || entryName === '.env.local' || entryName.startsWith('.env.');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Decide whether a directory entry should be skipped at the COPY stage (when
|
|
59
|
+
* staging the source tree into the artifact dir). Excludes:
|
|
60
|
+
* - the build-tooling artefacts in EXCLUDED_ENTRIES (.git / .venv / etc.)
|
|
61
|
+
* - the project agentcore/ config directory ONLY when it sits at the
|
|
62
|
+
* root of the package source (an in-tree dependency that ships its own
|
|
63
|
+
* agentcore/ sub-module — see issue #843 — must still be packaged).
|
|
64
|
+
* - any .env / .env.local / .env.* file at any depth.
|
|
65
|
+
*
|
|
66
|
+
* The .env bucket closes a footgun where a project with `--code-location .`
|
|
67
|
+
* (BYO at project root) would otherwise have `agentcore/.env.local` staged
|
|
68
|
+
* — but is depth-aware to avoid breaking legitimate dependency code.
|
|
69
|
+
*/
|
|
70
|
+
function shouldExcludeEntry(entryName, source, rootDir) {
|
|
71
|
+
if (EXCLUDED_ENTRIES.has(entryName))
|
|
72
|
+
return true;
|
|
73
|
+
if (entryName === constants_1.CONFIG_DIR && (0, path_1.resolve)(source) === (0, path_1.resolve)(rootDir))
|
|
74
|
+
return true;
|
|
75
|
+
if (isEnvSecretEntry(entryName))
|
|
76
|
+
return true;
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Decide whether a directory entry should be skipped at the ZIP stage. The zip
|
|
81
|
+
* runs against the staging directory (not the project root), where the
|
|
82
|
+
* project's own agentcore/ config dir is already absent — so a top-level
|
|
83
|
+
* `agentcore/` here is a real Python package (e.g. an installed dependency)
|
|
84
|
+
* and MUST be included (issue #1408 / PR #1424). Unlike the copy stage, we
|
|
85
|
+
* therefore do NOT skip CONFIG_DIR; we only drop build artefacts and .env
|
|
86
|
+
* secret files.
|
|
87
|
+
*/
|
|
88
|
+
function isZipExcludedEntry(entryName) {
|
|
89
|
+
if (EXCLUDED_ENTRIES.has(entryName))
|
|
90
|
+
return true;
|
|
91
|
+
if (isEnvSecretEntry(entryName))
|
|
92
|
+
return true;
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
47
95
|
exports.MAX_ZIP_SIZE_BYTES = 250 * 1024 * 1024;
|
|
48
96
|
/**
|
|
49
97
|
* Resolve CodeLocation path relative to repository root
|
|
@@ -94,7 +142,7 @@ async function resolveProjectPaths(options = {}, agentName) {
|
|
|
94
142
|
? (0, path_1.resolve)(options.pyprojectPath)
|
|
95
143
|
: await findUp('pyproject.toml', startDir);
|
|
96
144
|
if (!candidatePyproject || !(await pathExists(candidatePyproject))) {
|
|
97
|
-
throw new
|
|
145
|
+
throw new types_1.MissingProjectFileError(options.pyprojectPath ?? (0, path_1.join)(startDir, 'pyproject.toml'));
|
|
98
146
|
}
|
|
99
147
|
const pyprojectPath = candidatePyproject;
|
|
100
148
|
const projectRoot = options.projectRoot ? (0, path_1.resolve)(options.projectRoot) : (0, path_1.dirname)(pyprojectPath);
|
|
@@ -125,10 +173,7 @@ async function copyEntry(source, destination, rootDir) {
|
|
|
125
173
|
await (0, promises_1.mkdir)(destination, { recursive: true });
|
|
126
174
|
const entries = await (0, promises_1.readdir)(source);
|
|
127
175
|
for (const entry of entries) {
|
|
128
|
-
if (
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
if (entry === constants_1.CONFIG_DIR && (0, path_1.resolve)(source) === (0, path_1.resolve)(rootDir)) {
|
|
176
|
+
if (shouldExcludeEntry(entry, source, rootDir)) {
|
|
132
177
|
continue;
|
|
133
178
|
}
|
|
134
179
|
await copyEntry((0, path_1.join)(source, entry), (0, path_1.join)(destination, entry), rootDir);
|
|
@@ -141,7 +186,7 @@ async function copyEntry(source, destination, rootDir) {
|
|
|
141
186
|
}
|
|
142
187
|
async function copySourceTree(srcDir, destination) {
|
|
143
188
|
if (!(await pathExists(srcDir))) {
|
|
144
|
-
throw new
|
|
189
|
+
throw new types_1.MissingProjectFileError(srcDir);
|
|
145
190
|
}
|
|
146
191
|
await copyEntry(srcDir, destination, srcDir);
|
|
147
192
|
}
|
|
@@ -156,7 +201,7 @@ async function ensureBinaryAvailable(binary, installHint) {
|
|
|
156
201
|
return;
|
|
157
202
|
}
|
|
158
203
|
}
|
|
159
|
-
throw new
|
|
204
|
+
throw new types_1.MissingDependencyError(binary, installHint);
|
|
160
205
|
}
|
|
161
206
|
async function runCommand(command, args, cwd) {
|
|
162
207
|
await (0, subprocess_1.runSubprocess)(command, args, { cwd });
|
|
@@ -164,22 +209,20 @@ async function runCommand(command, args, cwd) {
|
|
|
164
209
|
async function createZipFromDir(sourceDir, outputZip) {
|
|
165
210
|
await (0, promises_1.rm)(outputZip, { force: true });
|
|
166
211
|
await (0, promises_1.mkdir)((0, path_1.dirname)(outputZip), { recursive: true });
|
|
167
|
-
const files = await collectFiles(sourceDir
|
|
212
|
+
const files = await collectFiles(sourceDir);
|
|
168
213
|
const zipped = (0, fflate_1.zipSync)(files);
|
|
169
214
|
await (0, promises_1.writeFile)(outputZip, zipped);
|
|
170
215
|
}
|
|
171
|
-
async function collectFiles(directory,
|
|
216
|
+
async function collectFiles(directory, basePath = '') {
|
|
172
217
|
const result = {};
|
|
173
218
|
const entries = await (0, promises_1.readdir)(directory, { withFileTypes: true });
|
|
174
219
|
for (const entry of entries) {
|
|
175
|
-
if (
|
|
176
|
-
continue;
|
|
177
|
-
if (entry.name === constants_1.CONFIG_DIR && (0, path_1.resolve)(directory) === (0, path_1.resolve)(rootDir))
|
|
220
|
+
if (isZipExcludedEntry(entry.name))
|
|
178
221
|
continue;
|
|
179
222
|
const fullPath = (0, path_1.join)(directory, entry.name);
|
|
180
223
|
const zipPath = basePath ? `${basePath}/${entry.name}` : entry.name;
|
|
181
224
|
if (entry.isDirectory()) {
|
|
182
|
-
Object.assign(result, await collectFiles(fullPath,
|
|
225
|
+
Object.assign(result, await collectFiles(fullPath, zipPath));
|
|
183
226
|
}
|
|
184
227
|
else if (entry.isFile()) {
|
|
185
228
|
result[zipPath] = [await (0, promises_1.readFile)(fullPath), { level: 6 }];
|
|
@@ -190,7 +233,7 @@ async function collectFiles(directory, rootDir, basePath = '') {
|
|
|
190
233
|
async function enforceZipSizeLimit(zipPath) {
|
|
191
234
|
const { size } = await (0, promises_1.stat)(zipPath);
|
|
192
235
|
if (size > exports.MAX_ZIP_SIZE_BYTES) {
|
|
193
|
-
throw new
|
|
236
|
+
throw new types_1.ArtifactSizeError(exports.MAX_ZIP_SIZE_BYTES, size);
|
|
194
237
|
}
|
|
195
238
|
return size;
|
|
196
239
|
}
|
|
@@ -217,7 +260,7 @@ function resolveProjectPathsSync(options = {}, agentName) {
|
|
|
217
260
|
? (0, path_1.resolve)(options.pyprojectPath)
|
|
218
261
|
: findUpSync('pyproject.toml', startDir);
|
|
219
262
|
if (!candidatePyproject || !pathExistsSync(candidatePyproject)) {
|
|
220
|
-
throw new
|
|
263
|
+
throw new types_1.MissingProjectFileError(options.pyprojectPath ?? (0, path_1.join)(startDir, 'pyproject.toml'));
|
|
221
264
|
}
|
|
222
265
|
const pyprojectPath = candidatePyproject;
|
|
223
266
|
const projectRoot = options.projectRoot ? (0, path_1.resolve)(options.projectRoot) : (0, path_1.dirname)(pyprojectPath);
|
|
@@ -238,6 +281,66 @@ function resolveProjectPathsSync(options = {}, agentName) {
|
|
|
238
281
|
artifactsDir,
|
|
239
282
|
};
|
|
240
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Resolve filesystem paths for a Node.js/TypeScript agent project during packaging.
|
|
286
|
+
*
|
|
287
|
+
* Locates the nearest package.json (equivalent of pyproject.toml for Python agents),
|
|
288
|
+
* then derives:
|
|
289
|
+
* - projectRoot: directory containing package.json
|
|
290
|
+
* - srcDir: source directory (defaults to projectRoot)
|
|
291
|
+
* - artifactDir: where CDK config and build outputs live (agentcore/ directory)
|
|
292
|
+
* - buildDir/stagingDir: per-agent temp directories used during CodeZip packaging
|
|
293
|
+
*
|
|
294
|
+
* Note: `pyprojectPath` in the return type is reused from the Python ResolvedPaths
|
|
295
|
+
* interface — for Node projects it points to package.json.
|
|
296
|
+
*/
|
|
297
|
+
async function resolveNodeProjectPaths(options = {}, agentName) {
|
|
298
|
+
const startDir = options.projectRoot ? (0, path_1.resolve)(options.projectRoot) : process.cwd();
|
|
299
|
+
const candidatePackageJson = await findUp('package.json', startDir);
|
|
300
|
+
if (!candidatePackageJson || !(await pathExists(candidatePackageJson))) {
|
|
301
|
+
throw new types_1.MissingProjectFileError((0, path_1.join)(startDir, 'package.json'));
|
|
302
|
+
}
|
|
303
|
+
const projectRoot = options.projectRoot ? (0, path_1.resolve)(options.projectRoot) : (0, path_1.dirname)(candidatePackageJson);
|
|
304
|
+
const srcDir = (0, path_1.resolve)(projectRoot, options.srcDir ?? '.');
|
|
305
|
+
const artifactDir = (0, path_1.resolve)(options.artifactDir ?? (0, path_1.join)(projectRoot, constants_1.CONFIG_DIR));
|
|
306
|
+
const name = agentName ?? 'default';
|
|
307
|
+
const buildDir = (0, path_1.join)(artifactDir, name);
|
|
308
|
+
const stagingDir = (0, path_1.join)(buildDir, 'staging');
|
|
309
|
+
const artifactsDir = artifactDir;
|
|
310
|
+
return {
|
|
311
|
+
projectRoot,
|
|
312
|
+
srcDir,
|
|
313
|
+
pyprojectPath: candidatePackageJson,
|
|
314
|
+
artifactDir,
|
|
315
|
+
buildDir,
|
|
316
|
+
stagingDir,
|
|
317
|
+
artifactsDir,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
/** Synchronous version of resolveNodeProjectPaths — used in contexts where async is not available. */
|
|
321
|
+
function resolveNodeProjectPathsSync(options = {}, agentName) {
|
|
322
|
+
const startDir = options.projectRoot ? (0, path_1.resolve)(options.projectRoot) : process.cwd();
|
|
323
|
+
const candidatePackageJson = findUpSync('package.json', startDir);
|
|
324
|
+
if (!candidatePackageJson || !pathExistsSync(candidatePackageJson)) {
|
|
325
|
+
throw new types_1.MissingProjectFileError((0, path_1.join)(startDir, 'package.json'));
|
|
326
|
+
}
|
|
327
|
+
const projectRoot = options.projectRoot ? (0, path_1.resolve)(options.projectRoot) : (0, path_1.dirname)(candidatePackageJson);
|
|
328
|
+
const srcDir = (0, path_1.resolve)(projectRoot, options.srcDir ?? '.');
|
|
329
|
+
const artifactDir = (0, path_1.resolve)(options.artifactDir ?? (0, path_1.join)(projectRoot, constants_1.CONFIG_DIR));
|
|
330
|
+
const name = agentName ?? 'default';
|
|
331
|
+
const buildDir = (0, path_1.join)(artifactDir, name);
|
|
332
|
+
const stagingDir = (0, path_1.join)(buildDir, 'staging');
|
|
333
|
+
const artifactsDir = artifactDir;
|
|
334
|
+
return {
|
|
335
|
+
projectRoot,
|
|
336
|
+
srcDir,
|
|
337
|
+
pyprojectPath: candidatePackageJson,
|
|
338
|
+
artifactDir,
|
|
339
|
+
buildDir,
|
|
340
|
+
stagingDir,
|
|
341
|
+
artifactsDir,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
241
344
|
function ensureDirCleanSync(dir) {
|
|
242
345
|
(0, fs_1.rmSync)(dir, { recursive: true, force: true });
|
|
243
346
|
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
@@ -248,10 +351,7 @@ function copyEntrySync(source, destination, rootDir) {
|
|
|
248
351
|
(0, fs_1.mkdirSync)(destination, { recursive: true });
|
|
249
352
|
const entries = (0, fs_1.readdirSync)(source);
|
|
250
353
|
for (const entry of entries) {
|
|
251
|
-
if (
|
|
252
|
-
continue;
|
|
253
|
-
}
|
|
254
|
-
if (entry === constants_1.CONFIG_DIR && (0, path_1.resolve)(source) === (0, path_1.resolve)(rootDir)) {
|
|
354
|
+
if (shouldExcludeEntry(entry, source, rootDir)) {
|
|
255
355
|
continue;
|
|
256
356
|
}
|
|
257
357
|
copyEntrySync((0, path_1.join)(source, entry), (0, path_1.join)(destination, entry), rootDir);
|
|
@@ -262,7 +362,7 @@ function copyEntrySync(source, destination, rootDir) {
|
|
|
262
362
|
}
|
|
263
363
|
function copySourceTreeSync(srcDir, destination) {
|
|
264
364
|
if (!pathExistsSync(srcDir)) {
|
|
265
|
-
throw new
|
|
365
|
+
throw new types_1.MissingProjectFileError(srcDir);
|
|
266
366
|
}
|
|
267
367
|
copyEntrySync(srcDir, destination, srcDir);
|
|
268
368
|
}
|
|
@@ -277,20 +377,18 @@ function ensureBinaryAvailableSync(binary, installHint) {
|
|
|
277
377
|
return;
|
|
278
378
|
}
|
|
279
379
|
}
|
|
280
|
-
throw new
|
|
380
|
+
throw new types_1.MissingDependencyError(binary, installHint);
|
|
281
381
|
}
|
|
282
|
-
function collectFilesSync(directory,
|
|
382
|
+
function collectFilesSync(directory, basePath = '') {
|
|
283
383
|
const result = {};
|
|
284
384
|
const entries = (0, fs_1.readdirSync)(directory, { withFileTypes: true });
|
|
285
385
|
for (const entry of entries) {
|
|
286
|
-
if (
|
|
287
|
-
continue;
|
|
288
|
-
if (entry.name === constants_1.CONFIG_DIR && (0, path_1.resolve)(directory) === (0, path_1.resolve)(rootDir))
|
|
386
|
+
if (isZipExcludedEntry(entry.name))
|
|
289
387
|
continue;
|
|
290
388
|
const fullPath = (0, path_1.join)(directory, entry.name);
|
|
291
389
|
const zipPath = basePath ? `${basePath}/${entry.name}` : entry.name;
|
|
292
390
|
if (entry.isDirectory()) {
|
|
293
|
-
Object.assign(result, collectFilesSync(fullPath,
|
|
391
|
+
Object.assign(result, collectFilesSync(fullPath, zipPath));
|
|
294
392
|
}
|
|
295
393
|
else if (entry.isFile()) {
|
|
296
394
|
result[zipPath] = [(0, fs_1.readFileSync)(fullPath), { level: 6 }];
|
|
@@ -301,14 +399,14 @@ function collectFilesSync(directory, rootDir, basePath = '') {
|
|
|
301
399
|
function createZipFromDirSync(sourceDir, outputZip) {
|
|
302
400
|
(0, fs_1.rmSync)(outputZip, { force: true });
|
|
303
401
|
(0, fs_1.mkdirSync)((0, path_1.dirname)(outputZip), { recursive: true });
|
|
304
|
-
const files = collectFilesSync(sourceDir
|
|
402
|
+
const files = collectFilesSync(sourceDir);
|
|
305
403
|
const zipped = (0, fflate_1.zipSync)(files);
|
|
306
404
|
(0, fs_1.writeFileSync)(outputZip, zipped);
|
|
307
405
|
}
|
|
308
406
|
function enforceZipSizeLimitSync(zipPath) {
|
|
309
407
|
const { size } = (0, fs_1.statSync)(zipPath);
|
|
310
408
|
if (size > exports.MAX_ZIP_SIZE_BYTES) {
|
|
311
|
-
throw new
|
|
409
|
+
throw new types_1.ArtifactSizeError(exports.MAX_ZIP_SIZE_BYTES, size);
|
|
312
410
|
}
|
|
313
411
|
return size;
|
|
314
412
|
}
|