@nimblebrain/mpak-sdk
Advanced tools
+12
-1
@@ -1185,2 +1185,12 @@ "use strict"; | ||
| * Substitute `${user_config.*}` placeholders in env vars. | ||
| * | ||
| * When a bundle maps the same field to multiple env vars, e.g. | ||
| * `{ "ANTHROPIC_API_KEY": "${user_config.key}", | ||
| * "CLAUDE_API_KEY": "${user_config.key}" }` | ||
| * every mapped var receives the resolved value on spawn, even if the | ||
| * env-alias tier in `gatherUserConfig` only matched one of them in the | ||
| * host process. That's intentional: once a field is resolved, all of | ||
| * the bundle's declared destinations for that field get populated — | ||
| * it's the bundle author's declaration of "these names mean this | ||
| * field to me." Tests pin this behavior down in mpak.test.ts. | ||
| */ | ||
@@ -1191,2 +1201,3 @@ static substituteEnvVars(env, userConfigValues) { | ||
| for (const [key, value] of Object.entries(env)) { | ||
| if (typeof value !== "string") continue; | ||
| result[key] = value.replace( | ||
@@ -1214,3 +1225,3 @@ /\$\{user_config\.([^}]+)\}/g, | ||
| if (!entries) return map; | ||
| const wholeSubstitution = /^\$\{user_config\.([A-Za-z_][A-Za-z0-9_]*)\}$/; | ||
| const wholeSubstitution = /^\$\{user_config\.([^}]+)\}$/; | ||
| for (const [envVar, template] of Object.entries(entries)) { | ||
@@ -1217,0 +1228,0 @@ if (typeof template !== "string") continue; |
+10
-0
@@ -541,2 +541,12 @@ import { BundleSearchParamsInput, BundleSearchResponse, BundleDetail, VersionsResponse, VersionDetail, PlatformInfo, DownloadInfo, SkillSearchParamsInput, SkillSearchResponse, SkillDetail, SkillDownloadInfo, CacheMetadata, McpbManifest, CachedBundleInfo } from '@nimblebrain/mpak-schemas'; | ||
| * Substitute `${user_config.*}` placeholders in env vars. | ||
| * | ||
| * When a bundle maps the same field to multiple env vars, e.g. | ||
| * `{ "ANTHROPIC_API_KEY": "${user_config.key}", | ||
| * "CLAUDE_API_KEY": "${user_config.key}" }` | ||
| * every mapped var receives the resolved value on spawn, even if the | ||
| * env-alias tier in `gatherUserConfig` only matched one of them in the | ||
| * host process. That's intentional: once a field is resolved, all of | ||
| * the bundle's declared destinations for that field get populated — | ||
| * it's the bundle author's declaration of "these names mean this | ||
| * field to me." Tests pin this behavior down in mpak.test.ts. | ||
| */ | ||
@@ -543,0 +553,0 @@ private static substituteEnvVars; |
+10
-0
@@ -541,2 +541,12 @@ import { BundleSearchParamsInput, BundleSearchResponse, BundleDetail, VersionsResponse, VersionDetail, PlatformInfo, DownloadInfo, SkillSearchParamsInput, SkillSearchResponse, SkillDetail, SkillDownloadInfo, CacheMetadata, McpbManifest, CachedBundleInfo } from '@nimblebrain/mpak-schemas'; | ||
| * Substitute `${user_config.*}` placeholders in env vars. | ||
| * | ||
| * When a bundle maps the same field to multiple env vars, e.g. | ||
| * `{ "ANTHROPIC_API_KEY": "${user_config.key}", | ||
| * "CLAUDE_API_KEY": "${user_config.key}" }` | ||
| * every mapped var receives the resolved value on spawn, even if the | ||
| * env-alias tier in `gatherUserConfig` only matched one of them in the | ||
| * host process. That's intentional: once a field is resolved, all of | ||
| * the bundle's declared destinations for that field get populated — | ||
| * it's the bundle author's declaration of "these names mean this | ||
| * field to me." Tests pin this behavior down in mpak.test.ts. | ||
| */ | ||
@@ -543,0 +553,0 @@ private static substituteEnvVars; |
+12
-1
@@ -1147,2 +1147,12 @@ // src/mpakSDK.ts | ||
| * Substitute `${user_config.*}` placeholders in env vars. | ||
| * | ||
| * When a bundle maps the same field to multiple env vars, e.g. | ||
| * `{ "ANTHROPIC_API_KEY": "${user_config.key}", | ||
| * "CLAUDE_API_KEY": "${user_config.key}" }` | ||
| * every mapped var receives the resolved value on spawn, even if the | ||
| * env-alias tier in `gatherUserConfig` only matched one of them in the | ||
| * host process. That's intentional: once a field is resolved, all of | ||
| * the bundle's declared destinations for that field get populated — | ||
| * it's the bundle author's declaration of "these names mean this | ||
| * field to me." Tests pin this behavior down in mpak.test.ts. | ||
| */ | ||
@@ -1153,2 +1163,3 @@ static substituteEnvVars(env, userConfigValues) { | ||
| for (const [key, value] of Object.entries(env)) { | ||
| if (typeof value !== "string") continue; | ||
| result[key] = value.replace( | ||
@@ -1176,3 +1187,3 @@ /\$\{user_config\.([^}]+)\}/g, | ||
| if (!entries) return map; | ||
| const wholeSubstitution = /^\$\{user_config\.([A-Za-z_][A-Za-z0-9_]*)\}$/; | ||
| const wholeSubstitution = /^\$\{user_config\.([^}]+)\}$/; | ||
| for (const [envVar, template] of Object.entries(entries)) { | ||
@@ -1179,0 +1190,0 @@ if (typeof template !== "string") continue; |
+1
-1
| { | ||
| "name": "@nimblebrain/mpak-sdk", | ||
| "version": "0.4.0", | ||
| "version": "0.4.1", | ||
| "description": "TypeScript SDK for mpak registry - MCPB bundles and Agent Skills", | ||
@@ -5,0 +5,0 @@ "author": "NimbleBrain Inc <engineering@mpak.dev>", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
331254
1.61%3136
1.03%