docs: constrain package README summaries

This commit is contained in:
Turtle
2026-09-08 13:52:40 +08:00
parent 06c01ce2e8
commit f1c1ff5a08
517 changed files with 827 additions and 692 deletions
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/code-runtime/code-runtime-worker-thread/README.md
README.md: 38c977ca3b387b4d8e5e9fb998a202a21a6d2415
README.zh.md: 30825aa81a268ea0c61021e98eb0cb8237a3a756
README.md: c26f349762ab2dac9956099ab637cde9d6d93771
README.zh.md: 39885e64de0b98cfefe20f8e1b5cd362d4404eea
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
## Summary
`dsh-code-runtime-worker-thread` executes TypeScript programs for the [`dsh-code-runtime`](../code-runtime/README.md) seam: each program runs in one fresh Node worker thread with host-provided bindings callable as ordinary async functions, and the run returns `{ value, logs, error? }`. It is the shipped backend for PTC mode in `dsh-tools`, so mounting it is what makes model-written TypeScript execution work in a composition. The runtime contains a program without isolating it: the trust posture is bash-equivalent, with an empty environment, a heap cap, measured busy-time and wall-clock budgets, and hard termination. Programs run once per request with no state carried between runs, and every failure — syntax error, budget expiry, abort, OOM exit, or output overflow — comes back as a result field.
This package lets PTC compositions execute model-written TypeScript with host-provided bindings and receive the completion value, ordered logs, or a structured failure. Each request starts with no state from earlier runs, and failures such as syntax errors, budget expiry, aborts, memory exhaustion, and output overflow are returned instead of thrown. Treat executed code as bash-equivalent: the package limits environment exposure and resource use, but does not isolate code from the host. Configurable compute, wall-clock, heap, and output limits terminate the run and bound its results.
## Table of Contents
@@ -9,7 +9,7 @@ kind: "package-reference"
## 概述
`dsh-code-runtime-worker-thread` 为 [`dsh-code-runtime`](../code-runtime/README.zh.md) seam 执行 TypeScript 程序:每个程序都在一个全新的 Node Worker 线程中运行,宿主提供的绑定可作为普通异步函数调用,运行返回 `{ value, logs, error? }`。它是 `dsh-tools` 中 PTC mode 的已发布后端,因此挂载它正是让模型编写的 TypeScript 执行在组合中生效的方式。运行时「包含」程序,但不隔离它:信任立场与 bash 等价,并带有空环境、堆上限、实测忙碌时间与墙钟预算,以及强制终止。程序每次请求只运行一次,运行之间不保留状态;每个失败——语法错误、预算到期、中止、OOM 退出或输出溢出——都以结果字段返回
本包让 PTC 组合能够使用宿主提供的绑定执行模型编写的 TypeScript,并取得完成值、顺序日志或结构化失败。每次请求都不继承先前运行的状态;语法错误、预算到期、中止、内存耗尽和输出溢出等失败会作为结果返回,而不是抛出。应将执行的代码视为与 bash 拥有同等权限:本包限制环境暴露和资源使用,但不将代码与宿主隔离。可配置的计算时间、墙钟时间、堆和输出上限会终止运行并限制其结果大小
## 目录