Преглед на файлове

docs(code-runtime): align derived docs with the portable-identifier JSDoc

Update the type-equiv blocks in docs/core-data-structures/code-runtime
(both languages, re-recorded) to mirror the new CodeBindingNamespace /
CodeBindingErrorClass JSDoc, and regenerate the cordis services catalog
for the shifted source line. Keeps the worker-only intro until the
Python backend package exists.
Chinesezjc преди 2 месеца
родител
ревизия
b5578c026e

+ 1 - 1
docs/cordis-catalog/services.md

@@ -398,7 +398,7 @@ abstract run(request: CodeRunRequest): Promise<CodeRunResult>
 
 Types: [CodeRunRequest](../core-data-structures/code-runtime.md) · [CodeRunResult](../core-data-structures/code-runtime.md)
 
-Source: [`packages/code-runtime/code-runtime/src/index.ts:33`](../../packages/code-runtime/code-runtime/src/index.ts)
+Source: [`packages/code-runtime/code-runtime/src/index.ts:95`](../../packages/code-runtime/code-runtime/src/index.ts)
 
 ## `ctx.commands` — `CommandService`
 

+ 2 - 2
docs/core-data-structures/code-runtime.i18n.yaml

@@ -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 docs/core-data-structures/code-runtime.md
-code-runtime.md: 64de3c45d4f1d1d981daa6c6f074abb667e0aa52
-code-runtime.zh.md: daf07aaf613852a6c4a7b1aff152fcc61052fbca
+code-runtime.md: 522fe29deae8cac01462a336a02d082502b61fb4
+code-runtime.zh.md: 6d16f8ed2ab3b99620f30a8e81dc3718cf1419d1

+ 14 - 3
docs/core-data-structures/code-runtime.md

@@ -72,9 +72,14 @@ Each `CodeBindingNamespace` becomes one global object of async callables inside
  * of a particular consumer such as Code Mode.
  */
 interface CodeBindingErrorClass {
-  /** Constructor global and resulting `Error.name` (must be a usable JS identifier). */
+  /** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
   name: string
-  /** Non-empty own property for the member name; cannot replace `name`, `message`, or `stack`. */
+  /**
+   * Non-empty own property for the member name. The portable exclusion set is
+   * `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__*__`), enforced
+   * identically by every backend; any other name — identifiers or not — is
+   * accepted everywhere.
+   */
   memberNameProperty: string
 }
 ```
@@ -88,7 +93,13 @@ interface CodeBindingErrorClass {
  * collisions.
  */
 interface CodeBindingNamespace {
-  /** The global identifier the program sees (must be a valid JS identifier). */
+  /**
+   * The global identifier the program sees. Must match the LANGUAGE-PORTABLE
+   * identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
+   * words, so the same namespace list works against every backend regardless
+   * of `language` — a JS-only spelling like `$tools` is rejected by design,
+   * not just by the Python backend.
+   */
   global: string
   /** The callable members, keyed by the exact name the program calls. */
   functions: Record<string, CodeBindingFunction>

+ 14 - 3
docs/core-data-structures/code-runtime.zh.md

@@ -72,9 +72,14 @@ interface CodeRunResult {
  * of a particular consumer such as Code Mode.
  */
 interface CodeBindingErrorClass {
-  /** Constructor global and resulting `Error.name` (must be a usable JS identifier). */
+  /** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
   name: string
-  /** Non-empty own property for the member name; cannot replace `name`, `message`, or `stack`. */
+  /**
+   * Non-empty own property for the member name. The portable exclusion set is
+   * `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__*__`), enforced
+   * identically by every backend; any other name — identifiers or not — is
+   * accepted everywhere.
+   */
   memberNameProperty: string
 }
 ```
@@ -88,7 +93,13 @@ interface CodeBindingErrorClass {
  * collisions.
  */
 interface CodeBindingNamespace {
-  /** The global identifier the program sees (must be a valid JS identifier). */
+  /**
+   * The global identifier the program sees. Must match the LANGUAGE-PORTABLE
+   * identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
+   * words, so the same namespace list works against every backend regardless
+   * of `language` — a JS-only spelling like `$tools` is rejected by design,
+   * not just by the Python backend.
+   */
   global: string
   /** The callable members, keyed by the exact name the program calls. */
   functions: Record<string, CodeBindingFunction>