feat(0.11.1): streaming-first runtime + skill-dir path layout#17
Merged
Conversation
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.
57ca631 to
599db20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
resolveSubjectPathnow probes candidates in order rather than picking a single path. Required so the substrate accepts both:<surfaces.systemPrompt>/<section>.md<surfaces.systemPrompt>/<section>/SKILL.md(used by tax / legal / gtm / creative)tool-doc:<tool>/README.mdOR<tool>.mdFor create-new, always uses the canonical flat layout. For edit-existing, uses whichever exists.
Streaming-first
AgentRuntime.actruntime.actnow returnsAgentRunInvocation { events, output }instead ofPromise<TRunOutput>. Preserves the chat-centric product's streaming surface through the substrate:events:AsyncIterable<RuntimeStreamEvent>— chat UX consumes verbatim (SSE/WebSocket/inline render). The existingrunChatTurnprimitive 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 yetcollectAgentRun(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
collectAgentRundraining + awaiting.