From 0b0367e34b03fffdc672e20adb5125bab757e3e6 Mon Sep 17 00:00:00 2001 From: anycodes <21079031+anycodes@users.noreply.github.com> Date: Thu, 5 Nov 2026 08:12:15 +0000 Subject: [PATCH 1/3] feat(client): invoke registered application commands --- .agents/README.md | 2 + ...26-11-05-application-command-invocation.md | 31 ++++ ...26-11-05-application-command-invocation.md | 41 +++++ .github/workflows/ci.yml | 2 +- CHANGELOG.md | 5 + README.md | 8 +- README.zh-CN.md | 8 +- docs/configuration.md | 5 +- docs/configuration.zh-CN.md | 5 +- docs/server-client.md | 22 ++- docs/server-client.zh-CN.md | 21 ++- src/config-keys.json | 22 +++ src/index.ts | 4 + src/server-client.ts | 142 ++++++++++++++---- test/agent-loop.test.mjs | 55 +++++++ test/config-keys.test.mjs | 12 +- test/server-client.test.mjs | 109 ++++++++++++++ 17 files changed, 453 insertions(+), 41 deletions(-) create mode 100644 .agents/evidence/verify/2026-11-05-application-command-invocation.md create mode 100644 .agents/notes/proposed/feature/2026-11-05-application-command-invocation.md diff --git a/.agents/README.md b/.agents/README.md index 3621ec8..2f83d6d 100644 --- a/.agents/README.md +++ b/.agents/README.md @@ -1,5 +1,7 @@ # Node SDK engineering records +- [Application command invocation](notes/proposed/feature/2026-11-05-application-command-invocation.md) · [verification](evidence/verify/2026-11-05-application-command-invocation.md). + ## Current delivery — 2026-10-25 - Source package version: **0.1.0**. [Source installation](../README.md#install) builds and packs the SDK. The recorded delivery is source merge, not npm publication. diff --git a/.agents/evidence/verify/2026-11-05-application-command-invocation.md b/.agents/evidence/verify/2026-11-05-application-command-invocation.md new file mode 100644 index 0000000..73288f9 --- /dev/null +++ b/.agents/evidence/verify/2026-11-05-application-command-invocation.md @@ -0,0 +1,31 @@ +# Verification: Application command invocation + +- Date: 2026-11-05 +- Change: application-command-invocation; owner Issue https://github.com/Alibaba-Agent-Sandbox/nodejs-sdk/issues/23 +- Result: PARTIAL +- Baseline: 1505b61a10a819c299c25f31ba508af2d8cb4ba6 +- Environment: Node 22.22.2, Python 3.11.15, matching local Python client/server source. No cloud credentials are required or passed to these tests. + +## What was verified + +Registered application commands preserve typed JSON arguments and separate request timeouts. Requests retain the bound proxy prefix, signed query and distinct application/traffic headers. The actual local Python runtime discovers and executes a registered function with business fields named timeout, name, arguments, server_port and requestTimeout, and returns expected validation/not-found errors. + +## Commands run + +`npm run build && node --test --test-name-pattern='named application commands' test/server-client.test.mjs` first failed all three new behavior tests because the API was absent. After implementation all three passed. + +`npm ci --ignore-scripts --no-audit --no-fund`, `npm run typecheck`, `node examples/agent-loop.mjs` and `npm pack --dry-run` passed. `npm test`, with the matched Python environment on the child process PATH, passed all 36 tests, including the real registered-command service and both existing agent-loop tests. An intermediate configuration test failed because its old expected key count was 21; the synchronized schema adds security_token as key 22, and the complete canonical-name and secret-key checks now pass. + +A further observable regression first failed when a response sent headers but delayed its JSON body: timeout escaped as DOMException instead of ConnectionError, and controllers were released too early to support client-close cancellation during body reads. The request lifetime now includes body consumption. Timeout, close, server errors and no-replay checks pass in the full run. + +## Independent review + +A separate SDK reviewer inspected the complete diff and reran all 36 tests successfully. The reviewer found fractional request seconds could reach AbortSignal.timeout as a non-integer and throw RangeError before cleanup. Timeout conversion now rounds up to whole milliseconds, rejects unsupported timer ranges before I/O, and constructs cancellation signals inside the controller lifetime. A fractional 0.0105-second regression and an oversized-value rejection pass in the complete 36-test run. No remaining blocking issue was found in metadata, URL/query binding, argument separation or authentication. + +## Cleanup + +The registered-command Python process exited on SIGTERM; its temporary source/data directory was removed. Existing agent-loop fixtures also cleaned up. No cloud resource was created. + +## Not verified + +The remote matrix and exact companion schema pin remain pending. Independent review is complete. This is application HTTP evidence, not cloud lifecycle acceptance or npm publication. diff --git a/.agents/notes/proposed/feature/2026-11-05-application-command-invocation.md b/.agents/notes/proposed/feature/2026-11-05-application-command-invocation.md new file mode 100644 index 0000000..fcdf81d --- /dev/null +++ b/.agents/notes/proposed/feature/2026-11-05-application-command-invocation.md @@ -0,0 +1,41 @@ +# Decision: Invoke registered application commands with separate arguments + +Status: proposed + +## Problem + +The application HTTP client supports shell and file operations but omits the server's registered function API. Mixing function arguments with request options would reserve normal business names such as timeout. The current shared configuration export also lacks the STS session-token key being added by its Python owner. + +## Decision + +Add ServerCommandsApi to ServerClient with explicit list and invoke methods. Reuse the existing bound HTTP transport, separate gateway/application authentication, redirect refusal and non-replayed mutation behavior. Preserve the package's application HTTP scope. Import the updated configuration export without aliases or an independent configuration registry. + +## API Design + +`commands.list(): Promise` reads GET /commands. `commands.invoke(name, arguments, { requestTimeout }): Promise` sends the argument object to POST /commands/{name}; HTTP timeout is in seconds and is never added to the business object. Metadata types and ServerCommandsApi are public exports. Runtime protocol validation checks metadata and the result envelope, while callers validate their own business result type. + +## Alternatives considered + +- Merge transport fields into business arguments: rejected because names collide. +- Add a Node cloud lifecycle SDK: rejected because it exceeds this package's existing scope and duplicates provider mappings. +- Call arbitrary paths or follow redirects: rejected because it breaks the authenticated endpoint binding. + +## Dependencies + +The existing Python server command protocol and its Python-owned configuration schema. Companion contract: https://github.com/Alibaba-Agent-Sandbox/python-sdk/issues/152 . Owner issue: https://github.com/Alibaba-Agent-Sandbox/nodejs-sdk/issues/23 . + +## Test Strategy + +Regression-first HTTP tests cover typed arguments, gateway binding, status preservation, no mutation replay and malformed responses. A real local Python server registers a function with conflicting business names and verifies discovery, invocation and rejected calls. Run typecheck, the complete Node suite, the example and package checks; compare the whole configuration schema against the exact companion source commit in CI. + +## Acceptance criteria + +- Conflicting business argument names are preserved unchanged. +- Existing authentication and bound endpoint protections remain effective. +- Real registered function invocation and the existing local example pass. +- Full required local/remote checks and independent review pass before merge. +- English/Chinese usage, public exports, shared configuration and evidence are consistent. + +## Evidence + +- [Verification](../../../evidence/verify/2026-11-05-application-command-invocation.md). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27c9299..2e44c35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 with: repository: Alibaba-Agent-Sandbox/python-sdk - ref: 98642ae6712a5017e187cae7952a2b3c819c1ece + ref: 1aef5f67ab54131ab1e6a060034a3c1f8b5c6e5d path: vendor/python-sdk persist-credentials: false - name: Verify shared application authentication vectors diff --git a/CHANGELOG.md b/CHANGELOG.md index 58774b7..d2e0cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ ### Fixed +- Keep request timeout and client-close cancellation active while reading an application response body. / 读取应用响应体期间继续执行超时和客户端关闭取消。 + - Reject control characters before URL normalization and recursively encoded namespace escapes/query-key collisions before an authenticated request can reach another sandbox. - Preserve sandbox proxy prefixes and signed query bytes; reject redirects, URL userinfo, escaping paths and credential/header collisions. Separate gateway headers from the application token and omit signed query credentials from diagnostics. @@ -35,5 +37,8 @@ ### Added +- Discover and invoke registered application commands with separate business arguments and HTTP request options. / 支持发现和调用已注册应用命令,业务参数与 HTTP 请求选项分开。 +- Export the shared `security_token` configuration name (`ALIBABA_CLOUD_SECURITY_TOKEN`) for STS credentials. / 导出 STS 凭据的共享配置名 `security_token`。 + - A PR CI matrix for Node.js 20/22, including the existing real local server loop against a pinned Python server source. No publication workflow is added. diff --git a/README.md b/README.md index 051c971..1ccfc14 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **English** | [中文](README.zh-CN.md) -Call sandbox application services from JavaScript or TypeScript. `@agent-sandbox/sdk` provides an HTTP `ServerClient` for running shell commands and transferring files, plus shared configuration-name helpers. +Call sandbox application services from JavaScript or TypeScript. `@agent-sandbox/sdk` provides an HTTP `ServerClient` for running shell commands, invoking registered application functions and transferring files, plus shared configuration-name helpers. Requires Node.js 20+ and ESM. Create the sandbox and start its service with the [abx CLI](https://github.com/Alibaba-Agent-Sandbox/agent-sandbox) or [Python SDK](https://github.com/Alibaba-Agent-Sandbox/python-sdk); this package connects to that running service. @@ -56,11 +56,15 @@ try { | --- | --- | | `health()` | Check the application service | | `process.shell(command, options)` | Execute a process and read its result | +| `commands.list()` | Discover registered application commands | +| `commands.invoke(name, arguments, options)` | Invoke an application command with JSON arguments | | `files.upload(path, data)` | Upload bytes | | `files.download(path)` / `files.readText(path)` | Download bytes or text | | `close()` | Release the client | -Commands are tokenized by the server; use `sh -c` when shell expansion or pipes are needed. Cloud lifecycle, interpreter, PTY and browser clients are outside this package's current scope. Closing the HTTP client leaves the sandbox running; delete the sandbox through the tool that created it. +Shell commands are tokenized by the server; use `sh -c` when shell expansion or pipes are needed. Registered application commands require a service that has loaded those functions. Their JSON arguments stay separate from request options, so a business field named `timeout` is preserved: `server.commands.invoke("job", { timeout: 5 }, { requestTimeout: 30 })`. See the [HTTP client reference](docs/server-client.md). + +Cloud lifecycle, interpreter, PTY and browser clients are outside this package's current scope. Closing the HTTP client leaves the sandbox running; delete the sandbox through the tool that created it. ## Configuration helpers diff --git a/README.zh-CN.md b/README.zh-CN.md index ef66862..ffc5567 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -2,7 +2,7 @@ **中文** | [English](README.md) -在 JavaScript 或 TypeScript 中调用沙箱应用服务。`@agent-sandbox/sdk` 提供用于执行命令和传输文件的 HTTP `ServerClient`,以及共享配置名查询工具。 +在 JavaScript 或 TypeScript 中调用沙箱应用服务。`@agent-sandbox/sdk` 提供用于执行 Shell 命令、调用已注册应用函数和传输文件的 HTTP `ServerClient`,以及共享配置名查询工具。 需要 Node.js 20+,仅支持 ESM。先用 [abx CLI](https://github.com/Alibaba-Agent-Sandbox/agent-sandbox) 或 [Python SDK](https://github.com/Alibaba-Agent-Sandbox/python-sdk)创建沙箱并启动服务,再通过本包连接。 @@ -56,11 +56,15 @@ try { | --- | --- | | `health()` | 检查应用服务 | | `process.shell(command, options)` | 执行进程并读取结果 | +| `commands.list()` | 查询已注册应用命令 | +| `commands.invoke(name, arguments, options)` | 以 JSON 参数调用应用命令 | | `files.upload(path, data)` | 上传字节 | | `files.download(path)` / `files.readText(path)` | 下载字节或文本 | | `close()` | 释放客户端 | -服务端会拆分命令参数,需要变量展开或管道时使用 `sh -c`。当前包不提供云端生命周期、解释器、PTY 或浏览器客户端。关闭 HTTP 客户端后沙箱仍在运行,应通过创建沙箱的工具将其删除。 +服务端会拆分 Shell 命令参数,需要变量展开或管道时使用 `sh -c`。调用应用命令前,服务必须已加载对应函数。业务 JSON 参数与请求选项分开,因此名为 `timeout` 的业务字段也能完整传递:`server.commands.invoke("job", { timeout: 5 }, { requestTimeout: 30 })`。详见 [HTTP 客户端参考](docs/server-client.zh-CN.md)。 + +当前包不提供云端生命周期、解释器、PTY 或浏览器客户端。关闭 HTTP 客户端后沙箱仍在运行,应通过创建沙箱的工具将其删除。 ## 配置工具 diff --git a/docs/configuration.md b/docs/configuration.md index a1d6bc4..57bfb94 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -11,13 +11,13 @@ The table exports configuration names. `readEnv` only reads a value; it does not `src/config-keys.json` is the canonical list, exported from `python -m agent_sandbox.utils.config_keys --json`. Each key has exactly one environment variable. There are no aliases. `readEnv` reads only that name. `configSchema.reserved_provider_ids` follows the -[Python registry](https://github.com/Alibaba-Agent-Sandbox/python-sdk/blob/145341d462df2f4753c03a62365114f1872acd1a/client-sdk/src/agent_sandbox/utils/config_keys.py): +[Python registry](https://github.com/Alibaba-Agent-Sandbox/python-sdk/blob/main/client-sdk/src/agent_sandbox/utils/config_keys.py): built-in/core identifiers stay reserved, while the installable catalog id `e2b` is available. Provider execution belongs to the Python SDK and `abx`. Product keys use the `ABX_` prefix: `ABX_SANDBOX_API_KEY`, `ABX_SANDBOX_BASE_URL`, `ABX_SANDBOX_DOMAIN`, `ABX_PROVIDER`. -Where the vendor already publishes a name, that name is the environment variable: `ALICLOUD_ACCESS_KEY_ID`, `ALICLOUD_ACCESS_KEY_SECRET`, `ALIBABA_CLOUD_REGION_ID`, and `GITHUB_TOKEN`. +Where the vendor already publishes a name, that name is the environment variable: `ALICLOUD_ACCESS_KEY_ID`, `ALICLOUD_ACCESS_KEY_SECRET`, `ALIBABA_CLOUD_SECURITY_TOKEN`, `ALIBABA_CLOUD_REGION_ID`, and `GITHUB_TOKEN`. ```js import { envName, readEnv } from "@agent-sandbox/sdk"; @@ -50,3 +50,4 @@ readEnv("sandbox_api_key", process.env); | `region` | alicloud-express | `ALIBABA_CLOUD_REGION_ID` | Region id (derives the API URL and domain) | | `access_key_id` | alicloud-express | `ALICLOUD_ACCESS_KEY_ID` | Alibaba Cloud AccessKey ID | | `access_key_secret` | alicloud-express | `ALICLOUD_ACCESS_KEY_SECRET` | Alibaba Cloud AccessKey secret | +| `security_token` | alicloud-express | `ALIBABA_CLOUD_SECURITY_TOKEN` | STS session token used with temporary AccessKey credentials | diff --git a/docs/configuration.zh-CN.md b/docs/configuration.zh-CN.md index 3b0e7e8..46b9e72 100644 --- a/docs/configuration.zh-CN.md +++ b/docs/configuration.zh-CN.md @@ -11,13 +11,13 @@ `src/config-keys.json` 是规范列表,来自 `python -m agent_sandbox.utils.config_keys --json`。每个 key 只有一个环境变量,没有别名。`readEnv` 只读这个名字。 `configSchema.reserved_provider_ids` 遵循 -[Python 注册表](https://github.com/Alibaba-Agent-Sandbox/python-sdk/blob/145341d462df2f4753c03a62365114f1872acd1a/client-sdk/src/agent_sandbox/utils/config_keys.py): +[Python 注册表](https://github.com/Alibaba-Agent-Sandbox/python-sdk/blob/main/client-sdk/src/agent_sandbox/utils/config_keys.py): 内置及核心标识仍保留,可安装的目录提供方标识 `e2b` 不再保留。 提供方执行由 Python SDK 和 `abx` 负责。 产品 key 使用 `ABX_` 前缀:`ABX_SANDBOX_API_KEY`、`ABX_SANDBOX_BASE_URL`、`ABX_SANDBOX_DOMAIN`、`ABX_PROVIDER`。 -厂商已经公布名字时,环境变量就用那个名字:`ALICLOUD_ACCESS_KEY_ID`、`ALICLOUD_ACCESS_KEY_SECRET`、`ALIBABA_CLOUD_REGION_ID`,以及 `GITHUB_TOKEN`。 +厂商已经公布名字时,环境变量就用那个名字:`ALICLOUD_ACCESS_KEY_ID`、`ALICLOUD_ACCESS_KEY_SECRET`、`ALIBABA_CLOUD_SECURITY_TOKEN`、`ALIBABA_CLOUD_REGION_ID`,以及 `GITHUB_TOKEN`。 ```js import { envName, readEnv } from "@agent-sandbox/sdk"; @@ -50,3 +50,4 @@ readEnv("sandbox_api_key", process.env); | `region` | alicloud-express | `ALIBABA_CLOUD_REGION_ID` | 地域(用于推导 API 地址和域名) | | `access_key_id` | alicloud-express | `ALICLOUD_ACCESS_KEY_ID` | 阿里云 AccessKey ID | | `access_key_secret` | alicloud-express | `ALICLOUD_ACCESS_KEY_SECRET` | 阿里云 AccessKey Secret | +| `security_token` | alicloud-express | `ALIBABA_CLOUD_SECURITY_TOKEN` | 与临时 AccessKey 配套使用的 STS 会话令牌 | diff --git a/docs/server-client.md b/docs/server-client.md index 7c07096..bae0544 100644 --- a/docs/server-client.md +++ b/docs/server-client.md @@ -6,7 +6,7 @@ Back to the [README](../README.md). ## ServerClient -`ServerClient` speaks HTTP to a server started with `python3 -m agent_sandbox.server serve` (default port 9000). These four calls are the ones the local agent loop uses. They are enabled by default: +`ServerClient` speaks HTTP to a server started with `python3 -m agent_sandbox.server serve` (default port 9000). These endpoints are enabled by default; application functions must be registered before invocation: | Method | Request | | --- | --- | @@ -14,6 +14,8 @@ Back to the [README](../README.md). | `process.shell(command)` | `POST /shell` with JSON `{ "command": "..." }` | | `files.upload(path, data)` | `POST /files/upload-stream` with JSON `{ "path", "content_base64" }` | | `files.download(path)` / `files.readText(path)` | `GET /files/download-stream?path=` | +| `commands.list()` | `GET /commands` | +| `commands.invoke(name, arguments, options)` | `POST /commands/{name}` with the argument object as JSON | `cwd`, `env`, and `timeout` are added to the shell body only when you set them. The server tokenises `command`; it does not run a shell. A bearer token, when passed to the constructor, is sent as `Authorization: Bearer` (the same secret as `ABX_SERVER_TOKEN`). @@ -53,3 +55,21 @@ prefix-bound HTTP URLs; operation-specific signed path bindings must use the pro adapter's operation transport. This prefix client does not accept those bindings. The explicit application `token` is also sent as `X-Access-Token` when no supplied header already occupies that name, case-insensitively. Bearer is retained for existing services. Caller and gateway headers are copied for each request and never overwritten; requests without a token gain no application credentials. This supports server proxies that strip Authorization using the server's existing authentication header. + +## Registered application commands + +Start the service with its command module loaded, for example `python3 -m agent_sandbox.server serve --commands commands.py`. `commands.list()` returns the visible command names, descriptions and argument metadata. Functions registered with `@command()` are application business commands; they are separate from shell execution and provider management. + +```js +const commands = await server.commands.list(); +const result = await server.commands.invoke("job", { + timeout: 5, + name: "daily-report", +}, { requestTimeout: 30 }); +``` + +`requestTimeout` is an HTTP timeout in seconds. Business arguments are sent unchanged as the JSON object, including keys named `timeout`, `name` or `arguments`. The result may be any JSON value, including `null`. TypeScript callers may select a result type with `invoke(...)`; runtime validation of a business result remains the caller's responsibility. + +Invocation preserves `ServerAPIError.statusCode`, `errorType` and `errorCode` for server rejections and failures. A timed-out request raises `ConnectionError`; the remote function may still have run. Invocations are never retried automatically. The server must permit the command for the authenticated identity. + +Request timeouts accept fractional seconds, rounded up to milliseconds; the maximum is 2147483.647 seconds. Invalid values fail before sending a request. diff --git a/docs/server-client.zh-CN.md b/docs/server-client.zh-CN.md index 9b6c292..da655b8 100644 --- a/docs/server-client.zh-CN.md +++ b/docs/server-client.zh-CN.md @@ -6,7 +6,7 @@ ## ServerClient -`ServerClient` 通过 HTTP 访问 `python3 -m agent_sandbox.server serve` 启动的进程(默认端口 9000)。本地 agent 循环用到的是下面四个调用,它们默认开启: +`ServerClient` 通过 HTTP 访问 `python3 -m agent_sandbox.server serve` 启动的进程(默认端口 9000)。下列端点默认开启,调用应用函数前需要先完成注册: | 方法 | 请求 | | --- | --- | @@ -14,6 +14,8 @@ | `process.shell(command)` | `POST /shell`,JSON `{ "command": "..." }` | | `files.upload(path, data)` | `POST /files/upload-stream`,JSON `{ "path", "content_base64" }` | | `files.download(path)` / `files.readText(path)` | `GET /files/download-stream?path=` | +| `commands.list()` | `GET /commands` | +| `commands.invoke(name, arguments, options)` | `POST /commands/{name}`,业务参数作为 JSON 请求体 | 只有在你设置了 `cwd`、`env`、`timeout` 时,它们才会出现在 shell 请求体里。服务端对 `command` 做分词,不会交给 shell。构造时传入的 bearer token 会以 `Authorization: Bearer` 发送(与 `ABX_SERVER_TOKEN` 是同一个密钥)。 @@ -47,3 +49,20 @@ await server.close(); 绑定代理前缀的 HTTP URL;按操作签名的路径绑定需要使用提供方适配器的逐操作传输接口,不能传入本前缀客户端。 显式应用 `token` 还会通过 `X-Access-Token` 发送,前提是调用方提供的请求头未占用该名称(不区分大小写)。Bearer 仍然保留以兼容现有服务。每次请求复制调用方与网关请求头,不会覆盖它们;未提供 token 时不会添加应用凭据。该行为使用服务端已有认证请求头,兼容剥离 Authorization 的服务端代理。 +## 应用命令调用 + +启动服务时加载对应命令模块,例如 `python3 -m agent_sandbox.server serve --commands commands.py`。`commands.list()` 返回当前身份可见的命令名称、说明和参数信息。使用 `@command()` 注册的业务函数与 Shell 执行、提供方管理命令分开。 + +```js +const commands = await server.commands.list(); +const result = await server.commands.invoke("job", { + timeout: 5, + name: "daily-report", +}, { requestTimeout: 30 }); +``` + +`requestTimeout` 是 HTTP 请求超时,单位为秒。业务参数保持原值写入 JSON,包括 `timeout`、`name`、`arguments` 等名称。结果可以是任意 JSON 值,包括 `null`。TypeScript 可使用 `invoke(...)` 声明预期类型,业务结果的运行时校验由调用方负责。 + +服务端拒绝或执行失败时,保留 `ServerAPIError` 的 `statusCode`、`errorType`、`errorCode`。请求超时抛出 `ConnectionError`,此时远端函数可能已经执行;客户端不会自动重试。服务端仍会检查调用身份是否有权运行该命令。 + +请求超时支持小数秒,向上取整到毫秒;上限为 2147483.647 秒。无效值会在发送请求之前被拒绝。 diff --git a/src/config-keys.json b/src/config-keys.json index c4eb21f..92f9755 100644 --- a/src/config-keys.json +++ b/src/config-keys.json @@ -483,6 +483,28 @@ "choices": [], "group": "Alibaba Cloud credentials", "description": "Alibaba Cloud AccessKey secret" + }, + { + "key": "security_token", + "scope": "alicloud-express", + "type": "str", + "secret": true, + "credential": true, + "settable": true, + "env": "ALIBABA_CLOUD_SECURITY_TOKEN", + "aliases": [], + "env_names": [ + "ALIBABA_CLOUD_SECURITY_TOKEN" + ], + "toml_section": null, + "storage": { + "file": "env", + "name": "ALIBABA_CLOUD_SECURITY_TOKEN" + }, + "default": null, + "choices": [], + "group": "Alibaba Cloud credentials", + "description": "Alibaba Cloud STS security token (with temporary AccessKey credentials)" } ] } diff --git a/src/index.ts b/src/index.ts index d9af34a..a0b9d19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,11 +12,15 @@ export { ConnectionError, ServerAPIError } from "./errors.js"; export { DEFAULT_SERVER_PORT, ServerClient, + ServerCommandsApi, ServerFilesApi, ServerProcessApi, } from "./server-client.js"; export type { ServerClientOptions, + ServerCommand, + ServerCommandArg, + CommandInvocationOptions, ShellOptions, ShellResult, TransferResult, diff --git a/src/server-client.ts b/src/server-client.ts index 125127f..0539618 100644 --- a/src/server-client.ts +++ b/src/server-client.ts @@ -40,6 +40,27 @@ export interface TransferResult { size: number; } +/** An argument advertised by a registered application command. */ +export interface ServerCommandArg { + name: string; + type: string; + required: boolean; + default: unknown; + description: string; +} + +/** A registered application command returned by `GET /commands`. */ +export interface ServerCommand { + name: string; + description: string; + args: ServerCommandArg[]; +} + +export interface CommandInvocationOptions { + /** HTTP request timeout in seconds; never included in business arguments. */ + requestTimeout?: number; +} + interface RequestOptions { params?: Readonly>; jsonBody?: Readonly>; @@ -110,7 +131,7 @@ function errorFromResponse(status: number, body: unknown, endpoint: string): Ser * * This slice talks to the same routes the local Python agent loop uses: * `GET /health`, `POST /shell`, `POST /files/upload-stream`, and - * `GET /files/download-stream`. Those endpoints are on by default. Opt-in + * `GET /files/download-stream`, and registered application commands. Those endpoints are on by default. Opt-in * groups (`dev_tools`, `browser`, `agents`) are enabled only with * `ABX_SERVER_ENABLED_GROUPS`. A bearer token, when set, is sent as * `Authorization: Bearer` (the server's `ABX_SERVER_TOKEN`). Agents responses @@ -122,6 +143,7 @@ export class ServerClient { readonly timeout: number; readonly files: ServerFilesApi; readonly process: ServerProcessApi; + readonly commands: ServerCommandsApi; #endpoint: URL; #token: string | undefined; @@ -161,6 +183,7 @@ export class ServerClient { this.#headers = Object.fromEntries(headers); this.files = new ServerFilesApi(this); this.process = new ServerProcessApi(this); + this.commands = new ServerCommandsApi(this); } /** Headers sent on every request. */ @@ -228,16 +251,46 @@ export class ServerClient { body = JSON.stringify(options.jsonBody); } const timeoutSeconds = options.timeout ?? this.timeout; + const timeoutMilliseconds = Math.ceil(timeoutSeconds * 1000); + if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0 || timeoutMilliseconds > 2_147_483_647) { + throw new TypeError("Request timeout must be positive and at most 2147483.647 seconds"); + } const controller = new AbortController(); this.#controllers.add(controller); - const signal = AbortSignal.any([ - AbortSignal.timeout(Math.max(1, timeoutSeconds * 1000)), - controller.signal, - ]); - let response: Response; try { - response = await fetch(url, { method, headers, body, signal, redirect: "manual" }); + const signal = AbortSignal.any([ + AbortSignal.timeout(Math.max(1, timeoutMilliseconds)), + controller.signal, + ]); + const response = await fetch(url, { method, headers, body, signal, redirect: "manual" }); + + if (response.status >= 300 && response.status < 400) { + await response.body?.cancel(); + throw new ServerAPIError("Sandbox server redirects are not allowed", { + statusCode: response.status, errorType: "BindingError", endpoint, + }); + } + const text = await response.text(); + let parsed: unknown = null; + if (text) { + try { + parsed = JSON.parse(text); + } catch { + parsed = text; + } + } + if (response.status >= 400) { + throw errorFromResponse(response.status, parsed, endpoint); + } + if (!isRecord(parsed)) { + throw new ServerAPIError( + `Sandbox server returned a non-JSON object (HTTP ${response.status})`, + { statusCode: response.status, errorType: "ProtocolError", endpoint }, + ); + } + return parsed; } catch (err) { + if (err instanceof ServerAPIError) throw err; if (this.#closed || controller.signal.aborted) { throw new ConnectionError(`ServerClient is closed (${this.baseUrl})`); } @@ -251,32 +304,63 @@ export class ServerClient { } finally { this.#controllers.delete(controller); } + } +} + +/** Discover and invoke business functions registered on the application server. */ +export class ServerCommandsApi { + constructor(private readonly client: ServerClient) {} - if (response.status >= 300 && response.status < 400) { - await response.body?.cancel(); - throw new ServerAPIError("Sandbox server redirects are not allowed", { - statusCode: response.status, errorType: "BindingError", endpoint, + /** `GET /commands`. Only commands visible to the authenticated caller are returned. */ + async list(): Promise { + const data = await this.client.send("list_commands", "GET", "/commands"); + const invalid = (): never => { + throw new ServerAPIError("Server returned invalid command metadata", { + statusCode: 200, errorType: "ProtocolError", endpoint: "list_commands", }); + }; + if (!Array.isArray(data.commands)) return invalid(); + return data.commands.map((command: unknown): ServerCommand => { + if (!isRecord(command) || typeof command.name !== "string" || + (command.description !== undefined && typeof command.description !== "string") || + (command.args !== undefined && !Array.isArray(command.args))) return invalid(); + const args = (command.args ?? []) as unknown[]; + return { + name: command.name, + description: command.description ?? "", + args: args.map((arg: unknown): ServerCommandArg => { + if (!isRecord(arg) || typeof arg.name !== "string" || + (arg.type !== undefined && typeof arg.type !== "string") || + (arg.required !== undefined && typeof arg.required !== "boolean") || + (arg.description !== undefined && typeof arg.description !== "string")) return invalid(); + return { name: arg.name, type: arg.type ?? "string", required: arg.required ?? true, + default: arg.default ?? null, description: arg.description ?? "" }; + }), + }; + }); + } + + /** `POST /commands/{name}`. Business arguments and transport options stay separate. No retries. */ + async invoke( + name: string, + arguments_: Readonly> = {}, + options: CommandInvocationOptions = {}, + ): Promise { + if (typeof name !== "string" || !name) throw new TypeError("Command name must be a non-empty string"); + if (!isRecord(arguments_)) throw new TypeError("Command arguments must be a JSON object"); + if (options.requestTimeout !== undefined && + (!Number.isFinite(options.requestTimeout) || options.requestTimeout <= 0)) { + throw new TypeError("Command request timeout must be a positive number of seconds"); } - const text = await response.text(); - let parsed: unknown = null; - if (text) { - try { - parsed = JSON.parse(text); - } catch { - parsed = text; - } - } - if (response.status >= 400) { - throw errorFromResponse(response.status, parsed, endpoint); - } - if (!isRecord(parsed)) { - throw new ServerAPIError( - `Sandbox server returned a non-JSON object (HTTP ${response.status})`, - { statusCode: response.status, errorType: "ProtocolError", endpoint }, - ); + const data = await this.client.send("run_command", "POST", `/commands/${encodeURIComponent(name)}`, { + jsonBody: arguments_, timeout: options.requestTimeout, + }); + if (!Object.hasOwn(data, "result")) { + throw new ServerAPIError("Server returned no command result", { + statusCode: 200, errorType: "ProtocolError", endpoint: "run_command", + }); } - return parsed; + return data.result as T; } } diff --git a/test/agent-loop.test.mjs b/test/agent-loop.test.mjs index 8870db8..f387a64 100644 --- a/test/agent-loop.test.mjs +++ b/test/agent-loop.test.mjs @@ -5,9 +5,64 @@ import { tmpdir } from "node:os"; import path from "node:path"; import test from "node:test"; import { fileURLToPath } from "node:url"; +import { createServer } from "node:net"; + +import { ServerAPIError, ServerClient } from "../dist/index.js"; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); +test("named application commands work with the actual Python runtime", { timeout: 60_000 }, async () => { + const directory = await mkdtemp(path.join(tmpdir(), "node-sdk-commands-")); + const reservation = createServer(); + await new Promise((resolve, reject) => { + reservation.once("error", reject); + reservation.listen(0, "127.0.0.1", resolve); + }); + const port = reservation.address().port; + await new Promise((resolve, reject) => reservation.close(error => error ? reject(error) : resolve())); + const commands = path.join(directory, "commands.py"); + await writeFile(commands, `from agent_sandbox.server import command + +@command("inspect_inputs") +def inspect_inputs(timeout: int, name: str, arguments: str, server_port: int, + requestTimeout: int, labels: list[str], enabled: bool) -> dict: + return {"timeout": timeout, "name": name, "arguments": arguments, + "server_port": server_port, "requestTimeout": requestTimeout, + "labels": labels, "enabled": enabled} +`); + const child = spawn("python3", ["-m", "agent_sandbox.server", "serve", "--host", "127.0.0.1", + "--port", String(port), "--commands", commands], { + env: { ...process.env, ABX_SERVER_TOKEN: "fixture-command-token", ABX_SERVER_BASE_DIR: directory }, + stdio: ["ignore", "ignore", "pipe"], + }); + let stderr = ""; + child.stderr.setEncoding("utf8"); + child.stderr.on("data", chunk => { stderr += chunk; }); + const exited = new Promise(resolve => child.once("exit", resolve)); + const client = new ServerClient(`http://127.0.0.1:${port}`, { token: "fixture-command-token", timeout: 1 }); + try { + let ready = false; + for (let attempt = 0; attempt < 80; attempt += 1) { + if (await client.health()) { ready = true; break; } + if (child.exitCode !== null) break; + await new Promise(resolve => setTimeout(resolve, 100)); + } + assert.ok(ready, "Python runtime did not start: " + stderr); + const listed = await client.commands.list(); + assert.ok(listed.some(command => command.name === "inspect_inputs" && command.args.some(arg => arg.name === "timeout"))); + const payload = { timeout: 5, name: "business", arguments: "preserved", server_port: 42, + requestTimeout: 7, labels: ["one", "two"], enabled: false }; + assert.deepEqual(await client.commands.invoke("inspect_inputs", payload, { requestTimeout: 5 }), payload); + await assert.rejects(client.commands.invoke("inspect_inputs", {}), error => error instanceof ServerAPIError && error.statusCode === 400); + await assert.rejects(client.commands.invoke("missing_command", {}), error => error instanceof ServerAPIError && error.statusCode === 404); + } finally { + await client.close(); + if (child.exitCode === null) child.kill("SIGTERM"); + await exited; + await rm(directory, { recursive: true, force: true }); + } +}); + function fromPythonRepr(literal) { assert.equal(literal.startsWith("'"), true, literal); assert.equal(literal.endsWith("'"), true, literal); diff --git a/test/config-keys.test.mjs b/test/config-keys.test.mjs index c7b9405..7aab38c 100644 --- a/test/config-keys.test.mjs +++ b/test/config-keys.test.mjs @@ -32,7 +32,7 @@ test("reserved provider ids keep the E2B catalog id available", () => { test("fixture is copied through with one env name per key", () => { assert.equal(configSchema.schema_version, 1); assert.equal(CONFIG_KEYS.length, source.keys.length); - assert.equal(CONFIG_KEYS.length, 21); + assert.equal(CONFIG_KEYS.length, 22); for (const [index, key] of CONFIG_KEYS.entries()) { const raw = source.keys[index]; assert.equal(key.key, raw.key); @@ -56,6 +56,16 @@ test("official names are the env vars", () => { assert.equal(envName("region", "alicloud-express"), "ALIBABA_CLOUD_REGION_ID"); assert.equal(envName("access_key_id", "alicloud-express"), "ALICLOUD_ACCESS_KEY_ID"); assert.equal(envName("access_key_secret", "alicloud-express"), "ALICLOUD_ACCESS_KEY_SECRET"); + assert.equal(envName("security_token", "alicloud-express"), "ALIBABA_CLOUD_SECURITY_TOKEN"); +}); + +test("STS configuration keeps its single secret credential name", () => { + const key = CONFIG_KEYS.find(key => key.scope === "alicloud-express" && key.key === "security_token"); + assert.equal(key.secret, true); + assert.equal(key.credential, true); + assert.deepEqual(key.env_names, ["ALIBABA_CLOUD_SECURITY_TOKEN"]); + assert.equal(readEnv("security_token", { ALIBABA_CLOUD_SECURITY_TOKEN: "fixture-session" }, "alicloud-express"), "fixture-session"); + assert.equal(readEnv("security_token", { ALICLOUD_SECURITY_TOKEN: "fixture-retired" }, "alicloud-express"), undefined); }); test("only canonical env names are accepted", () => { diff --git a/test/server-client.test.mjs b/test/server-client.test.mjs index a650c0a..28095b1 100644 --- a/test/server-client.test.mjs +++ b/test/server-client.test.mjs @@ -31,6 +31,115 @@ function readBody(req) { }); } +test("named application commands preserve business arguments and gateway binding", async () => { + const hits = []; + const command = { + name: "inspect.inputs", description: "Inspect typed inputs", + args: [{ name: "timeout", type: "integer", required: true, default: null, description: "Business timeout" }], + }; + const server = await listen(async (req, res) => { + const body = await readBody(req); + hits.push({ url: req.url, method: req.method, body, + app: req.headers.authorization, traffic: req.headers["e2b-traffic-access-token"] }); + res.setHeader("content-type", "application/json"); + res.end(JSON.stringify(req.method === "GET" ? { commands: [command] } : { result: JSON.parse(body) })); + }); + const client = new ServerClient(`http://127.0.0.1:${server.port}/proxy/owned/9000?sig=a%2Fb`, { + token: "application-token", gatewayHeaders: { "e2b-traffic-access-token": "traffic-token" }, + }); + const arguments_ = { timeout: 5, name: "business-name", arguments: "business-argument", + server_port: 42, requestTimeout: 9, values: ["a", "b"], enabled: false }; + try { + assert.deepEqual(await client.commands.list(), [command]); + assert.deepEqual(await client.commands.invoke("inspect.inputs", arguments_, { requestTimeout: 3 }), arguments_); + assert.equal(hits[0].url, "/proxy/owned/9000/commands?sig=a%2Fb"); + assert.equal(hits[1].url, "/proxy/owned/9000/commands/inspect.inputs?sig=a%2Fb"); + assert.deepEqual(JSON.parse(hits[1].body), arguments_); + assert.equal(hits[1].app, "Bearer application-token"); + assert.equal(hits[1].traffic, "traffic-token"); + } finally { await client.close(); await server.close(); } +}); + +test("named application commands preserve failures without replaying mutations", async () => { + let hits = 0; + let status = 404; + const server = await listen(async (req, res) => { + await readBody(req); hits += 1; + res.statusCode = status; + res.end(JSON.stringify({ error: "Command failed", type: "ValueError", code: "command_failed" })); + }); + const client = new ServerClient(`http://127.0.0.1:${server.port}`); + try { + for (status of [400, 401, 403, 404, 500, 503]) { + await assert.rejects(client.commands.invoke("action", {}), error => + error instanceof ServerAPIError && error.statusCode === status && error.errorCode === "command_failed"); + } + assert.equal(hits, 6); + for (const name of ["", ".", "..", "a/b", "a\\b", "a\n", "%2e%2e"]) { + await assert.rejects(client.commands.invoke(name, {}), TypeError); + } + assert.equal(hits, 6); + } finally { await client.close(); await server.close(); } +}); + +test("named application commands reject malformed responses and accept null results", async () => { + let response = { commands: "invalid" }; + const server = await listen(async (req, res) => { + await readBody(req); res.end(JSON.stringify(response)); + }); + const client = new ServerClient(`http://127.0.0.1:${server.port}`); + try { + await assert.rejects(client.commands.list(), error => error instanceof ServerAPIError && error.errorType === "ProtocolError"); + response = { commands: [{ name: "bad", args: [{ name: 42 }] }] }; + await assert.rejects(client.commands.list(), ServerAPIError); + response = {}; + await assert.rejects(client.commands.invoke("action", {}), ServerAPIError); + response = { result: null }; + assert.equal(await client.commands.invoke("action", {}), null); + await assert.rejects(client.commands.invoke("action", []), TypeError); + } finally { await client.close(); await server.close(); } +}); + +test("named application command timeout does not replay a running function", async () => { + let calls = 0; + const server = await listen(async (req, res) => { + await readBody(req); + calls += 1; + await new Promise(resolve => setTimeout(resolve, 100)); + res.end(JSON.stringify({ result: "finished remotely" })); + }); + const client = new ServerClient(`http://127.0.0.1:${server.port}`, { timeout: 5 }); + try { + await assert.rejects(client.commands.invoke("slow", {}, { requestTimeout: 2_147_483.648 }), TypeError); + await assert.rejects(client.commands.invoke("slow", { timeout: 42 }, { requestTimeout: 0.0105 }), ConnectionError); + await new Promise(resolve => setTimeout(resolve, 150)); + assert.equal(calls, 1); + } finally { await client.close(); await server.close(); } +}); + +test("named command timeout and close include reading the response body", async () => { + let bodyStarted; + let started = new Promise(resolve => { bodyStarted = resolve; }); + const server = await listen(async (req, res) => { + await readBody(req); + res.writeHead(200, { "content-type": "application/json" }); + res.write('{"result":'); + bodyStarted(); + await new Promise(resolve => setTimeout(resolve, 100)); + res.end('"finished"}'); + }); + const client = new ServerClient(`http://127.0.0.1:${server.port}`); + try { + await assert.rejects(client.commands.invoke("slow_body", {}, { requestTimeout: 0.02 }), ConnectionError); + started = new Promise(resolve => { bodyStarted = resolve; }); + const pending = client.commands.invoke("slow_body", {}); + await started; + await new Promise(resolve => setTimeout(resolve, 10)); + await client.close(); + await assert.rejects(pending, ConnectionError); + } finally { await client.close(); await server.close(); } +}); + test("health, shell, upload-stream, and download-stream match the server JSON", async () => { const hits = []; const server = await listen(async (req, res) => { From a8f12bd67ab82e0cff6d9587808e8bfc11d870bb Mon Sep 17 00:00:00 2001 From: anycodes <21079031+anycodes@users.noreply.github.com> Date: Thu, 5 Nov 2026 08:27:51 +0000 Subject: [PATCH 2/3] docs: record reviewed application command acceptance --- .agents/README.md | 2 +- .../2026-11-05-application-command-invocation.md | 10 ++++++++-- .../2026-11-05-application-command-invocation.md | 2 +- .github/workflows/ci.yml | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) rename .agents/notes/{proposed => implemented}/feature/2026-11-05-application-command-invocation.md (99%) diff --git a/.agents/README.md b/.agents/README.md index 2f83d6d..02457b4 100644 --- a/.agents/README.md +++ b/.agents/README.md @@ -1,6 +1,6 @@ # Node SDK engineering records -- [Application command invocation](notes/proposed/feature/2026-11-05-application-command-invocation.md) · [verification](evidence/verify/2026-11-05-application-command-invocation.md). +- [Application command invocation](notes/implemented/feature/2026-11-05-application-command-invocation.md) · [verification](evidence/verify/2026-11-05-application-command-invocation.md). ## Current delivery — 2026-10-25 diff --git a/.agents/evidence/verify/2026-11-05-application-command-invocation.md b/.agents/evidence/verify/2026-11-05-application-command-invocation.md index 73288f9..9f5d61e 100644 --- a/.agents/evidence/verify/2026-11-05-application-command-invocation.md +++ b/.agents/evidence/verify/2026-11-05-application-command-invocation.md @@ -2,7 +2,7 @@ - Date: 2026-11-05 - Change: application-command-invocation; owner Issue https://github.com/Alibaba-Agent-Sandbox/nodejs-sdk/issues/23 -- Result: PARTIAL +- Result: PASS for application HTTP scope; latest-head delivery checks remain required - Baseline: 1505b61a10a819c299c25f31ba508af2d8cb4ba6 - Environment: Node 22.22.2, Python 3.11.15, matching local Python client/server source. No cloud credentials are required or passed to these tests. @@ -28,4 +28,10 @@ The registered-command Python process exited on SIGTERM; its temporary source/da ## Not verified -The remote matrix and exact companion schema pin remain pending. Independent review is complete. This is application HTTP evidence, not cloud lifecycle acceptance or npm publication. +The initial implementation head 0b0367e34b03fffdc672e20adb5125bab757e3e6 passed the complete Node20/22 matrix in [run 41992843654](https://github.com/Alibaba-Agent-Sandbox/nodejs-sdk/actions/runs/41992843654). CI now pins the companion reviewed product commit 09f0e39a598a05244bfdd841ce1253fcdb1deb7e, which includes the shared configuration export; that contract must land before this consumer merges. Independent review is complete. The final follow-up head must pass its own remote checks. This does not certify cloud lifecycle or npm publication. + +## Real private application acceptance + +The candidate was also exercised against an owned Express sandbox hosting a registered function on an exclusive port. Node command discovery and invocation passed with separate public-gateway and application credentials; conflicting business argument names were preserved. The independent Python/direct-HTTP controls passed and anonymous public traffic returned HTTP403. Deletion was confirmed independently with GET404 and zero owned resources remaining. + +An earlier Node controller failed TLS trust with UNABLE_TO_VERIFY_LEAF_SIGNATURE because its minimal child environment dropped already-configured NODE_EXTRA_CA_CERTS/SSL_CERT_FILE. Raw fetch reproduced the same failure. Preserving only the existing trust configuration fixed the controller; certificate verification was never disabled. A separate early object-order comparison was replaced with deep value equality. These controller failures remain distinct from product behavior. diff --git a/.agents/notes/proposed/feature/2026-11-05-application-command-invocation.md b/.agents/notes/implemented/feature/2026-11-05-application-command-invocation.md similarity index 99% rename from .agents/notes/proposed/feature/2026-11-05-application-command-invocation.md rename to .agents/notes/implemented/feature/2026-11-05-application-command-invocation.md index fcdf81d..80ee7fd 100644 --- a/.agents/notes/proposed/feature/2026-11-05-application-command-invocation.md +++ b/.agents/notes/implemented/feature/2026-11-05-application-command-invocation.md @@ -1,6 +1,6 @@ # Decision: Invoke registered application commands with separate arguments -Status: proposed +Status: implemented ## Problem diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e44c35..d562dcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 with: repository: Alibaba-Agent-Sandbox/python-sdk - ref: 1aef5f67ab54131ab1e6a060034a3c1f8b5c6e5d + ref: 09f0e39a598a05244bfdd841ce1253fcdb1deb7e path: vendor/python-sdk persist-credentials: false - name: Verify shared application authentication vectors From 90fe8364f41074df9e332c2900b912cc38d7f04b Mon Sep 17 00:00:00 2001 From: anycodes <21079031+anycodes@users.noreply.github.com> Date: Thu, 5 Nov 2026 08:33:58 +0000 Subject: [PATCH 3/3] ci: pin the integrated Python configuration contract --- .../verify/2026-11-05-application-command-invocation.md | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.agents/evidence/verify/2026-11-05-application-command-invocation.md b/.agents/evidence/verify/2026-11-05-application-command-invocation.md index 9f5d61e..701dcf1 100644 --- a/.agents/evidence/verify/2026-11-05-application-command-invocation.md +++ b/.agents/evidence/verify/2026-11-05-application-command-invocation.md @@ -28,7 +28,7 @@ The registered-command Python process exited on SIGTERM; its temporary source/da ## Not verified -The initial implementation head 0b0367e34b03fffdc672e20adb5125bab757e3e6 passed the complete Node20/22 matrix in [run 41992843654](https://github.com/Alibaba-Agent-Sandbox/nodejs-sdk/actions/runs/41992843654). CI now pins the companion reviewed product commit 09f0e39a598a05244bfdd841ce1253fcdb1deb7e, which includes the shared configuration export; that contract must land before this consumer merges. Independent review is complete. The final follow-up head must pass its own remote checks. This does not certify cloud lifecycle or npm publication. +The initial implementation head 0b0367e34b03fffdc672e20adb5125bab757e3e6 passed the complete Node20/22 matrix in [run 41992843654](https://github.com/Alibaba-Agent-Sandbox/nodejs-sdk/actions/runs/41992843654). CI now pins the companion reviewed product commit 653404d4eb1e61c490816e1c8f7b688664b146e1, which includes the shared configuration export; that contract must land before this consumer merges. Independent review is complete. The final follow-up head must pass its own remote checks. This does not certify cloud lifecycle or npm publication. ## Real private application acceptance diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d562dcd..c5e5ff7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 with: repository: Alibaba-Agent-Sandbox/python-sdk - ref: 09f0e39a598a05244bfdd841ce1253fcdb1deb7e + ref: 653404d4eb1e61c490816e1c8f7b688664b146e1 path: vendor/python-sdk persist-credentials: false - name: Verify shared application authentication vectors