feat(fn): transport-agnostic core + try-catch / tRPC / oRPC adapter packages#79
Open
DawidWraga wants to merge 72 commits into
Open
feat(fn): transport-agnostic core + try-catch / tRPC / oRPC adapter packages#79DawidWraga wants to merge 72 commits into
DawidWraga wants to merge 72 commits into
Conversation
…efresh schema + view refs
Records the initial Promptfoo LLM-as-judge experiment before cleanup. Known rough edges include mixed smoke/explore config, variant-only artifact paths, hardcoded Gemini execution, and unstructured grader output.
Add --compact-mode to open-agents submit. Compact mode treats the user's input as a short task title, requires a history file, extracts a fixed 50k token-like tail, runs a Cursor composer-2.5 spec-writer job, and then submits the generated spec to the selected executor provider. The spec-writer prompt now prioritizes a dense <context> block with relevant files, folders, project facts, original user query, useful quotes, decisions, constraints, and caveats. It avoids <acceptance> unless the history explicitly calls for one. Also extend the eval harness artifacts for title-tail and spec-writer variants so generated specs, recent tails, history snapshots, and executor outputs are persisted for comparison.
Let compact mode find history without manual --history-file wiring. Resolution now prefers --history-file, then OPEN_AGENTS_HISTORY_FILE, then CLAUDE_CODE_TRANSCRIPT_PATH for hook-style callers, then CLAUDE_CODE_SESSION_ID by scanning ~/.claude/projects/*/<session>.jsonl. This keeps explicit history paths available but makes the common Claude Code-launched flow deterministic for tools that inherit the session environment.
Avoid passing the full 50k-token compact history prompt through argv. The spec-writer task is now persisted to the job .spec.md file, and the composer-2.5 spec-writer receives only a short wrapper telling it to read that file and produce the executor spec. This avoids Windows ENAMETOOLONG failures while keeping the full task inspectable on disk. Also tighten the spec-writer contract: it should distill history into a super concise executor brief, avoid copying the transcript or long history excerpts, and point the executor at the history file when details are uncertain or too large to summarize cleanly.
Report how long the compact spec-writer stage took and include a user-friendly ~/... path to the generated spec artifact. This makes the handoff easier to inspect after compact mode finishes. Also silence the Cursor .test.ts probe cleanup message; the cleanup still runs, but compact-mode output no longer includes the noisy swept-stray line.
Add the 0.1.1 changelog entry for the folder metadata XML output changes and bump @davstack/meta from 0.1.0 to 0.1.1.
Add line numbers to TypeScript-like and Python symbol summaries while preserving comment-stripped locations. Render omitted files after nested folders so each folder block ends with unsupported files, and publish this as @davstack/meta 0.1.2.
Render file paths relative to the Git repository root and format code symbol references as [ln start-end] ranges. Update tests for nested folder paths and release @davstack/meta 0.1.3.
Render folder paths relative to the Git repository root using the same convention as file paths, including parent segments for nested folders. Add coverage for scanning a nested Git worktree folder.
Render nested folder metadata with tab indentation so folders, files, symbol bullets, and omitted-file entries visually reflect the XML hierarchy.
Adjust folder metadata indentation so root-level children stay flush-left while nested folder contents indent by folder depth. Render code symbol references without list prefixes, keep markdown headings and omitted files as list entries, and release @davstack/meta 0.1.4.
Introduce configurable metadata output with human and agent presets. Human output keeps indentation and full repo-relative file paths, while agent output removes indentation and uses concise file paths inside full folder paths. Expose --human, --agent, --indent/--no-indent, and --file_paths through gen/view, with explicit flags overriding preset defaults.
Make human and agent metadata presets scan deeply by default, while allowing explicit deep false overrides. Remove the generated Markdown title so output starts directly at the folder XML, simplify renderFolderSummary to return the rendered string, and release @davstack/meta 0.1.5 with the pending meta output changesets consumed.
Summarize describe, test, and it calls in TypeScript-like files using their literal source titles and call-expression line ranges. This makes test-heavy folders informative without adding code excerpts, and releases @davstack/meta 0.1.6.
npx explore tries to fetch a nonexistent npm package; the CLI ships as a pnpm-global linked binary. Regenerated init copy via gen:init-skills.
Remove pipe and .safeCall; drop @trpc/server + superjson deps. Use @davstack/try-catch for Result-style calls and the adapter packages for transport. BREAKING (major).
Zero-dep tryCatch(promiseOrThunk) -> { data, error } Result wrapper.
initProcedureFactory turns a fn into a tRPC query/mutation procedure.
initProcedureFactory turns a fn into an oRPC procedure (maps context -> ctx).
Rewrite README for v2 (createFn/initCreateFn/middleware/FnError/tryCatch + adapters); add fn-error and pipe-vs-middleware eval notes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Makes
@davstack/fna dependency-free, transport-agnostic core and splits transport + Result handling into separate companion packages.Breaking (
@davstack/fn→ major).safeCall— usetryCatchfrom@davstack/try-catch:const { data, error } = await tryCatch(() => myFn({ input, ctx })).Resulttype (now in@davstack/try-catch).pipeexport (dead code; the middleware array is strictly more capable).initProcedureFactory) to@davstack/fn-trpc.@trpc/server+superjsonfrom dependencies (superjsonwas unused; tRPC moved to the adapter). Core now has zero runtime deps.New packages
@davstack/try-catch— zero-deptryCatch(promiseOrThunk) → { data, error }Result wrapper.@davstack/fn-trpc—initProcedureFactory(t.procedure)turns a fn into a tRPC query/mutation procedure.@davstack/fn-orpc—initProcedureFactory(os)turns a fn into an oRPC procedure (maps oRPCcontext→ fnctx; chain.route()for OpenAPI).Docs / notes
fnREADME for v2 (createFn / initCreateFn / middleware / FnError / tryCatch + adapters).Testing
fn(49),fn-trpc(2),fn-orpc(8),try-catch(6) — no type errors.tsc --noEmit) and build (tsup ESM +.d.ts).FnErrorpropagation, input/output validation, and type-level inference.Notes
fnmajor; the three new ones minor) — versioning happens at publish viachangeset version.