Skip to content

refactor(ts/agent): remove remaining Python-idiom duplicates from the public API #3592

Description

@ditman

Follow-up to the review of #3397 (comment), which removed four second spellings from the skill module (generateSkillset, positional new Skill(...), SkillSet.length, SkillSet.items()). A scan of the rest of @a2ui/agent's public surface found these, none of which is a duplicate in Python but each of which is a Python idiom with a more usual TS shape:

  1. Skill.toString() returns toMarkdown() (src/skill/skill.ts). A port of __str__; two spellings for one thing. Remove.
  2. SkillSet[Symbol.iterator] yields keys (src/skill/skill.ts), as a Python dict does, while a JS Map yields [key, value]. Since size/entries() follow Map, iterate like Map too: implements Iterable<[string, Skill]>, iterator returns entries(). keys() stays for callers who want keys.
  3. ExpressParser.wrapDecompiledBlocks(string[]) and ExpressDecompiler.wrapDecompiledBlocks (src/inference-formats/express/{parser,decompiler}.ts), a port of wrap_decompiled_blocks, sit next to wrap(RawResponsePart[]). The only non-test callers are inside ExpressPromptGenerator. Make it internal or fold it into wrap.
  4. supportsStreaming exists on both Parser (src/parser/parser.ts) and InferenceFormat (src/inference-format.ts, commented "Mirrors Python InferenceFormat.supports_streaming"). Decide which one owns the answer and drop the other, or have one delegate to the other.
  5. A2uiRequestProcessor.activeCatalogs (src/processor/processor.ts) vs catalogs on RendererState, ExpressParser, DirectJsonParser, and PromptGenerator. Rename to catalogs for consistency (mirrors Python's active_catalogs).
  6. ExpressParser.decompile(messages: AgentToRendererMessage | AgentToRendererMessage[]) accepts a single message where the abstract Parser.decompile and DirectJsonParser.decompile take only an array. Take the array only, matching the other overload removals.

Items 1–2 and 5–6 are small public API changes and need **BREAKING**: CHANGELOG entries; 3–4 can be done without one if the public member is kept and only delegated.

Update blueprints/codebases/typescript/agents/a2ui_agent/codebase.blueprint.md where method names change.

Activity

  1. self-assigned this
    on Oct 24, 2026
  2. added theissue type on Oct 24, 2026
  3. added
    P2The team intends to work on this in the near future, or at a lower priority.
    component: agent sdkRelating to the agent SDK libraries in any language
    component: core sdkAffects the core SDK layer in any language
    lang: pythonAffects SDKs or apps in the Python programming language
    and removed
    P1This is a priority. Team is actively working on it, or will be soon.
    on Oct 28, 2026
  4. moved this from Todo to In Progress in A2UIon Oct 29, 2026
  5. added 2 commits that reference this issue on Oct 29, 2026
    49771b9
    6e9f213
  6. moved this from In Progress to Done in A2UIon Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions