Skip to content

feat(0.11.1): streaming-first runtime + skill-dir path layout#17

Merged
drewstone merged 1 commit into
mainfrom
feat/0.11.1-streaming-and-multi-candidate
May 20, 2026
Merged

feat(0.11.1): streaming-first runtime + skill-dir path layout#17
drewstone merged 1 commit into
mainfrom
feat/0.11.1-streaming-and-multi-candidate

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Two follow-ups missed by the #16 merge window — both required by the per-agent manifest PRs (tax #69, legal #70, gtm #122, creative #98).

Multi-candidate path probing

resolveSubjectPath now probes candidates in order rather than picking a single path. Required so the substrate accepts both:

  • Flat layout: <surfaces.systemPrompt>/<section>.md
  • Skill-dir layout: <surfaces.systemPrompt>/<section>/SKILL.md (used by tax / legal / gtm / creative)
  • Same for tool-doc: <tool>/README.md OR <tool>.md

For create-new, always uses the canonical flat layout. For edit-existing, uses whichever exists.

Streaming-first AgentRuntime.act

runtime.act now returns AgentRunInvocation { events, output } instead of Promise<TRunOutput>. Preserves the chat-centric product's streaming surface through the substrate:

  • events: AsyncIterable<RuntimeStreamEvent> — chat UX consumes verbatim (SSE/WebSocket/inline render). The existing runChatTurn primitive plugs in directly.
  • output: Promise<TRunOutput> — resolves after the stream drains. Eval substrate awaits this; chat UX ignores (already rendered).

Helpers:

  • unimplementedAgentRun(reason?) — stub for manifests whose eval path isn't wired yet
  • collectAgentRun(invocation) — eval-path drain (chat UX must NOT call this)

Tests

130/130 pass. 3 new tests cover the streaming contract: stub semantics, incremental consumption preserving the chat surface, and collectAgentRun draining + awaiting.

Two follow-ups missed by the #16 merge window — both required by the
per-agent manifest PRs (tax #69, legal #70, gtm #122, creative #98) to
edit existing system-prompt skill directories rather than fabricating
flat <section>.md siblings.

Multi-candidate path probing (surfaces.ts):
  resolveSubjectPath now probes candidates in order rather than picking
  a single path. system-prompt:<section> resolves to:
    <surfaces.systemPrompt>/<section>.md          (canonical create-new)
    <surfaces.systemPrompt>/<section>/SKILL.md    (tax/legal/gtm/creative)
    <surfaces.systemPrompt>/<section>/index.md    (flat-md repos)
  tool-doc:<tool> probes <tool>/README.md then <tool>.md. First hit wins
  for edit-existing; first candidate is the canonical create-new target.

Streaming-first AgentRuntime.act (define-agent.ts):
  Returns AgentRunInvocation { events, output } instead of Promise<T>.
  Preserves the chat-centric product's streaming surface through the
  substrate:
    - events: AsyncIterable<RuntimeStreamEvent> — chat UX consumes
      verbatim (SSE / WebSocket / inline render). runChatTurn plugs
      in directly.
    - output: Promise<TRunOutput> — resolves after stream drains; eval
      substrate awaits this; chat UX ignores (already rendered).

Helpers:
  unimplementedAgentRun(reason?) — stub manifests use until their eval
    path is fully wired; yields no events, rejects output loudly.
  collectAgentRun(invocation) — eval-path drain helper; chat UX MUST
    NOT call this (defeats streaming).

133/133 tests pass (6 new: streaming contract + multi-candidate probing).

Bumps to 0.11.1.
@drewstone drewstone force-pushed the feat/0.11.1-streaming-and-multi-candidate branch from 57ca631 to 599db20 Compare May 20, 2026 10:45
@drewstone drewstone merged commit 599db20 into main May 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant