@assemblyline-agents/core 1.0.0 → 3.0.0
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 +1 -1
- package/dist/adapter-metadata.d.ts.map +1 -1
- package/dist/adapter-metadata.js +94 -36
- package/dist/adapter-metadata.js.map +1 -1
- package/dist/agent-capabilities.d.ts +34 -0
- package/dist/agent-capabilities.d.ts.map +1 -0
- package/dist/agent-capabilities.js +50 -0
- package/dist/agent-capabilities.js.map +1 -0
- package/dist/agent-definition.d.ts +43 -0
- package/dist/agent-definition.d.ts.map +1 -0
- package/dist/agent-definition.js +4 -0
- package/dist/agent-definition.js.map +1 -0
- package/dist/agent-hooks.d.ts +60 -0
- package/dist/agent-hooks.d.ts.map +1 -0
- package/dist/agent-hooks.js +198 -0
- package/dist/agent-hooks.js.map +1 -0
- package/dist/agent-state.d.ts +18 -0
- package/dist/agent-state.d.ts.map +1 -0
- package/dist/agent-state.js +2 -0
- package/dist/agent-state.js.map +1 -0
- package/dist/artifact-dir.d.ts +1 -7
- package/dist/artifact-dir.d.ts.map +1 -1
- package/dist/artifact-dir.js +3 -12
- package/dist/artifact-dir.js.map +1 -1
- package/dist/audience.d.ts +16 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/audience.js +2 -0
- package/dist/audience.js.map +1 -0
- package/dist/brand.d.ts +2 -17
- package/dist/brand.d.ts.map +1 -1
- package/dist/brand.js +2 -17
- package/dist/brand.js.map +1 -1
- package/dist/connection-auth.d.ts.map +1 -1
- package/dist/connection-auth.js +17 -2
- package/dist/connection-auth.js.map +1 -1
- package/dist/connection-events.d.ts +35 -0
- package/dist/connection-events.d.ts.map +1 -0
- package/dist/connection-events.js +131 -0
- package/dist/connection-events.js.map +1 -0
- package/dist/connection-types.d.ts +240 -6
- package/dist/connection-types.d.ts.map +1 -1
- package/dist/connection-types.js +8 -1
- package/dist/connection-types.js.map +1 -1
- package/dist/definitions.d.ts +11 -43
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +60 -14
- package/dist/definitions.js.map +1 -1
- package/dist/deploy-secrets.d.ts +16 -0
- package/dist/deploy-secrets.d.ts.map +1 -0
- package/dist/deploy-secrets.js +43 -0
- package/dist/deploy-secrets.js.map +1 -0
- package/dist/deploy.d.ts +17 -5
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js.map +1 -1
- package/dist/harness.d.ts +40 -2
- package/dist/harness.d.ts.map +1 -1
- package/dist/harness.js.map +1 -1
- package/dist/index.d.ts +84 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -2
- package/dist/index.js.map +1 -1
- package/dist/manifest-types.d.ts +138 -22
- package/dist/manifest-types.d.ts.map +1 -1
- package/dist/model-metadata.d.ts +33 -0
- package/dist/model-metadata.d.ts.map +1 -0
- package/dist/model-metadata.js +13 -0
- package/dist/model-metadata.js.map +1 -0
- package/dist/plugin-connection-factories.d.ts +31 -0
- package/dist/plugin-connection-factories.d.ts.map +1 -0
- package/dist/plugin-connection-factories.js +416 -0
- package/dist/plugin-connection-factories.js.map +1 -0
- package/dist/plugin-contract.d.ts +161 -0
- package/dist/plugin-contract.d.ts.map +1 -0
- package/dist/plugin-contract.js +52 -0
- package/dist/plugin-contract.js.map +1 -0
- package/dist/plugin.d.ts +5 -126
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +863 -369
- package/dist/plugin.js.map +1 -1
- package/dist/resource-types.d.ts +1 -1
- package/dist/resource-types.d.ts.map +1 -1
- package/dist/sandbox-file-metadata.d.ts +9 -0
- package/dist/sandbox-file-metadata.d.ts.map +1 -0
- package/dist/sandbox-file-metadata.js +33 -0
- package/dist/sandbox-file-metadata.js.map +1 -0
- package/dist/sandbox-filesystem-contract.d.ts +9 -9
- package/dist/sandbox-filesystem-contract.d.ts.map +1 -1
- package/dist/sandbox-filesystem-contract.js +31 -29
- package/dist/sandbox-filesystem-contract.js.map +1 -1
- package/dist/sandbox-paths.d.ts +1 -1
- package/dist/sandbox-paths.d.ts.map +1 -1
- package/dist/sandbox-paths.js +1 -1
- package/dist/sandbox-paths.js.map +1 -1
- package/dist/sandbox-security.d.ts +0 -3
- package/dist/sandbox-security.d.ts.map +1 -1
- package/dist/sandbox-security.js +7 -12
- package/dist/sandbox-security.js.map +1 -1
- package/dist/sandbox-types.d.ts +74 -3
- package/dist/sandbox-types.d.ts.map +1 -1
- package/dist/sandbox-types.js +13 -1
- package/dist/sandbox-types.js.map +1 -1
- package/dist/secrets-types.d.ts +25 -0
- package/dist/secrets-types.d.ts.map +1 -0
- package/dist/secrets-types.js +22 -0
- package/dist/secrets-types.js.map +1 -0
- package/dist/skill-bundles.d.ts +14 -0
- package/dist/skill-bundles.d.ts.map +1 -0
- package/dist/skill-bundles.js +85 -0
- package/dist/skill-bundles.js.map +1 -0
- package/dist/tool-wire-name.d.ts +8 -0
- package/dist/tool-wire-name.d.ts.map +1 -0
- package/dist/tool-wire-name.js +26 -0
- package/dist/tool-wire-name.js.map +1 -0
- package/package.json +1 -1
- package/dist/env-alias.d.ts +0 -38
- package/dist/env-alias.d.ts.map +0 -1
- package/dist/env-alias.js +0 -82
- package/dist/env-alias.js.map +0 -1
package/dist/sandbox-types.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export interface SandboxSession {
|
|
|
5
5
|
provider?: string;
|
|
6
6
|
metadata?: JsonObject;
|
|
7
7
|
readFile(path: string): MaybePromise<string>;
|
|
8
|
+
/** Byte-preserving exact-path read for binary artifacts. */
|
|
9
|
+
readFileBytes?(path: string): MaybePromise<Uint8Array>;
|
|
8
10
|
writeFile(path: string, contents: string | Uint8Array): MaybePromise<void>;
|
|
9
|
-
listFiles?(path: string, options?:
|
|
10
|
-
excludeTopLevel?: string[];
|
|
11
|
-
}): MaybePromise<SandboxFileEntry[]>;
|
|
11
|
+
listFiles?(path: string, options?: SandboxListFilesOptions): MaybePromise<SandboxFileEntry[]>;
|
|
12
12
|
deletePath?(path: string, options?: {
|
|
13
13
|
recursive?: boolean;
|
|
14
14
|
}): MaybePromise<void>;
|
|
@@ -21,6 +21,14 @@ export interface SandboxSession {
|
|
|
21
21
|
snapshot?(request?: SandboxSnapshotRequest): MaybePromise<SandboxSnapshot>;
|
|
22
22
|
dispose?(): MaybePromise<void>;
|
|
23
23
|
}
|
|
24
|
+
export interface SandboxListFilesOptions {
|
|
25
|
+
/** Directory names pruned only when they are direct children of `path`. */
|
|
26
|
+
excludeTopLevel?: string[];
|
|
27
|
+
/** Maximum entries to return. Adapters must stop traversal once reached. */
|
|
28
|
+
limit?: number;
|
|
29
|
+
/** Load each file body. Defaults to true for persistence and grep scans. */
|
|
30
|
+
includeContents?: boolean;
|
|
31
|
+
}
|
|
24
32
|
export interface SandboxSpawnOptions {
|
|
25
33
|
cwd?: string;
|
|
26
34
|
env?: Record<string, string>;
|
|
@@ -50,8 +58,13 @@ export interface SandboxSnapshotRequest {
|
|
|
50
58
|
}
|
|
51
59
|
export interface SandboxFileEntry {
|
|
52
60
|
path: string;
|
|
61
|
+
/** Empty when `includeContents` is false. */
|
|
53
62
|
contents: string | Uint8Array;
|
|
54
63
|
size?: number;
|
|
64
|
+
/** Providers should report non-regular entries so workspace sync can reject them. */
|
|
65
|
+
kind?: "file" | "symlink" | "other";
|
|
66
|
+
/** Portable POSIX permission bits. Workspace persistence currently preserves executable bits. */
|
|
67
|
+
mode?: number;
|
|
55
68
|
}
|
|
56
69
|
export interface SandboxCommandResult {
|
|
57
70
|
command: string;
|
|
@@ -68,11 +81,69 @@ export interface SandboxSnapshot {
|
|
|
68
81
|
export interface SandboxDefinition {
|
|
69
82
|
adapter: string;
|
|
70
83
|
image?: string;
|
|
84
|
+
/** Immutable build context used to provision a provider-native sandbox environment. */
|
|
85
|
+
environment?: SandboxEnvironmentDefinition;
|
|
71
86
|
workingDirectory?: string;
|
|
72
87
|
env?: string[];
|
|
73
88
|
snapshot?: SandboxSnapshotPolicy;
|
|
74
89
|
metadata?: JsonObject;
|
|
75
90
|
}
|
|
91
|
+
/** Authored, provider-neutral sandbox environment build context. */
|
|
92
|
+
export interface SandboxEnvironmentDefinition {
|
|
93
|
+
/** Directory relative to the owning sandbox definition file. */
|
|
94
|
+
context: string;
|
|
95
|
+
/** Dockerfile path relative to `context`. Defaults to `Dockerfile`. */
|
|
96
|
+
dockerfile?: string;
|
|
97
|
+
/** Command executed inside a temporary sandbox to verify a newly resolved artifact. */
|
|
98
|
+
verifyCommand?: string;
|
|
99
|
+
}
|
|
100
|
+
/** One immutable source file contributing to a compiled sandbox environment. */
|
|
101
|
+
export interface SandboxEnvironmentFile {
|
|
102
|
+
/** Path relative to the environment context. */
|
|
103
|
+
path: string;
|
|
104
|
+
sha256: string;
|
|
105
|
+
size: number;
|
|
106
|
+
}
|
|
107
|
+
/** Compiler-owned environment identity embedded in the agent manifest. */
|
|
108
|
+
export interface CompiledSandboxEnvironment {
|
|
109
|
+
sourceKind: "dockerfile";
|
|
110
|
+
/** Agent-root-relative authored context path. */
|
|
111
|
+
context: string;
|
|
112
|
+
/** Built-artifact-relative copy of the complete context. */
|
|
113
|
+
artifactPath: string;
|
|
114
|
+
/** Path relative to both `context` and `artifactPath`. */
|
|
115
|
+
dockerfile: string;
|
|
116
|
+
verifyCommand?: string;
|
|
117
|
+
/** SHA-256 over the declaration and complete sorted context inventory. */
|
|
118
|
+
fingerprint: string;
|
|
119
|
+
files: SandboxEnvironmentFile[];
|
|
120
|
+
}
|
|
121
|
+
export type SandboxEnvironmentAction = "reused" | "built" | "external";
|
|
122
|
+
/** Input supplied to the selected sandbox provider during hosted deployment. */
|
|
123
|
+
export interface SandboxEnvironmentEnsureInput {
|
|
124
|
+
agentId: string;
|
|
125
|
+
sandboxName: string;
|
|
126
|
+
adapter: string;
|
|
127
|
+
artifactRoot: string;
|
|
128
|
+
environment: CompiledSandboxEnvironment;
|
|
129
|
+
}
|
|
130
|
+
/** Sanitized provider result safe to persist in deployment receipts. */
|
|
131
|
+
export interface SandboxEnvironmentResolution {
|
|
132
|
+
provider: string;
|
|
133
|
+
artifactKind: string;
|
|
134
|
+
fingerprint: string;
|
|
135
|
+
artifactId: string;
|
|
136
|
+
runtimeReference: string;
|
|
137
|
+
action: SandboxEnvironmentAction;
|
|
138
|
+
}
|
|
139
|
+
/** Optional deployment-time facet implemented by sandbox providers with build artifacts. */
|
|
140
|
+
export interface SandboxEnvironmentProvisioner {
|
|
141
|
+
ensureEnvironment(input: SandboxEnvironmentEnsureInput): Promise<SandboxEnvironmentResolution>;
|
|
142
|
+
}
|
|
143
|
+
/** Stable provider-safe base name shared by deploy reconciliation and runtime selection. */
|
|
144
|
+
export declare function sandboxEnvironmentName(agentId: string, sandboxName: string, maxLength?: number): string;
|
|
145
|
+
/** Content-addressed tag owned by Assembly Line; providers must never retarget it. */
|
|
146
|
+
export declare function sandboxEnvironmentTag(fingerprint: string): string;
|
|
76
147
|
export interface InstrumentationSetupContext {
|
|
77
148
|
agentName: string;
|
|
78
149
|
manifest: AgentManifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-types.d.ts","sourceRoot":"","sources":["../src/sandbox-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3E,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"sandbox-types.d.ts","source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qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvE,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,cAAc,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAAC;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB"}
|
package/dist/sandbox-types.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/** Stable provider-safe base name shared by deploy reconciliation and runtime selection. */
|
|
2
|
+
export function sandboxEnvironmentName(agentId, sandboxName, maxLength = 64) {
|
|
3
|
+
const value = `assembly-line-${agentId}-${sandboxName}`
|
|
4
|
+
.toLowerCase()
|
|
5
|
+
.replace(/[^a-z0-9_-]+/gu, "-")
|
|
6
|
+
.replace(/^-+|-+$/gu, "")
|
|
7
|
+
.slice(0, maxLength);
|
|
8
|
+
return value || "assembly-line-agent-sandbox";
|
|
9
|
+
}
|
|
10
|
+
/** Content-addressed tag owned by Assembly Line; providers must never retarget it. */
|
|
11
|
+
export function sandboxEnvironmentTag(fingerprint) {
|
|
12
|
+
return `sha256-${fingerprint}`;
|
|
13
|
+
}
|
|
2
14
|
//# sourceMappingURL=sandbox-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-types.js","sourceRoot":"","sources":["../src/sandbox-types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"sandbox-types.js","sourceRoot":"","sources":["../src/sandbox-types.ts"],"names":[],"mappings":"AA2JA,4FAA4F;AAC5F,MAAM,UAAU,sBAAsB,CAAC,OAAe,EAAE,WAAmB,EAAE,SAAS,GAAG,EAAE;IACzF,MAAM,KAAK,GAAG,iBAAiB,OAAO,IAAI,WAAW,EAAE;SACpD,WAAW,EAAE;SACb,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9B,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACvB,OAAO,KAAK,IAAI,6BAA6B,CAAC;AAChD,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,qBAAqB,CAAC,WAAmB;IACvD,OAAO,UAAU,WAAW,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AgentManifest, MaybePromise } from "./index.js";
|
|
2
|
+
/**
|
|
3
|
+
* A secrets adapter resolves declared environment names to values at boot.
|
|
4
|
+
* The gateway selects one (`secrets: adapter("1password")`); without one the
|
|
5
|
+
* process environment is used as-is. Resolved values overlay the process
|
|
6
|
+
* environment, so the configured store is authoritative for the names it
|
|
7
|
+
* holds and rotation happens in one place.
|
|
8
|
+
*/
|
|
9
|
+
export interface SecretsAdapter {
|
|
10
|
+
/**
|
|
11
|
+
* Resolve the named secrets. Return only the names the store holds; absent
|
|
12
|
+
* names fall back to the process environment. Throw only for store-level
|
|
13
|
+
* failures (bad credentials, unreachable backend) — a missing name is not
|
|
14
|
+
* an error.
|
|
15
|
+
*/
|
|
16
|
+
resolve(names: string[]): MaybePromise<Record<string, string>>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Every environment name the compiled agent declares: env-kind preflight
|
|
20
|
+
* requirements (gateway adapters, model providers, channels, connections,
|
|
21
|
+
* subagents) plus sandbox env projections. This is the exact set a secrets
|
|
22
|
+
* adapter is asked to resolve — stores never inject undeclared names.
|
|
23
|
+
*/
|
|
24
|
+
export declare function manifestSecretEnvNames(manifest: AgentManifest): string[];
|
|
25
|
+
//# sourceMappingURL=secrets-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-types.d.ts","sourceRoot":"","sources":["../src/secrets-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,CAWxE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every environment name the compiled agent declares: env-kind preflight
|
|
3
|
+
* requirements (gateway adapters, model providers, channels, connections,
|
|
4
|
+
* subagents) plus sandbox env projections. This is the exact set a secrets
|
|
5
|
+
* adapter is asked to resolve — stores never inject undeclared names.
|
|
6
|
+
*/
|
|
7
|
+
export function manifestSecretEnvNames(manifest) {
|
|
8
|
+
const names = new Set();
|
|
9
|
+
for (const requirement of manifest.preflight) {
|
|
10
|
+
if (requirement.kind !== "env")
|
|
11
|
+
continue;
|
|
12
|
+
names.add(requirement.name);
|
|
13
|
+
for (const alternative of requirement.alternatives ?? [])
|
|
14
|
+
names.add(alternative);
|
|
15
|
+
}
|
|
16
|
+
for (const sandbox of manifest.sandboxes) {
|
|
17
|
+
for (const name of sandbox.env)
|
|
18
|
+
names.add(name);
|
|
19
|
+
}
|
|
20
|
+
return [...names].sort();
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=secrets-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-types.js","sourceRoot":"","sources":["../src/secrets-types.ts"],"names":[],"mappings":"AAmBA;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAuB;IAC5D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,WAAW,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC7C,IAAI,WAAW,CAAC,IAAI,KAAK,KAAK;YAAE,SAAS;QACzC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5B,KAAK,MAAM,WAAW,IAAI,WAAW,CAAC,YAAY,IAAI,EAAE;YAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACnF,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;QACzC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,GAAG;YAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared skill-bundle constants and helpers used by the compiler (discovery,
|
|
3
|
+
* packaging) and the runtime (projection, hydration). A skill bundle is the
|
|
4
|
+
* top-level folder `skills/<id>` of an agent: a standalone skill folder or a
|
|
5
|
+
* multi-skill plugin pack.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PLUGIN_MANIFEST_RELATIVE_PATH = ".assembly-line-plugin/plugin.json";
|
|
8
|
+
export declare const SKILL_BUNDLE_MAX_FILES = 2000;
|
|
9
|
+
export declare const SKILL_BUNDLE_MAX_BYTES: number;
|
|
10
|
+
/** Directory or file names excluded from skill bundles (OS junk, VCS, caches, build output). */
|
|
11
|
+
export declare function isSkillBundleJunkEntry(name: string): boolean;
|
|
12
|
+
/** Extension-derived content type for a bundle resource path. */
|
|
13
|
+
export declare function contentTypeForPath(path: string): string;
|
|
14
|
+
//# sourceMappingURL=skill-bundles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-bundles.d.ts","sourceRoot":"","sources":["../src/skill-bundles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,6BAA6B,sCAAsC,CAAC;AAEjF,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAAmB,CAAC;AAcvD,gGAAgG;AAChG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK5D;AAmDD,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKvD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared skill-bundle constants and helpers used by the compiler (discovery,
|
|
3
|
+
* packaging) and the runtime (projection, hydration). A skill bundle is the
|
|
4
|
+
* top-level folder `skills/<id>` of an agent: a standalone skill folder or a
|
|
5
|
+
* multi-skill plugin pack.
|
|
6
|
+
*/
|
|
7
|
+
export const PLUGIN_MANIFEST_RELATIVE_PATH = ".assembly-line-plugin/plugin.json";
|
|
8
|
+
export const SKILL_BUNDLE_MAX_FILES = 2000;
|
|
9
|
+
export const SKILL_BUNDLE_MAX_BYTES = 64 * 1024 * 1024;
|
|
10
|
+
const JUNK_ENTRY_NAMES = new Set([
|
|
11
|
+
".DS_Store",
|
|
12
|
+
".git",
|
|
13
|
+
"__pycache__",
|
|
14
|
+
"node_modules",
|
|
15
|
+
".pytest_cache",
|
|
16
|
+
".mypy_cache",
|
|
17
|
+
".ruff_cache",
|
|
18
|
+
".venv",
|
|
19
|
+
"Thumbs.db"
|
|
20
|
+
]);
|
|
21
|
+
/** Directory or file names excluded from skill bundles (OS junk, VCS, caches, build output). */
|
|
22
|
+
export function isSkillBundleJunkEntry(name) {
|
|
23
|
+
if (JUNK_ENTRY_NAMES.has(name))
|
|
24
|
+
return true;
|
|
25
|
+
if (name.endsWith(".pyc"))
|
|
26
|
+
return true;
|
|
27
|
+
if (name.endsWith(".egg-info"))
|
|
28
|
+
return true;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const TEXT_CONTENT_TYPES = {
|
|
32
|
+
md: "text/markdown",
|
|
33
|
+
markdown: "text/markdown",
|
|
34
|
+
txt: "text/plain",
|
|
35
|
+
json: "application/json",
|
|
36
|
+
yaml: "application/yaml",
|
|
37
|
+
yml: "application/yaml",
|
|
38
|
+
toml: "application/toml",
|
|
39
|
+
csv: "text/csv",
|
|
40
|
+
tsv: "text/tab-separated-values",
|
|
41
|
+
py: "text/x-python",
|
|
42
|
+
js: "text/javascript",
|
|
43
|
+
mjs: "text/javascript",
|
|
44
|
+
cjs: "text/javascript",
|
|
45
|
+
ts: "text/x-typescript",
|
|
46
|
+
tsx: "text/x-typescript",
|
|
47
|
+
jsx: "text/javascript",
|
|
48
|
+
css: "text/css",
|
|
49
|
+
html: "text/html",
|
|
50
|
+
htm: "text/html",
|
|
51
|
+
svg: "image/svg+xml",
|
|
52
|
+
xml: "application/xml",
|
|
53
|
+
sh: "text/x-shellscript",
|
|
54
|
+
sql: "text/x-sql",
|
|
55
|
+
gitignore: "text/plain"
|
|
56
|
+
};
|
|
57
|
+
const BINARY_CONTENT_TYPES = {
|
|
58
|
+
png: "image/png",
|
|
59
|
+
jpg: "image/jpeg",
|
|
60
|
+
jpeg: "image/jpeg",
|
|
61
|
+
gif: "image/gif",
|
|
62
|
+
webp: "image/webp",
|
|
63
|
+
ico: "image/x-icon",
|
|
64
|
+
pdf: "application/pdf",
|
|
65
|
+
zip: "application/zip",
|
|
66
|
+
gz: "application/gzip",
|
|
67
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
68
|
+
xls: "application/vnd.ms-excel",
|
|
69
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
70
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
71
|
+
woff: "font/woff",
|
|
72
|
+
woff2: "font/woff2",
|
|
73
|
+
ttf: "font/ttf",
|
|
74
|
+
mp3: "audio/mpeg",
|
|
75
|
+
mp4: "video/mp4",
|
|
76
|
+
wav: "audio/wav"
|
|
77
|
+
};
|
|
78
|
+
/** Extension-derived content type for a bundle resource path. */
|
|
79
|
+
export function contentTypeForPath(path) {
|
|
80
|
+
const base = path.slice(path.lastIndexOf("/") + 1);
|
|
81
|
+
const dot = base.lastIndexOf(".");
|
|
82
|
+
const extension = dot >= 0 ? base.slice(dot + 1).toLowerCase() : "";
|
|
83
|
+
return TEXT_CONTENT_TYPES[extension] ?? BINARY_CONTENT_TYPES[extension] ?? "application/octet-stream";
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=skill-bundles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-bundles.js","sourceRoot":"","sources":["../src/skill-bundles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG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B,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,oBAAoB,GAA2B;IACnD,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,iBAAiB;IACtB,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,mEAAmE;IACzE,GAAG,EAAE,0BAA0B;IAC/B,IAAI,EAAE,yEAAyE;IAC/E,IAAI,EAAE,2EAA2E;IACjF,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;CACjB,CAAC;AAEF,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,OAAO,kBAAkB,CAAC,SAAS,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,IAAI,0BAA0B,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PROVIDER_TOOL_NAME_PATTERN: RegExp;
|
|
2
|
+
export declare const PROVIDER_TOOL_NAME_MAX_LENGTH = 64;
|
|
3
|
+
/**
|
|
4
|
+
* Return a deterministic model-provider wire name while preserving the
|
|
5
|
+
* canonical runtime name as the authorization and execution identity.
|
|
6
|
+
*/
|
|
7
|
+
export declare function providerSafeToolName(name: string, canonicalName?: string, forceAlias?: boolean): string;
|
|
8
|
+
//# sourceMappingURL=tool-wire-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-wire-name.d.ts","sourceRoot":"","sources":["../src/tool-wire-name.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,QAAsB,CAAC;AAC9D,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAIhD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,SAAO,EAAE,UAAU,UAAQ,GAAG,MAAM,CAgBnG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
export const PROVIDER_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/u;
|
|
3
|
+
export const PROVIDER_TOOL_NAME_MAX_LENGTH = 64;
|
|
4
|
+
const PROVIDER_TOOL_ALIAS_HASH_LENGTH = 12;
|
|
5
|
+
/**
|
|
6
|
+
* Return a deterministic model-provider wire name while preserving the
|
|
7
|
+
* canonical runtime name as the authorization and execution identity.
|
|
8
|
+
*/
|
|
9
|
+
export function providerSafeToolName(name, canonicalName = name, forceAlias = false) {
|
|
10
|
+
if (!forceAlias && PROVIDER_TOOL_NAME_PATTERN.test(name) && name.length <= PROVIDER_TOOL_NAME_MAX_LENGTH) {
|
|
11
|
+
return name;
|
|
12
|
+
}
|
|
13
|
+
const normalized = name
|
|
14
|
+
.normalize("NFKD")
|
|
15
|
+
.replace(/[\u0300-\u036f]/gu, "")
|
|
16
|
+
.replace(/[^a-zA-Z0-9_-]+/gu, "_")
|
|
17
|
+
.replace(/^[-_]+|[-_]+$/gu, "") || "tool";
|
|
18
|
+
const hash = createHash("sha256")
|
|
19
|
+
.update(canonicalName)
|
|
20
|
+
.digest("hex")
|
|
21
|
+
.slice(0, PROVIDER_TOOL_ALIAS_HASH_LENGTH);
|
|
22
|
+
const baseLength = PROVIDER_TOOL_NAME_MAX_LENGTH - hash.length - 1;
|
|
23
|
+
const base = normalized.slice(0, baseLength).replace(/[-_]+$/gu, "") || "tool";
|
|
24
|
+
return `${base}_${hash}`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=tool-wire-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-wire-name.js","sourceRoot":"","sources":["../src/tool-wire-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC;AAC9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEhD,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,aAAa,GAAG,IAAI,EAAE,UAAU,GAAG,KAAK;IACzF,IAAI,CAAC,UAAU,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,6BAA6B,EAAE,CAAC;QACzG,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,IAAI;SACpB,SAAS,CAAC,MAAM,CAAC;SACjB,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC;SACjC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC;IAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC;SAC9B,MAAM,CAAC,aAAa,CAAC;SACrB,MAAM,CAAC,KAAK,CAAC;SACb,KAAK,CAAC,CAAC,EAAE,+BAA+B,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,6BAA6B,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACnE,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC;IAC/E,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
package/package.json
CHANGED
package/dist/env-alias.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environment-variable aliasing for the OpenEve -> Assembly Line rename.
|
|
3
|
-
*
|
|
4
|
-
* Unlike every other renamed surface (routes, exports, bins, artifact/hosts
|
|
5
|
-
* file names), this mirror is PERMANENT, not a soak-window shim: host
|
|
6
|
-
* environments are free to keep the `OPENEVE_*` spelling forever. The
|
|
7
|
-
* contract is a uniform prefix bijection: every `ASSEMBLY_LINE_X` has the
|
|
8
|
-
* legacy spelling `OPENEVE_X` and vice versa. Aliasing mirrors each value
|
|
9
|
-
* under both names so existing read sites (including prefix rules like
|
|
10
|
-
* `OPENEVE_VPS_BACKUP_*` and the `OPENEVE_*_RATE_LIMIT` family) keep working
|
|
11
|
-
* without per-site edits. Precedence: the new name wins; equal duplicates are
|
|
12
|
-
* accepted; conflicting duplicates are a hard error.
|
|
13
|
-
*/
|
|
14
|
-
export declare function canonicalEnvName(name: string): string;
|
|
15
|
-
export declare function legacyEnvName(name: string): string;
|
|
16
|
-
export declare class EnvAliasConflictError extends Error {
|
|
17
|
-
readonly names: readonly [string, string];
|
|
18
|
-
constructor(newName: string, legacyName: string);
|
|
19
|
-
}
|
|
20
|
-
export interface AppliedEnvAliases {
|
|
21
|
-
env: Record<string, string | undefined>;
|
|
22
|
-
/** Variables supplied only under their legacy `OPENEVE_*` name. */
|
|
23
|
-
legacyOnlyNames: string[];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Returns a copy of `env` where every branded variable is readable under both
|
|
27
|
-
* its `ASSEMBLY_LINE_*` and `OPENEVE_*` spellings. Throws
|
|
28
|
-
* {@link EnvAliasConflictError} when both spellings are set to different
|
|
29
|
-
* values. The input record is not mutated.
|
|
30
|
-
*/
|
|
31
|
-
export declare function applyEnvAliases(env: Record<string, string | undefined>): AppliedEnvAliases;
|
|
32
|
-
/**
|
|
33
|
-
* Mirrors branded variables into `target` in place (used for `process.env`,
|
|
34
|
-
* which must keep its exotic binding). Same precedence rules as
|
|
35
|
-
* {@link applyEnvAliases}.
|
|
36
|
-
*/
|
|
37
|
-
export declare function mirrorEnvAliasesInPlace(target: Record<string, string | undefined>): AppliedEnvAliases;
|
|
38
|
-
//# sourceMappingURL=env-alias.d.ts.map
|
package/dist/env-alias.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-alias.d.ts","sourceRoot":"","sources":["../src/env-alias.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAE9B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAQhD;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,mEAAmE;IACnE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,iBAAiB,CAyB1F;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,iBAAiB,CAMrG"}
|
package/dist/env-alias.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ENV_PREFIX, LEGACY_ENV_PREFIX } from "./brand.js";
|
|
2
|
-
/**
|
|
3
|
-
* Environment-variable aliasing for the OpenEve -> Assembly Line rename.
|
|
4
|
-
*
|
|
5
|
-
* Unlike every other renamed surface (routes, exports, bins, artifact/hosts
|
|
6
|
-
* file names), this mirror is PERMANENT, not a soak-window shim: host
|
|
7
|
-
* environments are free to keep the `OPENEVE_*` spelling forever. The
|
|
8
|
-
* contract is a uniform prefix bijection: every `ASSEMBLY_LINE_X` has the
|
|
9
|
-
* legacy spelling `OPENEVE_X` and vice versa. Aliasing mirrors each value
|
|
10
|
-
* under both names so existing read sites (including prefix rules like
|
|
11
|
-
* `OPENEVE_VPS_BACKUP_*` and the `OPENEVE_*_RATE_LIMIT` family) keep working
|
|
12
|
-
* without per-site edits. Precedence: the new name wins; equal duplicates are
|
|
13
|
-
* accepted; conflicting duplicates are a hard error.
|
|
14
|
-
*/
|
|
15
|
-
export function canonicalEnvName(name) {
|
|
16
|
-
return name.startsWith(LEGACY_ENV_PREFIX)
|
|
17
|
-
? `${ENV_PREFIX}${name.slice(LEGACY_ENV_PREFIX.length)}`
|
|
18
|
-
: name;
|
|
19
|
-
}
|
|
20
|
-
export function legacyEnvName(name) {
|
|
21
|
-
return name.startsWith(ENV_PREFIX)
|
|
22
|
-
? `${LEGACY_ENV_PREFIX}${name.slice(ENV_PREFIX.length)}`
|
|
23
|
-
: name;
|
|
24
|
-
}
|
|
25
|
-
export class EnvAliasConflictError extends Error {
|
|
26
|
-
names;
|
|
27
|
-
constructor(newName, legacyName) {
|
|
28
|
-
super(`Conflicting values for ${newName} and ${legacyName}. ` +
|
|
29
|
-
`These are aliases for the same setting; set one, or set both to the same value.`);
|
|
30
|
-
this.name = "EnvAliasConflictError";
|
|
31
|
-
this.names = [newName, legacyName];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Returns a copy of `env` where every branded variable is readable under both
|
|
36
|
-
* its `ASSEMBLY_LINE_*` and `OPENEVE_*` spellings. Throws
|
|
37
|
-
* {@link EnvAliasConflictError} when both spellings are set to different
|
|
38
|
-
* values. The input record is not mutated.
|
|
39
|
-
*/
|
|
40
|
-
export function applyEnvAliases(env) {
|
|
41
|
-
const merged = { ...env };
|
|
42
|
-
const legacyOnlyNames = [];
|
|
43
|
-
for (const [name, value] of Object.entries(env)) {
|
|
44
|
-
if (value === undefined)
|
|
45
|
-
continue;
|
|
46
|
-
if (name.startsWith(ENV_PREFIX)) {
|
|
47
|
-
const legacy = legacyEnvName(name);
|
|
48
|
-
const legacyValue = env[legacy];
|
|
49
|
-
if (legacyValue !== undefined && legacyValue !== value) {
|
|
50
|
-
throw new EnvAliasConflictError(name, legacy);
|
|
51
|
-
}
|
|
52
|
-
merged[legacy] = value;
|
|
53
|
-
}
|
|
54
|
-
else if (name.startsWith(LEGACY_ENV_PREFIX)) {
|
|
55
|
-
const canonical = canonicalEnvName(name);
|
|
56
|
-
const canonicalValue = env[canonical];
|
|
57
|
-
if (canonicalValue !== undefined) {
|
|
58
|
-
if (canonicalValue !== value)
|
|
59
|
-
throw new EnvAliasConflictError(canonical, name);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
merged[canonical] = value;
|
|
63
|
-
legacyOnlyNames.push(name);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
legacyOnlyNames.sort();
|
|
67
|
-
return { env: merged, legacyOnlyNames };
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Mirrors branded variables into `target` in place (used for `process.env`,
|
|
71
|
-
* which must keep its exotic binding). Same precedence rules as
|
|
72
|
-
* {@link applyEnvAliases}.
|
|
73
|
-
*/
|
|
74
|
-
export function mirrorEnvAliasesInPlace(target) {
|
|
75
|
-
const applied = applyEnvAliases({ ...target });
|
|
76
|
-
for (const [name, value] of Object.entries(applied.env)) {
|
|
77
|
-
if (value !== undefined && target[name] === undefined)
|
|
78
|
-
target[name] = value;
|
|
79
|
-
}
|
|
80
|
-
return { env: target, legacyOnlyNames: applied.legacyOnlyNames };
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=env-alias.js.map
|
package/dist/env-alias.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-alias.js","sourceRoot":"","sources":["../src/env-alias.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;QACvC,CAAC,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE;QACxD,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAChC,CAAC,CAAC,GAAG,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACxD,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,KAAK,CAA4B;IAE1C,YAAY,OAAe,EAAE,UAAkB;QAC7C,KAAK,CACH,0BAA0B,OAAO,QAAQ,UAAU,IAAI;YACrD,iFAAiF,CACpF,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrC,CAAC;CACF;AAQD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAuC;IACrE,MAAM,MAAM,GAAuC,EAAE,GAAG,GAAG,EAAE,CA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