@opencow-ai/opencow-agent-sdk 0.4.24 → 0.4.26
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/dist/capabilities/mcp/codexConfigFields.d.ts +20 -0
- package/dist/capabilities/mcp/envExpansion.d.ts +4 -1
- package/dist/capabilities/plugins/lspPluginIntegration.d.ts +1 -0
- package/dist/capabilities/plugins/mcpPluginIntegration.d.ts +1 -0
- package/dist/cli.mjs +63944 -76705
- package/dist/client.js +31389 -92985
- package/dist/constants/envVars.d.ts +5 -0
- package/dist/controller/loop.d.ts +5 -0
- package/dist/entrypoints/sdk/runtimeTypes.d.ts +16 -0
- package/dist/providers/shared/retry.d.ts +33 -1
- package/dist/sdk.js +31389 -92985
- package/dist/session/attachments.d.ts +9 -0
- package/dist/session/tokens.d.ts +2 -1
- package/dist/types/plugin.d.ts +5 -0
- package/dist/types/replayState.d.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex 插件把第三方授权写成「按名引用」的宿主专属字段:`env_vars`、
|
|
3
|
+
* `bearer_token_env_var`、`env_http_headers`、`http_headers`。MCP 协议与本运行时
|
|
4
|
+
* 都不读这些键,`McpServerConfigSchema` 会把它们当未知字段静默丢弃 —— 结果是插件
|
|
5
|
+
* MCP 启动时没有 Authorization / env,请求必然失败。
|
|
6
|
+
*
|
|
7
|
+
* 因此在校验前把它们翻译成运行时真正读取的 `env` / `headers`,值写成 `${VAR}`
|
|
8
|
+
* 引用,交由 `resolvePluginMcpEnvironment` 展开(值来源见 `SdkManagedPlugin.env`)。
|
|
9
|
+
*
|
|
10
|
+
* 与 Host 侧 `src/shared/mcpConfigConvert.ts` 同一语义;Host 的渲染层依赖使它无法
|
|
11
|
+
* 引用 SDK,两份实现必须同步修改。差异:Host 还要把 mcpb/Claude 的占位写法
|
|
12
|
+
* (`${input:…}`、`${user_config.…}`、`${{ secrets.… }}`)改写成待配置变量,
|
|
13
|
+
* 那是无 user-config 通道时的兜底;这里 `${user_config.…}` 由运行时原生支持,
|
|
14
|
+
* 不做改写。
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* 翻译单个 MCP server 配置(不是 `{ mcpServers: … }` 包装层)。
|
|
18
|
+
* 输入不被修改;非对象输入原样返回。
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeCodexMcpFields(input: unknown): Record<string, unknown>;
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Expand environment variables in a string value
|
|
6
6
|
* Handles ${VAR} and ${VAR:-default} syntax
|
|
7
|
+
* @param env Lookup source for variable values. Defaults to `process.env`;
|
|
8
|
+
* callers pass a per-plugin overlay so plugin-scoped values (e.g. credentials
|
|
9
|
+
* the host collected for that plugin) win over the ambient process env.
|
|
7
10
|
* @returns Object with expanded string and list of missing variables
|
|
8
11
|
*/
|
|
9
|
-
export declare function expandEnvVarsInString(value: string): {
|
|
12
|
+
export declare function expandEnvVarsInString(value: string, env?: Record<string, string | undefined>): {
|
|
10
13
|
expanded: string;
|
|
11
14
|
missingVars: string[];
|
|
12
15
|
};
|
|
@@ -21,6 +21,7 @@ export declare function resolvePluginLspEnvironment(config: LspServerConfig, plu
|
|
|
21
21
|
path: string;
|
|
22
22
|
source: string;
|
|
23
23
|
dataPath?: string;
|
|
24
|
+
env?: Record<string, string>;
|
|
24
25
|
}, userConfig?: PluginOptionValues, _errors?: PluginError[]): LspServerConfig;
|
|
25
26
|
/**
|
|
26
27
|
* Add plugin scope to LSP server configs
|
|
@@ -48,6 +48,7 @@ export declare function resolvePluginMcpEnvironment(config: McpServerConfig, plu
|
|
|
48
48
|
path: string;
|
|
49
49
|
source: string;
|
|
50
50
|
dataPath?: string;
|
|
51
|
+
env?: Record<string, string>;
|
|
51
52
|
}, userConfig?: UserConfigValues, errors?: PluginError[], pluginName?: string, serverName?: string): McpServerConfig;
|
|
52
53
|
/**
|
|
53
54
|
* Get MCP servers from a specific plugin with environment variable resolution and scoping
|